@kolkrabbi/design-editor 0.27.0 → 0.27.1

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.
@@ -0,0 +1,4261 @@
1
+ import { $t as e, At as t, D as n, En as r, F as i, L as a, Mt as o, Ot as s, Qt as c, Sn as l, T as u, d, f, jt as p, kn as m, kt as h, nn as g, q as _, t as v, wn as y } from "./rolls-CGma4Bua.js";
2
+ import { c as b, d as x, f as S, i as C, l as w, o as T, r as ee, s as te, u as ne } from "./TreePicker-BQYPaQv3.js";
3
+ import { i as E, t as D } from "./Timeline-OZsY9CvR.js";
4
+ import { BezierPathEditor as O, Button as k, Dropdown as re, Input as ie, LabeledControl as ae, MenuDropdownItem as oe, PopoverPanel as se, SegmentedToggle as ce, SettingsRow as le, Slider as A, Textarea as ue, ToggleCheckbox as j, Tooltip as M, glyphSize as de, usePopover as fe } from "@kolkrabbi/kol-component";
5
+ import { Fragment as pe, useEffect as me, useState as N } from "react";
6
+ import { Fragment as he, jsx as P, jsxs as F } from "react/jsx-runtime";
7
+ import { Icon as ge } from "@kolkrabbi/kol-icons";
8
+ //#region src/kinetic/paths.js
9
+ var _e = Math.PI * 2, I = (e) => Math.round(e * 100) / 100;
10
+ function ve(e) {
11
+ return e.map((e, t) => `${t === 0 ? "M" : "L"} ${I(e[0])} ${I(e[1])}`).join(" ");
12
+ }
13
+ var ye = [
14
+ [.12, .55],
15
+ [.37, .32],
16
+ [.63, .68],
17
+ [.88, .45]
18
+ ];
19
+ function be(e, t, n) {
20
+ let r = e.map(([e, r]) => [e * t, r * n]);
21
+ if (r.length < 2) return `M ${I(t / 2)} ${I(n / 2)} L ${I(t / 2 + 1)} ${I(n / 2)}`;
22
+ let i = `M ${I(r[0][0])} ${I(r[0][1])}`;
23
+ for (let e = 0; e < r.length - 1; e++) {
24
+ let t = r[e - 1] || r[e], n = r[e], a = r[e + 1], o = r[e + 2] || r[e + 1], s = n[0] + (a[0] - t[0]) / 6, c = n[1] + (a[1] - t[1]) / 6, l = a[0] - (o[0] - n[0]) / 6, u = a[1] - (o[1] - n[1]) / 6;
25
+ i += ` C ${I(s)} ${I(c)} ${I(l)} ${I(u)} ${I(a[0])} ${I(a[1])}`;
26
+ }
27
+ return i;
28
+ }
29
+ var xe = (e) => e === "array", Se = (e) => e === "radial", Ce = (e) => e === "rings", L = {
30
+ amp: .4,
31
+ freq: 2,
32
+ turns: 3,
33
+ radius: .72,
34
+ rows: 2,
35
+ cols: 3,
36
+ count: 12,
37
+ inner: .12,
38
+ spin: 1,
39
+ twist: .5,
40
+ grow: .6
41
+ };
42
+ function we(e, t, n, r = {}) {
43
+ let i = t / 2, a = n / 2, o = Math.min(t, n) * .12, s = r.amp ?? L.amp, c = Math.max(1, Math.round(r.freq ?? L.freq)), l = Math.max(1, Math.round(r.turns ?? L.turns)), u = r.radius ?? L.radius;
44
+ switch (e) {
45
+ case "arc": {
46
+ let e = n * .62, r = e - s * n * .7;
47
+ return {
48
+ d: `M ${I(o)} ${I(e)} Q ${I(i)} ${I(r)} ${I(t - o)} ${I(e)}`,
49
+ closed: !1
50
+ };
51
+ }
52
+ case "circle": {
53
+ let e = Math.min(t, n) * .5 * u;
54
+ return {
55
+ d: `M ${I(i - e)} ${I(a)} A ${I(e)} ${I(e)} 0 1 1 ${I(i + e)} ${I(a)} A ${I(e)} ${I(e)} 0 1 1 ${I(i - e)} ${I(a)} Z`,
56
+ closed: !0
57
+ };
58
+ }
59
+ case "ellipse": {
60
+ let e = (t * .5 - o) * u, r = (n * .5 - o) * u;
61
+ return {
62
+ d: `M ${I(i - e)} ${I(a)} A ${I(e)} ${I(r)} 0 1 1 ${I(i + e)} ${I(a)} A ${I(e)} ${I(r)} 0 1 1 ${I(i - e)} ${I(a)} Z`,
63
+ closed: !0
64
+ };
65
+ }
66
+ case "sine": {
67
+ let e = [];
68
+ for (let r = 0; r <= 120; r++) {
69
+ let i = r / 120;
70
+ e.push([o + i * (t - 2 * o), a + s * n * .32 * Math.sin(i * c * _e)]);
71
+ }
72
+ return {
73
+ d: ve(e),
74
+ closed: !1
75
+ };
76
+ }
77
+ case "spiral": {
78
+ let e = Math.min(t, n) * .45 * u, r = [];
79
+ for (let t = 0; t <= 420; t++) {
80
+ let n = t / 420, o = n * l * _e, s = n * e;
81
+ r.push([i + Math.cos(o) * s, a + Math.sin(o) * s]);
82
+ }
83
+ return {
84
+ d: ve(r),
85
+ closed: !1
86
+ };
87
+ }
88
+ case "zigzag": {
89
+ let e = c * 2, r = [];
90
+ for (let i = 0; i <= e; i++) {
91
+ let c = i / e;
92
+ r.push([o + c * (t - 2 * o), a + (i % 2 == 0 ? -1 : 1) * s * n * .28]);
93
+ }
94
+ return {
95
+ d: ve(r),
96
+ closed: !1
97
+ };
98
+ }
99
+ case "custom": return {
100
+ d: be(Array.isArray(r.points) && r.points.length >= 2 ? r.points : ye, t, n),
101
+ closed: !1
102
+ };
103
+ default: {
104
+ let e = a + (r.offset || 0) * n;
105
+ return {
106
+ d: `M ${I(o)} ${I(e)} L ${I(t - o)} ${I(e)}`,
107
+ closed: !1
108
+ };
109
+ }
110
+ }
111
+ }
112
+ //#endregion
113
+ //#region src/kinetic/presets.js
114
+ var Te = "#0b0d12", Ee = "#e8e4dc", R = {
115
+ text: "Kinetic",
116
+ font: "gullhamrar",
117
+ fontSize: 120,
118
+ fill: "#e8e4dc",
119
+ italic: !1,
120
+ case: "none",
121
+ letterSpacing: 0,
122
+ align: "center",
123
+ multiply: 1,
124
+ group: null,
125
+ flow: "flow",
126
+ offset: {
127
+ x: 0,
128
+ y: 0
129
+ },
130
+ phase: 0,
131
+ stagger: 0,
132
+ vf: {},
133
+ opentype: {},
134
+ showPath: !1,
135
+ path: {
136
+ type: "line",
137
+ ...L
138
+ },
139
+ motion: {
140
+ mode: "none",
141
+ cycles: 1,
142
+ phase: .5,
143
+ amp: .3,
144
+ axis: "wght",
145
+ field: "x"
146
+ },
147
+ motions: [],
148
+ morph: {
149
+ on: !1,
150
+ mode: "morph",
151
+ vf2: {},
152
+ face2: "",
153
+ curve: "flat",
154
+ blend: .5,
155
+ cp1: {
156
+ x: .33,
157
+ y: .33
158
+ },
159
+ cp2: {
160
+ x: .66,
161
+ y: .66
162
+ }
163
+ }
164
+ };
165
+ function De(e, t = {}) {
166
+ let n = b(e), r = te(n);
167
+ for (let e of n.axes) t[e.tag] != null && (r[e.tag] = t[e.tag]);
168
+ return r;
169
+ }
170
+ function Oe(e = {}, t = 0) {
171
+ let n = {
172
+ id: e.id || `i${t}`,
173
+ ...R,
174
+ ...e,
175
+ path: {
176
+ ...R.path,
177
+ ...e.path || {}
178
+ },
179
+ motion: {
180
+ ...R.motion,
181
+ ...e.motion || {}
182
+ },
183
+ motions: Array.isArray(e.motions) ? e.motions.map((e) => ({
184
+ ...R.motion,
185
+ ...e
186
+ })) : [],
187
+ offset: {
188
+ ...R.offset,
189
+ ...e.offset || {}
190
+ },
191
+ opentype: { ...e.opentype || {} },
192
+ morph: {
193
+ ...R.morph,
194
+ ...e.morph || {},
195
+ vf2: { ...e.morph?.vf2 || {} }
196
+ }
197
+ };
198
+ return n.vf = De(n.font, e.vf), n;
199
+ }
200
+ var z = (e) => ({
201
+ bg: Te,
202
+ instances: [Oe({
203
+ font: "rot",
204
+ fill: Ee,
205
+ ...e
206
+ }, 0)]
207
+ }), ke = "#16202E", B = (...e) => ({
208
+ bg: ke,
209
+ instances: e.map((e, t) => Oe(e, t))
210
+ }), Ae = (e, ...t) => ({
211
+ bg: e,
212
+ instances: t.map((e, t) => Oe(e, t))
213
+ }), V = [
214
+ {
215
+ id: "sunburst",
216
+ label: "Sunburst",
217
+ sub: "Radial",
218
+ comp: z({
219
+ text: "Without a soul, is it a place?",
220
+ fontSize: 26,
221
+ vf: {
222
+ wdth: 100,
223
+ wght: 500
224
+ },
225
+ path: {
226
+ type: "radial",
227
+ count: 14,
228
+ inner: .1,
229
+ spin: 1
230
+ }
231
+ })
232
+ },
233
+ {
234
+ id: "dense-burst",
235
+ label: "Dense burst",
236
+ sub: "Radial",
237
+ comp: z({
238
+ text: "is it a place",
239
+ fontSize: 30,
240
+ vf: {
241
+ wdth: 90,
242
+ wght: 600
243
+ },
244
+ path: {
245
+ type: "radial",
246
+ count: 28,
247
+ inner: .06,
248
+ spin: 1
249
+ }
250
+ })
251
+ },
252
+ {
253
+ id: "double-twirl",
254
+ label: "Double twirl",
255
+ sub: "Radial",
256
+ comp: z({
257
+ text: "turning and turning",
258
+ fontSize: 24,
259
+ font: "malromur",
260
+ vf: { wght: 500 },
261
+ path: {
262
+ type: "radial",
263
+ count: 18,
264
+ inner: .12,
265
+ spin: 2
266
+ }
267
+ })
268
+ },
269
+ {
270
+ id: "pulse-burst",
271
+ label: "Pulse burst",
272
+ sub: "Radial",
273
+ comp: z({
274
+ text: "breathe in, breathe out",
275
+ fontSize: 26,
276
+ font: "gullhamrar",
277
+ vf: { wght: 600 },
278
+ path: {
279
+ type: "radial",
280
+ count: 16,
281
+ inner: .1,
282
+ spin: 1
283
+ },
284
+ motion: {
285
+ mode: "cascade",
286
+ cycles: 2,
287
+ phase: .5
288
+ }
289
+ })
290
+ },
291
+ {
292
+ id: "vortex",
293
+ label: "Vortex",
294
+ sub: "Rings",
295
+ comp: z({
296
+ text: "Does a community make a place? ",
297
+ fontSize: 24,
298
+ vf: {
299
+ wdth: 100,
300
+ wght: 500
301
+ },
302
+ path: {
303
+ type: "rings",
304
+ count: 12,
305
+ inner: .1,
306
+ radius: .94,
307
+ spin: 1,
308
+ twist: .6,
309
+ grow: .8
310
+ }
311
+ })
312
+ },
313
+ {
314
+ id: "galaxy",
315
+ label: "Galaxy",
316
+ sub: "Rings",
317
+ comp: z({
318
+ text: "spiralling inward forever ",
319
+ fontSize: 22,
320
+ font: "malromur",
321
+ vf: { wght: 500 },
322
+ path: {
323
+ type: "rings",
324
+ count: 16,
325
+ inner: .05,
326
+ radius: .96,
327
+ spin: 1,
328
+ twist: 1.25,
329
+ grow: .9
330
+ }
331
+ })
332
+ },
333
+ {
334
+ id: "wide-rings",
335
+ label: "Wide rings",
336
+ sub: "Rings",
337
+ comp: z({
338
+ text: "around and around ",
339
+ fontSize: 28,
340
+ font: "gullhamrar",
341
+ vf: { wght: 600 },
342
+ path: {
343
+ type: "rings",
344
+ count: 8,
345
+ inner: .18,
346
+ radius: .92,
347
+ spin: 1,
348
+ twist: .3,
349
+ grow: 1.2
350
+ }
351
+ })
352
+ },
353
+ {
354
+ id: "orbit",
355
+ label: "Orbit",
356
+ sub: "Path",
357
+ comp: z({
358
+ text: "KOLKRABBI · REYKJAVIK · ",
359
+ fontSize: 40,
360
+ font: "malromur",
361
+ vf: { wght: 500 },
362
+ path: {
363
+ type: "circle",
364
+ radius: .82
365
+ },
366
+ motion: {
367
+ mode: "orbit",
368
+ cycles: 1
369
+ }
370
+ })
371
+ },
372
+ {
373
+ id: "spiral",
374
+ label: "Spiral",
375
+ sub: "Path",
376
+ comp: z({
377
+ text: "into the spiral we go ",
378
+ fontSize: 30,
379
+ vf: {
380
+ wdth: 100,
381
+ wght: 500
382
+ },
383
+ path: {
384
+ type: "spiral",
385
+ turns: 4,
386
+ radius: .95
387
+ },
388
+ motion: {
389
+ mode: "march",
390
+ cycles: 1
391
+ }
392
+ })
393
+ },
394
+ {
395
+ id: "template",
396
+ label: "Template",
397
+ sub: "Path",
398
+ comp: z({
399
+ text: "Type here",
400
+ fontSize: 160,
401
+ vf: {
402
+ wdth: 100,
403
+ wght: 600
404
+ }
405
+ })
406
+ },
407
+ {
408
+ id: "big-statement",
409
+ label: "Flood",
410
+ sub: "Scenes",
411
+ comp: B({
412
+ text: "BIG",
413
+ font: "rot",
414
+ fontSize: 220,
415
+ vf: {
416
+ wdth: 140,
417
+ wght: 100
418
+ },
419
+ fill: "#c2502e",
420
+ motion: {
421
+ mode: "vfwave",
422
+ axis: "wght",
423
+ cycles: 1,
424
+ phase: .5
425
+ }
426
+ })
427
+ },
428
+ {
429
+ id: "ring-and-word",
430
+ label: "Ring",
431
+ sub: "Scenes",
432
+ comp: B({
433
+ id: "a",
434
+ text: "KOLKRABBI · REYKJAVIK · ",
435
+ font: "malromur",
436
+ fontSize: 56,
437
+ vf: { wght: 500 },
438
+ fill: "#9ec1ff",
439
+ path: {
440
+ type: "circle",
441
+ radius: .86
442
+ },
443
+ motion: {
444
+ mode: "orbit",
445
+ cycles: 1
446
+ }
447
+ }, {
448
+ id: "b",
449
+ text: "KOL",
450
+ font: "gullhamrar",
451
+ fontSize: 180,
452
+ vf: { wght: 800 },
453
+ fill: "#e8e4dc",
454
+ path: { type: "line" }
455
+ })
456
+ },
457
+ {
458
+ id: "custom-s",
459
+ label: "Flow",
460
+ sub: "Scenes",
461
+ comp: B({
462
+ text: "freeform",
463
+ fontSize: 96,
464
+ vf: { wght: 600 },
465
+ path: { type: "custom" },
466
+ showPath: !0
467
+ })
468
+ },
469
+ {
470
+ id: "malromur-wave",
471
+ label: "Morph",
472
+ sub: "Scenes",
473
+ comp: B({
474
+ text: "Malromur",
475
+ font: "malromur",
476
+ fontSize: 132,
477
+ vf: { wght: 300 },
478
+ motion: {
479
+ mode: "vfwave",
480
+ axis: "wght",
481
+ cycles: 2,
482
+ phase: .5
483
+ }
484
+ })
485
+ },
486
+ {
487
+ id: "flag",
488
+ label: "Wave",
489
+ sub: "Scenes",
490
+ comp: B({
491
+ text: "flag",
492
+ font: "rot",
493
+ fontSize: 168,
494
+ vf: {
495
+ wdth: 120,
496
+ wght: 600
497
+ },
498
+ motion: {
499
+ mode: "glyphwave",
500
+ cycles: 1,
501
+ phase: .5,
502
+ amp: .5
503
+ }
504
+ })
505
+ },
506
+ {
507
+ id: "sweep-grid",
508
+ label: "Reveal",
509
+ sub: "Scenes",
510
+ comp: B({
511
+ text: "KOL",
512
+ font: "rot",
513
+ fontSize: 56,
514
+ vf: {
515
+ wdth: 90,
516
+ wght: 500
517
+ },
518
+ fill: "#7fd1ff",
519
+ path: {
520
+ type: "array",
521
+ rows: 4,
522
+ cols: 5
523
+ },
524
+ motion: {
525
+ mode: "sweep",
526
+ field: "diagonal",
527
+ cycles: 1,
528
+ amp: .3
529
+ }
530
+ })
531
+ },
532
+ {
533
+ id: "baseline",
534
+ label: "Baseline",
535
+ sub: "Elements",
536
+ comp: B({
537
+ text: "Typography",
538
+ fontSize: 120,
539
+ vf: { wght: 500 }
540
+ })
541
+ },
542
+ {
543
+ id: "arc-kinetic",
544
+ label: "Arcs",
545
+ sub: "Elements",
546
+ comp: B({
547
+ text: "Kinetic",
548
+ fontSize: 130,
549
+ vf: { wght: 600 },
550
+ path: {
551
+ type: "arc",
552
+ amp: .45
553
+ }
554
+ })
555
+ },
556
+ {
557
+ id: "ellipse-loop",
558
+ label: "Loops",
559
+ sub: "Elements",
560
+ comp: B({
561
+ text: "REYKJAVIK",
562
+ font: "rot",
563
+ fontSize: 78,
564
+ vf: {
565
+ wdth: 120,
566
+ wght: 600
567
+ },
568
+ path: {
569
+ type: "ellipse",
570
+ radius: .92
571
+ },
572
+ motion: { mode: "orbit" }
573
+ })
574
+ },
575
+ {
576
+ id: "zigzag",
577
+ label: "Angular",
578
+ sub: "Elements",
579
+ comp: B({
580
+ text: "ZIGZAG",
581
+ font: "malromur",
582
+ fontSize: 92,
583
+ vf: { wght: 700 },
584
+ path: {
585
+ type: "zigzag",
586
+ amp: .5,
587
+ freq: 3
588
+ }
589
+ })
590
+ },
591
+ {
592
+ id: "array-grid",
593
+ label: "Grid",
594
+ sub: "Elements",
595
+ comp: B({
596
+ text: "KOL",
597
+ fontSize: 64,
598
+ vf: { wght: 600 },
599
+ path: {
600
+ type: "array",
601
+ rows: 3,
602
+ cols: 4
603
+ }
604
+ })
605
+ },
606
+ {
607
+ id: "weight-pulse",
608
+ label: "Weight",
609
+ sub: "Elements",
610
+ comp: B({
611
+ text: "WEIGHT",
612
+ fontSize: 150,
613
+ vf: { wght: 300 },
614
+ motion: {
615
+ mode: "vfwave",
616
+ axis: "wght",
617
+ cycles: 1,
618
+ phase: .6
619
+ }
620
+ })
621
+ },
622
+ {
623
+ id: "rot-width",
624
+ label: "Width",
625
+ sub: "Elements",
626
+ comp: B({
627
+ text: "WIDTH",
628
+ font: "rot",
629
+ fontSize: 150,
630
+ vf: {
631
+ wdth: 64,
632
+ wght: 600
633
+ },
634
+ motion: {
635
+ mode: "vfwave",
636
+ axis: "wdth",
637
+ cycles: 1,
638
+ phase: .6
639
+ }
640
+ })
641
+ },
642
+ {
643
+ id: "cascade",
644
+ label: "Cascade",
645
+ sub: "Elements",
646
+ comp: B({
647
+ text: "CASCADE",
648
+ fontSize: 130,
649
+ vf: { wght: 600 },
650
+ motion: {
651
+ mode: "cascade",
652
+ cycles: 1,
653
+ phase: .6
654
+ }
655
+ })
656
+ },
657
+ {
658
+ id: "baseline-mono",
659
+ label: "Mono line",
660
+ sub: "Lines",
661
+ comp: B({
662
+ text: "monospace",
663
+ font: "rot",
664
+ fontSize: 110,
665
+ vf: {
666
+ wdth: 90,
667
+ wght: 500
668
+ },
669
+ fill: "#7fd1ff"
670
+ })
671
+ },
672
+ {
673
+ id: "baseline-light",
674
+ label: "On paper",
675
+ sub: "Lines",
676
+ comp: Ae("#f4f1ea", {
677
+ text: "Reykjavik",
678
+ font: "malromur",
679
+ fontSize: 130,
680
+ vf: { wght: 600 },
681
+ fill: "#0b0b0e"
682
+ })
683
+ },
684
+ {
685
+ id: "sine-flow",
686
+ label: "Sine flow",
687
+ sub: "Curves",
688
+ comp: B({
689
+ text: "wave along",
690
+ font: "rot",
691
+ fontSize: 96,
692
+ vf: {
693
+ wdth: 90,
694
+ wght: 500
695
+ },
696
+ path: {
697
+ type: "sine",
698
+ amp: .4,
699
+ freq: 2
700
+ },
701
+ motion: {
702
+ mode: "march",
703
+ cycles: 1
704
+ }
705
+ })
706
+ },
707
+ {
708
+ id: "spiral-in",
709
+ label: "Spiral",
710
+ sub: "Curves",
711
+ comp: B({
712
+ text: "spiral",
713
+ fontSize: 88,
714
+ vf: { wght: 700 },
715
+ path: {
716
+ type: "spiral",
717
+ turns: 3
718
+ }
719
+ })
720
+ },
721
+ {
722
+ id: "arc-march",
723
+ label: "Arc march",
724
+ sub: "Curves",
725
+ comp: B({
726
+ text: "on the arc",
727
+ font: "rot",
728
+ fontSize: 96,
729
+ vf: {
730
+ wdth: 100,
731
+ wght: 500
732
+ },
733
+ path: {
734
+ type: "arc",
735
+ amp: .5
736
+ },
737
+ motion: { mode: "march" }
738
+ })
739
+ },
740
+ {
741
+ id: "arc-up",
742
+ label: "High arc",
743
+ sub: "Curves",
744
+ comp: B({
745
+ text: "over the top",
746
+ font: "malromur",
747
+ fontSize: 92,
748
+ vf: { wght: 600 },
749
+ path: {
750
+ type: "arc",
751
+ amp: .7
752
+ }
753
+ })
754
+ },
755
+ {
756
+ id: "arc-wide",
757
+ label: "Wide arc",
758
+ sub: "Curves",
759
+ comp: B({
760
+ text: "WIDEARC",
761
+ font: "rot",
762
+ fontSize: 96,
763
+ vf: {
764
+ wdth: 150,
765
+ wght: 600
766
+ },
767
+ path: {
768
+ type: "arc",
769
+ amp: .4
770
+ }
771
+ })
772
+ },
773
+ {
774
+ id: "sine-fast",
775
+ label: "Fast wave",
776
+ sub: "Curves",
777
+ comp: B({
778
+ text: "up and down",
779
+ fontSize: 90,
780
+ vf: { wght: 600 },
781
+ path: {
782
+ type: "sine",
783
+ amp: .4,
784
+ freq: 3
785
+ },
786
+ motion: {
787
+ mode: "march",
788
+ cycles: 2
789
+ }
790
+ })
791
+ },
792
+ {
793
+ id: "sine-tall",
794
+ label: "Tall wave",
795
+ sub: "Curves",
796
+ comp: B({
797
+ text: "rolling",
798
+ font: "rot",
799
+ fontSize: 100,
800
+ vf: {
801
+ wdth: 90,
802
+ wght: 500
803
+ },
804
+ path: {
805
+ type: "sine",
806
+ amp: .6,
807
+ freq: 2
808
+ }
809
+ })
810
+ },
811
+ {
812
+ id: "spiral-march",
813
+ label: "Spiral march",
814
+ sub: "Curves",
815
+ comp: B({
816
+ text: "into the spiral",
817
+ font: "rot",
818
+ fontSize: 72,
819
+ vf: {
820
+ wdth: 100,
821
+ wght: 500
822
+ },
823
+ path: {
824
+ type: "spiral",
825
+ turns: 5
826
+ },
827
+ motion: {
828
+ mode: "march",
829
+ cycles: 1
830
+ }
831
+ })
832
+ },
833
+ {
834
+ id: "circle-orbit",
835
+ label: "Circle",
836
+ sub: "Closed",
837
+ comp: B({
838
+ text: "KOLKRABBI",
839
+ font: "malromur",
840
+ fontSize: 80,
841
+ vf: { wght: 500 },
842
+ path: {
843
+ type: "circle",
844
+ radius: .72
845
+ },
846
+ motion: {
847
+ mode: "orbit",
848
+ cycles: 1
849
+ }
850
+ })
851
+ },
852
+ {
853
+ id: "circle-big",
854
+ label: "Big circle",
855
+ sub: "Closed",
856
+ comp: B({
857
+ text: "AROUND WE GO",
858
+ fontSize: 76,
859
+ vf: { wght: 600 },
860
+ path: {
861
+ type: "circle",
862
+ radius: .85
863
+ },
864
+ motion: { mode: "orbit" }
865
+ })
866
+ },
867
+ {
868
+ id: "circle-mono",
869
+ label: "Mono circle",
870
+ sub: "Closed",
871
+ comp: B({
872
+ text: "LOOP/LOOP/",
873
+ font: "rot",
874
+ fontSize: 72,
875
+ vf: {
876
+ wdth: 90,
877
+ wght: 500
878
+ },
879
+ fill: "#f6c453",
880
+ path: {
881
+ type: "circle",
882
+ radius: .78
883
+ },
884
+ motion: { mode: "orbit" }
885
+ })
886
+ },
887
+ {
888
+ id: "ellipse-wide",
889
+ label: "Wide ellipse",
890
+ sub: "Closed",
891
+ comp: B({
892
+ text: "ELLIPTICAL",
893
+ font: "malromur",
894
+ fontSize: 74,
895
+ vf: { wght: 500 },
896
+ path: {
897
+ type: "ellipse",
898
+ radius: 1
899
+ },
900
+ motion: { mode: "orbit" }
901
+ })
902
+ },
903
+ {
904
+ id: "zigzag-fine",
905
+ label: "Fine zigzag",
906
+ sub: "Angular",
907
+ comp: B({
908
+ text: "sawtooth",
909
+ font: "rot",
910
+ fontSize: 80,
911
+ vf: {
912
+ wdth: 90,
913
+ wght: 600
914
+ },
915
+ path: {
916
+ type: "zigzag",
917
+ amp: .35,
918
+ freq: 5
919
+ }
920
+ })
921
+ },
922
+ {
923
+ id: "custom-march",
924
+ label: "Custom march",
925
+ sub: "Custom",
926
+ comp: B({
927
+ text: "follow me",
928
+ font: "rot",
929
+ fontSize: 90,
930
+ vf: {
931
+ wdth: 90,
932
+ wght: 500
933
+ },
934
+ path: { type: "custom" },
935
+ motion: { mode: "march" }
936
+ })
937
+ },
938
+ {
939
+ id: "ordspor-pulse",
940
+ label: "Ordspor",
941
+ sub: "Weight",
942
+ comp: B({
943
+ text: "Ordspor",
944
+ font: "rot",
945
+ fontSize: 132,
946
+ vf: {
947
+ wdth: 90,
948
+ wght: 300
949
+ },
950
+ motion: {
951
+ mode: "vfwave",
952
+ axis: "wght",
953
+ cycles: 1,
954
+ phase: .7
955
+ }
956
+ })
957
+ },
958
+ {
959
+ id: "rot-weight",
960
+ label: "Rot weight",
961
+ sub: "Weight",
962
+ comp: B({
963
+ text: "ROT",
964
+ font: "rot",
965
+ fontSize: 200,
966
+ vf: {
967
+ wdth: 120,
968
+ wght: 100
969
+ },
970
+ motion: {
971
+ mode: "vfwave",
972
+ axis: "wght",
973
+ cycles: 1,
974
+ phase: .5
975
+ }
976
+ })
977
+ },
978
+ {
979
+ id: "weight-slow",
980
+ label: "Slow weight",
981
+ sub: "Weight",
982
+ comp: B({
983
+ text: "breathe",
984
+ fontSize: 150,
985
+ vf: { wght: 300 },
986
+ motion: {
987
+ mode: "vfwave",
988
+ axis: "wght",
989
+ cycles: 1,
990
+ phase: .3
991
+ }
992
+ })
993
+ },
994
+ {
995
+ id: "weight-fast",
996
+ label: "Fast weight",
997
+ sub: "Weight",
998
+ comp: B({
999
+ text: "PULSE",
1000
+ fontSize: 160,
1001
+ vf: { wght: 300 },
1002
+ motion: {
1003
+ mode: "vfwave",
1004
+ axis: "wght",
1005
+ cycles: 3,
1006
+ phase: .6
1007
+ }
1008
+ })
1009
+ },
1010
+ {
1011
+ id: "malromur-heavy",
1012
+ label: "Heavy swing",
1013
+ sub: "Weight",
1014
+ comp: Ae("#f4f1ea", {
1015
+ text: "Malromur",
1016
+ font: "malromur",
1017
+ fontSize: 130,
1018
+ vf: { wght: 300 },
1019
+ fill: "#0b0b0e",
1020
+ motion: {
1021
+ mode: "vfwave",
1022
+ axis: "wght",
1023
+ cycles: 1,
1024
+ phase: .5
1025
+ }
1026
+ })
1027
+ },
1028
+ {
1029
+ id: "ordspor-wave2",
1030
+ label: "Ordspor ×2",
1031
+ sub: "Weight",
1032
+ comp: B({
1033
+ text: "twice",
1034
+ font: "rot",
1035
+ fontSize: 150,
1036
+ vf: {
1037
+ wdth: 90,
1038
+ wght: 300
1039
+ },
1040
+ motion: {
1041
+ mode: "vfwave",
1042
+ axis: "wght",
1043
+ cycles: 2,
1044
+ phase: .5
1045
+ }
1046
+ })
1047
+ },
1048
+ {
1049
+ id: "rot-weight2",
1050
+ label: "Rot weight ×2",
1051
+ sub: "Weight",
1052
+ comp: B({
1053
+ text: "ROT",
1054
+ font: "rot",
1055
+ fontSize: 200,
1056
+ vf: {
1057
+ wdth: 120,
1058
+ wght: 100
1059
+ },
1060
+ motion: {
1061
+ mode: "vfwave",
1062
+ axis: "wght",
1063
+ cycles: 2,
1064
+ phase: .4
1065
+ }
1066
+ })
1067
+ },
1068
+ {
1069
+ id: "malromur-bigwave",
1070
+ label: "Big wave",
1071
+ sub: "Weight",
1072
+ comp: B({
1073
+ text: "WEIGHT",
1074
+ font: "malromur",
1075
+ fontSize: 150,
1076
+ vf: { wght: 300 },
1077
+ fill: "#f6c453",
1078
+ motion: {
1079
+ mode: "vfwave",
1080
+ axis: "wght",
1081
+ cycles: 2,
1082
+ phase: .7
1083
+ }
1084
+ })
1085
+ },
1086
+ {
1087
+ id: "ordspor-accent",
1088
+ label: "Ordspor accent",
1089
+ sub: "Weight",
1090
+ comp: B({
1091
+ text: "Ordspor",
1092
+ font: "rot",
1093
+ fontSize: 140,
1094
+ vf: {
1095
+ wdth: 90,
1096
+ wght: 300
1097
+ },
1098
+ fill: "#8f5ad0",
1099
+ motion: {
1100
+ mode: "vfwave",
1101
+ axis: "wght",
1102
+ cycles: 1,
1103
+ phase: .6
1104
+ }
1105
+ })
1106
+ },
1107
+ {
1108
+ id: "rot-dual",
1109
+ label: "Variable",
1110
+ sub: "Width",
1111
+ comp: B({
1112
+ text: "variable",
1113
+ font: "rot",
1114
+ fontSize: 124,
1115
+ vf: {
1116
+ wdth: 100,
1117
+ wght: 400
1118
+ },
1119
+ motion: {
1120
+ mode: "vfwave",
1121
+ axis: "wdth",
1122
+ cycles: 2,
1123
+ phase: .4
1124
+ }
1125
+ })
1126
+ },
1127
+ {
1128
+ id: "rot-width-fast",
1129
+ label: "Width ×2",
1130
+ sub: "Width",
1131
+ comp: B({
1132
+ text: "STRETCH",
1133
+ font: "rot",
1134
+ fontSize: 130,
1135
+ vf: {
1136
+ wdth: 64,
1137
+ wght: 600
1138
+ },
1139
+ motion: {
1140
+ mode: "vfwave",
1141
+ axis: "wdth",
1142
+ cycles: 2,
1143
+ phase: .5
1144
+ }
1145
+ })
1146
+ },
1147
+ {
1148
+ id: "rot-width-slow",
1149
+ label: "Width slow",
1150
+ sub: "Width",
1151
+ comp: B({
1152
+ text: "expand",
1153
+ font: "rot",
1154
+ fontSize: 130,
1155
+ vf: {
1156
+ wdth: 100,
1157
+ wght: 500
1158
+ },
1159
+ motion: {
1160
+ mode: "vfwave",
1161
+ axis: "wdth",
1162
+ cycles: 1,
1163
+ phase: .3
1164
+ }
1165
+ })
1166
+ },
1167
+ {
1168
+ id: "morph-mtl",
1169
+ label: "Made to last",
1170
+ sub: "Morph",
1171
+ comp: B({
1172
+ text: "Made to last",
1173
+ font: "rot",
1174
+ fontSize: 150,
1175
+ vf: {
1176
+ wdth: 64,
1177
+ wght: 100
1178
+ },
1179
+ morph: {
1180
+ on: !0,
1181
+ mode: "morph",
1182
+ curve: "linear",
1183
+ blend: .5,
1184
+ vf2: {
1185
+ wdth: 172,
1186
+ wght: 900
1187
+ }
1188
+ }
1189
+ })
1190
+ },
1191
+ {
1192
+ id: "morph-wave",
1193
+ label: "Morph wave",
1194
+ sub: "Morph",
1195
+ comp: B({
1196
+ text: "MORPH",
1197
+ font: "rot",
1198
+ fontSize: 200,
1199
+ vf: {
1200
+ wdth: 64,
1201
+ wght: 200
1202
+ },
1203
+ morph: {
1204
+ on: !0,
1205
+ mode: "morph",
1206
+ curve: "sine",
1207
+ blend: .5,
1208
+ vf2: {
1209
+ wdth: 172,
1210
+ wght: 900
1211
+ }
1212
+ }
1213
+ })
1214
+ },
1215
+ {
1216
+ id: "morph-ease",
1217
+ label: "Heavy → light",
1218
+ sub: "Morph",
1219
+ comp: B({
1220
+ text: "gradient",
1221
+ font: "rot",
1222
+ fontSize: 150,
1223
+ vf: {
1224
+ wdth: 120,
1225
+ wght: 900
1226
+ },
1227
+ morph: {
1228
+ on: !0,
1229
+ mode: "morph",
1230
+ curve: "ease",
1231
+ blend: .5,
1232
+ vf2: {
1233
+ wdth: 120,
1234
+ wght: 100
1235
+ }
1236
+ }
1237
+ })
1238
+ },
1239
+ {
1240
+ id: "morph-random",
1241
+ label: "Ransom note",
1242
+ sub: "Morph",
1243
+ comp: B({
1244
+ text: "CHAOS",
1245
+ font: "rot",
1246
+ fontSize: 170,
1247
+ vf: {
1248
+ wdth: 100,
1249
+ wght: 500
1250
+ },
1251
+ morph: {
1252
+ on: !0,
1253
+ mode: "random",
1254
+ blend: .37
1255
+ }
1256
+ })
1257
+ },
1258
+ {
1259
+ id: "morph-fade",
1260
+ label: "Fade A↔B",
1261
+ sub: "Morph",
1262
+ comp: B({
1263
+ text: "between",
1264
+ font: "gullhamrar",
1265
+ fontSize: 150,
1266
+ vf: { wght: 300 },
1267
+ morph: {
1268
+ on: !0,
1269
+ mode: "fade",
1270
+ blend: .5,
1271
+ vf2: { wght: 900 }
1272
+ }
1273
+ })
1274
+ },
1275
+ {
1276
+ id: "morph-cross",
1277
+ label: "Cross-face",
1278
+ sub: "Morph",
1279
+ comp: B({
1280
+ text: "hybrid",
1281
+ font: "rot",
1282
+ fontSize: 150,
1283
+ vf: {
1284
+ wdth: 100,
1285
+ wght: 600
1286
+ },
1287
+ morph: {
1288
+ on: !0,
1289
+ mode: "morph",
1290
+ blend: .5,
1291
+ face2: "gullhamrar"
1292
+ }
1293
+ })
1294
+ },
1295
+ {
1296
+ id: "arc-weight",
1297
+ label: "Morph on arc",
1298
+ sub: "On path",
1299
+ comp: B({
1300
+ text: "morph",
1301
+ fontSize: 120,
1302
+ path: {
1303
+ type: "arc",
1304
+ amp: .3
1305
+ },
1306
+ motion: {
1307
+ mode: "vfwave",
1308
+ axis: "wght",
1309
+ cycles: 1,
1310
+ phase: .6
1311
+ }
1312
+ })
1313
+ },
1314
+ {
1315
+ id: "sine-weight",
1316
+ label: "Wave + weight",
1317
+ sub: "On path",
1318
+ comp: B({
1319
+ text: "modulated",
1320
+ fontSize: 92,
1321
+ vf: { wght: 400 },
1322
+ path: {
1323
+ type: "sine",
1324
+ amp: .3,
1325
+ freq: 2
1326
+ },
1327
+ motion: {
1328
+ mode: "vfwave",
1329
+ axis: "wght",
1330
+ cycles: 1,
1331
+ phase: .5
1332
+ }
1333
+ })
1334
+ },
1335
+ {
1336
+ id: "circle-weight",
1337
+ label: "Ring + weight",
1338
+ sub: "On path",
1339
+ comp: B({
1340
+ text: "ROTATING",
1341
+ font: "malromur",
1342
+ fontSize: 78,
1343
+ vf: { wght: 300 },
1344
+ path: {
1345
+ type: "circle",
1346
+ radius: .74
1347
+ },
1348
+ motion: {
1349
+ mode: "vfwave",
1350
+ axis: "wght",
1351
+ cycles: 2,
1352
+ phase: .6
1353
+ }
1354
+ })
1355
+ },
1356
+ {
1357
+ id: "arc-width",
1358
+ label: "Arc + width",
1359
+ sub: "On path",
1360
+ comp: B({
1361
+ text: "arcwidth",
1362
+ font: "rot",
1363
+ fontSize: 96,
1364
+ vf: {
1365
+ wdth: 80,
1366
+ wght: 600
1367
+ },
1368
+ path: {
1369
+ type: "arc",
1370
+ amp: .4
1371
+ },
1372
+ motion: {
1373
+ mode: "vfwave",
1374
+ axis: "wdth",
1375
+ cycles: 1,
1376
+ phase: .5
1377
+ }
1378
+ })
1379
+ },
1380
+ {
1381
+ id: "pop",
1382
+ label: "Pop",
1383
+ sub: "Reveal",
1384
+ comp: B({
1385
+ text: "POP POP",
1386
+ fontSize: 130,
1387
+ vf: { wght: 800 },
1388
+ motion: {
1389
+ mode: "cascade",
1390
+ cycles: 2,
1391
+ phase: .8
1392
+ }
1393
+ })
1394
+ },
1395
+ {
1396
+ id: "arc-cascade",
1397
+ label: "Curve cascade",
1398
+ sub: "Reveal",
1399
+ comp: B({
1400
+ text: "on a curve",
1401
+ font: "rot",
1402
+ fontSize: 100,
1403
+ vf: {
1404
+ wdth: 90,
1405
+ wght: 500
1406
+ },
1407
+ path: {
1408
+ type: "arc",
1409
+ amp: .4
1410
+ },
1411
+ motion: {
1412
+ mode: "cascade",
1413
+ cycles: 1,
1414
+ phase: .5
1415
+ }
1416
+ })
1417
+ },
1418
+ {
1419
+ id: "cascade-slow",
1420
+ label: "Slow cascade",
1421
+ sub: "Reveal",
1422
+ comp: B({
1423
+ text: "unfold",
1424
+ fontSize: 130,
1425
+ vf: { wght: 600 },
1426
+ motion: {
1427
+ mode: "cascade",
1428
+ cycles: 1,
1429
+ phase: .4
1430
+ }
1431
+ })
1432
+ },
1433
+ {
1434
+ id: "cascade-fast",
1435
+ label: "Fast cascade",
1436
+ sub: "Reveal",
1437
+ comp: B({
1438
+ text: "flicker",
1439
+ fontSize: 130,
1440
+ vf: { wght: 700 },
1441
+ motion: {
1442
+ mode: "cascade",
1443
+ cycles: 2,
1444
+ phase: .7
1445
+ }
1446
+ })
1447
+ },
1448
+ {
1449
+ id: "typewriter",
1450
+ label: "Typewriter",
1451
+ sub: "Reveal",
1452
+ comp: B({
1453
+ text: "type_type_",
1454
+ font: "rot",
1455
+ fontSize: 100,
1456
+ vf: {
1457
+ wdth: 90,
1458
+ wght: 500
1459
+ },
1460
+ fill: "#7fd1ff",
1461
+ motion: {
1462
+ mode: "cascade",
1463
+ cycles: 1,
1464
+ phase: 1
1465
+ }
1466
+ })
1467
+ },
1468
+ {
1469
+ id: "spiral-cascade",
1470
+ label: "Spiral reveal",
1471
+ sub: "Reveal",
1472
+ comp: B({
1473
+ text: "spiral down",
1474
+ fontSize: 74,
1475
+ vf: { wght: 600 },
1476
+ path: {
1477
+ type: "spiral",
1478
+ turns: 3
1479
+ },
1480
+ motion: {
1481
+ mode: "cascade",
1482
+ cycles: 1,
1483
+ phase: .5
1484
+ }
1485
+ })
1486
+ },
1487
+ {
1488
+ id: "circle-cascade",
1489
+ label: "Ring reveal",
1490
+ sub: "Reveal",
1491
+ comp: B({
1492
+ text: "AROUND",
1493
+ font: "malromur",
1494
+ fontSize: 86,
1495
+ vf: { wght: 600 },
1496
+ path: {
1497
+ type: "circle",
1498
+ radius: .74
1499
+ },
1500
+ motion: {
1501
+ mode: "cascade",
1502
+ cycles: 1,
1503
+ phase: .6
1504
+ }
1505
+ })
1506
+ },
1507
+ {
1508
+ id: "pop-mono",
1509
+ label: "Mono pop",
1510
+ sub: "Reveal",
1511
+ comp: B({
1512
+ text: "POP.POP.",
1513
+ font: "rot",
1514
+ fontSize: 110,
1515
+ vf: {
1516
+ wdth: 90,
1517
+ wght: 500
1518
+ },
1519
+ fill: "#f6c453",
1520
+ motion: {
1521
+ mode: "cascade",
1522
+ cycles: 2,
1523
+ phase: .8
1524
+ }
1525
+ })
1526
+ },
1527
+ {
1528
+ id: "glyph-wave",
1529
+ label: "Ripple",
1530
+ sub: "Wave",
1531
+ comp: B({
1532
+ text: "ripple",
1533
+ font: "malromur",
1534
+ fontSize: 140,
1535
+ vf: { wght: 600 },
1536
+ motion: {
1537
+ mode: "glyphwave",
1538
+ cycles: 1,
1539
+ phase: .6,
1540
+ amp: .4
1541
+ }
1542
+ })
1543
+ },
1544
+ {
1545
+ id: "sine-ripple",
1546
+ label: "Sine ripple",
1547
+ sub: "Wave",
1548
+ comp: B({
1549
+ text: "wavewave",
1550
+ font: "rot",
1551
+ fontSize: 108,
1552
+ vf: {
1553
+ wdth: 110,
1554
+ wght: 600
1555
+ },
1556
+ path: {
1557
+ type: "sine",
1558
+ amp: .3,
1559
+ freq: 2
1560
+ },
1561
+ motion: {
1562
+ mode: "glyphwave",
1563
+ amp: .3
1564
+ }
1565
+ })
1566
+ },
1567
+ {
1568
+ id: "glyph-big",
1569
+ label: "Big ripple",
1570
+ sub: "Wave",
1571
+ comp: B({
1572
+ text: "WAVES",
1573
+ fontSize: 150,
1574
+ vf: { wght: 700 },
1575
+ motion: {
1576
+ mode: "glyphwave",
1577
+ cycles: 1,
1578
+ phase: .6,
1579
+ amp: .6
1580
+ }
1581
+ })
1582
+ },
1583
+ {
1584
+ id: "glyph-fast",
1585
+ label: "Fast ripple",
1586
+ sub: "Wave",
1587
+ comp: B({
1588
+ text: "shiver",
1589
+ font: "malromur",
1590
+ fontSize: 140,
1591
+ vf: { wght: 600 },
1592
+ motion: {
1593
+ mode: "glyphwave",
1594
+ cycles: 2,
1595
+ phase: .5,
1596
+ amp: .35
1597
+ }
1598
+ })
1599
+ },
1600
+ {
1601
+ id: "arc-glyphwave",
1602
+ label: "Arc ripple",
1603
+ sub: "Wave",
1604
+ comp: B({
1605
+ text: "on a curve",
1606
+ font: "rot",
1607
+ fontSize: 96,
1608
+ vf: {
1609
+ wdth: 90,
1610
+ wght: 500
1611
+ },
1612
+ path: {
1613
+ type: "arc",
1614
+ amp: .4
1615
+ },
1616
+ motion: {
1617
+ mode: "glyphwave",
1618
+ amp: .3
1619
+ }
1620
+ })
1621
+ },
1622
+ {
1623
+ id: "rot-flag-fast",
1624
+ label: "Rot flag",
1625
+ sub: "Wave",
1626
+ comp: B({
1627
+ text: "flutter",
1628
+ font: "rot",
1629
+ fontSize: 150,
1630
+ vf: {
1631
+ wdth: 120,
1632
+ wght: 600
1633
+ },
1634
+ motion: {
1635
+ mode: "glyphwave",
1636
+ cycles: 2,
1637
+ phase: .5,
1638
+ amp: .5
1639
+ }
1640
+ })
1641
+ },
1642
+ {
1643
+ id: "sine-ripple2",
1644
+ label: "Sine flutter",
1645
+ sub: "Wave",
1646
+ comp: B({
1647
+ text: "flowflow",
1648
+ font: "rot",
1649
+ fontSize: 100,
1650
+ vf: {
1651
+ wdth: 90,
1652
+ wght: 500
1653
+ },
1654
+ path: {
1655
+ type: "sine",
1656
+ amp: .3,
1657
+ freq: 2
1658
+ },
1659
+ motion: {
1660
+ mode: "glyphwave",
1661
+ cycles: 2,
1662
+ amp: .3
1663
+ }
1664
+ })
1665
+ },
1666
+ {
1667
+ id: "sweep-x",
1668
+ label: "Sweep X",
1669
+ sub: "Sweep",
1670
+ comp: B({
1671
+ text: "SWEEP",
1672
+ fontSize: 150,
1673
+ vf: { wght: 700 },
1674
+ motion: {
1675
+ mode: "sweep",
1676
+ field: "x",
1677
+ cycles: 1,
1678
+ amp: .3
1679
+ }
1680
+ })
1681
+ },
1682
+ {
1683
+ id: "sweep-y",
1684
+ label: "Sweep Y",
1685
+ sub: "Sweep",
1686
+ comp: B({
1687
+ text: "descend",
1688
+ font: "rot",
1689
+ fontSize: 130,
1690
+ vf: {
1691
+ wdth: 90,
1692
+ wght: 500
1693
+ },
1694
+ motion: {
1695
+ mode: "sweep",
1696
+ field: "y",
1697
+ cycles: 1,
1698
+ amp: .35
1699
+ }
1700
+ })
1701
+ },
1702
+ {
1703
+ id: "sweep-radial",
1704
+ label: "Radial pulse",
1705
+ sub: "Sweep",
1706
+ comp: B({
1707
+ text: "PULSE",
1708
+ font: "malromur",
1709
+ fontSize: 140,
1710
+ vf: { wght: 600 },
1711
+ motion: {
1712
+ mode: "sweep",
1713
+ field: "radial",
1714
+ cycles: 1,
1715
+ amp: .4
1716
+ }
1717
+ })
1718
+ },
1719
+ {
1720
+ id: "sweep-weight",
1721
+ label: "Sweep weight",
1722
+ sub: "Sweep",
1723
+ comp: B({
1724
+ text: "WEIGHT",
1725
+ fontSize: 150,
1726
+ vf: { wght: 300 },
1727
+ motion: {
1728
+ mode: "sweepWeight",
1729
+ field: "x",
1730
+ cycles: 1,
1731
+ amp: .4
1732
+ }
1733
+ })
1734
+ },
1735
+ {
1736
+ id: "sweep-shift",
1737
+ label: "Sweep shift",
1738
+ sub: "Sweep",
1739
+ comp: B({
1740
+ text: "shiver",
1741
+ font: "rot",
1742
+ fontSize: 130,
1743
+ vf: {
1744
+ wdth: 110,
1745
+ wght: 600
1746
+ },
1747
+ motion: {
1748
+ mode: "sweepShift",
1749
+ field: "wave",
1750
+ cycles: 1,
1751
+ amp: .3
1752
+ }
1753
+ })
1754
+ },
1755
+ {
1756
+ id: "orbit-spin",
1757
+ label: "Orbit",
1758
+ sub: "Orbit",
1759
+ comp: B({
1760
+ text: "ORBIT",
1761
+ font: "malromur",
1762
+ fontSize: 88,
1763
+ vf: { wght: 600 },
1764
+ path: {
1765
+ type: "circle",
1766
+ radius: .7
1767
+ },
1768
+ motion: {
1769
+ mode: "orbit",
1770
+ cycles: 1
1771
+ }
1772
+ })
1773
+ },
1774
+ {
1775
+ id: "orbit-fast",
1776
+ label: "Fast orbit",
1777
+ sub: "Orbit",
1778
+ comp: B({
1779
+ text: "spinning",
1780
+ fontSize: 84,
1781
+ vf: { wght: 600 },
1782
+ path: {
1783
+ type: "circle",
1784
+ radius: .72
1785
+ },
1786
+ motion: {
1787
+ mode: "orbit",
1788
+ cycles: 2
1789
+ }
1790
+ })
1791
+ },
1792
+ {
1793
+ id: "ellipse-orbit",
1794
+ label: "Ellipse orbit",
1795
+ sub: "Orbit",
1796
+ comp: B({
1797
+ text: "ORBITAL",
1798
+ font: "rot",
1799
+ fontSize: 78,
1800
+ vf: {
1801
+ wdth: 110,
1802
+ wght: 600
1803
+ },
1804
+ path: {
1805
+ type: "ellipse",
1806
+ radius: .95
1807
+ },
1808
+ motion: {
1809
+ mode: "orbit",
1810
+ cycles: 1
1811
+ }
1812
+ })
1813
+ },
1814
+ {
1815
+ id: "array-pulse",
1816
+ label: "Grid pulse",
1817
+ sub: "Array",
1818
+ comp: B({
1819
+ text: "NODE",
1820
+ font: "rot",
1821
+ fontSize: 44,
1822
+ vf: {
1823
+ wdth: 90,
1824
+ wght: 500
1825
+ },
1826
+ fill: "#7fd1ff",
1827
+ path: {
1828
+ type: "array",
1829
+ rows: 4,
1830
+ cols: 5
1831
+ },
1832
+ motion: {
1833
+ mode: "cascade",
1834
+ cycles: 1,
1835
+ phase: .5
1836
+ }
1837
+ })
1838
+ },
1839
+ {
1840
+ id: "array-wave",
1841
+ label: "Grid wave",
1842
+ sub: "Array",
1843
+ comp: B({
1844
+ text: "echo",
1845
+ font: "rot",
1846
+ fontSize: 52,
1847
+ vf: {
1848
+ wdth: 90,
1849
+ wght: 500
1850
+ },
1851
+ path: {
1852
+ type: "array",
1853
+ rows: 3,
1854
+ cols: 3
1855
+ },
1856
+ motion: {
1857
+ mode: "glyphwave",
1858
+ cycles: 1,
1859
+ phase: .7,
1860
+ amp: .4
1861
+ }
1862
+ })
1863
+ },
1864
+ {
1865
+ id: "array-weight",
1866
+ label: "Grid weight",
1867
+ sub: "Array",
1868
+ comp: B({
1869
+ text: "OK",
1870
+ font: "rot",
1871
+ fontSize: 88,
1872
+ vf: {
1873
+ wdth: 100,
1874
+ wght: 200
1875
+ },
1876
+ path: {
1877
+ type: "array",
1878
+ rows: 2,
1879
+ cols: 3
1880
+ },
1881
+ motion: {
1882
+ mode: "vfwave",
1883
+ axis: "wght",
1884
+ cycles: 1,
1885
+ phase: .6
1886
+ }
1887
+ })
1888
+ },
1889
+ {
1890
+ id: "stacked",
1891
+ label: "Stacked",
1892
+ sub: "Composite",
1893
+ comp: B({
1894
+ id: "a",
1895
+ text: "KINETIC",
1896
+ font: "gullhamrar",
1897
+ fontSize: 130,
1898
+ vf: { wght: 700 },
1899
+ fill: "#e8e4dc",
1900
+ path: {
1901
+ type: "line",
1902
+ offset: -.16
1903
+ }
1904
+ }, {
1905
+ id: "b",
1906
+ text: "typography",
1907
+ font: "rot",
1908
+ fontSize: 90,
1909
+ vf: {
1910
+ wdth: 90,
1911
+ wght: 400
1912
+ },
1913
+ fill: "#f6c453",
1914
+ path: {
1915
+ type: "line",
1916
+ offset: .16
1917
+ },
1918
+ motion: {
1919
+ mode: "vfwave",
1920
+ axis: "wght",
1921
+ cycles: 1,
1922
+ phase: .5
1923
+ }
1924
+ })
1925
+ },
1926
+ {
1927
+ id: "grid-and-ring",
1928
+ label: "Grid + ring",
1929
+ sub: "Composite",
1930
+ comp: Ae("#0a0b14", {
1931
+ id: "a",
1932
+ text: "echo",
1933
+ font: "rot",
1934
+ fontSize: 40,
1935
+ vf: {
1936
+ wdth: 90,
1937
+ wght: 500
1938
+ },
1939
+ fill: "#3a4a6a",
1940
+ path: {
1941
+ type: "array",
1942
+ rows: 4,
1943
+ cols: 5
1944
+ }
1945
+ }, {
1946
+ id: "b",
1947
+ text: "SIGNAL · SIGNAL · ",
1948
+ font: "rot",
1949
+ fontSize: 60,
1950
+ vf: {
1951
+ wdth: 110,
1952
+ wght: 600
1953
+ },
1954
+ fill: "#9ec1ff",
1955
+ path: {
1956
+ type: "circle",
1957
+ radius: .7
1958
+ },
1959
+ motion: {
1960
+ mode: "orbit",
1961
+ cycles: 1
1962
+ }
1963
+ })
1964
+ }
1965
+ ], je = (e) => V.find((t) => t.id === e) || V[0], Me = [
1966
+ "Radial",
1967
+ "Rings",
1968
+ "Path"
1969
+ ], Ne = [{
1970
+ label: "Type",
1971
+ subs: Me
1972
+ }, {
1973
+ label: "Kinetic",
1974
+ subs: [...new Set(V.map((e) => e.sub))].filter((e) => !Me.includes(e))
1975
+ }], Pe = (e) => structuredClone(e.comp), H = {
1976
+ dLen: 0,
1977
+ dNormal: 0,
1978
+ scale: 1,
1979
+ dRot: 0,
1980
+ opacity: 1,
1981
+ vf: null
1982
+ }, Fe = {
1983
+ none: () => H,
1984
+ march: (e) => ({
1985
+ ...H,
1986
+ dLen: e.u * e.pathLen * Math.max(1, Math.round(e.m.cycles || 1))
1987
+ }),
1988
+ orbit: (e) => ({
1989
+ ...H,
1990
+ dLen: e.u * e.pathLen * Math.max(1, Math.round(e.m.cycles || 1))
1991
+ }),
1992
+ vfwave: (e) => {
1993
+ let t = Math.max(1, Math.round(e.m.cycles || 1)), n = .5 + .5 * Math.sin(e.u * l * t - e.i * (e.m.phase ?? .5));
1994
+ return {
1995
+ ...H,
1996
+ vf: { [e.axisTag]: r(e.axisMin, e.axisMax, n) }
1997
+ };
1998
+ },
1999
+ glyphwave: (e) => {
2000
+ let t = Math.max(1, Math.round(e.m.cycles || 1)), n = Math.sin(e.u * l * t - e.i * (e.m.phase ?? .5));
2001
+ return {
2002
+ ...H,
2003
+ dNormal: (e.m.amp ?? .3) * e.sizePx * n
2004
+ };
2005
+ },
2006
+ cascade: (e) => {
2007
+ let t = Math.max(1, Math.round(e.m.cycles || 1)), n = .5 + .5 * Math.sin(e.u * l * t - e.i * (e.m.phase ?? .6));
2008
+ return {
2009
+ ...H,
2010
+ scale: r(.25, 1, n),
2011
+ opacity: r(.15, 1, n)
2012
+ };
2013
+ },
2014
+ sweep: (e) => {
2015
+ let t = ze(e);
2016
+ return {
2017
+ ...H,
2018
+ scale: r(.25, 1, t),
2019
+ opacity: r(.12, 1, t)
2020
+ };
2021
+ },
2022
+ sweepWeight: (e) => {
2023
+ let t = ze(e);
2024
+ return {
2025
+ ...H,
2026
+ vf: { [e.axisTag]: r(e.axisMin, e.axisMax, t) }
2027
+ };
2028
+ },
2029
+ sweepShift: (e) => {
2030
+ let t = ze(e);
2031
+ return {
2032
+ ...H,
2033
+ dNormal: t * .6 * e.sizePx
2034
+ };
2035
+ }
2036
+ }, Ie = (e) => e - Math.floor(e);
2037
+ function Le(e, t) {
2038
+ if (t <= 0) return 0;
2039
+ let n = Math.min(1, e / t);
2040
+ return 1 - n * n * (3 - 2 * n);
2041
+ }
2042
+ function Re(e, t, n, r, i, a) {
2043
+ let o = Ie(r * i), s = Math.max(.02, a * .5), c = (e) => {
2044
+ let t = Math.abs(Ie(e) - o);
2045
+ return Le(Math.min(t, 1 - t), s);
2046
+ };
2047
+ switch (e) {
2048
+ case "y": return c(n);
2049
+ case "diagonal": return c(.5 + (t - .5) * .7071 + (n - .5) * .7071);
2050
+ case "radial": return c(Math.hypot(t - .5, n - .5) / .7071);
2051
+ case "angular": return c(Math.atan2(n - .5, t - .5) / l + .5);
2052
+ case "wave": {
2053
+ let e = Math.max(1, Math.round(1 + (1 - a) * 6));
2054
+ return .5 + .5 * Math.sin((t * e - r * i) * l);
2055
+ }
2056
+ default: return c(t);
2057
+ }
2058
+ }
2059
+ var ze = (e) => Re(e.m.field || "x", e.nx ?? .5, e.ny ?? .5, e.u, Math.max(1, Math.round(e.m.cycles || 1)), e.m.amp ?? .35);
2060
+ function Be(e, t) {
2061
+ return (Fe[e] || Fe.none)(t);
2062
+ }
2063
+ //#endregion
2064
+ //#region src/kinetic/features.js
2065
+ var Ve = [
2066
+ {
2067
+ tag: "liga",
2068
+ label: "Ligatures"
2069
+ },
2070
+ {
2071
+ tag: "dlig",
2072
+ label: "Discretionary ligatures"
2073
+ },
2074
+ {
2075
+ tag: "smcp",
2076
+ label: "Small caps"
2077
+ },
2078
+ {
2079
+ tag: "case",
2080
+ label: "Case-sensitive forms"
2081
+ },
2082
+ {
2083
+ tag: "onum",
2084
+ label: "Oldstyle figures"
2085
+ },
2086
+ {
2087
+ tag: "tnum",
2088
+ label: "Tabular figures"
2089
+ },
2090
+ {
2091
+ tag: "frac",
2092
+ label: "Fractions"
2093
+ },
2094
+ {
2095
+ tag: "swsh",
2096
+ label: "Swashes"
2097
+ },
2098
+ {
2099
+ tag: "ss01",
2100
+ label: "Stylistic set 1"
2101
+ },
2102
+ {
2103
+ tag: "ss02",
2104
+ label: "Stylistic set 2"
2105
+ }
2106
+ ];
2107
+ function He(e) {
2108
+ if (!e) return "normal";
2109
+ let t = [];
2110
+ for (let [n, r] of Object.entries(e)) t.push(`"${n}" ${+!!r}`);
2111
+ return t.length ? t.join(", ") : "normal";
2112
+ }
2113
+ //#endregion
2114
+ //#region src/kinetic/KineticType.js
2115
+ var Ue = "http://www.w3.org/2000/svg", U = (e) => e - Math.floor(e), W = (e) => document.createElementNS(Ue, e);
2116
+ function We(e, t) {
2117
+ return !e || !t || t === "none" ? e || "" : t === "upper" ? e.toUpperCase() : t === "lower" ? e.toLowerCase() : t === "title" ? e.replace(/\b\w/g, (e) => e.toUpperCase()) : e;
2118
+ }
2119
+ function Ge(e) {
2120
+ if (!e) return {
2121
+ bg: "#16202E",
2122
+ instances: []
2123
+ };
2124
+ if (Array.isArray(e.instances)) return e;
2125
+ let { bg: t, ...n } = e;
2126
+ return {
2127
+ bg: t || "#16202E",
2128
+ instances: [{
2129
+ id: "main",
2130
+ ...n
2131
+ }]
2132
+ };
2133
+ }
2134
+ var Ke = class {
2135
+ constructor(e) {
2136
+ this.host = e, this.params = Ge(null), this.w = 0, this.h = 0, this._rt = /* @__PURE__ */ new Map(), this._instSig = "", this._needsRemeasure = !1;
2137
+ let t = W("svg");
2138
+ t.setAttribute("xmlns", Ue), t.style.display = "block", t.style.maxWidth = "100%", t.style.maxHeight = "100%", t.style.pointerEvents = "none", t.style.overflow = "hidden", this._clipApplied = !0, this.bg = W("rect"), this.layer = W("g"), this.measEl = W("text"), this.measEl.setAttribute("x", "0"), this.measEl.setAttribute("y", "0"), this.measEl.style.visibility = "hidden", t.append(this.bg, this.layer, this.measEl), e.appendChild(t), this.svg = t, e.__kolKineticEngine = this, typeof document < "u" && document.fonts && document.fonts.ready.then(() => {
2139
+ this._needsRemeasure = !0;
2140
+ }).catch(() => {});
2141
+ }
2142
+ resize(e, t) {
2143
+ this.w = e, this.h = t, this.svg.setAttribute("width", e), this.svg.setAttribute("height", t), this.svg.setAttribute("viewBox", `0 0 ${e} ${t}`), this.bg.setAttribute("width", e), this.bg.setAttribute("height", t);
2144
+ for (let e of this._rt.values()) e.cache = null;
2145
+ }
2146
+ setComposition(e) {
2147
+ this.params = Ge(e);
2148
+ }
2149
+ renderAt(e) {
2150
+ !this.w || !this.h || this._render(y(e));
2151
+ }
2152
+ getInstanceRect(e) {
2153
+ let t = this._rt.get(e);
2154
+ if (!t || !t.glyphG) return null;
2155
+ let n;
2156
+ try {
2157
+ n = t.glyphG.getBBox();
2158
+ } catch {
2159
+ return null;
2160
+ }
2161
+ if (!n || !n.width || !n.height) return null;
2162
+ let r = (this.params.instances || []).find((t) => t.id === e), i = (r?.offset?.x || 0) * this.w, a = (r?.offset?.y || 0) * this.h;
2163
+ return {
2164
+ x: n.x + i,
2165
+ y: n.y + a,
2166
+ w: n.width,
2167
+ h: n.height
2168
+ };
2169
+ }
2170
+ hitTest(e, t) {
2171
+ let n = this.svg.getBoundingClientRect();
2172
+ if (!n.width || !n.height) return null;
2173
+ let r = (e - n.left) * (this.w / n.width), i = (t - n.top) * (this.h / n.height), a = this.params.instances || [];
2174
+ for (let e = a.length - 1; e >= 0; e--) {
2175
+ let t = this.getInstanceRect(a[e].id);
2176
+ if (t && r >= t.x && r <= t.x + t.w && i >= t.y && i <= t.y + t.h) return a[e].id;
2177
+ }
2178
+ return null;
2179
+ }
2180
+ dispose() {
2181
+ this.host && this.host.__kolKineticEngine === this && delete this.host.__kolKineticEngine, this.svg && this.svg.parentNode === this.host && this.host.removeChild(this.svg);
2182
+ }
2183
+ _syncInstances() {
2184
+ let e = this.params.instances || [], t = e.map((e) => e.id).join("|");
2185
+ if (t === this._instSig) return;
2186
+ this._instSig = t;
2187
+ let n = new Set(e.map((e) => e.id));
2188
+ for (let [e, t] of this._rt) n.has(e) || (t.group.remove(), this._rt.delete(e));
2189
+ for (let t of e) {
2190
+ let e = this._rt.get(t.id);
2191
+ if (!e) {
2192
+ let n = W("g"), r = W("path");
2193
+ r.setAttribute("fill", "none");
2194
+ let i = W("g");
2195
+ i.setAttribute("data-glyphs", t.id), n.append(r, i), e = {
2196
+ group: n,
2197
+ pathEl: r,
2198
+ glyphG: i,
2199
+ glyphEls: [],
2200
+ cache: null,
2201
+ glyphKey: "",
2202
+ closed: !1
2203
+ }, this._rt.set(t.id, e);
2204
+ }
2205
+ this.layer.appendChild(e.group);
2206
+ }
2207
+ }
2208
+ _render(e) {
2209
+ let t = this.params.clip !== !1;
2210
+ if (t !== this._clipApplied && (this._clipApplied = t, this.svg.style.overflow = t ? "hidden" : "visible"), this._needsRemeasure) {
2211
+ this._needsRemeasure = !1;
2212
+ for (let e of this._rt.values()) e.cache = null;
2213
+ }
2214
+ this.bg.setAttribute("fill", this.params.bg || "#16202E"), this._syncInstances();
2215
+ for (let t of this.params.instances || []) {
2216
+ let n = this._rt.get(t.id);
2217
+ n && this._renderInstance(t, n, e);
2218
+ }
2219
+ }
2220
+ _ensureGlyphs(e, t, n, r) {
2221
+ let i = `${t}|${n.family}|${r}`;
2222
+ if (i !== e.glyphKey) {
2223
+ e.glyphKey = i, e.glyphG.textContent = "", e.glyphEls = [];
2224
+ for (let n = 0; n < r; n++) for (let n of t) {
2225
+ let t = W("text");
2226
+ t.setAttribute("text-anchor", "middle"), t.setAttribute("dominant-baseline", "central"), t.textContent = n, e.glyphG.appendChild(t), e.glyphEls.push(t);
2227
+ }
2228
+ }
2229
+ }
2230
+ _measure(e, t, n, r) {
2231
+ let i = t.letterSpacing || 0, a = He(t.opentype), o = `${r}|${n.family}|${t.fontSize}|${i}|${x(t.vf)}|${a}`;
2232
+ if (e.cache && e.cache.key === o) return e.cache;
2233
+ let s = this.measEl;
2234
+ s.style.fontFamily = `'${n.family}'`, s.style.fontSize = `${t.fontSize}px`, s.style.letterSpacing = `${i}px`, s.style.fontVariationSettings = x(t.vf), s.style.fontFeatureSettings = a, s.textContent = r;
2235
+ let c = r.length, l = Array(c), u = 0;
2236
+ try {
2237
+ u = s.getComputedTextLength();
2238
+ let e = Array(c);
2239
+ for (let t = 0; t < c; t++) e[t] = s.getStartPositionOfChar(t).x;
2240
+ for (let t = 0; t < c; t++) l[t] = (e[t] + (t + 1 < c ? e[t + 1] : u)) / 2;
2241
+ } catch {
2242
+ u = t.fontSize * .6 * c;
2243
+ for (let e = 0; e < c; e++) l[e] = (e + .5) * (u / Math.max(1, c));
2244
+ }
2245
+ return e.cache = {
2246
+ key: o,
2247
+ centers: l,
2248
+ total: u
2249
+ }, e.cache;
2250
+ }
2251
+ _renderInstance(e, t, n) {
2252
+ let r = b(e.font), i = e.phase ? U(n + e.phase) : n, a = We(e.text || "", e.case), s = Math.max(1, Math.round(e.multiply || 1)), c = s > 1 && a ? Array(s).fill(a).join(" ") : a, l = e.path?.type || "line", u = (e.offset?.x || 0) * this.w, d = (e.offset?.y || 0) * this.h;
2253
+ if (t.group.setAttribute("transform", `translate(${u.toFixed(2)} ${d.toFixed(2)})`), e.morph?.on && !Se(l) && !Ce(l)) {
2254
+ let n = r.url, a = e.morph.face2 ? b(e.morph.face2) : null, s = a ? a.url : n, u = o(n), d = o(s);
2255
+ if (u && d) {
2256
+ this._setKind(t, "morph"), this._renderMorph(e, t, i, u, d, r, c, l);
2257
+ return;
2258
+ }
2259
+ u || p(n).catch(() => {}), !d && s !== n && p(s).catch(() => {});
2260
+ }
2261
+ if (this._setKind(t, "text"), xe(l)) {
2262
+ t.pathEl.setAttribute("d", ""), t.pathEl.style.opacity = 0;
2263
+ let n = Math.max(1, Math.round(e.path?.rows ?? 2)), a = Math.max(1, Math.round(e.path?.cols ?? 3));
2264
+ if (this._ensureGlyphs(t, c, r, n * a), !c.length) return;
2265
+ this._measure(t, e, r, c), this._placeArray(e, t, r, i, t.glyphEls, n, a);
2266
+ return;
2267
+ }
2268
+ if (Se(l) || Ce(l)) {
2269
+ t.pathEl.setAttribute("d", ""), t.pathEl.style.opacity = 0;
2270
+ let n = Math.max(1, Math.round(e.path?.count ?? 12));
2271
+ if (this._ensureGlyphs(t, c, r, n), !c.length) return;
2272
+ this._measure(t, e, r, c), Se(l) ? this._placeRadial(e, t, r, i, t.glyphEls, n) : this._placeRings(e, t, r, i, t.glyphEls, n);
2273
+ return;
2274
+ }
2275
+ let f = we(l, this.w, this.h, e.path || {});
2276
+ t.closed = f.closed, t.pathEl.setAttribute("d", f.d), t.pathEl.setAttribute("stroke", e.showPath ? e.fill || "#888" : "none"), t.pathEl.setAttribute("stroke-width", +!!e.showPath), t.pathEl.style.opacity = e.showPath ? .25 : 0, this._ensureGlyphs(t, c, r, 1), c.length && (this._measure(t, e, r, c), this._placeOnPath(e, t, r, i, t.glyphEls));
2277
+ }
2278
+ _styleGlyph(e, t, n, r) {
2279
+ e.style.fontFamily = `'${n.family}'`, e.style.fontSize = `${t.fontSize}px`, e.style.fontStyle = t.italic ? "italic" : "normal", e.style.fontVariationSettings = x(r.vf ? {
2280
+ ...t.vf,
2281
+ ...r.vf
2282
+ } : t.vf), e.style.fontFeatureSettings = He(t.opentype), e.setAttribute("fill", t.fill || "#e8e4dc"), e.setAttribute("opacity", r.opacity);
2283
+ }
2284
+ _anim(e, t, n) {
2285
+ let r = e.motions && e.motions.length ? [e.motion, ...e.motions] : [e.motion], i = 0, a = 0, o = 0, s = 1, c = 1, l = null;
2286
+ for (let e of r) {
2287
+ if (!e || (e.mode || "none") === "none") continue;
2288
+ let r = n.axes.find((t) => t.tag === (e.axis || n.axes[0] && n.axes[0].tag)), u = Be(e.mode, {
2289
+ ...t,
2290
+ m: e,
2291
+ axisTag: r ? r.tag : "wght",
2292
+ axisMin: r ? r.min : 100,
2293
+ axisMax: r ? r.max : 900
2294
+ });
2295
+ i += u.dLen, a += u.dNormal, o += u.dRot, s *= u.scale, c *= u.opacity, u.vf && (l = {
2296
+ ...l || {},
2297
+ ...u.vf
2298
+ });
2299
+ }
2300
+ return {
2301
+ dLen: i,
2302
+ dNormal: a,
2303
+ scale: s,
2304
+ dRot: o,
2305
+ opacity: c,
2306
+ vf: l
2307
+ };
2308
+ }
2309
+ _placeOnPath(e, t, n, r, i) {
2310
+ let a = t.cache;
2311
+ if (!a) return;
2312
+ let o = t.pathEl.getTotalLength();
2313
+ if (!o) return;
2314
+ let { centers: s, total: c } = a, l = e.align || "center", u = l === "start" ? 0 : l === "end" ? o - c : (o - c) / 2, d = .75, f = t.closed, p = e.flow === "flow" && !f, m = (e) => f ? (e % o + o) % o : Math.max(0, Math.min(o, e)), h = (e) => {
2315
+ if (p && (e < 0 || e > o)) {
2316
+ let n = e < 0 ? 0 : o, r = t.pathEl.getPointAtLength(n), i = t.pathEl.getPointAtLength(Math.max(0, n - d)), a = t.pathEl.getPointAtLength(Math.min(o, n + d)), s = a.x - i.x, c = a.y - i.y, l = Math.hypot(s, c) || 1;
2317
+ s /= l, c /= l;
2318
+ let u = e - n;
2319
+ return {
2320
+ x: r.x + s * u,
2321
+ y: r.y + c * u
2322
+ };
2323
+ }
2324
+ return t.pathEl.getPointAtLength(m(e));
2325
+ }, g = Math.min(i.length, s.length), _ = y(e.stagger || 0), v = Math.max(1, Math.round(e.multiply || 1)), b = (s.length + 2) / v;
2326
+ for (let t = 0; t < g; t++) {
2327
+ let a = u + s[t], c = h(a), l = _ && v > 1 ? U(r + _ * Math.floor(t / b) / v) : r, f = this._anim(e, {
2328
+ i: t,
2329
+ n: s.length,
2330
+ u: l,
2331
+ sizePx: e.fontSize,
2332
+ pathLen: o,
2333
+ nx: this.w ? c.x / this.w : .5,
2334
+ ny: this.h ? c.y / this.h : .5
2335
+ }, n), p = a + f.dLen, m = h(p), g = h(p - d), y = h(p + d), x = Math.atan2(y.y - g.y, y.x - g.x) * 180 / Math.PI;
2336
+ i[t].setAttribute("transform", `translate(${m.x.toFixed(2)} ${m.y.toFixed(2)}) rotate(${(x + f.dRot).toFixed(2)}) translate(0 ${(-f.dNormal).toFixed(2)}) scale(${f.scale.toFixed(3)})`), this._styleGlyph(i[t], e, n, f);
2337
+ }
2338
+ }
2339
+ _placeArray(e, t, n, r, i, a, o) {
2340
+ let s = t.cache;
2341
+ if (!s) return;
2342
+ let { centers: c, total: l } = s, u = c.length;
2343
+ if (!u) return;
2344
+ let d = Math.min(this.w, this.h) * .08, f = (this.w - 2 * d) / o, p = (this.h - 2 * d) / a, m = y(e.stagger || 0), h = a * o;
2345
+ for (let t = 0; t < h; t++) {
2346
+ let a = Math.floor(t / o), s = d + t % o * f + f / 2, g = d + a * p + p / 2, _ = s - l / 2, v = m ? U(r + m * t / h) : r;
2347
+ for (let r = 0; r < u; r++) {
2348
+ let a = i[t * u + r];
2349
+ if (!a) continue;
2350
+ let o = _ + c[r], s = this._anim(e, {
2351
+ i: t * u + r,
2352
+ n: h * u,
2353
+ u: v,
2354
+ sizePx: e.fontSize,
2355
+ pathLen: 0,
2356
+ nx: this.w ? o / this.w : .5,
2357
+ ny: this.h ? g / this.h : .5
2358
+ }, n), l = g - s.dNormal;
2359
+ a.setAttribute("transform", `translate(${o.toFixed(2)} ${l.toFixed(2)}) rotate(${s.dRot.toFixed(2)}) scale(${s.scale.toFixed(3)})`), this._styleGlyph(a, e, n, s);
2360
+ }
2361
+ }
2362
+ }
2363
+ _placeRadial(e, t, n, r, i, a) {
2364
+ let o = t.cache;
2365
+ if (!o) return;
2366
+ let { centers: s } = o, c = s.length;
2367
+ if (!c) return;
2368
+ let u = this.w / 2, d = this.h / 2, f = Math.min(this.w, this.h) * .5, p = f * Math.max(0, Math.min(.95, e.path?.inner ?? .12)), m = Math.round(e.path?.spin ?? 1), h = y(e.stagger || 0);
2369
+ for (let t = 0; t < a; t++) {
2370
+ let o = a > 1 ? t / (a - 1) : 0, g = m + (h ? Math.round(h * 2 * o) : 0), _ = t / a * l + r * l * g, v = h ? U(r + h * t / a) : r, y = Math.cos(_), b = Math.sin(_), x = _ * 180 / Math.PI;
2371
+ for (let r = 0; r < c; r++) {
2372
+ let o = t * c + r, l = i[o];
2373
+ if (!l) continue;
2374
+ let m = p + s[r], h = u + y * m, g = d + b * m, _ = this._anim(e, {
2375
+ i: o,
2376
+ n: a * c,
2377
+ u: v,
2378
+ sizePx: e.fontSize,
2379
+ pathLen: f,
2380
+ nx: this.w ? h / this.w : .5,
2381
+ ny: this.h ? g / this.h : .5
2382
+ }, n), S = m + _.dLen, C = u + y * S, w = d + b * S;
2383
+ l.setAttribute("transform", `translate(${C.toFixed(2)} ${w.toFixed(2)}) rotate(${(x + _.dRot).toFixed(2)}) translate(0 ${(-_.dNormal).toFixed(2)}) scale(${_.scale.toFixed(3)})`), this._styleGlyph(l, e, n, _);
2384
+ }
2385
+ }
2386
+ }
2387
+ _placeRings(e, t, n, r, i, a) {
2388
+ let o = t.cache;
2389
+ if (!o) return;
2390
+ let { centers: s, total: c } = o, u = s.length;
2391
+ if (!u) return;
2392
+ let d = this.w / 2, f = this.h / 2, p = Math.min(this.w, this.h) * .5 * Math.max(.1, Math.min(1, e.path?.radius ?? .92)), m = p * Math.max(.02, Math.min(.95, e.path?.inner ?? .14)), h = Math.round(e.path?.spin ?? 1), g = e.path?.twist ?? .5, _ = e.path?.grow ?? .6, v = y(e.stagger || 0);
2393
+ for (let t = 0; t < a; t++) {
2394
+ let o = a > 1 ? t / (a - 1) : 0, y = Math.max(1, m + o * (p - m)), b = h + (v ? Math.round(v * 2 * o) : 0), x = r * l * b + o * g * l, S = v ? U(r + v * t / a) : r, C = 1 + _ * o;
2395
+ for (let r = 0; r < u; r++) {
2396
+ let o = t * u + r, p = i[o];
2397
+ if (!p) continue;
2398
+ let m = x + (s[r] - c / 2) / y, h = d + Math.cos(m) * y, g = f + Math.sin(m) * y, _ = this._anim(e, {
2399
+ i: o,
2400
+ n: a * u,
2401
+ u: S,
2402
+ sizePx: e.fontSize,
2403
+ pathLen: l * y,
2404
+ nx: this.w ? h / this.w : .5,
2405
+ ny: this.h ? g / this.h : .5
2406
+ }, n), v = m + _.dLen / y, b = y - _.dNormal, w = d + Math.cos(v) * b, T = f + Math.sin(v) * b, ee = v * 180 / Math.PI + 90 + _.dRot;
2407
+ p.setAttribute("transform", `translate(${w.toFixed(2)} ${T.toFixed(2)}) rotate(${ee.toFixed(2)}) scale(${(_.scale * C).toFixed(3)})`), this._styleGlyph(p, e, n, _);
2408
+ }
2409
+ }
2410
+ }
2411
+ _setKind(e, t) {
2412
+ e.kind !== t && (e.kind = t, e.glyphG.textContent = "", e.glyphEls = [], e.morphEls = [], e.glyphKey = "", e.morphKey = "", e.morphPoolKey = "", e.cache = null);
2413
+ }
2414
+ _renderMorph(e, n, r, i, a, o, s, c) {
2415
+ let l = e.fontSize, u = o.axes || [], d = {};
2416
+ for (let t of u) d[t.tag] = e.vf?.[t.tag] ?? t.def;
2417
+ let f = !!e.morph.face2, p = {};
2418
+ if (!f) for (let t of u) p[t.tag] = e.morph.vf2?.[t.tag] ?? t.max;
2419
+ let m = l * .12 + (e.letterSpacing || 0), h = e.morph.mode || "morph", g = e.morph.blend ?? .5, _ = e.morph.curve || "flat", v = e.morph.cp1 || {
2420
+ x: .33,
2421
+ y: .33
2422
+ }, y = e.morph.cp2 || {
2423
+ x: .66,
2424
+ y: .66
2425
+ }, b = e.fill || "#e8e4dc", x = JSON.stringify([
2426
+ s,
2427
+ e.font,
2428
+ e.morph.face2 || "",
2429
+ l,
2430
+ d,
2431
+ p,
2432
+ h,
2433
+ g,
2434
+ _,
2435
+ v,
2436
+ y,
2437
+ e.letterSpacing || 0,
2438
+ b
2439
+ ]), S = x !== n.morphKey;
2440
+ if (S) {
2441
+ n.morphKey = x;
2442
+ let e = t(i, a, s, l, {
2443
+ mode: h,
2444
+ blend: g,
2445
+ curve: _,
2446
+ cp1: v,
2447
+ cp2: y,
2448
+ coordsA: d,
2449
+ coordsB: p,
2450
+ axes: u,
2451
+ gap: m
2452
+ });
2453
+ n.morphData = e;
2454
+ let r = [], o = 0;
2455
+ for (let t of e.glyphs) r.push(o + t.advance / 2), o += t.advance;
2456
+ n.morphCenters = r, n.morphTotal = e.totalAdvance;
2457
+ }
2458
+ let C = n.morphData?.glyphs.length || 0;
2459
+ if (!s.length || !C) {
2460
+ n.pathEl.setAttribute("d", ""), n.pathEl.style.opacity = 0;
2461
+ return;
2462
+ }
2463
+ let w = xe(c), T = w ? Math.max(1, Math.round(e.path?.rows ?? 2)) : 1, ee = w ? Math.max(1, Math.round(e.path?.cols ?? 3)) : 1, te = w ? T * ee : 1, ne = this._ensureMorphPool(n, C, te, h);
2464
+ if ((S || ne) && this._refreshMorphPaths(n, te, h, b), w) {
2465
+ n.pathEl.setAttribute("d", ""), n.pathEl.style.opacity = 0, this._placeMorphArray(e, n, o, r, T, ee);
2466
+ return;
2467
+ }
2468
+ let E = we(c, this.w, this.h, e.path || {});
2469
+ n.closed = E.closed, n.pathEl.setAttribute("d", E.d), n.pathEl.setAttribute("stroke", e.showPath ? e.fill || "#888" : "none"), n.pathEl.setAttribute("stroke-width", +!!e.showPath), n.pathEl.style.opacity = e.showPath ? .25 : 0, this._placeMorphOnPath(e, n, o, r);
2470
+ }
2471
+ _ensureMorphPool(e, t, n, r) {
2472
+ let i = `${t}|${n}|${r}`;
2473
+ if (i === e.morphPoolKey) return !1;
2474
+ e.morphPoolKey = i, e.glyphG.textContent = "", e.morphEls = [];
2475
+ let a = t * n;
2476
+ for (let t = 0; t < a; t++) {
2477
+ let t = W("g");
2478
+ t.appendChild(W("path")), r === "fade" && t.appendChild(W("path")), e.glyphG.appendChild(t), e.morphEls.push(t);
2479
+ }
2480
+ return !0;
2481
+ }
2482
+ _refreshMorphPaths(e, t, n, r) {
2483
+ let i = e.morphData?.glyphs || [], a = i.length;
2484
+ if (a) for (let t = 0; t < e.morphEls.length; t++) {
2485
+ let o = e.morphEls[t], s = i[t % a];
2486
+ if (!s) continue;
2487
+ let c = o.childNodes;
2488
+ n === "fade" ? (this._setMorphPath(c[0], s.dA, s.bboxA, r, s.opA), this._setMorphPath(c[1], s.dB, s.bboxB, r, s.opB)) : this._setMorphPath(c[0], s.d, s.bbox, r, 1);
2489
+ }
2490
+ }
2491
+ _setMorphPath(e, t, n, r, i) {
2492
+ if (!e) return;
2493
+ e.setAttribute("d", t || ""), e.setAttribute("fill", r), e.setAttribute("fill-rule", "evenodd"), e.setAttribute("opacity", i);
2494
+ let a = (n.x1 + n.x2) / 2, o = (n.y1 + n.y2) / 2;
2495
+ e.setAttribute("transform", `translate(${(-a).toFixed(2)} ${(-o).toFixed(2)})`);
2496
+ }
2497
+ _placeMorphOnPath(e, t, n, r, i = t.morphEls) {
2498
+ let a = t.morphCenters, o = t.morphTotal;
2499
+ if (!a || !i) return;
2500
+ let s = t.pathEl.getTotalLength();
2501
+ if (!s) return;
2502
+ let c = e.align || "center", l = c === "start" ? 0 : c === "end" ? s - o : (s - o) / 2, u = .75, d = t.closed, f = e.flow === "flow" && !d, p = (e) => d ? (e % s + s) % s : Math.max(0, Math.min(s, e)), m = (e) => {
2503
+ if (f && (e < 0 || e > s)) {
2504
+ let n = e < 0 ? 0 : s, r = t.pathEl.getPointAtLength(n), i = t.pathEl.getPointAtLength(Math.max(0, n - u)), a = t.pathEl.getPointAtLength(Math.min(s, n + u)), o = a.x - i.x, c = a.y - i.y, l = Math.hypot(o, c) || 1;
2505
+ o /= l, c /= l;
2506
+ let d = e - n;
2507
+ return {
2508
+ x: r.x + o * d,
2509
+ y: r.y + c * d
2510
+ };
2511
+ }
2512
+ return t.pathEl.getPointAtLength(p(e));
2513
+ }, h = e.italic ? " skewX(-12)" : "", g = Math.min(i.length, a.length), _ = y(e.stagger || 0), v = Math.max(1, Math.round(e.multiply || 1)), b = (a.length + 2) / v;
2514
+ for (let t = 0; t < g; t++) {
2515
+ let o = l + a[t], c = m(o), d = _ && v > 1 ? U(r + _ * Math.floor(t / b) / v) : r, f = this._anim(e, {
2516
+ i: t,
2517
+ n: a.length,
2518
+ u: d,
2519
+ sizePx: e.fontSize,
2520
+ pathLen: s,
2521
+ nx: this.w ? c.x / this.w : .5,
2522
+ ny: this.h ? c.y / this.h : .5
2523
+ }, n), p = o + f.dLen, g = m(p), y = m(p - u), x = m(p + u), S = Math.atan2(x.y - y.y, x.x - y.x) * 180 / Math.PI;
2524
+ i[t].setAttribute("transform", `translate(${g.x.toFixed(2)} ${g.y.toFixed(2)}) rotate(${(S + f.dRot).toFixed(2)}) translate(0 ${(-f.dNormal).toFixed(2)}) scale(${f.scale.toFixed(3)})${h}`), i[t].setAttribute("opacity", f.opacity);
2525
+ }
2526
+ }
2527
+ _placeMorphArray(e, t, n, r, i, a, o = t.morphEls) {
2528
+ let s = t.morphCenters, c = t.morphTotal;
2529
+ if (!s || !o) return;
2530
+ let l = s.length;
2531
+ if (!l) return;
2532
+ let u = Math.min(this.w, this.h) * .08, d = (this.w - 2 * u) / a, f = (this.h - 2 * u) / i, p = e.italic ? " skewX(-12)" : "", m = y(e.stagger || 0), h = i * a;
2533
+ for (let t = 0; t < h; t++) {
2534
+ let i = Math.floor(t / a), g = u + t % a * d + d / 2, _ = u + i * f + f / 2, v = g - c / 2, y = m ? U(r + m * t / h) : r;
2535
+ for (let r = 0; r < l; r++) {
2536
+ let i = t * l + r, a = o[i];
2537
+ if (!a) continue;
2538
+ let c = v + s[r], u = this._anim(e, {
2539
+ i,
2540
+ n: h * l,
2541
+ u: y,
2542
+ sizePx: e.fontSize,
2543
+ pathLen: 0,
2544
+ nx: this.w ? c / this.w : .5,
2545
+ ny: this.h ? _ / this.h : .5
2546
+ }, n), d = _ - u.dNormal;
2547
+ a.setAttribute("transform", `translate(${c.toFixed(2)} ${d.toFixed(2)}) rotate(${u.dRot.toFixed(2)}) scale(${u.scale.toFixed(3)})${p}`), a.setAttribute("opacity", u.opacity);
2548
+ }
2549
+ }
2550
+ }
2551
+ }, G = (e, t = 0) => e?.instances?.[t] ?? null, K = (e, t, n = 0) => ({
2552
+ ...e,
2553
+ instances: (e.instances ?? []).map((e, r) => r === n ? {
2554
+ ...e,
2555
+ ...t
2556
+ } : e)
2557
+ }), qe = (e, t) => ({
2558
+ ...e,
2559
+ instances: (e.instances ?? []).map((e, n, r) => ({
2560
+ ...e,
2561
+ ...t(e, n, r.length)
2562
+ }))
2563
+ }), q = (e, t, n = 0) => K(e, { path: {
2564
+ ...G(e, n)?.path ?? {},
2565
+ ...t
2566
+ } }, n), J = (e, t, n = 0) => K(e, { motion: {
2567
+ ...G(e, n)?.motion ?? {},
2568
+ ...t
2569
+ } }, n), Y = (e, t = 0) => G(e, t)?.path?.type ?? "line", X = (e, t = 0) => G(e, t)?.motion?.mode ?? "none", Je = (e, t = 0) => ![
2570
+ "radial",
2571
+ "rings",
2572
+ "array"
2573
+ ].includes(Y(e, t)), Ye = [
2574
+ {
2575
+ value: "line",
2576
+ label: "Line"
2577
+ },
2578
+ {
2579
+ value: "arc",
2580
+ label: "Arc"
2581
+ },
2582
+ {
2583
+ value: "sine",
2584
+ label: "Sine"
2585
+ },
2586
+ {
2587
+ value: "zigzag",
2588
+ label: "Zigzag"
2589
+ },
2590
+ {
2591
+ value: "spiral",
2592
+ label: "Spiral"
2593
+ },
2594
+ {
2595
+ value: "circle",
2596
+ label: "Circle"
2597
+ },
2598
+ {
2599
+ value: "ellipse",
2600
+ label: "Ellipse"
2601
+ },
2602
+ {
2603
+ value: "custom",
2604
+ label: "Custom"
2605
+ },
2606
+ {
2607
+ value: "array",
2608
+ label: "Array"
2609
+ },
2610
+ {
2611
+ value: "radial",
2612
+ label: "Radial"
2613
+ },
2614
+ {
2615
+ value: "rings",
2616
+ label: "Rings"
2617
+ }
2618
+ ], Z = (e, t = 0) => G(e, t)?.morph ?? {}, Q = (e, t, n = 0) => K(e, { morph: {
2619
+ ...G(e, n)?.morph ?? {},
2620
+ ...t
2621
+ } }, n), Xe = (e, t, n, r = 0) => Q(e, { vf2: {
2622
+ ...Z(e, r).vf2 ?? {},
2623
+ [t]: n
2624
+ } }, r), Ze = (e, t = 0) => !["radial", "rings"].includes(Y(e, t)), Qe = (e, t = 0) => Ze(e, t) && !!Z(e, t).on, $e = (e, t = 0) => Z(e, t).mode ?? "morph", et = (e, t = 0) => Qe(e, t) && ["morph", "fade"].includes($e(e, t)), $ = (e, t, n = 0) => b(G(e, n)?.font).axes.find((e) => e.tag === t), tt = (e, t, n, r = 0) => {
2625
+ let i = $(e, t, r), a = i ? Math.min(i.max, Math.max(i.min, n)) : n;
2626
+ return Xe(e, t, Math.round(a), r);
2627
+ }, nt = (e, t, n, r = 0) => {
2628
+ let i = $(e, t, r), a = i ? Math.min(i.max, Math.max(i.min, n)) : n;
2629
+ return K(e, { vf: {
2630
+ ...G(e, r)?.vf ?? {},
2631
+ [t]: Math.round(a)
2632
+ } }, r);
2633
+ }, rt = (e) => ({
2634
+ key: `vf${e[0].toUpperCase()}${e.slice(1)}`,
2635
+ label: C[e] || e,
2636
+ tab: "style",
2637
+ section: "Axes",
2638
+ type: "range",
2639
+ step: 1,
2640
+ min: (t, n = 0) => $(t, e, n)?.min ?? 0,
2641
+ max: (t, n = 0) => $(t, e, n)?.max ?? 1e3,
2642
+ when: (t, n = 0) => !!$(t, e, n),
2643
+ get: (t, n = 0) => G(t, n)?.vf?.[e] ?? $(t, e, n)?.def ?? 0,
2644
+ set: (t, n, r = 0) => nt(t, e, n, r)
2645
+ }), it = (e, t = 0) => Qe(e, t) && $e(e, t) === "morph" && (Z(e, t).curve ?? "flat") === "custom", at = (e, t) => ({
2646
+ key: `morphC${e}${t}`,
2647
+ label: `P${e} ${t.toUpperCase()}`,
2648
+ tab: "style",
2649
+ section: "Morph",
2650
+ type: "range",
2651
+ min: 0,
2652
+ max: 1,
2653
+ step: .01,
2654
+ noRandom: !0,
2655
+ when: it,
2656
+ get: (n, r = 0) => Z(n, r)[`cp${e}`]?.[t] ?? (e === 1 ? .33 : .66),
2657
+ set: (n, r, i = 0) => Q(n, { [`cp${e}`]: {
2658
+ ...Z(n, i)[`cp${e}`] ?? {
2659
+ x: e === 1 ? .33 : .66,
2660
+ y: e === 1 ? .33 : .66
2661
+ },
2662
+ [t]: r
2663
+ } }, i)
2664
+ }), ot = [
2665
+ {
2666
+ key: "bg",
2667
+ label: "Background",
2668
+ tab: "style",
2669
+ type: "color",
2670
+ role: "bg",
2671
+ noRandom: !0,
2672
+ get: (e) => e.bg,
2673
+ set: (e, t) => ({
2674
+ ...e,
2675
+ bg: t
2676
+ })
2677
+ },
2678
+ {
2679
+ key: "fill",
2680
+ label: "Fill",
2681
+ tab: "style",
2682
+ type: "color",
2683
+ role: "fg",
2684
+ noRandom: !0,
2685
+ get: (e, t = 0) => G(e, t)?.fill,
2686
+ set: (e, t, n = 0) => K(e, { fill: t }, n)
2687
+ },
2688
+ {
2689
+ key: "font",
2690
+ label: "Font",
2691
+ tab: "style",
2692
+ type: "select",
2693
+ options: T,
2694
+ noRandom: !0,
2695
+ get: (e, t = 0) => G(e, t)?.font,
2696
+ set: (e, t, n = 0) => K(e, {
2697
+ font: t,
2698
+ vf: De(t, G(e, n)?.vf)
2699
+ }, n)
2700
+ },
2701
+ {
2702
+ key: "italic",
2703
+ label: "Italic",
2704
+ tab: "style",
2705
+ type: "select",
2706
+ noRandom: !0,
2707
+ options: [{
2708
+ value: "off",
2709
+ label: "Off"
2710
+ }, {
2711
+ value: "on",
2712
+ label: "On"
2713
+ }],
2714
+ get: (e, t = 0) => G(e, t)?.italic ? "on" : "off",
2715
+ set: (e, t, n = 0) => K(e, { italic: t === "on" }, n)
2716
+ },
2717
+ {
2718
+ key: "case",
2719
+ label: "Case",
2720
+ tab: "style",
2721
+ type: "select",
2722
+ noRandom: !0,
2723
+ options: [
2724
+ {
2725
+ value: "none",
2726
+ label: "Aa"
2727
+ },
2728
+ {
2729
+ value: "upper",
2730
+ label: "AA"
2731
+ },
2732
+ {
2733
+ value: "lower",
2734
+ label: "aa"
2735
+ },
2736
+ {
2737
+ value: "title",
2738
+ label: "Tt"
2739
+ }
2740
+ ],
2741
+ get: (e, t = 0) => G(e, t)?.case ?? "none",
2742
+ set: (e, t, n = 0) => K(e, { case: t }, n)
2743
+ },
2744
+ {
2745
+ key: "fontSize",
2746
+ label: "Font size",
2747
+ tab: "style",
2748
+ type: "range",
2749
+ min: 8,
2750
+ max: 1200,
2751
+ step: 1,
2752
+ rMin: 36,
2753
+ rMax: 150,
2754
+ get: (e, t = 0) => G(e, t)?.fontSize ?? 26,
2755
+ set: (e, t, n = 0) => K(e, { fontSize: Math.round(t) }, n)
2756
+ },
2757
+ {
2758
+ key: "letterSpacing",
2759
+ label: "Letter spacing",
2760
+ tab: "style",
2761
+ type: "range",
2762
+ min: -10,
2763
+ max: 400,
2764
+ step: .5,
2765
+ rMin: 0,
2766
+ rMax: 12,
2767
+ get: (e, t = 0) => G(e, t)?.letterSpacing ?? 0,
2768
+ set: (e, t, n = 0) => K(e, { letterSpacing: t }, n)
2769
+ },
2770
+ {
2771
+ key: "align",
2772
+ label: "Align",
2773
+ tab: "style",
2774
+ type: "select",
2775
+ noRandom: !0,
2776
+ when: Je,
2777
+ options: [
2778
+ {
2779
+ value: "start",
2780
+ label: "Start"
2781
+ },
2782
+ {
2783
+ value: "center",
2784
+ label: "Center"
2785
+ },
2786
+ {
2787
+ value: "end",
2788
+ label: "End"
2789
+ }
2790
+ ],
2791
+ get: (e, t = 0) => G(e, t)?.align ?? "center",
2792
+ set: (e, t, n = 0) => K(e, { align: t }, n)
2793
+ },
2794
+ {
2795
+ key: "multiply",
2796
+ label: "Copies",
2797
+ tab: "style",
2798
+ type: "range",
2799
+ min: 1,
2800
+ max: 24,
2801
+ step: 1,
2802
+ noRandom: !0,
2803
+ when: Je,
2804
+ get: (e, t = 0) => G(e, t)?.multiply ?? 1,
2805
+ set: (e, t, n = 0) => K(e, { multiply: Math.round(t) }, n)
2806
+ },
2807
+ rt("wdth"),
2808
+ rt("wght"),
2809
+ {
2810
+ key: "arrangement",
2811
+ label: "Arrangement",
2812
+ tab: "style",
2813
+ section: "Arrangement",
2814
+ type: "select",
2815
+ noRandom: !0,
2816
+ options: Ye,
2817
+ get: Y,
2818
+ set: (e, t, n = 0) => q(e, { type: t }, n)
2819
+ },
2820
+ {
2821
+ key: "spokes",
2822
+ label: "Spokes",
2823
+ tab: "style",
2824
+ section: "Arrangement",
2825
+ type: "range",
2826
+ min: 2,
2827
+ max: 32,
2828
+ step: 1,
2829
+ rMin: 6,
2830
+ rMax: 28,
2831
+ when: (e, t = 0) => Y(e, t) === "radial",
2832
+ get: (e, t = 0) => G(e, t)?.path?.count ?? 12,
2833
+ set: (e, t, n = 0) => q(e, { count: Math.round(t) }, n)
2834
+ },
2835
+ {
2836
+ key: "rings",
2837
+ label: "Rings",
2838
+ tab: "style",
2839
+ section: "Arrangement",
2840
+ type: "range",
2841
+ min: 2,
2842
+ max: 24,
2843
+ step: 1,
2844
+ rMin: 4,
2845
+ rMax: 16,
2846
+ when: (e, t = 0) => Y(e, t) === "rings",
2847
+ get: (e, t = 0) => G(e, t)?.path?.count ?? 12,
2848
+ set: (e, t, n = 0) => q(e, { count: Math.round(t) }, n)
2849
+ },
2850
+ {
2851
+ key: "inner",
2852
+ label: "Inner radius",
2853
+ tab: "style",
2854
+ section: "Arrangement",
2855
+ type: "range",
2856
+ min: 0,
2857
+ max: .9,
2858
+ step: .01,
2859
+ rMin: .04,
2860
+ rMax: .4,
2861
+ when: (e, t = 0) => Y(e, t) === "radial" || Y(e, t) === "rings",
2862
+ get: (e, t = 0) => G(e, t)?.path?.inner ?? .12,
2863
+ set: (e, t, n = 0) => q(e, { inner: t }, n)
2864
+ },
2865
+ {
2866
+ key: "ringRadius",
2867
+ label: "Radius",
2868
+ tab: "style",
2869
+ section: "Arrangement",
2870
+ type: "range",
2871
+ min: .1,
2872
+ max: 1,
2873
+ step: .01,
2874
+ rMin: .6,
2875
+ rMax: 1,
2876
+ when: (e, t = 0) => Y(e, t) === "rings",
2877
+ get: (e, t = 0) => G(e, t)?.path?.radius ?? .92,
2878
+ set: (e, t, n = 0) => q(e, { radius: t }, n)
2879
+ },
2880
+ {
2881
+ key: "twist",
2882
+ label: "Twist",
2883
+ tab: "style",
2884
+ section: "Arrangement",
2885
+ type: "range",
2886
+ min: 0,
2887
+ max: 2,
2888
+ step: .05,
2889
+ rMin: 0,
2890
+ rMax: 1.5,
2891
+ when: (e, t = 0) => Y(e, t) === "rings",
2892
+ get: (e, t = 0) => G(e, t)?.path?.twist ?? .5,
2893
+ set: (e, t, n = 0) => q(e, { twist: t }, n)
2894
+ },
2895
+ {
2896
+ key: "grow",
2897
+ label: "Grow",
2898
+ tab: "style",
2899
+ section: "Arrangement",
2900
+ type: "range",
2901
+ min: 0,
2902
+ max: 2,
2903
+ step: .05,
2904
+ rMin: 0,
2905
+ rMax: 1.5,
2906
+ when: (e, t = 0) => Y(e, t) === "rings",
2907
+ get: (e, t = 0) => G(e, t)?.path?.grow ?? .6,
2908
+ set: (e, t, n = 0) => q(e, { grow: t }, n)
2909
+ },
2910
+ {
2911
+ key: "pathRadius",
2912
+ label: "Radius",
2913
+ tab: "style",
2914
+ section: "Arrangement",
2915
+ type: "range",
2916
+ min: .2,
2917
+ max: 1,
2918
+ step: .01,
2919
+ rMin: .5,
2920
+ rMax: 1,
2921
+ when: (e, t = 0) => [
2922
+ "circle",
2923
+ "ellipse",
2924
+ "spiral"
2925
+ ].includes(Y(e, t)),
2926
+ get: (e, t = 0) => G(e, t)?.path?.radius ?? .72,
2927
+ set: (e, t, n = 0) => q(e, { radius: t }, n)
2928
+ },
2929
+ {
2930
+ key: "turns",
2931
+ label: "Turns",
2932
+ tab: "style",
2933
+ section: "Arrangement",
2934
+ type: "range",
2935
+ min: 1,
2936
+ max: 8,
2937
+ rMin: 1,
2938
+ rMax: 6,
2939
+ step: 1,
2940
+ rMin: 2,
2941
+ rMax: 5,
2942
+ when: (e, t = 0) => Y(e, t) === "spiral",
2943
+ get: (e, t = 0) => G(e, t)?.path?.turns ?? 3,
2944
+ set: (e, t, n = 0) => q(e, { turns: Math.round(t) }, n)
2945
+ },
2946
+ {
2947
+ key: "amp",
2948
+ label: "Amplitude",
2949
+ tab: "style",
2950
+ section: "Arrangement",
2951
+ type: "range",
2952
+ min: 0,
2953
+ max: 1,
2954
+ step: .05,
2955
+ rMin: .2,
2956
+ rMax: .7,
2957
+ when: (e, t = 0) => [
2958
+ "arc",
2959
+ "sine",
2960
+ "zigzag"
2961
+ ].includes(Y(e, t)),
2962
+ get: (e, t = 0) => G(e, t)?.path?.amp ?? .4,
2963
+ set: (e, t, n = 0) => q(e, { amp: t }, n)
2964
+ },
2965
+ {
2966
+ key: "freq",
2967
+ label: "Frequency",
2968
+ tab: "style",
2969
+ section: "Arrangement",
2970
+ type: "range",
2971
+ min: 1,
2972
+ max: 6,
2973
+ step: 1,
2974
+ rMin: 1,
2975
+ rMax: 4,
2976
+ when: (e, t = 0) => ["sine", "zigzag"].includes(Y(e, t)),
2977
+ get: (e, t = 0) => G(e, t)?.path?.freq ?? 2,
2978
+ set: (e, t, n = 0) => q(e, { freq: Math.round(t) }, n)
2979
+ },
2980
+ {
2981
+ key: "rows",
2982
+ label: "Rows",
2983
+ tab: "style",
2984
+ section: "Arrangement",
2985
+ type: "range",
2986
+ min: 1,
2987
+ max: 6,
2988
+ step: 1,
2989
+ rMin: 2,
2990
+ rMax: 4,
2991
+ when: (e, t = 0) => Y(e, t) === "array",
2992
+ get: (e, t = 0) => G(e, t)?.path?.rows ?? 2,
2993
+ set: (e, t, n = 0) => q(e, { rows: Math.round(t) }, n)
2994
+ },
2995
+ {
2996
+ key: "cols",
2997
+ label: "Columns",
2998
+ tab: "style",
2999
+ section: "Arrangement",
3000
+ type: "range",
3001
+ min: 1,
3002
+ max: 8,
3003
+ step: 1,
3004
+ rMin: 2,
3005
+ rMax: 6,
3006
+ when: (e, t = 0) => Y(e, t) === "array",
3007
+ get: (e, t = 0) => G(e, t)?.path?.cols ?? 3,
3008
+ set: (e, t, n = 0) => q(e, { cols: Math.round(t) }, n)
3009
+ },
3010
+ {
3011
+ key: "flow",
3012
+ label: "Paragraph",
3013
+ tab: "style",
3014
+ section: "Arrangement",
3015
+ type: "select",
3016
+ noRandom: !0,
3017
+ when: Je,
3018
+ options: [{
3019
+ value: "flow",
3020
+ label: "Flow"
3021
+ }, {
3022
+ value: "contain",
3023
+ label: "Contain"
3024
+ }],
3025
+ get: (e, t = 0) => G(e, t)?.flow ?? "flow",
3026
+ set: (e, t, n = 0) => K(e, { flow: t }, n)
3027
+ },
3028
+ {
3029
+ key: "showPath",
3030
+ label: "Show path",
3031
+ tab: "style",
3032
+ section: "Arrangement",
3033
+ type: "select",
3034
+ noRandom: !0,
3035
+ when: Je,
3036
+ options: [{
3037
+ value: "off",
3038
+ label: "Off"
3039
+ }, {
3040
+ value: "on",
3041
+ label: "On"
3042
+ }],
3043
+ get: (e, t = 0) => G(e, t)?.showPath ? "on" : "off",
3044
+ set: (e, t, n = 0) => K(e, { showPath: t === "on" }, n)
3045
+ },
3046
+ {
3047
+ key: "offsetX",
3048
+ label: "X",
3049
+ tab: "style",
3050
+ section: "Position",
3051
+ type: "range",
3052
+ min: -1,
3053
+ max: 1,
3054
+ step: .01,
3055
+ noRandom: !0,
3056
+ get: (e, t = 0) => G(e, t)?.offset?.x ?? 0,
3057
+ set: (e, t, n = 0) => K(e, { offset: {
3058
+ ...G(e, n)?.offset ?? {},
3059
+ x: t
3060
+ } }, n)
3061
+ },
3062
+ {
3063
+ key: "offsetY",
3064
+ label: "Y",
3065
+ tab: "style",
3066
+ section: "Position",
3067
+ type: "range",
3068
+ min: -1,
3069
+ max: 1,
3070
+ step: .01,
3071
+ noRandom: !0,
3072
+ get: (e, t = 0) => G(e, t)?.offset?.y ?? 0,
3073
+ set: (e, t, n = 0) => K(e, { offset: {
3074
+ ...G(e, n)?.offset ?? {},
3075
+ y: t
3076
+ } }, n)
3077
+ },
3078
+ {
3079
+ key: "morphOn",
3080
+ label: "Morph outlines",
3081
+ tab: "style",
3082
+ section: "Morph",
3083
+ type: "select",
3084
+ noRandom: !0,
3085
+ when: Ze,
3086
+ options: [{
3087
+ value: "off",
3088
+ label: "Off"
3089
+ }, {
3090
+ value: "on",
3091
+ label: "On"
3092
+ }],
3093
+ get: (e, t = 0) => Z(e, t).on ? "on" : "off",
3094
+ set: (e, t, n = 0) => Q(e, { on: t === "on" }, n)
3095
+ },
3096
+ {
3097
+ key: "morphMode",
3098
+ label: "Mode",
3099
+ tab: "style",
3100
+ section: "Morph",
3101
+ type: "select",
3102
+ when: Qe,
3103
+ options: h,
3104
+ get: $e,
3105
+ set: (e, t, n = 0) => Q(e, { mode: t }, n)
3106
+ },
3107
+ {
3108
+ key: "morphFace2",
3109
+ label: "Cut B face",
3110
+ tab: "style",
3111
+ section: "Morph",
3112
+ type: "select",
3113
+ noRandom: !0,
3114
+ when: et,
3115
+ options: (e, t = 0) => [{
3116
+ value: "",
3117
+ label: "Off"
3118
+ }, ...T.filter((n) => n.value !== G(e, t)?.font)],
3119
+ get: (e, t = 0) => Z(e, t).face2 ?? "",
3120
+ set: (e, t, n = 0) => Q(e, { face2: t }, n)
3121
+ },
3122
+ {
3123
+ key: "morphVf2Wdth",
3124
+ label: "Cut B · Width",
3125
+ tab: "style",
3126
+ section: "Morph",
3127
+ type: "range",
3128
+ min: 64,
3129
+ max: 172,
3130
+ step: 1,
3131
+ when: (e, t = 0) => et(e, t) && !Z(e, t).face2 && !!$(e, "wdth", t),
3132
+ get: (e, t = 0) => Z(e, t).vf2?.wdth ?? $(e, "wdth", t)?.max ?? 172,
3133
+ set: (e, t, n = 0) => tt(e, "wdth", t, n)
3134
+ },
3135
+ {
3136
+ key: "morphVf2Wght",
3137
+ label: "Cut B · Weight",
3138
+ tab: "style",
3139
+ section: "Morph",
3140
+ type: "range",
3141
+ min: 100,
3142
+ max: 900,
3143
+ step: 1,
3144
+ when: (e, t = 0) => et(e, t) && !Z(e, t).face2 && !!$(e, "wght", t),
3145
+ get: (e, t = 0) => Z(e, t).vf2?.wght ?? $(e, "wght", t)?.max ?? 900,
3146
+ set: (e, t, n = 0) => tt(e, "wght", t, n)
3147
+ },
3148
+ {
3149
+ key: "morphCurve",
3150
+ label: "Curve",
3151
+ tab: "style",
3152
+ section: "Morph",
3153
+ type: "select",
3154
+ when: (e, t = 0) => Qe(e, t) && $e(e, t) === "morph",
3155
+ options: s,
3156
+ get: (e, t = 0) => Z(e, t).curve ?? "flat",
3157
+ set: (e, t, n = 0) => Q(e, { curve: t }, n)
3158
+ },
3159
+ at(1, "x"),
3160
+ at(1, "y"),
3161
+ at(2, "x"),
3162
+ at(2, "y"),
3163
+ {
3164
+ key: "morphBlend",
3165
+ label: "Blend",
3166
+ tab: "style",
3167
+ section: "Morph",
3168
+ type: "range",
3169
+ min: 0,
3170
+ max: 1,
3171
+ step: .01,
3172
+ when: (e, t = 0) => Qe(e, t) && $e(e, t) !== "random",
3173
+ get: (e, t = 0) => Z(e, t).blend ?? .5,
3174
+ set: (e, t, n = 0) => Q(e, { blend: t }, n)
3175
+ },
3176
+ {
3177
+ key: "morphSeed",
3178
+ label: "Seed",
3179
+ tab: "style",
3180
+ section: "Morph",
3181
+ type: "range",
3182
+ min: 0,
3183
+ max: 1,
3184
+ step: .01,
3185
+ when: (e, t = 0) => Qe(e, t) && $e(e, t) === "random",
3186
+ get: (e, t = 0) => Z(e, t).blend ?? .5,
3187
+ set: (e, t, n = 0) => Q(e, { blend: t }, n)
3188
+ },
3189
+ {
3190
+ key: "mode",
3191
+ label: "Motion",
3192
+ tab: "anim",
3193
+ type: "select",
3194
+ noRandom: !0,
3195
+ options: [
3196
+ {
3197
+ value: "none",
3198
+ label: "None"
3199
+ },
3200
+ {
3201
+ value: "march",
3202
+ label: "March"
3203
+ },
3204
+ {
3205
+ value: "orbit",
3206
+ label: "Orbit"
3207
+ },
3208
+ {
3209
+ value: "vfwave",
3210
+ label: "Axis wave"
3211
+ },
3212
+ {
3213
+ value: "glyphwave",
3214
+ label: "Glyph wave"
3215
+ },
3216
+ {
3217
+ value: "cascade",
3218
+ label: "Cascade"
3219
+ },
3220
+ {
3221
+ value: "sweep",
3222
+ label: "Sweep"
3223
+ },
3224
+ {
3225
+ value: "sweepWeight",
3226
+ label: "Sweep weight"
3227
+ },
3228
+ {
3229
+ value: "sweepShift",
3230
+ label: "Sweep shift"
3231
+ }
3232
+ ],
3233
+ get: X,
3234
+ set: (e, t, n = 0) => J(e, { mode: t }, n)
3235
+ },
3236
+ {
3237
+ key: "cycles",
3238
+ label: "Cycles",
3239
+ tab: "anim",
3240
+ type: "range",
3241
+ min: 1,
3242
+ max: 8,
3243
+ rMin: 1,
3244
+ rMax: 4,
3245
+ step: 1,
3246
+ rMin: 1,
3247
+ rMax: 3,
3248
+ when: (e, t = 0) => X(e, t) !== "none",
3249
+ get: (e, t = 0) => G(e, t)?.motion?.cycles ?? 1,
3250
+ set: (e, t, n = 0) => J(e, { cycles: Math.round(t) }, n)
3251
+ },
3252
+ {
3253
+ key: "motionAmp",
3254
+ label: "Amount",
3255
+ tab: "anim",
3256
+ type: "range",
3257
+ min: .05,
3258
+ max: 1,
3259
+ step: .05,
3260
+ rMin: .15,
3261
+ rMax: .6,
3262
+ when: (e, t = 0) => [
3263
+ "glyphwave",
3264
+ "sweep",
3265
+ "sweepWeight",
3266
+ "sweepShift"
3267
+ ].includes(X(e, t)),
3268
+ get: (e, t = 0) => G(e, t)?.motion?.amp ?? .3,
3269
+ set: (e, t, n = 0) => J(e, { amp: t }, n)
3270
+ },
3271
+ {
3272
+ key: "motionPhase",
3273
+ label: "Glyph phase",
3274
+ tab: "anim",
3275
+ type: "range",
3276
+ min: 0,
3277
+ max: 1.5,
3278
+ step: .05,
3279
+ rMin: .3,
3280
+ rMax: 1,
3281
+ when: (e, t = 0) => [
3282
+ "vfwave",
3283
+ "glyphwave",
3284
+ "cascade"
3285
+ ].includes(X(e, t)),
3286
+ get: (e, t = 0) => G(e, t)?.motion?.phase ?? .5,
3287
+ set: (e, t, n = 0) => J(e, { phase: t }, n)
3288
+ },
3289
+ {
3290
+ key: "axis",
3291
+ label: "Axis",
3292
+ tab: "anim",
3293
+ type: "select",
3294
+ when: (e, t = 0) => ["vfwave", "sweepWeight"].includes(X(e, t)) && b(G(e, t)?.font).axes.length > 1,
3295
+ options: (e, t = 0) => b(G(e, t)?.font).axes.map((e) => ({
3296
+ value: e.tag,
3297
+ label: C[e.tag] || e.tag
3298
+ })),
3299
+ get: (e, t = 0) => G(e, t)?.motion?.axis ?? "wght",
3300
+ set: (e, t, n = 0) => J(e, { axis: t }, n)
3301
+ },
3302
+ {
3303
+ key: "field",
3304
+ label: "Field",
3305
+ tab: "anim",
3306
+ type: "select",
3307
+ when: (e, t = 0) => [
3308
+ "sweep",
3309
+ "sweepWeight",
3310
+ "sweepShift"
3311
+ ].includes(X(e, t)),
3312
+ options: [
3313
+ {
3314
+ value: "x",
3315
+ label: "Horizontal"
3316
+ },
3317
+ {
3318
+ value: "y",
3319
+ label: "Vertical"
3320
+ },
3321
+ {
3322
+ value: "diagonal",
3323
+ label: "Diagonal"
3324
+ },
3325
+ {
3326
+ value: "radial",
3327
+ label: "Radial"
3328
+ },
3329
+ {
3330
+ value: "angular",
3331
+ label: "Angular"
3332
+ },
3333
+ {
3334
+ value: "wave",
3335
+ label: "Wave"
3336
+ }
3337
+ ],
3338
+ get: (e, t = 0) => G(e, t)?.motion?.field ?? "x",
3339
+ set: (e, t, n = 0) => J(e, { field: t }, n)
3340
+ },
3341
+ {
3342
+ key: "stagger",
3343
+ label: "Stagger",
3344
+ tab: "anim",
3345
+ type: "range",
3346
+ min: 0,
3347
+ max: 1,
3348
+ step: .01,
3349
+ get: (e) => G(e)?.stagger ?? 0,
3350
+ set: (e, t) => qe(e, (e, n, r) => ({
3351
+ stagger: t,
3352
+ phase: r > 1 ? n / r * t : 0
3353
+ }))
3354
+ },
3355
+ {
3356
+ key: "spin",
3357
+ label: "Spin",
3358
+ tab: "anim",
3359
+ type: "range",
3360
+ min: -8,
3361
+ max: 8,
3362
+ rMin: 0,
3363
+ rMax: 4,
3364
+ step: 1,
3365
+ rMin: 0,
3366
+ rMax: 3,
3367
+ when: (e, t = 0) => Y(e, t) === "radial" || Y(e, t) === "rings",
3368
+ get: (e, t = 0) => G(e, t)?.path?.spin ?? 1,
3369
+ set: (e, t, n = 0) => q(e, { spin: Math.round(t) }, n)
3370
+ }
3371
+ ], st = (e, t, n = 0) => typeof e.options == "function" ? e.options(t, n) : e.options ?? [], ct = (e, t, n = 0) => ({
3372
+ min: typeof e.min == "function" ? e.min(t, n) : e.min,
3373
+ max: typeof e.max == "function" ? e.max(t, n) : e.max
3374
+ });
3375
+ function lt(e, t = 0, n = Math.random, r = null) {
3376
+ let i = e;
3377
+ for (let e of ot) if (!(e.noRandom || e.type === "color") && !(r && !r.includes(e.tab)) && !(e.when && !e.when(i, t))) {
3378
+ if (e.type === "range") {
3379
+ let r = ct(e, i, t), a = e.rMin ?? r.min, o = e.rMax ?? r.max, s = e.step ?? 1, c = a + n() * (o - a);
3380
+ i = e.set(i, Math.min(o, Math.max(a, Number((Math.round(c / s) * s).toFixed(4)))), t);
3381
+ } else if (e.type === "select") {
3382
+ let r = st(e, i, t);
3383
+ r.length && (i = e.set(i, r[Math.floor(n() * r.length)].value, t));
3384
+ }
3385
+ }
3386
+ return i;
3387
+ }
3388
+ var ut = (e, t) => `kin:${e}:${t}`;
3389
+ function dt(e, t) {
3390
+ let n = e;
3391
+ for (let e in t) {
3392
+ let r = /^kin:(\d+):(.+)$/.exec(e);
3393
+ if (!r || typeof t[e] != "number") continue;
3394
+ let i = ot.find((e) => e.key === r[2]);
3395
+ i?.type === "range" && (n = i.set(n, t[e], Number(r[1])));
3396
+ }
3397
+ return n;
3398
+ }
3399
+ //#endregion
3400
+ //#region src/editor/compose/inspectors/KineticPanel.jsx
3401
+ var ft = {
3402
+ key: "morphBlend",
3403
+ label: "Morph blend",
3404
+ type: "range",
3405
+ min: 0,
3406
+ max: 1,
3407
+ step: .01,
3408
+ default: .5
3409
+ }, pt = new Set([
3410
+ "mode",
3411
+ "cycles",
3412
+ "motionAmp",
3413
+ "motionPhase",
3414
+ "axis",
3415
+ "field"
3416
+ ]), mt = {
3417
+ mode: "glyphwave",
3418
+ cycles: 1,
3419
+ phase: .5,
3420
+ amp: .3,
3421
+ axis: "wght",
3422
+ field: "x"
3423
+ }, ht = new Set([
3424
+ "align",
3425
+ "italic",
3426
+ "fill",
3427
+ "fontSize",
3428
+ "vfWght",
3429
+ "offsetX",
3430
+ "offsetY"
3431
+ ]), gt = (e, t) => e ? String.fromCharCode(97 + t.indexOf(e) % 26) : null;
3432
+ function _t({ layer: t, setProp: n, updateLayer: r, palette: o, renderAnimate: s, tab: l, tabStrip: p, picker: m = !0 }) {
3433
+ let h = a(), g = t.comp ?? {
3434
+ bg: "#0b0d12",
3435
+ instances: []
3436
+ }, y = g.instances ?? [], [b, x] = N(0), S = Math.min(b, Math.max(0, y.length - 1)), C = (e) => {
3437
+ x(e), window.dispatchEvent(new CustomEvent("kol:kinetic-element", { detail: {
3438
+ id: t.id,
3439
+ index: e,
3440
+ from: "panel"
3441
+ } }));
3442
+ };
3443
+ me(() => {
3444
+ let e = (e) => {
3445
+ e.detail?.id === t.id && e.detail.from === "canvas" && x(e.detail.index);
3446
+ };
3447
+ return window.addEventListener("kol:kinetic-element", e), () => window.removeEventListener("kol:kinetic-element", e);
3448
+ }, [t.id]);
3449
+ let [w, T] = N([]), ee = (e) => T((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]), te = (e) => {
3450
+ let t = y[e]?.group;
3451
+ return t ? y.reduce((e, n, r) => n.group === t ? [...e, r] : e, []) : [e];
3452
+ }, [ne, E] = N(0), D = y[S]?.motions ?? [], O = Math.min(ne, D.length), ie = (e) => ({
3453
+ ...e,
3454
+ instances: (e.instances ?? []).map((e, t) => t === S ? {
3455
+ ...e,
3456
+ motion: { ...e.motions?.[O - 1] ?? {} }
3457
+ } : e)
3458
+ }), oe = (e) => pt.has(e.key) && O > 0 ? ie(g) : g, se = (e) => {
3459
+ e && (r(t.id, {
3460
+ presetId: e.id,
3461
+ presetLabel: e.label,
3462
+ comp: Pe(e)
3463
+ }), x(0), E(0));
3464
+ }, A = (e) => n("comp", e), j = (e) => r(t.id, { comp: {
3465
+ ...g,
3466
+ instances: e
3467
+ } }), de = (e, t) => A({
3468
+ ...g,
3469
+ instances: y.map((n, r) => r === e ? {
3470
+ ...n,
3471
+ ...t
3472
+ } : n)
3473
+ }), fe = () => {
3474
+ if (w.length < 2) return;
3475
+ let e = new Set(y.map((e) => e.group).filter(Boolean)), t = 1;
3476
+ for (; e.has(`g${t}`);) t++;
3477
+ j(y.map((e) => w.includes(e.id) ? {
3478
+ ...e,
3479
+ group: `g${t}`
3480
+ } : e)), T([]);
3481
+ }, ge = () => {
3482
+ w.length && (j(y.map((e) => w.includes(e.id) ? {
3483
+ ...e,
3484
+ group: null
3485
+ } : e)), T([]));
3486
+ }, _e = (e, t) => {
3487
+ if (pt.has(e.key) && O > 0) {
3488
+ let n = e.set(ie(g), t, S).instances?.[S]?.motion ?? {};
3489
+ de(S, { motions: D.map((e, t) => t === O - 1 ? n : e) });
3490
+ return;
3491
+ }
3492
+ let n = te(S);
3493
+ if (n.length > 1 && ht.has(e.key)) {
3494
+ let r = g;
3495
+ if (e.key === "fontSize") {
3496
+ let i = Number(e.get(g, S)) || 1, a = t / i;
3497
+ for (let t of n) {
3498
+ let n = Number(e.get(g, t)) || i;
3499
+ r = e.set(r, Math.max(8, Math.min(1200, Math.round(n * a))), t);
3500
+ }
3501
+ } else if (e.key === "offsetX" || e.key === "offsetY") {
3502
+ let i = t - (Number(e.get(g, S)) || 0);
3503
+ for (let t of n) r = e.set(r, (Number(e.get(g, t)) || 0) + i, t);
3504
+ } else for (let i of n) r = e.set(r, t, i);
3505
+ A(r);
3506
+ return;
3507
+ }
3508
+ A(e.set(g, t, S));
3509
+ }, I = d(t), ve = (e = null) => {
3510
+ let n = I.take();
3511
+ r(t.id, {
3512
+ comp: lt(g, S, f(n >>> 0), e),
3513
+ _rollSeed: n
3514
+ });
3515
+ }, ye = () => {
3516
+ let e = I.take(), n = f(e >>> 0), i = g;
3517
+ y.forEach((e, t) => {
3518
+ i = lt(i, t, n);
3519
+ }), r(t.id, {
3520
+ comp: i,
3521
+ _rollSeed: e
3522
+ });
3523
+ }, be = () => {
3524
+ let e = V.find((e) => e.id === t.presetId), n = V.filter((t) => t.id !== e?.id && (!e || t.sub === e.sub));
3525
+ n.length && se(n[Math.floor(f(I.take() >>> 0)() * n.length)]);
3526
+ }, xe = () => {
3527
+ let e = f(I.take() >>> 0);
3528
+ Ce(c[Math.floor(e() * c.length)].value, e() < .5);
3529
+ }, Se = () => se(V.find((e) => e.id === t.presetId) ?? V[0]), Ce = (n, i) => {
3530
+ let a = e(n, i);
3531
+ r(t.id, {
3532
+ themeId: n,
3533
+ themeInvert: i,
3534
+ comp: {
3535
+ ...g,
3536
+ bg: a.bg,
3537
+ instances: y.map((e) => ({
3538
+ ...e,
3539
+ fill: a.fg
3540
+ }))
3541
+ }
3542
+ });
3543
+ }, L = (e) => A({
3544
+ ...g,
3545
+ instances: y.map((t) => ({
3546
+ ...t,
3547
+ fill: e
3548
+ }))
3549
+ }), we = l === "labs-effect" ? "style" : l, Te = ot.filter((e) => e.tab === we && (!e.when || e.when(oe(e), S))), Ee = y.some((e) => e?.morph?.on), R = y[S];
3550
+ return /* @__PURE__ */ F(he, { children: [
3551
+ p,
3552
+ m && /* @__PURE__ */ P(vt, {
3553
+ layer: t,
3554
+ onPreset: se
3555
+ }),
3556
+ l === "generate" || l === "labs-effect" ? /* @__PURE__ */ F("div", {
3557
+ className: "flex flex-col gap-1",
3558
+ children: [
3559
+ /* @__PURE__ */ P("span", {
3560
+ className: "kol-eyebrow text-fg-80",
3561
+ children: "Elements"
3562
+ }),
3563
+ /* @__PURE__ */ P(yt, {
3564
+ insts: y,
3565
+ idx: S,
3566
+ onSelect: C,
3567
+ onWrite: j,
3568
+ marked: w,
3569
+ onMark: ee,
3570
+ onGroup: fe,
3571
+ onUngroup: ge
3572
+ }),
3573
+ /* @__PURE__ */ P(M, {
3574
+ label: "Edit elements on the canvas (click to select, drag to move, corners to scale)",
3575
+ children: /* @__PURE__ */ P(k, {
3576
+ "aria-label": "Edit elements on the canvas (click to select, drag to move, corners to scale)",
3577
+ tone: "primary",
3578
+ size: h,
3579
+ className: "w-full",
3580
+ onClick: () => window.dispatchEvent(new CustomEvent("kol:kinetic-edit", { detail: {
3581
+ id: t.id,
3582
+ index: S
3583
+ } })),
3584
+ children: "Edit on canvas"
3585
+ })
3586
+ })
3587
+ ]
3588
+ }) : y.length > 1 && /* @__PURE__ */ F("span", {
3589
+ className: "kol-helper-12 text-meta truncate",
3590
+ children: [
3591
+ "Element ",
3592
+ S + 1,
3593
+ " · ",
3594
+ R?.text || "—"
3595
+ ]
3596
+ }),
3597
+ (l === "generate" || l === "labs-effect") && /* @__PURE__ */ F(he, { children: [
3598
+ /* @__PURE__ */ P(ae, {
3599
+ label: "TEXT",
3600
+ children: /* @__PURE__ */ P(ue, {
3601
+ variant: "filled",
3602
+ size: h,
3603
+ rows: 2,
3604
+ axis: "y",
3605
+ value: y[S]?.text ?? "",
3606
+ onChange: (e) => de(S, { text: e.target.value })
3607
+ })
3608
+ }),
3609
+ /* @__PURE__ */ F("div", {
3610
+ className: "flex flex-col gap-2",
3611
+ children: [/* @__PURE__ */ P(le, {
3612
+ label: "Theme",
3613
+ align: "fill",
3614
+ labelWidth: i,
3615
+ children: /* @__PURE__ */ P(re, {
3616
+ variant: "subtle",
3617
+ size: h,
3618
+ className: "w-full",
3619
+ options: c,
3620
+ value: t.themeId ?? "kol",
3621
+ onChange: (e) => Ce(e, !!t.themeInvert)
3622
+ })
3623
+ }), /* @__PURE__ */ P(le, {
3624
+ label: "Invert",
3625
+ align: "fill",
3626
+ labelWidth: i,
3627
+ children: /* @__PURE__ */ P(ce, {
3628
+ size: h,
3629
+ className: "w-full",
3630
+ options: [{
3631
+ value: "off",
3632
+ label: "Off"
3633
+ }, {
3634
+ value: "on",
3635
+ label: "On"
3636
+ }],
3637
+ value: t.themeInvert ? "on" : "off",
3638
+ onChange: (e) => Ce(t.themeId ?? "kol", e === "on")
3639
+ })
3640
+ })]
3641
+ }),
3642
+ /* @__PURE__ */ P(u, {
3643
+ inline: !0,
3644
+ label: "Text color",
3645
+ value: y[0]?.fill,
3646
+ onChange: (e) => L(_(e, o) ?? e),
3647
+ palette: o
3648
+ }),
3649
+ /* @__PURE__ */ P(k, {
3650
+ tone: "primary",
3651
+ size: h,
3652
+ className: "w-full",
3653
+ onClick: be,
3654
+ children: "Randomize preset"
3655
+ }),
3656
+ /* @__PURE__ */ F("div", {
3657
+ className: "flex gap-2",
3658
+ children: [/* @__PURE__ */ P(k, {
3659
+ tone: "primary",
3660
+ size: h,
3661
+ className: "flex-1 min-w-0",
3662
+ onClick: () => ve(),
3663
+ children: "Randomize all"
3664
+ }), /* @__PURE__ */ P(M, {
3665
+ label: "Reset to defaults",
3666
+ children: /* @__PURE__ */ P(k, {
3667
+ tone: "primary",
3668
+ size: h,
3669
+ iconOnly: "refresh",
3670
+ "aria-label": "Reset to defaults",
3671
+ onClick: Se,
3672
+ className: "shrink-0"
3673
+ })
3674
+ })]
3675
+ }),
3676
+ /* @__PURE__ */ F("div", {
3677
+ className: "grid grid-cols-2 gap-2",
3678
+ children: [
3679
+ /* @__PURE__ */ P(k, {
3680
+ tone: "primary",
3681
+ size: h,
3682
+ onClick: xe,
3683
+ children: "Color"
3684
+ }),
3685
+ /* @__PURE__ */ P(k, {
3686
+ tone: "primary",
3687
+ size: h,
3688
+ onClick: () => ve(["style"]),
3689
+ children: "Type"
3690
+ }),
3691
+ /* @__PURE__ */ P(k, {
3692
+ tone: "primary",
3693
+ size: h,
3694
+ onClick: () => ve(["anim"]),
3695
+ children: "Motion"
3696
+ }),
3697
+ /* @__PURE__ */ P(k, {
3698
+ tone: "primary",
3699
+ size: h,
3700
+ onClick: ye,
3701
+ children: "All elements"
3702
+ })
3703
+ ]
3704
+ }),
3705
+ /* @__PURE__ */ P(v, { seed: I })
3706
+ ] }),
3707
+ l === "anim" && /* @__PURE__ */ P(xt, {
3708
+ motions: D,
3709
+ mIdx: O,
3710
+ onSelect: E,
3711
+ onAdd: () => {
3712
+ j(y.map((e, t) => t === S ? {
3713
+ ...e,
3714
+ motions: [...D, { ...mt }]
3715
+ } : e)), E(D.length + 1);
3716
+ },
3717
+ onRemove: () => {
3718
+ O !== 0 && (j(y.map((e, t) => t === S ? {
3719
+ ...e,
3720
+ motions: D.filter((e, t) => t !== O - 1)
3721
+ } : e)), E(O - 1));
3722
+ }
3723
+ }),
3724
+ l !== "generate" && Te.map((e, r) => /* @__PURE__ */ F(pe, { children: [
3725
+ e.key === "arrangement" && /* @__PURE__ */ F(he, { children: [/* @__PURE__ */ P("span", {
3726
+ className: "kol-eyebrow text-fg-80",
3727
+ children: "OpenType"
3728
+ }), /* @__PURE__ */ P(St, {
3729
+ value: R?.opentype ?? {},
3730
+ onToggle: (e, t) => de(S, { opentype: {
3731
+ ...R?.opentype ?? {},
3732
+ [e]: t
3733
+ } })
3734
+ })] }),
3735
+ e.section && e.section !== Te[r - 1]?.section && /* @__PURE__ */ P("span", {
3736
+ className: "kol-eyebrow text-fg-80",
3737
+ children: e.section
3738
+ }),
3739
+ /* @__PURE__ */ P(bt, {
3740
+ knob: e,
3741
+ comp: oe(e),
3742
+ idx: S,
3743
+ palette: o,
3744
+ onWrite: _e,
3745
+ bridge: pt.has(e.key) && O > 0 ? null : {
3746
+ layer: t,
3747
+ setProp: n,
3748
+ renderAnimate: s,
3749
+ key: ut(S, e.key)
3750
+ }
3751
+ }),
3752
+ e.key === "showPath" && R?.path?.type === "custom" && /* @__PURE__ */ P(Ct, {
3753
+ inst: R,
3754
+ layer: t,
3755
+ onPoints: (e) => de(S, { path: {
3756
+ ...R?.path ?? {},
3757
+ points: e
3758
+ } })
3759
+ })
3760
+ ] }, e.key)),
3761
+ l === "anim" && Ee && /* @__PURE__ */ P(wt, {
3762
+ layer: t,
3763
+ setProp: n,
3764
+ insts: y,
3765
+ renderAnimate: s
3766
+ })
3767
+ ] });
3768
+ }
3769
+ function vt({ layer: e, onPreset: t }) {
3770
+ return /* @__PURE__ */ P(ee, {
3771
+ tree: Ne,
3772
+ presets: V,
3773
+ current: V.find((t) => t.id === e.presetId) ?? V[0],
3774
+ onPick: t,
3775
+ inline: !0
3776
+ });
3777
+ }
3778
+ function yt({ insts: e, idx: t, onSelect: n, onWrite: r, marked: i, onMark: o, onGroup: s, onUngroup: c }) {
3779
+ let l = a(), u = () => {
3780
+ let t = e.length;
3781
+ for (; e.some((e) => e.id === `i${t}`);) t++;
3782
+ return `i${t}`;
3783
+ }, d = () => {
3784
+ let i = {
3785
+ id: u(),
3786
+ text: "Text"
3787
+ };
3788
+ e[t]?.fill && (i.fill = e[t].fill), r([...e, Oe(i, e.length)]), n(e.length);
3789
+ }, f = (t) => {
3790
+ let i = {
3791
+ ...structuredClone(e[t]),
3792
+ id: u()
3793
+ }, a = [...e];
3794
+ a.splice(t + 1, 0, i), r(a), n(t + 1);
3795
+ }, p = (t) => {
3796
+ e.length <= 1 || (r(e.filter((e, n) => n !== t)), n(Math.min(t, e.length - 2)));
3797
+ }, m = (i) => {
3798
+ let a = t + i;
3799
+ if (a < 0 || a >= e.length) return;
3800
+ let o = [...e], [s] = o.splice(t, 1);
3801
+ o.splice(a, 0, s), r(o), n(a);
3802
+ }, h = [...new Set(e.map((e) => e.group).filter(Boolean))];
3803
+ return /* @__PURE__ */ F(he, { children: [
3804
+ /* @__PURE__ */ P("div", {
3805
+ className: "flex flex-col gap-1",
3806
+ children: e.map((r, a) => {
3807
+ let s = gt(r.group, h);
3808
+ return /* @__PURE__ */ F("div", {
3809
+ onClick: () => n(a),
3810
+ className: `flex items-center gap-2 pl-2 pr-1 py-1 rounded cursor-pointer kol-helper-12 ${a === t ? "bg-oq-08 text-emphasis" : "text-body hover:bg-oq-04 hover:text-emphasis"}`,
3811
+ children: [
3812
+ /* @__PURE__ */ P("span", {
3813
+ onClick: (e) => e.stopPropagation(),
3814
+ className: "shrink-0",
3815
+ style: { lineHeight: 0 },
3816
+ children: /* @__PURE__ */ P(j, {
3817
+ checked: i.includes(r.id),
3818
+ onChange: () => o(r.id)
3819
+ })
3820
+ }),
3821
+ /* @__PURE__ */ P("span", {
3822
+ className: "kol-helper-10 text-meta shrink-0",
3823
+ children: a + 1
3824
+ }),
3825
+ /* @__PURE__ */ P("span", {
3826
+ className: "truncate flex-1 min-w-0",
3827
+ children: r.text || "—"
3828
+ }),
3829
+ s && /* @__PURE__ */ F("span", {
3830
+ className: "shrink-0 kol-helper-10 text-meta",
3831
+ children: ["grp ", s]
3832
+ }),
3833
+ /* @__PURE__ */ P(M, {
3834
+ label: "Duplicate element",
3835
+ children: /* @__PURE__ */ P(k, {
3836
+ tone: "ghost",
3837
+ size: l,
3838
+ quiet: !0,
3839
+ iconOnly: "copy",
3840
+ iconSize: 12,
3841
+ "aria-label": "Duplicate element",
3842
+ onClick: (e) => {
3843
+ e.stopPropagation(), f(a);
3844
+ }
3845
+ })
3846
+ }),
3847
+ /* @__PURE__ */ P("span", {
3848
+ className: e.length <= 1 ? "invisible pointer-events-none" : "contents",
3849
+ "aria-hidden": e.length <= 1 || void 0,
3850
+ children: /* @__PURE__ */ P(M, {
3851
+ label: "Delete element",
3852
+ children: /* @__PURE__ */ P(k, {
3853
+ tone: "ghost",
3854
+ size: l,
3855
+ quiet: !0,
3856
+ iconOnly: "x",
3857
+ iconSize: 10,
3858
+ "aria-label": "Delete element",
3859
+ onClick: (e) => {
3860
+ e.stopPropagation(), p(a);
3861
+ }
3862
+ })
3863
+ })
3864
+ })
3865
+ ]
3866
+ }, r.id ?? a);
3867
+ })
3868
+ }),
3869
+ i.length > 0 && /* @__PURE__ */ F("div", {
3870
+ className: "grid grid-cols-2 gap-1",
3871
+ children: [i.length >= 2 && /* @__PURE__ */ P(k, {
3872
+ tone: "primary",
3873
+ size: l,
3874
+ onClick: s,
3875
+ children: "Group"
3876
+ }), /* @__PURE__ */ P(k, {
3877
+ tone: "primary",
3878
+ size: l,
3879
+ onClick: c,
3880
+ children: "Ungroup"
3881
+ })]
3882
+ }),
3883
+ /* @__PURE__ */ F("div", {
3884
+ className: "flex items-center gap-1",
3885
+ children: [
3886
+ /* @__PURE__ */ P(k, {
3887
+ tone: "primary",
3888
+ size: l,
3889
+ className: "flex-1",
3890
+ iconLeft: "plus",
3891
+ iconSize: 12,
3892
+ onClick: d,
3893
+ children: "Add element"
3894
+ }),
3895
+ /* @__PURE__ */ P("span", {
3896
+ className: t <= 0 ? "invisible pointer-events-none" : "contents",
3897
+ "aria-hidden": t <= 0 || void 0,
3898
+ children: /* @__PURE__ */ P(M, {
3899
+ label: "Move element up",
3900
+ children: /* @__PURE__ */ P(k, {
3901
+ tone: "ghost",
3902
+ size: l,
3903
+ quiet: !0,
3904
+ iconOnly: "chevron-down",
3905
+ className: "rotate-180",
3906
+ "aria-label": "Move element up",
3907
+ onClick: () => m(-1)
3908
+ })
3909
+ })
3910
+ }),
3911
+ /* @__PURE__ */ P("span", {
3912
+ className: t >= e.length - 1 ? "invisible pointer-events-none" : "contents",
3913
+ "aria-hidden": t >= e.length - 1 || void 0,
3914
+ children: /* @__PURE__ */ P(M, {
3915
+ label: "Move element down",
3916
+ children: /* @__PURE__ */ P(k, {
3917
+ tone: "ghost",
3918
+ size: l,
3919
+ quiet: !0,
3920
+ iconOnly: "chevron-down",
3921
+ "aria-label": "Move element down",
3922
+ onClick: () => m(1)
3923
+ })
3924
+ })
3925
+ })
3926
+ ]
3927
+ })
3928
+ ] });
3929
+ }
3930
+ function bt({ knob: e, comp: t, idx: r, palette: o, onWrite: s, bridge: c }) {
3931
+ let l = a(), d = e.get(t, r), f = (t) => s(e, t);
3932
+ if (e.type === "color") return /* @__PURE__ */ P(u, {
3933
+ label: e.label,
3934
+ value: d,
3935
+ onChange: (e) => f(_(e, o) ?? e),
3936
+ palette: o,
3937
+ inline: !0
3938
+ });
3939
+ if (e.type === "select") return /* @__PURE__ */ P(le, {
3940
+ label: e.label,
3941
+ align: "fill",
3942
+ labelWidth: i,
3943
+ children: /* @__PURE__ */ P(re, {
3944
+ variant: "subtle",
3945
+ size: l,
3946
+ className: "w-full",
3947
+ options: st(e, t, r),
3948
+ value: d,
3949
+ onChange: f
3950
+ })
3951
+ });
3952
+ let { min: p, max: m } = ct(e, t, r), h = c && c.layer[c.key], g = n(h), v = typeof h == "number" ? h : d, y = typeof h == "number" ? (e) => c.setProp(c.key, e) : f;
3953
+ return /* @__PURE__ */ P(le, {
3954
+ label: e.label,
3955
+ align: "fill",
3956
+ labelWidth: i,
3957
+ children: /* @__PURE__ */ F("div", {
3958
+ className: "flex flex-1 items-center gap-2",
3959
+ children: [/* @__PURE__ */ P("div", {
3960
+ className: "flex-1 min-w-0",
3961
+ children: g ? /* @__PURE__ */ P("div", {
3962
+ className: "kol-helper-12 text-meta italic px-1",
3963
+ children: "animated"
3964
+ }) : /* @__PURE__ */ P(A, {
3965
+ min: p,
3966
+ max: m,
3967
+ step: e.step ?? 1,
3968
+ value: typeof v == "number" ? v : p,
3969
+ onChange: y,
3970
+ displayWidth: String(m).length,
3971
+ className: "flex-1"
3972
+ })
3973
+ }), c?.renderAnimate?.({
3974
+ key: c.key,
3975
+ label: e.label,
3976
+ type: "range",
3977
+ min: p,
3978
+ max: m,
3979
+ step: e.step ?? 1,
3980
+ default: typeof d == "number" ? d : p
3981
+ })]
3982
+ })
3983
+ });
3984
+ }
3985
+ function xt({ motions: e, mIdx: t, onSelect: n, onAdd: r, onRemove: i }) {
3986
+ let o = a(), s = [{
3987
+ value: "0",
3988
+ label: "1"
3989
+ }, ...e.map((e, t) => ({
3990
+ value: String(t + 1),
3991
+ label: String(t + 2)
3992
+ }))];
3993
+ return /* @__PURE__ */ F("div", {
3994
+ className: "flex flex-col gap-1",
3995
+ children: [/* @__PURE__ */ P("span", {
3996
+ className: "kol-eyebrow text-fg-80",
3997
+ children: "Motion layers"
3998
+ }), /* @__PURE__ */ F("div", {
3999
+ className: "flex items-center gap-1",
4000
+ children: [
4001
+ /* @__PURE__ */ P("div", {
4002
+ className: "flex-1 min-w-0",
4003
+ children: /* @__PURE__ */ P(ce, {
4004
+ size: o,
4005
+ value: String(t),
4006
+ onChange: (e) => n(Number(e)),
4007
+ options: s
4008
+ })
4009
+ }),
4010
+ /* @__PURE__ */ P(M, {
4011
+ label: "Add motion layer",
4012
+ children: /* @__PURE__ */ P(k, {
4013
+ tone: "ghost",
4014
+ size: o,
4015
+ quiet: !0,
4016
+ iconOnly: "plus",
4017
+ iconSize: 12,
4018
+ "aria-label": "Add motion layer",
4019
+ onClick: r
4020
+ })
4021
+ }),
4022
+ /* @__PURE__ */ P("span", {
4023
+ className: t === 0 ? "invisible pointer-events-none" : "contents",
4024
+ "aria-hidden": t === 0 || void 0,
4025
+ children: /* @__PURE__ */ P(M, {
4026
+ label: "Delete motion layer (the primary can only be set to None)",
4027
+ children: /* @__PURE__ */ P(k, {
4028
+ tone: "ghost",
4029
+ size: o,
4030
+ quiet: !0,
4031
+ iconOnly: "x",
4032
+ iconSize: 10,
4033
+ "aria-label": "Delete motion layer",
4034
+ onClick: i
4035
+ })
4036
+ })
4037
+ })
4038
+ ]
4039
+ })]
4040
+ });
4041
+ }
4042
+ function St({ value: e = {}, onToggle: t }) {
4043
+ let n = a(), [r, i] = N(!1), o = fe({
4044
+ open: r,
4045
+ onOpenChange: i,
4046
+ placement: "bottom-start",
4047
+ offset: -1,
4048
+ flip: !1,
4049
+ matchReferenceWidth: !0,
4050
+ role: "listbox"
4051
+ }), s = Ve.filter((t) => e[t.tag]).length;
4052
+ return /* @__PURE__ */ F("div", {
4053
+ className: "relative w-full",
4054
+ children: [/* @__PURE__ */ P(k, {
4055
+ ref: o.refs.setReference,
4056
+ ...o.getReferenceProps(),
4057
+ tone: "primary",
4058
+ size: n,
4059
+ className: "w-full justify-between",
4060
+ iconRight: "chevron-down",
4061
+ "aria-haspopup": "listbox",
4062
+ "aria-expanded": r,
4063
+ children: s ? `${s} feature${s > 1 ? "s" : ""}` : "None"
4064
+ }), /* @__PURE__ */ P(se, {
4065
+ popover: o,
4066
+ panel: !1,
4067
+ focus: !1,
4068
+ style: {
4069
+ backgroundColor: "var(--kol-surface-secondary)",
4070
+ color: "var(--kol-surface-on-primary)",
4071
+ borderRadius: "0 0 4px 4px",
4072
+ zIndex: "var(--kol-z-dropdown)"
4073
+ },
4074
+ children: /* @__PURE__ */ P("div", {
4075
+ className: "flex max-h-[300px] flex-col items-stretch overflow-y-auto",
4076
+ role: "listbox",
4077
+ children: Ve.map((n) => /* @__PURE__ */ P(oe, {
4078
+ onClick: () => t(n.tag, !e[n.tag]),
4079
+ shortcut: e[n.tag] ? /* @__PURE__ */ P(ge, {
4080
+ name: "check",
4081
+ size: 11
4082
+ }) : void 0,
4083
+ children: n.label
4084
+ }, n.tag))
4085
+ })
4086
+ })]
4087
+ });
4088
+ }
4089
+ function Ct({ inst: e, layer: t, onPoints: n }) {
4090
+ let r = a(), i = e?.path?.points, o = Array.isArray(i) && i.length >= 2 ? i : ye, s = t.w > 0 && t.h > 0 ? t.w / t.h : 1;
4091
+ return /* @__PURE__ */ F("div", {
4092
+ className: "flex flex-col gap-2",
4093
+ children: [/* @__PURE__ */ P(O, {
4094
+ value: o.map(([e, t]) => ({
4095
+ x: e,
4096
+ y: t
4097
+ })),
4098
+ onChange: (e) => n(e.map((e) => [Number(e.x.toFixed(3)), Number(e.y.toFixed(3))])),
4099
+ aspect: s,
4100
+ size: r,
4101
+ minPoints: 2,
4102
+ ariaLabel: "Custom path points"
4103
+ }), /* @__PURE__ */ F("div", {
4104
+ className: "grid grid-cols-2 gap-2",
4105
+ children: [/* @__PURE__ */ P(k, {
4106
+ tone: "primary",
4107
+ size: r,
4108
+ onClick: () => n([...o, [.5, .5]]),
4109
+ children: "Add point"
4110
+ }), o.length > 2 && /* @__PURE__ */ P(k, {
4111
+ tone: "primary",
4112
+ size: r,
4113
+ onClick: () => n(o.slice(0, -1)),
4114
+ children: "Remove point"
4115
+ })]
4116
+ })]
4117
+ });
4118
+ }
4119
+ function wt({ layer: e, setProp: t, insts: r, renderAnimate: a }) {
4120
+ let o = ft, s = e[o.key], c = n(s), l = r.find((e) => e?.morph?.on)?.morph?.blend ?? o.default, u = typeof s == "number" ? s : l, d = c ? /* @__PURE__ */ P("div", {
4121
+ className: "kol-helper-12 text-meta italic px-1",
4122
+ children: "animated"
4123
+ }) : /* @__PURE__ */ P(A, {
4124
+ min: o.min,
4125
+ max: o.max,
4126
+ step: o.step,
4127
+ value: u,
4128
+ onChange: (e) => t(o.key, e)
4129
+ });
4130
+ return /* @__PURE__ */ P(le, {
4131
+ label: o.label,
4132
+ align: "fill",
4133
+ labelWidth: i,
4134
+ children: /* @__PURE__ */ F("div", {
4135
+ className: "flex flex-1 items-center gap-2",
4136
+ children: [/* @__PURE__ */ P("div", {
4137
+ className: "flex-1 min-w-0",
4138
+ children: d
4139
+ }), a(o)]
4140
+ })
4141
+ });
4142
+ }
4143
+ //#endregion
4144
+ //#region src/editor/params/TransportBar.jsx
4145
+ function Tt({ seconds: e, onCommit: t, size: n }) {
4146
+ let r = String(e), [i, a] = N(r), [o, s] = N(!1);
4147
+ return me(() => {
4148
+ o || a(r);
4149
+ }, [r, o]), /* @__PURE__ */ P(M, {
4150
+ label: "Loop length",
4151
+ triggerClassName: "flex w-full",
4152
+ children: /* @__PURE__ */ P(ie, {
4153
+ type: "text",
4154
+ inputMode: "decimal",
4155
+ variant: "property",
4156
+ size: n,
4157
+ affordance: "Loop /",
4158
+ unit: "s",
4159
+ chars: 3,
4160
+ "aria-label": "Loop length in seconds",
4161
+ value: i,
4162
+ onFocus: (e) => {
4163
+ s(!0), e.target.select();
4164
+ },
4165
+ onChange: (e) => a(e.target.value),
4166
+ onBlur: () => {
4167
+ s(!1);
4168
+ let e = Number(i.trim());
4169
+ if (i.trim() === "" || !Number.isFinite(e)) {
4170
+ a(r);
4171
+ return;
4172
+ }
4173
+ t(e);
4174
+ },
4175
+ onKeyDown: (e) => {
4176
+ e.key === "Enter" && e.currentTarget.blur(), e.key === "Escape" && (a(r), s(!1), e.currentTarget.blur());
4177
+ },
4178
+ className: "justify-center",
4179
+ inputClassName: "text-center"
4180
+ })
4181
+ });
4182
+ }
4183
+ var Et = (e, t) => /* @__PURE__ */ P(ge, {
4184
+ name: e,
4185
+ size: de(t, !0)
4186
+ }), Dt = {
4187
+ sm: "shrink-0 [&_.kol-seg-cell]:flex-none [&_.kol-seg-cell]:px-0 [&_.kol-seg-cell]:w-[var(--kol-ctl-sm)]",
4188
+ md: "shrink-0 [&_.kol-seg-cell]:flex-none [&_.kol-seg-cell]:px-0 [&_.kol-seg-cell]:w-[var(--kol-ctl-md)]",
4189
+ lg: "shrink-0 [&_.kol-seg-cell]:flex-none [&_.kol-seg-cell]:px-0 [&_.kol-seg-cell]:w-[var(--kol-ctl-lg)]"
4190
+ };
4191
+ function Ot({ size: e = "sm" }) {
4192
+ let { playing: t, loopSeconds: n, play: r, pause: i, stop: a, rewind: o, setLoopSeconds: s } = g();
4193
+ return /* @__PURE__ */ F("div", {
4194
+ className: "flex items-center gap-2",
4195
+ children: [
4196
+ /* @__PURE__ */ P(ce, {
4197
+ size: e,
4198
+ ariaLabel: "Playback",
4199
+ value: t ? "play" : "pause",
4200
+ className: Dt[e],
4201
+ onChange: (e) => e === "play" ? r() : i(),
4202
+ options: [{
4203
+ value: "play",
4204
+ ariaLabel: "Play",
4205
+ tooltip: "Play (Space)",
4206
+ label: Et("play", e)
4207
+ }, {
4208
+ value: "pause",
4209
+ ariaLabel: "Pause",
4210
+ tooltip: "Pause (Space)",
4211
+ label: Et("pause", e)
4212
+ }]
4213
+ }),
4214
+ /* @__PURE__ */ P("div", {
4215
+ className: "flex-1 min-w-0",
4216
+ children: /* @__PURE__ */ P(Tt, {
4217
+ seconds: n,
4218
+ onCommit: s,
4219
+ size: e
4220
+ })
4221
+ }),
4222
+ /* @__PURE__ */ P(ce, {
4223
+ size: e,
4224
+ ariaLabel: "Reset",
4225
+ value: null,
4226
+ className: Dt[e],
4227
+ onChange: (e) => e === "stop" ? a() : o(),
4228
+ options: [{
4229
+ value: "stop",
4230
+ ariaLabel: "Stop",
4231
+ label: Et("stop", e)
4232
+ }, {
4233
+ value: "rewind",
4234
+ ariaLabel: "Rewind",
4235
+ label: Et("rewind", e)
4236
+ }]
4237
+ })
4238
+ ]
4239
+ });
4240
+ }
4241
+ //#endregion
4242
+ //#region src/packs/motion.js
4243
+ var kt = {
4244
+ layerTypes: ["kinetic"],
4245
+ kineticPresetById: je,
4246
+ presetComp: Pe,
4247
+ KINETIC_TREE: Ne,
4248
+ KINETIC_PRESETS: V,
4249
+ KineticType: Ke,
4250
+ applyKnobBridges: dt,
4251
+ loadFonts: ne,
4252
+ warmFontCss: S,
4253
+ kineticFontCss: w,
4254
+ KineticPanel: _t,
4255
+ TimelineDock: D,
4256
+ useTimelineUp: E,
4257
+ TransportBar: Ot
4258
+ };
4259
+ m("motion", kt);
4260
+ //#endregion
4261
+ export { Ne as a, V as i, _t as n, Pe as o, lt as r, kt as t };