@wallarm-org/design-system 4.6.2 → 4.7.0

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 (69) hide show
  1. package/dist/components/AgentAvatar/AgentAvatar.d.ts +45 -0
  2. package/dist/components/AgentAvatar/AgentAvatar.js +544 -0
  3. package/dist/components/AgentAvatar/AgentAvatarGroup.d.ts +12 -0
  4. package/dist/components/AgentAvatar/AgentAvatarGroup.js +25 -0
  5. package/dist/components/AgentAvatar/index.d.ts +4 -0
  6. package/dist/components/AgentAvatar/index.js +3 -0
  7. package/dist/components/AgentAvatar/useBakedLayers.d.ts +9 -0
  8. package/dist/components/AgentAvatar/useBakedLayers.js +75 -0
  9. package/dist/components/AgentAvatar/useCharacter.d.ts +39 -0
  10. package/dist/components/AgentAvatar/useCharacter.js +251 -0
  11. package/dist/components/AgentGlyph/AgentGlyph.d.ts +30 -0
  12. package/dist/components/AgentGlyph/AgentGlyph.js +192 -0
  13. package/dist/components/AgentGlyph/index.d.ts +4 -0
  14. package/dist/components/AgentGlyph/index.js +2 -0
  15. package/dist/components/AgentLookBuilder/index.d.ts +3 -0
  16. package/dist/components/AgentLookBuilder/index.js +2 -0
  17. package/dist/components/AgentLookBuilder/kit.d.ts +36 -0
  18. package/dist/components/AgentLookBuilder/kit.js +30 -0
  19. package/dist/components/Chat/ChatGreeting.d.ts +1 -1
  20. package/dist/components/Chat/ChatGreeting.js +95 -44
  21. package/dist/components/Chat/ChatHeaderTitle.d.ts +1 -1
  22. package/dist/components/Chat/ChatHeaderTitle.js +32 -29
  23. package/dist/components/WallySkeleton/WallySkeleton.js +92 -71
  24. package/dist/index.d.ts +2 -0
  25. package/dist/index.js +2 -0
  26. package/dist/lib/agent-characters/bake.d.ts +40 -0
  27. package/dist/lib/agent-characters/bake.js +220 -0
  28. package/dist/lib/agent-characters/canvas.d.ts +7 -0
  29. package/dist/lib/agent-characters/canvas.js +22 -0
  30. package/dist/lib/agent-characters/char.d.ts +32 -0
  31. package/dist/lib/agent-characters/char.js +375 -0
  32. package/dist/lib/agent-characters/color.d.ts +6 -0
  33. package/dist/lib/agent-characters/color.js +20 -0
  34. package/dist/lib/agent-characters/data.gen.d.ts +106 -0
  35. package/dist/lib/agent-characters/data.gen.js +3854 -0
  36. package/dist/lib/agent-characters/engine.d.ts +206 -0
  37. package/dist/lib/agent-characters/engine.js +1241 -0
  38. package/dist/lib/agent-characters/eyes.d.ts +18 -0
  39. package/dist/lib/agent-characters/eyes.js +132 -0
  40. package/dist/lib/agent-characters/geom.d.ts +23 -0
  41. package/dist/lib/agent-characters/geom.js +109 -0
  42. package/dist/lib/agent-characters/glyph.d.ts +21 -0
  43. package/dist/lib/agent-characters/glyph.js +126 -0
  44. package/dist/lib/agent-characters/look.d.ts +24 -0
  45. package/dist/lib/agent-characters/look.js +68 -0
  46. package/dist/lib/agent-characters/motion.d.ts +73 -0
  47. package/dist/lib/agent-characters/motion.js +1215 -0
  48. package/dist/lib/agent-characters/paths.d.ts +13 -0
  49. package/dist/lib/agent-characters/paths.js +118 -0
  50. package/dist/lib/agent-characters/places.d.ts +76 -0
  51. package/dist/lib/agent-characters/places.js +64 -0
  52. package/dist/lib/agent-characters/propOf.d.ts +7 -0
  53. package/dist/lib/agent-characters/propOf.js +20 -0
  54. package/dist/lib/agent-characters/props.d.ts +4 -0
  55. package/dist/lib/agent-characters/props.js +337 -0
  56. package/dist/lib/agent-characters/queue.d.ts +23 -0
  57. package/dist/lib/agent-characters/queue.js +73 -0
  58. package/dist/lib/agent-characters/runtime.d.ts +69 -0
  59. package/dist/lib/agent-characters/runtime.js +178 -0
  60. package/dist/lib/agent-characters/svg.d.ts +6 -0
  61. package/dist/lib/agent-characters/svg.js +6 -0
  62. package/dist/lib/agent-characters/worker.d.ts +6 -0
  63. package/dist/lib/agent-characters/worker.js +94 -0
  64. package/dist/metadata/components.json +689 -276
  65. package/dist/theme/components/agent-avatar.css +42 -0
  66. package/dist/theme/index.css +1 -0
  67. package/dist/utils/renderSvgNode.d.ts +4 -0
  68. package/dist/utils/renderSvgNode.js +12 -0
  69. package/package.json +2 -1
@@ -0,0 +1,1215 @@
1
+ import { clamp, r2 } from "./paths.js";
2
+ const lerp = (a, b, t)=>a + (b - a) * t;
3
+ const cb = (x1, y1, x2, y2)=>(t)=>{
4
+ let u = t;
5
+ for(let i = 0; i < 6; i++){
6
+ const x = 3 * (1 - u) * (1 - u) * u * x1 + 3 * (1 - u) * u * u * x2 + u * u * u - t;
7
+ const dx = 3 * (1 - u) * (1 - u) * x1 + 6 * (1 - u) * u * (x2 - x1) + 3 * u * u * (1 - x2);
8
+ if (Math.abs(dx) < 1e-6) break;
9
+ u = clamp(u - x / dx, 0, 1);
10
+ }
11
+ return 3 * (1 - u) * (1 - u) * u * y1 + 3 * (1 - u) * u * u * y2 + u * u * u;
12
+ };
13
+ const E_SETTLE = cb(0.22, 1, 0.36, 1);
14
+ const E_GRAV = cb(0.55, 0, 1, 0.45);
15
+ const E_RISE = cb(0.2, 0.7, 0.3, 1);
16
+ const E_INOUT = cb(0.45, 0, 0.55, 1);
17
+ const E_FILL = cb(0.3, 0.7, 0.2, 1);
18
+ const E_OUT = cb(0.15, 0.85, 0.35, 1);
19
+ const E_IN = cb(0.6, 0, 0.9, 0.4);
20
+ const E_LIN = (t)=>t;
21
+ function gauss(r) {
22
+ let u = 0;
23
+ let v = 0;
24
+ while(!u)u = r();
25
+ while(!v)v = r();
26
+ return Math.sqrt(-2 * Math.log(u)) * Math.cos(2 * Math.PI * v);
27
+ }
28
+ const logn = (r, med, s, lo, hi)=>clamp(med * Math.exp(s * gauss(r)), lo, hi);
29
+ const SPR = (T, z)=>{
30
+ const w = 2 * Math.PI / T;
31
+ return {
32
+ k: w * w,
33
+ c: 2 * z * w
34
+ };
35
+ };
36
+ const P_SHAPE = SPR(0.28, 0.8);
37
+ const P_POP = SPR(0.32, 0.45);
38
+ const P_DART = SPR(0.12, 0.65);
39
+ const P_PURSUIT = SPR(0.3, 0.85);
40
+ const P_BRIGHT = SPR(0.2, 1);
41
+ const P_SQ = SPR(0.22, 0.3);
42
+ const P_LAND = SPR(0.35, 0.4);
43
+ const P_W = SPR(0.6, 1);
44
+ const spring = (x, p)=>({
45
+ x,
46
+ v: 0,
47
+ t: x,
48
+ p
49
+ });
50
+ function stepS(s, dt) {
51
+ const n = Math.ceil(240 * dt);
52
+ const h = dt / n;
53
+ for(let i = 0; i < n; i++){
54
+ s.v += (-s.p.k * (s.x - s.t) - s.p.c * s.v) * h;
55
+ s.x += s.v * h;
56
+ }
57
+ }
58
+ const NOX = {};
59
+ const kx = (t, x, e)=>[
60
+ t,
61
+ 0,
62
+ 1,
63
+ 0,
64
+ e || null,
65
+ x
66
+ ];
67
+ function osc(ch, t0, amps, per, end) {
68
+ const ks = [
69
+ kx(t0, {
70
+ [ch]: 0
71
+ })
72
+ ];
73
+ amps.forEach((a, i)=>{
74
+ ks.push(kx(t0 + per / 4 + i * per / 2, {
75
+ [ch]: a
76
+ }, E_INOUT));
77
+ });
78
+ ks.push(kx(end, {
79
+ [ch]: 0
80
+ }, E_SETTLE));
81
+ return ks;
82
+ }
83
+ const BEAT = [
84
+ [
85
+ 0,
86
+ 0,
87
+ 1,
88
+ 0,
89
+ null,
90
+ {
91
+ gx: 0,
92
+ gy: 0,
93
+ br: 0
94
+ }
95
+ ],
96
+ [
97
+ 40,
98
+ 0,
99
+ 1,
100
+ 0,
101
+ E_LIN,
102
+ {
103
+ gx: 0.12,
104
+ gy: 0.05,
105
+ br: -0.4
106
+ }
107
+ ],
108
+ [
109
+ 80,
110
+ 0,
111
+ 1,
112
+ 0,
113
+ E_LIN,
114
+ {
115
+ gx: -0.08,
116
+ gy: 0,
117
+ br: 0.1
118
+ }
119
+ ],
120
+ [
121
+ 120,
122
+ 0,
123
+ 1,
124
+ 0,
125
+ E_LIN,
126
+ {
127
+ gx: 0.04,
128
+ gy: 0.03,
129
+ br: -0.3
130
+ }
131
+ ],
132
+ [
133
+ 160,
134
+ 0,
135
+ 1,
136
+ 0,
137
+ E_LIN,
138
+ {
139
+ gx: 0,
140
+ gy: 0,
141
+ br: 0
142
+ }
143
+ ],
144
+ [
145
+ 280,
146
+ 0,
147
+ 1,
148
+ -2.4,
149
+ E_INOUT,
150
+ {
151
+ gx: -0.42,
152
+ gy: 0,
153
+ br: 0
154
+ }
155
+ ],
156
+ [
157
+ 420,
158
+ 0,
159
+ 1,
160
+ 2.2,
161
+ E_INOUT,
162
+ {
163
+ gx: 0.42,
164
+ gy: 0,
165
+ br: 0
166
+ }
167
+ ],
168
+ [
169
+ 550,
170
+ 0,
171
+ 1,
172
+ -1.1,
173
+ E_INOUT,
174
+ {
175
+ gx: -0.2,
176
+ gy: 0,
177
+ br: 0
178
+ }
179
+ ],
180
+ [
181
+ 680,
182
+ 0,
183
+ 1,
184
+ 0,
185
+ E_SETTLE,
186
+ {
187
+ gx: 0,
188
+ gy: 0,
189
+ br: 0
190
+ }
191
+ ]
192
+ ];
193
+ const HELLO_TILT = [
194
+ [
195
+ 0,
196
+ 0,
197
+ 1,
198
+ 0
199
+ ],
200
+ [
201
+ 430,
202
+ 0,
203
+ 1,
204
+ 0
205
+ ],
206
+ [
207
+ 650,
208
+ 0,
209
+ 1,
210
+ -6,
211
+ E_OUT
212
+ ],
213
+ [
214
+ 790,
215
+ 0,
216
+ 1,
217
+ -6
218
+ ],
219
+ [
220
+ 1130,
221
+ 0,
222
+ 1,
223
+ 6,
224
+ E_INOUT
225
+ ],
226
+ [
227
+ 1270,
228
+ 0,
229
+ 1,
230
+ 6
231
+ ],
232
+ [
233
+ 1600,
234
+ 0,
235
+ 1,
236
+ 0,
237
+ E_SETTLE
238
+ ]
239
+ ];
240
+ const HELLO_PROP = {
241
+ twitch: osc('pa', 250, [
242
+ 12,
243
+ -12,
244
+ 11,
245
+ -10,
246
+ 8,
247
+ -5
248
+ ], 420, 1650),
249
+ flutter: osc('pa', 250, [
250
+ 14,
251
+ -14,
252
+ 13,
253
+ -12,
254
+ 10,
255
+ -7
256
+ ], 300, 1350),
257
+ sway: osc('pa', 250, [
258
+ 10,
259
+ -10,
260
+ 8,
261
+ -6
262
+ ], 560, 1650),
263
+ scan: osc('pa', 250, [
264
+ 14,
265
+ -14,
266
+ 10
267
+ ], 640, 1450),
268
+ sweep: osc('pa', 250, [
269
+ 10,
270
+ -10,
271
+ 8,
272
+ -5
273
+ ], 560, 1650),
274
+ turn: [
275
+ kx(0, {
276
+ pw: 0
277
+ }),
278
+ kx(250, {
279
+ pw: 0
280
+ }),
281
+ kx(1250, {
282
+ pw: 360
283
+ }, E_INOUT)
284
+ ],
285
+ spin: [
286
+ kx(0, {
287
+ pw: 0
288
+ }),
289
+ kx(250, {
290
+ pw: 0
291
+ }),
292
+ kx(1450, {
293
+ pw: 720
294
+ }, E_INOUT)
295
+ ],
296
+ flicker: [
297
+ kx(0, {
298
+ bm: 0,
299
+ pb: 0
300
+ }),
301
+ kx(250, {
302
+ bm: 0,
303
+ pb: 0
304
+ }),
305
+ kx(300, {
306
+ bm: 0.5,
307
+ pb: -1.6
308
+ }, E_OUT),
309
+ kx(600, {
310
+ bm: 0.5,
311
+ pb: 0
312
+ }, E_GRAV),
313
+ kx(650, {
314
+ bm: 0,
315
+ pb: 0
316
+ }),
317
+ kx(760, {
318
+ bm: 0,
319
+ pb: 0
320
+ }),
321
+ kx(810, {
322
+ bm: 0.5,
323
+ pb: 0
324
+ }),
325
+ kx(1100, {
326
+ bm: 0.5,
327
+ pb: 0
328
+ }),
329
+ kx(1200, {
330
+ bm: 0,
331
+ pb: 0
332
+ })
333
+ ],
334
+ bob: [
335
+ kx(0, {
336
+ pb: 0
337
+ }),
338
+ kx(250, {
339
+ pb: 0
340
+ }),
341
+ kx(370, {
342
+ pb: -2.4
343
+ }, E_OUT),
344
+ kx(520, {
345
+ pb: 0
346
+ }, E_GRAV),
347
+ kx(820, {
348
+ pb: 0
349
+ }),
350
+ kx(940, {
351
+ pb: -1.8
352
+ }, E_OUT),
353
+ kx(1090, {
354
+ pb: 0
355
+ }, E_GRAV)
356
+ ]
357
+ };
358
+ HELLO_PROP.slip = HELLO_PROP.bob;
359
+ const FIDDLE = {
360
+ twitch: [
361
+ kx(0, {
362
+ pa: 0
363
+ }),
364
+ kx(60, {
365
+ pa: 6
366
+ }),
367
+ kx(120, {
368
+ pa: -4
369
+ }),
370
+ kx(190, {
371
+ pa: 5
372
+ }),
373
+ kx(270, {
374
+ pa: 0
375
+ }),
376
+ kx(560, {
377
+ pa: 0
378
+ }),
379
+ kx(620, {
380
+ pa: 5
381
+ }),
382
+ kx(690, {
383
+ pa: -3
384
+ }),
385
+ kx(770, {
386
+ pa: 3
387
+ }),
388
+ kx(900, {
389
+ pa: 0
390
+ })
391
+ ],
392
+ scan: [
393
+ kx(0, {
394
+ pa: 0,
395
+ gx: 0
396
+ }),
397
+ kx(700, {
398
+ pa: -18,
399
+ gx: -0.25
400
+ }, E_INOUT),
401
+ kx(1500, {
402
+ pa: 16,
403
+ gx: 0.22
404
+ }, E_INOUT),
405
+ kx(2300, {
406
+ pa: 0,
407
+ gx: 0
408
+ }, E_INOUT)
409
+ ],
410
+ turn: [
411
+ kx(0, {
412
+ pw: 0,
413
+ gx: 0
414
+ }),
415
+ kx(450, {
416
+ pw: 180,
417
+ gx: -0.3
418
+ }, E_INOUT),
419
+ kx(1450, {
420
+ pw: 180,
421
+ gx: -0.3
422
+ }),
423
+ kx(1900, {
424
+ pw: 360,
425
+ gx: 0
426
+ }, E_INOUT)
427
+ ],
428
+ sweep: [
429
+ kx(0, {
430
+ pa: 0,
431
+ gx: 0
432
+ }),
433
+ kx(500, {
434
+ pa: -14,
435
+ gx: 0.3
436
+ }, E_INOUT),
437
+ kx(1200, {
438
+ pa: 12,
439
+ gx: 0.3
440
+ }, E_INOUT),
441
+ kx(1700, {
442
+ pa: 0,
443
+ gx: 0
444
+ }, E_INOUT)
445
+ ],
446
+ flutter: osc('pa', 0, [
447
+ 7,
448
+ -6,
449
+ 5,
450
+ -4,
451
+ 3,
452
+ -2,
453
+ 1
454
+ ], 260, 1150),
455
+ sway: [
456
+ kx(0, {
457
+ pa: 0
458
+ }),
459
+ kx(500, {
460
+ pa: 9
461
+ }, E_INOUT),
462
+ kx(1100, {
463
+ pa: -7
464
+ }, E_INOUT),
465
+ kx(1600, {
466
+ pa: 3
467
+ }, E_INOUT),
468
+ kx(2000, {
469
+ pa: 0
470
+ }, E_SETTLE)
471
+ ],
472
+ flicker: [
473
+ kx(0, {
474
+ bm: 0
475
+ }),
476
+ kx(60, {
477
+ bm: 0.5
478
+ }, E_LIN),
479
+ kx(110, {
480
+ bm: 0.05
481
+ }, E_LIN),
482
+ kx(170, {
483
+ bm: 0.55
484
+ }, E_LIN),
485
+ kx(220, {
486
+ bm: 0.12
487
+ }, E_LIN),
488
+ kx(300, {
489
+ bm: 0.55
490
+ }, E_LIN),
491
+ kx(1150, {
492
+ bm: 0.55
493
+ }),
494
+ kx(1500, {
495
+ bm: 0
496
+ }, E_INOUT)
497
+ ],
498
+ spin: [
499
+ kx(0, {
500
+ pw: 0
501
+ }),
502
+ kx(1500, {
503
+ pw: 720
504
+ }, E_INOUT)
505
+ ],
506
+ slip: [
507
+ kx(0, {
508
+ pb: 0,
509
+ pdx: 0,
510
+ lid: 0,
511
+ gx: 0
512
+ }),
513
+ kx(280, {
514
+ pb: 3.2,
515
+ pdx: 0.8,
516
+ lid: 0,
517
+ gx: 0.15
518
+ }, E_IN),
519
+ kx(560, {
520
+ pb: 3.2,
521
+ pdx: 0.8,
522
+ lid: 0,
523
+ gx: 0.15
524
+ }),
525
+ kx(760, {
526
+ pb: -0.6,
527
+ pdx: 0,
528
+ lid: 0.3,
529
+ gx: 0.2
530
+ }, E_OUT),
531
+ kx(900, {
532
+ pb: 0,
533
+ pdx: 0,
534
+ lid: 0.3,
535
+ gx: 0.2
536
+ }, E_SETTLE),
537
+ kx(1300, {
538
+ pb: 0,
539
+ pdx: 0,
540
+ lid: 0.3,
541
+ gx: 0.2
542
+ }),
543
+ kx(1650, {
544
+ pb: 0,
545
+ pdx: 0,
546
+ lid: 0,
547
+ gx: 0
548
+ }, E_INOUT)
549
+ ]
550
+ };
551
+ const FAST = new Set([
552
+ 'twitch',
553
+ 'flutter',
554
+ 'flicker'
555
+ ]);
556
+ const ACTS = {
557
+ bored: ()=>[
558
+ [
559
+ 0,
560
+ 0,
561
+ 1,
562
+ 0,
563
+ null,
564
+ {
565
+ lid: 0,
566
+ gy: 0,
567
+ br: 0,
568
+ op: 0
569
+ }
570
+ ],
571
+ [
572
+ 650,
573
+ 0,
574
+ 1.018,
575
+ 0,
576
+ E_INOUT,
577
+ {
578
+ lid: 0.3,
579
+ gy: 0.1,
580
+ br: -0.05,
581
+ op: 0
582
+ }
583
+ ],
584
+ [
585
+ 1500,
586
+ 0,
587
+ 0.975,
588
+ 0,
589
+ E_INOUT,
590
+ {
591
+ lid: 0.42,
592
+ gy: 0.2,
593
+ br: -0.08,
594
+ op: 0
595
+ }
596
+ ],
597
+ [
598
+ 1850,
599
+ 0,
600
+ 0.975,
601
+ 0,
602
+ null,
603
+ {
604
+ lid: 0.42,
605
+ gy: 0.2,
606
+ br: -0.08,
607
+ op: 0
608
+ }
609
+ ],
610
+ [
611
+ 2050,
612
+ 0,
613
+ 0.975,
614
+ 0,
615
+ E_IN,
616
+ {
617
+ lid: 0.42,
618
+ gy: 0.2,
619
+ br: -0.08,
620
+ op: -0.75
621
+ }
622
+ ],
623
+ [
624
+ 2300,
625
+ 0,
626
+ 0.978,
627
+ 0,
628
+ E_OUT,
629
+ {
630
+ lid: 0.4,
631
+ gy: 0.18,
632
+ br: -0.08,
633
+ op: 0
634
+ }
635
+ ],
636
+ [
637
+ 2900,
638
+ 0,
639
+ 1,
640
+ 0,
641
+ E_SETTLE,
642
+ {
643
+ lid: 0,
644
+ gy: 0,
645
+ br: 0,
646
+ op: 0
647
+ }
648
+ ]
649
+ ],
650
+ lean: (s)=>[
651
+ [
652
+ 0,
653
+ 0,
654
+ 1,
655
+ 0
656
+ ],
657
+ [
658
+ 380,
659
+ 0,
660
+ 1,
661
+ 2.6 * s,
662
+ E_OUT
663
+ ],
664
+ [
665
+ 1150,
666
+ 0,
667
+ 1,
668
+ 2.6 * s
669
+ ],
670
+ [
671
+ 1500,
672
+ 0,
673
+ 1,
674
+ -0.5 * s,
675
+ E_INOUT
676
+ ],
677
+ [
678
+ 1800,
679
+ 0,
680
+ 1,
681
+ 0,
682
+ E_SETTLE
683
+ ]
684
+ ],
685
+ shuffle: (s)=>[
686
+ [
687
+ 0,
688
+ 0,
689
+ 1,
690
+ 0
691
+ ],
692
+ [
693
+ 110,
694
+ -2,
695
+ 1.01,
696
+ -1.8 * s,
697
+ E_OUT
698
+ ],
699
+ [
700
+ 220,
701
+ 0,
702
+ 0.975,
703
+ -0.5 * s,
704
+ E_GRAV
705
+ ],
706
+ [
707
+ 330,
708
+ -2,
709
+ 1.01,
710
+ 1.8 * s,
711
+ E_OUT
712
+ ],
713
+ [
714
+ 440,
715
+ 0,
716
+ 0.975,
717
+ 0.5 * s,
718
+ E_GRAV
719
+ ],
720
+ [
721
+ 650,
722
+ 0,
723
+ 1,
724
+ 0,
725
+ E_SETTLE
726
+ ]
727
+ ],
728
+ look: (g, L)=>[
729
+ [
730
+ 0,
731
+ 0,
732
+ 1,
733
+ 0,
734
+ null,
735
+ {
736
+ gx: 0,
737
+ gy: 0
738
+ }
739
+ ],
740
+ [
741
+ 200,
742
+ 0,
743
+ 1,
744
+ L,
745
+ E_OUT,
746
+ {
747
+ gx: g.gx,
748
+ gy: g.gy
749
+ }
750
+ ],
751
+ [
752
+ 1200,
753
+ 0,
754
+ 1,
755
+ L,
756
+ null,
757
+ {
758
+ gx: g.gx,
759
+ gy: g.gy
760
+ }
761
+ ],
762
+ [
763
+ 1550,
764
+ 0,
765
+ 1,
766
+ 0,
767
+ E_INOUT,
768
+ {
769
+ gx: 0,
770
+ gy: 0
771
+ }
772
+ ]
773
+ ],
774
+ take: (g, L)=>[
775
+ [
776
+ 0,
777
+ 0,
778
+ 1,
779
+ 0,
780
+ null,
781
+ {
782
+ gx: 0,
783
+ gy: 0
784
+ }
785
+ ],
786
+ [
787
+ 180,
788
+ 0,
789
+ 1,
790
+ 0.6 * L,
791
+ E_OUT,
792
+ {
793
+ gx: 0.8 * g.gx,
794
+ gy: 0.8 * g.gy
795
+ }
796
+ ],
797
+ [
798
+ 520,
799
+ 0,
800
+ 1,
801
+ 0.6 * L,
802
+ null,
803
+ {
804
+ gx: 0.8 * g.gx,
805
+ gy: 0.8 * g.gy
806
+ }
807
+ ],
808
+ [
809
+ 700,
810
+ 0,
811
+ 1,
812
+ 0,
813
+ E_INOUT,
814
+ {
815
+ gx: 0,
816
+ gy: 0
817
+ }
818
+ ],
819
+ [
820
+ 900,
821
+ 0,
822
+ 1,
823
+ L,
824
+ E_OUT,
825
+ {
826
+ gx: g.gx,
827
+ gy: g.gy
828
+ }
829
+ ],
830
+ [
831
+ 1750,
832
+ 0,
833
+ 1,
834
+ L,
835
+ null,
836
+ {
837
+ gx: g.gx,
838
+ gy: g.gy
839
+ }
840
+ ],
841
+ [
842
+ 2100,
843
+ 0,
844
+ 1,
845
+ 0,
846
+ E_INOUT,
847
+ {
848
+ gx: 0,
849
+ gy: 0
850
+ }
851
+ ]
852
+ ],
853
+ stretch: ()=>[
854
+ [
855
+ 0,
856
+ 0,
857
+ 1,
858
+ 0,
859
+ null,
860
+ {
861
+ op: 0
862
+ }
863
+ ],
864
+ [
865
+ 380,
866
+ 0,
867
+ 0.955,
868
+ 0,
869
+ E_INOUT,
870
+ {
871
+ op: -0.25
872
+ }
873
+ ],
874
+ [
875
+ 1050,
876
+ 0,
877
+ 1.07,
878
+ 0,
879
+ E_OUT,
880
+ {
881
+ op: -0.88
882
+ }
883
+ ],
884
+ [
885
+ 1200,
886
+ 0,
887
+ 1.07,
888
+ 0.9,
889
+ E_INOUT,
890
+ {
891
+ op: -0.88
892
+ }
893
+ ],
894
+ [
895
+ 1350,
896
+ 0,
897
+ 1.07,
898
+ -0.9,
899
+ E_INOUT,
900
+ {
901
+ op: -0.88
902
+ }
903
+ ],
904
+ [
905
+ 1500,
906
+ 0,
907
+ 1.07,
908
+ 0,
909
+ E_INOUT,
910
+ {
911
+ op: -0.88
912
+ }
913
+ ],
914
+ [
915
+ 1850,
916
+ 0,
917
+ 0.97,
918
+ 0,
919
+ E_INOUT,
920
+ {
921
+ op: -0.2
922
+ }
923
+ ],
924
+ [
925
+ 2100,
926
+ 0,
927
+ 1.012,
928
+ 0,
929
+ E_INOUT,
930
+ {
931
+ op: 0
932
+ }
933
+ ],
934
+ [
935
+ 2400,
936
+ 0,
937
+ 1,
938
+ 0,
939
+ E_SETTLE,
940
+ {
941
+ op: 0
942
+ }
943
+ ]
944
+ ],
945
+ reach: (L)=>[
946
+ [
947
+ 0,
948
+ 0,
949
+ 1,
950
+ 0,
951
+ null,
952
+ {
953
+ cv: 0,
954
+ gy: 0,
955
+ br: 0,
956
+ op: 0
957
+ }
958
+ ],
959
+ [
960
+ 220,
961
+ 0,
962
+ 0.985,
963
+ 0,
964
+ E_INOUT,
965
+ {
966
+ cv: 0,
967
+ gy: 0.06,
968
+ br: 0,
969
+ op: 0
970
+ }
971
+ ],
972
+ [
973
+ 820,
974
+ 0,
975
+ 1.03,
976
+ 0,
977
+ E_OUT,
978
+ {
979
+ cv: -L,
980
+ gy: -0.4,
981
+ br: 0.08,
982
+ op: 0
983
+ }
984
+ ],
985
+ [
986
+ 1250,
987
+ 0,
988
+ 1.03,
989
+ 0,
990
+ null,
991
+ {
992
+ cv: -L,
993
+ gy: -0.4,
994
+ br: 0.08,
995
+ op: 0
996
+ }
997
+ ],
998
+ [
999
+ 1340,
1000
+ 0,
1001
+ 1.025,
1002
+ 0,
1003
+ E_IN,
1004
+ {
1005
+ cv: -0.92 * L,
1006
+ gy: -0.34,
1007
+ br: 0.06,
1008
+ op: -0.9
1009
+ }
1010
+ ],
1011
+ [
1012
+ 1450,
1013
+ 0,
1014
+ 1.015,
1015
+ 0,
1016
+ E_OUT,
1017
+ {
1018
+ cv: -0.75 * L,
1019
+ gy: -0.25,
1020
+ br: 0.04,
1021
+ op: 0
1022
+ }
1023
+ ],
1024
+ [
1025
+ 1700,
1026
+ 0,
1027
+ 1,
1028
+ 0,
1029
+ E_SETTLE,
1030
+ {
1031
+ cv: -0.35 * L,
1032
+ gy: -0.1,
1033
+ br: 0,
1034
+ op: 0
1035
+ }
1036
+ ],
1037
+ [
1038
+ 2400,
1039
+ 0,
1040
+ 1,
1041
+ 0,
1042
+ E_INOUT,
1043
+ {
1044
+ cv: 0,
1045
+ gy: 0,
1046
+ br: 0,
1047
+ op: 0
1048
+ }
1049
+ ]
1050
+ ]
1051
+ };
1052
+ const ACT_W = {
1053
+ bored: 0.22,
1054
+ fidget: 0.26,
1055
+ prop: 0.24,
1056
+ look: 0.18,
1057
+ stretch: 0.1
1058
+ };
1059
+ const INVITE = (c)=>{
1060
+ const s = Math.abs(c.gx) >= 0.15 ? Math.sign(c.gx) : 0;
1061
+ const lo = 0 === s;
1062
+ const O = {
1063
+ gx: 0,
1064
+ gy: 0
1065
+ };
1066
+ const C = {
1067
+ gx: c.gx,
1068
+ gy: 1.25 * c.gy
1069
+ };
1070
+ return [
1071
+ [
1072
+ 0,
1073
+ 0,
1074
+ 1,
1075
+ 0,
1076
+ null,
1077
+ {
1078
+ gx: 0,
1079
+ gy: 0,
1080
+ lid: 0,
1081
+ br: 0,
1082
+ op: 0
1083
+ }
1084
+ ],
1085
+ [
1086
+ 240,
1087
+ 0,
1088
+ 1.022,
1089
+ -0.6 * s,
1090
+ E_OUT,
1091
+ {
1092
+ ...O,
1093
+ lid: 0,
1094
+ br: 0.2,
1095
+ op: 0
1096
+ }
1097
+ ],
1098
+ [
1099
+ 460,
1100
+ 0,
1101
+ 1.022,
1102
+ -0.6 * s,
1103
+ null,
1104
+ {
1105
+ ...O,
1106
+ lid: 0,
1107
+ br: 0.2,
1108
+ op: 0
1109
+ }
1110
+ ],
1111
+ [
1112
+ 700,
1113
+ 0,
1114
+ lo ? 0.985 : 1.01,
1115
+ 3 * s,
1116
+ E_INOUT,
1117
+ {
1118
+ ...C,
1119
+ lid: 0,
1120
+ br: 0.2,
1121
+ op: 0
1122
+ }
1123
+ ],
1124
+ [
1125
+ 1350,
1126
+ 0,
1127
+ lo ? 0.988 : 1.008,
1128
+ 2.6 * s,
1129
+ E_INOUT,
1130
+ {
1131
+ ...C,
1132
+ lid: 0,
1133
+ br: 0.2,
1134
+ op: 0
1135
+ }
1136
+ ],
1137
+ [
1138
+ 1550,
1139
+ 0,
1140
+ 1.006,
1141
+ 1.4 * s,
1142
+ E_INOUT,
1143
+ {
1144
+ ...O,
1145
+ lid: 0,
1146
+ br: 0.12,
1147
+ op: 0
1148
+ }
1149
+ ],
1150
+ [
1151
+ 1710,
1152
+ 0,
1153
+ 1.004,
1154
+ 0.8 * s,
1155
+ E_IN,
1156
+ {
1157
+ ...O,
1158
+ lid: 0.1,
1159
+ br: 0.1,
1160
+ op: -0.9
1161
+ }
1162
+ ],
1163
+ [
1164
+ 1930,
1165
+ 0,
1166
+ 1.002,
1167
+ 0.3 * s,
1168
+ E_OUT,
1169
+ {
1170
+ ...O,
1171
+ lid: 0.04,
1172
+ br: 0.06,
1173
+ op: 0
1174
+ }
1175
+ ],
1176
+ [
1177
+ 2350,
1178
+ 0,
1179
+ 1,
1180
+ 0,
1181
+ E_SETTLE,
1182
+ {
1183
+ gx: 0,
1184
+ gy: 0,
1185
+ lid: 0,
1186
+ br: 0,
1187
+ op: 0
1188
+ }
1189
+ ]
1190
+ ];
1191
+ };
1192
+ function propTr(X, F) {
1193
+ const f = F || {
1194
+ px: 60,
1195
+ py: 30
1196
+ };
1197
+ let s = '';
1198
+ const dx = X.pdx || 0;
1199
+ const dy = X.pb || 0;
1200
+ if (Math.abs(dx) > 0.01 || Math.abs(dy) > 0.01) s += `translate(${r2(dx)} ${r2(dy)})`;
1201
+ if (Math.abs(X.pa || 0) > 0.01) s += ` rotate(${r2(X.pa)} ${f.px} ${f.py})`;
1202
+ if (Math.abs(X.pw || 0) > 0.5) {
1203
+ let c = Math.cos(X.pw * Math.PI / 180);
1204
+ c = (c < 0 ? -1 : 1) * Math.max(0.04, Math.abs(c));
1205
+ s += ` translate(${f.px} 0) scale(${r2(c)} 1) translate(${-f.px} 0)`;
1206
+ }
1207
+ return s.trim();
1208
+ }
1209
+ const blinkOpen = (u)=>{
1210
+ if (u < 0 || u > 1) return 1;
1211
+ if (u < 0.38) return 1 - E_IN(u / 0.38);
1212
+ const v = (u - 0.38) / 0.62;
1213
+ return v < 0.85 ? 1.04 * E_OUT(v / 0.85) : 1.04 - (v - 0.85) / 0.15 * 0.04;
1214
+ };
1215
+ export { ACTS, ACT_W, BEAT, E_FILL, E_GRAV, E_IN, E_INOUT, E_LIN, E_OUT, E_RISE, E_SETTLE, FAST, FIDDLE, HELLO_PROP, HELLO_TILT, INVITE, NOX, P_BRIGHT, P_DART, P_LAND, P_POP, P_PURSUIT, P_SHAPE, P_SQ, P_W, blinkOpen, lerp, logn, propTr, spring, stepS };