@7ots/cli 0.1.17 → 0.1.36

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.
Files changed (107) hide show
  1. package/.env.example +14 -0
  2. package/README.md +11 -0
  3. package/brand/logos/base.svg +1 -0
  4. package/brand/logos/clawpump.png +0 -0
  5. package/brand/logos/conductors.svg +1 -0
  6. package/brand/logos/notlogin.svg +12 -0
  7. package/brand/logos/pumpfun.png +0 -0
  8. package/brand/logos/solana.png +0 -0
  9. package/brand/logos/spawnerbot.svg +1 -0
  10. package/brand/logos/virtuals.png +0 -0
  11. package/cli/7ots.mjs +61 -1
  12. package/cli/lib/account.mjs +23 -3
  13. package/cli/lib/assistant.mjs +92 -14
  14. package/cli/lib/brain.mjs +84 -11
  15. package/cli/lib/card-shot.mjs +1 -1
  16. package/cli/lib/config.mjs +14 -3
  17. package/cli/lib/desktop-sync.mjs +177 -0
  18. package/cli/lib/i18n.mjs +9 -0
  19. package/cli/lib/inferences.mjs +19 -2
  20. package/cli/lib/integrations.mjs +98 -13
  21. package/cli/lib/mcp.mjs +1 -1
  22. package/cli/lib/open.mjs +3 -1
  23. package/cli/lib/pet-server.mjs +352 -41
  24. package/cli/lib/prompts.mjs +1 -1
  25. package/cli/lib/screen.mjs +1 -1
  26. package/cli/lib/senses/gestures.mjs +121 -0
  27. package/cli/lib/senses/index.mjs +490 -0
  28. package/cli/lib/senses/rules.mjs +159 -0
  29. package/cli/lib/senses/sources/activity.mjs +95 -0
  30. package/cli/lib/senses/sources/calendar.mjs +75 -0
  31. package/cli/lib/senses/sources/index.mjs +17 -0
  32. package/cli/lib/senses/sources/mail.mjs +48 -0
  33. package/cli/lib/senses/sources/system.mjs +39 -0
  34. package/cli/lib/senses/util.mjs +41 -0
  35. package/cli/lib/senses/vendor.mjs +78 -0
  36. package/cli/lib/stt-local.py +16 -8
  37. package/cli/lib/stt.mjs +53 -6
  38. package/cli/lib/tooluse.mjs +56 -0
  39. package/cli/lib/tts-local.mjs +2 -2
  40. package/cli/lib/vm.mjs +2 -2
  41. package/cli/lib/wake-local.py +109 -0
  42. package/cli/lib/wake.mjs +102 -0
  43. package/cli/pet/electron/main.cjs +190 -8
  44. package/cli/pet/pet.html +153 -34
  45. package/cli/pet/senses.html +342 -0
  46. package/cli/pet/settings.html +815 -74
  47. package/dist/7ots.esm.js +373 -146
  48. package/dist/7ots.esm.js.map +4 -4
  49. package/dist/7ots.iife.js +373 -146
  50. package/dist/7ots.iife.js.map +4 -4
  51. package/llms.txt +27 -0
  52. package/package.json +5 -2
  53. package/server/channels/apuchat.mjs +18 -4
  54. package/server/errors.mjs +90 -0
  55. package/server/notify.mjs +78 -0
  56. package/server/server.mjs +84 -14
  57. package/server/settings.mjs +3 -0
  58. package/server/site.mjs +401 -0
  59. package/server/tts.mjs +29 -5
  60. package/src/avatar/AvatarStage.js +2 -2
  61. package/src/avatar/three.js +3 -2
  62. package/src/character/AvatarEditor.js +2 -1
  63. package/src/character/Character.js +38 -5
  64. package/src/character/TradingCard.js +2 -0
  65. package/src/character/beat.js +64 -2
  66. package/src/character/mods/orc.js +8 -1
  67. package/src/character/mods.js +104 -10
  68. package/src/character/motion.js +252 -1
  69. package/src/character/parts.js +40 -38
  70. package/src/character/styles.js +40 -38
  71. package/src/character3d/Character3D.js +26 -5
  72. package/src/character3d/body.js +14 -12
  73. package/src/character3d/export.js +693 -0
  74. package/src/character3d/fx.js +13 -0
  75. package/src/character3d/index.js +2 -0
  76. package/src/character3d/materials.js +106 -10
  77. package/src/character3d/room-themes.js +1184 -0
  78. package/src/character3d/room.js +487 -0
  79. package/src/character3d/stage.js +14 -2
  80. package/src/creator/StepCreator.js +316 -0
  81. package/src/i18n/index.js +3 -3
  82. package/src/i18n/messages/character.js +352 -4
  83. package/src/i18n/messages/creator.js +138 -0
  84. package/src/i18n/messages/identity.js +89 -1
  85. package/src/i18n/messages/platform.js +270 -4
  86. package/src/i18n/messages/server.js +443 -1
  87. package/src/i18n/messages/widget.js +233 -0
  88. package/src/identity/random.js +14 -2
  89. package/src/identity/schema.js +2 -1
  90. package/src/index.js +9 -2
  91. package/src/voice/tags.js +22 -0
  92. package/server/platform/apuchat.mjs +0 -266
  93. package/server/platform/auth.mjs +0 -319
  94. package/server/platform/connect.mjs +0 -387
  95. package/server/platform/crypto.mjs +0 -80
  96. package/server/platform/db.mjs +0 -275
  97. package/server/platform/device.mjs +0 -222
  98. package/server/platform/integrations.mjs +0 -169
  99. package/server/platform/look.mjs +0 -20
  100. package/server/platform/mods.mjs +0 -222
  101. package/server/platform/orquesta.mjs +0 -577
  102. package/server/platform/profile.mjs +0 -161
  103. package/server/platform/routes.mjs +0 -542
  104. package/server/platform/runtime.mjs +0 -242
  105. package/server/platform/sites.mjs +0 -146
  106. package/server/platform/store.mjs +0 -456
  107. package/server/platform/vm.mjs +0 -1057
