handler-playable-sdk 1.0.50 → 1.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/{chunk-3QSVVLAS.js → chunk-L3ZXZIBO.js} +66 -66
  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 +94 -94
  34. package/dist/index.js +1 -1
  35. package/dist/pixi/index.cjs +8 -8
  36. package/dist/pixi/index.js +1 -1
  37. package/dist/three/index.cjs +1 -1
  38. package/dist/three/index.js +1 -1
  39. package/package.json +1 -1
@@ -1 +1 @@
1
- function a0_0x2ac6(){var _0x4b3444=['W6xdSwRdOf4','W5HebfdcLCkbzG','W5/cKmkkjxi','C8oOWQJdGcrJWQa','W7LFW6VcUCksfmokorNdQvr9','D8kAFhKIpCoHW50hbCo6rW','qSkMW5bEW5dcQdeaW4FcGCkasq4','W4JdTgNcJSo5AmoiWRdcGmk6WRm8','WQemW5XNqG','emo5qq','W4elW6WPsW','W65+W6hdVSo7WO1nWPpdKsSBCq','WPFdRf4nWQrtW6RdQ8kv','ww1OFSoIEmkbqa7dLmk6W6O','WRpdSwG8W63dGmonW4BcLCkIWO7dIa','BSk0WP3cIwTsdcW3FCkSbW','W7vvW6RcUCkreSoYiWVdHwri','E8oqxdpdV8k+WRtdGCoGoCkdaW','EmoCvZVdUSk/WOpdTSoJfSkDgq','a8o0WOeFWOa','W5rOtd3dKSksWPO','z8k/b8ovd8o5W7BcSu/dRq','CmknAf3cPq','WOLqWRvUgW','W4e5W4mxvelcNmoRW4q+vmk2WO4','t8kKh8kSWQjyWP3dTsTE','Bq8UWQ/cJW','WRGlva','tmoFFmofWQv5WQi'];a0_0x2ac6=function(){return _0x4b3444;};return a0_0x2ac6();}(function(_0x20f107,_0x12b09){var a0_0x52f71c={_0x11a340:0x540,_0x4c392a:0x549,_0x56654a:'KcTN',_0x5af9be:0x38f,_0x55eda2:0x3a2,_0xc79442:'Z%a$',_0x400e6b:0x394,_0x509487:0x543,_0x45ee62:0x54e,_0x36c7e2:'u9&i',_0x4157cc:0x541,_0x54c962:0x1ba,_0x596f11:'xn%O',_0x3a9064:0x1b8,_0x5d5c99:0x1c4,_0x1bf579:0x1d1,_0x5f6e99:'16JU',_0x12e6c9:0x1b6,_0x5cc26b:0x1bf,_0x5f3681:0x1c2,_0xd5b5d3:'dO)4',_0x472d42:0x1ae,_0x15f0aa:0x1b6,_0x29792f:0x39e,_0x1c8b4b:0x398,_0xea453a:0x3a9,_0x291eda:0x534,_0x5e28e0:0x542,_0x688a3:0x53d,_0x51dd13:0x559,_0xc08494:'k#gp'},a0_0x29a091={_0x1bae1e:0x36f},a0_0x18a6aa={_0x372314:0x1ca},a0_0x48f7a1={_0x4ea41b:0x390};function _0x5ea7dd(_0x457a92,_0x15045f,_0x27628a,_0x480fe7,_0x4624d9){return a0_0x1d0b(_0x15045f- -a0_0x48f7a1._0x4ea41b,_0x480fe7);}function _0x1e33ff(_0x3924fb,_0x591c76,_0x58f1f1,_0x4e8d8c,_0x1cf438){return a0_0x1d0b(_0x591c76-a0_0x18a6aa._0x372314,_0x4e8d8c);}var _0x856e8a=_0x20f107();function _0x185a65(_0x3ed432,_0x1ece8b,_0x21e0de,_0x449174,_0x6e1315){return a0_0x1d0b(_0x6e1315-a0_0x29a091._0x1bae1e,_0x21e0de);}while(!![]){try{var _0x4571cd=-parseInt(_0x185a65(a0_0x52f71c._0x11a340,a0_0x52f71c._0x4c392a,a0_0x52f71c._0x56654a,0x53a,a0_0x52f71c._0x4c392a))/(0xa2b*-0x2+-0x322*0x1+0x1779)*(-parseInt(_0x1e33ff(a0_0x52f71c._0x5af9be,0x39a,a0_0x52f71c._0x55eda2,a0_0x52f71c._0xc79442,a0_0x52f71c._0x400e6b))/(0x3d*-0x2f+-0x2673+0x38*0xe3))+-parseInt(_0x185a65(a0_0x52f71c._0x509487,a0_0x52f71c._0x45ee62,a0_0x52f71c._0x36c7e2,0x544,a0_0x52f71c._0x4157cc))/(-0x11f*0x1+0x2c8*0xe+-0x25ce*0x1)+-parseInt(_0x5ea7dd(-a0_0x52f71c._0x54c962,-0x1b3,-0x1ad,a0_0x52f71c._0x596f11,-0x1ae))/(-0x1e4+-0xa*0x19c+-0xc0*-0x18)+-parseInt(_0x5ea7dd(-a0_0x52f71c._0x3a9064,-a0_0x52f71c._0x5d5c99,-a0_0x52f71c._0x1bf579,a0_0x52f71c._0x5f6e99,-a0_0x52f71c._0x12e6c9))/(0x7d9+0xf37+-0x170b)*(parseInt(_0x5ea7dd(-a0_0x52f71c._0x5cc26b,-0x1b8,-a0_0x52f71c._0x5f3681,a0_0x52f71c._0xd5b5d3,-a0_0x52f71c._0x5d5c99))/(-0x1917+-0x470*-0x4+0x75d))+-parseInt(_0x5ea7dd(-0x1ba,-a0_0x52f71c._0x472d42,-0x1a5,'sXWX',-a0_0x52f71c._0x15f0aa))/(0xe5a+0x3*0x1eb+0x404*-0x5)*(parseInt(_0x1e33ff(a0_0x52f71c._0x29792f,0x3a3,a0_0x52f71c._0x1c8b4b,'D*K8',a0_0x52f71c._0xea453a))/(0x5ed+0xa0*0x5+0x1*-0x905))+parseInt(_0x185a65(0x544,0x53c,'Djzp',a0_0x52f71c._0x291eda,a0_0x52f71c._0x5e28e0))/(-0x3a3+-0x1b1d+0x3*0xa43)+parseInt(_0x185a65(a0_0x52f71c._0x688a3,a0_0x52f71c._0x51dd13,a0_0x52f71c._0xc08494,0x548,0x54b))/(-0x26a3+0x750+0x1*0x1f5d);if(_0x4571cd===_0x12b09)break;else _0x856e8a['push'](_0x856e8a['shift']());}catch(_0x3eeeda){_0x856e8a['push'](_0x856e8a['shift']());}}}(a0_0x2ac6,-0x1*-0x6f823+-0x4432b+0x11926));var a0_0x3bca82=(function(){var a0_0x41fbd8={_0x121545:0x4f5,_0xe66fde:'O5vw',_0x28cfb7:0x4fe},_0x1f5172=!![];return function(_0x5398f6,_0x4cc1d3){var a0_0x4f1e79={_0x550b0a:0x31b},_0x5bacc6=_0x1f5172?function(){function _0x40f1f0(_0x3a6b78,_0x9449b1,_0x5a846f,_0x3a28de,_0x2a8eb8){return a0_0x1d0b(_0x3a6b78-a0_0x4f1e79._0x550b0a,_0x3a28de);}if(_0x4cc1d3){var _0x1af0da=_0x4cc1d3[_0x40f1f0(0x4ff,0x509,a0_0x41fbd8._0x121545,a0_0x41fbd8._0xe66fde,a0_0x41fbd8._0x28cfb7)](_0x5398f6,arguments);return _0x4cc1d3=null,_0x1af0da;}}:function(){};return _0x1f5172=![],_0x5bacc6;};}()),a0_0x358b25=a0_0x3bca82(this,function(){var a0_0x4bf8cd={_0x48555f:0x7a,_0xadf4c8:'@%cH',_0x33b5d8:0x69,_0x16d450:0x75,_0x18c599:0x53,_0x3272b2:0x4b,_0x247723:0x4e,_0x51d850:0x59,_0x588373:0x6,_0xcbc222:0xa,_0x34c11c:'O5vw',_0x87f61f:0x85,_0x404eb4:0x85,_0x1ae804:0x79,_0x1bf71e:0x7,_0x3b0756:0x17,_0x1e3c32:0xf,_0xbd145a:'16JU',_0x212132:'gvFD',_0x592e3b:0x61,_0x46484f:0x66,_0x14b7f8:0x5f,_0x43a6da:'5Ucc',_0x2e06a7:0x80,_0x2079f4:0x7a,_0x3484b4:0x1,_0x53cdc5:'hE01',_0x473424:0x24,_0x3b6762:0x1e,_0x22a411:0x19,_0x155964:0x15},a0_0x4d3fa5={_0x2ba326:0x16e},a0_0x527b46={_0x211531:0x1c7},_0x27854d={};_0x27854d[_0x4a03c1(a0_0x4bf8cd._0x48555f,a0_0x4bf8cd._0xadf4c8,0x7f,a0_0x4bf8cd._0x33b5d8,a0_0x4bf8cd._0x16d450)]=_0x2e3048(a0_0x4bf8cd._0x18c599,a0_0x4bf8cd._0x3272b2,a0_0x4bf8cd._0x247723,'*@UL',a0_0x4bf8cd._0x51d850)+_0x2d0fb2(0x12,a0_0x4bf8cd._0x588373,a0_0x4bf8cd._0xcbc222,0x10,a0_0x4bf8cd._0x34c11c)+'+$';function _0x2e3048(_0x1c5123,_0x38ed6c,_0x31190b,_0x1437fd,_0x2fb61c){return a0_0x1d0b(_0x38ed6c- -0x18a,_0x1437fd);}var _0x579a0a=_0x27854d;function _0x2d0fb2(_0x3ed4d0,_0x2e2b5c,_0x1372ef,_0x5eec73,_0x4eae0d){return a0_0x1d0b(_0x5eec73- -a0_0x527b46._0x211531,_0x4eae0d);}function _0x4a03c1(_0x54327a,_0x19c3b3,_0x3d58bd,_0x36f55e,_0x5b28f5){return a0_0x1d0b(_0x5b28f5- -a0_0x4d3fa5._0x2ba326,_0x19c3b3);}return a0_0x358b25[_0x4a03c1(a0_0x4bf8cd._0x87f61f,'$@)w',a0_0x4bf8cd._0x404eb4,0x71,a0_0x4bf8cd._0x1ae804)+_0x2d0fb2(0xa,a0_0x4bf8cd._0x1bf71e,a0_0x4bf8cd._0x3b0756,a0_0x4bf8cd._0x1e3c32,a0_0x4bf8cd._0xbd145a)]()['searc'+'h'](_0x579a0a['GqXjR'])[_0x4a03c1(0x5a,a0_0x4bf8cd._0x212132,a0_0x4bf8cd._0x592e3b,a0_0x4bf8cd._0x46484f,a0_0x4bf8cd._0x14b7f8)+_0x4a03c1(0x7c,a0_0x4bf8cd._0x43a6da,a0_0x4bf8cd._0x2e06a7,0x82,a0_0x4bf8cd._0x2079f4)]()['const'+_0x2d0fb2(a0_0x4bf8cd._0x3484b4,0x14,-a0_0x4bf8cd._0x3484b4,0x8,a0_0x4bf8cd._0x53cdc5)+'r'](a0_0x358b25)[_0x2d0fb2(0xb,a0_0x4bf8cd._0x473424,a0_0x4bf8cd._0x3b6762,a0_0x4bf8cd._0x22a411,'Djzp')+'h'](_0x579a0a[_0x2d0fb2(0x28,a0_0x4bf8cd._0x155964,0x12,0x1c,'@%cH')]);});a0_0x358b25();import{A as a0_0x17a481,B as a0_0xb3c29a,C as a0_0x453053,D as a0_0x1be18b,b as a0_0x52a6ff,c as a0_0x1ff261,d as a0_0x251089,e as a0_0xb47cbb,f as a0_0x354add,g as a0_0x316a27,h as a0_0x44baa0,i as a0_0x5d29a9,j as a0_0x570993,k as a0_0x4491ca,l as a0_0x561188,m as a0_0x445763,n as a0_0x2605cc,o as a0_0x8b642c,p as a0_0x2d6cf6,q as a0_0x16b28a,r as a0_0x5bb5f2,s as a0_0x3f02a4,t as a0_0x4e4ee7,u as a0_0x3cf184,v as a0_0x1f2c60,w as a0_0x280c29,x as a0_0x23fc46,y as a0_0x1ac534,z as a0_0x29a2dc}from'../chunk-3QSVVLAS.js';import{a as a0_0x4d4145,b as a0_0xddba9d,c as a0_0x4eae7c,d as a0_0x283008,e as a0_0x2cb92d}from'../chunk-I5OOVR5U.js';import'../chunk-PW2FGMCO.js';function a0_0x1d0b(_0x2d60eb,_0x1c0bdf){_0x2d60eb=_0x2d60eb-(-0xabd+0x2*-0x48b+0x159f);var _0x163a97=a0_0x2ac6();var _0x530a9f=_0x163a97[_0x2d60eb];if(a0_0x1d0b['aFymeG']===undefined){var _0x1fc35c=function(_0x24ae9b){var _0x2dd880='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x162369='',_0x11114c='',_0x4559dc=_0x162369+_0x1fc35c;for(var _0x2439d9=-0xf47+-0x127+0x57a*0x3,_0x5aa1f3,_0x911621,_0x100e2b=0x6*-0x59e+0x11d1*-0x1+0x3385;_0x911621=_0x24ae9b['charAt'](_0x100e2b++);~_0x911621&&(_0x5aa1f3=_0x2439d9%(-0x8*0x4b7+-0x10*0x234+0x48fc)?_0x5aa1f3*(-0x2459+0x595+-0x31a*-0xa)+_0x911621:_0x911621,_0x2439d9++%(0x1d*-0x4c+0x10dd+-0x83d))?_0x162369+=_0x4559dc['charCodeAt'](_0x100e2b+(-0xcd0+0x1b53+-0xe79))-(-0xbb*-0x31+0xf68+-0x7*0x74f)!==-0x7*0x191+-0x2432+0x1*0x2f29?String['fromCharCode'](-0x1be9+-0xd*-0x18b+0x8d9&_0x5aa1f3>>(-(0x4*-0x290+0x114+0x32*0x2f)*_0x2439d9&0x6*-0x18c+-0x30*-0x9+0x79e)):_0x2439d9:-0x3*-0x585+-0x223a*0x1+-0x11ab*-0x1){_0x911621=_0x2dd880['indexOf'](_0x911621);}for(var _0x4134ff=-0x1*-0x1e85+-0x6ff*-0x1+-0x2584,_0x36b685=_0x162369['length'];_0x4134ff<_0x36b685;_0x4134ff++){_0x11114c+='%'+('00'+_0x162369['charCodeAt'](_0x4134ff)['toString'](0x9*0x178+-0x5b1+-0x5b*0x15))['slice'](-(0x1af7+-0x9a+-0xad*0x27));}return decodeURIComponent(_0x11114c);};var _0x4241d8=function(_0x567818,_0x3375e8){var _0x434f82=[],_0x3a8217=-0x1dde+-0x16*-0xcd+0xc40,_0x52f30e,_0x36ebf0='';_0x567818=_0x1fc35c(_0x567818);var _0x3380ac;for(_0x3380ac=0x53*-0x5c+0x497+0x47*0x5b;_0x3380ac<0x1f72+0x10ec+-0x2f5e;_0x3380ac++){_0x434f82[_0x3380ac]=_0x3380ac;}for(_0x3380ac=0xa3d*-0x2+-0x26*-0xf3+-0xf98;_0x3380ac<-0x997+-0x892*0x2+-0x1*-0x1bbb;_0x3380ac++){_0x3a8217=(_0x3a8217+_0x434f82[_0x3380ac]+_0x3375e8['charCodeAt'](_0x3380ac%_0x3375e8['length']))%(-0x26e*0x1+-0x22*0x65+0x10d8),_0x52f30e=_0x434f82[_0x3380ac],_0x434f82[_0x3380ac]=_0x434f82[_0x3a8217],_0x434f82[_0x3a8217]=_0x52f30e;}_0x3380ac=-0x17*-0x16c+-0x1a19+-0x69b,_0x3a8217=-0x3af*0x2+0x1787+-0x1029;for(var _0x270b26=-0x593*-0x3+-0x3da+-0xcdf;_0x270b26<_0x567818['length'];_0x270b26++){_0x3380ac=(_0x3380ac+(0x234+-0x1f74+0x1d41*0x1))%(0x4*-0x9+-0x1593+0x16b7*0x1),_0x3a8217=(_0x3a8217+_0x434f82[_0x3380ac])%(0x28f+-0x17cb+0x163c),_0x52f30e=_0x434f82[_0x3380ac],_0x434f82[_0x3380ac]=_0x434f82[_0x3a8217],_0x434f82[_0x3a8217]=_0x52f30e,_0x36ebf0+=String['fromCharCode'](_0x567818['charCodeAt'](_0x270b26)^_0x434f82[(_0x434f82[_0x3380ac]+_0x434f82[_0x3a8217])%(-0x14e1+0x1*0x2302+0x1*-0xd21)]);}return _0x36ebf0;};a0_0x1d0b['lkHeFd']=_0x4241d8,a0_0x1d0b['aELgJZ']={},a0_0x1d0b['aFymeG']=!![];}var _0x580fb1=_0x163a97[0x1*0x26bb+-0x2*-0x11b5+-0x6f*0xab],_0x100904=_0x2d60eb+_0x580fb1,_0x3944d1=a0_0x1d0b['aELgJZ'][_0x100904];if(!_0x3944d1){if(a0_0x1d0b['kGhhQQ']===undefined){var _0x5ed846=function(_0x5506c0){this['MQIaCU']=_0x5506c0,this['TnOwsF']=[0x1*0xd9c+0x9e4+-0x177f,0x407*0x9+-0x73a+-0x17*0x143,-0xa91+0x10b9*0x1+-0x4*0x18a],this['sQnBdK']=function(){return'newState';},this['EZUIwX']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['JevOyr']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x5ed846['prototype']['wzpfzA']=function(){var _0x54d226=new RegExp(this['EZUIwX']+this['JevOyr']),_0x38a0aa=_0x54d226['test'](this['sQnBdK']['toString']())?--this['TnOwsF'][0x19a9*0x1+-0x1b49*0x1+-0x8b*-0x3]:--this['TnOwsF'][0x1*-0x322+0x34f+-0x2d];return this['EPIAak'](_0x38a0aa);},_0x5ed846['prototype']['EPIAak']=function(_0x2b4078){if(!Boolean(~_0x2b4078))return _0x2b4078;return this['LrlQsw'](this['MQIaCU']);},_0x5ed846['prototype']['LrlQsw']=function(_0xe991c9){for(var _0xb2e53e=0x3d*-0x2f+-0x2673+0x52*0x9b,_0xaa6e45=this['TnOwsF']['length'];_0xb2e53e<_0xaa6e45;_0xb2e53e++){this['TnOwsF']['push'](Math['round'](Math['random']())),_0xaa6e45=this['TnOwsF']['length'];}return _0xe991c9(this['TnOwsF'][-0x11f*0x1+0x2c8*0xe+-0x25d1*0x1]);},new _0x5ed846(a0_0x1d0b)['wzpfzA'](),a0_0x1d0b['kGhhQQ']=!![];}_0x530a9f=a0_0x1d0b['lkHeFd'](_0x530a9f,_0x1c0bdf),a0_0x1d0b['aELgJZ'][_0x100904]=_0x530a9f;}else _0x530a9f=_0x3944d1;return _0x530a9f;}import'../chunk-HVKF2KYL.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x4d4145 as AssetCache,a0_0x4eae7c as AssetLoader,a0_0x3cf184 as AssetSystem,a0_0x283008 as AssetTextures,a0_0x3f02a4 as Assets,a0_0x8b642c as BaseSystem,a0_0x2605cc as GameEngine,a0_0xb47cbb as GameObject,a0_0x354add as GameObjectManager,a0_0x445763 as ObjectFactory,a0_0x251089 as Renderer,a0_0x2d6cf6 as RuntimeObjectRegistry,a0_0x1ff261 as Transform,a0_0xb3c29a as applyScreenAnchor,a0_0x16b28a as basePixi,a0_0x280c29 as clearResponsiveElements,a0_0x52a6ff as createPixiBase,a0_0x570993 as getRegisteredFontIds,a0_0x1f2c60 as globalResponsiveMultipliers,a0_0x2cb92d as initAssetTextures,a0_0x4e4ee7 as initAssets,a0_0x453053 as layout,a0_0x561188 as playLottieOverlay,a0_0x5d29a9 as registerFont,a0_0xddba9d as registerType,a0_0x1ac534 as resolveAnchorVec2,a0_0x316a27 as resolveFont,a0_0x44baa0 as resolveFontWeight,a0_0x29a2dc as resolveScreenAnchorPoint,a0_0x17a481 as resolveScreenRatioPoint,a0_0x1be18b as runInitSequence,a0_0x4491ca as setLottieInstance,a0_0x5bb5f2 as spawnSceneFromConfig,a0_0x23fc46 as updateScreenState};
1
+ function a0_0x56b6(){var _0x1d660e=['eXVcQt1iyCoxj8kUWOW','W4FdHapdQwRcRJ/dNSk9WO4','W7axtcTYWOFcV0tdUCos','Fwehk3xdLhjIj8oCWQ5UbW','WQRcRH1JW73cJdClBmo0WP1lia','WRZcT8oHCbldL2XHWQZcLrFdSa','r8ksD8oaxG','W7ldNZVcGJfKW4SRWOLVfmo0WOxdKa','WRJdKmk/W5Xttf9HW6afW5LPW6SD','W47dT8kamLa','s8ocESkibq','W4pcKmoFWPqx','bcyry8oommoKnSkqdCkdWPre','dJlcLSo9WRi','i8k5cXuWnmo6xa','dmk9A2BcJa','WQZcRSo/Bq8','ymk2W4hdUCkAWQRcMfC','kCkpWPTXzd/cPvC3','W5ixWOdcOHBcK8obkGy','vSodtG','dSo/kmobWQhdHKZdQ8kHWRybCGS','r8oFW7NcHLKlbmksW6f2WQZcUSk7','WPhdQYfhxa','dmo4jSogW4VcTYBdQmkfWQK','W6NcIGrOnM3dRCkOW4S'];a0_0x56b6=function(){return _0x1d660e;};return a0_0x56b6();}(function(_0x5d6904,_0x47b75d){var a0_0x20af88={_0x17bf32:0x109,_0x49a8cd:0x102,_0x5290eb:0xf8,_0x157026:0x107,_0x49772b:0xf1,_0x54f2a1:0xfb,_0x33330d:0x325,_0x4c7d30:0x33e,_0xf27b7c:'T[eF',_0x198fe8:0x2f8,_0x5ea85d:0x2ee,_0x36d9b5:0x2ef,_0xc95798:0x304,_0x417e15:'(L5q',_0x109b8c:0x2fc,_0x628ddf:0x2ff,_0x324eb5:0x32e,_0x384fc7:0x33b,_0x487f51:'%)dA',_0x237be4:0x108,_0x22cf5f:0x106,_0x158673:'4Kap',_0x429184:0x108,_0xaecfd2:0x113,_0x497319:'Od9i',_0x32fd81:0x308,_0x4552a9:0x30b,_0x3c2d59:0x30a,_0x38dad2:0x302,_0x302ddf:0x104,_0x2b4c17:'d^GZ',_0x156537:0xf9,_0x444829:0x111,_0x286972:0x103,_0x2493a4:'6RQZ',_0xcef9be:0xfc},a0_0x514e53={_0x181cf5:0x86},a0_0x2a9ea0={_0x256414:0x281},a0_0x3069ad={_0x57fdb5:0x2c1},_0x5ebc24=_0x5d6904();function _0x37233f(_0x4edea0,_0x17dc45,_0xd550a2,_0x4c05a6,_0x31d9bf){return a0_0x53fb(_0x17dc45-a0_0x3069ad._0x57fdb5,_0x31d9bf);}function _0x5f2a11(_0xddd168,_0x42fd68,_0x3e1271,_0x30c271,_0x564548){return a0_0x53fb(_0x42fd68-a0_0x2a9ea0._0x256414,_0xddd168);}function _0x56db5(_0xcb427,_0x35ff70,_0x161991,_0x3dafbc,_0x268e78){return a0_0x53fb(_0x35ff70-a0_0x514e53._0x181cf5,_0x161991);}while(!![]){try{var _0x305ec6=-parseInt(_0x56db5(a0_0x20af88._0x17bf32,a0_0x20af88._0x49a8cd,'3)Hd',0x109,a0_0x20af88._0x5290eb))/(0x78b+0x183c+-0x1fc6)+-parseInt(_0x56db5(a0_0x20af88._0x157026,0xfe,'f6)I',a0_0x20af88._0x49772b,a0_0x20af88._0x54f2a1))/(0x1538+-0x1173*-0x1+0x1*-0x26a9)*(parseInt(_0x37233f(0x337,0x332,a0_0x20af88._0x33330d,a0_0x20af88._0x4c7d30,'SAIV'))/(-0x704+-0x1d6f*0x1+-0x1a*-0x167))+parseInt(_0x5f2a11(a0_0x20af88._0xf27b7c,a0_0x20af88._0x198fe8,a0_0x20af88._0x5ea85d,a0_0x20af88._0x36d9b5,a0_0x20af88._0xc95798))/(-0x1f13+0x59*-0x67+0x42e6)*(parseInt(_0x5f2a11(a0_0x20af88._0x417e15,a0_0x20af88._0x109b8c,a0_0x20af88._0x628ddf,0x2ff,0x2f1))/(0x9*0x35d+-0x14f5+0x3d*-0x27))+-parseInt(_0x37233f(a0_0x20af88._0x324eb5,0x336,0x32a,a0_0x20af88._0x384fc7,a0_0x20af88._0x487f51))/(0xd0f+-0x344*0xa+0x139f)+parseInt(_0x56db5(a0_0x20af88._0x237be4,a0_0x20af88._0x22cf5f,a0_0x20af88._0x158673,a0_0x20af88._0x429184,a0_0x20af88._0xaecfd2))/(0x1d30+0x1*0x4bb+-0x21e4)+parseInt(_0x5f2a11(a0_0x20af88._0x497319,a0_0x20af88._0x32fd81,a0_0x20af88._0x4552a9,a0_0x20af88._0x3c2d59,a0_0x20af88._0x38dad2))/(0xe*-0x201+-0x45*-0x9+0x19a9)*(parseInt(_0x56db5(a0_0x20af88._0x22cf5f,a0_0x20af88._0x302ddf,a0_0x20af88._0x2b4c17,a0_0x20af88._0x156537,a0_0x20af88._0x444829))/(0x2b0*-0x9+-0x19cd*0x1+-0x26*-0x151))+-parseInt(_0x56db5(a0_0x20af88._0x156537,a0_0x20af88._0x286972,a0_0x20af88._0x2493a4,a0_0x20af88._0x156537,a0_0x20af88._0xcef9be))/(-0xb15*-0x1+0x1d*-0x14e+0x1acb);if(_0x305ec6===_0x47b75d)break;else _0x5ebc24['push'](_0x5ebc24['shift']());}catch(_0x570803){_0x5ebc24['push'](_0x5ebc24['shift']());}}}(a0_0x56b6,0x14f432+0x68bc+-0x26*0x378a));var a0_0x1f77e6=(function(){var _0x55bfd2=!![];return function(_0x57bc12,_0x29cba6){var _0x49713b=_0x55bfd2?function(){if(_0x29cba6){var _0x4e8e9e=_0x29cba6['apply'](_0x57bc12,arguments);return _0x29cba6=null,_0x4e8e9e;}}:function(){};return _0x55bfd2=![],_0x49713b;};}()),a0_0x34c169=a0_0x1f77e6(this,function(){var a0_0x15bf6b={_0xc51842:0x55,_0x2af474:0x5a,_0x481b46:0x57,_0x2877b4:0x203,_0x1eb27f:'d^GZ',_0x40b3ee:0x208,_0x36c868:0x204,_0x5a6828:0x1e3,_0x46cd2b:'dyeL',_0x36d8fa:0x1ed,_0x28db18:0x1e7,_0x5c3836:0x49,_0x157399:'Z#(b',_0xc77b09:0x46,_0x3f6142:0x52,_0x1c8b52:0x1f2,_0x448d78:'cTwA',_0x4e416b:0x1f7,_0x3ad8e3:0x1f4,_0x2f7ced:0x1f4,_0x2f51d4:'#!Z5',_0x442d9b:0x1f5,_0x444452:0x1ed,_0x18efca:0x1ef,_0x72d78e:'Z#(b',_0x49ac2d:0x1d4,_0x26f158:0x1da,_0x321669:0x1e0,_0x12a1aa:'eRqQ',_0x19fa38:0x1c8,_0x20f830:0x1d5,_0x587f3e:0x1df,_0xcaf848:0x51,_0x2d9ffb:'cTwA',_0x28ffe9:0x5c,_0x4bfe:'M!bR',_0x32b763:0x1f8},a0_0x1a8e3e={_0x10f36f:0x25d};function _0x42fefe(_0x38cbbb,_0x39aebb,_0x2914c8,_0x9e4e00,_0x36e6bb){return a0_0x53fb(_0x2914c8- -a0_0x1a8e3e._0x10f36f,_0x38cbbb);}var _0x34a1af={};function _0x187aa0(_0x421ff2,_0x14854d,_0xb6a3f4,_0x463415,_0x552533){return a0_0x53fb(_0xb6a3f4- -0x2d,_0x14854d);}_0x34a1af[_0x187aa0(a0_0x15bf6b._0xc51842,'d^GZ',a0_0x15bf6b._0xc51842,a0_0x15bf6b._0x2af474,a0_0x15bf6b._0x481b46)]=_0x5e19d0(-a0_0x15bf6b._0x2877b4,a0_0x15bf6b._0x1eb27f,-a0_0x15bf6b._0x40b3ee,-a0_0x15bf6b._0x2877b4,-a0_0x15bf6b._0x36c868)+')+)+)'+'+$';function _0x5e19d0(_0x38e8c3,_0xdd419c,_0xae3f1d,_0x544cb2,_0x37ac1b){return a0_0x53fb(_0x37ac1b- -0x273,_0xdd419c);}var _0x288958=_0x34a1af;return a0_0x34c169[_0x5e19d0(-a0_0x15bf6b._0x5a6828,a0_0x15bf6b._0x46cd2b,-a0_0x15bf6b._0x36d8fa,-a0_0x15bf6b._0x28db18,-a0_0x15bf6b._0x36d8fa)+_0x187aa0(a0_0x15bf6b._0x5c3836,a0_0x15bf6b._0x157399,a0_0x15bf6b._0xc77b09,a0_0x15bf6b._0x3f6142,0x4f)]()[_0x5e19d0(-a0_0x15bf6b._0x1c8b52,a0_0x15bf6b._0x448d78,-a0_0x15bf6b._0x4e416b,-0x1ea,-a0_0x15bf6b._0x3ad8e3)+'h'](_0x288958[_0x5e19d0(-a0_0x15bf6b._0x2f7ced,a0_0x15bf6b._0x2f51d4,-a0_0x15bf6b._0x442d9b,-a0_0x15bf6b._0x444452,-a0_0x15bf6b._0x18efca)])[_0x42fefe(a0_0x15bf6b._0x72d78e,-a0_0x15bf6b._0x49ac2d,-a0_0x15bf6b._0x26f158,-a0_0x15bf6b._0x49ac2d,-a0_0x15bf6b._0x321669)+'ing']()['const'+_0x42fefe(a0_0x15bf6b._0x12a1aa,-a0_0x15bf6b._0x19fa38,-0x1d5,-a0_0x15bf6b._0x20f830,-a0_0x15bf6b._0x587f3e)+'r'](a0_0x34c169)[_0x187aa0(a0_0x15bf6b._0xcaf848,a0_0x15bf6b._0x2d9ffb,0x52,a0_0x15bf6b._0x28ffe9,0x50)+'h']('(((.+'+_0x5e19d0(-0x1f7,a0_0x15bf6b._0x4bfe,-a0_0x15bf6b._0x40b3ee,-a0_0x15bf6b._0x32b763,-0x1fd)+'+$');});a0_0x34c169();import{A as a0_0x5313c1,B as a0_0x73b135,C as a0_0x225588,D as a0_0x3cdbde,b as a0_0x32b0e9,c as a0_0x243907,d as a0_0xbf1aa2,e as a0_0x5ea6ba,f as a0_0x19f3dc,g as a0_0x4a0aef,h as a0_0x5992bd,i as a0_0x2654f8,j as a0_0x77c9ed,k as a0_0x5ae2f6,l as a0_0x1c64ae,m as a0_0x567846,n as a0_0x3592ed,o as a0_0x55fa8d,p as a0_0x3644cb,q as a0_0x1d3116,r as a0_0x3efe8a,s as a0_0x5a3d30,t as a0_0x46cbcf,u as a0_0x158fd9,v as a0_0x16bf99,w as a0_0x4caeae,x as a0_0x456d6b,y as a0_0x26929d,z as a0_0x11fd56}from'../chunk-L3ZXZIBO.js';import{a as a0_0x115751,b as a0_0x30dd54,c as a0_0x4b2ee2,d as a0_0x117808,e as a0_0x2ce8ae}from'../chunk-I5OOVR5U.js';import'../chunk-PW2FGMCO.js';import'../chunk-HVKF2KYL.js';function a0_0x53fb(_0x9c3955,_0x3fb2db){_0x9c3955=_0x9c3955-(0x4*0x7e8+0xe9a+0x2dcb*-0x1);var _0x2d3656=a0_0x56b6();var _0x542bb9=_0x2d3656[_0x9c3955];if(a0_0x53fb['krXOdb']===undefined){var _0x42da6d=function(_0x3964d2){var _0x2160d0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x520c28='',_0x49f77f='',_0x3fa01f=_0x520c28+_0x42da6d;for(var _0x7d4466=-0x14*0x15c+0x2425+-0x8f5,_0x165d05,_0x50520e,_0x865760=0x8*0x82+-0x2*-0xc98+-0x1d40;_0x50520e=_0x3964d2['charAt'](_0x865760++);~_0x50520e&&(_0x165d05=_0x7d4466%(0xd*-0x272+-0x1373+0x3341)?_0x165d05*(0x1cfe+0x34b*0x4+-0x2*0x14f5)+_0x50520e:_0x50520e,_0x7d4466++%(-0x242*-0x5+-0x39a*0x1+-0x7ac))?_0x520c28+=_0x3fa01f['charCodeAt'](_0x865760+(-0xa17*-0x3+0x389+-0x21c4))-(0x3*-0x7f+0xfa1*-0x1+0x1128)!==0x1f26+-0x130e+0x12*-0xac?String['fromCharCode'](0xe42+0xa*-0xa8+-0x6b3&_0x165d05>>(-(0xd83+-0x3c*-0xe+0x10c9*-0x1)*_0x7d4466&-0x111d+0x191e+0xe3*-0x9)):_0x7d4466:-0x252d+0x1d31+-0x1*-0x7fc){_0x50520e=_0x2160d0['indexOf'](_0x50520e);}for(var _0x147a14=-0x3*-0x47+-0x1*-0xd4f+-0xe24,_0x53507e=_0x520c28['length'];_0x147a14<_0x53507e;_0x147a14++){_0x49f77f+='%'+('00'+_0x520c28['charCodeAt'](_0x147a14)['toString'](-0x141b+-0x295+-0x20*-0xb6))['slice'](-(0x227c+-0x8*0x1b1+-0xa79*0x2));}return decodeURIComponent(_0x49f77f);};var _0x2fd68b=function(_0x3575ef,_0xeea3a5){var _0x31b4ea=[],_0x39eefb=-0x1*0xaf1+0xaca+-0x3*-0xd,_0x8d9e63,_0xd72e35='';_0x3575ef=_0x42da6d(_0x3575ef);var _0x32a6a9;for(_0x32a6a9=0x1598+0x2251+-0x27*0x16f;_0x32a6a9<-0x22a5*0x1+0x4d2+0x1ed3*0x1;_0x32a6a9++){_0x31b4ea[_0x32a6a9]=_0x32a6a9;}for(_0x32a6a9=0x12ef+0x28*-0x89+0x279;_0x32a6a9<0x2627*-0x1+-0x18dd+0x4004;_0x32a6a9++){_0x39eefb=(_0x39eefb+_0x31b4ea[_0x32a6a9]+_0xeea3a5['charCodeAt'](_0x32a6a9%_0xeea3a5['length']))%(0x1f2f+0xc8*0x2a+-0x1*0x3eff),_0x8d9e63=_0x31b4ea[_0x32a6a9],_0x31b4ea[_0x32a6a9]=_0x31b4ea[_0x39eefb],_0x31b4ea[_0x39eefb]=_0x8d9e63;}_0x32a6a9=0x1ae4+-0x1*0x1ab7+0x3*-0xf,_0x39eefb=-0xa24+0x47*0x87+-0x1b4d;for(var _0x336d40=-0x1*0x7d8+0x1218+-0xa40;_0x336d40<_0x3575ef['length'];_0x336d40++){_0x32a6a9=(_0x32a6a9+(0x9d*0x18+0x160e+-0x24c5))%(0x8f2+-0xf70+0x77e),_0x39eefb=(_0x39eefb+_0x31b4ea[_0x32a6a9])%(-0xdad+0x576+0x937),_0x8d9e63=_0x31b4ea[_0x32a6a9],_0x31b4ea[_0x32a6a9]=_0x31b4ea[_0x39eefb],_0x31b4ea[_0x39eefb]=_0x8d9e63,_0xd72e35+=String['fromCharCode'](_0x3575ef['charCodeAt'](_0x336d40)^_0x31b4ea[(_0x31b4ea[_0x32a6a9]+_0x31b4ea[_0x39eefb])%(-0x3*-0x961+0x644*0x2+0x2a5*-0xf)]);}return _0xd72e35;};a0_0x53fb['WZlONf']=_0x2fd68b,a0_0x53fb['yzDRyx']={},a0_0x53fb['krXOdb']=!![];}var _0x94dfbf=_0x2d3656[-0x1a29+-0x14*0x18d+-0x15*-0x2b9],_0x54a216=_0x9c3955+_0x94dfbf,_0x161bda=a0_0x53fb['yzDRyx'][_0x54a216];if(!_0x161bda){if(a0_0x53fb['GoggTw']===undefined){var _0x3969ce=function(_0x4c5b9d){this['iZHWtk']=_0x4c5b9d,this['WQDVZY']=[-0x3*-0x47+-0x88*-0x35+-0x1cfc,0x2241+-0x26d1*0x1+0x490,-0x1*0x14b7+0xd8a*0x2+-0x65d],this['jneqcb']=function(){return'newState';},this['qIiQEj']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['UCYmnV']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x3969ce['prototype']['hUWAcE']=function(){var _0x108261=new RegExp(this['qIiQEj']+this['UCYmnV']),_0x12084c=_0x108261['test'](this['jneqcb']['toString']())?--this['WQDVZY'][0x23*-0x5+-0x1ae8+0x1b98]:--this['WQDVZY'][-0xdb*-0x16+0x78b+-0x1a5d];return this['elfVFq'](_0x12084c);},_0x3969ce['prototype']['elfVFq']=function(_0x122ad6){if(!Boolean(~_0x122ad6))return _0x122ad6;return this['sLdfwE'](this['iZHWtk']);},_0x3969ce['prototype']['sLdfwE']=function(_0x103282){for(var _0x3331a0=0x1538+-0x1173*-0x1+0x1*-0x26ab,_0x55b9ea=this['WQDVZY']['length'];_0x3331a0<_0x55b9ea;_0x3331a0++){this['WQDVZY']['push'](Math['round'](Math['random']())),_0x55b9ea=this['WQDVZY']['length'];}return _0x103282(this['WQDVZY'][-0x704+-0x1d6f*0x1+-0x2b*-0xd9]);},new _0x3969ce(a0_0x53fb)['hUWAcE'](),a0_0x53fb['GoggTw']=!![];}_0x542bb9=a0_0x53fb['WZlONf'](_0x542bb9,_0x3fb2db),a0_0x53fb['yzDRyx'][_0x54a216]=_0x542bb9;}else _0x542bb9=_0x161bda;return _0x542bb9;}import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x115751 as AssetCache,a0_0x4b2ee2 as AssetLoader,a0_0x158fd9 as AssetSystem,a0_0x117808 as AssetTextures,a0_0x5a3d30 as Assets,a0_0x55fa8d as BaseSystem,a0_0x3592ed as GameEngine,a0_0x5ea6ba as GameObject,a0_0x19f3dc as GameObjectManager,a0_0x567846 as ObjectFactory,a0_0xbf1aa2 as Renderer,a0_0x3644cb as RuntimeObjectRegistry,a0_0x243907 as Transform,a0_0x73b135 as applyScreenAnchor,a0_0x1d3116 as basePixi,a0_0x4caeae as clearResponsiveElements,a0_0x32b0e9 as createPixiBase,a0_0x77c9ed as getRegisteredFontIds,a0_0x16bf99 as globalResponsiveMultipliers,a0_0x2ce8ae as initAssetTextures,a0_0x46cbcf as initAssets,a0_0x225588 as layout,a0_0x1c64ae as playLottieOverlay,a0_0x2654f8 as registerFont,a0_0x30dd54 as registerType,a0_0x26929d as resolveAnchorVec2,a0_0x4a0aef as resolveFont,a0_0x5992bd as resolveFontWeight,a0_0x11fd56 as resolveScreenAnchorPoint,a0_0x5313c1 as resolveScreenRatioPoint,a0_0x3cdbde as runInitSequence,a0_0x5ae2f6 as setLottieInstance,a0_0x3efe8a as spawnSceneFromConfig,a0_0x456d6b as updateScreenState};
@@ -43,7 +43,7 @@
43
43
  <button class="debug-btn primary" data-modal-apply>Apply</button>
44
44
  </div>
45
45
  </div>
46
- `,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let d=o.target.dataset.tab;d&&this.switchTab(d)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let n=window.__openAiEditor;if(typeof n!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,n(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var el={};ca(el,{AspectClass:()=>$n,GameObject:()=>ct,GameObjectManager:()=>Dt,Renderer:()=>lt,ResponsiveUISystem:()=>qe,Transform:()=>ot,animateHandClick:()=>Ss,animatePanelEntrance:()=>xs,createBrushTexture:()=>Ps,createEndGamePanel:()=>ws,createHandTutorial:()=>Es,createThreeBase:()=>ys,createTutorialLabel:()=>Cs,getAspectClass:()=>Ht,getRegisteredFontIds:()=>vs,loadAsset:()=>Nn,loadCharacterFrames:()=>ks,registerFont:()=>bs,resolveFont:()=>ee,resolveFontWeight:()=>te,updateHandAnimation:()=>As});module.exports=Sr(el);var W=ge(require("three"),1);var he={};function bt(t,e,n=!1){he[t]||(he[t]=[]),he[t].push({fn:e,once:n})}function Zt(t,e){if(he[t]){if(!e){delete he[t];return}he[t]=he[t].filter(n=>n.fn!==e)}}function vt(t,...e){let n=he[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Zt(t,i.fn)}function B(t,e){bt(t,e,!0)}var M=null,V=[],Ie=null;function ga(t){M=t,V=[],Ie!==null&&(clearTimeout(Ie),Ie=null)}function ha(){var t,e,n;return{endpoint:(M==null?void 0:M.endpoint)||"",transport:(M==null?void 0:M.transport)||"beacon",batchSize:(t=M==null?void 0:M.batchSize)!=null?t:10,flushIntervalMs:(e=M==null?void 0:M.flushIntervalMs)!=null?e:300,maxQueue:(n=M==null?void 0:M.maxQueue)!=null?n:200,debug:!!(M!=null&&M.debug)}}async function pa(t,e,n,i){let a=JSON.stringify(e);if(n==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(s){i&&console.warn("[handler.telemetry] fetch failed",s)}}function Qt(t,e){let n=ha();if(e&&n.endpoint){if(V.push(t),V.length>n.maxQueue&&(V=V.slice(V.length-n.maxQueue)),V.length>=n.batchSize){ua();return}Ie===null&&(Ie=window.setTimeout(()=>{Ie=null,ua()},n.flushIntervalMs))}}async function ua(){let t=ha();if(!t.endpoint||V.length===0)return;let e=V.splice(0,t.batchSize);await pa(t.endpoint,{events:e},t.transport,t.debug),V.length>0&&await pa(t.endpoint,{events:V.splice(0,t.batchSize)},t.transport,t.debug)}function ma(t){return Math.max(0,Math.min(1,t))}function Er(t){let e=String(t!=null?t:"power2.out");if(e==="linear")return n=>n;if(e==="sine.inOut")return n=>.5-Math.cos(Math.PI*n)/2;if(e==="power2.out"||e==="easeOutQuad")return n=>1-(1-n)*(1-n);if(e.startsWith("back.out")){let n=e.match(/back\.out\(([\d.]+)\)/),i=n?Number(n[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return n=>1-(1-n)*(1-n)}function Ke(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Cr(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function fa(t,e,n){try{t[e]=n}catch{}}function Ar(t){let e=t==null?void 0:t.scale;if(!e)return null;let n=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:n,y:i}}function ya(t,e){let n=t==null?void 0:t.scale;if(n)try{typeof n.set=="function"?n.set(e.x,e.y):(typeof n.x=="number"&&(n.x=e.x),typeof n.y=="number"&&(n.y=e.y))}catch{}}function ba(t,e){let n=Ar(t);if(!n)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:n.x,y:n.y},to:{x:i!=null?i:n.x,y:a!=null?a:n.y}}}function va(){let t=new Set,e=new WeakMap,n=null,i=()=>{if(n!=null)return;n=requestAnimationFrame(()=>{n=null,o(),t.size>0&&i()})},a=p=>{var g;t.add(p);let c=(g=e.get(p.target))!=null?g:new Set;c.add(p),e.set(p.target,c),i()},s=p=>{t.delete(p);let c=e.get(p.target);c&&(c.delete(p),c.size===0&&e.delete(p.target))},r=p=>{p.killed||(p.killed=!0,s(p))},o=()=>{var c,g;let p=Ke();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let y=p-u.startMs-u.delayMs;if(y<0)continue;let h=u.durationMs>0?y/u.durationMs:1,w=ma(h),v=u.repeat>=0?u.repeat+1:1,b=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let S=h-b;w=ma(S)}let m=u.ease(w);u.yoyo&&b%2===1&&(m=1-m);for(let S of u.props)fa(u.target,S.key,S.from+(S.to-S.from)*m);u.scaleFrom&&u.scaleTo&&ya(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*m,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*m});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){r(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var S;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),y=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((S=g==null?void 0:g.delayMsOverride)!=null?S:0)),h=Er(c.ease),w=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,b=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),m=[];for(let E of Object.keys(c)){if(b.has(E))continue;let C=c[E];typeof C=="number"&&m.push({key:E,from:Cr(p,E),to:C})}let f=ba(p,c);return{target:p,startMs:Ke(),delayMs:y,durationMs:u,ease:h,props:m,scaleFrom:f.from,scaleTo:f.to,repeat:w,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>r(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ke())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ke(),y=Ke()-u;g.startMs+=y,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let y=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof y=="number"&&fa(p,u,y)}let g=ba(p,c);g.to&&ya(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))r(g)},timeline(p={}){let c=[],g=0,u=!1,y=[],h=b=>{if(typeof b=="number")return Math.max(0,b*1e3);let m=typeof b=="string"?b.trim():"";return m.startsWith("+=")?g+Math.max(0,Number(m.slice(2))*1e3||0):m?Math.max(0,Number(m)*1e3||0):g},w=b=>{c.push(b);let m=Math.max(0,(typeof b.vars.duration=="number"?b.vars.duration:.5)*1e3);g=Math.max(g,b.atMs+m)},v={to(b,m,f){return w({kind:"to",target:b,vars:m,atMs:h(f)}),v},fromTo(b,m,f,S){return w({kind:"fromTo",target:b,vars:f,from:m,atMs:h(S)}),v},play(){var b,m;if(u)return v;u=!0,y=[];for(let f of c)f.kind==="fromTo"&&d.set(f.target,(b=f.from)!=null?b:{}),y.push(d.to(f.target,{...f.vars,delay:f.atMs/1e3+((m=f.vars.delay)!=null?m:0)}));return v},pause(){for(let b of y)b.pause();return v},kill(){for(let b of y)b.kill();y=[],u=!1}};return p.paused||v.play(),v}};return d}function wa(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=va()}catch{}}var xa={name:"handler-playable-sdk",version:"1.0.50",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 G=0,Lr=G++,Sa=G++,Ea=G++,Ca=G++,Aa=G++,Ta=G++,La=G++,ka=G++,Pa=G++,Ma=G++,_a=G++,Ia=G++,T=Lr;function ja(){return T===Sa}function Oa(){return T===Ea}function Ra(){return T===Ca}function za(){return T===Aa}function je(){return T===Ta}function Oe(){return T===La}function $a(){return T===ka}function Ha(){return T===Pa}function Da(){return T===Ma}function en(){return T===_a}function tn(){return T===Ia}function Na(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),T=Sa;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=Ea;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=Ca)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Aa)}catch{}else if(e==="mintegral")window.gameReady&&(T=Ta);else if(e==="tapjoy")window.TJ_API&&(T=La);else if(e==="tiktok")window.openAppStore&&(T=ka);else if(e==="smadex")try{window.smxTracking&&(T=Pa)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=Ma)}catch{}else e==="vungle"?T=_a:(t==="nucleo"||e==="nucleo")&&(T=Ia)}var wt=ge(require("lottie-web"),1),Fa=wt.default;typeof window!="undefined"&&(window.lottie=wt.default,window.__baseLottie=wt.default);var kr=require("pixi.js");var nn=require("pixi.js");var Pr=null;function an(t){Pr=t}St();xt();var Xe=require("pixi.js");St();var Rr=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ln=Rr;if(typeof window!="undefined")try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);e!=null&&e.buildMode&&(ln=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${ln}`))}}catch{}function zr(t){var n,i,a,s,r;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(t);let e={center:{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};if(Array.isArray(t))return{x:(n=t[0])!=null?n:.5,y:(i=t[1])!=null?i:.5};if(t&&typeof t=="object"&&"x"in t&&"y"in t)return{x:(a=t.x)!=null?a:.5,y:(s=t.y)!=null?s:.5};if(typeof t=="string"){let o=t.trim().toLowerCase();return(r=e[o])!=null?r:{x:.5,y:.5}}return null}var fe=class{static async create(e,n,i){var l,d,p,c,g,u,y;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${ln}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Xe.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let s=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${s}, type: ${a.type}, path: ${a.path}`);let r=await Ce.load(e,a,i,s);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=r==null?void 0:r.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Xe.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=r==null?void 0:r.constructor)==null?void 0:g.name,r),r&&(((u=r.constructor)==null?void 0:u.name)==="Container"||r instanceof Xe.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],w=!1;for(let v of h)try{let b=await fetch(v);if(b.ok){o=await b.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(y=o==null?void 0:o.constructor)==null?void 0:y.name),w=!0;break}}catch{continue}w||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=r)}else o=r;else o=r,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform,n);return o}static applyTransform(e,n,i){var a,s,r,o;if(!(!n||!e)&&(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(s=n.position.y)!=null?s:0):"position"in e&&e.position&&e.position.set((r=n.position.x)!=null?r:0,(o=n.position.y)!=null?o:0)),n.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(n.scale):e.scale=n.scale),n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor)){let l=zr(n.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var Je=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var Dr=ge(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Dr);Ze();var Ct=require("pixi.js");Ze();var dn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Je}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async s=>{var o;let r=this.registry.get(s);if(!r){console.warn("[Assets] No config found for object:",s);return}try{let l=await fe.create(s,r,this.app);this.instanceCache.set(s,l),console.log("[Assets] Loaded object:",s,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",s,l)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(s=>!this.instanceCache.has(s));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let n=this.registry.get(e);if(n){let i=await fe.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Fr=new dn,Br=new Proxy(Fr,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Ze();var qr=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},Tt={scale:1,position:1},un=[];function Vr(t,e,n,i,a,s,r){un.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Wr(){un.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*le.scaleFactor;n(t,le.width,le.height,i,a,!0,!1)})}function pn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),le.width=t,le.height=e,le.scaleFactor=Math.min(t/le.designWidth,1.15),Tt.scale=le.scaleFactor,Tt.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Tt.scale.toFixed(3)}`),Wr()}var et={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 Yr(t,e,n){let i=et[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Kr(){return et}var Xr={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 At(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function ze(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:At(t[0],e.x),y:At(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:At(i.x,e.x),y:At(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Xr[i])!=null?n:e}return e}function gn(t,e,n,i={}){var u,y,h,w,v,b;let a=ze(n),s=(u=i.inset)!=null?u:{},r=(y=i.padding)!=null?y:{x:0,y:0},o=((h=s.left)!=null?h:0)+r.x,l=((w=s.right)!=null?w:0)+r.x,d=((v=s.top)!=null?v:0)+r.y,p=((b=s.bottom)!=null?b:0)+r.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function hn(t,e,n,i={}){var h,w,v,b,m,f;let a=(h=i.inset)!=null?h:{},s=(w=i.padding)!=null?w:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((b=a.right)!=null?b:0)+s.x,l=((m=a.top)!=null?m:0)+s.y,d=((f=a.bottom)!=null?f:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=ze(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),y=Math.min(Math.max(g.y,0),1);return{x:r+p*u,y:l+c*y}}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,n=()=>{let i=window.innerWidth,a=window.innerHeight;(i!==t||a!==e)&&(t=i,e=a,pn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),pn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Yr,window.getDebugConfig=Kr,window.copyConfig=oo,window.applyConfig=Qe,window.applyConfigForRatio=lo,window.positionAtBottom=qa,window.positionAtTop=Qr,window.positionAtCenter=eo,window.positionAtLeft=to,window.positionAtRight=no,window.positionAtBottomLeft=io,window.positionAtBottomRight=ao,window.positionAtTopLeft=so,window.positionAtTopRight=ro,window.applyPositionContract=Zr,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 Lt(t,e,n=0){return t*e+n}function kt(t,e,n=0){return t*(1-e)+n}function Pt(t,e,n=0){return t*e+n}function Mt(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Jr(t,e){return t*e}function Zr(t,e,n,i){var r,o,l,d,p,c,g,u,y,h,w,v,b,m,f,S,E,C,P,I;let a=0,s=0;switch(i.type){case"top":a=U(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),s=Lt(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),s=kt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=Pt(e,i.percent,(h=(y=i.offset)==null?void 0:y.x)!=null?h:0),s=U(n,(v=(w=i.offset)==null?void 0:w.y)!=null?v:0);break;case"right":a=Mt(e,i.percent,(m=(b=i.offset)==null?void 0:b.x)!=null?m:0),s=U(n,(S=(f=i.offset)==null?void 0:f.y)!=null?S:0);break;case"center":a=U(e,(C=(E=i.offset)==null?void 0:E.x)!=null?C:0),s=U(n,(I=(P=i.offset)==null?void 0:P.y)!=null?I:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function qa(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Jr(n,i),l=kt(n,i/2);ce(t,U(e),l);let d=s?a*le.scaleFactor:a;de(t,d),r&&!un.find(p=>p.element===t)&&Vr(t,qa,e,n,i,a,s)}function Qr(t,e,n,i=.1,a=1){ce(t,U(e),Lt(n,i)),de(t,a)}function eo(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function to(t,e,n,i=.1,a=1){ce(t,Pt(e,i),U(n)),de(t,a)}function no(t,e,n,i=.1,a=1){ce(t,Mt(e,i),U(n)),de(t,a)}function io(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),kt(n,i)),de(t,s)}function ao(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),kt(n,i)),de(t,s)}function so(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),Lt(n,i)),de(t,s)}function ro(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),Lt(n,i)),de(t,s)}function ce(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ae={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 oo(t){return t&&Ae[t]?JSON.parse(JSON.stringify(Ae[t])):JSON.parse(JSON.stringify(et))}function Qe(t){Object.keys(t).forEach(e=>{let n=e;et[n]&&t[n]&&Object.assign(et[n],t[n])}),console.log("Config applied:",t)}function lo(t,e){let n=t/e;n>1.6?(Qe(Ae.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Qe(Ae.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Qe(Ae.square),console.log("Applied SQUARE config for ratio:",n)):(Qe(Ae.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ae,t.resolveAnchorVec2=t.resolveAnchorVec2||ze,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||gn,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||hn}yn();function _(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Wc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:_(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:_(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:_(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:_(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:_(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:_(360,780)}],Yc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:_(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:_(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:_(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:_(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:_(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:_(412,915)}],Kc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:_(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:_(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:_(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:_(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:_(800,1280)}],Ka=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:_(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:_(768,1024),mraidScale:.7}];var Xc=[...Ka];var yo=Ka[0];Z();function bo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function vo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function wo(t){return await new Promise(e=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth||n.width,height:n.naturalHeight||n.height}),n.onerror=()=>e(null),n.src=t})}async function bn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await bo(a),r=await wo(s),o=vo(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:(n=r==null?void 0:r.height)!=null?n:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function _t(t,e=30){try{console.log("[ImageUtils] Removing background color...");let n=await new Promise((c,g)=>{let u=new Image;u.onload=()=>c(u),u.onerror=()=>g(new Error("Failed to load image")),u.src=t}),i=document.createElement("canvas");i.width=n.width,i.height=n.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),t;a.drawImage(n,0,0);let s=a.getImageData(0,0,i.width,i.height),r=s.data,l=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(c=>({r:r[c.offset],g:r[c.offset+1],b:r[c.offset+2]})),d=0;for(let c=0;c<r.length;c+=4){let g=r[c],u=r[c+1],y=r[c+2],h=!1;for(let w of l)if(Math.sqrt(Math.pow(g-w.r,2)+Math.pow(u-w.g,2)+Math.pow(y-w.b,2))<e){h=!0;break}h&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Za=require("@google/genai");async function vn(t,e,n=[],i={}){var a,s,r,o,l,d,p;try{if(!(t!=null&&t.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let v=0;v<n.length;v++){let b=n[v];if(!b.base64||!b.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(b.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!b.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${b.mimeType}`)}let c=new Za.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,b)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${b+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${n.length} images and prompt length: ${e.length}`);let y=await c.models.generateContent({model:g,contents:u}),h="",w=(r=(s=(a=y.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(w)for(let v of w)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(o=c.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."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var Qa=require("@google/genai");async function It(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Qa.GoogleGenAI({apiKey:t}),s=[{text:e}];n.length>0&&n.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),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 l=o.inlineData.data,d=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${d};base64,${l}`}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 xo=require("pixi.js");Ze();xt();Z();var ts=require("pixi.js");var Eo=require("pixi.js");Z();function jo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function Oo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function Ro(t){return`
46
+ `,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let d=o.target.dataset.tab;d&&this.switchTab(d)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let n=window.__openAiEditor;if(typeof n!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,n(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var el={};ca(el,{AspectClass:()=>$n,GameObject:()=>ct,GameObjectManager:()=>Dt,Renderer:()=>lt,ResponsiveUISystem:()=>qe,Transform:()=>ot,animateHandClick:()=>Ss,animatePanelEntrance:()=>xs,createBrushTexture:()=>Ps,createEndGamePanel:()=>ws,createHandTutorial:()=>Es,createThreeBase:()=>ys,createTutorialLabel:()=>Cs,getAspectClass:()=>Ht,getRegisteredFontIds:()=>vs,loadAsset:()=>Nn,loadCharacterFrames:()=>ks,registerFont:()=>bs,resolveFont:()=>ee,resolveFontWeight:()=>te,updateHandAnimation:()=>As});module.exports=Sr(el);var W=ge(require("three"),1);var he={};function bt(t,e,n=!1){he[t]||(he[t]=[]),he[t].push({fn:e,once:n})}function Zt(t,e){if(he[t]){if(!e){delete he[t];return}he[t]=he[t].filter(n=>n.fn!==e)}}function vt(t,...e){let n=he[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Zt(t,i.fn)}function B(t,e){bt(t,e,!0)}var M=null,V=[],Ie=null;function ga(t){M=t,V=[],Ie!==null&&(clearTimeout(Ie),Ie=null)}function ha(){var t,e,n;return{endpoint:(M==null?void 0:M.endpoint)||"",transport:(M==null?void 0:M.transport)||"beacon",batchSize:(t=M==null?void 0:M.batchSize)!=null?t:10,flushIntervalMs:(e=M==null?void 0:M.flushIntervalMs)!=null?e:300,maxQueue:(n=M==null?void 0:M.maxQueue)!=null?n:200,debug:!!(M!=null&&M.debug)}}async function pa(t,e,n,i){let a=JSON.stringify(e);if(n==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(s){i&&console.warn("[handler.telemetry] fetch failed",s)}}function Qt(t,e){let n=ha();if(e&&n.endpoint){if(V.push(t),V.length>n.maxQueue&&(V=V.slice(V.length-n.maxQueue)),V.length>=n.batchSize){ua();return}Ie===null&&(Ie=window.setTimeout(()=>{Ie=null,ua()},n.flushIntervalMs))}}async function ua(){let t=ha();if(!t.endpoint||V.length===0)return;let e=V.splice(0,t.batchSize);await pa(t.endpoint,{events:e},t.transport,t.debug),V.length>0&&await pa(t.endpoint,{events:V.splice(0,t.batchSize)},t.transport,t.debug)}function ma(t){return Math.max(0,Math.min(1,t))}function Er(t){let e=String(t!=null?t:"power2.out");if(e==="linear")return n=>n;if(e==="sine.inOut")return n=>.5-Math.cos(Math.PI*n)/2;if(e==="power2.out"||e==="easeOutQuad")return n=>1-(1-n)*(1-n);if(e.startsWith("back.out")){let n=e.match(/back\.out\(([\d.]+)\)/),i=n?Number(n[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return n=>1-(1-n)*(1-n)}function Ke(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Cr(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function fa(t,e,n){try{t[e]=n}catch{}}function Ar(t){let e=t==null?void 0:t.scale;if(!e)return null;let n=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:n,y:i}}function ya(t,e){let n=t==null?void 0:t.scale;if(n)try{typeof n.set=="function"?n.set(e.x,e.y):(typeof n.x=="number"&&(n.x=e.x),typeof n.y=="number"&&(n.y=e.y))}catch{}}function ba(t,e){let n=Ar(t);if(!n)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:n.x,y:n.y},to:{x:i!=null?i:n.x,y:a!=null?a:n.y}}}function va(){let t=new Set,e=new WeakMap,n=null,i=()=>{if(n!=null)return;n=requestAnimationFrame(()=>{n=null,o(),t.size>0&&i()})},a=p=>{var g;t.add(p);let c=(g=e.get(p.target))!=null?g:new Set;c.add(p),e.set(p.target,c),i()},s=p=>{t.delete(p);let c=e.get(p.target);c&&(c.delete(p),c.size===0&&e.delete(p.target))},r=p=>{p.killed||(p.killed=!0,s(p))},o=()=>{var c,g;let p=Ke();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let y=p-u.startMs-u.delayMs;if(y<0)continue;let h=u.durationMs>0?y/u.durationMs:1,w=ma(h),v=u.repeat>=0?u.repeat+1:1,b=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let S=h-b;w=ma(S)}let m=u.ease(w);u.yoyo&&b%2===1&&(m=1-m);for(let S of u.props)fa(u.target,S.key,S.from+(S.to-S.from)*m);u.scaleFrom&&u.scaleTo&&ya(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*m,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*m});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){r(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var S;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),y=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((S=g==null?void 0:g.delayMsOverride)!=null?S:0)),h=Er(c.ease),w=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,b=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),m=[];for(let E of Object.keys(c)){if(b.has(E))continue;let C=c[E];typeof C=="number"&&m.push({key:E,from:Cr(p,E),to:C})}let f=ba(p,c);return{target:p,startMs:Ke(),delayMs:y,durationMs:u,ease:h,props:m,scaleFrom:f.from,scaleTo:f.to,repeat:w,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>r(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ke())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ke(),y=Ke()-u;g.startMs+=y,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let y=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof y=="number"&&fa(p,u,y)}let g=ba(p,c);g.to&&ya(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))r(g)},timeline(p={}){let c=[],g=0,u=!1,y=[],h=b=>{if(typeof b=="number")return Math.max(0,b*1e3);let m=typeof b=="string"?b.trim():"";return m.startsWith("+=")?g+Math.max(0,Number(m.slice(2))*1e3||0):m?Math.max(0,Number(m)*1e3||0):g},w=b=>{c.push(b);let m=Math.max(0,(typeof b.vars.duration=="number"?b.vars.duration:.5)*1e3);g=Math.max(g,b.atMs+m)},v={to(b,m,f){return w({kind:"to",target:b,vars:m,atMs:h(f)}),v},fromTo(b,m,f,S){return w({kind:"fromTo",target:b,vars:f,from:m,atMs:h(S)}),v},play(){var b,m;if(u)return v;u=!0,y=[];for(let f of c)f.kind==="fromTo"&&d.set(f.target,(b=f.from)!=null?b:{}),y.push(d.to(f.target,{...f.vars,delay:f.atMs/1e3+((m=f.vars.delay)!=null?m:0)}));return v},pause(){for(let b of y)b.pause();return v},kill(){for(let b of y)b.kill();y=[],u=!1}};return p.paused||v.play(),v}};return d}function wa(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=va()}catch{}}var xa={name:"handler-playable-sdk",version:"1.0.51",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web --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 G=0,Lr=G++,Sa=G++,Ea=G++,Ca=G++,Aa=G++,Ta=G++,La=G++,ka=G++,Pa=G++,Ma=G++,_a=G++,Ia=G++,T=Lr;function ja(){return T===Sa}function Oa(){return T===Ea}function Ra(){return T===Ca}function za(){return T===Aa}function je(){return T===Ta}function Oe(){return T===La}function $a(){return T===ka}function Ha(){return T===Pa}function Da(){return T===Ma}function en(){return T===_a}function tn(){return T===Ia}function Na(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),T=Sa;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=Ea;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=Ca)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Aa)}catch{}else if(e==="mintegral")window.gameReady&&(T=Ta);else if(e==="tapjoy")window.TJ_API&&(T=La);else if(e==="tiktok")window.openAppStore&&(T=ka);else if(e==="smadex")try{window.smxTracking&&(T=Pa)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=Ma)}catch{}else e==="vungle"?T=_a:(t==="nucleo"||e==="nucleo")&&(T=Ia)}var wt=ge(require("lottie-web"),1),Fa=wt.default;typeof window!="undefined"&&(window.lottie=wt.default,window.__baseLottie=wt.default);var kr=require("pixi.js");var nn=require("pixi.js");var Pr=null;function an(t){Pr=t}St();xt();var Xe=require("pixi.js");St();var Rr=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ln=Rr;if(typeof window!="undefined")try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);e!=null&&e.buildMode&&(ln=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${ln}`))}}catch{}function zr(t){var n,i,a,s,r;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(t);let e={center:{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};if(Array.isArray(t))return{x:(n=t[0])!=null?n:.5,y:(i=t[1])!=null?i:.5};if(t&&typeof t=="object"&&"x"in t&&"y"in t)return{x:(a=t.x)!=null?a:.5,y:(s=t.y)!=null?s:.5};if(typeof t=="string"){let o=t.trim().toLowerCase();return(r=e[o])!=null?r:{x:.5,y:.5}}return null}var fe=class{static async create(e,n,i){var l,d,p,c,g,u,y;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${ln}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Xe.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let s=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${s}, type: ${a.type}, path: ${a.path}`);let r=await Ce.load(e,a,i,s);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=r==null?void 0:r.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Xe.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=r==null?void 0:r.constructor)==null?void 0:g.name,r),r&&(((u=r.constructor)==null?void 0:u.name)==="Container"||r instanceof Xe.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],w=!1;for(let v of h)try{let b=await fetch(v);if(b.ok){o=await b.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(y=o==null?void 0:o.constructor)==null?void 0:y.name),w=!0;break}}catch{continue}w||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=r)}else o=r;else o=r,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform,n);return o}static applyTransform(e,n,i){var a,s,r,o;if(!(!n||!e)&&(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(s=n.position.y)!=null?s:0):"position"in e&&e.position&&e.position.set((r=n.position.x)!=null?r:0,(o=n.position.y)!=null?o:0)),n.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(n.scale):e.scale=n.scale),n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor)){let l=zr(n.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var Je=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var Dr=ge(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Dr);Ze();var Ct=require("pixi.js");Ze();var dn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Je}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async s=>{var o;let r=this.registry.get(s);if(!r){console.warn("[Assets] No config found for object:",s);return}try{let l=await fe.create(s,r,this.app);this.instanceCache.set(s,l),console.log("[Assets] Loaded object:",s,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",s,l)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(s=>!this.instanceCache.has(s));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let n=this.registry.get(e);if(n){let i=await fe.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Fr=new dn,Br=new Proxy(Fr,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Ze();var qr=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},Tt={scale:1,position:1},un=[];function Vr(t,e,n,i,a,s,r){un.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Wr(){un.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*le.scaleFactor;n(t,le.width,le.height,i,a,!0,!1)})}function pn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),le.width=t,le.height=e,le.scaleFactor=Math.min(t/le.designWidth,1.15),Tt.scale=le.scaleFactor,Tt.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Tt.scale.toFixed(3)}`),Wr()}var et={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 Yr(t,e,n){let i=et[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Kr(){return et}var Xr={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 At(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function ze(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:At(t[0],e.x),y:At(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:At(i.x,e.x),y:At(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Xr[i])!=null?n:e}return e}function gn(t,e,n,i={}){var u,y,h,w,v,b;let a=ze(n),s=(u=i.inset)!=null?u:{},r=(y=i.padding)!=null?y:{x:0,y:0},o=((h=s.left)!=null?h:0)+r.x,l=((w=s.right)!=null?w:0)+r.x,d=((v=s.top)!=null?v:0)+r.y,p=((b=s.bottom)!=null?b:0)+r.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function hn(t,e,n,i={}){var h,w,v,b,m,f;let a=(h=i.inset)!=null?h:{},s=(w=i.padding)!=null?w:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((b=a.right)!=null?b:0)+s.x,l=((m=a.top)!=null?m:0)+s.y,d=((f=a.bottom)!=null?f:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=ze(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),y=Math.min(Math.max(g.y,0),1);return{x:r+p*u,y:l+c*y}}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,n=()=>{let i=window.innerWidth,a=window.innerHeight;(i!==t||a!==e)&&(t=i,e=a,pn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),pn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Yr,window.getDebugConfig=Kr,window.copyConfig=oo,window.applyConfig=Qe,window.applyConfigForRatio=lo,window.positionAtBottom=qa,window.positionAtTop=Qr,window.positionAtCenter=eo,window.positionAtLeft=to,window.positionAtRight=no,window.positionAtBottomLeft=io,window.positionAtBottomRight=ao,window.positionAtTopLeft=so,window.positionAtTopRight=ro,window.applyPositionContract=Zr,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 Lt(t,e,n=0){return t*e+n}function kt(t,e,n=0){return t*(1-e)+n}function Pt(t,e,n=0){return t*e+n}function Mt(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Jr(t,e){return t*e}function Zr(t,e,n,i){var r,o,l,d,p,c,g,u,y,h,w,v,b,m,f,S,E,C,P,I;let a=0,s=0;switch(i.type){case"top":a=U(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),s=Lt(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),s=kt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=Pt(e,i.percent,(h=(y=i.offset)==null?void 0:y.x)!=null?h:0),s=U(n,(v=(w=i.offset)==null?void 0:w.y)!=null?v:0);break;case"right":a=Mt(e,i.percent,(m=(b=i.offset)==null?void 0:b.x)!=null?m:0),s=U(n,(S=(f=i.offset)==null?void 0:f.y)!=null?S:0);break;case"center":a=U(e,(C=(E=i.offset)==null?void 0:E.x)!=null?C:0),s=U(n,(I=(P=i.offset)==null?void 0:P.y)!=null?I:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function qa(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Jr(n,i),l=kt(n,i/2);ce(t,U(e),l);let d=s?a*le.scaleFactor:a;de(t,d),r&&!un.find(p=>p.element===t)&&Vr(t,qa,e,n,i,a,s)}function Qr(t,e,n,i=.1,a=1){ce(t,U(e),Lt(n,i)),de(t,a)}function eo(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function to(t,e,n,i=.1,a=1){ce(t,Pt(e,i),U(n)),de(t,a)}function no(t,e,n,i=.1,a=1){ce(t,Mt(e,i),U(n)),de(t,a)}function io(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),kt(n,i)),de(t,s)}function ao(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),kt(n,i)),de(t,s)}function so(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),Lt(n,i)),de(t,s)}function ro(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),Lt(n,i)),de(t,s)}function ce(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ae={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 oo(t){return t&&Ae[t]?JSON.parse(JSON.stringify(Ae[t])):JSON.parse(JSON.stringify(et))}function Qe(t){Object.keys(t).forEach(e=>{let n=e;et[n]&&t[n]&&Object.assign(et[n],t[n])}),console.log("Config applied:",t)}function lo(t,e){let n=t/e;n>1.6?(Qe(Ae.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Qe(Ae.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Qe(Ae.square),console.log("Applied SQUARE config for ratio:",n)):(Qe(Ae.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ae,t.resolveAnchorVec2=t.resolveAnchorVec2||ze,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||gn,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||hn}yn();function _(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Wc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:_(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:_(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:_(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:_(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:_(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:_(360,780)}],Yc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:_(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:_(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:_(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:_(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:_(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:_(412,915)}],Kc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:_(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:_(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:_(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:_(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:_(800,1280)}],Ka=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:_(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:_(768,1024),mraidScale:.7}];var Xc=[...Ka];var yo=Ka[0];Z();function bo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function vo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function wo(t){return await new Promise(e=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth||n.width,height:n.naturalHeight||n.height}),n.onerror=()=>e(null),n.src=t})}async function bn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await bo(a),r=await wo(s),o=vo(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:(n=r==null?void 0:r.height)!=null?n:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function _t(t,e=30){try{console.log("[ImageUtils] Removing background color...");let n=await new Promise((c,g)=>{let u=new Image;u.onload=()=>c(u),u.onerror=()=>g(new Error("Failed to load image")),u.src=t}),i=document.createElement("canvas");i.width=n.width,i.height=n.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),t;a.drawImage(n,0,0);let s=a.getImageData(0,0,i.width,i.height),r=s.data,l=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(c=>({r:r[c.offset],g:r[c.offset+1],b:r[c.offset+2]})),d=0;for(let c=0;c<r.length;c+=4){let g=r[c],u=r[c+1],y=r[c+2],h=!1;for(let w of l)if(Math.sqrt(Math.pow(g-w.r,2)+Math.pow(u-w.g,2)+Math.pow(y-w.b,2))<e){h=!0;break}h&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Za=require("@google/genai");async function vn(t,e,n=[],i={}){var a,s,r,o,l,d,p;try{if(!(t!=null&&t.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let v=0;v<n.length;v++){let b=n[v];if(!b.base64||!b.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(b.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!b.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${b.mimeType}`)}let c=new Za.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,b)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${b+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${n.length} images and prompt length: ${e.length}`);let y=await c.models.generateContent({model:g,contents:u}),h="",w=(r=(s=(a=y.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(w)for(let v of w)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(o=c.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."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var Qa=require("@google/genai");async function It(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Qa.GoogleGenAI({apiKey:t}),s=[{text:e}];n.length>0&&n.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),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 l=o.inlineData.data,d=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${d};base64,${l}`}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 xo=require("pixi.js");Ze();xt();Z();var ts=require("pixi.js");var Eo=require("pixi.js");Z();function jo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function Oo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function Ro(t){return`
47
47
  Analyze these screenshots of a brand or game and extract its "Brand DNA".
48
48
 
49
49
  Provide a concise summary (2-3 sentences) covering: