handler-playable-sdk 1.0.101 → 1.0.103

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.
Files changed (39) hide show
  1. package/dist/{chunk-RZAAEBBT.js → chunk-NOMTJOWU.js} +15 -5
  2. package/dist/cli/brand-dna.mjs +1 -1
  3. package/dist/cli/canva-import.mjs +1 -1
  4. package/dist/cli/cleanup-assets.mjs +1 -1
  5. package/dist/cli/fix-scales.mjs +1 -1
  6. package/dist/cli/index.js +1 -1
  7. package/dist/cli/screen-helper.mjs +1 -1
  8. package/dist/cli/setup-library.mjs +1 -1
  9. package/dist/cli/student-helper/add-logic.mjs +1 -1
  10. package/dist/cli/student-helper/add-object.mjs +1 -1
  11. package/dist/cli/student-helper/arg-parsing.mjs +1 -1
  12. package/dist/cli/student-helper/asset-registry.mjs +1 -1
  13. package/dist/cli/student-helper/bullet-system.mjs +1 -1
  14. package/dist/cli/student-helper/collectable-system.mjs +1 -1
  15. package/dist/cli/student-helper/constants.mjs +1 -1
  16. package/dist/cli/student-helper/drag-snap-couples.mjs +1 -1
  17. package/dist/cli/student-helper/endgame-screen.mjs +1 -1
  18. package/dist/cli/student-helper/fs-io.mjs +1 -1
  19. package/dist/cli/student-helper/logic-defaults.mjs +1 -1
  20. package/dist/cli/student-helper/print-help.mjs +1 -1
  21. package/dist/cli/student-helper/prompts.mjs +1 -1
  22. package/dist/cli/student-helper/scratch-card.mjs +1 -1
  23. package/dist/cli/student-helper/screen-utils.mjs +1 -1
  24. package/dist/cli/student-helper/snippets.mjs +1 -1
  25. package/dist/cli/student-helper/start-screen.mjs +1 -1
  26. package/dist/cli/student-helper/swerve-collect.mjs +1 -1
  27. package/dist/cli/student-helper/tap-destroy.mjs +1 -1
  28. package/dist/cli/student-helper/template-packs.mjs +1 -1
  29. package/dist/cli/student-helper.mjs +1 -1
  30. package/dist/cli/sync-screens.mjs +1 -1
  31. package/dist/cli/validate-assets.mjs +1 -1
  32. package/dist/cli/validate.mjs +1 -1
  33. package/dist/index.cjs +15 -5
  34. package/dist/index.js +1 -1
  35. package/dist/pixi/index.cjs +1 -1
  36. package/dist/pixi/index.js +1 -1
  37. package/dist/three/index.cjs +10 -10
  38. package/dist/three/index.js +1 -1
  39. package/package.json +1 -1
@@ -94,7 +94,7 @@
94
94
  <button class="asset-crop-apply primary" data-action="apply">Apply Crop</button>
95
95
  </div>
96
96
  </div>
