handler-playable-sdk 1.0.91 → 1.0.93

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-HCWFDISI.js → chunk-6676ZMVB.js} +2 -2
  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 +2 -2
  34. package/dist/index.js +1 -1
  35. package/dist/pixi/index.cjs +1 -1
  36. package/dist/pixi/index.js +1 -1
  37. package/dist/three/index.cjs +1 -1
  38. package/dist/three/index.js +1 -1
  39. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x333b29,_0x242878){var a0_0x425bda={_0x273468:'Bx^P',_0x1022db:0x1b0,_0x2425be:0x1ab,_0x448b7d:0x1ae,_0x52455a:'51Rv',_0x4da4ca:0x1a2,_0x4ef279:'C5tP',_0x4ca314:0x193,_0x412275:0x19f,_0x3b4eda:0x2b7,_0x42e3f1:0x2b0,_0x541eff:'69Z2',_0x44614b:0x1b2,_0x5236fd:0x1a8,_0x123d9d:0x1a0,_0x4e4941:'YEYs',_0x105f6b:0x2b9,_0x3564ee:'UDS%',_0x156ad5:0x1a5,_0x44c9d0:0x1a9,_0x13fc45:0x1a7,_0x36a8b5:'gpE8',_0x109263:0x1a0,_0x35488a:0x1a5,_0x32d317:'C5tP',_0x95f084:0x2b1,_0x46cb87:0x2c2,_0xff14c9:0x2b9,_0x30b187:0x2ae,_0x3525c0:0x2b2,_0x1e6c8a:0x18d,_0x5d231d:0x189,_0x315553:0x181,_0x395b18:0x177},a0_0x1d748a={_0x5b9d91:0x3d},a0_0x134a4a={_0x18bf9d:0xf};function _0x160462(_0x2ef724,_0x503238,_0x266487,_0x2681b5,_0x124ae6){return a0_0x1df9(_0x266487-a0_0x134a4a._0x18bf9d,_0x2681b5);}var _0x326a72=_0x333b29();function _0xc4b263(_0xbc50d4,_0x1489ee,_0x1e8da3,_0x1ed0fc,_0x20d195){return a0_0x1df9(_0x1e8da3-a0_0x1d748a._0x5b9d91,_0xbc50d4);}function _0x48dd0d(_0x5bce4d,_0x2a1005,_0x54feef,_0x41ff10,_0x54ebc0){return a0_0x1df9(_0x54ebc0-0x151,_0x5bce4d);}while(!![]){try{var _0x6d30bd=-parseInt(_0xc4b263(a0_0x425bda._0x273468,a0_0x425bda._0x1022db,a0_0x425bda._0x2425be,0x19f,a0_0x425bda._0x448b7d))/(0x51b*0x1+0x348+-0x862)*(-parseInt(_0xc4b263(a0_0x425bda._0x52455a,0x1af,0x1ac,0x1a4,a0_0x425bda._0x4da4ca))/(-0x95d+-0x1f*-0xdb+-0x1126))+-parseInt(_0xc4b263(a0_0x425bda._0x4ef279,a0_0x425bda._0x4ca314,a0_0x425bda._0x412275,0x196,0x1a8))/(-0x9*-0x3dd+-0x1*0xe62+0x518*-0x4)*(parseInt(_0x48dd0d('h3l%',a0_0x425bda._0x3b4eda,0x2b3,0x2b8,a0_0x425bda._0x42e3f1))/(0x25*-0xe5+0xb7c+0x15a1))+parseInt(_0xc4b263(a0_0x425bda._0x541eff,a0_0x425bda._0x44614b,a0_0x425bda._0x5236fd,a0_0x425bda._0x123d9d,0x19d))/(-0x8da+0x2*0x923+-0x967)+-parseInt(_0x48dd0d(a0_0x425bda._0x4e4941,0x2cc,0x2b7,a0_0x425bda._0x105f6b,0x2c1))/(-0xe*-0x20b+-0x7a5+-0x1*0x14ef)+parseInt(_0xc4b263(a0_0x425bda._0x3564ee,a0_0x425bda._0x156ad5,a0_0x425bda._0x44c9d0,a0_0x425bda._0x13fc45,0x1a2))/(-0x1*0x1c4e+-0x1*-0x10ee+-0x8b*-0x15)*(-parseInt(_0xc4b263(a0_0x425bda._0x36a8b5,a0_0x425bda._0x5236fd,a0_0x425bda._0x109263,a0_0x425bda._0x35488a,0x1a5))/(0x19f4+0x115f+-0x2b4b))+parseInt(_0x48dd0d(a0_0x425bda._0x32d317,a0_0x425bda._0x95f084,a0_0x425bda._0x46cb87,0x2b3,a0_0x425bda._0xff14c9))/(-0x1449+-0x4b2*-0x2+0xaee)+-parseInt(_0x48dd0d('#vVH',0x2b2,a0_0x425bda._0x30b187,0x2a7,a0_0x425bda._0x3525c0))/(-0x162c+0xfcc+0x66a)*(parseInt(_0x160462(a0_0x425bda._0x1e6c8a,a0_0x425bda._0x5d231d,a0_0x425bda._0x315553,'EZ&L',a0_0x425bda._0x395b18))/(-0x10c7+0x14fb+0xd5*-0x5));if(_0x6d30bd===_0x242878)break;else _0x326a72['push'](_0x326a72['shift']());}catch(_0x2bdff2){_0x326a72['push'](_0x326a72['shift']());}}}(a0_0x13d4,0x1*-0xc7fc6+0x2*0x7b3be+0x15*0x8f0e));var a0_0x3e4b6e=(function(){var _0x34aacb=!![];return function(_0x38afea,_0x17e119){var a0_0x4bccd6={_0xdeea4e:'OgR%',_0xfab3c8:0x40d,_0x2fd602:0x41a,_0x397d42:0x411},_0x10d0ad=_0x34aacb?function(){function _0x56a708(_0x28c0d7,_0xf59011,_0x1d23a5,_0x375bb6,_0x2ea41f){return a0_0x1df9(_0x2ea41f-0x29b,_0x28c0d7);}if(_0x17e119){var _0x5c29b7=_0x17e119[_0x56a708(a0_0x4bccd6._0xdeea4e,a0_0x4bccd6._0xfab3c8,a0_0x4bccd6._0x2fd602,0x40f,a0_0x4bccd6._0x397d42)](_0x38afea,arguments);return _0x17e119=null,_0x5c29b7;}}:function(){};return _0x34aacb=![],_0x10d0ad;};}()),a0_0xb31df7=a0_0x3e4b6e(this,function(){var a0_0x36d973={_0x5b0ab9:0x391,_0x29eaed:')H]3',_0x17509d:0x388,_0x5213a6:0x345,_0x2f0d5c:0x339,_0x213b21:0x380,_0x739a00:0x374,_0x54696f:0x36d,_0xc5e27c:0x374,_0x503e76:'DMxh',_0x1fe3ef:0x337,_0xc8778:0x346,_0xcd6dd0:0x33a,_0x559b32:0x338,_0x2afcf3:')H]3',_0x435055:0x520,_0x10881a:0x52a,_0x985c7d:0x52c,_0x436b1a:'YEYs',_0x174953:0x340,_0x3c7981:0x33b,_0x886b78:0x33c,_0x2c8391:0x379,_0x5aea75:'tcI$',_0x58d0a6:0x37b,_0x56dd58:0x382,_0x2d38ec:0x36e,_0x5552ca:0x38a,_0x55d6a3:'XCN1',_0x44d212:0x381,_0x1d36f7:0x375,_0x147fb6:0x343,_0x4a7f78:0x33e,_0x483392:0x332},a0_0x78d46d={_0x15dcf0:0x1d5},a0_0x482e1e={_0x569990:0x214},a0_0x463a41={_0x5ed68e:0x3a9},_0x4c0308={};function _0x438117(_0x506f9a,_0xb343c7,_0x3908e3,_0x12c736,_0xf3af02){return a0_0x1df9(_0xb343c7-a0_0x463a41._0x5ed68e,_0x506f9a);}_0x4c0308[_0x5bb478(a0_0x36d973._0x5b0ab9,a0_0x36d973._0x29eaed,0x38b,a0_0x36d973._0x5b0ab9,a0_0x36d973._0x17509d)]='(((.+'+_0x4a7aba('Q2la',0x333,a0_0x36d973._0x5213a6,a0_0x36d973._0x2f0d5c,0x337)+'+$';var _0x4d126a=_0x4c0308;function _0x5bb478(_0x22528f,_0x3607ee,_0x12bbd9,_0x5e5db8,_0x2d95e7){return a0_0x1df9(_0x12bbd9-a0_0x482e1e._0x569990,_0x3607ee);}function _0x4a7aba(_0x33fb65,_0x459a0c,_0x292d00,_0x48caab,_0x39d6d3){return a0_0x1df9(_0x48caab-a0_0x78d46d._0x15dcf0,_0x33fb65);}return a0_0xb31df7[_0x5bb478(a0_0x36d973._0x213b21,'Q2la',a0_0x36d973._0x739a00,a0_0x36d973._0x54696f,a0_0x36d973._0xc5e27c)+'ing']()[_0x4a7aba(a0_0x36d973._0x503e76,a0_0x36d973._0x1fe3ef,a0_0x36d973._0xc8778,a0_0x36d973._0xcd6dd0,a0_0x36d973._0x559b32)+'h'](_0x4d126a[_0x438117(a0_0x36d973._0x2afcf3,a0_0x36d973._0x435055,a0_0x36d973._0x10881a,a0_0x36d973._0x985c7d,0x524)])['toStr'+_0x4a7aba(a0_0x36d973._0x436b1a,0x333,a0_0x36d973._0x174953,a0_0x36d973._0x3c7981,a0_0x36d973._0x886b78)]()['const'+_0x5bb478(a0_0x36d973._0x2c8391,a0_0x36d973._0x5aea75,a0_0x36d973._0x58d0a6,a0_0x36d973._0x56dd58,a0_0x36d973._0x2d38ec)+'r'](a0_0xb31df7)[_0x5bb478(a0_0x36d973._0x5552ca,a0_0x36d973._0x55d6a3,a0_0x36d973._0x44d212,0x377,a0_0x36d973._0x1d36f7)+'h'](_0x4d126a[_0x4a7aba('MUeJ',a0_0x36d973._0x147fb6,0x342,a0_0x36d973._0x4a7f78,a0_0x36d973._0x483392)]);});a0_0xb31df7();function a0_0x1df9(_0x52996c,_0x265c28){_0x52996c=_0x52996c-(-0x266d+-0x1ae3+-0x18d*-0x2b);var _0x3ef5cc=a0_0x13d4();var _0x1c359a=_0x3ef5cc[_0x52996c];if(a0_0x1df9['KfspCU']===undefined){var _0x125ede=function(_0x57e913){var _0x2bdddc='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x4bd2ca='',_0x2c6419='',_0x443c11=_0x4bd2ca+_0x125ede;for(var _0x15dd3a=-0xe83+-0x8*0x3a4+0x2ba3,_0x4f5d61,_0x44e3af,_0x2ebe81=-0x126e*0x1+-0x988*-0x3+-0x2*0x515;_0x44e3af=_0x57e913['charAt'](_0x2ebe81++);~_0x44e3af&&(_0x4f5d61=_0x15dd3a%(-0x1*-0xfe5+0x1e0e+0x42d*-0xb)?_0x4f5d61*(0x1f6*-0x1+-0x1f5d+0x2193)+_0x44e3af:_0x44e3af,_0x15dd3a++%(-0x125a+0x1*0x8f9+-0x1*-0x965))?_0x4bd2ca+=_0x443c11['charCodeAt'](_0x2ebe81+(0x95*-0x3e+0x113d+0x12e3))-(-0x687+0xd59+0x7c*-0xe)!==0x1*0x1d2a+0x4*0x74b+-0x13*0x312?String['fromCharCode'](-0x20c2+-0x1032+-0x13*-0x2a1&_0x4f5d61>>(-(0x1*-0x25ce+-0xc23+0x31f3)*_0x15dd3a&-0x1*0xc3b+-0x148a+-0x68f*-0x5)):_0x15dd3a:-0x4e4*-0x1+0x186a*0x1+-0x1d4e){_0x44e3af=_0x2bdddc['indexOf'](_0x44e3af);}for(var _0x176dfe=0x12*-0x1fd+-0xdde+0x31a8,_0x3dd506=_0x4bd2ca['length'];_0x176dfe<_0x3dd506;_0x176dfe++){_0x2c6419+='%'+('00'+_0x4bd2ca['charCodeAt'](_0x176dfe)['toString'](0x1*0x30b+-0x20c5+0x1f*0xf6))['slice'](-(0x1*-0x65e+-0x2*0xa52+0x1b04));}return decodeURIComponent(_0x2c6419);};var _0x445a71=function(_0x16ee00,_0x3b2651){var _0x623752=[],_0x41efd9=-0x101*0x2+0x2406+-0x2204,_0x93358f,_0x724ec7='';_0x16ee00=_0x125ede(_0x16ee00);var _0x14a100;for(_0x14a100=0xd*0x25+0x2b*-0x99+0x17d2;_0x14a100<-0xd*-0x169+-0x1b34*-0x1+0x36d*-0xd;_0x14a100++){_0x623752[_0x14a100]=_0x14a100;}for(_0x14a100=0x3*0x2a1+-0x68b*-0x2+0x2ff*-0x7;_0x14a100<0x1*0x2622+-0x2*0x69d+-0x17e8;_0x14a100++){_0x41efd9=(_0x41efd9+_0x623752[_0x14a100]+_0x3b2651['charCodeAt'](_0x14a100%_0x3b2651['length']))%(0x1238*0x2+-0x1c9*-0xd+-0x1*0x3aa5),_0x93358f=_0x623752[_0x14a100],_0x623752[_0x14a100]=_0x623752[_0x41efd9],_0x623752[_0x41efd9]=_0x93358f;}_0x14a100=-0xf25*0x1+-0x189f*-0x1+-0x97a,_0x41efd9=-0xd18*0x1+-0x1*-0xe16+-0x1*0xfe;for(var _0x42f80c=0x3*-0x6bb+0x1b5*-0xb+-0x2*-0x137c;_0x42f80c<_0x16ee00['length'];_0x42f80c++){_0x14a100=(_0x14a100+(-0x3f9*-0x7+-0xa12+-0x4*0x46f))%(0x1542+-0x3*0x925+0x72d),_0x41efd9=(_0x41efd9+_0x623752[_0x14a100])%(-0x6*0x5c9+0x74*-0x11+0x1*0x2b6a),_0x93358f=_0x623752[_0x14a100],_0x623752[_0x14a100]=_0x623752[_0x41efd9],_0x623752[_0x41efd9]=_0x93358f,_0x724ec7+=String['fromCharCode'](_0x16ee00['charCodeAt'](_0x42f80c)^_0x623752[(_0x623752[_0x14a100]+_0x623752[_0x41efd9])%(0x2*0x4+0x11a*0x11+0x11c2*-0x1)]);}return _0x724ec7;};a0_0x1df9['XUsrPz']=_0x445a71,a0_0x1df9['awIYdn']={},a0_0x1df9['KfspCU']=!![];}var _0x3ed1fb=_0x3ef5cc[0x1f1*0xe+-0x227*0xb+0xd*-0x45],_0x2561ca=_0x52996c+_0x3ed1fb,_0xd23c5c=a0_0x1df9['awIYdn'][_0x2561ca];if(!_0xd23c5c){if(a0_0x1df9['swTxBy']===undefined){var _0x1ac854=function(_0x4c89fb){this['WqOxqI']=_0x4c89fb,this['afWbaP']=[0xc5*0x1f+0x1231*-0x1+0x1*-0x5a9,0x1*-0x1269+-0x3*-0xa2a+-0xc15,-0x68*-0x50+0x1*-0x19d5+0x239*-0x3],this['bVGWtw']=function(){return'newState';},this['oLTDty']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['SYRlNR']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x1ac854['prototype']['nYCHDo']=function(){var _0xacb188=new RegExp(this['oLTDty']+this['SYRlNR']),_0x1b3640=_0xacb188['test'](this['bVGWtw']['toString']())?--this['afWbaP'][-0x2189+-0x223e*0x1+-0x9*-0x788]:--this['afWbaP'][-0x188d+-0x9*-0x3dd+-0x1*0xa38];return this['dpPkKH'](_0x1b3640);},_0x1ac854['prototype']['dpPkKH']=function(_0x494bb5){if(!Boolean(~_0x494bb5))return _0x494bb5;return this['ljzFfT'](this['WqOxqI']);},_0x1ac854['prototype']['ljzFfT']=function(_0x29c999){for(var _0x20914b=0x1962+0x68*0x4f+-0x7*0x836,_0x441b76=this['afWbaP']['length'];_0x20914b<_0x441b76;_0x20914b++){this['afWbaP']['push'](Math['round'](Math['random']())),_0x441b76=this['afWbaP']['length'];}return _0x29c999(this['afWbaP'][-0x782*0x3+0x16*-0x67+0x1f60]);},new _0x1ac854(a0_0x1df9)['nYCHDo'](),a0_0x1df9['swTxBy']=!![];}_0x1c359a=a0_0x1df9['XUsrPz'](_0x1c359a,_0x265c28),a0_0x1df9['awIYdn'][_0x2561ca]=_0x1c359a;}else _0x1c359a=_0xd23c5c;return _0x1c359a;}import{A as a0_0x230be5,B as a0_0x27dc06,C as a0_0x2d3ca1,D as a0_0x5ba81b,b as a0_0x461c55,c as a0_0x17ab64,d as a0_0xfa203b,e as a0_0xdaa41a,f as a0_0x31fb4a,g as a0_0x10522d,h as a0_0x53891a,i as a0_0x4157c1,j as a0_0x57e254,k as a0_0x427dd3,l as a0_0x217e50,m as a0_0x460ff9,n as a0_0x50e400,o as a0_0x3ef60f,p as a0_0x22b5ec,q as a0_0x450d99,r as a0_0x7bc9a1,s as a0_0x4a4e7a,t as a0_0x4df521,u as a0_0x394fed,v as a0_0x3fa87e,w as a0_0x33e0a0,x as a0_0x471db9,y as a0_0x376700,z as a0_0x5b3d3e}from'../chunk-HCWFDISI.js';import'../chunk-JYGZ4R4K.js';import{a as a0_0x4ec6b3,b as a0_0x548f44,c as a0_0x5e3aac,d as a0_0x1f8b5e,e as a0_0x530fa6}from'../chunk-I5OOVR5U.js';import'../chunk-GVZ2445E.js';import'../chunk-EFRB44UC.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x4ec6b3 as AssetCache,a0_0x5e3aac as AssetLoader,a0_0x394fed as AssetSystem,a0_0x1f8b5e as AssetTextures,a0_0x4a4e7a as Assets,a0_0x3ef60f as BaseSystem,a0_0x50e400 as GameEngine,a0_0xdaa41a as GameObject,a0_0x31fb4a as GameObjectManager,a0_0x460ff9 as ObjectFactory,a0_0xfa203b as Renderer,a0_0x22b5ec as RuntimeObjectRegistry,a0_0x17ab64 as Transform,a0_0x27dc06 as applyScreenAnchor,a0_0x450d99 as basePixi,a0_0x33e0a0 as clearResponsiveElements,a0_0x461c55 as createPixiBase,a0_0x57e254 as getRegisteredFontIds,a0_0x3fa87e as globalResponsiveMultipliers,a0_0x530fa6 as initAssetTextures,a0_0x4df521 as initAssets,a0_0x2d3ca1 as layout,a0_0x217e50 as playLottieOverlay,a0_0x4157c1 as registerFont,a0_0x548f44 as registerType,a0_0x376700 as resolveAnchorVec2,a0_0x10522d as resolveFont,a0_0x53891a as resolveFontWeight,a0_0x5b3d3e as resolveScreenAnchorPoint,a0_0x230be5 as resolveScreenRatioPoint,a0_0x5ba81b as runInitSequence,a0_0x427dd3 as setLottieInstance,a0_0x7bc9a1 as spawnSceneFromConfig,a0_0x471db9 as updateScreenState};function a0_0x13d4(){var _0x133583=['WRvofu7cN8oxWQJcOmkQ','AmoZW6hdNSk4W79RAG','D8obySomW6dcMCoMWO8/rZddMrS','W4XRWRpcIWO','h8k2W6xdUmkB','fvVcLCoFW7ZdTSkkW7y','o8oGWQ4Aza','hmkXEWBdRbBcTJS','WPdcPmo/ASomWPldNZqyW4bcrq','zSosWQCbW4FcNmopWQ5F','zSkKW5rfpW','gcJcKCondW','WRLOfG','g8kOCCoOya','WPFcRCo3ySobWPBcRMizW5LKxmocW54','W7DJo8kDWPW','F8ojBSonWOBdN8k7WPqQFq','WP9QCCkyxmkdcSkccq47vmkt','WQ3dI8kmuY7cNJOPe8kSr3W','W7CErM7cRa','W73cRCo1iCoOW5NcR0ddMmo9','WRv9FmoGW78JW7NcRmoOW4C','W6i/smk4W6xcQxFcPCoai8kqgCkg','WPrIFCkDumkdaSkZedm6s8kj','WPhcM8oZWRqzW5TOWRahvxVcKLFcQq'];a0_0x13d4=function(){return _0x133583;};return a0_0x13d4();}
1
+ (function(_0x1ff3c6,_0x49dc3f){var a0_0x26b83b={_0x1e2a25:0x1f,_0x172441:0x28,_0x34d804:0x1c,_0x21eb3c:0x20,_0x19fc25:0x21c,_0x4a5da6:'2UEV',_0x2cedba:0x214,_0x56e0bb:0x225,_0x1078cd:0x24,_0x3bb135:0x19,_0x13af29:0x17,_0x463470:0x21,_0x56ba4a:'OAFX',_0x588ece:0x18e,_0x509480:0x19c,_0x1a47a7:0x19d,_0x45010c:0x39,_0x42fbb9:0x34,_0x2f1bb1:0x2a,_0x33aa26:'de2Q',_0x162768:0x6,_0x3b98f2:0x12,_0x11c6d6:0x5,_0x5179f9:0x20d,_0x5c8db9:'q@kD',_0x4dcb1c:0x217,_0x1513fa:0x18a,_0xc5bad5:'#Io&',_0x5512d8:0x18c,_0x387914:0x198,_0x55e6fc:0x196,_0x1e6152:'de2Q',_0x18fa6c:0x2c},a0_0x400dcb={_0x4e8302:0xa6},a0_0x1fc029={_0x546a06:0x11b},a0_0x34ff02={_0x3f0cad:0x117},_0xbeaa0a=_0x1ff3c6();function _0x1890f3(_0x483e2b,_0x41e0fe,_0x131287,_0x4fd19a,_0x4dd9a3){return a0_0xec34(_0x131287- -a0_0x34ff02._0x3f0cad,_0x483e2b);}function _0x51f7af(_0x11b116,_0x169b21,_0x4898fb,_0x59d2f5,_0x3c9813){return a0_0xec34(_0x11b116-a0_0x1fc029._0x546a06,_0x169b21);}function _0x21c1b4(_0x5529af,_0x39e66f,_0x362cb7,_0x19c74e,_0x4e9a17){return a0_0xec34(_0x4e9a17-a0_0x400dcb._0x4e8302,_0x39e66f);}while(!![]){try{var _0x4670ea=-parseInt(_0x1890f3('hrRF',-a0_0x26b83b._0x1e2a25,-a0_0x26b83b._0x172441,-a0_0x26b83b._0x34d804,-a0_0x26b83b._0x21eb3c))/(-0x2*-0x902+0x251f+-0x3722)*(parseInt(_0x51f7af(a0_0x26b83b._0x19fc25,a0_0x26b83b._0x4a5da6,a0_0x26b83b._0x2cedba,0x219,a0_0x26b83b._0x56e0bb))/(-0x1e23+0x1*0x1e8+0x1c3d))+-parseInt(_0x1890f3('SMCb',-a0_0x26b83b._0x1078cd,-a0_0x26b83b._0x1e2a25,-a0_0x26b83b._0x3bb135,-0x2b))/(0x15b*-0xc+0xf96+0xb1)*(-parseInt(_0x1890f3('4fOn',-a0_0x26b83b._0x1078cd,-a0_0x26b83b._0x13af29,-a0_0x26b83b._0x463470,-0xa))/(-0x2ff+-0x583*-0x1+0x40*-0xa))+parseInt(_0x21c1b4(0x193,a0_0x26b83b._0x56ba4a,a0_0x26b83b._0x588ece,a0_0x26b83b._0x509480,a0_0x26b83b._0x1a47a7))/(0xe7b+-0x12db*0x1+0x19*0x2d)*(-parseInt(_0x1890f3('Ouob',-0x1d,-0x2b,-a0_0x26b83b._0x45010c,-0x37))/(0x1bfc+-0x1585+-0x671))+-parseInt(_0x1890f3('kwDg',-a0_0x26b83b._0x42fbb9,-a0_0x26b83b._0x2f1bb1,-0x1d,-0x33))/(0x1*-0x2065+0x5*0x1e+0x1fd6)+-parseInt(_0x1890f3(a0_0x26b83b._0x33aa26,-a0_0x26b83b._0x162768,-0x11,-a0_0x26b83b._0x3b98f2,-a0_0x26b83b._0x11c6d6))/(-0x79d+0x21cc+0x1a27*-0x1)*(parseInt(_0x51f7af(a0_0x26b83b._0x5179f9,a0_0x26b83b._0x5c8db9,a0_0x26b83b._0x4dcb1c,0x209,a0_0x26b83b._0x4dcb1c))/(-0x2*0xe1d+-0x4ee*-0x4+-0xf3*-0x9))+parseInt(_0x21c1b4(a0_0x26b83b._0x1513fa,a0_0x26b83b._0xc5bad5,a0_0x26b83b._0x5512d8,a0_0x26b83b._0x387914,a0_0x26b83b._0x55e6fc))/(-0x189*-0x9+-0x4*-0x7cd+-0x1*0x2cfb)+parseInt(_0x1890f3(a0_0x26b83b._0x1e6152,-0x24,-a0_0x26b83b._0x18fa6c,-0x31,-0x31))/(-0x3*-0x1f7+0x12a2+-0x187c);if(_0x4670ea===_0x49dc3f)break;else _0xbeaa0a['push'](_0xbeaa0a['shift']());}catch(_0x425f23){_0xbeaa0a['push'](_0xbeaa0a['shift']());}}}(a0_0x16b6,0x2*-0x2ae9c+-0xb6d6*0xc+0x19946b));var a0_0x5649fa=(function(){var _0x324e4c=!![];return function(_0x41ee8b,_0x589df8){var a0_0x222067={_0x33e041:0x51,_0x254e4f:0x4a,_0x35cd01:'4e^D'},_0x4defc0=_0x324e4c?function(){function _0x1dd52f(_0x382a6d,_0x12f927,_0x3f2029,_0x110b47,_0x318c5e){return a0_0xec34(_0x382a6d- -0x14e,_0x318c5e);}if(_0x589df8){var _0x2eaa0a=_0x589df8[_0x1dd52f(-a0_0x222067._0x33e041,-0x44,-a0_0x222067._0x254e4f,-0x50,a0_0x222067._0x35cd01)](_0x41ee8b,arguments);return _0x589df8=null,_0x2eaa0a;}}:function(){};return _0x324e4c=![],_0x4defc0;};}()),a0_0x418565=a0_0x5649fa(this,function(){var a0_0x37ae73={_0x2aebc1:'Gwdj',_0x29be34:0x211,_0x5cd14e:0x202,_0x2bafc3:0x1f3,_0x388843:0x218,_0x3bbc68:'3arn',_0x1494c0:0x219,_0xb60c91:0x20a,_0x596fa4:0x1fd,_0x3c0522:'J7sC',_0x4a817d:0x206,_0x53a4ab:0x208,_0xf7f452:0x200,_0x2ced08:0xff,_0x2b06cc:0xf1,_0x328173:'b[!M',_0x2e28b8:0xe7,_0x3089f3:0xec,_0x437124:'YNog',_0x554d59:0xe1,_0x3c88e:0xeb,_0x13fedb:0x1c,_0x322784:'#QQ9',_0x4511e9:0xd,_0x13e979:0xfe,_0x5a8006:0xf4,_0x145b81:0xfc,_0x21b48f:0xf5},a0_0x2bfafd={_0x5a8293:0x307},a0_0x1efcc6={_0x5b2704:0x1ef},a0_0x41d3cc={_0x3488dd:0xe8};function _0x225544(_0x5c1548,_0x388c60,_0x52333a,_0x97104,_0x55c961){return a0_0xec34(_0x52333a- -a0_0x41d3cc._0x3488dd,_0x97104);}var _0x4fc301={};_0x4fc301[_0x4afd91(-0x1f4,a0_0x37ae73._0x2aebc1,-a0_0x37ae73._0x29be34,-a0_0x37ae73._0x5cd14e,-a0_0x37ae73._0x2bafc3)]='(((.+'+_0x4afd91(-a0_0x37ae73._0x388843,a0_0x37ae73._0x3bbc68,-0x21d,-a0_0x37ae73._0x1494c0,-a0_0x37ae73._0xb60c91)+'+$';function _0x17d1b6(_0x5838fd,_0x899b71,_0x275afb,_0x4c59e0,_0x1a2086){return a0_0xec34(_0x899b71- -a0_0x1efcc6._0x5b2704,_0x275afb);}function _0x4afd91(_0x2cb368,_0x48b566,_0x2b671b,_0x486a66,_0xac227e){return a0_0xec34(_0x486a66- -a0_0x2bfafd._0x5a8293,_0x48b566);}var _0xfd4c58=_0x4fc301;return a0_0x418565['toStr'+'ing']()[_0x4afd91(-a0_0x37ae73._0x596fa4,a0_0x37ae73._0x3c0522,-a0_0x37ae73._0x4a817d,-a0_0x37ae73._0x53a4ab,-a0_0x37ae73._0xf7f452)+'h'](_0xfd4c58[_0x17d1b6(-a0_0x37ae73._0x2ced08,-a0_0x37ae73._0x2b06cc,a0_0x37ae73._0x328173,-0xec,-a0_0x37ae73._0x2e28b8)])[_0x17d1b6(-0xf6,-a0_0x37ae73._0x3089f3,a0_0x37ae73._0x437124,-a0_0x37ae73._0x554d59,-a0_0x37ae73._0x3c88e)+_0x225544(0x1b,a0_0x37ae73._0x13fedb,0x14,a0_0x37ae73._0x322784,a0_0x37ae73._0x4511e9)]()[_0x17d1b6(-0xf9,-a0_0x37ae73._0x13e979,'hrRF',-a0_0x37ae73._0x5a8006,-a0_0x37ae73._0x145b81)+'ructo'+'r'](a0_0x418565)[_0x17d1b6(-0xf5,-a0_0x37ae73._0x21b48f,'Ouob',-0x102,-0xe9)+'h'](_0xfd4c58['bKCBs']);});function a0_0xec34(_0x2c0873,_0x3669cf){_0x2c0873=_0x2c0873-(0x1957+0x165*-0xa+-0xa7a);var _0x8003b1=a0_0x16b6();var _0x4d0c13=_0x8003b1[_0x2c0873];if(a0_0xec34['olusRp']===undefined){var _0xb0ba0b=function(_0x7964ff){var _0x3090f6='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x54438c='',_0x5a945f='',_0x43ec09=_0x54438c+_0xb0ba0b;for(var _0x51d798=0xd7d*-0x2+-0x18*0xb3+0x2bc2,_0x156c2a,_0x2f845a,_0x1d4e6c=-0x1*0x2081+0x1b90+-0x4f1*-0x1;_0x2f845a=_0x7964ff['charAt'](_0x1d4e6c++);~_0x2f845a&&(_0x156c2a=_0x51d798%(0x20e4+0xaca+-0x2baa)?_0x156c2a*(0x5*0x494+-0x6b1+-0xff3)+_0x2f845a:_0x2f845a,_0x51d798++%(0x1286+0x6e5*0x3+-0x7f*0x4f))?_0x54438c+=_0x43ec09['charCodeAt'](_0x1d4e6c+(0x1a1*0x9+0xb*-0x85+0x3c*-0x26))-(0x1554+-0x1543*0x1+-0x7)!==-0x5*-0xb9+-0x2c7+-0xd6?String['fromCharCode'](-0x1*-0xb53+-0x1660+-0x6*-0x202&_0x156c2a>>(-(-0x2529+0x2232+-0x1*-0x2f9)*_0x51d798&0x1d62*0x1+0x2*-0xa22+-0x918)):_0x51d798:-0x1*-0x24e3+-0xc*-0x31d+-0xe5*0x53){_0x2f845a=_0x3090f6['indexOf'](_0x2f845a);}for(var _0x1be548=-0x188f*-0x1+-0x2388+-0x35*-0x35,_0x826b99=_0x54438c['length'];_0x1be548<_0x826b99;_0x1be548++){_0x5a945f+='%'+('00'+_0x54438c['charCodeAt'](_0x1be548)['toString'](-0x25ef+0x1*-0x210a+-0x5*-0xe35))['slice'](-(-0xbc3*0x2+0x4*-0x44c+0x517*0x8));}return decodeURIComponent(_0x5a945f);};var _0x18ace8=function(_0x3066cb,_0x30f645){var _0x41eaab=[],_0x54ee39=-0x2090+0x8aa+0x17e6,_0x3c6e6e,_0x1f5cdf='';_0x3066cb=_0xb0ba0b(_0x3066cb);var _0x2665ad;for(_0x2665ad=-0x1*-0x1177+-0x2*0x71b+-0x341*0x1;_0x2665ad<0x1*0x1b7f+-0x3*0x1a1+-0x159c;_0x2665ad++){_0x41eaab[_0x2665ad]=_0x2665ad;}for(_0x2665ad=-0x1a60+-0x1f5+-0x1c55*-0x1;_0x2665ad<-0xd1b*0x2+-0x268+0xecf*0x2;_0x2665ad++){_0x54ee39=(_0x54ee39+_0x41eaab[_0x2665ad]+_0x30f645['charCodeAt'](_0x2665ad%_0x30f645['length']))%(-0xf4*-0x1a+-0x2b*0x5+-0x7*0x347),_0x3c6e6e=_0x41eaab[_0x2665ad],_0x41eaab[_0x2665ad]=_0x41eaab[_0x54ee39],_0x41eaab[_0x54ee39]=_0x3c6e6e;}_0x2665ad=0x2*-0x11ac+-0xd37+-0x1f*-0x191,_0x54ee39=0x431+-0x5*-0x694+-0x2515;for(var _0x58f0a0=-0x1*0xf73+0x8a5+0x6ce;_0x58f0a0<_0x3066cb['length'];_0x58f0a0++){_0x2665ad=(_0x2665ad+(-0x261+-0xbd9+0x1*0xe3b))%(0x25b2+0x9*-0x128+-0x1a4a),_0x54ee39=(_0x54ee39+_0x41eaab[_0x2665ad])%(0x167a+0x1899*-0x1+-0x1*-0x31f),_0x3c6e6e=_0x41eaab[_0x2665ad],_0x41eaab[_0x2665ad]=_0x41eaab[_0x54ee39],_0x41eaab[_0x54ee39]=_0x3c6e6e,_0x1f5cdf+=String['fromCharCode'](_0x3066cb['charCodeAt'](_0x58f0a0)^_0x41eaab[(_0x41eaab[_0x2665ad]+_0x41eaab[_0x54ee39])%(0x81*0x2e+0x3*0x392+-0x1*0x20e4)]);}return _0x1f5cdf;};a0_0xec34['ewrDwV']=_0x18ace8,a0_0xec34['gGXXZg']={},a0_0xec34['olusRp']=!![];}var _0x56218d=_0x8003b1[-0xf3*-0x6+-0x2d1+-0x1*0x2e1],_0x4e5f09=_0x2c0873+_0x56218d,_0x415d03=a0_0xec34['gGXXZg'][_0x4e5f09];if(!_0x415d03){if(a0_0xec34['nMjeNd']===undefined){var _0xf29ea1=function(_0x18d53b){this['qCjbqW']=_0x18d53b,this['ZHZLfV']=[0x6fd+-0x117+0x1f7*-0x3,-0x1981+0x2392+-0xa11,-0x3e+-0x1511*-0x1+0x1*-0x14d3],this['igBkXK']=function(){return'newState';},this['irYsAr']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['ewMcZL']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0xf29ea1['prototype']['iNGdEa']=function(){var _0x3eab86=new RegExp(this['irYsAr']+this['ewMcZL']),_0x5aa2a2=_0x3eab86['test'](this['igBkXK']['toString']())?--this['ZHZLfV'][-0x14*-0x10+-0x2*-0xb05+-0x1749]:--this['ZHZLfV'][0x882*-0x2+-0x2*0xe95+0x2e2e];return this['hzzkfk'](_0x5aa2a2);},_0xf29ea1['prototype']['hzzkfk']=function(_0xd3cffa){if(!Boolean(~_0xd3cffa))return _0xd3cffa;return this['DyZsmy'](this['qCjbqW']);},_0xf29ea1['prototype']['DyZsmy']=function(_0x47c1b3){for(var _0x3333ef=-0x27*0xf+0x1*-0x1e23+0x206c,_0x21f34d=this['ZHZLfV']['length'];_0x3333ef<_0x21f34d;_0x3333ef++){this['ZHZLfV']['push'](Math['round'](Math['random']())),_0x21f34d=this['ZHZLfV']['length'];}return _0x47c1b3(this['ZHZLfV'][0x15b*-0xc+0xf96+0xae]);},new _0xf29ea1(a0_0xec34)['iNGdEa'](),a0_0xec34['nMjeNd']=!![];}_0x4d0c13=a0_0xec34['ewrDwV'](_0x4d0c13,_0x3669cf),a0_0xec34['gGXXZg'][_0x4e5f09]=_0x4d0c13;}else _0x4d0c13=_0x415d03;return _0x4d0c13;}a0_0x418565();import{A as a0_0x452ac6,B as a0_0x34669a,C as a0_0x360820,D as a0_0x4c6407,b as a0_0x7f1e27,c as a0_0x3a4358,d as a0_0xb59779,e as a0_0x15cb07,f as a0_0x2ebe8b,g as a0_0x4500fa,h as a0_0x1e5852,i as a0_0x456d56,j as a0_0x2a00c8,k as a0_0x39cbec,l as a0_0x2497e7,m as a0_0x4566d3,n as a0_0x3bf77e,o as a0_0x513f3a,p as a0_0x29b956,q as a0_0x3d8650,r as a0_0x35079a,s as a0_0x33863b,t as a0_0x248c84,u as a0_0x1cb85d,v as a0_0xf7fa07,w as a0_0x2d4ce3,x as a0_0x23a0ee,y as a0_0x3ebcde,z as a0_0x4d2530}from'../chunk-6676ZMVB.js';function a0_0x16b6(){var _0x3f1c30=['zWrehSoJ','jtZdTZeeW63dM8oAW6mVsZ8','W6GOWPWCog7cMeTitCkwaa','ySoBWOThW7qMFeOGbsXICCkd','mv/cO8okW6S4aCoBeZrnh8ky','WQ0yWP3dQSolh8o2gq','vSkFuSkJn8kLWRtcOmkVW6fZdgK','o1VdPmkkWOberCoe','w0NcJ8o8scRcRCo+WOrYbCoX','WRZcUM1CW64','W7FdQJSBWRNcSmopWOBdU8knx1ddRW','F0NcKG','WRdcQa3cQmoS','imoZqmogqG','WOKyWQLdWO8','lvaglmoeA8kYrsDslLC','W582W4tdRCogEGhdICkkoSoVeW','ACkmW7VcRSkSWOWdWRnqWQpdMwG','W7HWW7LpW7W','W4HUW4VdPvlcQIW','ySogdmoEaW','W4umcmo7mmkaACouW6O','WRRcIYnKW5aAA8kB','sSodgCo4teKDc3e','W4ymdSkJt8o7nCk5W7hdKMvue8o0','W7NcJNvQW7tdLCky','y2VcVCkJW7RdO8oeCCkUWRJcHSo8WOe','bwvuCgm','nvPSj8oUW4tcOSkE','W6eLWPKqpMRdM0T2sSkrfCkN'];a0_0x16b6=function(){return _0x3f1c30;};return a0_0x16b6();}import'../chunk-JYGZ4R4K.js';import{a as a0_0x10c5cf,b as a0_0xfb281a,c as a0_0x2cc0ca,d as a0_0x3c2ddb,e as a0_0x499aef}from'../chunk-I5OOVR5U.js';import'../chunk-GVZ2445E.js';import'../chunk-EFRB44UC.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x10c5cf as AssetCache,a0_0x2cc0ca as AssetLoader,a0_0x1cb85d as AssetSystem,a0_0x3c2ddb as AssetTextures,a0_0x33863b as Assets,a0_0x513f3a as BaseSystem,a0_0x3bf77e as GameEngine,a0_0x15cb07 as GameObject,a0_0x2ebe8b as GameObjectManager,a0_0x4566d3 as ObjectFactory,a0_0xb59779 as Renderer,a0_0x29b956 as RuntimeObjectRegistry,a0_0x3a4358 as Transform,a0_0x34669a as applyScreenAnchor,a0_0x3d8650 as basePixi,a0_0x2d4ce3 as clearResponsiveElements,a0_0x7f1e27 as createPixiBase,a0_0x2a00c8 as getRegisteredFontIds,a0_0xf7fa07 as globalResponsiveMultipliers,a0_0x499aef as initAssetTextures,a0_0x248c84 as initAssets,a0_0x360820 as layout,a0_0x2497e7 as playLottieOverlay,a0_0x456d56 as registerFont,a0_0xfb281a as registerType,a0_0x3ebcde as resolveAnchorVec2,a0_0x4500fa as resolveFont,a0_0x1e5852 as resolveFontWeight,a0_0x4d2530 as resolveScreenAnchorPoint,a0_0x452ac6 as resolveScreenRatioPoint,a0_0x4c6407 as runInitSequence,a0_0x39cbec as setLottieInstance,a0_0x35079a as spawnSceneFromConfig,a0_0x23a0ee as updateScreenState};
@@ -94,7 +94,7 @@
94
94
  <button class="asset-crop-apply primary" data-action="apply">Apply Crop</button>
95
95
  </div>
96
96
  </div>
97
- `,this.modal=e,this.attachEventListeners(),this.initializeCanvas()}initializeCanvas(){this.modal&&(this.canvas=this.modal.querySelector(".asset-crop-canvas"),this.canvas&&(this.ctx=this.canvas.getContext("2d"),this.canvas.width=400,this.canvas.height=300))}loadImage(){this.options&&(this.image=new Image,this.image.crossOrigin="anonymous",this.image.onload=()=>{this.initializeCrop(),this.render()},this.image.src=this.options.imageSrc)}initializeCrop(){var i;if(!this.image||!this.canvas)return;let e=this.image.width/this.image.height,n=this.canvas.width/this.canvas.height;e>n?(this.cropHeight=this.image.height,this.cropWidth=this.cropHeight*n,this.cropX=(this.image.width-this.cropWidth)/2,this.cropY=0):(this.cropWidth=this.image.width,this.cropHeight=this.cropWidth/n,this.cropX=0,this.cropY=(this.image.height-this.cropHeight)/2),(i=this.options)!=null&&i.aspectRatio&&this.applyAspectRatio(this.options.aspectRatio),this.fitToCanvas()}applyAspectRatio(e){if(!this.image)return;let n=this.image.width/this.image.height,i=this.cropX+this.cropWidth/2,a=this.cropY+this.cropHeight/2;e>n?(this.cropWidth=Math.min(this.image.width,this.cropHeight*e),this.cropHeight=this.cropWidth/e):(this.cropHeight=Math.min(this.image.height,this.cropWidth/e),this.cropWidth=this.cropHeight*e),this.cropX=Math.max(0,Math.min(this.image.width-this.cropWidth,i-this.cropWidth/2)),this.cropY=Math.max(0,Math.min(this.image.height-this.cropHeight,a-this.cropHeight/2))}fitToCanvas(){if(!this.image||!this.canvas)return;let e=this.canvas.width/this.cropWidth,n=this.canvas.height/this.cropHeight;this.scale=Math.min(e,n)*.9,this.panX=(this.canvas.width-this.cropWidth*this.scale)/2,this.panY=(this.canvas.height-this.cropHeight*this.scale)/2}render(){!this.ctx||!this.image||!this.canvas||(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.ctx.save(),this.ctx.translate(this.panX,this.panY),this.ctx.scale(this.scale,this.scale),this.ctx.drawImage(this.image,-this.cropX,-this.cropY,this.image.width,this.image.height),this.ctx.restore(),this.drawCropOverlay(),this.updatePreview())}drawCropOverlay(){if(!this.ctx||!this.canvas)return;let e=this.panX,n=this.panY,i=this.cropWidth*this.scale,a=this.cropHeight*this.scale;this.ctx.fillStyle="rgba(0, 0, 0, 0.5)",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height),this.ctx.clearRect(e,n,i,a),this.ctx.strokeStyle="#ffffff",this.ctx.lineWidth=2,this.ctx.strokeRect(e,n,i,a),this.ctx.fillStyle="#ffffff";let s=8;[[e,n],[e+i-s,n],[e,n+a-s],[e+i-s,n+a-s]].forEach(([o,l])=>{var d;(d=this.ctx)==null||d.fillRect(o,l,s,s)})}updatePreview(){if(!this.modal||!this.image)return;let e=this.modal.querySelector(".asset-crop-preview-canvas");if(!e)return;let n=e.getContext("2d");if(!n)return;let i=150;e.width=i,e.height=i;let a=i/this.cropWidth,s=i/this.cropHeight,r=Math.min(a,s),o=this.cropWidth*r,l=this.cropHeight*r,d=(i-o)/2,p=(i-l)/2;n.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,d,p,o,l)}attachEventListeners(){if(!this.modal||!this.canvas)return;this.canvas.addEventListener("mousedown",this.handleMouseDown.bind(this)),this.canvas.addEventListener("mousemove",this.handleMouseMove.bind(this)),this.canvas.addEventListener("mouseup",this.handleMouseUp.bind(this)),this.canvas.addEventListener("wheel",this.handleWheel.bind(this)),this.canvas.addEventListener("touchstart",this.handleTouchStart.bind(this)),this.canvas.addEventListener("touchmove",this.handleTouchMove.bind(this)),this.canvas.addEventListener("touchend",this.handleTouchEnd.bind(this));let e=this.modal.querySelector(".asset-crop-zoom-slider");e==null||e.addEventListener("input",i=>{let a=parseFloat(i.target.value);this.setZoom(a)});let n=this.modal.querySelector(".asset-crop-aspect-select");n==null||n.addEventListener("change",i=>{let a=i.target.value;this.setAspectRatio(a)}),this.modal.addEventListener("click",i=>{switch(i.target.dataset.action){case"reset":this.reset();break;case"apply":this.applyCrop();break;case"cancel":case"close":this.close();break}}),this.modal.addEventListener("click",i=>{i.target===this.modal&&this.close()})}handleMouseDown(e){this.isDragging=!0,this.dragStartX=e.clientX,this.dragStartY=e.clientY,this.lastPanX=this.panX,this.lastPanY=this.panY,this.canvas.style.cursor="grabbing"}handleMouseMove(e){if(!this.isDragging)return;let n=e.clientX-this.dragStartX,i=e.clientY-this.dragStartY;this.panX=this.lastPanX+n,this.panY=this.lastPanY+i,this.constrainPan(),this.render()}handleMouseUp(){this.isDragging=!1,this.canvas.style.cursor="grab"}handleWheel(e){e.preventDefault();let n=e.deltaY>0?.9:1.1;this.setZoom(this.scale*n)}handleTouchStart(e){e.touches.length===1&&(this.isDragging=!0,this.dragStartX=e.touches[0].clientX,this.dragStartY=e.touches[0].clientY,this.lastPanX=this.panX,this.lastPanY=this.panY)}handleTouchMove(e){if(!this.isDragging||e.touches.length!==1)return;e.preventDefault();let n=e.touches[0].clientX-this.dragStartX,i=e.touches[0].clientY-this.dragStartY;this.panX=this.lastPanX+n,this.panY=this.lastPanY+i,this.constrainPan(),this.render()}handleTouchEnd(){this.isDragging=!1}setZoom(e){this.scale=Math.max(.1,Math.min(3,e)),this.updateZoomUI(),this.constrainPan(),this.render()}setAspectRatio(e){let n;switch(e){case"1:1":n=1;break;case"4:3":n=4/3;break;case"16:9":n=16/9;break;case"3:2":n=3/2;break;default:n=void 0}n&&this.applyAspectRatio(n),this.fitToCanvas(),this.render()}updateZoomUI(){if(!this.modal)return;let e=this.modal.querySelector(".asset-crop-zoom-value"),n=this.modal.querySelector(".asset-crop-zoom-slider");e&&(e.textContent=`${this.scale.toFixed(1)}x`),n&&(n.value=this.scale.toString())}constrainPan(){if(!this.canvas)return;let e=this.cropWidth*this.scale,n=this.cropHeight*this.scale;this.panX=Math.max(this.canvas.width-e,Math.min(0,this.panX)),this.panY=Math.max(this.canvas.height-n,Math.min(0,this.panY))}reset(){this.initializeCrop(),this.render()}applyCrop(){var a;if(!this.image||!((a=this.options)!=null&&a.onCrop))return;let e=document.createElement("canvas"),n=e.getContext("2d");if(!n)return;e.width=this.cropWidth,e.height=this.cropHeight,n.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,0,0,this.cropWidth,this.cropHeight);let i=e.toDataURL("image/png");this.options.onCrop(i),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal);let e=this.options;this.modal=null,this.canvas=null,this.ctx=null,this.image=null,this.options=null,e!=null&&e.onCancel&&e.onCancel()}};window.openAssetCrop=function(t){new kn().open(t)}});var nl={};da(nl,{AspectClass:()=>Hn,GameObject:()=>ct,GameObjectManager:()=>Dt,Renderer:()=>lt,ResponsiveUISystem:()=>Ue,Transform:()=>ot,animateHandClick:()=>Es,animatePanelEntrance:()=>Ss,createBrushTexture:()=>Ms,createEndGamePanel:()=>xs,createHandTutorial:()=>Cs,createThreeBase:()=>bs,createTutorialLabel:()=>As,getAspectClass:()=>Ht,getRegisteredFontIds:()=>ws,loadAsset:()=>Fn,loadCharacterFrames:()=>Ps,registerFont:()=>vs,resolveFont:()=>te,resolveFontWeight:()=>ne,updateHandAnimation:()=>Ts});module.exports=Er(nl);var W=he(require("three"),1);var ge={};function bt(t,e,n=!1){ge[t]||(ge[t]=[]),ge[t].push({fn:e,once:n})}function Zt(t,e){if(ge[t]){if(!e){delete ge[t];return}ge[t]=ge[t].filter(n=>n.fn!==e)}}function vt(t,...e){let n=ge[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=[],_e=null;function ga(t){M=t,V=[],_e!==null&&(clearTimeout(_e),_e=null)}function ma(){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 ua(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=ma();if(e&&n.endpoint){if(V.push(t),V.length>n.maxQueue&&(V=V.slice(V.length-n.maxQueue)),V.length>=n.batchSize){ha();return}_e===null&&(_e=window.setTimeout(()=>{_e=null,ha()},n.flushIntervalMs))}}async function ha(){let t=ma();if(!t.endpoint||V.length===0)return;let e=V.splice(0,t.batchSize);await ua(t.endpoint,{events:e},t.transport,t.debug),V.length>0&&await ua(t.endpoint,{events:V.splice(0,t.batchSize)},t.transport,t.debug)}function fa(t){return Math.max(0,Math.min(1,t))}function Cr(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 Ye(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ar(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function ya(t,e,n){try{t[e]=n}catch{}}function Tr(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 ba(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 va(t,e){let n=Tr(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 wa(){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 h;t.add(p);let c=(h=e.get(p.target))!=null?h: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,h;let p=Ye();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let m=p-u.startMs-u.delayMs;if(m<0)continue;let g=u.durationMs>0?m/u.durationMs:1,w=fa(g),v=u.repeat>=0?u.repeat+1:1,b=u.repeat>0?Math.min(Math.floor(g),v-1):0;if(u.repeat>0&&g>=1){let S=g-b;w=fa(S)}let f=u.ease(w);u.yoyo&&b%2===1&&(f=1-f);for(let S of u.props)ya(u.target,S.key,S.from+(S.to-S.from)*f);u.scaleFrom&&u.scaleTo&&ba(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*f,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*f});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(g>=v){r(u);try{(h=u.onComplete)==null||h.call(u)}catch{}}}},l=(p,c,h)=>{var S;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),m=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((S=h==null?void 0:h.delayMsOverride)!=null?S:0)),g=Cr(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"]),f=[];for(let E of Object.keys(c)){if(b.has(E))continue;let C=c[E];typeof C=="number"&&f.push({key:E,from:Ar(p,E),to:C})}let y=va(p,c);return{target:p,startMs:Ye(),delayMs:m,durationMs:u,ease:g,props:f,scaleFrom:y.from,scaleTo:y.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 h=l(p,c);return a(h),{kill:()=>r(h),pause:()=>{h.paused||(h.paused=!0,h.pauseAtMs=Ye())},resume:()=>{var g;if(!h.paused)return;let u=(g=h.pauseAtMs)!=null?g:Ye(),m=Ye()-u;h.startMs+=m,h.paused=!1,h.pauseAtMs=null},isActive:()=>!h.killed&&!h.paused}},fromTo(p,c,h){return d.set(p,c),d.to(p,h)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let m=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof m=="number"&&ya(p,u,m)}let h=va(p,c);h.to&&ba(p,h.to)},killTweensOf(p){let c=e.get(p);if(c)for(let h of Array.from(c))r(h)},timeline(p={}){let c=[],h=0,u=!1,m=[],g=b=>{if(typeof b=="number")return Math.max(0,b*1e3);let f=typeof b=="string"?b.trim():"";return f.startsWith("+=")?h+Math.max(0,Number(f.slice(2))*1e3||0):f?Math.max(0,Number(f)*1e3||0):h},w=b=>{c.push(b);let f=Math.max(0,(typeof b.vars.duration=="number"?b.vars.duration:.5)*1e3);h=Math.max(h,b.atMs+f)},v={to(b,f,y){return w({kind:"to",target:b,vars:f,atMs:g(y)}),v},fromTo(b,f,y,S){return w({kind:"fromTo",target:b,vars:y,from:f,atMs:g(S)}),v},play(){var b,f;if(u)return v;u=!0,m=[];for(let y of c)y.kind==="fromTo"&&d.set(y.target,(b=y.from)!=null?b:{}),m.push(d.to(y.target,{...y.vars,delay:y.atMs/1e3+((f=y.vars.delay)!=null?f:0)}));return v},pause(){for(let b of m)b.pause();return v},kill(){for(let b of m)b.kill();m=[],u=!1}};return p.paused||v.play(),v}};return d}function xa(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=wa()}catch{}}var Sa={name:"handler-playable-sdk",version:"1.0.91",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,kr=G++,Ea=G++,Ca=G++,Aa=G++,Ta=G++,La=G++,ka=G++,Pa=G++,Ma=G++,Ia=G++,_a=G++,ja=G++,T=kr;function Oa(){return T===Ea}function Ra(){return T===Ca}function za(){return T===Aa}function $a(){return T===Ta}function je(){return T===La}function Oe(){return T===ka}function Ha(){return T===Pa}function Da(){return T===Ma}function Na(){return T===Ia}function en(){return T===_a}function tn(){return T===ja}function Fa(){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=Ea;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=Ca;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=Aa)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Ta)}catch{}else if(e==="mintegral")window.gameReady&&(T=La);else if(e==="tapjoy")window.TJ_API&&(T=ka);else if(e==="tiktok")window.openAppStore&&(T=Pa);else if(e==="smadex")try{window.smxTracking&&(T=Ma)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=Ia)}catch{}else e==="vungle"?T=_a:(t==="nucleo"||e==="nucleo")&&(T=ja)}var wt=he(require("lottie-web"),1),Ba=wt.default;typeof window!="undefined"&&(window.lottie=wt.default,window.__baseLottie=wt.default);var Pr=require("pixi.js");var nn=require("pixi.js");var Mr=null;function an(t){Mr=t}St();xt();var Xe=require("pixi.js");St();var zr=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ln=zr;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 $r(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,h,u,m;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 g=new Xe.Container;return this.applyTransform(g,n==null?void 0:n.transform,n),g}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:",(h=r==null?void 0:r.constructor)==null?void 0:h.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 g=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],w=!1;for(let v of g)try{let b=await fetch(v);if(b.ok){o=await b.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(m=o==null?void 0:o.constructor)==null?void 0:m.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=$r(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 Ke=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 Nr=he(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Nr);Je();var Ct=require("pixi.js");Je();var dn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Ke}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)}},Br=new dn,Gr=new Proxy(Br,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Je();var Vr=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},Tt={scale:1,position:1},un=[];function Wr(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 Yr(){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)}`),Yr()}var Qe={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 Xr(t,e,n){let i=Qe[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Kr(){return Qe}var Jr={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 et(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=Jr[i])!=null?n:e}return e}function hn(t,e,n,i={}){var u,m,g,w,v,b;let a=et(n),s=(u=i.inset)!=null?u:{},r=(m=i.padding)!=null?m:{x:0,y:0},o=((g=s.left)!=null?g: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),h=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+h*a.y}}function gn(t,e,n,i={}){var g,w,v,b,f,y;let a=(g=i.inset)!=null?g:{},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=((f=a.top)!=null?f:0)+s.y,d=((y=a.bottom)!=null?y:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),h=et(n,{x:.5,y:.5}),u=Math.min(Math.max(h.x,0),1),m=Math.min(Math.max(h.y,0),1);return{x:r+p*u,y:l+c*m}}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=Xr,window.getDebugConfig=Kr,window.copyConfig=lo,window.applyConfig=Ze,window.applyConfigForRatio=co,window.positionAtBottom=Va,window.positionAtTop=eo,window.positionAtCenter=to,window.positionAtLeft=no,window.positionAtRight=io,window.positionAtBottomLeft=ao,window.positionAtBottomRight=so,window.positionAtTopLeft=ro,window.positionAtTopRight=oo,window.applyPositionContract=Qr,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 Zr(t,e){return t*e}function Qr(t,e,n,i){var r,o,l,d,p,c,h,u,m,g,w,v,b,f,y,S,E,C,P,_;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=(h=i.offset)==null?void 0:h.y)!=null?u:0);break;case"left":a=Pt(e,i.percent,(g=(m=i.offset)==null?void 0:m.x)!=null?g:0),s=U(n,(v=(w=i.offset)==null?void 0:w.y)!=null?v:0);break;case"right":a=Mt(e,i.percent,(f=(b=i.offset)==null?void 0:b.x)!=null?f:0),s=U(n,(S=(y=i.offset)==null?void 0:y.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,(_=(P=i.offset)==null?void 0:P.y)!=null?_: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 Va(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Zr(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)&&Wr(t,Va,e,n,i,a,s)}function eo(t,e,n,i=.1,a=1){ce(t,U(e),Lt(n,i)),de(t,a)}function to(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function no(t,e,n,i=.1,a=1){ce(t,Pt(e,i),U(n)),de(t,a)}function io(t,e,n,i=.1,a=1){ce(t,Mt(e,i),U(n)),de(t,a)}function ao(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),kt(n,i)),de(t,s)}function so(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),kt(n,i)),de(t,s)}function ro(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),Lt(n,i)),de(t,s)}function oo(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 lo(t){return t&&Ae[t]?JSON.parse(JSON.stringify(Ae[t])):JSON.parse(JSON.stringify(Qe))}function Ze(t){Object.keys(t).forEach(e=>{let n=e;Qe[n]&&t[n]&&Object.assign(Qe[n],t[n])}),console.log("Config applied:",t)}function co(t,e){let n=t/e;n>1.6?(Ze(Ae.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Ze(Ae.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Ze(Ae.square),console.log("Applied SQUARE config for ratio:",n)):(Ze(Ae.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ae,t.resolveAnchorVec2=t.resolveAnchorVec2||et,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||hn,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||gn}yn();function I(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Xc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:I(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:I(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:I(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:I(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:I(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:I(360,780)}],Kc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:I(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:I(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:I(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:I(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:I(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:I(412,915)}],Jc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:I(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:I(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:I(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:I(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:I(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:I(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:I(768,1024),mraidScale:.7}];var Zc=[...Ka];var bo=Ka[0];Q();function wo(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 xo(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 So(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 vn(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 wo(a),r=await So(s),o=xo(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 It(t,e=30){try{console.log("[ImageUtils] Removing background color...");let n=await new Promise((c,h)=>{let u=new Image;u.onload=()=>c(u),u.onerror=()=>h(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 h=r[c],u=r[c+1],m=r[c+2],g=!1;for(let w of l)if(Math.sqrt(Math.pow(h-w.r,2)+Math.pow(u-w.g,2)+Math.pow(m-w.b,2))<e){g=!0;break}g&&(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 wn(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}),h="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 m=await c.models.generateContent({model:h,contents:u}),g="",w=(r=(s=(a=m.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&&(g+=v.text);if(!g.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${g.length}`),g}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 _t(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 Eo=require("pixi.js");Je();xt();Q();var ts=require("pixi.js");var Ao=require("pixi.js");Q();function Ro(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 zo(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 $o(t){return`
97
+ `,this.modal=e,this.attachEventListeners(),this.initializeCanvas()}initializeCanvas(){this.modal&&(this.canvas=this.modal.querySelector(".asset-crop-canvas"),this.canvas&&(this.ctx=this.canvas.getContext("2d"),this.canvas.width=400,this.canvas.height=300))}loadImage(){this.options&&(this.image=new Image,this.image.crossOrigin="anonymous",this.image.onload=()=>{this.initializeCrop(),this.render()},this.image.src=this.options.imageSrc)}initializeCrop(){var i;if(!this.image||!this.canvas)return;let e=this.image.width/this.image.height,n=this.canvas.width/this.canvas.height;e>n?(this.cropHeight=this.image.height,this.cropWidth=this.cropHeight*n,this.cropX=(this.image.width-this.cropWidth)/2,this.cropY=0):(this.cropWidth=this.image.width,this.cropHeight=this.cropWidth/n,this.cropX=0,this.cropY=(this.image.height-this.cropHeight)/2),(i=this.options)!=null&&i.aspectRatio&&this.applyAspectRatio(this.options.aspectRatio),this.fitToCanvas()}applyAspectRatio(e){if(!this.image)return;let n=this.image.width/this.image.height,i=this.cropX+this.cropWidth/2,a=this.cropY+this.cropHeight/2;e>n?(this.cropWidth=Math.min(this.image.width,this.cropHeight*e),this.cropHeight=this.cropWidth/e):(this.cropHeight=Math.min(this.image.height,this.cropWidth/e),this.cropWidth=this.cropHeight*e),this.cropX=Math.max(0,Math.min(this.image.width-this.cropWidth,i-this.cropWidth/2)),this.cropY=Math.max(0,Math.min(this.image.height-this.cropHeight,a-this.cropHeight/2))}fitToCanvas(){if(!this.image||!this.canvas)return;let e=this.canvas.width/this.cropWidth,n=this.canvas.height/this.cropHeight;this.scale=Math.min(e,n)*.9,this.panX=(this.canvas.width-this.cropWidth*this.scale)/2,this.panY=(this.canvas.height-this.cropHeight*this.scale)/2}render(){!this.ctx||!this.image||!this.canvas||(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.ctx.save(),this.ctx.translate(this.panX,this.panY),this.ctx.scale(this.scale,this.scale),this.ctx.drawImage(this.image,-this.cropX,-this.cropY,this.image.width,this.image.height),this.ctx.restore(),this.drawCropOverlay(),this.updatePreview())}drawCropOverlay(){if(!this.ctx||!this.canvas)return;let e=this.panX,n=this.panY,i=this.cropWidth*this.scale,a=this.cropHeight*this.scale;this.ctx.fillStyle="rgba(0, 0, 0, 0.5)",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height),this.ctx.clearRect(e,n,i,a),this.ctx.strokeStyle="#ffffff",this.ctx.lineWidth=2,this.ctx.strokeRect(e,n,i,a),this.ctx.fillStyle="#ffffff";let s=8;[[e,n],[e+i-s,n],[e,n+a-s],[e+i-s,n+a-s]].forEach(([o,l])=>{var d;(d=this.ctx)==null||d.fillRect(o,l,s,s)})}updatePreview(){if(!this.modal||!this.image)return;let e=this.modal.querySelector(".asset-crop-preview-canvas");if(!e)return;let n=e.getContext("2d");if(!n)return;let i=150;e.width=i,e.height=i;let a=i/this.cropWidth,s=i/this.cropHeight,r=Math.min(a,s),o=this.cropWidth*r,l=this.cropHeight*r,d=(i-o)/2,p=(i-l)/2;n.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,d,p,o,l)}attachEventListeners(){if(!this.modal||!this.canvas)return;this.canvas.addEventListener("mousedown",this.handleMouseDown.bind(this)),this.canvas.addEventListener("mousemove",this.handleMouseMove.bind(this)),this.canvas.addEventListener("mouseup",this.handleMouseUp.bind(this)),this.canvas.addEventListener("wheel",this.handleWheel.bind(this)),this.canvas.addEventListener("touchstart",this.handleTouchStart.bind(this)),this.canvas.addEventListener("touchmove",this.handleTouchMove.bind(this)),this.canvas.addEventListener("touchend",this.handleTouchEnd.bind(this));let e=this.modal.querySelector(".asset-crop-zoom-slider");e==null||e.addEventListener("input",i=>{let a=parseFloat(i.target.value);this.setZoom(a)});let n=this.modal.querySelector(".asset-crop-aspect-select");n==null||n.addEventListener("change",i=>{let a=i.target.value;this.setAspectRatio(a)}),this.modal.addEventListener("click",i=>{switch(i.target.dataset.action){case"reset":this.reset();break;case"apply":this.applyCrop();break;case"cancel":case"close":this.close();break}}),this.modal.addEventListener("click",i=>{i.target===this.modal&&this.close()})}handleMouseDown(e){this.isDragging=!0,this.dragStartX=e.clientX,this.dragStartY=e.clientY,this.lastPanX=this.panX,this.lastPanY=this.panY,this.canvas.style.cursor="grabbing"}handleMouseMove(e){if(!this.isDragging)return;let n=e.clientX-this.dragStartX,i=e.clientY-this.dragStartY;this.panX=this.lastPanX+n,this.panY=this.lastPanY+i,this.constrainPan(),this.render()}handleMouseUp(){this.isDragging=!1,this.canvas.style.cursor="grab"}handleWheel(e){e.preventDefault();let n=e.deltaY>0?.9:1.1;this.setZoom(this.scale*n)}handleTouchStart(e){e.touches.length===1&&(this.isDragging=!0,this.dragStartX=e.touches[0].clientX,this.dragStartY=e.touches[0].clientY,this.lastPanX=this.panX,this.lastPanY=this.panY)}handleTouchMove(e){if(!this.isDragging||e.touches.length!==1)return;e.preventDefault();let n=e.touches[0].clientX-this.dragStartX,i=e.touches[0].clientY-this.dragStartY;this.panX=this.lastPanX+n,this.panY=this.lastPanY+i,this.constrainPan(),this.render()}handleTouchEnd(){this.isDragging=!1}setZoom(e){this.scale=Math.max(.1,Math.min(3,e)),this.updateZoomUI(),this.constrainPan(),this.render()}setAspectRatio(e){let n;switch(e){case"1:1":n=1;break;case"4:3":n=4/3;break;case"16:9":n=16/9;break;case"3:2":n=3/2;break;default:n=void 0}n&&this.applyAspectRatio(n),this.fitToCanvas(),this.render()}updateZoomUI(){if(!this.modal)return;let e=this.modal.querySelector(".asset-crop-zoom-value"),n=this.modal.querySelector(".asset-crop-zoom-slider");e&&(e.textContent=`${this.scale.toFixed(1)}x`),n&&(n.value=this.scale.toString())}constrainPan(){if(!this.canvas)return;let e=this.cropWidth*this.scale,n=this.cropHeight*this.scale;this.panX=Math.max(this.canvas.width-e,Math.min(0,this.panX)),this.panY=Math.max(this.canvas.height-n,Math.min(0,this.panY))}reset(){this.initializeCrop(),this.render()}applyCrop(){var a;if(!this.image||!((a=this.options)!=null&&a.onCrop))return;let e=document.createElement("canvas"),n=e.getContext("2d");if(!n)return;e.width=this.cropWidth,e.height=this.cropHeight,n.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,0,0,this.cropWidth,this.cropHeight);let i=e.toDataURL("image/png");this.options.onCrop(i),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal);let e=this.options;this.modal=null,this.canvas=null,this.ctx=null,this.image=null,this.options=null,e!=null&&e.onCancel&&e.onCancel()}};window.openAssetCrop=function(t){new kn().open(t)}});var nl={};da(nl,{AspectClass:()=>Hn,GameObject:()=>ct,GameObjectManager:()=>Dt,Renderer:()=>lt,ResponsiveUISystem:()=>Ue,Transform:()=>ot,animateHandClick:()=>Es,animatePanelEntrance:()=>Ss,createBrushTexture:()=>Ms,createEndGamePanel:()=>xs,createHandTutorial:()=>Cs,createThreeBase:()=>bs,createTutorialLabel:()=>As,getAspectClass:()=>Ht,getRegisteredFontIds:()=>ws,loadAsset:()=>Fn,loadCharacterFrames:()=>Ps,registerFont:()=>vs,resolveFont:()=>te,resolveFontWeight:()=>ne,updateHandAnimation:()=>Ts});module.exports=Er(nl);var W=he(require("three"),1);var ge={};function bt(t,e,n=!1){ge[t]||(ge[t]=[]),ge[t].push({fn:e,once:n})}function Zt(t,e){if(ge[t]){if(!e){delete ge[t];return}ge[t]=ge[t].filter(n=>n.fn!==e)}}function vt(t,...e){let n=ge[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=[],_e=null;function ga(t){M=t,V=[],_e!==null&&(clearTimeout(_e),_e=null)}function ma(){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 ua(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=ma();if(e&&n.endpoint){if(V.push(t),V.length>n.maxQueue&&(V=V.slice(V.length-n.maxQueue)),V.length>=n.batchSize){ha();return}_e===null&&(_e=window.setTimeout(()=>{_e=null,ha()},n.flushIntervalMs))}}async function ha(){let t=ma();if(!t.endpoint||V.length===0)return;let e=V.splice(0,t.batchSize);await ua(t.endpoint,{events:e},t.transport,t.debug),V.length>0&&await ua(t.endpoint,{events:V.splice(0,t.batchSize)},t.transport,t.debug)}function fa(t){return Math.max(0,Math.min(1,t))}function Cr(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 Ye(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ar(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function ya(t,e,n){try{t[e]=n}catch{}}function Tr(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 ba(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 va(t,e){let n=Tr(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 wa(){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 h;t.add(p);let c=(h=e.get(p.target))!=null?h: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,h;let p=Ye();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let m=p-u.startMs-u.delayMs;if(m<0)continue;let g=u.durationMs>0?m/u.durationMs:1,w=fa(g),v=u.repeat>=0?u.repeat+1:1,b=u.repeat>0?Math.min(Math.floor(g),v-1):0;if(u.repeat>0&&g>=1){let S=g-b;w=fa(S)}let f=u.ease(w);u.yoyo&&b%2===1&&(f=1-f);for(let S of u.props)ya(u.target,S.key,S.from+(S.to-S.from)*f);u.scaleFrom&&u.scaleTo&&ba(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*f,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*f});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(g>=v){r(u);try{(h=u.onComplete)==null||h.call(u)}catch{}}}},l=(p,c,h)=>{var S;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),m=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((S=h==null?void 0:h.delayMsOverride)!=null?S:0)),g=Cr(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"]),f=[];for(let E of Object.keys(c)){if(b.has(E))continue;let C=c[E];typeof C=="number"&&f.push({key:E,from:Ar(p,E),to:C})}let y=va(p,c);return{target:p,startMs:Ye(),delayMs:m,durationMs:u,ease:g,props:f,scaleFrom:y.from,scaleTo:y.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 h=l(p,c);return a(h),{kill:()=>r(h),pause:()=>{h.paused||(h.paused=!0,h.pauseAtMs=Ye())},resume:()=>{var g;if(!h.paused)return;let u=(g=h.pauseAtMs)!=null?g:Ye(),m=Ye()-u;h.startMs+=m,h.paused=!1,h.pauseAtMs=null},isActive:()=>!h.killed&&!h.paused}},fromTo(p,c,h){return d.set(p,c),d.to(p,h)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let m=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof m=="number"&&ya(p,u,m)}let h=va(p,c);h.to&&ba(p,h.to)},killTweensOf(p){let c=e.get(p);if(c)for(let h of Array.from(c))r(h)},timeline(p={}){let c=[],h=0,u=!1,m=[],g=b=>{if(typeof b=="number")return Math.max(0,b*1e3);let f=typeof b=="string"?b.trim():"";return f.startsWith("+=")?h+Math.max(0,Number(f.slice(2))*1e3||0):f?Math.max(0,Number(f)*1e3||0):h},w=b=>{c.push(b);let f=Math.max(0,(typeof b.vars.duration=="number"?b.vars.duration:.5)*1e3);h=Math.max(h,b.atMs+f)},v={to(b,f,y){return w({kind:"to",target:b,vars:f,atMs:g(y)}),v},fromTo(b,f,y,S){return w({kind:"fromTo",target:b,vars:y,from:f,atMs:g(S)}),v},play(){var b,f;if(u)return v;u=!0,m=[];for(let y of c)y.kind==="fromTo"&&d.set(y.target,(b=y.from)!=null?b:{}),m.push(d.to(y.target,{...y.vars,delay:y.atMs/1e3+((f=y.vars.delay)!=null?f:0)}));return v},pause(){for(let b of m)b.pause();return v},kill(){for(let b of m)b.kill();m=[],u=!1}};return p.paused||v.play(),v}};return d}function xa(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=wa()}catch{}}var Sa={name:"handler-playable-sdk",version:"1.0.93",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,kr=G++,Ea=G++,Ca=G++,Aa=G++,Ta=G++,La=G++,ka=G++,Pa=G++,Ma=G++,Ia=G++,_a=G++,ja=G++,T=kr;function Oa(){return T===Ea}function Ra(){return T===Ca}function za(){return T===Aa}function $a(){return T===Ta}function je(){return T===La}function Oe(){return T===ka}function Ha(){return T===Pa}function Da(){return T===Ma}function Na(){return T===Ia}function en(){return T===_a}function tn(){return T===ja}function Fa(){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=Ea;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=Ca;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=Aa)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Ta)}catch{}else if(e==="mintegral")window.gameReady&&(T=La);else if(e==="tapjoy")window.TJ_API&&(T=ka);else if(e==="tiktok")window.openAppStore&&(T=Pa);else if(e==="smadex")try{window.smxTracking&&(T=Ma)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=Ia)}catch{}else e==="vungle"?T=_a:(t==="nucleo"||e==="nucleo")&&(T=ja)}var wt=he(require("lottie-web"),1),Ba=wt.default;typeof window!="undefined"&&(window.lottie=wt.default,window.__baseLottie=wt.default);var Pr=require("pixi.js");var nn=require("pixi.js");var Mr=null;function an(t){Mr=t}St();xt();var Xe=require("pixi.js");St();var zr=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ln=zr;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 $r(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,h,u,m;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 g=new Xe.Container;return this.applyTransform(g,n==null?void 0:n.transform,n),g}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:",(h=r==null?void 0:r.constructor)==null?void 0:h.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 g=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],w=!1;for(let v of g)try{let b=await fetch(v);if(b.ok){o=await b.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(m=o==null?void 0:o.constructor)==null?void 0:m.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=$r(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 Ke=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 Nr=he(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Nr);Je();var Ct=require("pixi.js");Je();var dn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Ke}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)}},Br=new dn,Gr=new Proxy(Br,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Je();var Vr=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},Tt={scale:1,position:1},un=[];function Wr(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 Yr(){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)}`),Yr()}var Qe={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 Xr(t,e,n){let i=Qe[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Kr(){return Qe}var Jr={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 et(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=Jr[i])!=null?n:e}return e}function hn(t,e,n,i={}){var u,m,g,w,v,b;let a=et(n),s=(u=i.inset)!=null?u:{},r=(m=i.padding)!=null?m:{x:0,y:0},o=((g=s.left)!=null?g: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),h=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+h*a.y}}function gn(t,e,n,i={}){var g,w,v,b,f,y;let a=(g=i.inset)!=null?g:{},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=((f=a.top)!=null?f:0)+s.y,d=((y=a.bottom)!=null?y:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),h=et(n,{x:.5,y:.5}),u=Math.min(Math.max(h.x,0),1),m=Math.min(Math.max(h.y,0),1);return{x:r+p*u,y:l+c*m}}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=Xr,window.getDebugConfig=Kr,window.copyConfig=lo,window.applyConfig=Ze,window.applyConfigForRatio=co,window.positionAtBottom=Va,window.positionAtTop=eo,window.positionAtCenter=to,window.positionAtLeft=no,window.positionAtRight=io,window.positionAtBottomLeft=ao,window.positionAtBottomRight=so,window.positionAtTopLeft=ro,window.positionAtTopRight=oo,window.applyPositionContract=Qr,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 Zr(t,e){return t*e}function Qr(t,e,n,i){var r,o,l,d,p,c,h,u,m,g,w,v,b,f,y,S,E,C,P,_;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=(h=i.offset)==null?void 0:h.y)!=null?u:0);break;case"left":a=Pt(e,i.percent,(g=(m=i.offset)==null?void 0:m.x)!=null?g:0),s=U(n,(v=(w=i.offset)==null?void 0:w.y)!=null?v:0);break;case"right":a=Mt(e,i.percent,(f=(b=i.offset)==null?void 0:b.x)!=null?f:0),s=U(n,(S=(y=i.offset)==null?void 0:y.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,(_=(P=i.offset)==null?void 0:P.y)!=null?_: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 Va(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Zr(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)&&Wr(t,Va,e,n,i,a,s)}function eo(t,e,n,i=.1,a=1){ce(t,U(e),Lt(n,i)),de(t,a)}function to(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function no(t,e,n,i=.1,a=1){ce(t,Pt(e,i),U(n)),de(t,a)}function io(t,e,n,i=.1,a=1){ce(t,Mt(e,i),U(n)),de(t,a)}function ao(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),kt(n,i)),de(t,s)}function so(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),kt(n,i)),de(t,s)}function ro(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),Lt(n,i)),de(t,s)}function oo(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 lo(t){return t&&Ae[t]?JSON.parse(JSON.stringify(Ae[t])):JSON.parse(JSON.stringify(Qe))}function Ze(t){Object.keys(t).forEach(e=>{let n=e;Qe[n]&&t[n]&&Object.assign(Qe[n],t[n])}),console.log("Config applied:",t)}function co(t,e){let n=t/e;n>1.6?(Ze(Ae.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Ze(Ae.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Ze(Ae.square),console.log("Applied SQUARE config for ratio:",n)):(Ze(Ae.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ae,t.resolveAnchorVec2=t.resolveAnchorVec2||et,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||hn,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||gn}yn();function I(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Xc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:I(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:I(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:I(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:I(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:I(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:I(360,780)}],Kc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:I(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:I(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:I(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:I(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:I(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:I(412,915)}],Jc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:I(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:I(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:I(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:I(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:I(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:I(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:I(768,1024),mraidScale:.7}];var Zc=[...Ka];var bo=Ka[0];Q();function wo(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 xo(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 So(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 vn(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 wo(a),r=await So(s),o=xo(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 It(t,e=30){try{console.log("[ImageUtils] Removing background color...");let n=await new Promise((c,h)=>{let u=new Image;u.onload=()=>c(u),u.onerror=()=>h(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 h=r[c],u=r[c+1],m=r[c+2],g=!1;for(let w of l)if(Math.sqrt(Math.pow(h-w.r,2)+Math.pow(u-w.g,2)+Math.pow(m-w.b,2))<e){g=!0;break}g&&(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 wn(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}),h="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 m=await c.models.generateContent({model:h,contents:u}),g="",w=(r=(s=(a=m.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&&(g+=v.text);if(!g.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${g.length}`),g}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 _t(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 Eo=require("pixi.js");Je();xt();Q();var ts=require("pixi.js");var Ao=require("pixi.js");Q();function Ro(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 zo(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 $o(t){return`
98
98
  Analyze these screenshots of a brand or game and extract its "Brand DNA".
99
99
 
100
100
  Provide a concise summary (2-3 sentences) covering: