handler-playable-sdk 0.5.26 → 0.5.28
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-CFNCYJKB.js → chunk-EZMANCHN.js} +211 -105
- 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.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 +195 -89
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/pixi/index.cjs +13 -13
- package/dist/pixi/index.js +1 -1
- package/dist/three/index.cjs +17 -17
- package/dist/three/index.js +1 -1
- package/package.json +1 -1
package/dist/pixi/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xc3fb87,_0x3c4059){var a0_0x5f2964={_0x2afcde:0x1bb,_0x34a4aa:'[TSz',_0x3f2955:0x1ca,_0x54745a:0x1bb,_0xf8df5a:0x10d,_0x228fc6:0x1ce,_0x536e4c:'gpXT',_0x34c0b1:0x1d2,_0x4787d7:0x1d1,_0x21235a:'OD6%',_0x25cac3:0x1c9,_0x59f90c:0x1d4,_0xd9a46b:0x1c3,_0x3dd1ff:0x1c9,_0x4dc199:'Zt03',_0x2dca1a:0x1c5,_0xdb31a:0x1ba,_0x2ad3ee:0x1cc,_0x5bb914:0x47,_0x11c7a3:0x5e,_0x9fc3d5:'QO2Z',_0xc47097:0x50,_0x25655b:0x110,_0x3b8002:0x103,_0x554169:0xfe,_0x2f8710:0x1b6,_0x2c1484:'KGId',_0x362789:0x1bc,_0x2359e8:0x1bd,_0x2ab1a6:0x1ac,_0x1e5a9a:0x10e,_0x3801fa:'&9NV',_0x1ed4d9:0x10a,_0x5dc63f:0x1cd,_0x147bfe:0x1dd,_0x157bfe:0x1be},a0_0x3de583={_0x363a82:0x7d},a0_0x4d1c37={_0x449eb9:0x132},a0_0x1a405e={_0x4370b0:0x44},_0x455231=_0xc3fb87();function _0x4055d1(_0x1e1d92,_0x549c1c,_0x5243dc,_0xdaa002,_0x234cf0){return a0_0x5b5c(_0xdaa002- -a0_0x1a405e._0x4370b0,_0x5243dc);}function _0x16d264(_0x375d22,_0x4a7532,_0x1780fc,_0x3f7677,_0x5a1ae4){return a0_0x5b5c(_0x375d22-a0_0x4d1c37._0x449eb9,_0x4a7532);}function _0x283148(_0x129095,_0x4745f0,_0x1222cc,_0x5b13f9,_0x58c61d){return a0_0x5b5c(_0x4745f0-a0_0x3de583._0x363a82,_0x1222cc);}while(!![]){try{var _0xd47754=parseInt(_0x16d264(a0_0x5f2964._0x2afcde,a0_0x5f2964._0x34a4aa,0x1be,a0_0x5f2964._0x3f2955,a0_0x5f2964._0x54745a))/(-0x3e*-0x5d+0x1d8a+0x1*-0x340f)*(-parseInt(_0x283148(a0_0x5f2964._0xf8df5a,0x10f,'y2Mv',0x11b,0x104))/(0x1*-0x1479+-0x21*-0x47+0xb54))+parseInt(_0x16d264(a0_0x5f2964._0x228fc6,a0_0x5f2964._0x536e4c,0x1cc,a0_0x5f2964._0x34c0b1,0x1c1))/(-0x4*0x697+0x8da*-0x4+-0x1*-0x3dc7)+parseInt(_0x16d264(a0_0x5f2964._0x4787d7,a0_0x5f2964._0x21235a,a0_0x5f2964._0x25cac3,a0_0x5f2964._0x59f90c,a0_0x5f2964._0xd9a46b))/(-0x1eae+-0x1*0x45f+0x2311*0x1)+-parseInt(_0x16d264(a0_0x5f2964._0x3dd1ff,a0_0x5f2964._0x4dc199,a0_0x5f2964._0x2dca1a,a0_0x5f2964._0xdb31a,a0_0x5f2964._0x2ad3ee))/(-0x6*0x1e3+0xb37+0x20)*(parseInt(_0x4055d1(a0_0x5f2964._0x5bb914,a0_0x5f2964._0x11c7a3,a0_0x5f2964._0x9fc3d5,a0_0x5f2964._0xc47097,a0_0x5f2964._0x5bb914))/(0x1104+0x160e+-0x15*0x1dc))+-parseInt(_0x283148(a0_0x5f2964._0x25655b,a0_0x5f2964._0x3b8002,'TVmg',a0_0x5f2964._0x554169,a0_0x5f2964._0xf8df5a))/(-0x1a1c+0x2e*-0x11+0x1d31)+-parseInt(_0x16d264(a0_0x5f2964._0x2f8710,a0_0x5f2964._0x2c1484,a0_0x5f2964._0x362789,a0_0x5f2964._0x2359e8,a0_0x5f2964._0x2ab1a6))/(0x45*-0x23+0x21c4+-0x184d*0x1)*(parseInt(_0x283148(0x11a,a0_0x5f2964._0x1e5a9a,a0_0x5f2964._0x3801fa,a0_0x5f2964._0x25655b,a0_0x5f2964._0x1ed4d9))/(-0xa6*0x9+-0x1bec+0x21cb))+parseInt(_0x16d264(a0_0x5f2964._0x5dc63f,a0_0x5f2964._0x3801fa,a0_0x5f2964._0x147bfe,a0_0x5f2964._0x157bfe,0x1d6))/(0x177c+0x16bb+-0x2e2d);if(_0xd47754===_0x3c4059)break;else _0x455231['push'](_0x455231['shift']());}catch(_0x2201e9){_0x455231['push'](_0x455231['shift']());}}}(a0_0x160b,0x3a11e+0x10ab1f+-0xbd276));var a0_0x3099d3=(function(){var _0x1d4eed=!![];return function(_0x1acacb,_0x58d87a){var a0_0x27c395={_0x1eb041:0x2d0,_0x512a07:0x2d5,_0x1faebd:'xMjk'},_0x48fbbe=_0x1d4eed?function(){var a0_0x1cfd7b={_0x548885:0x23b};function _0x429aa3(_0x52dacb,_0x4ec152,_0x38091b,_0x312b4d,_0x34b8d1){return a0_0x5b5c(_0x38091b-a0_0x1cfd7b._0x548885,_0x34b8d1);}if(_0x58d87a){var _0x1d274c=_0x58d87a[_0x429aa3(0x2df,a0_0x27c395._0x1eb041,a0_0x27c395._0x512a07,0x2e1,a0_0x27c395._0x1faebd)](_0x1acacb,arguments);return _0x58d87a=null,_0x1d274c;}}:function(){};return _0x1d4eed=![],_0x48fbbe;};}()),a0_0x30ce5a=a0_0x3099d3(this,function(){var a0_0x783dcf={_0x1dcd9e:0x3b8,_0x4f94cb:'xK^!',_0x280484:0x3c1,_0x17156d:0x3c7,_0x18db2b:0x2e8,_0x5788bd:0x2e3,_0x93dc3d:0x2f3,_0x1d6b94:'OD6%',_0x28f062:0x289,_0x504b5d:0x27d,_0x308a00:0x285,_0x3331ef:0x27f,_0xd464f8:0x3bc,_0x5f1cea:0x3ca,_0x41e1d1:0x3bd,_0x34b8a0:0x2ed,_0x59df2f:0x2f4,_0x19c86f:'Vu4c',_0x37b526:0x307,_0x25b89d:0x306,_0x305b70:0x2fc,_0x1cba3d:0x302,_0x5063c1:'NL5A',_0x160e11:0x27f,_0x58e65a:0x28d,_0x56d772:0x28b,_0x3d0602:0x27e,_0x143ab9:'LT2u',_0x1086c4:0x273,_0x42e964:0x27f,_0x5c2e31:0x272,_0x49076a:0x271,_0x1e1d67:0x268,_0x47e84b:0x283,_0x337ab6:0x284,_0x2493df:0x277,_0x49cf46:0x2e4,_0x41bd9d:0x2fb,_0x2ace81:0x2eb,_0xd20144:'y2Mv'},a0_0x173fa9={_0x2c040e:0x306},a0_0x4e7081={_0x228a22:0x269},a0_0x3592d9={_0x5285a0:0x33e};function _0x5bc752(_0x561760,_0x44923c,_0x579971,_0x7f6291,_0x4f49cd){return a0_0x5b5c(_0x7f6291-a0_0x3592d9._0x5285a0,_0x44923c);}var _0x5d6d0c={};function _0x5c303b(_0x548129,_0xfd69ad,_0x9c712e,_0x2b9841,_0x382a4e){return a0_0x5b5c(_0x2b9841-a0_0x4e7081._0x228a22,_0x382a4e);}_0x5d6d0c['NpvtR']=_0x5bc752(a0_0x783dcf._0x1dcd9e,a0_0x783dcf._0x4f94cb,0x3b3,a0_0x783dcf._0x280484,a0_0x783dcf._0x17156d)+_0x5c303b(0x2f8,a0_0x783dcf._0x18db2b,a0_0x783dcf._0x5788bd,a0_0x783dcf._0x93dc3d,'Zt03')+'+$';var _0x31bbb6=_0x5d6d0c;function _0x24cc7b(_0x3d4edf,_0x14a49,_0x333388,_0x503223,_0x3b0afb){return a0_0x5b5c(_0x3b0afb- -a0_0x173fa9._0x2c040e,_0x3d4edf);}return a0_0x30ce5a[_0x24cc7b(a0_0x783dcf._0x1d6b94,-a0_0x783dcf._0x28f062,-a0_0x783dcf._0x504b5d,-a0_0x783dcf._0x308a00,-a0_0x783dcf._0x3331ef)+'ing']()[_0x5bc752(a0_0x783dcf._0xd464f8,'KGId',0x3c5,a0_0x783dcf._0x5f1cea,a0_0x783dcf._0x41e1d1)+'h'](_0x31bbb6['NpvtR'])['toStr'+_0x5c303b(a0_0x783dcf._0x34b8a0,0x2e7,0x2f0,a0_0x783dcf._0x59df2f,a0_0x783dcf._0x19c86f)]()[_0x5c303b(a0_0x783dcf._0x37b526,a0_0x783dcf._0x25b89d,a0_0x783dcf._0x305b70,a0_0x783dcf._0x1cba3d,a0_0x783dcf._0x5063c1)+_0x24cc7b('9kGP',-a0_0x783dcf._0x160e11,-a0_0x783dcf._0x58e65a,-a0_0x783dcf._0x56d772,-a0_0x783dcf._0x3d0602)+'r'](a0_0x30ce5a)[_0x24cc7b(a0_0x783dcf._0x143ab9,-a0_0x783dcf._0x1086c4,-a0_0x783dcf._0x42e964,-a0_0x783dcf._0x5c2e31,-a0_0x783dcf._0x49076a)+'h'](_0x24cc7b('fHfQ',-a0_0x783dcf._0x1e1d67,-a0_0x783dcf._0x47e84b,-a0_0x783dcf._0x337ab6,-a0_0x783dcf._0x2493df)+_0x5c303b(a0_0x783dcf._0x49cf46,0x2fa,a0_0x783dcf._0x41bd9d,a0_0x783dcf._0x2ace81,a0_0x783dcf._0xd20144)+'+$');});a0_0x30ce5a();function a0_0x5b5c(_0x43430d,_0x584487){_0x43430d=_0x43430d-(0x7d+0x1*-0x1926+0x192a);var _0x441054=a0_0x160b();var _0x23ef5b=_0x441054[_0x43430d];if(a0_0x5b5c['eDWJux']===undefined){var _0xa3ddbe=function(_0x46d84f){var _0x5747b3='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x21df3c='',_0x3d6028='',_0x56c583=_0x21df3c+_0xa3ddbe;for(var _0x2947ef=0x2*0x11e4+0xb76+-0x2*0x179f,_0xc03ab6,_0x2bd43a,_0x4474ae=0xa72+-0x1*-0xcc4+-0x1736;_0x2bd43a=_0x46d84f['charAt'](_0x4474ae++);~_0x2bd43a&&(_0xc03ab6=_0x2947ef%(0x1c05+0x2456+-0x4057)?_0xc03ab6*(-0x11f5*0x2+0xfe5+0x1445)+_0x2bd43a:_0x2bd43a,_0x2947ef++%(-0x1*-0xc86+0x25b8+-0x323a))?_0x21df3c+=_0x56c583['charCodeAt'](_0x4474ae+(-0xbc3+-0x1*0x1ca5+0x2872))-(-0x188f+-0x4d0*0x7+0x3a49)!==-0x1be3+-0x1d9+0x1dbc?String['fromCharCode'](-0x62f*-0x1+0x7bd+0xced*-0x1&_0xc03ab6>>(-(-0x1*-0x1e77+-0x10a2+0x1*-0xdd3)*_0x2947ef&-0x1*-0xe83+0x1*0x217d+-0x2ffa)):_0x2947ef:-0x1b72+0x11c7*0x1+0x9ab){_0x2bd43a=_0x5747b3['indexOf'](_0x2bd43a);}for(var _0x4a9b29=0x3b*0xb+-0x11*0x55+0x31c,_0xff6d1a=_0x21df3c['length'];_0x4a9b29<_0xff6d1a;_0x4a9b29++){_0x3d6028+='%'+('00'+_0x21df3c['charCodeAt'](_0x4a9b29)['toString'](-0xd*-0x139+-0x5a5+-0xa30))['slice'](-(0x1990+0x25ae+0x26*-0x1aa));}return decodeURIComponent(_0x3d6028);};var _0x2a74b2=function(_0x1aa40d,_0x58e97a){var _0x23a17b=[],_0xfd2df0=-0xb7+0x1d*-0x12b+0x2296,_0x2bf5d2,_0x625777='';_0x1aa40d=_0xa3ddbe(_0x1aa40d);var _0x333bf1;for(_0x333bf1=0xf58+-0x1452+0x4fa;_0x333bf1<0x198d+0x20e5*-0x1+0x164*0x6;_0x333bf1++){_0x23a17b[_0x333bf1]=_0x333bf1;}for(_0x333bf1=0x22c8+0x1e*0x144+-0x48c0;_0x333bf1<-0x1ff8+0x32*-0x6e+0x3674;_0x333bf1++){_0xfd2df0=(_0xfd2df0+_0x23a17b[_0x333bf1]+_0x58e97a['charCodeAt'](_0x333bf1%_0x58e97a['length']))%(0x257a+0xe5*-0x2a+0x118),_0x2bf5d2=_0x23a17b[_0x333bf1],_0x23a17b[_0x333bf1]=_0x23a17b[_0xfd2df0],_0x23a17b[_0xfd2df0]=_0x2bf5d2;}_0x333bf1=-0x1*-0x2579+0x8f*0x3+-0x2726,_0xfd2df0=0xe3*-0x21+-0x21b7+0x3efa;for(var _0x501acb=0x9cf+-0x8a1*0x2+0x773;_0x501acb<_0x1aa40d['length'];_0x501acb++){_0x333bf1=(_0x333bf1+(-0x3ed*0x6+-0x15d4+0x2d63))%(0x6b1*0x1+0x1b*0x85+0x9dc*-0x2),_0xfd2df0=(_0xfd2df0+_0x23a17b[_0x333bf1])%(-0x2112+0x177a+0xa98),_0x2bf5d2=_0x23a17b[_0x333bf1],_0x23a17b[_0x333bf1]=_0x23a17b[_0xfd2df0],_0x23a17b[_0xfd2df0]=_0x2bf5d2,_0x625777+=String['fromCharCode'](_0x1aa40d['charCodeAt'](_0x501acb)^_0x23a17b[(_0x23a17b[_0x333bf1]+_0x23a17b[_0xfd2df0])%(-0x14f8+0x27d*0x5+0x987)]);}return _0x625777;};a0_0x5b5c['XQjWxu']=_0x2a74b2,a0_0x5b5c['RCiRWe']={},a0_0x5b5c['eDWJux']=!![];}var _0x2a5af2=_0x441054[0x142c+0x2*0xd43+-0x2eb2],_0xfad950=_0x43430d+_0x2a5af2,_0x4e64a8=a0_0x5b5c['RCiRWe'][_0xfad950];if(!_0x4e64a8){if(a0_0x5b5c['IcSPig']===undefined){var _0x109583=function(_0x242ca6){this['llAeBu']=_0x242ca6,this['JOGgDk']=[0x17c9+0x1*-0x26df+0x1*0xf17,-0x1d9*0x15+-0x1cf2+0x171*0x2f,0x36*-0x1e+-0x59d+0x3fb*0x3],this['IfkJKk']=function(){return'newState';},this['Bqzowx']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['vrTEhi']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x109583['prototype']['QqGcUh']=function(){var _0x58e5f9=new RegExp(this['Bqzowx']+this['vrTEhi']),_0x5b4de3=_0x58e5f9['test'](this['IfkJKk']['toString']())?--this['JOGgDk'][-0x1*-0x18a0+0x1*0x22c3+-0x3b62]:--this['JOGgDk'][0x1e2f*-0x1+0x1686+0x7a9];return this['QYGpis'](_0x5b4de3);},_0x109583['prototype']['QYGpis']=function(_0x49d278){if(!Boolean(~_0x49d278))return _0x49d278;return this['qTmcVt'](this['llAeBu']);},_0x109583['prototype']['qTmcVt']=function(_0x22a2e5){for(var _0x50872e=0x3e5+0x1*0xabd+0xea2*-0x1,_0x119ad5=this['JOGgDk']['length'];_0x50872e<_0x119ad5;_0x50872e++){this['JOGgDk']['push'](Math['round'](Math['random']())),_0x119ad5=this['JOGgDk']['length'];}return _0x22a2e5(this['JOGgDk'][-0xfd8+-0x891+-0x1*-0x1869]);},new _0x109583(a0_0x5b5c)['QqGcUh'](),a0_0x5b5c['IcSPig']=!![];}_0x23ef5b=a0_0x5b5c['XQjWxu'](_0x23ef5b,_0x584487),a0_0x5b5c['RCiRWe'][_0xfad950]=_0x23ef5b;}else _0x23ef5b=_0x4e64a8;return _0x23ef5b;}import{A as a0_0x497f59,B as a0_0x35c5f4,C as a0_0x3e9cca,D as a0_0x2ed161,b as a0_0x6598e4,c as a0_0x252185,d as a0_0x3f9eac,e as a0_0x452705,f as a0_0xeb73f5,g as a0_0x426a20,h as a0_0x16e3af,i as a0_0x1196cd,j as a0_0x21ae0d,k as a0_0x2ce370,l as a0_0x4edf9b,m as a0_0x78a5b1,n as a0_0x1395b6,o as a0_0x3bfa5c,p as a0_0x59e989,q as a0_0x497d1c,r as a0_0x5139d9,s as a0_0x5a2425,t as a0_0x5e07c1,u as a0_0x2d6855,v as a0_0x3d907c,w as a0_0x3f547c,x as a0_0x17bae5,y as a0_0x8ab676,z as a0_0x1577fb}from'../chunk-CFNCYJKB.js';import{a as a0_0x2291b1,b as a0_0x492e1b,c as a0_0x44d169,d as a0_0x2d0d7e,e as a0_0x5d6dea}from'../chunk-I5OOVR5U.js';import'../chunk-LV4HGC5G.js';import'../chunk-ZLL42OOV.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x2291b1 as AssetCache,a0_0x44d169 as AssetLoader,a0_0x2d6855 as AssetSystem,a0_0x2d0d7e as AssetTextures,a0_0x5a2425 as Assets,a0_0x3bfa5c as BaseSystem,a0_0x1395b6 as GameEngine,a0_0x452705 as GameObject,a0_0xeb73f5 as GameObjectManager,a0_0x78a5b1 as ObjectFactory,a0_0x3f9eac as Renderer,a0_0x59e989 as RuntimeObjectRegistry,a0_0x252185 as Transform,a0_0x35c5f4 as applyScreenAnchor,a0_0x497d1c as basePixi,a0_0x3f547c as clearResponsiveElements,a0_0x6598e4 as createPixiBase,a0_0x21ae0d as getRegisteredFontIds,a0_0x3d907c as globalResponsiveMultipliers,a0_0x5d6dea as initAssetTextures,a0_0x5e07c1 as initAssets,a0_0x3e9cca as layout,a0_0x4edf9b as playLottieOverlay,a0_0x1196cd as registerFont,a0_0x492e1b as registerType,a0_0x8ab676 as resolveAnchorVec2,a0_0x426a20 as resolveFont,a0_0x16e3af as resolveFontWeight,a0_0x1577fb as resolveScreenAnchorPoint,a0_0x497f59 as resolveScreenRatioPoint,a0_0x2ed161 as runInitSequence,a0_0x2ce370 as setLottieInstance,a0_0x5139d9 as spawnSceneFromConfig,a0_0x17bae5 as updateScreenState};function a0_0x160b(){var _0x38391b=['E8oKdKNdUmo1W7hcIMFcI3iYzG','WRVdQWNdT8oi','ymk9WRJcVHO','BqXtkmkEAdbnW5fV','WQldPCkdWOZcGa','WRhcKIK','sv9bhmo2','dSoGEmknDHVcUGRcHXdcUCog','Dh8iW4L7WPpcUmonoSoiWQRdPMK','AmozWPRcPSoY','WOxdRmoxW5RdTu5t','amoMamoFd3RcNqa','WRBcMdRdHmoFeHe','dmoNDSkllhNcRsJcKYq','W4FcG1NdLGaNbt/dNCkJ','ASoeWR86AW','W5tcOCoax0O3W77dOG','WRRdTSkEWPFdJ8k3W7tcNq0N','WQreW4SiW7FdHqLsqH8','W57dHSoZW6ZdMa','zgvXW7/dOa','cmoLFSkpDX3dVgJcLr/cGmolWR1W','WR/dT1LuWOFcT8o1W4xdOSkos0RdLW','W4pcGvhdKLTdvh/dM8kyaLRcHmkf','WOO3W5zvWOL0WRrDWQFdNSk1fHe','W7ZcSMZcTmkdW7/cISk7WQvUWO/dIgW','cqWwwCkSw8kRcXBdSZWxWQS','WQFdTLNcQSkV','iuSfuGO','dqWxxSkMw8oLmcVdJdSE','tM50WPFdPeSJW4L8Eq'];a0_0x160b=function(){return _0x38391b;};return a0_0x160b();}
|
|
1
|
+
function a0_0x325a(_0x55a955,_0x50867a){_0x55a955=_0x55a955-(-0x17d9*0x1+-0x29d*0x5+0x7b2*0x5);var _0x30ed31=a0_0xc15e();var _0x19d155=_0x30ed31[_0x55a955];if(a0_0x325a['wiOtmG']===undefined){var _0x1b7684=function(_0x485067){var _0x4bab8a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x3ddfe8='',_0x3e1915='',_0x571d9b=_0x3ddfe8+_0x1b7684;for(var _0x2e0486=0x951*-0x1+0x102e*0x1+-0x6dd,_0xf8b594,_0x3c5834,_0xbeb35c=0x1286*0x2+-0xa*-0x2+-0x2520;_0x3c5834=_0x485067['charAt'](_0xbeb35c++);~_0x3c5834&&(_0xf8b594=_0x2e0486%(-0x62c*-0x2+-0x260e*-0x1+-0x3262*0x1)?_0xf8b594*(0x1*0x23e9+0x250c+-0x48b5)+_0x3c5834:_0x3c5834,_0x2e0486++%(-0x1a67+0x1bf8+0x18d*-0x1))?_0x3ddfe8+=_0x571d9b['charCodeAt'](_0xbeb35c+(-0x140b+0x5fb*0x1+0xe1a))-(-0x2*-0x29d+-0x26c4+-0x1*-0x2194)!==0x44a+-0x23c4+0x1f7a?String['fromCharCode'](-0x25*-0x92+0x3*0x447+-0x20f0&_0xf8b594>>(-(-0xc47*-0x1+-0x1b+-0xc2a)*_0x2e0486&0x378+0x8b9+0xc2b*-0x1)):_0x2e0486:-0xfb*-0x21+0x2*-0xa2e+-0xbff){_0x3c5834=_0x4bab8a['indexOf'](_0x3c5834);}for(var _0x5cb160=-0x9b2*-0x1+-0xd6a+0x3b8,_0x462968=_0x3ddfe8['length'];_0x5cb160<_0x462968;_0x5cb160++){_0x3e1915+='%'+('00'+_0x3ddfe8['charCodeAt'](_0x5cb160)['toString'](-0x1ba8+-0x1464+0x301c))['slice'](-(0x922+-0x109f*0x1+-0x65*-0x13));}return decodeURIComponent(_0x3e1915);};var _0x393b74=function(_0x246981,_0x3f0f8c){var _0x180460=[],_0x54a456=-0x4*-0x98c+0x1e90+0xa*-0x6e0,_0x4827d7,_0x2261c5='';_0x246981=_0x1b7684(_0x246981);var _0x531534;for(_0x531534=0x10d*0x23+0x1572+-0x3a39;_0x531534<-0x2027+0x256a+0x1*-0x443;_0x531534++){_0x180460[_0x531534]=_0x531534;}for(_0x531534=0x3ec+0xec+-0x28*0x1f;_0x531534<0x17f0+0x2*0x48d+-0x200a;_0x531534++){_0x54a456=(_0x54a456+_0x180460[_0x531534]+_0x3f0f8c['charCodeAt'](_0x531534%_0x3f0f8c['length']))%(0x13*-0x1b3+-0x1*-0x2288+-0x13f),_0x4827d7=_0x180460[_0x531534],_0x180460[_0x531534]=_0x180460[_0x54a456],_0x180460[_0x54a456]=_0x4827d7;}_0x531534=0x509+-0x1*-0x7f+0x8*-0xb1,_0x54a456=0x184e+0x140a+-0x2c58;for(var _0x47675d=-0x2*-0x11a5+-0x15c8+-0xd82;_0x47675d<_0x246981['length'];_0x47675d++){_0x531534=(_0x531534+(0xaa7+0x1*0x27d+-0xd23))%(0xabe+0x21e1+-0x2b9f),_0x54a456=(_0x54a456+_0x180460[_0x531534])%(0x250c+0x672*0x1+-0x2a7e),_0x4827d7=_0x180460[_0x531534],_0x180460[_0x531534]=_0x180460[_0x54a456],_0x180460[_0x54a456]=_0x4827d7,_0x2261c5+=String['fromCharCode'](_0x246981['charCodeAt'](_0x47675d)^_0x180460[(_0x180460[_0x531534]+_0x180460[_0x54a456])%(0x11c+0x7*0x2dd+-0x1427)]);}return _0x2261c5;};a0_0x325a['WRzcbg']=_0x393b74,a0_0x325a['TLCfyx']={},a0_0x325a['wiOtmG']=!![];}var _0x303054=_0x30ed31[-0x1ed*-0x11+0x17a+-0x2237],_0x3c4338=_0x55a955+_0x303054,_0xc94819=a0_0x325a['TLCfyx'][_0x3c4338];if(!_0xc94819){if(a0_0x325a['kCQSfp']===undefined){var _0x171643=function(_0x26924b){this['VGVKce']=_0x26924b,this['gQpyDB']=[0x68*0x29+0x280*0xe+-0x761*0x7,-0x1473+0xe6a*0x1+0x609,-0x1fcb*-0x1+-0xd91+-0x2*0x91d],this['SaFzXZ']=function(){return'newState';},this['dtpweN']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['vjVtii']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x171643['prototype']['DXSGZU']=function(){var _0x452827=new RegExp(this['dtpweN']+this['vjVtii']),_0x418770=_0x452827['test'](this['SaFzXZ']['toString']())?--this['gQpyDB'][0x1526+0x2419*-0x1+0xef4]:--this['gQpyDB'][-0x5*0x523+0x7ab*-0x3+0x30b0*0x1];return this['rloIcy'](_0x418770);},_0x171643['prototype']['rloIcy']=function(_0x56a04f){if(!Boolean(~_0x56a04f))return _0x56a04f;return this['FueWYx'](this['VGVKce']);},_0x171643['prototype']['FueWYx']=function(_0x3ecbb1){for(var _0x3cbe8b=0x2*0xfd3+0x1fc9+-0x3f6f,_0x49ab5e=this['gQpyDB']['length'];_0x3cbe8b<_0x49ab5e;_0x3cbe8b++){this['gQpyDB']['push'](Math['round'](Math['random']())),_0x49ab5e=this['gQpyDB']['length'];}return _0x3ecbb1(this['gQpyDB'][-0x21f1*-0x1+-0x1913+-0x1c6*0x5]);},new _0x171643(a0_0x325a)['DXSGZU'](),a0_0x325a['kCQSfp']=!![];}_0x19d155=a0_0x325a['WRzcbg'](_0x19d155,_0x50867a),a0_0x325a['TLCfyx'][_0x3c4338]=_0x19d155;}else _0x19d155=_0xc94819;return _0x19d155;}(function(_0x13650a,_0x120367){var a0_0x138b94={_0x5867ac:0x4c9,_0xeca01a:0x4c0,_0x34b055:0x4d1,_0x46d332:0x4c8,_0xacc6d7:0x381,_0x93c33a:'f%rr',_0x5f2118:0x22f,_0x2e7f52:0x229,_0x2dce4a:'xl3#',_0x422a72:0x23a,_0x273cb5:0x236,_0x39ee4a:'9paY',_0x18ec32:0x223,_0x2d4ed1:0x37a,_0x4b8f28:0x390,_0x53f89d:0x380,_0x13eb38:'donk',_0x2174fb:0x385,_0x53c054:0x228,_0x1f7af3:0x231,_0x135eff:0x23d,_0x408221:0x235,_0x382f1e:0x238,_0x47bf09:0x22f,_0x4401d9:'a3N[',_0x227525:0x238,_0x365359:0x227,_0x5906a1:0x230,_0x2d49c2:'bS)U',_0x556976:0x22f,_0x1bb44c:0x384,_0x5b4028:0x37d,_0x5cee9c:')t(1',_0x3317bd:0x37f,_0x101ce5:0x397,_0xe97bf5:0x385,_0x4b4dc9:0x39d,_0x293638:0x392},a0_0x326a2f={_0x356017:0x1ed};function _0x5f15e2(_0x30076a,_0x11ffcc,_0x461d40,_0x243fd4,_0x39d845){return a0_0x325a(_0x30076a-0x334,_0x39d845);}function _0x4597bf(_0x1d664b,_0x4e7549,_0xec7967,_0x11a8b6,_0x195a28){return a0_0x325a(_0x4e7549-0x91,_0x11a8b6);}var _0x332a91=_0x13650a();function _0x286e77(_0xabfd16,_0x18aa05,_0x13cc7a,_0x2247ea,_0x9d59e){return a0_0x325a(_0x9d59e-a0_0x326a2f._0x356017,_0x2247ea);}while(!![]){try{var _0x12386f=-parseInt(_0x5f15e2(a0_0x138b94._0x5867ac,a0_0x138b94._0xeca01a,a0_0x138b94._0x34b055,a0_0x138b94._0x46d332,'mnb8'))/(0x42f*0x1+0x1dd7*0x1+0x3*-0xb57)*(parseInt(_0x286e77(a0_0x138b94._0xacc6d7,0x38b,0x393,a0_0x138b94._0x93c33a,0x38e))/(-0xdf*0x1+-0xf17*0x1+0xff8))+parseInt(_0x4597bf(0x225,a0_0x138b94._0x5f2118,a0_0x138b94._0x2e7f52,a0_0x138b94._0x2dce4a,a0_0x138b94._0x422a72))/(0x11fb*0x2+-0x10*0x18d+-0xb23)+-parseInt(_0x4597bf(a0_0x138b94._0x273cb5,0x22e,0x231,a0_0x138b94._0x39ee4a,a0_0x138b94._0x18ec32))/(0x69+0x125*0x9+0x2*-0x559)+-parseInt(_0x286e77(a0_0x138b94._0x2d4ed1,a0_0x138b94._0x4b8f28,a0_0x138b94._0x53f89d,a0_0x138b94._0x13eb38,a0_0x138b94._0x2174fb))/(0xbce+0x204e+-0x2c17*0x1)*(-parseInt(_0x4597bf(a0_0x138b94._0x53c054,a0_0x138b94._0x1f7af3,a0_0x138b94._0x135eff,'5uth',a0_0x138b94._0x408221))/(-0x2253+-0x2*-0x935+-0xfef*-0x1))+-parseInt(_0x4597bf(a0_0x138b94._0x408221,a0_0x138b94._0x382f1e,a0_0x138b94._0x47bf09,a0_0x138b94._0x4401d9,a0_0x138b94._0x227525))/(-0xae7*0x1+0x1d00+-0x909*0x2)*(-parseInt(_0x4597bf(a0_0x138b94._0x18ec32,a0_0x138b94._0x365359,a0_0x138b94._0x5906a1,a0_0x138b94._0x2d49c2,a0_0x138b94._0x556976))/(0x1fe7*0x1+0xc61+-0xc0*0x3b))+parseInt(_0x286e77(a0_0x138b94._0x1bb44c,0x37f,a0_0x138b94._0x5b4028,a0_0x138b94._0x5cee9c,a0_0x138b94._0x3317bd))/(-0x1ecf+-0x89*-0xc+0x186c)+-parseInt(_0x286e77(a0_0x138b94._0x101ce5,a0_0x138b94._0xe97bf5,a0_0x138b94._0x4b4dc9,'gCn]',a0_0x138b94._0x293638))/(0xc38+0x1*0xfc3+-0x1bf1);if(_0x12386f===_0x120367)break;else _0x332a91['push'](_0x332a91['shift']());}catch(_0x940b1f){_0x332a91['push'](_0x332a91['shift']());}}}(a0_0xc15e,0x77b0*-0x10+0x22b91+0xdca47*0x1));var a0_0x45cb13=(function(){var _0x59d600=!![];return function(_0x5e767c,_0x3df975){var a0_0xb1e923={_0x3c4970:0x3b1,_0x42fae4:0x3bb,_0xc211fd:'jqf4'},a0_0x532740={_0xe33792:0x219},_0x5e2d22=_0x59d600?function(){function _0x3f443f(_0x105aef,_0x2b69c8,_0x4f1f2b,_0x503a6a,_0x31b2d0){return a0_0x325a(_0x105aef-a0_0x532740._0xe33792,_0x503a6a);}if(_0x3df975){var _0x2f23c5=_0x3df975[_0x3f443f(0x3b2,a0_0xb1e923._0x3c4970,a0_0xb1e923._0x42fae4,a0_0xb1e923._0xc211fd,a0_0xb1e923._0x42fae4)](_0x5e767c,arguments);return _0x3df975=null,_0x2f23c5;}}:function(){};return _0x59d600=![],_0x5e2d22;};}()),a0_0x9c916=a0_0x45cb13(this,function(){var a0_0x2907b2={_0xe32141:0x227,_0x2a341e:0x224,_0x350a6d:'bP70',_0x45e304:0x224,_0x1609b4:0x223,_0x2fb393:0x221,_0x572569:0x22e,_0x1db4af:0x223,_0x4886ef:0x21e,_0x237b67:'yA]Q',_0x57c32c:0x21b,_0x36b0d0:0x151,_0x5c819b:0x165,_0x2bba6b:0x163,_0x3a465d:'bS)U',_0xf83f87:0x22a,_0x1293cf:0x237,_0x270290:0x234,_0x136cd3:0x221,_0x5e047b:0x21f,_0x42c22:0x22d,_0x38039d:0x234,_0x59f18a:0x241,_0x33f5c6:'WaXy',_0x238c8b:0x22b,_0x4bab9b:0x239,_0x1536a8:0x228,_0x277e63:0x21d,_0x216efa:'jqf4',_0x5979ee:0x21f,_0x1778f8:0x14c,_0x167255:0x14d,_0x43b888:0x159},a0_0x148c39={_0x458625:0x4d},a0_0xd445c3={_0x377f54:0x90},a0_0x1a455d={_0x1d2b68:0x3c4};function _0x18d97a(_0x1eb47d,_0x552b7f,_0x2a2ea9,_0x567210,_0x126c65){return a0_0x325a(_0x1eb47d- -a0_0x1a455d._0x1d2b68,_0x2a2ea9);}function _0x1496fd(_0x5d70f5,_0x31b049,_0x5d4e66,_0x1f878f,_0x46af69){return a0_0x325a(_0x31b049-a0_0xd445c3._0x377f54,_0x1f878f);}var _0x7aa94={};_0x7aa94[_0x1496fd(0x234,a0_0x2907b2._0xe32141,a0_0x2907b2._0x2a341e,a0_0x2907b2._0x350a6d,0x21a)]='(((.+'+_0x1496fd(0x229,a0_0x2907b2._0x45e304,a0_0x2907b2._0x1609b4,'yA]Q',a0_0x2907b2._0x2fb393)+'+$';var _0x35d5ac=_0x7aa94;function _0x240603(_0x4c0a06,_0x1e20c9,_0x4d540e,_0x31c357,_0x1824d6){return a0_0x325a(_0x31c357- -a0_0x148c39._0x458625,_0x1824d6);}return a0_0x9c916[_0x1496fd(a0_0x2907b2._0x572569,a0_0x2907b2._0x1db4af,a0_0x2907b2._0x4886ef,a0_0x2907b2._0x237b67,a0_0x2907b2._0x57c32c)+_0x240603(a0_0x2907b2._0x36b0d0,a0_0x2907b2._0x5c819b,a0_0x2907b2._0x2bba6b,0x15c,a0_0x2907b2._0x3a465d)]()[_0x18d97a(-a0_0x2907b2._0xf83f87,-a0_0x2907b2._0x1293cf,'pkN^',-a0_0x2907b2._0x270290,-a0_0x2907b2._0x1293cf)+'h'](_0x35d5ac[_0x1496fd(a0_0x2907b2._0x136cd3,a0_0x2907b2._0x2fb393,a0_0x2907b2._0x5e047b,'B8JL',a0_0x2907b2._0x42c22)])[_0x18d97a(-a0_0x2907b2._0x38039d,-a0_0x2907b2._0x59f18a,a0_0x2907b2._0x33f5c6,-a0_0x2907b2._0x238c8b,-a0_0x2907b2._0x4bab9b)+_0x18d97a(-a0_0x2907b2._0x1536a8,-a0_0x2907b2._0x277e63,a0_0x2907b2._0x216efa,-a0_0x2907b2._0x572569,-a0_0x2907b2._0x5979ee)]()['const'+'ructo'+'r'](a0_0x9c916)['searc'+'h'](_0x240603(0x158,a0_0x2907b2._0x1778f8,a0_0x2907b2._0x167255,a0_0x2907b2._0x43b888,'V^!x')+')+)+)'+'+$');});a0_0x9c916();import{A as a0_0x3d5688,B as a0_0x134574,C as a0_0x5e4b90,D as a0_0x54fd1e,b as a0_0x31a4cc,c as a0_0x28effd,d as a0_0xae2f8,e as a0_0x31bac6,f as a0_0x35a337,g as a0_0x5c93c4,h as a0_0x49dd28,i as a0_0x4dec7e,j as a0_0x4d5967,k as a0_0x131eb5,l as a0_0x238633,m as a0_0x871fa1,n as a0_0x5d5a05,o as a0_0x31009f,p as a0_0xfa9a6b,q as a0_0x58153a,r as a0_0x35732d,s as a0_0x34791f,t as a0_0x30d03f,u as a0_0x166bb7,v as a0_0x3f2c68,w as a0_0x58958c,x as a0_0x161057,y as a0_0x4ce7ea,z as a0_0x3acbbb}from'../chunk-EZMANCHN.js';import{a as a0_0x119063,b as a0_0x41f87c,c as a0_0x369095,d as a0_0x1fa9c9,e as a0_0x84865c}from'../chunk-I5OOVR5U.js';import'../chunk-LV4HGC5G.js';import'../chunk-ZLL42OOV.js';function a0_0xc15e(){var _0x46d8c9=['bSo7rYvEW7uTxa','o3ddO8kPvtG0WPtcL2nQ','jSk3m1OKW650FCogCSki','lhJdPCo3pSkoW4ldNCo5DSoTAt8','FCoRb8kMe1mnW7RdM1uME3O','W6msEqq0','W6pcGSkmpSkEWOZcVSk0W7Hd','W4JcMCooWRRcSNldSSo9W7FcTwbIW5m','W6xcUcG','WRZcLGXmhG','iSkRWR9gga','pmkSWPJcQhhcIt0RtSoxWQmVjq','WPFdPSokWQtdHq','W4RcOSkWW7VcNG','ucLSx33cIXpcQtHkWQ0','WR3dPhRdNSondtnxW4ymWPa','j8oHa8oKW70','d0tdMWnMAWZcKmoHpG','w8oirmoqWPu','F8oynYHW','WQZdJNNcLCkZWQDLW4G','u8owuW','vCoQWOTnW5ZdMCoAm8ohW7ldOmom','lSoAWOb4bCo1W5dcVZHaW6NdIrG','WR3dOxRdKmkveY9kW5CY','D1JdISondv5IW4iPaa'];a0_0xc15e=function(){return _0x46d8c9;};return a0_0xc15e();}import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x119063 as AssetCache,a0_0x369095 as AssetLoader,a0_0x166bb7 as AssetSystem,a0_0x1fa9c9 as AssetTextures,a0_0x34791f as Assets,a0_0x31009f as BaseSystem,a0_0x5d5a05 as GameEngine,a0_0x31bac6 as GameObject,a0_0x35a337 as GameObjectManager,a0_0x871fa1 as ObjectFactory,a0_0xae2f8 as Renderer,a0_0xfa9a6b as RuntimeObjectRegistry,a0_0x28effd as Transform,a0_0x134574 as applyScreenAnchor,a0_0x58153a as basePixi,a0_0x58958c as clearResponsiveElements,a0_0x31a4cc as createPixiBase,a0_0x4d5967 as getRegisteredFontIds,a0_0x3f2c68 as globalResponsiveMultipliers,a0_0x84865c as initAssetTextures,a0_0x30d03f as initAssets,a0_0x5e4b90 as layout,a0_0x238633 as playLottieOverlay,a0_0x4dec7e as registerFont,a0_0x41f87c as registerType,a0_0x4ce7ea as resolveAnchorVec2,a0_0x5c93c4 as resolveFont,a0_0x49dd28 as resolveFontWeight,a0_0x3acbbb as resolveScreenAnchorPoint,a0_0x3d5688 as resolveScreenRatioPoint,a0_0x54fd1e as runInitSequence,a0_0x131eb5 as setLottieInstance,a0_0x35732d as spawnSceneFromConfig,a0_0x161057 as updateScreenState};
|
package/dist/three/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var fs=Object.create;var ft=Object.defineProperty;var ms=Object.getOwnPropertyDescriptor;var bs=Object.getOwnPropertyNames;var ys=Object.getPrototypeOf,vs=Object.prototype.hasOwnProperty;var ne=(t,e)=>()=>(t&&(e=t(t=0)),e);var sa=(t,e)=>{for(var i in e)ft(t,i,{get:e[i],enumerable:!0})},oa=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of bs(e))!vs.call(t,a)&&a!==i&&ft(t,a,{get:()=>e[a],enumerable:!(n=ms(e,a))||n.enumerable});return t};var ae=(t,e,i)=>(i=t!=null?fs(ys(t)):{},oa(e||!t||!t.__esModule?ft(i,"default",{value:t,enumerable:!0}):i,t)),ws=t=>oa(ft({},"__esModule",{value:!0}),t);var re,ii=ne(()=>{"use strict";re=class{static get(e){var i;return(i=this.store.get(e))==null?void 0:i.data}static set(e,i){this.store.set(e,{data:i})}static has(e){return this.store.has(e)}static clear(){this.store.clear()}};re.store=new Map});function _s(){var t,e;try{let i=typeof window!="undefined"&&(document.querySelector('script[src*="inline-assets.js"]')||((e=(t=document.querySelector("script"))==null?void 0:t.textContent)==null?void 0:e.includes("inline-assets.js"))||window.INLINE_ASSETS),n=typeof window!="undefined"&&document.querySelector('link[href*="assets/"], script[src*="assets/"]');return!!(i&&!n)}catch{return!1}}async function ks(){try{if(typeof window!="undefined"){let t=await fetch("./build-settings.json");if(t.ok){let e=await t.json();return console.log("[AssetLoader] Loaded build settings:",e),e}}}catch{}return null}function Ms(){try{if(typeof window!="undefined"){let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);return console.log("[AssetLoader] Loaded build settings (sync):",e),e}}}catch{}return null}async function Ps(){if(console.log(`[AssetLoader] getInlineAssets() called - Effective mode: ${C}`),Object.keys(se).length>0)return console.log("[AssetLoader] Returning cached inline assets:",Object.keys(se)),se;if(typeof window!="undefined"&&window.INLINE_ASSETS)return console.log("[AssetLoader] Using pre-loaded INLINE_ASSETS from window:",Object.keys(window.INLINE_ASSETS)),se={...window.INLINE_ASSETS},se;if(!(C==="publish"&&K!==!1))return console.log("[AssetLoader] Inline assets disabled for this build mode."),se;if(!ni){let e=typeof window!="undefined"?new URL("inline-assets.js",window.location.href).href:"./inline-assets.js";console.log("[AssetLoader] Loading inline assets from:",e),ni=(async()=>{try{try{let r=await import(e+"?t="+Date.now());if(r.INLINE_ASSETS)return console.log("[AssetLoader] Loaded INLINE_ASSETS via ES module:",Object.keys(r.INLINE_ASSETS)),r.INLINE_ASSETS}catch(r){console.warn("[AssetLoader] ES module import failed, trying text parse:",r)}let i=await fetch(e);if(!i.ok)throw new Error(`HTTP ${i.status}: ${i.statusText}`);let n=await i.text();console.log("[AssetLoader] Received JS code, length:",n.length);let a=n.match(/export\s+const\s+INLINE_ASSETS\s*=\s*({[\s\S]*?});?\s*$/m);if(a)try{let r=a[1];console.log("[AssetLoader] Found INLINE_ASSETS export, parsing...");let s=new Function("return "+r)();return console.log("[AssetLoader] Parsed inline assets:",Object.keys(s)),s}catch(r){return console.warn("[AssetLoader] Failed to parse inline assets:",r),{}}else return console.warn("[AssetLoader] INLINE_ASSETS export not found in response"),console.log("[AssetLoader] JS code preview:",n.substring(0,500)),{}}catch(i){return console.warn("[AssetLoader] Failed to load inline assets:",i),{}}})()}return se=await ni,console.log("[AssetLoader] Final inline assets cache:",Object.keys(se)),se}function ai(t){return t===null||typeof t!="object"||(Object.freeze(t),Object.values(t).forEach(e=>ai(e))),t}function Os(t=64,e=64,i=16711680){let n=document.createElement("canvas");n.width=t,n.height=e;let a=n.getContext("2d");return a.fillStyle=`#${i.toString(16).padStart(6,"0")}`,a.fillRect(0,0,t,e),a.strokeStyle="#000",a.strokeRect(0,0,t,e),a.fillStyle="#fff",a.font="10px sans-serif",a.textAlign="center",a.fillText("MISSING",t/2,e/2),oe.Texture.from(n)}function ri(t,e){Na.set(t,e)}var oe,Ha,Fa,Ee,C,K,he,se,ni,Na,Se,vt=ne(()=>{"use strict";oe=require("pixi.js");ii();Ha=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Fa=_s(),Ee=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,C=Fa?"publish":Ha,K=Ee==null?void 0:Ee.assetsInlined;Ee!=null&&Ee.buildMode&&(C=Ee.buildMode,console.log(`[AssetLoader] Build mode overridden by inline settings: ${C}`));he=Ms();he!=null&&he.buildMode&&(C=he.buildMode,console.log(`[AssetLoader] Build mode overridden by sync settings: ${C}`));(he==null?void 0:he.assetsInlined)!==void 0&&(K=he.assetsInlined);ks().then(t=>{t!=null&&t.buildMode&&t.buildMode!==C&&(C=t.buildMode,console.log(`[AssetLoader] Build mode overridden by settings: ${C}`)),(t==null?void 0:t.assetsInlined)!==void 0&&(K=t.assetsInlined)}).catch(()=>{});console.log(`[AssetLoader] MODULE LOADED - Compile: ${Ha}, Runtime: ${Fa?"publish":"dev"}, Effective: ${C}`);se={},ni=null;Na=new Map;Se=class{static async load(e,i,n,a){let r=`${e}:${i.path}`,s=re.get(r);if(s!==void 0)return s;console.log(`[AssetLoader] Loading asset: ${e}, type: ${i.type}, Effective mode: ${C}`),console.log(`[AssetLoader] Window defined: ${typeof window!="undefined"}, INLINE_ASSETS exists: ${!!(typeof window!="undefined"&&window.INLINE_ASSETS)}, keys: ${typeof window!="undefined"&&window.INLINE_ASSETS?Object.keys(window.INLINE_ASSETS).length:"N/A"}`);let o=await Ps(),l=o[e];if(!l&&a&&(l=o[a],l&&console.log(`[AssetLoader] Found inline data for ${e} using configId: ${a}`)),!l&&i.path){let c=i.path.split("/");if(c.length>=2){let g=c[c.length-1].split(".")[0];o[g]&&(l=o[g],console.log(`[AssetLoader] Found inline data for ${e} using assetName: ${g}`))}}if(console.log("[AssetLoader] Inline data for",e,":",l?"FOUND":"NOT FOUND"),C==="publish"&&K!==!1&&(console.log("[AssetLoader] \u26A0\uFE0F PUBLISH MODE DETECTED - inline assets are MANDATORY"),!l))throw new Error(`[AssetLoader] PUBLISH MODE: Inline asset required but NOT FOUND for object: ${e}, path: ${i.path}`);let p=Na.get(i.type);if(p)try{let c=await p(i.path,l,e,n);return re.set(r,c),c}catch(c){return this.handleFailure(e,i.type,c)}try{let c;switch(i.type){case"image":c=await this.loadImage(i.path,l);break;case"json":c=await this.loadJSON(i.path,l),c=ai(c);break;default:throw new Error(`Unknown asset type: ${i.type}`)}return re.set(r,c),c}catch(c){return this.handleFailure(e,i.type,c)}}static async loadImage(e,i){let n=C==="publish",a=n&&K!==!1;if(console.log(`[AssetLoader] loadImage - Effective mode: ${C}, isPublishMode: ${n}, inlineData: ${i?"EXISTS":"MISSING"}`),a){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!i)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for object. Path: ${e}`);if(typeof i!="string"||!i.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI string, got: ${typeof i}`);try{return await oe.Assets.load(i)}catch(r){throw console.error("[AssetLoader] Failed to load texture from data URI:",r),r}}if(i&&typeof i=="string"&&i.startsWith("data:"))try{return await oe.Assets.load(i)}catch(r){return console.error("[AssetLoader] Failed to load texture from data URI, falling back to path:",r),await oe.Assets.load(e)}return await oe.Assets.load(e)}static async loadJSON(e,i){let n=C==="publish",a=n&&K!==!1;if(console.log(`[AssetLoader] loadJSON - Effective mode: ${C}, isPublishMode: ${n}, inlineData: ${i?"EXISTS":"MISSING"}`),a){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!i)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${e}`);if(typeof i=="object"&&i!==null)return i;if(typeof i=="string"&&i.startsWith("data:")){let s=atob(i.split(",")[1]);return JSON.parse(s)}return JSON.parse(i)}if(i){if(typeof i=="object"&&i!==null)return i;if(typeof i=="string"&&i.startsWith("data:")){let s=atob(i.split(",")[1]);return JSON.parse(s)}return JSON.parse(i)}let r=await fetch(e);if(!r.ok)throw new Error(`JSON fetch failed: ${e}`);return r.json()}static handleFailure(e,i,n){if(C==="dev"){let r=i==="image"?Os():ai({__placeholder:!0,type:i});return re.set(e+":"+((n==null?void 0:n.path)||"missing"),r),r}throw n}};ri("image",async(t,e)=>{let i=C==="publish",n=i&&K!==!1,a=C==="brand",r=i&&K===!1;if(console.log(`[AssetLoader] registerType('image') - Effective mode: ${C}, isPublishMode: ${i}, isBrandMode: ${a}, inlineData: ${e?"EXISTS":"MISSING"}`),n){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!e)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${t}`);if(typeof e!="string"||!e.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI string, got: ${typeof e}`);return oe.Assets.load(e)}let s=t;return(a||r)&&t&&!t.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(s=t,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${t}" as-is`)):(s=`assets/${t}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${t}" -> "${s}"`))),oe.Assets.load(e||s)});ri("json",async(t,e)=>{let i=C==="publish",n=i&&K!==!1,a=C==="brand",r=i&&K===!1;if(console.log(`[AssetLoader] registerType('json') - Effective mode: ${C}, isPublishMode: ${i}, isBrandMode: ${a}, inlineData: ${e?"EXISTS":"MISSING"}`),n){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!e)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${t}`);return typeof e=="object"&&e!==null?e:typeof e=="string"&&e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e)}let s=t;if((a||r)&&t&&!t.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(s=t,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${t}" as-is`)):(s=`assets/${t}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${t}" -> "${s}"`))),e)return typeof e=="object"&&e!==null?e:typeof e=="string"&&e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e);let o=await fetch(s);if(!o.ok)throw new Error(`JSON fetch failed: ${t}`);return o.json()})});var oi,$s,wt,Ke=ne(()=>{"use strict";vt();oi=class{constructor(){this.textures=new Map;this.readyPromise=null;this.priorityReadyPromise=null;this.priorityReadyResolve=null;this.config=null;this.app=null;this.attempted=new Set;this.waiters=new Set}init(e,i){if(this.config===e&&this.app===i&&this.priorityReadyPromise){console.log("[AssetTextures] init called with same config/app; keeping existing state");return}this.textures.clear(),this.readyPromise=null,this.priorityReadyPromise=null,this.priorityReadyResolve=null,this.attempted.clear(),this.waiters.clear(),this.priorityReadyPromise=new Promise(n=>{this.priorityReadyResolve=n}),this.config=e,this.app=i,console.log("[AssetTextures] Initialized with config, cleared previous textures")}async ready(){if(this.readyPromise){await this.readyPromise;return}if(!this.config)throw new Error("[AssetTextures] Must call init() before ready() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before ready() - app is null");let e=this.config,i=this.app;return this.readyPromise=(async()=>{var s;console.log("[AssetTextures] Loading all assets...");let n=new Set(["background_loading_1"]),a=[],r=[];for(let[o,l]of e.objects.entries()){let d=(s=l.render)==null?void 0:s.asset;if(!d)continue;let p=async()=>{var c;try{let g=(c=l.identity)==null?void 0:c.id;console.log(`[AssetTextures] Loading ${d.type}: ${o} (${g})`);let u=await Se.load(o,d,i,g);this.textures.set(o,u),console.log(`[AssetTextures] \u2713 Loaded: ${o}`)}catch(g){console.error(`[AssetTextures] \u2717 Failed to load: ${o}`,g)}finally{this.attempted.add(o);try{for(let g of Array.from(this.waiters))g()}catch{}}};n.has(o)?a.push(p()):r.push(p())}a.length>0&&(console.log("[AssetTextures] Phase 1: Loading priority assets (loading screen)..."),await Promise.all(a),console.log("[AssetTextures] Phase 1: Priority assets ready")),this.priorityReadyResolve&&this.priorityReadyResolve(),console.log("[AssetTextures] Phase 2: Loading remaining assets..."),await Promise.all(r),console.log("[AssetTextures] All textures loaded:",Array.from(this.textures.keys()))})(),this.readyPromise}async priorityReady(){return this.priorityReadyPromise?this.priorityReadyPromise:Promise.resolve()}async waitFor(e,i={}){if(!this.config)throw new Error("[AssetTextures] Must call init() before waitFor() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before waitFor() - app is null");let a=Array.from(new Set((e||[]).filter(o=>typeof o=="string"&&o))).filter(o=>{var l,d,p,c;try{let g=(p=(d=(l=this.config)==null?void 0:l.objects)==null?void 0:d.get)==null?void 0:p.call(d,o);return!!((c=g==null?void 0:g.render)!=null&&c.asset)}catch{return!1}});if(a.length===0)return;this.ready().catch(()=>{});let r=()=>a.every(o=>this.textures.has(o)||this.attempted.has(o));if(r())return;let s=typeof i.timeoutMs=="number"?i.timeoutMs:15e3;await new Promise(o=>{let l=!1,d=()=>{l||r()&&(l=!0,this.waiters.delete(d),o())};this.waiters.add(d),d(),s>0&&setTimeout(()=>{l||(l=!0,this.waiters.delete(d),console.warn("[AssetTextures] waitFor timed out; continuing",{ids:a}),o())},s)})}get(e){return this.textures.get(e)}set(e,i){this.textures.set(e,i),console.log(`[AssetTextures] Updated texture: ${e}`)}clear(){this.textures.clear(),this.readyPromise=null,console.log("[AssetTextures] Cleared all textures")}getAllIds(){return Array.from(this.textures.keys())}},$s=new oi,wt=new Proxy($s,{get(t,e){return e in t&&typeof t[e]=="function"?t[e].bind(t):t.get(e)},set(t,e,i){return t.set(e,i),!0}})});var so,fe=ne(()=>{"use strict";so="handler_preview_override_mode";if(typeof window!="undefined"){let t=window.localStorage.getItem(so);window.__enableConfigOverrides=t===null?!0:t==="true"}});var Wa,Te,Ec,pi=ne(()=>{"use strict";fe();Wa=null,Te="dev";if(typeof window!="undefined"){let t=window.__BUILD_SETTINGS__;if(t!=null&&t.buildMode)Wa=t,Te=t.buildMode,console.log("[CONFIG] Loaded inline build settings:",t,"buildMode:",Te);else try{let e=new XMLHttpRequest;if(e.open("GET","./build-settings.json",!1),e.send(),e.status===200&&e.responseText){let i=JSON.parse(e.responseText);Wa=i,Te=i.buildMode||"dev",console.log("[CONFIG] Loaded build settings:",i,"buildMode:",Te)}else console.log("[CONFIG] No build-settings.json found, using default buildMode:",Te)}catch(e){console.log("[CONFIG] Failed to load build-settings.json:",e instanceof Error?e.message:String(e))}}console.log("[CONFIG] Final buildMode:",Te);Ec=Te==="dev"||typeof window!="undefined"&&window.location.search.includes("hot-reload")});var ui=ne(()=>{"use strict"});var Ya=ne(()=>{"use strict";ui();pi()});var gi=ne(()=>{"use strict";pi();ui();Ya()});var tr={};sa(tr,{AssetEditorModal:()=>wi});var wi,xi=ne(()=>{"use strict";wi=class{constructor(){this.modal=null;this.currentObjectId=null;this.currentPath=null;this.currentAsset="";this.onApplyCallback=null}show(e,i,n,a){this.currentObjectId=e,this.currentPath=i,this.currentAsset=n,this.onApplyCallback=a,this.createModal(e,n),document.body.appendChild(this.modal),this.attachModalListeners()}createModal(e,i){let n=document.createElement("div");n.className="asset-editor-modal",n.innerHTML=`
|
|
1
|
+
"use strict";var fs=Object.create;var ft=Object.defineProperty;var ms=Object.getOwnPropertyDescriptor;var bs=Object.getOwnPropertyNames;var ys=Object.getPrototypeOf,vs=Object.prototype.hasOwnProperty;var ne=(t,e)=>()=>(t&&(e=t(t=0)),e);var sa=(t,e)=>{for(var i in e)ft(t,i,{get:e[i],enumerable:!0})},oa=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of bs(e))!vs.call(t,a)&&a!==i&&ft(t,a,{get:()=>e[a],enumerable:!(n=ms(e,a))||n.enumerable});return t};var ae=(t,e,i)=>(i=t!=null?fs(ys(t)):{},oa(e||!t||!t.__esModule?ft(i,"default",{value:t,enumerable:!0}):i,t)),ws=t=>oa(ft({},"__esModule",{value:!0}),t);var re,ii=ne(()=>{"use strict";re=class{static get(e){var i;return(i=this.store.get(e))==null?void 0:i.data}static set(e,i){this.store.set(e,{data:i})}static has(e){return this.store.has(e)}static clear(){this.store.clear()}};re.store=new Map});function _s(){var t,e;try{let i=typeof window!="undefined"&&(document.querySelector('script[src*="inline-assets.js"]')||((e=(t=document.querySelector("script"))==null?void 0:t.textContent)==null?void 0:e.includes("inline-assets.js"))||window.INLINE_ASSETS),n=typeof window!="undefined"&&document.querySelector('link[href*="assets/"], script[src*="assets/"]');return!!(i&&!n)}catch{return!1}}async function ks(){try{if(typeof window!="undefined"){let t=await fetch("./build-settings.json");if(t.ok){let e=await t.json();return console.log("[AssetLoader] Loaded build settings:",e),e}}}catch{}return null}function Ms(){try{if(typeof window!="undefined"){let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);return console.log("[AssetLoader] Loaded build settings (sync):",e),e}}}catch{}return null}async function Ps(){if(console.log(`[AssetLoader] getInlineAssets() called - Effective mode: ${C}`),Object.keys(se).length>0)return console.log("[AssetLoader] Returning cached inline assets:",Object.keys(se)),se;if(typeof window!="undefined"&&window.INLINE_ASSETS)return console.log("[AssetLoader] Using pre-loaded INLINE_ASSETS from window:",Object.keys(window.INLINE_ASSETS)),se={...window.INLINE_ASSETS},se;if(!(C==="publish"&&K!==!1))return console.log("[AssetLoader] Inline assets disabled for this build mode."),se;if(!ni){let e=typeof window!="undefined"?new URL("inline-assets.js",window.location.href).href:"./inline-assets.js";console.log("[AssetLoader] Loading inline assets from:",e),ni=(async()=>{try{try{let r=await import(e+"?t="+Date.now());if(r.INLINE_ASSETS)return console.log("[AssetLoader] Loaded INLINE_ASSETS via ES module:",Object.keys(r.INLINE_ASSETS)),r.INLINE_ASSETS}catch(r){console.warn("[AssetLoader] ES module import failed, trying text parse:",r)}let i=await fetch(e);if(!i.ok)throw new Error(`HTTP ${i.status}: ${i.statusText}`);let n=await i.text();console.log("[AssetLoader] Received JS code, length:",n.length);let a=n.match(/export\s+const\s+INLINE_ASSETS\s*=\s*({[\s\S]*?});?\s*$/m);if(a)try{let r=a[1];console.log("[AssetLoader] Found INLINE_ASSETS export, parsing...");let s=new Function("return "+r)();return console.log("[AssetLoader] Parsed inline assets:",Object.keys(s)),s}catch(r){return console.warn("[AssetLoader] Failed to parse inline assets:",r),{}}else return console.warn("[AssetLoader] INLINE_ASSETS export not found in response"),console.log("[AssetLoader] JS code preview:",n.substring(0,500)),{}}catch(i){return console.warn("[AssetLoader] Failed to load inline assets:",i),{}}})()}return se=await ni,console.log("[AssetLoader] Final inline assets cache:",Object.keys(se)),se}function ai(t){return t===null||typeof t!="object"||(Object.freeze(t),Object.values(t).forEach(e=>ai(e))),t}function Os(t=64,e=64,i=16711680){let n=document.createElement("canvas");n.width=t,n.height=e;let a=n.getContext("2d");return a.fillStyle=`#${i.toString(16).padStart(6,"0")}`,a.fillRect(0,0,t,e),a.strokeStyle="#000",a.strokeRect(0,0,t,e),a.fillStyle="#fff",a.font="10px sans-serif",a.textAlign="center",a.fillText("MISSING",t/2,e/2),oe.Texture.from(n)}function ri(t,e){Fa.set(t,e)}var oe,Ha,Na,Ee,C,K,he,se,ni,Fa,Se,vt=ne(()=>{"use strict";oe=require("pixi.js");ii();Ha=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Na=_s(),Ee=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,C=Na?"publish":Ha,K=Ee==null?void 0:Ee.assetsInlined;Ee!=null&&Ee.buildMode&&(C=Ee.buildMode,console.log(`[AssetLoader] Build mode overridden by inline settings: ${C}`));he=Ms();he!=null&&he.buildMode&&(C=he.buildMode,console.log(`[AssetLoader] Build mode overridden by sync settings: ${C}`));(he==null?void 0:he.assetsInlined)!==void 0&&(K=he.assetsInlined);ks().then(t=>{t!=null&&t.buildMode&&t.buildMode!==C&&(C=t.buildMode,console.log(`[AssetLoader] Build mode overridden by settings: ${C}`)),(t==null?void 0:t.assetsInlined)!==void 0&&(K=t.assetsInlined)}).catch(()=>{});console.log(`[AssetLoader] MODULE LOADED - Compile: ${Ha}, Runtime: ${Na?"publish":"dev"}, Effective: ${C}`);se={},ni=null;Fa=new Map;Se=class{static async load(e,i,n,a){let r=`${e}:${i.path}`,s=re.get(r);if(s!==void 0)return s;console.log(`[AssetLoader] Loading asset: ${e}, type: ${i.type}, Effective mode: ${C}`),console.log(`[AssetLoader] Window defined: ${typeof window!="undefined"}, INLINE_ASSETS exists: ${!!(typeof window!="undefined"&&window.INLINE_ASSETS)}, keys: ${typeof window!="undefined"&&window.INLINE_ASSETS?Object.keys(window.INLINE_ASSETS).length:"N/A"}`);let o=await Ps(),l=o[e];if(!l&&a&&(l=o[a],l&&console.log(`[AssetLoader] Found inline data for ${e} using configId: ${a}`)),!l&&i.path){let c=i.path.split("/");if(c.length>=2){let g=c[c.length-1].split(".")[0];o[g]&&(l=o[g],console.log(`[AssetLoader] Found inline data for ${e} using assetName: ${g}`))}}if(console.log("[AssetLoader] Inline data for",e,":",l?"FOUND":"NOT FOUND"),C==="publish"&&K!==!1&&(console.log("[AssetLoader] \u26A0\uFE0F PUBLISH MODE DETECTED - inline assets are MANDATORY"),!l))throw new Error(`[AssetLoader] PUBLISH MODE: Inline asset required but NOT FOUND for object: ${e}, path: ${i.path}`);let p=Fa.get(i.type);if(p)try{let c=await p(i.path,l,e,n);return re.set(r,c),c}catch(c){return this.handleFailure(e,i.type,c)}try{let c;switch(i.type){case"image":c=await this.loadImage(i.path,l);break;case"json":c=await this.loadJSON(i.path,l),c=ai(c);break;default:throw new Error(`Unknown asset type: ${i.type}`)}return re.set(r,c),c}catch(c){return this.handleFailure(e,i.type,c)}}static async loadImage(e,i){let n=C==="publish",a=n&&K!==!1;if(console.log(`[AssetLoader] loadImage - Effective mode: ${C}, isPublishMode: ${n}, inlineData: ${i?"EXISTS":"MISSING"}`),a){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!i)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for object. Path: ${e}`);if(typeof i!="string"||!i.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI string, got: ${typeof i}`);try{return await oe.Assets.load(i)}catch(r){throw console.error("[AssetLoader] Failed to load texture from data URI:",r),r}}if(i&&typeof i=="string"&&i.startsWith("data:"))try{return await oe.Assets.load(i)}catch(r){return console.error("[AssetLoader] Failed to load texture from data URI, falling back to path:",r),await oe.Assets.load(e)}return await oe.Assets.load(e)}static async loadJSON(e,i){let n=C==="publish",a=n&&K!==!1;if(console.log(`[AssetLoader] loadJSON - Effective mode: ${C}, isPublishMode: ${n}, inlineData: ${i?"EXISTS":"MISSING"}`),a){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!i)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${e}`);if(typeof i=="object"&&i!==null)return i;if(typeof i=="string"&&i.startsWith("data:")){let s=atob(i.split(",")[1]);return JSON.parse(s)}return JSON.parse(i)}if(i){if(typeof i=="object"&&i!==null)return i;if(typeof i=="string"&&i.startsWith("data:")){let s=atob(i.split(",")[1]);return JSON.parse(s)}return JSON.parse(i)}let r=await fetch(e);if(!r.ok)throw new Error(`JSON fetch failed: ${e}`);return r.json()}static handleFailure(e,i,n){if(C==="dev"){let r=i==="image"?Os():ai({__placeholder:!0,type:i});return re.set(e+":"+((n==null?void 0:n.path)||"missing"),r),r}throw n}};ri("image",async(t,e)=>{let i=C==="publish",n=i&&K!==!1,a=C==="brand",r=i&&K===!1;if(console.log(`[AssetLoader] registerType('image') - Effective mode: ${C}, isPublishMode: ${i}, isBrandMode: ${a}, inlineData: ${e?"EXISTS":"MISSING"}`),n){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!e)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${t}`);if(typeof e!="string"||!e.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI string, got: ${typeof e}`);return oe.Assets.load(e)}let s=t;return(a||r)&&t&&!t.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(s=t,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${t}" as-is`)):(s=`assets/${t}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${t}" -> "${s}"`))),oe.Assets.load(e||s)});ri("json",async(t,e)=>{let i=C==="publish",n=i&&K!==!1,a=C==="brand",r=i&&K===!1;if(console.log(`[AssetLoader] registerType('json') - Effective mode: ${C}, isPublishMode: ${i}, isBrandMode: ${a}, inlineData: ${e?"EXISTS":"MISSING"}`),n){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!e)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${t}`);return typeof e=="object"&&e!==null?e:typeof e=="string"&&e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e)}let s=t;if((a||r)&&t&&!t.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(s=t,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${t}" as-is`)):(s=`assets/${t}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${t}" -> "${s}"`))),e)return typeof e=="object"&&e!==null?e:typeof e=="string"&&e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e);let o=await fetch(s);if(!o.ok)throw new Error(`JSON fetch failed: ${t}`);return o.json()})});var oi,Ds,wt,Ke=ne(()=>{"use strict";vt();oi=class{constructor(){this.textures=new Map;this.readyPromise=null;this.priorityReadyPromise=null;this.priorityReadyResolve=null;this.config=null;this.app=null;this.attempted=new Set;this.waiters=new Set}init(e,i){if(this.config===e&&this.app===i&&this.priorityReadyPromise){console.log("[AssetTextures] init called with same config/app; keeping existing state");return}this.textures.clear(),this.readyPromise=null,this.priorityReadyPromise=null,this.priorityReadyResolve=null,this.attempted.clear(),this.waiters.clear(),this.priorityReadyPromise=new Promise(n=>{this.priorityReadyResolve=n}),this.config=e,this.app=i,console.log("[AssetTextures] Initialized with config, cleared previous textures")}async ready(){if(this.readyPromise){await this.readyPromise;return}if(!this.config)throw new Error("[AssetTextures] Must call init() before ready() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before ready() - app is null");let e=this.config,i=this.app;return this.readyPromise=(async()=>{var s;console.log("[AssetTextures] Loading all assets...");let n=new Set(["background_loading_1"]),a=[],r=[];for(let[o,l]of e.objects.entries()){let d=(s=l.render)==null?void 0:s.asset;if(!d)continue;let p=async()=>{var c;try{let g=(c=l.identity)==null?void 0:c.id;console.log(`[AssetTextures] Loading ${d.type}: ${o} (${g})`);let u=await Se.load(o,d,i,g);this.textures.set(o,u),console.log(`[AssetTextures] \u2713 Loaded: ${o}`)}catch(g){console.error(`[AssetTextures] \u2717 Failed to load: ${o}`,g)}finally{this.attempted.add(o);try{for(let g of Array.from(this.waiters))g()}catch{}}};n.has(o)?a.push(p()):r.push(p())}a.length>0&&(console.log("[AssetTextures] Phase 1: Loading priority assets (loading screen)..."),await Promise.all(a),console.log("[AssetTextures] Phase 1: Priority assets ready")),this.priorityReadyResolve&&this.priorityReadyResolve(),console.log("[AssetTextures] Phase 2: Loading remaining assets..."),await Promise.all(r),console.log("[AssetTextures] All textures loaded:",Array.from(this.textures.keys()))})(),this.readyPromise}async priorityReady(){return this.priorityReadyPromise?this.priorityReadyPromise:Promise.resolve()}async waitFor(e,i={}){if(!this.config)throw new Error("[AssetTextures] Must call init() before waitFor() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before waitFor() - app is null");let a=Array.from(new Set((e||[]).filter(o=>typeof o=="string"&&o))).filter(o=>{var l,d,p,c;try{let g=(p=(d=(l=this.config)==null?void 0:l.objects)==null?void 0:d.get)==null?void 0:p.call(d,o);return!!((c=g==null?void 0:g.render)!=null&&c.asset)}catch{return!1}});if(a.length===0)return;this.ready().catch(()=>{});let r=()=>a.every(o=>this.textures.has(o)||this.attempted.has(o));if(r())return;let s=typeof i.timeoutMs=="number"?i.timeoutMs:15e3;await new Promise(o=>{let l=!1,d=()=>{l||r()&&(l=!0,this.waiters.delete(d),o())};this.waiters.add(d),d(),s>0&&setTimeout(()=>{l||(l=!0,this.waiters.delete(d),console.warn("[AssetTextures] waitFor timed out; continuing",{ids:a}),o())},s)})}get(e){return this.textures.get(e)}set(e,i){this.textures.set(e,i),console.log(`[AssetTextures] Updated texture: ${e}`)}clear(){this.textures.clear(),this.readyPromise=null,console.log("[AssetTextures] Cleared all textures")}getAllIds(){return Array.from(this.textures.keys())}},Ds=new oi,wt=new Proxy(Ds,{get(t,e){return e in t&&typeof t[e]=="function"?t[e].bind(t):t.get(e)},set(t,e,i){return t.set(e,i),!0}})});var so,fe=ne(()=>{"use strict";so="handler_preview_override_mode";if(typeof window!="undefined"){let t=window.localStorage.getItem(so);window.__enableConfigOverrides=t===null?!0:t==="true"}});var Wa,Te,Ec,pi=ne(()=>{"use strict";fe();Wa=null,Te="dev";if(typeof window!="undefined"){let t=window.__BUILD_SETTINGS__;if(t!=null&&t.buildMode)Wa=t,Te=t.buildMode,console.log("[CONFIG] Loaded inline build settings:",t,"buildMode:",Te);else try{let e=new XMLHttpRequest;if(e.open("GET","./build-settings.json",!1),e.send(),e.status===200&&e.responseText){let i=JSON.parse(e.responseText);Wa=i,Te=i.buildMode||"dev",console.log("[CONFIG] Loaded build settings:",i,"buildMode:",Te)}else console.log("[CONFIG] No build-settings.json found, using default buildMode:",Te)}catch(e){console.log("[CONFIG] Failed to load build-settings.json:",e instanceof Error?e.message:String(e))}}console.log("[CONFIG] Final buildMode:",Te);Ec=Te==="dev"||typeof window!="undefined"&&window.location.search.includes("hot-reload")});var ui=ne(()=>{"use strict"});var Ya=ne(()=>{"use strict";ui();pi()});var gi=ne(()=>{"use strict";pi();ui();Ya()});var tr={};sa(tr,{AssetEditorModal:()=>wi});var wi,xi=ne(()=>{"use strict";wi=class{constructor(){this.modal=null;this.currentObjectId=null;this.currentPath=null;this.currentAsset="";this.onApplyCallback=null}show(e,i,n,a){this.currentObjectId=e,this.currentPath=i,this.currentAsset=n,this.onApplyCallback=a,this.createModal(e,n),document.body.appendChild(this.modal),this.attachModalListeners()}createModal(e,i){let n=document.createElement("div");n.className="asset-editor-modal",n.innerHTML=`
|
|
2
2
|
<div class="asset-editor-card">
|
|
3
3
|
<div class="asset-editor-header">
|
|
4
4
|
<div>
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
<button class="debug-btn primary" data-modal-apply>Apply</button>
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
|
-
`,this.modal=n}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(s=>{s.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(s=>{s.addEventListener("click",o=>{let d=o.target.dataset.tab;d&&this.switchTab(d)})});let n=this.modal.querySelector("[data-ai-generate]");n==null||n.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let r=this.modal.querySelector("[data-modal-apply]");r==null||r.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.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 i=window.__openAiEditor;if(typeof i!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";e==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,i(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Ko={};sa(Ko,{AspectClass:()=>Ii,GameObject:()=>ot,GameObjectManager:()=>Dt,Renderer:()=>st,ResponsiveUISystem:()=>Ge,Transform:()=>rt,animateHandClick:()=>wr,animatePanelEntrance:()=>vr,createBrushTexture:()=>Lr,createEndGamePanel:()=>yr,createHandTutorial:()=>xr,createThreeBase:()=>fr,createTutorialLabel:()=>Er,getAspectClass:()=>zt,getRegisteredFontIds:()=>br,loadAsset:()=>zi,loadCharacterFrames:()=>Tr,registerFont:()=>mr,resolveFont:()=>Z,resolveFontWeight:()=>Q,updateHandAnimation:()=>Sr});module.exports=ws(Ko);var V=ae(require("three"),1);var ge={};function mt(t,e,i=!1){ge[t]||(ge[t]=[]),ge[t].push({fn:e,once:i})}function Kt(t,e){if(ge[t]){if(!e){delete ge[t];return}ge[t]=ge[t].filter(i=>i.fn!==e)}}function bt(t,...e){let i=ge[t];if(i)for(let n of[...i])n.fn(...e),n.once&&Kt(t,n.fn)}function B(t,e){mt(t,e,!0)}var M=null,W=[],Pe=null;function da(t){M=t,W=[],Pe!==null&&(clearTimeout(Pe),Pe=null)}function pa(){var t,e,i;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:(i=M==null?void 0:M.maxQueue)!=null?i:200,debug:!!(M!=null&&M.debug)}}async function la(t,e,i,n){let a=JSON.stringify(e);if(i==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let r=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",r,e);return}catch(r){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",r)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",e)}catch(r){n&&console.warn("[handler.telemetry] fetch failed",r)}}function Jt(t,e){let i=pa();if(e&&i.endpoint){if(W.push(t),W.length>i.maxQueue&&(W=W.slice(W.length-i.maxQueue)),W.length>=i.batchSize){ca();return}Pe===null&&(Pe=window.setTimeout(()=>{Pe=null,ca()},i.flushIntervalMs))}}async function ca(){let t=pa();if(!t.endpoint||W.length===0)return;let e=W.splice(0,t.batchSize);await la(t.endpoint,{events:e},t.transport,t.debug),W.length>0&&await la(t.endpoint,{events:W.splice(0,t.batchSize)},t.transport,t.debug)}function ua(t){return Math.max(0,Math.min(1,t))}function xs(t){let e=String(t!=null?t:"power2.out");if(e==="linear")return i=>i;if(e==="sine.inOut")return i=>.5-Math.cos(Math.PI*i)/2;if(e==="power2.out"||e==="easeOutQuad")return i=>1-(1-i)*(1-i);if(e.startsWith("back.out")){let i=e.match(/back\.out\(([\d.]+)\)/),n=i?Number(i[1]):1.8;return a=>1+(n+1)*Math.pow(a-1,3)+n*Math.pow(a-1,2)}return i=>1-(1-i)*(1-i)}function Ve(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Es(t,e){let i=t==null?void 0:t[e];return typeof i=="number"?i:0}function ga(t,e,i){try{t[e]=i}catch{}}function Ss(t){let e=t==null?void 0:t.scale;if(!e)return null;let i=typeof e.x=="number"?e.x:1,n=typeof e.y=="number"?e.y:1;return{x:i,y:n}}function ha(t,e){let i=t==null?void 0:t.scale;if(i)try{typeof i.set=="function"?i.set(e.x,e.y):(typeof i.x=="number"&&(i.x=e.x),typeof i.y=="number"&&(i.y=e.y))}catch{}}function fa(t,e){let i=Ss(t);if(!i)return{from:null,to:null};let n=null,a=null;return typeof e.scale=="number"?(n=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(n=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(n=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),n===null&&a===null?{from:null,to:null}:{from:{x:i.x,y:i.y},to:{x:n!=null?n:i.x,y:a!=null?a:i.y}}}function ma(){let t=new Set,e=new WeakMap,i=null,n=()=>{if(i!=null)return;i=requestAnimationFrame(()=>{i=null,o(),t.size>0&&n()})},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),n()},r=p=>{t.delete(p);let c=e.get(p.target);c&&(c.delete(p),c.size===0&&e.delete(p.target))},s=p=>{p.killed||(p.killed=!0,r(p))},o=()=>{var c,g;let p=Ve();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let b=p-u.startMs-u.delayMs;if(b<0)continue;let h=u.durationMs>0?b/u.durationMs:1,w=ua(h),v=u.repeat>=0?u.repeat+1:1,y=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let E=h-y;w=ua(E)}let f=u.ease(w);u.yoyo&&y%2===1&&(f=1-f);for(let E of u.props)ga(u.target,E.key,E.from+(E.to-E.from)*f);u.scaleFrom&&u.scaleTo&&ha(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*f,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*f});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){s(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var E;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),b=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((E=g==null?void 0:g.delayMsOverride)!=null?E:0)),h=xs(c.ease),w=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),f=[];for(let S of Object.keys(c)){if(y.has(S))continue;let A=c[S];typeof A=="number"&&f.push({key:S,from:Es(p,S),to:A})}let m=fa(p,c);return{target:p,startMs:Ve(),delayMs:b,durationMs:u,ease:h,props:f,scaleFrom:m.from,scaleTo:m.to,repeat: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:()=>s(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ve())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ve(),b=Ve()-u;g.startMs+=b,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let b=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof b=="number"&&ga(p,u,b)}let g=fa(p,c);g.to&&ha(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))s(g)},timeline(p={}){let c=[],g=0,u=!1,b=[],h=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let f=typeof y=="string"?y.trim():"";return f.startsWith("+=")?g+Math.max(0,Number(f.slice(2))*1e3||0):f?Math.max(0,Number(f)*1e3||0):g},w=y=>{c.push(y);let f=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);g=Math.max(g,y.atMs+f)},v={to(y,f,m){return w({kind:"to",target:y,vars:f,atMs:h(m)}),v},fromTo(y,f,m,E){return w({kind:"fromTo",target:y,vars:m,from:f,atMs:h(E)}),v},play(){var y,f;if(u)return v;u=!0,b=[];for(let m of c)m.kind==="fromTo"&&d.set(m.target,(y=m.from)!=null?y:{}),b.push(d.to(m.target,{...m.vars,delay:m.atMs/1e3+((f=m.vars.delay)!=null?f:0)}));return v},pause(){for(let y of b)y.pause();return v},kill(){for(let y of b)y.kill();b=[],u=!1}};return p.paused||v.play(),v}};return d}function ba(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=ma()}catch{}}var ya={name:"handler-playable-sdk",version:"0.5.26",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var G=0,Cs=G++,va=G++,wa=G++,xa=G++,Ea=G++,Sa=G++,Aa=G++,Ca=G++,Ta=G++,La=G++,_a=G++,ka=G++,T=Cs;function Ma(){return T===va}function Pa(){return T===wa}function Oa(){return T===xa}function Ia(){return T===Ea}function Oe(){return T===Sa}function Ie(){return T===Aa}function Ra(){return T===Ca}function ja(){return T===Ta}function za(){return T===La}function Zt(){return T===_a}function Qt(){return T===ka}function Da(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),T=va;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=wa;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=xa)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Ea)}catch{}else if(e==="mintegral")window.gameReady&&(T=Sa);else if(e==="tapjoy")window.TJ_API&&(T=Aa);else if(e==="tiktok")window.openAppStore&&(T=Ca);else if(e==="smadex")try{window.smxTracking&&(T=Ta)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=La)}catch{}else e==="vungle"?T=_a:(t==="nucleo"||e==="nucleo")&&(T=ka)}var yt=ae(require("lottie-web"),1),$a=yt.default;typeof window!="undefined"&&(window.lottie=yt.default,window.__baseLottie=yt.default);var Ts=require("pixi.js");var ei=require("pixi.js");var Ls=null;function ti(t){Ls=t}vt();ii();var Ye=require("pixi.js");vt();var Is=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",si=Is;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&&(si=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${si}`))}}catch{}function Rs(t){var i,n,a,r,s;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:(i=t[0])!=null?i:.5,y:(n=t[1])!=null?n:.5};if(t&&typeof t=="object"&&"x"in t&&"y"in t)return{x:(a=t.x)!=null?a:.5,y:(r=t.y)!=null?r:.5};if(typeof t=="string"){let o=t.trim().toLowerCase();return(s=e[o])!=null?s:{x:.5,y:.5}}return null}var Ae=class{static async create(e,i,n){var l,d,p,c,g,u,b;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${si}`);let a=(l=i==null?void 0:i.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Ye.Container;return this.applyTransform(h,i==null?void 0:i.transform,i),h}let r=(d=i==null?void 0:i.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${r}, type: ${a.type}, path: ${a.path}`);let s=await Se.load(e,a,n,r);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=s==null?void 0:s.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",s,"for object:",e),o=new Ye.Sprite(s),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,i==null?void 0:i.transform,i);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=s==null?void 0:s.constructor)==null?void 0:g.name,s),s&&(((u=s.constructor)==null?void 0:u.name)==="Container"||s instanceof Ye.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],w=!1;for(let v of h)try{let y=await fetch(v);if(y.ok){o=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(b=o==null?void 0:o.constructor)==null?void 0:b.name),w=!0;break}}catch{continue}w||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=s)}else o=s;else o=s,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,i==null?void 0:i.transform,i);return o}static applyTransform(e,i,n){var a,r,s,o;if(!(!i||!e)&&(i.position&&("x"in e&&"y"in e?(e.x=(a=i.position.x)!=null?a:0,e.y=(r=i.position.y)!=null?r:0):"position"in e&&e.position&&e.position.set((s=i.position.x)!=null?s:0,(o=i.position.y)!=null?o:0)),i.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(i.scale):e.scale=i.scale),i.rotation!==void 0&&"rotation"in e&&(e.rotation=i.rotation),i.anchor&&"anchor"in e&&e.anchor)){let l=Rs(i.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var Xe=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 Ds=ae(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Ds);Ke();var xt=require("pixi.js");Ke();var li=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Xe}init(e,i){this.registry.init(e),this.app=i}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let i=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(i.length===0)return;let n=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async r=>{var o;let s=this.registry.get(r);if(!s){console.warn("[Assets] No config found for object:",r);return}try{let l=await Ae.create(r,s,this.app);this.instanceCache.set(r,l),console.log("[Assets] Loaded object:",r,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",r,l)}})))};return this.readyPromise=(async()=>{await n(i);let a=this.registry.getAllIds().filter(r=>!this.instanceCache.has(r));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await n(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 i=this.registry.get(e);if(i){let n=await Ae.create(e,i,this.app);this.instanceCache.set(e,n)}}get(e){return this.instanceCache.get(e)}},Hs=new li,Fs=new Proxy(Hs,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Ke();var Ba=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},St={scale:1,position:1},di=[];function Gs(t,e,i,n,a,r,s){di.push({element:t,originalScale:r,positionHelper:e,heightPercent:a}),e(t,i,n,a,r,s,!1)}function Us(){di.forEach(({element:t,originalScale:e,positionHelper:i,heightPercent:n})=>{let a=e*le.scaleFactor;i(t,le.width,le.height,n,a,!0,!1)})}function ci(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),le.width=t,le.height=e,le.scaleFactor=Math.min(t/le.designWidth,1.15),St.scale=le.scaleFactor,St.position=1,console.log(`[SCREEN] Global multipliers - scale: ${St.scale.toFixed(3)}`),Us()}var Ze={layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}};function qs(t,e,i){let n=Ze[t];n&&n[e]!==void 0&&(n[e]=i,console.log(`Updated ${t}.${e} = ${i}`))}function Ws(){return Ze}var Vs={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function Et(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function At(t,e={x:.5,y:.5}){var i;if(Array.isArray(t))return{x:Et(t[0],e.x),y:Et(t[1],e.y)};if(t&&typeof t=="object"){let n=t;return{x:Et(n.x,e.x),y:Et(n.y,e.y)}}if(typeof t=="string"){let n=t.trim().toLowerCase();return(i=Vs[n])!=null?i:e}return e}function Ga(t,e,i,n={}){var u,b,h,w,v,y;let a=At(i),r=(u=n.inset)!=null?u:{},s=(b=n.padding)!=null?b:{x:0,y:0},o=((h=r.left)!=null?h:0)+s.x,l=((w=r.right)!=null?w:0)+s.x,d=((v=r.top)!=null?v:0)+s.y,p=((y=r.bottom)!=null?y:0)+s.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function Ua(t,e,i,n={}){var h,w,v,y,f,m;let a=(h=n.inset)!=null?h:{},r=(w=n.padding)!=null?w:{x:0,y:0},s=((v=a.left)!=null?v:0)+r.x,o=((y=a.right)!=null?y:0)+r.x,l=((f=a.top)!=null?f:0)+r.y,d=((m=a.bottom)!=null?m:0)+r.y,p=Math.max(0,t-s-o),c=Math.max(0,e-l-d),g=At(i,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),b=Math.min(Math.max(g.y,0),1);return{x:s+p*u,y:l+c*b}}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,i=()=>{let n=window.innerWidth,a=window.innerHeight;(n!==t||a!==e)&&(t=n,e=a,ci(n,a))};window.addEventListener("resize",i),window.addEventListener("orientationchange",()=>{setTimeout(i,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",i),window.mraid.addEventListener("sizeChange",i)),ci(window.innerWidth,window.innerHeight),window.updateDebugConfig=qs,window.getDebugConfig=Ws,window.copyConfig=ao,window.applyConfig=Je,window.applyConfigForRatio=ro,window.positionAtBottom=qa,window.positionAtTop=Ks,window.positionAtCenter=Js,window.positionAtLeft=Zs,window.positionAtRight=Qs,window.positionAtBottomLeft=eo,window.positionAtBottomRight=to,window.positionAtTopLeft=io,window.positionAtTopRight=no,window.applyPositionContract=Xs,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function Ct(t,e,i=0){return t*e+i}function Tt(t,e,i=0){return t*(1-e)+i}function Lt(t,e,i=0){return t*e+i}function _t(t,e,i=0){return t*(1-e)+i}function U(t,e=0){return t/2+e}function Ys(t,e){return t*e}function Xs(t,e,i,n){var s,o,l,d,p,c,g,u,b,h,w,v,y,f,m,E,S,A,k,O;let a=0,r=0;switch(n.type){case"top":a=U(e,(o=(s=n.offset)==null?void 0:s.x)!=null?o:0),r=Ct(i,n.percent,(d=(l=n.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=n.offset)==null?void 0:p.x)!=null?c:0),r=Tt(i,n.percent,(u=(g=n.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=Lt(e,n.percent,(h=(b=n.offset)==null?void 0:b.x)!=null?h:0),r=U(i,(v=(w=n.offset)==null?void 0:w.y)!=null?v:0);break;case"right":a=_t(e,n.percent,(f=(y=n.offset)==null?void 0:y.x)!=null?f:0),r=U(i,(E=(m=n.offset)==null?void 0:m.y)!=null?E:0);break;case"center":a=U(e,(A=(S=n.offset)==null?void 0:S.x)!=null?A:0),r=U(i,(O=(k=n.offset)==null?void 0:k.y)!=null?O:0);break}t.position?t.position.set(a,r):(t.x=a,t.y=r),n.scale!==void 0&&n.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(n.scale,n.scale):(t.scale.x=n.scale,t.scale.y=n.scale))}function qa(t,e,i,n=.2,a=1,r=!0,s=!1){let o=Ys(i,n),l=Tt(i,n/2);ce(t,U(e),l);let d=r?a*le.scaleFactor:a;de(t,d),s&&!di.find(p=>p.element===t)&&Gs(t,qa,e,i,n,a,r)}function Ks(t,e,i,n=.1,a=1){ce(t,U(e),Ct(i,n)),de(t,a)}function Js(t,e,i,n=0,a=0,r=1){ce(t,U(e,n),U(i,a)),de(t,r)}function Zs(t,e,i,n=.1,a=1){ce(t,Lt(e,n),U(i)),de(t,a)}function Qs(t,e,i,n=.1,a=1){ce(t,_t(e,n),U(i)),de(t,a)}function eo(t,e,i,n=.05,a=.05,r=1){ce(t,Lt(e,a),Tt(i,n)),de(t,r)}function to(t,e,i,n=.05,a=.05,r=1){ce(t,_t(e,a),Tt(i,n)),de(t,r)}function io(t,e,i,n=.05,a=.05,r=1){ce(t,Lt(e,a),Ct(i,n)),de(t,r)}function no(t,e,i,n=.05,a=.05,r=1){ce(t,_t(e,a),Ct(i,n)),de(t,r)}function ce(t,e,i){t&&t.position?typeof t.position.set=="function"?t.position.set(e,i):(t.position.x=e,t.position.y=i):t&&(t.x=e,t.y=i)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ce={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function ao(t){return t&&Ce[t]?JSON.parse(JSON.stringify(Ce[t])):JSON.parse(JSON.stringify(Ze))}function Je(t){Object.keys(t).forEach(e=>{let i=e;Ze[i]&&t[i]&&Object.assign(Ze[i],t[i])}),console.log("Config applied:",t)}function ro(t,e){let i=t/e;i>1.6?(Je(Ce.wide),console.log("Applied WIDE config for ratio:",i)):i<.7?(Je(Ce.tall),console.log("Applied TALL config for ratio:",i)):i>.8&&i<1.2?(Je(Ce.square),console.log("Applied SQUARE config for ratio:",i)):(Je(Ce.default),console.log("Applied DEFAULT config for ratio:",i))}if(typeof window!="undefined"){let t=window;t.configPresets=Ce,t.resolveAnchorVec2=t.resolveAnchorVec2||At,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||Ga,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||Ua}gi();function P(t,e){let i=(a,r)=>r===0?a:i(r,a%r),n=i(t,e);return`${t/n}:${e/n}`}var Bc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:P(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:P(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:P(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:P(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:P(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:P(360,780)}],Gc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:P(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:P(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:P(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:P(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:P(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:P(412,915)}],Uc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:P(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:P(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:P(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:P(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:P(800,1280)}],Xa=[{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:P(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:P(768,1024),mraidScale:.7}];var qc=[...Xa];var ho=Xa[0];fe();var wo=ae(require("jszip"),1);function bo(t){return new Promise((e,i)=>{let n=new FileReader;n.onerror=()=>i(new Error("FileReader failed")),n.onload=()=>e(String(n.result||"")),n.readAsDataURL(t)})}function yo(t){var a;let[e,i]=t.split(","),n=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:i!=null?i:"",mimeType:(a=n==null?void 0:n[1])!=null?a:"image/png"}}async function vo(t){return await new Promise(e=>{let i=new Image;i.onload=()=>e({width:i.naturalWidth||i.width,height:i.naturalHeight||i.height}),i.onerror=()=>e(null),i.src=t})}async function hi(t){var e,i;try{console.log("[ImageUtils] Fetching image data from URL:",t);let n=await fetch(t);if(!n.ok)return console.warn("[ImageUtils] Fetch failed with status:",n.status,t),null;let a=await n.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let r=await bo(a),s=await vo(r),o=yo(r);return console.log("[ImageUtils] Success resolution:",s==null?void 0:s.width,"x",s==null?void 0:s.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:r,width:(e=s==null?void 0:s.width)!=null?e:0,height:(i=s==null?void 0:s.height)!=null?i:0}}catch(n){return console.error("[ImageUtils] Error fetching image data:",n),null}}async function kt(t,e=30){try{console.log("[ImageUtils] Removing background color...");let i=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}),n=document.createElement("canvas");n.width=i.width,n.height=i.height;let a=n.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),t;a.drawImage(i,0,0);let r=a.getImageData(0,0,n.width,n.height),s=r.data,l=[{name:"top-left",offset:0},{name:"top-right",offset:(n.width-1)*4},{name:"bottom-left",offset:(n.height-1)*n.width*4},{name:"bottom-right",offset:((n.height-1)*n.width+(n.width-1))*4}].map(c=>({r:s[c.offset],g:s[c.offset+1],b:s[c.offset+2]})),d=0;for(let c=0;c<s.length;c+=4){let g=s[c],u=s[c+1],b=s[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(b-w.b,2))<e){h=!0;break}h&&(s[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(r,0,0),n.toDataURL("image/png")}catch(i){return console.error("[ImageUtils] Error removing background:",i),t}}var Ka=require("@google/genai");async function fi(t,e,i=[],n={}){var a,r,s,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<i.length;v++){let y=i[v];if(!y.base64||!y.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(y.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!y.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${y.mimeType}`)}let c=new Ka.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];i.length>0&&i.forEach((v,y)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${y+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${i.length} images and prompt length: ${e.length}`);let b=await c.models.generateContent({model:g,contents:u}),h="",w=(s=(r=(a=b.candidates)==null?void 0:a[0])==null?void 0:r.content)==null?void 0:s.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 Ja=require("@google/genai");async function Mt(t,e,i=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Ja.GoogleGenAI({apiKey:t}),r=[{text:e}];i.length>0&&i.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),r.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let s=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:r});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!s.candidates||!s.candidates[0]||!s.candidates[0].content||!s.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of s.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");Ke();fe();var Qa=require("pixi.js");var Eo=require("pixi.js");fe();function ko(t){return new Promise((e,i)=>{let n=new FileReader;n.onerror=()=>i(new Error("FileReader failed")),n.onload=()=>e(String(n.result||"")),n.readAsDataURL(t)})}function Mo(t){var a;let[e,i]=t.split(","),n=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:i!=null?i:"",mimeType:(a=n==null?void 0:n[1])!=null?a:"image/png"}}function Po(t){return`
|
|
46
|
+
`,this.modal=n}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(s=>{s.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(s=>{s.addEventListener("click",o=>{let d=o.target.dataset.tab;d&&this.switchTab(d)})});let n=this.modal.querySelector("[data-ai-generate]");n==null||n.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let r=this.modal.querySelector("[data-modal-apply]");r==null||r.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.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 i=window.__openAiEditor;if(typeof i!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";e==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,i(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Ko={};sa(Ko,{AspectClass:()=>Ii,GameObject:()=>ot,GameObjectManager:()=>$t,Renderer:()=>st,ResponsiveUISystem:()=>Ge,Transform:()=>rt,animateHandClick:()=>wr,animatePanelEntrance:()=>vr,createBrushTexture:()=>Lr,createEndGamePanel:()=>yr,createHandTutorial:()=>xr,createThreeBase:()=>fr,createTutorialLabel:()=>Er,getAspectClass:()=>zt,getRegisteredFontIds:()=>br,loadAsset:()=>zi,loadCharacterFrames:()=>Tr,registerFont:()=>mr,resolveFont:()=>Z,resolveFontWeight:()=>Q,updateHandAnimation:()=>Sr});module.exports=ws(Ko);var V=ae(require("three"),1);var ge={};function mt(t,e,i=!1){ge[t]||(ge[t]=[]),ge[t].push({fn:e,once:i})}function Kt(t,e){if(ge[t]){if(!e){delete ge[t];return}ge[t]=ge[t].filter(i=>i.fn!==e)}}function bt(t,...e){let i=ge[t];if(i)for(let n of[...i])n.fn(...e),n.once&&Kt(t,n.fn)}function B(t,e){mt(t,e,!0)}var M=null,W=[],Pe=null;function da(t){M=t,W=[],Pe!==null&&(clearTimeout(Pe),Pe=null)}function pa(){var t,e,i;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:(i=M==null?void 0:M.maxQueue)!=null?i:200,debug:!!(M!=null&&M.debug)}}async function la(t,e,i,n){let a=JSON.stringify(e);if(i==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let r=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",r,e);return}catch(r){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",r)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",e)}catch(r){n&&console.warn("[handler.telemetry] fetch failed",r)}}function Jt(t,e){let i=pa();if(e&&i.endpoint){if(W.push(t),W.length>i.maxQueue&&(W=W.slice(W.length-i.maxQueue)),W.length>=i.batchSize){ca();return}Pe===null&&(Pe=window.setTimeout(()=>{Pe=null,ca()},i.flushIntervalMs))}}async function ca(){let t=pa();if(!t.endpoint||W.length===0)return;let e=W.splice(0,t.batchSize);await la(t.endpoint,{events:e},t.transport,t.debug),W.length>0&&await la(t.endpoint,{events:W.splice(0,t.batchSize)},t.transport,t.debug)}function ua(t){return Math.max(0,Math.min(1,t))}function xs(t){let e=String(t!=null?t:"power2.out");if(e==="linear")return i=>i;if(e==="sine.inOut")return i=>.5-Math.cos(Math.PI*i)/2;if(e==="power2.out"||e==="easeOutQuad")return i=>1-(1-i)*(1-i);if(e.startsWith("back.out")){let i=e.match(/back\.out\(([\d.]+)\)/),n=i?Number(i[1]):1.8;return a=>1+(n+1)*Math.pow(a-1,3)+n*Math.pow(a-1,2)}return i=>1-(1-i)*(1-i)}function Ve(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Es(t,e){let i=t==null?void 0:t[e];return typeof i=="number"?i:0}function ga(t,e,i){try{t[e]=i}catch{}}function Ss(t){let e=t==null?void 0:t.scale;if(!e)return null;let i=typeof e.x=="number"?e.x:1,n=typeof e.y=="number"?e.y:1;return{x:i,y:n}}function ha(t,e){let i=t==null?void 0:t.scale;if(i)try{typeof i.set=="function"?i.set(e.x,e.y):(typeof i.x=="number"&&(i.x=e.x),typeof i.y=="number"&&(i.y=e.y))}catch{}}function fa(t,e){let i=Ss(t);if(!i)return{from:null,to:null};let n=null,a=null;return typeof e.scale=="number"?(n=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(n=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(n=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),n===null&&a===null?{from:null,to:null}:{from:{x:i.x,y:i.y},to:{x:n!=null?n:i.x,y:a!=null?a:i.y}}}function ma(){let t=new Set,e=new WeakMap,i=null,n=()=>{if(i!=null)return;i=requestAnimationFrame(()=>{i=null,o(),t.size>0&&n()})},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),n()},r=p=>{t.delete(p);let c=e.get(p.target);c&&(c.delete(p),c.size===0&&e.delete(p.target))},s=p=>{p.killed||(p.killed=!0,r(p))},o=()=>{var c,g;let p=Ve();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let b=p-u.startMs-u.delayMs;if(b<0)continue;let h=u.durationMs>0?b/u.durationMs:1,w=ua(h),v=u.repeat>=0?u.repeat+1:1,y=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let E=h-y;w=ua(E)}let f=u.ease(w);u.yoyo&&y%2===1&&(f=1-f);for(let E of u.props)ga(u.target,E.key,E.from+(E.to-E.from)*f);u.scaleFrom&&u.scaleTo&&ha(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*f,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*f});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){s(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var E;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),b=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((E=g==null?void 0:g.delayMsOverride)!=null?E:0)),h=xs(c.ease),w=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),f=[];for(let S of Object.keys(c)){if(y.has(S))continue;let A=c[S];typeof A=="number"&&f.push({key:S,from:Es(p,S),to:A})}let m=fa(p,c);return{target:p,startMs:Ve(),delayMs:b,durationMs:u,ease:h,props:f,scaleFrom:m.from,scaleTo:m.to,repeat: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:()=>s(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ve())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ve(),b=Ve()-u;g.startMs+=b,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let b=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof b=="number"&&ga(p,u,b)}let g=fa(p,c);g.to&&ha(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))s(g)},timeline(p={}){let c=[],g=0,u=!1,b=[],h=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let f=typeof y=="string"?y.trim():"";return f.startsWith("+=")?g+Math.max(0,Number(f.slice(2))*1e3||0):f?Math.max(0,Number(f)*1e3||0):g},w=y=>{c.push(y);let f=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);g=Math.max(g,y.atMs+f)},v={to(y,f,m){return w({kind:"to",target:y,vars:f,atMs:h(m)}),v},fromTo(y,f,m,E){return w({kind:"fromTo",target:y,vars:m,from:f,atMs:h(E)}),v},play(){var y,f;if(u)return v;u=!0,b=[];for(let m of c)m.kind==="fromTo"&&d.set(m.target,(y=m.from)!=null?y:{}),b.push(d.to(m.target,{...m.vars,delay:m.atMs/1e3+((f=m.vars.delay)!=null?f:0)}));return v},pause(){for(let y of b)y.pause();return v},kill(){for(let y of b)y.kill();b=[],u=!1}};return p.paused||v.play(),v}};return d}function ba(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=ma()}catch{}}var ya={name:"handler-playable-sdk",version:"0.5.28",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var G=0,Cs=G++,va=G++,wa=G++,xa=G++,Ea=G++,Sa=G++,Aa=G++,Ca=G++,Ta=G++,La=G++,_a=G++,ka=G++,T=Cs;function Ma(){return T===va}function Pa(){return T===wa}function Oa(){return T===xa}function Ia(){return T===Ea}function Oe(){return T===Sa}function Ie(){return T===Aa}function Ra(){return T===Ca}function ja(){return T===Ta}function za(){return T===La}function Zt(){return T===_a}function Qt(){return T===ka}function $a(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),T=va;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=wa;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=xa)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Ea)}catch{}else if(e==="mintegral")window.gameReady&&(T=Sa);else if(e==="tapjoy")window.TJ_API&&(T=Aa);else if(e==="tiktok")window.openAppStore&&(T=Ca);else if(e==="smadex")try{window.smxTracking&&(T=Ta)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=La)}catch{}else e==="vungle"?T=_a:(t==="nucleo"||e==="nucleo")&&(T=ka)}var yt=ae(require("lottie-web"),1),Da=yt.default;typeof window!="undefined"&&(window.lottie=yt.default,window.__baseLottie=yt.default);var Ts=require("pixi.js");var ei=require("pixi.js");var Ls=null;function ti(t){Ls=t}vt();ii();var Ye=require("pixi.js");vt();var Is=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",si=Is;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&&(si=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${si}`))}}catch{}function Rs(t){var i,n,a,r,s;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:(i=t[0])!=null?i:.5,y:(n=t[1])!=null?n:.5};if(t&&typeof t=="object"&&"x"in t&&"y"in t)return{x:(a=t.x)!=null?a:.5,y:(r=t.y)!=null?r:.5};if(typeof t=="string"){let o=t.trim().toLowerCase();return(s=e[o])!=null?s:{x:.5,y:.5}}return null}var Ae=class{static async create(e,i,n){var l,d,p,c,g,u,b;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${si}`);let a=(l=i==null?void 0:i.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Ye.Container;return this.applyTransform(h,i==null?void 0:i.transform,i),h}let r=(d=i==null?void 0:i.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${r}, type: ${a.type}, path: ${a.path}`);let s=await Se.load(e,a,n,r);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=s==null?void 0:s.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",s,"for object:",e),o=new Ye.Sprite(s),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,i==null?void 0:i.transform,i);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=s==null?void 0:s.constructor)==null?void 0:g.name,s),s&&(((u=s.constructor)==null?void 0:u.name)==="Container"||s instanceof Ye.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],w=!1;for(let v of h)try{let y=await fetch(v);if(y.ok){o=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(b=o==null?void 0:o.constructor)==null?void 0:b.name),w=!0;break}}catch{continue}w||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=s)}else o=s;else o=s,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,i==null?void 0:i.transform,i);return o}static applyTransform(e,i,n){var a,r,s,o;if(!(!i||!e)&&(i.position&&("x"in e&&"y"in e?(e.x=(a=i.position.x)!=null?a:0,e.y=(r=i.position.y)!=null?r:0):"position"in e&&e.position&&e.position.set((s=i.position.x)!=null?s:0,(o=i.position.y)!=null?o:0)),i.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(i.scale):e.scale=i.scale),i.rotation!==void 0&&"rotation"in e&&(e.rotation=i.rotation),i.anchor&&"anchor"in e&&e.anchor)){let l=Rs(i.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var Xe=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 $s=ae(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=$s);Ke();var xt=require("pixi.js");Ke();var li=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Xe}init(e,i){this.registry.init(e),this.app=i}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let i=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(i.length===0)return;let n=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async r=>{var o;let s=this.registry.get(r);if(!s){console.warn("[Assets] No config found for object:",r);return}try{let l=await Ae.create(r,s,this.app);this.instanceCache.set(r,l),console.log("[Assets] Loaded object:",r,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",r,l)}})))};return this.readyPromise=(async()=>{await n(i);let a=this.registry.getAllIds().filter(r=>!this.instanceCache.has(r));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await n(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 i=this.registry.get(e);if(i){let n=await Ae.create(e,i,this.app);this.instanceCache.set(e,n)}}get(e){return this.instanceCache.get(e)}},Hs=new li,Ns=new Proxy(Hs,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Ke();var Ba=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},St={scale:1,position:1},di=[];function Gs(t,e,i,n,a,r,s){di.push({element:t,originalScale:r,positionHelper:e,heightPercent:a}),e(t,i,n,a,r,s,!1)}function Us(){di.forEach(({element:t,originalScale:e,positionHelper:i,heightPercent:n})=>{let a=e*le.scaleFactor;i(t,le.width,le.height,n,a,!0,!1)})}function ci(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),le.width=t,le.height=e,le.scaleFactor=Math.min(t/le.designWidth,1.15),St.scale=le.scaleFactor,St.position=1,console.log(`[SCREEN] Global multipliers - scale: ${St.scale.toFixed(3)}`),Us()}var Ze={layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}};function qs(t,e,i){let n=Ze[t];n&&n[e]!==void 0&&(n[e]=i,console.log(`Updated ${t}.${e} = ${i}`))}function Ws(){return Ze}var Vs={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function Et(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function At(t,e={x:.5,y:.5}){var i;if(Array.isArray(t))return{x:Et(t[0],e.x),y:Et(t[1],e.y)};if(t&&typeof t=="object"){let n=t;return{x:Et(n.x,e.x),y:Et(n.y,e.y)}}if(typeof t=="string"){let n=t.trim().toLowerCase();return(i=Vs[n])!=null?i:e}return e}function Ga(t,e,i,n={}){var u,b,h,w,v,y;let a=At(i),r=(u=n.inset)!=null?u:{},s=(b=n.padding)!=null?b:{x:0,y:0},o=((h=r.left)!=null?h:0)+s.x,l=((w=r.right)!=null?w:0)+s.x,d=((v=r.top)!=null?v:0)+s.y,p=((y=r.bottom)!=null?y:0)+s.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function Ua(t,e,i,n={}){var h,w,v,y,f,m;let a=(h=n.inset)!=null?h:{},r=(w=n.padding)!=null?w:{x:0,y:0},s=((v=a.left)!=null?v:0)+r.x,o=((y=a.right)!=null?y:0)+r.x,l=((f=a.top)!=null?f:0)+r.y,d=((m=a.bottom)!=null?m:0)+r.y,p=Math.max(0,t-s-o),c=Math.max(0,e-l-d),g=At(i,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),b=Math.min(Math.max(g.y,0),1);return{x:s+p*u,y:l+c*b}}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,i=()=>{let n=window.innerWidth,a=window.innerHeight;(n!==t||a!==e)&&(t=n,e=a,ci(n,a))};window.addEventListener("resize",i),window.addEventListener("orientationchange",()=>{setTimeout(i,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",i),window.mraid.addEventListener("sizeChange",i)),ci(window.innerWidth,window.innerHeight),window.updateDebugConfig=qs,window.getDebugConfig=Ws,window.copyConfig=ao,window.applyConfig=Je,window.applyConfigForRatio=ro,window.positionAtBottom=qa,window.positionAtTop=Ks,window.positionAtCenter=Js,window.positionAtLeft=Zs,window.positionAtRight=Qs,window.positionAtBottomLeft=eo,window.positionAtBottomRight=to,window.positionAtTopLeft=io,window.positionAtTopRight=no,window.applyPositionContract=Xs,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function Ct(t,e,i=0){return t*e+i}function Tt(t,e,i=0){return t*(1-e)+i}function Lt(t,e,i=0){return t*e+i}function _t(t,e,i=0){return t*(1-e)+i}function U(t,e=0){return t/2+e}function Ys(t,e){return t*e}function Xs(t,e,i,n){var s,o,l,d,p,c,g,u,b,h,w,v,y,f,m,E,S,A,k,O;let a=0,r=0;switch(n.type){case"top":a=U(e,(o=(s=n.offset)==null?void 0:s.x)!=null?o:0),r=Ct(i,n.percent,(d=(l=n.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=n.offset)==null?void 0:p.x)!=null?c:0),r=Tt(i,n.percent,(u=(g=n.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=Lt(e,n.percent,(h=(b=n.offset)==null?void 0:b.x)!=null?h:0),r=U(i,(v=(w=n.offset)==null?void 0:w.y)!=null?v:0);break;case"right":a=_t(e,n.percent,(f=(y=n.offset)==null?void 0:y.x)!=null?f:0),r=U(i,(E=(m=n.offset)==null?void 0:m.y)!=null?E:0);break;case"center":a=U(e,(A=(S=n.offset)==null?void 0:S.x)!=null?A:0),r=U(i,(O=(k=n.offset)==null?void 0:k.y)!=null?O:0);break}t.position?t.position.set(a,r):(t.x=a,t.y=r),n.scale!==void 0&&n.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(n.scale,n.scale):(t.scale.x=n.scale,t.scale.y=n.scale))}function qa(t,e,i,n=.2,a=1,r=!0,s=!1){let o=Ys(i,n),l=Tt(i,n/2);ce(t,U(e),l);let d=r?a*le.scaleFactor:a;de(t,d),s&&!di.find(p=>p.element===t)&&Gs(t,qa,e,i,n,a,r)}function Ks(t,e,i,n=.1,a=1){ce(t,U(e),Ct(i,n)),de(t,a)}function Js(t,e,i,n=0,a=0,r=1){ce(t,U(e,n),U(i,a)),de(t,r)}function Zs(t,e,i,n=.1,a=1){ce(t,Lt(e,n),U(i)),de(t,a)}function Qs(t,e,i,n=.1,a=1){ce(t,_t(e,n),U(i)),de(t,a)}function eo(t,e,i,n=.05,a=.05,r=1){ce(t,Lt(e,a),Tt(i,n)),de(t,r)}function to(t,e,i,n=.05,a=.05,r=1){ce(t,_t(e,a),Tt(i,n)),de(t,r)}function io(t,e,i,n=.05,a=.05,r=1){ce(t,Lt(e,a),Ct(i,n)),de(t,r)}function no(t,e,i,n=.05,a=.05,r=1){ce(t,_t(e,a),Ct(i,n)),de(t,r)}function ce(t,e,i){t&&t.position?typeof t.position.set=="function"?t.position.set(e,i):(t.position.x=e,t.position.y=i):t&&(t.x=e,t.y=i)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ce={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function ao(t){return t&&Ce[t]?JSON.parse(JSON.stringify(Ce[t])):JSON.parse(JSON.stringify(Ze))}function Je(t){Object.keys(t).forEach(e=>{let i=e;Ze[i]&&t[i]&&Object.assign(Ze[i],t[i])}),console.log("Config applied:",t)}function ro(t,e){let i=t/e;i>1.6?(Je(Ce.wide),console.log("Applied WIDE config for ratio:",i)):i<.7?(Je(Ce.tall),console.log("Applied TALL config for ratio:",i)):i>.8&&i<1.2?(Je(Ce.square),console.log("Applied SQUARE config for ratio:",i)):(Je(Ce.default),console.log("Applied DEFAULT config for ratio:",i))}if(typeof window!="undefined"){let t=window;t.configPresets=Ce,t.resolveAnchorVec2=t.resolveAnchorVec2||At,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||Ga,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||Ua}gi();function P(t,e){let i=(a,r)=>r===0?a:i(r,a%r),n=i(t,e);return`${t/n}:${e/n}`}var Bc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:P(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:P(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:P(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:P(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:P(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:P(360,780)}],Gc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:P(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:P(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:P(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:P(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:P(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:P(412,915)}],Uc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:P(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:P(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:P(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:P(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:P(800,1280)}],Xa=[{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:P(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:P(768,1024),mraidScale:.7}];var qc=[...Xa];var ho=Xa[0];fe();var wo=ae(require("jszip"),1);function bo(t){return new Promise((e,i)=>{let n=new FileReader;n.onerror=()=>i(new Error("FileReader failed")),n.onload=()=>e(String(n.result||"")),n.readAsDataURL(t)})}function yo(t){var a;let[e,i]=t.split(","),n=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:i!=null?i:"",mimeType:(a=n==null?void 0:n[1])!=null?a:"image/png"}}async function vo(t){return await new Promise(e=>{let i=new Image;i.onload=()=>e({width:i.naturalWidth||i.width,height:i.naturalHeight||i.height}),i.onerror=()=>e(null),i.src=t})}async function hi(t){var e,i;try{console.log("[ImageUtils] Fetching image data from URL:",t);let n=await fetch(t);if(!n.ok)return console.warn("[ImageUtils] Fetch failed with status:",n.status,t),null;let a=await n.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let r=await bo(a),s=await vo(r),o=yo(r);return console.log("[ImageUtils] Success resolution:",s==null?void 0:s.width,"x",s==null?void 0:s.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:r,width:(e=s==null?void 0:s.width)!=null?e:0,height:(i=s==null?void 0:s.height)!=null?i:0}}catch(n){return console.error("[ImageUtils] Error fetching image data:",n),null}}async function kt(t,e=30){try{console.log("[ImageUtils] Removing background color...");let i=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}),n=document.createElement("canvas");n.width=i.width,n.height=i.height;let a=n.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),t;a.drawImage(i,0,0);let r=a.getImageData(0,0,n.width,n.height),s=r.data,l=[{name:"top-left",offset:0},{name:"top-right",offset:(n.width-1)*4},{name:"bottom-left",offset:(n.height-1)*n.width*4},{name:"bottom-right",offset:((n.height-1)*n.width+(n.width-1))*4}].map(c=>({r:s[c.offset],g:s[c.offset+1],b:s[c.offset+2]})),d=0;for(let c=0;c<s.length;c+=4){let g=s[c],u=s[c+1],b=s[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(b-w.b,2))<e){h=!0;break}h&&(s[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(r,0,0),n.toDataURL("image/png")}catch(i){return console.error("[ImageUtils] Error removing background:",i),t}}var Ka=require("@google/genai");async function fi(t,e,i=[],n={}){var a,r,s,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<i.length;v++){let y=i[v];if(!y.base64||!y.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(y.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!y.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${y.mimeType}`)}let c=new Ka.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];i.length>0&&i.forEach((v,y)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${y+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${i.length} images and prompt length: ${e.length}`);let b=await c.models.generateContent({model:g,contents:u}),h="",w=(s=(r=(a=b.candidates)==null?void 0:a[0])==null?void 0:r.content)==null?void 0:s.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 Ja=require("@google/genai");async function Mt(t,e,i=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Ja.GoogleGenAI({apiKey:t}),r=[{text:e}];i.length>0&&i.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),r.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let s=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:r});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!s.candidates||!s.candidates[0]||!s.candidates[0].content||!s.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of s.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");Ke();fe();var Qa=require("pixi.js");var Eo=require("pixi.js");fe();function ko(t){return new Promise((e,i)=>{let n=new FileReader;n.onerror=()=>i(new Error("FileReader failed")),n.onload=()=>e(String(n.result||"")),n.readAsDataURL(t)})}function Mo(t){var a;let[e,i]=t.split(","),n=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:i!=null?i:"",mimeType:(a=n==null?void 0:n[1])!=null?a:"image/png"}}function Po(t){return`
|
|
47
47
|
Analyze these screenshots of a brand or game and extract its "Brand DNA".
|
|
48
48
|
|
|
49
49
|
Provide a concise summary (2-3 sentences) covering:
|
|
@@ -226,7 +226,7 @@ Style guidelines: ${n.summary}`;this.promptInput.value=a,this.currentPrompt=a}}c
|
|
|
226
226
|
<button class="asset-crop-apply primary" data-action="apply">Apply Crop</button>
|
|
227
227
|
</div>
|
|
228
228
|
</div>
|
|
229
|
-
`,this.modal=e,this.attachEventListeners(),this.initializeCanvas()}initializeCanvas(){this.modal&&(this.canvas=this.modal.querySelector(".asset-crop-canvas"),this.canvas&&(this.ctx=this.canvas.getContext("2d"),this.canvas.width=400,this.canvas.height=300))}loadImage(){this.options&&(this.image=new Image,this.image.crossOrigin="anonymous",this.image.onload=()=>{this.initializeCrop(),this.render()},this.image.src=this.options.imageSrc)}initializeCrop(){var n;if(!this.image||!this.canvas)return;let e=this.image.width/this.image.height,i=this.canvas.width/this.canvas.height;e>i?(this.cropHeight=this.image.height,this.cropWidth=this.cropHeight*i,this.cropX=(this.image.width-this.cropWidth)/2,this.cropY=0):(this.cropWidth=this.image.width,this.cropHeight=this.cropWidth/i,this.cropX=0,this.cropY=(this.image.height-this.cropHeight)/2),(n=this.options)!=null&&n.aspectRatio&&this.applyAspectRatio(this.options.aspectRatio),this.fitToCanvas()}applyAspectRatio(e){if(!this.image)return;let i=this.image.width/this.image.height,n=this.cropX+this.cropWidth/2,a=this.cropY+this.cropHeight/2;e>i?(this.cropWidth=Math.min(this.image.width,this.cropHeight*e),this.cropHeight=this.cropWidth/e):(this.cropHeight=Math.min(this.image.height,this.cropWidth/e),this.cropWidth=this.cropHeight*e),this.cropX=Math.max(0,Math.min(this.image.width-this.cropWidth,n-this.cropWidth/2)),this.cropY=Math.max(0,Math.min(this.image.height-this.cropHeight,a-this.cropHeight/2))}fitToCanvas(){if(!this.image||!this.canvas)return;let e=this.canvas.width/this.cropWidth,i=this.canvas.height/this.cropHeight;this.scale=Math.min(e,i)*.9,this.panX=(this.canvas.width-this.cropWidth*this.scale)/2,this.panY=(this.canvas.height-this.cropHeight*this.scale)/2}render(){!this.ctx||!this.image||!this.canvas||(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.ctx.save(),this.ctx.translate(this.panX,this.panY),this.ctx.scale(this.scale,this.scale),this.ctx.drawImage(this.image,-this.cropX,-this.cropY,this.image.width,this.image.height),this.ctx.restore(),this.drawCropOverlay(),this.updatePreview())}drawCropOverlay(){if(!this.ctx||!this.canvas)return;let e=this.panX,i=this.panY,n=this.cropWidth*this.scale,a=this.cropHeight*this.scale;this.ctx.fillStyle="rgba(0, 0, 0, 0.5)",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height),this.ctx.clearRect(e,i,n,a),this.ctx.strokeStyle="#ffffff",this.ctx.lineWidth=2,this.ctx.strokeRect(e,i,n,a),this.ctx.fillStyle="#ffffff";let r=8;[[e,i],[e+n-r,i],[e,i+a-r],[e+n-r,i+a-r]].forEach(([o,l])=>{var d;(d=this.ctx)==null||d.fillRect(o,l,r,r)})}updatePreview(){if(!this.modal||!this.image)return;let e=this.modal.querySelector(".asset-crop-preview-canvas");if(!e)return;let i=e.getContext("2d");if(!i)return;let n=150;e.width=n,e.height=n;let a=n/this.cropWidth,r=n/this.cropHeight,s=Math.min(a,r),o=this.cropWidth*s,l=this.cropHeight*s,d=(n-o)/2,p=(n-l)/2;i.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,d,p,o,l)}attachEventListeners(){if(!this.modal||!this.canvas)return;this.canvas.addEventListener("mousedown",this.handleMouseDown.bind(this)),this.canvas.addEventListener("mousemove",this.handleMouseMove.bind(this)),this.canvas.addEventListener("mouseup",this.handleMouseUp.bind(this)),this.canvas.addEventListener("wheel",this.handleWheel.bind(this)),this.canvas.addEventListener("touchstart",this.handleTouchStart.bind(this)),this.canvas.addEventListener("touchmove",this.handleTouchMove.bind(this)),this.canvas.addEventListener("touchend",this.handleTouchEnd.bind(this));let e=this.modal.querySelector(".asset-crop-zoom-slider");e==null||e.addEventListener("input",n=>{let a=parseFloat(n.target.value);this.setZoom(a)});let i=this.modal.querySelector(".asset-crop-aspect-select");i==null||i.addEventListener("change",n=>{let a=n.target.value;this.setAspectRatio(a)}),this.modal.addEventListener("click",n=>{switch(n.target.dataset.action){case"reset":this.reset();break;case"apply":this.applyCrop();break;case"cancel":case"close":this.close();break}}),this.modal.addEventListener("click",n=>{n.target===this.modal&&this.close()})}handleMouseDown(e){this.isDragging=!0,this.dragStartX=e.clientX,this.dragStartY=e.clientY,this.lastPanX=this.panX,this.lastPanY=this.panY,this.canvas.style.cursor="grabbing"}handleMouseMove(e){if(!this.isDragging)return;let i=e.clientX-this.dragStartX,n=e.clientY-this.dragStartY;this.panX=this.lastPanX+i,this.panY=this.lastPanY+n,this.constrainPan(),this.render()}handleMouseUp(){this.isDragging=!1,this.canvas.style.cursor="grab"}handleWheel(e){e.preventDefault();let i=e.deltaY>0?.9:1.1;this.setZoom(this.scale*i)}handleTouchStart(e){e.touches.length===1&&(this.isDragging=!0,this.dragStartX=e.touches[0].clientX,this.dragStartY=e.touches[0].clientY,this.lastPanX=this.panX,this.lastPanY=this.panY)}handleTouchMove(e){if(!this.isDragging||e.touches.length!==1)return;e.preventDefault();let i=e.touches[0].clientX-this.dragStartX,n=e.touches[0].clientY-this.dragStartY;this.panX=this.lastPanX+i,this.panY=this.lastPanY+n,this.constrainPan(),this.render()}handleTouchEnd(){this.isDragging=!1}setZoom(e){this.scale=Math.max(.1,Math.min(3,e)),this.updateZoomUI(),this.constrainPan(),this.render()}setAspectRatio(e){let i;switch(e){case"1:1":i=1;break;case"4:3":i=4/3;break;case"16:9":i=16/9;break;case"3:2":i=3/2;break;default:i=void 0}i&&this.applyAspectRatio(i),this.fitToCanvas(),this.render()}updateZoomUI(){if(!this.modal)return;let e=this.modal.querySelector(".asset-crop-zoom-value"),i=this.modal.querySelector(".asset-crop-zoom-slider");e&&(e.textContent=`${this.scale.toFixed(1)}x`),i&&(i.value=this.scale.toString())}constrainPan(){if(!this.canvas)return;let e=this.cropWidth*this.scale,i=this.cropHeight*this.scale;this.panX=Math.max(this.canvas.width-e,Math.min(0,this.panX)),this.panY=Math.max(this.canvas.height-i,Math.min(0,this.panY))}reset(){this.initializeCrop(),this.render()}applyCrop(){var a;if(!this.image||!((a=this.options)!=null&&a.onCrop))return;let e=document.createElement("canvas"),i=e.getContext("2d");if(!i)return;e.width=this.cropWidth,e.height=this.cropHeight,i.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,0,0,this.cropWidth,this.cropHeight);let n=e.toDataURL("image/png");this.options.onCrop(n),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal);let e=this.options;this.modal=null,this.canvas=null,this.ctx=null,this.image=null,this.options=null,e!=null&&e.onCancel&&e.onCancel()}};window.openAssetCrop=function(t){new Si().open(t)};fe();fe();var ir=ae(require("lottie-web"),1);ti($a);typeof window!="undefined"&&!window.lottie&&(window.lottie=ir.default);gi();fe();var Ai=ya.version,Ro=new Set(["init","boot","view","ready","start","pause","resume","complete","error","engagement","first_interaction","retry","cta_show","cta_click","cta_dismiss","clickout","conversion","session_time","level_time","load_time","level_start","level_complete","level_fail","checkpoint","reward","tutorial_start","tutorial_complete","tutorial_skip","ab_assign","fps","memory","asset_load_start","asset_load_complete"]);ba();var cr={mechanic_id:"TODO_mechanic_id",variant_id:"TODO_variant_id",deployment_id:"TODO_deployment_id",export_id:"TODO_export_id",profile_id:"TODO_profile_id",instance_id:"default"},dr=Math.random().toString(36).slice(2),$e=null,ze={...cr},pr="web_embed",_i={},et,Ci=!1,Qe=!1,it=!1,ur=!1,Oi=1,Ot=0,jt=!1,pe=!1,De="",He=Math.floor(window.innerWidth),Fe=Math.floor(window.innerHeight),ki=He>Fe,ue=!1,tt=!1,nr=!1,ar=!1,Ti=!1,It=null,_e=null,Mi=!1,Pi=!1,Pt=new Map;function gr(){if(!_e)return null;let t=Date.now()-_e;return!Number.isFinite(t)||t<0?null:t}function Li(t){if(Mi)return;let e=gr();e!==null&&(Mi=!0,x("session_time",{duration_ms:e,reason:t}))}function rr(){if($e)return $e;let t=document.createElement("div");return t.id="handler-root",t.setAttribute("data-handler-root","true"),document.body.appendChild(t),$e=t,t}function Rt(t){switch(t){case"interaction":return"engagement";case"finish":return"complete";case"install":return"cta_click";default:return t}}function hr(t,e){return{event_name:t,ts:Date.now(),session_id:dr,deployment_id:ze.deployment_id,variant_id:ze.variant_id,export_profile_id:ze.profile_id,instance_id:ze.instance_id||"default",env:pr==="mraid"?"mraid":"web",attribution:et,payload:e}}function x(t,e){let i=Rt(t),n=hr(i,e);Jt(n,!!_i.analytics),bt(i,n),i!==t&&bt(t,n)}function nt(){It&&(It(He,Fe),It=null)}function Ne(t){Oi=t,x("volume",t)}function Be(t){t&&(ur=!0),!it&&(it=!0,x("pause"),Ne(0))}function at(t){!t&&ur||it&&(it=!1,x("resume"),Ne(Oi))}function me(t,e){He=Math.floor(t||window.innerWidth),Fe=Math.floor(e||window.innerHeight),ki=He>Fe,x("resize",{width:He,height:Fe})}function jo(){if(Ma())try{let t=mraid.getMaxSize();me(t.width,t.height);let e=()=>{mraid.isViewable()&&mraid.getState()!=="hidden"?at():Be()};if(mraid.addEventListener("viewableChange",e),mraid.addEventListener("stateChange",e),mraid.addEventListener("sizeChange",()=>{let i=mraid.getMaxSize();me(i.width,i.height)}),mraid.getAudioVolume){let i=mraid.getAudioVolume();Ne(i?1:0)}if(mraid.addEventListener("audioVolumeChange",i=>{i!==null&&Ne(i>0?1:0)}),mraid.addEventListener("error",(i,n)=>{console.warn("mraid error:",i,"action:",n)}),jt=!0,mraid.isViewable()&&mraid.getState()!=="hidden")ue=!0,x("boot"),x("view"),x("ready"),pe=!0,nt();else{let i=()=>{ue=!0,x("boot"),x("view"),x("ready"),pe=!0,nt()};mraid.addEventListener("ready",i)}}catch(t){console.warn("MRAID hook skipped",t)}}function zo(){if(Pa())try{let t=dapi.getScreenSize();me(t.width,t.height),dapi.addEventListener("viewableChange",i=>{i.isViewable?at():Be()}),dapi.addEventListener("adResized",i=>{let n=dapi.getScreenSize();me(i.width||n.width,i.height||n.height)});let e=dapi.getAudioVolume();if(Ne(e?1:0),dapi.addEventListener("audioVolumeChange",i=>Ne(i?1:0)),jt=!0,dapi.isViewable())ue=!0,x("boot"),x("view"),x("ready"),pe=!0,nt();else{let i=()=>{ue=!0,x("boot"),x("view"),x("ready"),pe=!0,nt()};dapi.addEventListener("ready",i)}}catch(t){console.warn("DAPI hook skipped",t)}}function sr(){let t=()=>{ue||document.visibilityState==="visible"&&(document.readyState==="complete"||document.readyState==="interactive")&&(ue=!0,x("boot"),x("view"),x("ready"),pe=!0,nt(),tt&&(tt=!1,J.start()))};window.addEventListener("resize",()=>me()),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?(at(),t()):Be()}),document.readyState==="complete"||document.readyState==="interactive"?t():window.addEventListener("load",t),jt=!0}function Do(){let t=e=>{typeof TouchEvent!="undefined"&&e instanceof TouchEvent&&(nr=!0),!(nr&&e instanceof MouseEvent)&&(Ot+=1,Pi||(Pi=!0,x("first_interaction",{count:Ot})),x("interaction",Ot))};document.addEventListener("mousedown",t),document.addEventListener("touchstart",t)}function or(t){var n,a,r,s,o,l,d,p,c,g,u,b;let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none";if((typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed")==="google")try{(n=window.ExitApi)==null||n.exit();return}catch{}if(e==="mraid"&&typeof mraid!="undefined")mraid.open(t||"");else if(e==="dapi"&&typeof dapi!="undefined")dapi.openStoreUrl();else if(Ie())(r=(a=window.TJ_API)==null?void 0:a.click)==null||r.call(a);else if(Oa())(o=(s=window.FbPlayableAd)==null?void 0:s.onCTAClick)==null||o.call(s);else if(za())(d=(l=window.ScPlayableAd)==null?void 0:l.onCTAClick)==null||d.call(l);else if(ja())try{(c=(p=window.smxTracking)==null?void 0:p.redirect)==null||c.call(p)}catch(h){console.warn("Smadex redirect failed",h)}else if(Ia()){let h=window.ExitApi;h&&typeof h.exit=="function"?h.exit(t||De||""):t&&window.open(t)}else Oe()?(g=window.install)==null||g.call(window):Ra()?(u=window.openAppStore)==null||u.call(window):Zt()?(b=parent==null?void 0:parent.postMessage)==null||b.call(parent,"download","*"):t&&window.open(t)}function $o(){let t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed",e=i=>{if(!i)return;let n=new Image;n.src=i};if(t==="bigabid"){let i=window.BIGABID_BIDTIMEMACROS;if(!i)return;B("view",()=>e(i.mraid_viewable)),B("start",()=>e(i.game_viewable)),B("engagement",()=>e(i.engagement));let n=()=>e(i.complete);B("complete",n),mt("engagement",a=>{var r;((r=a==null?void 0:a.payload)==null?void 0:r.count)>3&&n()}),B("cta_click",()=>e(i.click))}else if(t==="inmobi"){let i=window.INMOBI_DSPMACROS;if(!i)return;B("view",()=>e(i.Ad_Load_Start)),B("start",()=>e(i.Ad_Viewable)),B("engagement",()=>e(i.First_Engagement)),B("complete",()=>e(i.Gameplay_Complete)),B("cta_click",()=>e(i.DSP_Click)),B("start",()=>{[5,10,15,20,25,30].forEach(n=>setTimeout(()=>e(i[`Spent_${n}_Seconds`]),n*1e3))})}}function Ho(){if(!Ie())return;let t=window.TJ_API;t&&t.setPlayableAPI&&t.setPlayableAPI({skipAd:()=>{try{J.finish()}catch(e){console.warn("Tapjoy skip failed",e)}}})}function lr(){var e,i,n;let t=window.TJ_API;(e=t==null?void 0:t.objectiveComplete)==null||e.call(t),(i=t==null?void 0:t.playableFinished)==null||i.call(t),(n=t==null?void 0:t.gameplayFinished)==null||n.call(t)}function Fo(){Oe()&&(window.mintGameStart=()=>{at(!0),me()},window.mintGameClose=()=>{Be(!0)})}function No(){if(!Qt())return;let t=window.NUC;!t||!t.trigger||(J.on("cta_click",()=>{var e,i;return(i=(e=t.trigger).convert)==null?void 0:i.call(e,De)}),J.on("complete",()=>{var e,i;return(i=(e=t.trigger).tryAgain)==null?void 0:i.call(e)}))}var J={init(t={},e){var i;if(pr=t.profile||"web_embed",_i=t.consent||{},ze={...cr,...t.ids||{}},$e=t.rootEl||$e,et=void 0,da((i=t.telemetry)!=null&&i.endpoint?t.telemetry:null),_e=null,Mi=!1,Pi=!1,Pt.clear(),De=t.destinationUrl||(/android/i.test(navigator.userAgent)?"https://play.google.com/store":"https://www.apple.com/app-store/"),e&&(It=e),x("init"),document.body.oncontextmenu=()=>!1,rr(),Go($e),Da(),jo(),zo(),!jt){if(document.readyState==="complete")sr();else if(!ar){ar=!0;let n=()=>{sr(),window.removeEventListener("load",n),document.removeEventListener("DOMContentLoaded",n)};window.addEventListener("load",n),document.addEventListener("DOMContentLoaded",n)}}Do(),$o(),Ho(),Fo(),No(),console.log(`%c @handler/playable-sdk %c v${Ai} `,"background: var(--ui-console-info); color: var(--ui-white); font-size: 14px; padding: 4px 8px; border-top-left-radius: 4px; border-bottom-left-radius: 4px;","background: var(--ui-console-bg); color: var(--ui-console-text); font-size: 14px; padding: 4px 8px; border-top-right-radius: 4px; border-bottom-right-radius: 4px;"),ue&&!pe&&(x("boot"),x("view"),x("ready"),tt&&(tt=!1,J.start()),pe=!0),pe=ue},getRoot(){return rr()},get version(){return Ai},get maxWidth(){return He},get maxHeight(){return Fe},get isLandscape(){return ki},get isReady(){return pe},get isStarted(){return Ci},get isPaused(){return it},get isFinished(){return Qe},get volume(){return Oi},get interactions(){return Ot},on(t,e){mt(Rt(t),e)},off(t,e){Kt(Rt(t),e)},start(){var t,e;if(!Ci){if(!ue){tt=!0;return}if(Ci=!0,_e||(_e=Date.now()),x("start"),me(),Oe())Be(),(t=window.gameReady)==null||t.call(window);else if(Ie()){let i=window.TJ_API;(e=i==null?void 0:i.setPlayableBuild)==null||e.call(i,{orientation:ki?"landscape":"portrait",buildID:Ai})}}},finish(){var t,e;Qe||(Qe=!0,x("complete"),Li("complete"),Oe()?(t=window.gameEnd)==null||t.call(window):Zt()?(e=parent==null?void 0:parent.postMessage)==null||e.call(parent,"complete","*"):Ie()&&lr())},install(t){if(!Qe){Qe=!0,Ie()?(lr(),setTimeout(()=>J.install(t),300)):(x("complete"),setTimeout(()=>J.install(t),0));return}Ti||(Ti=!0,setTimeout(()=>Ti=!1,500),x("cta_click"),x("conversion"),Li("cta"),or(t||De))},emit(t,e){let i=Rt(t);if(!Ro.has(i)&&i!=="resize"&&i!=="volume"&&!i.startsWith("custom."))throw new Error(`Event ${t} must be canonical or namespaced as custom.<mechanic_id>.<event>`);let n=hr(i,e);Jt(n,!!_i.analytics),bt(i,n)},gameStart(){J.start()},gameEnd(){J.finish()},ctaClick(t,e){x("cta_click",{url:t||De,manual:!0}),(e==null?void 0:e.open)!==!1&&or(t||De)},ctaShow(t){x("cta_show",t)},ctaDismiss(t){x("cta_dismiss",t)},getGameTimeMs(){return gr()},endSession(t="manual"){Li(t)},setAttribution(t){et=t},abTest(t,e){if(!t)throw new Error("abTest requires experimentId");if(!Array.isArray(e)||e.length<2)throw new Error("abTest requires at least 2 variants");let i=Math.abs(Bo(`${dr}:${t}`))%e.length,n=e[i];return et={...et||{},experiment_id:t},ze.variant_id=n,x("ab_assign",{experiment_id:t,variant_id:n}),n},levelStart(t,e){_e||(_e=Date.now()),x("level_start",{level_id:t,...e})},levelComplete(t,e){x("level_complete",{level_id:t,...e})},levelFail(t,e){x("level_fail",{level_id:t,...e})},checkpoint(t,e){x("checkpoint",{checkpoint_id:t,...e})},reward(t,e){x("reward",{reward_id:t,...e})},tutorialStart(t,e){x("tutorial_start",{step_id:t,...e})},tutorialComplete(t,e){x("tutorial_complete",{step_id:t,...e})},tutorialSkip(t,e){x("tutorial_skip",{step_id:t,...e})},timerStart(t){t&&Pt.set(t,Date.now())},timerEnd(t,e="custom",i){if(!t)return;let n=Pt.get(t);if(!n)return;Pt.delete(t);let a=Date.now()-n;if(!(!Number.isFinite(a)||a<0)){if(e==="custom"){x("engagement",{action:"timer",key:t,duration_ms:a,...i});return}x(e,{key:t,duration_ms:a,...i})}},fps(t,e){x("fps",{value:t,...e})},memory(t,e){x("memory",{bytes:t,...e})},assetLoadStart(t,e){x("asset_load_start",{asset_id:t,...e})},assetLoadComplete(t,e){x("asset_load_complete",{asset_id:t,...e})},reportError(t,e,i){x("error",{code:t,message:e,...i})},retry(){var t,e,i;if(Oe())(t=window.gameRetry)==null||t.call(window);else if(Qt()){let n=window.NUC;(i=(e=n==null?void 0:n.trigger)==null?void 0:e.tryAgain)==null||i.call(e)}x("engagement",{action:"retry"})},pause(){Be(!0)},resume(){at(!0)},resize(t,e){me(t,e)}},Re=J;function Bo(t){let e=2166136261;for(let i=0;i<t.length;i++)e^=t.charCodeAt(i),e=Math.imul(e,16777619);return e|0}function Go(t){let e=document.createElement("script");e.type="text/javascript",e.textContent=`
|
|
229
|
+
`,this.modal=e,this.attachEventListeners(),this.initializeCanvas()}initializeCanvas(){this.modal&&(this.canvas=this.modal.querySelector(".asset-crop-canvas"),this.canvas&&(this.ctx=this.canvas.getContext("2d"),this.canvas.width=400,this.canvas.height=300))}loadImage(){this.options&&(this.image=new Image,this.image.crossOrigin="anonymous",this.image.onload=()=>{this.initializeCrop(),this.render()},this.image.src=this.options.imageSrc)}initializeCrop(){var n;if(!this.image||!this.canvas)return;let e=this.image.width/this.image.height,i=this.canvas.width/this.canvas.height;e>i?(this.cropHeight=this.image.height,this.cropWidth=this.cropHeight*i,this.cropX=(this.image.width-this.cropWidth)/2,this.cropY=0):(this.cropWidth=this.image.width,this.cropHeight=this.cropWidth/i,this.cropX=0,this.cropY=(this.image.height-this.cropHeight)/2),(n=this.options)!=null&&n.aspectRatio&&this.applyAspectRatio(this.options.aspectRatio),this.fitToCanvas()}applyAspectRatio(e){if(!this.image)return;let i=this.image.width/this.image.height,n=this.cropX+this.cropWidth/2,a=this.cropY+this.cropHeight/2;e>i?(this.cropWidth=Math.min(this.image.width,this.cropHeight*e),this.cropHeight=this.cropWidth/e):(this.cropHeight=Math.min(this.image.height,this.cropWidth/e),this.cropWidth=this.cropHeight*e),this.cropX=Math.max(0,Math.min(this.image.width-this.cropWidth,n-this.cropWidth/2)),this.cropY=Math.max(0,Math.min(this.image.height-this.cropHeight,a-this.cropHeight/2))}fitToCanvas(){if(!this.image||!this.canvas)return;let e=this.canvas.width/this.cropWidth,i=this.canvas.height/this.cropHeight;this.scale=Math.min(e,i)*.9,this.panX=(this.canvas.width-this.cropWidth*this.scale)/2,this.panY=(this.canvas.height-this.cropHeight*this.scale)/2}render(){!this.ctx||!this.image||!this.canvas||(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.ctx.save(),this.ctx.translate(this.panX,this.panY),this.ctx.scale(this.scale,this.scale),this.ctx.drawImage(this.image,-this.cropX,-this.cropY,this.image.width,this.image.height),this.ctx.restore(),this.drawCropOverlay(),this.updatePreview())}drawCropOverlay(){if(!this.ctx||!this.canvas)return;let e=this.panX,i=this.panY,n=this.cropWidth*this.scale,a=this.cropHeight*this.scale;this.ctx.fillStyle="rgba(0, 0, 0, 0.5)",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height),this.ctx.clearRect(e,i,n,a),this.ctx.strokeStyle="#ffffff",this.ctx.lineWidth=2,this.ctx.strokeRect(e,i,n,a),this.ctx.fillStyle="#ffffff";let r=8;[[e,i],[e+n-r,i],[e,i+a-r],[e+n-r,i+a-r]].forEach(([o,l])=>{var d;(d=this.ctx)==null||d.fillRect(o,l,r,r)})}updatePreview(){if(!this.modal||!this.image)return;let e=this.modal.querySelector(".asset-crop-preview-canvas");if(!e)return;let i=e.getContext("2d");if(!i)return;let n=150;e.width=n,e.height=n;let a=n/this.cropWidth,r=n/this.cropHeight,s=Math.min(a,r),o=this.cropWidth*s,l=this.cropHeight*s,d=(n-o)/2,p=(n-l)/2;i.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,d,p,o,l)}attachEventListeners(){if(!this.modal||!this.canvas)return;this.canvas.addEventListener("mousedown",this.handleMouseDown.bind(this)),this.canvas.addEventListener("mousemove",this.handleMouseMove.bind(this)),this.canvas.addEventListener("mouseup",this.handleMouseUp.bind(this)),this.canvas.addEventListener("wheel",this.handleWheel.bind(this)),this.canvas.addEventListener("touchstart",this.handleTouchStart.bind(this)),this.canvas.addEventListener("touchmove",this.handleTouchMove.bind(this)),this.canvas.addEventListener("touchend",this.handleTouchEnd.bind(this));let e=this.modal.querySelector(".asset-crop-zoom-slider");e==null||e.addEventListener("input",n=>{let a=parseFloat(n.target.value);this.setZoom(a)});let i=this.modal.querySelector(".asset-crop-aspect-select");i==null||i.addEventListener("change",n=>{let a=n.target.value;this.setAspectRatio(a)}),this.modal.addEventListener("click",n=>{switch(n.target.dataset.action){case"reset":this.reset();break;case"apply":this.applyCrop();break;case"cancel":case"close":this.close();break}}),this.modal.addEventListener("click",n=>{n.target===this.modal&&this.close()})}handleMouseDown(e){this.isDragging=!0,this.dragStartX=e.clientX,this.dragStartY=e.clientY,this.lastPanX=this.panX,this.lastPanY=this.panY,this.canvas.style.cursor="grabbing"}handleMouseMove(e){if(!this.isDragging)return;let i=e.clientX-this.dragStartX,n=e.clientY-this.dragStartY;this.panX=this.lastPanX+i,this.panY=this.lastPanY+n,this.constrainPan(),this.render()}handleMouseUp(){this.isDragging=!1,this.canvas.style.cursor="grab"}handleWheel(e){e.preventDefault();let i=e.deltaY>0?.9:1.1;this.setZoom(this.scale*i)}handleTouchStart(e){e.touches.length===1&&(this.isDragging=!0,this.dragStartX=e.touches[0].clientX,this.dragStartY=e.touches[0].clientY,this.lastPanX=this.panX,this.lastPanY=this.panY)}handleTouchMove(e){if(!this.isDragging||e.touches.length!==1)return;e.preventDefault();let i=e.touches[0].clientX-this.dragStartX,n=e.touches[0].clientY-this.dragStartY;this.panX=this.lastPanX+i,this.panY=this.lastPanY+n,this.constrainPan(),this.render()}handleTouchEnd(){this.isDragging=!1}setZoom(e){this.scale=Math.max(.1,Math.min(3,e)),this.updateZoomUI(),this.constrainPan(),this.render()}setAspectRatio(e){let i;switch(e){case"1:1":i=1;break;case"4:3":i=4/3;break;case"16:9":i=16/9;break;case"3:2":i=3/2;break;default:i=void 0}i&&this.applyAspectRatio(i),this.fitToCanvas(),this.render()}updateZoomUI(){if(!this.modal)return;let e=this.modal.querySelector(".asset-crop-zoom-value"),i=this.modal.querySelector(".asset-crop-zoom-slider");e&&(e.textContent=`${this.scale.toFixed(1)}x`),i&&(i.value=this.scale.toString())}constrainPan(){if(!this.canvas)return;let e=this.cropWidth*this.scale,i=this.cropHeight*this.scale;this.panX=Math.max(this.canvas.width-e,Math.min(0,this.panX)),this.panY=Math.max(this.canvas.height-i,Math.min(0,this.panY))}reset(){this.initializeCrop(),this.render()}applyCrop(){var a;if(!this.image||!((a=this.options)!=null&&a.onCrop))return;let e=document.createElement("canvas"),i=e.getContext("2d");if(!i)return;e.width=this.cropWidth,e.height=this.cropHeight,i.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,0,0,this.cropWidth,this.cropHeight);let n=e.toDataURL("image/png");this.options.onCrop(n),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal);let e=this.options;this.modal=null,this.canvas=null,this.ctx=null,this.image=null,this.options=null,e!=null&&e.onCancel&&e.onCancel()}};window.openAssetCrop=function(t){new Si().open(t)};fe();fe();var ir=ae(require("lottie-web"),1);ti(Da);typeof window!="undefined"&&!window.lottie&&(window.lottie=ir.default);gi();fe();var Ai=ya.version,Ro=new Set(["init","boot","view","ready","start","pause","resume","complete","error","engagement","first_interaction","retry","cta_show","cta_click","cta_dismiss","clickout","conversion","session_time","level_time","load_time","level_start","level_complete","level_fail","checkpoint","reward","tutorial_start","tutorial_complete","tutorial_skip","ab_assign","fps","memory","asset_load_start","asset_load_complete"]);ba();var cr={mechanic_id:"TODO_mechanic_id",variant_id:"TODO_variant_id",deployment_id:"TODO_deployment_id",export_id:"TODO_export_id",profile_id:"TODO_profile_id",instance_id:"default"},dr=Math.random().toString(36).slice(2),De=null,ze={...cr},pr="web_embed",_i={},et,Ci=!1,Qe=!1,it=!1,ur=!1,Oi=1,Ot=0,jt=!1,pe=!1,$e="",He=Math.floor(window.innerWidth),Ne=Math.floor(window.innerHeight),ki=He>Ne,ue=!1,tt=!1,nr=!1,ar=!1,Ti=!1,It=null,_e=null,Mi=!1,Pi=!1,Pt=new Map;function gr(){if(!_e)return null;let t=Date.now()-_e;return!Number.isFinite(t)||t<0?null:t}function Li(t){if(Mi)return;let e=gr();e!==null&&(Mi=!0,x("session_time",{duration_ms:e,reason:t}))}function rr(){if(De)return De;let t=document.createElement("div");return t.id="handler-root",t.setAttribute("data-handler-root","true"),document.body.appendChild(t),De=t,t}function Rt(t){switch(t){case"interaction":return"engagement";case"finish":return"complete";case"install":return"cta_click";default:return t}}function hr(t,e){return{event_name:t,ts:Date.now(),session_id:dr,deployment_id:ze.deployment_id,variant_id:ze.variant_id,export_profile_id:ze.profile_id,instance_id:ze.instance_id||"default",env:pr==="mraid"?"mraid":"web",attribution:et,payload:e}}function x(t,e){let i=Rt(t),n=hr(i,e);Jt(n,!!_i.analytics),bt(i,n),i!==t&&bt(t,n)}function nt(){It&&(It(He,Ne),It=null)}function Fe(t){Oi=t,x("volume",t)}function Be(t){t&&(ur=!0),!it&&(it=!0,x("pause"),Fe(0))}function at(t){!t&&ur||it&&(it=!1,x("resume"),Fe(Oi))}function me(t,e){He=Math.floor(t||window.innerWidth),Ne=Math.floor(e||window.innerHeight),ki=He>Ne,x("resize",{width:He,height:Ne})}function jo(){if(Ma())try{let t=mraid.getMaxSize();me(t.width,t.height);let e=()=>{mraid.isViewable()&&mraid.getState()!=="hidden"?at():Be()};if(mraid.addEventListener("viewableChange",e),mraid.addEventListener("stateChange",e),mraid.addEventListener("sizeChange",()=>{let i=mraid.getMaxSize();me(i.width,i.height)}),mraid.getAudioVolume){let i=mraid.getAudioVolume();Fe(i?1:0)}if(mraid.addEventListener("audioVolumeChange",i=>{i!==null&&Fe(i>0?1:0)}),mraid.addEventListener("error",(i,n)=>{console.warn("mraid error:",i,"action:",n)}),jt=!0,mraid.isViewable()&&mraid.getState()!=="hidden")ue=!0,x("boot"),x("view"),x("ready"),pe=!0,nt();else{let i=()=>{ue=!0,x("boot"),x("view"),x("ready"),pe=!0,nt()};mraid.addEventListener("ready",i)}}catch(t){console.warn("MRAID hook skipped",t)}}function zo(){if(Pa())try{let t=dapi.getScreenSize();me(t.width,t.height),dapi.addEventListener("viewableChange",i=>{i.isViewable?at():Be()}),dapi.addEventListener("adResized",i=>{let n=dapi.getScreenSize();me(i.width||n.width,i.height||n.height)});let e=dapi.getAudioVolume();if(Fe(e?1:0),dapi.addEventListener("audioVolumeChange",i=>Fe(i?1:0)),jt=!0,dapi.isViewable())ue=!0,x("boot"),x("view"),x("ready"),pe=!0,nt();else{let i=()=>{ue=!0,x("boot"),x("view"),x("ready"),pe=!0,nt()};dapi.addEventListener("ready",i)}}catch(t){console.warn("DAPI hook skipped",t)}}function sr(){let t=()=>{ue||document.visibilityState==="visible"&&(document.readyState==="complete"||document.readyState==="interactive")&&(ue=!0,x("boot"),x("view"),x("ready"),pe=!0,nt(),tt&&(tt=!1,J.start()))};window.addEventListener("resize",()=>me()),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?(at(),t()):Be()}),document.readyState==="complete"||document.readyState==="interactive"?t():window.addEventListener("load",t),jt=!0}function $o(){let t=e=>{typeof TouchEvent!="undefined"&&e instanceof TouchEvent&&(nr=!0),!(nr&&e instanceof MouseEvent)&&(Ot+=1,Pi||(Pi=!0,x("first_interaction",{count:Ot})),x("interaction",Ot))};document.addEventListener("mousedown",t),document.addEventListener("touchstart",t)}function or(t){var n,a,r,s,o,l,d,p,c,g,u,b;let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none";if((typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed")==="google")try{(n=window.ExitApi)==null||n.exit();return}catch{}if(e==="mraid"&&typeof mraid!="undefined")mraid.open(t||"");else if(e==="dapi"&&typeof dapi!="undefined")dapi.openStoreUrl();else if(Ie())(r=(a=window.TJ_API)==null?void 0:a.click)==null||r.call(a);else if(Oa())(o=(s=window.FbPlayableAd)==null?void 0:s.onCTAClick)==null||o.call(s);else if(za())(d=(l=window.ScPlayableAd)==null?void 0:l.onCTAClick)==null||d.call(l);else if(ja())try{(c=(p=window.smxTracking)==null?void 0:p.redirect)==null||c.call(p)}catch(h){console.warn("Smadex redirect failed",h)}else if(Ia()){let h=window.ExitApi;h&&typeof h.exit=="function"?h.exit(t||$e||""):t&&window.open(t)}else Oe()?(g=window.install)==null||g.call(window):Ra()?(u=window.openAppStore)==null||u.call(window):Zt()?(b=parent==null?void 0:parent.postMessage)==null||b.call(parent,"download","*"):t&&window.open(t)}function Do(){let t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed",e=i=>{if(!i)return;let n=new Image;n.src=i};if(t==="bigabid"){let i=window.BIGABID_BIDTIMEMACROS;if(!i)return;B("view",()=>e(i.mraid_viewable)),B("start",()=>e(i.game_viewable)),B("engagement",()=>e(i.engagement));let n=()=>e(i.complete);B("complete",n),mt("engagement",a=>{var r;((r=a==null?void 0:a.payload)==null?void 0:r.count)>3&&n()}),B("cta_click",()=>e(i.click))}else if(t==="inmobi"){let i=window.INMOBI_DSPMACROS;if(!i)return;B("view",()=>e(i.Ad_Load_Start)),B("start",()=>e(i.Ad_Viewable)),B("engagement",()=>e(i.First_Engagement)),B("complete",()=>e(i.Gameplay_Complete)),B("cta_click",()=>e(i.DSP_Click)),B("start",()=>{[5,10,15,20,25,30].forEach(n=>setTimeout(()=>e(i[`Spent_${n}_Seconds`]),n*1e3))})}}function Ho(){if(!Ie())return;let t=window.TJ_API;t&&t.setPlayableAPI&&t.setPlayableAPI({skipAd:()=>{try{J.finish()}catch(e){console.warn("Tapjoy skip failed",e)}}})}function lr(){var e,i,n;let t=window.TJ_API;(e=t==null?void 0:t.objectiveComplete)==null||e.call(t),(i=t==null?void 0:t.playableFinished)==null||i.call(t),(n=t==null?void 0:t.gameplayFinished)==null||n.call(t)}function No(){Oe()&&(window.mintGameStart=()=>{at(!0),me()},window.mintGameClose=()=>{Be(!0)})}function Fo(){if(!Qt())return;let t=window.NUC;!t||!t.trigger||(J.on("cta_click",()=>{var e,i;return(i=(e=t.trigger).convert)==null?void 0:i.call(e,$e)}),J.on("complete",()=>{var e,i;return(i=(e=t.trigger).tryAgain)==null?void 0:i.call(e)}))}var J={init(t={},e){var i;if(pr=t.profile||"web_embed",_i=t.consent||{},ze={...cr,...t.ids||{}},De=t.rootEl||De,et=void 0,da((i=t.telemetry)!=null&&i.endpoint?t.telemetry:null),_e=null,Mi=!1,Pi=!1,Pt.clear(),$e=t.destinationUrl||(/android/i.test(navigator.userAgent)?"https://play.google.com/store":"https://www.apple.com/app-store/"),e&&(It=e),x("init"),document.body.oncontextmenu=()=>!1,rr(),Go(De),$a(),jo(),zo(),!jt){if(document.readyState==="complete")sr();else if(!ar){ar=!0;let n=()=>{sr(),window.removeEventListener("load",n),document.removeEventListener("DOMContentLoaded",n)};window.addEventListener("load",n),document.addEventListener("DOMContentLoaded",n)}}$o(),Do(),Ho(),No(),Fo(),console.log(`%c @handler/playable-sdk %c v${Ai} `,"background: var(--ui-console-info); color: var(--ui-white); font-size: 14px; padding: 4px 8px; border-top-left-radius: 4px; border-bottom-left-radius: 4px;","background: var(--ui-console-bg); color: var(--ui-console-text); font-size: 14px; padding: 4px 8px; border-top-right-radius: 4px; border-bottom-right-radius: 4px;"),ue&&!pe&&(x("boot"),x("view"),x("ready"),tt&&(tt=!1,J.start()),pe=!0),pe=ue},getRoot(){return rr()},get version(){return Ai},get maxWidth(){return He},get maxHeight(){return Ne},get isLandscape(){return ki},get isReady(){return pe},get isStarted(){return Ci},get isPaused(){return it},get isFinished(){return Qe},get volume(){return Oi},get interactions(){return Ot},on(t,e){mt(Rt(t),e)},off(t,e){Kt(Rt(t),e)},start(){var t,e;if(!Ci){if(!ue){tt=!0;return}if(Ci=!0,_e||(_e=Date.now()),x("start"),me(),Oe())Be(),(t=window.gameReady)==null||t.call(window);else if(Ie()){let i=window.TJ_API;(e=i==null?void 0:i.setPlayableBuild)==null||e.call(i,{orientation:ki?"landscape":"portrait",buildID:Ai})}}},finish(){var t,e;Qe||(Qe=!0,x("complete"),Li("complete"),Oe()?(t=window.gameEnd)==null||t.call(window):Zt()?(e=parent==null?void 0:parent.postMessage)==null||e.call(parent,"complete","*"):Ie()&&lr())},install(t){if(!Qe){Qe=!0,Ie()?(lr(),setTimeout(()=>J.install(t),300)):(x("complete"),setTimeout(()=>J.install(t),0));return}Ti||(Ti=!0,setTimeout(()=>Ti=!1,500),x("cta_click"),x("conversion"),Li("cta"),or(t||$e))},emit(t,e){let i=Rt(t);if(!Ro.has(i)&&i!=="resize"&&i!=="volume"&&!i.startsWith("custom."))throw new Error(`Event ${t} must be canonical or namespaced as custom.<mechanic_id>.<event>`);let n=hr(i,e);Jt(n,!!_i.analytics),bt(i,n)},gameStart(){J.start()},gameEnd(){J.finish()},ctaClick(t,e){x("cta_click",{url:t||$e,manual:!0}),(e==null?void 0:e.open)!==!1&&or(t||$e)},ctaShow(t){x("cta_show",t)},ctaDismiss(t){x("cta_dismiss",t)},getGameTimeMs(){return gr()},endSession(t="manual"){Li(t)},setAttribution(t){et=t},abTest(t,e){if(!t)throw new Error("abTest requires experimentId");if(!Array.isArray(e)||e.length<2)throw new Error("abTest requires at least 2 variants");let i=Math.abs(Bo(`${dr}:${t}`))%e.length,n=e[i];return et={...et||{},experiment_id:t},ze.variant_id=n,x("ab_assign",{experiment_id:t,variant_id:n}),n},levelStart(t,e){_e||(_e=Date.now()),x("level_start",{level_id:t,...e})},levelComplete(t,e){x("level_complete",{level_id:t,...e})},levelFail(t,e){x("level_fail",{level_id:t,...e})},checkpoint(t,e){x("checkpoint",{checkpoint_id:t,...e})},reward(t,e){x("reward",{reward_id:t,...e})},tutorialStart(t,e){x("tutorial_start",{step_id:t,...e})},tutorialComplete(t,e){x("tutorial_complete",{step_id:t,...e})},tutorialSkip(t,e){x("tutorial_skip",{step_id:t,...e})},timerStart(t){t&&Pt.set(t,Date.now())},timerEnd(t,e="custom",i){if(!t)return;let n=Pt.get(t);if(!n)return;Pt.delete(t);let a=Date.now()-n;if(!(!Number.isFinite(a)||a<0)){if(e==="custom"){x("engagement",{action:"timer",key:t,duration_ms:a,...i});return}x(e,{key:t,duration_ms:a,...i})}},fps(t,e){x("fps",{value:t,...e})},memory(t,e){x("memory",{bytes:t,...e})},assetLoadStart(t,e){x("asset_load_start",{asset_id:t,...e})},assetLoadComplete(t,e){x("asset_load_complete",{asset_id:t,...e})},reportError(t,e,i){x("error",{code:t,message:e,...i})},retry(){var t,e,i;if(Oe())(t=window.gameRetry)==null||t.call(window);else if(Qt()){let n=window.NUC;(i=(e=n==null?void 0:n.trigger)==null?void 0:e.tryAgain)==null||i.call(e)}x("engagement",{action:"retry"})},pause(){Be(!0)},resume(){at(!0)},resize(t,e){me(t,e)}},Re=J;function Bo(t){let e=2166136261;for(let i=0;i<t.length;i++)e^=t.charCodeAt(i),e=Math.imul(e,16777619);return e|0}function Go(t){let e=document.createElement("script");e.type="text/javascript",e.textContent=`
|
|
230
230
|
(function(){
|
|
231
231
|
var events = ['touchstart','touchend','mousedown','keydown'];
|
|
232
232
|
function unlock(){
|
|
@@ -265,7 +265,7 @@ Style guidelines: ${n.summary}`;this.promptInput.value=a,this.currentPrompt=a}}c
|
|
|
265
265
|
overflow: hidden !important;
|
|
266
266
|
`,t.appendChild(s);let o=document.createElement("div");o.setAttribute("style",["position:absolute","inset:0","width:100%","height:100%","min-width:100%","min-height:100%","max-width:100%","max-height:100%","pointer-events:auto","box-sizing:border-box","margin:0","padding:0","overflow:hidden"].join(";")),s.appendChild(o);let l=new V.Scene,{width:d,height:p}=i(),c=new V.AmbientLight(16777215,.6);l.add(c);let g=new V.DirectionalLight(16777215,.8);g.position.set(5,5,5),g.castShadow=!1,l.add(g);let u=new V.DirectionalLight(16777215,.3);u.position.set(-5,0,5),l.add(u);let b=new V.PerspectiveCamera(55,d/p,.1,100);b.position.set(0,0,3.2),b.lookAt(0,0,0),b.updateMatrixWorld();let h=new V.WebGLRenderer({antialias:!0,alpha:!0,preserveDrawingBuffer:!0});h.setPixelRatio(window.devicePixelRatio||1),h.setSize(d,p),h.setClearColor(0,0),h.domElement.style.position="absolute",h.domElement.style.top="0",h.domElement.style.left="0",h.domElement.style.right="0",h.domElement.style.bottom="0",h.domElement.style.width="100%",h.domElement.style.height="100%",h.domElement.style.minWidth="100%",h.domElement.style.minHeight="100%",h.domElement.style.maxWidth="100%",h.domElement.style.maxHeight="100%",h.domElement.style.display="block",h.domElement.style.pointerEvents="auto",h.domElement.style.margin="0",h.domElement.style.padding="0",h.domElement.style.boxSizing="border-box",o.appendChild(h.domElement);let w=f=>{var _;let m=t.getBoundingClientRect(),E=window.getComputedStyle(t);console.log("[THREE-BASE] applySize called:",{providedSize:f,rootRect:{width:m.width,height:m.height},clientSize:{width:t.clientWidth,height:t.clientHeight},styleSize:{width:t.style.width,height:t.style.height},computedStyle:{width:E.width,height:E.height,transform:E.transform,scale:E.scale},rendererCurrentSize:{width:h.domElement.width,height:h.domElement.height},rendererStyleSize:{width:h.domElement.style.width,height:h.domElement.style.height},stackTrace:(_=new Error().stack)==null?void 0:_.split(`
|
|
267
267
|
`).slice(1,4).join(`
|
|
268
|
-
`)});let S=m.width,A=m.height;if((S<=0||!isFinite(S))&&(console.warn("[THREE-BASE] Invalid boundingRect.width, using clientWidth fallback",{boundingRectWidth:m.width,clientWidth:t.clientWidth}),S=t.clientWidth||window.innerWidth||320),(A<=0||!isFinite(A))&&(console.warn("[THREE-BASE] Invalid boundingRect.height, using clientHeight fallback",{boundingRectHeight:m.height,clientHeight:t.clientHeight}),A=t.clientHeight||window.innerHeight||480),typeof(f==null?void 0:f.width)=="number"&&f.width>0){let j=Math.abs(f.width-m.width),I=m.width*.1;j>I?console.warn("[THREE-BASE] Provided width ignored (too different from container):",{provided:f.width,container:m.width,difference:j,tolerance:I,willUse:"container size (boundingRect)"}):(S=f.width,console.log("[THREE-BASE] Using provided width (within tolerance):",{provided:f.width,container:m.width}))}if(typeof(f==null?void 0:f.height)=="number"&&f.height>0){let j=Math.abs(f.height-m.height),I=m.height*.1;j>I?console.warn("[THREE-BASE] Provided height ignored (too different from container):",{provided:f.height,container:m.height,difference:j,tolerance:I,willUse:"container size (boundingRect)"}):(A=f.height,console.log("[THREE-BASE] Using provided height (within tolerance):",{provided:f.height,container:m.height}))}(S<=0||A<=0||!isFinite(S)||!isFinite(A))&&(console.warn("[THREE-BASE] Invalid size in applySize, using fallback",{newWidth:S,newHeight:A,size:f,rootRect:m}),S=m.width||t.clientWidth||320,A=m.height||t.clientHeight||480);let k=Math.floor(S),O=Math.floor(A);console.log("[THREE-BASE] applySize setting renderer size:",{finalWidth:k,finalHeight:O,aspectRatio:k/O,beforeRendererSize:{width:h.domElement.width,height:h.domElement.height},beforeRendererStyle:{width:h.domElement.style.width,height:h.domElement.style.height}}),h.setSize(k,O),h.setPixelRatio(window.devicePixelRatio||1),b.aspect=k/O,b.updateProjectionMatrix();let L=t.getBoundingClientRect();console.log("[THREE-BASE] applySize after setting:",{rendererSize:{width:h.domElement.width,height:h.domElement.height},rendererStyle:{width:h.domElement.style.width,height:h.domElement.style.height},containerRect:{width:L.width,height:L.height},cameraAspect:b.aspect,matches:{width:Math.abs(h.domElement.width-L.width)<1,height:Math.abs(h.domElement.height-L.height)<1},sizeDifference:{width:h.domElement.width-L.width,height:h.domElement.height-L.height}})};requestAnimationFrame(()=>{requestAnimationFrame(()=>{w()})});let v=!1;Re.on("pause",()=>{v=!0,document.querySelectorAll("audio").forEach(m=>m.pause())}),Re.on("resume",()=>{v=!1,document.querySelectorAll("audio").forEach(m=>{m.currentTime>0&&!m.ended&&m.play().catch(()=>{})})});let y=new Ge(t,s);return Re.on("resize",({payload:f})=>{console.log("[THREE-BASE] Handler resize event received:",{payload:f,timestamp:Date.now(),rootRect:t.getBoundingClientRect()}),w({width:f==null?void 0:f.width,height:f==null?void 0:f.height}),y.updateLayout()}),window.addEventListener("resize",()=>{console.log("[THREE-BASE] Window resize event received:",{timestamp:Date.now(),windowSize:{width:window.innerWidth,height:window.innerHeight},rootRect:t.getBoundingClientRect()}),w(),y.updateLayout()}),{scene:l,camera:b,renderer:h,uiSystem:y,applySize:w}}var z=ae(require("three"),1),rt=class{constructor(e){var i,n;this.position=(e==null?void 0:e.position)||{x:0,y:0},this.scale=(i=e==null?void 0:e.scale)!=null?i:1,this.rotation=(n=e==null?void 0:e.rotation)!=null?n:0}update(e){e.position!==void 0&&(this.position={...e.position}),e.scale!==void 0&&(this.scale=e.scale),e.rotation!==void 0&&(this.rotation=e.rotation)}syncToThree(e){let i=e.position.z,n=i===0||!isFinite(i)?.5:i;e.position.set(this.position.x,this.position.y,n),e.scale.set(this.scale,this.scale,this.scale),e.rotation.z=this.rotation}},st=class{constructor(e){var i,n,a,r;this.z_index=(i=e==null?void 0:e.z_index)!=null?i:0,this.alpha=(n=e==null?void 0:e.alpha)!=null?n:1,this.visible=(a=e==null?void 0:e.visible)!=null?a:!0,this.tint=(r=e==null?void 0:e.tint)!=null?r:null}update(e){e.z_index!==void 0&&(this.z_index=e.z_index),e.alpha!==void 0&&(this.alpha=e.alpha),e.visible!==void 0&&(this.visible=e.visible),e.tint!==void 0&&(this.tint=e.tint)}syncToThree(e){if(e.renderOrder=this.z_index,e.visible=this.visible,e instanceof z.Mesh&&e.material&&(Array.isArray(e.material)?e.material.forEach(i=>{i instanceof z.Material&&(i.opacity=this.alpha,i.transparent=this.alpha<1)}):e.material instanceof z.Material&&(e.material.opacity=this.alpha,e.material.transparent=this.alpha<1)),this.tint!==null&&e instanceof z.Mesh&&e.material){let i=typeof this.tint=="string"?new z.Color(this.tint):new z.Color(this.tint);Array.isArray(e.material)?e.material.forEach(n=>{(n instanceof z.MeshBasicMaterial||n instanceof z.MeshStandardMaterial)&&n.color.copy(i)}):(e.material instanceof z.MeshBasicMaterial||e.material instanceof z.MeshStandardMaterial)&&e.material.color.copy(i)}}},ot=class{constructor(e,i,n,a){this.instanceId=e,this.objectConfig=i,this.threeObject=n,this._config=a,this.transform=new rt(a.transform),this.renderer=new st(a.render),this.sync()}sync(){this.transform.syncToThree(this.threeObject),this.renderer.syncToThree(this.threeObject)}updateConfig(e){this._config=e,e.transform&&this.transform.update(e.transform),e.render&&this.renderer.update(e.render),this.sync()}getComponent(e){return this._config[e]}getPosition(){return{...this.transform.position}}setPosition(e,i){this.transform.position={x:e,y:i},this.transform.syncToThree(this.threeObject)}getAlpha(){return this.renderer.alpha}setAlpha(e){this.renderer.alpha=e,this.renderer.syncToThree(this.threeObject)}getVisible(){return this.renderer.visible}setVisible(e){this.renderer.visible=e,this.renderer.syncToThree(this.threeObject)}}
|
|
268
|
+
`)});let S=m.width,A=m.height;if((S<=0||!isFinite(S))&&(console.warn("[THREE-BASE] Invalid boundingRect.width, using clientWidth fallback",{boundingRectWidth:m.width,clientWidth:t.clientWidth}),S=t.clientWidth||window.innerWidth||320),(A<=0||!isFinite(A))&&(console.warn("[THREE-BASE] Invalid boundingRect.height, using clientHeight fallback",{boundingRectHeight:m.height,clientHeight:t.clientHeight}),A=t.clientHeight||window.innerHeight||480),typeof(f==null?void 0:f.width)=="number"&&f.width>0){let j=Math.abs(f.width-m.width),I=m.width*.1;j>I?console.warn("[THREE-BASE] Provided width ignored (too different from container):",{provided:f.width,container:m.width,difference:j,tolerance:I,willUse:"container size (boundingRect)"}):(S=f.width,console.log("[THREE-BASE] Using provided width (within tolerance):",{provided:f.width,container:m.width}))}if(typeof(f==null?void 0:f.height)=="number"&&f.height>0){let j=Math.abs(f.height-m.height),I=m.height*.1;j>I?console.warn("[THREE-BASE] Provided height ignored (too different from container):",{provided:f.height,container:m.height,difference:j,tolerance:I,willUse:"container size (boundingRect)"}):(A=f.height,console.log("[THREE-BASE] Using provided height (within tolerance):",{provided:f.height,container:m.height}))}(S<=0||A<=0||!isFinite(S)||!isFinite(A))&&(console.warn("[THREE-BASE] Invalid size in applySize, using fallback",{newWidth:S,newHeight:A,size:f,rootRect:m}),S=m.width||t.clientWidth||320,A=m.height||t.clientHeight||480);let k=Math.floor(S),O=Math.floor(A);console.log("[THREE-BASE] applySize setting renderer size:",{finalWidth:k,finalHeight:O,aspectRatio:k/O,beforeRendererSize:{width:h.domElement.width,height:h.domElement.height},beforeRendererStyle:{width:h.domElement.style.width,height:h.domElement.style.height}}),h.setSize(k,O),h.setPixelRatio(window.devicePixelRatio||1),b.aspect=k/O,b.updateProjectionMatrix();let L=t.getBoundingClientRect();console.log("[THREE-BASE] applySize after setting:",{rendererSize:{width:h.domElement.width,height:h.domElement.height},rendererStyle:{width:h.domElement.style.width,height:h.domElement.style.height},containerRect:{width:L.width,height:L.height},cameraAspect:b.aspect,matches:{width:Math.abs(h.domElement.width-L.width)<1,height:Math.abs(h.domElement.height-L.height)<1},sizeDifference:{width:h.domElement.width-L.width,height:h.domElement.height-L.height}})};requestAnimationFrame(()=>{requestAnimationFrame(()=>{w()})});let v=!1;Re.on("pause",()=>{v=!0,document.querySelectorAll("audio").forEach(m=>m.pause())}),Re.on("resume",()=>{v=!1,document.querySelectorAll("audio").forEach(m=>{m.currentTime>0&&!m.ended&&m.play().catch(()=>{})})});let y=new Ge(t,s);return Re.on("resize",({payload:f})=>{console.log("[THREE-BASE] Handler resize event received:",{payload:f,timestamp:Date.now(),rootRect:t.getBoundingClientRect()}),w({width:f==null?void 0:f.width,height:f==null?void 0:f.height}),y.updateLayout()}),window.addEventListener("resize",()=>{console.log("[THREE-BASE] Window resize event received:",{timestamp:Date.now(),windowSize:{width:window.innerWidth,height:window.innerHeight},rootRect:t.getBoundingClientRect()}),w(),y.updateLayout()}),{scene:l,camera:b,renderer:h,uiSystem:y,applySize:w}}var z=ae(require("three"),1),rt=class{constructor(e){var i,n;this.position=(e==null?void 0:e.position)||{x:0,y:0},this.scale=(i=e==null?void 0:e.scale)!=null?i:1,this.rotation=(n=e==null?void 0:e.rotation)!=null?n:0}update(e){e.position!==void 0&&(this.position={...e.position}),e.scale!==void 0&&(this.scale=e.scale),e.rotation!==void 0&&(this.rotation=e.rotation)}syncToThree(e){let i=e.position.z,n=i===0||!isFinite(i)?.5:i;e.position.set(this.position.x,this.position.y,n),e.scale.set(this.scale,this.scale,this.scale),e.rotation.z=this.rotation}},st=class{constructor(e){var i,n,a,r;this.z_index=(i=e==null?void 0:e.z_index)!=null?i:0,this.alpha=(n=e==null?void 0:e.alpha)!=null?n:1,this.visible=(a=e==null?void 0:e.visible)!=null?a:!0,this.tint=(r=e==null?void 0:e.tint)!=null?r:null}update(e){e.z_index!==void 0&&(this.z_index=e.z_index),e.alpha!==void 0&&(this.alpha=e.alpha),e.visible!==void 0&&(this.visible=e.visible),e.tint!==void 0&&(this.tint=e.tint)}syncToThree(e){if(e.renderOrder=this.z_index,e.visible=this.visible,e instanceof z.Mesh&&e.material&&(Array.isArray(e.material)?e.material.forEach(i=>{i instanceof z.Material&&(i.opacity=this.alpha,i.transparent=this.alpha<1)}):e.material instanceof z.Material&&(e.material.opacity=this.alpha,e.material.transparent=this.alpha<1)),this.tint!==null&&e instanceof z.Mesh&&e.material){let i=typeof this.tint=="string"?new z.Color(this.tint):new z.Color(this.tint);Array.isArray(e.material)?e.material.forEach(n=>{(n instanceof z.MeshBasicMaterial||n instanceof z.MeshStandardMaterial)&&n.color.copy(i)}):(e.material instanceof z.MeshBasicMaterial||e.material instanceof z.MeshStandardMaterial)&&e.material.color.copy(i)}}},ot=class{constructor(e,i,n,a){this.instanceId=e,this.objectConfig=i,this.threeObject=n,this._config=a,this.transform=new rt(a.transform),this.renderer=new st(a.render),this.sync()}sync(){this.transform.syncToThree(this.threeObject),this.renderer.syncToThree(this.threeObject)}updateConfig(e){this._config=e,e.transform&&this.transform.update(e.transform),e.render&&this.renderer.update(e.render),this.sync()}getComponent(e){return this._config[e]}getPosition(){return{...this.transform.position}}setPosition(e,i){this.transform.position={x:e,y:i},this.transform.syncToThree(this.threeObject)}getAlpha(){return this.renderer.alpha}setAlpha(e){this.renderer.alpha=e,this.renderer.syncToThree(this.threeObject)}getVisible(){return this.renderer.visible}setVisible(e){this.renderer.visible=e,this.renderer.syncToThree(this.threeObject)}},$t=class{constructor(e){this.objects=new Map;this.config=e}create(e,i){let n=this.config.objects.get(e);if(!n)throw new Error(`Object config not found: ${e}`);let a=new ot(e,n.object_config||e,i,n);return this.objects.set(e,a),a}get(e){return this.objects.get(e)}updateConfig(e){this.config=e;for(let[i,n]of this.objects.entries()){let a=e.objects.get(i);a&&n.updateConfig(a)}}getAll(){return Array.from(this.objects.values())}remove(e){this.objects.delete(e)}clear(){this.objects.clear()}};var Dt={"brand.primary":{family:"Arial, sans-serif",weight:"400"},"brand.warning":{family:"Arial Black, Arial, sans-serif",weight:"900"},"brand.heading":{family:"Arial Black, Arial, sans-serif",weight:"800"},"brand.body":{family:"Arial, sans-serif",weight:"400"}};function Z(t){let e=Dt[t];return e?e.family:(console.warn(`Font ID "${t}" not found in registry, using fallback`),"Arial, sans-serif")}function Q(t){var i;let e=Dt[t];return e&&(i=e.weight)!=null?i:"400"}function mr(t,e){Dt[t]=e}function br(){return Object.keys(Dt)}var Ue=ae(require("three"),1);function ke(t){return{element:t,get alpha(){return parseFloat(t.style.opacity||"1")},set alpha(e){t.style.opacity=e.toString()},get visible(){return t.style.display!=="none"},set visible(e){t.style.display=e?"":"none"},position:{set(e,i){t.style.left=`${e}px`,t.style.top=`${i}px`},get x(){return parseFloat(t.style.left||"0")},get y(){return parseFloat(t.style.top||"0")}},scale:{set(e,i){t.style.transform=`scale(${e})`},get x(){let e=t.style.transform.match(/scale\(([^)]+)\)/);return e?parseFloat(e[1]):1}}}}function yr(t,e,i,n){var Zi,Qi,en,tn,nn,an,rn,sn,on,ln,cn,dn,pn,un,gn,hn,fn,mn,bn,yn,vn,wn,xn,En,Sn,An,Cn,Tn,Ln,_n,kn,Mn,Pn,On,In,Rn,jn,zn,$n,Dn,Hn,Nn,Fn,Bn,Gn,Un,qn,Wn,Vn,Yn,Xn,Kn,Jn,Zn,Qn,ea,ta,ia,na,aa,ra;let a=t.objects.get("ui_endgame_1"),r=t.objects.get("ui_endgame_logo_1"),s=t.objects.get("ui_endgame_title_1"),o=t.objects.get("ui_endgame_subtitle_1"),l=t.objects.get("ui_endgame_footer_1"),d=t.objects.get("ui_endgame_cta_1"),p=t.objects.get("ui_endgame_cta_hint_1"),c=t.objects.get("ui_endgame_hand_1"),g=t.engine.runtime||{},u=((Zi=a==null?void 0:a.gameplay)==null?void 0:Zi.tuning)||{},b=(a==null?void 0:a.render)||{},h=n.getBoundingClientRect(),w=h.width>0?h.width*.9:320,v=h.height>0?h.height*.85:400,y=Math.min((Qi=u.panel_width)!=null?Qi:320,w),f=Math.min((en=u.panel_height)!=null?en:400,v),m=(tn=u.panel_padding)!=null?tn:32,E=(nn=u.panel_radius)!=null?nn:24,S=b.background_color||u.panel_bg_color||"#1a0a0a",A=b.background_alpha!==void 0&&b.background_alpha!==null?b.background_alpha:(an=u.panel_bg_alpha)!=null?an:.98,k=b.border_color||u.panel_border_color||"#ffffff",O=(rn=u.panel_border_width)!=null?rn:2,L=(sn=u.panel_border_alpha)!=null?sn:.3,_=document.createElement("div");_.style.cssText=`
|
|
269
269
|
position: absolute;
|
|
270
270
|
width: ${y}px;
|
|
271
271
|
height: ${f}px;
|
|
@@ -284,9 +284,9 @@ Style guidelines: ${n.summary}`;this.promptInput.value=a,this.currentPrompt=a}}c
|
|
|
284
284
|
z-index: 1000;
|
|
285
285
|
box-sizing: border-box;
|
|
286
286
|
padding: ${m}px;
|
|
287
|
-
`,n.appendChild(_);let j=ke(_);j.element=_;let I=((on=r==null?void 0:r.gameplay)==null?void 0:on.tuning)||{},be=(r==null?void 0:r.transform)||{},q=(ln=I.logo_size)!=null?ln:56,Y=(cn=be.scale)!=null?cn:1,Me=(pn=(dn=be.offset)==null?void 0:dn.y)!=null?pn:-130,lt=(un=I.logo_alpha)!=null?un:1,_r=new Ue.SpriteMaterial({map:i||void 0,transparent:!0,alphaTest:.1}),X=new Ue.Sprite(_r);X.position.set(0,Me,0),X.material.opacity=0;let ct=0,dt=0;if(i){let
|
|
288
|
-
font-family: ${Z(
|
|
289
|
-
font-size: ${
|
|
287
|
+
`,n.appendChild(_);let j=ke(_);j.element=_;let I=((on=r==null?void 0:r.gameplay)==null?void 0:on.tuning)||{},be=(r==null?void 0:r.transform)||{},q=(ln=I.logo_size)!=null?ln:56,Y=(cn=be.scale)!=null?cn:1,Me=(pn=(dn=be.offset)==null?void 0:dn.y)!=null?pn:-130,lt=(un=I.logo_alpha)!=null?un:1,_r=new Ue.SpriteMaterial({map:i||void 0,transparent:!0,alphaTest:.1}),X=new Ue.Sprite(_r);X.position.set(0,Me,0),X.material.opacity=0;let ct=0,dt=0;if(i){let $=i.image;ct=($==null?void 0:$.width)||100,dt=($==null?void 0:$.height)||100}if(ct>0&&dt>0){let $=ct/dt,Yt,Xt;$>1?(Yt=q,Xt=q/$):(Xt=q,Yt=q*$);let gs=Yt/ct*Y,hs=Xt/dt*Y;X.scale.set(gs,hs,1)}else{let $=q/100*Y;X.scale.set($,$,1)}X.targetAlpha=lt,X.baseScaleX=X.scale.x,X.baseScaleY=X.scale.y;let D=s==null?void 0:s.ui,ee=((gn=s==null?void 0:s.gameplay)==null?void 0:gn.tuning)||{},kr=(D==null?void 0:D.text)||"MISSION ACCOMPLISHED",$i=(D==null?void 0:D.font)||"brand.heading",Nt=(D==null?void 0:D.fontSize)||24,Mr=(hn=D==null?void 0:D.letterSpacing)!=null?hn:1,pt=(fn=s==null?void 0:s.render)==null?void 0:fn.tint,Pr=typeof pt=="string"?pt:pt?`#${pt.toString(16).padStart(6,"0")}`:"#00FF88",Or=y-m*2-30,Ir=ee.font_weight_override?ee.font_weight_override:Q($i),ye=document.createElement("div");ye.textContent=kr,ye.style.cssText=`
|
|
288
|
+
font-family: ${Z($i)};
|
|
289
|
+
font-size: ${Nt}px;
|
|
290
290
|
font-weight: ${Ir};
|
|
291
291
|
color: ${Pr};
|
|
292
292
|
text-align: center;
|
|
@@ -298,30 +298,30 @@ Style guidelines: ${n.summary}`;this.promptInput.value=a,this.currentPrompt=a}}c
|
|
|
298
298
|
transform: translate(-50%, -50%);
|
|
299
299
|
white-space: nowrap;
|
|
300
300
|
max-width: ${Or}px;
|
|
301
|
-
`;let
|
|
302
|
-
font-family: ${Z(
|
|
303
|
-
font-size: ${
|
|
304
|
-
font-weight: ${Q(
|
|
305
|
-
color: ${
|
|
301
|
+
`;let Di=m+30,Rr=((xn=u.title_offset_y)!=null?xn:Di+Nt/2)+((En=ee.animation_start_y_offset)!=null?En:-20);ye.style.top=`${Rr}px`,ye.style.left="50%";let Hi=ke(ye);Hi.element=ye,_.appendChild(ye);let H=o==null?void 0:o.ui,Ni=((Sn=o==null?void 0:o.gameplay)==null?void 0:Sn.tuning)||{},jr=(H==null?void 0:H.text)||"RESCUE COMPLETE",Fi=(H==null?void 0:H.font)||"brand.body",Ft=(H==null?void 0:H.fontSize)||11,zr=(An=H==null?void 0:H.letterSpacing)!=null?An:.5,ut=(Cn=o==null?void 0:o.render)==null?void 0:Cn.tint,$r=typeof ut=="string"?ut:ut?`#${ut.toString(16).padStart(6,"0")}`:"#B0B0B0",ve=document.createElement("div");ve.textContent=jr,ve.style.cssText=`
|
|
302
|
+
font-family: ${Z(Fi)};
|
|
303
|
+
font-size: ${Ft}px;
|
|
304
|
+
font-weight: ${Q(Fi)};
|
|
305
|
+
color: ${$r};
|
|
306
306
|
text-align: center;
|
|
307
307
|
letter-spacing: ${zr}px;
|
|
308
308
|
opacity: 0;
|
|
309
309
|
position: absolute;
|
|
310
310
|
transform: translate(-50%, -50%);
|
|
311
311
|
white-space: nowrap;
|
|
312
|
-
`;let Bi
|
|
312
|
+
`;let Bi=Di+Nt+15,Dr=((Tn=u.subtitle_offset_y)!=null?Tn:Bi+Ft/2)+((Ln=Ni.animation_start_y_offset)!=null?Ln:-10);ve.style.top=`${Dr}px`,ve.style.left="50%";let Bt=ke(ve);Bt.element=ve,Bt.animationStartYOffset=(_n=Ni.animation_start_y_offset)!=null?_n:-10,_.appendChild(ve);let te=l==null?void 0:l.ui,Gi=((kn=l==null?void 0:l.gameplay)==null?void 0:kn.tuning)||{},Hr=(te==null?void 0:te.text)||((Mn=g.ui)==null?void 0:Mn.cta_hint)||"Continue the adventure!",Ui=(te==null?void 0:te.font)||"brand.body",qi=(te==null?void 0:te.fontSize)||16,gt=(Pn=l==null?void 0:l.render)==null?void 0:Pn.tint,Nr=typeof gt=="string"?gt:gt?`#${gt.toString(16).padStart(6,"0")}`:"#FFFFFF",Fr=(On=Gi.max_width)!=null?On:y-m*2,Br=(In=Gi.line_height)!=null?In:1.4,we=document.createElement("div");we.textContent=Hr,we.style.cssText=`
|
|
313
313
|
font-family: ${Z(Ui)};
|
|
314
314
|
font-size: ${qi}px;
|
|
315
315
|
font-weight: ${Q(Ui)};
|
|
316
|
-
color: ${
|
|
316
|
+
color: ${Nr};
|
|
317
317
|
text-align: center;
|
|
318
318
|
opacity: 0;
|
|
319
319
|
position: absolute;
|
|
320
320
|
transform: translate(-50%, -50%);
|
|
321
|
-
max-width: ${
|
|
321
|
+
max-width: ${Fr}px;
|
|
322
322
|
line-height: ${Br};
|
|
323
323
|
word-wrap: break-word;
|
|
324
|
-
`;let Gr=Bi+
|
|
324
|
+
`;let Gr=Bi+Ft+30,Ur=(Rn=u.footer_offset_y)!=null?Rn:Gr+qi/2;we.style.top=`${Ur}px`,we.style.left="50%";let Gt=ke(we);Gt.element=we;let qr=((jn=l==null?void 0:l.render)==null?void 0:jn.alpha)!==void 0&&((zn=l==null?void 0:l.render)==null?void 0:zn.alpha)!==null?l.render.alpha:1;Gt.targetAlpha=qr,_.appendChild(we);let ie=(($n=d==null?void 0:d.gameplay)==null?void 0:$n.tuning)||{},N=d==null?void 0:d.ui,Wr=(Dn=ie.button_width)!=null?Dn:260,Wi=(Hn=ie.button_height)!=null?Hn:56,Vr=(Nn=ie.button_radius)!=null?Nn:16,Yr=ie.button_bg_color||((Fn=g.theme)==null?void 0:Fn.cta_background)||"#ffb43b",Xr=(Bn=ie.button_bg_alpha)!=null?Bn:1,Kr=ie.button_border_color||"#ffffff",Jr=(Gn=ie.button_border_width)!=null?Gn:2,Qo=(Un=ie.button_border_alpha)!=null?Un:.2,Ut=(qn=u.cta_offset_y)!=null?qn:f*.7,R=document.createElement("button");R.style.cssText=`
|
|
325
325
|
width: ${Wr}px;
|
|
326
326
|
height: ${Wi}px;
|
|
327
327
|
background: ${Yr};
|
|
@@ -333,7 +333,7 @@ Style guidelines: ${n.summary}`;this.promptInput.value=a,this.currentPrompt=a}}c
|
|
|
333
333
|
position: absolute;
|
|
334
334
|
transform: translate(-50%, -50%);
|
|
335
335
|
box-shadow: inset 0 0 1px rgba(0,0,0,0.15);
|
|
336
|
-
`,R.style.top=`${Ut}px`,R.style.left="50%";let qt=ke(R);qt.element=R,qt.addEventListener=R.addEventListener.bind(R),_.appendChild(R);let Zr=(
|
|
336
|
+
`,R.style.top=`${Ut}px`,R.style.left="50%";let qt=ke(R);qt.element=R,qt.addEventListener=R.addEventListener.bind(R),_.appendChild(R);let Zr=(N==null?void 0:N.text)||((Wn=g.ui)==null?void 0:Wn.cta_label_end)||"DOWNLOAD",Vi=(N==null?void 0:N.font)||"brand.heading",Qr=(N==null?void 0:N.fontSize)||20,es=ie.button_text_color||((Vn=g.theme)==null?void 0:Vn.cta_text)||"#1a0a0a";R.textContent=Zr,R.style.fontFamily=Z(Vi),R.style.fontSize=`${Qr}px`,R.style.fontWeight=String(Q(Vi)),R.style.color=es,R.style.letterSpacing=`${(Yn=N==null?void 0:N.letterSpacing)!=null?Yn:1}px`;let Yi=ke(R);Yi.element=R;let F=p==null?void 0:p.ui,Xi=((Xn=p==null?void 0:p.gameplay)==null?void 0:Xn.tuning)||{},ts=(F==null?void 0:F.text)||"Play the full game",Ki=(F==null?void 0:F.font)||"brand.body",is=(F==null?void 0:F.fontSize)||11,ns=(Kn=F==null?void 0:F.letterSpacing)!=null?Kn:0,ht=(Jn=p==null?void 0:p.render)==null?void 0:Jn.tint,as=typeof ht=="string"?ht:ht?`#${ht.toString(16).padStart(6,"0")}`:"#CCCCCC",xe=document.createElement("div");xe.textContent=ts,xe.style.cssText=`
|
|
337
337
|
font-family: ${Z(Ki)};
|
|
338
338
|
font-size: ${is}px;
|
|
339
339
|
font-weight: ${Q(Ki)};
|