97
- `,this.modal=e,this.attachEventListeners(),this.initializeCanvas()}initializeCanvas(){this.modal&&(this.canvas=this.modal.querySelector(".asset-crop-canvas"),this.canvas&&(this.ctx=this.canvas.getContext("2d"),this.canvas.width=400,this.canvas.height=300))}loadImage(){this.options&&(this.image=new Image,this.image.crossOrigin="anonymous",this.image.onload=()=>{this.image&&this.image.naturalWidth>0&&this.image.naturalHeight>0?(console.log("[AssetCropModal] Image loaded:",this.image.naturalWidth,"x",this.image.naturalHeight),this.initializeCrop(),this.render()):(console.error("[AssetCropModal] Image loaded but invalid dimensions"),this.showError("Failed to load image"))},this.image.onerror=e=>{console.error("[AssetCropModal] Image load error:",e),this.showError("Failed to load image. Please check the image URL.")},this.image.src=this.options.imageSrc,this.canvas&&this.ctx&&(this.ctx.fillStyle="rgba(128, 128, 128, 0.3)",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height),this.ctx.fillStyle="rgba(255, 255, 255, 0.7)",this.ctx.font="14px sans-serif",this.ctx.textAlign="center",this.ctx.fillText("Loading image...",this.canvas.width/2,this.canvas.height/2)))}showError(e){var n;if(!this.canvas||!this.ctx)return;this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.ctx.fillStyle="rgba(255, 0, 0, 0.2)",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height),this.ctx.fillStyle="#ff4444",this.ctx.font="14px sans-serif",this.ctx.textAlign="center",this.ctx.fillText(e,this.canvas.width/2,this.canvas.height/2);let t=(n=this.modal)==null?void 0:n.querySelector(".asset-crop-preview-canvas");if(t){let a=t.getContext("2d");a&&(a.fillStyle="rgba(255, 0, 0, 0.2)",a.fillRect(0,0,t.width,t.height))}}initializeCrop(){var n;if(!this.image||!this.canvas)return;let e=this.image.width/this.image.height,t=this.canvas.width/this.canvas.height;e>t?(this.cropHeight=this.image.height,this.cropWidth=this.cropHeight*t,this.cropX=(this.image.width-this.cropWidth)/2,this.cropY=0):(this.cropWidth=this.image.width,this.cropHeight=this.cropWidth/t,this.cropX=0,this.cropY=(this.image.height-this.cropHeight)/2),(n=this.options)!=null&&n.aspectRatio&&this.applyAspectRatio(this.options.aspectRatio),this.fitToCanvas()}applyAspectRatio(e){if(!this.image)return;let t=this.image.width/this.image.height,n=this.cropX+this.cropWidth/2,a=this.cropY+this.cropHeight/2;e>t?(this.cropWidth=Math.min(this.image.width,this.cropHeight*e),this.cropHeight=this.cropWidth/e):(this.cropHeight=Math.min(this.image.height,this.cropWidth/e),this.cropWidth=this.cropHeight*e),this.cropX=Math.max(0,Math.min(this.image.width-this.cropWidth,n-this.cropWidth/2)),this.cropY=Math.max(0,Math.min(this.image.height-this.cropHeight,a-this.cropHeight/2))}fitToCanvas(){if(!this.image||!this.canvas)return;let e=this.canvas.width/this.cropWidth,t=this.canvas.height/this.cropHeight;this.scale=Math.min(e,t)*.9,this.panX=(this.canvas.width-this.cropWidth*this.scale)/2,this.panY=(this.canvas.height-this.cropHeight*this.scale)/2}render(){if(!(!this.ctx||!this.canvas)){if(!this.image||!this.image.complete||this.image.naturalWidth===0||this.image.naturalHeight===0){console.warn("[AssetCropModal] Image not ready for rendering"),this.showError("Image not loaded");return}this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);try{this.ctx.save(),this.ctx.translate(this.panX,this.panY),this.ctx.scale(this.scale,this.scale),this.ctx.drawImage(this.image,-this.cropX,-this.cropY,this.image.width,this.image.height),this.ctx.restore()}catch(e){console.error("[AssetCropModal] Error drawing image:",e),this.showError("Error drawing image");return}this.drawCropOverlay(),this.updatePreview()}}drawCropOverlay(){if(!this.ctx||!this.canvas)return;let e=this.panX,t=this.panY,n=this.cropWidth*this.scale,a=this.cropHeight*this.scale;this.ctx.fillStyle="rgba(0, 0, 0, 0.5)",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height),this.ctx.clearRect(e,t,n,a),this.ctx.strokeStyle="#ffffff",this.ctx.lineWidth=2,this.ctx.strokeRect(e,t,n,a),this.ctx.fillStyle="#ffffff";let s=8;[[e,t],[e+n-s,t],[e,t+a-s],[e+n-s,t+a-s]].forEach(([o,c])=>{var l;(l=this.ctx)==null||l.fillRect(o,c,s,s)})}updatePreview(){if(!this.modal||!this.image||!this.image.complete||this.image.naturalWidth===0||this.image.naturalHeight===0)return;let e=this.modal.querySelector(".asset-crop-preview-canvas");if(!e)return;let t=e.getContext("2d");if(!t)return;let n=150;e.width=n,e.height=n,t.clearRect(0,0,n,n);let a=n/this.cropWidth,s=n/this.cropHeight,r=Math.min(a,s),o=this.cropWidth*r,c=this.cropHeight*r,l=(n-o)/2,u=(n-c)/2;try{t.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,l,u,o,c)}catch(d){console.error("[AssetCropModal] Error drawing preview:",d),t.fillStyle="rgba(255, 0, 0, 0.2)",t.fillRect(0,0,n,n)}}attachEventListeners(){if(!this.modal||!this.canvas)return;this.canvas.addEventListener("mousedown",this.handleMouseDown.bind(this)),this.canvas.addEventListener("mousemove",this.handleMouseMove.bind(this)),this.canvas.addEventListener("mouseup",this.handleMouseUp.bind(this)),this.canvas.addEventListener("wheel",this.handleWheel.bind(this)),this.canvas.addEventListener("touchstart",this.handleTouchStart.bind(this)),this.canvas.addEventListener("touchmove",this.handleTouchMove.bind(this)),this.canvas.addEventListener("touchend",this.handleTouchEnd.bind(this));let e=this.modal.querySelector(".asset-crop-zoom-slider");e==null||e.addEventListener("input",n=>{let a=parseFloat(n.target.value);this.setZoom(a)});let t=this.modal.querySelector(".asset-crop-aspect-select");t==null||t.addEventListener("change",n=>{let a=n.target.value;this.setAspectRatio(a)}),this.modal.addEventListener("click",n=>{switch(n.target.dataset.action){case"reset":this.reset();break;case"apply":this.applyCrop();break;case"cancel":case"close":this.close();break}}),this.modal.addEventListener("click",n=>{n.target===this.modal&&this.close()})}handleMouseDown(e){this.isDragging=!0,this.dragStartX=e.clientX,this.dragStartY=e.clientY,this.lastPanX=this.panX,this.lastPanY=this.panY,this.canvas.style.cursor="grabbing"}handleMouseMove(e){if(!this.isDragging)return;let t=e.clientX-this.dragStartX,n=e.clientY-this.dragStartY;this.panX=this.lastPanX+t,this.panY=this.lastPanY+n,this.constrainPan(),this.render()}handleMouseUp(){this.isDragging=!1,this.canvas.style.cursor="grab"}handleWheel(e){e.preventDefault();let t=e.deltaY>0?.9:1.1;this.setZoom(this.scale*t)}handleTouchStart(e){e.touches.length===1&&(this.isDragging=!0,this.dragStartX=e.touches[0].clientX,this.dragStartY=e.touches[0].clientY,this.lastPanX=this.panX,this.lastPanY=this.panY)}handleTouchMove(e){if(!this.isDragging||e.touches.length!==1)return;e.preventDefault();let t=e.touches[0].clientX-this.dragStartX,n=e.touches[0].clientY-this.dragStartY;this.panX=this.lastPanX+t,this.panY=this.lastPanY+n,this.constrainPan(),this.render()}handleTouchEnd(){this.isDragging=!1}setZoom(e){this.scale=Math.max(.1,Math.min(3,e)),this.updateZoomUI(),this.constrainPan(),this.render()}setAspectRatio(e){let t;switch(e){case"1:1":t=1;break;case"4:3":t=4/3;break;case"16:9":t=16/9;break;case"3:2":t=3/2;break;default:t=void 0}t&&this.applyAspectRatio(t),this.fitToCanvas(),this.render()}updateZoomUI(){if(!this.modal)return;let e=this.modal.querySelector(".asset-crop-zoom-value"),t=this.modal.querySelector(".asset-crop-zoom-slider");e&&(e.textContent=`${this.scale.toFixed(1)}x`),t&&(t.value=this.scale.toString())}constrainPan(){if(!this.canvas)return;let e=this.cropWidth*this.scale,t=this.cropHeight*this.scale;this.panX=Math.max(this.canvas.width-e,Math.min(0,this.panX)),this.panY=Math.max(this.canvas.height-t,Math.min(0,this.panY))}reset(){this.initializeCrop(),this.render()}applyCrop(){var a;if(!this.image||!((a=this.options)!=null&&a.onCrop))return;let e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return;e.width=this.cropWidth,e.height=this.cropHeight,t.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,0,0,this.cropWidth,this.cropHeight);let n=e.toDataURL("image/png");this.options.onCrop(n),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal);let e=this.options;this.modal=null,this.canvas=null,this.ctx=null,this.image=null,this.options=null,e!=null&&e.onCancel&&e.onCancel()}};window.openAssetCrop=function(i){new Pi().open(i)}});var fr={};mn(fr,{AssetCache:()=>re,AssetLoader:()=>ke,AssetSystem:()=>li,AssetTextures:()=>Pe,Assets:()=>Fa,BaseSystem:()=>rt,GameEngine:()=>oi,GameObject:()=>Ot,GameObjectManager:()=>at,ObjectFactory:()=>ye,Renderer:()=>_t,RuntimeObjectRegistry:()=>ot,Transform:()=>jt,applyScreenAnchor:()=>Ft,basePixi:()=>$a,clearResponsiveElements:()=>ia,createPixiBase:()=>si,getRegisteredFontIds:()=>_a,globalResponsiveMultipliers:()=>St,initAssetTextures:()=>Zt,initAssets:()=>Ba,layout:()=>aa,playLottieOverlay:()=>Ra,registerFont:()=>ja,registerType:()=>Xt,resolveAnchorVec2:()=>Te,resolveFont:()=>Pa,resolveFontWeight:()=>Ma,resolveScreenAnchorPoint:()=>De,resolveScreenRatioPoint:()=>Ne,runInitSequence:()=>Ga,setLottieInstance:()=>Qt,spawnSceneFromConfig:()=>Na,updateScreenState:()=>Ht});module.exports=Ka(fr);var ka=require("pixi.js");var Le={};function zt(i,e,t=!1){Le[i]||(Le[i]=[]),Le[i].push({fn:e,once:t})}function di(i,e){if(Le[i]){if(!e){delete Le[i];return}Le[i]=Le[i].filter(t=>t.fn!==e)}}function $t(i,...e){let t=Le[i];if(t)for(let n of[...t])n.fn(...e),n.once&&di(i,n.fn)}function ee(i,e){zt(i,e,!0)}var $=null,ae=[],Ye=null;function wn(i){$=i,ae=[],Ye!==null&&(clearTimeout(Ye),Ye=null)}function xn(){var i,e,t;return{endpoint:($==null?void 0:$.endpoint)||"",transport:($==null?void 0:$.transport)||"beacon",batchSize:(i=$==null?void 0:$.batchSize)!=null?i:10,flushIntervalMs:(e=$==null?void 0:$.flushIntervalMs)!=null?e:300,maxQueue:(t=$==null?void 0:$.maxQueue)!=null?t:200,debug:!!($!=null&&$.debug)}}async function yn(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 pi(i,e){let t=xn();if(e&&t.endpoint){if(ae.push(i),ae.length>t.maxQueue&&(ae=ae.slice(ae.length-t.maxQueue)),ae.length>=t.batchSize){vn();return}Ye===null&&(Ye=window.setTimeout(()=>{Ye=null,vn()},t.flushIntervalMs))}}async function vn(){let i=xn();if(!i.endpoint||ae.length===0)return;let e=ae.splice(0,i.batchSize);await yn(i.endpoint,{events:e},i.transport,i.debug),ae.length>0&&await yn(i.endpoint,{events:ae.splice(0,i.batchSize)},i.transport,i.debug)}function Sn(i){return Math.max(0,Math.min(1,i))}function Xa(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 wt(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ja(i,e){let t=i==null?void 0:i[e];return typeof t=="number"?t:0}function En(i,e,t){try{i[e]=t}catch{}}function Za(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 Cn(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 An(i,e){let t=Za(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 Ln(){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=wt();for(let g of Array.from(i)){if(g.killed||g.paused)continue;let h=u-g.startMs-g.delayMs;if(h<0)continue;let m=g.durationMs>0?h/g.durationMs:1,C=Sn(m),b=g.repeat>=0?g.repeat+1:1,f=g.repeat>0?Math.min(Math.floor(m),b-1):0;if(g.repeat>0&&m>=1){let x=m-f;C=Sn(x)}let y=g.ease(C);g.yoyo&&f%2===1&&(y=1-y);for(let x of g.props)En(g.target,x.key,x.from+(x.to-x.from)*y);g.scaleFrom&&g.scaleTo&&Cn(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*y,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*y});try{(d=g.onUpdate)==null||d.call(g)}catch{}if(m>=b){r(g);try{(p=g.onComplete)==null||p.call(g)}catch{}}}},c=(u,d,p)=>{var x;let g=Math.max(0,(typeof d.duration=="number"?d.duration:.5)*1e3),h=Math.max(0,(typeof d.delay=="number"?d.delay:0)*1e3+((x=p==null?void 0:p.delayMsOverride)!=null?x:0)),m=Xa(d.ease),C=typeof d.repeat=="number"?Math.max(0,d.repeat|0):0,b=d.yoyo===!0,f=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),y=[];for(let k of Object.keys(d)){if(f.has(k))continue;let L=d[k];typeof L=="number"&&y.push({key:k,from:Ja(u,k),to:L})}let w=An(u,d);return{target:u,startMs:wt(),delayMs:h,durationMs:g,ease:m,props:y,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=wt())},resume:()=>{var m;if(!p.paused)return;let g=(m=p.pauseAtMs)!=null?m:wt(),h=wt()-g;p.startMs+=h,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 h=d[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof h=="number"&&En(u,g,h)}let p=An(u,d);p.to&&Cn(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,h=[],m=f=>{if(typeof f=="number")return Math.max(0,f*1e3);let y=typeof f=="string"?f.trim():"";return y.startsWith("+=")?p+Math.max(0,Number(y.slice(2))*1e3||0):y?Math.max(0,Number(y)*1e3||0):p},C=f=>{d.push(f);let y=Math.max(0,(typeof f.vars.duration=="number"?f.vars.duration:.5)*1e3);p=Math.max(p,f.atMs+y)},b={to(f,y,w){return C({kind:"to",target:f,vars:y,atMs:m(w)}),b},fromTo(f,y,w,x){return C({kind:"fromTo",target:f,vars:w,from:y,atMs:m(x)}),b},play(){var f,y;if(g)return b;g=!0,h=[];for(let w of d)w.kind==="fromTo"&&l.set(w.target,(f=w.from)!=null?f:{}),h.push(l.to(w.target,{...w.vars,delay:w.atMs/1e3+((y=w.vars.delay)!=null?y:0)}));return b},pause(){for(let f of h)f.pause();return b},kill(){for(let f of h)f.kill();h=[],g=!1}};return u.paused||b.play(),b}};return l}function Tn(){if(typeof window=="undefined")return;let i=window;if(!i.gsap)try{i.gsap=Ln()}catch{}}var In={name:"handler-playable-sdk",version:"1.0.101",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 te=0,es=te++,kn=te++,Pn=te++,Mn=te++,jn=te++,_n=te++,On=te++,Rn=te++,zn=te++,$n=te++,Dn=te++,Nn=te++,j=es;function Hn(){return j===kn}function Fn(){return j===Pn}function Bn(){return j===Mn}function Gn(){return j===jn}function We(){return j===_n}function Ke(){return j===On}function Un(){return j===Rn}function qn(){return j===zn}function Vn(){return j===$n}function ui(){return j===Dn}function gi(){return j===Nn}function Yn(){let i=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(i==="mraid")try{mraid.getState(),j=kn;return}catch{}else if(i==="dapi")try{dapi.isReady(),j=Pn;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(j=Mn)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(j=jn)}catch{}else if(e==="mintegral")window.gameReady&&(j=_n);else if(e==="tapjoy")window.TJ_API&&(j=On);else if(e==="tiktok")window.openAppStore&&(j=Rn);else if(e==="smadex")try{window.smxTracking&&(j=zn)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(j=$n)}catch{}else e==="vungle"?j=Dn:(i==="nucleo"||e==="nucleo")&&(j=Nn)}var Dt=ci(require("lottie-web"),1),Wn=Dt.default;typeof window!="undefined"&&(window.lottie=Dt.default,window.__baseLottie=Dt.default);mi();function D(i,e){let t=(a,s)=>s===0?a:t(s,a%s),n=t(i,e);return`${i/n}:${e/n}`}var Wr=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:D(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:D(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:D(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:D(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:D(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:D(360,780)}],Kr=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:D(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:D(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:D(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:D(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:D(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:D(412,915)}],Xr=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:D(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:D(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:D(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:D(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:D(800,1280)}],Zn=[{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:D(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:D(768,1024),mraidScale:.7}];var Jr=[...Zn];var ls=Zn[0];de();var ta=require("pixi.js"),fe={width:400,height:600,designWidth:400,scaleFactor:1},St={scale:1,position:1},Bt=[];function ds(i,e,t,n,a,s,r){Bt.push({element:i,originalScale:s,positionHelper:e,heightPercent:a}),e(i,t,n,a,s,r,!1)}function ps(){Bt.forEach(({element:i,originalScale:e,positionHelper:t,heightPercent:n})=>{let a=e*fe.scaleFactor;t(i,fe.width,fe.height,n,a,!0,!1)})}function ia(){Bt.length=0,console.log("[LAYOUT] Cleared all responsive elements")}function Ht(i,e){console.log(`[SCREEN] updateScreenState called: ${i}x${e}`),fe.width=i,fe.height=e,fe.scaleFactor=Math.min(i/fe.designWidth,1.15),St.scale=fe.scaleFactor,St.position=1,console.log(`[SCREEN] Global multipliers - scale: ${St.scale.toFixed(3)}`),ps()}var _={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 us(i,e,t){let n=_[i];n&&n[e]!==void 0&&(n[e]=t,console.log(`Updated ${i}.${e} = ${t}`))}function gs(){return _}var hs={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 Nt(i,e){return typeof i=="number"&&Number.isFinite(i)?i:e}function Te(i,e={x:.5,y:.5}){var t;if(Array.isArray(i))return{x:Nt(i[0],e.x),y:Nt(i[1],e.y)};if(i&&typeof i=="object"){let n=i;return{x:Nt(n.x,e.x),y:Nt(n.y,e.y)}}if(typeof i=="string"){let n=i.trim().toLowerCase();return(t=hs[n])!=null?t:e}return e}function De(i,e,t,n={}){var g,h,m,C,b,f;let a=Te(t),s=(g=n.inset)!=null?g:{},r=(h=n.padding)!=null?h:{x:0,y:0},o=((m=s.left)!=null?m:0)+r.x,c=((C=s.right)!=null?C:0)+r.x,l=((b=s.top)!=null?b:0)+r.y,u=((f=s.bottom)!=null?f:0)+r.y,d=Math.max(0,i-o-c),p=Math.max(0,e-l-u);return{x:o+d*a.x,y:l+p*a.y}}function Ne(i,e,t,n={}){var m,C,b,f,y,w;let a=(m=n.inset)!=null?m:{},s=(C=n.padding)!=null?C:{x:0,y:0},r=((b=a.left)!=null?b:0)+s.x,o=((f=a.right)!=null?f:0)+s.x,c=((y=a.top)!=null?y:0)+s.y,l=((w=a.bottom)!=null?w:0)+s.y,u=Math.max(0,i-r-o),d=Math.max(0,e-c-l),p=Te(t,{x:.5,y:.5}),g=Math.min(Math.max(p.x,0),1),h=Math.min(Math.max(p.y,0),1);return{x:r+u*g,y:c+d*h}}function Ft(i,e,t,n={}){var u,d,p;if(!i)return;let a=n.positionRatio?Ne(e,t,n.positionRatio,{inset:n.inset,padding:n.screenPadding}):De(e,t,n.anchor,{inset:n.inset,padding:n.screenPadding}),s=(u=n.offset)!=null?u:{x:0,y:0},r=a.x+s.x,o=a.y+s.y;i.anchor&&n.renderAnchor&&i.anchor.set(n.renderAnchor.x,n.renderAnchor.y),se(i,r,o);let c=(d=n.scale)!=null?d:1,l=(p=n.scaleMultiplier)!=null?p:1;(n.scale!==void 0||n.scaleMultiplier!==void 0)&&pe(i,c*l)}if(typeof window!="undefined"){let i=window.innerWidth,e=window.innerHeight,t=()=>{let n=window.innerWidth,a=window.innerHeight;(n!==i||a!==e)&&(i=n,e=a,Ht(n,a))};window.addEventListener("resize",t),window.addEventListener("orientationchange",()=>{setTimeout(t,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",t),window.mraid.addEventListener("sizeChange",t)),Ht(window.innerWidth,window.innerHeight),window.updateDebugConfig=us,window.getDebugConfig=gs,window.copyConfig=As,window.applyConfig=xt,window.applyConfigForRatio=Ls,window.positionAtBottom=na,window.positionAtTop=bs,window.positionAtCenter=ys,window.positionAtLeft=vs,window.positionAtRight=ws,window.positionAtBottomLeft=xs,window.positionAtBottomRight=Ss,window.positionAtTopLeft=Es,window.positionAtTopRight=Cs,window.applyPositionContract=ms,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 Gt(i,e,t=0){return i*e+t}function Ut(i,e,t=0){return i*(1-e)+t}function qt(i,e,t=0){return i*e+t}function Vt(i,e,t=0){return i*(1-e)+t}function ie(i,e=0){return i/2+e}function fs(i,e){return i*e}function ms(i,e,t,n){var r,o,c,l,u,d,p,g,h,m,C,b,f,y,w,x,k,L,B,R;let a=0,s=0;switch(n.type){case"top":a=ie(e,(o=(r=n.offset)==null?void 0:r.x)!=null?o:0),s=Gt(t,n.percent,(l=(c=n.offset)==null?void 0:c.y)!=null?l:0);break;case"bottom":a=ie(e,(d=(u=n.offset)==null?void 0:u.x)!=null?d:0),s=Ut(t,n.percent,(g=(p=n.offset)==null?void 0:p.y)!=null?g:0);break;case"left":a=qt(e,n.percent,(m=(h=n.offset)==null?void 0:h.x)!=null?m:0),s=ie(t,(b=(C=n.offset)==null?void 0:C.y)!=null?b:0);break;case"right":a=Vt(e,n.percent,(y=(f=n.offset)==null?void 0:f.x)!=null?y:0),s=ie(t,(x=(w=n.offset)==null?void 0:w.y)!=null?x:0);break;case"center":a=ie(e,(L=(k=n.offset)==null?void 0:k.x)!=null?L:0),s=ie(t,(R=(B=n.offset)==null?void 0:B.y)!=null?R:0);break}i.position?i.position.set(a,s):(i.x=a,i.y=s),n.scale!==void 0&&n.scale!==1&&i.scale&&(typeof i.scale.set=="function"?i.scale.set(n.scale,n.scale):(i.scale.x=n.scale,i.scale.y=n.scale))}function na(i,e,t,n=.2,a=1,s=!0,r=!1){let o=fs(t,n),c=Ut(t,n/2);se(i,ie(e),c);let l=s?a*fe.scaleFactor:a;pe(i,l),r&&!Bt.find(u=>u.element===i)&&ds(i,na,e,t,n,a,s)}function bs(i,e,t,n=.1,a=1){se(i,ie(e),Gt(t,n)),pe(i,a)}function ys(i,e,t,n=0,a=0,s=1){se(i,ie(e,n),ie(t,a)),pe(i,s)}function vs(i,e,t,n=.1,a=1){se(i,qt(e,n),ie(t)),pe(i,a)}function ws(i,e,t,n=.1,a=1){se(i,Vt(e,n),ie(t)),pe(i,a)}function xs(i,e,t,n=.05,a=.05,s=1){se(i,qt(e,a),Ut(t,n)),pe(i,s)}function Ss(i,e,t,n=.05,a=.05,s=1){se(i,Vt(e,a),Ut(t,n)),pe(i,s)}function Es(i,e,t,n=.05,a=.05,s=1){se(i,qt(e,a),Gt(t,n)),pe(i,s)}function Cs(i,e,t,n=.05,a=.05,s=1){se(i,Vt(e,a),Gt(t,n)),pe(i,s)}function se(i,e,t){i&&i.position?typeof i.position.set=="function"?i.position.set(e,t):(i.position.x=e,i.position.y=t):i&&(i.x=e,i.y=t)}function pe(i,e){e!==1&&i&&i.scale&&(typeof i.scale.set=="function"?i.scale.set(e,e):i.scale.x!==void 0&&i.scale.y!==void 0&&(i.scale.x=e,i.scale.y=e))}var $e={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 As(i){return i&&$e[i]?JSON.parse(JSON.stringify($e[i])):JSON.parse(JSON.stringify(_))}function xt(i){Object.keys(i).forEach(e=>{let t=e;_[t]&&i[t]&&Object.assign(_[t],i[t])}),console.log("Config applied:",i)}function Ls(i,e){let t=i/e;t>1.6?(xt($e.wide),console.log("Applied WIDE config for ratio:",t)):t<.7?(xt($e.tall),console.log("Applied TALL config for ratio:",t)):t>.8&&t<1.2?(xt($e.square),console.log("Applied SQUARE config for ratio:",t)):(xt($e.default),console.log("Applied DEFAULT config for ratio:",t))}if(typeof window!="undefined"){let i=window;i.configPresets=$e,i.resolveAnchorVec2=i.resolveAnchorVec2||Te,i.resolveScreenAnchorPoint=i.resolveScreenAnchorPoint||De,i.resolveScreenRatioPoint=i.resolveScreenRatioPoint||Ne}var K=null,ea=new Map;function aa(i,e,t,n,a,s={}){var Se,Ee,Ce,Ae,Y,_e,lt,ct,dt,pt,ut,gt,ht,ft,mt,bt,F,Z,U,Q,Ue,Oe,Bi,Gi,Ui,qi,Vi,Yi,Wi,Ki,Xi,Ji,Zi,Qi,en,tn,nn,an,sn,rn,on,ln,cn,dn,pn,un,gn,hn,fn;let r=(Se=s.enableDebugLogs)!=null?Se:!1;r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== STARTING LAYOUT CALCULATION ====="),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Screen dimensions:",{width:n.width,height:n.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Time:",t),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Options:",s));let{mainContainer:o,label:c,background:l,backgroundTexture:u,app:d}=i;if(!d||!d.renderer){r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] \u274C No app or renderer, skipping layout");return}r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] App renderer dimensions:",{width:d.renderer.width,height:d.renderer.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] App screen dimensions:",{width:d.screen.width,height:d.screen.height}));let p=n.width,g=n.height;r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Base dimensions:",{baseWidth:p,baseHeight:g});let h=p*_.layout.screen_scale_x,m=g*_.layout.screen_scale_y,C=p/2,b=e.engine.runtime||{},f=b.layout||{};r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug config:",{screen_scale_x:_.layout.screen_scale_x,screen_scale_y:_.layout.screen_scale_y}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Calculated dimensions:",{width:h,height:m,midX:C}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Engine runtime:",b),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Layout config:",f));let y=m>h,w=(Ee=f.design_width_portrait)!=null?Ee:y?400:600,x=(Ce=f.design_height_portrait)!=null?Ce:y?600:400,k=Math.min(h/w,m/x);k=Math.min(k,1.15);let L=k*((Ae=_.engine.scale)!=null?Ae:1),B=(Y=s.skipMainContainerTransform)!=null?Y:!1;!B&&o&&o.scale&&(typeof o.scale.set=="function"?o.scale.set(L):(o.scale.x=L,o.scale.y=L));let R=(_e=f.main_container_anchor)!=null?_e:"center",H=(lt=f.main_container_position_ratio)!=null?lt:{x:.5,y:.5},z=(ct=f.main_container_offset)!=null?ct:{x:0,y:0},T=f.main_container_position_ratio?Ne(p,g,H):De(p,g,R),E=T.x+z.x+_.layout.position_offset.x,S=T.y+z.y+_.layout.position_offset.y;if(!B&&o&&o.position&&(typeof o.position.set=="function"?o.position.set(E,S):(o.position.x=E,o.position.y=S)),a&&(o!=null&&o.toLocal)){let G=g>p,W=(dt=f.design_width_portrait)!=null?dt:G?320:480,N=(pt=f.design_height_portrait)!=null?pt:G?480:320;for(let[oe,le]of e.objects.entries()){let q=le==null?void 0:le.transform;if(!q||((ut=q.position_mode)!=null?ut:"static")!=="static")continue;let I=(gt=a.get)==null?void 0:gt.call(a,oe),yt=((ht=I==null?void 0:I.getDisplayObject)==null?void 0:ht.call(I))||(I==null?void 0:I.pixiObject)||I;if(!yt||yt.parent!==o)continue;let he=(ft=q.anchor)!=null?ft:"bottom-left";he==="bottom-left"&&q.anchor==null&&console.log("[DEBUG FALLBACK] LayoutManager transform.anchor \u2192 bottom-left");let qe=q.position_ratio!=null?Ne(W,N,q.position_ratio):De(W,N,he),Ve=(mt=q.position)!=null?mt:{x:0,y:0},vt=qe.x-W/2+Ve.x,Re=qe.y-N/2+Ve.y;typeof(I==null?void 0:I.setPosition)=="function"?I.setPosition(vt,Re):(se(yt,vt,Re),(bt=I==null?void 0:I.transform)!=null&&bt.position&&(I.transform.position.x=vt,I.transform.position.y=Re))}}let A=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,J=((A==null?void 0:A.buildMode)||(typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"dev"))==="dev";if(_.layout.debug_rect_visible&&J){(!K||K.parent!==d.stage)&&(K==null||K.destroy(),K=new ta.Graphics,K.zIndex=9999,d.stage.addChild(K)),K.clear();let G=_.layout.debug_rect_scale_x,W=_.layout.debug_rect_scale_y,N=(p-4)*G,oe=(g-4)*W,le=(p-N)/2,q=(g-oe)/2;r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== DEBUG RECT POSITIONING ====="),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug rect calculations:",{baseWidth:p,baseHeight:g,rectW:N,rectH:oe,offsetX:le,offsetY:q}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug rect final position:",{x:2+le,y:2+q,width:N,height:oe})),K.rect(2+le,2+q,N,oe).stroke({width:_.layout.debug_rect_thickness,color:_.layout.debug_rect_color})}else K&&(K.destroy(),K=null);let O=((F=i.label)==null?void 0:F.config)||e.objects.get("label_1")||e.objects.get("ui_tutorial_1");if(c&&c.position&&O){let G=(U=(Z=O==null?void 0:O.transform)==null?void 0:Z.anchor)!=null?U:"center",W=(Q=O==null?void 0:O.transform)==null?void 0:Q.position_ratio,N=((Ue=O==null?void 0:O.transform)==null?void 0:Ue.offset)||{x:0,y:0};Ft(c,p,g,{anchor:G,positionRatio:W,offset:{x:N.x*L,y:N.y*L},renderAnchor:Te(G)})}if(c&&c.alpha>0){let G=1+Math.sin(t*_.engine.label_pulse_speed)*_.engine.label_pulse_intensity,W=(Bi=(Oe=O==null?void 0:O.transform)==null?void 0:Oe.scale)!=null?Bi:1,N=G*L*W;c.scale&&(typeof c.scale.set=="function"?c.scale.set(N):(c.scale.x=N,c.scale.y=N))}r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== BACKGROUND POSITIONING =====");let ne=l?e.objects.get("background_1"):null,je=!!ne&&(l==null?void 0:l.parent)===o;if(l&&!je){r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background object exists:",!!l),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background type:",(Gi=l.constructor)==null?void 0:Gi.name)),l.alpha=((qi=(Ui=b.background)==null?void 0:Ui.alpha)!=null?qi:.98)*_.engine.background_alpha,r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background alpha set to:",l.alpha),r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background config:",ne);let G=(ne==null?void 0:ne.transform)||{};r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background transform:",G);let W=G.offset||{x:0,y:0},N=((Yi=(Vi=b.background)==null?void 0:Vi.offset_y)!=null?Yi:0)+_.engine.background_offset_y,oe=(Wi=G.anchor)!=null?Wi:"center",le=G.position_ratio;if(r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background positioning params:",{bgOffset:W,bgRuntimeOffsetY:N,bgScreenAnchor:oe,bgPositionRatio:le,baseWidth:p,baseHeight:g,finalScale:L}),Ft(l,p,g,{anchor:oe,positionRatio:le,offset:{x:W.x*L,y:W.y*L+N},renderAnchor:Te(oe)}),r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background position after applyScreenAnchor:",{x:l.x,y:l.y,scaleX:(Ki=l.scale)==null?void 0:Ki.x,scaleY:(Xi=l.scale)==null?void 0:Xi.y,anchorX:(Ji=l.anchor)==null?void 0:Ji.x,anchorY:(Zi=l.anchor)==null?void 0:Zi.y,pivotX:(Qi=l.pivot)==null?void 0:Qi.x,pivotY:(en=l.pivot)==null?void 0:en.y,width:l.width,height:l.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background texture dimensions:",{textureWidth:u==null?void 0:u.width,textureHeight:u==null?void 0:u.height})),u){let qe=Math.max(h/u.width,m/u.height),Ve=(nn=(tn=b.background)==null?void 0:tn.scale_multiplier)!=null?nn:1.05,vt=(an=G.scale)!=null?an:1,Re=qe*Ve*_.engine.background_scale*vt;l.scale&&(typeof l.scale.set=="function"?l.scale.set(Re):(l.scale.x=Re,l.scale.y=Re))}else l&&typeof l.clear=="function"&&(l.clear(),l.rect(-h/2,-m/2,h,m).fill({color:1444375}));let q=`${p}x${g}`,P=ea.get(q),I={x:Number((sn=l.x)!=null?sn:0),y:Number((rn=l.y)!=null?rn:0),scaleX:Number((ln=(on=l.scale)==null?void 0:on.x)!=null?ln:1),scaleY:Number((dn=(cn=l.scale)==null?void 0:cn.y)!=null?dn:1),rotation:Number.isFinite(l.rotation)?l.rotation:void 0,anchorX:Number.isFinite((pn=l.anchor)==null?void 0:pn.x)?l.anchor.x:void 0,anchorY:Number.isFinite((un=l.anchor)==null?void 0:un.y)?l.anchor.y:void 0,pivotX:Number.isFinite((gn=l.pivot)==null?void 0:gn.x)?l.pivot.x:void 0,pivotY:Number.isFinite((hn=l.pivot)==null?void 0:hn.y)?l.pivot.y:void 0},yt=Number.isFinite(I.x)&&Number.isFinite(I.y)&&Number.isFinite(I.scaleX)&&Number.isFinite(I.scaleY),he=I;if(P){let qe=Math.hypot(I.x-P.x,I.y-P.y),Ve=Math.max(p,g)*.5;(!yt||qe>Ve)&&((fn=l.position)!=null&&fn.set?l.position.set(P.x,P.y):(l.x=P.x,l.y=P.y),l.scale&&(typeof l.scale.set=="function"?l.scale.set(P.scaleX,P.scaleY):(l.scale.x=P.scaleX,l.scale.y=P.scaleY)),Number.isFinite(P.rotation)&&typeof l.rotation=="number"&&(l.rotation=P.rotation),l.anchor&&Number.isFinite(P.anchorX)&&Number.isFinite(P.anchorY)&&l.anchor.set(P.anchorX,P.anchorY),l.pivot&&Number.isFinite(P.pivotX)&&Number.isFinite(P.pivotY)&&l.pivot.set(P.pivotX,P.pivotY),he=P)}Number.isFinite(he.x)&&Number.isFinite(he.y)&&Number.isFinite(he.scaleX)&&Number.isFinite(he.scaleY)&&ea.set(q,he)}}function Ts(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 Is(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 ks(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 yi(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 Ts(a),r=await ks(s),o=Is(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 Yt(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],h=r[d+2],m=!1;for(let C of c)if(Math.sqrt(Math.pow(p-C.r,2)+Math.pow(g-C.g,2)+Math.pow(h-C.b,2))<e){m=!0;break}m&&(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 sa=require("@google/genai");async function vi(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 f=t[b];if(!f.base64||!f.mimeType)throw new Error(`Image ${b+1} is missing required data`);if(f.base64.length<1e3&&console.warn(`Image ${b+1} data appears very small, may be corrupted`),!f.mimeType.startsWith("image/"))throw new Error(`Image ${b+1} has invalid MIME type: ${f.mimeType}`)}let d=new sa.GoogleGenAI({apiKey:i}),p="gemini-2.5-flash",g=[e];t.length>0&&t.forEach((b,f)=>{g.push({inlineData:{data:b.base64,mimeType:b.mimeType}}),console.log(`[Gemini] Added image ${f+1}: ${b.mimeType}, size: ${Math.round(b.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${t.length} images and prompt length: ${e.length}`);let h=await d.models.generateContent({model:p,contents:g}),m="",C=(r=(s=(a=h.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&&(m+=b.text);if(!m.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${m.length}`),m}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 ra=require("@google/genai");async function Wt(i,e,t=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new ra.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 Rs=require("pixi.js");Et();Kt();de();var ua=require("pixi.js");var $s=require("pixi.js");de();function Ws(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 Ks(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 Xs(i){return`
97
+ `,this.modal=e,this.attachEventListeners(),this.initializeCanvas()}initializeCanvas(){this.modal&&(this.canvas=this.modal.querySelector(".asset-crop-canvas"),this.canvas&&(this.ctx=this.canvas.getContext("2d"),this.canvas.width=400,this.canvas.height=300))}loadImage(){this.options&&(this.image=new Image,this.image.crossOrigin="anonymous",this.image.onload=()=>{this.image&&this.image.naturalWidth>0&&this.image.naturalHeight>0?(console.log("[AssetCropModal] Image loaded:",this.image.naturalWidth,"x",this.image.naturalHeight),this.initializeCrop(),this.render()):(console.error("[AssetCropModal] Image loaded but invalid dimensions"),this.showError("Failed to load image"))},this.image.onerror=e=>{console.error("[AssetCropModal] Image load error:",e),this.showError("Failed to load image. Please check the image URL.")},this.image.src=this.options.imageSrc,this.canvas&&this.ctx&&(this.ctx.fillStyle="rgba(128, 128, 128, 0.3)",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height),this.ctx.fillStyle="rgba(255, 255, 255, 0.7)",this.ctx.font="14px sans-serif",this.ctx.textAlign="center",this.ctx.fillText("Loading image...",this.canvas.width/2,this.canvas.height/2)))}showError(e){var n;if(!this.canvas||!this.ctx)return;this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.ctx.fillStyle="rgba(255, 0, 0, 0.2)",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height),this.ctx.fillStyle="#ff4444",this.ctx.font="14px sans-serif",this.ctx.textAlign="center",this.ctx.fillText(e,this.canvas.width/2,this.canvas.height/2);let t=(n=this.modal)==null?void 0:n.querySelector(".asset-crop-preview-canvas");if(t){let a=t.getContext("2d");a&&(a.fillStyle="rgba(255, 0, 0, 0.2)",a.fillRect(0,0,t.width,t.height))}}initializeCrop(){var n;if(!this.image||!this.canvas)return;let e=this.image.width/this.image.height,t=this.canvas.width/this.canvas.height;e>t?(this.cropHeight=this.image.height,this.cropWidth=this.cropHeight*t,this.cropX=(this.image.width-this.cropWidth)/2,this.cropY=0):(this.cropWidth=this.image.width,this.cropHeight=this.cropWidth/t,this.cropX=0,this.cropY=(this.image.height-this.cropHeight)/2),(n=this.options)!=null&&n.aspectRatio&&this.applyAspectRatio(this.options.aspectRatio),this.fitToCanvas()}applyAspectRatio(e){if(!this.image)return;let t=this.image.width/this.image.height,n=this.cropX+this.cropWidth/2,a=this.cropY+this.cropHeight/2;e>t?(this.cropWidth=Math.min(this.image.width,this.cropHeight*e),this.cropHeight=this.cropWidth/e):(this.cropHeight=Math.min(this.image.height,this.cropWidth/e),this.cropWidth=this.cropHeight*e),this.cropX=Math.max(0,Math.min(this.image.width-this.cropWidth,n-this.cropWidth/2)),this.cropY=Math.max(0,Math.min(this.image.height-this.cropHeight,a-this.cropHeight/2))}fitToCanvas(){if(!this.image||!this.canvas)return;let e=this.canvas.width/this.cropWidth,t=this.canvas.height/this.cropHeight;this.scale=Math.min(e,t)*.9,this.panX=(this.canvas.width-this.cropWidth*this.scale)/2,this.panY=(this.canvas.height-this.cropHeight*this.scale)/2}render(){if(!(!this.ctx||!this.canvas)){if(!this.image||!this.image.complete||this.image.naturalWidth===0||this.image.naturalHeight===0){console.warn("[AssetCropModal] Image not ready for rendering"),this.showError("Image not loaded");return}this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);try{this.ctx.save(),this.ctx.translate(this.panX,this.panY),this.ctx.scale(this.scale,this.scale),this.ctx.drawImage(this.image,-this.cropX,-this.cropY,this.image.width,this.image.height),this.ctx.restore()}catch(e){console.error("[AssetCropModal] Error drawing image:",e),this.showError("Error drawing image");return}this.drawCropOverlay(),this.updatePreview()}}drawCropOverlay(){if(!this.ctx||!this.canvas)return;let e=this.panX,t=this.panY,n=this.cropWidth*this.scale,a=this.cropHeight*this.scale;this.ctx.fillStyle="rgba(0, 0, 0, 0.5)",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height),this.ctx.clearRect(e,t,n,a),this.ctx.strokeStyle="#ffffff",this.ctx.lineWidth=2,this.ctx.strokeRect(e,t,n,a),this.ctx.fillStyle="#ffffff";let s=8;[[e,t],[e+n-s,t],[e,t+a-s],[e+n-s,t+a-s]].forEach(([o,c])=>{var l;(l=this.ctx)==null||l.fillRect(o,c,s,s)})}updatePreview(){if(!this.modal||!this.image||!this.image.complete||this.image.naturalWidth===0||this.image.naturalHeight===0)return;let e=this.modal.querySelector(".asset-crop-preview-canvas");if(!e)return;let t=e.getContext("2d");if(!t)return;let n=150;e.width=n,e.height=n,t.clearRect(0,0,n,n);let a=n/this.cropWidth,s=n/this.cropHeight,r=Math.min(a,s),o=this.cropWidth*r,c=this.cropHeight*r,l=(n-o)/2,u=(n-c)/2;try{t.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,l,u,o,c)}catch(d){console.error("[AssetCropModal] Error drawing preview:",d),t.fillStyle="rgba(255, 0, 0, 0.2)",t.fillRect(0,0,n,n)}}attachEventListeners(){if(!this.modal||!this.canvas)return;this.canvas.addEventListener("mousedown",this.handleMouseDown.bind(this)),this.canvas.addEventListener("mousemove",this.handleMouseMove.bind(this)),this.canvas.addEventListener("mouseup",this.handleMouseUp.bind(this)),this.canvas.addEventListener("wheel",this.handleWheel.bind(this)),this.canvas.addEventListener("touchstart",this.handleTouchStart.bind(this)),this.canvas.addEventListener("touchmove",this.handleTouchMove.bind(this)),this.canvas.addEventListener("touchend",this.handleTouchEnd.bind(this));let e=this.modal.querySelector(".asset-crop-zoom-slider");e==null||e.addEventListener("input",n=>{let a=parseFloat(n.target.value);this.setZoom(a)});let t=this.modal.querySelector(".asset-crop-aspect-select");t==null||t.addEventListener("change",n=>{let a=n.target.value;this.setAspectRatio(a)}),this.modal.addEventListener("click",n=>{switch(n.target.dataset.action){case"reset":this.reset();break;case"apply":this.applyCrop();break;case"cancel":case"close":this.close();break}}),this.modal.addEventListener("click",n=>{n.target===this.modal&&this.close()})}handleMouseDown(e){this.isDragging=!0,this.dragStartX=e.clientX,this.dragStartY=e.clientY,this.lastPanX=this.panX,this.lastPanY=this.panY,this.canvas.style.cursor="grabbing"}handleMouseMove(e){if(!this.isDragging)return;let t=e.clientX-this.dragStartX,n=e.clientY-this.dragStartY;this.panX=this.lastPanX+t,this.panY=this.lastPanY+n,this.constrainPan(),this.render()}handleMouseUp(){this.isDragging=!1,this.canvas.style.cursor="grab"}handleWheel(e){e.preventDefault();let t=e.deltaY>0?.9:1.1;this.setZoom(this.scale*t)}handleTouchStart(e){e.touches.length===1&&(this.isDragging=!0,this.dragStartX=e.touches[0].clientX,this.dragStartY=e.touches[0].clientY,this.lastPanX=this.panX,this.lastPanY=this.panY)}handleTouchMove(e){if(!this.isDragging||e.touches.length!==1)return;e.preventDefault();let t=e.touches[0].clientX-this.dragStartX,n=e.touches[0].clientY-this.dragStartY;this.panX=this.lastPanX+t,this.panY=this.lastPanY+n,this.constrainPan(),this.render()}handleTouchEnd(){this.isDragging=!1}setZoom(e){this.scale=Math.max(.1,Math.min(3,e)),this.updateZoomUI(),this.constrainPan(),this.render()}setAspectRatio(e){let t;switch(e){case"1:1":t=1;break;case"4:3":t=4/3;break;case"16:9":t=16/9;break;case"3:2":t=3/2;break;default:t=void 0}t&&this.applyAspectRatio(t),this.fitToCanvas(),this.render()}updateZoomUI(){if(!this.modal)return;let e=this.modal.querySelector(".asset-crop-zoom-value"),t=this.modal.querySelector(".asset-crop-zoom-slider");e&&(e.textContent=`${this.scale.toFixed(1)}x`),t&&(t.value=this.scale.toString())}constrainPan(){if(!this.canvas)return;let e=this.cropWidth*this.scale,t=this.cropHeight*this.scale;this.panX=Math.max(this.canvas.width-e,Math.min(0,this.panX)),this.panY=Math.max(this.canvas.height-t,Math.min(0,this.panY))}reset(){this.initializeCrop(),this.render()}applyCrop(){var a;if(!this.image||!((a=this.options)!=null&&a.onCrop))return;let e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return;e.width=this.cropWidth,e.height=this.cropHeight,t.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,0,0,this.cropWidth,this.cropHeight);let n=e.toDataURL("image/png");this.options.onCrop(n),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal);let e=this.options;this.modal=null,this.canvas=null,this.ctx=null,this.image=null,this.options=null,e!=null&&e.onCancel&&e.onCancel()}};window.openAssetCrop=function(i){new Pi().open(i)}});var fr={};mn(fr,{AssetCache:()=>re,AssetLoader:()=>ke,AssetSystem:()=>li,AssetTextures:()=>Pe,Assets:()=>Fa,BaseSystem:()=>rt,GameEngine:()=>oi,GameObject:()=>Ot,GameObjectManager:()=>at,ObjectFactory:()=>ye,Renderer:()=>_t,RuntimeObjectRegistry:()=>ot,Transform:()=>jt,applyScreenAnchor:()=>Ft,basePixi:()=>$a,clearResponsiveElements:()=>ia,createPixiBase:()=>si,getRegisteredFontIds:()=>_a,globalResponsiveMultipliers:()=>St,initAssetTextures:()=>Zt,initAssets:()=>Ba,layout:()=>aa,playLottieOverlay:()=>Ra,registerFont:()=>ja,registerType:()=>Xt,resolveAnchorVec2:()=>Te,resolveFont:()=>Pa,resolveFontWeight:()=>Ma,resolveScreenAnchorPoint:()=>De,resolveScreenRatioPoint:()=>Ne,runInitSequence:()=>Ga,setLottieInstance:()=>Qt,spawnSceneFromConfig:()=>Na,updateScreenState:()=>Ht});module.exports=Ka(fr);var ka=require("pixi.js");var Le={};function zt(i,e,t=!1){Le[i]||(Le[i]=[]),Le[i].push({fn:e,once:t})}function di(i,e){if(Le[i]){if(!e){delete Le[i];return}Le[i]=Le[i].filter(t=>t.fn!==e)}}function $t(i,...e){let t=Le[i];if(t)for(let n of[...t])n.fn(...e),n.once&&di(i,n.fn)}function ee(i,e){zt(i,e,!0)}var $=null,ae=[],Ye=null;function wn(i){$=i,ae=[],Ye!==null&&(clearTimeout(Ye),Ye=null)}function xn(){var i,e,t;return{endpoint:($==null?void 0:$.endpoint)||"",transport:($==null?void 0:$.transport)||"beacon",batchSize:(i=$==null?void 0:$.batchSize)!=null?i:10,flushIntervalMs:(e=$==null?void 0:$.flushIntervalMs)!=null?e:300,maxQueue:(t=$==null?void 0:$.maxQueue)!=null?t:200,debug:!!($!=null&&$.debug)}}async function yn(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 pi(i,e){let t=xn();if(e&&t.endpoint){if(ae.push(i),ae.length>t.maxQueue&&(ae=ae.slice(ae.length-t.maxQueue)),ae.length>=t.batchSize){vn();return}Ye===null&&(Ye=window.setTimeout(()=>{Ye=null,vn()},t.flushIntervalMs))}}async function vn(){let i=xn();if(!i.endpoint||ae.length===0)return;let e=ae.splice(0,i.batchSize);await yn(i.endpoint,{events:e},i.transport,i.debug),ae.length>0&&await yn(i.endpoint,{events:ae.splice(0,i.batchSize)},i.transport,i.debug)}function Sn(i){return Math.max(0,Math.min(1,i))}function Xa(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 wt(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ja(i,e){let t=i==null?void 0:i[e];return typeof t=="number"?t:0}function En(i,e,t){try{i[e]=t}catch{}}function Za(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 Cn(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 An(i,e){let t=Za(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 Ln(){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=wt();for(let g of Array.from(i)){if(g.killed||g.paused)continue;let h=u-g.startMs-g.delayMs;if(h<0)continue;let m=g.durationMs>0?h/g.durationMs:1,C=Sn(m),b=g.repeat>=0?g.repeat+1:1,f=g.repeat>0?Math.min(Math.floor(m),b-1):0;if(g.repeat>0&&m>=1){let x=m-f;C=Sn(x)}let y=g.ease(C);g.yoyo&&f%2===1&&(y=1-y);for(let x of g.props)En(g.target,x.key,x.from+(x.to-x.from)*y);g.scaleFrom&&g.scaleTo&&Cn(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*y,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*y});try{(d=g.onUpdate)==null||d.call(g)}catch{}if(m>=b){r(g);try{(p=g.onComplete)==null||p.call(g)}catch{}}}},c=(u,d,p)=>{var x;let g=Math.max(0,(typeof d.duration=="number"?d.duration:.5)*1e3),h=Math.max(0,(typeof d.delay=="number"?d.delay:0)*1e3+((x=p==null?void 0:p.delayMsOverride)!=null?x:0)),m=Xa(d.ease),C=typeof d.repeat=="number"?Math.max(0,d.repeat|0):0,b=d.yoyo===!0,f=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),y=[];for(let k of Object.keys(d)){if(f.has(k))continue;let L=d[k];typeof L=="number"&&y.push({key:k,from:Ja(u,k),to:L})}let w=An(u,d);return{target:u,startMs:wt(),delayMs:h,durationMs:g,ease:m,props:y,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=wt())},resume:()=>{var m;if(!p.paused)return;let g=(m=p.pauseAtMs)!=null?m:wt(),h=wt()-g;p.startMs+=h,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 h=d[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof h=="number"&&En(u,g,h)}let p=An(u,d);p.to&&Cn(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,h=[],m=f=>{if(typeof f=="number")return Math.max(0,f*1e3);let y=typeof f=="string"?f.trim():"";return y.startsWith("+=")?p+Math.max(0,Number(y.slice(2))*1e3||0):y?Math.max(0,Number(y)*1e3||0):p},C=f=>{d.push(f);let y=Math.max(0,(typeof f.vars.duration=="number"?f.vars.duration:.5)*1e3);p=Math.max(p,f.atMs+y)},b={to(f,y,w){return C({kind:"to",target:f,vars:y,atMs:m(w)}),b},fromTo(f,y,w,x){return C({kind:"fromTo",target:f,vars:w,from:y,atMs:m(x)}),b},play(){var f,y;if(g)return b;g=!0,h=[];for(let w of d)w.kind==="fromTo"&&l.set(w.target,(f=w.from)!=null?f:{}),h.push(l.to(w.target,{...w.vars,delay:w.atMs/1e3+((y=w.vars.delay)!=null?y:0)}));return b},pause(){for(let f of h)f.pause();return b},kill(){for(let f of h)f.kill();h=[],g=!1}};return u.paused||b.play(),b}};return l}function Tn(){if(typeof window=="undefined")return;let i=window;if(!i.gsap)try{i.gsap=Ln()}catch{}}var In={name:"handler-playable-sdk",version:"1.0.103",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 te=0,es=te++,kn=te++,Pn=te++,Mn=te++,jn=te++,_n=te++,On=te++,Rn=te++,zn=te++,$n=te++,Dn=te++,Nn=te++,j=es;function Hn(){return j===kn}function Fn(){return j===Pn}function Bn(){return j===Mn}function Gn(){return j===jn}function We(){return j===_n}function Ke(){return j===On}function Un(){return j===Rn}function qn(){return j===zn}function Vn(){return j===$n}function ui(){return j===Dn}function gi(){return j===Nn}function Yn(){let i=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(i==="mraid")try{mraid.getState(),j=kn;return}catch{}else if(i==="dapi")try{dapi.isReady(),j=Pn;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(j=Mn)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(j=jn)}catch{}else if(e==="mintegral")window.gameReady&&(j=_n);else if(e==="tapjoy")window.TJ_API&&(j=On);else if(e==="tiktok")window.openAppStore&&(j=Rn);else if(e==="smadex")try{window.smxTracking&&(j=zn)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(j=$n)}catch{}else e==="vungle"?j=Dn:(i==="nucleo"||e==="nucleo")&&(j=Nn)}var Dt=ci(require("lottie-web"),1),Wn=Dt.default;typeof window!="undefined"&&(window.lottie=Dt.default,window.__baseLottie=Dt.default);mi();function D(i,e){let t=(a,s)=>s===0?a:t(s,a%s),n=t(i,e);return`${i/n}:${e/n}`}var Wr=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:D(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:D(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:D(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:D(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:D(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:D(360,780)}],Kr=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:D(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:D(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:D(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:D(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:D(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:D(412,915)}],Xr=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:D(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:D(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:D(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:D(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:D(800,1280)}],Zn=[{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:D(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:D(768,1024),mraidScale:.7}];var Jr=[...Zn];var ls=Zn[0];de();var ta=require("pixi.js"),fe={width:400,height:600,designWidth:400,scaleFactor:1},St={scale:1,position:1},Bt=[];function ds(i,e,t,n,a,s,r){Bt.push({element:i,originalScale:s,positionHelper:e,heightPercent:a}),e(i,t,n,a,s,r,!1)}function ps(){Bt.forEach(({element:i,originalScale:e,positionHelper:t,heightPercent:n})=>{let a=e*fe.scaleFactor;t(i,fe.width,fe.height,n,a,!0,!1)})}function ia(){Bt.length=0,console.log("[LAYOUT] Cleared all responsive elements")}function Ht(i,e){console.log(`[SCREEN] updateScreenState called: ${i}x${e}`),fe.width=i,fe.height=e,fe.scaleFactor=Math.min(i/fe.designWidth,1.15),St.scale=fe.scaleFactor,St.position=1,console.log(`[SCREEN] Global multipliers - scale: ${St.scale.toFixed(3)}`),ps()}var _={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 us(i,e,t){let n=_[i];n&&n[e]!==void 0&&(n[e]=t,console.log(`Updated ${i}.${e} = ${t}`))}function gs(){return _}var hs={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 Nt(i,e){return typeof i=="number"&&Number.isFinite(i)?i:e}function Te(i,e={x:.5,y:.5}){var t;if(Array.isArray(i))return{x:Nt(i[0],e.x),y:Nt(i[1],e.y)};if(i&&typeof i=="object"){let n=i;return{x:Nt(n.x,e.x),y:Nt(n.y,e.y)}}if(typeof i=="string"){let n=i.trim().toLowerCase();return(t=hs[n])!=null?t:e}return e}function De(i,e,t,n={}){var g,h,m,C,b,f;let a=Te(t),s=(g=n.inset)!=null?g:{},r=(h=n.padding)!=null?h:{x:0,y:0},o=((m=s.left)!=null?m:0)+r.x,c=((C=s.right)!=null?C:0)+r.x,l=((b=s.top)!=null?b:0)+r.y,u=((f=s.bottom)!=null?f:0)+r.y,d=Math.max(0,i-o-c),p=Math.max(0,e-l-u);return{x:o+d*a.x,y:l+p*a.y}}function Ne(i,e,t,n={}){var m,C,b,f,y,w;let a=(m=n.inset)!=null?m:{},s=(C=n.padding)!=null?C:{x:0,y:0},r=((b=a.left)!=null?b:0)+s.x,o=((f=a.right)!=null?f:0)+s.x,c=((y=a.top)!=null?y:0)+s.y,l=((w=a.bottom)!=null?w:0)+s.y,u=Math.max(0,i-r-o),d=Math.max(0,e-c-l),p=Te(t,{x:.5,y:.5}),g=Math.min(Math.max(p.x,0),1),h=Math.min(Math.max(p.y,0),1);return{x:r+u*g,y:c+d*h}}function Ft(i,e,t,n={}){var u,d,p;if(!i)return;let a=n.positionRatio?Ne(e,t,n.positionRatio,{inset:n.inset,padding:n.screenPadding}):De(e,t,n.anchor,{inset:n.inset,padding:n.screenPadding}),s=(u=n.offset)!=null?u:{x:0,y:0},r=a.x+s.x,o=a.y+s.y;i.anchor&&n.renderAnchor&&i.anchor.set(n.renderAnchor.x,n.renderAnchor.y),se(i,r,o);let c=(d=n.scale)!=null?d:1,l=(p=n.scaleMultiplier)!=null?p:1;(n.scale!==void 0||n.scaleMultiplier!==void 0)&&pe(i,c*l)}if(typeof window!="undefined"){let i=window.innerWidth,e=window.innerHeight,t=()=>{let n=window.innerWidth,a=window.innerHeight;(n!==i||a!==e)&&(i=n,e=a,Ht(n,a))};window.addEventListener("resize",t),window.addEventListener("orientationchange",()=>{setTimeout(t,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",t),window.mraid.addEventListener("sizeChange",t)),Ht(window.innerWidth,window.innerHeight),window.updateDebugConfig=us,window.getDebugConfig=gs,window.copyConfig=As,window.applyConfig=xt,window.applyConfigForRatio=Ls,window.positionAtBottom=na,window.positionAtTop=bs,window.positionAtCenter=ys,window.positionAtLeft=vs,window.positionAtRight=ws,window.positionAtBottomLeft=xs,window.positionAtBottomRight=Ss,window.positionAtTopLeft=Es,window.positionAtTopRight=Cs,window.applyPositionContract=ms,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 Gt(i,e,t=0){return i*e+t}function Ut(i,e,t=0){return i*(1-e)+t}function qt(i,e,t=0){return i*e+t}function Vt(i,e,t=0){return i*(1-e)+t}function ie(i,e=0){return i/2+e}function fs(i,e){return i*e}function ms(i,e,t,n){var r,o,c,l,u,d,p,g,h,m,C,b,f,y,w,x,k,L,B,R;let a=0,s=0;switch(n.type){case"top":a=ie(e,(o=(r=n.offset)==null?void 0:r.x)!=null?o:0),s=Gt(t,n.percent,(l=(c=n.offset)==null?void 0:c.y)!=null?l:0);break;case"bottom":a=ie(e,(d=(u=n.offset)==null?void 0:u.x)!=null?d:0),s=Ut(t,n.percent,(g=(p=n.offset)==null?void 0:p.y)!=null?g:0);break;case"left":a=qt(e,n.percent,(m=(h=n.offset)==null?void 0:h.x)!=null?m:0),s=ie(t,(b=(C=n.offset)==null?void 0:C.y)!=null?b:0);break;case"right":a=Vt(e,n.percent,(y=(f=n.offset)==null?void 0:f.x)!=null?y:0),s=ie(t,(x=(w=n.offset)==null?void 0:w.y)!=null?x:0);break;case"center":a=ie(e,(L=(k=n.offset)==null?void 0:k.x)!=null?L:0),s=ie(t,(R=(B=n.offset)==null?void 0:B.y)!=null?R:0);break}i.position?i.position.set(a,s):(i.x=a,i.y=s),n.scale!==void 0&&n.scale!==1&&i.scale&&(typeof i.scale.set=="function"?i.scale.set(n.scale,n.scale):(i.scale.x=n.scale,i.scale.y=n.scale))}function na(i,e,t,n=.2,a=1,s=!0,r=!1){let o=fs(t,n),c=Ut(t,n/2);se(i,ie(e),c);let l=s?a*fe.scaleFactor:a;pe(i,l),r&&!Bt.find(u=>u.element===i)&&ds(i,na,e,t,n,a,s)}function bs(i,e,t,n=.1,a=1){se(i,ie(e),Gt(t,n)),pe(i,a)}function ys(i,e,t,n=0,a=0,s=1){se(i,ie(e,n),ie(t,a)),pe(i,s)}function vs(i,e,t,n=.1,a=1){se(i,qt(e,n),ie(t)),pe(i,a)}function ws(i,e,t,n=.1,a=1){se(i,Vt(e,n),ie(t)),pe(i,a)}function xs(i,e,t,n=.05,a=.05,s=1){se(i,qt(e,a),Ut(t,n)),pe(i,s)}function Ss(i,e,t,n=.05,a=.05,s=1){se(i,Vt(e,a),Ut(t,n)),pe(i,s)}function Es(i,e,t,n=.05,a=.05,s=1){se(i,qt(e,a),Gt(t,n)),pe(i,s)}function Cs(i,e,t,n=.05,a=.05,s=1){se(i,Vt(e,a),Gt(t,n)),pe(i,s)}function se(i,e,t){i&&i.position?typeof i.position.set=="function"?i.position.set(e,t):(i.position.x=e,i.position.y=t):i&&(i.x=e,i.y=t)}function pe(i,e){e!==1&&i&&i.scale&&(typeof i.scale.set=="function"?i.scale.set(e,e):i.scale.x!==void 0&&i.scale.y!==void 0&&(i.scale.x=e,i.scale.y=e))}var $e={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 As(i){return i&&$e[i]?JSON.parse(JSON.stringify($e[i])):JSON.parse(JSON.stringify(_))}function xt(i){Object.keys(i).forEach(e=>{let t=e;_[t]&&i[t]&&Object.assign(_[t],i[t])}),console.log("Config applied:",i)}function Ls(i,e){let t=i/e;t>1.6?(xt($e.wide),console.log("Applied WIDE config for ratio:",t)):t<.7?(xt($e.tall),console.log("Applied TALL config for ratio:",t)):t>.8&&t<1.2?(xt($e.square),console.log("Applied SQUARE config for ratio:",t)):(xt($e.default),console.log("Applied DEFAULT config for ratio:",t))}if(typeof window!="undefined"){let i=window;i.configPresets=$e,i.resolveAnchorVec2=i.resolveAnchorVec2||Te,i.resolveScreenAnchorPoint=i.resolveScreenAnchorPoint||De,i.resolveScreenRatioPoint=i.resolveScreenRatioPoint||Ne}var K=null,ea=new Map;function aa(i,e,t,n,a,s={}){var Se,Ee,Ce,Ae,Y,_e,lt,ct,dt,pt,ut,gt,ht,ft,mt,bt,F,Z,U,Q,Ue,Oe,Bi,Gi,Ui,qi,Vi,Yi,Wi,Ki,Xi,Ji,Zi,Qi,en,tn,nn,an,sn,rn,on,ln,cn,dn,pn,un,gn,hn,fn;let r=(Se=s.enableDebugLogs)!=null?Se:!1;r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== STARTING LAYOUT CALCULATION ====="),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Screen dimensions:",{width:n.width,height:n.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Time:",t),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Options:",s));let{mainContainer:o,label:c,background:l,backgroundTexture:u,app:d}=i;if(!d||!d.renderer){r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] \u274C No app or renderer, skipping layout");return}r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] App renderer dimensions:",{width:d.renderer.width,height:d.renderer.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] App screen dimensions:",{width:d.screen.width,height:d.screen.height}));let p=n.width,g=n.height;r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Base dimensions:",{baseWidth:p,baseHeight:g});let h=p*_.layout.screen_scale_x,m=g*_.layout.screen_scale_y,C=p/2,b=e.engine.runtime||{},f=b.layout||{};r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug config:",{screen_scale_x:_.layout.screen_scale_x,screen_scale_y:_.layout.screen_scale_y}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Calculated dimensions:",{width:h,height:m,midX:C}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Engine runtime:",b),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Layout config:",f));let y=m>h,w=(Ee=f.design_width_portrait)!=null?Ee:y?400:600,x=(Ce=f.design_height_portrait)!=null?Ce:y?600:400,k=Math.min(h/w,m/x);k=Math.min(k,1.15);let L=k*((Ae=_.engine.scale)!=null?Ae:1),B=(Y=s.skipMainContainerTransform)!=null?Y:!1;!B&&o&&o.scale&&(typeof o.scale.set=="function"?o.scale.set(L):(o.scale.x=L,o.scale.y=L));let R=(_e=f.main_container_anchor)!=null?_e:"center",H=(lt=f.main_container_position_ratio)!=null?lt:{x:.5,y:.5},z=(ct=f.main_container_offset)!=null?ct:{x:0,y:0},T=f.main_container_position_ratio?Ne(p,g,H):De(p,g,R),E=T.x+z.x+_.layout.position_offset.x,S=T.y+z.y+_.layout.position_offset.y;if(!B&&o&&o.position&&(typeof o.position.set=="function"?o.position.set(E,S):(o.position.x=E,o.position.y=S)),a&&(o!=null&&o.toLocal)){let G=g>p,W=(dt=f.design_width_portrait)!=null?dt:G?320:480,N=(pt=f.design_height_portrait)!=null?pt:G?480:320;for(let[oe,le]of e.objects.entries()){let q=le==null?void 0:le.transform;if(!q||((ut=q.position_mode)!=null?ut:"static")!=="static")continue;let I=(gt=a.get)==null?void 0:gt.call(a,oe),yt=((ht=I==null?void 0:I.getDisplayObject)==null?void 0:ht.call(I))||(I==null?void 0:I.pixiObject)||I;if(!yt||yt.parent!==o)continue;let he=(ft=q.anchor)!=null?ft:"bottom-left";he==="bottom-left"&&q.anchor==null&&console.log("[DEBUG FALLBACK] LayoutManager transform.anchor \u2192 bottom-left");let qe=q.position_ratio!=null?Ne(W,N,q.position_ratio):De(W,N,he),Ve=(mt=q.position)!=null?mt:{x:0,y:0},vt=qe.x-W/2+Ve.x,Re=qe.y-N/2+Ve.y;typeof(I==null?void 0:I.setPosition)=="function"?I.setPosition(vt,Re):(se(yt,vt,Re),(bt=I==null?void 0:I.transform)!=null&&bt.position&&(I.transform.position.x=vt,I.transform.position.y=Re))}}let A=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,J=((A==null?void 0:A.buildMode)||(typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"dev"))==="dev";if(_.layout.debug_rect_visible&&J){(!K||K.parent!==d.stage)&&(K==null||K.destroy(),K=new ta.Graphics,K.zIndex=9999,d.stage.addChild(K)),K.clear();let G=_.layout.debug_rect_scale_x,W=_.layout.debug_rect_scale_y,N=(p-4)*G,oe=(g-4)*W,le=(p-N)/2,q=(g-oe)/2;r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== DEBUG RECT POSITIONING ====="),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug rect calculations:",{baseWidth:p,baseHeight:g,rectW:N,rectH:oe,offsetX:le,offsetY:q}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug rect final position:",{x:2+le,y:2+q,width:N,height:oe})),K.rect(2+le,2+q,N,oe).stroke({width:_.layout.debug_rect_thickness,color:_.layout.debug_rect_color})}else K&&(K.destroy(),K=null);let O=((F=i.label)==null?void 0:F.config)||e.objects.get("label_1")||e.objects.get("ui_tutorial_1");if(c&&c.position&&O){let G=(U=(Z=O==null?void 0:O.transform)==null?void 0:Z.anchor)!=null?U:"center",W=(Q=O==null?void 0:O.transform)==null?void 0:Q.position_ratio,N=((Ue=O==null?void 0:O.transform)==null?void 0:Ue.offset)||{x:0,y:0};Ft(c,p,g,{anchor:G,positionRatio:W,offset:{x:N.x*L,y:N.y*L},renderAnchor:Te(G)})}if(c&&c.alpha>0){let G=1+Math.sin(t*_.engine.label_pulse_speed)*_.engine.label_pulse_intensity,W=(Bi=(Oe=O==null?void 0:O.transform)==null?void 0:Oe.scale)!=null?Bi:1,N=G*L*W;c.scale&&(typeof c.scale.set=="function"?c.scale.set(N):(c.scale.x=N,c.scale.y=N))}r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== BACKGROUND POSITIONING =====");let ne=l?e.objects.get("background_1"):null,je=!!ne&&(l==null?void 0:l.parent)===o;if(l&&!je){r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background object exists:",!!l),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background type:",(Gi=l.constructor)==null?void 0:Gi.name)),l.alpha=((qi=(Ui=b.background)==null?void 0:Ui.alpha)!=null?qi:.98)*_.engine.background_alpha,r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background alpha set to:",l.alpha),r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background config:",ne);let G=(ne==null?void 0:ne.transform)||{};r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background transform:",G);let W=G.offset||{x:0,y:0},N=((Yi=(Vi=b.background)==null?void 0:Vi.offset_y)!=null?Yi:0)+_.engine.background_offset_y,oe=(Wi=G.anchor)!=null?Wi:"center",le=G.position_ratio;if(r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background positioning params:",{bgOffset:W,bgRuntimeOffsetY:N,bgScreenAnchor:oe,bgPositionRatio:le,baseWidth:p,baseHeight:g,finalScale:L}),Ft(l,p,g,{anchor:oe,positionRatio:le,offset:{x:W.x*L,y:W.y*L+N},renderAnchor:Te(oe)}),r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background position after applyScreenAnchor:",{x:l.x,y:l.y,scaleX:(Ki=l.scale)==null?void 0:Ki.x,scaleY:(Xi=l.scale)==null?void 0:Xi.y,anchorX:(Ji=l.anchor)==null?void 0:Ji.x,anchorY:(Zi=l.anchor)==null?void 0:Zi.y,pivotX:(Qi=l.pivot)==null?void 0:Qi.x,pivotY:(en=l.pivot)==null?void 0:en.y,width:l.width,height:l.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background texture dimensions:",{textureWidth:u==null?void 0:u.width,textureHeight:u==null?void 0:u.height})),u){let qe=Math.max(h/u.width,m/u.height),Ve=(nn=(tn=b.background)==null?void 0:tn.scale_multiplier)!=null?nn:1.05,vt=(an=G.scale)!=null?an:1,Re=qe*Ve*_.engine.background_scale*vt;l.scale&&(typeof l.scale.set=="function"?l.scale.set(Re):(l.scale.x=Re,l.scale.y=Re))}else l&&typeof l.clear=="function"&&(l.clear(),l.rect(-h/2,-m/2,h,m).fill({color:1444375}));let q=`${p}x${g}`,P=ea.get(q),I={x:Number((sn=l.x)!=null?sn:0),y:Number((rn=l.y)!=null?rn:0),scaleX:Number((ln=(on=l.scale)==null?void 0:on.x)!=null?ln:1),scaleY:Number((dn=(cn=l.scale)==null?void 0:cn.y)!=null?dn:1),rotation:Number.isFinite(l.rotation)?l.rotation:void 0,anchorX:Number.isFinite((pn=l.anchor)==null?void 0:pn.x)?l.anchor.x:void 0,anchorY:Number.isFinite((un=l.anchor)==null?void 0:un.y)?l.anchor.y:void 0,pivotX:Number.isFinite((gn=l.pivot)==null?void 0:gn.x)?l.pivot.x:void 0,pivotY:Number.isFinite((hn=l.pivot)==null?void 0:hn.y)?l.pivot.y:void 0},yt=Number.isFinite(I.x)&&Number.isFinite(I.y)&&Number.isFinite(I.scaleX)&&Number.isFinite(I.scaleY),he=I;if(P){let qe=Math.hypot(I.x-P.x,I.y-P.y),Ve=Math.max(p,g)*.5;(!yt||qe>Ve)&&((fn=l.position)!=null&&fn.set?l.position.set(P.x,P.y):(l.x=P.x,l.y=P.y),l.scale&&(typeof l.scale.set=="function"?l.scale.set(P.scaleX,P.scaleY):(l.scale.x=P.scaleX,l.scale.y=P.scaleY)),Number.isFinite(P.rotation)&&typeof l.rotation=="number"&&(l.rotation=P.rotation),l.anchor&&Number.isFinite(P.anchorX)&&Number.isFinite(P.anchorY)&&l.anchor.set(P.anchorX,P.anchorY),l.pivot&&Number.isFinite(P.pivotX)&&Number.isFinite(P.pivotY)&&l.pivot.set(P.pivotX,P.pivotY),he=P)}Number.isFinite(he.x)&&Number.isFinite(he.y)&&Number.isFinite(he.scaleX)&&Number.isFinite(he.scaleY)&&ea.set(q,he)}}function Ts(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 Is(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 ks(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 yi(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 Ts(a),r=await ks(s),o=Is(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 Yt(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],h=r[d+2],m=!1;for(let C of c)if(Math.sqrt(Math.pow(p-C.r,2)+Math.pow(g-C.g,2)+Math.pow(h-C.b,2))<e){m=!0;break}m&&(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 sa=require("@google/genai");async function vi(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 f=t[b];if(!f.base64||!f.mimeType)throw new Error(`Image ${b+1} is missing required data`);if(f.base64.length<1e3&&console.warn(`Image ${b+1} data appears very small, may be corrupted`),!f.mimeType.startsWith("image/"))throw new Error(`Image ${b+1} has invalid MIME type: ${f.mimeType}`)}let d=new sa.GoogleGenAI({apiKey:i}),p="gemini-2.5-flash",g=[e];t.length>0&&t.forEach((b,f)=>{g.push({inlineData:{data:b.base64,mimeType:b.mimeType}}),console.log(`[Gemini] Added image ${f+1}: ${b.mimeType}, size: ${Math.round(b.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${t.length} images and prompt length: ${e.length}`);let h=await d.models.generateContent({model:p,contents:g}),m="",C=(r=(s=(a=h.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&&(m+=b.text);if(!m.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${m.length}`),m}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 ra=require("@google/genai");async function Wt(i,e,t=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new ra.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 Rs=require("pixi.js");Et();Kt();de();var ua=require("pixi.js");var $s=require("pixi.js");de();function Ws(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 Ks(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 Xs(i){return`
98
98
  Analyze these screenshots of a brand or game and extract its "Brand DNA".
99
99
 
100
100
  Provide a concise summary (2-3 sentences) covering:
@@ -1 +1 @@
1
- (function(_0x1661ef,_0x114267){var a0_0x5814f2={_0x2f70b7:0x32d,_0x4b89af:0x31e,_0xa0a4df:'Bsn$',_0x15cefc:0x312,_0x545042:0x30b,_0x3b92f6:0x30f,_0x221f1a:'hf&y',_0x28cd5b:0x30c,_0x558835:0x317,_0x2d46e7:0x310,_0x53cb9b:0x313,_0x2d6a6a:0x325,_0x29d8b0:0x319,_0x42e1d3:0x322,_0x583f60:'$bY@',_0x390e5f:0x2fd,_0x396501:0x30a,_0x52e1d2:'8i5R',_0x2db39c:0x30d,_0xa04560:0x31a,_0x1c2627:0x311,_0x5ed777:'Gib#',_0x13cc76:0x32a,_0x4a7dd2:'*72J',_0xd86497:0x305,_0x24302b:'Uwr]',_0x894027:0x319,_0x3e3efa:0x314,_0xd2f0:0x328,_0x501494:'lwe)',_0x182e9c:0x313,_0x2f5d31:0x30e,_0x3e114c:0x31b,_0x21f98a:0x317,_0x114adf:0x323,_0x4ebe07:'lwe)',_0x305ec8:0x30a,_0x5b1e05:0x2fe},a0_0x2eca21={_0xe86a2:0x266},a0_0x8d7f64={_0x2f1156:0x286};function _0x153e07(_0x5026f2,_0x430018,_0x23901c,_0x2c0766,_0x164aa5){return a0_0x265c(_0x430018-a0_0x8d7f64._0x2f1156,_0x5026f2);}function _0x1a3c57(_0x5627a5,_0x315206,_0x18bcf4,_0x8c111b,_0x258e2c){return a0_0x265c(_0x258e2c- -0x3ba,_0x5627a5);}var _0x2220ea=_0x1661ef();function _0x2be845(_0xd97b8d,_0x4c654d,_0x4372a8,_0x459454,_0x47bc22){return a0_0x265c(_0x459454-a0_0x2eca21._0xe86a2,_0xd97b8d);}while(!![]){try{var _0x4ac362=-parseInt(_0x153e07('D0)m',a0_0x5814f2._0x2f70b7,0x333,0x325,a0_0x5814f2._0x4b89af))/(0x16e*-0x1a+-0x842+-0x2d6f*-0x1)+-parseInt(_0x153e07(a0_0x5814f2._0xa0a4df,0x31a,a0_0x5814f2._0x15cefc,a0_0x5814f2._0x545042,a0_0x5814f2._0x3b92f6))/(0x424+0x168a+0x1*-0x1aac)+parseInt(_0x2be845(a0_0x5814f2._0x221f1a,a0_0x5814f2._0x28cd5b,a0_0x5814f2._0x558835,a0_0x5814f2._0x2d46e7,a0_0x5814f2._0x53cb9b))/(-0x10a5*-0x1+-0x14d1+0x42f)*(parseInt(_0x1a3c57('xkV1',-0x32f,-a0_0x5814f2._0x2d6a6a,-a0_0x5814f2._0x29d8b0,-a0_0x5814f2._0x42e1d3))/(-0x805*-0x2+0x19aa+-0x29b0))+-parseInt(_0x1a3c57(a0_0x5814f2._0x583f60,-0x301,-a0_0x5814f2._0x29d8b0,-a0_0x5814f2._0x390e5f,-a0_0x5814f2._0x396501))/(-0x321+0x1*-0x252d+-0x3*-0xd71)*(parseInt(_0x1a3c57(a0_0x5814f2._0x52e1d2,-0x31f,-a0_0x5814f2._0x2db39c,-a0_0x5814f2._0xa04560,-a0_0x5814f2._0x1c2627))/(-0x1*-0x2054+-0x2*-0x231+-0x24b0))+-parseInt(_0x1a3c57(a0_0x5814f2._0x5ed777,-a0_0x5814f2._0x29d8b0,-a0_0x5814f2._0x13cc76,-0x329,-0x31e))/(0xf2e*-0x1+0xed6+0x5f)*(-parseInt(_0x2be845(a0_0x5814f2._0x4a7dd2,0x30b,a0_0x5814f2._0xd86497,0x313,a0_0x5814f2._0x2d46e7))/(-0xc1d+0x1*-0x17e9+0x240e))+-parseInt(_0x153e07(a0_0x5814f2._0x24302b,a0_0x5814f2._0x894027,a0_0x5814f2._0x3e3efa,a0_0x5814f2._0xd2f0,0x310))/(-0x3fa*-0x5+-0x7*0x4fd+0xf12)*(-parseInt(_0x1a3c57(a0_0x5814f2._0x501494,-0x309,-a0_0x5814f2._0x182e9c,-a0_0x5814f2._0x2f5d31,-0x314))/(0x2*0x58a+-0x1*-0x199d+-0x24a7))+-parseInt(_0x1a3c57('Uwr]',-a0_0x5814f2._0x3e114c,-a0_0x5814f2._0x21f98a,-a0_0x5814f2._0xd2f0,-a0_0x5814f2._0x114adf))/(0x63b+0x44f*-0x7+0x17f9)*(-parseInt(_0x2be845(a0_0x5814f2._0x4ebe07,0x30e,0x314,a0_0x5814f2._0x305ec8,a0_0x5814f2._0x5b1e05))/(-0x19*0x57+-0x8*-0x206+-0x7a5));if(_0x4ac362===_0x114267)break;else _0x2220ea['push'](_0x2220ea['shift']());}catch(_0x3711a3){_0x2220ea['push'](_0x2220ea['shift']());}}}(a0_0xbfe1,0x28*-0x5564+-0x8bd*0x10d+0x2035d1*0x1));var a0_0x19672a=(function(){var a0_0x4d0441={_0x112f1c:0x1a8,_0x5294de:'$bY@',_0x89fa8b:0x198,_0x3fa48a:0x1a0,_0x3a3bbb:0x1ae},_0x85f144=!![];return function(_0x5e6100,_0x2ae25d){var _0x1fb998=_0x85f144?function(){function _0x5521be(_0x4bf26b,_0x356177,_0x1adb61,_0x5f5bbf,_0x5d52c6){return a0_0x265c(_0x5f5bbf- -0x236,_0x356177);}if(_0x2ae25d){var _0x3946c2=_0x2ae25d[_0x5521be(-a0_0x4d0441._0x112f1c,a0_0x4d0441._0x5294de,-a0_0x4d0441._0x89fa8b,-a0_0x4d0441._0x3fa48a,-a0_0x4d0441._0x3a3bbb)](_0x5e6100,arguments);return _0x2ae25d=null,_0x3946c2;}}:function(){};return _0x85f144=![],_0x1fb998;};}()),a0_0x3640b5=a0_0x19672a(this,function(){var a0_0x540cc4={_0x3c5975:'vIRC',_0xe61647:0x311,_0x809a84:0x44a,_0x180379:'DAAn',_0x13f03d:0x445,_0x1d06bf:'Xo6h',_0x3bb243:0x21a,_0x3f8bbd:0x217,_0xd98777:0x204,_0x42d5b6:0x452,_0x1b6de9:0x450,_0x5ca36b:'cpwF',_0x2f6e04:0x444,_0x15ecfd:0x428,_0x54c0ab:'O](R',_0xe0df4a:0x434,_0x1dd36a:0x441,_0x46e720:0x426,_0x5d6a22:'Du4C',_0x2b7eca:'2x*n',_0x574675:0x2f9,_0xb74445:0x306,_0x39eb38:0x2ec,_0x59cbd5:'Q4SP',_0x23a3e3:0x2f8,_0x3c853d:'lsB*',_0x578066:0x208,_0x50800e:0x215},a0_0x3ac383={_0x4407a0:0x259},a0_0x26c6a6={_0x1ecad4:0x16e},a0_0x20e02b={_0x40090d:0x399};function _0x51c387(_0x1950d7,_0x26d013,_0x3b7965,_0x474947,_0x2825e7){return a0_0x265c(_0x2825e7-a0_0x20e02b._0x40090d,_0x474947);}function _0xe9bc1b(_0x39a25a,_0x10f05f,_0x3737a9,_0x52950f,_0x2e6bb0){return a0_0x265c(_0x3737a9-a0_0x26c6a6._0x1ecad4,_0x39a25a);}function _0x1a5d78(_0x16f679,_0x165908,_0x7f428d,_0x203103,_0xde70e0){return a0_0x265c(_0x165908-a0_0x3ac383._0x4407a0,_0x16f679);}return a0_0x3640b5[_0x1a5d78(a0_0x540cc4._0x3c5975,0x307,0x313,a0_0x540cc4._0xe61647,0x313)+_0x51c387(0x438,0x447,a0_0x540cc4._0x809a84,a0_0x540cc4._0x180379,a0_0x540cc4._0x13f03d)]()[_0xe9bc1b(a0_0x540cc4._0x1d06bf,a0_0x540cc4._0x3bb243,0x20b,a0_0x540cc4._0x3f8bbd,a0_0x540cc4._0xd98777)+'h']('(((.+'+_0x51c387(0x452,a0_0x540cc4._0x42d5b6,a0_0x540cc4._0x1b6de9,a0_0x540cc4._0x5ca36b,a0_0x540cc4._0x2f6e04)+'+$')['toStr'+_0x51c387(0x42e,a0_0x540cc4._0x15ecfd,0x43d,a0_0x540cc4._0x54c0ab,a0_0x540cc4._0xe0df4a)]()['const'+_0x51c387(0x42e,a0_0x540cc4._0x1dd36a,a0_0x540cc4._0x46e720,a0_0x540cc4._0x5d6a22,0x432)+'r'](a0_0x3640b5)[_0x1a5d78(a0_0x540cc4._0x2b7eca,a0_0x540cc4._0x574675,a0_0x540cc4._0x574675,a0_0x540cc4._0xb74445,a0_0x540cc4._0x39eb38)+'h'](_0x1a5d78(a0_0x540cc4._0x59cbd5,0x2f3,0x2f2,0x2ec,a0_0x540cc4._0x23a3e3)+_0xe9bc1b(a0_0x540cc4._0x3c853d,0x200,0x20f,a0_0x540cc4._0x578066,a0_0x540cc4._0x50800e)+'+$');});a0_0x3640b5();function a0_0x265c(_0xd1355e,_0x17ba46){_0xd1355e=_0xd1355e-(0x1*0xcdd+-0x18b2+0xc68);var _0x434368=a0_0xbfe1();var _0x4f02f2=_0x434368[_0xd1355e];if(a0_0x265c['ovQNnx']===undefined){var _0x316cea=function(_0x250216){var _0x23958d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x3c2cc8='',_0x39bf2b='',_0x46d205=_0x3c2cc8+_0x316cea;for(var _0x2942f4=-0x7a4+-0x13d8+0x1b7c,_0x5724f3,_0x350966,_0x46ec1a=-0xfed+0x1190+-0x1a3*0x1;_0x350966=_0x250216['charAt'](_0x46ec1a++);~_0x350966&&(_0x5724f3=_0x2942f4%(-0x171e*-0x1+-0xf*-0x14b+-0xb*0x3dd)?_0x5724f3*(-0x16ee+-0x1f99+0x36c7)+_0x350966:_0x350966,_0x2942f4++%(0xd*-0x17+0x15f*0x3+-0x2ee))?_0x3c2cc8+=_0x46d205['charCodeAt'](_0x46ec1a+(-0xd64+0x1*-0x7d3+0x1541))-(-0xe86+0x1391*0x1+-0x3*0x1ab)!==-0x1ef4+-0xdc*-0x14+0x1*0xdc4?String['fromCharCode'](0x188f+-0x2008+-0x4*-0x21e&_0x5724f3>>(-(-0xdc7+-0x2098+0x2e61*0x1)*_0x2942f4&-0x20*0xf4+-0x3*0x543+0x2e4f*0x1)):_0x2942f4:-0x439+-0x18d0*0x1+-0x1*-0x1d09){_0x350966=_0x23958d['indexOf'](_0x350966);}for(var _0x2dca6d=-0xa7*-0xe+-0x454+0x2*-0x267,_0x488f81=_0x3c2cc8['length'];_0x2dca6d<_0x488f81;_0x2dca6d++){_0x39bf2b+='%'+('00'+_0x3c2cc8['charCodeAt'](_0x2dca6d)['toString'](0x18d*0x7+0x1b1*-0x1+-0x91a))['slice'](-(0x39*-0x6b+-0x2644+-0x3e19*-0x1));}return decodeURIComponent(_0x39bf2b);};var _0x2bdf26=function(_0x29f8a7,_0x29bdb0){var _0x1d2938=[],_0x41cc24=-0x8*0x3b9+-0x18f0+-0x338*-0x11,_0x31939e,_0x5ac28d='';_0x29f8a7=_0x316cea(_0x29f8a7);var _0x39eaed;for(_0x39eaed=0x1dc*-0x13+-0xd14*0x2+0x3d7c;_0x39eaed<-0x155d+-0xe2b+0x2488;_0x39eaed++){_0x1d2938[_0x39eaed]=_0x39eaed;}for(_0x39eaed=0x1137+-0x377*0x3+-0x6d2;_0x39eaed<0x2641+0x7*-0x90+-0x2151;_0x39eaed++){_0x41cc24=(_0x41cc24+_0x1d2938[_0x39eaed]+_0x29bdb0['charCodeAt'](_0x39eaed%_0x29bdb0['length']))%(-0x18cf+0x524*0x6+-0x509),_0x31939e=_0x1d2938[_0x39eaed],_0x1d2938[_0x39eaed]=_0x1d2938[_0x41cc24],_0x1d2938[_0x41cc24]=_0x31939e;}_0x39eaed=0x63f*-0x1+0x195+-0x6*-0xc7,_0x41cc24=-0xd*-0x1e2+-0x76c+-0x110e;for(var _0x29a479=0x311*0x4+-0x2655+0x1*0x1a11;_0x29a479<_0x29f8a7['length'];_0x29a479++){_0x39eaed=(_0x39eaed+(0x15d6+-0x1ed7+0x481*0x2))%(-0x2*0xe95+-0x1b16*0x1+0x3940),_0x41cc24=(_0x41cc24+_0x1d2938[_0x39eaed])%(0x2055+0x1860+-0x1*0x37b5),_0x31939e=_0x1d2938[_0x39eaed],_0x1d2938[_0x39eaed]=_0x1d2938[_0x41cc24],_0x1d2938[_0x41cc24]=_0x31939e,_0x5ac28d+=String['fromCharCode'](_0x29f8a7['charCodeAt'](_0x29a479)^_0x1d2938[(_0x1d2938[_0x39eaed]+_0x1d2938[_0x41cc24])%(-0x2233+-0x1653+0x1*0x3986)]);}return _0x5ac28d;};a0_0x265c['AWEnlT']=_0x2bdf26,a0_0x265c['mNmBZO']={},a0_0x265c['ovQNnx']=!![];}var _0x1136a1=_0x434368[0x26b8+-0xd8*0x4+-0x18*0x179],_0x15367d=_0xd1355e+_0x1136a1,_0x8ca170=a0_0x265c['mNmBZO'][_0x15367d];if(!_0x8ca170){if(a0_0x265c['iELYus']===undefined){var _0x20e70f=function(_0x128107){this['mZnERN']=_0x128107,this['GGcXhl']=[0x21b1+-0x1736+-0x12*0x95,0x1*-0x15b1+0x238d+-0x4*0x377,-0x13*-0xd+-0xa5+-0x2*0x29],this['YfaWPe']=function(){return'newState';},this['RwXsyW']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['SaQrWI']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x20e70f['prototype']['ULQruT']=function(){var _0x51d258=new RegExp(this['RwXsyW']+this['SaQrWI']),_0x52ff50=_0x51d258['test'](this['YfaWPe']['toString']())?--this['GGcXhl'][0x29b+0xb24*0x2+-0x23*0xb6]:--this['GGcXhl'][-0x1af6+-0x1b57*0x1+0x364d];return this['WtcvZU'](_0x52ff50);},_0x20e70f['prototype']['WtcvZU']=function(_0x409dda){if(!Boolean(~_0x409dda))return _0x409dda;return this['GxHYvS'](this['mZnERN']);},_0x20e70f['prototype']['GxHYvS']=function(_0x24b985){for(var _0x47f4ad=0x4e8+-0x8b8*-0x3+0x8e*-0x38,_0x5128b3=this['GGcXhl']['length'];_0x47f4ad<_0x5128b3;_0x47f4ad++){this['GGcXhl']['push'](Math['round'](Math['random']())),_0x5128b3=this['GGcXhl']['length'];}return _0x24b985(this['GGcXhl'][0x1*-0x16f9+-0x5d*0x5b+-0xa3*-0x58]);},new _0x20e70f(a0_0x265c)['ULQruT'](),a0_0x265c['iELYus']=!![];}_0x4f02f2=a0_0x265c['AWEnlT'](_0x4f02f2,_0x17ba46),a0_0x265c['mNmBZO'][_0x15367d]=_0x4f02f2;}else _0x4f02f2=_0x8ca170;return _0x4f02f2;}import{A as a0_0x5bc12b,B as a0_0x5d65d9,C as a0_0x2ab0c1,D as a0_0x129bd6,b as a0_0xfc743,c as a0_0x37d1e6,d as a0_0x46e761,e as a0_0x8ff876,f as a0_0x31900c,g as a0_0x2e471,h as a0_0xb5771e,i as a0_0x11409d,j as a0_0x363d52,k as a0_0x1bd90c,l as a0_0x1df773,m as a0_0x53865f,n as a0_0xd15d65,o as a0_0x492453,p as a0_0xfc3f45,q as a0_0x494cc0,r as a0_0x52e26d,s as a0_0x50e528,t as a0_0x1d5f6f,u as a0_0x10b98e,v as a0_0x159d16,w as a0_0x1e653d,x as a0_0x2aa491,y as a0_0x150451,z as a0_0x2acb57}from'../chunk-RZAAEBBT.js';import'../chunk-NSZ7GCS3.js';import{a as a0_0x44b39c,b as a0_0x230039,c as a0_0x2b37b7,d as a0_0x3c622c,e as a0_0xc9396d}from'../chunk-I5OOVR5U.js';import'../chunk-FOTLNUIS.js';function a0_0xbfe1(){var _0x44ba78=['WOFdS8ojWQldS8ormq','Ew/cKSkHW77cRYtdKfBcSmoPtHe','W7X2W7FcHhlcO8kXfmk0jLXE','W4CHDCk7WQftg8kZ','WOvwWRjoWQvTWRTuWO5slmo3Dq','W5NdHCk+o8oEwSk3WRi','jCo8bmkRWQO','W57dQMO','amoeW7Gty1BdHbyBFSkP','r8omj8k8mq','WPr6WRioedNdINiab8kzW7y','WRPuW4xdTCoNWRvH','sv0FuhpcTSkfvG','WRnXWODHtcVdVCocCmomW4fazG','WOnqW6K/W504W6fT','W65DW5hdLCoK','tvG2r3/cPmkqya','ymkLW6zYWODgWPZdO2yUESki','F8kwWOBdG8o4','BwZdMmkBqG','WRjUW7O','BSoxWRFcLIhdQCo5WRtdUri','W73cMmoMcmk4','h8k7ESkpCX3dMfGXWOe','g8k/F8khmhxcJ3KOWPbRWPhcMG','aSkgWRRcN8k9','WPFdJ8kxa3O','tCoYhZncW55wWP/dPmoFfq','oSoNW6PBnZtdLmkSWO/cVvhcKa','EMdcKmkIW7NcQvddOexcI8oRCW'];a0_0xbfe1=function(){return _0x44ba78;};return a0_0xbfe1();}import'../chunk-2MR65LDX.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x44b39c as AssetCache,a0_0x2b37b7 as AssetLoader,a0_0x10b98e as AssetSystem,a0_0x3c622c as AssetTextures,a0_0x50e528 as Assets,a0_0x492453 as BaseSystem,a0_0xd15d65 as GameEngine,a0_0x8ff876 as GameObject,a0_0x31900c as GameObjectManager,a0_0x53865f as ObjectFactory,a0_0x46e761 as Renderer,a0_0xfc3f45 as RuntimeObjectRegistry,a0_0x37d1e6 as Transform,a0_0x5d65d9 as applyScreenAnchor,a0_0x494cc0 as basePixi,a0_0x1e653d as clearResponsiveElements,a0_0xfc743 as createPixiBase,a0_0x363d52 as getRegisteredFontIds,a0_0x159d16 as globalResponsiveMultipliers,a0_0xc9396d as initAssetTextures,a0_0x1d5f6f as initAssets,a0_0x2ab0c1 as layout,a0_0x1df773 as playLottieOverlay,a0_0x11409d as registerFont,a0_0x230039 as registerType,a0_0x150451 as resolveAnchorVec2,a0_0x2e471 as resolveFont,a0_0xb5771e as resolveFontWeight,a0_0x2acb57 as resolveScreenAnchorPoint,a0_0x5bc12b as resolveScreenRatioPoint,a0_0x129bd6 as runInitSequence,a0_0x1bd90c as setLottieInstance,a0_0x52e26d as spawnSceneFromConfig,a0_0x2aa491 as updateScreenState};
1
+ (function(_0x497200,_0x15791b){var a0_0x2b187e={_0x4f8d70:0x3fb,_0x2a9ca7:0x3fb,_0x1aee0b:0x405,_0x5018fa:'cYd)',_0x76f197:0x3fc,_0x5a5311:0x409,_0x222151:0x3fd,_0xfc6126:'Sbdv',_0x4c22af:0x444,_0x27f5b5:0x43d,_0x490280:'oN9S',_0x49c93e:0x449,_0x5074a0:0x445,_0x4dd5e9:0x40b,_0x231f8f:0x40a,_0x17d9d2:0x415,_0x3e8ab9:'oN9S',_0x40f1a1:0x16a,_0x56f655:0x15c,_0x3d392e:'8ZGz',_0x1c3c61:0x406,_0x38ae57:0x409,_0x5486f5:0x400,_0x270082:0x14f,_0x1010b0:0x15d,_0x4e32a3:'MHrB',_0x2879fd:0x151,_0x2072b7:0x156,_0x6d94c2:0x162,_0x278f4b:'C0U2',_0x37076b:0x15a,_0x46d0e7:0x44c,_0x32739f:0x440,_0x393e29:'HcMH',_0x55a268:0x44a,_0x289dc5:0x43b},a0_0xad2f25={_0x2b4c7f:0x3bb},a0_0x40b1c8={_0x20f8ff:0x37c},a0_0x788b1d={_0x381c13:0xd1},_0x1ec4f9=_0x497200();function _0x7fe9a4(_0x589cc5,_0x4a20b7,_0x3e75be,_0x5c4ffc,_0x23c3e0){return a0_0x452f(_0x23c3e0-a0_0x788b1d._0x381c13,_0x5c4ffc);}function _0x121c04(_0x58fa0b,_0x258f85,_0x5e6aa7,_0x346d5f,_0x38b3c2){return a0_0x452f(_0x5e6aa7-a0_0x40b1c8._0x20f8ff,_0x38b3c2);}function _0x4a84ea(_0x4417a1,_0x211e25,_0x16be1a,_0x248c68,_0x24568a){return a0_0x452f(_0x211e25-a0_0xad2f25._0x2b4c7f,_0x16be1a);}while(!![]){try{var _0x34843b=parseInt(_0x121c04(a0_0x2b187e._0x4f8d70,a0_0x2b187e._0x2a9ca7,0x402,a0_0x2b187e._0x1aee0b,a0_0x2b187e._0x5018fa))/(0x299*0x5+-0x1*-0xb8b+-0x1887)+-parseInt(_0x121c04(0x415,a0_0x2b187e._0x76f197,a0_0x2b187e._0x5a5311,a0_0x2b187e._0x222151,a0_0x2b187e._0xfc6126))/(-0x185*0xd+-0x4a*0x1c+0x1bdb)+-parseInt(_0x4a84ea(a0_0x2b187e._0x4c22af,a0_0x2b187e._0x27f5b5,a0_0x2b187e._0x490280,a0_0x2b187e._0x49c93e,a0_0x2b187e._0x5074a0))/(0x9*-0x2e9+-0x280*-0x8+0x634)+parseInt(_0x121c04(0x404,a0_0x2b187e._0x4dd5e9,a0_0x2b187e._0x231f8f,a0_0x2b187e._0x17d9d2,a0_0x2b187e._0x3e8ab9))/(0x1*0xe9b+0x178d+-0x2624)+parseInt(_0x7fe9a4(a0_0x2b187e._0x40f1a1,a0_0x2b187e._0x56f655,0x16a,a0_0x2b187e._0x3d392e,0x15d))/(0xf77*0x2+-0x1a43+-0x4a6)*(-parseInt(_0x121c04(a0_0x2b187e._0x1c3c61,a0_0x2b187e._0x38ae57,a0_0x2b187e._0x5486f5,a0_0x2b187e._0x38ae57,'VVjg'))/(0xf3*-0x29+0x7*0x3a1+0x1*0xd8a))+parseInt(_0x7fe9a4(a0_0x2b187e._0x270082,0x15c,a0_0x2b187e._0x1010b0,a0_0x2b187e._0x4e32a3,0x15c))/(-0x130+0x1708+0x15d1*-0x1)+-parseInt(_0x7fe9a4(a0_0x2b187e._0x2879fd,a0_0x2b187e._0x2072b7,a0_0x2b187e._0x6d94c2,a0_0x2b187e._0x278f4b,a0_0x2b187e._0x37076b))/(-0x930+-0x1*-0xe8b+-0x553)*(-parseInt(_0x4a84ea(a0_0x2b187e._0x46d0e7,a0_0x2b187e._0x32739f,a0_0x2b187e._0x393e29,a0_0x2b187e._0x55a268,a0_0x2b187e._0x289dc5))/(-0xc85*0x3+-0x315*-0x7+0x1005));if(_0x34843b===_0x15791b)break;else _0x1ec4f9['push'](_0x1ec4f9['shift']());}catch(_0x314e2d){_0x1ec4f9['push'](_0x1ec4f9['shift']());}}}(a0_0xfe94,-0x15ff7+-0x2ce9*0xb+-0x1940e*-0x4));var a0_0xa7b642=(function(){var _0x2c2088=!![];return function(_0x303bbc,_0x29b6c9){var a0_0x1e34f1={_0x39601c:'HcMH',_0x1d2199:0x304,_0x5a98f2:0x2fe,_0xa101c5:0x2f8},a0_0x5ce117={_0x5bc166:0x267},_0x42d62c=_0x2c2088?function(){function _0x14c392(_0x4ae0e9,_0x436df5,_0x39adaa,_0x139e2c,_0x3a9810){return a0_0x452f(_0x139e2c-a0_0x5ce117._0x5bc166,_0x4ae0e9);}if(_0x29b6c9){var _0x27ddc9=_0x29b6c9[_0x14c392(a0_0x1e34f1._0x39601c,0x30a,a0_0x1e34f1._0x1d2199,a0_0x1e34f1._0x5a98f2,a0_0x1e34f1._0xa101c5)](_0x303bbc,arguments);return _0x29b6c9=null,_0x27ddc9;}}:function(){};return _0x2c2088=![],_0x42d62c;};}()),a0_0x515b97=a0_0xa7b642(this,function(){var a0_0x38b569={_0x37cf14:0x30a,_0x1887f6:0x31f,_0x1ac85f:0x145,_0x180a04:0x14a,_0x89fa2f:0x146,_0x229500:0x149,_0x4a4fc1:0x148,_0x53a2ec:'CDuC',_0x2d59a4:0x144,_0x166205:0x14f,_0x19335e:0x161,_0x293c54:0x157,_0x207374:'rM(9',_0x330a9f:0x14d,_0x19d119:0x156,_0x40861d:0x155,_0x18636c:'cYd)',_0x56f7e9:'$A&d',_0x5dad2b:0x158,_0x383d51:'V76G',_0x1076e2:0x326,_0xb9b74b:0x328,_0x3e0732:0x31d,_0x1556c9:'HcMH',_0x4f2138:0x312,_0x58fd3c:0x306,_0x3ff722:0x2fa,_0x58497d:'WMva',_0x293ab8:0x147,_0x5a35e0:0x142,_0x1840b0:0x325,_0x5b9015:0x15f,_0x2f2a8a:0x15c,_0x14db6a:'7uF#',_0x1a587a:0x152,_0x4e2df3:0x14e},a0_0x311c79={_0x430f2a:0x1df},a0_0x5dae22={_0x36a7fe:0x285},a0_0x4f0e97={_0x3ebf41:0x1e5},_0x484880={};function _0x13f5b7(_0x434382,_0x44197c,_0x4f372a,_0xe65213,_0x23c08a){return a0_0x452f(_0x44197c- -a0_0x4f0e97._0x3ebf41,_0x4f372a);}function _0x104de1(_0x129e2a,_0x4fa99b,_0x2acebf,_0x1049d6,_0x1bb862){return a0_0x452f(_0x1049d6-a0_0x5dae22._0x36a7fe,_0x129e2a);}_0x484880[_0x104de1('kxe6',a0_0x38b569._0x37cf14,0x31d,0x317,a0_0x38b569._0x1887f6)]='(((.+'+_0x1867d4(-a0_0x38b569._0x1ac85f,-a0_0x38b569._0x180a04,'7uF#',-a0_0x38b569._0x89fa2f,-a0_0x38b569._0x229500)+'+$';var _0x5a334f=_0x484880;function _0x1867d4(_0x250bd5,_0xe41b36,_0x430a80,_0x2bcae8,_0x7f4797){return a0_0x452f(_0xe41b36- -a0_0x311c79._0x430f2a,_0x430a80);}return a0_0x515b97[_0x1867d4(-a0_0x38b569._0x4a4fc1,-0x144,a0_0x38b569._0x53a2ec,-a0_0x38b569._0x2d59a4,-a0_0x38b569._0x166205)+'ing']()[_0x1867d4(-a0_0x38b569._0x19335e,-a0_0x38b569._0x293c54,a0_0x38b569._0x207374,-a0_0x38b569._0x330a9f,-0x153)+'h'](_0x5a334f[_0x13f5b7(-a0_0x38b569._0x19d119,-a0_0x38b569._0x40861d,a0_0x38b569._0x18636c,-0x153,-0x159)])[_0x1867d4(-0x13f,-0x14c,a0_0x38b569._0x56f7e9,-a0_0x38b569._0x5dad2b,-0x13f)+_0x104de1(a0_0x38b569._0x383d51,a0_0x38b569._0x1076e2,a0_0x38b569._0xb9b74b,a0_0x38b569._0x3e0732,0x315)]()[_0x104de1(a0_0x38b569._0x1556c9,0x301,a0_0x38b569._0x4f2138,a0_0x38b569._0x58fd3c,a0_0x38b569._0x3ff722)+_0x1867d4(-0x13d,-0x145,a0_0x38b569._0x58497d,-a0_0x38b569._0x293ab8,-a0_0x38b569._0x5a35e0)+'r'](a0_0x515b97)[_0x104de1('GPp9',0x31c,0x311,0x31e,a0_0x38b569._0x1840b0)+'h'](_0x5a334f[_0x1867d4(-a0_0x38b569._0x5b9015,-a0_0x38b569._0x2f2a8a,a0_0x38b569._0x14db6a,-a0_0x38b569._0x1a587a,-a0_0x38b569._0x4e2df3)]);});function a0_0x452f(_0x4183dd,_0x4c6e9a){_0x4183dd=_0x4183dd-(0x1e7*-0xb+0x26ab+-0x113e);var _0x480872=a0_0xfe94();var _0x450013=_0x480872[_0x4183dd];if(a0_0x452f['POMabp']===undefined){var _0x14a6f3=function(_0x593063){var _0x1858a7='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0xa0c3c4='',_0x30177='',_0x4eb103=_0xa0c3c4+_0x14a6f3;for(var _0x5e9ecf=-0x1b*-0xa7+0xb*0x1b1+-0x121c*0x2,_0x4dad65,_0x4a3e85,_0x437521=0x420+-0xc*-0x43+-0x744;_0x4a3e85=_0x593063['charAt'](_0x437521++);~_0x4a3e85&&(_0x4dad65=_0x5e9ecf%(-0x1fa5+-0x3ab+-0x1c*-0x143)?_0x4dad65*(-0xc91+-0x1462+-0x1*-0x2133)+_0x4a3e85:_0x4a3e85,_0x5e9ecf++%(0x1*0x4d2+-0x4a*-0x31+-0x12f8))?_0xa0c3c4+=_0x4eb103['charCodeAt'](_0x437521+(-0x24b0+-0xe1*-0x16+0x35*0x54))-(-0x2*-0x9d+-0x10f5*0x1+0xfc5*0x1)!==-0x1ee9+-0x4ef+0x23d8?String['fromCharCode'](0x135*-0x8+-0x1d8b+0x2832&_0x4dad65>>(-(-0x1*-0x1b1d+-0x1*-0x15f5+-0x13a*0x28)*_0x5e9ecf&0x1*0x81+-0x2296+0x221b)):_0x5e9ecf:-0x1f51*-0x1+0x29d*0xd+-0x414a){_0x4a3e85=_0x1858a7['indexOf'](_0x4a3e85);}for(var _0x58683e=0x1*0x197f+-0x73b+-0x1244*0x1,_0x34fb66=_0xa0c3c4['length'];_0x58683e<_0x34fb66;_0x58683e++){_0x30177+='%'+('00'+_0xa0c3c4['charCodeAt'](_0x58683e)['toString'](-0x12ad+0x950+0x96d))['slice'](-(0x2e3+0x3c*-0x2f+0x823));}return decodeURIComponent(_0x30177);};var _0x46b9bd=function(_0x2e3dba,_0x4bcbe3){var _0x150df1=[],_0x170c34=-0x1269+0x2405+-0x2*0x8ce,_0x51df6c,_0x57e042='';_0x2e3dba=_0x14a6f3(_0x2e3dba);var _0x24791c;for(_0x24791c=0x1*-0x527+-0x18b+0x6b2;_0x24791c<-0xcdf*-0x2+0x4a3*0x2+-0x2204;_0x24791c++){_0x150df1[_0x24791c]=_0x24791c;}for(_0x24791c=0x1f7e+-0xca*-0x8+-0x25ce;_0x24791c<0xfe+-0x1*-0x1d6e+-0x1d6c;_0x24791c++){_0x170c34=(_0x170c34+_0x150df1[_0x24791c]+_0x4bcbe3['charCodeAt'](_0x24791c%_0x4bcbe3['length']))%(-0x10a9+-0x2483+-0x1*-0x362c),_0x51df6c=_0x150df1[_0x24791c],_0x150df1[_0x24791c]=_0x150df1[_0x170c34],_0x150df1[_0x170c34]=_0x51df6c;}_0x24791c=0x7d8*0x2+-0x669+-0x13*0x7d,_0x170c34=-0x154b+-0x1*-0x2284+-0xd39;for(var _0x41704a=0xfad*-0x1+-0xa71+-0xd0f*-0x2;_0x41704a<_0x2e3dba['length'];_0x41704a++){_0x24791c=(_0x24791c+(-0x1ae+0x17c0+-0x1*0x1611))%(-0x25b*0x2+0xecc+0x2*-0x48b),_0x170c34=(_0x170c34+_0x150df1[_0x24791c])%(-0x11ba+0xbd2*-0x3+0x3630),_0x51df6c=_0x150df1[_0x24791c],_0x150df1[_0x24791c]=_0x150df1[_0x170c34],_0x150df1[_0x170c34]=_0x51df6c,_0x57e042+=String['fromCharCode'](_0x2e3dba['charCodeAt'](_0x41704a)^_0x150df1[(_0x150df1[_0x24791c]+_0x150df1[_0x170c34])%(-0x7ed+-0x8ae+0x119b*0x1)]);}return _0x57e042;};a0_0x452f['fLaGlk']=_0x46b9bd,a0_0x452f['OlgvPC']={},a0_0x452f['POMabp']=!![];}var _0x1dca9a=_0x480872[0x3*0x4ec+-0x2c*0x1f+-0x1*0x970],_0x55701e=_0x4183dd+_0x1dca9a,_0xfa2216=a0_0x452f['OlgvPC'][_0x55701e];if(!_0xfa2216){if(a0_0x452f['GtlMjf']===undefined){var _0x187d84=function(_0x5aacad){this['MwFZJf']=_0x5aacad,this['pUAxsh']=[0x201a+0x1669+-0x3682,0x16b7+-0xf8a+0x1*-0x72d,-0x1a2*-0xb+-0x1709+0x513*0x1],this['rlzPlw']=function(){return'newState';},this['iIvLbA']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['jpgZRI']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x187d84['prototype']['IpMDdb']=function(){var _0x2d920d=new RegExp(this['iIvLbA']+this['jpgZRI']),_0x2c77a8=_0x2d920d['test'](this['rlzPlw']['toString']())?--this['pUAxsh'][-0x169f+0x13*-0x6b+0x1e91*0x1]:--this['pUAxsh'][0x262a+-0x3b7+-0x2273];return this['eXVCYO'](_0x2c77a8);},_0x187d84['prototype']['eXVCYO']=function(_0x1d9470){if(!Boolean(~_0x1d9470))return _0x1d9470;return this['iqzjRg'](this['MwFZJf']);},_0x187d84['prototype']['iqzjRg']=function(_0x4a05c7){for(var _0x3b7fe2=-0xc9*-0x14+-0x1d1d+0xd69,_0xaa7561=this['pUAxsh']['length'];_0x3b7fe2<_0xaa7561;_0x3b7fe2++){this['pUAxsh']['push'](Math['round'](Math['random']())),_0xaa7561=this['pUAxsh']['length'];}return _0x4a05c7(this['pUAxsh'][0x140*0x10+0xa7e+-0x1e7e]);},new _0x187d84(a0_0x452f)['IpMDdb'](),a0_0x452f['GtlMjf']=!![];}_0x450013=a0_0x452f['fLaGlk'](_0x450013,_0x4c6e9a),a0_0x452f['OlgvPC'][_0x55701e]=_0x450013;}else _0x450013=_0xfa2216;return _0x450013;}function a0_0xfe94(){var _0x3c9474=['WO7cUSotfSoj','W44FWP9dWQ0','s8o1prRdISkqjttdUSkeW4G','W4/cP8keor4','FCoZW511W5j+iSkFySof','W4tdMmoIDru','zuq9','mmk9WPjTWRi','m8otcaRdGq','eH/cOeaE','W7mRF8kDW50xnCk0w2u','W4BdH8o8AHG','udeowwmea8kNaL7dRt8','WP/dUCoeueq','xcvjcuJdUCoAWQf3W7G','WPtcM8kRla1/rYVcHhS','WQNdGmkIFJ84W7RcN8oWW5pdLG','vZipWQ7cRsP4lSkCWQvtFW','W5zyW5VdJr4','owtdIhpcSmo8WRxcL3JcPq','A8oizmopW6FdGCkFlmkeCW','FCoZW59/WO8eACkVv8oSW6yNya','AxHmWQzldYFcSCoLgq','jZONwCoLW7NcLmo/WRWqA8kQ','vZyduM4jECkLfexdMbTk','W4vvWPBcLhNdLsRcPCoPW7qTWR8','W6hcGCo9d3G','WQNdH8kTFJn1WPRcNmoXW6FdNCodW64'];a0_0xfe94=function(){return _0x3c9474;};return a0_0xfe94();}a0_0x515b97();import{A as a0_0x1937c6,B as a0_0x5ba70d,C as a0_0xe9a510,D as a0_0xc2d9b2,b as a0_0x38f92c,c as a0_0x2ae331,d as a0_0x296624,e as a0_0x2dce6f,f as a0_0x485c20,g as a0_0x45ad63,h as a0_0x1f1747,i as a0_0x25b2df,j as a0_0x4f1c12,k as a0_0x3b01d2,l as a0_0x3c7de6,m as a0_0x6750ad,n as a0_0x2fc363,o as a0_0x4e1c8d,p as a0_0x1db4c6,q as a0_0x56209d,r as a0_0x376437,s as a0_0x251589,t as a0_0x40ca6e,u as a0_0xe8ef0c,v as a0_0x9010d6,w as a0_0x30e6de,x as a0_0x539c1c,y as a0_0x508957,z as a0_0x46f7db}from'../chunk-NOMTJOWU.js';import'../chunk-NSZ7GCS3.js';import{a as a0_0x2c96e4,b as a0_0x20caff,c as a0_0x1b5a4b,d as a0_0x31f919,e as a0_0x2acf01}from'../chunk-I5OOVR5U.js';import'../chunk-FOTLNUIS.js';import'../chunk-2MR65LDX.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x2c96e4 as AssetCache,a0_0x1b5a4b as AssetLoader,a0_0xe8ef0c as AssetSystem,a0_0x31f919 as AssetTextures,a0_0x251589 as Assets,a0_0x4e1c8d as BaseSystem,a0_0x2fc363 as GameEngine,a0_0x2dce6f as GameObject,a0_0x485c20 as GameObjectManager,a0_0x6750ad as ObjectFactory,a0_0x296624 as Renderer,a0_0x1db4c6 as RuntimeObjectRegistry,a0_0x2ae331 as Transform,a0_0x5ba70d as applyScreenAnchor,a0_0x56209d as basePixi,a0_0x30e6de as clearResponsiveElements,a0_0x38f92c as createPixiBase,a0_0x4f1c12 as getRegisteredFontIds,a0_0x9010d6 as globalResponsiveMultipliers,a0_0x2acf01 as initAssetTextures,a0_0x40ca6e as initAssets,a0_0xe9a510 as layout,a0_0x3c7de6 as playLottieOverlay,a0_0x25b2df as registerFont,a0_0x20caff as registerType,a0_0x508957 as resolveAnchorVec2,a0_0x45ad63 as resolveFont,a0_0x1f1747 as resolveFontWeight,a0_0x46f7db as resolveScreenAnchorPoint,a0_0x1937c6 as resolveScreenRatioPoint,a0_0xc2d9b2 as runInitSequence,a0_0x3b01d2 as setLottieInstance,a0_0x376437 as spawnSceneFromConfig,a0_0x539c1c as updateScreenState};