handler-playable-sdk 0.3.39 → 0.3.41

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.
@@ -1 +1 @@
1
- (function(_0x59d476,_0x533408){var a0_0xfbc06a={_0x1cba50:0x4eb,_0x41de9d:0x4eb,_0x422578:0x4e6,_0x30fe48:0x4f7,_0x130802:0x4e0,_0x1923a1:0x4e9,_0x225ad7:0x4f8,_0x1a5cb2:0x4d9,_0x50a8d6:'z[c#',_0x1e3ae3:0x32a,_0x47c0d9:0x320,_0x2b733e:0x337,_0x2a7fca:0x318,_0x58ec07:'#[Oi',_0x4d0d41:0x319,_0x370c2c:0x31d,_0x399660:0x310,_0x36a9c0:'sO]I',_0x1e895c:0x307,_0x54443f:0x503,_0x25e9fd:0x4fd,_0x4b9854:0x4f2,_0x133b41:0x4ee,_0x9d0eac:0x333,_0x2d6597:0x32d,_0x14cd9d:'[!Fj',_0x556751:0x252,_0x502c12:0x24b,_0x1656c7:'E#bd',_0x32e157:0x249,_0x27b643:0x4fc,_0x1dc852:0x4f8,_0x489669:0x4f5,_0xb967a2:0x4ea,_0x4ce509:'K9En',_0x5f01ec:0x24f,_0x5dc20c:0x24a,_0x359ab2:'vS]8',_0x49cb82:0x248,_0x570481:0x24f,_0x79ac3a:0x31e,_0xd4a2dc:0x329,_0x39dcc3:0x326,_0x530f1a:'WZ1N',_0x5102dd:0x321},a0_0x217c44={_0x33e092:0x3de},a0_0xb8dca8={_0x364a23:0x36a},a0_0xae641f={_0x50589b:0x197};function _0x41ed30(_0x56ee34,_0x3b8330,_0x554904,_0x2ab443,_0x11c4f7){return a0_0x4946(_0x3b8330-a0_0xae641f._0x50589b,_0x2ab443);}var _0x3161a9=_0x59d476();function _0x2c2768(_0x2de22c,_0x4c37ff,_0x150ea3,_0x27d6a2,_0x32fe7d){return a0_0x4946(_0x4c37ff-a0_0xb8dca8._0x364a23,_0x32fe7d);}function _0x568f1b(_0x2eb95f,_0x44b697,_0xfe8c,_0x5b434c,_0x5f3932){return a0_0x4946(_0x5f3932- -a0_0x217c44._0x33e092,_0xfe8c);}while(!![]){try{var _0x4bf2c8=parseInt(_0x2c2768(a0_0xfbc06a._0x1cba50,a0_0xfbc06a._0x41de9d,a0_0xfbc06a._0x422578,a0_0xfbc06a._0x30fe48,'xJN%'))/(-0x33*0x44+-0x1980+-0x270d*-0x1)+-parseInt(_0x2c2768(a0_0xfbc06a._0x130802,a0_0xfbc06a._0x1923a1,a0_0xfbc06a._0x225ad7,a0_0xfbc06a._0x1a5cb2,a0_0xfbc06a._0x50a8d6))/(-0x7*-0x267+-0x36*-0x3+-0x1171)*(-parseInt(_0x41ed30(a0_0xfbc06a._0x1e3ae3,0x327,a0_0xfbc06a._0x47c0d9,'yR!d',a0_0xfbc06a._0x2b733e))/(-0x1f46+0x5*-0x511+0x2*0x1c4f))+parseInt(_0x41ed30(a0_0xfbc06a._0x2a7fca,0x31e,0x30f,a0_0xfbc06a._0x58ec07,a0_0xfbc06a._0x4d0d41))/(-0x1564+-0x1*-0x349+-0x121f*-0x1)+parseInt(_0x41ed30(a0_0xfbc06a._0x370c2c,a0_0xfbc06a._0x399660,0x305,a0_0xfbc06a._0x36a9c0,a0_0xfbc06a._0x1e895c))/(0x35*0x8b+-0x7*-0x469+0xbed*-0x5)*(parseInt(_0x2c2768(a0_0xfbc06a._0x54443f,a0_0xfbc06a._0x25e9fd,a0_0xfbc06a._0x4b9854,a0_0xfbc06a._0x133b41,'pMph'))/(-0x5*-0x14d+-0x6fb+0x40*0x2))+parseInt(_0x41ed30(a0_0xfbc06a._0x9d0eac,a0_0xfbc06a._0x2d6597,0x33c,a0_0xfbc06a._0x14cd9d,0x32a))/(0xb*0x92+-0xf4d+-0x1*-0x90e)*(parseInt(_0x568f1b(-a0_0xfbc06a._0x556751,-a0_0xfbc06a._0x502c12,a0_0xfbc06a._0x1656c7,-0x244,-a0_0xfbc06a._0x32e157))/(0x7fb+0x2386*0x1+-0x2b79))+parseInt(_0x2c2768(a0_0xfbc06a._0x27b643,a0_0xfbc06a._0x1dc852,a0_0xfbc06a._0x489669,a0_0xfbc06a._0xb967a2,a0_0xfbc06a._0x4ce509))/(0x1f0c+0x167*-0x12+-0x5c5)*(parseInt(_0x568f1b(-a0_0xfbc06a._0x5f01ec,-a0_0xfbc06a._0x5dc20c,a0_0xfbc06a._0x359ab2,-a0_0xfbc06a._0x49cb82,-a0_0xfbc06a._0x570481))/(0x18a6+-0x216d+0x8d1))+-parseInt(_0x41ed30(a0_0xfbc06a._0x79ac3a,a0_0xfbc06a._0xd4a2dc,a0_0xfbc06a._0x39dcc3,a0_0xfbc06a._0x530f1a,a0_0xfbc06a._0x5102dd))/(0x3*0x971+-0x11d5+0x6b*-0x19);if(_0x4bf2c8===_0x533408)break;else _0x3161a9['push'](_0x3161a9['shift']());}catch(_0x1eb059){_0x3161a9['push'](_0x3161a9['shift']());}}}(a0_0x3c5d,0x108c07*0x1+0xa5673*-0x2+-0x16d3*-0xb3));var a0_0x5e8a56=(function(){var _0x56620f=!![];return function(_0x3b2bc5,_0x401f6b){var a0_0x11363f={_0xfc7921:0x2ba,_0x87db85:0x2b7,_0x5998c5:'(koq',_0x2d1e4f:0x2ab,_0x21106d:0x2b0},a0_0x32fc24={_0x3ca2d8:0x13c},_0x188fbd=_0x56620f?function(){function _0x46a19c(_0x4bb256,_0x58f61d,_0x1574f4,_0x2b456d,_0x1c35e2){return a0_0x4946(_0x4bb256-a0_0x32fc24._0x3ca2d8,_0x1574f4);}if(_0x401f6b){var _0x42c6d9=_0x401f6b[_0x46a19c(a0_0x11363f._0xfc7921,a0_0x11363f._0x87db85,a0_0x11363f._0x5998c5,a0_0x11363f._0x2d1e4f,a0_0x11363f._0x21106d)](_0x3b2bc5,arguments);return _0x401f6b=null,_0x42c6d9;}}:function(){};return _0x56620f=![],_0x188fbd;};}()),a0_0x18cdd9=a0_0x5e8a56(this,function(){var a0_0x3d3a8b={_0x17e07a:0x11b,_0x3d350f:'E^%$',_0x4b3969:0x12a,_0x1067a0:0x114,_0x579198:0x108,_0xcde400:'WcYy',_0x48bab5:0x113,_0x385773:0xfd,_0x268200:0x11a,_0x3f0857:'xJN%',_0x1efef3:0x28c,_0x3008ef:0x271,_0x19f19f:0x96,_0x1cb966:0x97,_0xbab951:0x8d,_0x1ffb47:'v[x!',_0x206825:0x115,_0x45b444:0x10f,_0x152c8e:0x274,_0x442927:')!rM',_0x1125ea:0x274,_0x3a3b76:0x27a,_0x1d5990:'29lu',_0x148f37:0x272,_0x16b63e:0x11d,_0x1cad55:'$3Ky',_0x49a2f2:0x110,_0x822c82:0x116,_0x26246e:0xfa,_0x116a3a:0xf1,_0x57b23a:0x102,_0x296a25:0x27a,_0x46cae3:0x281,_0x1c8bd3:'skXN',_0x557b92:0x283,_0x260e11:0x279},a0_0x33c65d={_0x2833f5:0xf8},a0_0x1b6fb0={_0x45c891:0x218};function _0x3260d5(_0x280a08,_0x9b9b55,_0x489cab,_0x825731,_0x5bf68f){return a0_0x4946(_0x825731- -a0_0x1b6fb0._0x45c891,_0x489cab);}function _0x2c3433(_0x4a9021,_0x31746c,_0x28d289,_0x2a0688,_0x34f116){return a0_0x4946(_0x31746c-a0_0x33c65d._0x2833f5,_0x28d289);}function _0x598f01(_0x438c09,_0x131fbb,_0xe726ac,_0x2fb0d2,_0x2d7080){return a0_0x4946(_0x438c09- -0x295,_0x131fbb);}return a0_0x18cdd9[_0x598f01(-a0_0x3d3a8b._0x17e07a,a0_0x3d3a8b._0x3d350f,-a0_0x3d3a8b._0x4b3969,-0x10b,-a0_0x3d3a8b._0x1067a0)+'ing']()[_0x598f01(-a0_0x3d3a8b._0x579198,a0_0x3d3a8b._0xcde400,-a0_0x3d3a8b._0x48bab5,-0x101,-a0_0x3d3a8b._0x385773)+'h'](_0x598f01(-a0_0x3d3a8b._0x268200,a0_0x3d3a8b._0x3f0857,-0x126,-0x11c,-0x11e)+_0x2c3433(a0_0x3d3a8b._0x1efef3,0x27e,'OIM8',0x27a,a0_0x3d3a8b._0x3008ef)+'+$')[_0x3260d5(-a0_0x3d3a8b._0x19f19f,-a0_0x3d3a8b._0x1cb966,'STIr',-a0_0x3d3a8b._0xbab951,-0x83)+_0x598f01(-0x115,a0_0x3d3a8b._0x1ffb47,-a0_0x3d3a8b._0x17e07a,-a0_0x3d3a8b._0x206825,-a0_0x3d3a8b._0x45b444)]()[_0x2c3433(0x281,a0_0x3d3a8b._0x152c8e,a0_0x3d3a8b._0x442927,a0_0x3d3a8b._0x1125ea,a0_0x3d3a8b._0x1125ea)+_0x2c3433(0x26e,a0_0x3d3a8b._0x3a3b76,a0_0x3d3a8b._0x1d5990,a0_0x3d3a8b._0x148f37,0x275)+'r'](a0_0x18cdd9)[_0x598f01(-a0_0x3d3a8b._0x16b63e,a0_0x3d3a8b._0x1cad55,-a0_0x3d3a8b._0x49a2f2,-a0_0x3d3a8b._0x822c82,-0x12d)+'h'](_0x598f01(-0x101,a0_0x3d3a8b._0xcde400,-a0_0x3d3a8b._0x26246e,-a0_0x3d3a8b._0x116a3a,-a0_0x3d3a8b._0x57b23a)+_0x2c3433(a0_0x3d3a8b._0x296a25,a0_0x3d3a8b._0x46cae3,a0_0x3d3a8b._0x1c8bd3,a0_0x3d3a8b._0x557b92,a0_0x3d3a8b._0x260e11)+'+$');});a0_0x18cdd9();import{A as a0_0x3aad04,B as a0_0x49f791,C as a0_0x186e4e,D as a0_0x485bce,b as a0_0x37b98f,c as a0_0x351832,d as a0_0x5c18ac,e as a0_0x59753b,f as a0_0x466e39,g as a0_0xbdf0f0,h as a0_0x5badbb,i as a0_0x4f2c73,j as a0_0x463762,k as a0_0x17b98e,l as a0_0x26107e,m as a0_0xecaa4d,n as a0_0xca59e2,o as a0_0x278cd5,p as a0_0x561efd,q as a0_0x53b75c,r as a0_0x590c21,s as a0_0x35a072,t as a0_0x9c9811,u as a0_0x2d50ec,v as a0_0x1d2d57,w as a0_0x1b2ad0,x as a0_0x31e7d5,y as a0_0x1e9393,z as a0_0x43c239}from'../chunk-CWB5AX6E.js';import{a as a0_0x42dbc9,b as a0_0x390ad6,c as a0_0x21acbb,d as a0_0xf472f9,e as a0_0x3a5830}from'../chunk-I5OOVR5U.js';function a0_0x4946(_0x33b2c7,_0x3ebb28){_0x33b2c7=_0x33b2c7-(0x118a+-0xa7b+0x9*-0x9f);var _0x46dd0e=a0_0x3c5d();var _0x2b359a=_0x46dd0e[_0x33b2c7];if(a0_0x4946['iJutOy']===undefined){var _0x3a4469=function(_0x3d43ea){var _0x4e221d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x1939ad='',_0x50eca1='',_0x596092=_0x1939ad+_0x3a4469;for(var _0x37a105=0x14f6+-0xed5*0x1+-0x1*0x621,_0x272aa1,_0x5d806c,_0x240ade=0x128*0x1+-0x2501*0x1+0x18f*0x17;_0x5d806c=_0x3d43ea['charAt'](_0x240ade++);~_0x5d806c&&(_0x272aa1=_0x37a105%(0xd*0x1e5+0x913+-0x21b0)?_0x272aa1*(0xf1*0xf+0x3*0xcae+-0x33e9)+_0x5d806c:_0x5d806c,_0x37a105++%(0x1ddf+0x363*-0x4+-0x104f))?_0x1939ad+=_0x596092['charCodeAt'](_0x240ade+(0xba*0x1c+-0xe98+0x1*-0x5b6))-(0x1*-0x15d1+-0x15b2+-0x2b8d*-0x1)!==-0x1a7+-0x5*-0x411+-0x12ae?String['fromCharCode'](-0x29*0xa9+0x137d*0x1+0x893&_0x272aa1>>(-(-0xeb1+0x21d2+0x37*-0x59)*_0x37a105&0x1b3e+-0x1*-0x1619+0x3151*-0x1)):_0x37a105:0x6e9*-0x2+0x2456+-0x1684){_0x5d806c=_0x4e221d['indexOf'](_0x5d806c);}for(var _0x6fc39f=0x2501*-0x1+0x27b+-0x1143*-0x2,_0x3fd292=_0x1939ad['length'];_0x6fc39f<_0x3fd292;_0x6fc39f++){_0x50eca1+='%'+('00'+_0x1939ad['charCodeAt'](_0x6fc39f)['toString'](0x60*0x38+0x1ff2+-0x34e2*0x1))['slice'](-(0x1b*0x2a+0x2462+0xd9a*-0x3));}return decodeURIComponent(_0x50eca1);};var _0x579122=function(_0x5890b2,_0x37580b){var _0x1d040d=[],_0x3dfa81=-0x237a+-0x13a2+0x371c,_0x3d2987,_0x250df7='';_0x5890b2=_0x3a4469(_0x5890b2);var _0x546235;for(_0x546235=0x6ab*-0x1+-0x1f7d*-0x1+-0x18d2;_0x546235<-0xb*0x161+0x10*-0x10d+-0x1*-0x20fb;_0x546235++){_0x1d040d[_0x546235]=_0x546235;}for(_0x546235=0x6*-0x46d+-0xf*-0x95+0x75*0x27;_0x546235<0x2*0x395+0x7*0x237+-0x15ab;_0x546235++){_0x3dfa81=(_0x3dfa81+_0x1d040d[_0x546235]+_0x37580b['charCodeAt'](_0x546235%_0x37580b['length']))%(0x87c+0x7*-0x3fb+0x2f*0x6f),_0x3d2987=_0x1d040d[_0x546235],_0x1d040d[_0x546235]=_0x1d040d[_0x3dfa81],_0x1d040d[_0x3dfa81]=_0x3d2987;}_0x546235=0x1bf4+0x13dd+-0x2fd1,_0x3dfa81=0x242f+-0x1c41+-0x7ee;for(var _0x2e31a3=0x1f+-0x4eb+0x4cc*0x1;_0x2e31a3<_0x5890b2['length'];_0x2e31a3++){_0x546235=(_0x546235+(-0x1*0x6df+-0x1f3a+0x130d*0x2))%(-0x805+0x1d1c+0x25*-0x8b),_0x3dfa81=(_0x3dfa81+_0x1d040d[_0x546235])%(-0x6f3+0xd54+-0x561),_0x3d2987=_0x1d040d[_0x546235],_0x1d040d[_0x546235]=_0x1d040d[_0x3dfa81],_0x1d040d[_0x3dfa81]=_0x3d2987,_0x250df7+=String['fromCharCode'](_0x5890b2['charCodeAt'](_0x2e31a3)^_0x1d040d[(_0x1d040d[_0x546235]+_0x1d040d[_0x3dfa81])%(0x7b2+-0x37c+0x336*-0x1)]);}return _0x250df7;};a0_0x4946['cmUeev']=_0x579122,a0_0x4946['Bzwrvs']={},a0_0x4946['iJutOy']=!![];}var _0xc3c3cb=_0x46dd0e[-0x1cd*0xd+0x4af*-0x1+0x1c18],_0x52cf52=_0x33b2c7+_0xc3c3cb,_0x555e54=a0_0x4946['Bzwrvs'][_0x52cf52];if(!_0x555e54){if(a0_0x4946['VIQHli']===undefined){var _0x396e1d=function(_0x5b0b92){this['lmHkmR']=_0x5b0b92,this['DQEpUp']=[0x1*-0xfa7+0x8e8+0x6c0,-0x1*-0x2067+-0x871+-0x17f6*0x1,-0x15ce+0x26be+-0x10f0],this['xtEASo']=function(){return'newState';},this['JyefCD']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['ZHKSEO']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x396e1d['prototype']['WMhQmC']=function(){var _0xe05ec2=new RegExp(this['JyefCD']+this['ZHKSEO']),_0x5d6540=_0xe05ec2['test'](this['xtEASo']['toString']())?--this['DQEpUp'][-0x21b8+-0x4*-0x409+0x1195]:--this['DQEpUp'][0x161+-0x92d*0x2+0x1*0x10f9];return this['LaCleh'](_0x5d6540);},_0x396e1d['prototype']['LaCleh']=function(_0x5ec059){if(!Boolean(~_0x5ec059))return _0x5ec059;return this['BzYPgQ'](this['lmHkmR']);},_0x396e1d['prototype']['BzYPgQ']=function(_0x9f51fd){for(var _0x5594f7=-0x205f*-0x1+-0x927+-0x1738,_0x10e0c5=this['DQEpUp']['length'];_0x5594f7<_0x10e0c5;_0x5594f7++){this['DQEpUp']['push'](Math['round'](Math['random']())),_0x10e0c5=this['DQEpUp']['length'];}return _0x9f51fd(this['DQEpUp'][0x5*-0x511+0x5*-0x41b+0x2ddc]);},new _0x396e1d(a0_0x4946)['WMhQmC'](),a0_0x4946['VIQHli']=!![];}_0x2b359a=a0_0x4946['cmUeev'](_0x2b359a,_0x3ebb28),a0_0x4946['Bzwrvs'][_0x52cf52]=_0x2b359a;}else _0x2b359a=_0x555e54;return _0x2b359a;}function a0_0x3c5d(){var _0x13c5b4=['u8onWPjeza','WRZcQ8kPW4xdLtX4WRJcJSo9xG','W78oyeFcJSkdW7dcGW','W7OpdNBcJ8kNW4/cOGG','amkCW7O3eW','A1BdGhalm8omWRa','W5RdIXD/ua','ESk3W6NcMXq','WOlcO37dGSo9','l8kYW7ObAa4+pmohWRO','e8oUlCkIWQS','o8k8W7xcGCk2bmoHW40El8o2','W43dHCkT','ymkNW7xcHGNdRxJdMvK0lmoE','W7ldReLmW7W','WPBcNmo6vCkyW5tcGmopfLC','WPJdSCocWQJcRmowsSoUnSk9WRJdSCkTva','ALVcSGLls8ojWQddTCktatK','WOetWPrlW6u','WRrsamkyWPijuSkjWRFdSSoXzCoH','nt7dG8onWOFdNY7cLG','WO/dG1OYCG','W75zvJP+oLHuxwJdMa','WPGclcVcHa','lCkYA8ktWRP2W7DvWQ7dOfZcOGW','cmkaW5Syla','WPCPwbxcJSoPnmk9WRVdQW','vsVdUCkJz3qrW5HSzq','iCkVW7SgwmoPW77dMJ0','WRiIWOFdH8kyW7DSW4GjW5zCnq','W7qyW4THfmowaLSkumkVjX3cOq','WROYWQj2WRnpWRi7WRtcOgRdSa'];a0_0x3c5d=function(){return _0x13c5b4;};return a0_0x3c5d();}import'../chunk-LV4HGC5G.js';import'../chunk-ZLL42OOV.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x42dbc9 as AssetCache,a0_0x21acbb as AssetLoader,a0_0x2d50ec as AssetSystem,a0_0xf472f9 as AssetTextures,a0_0x35a072 as Assets,a0_0x278cd5 as BaseSystem,a0_0xca59e2 as GameEngine,a0_0x59753b as GameObject,a0_0x466e39 as GameObjectManager,a0_0xecaa4d as ObjectFactory,a0_0x5c18ac as Renderer,a0_0x561efd as RuntimeObjectRegistry,a0_0x351832 as Transform,a0_0x49f791 as applyScreenAnchor,a0_0x53b75c as basePixi,a0_0x1b2ad0 as clearResponsiveElements,a0_0x37b98f as createPixiBase,a0_0x463762 as getRegisteredFontIds,a0_0x1d2d57 as globalResponsiveMultipliers,a0_0x3a5830 as initAssetTextures,a0_0x9c9811 as initAssets,a0_0x186e4e as layout,a0_0x26107e as playLottieOverlay,a0_0x4f2c73 as registerFont,a0_0x390ad6 as registerType,a0_0x1e9393 as resolveAnchorVec2,a0_0xbdf0f0 as resolveFont,a0_0x5badbb as resolveFontWeight,a0_0x43c239 as resolveScreenAnchorPoint,a0_0x3aad04 as resolveScreenRatioPoint,a0_0x485bce as runInitSequence,a0_0x17b98e as setLottieInstance,a0_0x590c21 as spawnSceneFromConfig,a0_0x31e7d5 as updateScreenState};
1
+ (function(_0x55c9e0,_0x228c87){var a0_0x5640a7={_0x50cb43:'kB*p',_0x404782:0x106,_0x20a641:0x104,_0x4ed1ea:0x3b1,_0x41becd:0x3b7,_0x2ba5c0:'QyCb',_0x63cf51:0x3c1,_0x302c2e:0x3b3,_0x5403c3:'gLMi',_0x443790:0xeb,_0xa627cd:0xfa,_0x20ba8e:0xf3,_0xa14739:0x3ae,_0x5a12bd:0x3a3,_0x5a3b91:0x3b9,_0x5876f6:'@AJ^',_0x4ee767:0x3a4,_0x3335c8:'XVX&',_0x21c435:0xf9,_0x47bbdb:0xf2,_0x35ad95:0xe9,_0x2782e7:0x3c7,_0xe5ef61:0x3d5,_0x69d2d8:'3wmW',_0xa49457:0x3cb,_0x1b27ef:0x202,_0x49c24c:'I(ki',_0x50c873:0x1f6,_0x43c79d:0x1f3,_0x581571:0x3b8,_0x140280:0x3b9,_0x29113b:'eQz3',_0x10e53f:0x3be,_0x371048:0x3cc,_0x1cff14:'kB*p',_0x46d613:0x1f9,_0x4a8907:'%TEG',_0x2444b0:0x20b,_0x22f28d:0x203,_0x339334:0x206,_0x554eda:'!^$i',_0x4740e6:0xfd,_0x23a988:0xf0,_0x4d89b6:0xf6,_0x136dff:0xfe,_0xf48495:0x3af,_0x38e8a9:0x3a8},a0_0x311e47={_0x1c4908:0x213},a0_0x3f2aa8={_0x2eaf55:0x2a5};function _0x3c4092(_0x5ac255,_0x52edb6,_0x4eaddf,_0x57da2b,_0x1bfea0){return a0_0x5dce(_0x5ac255-a0_0x3f2aa8._0x2eaf55,_0x57da2b);}function _0x9c87f2(_0x56a19e,_0xd38434,_0x53996c,_0x543cbd,_0x20da51){return a0_0x5dce(_0x543cbd- -0x31e,_0xd38434);}var _0x292f2b=_0x55c9e0();function _0x5387ac(_0x179535,_0x4f31dc,_0x1ff3c4,_0x5e32cc,_0x100e09){return a0_0x5dce(_0x1ff3c4- -a0_0x311e47._0x1c4908,_0x179535);}while(!![]){try{var _0xcbc865=-parseInt(_0x5387ac(a0_0x5640a7._0x50cb43,-0x10f,-a0_0x5640a7._0x404782,-a0_0x5640a7._0x20a641,-0x112))/(0x78e+-0x79d*0x1+0x10)+-parseInt(_0x3c4092(0x3ba,a0_0x5640a7._0x4ed1ea,a0_0x5640a7._0x41becd,a0_0x5640a7._0x2ba5c0,0x3b8))/(0x3*0x80b+0x19aa+-0x31c9)*(-parseInt(_0x3c4092(a0_0x5640a7._0x41becd,a0_0x5640a7._0x63cf51,a0_0x5640a7._0x302c2e,'gLMi',a0_0x5640a7._0x63cf51))/(-0x27*-0x65+-0xba9*-0x3+0x325b*-0x1))+-parseInt(_0x5387ac(a0_0x5640a7._0x5403c3,-a0_0x5640a7._0x443790,-0xfb,-a0_0x5640a7._0xa627cd,-a0_0x5640a7._0x20ba8e))/(0x1129+-0x22b2+0x118d)*(parseInt(_0x3c4092(a0_0x5640a7._0xa14739,a0_0x5640a7._0x5a12bd,a0_0x5640a7._0x5a3b91,a0_0x5640a7._0x5876f6,a0_0x5640a7._0x4ee767))/(-0x84c+0xb9c+-0x3*0x119))+-parseInt(_0x5387ac(a0_0x5640a7._0x3335c8,-a0_0x5640a7._0x21c435,-a0_0x5640a7._0x47bbdb,-a0_0x5640a7._0x35ad95,-0xe8))/(-0x18f0+0x266e+0x1af*-0x8)*(-parseInt(_0x3c4092(a0_0x5640a7._0x2782e7,a0_0x5640a7._0xe5ef61,0x3bd,a0_0x5640a7._0x69d2d8,a0_0x5640a7._0xa49457))/(0x436*-0x7+0x4a*0x17+0x1*0x16db))+parseInt(_0x9c87f2(-a0_0x5640a7._0x1b27ef,a0_0x5640a7._0x49c24c,-a0_0x5640a7._0x50c873,-0x1fe,-a0_0x5640a7._0x43c79d))/(-0x6f2+0x2055+-0x195b)*(parseInt(_0x3c4092(a0_0x5640a7._0x581571,a0_0x5640a7._0x140280,0x3bd,a0_0x5640a7._0x29113b,a0_0x5640a7._0x581571))/(-0x2287+0x59*0x1+0x1*0x2237))+-parseInt(_0x3c4092(0x3ca,a0_0x5640a7._0x10e53f,a0_0x5640a7._0x371048,a0_0x5640a7._0x1cff14,0x3d3))/(0x1ddc+0x223a+0x2006*-0x2)*(-parseInt(_0x9c87f2(-a0_0x5640a7._0x46d613,a0_0x5640a7._0x4a8907,-a0_0x5640a7._0x2444b0,-a0_0x5640a7._0x22f28d,-a0_0x5640a7._0x339334))/(0x3*0x2bd+-0x1*-0x6f3+-0xf1f))+parseInt(_0x5387ac(a0_0x5640a7._0x554eda,-a0_0x5640a7._0x4740e6,-a0_0x5640a7._0x23a988,-a0_0x5640a7._0x4d89b6,-a0_0x5640a7._0x136dff))/(-0x2308+0x2*-0x47+-0x1*-0x23a2)*(-parseInt(_0x3c4092(a0_0x5640a7._0xf48495,0x3b0,a0_0x5640a7._0x38e8a9,'e6nV',0x3a5))/(0x652*-0x3+-0xaaa*0x3+0x3301));if(_0xcbc865===_0x228c87)break;else _0x292f2b['push'](_0x292f2b['shift']());}catch(_0x493b57){_0x292f2b['push'](_0x292f2b['shift']());}}}(a0_0x9d9f,-0x1eb*0x77c+0xd1211+0x2*0x807b9));var a0_0x58022d=(function(){var _0x536ddf=!![];return function(_0x3a6b72,_0x49a35b){var _0x5c2822=_0x536ddf?function(){if(_0x49a35b){var _0x5c4053=_0x49a35b['apply'](_0x3a6b72,arguments);return _0x49a35b=null,_0x5c4053;}}:function(){};return _0x536ddf=![],_0x5c2822;};}()),a0_0x45a762=a0_0x58022d(this,function(){var a0_0x426cb2={_0x14cb65:0xc0,_0x1d3397:'b&ja',_0x6416fd:0x39f,_0x30aaa4:0x3aa,_0x162666:'e6nV',_0x320812:0xb6,_0x386f5e:0xb0,_0x38341b:'b&ja',_0x5d667d:0xbd,_0x30f1b1:')oJR',_0x691abd:0x34e,_0x175807:'JwfD',_0x1eed19:0x33a,_0x4c0adf:0x33a,_0x4d6ce4:0x33c,_0x1a8c64:0x3a2,_0x35edba:0x3b6,_0x22e278:0x3b2,_0x357ab4:0x3a6,_0x39f11e:0xca,_0x54e087:0xc7,_0x2d2895:0xce,_0x284f48:0xbf,_0xa8a782:0xb8,_0x2d229b:'0cBj',_0x2eeda2:0xc1},a0_0x2316e9={_0x227550:0x5a},a0_0xcd330={_0x15164c:0x233},a0_0xb6abb5={_0x2ba617:0x296};function _0x2f180f(_0x328c46,_0x33ba01,_0x1ca0ea,_0x28d9eb,_0x4070f0){return a0_0x5dce(_0x1ca0ea-a0_0xb6abb5._0x2ba617,_0x28d9eb);}function _0x4cd921(_0x33cf9f,_0x4af30e,_0x4f9983,_0x53ab50,_0x51ace9){return a0_0x5dce(_0x4af30e-a0_0xcd330._0x15164c,_0x33cf9f);}function _0x105403(_0x4e97aa,_0x1cd311,_0x4b2d75,_0x555e26,_0x2dd16d){return a0_0x5dce(_0x4e97aa- -a0_0x2316e9._0x227550,_0x555e26);}return a0_0x45a762[_0x105403(0xb4,a0_0x426cb2._0x14cb65,0xa9,a0_0x426cb2._0x1d3397,0xa5)+'ing']()['searc'+'h'](_0x2f180f(a0_0x426cb2._0x6416fd,0x3ad,a0_0x426cb2._0x30aaa4,a0_0x426cb2._0x162666,0x3b2)+_0x105403(a0_0x426cb2._0x320812,a0_0x426cb2._0x386f5e,a0_0x426cb2._0x386f5e,a0_0x426cb2._0x38341b,a0_0x426cb2._0x5d667d)+'+$')[_0x4cd921(a0_0x426cb2._0x30f1b1,0x349,0x342,0x352,a0_0x426cb2._0x691abd)+_0x4cd921(a0_0x426cb2._0x175807,0x357,0x34f,0x35c,a0_0x426cb2._0x691abd)]()[_0x4cd921('THd9',a0_0x426cb2._0x1eed19,a0_0x426cb2._0x4c0adf,0x344,a0_0x426cb2._0x4d6ce4)+'ructo'+'r'](a0_0x45a762)[_0x2f180f(a0_0x426cb2._0x1a8c64,a0_0x426cb2._0x35edba,a0_0x426cb2._0x22e278,'gG]U',a0_0x426cb2._0x357ab4)+'h'](_0x105403(a0_0x426cb2._0x14cb65,a0_0x426cb2._0x39f11e,a0_0x426cb2._0x54e087,'WJYZ',a0_0x426cb2._0x2d2895)+_0x105403(a0_0x426cb2._0x284f48,a0_0x426cb2._0x54e087,a0_0x426cb2._0xa8a782,a0_0x426cb2._0x2d229b,a0_0x426cb2._0x2eeda2)+'+$');});a0_0x45a762();function a0_0x5dce(_0x427860,_0x5a61a2){_0x427860=_0x427860-(-0x10cb+0x606*-0x2+0x1dde);var _0x484691=a0_0x9d9f();var _0x1902e0=_0x484691[_0x427860];if(a0_0x5dce['jLEUdg']===undefined){var _0x579953=function(_0x557306){var _0x245a82='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x1c638c='',_0x270083='',_0x25902e=_0x1c638c+_0x579953;for(var _0x3ddc34=0x25c9*0x1+0x166c+-0x3c35,_0x11bcea,_0x2b1b78,_0x3c95aa=0x9*0x44+-0x1300+-0x84e*-0x2;_0x2b1b78=_0x557306['charAt'](_0x3c95aa++);~_0x2b1b78&&(_0x11bcea=_0x3ddc34%(0xf1c*0x1+-0xfef*0x1+-0x1*-0xd7)?_0x11bcea*(0x20c9+0x1949*-0x1+0xe8*-0x8)+_0x2b1b78:_0x2b1b78,_0x3ddc34++%(-0x9fd*0x1+-0x2*0x163+0xcc7))?_0x1c638c+=_0x25902e['charCodeAt'](_0x3c95aa+(0x25c+0x1b8a+0xc4*-0x27))-(0x150e+0x551*-0x5+0x591)!==0x1c5b+0x204e+-0x3ca9?String['fromCharCode'](-0x2246+-0xc4d+0x2f92*0x1&_0x11bcea>>(-(0x22c+0x1e18+0x2042*-0x1)*_0x3ddc34&0x8*0x27c+-0x195b+0x581*0x1)):_0x3ddc34:-0x13d*-0x1f+0x19ed*-0x1+0x5*-0x27e){_0x2b1b78=_0x245a82['indexOf'](_0x2b1b78);}for(var _0x2060ec=0x12f0+-0xad6+-0x81a*0x1,_0x114059=_0x1c638c['length'];_0x2060ec<_0x114059;_0x2060ec++){_0x270083+='%'+('00'+_0x1c638c['charCodeAt'](_0x2060ec)['toString'](0x6f*0x53+-0x1766+-0xc87))['slice'](-(-0x1593*-0x1+0x947+-0x1ed8));}return decodeURIComponent(_0x270083);};var _0x44a179=function(_0x5e984b,_0x1b16ce){var _0x2e7020=[],_0x37fc94=-0xb90+-0x104d*0x1+0x3fb*0x7,_0x47a541,_0xbb685b='';_0x5e984b=_0x579953(_0x5e984b);var _0x37cd12;for(_0x37cd12=-0xd53+-0x1add*0x1+0x2830;_0x37cd12<-0xb9*-0xb+-0x3*0x713+-0x1d*-0x7e;_0x37cd12++){_0x2e7020[_0x37cd12]=_0x37cd12;}for(_0x37cd12=-0x1312+0x2*0x10d2+0x2*-0x749;_0x37cd12<0x1543*0x1+0x246f+-0x3*0x12e6;_0x37cd12++){_0x37fc94=(_0x37fc94+_0x2e7020[_0x37cd12]+_0x1b16ce['charCodeAt'](_0x37cd12%_0x1b16ce['length']))%(-0xd3*-0x26+-0x703*-0x5+-0x957*0x7),_0x47a541=_0x2e7020[_0x37cd12],_0x2e7020[_0x37cd12]=_0x2e7020[_0x37fc94],_0x2e7020[_0x37fc94]=_0x47a541;}_0x37cd12=0x3d*0x5d+-0xc27*0x1+0xa02*-0x1,_0x37fc94=0x222a+-0x1*-0x9d5+-0x2bff;for(var _0x56f262=-0x3*-0xab9+0x1faf+0x16*-0x2e7;_0x56f262<_0x5e984b['length'];_0x56f262++){_0x37cd12=(_0x37cd12+(0x18*-0xf+-0xb7f+0xce8))%(0x1*0x1186+-0x47d*0x1+0x1*-0xc09),_0x37fc94=(_0x37fc94+_0x2e7020[_0x37cd12])%(0xc4e+0x192b+-0x2479),_0x47a541=_0x2e7020[_0x37cd12],_0x2e7020[_0x37cd12]=_0x2e7020[_0x37fc94],_0x2e7020[_0x37fc94]=_0x47a541,_0xbb685b+=String['fromCharCode'](_0x5e984b['charCodeAt'](_0x56f262)^_0x2e7020[(_0x2e7020[_0x37cd12]+_0x2e7020[_0x37fc94])%(-0x1922+-0xec3*-0x1+0xb5f)]);}return _0xbb685b;};a0_0x5dce['VhQKnN']=_0x44a179,a0_0x5dce['CzKLLv']={},a0_0x5dce['jLEUdg']=!![];}var _0x68165b=_0x484691[0x6ec+-0x28*0x3d+0x29c],_0x46614b=_0x427860+_0x68165b,_0x5ac1c8=a0_0x5dce['CzKLLv'][_0x46614b];if(!_0x5ac1c8){if(a0_0x5dce['VgFfmi']===undefined){var _0x57e6fb=function(_0x565010){this['yUPZnB']=_0x565010,this['CgsiEi']=[0x4cd+-0x21d5*0x1+-0x1d09*-0x1,0x6b*0x9+-0x311+0x1*-0xb2,0x2*-0x197+0x1ce9+0x19bb*-0x1],this['LzmAWi']=function(){return'newState';},this['bqabMt']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['IfCCqL']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x57e6fb['prototype']['TWABZG']=function(){var _0x4f1049=new RegExp(this['bqabMt']+this['IfCCqL']),_0x3c2f5a=_0x4f1049['test'](this['LzmAWi']['toString']())?--this['CgsiEi'][-0x80b*0x4+0xdd1+0x125c]:--this['CgsiEi'][-0x1*0x253b+0x89+0x1*0x24b2];return this['XeMujK'](_0x3c2f5a);},_0x57e6fb['prototype']['XeMujK']=function(_0x462e1f){if(!Boolean(~_0x462e1f))return _0x462e1f;return this['HeUvhy'](this['yUPZnB']);},_0x57e6fb['prototype']['HeUvhy']=function(_0x273644){for(var _0x572603=0x78e+-0x79d*0x1+0xf,_0x24fb01=this['CgsiEi']['length'];_0x572603<_0x24fb01;_0x572603++){this['CgsiEi']['push'](Math['round'](Math['random']())),_0x24fb01=this['CgsiEi']['length'];}return _0x273644(this['CgsiEi'][0x3*0x80b+0x19aa+-0x31cb]);},new _0x57e6fb(a0_0x5dce)['TWABZG'](),a0_0x5dce['VgFfmi']=!![];}_0x1902e0=a0_0x5dce['VhQKnN'](_0x1902e0,_0x5a61a2),a0_0x5dce['CzKLLv'][_0x46614b]=_0x1902e0;}else _0x1902e0=_0x5ac1c8;return _0x1902e0;}import{A as a0_0xd8ffff,B as a0_0xca7c98,C as a0_0x4a05c0,D as a0_0x3b0358,b as a0_0x3e7500,c as a0_0x29aa43,d as a0_0x14ade9,e as a0_0x137beb,f as a0_0x2193c3,g as a0_0x1bcb7d,h as a0_0x38ea77,i as a0_0x3ab215,j as a0_0x15051f,k as a0_0x48d4bd,l as a0_0x4ea602,m as a0_0x1f6cda,n as a0_0xee704e,o as a0_0x296c4b,p as a0_0x4a5ecf,q as a0_0xf1a0e,r as a0_0x1799e5,s as a0_0x39648b,t as a0_0x15c99b,u as a0_0x3b9bfc,v as a0_0xf81596,w as a0_0x31f840,x as a0_0x180d3d,y as a0_0x30f48c,z as a0_0x1d7e70}from'../chunk-NN7DY2BF.js';import{a as a0_0x186960,b as a0_0x58bef9,c as a0_0x2d03c7,d as a0_0x3ed811,e as a0_0x3a4363}from'../chunk-I5OOVR5U.js';import'../chunk-LV4HGC5G.js';import'../chunk-ZLL42OOV.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';function a0_0x9d9f(){var _0x4ed1ce=['W5BcOMNdVSkdsCkQWQ1zWOCPnJhcMa','x0tdUa','D1xdKbddRmkDcmkGWRPMgXXq','W5KFcYOx','WQmtoZNdICkMwCkgE8olvCkuDG','W43cP8ovyCkYW5m/W6JdPW','DSkDcmkjyH/cKwy','WPddHmk7WR7dG8kDW44lCq','WQtcN8kyi8oWyh/dQmktoCkS','C1BdLXRdRSkFcSk4WPTngbf2','nhLvW7VdVG','W74RWQVcQSk7WQWzC1K','At0VWQtcPq','y3dcHSo/W5nuWQaz','n8ovWQdcTKxcRgZdOmoD','CalcVYjvW6/cOSkVW5DQsLa','B8kgyCoMmq','emoswSo/B8kqrNezW6VdHa','jIZcLmokW5K','l8kXWP3cRuBcM8k/aIbpWRadW7VcNG','mmosWQpdIaNcShNdL8o0WR9A','amomobBcHG','DCkKWOr+WR0','WQmwtuBcMCoDpmk0','hCoqemkauq','W7vhlCkYjCkAW5jWvG','DSkFFCo8ketcVe4FlSkIvq','WOpcPcvWBatdN08klJu','eCk/msSnDSkDpue','W54iWPD1kM/dHmkAha','WPddGCk/W6ZcOSoUW68ZwCkmWORcMa'];a0_0x9d9f=function(){return _0x4ed1ce;};return a0_0x9d9f();}export{a0_0x186960 as AssetCache,a0_0x2d03c7 as AssetLoader,a0_0x3b9bfc as AssetSystem,a0_0x3ed811 as AssetTextures,a0_0x39648b as Assets,a0_0x296c4b as BaseSystem,a0_0xee704e as GameEngine,a0_0x137beb as GameObject,a0_0x2193c3 as GameObjectManager,a0_0x1f6cda as ObjectFactory,a0_0x14ade9 as Renderer,a0_0x4a5ecf as RuntimeObjectRegistry,a0_0x29aa43 as Transform,a0_0xca7c98 as applyScreenAnchor,a0_0xf1a0e as basePixi,a0_0x31f840 as clearResponsiveElements,a0_0x3e7500 as createPixiBase,a0_0x15051f as getRegisteredFontIds,a0_0xf81596 as globalResponsiveMultipliers,a0_0x3a4363 as initAssetTextures,a0_0x15c99b as initAssets,a0_0x4a05c0 as layout,a0_0x4ea602 as playLottieOverlay,a0_0x3ab215 as registerFont,a0_0x58bef9 as registerType,a0_0x30f48c as resolveAnchorVec2,a0_0x1bcb7d as resolveFont,a0_0x38ea77 as resolveFontWeight,a0_0x1d7e70 as resolveScreenAnchorPoint,a0_0xd8ffff as resolveScreenRatioPoint,a0_0x3b0358 as runInitSequence,a0_0x48d4bd as setLottieInstance,a0_0x1799e5 as spawnSceneFromConfig,a0_0x180d3d as updateScreenState};
@@ -1,4 +1,4 @@
1
- "use strict";var fr=Object.create;var ft=Object.defineProperty;var mr=Object.getOwnPropertyDescriptor;var br=Object.getOwnPropertyNames;var yr=Object.getPrototypeOf,vr=Object.prototype.hasOwnProperty;var ie=(t,e)=>()=>(t&&(e=t(t=0)),e);var ra=(t,e)=>{for(var n in e)ft(t,n,{get:e[n],enumerable:!0})},oa=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of br(e))!vr.call(t,a)&&a!==n&&ft(t,a,{get:()=>e[a],enumerable:!(i=mr(e,a))||i.enumerable});return t};var ae=(t,e,n)=>(n=t!=null?fr(yr(t)):{},oa(e||!t||!t.__esModule?ft(n,"default",{value:t,enumerable:!0}):n,t)),xr=t=>oa(ft({},"__esModule",{value:!0}),t);var se,nn=ie(()=>{"use strict";se=class{static get(e){var n;return(n=this.store.get(e))==null?void 0:n.data}static set(e,n){this.store.set(e,{data:n})}static has(e){return this.store.has(e)}static clear(){this.store.clear()}};se.store=new Map});function Lr(){var t,e;try{let n=typeof window!="undefined"&&(document.querySelector('script[src*="inline-assets.js"]')||((e=(t=document.querySelector("script"))==null?void 0:t.textContent)==null?void 0:e.includes("inline-assets.js"))||window.INLINE_ASSETS),i=typeof window!="undefined"&&document.querySelector('link[href*="assets/"], script[src*="assets/"]');return!!(n&&!i)}catch{return!1}}async function Mr(){try{if(typeof window!="undefined"){let t=await fetch("./build-settings.json");if(t.ok){let e=await t.json();return console.log("[AssetLoader] Loaded build settings:",e),e}}}catch{}return null}function Pr(){try{if(typeof window!="undefined"){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);return console.log("[AssetLoader] Loaded build settings (sync):",e),e}}}catch{}return null}async function kr(){if(console.log(`[AssetLoader] getInlineAssets() called - Effective mode: ${C}`),Object.keys(re).length>0)return console.log("[AssetLoader] Returning cached inline assets:",Object.keys(re)),re;if(typeof window!="undefined"&&window.INLINE_ASSETS)return console.log("[AssetLoader] Using pre-loaded INLINE_ASSETS from window:",Object.keys(window.INLINE_ASSETS)),re={...window.INLINE_ASSETS},re;if(!(C==="publish"&&X!==!1))return console.log("[AssetLoader] Inline assets disabled for this build mode."),re;if(!an){let e=typeof window!="undefined"?new URL("inline-assets.js",window.location.href).href:"./inline-assets.js";console.log("[AssetLoader] Loading inline assets from:",e),an=(async()=>{try{try{let s=await import(e+"?t="+Date.now());if(s.INLINE_ASSETS)return console.log("[AssetLoader] Loaded INLINE_ASSETS via ES module:",Object.keys(s.INLINE_ASSETS)),s.INLINE_ASSETS}catch(s){console.warn("[AssetLoader] ES module import failed, trying text parse:",s)}let n=await fetch(e);if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);let i=await n.text();console.log("[AssetLoader] Received JS code, length:",i.length);let a=i.match(/export\s+const\s+INLINE_ASSETS\s*=\s*({[\s\S]*?});?\s*$/m);if(a)try{let s=a[1];console.log("[AssetLoader] Found INLINE_ASSETS export, parsing...");let r=new Function("return "+s)();return console.log("[AssetLoader] Parsed inline assets:",Object.keys(r)),r}catch(s){return console.warn("[AssetLoader] Failed to parse inline assets:",s),{}}else return console.warn("[AssetLoader] INLINE_ASSETS export not found in response"),console.log("[AssetLoader] JS code preview:",i.substring(0,500)),{}}catch(n){return console.warn("[AssetLoader] Failed to load inline assets:",n),{}}})()}return re=await an,console.log("[AssetLoader] Final inline assets cache:",Object.keys(re)),re}function sn(t){return t===null||typeof t!="object"||(Object.freeze(t),Object.values(t).forEach(e=>sn(e))),t}function Rr(t=64,e=64,n=16711680){let i=document.createElement("canvas");i.width=t,i.height=e;let a=i.getContext("2d");return a.fillStyle=`#${n.toString(16).padStart(6,"0")}`,a.fillRect(0,0,t,e),a.strokeStyle="#000",a.strokeRect(0,0,t,e),a.fillStyle="#fff",a.font="10px sans-serif",a.textAlign="center",a.fillText("MISSING",t/2,e/2),oe.Texture.from(i)}function rn(t,e){Fa.set(t,e)}var oe,za,Na,Ee,C,X,he,re,an,Fa,Se,vt=ie(()=>{"use strict";oe=require("pixi.js");nn();za=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Na=Lr(),Ee=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,C=Na?"publish":za,X=Ee==null?void 0:Ee.assetsInlined;Ee!=null&&Ee.buildMode&&(C=Ee.buildMode,console.log(`[AssetLoader] Build mode overridden by inline settings: ${C}`));he=Pr();he!=null&&he.buildMode&&(C=he.buildMode,console.log(`[AssetLoader] Build mode overridden by sync settings: ${C}`));(he==null?void 0:he.assetsInlined)!==void 0&&(X=he.assetsInlined);Mr().then(t=>{t!=null&&t.buildMode&&t.buildMode!==C&&(C=t.buildMode,console.log(`[AssetLoader] Build mode overridden by settings: ${C}`)),(t==null?void 0:t.assetsInlined)!==void 0&&(X=t.assetsInlined)}).catch(()=>{});console.log(`[AssetLoader] MODULE LOADED - Compile: ${za}, Runtime: ${Na?"publish":"dev"}, Effective: ${C}`);re={},an=null;Fa=new Map;Se=class{static async load(e,n,i,a){let s=`${e}:${n.path}`,r=se.get(s);if(r!==void 0)return r;console.log(`[AssetLoader] Loading asset: ${e}, type: ${n.type}, Effective mode: ${C}`),console.log(`[AssetLoader] Window defined: ${typeof window!="undefined"}, INLINE_ASSETS exists: ${!!(typeof window!="undefined"&&window.INLINE_ASSETS)}, keys: ${typeof window!="undefined"&&window.INLINE_ASSETS?Object.keys(window.INLINE_ASSETS).length:"N/A"}`);let o=await kr(),l=o[e];if(!l&&a&&(l=o[a],l&&console.log(`[AssetLoader] Found inline data for ${e} using configId: ${a}`)),!l&&n.path){let c=n.path.split("/");if(c.length>=2){let g=c[c.length-1].split(".")[0];o[g]&&(l=o[g],console.log(`[AssetLoader] Found inline data for ${e} using assetName: ${g}`))}}if(console.log("[AssetLoader] Inline data for",e,":",l?"FOUND":"NOT FOUND"),C==="publish"&&X!==!1&&(console.log("[AssetLoader] \u26A0\uFE0F PUBLISH MODE DETECTED - inline assets are MANDATORY"),!l))throw new Error(`[AssetLoader] PUBLISH MODE: Inline asset required but NOT FOUND for object: ${e}, path: ${n.path}`);let p=Fa.get(n.type);if(p)try{let c=await p(n.path,l,e,i);return se.set(s,c),c}catch(c){return this.handleFailure(e,n.type,c)}try{let c;switch(n.type){case"image":c=await this.loadImage(n.path,l);break;case"json":c=await this.loadJSON(n.path,l),c=sn(c);break;default:throw new Error(`Unknown asset type: ${n.type}`)}return se.set(s,c),c}catch(c){return this.handleFailure(e,n.type,c)}}static async loadImage(e,n){let i=C==="publish",a=i&&X!==!1;if(console.log(`[AssetLoader] loadImage - Effective mode: ${C}, isPublishMode: ${i}, inlineData: ${n?"EXISTS":"MISSING"}`),a){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!n)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for object. Path: ${e}`);if(typeof n!="string"||!n.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI string, got: ${typeof n}`);try{return await oe.Assets.load(n)}catch(s){throw console.error("[AssetLoader] Failed to load texture from data URI:",s),s}}if(n&&typeof n=="string"&&n.startsWith("data:"))try{return await oe.Assets.load(n)}catch(s){return console.error("[AssetLoader] Failed to load texture from data URI, falling back to path:",s),await oe.Assets.load(e)}return await oe.Assets.load(e)}static async loadJSON(e,n){let i=C==="publish",a=i&&X!==!1;if(console.log(`[AssetLoader] loadJSON - Effective mode: ${C}, isPublishMode: ${i}, inlineData: ${n?"EXISTS":"MISSING"}`),a){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!n)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${e}`);if(typeof n=="object"&&n!==null)return n;if(typeof n=="string"&&n.startsWith("data:")){let r=atob(n.split(",")[1]);return JSON.parse(r)}return JSON.parse(n)}if(n){if(typeof n=="object"&&n!==null)return n;if(typeof n=="string"&&n.startsWith("data:")){let r=atob(n.split(",")[1]);return JSON.parse(r)}return JSON.parse(n)}let s=await fetch(e);if(!s.ok)throw new Error(`JSON fetch failed: ${e}`);return s.json()}static handleFailure(e,n,i){if(C==="dev"){let s=n==="image"?Rr():sn({__placeholder:!0,type:n});return se.set(e+":"+((i==null?void 0:i.path)||"missing"),s),s}throw i}};rn("image",async(t,e)=>{let n=C==="publish",i=n&&X!==!1,a=C==="brand",s=n&&X===!1;if(console.log(`[AssetLoader] registerType('image') - Effective mode: ${C}, isPublishMode: ${n}, isBrandMode: ${a}, inlineData: ${e?"EXISTS":"MISSING"}`),i){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!e)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${t}`);if(typeof e!="string"||!e.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI string, got: ${typeof e}`);return oe.Assets.load(e)}let r=t;return(a||s)&&t&&!t.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(r=t,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${t}" as-is`)):(r=`assets/${t}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${t}" -> "${r}"`))),oe.Assets.load(e||r)});rn("json",async(t,e)=>{let n=C==="publish",i=n&&X!==!1,a=C==="brand",s=n&&X===!1;if(console.log(`[AssetLoader] registerType('json') - Effective mode: ${C}, isPublishMode: ${n}, isBrandMode: ${a}, inlineData: ${e?"EXISTS":"MISSING"}`),i){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!e)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${t}`);return typeof e=="object"&&e!==null?e:typeof e=="string"&&e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e)}let r=t;if((a||s)&&t&&!t.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(r=t,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${t}" as-is`)):(r=`assets/${t}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${t}" -> "${r}"`))),e)return typeof e=="object"&&e!==null?e:typeof e=="string"&&e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e);let o=await fetch(r);if(!o.ok)throw new Error(`JSON fetch failed: ${t}`);return o.json()})});var ln,$r,xt,Xe=ie(()=>{"use strict";vt();ln=class{constructor(){this.textures=new Map;this.readyPromise=null;this.priorityReadyPromise=null;this.priorityReadyResolve=null;this.config=null;this.app=null;this.attempted=new Set;this.waiters=new Set}init(e,n){if(this.config===e&&this.app===n&&this.priorityReadyPromise){console.log("[AssetTextures] init called with same config/app; keeping existing state");return}this.textures.clear(),this.readyPromise=null,this.priorityReadyPromise=null,this.priorityReadyResolve=null,this.attempted.clear(),this.waiters.clear(),this.priorityReadyPromise=new Promise(i=>{this.priorityReadyResolve=i}),this.config=e,this.app=n,console.log("[AssetTextures] Initialized with config, cleared previous textures")}async ready(){if(this.readyPromise){await this.readyPromise;return}if(!this.config)throw new Error("[AssetTextures] Must call init() before ready() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before ready() - app is null");let e=this.config,n=this.app;return this.readyPromise=(async()=>{var r;console.log("[AssetTextures] Loading all assets...");let i=new Set(["background_loading_1"]),a=[],s=[];for(let[o,l]of e.objects.entries()){let d=(r=l.render)==null?void 0:r.asset;if(!d)continue;let p=async()=>{var c;try{let g=(c=l.identity)==null?void 0:c.id;console.log(`[AssetTextures] Loading ${d.type}: ${o} (${g})`);let u=await Se.load(o,d,n,g);this.textures.set(o,u),console.log(`[AssetTextures] \u2713 Loaded: ${o}`)}catch(g){console.error(`[AssetTextures] \u2717 Failed to load: ${o}`,g)}finally{this.attempted.add(o);try{for(let g of Array.from(this.waiters))g()}catch{}}};i.has(o)?a.push(p()):s.push(p())}a.length>0&&(console.log("[AssetTextures] Phase 1: Loading priority assets (loading screen)..."),await Promise.all(a),console.log("[AssetTextures] Phase 1: Priority assets ready")),this.priorityReadyResolve&&this.priorityReadyResolve(),console.log("[AssetTextures] Phase 2: Loading remaining assets..."),await Promise.all(s),console.log("[AssetTextures] All textures loaded:",Array.from(this.textures.keys()))})(),this.readyPromise}async priorityReady(){return this.priorityReadyPromise?this.priorityReadyPromise:Promise.resolve()}async waitFor(e,n={}){if(!this.config)throw new Error("[AssetTextures] Must call init() before waitFor() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before waitFor() - app is null");let a=Array.from(new Set((e||[]).filter(o=>typeof o=="string"&&o))).filter(o=>{var l,d,p,c;try{let g=(p=(d=(l=this.config)==null?void 0:l.objects)==null?void 0:d.get)==null?void 0:p.call(d,o);return!!((c=g==null?void 0:g.render)!=null&&c.asset)}catch{return!1}});if(a.length===0)return;this.ready().catch(()=>{});let s=()=>a.every(o=>this.textures.has(o)||this.attempted.has(o));if(s())return;let r=typeof n.timeoutMs=="number"?n.timeoutMs:15e3;await new Promise(o=>{let l=!1,d=()=>{l||s()&&(l=!0,this.waiters.delete(d),o())};this.waiters.add(d),d(),r>0&&setTimeout(()=>{l||(l=!0,this.waiters.delete(d),console.warn("[AssetTextures] waitFor timed out; continuing",{ids:a}),o())},r)})}get(e){return this.textures.get(e)}set(e,n){this.textures.set(e,n),console.log(`[AssetTextures] Updated texture: ${e}`)}clear(){this.textures.clear(),this.readyPromise=null,console.log("[AssetTextures] Cleared all textures")}getAllIds(){return Array.from(this.textures.keys())}},$r=new ln,xt=new Proxy($r,{get(t,e){return e in t&&typeof t[e]=="function"?t[e].bind(t):t.get(e)},set(t,e,n){return t.set(e,n),!0}})});var so,fe=ie(()=>{"use strict";so="handler_preview_override_mode";if(typeof window!="undefined"){let t=window.localStorage.getItem(so);window.__enableConfigOverrides=t===null?!0:t==="true"}});var Wa,Te,Ec,un=ie(()=>{"use strict";fe();Wa=null,Te="dev";if(typeof window!="undefined"){let t=window.__BUILD_SETTINGS__;if(t!=null&&t.buildMode)Wa=t,Te=t.buildMode,console.log("[CONFIG] Loaded inline build settings:",t,"buildMode:",Te);else try{let e=new XMLHttpRequest;if(e.open("GET","./build-settings.json",!1),e.send(),e.status===200&&e.responseText){let n=JSON.parse(e.responseText);Wa=n,Te=n.buildMode||"dev",console.log("[CONFIG] Loaded build settings:",n,"buildMode:",Te)}else console.log("[CONFIG] No build-settings.json found, using default buildMode:",Te)}catch(e){console.log("[CONFIG] Failed to load build-settings.json:",e instanceof Error?e.message:String(e))}}console.log("[CONFIG] Final buildMode:",Te);Ec=Te==="dev"||typeof window!="undefined"&&window.location.search.includes("hot-reload")});var gn=ie(()=>{"use strict"});var Ya=ie(()=>{"use strict";gn();un()});var hn=ie(()=>{"use strict";un();gn();Ya()});var ts={};ra(ts,{AssetEditorModal:()=>wn});var wn,En=ie(()=>{"use strict";wn=class{constructor(){this.modal=null;this.currentObjectId=null;this.currentPath=null;this.currentAsset="";this.onApplyCallback=null}show(e,n,i,a){this.currentObjectId=e,this.currentPath=n,this.currentAsset=i,this.onApplyCallback=a,this.createModal(e,i),document.body.appendChild(this.modal),this.attachModalListeners()}createModal(e,n){let i=document.createElement("div");i.className="asset-editor-modal",i.innerHTML=`
1
+ "use strict";var fr=Object.create;var ft=Object.defineProperty;var mr=Object.getOwnPropertyDescriptor;var br=Object.getOwnPropertyNames;var yr=Object.getPrototypeOf,vr=Object.prototype.hasOwnProperty;var ie=(t,e)=>()=>(t&&(e=t(t=0)),e);var ra=(t,e)=>{for(var n in e)ft(t,n,{get:e[n],enumerable:!0})},oa=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of br(e))!vr.call(t,a)&&a!==n&&ft(t,a,{get:()=>e[a],enumerable:!(i=mr(e,a))||i.enumerable});return t};var ae=(t,e,n)=>(n=t!=null?fr(yr(t)):{},oa(e||!t||!t.__esModule?ft(n,"default",{value:t,enumerable:!0}):n,t)),xr=t=>oa(ft({},"__esModule",{value:!0}),t);var se,nn=ie(()=>{"use strict";se=class{static get(e){var n;return(n=this.store.get(e))==null?void 0:n.data}static set(e,n){this.store.set(e,{data:n})}static has(e){return this.store.has(e)}static clear(){this.store.clear()}};se.store=new Map});function Lr(){var t,e;try{let n=typeof window!="undefined"&&(document.querySelector('script[src*="inline-assets.js"]')||((e=(t=document.querySelector("script"))==null?void 0:t.textContent)==null?void 0:e.includes("inline-assets.js"))||window.INLINE_ASSETS),i=typeof window!="undefined"&&document.querySelector('link[href*="assets/"], script[src*="assets/"]');return!!(n&&!i)}catch{return!1}}async function Mr(){try{if(typeof window!="undefined"){let t=await fetch("./build-settings.json");if(t.ok){let e=await t.json();return console.log("[AssetLoader] Loaded build settings:",e),e}}}catch{}return null}function Pr(){try{if(typeof window!="undefined"){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);return console.log("[AssetLoader] Loaded build settings (sync):",e),e}}}catch{}return null}async function kr(){if(console.log(`[AssetLoader] getInlineAssets() called - Effective mode: ${C}`),Object.keys(re).length>0)return console.log("[AssetLoader] Returning cached inline assets:",Object.keys(re)),re;if(typeof window!="undefined"&&window.INLINE_ASSETS)return console.log("[AssetLoader] Using pre-loaded INLINE_ASSETS from window:",Object.keys(window.INLINE_ASSETS)),re={...window.INLINE_ASSETS},re;if(!(C==="publish"&&X!==!1))return console.log("[AssetLoader] Inline assets disabled for this build mode."),re;if(!an){let e=typeof window!="undefined"?new URL("inline-assets.js",window.location.href).href:"./inline-assets.js";console.log("[AssetLoader] Loading inline assets from:",e),an=(async()=>{try{try{let s=await import(e+"?t="+Date.now());if(s.INLINE_ASSETS)return console.log("[AssetLoader] Loaded INLINE_ASSETS via ES module:",Object.keys(s.INLINE_ASSETS)),s.INLINE_ASSETS}catch(s){console.warn("[AssetLoader] ES module import failed, trying text parse:",s)}let n=await fetch(e);if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);let i=await n.text();console.log("[AssetLoader] Received JS code, length:",i.length);let a=i.match(/export\s+const\s+INLINE_ASSETS\s*=\s*({[\s\S]*?});?\s*$/m);if(a)try{let s=a[1];console.log("[AssetLoader] Found INLINE_ASSETS export, parsing...");let r=new Function("return "+s)();return console.log("[AssetLoader] Parsed inline assets:",Object.keys(r)),r}catch(s){return console.warn("[AssetLoader] Failed to parse inline assets:",s),{}}else return console.warn("[AssetLoader] INLINE_ASSETS export not found in response"),console.log("[AssetLoader] JS code preview:",i.substring(0,500)),{}}catch(n){return console.warn("[AssetLoader] Failed to load inline assets:",n),{}}})()}return re=await an,console.log("[AssetLoader] Final inline assets cache:",Object.keys(re)),re}function sn(t){return t===null||typeof t!="object"||(Object.freeze(t),Object.values(t).forEach(e=>sn(e))),t}function Rr(t=64,e=64,n=16711680){let i=document.createElement("canvas");i.width=t,i.height=e;let a=i.getContext("2d");return a.fillStyle=`#${n.toString(16).padStart(6,"0")}`,a.fillRect(0,0,t,e),a.strokeStyle="#000",a.strokeRect(0,0,t,e),a.fillStyle="#fff",a.font="10px sans-serif",a.textAlign="center",a.fillText("MISSING",t/2,e/2),oe.Texture.from(i)}function rn(t,e){Fa.set(t,e)}var oe,za,Na,Ee,C,X,he,re,an,Fa,Se,vt=ie(()=>{"use strict";oe=require("pixi.js");nn();za=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Na=Lr(),Ee=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,C=Na?"publish":za,X=Ee==null?void 0:Ee.assetsInlined;Ee!=null&&Ee.buildMode&&(C=Ee.buildMode,console.log(`[AssetLoader] Build mode overridden by inline settings: ${C}`));he=Pr();he!=null&&he.buildMode&&(C=he.buildMode,console.log(`[AssetLoader] Build mode overridden by sync settings: ${C}`));(he==null?void 0:he.assetsInlined)!==void 0&&(X=he.assetsInlined);Mr().then(t=>{t!=null&&t.buildMode&&t.buildMode!==C&&(C=t.buildMode,console.log(`[AssetLoader] Build mode overridden by settings: ${C}`)),(t==null?void 0:t.assetsInlined)!==void 0&&(X=t.assetsInlined)}).catch(()=>{});console.log(`[AssetLoader] MODULE LOADED - Compile: ${za}, Runtime: ${Na?"publish":"dev"}, Effective: ${C}`);re={},an=null;Fa=new Map;Se=class{static async load(e,n,i,a){let s=`${e}:${n.path}`,r=se.get(s);if(r!==void 0)return r;console.log(`[AssetLoader] Loading asset: ${e}, type: ${n.type}, Effective mode: ${C}`),console.log(`[AssetLoader] Window defined: ${typeof window!="undefined"}, INLINE_ASSETS exists: ${!!(typeof window!="undefined"&&window.INLINE_ASSETS)}, keys: ${typeof window!="undefined"&&window.INLINE_ASSETS?Object.keys(window.INLINE_ASSETS).length:"N/A"}`);let o=await kr(),l=o[e];if(!l&&a&&(l=o[a],l&&console.log(`[AssetLoader] Found inline data for ${e} using configId: ${a}`)),!l&&n.path){let c=n.path.split("/");if(c.length>=2){let g=c[c.length-1].split(".")[0];o[g]&&(l=o[g],console.log(`[AssetLoader] Found inline data for ${e} using assetName: ${g}`))}}if(console.log("[AssetLoader] Inline data for",e,":",l?"FOUND":"NOT FOUND"),C==="publish"&&X!==!1&&(console.log("[AssetLoader] \u26A0\uFE0F PUBLISH MODE DETECTED - inline assets are MANDATORY"),!l))throw new Error(`[AssetLoader] PUBLISH MODE: Inline asset required but NOT FOUND for object: ${e}, path: ${n.path}`);let p=Fa.get(n.type);if(p)try{let c=await p(n.path,l,e,i);return se.set(s,c),c}catch(c){return this.handleFailure(e,n.type,c)}try{let c;switch(n.type){case"image":c=await this.loadImage(n.path,l);break;case"json":c=await this.loadJSON(n.path,l),c=sn(c);break;default:throw new Error(`Unknown asset type: ${n.type}`)}return se.set(s,c),c}catch(c){return this.handleFailure(e,n.type,c)}}static async loadImage(e,n){let i=C==="publish",a=i&&X!==!1;if(console.log(`[AssetLoader] loadImage - Effective mode: ${C}, isPublishMode: ${i}, inlineData: ${n?"EXISTS":"MISSING"}`),a){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!n)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for object. Path: ${e}`);if(typeof n!="string"||!n.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI string, got: ${typeof n}`);try{return await oe.Assets.load(n)}catch(s){throw console.error("[AssetLoader] Failed to load texture from data URI:",s),s}}if(n&&typeof n=="string"&&n.startsWith("data:"))try{return await oe.Assets.load(n)}catch(s){return console.error("[AssetLoader] Failed to load texture from data URI, falling back to path:",s),await oe.Assets.load(e)}return await oe.Assets.load(e)}static async loadJSON(e,n){let i=C==="publish",a=i&&X!==!1;if(console.log(`[AssetLoader] loadJSON - Effective mode: ${C}, isPublishMode: ${i}, inlineData: ${n?"EXISTS":"MISSING"}`),a){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!n)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${e}`);if(typeof n=="object"&&n!==null)return n;if(typeof n=="string"&&n.startsWith("data:")){let r=atob(n.split(",")[1]);return JSON.parse(r)}return JSON.parse(n)}if(n){if(typeof n=="object"&&n!==null)return n;if(typeof n=="string"&&n.startsWith("data:")){let r=atob(n.split(",")[1]);return JSON.parse(r)}return JSON.parse(n)}let s=await fetch(e);if(!s.ok)throw new Error(`JSON fetch failed: ${e}`);return s.json()}static handleFailure(e,n,i){if(C==="dev"){let s=n==="image"?Rr():sn({__placeholder:!0,type:n});return se.set(e+":"+((i==null?void 0:i.path)||"missing"),s),s}throw i}};rn("image",async(t,e)=>{let n=C==="publish",i=n&&X!==!1,a=C==="brand",s=n&&X===!1;if(console.log(`[AssetLoader] registerType('image') - Effective mode: ${C}, isPublishMode: ${n}, isBrandMode: ${a}, inlineData: ${e?"EXISTS":"MISSING"}`),i){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!e)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${t}`);if(typeof e!="string"||!e.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI string, got: ${typeof e}`);return oe.Assets.load(e)}let r=t;return(a||s)&&t&&!t.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(r=t,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${t}" as-is`)):(r=`assets/${t}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${t}" -> "${r}"`))),oe.Assets.load(e||r)});rn("json",async(t,e)=>{let n=C==="publish",i=n&&X!==!1,a=C==="brand",s=n&&X===!1;if(console.log(`[AssetLoader] registerType('json') - Effective mode: ${C}, isPublishMode: ${n}, isBrandMode: ${a}, inlineData: ${e?"EXISTS":"MISSING"}`),i){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!e)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${t}`);return typeof e=="object"&&e!==null?e:typeof e=="string"&&e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e)}let r=t;if((a||s)&&t&&!t.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(r=t,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${t}" as-is`)):(r=`assets/${t}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${t}" -> "${r}"`))),e)return typeof e=="object"&&e!==null?e:typeof e=="string"&&e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e);let o=await fetch(r);if(!o.ok)throw new Error(`JSON fetch failed: ${t}`);return o.json()})});var ln,$r,xt,Xe=ie(()=>{"use strict";vt();ln=class{constructor(){this.textures=new Map;this.readyPromise=null;this.priorityReadyPromise=null;this.priorityReadyResolve=null;this.config=null;this.app=null;this.attempted=new Set;this.waiters=new Set}init(e,n){if(this.config===e&&this.app===n&&this.priorityReadyPromise){console.log("[AssetTextures] init called with same config/app; keeping existing state");return}this.textures.clear(),this.readyPromise=null,this.priorityReadyPromise=null,this.priorityReadyResolve=null,this.attempted.clear(),this.waiters.clear(),this.priorityReadyPromise=new Promise(i=>{this.priorityReadyResolve=i}),this.config=e,this.app=n,console.log("[AssetTextures] Initialized with config, cleared previous textures")}async ready(){if(this.readyPromise){await this.readyPromise;return}if(!this.config)throw new Error("[AssetTextures] Must call init() before ready() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before ready() - app is null");let e=this.config,n=this.app;return this.readyPromise=(async()=>{var r;console.log("[AssetTextures] Loading all assets...");let i=new Set(["background_loading_1"]),a=[],s=[];for(let[o,l]of e.objects.entries()){let d=(r=l.render)==null?void 0:r.asset;if(!d)continue;let p=async()=>{var c;try{let g=(c=l.identity)==null?void 0:c.id;console.log(`[AssetTextures] Loading ${d.type}: ${o} (${g})`);let u=await Se.load(o,d,n,g);this.textures.set(o,u),console.log(`[AssetTextures] \u2713 Loaded: ${o}`)}catch(g){console.error(`[AssetTextures] \u2717 Failed to load: ${o}`,g)}finally{this.attempted.add(o);try{for(let g of Array.from(this.waiters))g()}catch{}}};i.has(o)?a.push(p()):s.push(p())}a.length>0&&(console.log("[AssetTextures] Phase 1: Loading priority assets (loading screen)..."),await Promise.all(a),console.log("[AssetTextures] Phase 1: Priority assets ready")),this.priorityReadyResolve&&this.priorityReadyResolve(),console.log("[AssetTextures] Phase 2: Loading remaining assets..."),await Promise.all(s),console.log("[AssetTextures] All textures loaded:",Array.from(this.textures.keys()))})(),this.readyPromise}async priorityReady(){return this.priorityReadyPromise?this.priorityReadyPromise:Promise.resolve()}async waitFor(e,n={}){if(!this.config)throw new Error("[AssetTextures] Must call init() before waitFor() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before waitFor() - app is null");let a=Array.from(new Set((e||[]).filter(o=>typeof o=="string"&&o))).filter(o=>{var l,d,p,c;try{let g=(p=(d=(l=this.config)==null?void 0:l.objects)==null?void 0:d.get)==null?void 0:p.call(d,o);return!!((c=g==null?void 0:g.render)!=null&&c.asset)}catch{return!1}});if(a.length===0)return;this.ready().catch(()=>{});let s=()=>a.every(o=>this.textures.has(o)||this.attempted.has(o));if(s())return;let r=typeof n.timeoutMs=="number"?n.timeoutMs:15e3;await new Promise(o=>{let l=!1,d=()=>{l||s()&&(l=!0,this.waiters.delete(d),o())};this.waiters.add(d),d(),r>0&&setTimeout(()=>{l||(l=!0,this.waiters.delete(d),console.warn("[AssetTextures] waitFor timed out; continuing",{ids:a}),o())},r)})}get(e){return this.textures.get(e)}set(e,n){this.textures.set(e,n),console.log(`[AssetTextures] Updated texture: ${e}`)}clear(){this.textures.clear(),this.readyPromise=null,console.log("[AssetTextures] Cleared all textures")}getAllIds(){return Array.from(this.textures.keys())}},$r=new ln,xt=new Proxy($r,{get(t,e){return e in t&&typeof t[e]=="function"?t[e].bind(t):t.get(e)},set(t,e,n){return t.set(e,n),!0}})});var so,fe=ie(()=>{"use strict";so="handler_preview_override_mode";if(typeof window!="undefined"){let t=window.localStorage.getItem(so);window.__enableConfigOverrides=t===null?!0:t==="true"}});var Wa,Te,wc,un=ie(()=>{"use strict";fe();Wa=null,Te="dev";if(typeof window!="undefined"){let t=window.__BUILD_SETTINGS__;if(t!=null&&t.buildMode)Wa=t,Te=t.buildMode,console.log("[CONFIG] Loaded inline build settings:",t,"buildMode:",Te);else try{let e=new XMLHttpRequest;if(e.open("GET","./build-settings.json",!1),e.send(),e.status===200&&e.responseText){let n=JSON.parse(e.responseText);Wa=n,Te=n.buildMode||"dev",console.log("[CONFIG] Loaded build settings:",n,"buildMode:",Te)}else console.log("[CONFIG] No build-settings.json found, using default buildMode:",Te)}catch(e){console.log("[CONFIG] Failed to load build-settings.json:",e instanceof Error?e.message:String(e))}}console.log("[CONFIG] Final buildMode:",Te);wc=Te==="dev"||typeof window!="undefined"&&window.location.search.includes("hot-reload")});var gn=ie(()=>{"use strict"});var Ya=ie(()=>{"use strict";gn();un()});var hn=ie(()=>{"use strict";un();gn();Ya()});var ts={};ra(ts,{AssetEditorModal:()=>wn});var wn,En=ie(()=>{"use strict";wn=class{constructor(){this.modal=null;this.currentObjectId=null;this.currentPath=null;this.currentAsset="";this.onApplyCallback=null}show(e,n,i,a){this.currentObjectId=e,this.currentPath=n,this.currentAsset=i,this.onApplyCallback=a,this.createModal(e,i),document.body.appendChild(this.modal),this.attachModalListeners()}createModal(e,n){let i=document.createElement("div");i.className="asset-editor-modal",i.innerHTML=`
2
2
  <div class="asset-editor-card">
3
3
  <div class="asset-editor-header">
4
4
  <div>
@@ -43,7 +43,7 @@
43
43
  <button class="debug-btn primary" data-modal-apply>Apply</button>
44
44
  </div>
45
45
  </div>
46
- `,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let d=o.target.dataset.tab;d&&this.switchTab(d)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let n=window.__openAiEditor;if(typeof n!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,n(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Xo={};ra(Xo,{AspectClass:()=>In,GameObject:()=>ot,GameObjectManager:()=>$t,Renderer:()=>rt,ResponsiveUISystem:()=>Ge,Transform:()=>st,animateHandClick:()=>xs,animatePanelEntrance:()=>vs,createBrushTexture:()=>_s,createEndGamePanel:()=>ys,createHandTutorial:()=>ws,createThreeBase:()=>fs,createTutorialLabel:()=>Es,getAspectClass:()=>Dt,getRegisteredFontIds:()=>bs,loadAsset:()=>$n,loadCharacterFrames:()=>Ts,registerFont:()=>ms,resolveFont:()=>Z,resolveFontWeight:()=>Q,updateHandAnimation:()=>Ss});module.exports=xr(Xo);var V=ae(require("three"),1);var ge={};function mt(t,e,n=!1){ge[t]||(ge[t]=[]),ge[t].push({fn:e,once:n})}function Xt(t,e){if(ge[t]){if(!e){delete ge[t];return}ge[t]=ge[t].filter(n=>n.fn!==e)}}function bt(t,...e){let n=ge[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Xt(t,i.fn)}function B(t,e){mt(t,e,!0)}var P=null,W=[],ke=null;function da(t){P=t,W=[],ke!==null&&(clearTimeout(ke),ke=null)}function pa(){var t,e,n;return{endpoint:(P==null?void 0:P.endpoint)||"",transport:(P==null?void 0:P.transport)||"beacon",batchSize:(t=P==null?void 0:P.batchSize)!=null?t:10,flushIntervalMs:(e=P==null?void 0:P.flushIntervalMs)!=null?e:300,maxQueue:(n=P==null?void 0:P.maxQueue)!=null?n:200,debug:!!(P!=null&&P.debug)}}async function la(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 Jt(t,e){let n=pa();if(e&&n.endpoint){if(W.push(t),W.length>n.maxQueue&&(W=W.slice(W.length-n.maxQueue)),W.length>=n.batchSize){ca();return}ke===null&&(ke=window.setTimeout(()=>{ke=null,ca()},n.flushIntervalMs))}}async function ca(){let t=pa();if(!t.endpoint||W.length===0)return;let e=W.splice(0,t.batchSize);await la(t.endpoint,{events:e},t.transport,t.debug),W.length>0&&await la(t.endpoint,{events:W.splice(0,t.batchSize)},t.transport,t.debug)}function ua(t){return Math.max(0,Math.min(1,t))}function wr(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 Ve(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Er(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function ga(t,e,n){try{t[e]=n}catch{}}function Sr(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 ha(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 fa(t,e){let n=Sr(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 ma(){let t=new Set,e=new WeakMap,n=null,i=()=>{if(n!=null)return;n=requestAnimationFrame(()=>{n=null,o(),t.size>0&&i()})},a=p=>{var g;t.add(p);let c=(g=e.get(p.target))!=null?g:new Set;c.add(p),e.set(p.target,c),i()},s=p=>{t.delete(p);let c=e.get(p.target);c&&(c.delete(p),c.size===0&&e.delete(p.target))},r=p=>{p.killed||(p.killed=!0,s(p))},o=()=>{var c,g;let p=Ve();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let b=p-u.startMs-u.delayMs;if(b<0)continue;let h=u.durationMs>0?b/u.durationMs:1,x=ua(h),v=u.repeat>=0?u.repeat+1:1,y=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let E=h-y;x=ua(E)}let f=u.ease(x);u.yoyo&&y%2===1&&(f=1-f);for(let E of u.props)ga(u.target,E.key,E.from+(E.to-E.from)*f);u.scaleFrom&&u.scaleTo&&ha(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(h>=v){r(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var E;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),b=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((E=g==null?void 0:g.delayMsOverride)!=null?E:0)),h=wr(c.ease),x=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),f=[];for(let S of Object.keys(c)){if(y.has(S))continue;let A=c[S];typeof A=="number"&&f.push({key:S,from:Er(p,S),to:A})}let m=fa(p,c);return{target:p,startMs:Ve(),delayMs:b,durationMs:u,ease:h,props:f,scaleFrom:m.from,scaleTo:m.to,repeat:x,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>r(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ve())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ve(),b=Ve()-u;g.startMs+=b,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let b=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof b=="number"&&ga(p,u,b)}let g=fa(p,c);g.to&&ha(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))r(g)},timeline(p={}){let c=[],g=0,u=!1,b=[],h=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let f=typeof y=="string"?y.trim():"";return f.startsWith("+=")?g+Math.max(0,Number(f.slice(2))*1e3||0):f?Math.max(0,Number(f)*1e3||0):g},x=y=>{c.push(y);let f=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);g=Math.max(g,y.atMs+f)},v={to(y,f,m){return x({kind:"to",target:y,vars:f,atMs:h(m)}),v},fromTo(y,f,m,E){return x({kind:"fromTo",target:y,vars:m,from:f,atMs:h(E)}),v},play(){var y,f;if(u)return v;u=!0,b=[];for(let m of c)m.kind==="fromTo"&&d.set(m.target,(y=m.from)!=null?y:{}),b.push(d.to(m.target,{...m.vars,delay:m.atMs/1e3+((f=m.vars.delay)!=null?f:0)}));return v},pause(){for(let y of b)y.pause();return v},kill(){for(let y of b)y.kill();b=[],u=!1}};return p.paused||v.play(),v}};return d}function ba(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=ma()}catch{}}var ya={name:"handler-playable-sdk",version:"0.3.39",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 && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var G=0,Cr=G++,va=G++,xa=G++,wa=G++,Ea=G++,Sa=G++,Aa=G++,Ca=G++,Ta=G++,_a=G++,La=G++,Ma=G++,T=Cr;function Pa(){return T===va}function ka(){return T===xa}function Ra(){return T===wa}function Oa(){return T===Ea}function Re(){return T===Sa}function Oe(){return T===Aa}function Ia(){return T===Ca}function ja(){return T===Ta}function Da(){return T===_a}function Zt(){return T===La}function Qt(){return T===Ma}function $a(){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=va;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=xa;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=wa)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Ea)}catch{}else if(e==="mintegral")window.gameReady&&(T=Sa);else if(e==="tapjoy")window.TJ_API&&(T=Aa);else if(e==="tiktok")window.openAppStore&&(T=Ca);else if(e==="smadex")try{window.smxTracking&&(T=Ta)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=_a)}catch{}else e==="vungle"?T=La:(t==="nucleo"||e==="nucleo")&&(T=Ma)}var yt=ae(require("lottie-web"),1),Ha=yt.default;typeof window!="undefined"&&(window.lottie=yt.default,window.__baseLottie=yt.default);var Tr=require("pixi.js");var en=require("pixi.js");var _r=null;function tn(t){_r=t}vt();nn();var Ye=require("pixi.js");vt();var Or=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",on=Or;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&&(on=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${on}`))}}catch{}var Ae=class{static async create(e,n,i){var l,d,p,c,g,u,b;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${on}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Ye.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let s=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${s}, type: ${a.type}, path: ${a.path}`);let r=await Se.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 Ye.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=r==null?void 0:r.constructor)==null?void 0:g.name,r),r&&(((u=r.constructor)==null?void 0:u.name)==="Container"||r instanceof Ye.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],x=!1;for(let v of h)try{let y=await fetch(v);if(y.ok){o=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(b=o==null?void 0:o.constructor)==null?void 0:b.name),x=!0;break}}catch{continue}x||(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,l;if(!(!n||!e)){if(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){let d=(l=i==null?void 0:i.identity)==null?void 0:l.category,p=d==="ui"||d==="environment"?.2:1,c=n.scale*p;console.log(`[ObjectFactory] Applying scale: category=${d}, configScale=${n.scale}, multiplier=${p}, finalScale=${c}`),"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(c):e.scale=c)}n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor&&Array.isArray(n.anchor)&&("set"in e.anchor?e.anchor.set(n.anchor[0],n.anchor[1]):(e.anchor.x=n.anchor[0],e.anchor.y=n.anchor[1]))}}};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 Dr=ae(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Dr);Xe();var wt=require("pixi.js");Xe();var cn=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 Ae.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 Ae.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Hr=new cn,zr=new Proxy(Hr,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Xe();var Ba=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},St={scale:1,position:1},pn=[];function Br(t,e,n,i,a,s,r){pn.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Gr(){pn.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 dn(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),St.scale=le.scaleFactor,St.position=1,console.log(`[SCREEN] Global multipliers - scale: ${St.scale.toFixed(3)}`),Gr()}var Ze={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 Ur(t,e,n){let i=Ze[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function qr(){return Ze}var Wr={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 Et(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function At(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:Et(t[0],e.x),y:Et(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:Et(i.x,e.x),y:Et(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Wr[i])!=null?n:e}return e}function Ga(t,e,n,i={}){var u,b,h,x,v,y;let a=At(n),s=(u=i.inset)!=null?u:{},r=(b=i.padding)!=null?b:{x:0,y:0},o=((h=s.left)!=null?h:0)+r.x,l=((x=s.right)!=null?x:0)+r.x,d=((v=s.top)!=null?v:0)+r.y,p=((y=s.bottom)!=null?y:0)+r.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function Ua(t,e,n,i={}){var h,x,v,y,f,m;let a=(h=i.inset)!=null?h:{},s=(x=i.padding)!=null?x:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((y=a.right)!=null?y:0)+s.x,l=((f=a.top)!=null?f:0)+s.y,d=((m=a.bottom)!=null?m:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=At(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),b=Math.min(Math.max(g.y,0),1);return{x:r+p*u,y:l+c*b}}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,dn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),dn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Ur,window.getDebugConfig=qr,window.copyConfig=io,window.applyConfig=Je,window.applyConfigForRatio=ao,window.positionAtBottom=qa,window.positionAtTop=Kr,window.positionAtCenter=Xr,window.positionAtLeft=Jr,window.positionAtRight=Zr,window.positionAtBottomLeft=Qr,window.positionAtBottomRight=eo,window.positionAtTopLeft=to,window.positionAtTopRight=no,window.applyPositionContract=Yr,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 Ct(t,e,n=0){return t*e+n}function Tt(t,e,n=0){return t*(1-e)+n}function _t(t,e,n=0){return t*e+n}function Lt(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Vr(t,e){return t*e}function Yr(t,e,n,i){var r,o,l,d,p,c,g,u,b,h,x,v,y,f,m,E,S,A,M,R;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=Ct(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=Tt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=_t(e,i.percent,(h=(b=i.offset)==null?void 0:b.x)!=null?h:0),s=U(n,(v=(x=i.offset)==null?void 0:x.y)!=null?v:0);break;case"right":a=Lt(e,i.percent,(f=(y=i.offset)==null?void 0:y.x)!=null?f:0),s=U(n,(E=(m=i.offset)==null?void 0:m.y)!=null?E:0);break;case"center":a=U(e,(A=(S=i.offset)==null?void 0:S.x)!=null?A:0),s=U(n,(R=(M=i.offset)==null?void 0:M.y)!=null?R:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function qa(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Vr(n,i),l=Tt(n,i/2);ce(t,U(e),l);let d=s?a*le.scaleFactor:a;de(t,d),r&&!pn.find(p=>p.element===t)&&Br(t,qa,e,n,i,a,s)}function Kr(t,e,n,i=.1,a=1){ce(t,U(e),Ct(n,i)),de(t,a)}function Xr(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function Jr(t,e,n,i=.1,a=1){ce(t,_t(e,i),U(n)),de(t,a)}function Zr(t,e,n,i=.1,a=1){ce(t,Lt(e,i),U(n)),de(t,a)}function Qr(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),Tt(n,i)),de(t,s)}function eo(t,e,n,i=.05,a=.05,s=1){ce(t,Lt(e,a),Tt(n,i)),de(t,s)}function to(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),Ct(n,i)),de(t,s)}function no(t,e,n,i=.05,a=.05,s=1){ce(t,Lt(e,a),Ct(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 Ce={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 io(t){return t&&Ce[t]?JSON.parse(JSON.stringify(Ce[t])):JSON.parse(JSON.stringify(Ze))}function Je(t){Object.keys(t).forEach(e=>{let n=e;Ze[n]&&t[n]&&Object.assign(Ze[n],t[n])}),console.log("Config applied:",t)}function ao(t,e){let n=t/e;n>1.6?(Je(Ce.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Je(Ce.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Je(Ce.square),console.log("Applied SQUARE config for ratio:",n)):(Je(Ce.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ce,t.resolveAnchorVec2=t.resolveAnchorVec2||At,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||Ga,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||Ua}hn();function k(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Bc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:k(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:k(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:k(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:k(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:k(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:k(360,780)}],Gc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:k(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:k(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:k(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:k(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:k(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:k(412,915)}],Uc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:k(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:k(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:k(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:k(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:k(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:k(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:k(768,1024),mraidScale:.7}];var qc=[...Ka];var go=Ka[0];fe();var xo=ae(require("jszip"),1);function bo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function yo(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 vo(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 fn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await bo(a),r=await vo(s),o=yo(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 Mt(t,e=30){try{console.log("[ImageUtils] Removing background color...");let n=await new Promise((c,g)=>{let u=new Image;u.onload=()=>c(u),u.onerror=()=>g(new Error("Failed to load image")),u.src=t}),i=document.createElement("canvas");i.width=n.width,i.height=n.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),t;a.drawImage(n,0,0);let s=a.getImageData(0,0,i.width,i.height),r=s.data,l=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(c=>({r:r[c.offset],g:r[c.offset+1],b:r[c.offset+2]})),d=0;for(let c=0;c<r.length;c+=4){let g=r[c],u=r[c+1],b=r[c+2],h=!1;for(let x of l)if(Math.sqrt(Math.pow(g-x.r,2)+Math.pow(u-x.g,2)+Math.pow(b-x.b,2))<e){h=!0;break}h&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Xa=require("@google/genai");async function mn(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 y=n[v];if(!y.base64||!y.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(y.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!y.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${y.mimeType}`)}let c=new Xa.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,y)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${y+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 b=await c.models.generateContent({model:g,contents:u}),h="",x=(r=(s=(a=b.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(x)for(let v of x)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(o=c.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var Ja=require("@google/genai");async function Pt(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Ja.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 wo=require("pixi.js");Xe();fe();var Qa=require("pixi.js");var Eo=require("pixi.js");fe();function Mo(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 Po(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 ko(t){return`
46
+ `,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let d=o.target.dataset.tab;d&&this.switchTab(d)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let n=window.__openAiEditor;if(typeof n!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,n(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Ko={};ra(Ko,{AspectClass:()=>In,GameObject:()=>ot,GameObjectManager:()=>$t,Renderer:()=>rt,ResponsiveUISystem:()=>Ge,Transform:()=>st,animateHandClick:()=>xs,animatePanelEntrance:()=>vs,createBrushTexture:()=>_s,createEndGamePanel:()=>ys,createHandTutorial:()=>ws,createThreeBase:()=>fs,createTutorialLabel:()=>Es,getAspectClass:()=>Dt,getRegisteredFontIds:()=>bs,loadAsset:()=>$n,loadCharacterFrames:()=>Ts,registerFont:()=>ms,resolveFont:()=>Z,resolveFontWeight:()=>Q,updateHandAnimation:()=>Ss});module.exports=xr(Ko);var V=ae(require("three"),1);var ge={};function mt(t,e,n=!1){ge[t]||(ge[t]=[]),ge[t].push({fn:e,once:n})}function Xt(t,e){if(ge[t]){if(!e){delete ge[t];return}ge[t]=ge[t].filter(n=>n.fn!==e)}}function bt(t,...e){let n=ge[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Xt(t,i.fn)}function B(t,e){mt(t,e,!0)}var P=null,W=[],ke=null;function da(t){P=t,W=[],ke!==null&&(clearTimeout(ke),ke=null)}function pa(){var t,e,n;return{endpoint:(P==null?void 0:P.endpoint)||"",transport:(P==null?void 0:P.transport)||"beacon",batchSize:(t=P==null?void 0:P.batchSize)!=null?t:10,flushIntervalMs:(e=P==null?void 0:P.flushIntervalMs)!=null?e:300,maxQueue:(n=P==null?void 0:P.maxQueue)!=null?n:200,debug:!!(P!=null&&P.debug)}}async function la(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 Jt(t,e){let n=pa();if(e&&n.endpoint){if(W.push(t),W.length>n.maxQueue&&(W=W.slice(W.length-n.maxQueue)),W.length>=n.batchSize){ca();return}ke===null&&(ke=window.setTimeout(()=>{ke=null,ca()},n.flushIntervalMs))}}async function ca(){let t=pa();if(!t.endpoint||W.length===0)return;let e=W.splice(0,t.batchSize);await la(t.endpoint,{events:e},t.transport,t.debug),W.length>0&&await la(t.endpoint,{events:W.splice(0,t.batchSize)},t.transport,t.debug)}function ua(t){return Math.max(0,Math.min(1,t))}function wr(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 Ve(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Er(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function ga(t,e,n){try{t[e]=n}catch{}}function Sr(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 ha(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 fa(t,e){let n=Sr(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 ma(){let t=new Set,e=new WeakMap,n=null,i=()=>{if(n!=null)return;n=requestAnimationFrame(()=>{n=null,o(),t.size>0&&i()})},a=p=>{var g;t.add(p);let c=(g=e.get(p.target))!=null?g:new Set;c.add(p),e.set(p.target,c),i()},s=p=>{t.delete(p);let c=e.get(p.target);c&&(c.delete(p),c.size===0&&e.delete(p.target))},r=p=>{p.killed||(p.killed=!0,s(p))},o=()=>{var c,g;let p=Ve();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let b=p-u.startMs-u.delayMs;if(b<0)continue;let h=u.durationMs>0?b/u.durationMs:1,x=ua(h),v=u.repeat>=0?u.repeat+1:1,y=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let E=h-y;x=ua(E)}let f=u.ease(x);u.yoyo&&y%2===1&&(f=1-f);for(let E of u.props)ga(u.target,E.key,E.from+(E.to-E.from)*f);u.scaleFrom&&u.scaleTo&&ha(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(h>=v){r(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var E;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),b=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((E=g==null?void 0:g.delayMsOverride)!=null?E:0)),h=wr(c.ease),x=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),f=[];for(let S of Object.keys(c)){if(y.has(S))continue;let A=c[S];typeof A=="number"&&f.push({key:S,from:Er(p,S),to:A})}let m=fa(p,c);return{target:p,startMs:Ve(),delayMs:b,durationMs:u,ease:h,props:f,scaleFrom:m.from,scaleTo:m.to,repeat:x,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>r(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ve())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ve(),b=Ve()-u;g.startMs+=b,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let b=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof b=="number"&&ga(p,u,b)}let g=fa(p,c);g.to&&ha(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))r(g)},timeline(p={}){let c=[],g=0,u=!1,b=[],h=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let f=typeof y=="string"?y.trim():"";return f.startsWith("+=")?g+Math.max(0,Number(f.slice(2))*1e3||0):f?Math.max(0,Number(f)*1e3||0):g},x=y=>{c.push(y);let f=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);g=Math.max(g,y.atMs+f)},v={to(y,f,m){return x({kind:"to",target:y,vars:f,atMs:h(m)}),v},fromTo(y,f,m,E){return x({kind:"fromTo",target:y,vars:m,from:f,atMs:h(E)}),v},play(){var y,f;if(u)return v;u=!0,b=[];for(let m of c)m.kind==="fromTo"&&d.set(m.target,(y=m.from)!=null?y:{}),b.push(d.to(m.target,{...m.vars,delay:m.atMs/1e3+((f=m.vars.delay)!=null?f:0)}));return v},pause(){for(let y of b)y.pause();return v},kill(){for(let y of b)y.kill();b=[],u=!1}};return p.paused||v.play(),v}};return d}function ba(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=ma()}catch{}}var ya={name:"handler-playable-sdk",version:"0.3.41",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 && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var G=0,Cr=G++,va=G++,xa=G++,wa=G++,Ea=G++,Sa=G++,Aa=G++,Ca=G++,Ta=G++,_a=G++,La=G++,Ma=G++,T=Cr;function Pa(){return T===va}function ka(){return T===xa}function Ra(){return T===wa}function Oa(){return T===Ea}function Re(){return T===Sa}function Oe(){return T===Aa}function Ia(){return T===Ca}function ja(){return T===Ta}function Da(){return T===_a}function Zt(){return T===La}function Qt(){return T===Ma}function $a(){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=va;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=xa;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=wa)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Ea)}catch{}else if(e==="mintegral")window.gameReady&&(T=Sa);else if(e==="tapjoy")window.TJ_API&&(T=Aa);else if(e==="tiktok")window.openAppStore&&(T=Ca);else if(e==="smadex")try{window.smxTracking&&(T=Ta)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=_a)}catch{}else e==="vungle"?T=La:(t==="nucleo"||e==="nucleo")&&(T=Ma)}var yt=ae(require("lottie-web"),1),Ha=yt.default;typeof window!="undefined"&&(window.lottie=yt.default,window.__baseLottie=yt.default);var Tr=require("pixi.js");var en=require("pixi.js");var _r=null;function tn(t){_r=t}vt();nn();var Ye=require("pixi.js");vt();var Or=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",on=Or;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&&(on=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${on}`))}}catch{}var Ae=class{static async create(e,n,i){var l,d,p,c,g,u,b;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${on}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Ye.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let s=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${s}, type: ${a.type}, path: ${a.path}`);let r=await Se.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 Ye.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=r==null?void 0:r.constructor)==null?void 0:g.name,r),r&&(((u=r.constructor)==null?void 0:u.name)==="Container"||r instanceof Ye.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],x=!1;for(let v of h)try{let y=await fetch(v);if(y.ok){o=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(b=o==null?void 0:o.constructor)==null?void 0:b.name),x=!0;break}}catch{continue}x||(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;!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&&Array.isArray(n.anchor)&&("set"in e.anchor?e.anchor.set(n.anchor[0],n.anchor[1]):(e.anchor.x=n.anchor[0],e.anchor.y=n.anchor[1])))}};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 Dr=ae(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Dr);Xe();var wt=require("pixi.js");Xe();var cn=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 Ae.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 Ae.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Hr=new cn,zr=new Proxy(Hr,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Xe();var Ba=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},St={scale:1,position:1},pn=[];function Br(t,e,n,i,a,s,r){pn.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Gr(){pn.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 dn(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),St.scale=le.scaleFactor,St.position=1,console.log(`[SCREEN] Global multipliers - scale: ${St.scale.toFixed(3)}`),Gr()}var Ze={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 Ur(t,e,n){let i=Ze[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function qr(){return Ze}var Wr={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 Et(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function At(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:Et(t[0],e.x),y:Et(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:Et(i.x,e.x),y:Et(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Wr[i])!=null?n:e}return e}function Ga(t,e,n,i={}){var u,b,h,x,v,y;let a=At(n),s=(u=i.inset)!=null?u:{},r=(b=i.padding)!=null?b:{x:0,y:0},o=((h=s.left)!=null?h:0)+r.x,l=((x=s.right)!=null?x:0)+r.x,d=((v=s.top)!=null?v:0)+r.y,p=((y=s.bottom)!=null?y:0)+r.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function Ua(t,e,n,i={}){var h,x,v,y,f,m;let a=(h=i.inset)!=null?h:{},s=(x=i.padding)!=null?x:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((y=a.right)!=null?y:0)+s.x,l=((f=a.top)!=null?f:0)+s.y,d=((m=a.bottom)!=null?m:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=At(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),b=Math.min(Math.max(g.y,0),1);return{x:r+p*u,y:l+c*b}}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,dn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),dn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Ur,window.getDebugConfig=qr,window.copyConfig=io,window.applyConfig=Je,window.applyConfigForRatio=ao,window.positionAtBottom=qa,window.positionAtTop=Kr,window.positionAtCenter=Xr,window.positionAtLeft=Jr,window.positionAtRight=Zr,window.positionAtBottomLeft=Qr,window.positionAtBottomRight=eo,window.positionAtTopLeft=to,window.positionAtTopRight=no,window.applyPositionContract=Yr,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 Ct(t,e,n=0){return t*e+n}function Tt(t,e,n=0){return t*(1-e)+n}function _t(t,e,n=0){return t*e+n}function Lt(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Vr(t,e){return t*e}function Yr(t,e,n,i){var r,o,l,d,p,c,g,u,b,h,x,v,y,f,m,E,S,A,M,R;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=Ct(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=Tt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=_t(e,i.percent,(h=(b=i.offset)==null?void 0:b.x)!=null?h:0),s=U(n,(v=(x=i.offset)==null?void 0:x.y)!=null?v:0);break;case"right":a=Lt(e,i.percent,(f=(y=i.offset)==null?void 0:y.x)!=null?f:0),s=U(n,(E=(m=i.offset)==null?void 0:m.y)!=null?E:0);break;case"center":a=U(e,(A=(S=i.offset)==null?void 0:S.x)!=null?A:0),s=U(n,(R=(M=i.offset)==null?void 0:M.y)!=null?R:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function qa(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Vr(n,i),l=Tt(n,i/2);ce(t,U(e),l);let d=s?a*le.scaleFactor:a;de(t,d),r&&!pn.find(p=>p.element===t)&&Br(t,qa,e,n,i,a,s)}function Kr(t,e,n,i=.1,a=1){ce(t,U(e),Ct(n,i)),de(t,a)}function Xr(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function Jr(t,e,n,i=.1,a=1){ce(t,_t(e,i),U(n)),de(t,a)}function Zr(t,e,n,i=.1,a=1){ce(t,Lt(e,i),U(n)),de(t,a)}function Qr(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),Tt(n,i)),de(t,s)}function eo(t,e,n,i=.05,a=.05,s=1){ce(t,Lt(e,a),Tt(n,i)),de(t,s)}function to(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),Ct(n,i)),de(t,s)}function no(t,e,n,i=.05,a=.05,s=1){ce(t,Lt(e,a),Ct(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 Ce={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 io(t){return t&&Ce[t]?JSON.parse(JSON.stringify(Ce[t])):JSON.parse(JSON.stringify(Ze))}function Je(t){Object.keys(t).forEach(e=>{let n=e;Ze[n]&&t[n]&&Object.assign(Ze[n],t[n])}),console.log("Config applied:",t)}function ao(t,e){let n=t/e;n>1.6?(Je(Ce.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Je(Ce.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Je(Ce.square),console.log("Applied SQUARE config for ratio:",n)):(Je(Ce.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ce,t.resolveAnchorVec2=t.resolveAnchorVec2||At,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||Ga,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||Ua}hn();function k(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Fc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:k(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:k(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:k(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:k(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:k(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:k(360,780)}],Bc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:k(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:k(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:k(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:k(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:k(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:k(412,915)}],Gc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:k(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:k(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:k(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:k(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:k(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:k(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:k(768,1024),mraidScale:.7}];var Uc=[...Ka];var go=Ka[0];fe();var vo=ae(require("jszip"),1);function mo(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 bo(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 yo(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 fn(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 mo(a),r=await yo(s),o=bo(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 Mt(t,e=30){try{console.log("[ImageUtils] Removing background color...");let n=await new Promise((c,g)=>{let u=new Image;u.onload=()=>c(u),u.onerror=()=>g(new Error("Failed to load image")),u.src=t}),i=document.createElement("canvas");i.width=n.width,i.height=n.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),t;a.drawImage(n,0,0);let s=a.getImageData(0,0,i.width,i.height),r=s.data,l=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(c=>({r:r[c.offset],g:r[c.offset+1],b:r[c.offset+2]})),d=0;for(let c=0;c<r.length;c+=4){let g=r[c],u=r[c+1],b=r[c+2],h=!1;for(let x of l)if(Math.sqrt(Math.pow(g-x.r,2)+Math.pow(u-x.g,2)+Math.pow(b-x.b,2))<e){h=!0;break}h&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Xa=require("@google/genai");async function mn(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 y=n[v];if(!y.base64||!y.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(y.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!y.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${y.mimeType}`)}let c=new Xa.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,y)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${y+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 b=await c.models.generateContent({model:g,contents:u}),h="",x=(r=(s=(a=b.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(x)for(let v of x)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(o=c.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var Ja=require("@google/genai");async function Pt(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Ja.GoogleGenAI({apiKey:t}),s=[{text:e}];n.length>0&&n.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),s.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let r=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:s});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!r.candidates||!r.candidates[0]||!r.candidates[0].content||!r.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of r.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let l=o.inlineData.data,d=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${d};base64,${l}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var xo=require("pixi.js");Xe();fe();var Qa=require("pixi.js");var wo=require("pixi.js");fe();function Lo(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 Mo(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 Po(t){return`
47
47
  Analyze these screenshots of a brand or game and extract its "Brand DNA".
48
48
 
49
49
  Provide a concise summary (2-3 sentences) covering:
@@ -60,9 +60,9 @@ Palette: [#RRGGBB, #RRGGBB, ...]
60
60
  ${t?`
61
61
  ADDITIONAL RULES/NOTES:
62
62
  ${t}`:""}
63
- `.trim()}function es(){let t=[],e="",n=null;return{async addSources(i){let a=[];for(let s of i){let r=await Mo(s),o=Po(r),l={id:`${Date.now()}-${Math.random().toString(16).slice(2)}`,name:s.name,base64:o.base64,mimeType:o.mimeType,dataUrl:r};t.push(l),a.push(l)}return a},getSources(){return t.slice()},async analyze(i,a,s){if(t.length===0)throw new Error("No screenshots to analyze.");let r=ko(a),o=t.map(g=>({base64:g.base64,mimeType:g.mimeType})),l=await mn(i,r,o,{model:s}),d=e,p=[],c=l.split(`
63
+ `.trim()}function es(){let t=[],e="",n=null;return{async addSources(i){let a=[];for(let s of i){let r=await Lo(s),o=Mo(r),l={id:`${Date.now()}-${Math.random().toString(16).slice(2)}`,name:s.name,base64:o.base64,mimeType:o.mimeType,dataUrl:r};t.push(l),a.push(l)}return a},getSources(){return t.slice()},async analyze(i,a,s){if(t.length===0)throw new Error("No screenshots to analyze.");let r=Po(a),o=t.map(g=>({base64:g.base64,mimeType:g.mimeType})),l=await mn(i,r,o,{model:s}),d=e,p=[],c=l.split(`
64
64
  `);for(let g of c)if(g.toLowerCase().startsWith("summary:"))d=g.slice(8).trim();else if(g.toLowerCase().includes("palette:")){let u=g.match(/#[0-9A-Fa-f]{6}/g);u&&u.forEach(b=>{p.includes(b.toUpperCase())||p.push(b.toUpperCase())})}return(!d||d===e)&&(d=l.split(`
65
- Palette:`)[0].replace(/^Summary:\s*/i,"").trim()),n={summary:d,palette:p.slice(0,10)},n},setSummary(i){e=i,n&&(n={...n,summary:i})},getResult(){return n}}}var _e="handler_api_key_";var je=class{static setKey(e,n,i){try{let a={key:this.encryptKey(n),created:Date.now(),lastUsed:Date.now(),label:i||e},s=`${_e}${e}`;localStorage.setItem(s,JSON.stringify(a))}catch(a){console.error("[ApiKeyStorage] Failed to store API key:",a)}}static getKey(e){try{let n=`${_e}${e}`,i=localStorage.getItem(n);if(!i)return null;let a=JSON.parse(i);return a.lastUsed=Date.now(),localStorage.setItem(n,JSON.stringify(a)),this.decryptKey(a.key)}catch(n){return console.error("[ApiKeyStorage] Failed to retrieve API key:",n),null}}static hasKey(e){let n=`${_e}${e}`;return localStorage.getItem(n)!==null}static removeKey(e){try{let n=`${_e}${e}`;localStorage.removeItem(n)}catch(n){console.error("[ApiKeyStorage] Failed to remove API key:",n)}}static getStoredServices(){let e=[];try{for(let n=0;n<localStorage.length;n++){let i=localStorage.key(n);if(i&&i.startsWith(_e)){let a=i.substring(_e.length),s=localStorage.getItem(i);if(s){let r=JSON.parse(s);e.push({service:a,label:r.label,created:r.created,lastUsed:r.lastUsed})}}}}catch(n){console.error("[ApiKeyStorage] Failed to get stored services:",n)}return e.sort((n,i)=>i.lastUsed-n.lastUsed)}static clearAll(){try{let e=[];for(let n=0;n<localStorage.length;n++){let i=localStorage.key(n);i&&i.startsWith(_e)&&e.push(i)}e.forEach(n=>localStorage.removeItem(n))}catch(e){console.error("[ApiKeyStorage] Failed to clear API keys:",e)}}static encryptKey(e){try{let i="handler_preview_salt_2024"+e;return btoa(i)}catch(n){return console.warn("[ApiKeyStorage] Encryption failed, storing as-is:",n),e}}static decryptKey(e){try{let n=atob(e),i="handler_preview_salt_2024";return n.startsWith(i)?n.substring(i.length):n}catch(n){return console.warn("[ApiKeyStorage] Decryption failed, returning as-is:",n),e}}},bn=()=>je.getKey("gemini"),yn=(t,e)=>je.setKey("gemini",t,e),Ro=()=>je.hasKey("gemini");window.ApiKeyStorage=je;window.getGeminiApiKey=bn;window.setGeminiApiKey=yn;window.hasGeminiApiKey=Ro;var xn=class{constructor(){this.modal=null;this.options=null;this.analyzer=es();this.currentPrompt="";this.isGenerating=!1;this.generatedImages=[];this.selectedImageIndex=-1;this.promptInput=null;this.generateBtn=null;this.loadingEl=null;this.galleryEl=null;this.previewEl=null}open(e){this.options=e,this.currentPrompt=e.initialPrompt||"",this.generatedImages=[],this.selectedImageIndex=-1,this.isGenerating=!1,this.createModal(),document.body.appendChild(this.modal),setTimeout(()=>{var n,i;(n=this.promptInput)==null||n.focus(),(i=this.promptInput)==null||i.select()},100)}createModal(){var n;let e=document.createElement("div");e.className="ai-modal",e.innerHTML=`
65
+ Palette:`)[0].replace(/^Summary:\s*/i,"").trim()),n={summary:d,palette:p.slice(0,10)},n},setSummary(i){e=i,n&&(n={...n,summary:i})},getResult(){return n}}}var _e="handler_api_key_";var je=class{static setKey(e,n,i){try{let a={key:this.encryptKey(n),created:Date.now(),lastUsed:Date.now(),label:i||e},s=`${_e}${e}`;localStorage.setItem(s,JSON.stringify(a))}catch(a){console.error("[ApiKeyStorage] Failed to store API key:",a)}}static getKey(e){try{let n=`${_e}${e}`,i=localStorage.getItem(n);if(!i)return null;let a=JSON.parse(i);return a.lastUsed=Date.now(),localStorage.setItem(n,JSON.stringify(a)),this.decryptKey(a.key)}catch(n){return console.error("[ApiKeyStorage] Failed to retrieve API key:",n),null}}static hasKey(e){let n=`${_e}${e}`;return localStorage.getItem(n)!==null}static removeKey(e){try{let n=`${_e}${e}`;localStorage.removeItem(n)}catch(n){console.error("[ApiKeyStorage] Failed to remove API key:",n)}}static getStoredServices(){let e=[];try{for(let n=0;n<localStorage.length;n++){let i=localStorage.key(n);if(i&&i.startsWith(_e)){let a=i.substring(_e.length),s=localStorage.getItem(i);if(s){let r=JSON.parse(s);e.push({service:a,label:r.label,created:r.created,lastUsed:r.lastUsed})}}}}catch(n){console.error("[ApiKeyStorage] Failed to get stored services:",n)}return e.sort((n,i)=>i.lastUsed-n.lastUsed)}static clearAll(){try{let e=[];for(let n=0;n<localStorage.length;n++){let i=localStorage.key(n);i&&i.startsWith(_e)&&e.push(i)}e.forEach(n=>localStorage.removeItem(n))}catch(e){console.error("[ApiKeyStorage] Failed to clear API keys:",e)}}static encryptKey(e){try{let i="handler_preview_salt_2024"+e;return btoa(i)}catch(n){return console.warn("[ApiKeyStorage] Encryption failed, storing as-is:",n),e}}static decryptKey(e){try{let n=atob(e),i="handler_preview_salt_2024";return n.startsWith(i)?n.substring(i.length):n}catch(n){return console.warn("[ApiKeyStorage] Decryption failed, returning as-is:",n),e}}},bn=()=>je.getKey("gemini"),yn=(t,e)=>je.setKey("gemini",t,e),ko=()=>je.hasKey("gemini");window.ApiKeyStorage=je;window.getGeminiApiKey=bn;window.setGeminiApiKey=yn;window.hasGeminiApiKey=ko;var xn=class{constructor(){this.modal=null;this.options=null;this.analyzer=es();this.currentPrompt="";this.isGenerating=!1;this.generatedImages=[];this.selectedImageIndex=-1;this.promptInput=null;this.generateBtn=null;this.loadingEl=null;this.galleryEl=null;this.previewEl=null}open(e){this.options=e,this.currentPrompt=e.initialPrompt||"",this.generatedImages=[],this.selectedImageIndex=-1,this.isGenerating=!1,this.createModal(),document.body.appendChild(this.modal),setTimeout(()=>{var n,i;(n=this.promptInput)==null||n.focus(),(i=this.promptInput)==null||i.select()},100)}createModal(){var n;let e=document.createElement("div");e.className="ai-modal",e.innerHTML=`
66
66
  <div class="ai-modal-card">
67
67
  <div class="ai-modal-header">
68
68
  <div class="ai-modal-actions">
@@ -226,7 +226,7 @@ Style guidelines: ${i.summary}`;this.promptInput.value=a,this.currentPrompt=a}}c
226
226
  <button class="asset-crop-apply primary" data-action="apply">Apply Crop</button>
227
227
  </div>
228
228
  </div>
229
- `,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 An().open(t)};fe();fe();var ns=ae(require("lottie-web"),1);tn(Ha);typeof window!="undefined"&&!window.lottie&&(window.lottie=ns.default);hn();fe();var Cn=ya.version,Io=new Set(["init","boot","view","ready","start","pause","resume","complete","error","engagement","first_interaction","retry","cta_show","cta_click","cta_dismiss","clickout","conversion","session_time","level_time","load_time","level_start","level_complete","level_fail","checkpoint","reward","tutorial_start","tutorial_complete","tutorial_skip","ab_assign","fps","memory","asset_load_start","asset_load_complete"]);ba();var cs={mechanic_id:"TODO_mechanic_id",variant_id:"TODO_variant_id",deployment_id:"TODO_deployment_id",export_id:"TODO_export_id",profile_id:"TODO_profile_id",instance_id:"default"},ds=Math.random().toString(36).slice(2),He=null,De={...cs},ps="web_embed",Mn={},et,Tn=!1,Qe=!1,nt=!1,us=!1,On=1,Rt=0,jt=!1,pe=!1,$e="",ze=Math.floor(window.innerWidth),Ne=Math.floor(window.innerHeight),Pn=ze>Ne,ue=!1,tt=!1,is=!1,as=!1,_n=!1,Ot=null,Le=null,kn=!1,Rn=!1,kt=new Map;function gs(){if(!Le)return null;let t=Date.now()-Le;return!Number.isFinite(t)||t<0?null:t}function Ln(t){if(kn)return;let e=gs();e!==null&&(kn=!0,w("session_time",{duration_ms:e,reason:t}))}function ss(){if(He)return He;let t=document.createElement("div");return t.id="handler-root",t.setAttribute("data-handler-root","true"),document.body.appendChild(t),He=t,t}function It(t){switch(t){case"interaction":return"engagement";case"finish":return"complete";case"install":return"cta_click";default:return t}}function hs(t,e){return{event_name:t,ts:Date.now(),session_id:ds,deployment_id:De.deployment_id,variant_id:De.variant_id,export_profile_id:De.profile_id,instance_id:De.instance_id||"default",env:ps==="mraid"?"mraid":"web",attribution:et,payload:e}}function w(t,e){let n=It(t),i=hs(n,e);Jt(i,!!Mn.analytics),bt(n,i),n!==t&&bt(t,i)}function it(){Ot&&(Ot(ze,Ne),Ot=null)}function Fe(t){On=t,w("volume",t)}function Be(t){t&&(us=!0),!nt&&(nt=!0,w("pause"),Fe(0))}function at(t){!t&&us||nt&&(nt=!1,w("resume"),Fe(On))}function me(t,e){ze=Math.floor(t||window.innerWidth),Ne=Math.floor(e||window.innerHeight),Pn=ze>Ne,w("resize",{width:ze,height:Ne})}function jo(){if(Pa())try{let t=mraid.getMaxSize();me(t.width,t.height);let e=()=>{mraid.isViewable()&&mraid.getState()!=="hidden"?at():Be()};if(mraid.addEventListener("viewableChange",e),mraid.addEventListener("stateChange",e),mraid.addEventListener("sizeChange",()=>{let n=mraid.getMaxSize();me(n.width,n.height)}),mraid.getAudioVolume){let n=mraid.getAudioVolume();Fe(n?1:0)}if(mraid.addEventListener("audioVolumeChange",n=>{n!==null&&Fe(n>0?1:0)}),mraid.addEventListener("error",(n,i)=>{console.warn("mraid error:",n,"action:",i)}),jt=!0,mraid.isViewable()&&mraid.getState()!=="hidden")ue=!0,w("boot"),w("view"),w("ready"),pe=!0,it();else{let n=()=>{ue=!0,w("boot"),w("view"),w("ready"),pe=!0,it()};mraid.addEventListener("ready",n)}}catch(t){console.warn("MRAID hook skipped",t)}}function Do(){if(ka())try{let t=dapi.getScreenSize();me(t.width,t.height),dapi.addEventListener("viewableChange",n=>{n.isViewable?at():Be()}),dapi.addEventListener("adResized",n=>{let i=dapi.getScreenSize();me(n.width||i.width,n.height||i.height)});let e=dapi.getAudioVolume();if(Fe(e?1:0),dapi.addEventListener("audioVolumeChange",n=>Fe(n?1:0)),jt=!0,dapi.isViewable())ue=!0,w("boot"),w("view"),w("ready"),pe=!0,it();else{let n=()=>{ue=!0,w("boot"),w("view"),w("ready"),pe=!0,it()};dapi.addEventListener("ready",n)}}catch(t){console.warn("DAPI hook skipped",t)}}function rs(){let t=()=>{ue||document.visibilityState==="visible"&&(document.readyState==="complete"||document.readyState==="interactive")&&(ue=!0,w("boot"),w("view"),w("ready"),pe=!0,it(),tt&&(tt=!1,J.start()))};window.addEventListener("resize",()=>me()),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?(at(),t()):Be()}),document.readyState==="complete"||document.readyState==="interactive"?t():window.addEventListener("load",t),jt=!0}function $o(){let t=e=>{typeof TouchEvent!="undefined"&&e instanceof TouchEvent&&(is=!0),!(is&&e instanceof MouseEvent)&&(Rt+=1,Rn||(Rn=!0,w("first_interaction",{count:Rt})),w("interaction",Rt))};document.addEventListener("mousedown",t),document.addEventListener("touchstart",t)}function os(t){var i,a,s,r,o,l,d,p,c,g,u,b;let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none";if((typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed")==="google")try{(i=window.ExitApi)==null||i.exit();return}catch{}if(e==="mraid"&&typeof mraid!="undefined")mraid.open(t||"");else if(e==="dapi"&&typeof dapi!="undefined")dapi.openStoreUrl();else if(Oe())(s=(a=window.TJ_API)==null?void 0:a.click)==null||s.call(a);else if(Ra())(o=(r=window.FbPlayableAd)==null?void 0:r.onCTAClick)==null||o.call(r);else if(Da())(d=(l=window.ScPlayableAd)==null?void 0:l.onCTAClick)==null||d.call(l);else if(ja())try{(c=(p=window.smxTracking)==null?void 0:p.redirect)==null||c.call(p)}catch(h){console.warn("Smadex redirect failed",h)}else if(Oa()){let h=window.ExitApi;h&&typeof h.exit=="function"?h.exit(t||$e||""):t&&window.open(t)}else Re()?(g=window.install)==null||g.call(window):Ia()?(u=window.openAppStore)==null||u.call(window):Zt()?(b=parent==null?void 0:parent.postMessage)==null||b.call(parent,"download","*"):t&&window.open(t)}function Ho(){let t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed",e=n=>{if(!n)return;let i=new Image;i.src=n};if(t==="bigabid"){let n=window.BIGABID_BIDTIMEMACROS;if(!n)return;B("view",()=>e(n.mraid_viewable)),B("start",()=>e(n.game_viewable)),B("engagement",()=>e(n.engagement));let i=()=>e(n.complete);B("complete",i),mt("engagement",a=>{var s;((s=a==null?void 0:a.payload)==null?void 0:s.count)>3&&i()}),B("cta_click",()=>e(n.click))}else if(t==="inmobi"){let n=window.INMOBI_DSPMACROS;if(!n)return;B("view",()=>e(n.Ad_Load_Start)),B("start",()=>e(n.Ad_Viewable)),B("engagement",()=>e(n.First_Engagement)),B("complete",()=>e(n.Gameplay_Complete)),B("cta_click",()=>e(n.DSP_Click)),B("start",()=>{[5,10,15,20,25,30].forEach(i=>setTimeout(()=>e(n[`Spent_${i}_Seconds`]),i*1e3))})}}function zo(){if(!Oe())return;let t=window.TJ_API;t&&t.setPlayableAPI&&t.setPlayableAPI({skipAd:()=>{try{J.finish()}catch(e){console.warn("Tapjoy skip failed",e)}}})}function ls(){var e,n,i;let t=window.TJ_API;(e=t==null?void 0:t.objectiveComplete)==null||e.call(t),(n=t==null?void 0:t.playableFinished)==null||n.call(t),(i=t==null?void 0:t.gameplayFinished)==null||i.call(t)}function No(){Re()&&(window.mintGameStart=()=>{at(!0),me()},window.mintGameClose=()=>{Be(!0)})}function Fo(){if(!Qt())return;let t=window.NUC;!t||!t.trigger||(J.on("cta_click",()=>{var e,n;return(n=(e=t.trigger).convert)==null?void 0:n.call(e,$e)}),J.on("complete",()=>{var e,n;return(n=(e=t.trigger).tryAgain)==null?void 0:n.call(e)}))}var J={init(t={},e){var n;if(ps=t.profile||"web_embed",Mn=t.consent||{},De={...cs,...t.ids||{}},He=t.rootEl||He,et=void 0,da((n=t.telemetry)!=null&&n.endpoint?t.telemetry:null),Le=null,kn=!1,Rn=!1,kt.clear(),$e=t.destinationUrl||(/android/i.test(navigator.userAgent)?"https://play.google.com/store":"https://www.apple.com/app-store/"),e&&(Ot=e),w("init"),document.body.oncontextmenu=()=>!1,ss(),Go(He),$a(),jo(),Do(),!jt){if(document.readyState==="complete")rs();else if(!as){as=!0;let i=()=>{rs(),window.removeEventListener("load",i),document.removeEventListener("DOMContentLoaded",i)};window.addEventListener("load",i),document.addEventListener("DOMContentLoaded",i)}}$o(),Ho(),zo(),No(),Fo(),console.log(`%c @handler/playable-sdk %c v${Cn} `,"background: #007acc; color: #fff; font-size: 14px; padding: 4px 8px; border-top-left-radius: 4px; border-bottom-left-radius: 4px;","background: #e1e4e8; color: #333; font-size: 14px; padding: 4px 8px; border-top-right-radius: 4px; border-bottom-right-radius: 4px;"),ue&&!pe&&(w("boot"),w("view"),w("ready"),tt&&(tt=!1,J.start()),pe=!0),pe=ue},getRoot(){return ss()},get version(){return Cn},get maxWidth(){return ze},get maxHeight(){return Ne},get isLandscape(){return Pn},get isReady(){return pe},get isStarted(){return Tn},get isPaused(){return nt},get isFinished(){return Qe},get volume(){return On},get interactions(){return Rt},on(t,e){mt(It(t),e)},off(t,e){Xt(It(t),e)},start(){var t,e;if(!Tn){if(!ue){tt=!0;return}if(Tn=!0,Le||(Le=Date.now()),w("start"),me(),Re())Be(),(t=window.gameReady)==null||t.call(window);else if(Oe()){let n=window.TJ_API;(e=n==null?void 0:n.setPlayableBuild)==null||e.call(n,{orientation:Pn?"landscape":"portrait",buildID:Cn})}}},finish(){var t,e;Qe||(Qe=!0,w("complete"),Ln("complete"),Re()?(t=window.gameEnd)==null||t.call(window):Zt()?(e=parent==null?void 0:parent.postMessage)==null||e.call(parent,"complete","*"):Oe()&&ls())},install(t){if(!Qe){Qe=!0,Oe()?(ls(),setTimeout(()=>J.install(t),300)):(w("complete"),setTimeout(()=>J.install(t),0));return}_n||(_n=!0,setTimeout(()=>_n=!1,500),w("cta_click"),w("conversion"),Ln("cta"),os(t||$e))},emit(t,e){let n=It(t);if(!Io.has(n)&&n!=="resize"&&n!=="volume"&&!n.startsWith("custom."))throw new Error(`Event ${t} must be canonical or namespaced as custom.<mechanic_id>.<event>`);let i=hs(n,e);Jt(i,!!Mn.analytics),bt(n,i)},gameStart(){J.start()},gameEnd(){J.finish()},ctaClick(t,e){w("cta_click",{url:t||$e,manual:!0}),(e==null?void 0:e.open)!==!1&&os(t||$e)},ctaShow(t){w("cta_show",t)},ctaDismiss(t){w("cta_dismiss",t)},getGameTimeMs(){return gs()},endSession(t="manual"){Ln(t)},setAttribution(t){et=t},abTest(t,e){if(!t)throw new Error("abTest requires experimentId");if(!Array.isArray(e)||e.length<2)throw new Error("abTest requires at least 2 variants");let n=Math.abs(Bo(`${ds}:${t}`))%e.length,i=e[n];return et={...et||{},experiment_id:t},De.variant_id=i,w("ab_assign",{experiment_id:t,variant_id:i}),i},levelStart(t,e){Le||(Le=Date.now()),w("level_start",{level_id:t,...e})},levelComplete(t,e){w("level_complete",{level_id:t,...e})},levelFail(t,e){w("level_fail",{level_id:t,...e})},checkpoint(t,e){w("checkpoint",{checkpoint_id:t,...e})},reward(t,e){w("reward",{reward_id:t,...e})},tutorialStart(t,e){w("tutorial_start",{step_id:t,...e})},tutorialComplete(t,e){w("tutorial_complete",{step_id:t,...e})},tutorialSkip(t,e){w("tutorial_skip",{step_id:t,...e})},timerStart(t){t&&kt.set(t,Date.now())},timerEnd(t,e="custom",n){if(!t)return;let i=kt.get(t);if(!i)return;kt.delete(t);let a=Date.now()-i;if(!(!Number.isFinite(a)||a<0)){if(e==="custom"){w("engagement",{action:"timer",key:t,duration_ms:a,...n});return}w(e,{key:t,duration_ms:a,...n})}},fps(t,e){w("fps",{value:t,...e})},memory(t,e){w("memory",{bytes:t,...e})},assetLoadStart(t,e){w("asset_load_start",{asset_id:t,...e})},assetLoadComplete(t,e){w("asset_load_complete",{asset_id:t,...e})},reportError(t,e,n){w("error",{code:t,message:e,...n})},retry(){var t,e,n;if(Re())(t=window.gameRetry)==null||t.call(window);else if(Qt()){let i=window.NUC;(n=(e=i==null?void 0:i.trigger)==null?void 0:e.tryAgain)==null||n.call(e)}w("engagement",{action:"retry"})},pause(){Be(!0)},resume(){at(!0)},resize(t,e){me(t,e)}},Ie=J;function Bo(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return e|0}function Go(t){let e=document.createElement("script");e.type="text/javascript",e.textContent=`
229
+ `,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 An().open(t)};fe();fe();var ns=ae(require("lottie-web"),1);tn(Ha);typeof window!="undefined"&&!window.lottie&&(window.lottie=ns.default);hn();fe();var Cn=ya.version,Oo=new Set(["init","boot","view","ready","start","pause","resume","complete","error","engagement","first_interaction","retry","cta_show","cta_click","cta_dismiss","clickout","conversion","session_time","level_time","load_time","level_start","level_complete","level_fail","checkpoint","reward","tutorial_start","tutorial_complete","tutorial_skip","ab_assign","fps","memory","asset_load_start","asset_load_complete"]);ba();var cs={mechanic_id:"TODO_mechanic_id",variant_id:"TODO_variant_id",deployment_id:"TODO_deployment_id",export_id:"TODO_export_id",profile_id:"TODO_profile_id",instance_id:"default"},ds=Math.random().toString(36).slice(2),He=null,De={...cs},ps="web_embed",Mn={},et,Tn=!1,Qe=!1,nt=!1,us=!1,On=1,Rt=0,jt=!1,pe=!1,$e="",ze=Math.floor(window.innerWidth),Ne=Math.floor(window.innerHeight),Pn=ze>Ne,ue=!1,tt=!1,is=!1,as=!1,_n=!1,Ot=null,Le=null,kn=!1,Rn=!1,kt=new Map;function gs(){if(!Le)return null;let t=Date.now()-Le;return!Number.isFinite(t)||t<0?null:t}function Ln(t){if(kn)return;let e=gs();e!==null&&(kn=!0,w("session_time",{duration_ms:e,reason:t}))}function ss(){if(He)return He;let t=document.createElement("div");return t.id="handler-root",t.setAttribute("data-handler-root","true"),document.body.appendChild(t),He=t,t}function It(t){switch(t){case"interaction":return"engagement";case"finish":return"complete";case"install":return"cta_click";default:return t}}function hs(t,e){return{event_name:t,ts:Date.now(),session_id:ds,deployment_id:De.deployment_id,variant_id:De.variant_id,export_profile_id:De.profile_id,instance_id:De.instance_id||"default",env:ps==="mraid"?"mraid":"web",attribution:et,payload:e}}function w(t,e){let n=It(t),i=hs(n,e);Jt(i,!!Mn.analytics),bt(n,i),n!==t&&bt(t,i)}function it(){Ot&&(Ot(ze,Ne),Ot=null)}function Fe(t){On=t,w("volume",t)}function Be(t){t&&(us=!0),!nt&&(nt=!0,w("pause"),Fe(0))}function at(t){!t&&us||nt&&(nt=!1,w("resume"),Fe(On))}function me(t,e){ze=Math.floor(t||window.innerWidth),Ne=Math.floor(e||window.innerHeight),Pn=ze>Ne,w("resize",{width:ze,height:Ne})}function Io(){if(Pa())try{let t=mraid.getMaxSize();me(t.width,t.height);let e=()=>{mraid.isViewable()&&mraid.getState()!=="hidden"?at():Be()};if(mraid.addEventListener("viewableChange",e),mraid.addEventListener("stateChange",e),mraid.addEventListener("sizeChange",()=>{let n=mraid.getMaxSize();me(n.width,n.height)}),mraid.getAudioVolume){let n=mraid.getAudioVolume();Fe(n?1:0)}if(mraid.addEventListener("audioVolumeChange",n=>{n!==null&&Fe(n>0?1:0)}),mraid.addEventListener("error",(n,i)=>{console.warn("mraid error:",n,"action:",i)}),jt=!0,mraid.isViewable()&&mraid.getState()!=="hidden")ue=!0,w("boot"),w("view"),w("ready"),pe=!0,it();else{let n=()=>{ue=!0,w("boot"),w("view"),w("ready"),pe=!0,it()};mraid.addEventListener("ready",n)}}catch(t){console.warn("MRAID hook skipped",t)}}function jo(){if(ka())try{let t=dapi.getScreenSize();me(t.width,t.height),dapi.addEventListener("viewableChange",n=>{n.isViewable?at():Be()}),dapi.addEventListener("adResized",n=>{let i=dapi.getScreenSize();me(n.width||i.width,n.height||i.height)});let e=dapi.getAudioVolume();if(Fe(e?1:0),dapi.addEventListener("audioVolumeChange",n=>Fe(n?1:0)),jt=!0,dapi.isViewable())ue=!0,w("boot"),w("view"),w("ready"),pe=!0,it();else{let n=()=>{ue=!0,w("boot"),w("view"),w("ready"),pe=!0,it()};dapi.addEventListener("ready",n)}}catch(t){console.warn("DAPI hook skipped",t)}}function rs(){let t=()=>{ue||document.visibilityState==="visible"&&(document.readyState==="complete"||document.readyState==="interactive")&&(ue=!0,w("boot"),w("view"),w("ready"),pe=!0,it(),tt&&(tt=!1,J.start()))};window.addEventListener("resize",()=>me()),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?(at(),t()):Be()}),document.readyState==="complete"||document.readyState==="interactive"?t():window.addEventListener("load",t),jt=!0}function Do(){let t=e=>{typeof TouchEvent!="undefined"&&e instanceof TouchEvent&&(is=!0),!(is&&e instanceof MouseEvent)&&(Rt+=1,Rn||(Rn=!0,w("first_interaction",{count:Rt})),w("interaction",Rt))};document.addEventListener("mousedown",t),document.addEventListener("touchstart",t)}function os(t){var i,a,s,r,o,l,d,p,c,g,u,b;let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none";if((typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed")==="google")try{(i=window.ExitApi)==null||i.exit();return}catch{}if(e==="mraid"&&typeof mraid!="undefined")mraid.open(t||"");else if(e==="dapi"&&typeof dapi!="undefined")dapi.openStoreUrl();else if(Oe())(s=(a=window.TJ_API)==null?void 0:a.click)==null||s.call(a);else if(Ra())(o=(r=window.FbPlayableAd)==null?void 0:r.onCTAClick)==null||o.call(r);else if(Da())(d=(l=window.ScPlayableAd)==null?void 0:l.onCTAClick)==null||d.call(l);else if(ja())try{(c=(p=window.smxTracking)==null?void 0:p.redirect)==null||c.call(p)}catch(h){console.warn("Smadex redirect failed",h)}else if(Oa()){let h=window.ExitApi;h&&typeof h.exit=="function"?h.exit(t||$e||""):t&&window.open(t)}else Re()?(g=window.install)==null||g.call(window):Ia()?(u=window.openAppStore)==null||u.call(window):Zt()?(b=parent==null?void 0:parent.postMessage)==null||b.call(parent,"download","*"):t&&window.open(t)}function $o(){let t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed",e=n=>{if(!n)return;let i=new Image;i.src=n};if(t==="bigabid"){let n=window.BIGABID_BIDTIMEMACROS;if(!n)return;B("view",()=>e(n.mraid_viewable)),B("start",()=>e(n.game_viewable)),B("engagement",()=>e(n.engagement));let i=()=>e(n.complete);B("complete",i),mt("engagement",a=>{var s;((s=a==null?void 0:a.payload)==null?void 0:s.count)>3&&i()}),B("cta_click",()=>e(n.click))}else if(t==="inmobi"){let n=window.INMOBI_DSPMACROS;if(!n)return;B("view",()=>e(n.Ad_Load_Start)),B("start",()=>e(n.Ad_Viewable)),B("engagement",()=>e(n.First_Engagement)),B("complete",()=>e(n.Gameplay_Complete)),B("cta_click",()=>e(n.DSP_Click)),B("start",()=>{[5,10,15,20,25,30].forEach(i=>setTimeout(()=>e(n[`Spent_${i}_Seconds`]),i*1e3))})}}function Ho(){if(!Oe())return;let t=window.TJ_API;t&&t.setPlayableAPI&&t.setPlayableAPI({skipAd:()=>{try{J.finish()}catch(e){console.warn("Tapjoy skip failed",e)}}})}function ls(){var e,n,i;let t=window.TJ_API;(e=t==null?void 0:t.objectiveComplete)==null||e.call(t),(n=t==null?void 0:t.playableFinished)==null||n.call(t),(i=t==null?void 0:t.gameplayFinished)==null||i.call(t)}function zo(){Re()&&(window.mintGameStart=()=>{at(!0),me()},window.mintGameClose=()=>{Be(!0)})}function No(){if(!Qt())return;let t=window.NUC;!t||!t.trigger||(J.on("cta_click",()=>{var e,n;return(n=(e=t.trigger).convert)==null?void 0:n.call(e,$e)}),J.on("complete",()=>{var e,n;return(n=(e=t.trigger).tryAgain)==null?void 0:n.call(e)}))}var J={init(t={},e){var n;if(ps=t.profile||"web_embed",Mn=t.consent||{},De={...cs,...t.ids||{}},He=t.rootEl||He,et=void 0,da((n=t.telemetry)!=null&&n.endpoint?t.telemetry:null),Le=null,kn=!1,Rn=!1,kt.clear(),$e=t.destinationUrl||(/android/i.test(navigator.userAgent)?"https://play.google.com/store":"https://www.apple.com/app-store/"),e&&(Ot=e),w("init"),document.body.oncontextmenu=()=>!1,ss(),Bo(He),$a(),Io(),jo(),!jt){if(document.readyState==="complete")rs();else if(!as){as=!0;let i=()=>{rs(),window.removeEventListener("load",i),document.removeEventListener("DOMContentLoaded",i)};window.addEventListener("load",i),document.addEventListener("DOMContentLoaded",i)}}Do(),$o(),Ho(),zo(),No(),console.log(`%c @handler/playable-sdk %c v${Cn} `,"background: #007acc; color: #fff; font-size: 14px; padding: 4px 8px; border-top-left-radius: 4px; border-bottom-left-radius: 4px;","background: #e1e4e8; color: #333; font-size: 14px; padding: 4px 8px; border-top-right-radius: 4px; border-bottom-right-radius: 4px;"),ue&&!pe&&(w("boot"),w("view"),w("ready"),tt&&(tt=!1,J.start()),pe=!0),pe=ue},getRoot(){return ss()},get version(){return Cn},get maxWidth(){return ze},get maxHeight(){return Ne},get isLandscape(){return Pn},get isReady(){return pe},get isStarted(){return Tn},get isPaused(){return nt},get isFinished(){return Qe},get volume(){return On},get interactions(){return Rt},on(t,e){mt(It(t),e)},off(t,e){Xt(It(t),e)},start(){var t,e;if(!Tn){if(!ue){tt=!0;return}if(Tn=!0,Le||(Le=Date.now()),w("start"),me(),Re())Be(),(t=window.gameReady)==null||t.call(window);else if(Oe()){let n=window.TJ_API;(e=n==null?void 0:n.setPlayableBuild)==null||e.call(n,{orientation:Pn?"landscape":"portrait",buildID:Cn})}}},finish(){var t,e;Qe||(Qe=!0,w("complete"),Ln("complete"),Re()?(t=window.gameEnd)==null||t.call(window):Zt()?(e=parent==null?void 0:parent.postMessage)==null||e.call(parent,"complete","*"):Oe()&&ls())},install(t){if(!Qe){Qe=!0,Oe()?(ls(),setTimeout(()=>J.install(t),300)):(w("complete"),setTimeout(()=>J.install(t),0));return}_n||(_n=!0,setTimeout(()=>_n=!1,500),w("cta_click"),w("conversion"),Ln("cta"),os(t||$e))},emit(t,e){let n=It(t);if(!Oo.has(n)&&n!=="resize"&&n!=="volume"&&!n.startsWith("custom."))throw new Error(`Event ${t} must be canonical or namespaced as custom.<mechanic_id>.<event>`);let i=hs(n,e);Jt(i,!!Mn.analytics),bt(n,i)},gameStart(){J.start()},gameEnd(){J.finish()},ctaClick(t,e){w("cta_click",{url:t||$e,manual:!0}),(e==null?void 0:e.open)!==!1&&os(t||$e)},ctaShow(t){w("cta_show",t)},ctaDismiss(t){w("cta_dismiss",t)},getGameTimeMs(){return gs()},endSession(t="manual"){Ln(t)},setAttribution(t){et=t},abTest(t,e){if(!t)throw new Error("abTest requires experimentId");if(!Array.isArray(e)||e.length<2)throw new Error("abTest requires at least 2 variants");let n=Math.abs(Fo(`${ds}:${t}`))%e.length,i=e[n];return et={...et||{},experiment_id:t},De.variant_id=i,w("ab_assign",{experiment_id:t,variant_id:i}),i},levelStart(t,e){Le||(Le=Date.now()),w("level_start",{level_id:t,...e})},levelComplete(t,e){w("level_complete",{level_id:t,...e})},levelFail(t,e){w("level_fail",{level_id:t,...e})},checkpoint(t,e){w("checkpoint",{checkpoint_id:t,...e})},reward(t,e){w("reward",{reward_id:t,...e})},tutorialStart(t,e){w("tutorial_start",{step_id:t,...e})},tutorialComplete(t,e){w("tutorial_complete",{step_id:t,...e})},tutorialSkip(t,e){w("tutorial_skip",{step_id:t,...e})},timerStart(t){t&&kt.set(t,Date.now())},timerEnd(t,e="custom",n){if(!t)return;let i=kt.get(t);if(!i)return;kt.delete(t);let a=Date.now()-i;if(!(!Number.isFinite(a)||a<0)){if(e==="custom"){w("engagement",{action:"timer",key:t,duration_ms:a,...n});return}w(e,{key:t,duration_ms:a,...n})}},fps(t,e){w("fps",{value:t,...e})},memory(t,e){w("memory",{bytes:t,...e})},assetLoadStart(t,e){w("asset_load_start",{asset_id:t,...e})},assetLoadComplete(t,e){w("asset_load_complete",{asset_id:t,...e})},reportError(t,e,n){w("error",{code:t,message:e,...n})},retry(){var t,e,n;if(Re())(t=window.gameRetry)==null||t.call(window);else if(Qt()){let i=window.NUC;(n=(e=i==null?void 0:i.trigger)==null?void 0:e.tryAgain)==null||n.call(e)}w("engagement",{action:"retry"})},pause(){Be(!0)},resume(){at(!0)},resize(t,e){me(t,e)}},Ie=J;function Fo(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return e|0}function Bo(t){let e=document.createElement("script");e.type="text/javascript",e.textContent=`
230
230
  (function(){
231
231
  var events = ['touchstart','touchend','mousedown','keydown'];
232
232
  function unlock(){
@@ -321,7 +321,7 @@ Style guidelines: ${i.summary}`;this.promptInput.value=a,this.currentPrompt=a}}c
321
321
  max-width: ${Fs}px;
322
322
  line-height: ${Bs};
323
323
  word-wrap: break-word;
324
- `;let Gs=Gn+Ft+30,Us=(Ii=u.footer_offset_y)!=null?Ii:Gs+Wn/2;xe.style.top=`${Us}px`,xe.style.left="50%";let Gt=Me(xe);Gt.element=xe;let qs=((ji=l==null?void 0:l.render)==null?void 0:ji.alpha)!==void 0&&((Di=l==null?void 0:l.render)==null?void 0:Di.alpha)!==null?l.render.alpha:1;Gt.targetAlpha=qs,L.appendChild(xe);let ne=(($i=d==null?void 0:d.gameplay)==null?void 0:$i.tuning)||{},N=d==null?void 0:d.ui,Ws=(Hi=ne.button_width)!=null?Hi:260,Vn=(zi=ne.button_height)!=null?zi:56,Vs=(Ni=ne.button_radius)!=null?Ni:16,Ys=ne.button_bg_color||((Fi=g.theme)==null?void 0:Fi.cta_background)||"#ffb43b",Ks=(Bi=ne.button_bg_alpha)!=null?Bi:1,Xs=ne.button_border_color||"#ffffff",Js=(Gi=ne.button_border_width)!=null?Gi:2,Qo=(Ui=ne.button_border_alpha)!=null?Ui:.2,Ut=(qi=u.cta_offset_y)!=null?qi:f*.7,I=document.createElement("button");I.style.cssText=`
324
+ `;let Gs=Gn+Ft+30,Us=(Ii=u.footer_offset_y)!=null?Ii:Gs+Wn/2;xe.style.top=`${Us}px`,xe.style.left="50%";let Gt=Me(xe);Gt.element=xe;let qs=((ji=l==null?void 0:l.render)==null?void 0:ji.alpha)!==void 0&&((Di=l==null?void 0:l.render)==null?void 0:Di.alpha)!==null?l.render.alpha:1;Gt.targetAlpha=qs,L.appendChild(xe);let ne=(($i=d==null?void 0:d.gameplay)==null?void 0:$i.tuning)||{},N=d==null?void 0:d.ui,Ws=(Hi=ne.button_width)!=null?Hi:260,Vn=(zi=ne.button_height)!=null?zi:56,Vs=(Ni=ne.button_radius)!=null?Ni:16,Ys=ne.button_bg_color||((Fi=g.theme)==null?void 0:Fi.cta_background)||"#ffb43b",Ks=(Bi=ne.button_bg_alpha)!=null?Bi:1,Xs=ne.button_border_color||"#ffffff",Js=(Gi=ne.button_border_width)!=null?Gi:2,Zo=(Ui=ne.button_border_alpha)!=null?Ui:.2,Ut=(qi=u.cta_offset_y)!=null?qi:f*.7,I=document.createElement("button");I.style.cssText=`
325
325
  width: ${Ws}px;
326
326
  height: ${Vn}px;
327
327
  background: ${Ys};
@@ -344,7 +344,7 @@ Style guidelines: ${i.summary}`;this.promptInput.value=a,this.currentPrompt=a}}c
344
344
  position: absolute;
345
345
  transform: translate(-50%, -50%);
346
346
  white-space: nowrap;
347
- `;let sr=Ut+Vn/2+20,rr=f-m-10,or=Math.min(sr+((Zi=Xn.animation_start_y_offset)!=null?Zi:5),rr);we.style.top=`${or}px`,we.style.left="50%";let Wt=Me(we);Wt.element=we,Wt.animationStartYOffset=(Qi=Xn.animation_start_y_offset)!=null?Qi:5,L.appendChild(we);let Vt=((ea=c==null?void 0:c.gameplay)==null?void 0:ea.tuning)||{},lr=(ta=Vt.hand_offset_x)!=null?ta:50,cr=(na=Vt.hand_offset_y)!=null?na:50,dr=(aa=(ia=c==null?void 0:c.transform)==null?void 0:ia.scale)!=null?aa:.1875,pr=(sa=Vt.hand_scale_multiplier)!=null?sa:2.5,ur=new Ue.SpriteMaterial({map:e||void 0,transparent:!0,alphaTest:.1}),We=new Ue.Sprite(ur),Zn=dr*pr*100;return We.scale.set(Zn,Zn,1),We.position.set(lr,Ut+cr,0),We.material.opacity=0,We.visible=!1,{panel:j,logo:K,title:Nn,subtitle:Bt,footer:Gt,ctaButton:qt,ctaText:Kn,ctaHint:Wt,hand:We}}function vs(t,e,n){var S,A,M,R,_,L,j,O;let i=e.objects.get("ui_endgame_1"),a=((S=i==null?void 0:i.gameplay)==null?void 0:S.tuning)||{},s=(A=a.animation_duration_ms)!=null?A:800,r=(M=a.fade_in_duration_ms)!=null?M:600,o=(R=a.scale_animation_intensity)!=null?R:.1,l=(_=a.logo_animation_delay_ms)!=null?_:100,d=(L=a.title_animation_delay_ms)!=null?L:200,p=(j=a.footer_animation_delay_ms)!=null?j:300,c=(O=a.cta_animation_delay_ms)!=null?O:400,{panel:g,logo:u,title:b,subtitle:h,footer:x,ctaButton:v,ctaText:y,ctaHint:f}=t;g.visible=!0,g.element.style.visibility="visible";let m=Date.now(),E=()=>{let be=Date.now()-m,q=Math.min(be/r,1),Y=1-Math.pow(1-q,3);g.alpha=Y,g.element.style.opacity=Y.toString();let Pe=1+o*(1-Y);g.element.style.transform=`translate(-50%, -50%) scale(${Pe})`,q<1?requestAnimationFrame(E):(setTimeout(()=>Uo(u,s,e),l),setTimeout(()=>{qo(b,s),setTimeout(()=>Wo(h,s),50)},d),setTimeout(()=>Vo(x,s),p),setTimeout(()=>{Yo(v,y,s),setTimeout(()=>Ko(f,s),50),n&&n()},c))};E()}function Uo(t,e,n){var g,u,b,h,x;let i=n==null?void 0:n.objects.get("ui_endgame_logo_1"),s=(u=(((g=i==null?void 0:i.gameplay)==null?void 0:g.tuning)||{}).animation_start_scale)!=null?u:1.2,r=Date.now(),o=t.material.opacity,l=(b=t.targetAlpha)!=null?b:1,d=(h=t.baseScaleX)!=null?h:t.scale.x,p=(x=t.baseScaleY)!=null?x:t.scale.y,c=()=>{let v=Date.now()-r,y=Math.min(v/e,1),f=1-Math.pow(1-y,2);t.material.opacity=o+(l-o)*f;let m=s+(1-s)*f;t.scale.set(d*m,p*m,1),y<1&&requestAnimationFrame(c)};c()}function qo(t,e){let n=Date.now(),i=parseFloat(t.element.style.opacity||"0"),a=parseFloat(t.element.style.top||"0"),s=()=>{let r=Date.now()-n,o=Math.min(r/e,1),l=1-Math.pow(1-o,2);t.element.style.opacity=(i+(1-i)*l).toString(),t.element.style.top=`${a-20*(1-l)}px`,o<1&&requestAnimationFrame(s)};s()}function Wo(t,e){var o;let n=Date.now(),i=parseFloat(t.element.style.opacity||"0"),a=parseFloat(t.element.style.top||"0"),s=a-((o=t.animationStartYOffset)!=null?o:-10),r=()=>{let l=Date.now()-n,d=Math.min(l/e,1),p=1-Math.pow(1-d,2);t.element.style.opacity=(i+(1-i)*p).toString(),t.element.style.top=`${a+(s-a)*p}px`,d<1&&requestAnimationFrame(r)};r()}function Vo(t,e){var r;let n=Date.now(),i=parseFloat(t.element.style.opacity||"0"),a=(r=t.targetAlpha)!=null?r:1,s=()=>{let o=Date.now()-n,l=Math.min(o/e,1),d=1-Math.pow(1-l,2);t.element.style.opacity=(i+(a-i)*d).toString(),l<1&&requestAnimationFrame(s)};s()}function Yo(t,e,n){let i=Date.now(),a=parseFloat(t.element.style.opacity||"0"),s=()=>{let r=Date.now()-i,o=Math.min(r/n,1),l=1-Math.pow(1-o,2);t.element.style.opacity=(a+(1-a)*l).toString(),e.element.style.opacity=(a+(1-a)*l).toString(),t.element.style.transform=`translate(-50%, -50%) scale(${1+.1*(1-l)})`,o<1&&requestAnimationFrame(s)};s()}function Ko(t,e){var o;let n=Date.now(),i=parseFloat(t.element.style.opacity||"0"),a=parseFloat(t.element.style.top||"0"),s=a-((o=t.animationStartYOffset)!=null?o:5),r=()=>{let l=Date.now()-n,d=Math.min(l/e,1),p=1-Math.pow(1-d,2);t.element.style.opacity=(i+(1-i)*p).toString(),t.element.style.top=`${a+(s-a)*p}px`,d<1&&requestAnimationFrame(r)};r()}function xs(t,e,n,i){var p,c,g,u;let a=n.objects.get("ui_endgame_hand_1"),s=((p=a==null?void 0:a.gameplay)==null?void 0:p.tuning)||{},r=(c=s.click_animation_duration_ms)!=null?c:600,o=(g=s.click_delay_ms)!=null?g:2e3,l=(u=s.click_repeat_delay_ms)!=null?u:3e3,d=()=>{var A,M;t.visible=!0,t.material.opacity=1;let b=t.position.x,h=t.position.y,x=(A=s.hand_offset_x)!=null?A:50,v=(M=s.hand_offset_y)!=null?M:50,y=e.element.getBoundingClientRect(),f=x,m=v,E=Date.now(),S=()=>{var Y,Pe,lt;let R=Date.now()-E,_=Math.min(R/r,1),L=_<.5?2*_*_:1-Math.pow(-2*_+2,2)/2;t.position.set(b+(f-b)*L,h+(m-h)*L,0);let j=(Pe=(Y=a==null?void 0:a.transform)==null?void 0:Y.scale)!=null?Pe:.1875,O=(lt=s.hand_scale_multiplier)!=null?lt:2.5,be=j*O*100,q=be+be*.2*Math.sin(_*Math.PI);t.scale.set(q,q,1),_<1?requestAnimationFrame(S):(e.element.style.transform="translate(-50%, -50%) scale(0.95)",setTimeout(()=>{e.element.style.transform="translate(-50%, -50%) scale(1)",i()},100),setTimeout(()=>{t.material.opacity=0,setTimeout(()=>{t.position.set(b,h,0),d()},l)},500))};S()};setTimeout(d,o)}var zt=ae(require("three"),1);function ws(t,e,n){var u,b,h,x,v,y,f;let i=e.objects.get("hand_tutorial_1"),a=((u=i==null?void 0:i.gameplay)==null?void 0:u.tuning)||{},s=(i==null?void 0:i.render)||{},r=(i==null?void 0:i.transform)||{},o=new zt.SpriteMaterial({map:t||void 0,transparent:!0,alphaTest:.1}),l=new zt.Sprite(o),d=r.position||{},p=(b=d==null?void 0:d.z)!=null?b:0;l.position.set(n.x+((h=d==null?void 0:d.x)!=null?h:0),n.y+((x=d==null?void 0:d.y)!=null?x:0),p),l.material.opacity=s.alpha!==void 0&&s.alpha!==null?s.alpha:0,l.visible=s.visible!==void 0&&s.visible!==null?s.visible:!1;let c=(v=a.hand_scale_multiplier)!=null?v:2.5,g=(y=r.scale)!=null?y:.1875;return l.scale.set(g*c*100,g*c*100,1),l.renderOrder=(f=s.z_index)!=null?f:99999,l}function Es(t){var b,h,x,v,y,f,m,E,S;let e=t.objects.get("ui_tutorial_1"),n=e==null?void 0:e.ui,i=(e==null?void 0:e.render)||{},a=((b=t.engine.runtime)==null?void 0:b.ui_styles)||{},s=((h=t.engine.runtime)==null?void 0:h.ui)||{},r=(n==null?void 0:n.text)||s.tutorial_label||s.label_text||"CLEAN!",o=(n==null?void 0:n.font)||"brand.warning",l=(n==null?void 0:n.fontSize)||a.label_font_size||52,d=(v=n==null?void 0:n.letterSpacing)!=null?v:(x=a.label_letter_spacing)!=null?x:-1,p=(n==null?void 0:n.align)||"center",c=i.tint,g=typeof c=="string"?c:c?`#${c.toString(16).padStart(6,"0")}`:a.label_fill||"#FFF1C1",u=document.createElement("div");return u.textContent=r,u.style.cssText=`
347
+ `;let sr=Ut+Vn/2+20,rr=f-m-10,or=Math.min(sr+((Zi=Xn.animation_start_y_offset)!=null?Zi:5),rr);we.style.top=`${or}px`,we.style.left="50%";let Wt=Me(we);Wt.element=we,Wt.animationStartYOffset=(Qi=Xn.animation_start_y_offset)!=null?Qi:5,L.appendChild(we);let Vt=((ea=c==null?void 0:c.gameplay)==null?void 0:ea.tuning)||{},lr=(ta=Vt.hand_offset_x)!=null?ta:50,cr=(na=Vt.hand_offset_y)!=null?na:50,dr=(aa=(ia=c==null?void 0:c.transform)==null?void 0:ia.scale)!=null?aa:.1875,pr=(sa=Vt.hand_scale_multiplier)!=null?sa:2.5,ur=new Ue.SpriteMaterial({map:e||void 0,transparent:!0,alphaTest:.1}),We=new Ue.Sprite(ur),Zn=dr*pr*100;return We.scale.set(Zn,Zn,1),We.position.set(lr,Ut+cr,0),We.material.opacity=0,We.visible=!1,{panel:j,logo:K,title:Nn,subtitle:Bt,footer:Gt,ctaButton:qt,ctaText:Kn,ctaHint:Wt,hand:We}}function vs(t,e,n){var S,A,M,R,_,L,j,O;let i=e.objects.get("ui_endgame_1"),a=((S=i==null?void 0:i.gameplay)==null?void 0:S.tuning)||{},s=(A=a.animation_duration_ms)!=null?A:800,r=(M=a.fade_in_duration_ms)!=null?M:600,o=(R=a.scale_animation_intensity)!=null?R:.1,l=(_=a.logo_animation_delay_ms)!=null?_:100,d=(L=a.title_animation_delay_ms)!=null?L:200,p=(j=a.footer_animation_delay_ms)!=null?j:300,c=(O=a.cta_animation_delay_ms)!=null?O:400,{panel:g,logo:u,title:b,subtitle:h,footer:x,ctaButton:v,ctaText:y,ctaHint:f}=t;g.visible=!0,g.element.style.visibility="visible";let m=Date.now(),E=()=>{let be=Date.now()-m,q=Math.min(be/r,1),Y=1-Math.pow(1-q,3);g.alpha=Y,g.element.style.opacity=Y.toString();let Pe=1+o*(1-Y);g.element.style.transform=`translate(-50%, -50%) scale(${Pe})`,q<1?requestAnimationFrame(E):(setTimeout(()=>Go(u,s,e),l),setTimeout(()=>{Uo(b,s),setTimeout(()=>qo(h,s),50)},d),setTimeout(()=>Wo(x,s),p),setTimeout(()=>{Vo(v,y,s),setTimeout(()=>Yo(f,s),50),n&&n()},c))};E()}function Go(t,e,n){var g,u,b,h,x;let i=n==null?void 0:n.objects.get("ui_endgame_logo_1"),s=(u=(((g=i==null?void 0:i.gameplay)==null?void 0:g.tuning)||{}).animation_start_scale)!=null?u:1.2,r=Date.now(),o=t.material.opacity,l=(b=t.targetAlpha)!=null?b:1,d=(h=t.baseScaleX)!=null?h:t.scale.x,p=(x=t.baseScaleY)!=null?x:t.scale.y,c=()=>{let v=Date.now()-r,y=Math.min(v/e,1),f=1-Math.pow(1-y,2);t.material.opacity=o+(l-o)*f;let m=s+(1-s)*f;t.scale.set(d*m,p*m,1),y<1&&requestAnimationFrame(c)};c()}function Uo(t,e){let n=Date.now(),i=parseFloat(t.element.style.opacity||"0"),a=parseFloat(t.element.style.top||"0"),s=()=>{let r=Date.now()-n,o=Math.min(r/e,1),l=1-Math.pow(1-o,2);t.element.style.opacity=(i+(1-i)*l).toString(),t.element.style.top=`${a-20*(1-l)}px`,o<1&&requestAnimationFrame(s)};s()}function qo(t,e){var o;let n=Date.now(),i=parseFloat(t.element.style.opacity||"0"),a=parseFloat(t.element.style.top||"0"),s=a-((o=t.animationStartYOffset)!=null?o:-10),r=()=>{let l=Date.now()-n,d=Math.min(l/e,1),p=1-Math.pow(1-d,2);t.element.style.opacity=(i+(1-i)*p).toString(),t.element.style.top=`${a+(s-a)*p}px`,d<1&&requestAnimationFrame(r)};r()}function Wo(t,e){var r;let n=Date.now(),i=parseFloat(t.element.style.opacity||"0"),a=(r=t.targetAlpha)!=null?r:1,s=()=>{let o=Date.now()-n,l=Math.min(o/e,1),d=1-Math.pow(1-l,2);t.element.style.opacity=(i+(a-i)*d).toString(),l<1&&requestAnimationFrame(s)};s()}function Vo(t,e,n){let i=Date.now(),a=parseFloat(t.element.style.opacity||"0"),s=()=>{let r=Date.now()-i,o=Math.min(r/n,1),l=1-Math.pow(1-o,2);t.element.style.opacity=(a+(1-a)*l).toString(),e.element.style.opacity=(a+(1-a)*l).toString(),t.element.style.transform=`translate(-50%, -50%) scale(${1+.1*(1-l)})`,o<1&&requestAnimationFrame(s)};s()}function Yo(t,e){var o;let n=Date.now(),i=parseFloat(t.element.style.opacity||"0"),a=parseFloat(t.element.style.top||"0"),s=a-((o=t.animationStartYOffset)!=null?o:5),r=()=>{let l=Date.now()-n,d=Math.min(l/e,1),p=1-Math.pow(1-d,2);t.element.style.opacity=(i+(1-i)*p).toString(),t.element.style.top=`${a+(s-a)*p}px`,d<1&&requestAnimationFrame(r)};r()}function xs(t,e,n,i){var p,c,g,u;let a=n.objects.get("ui_endgame_hand_1"),s=((p=a==null?void 0:a.gameplay)==null?void 0:p.tuning)||{},r=(c=s.click_animation_duration_ms)!=null?c:600,o=(g=s.click_delay_ms)!=null?g:2e3,l=(u=s.click_repeat_delay_ms)!=null?u:3e3,d=()=>{var A,M;t.visible=!0,t.material.opacity=1;let b=t.position.x,h=t.position.y,x=(A=s.hand_offset_x)!=null?A:50,v=(M=s.hand_offset_y)!=null?M:50,y=e.element.getBoundingClientRect(),f=x,m=v,E=Date.now(),S=()=>{var Y,Pe,lt;let R=Date.now()-E,_=Math.min(R/r,1),L=_<.5?2*_*_:1-Math.pow(-2*_+2,2)/2;t.position.set(b+(f-b)*L,h+(m-h)*L,0);let j=(Pe=(Y=a==null?void 0:a.transform)==null?void 0:Y.scale)!=null?Pe:.1875,O=(lt=s.hand_scale_multiplier)!=null?lt:2.5,be=j*O*100,q=be+be*.2*Math.sin(_*Math.PI);t.scale.set(q,q,1),_<1?requestAnimationFrame(S):(e.element.style.transform="translate(-50%, -50%) scale(0.95)",setTimeout(()=>{e.element.style.transform="translate(-50%, -50%) scale(1)",i()},100),setTimeout(()=>{t.material.opacity=0,setTimeout(()=>{t.position.set(b,h,0),d()},l)},500))};S()};setTimeout(d,o)}var zt=ae(require("three"),1);function ws(t,e,n){var u,b,h,x,v,y,f;let i=e.objects.get("hand_tutorial_1"),a=((u=i==null?void 0:i.gameplay)==null?void 0:u.tuning)||{},s=(i==null?void 0:i.render)||{},r=(i==null?void 0:i.transform)||{},o=new zt.SpriteMaterial({map:t||void 0,transparent:!0,alphaTest:.1}),l=new zt.Sprite(o),d=r.position||{},p=(b=d==null?void 0:d.z)!=null?b:0;l.position.set(n.x+((h=d==null?void 0:d.x)!=null?h:0),n.y+((x=d==null?void 0:d.y)!=null?x:0),p),l.material.opacity=s.alpha!==void 0&&s.alpha!==null?s.alpha:0,l.visible=s.visible!==void 0&&s.visible!==null?s.visible:!1;let c=(v=a.hand_scale_multiplier)!=null?v:2.5,g=(y=r.scale)!=null?y:.1875;return l.scale.set(g*c*100,g*c*100,1),l.renderOrder=(f=s.z_index)!=null?f:99999,l}function Es(t){var b,h,x,v,y,f,m,E,S;let e=t.objects.get("ui_tutorial_1"),n=e==null?void 0:e.ui,i=(e==null?void 0:e.render)||{},a=((b=t.engine.runtime)==null?void 0:b.ui_styles)||{},s=((h=t.engine.runtime)==null?void 0:h.ui)||{},r=(n==null?void 0:n.text)||s.tutorial_label||s.label_text||"CLEAN!",o=(n==null?void 0:n.font)||"brand.warning",l=(n==null?void 0:n.fontSize)||a.label_font_size||52,d=(v=n==null?void 0:n.letterSpacing)!=null?v:(x=a.label_letter_spacing)!=null?x:-1,p=(n==null?void 0:n.align)||"center",c=i.tint,g=typeof c=="string"?c:c?`#${c.toString(16).padStart(6,"0")}`:a.label_fill||"#FFF1C1",u=document.createElement("div");return u.textContent=r,u.style.cssText=`
348
348
  font-family: ${Z(o)};
349
349
  font-size: ${l}px;
350
350
  font-weight: ${Q(o)};
@@ -412,8 +412,8 @@
412
412
  /* Scene Tools Corner Panel - HANDLER Style */
413
413
  .scene-tools-corner-panel {
414
414
  position: absolute;
415
- bottom: 200px;
416
- right: 24px;
415
+ top: 16px;
416
+ right: 16px;
417
417
  width: 280px;
418
418
  background: var(--ui-surface);
419
419
  border: 1px solid var(--ui-border);
@@ -432,7 +432,6 @@
432
432
  background: var(--ui-bg-2);
433
433
  border-bottom: 1px solid var(--ui-border);
434
434
  border-radius: 14px 14px 0 0;
435
- cursor: move;
436
435
  user-select: none;
437
436
  }
438
437