handler-playable-sdk 1.0.54 → 1.0.55
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-ZUU5X4IK.js → chunk-YP26RQ4X.js} +2 -2
- 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 +190 -190
- package/dist/index.js +1 -1
- package/dist/pixi/index.cjs +16 -16
- 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 a0_0x2cd2(){var _0x342980=['WOlcJ8oXDSoBj8ouWOxdLJa3','zGLvCSoSreL5ih7dNmoGySkq','WQ3cPCk9zYO','W7qdq8oZW4NdLZ7cRXLFW5G','x8ottW','W4pdTeGxW40','WQVdT2G2ha','gcerW7xdNq','u8kWW53cH8oOWRVcNSok','amo0WRqSW55JBCkrpSo5Cmkh','WR7dISo6W6RcJSoeWOv7W4G','dJFcPdS9e8kPzc3dPGPRga','W4FdNI3cVK4faCkaWR/cQJzB','hJSHW7xdGa','tSkNW5/cUCkAh8oCW7FdN8oCgCoUWRdcTq','WPpcSa1kWOlcRSoWECobW7lcOSoZ','wZRcUmogEG','oSkjW548EW','DahdQCoeiW','kGiwWOVcPgC0WRFcKL4oWPS','W7WdW4BcG8kbesBcOXxdP2NcHNm','sXmGW6el','stP8WONcMCoajmo5iSo2mSoAW4q','stP9WOZcNSodiSo/imo2nSo1W6u','WRbcW6VdKLZcTCkTWR1YW4nW','WRjTpJOchX3cPG','WPGLWO5CWOe','yavDemkznIKoka'];a0_0x2cd2=function(){return _0x342980;};return a0_0x2cd2();}(function(_0x17e398,_0x24fc16){var a0_0x30ac9d={_0x1d500c:0x219,_0x538971:'q6sB',_0x14a2b3:0x22a,_0x31386c:0x227,_0x499bd6:0x22f,_0x38e245:'hS54',_0x5490e0:0x226,_0x4f3708:0x22c,_0x4eb141:0x221,_0x15647c:'PHbX',_0x38e591:0x212,_0x2184ae:'%$u^',_0x223480:0x213,_0x32941e:0x21c,_0x2e1247:'wy66',_0x406cdc:0x175,_0x42fc00:0x17d,_0x5d3389:0x188,_0x204e83:0x179,_0x2d7b70:'qlS6',_0x486149:0xd9,_0x262e75:'5RI[',_0x2e07eb:0xd7,_0x3c26d3:0xde,_0x7a4472:0xd4,_0x161918:0x220,_0x1c85bf:0x223,_0x55f44b:0x21e,_0x453842:0x21b},a0_0x308e90={_0x6b82:0x179},a0_0x2fd07c={_0x4b7145:0x2c7};function _0xb3a34d(_0x23aa0a,_0x41d1ea,_0x2105a2,_0x2fe301,_0x57873b){return a0_0x3a8f(_0x57873b- -a0_0x2fd07c._0x4b7145,_0x2105a2);}function _0x539965(_0x38565a,_0x50eea3,_0xac6814,_0x14a5b1,_0x153564){return a0_0x3a8f(_0xac6814- -a0_0x308e90._0x6b82,_0x50eea3);}function _0x24b09c(_0x50d61c,_0x311bcc,_0x557dca,_0x38598,_0x512f72){return a0_0x3a8f(_0x557dca-0xeb,_0x50d61c);}var _0x302b33=_0x17e398();while(!![]){try{var _0x5b5845=-parseInt(_0xb3a34d(-a0_0x30ac9d._0x1d500c,-0x221,a0_0x30ac9d._0x538971,-a0_0x30ac9d._0x14a2b3,-a0_0x30ac9d._0x31386c))/(-0x1862+0x12*0x6+0x4cb*0x5)*(parseInt(_0xb3a34d(-0x235,-a0_0x30ac9d._0x499bd6,a0_0x30ac9d._0x38e245,-a0_0x30ac9d._0x5490e0,-a0_0x30ac9d._0x4f3708))/(-0x4ff*-0x2+0xb1d+-0x1519))+-parseInt(_0xb3a34d(-a0_0x30ac9d._0x4eb141,-a0_0x30ac9d._0x499bd6,a0_0x30ac9d._0x15647c,-0x21e,-a0_0x30ac9d._0x5490e0))/(-0x66b+0x26e6+0x2*-0x103c)+parseInt(_0xb3a34d(-a0_0x30ac9d._0x38e591,-0x213,a0_0x30ac9d._0x2184ae,-a0_0x30ac9d._0x223480,-a0_0x30ac9d._0x32941e))/(-0x25a4+0x1c73+0x935)+-parseInt(_0x24b09c(a0_0x30ac9d._0x2e1247,a0_0x30ac9d._0x406cdc,a0_0x30ac9d._0x42fc00,a0_0x30ac9d._0x5d3389,a0_0x30ac9d._0x204e83))/(0x26f0+-0x12b0+-0x143b)+parseInt(_0xb3a34d(-0x22b,-0x224,a0_0x30ac9d._0x2d7b70,-0x22d,-a0_0x30ac9d._0x499bd6))/(0x108a+0x1290+0x1c1*-0x14)*(-parseInt(_0x539965(-a0_0x30ac9d._0x486149,a0_0x30ac9d._0x262e75,-a0_0x30ac9d._0x2e07eb,-a0_0x30ac9d._0x3c26d3,-a0_0x30ac9d._0x7a4472))/(0x1308+0x3*0x5a4+-0x23ed))+-parseInt(_0xb3a34d(-a0_0x30ac9d._0x161918,-a0_0x30ac9d._0x1c85bf,'lV*5',-a0_0x30ac9d._0x55f44b,-a0_0x30ac9d._0x453842))/(-0x2369+-0x20ec+0x197*0x2b)+parseInt(_0xb3a34d(-0x227,-0x22f,']utD',-0x224,-a0_0x30ac9d._0x4eb141))/(0x17bf+0x189*-0x1+-0x162d);if(_0x5b5845===_0x24fc16)break;else _0x302b33['push'](_0x302b33['shift']());}catch(_0x16b59c){_0x302b33['push'](_0x302b33['shift']());}}}(a0_0x2cd2,0x2373d*-0x3+-0x20b*-0x1f9+-0x2f*-0x21b0));var a0_0xd72703=(function(){var a0_0x58f9fa={_0x4d4c6e:0x162,_0x51b58d:0x155,_0x5801e1:'&3pd',_0x41b86c:0x156,_0x3a9608:0x15b},_0x328de8=!![];return function(_0x2bea3f,_0x291fb4){var _0x2dfbd8=_0x328de8?function(){var a0_0x291581={_0x198c2c:0x1f8};function _0x597c5e(_0x173d17,_0x1bf265,_0x78e9aa,_0x482e74,_0x34ffbe){return a0_0x3a8f(_0x34ffbe- -a0_0x291581._0x198c2c,_0x78e9aa);}if(_0x291fb4){var _0x120cd5=_0x291fb4[_0x597c5e(-a0_0x58f9fa._0x4d4c6e,-a0_0x58f9fa._0x51b58d,a0_0x58f9fa._0x5801e1,-a0_0x58f9fa._0x41b86c,-a0_0x58f9fa._0x3a9608)](_0x2bea3f,arguments);return _0x291fb4=null,_0x120cd5;}}:function(){};return _0x328de8=![],_0x2dfbd8;};}()),a0_0x211287=a0_0xd72703(this,function(){var a0_0x5bfad2={_0x5ec86e:0x387,_0x51edf3:0x38e,_0x3f6096:0x38f,_0x474dad:0x383,_0xc40b77:0x380,_0x2f5e53:'h]se',_0x31fde2:0x380,_0x59a6f6:0x9d,_0x2118b8:0xac,_0x3f4b64:0xab,_0x446e6a:0xa0,_0x2461f3:0x390,_0x548b51:0x38b,_0x1e065c:0x38e,_0x3b29e8:'J2Fy',_0x370632:0x398,_0x4bb206:0x398,_0x411a7c:0x393,_0x4cc982:'DNQy',_0x57c121:0x39c,_0x205831:0x3a2,_0x2df587:0x39e,_0x37e093:'EZ8i',_0x4e97e5:0x393,_0x10a04b:'DgUz',_0x22d661:'3HLu',_0x6fcc64:0xa4,_0x448846:0x9d,_0x252f0a:0x387,_0x32f39d:0x378,_0x45ccd2:0x37b,_0x4d3ea5:'SE0r',_0x3a4306:0x37c,_0x33f503:0x383,_0x3c6bf0:0x37f,_0x442ff2:'DgUz',_0x30c31d:0x385},a0_0x5b8114={_0x48d877:0x2e6},a0_0x4e178e={_0x15707c:0x2fa},_0x1a2a04={};function _0x12bac6(_0xd52381,_0x599d60,_0x1417d2,_0x1cc5a1,_0x38cc5b){return a0_0x3a8f(_0x1417d2-a0_0x4e178e._0x15707c,_0x38cc5b);}_0x1a2a04[_0x3a407d(a0_0x5bfad2._0x5ec86e,0x381,a0_0x5bfad2._0x51edf3,'cJ3C',a0_0x5bfad2._0x3f6096)]=_0x3a407d(0x379,a0_0x5bfad2._0x474dad,a0_0x5bfad2._0xc40b77,a0_0x5bfad2._0x2f5e53,a0_0x5bfad2._0x31fde2)+_0x2cef38(a0_0x5bfad2._0x59a6f6,'fCs[',a0_0x5bfad2._0x2118b8,a0_0x5bfad2._0x3f4b64,a0_0x5bfad2._0x446e6a)+'+$';var _0xd9788d=_0x1a2a04;function _0x3a407d(_0x6db7eb,_0x3c5b13,_0xf35f39,_0x4a00fc,_0x9993d0){return a0_0x3a8f(_0x9993d0-a0_0x5b8114._0x48d877,_0x4a00fc);}function _0x2cef38(_0x4bc129,_0x3a8944,_0x44ce73,_0x1ec44c,_0x26d890){return a0_0x3a8f(_0x1ec44c-0x1,_0x3a8944);}return a0_0x211287[_0x12bac6(a0_0x5bfad2._0x2461f3,a0_0x5bfad2._0x2461f3,a0_0x5bfad2._0x548b51,a0_0x5bfad2._0x1e065c,a0_0x5bfad2._0x3b29e8)+'ing']()[_0x12bac6(a0_0x5bfad2._0x370632,a0_0x5bfad2._0x1e065c,a0_0x5bfad2._0x4bb206,a0_0x5bfad2._0x411a7c,a0_0x5bfad2._0x4cc982)+'h']('(((.+'+_0x12bac6(a0_0x5bfad2._0x57c121,0x39d,a0_0x5bfad2._0x205831,a0_0x5bfad2._0x2df587,a0_0x5bfad2._0x37e093)+'+$')[_0x3a407d(a0_0x5bfad2._0x474dad,a0_0x5bfad2._0x4e97e5,0x37e,a0_0x5bfad2._0x10a04b,a0_0x5bfad2._0x548b51)+_0x2cef38(0x98,a0_0x5bfad2._0x22d661,a0_0x5bfad2._0x6fcc64,a0_0x5bfad2._0x448846,0xa4)]()[_0x3a407d(a0_0x5bfad2._0x252f0a,a0_0x5bfad2._0x32f39d,a0_0x5bfad2._0x45ccd2,a0_0x5bfad2._0x4d3ea5,a0_0x5bfad2._0x3a4306)+_0x3a407d(a0_0x5bfad2._0x33f503,a0_0x5bfad2._0x45ccd2,a0_0x5bfad2._0x3c6bf0,a0_0x5bfad2._0x442ff2,a0_0x5bfad2._0x30c31d)+'r'](a0_0x211287)['searc'+'h'](_0xd9788d['uytSw']);});a0_0x211287();import{A as a0_0x3f20e0,B as a0_0x4d514e,C as a0_0x1a195c,D as a0_0xcee7d3,b as a0_0x3a7ef6,c as a0_0x1f8ddd,d as a0_0x51eef6,e as a0_0x37444d,f as a0_0x563b48,g as a0_0x31bff2,h as a0_0x33f180,i as a0_0x54ef4c,j as a0_0x447b2b,k as a0_0x3b06a6,l as a0_0x676c03,m as a0_0x51be87,n as a0_0x68057c,o as a0_0x5692ba,p as a0_0x50c1d5,q as a0_0x90a216,r as a0_0x194633,s as a0_0x45fcce,t as a0_0x3f90fc,u as a0_0x273a73,v as a0_0x267149,w as a0_0x145dbe,x as a0_0x2131f2,y as a0_0xb22e07,z as a0_0x3aafa2}from'../chunk-ZUU5X4IK.js';import{a as a0_0xa301b,b as a0_0x2778dc,c as a0_0x1525ce,d as a0_0x3ae354,e as a0_0x33897b}from'../chunk-I5OOVR5U.js';function a0_0x3a8f(_0x5268fb,_0x2882a5){_0x5268fb=_0x5268fb-(-0x4*-0x5d9+-0x33+-0x16a0);var _0x22ca8a=a0_0x2cd2();var _0x1ce84a=_0x22ca8a[_0x5268fb];if(a0_0x3a8f['CQRAmY']===undefined){var _0x5f36e4=function(_0x43e03c){var _0x4657fe='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x28d387='',_0x1c408a='',_0x3f4f87=_0x28d387+_0x5f36e4;for(var _0x4a0cb1=0x8e8+0x4*0x81a+-0x4*0xa54,_0x46eaa1,_0x445782,_0x1d3ca9=-0xdcd*-0x1+0x26*0xf1+-0x3193;_0x445782=_0x43e03c['charAt'](_0x1d3ca9++);~_0x445782&&(_0x46eaa1=_0x4a0cb1%(0x29*-0xb5+-0x1*-0x17ba+-0x547*-0x1)?_0x46eaa1*(0x1836*0x1+-0xd3e+-0x1c*0x62)+_0x445782:_0x445782,_0x4a0cb1++%(0x2676+0x2695*0x1+-0x4d07))?_0x28d387+=_0x3f4f87['charCodeAt'](_0x1d3ca9+(-0x18ef+-0x25f0+0x3ee9))-(0x23dc+0x14*-0x183+-0xb*0x82)!==0x8ac+-0x1b*0x3+0x3*-0x2c9?String['fromCharCode'](0xff1+-0xf01+-0x3*-0x5&_0x46eaa1>>(-(-0x252+0x1ef2+-0x42*0x6f)*_0x4a0cb1&-0x2ea*-0xb+-0xf82+-0x1086)):_0x4a0cb1:0x87+-0x256a+0x24e3){_0x445782=_0x4657fe['indexOf'](_0x445782);}for(var _0x5bba69=-0x1*-0x1417+-0x1a3+-0x2*0x93a,_0x3646c7=_0x28d387['length'];_0x5bba69<_0x3646c7;_0x5bba69++){_0x1c408a+='%'+('00'+_0x28d387['charCodeAt'](_0x5bba69)['toString'](-0x1351+0x1*-0x85+0x13e6))['slice'](-(-0x7ec+-0x2*0x149+0xa80));}return decodeURIComponent(_0x1c408a);};var _0x31e816=function(_0x1861ab,_0x478c02){var _0x781c32=[],_0x60489e=0xca6+0x1847+-0x17*0x19b,_0x1f2563,_0x561c4c='';_0x1861ab=_0x5f36e4(_0x1861ab);var _0x47dcc3;for(_0x47dcc3=0x1*0x1c0f+0x636+-0x2245;_0x47dcc3<0x1109+0x94a+-0x1953;_0x47dcc3++){_0x781c32[_0x47dcc3]=_0x47dcc3;}for(_0x47dcc3=0x1fdc+0x1b18+0x1c*-0x21b;_0x47dcc3<-0x6ee+-0x793+0xf81;_0x47dcc3++){_0x60489e=(_0x60489e+_0x781c32[_0x47dcc3]+_0x478c02['charCodeAt'](_0x47dcc3%_0x478c02['length']))%(0x903+-0x268d+0x1*0x1e8a),_0x1f2563=_0x781c32[_0x47dcc3],_0x781c32[_0x47dcc3]=_0x781c32[_0x60489e],_0x781c32[_0x60489e]=_0x1f2563;}_0x47dcc3=0x259+-0x317+0xbe,_0x60489e=-0x11a3+-0x1bf0+0x2d93;for(var _0x4cabbe=0x308+-0x23d3+-0x5*-0x68f;_0x4cabbe<_0x1861ab['length'];_0x4cabbe++){_0x47dcc3=(_0x47dcc3+(-0x23b6+0xec*-0x28+0x4897))%(-0x113d+0x1*0xe09+0x21a*0x2),_0x60489e=(_0x60489e+_0x781c32[_0x47dcc3])%(0x1*-0xd46+0xd60+0xe6),_0x1f2563=_0x781c32[_0x47dcc3],_0x781c32[_0x47dcc3]=_0x781c32[_0x60489e],_0x781c32[_0x60489e]=_0x1f2563,_0x561c4c+=String['fromCharCode'](_0x1861ab['charCodeAt'](_0x4cabbe)^_0x781c32[(_0x781c32[_0x47dcc3]+_0x781c32[_0x60489e])%(-0xb*0x6d+-0x6*-0x2a5+0x365*-0x3)]);}return _0x561c4c;};a0_0x3a8f['SPpwpB']=_0x31e816,a0_0x3a8f['zQekWZ']={},a0_0x3a8f['CQRAmY']=!![];}var _0x18e18b=_0x22ca8a[-0x14bb+-0x2d6*-0x7+-0xf*-0xf],_0x1dc26d=_0x5268fb+_0x18e18b,_0x1643de=a0_0x3a8f['zQekWZ'][_0x1dc26d];if(!_0x1643de){if(a0_0x3a8f['yROTWd']===undefined){var _0x2dd0ce=function(_0x2f2ec0){this['vhGMLs']=_0x2f2ec0,this['hVUuft']=[0x1a08+0x5*0x3a1+-0x2c2c,0x48c*-0x3+0x7*-0x4e9+0x1*0x3003,-0x11*0xc+-0x2374*0x1+-0x20*-0x122],this['MrDYoz']=function(){return'newState';},this['ZJWDYv']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['phzwhN']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x2dd0ce['prototype']['bdzXgR']=function(){var _0x4419a6=new RegExp(this['ZJWDYv']+this['phzwhN']),_0x5408cf=_0x4419a6['test'](this['MrDYoz']['toString']())?--this['hVUuft'][-0xd*-0x1e7+0x1e51+-0x370b]:--this['hVUuft'][0x12*0x6+0x21a1*-0x1+0x1*0x2135];return this['KLKzqX'](_0x5408cf);},_0x2dd0ce['prototype']['KLKzqX']=function(_0x25f018){if(!Boolean(~_0x25f018))return _0x25f018;return this['quMdbX'](this['vhGMLs']);},_0x2dd0ce['prototype']['quMdbX']=function(_0x344ed7){for(var _0x4a9e5a=0x23cb+-0x19a0+-0xa2b,_0x58b6f8=this['hVUuft']['length'];_0x4a9e5a<_0x58b6f8;_0x4a9e5a++){this['hVUuft']['push'](Math['round'](Math['random']())),_0x58b6f8=this['hVUuft']['length'];}return _0x344ed7(this['hVUuft'][0x26e6+0x3*-0x426+-0x1a74]);},new _0x2dd0ce(a0_0x3a8f)['bdzXgR'](),a0_0x3a8f['yROTWd']=!![];}_0x1ce84a=a0_0x3a8f['SPpwpB'](_0x1ce84a,_0x2882a5),a0_0x3a8f['zQekWZ'][_0x1dc26d]=_0x1ce84a;}else _0x1ce84a=_0x1643de;return _0x1ce84a;}import'../chunk-PW2FGMCO.js';import'../chunk-HVKF2KYL.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0xa301b as AssetCache,a0_0x1525ce as AssetLoader,a0_0x273a73 as AssetSystem,a0_0x3ae354 as AssetTextures,a0_0x45fcce as Assets,a0_0x5692ba as BaseSystem,a0_0x68057c as GameEngine,a0_0x37444d as GameObject,a0_0x563b48 as GameObjectManager,a0_0x51be87 as ObjectFactory,a0_0x51eef6 as Renderer,a0_0x50c1d5 as RuntimeObjectRegistry,a0_0x1f8ddd as Transform,a0_0x4d514e as applyScreenAnchor,a0_0x90a216 as basePixi,a0_0x145dbe as clearResponsiveElements,a0_0x3a7ef6 as createPixiBase,a0_0x447b2b as getRegisteredFontIds,a0_0x267149 as globalResponsiveMultipliers,a0_0x33897b as initAssetTextures,a0_0x3f90fc as initAssets,a0_0x1a195c as layout,a0_0x676c03 as playLottieOverlay,a0_0x54ef4c as registerFont,a0_0x2778dc as registerType,a0_0xb22e07 as resolveAnchorVec2,a0_0x31bff2 as resolveFont,a0_0x33f180 as resolveFontWeight,a0_0x3aafa2 as resolveScreenAnchorPoint,a0_0x3f20e0 as resolveScreenRatioPoint,a0_0xcee7d3 as runInitSequence,a0_0x3b06a6 as setLottieInstance,a0_0x194633 as spawnSceneFromConfig,a0_0x2131f2 as updateScreenState};
|
|
1
|
+
(function(_0x2972e0,_0xe8f066){var a0_0x10d3d2={_0x5764d0:0x47d,_0x46f62d:0x462,_0x17312d:0x471,_0x4038b5:'j!08',_0xaae18f:0x477,_0x2f30f9:0x24a,_0xdf2259:'zw9E',_0x3f68e4:0x254,_0x2d6320:0x25c,_0x54e464:0x24c,_0x41d60f:0x250,_0x2d5a95:'xym7',_0x48faa9:0x243,_0x4ccc55:0x252,_0x1fd68a:0x243,_0x185575:0x23c,_0x124444:0x230,_0x313f5a:'2T9g',_0x5abbb4:0x1eb,_0x536b17:0x1f7,_0x3bd929:0x1ef,_0x3d7e39:'IeN@',_0x37f78:0x1ec,_0x238f9b:0x216,_0x407361:0x215,_0xaa2a54:0x466,_0x2c71a1:0x473,_0x2a9db0:'b$KQ',_0x5a4f30:0x47e,_0x2165c2:0x44d,_0xb2acc2:0x46a,_0x859a10:0x45a,_0x24eac2:0x468,_0x16f35c:0x469,_0x4e0a9a:0x21a,_0x598a5b:0x1fd},a0_0x2b7ed5={_0xc9a46:0x2e9};function _0x1d33c2(_0x59ecdf,_0x3fd5e0,_0x11f5e,_0x3f57ad,_0x25ae54){return a0_0x5c65(_0x25ae54-0xc1,_0x3fd5e0);}function _0x2799ec(_0x1e24d0,_0x2ca622,_0x22235b,_0x3bbf97,_0x133cf8){return a0_0x5c65(_0x22235b-a0_0x2b7ed5._0xc9a46,_0x3bbf97);}var _0x144c33=_0x2972e0();function _0x1431c2(_0x1ff2fb,_0x14264c,_0x484c34,_0x2ff726,_0x293fa6){return a0_0x5c65(_0x1ff2fb- -0x389,_0x484c34);}while(!![]){try{var _0x201519=parseInt(_0x2799ec(a0_0x10d3d2._0x5764d0,a0_0x10d3d2._0x46f62d,a0_0x10d3d2._0x17312d,a0_0x10d3d2._0x4038b5,a0_0x10d3d2._0xaae18f))/(0x3e*0x61+0x1dd6+-0x3553)+-parseInt(_0x1d33c2(a0_0x10d3d2._0x2f30f9,a0_0x10d3d2._0xdf2259,a0_0x10d3d2._0x3f68e4,a0_0x10d3d2._0x2d6320,a0_0x10d3d2._0x54e464))/(0x1f1b+-0x8*0x1de+-0x1029)+parseInt(_0x1d33c2(a0_0x10d3d2._0x41d60f,a0_0x10d3d2._0x2d5a95,0x246,a0_0x10d3d2._0x48faa9,a0_0x10d3d2._0x4ccc55))/(-0x5d8+-0xb43+0x111e)*(parseInt(_0x1d33c2(a0_0x10d3d2._0x1fd68a,'q!m9',a0_0x10d3d2._0x185575,a0_0x10d3d2._0x124444,0x23c))/(-0x1187+0x565+0xc26))+parseInt(_0x1431c2(-0x1fa,-0x1ee,a0_0x10d3d2._0x313f5a,-0x1f2,-a0_0x10d3d2._0x5abbb4))/(0x6a8+0x17*-0x150+0x178d)+-parseInt(_0x1431c2(-a0_0x10d3d2._0x536b17,-a0_0x10d3d2._0x3bd929,a0_0x10d3d2._0x3d7e39,-0x205,-a0_0x10d3d2._0x37f78))/(0x1*-0xb0f+-0x938+-0x144d*-0x1)*(parseInt(_0x1431c2(-a0_0x10d3d2._0x238f9b,-a0_0x10d3d2._0x407361,'z0Bf',-0x211,-0x21a))/(-0x7*-0x2fd+-0x1781+0x29d))+parseInt(_0x2799ec(0x467,a0_0x10d3d2._0xaa2a54,a0_0x10d3d2._0x2c71a1,a0_0x10d3d2._0x2a9db0,a0_0x10d3d2._0x5a4f30))/(0xbcf*0x1+0x9*0x333+0x2892*-0x1)*(-parseInt(_0x2799ec(a0_0x10d3d2._0x2165c2,a0_0x10d3d2._0xb2acc2,a0_0x10d3d2._0x859a10,'gSvP',a0_0x10d3d2._0x24eac2))/(-0x67e+-0x241f*0x1+0x2aa6))+parseInt(_0x2799ec(a0_0x10d3d2._0x16f35c,0x469,0x46f,'&LY3',0x461))/(-0x5*-0x26c+-0x2a7+-0x96b)*(parseInt(_0x1431c2(-0x20b,-a0_0x10d3d2._0x4e0a9a,'t]EC',-a0_0x10d3d2._0x598a5b,-0x203))/(-0xd40+0x16fe+0x9b3*-0x1));if(_0x201519===_0xe8f066)break;else _0x144c33['push'](_0x144c33['shift']());}catch(_0x2f4824){_0x144c33['push'](_0x144c33['shift']());}}}(a0_0x2a8f,-0x4639*0x3+-0x40421*-0x1+0xa89ab));var a0_0x175b53=(function(){var _0x4c5b29=!![];return function(_0x28c352,_0x120d4f){var _0x220c85=_0x4c5b29?function(){if(_0x120d4f){var _0xbeeb88=_0x120d4f['apply'](_0x28c352,arguments);return _0x120d4f=null,_0xbeeb88;}}:function(){};return _0x4c5b29=![],_0x220c85;};}()),a0_0x21675a=a0_0x175b53(this,function(){var a0_0x529c65={_0x1b2765:0x439,_0xbc84a1:0x43e,_0x543604:'xym7',_0x4398ee:0x44b,_0x34208f:0xfc,_0xd64538:0xec,_0x573b5b:'DqRx',_0x4942d4:0xdf,_0x2060c4:0xd5,_0xcf00f5:'YW8e',_0x17b1c0:0x1bd,_0xc80dd6:'IeN@',_0x483d3a:0x1b8,_0x371805:0xf8,_0x3939e1:0xf8,_0xb0c562:0xe9,_0x1e0901:')O)Z',_0xb32038:0xe8,_0x4c0c49:'Kyt7',_0x3bf49e:0x1b3,_0x407af6:0x1b2,_0x45dbaf:0x445,_0x1a372c:0x45b,_0x1b761f:'&LY3',_0x5b67c5:0x440,_0x13613f:0x456,_0x2fcbb6:'nH56',_0xd4521d:0x43a,_0x1497d8:0x1ba,_0x387ed7:0x1c7,_0x285c60:0x45c,_0x14b9ec:0x452,_0x216ad8:'xym7',_0x546783:0x44f,_0x50838f:0x1d9,_0x3a6880:'!%6$',_0x2c5c49:0x1c5,_0x1ff82a:0x1c9,_0x5cc49d:0x44c,_0x4216b5:')q1R',_0x36f953:0x449},a0_0x2f9362={_0x2773c7:0x2c9};function _0x22ce6d(_0x23bdeb,_0x5325c9,_0x4e545e,_0x1c79ff,_0x45d255){return a0_0x5c65(_0x45d255-0x39,_0x4e545e);}var _0x52fe4f={};_0x52fe4f[_0x1a757(a0_0x529c65._0x1b2765,a0_0x529c65._0xbc84a1,0x437,a0_0x529c65._0x543604,a0_0x529c65._0x4398ee)]=_0x446af8(-a0_0x529c65._0x34208f,-0xe4,-0xde,-a0_0x529c65._0xd64538,a0_0x529c65._0x573b5b)+_0x446af8(-a0_0x529c65._0x4942d4,-0xe3,-a0_0x529c65._0x2060c4,-a0_0x529c65._0x2060c4,a0_0x529c65._0xcf00f5)+'+$';var _0x350c33=_0x52fe4f;function _0x446af8(_0x27fbcb,_0x1d8211,_0x994ecc,_0x2adf95,_0x3ef43e){return a0_0x5c65(_0x2adf95- -0x262,_0x3ef43e);}function _0x1a757(_0x317e60,_0x2918f7,_0x19285c,_0x430de9,_0x2f0e0e){return a0_0x5c65(_0x2918f7-a0_0x2f9362._0x2773c7,_0x430de9);}return a0_0x21675a[_0x22ce6d(a0_0x529c65._0x17b1c0,0x1b6,a0_0x529c65._0xc80dd6,0x1c3,a0_0x529c65._0x483d3a)+_0x446af8(-a0_0x529c65._0x371805,-a0_0x529c65._0x3939e1,-a0_0x529c65._0xd64538,-a0_0x529c65._0xb0c562,a0_0x529c65._0x1e0901)]()[_0x446af8(-0xe0,-0xed,-0xf7,-a0_0x529c65._0xb32038,a0_0x529c65._0x4c0c49)+'h'](_0x350c33[_0x22ce6d(0x1ca,a0_0x529c65._0x3bf49e,'3f#E',a0_0x529c65._0x407af6,0x1bd)])[_0x1a757(a0_0x529c65._0x45dbaf,0x450,a0_0x529c65._0x1a372c,a0_0x529c65._0x1b761f,a0_0x529c65._0x5b67c5)+_0x1a757(a0_0x529c65._0x13613f,a0_0x529c65._0x4398ee,a0_0x529c65._0x45dbaf,a0_0x529c65._0x2fcbb6,a0_0x529c65._0xd4521d)]()[_0x22ce6d(a0_0x529c65._0x1497d8,a0_0x529c65._0x387ed7,'7(T0',a0_0x529c65._0x387ed7,0x1c5)+'ructo'+'r'](a0_0x21675a)[_0x1a757(a0_0x529c65._0x285c60,0x44c,a0_0x529c65._0x14b9ec,a0_0x529c65._0x216ad8,a0_0x529c65._0x546783)+'h'](_0x22ce6d(a0_0x529c65._0x50838f,0x1c6,a0_0x529c65._0x3a6880,a0_0x529c65._0x2c5c49,a0_0x529c65._0x1ff82a)+_0x1a757(a0_0x529c65._0x4398ee,0x44e,a0_0x529c65._0x5cc49d,a0_0x529c65._0x4216b5,a0_0x529c65._0x36f953)+'+$');});a0_0x21675a();function a0_0x5c65(_0xbb48fe,_0x1a4bdb){_0xbb48fe=_0xbb48fe-(-0x17*-0xfb+0x174b+-0x2c67);var _0x364657=a0_0x2a8f();var _0x284a77=_0x364657[_0xbb48fe];if(a0_0x5c65['DdrILp']===undefined){var _0xdcc346=function(_0x5d88c2){var _0x3da9a8='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x137234='',_0x2230e2='',_0x247001=_0x137234+_0xdcc346;for(var _0x449e15=-0x61b*-0x6+0x17*0xe6+0x1*-0x394c,_0x395c91,_0x294f55,_0x598c0c=-0x1*0x949+0xdd6+-0xe9*0x5;_0x294f55=_0x5d88c2['charAt'](_0x598c0c++);~_0x294f55&&(_0x395c91=_0x449e15%(-0x2*-0x6e+0xedc+-0x192*0xa)?_0x395c91*(-0x2589+0xe1*-0x1a+0x3ca3)+_0x294f55:_0x294f55,_0x449e15++%(0x1c*-0x73+-0x27*0x4a+0x41*0x5e))?_0x137234+=_0x247001['charCodeAt'](_0x598c0c+(-0x34e+-0x6e4+0xa3c))-(-0x2fc*-0x7+0x1*-0x134f+-0x18b)!==-0x2*-0x933+0x13*0x1fd+-0x382d?String['fromCharCode'](0x97d*-0x3+-0x2*0xa36+0x31e2&_0x395c91>>(-(0x1d04+-0x23d+-0x1ac5)*_0x449e15&-0x20*0xbb+-0x1e48+0x35ae)):_0x449e15:-0xb*-0x386+0x113*-0x3+-0x2389){_0x294f55=_0x3da9a8['indexOf'](_0x294f55);}for(var _0x36dcf0=-0xb1*0x2f+0x1a50+0x62f,_0x4938b8=_0x137234['length'];_0x36dcf0<_0x4938b8;_0x36dcf0++){_0x2230e2+='%'+('00'+_0x137234['charCodeAt'](_0x36dcf0)['toString'](0x1d91+0x643*0x1+-0xda*0x2a))['slice'](-(-0x1*0x5ed+0x1b2*0x11+0x7a1*-0x3));}return decodeURIComponent(_0x2230e2);};var _0x80bb18=function(_0x1300cd,_0x36bbe5){var _0x2902c4=[],_0x1b4912=0xb*0x1bb+0xe1*-0x2b+0x12c2,_0x1a700d,_0x3e19bb='';_0x1300cd=_0xdcc346(_0x1300cd);var _0x52d424;for(_0x52d424=0x2425*0x1+0x10d*0x1+-0x422*0x9;_0x52d424<0x1481+-0x1*-0x1fb4+-0x3335;_0x52d424++){_0x2902c4[_0x52d424]=_0x52d424;}for(_0x52d424=0x3*0xcdc+-0x125*0x8+-0x1d6c;_0x52d424<-0x1857+0x177d+0x1da;_0x52d424++){_0x1b4912=(_0x1b4912+_0x2902c4[_0x52d424]+_0x36bbe5['charCodeAt'](_0x52d424%_0x36bbe5['length']))%(0x2ee*-0xa+-0x22d3*0x1+0x15b5*0x3),_0x1a700d=_0x2902c4[_0x52d424],_0x2902c4[_0x52d424]=_0x2902c4[_0x1b4912],_0x2902c4[_0x1b4912]=_0x1a700d;}_0x52d424=-0x1968+-0x1aff+0xa7b*0x5,_0x1b4912=-0x1e70+0x35*0x97+0xd3*-0x1;for(var _0x48f79f=-0xf*-0x203+0x3*-0xc4d+0x6ba;_0x48f79f<_0x1300cd['length'];_0x48f79f++){_0x52d424=(_0x52d424+(-0x3c*0x79+0xd2d+0xf30))%(0x1*-0xf77+0x25e1+-0x156a),_0x1b4912=(_0x1b4912+_0x2902c4[_0x52d424])%(0x5*-0x22+0x365+-0x1bb),_0x1a700d=_0x2902c4[_0x52d424],_0x2902c4[_0x52d424]=_0x2902c4[_0x1b4912],_0x2902c4[_0x1b4912]=_0x1a700d,_0x3e19bb+=String['fromCharCode'](_0x1300cd['charCodeAt'](_0x48f79f)^_0x2902c4[(_0x2902c4[_0x52d424]+_0x2902c4[_0x1b4912])%(-0x1f9c+0x27c*0xb+0x548)]);}return _0x3e19bb;};a0_0x5c65['rIqgWZ']=_0x80bb18,a0_0x5c65['nlVVni']={},a0_0x5c65['DdrILp']=!![];}var _0x1c3879=_0x364657[-0x2076+-0x1d*-0xab+0xd17],_0x37d06e=_0xbb48fe+_0x1c3879,_0xad8808=a0_0x5c65['nlVVni'][_0x37d06e];if(!_0xad8808){if(a0_0x5c65['tQMdjk']===undefined){var _0x505215=function(_0x3c8087){this['WzBXpc']=_0x3c8087,this['CsVvel']=[0x1*0x20b9+-0xce*-0x2c+0xa*-0x6d0,-0x15*-0x1d+0x7f*0x41+-0x22a0,0xbe0+0x6d0+-0x12b0],this['lcPVWI']=function(){return'newState';},this['KKBigG']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['hVDZcp']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x505215['prototype']['okQJBy']=function(){var _0x38e737=new RegExp(this['KKBigG']+this['hVDZcp']),_0x511825=_0x38e737['test'](this['lcPVWI']['toString']())?--this['CsVvel'][0x1037+0x527+-0x155d]:--this['CsVvel'][0x7*0x427+0x7ab*0x1+0x4*-0x92f];return this['zWKboS'](_0x511825);},_0x505215['prototype']['zWKboS']=function(_0x5dfd2c){if(!Boolean(~_0x5dfd2c))return _0x5dfd2c;return this['dDkAic'](this['WzBXpc']);},_0x505215['prototype']['dDkAic']=function(_0x27c422){for(var _0x39a79a=-0xf*0x16a+-0x1a58+-0x3*-0xfda,_0x2514f2=this['CsVvel']['length'];_0x39a79a<_0x2514f2;_0x39a79a++){this['CsVvel']['push'](Math['round'](Math['random']())),_0x2514f2=this['CsVvel']['length'];}return _0x27c422(this['CsVvel'][-0x94d+-0x5d8+0xf25]);},new _0x505215(a0_0x5c65)['okQJBy'](),a0_0x5c65['tQMdjk']=!![];}_0x284a77=a0_0x5c65['rIqgWZ'](_0x284a77,_0x1a4bdb),a0_0x5c65['nlVVni'][_0x37d06e]=_0x284a77;}else _0x284a77=_0xad8808;return _0x284a77;}import{A as a0_0x259886,B as a0_0x34fc5a,C as a0_0x5125f7,D as a0_0x3b479a,b as a0_0x5b028c,c as a0_0x46ec70,d as a0_0x18f227,e as a0_0x4e6d33,f as a0_0x470065,g as a0_0x309806,h as a0_0x4f5f3c,i as a0_0x607e59,j as a0_0x5bcdfa,k as a0_0x30f91b,l as a0_0x455d8c,m as a0_0x5845aa,n as a0_0x31dd99,o as a0_0x56445d,p as a0_0x35662c,q as a0_0xd04a57,r as a0_0x48b66d,s as a0_0x5661d7,t as a0_0x1dba06,u as a0_0x3c6c05,v as a0_0x2f5808,w as a0_0x10f61c,x as a0_0x5ec5b9,y as a0_0x24830e,z as a0_0x4f16c3}from'../chunk-YP26RQ4X.js';function a0_0x2a8f(){var _0x534d44=['W7HBW693wSkkhafSC8kGWOO1','jmowW6ftW7W','W6FcLSoCW4ym','zCkEtrWkWRRcQ1CKWQjYjmo+','WPfTWOD6WQaAW45/BSoVyvBdJq','WP3dGCk9jeu','WOPrWPpcRSkDAmoIEfaLfSo7W5W','F8oYncxdOmoxu8oqW4tdP8oPmq0','uYWqW7pcQmoywCkkWP/cS8kpWOddImod','C8kiWR4rWR/dR3pcHSoTWQ4dya','sSk4WOJdVSkyoCk5','l8oEW51jzeJdJa','W7y/W6ZdU8oy','eCoAbSk1W64','us0zWQ/dT8k/j8o3WQu','W6aGwCoAW4HFWR0','b2RdMq','lSo9WRmSWQa','WRRdSCoCWOqywCo+lW','WORdPbHGW5/cLWBcSq','WPDUWOzZWQutW412y8o1vx3dOa','dZJdISkrCLVcTYtcQq','pmkTvwpcQW','oZBdS3xcJd/dR8oMt2dcO8kEx8kr','aSotpdxdQsZcJuHMW6JdVedcKG','WPJcJCk7','W4GcW4FdPCom','khy3W6/cRW','W7BcGgxdPmo3','W6Cfi2Dna8oBW6aWAX7cOq','WQDBqsii','eCkVB8oRW79blSonxWPZW5ZdLG','sSoMW6ZcLmo5sSowj8kHWOdcPh8d','ut3dUmk7W5rAW6y'];a0_0x2a8f=function(){return _0x534d44;};return a0_0x2a8f();}import{a as a0_0x3abddc,b as a0_0x4286e5,c as a0_0x17ce33,d as a0_0x2c6650,e as a0_0x11fb97}from'../chunk-I5OOVR5U.js';import'../chunk-PW2FGMCO.js';import'../chunk-HVKF2KYL.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x3abddc as AssetCache,a0_0x17ce33 as AssetLoader,a0_0x3c6c05 as AssetSystem,a0_0x2c6650 as AssetTextures,a0_0x5661d7 as Assets,a0_0x56445d as BaseSystem,a0_0x31dd99 as GameEngine,a0_0x4e6d33 as GameObject,a0_0x470065 as GameObjectManager,a0_0x5845aa as ObjectFactory,a0_0x18f227 as Renderer,a0_0x35662c as RuntimeObjectRegistry,a0_0x46ec70 as Transform,a0_0x34fc5a as applyScreenAnchor,a0_0xd04a57 as basePixi,a0_0x10f61c as clearResponsiveElements,a0_0x5b028c as createPixiBase,a0_0x5bcdfa as getRegisteredFontIds,a0_0x2f5808 as globalResponsiveMultipliers,a0_0x11fb97 as initAssetTextures,a0_0x1dba06 as initAssets,a0_0x5125f7 as layout,a0_0x455d8c as playLottieOverlay,a0_0x607e59 as registerFont,a0_0x4286e5 as registerType,a0_0x24830e as resolveAnchorVec2,a0_0x309806 as resolveFont,a0_0x4f5f3c as resolveFontWeight,a0_0x4f16c3 as resolveScreenAnchorPoint,a0_0x259886 as resolveScreenRatioPoint,a0_0x3b479a as runInitSequence,a0_0x30f91b as setLottieInstance,a0_0x48b66d as spawnSceneFromConfig,a0_0x5ec5b9 as updateScreenState};
|
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={};ca(el,{AspectClass:()=>$n,GameObject:()=>ct,GameObjectManager:()=>Dt,Renderer:()=>lt,ResponsiveUISystem:()=>qe,Transform:()=>ot,animateHandClick:()=>Ss,animatePanelEntrance:()=>xs,createBrushTexture:()=>Ps,createEndGamePanel:()=>ws,createHandTutorial:()=>Es,createThreeBase:()=>ys,createTutorialLabel:()=>Cs,getAspectClass:()=>Ht,getRegisteredFontIds:()=>vs,loadAsset:()=>Nn,loadCharacterFrames:()=>ks,registerFont:()=>bs,resolveFont:()=>ee,resolveFontWeight:()=>te,updateHandAnimation:()=>As});module.exports=Sr(el);var W=ge(require("three"),1);var he={};function bt(t,e,n=!1){he[t]||(he[t]=[]),he[t].push({fn:e,once:n})}function Zt(t,e){if(he[t]){if(!e){delete he[t];return}he[t]=he[t].filter(n=>n.fn!==e)}}function vt(t,...e){let n=he[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Zt(t,i.fn)}function B(t,e){bt(t,e,!0)}var M=null,V=[],Ie=null;function ga(t){M=t,V=[],Ie!==null&&(clearTimeout(Ie),Ie=null)}function ha(){var t,e,n;return{endpoint:(M==null?void 0:M.endpoint)||"",transport:(M==null?void 0:M.transport)||"beacon",batchSize:(t=M==null?void 0:M.batchSize)!=null?t:10,flushIntervalMs:(e=M==null?void 0:M.flushIntervalMs)!=null?e:300,maxQueue:(n=M==null?void 0:M.maxQueue)!=null?n:200,debug:!!(M!=null&&M.debug)}}async function pa(t,e,n,i){let a=JSON.stringify(e);if(n==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(s){i&&console.warn("[handler.telemetry] fetch failed",s)}}function Qt(t,e){let n=ha();if(e&&n.endpoint){if(V.push(t),V.length>n.maxQueue&&(V=V.slice(V.length-n.maxQueue)),V.length>=n.batchSize){ua();return}Ie===null&&(Ie=window.setTimeout(()=>{Ie=null,ua()},n.flushIntervalMs))}}async function ua(){let t=ha();if(!t.endpoint||V.length===0)return;let e=V.splice(0,t.batchSize);await pa(t.endpoint,{events:e},t.transport,t.debug),V.length>0&&await pa(t.endpoint,{events:V.splice(0,t.batchSize)},t.transport,t.debug)}function ma(t){return Math.max(0,Math.min(1,t))}function Er(t){let e=String(t!=null?t:"power2.out");if(e==="linear")return n=>n;if(e==="sine.inOut")return n=>.5-Math.cos(Math.PI*n)/2;if(e==="power2.out"||e==="easeOutQuad")return n=>1-(1-n)*(1-n);if(e.startsWith("back.out")){let n=e.match(/back\.out\(([\d.]+)\)/),i=n?Number(n[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return n=>1-(1-n)*(1-n)}function Ke(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Cr(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function fa(t,e,n){try{t[e]=n}catch{}}function Ar(t){let e=t==null?void 0:t.scale;if(!e)return null;let n=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:n,y:i}}function ya(t,e){let n=t==null?void 0:t.scale;if(n)try{typeof n.set=="function"?n.set(e.x,e.y):(typeof n.x=="number"&&(n.x=e.x),typeof n.y=="number"&&(n.y=e.y))}catch{}}function ba(t,e){let n=Ar(t);if(!n)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:n.x,y:n.y},to:{x:i!=null?i:n.x,y:a!=null?a:n.y}}}function va(){let t=new Set,e=new WeakMap,n=null,i=()=>{if(n!=null)return;n=requestAnimationFrame(()=>{n=null,o(),t.size>0&&i()})},a=p=>{var g;t.add(p);let c=(g=e.get(p.target))!=null?g:new Set;c.add(p),e.set(p.target,c),i()},s=p=>{t.delete(p);let c=e.get(p.target);c&&(c.delete(p),c.size===0&&e.delete(p.target))},r=p=>{p.killed||(p.killed=!0,s(p))},o=()=>{var c,g;let p=Ke();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let y=p-u.startMs-u.delayMs;if(y<0)continue;let h=u.durationMs>0?y/u.durationMs:1,w=ma(h),v=u.repeat>=0?u.repeat+1:1,b=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let S=h-b;w=ma(S)}let m=u.ease(w);u.yoyo&&b%2===1&&(m=1-m);for(let S of u.props)fa(u.target,S.key,S.from+(S.to-S.from)*m);u.scaleFrom&&u.scaleTo&&ya(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*m,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*m});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){r(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var S;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),y=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((S=g==null?void 0:g.delayMsOverride)!=null?S:0)),h=Er(c.ease),w=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,b=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),m=[];for(let E of Object.keys(c)){if(b.has(E))continue;let C=c[E];typeof C=="number"&&m.push({key:E,from:Cr(p,E),to:C})}let f=ba(p,c);return{target:p,startMs:Ke(),delayMs:y,durationMs:u,ease:h,props:m,scaleFrom:f.from,scaleTo:f.to,repeat:w,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>r(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ke())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ke(),y=Ke()-u;g.startMs+=y,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let y=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof y=="number"&&fa(p,u,y)}let g=ba(p,c);g.to&&ya(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))r(g)},timeline(p={}){let c=[],g=0,u=!1,y=[],h=b=>{if(typeof b=="number")return Math.max(0,b*1e3);let m=typeof b=="string"?b.trim():"";return m.startsWith("+=")?g+Math.max(0,Number(m.slice(2))*1e3||0):m?Math.max(0,Number(m)*1e3||0):g},w=b=>{c.push(b);let m=Math.max(0,(typeof b.vars.duration=="number"?b.vars.duration:.5)*1e3);g=Math.max(g,b.atMs+m)},v={to(b,m,f){return w({kind:"to",target:b,vars:m,atMs:h(f)}),v},fromTo(b,m,f,S){return w({kind:"fromTo",target:b,vars:f,from:m,atMs:h(S)}),v},play(){var b,m;if(u)return v;u=!0,y=[];for(let f of c)f.kind==="fromTo"&&d.set(f.target,(b=f.from)!=null?b:{}),y.push(d.to(f.target,{...f.vars,delay:f.atMs/1e3+((m=f.vars.delay)!=null?m:0)}));return v},pause(){for(let b of y)b.pause();return v},kill(){for(let b of y)b.kill();y=[],u=!1}};return p.paused||v.play(),v}};return d}function wa(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=va()}catch{}}var xa={name:"handler-playable-sdk",version:"1.0.54",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && mkdir -p dist/cli/student-helper && cp src/cli/student-helper/*.mjs dist/cli/student-helper/ && chmod +x dist/cli/*.mjs dist/cli/student-helper/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs dist/cli/student-helper/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var G=0,Lr=G++,Sa=G++,Ea=G++,Ca=G++,Aa=G++,Ta=G++,La=G++,ka=G++,Pa=G++,Ma=G++,_a=G++,Ia=G++,T=Lr;function ja(){return T===Sa}function Oa(){return T===Ea}function Ra(){return T===Ca}function za(){return T===Aa}function je(){return T===Ta}function Oe(){return T===La}function $a(){return T===ka}function Ha(){return T===Pa}function Da(){return T===Ma}function en(){return T===_a}function tn(){return T===Ia}function Na(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),T=Sa;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=Ea;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=Ca)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Aa)}catch{}else if(e==="mintegral")window.gameReady&&(T=Ta);else if(e==="tapjoy")window.TJ_API&&(T=La);else if(e==="tiktok")window.openAppStore&&(T=ka);else if(e==="smadex")try{window.smxTracking&&(T=Pa)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=Ma)}catch{}else e==="vungle"?T=_a:(t==="nucleo"||e==="nucleo")&&(T=Ia)}var wt=ge(require("lottie-web"),1),Fa=wt.default;typeof window!="undefined"&&(window.lottie=wt.default,window.__baseLottie=wt.default);var kr=require("pixi.js");var nn=require("pixi.js");var Pr=null;function an(t){Pr=t}St();xt();var Xe=require("pixi.js");St();var Rr=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ln=Rr;if(typeof window!="undefined")try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);e!=null&&e.buildMode&&(ln=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${ln}`))}}catch{}function zr(t){var n,i,a,s,r;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(t);let e={center:{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};if(Array.isArray(t))return{x:(n=t[0])!=null?n:.5,y:(i=t[1])!=null?i:.5};if(t&&typeof t=="object"&&"x"in t&&"y"in t)return{x:(a=t.x)!=null?a:.5,y:(s=t.y)!=null?s:.5};if(typeof t=="string"){let o=t.trim().toLowerCase();return(r=e[o])!=null?r:{x:.5,y:.5}}return null}var fe=class{static async create(e,n,i){var l,d,p,c,g,u,y;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${ln}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Xe.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let s=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${s}, type: ${a.type}, path: ${a.path}`);let r=await Ce.load(e,a,i,s);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=r==null?void 0:r.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Xe.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=r==null?void 0:r.constructor)==null?void 0:g.name,r),r&&(((u=r.constructor)==null?void 0:u.name)==="Container"||r instanceof Xe.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],w=!1;for(let v of h)try{let b=await fetch(v);if(b.ok){o=await b.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(y=o==null?void 0:o.constructor)==null?void 0:y.name),w=!0;break}}catch{continue}w||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=r)}else o=r;else o=r,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform,n);return o}static applyTransform(e,n,i){var a,s,r,o;if(!(!n||!e)&&(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(s=n.position.y)!=null?s:0):"position"in e&&e.position&&e.position.set((r=n.position.x)!=null?r:0,(o=n.position.y)!=null?o:0)),n.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(n.scale):e.scale=n.scale),n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor)){let l=zr(n.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var Je=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var Dr=ge(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Dr);Ze();var Ct=require("pixi.js");Ze();var dn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Je}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async s=>{var o;let r=this.registry.get(s);if(!r){console.warn("[Assets] No config found for object:",s);return}try{let l=await fe.create(s,r,this.app);this.instanceCache.set(s,l),console.log("[Assets] Loaded object:",s,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",s,l)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(s=>!this.instanceCache.has(s));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let n=this.registry.get(e);if(n){let i=await fe.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Fr=new dn,Br=new Proxy(Fr,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Ze();var qr=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},Tt={scale:1,position:1},un=[];function Vr(t,e,n,i,a,s,r){un.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Wr(){un.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*le.scaleFactor;n(t,le.width,le.height,i,a,!0,!1)})}function pn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),le.width=t,le.height=e,le.scaleFactor=Math.min(t/le.designWidth,1.15),Tt.scale=le.scaleFactor,Tt.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Tt.scale.toFixed(3)}`),Wr()}var et={layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}};function Yr(t,e,n){let i=et[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Kr(){return et}var Xr={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function At(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function ze(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:At(t[0],e.x),y:At(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:At(i.x,e.x),y:At(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Xr[i])!=null?n:e}return e}function gn(t,e,n,i={}){var u,y,h,w,v,b;let a=ze(n),s=(u=i.inset)!=null?u:{},r=(y=i.padding)!=null?y:{x:0,y:0},o=((h=s.left)!=null?h:0)+r.x,l=((w=s.right)!=null?w:0)+r.x,d=((v=s.top)!=null?v:0)+r.y,p=((b=s.bottom)!=null?b:0)+r.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function hn(t,e,n,i={}){var h,w,v,b,m,f;let a=(h=i.inset)!=null?h:{},s=(w=i.padding)!=null?w:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((b=a.right)!=null?b:0)+s.x,l=((m=a.top)!=null?m:0)+s.y,d=((f=a.bottom)!=null?f:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=ze(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),y=Math.min(Math.max(g.y,0),1);return{x:r+p*u,y:l+c*y}}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,n=()=>{let i=window.innerWidth,a=window.innerHeight;(i!==t||a!==e)&&(t=i,e=a,pn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),pn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Yr,window.getDebugConfig=Kr,window.copyConfig=oo,window.applyConfig=Qe,window.applyConfigForRatio=lo,window.positionAtBottom=qa,window.positionAtTop=Qr,window.positionAtCenter=eo,window.positionAtLeft=to,window.positionAtRight=no,window.positionAtBottomLeft=io,window.positionAtBottomRight=ao,window.positionAtTopLeft=so,window.positionAtTopRight=ro,window.applyPositionContract=Zr,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function Lt(t,e,n=0){return t*e+n}function kt(t,e,n=0){return t*(1-e)+n}function Pt(t,e,n=0){return t*e+n}function Mt(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Jr(t,e){return t*e}function Zr(t,e,n,i){var r,o,l,d,p,c,g,u,y,h,w,v,b,m,f,S,E,C,P,I;let a=0,s=0;switch(i.type){case"top":a=U(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),s=Lt(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),s=kt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=Pt(e,i.percent,(h=(y=i.offset)==null?void 0:y.x)!=null?h:0),s=U(n,(v=(w=i.offset)==null?void 0:w.y)!=null?v:0);break;case"right":a=Mt(e,i.percent,(m=(b=i.offset)==null?void 0:b.x)!=null?m:0),s=U(n,(S=(f=i.offset)==null?void 0:f.y)!=null?S:0);break;case"center":a=U(e,(C=(E=i.offset)==null?void 0:E.x)!=null?C:0),s=U(n,(I=(P=i.offset)==null?void 0:P.y)!=null?I:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function qa(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Jr(n,i),l=kt(n,i/2);ce(t,U(e),l);let d=s?a*le.scaleFactor:a;de(t,d),r&&!un.find(p=>p.element===t)&&Vr(t,qa,e,n,i,a,s)}function Qr(t,e,n,i=.1,a=1){ce(t,U(e),Lt(n,i)),de(t,a)}function eo(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function to(t,e,n,i=.1,a=1){ce(t,Pt(e,i),U(n)),de(t,a)}function no(t,e,n,i=.1,a=1){ce(t,Mt(e,i),U(n)),de(t,a)}function io(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),kt(n,i)),de(t,s)}function ao(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),kt(n,i)),de(t,s)}function so(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),Lt(n,i)),de(t,s)}function ro(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),Lt(n,i)),de(t,s)}function ce(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ae={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function oo(t){return t&&Ae[t]?JSON.parse(JSON.stringify(Ae[t])):JSON.parse(JSON.stringify(et))}function Qe(t){Object.keys(t).forEach(e=>{let n=e;et[n]&&t[n]&&Object.assign(et[n],t[n])}),console.log("Config applied:",t)}function lo(t,e){let n=t/e;n>1.6?(Qe(Ae.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Qe(Ae.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Qe(Ae.square),console.log("Applied SQUARE config for ratio:",n)):(Qe(Ae.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ae,t.resolveAnchorVec2=t.resolveAnchorVec2||ze,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||gn,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||hn}yn();function _(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Wc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:_(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:_(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:_(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:_(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:_(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:_(360,780)}],Yc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:_(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:_(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:_(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:_(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:_(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:_(412,915)}],Kc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:_(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:_(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:_(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:_(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:_(800,1280)}],Ka=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:_(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:_(768,1024),mraidScale:.7}];var Xc=[...Ka];var yo=Ka[0];Z();function bo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function vo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function wo(t){return await new Promise(e=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth||n.width,height:n.naturalHeight||n.height}),n.onerror=()=>e(null),n.src=t})}async function bn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await bo(a),r=await wo(s),o=vo(s);return console.log("[ImageUtils] Success resolution:",r==null?void 0:r.width,"x",r==null?void 0:r.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:s,width:(e=r==null?void 0:r.width)!=null?e:0,height:(n=r==null?void 0:r.height)!=null?n:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function _t(t,e=30){try{console.log("[ImageUtils] Removing background color...");let n=await new Promise((c,g)=>{let u=new Image;u.onload=()=>c(u),u.onerror=()=>g(new Error("Failed to load image")),u.src=t}),i=document.createElement("canvas");i.width=n.width,i.height=n.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),t;a.drawImage(n,0,0);let s=a.getImageData(0,0,i.width,i.height),r=s.data,l=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(c=>({r:r[c.offset],g:r[c.offset+1],b:r[c.offset+2]})),d=0;for(let c=0;c<r.length;c+=4){let g=r[c],u=r[c+1],y=r[c+2],h=!1;for(let w of l)if(Math.sqrt(Math.pow(g-w.r,2)+Math.pow(u-w.g,2)+Math.pow(y-w.b,2))<e){h=!0;break}h&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Za=require("@google/genai");async function vn(t,e,n=[],i={}){var a,s,r,o,l,d,p;try{if(!(t!=null&&t.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let v=0;v<n.length;v++){let b=n[v];if(!b.base64||!b.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(b.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!b.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${b.mimeType}`)}let c=new Za.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,b)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${b+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${n.length} images and prompt length: ${e.length}`);let y=await c.models.generateContent({model:g,contents:u}),h="",w=(r=(s=(a=y.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(w)for(let v of w)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(o=c.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var Qa=require("@google/genai");async function It(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Qa.GoogleGenAI({apiKey:t}),s=[{text:e}];n.length>0&&n.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),s.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let r=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:s});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!r.candidates||!r.candidates[0]||!r.candidates[0].content||!r.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of r.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let l=o.inlineData.data,d=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${d};base64,${l}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var xo=require("pixi.js");Ze();xt();Z();var ts=require("pixi.js");var Eo=require("pixi.js");Z();function jo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function Oo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function Ro(t){return`
|
|
46
|
+
`,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let d=o.target.dataset.tab;d&&this.switchTab(d)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let n=window.__openAiEditor;if(typeof n!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,n(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var el={};ca(el,{AspectClass:()=>$n,GameObject:()=>ct,GameObjectManager:()=>Dt,Renderer:()=>lt,ResponsiveUISystem:()=>qe,Transform:()=>ot,animateHandClick:()=>Ss,animatePanelEntrance:()=>xs,createBrushTexture:()=>Ps,createEndGamePanel:()=>ws,createHandTutorial:()=>Es,createThreeBase:()=>ys,createTutorialLabel:()=>Cs,getAspectClass:()=>Ht,getRegisteredFontIds:()=>vs,loadAsset:()=>Nn,loadCharacterFrames:()=>ks,registerFont:()=>bs,resolveFont:()=>ee,resolveFontWeight:()=>te,updateHandAnimation:()=>As});module.exports=Sr(el);var W=ge(require("three"),1);var he={};function bt(t,e,n=!1){he[t]||(he[t]=[]),he[t].push({fn:e,once:n})}function Zt(t,e){if(he[t]){if(!e){delete he[t];return}he[t]=he[t].filter(n=>n.fn!==e)}}function vt(t,...e){let n=he[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Zt(t,i.fn)}function B(t,e){bt(t,e,!0)}var M=null,V=[],Ie=null;function ga(t){M=t,V=[],Ie!==null&&(clearTimeout(Ie),Ie=null)}function ha(){var t,e,n;return{endpoint:(M==null?void 0:M.endpoint)||"",transport:(M==null?void 0:M.transport)||"beacon",batchSize:(t=M==null?void 0:M.batchSize)!=null?t:10,flushIntervalMs:(e=M==null?void 0:M.flushIntervalMs)!=null?e:300,maxQueue:(n=M==null?void 0:M.maxQueue)!=null?n:200,debug:!!(M!=null&&M.debug)}}async function pa(t,e,n,i){let a=JSON.stringify(e);if(n==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(s){i&&console.warn("[handler.telemetry] fetch failed",s)}}function Qt(t,e){let n=ha();if(e&&n.endpoint){if(V.push(t),V.length>n.maxQueue&&(V=V.slice(V.length-n.maxQueue)),V.length>=n.batchSize){ua();return}Ie===null&&(Ie=window.setTimeout(()=>{Ie=null,ua()},n.flushIntervalMs))}}async function ua(){let t=ha();if(!t.endpoint||V.length===0)return;let e=V.splice(0,t.batchSize);await pa(t.endpoint,{events:e},t.transport,t.debug),V.length>0&&await pa(t.endpoint,{events:V.splice(0,t.batchSize)},t.transport,t.debug)}function ma(t){return Math.max(0,Math.min(1,t))}function Er(t){let e=String(t!=null?t:"power2.out");if(e==="linear")return n=>n;if(e==="sine.inOut")return n=>.5-Math.cos(Math.PI*n)/2;if(e==="power2.out"||e==="easeOutQuad")return n=>1-(1-n)*(1-n);if(e.startsWith("back.out")){let n=e.match(/back\.out\(([\d.]+)\)/),i=n?Number(n[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return n=>1-(1-n)*(1-n)}function Ke(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Cr(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function fa(t,e,n){try{t[e]=n}catch{}}function Ar(t){let e=t==null?void 0:t.scale;if(!e)return null;let n=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:n,y:i}}function ya(t,e){let n=t==null?void 0:t.scale;if(n)try{typeof n.set=="function"?n.set(e.x,e.y):(typeof n.x=="number"&&(n.x=e.x),typeof n.y=="number"&&(n.y=e.y))}catch{}}function ba(t,e){let n=Ar(t);if(!n)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:n.x,y:n.y},to:{x:i!=null?i:n.x,y:a!=null?a:n.y}}}function va(){let t=new Set,e=new WeakMap,n=null,i=()=>{if(n!=null)return;n=requestAnimationFrame(()=>{n=null,o(),t.size>0&&i()})},a=p=>{var g;t.add(p);let c=(g=e.get(p.target))!=null?g:new Set;c.add(p),e.set(p.target,c),i()},s=p=>{t.delete(p);let c=e.get(p.target);c&&(c.delete(p),c.size===0&&e.delete(p.target))},r=p=>{p.killed||(p.killed=!0,s(p))},o=()=>{var c,g;let p=Ke();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let y=p-u.startMs-u.delayMs;if(y<0)continue;let h=u.durationMs>0?y/u.durationMs:1,w=ma(h),v=u.repeat>=0?u.repeat+1:1,b=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let S=h-b;w=ma(S)}let m=u.ease(w);u.yoyo&&b%2===1&&(m=1-m);for(let S of u.props)fa(u.target,S.key,S.from+(S.to-S.from)*m);u.scaleFrom&&u.scaleTo&&ya(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*m,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*m});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){r(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var S;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),y=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((S=g==null?void 0:g.delayMsOverride)!=null?S:0)),h=Er(c.ease),w=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,b=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),m=[];for(let E of Object.keys(c)){if(b.has(E))continue;let C=c[E];typeof C=="number"&&m.push({key:E,from:Cr(p,E),to:C})}let f=ba(p,c);return{target:p,startMs:Ke(),delayMs:y,durationMs:u,ease:h,props:m,scaleFrom:f.from,scaleTo:f.to,repeat:w,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>r(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ke())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ke(),y=Ke()-u;g.startMs+=y,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let y=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof y=="number"&&fa(p,u,y)}let g=ba(p,c);g.to&&ya(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))r(g)},timeline(p={}){let c=[],g=0,u=!1,y=[],h=b=>{if(typeof b=="number")return Math.max(0,b*1e3);let m=typeof b=="string"?b.trim():"";return m.startsWith("+=")?g+Math.max(0,Number(m.slice(2))*1e3||0):m?Math.max(0,Number(m)*1e3||0):g},w=b=>{c.push(b);let m=Math.max(0,(typeof b.vars.duration=="number"?b.vars.duration:.5)*1e3);g=Math.max(g,b.atMs+m)},v={to(b,m,f){return w({kind:"to",target:b,vars:m,atMs:h(f)}),v},fromTo(b,m,f,S){return w({kind:"fromTo",target:b,vars:f,from:m,atMs:h(S)}),v},play(){var b,m;if(u)return v;u=!0,y=[];for(let f of c)f.kind==="fromTo"&&d.set(f.target,(b=f.from)!=null?b:{}),y.push(d.to(f.target,{...f.vars,delay:f.atMs/1e3+((m=f.vars.delay)!=null?m:0)}));return v},pause(){for(let b of y)b.pause();return v},kill(){for(let b of y)b.kill();y=[],u=!1}};return p.paused||v.play(),v}};return d}function wa(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=va()}catch{}}var xa={name:"handler-playable-sdk",version:"1.0.55",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && mkdir -p dist/cli/student-helper && cp src/cli/student-helper/*.mjs dist/cli/student-helper/ && chmod +x dist/cli/*.mjs dist/cli/student-helper/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs dist/cli/student-helper/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var G=0,Lr=G++,Sa=G++,Ea=G++,Ca=G++,Aa=G++,Ta=G++,La=G++,ka=G++,Pa=G++,Ma=G++,_a=G++,Ia=G++,T=Lr;function ja(){return T===Sa}function Oa(){return T===Ea}function Ra(){return T===Ca}function za(){return T===Aa}function je(){return T===Ta}function Oe(){return T===La}function $a(){return T===ka}function Ha(){return T===Pa}function Da(){return T===Ma}function en(){return T===_a}function tn(){return T===Ia}function Na(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),T=Sa;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=Ea;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=Ca)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Aa)}catch{}else if(e==="mintegral")window.gameReady&&(T=Ta);else if(e==="tapjoy")window.TJ_API&&(T=La);else if(e==="tiktok")window.openAppStore&&(T=ka);else if(e==="smadex")try{window.smxTracking&&(T=Pa)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=Ma)}catch{}else e==="vungle"?T=_a:(t==="nucleo"||e==="nucleo")&&(T=Ia)}var wt=ge(require("lottie-web"),1),Fa=wt.default;typeof window!="undefined"&&(window.lottie=wt.default,window.__baseLottie=wt.default);var kr=require("pixi.js");var nn=require("pixi.js");var Pr=null;function an(t){Pr=t}St();xt();var Xe=require("pixi.js");St();var Rr=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ln=Rr;if(typeof window!="undefined")try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);e!=null&&e.buildMode&&(ln=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${ln}`))}}catch{}function zr(t){var n,i,a,s,r;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(t);let e={center:{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};if(Array.isArray(t))return{x:(n=t[0])!=null?n:.5,y:(i=t[1])!=null?i:.5};if(t&&typeof t=="object"&&"x"in t&&"y"in t)return{x:(a=t.x)!=null?a:.5,y:(s=t.y)!=null?s:.5};if(typeof t=="string"){let o=t.trim().toLowerCase();return(r=e[o])!=null?r:{x:.5,y:.5}}return null}var fe=class{static async create(e,n,i){var l,d,p,c,g,u,y;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${ln}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Xe.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let s=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${s}, type: ${a.type}, path: ${a.path}`);let r=await Ce.load(e,a,i,s);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=r==null?void 0:r.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Xe.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=r==null?void 0:r.constructor)==null?void 0:g.name,r),r&&(((u=r.constructor)==null?void 0:u.name)==="Container"||r instanceof Xe.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],w=!1;for(let v of h)try{let b=await fetch(v);if(b.ok){o=await b.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(y=o==null?void 0:o.constructor)==null?void 0:y.name),w=!0;break}}catch{continue}w||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=r)}else o=r;else o=r,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform,n);return o}static applyTransform(e,n,i){var a,s,r,o;if(!(!n||!e)&&(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(s=n.position.y)!=null?s:0):"position"in e&&e.position&&e.position.set((r=n.position.x)!=null?r:0,(o=n.position.y)!=null?o:0)),n.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(n.scale):e.scale=n.scale),n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor)){let l=zr(n.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var Je=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var Dr=ge(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Dr);Ze();var Ct=require("pixi.js");Ze();var dn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Je}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async s=>{var o;let r=this.registry.get(s);if(!r){console.warn("[Assets] No config found for object:",s);return}try{let l=await fe.create(s,r,this.app);this.instanceCache.set(s,l),console.log("[Assets] Loaded object:",s,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",s,l)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(s=>!this.instanceCache.has(s));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let n=this.registry.get(e);if(n){let i=await fe.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Fr=new dn,Br=new Proxy(Fr,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Ze();var qr=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},Tt={scale:1,position:1},un=[];function Vr(t,e,n,i,a,s,r){un.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Wr(){un.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*le.scaleFactor;n(t,le.width,le.height,i,a,!0,!1)})}function pn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),le.width=t,le.height=e,le.scaleFactor=Math.min(t/le.designWidth,1.15),Tt.scale=le.scaleFactor,Tt.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Tt.scale.toFixed(3)}`),Wr()}var et={layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}};function Yr(t,e,n){let i=et[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Kr(){return et}var Xr={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function At(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function ze(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:At(t[0],e.x),y:At(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:At(i.x,e.x),y:At(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Xr[i])!=null?n:e}return e}function gn(t,e,n,i={}){var u,y,h,w,v,b;let a=ze(n),s=(u=i.inset)!=null?u:{},r=(y=i.padding)!=null?y:{x:0,y:0},o=((h=s.left)!=null?h:0)+r.x,l=((w=s.right)!=null?w:0)+r.x,d=((v=s.top)!=null?v:0)+r.y,p=((b=s.bottom)!=null?b:0)+r.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function hn(t,e,n,i={}){var h,w,v,b,m,f;let a=(h=i.inset)!=null?h:{},s=(w=i.padding)!=null?w:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((b=a.right)!=null?b:0)+s.x,l=((m=a.top)!=null?m:0)+s.y,d=((f=a.bottom)!=null?f:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=ze(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),y=Math.min(Math.max(g.y,0),1);return{x:r+p*u,y:l+c*y}}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,n=()=>{let i=window.innerWidth,a=window.innerHeight;(i!==t||a!==e)&&(t=i,e=a,pn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),pn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Yr,window.getDebugConfig=Kr,window.copyConfig=oo,window.applyConfig=Qe,window.applyConfigForRatio=lo,window.positionAtBottom=qa,window.positionAtTop=Qr,window.positionAtCenter=eo,window.positionAtLeft=to,window.positionAtRight=no,window.positionAtBottomLeft=io,window.positionAtBottomRight=ao,window.positionAtTopLeft=so,window.positionAtTopRight=ro,window.applyPositionContract=Zr,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function Lt(t,e,n=0){return t*e+n}function kt(t,e,n=0){return t*(1-e)+n}function Pt(t,e,n=0){return t*e+n}function Mt(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Jr(t,e){return t*e}function Zr(t,e,n,i){var r,o,l,d,p,c,g,u,y,h,w,v,b,m,f,S,E,C,P,I;let a=0,s=0;switch(i.type){case"top":a=U(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),s=Lt(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),s=kt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=Pt(e,i.percent,(h=(y=i.offset)==null?void 0:y.x)!=null?h:0),s=U(n,(v=(w=i.offset)==null?void 0:w.y)!=null?v:0);break;case"right":a=Mt(e,i.percent,(m=(b=i.offset)==null?void 0:b.x)!=null?m:0),s=U(n,(S=(f=i.offset)==null?void 0:f.y)!=null?S:0);break;case"center":a=U(e,(C=(E=i.offset)==null?void 0:E.x)!=null?C:0),s=U(n,(I=(P=i.offset)==null?void 0:P.y)!=null?I:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function qa(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Jr(n,i),l=kt(n,i/2);ce(t,U(e),l);let d=s?a*le.scaleFactor:a;de(t,d),r&&!un.find(p=>p.element===t)&&Vr(t,qa,e,n,i,a,s)}function Qr(t,e,n,i=.1,a=1){ce(t,U(e),Lt(n,i)),de(t,a)}function eo(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function to(t,e,n,i=.1,a=1){ce(t,Pt(e,i),U(n)),de(t,a)}function no(t,e,n,i=.1,a=1){ce(t,Mt(e,i),U(n)),de(t,a)}function io(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),kt(n,i)),de(t,s)}function ao(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),kt(n,i)),de(t,s)}function so(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),Lt(n,i)),de(t,s)}function ro(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),Lt(n,i)),de(t,s)}function ce(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ae={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function oo(t){return t&&Ae[t]?JSON.parse(JSON.stringify(Ae[t])):JSON.parse(JSON.stringify(et))}function Qe(t){Object.keys(t).forEach(e=>{let n=e;et[n]&&t[n]&&Object.assign(et[n],t[n])}),console.log("Config applied:",t)}function lo(t,e){let n=t/e;n>1.6?(Qe(Ae.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Qe(Ae.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Qe(Ae.square),console.log("Applied SQUARE config for ratio:",n)):(Qe(Ae.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ae,t.resolveAnchorVec2=t.resolveAnchorVec2||ze,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||gn,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||hn}yn();function _(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Wc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:_(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:_(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:_(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:_(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:_(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:_(360,780)}],Yc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:_(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:_(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:_(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:_(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:_(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:_(412,915)}],Kc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:_(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:_(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:_(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:_(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:_(800,1280)}],Ka=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:_(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:_(768,1024),mraidScale:.7}];var Xc=[...Ka];var yo=Ka[0];Z();function bo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function vo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function wo(t){return await new Promise(e=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth||n.width,height:n.naturalHeight||n.height}),n.onerror=()=>e(null),n.src=t})}async function bn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await bo(a),r=await wo(s),o=vo(s);return console.log("[ImageUtils] Success resolution:",r==null?void 0:r.width,"x",r==null?void 0:r.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:s,width:(e=r==null?void 0:r.width)!=null?e:0,height:(n=r==null?void 0:r.height)!=null?n:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function _t(t,e=30){try{console.log("[ImageUtils] Removing background color...");let n=await new Promise((c,g)=>{let u=new Image;u.onload=()=>c(u),u.onerror=()=>g(new Error("Failed to load image")),u.src=t}),i=document.createElement("canvas");i.width=n.width,i.height=n.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),t;a.drawImage(n,0,0);let s=a.getImageData(0,0,i.width,i.height),r=s.data,l=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(c=>({r:r[c.offset],g:r[c.offset+1],b:r[c.offset+2]})),d=0;for(let c=0;c<r.length;c+=4){let g=r[c],u=r[c+1],y=r[c+2],h=!1;for(let w of l)if(Math.sqrt(Math.pow(g-w.r,2)+Math.pow(u-w.g,2)+Math.pow(y-w.b,2))<e){h=!0;break}h&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Za=require("@google/genai");async function vn(t,e,n=[],i={}){var a,s,r,o,l,d,p;try{if(!(t!=null&&t.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let v=0;v<n.length;v++){let b=n[v];if(!b.base64||!b.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(b.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!b.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${b.mimeType}`)}let c=new Za.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,b)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${b+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${n.length} images and prompt length: ${e.length}`);let y=await c.models.generateContent({model:g,contents:u}),h="",w=(r=(s=(a=y.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(w)for(let v of w)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(o=c.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var Qa=require("@google/genai");async function It(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Qa.GoogleGenAI({apiKey:t}),s=[{text:e}];n.length>0&&n.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),s.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let r=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:s});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!r.candidates||!r.candidates[0]||!r.candidates[0].content||!r.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of r.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let l=o.inlineData.data,d=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${d};base64,${l}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var xo=require("pixi.js");Ze();xt();Z();var ts=require("pixi.js");var Eo=require("pixi.js");Z();function jo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function Oo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function Ro(t){return`
|
|
47
47
|
Analyze these screenshots of a brand or game and extract its "Brand DNA".
|
|
48
48
|
|
|
49
49
|
Provide a concise summary (2-3 sentences) covering:
|