handler-playable-sdk 1.0.45 → 1.0.47
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-WNRFAMMB.js → chunk-CCGP6ONI.js} +29 -29
- package/dist/cli/brand-dna.mjs +1 -1
- package/dist/cli/canva-import.mjs +1 -1
- package/dist/cli/cleanup-assets.mjs +1 -1
- package/dist/cli/fix-scales.mjs +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/screen-helper.mjs +1 -1
- package/dist/cli/setup-library.mjs +1 -1
- package/dist/cli/student-helper/add-logic.mjs +1 -1
- package/dist/cli/student-helper/add-object.mjs +1 -1
- package/dist/cli/student-helper/arg-parsing.mjs +1 -1
- package/dist/cli/student-helper/asset-registry.mjs +1 -1
- package/dist/cli/student-helper/bullet-system.mjs +1 -1
- package/dist/cli/student-helper/collectable-system.mjs +1 -1
- package/dist/cli/student-helper/constants.mjs +1 -1
- package/dist/cli/student-helper/drag-snap-couples.mjs +1 -1
- package/dist/cli/student-helper/endgame-screen.mjs +1 -1
- package/dist/cli/student-helper/fs-io.mjs +1 -1
- package/dist/cli/student-helper/logic-defaults.mjs +1 -1
- package/dist/cli/student-helper/print-help.mjs +1 -1
- package/dist/cli/student-helper/prompts.mjs +1 -1
- package/dist/cli/student-helper/scratch-card.mjs +1 -1
- package/dist/cli/student-helper/screen-utils.mjs +1 -1
- package/dist/cli/student-helper/snippets.mjs +1 -1
- package/dist/cli/student-helper/start-screen.mjs +1 -1
- package/dist/cli/student-helper/swerve-collect.mjs +1 -1
- package/dist/cli/student-helper/tap-destroy.mjs +1 -1
- package/dist/cli/student-helper/template-packs.mjs +1 -1
- package/dist/cli/student-helper.mjs +1 -1
- package/dist/cli/sync-screens.mjs +1 -1
- package/dist/cli/validate-assets.mjs +1 -1
- package/dist/cli/validate.mjs +1 -1
- package/dist/index.cjs +206 -206
- package/dist/index.js +1 -1
- package/dist/pixi/index.cjs +16 -16
- package/dist/pixi/index.js +1 -1
- package/dist/three/index.cjs +1 -1
- package/dist/three/index.js +1 -1
- package/package.json +1 -1
package/dist/pixi/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x14883c,_0x4e3a1c){var a0_0x499bc6={_0xdb68ae:0x3ea,_0x3dd345:'7St$',_0x4ee56a:0x3f6,_0x154671:0x3fc,_0x44eb65:0x40d,_0x5ca40f:0x3f1,_0x1b6958:'#WQm',_0xd505fc:0x3ff,_0x5ba70f:0x191,_0x37a887:0x18e,_0xd0057a:'^041',_0x165e0a:0x18b,_0x199ac6:0x161,_0x2b96f5:0x3fb,_0x32b99e:0x3ed,_0x51ff26:'[XJG',_0x555c49:0x3fd,_0x2de6df:0x1c0,_0x119ddd:0x1b7,_0x49849b:0x3e7,_0x5042bb:0x3fa,_0x2df23f:'%63Y',_0x10d72a:0x3f7,_0x29b9f5:0x16e,_0x3ee77f:'fyBM',_0x4483a1:0x16e,_0x5bef5f:0x3e2,_0xcbefcd:0x3f3,_0x5b7ec1:0x3e6,_0x45aed7:'aPSa',_0x3c3f9f:0x3e9,_0xae69ed:0x1d4,_0x1a500c:'XUQ^',_0x551efe:0x1c3,_0x414f52:0x1c6,_0x5ce4e3:0x3eb,_0x42b06a:0x3ea,_0x36cdd8:'yt7H',_0x404793:0x3f2,_0x33c6e3:0x183,_0x1f9b94:0x186,_0x111f13:0x175,_0x262f52:0x17e},a0_0xfde14b={_0x123d6b:0x255},a0_0x555368={_0xd039db:0x31b},a0_0x3b1cff={_0x53111b:0xd6};function _0x4b86e2(_0x50b33d,_0x44b82c,_0x598662,_0x51fafe,_0x2ded79){return a0_0x3f1f(_0x598662-a0_0x3b1cff._0x53111b,_0x44b82c);}function _0x15e051(_0x28cfcf,_0x1b0954,_0x2d755e,_0x58c1a0,_0x842c5){return a0_0x3f1f(_0x842c5-a0_0x555368._0xd039db,_0x58c1a0);}var _0x24a515=_0x14883c();function _0x18c701(_0x402c39,_0x3c09de,_0x16decf,_0x3c0c38,_0x579169){return a0_0x3f1f(_0x16decf- -a0_0xfde14b._0x123d6b,_0x3c0c38);}while(!![]){try{var _0x2956f9=-parseInt(_0x15e051(0x3e9,a0_0x499bc6._0xdb68ae,0x3fe,a0_0x499bc6._0x3dd345,a0_0x499bc6._0x4ee56a))/(0x264+-0x1208*-0x1+-0x146b*0x1)*(-parseInt(_0x15e051(a0_0x499bc6._0x154671,a0_0x499bc6._0x44eb65,a0_0x499bc6._0x5ca40f,a0_0x499bc6._0x1b6958,a0_0x499bc6._0xd505fc))/(0x17*0x15a+0x1*0x3bd+-0x22d1))+-parseInt(_0x18c701(-a0_0x499bc6._0x5ba70f,-a0_0x499bc6._0x37a887,-0x183,a0_0x499bc6._0xd0057a,-a0_0x499bc6._0x165e0a))/(0xc04*0x1+0x2100+-0x1*0x2d01)+parseInt(_0x18c701(-a0_0x499bc6._0x199ac6,-0x181,-0x172,'^f9Q',-0x169))/(0x2a2+0x322*-0xa+0x41a*0x7)*(-parseInt(_0x15e051(0x3fc,a0_0x499bc6._0x2b96f5,a0_0x499bc6._0x32b99e,a0_0x499bc6._0x51ff26,a0_0x499bc6._0x555c49))/(0x3*-0x5cb+0x232+0xf34))+-parseInt(_0x4b86e2(a0_0x499bc6._0x2de6df,'MRb&',0x1b3,a0_0x499bc6._0x119ddd,0x1b3))/(0x7f*0x41+-0xc4*0x16+-0xf61)*(-parseInt(_0x15e051(a0_0x499bc6._0x49849b,a0_0x499bc6._0x5042bb,0x3f8,a0_0x499bc6._0x2df23f,a0_0x499bc6._0x10d72a))/(-0x165f+0x982*0x2+0x1*0x362))+-parseInt(_0x18c701(-a0_0x499bc6._0x29b9f5,-0x167,-0x177,a0_0x499bc6._0x3ee77f,-a0_0x499bc6._0x4483a1))/(0x69+-0x1*-0x262a+0x1ad*-0x17)*(-parseInt(_0x15e051(a0_0x499bc6._0x5bef5f,a0_0x499bc6._0xcbefcd,a0_0x499bc6._0x5b7ec1,a0_0x499bc6._0x45aed7,a0_0x499bc6._0x3c3f9f))/(-0x1419+-0x17d3+0x2bf5))+-parseInt(_0x4b86e2(a0_0x499bc6._0xae69ed,a0_0x499bc6._0x1a500c,a0_0x499bc6._0x551efe,a0_0x499bc6._0x414f52,0x1c2))/(-0x189c+-0xb86+0x242c)+-parseInt(_0x15e051(a0_0x499bc6._0x5ce4e3,a0_0x499bc6._0x42b06a,0x3e4,a0_0x499bc6._0x36cdd8,a0_0x499bc6._0x404793))/(0x1691+0x1b*-0x111+0x5*0x141)*(-parseInt(_0x18c701(-a0_0x499bc6._0x33c6e3,-a0_0x499bc6._0x1f9b94,-a0_0x499bc6._0x111f13,'gsbc',-a0_0x499bc6._0x262f52))/(0x2270+0x39e*-0x4+-0x64*0x33));if(_0x2956f9===_0x4e3a1c)break;else _0x24a515['push'](_0x24a515['shift']());}catch(_0x47b49a){_0x24a515['push'](_0x24a515['shift']());}}}(a0_0x2c7c,-0xbdac8+-0x113882+0x5*0x7e881));var a0_0x335969=(function(){var a0_0x1be57d={_0xd24249:0x8f,_0x4aeba8:0xa5,_0x3ea1ca:0xa7,_0x3b743c:0x9a,_0x2d7068:'aPSa'},_0x36a248=!![];return function(_0x4c0d40,_0x5eb8cb){var _0x68ba4e=_0x36a248?function(){function _0x94c54d(_0x3915b4,_0x3a60d2,_0x276972,_0x1c3a60,_0x5e12d1){return a0_0x3f1f(_0x1c3a60- -0x3e,_0x5e12d1);}if(_0x5eb8cb){var _0x1764dd=_0x5eb8cb[_0x94c54d(a0_0x1be57d._0xd24249,a0_0x1be57d._0x4aeba8,a0_0x1be57d._0x3ea1ca,a0_0x1be57d._0x3b743c,a0_0x1be57d._0x2d7068)](_0x4c0d40,arguments);return _0x5eb8cb=null,_0x1764dd;}}:function(){};return _0x36a248=![],_0x68ba4e;};}()),a0_0x5803cc=a0_0x335969(this,function(){var a0_0x118b78={_0xea278b:0x244,_0xe37937:0x23a,_0x1e7fac:0x233,_0x3aeeb8:0x237,_0x558889:'fyBM',_0x482d5a:0x174,_0x466068:0x15e,_0x1d3a17:'WBXV',_0x51ae0d:0x16a,_0x1008ff:0x168,_0xe888b3:'Qy$J',_0x238c46:0x11,_0x2159d5:0x2a,_0x4fbd0b:0x11,_0x269455:'Y&uw',_0x34efcb:0x25b,_0x3db0e7:0x24c,_0x4b88df:'bqgq',_0x1e461c:0xf,_0x52698b:'SV^f',_0x5c268b:0x1c,_0x3e0ee3:0x25,_0x8eda61:0x36,_0x3c942a:0x33,_0x4c7ddc:'ADDH',_0x1f8143:0xe,_0x4e3056:0xf,_0x594e61:0x15,_0x176015:0x1d,_0x2c4b52:0x241,_0x5ef132:0x23f,_0x559b24:0x256,_0x4dcc91:0x250,_0x3863d9:0x24e,_0x43838b:0x25d,_0x1a9098:0x246,_0x386d61:0x249,_0x575cba:'GJJ6',_0x414344:0x244,_0x276771:0x251},a0_0x55422d={_0x5be8a6:0x254},a0_0x56a023={_0xfd4824:0x320},_0x504bf6={};_0x504bf6[_0x10cd07(-a0_0x118b78._0xea278b,-a0_0x118b78._0xe37937,-a0_0x118b78._0x1e7fac,-a0_0x118b78._0x3aeeb8,a0_0x118b78._0x558889)]=_0x420648(-a0_0x118b78._0x482d5a,-a0_0x118b78._0x466068,-a0_0x118b78._0x466068,a0_0x118b78._0x1d3a17,-a0_0x118b78._0x51ae0d)+_0x420648(-0x160,-a0_0x118b78._0x1008ff,-0x15f,a0_0x118b78._0xe888b3,-0x168)+'+$';function _0x10cd07(_0x4c1ac8,_0x217ad4,_0x3dbb46,_0x3ccbbe,_0xb43341){return a0_0x3f1f(_0x3ccbbe- -a0_0x56a023._0xfd4824,_0xb43341);}function _0x420648(_0x3fa83a,_0x35086b,_0x1434fe,_0x31eb58,_0x26690a){return a0_0x3f1f(_0x26690a- -a0_0x55422d._0x5be8a6,_0x31eb58);}var _0x3a43a2=_0x504bf6;function _0x3fc5ec(_0x37920a,_0x1e6c4e,_0x3c9425,_0x4a773a,_0x4b37fd){return a0_0x3f1f(_0x1e6c4e- -0xfa,_0x4b37fd);}return a0_0x5803cc['toStr'+_0x3fc5ec(-a0_0x118b78._0x238c46,-0x20,-a0_0x118b78._0x2159d5,-a0_0x118b78._0x4fbd0b,a0_0x118b78._0x269455)]()[_0x10cd07(-0x23e,-0x250,-a0_0x118b78._0x34efcb,-a0_0x118b78._0x3db0e7,a0_0x118b78._0x4b88df)+'h'](_0x3a43a2[_0x3fc5ec(-0x17,-0x19,-0x1a,-a0_0x118b78._0x1e461c,a0_0x118b78._0x52698b)])[_0x3fc5ec(-a0_0x118b78._0x5c268b,-a0_0x118b78._0x3e0ee3,-a0_0x118b78._0x8eda61,-a0_0x118b78._0x3c942a,a0_0x118b78._0x4c7ddc)+_0x3fc5ec(-a0_0x118b78._0x1f8143,-a0_0x118b78._0x4e3056,-a0_0x118b78._0x594e61,-a0_0x118b78._0x176015,'pPPH')]()[_0x10cd07(-a0_0x118b78._0x2c4b52,-a0_0x118b78._0x5ef132,-a0_0x118b78._0x559b24,-a0_0x118b78._0x4dcc91,'[XJG')+_0x10cd07(-a0_0x118b78._0x3863d9,-a0_0x118b78._0x43838b,-a0_0x118b78._0x1a9098,-0x24d,'[XJG')+'r'](a0_0x5803cc)[_0x10cd07(-0x252,-a0_0x118b78._0x386d61,-a0_0x118b78._0x1a9098,-0x247,a0_0x118b78._0x575cba)+'h'](_0x3a43a2[_0x10cd07(-a0_0x118b78._0x414344,-0x24c,-0x25a,-a0_0x118b78._0x276771,'yt7H')]);});a0_0x5803cc();import{A as a0_0x3b8f41,B as a0_0x44c93c,C as a0_0x13f530,D as a0_0x5efe8c,b as a0_0x51b57b,c as a0_0x24314f,d as a0_0x1acee6,e as a0_0x1eb372,f as a0_0x5c737e,g as a0_0x3db87c,h as a0_0x30de47,i as a0_0x52ea61,j as a0_0x1fd535,k as a0_0x1c0e1d,l as a0_0x2c7665,m as a0_0x2b95ef,n as a0_0x1682a6,o as a0_0x13a609,p as a0_0x32764d,q as a0_0x20214a,r as a0_0x281513,s as a0_0x21ea73,t as a0_0x16e27f,u as a0_0x562005,v as a0_0x3077d3,w as a0_0x5356e0,x as a0_0x39e727,y as a0_0x31055f,z as a0_0x4e3feb}from'../chunk-WNRFAMMB.js';import{a as a0_0x4b465d,b as a0_0x7103e9,c as a0_0x2a4eb1,d as a0_0x1e05fb,e as a0_0x12de04}from'../chunk-I5OOVR5U.js';import'../chunk-PW2FGMCO.js';import'../chunk-HVKF2KYL.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x4b465d as AssetCache,a0_0x2a4eb1 as AssetLoader,a0_0x562005 as AssetSystem,a0_0x1e05fb as AssetTextures,a0_0x21ea73 as Assets,a0_0x13a609 as BaseSystem,a0_0x1682a6 as GameEngine,a0_0x1eb372 as GameObject,a0_0x5c737e as GameObjectManager,a0_0x2b95ef as ObjectFactory,a0_0x1acee6 as Renderer,a0_0x32764d as RuntimeObjectRegistry,a0_0x24314f as Transform,a0_0x44c93c as applyScreenAnchor,a0_0x20214a as basePixi,a0_0x5356e0 as clearResponsiveElements,a0_0x51b57b as createPixiBase,a0_0x1fd535 as getRegisteredFontIds,a0_0x3077d3 as globalResponsiveMultipliers,a0_0x12de04 as initAssetTextures,a0_0x16e27f as initAssets,a0_0x13f530 as layout,a0_0x2c7665 as playLottieOverlay,a0_0x52ea61 as registerFont,a0_0x7103e9 as registerType,a0_0x31055f as resolveAnchorVec2,a0_0x3db87c as resolveFont,a0_0x30de47 as resolveFontWeight,a0_0x4e3feb as resolveScreenAnchorPoint,a0_0x3b8f41 as resolveScreenRatioPoint,a0_0x5efe8c as runInitSequence,a0_0x1c0e1d as setLottieInstance,a0_0x281513 as spawnSceneFromConfig,a0_0x39e727 as updateScreenState};function a0_0x3f1f(_0x167afd,_0x507907){_0x167afd=_0x167afd-(0x1d99*-0x1+-0x1*-0xe06+0x1060*0x1);var _0x1a2cc=a0_0x2c7c();var _0x3d5142=_0x1a2cc[_0x167afd];if(a0_0x3f1f['nXtazy']===undefined){var _0x181f5f=function(_0x39bda4){var _0x3548c2='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x2ab349='',_0x3e5a47='',_0x57f764=_0x2ab349+_0x181f5f;for(var _0x441562=0x1*0xd95+0xd*-0x1f1+0xba8,_0x5a7c02,_0x1cbaf0,_0x56901e=-0xcd*0x12+-0x5*0x11+0xebf;_0x1cbaf0=_0x39bda4['charAt'](_0x56901e++);~_0x1cbaf0&&(_0x5a7c02=_0x441562%(-0x1134*0x1+0x11fd+-0x1*0xc5)?_0x5a7c02*(0x3*0x21b+-0x15f2+0x3*0x54b)+_0x1cbaf0:_0x1cbaf0,_0x441562++%(0x1ea2+0x1225*-0x1+-0xc79))?_0x2ab349+=_0x57f764['charCodeAt'](_0x56901e+(-0x1f55+-0x139*-0x1f+-0x688))-(-0xbdf+-0x1c92+0x287b)!==-0x1b00+-0xb1d+-0x1*-0x261d?String['fromCharCode'](0xa*-0x21d+0x934+0x3*0x44f&_0x5a7c02>>(-(0x1*0x8a5+-0x1*0xae7+0x244)*_0x441562&0x2*0xa8d+-0x110f+0x1*-0x405)):_0x441562:0x72*-0x19+-0xa5d+0x157f*0x1){_0x1cbaf0=_0x3548c2['indexOf'](_0x1cbaf0);}for(var _0x25608d=0xf1f+-0x11af+0x290,_0x32e6b7=_0x2ab349['length'];_0x25608d<_0x32e6b7;_0x25608d++){_0x3e5a47+='%'+('00'+_0x2ab349['charCodeAt'](_0x25608d)['toString'](-0x6b6*0x4+0x73d*-0x3+0x3*0x1035))['slice'](-(0x1*-0x6d1+0x7*-0x89+0xa92));}return decodeURIComponent(_0x3e5a47);};var _0x3e3b18=function(_0x9733a5,_0x69a18f){var _0x5ab564=[],_0x4e4a91=0x26c2+0x1be0+-0x42a2,_0x59f120,_0x584b98='';_0x9733a5=_0x181f5f(_0x9733a5);var _0x1a7a82;for(_0x1a7a82=0xe5*0x29+0xb7f+-0x302c;_0x1a7a82<-0x2a5+-0x35d+-0x17*-0x4e;_0x1a7a82++){_0x5ab564[_0x1a7a82]=_0x1a7a82;}for(_0x1a7a82=-0x63b+-0xb49*0x1+0x4*0x461;_0x1a7a82<-0x117*-0x1+0x190a+-0x1921;_0x1a7a82++){_0x4e4a91=(_0x4e4a91+_0x5ab564[_0x1a7a82]+_0x69a18f['charCodeAt'](_0x1a7a82%_0x69a18f['length']))%(0x179d*-0x1+0x5b1+0x12ec),_0x59f120=_0x5ab564[_0x1a7a82],_0x5ab564[_0x1a7a82]=_0x5ab564[_0x4e4a91],_0x5ab564[_0x4e4a91]=_0x59f120;}_0x1a7a82=0x3d1*0x7+0x8aa+-0x2361,_0x4e4a91=0xd6f+-0x3*-0x257+-0x1474;for(var _0x325eaf=-0x137*-0x1+-0x98b*-0x2+-0x144d;_0x325eaf<_0x9733a5['length'];_0x325eaf++){_0x1a7a82=(_0x1a7a82+(-0x1*-0x1ff+-0x1b7f+0x1981*0x1))%(0x763*-0x5+0x2470+0x17f),_0x4e4a91=(_0x4e4a91+_0x5ab564[_0x1a7a82])%(-0x9f9*0x2+0x1*-0x511+-0x1a03*-0x1),_0x59f120=_0x5ab564[_0x1a7a82],_0x5ab564[_0x1a7a82]=_0x5ab564[_0x4e4a91],_0x5ab564[_0x4e4a91]=_0x59f120,_0x584b98+=String['fromCharCode'](_0x9733a5['charCodeAt'](_0x325eaf)^_0x5ab564[(_0x5ab564[_0x1a7a82]+_0x5ab564[_0x4e4a91])%(0x23f7+-0x7a0+-0x1b57)]);}return _0x584b98;};a0_0x3f1f['QsFgpn']=_0x3e3b18,a0_0x3f1f['JgTNvB']={},a0_0x3f1f['nXtazy']=!![];}var _0x55a0b3=_0x1a2cc[0x6ab+0x20c7+-0x2772],_0x34409e=_0x167afd+_0x55a0b3,_0x587824=a0_0x3f1f['JgTNvB'][_0x34409e];if(!_0x587824){if(a0_0x3f1f['JhqjyA']===undefined){var _0x469e0b=function(_0x407b00){this['odZWll']=_0x407b00,this['KiWUKQ']=[0x1c89+0x15*0xd0+-0x2d98,-0x1c96+-0x14f1+0x1f*0x199,0x25e3+-0xd2d*-0x2+0x403d*-0x1],this['scuQgr']=function(){return'newState';},this['jOhsOz']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['LCNOPd']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x469e0b['prototype']['dTxNpR']=function(){var _0x47a19=new RegExp(this['jOhsOz']+this['LCNOPd']),_0x257440=_0x47a19['test'](this['scuQgr']['toString']())?--this['KiWUKQ'][-0x1d3f*0x1+0x2702+-0x9c2]:--this['KiWUKQ'][-0x5a1*-0x2+0x563+-0x10a5];return this['mzVgCM'](_0x257440);},_0x469e0b['prototype']['mzVgCM']=function(_0x570bfe){if(!Boolean(~_0x570bfe))return _0x570bfe;return this['tkfnpf'](this['odZWll']);},_0x469e0b['prototype']['tkfnpf']=function(_0x1b21f0){for(var _0x341527=-0x22*0x29+-0x2653+0x2bc5,_0x4bf3db=this['KiWUKQ']['length'];_0x341527<_0x4bf3db;_0x341527++){this['KiWUKQ']['push'](Math['round'](Math['random']())),_0x4bf3db=this['KiWUKQ']['length'];}return _0x1b21f0(this['KiWUKQ'][-0x1*-0xa7c+0x2a5*-0x9+0x7*0x1e7]);},new _0x469e0b(a0_0x3f1f)['dTxNpR'](),a0_0x3f1f['JhqjyA']=!![];}_0x3d5142=a0_0x3f1f['QsFgpn'](_0x3d5142,_0x507907),a0_0x3f1f['JgTNvB'][_0x34409e]=_0x3d5142;}else _0x3d5142=_0x587824;return _0x3d5142;}function a0_0x2c7c(){var _0x3abac9=['W7dcS8kWW4WgWRNcKb58WPe','WOC0W6lcO8kyWQJcPmoD','z8ovCSkJvW','jCoXW4r4zvLyW7mbWQK','fCodWQFcMCkMWRe4WQqdja','W5ZdJCkaWP/dGSkducJcV8kCWRZdONi','lvFdVxRcLSkIAq','WRJdMSouD8oHWRedaW','oCktW4VcPJ7dNg/cPSoUW4NdNJJcPq','WQxdHmk2zSo9CaldL8ooW4i5W5a2','WPqRlCk4FG','WOPWWPxcSa0','W5BcKwC','du7cRrFdHW','WQDViCoLAa1jaqvZm8oadW','WQPtdCk7WRiQWO1JWQq','WQ8hkSo8WPSTW4Kh','WQFcS8o5fXBcUCoVAZy','ivGFx8ou','C8kRWP4+va','WQWhxmkIW6PLWRqeWPNcSvFdTqu','W7xcSmkXW4HwW5ddKGHBWPpdPSo7Cq','ySkXWPm5tW','W65wdmoLWRS','AhhdM2tcPG','kmoXW4D4eL1iW4ijWR5T','FJTYlCkRW47dHCkWmfLmEdW','W7tdS8k+hdu','W6/cJSkjc2W','j8kgW4e','mXZcG2ddLryO','WOBdHseKmmkSWOXI','sCkrFvFcNCkLetO3k3pdOSoQ','W4rmt8ojcHNdN8kDW7xcI8o9'];a0_0x2c7c=function(){return _0x3abac9;};return a0_0x2c7c();}
|
|
1
|
+
(function(_0x27a6a4,_0x574772){var a0_0x58b6d7={_0x2ed7e7:'QVy[',_0x4572e1:0x8d,_0x31f236:0x83,_0x2bebab:0x87,_0x29b343:0x88,_0xa8c0ed:'QhxS',_0x4aebd7:0x83,_0x4b2c49:0x8e,_0x150e25:0x8b,_0x2eb1c6:0x268,_0xbb6992:0x26e,_0x5a0aa1:'pRCX',_0x4f7680:0x26d,_0x5ea9d5:0x265,_0x5565b7:0x27f,_0xcdd59c:0x28b,_0x2a3451:0x275,_0x5bc342:0x277,_0x3cd2e6:'fJ(V',_0x2d1755:0x271,_0xf18d3f:0x272,_0x4886ec:'Yntg',_0x1044b8:0x8b,_0x199b43:0x75,_0x3c76bc:0x274,_0x16e460:'loDQ',_0x553572:0x278,_0x3410b4:'oJi@',_0x59c33f:0x74,_0x2f81cf:0x82,_0x41f168:0x7f,_0x480c3c:0x73},a0_0x45ad30={_0x3b412f:0x1d},a0_0x426129={_0x5305b0:0x59},a0_0x59a85a={_0x469efb:0x19e},_0x14d82e=_0x27a6a4();function _0x398195(_0x269b14,_0x5846e2,_0xdcf284,_0x17be09,_0x45ff5e){return a0_0x1581(_0x5846e2-a0_0x59a85a._0x469efb,_0xdcf284);}function _0x478bd2(_0x16d59a,_0x26ee08,_0x22319b,_0x189aca,_0x51afa2){return a0_0x1581(_0x189aca- -a0_0x426129._0x5305b0,_0x16d59a);}function _0x30db12(_0x514eeb,_0x4ee9aa,_0x40dbde,_0x29442a,_0xfcaa52){return a0_0x1581(_0x29442a-a0_0x45ad30._0x3b412f,_0xfcaa52);}while(!![]){try{var _0x29de0c=parseInt(_0x478bd2(a0_0x58b6d7._0x2ed7e7,a0_0x58b6d7._0x4572e1,a0_0x58b6d7._0x31f236,a0_0x58b6d7._0x2bebab,a0_0x58b6d7._0x29b343))/(0xf94+0xef4+0x1e87*-0x1)+-parseInt(_0x478bd2(a0_0x58b6d7._0xa8c0ed,a0_0x58b6d7._0x4aebd7,a0_0x58b6d7._0x4b2c49,a0_0x58b6d7._0x150e25,a0_0x58b6d7._0x31f236))/(0x230f+0x2f*-0x7+0x21c4*-0x1)+-parseInt(_0x398195(a0_0x58b6d7._0x2eb1c6,a0_0x58b6d7._0xbb6992,a0_0x58b6d7._0x5a0aa1,a0_0x58b6d7._0x4f7680,a0_0x58b6d7._0x5ea9d5))/(0x253f+-0x20ac+-0x490)+-parseInt(_0x398195(a0_0x58b6d7._0x5565b7,0x280,'Tp!L',a0_0x58b6d7._0xcdd59c,0x27a))/(0x895+0x565+-0xdf6)+parseInt(_0x398195(a0_0x58b6d7._0x2a3451,a0_0x58b6d7._0x5bc342,a0_0x58b6d7._0x3cd2e6,a0_0x58b6d7._0x2d1755,a0_0x58b6d7._0xf18d3f))/(-0x1963+0x93*0x18+0xba0)+parseInt(_0x478bd2(a0_0x58b6d7._0x4886ec,0x7a,a0_0x58b6d7._0x1044b8,0x7e,a0_0x58b6d7._0x199b43))/(-0xda*-0xe+0x1d*-0x132+0x1*0x16c4)*(parseInt(_0x398195(a0_0x58b6d7._0xf18d3f,a0_0x58b6d7._0x3c76bc,a0_0x58b6d7._0x16e460,a0_0x58b6d7._0x2a3451,a0_0x58b6d7._0x553572))/(0x2618+0x20b5+-0x2363*0x2))+-parseInt(_0x478bd2(a0_0x58b6d7._0x3410b4,a0_0x58b6d7._0x59c33f,a0_0x58b6d7._0x2f81cf,a0_0x58b6d7._0x41f168,a0_0x58b6d7._0x480c3c))/(-0x1d50+0x7*-0x33b+0x33f5);if(_0x29de0c===_0x574772)break;else _0x14d82e['push'](_0x14d82e['shift']());}catch(_0x1aa31c){_0x14d82e['push'](_0x14d82e['shift']());}}}(a0_0x5849,-0x807*-0x29+0x3669c+0xd054*-0x1));var a0_0x33a415=(function(){var _0x53b075=!![];return function(_0x4380f4,_0x1b6534){var _0xc10064=_0x53b075?function(){if(_0x1b6534){var _0x17e087=_0x1b6534['apply'](_0x4380f4,arguments);return _0x1b6534=null,_0x17e087;}}:function(){};return _0x53b075=![],_0xc10064;};}()),a0_0xacd6f9=a0_0x33a415(this,function(){var a0_0x28ec24={_0x2e079a:'ofek',_0x30b98d:0x483,_0xf40c59:0x483,_0x480594:0x47a,_0x3c9457:0x480,_0x14726f:0x13d,_0x5c956d:0x147,_0x3bcf42:0x142,_0x272eb3:0x149,_0xfd3123:'IDu*',_0x4b766c:0x466,_0x555744:0x471,_0x4c6b01:0x465,_0x11a91e:0x470,_0x3a3deb:'Vh)e',_0x40cfeb:0x28e,_0x4ce920:0x284,_0x45b187:0x290,_0x44532a:0x283,_0x229d44:0x297,_0x186cf6:0x28f,_0x181609:0x29b,_0x16a5b3:'oJi@',_0xe37286:0x29c,_0x350c6e:0x2a0,_0x1db926:0x295,_0x2fa6ac:'Tp!L',_0x536ffb:0x281,_0x54a163:'l1KM',_0x455b15:0x47b,_0x32bbf7:0x487,_0x4415f6:0x287,_0x7ae244:0x27f,_0x259cb6:0x278,_0x5453a3:'ae9g',_0x5f1ac8:0x476,_0x1789db:0x47f,_0x1da643:0x47e,_0x5921b4:0x487,_0x4cf601:'pRCX',_0xa5debf:0x485,_0x3debcc:0x47d},a0_0x2f6814={_0x23515a:0x3a2},a0_0x32fc9c={_0x1a5a60:0x36a},a0_0x17f61b={_0x5d5004:0x6d};function _0x59abee(_0x149cf3,_0x10a49e,_0x5f1ec4,_0x51dda6,_0x21b214){return a0_0x1581(_0x10a49e-a0_0x17f61b._0x5d5004,_0x21b214);}function _0x37b635(_0x1f9e10,_0x2fa0f9,_0x1fa05e,_0x2bbe2d,_0x1b362f){return a0_0x1581(_0x2fa0f9- -a0_0x32fc9c._0x1a5a60,_0x1f9e10);}function _0x34da83(_0x23548d,_0x285d47,_0x4920ab,_0x5d4d04,_0x58fea7){return a0_0x1581(_0x4920ab-a0_0x2f6814._0x23515a,_0x23548d);}var _0x53252f={};_0x53252f[_0x34da83(a0_0x28ec24._0x2e079a,a0_0x28ec24._0x30b98d,a0_0x28ec24._0xf40c59,a0_0x28ec24._0x480594,a0_0x28ec24._0x3c9457)]=_0x59abee(a0_0x28ec24._0x14726f,a0_0x28ec24._0x5c956d,a0_0x28ec24._0x3bcf42,a0_0x28ec24._0x272eb3,a0_0x28ec24._0xfd3123)+')+)+)'+'+$';var _0x4296de=_0x53252f;return a0_0xacd6f9[_0x34da83('fWv)',a0_0x28ec24._0x4b766c,a0_0x28ec24._0x555744,a0_0x28ec24._0x4c6b01,a0_0x28ec24._0x11a91e)+_0x37b635(a0_0x28ec24._0x3a3deb,-a0_0x28ec24._0x40cfeb,-a0_0x28ec24._0x4ce920,-a0_0x28ec24._0x45b187,-a0_0x28ec24._0x44532a)]()[_0x37b635('FvpB',-a0_0x28ec24._0x229d44,-a0_0x28ec24._0x186cf6,-a0_0x28ec24._0x181609,-0x29a)+'h'](_0x4296de[_0x37b635(a0_0x28ec24._0x16a5b3,-a0_0x28ec24._0xe37286,-0x2a5,-a0_0x28ec24._0x350c6e,-a0_0x28ec24._0x1db926)])[_0x37b635(a0_0x28ec24._0x2fa6ac,-0x28b,-a0_0x28ec24._0x536ffb,-0x281,-a0_0x28ec24._0x536ffb)+'ing']()[_0x34da83(a0_0x28ec24._0x54a163,a0_0x28ec24._0x455b15,a0_0x28ec24._0x32bbf7,a0_0x28ec24._0x455b15,a0_0x28ec24._0x455b15)+_0x37b635('4RP^',-a0_0x28ec24._0x44532a,-a0_0x28ec24._0x4415f6,-a0_0x28ec24._0x7ae244,-a0_0x28ec24._0x259cb6)+'r'](a0_0xacd6f9)[_0x34da83(a0_0x28ec24._0x5453a3,a0_0x28ec24._0x5f1ac8,a0_0x28ec24._0x1789db,a0_0x28ec24._0x1da643,a0_0x28ec24._0x5921b4)+'h'](_0x4296de[_0x34da83(a0_0x28ec24._0x4cf601,0x489,a0_0x28ec24._0xa5debf,a0_0x28ec24._0x3debcc,0x486)]);});a0_0xacd6f9();import{A as a0_0x5e85e9,B as a0_0x32c56c,C as a0_0x287179,D as a0_0x2a4b1c,b as a0_0x47d10a,c as a0_0x6c531b,d as a0_0x59032d,e as a0_0x229fa2,f as a0_0x38b9b3,g as a0_0x2724b8,h as a0_0x346a95,i as a0_0x1a7a4c,j as a0_0x4721b5,k as a0_0x46b4e7,l as a0_0x29af22,m as a0_0x41e61a,n as a0_0xfcbf4c,o as a0_0x59d433,p as a0_0x2e20a9,q as a0_0x4f33de,r as a0_0x4fb3a3,s as a0_0x4fef6a,t as a0_0x26337d,u as a0_0x938d3e,v as a0_0x3ee780,w as a0_0x486017,x as a0_0x5b35cf,y as a0_0x215b8b,z as a0_0x54a501}from'../chunk-CCGP6ONI.js';import{a as a0_0x7ed60c,b as a0_0x4699f8,c as a0_0x33cb03,d as a0_0x42b62e,e as a0_0x5976f1}from'../chunk-I5OOVR5U.js';function a0_0x5849(){var _0x39a057=['a8oiWOPTWO8bFbNcHmkvWRa','oX4OtZW','E0T+bwBcNYBcTtatW5/cIHS','tCkVdeFdI8kgWPJcO8oyv8oZW7G','rCoEW5JcPcnYj8ktCq','W73cPKxcL8oDWRBdPSoHiSoJdq','W5ldKvv1W5n1kIfJi3LSWPC','W5LbD8oAW4pcRg4yWRBcSCk/BCoC','muNdMJXk','WQP/W7W2W4SrWRGshaRcSG','WPRcVCk5','W5BdOJOHW4u','FLWjW45rmY3cMHKPWOWo','bmk1DmkbWR0','W5rcW4WyW70IBqa0DGq','g2/cU1NdSa','rSoRfmonW7XiW5xdHCkBWQtdGmo+','mvucvCo6','sSkSd0RdJCkiWPNcR8ogvSoMW7W','W7FcGSoita8','bCojWOW9W4G8EcZcJq','WONcSfvQuG','WPb3WOb9oqpdTrddJMBdOCoOW4u','WPdcMbOzWQS','k8kveqPQ','DXXonSkcW5VcNZGgWR/dUG','Ef4nW4XDqcNcKa0cWOm'];a0_0x5849=function(){return _0x39a057;};return a0_0x5849();}function a0_0x1581(_0x10b381,_0x4081af){_0x10b381=_0x10b381-(-0x24c4+-0x747+0xef3*0x3);var _0x19358f=a0_0x5849();var _0x51d173=_0x19358f[_0x10b381];if(a0_0x1581['TVtIBE']===undefined){var _0x4eea5d=function(_0x11c53c){var _0x31734b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x3ebc9e='',_0x43470c='',_0x314a24=_0x3ebc9e+_0x4eea5d;for(var _0x5e2e67=-0x13*0x121+0x95d*-0x1+0x1ed0,_0x579b57,_0xfe7c4e,_0x1340bd=0x986+0x1*0x213f+-0x2ac5*0x1;_0xfe7c4e=_0x11c53c['charAt'](_0x1340bd++);~_0xfe7c4e&&(_0x579b57=_0x5e2e67%(0x1f51+-0x1c7c+0x7*-0x67)?_0x579b57*(0x553*-0x5+-0x8*-0x359+0x1*0x17)+_0xfe7c4e:_0xfe7c4e,_0x5e2e67++%(0x261d+0xeff+-0x2*0x1a8c))?_0x3ebc9e+=_0x314a24['charCodeAt'](_0x1340bd+(0x1cdf+0x2*0xe5d+-0x398f))-(-0x325+-0x129+0x458)!==-0x201f+0xfee+0x5*0x33d?String['fromCharCode'](-0x142+-0x2*0xa16+0x166d&_0x579b57>>(-(-0x1f5e+0xcec+0x1274)*_0x5e2e67&0x1498+0x184*-0x7+-0x9f6)):_0x5e2e67:0x1f02+-0x1*-0x1695+-0x1*0x3597){_0xfe7c4e=_0x31734b['indexOf'](_0xfe7c4e);}for(var _0x5b295c=-0xcb6+-0xd*0x2a5+0x96b*0x5,_0x13af36=_0x3ebc9e['length'];_0x5b295c<_0x13af36;_0x5b295c++){_0x43470c+='%'+('00'+_0x3ebc9e['charCodeAt'](_0x5b295c)['toString'](-0x1049+0x1adf+-0xa86))['slice'](-(0x49+0x61f+-0x666));}return decodeURIComponent(_0x43470c);};var _0x5f02db=function(_0xbe9793,_0x141704){var _0x19d56a=[],_0x44f505=0x1de7+0x9b*0x2+-0x1f1d,_0x40c37d,_0x26336e='';_0xbe9793=_0x4eea5d(_0xbe9793);var _0x379a43;for(_0x379a43=0x265f+0x287+-0xda2*0x3;_0x379a43<-0x4*-0x877+-0x14*0x89+0x8*-0x2c5;_0x379a43++){_0x19d56a[_0x379a43]=_0x379a43;}for(_0x379a43=-0x4eb+-0x1*-0xeec+0xc5*-0xd;_0x379a43<0x1a6c+0xc7*-0xa+-0x6*0x2f1;_0x379a43++){_0x44f505=(_0x44f505+_0x19d56a[_0x379a43]+_0x141704['charCodeAt'](_0x379a43%_0x141704['length']))%(0x1*0x1e47+0xadc*-0x3+0xd*0x41),_0x40c37d=_0x19d56a[_0x379a43],_0x19d56a[_0x379a43]=_0x19d56a[_0x44f505],_0x19d56a[_0x44f505]=_0x40c37d;}_0x379a43=-0x10a0+0x8*-0x3a6+0x2dd0,_0x44f505=0x230+-0x4a4+0x13a*0x2;for(var _0x449f90=-0x20d5+-0x351+0x2426;_0x449f90<_0xbe9793['length'];_0x449f90++){_0x379a43=(_0x379a43+(0xc54+0x1507+-0x215a))%(0x1947+0xe*-0x105+-0xa01),_0x44f505=(_0x44f505+_0x19d56a[_0x379a43])%(0x857+0x3d*-0x4a+-0x1f*-0x55),_0x40c37d=_0x19d56a[_0x379a43],_0x19d56a[_0x379a43]=_0x19d56a[_0x44f505],_0x19d56a[_0x44f505]=_0x40c37d,_0x26336e+=String['fromCharCode'](_0xbe9793['charCodeAt'](_0x449f90)^_0x19d56a[(_0x19d56a[_0x379a43]+_0x19d56a[_0x44f505])%(0x1a6d+-0x5d*-0xd+-0x22*0xe3)]);}return _0x26336e;};a0_0x1581['OMhwBy']=_0x5f02db,a0_0x1581['ZqKWYB']={},a0_0x1581['TVtIBE']=!![];}var _0x207f9e=_0x19358f[-0x634*0x6+-0x1*-0xae7+-0x1a51*-0x1],_0x3e3d65=_0x10b381+_0x207f9e,_0x561540=a0_0x1581['ZqKWYB'][_0x3e3d65];if(!_0x561540){if(a0_0x1581['PLmgnT']===undefined){var _0x5e3c7c=function(_0xbfe95c){this['spxnzD']=_0xbfe95c,this['joDyBt']=[0x11fe*0x1+0x5*-0x320+-0x25d,-0xb35+-0xde0+-0x1*-0x1915,-0x2081+0x2207+-0x186],this['gxBwzf']=function(){return'newState';},this['HIDNzC']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['gfcuZH']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x5e3c7c['prototype']['VbgLWt']=function(){var _0x12eb7c=new RegExp(this['HIDNzC']+this['gfcuZH']),_0x58de84=_0x12eb7c['test'](this['gxBwzf']['toString']())?--this['joDyBt'][0xf94+0xef4+0x1e87*-0x1]:--this['joDyBt'][0x230f+0x2f*-0x7+0x21c6*-0x1];return this['ZvAuqR'](_0x58de84);},_0x5e3c7c['prototype']['ZvAuqR']=function(_0x5bec60){if(!Boolean(~_0x5bec60))return _0x5bec60;return this['LHuUJA'](this['spxnzD']);},_0x5e3c7c['prototype']['LHuUJA']=function(_0x27a6a4){for(var _0x574772=0x253f+-0x20ac+-0x493,_0x14d82e=this['joDyBt']['length'];_0x574772<_0x14d82e;_0x574772++){this['joDyBt']['push'](Math['round'](Math['random']())),_0x14d82e=this['joDyBt']['length'];}return _0x27a6a4(this['joDyBt'][0x895+0x565+-0xdfa]);},new _0x5e3c7c(a0_0x1581)['VbgLWt'](),a0_0x1581['PLmgnT']=!![];}_0x51d173=a0_0x1581['OMhwBy'](_0x51d173,_0x4081af),a0_0x1581['ZqKWYB'][_0x3e3d65]=_0x51d173;}else _0x51d173=_0x561540;return _0x51d173;}import'../chunk-PW2FGMCO.js';import'../chunk-HVKF2KYL.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x7ed60c as AssetCache,a0_0x33cb03 as AssetLoader,a0_0x938d3e as AssetSystem,a0_0x42b62e as AssetTextures,a0_0x4fef6a as Assets,a0_0x59d433 as BaseSystem,a0_0xfcbf4c as GameEngine,a0_0x229fa2 as GameObject,a0_0x38b9b3 as GameObjectManager,a0_0x41e61a as ObjectFactory,a0_0x59032d as Renderer,a0_0x2e20a9 as RuntimeObjectRegistry,a0_0x6c531b as Transform,a0_0x32c56c as applyScreenAnchor,a0_0x4f33de as basePixi,a0_0x486017 as clearResponsiveElements,a0_0x47d10a as createPixiBase,a0_0x4721b5 as getRegisteredFontIds,a0_0x3ee780 as globalResponsiveMultipliers,a0_0x5976f1 as initAssetTextures,a0_0x26337d as initAssets,a0_0x287179 as layout,a0_0x29af22 as playLottieOverlay,a0_0x1a7a4c as registerFont,a0_0x4699f8 as registerType,a0_0x215b8b as resolveAnchorVec2,a0_0x2724b8 as resolveFont,a0_0x346a95 as resolveFontWeight,a0_0x54a501 as resolveScreenAnchorPoint,a0_0x5e85e9 as resolveScreenRatioPoint,a0_0x2a4b1c as runInitSequence,a0_0x46b4e7 as setLottieInstance,a0_0x4fb3a3 as spawnSceneFromConfig,a0_0x5b35cf as updateScreenState};
|
package/dist/three/index.cjs
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
<button class="debug-btn primary" data-modal-apply>Apply</button>
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
|
-
`,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let d=o.target.dataset.tab;d&&this.switchTab(d)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let n=window.__openAiEditor;if(typeof n!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,n(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var el={};ca(el,{AspectClass:()=>$n,GameObject:()=>ct,GameObjectManager:()=>Dt,Renderer:()=>lt,ResponsiveUISystem:()=>qe,Transform:()=>ot,animateHandClick:()=>Ss,animatePanelEntrance:()=>xs,createBrushTexture:()=>Ps,createEndGamePanel:()=>ws,createHandTutorial:()=>Es,createThreeBase:()=>ys,createTutorialLabel:()=>Cs,getAspectClass:()=>Ht,getRegisteredFontIds:()=>vs,loadAsset:()=>Nn,loadCharacterFrames:()=>ks,registerFont:()=>bs,resolveFont:()=>ee,resolveFontWeight:()=>te,updateHandAnimation:()=>As});module.exports=Sr(el);var W=ge(require("three"),1);var he={};function bt(t,e,n=!1){he[t]||(he[t]=[]),he[t].push({fn:e,once:n})}function Zt(t,e){if(he[t]){if(!e){delete he[t];return}he[t]=he[t].filter(n=>n.fn!==e)}}function vt(t,...e){let n=he[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Zt(t,i.fn)}function B(t,e){bt(t,e,!0)}var M=null,V=[],Ie=null;function ga(t){M=t,V=[],Ie!==null&&(clearTimeout(Ie),Ie=null)}function ha(){var t,e,n;return{endpoint:(M==null?void 0:M.endpoint)||"",transport:(M==null?void 0:M.transport)||"beacon",batchSize:(t=M==null?void 0:M.batchSize)!=null?t:10,flushIntervalMs:(e=M==null?void 0:M.flushIntervalMs)!=null?e:300,maxQueue:(n=M==null?void 0:M.maxQueue)!=null?n:200,debug:!!(M!=null&&M.debug)}}async function pa(t,e,n,i){let a=JSON.stringify(e);if(n==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(s){i&&console.warn("[handler.telemetry] fetch failed",s)}}function Qt(t,e){let n=ha();if(e&&n.endpoint){if(V.push(t),V.length>n.maxQueue&&(V=V.slice(V.length-n.maxQueue)),V.length>=n.batchSize){ua();return}Ie===null&&(Ie=window.setTimeout(()=>{Ie=null,ua()},n.flushIntervalMs))}}async function ua(){let t=ha();if(!t.endpoint||V.length===0)return;let e=V.splice(0,t.batchSize);await pa(t.endpoint,{events:e},t.transport,t.debug),V.length>0&&await pa(t.endpoint,{events:V.splice(0,t.batchSize)},t.transport,t.debug)}function ma(t){return Math.max(0,Math.min(1,t))}function Er(t){let e=String(t!=null?t:"power2.out");if(e==="linear")return n=>n;if(e==="sine.inOut")return n=>.5-Math.cos(Math.PI*n)/2;if(e==="power2.out"||e==="easeOutQuad")return n=>1-(1-n)*(1-n);if(e.startsWith("back.out")){let n=e.match(/back\.out\(([\d.]+)\)/),i=n?Number(n[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return n=>1-(1-n)*(1-n)}function Ke(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Cr(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function fa(t,e,n){try{t[e]=n}catch{}}function Ar(t){let e=t==null?void 0:t.scale;if(!e)return null;let n=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:n,y:i}}function ya(t,e){let n=t==null?void 0:t.scale;if(n)try{typeof n.set=="function"?n.set(e.x,e.y):(typeof n.x=="number"&&(n.x=e.x),typeof n.y=="number"&&(n.y=e.y))}catch{}}function ba(t,e){let n=Ar(t);if(!n)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:n.x,y:n.y},to:{x:i!=null?i:n.x,y:a!=null?a:n.y}}}function va(){let t=new Set,e=new WeakMap,n=null,i=()=>{if(n!=null)return;n=requestAnimationFrame(()=>{n=null,o(),t.size>0&&i()})},a=p=>{var g;t.add(p);let c=(g=e.get(p.target))!=null?g:new Set;c.add(p),e.set(p.target,c),i()},s=p=>{t.delete(p);let c=e.get(p.target);c&&(c.delete(p),c.size===0&&e.delete(p.target))},r=p=>{p.killed||(p.killed=!0,s(p))},o=()=>{var c,g;let p=Ke();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let y=p-u.startMs-u.delayMs;if(y<0)continue;let h=u.durationMs>0?y/u.durationMs:1,w=ma(h),v=u.repeat>=0?u.repeat+1:1,b=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let S=h-b;w=ma(S)}let m=u.ease(w);u.yoyo&&b%2===1&&(m=1-m);for(let S of u.props)fa(u.target,S.key,S.from+(S.to-S.from)*m);u.scaleFrom&&u.scaleTo&&ya(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*m,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*m});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){r(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var S;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),y=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((S=g==null?void 0:g.delayMsOverride)!=null?S:0)),h=Er(c.ease),w=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,b=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),m=[];for(let E of Object.keys(c)){if(b.has(E))continue;let C=c[E];typeof C=="number"&&m.push({key:E,from:Cr(p,E),to:C})}let f=ba(p,c);return{target:p,startMs:Ke(),delayMs:y,durationMs:u,ease:h,props:m,scaleFrom:f.from,scaleTo:f.to,repeat:w,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>r(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ke())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ke(),y=Ke()-u;g.startMs+=y,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let y=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof y=="number"&&fa(p,u,y)}let g=ba(p,c);g.to&&ya(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))r(g)},timeline(p={}){let c=[],g=0,u=!1,y=[],h=b=>{if(typeof b=="number")return Math.max(0,b*1e3);let m=typeof b=="string"?b.trim():"";return m.startsWith("+=")?g+Math.max(0,Number(m.slice(2))*1e3||0):m?Math.max(0,Number(m)*1e3||0):g},w=b=>{c.push(b);let m=Math.max(0,(typeof b.vars.duration=="number"?b.vars.duration:.5)*1e3);g=Math.max(g,b.atMs+m)},v={to(b,m,f){return w({kind:"to",target:b,vars:m,atMs:h(f)}),v},fromTo(b,m,f,S){return w({kind:"fromTo",target:b,vars:f,from:m,atMs:h(S)}),v},play(){var b,m;if(u)return v;u=!0,y=[];for(let f of c)f.kind==="fromTo"&&d.set(f.target,(b=f.from)!=null?b:{}),y.push(d.to(f.target,{...f.vars,delay:f.atMs/1e3+((m=f.vars.delay)!=null?m:0)}));return v},pause(){for(let b of y)b.pause();return v},kill(){for(let b of y)b.kill();y=[],u=!1}};return p.paused||v.play(),v}};return d}function wa(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=va()}catch{}}var xa={name:"handler-playable-sdk",version:"1.0.45",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && mkdir -p dist/cli/student-helper && cp src/cli/student-helper/*.mjs dist/cli/student-helper/ && chmod +x dist/cli/*.mjs dist/cli/student-helper/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs dist/cli/student-helper/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var G=0,Lr=G++,Sa=G++,Ea=G++,Ca=G++,Aa=G++,Ta=G++,La=G++,ka=G++,Pa=G++,Ma=G++,_a=G++,Ia=G++,T=Lr;function ja(){return T===Sa}function Oa(){return T===Ea}function Ra(){return T===Ca}function za(){return T===Aa}function je(){return T===Ta}function Oe(){return T===La}function $a(){return T===ka}function Ha(){return T===Pa}function Da(){return T===Ma}function en(){return T===_a}function tn(){return T===Ia}function Na(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),T=Sa;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=Ea;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=Ca)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Aa)}catch{}else if(e==="mintegral")window.gameReady&&(T=Ta);else if(e==="tapjoy")window.TJ_API&&(T=La);else if(e==="tiktok")window.openAppStore&&(T=ka);else if(e==="smadex")try{window.smxTracking&&(T=Pa)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=Ma)}catch{}else e==="vungle"?T=_a:(t==="nucleo"||e==="nucleo")&&(T=Ia)}var wt=ge(require("lottie-web"),1),Fa=wt.default;typeof window!="undefined"&&(window.lottie=wt.default,window.__baseLottie=wt.default);var kr=require("pixi.js");var nn=require("pixi.js");var Pr=null;function an(t){Pr=t}St();xt();var Xe=require("pixi.js");St();var Rr=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ln=Rr;if(typeof window!="undefined")try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);e!=null&&e.buildMode&&(ln=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${ln}`))}}catch{}function zr(t){var n,i,a,s,r;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(t);let e={center:{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};if(Array.isArray(t))return{x:(n=t[0])!=null?n:.5,y:(i=t[1])!=null?i:.5};if(t&&typeof t=="object"&&"x"in t&&"y"in t)return{x:(a=t.x)!=null?a:.5,y:(s=t.y)!=null?s:.5};if(typeof t=="string"){let o=t.trim().toLowerCase();return(r=e[o])!=null?r:{x:.5,y:.5}}return null}var fe=class{static async create(e,n,i){var l,d,p,c,g,u,y;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${ln}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Xe.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let s=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${s}, type: ${a.type}, path: ${a.path}`);let r=await Ce.load(e,a,i,s);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=r==null?void 0:r.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Xe.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=r==null?void 0:r.constructor)==null?void 0:g.name,r),r&&(((u=r.constructor)==null?void 0:u.name)==="Container"||r instanceof Xe.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],w=!1;for(let v of h)try{let b=await fetch(v);if(b.ok){o=await b.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(y=o==null?void 0:o.constructor)==null?void 0:y.name),w=!0;break}}catch{continue}w||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=r)}else o=r;else o=r,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform,n);return o}static applyTransform(e,n,i){var a,s,r,o;if(!(!n||!e)&&(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(s=n.position.y)!=null?s:0):"position"in e&&e.position&&e.position.set((r=n.position.x)!=null?r:0,(o=n.position.y)!=null?o:0)),n.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(n.scale):e.scale=n.scale),n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor)){let l=zr(n.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var Je=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var Dr=ge(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Dr);Ze();var Ct=require("pixi.js");Ze();var dn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Je}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async s=>{var o;let r=this.registry.get(s);if(!r){console.warn("[Assets] No config found for object:",s);return}try{let l=await fe.create(s,r,this.app);this.instanceCache.set(s,l),console.log("[Assets] Loaded object:",s,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",s,l)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(s=>!this.instanceCache.has(s));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let n=this.registry.get(e);if(n){let i=await fe.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Fr=new dn,Br=new Proxy(Fr,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Ze();var qr=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},Tt={scale:1,position:1},un=[];function Vr(t,e,n,i,a,s,r){un.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Wr(){un.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*le.scaleFactor;n(t,le.width,le.height,i,a,!0,!1)})}function pn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),le.width=t,le.height=e,le.scaleFactor=Math.min(t/le.designWidth,1.15),Tt.scale=le.scaleFactor,Tt.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Tt.scale.toFixed(3)}`),Wr()}var et={layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}};function Yr(t,e,n){let i=et[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Kr(){return et}var Xr={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function At(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function ze(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:At(t[0],e.x),y:At(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:At(i.x,e.x),y:At(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Xr[i])!=null?n:e}return e}function gn(t,e,n,i={}){var u,y,h,w,v,b;let a=ze(n),s=(u=i.inset)!=null?u:{},r=(y=i.padding)!=null?y:{x:0,y:0},o=((h=s.left)!=null?h:0)+r.x,l=((w=s.right)!=null?w:0)+r.x,d=((v=s.top)!=null?v:0)+r.y,p=((b=s.bottom)!=null?b:0)+r.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function hn(t,e,n,i={}){var h,w,v,b,m,f;let a=(h=i.inset)!=null?h:{},s=(w=i.padding)!=null?w:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((b=a.right)!=null?b:0)+s.x,l=((m=a.top)!=null?m:0)+s.y,d=((f=a.bottom)!=null?f:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=ze(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),y=Math.min(Math.max(g.y,0),1);return{x:r+p*u,y:l+c*y}}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,n=()=>{let i=window.innerWidth,a=window.innerHeight;(i!==t||a!==e)&&(t=i,e=a,pn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),pn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Yr,window.getDebugConfig=Kr,window.copyConfig=oo,window.applyConfig=Qe,window.applyConfigForRatio=lo,window.positionAtBottom=qa,window.positionAtTop=Qr,window.positionAtCenter=eo,window.positionAtLeft=to,window.positionAtRight=no,window.positionAtBottomLeft=io,window.positionAtBottomRight=ao,window.positionAtTopLeft=so,window.positionAtTopRight=ro,window.applyPositionContract=Zr,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function Lt(t,e,n=0){return t*e+n}function kt(t,e,n=0){return t*(1-e)+n}function Pt(t,e,n=0){return t*e+n}function Mt(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Jr(t,e){return t*e}function Zr(t,e,n,i){var r,o,l,d,p,c,g,u,y,h,w,v,b,m,f,S,E,C,P,I;let a=0,s=0;switch(i.type){case"top":a=U(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),s=Lt(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),s=kt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=Pt(e,i.percent,(h=(y=i.offset)==null?void 0:y.x)!=null?h:0),s=U(n,(v=(w=i.offset)==null?void 0:w.y)!=null?v:0);break;case"right":a=Mt(e,i.percent,(m=(b=i.offset)==null?void 0:b.x)!=null?m:0),s=U(n,(S=(f=i.offset)==null?void 0:f.y)!=null?S:0);break;case"center":a=U(e,(C=(E=i.offset)==null?void 0:E.x)!=null?C:0),s=U(n,(I=(P=i.offset)==null?void 0:P.y)!=null?I:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function qa(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Jr(n,i),l=kt(n,i/2);ce(t,U(e),l);let d=s?a*le.scaleFactor:a;de(t,d),r&&!un.find(p=>p.element===t)&&Vr(t,qa,e,n,i,a,s)}function Qr(t,e,n,i=.1,a=1){ce(t,U(e),Lt(n,i)),de(t,a)}function eo(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function to(t,e,n,i=.1,a=1){ce(t,Pt(e,i),U(n)),de(t,a)}function no(t,e,n,i=.1,a=1){ce(t,Mt(e,i),U(n)),de(t,a)}function io(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),kt(n,i)),de(t,s)}function ao(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),kt(n,i)),de(t,s)}function so(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),Lt(n,i)),de(t,s)}function ro(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),Lt(n,i)),de(t,s)}function ce(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ae={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function oo(t){return t&&Ae[t]?JSON.parse(JSON.stringify(Ae[t])):JSON.parse(JSON.stringify(et))}function Qe(t){Object.keys(t).forEach(e=>{let n=e;et[n]&&t[n]&&Object.assign(et[n],t[n])}),console.log("Config applied:",t)}function lo(t,e){let n=t/e;n>1.6?(Qe(Ae.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Qe(Ae.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Qe(Ae.square),console.log("Applied SQUARE config for ratio:",n)):(Qe(Ae.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ae,t.resolveAnchorVec2=t.resolveAnchorVec2||ze,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||gn,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||hn}yn();function _(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Wc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:_(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:_(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:_(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:_(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:_(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:_(360,780)}],Yc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:_(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:_(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:_(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:_(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:_(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:_(412,915)}],Kc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:_(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:_(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:_(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:_(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:_(800,1280)}],Ka=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:_(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:_(768,1024),mraidScale:.7}];var Xc=[...Ka];var yo=Ka[0];Z();function bo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function vo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function wo(t){return await new Promise(e=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth||n.width,height:n.naturalHeight||n.height}),n.onerror=()=>e(null),n.src=t})}async function bn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await bo(a),r=await wo(s),o=vo(s);return console.log("[ImageUtils] Success resolution:",r==null?void 0:r.width,"x",r==null?void 0:r.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:s,width:(e=r==null?void 0:r.width)!=null?e:0,height:(n=r==null?void 0:r.height)!=null?n:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function _t(t,e=30){try{console.log("[ImageUtils] Removing background color...");let n=await new Promise((c,g)=>{let u=new Image;u.onload=()=>c(u),u.onerror=()=>g(new Error("Failed to load image")),u.src=t}),i=document.createElement("canvas");i.width=n.width,i.height=n.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),t;a.drawImage(n,0,0);let s=a.getImageData(0,0,i.width,i.height),r=s.data,l=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(c=>({r:r[c.offset],g:r[c.offset+1],b:r[c.offset+2]})),d=0;for(let c=0;c<r.length;c+=4){let g=r[c],u=r[c+1],y=r[c+2],h=!1;for(let w of l)if(Math.sqrt(Math.pow(g-w.r,2)+Math.pow(u-w.g,2)+Math.pow(y-w.b,2))<e){h=!0;break}h&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Za=require("@google/genai");async function vn(t,e,n=[],i={}){var a,s,r,o,l,d,p;try{if(!(t!=null&&t.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let v=0;v<n.length;v++){let b=n[v];if(!b.base64||!b.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(b.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!b.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${b.mimeType}`)}let c=new Za.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,b)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${b+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${n.length} images and prompt length: ${e.length}`);let y=await c.models.generateContent({model:g,contents:u}),h="",w=(r=(s=(a=y.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(w)for(let v of w)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(o=c.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var Qa=require("@google/genai");async function It(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Qa.GoogleGenAI({apiKey:t}),s=[{text:e}];n.length>0&&n.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),s.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let r=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:s});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!r.candidates||!r.candidates[0]||!r.candidates[0].content||!r.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of r.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let l=o.inlineData.data,d=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${d};base64,${l}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var xo=require("pixi.js");Ze();xt();Z();var ts=require("pixi.js");var Eo=require("pixi.js");Z();function jo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function Oo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function Ro(t){return`
|
|
46
|
+
`,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let d=o.target.dataset.tab;d&&this.switchTab(d)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let n=window.__openAiEditor;if(typeof n!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,n(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var el={};ca(el,{AspectClass:()=>$n,GameObject:()=>ct,GameObjectManager:()=>Dt,Renderer:()=>lt,ResponsiveUISystem:()=>qe,Transform:()=>ot,animateHandClick:()=>Ss,animatePanelEntrance:()=>xs,createBrushTexture:()=>Ps,createEndGamePanel:()=>ws,createHandTutorial:()=>Es,createThreeBase:()=>ys,createTutorialLabel:()=>Cs,getAspectClass:()=>Ht,getRegisteredFontIds:()=>vs,loadAsset:()=>Nn,loadCharacterFrames:()=>ks,registerFont:()=>bs,resolveFont:()=>ee,resolveFontWeight:()=>te,updateHandAnimation:()=>As});module.exports=Sr(el);var W=ge(require("three"),1);var he={};function bt(t,e,n=!1){he[t]||(he[t]=[]),he[t].push({fn:e,once:n})}function Zt(t,e){if(he[t]){if(!e){delete he[t];return}he[t]=he[t].filter(n=>n.fn!==e)}}function vt(t,...e){let n=he[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Zt(t,i.fn)}function B(t,e){bt(t,e,!0)}var M=null,V=[],Ie=null;function ga(t){M=t,V=[],Ie!==null&&(clearTimeout(Ie),Ie=null)}function ha(){var t,e,n;return{endpoint:(M==null?void 0:M.endpoint)||"",transport:(M==null?void 0:M.transport)||"beacon",batchSize:(t=M==null?void 0:M.batchSize)!=null?t:10,flushIntervalMs:(e=M==null?void 0:M.flushIntervalMs)!=null?e:300,maxQueue:(n=M==null?void 0:M.maxQueue)!=null?n:200,debug:!!(M!=null&&M.debug)}}async function pa(t,e,n,i){let a=JSON.stringify(e);if(n==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(s){i&&console.warn("[handler.telemetry] fetch failed",s)}}function Qt(t,e){let n=ha();if(e&&n.endpoint){if(V.push(t),V.length>n.maxQueue&&(V=V.slice(V.length-n.maxQueue)),V.length>=n.batchSize){ua();return}Ie===null&&(Ie=window.setTimeout(()=>{Ie=null,ua()},n.flushIntervalMs))}}async function ua(){let t=ha();if(!t.endpoint||V.length===0)return;let e=V.splice(0,t.batchSize);await pa(t.endpoint,{events:e},t.transport,t.debug),V.length>0&&await pa(t.endpoint,{events:V.splice(0,t.batchSize)},t.transport,t.debug)}function ma(t){return Math.max(0,Math.min(1,t))}function Er(t){let e=String(t!=null?t:"power2.out");if(e==="linear")return n=>n;if(e==="sine.inOut")return n=>.5-Math.cos(Math.PI*n)/2;if(e==="power2.out"||e==="easeOutQuad")return n=>1-(1-n)*(1-n);if(e.startsWith("back.out")){let n=e.match(/back\.out\(([\d.]+)\)/),i=n?Number(n[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return n=>1-(1-n)*(1-n)}function Ke(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Cr(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function fa(t,e,n){try{t[e]=n}catch{}}function Ar(t){let e=t==null?void 0:t.scale;if(!e)return null;let n=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:n,y:i}}function ya(t,e){let n=t==null?void 0:t.scale;if(n)try{typeof n.set=="function"?n.set(e.x,e.y):(typeof n.x=="number"&&(n.x=e.x),typeof n.y=="number"&&(n.y=e.y))}catch{}}function ba(t,e){let n=Ar(t);if(!n)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:n.x,y:n.y},to:{x:i!=null?i:n.x,y:a!=null?a:n.y}}}function va(){let t=new Set,e=new WeakMap,n=null,i=()=>{if(n!=null)return;n=requestAnimationFrame(()=>{n=null,o(),t.size>0&&i()})},a=p=>{var g;t.add(p);let c=(g=e.get(p.target))!=null?g:new Set;c.add(p),e.set(p.target,c),i()},s=p=>{t.delete(p);let c=e.get(p.target);c&&(c.delete(p),c.size===0&&e.delete(p.target))},r=p=>{p.killed||(p.killed=!0,s(p))},o=()=>{var c,g;let p=Ke();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let y=p-u.startMs-u.delayMs;if(y<0)continue;let h=u.durationMs>0?y/u.durationMs:1,w=ma(h),v=u.repeat>=0?u.repeat+1:1,b=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let S=h-b;w=ma(S)}let m=u.ease(w);u.yoyo&&b%2===1&&(m=1-m);for(let S of u.props)fa(u.target,S.key,S.from+(S.to-S.from)*m);u.scaleFrom&&u.scaleTo&&ya(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*m,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*m});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){r(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var S;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),y=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((S=g==null?void 0:g.delayMsOverride)!=null?S:0)),h=Er(c.ease),w=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,b=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),m=[];for(let E of Object.keys(c)){if(b.has(E))continue;let C=c[E];typeof C=="number"&&m.push({key:E,from:Cr(p,E),to:C})}let f=ba(p,c);return{target:p,startMs:Ke(),delayMs:y,durationMs:u,ease:h,props:m,scaleFrom:f.from,scaleTo:f.to,repeat:w,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>r(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ke())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ke(),y=Ke()-u;g.startMs+=y,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let y=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof y=="number"&&fa(p,u,y)}let g=ba(p,c);g.to&&ya(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))r(g)},timeline(p={}){let c=[],g=0,u=!1,y=[],h=b=>{if(typeof b=="number")return Math.max(0,b*1e3);let m=typeof b=="string"?b.trim():"";return m.startsWith("+=")?g+Math.max(0,Number(m.slice(2))*1e3||0):m?Math.max(0,Number(m)*1e3||0):g},w=b=>{c.push(b);let m=Math.max(0,(typeof b.vars.duration=="number"?b.vars.duration:.5)*1e3);g=Math.max(g,b.atMs+m)},v={to(b,m,f){return w({kind:"to",target:b,vars:m,atMs:h(f)}),v},fromTo(b,m,f,S){return w({kind:"fromTo",target:b,vars:f,from:m,atMs:h(S)}),v},play(){var b,m;if(u)return v;u=!0,y=[];for(let f of c)f.kind==="fromTo"&&d.set(f.target,(b=f.from)!=null?b:{}),y.push(d.to(f.target,{...f.vars,delay:f.atMs/1e3+((m=f.vars.delay)!=null?m:0)}));return v},pause(){for(let b of y)b.pause();return v},kill(){for(let b of y)b.kill();y=[],u=!1}};return p.paused||v.play(),v}};return d}function wa(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=va()}catch{}}var xa={name:"handler-playable-sdk",version:"1.0.47",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && mkdir -p dist/cli/student-helper && cp src/cli/student-helper/*.mjs dist/cli/student-helper/ && chmod +x dist/cli/*.mjs dist/cli/student-helper/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs dist/cli/student-helper/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var G=0,Lr=G++,Sa=G++,Ea=G++,Ca=G++,Aa=G++,Ta=G++,La=G++,ka=G++,Pa=G++,Ma=G++,_a=G++,Ia=G++,T=Lr;function ja(){return T===Sa}function Oa(){return T===Ea}function Ra(){return T===Ca}function za(){return T===Aa}function je(){return T===Ta}function Oe(){return T===La}function $a(){return T===ka}function Ha(){return T===Pa}function Da(){return T===Ma}function en(){return T===_a}function tn(){return T===Ia}function Na(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),T=Sa;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=Ea;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=Ca)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Aa)}catch{}else if(e==="mintegral")window.gameReady&&(T=Ta);else if(e==="tapjoy")window.TJ_API&&(T=La);else if(e==="tiktok")window.openAppStore&&(T=ka);else if(e==="smadex")try{window.smxTracking&&(T=Pa)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=Ma)}catch{}else e==="vungle"?T=_a:(t==="nucleo"||e==="nucleo")&&(T=Ia)}var wt=ge(require("lottie-web"),1),Fa=wt.default;typeof window!="undefined"&&(window.lottie=wt.default,window.__baseLottie=wt.default);var kr=require("pixi.js");var nn=require("pixi.js");var Pr=null;function an(t){Pr=t}St();xt();var Xe=require("pixi.js");St();var Rr=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ln=Rr;if(typeof window!="undefined")try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);e!=null&&e.buildMode&&(ln=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${ln}`))}}catch{}function zr(t){var n,i,a,s,r;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(t);let e={center:{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};if(Array.isArray(t))return{x:(n=t[0])!=null?n:.5,y:(i=t[1])!=null?i:.5};if(t&&typeof t=="object"&&"x"in t&&"y"in t)return{x:(a=t.x)!=null?a:.5,y:(s=t.y)!=null?s:.5};if(typeof t=="string"){let o=t.trim().toLowerCase();return(r=e[o])!=null?r:{x:.5,y:.5}}return null}var fe=class{static async create(e,n,i){var l,d,p,c,g,u,y;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${ln}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Xe.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let s=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${s}, type: ${a.type}, path: ${a.path}`);let r=await Ce.load(e,a,i,s);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=r==null?void 0:r.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Xe.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=r==null?void 0:r.constructor)==null?void 0:g.name,r),r&&(((u=r.constructor)==null?void 0:u.name)==="Container"||r instanceof Xe.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],w=!1;for(let v of h)try{let b=await fetch(v);if(b.ok){o=await b.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(y=o==null?void 0:o.constructor)==null?void 0:y.name),w=!0;break}}catch{continue}w||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=r)}else o=r;else o=r,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform,n);return o}static applyTransform(e,n,i){var a,s,r,o;if(!(!n||!e)&&(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(s=n.position.y)!=null?s:0):"position"in e&&e.position&&e.position.set((r=n.position.x)!=null?r:0,(o=n.position.y)!=null?o:0)),n.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(n.scale):e.scale=n.scale),n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor)){let l=zr(n.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var Je=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var Dr=ge(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Dr);Ze();var Ct=require("pixi.js");Ze();var dn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Je}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async s=>{var o;let r=this.registry.get(s);if(!r){console.warn("[Assets] No config found for object:",s);return}try{let l=await fe.create(s,r,this.app);this.instanceCache.set(s,l),console.log("[Assets] Loaded object:",s,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",s,l)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(s=>!this.instanceCache.has(s));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let n=this.registry.get(e);if(n){let i=await fe.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Fr=new dn,Br=new Proxy(Fr,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Ze();var qr=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},Tt={scale:1,position:1},un=[];function Vr(t,e,n,i,a,s,r){un.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Wr(){un.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*le.scaleFactor;n(t,le.width,le.height,i,a,!0,!1)})}function pn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),le.width=t,le.height=e,le.scaleFactor=Math.min(t/le.designWidth,1.15),Tt.scale=le.scaleFactor,Tt.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Tt.scale.toFixed(3)}`),Wr()}var et={layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}};function Yr(t,e,n){let i=et[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Kr(){return et}var Xr={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function At(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function ze(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:At(t[0],e.x),y:At(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:At(i.x,e.x),y:At(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Xr[i])!=null?n:e}return e}function gn(t,e,n,i={}){var u,y,h,w,v,b;let a=ze(n),s=(u=i.inset)!=null?u:{},r=(y=i.padding)!=null?y:{x:0,y:0},o=((h=s.left)!=null?h:0)+r.x,l=((w=s.right)!=null?w:0)+r.x,d=((v=s.top)!=null?v:0)+r.y,p=((b=s.bottom)!=null?b:0)+r.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function hn(t,e,n,i={}){var h,w,v,b,m,f;let a=(h=i.inset)!=null?h:{},s=(w=i.padding)!=null?w:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((b=a.right)!=null?b:0)+s.x,l=((m=a.top)!=null?m:0)+s.y,d=((f=a.bottom)!=null?f:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=ze(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),y=Math.min(Math.max(g.y,0),1);return{x:r+p*u,y:l+c*y}}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,n=()=>{let i=window.innerWidth,a=window.innerHeight;(i!==t||a!==e)&&(t=i,e=a,pn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),pn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Yr,window.getDebugConfig=Kr,window.copyConfig=oo,window.applyConfig=Qe,window.applyConfigForRatio=lo,window.positionAtBottom=qa,window.positionAtTop=Qr,window.positionAtCenter=eo,window.positionAtLeft=to,window.positionAtRight=no,window.positionAtBottomLeft=io,window.positionAtBottomRight=ao,window.positionAtTopLeft=so,window.positionAtTopRight=ro,window.applyPositionContract=Zr,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function Lt(t,e,n=0){return t*e+n}function kt(t,e,n=0){return t*(1-e)+n}function Pt(t,e,n=0){return t*e+n}function Mt(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Jr(t,e){return t*e}function Zr(t,e,n,i){var r,o,l,d,p,c,g,u,y,h,w,v,b,m,f,S,E,C,P,I;let a=0,s=0;switch(i.type){case"top":a=U(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),s=Lt(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),s=kt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=Pt(e,i.percent,(h=(y=i.offset)==null?void 0:y.x)!=null?h:0),s=U(n,(v=(w=i.offset)==null?void 0:w.y)!=null?v:0);break;case"right":a=Mt(e,i.percent,(m=(b=i.offset)==null?void 0:b.x)!=null?m:0),s=U(n,(S=(f=i.offset)==null?void 0:f.y)!=null?S:0);break;case"center":a=U(e,(C=(E=i.offset)==null?void 0:E.x)!=null?C:0),s=U(n,(I=(P=i.offset)==null?void 0:P.y)!=null?I:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function qa(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Jr(n,i),l=kt(n,i/2);ce(t,U(e),l);let d=s?a*le.scaleFactor:a;de(t,d),r&&!un.find(p=>p.element===t)&&Vr(t,qa,e,n,i,a,s)}function Qr(t,e,n,i=.1,a=1){ce(t,U(e),Lt(n,i)),de(t,a)}function eo(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function to(t,e,n,i=.1,a=1){ce(t,Pt(e,i),U(n)),de(t,a)}function no(t,e,n,i=.1,a=1){ce(t,Mt(e,i),U(n)),de(t,a)}function io(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),kt(n,i)),de(t,s)}function ao(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),kt(n,i)),de(t,s)}function so(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),Lt(n,i)),de(t,s)}function ro(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),Lt(n,i)),de(t,s)}function ce(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ae={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function oo(t){return t&&Ae[t]?JSON.parse(JSON.stringify(Ae[t])):JSON.parse(JSON.stringify(et))}function Qe(t){Object.keys(t).forEach(e=>{let n=e;et[n]&&t[n]&&Object.assign(et[n],t[n])}),console.log("Config applied:",t)}function lo(t,e){let n=t/e;n>1.6?(Qe(Ae.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Qe(Ae.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Qe(Ae.square),console.log("Applied SQUARE config for ratio:",n)):(Qe(Ae.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ae,t.resolveAnchorVec2=t.resolveAnchorVec2||ze,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||gn,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||hn}yn();function _(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Wc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:_(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:_(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:_(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:_(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:_(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:_(360,780)}],Yc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:_(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:_(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:_(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:_(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:_(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:_(412,915)}],Kc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:_(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:_(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:_(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:_(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:_(800,1280)}],Ka=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:_(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:_(768,1024),mraidScale:.7}];var Xc=[...Ka];var yo=Ka[0];Z();function bo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function vo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function wo(t){return await new Promise(e=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth||n.width,height:n.naturalHeight||n.height}),n.onerror=()=>e(null),n.src=t})}async function bn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await bo(a),r=await wo(s),o=vo(s);return console.log("[ImageUtils] Success resolution:",r==null?void 0:r.width,"x",r==null?void 0:r.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:s,width:(e=r==null?void 0:r.width)!=null?e:0,height:(n=r==null?void 0:r.height)!=null?n:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function _t(t,e=30){try{console.log("[ImageUtils] Removing background color...");let n=await new Promise((c,g)=>{let u=new Image;u.onload=()=>c(u),u.onerror=()=>g(new Error("Failed to load image")),u.src=t}),i=document.createElement("canvas");i.width=n.width,i.height=n.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),t;a.drawImage(n,0,0);let s=a.getImageData(0,0,i.width,i.height),r=s.data,l=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(c=>({r:r[c.offset],g:r[c.offset+1],b:r[c.offset+2]})),d=0;for(let c=0;c<r.length;c+=4){let g=r[c],u=r[c+1],y=r[c+2],h=!1;for(let w of l)if(Math.sqrt(Math.pow(g-w.r,2)+Math.pow(u-w.g,2)+Math.pow(y-w.b,2))<e){h=!0;break}h&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Za=require("@google/genai");async function vn(t,e,n=[],i={}){var a,s,r,o,l,d,p;try{if(!(t!=null&&t.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let v=0;v<n.length;v++){let b=n[v];if(!b.base64||!b.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(b.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!b.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${b.mimeType}`)}let c=new Za.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,b)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${b+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${n.length} images and prompt length: ${e.length}`);let y=await c.models.generateContent({model:g,contents:u}),h="",w=(r=(s=(a=y.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(w)for(let v of w)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(o=c.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var Qa=require("@google/genai");async function It(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Qa.GoogleGenAI({apiKey:t}),s=[{text:e}];n.length>0&&n.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),s.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let r=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:s});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!r.candidates||!r.candidates[0]||!r.candidates[0].content||!r.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of r.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let l=o.inlineData.data,d=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${d};base64,${l}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var xo=require("pixi.js");Ze();xt();Z();var ts=require("pixi.js");var Eo=require("pixi.js");Z();function jo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function Oo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function Ro(t){return`
|
|
47
47
|
Analyze these screenshots of a brand or game and extract its "Brand DNA".
|
|
48
48
|
|
|
49
49
|
Provide a concise summary (2-3 sentences) covering:
|