handler-playable-sdk 1.0.73 → 1.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-AEPOIAD2.js → chunk-L7FLGI2N.js} +83 -83
- package/dist/cli/brand-dna.mjs +1 -1
- package/dist/cli/canva-import.mjs +1 -1
- package/dist/cli/cleanup-assets.mjs +1 -1
- package/dist/cli/fix-scales.mjs +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/screen-helper.mjs +1 -1
- package/dist/cli/setup-library.mjs +1 -1
- package/dist/cli/student-helper/add-logic.mjs +1 -1
- package/dist/cli/student-helper/add-object.mjs +1 -1
- package/dist/cli/student-helper/arg-parsing.mjs +1 -1
- package/dist/cli/student-helper/asset-registry.mjs +1 -1
- package/dist/cli/student-helper/bullet-system.mjs +1 -1
- package/dist/cli/student-helper/collectable-system.mjs +1 -1
- package/dist/cli/student-helper/constants.mjs +1 -1
- package/dist/cli/student-helper/drag-snap-couples.mjs +1 -1
- package/dist/cli/student-helper/endgame-screen.mjs +1 -1
- package/dist/cli/student-helper/fs-io.mjs +1 -1
- package/dist/cli/student-helper/logic-defaults.mjs +1 -1
- package/dist/cli/student-helper/print-help.mjs +1 -1
- package/dist/cli/student-helper/prompts.mjs +1 -1
- package/dist/cli/student-helper/scratch-card.mjs +1 -1
- package/dist/cli/student-helper/screen-utils.mjs +1 -1
- package/dist/cli/student-helper/snippets.mjs +1 -1
- package/dist/cli/student-helper/start-screen.mjs +1 -1
- package/dist/cli/student-helper/swerve-collect.mjs +1 -1
- package/dist/cli/student-helper/tap-destroy.mjs +1 -1
- package/dist/cli/student-helper/template-packs.mjs +1 -1
- package/dist/cli/student-helper.mjs +1 -1
- package/dist/cli/sync-screens.mjs +1 -1
- package/dist/cli/validate-assets.mjs +1 -1
- package/dist/cli/validate.mjs +1 -1
- package/dist/index.cjs +77 -77
- package/dist/index.js +1 -1
- package/dist/pixi/index.cjs +8 -8
- package/dist/pixi/index.js +1 -1
- package/dist/three/index.cjs +1 -1
- package/dist/three/index.js +1 -1
- package/package.json +1 -1
package/dist/pixi/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x420223,_0x133530){var a0_0x2b2ae5={_0x218e91:0x69,_0x4c52b4:0x62,_0x244e45:0x67,_0x2200f7:'B(TK',_0xe73c50:0x59,_0x5ad1a6:0x5f,_0x12cfd4:0x52,_0x311e4f:0x69,_0x1332fc:0x61,_0x344237:0x72,_0x37a818:0x66,_0x9d941e:'P3m%',_0x3b7cca:0x2fc,_0x5659d9:0x2df,_0x21a042:0x74,_0x166c1c:0x75,_0x48d6ec:'L#^B',_0x33a5a1:0x6a,_0x1b0672:0x2be,_0x2cd9c2:0x2cf,_0x183b45:'JlEL',_0x44fd91:0x2f5,_0x23534f:0x2d8,_0x50bea7:'LaR&',_0xb63e72:0x2d7,_0x1397be:0x2c6,_0x3de352:0x2b1,_0x59950b:0x2b2,_0x4dbb33:'2ezC',_0x108877:0x52,_0x3931a6:0x58,_0x4398e1:'ed[h',_0x311323:0x63,_0x5c29bc:'N6Ce',_0x1b821d:0x2dc,_0xc68890:0x2e1,_0x11680f:0x2e7},a0_0x3c7dca={_0x36e512:0x223};function _0x21a94d(_0x1b61ce,_0x3ea57a,_0x3817e2,_0x19fb37,_0x2772c8){return a0_0x17c1(_0x2772c8- -0x6f,_0x19fb37);}function _0x2b7be9(_0x45282f,_0x37782a,_0x26f7c6,_0x4ad388,_0x252ba2){return a0_0x17c1(_0x4ad388- -0x394,_0x252ba2);}var _0x346ba8=_0x420223();function _0x2e5012(_0x395a04,_0x2ab92f,_0x599411,_0x12c6e1,_0x27f977){return a0_0x17c1(_0x12c6e1-a0_0x3c7dca._0x36e512,_0x599411);}while(!![]){try{var _0x4e5e24=parseInt(_0x21a94d(a0_0x2b2ae5._0x218e91,a0_0x2b2ae5._0x4c52b4,a0_0x2b2ae5._0x244e45,a0_0x2b2ae5._0x2200f7,a0_0x2b2ae5._0xe73c50))/(-0x22b7+-0x1*0xef7+0x31af)+-parseInt(_0x21a94d(a0_0x2b2ae5._0x5ad1a6,a0_0x2b2ae5._0x12cfd4,a0_0x2b2ae5._0x311e4f,'#)N)',0x5c))/(-0x24b*-0xd+0x171e*0x1+-0x34eb)*(parseInt(_0x21a94d(a0_0x2b2ae5._0x1332fc,a0_0x2b2ae5._0x344237,a0_0x2b2ae5._0x37a818,a0_0x2b2ae5._0x9d941e,0x6c))/(0xb8f*0x2+-0x4*-0x67d+-0x13*0x295))+parseInt(_0x2e5012(a0_0x2b2ae5._0x3b7cca,0x2e8,'Y)X7',0x2ed,a0_0x2b2ae5._0x5659d9))/(-0x2232+0x299+0x1f9d)*(parseInt(_0x21a94d(a0_0x2b2ae5._0x244e45,a0_0x2b2ae5._0x21a042,a0_0x2b2ae5._0x166c1c,a0_0x2b2ae5._0x48d6ec,a0_0x2b2ae5._0x33a5a1))/(-0x2267*-0x1+0x1*-0x11ff+-0x347*0x5))+-parseInt(_0x2b7be9(-a0_0x2b2ae5._0x5659d9,-0x2ca,-a0_0x2b2ae5._0x1b0672,-a0_0x2b2ae5._0x2cd9c2,a0_0x2b2ae5._0x183b45))/(-0x434*-0x1+-0x1*-0xe53+-0x1281)*(-parseInt(_0x2e5012(a0_0x2b2ae5._0x44fd91,a0_0x2b2ae5._0x23534f,a0_0x2b2ae5._0x50bea7,0x2e4,a0_0x2b2ae5._0xb63e72))/(-0x1787+0x1*0x7d4+0xfba))+parseInt(_0x2b7be9(-a0_0x2b2ae5._0x1397be,-a0_0x2b2ae5._0x3de352,-a0_0x2b2ae5._0x59950b,-0x2b8,a0_0x2b2ae5._0x4dbb33))/(0xc14+0x2f*0x29+-0x1393)+parseInt(_0x21a94d(a0_0x2b2ae5._0x108877,0x5f,a0_0x2b2ae5._0x3931a6,a0_0x2b2ae5._0x4398e1,0x5d))/(0x1*0xa60+0xcf9*0x2+0x7*-0x52f)+parseInt(_0x21a94d(a0_0x2b2ae5._0x311323,0x67,a0_0x2b2ae5._0x5ad1a6,a0_0x2b2ae5._0x5c29bc,a0_0x2b2ae5._0x1332fc))/(-0x127d+0x2075+-0xdee)*(-parseInt(_0x2e5012(a0_0x2b2ae5._0x1b821d,0x2da,'oP0t',a0_0x2b2ae5._0xc68890,a0_0x2b2ae5._0x11680f))/(0xe*-0x2a5+0x6*-0x3c2+0x3b9d));if(_0x4e5e24===_0x133530)break;else _0x346ba8['push'](_0x346ba8['shift']());}catch(_0x76a443){_0x346ba8['push'](_0x346ba8['shift']());}}}(a0_0x4041,-0x1147de*0x1+-0x26*-0x4dbc+0xe987f));var a0_0x463c99=(function(){var _0x52303d=!![];return function(_0x2a6657,_0x598a1b){var a0_0x3223d4={_0x52b07d:0x35a,_0xc36dcb:'%zt@',_0x2a172e:0x369,_0x20db39:0x352},_0x156137=_0x52303d?function(){var a0_0x5a683b={_0x12a37b:0x285};function _0x93fd79(_0x46387a,_0x4aee30,_0x4e2fd3,_0x4474e0,_0x3345ff){return a0_0x17c1(_0x46387a-a0_0x5a683b._0x12a37b,_0x4aee30);}if(_0x598a1b){var _0xa6eb9f=_0x598a1b[_0x93fd79(a0_0x3223d4._0x52b07d,a0_0x3223d4._0xc36dcb,a0_0x3223d4._0x2a172e,a0_0x3223d4._0x20db39,0x34d)](_0x2a6657,arguments);return _0x598a1b=null,_0xa6eb9f;}}:function(){};return _0x52303d=![],_0x156137;};}()),a0_0x407080=a0_0x463c99(this,function(){var a0_0x23cf59={_0x11097a:'UZSK',_0x4803a9:0x2b7,_0x5a6a6d:0x2bd,_0x596be7:0x121,_0x4e2e5c:'s3xv',_0xb72194:0x102,_0x1b9abd:0x103,_0x1f92cb:0x111,_0x383d6f:0x1fe,_0x177795:0x206,_0x5a23b2:'N6Ce',_0x2b5dd4:'%fFE',_0x2cbd1a:0x2d3,_0x1ef42d:0x2e1,_0x1ca2b1:0x2d7,_0x4d8da7:0x117,_0x589b24:0x113,_0x5224ef:0x1fc,_0x3f6213:0x1f9,_0x2c73d0:0x1fb,_0x49162d:'fdlE',_0x9d9fe9:'m8)k',_0x49d45b:0x2d5,_0x8ed96c:0x2c0,_0x3f2e5f:0x2c9,_0x5e6382:0x2ce,_0x1f3e50:0x1ec,_0x32e183:0x205,_0x179245:0x1fd,_0x3cf688:0x10f,_0x590ebf:'Y)X7',_0x253016:0x10b,_0x383a9a:0x10b,_0x1b0c36:0x1f6,_0x41f420:0x1e1,_0x40a030:0x1ef,_0x25292b:0xfd,_0x56b058:'jTTs',_0x2246b0:0xed,_0x34d46f:0xf0,_0x552ad4:0xfa,_0x28c32f:0x10e,_0x38db90:'tfIz',_0x14bf27:0xfc,_0x5ad07f:0x10d,_0x550932:0x108,_0x3409cc:'s3xv',_0x39f3d8:0x2cc,_0x2b19f6:0x2af},a0_0x421d7b={_0x5a8778:0x2c1},a0_0xf4ff31={_0x1bad3a:0x1fd},a0_0x1f080a={_0x1c3f23:0x3b};function _0x24f782(_0x90aed8,_0x2a7ff2,_0x2e6041,_0x475354,_0x21312b){return a0_0x17c1(_0x21312b-a0_0x1f080a._0x1c3f23,_0x2a7ff2);}var _0x2274d1={};function _0x4c8ab4(_0x4442cf,_0x261c8b,_0x322fcc,_0x1bc6a3,_0x325770){return a0_0x17c1(_0x325770-a0_0xf4ff31._0x1bad3a,_0x4442cf);}function _0x5a818d(_0x3c84fd,_0x275a87,_0x15ec17,_0x5a748f,_0x7198){return a0_0x17c1(_0x5a748f- -a0_0x421d7b._0x5a8778,_0x7198);}_0x2274d1['BSEsh']=_0x4c8ab4(a0_0x23cf59._0x11097a,a0_0x23cf59._0x4803a9,0x2b1,0x2b8,a0_0x23cf59._0x5a6a6d)+_0x24f782(a0_0x23cf59._0x596be7,a0_0x23cf59._0x4e2e5c,a0_0x23cf59._0xb72194,a0_0x23cf59._0x1b9abd,a0_0x23cf59._0x1f92cb)+'+$';var _0x2fdf5d=_0x2274d1;return a0_0x407080[_0x5a818d(-0x20e,-0x204,-a0_0x23cf59._0x383d6f,-a0_0x23cf59._0x177795,a0_0x23cf59._0x5a23b2)+_0x4c8ab4(a0_0x23cf59._0x2b5dd4,a0_0x23cf59._0x2cbd1a,a0_0x23cf59._0x1ef42d,0x2e2,a0_0x23cf59._0x1ca2b1)]()[_0x24f782(a0_0x23cf59._0x4d8da7,'oP0t',a0_0x23cf59._0x589b24,0x115,0x10a)+'h'](_0x5a818d(-a0_0x23cf59._0x5224ef,-0x20a,-a0_0x23cf59._0x3f6213,-a0_0x23cf59._0x2c73d0,a0_0x23cf59._0x49162d)+_0x4c8ab4(a0_0x23cf59._0x9d9fe9,a0_0x23cf59._0x49d45b,a0_0x23cf59._0x8ed96c,a0_0x23cf59._0x3f2e5f,a0_0x23cf59._0x5e6382)+'+$')[_0x5a818d(-a0_0x23cf59._0x1f3e50,-0x1f6,-a0_0x23cf59._0x32e183,-a0_0x23cf59._0x179245,'RPm8')+_0x24f782(a0_0x23cf59._0x3cf688,a0_0x23cf59._0x590ebf,a0_0x23cf59._0x253016,a0_0x23cf59._0x383a9a,0xfe)]()[_0x5a818d(-a0_0x23cf59._0x1b0c36,-a0_0x23cf59._0x41f420,-0x1f0,-a0_0x23cf59._0x40a030,'#)N)')+_0x24f782(a0_0x23cf59._0x25292b,a0_0x23cf59._0x56b058,a0_0x23cf59._0x2246b0,a0_0x23cf59._0x34d46f,a0_0x23cf59._0x552ad4)+'r'](a0_0x407080)[_0x24f782(a0_0x23cf59._0x28c32f,a0_0x23cf59._0x38db90,a0_0x23cf59._0x14bf27,a0_0x23cf59._0x5ad07f,a0_0x23cf59._0x550932)+'h'](_0x2fdf5d[_0x4c8ab4(a0_0x23cf59._0x3409cc,0x2c9,a0_0x23cf59._0x39f3d8,a0_0x23cf59._0x2b19f6,0x2bf)]);});a0_0x407080();import{A as a0_0x43f4a6,B as a0_0x334761,C as a0_0x26a086,D as a0_0x20c698,b as a0_0x388fa,c as a0_0x4a71fe,d as a0_0x2bbb39,e as a0_0x38a42c,f as a0_0x145247,g as a0_0x124484,h as a0_0xe55c69,i as a0_0x246dec,j as a0_0x3a92b4,k as a0_0x567c99,l as a0_0x91ac20,m as a0_0x37684b,n as a0_0xe99ec9,o as a0_0x4865c3,p as a0_0x83a08d,q as a0_0x5bb456,r as a0_0x664d10,s as a0_0x44df9e,t as a0_0x440aa4,u as a0_0x137a1a,v as a0_0x376771,w as a0_0x398bc4,x as a0_0x4c31fd,y as a0_0x442e46,z as a0_0x2091d3}from'../chunk-AEPOIAD2.js';function a0_0x17c1(_0x4279b4,_0x540125){_0x4279b4=_0x4279b4-(0x10b9+0x1581+0x1d*-0x14b);var _0x4aec6f=a0_0x4041();var _0x269eba=_0x4aec6f[_0x4279b4];if(a0_0x17c1['EbCJGO']===undefined){var _0x3d92ae=function(_0x18dad7){var _0xff9968='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x59acca='',_0x19b923='',_0x460053=_0x59acca+_0x3d92ae;for(var _0x1796b5=0xef*-0x15+0x9d*0x24+-0x279,_0x5c7f15,_0x3703c5,_0x3d1356=-0x192e*-0x1+-0x987*0x2+0x1*-0x620;_0x3703c5=_0x18dad7['charAt'](_0x3d1356++);~_0x3703c5&&(_0x5c7f15=_0x1796b5%(-0x22f7+0x2633*0x1+-0x19c*0x2)?_0x5c7f15*(-0x1fb7+0x533*-0x1+0x252a)+_0x3703c5:_0x3703c5,_0x1796b5++%(-0x4*0x2d3+-0x923*0x3+-0x1af*-0x17))?_0x59acca+=_0x460053['charCodeAt'](_0x3d1356+(-0x5ab+-0x1d6a+0x231f))-(-0x1cf4+0xda9+0x1*0xf55)!==-0x5c6*0x1+-0x6*0x5b5+0x1a*0x18a?String['fromCharCode'](-0x2*-0x295+0x1356+-0x223*0xb&_0x5c7f15>>(-(-0x84b+-0x1f6e+0x27bb)*_0x1796b5&-0xb34+0x4e*0x2+0xa9e)):_0x1796b5:-0x1e08+-0x2204+0x2006*0x2){_0x3703c5=_0xff9968['indexOf'](_0x3703c5);}for(var _0x111228=0x122*0x8+0xa*-0x3aa+0x1b94,_0x34d19d=_0x59acca['length'];_0x111228<_0x34d19d;_0x111228++){_0x19b923+='%'+('00'+_0x59acca['charCodeAt'](_0x111228)['toString'](0xbee+0x1524+0x152*-0x19))['slice'](-(0x722+0x2*-0x577+-0x1*-0x3ce));}return decodeURIComponent(_0x19b923);};var _0x49b597=function(_0x412c27,_0x326f3a){var _0x13bd66=[],_0x44bc86=-0x2*0x61c+-0x83*0x4c+0x331c,_0x266c2b,_0xf080d9='';_0x412c27=_0x3d92ae(_0x412c27);var _0x12f8ba;for(_0x12f8ba=0x48e*-0x6+-0x2535+0x4089;_0x12f8ba<-0x1b1c+-0x143f*-0x1+0x21*0x3d;_0x12f8ba++){_0x13bd66[_0x12f8ba]=_0x12f8ba;}for(_0x12f8ba=0x61*-0x3d+-0x2*-0x329+-0x1*-0x10cb;_0x12f8ba<-0x13d4+-0xe14+0x22e8;_0x12f8ba++){_0x44bc86=(_0x44bc86+_0x13bd66[_0x12f8ba]+_0x326f3a['charCodeAt'](_0x12f8ba%_0x326f3a['length']))%(0x224a+-0x158e+0x1*-0xbbc),_0x266c2b=_0x13bd66[_0x12f8ba],_0x13bd66[_0x12f8ba]=_0x13bd66[_0x44bc86],_0x13bd66[_0x44bc86]=_0x266c2b;}_0x12f8ba=0x7b*0x1c+0x5*-0x1cd+-0x473,_0x44bc86=0x13*0x19b+-0x17*0x1a3+0x724;for(var _0x393e90=-0x2d4*0x4+0x46+0xb0a;_0x393e90<_0x412c27['length'];_0x393e90++){_0x12f8ba=(_0x12f8ba+(0x23f9+0x190d+-0x1*0x3d05))%(0xfc6+-0xdf*-0x1d+-0x2809*0x1),_0x44bc86=(_0x44bc86+_0x13bd66[_0x12f8ba])%(0xac3+0x1da2+0x2765*-0x1),_0x266c2b=_0x13bd66[_0x12f8ba],_0x13bd66[_0x12f8ba]=_0x13bd66[_0x44bc86],_0x13bd66[_0x44bc86]=_0x266c2b,_0xf080d9+=String['fromCharCode'](_0x412c27['charCodeAt'](_0x393e90)^_0x13bd66[(_0x13bd66[_0x12f8ba]+_0x13bd66[_0x44bc86])%(-0x1327*-0x1+-0x1459+-0x232*-0x1)]);}return _0xf080d9;};a0_0x17c1['DUOsai']=_0x49b597,a0_0x17c1['tRqoOP']={},a0_0x17c1['EbCJGO']=!![];}var _0x1b64aa=_0x4aec6f[0x1*0xe0b+-0x843+-0xb9*0x8],_0x5f436d=_0x4279b4+_0x1b64aa,_0x32db6c=a0_0x17c1['tRqoOP'][_0x5f436d];if(!_0x32db6c){if(a0_0x17c1['zeUdzr']===undefined){var _0x99b6de=function(_0x53f6dc){this['haLQtg']=_0x53f6dc,this['Itbqhh']=[-0x643*-0x2+-0xffa+0x375,-0x220e+0x1*-0x277+0x1*0x2485,0x2*0xa67+-0x1*0xa0b+-0xac3],this['bkCZLg']=function(){return'newState';},this['orqEaj']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['XTtcRg']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x99b6de['prototype']['qtuUTx']=function(){var _0x33535e=new RegExp(this['orqEaj']+this['XTtcRg']),_0xd2aa2c=_0x33535e['test'](this['bkCZLg']['toString']())?--this['Itbqhh'][-0xbb0+-0x46*0x66+0x2795]:--this['Itbqhh'][-0x251d+-0xdf4*0x2+0x4105];return this['AxfhEa'](_0xd2aa2c);},_0x99b6de['prototype']['AxfhEa']=function(_0x3e6db5){if(!Boolean(~_0x3e6db5))return _0x3e6db5;return this['PuaiJR'](this['haLQtg']);},_0x99b6de['prototype']['PuaiJR']=function(_0x38e058){for(var _0x10ea32=-0x126b+0x11ab+0x18*0x8,_0x5a59e7=this['Itbqhh']['length'];_0x10ea32<_0x5a59e7;_0x10ea32++){this['Itbqhh']['push'](Math['round'](Math['random']())),_0x5a59e7=this['Itbqhh']['length'];}return _0x38e058(this['Itbqhh'][0x7c2*0x1+-0x1c3a+0x20c*0xa]);},new _0x99b6de(a0_0x17c1)['qtuUTx'](),a0_0x17c1['zeUdzr']=!![];}_0x269eba=a0_0x17c1['DUOsai'](_0x269eba,_0x540125),a0_0x17c1['tRqoOP'][_0x5f436d]=_0x269eba;}else _0x269eba=_0x32db6c;return _0x269eba;}import{a as a0_0x350b7b,b as a0_0x2c96dc,c as a0_0x177d1e,d as a0_0x1e8193,e as a0_0x108e72}from'../chunk-I5OOVR5U.js';import'../chunk-PW2FGMCO.js';import'../chunk-HVKF2KYL.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x350b7b as AssetCache,a0_0x177d1e as AssetLoader,a0_0x137a1a as AssetSystem,a0_0x1e8193 as AssetTextures,a0_0x44df9e as Assets,a0_0x4865c3 as BaseSystem,a0_0xe99ec9 as GameEngine,a0_0x38a42c as GameObject,a0_0x145247 as GameObjectManager,a0_0x37684b as ObjectFactory,a0_0x2bbb39 as Renderer,a0_0x83a08d as RuntimeObjectRegistry,a0_0x4a71fe as Transform,a0_0x334761 as applyScreenAnchor,a0_0x5bb456 as basePixi,a0_0x398bc4 as clearResponsiveElements,a0_0x388fa as createPixiBase,a0_0x3a92b4 as getRegisteredFontIds,a0_0x376771 as globalResponsiveMultipliers,a0_0x108e72 as initAssetTextures,a0_0x440aa4 as initAssets,a0_0x26a086 as layout,a0_0x91ac20 as playLottieOverlay,a0_0x246dec as registerFont,a0_0x2c96dc as registerType,a0_0x442e46 as resolveAnchorVec2,a0_0x124484 as resolveFont,a0_0xe55c69 as resolveFontWeight,a0_0x2091d3 as resolveScreenAnchorPoint,a0_0x43f4a6 as resolveScreenRatioPoint,a0_0x20c698 as runInitSequence,a0_0x567c99 as setLottieInstance,a0_0x664d10 as spawnSceneFromConfig,a0_0x4c31fd as updateScreenState};function a0_0x4041(){var _0x4a6841=['W48mcmoHWRu','W6tdTCkTrSoqW45gW77cQCokWP4','ALTiBIC','eSkRoW','kCkyWRpcP8or','WO0Lr11NvmoYWP1M','W57dLw7dOwK','pZ5PW40HWOldLSkPcNdcLxhcIa','tSooW7RdQCoJo8ktW4qIwrFcPW','W5usf8o7WQFdQIDMpsuszG','t8kYjf7cVSoEDq','W7pdV8kIWQpcICkWrCopW6RdM1Dr','e1VcM1FdL8kMW58gdCkyWPNcH8oS','ifflWQlcUG','WRhdNuGOW7fUWQldTSoJtNbQCq','ixldVSoaWPO','W7JdMCk6nmoNW5LEhfVdJZ5Qxq','WR0/WRtcLgq','WQlcPSo7W6tdHa','zGutW6hdOmoHWPpdRLT3xa','wSkBWObcm8kzWOmtvbXjwmow','W5hdK8kaW7rX','asmKnMy','W6tdSCkSaSkIW4jAW7JcPW','W4vAW6pcJNBcKv0','t8ouwmkUWQ9uW6lcQSkTWRldMJ/cUa','uSoYnW','W5SSW4xdSCoPs8oN','W4KyWQVdRH3dRWi/dJtdGeL8','WR/cG8oDECkJ','W4iuWQldQHRdRLyXhX3dM3y','WRtcMSo4W4ldTh8U','zchdSCoDWPS5r2a','W7dcPmo2W67dVa'];a0_0x4041=function(){return _0x4a6841;};return a0_0x4041();}
|
|
1
|
+
(function(_0x5a4806,_0x48cde2){var a0_0x4fbba3={_0x4a36c5:0x190,_0x584f81:0x193,_0x45483c:'mOZ6',_0x5abd24:0x19d,_0x4f88b4:0x3a7,_0x2e8a04:0x3ac,_0x35452c:'f6l5',_0x323834:0x39f,_0x54045d:'k9So',_0x1ec15e:0xd0,_0x49ee06:0xd4,_0xfe972d:0x193,_0x1cd912:0x19e,_0xd2438c:0x18d,_0x27445b:'1pNn',_0x3e7a50:0x18a,_0x5b6acc:0xcb,_0x8db6c6:'!YUI',_0x202a76:0xcd,_0x4b29f5:0x39a,_0x85bfe7:0xb6,_0x57d789:'$5zy',_0x24ac9b:0xcc,_0x32f6e0:0xc4,_0x1720e0:0xe5,_0x333e2b:0xd7,_0x1ca164:'[mwE',_0x55b0e0:0xd0,_0x244d49:0xc9,_0x20c05e:0xe0,_0x1c1758:'XSkB'},a0_0x30a342={_0x371a03:0x1b5},a0_0x2cc25c={_0x1d35cf:0x61},a0_0x1a08ac={_0x5708fb:0x2c1},_0x3291b3=_0x5a4806();function _0x2f06b9(_0x5e423f,_0xbddd22,_0x3261ee,_0x1495b3,_0x5e91a1){return a0_0x5082(_0x5e91a1- -a0_0x1a08ac._0x5708fb,_0xbddd22);}function _0x515f70(_0x17e84c,_0x2d7464,_0x25bb78,_0x4a1331,_0x221e59){return a0_0x5082(_0x17e84c- -a0_0x2cc25c._0x1d35cf,_0x4a1331);}function _0xe124c3(_0x4ba997,_0x122c86,_0x4b8849,_0x9f19cf,_0x42dcbe){return a0_0x5082(_0x4b8849-a0_0x30a342._0x371a03,_0x9f19cf);}while(!![]){try{var _0x230b85=-parseInt(_0x515f70(a0_0x4fbba3._0x4a36c5,0x18e,a0_0x4fbba3._0x584f81,a0_0x4fbba3._0x45483c,a0_0x4fbba3._0x5abd24))/(-0xca+-0x1*0x1111+-0x1*-0x11dc)+parseInt(_0xe124c3(a0_0x4fbba3._0x4f88b4,a0_0x4fbba3._0x2e8a04,a0_0x4fbba3._0x2e8a04,a0_0x4fbba3._0x35452c,a0_0x4fbba3._0x323834))/(-0xd08+0x3*-0xb8b+0x2fab)*(parseInt(_0x2f06b9(-0xde,a0_0x4fbba3._0x54045d,-a0_0x4fbba3._0x1ec15e,-0xd1,-a0_0x4fbba3._0x49ee06))/(0x1adf*0x1+0x13b7+-0x2e93))+-parseInt(_0x515f70(a0_0x4fbba3._0xfe972d,0x186,a0_0x4fbba3._0x1cd912,'nrx$',a0_0x4fbba3._0xd2438c))/(-0x1b24+-0x102c*0x1+0x2b54)*(-parseInt(_0x515f70(0x194,0x194,0x1a1,a0_0x4fbba3._0x27445b,a0_0x4fbba3._0x3e7a50))/(-0x1ed6+-0xc7b+0x2b56))+-parseInt(_0x2f06b9(-a0_0x4fbba3._0x5b6acc,a0_0x4fbba3._0x8db6c6,-0xda,-a0_0x4fbba3._0x202a76,-0xd2))/(-0x2*-0x1ff+0x607*-0x4+0x2*0xa12)*(-parseInt(_0xe124c3(a0_0x4fbba3._0x4b29f5,0x38f,0x39c,'[mwE',0x3a0))/(0x64a+0x2310+-0x1*0x2953))+parseInt(_0x2f06b9(-a0_0x4fbba3._0x85bfe7,a0_0x4fbba3._0x57d789,-a0_0x4fbba3._0x202a76,-a0_0x4fbba3._0x24ac9b,-a0_0x4fbba3._0x32f6e0))/(0x347+0xa3f+-0xd7e)+parseInt(_0x2f06b9(-0xce,'XSkB',-a0_0x4fbba3._0x1720e0,-a0_0x4fbba3._0x333e2b,-0xdb))/(-0x1129+-0x5f6+-0x1728*-0x1)*(parseInt(_0x2f06b9(-a0_0x4fbba3._0x32f6e0,a0_0x4fbba3._0x1ca164,-a0_0x4fbba3._0x55b0e0,-0xd1,-a0_0x4fbba3._0x244d49))/(0x1bd8+-0x1db3*-0x1+-0x3*0x132b))+-parseInt(_0x2f06b9(-a0_0x4fbba3._0x20c05e,a0_0x4fbba3._0x1c1758,-a0_0x4fbba3._0x333e2b,-0xc8,-0xd5))/(0xe7a*0x1+0x21dd*-0x1+0x6*0x33d);if(_0x230b85===_0x48cde2)break;else _0x3291b3['push'](_0x3291b3['shift']());}catch(_0x3d3c78){_0x3291b3['push'](_0x3291b3['shift']());}}}(a0_0x3970,0x4068b+-0x3f85c+0x26e43));var a0_0x380e3b=(function(){var _0x697be1=!![];return function(_0x2f216f,_0x4b92d7){var _0x56abc9=_0x697be1?function(){if(_0x4b92d7){var _0x410c65=_0x4b92d7['apply'](_0x2f216f,arguments);return _0x4b92d7=null,_0x410c65;}}:function(){};return _0x697be1=![],_0x56abc9;};}()),a0_0x4ac0aa=a0_0x380e3b(this,function(){var a0_0x1debc2={_0x752626:'Qmbp',_0xca0432:0x303,_0x4d86bb:0x306,_0x35272f:0x313,_0x3f2c31:0x30a,_0x3ea91d:'mFgw',_0x20562a:0x3ef,_0x348a53:'nrx$',_0x87af2d:0x3d9,_0x8c9cef:0x3d8,_0x5bbd58:'0n5i',_0x596ad7:0x3f3,_0x2ecf2b:0x278,_0x58835e:0x276,_0x12cdb7:0x283,_0x5ecd59:0x263,_0x21e5af:'dZQE',_0x36c7f8:0x258,_0x546384:0x3dd,_0x555937:'!YUI',_0x4ab5f3:0x3e0,_0x5e301e:0x3d1,_0x472f5f:0x3dd,_0x4235d0:0x3d7,_0x3651bb:'Z8SV',_0x585745:0x3db,_0x454e87:0x3e1,_0x5aebbf:0x3dd,_0x54df72:0x2f3},a0_0x584f9f={_0xd33751:0x107},a0_0x3d794d={_0x52b968:0x7a},a0_0x15d408={_0x286caf:0x1f3},_0x1b30b1={};function _0x25c3b9(_0x73e17,_0x182b3b,_0x4f6805,_0x3d3799,_0x32e0fd){return a0_0x5082(_0x73e17-a0_0x15d408._0x286caf,_0x182b3b);}_0x1b30b1[_0xa6485a(a0_0x1debc2._0x752626,a0_0x1debc2._0xca0432,a0_0x1debc2._0x4d86bb,a0_0x1debc2._0x35272f,a0_0x1debc2._0x3f2c31)]=_0x25c3b9(0x3ee,a0_0x1debc2._0x3ea91d,a0_0x1debc2._0x20562a,0x3ea,0x3e6)+')+)+)'+'+$';function _0x395408(_0x339383,_0xe1733b,_0xcc65f9,_0x47389a,_0x52f77d){return a0_0x5082(_0xe1733b-a0_0x3d794d._0x52b968,_0x47389a);}var _0x14d765=_0x1b30b1;function _0xa6485a(_0x1b643e,_0x40bf05,_0x4b0e04,_0x291fd2,_0x1465fb){return a0_0x5082(_0x4b0e04-a0_0x584f9f._0xd33751,_0x1b643e);}return a0_0x4ac0aa[_0x25c3b9(0x3d8,a0_0x1debc2._0x348a53,a0_0x1debc2._0x87af2d,a0_0x1debc2._0x8c9cef,0x3df)+_0x25c3b9(0x3e6,a0_0x1debc2._0x5bbd58,0x3d9,0x3ea,a0_0x1debc2._0x596ad7)]()[_0x395408(a0_0x1debc2._0x2ecf2b,a0_0x1debc2._0x58835e,a0_0x1debc2._0x12cdb7,'HLqx',0x273)+'h'](_0x14d765[_0x395408(0x25f,a0_0x1debc2._0x5ecd59,0x265,a0_0x1debc2._0x21e5af,a0_0x1debc2._0x36c7f8)])[_0x25c3b9(a0_0x1debc2._0x546384,a0_0x1debc2._0x555937,a0_0x1debc2._0x4ab5f3,a0_0x1debc2._0x5e301e,a0_0x1debc2._0x472f5f)+_0x25c3b9(a0_0x1debc2._0x4235d0,a0_0x1debc2._0x3651bb,a0_0x1debc2._0x585745,a0_0x1debc2._0x454e87,a0_0x1debc2._0x5aebbf)]()[_0xa6485a(a0_0x1debc2._0x555937,a0_0x1debc2._0x54df72,0x2ef,0x2ed,0x2ef)+'ructo'+'r'](a0_0x4ac0aa)['searc'+'h']('(((.+'+')+)+)'+'+$');});a0_0x4ac0aa();import{A as a0_0x30e2b9,B as a0_0x346a69,C as a0_0x28a682,D as a0_0x513faa,b as a0_0x471521,c as a0_0x17ffcc,d as a0_0x428c5a,e as a0_0x4201f8,f as a0_0x186400,g as a0_0x2af87c,h as a0_0x208bde,i as a0_0x2d4d23,j as a0_0x476de9,k as a0_0x2a8a21,l as a0_0x107888,m as a0_0x200d1a,n as a0_0x5ab9e7,o as a0_0x51b953,p as a0_0x5b14cc,q as a0_0xff215f,r as a0_0x543979,s as a0_0x1f794d,t as a0_0x154f69,u as a0_0x256973,v as a0_0x225a78,w as a0_0xd20218,x as a0_0x236ec4,y as a0_0x39ce13,z as a0_0x4143c2}from'../chunk-L7FLGI2N.js';import{a as a0_0x42e211,b as a0_0x201bdb,c as a0_0x32215d,d as a0_0xfaa631,e as a0_0x4f0f0b}from'../chunk-I5OOVR5U.js';import'../chunk-PW2FGMCO.js';import'../chunk-HVKF2KYL.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x42e211 as AssetCache,a0_0x32215d as AssetLoader,a0_0x256973 as AssetSystem,a0_0xfaa631 as AssetTextures,a0_0x1f794d as Assets,a0_0x51b953 as BaseSystem,a0_0x5ab9e7 as GameEngine,a0_0x4201f8 as GameObject,a0_0x186400 as GameObjectManager,a0_0x200d1a as ObjectFactory,a0_0x428c5a as Renderer,a0_0x5b14cc as RuntimeObjectRegistry,a0_0x17ffcc as Transform,a0_0x346a69 as applyScreenAnchor,a0_0xff215f as basePixi,a0_0xd20218 as clearResponsiveElements,a0_0x471521 as createPixiBase,a0_0x476de9 as getRegisteredFontIds,a0_0x225a78 as globalResponsiveMultipliers,a0_0x4f0f0b as initAssetTextures,a0_0x154f69 as initAssets,a0_0x28a682 as layout,a0_0x107888 as playLottieOverlay,a0_0x2d4d23 as registerFont,a0_0x201bdb as registerType,a0_0x39ce13 as resolveAnchorVec2,a0_0x2af87c as resolveFont,a0_0x208bde as resolveFontWeight,a0_0x4143c2 as resolveScreenAnchorPoint,a0_0x30e2b9 as resolveScreenRatioPoint,a0_0x513faa as runInitSequence,a0_0x2a8a21 as setLottieInstance,a0_0x543979 as spawnSceneFromConfig,a0_0x236ec4 as updateScreenState};function a0_0x5082(_0x56c545,_0xb31fd6){_0x56c545=_0x56c545-(0x1f44+0x1*0x1b4d+0x527*-0xb);var _0x365fc5=a0_0x3970();var _0x35781c=_0x365fc5[_0x56c545];if(a0_0x5082['rFhGCK']===undefined){var _0x2e77d1=function(_0x703c9b){var _0x1c3975='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0xe8fc26='',_0x1bf3a7='',_0x1d7307=_0xe8fc26+_0x2e77d1;for(var _0x455587=-0x1*-0x1+-0x1c06+-0x31d*-0x9,_0x5b079,_0x17b6b5,_0xa0d881=0xaa4+0xb15*-0x1+-0x71*-0x1;_0x17b6b5=_0x703c9b['charAt'](_0xa0d881++);~_0x17b6b5&&(_0x5b079=_0x455587%(0x1*0x1d8c+-0x4*0x6fb+0x19c*-0x1)?_0x5b079*(0x9*0x246+-0x1907+0x4d1)+_0x17b6b5:_0x17b6b5,_0x455587++%(0x1*0x228e+0x249b+-0x4725))?_0xe8fc26+=_0x1d7307['charCodeAt'](_0xa0d881+(-0x283*0x2+-0x7ad+0x43f*0x3))-(-0x3*-0xa6f+0x25f7+-0x453a)!==0x690+0x3e6+-0x2*0x53b?String['fromCharCode'](-0x183f+-0xb13+0x2451*0x1&_0x5b079>>(-(0x1*-0x10f7+0x26db+-0x15e2)*_0x455587&0x7f*0x6+-0x25ed+0x22f9)):_0x455587:-0x3d*0x67+-0x16b8+0x2f43){_0x17b6b5=_0x1c3975['indexOf'](_0x17b6b5);}for(var _0x2074b5=0x26f6+0xb73+-0x3269,_0x13b3c3=_0xe8fc26['length'];_0x2074b5<_0x13b3c3;_0x2074b5++){_0x1bf3a7+='%'+('00'+_0xe8fc26['charCodeAt'](_0x2074b5)['toString'](0x445+-0x2*-0x2fc+-0xa2d))['slice'](-(0x1207*0x1+0xd0a*0x2+-0x2c19));}return decodeURIComponent(_0x1bf3a7);};var _0x571d49=function(_0x2c1dfc,_0x29f657){var _0x348fa0=[],_0x1242bf=0xfb+0x51*-0x73+0x2368,_0x596d07,_0x279ec3='';_0x2c1dfc=_0x2e77d1(_0x2c1dfc);var _0x528537;for(_0x528537=0xf74+0xf02+-0x1e76;_0x528537<-0x24c1+0x1374+0x124d;_0x528537++){_0x348fa0[_0x528537]=_0x528537;}for(_0x528537=-0xb1*-0x33+-0x3b*-0x79+-0x3f26;_0x528537<-0x86b+-0xaed+0x1c*0xba;_0x528537++){_0x1242bf=(_0x1242bf+_0x348fa0[_0x528537]+_0x29f657['charCodeAt'](_0x528537%_0x29f657['length']))%(-0xb7*-0x16+-0x662*0x2+-0x1f6),_0x596d07=_0x348fa0[_0x528537],_0x348fa0[_0x528537]=_0x348fa0[_0x1242bf],_0x348fa0[_0x1242bf]=_0x596d07;}_0x528537=-0x1*-0x16d9+0x1ff0+-0x36c9,_0x1242bf=0x89a*-0x1+0x1b4f*0x1+-0x12b5;for(var _0x4907ca=-0x3d*-0x76+-0x37*-0x8+-0x1dd6;_0x4907ca<_0x2c1dfc['length'];_0x4907ca++){_0x528537=(_0x528537+(0x1dda+0x19df+-0x1*0x37b8))%(-0x4*-0x476+-0x2e6+-0xdf2),_0x1242bf=(_0x1242bf+_0x348fa0[_0x528537])%(-0x732*-0x1+-0x1*-0x21af+-0xf9*0x29),_0x596d07=_0x348fa0[_0x528537],_0x348fa0[_0x528537]=_0x348fa0[_0x1242bf],_0x348fa0[_0x1242bf]=_0x596d07,_0x279ec3+=String['fromCharCode'](_0x2c1dfc['charCodeAt'](_0x4907ca)^_0x348fa0[(_0x348fa0[_0x528537]+_0x348fa0[_0x1242bf])%(0x20ac+-0x15cf+-0x9dd)]);}return _0x279ec3;};a0_0x5082['rAzXEW']=_0x571d49,a0_0x5082['gLgTVi']={},a0_0x5082['rFhGCK']=!![];}var _0x507bf7=_0x365fc5[0x172a+-0xdaf+0x97b*-0x1],_0x47bfe0=_0x56c545+_0x507bf7,_0x449fad=a0_0x5082['gLgTVi'][_0x47bfe0];if(!_0x449fad){if(a0_0x5082['vpImqK']===undefined){var _0x47b005=function(_0x3802a9){this['aMldEu']=_0x3802a9,this['eYwHiS']=[0x1ae9+-0xd*0x46+0x1*-0x175a,0x8cb*-0x1+0xe8b*-0x2+0x25e1*0x1,0x1018+0x119*-0x1f+0x11ef],this['fzqkfS']=function(){return'newState';},this['GGGEeo']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['EfiNep']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x47b005['prototype']['vYhJCv']=function(){var _0x375d36=new RegExp(this['GGGEeo']+this['EfiNep']),_0x5a7b4c=_0x375d36['test'](this['fzqkfS']['toString']())?--this['eYwHiS'][0x3*0x86d+0x1*-0x1d3b+0x1*0x3f5]:--this['eYwHiS'][0x1*-0x1099+0xd0f+0x38a];return this['eswNGC'](_0x5a7b4c);},_0x47b005['prototype']['eswNGC']=function(_0x67d31d){if(!Boolean(~_0x67d31d))return _0x67d31d;return this['lwcIfr'](this['aMldEu']);},_0x47b005['prototype']['lwcIfr']=function(_0x8e2f73){for(var _0x42deb6=0x5f7+0x2010+-0x2607,_0x2f49db=this['eYwHiS']['length'];_0x42deb6<_0x2f49db;_0x42deb6++){this['eYwHiS']['push'](Math['round'](Math['random']())),_0x2f49db=this['eYwHiS']['length'];}return _0x8e2f73(this['eYwHiS'][-0x18b1+-0x1*-0x15fd+0x2b4]);},new _0x47b005(a0_0x5082)['vYhJCv'](),a0_0x5082['vpImqK']=!![];}_0x35781c=a0_0x5082['rAzXEW'](_0x35781c,_0xb31fd6),a0_0x5082['gLgTVi'][_0x47bfe0]=_0x35781c;}else _0x35781c=_0x449fad;return _0x35781c;}function a0_0x3970(){var _0x38518d=['kSozW5RdVCop','DbD8W451','WPFcKh5temktkSovtcldR8knWRC','fWpdLqhcT2tcTulcHmk6u2VcHq','oXiccCov','WQdcPMe','dMXZEaW','cCkiW4NdUmo3pSkRW5JdQ8o7b2W','W6eDWRqeWQmaW7ZcGG','rv/cI0FdTG','W5pdM8oAwSkg','uL/cTKddSa','jLFcU3WMWPGamSoAWPhcJW','dSkmW4/dVSo3nmo/WRNdJCoriwa3xG','W5rQBIuuCmkFlSotlgldKq','stnLqdXue1e','fWxdNqtcUMBdO0pcVCkqFLy','W6CFW6T1W4n6W4BcNspcVuXu','pCkbWOtdHa3cK8ofWQJdSmooiq','WO55bb7dM8kusmosW5ZdLmk0CJ/dLW','mgddOW','stCqya9ln1ef','Cmoofc3cPWrREKNdMSoR','paOLa10iWPW4fG','WRZdMmkEcSkAWQNdLG','W6uAWPyjWRKNW63cNG','W7hcUwDxxsDl','ifJdRaXlWQO8oa'];a0_0x3970=function(){return _0x38518d;};return a0_0x3970();}
|
package/dist/three/index.cjs
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
<button class="debug-btn primary" data-modal-apply>Apply</button>
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
|
-
`,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let d=o.target.dataset.tab;d&&this.switchTab(d)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let n=window.__openAiEditor;if(typeof n!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,n(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var el={};da(el,{AspectClass:()=>Hn,GameObject:()=>ct,GameObjectManager:()=>Dt,Renderer:()=>lt,ResponsiveUISystem:()=>Ue,Transform:()=>ot,animateHandClick:()=>Ss,animatePanelEntrance:()=>xs,createBrushTexture:()=>Ps,createEndGamePanel:()=>ws,createHandTutorial:()=>Es,createThreeBase:()=>ys,createTutorialLabel:()=>Cs,getAspectClass:()=>Ht,getRegisteredFontIds:()=>vs,loadAsset:()=>Fn,loadCharacterFrames:()=>ks,registerFont:()=>bs,resolveFont:()=>ee,resolveFontWeight:()=>te,updateHandAnimation:()=>As});module.exports=Sr(el);var W=ge(require("three"),1);var he={};function bt(t,e,n=!1){he[t]||(he[t]=[]),he[t].push({fn:e,once:n})}function Zt(t,e){if(he[t]){if(!e){delete he[t];return}he[t]=he[t].filter(n=>n.fn!==e)}}function vt(t,...e){let n=he[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Zt(t,i.fn)}function B(t,e){bt(t,e,!0)}var _=null,V=[],Ie=null;function ha(t){_=t,V=[],Ie!==null&&(clearTimeout(Ie),Ie=null)}function ma(){var t,e,n;return{endpoint:(_==null?void 0:_.endpoint)||"",transport:(_==null?void 0:_.transport)||"beacon",batchSize:(t=_==null?void 0:_.batchSize)!=null?t:10,flushIntervalMs:(e=_==null?void 0:_.flushIntervalMs)!=null?e:300,maxQueue:(n=_==null?void 0:_.maxQueue)!=null?n:200,debug:!!(_!=null&&_.debug)}}async function ua(t,e,n,i){let a=JSON.stringify(e);if(n==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(s){i&&console.warn("[handler.telemetry] fetch failed",s)}}function Qt(t,e){let n=ma();if(e&&n.endpoint){if(V.push(t),V.length>n.maxQueue&&(V=V.slice(V.length-n.maxQueue)),V.length>=n.batchSize){ga();return}Ie===null&&(Ie=window.setTimeout(()=>{Ie=null,ga()},n.flushIntervalMs))}}async function ga(){let t=ma();if(!t.endpoint||V.length===0)return;let e=V.splice(0,t.batchSize);await ua(t.endpoint,{events:e},t.transport,t.debug),V.length>0&&await ua(t.endpoint,{events:V.splice(0,t.batchSize)},t.transport,t.debug)}function fa(t){return Math.max(0,Math.min(1,t))}function Er(t){let e=String(t!=null?t:"power2.out");if(e==="linear")return n=>n;if(e==="sine.inOut")return n=>.5-Math.cos(Math.PI*n)/2;if(e==="power2.out"||e==="easeOutQuad")return n=>1-(1-n)*(1-n);if(e.startsWith("back.out")){let n=e.match(/back\.out\(([\d.]+)\)/),i=n?Number(n[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return n=>1-(1-n)*(1-n)}function Ye(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Cr(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function ya(t,e,n){try{t[e]=n}catch{}}function Ar(t){let e=t==null?void 0:t.scale;if(!e)return null;let n=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:n,y:i}}function ba(t,e){let n=t==null?void 0:t.scale;if(n)try{typeof n.set=="function"?n.set(e.x,e.y):(typeof n.x=="number"&&(n.x=e.x),typeof n.y=="number"&&(n.y=e.y))}catch{}}function va(t,e){let n=Ar(t);if(!n)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:n.x,y:n.y},to:{x:i!=null?i:n.x,y:a!=null?a:n.y}}}function wa(){let t=new Set,e=new WeakMap,n=null,i=()=>{if(n!=null)return;n=requestAnimationFrame(()=>{n=null,o(),t.size>0&&i()})},a=p=>{var 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=Ye();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let y=p-u.startMs-u.delayMs;if(y<0)continue;let h=u.durationMs>0?y/u.durationMs:1,w=fa(h),v=u.repeat>=0?u.repeat+1:1,b=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let S=h-b;w=fa(S)}let m=u.ease(w);u.yoyo&&b%2===1&&(m=1-m);for(let S of u.props)ya(u.target,S.key,S.from+(S.to-S.from)*m);u.scaleFrom&&u.scaleTo&&ba(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*m,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*m});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){r(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var S;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),y=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((S=g==null?void 0:g.delayMsOverride)!=null?S:0)),h=Er(c.ease),w=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,b=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),m=[];for(let E of Object.keys(c)){if(b.has(E))continue;let C=c[E];typeof C=="number"&&m.push({key:E,from:Cr(p,E),to:C})}let f=va(p,c);return{target:p,startMs:Ye(),delayMs:y,durationMs:u,ease:h,props:m,scaleFrom:f.from,scaleTo:f.to,repeat:w,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>r(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ye())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ye(),y=Ye()-u;g.startMs+=y,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let y=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof y=="number"&&ya(p,u,y)}let g=va(p,c);g.to&&ba(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))r(g)},timeline(p={}){let c=[],g=0,u=!1,y=[],h=b=>{if(typeof b=="number")return Math.max(0,b*1e3);let m=typeof b=="string"?b.trim():"";return m.startsWith("+=")?g+Math.max(0,Number(m.slice(2))*1e3||0):m?Math.max(0,Number(m)*1e3||0):g},w=b=>{c.push(b);let m=Math.max(0,(typeof b.vars.duration=="number"?b.vars.duration:.5)*1e3);g=Math.max(g,b.atMs+m)},v={to(b,m,f){return w({kind:"to",target:b,vars:m,atMs:h(f)}),v},fromTo(b,m,f,S){return w({kind:"fromTo",target:b,vars:f,from:m,atMs:h(S)}),v},play(){var b,m;if(u)return v;u=!0,y=[];for(let f of c)f.kind==="fromTo"&&d.set(f.target,(b=f.from)!=null?b:{}),y.push(d.to(f.target,{...f.vars,delay:f.atMs/1e3+((m=f.vars.delay)!=null?m:0)}));return v},pause(){for(let b of y)b.pause();return v},kill(){for(let b of y)b.kill();y=[],u=!1}};return p.paused||v.play(),v}};return d}function xa(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=wa()}catch{}}var Sa={name:"handler-playable-sdk",version:"1.0.73",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && mkdir -p dist/cli/student-helper && cp src/cli/student-helper/*.mjs dist/cli/student-helper/ && chmod +x dist/cli/*.mjs dist/cli/student-helper/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs dist/cli/student-helper/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var G=0,Lr=G++,Ea=G++,Ca=G++,Aa=G++,Ta=G++,La=G++,ka=G++,Pa=G++,_a=G++,Ma=G++,Ia=G++,ja=G++,T=Lr;function Oa(){return T===Ea}function Ra(){return T===Ca}function za(){return T===Aa}function $a(){return T===Ta}function je(){return T===La}function Oe(){return T===ka}function Ha(){return T===Pa}function Da(){return T===_a}function Na(){return T===Ma}function en(){return T===Ia}function tn(){return T===ja}function Fa(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),T=Ea;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=Ca;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=Aa)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Ta)}catch{}else if(e==="mintegral")window.gameReady&&(T=La);else if(e==="tapjoy")window.TJ_API&&(T=ka);else if(e==="tiktok")window.openAppStore&&(T=Pa);else if(e==="smadex")try{window.smxTracking&&(T=_a)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=Ma)}catch{}else e==="vungle"?T=Ia:(t==="nucleo"||e==="nucleo")&&(T=ja)}var wt=ge(require("lottie-web"),1),Ba=wt.default;typeof window!="undefined"&&(window.lottie=wt.default,window.__baseLottie=wt.default);var kr=require("pixi.js");var nn=require("pixi.js");var Pr=null;function an(t){Pr=t}St();xt();var Xe=require("pixi.js");St();var Rr=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ln=Rr;if(typeof window!="undefined")try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);e!=null&&e.buildMode&&(ln=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${ln}`))}}catch{}function zr(t){var n,i,a,s,r;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(t);let e={center:{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};if(Array.isArray(t))return{x:(n=t[0])!=null?n:.5,y:(i=t[1])!=null?i:.5};if(t&&typeof t=="object"&&"x"in t&&"y"in t)return{x:(a=t.x)!=null?a:.5,y:(s=t.y)!=null?s:.5};if(typeof t=="string"){let o=t.trim().toLowerCase();return(r=e[o])!=null?r:{x:.5,y:.5}}return null}var fe=class{static async create(e,n,i){var l,d,p,c,g,u,y;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${ln}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Xe.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let s=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${s}, type: ${a.type}, path: ${a.path}`);let r=await Ce.load(e,a,i,s);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=r==null?void 0:r.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Xe.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=r==null?void 0:r.constructor)==null?void 0:g.name,r),r&&(((u=r.constructor)==null?void 0:u.name)==="Container"||r instanceof Xe.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],w=!1;for(let v of h)try{let b=await fetch(v);if(b.ok){o=await b.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(y=o==null?void 0:o.constructor)==null?void 0:y.name),w=!0;break}}catch{continue}w||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=r)}else o=r;else o=r,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform,n);return o}static applyTransform(e,n,i){var a,s,r,o;if(!(!n||!e)&&(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(s=n.position.y)!=null?s:0):"position"in e&&e.position&&e.position.set((r=n.position.x)!=null?r:0,(o=n.position.y)!=null?o:0)),n.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(n.scale):e.scale=n.scale),n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor)){let l=zr(n.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var 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=ge(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Dr);Je();var Ct=require("pixi.js");Je();var dn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Ke}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async s=>{var o;let r=this.registry.get(s);if(!r){console.warn("[Assets] No config found for object:",s);return}try{let l=await fe.create(s,r,this.app);this.instanceCache.set(s,l),console.log("[Assets] Loaded object:",s,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",s,l)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(s=>!this.instanceCache.has(s));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let n=this.registry.get(e);if(n){let i=await fe.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Fr=new dn,Br=new Proxy(Fr,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Je();var qr=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},Tt={scale:1,position:1},un=[];function Vr(t,e,n,i,a,s,r){un.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Wr(){un.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*le.scaleFactor;n(t,le.width,le.height,i,a,!0,!1)})}function pn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),le.width=t,le.height=e,le.scaleFactor=Math.min(t/le.designWidth,1.15),Tt.scale=le.scaleFactor,Tt.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Tt.scale.toFixed(3)}`),Wr()}var Qe={layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}};function Yr(t,e,n){let i=Qe[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Xr(){return Qe}var Kr={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function At(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function et(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:At(t[0],e.x),y:At(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:At(i.x,e.x),y:At(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Kr[i])!=null?n:e}return e}function gn(t,e,n,i={}){var u,y,h,w,v,b;let a=et(n),s=(u=i.inset)!=null?u:{},r=(y=i.padding)!=null?y:{x:0,y:0},o=((h=s.left)!=null?h:0)+r.x,l=((w=s.right)!=null?w:0)+r.x,d=((v=s.top)!=null?v:0)+r.y,p=((b=s.bottom)!=null?b:0)+r.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function hn(t,e,n,i={}){var h,w,v,b,m,f;let a=(h=i.inset)!=null?h:{},s=(w=i.padding)!=null?w:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((b=a.right)!=null?b:0)+s.x,l=((m=a.top)!=null?m:0)+s.y,d=((f=a.bottom)!=null?f:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=et(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),y=Math.min(Math.max(g.y,0),1);return{x:r+p*u,y:l+c*y}}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,n=()=>{let i=window.innerWidth,a=window.innerHeight;(i!==t||a!==e)&&(t=i,e=a,pn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),pn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Yr,window.getDebugConfig=Xr,window.copyConfig=oo,window.applyConfig=Ze,window.applyConfigForRatio=lo,window.positionAtBottom=Va,window.positionAtTop=Qr,window.positionAtCenter=eo,window.positionAtLeft=to,window.positionAtRight=no,window.positionAtBottomLeft=io,window.positionAtBottomRight=ao,window.positionAtTopLeft=so,window.positionAtTopRight=ro,window.applyPositionContract=Zr,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function Lt(t,e,n=0){return t*e+n}function kt(t,e,n=0){return t*(1-e)+n}function Pt(t,e,n=0){return t*e+n}function _t(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Jr(t,e){return t*e}function Zr(t,e,n,i){var r,o,l,d,p,c,g,u,y,h,w,v,b,m,f,S,E,C,P,I;let a=0,s=0;switch(i.type){case"top":a=U(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),s=Lt(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),s=kt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=Pt(e,i.percent,(h=(y=i.offset)==null?void 0:y.x)!=null?h:0),s=U(n,(v=(w=i.offset)==null?void 0:w.y)!=null?v:0);break;case"right":a=_t(e,i.percent,(m=(b=i.offset)==null?void 0:b.x)!=null?m:0),s=U(n,(S=(f=i.offset)==null?void 0:f.y)!=null?S:0);break;case"center":a=U(e,(C=(E=i.offset)==null?void 0:E.x)!=null?C:0),s=U(n,(I=(P=i.offset)==null?void 0:P.y)!=null?I:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function Va(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Jr(n,i),l=kt(n,i/2);ce(t,U(e),l);let d=s?a*le.scaleFactor:a;de(t,d),r&&!un.find(p=>p.element===t)&&Vr(t,Va,e,n,i,a,s)}function Qr(t,e,n,i=.1,a=1){ce(t,U(e),Lt(n,i)),de(t,a)}function eo(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function to(t,e,n,i=.1,a=1){ce(t,Pt(e,i),U(n)),de(t,a)}function no(t,e,n,i=.1,a=1){ce(t,_t(e,i),U(n)),de(t,a)}function io(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),kt(n,i)),de(t,s)}function ao(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),kt(n,i)),de(t,s)}function so(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),Lt(n,i)),de(t,s)}function ro(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),Lt(n,i)),de(t,s)}function ce(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ae={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function oo(t){return t&&Ae[t]?JSON.parse(JSON.stringify(Ae[t])):JSON.parse(JSON.stringify(Qe))}function Ze(t){Object.keys(t).forEach(e=>{let n=e;Qe[n]&&t[n]&&Object.assign(Qe[n],t[n])}),console.log("Config applied:",t)}function lo(t,e){let n=t/e;n>1.6?(Ze(Ae.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Ze(Ae.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Ze(Ae.square),console.log("Applied SQUARE config for ratio:",n)):(Ze(Ae.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ae,t.resolveAnchorVec2=t.resolveAnchorVec2||et,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||gn,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||hn}yn();function M(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Wc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:M(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:M(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:M(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:M(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:M(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:M(360,780)}],Yc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:M(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:M(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:M(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:M(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:M(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:M(412,915)}],Xc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:M(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:M(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:M(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:M(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:M(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:M(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:M(768,1024),mraidScale:.7}];var Kc=[...Ka];var yo=Ka[0];Z();function bo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function vo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function wo(t){return await new Promise(e=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth||n.width,height:n.naturalHeight||n.height}),n.onerror=()=>e(null),n.src=t})}async function vn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await bo(a),r=await wo(s),o=vo(s);return console.log("[ImageUtils] Success resolution:",r==null?void 0:r.width,"x",r==null?void 0:r.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:s,width:(e=r==null?void 0:r.width)!=null?e:0,height:(n=r==null?void 0:r.height)!=null?n:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function 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],y=r[c+2],h=!1;for(let w of l)if(Math.sqrt(Math.pow(g-w.r,2)+Math.pow(u-w.g,2)+Math.pow(y-w.b,2))<e){h=!0;break}h&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Za=require("@google/genai");async function wn(t,e,n=[],i={}){var a,s,r,o,l,d,p;try{if(!(t!=null&&t.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let v=0;v<n.length;v++){let b=n[v];if(!b.base64||!b.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(b.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!b.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${b.mimeType}`)}let c=new Za.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,b)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${b+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${n.length} images and prompt length: ${e.length}`);let y=await c.models.generateContent({model:g,contents:u}),h="",w=(r=(s=(a=y.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(w)for(let v of w)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(o=c.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var Qa=require("@google/genai");async function It(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Qa.GoogleGenAI({apiKey:t}),s=[{text:e}];n.length>0&&n.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),s.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let r=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:s});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!r.candidates||!r.candidates[0]||!r.candidates[0].content||!r.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of r.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let l=o.inlineData.data,d=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${d};base64,${l}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var xo=require("pixi.js");Je();xt();Z();var ts=require("pixi.js");var Eo=require("pixi.js");Z();function jo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function Oo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function Ro(t){return`
|
|
46
|
+
`,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let d=o.target.dataset.tab;d&&this.switchTab(d)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let n=window.__openAiEditor;if(typeof n!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,n(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var el={};da(el,{AspectClass:()=>Hn,GameObject:()=>ct,GameObjectManager:()=>Dt,Renderer:()=>lt,ResponsiveUISystem:()=>Ue,Transform:()=>ot,animateHandClick:()=>Ss,animatePanelEntrance:()=>xs,createBrushTexture:()=>Ps,createEndGamePanel:()=>ws,createHandTutorial:()=>Es,createThreeBase:()=>ys,createTutorialLabel:()=>Cs,getAspectClass:()=>Ht,getRegisteredFontIds:()=>vs,loadAsset:()=>Fn,loadCharacterFrames:()=>ks,registerFont:()=>bs,resolveFont:()=>ee,resolveFontWeight:()=>te,updateHandAnimation:()=>As});module.exports=Sr(el);var W=ge(require("three"),1);var he={};function bt(t,e,n=!1){he[t]||(he[t]=[]),he[t].push({fn:e,once:n})}function Zt(t,e){if(he[t]){if(!e){delete he[t];return}he[t]=he[t].filter(n=>n.fn!==e)}}function vt(t,...e){let n=he[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Zt(t,i.fn)}function B(t,e){bt(t,e,!0)}var _=null,V=[],Ie=null;function ha(t){_=t,V=[],Ie!==null&&(clearTimeout(Ie),Ie=null)}function ma(){var t,e,n;return{endpoint:(_==null?void 0:_.endpoint)||"",transport:(_==null?void 0:_.transport)||"beacon",batchSize:(t=_==null?void 0:_.batchSize)!=null?t:10,flushIntervalMs:(e=_==null?void 0:_.flushIntervalMs)!=null?e:300,maxQueue:(n=_==null?void 0:_.maxQueue)!=null?n:200,debug:!!(_!=null&&_.debug)}}async function ua(t,e,n,i){let a=JSON.stringify(e);if(n==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(s){i&&console.warn("[handler.telemetry] fetch failed",s)}}function Qt(t,e){let n=ma();if(e&&n.endpoint){if(V.push(t),V.length>n.maxQueue&&(V=V.slice(V.length-n.maxQueue)),V.length>=n.batchSize){ga();return}Ie===null&&(Ie=window.setTimeout(()=>{Ie=null,ga()},n.flushIntervalMs))}}async function ga(){let t=ma();if(!t.endpoint||V.length===0)return;let e=V.splice(0,t.batchSize);await ua(t.endpoint,{events:e},t.transport,t.debug),V.length>0&&await ua(t.endpoint,{events:V.splice(0,t.batchSize)},t.transport,t.debug)}function fa(t){return Math.max(0,Math.min(1,t))}function Er(t){let e=String(t!=null?t:"power2.out");if(e==="linear")return n=>n;if(e==="sine.inOut")return n=>.5-Math.cos(Math.PI*n)/2;if(e==="power2.out"||e==="easeOutQuad")return n=>1-(1-n)*(1-n);if(e.startsWith("back.out")){let n=e.match(/back\.out\(([\d.]+)\)/),i=n?Number(n[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return n=>1-(1-n)*(1-n)}function Ye(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Cr(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function ya(t,e,n){try{t[e]=n}catch{}}function Ar(t){let e=t==null?void 0:t.scale;if(!e)return null;let n=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:n,y:i}}function ba(t,e){let n=t==null?void 0:t.scale;if(n)try{typeof n.set=="function"?n.set(e.x,e.y):(typeof n.x=="number"&&(n.x=e.x),typeof n.y=="number"&&(n.y=e.y))}catch{}}function va(t,e){let n=Ar(t);if(!n)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:n.x,y:n.y},to:{x:i!=null?i:n.x,y:a!=null?a:n.y}}}function wa(){let t=new Set,e=new WeakMap,n=null,i=()=>{if(n!=null)return;n=requestAnimationFrame(()=>{n=null,o(),t.size>0&&i()})},a=p=>{var 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=Ye();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let y=p-u.startMs-u.delayMs;if(y<0)continue;let h=u.durationMs>0?y/u.durationMs:1,w=fa(h),v=u.repeat>=0?u.repeat+1:1,b=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let S=h-b;w=fa(S)}let m=u.ease(w);u.yoyo&&b%2===1&&(m=1-m);for(let S of u.props)ya(u.target,S.key,S.from+(S.to-S.from)*m);u.scaleFrom&&u.scaleTo&&ba(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*m,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*m});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){r(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var S;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),y=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((S=g==null?void 0:g.delayMsOverride)!=null?S:0)),h=Er(c.ease),w=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,b=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),m=[];for(let E of Object.keys(c)){if(b.has(E))continue;let C=c[E];typeof C=="number"&&m.push({key:E,from:Cr(p,E),to:C})}let f=va(p,c);return{target:p,startMs:Ye(),delayMs:y,durationMs:u,ease:h,props:m,scaleFrom:f.from,scaleTo:f.to,repeat:w,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>r(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ye())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ye(),y=Ye()-u;g.startMs+=y,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let y=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof y=="number"&&ya(p,u,y)}let g=va(p,c);g.to&&ba(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))r(g)},timeline(p={}){let c=[],g=0,u=!1,y=[],h=b=>{if(typeof b=="number")return Math.max(0,b*1e3);let m=typeof b=="string"?b.trim():"";return m.startsWith("+=")?g+Math.max(0,Number(m.slice(2))*1e3||0):m?Math.max(0,Number(m)*1e3||0):g},w=b=>{c.push(b);let m=Math.max(0,(typeof b.vars.duration=="number"?b.vars.duration:.5)*1e3);g=Math.max(g,b.atMs+m)},v={to(b,m,f){return w({kind:"to",target:b,vars:m,atMs:h(f)}),v},fromTo(b,m,f,S){return w({kind:"fromTo",target:b,vars:f,from:m,atMs:h(S)}),v},play(){var b,m;if(u)return v;u=!0,y=[];for(let f of c)f.kind==="fromTo"&&d.set(f.target,(b=f.from)!=null?b:{}),y.push(d.to(f.target,{...f.vars,delay:f.atMs/1e3+((m=f.vars.delay)!=null?m:0)}));return v},pause(){for(let b of y)b.pause();return v},kill(){for(let b of y)b.kill();y=[],u=!1}};return p.paused||v.play(),v}};return d}function xa(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=wa()}catch{}}var Sa={name:"handler-playable-sdk",version:"1.0.74",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && mkdir -p dist/cli/student-helper && cp src/cli/student-helper/*.mjs dist/cli/student-helper/ && chmod +x dist/cli/*.mjs dist/cli/student-helper/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs dist/cli/student-helper/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var G=0,Lr=G++,Ea=G++,Ca=G++,Aa=G++,Ta=G++,La=G++,ka=G++,Pa=G++,_a=G++,Ma=G++,Ia=G++,ja=G++,T=Lr;function Oa(){return T===Ea}function Ra(){return T===Ca}function za(){return T===Aa}function $a(){return T===Ta}function je(){return T===La}function Oe(){return T===ka}function Ha(){return T===Pa}function Da(){return T===_a}function Na(){return T===Ma}function en(){return T===Ia}function tn(){return T===ja}function Fa(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),T=Ea;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=Ca;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=Aa)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Ta)}catch{}else if(e==="mintegral")window.gameReady&&(T=La);else if(e==="tapjoy")window.TJ_API&&(T=ka);else if(e==="tiktok")window.openAppStore&&(T=Pa);else if(e==="smadex")try{window.smxTracking&&(T=_a)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=Ma)}catch{}else e==="vungle"?T=Ia:(t==="nucleo"||e==="nucleo")&&(T=ja)}var wt=ge(require("lottie-web"),1),Ba=wt.default;typeof window!="undefined"&&(window.lottie=wt.default,window.__baseLottie=wt.default);var kr=require("pixi.js");var nn=require("pixi.js");var Pr=null;function an(t){Pr=t}St();xt();var Xe=require("pixi.js");St();var Rr=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ln=Rr;if(typeof window!="undefined")try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);e!=null&&e.buildMode&&(ln=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${ln}`))}}catch{}function zr(t){var n,i,a,s,r;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(t);let e={center:{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};if(Array.isArray(t))return{x:(n=t[0])!=null?n:.5,y:(i=t[1])!=null?i:.5};if(t&&typeof t=="object"&&"x"in t&&"y"in t)return{x:(a=t.x)!=null?a:.5,y:(s=t.y)!=null?s:.5};if(typeof t=="string"){let o=t.trim().toLowerCase();return(r=e[o])!=null?r:{x:.5,y:.5}}return null}var fe=class{static async create(e,n,i){var l,d,p,c,g,u,y;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${ln}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Xe.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let s=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${s}, type: ${a.type}, path: ${a.path}`);let r=await Ce.load(e,a,i,s);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=r==null?void 0:r.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Xe.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=r==null?void 0:r.constructor)==null?void 0:g.name,r),r&&(((u=r.constructor)==null?void 0:u.name)==="Container"||r instanceof Xe.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],w=!1;for(let v of h)try{let b=await fetch(v);if(b.ok){o=await b.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(y=o==null?void 0:o.constructor)==null?void 0:y.name),w=!0;break}}catch{continue}w||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=r)}else o=r;else o=r,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform,n);return o}static applyTransform(e,n,i){var a,s,r,o;if(!(!n||!e)&&(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(s=n.position.y)!=null?s:0):"position"in e&&e.position&&e.position.set((r=n.position.x)!=null?r:0,(o=n.position.y)!=null?o:0)),n.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(n.scale):e.scale=n.scale),n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor)){let l=zr(n.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var 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=ge(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Dr);Je();var Ct=require("pixi.js");Je();var dn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Ke}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async s=>{var o;let r=this.registry.get(s);if(!r){console.warn("[Assets] No config found for object:",s);return}try{let l=await fe.create(s,r,this.app);this.instanceCache.set(s,l),console.log("[Assets] Loaded object:",s,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",s,l)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(s=>!this.instanceCache.has(s));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let n=this.registry.get(e);if(n){let i=await fe.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Fr=new dn,Br=new Proxy(Fr,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Je();var qr=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},Tt={scale:1,position:1},un=[];function Vr(t,e,n,i,a,s,r){un.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Wr(){un.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*le.scaleFactor;n(t,le.width,le.height,i,a,!0,!1)})}function pn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),le.width=t,le.height=e,le.scaleFactor=Math.min(t/le.designWidth,1.15),Tt.scale=le.scaleFactor,Tt.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Tt.scale.toFixed(3)}`),Wr()}var Qe={layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}};function Yr(t,e,n){let i=Qe[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Xr(){return Qe}var Kr={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function At(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function et(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:At(t[0],e.x),y:At(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:At(i.x,e.x),y:At(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Kr[i])!=null?n:e}return e}function gn(t,e,n,i={}){var u,y,h,w,v,b;let a=et(n),s=(u=i.inset)!=null?u:{},r=(y=i.padding)!=null?y:{x:0,y:0},o=((h=s.left)!=null?h:0)+r.x,l=((w=s.right)!=null?w:0)+r.x,d=((v=s.top)!=null?v:0)+r.y,p=((b=s.bottom)!=null?b:0)+r.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function hn(t,e,n,i={}){var h,w,v,b,m,f;let a=(h=i.inset)!=null?h:{},s=(w=i.padding)!=null?w:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((b=a.right)!=null?b:0)+s.x,l=((m=a.top)!=null?m:0)+s.y,d=((f=a.bottom)!=null?f:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=et(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),y=Math.min(Math.max(g.y,0),1);return{x:r+p*u,y:l+c*y}}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,n=()=>{let i=window.innerWidth,a=window.innerHeight;(i!==t||a!==e)&&(t=i,e=a,pn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),pn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Yr,window.getDebugConfig=Xr,window.copyConfig=oo,window.applyConfig=Ze,window.applyConfigForRatio=lo,window.positionAtBottom=Va,window.positionAtTop=Qr,window.positionAtCenter=eo,window.positionAtLeft=to,window.positionAtRight=no,window.positionAtBottomLeft=io,window.positionAtBottomRight=ao,window.positionAtTopLeft=so,window.positionAtTopRight=ro,window.applyPositionContract=Zr,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function Lt(t,e,n=0){return t*e+n}function kt(t,e,n=0){return t*(1-e)+n}function Pt(t,e,n=0){return t*e+n}function _t(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Jr(t,e){return t*e}function Zr(t,e,n,i){var r,o,l,d,p,c,g,u,y,h,w,v,b,m,f,S,E,C,P,I;let a=0,s=0;switch(i.type){case"top":a=U(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),s=Lt(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),s=kt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=Pt(e,i.percent,(h=(y=i.offset)==null?void 0:y.x)!=null?h:0),s=U(n,(v=(w=i.offset)==null?void 0:w.y)!=null?v:0);break;case"right":a=_t(e,i.percent,(m=(b=i.offset)==null?void 0:b.x)!=null?m:0),s=U(n,(S=(f=i.offset)==null?void 0:f.y)!=null?S:0);break;case"center":a=U(e,(C=(E=i.offset)==null?void 0:E.x)!=null?C:0),s=U(n,(I=(P=i.offset)==null?void 0:P.y)!=null?I:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function Va(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Jr(n,i),l=kt(n,i/2);ce(t,U(e),l);let d=s?a*le.scaleFactor:a;de(t,d),r&&!un.find(p=>p.element===t)&&Vr(t,Va,e,n,i,a,s)}function Qr(t,e,n,i=.1,a=1){ce(t,U(e),Lt(n,i)),de(t,a)}function eo(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function to(t,e,n,i=.1,a=1){ce(t,Pt(e,i),U(n)),de(t,a)}function no(t,e,n,i=.1,a=1){ce(t,_t(e,i),U(n)),de(t,a)}function io(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),kt(n,i)),de(t,s)}function ao(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),kt(n,i)),de(t,s)}function so(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),Lt(n,i)),de(t,s)}function ro(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),Lt(n,i)),de(t,s)}function ce(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ae={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function oo(t){return t&&Ae[t]?JSON.parse(JSON.stringify(Ae[t])):JSON.parse(JSON.stringify(Qe))}function Ze(t){Object.keys(t).forEach(e=>{let n=e;Qe[n]&&t[n]&&Object.assign(Qe[n],t[n])}),console.log("Config applied:",t)}function lo(t,e){let n=t/e;n>1.6?(Ze(Ae.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Ze(Ae.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Ze(Ae.square),console.log("Applied SQUARE config for ratio:",n)):(Ze(Ae.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ae,t.resolveAnchorVec2=t.resolveAnchorVec2||et,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||gn,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||hn}yn();function M(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Wc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:M(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:M(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:M(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:M(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:M(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:M(360,780)}],Yc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:M(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:M(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:M(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:M(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:M(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:M(412,915)}],Xc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:M(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:M(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:M(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:M(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:M(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:M(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:M(768,1024),mraidScale:.7}];var Kc=[...Ka];var yo=Ka[0];Z();function bo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function vo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function wo(t){return await new Promise(e=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth||n.width,height:n.naturalHeight||n.height}),n.onerror=()=>e(null),n.src=t})}async function vn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await bo(a),r=await wo(s),o=vo(s);return console.log("[ImageUtils] Success resolution:",r==null?void 0:r.width,"x",r==null?void 0:r.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:s,width:(e=r==null?void 0:r.width)!=null?e:0,height:(n=r==null?void 0:r.height)!=null?n:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function 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],y=r[c+2],h=!1;for(let w of l)if(Math.sqrt(Math.pow(g-w.r,2)+Math.pow(u-w.g,2)+Math.pow(y-w.b,2))<e){h=!0;break}h&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Za=require("@google/genai");async function wn(t,e,n=[],i={}){var a,s,r,o,l,d,p;try{if(!(t!=null&&t.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let v=0;v<n.length;v++){let b=n[v];if(!b.base64||!b.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(b.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!b.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${b.mimeType}`)}let c=new Za.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,b)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${b+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${n.length} images and prompt length: ${e.length}`);let y=await c.models.generateContent({model:g,contents:u}),h="",w=(r=(s=(a=y.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(w)for(let v of w)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(o=c.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var Qa=require("@google/genai");async function It(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Qa.GoogleGenAI({apiKey:t}),s=[{text:e}];n.length>0&&n.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),s.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let r=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:s});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!r.candidates||!r.candidates[0]||!r.candidates[0].content||!r.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of r.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let l=o.inlineData.data,d=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${d};base64,${l}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var xo=require("pixi.js");Je();xt();Z();var ts=require("pixi.js");var Eo=require("pixi.js");Z();function jo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function Oo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function Ro(t){return`
|
|
47
47
|
Analyze these screenshots of a brand or game and extract its "Brand DNA".
|
|
48
48
|
|
|
49
49
|
Provide a concise summary (2-3 sentences) covering:
|