handler-playable-sdk 1.0.12 → 1.0.14
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-NNKOLF5Z.js → chunk-NUN3J3M4.js} +18 -18
- 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/add-logic.mjs +1 -0
- package/dist/cli/student-helper/add-object.mjs +1 -0
- package/dist/cli/student-helper/arg-parsing.mjs +1 -0
- package/dist/cli/student-helper/asset-registry.mjs +1 -0
- package/dist/cli/student-helper/bullet-system.mjs +1 -0
- package/dist/cli/student-helper/collectable-system.mjs +1 -0
- package/dist/cli/student-helper/constants.mjs +1 -0
- package/dist/cli/student-helper/drag-snap-couples.mjs +1 -0
- package/dist/cli/student-helper/endgame-screen.mjs +1 -0
- package/dist/cli/student-helper/fs-io.mjs +1 -0
- package/dist/cli/student-helper/logic-defaults.mjs +1 -0
- package/dist/cli/student-helper/print-help.mjs +1 -0
- package/dist/cli/student-helper/prompts.mjs +1 -0
- package/dist/cli/student-helper/scratch-card.mjs +1 -0
- package/dist/cli/student-helper/screen-utils.mjs +1 -0
- package/dist/cli/student-helper/snippets.mjs +1 -0
- package/dist/cli/student-helper/start-screen.mjs +1 -0
- package/dist/cli/student-helper/swerve-collect.mjs +1 -0
- package/dist/cli/student-helper/tap-destroy.mjs +1 -0
- package/dist/cli/student-helper/template-packs.mjs +1 -0
- 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 -3
- 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 +3 -3
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=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let 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 n=this.modal.querySelector("[data-ai-edit]");n==null||n.addEventListener("click",()=>{this.openAiEditor("edit")});let a=this.modal.querySelector("[data-modal-apply]");a==null||a.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(n=>{n.classList.toggle("active",n.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(n=>{n.classList.toggle("active",n.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:n=>{this.onApplyCallback&&this.onApplyCallback(n),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 _l={};Ct(_l,{COLORS:()=>fe,ConfigWatcher:()=>Ve,DebugPanel:()=>Ut,DefaultReloadStrategy:()=>zt,Handler:()=>ce,PlayableLoadingScreen:()=>un,PreviewShell:()=>cn,STROKE_WIDTH:()=>$r,THEME:()=>Dr,applyConfigOverride:()=>Q,applyConfigOverrides:()=>Ie,applyConfigsToDisk:()=>bi,applyDefaults:()=>qe,baseLottie:()=>An,bootstrap:()=>Sl,clearConfigOverrides:()=>ae,clearConfigOverridesForObject:()=>zs,configOverrideManager:()=>$s,createPreviewShell:()=>Oa,deepClone:()=>Y,default:()=>Ne,defaultPreset:()=>Ci,deviceGroups:()=>ta,devicePresets:()=>ea,diffConfigs:()=>Yn,exportConfigsAsJSON:()=>Ue,getConfigOverrides:()=>Z,getConfigStateSummary:()=>Me,getOverrideMode:()=>jt,getPresetById:()=>We,getPresetsByCategory:()=>Xo,loadAllObjectConfigs:()=>wi,loadComponentSchemas:()=>vi,loadEngineConfig:()=>xi,loadGamePromptConfig:()=>qn,loadObjectCentricConfig:()=>Ce,loadObjectConfig:()=>_e,loadSceneConfig:()=>Si,redoLastConfigChange:()=>mi,rehydrateObject:()=>Kn,removeConfigOverride:()=>_t,resetToApplied:()=>Ot,resetToOriginal:()=>yi,setBootstrapDependencies:()=>wl,setOverrideMode:()=>Bn,setupHotReload:()=>Zn,setupLiveEditBridge:()=>dn,toLegacyFormat:()=>Vn,trackObjectCreation:()=>Ds,trackObjectDeletion:()=>Hs,undoLastConfigChange:()=>fi,validateObjectConfig:()=>lt});module.exports=ao(_l);var ke={};function ii(s,e,t=!1){ke[s]||(ke[s]=[]),ke[s].push({fn:e,once:t})}function xn(s,e){if(ke[s]){if(!e){delete ke[s];return}ke[s]=ke[s].filter(t=>t.fn!==e)}}function ni(s,...e){let t=ke[s];if(t)for(let i of[...t])i.fn(...e),i.once&&xn(s,i.fn)}function te(s,e){ii(s,e,!0)}var V=null,re=[],it=null;function Ja(s){V=s,re=[],it!==null&&(clearTimeout(it),it=null)}function Za(){var s,e,t;return{endpoint:(V==null?void 0:V.endpoint)||"",transport:(V==null?void 0:V.transport)||"beacon",batchSize:(s=V==null?void 0:V.batchSize)!=null?s:10,flushIntervalMs:(e=V==null?void 0:V.flushIntervalMs)!=null?e:300,maxQueue:(t=V==null?void 0:V.maxQueue)!=null?t:200,debug:!!(V!=null&&V.debug)}}async function Ka(s,e,t,i){let n=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let a=navigator.sendBeacon(s,new Blob([n],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",a,e);return}catch(a){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",a)}try{await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(a){i&&console.warn("[handler.telemetry] fetch failed",a)}}function Sn(s,e){let t=Za();if(e&&t.endpoint){if(re.push(s),re.length>t.maxQueue&&(re=re.slice(re.length-t.maxQueue)),re.length>=t.batchSize){Xa();return}it===null&&(it=window.setTimeout(()=>{it=null,Xa()},t.flushIntervalMs))}}async function Xa(){let s=Za();if(!s.endpoint||re.length===0)return;let e=re.splice(0,s.batchSize);await Ka(s.endpoint,{events:e},s.transport,s.debug),re.length>0&&await Ka(s.endpoint,{events:re.splice(0,s.batchSize)},s.transport,s.debug)}function Qa(s){return Math.max(0,Math.min(1,s))}function so(s){let e=String(s!=null?s:"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 n=>1+(i+1)*Math.pow(n-1,3)+i*Math.pow(n-1,2)}return t=>1-(1-t)*(1-t)}function At(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function ro(s,e){let t=s==null?void 0:s[e];return typeof t=="number"?t:0}function es(s,e,t){try{s[e]=t}catch{}}function oo(s){let e=s==null?void 0:s.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 ts(s,e){let t=s==null?void 0:s.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 is(s,e){let t=oo(s);if(!t)return{from:null,to:null};let i=null,n=null;return typeof e.scale=="number"?(i=e.scale,n=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(n=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(n=e.scaleY),i===null&&n===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:i!=null?i:t.x,y:n!=null?n:t.y}}}function ns(){let s=new Set,e=new WeakMap,t=null,i=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),s.size>0&&i()})},n=d=>{var u;s.add(d);let p=(u=e.get(d.target))!=null?u:new Set;p.add(d),e.set(d.target,p),i()},a=d=>{s.delete(d);let p=e.get(d.target);p&&(p.delete(d),p.size===0&&e.delete(d.target))},r=d=>{d.killed||(d.killed=!0,a(d))},o=()=>{var p,u;let d=At();for(let g of Array.from(s)){if(g.killed||g.paused)continue;let h=d-g.startMs-g.delayMs;if(h<0)continue;let f=g.durationMs>0?h/g.durationMs:1,m=Qa(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 C=f-y;m=Qa(C)}let x=g.ease(m);g.yoyo&&y%2===1&&(x=1-x);for(let C of g.props)es(g.target,C.key,C.from+(C.to-C.from)*x);g.scaleFrom&&g.scaleTo&&ts(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{(p=g.onUpdate)==null||p.call(g)}catch{}if(f>=b){r(g);try{(u=g.onComplete)==null||u.call(g)}catch{}}}},l=(d,p,u)=>{var C;let g=Math.max(0,(typeof p.duration=="number"?p.duration:.5)*1e3),h=Math.max(0,(typeof p.delay=="number"?p.delay:0)*1e3+((C=u==null?void 0:u.delayMsOverride)!=null?C:0)),f=so(p.ease),m=typeof p.repeat=="number"?Math.max(0,p.repeat|0):0,b=p.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),x=[];for(let I of Object.keys(p)){if(y.has(I))continue;let O=p[I];typeof O=="number"&&x.push({key:I,from:ro(d,I),to:O})}let w=is(d,p);return{target:d,startMs:At(),delayMs:h,durationMs:g,ease:f,props:x,scaleFrom:w.from,scaleTo:w.to,repeat:m,yoyo:b,onUpdate:typeof p.onUpdate=="function"?p.onUpdate:void 0,onComplete:typeof p.onComplete=="function"?p.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(d,p){let u=l(d,p);return n(u),{kill:()=>r(u),pause:()=>{u.paused||(u.paused=!0,u.pauseAtMs=At())},resume:()=>{var f;if(!u.paused)return;let g=(f=u.pauseAtMs)!=null?f:At(),h=At()-g;u.startMs+=h,u.paused=!1,u.pauseAtMs=null},isActive:()=>!u.killed&&!u.paused}},fromTo(d,p,u){return c.set(d,p),c.to(d,u)},set(d,p){if(!d||!p)return;for(let g of Object.keys(p)){let h=p[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof h=="number"&&es(d,g,h)}let u=is(d,p);u.to&&ts(d,u.to)},killTweensOf(d){let p=e.get(d);if(p)for(let u of Array.from(p))r(u)},timeline(d={}){let p=[],u=0,g=!1,h=[],f=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let x=typeof y=="string"?y.trim():"";return x.startsWith("+=")?u+Math.max(0,Number(x.slice(2))*1e3||0):x?Math.max(0,Number(x)*1e3||0):u},m=y=>{p.push(y);let x=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);u=Math.max(u,y.atMs+x)},b={to(y,x,w){return m({kind:"to",target:y,vars:x,atMs:f(w)}),b},fromTo(y,x,w,C){return m({kind:"fromTo",target:y,vars:w,from:x,atMs:f(C)}),b},play(){var y,x;if(g)return b;g=!0,h=[];for(let w of p)w.kind==="fromTo"&&c.set(w.target,(y=w.from)!=null?y:{}),h.push(c.to(w.target,{...w.vars,delay:w.atMs/1e3+((x=w.vars.delay)!=null?x: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 d.paused||b.play(),b}};return c}function as(){if(typeof window=="undefined")return;let s=window;if(!s.gsap)try{s.gsap=ns()}catch{}}var ss={name:"handler-playable-sdk",version:"1.0.12",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 --external jszip && 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 --external jszip && 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 ie=0,co=ie++,rs=ie++,os=ie++,ls=ie++,cs=ie++,ds=ie++,ps=ie++,us=ie++,gs=ie++,hs=ie++,fs=ie++,ms=ie++,U=co;function bs(){return U===rs}function ys(){return U===os}function vs(){return U===ls}function ws(){return U===cs}function nt(){return U===ds}function at(){return U===ps}function xs(){return U===us}function Ss(){return U===gs}function Es(){return U===hs}function En(){return U===fs}function Cn(){return U===ms}function Cs(){let s=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(s==="mraid")try{mraid.getState(),U=rs;return}catch{}else if(s==="dapi")try{dapi.isReady(),U=os;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(U=ls)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(U=cs)}catch{}else if(e==="mintegral")window.gameReady&&(U=ds);else if(e==="tapjoy")window.TJ_API&&(U=ps);else if(e==="tiktok")window.openAppStore&&(U=us);else if(e==="smadex")try{window.smxTracking&&(U=gs)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(U=hs)}catch{}else e==="vungle"?U=fs:(s==="nucleo"||e==="nucleo")&&(U=ms)}var ai=tt(require("lottie-web"),1),An=ai.default;typeof window!="undefined"&&(window.lottie=ai.default,window.__baseLottie=ai.default);var po=require("pixi.js");var Ln=require("pixi.js");var uo=null;function Tn(s){uo=s}si();kn();var Lt=require("pixi.js");si();var yo=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",jn=yo;if(typeof window!="undefined")try{let s=new XMLHttpRequest;if(s.open("GET","./build-settings.json",!1),s.send(),s.status===200&&s.responseText){let e=JSON.parse(s.responseText);e!=null&&e.buildMode&&(jn=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${jn}`))}}catch{}function vo(s){var t,i,n,a,r;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(s);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(s))return{x:(t=s[0])!=null?t:.5,y:(i=s[1])!=null?i:.5};if(s&&typeof s=="object"&&"x"in s&&"y"in s)return{x:(n=s.x)!=null?n:.5,y:(a=s.y)!=null?a:.5};if(typeof s=="string"){let o=s.trim().toLowerCase();return(r=e[o])!=null?r:{x:.5,y:.5}}return null}var pe=class{static async create(e,t,i){var l,c,d,p,u,g,h;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${jn}`);let n=(l=t==null?void 0:t.render)==null?void 0:l.asset;if(!n){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let f=new Lt.Container;return this.applyTransform(f,t==null?void 0:t.transform,t),f}let a=(c=t==null?void 0:t.identity)==null?void 0:c.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${a}, type: ${n.type}, path: ${n.path}`);let r=await Be.load(e,n,i,a);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(d=r==null?void 0:r.constructor)==null?void 0:d.name}`);let o;if(n.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Lt.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(p=o==null?void 0:o.constructor)==null?void 0:p.name),this.applyTransform(o,t==null?void 0:t.transform,t);else if(n.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(u=r==null?void 0:r.constructor)==null?void 0:u.name,r),r&&(((g=r.constructor)==null?void 0:g.name)==="Container"||r instanceof Lt.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let f=[n.path,`/assets/${n.path}`,`assets/${n.path}`,`../assets/${n.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=r)}else o=r;else o=r,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,i){var n,a,r,o;if(!(!t||!e)&&(t.position&&("x"in e&&"y"in e?(e.x=(n=t.position.x)!=null?n:0,e.y=(a=t.position.y)!=null?a:0):"position"in e&&e.position&&e.position.set((r=t.position.x)!=null?r: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=vo(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 Tt=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 So=tt(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=So);st();var ri=require("pixi.js");st();var Rn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Tt}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(n=>!this.instanceCache.has(n));if(t.length===0)return;let i=async n=>{n.length&&(console.log("[Assets] Loading objects:",n),await Promise.all(n.map(async a=>{var o;let r=this.registry.get(a);if(!r){console.warn("[Assets] No config found for object:",a);return}try{let l=await pe.create(a,r,this.app);this.instanceCache.set(a,l),console.log("[Assets] Loaded object:",a,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",a,l)}})))};return this.readyPromise=(async()=>{await i(t);let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));n.length>0&&(console.warn("[Assets] Retrying missing assets:",n),await i(n)),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 i=await pe.create(e,t,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Eo=new Rn,Co=new Proxy(Eo,{get(s,e){if(e in s&&typeof s[e]=="function")return s[e].bind(s);if(s.get(e))return s.get(e)}});st();var Is=require("pixi.js"),oe={width:400,height:600,designWidth:400,scaleFactor:1},rt={scale:1,position:1},$n=[];function Lo(s,e,t,i,n,a,r){$n.push({element:s,originalScale:a,positionHelper:e,heightPercent:n}),e(s,t,i,n,a,r,!1)}function To(){$n.forEach(({element:s,originalScale:e,positionHelper:t,heightPercent:i})=>{let n=e*oe.scaleFactor;t(s,oe.width,oe.height,i,n,!0,!1)})}function zn(s,e){console.log(`[SCREEN] updateScreenState called: ${s}x${e}`),oe.width=s,oe.height=e,oe.scaleFactor=Math.min(s/oe.designWidth,1.15),rt.scale=oe.scaleFactor,rt.position=1,console.log(`[SCREEN] Global multipliers - scale: ${rt.scale.toFixed(3)}`),To()}var ge={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 ko(s,e,t){let i=ge[s];i&&i[e]!==void 0&&(i[e]=t,console.log(`Updated ${s}.${e} = ${t}`))}function Po(){return ge}var Io={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 oi(s,e){return typeof s=="number"&&Number.isFinite(s)?s:e}function ot(s,e={x:.5,y:.5}){var t;if(Array.isArray(s))return{x:oi(s[0],e.x),y:oi(s[1],e.y)};if(s&&typeof s=="object"){let i=s;return{x:oi(i.x,e.x),y:oi(i.y,e.y)}}if(typeof s=="string"){let i=s.trim().toLowerCase();return(t=Io[i])!=null?t:e}return e}function Pt(s,e,t,i={}){var g,h,f,m,b,y;let n=ot(t),a=(g=i.inset)!=null?g:{},r=(h=i.padding)!=null?h:{x:0,y:0},o=((f=a.left)!=null?f:0)+r.x,l=((m=a.right)!=null?m:0)+r.x,c=((b=a.top)!=null?b:0)+r.y,d=((y=a.bottom)!=null?y:0)+r.y,p=Math.max(0,s-o-l),u=Math.max(0,e-c-d);return{x:o+p*n.x,y:c+u*n.y}}function It(s,e,t,i={}){var f,m,b,y,x,w;let n=(f=i.inset)!=null?f:{},a=(m=i.padding)!=null?m:{x:0,y:0},r=((b=n.left)!=null?b:0)+a.x,o=((y=n.right)!=null?y:0)+a.x,l=((x=n.top)!=null?x:0)+a.y,c=((w=n.bottom)!=null?w:0)+a.y,d=Math.max(0,s-r-o),p=Math.max(0,e-l-c),u=ot(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:r+d*g,y:l+p*h}}if(typeof window!="undefined"){let s=window.innerWidth,e=window.innerHeight,t=()=>{let i=window.innerWidth,n=window.innerHeight;(i!==s||n!==e)&&(s=i,e=n,zn(i,n))};window.addEventListener("resize",t),window.addEventListener("orientationchange",()=>{setTimeout(t,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",t),window.mraid.addEventListener("sizeChange",t)),zn(window.innerWidth,window.innerHeight),window.updateDebugConfig=ko,window.getDebugConfig=Po,window.copyConfig=Fo,window.applyConfig=kt,window.applyConfigForRatio=Bo,window.positionAtBottom=Ms,window.positionAtTop=_o,window.positionAtCenter=Oo,window.positionAtLeft=Ro,window.positionAtRight=zo,window.positionAtBottomLeft=$o,window.positionAtBottomRight=Do,window.positionAtTopLeft=Ho,window.positionAtTopRight=No,window.applyPositionContract=jo,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 li(s,e,t=0){return s*e+t}function ci(s,e,t=0){return s*(1-e)+t}function di(s,e,t=0){return s*e+t}function pi(s,e,t=0){return s*(1-e)+t}function ne(s,e=0){return s/2+e}function Mo(s,e){return s*e}function jo(s,e,t,i){var r,o,l,c,d,p,u,g,h,f,m,b,y,x,w,C,I,O,v,k;let n=0,a=0;switch(i.type){case"top":n=ne(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),a=li(t,i.percent,(c=(l=i.offset)==null?void 0:l.y)!=null?c:0);break;case"bottom":n=ne(e,(p=(d=i.offset)==null?void 0:d.x)!=null?p:0),a=ci(t,i.percent,(g=(u=i.offset)==null?void 0:u.y)!=null?g:0);break;case"left":n=di(e,i.percent,(f=(h=i.offset)==null?void 0:h.x)!=null?f:0),a=ne(t,(b=(m=i.offset)==null?void 0:m.y)!=null?b:0);break;case"right":n=pi(e,i.percent,(x=(y=i.offset)==null?void 0:y.x)!=null?x:0),a=ne(t,(C=(w=i.offset)==null?void 0:w.y)!=null?C:0);break;case"center":n=ne(e,(O=(I=i.offset)==null?void 0:I.x)!=null?O:0),a=ne(t,(k=(v=i.offset)==null?void 0:v.y)!=null?k:0);break}s.position?s.position.set(n,a):(s.x=n,s.y=a),i.scale!==void 0&&i.scale!==1&&s.scale&&(typeof s.scale.set=="function"?s.scale.set(i.scale,i.scale):(s.scale.x=i.scale,s.scale.y=i.scale))}function Ms(s,e,t,i=.2,n=1,a=!0,r=!1){let o=Mo(t,i),l=ci(t,i/2);Se(s,ne(e),l);let c=a?n*oe.scaleFactor:n;Ee(s,c),r&&!$n.find(d=>d.element===s)&&Lo(s,Ms,e,t,i,n,a)}function _o(s,e,t,i=.1,n=1){Se(s,ne(e),li(t,i)),Ee(s,n)}function Oo(s,e,t,i=0,n=0,a=1){Se(s,ne(e,i),ne(t,n)),Ee(s,a)}function Ro(s,e,t,i=.1,n=1){Se(s,di(e,i),ne(t)),Ee(s,n)}function zo(s,e,t,i=.1,n=1){Se(s,pi(e,i),ne(t)),Ee(s,n)}function $o(s,e,t,i=.05,n=.05,a=1){Se(s,di(e,n),ci(t,i)),Ee(s,a)}function Do(s,e,t,i=.05,n=.05,a=1){Se(s,pi(e,n),ci(t,i)),Ee(s,a)}function Ho(s,e,t,i=.05,n=.05,a=1){Se(s,di(e,n),li(t,i)),Ee(s,a)}function No(s,e,t,i=.05,n=.05,a=1){Se(s,pi(e,n),li(t,i)),Ee(s,a)}function Se(s,e,t){s&&s.position?typeof s.position.set=="function"?s.position.set(e,t):(s.position.x=e,s.position.y=t):s&&(s.x=e,s.y=t)}function Ee(s,e){e!==1&&s&&s.scale&&(typeof s.scale.set=="function"?s.scale.set(e,e):s.scale.x!==void 0&&s.scale.y!==void 0&&(s.scale.x=e,s.scale.y=e))}var Ge={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 Fo(s){return s&&Ge[s]?JSON.parse(JSON.stringify(Ge[s])):JSON.parse(JSON.stringify(ge))}function kt(s){Object.keys(s).forEach(e=>{let t=e;ge[t]&&s[t]&&Object.assign(ge[t],s[t])}),console.log("Config applied:",s)}function Bo(s,e){let t=s/e;t>1.6?(kt(Ge.wide),console.log("Applied WIDE config for ratio:",t)):t<.7?(kt(Ge.tall),console.log("Applied TALL config for ratio:",t)):t>.8&&t<1.2?(kt(Ge.square),console.log("Applied SQUARE config for ratio:",t)):(kt(Ge.default),console.log("Applied DEFAULT config for ratio:",t))}if(typeof window!="undefined"){let s=window;s.configPresets=Ge,s.resolveAnchorVec2=s.resolveAnchorVec2||ot,s.resolveScreenAnchorPoint=s.resolveScreenAnchorPoint||Pt,s.resolveScreenRatioPoint=s.resolveScreenRatioPoint||It}Ei();function W(s,e){let t=(n,a)=>a===0?n:t(a,n%a),i=t(s,e);return`${s/i}:${e/i}`}var od=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:W(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:W(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:W(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:W(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:W(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:W(360,780)}],ld=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:W(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:W(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:W(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:W(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:W(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:W(412,915)}],cd=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:W(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:W(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:W(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:W(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:W(800,1280)}],Qn=[{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:W(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:W(768,1024),mraidScale:.7}];var ea=[...Qn],ta=[{category:"playable",label:"Playable Ad",devices:Qn}],Ci=Qn[0];function We(s){return ea.find(e=>e.id===s)||Ci}function Xo(s){return ea.filter(e=>e.category===s)}K();var Oe=class{async updateProperty(e,t,i,n={}){var l,c,d;console.log("[PropertyUpdateManager] Updating:",e,t,i);let a=window.getEditableObjectConfig;if(typeof a!="function"){console.error("[PropertyUpdateManager] getEditableObjectConfig not available");return}let r=a(e);if(!r){console.error("[PropertyUpdateManager] Config not found for:",e);return}Q({objectId:e,path:t,value:i},{persist:!0});let o=window.applyEditableObjectConfig;if(typeof o=="function"){let p=window.__editableConfig,u=(d=(c=(l=p==null?void 0:p.objects)==null?void 0:l.get)==null?void 0:c.call(l,e))!=null?d:r;await o(e,u),console.log("[PropertyUpdateManager] Applied config successfully")}else console.warn("[PropertyUpdateManager] applyEditableObjectConfig not available");this.triggerRefresh(e),n.refreshInspector&&window.dispatchEvent(new CustomEvent("inspector:refresh"))}getNestedProperty(e,t){let i=t.split("."),n=e;for(let a of i)if(n&&typeof n=="object"&&a in n)n=n[a];else return;return n}triggerRefresh(e){let t=window.__refreshHierarchy;typeof t=="function"&&t(),window.dispatchEvent(new CustomEvent("inspector:property-updated",{detail:{objectId:e}}))}};function ia(s){let e=document.createElement("input");e.type="file",e.accept="image/*",e.onchange=async t=>{var a;let i=(a=t.target.files)==null?void 0:a[0];if(!i)return;let n=new FileReader;n.onload=async()=>{let r=n.result,o=s.category||"misc",c=`${(s.objectId||"new_asset").replace(/^json\./,"").replace(/[^a-zA-Z0-9_-]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"")||"new_asset"}_uploaded`;try{let p=await(await fetch("/api/library/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({category:o,filename:`${c}.png`,data:r,overwrite:!0})})).json();if(!(p!=null&&p.success)){alert(`Upload failed: ${(p==null?void 0:p.error)||"Unknown error"}`);return}let u=window.addAssetToRegistry;typeof u=="function"&&u(o,`${c}.png`);try{await fetch("/api/setup-library",{method:"POST",headers:{"Content-Type":"application/json"}})}catch{}let g=window.refreshAssetLibrary;typeof g=="function"&&await g(),await s.onApply(p.path)}catch(d){console.error("[QuickActionsBar] Upload error:",d),alert("Upload failed. Check console.")}},n.readAsDataURL(i)},e.click()}var Ai=class{constructor(){this.updateManager=new Oe}async handleAction(e,t,i){console.log("[QuickActionsBar] Action:",e,t,i);let n=window.getEditableObjectConfig;if(typeof n!="function")return;let a=n(t);if(!a)return;let r=this.updateManager.getNestedProperty(a,i);if(e==="ai-convert"||e==="upload"||e==="library"){let o=i==="ui.text"||i==="render.asset.path",l=i==="render.asset.path";o&&(await this.prepareForImageConversion(t,a),e==="ai-convert"&&i!=="render.asset.path"&&(i="render.asset.path"))}switch(e){case"library":this.openLibrary(t,i,r);break;case"ai-edit":this.openAIEditor(t,i,r);break;case"upload":this.openUpload(t,i);break;case"reset":await this.resetToDefault(t,i);break;case"ai-convert":this.handleAiConvert(t,i,r);break;default:console.warn("[QuickActionsBar] Unknown action:",e)}}async prepareForImageConversion(e,t){var i,n;if(console.log("[QuickActionsBar] Preparing for image conversion:",e),t.render||(t.render={alpha:1,visible:!0}),(t.render.alpha===0||t.render.alpha===void 0)&&(t.render.alpha=1,await this.updateManager.updateProperty(e,"render.alpha",1)),(t.render.visible===!1||t.render.visible===void 0)&&(t.render.visible=!0,await this.updateManager.updateProperty(e,"render.visible",!0)),t.render.asset||(t.render.asset={type:"image",path:""}),t.render.asset.type!=="image"&&(t.render.asset.type="image",await this.updateManager.updateProperty(e,"render.asset",{type:"image",path:t.render.asset.path||""})),t.ui&&t.ui.renderMode!=="png"){await this.updateManager.updateProperty(e,"ui.renderMode","png",{refreshInspector:!0}),await this.updateManager.updateProperty(e,"render.tint","#ffffff");let r=((n=(i=t.transform)==null?void 0:i.scale)!=null?n:1)*.3;await this.updateManager.updateProperty(e,"transform.scale",r),console.log("[QuickActionsBar] Text to PNG conversion: set tint white, scale",r)}this.ensureSlotInRegistry(e,t)}ensureSlotInRegistry(e,t){var o,l,c;let i=window.getEditableAssets;if(typeof i!="function")return;let n=i();if(!n||!n.slots)return;let a=e.startsWith("json.")?e.replace("json.",""):e;if(!n.slots.some(d=>d.objectId===a||d.slotId===a)){let d=((o=t.identity)==null?void 0:o.category)||"ui";console.log("[QuickActionsBar] Adding new slot to registry for converted object:",a),n.slots.push({slotId:a,displayName:a.replace(/_/g," "),objectId:a,category:d,currentAsset:((c=(l=t.render)==null?void 0:l.asset)==null?void 0:c.path)||"",defaultAsset:"",libraryFolder:d,assetType:"image"}),n.categories&&!n.categories.includes(d)&&n.categories.push(d),n.libraryAssets&&!n.libraryAssets[d]&&(n.libraryAssets[d]=[]);let p=window.reRenderAssetLibrary;typeof p=="function"&&p()}}openLibrary(e,t,i){var a;let n=window.__debugContext;if(n){if(n.activeTab!=="library"){n.activeTab="library";let r=window.__updateWorkbenchTabs;typeof r=="function"&&r()}if(n.libraryPanel){let r=window.getEditableObjectConfig,o=r==null?void 0:r(e),l=(a=o==null?void 0:o.identity)==null?void 0:a.category;l||(l=t.split(".")[0]==="render"?"environment":"ui"),console.log("[QuickActionsBar] Highlighting library slot:",e,"category:",l),n.libraryPanel.highlightSlot(e,l)}}}openAIEditor(e,t,i){let n=window.__openAiEditor;if(typeof n=="function"){let a=t.split(".").pop()||t;n(a,`Edit ${a} for ${e}`,i,{objectId:e,path:t})}else console.warn("[QuickActionsBar] AI Editor not available")}openUpload(e,t){var r;let i=window.getEditableObjectConfig,n=i==null?void 0:i(e),a=((r=n==null?void 0:n.identity)==null?void 0:r.category)||(t.split(".")[0]==="render"?"environment":"ui");ia({objectId:e,category:a,onApply:async o=>{var d,p;await this.updateManager.updateProperty(e,t,o);let l=window.__debugContext;(p=(d=l==null?void 0:l.options)==null?void 0:d.onPropertyChange)==null||p.call(d,e,t,o);let c=window.__highlightLibrarySlot;typeof c=="function"&&setTimeout(()=>{c(e,a)},500),window.dispatchEvent(new CustomEvent("inspector:refresh"))}})}async resetToDefault(e,t){console.log("[QuickActionsBar] Reset to default:",e,t);try{let i=await this.getDefaultValue(e,t);i!==void 0?(await this.updateManager.updateProperty(e,t,i),console.log("[QuickActionsBar] Reset to default value:",i)):alert("No default value found for this property.")}catch(i){console.error("[QuickActionsBar] Failed to reset to default:",i),alert("Failed to reset property. Check console for details.")}}async getDefaultValue(e,t){let i=t.split(".");if(i.length<2)return;let n=i[0],a=i.slice(1),r=window.__editableConfig;if(!(r!=null&&r.schemas))return;let o=null;if(r.schemas instanceof Map?o=r.schemas.get(n):typeof r.schemas=="object"&&(o=r.schemas[n]),!(o!=null&&o.defaults))return;let l=o.defaults;for(let c of a)if(l&&typeof l=="object")l=l[c];else return;return l}handleAiConvert(e,t,i){let n=window.__openAiEditor;if(typeof n=="function"){let r=`A single, high-quality, high-detail game UI icon/asset representing "${String(i||e.replace(/_/g," ").replace("json.",""))}". Modern stylized 3D rendered style, vibrant colors, soft lighting, isolated on solid magenta background, highly polished professional game art.`,o="render.asset.path";console.log("[QuickActionsBar] AI Convert for:",e,"from:",t,"to:",o),n(e,r,"",{objectId:e,path:o});let l=window.__debugContext;if(l){l.activeTab="ai";let c=window.__updateWorkbenchTabs;typeof c=="function"&&c()}}else console.warn("[QuickActionsBar] AI Editor not available")}};var Jo=[{value:"loading",label:"Loading"},{value:"start",label:"Start"},{value:"gameplay",label:"Gameplay"},{value:"tutorial",label:"Tutorial"},{value:"endgame",label:"Endgame"}],Zo=["environment","ui","character","system","backgrounds"],Qo=["bg","world","ui"],qs={SwerveMove:{speed:5,sensitivity:1,directionMode:"dominantAxis",axis:"both",bounds:{left:-400,right:400,top:-300,bottom:300}},DragToWin:{targetId:"",successDistance:80},DragSnap:{snapTargetId:"",snapDistance:40},JoystickMove:{speed:6,bounds:{left:-400,right:400,top:-300,bottom:300}}},Li=class{constructor(){this.modal=null;this.state=null}open(e){this.state=this.createInitialState(e),this.createModal(),document.body.appendChild(this.modal),this.attachEventListeners(),this.updateStepUI()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),window.__wizardAssetPicker=null,this.modal=null,this.state=null}createInitialState(e){return{step:1,objectType:"sprite",instanceId:"",displayName:"",category:"environment",screenId:e.screenId,layer:"world",positionMode:"static",anchorPreset:"center",anchorX:.5,anchorY:.5,positionX:0,positionY:0,offsetX:0,offsetY:0,scale:.2,rotation:0,zIndex:0,assetPath:"",tint:"",alpha:1,text:"",font:"brand.primary",fontSize:18,letterSpacing:0,align:"center",graphicsWidth:200,graphicsHeight:200,graphicsFill:"#FFFFFF",graphicsAlpha:1,interactionEnabled:!1,dragEnabled:!1,hoverEnabled:!1,clickEnabled:!1,logicId:"",logicPropsRaw:""}}createModal(){let e=document.createElement("div");e.className="wizard-modal",e.innerHTML=`
|
|
46
|
+
`,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let 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 n=this.modal.querySelector("[data-ai-edit]");n==null||n.addEventListener("click",()=>{this.openAiEditor("edit")});let a=this.modal.querySelector("[data-modal-apply]");a==null||a.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(n=>{n.classList.toggle("active",n.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(n=>{n.classList.toggle("active",n.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:n=>{this.onApplyCallback&&this.onApplyCallback(n),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 _l={};Ct(_l,{COLORS:()=>fe,ConfigWatcher:()=>Ve,DebugPanel:()=>Ut,DefaultReloadStrategy:()=>zt,Handler:()=>ce,PlayableLoadingScreen:()=>un,PreviewShell:()=>cn,STROKE_WIDTH:()=>$r,THEME:()=>Dr,applyConfigOverride:()=>Q,applyConfigOverrides:()=>Ie,applyConfigsToDisk:()=>bi,applyDefaults:()=>qe,baseLottie:()=>An,bootstrap:()=>Sl,clearConfigOverrides:()=>ae,clearConfigOverridesForObject:()=>zs,configOverrideManager:()=>$s,createPreviewShell:()=>Oa,deepClone:()=>Y,default:()=>Ne,defaultPreset:()=>Ci,deviceGroups:()=>ta,devicePresets:()=>ea,diffConfigs:()=>Yn,exportConfigsAsJSON:()=>Ue,getConfigOverrides:()=>Z,getConfigStateSummary:()=>Me,getOverrideMode:()=>jt,getPresetById:()=>We,getPresetsByCategory:()=>Xo,loadAllObjectConfigs:()=>wi,loadComponentSchemas:()=>vi,loadEngineConfig:()=>xi,loadGamePromptConfig:()=>qn,loadObjectCentricConfig:()=>Ce,loadObjectConfig:()=>_e,loadSceneConfig:()=>Si,redoLastConfigChange:()=>mi,rehydrateObject:()=>Kn,removeConfigOverride:()=>_t,resetToApplied:()=>Ot,resetToOriginal:()=>yi,setBootstrapDependencies:()=>wl,setOverrideMode:()=>Bn,setupHotReload:()=>Zn,setupLiveEditBridge:()=>dn,toLegacyFormat:()=>Vn,trackObjectCreation:()=>Ds,trackObjectDeletion:()=>Hs,undoLastConfigChange:()=>fi,validateObjectConfig:()=>lt});module.exports=ao(_l);var ke={};function ii(s,e,t=!1){ke[s]||(ke[s]=[]),ke[s].push({fn:e,once:t})}function xn(s,e){if(ke[s]){if(!e){delete ke[s];return}ke[s]=ke[s].filter(t=>t.fn!==e)}}function ni(s,...e){let t=ke[s];if(t)for(let i of[...t])i.fn(...e),i.once&&xn(s,i.fn)}function te(s,e){ii(s,e,!0)}var V=null,re=[],it=null;function Ja(s){V=s,re=[],it!==null&&(clearTimeout(it),it=null)}function Za(){var s,e,t;return{endpoint:(V==null?void 0:V.endpoint)||"",transport:(V==null?void 0:V.transport)||"beacon",batchSize:(s=V==null?void 0:V.batchSize)!=null?s:10,flushIntervalMs:(e=V==null?void 0:V.flushIntervalMs)!=null?e:300,maxQueue:(t=V==null?void 0:V.maxQueue)!=null?t:200,debug:!!(V!=null&&V.debug)}}async function Ka(s,e,t,i){let n=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let a=navigator.sendBeacon(s,new Blob([n],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",a,e);return}catch(a){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",a)}try{await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(a){i&&console.warn("[handler.telemetry] fetch failed",a)}}function Sn(s,e){let t=Za();if(e&&t.endpoint){if(re.push(s),re.length>t.maxQueue&&(re=re.slice(re.length-t.maxQueue)),re.length>=t.batchSize){Xa();return}it===null&&(it=window.setTimeout(()=>{it=null,Xa()},t.flushIntervalMs))}}async function Xa(){let s=Za();if(!s.endpoint||re.length===0)return;let e=re.splice(0,s.batchSize);await Ka(s.endpoint,{events:e},s.transport,s.debug),re.length>0&&await Ka(s.endpoint,{events:re.splice(0,s.batchSize)},s.transport,s.debug)}function Qa(s){return Math.max(0,Math.min(1,s))}function so(s){let e=String(s!=null?s:"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 n=>1+(i+1)*Math.pow(n-1,3)+i*Math.pow(n-1,2)}return t=>1-(1-t)*(1-t)}function At(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function ro(s,e){let t=s==null?void 0:s[e];return typeof t=="number"?t:0}function es(s,e,t){try{s[e]=t}catch{}}function oo(s){let e=s==null?void 0:s.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 ts(s,e){let t=s==null?void 0:s.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 is(s,e){let t=oo(s);if(!t)return{from:null,to:null};let i=null,n=null;return typeof e.scale=="number"?(i=e.scale,n=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(n=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(n=e.scaleY),i===null&&n===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:i!=null?i:t.x,y:n!=null?n:t.y}}}function ns(){let s=new Set,e=new WeakMap,t=null,i=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),s.size>0&&i()})},n=d=>{var u;s.add(d);let p=(u=e.get(d.target))!=null?u:new Set;p.add(d),e.set(d.target,p),i()},a=d=>{s.delete(d);let p=e.get(d.target);p&&(p.delete(d),p.size===0&&e.delete(d.target))},r=d=>{d.killed||(d.killed=!0,a(d))},o=()=>{var p,u;let d=At();for(let g of Array.from(s)){if(g.killed||g.paused)continue;let h=d-g.startMs-g.delayMs;if(h<0)continue;let f=g.durationMs>0?h/g.durationMs:1,m=Qa(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 C=f-y;m=Qa(C)}let x=g.ease(m);g.yoyo&&y%2===1&&(x=1-x);for(let C of g.props)es(g.target,C.key,C.from+(C.to-C.from)*x);g.scaleFrom&&g.scaleTo&&ts(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{(p=g.onUpdate)==null||p.call(g)}catch{}if(f>=b){r(g);try{(u=g.onComplete)==null||u.call(g)}catch{}}}},l=(d,p,u)=>{var C;let g=Math.max(0,(typeof p.duration=="number"?p.duration:.5)*1e3),h=Math.max(0,(typeof p.delay=="number"?p.delay:0)*1e3+((C=u==null?void 0:u.delayMsOverride)!=null?C:0)),f=so(p.ease),m=typeof p.repeat=="number"?Math.max(0,p.repeat|0):0,b=p.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),x=[];for(let I of Object.keys(p)){if(y.has(I))continue;let O=p[I];typeof O=="number"&&x.push({key:I,from:ro(d,I),to:O})}let w=is(d,p);return{target:d,startMs:At(),delayMs:h,durationMs:g,ease:f,props:x,scaleFrom:w.from,scaleTo:w.to,repeat:m,yoyo:b,onUpdate:typeof p.onUpdate=="function"?p.onUpdate:void 0,onComplete:typeof p.onComplete=="function"?p.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(d,p){let u=l(d,p);return n(u),{kill:()=>r(u),pause:()=>{u.paused||(u.paused=!0,u.pauseAtMs=At())},resume:()=>{var f;if(!u.paused)return;let g=(f=u.pauseAtMs)!=null?f:At(),h=At()-g;u.startMs+=h,u.paused=!1,u.pauseAtMs=null},isActive:()=>!u.killed&&!u.paused}},fromTo(d,p,u){return c.set(d,p),c.to(d,u)},set(d,p){if(!d||!p)return;for(let g of Object.keys(p)){let h=p[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof h=="number"&&es(d,g,h)}let u=is(d,p);u.to&&ts(d,u.to)},killTweensOf(d){let p=e.get(d);if(p)for(let u of Array.from(p))r(u)},timeline(d={}){let p=[],u=0,g=!1,h=[],f=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let x=typeof y=="string"?y.trim():"";return x.startsWith("+=")?u+Math.max(0,Number(x.slice(2))*1e3||0):x?Math.max(0,Number(x)*1e3||0):u},m=y=>{p.push(y);let x=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);u=Math.max(u,y.atMs+x)},b={to(y,x,w){return m({kind:"to",target:y,vars:x,atMs:f(w)}),b},fromTo(y,x,w,C){return m({kind:"fromTo",target:y,vars:w,from:x,atMs:f(C)}),b},play(){var y,x;if(g)return b;g=!0,h=[];for(let w of p)w.kind==="fromTo"&&c.set(w.target,(y=w.from)!=null?y:{}),h.push(c.to(w.target,{...w.vars,delay:w.atMs/1e3+((x=w.vars.delay)!=null?x: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 d.paused||b.play(),b}};return c}function as(){if(typeof window=="undefined")return;let s=window;if(!s.gsap)try{s.gsap=ns()}catch{}}var ss={name:"handler-playable-sdk",version:"1.0.14",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 --external jszip && 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/ && mkdir -p dist/cli/student-helper && cp src/cli/student-helper/*.mjs dist/cli/student-helper/ && chmod +x dist/cli/*.mjs dist/cli/student-helper/*.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 --external jszip && 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 dist/cli/student-helper/*.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 ie=0,co=ie++,rs=ie++,os=ie++,ls=ie++,cs=ie++,ds=ie++,ps=ie++,us=ie++,gs=ie++,hs=ie++,fs=ie++,ms=ie++,U=co;function bs(){return U===rs}function ys(){return U===os}function vs(){return U===ls}function ws(){return U===cs}function nt(){return U===ds}function at(){return U===ps}function xs(){return U===us}function Ss(){return U===gs}function Es(){return U===hs}function En(){return U===fs}function Cn(){return U===ms}function Cs(){let s=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(s==="mraid")try{mraid.getState(),U=rs;return}catch{}else if(s==="dapi")try{dapi.isReady(),U=os;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(U=ls)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(U=cs)}catch{}else if(e==="mintegral")window.gameReady&&(U=ds);else if(e==="tapjoy")window.TJ_API&&(U=ps);else if(e==="tiktok")window.openAppStore&&(U=us);else if(e==="smadex")try{window.smxTracking&&(U=gs)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(U=hs)}catch{}else e==="vungle"?U=fs:(s==="nucleo"||e==="nucleo")&&(U=ms)}var ai=tt(require("lottie-web"),1),An=ai.default;typeof window!="undefined"&&(window.lottie=ai.default,window.__baseLottie=ai.default);var po=require("pixi.js");var Ln=require("pixi.js");var uo=null;function Tn(s){uo=s}si();kn();var Lt=require("pixi.js");si();var yo=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",jn=yo;if(typeof window!="undefined")try{let s=new XMLHttpRequest;if(s.open("GET","./build-settings.json",!1),s.send(),s.status===200&&s.responseText){let e=JSON.parse(s.responseText);e!=null&&e.buildMode&&(jn=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${jn}`))}}catch{}function vo(s){var t,i,n,a,r;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(s);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(s))return{x:(t=s[0])!=null?t:.5,y:(i=s[1])!=null?i:.5};if(s&&typeof s=="object"&&"x"in s&&"y"in s)return{x:(n=s.x)!=null?n:.5,y:(a=s.y)!=null?a:.5};if(typeof s=="string"){let o=s.trim().toLowerCase();return(r=e[o])!=null?r:{x:.5,y:.5}}return null}var pe=class{static async create(e,t,i){var l,c,d,p,u,g,h;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${jn}`);let n=(l=t==null?void 0:t.render)==null?void 0:l.asset;if(!n){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let f=new Lt.Container;return this.applyTransform(f,t==null?void 0:t.transform,t),f}let a=(c=t==null?void 0:t.identity)==null?void 0:c.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${a}, type: ${n.type}, path: ${n.path}`);let r=await Be.load(e,n,i,a);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(d=r==null?void 0:r.constructor)==null?void 0:d.name}`);let o;if(n.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Lt.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(p=o==null?void 0:o.constructor)==null?void 0:p.name),this.applyTransform(o,t==null?void 0:t.transform,t);else if(n.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(u=r==null?void 0:r.constructor)==null?void 0:u.name,r),r&&(((g=r.constructor)==null?void 0:g.name)==="Container"||r instanceof Lt.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let f=[n.path,`/assets/${n.path}`,`assets/${n.path}`,`../assets/${n.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=r)}else o=r;else o=r,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,i){var n,a,r,o;if(!(!t||!e)&&(t.position&&("x"in e&&"y"in e?(e.x=(n=t.position.x)!=null?n:0,e.y=(a=t.position.y)!=null?a:0):"position"in e&&e.position&&e.position.set((r=t.position.x)!=null?r: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=vo(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 Tt=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 So=tt(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=So);st();var ri=require("pixi.js");st();var Rn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Tt}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(n=>!this.instanceCache.has(n));if(t.length===0)return;let i=async n=>{n.length&&(console.log("[Assets] Loading objects:",n),await Promise.all(n.map(async a=>{var o;let r=this.registry.get(a);if(!r){console.warn("[Assets] No config found for object:",a);return}try{let l=await pe.create(a,r,this.app);this.instanceCache.set(a,l),console.log("[Assets] Loaded object:",a,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",a,l)}})))};return this.readyPromise=(async()=>{await i(t);let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));n.length>0&&(console.warn("[Assets] Retrying missing assets:",n),await i(n)),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 i=await pe.create(e,t,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Eo=new Rn,Co=new Proxy(Eo,{get(s,e){if(e in s&&typeof s[e]=="function")return s[e].bind(s);if(s.get(e))return s.get(e)}});st();var Is=require("pixi.js"),oe={width:400,height:600,designWidth:400,scaleFactor:1},rt={scale:1,position:1},$n=[];function Lo(s,e,t,i,n,a,r){$n.push({element:s,originalScale:a,positionHelper:e,heightPercent:n}),e(s,t,i,n,a,r,!1)}function To(){$n.forEach(({element:s,originalScale:e,positionHelper:t,heightPercent:i})=>{let n=e*oe.scaleFactor;t(s,oe.width,oe.height,i,n,!0,!1)})}function zn(s,e){console.log(`[SCREEN] updateScreenState called: ${s}x${e}`),oe.width=s,oe.height=e,oe.scaleFactor=Math.min(s/oe.designWidth,1.15),rt.scale=oe.scaleFactor,rt.position=1,console.log(`[SCREEN] Global multipliers - scale: ${rt.scale.toFixed(3)}`),To()}var ge={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 ko(s,e,t){let i=ge[s];i&&i[e]!==void 0&&(i[e]=t,console.log(`Updated ${s}.${e} = ${t}`))}function Po(){return ge}var Io={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 oi(s,e){return typeof s=="number"&&Number.isFinite(s)?s:e}function ot(s,e={x:.5,y:.5}){var t;if(Array.isArray(s))return{x:oi(s[0],e.x),y:oi(s[1],e.y)};if(s&&typeof s=="object"){let i=s;return{x:oi(i.x,e.x),y:oi(i.y,e.y)}}if(typeof s=="string"){let i=s.trim().toLowerCase();return(t=Io[i])!=null?t:e}return e}function Pt(s,e,t,i={}){var g,h,f,m,b,y;let n=ot(t),a=(g=i.inset)!=null?g:{},r=(h=i.padding)!=null?h:{x:0,y:0},o=((f=a.left)!=null?f:0)+r.x,l=((m=a.right)!=null?m:0)+r.x,c=((b=a.top)!=null?b:0)+r.y,d=((y=a.bottom)!=null?y:0)+r.y,p=Math.max(0,s-o-l),u=Math.max(0,e-c-d);return{x:o+p*n.x,y:c+u*n.y}}function It(s,e,t,i={}){var f,m,b,y,x,w;let n=(f=i.inset)!=null?f:{},a=(m=i.padding)!=null?m:{x:0,y:0},r=((b=n.left)!=null?b:0)+a.x,o=((y=n.right)!=null?y:0)+a.x,l=((x=n.top)!=null?x:0)+a.y,c=((w=n.bottom)!=null?w:0)+a.y,d=Math.max(0,s-r-o),p=Math.max(0,e-l-c),u=ot(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:r+d*g,y:l+p*h}}if(typeof window!="undefined"){let s=window.innerWidth,e=window.innerHeight,t=()=>{let i=window.innerWidth,n=window.innerHeight;(i!==s||n!==e)&&(s=i,e=n,zn(i,n))};window.addEventListener("resize",t),window.addEventListener("orientationchange",()=>{setTimeout(t,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",t),window.mraid.addEventListener("sizeChange",t)),zn(window.innerWidth,window.innerHeight),window.updateDebugConfig=ko,window.getDebugConfig=Po,window.copyConfig=Fo,window.applyConfig=kt,window.applyConfigForRatio=Bo,window.positionAtBottom=Ms,window.positionAtTop=_o,window.positionAtCenter=Oo,window.positionAtLeft=Ro,window.positionAtRight=zo,window.positionAtBottomLeft=$o,window.positionAtBottomRight=Do,window.positionAtTopLeft=Ho,window.positionAtTopRight=No,window.applyPositionContract=jo,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 li(s,e,t=0){return s*e+t}function ci(s,e,t=0){return s*(1-e)+t}function di(s,e,t=0){return s*e+t}function pi(s,e,t=0){return s*(1-e)+t}function ne(s,e=0){return s/2+e}function Mo(s,e){return s*e}function jo(s,e,t,i){var r,o,l,c,d,p,u,g,h,f,m,b,y,x,w,C,I,O,v,k;let n=0,a=0;switch(i.type){case"top":n=ne(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),a=li(t,i.percent,(c=(l=i.offset)==null?void 0:l.y)!=null?c:0);break;case"bottom":n=ne(e,(p=(d=i.offset)==null?void 0:d.x)!=null?p:0),a=ci(t,i.percent,(g=(u=i.offset)==null?void 0:u.y)!=null?g:0);break;case"left":n=di(e,i.percent,(f=(h=i.offset)==null?void 0:h.x)!=null?f:0),a=ne(t,(b=(m=i.offset)==null?void 0:m.y)!=null?b:0);break;case"right":n=pi(e,i.percent,(x=(y=i.offset)==null?void 0:y.x)!=null?x:0),a=ne(t,(C=(w=i.offset)==null?void 0:w.y)!=null?C:0);break;case"center":n=ne(e,(O=(I=i.offset)==null?void 0:I.x)!=null?O:0),a=ne(t,(k=(v=i.offset)==null?void 0:v.y)!=null?k:0);break}s.position?s.position.set(n,a):(s.x=n,s.y=a),i.scale!==void 0&&i.scale!==1&&s.scale&&(typeof s.scale.set=="function"?s.scale.set(i.scale,i.scale):(s.scale.x=i.scale,s.scale.y=i.scale))}function Ms(s,e,t,i=.2,n=1,a=!0,r=!1){let o=Mo(t,i),l=ci(t,i/2);Se(s,ne(e),l);let c=a?n*oe.scaleFactor:n;Ee(s,c),r&&!$n.find(d=>d.element===s)&&Lo(s,Ms,e,t,i,n,a)}function _o(s,e,t,i=.1,n=1){Se(s,ne(e),li(t,i)),Ee(s,n)}function Oo(s,e,t,i=0,n=0,a=1){Se(s,ne(e,i),ne(t,n)),Ee(s,a)}function Ro(s,e,t,i=.1,n=1){Se(s,di(e,i),ne(t)),Ee(s,n)}function zo(s,e,t,i=.1,n=1){Se(s,pi(e,i),ne(t)),Ee(s,n)}function $o(s,e,t,i=.05,n=.05,a=1){Se(s,di(e,n),ci(t,i)),Ee(s,a)}function Do(s,e,t,i=.05,n=.05,a=1){Se(s,pi(e,n),ci(t,i)),Ee(s,a)}function Ho(s,e,t,i=.05,n=.05,a=1){Se(s,di(e,n),li(t,i)),Ee(s,a)}function No(s,e,t,i=.05,n=.05,a=1){Se(s,pi(e,n),li(t,i)),Ee(s,a)}function Se(s,e,t){s&&s.position?typeof s.position.set=="function"?s.position.set(e,t):(s.position.x=e,s.position.y=t):s&&(s.x=e,s.y=t)}function Ee(s,e){e!==1&&s&&s.scale&&(typeof s.scale.set=="function"?s.scale.set(e,e):s.scale.x!==void 0&&s.scale.y!==void 0&&(s.scale.x=e,s.scale.y=e))}var Ge={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 Fo(s){return s&&Ge[s]?JSON.parse(JSON.stringify(Ge[s])):JSON.parse(JSON.stringify(ge))}function kt(s){Object.keys(s).forEach(e=>{let t=e;ge[t]&&s[t]&&Object.assign(ge[t],s[t])}),console.log("Config applied:",s)}function Bo(s,e){let t=s/e;t>1.6?(kt(Ge.wide),console.log("Applied WIDE config for ratio:",t)):t<.7?(kt(Ge.tall),console.log("Applied TALL config for ratio:",t)):t>.8&&t<1.2?(kt(Ge.square),console.log("Applied SQUARE config for ratio:",t)):(kt(Ge.default),console.log("Applied DEFAULT config for ratio:",t))}if(typeof window!="undefined"){let s=window;s.configPresets=Ge,s.resolveAnchorVec2=s.resolveAnchorVec2||ot,s.resolveScreenAnchorPoint=s.resolveScreenAnchorPoint||Pt,s.resolveScreenRatioPoint=s.resolveScreenRatioPoint||It}Ei();function W(s,e){let t=(n,a)=>a===0?n:t(a,n%a),i=t(s,e);return`${s/i}:${e/i}`}var od=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:W(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:W(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:W(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:W(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:W(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:W(360,780)}],ld=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:W(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:W(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:W(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:W(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:W(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:W(412,915)}],cd=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:W(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:W(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:W(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:W(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:W(800,1280)}],Qn=[{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:W(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:W(768,1024),mraidScale:.7}];var ea=[...Qn],ta=[{category:"playable",label:"Playable Ad",devices:Qn}],Ci=Qn[0];function We(s){return ea.find(e=>e.id===s)||Ci}function Xo(s){return ea.filter(e=>e.category===s)}K();var Oe=class{async updateProperty(e,t,i,n={}){var l,c,d;console.log("[PropertyUpdateManager] Updating:",e,t,i);let a=window.getEditableObjectConfig;if(typeof a!="function"){console.error("[PropertyUpdateManager] getEditableObjectConfig not available");return}let r=a(e);if(!r){console.error("[PropertyUpdateManager] Config not found for:",e);return}Q({objectId:e,path:t,value:i},{persist:!0});let o=window.applyEditableObjectConfig;if(typeof o=="function"){let p=window.__editableConfig,u=(d=(c=(l=p==null?void 0:p.objects)==null?void 0:l.get)==null?void 0:c.call(l,e))!=null?d:r;await o(e,u),console.log("[PropertyUpdateManager] Applied config successfully")}else console.warn("[PropertyUpdateManager] applyEditableObjectConfig not available");this.triggerRefresh(e),n.refreshInspector&&window.dispatchEvent(new CustomEvent("inspector:refresh"))}getNestedProperty(e,t){let i=t.split("."),n=e;for(let a of i)if(n&&typeof n=="object"&&a in n)n=n[a];else return;return n}triggerRefresh(e){let t=window.__refreshHierarchy;typeof t=="function"&&t(),window.dispatchEvent(new CustomEvent("inspector:property-updated",{detail:{objectId:e}}))}};function ia(s){let e=document.createElement("input");e.type="file",e.accept="image/*",e.onchange=async t=>{var a;let i=(a=t.target.files)==null?void 0:a[0];if(!i)return;let n=new FileReader;n.onload=async()=>{let r=n.result,o=s.category||"misc",c=`${(s.objectId||"new_asset").replace(/^json\./,"").replace(/[^a-zA-Z0-9_-]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"")||"new_asset"}_uploaded`;try{let p=await(await fetch("/api/library/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({category:o,filename:`${c}.png`,data:r,overwrite:!0})})).json();if(!(p!=null&&p.success)){alert(`Upload failed: ${(p==null?void 0:p.error)||"Unknown error"}`);return}let u=window.addAssetToRegistry;typeof u=="function"&&u(o,`${c}.png`);try{await fetch("/api/setup-library",{method:"POST",headers:{"Content-Type":"application/json"}})}catch{}let g=window.refreshAssetLibrary;typeof g=="function"&&await g(),await s.onApply(p.path)}catch(d){console.error("[QuickActionsBar] Upload error:",d),alert("Upload failed. Check console.")}},n.readAsDataURL(i)},e.click()}var Ai=class{constructor(){this.updateManager=new Oe}async handleAction(e,t,i){console.log("[QuickActionsBar] Action:",e,t,i);let n=window.getEditableObjectConfig;if(typeof n!="function")return;let a=n(t);if(!a)return;let r=this.updateManager.getNestedProperty(a,i);if(e==="ai-convert"||e==="upload"||e==="library"){let o=i==="ui.text"||i==="render.asset.path",l=i==="render.asset.path";o&&(await this.prepareForImageConversion(t,a),e==="ai-convert"&&i!=="render.asset.path"&&(i="render.asset.path"))}switch(e){case"library":this.openLibrary(t,i,r);break;case"ai-edit":this.openAIEditor(t,i,r);break;case"upload":this.openUpload(t,i);break;case"reset":await this.resetToDefault(t,i);break;case"ai-convert":this.handleAiConvert(t,i,r);break;default:console.warn("[QuickActionsBar] Unknown action:",e)}}async prepareForImageConversion(e,t){var i,n;if(console.log("[QuickActionsBar] Preparing for image conversion:",e),t.render||(t.render={alpha:1,visible:!0}),(t.render.alpha===0||t.render.alpha===void 0)&&(t.render.alpha=1,await this.updateManager.updateProperty(e,"render.alpha",1)),(t.render.visible===!1||t.render.visible===void 0)&&(t.render.visible=!0,await this.updateManager.updateProperty(e,"render.visible",!0)),t.render.asset||(t.render.asset={type:"image",path:""}),t.render.asset.type!=="image"&&(t.render.asset.type="image",await this.updateManager.updateProperty(e,"render.asset",{type:"image",path:t.render.asset.path||""})),t.ui&&t.ui.renderMode!=="png"){await this.updateManager.updateProperty(e,"ui.renderMode","png",{refreshInspector:!0}),await this.updateManager.updateProperty(e,"render.tint","#ffffff");let r=((n=(i=t.transform)==null?void 0:i.scale)!=null?n:1)*.3;await this.updateManager.updateProperty(e,"transform.scale",r),console.log("[QuickActionsBar] Text to PNG conversion: set tint white, scale",r)}this.ensureSlotInRegistry(e,t)}ensureSlotInRegistry(e,t){var o,l,c;let i=window.getEditableAssets;if(typeof i!="function")return;let n=i();if(!n||!n.slots)return;let a=e.startsWith("json.")?e.replace("json.",""):e;if(!n.slots.some(d=>d.objectId===a||d.slotId===a)){let d=((o=t.identity)==null?void 0:o.category)||"ui";console.log("[QuickActionsBar] Adding new slot to registry for converted object:",a),n.slots.push({slotId:a,displayName:a.replace(/_/g," "),objectId:a,category:d,currentAsset:((c=(l=t.render)==null?void 0:l.asset)==null?void 0:c.path)||"",defaultAsset:"",libraryFolder:d,assetType:"image"}),n.categories&&!n.categories.includes(d)&&n.categories.push(d),n.libraryAssets&&!n.libraryAssets[d]&&(n.libraryAssets[d]=[]);let p=window.reRenderAssetLibrary;typeof p=="function"&&p()}}openLibrary(e,t,i){var a;let n=window.__debugContext;if(n){if(n.activeTab!=="library"){n.activeTab="library";let r=window.__updateWorkbenchTabs;typeof r=="function"&&r()}if(n.libraryPanel){let r=window.getEditableObjectConfig,o=r==null?void 0:r(e),l=(a=o==null?void 0:o.identity)==null?void 0:a.category;l||(l=t.split(".")[0]==="render"?"environment":"ui"),console.log("[QuickActionsBar] Highlighting library slot:",e,"category:",l),n.libraryPanel.highlightSlot(e,l)}}}openAIEditor(e,t,i){let n=window.__openAiEditor;if(typeof n=="function"){let a=t.split(".").pop()||t;n(a,`Edit ${a} for ${e}`,i,{objectId:e,path:t})}else console.warn("[QuickActionsBar] AI Editor not available")}openUpload(e,t){var r;let i=window.getEditableObjectConfig,n=i==null?void 0:i(e),a=((r=n==null?void 0:n.identity)==null?void 0:r.category)||(t.split(".")[0]==="render"?"environment":"ui");ia({objectId:e,category:a,onApply:async o=>{var g,h;let l=window.applyAssetToSlot,c=this.getFilenameFromPath(o),d=/render\.asset\.path/i.test(t)||/\.(png|jpg|jpeg|gif|webp)$/i.test(o);typeof l=="function"&&c&&d&&await l(e,c,a),await this.updateManager.updateProperty(e,t,o);let p=window.__debugContext;(h=(g=p==null?void 0:p.options)==null?void 0:g.onPropertyChange)==null||h.call(g,e,t,o);let u=window.__highlightLibrarySlot;typeof u=="function"&&setTimeout(()=>{u(e,a)},500),window.dispatchEvent(new CustomEvent("inspector:refresh"))}})}getFilenameFromPath(e){if(!e)return"";let t=e.split("?")[0].replace(/\\/g,"/");return t.split("/").pop()||t}async resetToDefault(e,t){console.log("[QuickActionsBar] Reset to default:",e,t);try{let i=await this.getDefaultValue(e,t);i!==void 0?(await this.updateManager.updateProperty(e,t,i),console.log("[QuickActionsBar] Reset to default value:",i)):alert("No default value found for this property.")}catch(i){console.error("[QuickActionsBar] Failed to reset to default:",i),alert("Failed to reset property. Check console for details.")}}async getDefaultValue(e,t){let i=t.split(".");if(i.length<2)return;let n=i[0],a=i.slice(1),r=window.__editableConfig;if(!(r!=null&&r.schemas))return;let o=null;if(r.schemas instanceof Map?o=r.schemas.get(n):typeof r.schemas=="object"&&(o=r.schemas[n]),!(o!=null&&o.defaults))return;let l=o.defaults;for(let c of a)if(l&&typeof l=="object")l=l[c];else return;return l}handleAiConvert(e,t,i){let n=window.__openAiEditor;if(typeof n=="function"){let r=`A single, high-quality, high-detail game UI icon/asset representing "${String(i||e.replace(/_/g," ").replace("json.",""))}". Modern stylized 3D rendered style, vibrant colors, soft lighting, isolated on solid magenta background, highly polished professional game art.`,o="render.asset.path";console.log("[QuickActionsBar] AI Convert for:",e,"from:",t,"to:",o),n(e,r,"",{objectId:e,path:o});let l=window.__debugContext;if(l){l.activeTab="ai";let c=window.__updateWorkbenchTabs;typeof c=="function"&&c()}}else console.warn("[QuickActionsBar] AI Editor not available")}};var Jo=[{value:"loading",label:"Loading"},{value:"start",label:"Start"},{value:"gameplay",label:"Gameplay"},{value:"tutorial",label:"Tutorial"},{value:"endgame",label:"Endgame"}],Zo=["environment","ui","character","system","backgrounds"],Qo=["bg","world","ui"],qs={SwerveMove:{speed:5,sensitivity:1,directionMode:"dominantAxis",axis:"both",bounds:{left:-400,right:400,top:-300,bottom:300}},DragToWin:{targetId:"",successDistance:80},DragSnap:{snapTargetId:"",snapDistance:40},JoystickMove:{speed:6,bounds:{left:-400,right:400,top:-300,bottom:300}}},Li=class{constructor(){this.modal=null;this.state=null}open(e){this.state=this.createInitialState(e),this.createModal(),document.body.appendChild(this.modal),this.attachEventListeners(),this.updateStepUI()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),window.__wizardAssetPicker=null,this.modal=null,this.state=null}createInitialState(e){return{step:1,objectType:"sprite",instanceId:"",displayName:"",category:"environment",screenId:e.screenId,layer:"world",positionMode:"static",anchorPreset:"center",anchorX:.5,anchorY:.5,positionX:0,positionY:0,offsetX:0,offsetY:0,scale:.2,rotation:0,zIndex:0,assetPath:"",tint:"",alpha:1,text:"",font:"brand.primary",fontSize:18,letterSpacing:0,align:"center",graphicsWidth:200,graphicsHeight:200,graphicsFill:"#FFFFFF",graphicsAlpha:1,interactionEnabled:!1,dragEnabled:!1,hoverEnabled:!1,clickEnabled:!1,logicId:"",logicPropsRaw:""}}createModal(){let e=document.createElement("div");e.className="wizard-modal",e.innerHTML=`
|
|
47
47
|
<div class="wizard-card">
|
|
48
48
|
<div class="wizard-header">
|
|
49
49
|
<div class="wizard-title">
|
|
@@ -801,7 +801,7 @@ ${o}`)}this.refreshObjects()}async syncScreens(){try{await fetch("/api/sync-scre
|
|
|
801
801
|
</div>
|
|
802
802
|
`}
|
|
803
803
|
</div>
|
|
804
|
-
`}getThumbnailUrl(e){
|
|
804
|
+
`}getThumbnailUrl(e){if(e.startsWith("data:")||e.startsWith("blob:")||e.startsWith("http"))return e;let t=`t=${Date.now()}`,i=e.replace(/^\.?\//,"");if(i.startsWith("raw/")||i.startsWith("assets/")||i.startsWith("library/")){let n=`/${i}`;return n.includes("?")?`${n}&${t}`:`${n}?${t}`}return`/raw/${i}?${t}`}escapeHtml(e){let t=document.createElement("div");return t.textContent=e,t.innerHTML}formatLabel(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}};var Oi=class{render(e,t,i,n){let a=i||"#000000";return`
|
|
805
805
|
<div class="inspector-property inspector-property-color">
|
|
806
806
|
<label class="inspector-property-label">${this.formatLabel(t)}</label>
|
|
807
807
|
<div class="inspector-color-group">
|
|
@@ -2054,7 +2054,7 @@ This will DIRECTLY MODIFY your base configuration files WITHOUT creating a snaps
|
|
|
2054
2054
|
|
|
2055
2055
|
This cannot be undone unless you have git commits or backups.
|
|
2056
2056
|
|
|
2057
|
-
Are you absolutely sure?`))try{let t=Ue(),i={};for(let[a,r]of Object.entries(t.objects)){let o=r,l=a;/^(json\.|ui\.|effects\.|engine\.)/.test(l)||(l=`json.${a}`),o&&typeof o=="object"&&(o.identity||(o.identity={}),o.identity.id=l),i[`objects/${l}.json`]=o}t.engine&&(t.engine.runtime&&(i["engine/engine.runtime.json"]=t.engine.runtime),t.engine.assets&&(i["engine/engine.assets.json"]=t.engine.assets),t.engine.splash&&(i["engine/engine.splash.json"]=t.engine.splash),t.engine.loading&&(i["engine/engine.loading.json"]=t.engine.loading),t.engine.start&&(i["engine/engine.start.json"]=t.engine.start),t.engine.tutorial&&(i["engine/engine.tutorial.json"]=t.engine.tutorial),t.engine.endgame&&(i["engine/engine.endgame.json"]=t.engine.endgame),!t.engine.runtime&&!t.engine.assets&&(i["engine/engine.json"]=t.engine));for(let[a,r]of Object.entries(t.scenes)){let o=a.startsWith("scene.")?a:`scene.${a}`;i[`scenes/${o}.json`]=r}let n=await fetch("/api/apply-direct",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({configs:i,assets:{}})});if(!n.ok){let a=await n.json();throw new Error(a.error||"Direct apply failed")}ae(),this.showSuccessNotification(),this.refreshPanel()}catch(t){console.error("[ConfigPersistence] Direct apply failed:",t),alert(`\u274C Direct apply failed: ${t.message}`)}}};var Ut=class{constructor(){this.debugOverlay=null;this.isDebugOpen=!1;this.selectedObjectId=null;this.configViewer=null;this.container=null;this.objectAutoApplyTimer=null;this.objectDebugRaf=null;this.objectBoundsGfx=null;this.objectAnchorGfx=null;this.highlightObject=!1;this.highlightAnchor=!1;this.activeTab="hierarchy";this.sceneObjectsPanel=new Pi;this.sceneToolsPanel=new Ii;this.nudgePanel=new Mi;this.inspectorPanel=new qi;this.libraryPanel=new Dt;this.libraryPanelDocked=new Dt;this.brandVisionPanel=new Xi;this.customizeSettingsPanel=new Ji;this.configPersistencePanel=new on;this.loadingScreenPanel=new Zi}applyAssetChange(e,t){return cr(this,e,t)}resetAsset(e){return dr(this,e)}applySlotAsset(e,t,i){return Yi(this,e,t,i)}resetSlotAsset(e,t,i){return pr(this,e,t,i)}startObjectVisuals(){return br(this)}stopObjectVisuals(){return yr(this)}shouldRunObjectVisuals(){return Qi(this)}updateObjectVisuals(){return en(this)}getSelectedInstanceId(){return ca(this)}getDisplayObjectById(e){return da(this,e)}getSelectedObjectConfig(){return Gt(this)}getConfigAnchorWorldPoint(e){return pa(this,e)}getScreenSize(){return ua(this)}ensureBoundsGfx(){return ga(this)}ensureAnchorGfx(){return ha(this)}drawBounds(e){return fa(this,e)}drawAnchor(e){return ma(this,e)}clearBounds(){return ba(this)}clearAnchor(){return ya(this)}clearObjectVisuals(){return Ft(this)}updateObjectInfo(e){return Nt(this,e)}resetDebugConfig(){return nn(this)}applyDebugConfig(){return xr(this)}exportDebugConfig(){return an(this)}loadObjectConfig(e){return Sr(this,e)}fillConfigViewer(e){return tn(this,e)}copyConfigValues(){return Er(this)}applyObjectConfig(e){return wa(this,e)}applyCustomizeSettings(e,t){return Cr(this,e,t)}scheduleObjectAutoApply(){return Ar(this)}setupDebugEventListeners(){return Lr(this)}setupDebugInputListeners(e){return Ca(this,e)}setupPanelLayout(){return Tr(this)}setupCollapsiblePanels(e){return Aa(this,e)}setupRangeInput(e,t,i,n){return le(this,e,t,i,n)}updateWorkbenchTabs(){return Ea(this)}saveWorkbenchState(){return pt(this)}loadWorkbenchState(){return rn(this)}initialize(e){var n;this.container=e,this.debugOverlay=e.querySelector(".debug-overlay"),this.configViewer=e.querySelector("#config-viewer");try{let a=localStorage.getItem("preview_workbench_state");if(a){let r=JSON.parse(a);r.activeTab&&(this.activeTab=r.activeTab)}}catch(a){console.warn("[PREVIEW] Failed to load workbench tab state",a)}this.sceneObjectsPanel.initialize(e,{onSelect:a=>this.handleObjectSelect(a)}),this.libraryPanel.initialize(e,{onApply:(a,r,o)=>this.applySlotAsset(a,r,o),onReset:(a,r,o)=>this.resetSlotAsset(a,r,o)});let t=e.querySelector("#dock-library-content");t&&(t.innerHTML=this.libraryPanelDocked.render(),this.libraryPanelDocked.initialize(t,{onApply:(a,r,o)=>this.applySlotAsset(a,r,o),onReset:(a,r,o)=>this.resetSlotAsset(a,r,o)})),this.inspectorPanel.initialize(e,{onPropertyChange:(a,r,o)=>{console.log("[Inspector] Property changed:",a,r,o)}}),this.brandVisionPanel.initialize(e,()=>{this.toggleDebug(!1);let a="/dashboard";window.location.pathname!==a&&(window.location.href=a)}),this.customizeSettingsPanel.initialize(e,{onApply:(a,r)=>this.applyCustomizeSettings(a,r)}),this.sceneToolsPanel.initialize(e,{onHighlightObject:a=>{this.highlightObject=a,a?this.selectedObjectId&&this.startObjectVisuals():this.stopObjectVisuals()},onHighlightAnchor:a=>{this.highlightAnchor=a,a?this.selectedObjectId&&this.startObjectVisuals():this.stopObjectVisuals()},onNudge:(a,r)=>this.nudgeSelectedObject(a,r),onShowSplash:()=>{let a=window;typeof a.__previewShowSplash=="function"&&a.__previewShowSplash()},onUpdateSplash:a=>{let r=window;typeof r.applyEditableEngineConfig=="function"&&r.applyEditableEngineConfig({splash:a})}}),this.nudgePanel.initialize(e,{onNudge:async(a,r)=>{var g,h,f,m,b,y;if(!this.selectedObjectId)return;let o=this.getSelectedObjectConfig();if(!o)return;let l=(g=o.transform)==null?void 0:g.position,c=((h=l==null?void 0:l.x)!=null?h:0)+a,d=((f=l==null?void 0:l.y)!=null?f:0)+r,{applyConfigOverride:p}=await Promise.resolve().then(()=>(K(),je));p({objectId:this.selectedObjectId,path:"transform.position",value:{x:c,y:d}},{silent:!0,emitEvent:!0});let u=window.applyEditableObjectConfig;if(typeof u=="function"){let x=window.__editableConfig,w=(y=(b=(m=x==null?void 0:x.objects)==null?void 0:m.get)==null?void 0:b.call(m,this.selectedObjectId))!=null?y:o;await u(this.selectedObjectId,w)}window.dispatchEvent(new CustomEvent("inspector:refresh"))},onScale:async a=>{var p,u,g,h,f;if(!this.selectedObjectId)return;let r=this.getSelectedObjectConfig();if(!r)return;let o=(u=(p=r.transform)==null?void 0:p.scale)!=null?u:1,l=Math.max(.1,o+a),{applyConfigOverride:c}=await Promise.resolve().then(()=>(K(),je));c({objectId:this.selectedObjectId,path:"transform.scale",value:l},{silent:!0,emitEvent:!0});let d=window.applyEditableObjectConfig;if(typeof d=="function"){let m=window.__editableConfig,b=(f=(h=(g=m==null?void 0:m.objects)==null?void 0:g.get)==null?void 0:h.call(g,this.selectedObjectId))!=null?f:r;await d(this.selectedObjectId,b)}window.dispatchEvent(new CustomEvent("inspector:refresh"))}});let i=e.querySelector("#debug-nudge-enabled");i==null||i.addEventListener("change",()=>{i.checked?this.nudgePanel.show():this.nudgePanel.hide()}),this.configPersistencePanel.initialize(e),this.loadingScreenPanel.initialize(e,{onShowLoadingScreen:()=>{let a=window;typeof a.__previewShowLoading=="function"?a.__previewShowLoading():console.warn("[DEBUG] __previewShowLoading not available")},onHideLoadingScreen:()=>{let a=window;typeof a.__previewHideLoading=="function"?a.__previewHideLoading():console.warn("[DEBUG] __previewHideLoading not available")},onUpdateLoading:a=>{let r=window;typeof r.applyEditableEngineConfig=="function"&&r.applyEditableEngineConfig({loading:a}),typeof r.__previewUpdateLoading=="function"?r.__previewUpdateLoading(a):console.warn("[DEBUG] __previewUpdateLoading not available")}}),window.__openAiEditor=(a,r,o,l)=>{this.customizeSettingsPanel.openAiEditor(a,r,o,l)},this.setupPanelLayout(),this.updateWorkbenchTabs(),window.__debugContext=this,window.__updateWorkbenchTabs=()=>this.updateWorkbenchTabs(),this.isDebugOpen=!0,(n=this.debugOverlay)==null||n.classList.remove("hidden"),this.updateDebugBadge(),this.sceneObjectsPanel.refreshObjects(),window.__previewSelectObject=a=>this.selectObject(a),window.addEventListener("config:changed",a=>{var r,o;((r=a.detail)==null?void 0:r.action)!=="remove"&&((o=a.detail)==null?void 0:o.action)!=="clear_object"&&this.highlightChangesTab()}),window.applyAssetToSlot=(a,r,o)=>this.applySlotAsset(a,r,o),window.refreshAssetLibrary=()=>this.libraryPanel.refresh(),window.reRenderAssetLibrary=()=>this.libraryPanel.reRender(),window.getEngineSplashConfig=()=>{var r;let a=window.getActiveConfig;if(typeof a=="function"){let o=a();return((r=o==null?void 0:o.engine)==null?void 0:r.splash)||null}return null},window.addAssetToRegistry=(a,r)=>{let o=window.getEditableAssets;if(typeof o=="function"){let l=o();if(l!=null&&l.libraryAssets&&(l.libraryAssets[a]||(l.libraryAssets[a]=[]),!l.libraryAssets[a].some(d=>d.filename===r))){let d=r.replace(/\.(png|jpg|jpeg)$/i,"").replace(/_/g," ");l.libraryAssets[a].unshift({filename:r,displayName:d}),console.log(`[DEBUG] Added ${r} to registry category ${a}`)}}},window.__highlightLibrarySlot=(a,r)=>{this.libraryPanel.highlightSlot(a,r)}}selectObject(e){this.handleObjectSelect(e),this.activeTab!=="inspector"&&this.activeTab!=="ai"&&this.setActiveTab("inspector")}setActiveTab(e){this.activeTab=e,this.updateWorkbenchTabs(),this.saveWorkbenchState()}highlightChangesTab(){var t;let e=(t=this.container)==null?void 0:t.querySelector('[data-tab="changes"]');e&&e.classList.add("has-pending-changes")}getDebugOverlayHTML(){return`
|
|
2057
|
+
Are you absolutely sure?`))try{let t=Ue(),i={};for(let[a,r]of Object.entries(t.objects)){let o=r,l=a;/^(json\.|ui\.|effects\.|engine\.)/.test(l)||(l=`json.${a}`),o&&typeof o=="object"&&(o.identity||(o.identity={}),o.identity.id=l),i[`objects/${l}.json`]=o}t.engine&&(t.engine.runtime&&(i["engine/engine.runtime.json"]=t.engine.runtime),t.engine.assets&&(i["engine/engine.assets.json"]=t.engine.assets),t.engine.splash&&(i["engine/engine.splash.json"]=t.engine.splash),t.engine.loading&&(i["engine/engine.loading.json"]=t.engine.loading),t.engine.start&&(i["engine/engine.start.json"]=t.engine.start),t.engine.tutorial&&(i["engine/engine.tutorial.json"]=t.engine.tutorial),t.engine.endgame&&(i["engine/engine.endgame.json"]=t.engine.endgame),!t.engine.runtime&&!t.engine.assets&&(i["engine/engine.json"]=t.engine));for(let[a,r]of Object.entries(t.scenes)){let o=a.startsWith("scene.")?a:`scene.${a}`;i[`scenes/${o}.json`]=r}let n=await fetch("/api/apply-direct",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({configs:i,assets:{}})});if(!n.ok){let a=await n.json();throw new Error(a.error||"Direct apply failed")}ae(),this.showSuccessNotification(),this.refreshPanel()}catch(t){console.error("[ConfigPersistence] Direct apply failed:",t),alert(`\u274C Direct apply failed: ${t.message}`)}}};var Ut=class{constructor(){this.debugOverlay=null;this.isDebugOpen=!1;this.selectedObjectId=null;this.configViewer=null;this.container=null;this.objectAutoApplyTimer=null;this.objectDebugRaf=null;this.objectBoundsGfx=null;this.objectAnchorGfx=null;this.highlightObject=!1;this.highlightAnchor=!1;this.activeTab="hierarchy";this.sceneObjectsPanel=new Pi;this.sceneToolsPanel=new Ii;this.nudgePanel=new Mi;this.inspectorPanel=new qi;this.libraryPanel=new Dt;this.libraryPanelDocked=new Dt;this.brandVisionPanel=new Xi;this.customizeSettingsPanel=new Ji;this.configPersistencePanel=new on;this.loadingScreenPanel=new Zi}applyAssetChange(e,t){return cr(this,e,t)}resetAsset(e){return dr(this,e)}applySlotAsset(e,t,i){return Yi(this,e,t,i)}resetSlotAsset(e,t,i){return pr(this,e,t,i)}startObjectVisuals(){return br(this)}stopObjectVisuals(){return yr(this)}shouldRunObjectVisuals(){return Qi(this)}updateObjectVisuals(){return en(this)}getSelectedInstanceId(){return ca(this)}getDisplayObjectById(e){return da(this,e)}getSelectedObjectConfig(){return Gt(this)}getConfigAnchorWorldPoint(e){return pa(this,e)}getScreenSize(){return ua(this)}ensureBoundsGfx(){return ga(this)}ensureAnchorGfx(){return ha(this)}drawBounds(e){return fa(this,e)}drawAnchor(e){return ma(this,e)}clearBounds(){return ba(this)}clearAnchor(){return ya(this)}clearObjectVisuals(){return Ft(this)}updateObjectInfo(e){return Nt(this,e)}resetDebugConfig(){return nn(this)}applyDebugConfig(){return xr(this)}exportDebugConfig(){return an(this)}loadObjectConfig(e){return Sr(this,e)}fillConfigViewer(e){return tn(this,e)}copyConfigValues(){return Er(this)}applyObjectConfig(e){return wa(this,e)}applyCustomizeSettings(e,t){return Cr(this,e,t)}scheduleObjectAutoApply(){return Ar(this)}setupDebugEventListeners(){return Lr(this)}setupDebugInputListeners(e){return Ca(this,e)}setupPanelLayout(){return Tr(this)}setupCollapsiblePanels(e){return Aa(this,e)}setupRangeInput(e,t,i,n){return le(this,e,t,i,n)}updateWorkbenchTabs(){return Ea(this)}saveWorkbenchState(){return pt(this)}loadWorkbenchState(){return rn(this)}initialize(e){var n;this.container=e,this.debugOverlay=e.querySelector(".debug-overlay"),this.configViewer=e.querySelector("#config-viewer");try{let a=localStorage.getItem("preview_workbench_state");if(a){let r=JSON.parse(a);r.activeTab&&(this.activeTab=r.activeTab)}}catch(a){console.warn("[PREVIEW] Failed to load workbench tab state",a)}this.sceneObjectsPanel.initialize(e,{onSelect:a=>this.handleObjectSelect(a)}),this.libraryPanel.initialize(e,{onApply:(a,r,o)=>this.applySlotAsset(a,r,o),onReset:(a,r,o)=>this.resetSlotAsset(a,r,o)});let t=e.querySelector("#dock-library-content");t&&(t.innerHTML=this.libraryPanelDocked.render(),this.libraryPanelDocked.initialize(t,{onApply:(a,r,o)=>this.applySlotAsset(a,r,o),onReset:(a,r,o)=>this.resetSlotAsset(a,r,o)})),this.inspectorPanel.initialize(e,{onPropertyChange:(a,r,o)=>{console.log("[Inspector] Property changed:",a,r,o)}}),this.brandVisionPanel.initialize(e,()=>{this.toggleDebug(!1);let a="/dashboard";window.location.pathname!==a&&(window.location.href=a)}),this.customizeSettingsPanel.initialize(e,{onApply:(a,r)=>this.applyCustomizeSettings(a,r)}),this.sceneToolsPanel.initialize(e,{onHighlightObject:a=>{this.highlightObject=a,a?this.selectedObjectId&&this.startObjectVisuals():this.stopObjectVisuals()},onHighlightAnchor:a=>{this.highlightAnchor=a,a?this.selectedObjectId&&this.startObjectVisuals():this.stopObjectVisuals()},onNudge:(a,r)=>this.nudgeSelectedObject(a,r),onShowSplash:()=>{let a=window;typeof a.__previewShowSplash=="function"&&a.__previewShowSplash()},onUpdateSplash:a=>{let r=window;typeof r.applyEditableEngineConfig=="function"&&r.applyEditableEngineConfig({splash:a})}}),this.nudgePanel.initialize(e,{onNudge:async(a,r)=>{var g,h,f,m,b,y;if(!this.selectedObjectId)return;let o=this.getSelectedObjectConfig();if(!o)return;let l=(g=o.transform)==null?void 0:g.position,c=((h=l==null?void 0:l.x)!=null?h:0)+a,d=((f=l==null?void 0:l.y)!=null?f:0)+r,{applyConfigOverride:p}=await Promise.resolve().then(()=>(K(),je));p({objectId:this.selectedObjectId,path:"transform.position",value:{x:c,y:d}},{silent:!0,emitEvent:!0});let u=window.applyEditableObjectConfig;if(typeof u=="function"){let x=window.__editableConfig,w=(y=(b=(m=x==null?void 0:x.objects)==null?void 0:m.get)==null?void 0:b.call(m,this.selectedObjectId))!=null?y:o;await u(this.selectedObjectId,w)}window.dispatchEvent(new CustomEvent("inspector:refresh"))},onScale:async a=>{var p,u,g,h,f;if(!this.selectedObjectId)return;let r=this.getSelectedObjectConfig();if(!r)return;let o=(u=(p=r.transform)==null?void 0:p.scale)!=null?u:1,l=Math.max(.1,o+a),{applyConfigOverride:c}=await Promise.resolve().then(()=>(K(),je));c({objectId:this.selectedObjectId,path:"transform.scale",value:l},{silent:!0,emitEvent:!0});let d=window.applyEditableObjectConfig;if(typeof d=="function"){let m=window.__editableConfig,b=(f=(h=(g=m==null?void 0:m.objects)==null?void 0:g.get)==null?void 0:h.call(g,this.selectedObjectId))!=null?f:r;await d(this.selectedObjectId,b)}window.dispatchEvent(new CustomEvent("inspector:refresh"))}});let i=e.querySelector("#debug-nudge-enabled");i==null||i.addEventListener("change",()=>{i.checked?this.nudgePanel.show():this.nudgePanel.hide()}),this.configPersistencePanel.initialize(e),this.loadingScreenPanel.initialize(e,{onShowLoadingScreen:()=>{let a=window;typeof a.__previewShowLoading=="function"?a.__previewShowLoading():console.warn("[DEBUG] __previewShowLoading not available")},onHideLoadingScreen:()=>{let a=window;typeof a.__previewHideLoading=="function"?a.__previewHideLoading():console.warn("[DEBUG] __previewHideLoading not available")},onUpdateLoading:a=>{let r=window;typeof r.applyEditableEngineConfig=="function"&&r.applyEditableEngineConfig({loading:a}),typeof r.__previewUpdateLoading=="function"?r.__previewUpdateLoading(a):console.warn("[DEBUG] __previewUpdateLoading not available")}}),window.__openAiEditor=(a,r,o,l)=>{this.customizeSettingsPanel.openAiEditor(a,r,o,l)},this.setupPanelLayout(),this.updateWorkbenchTabs(),window.__debugContext=this,window.__updateWorkbenchTabs=()=>this.updateWorkbenchTabs(),this.isDebugOpen=!0,(n=this.debugOverlay)==null||n.classList.remove("hidden"),this.updateDebugBadge(),this.sceneObjectsPanel.refreshObjects(),window.__previewSelectObject=a=>this.selectObject(a),window.addEventListener("config:changed",a=>{var r,o;((r=a.detail)==null?void 0:r.action)!=="remove"&&((o=a.detail)==null?void 0:o.action)!=="clear_object"&&this.highlightChangesTab()}),window.applyAssetToSlot=(a,r,o)=>this.applySlotAsset(a,r,o),window.refreshAssetLibrary=()=>Promise.all([this.libraryPanel.refresh(),this.libraryPanelDocked.refresh()]),window.reRenderAssetLibrary=()=>{this.libraryPanel.reRender(),this.libraryPanelDocked.reRender()},window.getEngineSplashConfig=()=>{var r;let a=window.getActiveConfig;if(typeof a=="function"){let o=a();return((r=o==null?void 0:o.engine)==null?void 0:r.splash)||null}return null},window.addAssetToRegistry=(a,r)=>{let o=window.getEditableAssets;if(typeof o=="function"){let l=o();if(l!=null&&l.libraryAssets&&(l.libraryAssets[a]||(l.libraryAssets[a]=[]),!l.libraryAssets[a].some(d=>d.filename===r))){let d=r.replace(/\.(png|jpg|jpeg)$/i,"").replace(/_/g," ");l.libraryAssets[a].unshift({filename:r,displayName:d}),console.log(`[DEBUG] Added ${r} to registry category ${a}`)}}},window.__highlightLibrarySlot=(a,r)=>{this.libraryPanel.highlightSlot(a,r),this.libraryPanelDocked.highlightSlot(a,r)}}selectObject(e){this.handleObjectSelect(e),this.activeTab!=="inspector"&&this.activeTab!=="ai"&&this.setActiveTab("inspector")}setActiveTab(e){this.activeTab=e,this.updateWorkbenchTabs(),this.saveWorkbenchState()}highlightChangesTab(){var t;let e=(t=this.container)==null?void 0:t.querySelector('[data-tab="changes"]');e&&e.classList.add("has-pending-changes")}getDebugOverlayHTML(){return`
|
|
2058
2058
|
<div class="debug-overlay hidden" id="debug-overlay">
|
|
2059
2059
|
<div class="debug-workbench" id="debug-workbench">
|
|
2060
2060
|
<div class="workbench-header" id="workbench-handle">
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as J,F as K,G as L,H as M,I as N,J as O,K as P,L as Q,M as R,N as S,O as T,P as U,Q as V,R as W,S as X,T as Y,U as Z,a}from"./chunk-
|
|
1
|
+
import{E as J,F as K,G as L,H as M,I as N,J as O,K as P,L as Q,M as R,N as S,O as T,P as U,Q as V,R as W,S as X,T as Y,U as Z,a}from"./chunk-NUN3J3M4.js";import"./chunk-I5OOVR5U.js";import{a as u,b as v,c as w,d as x,e as y,f as z,g as A,h as B,i as C,j as D,k as E,l as F,m as G,n as H,o as I}from"./chunk-PW2FGMCO.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,p as q,q as r,r as s,s as t}from"./chunk-HVKF2KYL.js";import"./chunk-E6WJCS24.js";import"./chunk-JXBG6UFL.js";export{U as COLORS,F as ConfigWatcher,O as DebugPanel,E as DefaultReloadStrategy,Y as Handler,X as PlayableLoadingScreen,P as PreviewShell,V as STROKE_WIDTH,W as THEME,d as applyConfigOverride,e as applyConfigOverrides,r as applyConfigsToDisk,B as applyDefaults,a as baseLottie,T as bootstrap,f as clearConfigOverrides,g as clearConfigOverridesForObject,j as configOverrideManager,Q as createPreviewShell,o as deepClone,Z as default,L as defaultPreset,K as deviceGroups,J as devicePresets,G as diffConfigs,p as exportConfigsAsJSON,i as getConfigOverrides,q as getConfigStateSummary,b as getOverrideMode,M as getPresetById,N as getPresetsByCategory,w as loadAllObjectConfigs,u as loadComponentSchemas,x as loadEngineConfig,y as loadGamePromptConfig,C as loadObjectCentricConfig,v as loadObjectConfig,z as loadSceneConfig,l as redoLastConfigChange,H as rehydrateObject,h as removeConfigOverride,s as resetToApplied,t as resetToOriginal,S as setBootstrapDependencies,c as setOverrideMode,I as setupHotReload,R as setupLiveEditBridge,D as toLegacyFormat,m as trackObjectCreation,n as trackObjectDeletion,k as undoLastConfigChange,A 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=n}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let l=o.target.dataset.tab;l&&this.switchTab(l)})});let n=this.modal.querySelector("[data-ai-generate]");n==null||n.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let 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 rr={};cn(rr,{AssetCache:()=>oe,AssetLoader:()=>Pe,AssetSystem:()=>si,AssetTextures:()=>Ie,Assets:()=>_a,BaseSystem:()=>st,GameEngine:()=>ai,GameObject:()=>It,GameObjectManager:()=>nt,ObjectFactory:()=>be,Renderer:()=>Pt,RuntimeObjectRegistry:()=>rt,Transform:()=>kt,applyScreenAnchor:()=>Gt,basePixi:()=>Pa,clearResponsiveElements:()=>sa,createPixiBase:()=>ii,getRegisteredFontIds:()=>Aa,globalResponsiveMultipliers:()=>Ke,initAssetTextures:()=>Nt,initAssets:()=>Oa,layout:()=>oa,playLottieOverlay:()=>Ta,registerFont:()=>Ca,registerType:()=>Dt,resolveAnchorVec2:()=>Me,resolveFont:()=>Sa,resolveFontWeight:()=>Ea,resolveScreenAnchorPoint:()=>Ne,resolveScreenRatioPoint:()=>Fe,runInitSequence:()=>Ra,setLottieInstance:()=>Xt,spawnSceneFromConfig:()=>Ma,updateScreenState:()=>Bt});module.exports=Ba(rr);var xa=require("pixi.js");var Te={};function _t(i,e,t=!1){Te[i]||(Te[i]=[]),Te[i].push({fn:e,once:t})}function ci(i,e){if(Te[i]){if(!e){delete Te[i];return}Te[i]=Te[i].filter(t=>t.fn!==e)}}function Ot(i,...e){let t=Te[i];if(t)for(let n of[...t])n.fn(...e),n.once&&ci(i,n.fn)}function Z(i,e){_t(i,e,!0)}var D=null,te=[],qe=null;function gn(i){D=i,te=[],qe!==null&&(clearTimeout(qe),qe=null)}function hn(){var i,e,t;return{endpoint:(D==null?void 0:D.endpoint)||"",transport:(D==null?void 0:D.transport)||"beacon",batchSize:(i=D==null?void 0:D.batchSize)!=null?i: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 pn(i,e,t,n){let a=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(i,new Blob([a],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",e)}catch(s){n&&console.warn("[handler.telemetry] fetch failed",s)}}function di(i,e){let t=hn();if(e&&t.endpoint){if(te.push(i),te.length>t.maxQueue&&(te=te.slice(te.length-t.maxQueue)),te.length>=t.batchSize){un();return}qe===null&&(qe=window.setTimeout(()=>{qe=null,un()},t.flushIntervalMs))}}async function un(){let i=hn();if(!i.endpoint||te.length===0)return;let e=te.splice(0,i.batchSize);await pn(i.endpoint,{events:e},i.transport,i.debug),te.length>0&&await pn(i.endpoint,{events:te.splice(0,i.batchSize)},i.transport,i.debug)}function fn(i){return Math.max(0,Math.min(1,i))}function Ga(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 bt(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ua(i,e){let t=i==null?void 0:i[e];return typeof t=="number"?t:0}function mn(i,e,t){try{i[e]=t}catch{}}function qa(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 bn(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 yn(i,e){let t=qa(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 vn(){let i=new Set,e=new WeakMap,t=null,n=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),i.size>0&&n()})},a=u=>{var p;i.add(u);let d=(p=e.get(u.target))!=null?p:new Set;d.add(u),e.set(u.target,d),n()},s=u=>{i.delete(u);let d=e.get(u.target);d&&(d.delete(u),d.size===0&&e.delete(u.target))},r=u=>{u.killed||(u.killed=!0,s(u))},o=()=>{var d,p;let u=bt();for(let g of Array.from(i)){if(g.killed||g.paused)continue;let m=u-g.startMs-g.delayMs;if(m<0)continue;let f=g.durationMs>0?m/g.durationMs:1,C=fn(f),b=g.repeat>=0?g.repeat+1:1,h=g.repeat>0?Math.min(Math.floor(f),b-1):0;if(g.repeat>0&&f>=1){let y=f-h;C=fn(y)}let v=g.ease(C);g.yoyo&&h%2===1&&(v=1-v);for(let y of g.props)mn(g.target,y.key,y.from+(y.to-y.from)*v);g.scaleFrom&&g.scaleTo&&bn(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){r(g);try{(p=g.onComplete)==null||p.call(g)}catch{}}}},c=(u,d,p)=>{var y;let g=Math.max(0,(typeof d.duration=="number"?d.duration:.5)*1e3),m=Math.max(0,(typeof d.delay=="number"?d.delay:0)*1e3+((y=p==null?void 0:p.delayMsOverride)!=null?y:0)),f=Ga(d.ease),C=typeof d.repeat=="number"?Math.max(0,d.repeat|0):0,b=d.yoyo===!0,h=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),v=[];for(let I of Object.keys(d)){if(h.has(I))continue;let _=d[I];typeof _=="number"&&v.push({key:I,from:Ua(u,I),to:_})}let w=yn(u,d);return{target:u,startMs:bt(),delayMs:m,durationMs:g,ease:f,props:v,scaleFrom:w.from,scaleTo:w.to,repeat:C,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}},l={to(u,d){let p=c(u,d);return a(p),{kill:()=>r(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=bt())},resume:()=>{var f;if(!p.paused)return;let g=(f=p.pauseAtMs)!=null?f:bt(),m=bt()-g;p.startMs+=m,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(u,d,p){return l.set(u,d),l.to(u,p)},set(u,d){if(!u||!d)return;for(let g of Object.keys(d)){let m=d[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof m=="number"&&mn(u,g,m)}let p=yn(u,d);p.to&&bn(u,p.to)},killTweensOf(u){let d=e.get(u);if(d)for(let p of Array.from(d))r(p)},timeline(u={}){let d=[],p=0,g=!1,m=[],f=h=>{if(typeof h=="number")return Math.max(0,h*1e3);let v=typeof h=="string"?h.trim():"";return v.startsWith("+=")?p+Math.max(0,Number(v.slice(2))*1e3||0):v?Math.max(0,Number(v)*1e3||0):p},C=h=>{d.push(h);let v=Math.max(0,(typeof h.vars.duration=="number"?h.vars.duration:.5)*1e3);p=Math.max(p,h.atMs+v)},b={to(h,v,w){return C({kind:"to",target:h,vars:v,atMs:f(w)}),b},fromTo(h,v,w,y){return C({kind:"fromTo",target:h,vars:w,from:v,atMs:f(y)}),b},play(){var h,v;if(g)return b;g=!0,m=[];for(let w of d)w.kind==="fromTo"&&l.set(w.target,(h=w.from)!=null?h:{}),m.push(l.to(w.target,{...w.vars,delay:w.atMs/1e3+((v=w.vars.delay)!=null?v:0)}));return b},pause(){for(let h of m)h.pause();return b},kill(){for(let h of m)h.kill();m=[],g=!1}};return u.paused||b.play(),b}};return l}function wn(){if(typeof window=="undefined")return;let i=window;if(!i.gsap)try{i.gsap=vn()}catch{}}var xn={name:"handler-playable-sdk",version:"1.0.12",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 --external jszip && 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 --external jszip && 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 Q=0,Wa=Q++,Sn=Q++,En=Q++,Cn=Q++,An=Q++,Ln=Q++,Tn=Q++,kn=Q++,Pn=Q++,In=Q++,Mn=Q++,jn=Q++,O=Wa;function _n(){return O===Sn}function On(){return O===En}function Rn(){return O===Cn}function zn(){return O===An}function Ve(){return O===Ln}function We(){return O===Tn}function $n(){return O===kn}function Dn(){return O===Pn}function Hn(){return O===In}function pi(){return O===Mn}function ui(){return O===jn}function Nn(){let i=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(i==="mraid")try{mraid.getState(),O=Sn;return}catch{}else if(i==="dapi")try{dapi.isReady(),O=En;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(O=Cn)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(O=An)}catch{}else if(e==="mintegral")window.gameReady&&(O=Ln);else if(e==="tapjoy")window.TJ_API&&(O=Tn);else if(e==="tiktok")window.openAppStore&&(O=kn);else if(e==="smadex")try{window.smxTracking&&(O=Pn)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(O=In)}catch{}else e==="vungle"?O=Mn:(i==="nucleo"||e==="nucleo")&&(O=jn)}var Rt=li(require("lottie-web"),1),Fn=Rt.default;typeof window!="undefined"&&(window.lottie=Rt.default,window.__baseLottie=Rt.default);fi();function H(i,e){let t=(a,s)=>s===0?a:t(s,a%s),n=t(i,e);return`${i/n}:${e/n}`}var Hr=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:H(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:H(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:H(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:H(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:H(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:H(360,780)}],Nr=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:H(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:H(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:H(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:H(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:H(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:H(412,915)}],Fr=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:H(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:H(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:H(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:H(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:H(800,1280)}],qn=[{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:H(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:H(768,1024),mraidScale:.7}];var Br=[...qn];var ts=qn[0];re();function is(i){return new Promise((e,t)=>{let n=new FileReader;n.onerror=()=>t(new Error("FileReader failed")),n.onload=()=>e(String(n.result||"")),n.readAsDataURL(i)})}function ns(i){var a;let[e,t]=i.split(","),n=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=n==null?void 0:n[1])!=null?a:"image/png"}}async function as(i){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=i})}async function mi(i){var e,t;try{console.log("[ImageUtils] Fetching image data from URL:",i);let n=await fetch(i);if(!n.ok)return console.warn("[ImageUtils] Fetch failed with status:",n.status,i),null;let a=await n.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await is(a),r=await as(s),o=ns(s);return console.log("[ImageUtils] Success resolution:",r==null?void 0:r.width,"x",r==null?void 0:r.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:s,width:(e=r==null?void 0:r.width)!=null?e:0,height:(t=r==null?void 0:r.height)!=null?t:0}}catch(n){return console.error("[ImageUtils] Error fetching image data:",n),null}}async function zt(i,e=30){try{console.log("[ImageUtils] Removing background color...");let t=await new Promise((d,p)=>{let g=new Image;g.onload=()=>d(g),g.onerror=()=>p(new Error("Failed to load image")),g.src=i}),n=document.createElement("canvas");n.width=t.width,n.height=t.height;let a=n.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),i;a.drawImage(t,0,0);let s=a.getImageData(0,0,n.width,n.height),r=s.data,c=[{name:"top-left",offset:0},{name:"top-right",offset:(n.width-1)*4},{name:"bottom-left",offset:(n.height-1)*n.width*4},{name:"bottom-right",offset:((n.height-1)*n.width+(n.width-1))*4}].map(d=>({r:r[d.offset],g:r[d.offset+1],b:r[d.offset+2]})),l=0;for(let d=0;d<r.length;d+=4){let p=r[d],g=r[d+1],m=r[d+2],f=!1;for(let C of c)if(Math.sqrt(Math.pow(p-C.r,2)+Math.pow(g-C.g,2)+Math.pow(m-C.b,2))<e){f=!0;break}f&&(r[d+3]=0,l++)}return console.log(`[ImageUtils] Removed background from ${l} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),n.toDataURL("image/png")}catch(t){return console.error("[ImageUtils] Error removing background:",t),i}}var Yn=require("@google/genai");async function bi(i,e,t=[],n={}){var a,s,r,o,c,l,u;try{if(!(i!=null&&i.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 h=t[b];if(!h.base64||!h.mimeType)throw new Error(`Image ${b+1} is missing required data`);if(h.base64.length<1e3&&console.warn(`Image ${b+1} data appears very small, may be corrupted`),!h.mimeType.startsWith("image/"))throw new Error(`Image ${b+1} has invalid MIME type: ${h.mimeType}`)}let d=new Yn.GoogleGenAI({apiKey:i}),p="gemini-2.5-flash",g=[e];t.length>0&&t.forEach((b,h)=>{g.push({inlineData:{data:b.base64,mimeType:b.mimeType}}),console.log(`[Gemini] Added image ${h+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 d.models.generateContent({model:p,contents:g}),f="",C=(r=(s=(a=m.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(C)for(let b of C)b.text&&(f+=b.text);if(!f.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${f.length}`),f}catch(d){throw console.error("[Gemini] API error:",d),(o=d.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."):(c=d.message)!=null&&c.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(l=d.message)!=null&&l.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(u=d.message)!=null&&u.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):d}}var Kn=require("@google/genai");async function $t(i,e,t=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Kn.GoogleGenAI({apiKey:i}),s=[{text:e}];t.length>0&&t.forEach((o,c)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${c}`),s.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let r=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:s});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!r.candidates||!r.candidates[0]||!r.candidates[0].content||!r.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of r.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let c=o.inlineData.data,l=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${l};base64,${c}`}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 ds=require("pixi.js");yt();re();var ta=require("pixi.js");var us=require("pixi.js");re();function Ss(i){return new Promise((e,t)=>{let n=new FileReader;n.onerror=()=>t(new Error("FileReader failed")),n.onload=()=>e(String(n.result||"")),n.readAsDataURL(i)})}function Es(i){var a;let[e,t]=i.split(","),n=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=n==null?void 0:n[1])!=null?a:"image/png"}}function Cs(i){return`
|
|
46
|
+
`,this.modal=n}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let l=o.target.dataset.tab;l&&this.switchTab(l)})});let n=this.modal.querySelector("[data-ai-generate]");n==null||n.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let 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 rr={};cn(rr,{AssetCache:()=>oe,AssetLoader:()=>Pe,AssetSystem:()=>si,AssetTextures:()=>Ie,Assets:()=>_a,BaseSystem:()=>st,GameEngine:()=>ai,GameObject:()=>It,GameObjectManager:()=>nt,ObjectFactory:()=>be,Renderer:()=>Pt,RuntimeObjectRegistry:()=>rt,Transform:()=>kt,applyScreenAnchor:()=>Gt,basePixi:()=>Pa,clearResponsiveElements:()=>sa,createPixiBase:()=>ii,getRegisteredFontIds:()=>Aa,globalResponsiveMultipliers:()=>Ke,initAssetTextures:()=>Nt,initAssets:()=>Oa,layout:()=>oa,playLottieOverlay:()=>Ta,registerFont:()=>Ca,registerType:()=>Dt,resolveAnchorVec2:()=>Me,resolveFont:()=>Sa,resolveFontWeight:()=>Ea,resolveScreenAnchorPoint:()=>Ne,resolveScreenRatioPoint:()=>Fe,runInitSequence:()=>Ra,setLottieInstance:()=>Xt,spawnSceneFromConfig:()=>Ma,updateScreenState:()=>Bt});module.exports=Ba(rr);var xa=require("pixi.js");var Te={};function _t(i,e,t=!1){Te[i]||(Te[i]=[]),Te[i].push({fn:e,once:t})}function ci(i,e){if(Te[i]){if(!e){delete Te[i];return}Te[i]=Te[i].filter(t=>t.fn!==e)}}function Ot(i,...e){let t=Te[i];if(t)for(let n of[...t])n.fn(...e),n.once&&ci(i,n.fn)}function Z(i,e){_t(i,e,!0)}var D=null,te=[],qe=null;function gn(i){D=i,te=[],qe!==null&&(clearTimeout(qe),qe=null)}function hn(){var i,e,t;return{endpoint:(D==null?void 0:D.endpoint)||"",transport:(D==null?void 0:D.transport)||"beacon",batchSize:(i=D==null?void 0:D.batchSize)!=null?i: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 pn(i,e,t,n){let a=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(i,new Blob([a],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",e)}catch(s){n&&console.warn("[handler.telemetry] fetch failed",s)}}function di(i,e){let t=hn();if(e&&t.endpoint){if(te.push(i),te.length>t.maxQueue&&(te=te.slice(te.length-t.maxQueue)),te.length>=t.batchSize){un();return}qe===null&&(qe=window.setTimeout(()=>{qe=null,un()},t.flushIntervalMs))}}async function un(){let i=hn();if(!i.endpoint||te.length===0)return;let e=te.splice(0,i.batchSize);await pn(i.endpoint,{events:e},i.transport,i.debug),te.length>0&&await pn(i.endpoint,{events:te.splice(0,i.batchSize)},i.transport,i.debug)}function fn(i){return Math.max(0,Math.min(1,i))}function Ga(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 bt(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ua(i,e){let t=i==null?void 0:i[e];return typeof t=="number"?t:0}function mn(i,e,t){try{i[e]=t}catch{}}function qa(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 bn(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 yn(i,e){let t=qa(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 vn(){let i=new Set,e=new WeakMap,t=null,n=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),i.size>0&&n()})},a=u=>{var p;i.add(u);let d=(p=e.get(u.target))!=null?p:new Set;d.add(u),e.set(u.target,d),n()},s=u=>{i.delete(u);let d=e.get(u.target);d&&(d.delete(u),d.size===0&&e.delete(u.target))},r=u=>{u.killed||(u.killed=!0,s(u))},o=()=>{var d,p;let u=bt();for(let g of Array.from(i)){if(g.killed||g.paused)continue;let m=u-g.startMs-g.delayMs;if(m<0)continue;let f=g.durationMs>0?m/g.durationMs:1,C=fn(f),b=g.repeat>=0?g.repeat+1:1,h=g.repeat>0?Math.min(Math.floor(f),b-1):0;if(g.repeat>0&&f>=1){let y=f-h;C=fn(y)}let v=g.ease(C);g.yoyo&&h%2===1&&(v=1-v);for(let y of g.props)mn(g.target,y.key,y.from+(y.to-y.from)*v);g.scaleFrom&&g.scaleTo&&bn(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){r(g);try{(p=g.onComplete)==null||p.call(g)}catch{}}}},c=(u,d,p)=>{var y;let g=Math.max(0,(typeof d.duration=="number"?d.duration:.5)*1e3),m=Math.max(0,(typeof d.delay=="number"?d.delay:0)*1e3+((y=p==null?void 0:p.delayMsOverride)!=null?y:0)),f=Ga(d.ease),C=typeof d.repeat=="number"?Math.max(0,d.repeat|0):0,b=d.yoyo===!0,h=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),v=[];for(let I of Object.keys(d)){if(h.has(I))continue;let _=d[I];typeof _=="number"&&v.push({key:I,from:Ua(u,I),to:_})}let w=yn(u,d);return{target:u,startMs:bt(),delayMs:m,durationMs:g,ease:f,props:v,scaleFrom:w.from,scaleTo:w.to,repeat:C,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}},l={to(u,d){let p=c(u,d);return a(p),{kill:()=>r(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=bt())},resume:()=>{var f;if(!p.paused)return;let g=(f=p.pauseAtMs)!=null?f:bt(),m=bt()-g;p.startMs+=m,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(u,d,p){return l.set(u,d),l.to(u,p)},set(u,d){if(!u||!d)return;for(let g of Object.keys(d)){let m=d[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof m=="number"&&mn(u,g,m)}let p=yn(u,d);p.to&&bn(u,p.to)},killTweensOf(u){let d=e.get(u);if(d)for(let p of Array.from(d))r(p)},timeline(u={}){let d=[],p=0,g=!1,m=[],f=h=>{if(typeof h=="number")return Math.max(0,h*1e3);let v=typeof h=="string"?h.trim():"";return v.startsWith("+=")?p+Math.max(0,Number(v.slice(2))*1e3||0):v?Math.max(0,Number(v)*1e3||0):p},C=h=>{d.push(h);let v=Math.max(0,(typeof h.vars.duration=="number"?h.vars.duration:.5)*1e3);p=Math.max(p,h.atMs+v)},b={to(h,v,w){return C({kind:"to",target:h,vars:v,atMs:f(w)}),b},fromTo(h,v,w,y){return C({kind:"fromTo",target:h,vars:w,from:v,atMs:f(y)}),b},play(){var h,v;if(g)return b;g=!0,m=[];for(let w of d)w.kind==="fromTo"&&l.set(w.target,(h=w.from)!=null?h:{}),m.push(l.to(w.target,{...w.vars,delay:w.atMs/1e3+((v=w.vars.delay)!=null?v:0)}));return b},pause(){for(let h of m)h.pause();return b},kill(){for(let h of m)h.kill();m=[],g=!1}};return u.paused||b.play(),b}};return l}function wn(){if(typeof window=="undefined")return;let i=window;if(!i.gsap)try{i.gsap=vn()}catch{}}var xn={name:"handler-playable-sdk",version:"1.0.14",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 --external jszip && 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/ && mkdir -p dist/cli/student-helper && cp src/cli/student-helper/*.mjs dist/cli/student-helper/ && chmod +x dist/cli/*.mjs dist/cli/student-helper/*.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 --external jszip && 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 dist/cli/student-helper/*.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 Q=0,Wa=Q++,Sn=Q++,En=Q++,Cn=Q++,An=Q++,Ln=Q++,Tn=Q++,kn=Q++,Pn=Q++,In=Q++,Mn=Q++,jn=Q++,O=Wa;function _n(){return O===Sn}function On(){return O===En}function Rn(){return O===Cn}function zn(){return O===An}function Ve(){return O===Ln}function We(){return O===Tn}function $n(){return O===kn}function Dn(){return O===Pn}function Hn(){return O===In}function pi(){return O===Mn}function ui(){return O===jn}function Nn(){let i=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(i==="mraid")try{mraid.getState(),O=Sn;return}catch{}else if(i==="dapi")try{dapi.isReady(),O=En;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(O=Cn)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(O=An)}catch{}else if(e==="mintegral")window.gameReady&&(O=Ln);else if(e==="tapjoy")window.TJ_API&&(O=Tn);else if(e==="tiktok")window.openAppStore&&(O=kn);else if(e==="smadex")try{window.smxTracking&&(O=Pn)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(O=In)}catch{}else e==="vungle"?O=Mn:(i==="nucleo"||e==="nucleo")&&(O=jn)}var Rt=li(require("lottie-web"),1),Fn=Rt.default;typeof window!="undefined"&&(window.lottie=Rt.default,window.__baseLottie=Rt.default);fi();function H(i,e){let t=(a,s)=>s===0?a:t(s,a%s),n=t(i,e);return`${i/n}:${e/n}`}var Hr=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:H(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:H(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:H(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:H(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:H(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:H(360,780)}],Nr=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:H(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:H(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:H(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:H(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:H(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:H(412,915)}],Fr=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:H(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:H(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:H(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:H(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:H(800,1280)}],qn=[{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:H(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:H(768,1024),mraidScale:.7}];var Br=[...qn];var ts=qn[0];re();function is(i){return new Promise((e,t)=>{let n=new FileReader;n.onerror=()=>t(new Error("FileReader failed")),n.onload=()=>e(String(n.result||"")),n.readAsDataURL(i)})}function ns(i){var a;let[e,t]=i.split(","),n=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=n==null?void 0:n[1])!=null?a:"image/png"}}async function as(i){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=i})}async function mi(i){var e,t;try{console.log("[ImageUtils] Fetching image data from URL:",i);let n=await fetch(i);if(!n.ok)return console.warn("[ImageUtils] Fetch failed with status:",n.status,i),null;let a=await n.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await is(a),r=await as(s),o=ns(s);return console.log("[ImageUtils] Success resolution:",r==null?void 0:r.width,"x",r==null?void 0:r.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:s,width:(e=r==null?void 0:r.width)!=null?e:0,height:(t=r==null?void 0:r.height)!=null?t:0}}catch(n){return console.error("[ImageUtils] Error fetching image data:",n),null}}async function zt(i,e=30){try{console.log("[ImageUtils] Removing background color...");let t=await new Promise((d,p)=>{let g=new Image;g.onload=()=>d(g),g.onerror=()=>p(new Error("Failed to load image")),g.src=i}),n=document.createElement("canvas");n.width=t.width,n.height=t.height;let a=n.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),i;a.drawImage(t,0,0);let s=a.getImageData(0,0,n.width,n.height),r=s.data,c=[{name:"top-left",offset:0},{name:"top-right",offset:(n.width-1)*4},{name:"bottom-left",offset:(n.height-1)*n.width*4},{name:"bottom-right",offset:((n.height-1)*n.width+(n.width-1))*4}].map(d=>({r:r[d.offset],g:r[d.offset+1],b:r[d.offset+2]})),l=0;for(let d=0;d<r.length;d+=4){let p=r[d],g=r[d+1],m=r[d+2],f=!1;for(let C of c)if(Math.sqrt(Math.pow(p-C.r,2)+Math.pow(g-C.g,2)+Math.pow(m-C.b,2))<e){f=!0;break}f&&(r[d+3]=0,l++)}return console.log(`[ImageUtils] Removed background from ${l} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),n.toDataURL("image/png")}catch(t){return console.error("[ImageUtils] Error removing background:",t),i}}var Yn=require("@google/genai");async function bi(i,e,t=[],n={}){var a,s,r,o,c,l,u;try{if(!(i!=null&&i.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 h=t[b];if(!h.base64||!h.mimeType)throw new Error(`Image ${b+1} is missing required data`);if(h.base64.length<1e3&&console.warn(`Image ${b+1} data appears very small, may be corrupted`),!h.mimeType.startsWith("image/"))throw new Error(`Image ${b+1} has invalid MIME type: ${h.mimeType}`)}let d=new Yn.GoogleGenAI({apiKey:i}),p="gemini-2.5-flash",g=[e];t.length>0&&t.forEach((b,h)=>{g.push({inlineData:{data:b.base64,mimeType:b.mimeType}}),console.log(`[Gemini] Added image ${h+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 d.models.generateContent({model:p,contents:g}),f="",C=(r=(s=(a=m.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(C)for(let b of C)b.text&&(f+=b.text);if(!f.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${f.length}`),f}catch(d){throw console.error("[Gemini] API error:",d),(o=d.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."):(c=d.message)!=null&&c.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(l=d.message)!=null&&l.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(u=d.message)!=null&&u.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):d}}var Kn=require("@google/genai");async function $t(i,e,t=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Kn.GoogleGenAI({apiKey:i}),s=[{text:e}];t.length>0&&t.forEach((o,c)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${c}`),s.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let r=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:s});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!r.candidates||!r.candidates[0]||!r.candidates[0].content||!r.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of r.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let c=o.inlineData.data,l=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${l};base64,${c}`}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 ds=require("pixi.js");yt();re();var ta=require("pixi.js");var us=require("pixi.js");re();function Ss(i){return new Promise((e,t)=>{let n=new FileReader;n.onerror=()=>t(new Error("FileReader failed")),n.onload=()=>e(String(n.result||"")),n.readAsDataURL(i)})}function Es(i){var a;let[e,t]=i.split(","),n=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=n==null?void 0:n[1])!=null?a:"image/png"}}function Cs(i){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(_0x57f37b,_0x52273a){var a0_0x4ae6ea={_0x39e14b:0x223,_0x447257:'9klb',_0x181ca7:0x20b,_0xd7a4d1:'tU]M',_0x479817:0x203,_0x339933:0x200,_0x3f2f31:0x1f8,_0x1b622b:0x202,_0x1a824a:'0aQi',_0x3f5502:0x1fc,_0x283735:0x3f,_0x4b952b:0x38,_0x254b6d:0x47e,_0x2723ee:0x46c,_0x25ac39:0x461,_0x3815f8:0x1fa,_0x2593ba:0x1fd,_0xc3b1e2:'4cfT',_0x53a388:0x1ef,_0x5be745:0x1fe,_0x483a66:0x2e,_0x56ce3e:'I!jU',_0x17f350:0x32,_0x3fd9e1:0x26,_0x349606:0x472,_0x366f2c:'0aQi',_0x4a7941:0x475,_0x29cd86:0x26,_0x5d79f0:0x3d,_0x52c106:'!mnN',_0x31cc1f:0x29,_0x4f3792:0x45,_0x1cad6c:0x38,_0x19c215:'zvxp',_0x54fa1d:0x3e,_0x4a98bf:'b3]D',_0x336399:0x38,_0x51b1e1:0x47f,_0x1eb552:0x461},a0_0x3ee4c1={_0x25b163:0x1b5};function _0xd3dd73(_0xc46395,_0x2381d8,_0x46f730,_0xaa8e7c,_0x4352dd){return a0_0x36d1(_0xc46395-0x80,_0x46f730);}function _0x5f18ba(_0x49baee,_0x40a58f,_0x3b5e16,_0x48f36d,_0x2fa226){return a0_0x36d1(_0x48f36d- -a0_0x3ee4c1._0x25b163,_0x3b5e16);}function _0x3e6cb9(_0x55f6f1,_0x4aed28,_0x542835,_0x2d4c52,_0x3471b4){return a0_0x36d1(_0x3471b4-0x2dc,_0x542835);}var _0x54d44f=_0x57f37b();while(!![]){try{var _0x535bd2=-parseInt(_0xd3dd73(0x216,a0_0x4ae6ea._0x39e14b,a0_0x4ae6ea._0x447257,0x21d,0x20a))/(0xc9d+-0x4ee*0x1+-0x3d7*0x2)*(parseInt(_0xd3dd73(0x1fc,a0_0x4ae6ea._0x181ca7,a0_0x4ae6ea._0xd7a4d1,a0_0x4ae6ea._0x479817,a0_0x4ae6ea._0x339933))/(0xd23+0x20e2+-0x2e03))+-parseInt(_0xd3dd73(a0_0x4ae6ea._0x3f2f31,a0_0x4ae6ea._0x1b622b,a0_0x4ae6ea._0x1a824a,a0_0x4ae6ea._0x339933,a0_0x4ae6ea._0x3f5502))/(-0x3d5+-0x11*0x115+0x163d)*(parseInt(_0x5f18ba(-a0_0x4ae6ea._0x283735,-0x35,'[^[n',-a0_0x4ae6ea._0x4b952b,-0x47))/(-0xbc1+0x2143+-0x189*0xe))+parseInt(_0x3e6cb9(a0_0x4ae6ea._0x254b6d,a0_0x4ae6ea._0x2723ee,'tU]M',a0_0x4ae6ea._0x25ac39,0x46d))/(0x1777+0xac0+-0x5b3*0x6)+parseInt(_0xd3dd73(a0_0x4ae6ea._0x3815f8,a0_0x4ae6ea._0x2593ba,a0_0x4ae6ea._0xc3b1e2,a0_0x4ae6ea._0x53a388,a0_0x4ae6ea._0x5be745))/(0x151*0x9+-0x1418+0x845)*(parseInt(_0x5f18ba(-0x2b,-a0_0x4ae6ea._0x483a66,a0_0x4ae6ea._0x56ce3e,-a0_0x4ae6ea._0x17f350,-a0_0x4ae6ea._0x3fd9e1))/(0x2410+-0x740+0x1cc9*-0x1))+-parseInt(_0x3e6cb9(0x461,a0_0x4ae6ea._0x349606,a0_0x4ae6ea._0x366f2c,a0_0x4ae6ea._0x4a7941,0x467))/(0x1*-0x1311+-0x1144+0x245d)*(-parseInt(_0x5f18ba(-a0_0x4ae6ea._0x29cd86,-a0_0x4ae6ea._0x5d79f0,a0_0x4ae6ea._0x52c106,-0x30,-a0_0x4ae6ea._0x31cc1f))/(-0x190f+0x8*0x14b+0xec0))+-parseInt(_0x5f18ba(-a0_0x4ae6ea._0x4f3792,-a0_0x4ae6ea._0x1cad6c,a0_0x4ae6ea._0x19c215,-a0_0x4ae6ea._0x54fa1d,-0x40))/(0x159f+-0x4+-0x1591)+-parseInt(_0x5f18ba(-0x2a,-a0_0x4ae6ea._0x17f350,a0_0x4ae6ea._0x4a98bf,-0x37,-a0_0x4ae6ea._0x336399))/(-0x1*-0x1be7+-0x17f4+-0x8*0x7d)*(parseInt(_0x3e6cb9(a0_0x4ae6ea._0x51b1e1,a0_0x4ae6ea._0x1eb552,'6zQ&',0x462,0x471))/(0x1848+-0xb*0x28f+0x7*0x8f));if(_0x535bd2===_0x52273a)break;else _0x54d44f['push'](_0x54d44f['shift']());}catch(_0x41177b){_0x54d44f['push'](_0x54d44f['shift']());}}}(a0_0x479c,-0x54689+0x8b*-0x1ff1+0x1fe61a));function a0_0x36d1(_0x58ee3c,_0x17ac82){_0x58ee3c=_0x58ee3c-(0x1639*0x1+0x47f*-0x7+0xd3*0xd);var _0x5e63a4=a0_0x479c();var _0x174b19=_0x5e63a4[_0x58ee3c];if(a0_0x36d1['mwRcIi']===undefined){var _0x3fb934=function(_0x2b030c){var _0x193c62='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x5bba06='',_0x48a82f='',_0x1b0fa4=_0x5bba06+_0x3fb934;for(var _0x2fa7d8=-0x15b3+-0x1397+-0xe*-0x2f3,_0x2157b4,_0x5848a8,_0x10e1d7=-0x3*-0x943+-0x1*-0x1c1f+0xdfa*-0x4;_0x5848a8=_0x2b030c['charAt'](_0x10e1d7++);~_0x5848a8&&(_0x2157b4=_0x2fa7d8%(-0x4e7+0x111d+-0x2*0x619)?_0x2157b4*(-0x1273+-0x15c3*-0x1+0x70*-0x7)+_0x5848a8:_0x5848a8,_0x2fa7d8++%(0x2129+-0xc6*0xe+-0x1651))?_0x5bba06+=_0x1b0fa4['charCodeAt'](_0x10e1d7+(-0x6aa+0x107*0x4+0x298))-(-0x13*0x112+0xcb6+0x6d*0x12)!==0x10ef+-0xb*-0xa+-0x115d?String['fromCharCode'](0x6c6+-0x14f*-0xa+-0x12dd&_0x2157b4>>(-(0x1640+0x3e2+-0x1a20)*_0x2fa7d8&-0x4cd*-0x1+-0x1885+0x13be)):_0x2fa7d8:-0xced+0x338*0x3+0x345){_0x5848a8=_0x193c62['indexOf'](_0x5848a8);}for(var _0x1fe2fc=0x230b+0x15c5+-0x38d0,_0x4ede11=_0x5bba06['length'];_0x1fe2fc<_0x4ede11;_0x1fe2fc++){_0x48a82f+='%'+('00'+_0x5bba06['charCodeAt'](_0x1fe2fc)['toString'](0x2260+-0x1f0e+0x1*-0x342))['slice'](-(-0x449+-0xa7*0x3+0x640));}return decodeURIComponent(_0x48a82f);};var _0x17cc88=function(_0xf2bfc9,_0x4c53be){var _0x3cced4=[],_0x6a03bb=0x18e*-0x12+-0x107f+-0x2c7b*-0x1,_0x8936b6,_0x4f96c6='';_0xf2bfc9=_0x3fb934(_0xf2bfc9);var _0x1225ab;for(_0x1225ab=0xcd2*0x1+0xaf8*0x1+-0x17ca;_0x1225ab<0xfb+0x38*0x15+-0x1*0x493;_0x1225ab++){_0x3cced4[_0x1225ab]=_0x1225ab;}for(_0x1225ab=-0x1*-0x1b64+-0x14ba+-0x355*0x2;_0x1225ab<0x270*-0x1+0x1ec8*-0x1+0x6*0x5b4;_0x1225ab++){_0x6a03bb=(_0x6a03bb+_0x3cced4[_0x1225ab]+_0x4c53be['charCodeAt'](_0x1225ab%_0x4c53be['length']))%(-0x2*-0xdd6+0x24*-0x68+-0xc0c),_0x8936b6=_0x3cced4[_0x1225ab],_0x3cced4[_0x1225ab]=_0x3cced4[_0x6a03bb],_0x3cced4[_0x6a03bb]=_0x8936b6;}_0x1225ab=-0x2b*0x1f+-0x10c8+0x15fd*0x1,_0x6a03bb=-0x220a*-0x1+-0x2fc*0x5+-0x131e;for(var _0x3e2622=-0x52*-0x76+0x1428+-0x4*0xe7d;_0x3e2622<_0xf2bfc9['length'];_0x3e2622++){_0x1225ab=(_0x1225ab+(0x1490+-0xd91+0x2*-0x37f))%(0x1aac+0x4*0x4eb+-0x2d58),_0x6a03bb=(_0x6a03bb+_0x3cced4[_0x1225ab])%(-0x1*-0x2562+-0x1118+0x9a5*-0x2),_0x8936b6=_0x3cced4[_0x1225ab],_0x3cced4[_0x1225ab]=_0x3cced4[_0x6a03bb],_0x3cced4[_0x6a03bb]=_0x8936b6,_0x4f96c6+=String['fromCharCode'](_0xf2bfc9['charCodeAt'](_0x3e2622)^_0x3cced4[(_0x3cced4[_0x1225ab]+_0x3cced4[_0x6a03bb])%(0x157d+-0x223*-0x5+-0x17c*0x15)]);}return _0x4f96c6;};a0_0x36d1['BCCEjb']=_0x17cc88,a0_0x36d1['pbDbpp']={},a0_0x36d1['mwRcIi']=!![];}var _0x57d263=_0x5e63a4[0x1*0x4e1+0x2*0xe6f+0xa3*-0x35],_0xf22109=_0x58ee3c+_0x57d263,_0x2d9828=a0_0x36d1['pbDbpp'][_0xf22109];if(!_0x2d9828){if(a0_0x36d1['faazBf']===undefined){var _0x1729d8=function(_0x4f7054){this['kSvOiX']=_0x4f7054,this['oxgSbU']=[-0x1179+0x1ff5+-0xe7b,0x812+-0x13e4+0xbd2,-0xe8+0x887+-0x79f*0x1],this['xdgyVC']=function(){return'newState';},this['tRwPlW']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['oWfMap']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x1729d8['prototype']['wQozhh']=function(){var _0x4a63c4=new RegExp(this['tRwPlW']+this['oWfMap']),_0x6fac=_0x4a63c4['test'](this['xdgyVC']['toString']())?--this['oxgSbU'][0x7*-0xc5+0x137*0x1f+0x2045*-0x1]:--this['oxgSbU'][-0x221d+0x11b8+0x1065];return this['bXEdZL'](_0x6fac);},_0x1729d8['prototype']['bXEdZL']=function(_0xd0ddab){if(!Boolean(~_0xd0ddab))return _0xd0ddab;return this['qPkeiA'](this['kSvOiX']);},_0x1729d8['prototype']['qPkeiA']=function(_0x5bb3ef){for(var _0x26d6f0=-0x268c+0x2390+0x2fc,_0x28b59e=this['oxgSbU']['length'];_0x26d6f0<_0x28b59e;_0x26d6f0++){this['oxgSbU']['push'](Math['round'](Math['random']())),_0x28b59e=this['oxgSbU']['length'];}return _0x5bb3ef(this['oxgSbU'][-0x18d*-0x15+-0x5*0x77+-0x1e3e]);},new _0x1729d8(a0_0x36d1)['wQozhh'](),a0_0x36d1['faazBf']=!![];}_0x174b19=a0_0x36d1['BCCEjb'](_0x174b19,_0x17ac82),a0_0x36d1['pbDbpp'][_0xf22109]=_0x174b19;}else _0x174b19=_0x2d9828;return _0x174b19;}var a0_0x4b4e00=(function(){var _0x2fc652=!![];return function(_0x2c923a,_0x4a1e81){var a0_0x351757={_0x6feb0f:0x2e4,_0x430ec0:0x2ee,_0x43b034:0x2e9,_0x5176b7:'q1bj',_0x1d7271:0x2e0},a0_0x4a4786={_0x4af801:0x167},_0x42f8d2=_0x2fc652?function(){function _0xc89c9b(_0x3bcf99,_0x1554f0,_0x40b217,_0x4c001c,_0xe374d2){return a0_0x36d1(_0x40b217-a0_0x4a4786._0x4af801,_0x4c001c);}if(_0x4a1e81){var _0x2d533f=_0x4a1e81[_0xc89c9b(a0_0x351757._0x6feb0f,a0_0x351757._0x430ec0,a0_0x351757._0x43b034,a0_0x351757._0x5176b7,a0_0x351757._0x1d7271)](_0x2c923a,arguments);return _0x4a1e81=null,_0x2d533f;}}:function(){};return _0x2fc652=![],_0x42f8d2;};}()),a0_0x50f89a=a0_0x4b4e00(this,function(){var a0_0x1c93b5={_0x12969d:0x92,_0x3063ac:0x80,_0x146054:0x8d,_0x47f449:'Wwmq',_0x3af45c:0x22d,_0x3ff2ce:0x220,_0x206d8a:0x22c,_0x30592f:'()Nb',_0x3a7404:0xb,_0x5be489:0x6,_0x16b629:0xb,_0x247376:0x1b,_0x846ad8:'Rfkd',_0x406c63:0x21b,_0x1584f9:0x20f,_0x4f5124:0x21e,_0x165b77:0x21f,_0x25a810:0x215,_0x35bbc4:0x1f9,_0x194b75:0x207,_0x41ba1c:0x3,_0x8ee6c9:0x2,_0x35d04c:0x4,_0x41e4e4:0x99,_0x4e320c:0x83,_0xfaf46a:'0aQi',_0x4ae5f7:0xa3,_0x4d725e:0xa5,_0x4532e1:0x97,_0x544796:0xa1,_0x418099:'b3]D',_0x2afd9a:'9klb',_0x3da16a:0x1,_0x4f8d23:0x9,_0x236061:0x8,_0x1880a0:'RIim',_0x49f2d7:0x210,_0x5dbe40:0x224,_0x19b9b6:0x3,_0x4d4b58:0x2,_0x304691:0xa,_0x58ad60:0xf},a0_0x18eecc={_0x3d1e20:0x198},a0_0x378473={_0x31f60b:0x225},a0_0x4ba73a={_0xe2aa26:0x8e};function _0x3a8fd2(_0x2a1421,_0x2820e8,_0x58f70c,_0x272698,_0x1ad972){return a0_0x36d1(_0x272698-a0_0x4ba73a._0xe2aa26,_0x2a1421);}function _0x1223a6(_0x41d59e,_0x2149af,_0x2e288a,_0x41a351,_0x4c9839){return a0_0x36d1(_0x41a351- -a0_0x378473._0x31f60b,_0x4c9839);}var _0x2954d2={};_0x2954d2[_0x1223a6(-0x8a,-a0_0x1c93b5._0x12969d,-a0_0x1c93b5._0x3063ac,-a0_0x1c93b5._0x146054,a0_0x1c93b5._0x47f449)]=_0x3a8fd2('b3]D',a0_0x1c93b5._0x3af45c,0x21c,a0_0x1c93b5._0x3ff2ce,a0_0x1c93b5._0x206d8a)+_0x7f72a4(a0_0x1c93b5._0x30592f,-a0_0x1c93b5._0x3a7404,-a0_0x1c93b5._0x5be489,-a0_0x1c93b5._0x16b629,-a0_0x1c93b5._0x247376)+'+$';var _0x1b34e2=_0x2954d2;function _0x7f72a4(_0x29cc18,_0x161f96,_0x3857c4,_0x5df818,_0x1305ad){return a0_0x36d1(_0x5df818- -a0_0x18eecc._0x3d1e20,_0x29cc18);}return a0_0x50f89a['toStr'+_0x3a8fd2(a0_0x1c93b5._0x846ad8,a0_0x1c93b5._0x406c63,a0_0x1c93b5._0x1584f9,a0_0x1c93b5._0x4f5124,a0_0x1c93b5._0x165b77)]()[_0x3a8fd2('tU]M',a0_0x1c93b5._0x25a810,a0_0x1c93b5._0x35bbc4,a0_0x1c93b5._0x194b75,0x202)+'h'](_0x1b34e2[_0x7f72a4('W$9U',-a0_0x1c93b5._0x41ba1c,-a0_0x1c93b5._0x8ee6c9,-a0_0x1c93b5._0x35d04c,-a0_0x1c93b5._0x41ba1c)])[_0x1223a6(-a0_0x1c93b5._0x41e4e4,-0x8e,-a0_0x1c93b5._0x4e320c,-0x8e,a0_0x1c93b5._0xfaf46a)+'ing']()[_0x1223a6(-a0_0x1c93b5._0x4ae5f7,-a0_0x1c93b5._0x4d725e,-a0_0x1c93b5._0x4532e1,-a0_0x1c93b5._0x544796,a0_0x1c93b5._0x418099)+_0x7f72a4(a0_0x1c93b5._0x2afd9a,-0x4,-a0_0x1c93b5._0x3da16a,-a0_0x1c93b5._0x4f8d23,-a0_0x1c93b5._0x236061)+'r'](a0_0x50f89a)[_0x3a8fd2(a0_0x1c93b5._0x1880a0,0x21f,a0_0x1c93b5._0x49f2d7,0x214,a0_0x1c93b5._0x5dbe40)+'h'](_0x1b34e2[_0x7f72a4('c%HC',a0_0x1c93b5._0x19b9b6,a0_0x1c93b5._0x4d4b58,-a0_0x1c93b5._0x304691,-a0_0x1c93b5._0x58ad60)]);});a0_0x50f89a();import{A as a0_0x1aac36,B as a0_0x523fb7,C as a0_0xb362ca,D as a0_0x3f559c,b as a0_0x3d12fb,c as a0_0x3880e7,d as a0_0x5ed32d,e as a0_0x5262a4,f as a0_0x5f1089,g as a0_0x37f916,h as a0_0x30e272,i as a0_0x354b5c,j as a0_0xbe0f69,k as a0_0x356402,l as a0_0x4bdc79,m as a0_0x4bd147,n as a0_0x182455,o as a0_0x511ea5,p as a0_0x1663ce,q as a0_0x5c3763,r as a0_0x2bccbe,s as a0_0x2a8783,t as a0_0x5796b8,u as a0_0x16bc8a,v as a0_0x2cb6ae,w as a0_0xa1e948,x as a0_0x3affc6,y as a0_0x5e20a6,z as a0_0x5c417a}from'../chunk-NNKOLF5Z.js';import{a as a0_0x5d5e29,b as a0_0x53d2d2,c as a0_0x3851bd,d as a0_0x5176e6,e as a0_0x1dd635}from'../chunk-I5OOVR5U.js';import'../chunk-PW2FGMCO.js';function a0_0x479c(){var _0x54213e=['W4DMW6jRDW','WOxdH8kpgSkkWPaWW7LsWPxcQa','W6lcU8oCnWW','tJpdUGHQwgHmxsq','WPb7p0fCWQPfFXvaoSkxsW','ntXmW4JdIsZcUuddLmkq','pmo7lSkfemkjWOFcVmk8F8ku','E8kDW7VcKq8kW7W0W68q','BIzMEcxdRmkaotBdSxhdSW','wmoDfCo8W6i','WQVcVSk8zSoc','ESk3DmoftG','WRmNiG','rmkuuxZdGdC6iCkLW7yGrfy','WOWHWQq2ka','W5LTmCoXuxGvo8o/WOO','WO1lg8kkpW','WONdVrzvWQdcJCkhW5f2gW','pmoZjmkdfmo4WQJcUSkqxmkiFW','pSohWPRdNre','EMy5WPBdNW','WQiLEaFdSmkKA3X/W7pcILHE','FCkBW7ZcMvnzW58DW4yFWR3dIa','bSodad/cKa','qmorW5RdSSoQWOShW7pcLri','WOqaB8oWg07cKu0nttJcSa','qCo0lZZcOevM','WQvfA8k4WPJdIGO','WPy9WRWHzSkZWQhcOuzh','chnKCsyEoW','WPv/o0zDWQjaEc5rnSkXsW','BmoVrCkRWPn9WQa','i8owW6VcG8kO','bq7cNWldU8o9s8oGASok'];a0_0x479c=function(){return _0x54213e;};return a0_0x479c();}import'../chunk-HVKF2KYL.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x5d5e29 as AssetCache,a0_0x3851bd as AssetLoader,a0_0x16bc8a as AssetSystem,a0_0x5176e6 as AssetTextures,a0_0x2a8783 as Assets,a0_0x511ea5 as BaseSystem,a0_0x182455 as GameEngine,a0_0x5262a4 as GameObject,a0_0x5f1089 as GameObjectManager,a0_0x4bd147 as ObjectFactory,a0_0x5ed32d as Renderer,a0_0x1663ce as RuntimeObjectRegistry,a0_0x3880e7 as Transform,a0_0x523fb7 as applyScreenAnchor,a0_0x5c3763 as basePixi,a0_0xa1e948 as clearResponsiveElements,a0_0x3d12fb as createPixiBase,a0_0xbe0f69 as getRegisteredFontIds,a0_0x2cb6ae as globalResponsiveMultipliers,a0_0x1dd635 as initAssetTextures,a0_0x5796b8 as initAssets,a0_0xb362ca as layout,a0_0x4bdc79 as playLottieOverlay,a0_0x354b5c as registerFont,a0_0x53d2d2 as registerType,a0_0x5e20a6 as resolveAnchorVec2,a0_0x37f916 as resolveFont,a0_0x30e272 as resolveFontWeight,a0_0x5c417a as resolveScreenAnchorPoint,a0_0x1aac36 as resolveScreenRatioPoint,a0_0x3f559c as runInitSequence,a0_0x356402 as setLottieInstance,a0_0x2bccbe as spawnSceneFromConfig,a0_0x3affc6 as updateScreenState};
|
|
1
|
+
(function(_0x466799,_0xc25cfb){var a0_0x5f1294={_0x1c5697:0x35a,_0x57486d:0x374,_0x1478f3:0x364,_0x5ef98e:0x19d,_0x1c9264:0x184,_0x158442:'PABD',_0x5cfa77:0x185,_0x84cdd6:0x10c,_0x44a0dc:'u*DD',_0x282ee5:0x10b,_0x4ec5d6:0x105,_0x29633c:0x19d,_0x12266b:0x187,_0x3ade7b:0x19e,_0x52fa29:0x191,_0x289a15:0x17d,_0x1c8bfb:0x196,_0x5d57fe:0x186,_0x46e094:0x366,_0x14f51f:0x360,_0x492095:0x36e,_0x182d24:'l@kv',_0xd4d7e5:'B4d)',_0x53f4fb:0x108,_0x3579f4:0x183,_0x2e96f9:0x187,_0x352eba:'bzB2',_0xcf62c:0x19f,_0x1f5174:0x18f,_0x30b396:0x11f,_0x1a4fd2:'zqM)',_0x517ad1:0x115,_0x5a54b:0x112,_0x3f2ec9:0x11d,_0x57123d:0x107,_0x10a53a:0x101,_0x5d4e56:'8Ltp',_0x2ab1e7:0xf8,_0x49a790:0x105,_0x26cd21:0x117,_0x1f3bcc:'5#@n',_0x17afd1:0x116,_0x41cc6f:0x10f,_0x5afacf:0x112},a0_0x10a59e={_0x25359a:0x392},a0_0x21ae14={_0x321320:0x16a},a0_0x4ff672={_0x43d673:0x300};function _0x5af1da(_0x407943,_0x191f49,_0x567159,_0x3e6107,_0x3e0e42){return a0_0x261c(_0x3e6107- -a0_0x4ff672._0x43d673,_0x191f49);}var _0x53f8c0=_0x466799();function _0x5b80ff(_0x42b42f,_0x5291a9,_0x26eb86,_0x1b83e1,_0x8b54b9){return a0_0x261c(_0x26eb86-a0_0x21ae14._0x321320,_0x8b54b9);}function _0x4d153a(_0x10c723,_0x417b6e,_0x3ebe5a,_0xe9ca0f,_0x469c1d){return a0_0x261c(_0x469c1d- -a0_0x10a59e._0x25359a,_0x3ebe5a);}while(!![]){try{var _0x18d511=parseInt(_0x5b80ff(a0_0x5f1294._0x1c5697,a0_0x5f1294._0x57486d,a0_0x5f1294._0x1478f3,0x36d,'5cXf'))/(-0x4*-0x7f1+0x1c84+-0x3c47*0x1)+parseInt(_0x4d153a(-a0_0x5f1294._0x5ef98e,-a0_0x5f1294._0x1c9264,a0_0x5f1294._0x158442,-a0_0x5f1294._0x5cfa77,-0x190))/(0x11a*0x2+0x1c96+-0x1ec8)*(parseInt(_0x5af1da(-a0_0x5f1294._0x84cdd6,a0_0x5f1294._0x44a0dc,-0x106,-a0_0x5f1294._0x282ee5,-a0_0x5f1294._0x4ec5d6))/(-0xf60+0x1d36+0x1*-0xdd3))+parseInt(_0x4d153a(-a0_0x5f1294._0x29633c,-a0_0x5f1294._0x12266b,'Yoh*',-a0_0x5f1294._0x3ade7b,-a0_0x5f1294._0x52fa29))/(0x19b*0x5+0x5*-0x34+0x6ff*-0x1)*(-parseInt(_0x4d153a(-a0_0x5f1294._0x289a15,-a0_0x5f1294._0x1c8bfb,'fB7m',-a0_0x5f1294._0x5d57fe,-0x18b))/(0x1a38+0x23b9*-0x1+0x986))+-parseInt(_0x5b80ff(0x363,a0_0x5f1294._0x46e094,a0_0x5f1294._0x14f51f,a0_0x5f1294._0x492095,a0_0x5f1294._0x182d24))/(0x1a87+0x41*-0x86+-0xb*-0xaf)*(-parseInt(_0x5af1da(-0x118,a0_0x5f1294._0xd4d7e5,-0x116,-a0_0x5f1294._0x53f4fb,-0x101))/(0x28c*-0x1+-0x53*-0x45+-0x13cc))+parseInt(_0x4d153a(-a0_0x5f1294._0x3579f4,-a0_0x5f1294._0x2e96f9,a0_0x5f1294._0x352eba,-a0_0x5f1294._0xcf62c,-a0_0x5f1294._0x1f5174))/(-0x1*-0x1fbb+0x21d6+0x4189*-0x1)+parseInt(_0x5af1da(-a0_0x5f1294._0x30b396,a0_0x5f1294._0x1a4fd2,-a0_0x5f1294._0x517ad1,-a0_0x5f1294._0x5a54b,-a0_0x5f1294._0x3f2ec9))/(0x20f1+0x1b00+-0x18*0x27f)*(-parseInt(_0x5af1da(-a0_0x5f1294._0x57123d,'5cXf',-a0_0x5f1294._0x282ee5,-a0_0x5f1294._0x10a53a,-0x100))/(0x10be+-0x4*-0x7e8+-0x3054))+parseInt(_0x5af1da(-0x105,a0_0x5f1294._0x5d4e56,-a0_0x5f1294._0x2ab1e7,-0xfc,-a0_0x5f1294._0x49a790))/(0xfce+-0x429+-0xb9a)*(-parseInt(_0x5af1da(-a0_0x5f1294._0x26cd21,a0_0x5f1294._0x1f3bcc,-a0_0x5f1294._0x17afd1,-a0_0x5f1294._0x41cc6f,-a0_0x5f1294._0x5afacf))/(-0x1b27+0x24d1+-0x99e));if(_0x18d511===_0xc25cfb)break;else _0x53f8c0['push'](_0x53f8c0['shift']());}catch(_0x4c0e12){_0x53f8c0['push'](_0x53f8c0['shift']());}}}(a0_0x5a91,0x3f*-0x2103+-0x12698*0x1+-0x58*-0x3692));var a0_0x50dd26=(function(){var _0x42491a=!![];return function(_0x14eef0,_0x2e6f47){var _0x30e1e9=_0x42491a?function(){if(_0x2e6f47){var _0x5ac4a1=_0x2e6f47['apply'](_0x14eef0,arguments);return _0x2e6f47=null,_0x5ac4a1;}}:function(){};return _0x42491a=![],_0x30e1e9;};}()),a0_0x3ebaf4=a0_0x50dd26(this,function(){var a0_0x4be78d={_0x220815:'a1go',_0x27d303:0x327,_0x2b456:0x31d,_0x353159:'rFL@',_0x32c78f:0x31d,_0x4bfb54:0x317,_0x8b3b40:0x315,_0x5a2cac:0x443,_0x391057:0x439,_0xed7ebc:'qabf',_0x5d777e:0x431,_0x1dc113:0x436,_0x3cf805:0x267,_0x3b7972:0x25f,_0x12bd94:0x260,_0x4c13b2:'x@TI',_0x5deb80:0x260,_0xff8776:0x260,_0x5afc72:']^cK',_0x84728f:'D(Q(',_0x38032d:0x30d,_0x16fa3d:0x319,_0x12c430:0x309,_0x3f028e:0x251,_0x12dfab:0x243,_0x426b96:0x245,_0x4c6fed:'sDkL',_0x54f207:0x24e,_0x1b8393:0x266,_0x2d9e19:0x259,_0x4fe3d2:0x25d,_0x3b9364:0x25a,_0x1db47b:0x32a,_0x2b7a58:0x32f,_0x4eeb10:0x338,_0x5406bc:0x25c,_0x1abe1e:0x259,_0x1ea431:'znE6',_0x41565f:0x262,_0x1d6423:'^g$y',_0x4bfd0f:0x32b},a0_0x29acca={_0xc39127:0x11f},a0_0x17fda8={_0x530659:0x61},a0_0x5ebd2c={_0x1a63af:0x249},_0x20c2d1={};_0x20c2d1[_0x79131d(a0_0x4be78d._0x220815,a0_0x4be78d._0x27d303,0x32b,a0_0x4be78d._0x2b456,0x327)]=_0x79131d(a0_0x4be78d._0x353159,0x31f,a0_0x4be78d._0x32c78f,a0_0x4be78d._0x4bfb54,a0_0x4be78d._0x8b3b40)+_0x3f0e5c('sDkL',0x435,a0_0x4be78d._0x5a2cac,0x448,a0_0x4be78d._0x391057)+'+$';function _0x3f0e5c(_0x43b84d,_0x2e1b99,_0x8ee50b,_0x4eccf0,_0x26d023){return a0_0x261c(_0x26d023-a0_0x5ebd2c._0x1a63af,_0x43b84d);}var _0x140172=_0x20c2d1;function _0x524c3d(_0x36dde0,_0x24e762,_0x889dfd,_0xd65f3c,_0x111864){return a0_0x261c(_0x36dde0-a0_0x17fda8._0x530659,_0xd65f3c);}function _0x79131d(_0x45ba42,_0x28cf80,_0x67f12b,_0x119b05,_0x705ef6){return a0_0x261c(_0x28cf80-a0_0x29acca._0xc39127,_0x45ba42);}return a0_0x3ebaf4[_0x3f0e5c(a0_0x4be78d._0xed7ebc,a0_0x4be78d._0x5d777e,0x43b,0x437,a0_0x4be78d._0x1dc113)+_0x524c3d(a0_0x4be78d._0x3cf805,a0_0x4be78d._0x3b7972,a0_0x4be78d._0x12bd94,a0_0x4be78d._0x4c13b2,a0_0x4be78d._0x5deb80)]()[_0x524c3d(0x255,a0_0x4be78d._0xff8776,0x251,a0_0x4be78d._0x5afc72,0x25e)+'h'](_0x79131d(a0_0x4be78d._0x84728f,0x311,a0_0x4be78d._0x38032d,a0_0x4be78d._0x16fa3d,a0_0x4be78d._0x12c430)+_0x524c3d(a0_0x4be78d._0x3f028e,a0_0x4be78d._0x12dfab,a0_0x4be78d._0x426b96,a0_0x4be78d._0x4c6fed,a0_0x4be78d._0x54f207)+'+$')[_0x524c3d(a0_0x4be78d._0x1b8393,a0_0x4be78d._0x2d9e19,a0_0x4be78d._0x4fe3d2,'a1go',a0_0x4be78d._0x3b9364)+_0x79131d('Ogc4',a0_0x4be78d._0x1db47b,0x339,a0_0x4be78d._0x2b7a58,a0_0x4be78d._0x4eeb10)]()['const'+_0x524c3d(a0_0x4be78d._0x5406bc,0x25b,a0_0x4be78d._0x1abe1e,a0_0x4be78d._0x1ea431,a0_0x4be78d._0x41565f)+'r'](a0_0x3ebaf4)[_0x79131d(a0_0x4be78d._0x1d6423,0x31b,0x327,a0_0x4be78d._0x4bfd0f,a0_0x4be78d._0x1db47b)+'h'](_0x140172['YzynT']);});a0_0x3ebaf4();import{A as a0_0x45b9dd,B as a0_0x57f483,C as a0_0x5c1a5b,D as a0_0x428434,b as a0_0x35cc82,c as a0_0x48225b,d as a0_0x11d965,e as a0_0x5c9a29,f as a0_0x443e10,g as a0_0x106b52,h as a0_0x191780,i as a0_0x191098,j as a0_0xc076a9,k as a0_0x2f1c7d,l as a0_0x515b66,m as a0_0x55f993,n as a0_0x5c7633,o as a0_0x187f64,p as a0_0x4584d0,q as a0_0x42e03d,r as a0_0x16d1e5,s as a0_0x77f76a,t as a0_0xef79ec,u as a0_0x21976d,v as a0_0xc1f2a0,w as a0_0x4952a3,x as a0_0xe8b199,y as a0_0x4af5e5,z as a0_0x44f0cc}from'../chunk-NUN3J3M4.js';import{a as a0_0x44b6be,b as a0_0x59e7bd,c as a0_0x31fc47,d as a0_0x4c81e6,e as a0_0x2f44f2}from'../chunk-I5OOVR5U.js';function a0_0x5a91(){var _0x205618=['W5hcHvhcLY4','A8okySk7ba','eCoSamkWWPVcM8opWPvjW7JdSZaf','vmkzW71zFwSJySouWRO','g07dJtPwW57cO0rVamkmW7tcJq','lLmqWQlcKG','kCkfECkcWPldVX/cKc/dRW','WOtcLSopyLCjWQHHW7nDW5m','W4FcRMzZWQxcLGtcRb59vKRdRW','W7lcQdD8WPCIW5VcJSkDWRC3Fq','kCoMESkyqW','rNxcNG','W7aAW71PWRpdTdSFWQ0L','bmoZumkczq','dmoOWQNcVmoatJu','WRjLWRn0iuFcUrNcKcH/WORcKG','WRXsWRK','r8kSscpcGa','CmkyyNGCW68j','Fe9go8kBiSk3nYq1W4VdNG','W7ZdSatcKr8','WPDCuCkEomkPeSkUwa','W4PRW5FcUCow','cSkJWRVdSYdcTflcO3XNaCkAWRi','WPGhW7WTW5i','pCoSW6BdSmosDdtdUHe','WOaXxmkPWOZcOmopzCk/W5RcHMJdRq','WOpcImoIu1xdJr/cLW','WOtcVYLPthzLoa','WOuXwSoDW4VdN8kdzmk0','gK/dId1vW53dSwP3jmkqW5y'];a0_0x5a91=function(){return _0x205618;};return a0_0x5a91();}function a0_0x261c(_0x4fafd9,_0x4164b8){_0x4fafd9=_0x4fafd9-(0x14*-0x152+0x7ce*-0x3+0x33bf);var _0x11e7e7=a0_0x5a91();var _0x37bcea=_0x11e7e7[_0x4fafd9];if(a0_0x261c['VEilpX']===undefined){var _0x5c31ca=function(_0x31784d){var _0x43b1ae='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x30edd6='',_0x23247c='',_0x2c94d0=_0x30edd6+_0x5c31ca;for(var _0x4afe8f=-0x2dc+0x21fb+-0x1f*0x101,_0x4a3503,_0x5bc199,_0x3b7a27=-0x1966+0x3*0xad7+-0x1*0x71f;_0x5bc199=_0x31784d['charAt'](_0x3b7a27++);~_0x5bc199&&(_0x4a3503=_0x4afe8f%(-0x11df+-0x1*-0x156b+-0x2*0x1c4)?_0x4a3503*(0xc2*-0x16+-0x671*-0x4+-0x8d8)+_0x5bc199:_0x5bc199,_0x4afe8f++%(-0x81d+0x11a9+-0x1*0x988))?_0x30edd6+=_0x2c94d0['charCodeAt'](_0x3b7a27+(0x203*-0xd+0x25c1+-0xb90))-(0xb3a+0xb68*0x2+0x10*-0x220)!==0x14ea+0x4*0x202+0x1cf2*-0x1?String['fromCharCode'](0x17*0xef+-0x4d3*0x1+0xfa7*-0x1&_0x4a3503>>(-(-0x9*0xa3+0x12c5+-0xd08)*_0x4afe8f&0x7a*0x37+0x6b*0x17+0x5*-0x729)):_0x4afe8f:-0x8bb*0x3+-0x70f+-0x20*-0x10a){_0x5bc199=_0x43b1ae['indexOf'](_0x5bc199);}for(var _0x12140c=-0x2190+0x243b+-0x2ab,_0x2d416a=_0x30edd6['length'];_0x12140c<_0x2d416a;_0x12140c++){_0x23247c+='%'+('00'+_0x30edd6['charCodeAt'](_0x12140c)['toString'](0x1d29*0x1+0x4*-0x829+0x38b*0x1))['slice'](-(-0x239*0xb+0x24cc+-0xc57));}return decodeURIComponent(_0x23247c);};var _0x4b28fc=function(_0x566abc,_0x58fc2e){var _0x59547a=[],_0x268313=0x9bd*-0x3+-0xb*0xb+-0x76c*-0x4,_0x2e8bc0,_0x34d3ab='';_0x566abc=_0x5c31ca(_0x566abc);var _0x5599e5;for(_0x5599e5=-0x1460+-0x20ee+0x354e;_0x5599e5<0x13*0x11b+0xd94*-0x2+0x727;_0x5599e5++){_0x59547a[_0x5599e5]=_0x5599e5;}for(_0x5599e5=-0x5d*-0x41+-0x24a7+0xd0a*0x1;_0x5599e5<0x1f*-0x65+-0xb57*0x2+0x13d*0x1d;_0x5599e5++){_0x268313=(_0x268313+_0x59547a[_0x5599e5]+_0x58fc2e['charCodeAt'](_0x5599e5%_0x58fc2e['length']))%(0x337*-0x5+0x3f*-0x99+-0x1b5d*-0x2),_0x2e8bc0=_0x59547a[_0x5599e5],_0x59547a[_0x5599e5]=_0x59547a[_0x268313],_0x59547a[_0x268313]=_0x2e8bc0;}_0x5599e5=0x2ba*-0x7+-0x1c79*-0x1+-0x963,_0x268313=-0x1da*0x15+-0x1280+0x3962;for(var _0x57e561=0x2311+0x1*0xc13+0x1af*-0x1c;_0x57e561<_0x566abc['length'];_0x57e561++){_0x5599e5=(_0x5599e5+(0x1*-0x11e7+-0x1*0x2508+-0x1250*-0x3))%(0x49*-0x81+-0x60*-0x39+0x1069),_0x268313=(_0x268313+_0x59547a[_0x5599e5])%(0x2245+-0x23*0x117+0x270*0x2),_0x2e8bc0=_0x59547a[_0x5599e5],_0x59547a[_0x5599e5]=_0x59547a[_0x268313],_0x59547a[_0x268313]=_0x2e8bc0,_0x34d3ab+=String['fromCharCode'](_0x566abc['charCodeAt'](_0x57e561)^_0x59547a[(_0x59547a[_0x5599e5]+_0x59547a[_0x268313])%(0x1*-0x20f3+-0xfac+0x319f)]);}return _0x34d3ab;};a0_0x261c['UtbqnM']=_0x4b28fc,a0_0x261c['PAELqv']={},a0_0x261c['VEilpX']=!![];}var _0x17c70f=_0x11e7e7[-0x1f41+0xe12*-0x2+0x3b65],_0x50104e=_0x4fafd9+_0x17c70f,_0x629a3a=a0_0x261c['PAELqv'][_0x50104e];if(!_0x629a3a){if(a0_0x261c['tSSdud']===undefined){var _0x50a4f2=function(_0x125019){this['OGoBMO']=_0x125019,this['MRYkBA']=[-0xd46+0x1*0x4c+-0x1*-0xcfb,0x1*0xec3+0x14df*0x1+-0x23a2,0x136e+-0x4*0x164+-0x1*0xdde],this['AWsqox']=function(){return'newState';},this['AzkRxE']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['EXYsBw']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x50a4f2['prototype']['arDmBU']=function(){var _0x315185=new RegExp(this['AzkRxE']+this['EXYsBw']),_0x54269f=_0x315185['test'](this['AWsqox']['toString']())?--this['MRYkBA'][0xb1*0x2f+-0xd*0x1ea+-0x79c]:--this['MRYkBA'][0x6a*0x7+0xc32*-0x3+0x21b0];return this['sEtpHG'](_0x54269f);},_0x50a4f2['prototype']['sEtpHG']=function(_0x20cb23){if(!Boolean(~_0x20cb23))return _0x20cb23;return this['aGSDWQ'](this['OGoBMO']);},_0x50a4f2['prototype']['aGSDWQ']=function(_0x441f66){for(var _0x56497b=-0x1*0x1136+-0xf60+0x2b*0xc2,_0x1b152b=this['MRYkBA']['length'];_0x56497b<_0x1b152b;_0x56497b++){this['MRYkBA']['push'](Math['round'](Math['random']())),_0x1b152b=this['MRYkBA']['length'];}return _0x441f66(this['MRYkBA'][0x19b*0x5+0x5*-0x34+0x703*-0x1]);},new _0x50a4f2(a0_0x261c)['arDmBU'](),a0_0x261c['tSSdud']=!![];}_0x37bcea=a0_0x261c['UtbqnM'](_0x37bcea,_0x4164b8),a0_0x261c['PAELqv'][_0x50104e]=_0x37bcea;}else _0x37bcea=_0x629a3a;return _0x37bcea;}import'../chunk-PW2FGMCO.js';import'../chunk-HVKF2KYL.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x44b6be as AssetCache,a0_0x31fc47 as AssetLoader,a0_0x21976d as AssetSystem,a0_0x4c81e6 as AssetTextures,a0_0x77f76a as Assets,a0_0x187f64 as BaseSystem,a0_0x5c7633 as GameEngine,a0_0x5c9a29 as GameObject,a0_0x443e10 as GameObjectManager,a0_0x55f993 as ObjectFactory,a0_0x11d965 as Renderer,a0_0x4584d0 as RuntimeObjectRegistry,a0_0x48225b as Transform,a0_0x57f483 as applyScreenAnchor,a0_0x42e03d as basePixi,a0_0x4952a3 as clearResponsiveElements,a0_0x35cc82 as createPixiBase,a0_0xc076a9 as getRegisteredFontIds,a0_0xc1f2a0 as globalResponsiveMultipliers,a0_0x2f44f2 as initAssetTextures,a0_0xef79ec as initAssets,a0_0x5c1a5b as layout,a0_0x515b66 as playLottieOverlay,a0_0x191098 as registerFont,a0_0x59e7bd as registerType,a0_0x4af5e5 as resolveAnchorVec2,a0_0x106b52 as resolveFont,a0_0x191780 as resolveFontWeight,a0_0x44f0cc as resolveScreenAnchorPoint,a0_0x45b9dd as resolveScreenRatioPoint,a0_0x428434 as runInitSequence,a0_0x2f1c7d as setLottieInstance,a0_0x16d1e5 as spawnSceneFromConfig,a0_0xe8b199 as updateScreenState};
|