@@ -92,7 +92,7 @@ function keys(list) {
92
92
 
93
93
  /**
94
94
  * Gestos. { ms (duración por defecto), pose(t, ageMs) → pose, hands?: postura de manos,
95
- * wings?: 'slow'|'fast', fx?: [[t, efecto|metamorfosis, opts?]], hold?: se puede alargar con {ms} }.
95
+ * legs?: postura de patas (LEG_POSES), wings?: 'slow'|'fast', fx?: [[t, efecto|metamorfosis, opts?]], hold?: se puede alargar con {ms} }.
96
96
  * Se diseñan mirando a la derecha; con { dir: -1 } se reflejan x, r, lx y la mano activa.
97
97
  */
98
98
  const DAB = keys([[0, {}], [0.15, { sy: 0.9, sx: 1.06, y: 0.01, r: 4 }], [0.25, { r: -14, x: -0.03, sy: 1.02, ly: 0.7, lx: -0.5, blink: 0.4, curve: 0.5 }, 'out'], [0.85, { r: -14, x: -0.03, sy: 1.01, ly: 0.7, lx: -0.5, blink: 0.4, curve: 0.5 }], [1, {}]]);
@@ -199,6 +199,7 @@ export const GESTURES = {
199
199
  ms: 2600,
200
200
  hold: true,
201
201
  dance: 'funk',
202
+ legs: 'stomp',
202
203
  hands: 'dance',
203
204
  fx: [[0.05, 'notes']],
204
205
  pose: (t, age) => {
@@ -213,6 +214,7 @@ export const GESTURES = {
213
214
  ms: 6000,
214
215
  hold: true,
215
216
  dance: 'hype',
217
+ legs: 'floss',
216
218
  hands: 'floss',
217
219
  fx: [[0.04, 'notes']],
218
220
  pose: (t, age) => {
@@ -226,6 +228,7 @@ export const GESTURES = {
226
228
  ms: 6000,
227
229
  hold: true,
228
230
  dance: 'chip',
231
+ legs: 'robot',
229
232
  hands: 'robot',
230
233
  fx: [[0.04, 'notes']],
231
234
  pose: (t, age) => {
@@ -242,6 +245,7 @@ export const GESTURES = {
242
245
  ms: 6000,
243
246
  hold: true,
244
247
  dance: 'hype',
248
+ legs: 'shuffle',
245
249
  hands: 'pump',
246
250
  fx: [[0.04, 'notes']],
247
251
  pose: (t, age) => {
@@ -256,6 +260,7 @@ export const GESTURES = {
256
260
  ms: 4000,
257
261
  hold: true,
258
262
  dance: 'trap',
263
+ legs: 'wide',
259
264
  hands: 'dab',
260
265
  fx: [[0.08, 'sparkles']],
261
266
  // un golpe cada dos segundos (4 tiempos): se prepara, clava el dab y lo sostiene
@@ -271,6 +276,7 @@ export const GESTURES = {
271
276
  ms: 6000,
272
277
  hold: true,
273
278
  dance: 'funk',
279
+ legs: 'kick',
274
280
  hands: 'groove',
275
281
  fx: [[0.04, 'notes']],
276
282
  pose: (t, age) => {
@@ -284,6 +290,7 @@ export const GESTURES = {
284
290
  ms: 6000,
285
291
  hold: true,
286
292
  dance: 'chip',
293
+ legs: 'stomp',
287
294
  hands: 'armwave',
288
295
  fx: [[0.04, 'notes']],
289
296
  pose: (t, age) => {
@@ -296,6 +303,7 @@ export const GESTURES = {
296
303
  ms: 6000,
297
304
  hold: true,
298
305
  dance: 'funk',
306
+ legs: 'disco',
299
307
  hands: 'disco',
300
308
  fx: [[0.04, 'notes'], [0.04, 'sparkles']],
301
309
  pose: (t, age) => {
@@ -310,6 +318,7 @@ export const GESTURES = {
310
318
  ms: 6000,
311
319
  hold: true,
312
320
  dance: 'funk',
321
+ legs: 'moonwalk',
313
322
  hands: 'swing',
314
323
  fx: [[0.04, 'notes']],
315
324
  pose: (t, age) => {
@@ -324,6 +333,7 @@ export const GESTURES = {
324
333
  ms: 8000,
325
334
  hold: true,
326
335
  dance: 'hype',
336
+ legs: 'stomp',
327
337
  hands: 'routine',
328
338
  fx: [[0.04, 'notes']],
329
339
  pose: (t, age) => {
@@ -404,6 +414,105 @@ export const GESTURES = {
404
414
  return { r: S(age, 0.9) * 7 * e, x: S(age, 0.9, 1.2) * 0.03 * e, lx: S(age, 1.4) * 0.8 * e, ly: Math.cos((age / 1000) * TAU * 1.4) * 0.6 * e, curve: -0.1 * e, open: 0.15 * e, msx: 1 - 0.2 * e };
405
415
  },
406
416
  },
417
+ // ── farmeo de aura: poses de meme que suman aura. No son bailes: van aparte (`7ots aura`, su botón, su contador)
418
+ // y `aura` es su música (phonk o montagem de beat.js) ──
419
+ // six-seven: las palmas arriba, una sube y la otra baja, al compás, con cara de nada
420
+ sixseven: {
421
+ ms: 6000,
422
+ hold: true,
423
+ aura: 'montagem',
424
+ legs: 'wide',
425
+ hands: 'sixseven',
426
+ fx: [[0.04, 'aura'], [0.5, 'aura']],
427
+ pose: (t, age) => {
428
+ const e = env(t, 0.06, 0.08);
429
+ const w = snap(S(age, BEAT / 2));
430
+ return { r: w * 4 * e, x: w * 0.015 * e, y: -0.015 * Math.abs(S(age, BEAT)) * e, blink: 0.35 * e, curve: 0.15 * e, msx: 1 - 0.15 * e, lx: 0.2 * e };
431
+ },
432
+ },
433
+ // mirada sigma (mewing): quieto, mentón arriba, ojos a media asta, boca apretada; mira de reojo y vuelve a ti
434
+ mewing: {
435
+ ms: 6000,
436
+ hold: true,
437
+ aura: 'phonk',
438
+ legs: 'wide',
439
+ hands: 'hips',
440
+ fx: [[0.05, 'aura'], [0.55, 'aura']],
441
+ pose: (t, age) => {
442
+ const e = env(t, 0.12, 0.1);
443
+ const side = ((age / 1000) * (BEAT / 8)) % 1 < 0.5 ? 0.6 : 0;
444
+ return { r: -3 * e, y: -0.01 * e, sy: 1 + 0.02 * e, sx: 1 - 0.01 * e, blink: 0.45 * e, eye: 1 - 0.08 * e, lx: side * e, ly: -0.15 * e, curve: -0.05 * e, msx: 1 - 0.35 * e, lift: -1.5 * e };
445
+ },
446
+ },
447
+ // paso tikio: una mano arriba de reloj y la otra le marca la hora a golpes, mientras da una vuelta entera
448
+ tikio: {
449
+ ms: 6000,
450
+ hold: true,
451
+ aura: 'montagem',
452
+ legs: 'stomp',
453
+ hands: 'tikio',
454
+ fx: [[0.04, 'aura']],
455
+ pose: (t, age) => {
456
+ const e = env(t, 0.06, 0.08);
457
+ const f = ((age / 1000) * (BEAT / 8)) % 1; // una vuelta cada 8 tiempos
458
+ const turn = f > 0.5 ? EASE.inOut((f - 0.5) / 0.5) : 0;
459
+ const tick = Math.abs(S(age, BEAT));
460
+ return { sx: lerp(1, Math.cos(turn * TAU), e) * (1 - 0.02 * tick * e), sy: 1 + 0.02 * tick * e, y: -0.015 * tick * e, curve: 0.3 * e, blink: 0.3 * e };
461
+ },
462
+ },
463
+ // la garza: en una pata, las manos en triángulo sobre la cabeza, mirando con sospecha
464
+ garza: {
465
+ ms: 6000,
466
+ hold: true,
467
+ aura: 'phonk',
468
+ legs: 'garza',
469
+ hands: 'garza',
470
+ fx: [[0.05, 'aura'], [0.55, 'aura']],
471
+ pose: (t, age) => {
472
+ const e = env(t, 0.1, 0.08);
473
+ const wob = S(age, 0.7) * 0.6 + S(age, 1.9) * 0.4; // se balancea para no caerse
474
+ const look = ((age / 1000) * (BEAT / 4)) % 1 < 0.5 ? 0.7 : -0.7;
475
+ return { r: wob * 3 * e, x: wob * 0.01 * e, y: -0.02 * e, sy: 1 + 0.03 * e, blink: 0.5 * e, lx: look * e, curve: -0.25 * e, lift: -2 * e, msx: 1 - 0.25 * e };
476
+ },
477
+ },
478
+ // paso deal: pies rápidos coordinados y los codos que entran y salen juntos
479
+ deal: {
480
+ ms: 6000,
481
+ hold: true,
482
+ aura: 'montagem',
483
+ legs: 'deal',
484
+ hands: 'deal',
485
+ fx: [[0.04, 'aura']],
486
+ pose: (t, age) => {
487
+ const e = env(t, 0.06, 0.08);
488
+ const hop = Math.abs(S(age, BEAT * 2));
489
+ const side = snap(S(age, BEAT / 2));
490
+ return { x: side * 0.03 * e, r: -side * 3 * e, y: -0.025 * hop * e, sy: 1 + 0.03 * hop * e, curve: 0.4 * e, blink: 0.25 * e };
491
+ },
492
+ },
493
+ // festejo de futbolista: carrera, salto con giro y el «¡siuuu!» con los brazos abiertos; después, el dedo al cielo
494
+ siu: {
495
+ ms: 6000,
496
+ hold: true,
497
+ aura: 'phonk',
498
+ legs: 'siu',
499
+ hands: 'siu',
500
+ fx: [[0.3, 'aura'], [0.32, 'confetti']],
501
+ pose: (t, age) => {
502
+ const e = env(t, 0.04, 0.08);
503
+ const f = (age % 4000) / 4000;
504
+ if (f < 0.2) return { x: lerp(-0.05, 0.03, f / 0.2) * e, y: -0.02 * Math.abs(S(age, BEAT * 2)) * e, r: 6 * e, curve: 0.6 * e }; // corre
505
+ if (f < 0.4) {
506
+ const k = (f - 0.2) / 0.2; // salta y gira en el aire
507
+ return { x: 0.03 * e, y: -0.16 * Math.sin(Math.PI * k) * e, sx: lerp(1, Math.cos(EASE.inOut(k) * TAU), e), sy: 1 + 0.06 * Math.sin(Math.PI * k) * e, curve: 0.5 * e };
508
+ }
509
+ if (f < 0.75) {
510
+ const k = clamp((f - 0.4) / 0.06); // cae abierto: ¡siuuu!
511
+ return { x: 0.03 * e, sy: 1 - 0.08 * (1 - k) * e, sx: 1 + 0.06 * e, open: 0.85 * k * e, msx: 1 - 0.45 * e, curve: 0.1 * e, blink: 0.2 * e, lift: 2 * e };
512
+ }
513
+ return { x: 0.03 * e, ly: -0.8 * e, curve: 0.7 * e, lift: 1.5 * e, open: 0.1 * e }; // el dedo al cielo
514
+ },
515
+ },
407
516
  };
408
517
 
409
518
  /** Nombres alternativos (incluidos los gestos del avatar 3D de TalkingHead). */
@@ -417,6 +526,12 @@ export const GESTURE_ALIAS = {
417
526
  export const DANCES = Object.keys(GESTURES).filter((k) => GESTURES[k].dance);
418
527
  /** Baile → estilo de música (beat.js). */
419
528
  export const DANCE_STYLE = Object.fromEntries(DANCES.map((k) => [k, GESTURES[k].dance]));
529
+ /** El farmeo de aura (six-seven, mewing, tikio, garza, deal, siu): gestos con `aura`, aparte de los bailes. */
530
+ export const AURA_MOVES = Object.keys(GESTURES).filter((k) => GESTURES[k].aura);
531
+ /** Farmeo → su música (phonk o montagem, beat.js). */
532
+ export const AURA_STYLE = Object.fromEntries(AURA_MOVES.map((k) => [k, GESTURES[k].aura]));
533
+ /** Lo que suma cada farmeo (el número que flota: +67, +6.700…). */
534
+ export const AURA_POINTS = [67, 100, 420, 1000, 6700];
420
535
 
421
536
  // ───────────────────────────── manos ─────────────────────────────
422
537
 
@@ -481,6 +596,28 @@ export const HAND_POSES = {
481
596
  return { u: lerp(p0.u, p1.u, k), v: lerp(p0.v, p1.v, k), ang: lerp(p0.ang, p1.ang, k), type: 'open' };
482
597
  },
483
598
  cover: (s, a, dir, c) => ({ x: c.cx + s * c.sp, y: c.eyeY, ang: -8, type: 'open', s: 1.3 }),
599
+ // farmeo de aura
600
+ sixseven: (s, a) => {
601
+ const w = snap(S(a, BEAT / 2)) * s; // una palma sube mientras la otra baja
602
+ return { u: 1.32, v: -0.05 - w * 0.32, ang: 90, type: 'open', s: 1.05 };
603
+ },
604
+ tikio: (s, a, dir) => {
605
+ if (s !== dir) return { u: 0.35, v: -1.0, ang: s * 10, type: 'open' }; // el reloj, arriba
606
+ const k = Math.max(0, S(a, BEAT)) ** 1.5; // la otra le golpea la palma a cada tiempo
607
+ return { u: lerp(0.95, -0.15, k), v: lerp(-0.7, -0.95, k), ang: lerp(-20, -80, k), type: 'open' };
608
+ },
609
+ garza: (s, a) => ({ u: 0.28, v: -1.3 + 0.03 * S(a, 0.7), ang: -s * 38, type: 'open' }), // las puntas de los dedos se tocan sobre la cabeza
610
+ deal: (s, a) => {
611
+ const k = Math.max(0, S(a, BEAT * 2)) ** 1.2; // los dos codos a la vez, rápido
612
+ return { u: lerp(0.95, 1.3, k), v: lerp(0.2, 0.0, k), ang: lerp(150, 100, k), type: 'fist' };
613
+ },
614
+ siu: (s, a, dir) => {
615
+ const f = (a % 4000) / 4000;
616
+ if (f < 0.2) return { u: 1.1, v: 0.2 + s * S(a, BEAT * 2) * 0.25, ang: 160, type: 'fist' };
617
+ if (f < 0.4) return { u: 1.0, v: -0.6, ang: 20, type: 'open' };
618
+ if (f < 0.75) return { u: 1.45, v: 0.55, ang: 140, type: 'open' }; // brazos abiertos hacia abajo
619
+ return s === dir ? { u: 0.9, v: -1.25, ang: 0, type: 'point' } : { u: 1.0, v: 0.45, ang: 170, type: 'open' };
620
+ },
484
621
  };
485
622
 
486
623
  function handPos(pose, s, age, dir, c) {
@@ -580,6 +717,99 @@ function drawHands(c, k, age, o) {
580
717
  return [back, front, mask];
581
718
  }
582
719
 
720
+ // ───────────────────────────── patas ─────────────────────────────
721
+
722
+ /**
723
+ * Patas de los bailes: le salen por debajo, el cuerpo sube y los pies se quedan en el suelo,
724
+ * así cada salto, giro o vaivén las estira y dobla (de goma). (side, ageMs, dir) → { dx en
725
+ * anchos de cuerpo desde su sitio, lift en largos de pata, ang de la punta en grados }.
726
+ */
727
+ const FOOT_REST = { dx: 0, lift: 0, ang: 0 };
728
+ const tap = (a, hz, ph) => Math.max(0, S(a, hz, ph)) ** 1.5;
729
+ export const LEG_POSES = {
730
+ rest: () => FOOT_REST,
731
+ // pisa al compás, un pie y el otro
732
+ stomp: (s, a) => ({ dx: 0, lift: 0.38 * tap(a, BEAT / 2, s > 0 ? 0 : Math.PI), ang: -12 * tap(a, BEAT / 2, s > 0 ? 0 : Math.PI) }),
733
+ // running man: un pie adelante y el otro atrás, levantando la rodilla
734
+ shuffle: (s, a) => {
735
+ const ph = s > 0 ? 0 : Math.PI;
736
+ return { dx: 0.14 * S(a, BEAT / 2, ph), lift: 0.45 * tap(a, BEAT / 2, ph + Math.PI / 2), ang: -18 * tap(a, BEAT / 2, ph + Math.PI / 2) };
737
+ },
738
+ // a golpes: levanta un pie recto y lo planta
739
+ robot: (s, a) => {
740
+ const [i, k] = beatStep(a);
741
+ const up = (n) => ((n + (s > 0 ? 0 : 1)) % 2 ? 1 : 0);
742
+ const q = lerp(up(i - 1), up(i), k);
743
+ return { dx: 0.04 * q * s, lift: 0.3 * q, ang: 0 };
744
+ },
745
+ // las caderas van y vienen, los pies quietos y juntos: las patas se cruzan
746
+ floss: (s) => ({ dx: -s * 0.06, lift: 0, ang: 0 }),
747
+ // patada al costado cada cuatro tiempos
748
+ kick: (s, a, dir) => {
749
+ const b = ((a / 1000) * BEAT) % 4;
750
+ const kick = s === dir && b >= 2 && b < 3 ? Math.sin((b - 2) * Math.PI) : 0;
751
+ const bob = s !== dir ? 0 : 0.12 * tap(a, BEAT, 0) * (b < 2 ? 1 : 0);
752
+ return { dx: 0.3 * kick, lift: 0.9 * kick + bob, ang: -40 * kick };
753
+ },
754
+ // se desliza hacia atrás con un talón arriba (alternando)
755
+ moonwalk: (s, a) => {
756
+ const f = ((a / 1000) * (BEAT / 2)) % 1;
757
+ const which = Math.floor((a / 1000) * BEAT) % 2 ? 1 : -1;
758
+ const heel = s === which ? 0.22 : 0;
759
+ return { dx: -0.06 * Math.sin(f * TAU), lift: heel, ang: s === which ? 35 : 0 };
760
+ },
761
+ // marca el tiempo con la punta del pie de adelante
762
+ disco: (s, a, dir) => (s === dir ? { dx: 0.12, lift: 0.22 * tap(a, BEAT, 0), ang: -25 * tap(a, BEAT, 0) } : { dx: -0.03, lift: 0, ang: 0 }),
763
+ // bien abiertas y firmes
764
+ wide: (s) => ({ dx: s * 0.1, lift: 0, ang: 0 }),
765
+ // en una pata: la otra recogida a la altura de la rodilla
766
+ garza: (s, a, dir) => (s === dir ? { dx: -0.06, lift: 0.85, ang: -70 } : { dx: 0.02, lift: 0, ang: 0 }),
767
+ // pasos cortos y rápidos, cruzando y abriendo
768
+ deal: (s, a) => {
769
+ const ph = s > 0 ? 0 : Math.PI;
770
+ return { dx: 0.08 * snap(S(a, BEAT, ph)), lift: 0.25 * tap(a, BEAT * 2, ph), ang: -10 * tap(a, BEAT * 2, ph) };
771
+ },
772
+ // corre, salta con las dos y cae abierto
773
+ siu: (s, a) => {
774
+ const f = (a % 4000) / 4000;
775
+ if (f < 0.2) return { dx: 0.1 * S(a, BEAT * 2, s > 0 ? 0 : Math.PI), lift: 0.4 * tap(a, BEAT * 2, s > 0 ? 0 : Math.PI), ang: -15 };
776
+ if (f < 0.4) return { dx: 0, lift: 0.5 * Math.sin(Math.PI * ((f - 0.2) / 0.2)), ang: -20 };
777
+ return { dx: s * 0.14, lift: 0, ang: 0 };
778
+ },
779
+ };
780
+
781
+ /**
782
+ * Patas en coordenadas del mundo (no del cuerpo: los pies no siguen al cuerpo, se quedan en el
783
+ * suelo). c: { hips: [{x,y} izq, der], floor, cx, W, LL (largo), hr, aw, fill, line, lw }.
784
+ */
785
+ export function drawLegs(c, k, age, o = {}) {
786
+ if (k <= 0.01) return '';
787
+ const dir = o.dir || 1;
788
+ const fn = LEG_POSES[o.pose] || LEG_POSES.stomp;
789
+ let out = '';
790
+ for (const s of [-1, 1]) {
791
+ const p = fn(s, age, dir);
792
+ const hip = c.hips[s > 0 ? 1 : 0];
793
+ const fr = c.hr * 0.62;
794
+ const ax = c.cx + s * c.W * 0.17 + p.dx * c.W;
795
+ const ay = c.floor - fr * 0.9 - p.lift * c.LL;
796
+ const dx = ax - hip.x;
797
+ const dy = ay - hip.y;
798
+ const d = Math.hypot(dx, dy) || 1;
799
+ // rodilla de goma: cuanto más corta queda la pata, más se dobla hacia fuera
800
+ const bend = Math.sqrt(Math.max(0, c.LL * c.LL - d * d)) * 0.55 + d * 0.06;
801
+ const kx = (hip.x + ax) / 2 + s * bend;
802
+ const ky = (hip.y + ay) / 2;
803
+ const path = `M${R(hip.x)} ${R(hip.y)}Q${R(kx)} ${R(ky)} ${R(ax)} ${R(ay)}`;
804
+ const w = c.aw * 1.15 * Math.min(1, k);
805
+ out += `<path d="${path}" stroke="${c.line}" stroke-width="${R(w + c.lw * 2)}" fill="none" stroke-linecap="round"/><path d="${path}" stroke="${c.fill}" stroke-width="${R(w)}" fill="none" stroke-linecap="round"/>`;
806
+ // pie: zapatito redondo con la punta hacia fuera
807
+ const sc = Math.max(0.01, Math.min(1, k));
808
+ out += `<g transform="translate(${R(ax)} ${R(ay)}) scale(${R(s * sc)} ${R(sc)}) rotate(${R(p.ang)})"><ellipse cx="${R(c.hr * 0.45)}" cy="${R(fr * 0.35)}" rx="${R(c.hr * 1.05)}" ry="${R(fr)}" fill="${c.fill}" stroke="${c.line}" stroke-width="${c.lw}"/><path d="M${R(-c.hr * 0.45)} ${R(fr * 0.95)}H${R(c.hr * 1.3)}" stroke="${c.line}" stroke-width="${R(c.lw * 0.9)}" stroke-linecap="round" opacity=".5"/><ellipse cx="${R(c.hr * 0.85)}" cy="${R(-fr * 0.05)}" rx="${R(c.hr * 0.28)}" ry="${R(fr * 0.28)}" fill="#fff" opacity=".35"/></g>`;
809
+ }
810
+ return out;
811
+ }
812
+
583
813
  // ───────────────────────────── alas, pinchos, cuernos ─────────────────────────────
584
814
 
585
815
  const WING = 'M0 0C18 -36 64 -56 96 -44C88 -32 82 -28 72 -25C74 -14 66 -8 54 -8C54 3 42 8 30 6C20 11 7 9 0 0Z';
@@ -748,6 +978,27 @@ const at = (x, y, inner, extra = '') => `<g transform="translate(${R(x)} ${R(y)}
748
978
 
749
979
  /** Efectos: { ms, loop?, layer: 'face'|'front', draw(c, p 0..1, ageMs, o, rnd) }. */
750
980
  export const EFFECTS = {
981
+ // farmeo de aura: un halo que sube en llamitas violetas y el «+aura» flotando
982
+ aura: {
983
+ ms: 2600,
984
+ draw: (c, p, age, o, rnd) => {
985
+ const e = Math.min(clamp(p / 0.15), fade(p, 0.3));
986
+ let out = `<ellipse cx="${R(c.cx)}" cy="${R(c.top + c.H * 0.55)}" rx="${R(c.W * 0.62)}" ry="${R(c.H * 0.6)}" fill="none" stroke="#a78bfa" stroke-width="${R(c.W * 0.03)}" opacity="${R(0.35 * e)}"/>`;
987
+ for (let i = 0; i < 7; i++) {
988
+ const a = rnd() * TAU;
989
+ const q = ((p * 1.6 + i / 7) % 1);
990
+ const x = c.cx + Math.cos(a) * c.W * (0.45 + 0.1 * rnd());
991
+ const y = c.top + c.H * (0.9 - 0.9 * q);
992
+ const sz = c.W * 0.05 * Math.sin(Math.PI * q);
993
+ if (sz > 0.3) out += at(x, y, `<path d="M0 ${R(-sz * 2)}Q${R(sz)} 0 0 ${R(sz)}Q${R(-sz)} 0 0 ${R(-sz * 2)}Z" fill="#c4b5fd" opacity="${R(0.85 * e)}"/>`);
994
+ }
995
+ const k = c.W / 120;
996
+ const q = clamp(p / 0.8);
997
+ // el «+N aura» solo si te lo pasan (o.aura): el pet lo muestra él, encima del ot en 2D y en 3D
998
+ if (typeof o.aura === 'number') out += `<g opacity="${R(Math.min(clamp(p / 0.1), fade(p, 0.35)))}">${at(c.cx + c.dir * c.W * 0.5, c.top - c.H * 0.1 - c.H * 0.25 * EASE.out(q), `<text text-anchor="middle" font-family="system-ui,sans-serif" font-weight="900" font-size="15" fill="#7c3aed" stroke="#fff" stroke-width="3" paint-order="stroke">+${o.aura.toLocaleString('en-US')} aura</text>`, ` scale(${R(k)})`)}</g>`;
999
+ return out;
1000
+ },
1001
+ },
751
1002
  sparkles: {
752
1003
  ms: 1300,
753
1004
  draw: (c, p, age, o, rnd) => {
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * Nombres visibles: el `label` de cada pieza es solo el respaldo en español; la interfaz usa
13
13
  * partLabel(t, tipo, id), que lee `character.<tipo>.<id>` del catálogo de i18n
14
- * (src/i18n/messages/character.js). Una pieza nueva debe añadir su texto en es/en/pt allí
14
+ * (src/i18n/messages/character.js). Una pieza nueva debe añadir su texto en es/en/pt/zh/hi allí
15
15
  * (o con addMessages desde el sitio).
16
16
  */
17
17
 
@@ -135,38 +135,38 @@ export const SHAPES = [
135
135
  // ── catálogo 2 (2026-10): añadidas al final; las semillas antiguas no las sacan (ver CATALOG_V1) ──
136
136
  {
137
137
  id: 'peanut',
138
- label: 'Cacahuete', en: 'Peanut', pt: 'Amendoim',
138
+ label: 'Cacahuete', en: 'Peanut', pt: 'Amendoim', zh: '花生', hi: 'मूंगफली',
139
139
  points: superShape({ rxT: 56, rxB: 64, ryT: 72, ryB: 60, nT: 2.2, nB: 2.4, tweak: (i, x, y) => (i === 4 || i === 12 ? [100 + (x - 100) * 0.84, y + 4] : i === 3 || i === 13 ? [100 + (x - 100) * 1.04, y] : [x, y]) }),
140
140
  },
141
- { id: 'onigiri', label: 'Onigiri', en: 'Onigiri', pt: 'Onigiri', points: superShape({ rxT: 40, rxB: 72, ryT: 74, ryB: 54, nT: 1.5, nB: 3.4 }) },
142
- { id: 'bell', label: 'Campana', en: 'Bell', pt: 'Sino', points: superShape({ rxT: 48, rxB: 74, ryT: 72, ryB: 54, nT: 2.2, nB: 5.5 }) },
143
- { id: 'bun', label: 'Bollito', en: 'Bun', pt: 'Pãozinho', points: superShape({ rxT: 70, rxB: 74, ryT: 70, ryB: 40, nT: 2.1, nB: 5 }) },
141
+ { id: 'onigiri', label: 'Onigiri', en: 'Onigiri', pt: 'Onigiri', zh: '饭团', hi: 'ओनिगिरी', points: superShape({ rxT: 40, rxB: 72, ryT: 74, ryB: 54, nT: 1.5, nB: 3.4 }) },
142
+ { id: 'bell', label: 'Campana', en: 'Bell', pt: 'Sino', zh: '铃铛', hi: 'घंटी', points: superShape({ rxT: 48, rxB: 74, ryT: 72, ryB: 54, nT: 2.2, nB: 5.5 }) },
143
+ { id: 'bun', label: 'Bollito', en: 'Bun', pt: 'Pãozinho', zh: '小面包', hi: 'बन', points: superShape({ rxT: 70, rxB: 74, ryT: 70, ryB: 40, nT: 2.1, nB: 5 }) },
144
144
  {
145
145
  id: 'bear',
146
- label: 'Osito', en: 'Teddy', pt: 'Ursinho',
146
+ label: 'Osito', en: 'Teddy', pt: 'Ursinho', zh: '小熊', hi: 'टेडी',
147
147
  points: superShape({
148
148
  rxT: 60, rxB: 64, ryT: 62, ryB: 60, nT: 2.3, nB: 2.4,
149
149
  tweak: (i, x, y) => (i === 2 || i === 14 ? [x + (i === 2 ? 14 : -14), y - 16] : i === 1 || i === 15 ? [x, y + 6] : [x, y]),
150
150
  }),
151
151
  },
152
- { id: 'potato', label: 'Patata', en: 'Potato', pt: 'Batata', points: superShape({ rxT: 62, rxB: 66, ryT: 62, ryB: 58, nT: 2.3, nB: 2.5, tweak: (i, x, y) => [x + Math.sin(i * 2.9 + 1) * 6, y + Math.cos(i * 1.3 + 2) * 6] }) },
153
- { id: 'gem', label: 'Gema', en: 'Gem', pt: 'Gema', points: superShape({ rxT: 66, rxB: 66, ryT: 66, ryB: 70, nT: 1.35, nB: 1.35 }) },
154
- { id: 'chubby', label: 'Rechoncho', en: 'Chubby', pt: 'Fofinho', points: superShape({ rxT: 58, rxB: 82, ryT: 60, ryB: 46, nT: 2.2, nB: 3.2 }) },
155
- { id: 'capsule', label: 'Cápsula', en: 'Capsule', pt: 'Cápsula', points: superShape({ rxT: 48, rxB: 48, ryT: 78, ryB: 72, nT: 2.6, nB: 2.6 }) },
156
- { id: 'barrel', label: 'Tonel', en: 'Barrel', pt: 'Barril', points: superShape({ rxT: 64, rxB: 64, ryT: 64, ryB: 62, nT: 3, nB: 3, tweak: (i, x, y) => (i === 4 || i === 12 ? [100 + (x - 100) * 1.06, y] : [x, y]) }) },
157
- { id: 'flame', label: 'Llama', en: 'Flame', pt: 'Chama', points: superShape({ rxT: 40, rxB: 64, ryT: 80, ryB: 54, nT: 1.6, nB: 2.4, tweak: (i, x, y) => (i === 0 ? [x + 16, y + 4] : i === 1 ? [x + 6, y] : i === 15 ? [x + 8, y] : [x, y]) }) },
152
+ { id: 'potato', label: 'Patata', en: 'Potato', pt: 'Batata', zh: '土豆', hi: 'आलू', points: superShape({ rxT: 62, rxB: 66, ryT: 62, ryB: 58, nT: 2.3, nB: 2.5, tweak: (i, x, y) => [x + Math.sin(i * 2.9 + 1) * 6, y + Math.cos(i * 1.3 + 2) * 6] }) },
153
+ { id: 'gem', label: 'Gema', en: 'Gem', pt: 'Gema', zh: '宝石', hi: 'रत्न', points: superShape({ rxT: 66, rxB: 66, ryT: 66, ryB: 70, nT: 1.35, nB: 1.35 }) },
154
+ { id: 'chubby', label: 'Rechoncho', en: 'Chubby', pt: 'Fofinho', zh: '胖嘟嘟', hi: 'गोल-मटोल', points: superShape({ rxT: 58, rxB: 82, ryT: 60, ryB: 46, nT: 2.2, nB: 3.2 }) },
155
+ { id: 'capsule', label: 'Cápsula', en: 'Capsule', pt: 'Cápsula', zh: '胶囊', hi: 'कैप्सूल', points: superShape({ rxT: 48, rxB: 48, ryT: 78, ryB: 72, nT: 2.6, nB: 2.6 }) },
156
+ { id: 'barrel', label: 'Tonel', en: 'Barrel', pt: 'Barril', zh: '木桶', hi: 'पीपा', points: superShape({ rxT: 64, rxB: 64, ryT: 64, ryB: 62, nT: 3, nB: 3, tweak: (i, x, y) => (i === 4 || i === 12 ? [100 + (x - 100) * 1.06, y] : [x, y]) }) },
157
+ { id: 'flame', label: 'Llama', en: 'Flame', pt: 'Chama', zh: '火焰', hi: 'लौ', points: superShape({ rxT: 40, rxB: 64, ryT: 80, ryB: 54, nT: 1.6, nB: 2.4, tweak: (i, x, y) => (i === 0 ? [x + 16, y + 4] : i === 1 ? [x + 6, y] : i === 15 ? [x + 8, y] : [x, y]) }) },
158
158
  {
159
159
  id: 'owl',
160
- label: 'Búho', en: 'Owl', pt: 'Coruja',
160
+ label: 'Búho', en: 'Owl', pt: 'Coruja', zh: '猫头鹰', hi: 'उल्लू',
161
161
  points: superShape({
162
162
  rxT: 60, rxB: 64, ryT: 62, ryB: 60, nT: 3, nB: 2.4,
163
163
  tweak: (i, x, y) => (i === 2 || i === 14 ? [x + (i === 2 ? 4 : -4), y - 20] : i === 1 || i === 15 ? [x, y + 10] : i === 0 ? [x, y + 10] : [x, y]),
164
164
  }),
165
165
  },
166
- { id: 'slime', label: 'Slime', en: 'Slime', pt: 'Slime', points: superShape({ rxT: 56, rxB: 80, ryT: 78, ryB: 30, nT: 2, nB: 6, tweak: (i, x, y) => (i >= 6 && i <= 10 ? [x, y + (i % 2 ? 4 : -1)] : [x, y]) }) },
167
- { id: 'apple', label: 'Manzana', en: 'Apple', pt: 'Maçã', points: superShape({ rxT: 64, rxB: 60, ryT: 62, ryB: 62, nT: 2.4, nB: 2.2, tweak: (i, x, y) => (i === 0 ? [x, y + 12] : i === 1 || i === 15 ? [x, y + 2] : [x, y]) }) },
168
- { id: 'lemon', label: 'Limón', en: 'Lemon', pt: 'Limão', points: superShape({ rxT: 70, rxB: 70, ryT: 56, ryB: 56, nT: 2, nB: 2, tweak: (i, x, y) => (i === 4 || i === 12 ? [x + (i === 4 ? 12 : -12), y] : [x, y]) }) },
169
- { id: 'alien', label: 'Alien', en: 'Alien', pt: 'Alienígena', points: superShape({ rxT: 72, rxB: 44, ryT: 64, ryB: 66, nT: 2.3, nB: 1.7 }) },
166
+ { id: 'slime', label: 'Slime', en: 'Slime', pt: 'Slime', zh: '史莱姆', hi: 'स्लाइम', points: superShape({ rxT: 56, rxB: 80, ryT: 78, ryB: 30, nT: 2, nB: 6, tweak: (i, x, y) => (i >= 6 && i <= 10 ? [x, y + (i % 2 ? 4 : -1)] : [x, y]) }) },
167
+ { id: 'apple', label: 'Manzana', en: 'Apple', pt: 'Maçã', zh: '苹果', hi: 'सेब', points: superShape({ rxT: 64, rxB: 60, ryT: 62, ryB: 62, nT: 2.4, nB: 2.2, tweak: (i, x, y) => (i === 0 ? [x, y + 12] : i === 1 || i === 15 ? [x, y + 2] : [x, y]) }) },
168
+ { id: 'lemon', label: 'Limón', en: 'Lemon', pt: 'Limão', zh: '柠檬', hi: 'नींबू', points: superShape({ rxT: 70, rxB: 70, ryT: 56, ryB: 56, nT: 2, nB: 2, tweak: (i, x, y) => (i === 4 || i === 12 ? [x + (i === 4 ? 12 : -12), y] : [x, y]) }) },
169
+ { id: 'alien', label: 'Alien', en: 'Alien', pt: 'Alienígena', zh: '外星人', hi: 'एलियन', points: superShape({ rxT: 72, rxB: 44, ryT: 64, ryB: 66, nT: 2.3, nB: 1.7 }) },
170
170
  ];
171
171
 
172
172
  // ───────────────────────────── ojos ─────────────────────────────
@@ -424,13 +424,13 @@ export const FINISHES = [
424
424
  { id: 'neon', label: 'Neón' },
425
425
  { id: 'sketch', label: 'Boceto' },
426
426
  // catálogo 2 (2026-10): se dibujan en Character.js (FINISH2)
427
- { id: 'pastel', label: 'Pastel', en: 'Pastel', pt: 'Pastel', as3d: 'soft3d' },
428
- { id: 'metal', label: 'Metálico', en: 'Metallic', pt: 'Metálico', as3d: 'glossy' },
429
- { id: 'pearl', label: 'Nácar', en: 'Pearl', pt: 'Madrepérola', as3d: 'glossy' },
430
- { id: 'glass', label: 'Cristal', en: 'Glass', pt: 'Vidro', as3d: 'glossy' },
431
- { id: 'velvet', label: 'Terciopelo', en: 'Velvet', pt: 'Veludo', as3d: 'clay' },
432
- { id: 'holo', label: 'Holográfico', en: 'Holographic', pt: 'Holográfico', as3d: 'glossy' },
433
- { id: 'vinyl', label: 'Vinilo', en: 'Vinyl toy', pt: 'Vinil', as3d: 'toon' },
427
+ { id: 'pastel', label: 'Pastel', en: 'Pastel', pt: 'Pastel', zh: '粉彩', hi: 'पेस्टल' },
428
+ { id: 'metal', label: 'Metálico', en: 'Metallic', pt: 'Metálico', zh: '金属', hi: 'धात्विक' },
429
+ { id: 'pearl', label: 'Nácar', en: 'Pearl', pt: 'Madrepérola', zh: '珍珠', hi: 'मोती' },
430
+ { id: 'glass', label: 'Cristal', en: 'Glass', pt: 'Vidro', zh: '玻璃', hi: 'काँच' },
431
+ { id: 'velvet', label: 'Terciopelo', en: 'Velvet', pt: 'Veludo', zh: '天鹅绒', hi: 'मखमल' },
432
+ { id: 'holo', label: 'Holográfico', en: 'Holographic', pt: 'Holográfico', zh: '镭射', hi: 'होलोग्राफ़िक' },
433
+ { id: 'vinyl', label: 'Vinilo', en: 'Vinyl toy', pt: 'Vinil', zh: '搪胶玩具', hi: 'विनाइल खिलौना', as3d: 'toon' },
434
434
  ];
435
435
 
436
436
  // ───────────────────────────── texturas ─────────────────────────────
@@ -447,16 +447,16 @@ export const TEXTURES = [
447
447
  { id: 'ridges', label: 'Anillos' },
448
448
  { id: 'gloss', label: 'Gelatina' },
449
449
  { id: 'panels', label: 'Paneles' },
450
- // catálogo 2 (2026-10): solo se eligen a mano ('auto' nunca las saca)
451
- { id: 'knit', label: 'Punto', en: 'Knit', pt: 'Tricô', as3d: 'fuzz' },
452
- { id: 'polka', label: 'Lunares', en: 'Polka dots', pt: 'Bolinhas', as3d: 'speckles' },
453
- { id: 'glitter', label: 'Purpurina', en: 'Glitter', pt: 'Purpurina', as3d: 'speckles' },
454
- { id: 'stone', label: 'Piedra', en: 'Stone', pt: 'Pedra', as3d: 'speckles' },
455
- { id: 'wood', label: 'Madera', en: 'Wood', pt: 'Madeira', as3d: 'ridges' },
456
- { id: 'bubbles', label: 'Burbujas', en: 'Bubbles', pt: 'Bolhas', as3d: 'gloss' },
457
- { id: 'stitches', label: 'Costuras', en: 'Stitches', pt: 'Costuras', as3d: 'fuzz' },
458
- { id: 'honeycomb', label: 'Panal', en: 'Honeycomb', pt: 'Favo de mel', as3d: 'scales' },
459
- { id: 'quilt', label: 'Acolchado', en: 'Quilted', pt: 'Acolchoado', as3d: 'fuzz' },
450
+ // catálogo 2 (2026-10): solo se eligen a mano ('auto' nunca las saca); en 3D, skinTex2 de character3d/materials.js
451
+ { id: 'knit', label: 'Punto', en: 'Knit', pt: 'Tricô', zh: '针织', hi: 'बुनाई' },
452
+ { id: 'polka', label: 'Lunares', en: 'Polka dots', pt: 'Bolinhas', zh: '波点', hi: 'पोल्का डॉट्स' },
453
+ { id: 'glitter', label: 'Purpurina', en: 'Glitter', pt: 'Purpurina', zh: '亮片', hi: 'ग्लिटर' },
454
+ { id: 'stone', label: 'Piedra', en: 'Stone', pt: 'Pedra', zh: '石头', hi: 'पत्थर' },
455
+ { id: 'wood', label: 'Madera', en: 'Wood', pt: 'Madeira', zh: '木头', hi: 'लकड़ी' },
456
+ { id: 'bubbles', label: 'Burbujas', en: 'Bubbles', pt: 'Bolhas', zh: '泡泡', hi: 'बुलबुले' },
457
+ { id: 'stitches', label: 'Costuras', en: 'Stitches', pt: 'Costuras', zh: '缝线', hi: 'सिलाई' },
458
+ { id: 'honeycomb', label: 'Panal', en: 'Honeycomb', pt: 'Favo de mel', zh: '蜂巢', hi: 'मधुकोश' },
459
+ { id: 'quilt', label: 'Acolchado', en: 'Quilted', pt: 'Acolchoado', zh: '绗缝', hi: 'रज़ाई जैसा' },
460
460
  ];
461
461
 
462
462
  addCatalog({
@@ -673,16 +673,18 @@ export const CATALOG_V1 = { shapes: 16, eyes: 33, brows: 9, mouths: 28, cheeks:
673
673
  /** Listas por tipo (para partLabel). Moods y gestos viven en Character.js y solo tienen catálogo. */
674
674
  const CATALOG = { shapes: SHAPES, eyes: EYES, brows: BROWS, mouths: MOUTHS, cheeks: CHEEKS, patterns: PATTERNS, finishes: FINISHES, textures: TEXTURES, accessories: ACCESSORIES, groups: ACCESSORY_GROUPS, presets: PRESETS };
675
675
 
676
- // Textos en/pt de las piezas del catálogo 2 (llevan `en` y `pt` junto al `label` en español).
676
+ // Textos en/pt/zh/hi de las piezas del catálogo 2 (llevan `en`, `pt`, `zh` y `hi` junto al `label` en español).
677
+ // Si a una pieza le falta zh/hi, ese idioma cae al inglés.
677
678
  {
678
- const by = { es: {}, en: {}, pt: {} };
679
+ const LANGS = ['es', 'en', 'pt', 'zh', 'hi'];
680
+ const by = Object.fromEntries(LANGS.map((l) => [l, {}]));
679
681
  for (const [kind, list] of Object.entries(CATALOG)) {
680
682
  for (const x of list) {
681
683
  if (Array.isArray(x) || !x.en) continue;
682
- for (const l of ['es', 'en', 'pt']) (by[l][kind] ||= {})[x.id] = l === 'es' ? x.label : x[l];
684
+ for (const l of LANGS) (by[l][kind] ||= {})[x.id] = l === 'es' ? x.label : x[l] || x.en;
683
685
  }
684
686
  }
685
- addCatalog({ es: { character: by.es }, en: { character: by.en }, pt: { character: by.pt } });
687
+ addCatalog(Object.fromEntries(LANGS.map((l) => [l, { character: by[l] }])));
686
688
  }
687
689
 
688
690
  const ALIAS3D = Object.fromEntries(['eyes', 'brows', 'mouths', 'cheeks', 'patterns', 'accessories', 'finishes', 'textures'].map((k) => [k, Object.fromEntries(CATALOG[k].filter((x) => x.as3d).map((x) => [x.id, x.as3d]))]));
@@ -27,55 +27,57 @@ import { addCatalog } from '../i18n/index.js';
27
27
  const n = (v) => Math.round(v * 100) / 100;
28
28
 
29
29
  export const STYLES = [
30
- { id: 'none', label: { es: 'Ninguno', en: 'None', pt: 'Nenhum' } },
31
- { id: 'ukiyoe', label: { es: 'Ukiyo-e', en: 'Ukiyo-e', pt: 'Ukiyo-e' } },
32
- { id: 'clay', label: { es: 'Plastilina', en: 'Claymation', pt: 'Massinha' } },
33
- { id: 'glass', label: { es: 'Vitral', en: 'Stained glass', pt: 'Vitral' } },
34
- { id: 'bauhaus', label: { es: 'Bauhaus', en: 'Bauhaus', pt: 'Bauhaus' } },
35
- { id: 'manuscript', label: { es: 'Manuscrito', en: 'Manuscript', pt: 'Iluminura' } },
36
- { id: 'glitch', label: { es: 'Glitch', en: 'Glitch', pt: 'Glitch' } },
37
- { id: 'ink', label: { es: 'Tinta', en: 'Ink sketch', pt: 'Nanquim' } },
38
- { id: 'pop', label: { es: 'Pop art', en: 'Pop art', pt: 'Pop art' } },
39
- { id: 'watercolor', label: { es: 'Acuarela', en: 'Watercolor', pt: 'Aquarela' } },
40
- { id: 'pixel', label: { es: 'Píxel 8 bits', en: '8-bit pixel', pt: 'Pixel 8 bits' } },
41
- { id: 'synthwave', label: { es: 'Synthwave', en: 'Synthwave', pt: 'Synthwave' } },
42
- { id: 'nouveau', label: { es: 'Art nouveau', en: 'Art nouveau', pt: 'Art nouveau' } },
43
- { id: 'cubism', label: { es: 'Cubismo', en: 'Cubism', pt: 'Cubismo' } },
44
- { id: 'crayon', label: { es: 'Crayones', en: 'Crayon', pt: 'Giz de cera' } },
45
- { id: 'blueprint', label: { es: 'Plano técnico', en: 'Blueprint', pt: 'Planta técnica' } },
46
- { id: 'pointillism', label: { es: 'Puntillismo', en: 'Pointillism', pt: 'Pontilhismo' } },
47
- { id: 'woodcut', label: { es: 'Xilografía', en: 'Woodcut', pt: 'Xilogravura' } },
48
- { id: 'riso', label: { es: 'Risografía', en: 'Riso print', pt: 'Risografia' } },
49
- { id: 'dotmatrix', label: { es: 'Matriz verde', en: 'Dot matrix', pt: 'Matriz verde' } },
50
- { id: 'chalk', label: { es: 'Tiza', en: 'Chalk', pt: 'Giz' } },
51
- { id: 'sticker', label: { es: 'Calcomanía', en: 'Sticker', pt: 'Adesivo' } },
52
- { id: 'felt', label: { es: 'Fieltro', en: 'Felt', pt: 'Feltro' } },
53
- { id: 'papercut', label: { es: 'Papel recortado', en: 'Papercut', pt: 'Papel recortado' } },
54
- { id: 'lowpoly', label: { es: 'Low poly', en: 'Low poly', pt: 'Low poly' } },
55
- { id: 'marble', label: { es: 'Mármol', en: 'Marble', pt: 'Mármore' } },
56
- { id: 'candy', label: { es: 'Gomita', en: 'Gummy', pt: 'Bala de goma' } },
57
- { id: 'holo', label: { es: 'Holográfico', en: 'Holographic', pt: 'Holográfico' } },
58
- { id: 'sumie', label: { es: 'Sumi-e', en: 'Sumi-e', pt: 'Sumi-e' } },
59
- { id: 'tarot', label: { es: 'Tarot', en: 'Tarot', pt: 'Tarô' } },
60
- { id: 'retro70', label: { es: 'Años 70', en: 'Seventies', pt: 'Anos 70' } },
61
- { id: 'mosaic', label: { es: 'Mosaico', en: 'Mosaic', pt: 'Mosaico' } },
62
- { id: 'neonsign', label: { es: 'Letrero de neón', en: 'Neon sign', pt: 'Letreiro neon' } },
63
- { id: 'graffiti', label: { es: 'Grafiti', en: 'Graffiti', pt: 'Grafite' } },
64
- { id: 'thermal', label: { es: 'Cámara térmica', en: 'Thermal', pt: 'Câmera térmica' } },
30
+ { id: 'none', label: { es: 'Ninguno', en: 'None', pt: 'Nenhum', zh: '无', hi: 'कोई नहीं' } },
31
+ { id: 'ukiyoe', label: { es: 'Ukiyo-e', en: 'Ukiyo-e', pt: 'Ukiyo-e', zh: '浮世绘', hi: 'उकियो-ए' } },
32
+ { id: 'clay', label: { es: 'Plastilina', en: 'Claymation', pt: 'Massinha', zh: '黏土动画', hi: 'क्ले एनिमेशन' } },
33
+ { id: 'glass', label: { es: 'Vitral', en: 'Stained glass', pt: 'Vitral', zh: '彩色玻璃', hi: 'रंगीन काँच' } },
34
+ { id: 'bauhaus', label: { es: 'Bauhaus', en: 'Bauhaus', pt: 'Bauhaus', zh: '包豪斯', hi: 'बाउहाउस' } },
35
+ { id: 'manuscript', label: { es: 'Manuscrito', en: 'Manuscript', pt: 'Iluminura', zh: '泥金手抄本', hi: 'पांडुलिपि' } },
36
+ { id: 'glitch', label: { es: 'Glitch', en: 'Glitch', pt: 'Glitch', zh: '故障风', hi: 'ग्लिच' } },
37
+ { id: 'ink', label: { es: 'Tinta', en: 'Ink sketch', pt: 'Nanquim', zh: '墨水速写', hi: 'स्याही स्केच' } },
38
+ { id: 'pop', label: { es: 'Pop art', en: 'Pop art', pt: 'Pop art', zh: '波普艺术', hi: 'पॉप आर्ट' } },
39
+ { id: 'watercolor', label: { es: 'Acuarela', en: 'Watercolor', pt: 'Aquarela', zh: '水彩', hi: 'जलरंग' } },
40
+ { id: 'pixel', label: { es: 'Píxel 8 bits', en: '8-bit pixel', pt: 'Pixel 8 bits', zh: '8 位像素', hi: '8-बिट पिक्सेल' } },
41
+ { id: 'synthwave', label: { es: 'Synthwave', en: 'Synthwave', pt: 'Synthwave', zh: '合成波', hi: 'सिंथवेव' } },
42
+ { id: 'nouveau', label: { es: 'Art nouveau', en: 'Art nouveau', pt: 'Art nouveau', zh: '新艺术', hi: 'आर्ट नूवो' } },
43
+ { id: 'cubism', label: { es: 'Cubismo', en: 'Cubism', pt: 'Cubismo', zh: '立体主义', hi: 'घनवाद' } },
44
+ { id: 'crayon', label: { es: 'Crayones', en: 'Crayon', pt: 'Giz de cera', zh: '蜡笔', hi: 'क्रेयॉन' } },
45
+ { id: 'blueprint', label: { es: 'Plano técnico', en: 'Blueprint', pt: 'Planta técnica', zh: '蓝图', hi: 'ब्लूप्रिंट' } },
46
+ { id: 'pointillism', label: { es: 'Puntillismo', en: 'Pointillism', pt: 'Pontilhismo', zh: '点彩画', hi: 'बिंदुवाद' } },
47
+ { id: 'woodcut', label: { es: 'Xilografía', en: 'Woodcut', pt: 'Xilogravura', zh: '木刻', hi: 'काष्ठ छापा' } },
48
+ { id: 'riso', label: { es: 'Risografía', en: 'Riso print', pt: 'Risografia', zh: '孔版印刷', hi: 'रिसो प्रिंट' } },
49
+ { id: 'dotmatrix', label: { es: 'Matriz verde', en: 'Dot matrix', pt: 'Matriz verde', zh: '点阵', hi: 'डॉट मैट्रिक्स' } },
50
+ { id: 'chalk', label: { es: 'Tiza', en: 'Chalk', pt: 'Giz', zh: '粉笔', hi: 'चॉक' } },
51
+ { id: 'sticker', label: { es: 'Calcomanía', en: 'Sticker', pt: 'Adesivo', zh: '贴纸', hi: 'स्टिकर' } },
52
+ { id: 'felt', label: { es: 'Fieltro', en: 'Felt', pt: 'Feltro', zh: '毛毡', hi: 'फ़ेल्ट' } },
53
+ { id: 'papercut', label: { es: 'Papel recortado', en: 'Papercut', pt: 'Papel recortado', zh: '剪纸', hi: 'पेपरकट' } },
54
+ { id: 'lowpoly', label: { es: 'Low poly', en: 'Low poly', pt: 'Low poly', zh: '低多边形', hi: 'लो पॉली' } },
55
+ { id: 'marble', label: { es: 'Mármol', en: 'Marble', pt: 'Mármore', zh: '大理石', hi: 'संगमरमर' } },
56
+ { id: 'candy', label: { es: 'Gomita', en: 'Gummy', pt: 'Bala de goma', zh: '软糖', hi: 'गमी' } },
57
+ { id: 'holo', label: { es: 'Holográfico', en: 'Holographic', pt: 'Holográfico', zh: '镭射', hi: 'होलोग्राफ़िक' } },
58
+ { id: 'sumie', label: { es: 'Sumi-e', en: 'Sumi-e', pt: 'Sumi-e', zh: '水墨画', hi: 'सुमी-ए' } },
59
+ { id: 'tarot', label: { es: 'Tarot', en: 'Tarot', pt: 'Tarô', zh: '塔罗', hi: 'टैरो' } },
60
+ { id: 'retro70', label: { es: 'Años 70', en: 'Seventies', pt: 'Anos 70', zh: '七十年代', hi: 'सत्तर का दशक' } },
61
+ { id: 'mosaic', label: { es: 'Mosaico', en: 'Mosaic', pt: 'Mosaico', zh: '马赛克', hi: 'मोज़ेक' } },
62
+ { id: 'neonsign', label: { es: 'Letrero de neón', en: 'Neon sign', pt: 'Letreiro neon', zh: '霓虹招牌', hi: 'नियॉन साइन' } },
63
+ { id: 'graffiti', label: { es: 'Grafiti', en: 'Graffiti', pt: 'Grafite', zh: '涂鸦', hi: 'ग्राफ़िटी' } },
64
+ { id: 'thermal', label: { es: 'Cámara térmica', en: 'Thermal', pt: 'Câmera térmica', zh: '热成像', hi: 'थर्मल' } },
65
65
  ];
66
66
  export const STYLE_IDS = STYLES.map((s) => s.id);
67
67
 
68
68
  const lang = (l) => ({
69
- character: { styles: Object.fromEntries(STYLES.map((s) => [s.id, s.label[l]])) },
69
+ character: { styles: Object.fromEntries(STYLES.map((s) => [s.id, s.label[l] || s.label.en])) },
70
70
  editor: {
71
71
  artStyle: {
72
72
  es: { title: 'Estilo artístico', hint: 'Redibuja el mismo personaje en otro estilo, con un fondo a juego.' },
73
73
  en: { title: 'Art style', hint: 'Redraws the same character in another art style, with a matching backdrop.' },
74
74
  pt: { title: 'Estilo artístico', hint: 'Redesenha o mesmo personagem em outro estilo, com um fundo combinando.' },
75
+ zh: { title: '艺术风格', hint: '用另一种艺术风格重新绘制同一个角色,并配上相称的背景。' },
76
+ hi: { title: 'कला शैली', hint: 'उसी किरदार को दूसरी कला शैली में फिर से बनाता है, मेल खाती पृष्ठभूमि के साथ।' },
75
77
  }[l],
76
78
  },
77
79
  });
78
- addCatalog({ es: lang('es'), en: lang('en'), pt: lang('pt') });
80
+ addCatalog(Object.fromEntries(['es', 'en', 'pt', 'zh', 'hi'].map((l) => [l, lang(l)])));
79
81
 
80
82
  // ───────────────────────────── color ─────────────────────────────
81
83
 
@@ -467,7 +469,7 @@ export function stylizeSpec(spec) {
467
469
  a.color2 = m(a.color2, 'acc');
468
470
  }
469
471
  s.finish = look.finish;
470
- s.texture = look.texture;
472
+ s.texture = spec.texture && spec.texture !== 'auto' ? spec.texture : look.texture; // a texture the owner picked wins over the style's
471
473
  s._style = { id, seed: styleSeed(spec), ink: typeof look.ink === 'function' ? look.ink(s) : look.ink, lw: look.lw };
472
474
  return s;
473
475
  }