handler-playable-sdk 1.0.12 → 1.0.13
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-U2HEWFUD.js} +1 -1
- 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 +1 -1
- 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.13",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 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=`
|
|
47
47
|
<div class="wizard-card">
|
|
48
48
|
<div class="wizard-header">
|
|
49
49
|
<div class="wizard-title">
|
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-U2HEWFUD.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.13",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(_0x582468,_0x3759e3){var a0_0x1b3706={_0x1fb012:0x3a8,_0x694c13:0x399,_0x1ea1da:0x3a5,_0x52ca74:0x6a,_0x49df8b:0x63,_0x9b9daa:'4*o(',_0x221d90:0x58,_0x2c720d:0x5d,_0x37a52a:0x5a,_0x503fdd:0x58,_0x3cc877:'n@nI',_0x49b97c:0xf7,_0x3ef435:0xfa,_0x5034c7:0x102,_0xb6e8bc:0xfd,_0x5cb2a0:0x67,_0xc1baa0:0x5e,_0x48f6d4:0x62,_0x3590af:0x390,_0x118e9b:0x38f,_0x368bfa:0x391,_0xadadf3:0x39a,_0x5d04dc:0x3a1,_0x5659ce:0x3a8,_0x7fe5ce:0x3b4,_0x4369a2:0x3a0,_0x21822f:0x3a3,_0x5ec801:'w[@3',_0x224298:0x38a,_0x5a6ee4:'tCQP',_0x208cf8:0xfe,_0x44b0d9:0xf1,_0xcde7f1:'%CMP',_0x128ac8:0x109,_0xc65b44:0x104,_0x214dbe:0x100},a0_0x22f72e={_0x270a81:0x2c},a0_0xb09a2c={_0x4fbefc:0x2d3};function _0x381b47(_0x318abb,_0x534eaa,_0x1d80d2,_0x42b2e7,_0x3c2c87){return a0_0x5d85(_0x42b2e7-a0_0xb09a2c._0x4fbefc,_0x1d80d2);}var _0x70bf4e=_0x582468();function _0x215de2(_0x541b27,_0x2d1505,_0x547ffc,_0x10e2e7,_0x16744c){return a0_0x5d85(_0x547ffc- -0x68,_0x16744c);}function _0x594440(_0x565fe2,_0x1c1950,_0x5e7d54,_0x4e2d10,_0x5ebeda){return a0_0x5d85(_0x5ebeda-a0_0x22f72e._0x270a81,_0x565fe2);}while(!![]){try{var _0x29a0de=parseInt(_0x381b47(a0_0x1b3706._0x1fb012,a0_0x1b3706._0x694c13,'Jr39',a0_0x1b3706._0x1ea1da,0x3af))/(-0x8c8+0x3eb*-0x7+-0x609*-0x6)+parseInt(_0x215de2(0x5c,a0_0x1b3706._0x52ca74,a0_0x1b3706._0x49df8b,0x68,a0_0x1b3706._0x9b9daa))/(-0x761+-0x1*0x143+0x2e2*0x3)+parseInt(_0x215de2(a0_0x1b3706._0x221d90,a0_0x1b3706._0x2c720d,a0_0x1b3706._0x37a52a,a0_0x1b3706._0x503fdd,a0_0x1b3706._0x3cc877))/(-0x1aad*0x1+0x214*-0x1+-0x1*-0x1cc4)*(parseInt(_0x594440('jRN$',a0_0x1b3706._0x49b97c,a0_0x1b3706._0x3ef435,a0_0x1b3706._0x5034c7,a0_0x1b3706._0xb6e8bc))/(-0x132e+0xe1a+0x518))+parseInt(_0x215de2(a0_0x1b3706._0x5cb2a0,a0_0x1b3706._0x52ca74,a0_0x1b3706._0xc1baa0,a0_0x1b3706._0x48f6d4,'loWB'))/(-0x189f*-0x1+-0x3*0xb36+0x908)*(-parseInt(_0x381b47(0x396,a0_0x1b3706._0x3590af,'4#%k',a0_0x1b3706._0x118e9b,a0_0x1b3706._0x368bfa))/(-0x1*0x1d9+-0x6*0x334+-0x1517*-0x1))+-parseInt(_0x381b47(a0_0x1b3706._0xadadf3,a0_0x1b3706._0x5d04dc,'UD]7',a0_0x1b3706._0x5659ce,a0_0x1b3706._0x7fe5ce))/(0x263b+-0xd46*-0x1+-0x337a)+parseInt(_0x381b47(a0_0x1b3706._0x4369a2,a0_0x1b3706._0x21822f,a0_0x1b3706._0x5ec801,0x396,a0_0x1b3706._0x224298))/(-0x6dc+0xa5e+-0x37a*0x1)*(-parseInt(_0x594440(a0_0x1b3706._0x5a6ee4,0xf3,0xf7,a0_0x1b3706._0x208cf8,a0_0x1b3706._0x44b0d9))/(0x26de+0x1*-0xb4c+0x13*-0x173))+parseInt(_0x594440(a0_0x1b3706._0xcde7f1,0x10c,a0_0x1b3706._0x128ac8,a0_0x1b3706._0xc65b44,a0_0x1b3706._0x214dbe))/(0x2347+0x805*-0x1+-0x1b38);if(_0x29a0de===_0x3759e3)break;else _0x70bf4e['push'](_0x70bf4e['shift']());}catch(_0x11b5b2){_0x70bf4e['push'](_0x70bf4e['shift']());}}}(a0_0x33ef,0xe273*-0x2+0x1e47b+-0x1a*-0x1a6f));var a0_0x43c729=(function(){var a0_0x4d5f97={_0x2145c0:0x22f,_0x5f5ccd:0x234,_0x18dbb0:0x22e,_0xf88bc7:0x242,_0x1bb7ce:'7&fc'},_0x3aef75=!![];return function(_0x217430,_0x19edb4){var _0xc39864=_0x3aef75?function(){var a0_0xeeb6d2={_0x395714:0x167};function _0x5a7310(_0x328117,_0xc8c60,_0x31156f,_0x3b50e4,_0x3535f7){return a0_0x5d85(_0xc8c60-a0_0xeeb6d2._0x395714,_0x3535f7);}if(_0x19edb4){var _0x3531ab=_0x19edb4[_0x5a7310(a0_0x4d5f97._0x2145c0,a0_0x4d5f97._0x5f5ccd,a0_0x4d5f97._0x18dbb0,a0_0x4d5f97._0xf88bc7,a0_0x4d5f97._0x1bb7ce)](_0x217430,arguments);return _0x19edb4=null,_0x3531ab;}}:function(){};return _0x3aef75=![],_0xc39864;};}()),a0_0x3ff971=a0_0x43c729(this,function(){var a0_0x280e01={_0x3d8015:0xd5,_0x4b16fc:0xcd,_0x4e2e15:0xbc,_0x24eea9:'xR9X',_0x5e7782:'6E]o',_0x4dfce5:0x1a1,_0x301b3c:0x1aa,_0x208291:0x1af,_0x135303:0x104,_0x1f8efd:0x105,_0x5333f4:'UD]7',_0x23ffee:0xfe,_0x4348e4:0x10d,_0x530cbc:0xb5,_0x5eb318:'VtJD',_0x417241:0x19f,_0x424e9c:0x196,_0x115bac:0x19b,_0x3749f8:0x18e,_0x42bc58:0xd2,_0xe1fab1:0xc5,_0x5af6f5:']BgE',_0x509b80:0x1a8,_0x285668:0xeb,_0x45c87d:0xde,_0x53abfa:'nz%e',_0x2e19f8:0xf8,_0x54e281:0xf1,_0x51af1c:0x19a,_0x3da660:0x19f,_0x2251b5:0x100,_0x1e98fc:0x10a,_0x568631:'rcUt',_0x114096:0x101,_0x3cd8ff:0xf7},a0_0x352f19={_0x2b6229:0x1c1},a0_0x4a905b={_0x1614bb:0xdb},a0_0x4b120c={_0x3218d8:0x195};function _0x16e421(_0x741088,_0x576f3d,_0x2f63e6,_0x3f6be0,_0x1f5ef0){return a0_0x5d85(_0x3f6be0- -a0_0x4b120c._0x3218d8,_0x1f5ef0);}function _0x726ab8(_0x1d6863,_0x4a6c69,_0x38d07f,_0x412089,_0x54701e){return a0_0x5d85(_0x412089-a0_0x4a905b._0x1614bb,_0x1d6863);}function _0x1c3d78(_0x288076,_0x57aba1,_0x34614b,_0x26445f,_0x415557){return a0_0x5d85(_0x288076- -a0_0x352f19._0x2b6229,_0x34614b);}return a0_0x3ff971[_0x16e421(-a0_0x280e01._0x3d8015,-a0_0x280e01._0x4b16fc,-a0_0x280e01._0x4e2e15,-0xc7,a0_0x280e01._0x24eea9)+_0x726ab8(a0_0x280e01._0x5e7782,0x1ac,a0_0x280e01._0x4dfce5,a0_0x280e01._0x301b3c,a0_0x280e01._0x208291)]()['searc'+'h'](_0x1c3d78(-a0_0x280e01._0x135303,-a0_0x280e01._0x1f8efd,a0_0x280e01._0x5333f4,-a0_0x280e01._0x23ffee,-a0_0x280e01._0x4348e4)+_0x16e421(-0xc1,-a0_0x280e01._0x530cbc,-0xc7,-0xc2,'aKjt')+'+$')[_0x726ab8(a0_0x280e01._0x5eb318,a0_0x280e01._0x417241,a0_0x280e01._0x424e9c,a0_0x280e01._0x115bac,a0_0x280e01._0x3749f8)+_0x16e421(-a0_0x280e01._0x42bc58,-a0_0x280e01._0xe1fab1,-0xd3,-0xc6,'6E]o')]()[_0x726ab8(a0_0x280e01._0x5af6f5,a0_0x280e01._0x208291,0x1a2,0x1ab,a0_0x280e01._0x509b80)+_0x1c3d78(-a0_0x280e01._0x285668,-a0_0x280e01._0x45c87d,a0_0x280e01._0x53abfa,-a0_0x280e01._0x2e19f8,-a0_0x280e01._0x54e281)+'r'](a0_0x3ff971)[_0x726ab8('ycO%',0x1a4,a0_0x280e01._0x51af1c,a0_0x280e01._0x3da660,0x194)+'h']('(((.+'+_0x1c3d78(-a0_0x280e01._0x2251b5,-a0_0x280e01._0x1e98fc,a0_0x280e01._0x568631,-a0_0x280e01._0x114096,-a0_0x280e01._0x3cd8ff)+'+$');});a0_0x3ff971();function a0_0x33ef(){var _0x1f3835=['p8k9qSoHfW','DSk9oKldGrtcJCkNW5a','nCkhWOL9WRC','wmorWR0PF01WWQKEW7/dNCkV','W5zZWRnHtNfQyW','AL3dK8krW78','qmooWQaYBG','fSkpjbHECCkXWOj0vG','f8obWP15WQRdH8oacG','FM/cL14P','vSo6WQynW5v1nSkmWRxcGSkYtq','WOrebCo6kmobErKroSkk','W6epz2eyAedcLMfO','WRRcTYf9W446WR7cTmkR','jmk/f8oqW79aW7JdVcVcIaG','mwmws8o0W5X4EILnW5mv','W5r1W4qBbsXtvmo2W5BcOsO','ySoRa1tcLZ1kCmokjCk6W6C','WRLHWQDHWPW','WRlcHmo2WPHs','W4lcNta','WQG1FqLg','WOddQCkFtSoAtahcGa','WQ93W47dJhaOWRhcPuBcUI5t','WQBcQJWxWP8','lwK5fIXMlLTbiLJcM8kC','lSkAWPfHWQtdUdnHltZdQSku'];a0_0x33ef=function(){return _0x1f3835;};return a0_0x33ef();}import{A as a0_0x10d9db,B as a0_0x4ba3bc,C as a0_0x33a1e4,D as a0_0x535a1d,b as a0_0x5874ae,c as a0_0x4c2660,d as a0_0x341460,e as a0_0x5506d4,f as a0_0x419d2c,g as a0_0xe180bd,h as a0_0x4268ad,i as a0_0x2fcf91,j as a0_0x1b7606,k as a0_0x4285d8,l as a0_0x4b58c5,m as a0_0x4dc517,n as a0_0x460fb2,o as a0_0x156a98,p as a0_0x49b168,q as a0_0x1d352c,r as a0_0x499583,s as a0_0x51ad27,t as a0_0x24fe0d,u as a0_0x40260c,v as a0_0x163166,w as a0_0x261520,x as a0_0x1cc68f,y as a0_0x3ea5f9,z as a0_0x33cca5}from'../chunk-U2HEWFUD.js';import{a as a0_0x5b569a,b as a0_0x277542,c as a0_0x3760f0,d as a0_0x6a9326,e as a0_0x5146f3}from'../chunk-I5OOVR5U.js';function a0_0x5d85(_0x2d6f3b,_0x183b91){_0x2d6f3b=_0x2d6f3b-(0x1eb5+0x11*0x21d+0x41e6*-0x1);var _0x5c9269=a0_0x33ef();var _0x2d497b=_0x5c9269[_0x2d6f3b];if(a0_0x5d85['vkzOzK']===undefined){var _0x4089c9=function(_0x3fe419){var _0x11d333='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x566e23='',_0x50f059='',_0x1e631a=_0x566e23+_0x4089c9;for(var _0x27508b=0x10ed+0xc86+-0x1d73,_0x3c5804,_0x680e0,_0x24cb6c=0x1d4b*-0x1+-0x1547+0x3292;_0x680e0=_0x3fe419['charAt'](_0x24cb6c++);~_0x680e0&&(_0x3c5804=_0x27508b%(0x1d86+-0x1*0x288+-0x1afa)?_0x3c5804*(-0xf46+-0x147*-0x1e+-0x16cc)+_0x680e0:_0x680e0,_0x27508b++%(0x1433*0x1+-0x1fd1+-0x2*-0x5d1))?_0x566e23+=_0x1e631a['charCodeAt'](_0x24cb6c+(-0x1ade+0x336+0x17b2))-(-0x26da+-0x1*-0xa67+0x1c7d)!==0x6*0x63b+0x2*-0x1263+0x1a*-0x6?String['fromCharCode'](-0x3c2+-0x5a*-0x2+0x40d&_0x3c5804>>(-(-0x2*-0xa6f+-0xb35+0x7*-0x161)*_0x27508b&0xde4+0xf0+-0xece)):_0x27508b:0x1fcd+-0x1d25+0x55*-0x8){_0x680e0=_0x11d333['indexOf'](_0x680e0);}for(var _0x43602b=-0x934+0x5e7*0x5+-0x144f,_0x5c65b2=_0x566e23['length'];_0x43602b<_0x5c65b2;_0x43602b++){_0x50f059+='%'+('00'+_0x566e23['charCodeAt'](_0x43602b)['toString'](-0x8e*0x3d+0x1*0x2006+0x78*0x4))['slice'](-(0xf*0x18e+0x399+0x1*-0x1ae9));}return decodeURIComponent(_0x50f059);};var _0x5e58f5=function(_0x5f208f,_0x21e6b7){var _0x2ba793=[],_0x5bc6e1=0x1093*-0x1+-0x4f*-0x32+-0x1*-0x125,_0x33922b,_0x3cd3fd='';_0x5f208f=_0x4089c9(_0x5f208f);var _0x40233c;for(_0x40233c=0x1538+-0x74*0x4d+0xdac;_0x40233c<0xf7f*-0x1+0xc42+-0xd9*-0x5;_0x40233c++){_0x2ba793[_0x40233c]=_0x40233c;}for(_0x40233c=0x1b85+0x937+-0x24bc;_0x40233c<0x7*0xa5+-0x1fc5*0x1+0x1c42;_0x40233c++){_0x5bc6e1=(_0x5bc6e1+_0x2ba793[_0x40233c]+_0x21e6b7['charCodeAt'](_0x40233c%_0x21e6b7['length']))%(-0x1928+0xc1*-0x17+0x28f*0x11),_0x33922b=_0x2ba793[_0x40233c],_0x2ba793[_0x40233c]=_0x2ba793[_0x5bc6e1],_0x2ba793[_0x5bc6e1]=_0x33922b;}_0x40233c=-0xc30*0x1+0x1ab3+0xe83*-0x1,_0x5bc6e1=0x577+0x1844+-0x1dbb;for(var _0x5abf0b=-0x19*0x99+0x4*0x445+-0x223*0x1;_0x5abf0b<_0x5f208f['length'];_0x5abf0b++){_0x40233c=(_0x40233c+(0x17b7+-0xc11*-0x3+-0x3be9))%(0x126*0x15+-0x4*0x335+0x6*-0x1b7),_0x5bc6e1=(_0x5bc6e1+_0x2ba793[_0x40233c])%(0x69+0x18d*-0x2+0x3b1),_0x33922b=_0x2ba793[_0x40233c],_0x2ba793[_0x40233c]=_0x2ba793[_0x5bc6e1],_0x2ba793[_0x5bc6e1]=_0x33922b,_0x3cd3fd+=String['fromCharCode'](_0x5f208f['charCodeAt'](_0x5abf0b)^_0x2ba793[(_0x2ba793[_0x40233c]+_0x2ba793[_0x5bc6e1])%(0x100*-0x13+-0xe03+0x1*0x2203)]);}return _0x3cd3fd;};a0_0x5d85['KowSnM']=_0x5e58f5,a0_0x5d85['lLKLiE']={},a0_0x5d85['vkzOzK']=!![];}var _0x272cff=_0x5c9269[0xed1+0xb93*-0x1+0x1*-0x33e],_0x4d26e2=_0x2d6f3b+_0x272cff,_0x50c24a=a0_0x5d85['lLKLiE'][_0x4d26e2];if(!_0x50c24a){if(a0_0x5d85['uHFqCc']===undefined){var _0x25e652=function(_0x1be7e2){this['MxJaQl']=_0x1be7e2,this['zlkxcJ']=[-0x2145+-0x1e11+0x3*0x151d,-0xaad+-0x1*0x8b+0xb38,0xb7*-0x2f+0x1f7c+0x21d],this['QTgEne']=function(){return'newState';},this['PgmZmy']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['RaWjoU']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x25e652['prototype']['cdOCfR']=function(){var _0x52d9e1=new RegExp(this['PgmZmy']+this['RaWjoU']),_0x5910f8=_0x52d9e1['test'](this['QTgEne']['toString']())?--this['zlkxcJ'][-0x1*0x143+0x1fcd*-0x1+0x2111]:--this['zlkxcJ'][-0x214+0x176b*0x1+-0x1*0x1557];return this['Qmoqpa'](_0x5910f8);},_0x25e652['prototype']['Qmoqpa']=function(_0xa74015){if(!Boolean(~_0xa74015))return _0xa74015;return this['aFFAWE'](this['MxJaQl']);},_0x25e652['prototype']['aFFAWE']=function(_0x20ab3e){for(var _0x3fc15d=-0x132e+0xe1a+0x514,_0x5df685=this['zlkxcJ']['length'];_0x3fc15d<_0x5df685;_0x3fc15d++){this['zlkxcJ']['push'](Math['round'](Math['random']())),_0x5df685=this['zlkxcJ']['length'];}return _0x20ab3e(this['zlkxcJ'][-0x189f*-0x1+-0x3*0xb36+0x903]);},new _0x25e652(a0_0x5d85)['cdOCfR'](),a0_0x5d85['uHFqCc']=!![];}_0x2d497b=a0_0x5d85['KowSnM'](_0x2d497b,_0x183b91),a0_0x5d85['lLKLiE'][_0x4d26e2]=_0x2d497b;}else _0x2d497b=_0x50c24a;return _0x2d497b;}import'../chunk-PW2FGMCO.js';import'../chunk-HVKF2KYL.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x5b569a as AssetCache,a0_0x3760f0 as AssetLoader,a0_0x40260c as AssetSystem,a0_0x6a9326 as AssetTextures,a0_0x51ad27 as Assets,a0_0x156a98 as BaseSystem,a0_0x460fb2 as GameEngine,a0_0x5506d4 as GameObject,a0_0x419d2c as GameObjectManager,a0_0x4dc517 as ObjectFactory,a0_0x341460 as Renderer,a0_0x49b168 as RuntimeObjectRegistry,a0_0x4c2660 as Transform,a0_0x4ba3bc as applyScreenAnchor,a0_0x1d352c as basePixi,a0_0x261520 as clearResponsiveElements,a0_0x5874ae as createPixiBase,a0_0x1b7606 as getRegisteredFontIds,a0_0x163166 as globalResponsiveMultipliers,a0_0x5146f3 as initAssetTextures,a0_0x24fe0d as initAssets,a0_0x33a1e4 as layout,a0_0x4b58c5 as playLottieOverlay,a0_0x2fcf91 as registerFont,a0_0x277542 as registerType,a0_0x3ea5f9 as resolveAnchorVec2,a0_0xe180bd as resolveFont,a0_0x4268ad as resolveFontWeight,a0_0x33cca5 as resolveScreenAnchorPoint,a0_0x10d9db as resolveScreenRatioPoint,a0_0x535a1d as runInitSequence,a0_0x4285d8 as setLottieInstance,a0_0x499583 as spawnSceneFromConfig,a0_0x1cc68f as updateScreenState};
|