handler-playable-sdk 0.3.49 → 0.3.51
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/{chunk-TY4466XH.js → chunk-YDMSBKAK.js} +3 -2
- package/dist/cli/brand-dna.mjs +1 -1
- package/dist/cli/canva-import.mjs +1 -1
- package/dist/cli/cleanup-assets.mjs +1 -1
- package/dist/cli/fix-scales.mjs +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/screen-helper.mjs +1 -1
- package/dist/cli/setup-library.mjs +1 -1
- package/dist/cli/student-helper.mjs +1 -1
- package/dist/cli/sync-screens.mjs +1 -1
- package/dist/cli/validate-assets.mjs +1 -1
- package/dist/cli/validate.mjs +1 -1
- package/dist/index.cjs +3 -2
- package/dist/index.js +1 -1
- package/dist/pixi/index.cjs +1 -1
- package/dist/pixi/index.js +1 -1
- package/dist/three/index.cjs +1 -1
- package/dist/three/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
<button class="debug-btn primary" data-modal-apply>Apply</button>
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
|
-
`,this.modal=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 a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let r=this.modal.querySelector("[data-modal-apply]");r==null||r.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let t=window.__openAiEditor;if(typeof t!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";e==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,t(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var pl={};gt(pl,{COLORS:()=>le,ConfigWatcher:()=>$e,DebugPanel:()=>kt,DefaultReloadStrategy:()=>Ct,Handler:()=>ne,PlayableLoadingScreen:()=>Un,PreviewShell:()=>Hn,STROKE_WIDTH:()=>hs,THEME:()=>ms,applyConfigOverride:()=>Ae,applyConfigOverrides:()=>Se,applyConfigsToDisk:()=>Et,applyDefaults:()=>De,baseLottie:()=>ai,bootstrap:()=>el,clearConfigOverrides:()=>Ce,clearConfigOverridesForObject:()=>mr,configOverrideManager:()=>br,createPreviewShell:()=>oa,deepClone:()=>G,default:()=>Oe,defaultPreset:()=>pn,deviceGroups:()=>Mi,devicePresets:()=>Pi,diffConfigs:()=>Ai,exportConfigsAsJSON:()=>wt,getConfigOverrides:()=>Y,getConfigStateSummary:()=>an,getOverrideMode:()=>xt,getPresetById:()=>ze,getPresetsByCategory:()=>Oo,loadAllObjectConfigs:()=>on,loadComponentSchemas:()=>sn,loadEngineConfig:()=>ln,loadGamePromptConfig:()=>xi,loadObjectCentricConfig:()=>me,loadObjectConfig:()=>Le,loadSceneConfig:()=>cn,rehydrateObject:()=>Si,removeConfigOverride:()=>nn,resetToApplied:()=>At,resetToOriginal:()=>rn,setBootstrapDependencies:()=>Zo,setOverrideMode:()=>bi,setupHotReload:()=>Ti,setupLiveEditBridge:()=>Bn,toLegacyFormat:()=>wi,validateObjectConfig:()=>Je});module.exports=$s(pl);var xe={};function Ft(i,e,t=!1){xe[i]||(xe[i]=[]),xe[i].push({fn:e,once:t})}function ei(i,e){if(xe[i]){if(!e){delete xe[i];return}xe[i]=xe[i].filter(t=>t.fn!==e)}}function Ut(i,...e){let t=xe[i];if(t)for(let n of[...t])n.fn(...e),n.once&&ei(i,n.fn)}function X(i,e){Ft(i,e,!0)}var F=null,ee=[],Ve=null;function La(i){F=i,ee=[],Ve!==null&&(clearTimeout(Ve),Ve=null)}function Ta(){var i,e,t;return{endpoint:(F==null?void 0:F.endpoint)||"",transport:(F==null?void 0:F.transport)||"beacon",batchSize:(i=F==null?void 0:F.batchSize)!=null?i:10,flushIntervalMs:(e=F==null?void 0:F.flushIntervalMs)!=null?e:300,maxQueue:(t=F==null?void 0:F.maxQueue)!=null?t:200,debug:!!(F!=null&&F.debug)}}async function Sa(i,e,t,n){let a=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let r=navigator.sendBeacon(i,new Blob([a],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",r,e);return}catch(r){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",r)}try{await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",e)}catch(r){n&&console.warn("[handler.telemetry] fetch failed",r)}}function ti(i,e){let t=Ta();if(e&&t.endpoint){if(ee.push(i),ee.length>t.maxQueue&&(ee=ee.slice(ee.length-t.maxQueue)),ee.length>=t.batchSize){Ca();return}Ve===null&&(Ve=window.setTimeout(()=>{Ve=null,Ca()},t.flushIntervalMs))}}async function Ca(){let i=Ta();if(!i.endpoint||ee.length===0)return;let e=ee.splice(0,i.batchSize);await Sa(i.endpoint,{events:e},i.transport,i.debug),ee.length>0&&await Sa(i.endpoint,{events:ee.splice(0,i.batchSize)},i.transport,i.debug)}function _a(i){return Math.max(0,Math.min(1,i))}function zs(i){let e=String(i!=null?i:"power2.out");if(e==="linear")return t=>t;if(e==="sine.inOut")return t=>.5-Math.cos(Math.PI*t)/2;if(e==="power2.out"||e==="easeOutQuad")return t=>1-(1-t)*(1-t);if(e.startsWith("back.out")){let t=e.match(/back\.out\(([\d.]+)\)/),n=t?Number(t[1]):1.8;return a=>1+(n+1)*Math.pow(a-1,3)+n*Math.pow(a-1,2)}return t=>1-(1-t)*(1-t)}function ft(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ns(i,e){let t=i==null?void 0:i[e];return typeof t=="number"?t:0}function Pa(i,e,t){try{i[e]=t}catch{}}function Hs(i){let e=i==null?void 0:i.scale;if(!e)return null;let t=typeof e.x=="number"?e.x:1,n=typeof e.y=="number"?e.y:1;return{x:t,y:n}}function Ma(i,e){let t=i==null?void 0:i.scale;if(t)try{typeof t.set=="function"?t.set(e.x,e.y):(typeof t.x=="number"&&(t.x=e.x),typeof t.y=="number"&&(t.y=e.y))}catch{}}function ka(i,e){let t=Hs(i);if(!t)return{from:null,to:null};let n=null,a=null;return typeof e.scale=="number"?(n=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(n=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(n=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),n===null&&a===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:n!=null?n:t.x,y:a!=null?a:t.y}}}function Oa(){let i=new Set,e=new WeakMap,t=null,n=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),i.size>0&&n()})},a=p=>{var u;i.add(p);let d=(u=e.get(p.target))!=null?u:new Set;d.add(p),e.set(p.target,d),n()},r=p=>{i.delete(p);let d=e.get(p.target);d&&(d.delete(p),d.size===0&&e.delete(p.target))},s=p=>{p.killed||(p.killed=!0,r(p))},o=()=>{var d,u;let p=ft();for(let g of Array.from(i)){if(g.killed||g.paused)continue;let h=p-g.startMs-g.delayMs;if(h<0)continue;let f=g.durationMs>0?h/g.durationMs:1,m=_a(f),b=g.repeat>=0?g.repeat+1:1,y=g.repeat>0?Math.min(Math.floor(f),b-1):0;if(g.repeat>0&&f>=1){let E=f-y;m=_a(E)}let v=g.ease(m);g.yoyo&&y%2===1&&(v=1-v);for(let E of g.props)Pa(g.target,E.key,E.from+(E.to-E.from)*v);g.scaleFrom&&g.scaleTo&&Ma(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*v,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*v});try{(d=g.onUpdate)==null||d.call(g)}catch{}if(f>=b){s(g);try{(u=g.onComplete)==null||u.call(g)}catch{}}}},l=(p,d,u)=>{var E;let g=Math.max(0,(typeof d.duration=="number"?d.duration:.5)*1e3),h=Math.max(0,(typeof d.delay=="number"?d.delay:0)*1e3+((E=u==null?void 0:u.delayMsOverride)!=null?E:0)),f=zs(d.ease),m=typeof d.repeat=="number"?Math.max(0,d.repeat|0):0,b=d.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),v=[];for(let w of Object.keys(d)){if(y.has(w))continue;let T=d[w];typeof T=="number"&&v.push({key:w,from:Ns(p,w),to:T})}let x=ka(p,d);return{target:p,startMs:ft(),delayMs:h,durationMs:g,ease:f,props:v,scaleFrom:x.from,scaleTo:x.to,repeat:m,yoyo:b,onUpdate:typeof d.onUpdate=="function"?d.onUpdate:void 0,onComplete:typeof d.onComplete=="function"?d.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(p,d){let u=l(p,d);return a(u),{kill:()=>s(u),pause:()=>{u.paused||(u.paused=!0,u.pauseAtMs=ft())},resume:()=>{var f;if(!u.paused)return;let g=(f=u.pauseAtMs)!=null?f:ft(),h=ft()-g;u.startMs+=h,u.paused=!1,u.pauseAtMs=null},isActive:()=>!u.killed&&!u.paused}},fromTo(p,d,u){return c.set(p,d),c.to(p,u)},set(p,d){if(!p||!d)return;for(let g of Object.keys(d)){let h=d[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof h=="number"&&Pa(p,g,h)}let u=ka(p,d);u.to&&Ma(p,u.to)},killTweensOf(p){let d=e.get(p);if(d)for(let u of Array.from(d))s(u)},timeline(p={}){let d=[],u=0,g=!1,h=[],f=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let v=typeof y=="string"?y.trim():"";return v.startsWith("+=")?u+Math.max(0,Number(v.slice(2))*1e3||0):v?Math.max(0,Number(v)*1e3||0):u},m=y=>{d.push(y);let v=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);u=Math.max(u,y.atMs+v)},b={to(y,v,x){return m({kind:"to",target:y,vars:v,atMs:f(x)}),b},fromTo(y,v,x,E){return m({kind:"fromTo",target:y,vars:x,from:v,atMs:f(E)}),b},play(){var y,v;if(g)return b;g=!0,h=[];for(let x of d)x.kind==="fromTo"&&c.set(x.target,(y=x.from)!=null?y:{}),h.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 h)y.pause();return b},kill(){for(let y of h)y.kill();h=[],g=!1}};return p.paused||b.play(),b}};return c}function Ia(){if(typeof window=="undefined")return;let i=window;if(!i.gsap)try{i.gsap=Oa()}catch{}}var Ra={name:"handler-playable-sdk",version:"0.3.49",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var J=0,Fs=J++,ja=J++,Da=J++,$a=J++,za=J++,Na=J++,Ha=J++,Ba=J++,Fa=J++,Ua=J++,Ga=J++,qa=J++,H=Fs;function Va(){return H===ja}function Wa(){return H===Da}function Ya(){return H===$a}function Ka(){return H===za}function We(){return H===Na}function Ye(){return H===Ha}function Xa(){return H===Ba}function Ja(){return H===Fa}function Za(){return H===Ua}function ni(){return H===Ga}function ii(){return H===qa}function Qa(){let i=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(i==="mraid")try{mraid.getState(),H=ja;return}catch{}else if(i==="dapi")try{dapi.isReady(),H=Da;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(H=$a)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(H=za)}catch{}else if(e==="mintegral")window.gameReady&&(H=Na);else if(e==="tapjoy")window.TJ_API&&(H=Ha);else if(e==="tiktok")window.openAppStore&&(H=Ba);else if(e==="smadex")try{window.smxTracking&&(H=Fa)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(H=Ua)}catch{}else e==="vungle"?H=Ga:(i==="nucleo"||e==="nucleo")&&(H=qa)}var Gt=qe(require("lottie-web"),1),ai=Gt.default;typeof window!="undefined"&&(window.lottie=Gt.default,window.__baseLottie=Gt.default);var Us=require("pixi.js");var ri=require("pixi.js");var Gs=null;function si(i){Gs=i}qt();oi();var ht=require("pixi.js");qt();var Xs=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",pi=Xs;if(typeof window!="undefined")try{let i=new XMLHttpRequest;if(i.open("GET","./build-settings.json",!1),i.send(),i.status===200&&i.responseText){let e=JSON.parse(i.responseText);e!=null&&e.buildMode&&(pi=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${pi}`))}}catch{}function Js(i){var t,n,a,r,s;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(i);let e={center:{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};if(Array.isArray(i))return{x:(t=i[0])!=null?t:.5,y:(n=i[1])!=null?n:.5};if(i&&typeof i=="object"&&"x"in i&&"y"in i)return{x:(a=i.x)!=null?a:.5,y:(r=i.y)!=null?r:.5};if(typeof i=="string"){let o=i.trim().toLowerCase();return(s=e[o])!=null?s:{x:.5,y:.5}}return null}var Ee=class{static async create(e,t,n){var l,c,p,d,u,g,h;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${pi}`);let a=(l=t==null?void 0:t.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let f=new ht.Container;return this.applyTransform(f,t==null?void 0:t.transform,t),f}let r=(c=t==null?void 0:t.identity)==null?void 0:c.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${r}, type: ${a.type}, path: ${a.path}`);let s=await Re.load(e,a,n,r);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=s==null?void 0:s.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",s,"for object:",e),o=new ht.Sprite(s),console.log("[ObjectFactory] Created object:",o,"type:",(d=o==null?void 0:o.constructor)==null?void 0:d.name),this.applyTransform(o,t==null?void 0:t.transform,t);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(u=s==null?void 0:s.constructor)==null?void 0:u.name,s),s&&(((g=s.constructor)==null?void 0:g.name)==="Container"||s instanceof ht.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let f=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],m=!1;for(let b of f)try{let y=await fetch(b);if(y.ok){o=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",b,"type:",(h=o==null?void 0:o.constructor)==null?void 0:h.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,t==null?void 0:t.transform,t);return o}static applyTransform(e,t,n){var a,r,s,o;if(!(!t||!e)&&(t.position&&("x"in e&&"y"in e?(e.x=(a=t.position.x)!=null?a:0,e.y=(r=t.position.y)!=null?r:0):"position"in e&&e.position&&e.position.set((s=t.position.x)!=null?s:0,(o=t.position.y)!=null?o:0)),t.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(t.scale):e.scale=t.scale),t.rotation!==void 0&&"rotation"in e&&(e.rotation=t.rotation),t.anchor&&"anchor"in e&&e.anchor)){let l=Js(t.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var mt=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var eo=qe(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=eo);Ke();var Vt=require("pixi.js");Ke();var fi=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new mt}init(e,t){this.registry.init(e),this.app=t}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let t=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(t.length===0)return;let n=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async r=>{var o;let s=this.registry.get(r);if(!s){console.warn("[Assets] No config found for object:",r);return}try{let l=await Ee.create(r,s,this.app);this.instanceCache.set(r,l),console.log("[Assets] Loaded object:",r,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",r,l)}})))};return this.readyPromise=(async()=>{await n(t);let a=this.registry.getAllIds().filter(r=>!this.instanceCache.has(r));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await n(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let t=this.registry.get(e);if(t){let n=await Ee.create(e,t,this.app);this.instanceCache.set(e,n)}}get(e){return this.instanceCache.get(e)}},to=new fi,no=new Proxy(to,{get(i,e){if(e in i&&typeof i[e]=="function")return i[e].bind(i);if(i.get(e))return i.get(e)}});Ke();var rr=require("pixi.js"),ge={width:400,height:600,designWidth:400,scaleFactor:1},Yt={scale:1,position:1},mi=[];function ao(i,e,t,n,a,r,s){mi.push({element:i,originalScale:r,positionHelper:e,heightPercent:a}),e(i,t,n,a,r,s,!1)}function ro(){mi.forEach(({element:i,originalScale:e,positionHelper:t,heightPercent:n})=>{let a=e*ge.scaleFactor;t(i,ge.width,ge.height,n,a,!0,!1)})}function hi(i,e){console.log(`[SCREEN] updateScreenState called: ${i}x${e}`),ge.width=i,ge.height=e,ge.scaleFactor=Math.min(i/ge.designWidth,1.15),Yt.scale=ge.scaleFactor,Yt.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Yt.scale.toFixed(3)}`),ro()}var yt={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 so(i,e,t){let n=yt[i];n&&n[e]!==void 0&&(n[e]=t,console.log(`Updated ${i}.${e} = ${t}`))}function oo(){return yt}var lo={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 Wt(i,e){return typeof i=="number"&&Number.isFinite(i)?i:e}function Kt(i,e={x:.5,y:.5}){var t;if(Array.isArray(i))return{x:Wt(i[0],e.x),y:Wt(i[1],e.y)};if(i&&typeof i=="object"){let n=i;return{x:Wt(n.x,e.x),y:Wt(n.y,e.y)}}if(typeof i=="string"){let n=i.trim().toLowerCase();return(t=lo[n])!=null?t:e}return e}function sr(i,e,t,n={}){var g,h,f,m,b,y;let a=Kt(t),r=(g=n.inset)!=null?g:{},s=(h=n.padding)!=null?h:{x:0,y:0},o=((f=r.left)!=null?f:0)+s.x,l=((m=r.right)!=null?m:0)+s.x,c=((b=r.top)!=null?b:0)+s.y,p=((y=r.bottom)!=null?y:0)+s.y,d=Math.max(0,i-o-l),u=Math.max(0,e-c-p);return{x:o+d*a.x,y:c+u*a.y}}function or(i,e,t,n={}){var f,m,b,y,v,x;let a=(f=n.inset)!=null?f:{},r=(m=n.padding)!=null?m:{x:0,y:0},s=((b=a.left)!=null?b:0)+r.x,o=((y=a.right)!=null?y:0)+r.x,l=((v=a.top)!=null?v:0)+r.y,c=((x=a.bottom)!=null?x:0)+r.y,p=Math.max(0,i-s-o),d=Math.max(0,e-l-c),u=Kt(t,{x:.5,y:.5}),g=Math.min(Math.max(u.x,0),1),h=Math.min(Math.max(u.y,0),1);return{x:s+p*g,y:l+d*h}}if(typeof window!="undefined"){let i=window.innerWidth,e=window.innerHeight,t=()=>{let n=window.innerWidth,a=window.innerHeight;(n!==i||a!==e)&&(i=n,e=a,hi(n,a))};window.addEventListener("resize",t),window.addEventListener("orientationchange",()=>{setTimeout(t,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",t),window.mraid.addEventListener("sizeChange",t)),hi(window.innerWidth,window.innerHeight),window.updateDebugConfig=so,window.getDebugConfig=oo,window.copyConfig=xo,window.applyConfig=bt,window.applyConfigForRatio=wo,window.positionAtBottom=lr,window.positionAtTop=uo,window.positionAtCenter=go,window.positionAtLeft=fo,window.positionAtRight=ho,window.positionAtBottomLeft=mo,window.positionAtBottomRight=bo,window.positionAtTopLeft=yo,window.positionAtTopRight=vo,window.applyPositionContract=po,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 Xt(i,e,t=0){return i*e+t}function Jt(i,e,t=0){return i*(1-e)+t}function Zt(i,e,t=0){return i*e+t}function Qt(i,e,t=0){return i*(1-e)+t}function Z(i,e=0){return i/2+e}function co(i,e){return i*e}function po(i,e,t,n){var s,o,l,c,p,d,u,g,h,f,m,b,y,v,x,E,w,T,S,O;let a=0,r=0;switch(n.type){case"top":a=Z(e,(o=(s=n.offset)==null?void 0:s.x)!=null?o:0),r=Xt(t,n.percent,(c=(l=n.offset)==null?void 0:l.y)!=null?c:0);break;case"bottom":a=Z(e,(d=(p=n.offset)==null?void 0:p.x)!=null?d:0),r=Jt(t,n.percent,(g=(u=n.offset)==null?void 0:u.y)!=null?g:0);break;case"left":a=Zt(e,n.percent,(f=(h=n.offset)==null?void 0:h.x)!=null?f:0),r=Z(t,(b=(m=n.offset)==null?void 0:m.y)!=null?b:0);break;case"right":a=Qt(e,n.percent,(v=(y=n.offset)==null?void 0:y.x)!=null?v:0),r=Z(t,(E=(x=n.offset)==null?void 0:x.y)!=null?E:0);break;case"center":a=Z(e,(T=(w=n.offset)==null?void 0:w.x)!=null?T:0),r=Z(t,(O=(S=n.offset)==null?void 0:S.y)!=null?O:0);break}i.position?i.position.set(a,r):(i.x=a,i.y=r),n.scale!==void 0&&n.scale!==1&&i.scale&&(typeof i.scale.set=="function"?i.scale.set(n.scale,n.scale):(i.scale.x=n.scale,i.scale.y=n.scale))}function lr(i,e,t,n=.2,a=1,r=!0,s=!1){let o=co(t,n),l=Jt(t,n/2);fe(i,Z(e),l);let c=r?a*ge.scaleFactor:a;he(i,c),s&&!mi.find(p=>p.element===i)&&ao(i,lr,e,t,n,a,r)}function uo(i,e,t,n=.1,a=1){fe(i,Z(e),Xt(t,n)),he(i,a)}function go(i,e,t,n=0,a=0,r=1){fe(i,Z(e,n),Z(t,a)),he(i,r)}function fo(i,e,t,n=.1,a=1){fe(i,Zt(e,n),Z(t)),he(i,a)}function ho(i,e,t,n=.1,a=1){fe(i,Qt(e,n),Z(t)),he(i,a)}function mo(i,e,t,n=.05,a=.05,r=1){fe(i,Zt(e,a),Jt(t,n)),he(i,r)}function bo(i,e,t,n=.05,a=.05,r=1){fe(i,Qt(e,a),Jt(t,n)),he(i,r)}function yo(i,e,t,n=.05,a=.05,r=1){fe(i,Zt(e,a),Xt(t,n)),he(i,r)}function vo(i,e,t,n=.05,a=.05,r=1){fe(i,Qt(e,a),Xt(t,n)),he(i,r)}function fe(i,e,t){i&&i.position?typeof i.position.set=="function"?i.position.set(e,t):(i.position.x=e,i.position.y=t):i&&(i.x=e,i.y=t)}function he(i,e){e!==1&&i&&i.scale&&(typeof i.scale.set=="function"?i.scale.set(e,e):i.scale.x!==void 0&&i.scale.y!==void 0&&(i.scale.x=e,i.scale.y=e))}var je={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 xo(i){return i&&je[i]?JSON.parse(JSON.stringify(je[i])):JSON.parse(JSON.stringify(yt))}function bt(i){Object.keys(i).forEach(e=>{let t=e;yt[t]&&i[t]&&Object.assign(yt[t],i[t])}),console.log("Config applied:",i)}function wo(i,e){let t=i/e;t>1.6?(bt(je.wide),console.log("Applied WIDE config for ratio:",t)):t<.7?(bt(je.tall),console.log("Applied TALL config for ratio:",t)):t>.8&&t<1.2?(bt(je.square),console.log("Applied SQUARE config for ratio:",t)):(bt(je.default),console.log("Applied DEFAULT config for ratio:",t))}if(typeof window!="undefined"){let i=window;i.configPresets=je,i.resolveAnchorVec2=i.resolveAnchorVec2||Kt,i.resolveScreenAnchorPoint=i.resolveScreenAnchorPoint||sr,i.resolveScreenRatioPoint=i.resolveScreenRatioPoint||or}dn();function U(i,e){let t=(a,r)=>r===0?a:t(r,a%r),n=t(i,e);return`${i/n}:${e/n}`}var Nc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:U(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:U(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:U(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:U(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:U(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:U(360,780)}],Hc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:U(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:U(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:U(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:U(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:U(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:U(412,915)}],Bc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:U(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:U(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:U(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:U(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:U(800,1280)}],_i=[{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:U(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:U(768,1024),mraidScale:.7}];var Pi=[..._i],Mi=[{category:"playable",label:"Playable Ad",devices:_i}],pn=_i[0];function ze(i){return Pi.find(e=>e.id===i)||pn}function Oo(i){return Pi.filter(e=>e.category===i)}var un=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`
|
|
46
|
+
`,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 a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let r=this.modal.querySelector("[data-modal-apply]");r==null||r.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let t=window.__openAiEditor;if(typeof t!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";e==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,t(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var pl={};gt(pl,{COLORS:()=>le,ConfigWatcher:()=>$e,DebugPanel:()=>kt,DefaultReloadStrategy:()=>Ct,Handler:()=>ne,PlayableLoadingScreen:()=>Un,PreviewShell:()=>Hn,STROKE_WIDTH:()=>hs,THEME:()=>ms,applyConfigOverride:()=>Ae,applyConfigOverrides:()=>Se,applyConfigsToDisk:()=>Et,applyDefaults:()=>De,baseLottie:()=>ai,bootstrap:()=>el,clearConfigOverrides:()=>Ce,clearConfigOverridesForObject:()=>mr,configOverrideManager:()=>br,createPreviewShell:()=>oa,deepClone:()=>G,default:()=>Oe,defaultPreset:()=>pn,deviceGroups:()=>Mi,devicePresets:()=>Pi,diffConfigs:()=>Ai,exportConfigsAsJSON:()=>wt,getConfigOverrides:()=>Y,getConfigStateSummary:()=>an,getOverrideMode:()=>xt,getPresetById:()=>ze,getPresetsByCategory:()=>Oo,loadAllObjectConfigs:()=>on,loadComponentSchemas:()=>sn,loadEngineConfig:()=>ln,loadGamePromptConfig:()=>xi,loadObjectCentricConfig:()=>me,loadObjectConfig:()=>Le,loadSceneConfig:()=>cn,rehydrateObject:()=>Si,removeConfigOverride:()=>nn,resetToApplied:()=>At,resetToOriginal:()=>rn,setBootstrapDependencies:()=>Zo,setOverrideMode:()=>bi,setupHotReload:()=>Ti,setupLiveEditBridge:()=>Bn,toLegacyFormat:()=>wi,validateObjectConfig:()=>Je});module.exports=$s(pl);var xe={};function Ft(i,e,t=!1){xe[i]||(xe[i]=[]),xe[i].push({fn:e,once:t})}function ei(i,e){if(xe[i]){if(!e){delete xe[i];return}xe[i]=xe[i].filter(t=>t.fn!==e)}}function Ut(i,...e){let t=xe[i];if(t)for(let n of[...t])n.fn(...e),n.once&&ei(i,n.fn)}function X(i,e){Ft(i,e,!0)}var F=null,ee=[],Ve=null;function La(i){F=i,ee=[],Ve!==null&&(clearTimeout(Ve),Ve=null)}function Ta(){var i,e,t;return{endpoint:(F==null?void 0:F.endpoint)||"",transport:(F==null?void 0:F.transport)||"beacon",batchSize:(i=F==null?void 0:F.batchSize)!=null?i:10,flushIntervalMs:(e=F==null?void 0:F.flushIntervalMs)!=null?e:300,maxQueue:(t=F==null?void 0:F.maxQueue)!=null?t:200,debug:!!(F!=null&&F.debug)}}async function Sa(i,e,t,n){let a=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let r=navigator.sendBeacon(i,new Blob([a],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",r,e);return}catch(r){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",r)}try{await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",e)}catch(r){n&&console.warn("[handler.telemetry] fetch failed",r)}}function ti(i,e){let t=Ta();if(e&&t.endpoint){if(ee.push(i),ee.length>t.maxQueue&&(ee=ee.slice(ee.length-t.maxQueue)),ee.length>=t.batchSize){Ca();return}Ve===null&&(Ve=window.setTimeout(()=>{Ve=null,Ca()},t.flushIntervalMs))}}async function Ca(){let i=Ta();if(!i.endpoint||ee.length===0)return;let e=ee.splice(0,i.batchSize);await Sa(i.endpoint,{events:e},i.transport,i.debug),ee.length>0&&await Sa(i.endpoint,{events:ee.splice(0,i.batchSize)},i.transport,i.debug)}function _a(i){return Math.max(0,Math.min(1,i))}function zs(i){let e=String(i!=null?i:"power2.out");if(e==="linear")return t=>t;if(e==="sine.inOut")return t=>.5-Math.cos(Math.PI*t)/2;if(e==="power2.out"||e==="easeOutQuad")return t=>1-(1-t)*(1-t);if(e.startsWith("back.out")){let t=e.match(/back\.out\(([\d.]+)\)/),n=t?Number(t[1]):1.8;return a=>1+(n+1)*Math.pow(a-1,3)+n*Math.pow(a-1,2)}return t=>1-(1-t)*(1-t)}function ft(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ns(i,e){let t=i==null?void 0:i[e];return typeof t=="number"?t:0}function Pa(i,e,t){try{i[e]=t}catch{}}function Hs(i){let e=i==null?void 0:i.scale;if(!e)return null;let t=typeof e.x=="number"?e.x:1,n=typeof e.y=="number"?e.y:1;return{x:t,y:n}}function Ma(i,e){let t=i==null?void 0:i.scale;if(t)try{typeof t.set=="function"?t.set(e.x,e.y):(typeof t.x=="number"&&(t.x=e.x),typeof t.y=="number"&&(t.y=e.y))}catch{}}function ka(i,e){let t=Hs(i);if(!t)return{from:null,to:null};let n=null,a=null;return typeof e.scale=="number"?(n=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(n=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(n=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),n===null&&a===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:n!=null?n:t.x,y:a!=null?a:t.y}}}function Oa(){let i=new Set,e=new WeakMap,t=null,n=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),i.size>0&&n()})},a=p=>{var u;i.add(p);let d=(u=e.get(p.target))!=null?u:new Set;d.add(p),e.set(p.target,d),n()},r=p=>{i.delete(p);let d=e.get(p.target);d&&(d.delete(p),d.size===0&&e.delete(p.target))},s=p=>{p.killed||(p.killed=!0,r(p))},o=()=>{var d,u;let p=ft();for(let g of Array.from(i)){if(g.killed||g.paused)continue;let h=p-g.startMs-g.delayMs;if(h<0)continue;let f=g.durationMs>0?h/g.durationMs:1,m=_a(f),b=g.repeat>=0?g.repeat+1:1,y=g.repeat>0?Math.min(Math.floor(f),b-1):0;if(g.repeat>0&&f>=1){let E=f-y;m=_a(E)}let v=g.ease(m);g.yoyo&&y%2===1&&(v=1-v);for(let E of g.props)Pa(g.target,E.key,E.from+(E.to-E.from)*v);g.scaleFrom&&g.scaleTo&&Ma(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*v,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*v});try{(d=g.onUpdate)==null||d.call(g)}catch{}if(f>=b){s(g);try{(u=g.onComplete)==null||u.call(g)}catch{}}}},l=(p,d,u)=>{var E;let g=Math.max(0,(typeof d.duration=="number"?d.duration:.5)*1e3),h=Math.max(0,(typeof d.delay=="number"?d.delay:0)*1e3+((E=u==null?void 0:u.delayMsOverride)!=null?E:0)),f=zs(d.ease),m=typeof d.repeat=="number"?Math.max(0,d.repeat|0):0,b=d.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),v=[];for(let w of Object.keys(d)){if(y.has(w))continue;let T=d[w];typeof T=="number"&&v.push({key:w,from:Ns(p,w),to:T})}let x=ka(p,d);return{target:p,startMs:ft(),delayMs:h,durationMs:g,ease:f,props:v,scaleFrom:x.from,scaleTo:x.to,repeat:m,yoyo:b,onUpdate:typeof d.onUpdate=="function"?d.onUpdate:void 0,onComplete:typeof d.onComplete=="function"?d.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(p,d){let u=l(p,d);return a(u),{kill:()=>s(u),pause:()=>{u.paused||(u.paused=!0,u.pauseAtMs=ft())},resume:()=>{var f;if(!u.paused)return;let g=(f=u.pauseAtMs)!=null?f:ft(),h=ft()-g;u.startMs+=h,u.paused=!1,u.pauseAtMs=null},isActive:()=>!u.killed&&!u.paused}},fromTo(p,d,u){return c.set(p,d),c.to(p,u)},set(p,d){if(!p||!d)return;for(let g of Object.keys(d)){let h=d[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof h=="number"&&Pa(p,g,h)}let u=ka(p,d);u.to&&Ma(p,u.to)},killTweensOf(p){let d=e.get(p);if(d)for(let u of Array.from(d))s(u)},timeline(p={}){let d=[],u=0,g=!1,h=[],f=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let v=typeof y=="string"?y.trim():"";return v.startsWith("+=")?u+Math.max(0,Number(v.slice(2))*1e3||0):v?Math.max(0,Number(v)*1e3||0):u},m=y=>{d.push(y);let v=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);u=Math.max(u,y.atMs+v)},b={to(y,v,x){return m({kind:"to",target:y,vars:v,atMs:f(x)}),b},fromTo(y,v,x,E){return m({kind:"fromTo",target:y,vars:x,from:v,atMs:f(E)}),b},play(){var y,v;if(g)return b;g=!0,h=[];for(let x of d)x.kind==="fromTo"&&c.set(x.target,(y=x.from)!=null?y:{}),h.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 h)y.pause();return b},kill(){for(let y of h)y.kill();h=[],g=!1}};return p.paused||b.play(),b}};return c}function Ia(){if(typeof window=="undefined")return;let i=window;if(!i.gsap)try{i.gsap=Oa()}catch{}}var Ra={name:"handler-playable-sdk",version:"0.3.51",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var J=0,Fs=J++,ja=J++,Da=J++,$a=J++,za=J++,Na=J++,Ha=J++,Ba=J++,Fa=J++,Ua=J++,Ga=J++,qa=J++,H=Fs;function Va(){return H===ja}function Wa(){return H===Da}function Ya(){return H===$a}function Ka(){return H===za}function We(){return H===Na}function Ye(){return H===Ha}function Xa(){return H===Ba}function Ja(){return H===Fa}function Za(){return H===Ua}function ni(){return H===Ga}function ii(){return H===qa}function Qa(){let i=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(i==="mraid")try{mraid.getState(),H=ja;return}catch{}else if(i==="dapi")try{dapi.isReady(),H=Da;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(H=$a)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(H=za)}catch{}else if(e==="mintegral")window.gameReady&&(H=Na);else if(e==="tapjoy")window.TJ_API&&(H=Ha);else if(e==="tiktok")window.openAppStore&&(H=Ba);else if(e==="smadex")try{window.smxTracking&&(H=Fa)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(H=Ua)}catch{}else e==="vungle"?H=Ga:(i==="nucleo"||e==="nucleo")&&(H=qa)}var Gt=qe(require("lottie-web"),1),ai=Gt.default;typeof window!="undefined"&&(window.lottie=Gt.default,window.__baseLottie=Gt.default);var Us=require("pixi.js");var ri=require("pixi.js");var Gs=null;function si(i){Gs=i}qt();oi();var ht=require("pixi.js");qt();var Xs=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",pi=Xs;if(typeof window!="undefined")try{let i=new XMLHttpRequest;if(i.open("GET","./build-settings.json",!1),i.send(),i.status===200&&i.responseText){let e=JSON.parse(i.responseText);e!=null&&e.buildMode&&(pi=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${pi}`))}}catch{}function Js(i){var t,n,a,r,s;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(i);let e={center:{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};if(Array.isArray(i))return{x:(t=i[0])!=null?t:.5,y:(n=i[1])!=null?n:.5};if(i&&typeof i=="object"&&"x"in i&&"y"in i)return{x:(a=i.x)!=null?a:.5,y:(r=i.y)!=null?r:.5};if(typeof i=="string"){let o=i.trim().toLowerCase();return(s=e[o])!=null?s:{x:.5,y:.5}}return null}var Ee=class{static async create(e,t,n){var l,c,p,d,u,g,h;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${pi}`);let a=(l=t==null?void 0:t.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let f=new ht.Container;return this.applyTransform(f,t==null?void 0:t.transform,t),f}let r=(c=t==null?void 0:t.identity)==null?void 0:c.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${r}, type: ${a.type}, path: ${a.path}`);let s=await Re.load(e,a,n,r);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=s==null?void 0:s.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",s,"for object:",e),o=new ht.Sprite(s),console.log("[ObjectFactory] Created object:",o,"type:",(d=o==null?void 0:o.constructor)==null?void 0:d.name),this.applyTransform(o,t==null?void 0:t.transform,t);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(u=s==null?void 0:s.constructor)==null?void 0:u.name,s),s&&(((g=s.constructor)==null?void 0:g.name)==="Container"||s instanceof ht.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let f=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],m=!1;for(let b of f)try{let y=await fetch(b);if(y.ok){o=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",b,"type:",(h=o==null?void 0:o.constructor)==null?void 0:h.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,t==null?void 0:t.transform,t);return o}static applyTransform(e,t,n){var a,r,s,o;if(!(!t||!e)&&(t.position&&("x"in e&&"y"in e?(e.x=(a=t.position.x)!=null?a:0,e.y=(r=t.position.y)!=null?r:0):"position"in e&&e.position&&e.position.set((s=t.position.x)!=null?s:0,(o=t.position.y)!=null?o:0)),t.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(t.scale):e.scale=t.scale),t.rotation!==void 0&&"rotation"in e&&(e.rotation=t.rotation),t.anchor&&"anchor"in e&&e.anchor)){let l=Js(t.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var mt=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var eo=qe(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=eo);Ke();var Vt=require("pixi.js");Ke();var fi=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new mt}init(e,t){this.registry.init(e),this.app=t}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let t=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(t.length===0)return;let n=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async r=>{var o;let s=this.registry.get(r);if(!s){console.warn("[Assets] No config found for object:",r);return}try{let l=await Ee.create(r,s,this.app);this.instanceCache.set(r,l),console.log("[Assets] Loaded object:",r,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",r,l)}})))};return this.readyPromise=(async()=>{await n(t);let a=this.registry.getAllIds().filter(r=>!this.instanceCache.has(r));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await n(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let t=this.registry.get(e);if(t){let n=await Ee.create(e,t,this.app);this.instanceCache.set(e,n)}}get(e){return this.instanceCache.get(e)}},to=new fi,no=new Proxy(to,{get(i,e){if(e in i&&typeof i[e]=="function")return i[e].bind(i);if(i.get(e))return i.get(e)}});Ke();var rr=require("pixi.js"),ge={width:400,height:600,designWidth:400,scaleFactor:1},Yt={scale:1,position:1},mi=[];function ao(i,e,t,n,a,r,s){mi.push({element:i,originalScale:r,positionHelper:e,heightPercent:a}),e(i,t,n,a,r,s,!1)}function ro(){mi.forEach(({element:i,originalScale:e,positionHelper:t,heightPercent:n})=>{let a=e*ge.scaleFactor;t(i,ge.width,ge.height,n,a,!0,!1)})}function hi(i,e){console.log(`[SCREEN] updateScreenState called: ${i}x${e}`),ge.width=i,ge.height=e,ge.scaleFactor=Math.min(i/ge.designWidth,1.15),Yt.scale=ge.scaleFactor,Yt.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Yt.scale.toFixed(3)}`),ro()}var yt={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 so(i,e,t){let n=yt[i];n&&n[e]!==void 0&&(n[e]=t,console.log(`Updated ${i}.${e} = ${t}`))}function oo(){return yt}var lo={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 Wt(i,e){return typeof i=="number"&&Number.isFinite(i)?i:e}function Kt(i,e={x:.5,y:.5}){var t;if(Array.isArray(i))return{x:Wt(i[0],e.x),y:Wt(i[1],e.y)};if(i&&typeof i=="object"){let n=i;return{x:Wt(n.x,e.x),y:Wt(n.y,e.y)}}if(typeof i=="string"){let n=i.trim().toLowerCase();return(t=lo[n])!=null?t:e}return e}function sr(i,e,t,n={}){var g,h,f,m,b,y;let a=Kt(t),r=(g=n.inset)!=null?g:{},s=(h=n.padding)!=null?h:{x:0,y:0},o=((f=r.left)!=null?f:0)+s.x,l=((m=r.right)!=null?m:0)+s.x,c=((b=r.top)!=null?b:0)+s.y,p=((y=r.bottom)!=null?y:0)+s.y,d=Math.max(0,i-o-l),u=Math.max(0,e-c-p);return{x:o+d*a.x,y:c+u*a.y}}function or(i,e,t,n={}){var f,m,b,y,v,x;let a=(f=n.inset)!=null?f:{},r=(m=n.padding)!=null?m:{x:0,y:0},s=((b=a.left)!=null?b:0)+r.x,o=((y=a.right)!=null?y:0)+r.x,l=((v=a.top)!=null?v:0)+r.y,c=((x=a.bottom)!=null?x:0)+r.y,p=Math.max(0,i-s-o),d=Math.max(0,e-l-c),u=Kt(t,{x:.5,y:.5}),g=Math.min(Math.max(u.x,0),1),h=Math.min(Math.max(u.y,0),1);return{x:s+p*g,y:l+d*h}}if(typeof window!="undefined"){let i=window.innerWidth,e=window.innerHeight,t=()=>{let n=window.innerWidth,a=window.innerHeight;(n!==i||a!==e)&&(i=n,e=a,hi(n,a))};window.addEventListener("resize",t),window.addEventListener("orientationchange",()=>{setTimeout(t,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",t),window.mraid.addEventListener("sizeChange",t)),hi(window.innerWidth,window.innerHeight),window.updateDebugConfig=so,window.getDebugConfig=oo,window.copyConfig=xo,window.applyConfig=bt,window.applyConfigForRatio=wo,window.positionAtBottom=lr,window.positionAtTop=uo,window.positionAtCenter=go,window.positionAtLeft=fo,window.positionAtRight=ho,window.positionAtBottomLeft=mo,window.positionAtBottomRight=bo,window.positionAtTopLeft=yo,window.positionAtTopRight=vo,window.applyPositionContract=po,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 Xt(i,e,t=0){return i*e+t}function Jt(i,e,t=0){return i*(1-e)+t}function Zt(i,e,t=0){return i*e+t}function Qt(i,e,t=0){return i*(1-e)+t}function Z(i,e=0){return i/2+e}function co(i,e){return i*e}function po(i,e,t,n){var s,o,l,c,p,d,u,g,h,f,m,b,y,v,x,E,w,T,S,O;let a=0,r=0;switch(n.type){case"top":a=Z(e,(o=(s=n.offset)==null?void 0:s.x)!=null?o:0),r=Xt(t,n.percent,(c=(l=n.offset)==null?void 0:l.y)!=null?c:0);break;case"bottom":a=Z(e,(d=(p=n.offset)==null?void 0:p.x)!=null?d:0),r=Jt(t,n.percent,(g=(u=n.offset)==null?void 0:u.y)!=null?g:0);break;case"left":a=Zt(e,n.percent,(f=(h=n.offset)==null?void 0:h.x)!=null?f:0),r=Z(t,(b=(m=n.offset)==null?void 0:m.y)!=null?b:0);break;case"right":a=Qt(e,n.percent,(v=(y=n.offset)==null?void 0:y.x)!=null?v:0),r=Z(t,(E=(x=n.offset)==null?void 0:x.y)!=null?E:0);break;case"center":a=Z(e,(T=(w=n.offset)==null?void 0:w.x)!=null?T:0),r=Z(t,(O=(S=n.offset)==null?void 0:S.y)!=null?O:0);break}i.position?i.position.set(a,r):(i.x=a,i.y=r),n.scale!==void 0&&n.scale!==1&&i.scale&&(typeof i.scale.set=="function"?i.scale.set(n.scale,n.scale):(i.scale.x=n.scale,i.scale.y=n.scale))}function lr(i,e,t,n=.2,a=1,r=!0,s=!1){let o=co(t,n),l=Jt(t,n/2);fe(i,Z(e),l);let c=r?a*ge.scaleFactor:a;he(i,c),s&&!mi.find(p=>p.element===i)&&ao(i,lr,e,t,n,a,r)}function uo(i,e,t,n=.1,a=1){fe(i,Z(e),Xt(t,n)),he(i,a)}function go(i,e,t,n=0,a=0,r=1){fe(i,Z(e,n),Z(t,a)),he(i,r)}function fo(i,e,t,n=.1,a=1){fe(i,Zt(e,n),Z(t)),he(i,a)}function ho(i,e,t,n=.1,a=1){fe(i,Qt(e,n),Z(t)),he(i,a)}function mo(i,e,t,n=.05,a=.05,r=1){fe(i,Zt(e,a),Jt(t,n)),he(i,r)}function bo(i,e,t,n=.05,a=.05,r=1){fe(i,Qt(e,a),Jt(t,n)),he(i,r)}function yo(i,e,t,n=.05,a=.05,r=1){fe(i,Zt(e,a),Xt(t,n)),he(i,r)}function vo(i,e,t,n=.05,a=.05,r=1){fe(i,Qt(e,a),Xt(t,n)),he(i,r)}function fe(i,e,t){i&&i.position?typeof i.position.set=="function"?i.position.set(e,t):(i.position.x=e,i.position.y=t):i&&(i.x=e,i.y=t)}function he(i,e){e!==1&&i&&i.scale&&(typeof i.scale.set=="function"?i.scale.set(e,e):i.scale.x!==void 0&&i.scale.y!==void 0&&(i.scale.x=e,i.scale.y=e))}var je={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 xo(i){return i&&je[i]?JSON.parse(JSON.stringify(je[i])):JSON.parse(JSON.stringify(yt))}function bt(i){Object.keys(i).forEach(e=>{let t=e;yt[t]&&i[t]&&Object.assign(yt[t],i[t])}),console.log("Config applied:",i)}function wo(i,e){let t=i/e;t>1.6?(bt(je.wide),console.log("Applied WIDE config for ratio:",t)):t<.7?(bt(je.tall),console.log("Applied TALL config for ratio:",t)):t>.8&&t<1.2?(bt(je.square),console.log("Applied SQUARE config for ratio:",t)):(bt(je.default),console.log("Applied DEFAULT config for ratio:",t))}if(typeof window!="undefined"){let i=window;i.configPresets=je,i.resolveAnchorVec2=i.resolveAnchorVec2||Kt,i.resolveScreenAnchorPoint=i.resolveScreenAnchorPoint||sr,i.resolveScreenRatioPoint=i.resolveScreenRatioPoint||or}dn();function U(i,e){let t=(a,r)=>r===0?a:t(r,a%r),n=t(i,e);return`${i/n}:${e/n}`}var Nc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:U(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:U(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:U(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:U(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:U(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:U(360,780)}],Hc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:U(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:U(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:U(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:U(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:U(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:U(412,915)}],Bc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:U(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:U(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:U(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:U(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:U(800,1280)}],_i=[{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:U(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:U(768,1024),mraidScale:.7}];var Pi=[..._i],Mi=[{category:"playable",label:"Playable Ad",devices:_i}],pn=_i[0];function ze(i){return Pi.find(e=>e.id===i)||pn}function Oo(i){return Pi.filter(e=>e.category===i)}var un=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
47
|
<div class="scene-panel scene-objects panel-accent-teal" data-panel="scene-objects" style="left:16px; top:72px;">
|
|
48
48
|
<div class="scene-panel-header" data-panel-handle>
|
|
49
49
|
<div class="panel-title">
|
|
@@ -1409,6 +1409,7 @@ Style guidelines: ${n.summary}`;this.promptInput.value=a,this.currentPrompt=a}}c
|
|
|
1409
1409
|
<button class="preview-btn console-toggle" id="console-toggle">
|
|
1410
1410
|
Console <span class="console-badge" id="console-badge">0</span>
|
|
1411
1411
|
</button>
|
|
1412
|
+
</div>
|
|
1412
1413
|
</div>
|
|
1413
1414
|
|
|
1414
1415
|
<div class="preview-main">
|
|
@@ -1488,7 +1489,7 @@ Style guidelines: ${n.summary}`;this.promptInput.value=a,this.currentPrompt=a}}c
|
|
|
1488
1489
|
<div class="console-messages" id="console-messages"></div>
|
|
1489
1490
|
</div>
|
|
1490
1491
|
</div>
|
|
1491
|
-
`,this.setupEventListeners(e),e}setupEventListeners(e){var a,r,s,o,l,c,p,d,u,g;let t=e.querySelector("#device-select");t==null||t.addEventListener("change",h=>{if(this.viewMode==="compare")return;let f=h.target.value;this.setDevice(f)}),Array.from(e.querySelectorAll("[data-view-toggle]")).forEach(h=>{h.addEventListener("click",()=>{let f=h.dataset.viewToggle;f&&this.setViewMode(f)})}),(a=e.querySelector("#rotate-btn"))==null||a.addEventListener("click",()=>this.toggleRotation()),(r=e.querySelector("#zoom-in-btn"))==null||r.addEventListener("click",()=>this.adjustUserZoom(.1)),(s=e.querySelector("#zoom-out-btn"))==null||s.addEventListener("click",()=>this.adjustUserZoom(-.1)),(o=e.querySelector("#refresh-btn"))==null||o.addEventListener("click",()=>this.refresh()),(l=e.querySelector("#console-toggle"))==null||l.addEventListener("click",()=>this.toggleConsole()),(c=e.querySelector("#console-close"))==null||c.addEventListener("click",()=>this.toggleConsole(!1)),(p=e.querySelector("#console-clear"))==null||p.addEventListener("click",()=>this.clearConsole()),(d=e.querySelector("#corner-zoom-in-btn"))==null||d.addEventListener("click",()=>this.adjustUserZoom(.1)),(u=e.querySelector("#corner-zoom-out-btn"))==null||u.addEventListener("click",()=>this.adjustUserZoom(-.1)),(g=e.querySelector("#corner-grab-btn"))==null||g.addEventListener("click",()=>{this.frameDragger.style.cursor="grab",setTimeout(()=>{this.isSpaceKeyPressed||(this.frameDragger.style.cursor="")},1e3)})}applyDeviceFrameStyles(){Object.assign(this.frameDragger.style,{display:"flex",justifyContent:"center",alignItems:"center",transform:"translate(0px, 0px)",touchAction:"none"}),Object.assign(this.frameWrapper.style,{display:"flex",justifyContent:"center",alignItems:"center",transformOrigin:"center center",transition:"transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94)",boxShadow:"0 20px 50px rgba(0,0,0,0.5)",borderRadius:"0px",willChange:"transform"}),Object.assign(this.deviceFrame.style,{overflow:"hidden",position:"relative",borderRadius:"0px"}),Object.assign(this.gameContainer.style,{position:"relative",overflow:"hidden",minWidth:"0px",minHeight:"0px"})}setupObserversAndListeners(){this.resizeObserver=new ResizeObserver(()=>{this.resizeListenersDisabled||!this.gameReady||this.scheduleFit()}),this.resizeObserver.observe(this.previewContainer),window.addEventListener("resize",this.onWindowResize,{passive:!0})}scheduleFit(){this.rafFitHandle&&cancelAnimationFrame(this.rafFitHandle),this.rafFitHandle=requestAnimationFrame(()=>{this.rafFitHandle=null,this.fitToScreen()})}applyPresetDimensions(){let e=this.getEffectivePreset(),t=`${e.width}px`,n=`${e.height}px`;this.deviceFrame.style.width=t,this.deviceFrame.style.height=n,this.gameContainer.style.width=t,this.gameContainer.style.height=n,this.gameContainer.style.maxWidth=t,this.gameContainer.style.maxHeight=n,this.gameContainer.style.minWidth=t,this.gameContainer.style.minHeight=n,this.gameContainer.dataset.screenWidth=String(e.width),this.gameContainer.dataset.screenHeight=String(e.height),this.container.style.setProperty("--preview-screen-width",String(e.width)),this.container.style.setProperty("--preview-screen-height",String(e.height))}fitToScreen(e){if(!this.previewContainer)return;let t=this.getEffectivePreset(),n=this.getFitBounds(),a=Math.max(0,n.width),r=Math.max(0,n.height);if(a<=0||r<=0)return;this.applyPresetDimensions(),this.viewMode==="compare"&&this.applyCompareDimensions();let s=a/t.width,o=r/t.height;if(this.autoScale=Math.max(.01,Math.min(s,o)),!this.hasInitialFit){this.hasInitialFit=!0;let l=.6;this.userScaleMultiplier=l/this.autoScale}e!=null&&e.keepVisibleScale&&e.keepVisibleScale>0&&(this.userScaleMultiplier=e.keepVisibleScale/this.autoScale),this.applyTransform(),this.viewMode==="compare"&&this.fitCompareGhosts(),requestAnimationFrame(()=>this.updatePanelPositions()),this.emitScreenChange()}applyTransform(){let e=this.autoScale*this.userScaleMultiplier;this.frameWrapper.style.transform=`scale(${e})`;let t=this.container.querySelector("#zoom-label");t&&(t.textContent=`${Math.round(e*100)}%`),requestAnimationFrame(()=>this.updatePanelPositions())}applyFrameDrag(){this.frameDragger.style.transform=`translate(${this.frameDragOffsetX}px, ${this.frameDragOffsetY}px)`,requestAnimationFrame(()=>this.updatePanelPositions())}updatePanelPositions(){var r;if(!this.gameReady||this.viewMode==="compare")return;let e=this.frameWrapper.getBoundingClientRect(),t=(r=this.container.querySelector(".preview-main"))==null?void 0:r.getBoundingClientRect();if(!t)return;let n=this.container.querySelector("#scene-tools-container");if(n&&n.children.length>0){let o=e.left-t.left+e.width/2,l=e.top-t.top-16;n.style.position="absolute",n.style.left=`${o}px`,n.style.top=`${Math.max(16,l)}px`,n.style.transform="translate(-50%, -100%)",n.style.zIndex="100"}let a=this.container.querySelector("#nudge-panel-container");if(a&&a.children.length>0){let o=e.left-t.left-16,l=e.top-t.top+e.height/2;a.style.position="absolute",a.style.left=`${Math.max(16,o)}px`,a.style.top=`${l}px`,a.style.transform="translate(-100%, -50%)",a.style.zIndex="100"}}setupFrameDragging(){this.frameDragger.addEventListener("pointerdown",e=>{let t=!this.gameContainer.contains(e.target);!this.isSpaceKeyPressed&&!t||e.button===0&&(e.preventDefault(),this.frameDragActive=!0,this.frameDragStartX=e.clientX,this.frameDragStartY=e.clientY,this.frameDragOriginX=this.frameDragOffsetX,this.frameDragOriginY=this.frameDragOffsetY,window.addEventListener("pointermove",this.onFrameDragMove),window.addEventListener("pointerup",this.onFrameDragEnd))})}setupSpaceKeyListener(){window.addEventListener("keydown",e=>{e.code==="Space"&&!this.isInputFocused()&&(this.isSpaceKeyPressed||(this.isSpaceKeyPressed=!0,this.updateDragCursor(),e.preventDefault()))}),window.addEventListener("keyup",e=>{e.code==="Space"&&(this.isSpaceKeyPressed=!1,this.updateDragCursor(),this.frameDragActive&&this.onFrameDragEnd())}),window.addEventListener("blur",()=>{this.isSpaceKeyPressed=!1,this.updateDragCursor(),this.frameDragActive&&this.onFrameDragEnd()})}isInputFocused(){let e=document.activeElement;if(!e)return!1;let t=e.tagName.toLowerCase();return t==="input"||t==="textarea"||t==="select"||e.isContentEditable}updateDragCursor(){this.isSpaceKeyPressed?(this.frameDragger.style.cursor="grab",this.frameDragActive&&(this.frameDragger.style.cursor="grabbing")):this.frameDragger.style.cursor=""}adjustUserZoom(e){this.userScaleMultiplier=Math.max(.1,Math.min(6,this.userScaleMultiplier+e)),this.applyTransform(),this.emitScreenChange()}toggleRotation(){var t,n;if(this.viewMode==="compare")return;let e=this.autoScale*this.userScaleMultiplier;this.isLandscape=!this.isLandscape,this.applyPresetDimensions(),this.fitToScreen({keepVisibleScale:e}),(n=(t=this.options).onDeviceChange)==null||n.call(t,this.getEffectivePreset()),this.emitScreenChange()}emitScreenChange(){if(!this.gameReady)return;let e=this.getEffectivePreset(),t={width:e.width,height:e.height,dpr:Math.max(1,Math.floor(window.devicePixelRatio||1)),presetId:e.id,isLandscape:this.isLandscape};if(window.dispatchEvent(new CustomEvent("handler-preview:screen",{detail:t})),this.viewMode==="compare"&&this.refreshCompareSnapshots(),this.isInitialized&&this.isMounted&&this.gameReady){let n=window.gameApp;if(!(n!=null&&n.renderer))return;this.ignoreNextWindowResize=!0,window.dispatchEvent(new Event("resize"))}}safeStringify(e){var n;let t=new WeakSet;try{return JSON.stringify(e,(a,r)=>{if(typeof r=="object"&&r!==null){if(t.has(r))return"[Circular]";t.add(r)}return r},2)}catch{try{if(e&&((n=e.constructor)!=null&&n.name))return`[object ${e.constructor.name}]`}catch{}return String(e)}}setupConsoleInterceptor(){let e=console.log.bind(console),t=console.warn.bind(console),n=console.error.bind(console),a=console.info.bind(console),r=(s,...o)=>{let l=o.map(p=>typeof p=="object"?this.safeStringify(p):String(p)).join(" ");this.consoleMessages.push({type:s,message:l,timestamp:new Date}),this.appendConsoleMessage(this.consoleMessages[this.consoleMessages.length-1]);let c=this.container.querySelector("#console-badge");if(c){let p=this.consoleMessages.filter(d=>d.type==="error").length;c.textContent=p>0?`${p}!`:"0",c.classList.toggle("has-errors",p>0)}};console.log=(...s)=>{e(...s),r("log",...s)},console.warn=(...s)=>{t(...s),r("warn",...s)},console.error=(...s)=>{n(...s),r("error",...s)},console.info=(...s)=>{a(...s),r("info",...s)}}appendConsoleMessage(e){let t=this.container.querySelector("#console-messages");if(!t)return;let n=document.createElement("div");n.className=`console-msg type-${e.type}`;let a=e.timestamp.toLocaleTimeString();n.innerHTML=`<span class="time">${this.escapeHtml(a)}</span> <pre>${this.escapeHtml(e.message)}</pre>`,t.appendChild(n),t.scrollTop=t.scrollHeight}escapeHtml(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}toggleConsole(e){var t;this.isConsoleOpen=e!=null?e:!this.isConsoleOpen,(t=this.consolePanel)==null||t.classList.toggle("closed",!this.isConsoleOpen)}clearConsole(){this.consoleMessages=[];let e=this.container.querySelector("#console-messages");e&&(e.innerHTML="");let t=this.container.querySelector("#console-badge");t&&(t.textContent="0")}setupCompareViewports(){Array.from(this.container.querySelectorAll("[data-viewport]")).forEach(t=>{let n=t.dataset.viewport;if(!n)return;let a=this.comparePresets.find(d=>d.id===n);if(!a)return;let r=t.querySelector("[data-compare-slot]"),s=t.querySelector("[data-compare-ghost]"),o=t.querySelector("[data-compare-wrapper]"),l=t.querySelector("[data-compare-frame]"),c=t.querySelector("[data-compare-snapshot]"),p=t.querySelector("[data-compare-focus]");!r||!s||!o||!l||(t.addEventListener("click",d=>{let u=d.target;if(u!=null&&u.closest("[data-compare-focus]")){d.preventDefault(),this.activateCompareViewport(n);return}t.classList.contains("is-active")||this.activateCompareViewport(n)}),this.compareViewports.set(n,{preset:a,root:t,slot:r,ghost:s,wrapper:o,frame:l,canvas:c,focus:p}))})}setViewMode(e){if(this.viewMode===e)return;this.viewMode=e,this.container.classList.toggle("compare-mode",e==="compare"),this.singleStage.classList.toggle("hidden",e!=="single"),this.compareStage.classList.toggle("hidden",e!=="compare");let t=this.container.querySelector("#device-select");t&&(t.disabled=e==="compare");let n=this.container.querySelector("#rotate-btn");if(n&&(n.disabled=e==="compare"),this.updateViewToggleUI(),e==="compare"){this.lastSinglePresetId=this.currentPreset.id,this.activateCompareViewport(this.activeCompareId),this.refreshCompareSnapshots(),this.startCompareSnapshots();return}this.stopCompareSnapshots(),this.singleStage.appendChild(this.frameDragger),this.setDevice(this.lastSinglePresetId,{suppressCallback:!0}),this.fitToScreen()}updateViewToggleUI(){Array.from(this.container.querySelectorAll("[data-view-toggle]")).forEach(t=>{t.classList.toggle("active",t.dataset.viewToggle===this.viewMode)})}activateCompareViewport(e){var r,s;let t=this.compareViewports.get(e);if(!t)return;let n=this.autoScale*this.userScaleMultiplier,a=this.activeCompareId;a&&a!==e&&this.captureCompareSnapshot(a),this.activeCompareId=e,this.currentPreset=t.preset,this.isLandscape=!1,t.slot.appendChild(this.frameDragger),this.frameDragOffsetX=0,this.frameDragOffsetY=0,this.applyFrameDrag(),this.compareViewports.forEach((o,l)=>{o.root.classList.toggle("is-active",l===e),o.ghost.classList.toggle("hidden",l===e),o.focus&&(o.focus.textContent=l===e?"Live":"Focus")}),this.applyPresetDimensions(),this.applyCompareDimensions(),this.fitToScreen({keepVisibleScale:n}),(s=(r=this.options).onDeviceChange)==null||s.call(r,this.getEffectivePreset())}applyCompareDimensions(){this.compareViewports.forEach(e=>{let t=e.preset,n=`${t.width}px`,a=`${t.height}px`;e.frame.style.width=n,e.frame.style.height=a,e.canvas&&(e.canvas.width=t.width,e.canvas.height=t.height)})}fitCompareGhosts(){this.compareViewports.forEach(e=>{let t=e.root.querySelector(".compare-body");if(!t)return;let n=Math.max(0,t.clientWidth-24),a=Math.max(0,t.clientHeight-24);if(n<=0||a<=0)return;let r=n/e.preset.width,s=a/e.preset.height,o=Math.max(.01,Math.min(r,s));e.wrapper.style.transform=`scale(${o})`})}captureCompareSnapshot(e){let t=this.compareViewports.get(e);if(!(t!=null&&t.canvas))return;let n=this.gameContainer.querySelector("canvas");if(!n)return;let a=t.canvas.getContext("2d");if(!a)return;let r=t.canvas.width,s=t.canvas.height,o=Math.min(r/n.width,s/n.height),l=n.width*o,c=n.height*o,p=(r-l)/2,d=(s-c)/2;a.clearRect(0,0,r,s),a.drawImage(n,p,d,l,c)}refreshCompareSnapshots(){this.compareViewports.forEach((e,t)=>{t!==this.activeCompareId&&this.captureCompareSnapshot(t)})}startCompareSnapshots(){this.compareSnapshotTimer||(this.compareSnapshotTimer=window.setInterval(()=>{this.viewMode==="compare"&&this.refreshCompareSnapshots()},500))}stopCompareSnapshots(){this.compareSnapshotTimer&&(window.clearInterval(this.compareSnapshotTimer),this.compareSnapshotTimer=null)}getFitBounds(){if(this.viewMode!=="compare")return{width:this.previewContainer.clientWidth-40,height:this.previewContainer.clientHeight-40};let e=this.compareViewports.get(this.activeCompareId),t=e==null?void 0:e.root.querySelector(".compare-body");return t?{width:t.clientWidth-24,height:t.clientHeight-24}:{width:this.previewContainer.clientWidth-40,height:this.previewContainer.clientHeight-40}}mustQuery(e){let t=this.container.querySelector(e);if(!t)throw new Error(`PreviewShell missing element: ${e}`);return t}};function oa(i={}){let e=new Hn(i);return typeof window!="undefined"&&(window.__previewShell=e),e.mount(),e}K();function la(i){try{if(i&&typeof i.keys=="function")return Array.from(i.keys())}catch{}return[]}function ls(i){var e;return i?((e=i.getDisplayObject)==null?void 0:e.call(i))||i.pixiObject||i:null}function Ko(i,e){if(!i||!(e!=null&&e.interaction))return;let t=e.interaction,n=t.enabled!==!1&&(t.draggable===!0||t.clickable===!0);i.eventMode=n?"static":"none",i.interactive=n,n&&(i.cursor=t.draggable?"move":"pointer")}function cs(i,e){var l,c,p,d,u;if(!i||!e)return;let t=e.transform||{};Ko(i,e);let n=t.position||{},a=t.offset||{},r=(typeof n.x=="number"?n.x:0)+(typeof a.x=="number"?a.x:0),s=(typeof n.y=="number"?n.y:0)+(typeof a.y=="number"?a.y:0);(l=i.position)!=null&&l.set?i.position.set(r,s):(typeof i.x=="number"&&(i.x=r),typeof i.y=="number"&&(i.y=s)),typeof t.scale=="number"&&((c=i.scale)!=null&&c.set?i.scale.set(t.scale):i.scale&&(i.scale.x=t.scale,i.scale.y=t.scale));let o=(d=t.anchor)!=null?d:(p=e.render)==null?void 0:p.anchor;o&&((u=i.anchor)!=null&&u.set)&&typeof o.x=="number"&&typeof o.y=="number"&&i.anchor.set(o.x,o.y)}function ds(i){if(typeof window=="undefined")return;let e=i==null?void 0:i.objects,t=la(e),n=r=>{try{let s=window.__HANDLER_ACTIVE_SCREEN;if(!s||s==="all")return r;let o=window.__HANDLER_SCREEN_INDEX,l=o==null?void 0:o.instanceToScreen;return l?r.filter(c=>l[c]===s):r}catch{return r}};window.__editableObjectConfigs=e;let a=new Map;t.forEach(r=>a.set(r,[r])),window.__editableObjectInstances=a,window.refreshEditableConfigIndex=()=>ds(window.__editableConfig),window.getEditableObjectList=()=>{var r;return n(la((r=window.__editableConfig)==null?void 0:r.objects))},window.getEditableObjectListAll=()=>{var r;return la((r=window.__editableConfig)==null?void 0:r.objects)},window.getEditableObjectConfig=r=>{var p,d,u,g,h;let s=(g=(u=(d=(p=window.__editableConfig)==null?void 0:p.objects)==null?void 0:d.get)==null?void 0:u.call(d,r))!=null?g:null,o=window.__HANDLER_ACTIVE_SCREEN;if(!o||o==="all")return s;let l=window.__HANDLER_SCREEN_INDEX,c=(h=l==null?void 0:l.instanceToScreen)==null?void 0:h[r];return c&&c===o?s:null},window.getEditableEngineConfig=()=>{let r=window.__editableConfig;if(console.log("[BRIDGE] getEditableEngineConfig called, cfg present:",!!r),!r)return null;if(r.engine&&r.objects instanceof Map){console.log("[BRIDGE] Detected ObjectCentricConfig, flattening...");let s={...r.engine,objects:r.objects,scene:r.scene};return console.log("[BRIDGE] Returned assets:",Object.keys(s.assets||{})),s}return r}}function Xo(){if(typeof window=="undefined")return;let i=t=>{let n=String(t||"").trim();return n?/^(data:|blob:|https?:)/.test(n)||n.startsWith("/")?n:`/${n.replace(/^\.\//,"")}`:""},e=async(t,n)=>{var r,s,o;let a=i(n);if(a)try{let[{Assets:l},{AssetTextures:c}]=await Promise.all([import("pixi.js"),Promise.resolve().then(()=>(Ke(),ar))]),p=Date.now(),d=/^(data:|blob:)/.test(a)?a:a+(a.includes("?")?`&t=${p}`:`?t=${p}`),u=await l.load(d);if(!u)return;c[t]=u;let g=window.CustomAssets;(r=g==null?void 0:g[t])!=null&&r.texture&&(g[t].texture=u);let h=window.gameObjectManager,f=(s=h==null?void 0:h.get)==null?void 0:s.call(h,t);if(f){let m=((o=f.getDisplayObject)==null?void 0:o.call(f))||f.pixiObject||f.pixi||f;if(m!=null&&m.texture)m.texture=u;else if(m!=null&&m.children){let b=m.children.find(y=>y==null?void 0:y.texture);b!=null&&b.texture&&(b.texture=u)}}}catch(l){console.warn("[LIVE-EDIT] Failed to reload Pixi texture for",t,l)}};window.applyLiveEditOverrides=t=>{try{let n=Y();Array.isArray(n)&&n.length&&(window.__editableConfig=t,Se(n,{silent:!0,persist:!1}))}catch{}},window.applyEngineOverrides=t=>{try{let n=Y();Array.isArray(n)&&n.length&&(window.__editableConfig=t,Se(n,{silent:!0,persist:!1}))}catch{}},window.applyEditableEngineConfig=t=>{let n=window.__editableConfig;if(!(n!=null&&n.engine))return;let a=[];if(t.runtime)for(let[r,s]of Object.entries(t.runtime))a.push({path:`runtime.${r}`,value:s});if(t.assets)for(let[r,s]of Object.entries(t.assets))a.push({path:`assets.${r}`,value:s}),typeof s=="string"&&e(r,s);if(t.splash)for(let[r,s]of Object.entries(t.splash))a.push({path:`splash.${r}`,value:s});if(t.loading)for(let[r,s]of Object.entries(t.loading))a.push({path:`loading.${r}`,value:s});if(t.start)for(let[r,s]of Object.entries(t.start))a.push({path:`start.${r}`,value:s});a.length&&Se(a,{silent:!0,persist:!0,emitEvent:!0})}}function Bn(i){let{getConfig:e,gameObjectManager:t,onObjectConfigApplied:n}=i;t&&(t.onObjectRebuildRequired=async(r,s)=>{console.log(`[LIVE-EDIT] \u{1F3D7}\uFE0F Rebuilding object ${r} due to type change...`);let o=t.get(r),l=o==null?void 0:o.pixiObject,c=l==null?void 0:l.parent,p=c==null?void 0:c.children.indexOf(l);o?t.remove(r):l&&l.destroy();let d=window.gameApp,u=await Ee.create(r,s,d);c&&(p!==void 0&&p!==-1?c.addChildAt(u,p):c.addChild(u));let g=t.create(r,u);return console.log(`[LIVE-EDIT] \u2705 Rebuild complete for ${r}`),g}),typeof window!="undefined"&&(Xo(),window.applyEditableObjectConfig=(r,s)=>{var o,l,c;console.log("[LIVE-EDIT] \u{1F504} applyEditableObjectConfig called for:",r);try{let p=window.__editableConfig;(o=p==null?void 0:p.objects)!=null&&o.set&&(p.objects.set(r,s),console.log("[LIVE-EDIT] \u2705 Updated config in __editableConfig"));let d=(l=t==null?void 0:t.get)==null?void 0:l.call(t,r);if(console.log("[LIVE-EDIT] gameObject found?",!!d),d&&(console.log("[LIVE-EDIT] gameObject type:",(c=d.constructor)==null?void 0:c.name),console.log("[LIVE-EDIT] has updateConfig?",typeof d.updateConfig=="function"),console.log("[LIVE-EDIT] has onConfigUpdate?",typeof d.onConfigUpdate=="function")),d&&typeof d.updateConfig=="function")console.log("[LIVE-EDIT] \u2705 Calling updateConfig()"),d.updateConfig(s);else if(d&&typeof d.onConfigUpdate=="function")console.log("[LIVE-EDIT] \u2705 Calling onConfigUpdate()"),d.onConfigUpdate();else{console.log("[LIVE-EDIT] \u26A0\uFE0F No updateConfig or onConfigUpdate, applying transform directly");let u=ls(d);cs(u,s)}}catch(p){console.error("[LIVE-EDIT] \u274C Error in applyEditableObjectConfig:",p)}});let a={async applyObjectConfig(r,s){var p,d;console.log("[BRIDGE] \u{1F504} applyObjectConfig called for:",r);let o=e();(p=o==null?void 0:o.objects)!=null&&p.set&&(o.objects.set(r,s),console.log("[BRIDGE] \u2705 Updated config"));let l=(d=t==null?void 0:t.get)==null?void 0:d.call(t,r);if(console.log("[BRIDGE] gameObject found?",!!l),l&&(console.log("[BRIDGE] has updateConfig?",typeof l.updateConfig=="function"),console.log("[BRIDGE] has onConfigUpdate?",typeof l.onConfigUpdate=="function")),l&&typeof l.updateConfig=="function")console.log("[BRIDGE] \u2705 Calling updateConfig()"),l.updateConfig(s);else if(l&&typeof l.onConfigUpdate=="function")console.log("[BRIDGE] \u2705 Calling onConfigUpdate()"),l.onConfigUpdate();else{console.log("[BRIDGE] \u26A0\uFE0F Applying transform directly");let u=ls(l);cs(u,s)}let c=[r];n==null||n(r,s,c)},rebuildIndexes(){let r=e();typeof window!="undefined"&&(window.__editableConfig=r,ds(r))}};return a.rebuildIndexes(),a}K();var gs=qe(require("lottie-web"),1);si(ai);typeof window!="undefined"&&!window.lottie&&(window.lottie=gs.default);var nt=null,Jo=async()=>{if(!nt){let i=typeof window!="undefined"?window.INLINE_ASSETS:null,e=(i==null?void 0:i["handler.config"])||(i==null?void 0:i["handler.config.json"]);if(e)try{if(e.startsWith("data:")){let n=atob(e.split(",")[1]);nt=JSON.parse(n)}else nt=JSON.parse(e);return nt}catch(n){console.warn("[CONFIG] Failed to parse inline handler.config.json:",n)}nt=await(await fetch("./handler.config.json")).json()}return nt},ua,It,fs,it,da,pa;function Zo(i){ua=i.initGame,It=i.CustomAssets,fs=i.updateScreenState,it=i.globalResponsiveMultipliers,da=i.layout,pa=i.clearResponsiveElements}var Fn="web_embed",Ot="https://example.com",ps={profile_id:Fn},Pe=null,oe=null,ca={width:0,height:0},Qo=!0,el=async()=>{var c,p,d,u;document.title="Handler Pixi Game";let i=await Jo();ps={...i.ids||{},profile_id:Fn},Ot=i.destination_url||((p=(c=i.export_profiles)==null?void 0:c[Fn])==null?void 0:p.destination_url)||Ot,Oe.init({ids:ps,profile:Fn,destinationUrl:Ot});let e=Oe.getRoot();if(typeof __PREVIEW_SHELL__!="undefined"&&__PREVIEW_SHELL__){console.log("[BOOTSTRAP] Initializing Preview Shell..."),oe=oa({onDeviceChange:h=>{console.log(`[PREVIEW] Device switched to ${h.width}x${h.height}, restarting game...`),us()},onRefresh:us});let g=oe.getGameContainer();g&&(e=g),window.addEventListener("handler-preview:screen",h=>{var v,x,E,w,T,S,O,B,M,C,I;let f=window.gameApp,m=window.gameObjectManager,{width:b,height:y}=h.detail;if(ca.width=b,ca.height=y,fs(b,y),!(!f||!f.renderer)){m&&o(f,m);try{f.renderer.resize(b,y);let k=f.view;k&&(k.style.width="100%",k.style.height="100%",k.style.display="block")}catch(k){console.warn("[SCREEN] Error resizing renderer:",k);return}if(t&&m&&da)try{let k=(v=window.__mainContainer)!=null?v:f.stage,D=(O=(S=(w=window.__tutorialLabel)!=null?w:(E=(x=m.get("label_1"))==null?void 0:x.getDisplayObject)==null?void 0:E.call(x))!=null?S:(T=m.get("label_1"))==null?void 0:T.pixiObject)!=null?O:m.get("label_1"),R=m.get("background_1"),$=(I=(C=(M=window.__background)!=null?M:(B=R==null?void 0:R.getDisplayObject)==null?void 0:B.call(R))!=null?C:R==null?void 0:R.pixiObject)!=null?I:R;if(k){let A=k===f.stage;da({mainContainer:k,label:D,background:$,backgroundTexture:($==null?void 0:$.texture)||null,app:f},t,0,ca,m,{skipMainContainerTransform:A})}}catch(k){console.warn("[SCREEN] Error in layout:",k)}}})}let t=await me("scene.main");window.__editableConfig=t,s(),window.__editableConfigBaseline||(window.__editableConfigBaseline=G(t),console.log("[BOOTSTRAP] Frozen config baseline for persistence")),(u=(d=t.engine.runtime)==null?void 0:d.layout)!=null&&u.design_width_portrait||(console.warn("[BOOTSTRAP] Config layout missing, retrying..."),await new Promise(g=>setTimeout(g,100)),t=await me("scene.main"));let n=await ua(e,t,Ot,oe);Pe=n.app;let a=n.gameObjectManager;window.gameApp=Pe,window.gameObjectManager=a;try{window.__liveEditBridge=Bn({getConfig:()=>window.__editableConfig,gameObjectManager:a,assets:It})}catch(g){console.warn("[BOOTSTRAP] Failed to initialize live-edit bridge",g)}oe&&oe.notifyGameLoaded();let r=window.__debugScale;r&&typeof r=="number"&&(it.scale=r,console.log(`[DEBUG] Applied persisted debug scale: ${r}`)),o(Pe,a);async function s(){try{let g=async y=>{let v=y.startsWith("/")?y:`/${y}`,x=await fetch(v,{cache:"no-cache"});if(!x.ok)return null;let E=await x.text();try{return JSON.parse(E)}catch{return null}},h=await g("configs/flow/app.flow.json");if(!h||typeof h!="object")return;let f=h.screens;if(!f||typeof f!="object")return;let m={},b={};for(let[y,v]of Object.entries(f)){let x=v==null?void 0:v.source;if(typeof x!="string")continue;let E=await g(x),w=E==null?void 0:E.elements;if(!Array.isArray(w))continue;let T=w.map(S=>S==null?void 0:S.instance_id).filter(S=>typeof S=="string");m[y]=T;for(let S of T)b[S]||(b[S]=y)}window.__HANDLER_APP_FLOW=h,window.__HANDLER_SCREEN_INDEX={screenToInstances:m,instanceToScreen:b},window.dispatchEvent(new CustomEvent("handler:screen-index-loaded"))}catch{}}function o(g,h){if(Qo){console.log("[RESPONSIVE] Skipping global scaling; using config-driven layout");return}if(console.log("[RESPONSIVE] ===== APPLYING GLOBAL RESPONSIVE SCALING ====="),console.log(`[RESPONSIVE] Scale multiplier: ${it.scale.toFixed(3)}`),g.stage){let m=function(b,y=0){if(!b||!b.children)return;let v=" ".repeat(y);b.children.forEach((x,E)=>{if(x&&x.zIndex===9999){console.log(`${v}[RESPONSIVE] Skipping debug border (zIndex 9999)`);return}if(x&&x.scale){let w=x.scale.x||1,T=x.scale.y||1;x.__originalScale||(x.__originalScale={x:w,y:T},console.log(`${v}[RESPONSIVE] Stored original scale for child[${E}]: ${w.toFixed(3)}, ${T.toFixed(3)}`));let S=x.__originalScale.x*it.scale,O=x.__originalScale.y*it.scale;typeof x.scale.set=="function"?x.scale.set(S,O):(x.scale.x=S,x.scale.y=O),console.log(`${v}[RESPONSIVE] Child[${E}] scale: ${w.toFixed(3)}\u2192${x.scale.x.toFixed(3)} (type: ${x.constructor.name})`),m(x,y+1)}else x&&console.log(`${v}[RESPONSIVE] Child[${E}] has no scale (type: ${x.constructor.name})`)})};var f=m;console.log("[RESPONSIVE] Applying scale to PIXI stage children"),m(g.stage)}else console.warn("[RESPONSIVE] No app.stage found!");console.log("[REDDEBUG] Debug border left unscaled (fixed boundaries)"),console.log("[RESPONSIVE] ===== GLOBAL RESPONSIVE SCALING COMPLETE =====")}function l(g){if(g!==void 0){it.scale=g,console.log(`[RESPONSIVE] Updated global scale multiplier to: ${g.toFixed(3)}`);let h=window.gameApp,f=window.gameObjectManager;h&&f?(o(h,f),h.renderer&&(h.renderer.render(h.stage),console.log("[RESPONSIVE] Forced PIXI renderer update"))):console.warn(`[RESPONSIVE] No gameApp (${!!h}) or gameObjectManager (${!!f}) found in window for live update`)}}window.updateGlobalResponsiveMultipliers=l,Oe.start()},us=async()=>{var e,t,n,a;console.log("[PREVIEW] Restarting game in 1 seconds...");let i=(e=window.gameObjectManager)==null?void 0:e.get("character_1");if(i){let r=((t=i.getDisplayObject)==null?void 0:t.call(i))||i;r&&r.scale&&console.log(`[CHARACTER] Before restart - Current scale - x: ${((n=r.scale.x)!=null?n:1).toFixed(3)}, y: ${((a=r.scale.y)!=null?a:1).toFixed(3)}`)}if(oe){oe.notifyGameDestroyed();try{pa&&pa()}catch(r){console.warn("Failed to clear responsive elements",r)}setTimeout(()=>{console.log("[PREVIEW] Executing restart...");let r=oe.getGameContainer(),s=window.gameObjectManager;if(s&&typeof s.clear=="function"&&(console.log("[PREVIEW] Clearing old GameObjectManager tickers..."),s.clear()),Pe){try{Pe.destroy(!0,{children:!0,texture:!1})}catch(o){console.warn("[PREVIEW] Destroy warning:",o)}Pe=null}window.gameApp=null,window.gameObjectManager=null,r&&(r.innerHTML="");try{typeof It.resetScene=="function"&&It.resetScene()}catch(o){console.warn("Asset reset failed",o)}setTimeout(()=>{me("scene.main").then(o=>{window.__editableConfig=o,window.__editableConfigBaseline||(window.__editableConfigBaseline=G(o)),ua(r,o,Ot).then(l=>{Pe=l.app,window.gameApp=Pe,window.gameObjectManager=l.gameObjectManager;try{window.__liveEditBridge=Bn({getConfig:()=>window.__editableConfig,gameObjectManager:window.gameObjectManager,assets:It})}catch(c){console.warn("[BOOTSTRAP] Failed to re-initialize live-edit bridge",c)}oe&&oe.notifyGameLoaded(),console.log("[PREVIEW] Game restarted successfully");try{Oe.start()}catch{}})})},100)},1e3)}};dn();K();var le={background:"#F6F3EF",ink:"#1E1E1E",secondaryText:"#8E8A84",primaryAccent:"#E38A5A",secondaryAccent:"#C9A28C",statusGreen:"#5F8F6B"},hs=1.25,ms={fontFamily:"Inter, system-ui, sans-serif"};var Un=class{constructor(e={}){this.currentProgress=0;var t;this.currentProgress=(t=e.progress)!=null?t:0,this.container=this.createContainer()}createContainer(){let e=document.createElement("div");e.className="handler-loading-screen",e.style.cssText=`
|
|
1492
|
+
`,this.setupEventListeners(e),e}setupEventListeners(e){var a,r,s,o,l,c,p,d,u,g;let t=e.querySelector("#device-select");t==null||t.addEventListener("change",h=>{if(this.viewMode==="compare")return;let f=h.target.value;this.setDevice(f)}),Array.from(e.querySelectorAll("[data-view-toggle]")).forEach(h=>{h.addEventListener("click",()=>{let f=h.dataset.viewToggle;f&&this.setViewMode(f)})}),(a=e.querySelector("#rotate-btn"))==null||a.addEventListener("click",()=>this.toggleRotation()),(r=e.querySelector("#zoom-in-btn"))==null||r.addEventListener("click",()=>this.adjustUserZoom(.1)),(s=e.querySelector("#zoom-out-btn"))==null||s.addEventListener("click",()=>this.adjustUserZoom(-.1)),(o=e.querySelector("#refresh-btn"))==null||o.addEventListener("click",()=>this.refresh()),(l=e.querySelector("#console-toggle"))==null||l.addEventListener("click",()=>this.toggleConsole()),(c=e.querySelector("#console-close"))==null||c.addEventListener("click",()=>this.toggleConsole(!1)),(p=e.querySelector("#console-clear"))==null||p.addEventListener("click",()=>this.clearConsole()),(d=e.querySelector("#corner-zoom-in-btn"))==null||d.addEventListener("click",()=>this.adjustUserZoom(.1)),(u=e.querySelector("#corner-zoom-out-btn"))==null||u.addEventListener("click",()=>this.adjustUserZoom(-.1)),(g=e.querySelector("#corner-grab-btn"))==null||g.addEventListener("click",()=>{this.frameDragger.style.cursor="grab",setTimeout(()=>{this.isSpaceKeyPressed||(this.frameDragger.style.cursor="")},1e3)})}applyDeviceFrameStyles(){Object.assign(this.frameDragger.style,{display:"flex",justifyContent:"center",alignItems:"center",transform:"translate(0px, 0px)",touchAction:"none"}),Object.assign(this.frameWrapper.style,{display:"flex",justifyContent:"center",alignItems:"center",transformOrigin:"center center",transition:"transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94)",boxShadow:"0 20px 50px rgba(0,0,0,0.5)",borderRadius:"0px",willChange:"transform"}),Object.assign(this.deviceFrame.style,{overflow:"hidden",position:"relative",borderRadius:"0px"}),Object.assign(this.gameContainer.style,{position:"relative",overflow:"hidden",minWidth:"0px",minHeight:"0px"})}setupObserversAndListeners(){this.resizeObserver=new ResizeObserver(()=>{this.resizeListenersDisabled||!this.gameReady||this.scheduleFit()}),this.resizeObserver.observe(this.previewContainer),window.addEventListener("resize",this.onWindowResize,{passive:!0})}scheduleFit(){this.rafFitHandle&&cancelAnimationFrame(this.rafFitHandle),this.rafFitHandle=requestAnimationFrame(()=>{this.rafFitHandle=null,this.fitToScreen()})}applyPresetDimensions(){let e=this.getEffectivePreset(),t=`${e.width}px`,n=`${e.height}px`;this.deviceFrame.style.width=t,this.deviceFrame.style.height=n,this.gameContainer.style.width=t,this.gameContainer.style.height=n,this.gameContainer.style.maxWidth=t,this.gameContainer.style.maxHeight=n,this.gameContainer.style.minWidth=t,this.gameContainer.style.minHeight=n,this.gameContainer.dataset.screenWidth=String(e.width),this.gameContainer.dataset.screenHeight=String(e.height),this.container.style.setProperty("--preview-screen-width",String(e.width)),this.container.style.setProperty("--preview-screen-height",String(e.height))}fitToScreen(e){if(!this.previewContainer)return;let t=this.getEffectivePreset(),n=this.getFitBounds(),a=Math.max(0,n.width),r=Math.max(0,n.height);if(a<=0||r<=0)return;this.applyPresetDimensions(),this.viewMode==="compare"&&this.applyCompareDimensions();let s=a/t.width,o=r/t.height;if(this.autoScale=Math.max(.01,Math.min(s,o)),!this.hasInitialFit){this.hasInitialFit=!0;let l=.6;this.userScaleMultiplier=l/this.autoScale}e!=null&&e.keepVisibleScale&&e.keepVisibleScale>0&&(this.userScaleMultiplier=e.keepVisibleScale/this.autoScale),this.applyTransform(),this.viewMode==="compare"&&this.fitCompareGhosts(),requestAnimationFrame(()=>this.updatePanelPositions()),this.emitScreenChange()}applyTransform(){let e=this.autoScale*this.userScaleMultiplier;this.frameWrapper.style.transform=`scale(${e})`;let t=this.container.querySelector("#zoom-label");t&&(t.textContent=`${Math.round(e*100)}%`),requestAnimationFrame(()=>this.updatePanelPositions())}applyFrameDrag(){this.frameDragger.style.transform=`translate(${this.frameDragOffsetX}px, ${this.frameDragOffsetY}px)`,requestAnimationFrame(()=>this.updatePanelPositions())}updatePanelPositions(){var r;if(!this.gameReady||this.viewMode==="compare")return;let e=this.frameWrapper.getBoundingClientRect(),t=(r=this.container.querySelector(".preview-main"))==null?void 0:r.getBoundingClientRect();if(!t)return;let n=this.container.querySelector("#scene-tools-container");if(n&&n.children.length>0){let o=e.left-t.left+e.width/2,l=e.top-t.top-32;n.style.position="absolute",n.style.left=`${o}px`,n.style.top=`${Math.max(32,l)}px`,n.style.transform="translate(-50%, -100%)",n.style.zIndex="100"}let a=this.container.querySelector("#nudge-panel-container");if(a&&a.children.length>0){let o=e.left-t.left-32,l=e.top-t.top+e.height/2;a.style.position="absolute",a.style.left=`${Math.max(32,o)}px`,a.style.top=`${l}px`,a.style.transform="translate(-100%, -50%)",a.style.zIndex="100"}}setupFrameDragging(){this.frameDragger.addEventListener("pointerdown",e=>{let t=!this.gameContainer.contains(e.target);!this.isSpaceKeyPressed&&!t||e.button===0&&(e.preventDefault(),this.frameDragActive=!0,this.frameDragStartX=e.clientX,this.frameDragStartY=e.clientY,this.frameDragOriginX=this.frameDragOffsetX,this.frameDragOriginY=this.frameDragOffsetY,window.addEventListener("pointermove",this.onFrameDragMove),window.addEventListener("pointerup",this.onFrameDragEnd))})}setupSpaceKeyListener(){window.addEventListener("keydown",e=>{e.code==="Space"&&!this.isInputFocused()&&(this.isSpaceKeyPressed||(this.isSpaceKeyPressed=!0,this.updateDragCursor(),e.preventDefault()))}),window.addEventListener("keyup",e=>{e.code==="Space"&&(this.isSpaceKeyPressed=!1,this.updateDragCursor(),this.frameDragActive&&this.onFrameDragEnd())}),window.addEventListener("blur",()=>{this.isSpaceKeyPressed=!1,this.updateDragCursor(),this.frameDragActive&&this.onFrameDragEnd()})}isInputFocused(){let e=document.activeElement;if(!e)return!1;let t=e.tagName.toLowerCase();return t==="input"||t==="textarea"||t==="select"||e.isContentEditable}updateDragCursor(){this.isSpaceKeyPressed?(this.frameDragger.style.cursor="grab",this.frameDragActive&&(this.frameDragger.style.cursor="grabbing")):this.frameDragger.style.cursor=""}adjustUserZoom(e){this.userScaleMultiplier=Math.max(.1,Math.min(6,this.userScaleMultiplier+e)),this.applyTransform(),this.emitScreenChange()}toggleRotation(){var t,n;if(this.viewMode==="compare")return;let e=this.autoScale*this.userScaleMultiplier;this.isLandscape=!this.isLandscape,this.applyPresetDimensions(),this.fitToScreen({keepVisibleScale:e}),(n=(t=this.options).onDeviceChange)==null||n.call(t,this.getEffectivePreset()),this.emitScreenChange()}emitScreenChange(){if(!this.gameReady)return;let e=this.getEffectivePreset(),t={width:e.width,height:e.height,dpr:Math.max(1,Math.floor(window.devicePixelRatio||1)),presetId:e.id,isLandscape:this.isLandscape};if(window.dispatchEvent(new CustomEvent("handler-preview:screen",{detail:t})),this.viewMode==="compare"&&this.refreshCompareSnapshots(),this.isInitialized&&this.isMounted&&this.gameReady){let n=window.gameApp;if(!(n!=null&&n.renderer))return;this.ignoreNextWindowResize=!0,window.dispatchEvent(new Event("resize"))}}safeStringify(e){var n;let t=new WeakSet;try{return JSON.stringify(e,(a,r)=>{if(typeof r=="object"&&r!==null){if(t.has(r))return"[Circular]";t.add(r)}return r},2)}catch{try{if(e&&((n=e.constructor)!=null&&n.name))return`[object ${e.constructor.name}]`}catch{}return String(e)}}setupConsoleInterceptor(){let e=console.log.bind(console),t=console.warn.bind(console),n=console.error.bind(console),a=console.info.bind(console),r=(s,...o)=>{let l=o.map(p=>typeof p=="object"?this.safeStringify(p):String(p)).join(" ");this.consoleMessages.push({type:s,message:l,timestamp:new Date}),this.appendConsoleMessage(this.consoleMessages[this.consoleMessages.length-1]);let c=this.container.querySelector("#console-badge");if(c){let p=this.consoleMessages.filter(d=>d.type==="error").length;c.textContent=p>0?`${p}!`:"0",c.classList.toggle("has-errors",p>0)}};console.log=(...s)=>{e(...s),r("log",...s)},console.warn=(...s)=>{t(...s),r("warn",...s)},console.error=(...s)=>{n(...s),r("error",...s)},console.info=(...s)=>{a(...s),r("info",...s)}}appendConsoleMessage(e){let t=this.container.querySelector("#console-messages");if(!t)return;let n=document.createElement("div");n.className=`console-msg type-${e.type}`;let a=e.timestamp.toLocaleTimeString();n.innerHTML=`<span class="time">${this.escapeHtml(a)}</span> <pre>${this.escapeHtml(e.message)}</pre>`,t.appendChild(n),t.scrollTop=t.scrollHeight}escapeHtml(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}toggleConsole(e){var t;this.isConsoleOpen=e!=null?e:!this.isConsoleOpen,(t=this.consolePanel)==null||t.classList.toggle("closed",!this.isConsoleOpen)}clearConsole(){this.consoleMessages=[];let e=this.container.querySelector("#console-messages");e&&(e.innerHTML="");let t=this.container.querySelector("#console-badge");t&&(t.textContent="0")}setupCompareViewports(){Array.from(this.container.querySelectorAll("[data-viewport]")).forEach(t=>{let n=t.dataset.viewport;if(!n)return;let a=this.comparePresets.find(d=>d.id===n);if(!a)return;let r=t.querySelector("[data-compare-slot]"),s=t.querySelector("[data-compare-ghost]"),o=t.querySelector("[data-compare-wrapper]"),l=t.querySelector("[data-compare-frame]"),c=t.querySelector("[data-compare-snapshot]"),p=t.querySelector("[data-compare-focus]");!r||!s||!o||!l||(t.addEventListener("click",d=>{let u=d.target;if(u!=null&&u.closest("[data-compare-focus]")){d.preventDefault(),this.activateCompareViewport(n);return}t.classList.contains("is-active")||this.activateCompareViewport(n)}),this.compareViewports.set(n,{preset:a,root:t,slot:r,ghost:s,wrapper:o,frame:l,canvas:c,focus:p}))})}setViewMode(e){if(this.viewMode===e)return;this.viewMode=e,this.container.classList.toggle("compare-mode",e==="compare"),this.singleStage.classList.toggle("hidden",e!=="single"),this.compareStage.classList.toggle("hidden",e!=="compare");let t=this.container.querySelector("#device-select");t&&(t.disabled=e==="compare");let n=this.container.querySelector("#rotate-btn");if(n&&(n.disabled=e==="compare"),this.updateViewToggleUI(),e==="compare"){this.lastSinglePresetId=this.currentPreset.id,this.activateCompareViewport(this.activeCompareId),this.refreshCompareSnapshots(),this.startCompareSnapshots();return}this.stopCompareSnapshots(),this.singleStage.appendChild(this.frameDragger),this.setDevice(this.lastSinglePresetId,{suppressCallback:!0}),this.fitToScreen()}updateViewToggleUI(){Array.from(this.container.querySelectorAll("[data-view-toggle]")).forEach(t=>{t.classList.toggle("active",t.dataset.viewToggle===this.viewMode)})}activateCompareViewport(e){var r,s;let t=this.compareViewports.get(e);if(!t)return;let n=this.autoScale*this.userScaleMultiplier,a=this.activeCompareId;a&&a!==e&&this.captureCompareSnapshot(a),this.activeCompareId=e,this.currentPreset=t.preset,this.isLandscape=!1,t.slot.appendChild(this.frameDragger),this.frameDragOffsetX=0,this.frameDragOffsetY=0,this.applyFrameDrag(),this.compareViewports.forEach((o,l)=>{o.root.classList.toggle("is-active",l===e),o.ghost.classList.toggle("hidden",l===e),o.focus&&(o.focus.textContent=l===e?"Live":"Focus")}),this.applyPresetDimensions(),this.applyCompareDimensions(),this.fitToScreen({keepVisibleScale:n}),(s=(r=this.options).onDeviceChange)==null||s.call(r,this.getEffectivePreset())}applyCompareDimensions(){this.compareViewports.forEach(e=>{let t=e.preset,n=`${t.width}px`,a=`${t.height}px`;e.frame.style.width=n,e.frame.style.height=a,e.canvas&&(e.canvas.width=t.width,e.canvas.height=t.height)})}fitCompareGhosts(){this.compareViewports.forEach(e=>{let t=e.root.querySelector(".compare-body");if(!t)return;let n=Math.max(0,t.clientWidth-24),a=Math.max(0,t.clientHeight-24);if(n<=0||a<=0)return;let r=n/e.preset.width,s=a/e.preset.height,o=Math.max(.01,Math.min(r,s));e.wrapper.style.transform=`scale(${o})`})}captureCompareSnapshot(e){let t=this.compareViewports.get(e);if(!(t!=null&&t.canvas))return;let n=this.gameContainer.querySelector("canvas");if(!n)return;let a=t.canvas.getContext("2d");if(!a)return;let r=t.canvas.width,s=t.canvas.height,o=Math.min(r/n.width,s/n.height),l=n.width*o,c=n.height*o,p=(r-l)/2,d=(s-c)/2;a.clearRect(0,0,r,s),a.drawImage(n,p,d,l,c)}refreshCompareSnapshots(){this.compareViewports.forEach((e,t)=>{t!==this.activeCompareId&&this.captureCompareSnapshot(t)})}startCompareSnapshots(){this.compareSnapshotTimer||(this.compareSnapshotTimer=window.setInterval(()=>{this.viewMode==="compare"&&this.refreshCompareSnapshots()},500))}stopCompareSnapshots(){this.compareSnapshotTimer&&(window.clearInterval(this.compareSnapshotTimer),this.compareSnapshotTimer=null)}getFitBounds(){if(this.viewMode!=="compare")return{width:this.previewContainer.clientWidth-40,height:this.previewContainer.clientHeight-40};let e=this.compareViewports.get(this.activeCompareId),t=e==null?void 0:e.root.querySelector(".compare-body");return t?{width:t.clientWidth-24,height:t.clientHeight-24}:{width:this.previewContainer.clientWidth-40,height:this.previewContainer.clientHeight-40}}mustQuery(e){let t=this.container.querySelector(e);if(!t)throw new Error(`PreviewShell missing element: ${e}`);return t}};function oa(i={}){let e=new Hn(i);return typeof window!="undefined"&&(window.__previewShell=e),e.mount(),e}K();function la(i){try{if(i&&typeof i.keys=="function")return Array.from(i.keys())}catch{}return[]}function ls(i){var e;return i?((e=i.getDisplayObject)==null?void 0:e.call(i))||i.pixiObject||i:null}function Ko(i,e){if(!i||!(e!=null&&e.interaction))return;let t=e.interaction,n=t.enabled!==!1&&(t.draggable===!0||t.clickable===!0);i.eventMode=n?"static":"none",i.interactive=n,n&&(i.cursor=t.draggable?"move":"pointer")}function cs(i,e){var l,c,p,d,u;if(!i||!e)return;let t=e.transform||{};Ko(i,e);let n=t.position||{},a=t.offset||{},r=(typeof n.x=="number"?n.x:0)+(typeof a.x=="number"?a.x:0),s=(typeof n.y=="number"?n.y:0)+(typeof a.y=="number"?a.y:0);(l=i.position)!=null&&l.set?i.position.set(r,s):(typeof i.x=="number"&&(i.x=r),typeof i.y=="number"&&(i.y=s)),typeof t.scale=="number"&&((c=i.scale)!=null&&c.set?i.scale.set(t.scale):i.scale&&(i.scale.x=t.scale,i.scale.y=t.scale));let o=(d=t.anchor)!=null?d:(p=e.render)==null?void 0:p.anchor;o&&((u=i.anchor)!=null&&u.set)&&typeof o.x=="number"&&typeof o.y=="number"&&i.anchor.set(o.x,o.y)}function ds(i){if(typeof window=="undefined")return;let e=i==null?void 0:i.objects,t=la(e),n=r=>{try{let s=window.__HANDLER_ACTIVE_SCREEN;if(!s||s==="all")return r;let o=window.__HANDLER_SCREEN_INDEX,l=o==null?void 0:o.instanceToScreen;return l?r.filter(c=>l[c]===s):r}catch{return r}};window.__editableObjectConfigs=e;let a=new Map;t.forEach(r=>a.set(r,[r])),window.__editableObjectInstances=a,window.refreshEditableConfigIndex=()=>ds(window.__editableConfig),window.getEditableObjectList=()=>{var r;return n(la((r=window.__editableConfig)==null?void 0:r.objects))},window.getEditableObjectListAll=()=>{var r;return la((r=window.__editableConfig)==null?void 0:r.objects)},window.getEditableObjectConfig=r=>{var p,d,u,g,h;let s=(g=(u=(d=(p=window.__editableConfig)==null?void 0:p.objects)==null?void 0:d.get)==null?void 0:u.call(d,r))!=null?g:null,o=window.__HANDLER_ACTIVE_SCREEN;if(!o||o==="all")return s;let l=window.__HANDLER_SCREEN_INDEX,c=(h=l==null?void 0:l.instanceToScreen)==null?void 0:h[r];return c&&c===o?s:null},window.getEditableEngineConfig=()=>{let r=window.__editableConfig;if(console.log("[BRIDGE] getEditableEngineConfig called, cfg present:",!!r),!r)return null;if(r.engine&&r.objects instanceof Map){console.log("[BRIDGE] Detected ObjectCentricConfig, flattening...");let s={...r.engine,objects:r.objects,scene:r.scene};return console.log("[BRIDGE] Returned assets:",Object.keys(s.assets||{})),s}return r}}function Xo(){if(typeof window=="undefined")return;let i=t=>{let n=String(t||"").trim();return n?/^(data:|blob:|https?:)/.test(n)||n.startsWith("/")?n:`/${n.replace(/^\.\//,"")}`:""},e=async(t,n)=>{var r,s,o;let a=i(n);if(a)try{let[{Assets:l},{AssetTextures:c}]=await Promise.all([import("pixi.js"),Promise.resolve().then(()=>(Ke(),ar))]),p=Date.now(),d=/^(data:|blob:)/.test(a)?a:a+(a.includes("?")?`&t=${p}`:`?t=${p}`),u=await l.load(d);if(!u)return;c[t]=u;let g=window.CustomAssets;(r=g==null?void 0:g[t])!=null&&r.texture&&(g[t].texture=u);let h=window.gameObjectManager,f=(s=h==null?void 0:h.get)==null?void 0:s.call(h,t);if(f){let m=((o=f.getDisplayObject)==null?void 0:o.call(f))||f.pixiObject||f.pixi||f;if(m!=null&&m.texture)m.texture=u;else if(m!=null&&m.children){let b=m.children.find(y=>y==null?void 0:y.texture);b!=null&&b.texture&&(b.texture=u)}}}catch(l){console.warn("[LIVE-EDIT] Failed to reload Pixi texture for",t,l)}};window.applyLiveEditOverrides=t=>{try{let n=Y();Array.isArray(n)&&n.length&&(window.__editableConfig=t,Se(n,{silent:!0,persist:!1}))}catch{}},window.applyEngineOverrides=t=>{try{let n=Y();Array.isArray(n)&&n.length&&(window.__editableConfig=t,Se(n,{silent:!0,persist:!1}))}catch{}},window.applyEditableEngineConfig=t=>{let n=window.__editableConfig;if(!(n!=null&&n.engine))return;let a=[];if(t.runtime)for(let[r,s]of Object.entries(t.runtime))a.push({path:`runtime.${r}`,value:s});if(t.assets)for(let[r,s]of Object.entries(t.assets))a.push({path:`assets.${r}`,value:s}),typeof s=="string"&&e(r,s);if(t.splash)for(let[r,s]of Object.entries(t.splash))a.push({path:`splash.${r}`,value:s});if(t.loading)for(let[r,s]of Object.entries(t.loading))a.push({path:`loading.${r}`,value:s});if(t.start)for(let[r,s]of Object.entries(t.start))a.push({path:`start.${r}`,value:s});a.length&&Se(a,{silent:!0,persist:!0,emitEvent:!0})}}function Bn(i){let{getConfig:e,gameObjectManager:t,onObjectConfigApplied:n}=i;t&&(t.onObjectRebuildRequired=async(r,s)=>{console.log(`[LIVE-EDIT] \u{1F3D7}\uFE0F Rebuilding object ${r} due to type change...`);let o=t.get(r),l=o==null?void 0:o.pixiObject,c=l==null?void 0:l.parent,p=c==null?void 0:c.children.indexOf(l);o?t.remove(r):l&&l.destroy();let d=window.gameApp,u=await Ee.create(r,s,d);c&&(p!==void 0&&p!==-1?c.addChildAt(u,p):c.addChild(u));let g=t.create(r,u);return console.log(`[LIVE-EDIT] \u2705 Rebuild complete for ${r}`),g}),typeof window!="undefined"&&(Xo(),window.applyEditableObjectConfig=(r,s)=>{var o,l,c;console.log("[LIVE-EDIT] \u{1F504} applyEditableObjectConfig called for:",r);try{let p=window.__editableConfig;(o=p==null?void 0:p.objects)!=null&&o.set&&(p.objects.set(r,s),console.log("[LIVE-EDIT] \u2705 Updated config in __editableConfig"));let d=(l=t==null?void 0:t.get)==null?void 0:l.call(t,r);if(console.log("[LIVE-EDIT] gameObject found?",!!d),d&&(console.log("[LIVE-EDIT] gameObject type:",(c=d.constructor)==null?void 0:c.name),console.log("[LIVE-EDIT] has updateConfig?",typeof d.updateConfig=="function"),console.log("[LIVE-EDIT] has onConfigUpdate?",typeof d.onConfigUpdate=="function")),d&&typeof d.updateConfig=="function")console.log("[LIVE-EDIT] \u2705 Calling updateConfig()"),d.updateConfig(s);else if(d&&typeof d.onConfigUpdate=="function")console.log("[LIVE-EDIT] \u2705 Calling onConfigUpdate()"),d.onConfigUpdate();else{console.log("[LIVE-EDIT] \u26A0\uFE0F No updateConfig or onConfigUpdate, applying transform directly");let u=ls(d);cs(u,s)}}catch(p){console.error("[LIVE-EDIT] \u274C Error in applyEditableObjectConfig:",p)}});let a={async applyObjectConfig(r,s){var p,d;console.log("[BRIDGE] \u{1F504} applyObjectConfig called for:",r);let o=e();(p=o==null?void 0:o.objects)!=null&&p.set&&(o.objects.set(r,s),console.log("[BRIDGE] \u2705 Updated config"));let l=(d=t==null?void 0:t.get)==null?void 0:d.call(t,r);if(console.log("[BRIDGE] gameObject found?",!!l),l&&(console.log("[BRIDGE] has updateConfig?",typeof l.updateConfig=="function"),console.log("[BRIDGE] has onConfigUpdate?",typeof l.onConfigUpdate=="function")),l&&typeof l.updateConfig=="function")console.log("[BRIDGE] \u2705 Calling updateConfig()"),l.updateConfig(s);else if(l&&typeof l.onConfigUpdate=="function")console.log("[BRIDGE] \u2705 Calling onConfigUpdate()"),l.onConfigUpdate();else{console.log("[BRIDGE] \u26A0\uFE0F Applying transform directly");let u=ls(l);cs(u,s)}let c=[r];n==null||n(r,s,c)},rebuildIndexes(){let r=e();typeof window!="undefined"&&(window.__editableConfig=r,ds(r))}};return a.rebuildIndexes(),a}K();var gs=qe(require("lottie-web"),1);si(ai);typeof window!="undefined"&&!window.lottie&&(window.lottie=gs.default);var nt=null,Jo=async()=>{if(!nt){let i=typeof window!="undefined"?window.INLINE_ASSETS:null,e=(i==null?void 0:i["handler.config"])||(i==null?void 0:i["handler.config.json"]);if(e)try{if(e.startsWith("data:")){let n=atob(e.split(",")[1]);nt=JSON.parse(n)}else nt=JSON.parse(e);return nt}catch(n){console.warn("[CONFIG] Failed to parse inline handler.config.json:",n)}nt=await(await fetch("./handler.config.json")).json()}return nt},ua,It,fs,it,da,pa;function Zo(i){ua=i.initGame,It=i.CustomAssets,fs=i.updateScreenState,it=i.globalResponsiveMultipliers,da=i.layout,pa=i.clearResponsiveElements}var Fn="web_embed",Ot="https://example.com",ps={profile_id:Fn},Pe=null,oe=null,ca={width:0,height:0},Qo=!0,el=async()=>{var c,p,d,u;document.title="Handler Pixi Game";let i=await Jo();ps={...i.ids||{},profile_id:Fn},Ot=i.destination_url||((p=(c=i.export_profiles)==null?void 0:c[Fn])==null?void 0:p.destination_url)||Ot,Oe.init({ids:ps,profile:Fn,destinationUrl:Ot});let e=Oe.getRoot();if(typeof __PREVIEW_SHELL__!="undefined"&&__PREVIEW_SHELL__){console.log("[BOOTSTRAP] Initializing Preview Shell..."),oe=oa({onDeviceChange:h=>{console.log(`[PREVIEW] Device switched to ${h.width}x${h.height}, restarting game...`),us()},onRefresh:us});let g=oe.getGameContainer();g&&(e=g),window.addEventListener("handler-preview:screen",h=>{var v,x,E,w,T,S,O,B,M,C,I;let f=window.gameApp,m=window.gameObjectManager,{width:b,height:y}=h.detail;if(ca.width=b,ca.height=y,fs(b,y),!(!f||!f.renderer)){m&&o(f,m);try{f.renderer.resize(b,y);let k=f.view;k&&(k.style.width="100%",k.style.height="100%",k.style.display="block")}catch(k){console.warn("[SCREEN] Error resizing renderer:",k);return}if(t&&m&&da)try{let k=(v=window.__mainContainer)!=null?v:f.stage,D=(O=(S=(w=window.__tutorialLabel)!=null?w:(E=(x=m.get("label_1"))==null?void 0:x.getDisplayObject)==null?void 0:E.call(x))!=null?S:(T=m.get("label_1"))==null?void 0:T.pixiObject)!=null?O:m.get("label_1"),R=m.get("background_1"),$=(I=(C=(M=window.__background)!=null?M:(B=R==null?void 0:R.getDisplayObject)==null?void 0:B.call(R))!=null?C:R==null?void 0:R.pixiObject)!=null?I:R;if(k){let A=k===f.stage;da({mainContainer:k,label:D,background:$,backgroundTexture:($==null?void 0:$.texture)||null,app:f},t,0,ca,m,{skipMainContainerTransform:A})}}catch(k){console.warn("[SCREEN] Error in layout:",k)}}})}let t=await me("scene.main");window.__editableConfig=t,s(),window.__editableConfigBaseline||(window.__editableConfigBaseline=G(t),console.log("[BOOTSTRAP] Frozen config baseline for persistence")),(u=(d=t.engine.runtime)==null?void 0:d.layout)!=null&&u.design_width_portrait||(console.warn("[BOOTSTRAP] Config layout missing, retrying..."),await new Promise(g=>setTimeout(g,100)),t=await me("scene.main"));let n=await ua(e,t,Ot,oe);Pe=n.app;let a=n.gameObjectManager;window.gameApp=Pe,window.gameObjectManager=a;try{window.__liveEditBridge=Bn({getConfig:()=>window.__editableConfig,gameObjectManager:a,assets:It})}catch(g){console.warn("[BOOTSTRAP] Failed to initialize live-edit bridge",g)}oe&&oe.notifyGameLoaded();let r=window.__debugScale;r&&typeof r=="number"&&(it.scale=r,console.log(`[DEBUG] Applied persisted debug scale: ${r}`)),o(Pe,a);async function s(){try{let g=async y=>{let v=y.startsWith("/")?y:`/${y}`,x=await fetch(v,{cache:"no-cache"});if(!x.ok)return null;let E=await x.text();try{return JSON.parse(E)}catch{return null}},h=await g("configs/flow/app.flow.json");if(!h||typeof h!="object")return;let f=h.screens;if(!f||typeof f!="object")return;let m={},b={};for(let[y,v]of Object.entries(f)){let x=v==null?void 0:v.source;if(typeof x!="string")continue;let E=await g(x),w=E==null?void 0:E.elements;if(!Array.isArray(w))continue;let T=w.map(S=>S==null?void 0:S.instance_id).filter(S=>typeof S=="string");m[y]=T;for(let S of T)b[S]||(b[S]=y)}window.__HANDLER_APP_FLOW=h,window.__HANDLER_SCREEN_INDEX={screenToInstances:m,instanceToScreen:b},window.dispatchEvent(new CustomEvent("handler:screen-index-loaded"))}catch{}}function o(g,h){if(Qo){console.log("[RESPONSIVE] Skipping global scaling; using config-driven layout");return}if(console.log("[RESPONSIVE] ===== APPLYING GLOBAL RESPONSIVE SCALING ====="),console.log(`[RESPONSIVE] Scale multiplier: ${it.scale.toFixed(3)}`),g.stage){let m=function(b,y=0){if(!b||!b.children)return;let v=" ".repeat(y);b.children.forEach((x,E)=>{if(x&&x.zIndex===9999){console.log(`${v}[RESPONSIVE] Skipping debug border (zIndex 9999)`);return}if(x&&x.scale){let w=x.scale.x||1,T=x.scale.y||1;x.__originalScale||(x.__originalScale={x:w,y:T},console.log(`${v}[RESPONSIVE] Stored original scale for child[${E}]: ${w.toFixed(3)}, ${T.toFixed(3)}`));let S=x.__originalScale.x*it.scale,O=x.__originalScale.y*it.scale;typeof x.scale.set=="function"?x.scale.set(S,O):(x.scale.x=S,x.scale.y=O),console.log(`${v}[RESPONSIVE] Child[${E}] scale: ${w.toFixed(3)}\u2192${x.scale.x.toFixed(3)} (type: ${x.constructor.name})`),m(x,y+1)}else x&&console.log(`${v}[RESPONSIVE] Child[${E}] has no scale (type: ${x.constructor.name})`)})};var f=m;console.log("[RESPONSIVE] Applying scale to PIXI stage children"),m(g.stage)}else console.warn("[RESPONSIVE] No app.stage found!");console.log("[REDDEBUG] Debug border left unscaled (fixed boundaries)"),console.log("[RESPONSIVE] ===== GLOBAL RESPONSIVE SCALING COMPLETE =====")}function l(g){if(g!==void 0){it.scale=g,console.log(`[RESPONSIVE] Updated global scale multiplier to: ${g.toFixed(3)}`);let h=window.gameApp,f=window.gameObjectManager;h&&f?(o(h,f),h.renderer&&(h.renderer.render(h.stage),console.log("[RESPONSIVE] Forced PIXI renderer update"))):console.warn(`[RESPONSIVE] No gameApp (${!!h}) or gameObjectManager (${!!f}) found in window for live update`)}}window.updateGlobalResponsiveMultipliers=l,Oe.start()},us=async()=>{var e,t,n,a;console.log("[PREVIEW] Restarting game in 1 seconds...");let i=(e=window.gameObjectManager)==null?void 0:e.get("character_1");if(i){let r=((t=i.getDisplayObject)==null?void 0:t.call(i))||i;r&&r.scale&&console.log(`[CHARACTER] Before restart - Current scale - x: ${((n=r.scale.x)!=null?n:1).toFixed(3)}, y: ${((a=r.scale.y)!=null?a:1).toFixed(3)}`)}if(oe){oe.notifyGameDestroyed();try{pa&&pa()}catch(r){console.warn("Failed to clear responsive elements",r)}setTimeout(()=>{console.log("[PREVIEW] Executing restart...");let r=oe.getGameContainer(),s=window.gameObjectManager;if(s&&typeof s.clear=="function"&&(console.log("[PREVIEW] Clearing old GameObjectManager tickers..."),s.clear()),Pe){try{Pe.destroy(!0,{children:!0,texture:!1})}catch(o){console.warn("[PREVIEW] Destroy warning:",o)}Pe=null}window.gameApp=null,window.gameObjectManager=null,r&&(r.innerHTML="");try{typeof It.resetScene=="function"&&It.resetScene()}catch(o){console.warn("Asset reset failed",o)}setTimeout(()=>{me("scene.main").then(o=>{window.__editableConfig=o,window.__editableConfigBaseline||(window.__editableConfigBaseline=G(o)),ua(r,o,Ot).then(l=>{Pe=l.app,window.gameApp=Pe,window.gameObjectManager=l.gameObjectManager;try{window.__liveEditBridge=Bn({getConfig:()=>window.__editableConfig,gameObjectManager:window.gameObjectManager,assets:It})}catch(c){console.warn("[BOOTSTRAP] Failed to re-initialize live-edit bridge",c)}oe&&oe.notifyGameLoaded(),console.log("[PREVIEW] Game restarted successfully");try{Oe.start()}catch{}})})},100)},1e3)}};dn();K();var le={background:"#F6F3EF",ink:"#1E1E1E",secondaryText:"#8E8A84",primaryAccent:"#E38A5A",secondaryAccent:"#C9A28C",statusGreen:"#5F8F6B"},hs=1.25,ms={fontFamily:"Inter, system-ui, sans-serif"};var Un=class{constructor(e={}){this.currentProgress=0;var t;this.currentProgress=(t=e.progress)!=null?t:0,this.container=this.createContainer()}createContainer(){let e=document.createElement("div");e.className="handler-loading-screen",e.style.cssText=`
|
|
1492
1493
|
position: fixed;
|
|
1493
1494
|
inset: 0;
|
|
1494
1495
|
display: flex;
|
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-
|
|
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-YDMSBKAK.js";import"./chunk-I5OOVR5U.js";import{a as q,b as r,c as s,d as t,e as u,f as v,g as w,h as x,i as y,j as z,k as A,l as B,m as C,n as D,o as E}from"./chunk-LV4HGC5G.js";import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l,l as m,m as n,n as o,o as p}from"./chunk-ZLL42OOV.js";import"./chunk-E6WJCS24.js";import"./chunk-JXBG6UFL.js";export{Q as COLORS,B as ConfigWatcher,K as DebugPanel,A as DefaultReloadStrategy,U as Handler,T as PlayableLoadingScreen,L as PreviewShell,R as STROKE_WIDTH,S as THEME,d as applyConfigOverride,e as applyConfigOverrides,n as applyConfigsToDisk,x as applyDefaults,a as baseLottie,P as bootstrap,f as clearConfigOverrides,g as clearConfigOverridesForObject,j as configOverrideManager,M as createPreviewShell,k as deepClone,V as default,H as defaultPreset,G as deviceGroups,F as devicePresets,C as diffConfigs,l as exportConfigsAsJSON,i as getConfigOverrides,m as getConfigStateSummary,b as getOverrideMode,I as getPresetById,J as getPresetsByCategory,s as loadAllObjectConfigs,q as loadComponentSchemas,t as loadEngineConfig,u as loadGamePromptConfig,y as loadObjectCentricConfig,r as loadObjectConfig,v as loadSceneConfig,D as rehydrateObject,h as removeConfigOverride,o as resetToApplied,p as resetToOriginal,O as setBootstrapDependencies,c as setOverrideMode,E as setupHotReload,N as setupLiveEditBridge,z as toLegacyFormat,w as validateObjectConfig};
|
package/dist/pixi/index.cjs
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
<button class="debug-btn primary" data-modal-apply>Apply</button>
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
|
-
`,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(s=>{s.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(s=>{s.addEventListener("click",o=>{let c=o.target.dataset.tab;c&&this.switchTab(c)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let r=this.modal.querySelector("[data-modal-apply]");r==null||r.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let t=window.__openAiEditor;if(typeof t!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,t(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Nr={};Wn(Nr,{AssetCache:()=>Q,AssetLoader:()=>fe,AssetSystem:()=>It,AssetTextures:()=>he,Assets:()=>pa,BaseSystem:()=>Ne,GameEngine:()=>Ot,GameObject:()=>ot,GameObjectManager:()=>$e,ObjectFactory:()=>me,Renderer:()=>st,RuntimeObjectRegistry:()=>He,Transform:()=>rt,applyScreenAnchor:()=>Dt,basePixi:()=>oa,clearResponsiveElements:()=>ga,createPixiBase:()=>Mt,getRegisteredFontIds:()=>ia,globalResponsiveMultipliers:()=>ct,initAssetTextures:()=>At,initAssets:()=>ua,layout:()=>ha,playLottieOverlay:()=>ra,registerFont:()=>na,registerType:()=>wt,resolveAnchorVec2:()=>Ce,resolveFont:()=>ea,resolveFontWeight:()=>ta,resolveScreenAnchorPoint:()=>Be,resolveScreenRatioPoint:()=>Fe,runInitSequence:()=>ma,setLottieInstance:()=>St,spawnSceneFromConfig:()=>ca,updateScreenState:()=>jt});module.exports=Ea(Nr);var Qi=require("pixi.js");var pe={};function mt(n,e,t=!1){pe[n]||(pe[n]=[]),pe[n].push({fn:e,once:t})}function Gt(n,e){if(pe[n]){if(!e){delete pe[n];return}pe[n]=pe[n].filter(t=>t.fn!==e)}}function bt(n,...e){let t=pe[n];if(t)for(let i of[...t])i.fn(...e),i.once&&Gt(n,i.fn)}function q(n,e){mt(n,e,!0)}var D=null,Y=[],Le=null;function Jn(n){D=n,Y=[],Le!==null&&(clearTimeout(Le),Le=null)}function Zn(){var n,e,t;return{endpoint:(D==null?void 0:D.endpoint)||"",transport:(D==null?void 0:D.transport)||"beacon",batchSize:(n=D==null?void 0:D.batchSize)!=null?n:10,flushIntervalMs:(e=D==null?void 0:D.flushIntervalMs)!=null?e:300,maxQueue:(t=D==null?void 0:D.maxQueue)!=null?t:200,debug:!!(D!=null&&D.debug)}}async function Kn(n,e,t,i){let a=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let r=navigator.sendBeacon(n,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",r,e);return}catch(r){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",r)}try{await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(r){i&&console.warn("[handler.telemetry] fetch failed",r)}}function qt(n,e){let t=Zn();if(e&&t.endpoint){if(Y.push(n),Y.length>t.maxQueue&&(Y=Y.slice(Y.length-t.maxQueue)),Y.length>=t.batchSize){Xn();return}Le===null&&(Le=window.setTimeout(()=>{Le=null,Xn()},t.flushIntervalMs))}}async function Xn(){let n=Zn();if(!n.endpoint||Y.length===0)return;let e=Y.splice(0,n.batchSize);await Kn(n.endpoint,{events:e},n.transport,n.debug),Y.length>0&&await Kn(n.endpoint,{events:Y.splice(0,n.batchSize)},n.transport,n.debug)}function Qn(n){return Math.max(0,Math.min(1,n))}function Aa(n){let e=String(n!=null?n:"power2.out");if(e==="linear")return t=>t;if(e==="sine.inOut")return t=>.5-Math.cos(Math.PI*t)/2;if(e==="power2.out"||e==="easeOutQuad")return t=>1-(1-t)*(1-t);if(e.startsWith("back.out")){let t=e.match(/back\.out\(([\d.]+)\)/),i=t?Number(t[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return t=>1-(1-t)*(1-t)}function Ke(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Sa(n,e){let t=n==null?void 0:n[e];return typeof t=="number"?t:0}function ei(n,e,t){try{n[e]=t}catch{}}function Ca(n){let e=n==null?void 0:n.scale;if(!e)return null;let t=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:t,y:i}}function ti(n,e){let t=n==null?void 0:n.scale;if(t)try{typeof t.set=="function"?t.set(e.x,e.y):(typeof t.x=="number"&&(t.x=e.x),typeof t.y=="number"&&(t.y=e.y))}catch{}}function ni(n,e){let t=Ca(n);if(!t)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:i!=null?i:t.x,y:a!=null?a:t.y}}}function ii(){let n=new Set,e=new WeakMap,t=null,i=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),n.size>0&&i()})},a=u=>{var p;n.add(u);let l=(p=e.get(u.target))!=null?p:new Set;l.add(u),e.set(u.target,l),i()},r=u=>{n.delete(u);let l=e.get(u.target);l&&(l.delete(u),l.size===0&&e.delete(u.target))},s=u=>{u.killed||(u.killed=!0,r(u))},o=()=>{var l,p;let u=Ke();for(let g of Array.from(n)){if(g.killed||g.paused)continue;let m=u-g.startMs-g.delayMs;if(m<0)continue;let h=g.durationMs>0?m/g.durationMs:1,A=Qn(h),b=g.repeat>=0?g.repeat+1:1,f=g.repeat>0?Math.min(Math.floor(h),b-1):0;if(g.repeat>0&&h>=1){let y=h-f;A=Qn(y)}let x=g.ease(A);g.yoyo&&f%2===1&&(x=1-x);for(let y of g.props)ei(g.target,y.key,y.from+(y.to-y.from)*x);g.scaleFrom&&g.scaleTo&&ti(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*x,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*x});try{(l=g.onUpdate)==null||l.call(g)}catch{}if(h>=b){s(g);try{(p=g.onComplete)==null||p.call(g)}catch{}}}},d=(u,l,p)=>{var y;let g=Math.max(0,(typeof l.duration=="number"?l.duration:.5)*1e3),m=Math.max(0,(typeof l.delay=="number"?l.delay:0)*1e3+((y=p==null?void 0:p.delayMsOverride)!=null?y:0)),h=Aa(l.ease),A=typeof l.repeat=="number"?Math.max(0,l.repeat|0):0,b=l.yoyo===!0,f=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),x=[];for(let I of Object.keys(l)){if(f.has(I))continue;let j=l[I];typeof j=="number"&&x.push({key:I,from:Sa(u,I),to:j})}let w=ni(u,l);return{target:u,startMs:Ke(),delayMs:m,durationMs:g,ease:h,props:x,scaleFrom:w.from,scaleTo:w.to,repeat:A,yoyo:b,onUpdate:typeof l.onUpdate=="function"?l.onUpdate:void 0,onComplete:typeof l.onComplete=="function"?l.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(u,l){let p=d(u,l);return a(p),{kill:()=>s(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=Ke())},resume:()=>{var h;if(!p.paused)return;let g=(h=p.pauseAtMs)!=null?h:Ke(),m=Ke()-g;p.startMs+=m,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(u,l,p){return c.set(u,l),c.to(u,p)},set(u,l){if(!u||!l)return;for(let g of Object.keys(l)){let m=l[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof m=="number"&&ei(u,g,m)}let p=ni(u,l);p.to&&ti(u,p.to)},killTweensOf(u){let l=e.get(u);if(l)for(let p of Array.from(l))s(p)},timeline(u={}){let l=[],p=0,g=!1,m=[],h=f=>{if(typeof f=="number")return Math.max(0,f*1e3);let x=typeof f=="string"?f.trim():"";return x.startsWith("+=")?p+Math.max(0,Number(x.slice(2))*1e3||0):x?Math.max(0,Number(x)*1e3||0):p},A=f=>{l.push(f);let x=Math.max(0,(typeof f.vars.duration=="number"?f.vars.duration:.5)*1e3);p=Math.max(p,f.atMs+x)},b={to(f,x,w){return A({kind:"to",target:f,vars:x,atMs:h(w)}),b},fromTo(f,x,w,y){return A({kind:"fromTo",target:f,vars:w,from:x,atMs:h(y)}),b},play(){var f,x;if(g)return b;g=!0,m=[];for(let w of l)w.kind==="fromTo"&&c.set(w.target,(f=w.from)!=null?f:{}),m.push(c.to(w.target,{...w.vars,delay:w.atMs/1e3+((x=w.vars.delay)!=null?x:0)}));return b},pause(){for(let f of m)f.pause();return b},kill(){for(let f of m)f.kill();m=[],g=!1}};return u.paused||b.play(),b}};return c}function ai(){if(typeof window=="undefined")return;let n=window;if(!n.gsap)try{n.gsap=ii()}catch{}}var ri={name:"handler-playable-sdk",version:"0.3.49",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var V=0,Ta=V++,si=V++,oi=V++,li=V++,ci=V++,di=V++,pi=V++,ui=V++,gi=V++,fi=V++,hi=V++,mi=V++,k=Ta;function bi(){return k===si}function yi(){return k===oi}function vi(){return k===li}function xi(){return k===ci}function Te(){return k===di}function _e(){return k===pi}function wi(){return k===ui}function Ei(){return k===gi}function Ai(){return k===fi}function Vt(){return k===hi}function Wt(){return k===mi}function Si(){let n=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(n==="mraid")try{mraid.getState(),k=si;return}catch{}else if(n==="dapi")try{dapi.isReady(),k=oi;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(k=li)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(k=ci)}catch{}else if(e==="mintegral")window.gameReady&&(k=di);else if(e==="tapjoy")window.TJ_API&&(k=pi);else if(e==="tiktok")window.openAppStore&&(k=ui);else if(e==="smadex")try{window.smxTracking&&(k=gi)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(k=fi)}catch{}else e==="vungle"?k=hi:(n==="nucleo"||e==="nucleo")&&(k=mi)}var yt=ht(require("lottie-web"),1),Ci=yt.default;typeof window!="undefined"&&(window.lottie=yt.default,window.__baseLottie=yt.default);Xt();function $(n,e){let t=(a,r)=>r===0?a:t(r,a%r),i=t(n,e);return`${n/i}:${e/i}`}var ys=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:$(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:$(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:$(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:$(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:$(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:$(360,780)}],vs=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:$(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:$(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:$(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:$(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:$(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:$(412,915)}],xs=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:$(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:$(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:$(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:$(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:$(800,1280)}],Pi=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:$(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:$(768,1024),mraidScale:.7}];var ws=[...Pi];var ja=Pi[0];ue();var Ba=ht(require("jszip"),1);function za(n){return new Promise((e,t)=>{let i=new FileReader;i.onerror=()=>t(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(n)})}function Na(n){var a;let[e,t]=n.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function Ha(n){return await new Promise(e=>{let t=new Image;t.onload=()=>e({width:t.naturalWidth||t.width,height:t.naturalHeight||t.height}),t.onerror=()=>e(null),t.src=n})}async function Jt(n){var e,t;try{console.log("[ImageUtils] Fetching image data from URL:",n);let i=await fetch(n);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,n),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let r=await za(a),s=await Ha(r),o=Na(r);return console.log("[ImageUtils] Success resolution:",s==null?void 0:s.width,"x",s==null?void 0:s.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:r,width:(e=s==null?void 0:s.width)!=null?e:0,height:(t=s==null?void 0:s.height)!=null?t:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function vt(n,e=30){try{console.log("[ImageUtils] Removing background color...");let t=await new Promise((l,p)=>{let g=new Image;g.onload=()=>l(g),g.onerror=()=>p(new Error("Failed to load image")),g.src=n}),i=document.createElement("canvas");i.width=t.width,i.height=t.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),n;a.drawImage(t,0,0);let r=a.getImageData(0,0,i.width,i.height),s=r.data,d=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(l=>({r:s[l.offset],g:s[l.offset+1],b:s[l.offset+2]})),c=0;for(let l=0;l<s.length;l+=4){let p=s[l],g=s[l+1],m=s[l+2],h=!1;for(let A of d)if(Math.sqrt(Math.pow(p-A.r,2)+Math.pow(g-A.g,2)+Math.pow(m-A.b,2))<e){h=!0;break}h&&(s[l+3]=0,c++)}return console.log(`[ImageUtils] Removed background from ${c} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(r,0,0),i.toDataURL("image/png")}catch(t){return console.error("[ImageUtils] Error removing background:",t),n}}var Mi=require("@google/genai");async function Zt(n,e,t=[],i={}){var a,r,s,o,d,c,u;try{if(!(n!=null&&n.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let b=0;b<t.length;b++){let f=t[b];if(!f.base64||!f.mimeType)throw new Error(`Image ${b+1} is missing required data`);if(f.base64.length<1e3&&console.warn(`Image ${b+1} data appears very small, may be corrupted`),!f.mimeType.startsWith("image/"))throw new Error(`Image ${b+1} has invalid MIME type: ${f.mimeType}`)}let l=new Mi.GoogleGenAI({apiKey:n}),p="gemini-2.5-flash",g=[e];t.length>0&&t.forEach((b,f)=>{g.push({inlineData:{data:b.base64,mimeType:b.mimeType}}),console.log(`[Gemini] Added image ${f+1}: ${b.mimeType}, size: ${Math.round(b.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${t.length} images and prompt length: ${e.length}`);let m=await l.models.generateContent({model:p,contents:g}),h="",A=(s=(r=(a=m.candidates)==null?void 0:a[0])==null?void 0:r.content)==null?void 0:s.parts;if(A)for(let b of A)b.text&&(h+=b.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(l){throw console.error("[Gemini] API error:",l),(o=l.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(d=l.message)!=null&&d.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(c=l.message)!=null&&c.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(u=l.message)!=null&&u.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):l}}var ki=require("@google/genai");async function xt(n,e,t=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new ki.GoogleGenAI({apiKey:n}),r=[{text:e}];t.length>0&&t.forEach((o,d)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${d}`),r.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let s=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:r});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!s.candidates||!s.candidates[0]||!s.candidates[0].content||!s.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of s.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let d=o.inlineData.data,c=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${c};base64,${d}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var Wa=require("pixi.js");Xe();ue();var $i=require("pixi.js");var Ya=require("pixi.js");ue();function tr(n){return new Promise((e,t)=>{let i=new FileReader;i.onerror=()=>t(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(n)})}function nr(n){var a;let[e,t]=n.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function ir(n){return`
|
|
46
|
+
`,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(s=>{s.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(s=>{s.addEventListener("click",o=>{let c=o.target.dataset.tab;c&&this.switchTab(c)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let r=this.modal.querySelector("[data-modal-apply]");r==null||r.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let t=window.__openAiEditor;if(typeof t!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,t(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Nr={};Wn(Nr,{AssetCache:()=>Q,AssetLoader:()=>fe,AssetSystem:()=>It,AssetTextures:()=>he,Assets:()=>pa,BaseSystem:()=>Ne,GameEngine:()=>Ot,GameObject:()=>ot,GameObjectManager:()=>$e,ObjectFactory:()=>me,Renderer:()=>st,RuntimeObjectRegistry:()=>He,Transform:()=>rt,applyScreenAnchor:()=>Dt,basePixi:()=>oa,clearResponsiveElements:()=>ga,createPixiBase:()=>Mt,getRegisteredFontIds:()=>ia,globalResponsiveMultipliers:()=>ct,initAssetTextures:()=>At,initAssets:()=>ua,layout:()=>ha,playLottieOverlay:()=>ra,registerFont:()=>na,registerType:()=>wt,resolveAnchorVec2:()=>Ce,resolveFont:()=>ea,resolveFontWeight:()=>ta,resolveScreenAnchorPoint:()=>Be,resolveScreenRatioPoint:()=>Fe,runInitSequence:()=>ma,setLottieInstance:()=>St,spawnSceneFromConfig:()=>ca,updateScreenState:()=>jt});module.exports=Ea(Nr);var Qi=require("pixi.js");var pe={};function mt(n,e,t=!1){pe[n]||(pe[n]=[]),pe[n].push({fn:e,once:t})}function Gt(n,e){if(pe[n]){if(!e){delete pe[n];return}pe[n]=pe[n].filter(t=>t.fn!==e)}}function bt(n,...e){let t=pe[n];if(t)for(let i of[...t])i.fn(...e),i.once&&Gt(n,i.fn)}function q(n,e){mt(n,e,!0)}var D=null,Y=[],Le=null;function Jn(n){D=n,Y=[],Le!==null&&(clearTimeout(Le),Le=null)}function Zn(){var n,e,t;return{endpoint:(D==null?void 0:D.endpoint)||"",transport:(D==null?void 0:D.transport)||"beacon",batchSize:(n=D==null?void 0:D.batchSize)!=null?n:10,flushIntervalMs:(e=D==null?void 0:D.flushIntervalMs)!=null?e:300,maxQueue:(t=D==null?void 0:D.maxQueue)!=null?t:200,debug:!!(D!=null&&D.debug)}}async function Kn(n,e,t,i){let a=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let r=navigator.sendBeacon(n,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",r,e);return}catch(r){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",r)}try{await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(r){i&&console.warn("[handler.telemetry] fetch failed",r)}}function qt(n,e){let t=Zn();if(e&&t.endpoint){if(Y.push(n),Y.length>t.maxQueue&&(Y=Y.slice(Y.length-t.maxQueue)),Y.length>=t.batchSize){Xn();return}Le===null&&(Le=window.setTimeout(()=>{Le=null,Xn()},t.flushIntervalMs))}}async function Xn(){let n=Zn();if(!n.endpoint||Y.length===0)return;let e=Y.splice(0,n.batchSize);await Kn(n.endpoint,{events:e},n.transport,n.debug),Y.length>0&&await Kn(n.endpoint,{events:Y.splice(0,n.batchSize)},n.transport,n.debug)}function Qn(n){return Math.max(0,Math.min(1,n))}function Aa(n){let e=String(n!=null?n:"power2.out");if(e==="linear")return t=>t;if(e==="sine.inOut")return t=>.5-Math.cos(Math.PI*t)/2;if(e==="power2.out"||e==="easeOutQuad")return t=>1-(1-t)*(1-t);if(e.startsWith("back.out")){let t=e.match(/back\.out\(([\d.]+)\)/),i=t?Number(t[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return t=>1-(1-t)*(1-t)}function Ke(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Sa(n,e){let t=n==null?void 0:n[e];return typeof t=="number"?t:0}function ei(n,e,t){try{n[e]=t}catch{}}function Ca(n){let e=n==null?void 0:n.scale;if(!e)return null;let t=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:t,y:i}}function ti(n,e){let t=n==null?void 0:n.scale;if(t)try{typeof t.set=="function"?t.set(e.x,e.y):(typeof t.x=="number"&&(t.x=e.x),typeof t.y=="number"&&(t.y=e.y))}catch{}}function ni(n,e){let t=Ca(n);if(!t)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:i!=null?i:t.x,y:a!=null?a:t.y}}}function ii(){let n=new Set,e=new WeakMap,t=null,i=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),n.size>0&&i()})},a=u=>{var p;n.add(u);let l=(p=e.get(u.target))!=null?p:new Set;l.add(u),e.set(u.target,l),i()},r=u=>{n.delete(u);let l=e.get(u.target);l&&(l.delete(u),l.size===0&&e.delete(u.target))},s=u=>{u.killed||(u.killed=!0,r(u))},o=()=>{var l,p;let u=Ke();for(let g of Array.from(n)){if(g.killed||g.paused)continue;let m=u-g.startMs-g.delayMs;if(m<0)continue;let h=g.durationMs>0?m/g.durationMs:1,A=Qn(h),b=g.repeat>=0?g.repeat+1:1,f=g.repeat>0?Math.min(Math.floor(h),b-1):0;if(g.repeat>0&&h>=1){let y=h-f;A=Qn(y)}let x=g.ease(A);g.yoyo&&f%2===1&&(x=1-x);for(let y of g.props)ei(g.target,y.key,y.from+(y.to-y.from)*x);g.scaleFrom&&g.scaleTo&&ti(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*x,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*x});try{(l=g.onUpdate)==null||l.call(g)}catch{}if(h>=b){s(g);try{(p=g.onComplete)==null||p.call(g)}catch{}}}},d=(u,l,p)=>{var y;let g=Math.max(0,(typeof l.duration=="number"?l.duration:.5)*1e3),m=Math.max(0,(typeof l.delay=="number"?l.delay:0)*1e3+((y=p==null?void 0:p.delayMsOverride)!=null?y:0)),h=Aa(l.ease),A=typeof l.repeat=="number"?Math.max(0,l.repeat|0):0,b=l.yoyo===!0,f=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),x=[];for(let I of Object.keys(l)){if(f.has(I))continue;let j=l[I];typeof j=="number"&&x.push({key:I,from:Sa(u,I),to:j})}let w=ni(u,l);return{target:u,startMs:Ke(),delayMs:m,durationMs:g,ease:h,props:x,scaleFrom:w.from,scaleTo:w.to,repeat:A,yoyo:b,onUpdate:typeof l.onUpdate=="function"?l.onUpdate:void 0,onComplete:typeof l.onComplete=="function"?l.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(u,l){let p=d(u,l);return a(p),{kill:()=>s(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=Ke())},resume:()=>{var h;if(!p.paused)return;let g=(h=p.pauseAtMs)!=null?h:Ke(),m=Ke()-g;p.startMs+=m,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(u,l,p){return c.set(u,l),c.to(u,p)},set(u,l){if(!u||!l)return;for(let g of Object.keys(l)){let m=l[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof m=="number"&&ei(u,g,m)}let p=ni(u,l);p.to&&ti(u,p.to)},killTweensOf(u){let l=e.get(u);if(l)for(let p of Array.from(l))s(p)},timeline(u={}){let l=[],p=0,g=!1,m=[],h=f=>{if(typeof f=="number")return Math.max(0,f*1e3);let x=typeof f=="string"?f.trim():"";return x.startsWith("+=")?p+Math.max(0,Number(x.slice(2))*1e3||0):x?Math.max(0,Number(x)*1e3||0):p},A=f=>{l.push(f);let x=Math.max(0,(typeof f.vars.duration=="number"?f.vars.duration:.5)*1e3);p=Math.max(p,f.atMs+x)},b={to(f,x,w){return A({kind:"to",target:f,vars:x,atMs:h(w)}),b},fromTo(f,x,w,y){return A({kind:"fromTo",target:f,vars:w,from:x,atMs:h(y)}),b},play(){var f,x;if(g)return b;g=!0,m=[];for(let w of l)w.kind==="fromTo"&&c.set(w.target,(f=w.from)!=null?f:{}),m.push(c.to(w.target,{...w.vars,delay:w.atMs/1e3+((x=w.vars.delay)!=null?x:0)}));return b},pause(){for(let f of m)f.pause();return b},kill(){for(let f of m)f.kill();m=[],g=!1}};return u.paused||b.play(),b}};return c}function ai(){if(typeof window=="undefined")return;let n=window;if(!n.gsap)try{n.gsap=ii()}catch{}}var ri={name:"handler-playable-sdk",version:"0.3.51",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var V=0,Ta=V++,si=V++,oi=V++,li=V++,ci=V++,di=V++,pi=V++,ui=V++,gi=V++,fi=V++,hi=V++,mi=V++,k=Ta;function bi(){return k===si}function yi(){return k===oi}function vi(){return k===li}function xi(){return k===ci}function Te(){return k===di}function _e(){return k===pi}function wi(){return k===ui}function Ei(){return k===gi}function Ai(){return k===fi}function Vt(){return k===hi}function Wt(){return k===mi}function Si(){let n=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(n==="mraid")try{mraid.getState(),k=si;return}catch{}else if(n==="dapi")try{dapi.isReady(),k=oi;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(k=li)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(k=ci)}catch{}else if(e==="mintegral")window.gameReady&&(k=di);else if(e==="tapjoy")window.TJ_API&&(k=pi);else if(e==="tiktok")window.openAppStore&&(k=ui);else if(e==="smadex")try{window.smxTracking&&(k=gi)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(k=fi)}catch{}else e==="vungle"?k=hi:(n==="nucleo"||e==="nucleo")&&(k=mi)}var yt=ht(require("lottie-web"),1),Ci=yt.default;typeof window!="undefined"&&(window.lottie=yt.default,window.__baseLottie=yt.default);Xt();function $(n,e){let t=(a,r)=>r===0?a:t(r,a%r),i=t(n,e);return`${n/i}:${e/i}`}var ys=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:$(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:$(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:$(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:$(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:$(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:$(360,780)}],vs=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:$(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:$(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:$(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:$(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:$(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:$(412,915)}],xs=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:$(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:$(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:$(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:$(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:$(800,1280)}],Pi=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:$(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:$(768,1024),mraidScale:.7}];var ws=[...Pi];var ja=Pi[0];ue();var Ba=ht(require("jszip"),1);function za(n){return new Promise((e,t)=>{let i=new FileReader;i.onerror=()=>t(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(n)})}function Na(n){var a;let[e,t]=n.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function Ha(n){return await new Promise(e=>{let t=new Image;t.onload=()=>e({width:t.naturalWidth||t.width,height:t.naturalHeight||t.height}),t.onerror=()=>e(null),t.src=n})}async function Jt(n){var e,t;try{console.log("[ImageUtils] Fetching image data from URL:",n);let i=await fetch(n);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,n),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let r=await za(a),s=await Ha(r),o=Na(r);return console.log("[ImageUtils] Success resolution:",s==null?void 0:s.width,"x",s==null?void 0:s.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:r,width:(e=s==null?void 0:s.width)!=null?e:0,height:(t=s==null?void 0:s.height)!=null?t:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function vt(n,e=30){try{console.log("[ImageUtils] Removing background color...");let t=await new Promise((l,p)=>{let g=new Image;g.onload=()=>l(g),g.onerror=()=>p(new Error("Failed to load image")),g.src=n}),i=document.createElement("canvas");i.width=t.width,i.height=t.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),n;a.drawImage(t,0,0);let r=a.getImageData(0,0,i.width,i.height),s=r.data,d=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(l=>({r:s[l.offset],g:s[l.offset+1],b:s[l.offset+2]})),c=0;for(let l=0;l<s.length;l+=4){let p=s[l],g=s[l+1],m=s[l+2],h=!1;for(let A of d)if(Math.sqrt(Math.pow(p-A.r,2)+Math.pow(g-A.g,2)+Math.pow(m-A.b,2))<e){h=!0;break}h&&(s[l+3]=0,c++)}return console.log(`[ImageUtils] Removed background from ${c} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(r,0,0),i.toDataURL("image/png")}catch(t){return console.error("[ImageUtils] Error removing background:",t),n}}var Mi=require("@google/genai");async function Zt(n,e,t=[],i={}){var a,r,s,o,d,c,u;try{if(!(n!=null&&n.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let b=0;b<t.length;b++){let f=t[b];if(!f.base64||!f.mimeType)throw new Error(`Image ${b+1} is missing required data`);if(f.base64.length<1e3&&console.warn(`Image ${b+1} data appears very small, may be corrupted`),!f.mimeType.startsWith("image/"))throw new Error(`Image ${b+1} has invalid MIME type: ${f.mimeType}`)}let l=new Mi.GoogleGenAI({apiKey:n}),p="gemini-2.5-flash",g=[e];t.length>0&&t.forEach((b,f)=>{g.push({inlineData:{data:b.base64,mimeType:b.mimeType}}),console.log(`[Gemini] Added image ${f+1}: ${b.mimeType}, size: ${Math.round(b.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${t.length} images and prompt length: ${e.length}`);let m=await l.models.generateContent({model:p,contents:g}),h="",A=(s=(r=(a=m.candidates)==null?void 0:a[0])==null?void 0:r.content)==null?void 0:s.parts;if(A)for(let b of A)b.text&&(h+=b.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(l){throw console.error("[Gemini] API error:",l),(o=l.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(d=l.message)!=null&&d.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(c=l.message)!=null&&c.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(u=l.message)!=null&&u.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):l}}var ki=require("@google/genai");async function xt(n,e,t=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new ki.GoogleGenAI({apiKey:n}),r=[{text:e}];t.length>0&&t.forEach((o,d)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${d}`),r.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let s=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:r});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!s.candidates||!s.candidates[0]||!s.candidates[0].content||!s.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of s.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let d=o.inlineData.data,c=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${c};base64,${d}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var Wa=require("pixi.js");Xe();ue();var $i=require("pixi.js");var Ya=require("pixi.js");ue();function tr(n){return new Promise((e,t)=>{let i=new FileReader;i.onerror=()=>t(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(n)})}function nr(n){var a;let[e,t]=n.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function ir(n){return`
|
|
47
47
|
Analyze these screenshots of a brand or game and extract its "Brand DNA".
|
|
48
48
|
|
|
49
49
|
Provide a concise summary (2-3 sentences) covering:
|
package/dist/pixi/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x3c257b,_0x589238){var a0_0xb6aa45={_0x24c7d9:0x141,_0xe35604:0x145,_0x5273ce:0x13d,_0x5d84ea:0x13b,_0x24549f:0x2e,_0x3e30ba:0x24,_0xbc1c50:0x28,_0x2119ac:0x127,_0x46c89b:'Rrt5',_0x52f997:0x131,_0x1081d0:0x136,_0x46a447:0xd9,_0x40d9c8:0xd8,_0x4926ce:0xd7,_0x5ba8aa:'tdQZ',_0x211775:0x2b,_0x241944:'@oY&',_0x50610b:0x35,_0x2b5e6f:0x2a,_0x134ef3:0xd3,_0x185742:0xca,_0x46c29d:0xcd,_0x3a84b0:0xd6,_0x27199a:0x36,_0xbce6ea:'efN1',_0x2b9035:0x34,_0x25574a:0x3b,_0x48d238:0x134,_0x26d985:')6&q',_0xee5124:0x12d,_0x151593:0x142,_0x207500:0x135,_0x24979b:0x14e},a0_0x19d6bc={_0x57a40f:0xa1},a0_0x47fd06={_0x7531f4:0x20c},a0_0x216963={_0x2f51a7:0x2b3};function _0x132fce(_0x2723b2,_0x54f88b,_0x4f0ebb,_0x32ebf2,_0x39f35b){return a0_0x3730(_0x54f88b- -a0_0x216963._0x2f51a7,_0x39f35b);}var _0x5a3e43=_0x3c257b();function _0x1aa3eb(_0x14e79d,_0x1ce528,_0x13c377,_0x36a709,_0x2a852f){return a0_0x3730(_0x36a709- -a0_0x47fd06._0x7531f4,_0x13c377);}function _0x5dc6e7(_0x3b4128,_0x72dd01,_0x32e7c1,_0x1c5657,_0x30c805){return a0_0x3730(_0x3b4128- -a0_0x19d6bc._0x57a40f,_0x32e7c1);}while(!![]){try{var _0x1786b=-parseInt(_0x5dc6e7(a0_0xb6aa45._0x24c7d9,a0_0xb6aa45._0xe35604,'opSU',a0_0xb6aa45._0x5273ce,a0_0xb6aa45._0x5d84ea))/(0xbf*-0x2e+-0x1c6*-0x2+0x1ec7*0x1)+-parseInt(_0x1aa3eb(-a0_0xb6aa45._0x24549f,-a0_0xb6aa45._0x3e30ba,'sgLu',-a0_0xb6aa45._0xbc1c50,-0x1f))/(0x1cf*0x14+-0xb30+-0x18fa*0x1)*(parseInt(_0x5dc6e7(0x133,a0_0xb6aa45._0x2119ac,a0_0xb6aa45._0x46c89b,a0_0xb6aa45._0x52f997,a0_0xb6aa45._0x1081d0))/(-0xdc4+0x6+0xdc1))+parseInt(_0x132fce(-a0_0xb6aa45._0x46a447,-a0_0xb6aa45._0x40d9c8,-a0_0xb6aa45._0x4926ce,-0xd1,a0_0xb6aa45._0x5ba8aa))/(0x149*-0x1a+-0x11e*-0x13+0xc34)+-parseInt(_0x1aa3eb(-0x30,-a0_0xb6aa45._0x211775,a0_0xb6aa45._0x241944,-a0_0xb6aa45._0x50610b,-a0_0xb6aa45._0x2b5e6f))/(0x1ebe+0xbf*-0x17+0x1c*-0x7c)+-parseInt(_0x132fce(-a0_0xb6aa45._0x134ef3,-a0_0xb6aa45._0x185742,-a0_0xb6aa45._0x46c29d,-a0_0xb6aa45._0x3a84b0,'$Yfk'))/(0xa19*0x1+0x2f*0xa7+-0x28bc)*(-parseInt(_0x1aa3eb(-a0_0xb6aa45._0x27199a,-0x3c,a0_0xb6aa45._0xbce6ea,-a0_0xb6aa45._0x2b9035,-a0_0xb6aa45._0x25574a))/(-0x33d+0x340*0x8+-0x16bc))+-parseInt(_0x5dc6e7(a0_0xb6aa45._0x48d238,0x12f,a0_0xb6aa45._0x26d985,0x140,a0_0xb6aa45._0xee5124))/(-0xa5b+-0x108a+0x1aed)+parseInt(_0x5dc6e7(a0_0xb6aa45._0x151593,0x139,a0_0xb6aa45._0x241944,a0_0xb6aa45._0x207500,a0_0xb6aa45._0x24979b))/(0x1cae+-0x11*0x175+-0x3e0);if(_0x1786b===_0x589238)break;else _0x5a3e43['push'](_0x5a3e43['shift']());}catch(_0x2226a4){_0x5a3e43['push'](_0x5a3e43['shift']());}}}(a0_0x50d9,-0x4b699+0x46ca+-0x807*-0xe2));function a0_0x3730(_0x553613,_0x1abe6d){_0x553613=_0x553613-(0x47*0x67+0x7c*0x10+0x6d*-0x51);var _0xbf92cf=a0_0x50d9();var _0x5b0f39=_0xbf92cf[_0x553613];if(a0_0x3730['WUczCP']===undefined){var _0x4951d4=function(_0x49aae8){var _0x5e40c5='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x3bb1b6='',_0x45ce28='',_0x25e0dc=_0x3bb1b6+_0x4951d4;for(var _0x2bbcea=-0xffb*-0x2+-0x19bf*-0x1+0x39b5*-0x1,_0x4f6c71,_0x72f653,_0x4b8a02=-0x205d*0x1+0x691+0x19cc;_0x72f653=_0x49aae8['charAt'](_0x4b8a02++);~_0x72f653&&(_0x4f6c71=_0x2bbcea%(-0x3*-0x683+-0x2*0x607+0x111*-0x7)?_0x4f6c71*(0xf04+-0x60d*0x4+0x8*0x12e)+_0x72f653:_0x72f653,_0x2bbcea++%(0x113d+0x1a6a+-0x2ba3*0x1))?_0x3bb1b6+=_0x25e0dc['charCodeAt'](_0x4b8a02+(0x140b+-0x48*-0x55+-0x2be9))-(0x2672+0x11*0xcb+-0x167*0x25)!==-0x5c*-0x1+0x1db4+-0x4a*0x68?String['fromCharCode'](-0x17b2+0x3f6*0x1+0x14bb&_0x4f6c71>>(-(0x19b*-0x9+0x17f8+0x5*-0x1e7)*_0x2bbcea&0x1478+-0xbd4+-0x89e*0x1)):_0x2bbcea:0x6*-0x6a+-0x17*-0x41+-0x35b){_0x72f653=_0x5e40c5['indexOf'](_0x72f653);}for(var _0x569444=0x67*0x5d+-0x88*0x39+-0x723,_0x8706d1=_0x3bb1b6['length'];_0x569444<_0x8706d1;_0x569444++){_0x45ce28+='%'+('00'+_0x3bb1b6['charCodeAt'](_0x569444)['toString'](-0x67f*-0x1+-0x1b68+-0xd*-0x19d))['slice'](-(0x5ae*-0x2+-0x1*0xaa9+0x1*0x1607));}return decodeURIComponent(_0x45ce28);};var _0x551bf0=function(_0x230ce3,_0x1b8032){var _0x1172eb=[],_0x3cdbc5=0x49f+-0x13c1+0xf22,_0x256ce3,_0x52b0c9='';_0x230ce3=_0x4951d4(_0x230ce3);var _0x11752c;for(_0x11752c=0x5*-0x583+0x906+0x1289;_0x11752c<-0x1392+-0x5db*-0x1+0xeb7;_0x11752c++){_0x1172eb[_0x11752c]=_0x11752c;}for(_0x11752c=-0x12af*-0x2+0xd1*-0x1a+-0x812*0x2;_0x11752c<0xf9a+-0x59*0x52+0xde8;_0x11752c++){_0x3cdbc5=(_0x3cdbc5+_0x1172eb[_0x11752c]+_0x1b8032['charCodeAt'](_0x11752c%_0x1b8032['length']))%(-0x15a2+-0x20ab+-0x625*-0x9),_0x256ce3=_0x1172eb[_0x11752c],_0x1172eb[_0x11752c]=_0x1172eb[_0x3cdbc5],_0x1172eb[_0x3cdbc5]=_0x256ce3;}_0x11752c=0x21d7+-0x241*0x4+-0x18d3,_0x3cdbc5=-0xcfc+0x250e+-0x1812;for(var _0xa7196a=-0x679*-0x2+-0x17b9+-0x1*-0xac7;_0xa7196a<_0x230ce3['length'];_0xa7196a++){_0x11752c=(_0x11752c+(-0x35*0xb8+-0x1*-0xabb+0x1b5e))%(-0xaef+-0x62a+-0x1219*-0x1),_0x3cdbc5=(_0x3cdbc5+_0x1172eb[_0x11752c])%(-0x247*-0x7+0x1*0x1f01+-0x2df2),_0x256ce3=_0x1172eb[_0x11752c],_0x1172eb[_0x11752c]=_0x1172eb[_0x3cdbc5],_0x1172eb[_0x3cdbc5]=_0x256ce3,_0x52b0c9+=String['fromCharCode'](_0x230ce3['charCodeAt'](_0xa7196a)^_0x1172eb[(_0x1172eb[_0x11752c]+_0x1172eb[_0x3cdbc5])%(0x250a+0x4*-0x238+0x6*-0x487)]);}return _0x52b0c9;};a0_0x3730['ueCkYB']=_0x551bf0,a0_0x3730['wpbPbV']={},a0_0x3730['WUczCP']=!![];}var _0x3d082d=_0xbf92cf[0xf31+-0x1ac4+0xb93],_0x4195bf=_0x553613+_0x3d082d,_0x3c03d6=a0_0x3730['wpbPbV'][_0x4195bf];if(!_0x3c03d6){if(a0_0x3730['YgvGbu']===undefined){var _0x40ab85=function(_0x1f28ce){this['QAHASF']=_0x1f28ce,this['bbRzzN']=[0xead+-0x2c*-0xa7+-0x2b60,0x1823+0x5a7+-0x1dca,0x749+-0x13b5+0xc6c],this['haLggU']=function(){return'newState';},this['zOqKiL']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['LVsiQj']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x40ab85['prototype']['MPffyE']=function(){var _0x24315e=new RegExp(this['zOqKiL']+this['LVsiQj']),_0x54934a=_0x24315e['test'](this['haLggU']['toString']())?--this['bbRzzN'][0xe3*0x4+0x5ef+0x4bd*-0x2]:--this['bbRzzN'][0x1cf*0x14+-0xb30+-0x18fc*0x1];return this['FNTDCf'](_0x54934a);},_0x40ab85['prototype']['FNTDCf']=function(_0x322d1c){if(!Boolean(~_0x322d1c))return _0x322d1c;return this['nzNfis'](this['QAHASF']);},_0x40ab85['prototype']['nzNfis']=function(_0x1b999c){for(var _0xa7c3c5=-0xdc4+0x6+0xdbe,_0x463bd1=this['bbRzzN']['length'];_0xa7c3c5<_0x463bd1;_0xa7c3c5++){this['bbRzzN']['push'](Math['round'](Math['random']())),_0x463bd1=this['bbRzzN']['length'];}return _0x1b999c(this['bbRzzN'][0x149*-0x1a+-0x11e*-0x13+0xc30]);},new _0x40ab85(a0_0x3730)['MPffyE'](),a0_0x3730['YgvGbu']=!![];}_0x5b0f39=a0_0x3730['ueCkYB'](_0x5b0f39,_0x1abe6d),a0_0x3730['wpbPbV'][_0x4195bf]=_0x5b0f39;}else _0x5b0f39=_0x3c03d6;return _0x5b0f39;}var a0_0x547437=(function(){var _0x42baae=!![];return function(_0xce4e09,_0xfc9b13){var a0_0x198736={_0x298b2f:0x3a0,_0x49f9cf:0x3ae},_0x39a5b5=_0x42baae?function(){var a0_0x4ee54f={_0x57f06a:0x1c3};function _0x313802(_0x4a0602,_0x14f413,_0x29224d,_0x59e751,_0x4c68cf){return a0_0x3730(_0x4c68cf-a0_0x4ee54f._0x57f06a,_0x14f413);}if(_0xfc9b13){var _0x139d15=_0xfc9b13[_0x313802(a0_0x198736._0x298b2f,'8NVM',a0_0x198736._0x49f9cf,0x3aa,0x3a1)](_0xce4e09,arguments);return _0xfc9b13=null,_0x139d15;}}:function(){};return _0x42baae=![],_0x39a5b5;};}()),a0_0x473fb1=a0_0x547437(this,function(){var a0_0x2570c6={_0x5617c1:0xcd,_0x221e0f:0xcb,_0x320656:0xc9,_0x4fce94:'DQG5',_0x245c04:'R9$L',_0x954a14:0x34,_0x213ffb:0x2d,_0x144a79:0xce,_0x1e8561:0xdc,_0x120272:0xdd,_0x2e9dd0:'@Zg4',_0x58d8c1:0x2f,_0x5e932d:'$Q2g',_0x250bb1:0x25,_0x4f7ce0:0x2e,_0x18c512:'W[UI',_0x914e26:0xf0,_0x3d2ba1:0xf1,_0x360ebe:0xd1,_0x494e01:0xdb,_0x52fc9e:0xd7,_0x2d7bca:'Zai4',_0x2a44cb:0xc6,_0x4dfd22:0xd3,_0x45a4c4:0xd5,_0x3a3093:0xd3,_0x4f8df7:'T7LD',_0x45f1f7:0x1f,_0x4d0e62:0x13,_0x797aa4:0x22,_0x11c055:0x21,_0x368355:0xe1,_0x3d0f39:0xcc,_0x28ac83:0xd4,_0x5db337:'&n8d',_0x3b9908:0x2b,_0x384640:0x35},a0_0x2e363b={_0x3a47b4:0x114},a0_0x4a5645={_0x8b4f48:0x2d2},a0_0x272858={_0x548698:0x20b},_0x7c4253={};_0x7c4253[_0x5569a1(a0_0x2570c6._0x5617c1,0xca,a0_0x2570c6._0x221e0f,a0_0x2570c6._0x320656,a0_0x2570c6._0x4fce94)]='(((.+'+_0x40d97e(-0x35,a0_0x2570c6._0x245c04,-a0_0x2570c6._0x954a14,-0x39,-a0_0x2570c6._0x213ffb)+'+$';function _0x40d97e(_0x39bba5,_0x31f1fd,_0x3844ec,_0x26cfee,_0x50beb8){return a0_0x3730(_0x39bba5- -a0_0x272858._0x548698,_0x31f1fd);}function _0x534b0b(_0x15ba5a,_0x39eeda,_0x369777,_0x4ad4be,_0x284152){return a0_0x3730(_0x15ba5a- -a0_0x4a5645._0x8b4f48,_0x369777);}var _0x1548b0=_0x7c4253;function _0x5569a1(_0x1bca94,_0x499051,_0x4080f9,_0x2fbd36,_0x3c4305){return a0_0x3730(_0x2fbd36- -a0_0x2e363b._0x3a47b4,_0x3c4305);}return a0_0x473fb1['toStr'+_0x5569a1(a0_0x2570c6._0x144a79,a0_0x2570c6._0x1e8561,a0_0x2570c6._0x120272,0xd2,a0_0x2570c6._0x2e9dd0)]()['searc'+'h']('(((.+'+_0x40d97e(-a0_0x2570c6._0x58d8c1,a0_0x2570c6._0x5e932d,-a0_0x2570c6._0x250bb1,-0x2d,-a0_0x2570c6._0x4f7ce0)+'+$')[_0x534b0b(-0xf9,-0xf6,a0_0x2570c6._0x18c512,-a0_0x2570c6._0x914e26,-a0_0x2570c6._0x3d2ba1)+_0x5569a1(a0_0x2570c6._0x360ebe,a0_0x2570c6._0x494e01,a0_0x2570c6._0x1e8561,a0_0x2570c6._0x52fc9e,a0_0x2570c6._0x2d7bca)]()[_0x5569a1(a0_0x2570c6._0x2a44cb,a0_0x2570c6._0x4dfd22,a0_0x2570c6._0x45a4c4,a0_0x2570c6._0x3a3093,a0_0x2570c6._0x4f8df7)+_0x40d97e(-a0_0x2570c6._0x45f1f7,'R9$L',-a0_0x2570c6._0x4d0e62,-a0_0x2570c6._0x797aa4,-a0_0x2570c6._0x11c055)+'r'](a0_0x473fb1)[_0x5569a1(a0_0x2570c6._0x368355,a0_0x2570c6._0x3d0f39,0xcf,a0_0x2570c6._0x28ac83,a0_0x2570c6._0x5db337)+'h'](_0x1548b0[_0x40d97e(-a0_0x2570c6._0x3b9908,'x#Ds',-0x25,-0x20,-a0_0x2570c6._0x384640)]);});a0_0x473fb1();import{A as a0_0x2148a5,B as a0_0x21d354,C as a0_0x22ad2c,D as a0_0x50e019,b as a0_0x55eebd,c as a0_0x58a37d,d as a0_0x191c80,e as a0_0x524824,f as a0_0x36adf1,g as a0_0x3553c6,h as a0_0x179495,i as a0_0x1f7f08,j as a0_0x2d53d6,k as a0_0xa3b508,l as a0_0xe0da7e,m as a0_0x3ab3f0,n as a0_0x346c6b,o as a0_0x39d090,p as a0_0x2d8bce,q as a0_0x193659,r as a0_0x17cd83,s as a0_0x36d59d,t as a0_0x125981,u as a0_0x500e1a,v as a0_0x4e7457,w as a0_0xbc9333,x as a0_0x5d4bf9,y as a0_0x15c7e9,z as a0_0x43330a}from'../chunk-TY4466XH.js';import{a as a0_0x14d7ac,b as a0_0x381260,c as a0_0x4c6c6e,d as a0_0x436bc1,e as a0_0xe65914}from'../chunk-I5OOVR5U.js';function a0_0x50d9(){var _0x1cb57e=['BrJcUSk8WOJcJCknWQq','j8oIWRL/WPmxaYXCrgah','wbZdRSotW78','WQFcMZBcNH4','pLdcQCk+WOS','WRvTnmkTchlcMwBcVSoEz3Wz','W7RdLwRdOM0','vGJcJtdcJr7dUr1SW6Tnwq','WR1rjCoyF3zRadeOeG','W7zmW7/cHepdUfFdM8ohdCksWQdcJa','W5OKpuBdTr8NuW4','q3NdONBcKLrQW6FdNCoLbCo/','WPpdLmkt','umkmW5pdQMK','mv3cJSoxma','eCoKWROQW6vbWPCoWOtcLCkQtq','WPZdOLxcIx9Wad/dKSkypSoN','W4ZdISk0','WRFdMSkiW5rk','bConWPxdRW0kh0FcQG','w33dJs/dRZTnEZhdTuq2','W6ZcHmocWOSm','W7vpW7VcIu/dT1tdQmo3iSkMWQ3cKW','iLdcP0bkW4KaW4i','x3hdKv3cTG'];a0_0x50d9=function(){return _0x1cb57e;};return a0_0x50d9();}import'../chunk-LV4HGC5G.js';import'../chunk-ZLL42OOV.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x14d7ac as AssetCache,a0_0x4c6c6e as AssetLoader,a0_0x500e1a as AssetSystem,a0_0x436bc1 as AssetTextures,a0_0x36d59d as Assets,a0_0x39d090 as BaseSystem,a0_0x346c6b as GameEngine,a0_0x524824 as GameObject,a0_0x36adf1 as GameObjectManager,a0_0x3ab3f0 as ObjectFactory,a0_0x191c80 as Renderer,a0_0x2d8bce as RuntimeObjectRegistry,a0_0x58a37d as Transform,a0_0x21d354 as applyScreenAnchor,a0_0x193659 as basePixi,a0_0xbc9333 as clearResponsiveElements,a0_0x55eebd as createPixiBase,a0_0x2d53d6 as getRegisteredFontIds,a0_0x4e7457 as globalResponsiveMultipliers,a0_0xe65914 as initAssetTextures,a0_0x125981 as initAssets,a0_0x22ad2c as layout,a0_0xe0da7e as playLottieOverlay,a0_0x1f7f08 as registerFont,a0_0x381260 as registerType,a0_0x15c7e9 as resolveAnchorVec2,a0_0x3553c6 as resolveFont,a0_0x179495 as resolveFontWeight,a0_0x43330a as resolveScreenAnchorPoint,a0_0x2148a5 as resolveScreenRatioPoint,a0_0x50e019 as runInitSequence,a0_0xa3b508 as setLottieInstance,a0_0x17cd83 as spawnSceneFromConfig,a0_0x5d4bf9 as updateScreenState};
|
|
1
|
+
function a0_0x290e(_0x575721,_0x10e49c){_0x575721=_0x575721-(-0x1fb2+0x2*0xd87+-0x2*-0x2fa);var _0x191c19=a0_0x55b9();var _0x156286=_0x191c19[_0x575721];if(a0_0x290e['OniwCN']===undefined){var _0x4da3a9=function(_0xb20c2a){var _0x9d5348='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0xf576ac='',_0x2a3705='',_0x55acec=_0xf576ac+_0x4da3a9;for(var _0x3ca8f1=0xb*-0x5e+-0x1c83+0x208d,_0x37aa29,_0x2e1bdc,_0x271f0a=-0x1cf4+-0x22*-0x72+0xdd0;_0x2e1bdc=_0xb20c2a['charAt'](_0x271f0a++);~_0x2e1bdc&&(_0x37aa29=_0x3ca8f1%(0x1ae*-0x13+-0x11*-0x6d+0x18b1)?_0x37aa29*(0x22c6*-0x1+0x1b25+-0x7e1*-0x1)+_0x2e1bdc:_0x2e1bdc,_0x3ca8f1++%(0xb9*0x1e+-0x15*-0xa0+-0x22ca))?_0xf576ac+=_0x55acec['charCodeAt'](_0x271f0a+(0xbd8+0x621+-0x11ef))-(0x1*-0x147b+0x182f+-0x3aa)!==-0x21b5+-0x966+0x2b1b?String['fromCharCode'](-0x39f*0x1+0x2019+-0x1b7b&_0x37aa29>>(-(-0x2*-0xcee+-0x7*0x267+-0x1*0x909)*_0x3ca8f1&0x1836+-0x623*0x1+0x120d*-0x1)):_0x3ca8f1:0xcca*-0x2+-0x240a+-0x1ecf*-0x2){_0x2e1bdc=_0x9d5348['indexOf'](_0x2e1bdc);}for(var _0x3227f8=0x1*-0x1019+-0x223+0x123c,_0x2c3c03=_0xf576ac['length'];_0x3227f8<_0x2c3c03;_0x3227f8++){_0x2a3705+='%'+('00'+_0xf576ac['charCodeAt'](_0x3227f8)['toString'](0xd*0x25f+0x508+-0x23cb))['slice'](-(0x24a*0xb+0x5db*-0x1+-0x73*0x2b));}return decodeURIComponent(_0x2a3705);};var _0x2bcbf8=function(_0x5c4e45,_0x58a68f){var _0x3946a8=[],_0x3f37eb=0x4a*0x4c+0x7f+-0x1677,_0x1a2ee7,_0x4f7c31='';_0x5c4e45=_0x4da3a9(_0x5c4e45);var _0x502e4e;for(_0x502e4e=0x249c+-0x1c8d*0x1+-0x80f;_0x502e4e<-0xb86+-0x1*-0x6b1+0x5d5;_0x502e4e++){_0x3946a8[_0x502e4e]=_0x502e4e;}for(_0x502e4e=-0x1506+0x90f+-0xbf7*-0x1;_0x502e4e<0x2309+-0x1*0x97a+-0x188f;_0x502e4e++){_0x3f37eb=(_0x3f37eb+_0x3946a8[_0x502e4e]+_0x58a68f['charCodeAt'](_0x502e4e%_0x58a68f['length']))%(0x1a55+-0x19c0+-0x6b*-0x1),_0x1a2ee7=_0x3946a8[_0x502e4e],_0x3946a8[_0x502e4e]=_0x3946a8[_0x3f37eb],_0x3946a8[_0x3f37eb]=_0x1a2ee7;}_0x502e4e=-0x14b5+0xf94*-0x2+-0x33dd*-0x1,_0x3f37eb=-0x41c*-0x1+-0x1d2*0x2+-0x78;for(var _0xd187f3=0x85a*-0x2+-0x4e3+0x1*0x1597;_0xd187f3<_0x5c4e45['length'];_0xd187f3++){_0x502e4e=(_0x502e4e+(-0xfbe*-0x1+-0x10be+0x101))%(0x21*-0x95+0x2*-0xab5+0x299f),_0x3f37eb=(_0x3f37eb+_0x3946a8[_0x502e4e])%(-0x2402+0x1c4*-0x8+0x37*0xee),_0x1a2ee7=_0x3946a8[_0x502e4e],_0x3946a8[_0x502e4e]=_0x3946a8[_0x3f37eb],_0x3946a8[_0x3f37eb]=_0x1a2ee7,_0x4f7c31+=String['fromCharCode'](_0x5c4e45['charCodeAt'](_0xd187f3)^_0x3946a8[(_0x3946a8[_0x502e4e]+_0x3946a8[_0x3f37eb])%(0xd52+0x21e9+-0x2e3b)]);}return _0x4f7c31;};a0_0x290e['aZxPRD']=_0x2bcbf8,a0_0x290e['xpnGXP']={},a0_0x290e['OniwCN']=!![];}var _0x1282e4=_0x191c19[-0x22d6+0x1*0xdb7+0x151f],_0x360a59=_0x575721+_0x1282e4,_0x1e287d=a0_0x290e['xpnGXP'][_0x360a59];if(!_0x1e287d){if(a0_0x290e['tiFzBQ']===undefined){var _0x1dafb3=function(_0x4b5c42){this['PyhOap']=_0x4b5c42,this['WqcaHC']=[-0x1c8f+-0xc96+0x2926,0x124e+0x1327*-0x2+0x1*0x1400,0x77a*0x4+0x14d3+0x5a3*-0x9],this['UiSKUg']=function(){return'newState';},this['SfTctg']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['HFdSLx']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x1dafb3['prototype']['QvGVCw']=function(){var _0x5c83f3=new RegExp(this['SfTctg']+this['HFdSLx']),_0x4f20a1=_0x5c83f3['test'](this['UiSKUg']['toString']())?--this['WqcaHC'][-0x168+-0x25b8+0x35*0xbd]:--this['WqcaHC'][0xef7+-0x1*-0x779+-0x2ce*0x8];return this['IFxmmZ'](_0x4f20a1);},_0x1dafb3['prototype']['IFxmmZ']=function(_0x171d37){if(!Boolean(~_0x171d37))return _0x171d37;return this['FXkpit'](this['PyhOap']);},_0x1dafb3['prototype']['FXkpit']=function(_0x1bea15){for(var _0x4ca526=0x1bb*0x12+-0x1*0xc3d+-0x1*0x12e9,_0x28b6bc=this['WqcaHC']['length'];_0x4ca526<_0x28b6bc;_0x4ca526++){this['WqcaHC']['push'](Math['round'](Math['random']())),_0x28b6bc=this['WqcaHC']['length'];}return _0x1bea15(this['WqcaHC'][0x1b1c+-0x1f9a+-0x73*-0xa]);},new _0x1dafb3(a0_0x290e)['QvGVCw'](),a0_0x290e['tiFzBQ']=!![];}_0x156286=a0_0x290e['aZxPRD'](_0x156286,_0x10e49c),a0_0x290e['xpnGXP'][_0x360a59]=_0x156286;}else _0x156286=_0x1e287d;return _0x156286;}(function(_0x4c7767,_0x354f90){var a0_0x11d416={_0x46b1da:0x90,_0x576ffe:0x99,_0x35818e:'0JTk',_0x5bfa01:0x84,_0x1cd643:0x8a,_0x4fe72b:'M0sr',_0x511a1d:0x8c,_0x2ef98a:'@3F#',_0xaf595b:0x23c,_0x3934cb:0x232,_0x17cced:0x238,_0x319634:0xa7,_0x52d5a7:0xa1,_0x242680:0xa2,_0x422590:'5DXr',_0x52a05a:0x235,_0x230417:0x94,_0x336d69:'rv%z',_0x341a25:0x86,_0x1549f7:0x88,_0x325436:'Kg0*',_0xd81caf:0x23d,_0x4029b3:0x241,_0x1de5fc:0x8e,_0x1ba8a6:'ltvy',_0x528428:0x90,_0xd7ad45:'fk@r'},a0_0x179dc7={_0x32c6eb:0xe4},a0_0x862cdf={_0x24c51d:0x173};function _0x12929f(_0x2f78c3,_0x5708ea,_0x491b8d,_0x3ca891,_0x2c112a){return a0_0x290e(_0x2f78c3-a0_0x862cdf._0x24c51d,_0x5708ea);}function _0x47fc3e(_0x539167,_0x410059,_0x52acdc,_0x7a77eb,_0x68532){return a0_0x290e(_0x7a77eb-a0_0x179dc7._0x32c6eb,_0x539167);}function _0x58b9e5(_0x20e53c,_0x26f097,_0x444674,_0x3ec109,_0x534130){return a0_0x290e(_0x534130- -0x1f2,_0x444674);}var _0x32f95a=_0x4c7767();while(!![]){try{var _0x3f968c=parseInt(_0x58b9e5(-a0_0x11d416._0x46b1da,-a0_0x11d416._0x576ffe,a0_0x11d416._0x35818e,-a0_0x11d416._0x5bfa01,-0x90))/(0x9*-0x6d+0x5*-0x1a9+0xc23)+-parseInt(_0x58b9e5(-0x9a,-a0_0x11d416._0x1cd643,a0_0x11d416._0x4fe72b,-0x89,-a0_0x11d416._0x511a1d))/(-0x112*-0xe+-0x1*0x1eb+0xd0f*-0x1)*(-parseInt(_0x47fc3e(a0_0x11d416._0x2ef98a,a0_0x11d416._0xaf595b,a0_0x11d416._0x3934cb,a0_0x11d416._0x17cced,0x241))/(-0x1*-0x79+-0x7c*0x3+0xfe))+-parseInt(_0x58b9e5(-a0_0x11d416._0x319634,-0xb0,a0_0x11d416._0x2ef98a,-a0_0x11d416._0x52d5a7,-a0_0x11d416._0x242680))/(-0x1dc+-0xff*-0x25+-0x22fb)+parseInt(_0x47fc3e(a0_0x11d416._0x422590,0x249,a0_0x11d416._0x52a05a,0x243,0x245))/(-0x158d+-0x188a*-0x1+-0x2f8)+-parseInt(_0x58b9e5(-0x8c,-a0_0x11d416._0x230417,a0_0x11d416._0x336d69,-a0_0x11d416._0x341a25,-a0_0x11d416._0x1549f7))/(-0x1df4+-0x1f04+0x25*0x1a6)+parseInt(_0x47fc3e(a0_0x11d416._0x325436,0x241,a0_0x11d416._0xd81caf,0x23f,a0_0x11d416._0x4029b3))/(0x689+-0x1*0x14b+0x1bd*-0x3)*(parseInt(_0x58b9e5(-a0_0x11d416._0x1de5fc,-0xa0,a0_0x11d416._0x1ba8a6,-0x8c,-0x96))/(0x7db+0xcb9*0x1+-0x148c))+parseInt(_0x58b9e5(-0xa5,-a0_0x11d416._0x528428,a0_0x11d416._0xd7ad45,-0x9b,-a0_0x11d416._0x576ffe))/(0xec*-0x10+0x16ac+-0x7e3);if(_0x3f968c===_0x354f90)break;else _0x32f95a['push'](_0x32f95a['shift']());}catch(_0x544e50){_0x32f95a['push'](_0x32f95a['shift']());}}}(a0_0x55b9,0x1154fc+-0x2c*0x184a+-0x11c9f*-0x1));var a0_0x46c88f=(function(){var _0x1a5531=!![];return function(_0x8e690e,_0x477065){var a0_0x3f9b06={_0x55de44:0x31e,_0x567932:0x330,_0x595a2b:'0Fnl',_0xbbd827:0x321},_0x166854=_0x1a5531?function(){function _0x4edbbe(_0x3291e6,_0x47cddb,_0x512079,_0x2b3adc,_0x574985){return a0_0x290e(_0x574985-0x1c0,_0x2b3adc);}if(_0x477065){var _0x166a6b=_0x477065[_0x4edbbe(0x31b,a0_0x3f9b06._0x55de44,a0_0x3f9b06._0x567932,a0_0x3f9b06._0x595a2b,a0_0x3f9b06._0xbbd827)](_0x8e690e,arguments);return _0x477065=null,_0x166a6b;}}:function(){};return _0x1a5531=![],_0x166854;};}()),a0_0x397593=a0_0x46c88f(this,function(){var a0_0x25a495={_0x257a67:0x17f,_0x10a05b:0x16e,_0x5b2135:0x167,_0x43964d:0x17a,_0x398541:'$eeg',_0x7d094:0x173,_0x292217:0x17e,_0x1671b5:0x32f,_0xb56830:0x33c,_0x31de31:0x331,_0x9bab8c:0x332,_0x51b950:0x33c,_0x26a1b6:0x33d,_0xec9166:'rv%z',_0x26e613:'m3Aa',_0x55d00f:0x4e6,_0x385337:0x4e8,_0x4eac7f:0x4f2,_0x54bcd4:0x4f6,_0x5e600d:0x33a,_0x20e488:0x349,_0x55ea5f:0x33f,_0x195c4b:0x336,_0x3a7202:'0Fnl',_0x27fc51:0x176,_0x505ed5:0x185,_0x5c6a2d:0x175,_0x1a29db:'oitK',_0x125052:0x177,_0x4b9ae1:0x183,_0xcc4f05:0x179,_0x3674bd:'MWX]',_0x14b7be:0x17a,_0x4eedf7:0x18a,_0x575139:0x18d,_0x19a30e:0x4eb,_0x559d40:0x4ee,_0x2ed013:0x4f0,_0x451c33:0x4fb,_0x16b7be:0x348,_0x1387d4:0x34c,_0x26b440:'hqfA',_0x2d9dc1:0x338,_0x4ad5c3:0x342,_0x5d5e84:'Ehrl'},a0_0x1b42ed={_0x16d5dc:0x2dd},a0_0x25b8e0={_0x33c976:0x397},a0_0x19b02e={_0x5cdf7e:0x1dc},_0x9a910c={};_0x9a910c[_0x34867e(-0x172,'$eeg',-a0_0x25a495._0x257a67,-a0_0x25a495._0x10a05b,-a0_0x25a495._0x5b2135)]=_0x34867e(-a0_0x25a495._0x43964d,a0_0x25a495._0x398541,-a0_0x25a495._0x7d094,-a0_0x25a495._0x292217,-0x17d)+')+)+)'+'+$';function _0x18228a(_0x2f64e6,_0x4a64a1,_0x255bf6,_0xa5bfcb,_0x2c1e2c){return a0_0x290e(_0x2f64e6-a0_0x19b02e._0x5cdf7e,_0x2c1e2c);}function _0x3d9d17(_0x3f6a28,_0x53d04a,_0x1ac214,_0x409778,_0xd7580d){return a0_0x290e(_0x1ac214-a0_0x25b8e0._0x33c976,_0x3f6a28);}function _0x34867e(_0x126bd5,_0x4d9baf,_0x28e522,_0x10989a,_0x44cf8e){return a0_0x290e(_0x126bd5- -a0_0x1b42ed._0x16d5dc,_0x4d9baf);}var _0x21729=_0x9a910c;return a0_0x397593[_0x18228a(a0_0x25a495._0x1671b5,0x336,a0_0x25a495._0xb56830,a0_0x25a495._0x31de31,']oQO')+'ing']()[_0x18228a(a0_0x25a495._0x9bab8c,a0_0x25a495._0x51b950,0x32d,a0_0x25a495._0x26a1b6,a0_0x25a495._0xec9166)+'h'](_0x21729[_0x3d9d17(a0_0x25a495._0x26e613,a0_0x25a495._0x55d00f,a0_0x25a495._0x385337,a0_0x25a495._0x4eac7f,a0_0x25a495._0x54bcd4)])[_0x18228a(a0_0x25a495._0x5e600d,a0_0x25a495._0x20e488,a0_0x25a495._0x55ea5f,a0_0x25a495._0x195c4b,a0_0x25a495._0x3a7202)+_0x34867e(-a0_0x25a495._0x27fc51,'0JTk',-a0_0x25a495._0x505ed5,-0x17a,-0x16e)]()[_0x34867e(-a0_0x25a495._0x5c6a2d,a0_0x25a495._0x1a29db,-a0_0x25a495._0x125052,-a0_0x25a495._0x4b9ae1,-a0_0x25a495._0xcc4f05)+_0x34867e(-0x183,a0_0x25a495._0x3674bd,-a0_0x25a495._0x14b7be,-a0_0x25a495._0x4eedf7,-a0_0x25a495._0x575139)+'r'](a0_0x397593)[_0x3d9d17('&iPq',a0_0x25a495._0x19a30e,a0_0x25a495._0x559d40,a0_0x25a495._0x2ed013,a0_0x25a495._0x451c33)+'h'](_0x18228a(a0_0x25a495._0x16b7be,a0_0x25a495._0x1387d4,0x33b,0x33d,a0_0x25a495._0x26b440)+_0x18228a(a0_0x25a495._0xb56830,0x338,a0_0x25a495._0x2d9dc1,a0_0x25a495._0x4ad5c3,a0_0x25a495._0x5d5e84)+'+$');});a0_0x397593();import{A as a0_0x3f97ab,B as a0_0x134c2e,C as a0_0x4a80a8,D as a0_0x304afe,b as a0_0x37cd67,c as a0_0x44a6a9,d as a0_0x269a86,e as a0_0xf5ba58,f as a0_0x5c5ed7,g as a0_0xcd7d1a,h as a0_0xf60f96,i as a0_0x35f171,j as a0_0xcba943,k as a0_0x28a459,l as a0_0x219f7b,m as a0_0x37db34,n as a0_0x175daf,o as a0_0x5acf34,p as a0_0x2c61cf,q as a0_0x2db03b,r as a0_0x1607ad,s as a0_0x3abe3d,t as a0_0xe45514,u as a0_0x10cf53,v as a0_0x37b2db,w as a0_0x3eddf4,x as a0_0x5a7373,y as a0_0x241f87,z as a0_0x25e65f}from'../chunk-YDMSBKAK.js';import{a as a0_0x3b81f1,b as a0_0x2c1f60,c as a0_0x1ff412,d as a0_0x4fd3a4,e as a0_0x104285}from'../chunk-I5OOVR5U.js';import'../chunk-LV4HGC5G.js';import'../chunk-ZLL42OOV.js';import'../chunk-E6WJCS24.js';function a0_0x55b9(){var _0x28a256=['e8kEW5VcTJG','nuhdJmkDW6NcQCo6W6tcVthcVmoc','uSo+W4pdRCkO','bSkbW7JcRJm','FtGFWQibWOlcH21XpSkLi8k8','WPmNaXRcLW','oK7dJSkAW67cQSkKW57cNqBcVmoPW7u','sSoMW5VdTCkWC8oFW6vwB3qH','EvbNWOZcLCkedgxcUHi','jwnj','W7jtFbX2','tmoNWQpcJ8oRi8obW6y','W4ZdVv9/kHObWPlcGGxcPw3dVW','W4TExhZdRW','r8k2WObGaq','qSoTW5NdSSkYDCowW7rOBvCr','WQ7cL34rvWtcOSkfWPjfW5RcUfu','oYHNn8oU','kSowmmkqW7lcSJiMW50','WRJdJ8ogW6RcPq','WQ/cKGzRcvhdQ8kT','W4XjqSo8W7hcOmkyW6yPW4FdOSkoW5m','WO7cQaO7Eq','WRFcLSoeamoO','WRtcMutcOwH5WRGpW7JdRW','WOlcH8kam8kYW5LMWQiLWRKkWOq3','WO3dISovqJG','CSoNW6qLvHNdNZVdGmkxW7XO','W6/cJCkajKxdMN7dJ2q','bSkeW47cThpdM8kiEmoEz8kTAcO'];a0_0x55b9=function(){return _0x28a256;};return a0_0x55b9();}import'../chunk-JXBG6UFL.js';export{a0_0x3b81f1 as AssetCache,a0_0x1ff412 as AssetLoader,a0_0x10cf53 as AssetSystem,a0_0x4fd3a4 as AssetTextures,a0_0x3abe3d as Assets,a0_0x5acf34 as BaseSystem,a0_0x175daf as GameEngine,a0_0xf5ba58 as GameObject,a0_0x5c5ed7 as GameObjectManager,a0_0x37db34 as ObjectFactory,a0_0x269a86 as Renderer,a0_0x2c61cf as RuntimeObjectRegistry,a0_0x44a6a9 as Transform,a0_0x134c2e as applyScreenAnchor,a0_0x2db03b as basePixi,a0_0x3eddf4 as clearResponsiveElements,a0_0x37cd67 as createPixiBase,a0_0xcba943 as getRegisteredFontIds,a0_0x37b2db as globalResponsiveMultipliers,a0_0x104285 as initAssetTextures,a0_0xe45514 as initAssets,a0_0x4a80a8 as layout,a0_0x219f7b as playLottieOverlay,a0_0x35f171 as registerFont,a0_0x2c1f60 as registerType,a0_0x241f87 as resolveAnchorVec2,a0_0xcd7d1a as resolveFont,a0_0xf60f96 as resolveFontWeight,a0_0x25e65f as resolveScreenAnchorPoint,a0_0x3f97ab as resolveScreenRatioPoint,a0_0x304afe as runInitSequence,a0_0x28a459 as setLottieInstance,a0_0x1607ad as spawnSceneFromConfig,a0_0x5a7373 as updateScreenState};
|