@walkeros/explorer 4.7.2 → 4.8.0-next-1791496487198

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,2872 @@
1
+ "use client"
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/design/components/index.ts
22
+ var components_exports = {};
23
+ __export(components_exports, {
24
+ ArticleTeaserTracking: () => ArticleTeaserTracking,
25
+ BrowserFrame: () => BrowserFrame,
26
+ Button: () => Button,
27
+ Card: () => Card,
28
+ CardGrid: () => CardGrid,
29
+ CaseCard: () => CaseCard,
30
+ CheckList: () => CheckList,
31
+ Cluster: () => Cluster,
32
+ DestinationMappingViz: () => DestinationMappingViz,
33
+ EventLegend: () => EventLegend,
34
+ Eyebrow: () => Eyebrow,
35
+ FaqItem: () => FaqItem,
36
+ FeatureItem: () => FeatureItem,
37
+ Hero: () => Hero,
38
+ HeroTaggingViz: () => HeroTaggingViz,
39
+ HighlightCard: () => HighlightCard,
40
+ Icon: () => Icon,
41
+ InlineCode: () => InlineCode,
42
+ InstallCommand: () => InstallCommand,
43
+ PhotoPlaceholder: () => PhotoPlaceholder,
44
+ PlanCard: () => PlanCard,
45
+ ProblemCard: () => ProblemCard,
46
+ QuickstartSteps: () => QuickstartSteps,
47
+ Section: () => Section,
48
+ SectionHeading: () => SectionHeading,
49
+ Split: () => Split,
50
+ Stat: () => Stat,
51
+ Text: () => Text,
52
+ TextLink: () => TextLink
53
+ });
54
+ module.exports = __toCommonJS(components_exports);
55
+
56
+ // src/design/components/cx.ts
57
+ function cx(...names) {
58
+ return names.filter((name) => Boolean(name)).join(" ");
59
+ }
60
+
61
+ // src/design/components/atoms/Button.tsx
62
+ var import_jsx_runtime = require("react/jsx-runtime");
63
+ function classes({
64
+ variant = "primary",
65
+ block = false,
66
+ className
67
+ }) {
68
+ return cx(
69
+ "elb-btn",
70
+ `elb-btn--${variant}`,
71
+ block && "elb-btn--block",
72
+ className
73
+ );
74
+ }
75
+ function LinkButton({
76
+ children,
77
+ variant,
78
+ arrow,
79
+ block,
80
+ className,
81
+ linkComponent: Link,
82
+ ...anchor
83
+ }) {
84
+ const props = {
85
+ ...anchor,
86
+ className: classes({ variant, block, className })
87
+ };
88
+ const content = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
89
+ children,
90
+ arrow && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": "true", children: " \u2192" })
91
+ ] });
92
+ return Link ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, { ...props, children: content }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", { ...props, children: content });
93
+ }
94
+ function ButtonElement({
95
+ children,
96
+ variant,
97
+ arrow,
98
+ block,
99
+ className,
100
+ type = "button",
101
+ ...rest
102
+ }) {
103
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
104
+ "button",
105
+ {
106
+ ...rest,
107
+ type,
108
+ className: classes({ variant, block, className }),
109
+ children: [
110
+ children,
111
+ arrow && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": "true", children: " \u2192" })
112
+ ]
113
+ }
114
+ );
115
+ }
116
+ function Button(props) {
117
+ return props.href === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ButtonElement, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LinkButton, { ...props });
118
+ }
119
+
120
+ // src/design/components/atoms/InlineCode.tsx
121
+ var import_jsx_runtime2 = require("react/jsx-runtime");
122
+ function InlineCode({ children, className, ...rest }) {
123
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("code", { ...rest, className: cx("elb-code-inline", className), children });
124
+ }
125
+
126
+ // src/design/components/atoms/EventLegend.tsx
127
+ var import_jsx_runtime3 = require("react/jsx-runtime");
128
+ var PARTS = [
129
+ ["entity", "var(--event-entity)"],
130
+ ["action", "var(--event-action)"],
131
+ ["property", "var(--event-property)"],
132
+ ["context", "var(--event-context)"],
133
+ ["globals", "var(--event-globals)"]
134
+ ];
135
+ function EventLegend({ parts, className, ...rest }) {
136
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { ...rest, className: cx("elb-legend", className), "data-theme": "dark", children: PARTS.filter(([part]) => !parts || parts.includes(part)).map(
137
+ ([part, color]) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "elb-legend__item", children: [
138
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
139
+ "i",
140
+ {
141
+ className: "elb-legend__swatch",
142
+ style: { background: color },
143
+ "aria-hidden": "true"
144
+ }
145
+ ),
146
+ part
147
+ ] }, part)
148
+ ) });
149
+ }
150
+
151
+ // src/design/components/atoms/Icon.tsx
152
+ var import_jsx_runtime4 = require("react/jsx-runtime");
153
+ var GLYPHS = {
154
+ check: {
155
+ viewBox: "0 0 16 16",
156
+ strokes: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
157
+ "path",
158
+ {
159
+ d: "M3 8.5l3 3 7-7",
160
+ fill: "none",
161
+ stroke: "currentColor",
162
+ strokeWidth: 2,
163
+ strokeLinecap: "round",
164
+ strokeLinejoin: "round"
165
+ }
166
+ )
167
+ },
168
+ copy: {
169
+ viewBox: "0 0 24 24",
170
+ strokes: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
171
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
172
+ "rect",
173
+ {
174
+ x: 9,
175
+ y: 9,
176
+ width: 12,
177
+ height: 12,
178
+ rx: 2,
179
+ fill: "none",
180
+ stroke: "currentColor",
181
+ strokeWidth: 2
182
+ }
183
+ ),
184
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
185
+ "path",
186
+ {
187
+ d: "M5 15V5a2 2 0 0 1 2-2h10",
188
+ fill: "none",
189
+ stroke: "currentColor",
190
+ strokeWidth: 2
191
+ }
192
+ )
193
+ ] })
194
+ },
195
+ lock: {
196
+ viewBox: "0 0 24 24",
197
+ strokes: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
198
+ "g",
199
+ {
200
+ fill: "none",
201
+ stroke: "currentColor",
202
+ strokeWidth: 2,
203
+ strokeLinecap: "round",
204
+ strokeLinejoin: "round",
205
+ children: [
206
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("rect", { x: 5, y: 11, width: 14, height: 10, rx: 2 }),
207
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M8 11V7a4 4 0 0 1 8 0v4" })
208
+ ]
209
+ }
210
+ )
211
+ },
212
+ reload: {
213
+ viewBox: "0 0 24 24",
214
+ strokes: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
215
+ "g",
216
+ {
217
+ fill: "none",
218
+ stroke: "currentColor",
219
+ strokeWidth: 2,
220
+ strokeLinecap: "round",
221
+ strokeLinejoin: "round",
222
+ children: [
223
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M21 4v6h-6" }),
224
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M20.5 15a9 9 0 1 1-2.1-9.4L21 10" })
225
+ ]
226
+ }
227
+ )
228
+ },
229
+ bookmark: {
230
+ viewBox: "0 0 24 24",
231
+ strokes: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
232
+ "path",
233
+ {
234
+ d: "M6 3h12v18l-6-4-6 4z",
235
+ fill: "none",
236
+ stroke: "currentColor",
237
+ strokeWidth: 2,
238
+ strokeLinejoin: "round"
239
+ }
240
+ )
241
+ },
242
+ warning: {
243
+ viewBox: "0 0 24 24",
244
+ strokes: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
245
+ "g",
246
+ {
247
+ fill: "none",
248
+ stroke: "currentColor",
249
+ strokeWidth: 2,
250
+ strokeLinecap: "round",
251
+ strokeLinejoin: "round",
252
+ children: [
253
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M10.3 3.9 2.4 18a2 2 0 0 0 1.7 3h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z" }),
254
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M12 9v4" }),
255
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M12 17h.01" })
256
+ ]
257
+ }
258
+ )
259
+ }
260
+ };
261
+ function Icon({ name, size = 16, className, ...rest }) {
262
+ const { viewBox, strokes } = GLYPHS[name];
263
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
264
+ "svg",
265
+ {
266
+ "aria-hidden": true,
267
+ focusable: false,
268
+ ...rest,
269
+ width: size,
270
+ height: size,
271
+ className: cx("elb-icon", `elb-icon--${name}`, className),
272
+ viewBox,
273
+ children: strokes
274
+ }
275
+ );
276
+ }
277
+
278
+ // src/design/components/atoms/Eyebrow.tsx
279
+ var import_jsx_runtime5 = require("react/jsx-runtime");
280
+ function Eyebrow({
281
+ children,
282
+ variant = "eyebrow",
283
+ tone = "link",
284
+ className,
285
+ ...rest
286
+ }) {
287
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
288
+ "p",
289
+ {
290
+ ...rest,
291
+ className: cx(
292
+ "elb-eyebrow",
293
+ variant === "label" && "elb-eyebrow--label",
294
+ tone === "muted" && "elb-eyebrow--muted",
295
+ className
296
+ ),
297
+ children
298
+ }
299
+ );
300
+ }
301
+
302
+ // src/design/components/atoms/Stat.tsx
303
+ var import_jsx_runtime6 = require("react/jsx-runtime");
304
+ function Stat({ value, children, className, ...rest }) {
305
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ...rest, className: cx("elb-stat", className), children: [
306
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "elb-stat__value", children: value }),
307
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "elb-stat__label", children })
308
+ ] });
309
+ }
310
+
311
+ // src/design/components/atoms/Text.tsx
312
+ var import_jsx_runtime7 = require("react/jsx-runtime");
313
+ function Text({
314
+ children,
315
+ size = "body",
316
+ tone = "muted",
317
+ className,
318
+ ...rest
319
+ }) {
320
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
321
+ "p",
322
+ {
323
+ ...rest,
324
+ className: cx(
325
+ "elb-text",
326
+ size === "lg" && "elb-text--lg",
327
+ tone === "fg" && "elb-text--fg",
328
+ className
329
+ ),
330
+ children
331
+ }
332
+ );
333
+ }
334
+
335
+ // src/design/components/atoms/TextLink.tsx
336
+ var import_jsx_runtime8 = require("react/jsx-runtime");
337
+ function TextLink({
338
+ href,
339
+ children,
340
+ tone = "link",
341
+ arrow = false,
342
+ linkComponent: Link,
343
+ className,
344
+ ...rest
345
+ }) {
346
+ const props = {
347
+ ...rest,
348
+ href,
349
+ className: cx(
350
+ "elb-text-link",
351
+ tone === "muted" && "elb-text-link--muted",
352
+ className
353
+ )
354
+ };
355
+ const content = /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
356
+ children,
357
+ arrow && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { "aria-hidden": "true", children: " \u2192" })
358
+ ] });
359
+ return Link ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Link, { ...props, children: content }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("a", { ...props, children: content });
360
+ }
361
+
362
+ // src/design/components/atoms/Card.tsx
363
+ var import_jsx_runtime9 = require("react/jsx-runtime");
364
+ function Card({
365
+ children,
366
+ padding = "md",
367
+ radius = "lg",
368
+ hover = false,
369
+ highlight = false,
370
+ glow = false,
371
+ className,
372
+ ...rest
373
+ }) {
374
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
375
+ "div",
376
+ {
377
+ ...rest,
378
+ className: cx(
379
+ "elb-card",
380
+ `elb-card--pad-${padding}`,
381
+ radius === "xl" && "elb-card--radius-xl",
382
+ hover && "elb-card--hover",
383
+ highlight && "elb-card--highlight",
384
+ glow && "elb-card--glow",
385
+ className
386
+ ),
387
+ children
388
+ }
389
+ );
390
+ }
391
+
392
+ // src/design/components/atoms/InstallCommand.tsx
393
+ var import_react = require("react");
394
+ var import_jsx_runtime10 = require("react/jsx-runtime");
395
+ var CONFIRM_MS = 1400;
396
+ async function copyText(text) {
397
+ try {
398
+ await navigator.clipboard.writeText(text);
399
+ return true;
400
+ } catch {
401
+ return false;
402
+ }
403
+ }
404
+ function InstallCommand({
405
+ command = "npm i -g @walkeros/cli",
406
+ className,
407
+ "aria-describedby": describedBy,
408
+ ...rest
409
+ }) {
410
+ const hintId = (0, import_react.useId)();
411
+ const [state, setState] = (0, import_react.useState)("idle");
412
+ const mounted = (0, import_react.useRef)(true);
413
+ const timer = (0, import_react.useRef)(void 0);
414
+ (0, import_react.useEffect)(() => {
415
+ mounted.current = true;
416
+ return () => {
417
+ mounted.current = false;
418
+ clearTimeout(timer.current);
419
+ };
420
+ }, []);
421
+ const copy = async () => {
422
+ const copied = await copyText(command);
423
+ if (!mounted.current) return;
424
+ clearTimeout(timer.current);
425
+ setState(copied ? "done" : "failed");
426
+ if (copied) timer.current = setTimeout(() => setState("idle"), CONFIRM_MS);
427
+ };
428
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
429
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
430
+ "button",
431
+ {
432
+ ...rest,
433
+ "aria-describedby": describedBy ? `${hintId} ${describedBy}` : hintId,
434
+ type: "button",
435
+ className: cx("elb-cmd", className),
436
+ onClick: () => {
437
+ void copy();
438
+ },
439
+ children: [
440
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
441
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "elb-cmd__prompt", "aria-hidden": "true", children: [
442
+ "$",
443
+ " "
444
+ ] }),
445
+ command
446
+ ] }),
447
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
448
+ "span",
449
+ {
450
+ className: cx(
451
+ "elb-cmd__icon",
452
+ state === "done" && "elb-cmd__icon--done"
453
+ ),
454
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon, { name: state === "done" ? "check" : "copy" })
455
+ }
456
+ )
457
+ ]
458
+ }
459
+ ),
460
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { id: hintId, hidden: true, children: "Copy install command" }),
461
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "elb-cmd__status", role: "status", children: state === "done" ? "Copied" : state === "failed" ? "Copy failed" : "" })
462
+ ] });
463
+ }
464
+
465
+ // src/design/components/atoms/PhotoPlaceholder.tsx
466
+ var import_jsx_runtime11 = require("react/jsx-runtime");
467
+ function PhotoPlaceholder({
468
+ label = "photo",
469
+ tone = "theme",
470
+ className,
471
+ ...rest
472
+ }) {
473
+ const named = rest.role !== void 0 || rest["aria-label"] !== void 0 || rest["aria-labelledby"] !== void 0;
474
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
475
+ "div",
476
+ {
477
+ "aria-hidden": named ? void 0 : true,
478
+ ...rest,
479
+ className: cx("elb-photo", tone === "viz" && "elb-photo--viz", className),
480
+ ...tone === "viz" ? { "data-theme": "dark" } : {},
481
+ children: label
482
+ }
483
+ );
484
+ }
485
+
486
+ // src/design/components/molecules/CheckList.tsx
487
+ var import_jsx_runtime12 = require("react/jsx-runtime");
488
+ function CheckList({
489
+ items,
490
+ layout = "inline",
491
+ align = "start",
492
+ className,
493
+ ...rest
494
+ }) {
495
+ const stack = layout === "stack";
496
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
497
+ "ul",
498
+ {
499
+ ...rest,
500
+ className: cx(
501
+ "elb-checklist",
502
+ stack && "elb-checklist--stack",
503
+ align === "center" && "elb-checklist--center",
504
+ className
505
+ ),
506
+ children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("li", { className: "elb-checklist__item", children: [
507
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon, { name: "check", size: stack ? 14 : 16 }),
508
+ item
509
+ ] }, index))
510
+ }
511
+ );
512
+ }
513
+
514
+ // src/design/components/molecules/SectionHeading.tsx
515
+ var import_jsx_runtime13 = require("react/jsx-runtime");
516
+ function SectionHeading({
517
+ title,
518
+ eyebrow,
519
+ lead,
520
+ level = 2,
521
+ size = "lg",
522
+ highlight,
523
+ align = "start",
524
+ className,
525
+ ...rest
526
+ }) {
527
+ const hero = level === 1;
528
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
529
+ "div",
530
+ {
531
+ ...rest,
532
+ className: cx(
533
+ "elb-sh",
534
+ (hero || align === "center") && "elb-sh--center",
535
+ className
536
+ ),
537
+ children: [
538
+ eyebrow !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Eyebrow, { children: eyebrow }),
539
+ hero ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("h1", { className: "elb-sh__title elb-sh__title--display", children: [
540
+ title,
541
+ highlight !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
542
+ " ",
543
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "elb-sh__highlight", children: highlight })
544
+ ] })
545
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h2", { className: cx("elb-sh__title", `elb-sh__title--${size}`), children: title }),
546
+ lead !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: cx("elb-sh__lead", hero && "elb-sh__lead--hero"), children: lead })
547
+ ]
548
+ }
549
+ );
550
+ }
551
+
552
+ // src/design/components/molecules/ProblemCard.tsx
553
+ var import_jsx_runtime14 = require("react/jsx-runtime");
554
+ function ProblemCard({
555
+ number,
556
+ title,
557
+ children,
558
+ className,
559
+ ...rest
560
+ }) {
561
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
562
+ Card,
563
+ {
564
+ ...rest,
565
+ padding: "sm",
566
+ hover: true,
567
+ className: cx("elb-problem-card", className),
568
+ children: [
569
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("h3", { className: "elb-problem-card__title", children: [
570
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "elb-problem-card__number", children: number }),
571
+ title
572
+ ] }),
573
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "elb-problem-card__text", children })
574
+ ]
575
+ }
576
+ );
577
+ }
578
+
579
+ // src/design/components/molecules/FeatureItem.tsx
580
+ var import_jsx_runtime15 = require("react/jsx-runtime");
581
+ function FeatureItem({
582
+ title,
583
+ children,
584
+ href,
585
+ linkLabel = "Docs",
586
+ linkComponent,
587
+ linkAttributes,
588
+ className,
589
+ ...rest
590
+ }) {
591
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { ...rest, className: cx("elb-feature", className), children: [
592
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon, { name: "check", size: 20 }),
593
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
594
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h3", { className: "elb-feature__title", children: title }),
595
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "elb-feature__text", children }),
596
+ href !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
597
+ TextLink,
598
+ {
599
+ ...linkAttributes,
600
+ href,
601
+ arrow: true,
602
+ linkComponent,
603
+ className: "elb-feature__link",
604
+ children: linkLabel
605
+ }
606
+ )
607
+ ] })
608
+ ] });
609
+ }
610
+
611
+ // src/design/components/molecules/FaqItem.tsx
612
+ var import_react2 = require("react");
613
+ var import_jsx_runtime16 = require("react/jsx-runtime");
614
+ function FaqItem({
615
+ question,
616
+ children,
617
+ className,
618
+ ...rest
619
+ }) {
620
+ const parts = Array.isArray(children) ? children : [children];
621
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("details", { ...rest, className: cx("elb-faq", className), children: [
622
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("summary", { className: "elb-faq__question", children: question }),
623
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "elb-faq__answer", children: parts.map(
624
+ (part, index) => typeof part === "string" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { children: part }, index) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react2.Fragment, { children: part }, index)
625
+ ) })
626
+ ] });
627
+ }
628
+
629
+ // src/design/components/molecules/PlanCard.tsx
630
+ var import_jsx_runtime17 = require("react/jsx-runtime");
631
+ function PlanCard({
632
+ label,
633
+ title,
634
+ children,
635
+ features,
636
+ cta,
637
+ highlight = false,
638
+ linkComponent,
639
+ className,
640
+ ...rest
641
+ }) {
642
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
643
+ Card,
644
+ {
645
+ ...rest,
646
+ padding: "md",
647
+ highlight,
648
+ className: cx("elb-plan", className),
649
+ children: [
650
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Eyebrow, { variant: "label", tone: highlight ? "link" : "muted", children: label }),
651
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h3", { className: "elb-plan__title", children: title }),
652
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "elb-plan__text", children }),
653
+ features && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CheckList, { items: features, layout: "stack" }),
654
+ cta && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
655
+ Button,
656
+ {
657
+ ...cta.attributes,
658
+ href: cta.href,
659
+ variant: highlight ? "primary" : "secondary",
660
+ block: true,
661
+ linkComponent,
662
+ children: cta.label
663
+ }
664
+ )
665
+ ]
666
+ }
667
+ );
668
+ }
669
+
670
+ // src/design/components/molecules/CaseCard.tsx
671
+ var import_jsx_runtime18 = require("react/jsx-runtime");
672
+ function CaseCard({
673
+ label,
674
+ title,
675
+ children,
676
+ stats,
677
+ className,
678
+ ...rest
679
+ }) {
680
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Card, { ...rest, padding: "md", className: cx("elb-case-card", className), children: [
681
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Eyebrow, { variant: "label", children: label }),
682
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h3", { className: "elb-case-card__title", children: title }),
683
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "elb-case-card__text", children }),
684
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "elb-case-card__stats", children: stats.map((stat, index) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Stat, { value: stat.value, children: stat.label }, index)) })
685
+ ] });
686
+ }
687
+
688
+ // src/design/components/molecules/HighlightCard.tsx
689
+ var import_jsx_runtime19 = require("react/jsx-runtime");
690
+ function HighlightCard({
691
+ label,
692
+ title,
693
+ children,
694
+ cta,
695
+ linkComponent,
696
+ className,
697
+ ...rest
698
+ }) {
699
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
700
+ Card,
701
+ {
702
+ ...rest,
703
+ padding: "lg",
704
+ radius: "xl",
705
+ hover: true,
706
+ glow: true,
707
+ className: cx("elb-highlight-card", className),
708
+ children: [
709
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Eyebrow, { variant: "label", children: label }),
710
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h3", { className: "elb-highlight-card__title", children: title }),
711
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "elb-highlight-card__text", children }),
712
+ cta && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
713
+ Button,
714
+ {
715
+ ...cta.attributes,
716
+ href: cta.href,
717
+ variant: "secondary",
718
+ arrow: true,
719
+ linkComponent,
720
+ className: "elb-highlight-card__cta",
721
+ children: cta.label
722
+ }
723
+ )
724
+ ]
725
+ }
726
+ );
727
+ }
728
+
729
+ // src/design/components/molecules/BrowserFrame.tsx
730
+ var import_jsx_runtime20 = require("react/jsx-runtime");
731
+ function BrowserFrame({
732
+ url,
733
+ bookmarks,
734
+ onNavigate,
735
+ onReload,
736
+ actions,
737
+ children,
738
+ className,
739
+ ...rest
740
+ }) {
741
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { ...rest, className: cx("elb-browser", className), children: [
742
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "elb-browser__bar", children: [
743
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "elb-browser__dots", "aria-hidden": "true", children: [
744
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", {}),
745
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", {}),
746
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", {})
747
+ ] }),
748
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "elb-browser__address", title: url, children: [
749
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { name: "lock", size: 14 }),
750
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "elb-browser__url", children: url })
751
+ ] }),
752
+ onReload && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
753
+ "button",
754
+ {
755
+ type: "button",
756
+ className: "elb-browser__reload",
757
+ "aria-label": "Reload",
758
+ onClick: onReload,
759
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { name: "reload", size: 16 })
760
+ }
761
+ ),
762
+ actions && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "elb-browser__actions", children: actions })
763
+ ] }),
764
+ bookmarks && bookmarks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("nav", { className: "elb-browser__bookmarks", "aria-label": "Bookmarks", children: bookmarks.map((bookmark) => {
765
+ const current = bookmark.url === url;
766
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
767
+ "button",
768
+ {
769
+ type: "button",
770
+ className: cx(
771
+ "elb-browser__bookmark",
772
+ current && "elb-browser__bookmark--active"
773
+ ),
774
+ "aria-current": current ? "page" : void 0,
775
+ disabled: !onNavigate,
776
+ onClick: () => onNavigate?.(bookmark.url),
777
+ children: [
778
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { name: "bookmark", size: 14 }),
779
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: bookmark.label })
780
+ ]
781
+ },
782
+ bookmark.url
783
+ );
784
+ }) }),
785
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "elb-browser__viewport", children })
786
+ ] });
787
+ }
788
+
789
+ // src/design/components/molecules/QuickstartSteps.tsx
790
+ var import_jsx_runtime21 = require("react/jsx-runtime");
791
+ var ARROWS = [
792
+ {
793
+ kind: "wave",
794
+ paths: [
795
+ "M4 26 C 18 6, 34 6, 40 20 S 58 34, 70 16",
796
+ "M62 20 L70 16 L69.5 25"
797
+ ]
798
+ },
799
+ {
800
+ kind: "loop",
801
+ paths: [
802
+ "M4 28 C 20 30, 26 8, 38 10 C 50 12, 44 28, 36 24 C 28 20, 44 6, 72 14",
803
+ "M65.7 7.6 L72 14 L63.3 16.2"
804
+ ]
805
+ }
806
+ ];
807
+ function Arrow({ kind, paths }) {
808
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
809
+ "li",
810
+ {
811
+ className: cx("elb-quickstart__arrow", `elb-quickstart__arrow--${kind}`),
812
+ "aria-hidden": "true",
813
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
814
+ "svg",
815
+ {
816
+ width: "76",
817
+ height: "40",
818
+ viewBox: "0 0 76 40",
819
+ fill: "none",
820
+ stroke: "currentColor",
821
+ strokeWidth: "2.2",
822
+ strokeLinecap: "round",
823
+ strokeLinejoin: "round",
824
+ children: paths.map((d) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d }, d))
825
+ }
826
+ )
827
+ }
828
+ );
829
+ }
830
+ function QuickstartSteps({
831
+ steps,
832
+ children,
833
+ className,
834
+ ...rest
835
+ }) {
836
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { ...rest, className: cx("elb-quickstart", className), children: [
837
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("ol", { className: "elb-quickstart__steps", children: steps.flatMap((step, index) => {
838
+ const item = /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("li", { className: "elb-quickstart__step", children: [
839
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "elb-quickstart__head", children: [
840
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "elb-quickstart__num", "aria-hidden": "true", children: index + 1 }),
841
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h3", { className: "elb-quickstart__title", children: step.title })
842
+ ] }),
843
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "elb-quickstart__copy", children: step.text })
844
+ ] }, step.title);
845
+ return index < steps.length - 1 ? [
846
+ item,
847
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
848
+ Arrow,
849
+ {
850
+ ...ARROWS[index % ARROWS.length]
851
+ },
852
+ `arrow-${index}`
853
+ )
854
+ ] : [item];
855
+ }) }),
856
+ children
857
+ ] });
858
+ }
859
+
860
+ // src/design/components/layout/Section.tsx
861
+ var import_jsx_runtime22 = require("react/jsx-runtime");
862
+ function Section({
863
+ children,
864
+ tone = "default",
865
+ className,
866
+ ...rest
867
+ }) {
868
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
869
+ "section",
870
+ {
871
+ ...rest,
872
+ className: cx(
873
+ "elb-section",
874
+ tone === "alt" && "elb-section--alt",
875
+ className
876
+ ),
877
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "elb-section__inner", children })
878
+ }
879
+ );
880
+ }
881
+
882
+ // src/design/components/layout/CardGrid.tsx
883
+ var import_jsx_runtime23 = require("react/jsx-runtime");
884
+ function CardGrid({
885
+ children,
886
+ min,
887
+ gap = "cards",
888
+ className,
889
+ ...rest
890
+ }) {
891
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
892
+ "div",
893
+ {
894
+ ...rest,
895
+ className: cx(
896
+ "elb-card-grid",
897
+ `elb-card-grid--min-${min}`,
898
+ gap === "features" && "elb-card-grid--features",
899
+ className
900
+ ),
901
+ children
902
+ }
903
+ );
904
+ }
905
+
906
+ // src/design/components/layout/Split.tsx
907
+ var import_jsx_runtime24 = require("react/jsx-runtime");
908
+ function Split({
909
+ start,
910
+ end,
911
+ variant = "even",
912
+ className,
913
+ ...rest
914
+ }) {
915
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
916
+ "div",
917
+ {
918
+ ...rest,
919
+ className: cx(
920
+ "elb-split",
921
+ variant === "aside" && "elb-split--aside",
922
+ className
923
+ ),
924
+ children: [
925
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "elb-split__start", children: start }),
926
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "elb-split__end", children: end })
927
+ ]
928
+ }
929
+ );
930
+ }
931
+
932
+ // src/design/components/layout/Cluster.tsx
933
+ var import_jsx_runtime25 = require("react/jsx-runtime");
934
+ function Cluster({
935
+ children,
936
+ gap = "actions",
937
+ align = "start",
938
+ separated = false,
939
+ className,
940
+ ...rest
941
+ }) {
942
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
943
+ "div",
944
+ {
945
+ ...rest,
946
+ className: cx(
947
+ "elb-cluster",
948
+ gap === "links" && "elb-cluster--links",
949
+ align === "center" && "elb-cluster--center",
950
+ separated && "elb-cluster--separated",
951
+ className
952
+ ),
953
+ children
954
+ }
955
+ );
956
+ }
957
+
958
+ // src/design/components/layout/Hero.tsx
959
+ var import_jsx_runtime26 = require("react/jsx-runtime");
960
+ function Hero({
961
+ eyebrow,
962
+ title,
963
+ highlight,
964
+ lead,
965
+ actions,
966
+ proof,
967
+ children,
968
+ className,
969
+ ...rest
970
+ }) {
971
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("section", { ...rest, className: cx("elb-hero", className), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "elb-hero__inner", children: [
972
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
973
+ SectionHeading,
974
+ {
975
+ level: 1,
976
+ eyebrow,
977
+ title,
978
+ highlight,
979
+ lead
980
+ }
981
+ ),
982
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "elb-hero__actions", children: actions }),
983
+ proof !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "elb-hero__proof", children: proof }),
984
+ children !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "elb-hero__demo", children })
985
+ ] }) });
986
+ }
987
+
988
+ // src/design/components/viz/DestinationMappingViz.tsx
989
+ var import_react3 = require("react");
990
+
991
+ // src/design/components/viz/data/destination-mapping.ts
992
+ var GENERATED_ID = "\u2026";
993
+ var MAPPING_CAPTION = "50+ destination packages ship with the project. Removing GA4 or adding a new pixel is a block in this file, not a re-instrumentation project across every page.";
994
+ var GA4_MEASUREMENT_ID = "G-XXXXXXXXXX";
995
+ var MAPPING_EVENTS = [
996
+ {
997
+ entity: "product",
998
+ action: "view",
999
+ data: { id: "ers", price: 420, currency: "EUR" },
1000
+ destinations: [
1001
+ {
1002
+ id: "ga4",
1003
+ label: "GA4",
1004
+ rule: {
1005
+ name: "view_item",
1006
+ data: {
1007
+ map: {
1008
+ currency: "data.currency",
1009
+ value: "data.price",
1010
+ items: { loop: ["this", { map: { item_id: "data.id" } }] }
1011
+ }
1012
+ }
1013
+ },
1014
+ calls: [
1015
+ [
1016
+ "gtag",
1017
+ "event",
1018
+ "view_item",
1019
+ {
1020
+ currency: "EUR",
1021
+ value: 420,
1022
+ items: [{ item_id: "ers" }],
1023
+ send_to: GA4_MEASUREMENT_ID
1024
+ }
1025
+ ]
1026
+ ]
1027
+ },
1028
+ {
1029
+ id: "meta",
1030
+ label: "Meta Pixel",
1031
+ rule: {
1032
+ name: "ViewContent",
1033
+ data: {
1034
+ map: {
1035
+ value: "data.price",
1036
+ currency: "data.currency",
1037
+ contents: {
1038
+ set: [
1039
+ {
1040
+ map: {
1041
+ id: "data.id",
1042
+ quantity: { key: "data.quantity", value: 1 }
1043
+ }
1044
+ }
1045
+ ]
1046
+ },
1047
+ content_type: { value: "product" }
1048
+ }
1049
+ }
1050
+ },
1051
+ calls: [
1052
+ [
1053
+ "fbq",
1054
+ "track",
1055
+ "ViewContent",
1056
+ {
1057
+ value: 420,
1058
+ currency: "EUR",
1059
+ contents: [{ id: "ers", quantity: 1 }],
1060
+ content_type: "product"
1061
+ },
1062
+ { eventID: GENERATED_ID }
1063
+ ]
1064
+ ]
1065
+ },
1066
+ {
1067
+ id: "tiktok",
1068
+ label: "TikTok Pixel",
1069
+ rule: {
1070
+ name: "ViewContent",
1071
+ data: {
1072
+ map: {
1073
+ content_id: "data.id",
1074
+ content_type: { value: "product" },
1075
+ value: "data.price",
1076
+ currency: "data.currency"
1077
+ }
1078
+ }
1079
+ },
1080
+ calls: [
1081
+ [
1082
+ "ttq.track",
1083
+ "ViewContent",
1084
+ {
1085
+ content_id: "ers",
1086
+ content_type: "product",
1087
+ value: 420,
1088
+ currency: "EUR"
1089
+ },
1090
+ { event_id: GENERATED_ID }
1091
+ ]
1092
+ ]
1093
+ },
1094
+ {
1095
+ id: "amplitude",
1096
+ label: "Amplitude",
1097
+ rule: {
1098
+ name: "Product Viewed",
1099
+ data: {
1100
+ map: {
1101
+ product_id: "data.id",
1102
+ price: "data.price",
1103
+ currency: "data.currency"
1104
+ }
1105
+ }
1106
+ },
1107
+ calls: [
1108
+ [
1109
+ "amplitude.track",
1110
+ "Product Viewed",
1111
+ { product_id: "ers", price: 420, currency: "EUR" }
1112
+ ]
1113
+ ]
1114
+ }
1115
+ ]
1116
+ },
1117
+ {
1118
+ entity: "lead",
1119
+ action: "submit",
1120
+ data: { type: "demo", value: 2500, currency: "EUR" },
1121
+ destinations: [
1122
+ {
1123
+ id: "ga4",
1124
+ label: "GA4",
1125
+ rule: {
1126
+ name: "generate_lead",
1127
+ data: { map: { value: "data.value", currency: "data.currency" } }
1128
+ },
1129
+ calls: [
1130
+ [
1131
+ "gtag",
1132
+ "event",
1133
+ "generate_lead",
1134
+ { value: 2500, currency: "EUR", send_to: GA4_MEASUREMENT_ID }
1135
+ ]
1136
+ ]
1137
+ },
1138
+ {
1139
+ id: "meta",
1140
+ label: "Meta Pixel",
1141
+ rule: {
1142
+ name: "Lead",
1143
+ data: { map: { value: "data.value", currency: "data.currency" } }
1144
+ },
1145
+ calls: [
1146
+ [
1147
+ "fbq",
1148
+ "track",
1149
+ "Lead",
1150
+ { value: 2500, currency: "EUR" },
1151
+ { eventID: GENERATED_ID }
1152
+ ]
1153
+ ]
1154
+ },
1155
+ {
1156
+ id: "tiktok",
1157
+ label: "TikTok Pixel",
1158
+ rule: {
1159
+ name: "Contact",
1160
+ data: { map: { value: "data.value", currency: "data.currency" } }
1161
+ },
1162
+ calls: [
1163
+ [
1164
+ "ttq.track",
1165
+ "Contact",
1166
+ { value: 2500, currency: "EUR" },
1167
+ { event_id: GENERATED_ID }
1168
+ ]
1169
+ ]
1170
+ },
1171
+ {
1172
+ id: "amplitude",
1173
+ label: "Amplitude",
1174
+ rule: {
1175
+ name: "Lead Submitted",
1176
+ data: {
1177
+ map: {
1178
+ lead_type: "data.type",
1179
+ value: "data.value",
1180
+ currency: "data.currency"
1181
+ }
1182
+ }
1183
+ },
1184
+ calls: [
1185
+ [
1186
+ "amplitude.track",
1187
+ "Lead Submitted",
1188
+ { lead_type: "demo", value: 2500, currency: "EUR" }
1189
+ ]
1190
+ ]
1191
+ }
1192
+ ]
1193
+ },
1194
+ {
1195
+ entity: "order",
1196
+ action: "complete",
1197
+ data: { id: "0rd3r1d", value: 462, currency: "EUR" },
1198
+ nested: [
1199
+ { entity: "product", data: { id: "ers", price: 420, quantity: 1 } }
1200
+ ],
1201
+ destinations: [
1202
+ {
1203
+ id: "ga4",
1204
+ label: "GA4",
1205
+ rule: {
1206
+ name: "purchase",
1207
+ data: {
1208
+ map: {
1209
+ transaction_id: "data.id",
1210
+ value: "data.value",
1211
+ currency: "data.currency",
1212
+ items: {
1213
+ loop: [
1214
+ "nested",
1215
+ {
1216
+ map: {
1217
+ item_id: "data.id",
1218
+ price: "data.price",
1219
+ quantity: "data.quantity"
1220
+ }
1221
+ }
1222
+ ]
1223
+ }
1224
+ }
1225
+ }
1226
+ },
1227
+ calls: [
1228
+ [
1229
+ "gtag",
1230
+ "event",
1231
+ "purchase",
1232
+ {
1233
+ transaction_id: "0rd3r1d",
1234
+ value: 462,
1235
+ currency: "EUR",
1236
+ items: [{ item_id: "ers", price: 420, quantity: 1 }],
1237
+ send_to: GA4_MEASUREMENT_ID
1238
+ }
1239
+ ]
1240
+ ]
1241
+ },
1242
+ {
1243
+ id: "meta",
1244
+ label: "Meta Pixel",
1245
+ rule: {
1246
+ name: "Purchase",
1247
+ data: {
1248
+ map: {
1249
+ value: "data.value",
1250
+ currency: "data.currency",
1251
+ contents: {
1252
+ loop: [
1253
+ "nested",
1254
+ { map: { id: "data.id", quantity: "data.quantity" } }
1255
+ ]
1256
+ },
1257
+ content_type: { value: "product" }
1258
+ }
1259
+ }
1260
+ },
1261
+ calls: [
1262
+ [
1263
+ "fbq",
1264
+ "track",
1265
+ "Purchase",
1266
+ {
1267
+ value: 462,
1268
+ currency: "EUR",
1269
+ contents: [{ id: "ers", quantity: 1 }],
1270
+ content_type: "product"
1271
+ },
1272
+ { eventID: GENERATED_ID }
1273
+ ]
1274
+ ]
1275
+ },
1276
+ {
1277
+ id: "tiktok",
1278
+ label: "TikTok Pixel",
1279
+ rule: {
1280
+ name: "CompletePayment",
1281
+ data: {
1282
+ map: {
1283
+ order_id: "data.id",
1284
+ value: "data.value",
1285
+ currency: "data.currency",
1286
+ contents: {
1287
+ loop: [
1288
+ "nested",
1289
+ {
1290
+ map: {
1291
+ content_id: "data.id",
1292
+ quantity: "data.quantity",
1293
+ price: "data.price"
1294
+ }
1295
+ }
1296
+ ]
1297
+ },
1298
+ content_type: { value: "product" }
1299
+ }
1300
+ }
1301
+ },
1302
+ calls: [
1303
+ [
1304
+ "ttq.track",
1305
+ "CompletePayment",
1306
+ {
1307
+ order_id: "0rd3r1d",
1308
+ value: 462,
1309
+ currency: "EUR",
1310
+ contents: [{ content_id: "ers", quantity: 1, price: 420 }],
1311
+ content_type: "product"
1312
+ },
1313
+ { event_id: GENERATED_ID }
1314
+ ]
1315
+ ]
1316
+ },
1317
+ {
1318
+ id: "amplitude",
1319
+ label: "Amplitude",
1320
+ rule: {
1321
+ silent: true,
1322
+ settings: {
1323
+ revenue: {
1324
+ loop: [
1325
+ "nested",
1326
+ {
1327
+ map: {
1328
+ productId: "data.id",
1329
+ price: "data.price",
1330
+ quantity: "data.quantity",
1331
+ revenueType: { value: "purchase" },
1332
+ currency: { value: "EUR" }
1333
+ }
1334
+ }
1335
+ ]
1336
+ }
1337
+ }
1338
+ },
1339
+ calls: [
1340
+ [
1341
+ "amplitude.revenue",
1342
+ {
1343
+ productId: "ers",
1344
+ price: 420,
1345
+ quantity: 1,
1346
+ revenueType: "purchase",
1347
+ currency: "EUR"
1348
+ }
1349
+ ]
1350
+ ]
1351
+ }
1352
+ ]
1353
+ }
1354
+ ];
1355
+
1356
+ // src/design/components/viz/parts/CodeTokens.tsx
1357
+ var import_jsx_runtime27 = require("react/jsx-runtime");
1358
+ function CodeTokens({
1359
+ tokens,
1360
+ active = false
1361
+ }) {
1362
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_jsx_runtime27.Fragment, { children: tokens.map((token, index) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1363
+ "span",
1364
+ {
1365
+ className: cx(
1366
+ "elb-viz-tok",
1367
+ `elb-viz-tok--${token.kind}`,
1368
+ active && token.mark && `elb-viz-tok--mark-${token.mark}`
1369
+ ),
1370
+ children: token.t
1371
+ },
1372
+ index
1373
+ )) });
1374
+ }
1375
+ function CodeLine({ number, bar, className, children }) {
1376
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: cx("elb-viz-line", className), children: [
1377
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1378
+ "span",
1379
+ {
1380
+ className: cx("elb-viz-line__bar", bar && `elb-viz-line__bar--${bar}`),
1381
+ "aria-hidden": "true"
1382
+ }
1383
+ ),
1384
+ number !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "elb-viz-line__number", children: number }),
1385
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "elb-viz-line__code", children })
1386
+ ] });
1387
+ }
1388
+
1389
+ // src/design/components/viz/parts/tokens.ts
1390
+ function tok(t, kind, mark) {
1391
+ return mark ? { t, kind, mark } : { t, kind };
1392
+ }
1393
+ function typedLength(tokens) {
1394
+ return tokens.reduce((length, token) => length + token.t.length, 0);
1395
+ }
1396
+ function truncate(tokens, n) {
1397
+ const out = [];
1398
+ let left = n;
1399
+ for (const token of tokens) {
1400
+ if (left <= 0) break;
1401
+ const t = token.t.slice(0, left);
1402
+ out.push({ ...token, t });
1403
+ left -= t.length;
1404
+ }
1405
+ return out;
1406
+ }
1407
+
1408
+ // src/design/components/viz/parts/format.ts
1409
+ var ELIDED = "{\u2026}";
1410
+ function isRecord(value) {
1411
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1412
+ }
1413
+ function literal(value) {
1414
+ if (typeof value === "string")
1415
+ return `'${value.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
1416
+ if (typeof value !== "object" || value === null) return String(value);
1417
+ if (Array.isArray(value)) return `[${value.map(literal).join(", ")}]`;
1418
+ const entries = Object.entries(value);
1419
+ return entries.length === 0 ? "{}" : `{ ${entries.map(([key, item]) => `${key}: ${literal(item)}`).join(", ")} }`;
1420
+ }
1421
+ function formatRule(entity, action, rule) {
1422
+ const fields = [];
1423
+ if (rule.name !== void 0) fields.push(`"name": "${rule.name}"`);
1424
+ if (rule.silent) fields.push('"silent": true');
1425
+ if (rule.data !== void 0) fields.push(`"data": ${ELIDED}`);
1426
+ if (rule.settings !== void 0) {
1427
+ const settings = Object.keys(rule.settings).map(
1428
+ (key) => `"${key}": ${ELIDED}`
1429
+ );
1430
+ fields.push(`"settings": { ${settings.join(", ")} }`);
1431
+ }
1432
+ return `"${entity}": { "${action}": { ${fields.join(", ")} } }`;
1433
+ }
1434
+ function formatCall(record) {
1435
+ const [fn, ...args] = record;
1436
+ const at = args.findIndex(isRecord);
1437
+ const params = args[at];
1438
+ if (at < 0 || params === void 0 || !isRecord(params))
1439
+ return [`${fn}(${args.map(literal).join(", ")})`];
1440
+ const fields = Object.entries(params);
1441
+ if (fn === "amplitude.revenue") {
1442
+ if (fields.length === 0) return ["amplitude.revenue(new Revenue())"];
1443
+ return [
1444
+ "amplitude.revenue(new Revenue()",
1445
+ ...fields.map(
1446
+ ([key, value], index) => ` .set${key.charAt(0).toUpperCase()}${key.slice(1)}(${literal(value)})${index === fields.length - 1 ? ")" : ""}`
1447
+ )
1448
+ ];
1449
+ }
1450
+ const before = args.slice(0, at).map(literal);
1451
+ const after = args.slice(at + 1).map(literal);
1452
+ return [
1453
+ `${fn}(${[...before, "{"].join(", ")}`,
1454
+ ...fields.map(([key, value]) => ` ${key}: ${literal(value)},`),
1455
+ `}${after.map((arg) => `, ${arg}`).join("")})`
1456
+ ];
1457
+ }
1458
+ function formatElb(event) {
1459
+ const name = literal(`${event.entity} ${event.action}`);
1460
+ const data = literal(event.data);
1461
+ if (!event.nested?.length) return `elb(${name}, ${data})`;
1462
+ const nested = event.nested.map(
1463
+ (entity) => `{ entity: ${literal(entity.entity)}, \u2026 }`
1464
+ );
1465
+ return `elb({ name: ${name}, data: ${data}, nested: [${nested.join(", ")}] })`;
1466
+ }
1467
+ var TOKEN = /"[^"]*"|'[^']*'|\d+(?:\.\d+)?|[A-Za-z_]\w*|\s+|./g;
1468
+ var CALLS = /^(?:gtag|fbq|elb|ttq|track|amplitude|revenue|Revenue|set[A-Z]\w*)$/;
1469
+ function tokenizeCode(line, highlight) {
1470
+ const tokens = [];
1471
+ for (const match of line.matchAll(TOKEN)) {
1472
+ const t = match[0];
1473
+ const isKey = /^\s*:/.test(line.slice((match.index ?? 0) + t.length));
1474
+ if (t.startsWith('"') || t.startsWith("'")) {
1475
+ const marked = highlight !== void 0 && t.slice(1, -1) === highlight;
1476
+ tokens.push(
1477
+ tok(t, isKey ? "key" : "value", marked ? "entity" : void 0)
1478
+ );
1479
+ } else if (/^\d/.test(t) || t === "true" || t === "false") {
1480
+ tokens.push(tok(t, "num"));
1481
+ } else if (CALLS.test(t)) {
1482
+ tokens.push(tok(t, "fn"));
1483
+ } else if (/^[A-Za-z_]/.test(t)) {
1484
+ tokens.push(tok(t, isKey ? "key" : "text"));
1485
+ } else if (/^\s+$/.test(t)) {
1486
+ tokens.push(tok(t, "text"));
1487
+ } else {
1488
+ tokens.push(tok(t, "punct"));
1489
+ }
1490
+ }
1491
+ return tokens;
1492
+ }
1493
+
1494
+ // src/design/components/viz/parts/VizFrame.tsx
1495
+ var import_jsx_runtime28 = require("react/jsx-runtime");
1496
+ function VizFrame({
1497
+ variant,
1498
+ children,
1499
+ className,
1500
+ ...rest
1501
+ }) {
1502
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1503
+ "div",
1504
+ {
1505
+ ...rest,
1506
+ "data-theme": "dark",
1507
+ className: cx("elb-viz", `elb-viz--${variant}`, className),
1508
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "elb-viz__body", children })
1509
+ }
1510
+ );
1511
+ }
1512
+
1513
+ // src/design/components/viz/DestinationMappingViz.tsx
1514
+ var import_jsx_runtime29 = require("react/jsx-runtime");
1515
+ function DestinationMappingViz({
1516
+ initialEvent = 0,
1517
+ caption = MAPPING_CAPTION,
1518
+ ...rest
1519
+ }) {
1520
+ const [index, setIndex] = (0, import_react3.useState)(initialEvent);
1521
+ const event = MAPPING_EVENTS[index];
1522
+ const name = `${event.entity} ${event.action}`;
1523
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(VizFrame, { ...rest, variant: "mapping", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "elb-viz-mapping", children: [
1524
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "elb-viz-mapping__pick", children: [
1525
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "elb-viz-mapping__label", children: "Pick an event" }),
1526
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "elb-viz-mapping__chips", children: MAPPING_EVENTS.map((item, position) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
1527
+ "button",
1528
+ {
1529
+ type: "button",
1530
+ "aria-label": `${item.entity} ${item.action}`,
1531
+ "aria-pressed": position === index,
1532
+ className: cx(
1533
+ "elb-viz-mapping__chip",
1534
+ position === index && "elb-viz-mapping__chip--active"
1535
+ ),
1536
+ onClick: () => setIndex(position),
1537
+ children: [
1538
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "elb-viz-mapping__chip-entity", children: item.entity }),
1539
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "elb-viz-mapping__chip-action", children: item.action })
1540
+ ]
1541
+ },
1542
+ `${item.entity} ${item.action}`
1543
+ )) })
1544
+ ] }),
1545
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "elb-viz-mapping__event", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CodeTokens, { tokens: tokenizeCode(formatElb(event), name), active: true }) }),
1546
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "elb-viz-mapping__body", children: [
1547
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "elb-viz-mapping__comment", children: "// same event, four destinations, zero app code touched" }),
1548
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "elb-viz-mapping__cards", children: event.destinations.map((destination) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "elb-viz-mapping__card", children: [
1549
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "elb-viz-mapping__name", children: destination.label }),
1550
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "elb-viz-mapping__row", children: [
1551
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "elb-viz-mapping__tag", children: "mapping" }),
1552
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "elb-viz-mapping__rule", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
1553
+ CodeTokens,
1554
+ {
1555
+ tokens: tokenizeCode(
1556
+ formatRule(
1557
+ event.entity,
1558
+ event.action,
1559
+ destination.rule
1560
+ ),
1561
+ destination.rule.name
1562
+ ),
1563
+ active: true
1564
+ }
1565
+ ) })
1566
+ ] }),
1567
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "elb-viz-mapping__row elb-viz-mapping__row--sends", children: [
1568
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "elb-viz-mapping__tag", children: "sends" }),
1569
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "elb-viz-mapping__calls", children: destination.calls.flatMap((call) => formatCall(call)).map((line, position) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "elb-viz-mapping__line", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
1570
+ CodeTokens,
1571
+ {
1572
+ tokens: tokenizeCode(line, destination.rule.name),
1573
+ active: true
1574
+ }
1575
+ ) }, position)) })
1576
+ ] })
1577
+ ] }, destination.id)) })
1578
+ ] }),
1579
+ caption !== "" && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "elb-viz-mapping__caption", children: caption })
1580
+ ] }) });
1581
+ }
1582
+
1583
+ // src/design/components/viz/HeroTaggingViz.tsx
1584
+ var import_react6 = require("react");
1585
+
1586
+ // src/design/components/viz/parts/timeline.ts
1587
+ function clamp(x) {
1588
+ return Math.max(0, Math.min(1, x));
1589
+ }
1590
+ function ease(x) {
1591
+ return x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2;
1592
+ }
1593
+
1594
+ // src/design/components/viz/data/hero.ts
1595
+ var HERO_ARTICLES = [
1596
+ { kicker: "Tech", title: "Return of the Bug", thumb: "bug" },
1597
+ { kicker: "Tech", title: "The quiet return of RSS", thumb: "tech" },
1598
+ { kicker: "Food", title: "Why sourdough came back", thumb: "food" }
1599
+ ];
1600
+ var HERO_START = 9e3;
1601
+ var HERO_LOOP = 11500;
1602
+ var CUE = {
1603
+ slideInStart: 0,
1604
+ slideInEnd: 500,
1605
+ entityStart: 900,
1606
+ entityEnd: 1500,
1607
+ impressionStart: 1800,
1608
+ impressionEnd: 2600,
1609
+ categoryStart: 2900,
1610
+ categoryEnd: 3600,
1611
+ titleStart: 3900,
1612
+ titleEnd: 4700,
1613
+ actionStart: 5e3,
1614
+ actionEnd: 5800,
1615
+ impressionEvent: 6200,
1616
+ moveStart: 6900,
1617
+ moveEnd: 7700,
1618
+ click: 7850,
1619
+ openEvent: 8e3,
1620
+ fadeOut: 10600,
1621
+ slideOutStart: 10800,
1622
+ slideOutEnd: 11400
1623
+ };
1624
+ var MAX_ROWS = 24;
1625
+ var PAST = 1e4;
1626
+ var ENTITY = [
1627
+ tok("data-elb", "attr"),
1628
+ tok("=", "punct"),
1629
+ tok('"article"', "str")
1630
+ ];
1631
+ var IMPRESSION = [
1632
+ tok("data-elbaction", "attr"),
1633
+ tok("=", "punct"),
1634
+ tok('"impression"', "str")
1635
+ ];
1636
+ var CATEGORY = [
1637
+ tok(" ", "punct"),
1638
+ tok("data-elb-article", "attr"),
1639
+ tok("=", "punct"),
1640
+ tok('"category:#innerText"', "str")
1641
+ ];
1642
+ var TITLE = [
1643
+ tok(" ", "punct"),
1644
+ tok("data-elb-article", "attr"),
1645
+ tok("=", "punct"),
1646
+ tok('"title:#innerText"', "str")
1647
+ ];
1648
+ var ACTION = [
1649
+ tok(" ", "punct"),
1650
+ tok("data-elbaction", "attr"),
1651
+ tok("=", "punct"),
1652
+ tok('"click:open"', "str")
1653
+ ];
1654
+ var TYPING = [
1655
+ [CUE.entityStart, CUE.entityEnd],
1656
+ [CUE.impressionStart, CUE.impressionEnd],
1657
+ [CUE.categoryStart, CUE.categoryEnd],
1658
+ [CUE.titleStart, CUE.titleEnd],
1659
+ [CUE.actionStart, CUE.actionEnd]
1660
+ ];
1661
+ function articleAt(loop) {
1662
+ return HERO_ARTICLES[loop % HERO_ARTICLES.length];
1663
+ }
1664
+ function caretSlot(ph) {
1665
+ if (ph >= CUE.entityStart - 400 && ph < CUE.impressionStart - 300)
1666
+ return "entity";
1667
+ if (ph >= CUE.impressionStart - 300 && ph < CUE.categoryStart - 100)
1668
+ return "impression";
1669
+ if (ph >= CUE.categoryStart - 100 && ph < CUE.titleStart - 100)
1670
+ return "category";
1671
+ if (ph >= CUE.titleStart - 100 && ph < CUE.actionStart - 100) return "title";
1672
+ if (ph >= CUE.actionStart - 100 && ph < CUE.moveStart) return "action";
1673
+ return null;
1674
+ }
1675
+ function typed(tokens, start, end, ph) {
1676
+ return truncate(
1677
+ tokens,
1678
+ Math.round(clamp((ph - start) / (end - start)) * typedLength(tokens))
1679
+ );
1680
+ }
1681
+ function heroLines(article, ph) {
1682
+ const slot = caretSlot(ph);
1683
+ const indent = tok(" ", "punct");
1684
+ const entity = typed(ENTITY, CUE.entityStart, CUE.entityEnd, ph);
1685
+ const impression = typed(
1686
+ IMPRESSION,
1687
+ CUE.impressionStart,
1688
+ CUE.impressionEnd,
1689
+ ph
1690
+ );
1691
+ const category = typed(CATEGORY, CUE.categoryStart, CUE.categoryEnd, ph);
1692
+ const title = typed(TITLE, CUE.titleStart, CUE.titleEnd, ph);
1693
+ const action = typed(ACTION, CUE.actionStart, CUE.actionEnd, ph);
1694
+ const lines = [
1695
+ {
1696
+ id: "open",
1697
+ tokens: [
1698
+ tok("<article", "tag"),
1699
+ tok(" ", "punct"),
1700
+ tok("class", "attr"),
1701
+ tok("=", "punct"),
1702
+ tok('"teaser"', "str")
1703
+ ],
1704
+ on: false,
1705
+ caret: null
1706
+ },
1707
+ ph >= CUE.entityStart - 400 ? {
1708
+ id: "entity",
1709
+ tokens: [indent, ...entity],
1710
+ on: true,
1711
+ caret: slot === "entity" ? 1 + entity.length : null
1712
+ } : null,
1713
+ ph >= CUE.impressionStart - 300 ? {
1714
+ id: "impression",
1715
+ tokens: [indent, ...impression],
1716
+ on: true,
1717
+ caret: slot === "impression" ? 1 + impression.length : null
1718
+ } : null,
1719
+ { id: "close", tokens: [tok(">", "tag")], on: false, caret: null },
1720
+ {
1721
+ id: "image",
1722
+ tokens: [
1723
+ indent,
1724
+ tok("<img", "tag"),
1725
+ tok(" ", "punct"),
1726
+ tok("src", "attr"),
1727
+ tok("=", "punct"),
1728
+ tok(`"/img/${article.thumb}.jpg"`, "str"),
1729
+ tok(" ", "punct"),
1730
+ tok("alt", "attr"),
1731
+ tok("=", "punct"),
1732
+ tok('""', "str"),
1733
+ tok(" />", "tag")
1734
+ ],
1735
+ on: false,
1736
+ caret: null
1737
+ },
1738
+ {
1739
+ id: "category",
1740
+ tokens: [
1741
+ indent,
1742
+ tok("<span", "tag"),
1743
+ tok(" ", "punct"),
1744
+ tok("class", "attr"),
1745
+ tok("=", "punct"),
1746
+ tok('"kicker"', "str"),
1747
+ ...category,
1748
+ tok(">", "tag"),
1749
+ tok(article.kicker, "text"),
1750
+ tok("</span>", "tag")
1751
+ ],
1752
+ on: ph >= CUE.categoryStart - 100,
1753
+ caret: slot === "category" ? 6 + category.length : null
1754
+ },
1755
+ {
1756
+ id: "title",
1757
+ tokens: [
1758
+ indent,
1759
+ tok("<h3", "tag"),
1760
+ ...title,
1761
+ tok(">", "tag"),
1762
+ tok(article.title, "text"),
1763
+ tok("</h3>", "tag")
1764
+ ],
1765
+ on: ph >= CUE.titleStart - 100,
1766
+ caret: slot === "title" ? 2 + title.length : null
1767
+ },
1768
+ {
1769
+ id: "action",
1770
+ tokens: [
1771
+ indent,
1772
+ tok("<a", "tag"),
1773
+ ...action,
1774
+ tok(">", "tag"),
1775
+ tok("Open \u2192", "text"),
1776
+ tok("</a>", "tag")
1777
+ ],
1778
+ on: ph >= CUE.actionStart - 100,
1779
+ caret: slot === "action" ? 2 + action.length : null
1780
+ },
1781
+ { id: "end", tokens: [tok("</article>", "tag")], on: false, caret: null }
1782
+ ];
1783
+ return lines.filter((line) => line !== null).map((line, index) => ({ ...line, n: index + 1 }));
1784
+ }
1785
+ function heroEvents(article) {
1786
+ const data = { category: article.kicker, title: article.title };
1787
+ return [
1788
+ { name: "article impression", data },
1789
+ { name: "article open", data }
1790
+ ];
1791
+ }
1792
+ function heroRows(loop, ph) {
1793
+ const rows = [];
1794
+ for (let j = loop; j >= 0 && rows.length < MAX_ROWS; j--) {
1795
+ const [impression, open] = heroEvents(articleAt(j));
1796
+ const current = j === loop;
1797
+ if (!current || ph >= CUE.openEvent)
1798
+ rows.push({
1799
+ ...open,
1800
+ key: `${j}-open`,
1801
+ age: current ? ph - CUE.openEvent : PAST
1802
+ });
1803
+ if (!current || ph >= CUE.impressionEvent)
1804
+ rows.push({
1805
+ ...impression,
1806
+ key: `${j}-impression`,
1807
+ age: current ? ph - CUE.impressionEvent : PAST
1808
+ });
1809
+ }
1810
+ return rows.slice(0, MAX_ROWS);
1811
+ }
1812
+ function heroFrame(t) {
1813
+ const loop = Math.floor(t / HERO_LOOP);
1814
+ const ph = t - loop * HERO_LOOP;
1815
+ const article = articleAt(loop);
1816
+ const slideIn = ease(
1817
+ clamp((ph - CUE.slideInStart) / (CUE.slideInEnd - CUE.slideInStart))
1818
+ );
1819
+ const slideOut = ease(
1820
+ clamp((ph - CUE.slideOutStart) / (CUE.slideOutEnd - CUE.slideOutStart))
1821
+ );
1822
+ const move = ease(
1823
+ clamp((ph - CUE.moveStart) / (CUE.moveEnd - CUE.moveStart))
1824
+ );
1825
+ const ripple = clamp((ph - CUE.click) / 550);
1826
+ const cursorShown = ph >= CUE.moveStart - 200 && ph < CUE.fadeOut + 200;
1827
+ const fadingOut = ph > CUE.fadeOut ? 1 - clamp((ph - CUE.fadeOut) / 200) : 1;
1828
+ return {
1829
+ article,
1830
+ lines: heroLines(article, ph),
1831
+ fade: ph < 250 ? ph / 250 : ph > CUE.fadeOut ? 1 - clamp((ph - CUE.fadeOut) / (HERO_LOOP - CUE.fadeOut - 150)) : 1,
1832
+ caretOn: TYPING.some(([start, end]) => ph >= start && ph <= end) || ph % 900 < 500,
1833
+ card: {
1834
+ opacity: clamp(ph / 250) * (1 - slideOut),
1835
+ offset: ph >= CUE.slideOutStart ? -slideOut * 190 : (1 - slideIn) * 190,
1836
+ entity: ph >= CUE.entityEnd,
1837
+ impression: ph >= CUE.impressionEnd,
1838
+ category: ph >= CUE.categoryEnd,
1839
+ title: ph >= CUE.titleEnd,
1840
+ action: ph >= CUE.actionEnd
1841
+ },
1842
+ cursor: {
1843
+ x: 22 + (1 - move) * 190,
1844
+ y: 11 - (1 - move) * 80,
1845
+ opacity: cursorShown ? clamp((ph - (CUE.moveStart - 200)) / 200) * fadingOut : 0,
1846
+ ring: 1 + ripple * 1.8,
1847
+ ringOpacity: ph >= CUE.click ? (1 - ripple) * 0.9 : 0,
1848
+ pressed: ph >= CUE.click && ph < CUE.click + 180
1849
+ },
1850
+ rows: heroRows(loop, ph)
1851
+ };
1852
+ }
1853
+
1854
+ // src/design/components/viz/parts/EventsTable.tsx
1855
+ var import_react4 = require("react");
1856
+
1857
+ // src/design/components/viz/parts/style.ts
1858
+ function vizStyle(vars) {
1859
+ const style = {};
1860
+ return Object.assign(style, vars);
1861
+ }
1862
+
1863
+ // src/design/components/viz/parts/EventsTable.tsx
1864
+ var import_jsx_runtime30 = require("react/jsx-runtime");
1865
+ var SKELETON_ROWS = 6;
1866
+ function EventsTable({ rows }) {
1867
+ const skeletons = Math.max(0, SKELETON_ROWS - rows.length);
1868
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "elb-viz-table", children: [
1869
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "elb-viz-table__head", children: [
1870
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "elb-viz-table__query", children: [
1871
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "elb-viz-table__keyword", children: "SELECT" }),
1872
+ " *",
1873
+ " ",
1874
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "elb-viz-table__keyword", children: "FROM" }),
1875
+ " ",
1876
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "elb-viz-table__source", children: "walkerOS.events" })
1877
+ ] }),
1878
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "elb-viz-table__live", children: [
1879
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "elb-viz-table__dot", "aria-hidden": "true" }),
1880
+ "live"
1881
+ ] })
1882
+ ] }),
1883
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "elb-viz-table__body", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "elb-viz-table__scroll", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "elb-viz-table__rows", children: [
1884
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "elb-viz-table__row elb-viz-table__row--header", children: [
1885
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "elb-viz-table__cell elb-viz-table__cell--n", children: "Row" }),
1886
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "elb-viz-table__cell", children: [
1887
+ "name",
1888
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "elb-viz-table__type", children: "STRING" })
1889
+ ] }),
1890
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "elb-viz-table__cell", children: [
1891
+ "data",
1892
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "elb-viz-table__type", children: "JSON" })
1893
+ ] })
1894
+ ] }),
1895
+ rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
1896
+ "div",
1897
+ {
1898
+ className: "elb-viz-table__row elb-viz-table__row--event",
1899
+ style: vizStyle({
1900
+ "--elb-viz-row-tint": 14 * (1 - clamp(row.age / 1600)),
1901
+ "--elb-viz-row-opacity": clamp(row.age / 300),
1902
+ "--elb-viz-row-shift": (1 - ease(clamp(row.age / 500))) * -80
1903
+ }),
1904
+ children: [
1905
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "elb-viz-table__cell elb-viz-table__cell--n", children: index + 1 }),
1906
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "elb-viz-table__cell", children: row.name }),
1907
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "elb-viz-table__cell elb-viz-table__json", children: [
1908
+ "{",
1909
+ Object.entries(row.data).map(([key, value], position) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react4.Fragment, { children: [
1910
+ position === 0 ? '"' : ',"',
1911
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "elb-viz-table__json-key", children: key }),
1912
+ '":"',
1913
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "elb-viz-table__json-value", children: value }),
1914
+ '"'
1915
+ ] }, key)),
1916
+ "}"
1917
+ ] })
1918
+ ]
1919
+ },
1920
+ row.key
1921
+ )),
1922
+ Array.from({ length: skeletons }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
1923
+ "div",
1924
+ {
1925
+ className: "elb-viz-table__row elb-viz-table__row--skeleton",
1926
+ "aria-hidden": "true",
1927
+ children: [
1928
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "elb-viz-table__cell elb-viz-table__cell--n", children: rows.length + index + 1 }),
1929
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "elb-viz-table__cell", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "elb-viz-table__bar" }) }),
1930
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "elb-viz-table__cell", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "elb-viz-table__bar" }) })
1931
+ ]
1932
+ },
1933
+ `skeleton-${index}`
1934
+ ))
1935
+ ] }) }) })
1936
+ ] });
1937
+ }
1938
+
1939
+ // src/design/components/viz/parts/hooks.ts
1940
+ var import_react5 = require("react");
1941
+ var REDUCED_MOTION = "(prefers-reduced-motion: reduce)";
1942
+ function useInView(ref, threshold) {
1943
+ const [inView, setInView] = (0, import_react5.useState)(false);
1944
+ (0, import_react5.useEffect)(() => {
1945
+ const element = ref.current;
1946
+ if (!element || typeof IntersectionObserver === "undefined") {
1947
+ setInView(true);
1948
+ return void 0;
1949
+ }
1950
+ const observer = new IntersectionObserver(
1951
+ (entries) => {
1952
+ const entry = entries[entries.length - 1];
1953
+ if (entry)
1954
+ setInView(
1955
+ entry.isIntersecting && entry.intersectionRatio >= threshold
1956
+ );
1957
+ },
1958
+ { threshold }
1959
+ );
1960
+ observer.observe(element);
1961
+ return () => observer.disconnect();
1962
+ }, [ref, threshold]);
1963
+ return inView;
1964
+ }
1965
+ function useReducedMotion() {
1966
+ const [reduced, setReduced] = (0, import_react5.useState)(false);
1967
+ (0, import_react5.useEffect)(() => {
1968
+ if (typeof window.matchMedia !== "function") return void 0;
1969
+ const media = window.matchMedia(REDUCED_MOTION);
1970
+ const update = () => setReduced(media.matches);
1971
+ update();
1972
+ media.addEventListener("change", update);
1973
+ return () => media.removeEventListener("change", update);
1974
+ }, []);
1975
+ return reduced;
1976
+ }
1977
+
1978
+ // src/design/components/viz/parts/Pill.tsx
1979
+ var import_jsx_runtime31 = require("react/jsx-runtime");
1980
+ function Pill({
1981
+ part,
1982
+ variant = "solid",
1983
+ className,
1984
+ children
1985
+ }) {
1986
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
1987
+ "span",
1988
+ {
1989
+ className: cx(
1990
+ "elb-viz-pill",
1991
+ `elb-viz-pill--${part}`,
1992
+ variant === "outline" && "elb-viz-pill--outline",
1993
+ className
1994
+ ),
1995
+ children
1996
+ }
1997
+ );
1998
+ }
1999
+
2000
+ // src/design/components/viz/parts/Thumb.tsx
2001
+ var import_jsx_runtime32 = require("react/jsx-runtime");
2002
+ var BUG_LINES = [
2003
+ "M36 46 L28 42",
2004
+ "M35 54 L27 56",
2005
+ "M38 61 L31 66",
2006
+ "M76 46 L84 42",
2007
+ "M77 54 L85 56",
2008
+ "M74 61 L81 66",
2009
+ "M51 25 Q47 17 42 16",
2010
+ "M61 25 Q65 17 70 16"
2011
+ ];
2012
+ var BUG_SPOTS = [
2013
+ [47, 44, 3.4],
2014
+ [65, 44, 3.4],
2015
+ [45, 56, 2.8],
2016
+ [67, 56, 2.8]
2017
+ ];
2018
+ function Bug() {
2019
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
2020
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("rect", { className: "elb-viz-thumb__ground", width: 112, height: 86 }),
2021
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2022
+ "ellipse",
2023
+ {
2024
+ className: "elb-viz-thumb__shadow",
2025
+ cx: 56,
2026
+ cy: 66,
2027
+ rx: 30,
2028
+ ry: 6
2029
+ }
2030
+ ),
2031
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2032
+ "g",
2033
+ {
2034
+ className: "elb-viz-thumb__legs",
2035
+ strokeWidth: 2.4,
2036
+ strokeLinecap: "round",
2037
+ children: BUG_LINES.map((d) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("path", { d }, d))
2038
+ }
2039
+ ),
2040
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("circle", { className: "elb-viz-thumb__ink", cx: 42, cy: 16, r: 2 }),
2041
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("circle", { className: "elb-viz-thumb__ink", cx: 70, cy: 16, r: 2 }),
2042
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2043
+ "ellipse",
2044
+ {
2045
+ className: "elb-viz-thumb__ink",
2046
+ cx: 56,
2047
+ cy: 30,
2048
+ rx: 10,
2049
+ ry: 7.5
2050
+ }
2051
+ ),
2052
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("circle", { className: "elb-viz-thumb__eye", cx: 52, cy: 29, r: 1.6 }),
2053
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("circle", { className: "elb-viz-thumb__eye", cx: 60, cy: 29, r: 1.6 }),
2054
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2055
+ "ellipse",
2056
+ {
2057
+ className: "elb-viz-thumb__shell",
2058
+ cx: 56,
2059
+ cy: 50,
2060
+ rx: 21,
2061
+ ry: 18
2062
+ }
2063
+ ),
2064
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("path", { className: "elb-viz-thumb__seam", d: "M56 33 L56 68", strokeWidth: 2 }),
2065
+ BUG_SPOTS.map(([x, y, r]) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2066
+ "circle",
2067
+ {
2068
+ className: "elb-viz-thumb__ink",
2069
+ cx: x,
2070
+ cy: y,
2071
+ r
2072
+ },
2073
+ `${x}-${y}`
2074
+ )),
2075
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2076
+ "path",
2077
+ {
2078
+ className: "elb-viz-thumb__shine",
2079
+ d: "M44 38 Q48 35 52 36",
2080
+ strokeWidth: 2,
2081
+ strokeLinecap: "round"
2082
+ }
2083
+ )
2084
+ ] });
2085
+ }
2086
+ function Tech() {
2087
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
2088
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("rect", { className: "elb-viz-thumb__ground", width: 112, height: 86 }),
2089
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2090
+ "rect",
2091
+ {
2092
+ className: "elb-viz-thumb__badge",
2093
+ x: 38,
2094
+ y: 25,
2095
+ width: 36,
2096
+ height: 36,
2097
+ rx: 8
2098
+ }
2099
+ ),
2100
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("circle", { className: "elb-viz-thumb__dot", cx: 47, cy: 52, r: 3.2 }),
2101
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2102
+ "path",
2103
+ {
2104
+ className: "elb-viz-thumb__wave",
2105
+ d: "M45 42 A10 10 0 0 1 57 54",
2106
+ strokeWidth: 3.5,
2107
+ strokeLinecap: "round"
2108
+ }
2109
+ ),
2110
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2111
+ "path",
2112
+ {
2113
+ className: "elb-viz-thumb__wave",
2114
+ d: "M45 34.5 A17.5 17.5 0 0 1 64.5 54",
2115
+ strokeWidth: 3.5,
2116
+ strokeLinecap: "round"
2117
+ }
2118
+ )
2119
+ ] });
2120
+ }
2121
+ function Food() {
2122
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
2123
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("rect", { className: "elb-viz-thumb__ground", width: 112, height: 86 }),
2124
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2125
+ "ellipse",
2126
+ {
2127
+ className: "elb-viz-thumb__plate",
2128
+ cx: 56,
2129
+ cy: 62,
2130
+ rx: 44,
2131
+ ry: 10
2132
+ }
2133
+ ),
2134
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2135
+ "ellipse",
2136
+ {
2137
+ className: "elb-viz-thumb__loaf",
2138
+ cx: 56,
2139
+ cy: 50,
2140
+ rx: 31,
2141
+ ry: 19
2142
+ }
2143
+ ),
2144
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2145
+ "ellipse",
2146
+ {
2147
+ className: "elb-viz-thumb__crust",
2148
+ cx: 56,
2149
+ cy: 45,
2150
+ rx: 25,
2151
+ ry: 13
2152
+ }
2153
+ ),
2154
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2155
+ "path",
2156
+ {
2157
+ className: "elb-viz-thumb__score",
2158
+ d: "M40 44 Q56 35 72 44",
2159
+ strokeWidth: 2.2,
2160
+ strokeLinecap: "round"
2161
+ }
2162
+ ),
2163
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2164
+ "path",
2165
+ {
2166
+ className: "elb-viz-thumb__score",
2167
+ d: "M44 51 Q56 45 68 51",
2168
+ strokeWidth: 2.2,
2169
+ strokeLinecap: "round"
2170
+ }
2171
+ )
2172
+ ] });
2173
+ }
2174
+ function Thumb({ kind }) {
2175
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2176
+ "svg",
2177
+ {
2178
+ className: cx("elb-viz-thumb", `elb-viz-thumb--${kind}`),
2179
+ viewBox: "0 0 112 86",
2180
+ preserveAspectRatio: "xMidYMid slice",
2181
+ "aria-hidden": "true",
2182
+ focusable: "false",
2183
+ children: kind === "bug" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Bug, {}) : kind === "tech" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Tech, {}) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Food, {})
2184
+ }
2185
+ );
2186
+ }
2187
+
2188
+ // src/design/components/viz/HeroTaggingViz.tsx
2189
+ var import_jsx_runtime33 = require("react/jsx-runtime");
2190
+ var MAX_STEP = 64;
2191
+ function HeroTaggingViz({
2192
+ playing = true,
2193
+ speed = 1,
2194
+ startAt = HERO_START,
2195
+ ...rest
2196
+ }) {
2197
+ const paneRef = (0, import_react6.useRef)(null);
2198
+ const inView = useInView(paneRef, 0);
2199
+ const reduced = useReducedMotion();
2200
+ const [time, setTime] = (0, import_react6.useState)(startAt);
2201
+ const animate = playing && inView && !reduced;
2202
+ (0, import_react6.useEffect)(() => {
2203
+ if (!animate) return void 0;
2204
+ let frame = 0;
2205
+ let last = performance.now();
2206
+ const step = (now) => {
2207
+ const elapsed = Math.min(MAX_STEP, now - last);
2208
+ last = now;
2209
+ setTime((value) => value + elapsed * speed);
2210
+ frame = requestAnimationFrame(step);
2211
+ };
2212
+ frame = requestAnimationFrame(step);
2213
+ return () => cancelAnimationFrame(frame);
2214
+ }, [animate, speed]);
2215
+ const { article, lines, fade: fade2, caretOn, card, cursor, rows } = heroFrame(time);
2216
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(VizFrame, { ...rest, variant: "hero", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "elb-viz-hero", children: [
2217
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { ref: paneRef, className: "elb-viz-hero__pane", children: [
2218
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "elb-viz-hero__bar", children: [
2219
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "elb-viz-hero__dots", "aria-hidden": "true", children: [
2220
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", {}),
2221
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", {}),
2222
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", {})
2223
+ ] }),
2224
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "elb-viz-hero__file", children: "ArticleTeaser.html" })
2225
+ ] }),
2226
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2227
+ "div",
2228
+ {
2229
+ className: "elb-viz-hero__code",
2230
+ style: vizStyle({ "--elb-viz-fade": fade2 }),
2231
+ children: lines.map((line) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2232
+ CodeLine,
2233
+ {
2234
+ number: line.n,
2235
+ bar: line.on ? "entity" : void 0,
2236
+ className: cx(
2237
+ "elb-viz-hero__line",
2238
+ line.on && "elb-viz-hero__line--on"
2239
+ ),
2240
+ children: line.caret === null ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CodeTokens, { tokens: line.tokens }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
2241
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CodeTokens, { tokens: line.tokens.slice(0, line.caret) }),
2242
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2243
+ "span",
2244
+ {
2245
+ className: "elb-viz-caret",
2246
+ style: vizStyle({ "--elb-viz-caret": caretOn ? 1 : 0 })
2247
+ }
2248
+ ),
2249
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CodeTokens, { tokens: line.tokens.slice(line.caret) })
2250
+ ] })
2251
+ },
2252
+ line.id
2253
+ ))
2254
+ }
2255
+ ),
2256
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "elb-viz-hero__stage", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
2257
+ "div",
2258
+ {
2259
+ className: cx(
2260
+ "elb-viz-hero__card",
2261
+ card.entity && "elb-viz-hero__card--tagged"
2262
+ ),
2263
+ style: vizStyle({
2264
+ "--elb-viz-card-opacity": card.opacity,
2265
+ "--elb-viz-card-offset": card.offset
2266
+ }),
2267
+ children: [
2268
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "elb-viz-hero__pills", children: [
2269
+ card.entity && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Pill, { part: "entity", children: "article" }),
2270
+ card.impression && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Pill, { part: "action", children: "impression" })
2271
+ ] }),
2272
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "elb-viz-hero__thumb", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Thumb, { kind: article.thumb }) }),
2273
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "elb-viz-hero__text", children: [
2274
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2275
+ "span",
2276
+ {
2277
+ className: cx(
2278
+ "elb-viz-hero__kicker",
2279
+ card.category && "elb-viz-hero__kicker--on"
2280
+ ),
2281
+ children: article.kicker
2282
+ }
2283
+ ),
2284
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "elb-viz-hero__title", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2285
+ "span",
2286
+ {
2287
+ className: cx(
2288
+ "elb-viz-hero__mark",
2289
+ card.title && "elb-viz-hero__mark--on"
2290
+ ),
2291
+ children: article.title
2292
+ }
2293
+ ) }),
2294
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "elb-viz-hero__foot", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
2295
+ "span",
2296
+ {
2297
+ className: cx(
2298
+ "elb-viz-hero__link",
2299
+ card.action && "elb-viz-hero__link--on"
2300
+ ),
2301
+ children: [
2302
+ "Open \u2192",
2303
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
2304
+ "span",
2305
+ {
2306
+ className: "elb-viz-hero__cursor",
2307
+ "aria-hidden": "true",
2308
+ style: vizStyle({
2309
+ "--elb-viz-cursor-x": cursor.x,
2310
+ "--elb-viz-cursor-y": cursor.y,
2311
+ "--elb-viz-cursor-opacity": cursor.opacity,
2312
+ "--elb-viz-ring-scale": cursor.ring,
2313
+ "--elb-viz-ring-opacity": cursor.ringOpacity,
2314
+ "--elb-viz-press": cursor.pressed ? 0.8 : 1
2315
+ }),
2316
+ children: [
2317
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "elb-viz-hero__ring" }),
2318
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "elb-viz-hero__pointer" })
2319
+ ]
2320
+ }
2321
+ )
2322
+ ]
2323
+ }
2324
+ ) })
2325
+ ] })
2326
+ ]
2327
+ }
2328
+ ) })
2329
+ ] }),
2330
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(EventsTable, { rows })
2331
+ ] }) });
2332
+ }
2333
+
2334
+ // src/design/components/viz/ArticleTeaserTracking.tsx
2335
+ var import_react7 = require("react");
2336
+
2337
+ // src/design/components/viz/data/article-teaser.ts
2338
+ var TEASER_ENTITY = "article";
2339
+ var TEASER_ACTION = "click:open";
2340
+ var TEASER_PAGE_IDS = ["home", "article"];
2341
+ var TEASER_PAGES = {
2342
+ home: {
2343
+ template: "HomePage.tsx",
2344
+ organism: "HomeFeed",
2345
+ pagetype: "homepage",
2346
+ list: "homefeed",
2347
+ items: "stories",
2348
+ step: 3,
2349
+ listEffect: "homefeed",
2350
+ globalsEffect: "homepage",
2351
+ header: "<HomeFeed /> \xB7 homepage",
2352
+ articles: [
2353
+ { kicker: "Tech", title: "Return of the Bug" },
2354
+ { kicker: "Tech", title: "The quiet return of RSS" },
2355
+ { kicker: "Food", title: "Why sourdough came back" }
2356
+ ]
2357
+ },
2358
+ article: {
2359
+ template: "ArticlePage.tsx",
2360
+ organism: "RelatedStories",
2361
+ pagetype: "article",
2362
+ list: "related",
2363
+ items: "related",
2364
+ step: 4,
2365
+ listEffect: "related",
2366
+ globalsEffect: "articlepage",
2367
+ header: "<RelatedStories /> \xB7 article page",
2368
+ heading: "Related stories",
2369
+ articles: [
2370
+ { kicker: "Tech", title: "The quiet return of RSS" },
2371
+ { kicker: "Science", title: "A year on the ice shelf" },
2372
+ { kicker: "Culture", title: "Small venues, big nights" }
2373
+ ]
2374
+ }
2375
+ };
2376
+ var TEASER_STEPS = [
2377
+ { step: 1, label: "Atom" },
2378
+ { step: 2, label: "Molecule" },
2379
+ { step: 3, label: TEASER_PAGES.home.organism },
2380
+ { step: 4, label: TEASER_PAGES.article.organism },
2381
+ { step: 5, label: "Pages" }
2382
+ ];
2383
+ var TEASER_CAPTIONS = {
2384
+ 1: `Link carries the ${TEASER_ACTION} action wherever it is rendered.`,
2385
+ 2: `ArticleTeaser makes each card an ${TEASER_ENTITY} entity and reads category and title from its elements.`,
2386
+ 3: `${TEASER_PAGES.home.organism} wraps three teasers and adds list:${TEASER_PAGES.home.list} context to their events.`,
2387
+ 4: `${TEASER_PAGES.article.organism} reuses the same ArticleTeaser and adds list:${TEASER_PAGES.article.list} context.`,
2388
+ 5: "Each page template sets pagetype as a global, which is added to every event on that page."
2389
+ };
2390
+ var file = (step, name, level) => ({
2391
+ kind: "file",
2392
+ step,
2393
+ name,
2394
+ level
2395
+ });
2396
+ var code = (step, tokens, effect, part) => ({ kind: "code", step, tokens, effect, part });
2397
+ var PROPERTY = `data-elb-${TEASER_ENTITY}`;
2398
+ function buildItems() {
2399
+ const items = [
2400
+ file(1, "Link.tsx", "atom"),
2401
+ code(1, [
2402
+ tok("export const", "kw"),
2403
+ tok(" Link ", "text"),
2404
+ tok("= ({ href, children }) => (", "punct")
2405
+ ]),
2406
+ code(
2407
+ 1,
2408
+ [
2409
+ tok(" ", "punct"),
2410
+ tok("<a", "tag"),
2411
+ tok(" ", "punct"),
2412
+ tok("href", "attr"),
2413
+ tok("={href} ", "punct"),
2414
+ tok("data-elbaction", "attr", "action"),
2415
+ tok("=", "punct"),
2416
+ tok(`"${TEASER_ACTION}"`, "str", "action"),
2417
+ tok(">", "tag")
2418
+ ],
2419
+ "action",
2420
+ "action"
2421
+ ),
2422
+ code(1, [tok(" ", "punct"), tok("{children}", "punct")]),
2423
+ code(1, [tok(" ", "punct"), tok("</a>", "tag")]),
2424
+ code(1, [tok(");", "punct")]),
2425
+ file(2, "ArticleTeaser.tsx", "molecule"),
2426
+ code(2, [
2427
+ tok("export const", "kw"),
2428
+ tok(" ArticleTeaser ", "text"),
2429
+ tok("= ({", "punct")
2430
+ ]),
2431
+ code(2, [tok(" title, category, image, url, position,", "punct")]),
2432
+ code(2, [tok("}) => (", "punct")]),
2433
+ code(
2434
+ 2,
2435
+ [
2436
+ tok(" ", "punct"),
2437
+ tok("<article", "tag"),
2438
+ tok(" ", "punct"),
2439
+ tok("data-elb", "attr", "entity"),
2440
+ tok("=", "punct"),
2441
+ tok(`"${TEASER_ENTITY}"`, "str", "entity")
2442
+ ],
2443
+ "entity",
2444
+ "entity"
2445
+ ),
2446
+ code(
2447
+ 2,
2448
+ [
2449
+ tok(" ", "punct"),
2450
+ tok(PROPERTY, "attr", "property"),
2451
+ tok("={`", "punct"),
2452
+ tok("position:${position}", "str", "property"),
2453
+ tok("`}", "punct"),
2454
+ tok(">", "tag")
2455
+ ],
2456
+ "position",
2457
+ "property"
2458
+ ),
2459
+ code(
2460
+ 2,
2461
+ [
2462
+ tok(" ", "punct"),
2463
+ tok("<img", "tag"),
2464
+ tok(" ", "punct"),
2465
+ tok("src", "attr"),
2466
+ tok("={image} ", "punct"),
2467
+ tok("/>", "tag")
2468
+ ],
2469
+ "image"
2470
+ ),
2471
+ code(
2472
+ 2,
2473
+ [
2474
+ tok(" ", "punct"),
2475
+ tok("<span", "tag"),
2476
+ tok(" ", "punct"),
2477
+ tok(PROPERTY, "attr", "property"),
2478
+ tok("=", "punct"),
2479
+ tok('"category:#innerText"', "str", "property"),
2480
+ tok(">", "tag"),
2481
+ tok("{category}", "punct"),
2482
+ tok("</span>", "tag")
2483
+ ],
2484
+ "category",
2485
+ "property"
2486
+ ),
2487
+ code(
2488
+ 2,
2489
+ [
2490
+ tok(" ", "punct"),
2491
+ tok("<h3", "tag"),
2492
+ tok(" ", "punct"),
2493
+ tok(PROPERTY, "attr", "property"),
2494
+ tok("=", "punct"),
2495
+ tok('"title:#innerText"', "str", "property"),
2496
+ tok(">", "tag"),
2497
+ tok("{title}", "punct"),
2498
+ tok("</h3>", "tag")
2499
+ ],
2500
+ "title",
2501
+ "property"
2502
+ ),
2503
+ code(2, [
2504
+ tok(" ", "punct"),
2505
+ tok("<Link", "tag"),
2506
+ tok(" ", "punct"),
2507
+ tok("href", "attr"),
2508
+ tok("={url}", "punct"),
2509
+ tok(">", "tag"),
2510
+ tok("Open \u2192", "text"),
2511
+ tok("</Link>", "tag")
2512
+ ]),
2513
+ code(2, [tok(" ", "punct"), tok("</article>", "tag")]),
2514
+ code(2, [tok(");", "punct")])
2515
+ ];
2516
+ for (const id of TEASER_PAGE_IDS) {
2517
+ const page = TEASER_PAGES[id];
2518
+ items.push(
2519
+ file(page.step, `${page.organism}.tsx`, "organism"),
2520
+ code(
2521
+ page.step,
2522
+ [
2523
+ tok("<section", "tag"),
2524
+ tok(" ", "punct"),
2525
+ tok("data-elbcontext", "attr", "context"),
2526
+ tok("=", "punct"),
2527
+ tok(`"list:${page.list}"`, "str", "context"),
2528
+ tok(">", "tag")
2529
+ ],
2530
+ page.listEffect,
2531
+ "context"
2532
+ ),
2533
+ code(page.step, [
2534
+ tok(` {${page.items}.map((s, i) => `, "punct"),
2535
+ tok("<ArticleTeaser", "tag"),
2536
+ tok(" {...s} ", "punct"),
2537
+ tok("position", "attr"),
2538
+ tok("={i + 1} ", "punct"),
2539
+ tok("/>", "tag"),
2540
+ tok(")}", "punct")
2541
+ ]),
2542
+ code(page.step, [tok("</section>", "tag")])
2543
+ );
2544
+ }
2545
+ for (const id of TEASER_PAGE_IDS) {
2546
+ const page = TEASER_PAGES[id];
2547
+ items.push(
2548
+ file(5, page.template, "template"),
2549
+ code(
2550
+ 5,
2551
+ [
2552
+ tok("<main", "tag"),
2553
+ tok(" ", "punct"),
2554
+ tok("data-elbglobals", "attr", "globals"),
2555
+ tok("=", "punct"),
2556
+ tok(`"pagetype:${page.pagetype}"`, "str", "globals"),
2557
+ tok(">", "tag")
2558
+ ],
2559
+ page.globalsEffect,
2560
+ "globals"
2561
+ ),
2562
+ code(5, [tok(" ", "punct"), tok(`<${page.organism} />`, "tag")]),
2563
+ code(5, [tok("</main>", "tag")])
2564
+ );
2565
+ }
2566
+ return items;
2567
+ }
2568
+ var TEASER_ITEMS = buildItems();
2569
+ function hasEffect(item) {
2570
+ return item.kind === "code" && item.effect !== void 0;
2571
+ }
2572
+ function teaserStepStart(step) {
2573
+ return TEASER_ITEMS.findIndex((item) => item.step === step);
2574
+ }
2575
+ function teaserStepEnd(step) {
2576
+ let end = teaserStepStart(step);
2577
+ while (end < TEASER_ITEMS.length && TEASER_ITEMS[end].step === step) end += 1;
2578
+ return end;
2579
+ }
2580
+ function teaserAdvance(n) {
2581
+ if (n >= TEASER_ITEMS.length) return null;
2582
+ const item = TEASER_ITEMS[n];
2583
+ if (item.kind === "file" && (n === 0 || TEASER_ITEMS[n - 1].step !== item.step))
2584
+ return { next: n + 1, delay: 1300 };
2585
+ let next = n;
2586
+ while (next < TEASER_ITEMS.length && TEASER_ITEMS[next].step === item.step && !hasEffect(TEASER_ITEMS[next]))
2587
+ next += 1;
2588
+ if (next < TEASER_ITEMS.length && TEASER_ITEMS[next].step === item.step)
2589
+ next += 1;
2590
+ if (next >= TEASER_ITEMS.length) return { next, delay: null };
2591
+ return {
2592
+ next,
2593
+ delay: 1700 + (TEASER_ITEMS[next].step !== item.step ? 1600 : 0)
2594
+ };
2595
+ }
2596
+
2597
+ // src/design/components/viz/ArticleTeaserTracking.tsx
2598
+ var import_jsx_runtime34 = require("react/jsx-runtime");
2599
+ var FIRST_DELAY = 800;
2600
+ var JUMP_DELAY = 250;
2601
+ var SCROLL_DELAY = 400;
2602
+ function fade(on) {
2603
+ return cx("elb-viz-teaser__fade", on && "elb-viz-teaser__fade--on");
2604
+ }
2605
+ function TeaserCard({
2606
+ article,
2607
+ position,
2608
+ seen,
2609
+ ahead
2610
+ }) {
2611
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2612
+ "div",
2613
+ {
2614
+ className: cx(
2615
+ "elb-viz-teaser__card",
2616
+ seen.has("entity") && "elb-viz-teaser__card--entity",
2617
+ ahead && "elb-viz-teaser__card--ahead"
2618
+ ),
2619
+ children: [
2620
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "elb-viz-teaser__pills", children: [
2621
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Pill, { part: "entity", className: fade(seen.has("entity")), children: TEASER_ENTITY }),
2622
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2623
+ Pill,
2624
+ {
2625
+ part: "property",
2626
+ variant: "outline",
2627
+ className: fade(seen.has("position")),
2628
+ children: position
2629
+ }
2630
+ )
2631
+ ] }),
2632
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2633
+ PhotoPlaceholder,
2634
+ {
2635
+ tone: "viz",
2636
+ className: cx("elb-viz-teaser__photo", fade(seen.has("image")))
2637
+ }
2638
+ ),
2639
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2640
+ "span",
2641
+ {
2642
+ className: cx(
2643
+ "elb-viz-teaser__kicker",
2644
+ fade(seen.has("category")),
2645
+ seen.has("category") && "elb-viz-teaser__kicker--on"
2646
+ ),
2647
+ children: article.kicker
2648
+ }
2649
+ ),
2650
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2651
+ "span",
2652
+ {
2653
+ className: cx(
2654
+ "elb-viz-teaser__title",
2655
+ fade(seen.has("title")),
2656
+ seen.has("title") && "elb-viz-teaser__title--on"
2657
+ ),
2658
+ children: article.title
2659
+ }
2660
+ ),
2661
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2662
+ "span",
2663
+ {
2664
+ className: cx(
2665
+ "elb-viz-teaser__link",
2666
+ fade(seen.has("action")),
2667
+ seen.has("action") && "elb-viz-teaser__link--on"
2668
+ ),
2669
+ children: "Open \u2192"
2670
+ }
2671
+ )
2672
+ ]
2673
+ }
2674
+ );
2675
+ }
2676
+ function TeaserGroup({
2677
+ page,
2678
+ seen,
2679
+ current,
2680
+ lead
2681
+ }) {
2682
+ const globalsOn = seen.has(page.globalsEffect);
2683
+ const listOn = seen.has(page.listEffect);
2684
+ const reached = page.step <= current;
2685
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2686
+ "div",
2687
+ {
2688
+ className: cx(
2689
+ "elb-viz-teaser__page",
2690
+ globalsOn && "elb-viz-teaser__page--on",
2691
+ !reached && !lead && "elb-viz-teaser__page--ahead"
2692
+ ),
2693
+ children: [
2694
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "elb-viz-teaser__page-pill", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2695
+ Pill,
2696
+ {
2697
+ part: "globals",
2698
+ className: fade(globalsOn),
2699
+ children: `pagetype:${page.pagetype}`
2700
+ }
2701
+ ) }),
2702
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2703
+ "div",
2704
+ {
2705
+ className: cx(
2706
+ "elb-viz-teaser__list",
2707
+ listOn && "elb-viz-teaser__list--on"
2708
+ ),
2709
+ children: [
2710
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: cx("elb-viz-teaser__list-head", fade(listOn)), children: [
2711
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "elb-viz-teaser__list-label", children: [
2712
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "elb-viz-teaser__list-name", children: page.header }),
2713
+ page.heading !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "elb-viz-teaser__list-heading", children: page.heading })
2714
+ ] }),
2715
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Pill, { part: "context", children: `list:${page.list}` })
2716
+ ] }),
2717
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "elb-viz-teaser__cards", children: page.articles.map((article, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2718
+ TeaserCard,
2719
+ {
2720
+ article,
2721
+ position: index + 1,
2722
+ seen,
2723
+ ahead: !reached && !(lead && index === 0)
2724
+ },
2725
+ article.title
2726
+ )) })
2727
+ ]
2728
+ }
2729
+ )
2730
+ ]
2731
+ }
2732
+ );
2733
+ }
2734
+ function ArticleTeaserTracking({
2735
+ autoplay = true,
2736
+ speed = 1,
2737
+ initialStep,
2738
+ ...rest
2739
+ }) {
2740
+ const codeRef = (0, import_react7.useRef)(null);
2741
+ const inView = useInView(codeRef, 0.35);
2742
+ const reduced = useReducedMotion();
2743
+ const [shown, setShown] = (0, import_react7.useState)(
2744
+ () => initialStep ? teaserStepEnd(initialStep) : 0
2745
+ );
2746
+ const [delay, setDelay] = (0, import_react7.useState)(FIRST_DELAY);
2747
+ const [pinned, setPinned] = (0, import_react7.useState)(null);
2748
+ const playing = autoplay && inView && !reduced;
2749
+ const end = pinned === null ? TEASER_ITEMS.length : teaserStepEnd(pinned);
2750
+ (0, import_react7.useEffect)(() => {
2751
+ if (reduced) setShown(TEASER_ITEMS.length);
2752
+ }, [reduced]);
2753
+ (0, import_react7.useEffect)(() => {
2754
+ if (!playing || delay === null) return void 0;
2755
+ const timer = setTimeout(() => {
2756
+ const advance = teaserAdvance(shown);
2757
+ if (!advance) {
2758
+ setDelay(null);
2759
+ return;
2760
+ }
2761
+ setShown(advance.next);
2762
+ setDelay(advance.next < end ? advance.delay : null);
2763
+ }, delay / speed);
2764
+ return () => clearTimeout(timer);
2765
+ }, [playing, delay, shown, speed, end]);
2766
+ (0, import_react7.useEffect)(() => {
2767
+ const pane = codeRef.current;
2768
+ if (!pane || shown === 0 || typeof pane.scrollTo !== "function")
2769
+ return void 0;
2770
+ const timer = setTimeout(() => {
2771
+ const line = pane.querySelector(`[data-line="${shown - 1}"]`);
2772
+ const top = line instanceof HTMLElement ? line.offsetTop - pane.clientHeight / 2 : 0;
2773
+ pane.scrollTo({
2774
+ top: Math.max(0, top),
2775
+ behavior: reduced ? "auto" : "smooth"
2776
+ });
2777
+ }, SCROLL_DELAY);
2778
+ return () => clearTimeout(timer);
2779
+ }, [shown, reduced]);
2780
+ const jump = (step) => {
2781
+ setPinned(step);
2782
+ if (autoplay && !reduced) {
2783
+ setShown(teaserStepStart(step));
2784
+ setDelay(JUMP_DELAY);
2785
+ } else {
2786
+ setShown(teaserStepEnd(step));
2787
+ }
2788
+ };
2789
+ const count = Math.min(shown, TEASER_ITEMS.length);
2790
+ const visibleStep = count > 0 ? TEASER_ITEMS[count - 1].step : 0;
2791
+ const current = visibleStep === 0 ? 1 : visibleStep;
2792
+ const seen = /* @__PURE__ */ new Set();
2793
+ for (const item of TEASER_ITEMS.slice(0, count))
2794
+ if (item.kind === "code" && item.effect) seen.add(item.effect);
2795
+ let lineNumber = 0;
2796
+ let separated = false;
2797
+ const lines = TEASER_ITEMS.map((item, index) => {
2798
+ const visible = item.step <= visibleStep;
2799
+ const lineClass = cx(
2800
+ "elb-viz-teaser__line",
2801
+ visible && "elb-viz-teaser__line--visible",
2802
+ visible && item.step < current && "elb-viz-teaser__line--dim",
2803
+ item.kind === "file" && "elb-viz-teaser__line--file"
2804
+ );
2805
+ if (item.kind === "file") {
2806
+ lineNumber = 0;
2807
+ const fileClass = cx(
2808
+ "elb-viz-teaser__file",
2809
+ separated && "elb-viz-teaser__file--separated"
2810
+ );
2811
+ separated = true;
2812
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { "data-line": index, className: lineClass, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: fileClass, children: [
2813
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "elb-viz-teaser__file-name", children: item.name }),
2814
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "elb-viz-teaser__file-level", children: item.level })
2815
+ ] }) }, index);
2816
+ }
2817
+ lineNumber += 1;
2818
+ const reached = index < count;
2819
+ const isCurrent = index === count - 1 && item.effect !== void 0;
2820
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { "data-line": index, className: lineClass, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2821
+ CodeLine,
2822
+ {
2823
+ number: lineNumber,
2824
+ bar: reached ? item.part : void 0,
2825
+ className: cx(
2826
+ "elb-viz-teaser__code",
2827
+ isCurrent && `elb-viz-teaser__code--current-${item.part ?? "plain"}`
2828
+ ),
2829
+ children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CodeTokens, { tokens: item.tokens, active: reached })
2830
+ }
2831
+ ) }, index);
2832
+ });
2833
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(VizFrame, { ...rest, variant: "teaser", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "elb-viz-teaser", children: [
2834
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "elb-viz-teaser__header", children: [
2835
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "elb-viz-teaser__steps", children: TEASER_STEPS.map(({ step, label }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2836
+ "button",
2837
+ {
2838
+ type: "button",
2839
+ "aria-label": `Step ${step}: ${label}`,
2840
+ "aria-pressed": step === current,
2841
+ className: cx(
2842
+ "elb-viz-teaser__step",
2843
+ step === current && "elb-viz-teaser__step--active",
2844
+ step < current && "elb-viz-teaser__step--done"
2845
+ ),
2846
+ onClick: () => jump(step),
2847
+ children: [
2848
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "elb-viz-teaser__step-number", children: step }),
2849
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: label })
2850
+ ]
2851
+ },
2852
+ step
2853
+ )) }),
2854
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "elb-viz-teaser__legend", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(EventLegend, {}) })
2855
+ ] }),
2856
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "elb-viz-teaser__caption", children: TEASER_CAPTIONS[current] }),
2857
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "elb-viz-teaser__body", children: [
2858
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "elb-viz-teaser__pane", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { ref: codeRef, className: "elb-viz-teaser__scroll", children: lines }) }),
2859
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "elb-viz-teaser__pages", children: TEASER_PAGE_IDS.map((id, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2860
+ TeaserGroup,
2861
+ {
2862
+ page: TEASER_PAGES[id],
2863
+ seen,
2864
+ current,
2865
+ lead: index === 0
2866
+ },
2867
+ id
2868
+ )) })
2869
+ ] })
2870
+ ] }) });
2871
+ }
2872
+ //# sourceMappingURL=index.cjs.map