handler-playable-sdk 1.0.25 → 1.0.26
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-QX623OWV.js → chunk-ZXJG6WEB.js} +170 -170
- 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 +76 -76
- package/dist/index.css +31 -0
- package/dist/index.js +1 -1
- package/dist/pixi/index.cjs +9 -9
- package/dist/pixi/index.css +31 -0
- package/dist/pixi/index.js +1 -1
- package/dist/three/index.cjs +2 -2
- package/dist/three/index.css +31 -0
- package/dist/three/index.js +1 -1
- package/package.json +1 -1
package/dist/pixi/index.css
CHANGED
|
@@ -2160,6 +2160,20 @@
|
|
|
2160
2160
|
background: var(--ui-surface-2);
|
|
2161
2161
|
}
|
|
2162
2162
|
|
|
2163
|
+
.ai-modal-body {
|
|
2164
|
+
padding: 18px 20px;
|
|
2165
|
+
background: var(--ui-surface);
|
|
2166
|
+
color: var(--ui-text);
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
.ai-section {
|
|
2170
|
+
margin-bottom: 16px;
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
.ai-section:last-child {
|
|
2174
|
+
margin-bottom: 0;
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2163
2177
|
.ai-modal-actions {
|
|
2164
2178
|
display: inline-flex;
|
|
2165
2179
|
align-items: center;
|
|
@@ -2408,6 +2422,17 @@
|
|
|
2408
2422
|
cursor: not-allowed;
|
|
2409
2423
|
}
|
|
2410
2424
|
|
|
2425
|
+
.ai-btn.primary {
|
|
2426
|
+
background: var(--ui-terracotta);
|
|
2427
|
+
color: var(--ui-text-white);
|
|
2428
|
+
border-color: var(--ui-terracotta);
|
|
2429
|
+
}
|
|
2430
|
+
|
|
2431
|
+
.ai-btn.primary:hover:not(:disabled) {
|
|
2432
|
+
background: var(--ui-terracotta-hover);
|
|
2433
|
+
border-color: var(--ui-terracotta-hover);
|
|
2434
|
+
}
|
|
2435
|
+
|
|
2411
2436
|
.ai-file {
|
|
2412
2437
|
display: none;
|
|
2413
2438
|
}
|
|
@@ -2447,6 +2472,12 @@
|
|
|
2447
2472
|
min-height: 140px;
|
|
2448
2473
|
}
|
|
2449
2474
|
|
|
2475
|
+
.ai-preview-placeholder {
|
|
2476
|
+
font-size: 12px;
|
|
2477
|
+
color: var(--ui-muted);
|
|
2478
|
+
text-align: center;
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2450
2481
|
.ai-preview img {
|
|
2451
2482
|
max-width: 100%;
|
|
2452
2483
|
max-height: 220px;
|
package/dist/pixi/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x55c69c,_0x180889){var a0_0x5e8906={_0x5b9371:0x137,_0x250041:0x12f,_0x140fab:0x13d,_0x34668b:0x4ff,_0x2c3385:0x4f7,_0x80c12d:0x509,_0x4231db:0x506,_0x4c6421:0x504,_0x316c2c:0x4ed,_0x45afea:'PeP@',_0x15f35d:0x3fb,_0x21b071:0x3e7,_0x3c379c:0x3fe,_0x190693:0x3f4,_0x52d554:0x3f1,_0x56daf4:'E]tA',_0x43f98a:0x3e6,_0x90bb05:0x136,_0x38fa42:0x13b,_0x2a27cb:'F@D[',_0x51f414:0x134,_0x48d858:0x132,_0x2dc282:0x13e,_0x44fc99:'E$Tm',_0x2dafef:0x507,_0x3f1c41:0x512,_0x1184dc:0x505,_0xc7393:0x4fd,_0x38ba1f:'J8%G',_0x4a224e:0x503,_0x1edffd:0x4f6,_0x388d4c:0x501,_0x5921cd:'8fF%'},a0_0x452175={_0x3d2e30:0x246},a0_0x44ec1d={_0x34dfde:0x2e6},a0_0x3be924={_0x425af3:0x360};function _0xc48c72(_0x88ec9e,_0x3e036e,_0x4271f8,_0x288b42,_0x5b0247){return a0_0x3476(_0x88ec9e-a0_0x3be924._0x425af3,_0x5b0247);}function _0xd22168(_0x56ca9c,_0x14054a,_0x2cd400,_0x22bb02,_0x1d9222){return a0_0x3476(_0x2cd400- -a0_0x44ec1d._0x34dfde,_0x22bb02);}var _0x596ec5=_0x55c69c();function _0x5eeb1d(_0x563851,_0x18eeaf,_0x34105e,_0xd79cc5,_0x2fe396){return a0_0x3476(_0x2fe396-a0_0x452175._0x3d2e30,_0xd79cc5);}while(!![]){try{var _0x142782=parseInt(_0xd22168(-a0_0x5e8906._0x5b9371,-a0_0x5e8906._0x250041,-a0_0x5e8906._0x140fab,'gCKD',-0x12f))/(0x1*-0x6b6+0x509*-0x5+0x1fe4)+-parseInt(_0xc48c72(a0_0x5e8906._0x34668b,a0_0x5e8906._0x2c3385,a0_0x5e8906._0x80c12d,a0_0x5e8906._0x80c12d,'t7Mr'))/(0x249b*-0x1+-0x13*-0x10e+0x1093)+-parseInt(_0xc48c72(0x4fa,a0_0x5e8906._0x4231db,a0_0x5e8906._0x4c6421,a0_0x5e8906._0x316c2c,a0_0x5e8906._0x45afea))/(0x450+-0x14b2+0x1*0x1065)+-parseInt(_0x5eeb1d(a0_0x5e8906._0x15f35d,a0_0x5e8906._0x21b071,a0_0x5e8906._0x3c379c,'J8%G',a0_0x5e8906._0x190693))/(0x4ef+0x183a+0x3*-0x9b7)*(parseInt(_0x5eeb1d(0x3e3,a0_0x5e8906._0x52d554,0x3da,a0_0x5e8906._0x56daf4,a0_0x5e8906._0x43f98a))/(0x15*-0x112+0xb*0x57+0x12c2))+parseInt(_0xd22168(-a0_0x5e8906._0x90bb05,-a0_0x5e8906._0x38fa42,-a0_0x5e8906._0x38fa42,a0_0x5e8906._0x2a27cb,-a0_0x5e8906._0x51f414))/(-0x1*0x351+0x8e9*-0x3+0x1e12)+parseInt(_0xd22168(-0x141,-a0_0x5e8906._0x48d858,-a0_0x5e8906._0x2dc282,a0_0x5e8906._0x44fc99,-a0_0x5e8906._0x48d858))/(0x482*-0x6+-0x890*-0x4+-0x72d)*(parseInt(_0xc48c72(a0_0x5e8906._0x2dafef,a0_0x5e8906._0x3f1c41,a0_0x5e8906._0x1184dc,a0_0x5e8906._0xc7393,a0_0x5e8906._0x38ba1f))/(-0x272+0x1*-0x21ff+-0x1*-0x2479))+-parseInt(_0xc48c72(a0_0x5e8906._0x4a224e,a0_0x5e8906._0x1edffd,a0_0x5e8906._0x388d4c,0x509,a0_0x5e8906._0x5921cd))/(-0x148d+0x8f*-0x37+-0x1*-0x334f);if(_0x142782===_0x180889)break;else _0x596ec5['push'](_0x596ec5['shift']());}catch(_0x168cb2){_0x596ec5['push'](_0x596ec5['shift']());}}}(a0_0x421e,-0x21148+0x1*-0x6c88f+0x151842));var a0_0x5ac958=(function(){var a0_0x4ddf79={_0x435b71:0x39f,_0x521953:0x393,_0x297dee:0x3a0,_0x267c4b:0x398},_0x42bc4b=!![];return function(_0x97c9e1,_0x308aa3){var a0_0x2e2875={_0x168927:0x207},_0x1d5604=_0x42bc4b?function(){function _0x23b561(_0x369823,_0xe01552,_0x2ad2de,_0xbb6fd9,_0x2e379e){return a0_0x3476(_0xbb6fd9-a0_0x2e2875._0x168927,_0x369823);}if(_0x308aa3){var _0x4ca2b8=_0x308aa3[_0x23b561('[nB4',a0_0x4ddf79._0x435b71,a0_0x4ddf79._0x521953,a0_0x4ddf79._0x297dee,a0_0x4ddf79._0x267c4b)](_0x97c9e1,arguments);return _0x308aa3=null,_0x4ca2b8;}}:function(){};return _0x42bc4b=![],_0x1d5604;};}()),a0_0xeac3cd=a0_0x5ac958(this,function(){var a0_0x21e93b={_0x5c26bd:0xe9,_0x5c0d7f:0xe3,_0x3e44d6:0xf1,_0x439dda:0xed,_0x3d4853:0x4b1,_0x45904e:0x498,_0x43e2f0:'Nd&z',_0x3c63ca:0x4b4,_0x5397c5:0x4bb,_0x5539e0:'8fF%',_0xa48b:0x4b2,_0x4f54c2:0x4bf,_0x4f12ad:'oMhK',_0x4ca5a5:0x4b7,_0x28ee0d:0x154,_0x1922ff:0x155,_0x1d107d:0x4ad,_0x15ae51:0x4b5,_0x265b48:0x4ac,_0x5ddc60:0x4b1,_0x36e156:0x16d,_0x578761:0x16f,_0x335d01:0x161,_0x46c866:'f5od',_0x16c81b:0x4a9,_0x19014c:0x49c,_0x8db598:0x4a0,_0x2e4ab9:0xe5,_0x5cf2e4:0xe1,_0xe056ef:0xe7,_0x52e65c:0xd7,_0x19182a:'n17R',_0x2f7e93:0xd0,_0x5b805a:0xd2,_0x198316:0xd5,_0x28b7a0:'&4JP',_0x5ab652:0xcd},a0_0x381fdc={_0x15e366:0xca},a0_0x45e157={_0x38345f:0x306};function _0x374075(_0x5063b8,_0x38f96d,_0x1d39b7,_0x3a3d27,_0x167c63){return a0_0x3476(_0x3a3d27- -a0_0x45e157._0x38345f,_0x167c63);}function _0x94dff9(_0x18626d,_0x426b1f,_0x2ac82a,_0x3fe571,_0x203672){return a0_0x3476(_0x18626d- -a0_0x381fdc._0x15e366,_0x2ac82a);}var _0x4ca5d6={};function _0x5a4e2e(_0x2fe169,_0x546cdc,_0x5593e1,_0x538ff3,_0x5667e7){return a0_0x3476(_0x5667e7-0x305,_0x5593e1);}_0x4ca5d6[_0x94dff9(a0_0x21e93b._0x5c26bd,a0_0x21e93b._0x5c0d7f,'Nd&z',a0_0x21e93b._0x3e44d6,a0_0x21e93b._0x439dda)]=_0x5a4e2e(a0_0x21e93b._0x3d4853,a0_0x21e93b._0x45904e,a0_0x21e93b._0x43e2f0,a0_0x21e93b._0x3c63ca,0x4a6)+')+)+)'+'+$';var _0x196fb6=_0x4ca5d6;return a0_0xeac3cd[_0x5a4e2e(0x4ba,a0_0x21e93b._0x5397c5,a0_0x21e93b._0x5539e0,0x4b3,a0_0x21e93b._0xa48b)+_0x5a4e2e(0x4b9,a0_0x21e93b._0x4f54c2,a0_0x21e93b._0x4f12ad,0x4aa,a0_0x21e93b._0x4ca5a5)]()[_0x374075(-0x14f,-0x15f,-a0_0x21e93b._0x28ee0d,-a0_0x21e93b._0x1922ff,'p2ul')+'h'](_0x196fb6['YLxwY'])[_0x5a4e2e(a0_0x21e93b._0x1d107d,a0_0x21e93b._0x15ae51,'uK!x',a0_0x21e93b._0x265b48,a0_0x21e93b._0x5ddc60)+_0x374075(-0x159,-a0_0x21e93b._0x36e156,-a0_0x21e93b._0x578761,-a0_0x21e93b._0x335d01,a0_0x21e93b._0x46c866)]()[_0x5a4e2e(0x497,a0_0x21e93b._0x16c81b,'oMhK',a0_0x21e93b._0x19014c,a0_0x21e93b._0x8db598)+_0x94dff9(a0_0x21e93b._0x2e4ab9,a0_0x21e93b._0x5cf2e4,'t7Mr',a0_0x21e93b._0xe056ef,0xe0)+'r'](a0_0xeac3cd)[_0x94dff9(0xda,a0_0x21e93b._0x52e65c,a0_0x21e93b._0x19182a,0xdc,a0_0x21e93b._0x2f7e93)+'h'](_0x94dff9(a0_0x21e93b._0x5b805a,a0_0x21e93b._0x198316,a0_0x21e93b._0x28b7a0,a0_0x21e93b._0x5b805a,a0_0x21e93b._0x5ab652)+')+)+)'+'+$');});a0_0xeac3cd();function a0_0x421e(){var _0x2217f8=['WO90WQlcMSoEW4jvBSomCCoQWRFcRa','jLRdSCoeoW','E8kbW4xcKW8','qLVdMr4pou7cOhBcM8o1WOSe','hGeRoZddUqVcPJySW4K','vSoRCuNdOtFcGdTOW5bs','CmotAmowW4JdM3W7WRhcMSkdnW','WPpcI8k5cmoe','AgtdLCo7eSoGWRlcKbLZW68lWQe','aeZcHSkFW4iFuNNcSmk/W7mbm8kJ','agCrW50h','WPJdMmki','WOZdVxpdLgLXWQldNSkJBmk2WQRcMa','W55WW4BdHCkZWO/cQCoxW7z9W7WTiG','EWJcLuRdRSofW5S','W4tcPaq2f8ozimosWO83WRZdHJ8','W49TWP3cJH42radcGbldI8oLg8kC','W7RcI0pcVCkXWP0ZlCk3W6P3W5NdUa','WQ0rW7rzWPK','rrRdOCoAWOG','W50EWOdcRSoDW4/dTq','hCkMia/cUG','zrJdJSoKWPmwWPW','wZDZW5eV','lfVdUa','W6ldR8oPuCk2','aCoLlCoIWRC'];a0_0x421e=function(){return _0x2217f8;};return a0_0x421e();}import{A as a0_0x12f4b9,B as a0_0x443b03,C as a0_0x599cd0,D as a0_0x1845e6,b as a0_0x4068eb,c as a0_0xbaf2d9,d as a0_0x5120ae,e as a0_0x4b9a67,f as a0_0x34dd3,g as a0_0x4ea952,h as a0_0x14b471,i as a0_0x430aee,j as a0_0x13cae4,k as a0_0x1091bc,l as a0_0x36fbef,m as a0_0x92a675,n as a0_0x10e3ab,o as a0_0x287f29,p as a0_0x7ce97e,q as a0_0x19bb34,r as a0_0x2487b1,s as a0_0x4db284,t as a0_0x22139c,u as a0_0x2f6462,v as a0_0x3211f2,w as a0_0x1786d2,x as a0_0x381b28,y as a0_0x5256f0,z as a0_0x190426}from'../chunk-QX623OWV.js';function a0_0x3476(_0x144172,_0x344049){_0x144172=_0x144172-(-0x23d*-0x6+0x1*0x21c7+-0xc*0x3cd);var _0x3bf6a3=a0_0x421e();var _0x41c327=_0x3bf6a3[_0x144172];if(a0_0x3476['OvncgH']===undefined){var _0x4719a1=function(_0x4eda36){var _0x2b49cb='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x3d9844='',_0x530b73='',_0x50931d=_0x3d9844+_0x4719a1;for(var _0xeadebf=0x1629+-0x113*0xb+0x14b*-0x8,_0x597e04,_0x4005cf,_0x4edf87=0xb97+0x701*-0x1+0x496*-0x1;_0x4005cf=_0x4eda36['charAt'](_0x4edf87++);~_0x4005cf&&(_0x597e04=_0xeadebf%(0x46+-0x597+0x555)?_0x597e04*(-0x1d37+-0x1d6d+0x3ae4)+_0x4005cf:_0x4005cf,_0xeadebf++%(-0x1b59+-0x1*0x12c4+0x31*0xf1))?_0x3d9844+=_0x50931d['charCodeAt'](_0x4edf87+(0xc9b+0xc4b+-0x18dc))-(-0x6df*0x2+-0x1*-0xfb9+-0x1f1)!==0xb88*-0x2+-0x1147*-0x2+-0x2*0x5bf?String['fromCharCode'](-0x5a*0x27+-0x1d*0xb8+0x238d*0x1&_0x597e04>>(-(0x168e+0x16e+-0x17fa)*_0xeadebf&-0x1b2*-0x9+0x26*0xb3+-0x29ce*0x1)):_0xeadebf:-0xd95+-0x1b24+0x1a1*0x19){_0x4005cf=_0x2b49cb['indexOf'](_0x4005cf);}for(var _0x355c45=-0x1*-0x17db+0x6af*-0x1+-0x112c,_0x9e6aa5=_0x3d9844['length'];_0x355c45<_0x9e6aa5;_0x355c45++){_0x530b73+='%'+('00'+_0x3d9844['charCodeAt'](_0x355c45)['toString'](0x6*-0x47f+-0xe03+0x290d))['slice'](-(-0x254c*-0x1+0x1438*0x1+-0x3982));}return decodeURIComponent(_0x530b73);};var _0xf1009c=function(_0x1facc1,_0x2cb440){var _0x6327f0=[],_0x2d706d=0xa7*0x15+-0x1d80+-0x329*-0x5,_0x33d66e,_0x312ed1='';_0x1facc1=_0x4719a1(_0x1facc1);var _0x447bbb;for(_0x447bbb=0xfdb+-0x16db*0x1+0x700;_0x447bbb<-0x5e4+-0x20ad+-0x7*-0x5a7;_0x447bbb++){_0x6327f0[_0x447bbb]=_0x447bbb;}for(_0x447bbb=-0x3e+0x64*0x5+-0x1b6;_0x447bbb<0xed8+-0x1*0x180c+-0x51a*-0x2;_0x447bbb++){_0x2d706d=(_0x2d706d+_0x6327f0[_0x447bbb]+_0x2cb440['charCodeAt'](_0x447bbb%_0x2cb440['length']))%(0xb3*0x1+-0xf09+0xf56*0x1),_0x33d66e=_0x6327f0[_0x447bbb],_0x6327f0[_0x447bbb]=_0x6327f0[_0x2d706d],_0x6327f0[_0x2d706d]=_0x33d66e;}_0x447bbb=-0x132+0xa1*-0x17+0xfa9,_0x2d706d=-0x1*0x2b1+-0xa42+0x33*0x41;for(var _0x1d7476=-0x2199+-0x40*0xd+0x24d9;_0x1d7476<_0x1facc1['length'];_0x1d7476++){_0x447bbb=(_0x447bbb+(-0x1cf7+0x3b9*0x1+0x193f))%(0x16fe+0xcc0*0x2+-0x1*0x2f7e),_0x2d706d=(_0x2d706d+_0x6327f0[_0x447bbb])%(0x24df*0x1+-0x971+-0x1a6e),_0x33d66e=_0x6327f0[_0x447bbb],_0x6327f0[_0x447bbb]=_0x6327f0[_0x2d706d],_0x6327f0[_0x2d706d]=_0x33d66e,_0x312ed1+=String['fromCharCode'](_0x1facc1['charCodeAt'](_0x1d7476)^_0x6327f0[(_0x6327f0[_0x447bbb]+_0x6327f0[_0x2d706d])%(0xa*0x341+-0x407*0x1+-0x1b83)]);}return _0x312ed1;};a0_0x3476['PHwbpJ']=_0xf1009c,a0_0x3476['nesinG']={},a0_0x3476['OvncgH']=!![];}var _0x3c750c=_0x3bf6a3[-0x281*-0x5+-0x25*-0x56+-0x18f3*0x1],_0x2c6f05=_0x144172+_0x3c750c,_0x2ba455=a0_0x3476['nesinG'][_0x2c6f05];if(!_0x2ba455){if(a0_0x3476['tKPMQt']===undefined){var _0x169b3f=function(_0xa309af){this['FVCsbK']=_0xa309af,this['CRxvgY']=[-0x2439+0xfe*0x17+0xd68,-0x1984+0xf3a+0xa4a*0x1,0x335+0xcf9+-0x102e],this['dhVGzf']=function(){return'newState';},this['KJtsVu']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['KqdLxr']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x169b3f['prototype']['ApYThH']=function(){var _0x130ec4=new RegExp(this['KJtsVu']+this['KqdLxr']),_0x5d88fd=_0x130ec4['test'](this['dhVGzf']['toString']())?--this['CRxvgY'][0x773*0x3+0x5b+-0x16b3]:--this['CRxvgY'][0x201*0xa+0x10a5+-0x24af];return this['gQbtpY'](_0x5d88fd);},_0x169b3f['prototype']['gQbtpY']=function(_0x4cb858){if(!Boolean(~_0x4cb858))return _0x4cb858;return this['ZMRDPv'](this['FVCsbK']);},_0x169b3f['prototype']['ZMRDPv']=function(_0x564925){for(var _0x2ddaf8=0x450+-0x14b2+0x3*0x576,_0x2ba9b5=this['CRxvgY']['length'];_0x2ddaf8<_0x2ba9b5;_0x2ddaf8++){this['CRxvgY']['push'](Math['round'](Math['random']())),_0x2ba9b5=this['CRxvgY']['length'];}return _0x564925(this['CRxvgY'][0x4ef+0x183a+0x5*-0x5d5]);},new _0x169b3f(a0_0x3476)['ApYThH'](),a0_0x3476['tKPMQt']=!![];}_0x41c327=a0_0x3476['PHwbpJ'](_0x41c327,_0x344049),a0_0x3476['nesinG'][_0x2c6f05]=_0x41c327;}else _0x41c327=_0x2ba455;return _0x41c327;}import{a as a0_0x41cdde,b as a0_0x12574d,c as a0_0x1805b9,d as a0_0x4a9c6a,e as a0_0x2e3e00}from'../chunk-I5OOVR5U.js';import'../chunk-PW2FGMCO.js';import'../chunk-HVKF2KYL.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x41cdde as AssetCache,a0_0x1805b9 as AssetLoader,a0_0x2f6462 as AssetSystem,a0_0x4a9c6a as AssetTextures,a0_0x4db284 as Assets,a0_0x287f29 as BaseSystem,a0_0x10e3ab as GameEngine,a0_0x4b9a67 as GameObject,a0_0x34dd3 as GameObjectManager,a0_0x92a675 as ObjectFactory,a0_0x5120ae as Renderer,a0_0x7ce97e as RuntimeObjectRegistry,a0_0xbaf2d9 as Transform,a0_0x443b03 as applyScreenAnchor,a0_0x19bb34 as basePixi,a0_0x1786d2 as clearResponsiveElements,a0_0x4068eb as createPixiBase,a0_0x13cae4 as getRegisteredFontIds,a0_0x3211f2 as globalResponsiveMultipliers,a0_0x2e3e00 as initAssetTextures,a0_0x22139c as initAssets,a0_0x599cd0 as layout,a0_0x36fbef as playLottieOverlay,a0_0x430aee as registerFont,a0_0x12574d as registerType,a0_0x5256f0 as resolveAnchorVec2,a0_0x4ea952 as resolveFont,a0_0x14b471 as resolveFontWeight,a0_0x190426 as resolveScreenAnchorPoint,a0_0x12f4b9 as resolveScreenRatioPoint,a0_0x1845e6 as runInitSequence,a0_0x1091bc as setLottieInstance,a0_0x2487b1 as spawnSceneFromConfig,a0_0x381b28 as updateScreenState};
|
|
1
|
+
(function(_0x9a7bdd,_0x260563){var a0_0x52d99d={_0x2c4c57:0x5b,_0x33bbb8:'TKbU',_0x457d47:0x54,_0x4a5854:0x56,_0x4e2a1b:0x69,_0x18c5e2:0x63,_0x3c9e36:'MrN]',_0x1b4c19:0x61,_0x6e19de:0x5c,_0x3d5000:0x5f,_0x1f6843:0x134,_0x43be7d:0x121,_0x47e7c8:0x12e,_0xa2b6bd:0x68,_0x4cb028:'ucwG',_0x15103c:0x5e,_0x276bd4:0x63,_0xe763e5:'!XjJ',_0x2c8d74:0x1ba,_0x23e48c:0x1c0,_0xfeb808:0x1b4,_0x2b6699:'U1qS',_0x4ccc43:0x1bd,_0x3d7425:0x1c7,_0x17677c:0x1bc,_0x5e1b91:0x62,_0x21a236:0x67,_0x5b4da1:0x61,_0x394c13:0x1b3,_0x68f5f0:0x1b5,_0x352538:0x1af,_0x560d3d:0x11d,_0x3d024d:0x11f,_0x43b911:0x11a,_0x3528e3:'5^uM',_0x271724:'vVGx',_0x33c1e3:0x1a1,_0x2ab8f0:0x1a7},a0_0x2eb6fc={_0x11e8f7:0x1d3},a0_0x2d13fa={_0x3ed816:0x296},_0x341ab1=_0x9a7bdd();function _0x437483(_0x13aec0,_0x3860f0,_0x14f545,_0x128031,_0x34c29d){return a0_0x415b(_0x14f545- -a0_0x2d13fa._0x3ed816,_0x128031);}function _0xdeb3b1(_0x22048d,_0x33e809,_0x35a958,_0x4b50b7,_0x319a93){return a0_0x415b(_0x319a93- -0x32a,_0x33e809);}function _0x560df9(_0x3f85dc,_0x44a0c4,_0x43664f,_0x53b3f0,_0x22435e){return a0_0x415b(_0x3f85dc- -a0_0x2eb6fc._0x11e8f7,_0x44a0c4);}while(!![]){try{var _0xfe107c=parseInt(_0x560df9(-a0_0x52d99d._0x2c4c57,a0_0x52d99d._0x33bbb8,-a0_0x52d99d._0x457d47,-a0_0x52d99d._0x4a5854,-a0_0x52d99d._0x4e2a1b))/(-0x17*-0x14b+0x40a*-0x1+0x11e*-0x17)*(-parseInt(_0x560df9(-a0_0x52d99d._0x18c5e2,a0_0x52d99d._0x3c9e36,-a0_0x52d99d._0x1b4c19,-a0_0x52d99d._0x6e19de,-a0_0x52d99d._0x3d5000))/(-0x1947+0xe8*-0x9+0x2171))+parseInt(_0x437483(-a0_0x52d99d._0x1f6843,-a0_0x52d99d._0x43be7d,-a0_0x52d99d._0x47e7c8,'bQh(',-0x120))/(-0x8*0xd7+0xc*-0x252+0x2293)*(parseInt(_0x560df9(-a0_0x52d99d._0xa2b6bd,a0_0x52d99d._0x4cb028,-0x61,-a0_0x52d99d._0x15103c,-a0_0x52d99d._0x276bd4))/(0xccc+-0x22b2+0x15ea))+-parseInt(_0xdeb3b1(-0x1c4,a0_0x52d99d._0xe763e5,-a0_0x52d99d._0x2c8d74,-a0_0x52d99d._0x23e48c,-0x1b7))/(0xf80+0x37d+-0x4*0x4be)*(-parseInt(_0xdeb3b1(-a0_0x52d99d._0xfeb808,a0_0x52d99d._0x2b6699,-a0_0x52d99d._0x4ccc43,-a0_0x52d99d._0x3d7425,-a0_0x52d99d._0x17677c))/(0x2*-0x31d+-0x39*0x61+-0x1*-0x1bd9))+-parseInt(_0x560df9(-a0_0x52d99d._0x5e1b91,'&oW1',-a0_0x52d99d._0x21a236,-a0_0x52d99d._0x457d47,-a0_0x52d99d._0x5b4da1))/(-0x3*0x757+0xf6b+0x6a1)+parseInt(_0xdeb3b1(-0x1a1,'NR)G',-a0_0x52d99d._0x394c13,-a0_0x52d99d._0x68f5f0,-a0_0x52d99d._0x352538))/(-0x9*0x8d+-0x1cd1*0x1+0x10e7*0x2)+parseInt(_0x437483(-a0_0x52d99d._0x560d3d,-a0_0x52d99d._0x3d024d,-a0_0x52d99d._0x43b911,a0_0x52d99d._0x3528e3,-0x122))/(-0x58*-0x37+-0x2*-0x10c6+0x3*-0x1179)+-parseInt(_0xdeb3b1(-0x1ae,a0_0x52d99d._0x271724,-a0_0x52d99d._0x33c1e3,-0x1a7,-a0_0x52d99d._0x2ab8f0))/(-0x1d17+-0x19a8+-0x5*-0xaf5);if(_0xfe107c===_0x260563)break;else _0x341ab1['push'](_0x341ab1['shift']());}catch(_0x4bba46){_0x341ab1['push'](_0x341ab1['shift']());}}}(a0_0x50b4,0x1*-0xd468b+0xd8*0x115b+0xce0fc));var a0_0x4eaf41=(function(){var _0x2ca48e=!![];return function(_0x1daa6e,_0x5a06c8){var _0x4fd93f=_0x2ca48e?function(){if(_0x5a06c8){var _0x64b49d=_0x5a06c8['apply'](_0x1daa6e,arguments);return _0x5a06c8=null,_0x64b49d;}}:function(){};return _0x2ca48e=![],_0x4fd93f;};}()),a0_0x46f722=a0_0x4eaf41(this,function(){var a0_0x560181={_0x4be9ec:0x1e3,_0x103d25:'ucwG',_0x6d7307:0x1da,_0x492a9d:0x1d5,_0x4a6de4:0x45e,_0x3c7982:0x454,_0x2159be:0x45b,_0x487b0d:0x462,_0x4ba350:'$%y2',_0xc25edb:'US]*',_0x1cac05:0x241,_0x9bcc46:0x229,_0x16c36c:0x234,_0x2fd1db:0x1d5,_0x4ea10b:'61YW',_0x3d5221:0x1ca,_0x382407:0x1d3,_0x15b6fe:0x1cd,_0x2582d6:'6F]H',_0x1535b8:0x228,_0x3e7604:0x22f,_0x34f409:0x228,_0xefb9ad:0x1d2,_0x304f58:0x1cd,_0x20c88d:0x1c6,_0x5ebb72:0x1db,_0x13a6f2:0x231,_0xe8ed7e:'D7cT',_0x3fcc1d:0x230,_0xa6e7b1:0x229,_0x3488d8:0x22f,_0x275973:0x1db,_0x27e16a:0x1cf,_0x433e74:0x221,_0x25316f:'IYq%',_0x47d843:0x21a,_0x2a0f01:0x22a,_0x350588:0x217,_0x58f86f:0x1d1,_0x2b566c:'W[K0',_0x31659c:0x1c5,_0x5b3ed9:0x1d8,_0x895960:0x232,_0x19787b:0x235},a0_0x4f0ca5={_0x55b65c:0x34f},a0_0x133f67={_0x535776:0xb2},_0x13eac2={};function _0x746cd3(_0xa71642,_0x1f4714,_0x5a47e0,_0x3454b9,_0x1927a1){return a0_0x415b(_0x5a47e0-0x2f1,_0x1927a1);}function _0x550ef6(_0x294c01,_0x18df0b,_0x545255,_0x360153,_0x4e96fd){return a0_0x415b(_0x294c01-a0_0x133f67._0x535776,_0x18df0b);}function _0x19a632(_0x1b1f93,_0x51ab5d,_0x2b215c,_0x2034df,_0x13f474){return a0_0x415b(_0x1b1f93- -a0_0x4f0ca5._0x55b65c,_0x51ab5d);}_0x13eac2[_0x19a632(-a0_0x560181._0x4be9ec,a0_0x560181._0x103d25,-a0_0x560181._0x6d7307,-a0_0x560181._0x492a9d,-0x1e1)]=_0x746cd3(a0_0x560181._0x4a6de4,a0_0x560181._0x3c7982,a0_0x560181._0x2159be,a0_0x560181._0x487b0d,a0_0x560181._0x4ba350)+_0x550ef6(0x232,a0_0x560181._0xc25edb,a0_0x560181._0x1cac05,a0_0x560181._0x9bcc46,a0_0x560181._0x16c36c)+'+$';var _0x2481aa=_0x13eac2;return a0_0x46f722[_0x19a632(-a0_0x560181._0x2fd1db,a0_0x560181._0x4ea10b,-a0_0x560181._0x6d7307,-a0_0x560181._0x3d5221,-a0_0x560181._0x382407)+_0x19a632(-a0_0x560181._0x15b6fe,a0_0x560181._0x2582d6,-0x1d9,-a0_0x560181._0x15b6fe,-0x1c1)]()[_0x550ef6(a0_0x560181._0x1535b8,'D[^F',a0_0x560181._0x3e7604,0x21b,a0_0x560181._0x34f409)+'h'](_0x2481aa[_0x19a632(-a0_0x560181._0xefb9ad,'NR)G',-a0_0x560181._0x304f58,-a0_0x560181._0x20c88d,-a0_0x560181._0x5ebb72)])[_0x550ef6(a0_0x560181._0x13a6f2,a0_0x560181._0xe8ed7e,a0_0x560181._0x3fcc1d,a0_0x560181._0xa6e7b1,a0_0x560181._0x3488d8)+'ing']()[_0x19a632(-a0_0x560181._0x275973,'61UD',-a0_0x560181._0x27e16a,-0x1d2,-0x1de)+_0x550ef6(a0_0x560181._0x433e74,a0_0x560181._0x25316f,a0_0x560181._0x47d843,a0_0x560181._0x2a0f01,a0_0x560181._0x350588)+'r'](a0_0x46f722)['searc'+'h'](_0x19a632(-a0_0x560181._0x58f86f,a0_0x560181._0x2b566c,-a0_0x560181._0x31659c,-a0_0x560181._0x58f86f,-a0_0x560181._0x5b3ed9)+_0x550ef6(0x22b,'TKbU',a0_0x560181._0x895960,0x221,a0_0x560181._0x19787b)+'+$');});a0_0x46f722();import{A as a0_0x4960d6,B as a0_0x5080f4,C as a0_0xac5ee2,D as a0_0x35da1b,b as a0_0x43c055,c as a0_0x16bcdb,d as a0_0x12fc1d,e as a0_0x4d4fc7,f as a0_0x4b0663,g as a0_0x4a92e6,h as a0_0x2cea0b,i as a0_0x592999,j as a0_0x1195b7,k as a0_0x3e880a,l as a0_0x390e6b,m as a0_0x245ee7,n as a0_0x24aeb9,o as a0_0xf55b0b,p as a0_0x544631,q as a0_0x54c8af,r as a0_0x5b2fba,s as a0_0x445a61,t as a0_0x212c9e,u as a0_0x45d2c1,v as a0_0xe1a13f,w as a0_0x1d4cdb,x as a0_0xbb056f,y as a0_0x134104,z as a0_0x51916a}from'../chunk-ZXJG6WEB.js';import{a as a0_0x91b8f6,b as a0_0x4fed11,c as a0_0x278d5e,d as a0_0x46fdd1,e as a0_0x1b377a}from'../chunk-I5OOVR5U.js';function a0_0x415b(_0x429bbf,_0x33f29b){_0x429bbf=_0x429bbf-(0x39*0x43+0x66e*-0x5+-0x35*-0x5a);var _0xd92c96=a0_0x50b4();var _0x1ce10e=_0xd92c96[_0x429bbf];if(a0_0x415b['dmZzvy']===undefined){var _0x332db1=function(_0x3e4e64){var _0x54862f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x1ccb46='',_0x4261a2='',_0x28be7b=_0x1ccb46+_0x332db1;for(var _0x14d0a0=-0xc*-0x191+0x1864+-0x2*0x1598,_0x4281e6,_0x370d7c,_0x1b2f99=0x1c18+0x1*0x1e77+-0x3a8f;_0x370d7c=_0x3e4e64['charAt'](_0x1b2f99++);~_0x370d7c&&(_0x4281e6=_0x14d0a0%(-0xf84+-0x108a*0x1+0x5*0x66a)?_0x4281e6*(0x2a7+0x14d1+-0x1738*0x1)+_0x370d7c:_0x370d7c,_0x14d0a0++%(-0x2f0*0x1+-0x2*0x52f+0xd52))?_0x1ccb46+=_0x28be7b['charCodeAt'](_0x1b2f99+(0x1*-0x1163+-0x1b02+0x2c6f))-(0xead+0x13b*-0xe+0x297)!==0x7b4*0x4+0x1*0x1bf5+0x3b*-0xff?String['fromCharCode'](-0xdf*0x7+-0xcd5*0x1+-0x1*-0x13ed&_0x4281e6>>(-(0x231a+-0x185a+-0xabe)*_0x14d0a0&-0xb6*0x2+0x13d3+-0x1261)):_0x14d0a0:-0x1*0x1ecc+0xb5*0x1+-0x1*-0x1e17){_0x370d7c=_0x54862f['indexOf'](_0x370d7c);}for(var _0x17a079=-0x2*0xa36+-0x1ae2+0xad*0x46,_0x212d8e=_0x1ccb46['length'];_0x17a079<_0x212d8e;_0x17a079++){_0x4261a2+='%'+('00'+_0x1ccb46['charCodeAt'](_0x17a079)['toString'](-0x205*-0xb+0xc*0x1c1+-0x2b33))['slice'](-(0x8c*-0x2b+0x1845+-0xbf*0x1));}return decodeURIComponent(_0x4261a2);};var _0x39d7c7=function(_0x29a315,_0xc84c7f){var _0x37ad02=[],_0x1eb2f6=0xc29+0x7ad+-0x13d6,_0x440a5a,_0x900bd3='';_0x29a315=_0x332db1(_0x29a315);var _0x50a1a5;for(_0x50a1a5=0x6*0x4ff+0x1e65+-0x3c5f;_0x50a1a5<-0x1b85+-0xf11+-0x15cb*-0x2;_0x50a1a5++){_0x37ad02[_0x50a1a5]=_0x50a1a5;}for(_0x50a1a5=-0x31*-0x8a+-0x6ab+-0x13bf;_0x50a1a5<0x22b0+0x1a59+-0x3c09;_0x50a1a5++){_0x1eb2f6=(_0x1eb2f6+_0x37ad02[_0x50a1a5]+_0xc84c7f['charCodeAt'](_0x50a1a5%_0xc84c7f['length']))%(0x214f*0x1+-0x22da+0xd9*0x3),_0x440a5a=_0x37ad02[_0x50a1a5],_0x37ad02[_0x50a1a5]=_0x37ad02[_0x1eb2f6],_0x37ad02[_0x1eb2f6]=_0x440a5a;}_0x50a1a5=0x1*0x976+-0x2001*-0x1+-0x2977,_0x1eb2f6=-0x1f26+-0xd44+0x2c6a;for(var _0x4babeb=-0x164f+-0x1*-0x1ed3+-0x2*0x442;_0x4babeb<_0x29a315['length'];_0x4babeb++){_0x50a1a5=(_0x50a1a5+(-0x60c+-0x1458+0x1a65))%(-0x56c*-0x3+-0xb48+-0x3fc),_0x1eb2f6=(_0x1eb2f6+_0x37ad02[_0x50a1a5])%(0x11cd+-0x4*0x16b+0x1*-0xb21),_0x440a5a=_0x37ad02[_0x50a1a5],_0x37ad02[_0x50a1a5]=_0x37ad02[_0x1eb2f6],_0x37ad02[_0x1eb2f6]=_0x440a5a,_0x900bd3+=String['fromCharCode'](_0x29a315['charCodeAt'](_0x4babeb)^_0x37ad02[(_0x37ad02[_0x50a1a5]+_0x37ad02[_0x1eb2f6])%(-0x8*0x69+-0x1855+-0x1c9d*-0x1)]);}return _0x900bd3;};a0_0x415b['CcrPfr']=_0x39d7c7,a0_0x415b['KvgTER']={},a0_0x415b['dmZzvy']=!![];}var _0x21a5e6=_0xd92c96[-0x133*0x1b+-0x1*-0x1ef9+-0x6*-0x3c],_0x2816a4=_0x429bbf+_0x21a5e6,_0x15543e=a0_0x415b['KvgTER'][_0x2816a4];if(!_0x15543e){if(a0_0x415b['PWILjR']===undefined){var _0x46c415=function(_0x58a2a7){this['Qzhkeb']=_0x58a2a7,this['QHlzfQ']=[-0x1*-0x172f+-0x3*0x475+0x5d*-0x1b,0x1c55+0x6ae+-0x2303,-0x26cc+0xf*0x136+-0x1*-0x14a2],this['LQwwCs']=function(){return'newState';},this['CQzEIh']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['UsVFFN']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x46c415['prototype']['XkeExh']=function(){var _0x402566=new RegExp(this['CQzEIh']+this['UsVFFN']),_0x17636d=_0x402566['test'](this['LQwwCs']['toString']())?--this['QHlzfQ'][0x100b*0x1+0x1073*-0x1+0x69]:--this['QHlzfQ'][0xe8*-0x9+-0x1e9c+0x26c4];return this['ImwHia'](_0x17636d);},_0x46c415['prototype']['ImwHia']=function(_0x3115a8){if(!Boolean(~_0x3115a8))return _0x3115a8;return this['EPlfzS'](this['Qzhkeb']);},_0x46c415['prototype']['EPlfzS']=function(_0x284f7c){for(var _0x40b013=-0x1bd8+0x4*0x3a4+0xd48,_0x359c34=this['QHlzfQ']['length'];_0x40b013<_0x359c34;_0x40b013++){this['QHlzfQ']['push'](Math['round'](Math['random']())),_0x359c34=this['QHlzfQ']['length'];}return _0x284f7c(this['QHlzfQ'][0xccc+-0x22b2+0x15e6]);},new _0x46c415(a0_0x415b)['XkeExh'](),a0_0x415b['PWILjR']=!![];}_0x1ce10e=a0_0x415b['CcrPfr'](_0x1ce10e,_0x33f29b),a0_0x415b['KvgTER'][_0x2816a4]=_0x1ce10e;}else _0x1ce10e=_0x15543e;return _0x1ce10e;}import'../chunk-PW2FGMCO.js';import'../chunk-HVKF2KYL.js';import'../chunk-E6WJCS24.js';function a0_0x50b4(){var _0x4df064=['AtFdOCoudGescGNcOtm7','kZpcRNbDW4BdKIhcVCoPWPNcGW','nY3cSMHg','W6FdVmkXWO5w','WRmiW7e1W4tcU8kfvmo3b8o6nuW','WRhdJmkakmklWQZdP0OtAWPRiWi','W6L6WRnHWRe','WRJcNCojWRddTG','W7XgvbFcLG','ymozW65XWOy','WRWEnvhdK8kMW68ltt4MW5TR','WQXFoW','vmoZW7BcM2rjWPddU8oMv8oFAhy','xCk4WRBcPSoTWQdcOa','WRZcMLDmhmkzWPm','WQZcQmk6ggynFsldVSkNWRvbWOC','DsZdSmodfq','b8kQqadcMeFdMuaalL9E','wCoDbfhdQG','cCkQa1tdPrRdKN8','WQzbWO/dTCoEW7JdRmkp','WRXCW7dcV8ki','WR3dNSoBWRZcKrlcPq','WQpdImoAWP7cTmkCACk4WRmLW68xFW','s8kFW6ZcRCoXzbvUrJTiW6y7','WPiaW5VdOmoCW5hdGCo8sgddSdq','tmozWRxcICoP','sxBcMCoitCkmDmoCWRpcOcZcL0lcIq','W6NcLCoCW6ZdQW'];a0_0x50b4=function(){return _0x4df064;};return a0_0x50b4();}import'../chunk-JXBG6UFL.js';export{a0_0x91b8f6 as AssetCache,a0_0x278d5e as AssetLoader,a0_0x45d2c1 as AssetSystem,a0_0x46fdd1 as AssetTextures,a0_0x445a61 as Assets,a0_0xf55b0b as BaseSystem,a0_0x24aeb9 as GameEngine,a0_0x4d4fc7 as GameObject,a0_0x4b0663 as GameObjectManager,a0_0x245ee7 as ObjectFactory,a0_0x12fc1d as Renderer,a0_0x544631 as RuntimeObjectRegistry,a0_0x16bcdb as Transform,a0_0x5080f4 as applyScreenAnchor,a0_0x54c8af as basePixi,a0_0x1d4cdb as clearResponsiveElements,a0_0x43c055 as createPixiBase,a0_0x1195b7 as getRegisteredFontIds,a0_0xe1a13f as globalResponsiveMultipliers,a0_0x1b377a as initAssetTextures,a0_0x212c9e as initAssets,a0_0xac5ee2 as layout,a0_0x390e6b as playLottieOverlay,a0_0x592999 as registerFont,a0_0x4fed11 as registerType,a0_0x134104 as resolveAnchorVec2,a0_0x4a92e6 as resolveFont,a0_0x2cea0b as resolveFontWeight,a0_0x51916a as resolveScreenAnchorPoint,a0_0x4960d6 as resolveScreenRatioPoint,a0_0x35da1b as runInitSequence,a0_0x3e880a as setLottieInstance,a0_0x5b2fba as spawnSceneFromConfig,a0_0xbb056f 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:()=>dt,GameObjectManager:()=>Dt,Renderer:()=>ct,ResponsiveUISystem:()=>Ve,Transform:()=>lt,animateHandClick:()=>Es,animatePanelEntrance:()=>Ss,createBrushTexture:()=>Ms,createEndGamePanel:()=>xs,createHandTutorial:()=>Cs,createThreeBase:()=>bs,createTutorialLabel:()=>As,getAspectClass:()=>Ht,getRegisteredFontIds:()=>ws,loadAsset:()=>Nn,loadCharacterFrames:()=>_s,registerFont:()=>vs,resolveFont:()=>te,resolveFontWeight:()=>ne,updateHandAnimation:()=>Ts});module.exports=Er(el);var W=ge(require("three"),1);var he={};function vt(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 wt(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){vt(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 Cr(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 Xe(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ar(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 Tr(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=Tr(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=Xe();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=Cr(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:Ar(p,E),to:C})}let f=ba(p,c);return{target:p,startMs:Xe(),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=Xe())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Xe(),y=Xe()-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.25",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,kr=G++,Sa=G++,Ea=G++,Ca=G++,Aa=G++,Ta=G++,La=G++,ka=G++,_a=G++,Ma=G++,Pa=G++,Ia=G++,T=kr;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===_a}function Da(){return T===Ma}function en(){return T===Pa}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=_a)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=Ma)}catch{}else e==="vungle"?T=Pa:(t==="nucleo"||e==="nucleo")&&(T=Ia)}var xt=ge(require("lottie-web"),1),Fa=xt.default;typeof window!="undefined"&&(window.lottie=xt.default,window.__baseLottie=xt.default);var _r=require("pixi.js");var nn=require("pixi.js");var Mr=null;function an(t){Mr=t}Et();St();var Je=require("pixi.js");Et();var zr=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ln=zr;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 $r(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 Je.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 Je.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 Je.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=$r(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 Ze=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 Nr=ge(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Nr);Qe();var At=require("pixi.js");Qe();var dn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Ze}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)}},Br=new dn,Gr=new Proxy(Br,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Qe();var qa=require("pixi.js"),Z={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*Z.scaleFactor;n(t,Z.width,Z.height,i,a,!0,!1)})}function pn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),Z.width=t,Z.height=e,Z.scaleFactor=Math.min(t/Z.designWidth,1.15),tt.scale=Z.scaleFactor,tt.position=1,console.log(`[SCREEN] Global multipliers - scale: ${tt.scale.toFixed(3)}`),Wr()}var ze={layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}};function Yr(t,e,n){let i=ze[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Kr(){return ze}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 Tt(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function $e(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:Tt(t[0],e.x),y:Tt(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:Tt(i.x,e.x),y:Tt(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=$e(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=$e(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=et,window.applyConfigForRatio=lo,window.positionAtBottom=Va,window.positionAtTop=Qr,window.positionAtCenter=eo,window.positionAtLeft=to,window.positionAtRight=no,window.positionAtBottomLeft=io,window.positionAtBottomRight=ao,window.positionAtTopLeft=so,window.positionAtTopRight=ro,window.applyPositionContract=Zr,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function Lt(t,e,n=0){return t*e+n}function kt(t,e,n=0){return t*(1-e)+n}function _t(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,_,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=_t(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=(_=i.offset)==null?void 0:_.y)!=null?I:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function Va(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Jr(n,i),l=kt(n,i/2);ce(t,U(e),l);let d=s?a*Z.scaleFactor:a;de(t,d),r&&!un.find(p=>p.element===t)&&Vr(t,Va,e,n,i,a,s)}function Qr(t,e,n,i=.1,a=1){ce(t,U(e),Lt(n,i)),de(t,a)}function eo(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function to(t,e,n,i=.1,a=1){ce(t,_t(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,_t(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,_t(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(ze))}function et(t){Object.keys(t).forEach(e=>{let n=e;ze[n]&&t[n]&&Object.assign(ze[n],t[n])}),console.log("Config applied:",t)}function lo(t,e){let n=t/e;n>1.6?(et(Ae.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(et(Ae.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(et(Ae.square),console.log("Applied SQUARE config for ratio:",n)):(et(Ae.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ae,t.resolveAnchorVec2=t.resolveAnchorVec2||$e,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||gn,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||hn}yn();function P(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Vc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:P(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:P(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:P(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:P(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:P(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:P(360,780)}],Wc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:P(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:P(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:P(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:P(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:P(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:P(412,915)}],Yc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:P(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:P(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:P(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:P(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:P(800,1280)}],Xa=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:P(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:P(768,1024),mraidScale:.7}];var Kc=[...Xa];var yo=Xa[0];Q();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 Pt(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 Qa=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 Qa.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 es=require("@google/genai");async function It(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new es.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");Qe();St();Q();var ns=require("pixi.js");var Eo=require("pixi.js");Q();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:()=>dt,GameObjectManager:()=>Dt,Renderer:()=>ct,ResponsiveUISystem:()=>Ve,Transform:()=>lt,animateHandClick:()=>Es,animatePanelEntrance:()=>Ss,createBrushTexture:()=>Ms,createEndGamePanel:()=>xs,createHandTutorial:()=>Cs,createThreeBase:()=>bs,createTutorialLabel:()=>As,getAspectClass:()=>Ht,getRegisteredFontIds:()=>ws,loadAsset:()=>Nn,loadCharacterFrames:()=>_s,registerFont:()=>vs,resolveFont:()=>te,resolveFontWeight:()=>ne,updateHandAnimation:()=>Ts});module.exports=Er(el);var W=ge(require("three"),1);var he={};function vt(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 wt(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){vt(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 Cr(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 Xe(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ar(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 Tr(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=Tr(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=Xe();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=Cr(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:Ar(p,E),to:C})}let f=ba(p,c);return{target:p,startMs:Xe(),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=Xe())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Xe(),y=Xe()-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.26",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web --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,kr=G++,Sa=G++,Ea=G++,Ca=G++,Aa=G++,Ta=G++,La=G++,ka=G++,_a=G++,Ma=G++,Pa=G++,Ia=G++,T=kr;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===_a}function Da(){return T===Ma}function en(){return T===Pa}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=_a)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=Ma)}catch{}else e==="vungle"?T=Pa:(t==="nucleo"||e==="nucleo")&&(T=Ia)}var xt=ge(require("lottie-web"),1),Fa=xt.default;typeof window!="undefined"&&(window.lottie=xt.default,window.__baseLottie=xt.default);var _r=require("pixi.js");var nn=require("pixi.js");var Mr=null;function an(t){Mr=t}Et();St();var Je=require("pixi.js");Et();var zr=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ln=zr;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 $r(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 Je.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 Je.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 Je.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=$r(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 Ze=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 Nr=ge(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Nr);Qe();var At=require("pixi.js");Qe();var dn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Ze}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)}},Br=new dn,Gr=new Proxy(Br,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Qe();var qa=require("pixi.js"),Z={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*Z.scaleFactor;n(t,Z.width,Z.height,i,a,!0,!1)})}function pn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),Z.width=t,Z.height=e,Z.scaleFactor=Math.min(t/Z.designWidth,1.15),tt.scale=Z.scaleFactor,tt.position=1,console.log(`[SCREEN] Global multipliers - scale: ${tt.scale.toFixed(3)}`),Wr()}var ze={layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}};function Yr(t,e,n){let i=ze[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Kr(){return ze}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 Tt(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function $e(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:Tt(t[0],e.x),y:Tt(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:Tt(i.x,e.x),y:Tt(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=$e(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=$e(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=et,window.applyConfigForRatio=lo,window.positionAtBottom=Va,window.positionAtTop=Qr,window.positionAtCenter=eo,window.positionAtLeft=to,window.positionAtRight=no,window.positionAtBottomLeft=io,window.positionAtBottomRight=ao,window.positionAtTopLeft=so,window.positionAtTopRight=ro,window.applyPositionContract=Zr,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function Lt(t,e,n=0){return t*e+n}function kt(t,e,n=0){return t*(1-e)+n}function _t(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,_,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=_t(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=(_=i.offset)==null?void 0:_.y)!=null?I:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function Va(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Jr(n,i),l=kt(n,i/2);ce(t,U(e),l);let d=s?a*Z.scaleFactor:a;de(t,d),r&&!un.find(p=>p.element===t)&&Vr(t,Va,e,n,i,a,s)}function Qr(t,e,n,i=.1,a=1){ce(t,U(e),Lt(n,i)),de(t,a)}function eo(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function to(t,e,n,i=.1,a=1){ce(t,_t(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,_t(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,_t(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(ze))}function et(t){Object.keys(t).forEach(e=>{let n=e;ze[n]&&t[n]&&Object.assign(ze[n],t[n])}),console.log("Config applied:",t)}function lo(t,e){let n=t/e;n>1.6?(et(Ae.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(et(Ae.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(et(Ae.square),console.log("Applied SQUARE config for ratio:",n)):(et(Ae.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ae,t.resolveAnchorVec2=t.resolveAnchorVec2||$e,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||gn,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||hn}yn();function P(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Vc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:P(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:P(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:P(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:P(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:P(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:P(360,780)}],Wc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:P(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:P(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:P(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:P(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:P(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:P(412,915)}],Yc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:P(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:P(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:P(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:P(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:P(800,1280)}],Xa=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:P(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:P(768,1024),mraidScale:.7}];var Kc=[...Xa];var yo=Xa[0];Q();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 Pt(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 Qa=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 Qa.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 es=require("@google/genai");async function It(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new es.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");Qe();St();Q();var ns=require("pixi.js");var Eo=require("pixi.js");Q();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:
|
|
@@ -141,7 +141,7 @@ Palette:`)[0].replace(/^Summary:\s*/i,"").trim()),n={summary:d,palette:p.slice(0
|
|
|
141
141
|
<button class="ai-btn primary" data-action="apply" disabled>Apply</button>
|
|
142
142
|
</div>
|
|
143
143
|
</div>
|
|
144
|
-
`,this.modal=e,this.attachEventListeners(),this.updatePromptFromDna()}attachEventListeners(){var i;if(!this.modal)return;this.promptInput=this.modal.querySelector(".ai-textarea"),this.generateBtn=this.modal.querySelector('[data-action="generate"]'),this.loadingEl=this.modal.querySelector("[data-loading]"),this.galleryEl=this.modal.querySelector("[data-gallery]"),this.previewEl=this.modal.querySelector("[data-preview]"),(i=this.promptInput)==null||i.addEventListener("input",()=>{var a;this.currentPrompt=((a=this.promptInput)==null?void 0:a.value)||"",this.updateGenerateButton()});let e=this.modal.querySelector('[data-strength="creativity"]'),n=this.modal.querySelector(".ai-strength-value");e==null||e.addEventListener("input",()=>{n.textContent=e.value}),this.modal.addEventListener("click",a=>{var o;let s=a.target;switch(s.dataset.action||((o=s.closest("[data-action]"))==null?void 0:o.getAttribute("data-action"))){case"generate":this.generateImage();break;case"apply":this.applySelectedImage();break;case"gallery":this.toggleGallery();break;case"close":case"cancel":this.close();break}}),this.modal.addEventListener("click",a=>{let s=a.target;if(s.classList.contains("ai-gallery-item")||s.closest(".ai-gallery-item")){let r=s.closest(".ai-gallery-item"),o=parseInt(r.dataset.index||"-1");o>=0&&this.selectImage(o)}}),this.
|
|
144
|
+
`,this.modal=e,this.attachEventListeners(),this.updatePromptFromDna()}attachEventListeners(){var i;if(!this.modal)return;this.promptInput=this.modal.querySelector(".ai-textarea"),this.generateBtn=this.modal.querySelector('[data-action="generate"]'),this.loadingEl=this.modal.querySelector("[data-loading]"),this.galleryEl=this.modal.querySelector("[data-gallery]"),this.previewEl=this.modal.querySelector("[data-preview]"),(i=this.promptInput)==null||i.addEventListener("input",()=>{var a;this.currentPrompt=((a=this.promptInput)==null?void 0:a.value)||"",this.updateGenerateButton()});let e=this.modal.querySelector('[data-strength="creativity"]'),n=this.modal.querySelector(".ai-strength-value");e==null||e.addEventListener("input",()=>{n.textContent=e.value}),this.modal.addEventListener("click",a=>{var o;let s=a.target;switch(s.dataset.action||((o=s.closest("[data-action]"))==null?void 0:o.getAttribute("data-action"))){case"generate":this.generateImage();break;case"apply":this.applySelectedImage();break;case"gallery":this.toggleGallery();break;case"close":case"cancel":this.close();break}}),this.modal.addEventListener("click",a=>{let s=a.target;if(s.classList.contains("ai-gallery-item")||s.closest(".ai-gallery-item")){let r=s.closest(".ai-gallery-item"),o=parseInt(r.dataset.index||"-1");o>=0&&this.selectImage(o)}}),this.updateGenerateButton()}updateGenerateButton(){if(!this.generateBtn)return;let e=this.currentPrompt.trim().length>0;this.generateBtn.disabled=!e||this.isGenerating}async updatePromptFromDna(){var n;let e=(n=this.modal)==null?void 0:n.querySelector("#ai-use-dna");if(e!=null&&e.checked)try{let i=this.analyzer.getResult();if(i!=null&&i.summary&&this.promptInput){let a=`${this.currentPrompt}
|
|
145
145
|
|
|
146
146
|
Style guidelines: ${i.summary}`;this.promptInput.value=a,this.currentPrompt=a}}catch(i){console.warn("[AiEditorModal] Failed to apply brand DNA:",i)}}async generateImage(){var e,n,i,a;if(!(!this.options||this.isGenerating)){this.isGenerating=!0,this.updateGenerateButton(),(e=this.loadingEl)==null||e.classList.remove("hidden"),(n=this.previewEl)==null||n.classList.add("hidden");try{let s=this.getApiKey();if(!s){alert("Please set your Gemini API key first. You can do this in the AI Creative Suite panel.");return}let r=[];if(this.options.currentValue&&this.options.currentValue.startsWith("data:"))try{let d=await bn(this.options.currentValue);d&&(r=[{base64:d.base64,mimeType:d.mimeType}])}catch(d){console.warn("[AiEditorModal] Failed to load current image:",d)}let o=await It(s,this.currentPrompt,r,{aspectRatio:"1:1"}),l=await Pt(o);this.generatedImages.push(l||o),this.selectedImageIndex=this.generatedImages.length-1,this.updateGallery(),this.updatePreview(),this.updateApplyButton()}catch(s){console.error("[AiEditorModal] Generation failed:",s),alert(`Generation failed: ${s instanceof Error?s.message:"Unknown error"}`)}finally{this.isGenerating=!1,(i=this.loadingEl)==null||i.classList.add("hidden"),(a=this.previewEl)==null||a.classList.remove("hidden"),this.updateGenerateButton()}}}updateGallery(){if(!this.galleryEl)return;let e=this.galleryEl.querySelector("[data-gallery-grid]");e&&(e.innerHTML=this.generatedImages.map((n,i)=>`
|
|
147
147
|
<div class="ai-gallery-item ${i===this.selectedImageIndex?"active":""}" data-index="${i}">
|
package/dist/three/index.css
CHANGED
|
@@ -2160,6 +2160,20 @@
|
|
|
2160
2160
|
background: var(--ui-surface-2);
|
|
2161
2161
|
}
|
|
2162
2162
|
|
|
2163
|
+
.ai-modal-body {
|
|
2164
|
+
padding: 18px 20px;
|
|
2165
|
+
background: var(--ui-surface);
|
|
2166
|
+
color: var(--ui-text);
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
.ai-section {
|
|
2170
|
+
margin-bottom: 16px;
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
.ai-section:last-child {
|
|
2174
|
+
margin-bottom: 0;
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2163
2177
|
.ai-modal-actions {
|
|
2164
2178
|
display: inline-flex;
|
|
2165
2179
|
align-items: center;
|
|
@@ -2408,6 +2422,17 @@
|
|
|
2408
2422
|
cursor: not-allowed;
|
|
2409
2423
|
}
|
|
2410
2424
|
|
|
2425
|
+
.ai-btn.primary {
|
|
2426
|
+
background: var(--ui-terracotta);
|
|
2427
|
+
color: var(--ui-text-white);
|
|
2428
|
+
border-color: var(--ui-terracotta);
|
|
2429
|
+
}
|
|
2430
|
+
|
|
2431
|
+
.ai-btn.primary:hover:not(:disabled) {
|
|
2432
|
+
background: var(--ui-terracotta-hover);
|
|
2433
|
+
border-color: var(--ui-terracotta-hover);
|
|
2434
|
+
}
|
|
2435
|
+
|
|
2411
2436
|
.ai-file {
|
|
2412
2437
|
display: none;
|
|
2413
2438
|
}
|
|
@@ -2447,6 +2472,12 @@
|
|
|
2447
2472
|
min-height: 140px;
|
|
2448
2473
|
}
|
|
2449
2474
|
|
|
2475
|
+
.ai-preview-placeholder {
|
|
2476
|
+
font-size: 12px;
|
|
2477
|
+
color: var(--ui-muted);
|
|
2478
|
+
text-align: center;
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2450
2481
|
.ai-preview img {
|
|
2451
2482
|
max-width: 100%;
|
|
2452
2483
|
max-height: 220px;
|