@elucim/dsl 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.d.ts +109 -46
  2. package/dist/index.js +458 -459
  3. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,8 +1,9 @@
1
- import { easeOutBounce as oe, easeOutElastic as ge, easeOutBack as me, easeInBack as ye, easeInOutExpo as be, easeOutExpo as xe, easeInExpo as de, easeInOutSine as ve, easeOutSine as we, easeInSine as ke, easeInOutQuart as Ie, easeOutQuart as Se, easeInQuart as $e, easeInOutCubic as Oe, easeOutCubic as Ce, easeInCubic as Ae, easeInOutQuad as ze, easeOutQuad as pe, easeInQuad as Ee, linear as Fe, spring as Pe, cubicBezier as Re, Presentation as Te, Scene as Me, Player as Ne, Slide as We, Parallel as De, Stagger as _e, Morph as Ve, Transform as Le, Write as je, Draw as Be, FadeOut as qe, FadeIn as Ue, BarChart as Ge, LaTeX as He, Graph as Ke, Matrix as Qe, Text as j, VectorField as Xe, Vector as Je, FunctionPlot as Ye, Axes as Ze, Image as et, Polygon as tt, Rect as at, Arrow as rt, Line as it, Circle as nt, BezierCurve as st, Group as ct, Sequence as lt } from "@elucim/core";
2
- import { jsx as l, jsxs as P } from "react/jsx-runtime";
3
- import X, { forwardRef as ut, useRef as ht, useImperativeHandle as ft, useSyncExternalStore as ot } from "react";
4
- import { renderToStaticMarkup as gt } from "react-dom/server";
5
- const U = {
1
+ import { easeOutBounce as xe, easeOutElastic as de, easeOutBack as we, easeInBack as ve, easeInOutExpo as ke, easeOutExpo as Ie, easeInExpo as Se, easeInOutSine as $e, easeOutSine as Ce, easeInSine as Oe, easeInOutQuart as Ae, easeOutQuart as pe, easeInQuart as ze, easeInOutCubic as Ee, easeOutCubic as Re, easeInCubic as Te, easeInOutQuad as Fe, easeOutQuad as Pe, easeInQuad as Me, linear as _e, spring as De, cubicBezier as Ne, Presentation as We, resolveColor as u, Scene as Le, Player as Ve, Slide as Be, Parallel as je, Stagger as qe, Morph as Ue, Transform as He, Write as Ge, Draw as Ke, FadeOut as Qe, FadeIn as Xe, BarChart as Je, LaTeX as Ye, Graph as Ze, Matrix as et, Text as U, VectorField as tt, Vector as at, FunctionPlot as rt, Axes as it, Image as nt, Polygon as st, Rect as ct, Arrow as lt, Line as ut, Circle as ht, BezierCurve as ft, Group as gt, Sequence as ot, themeToVars as mt, DARK_THEME_VARS as yt, LIGHT_THEME_VARS as bt } from "@elucim/core";
2
+ import { DARK_THEME as $a, DARK_THEME_VARS as Ca, LIGHT_THEME as Oa, LIGHT_THEME_VARS as Aa, SEMANTIC_TOKENS as pa, TOKEN_NAMES as za, resolveColor as Ea, themeToVars as Ra } from "@elucim/core";
3
+ import { jsx as l, jsxs as E } from "react/jsx-runtime";
4
+ import K, { forwardRef as xt, useRef as dt, useImperativeHandle as wt, useSyncExternalStore as vt } from "react";
5
+ import { renderToStaticMarkup as kt } from "react-dom/server";
6
+ const Q = {
6
7
  sin: Math.sin,
7
8
  cos: Math.cos,
8
9
  tan: Math.tan,
@@ -22,12 +23,12 @@ const U = {
22
23
  max: (...e) => Math.max(...e),
23
24
  sign: Math.sign,
24
25
  pow: Math.pow
25
- }, J = {
26
+ }, ae = {
26
27
  PI: Math.PI,
27
28
  E: Math.E,
28
29
  TAU: Math.PI * 2
29
30
  };
30
- function K(e) {
31
+ function Y(e) {
31
32
  const a = [];
32
33
  let t = 0;
33
34
  for (; t < e.length; ) {
@@ -90,7 +91,7 @@ function K(e) {
90
91
  }
91
92
  return a.push({ type: "EOF", value: "", pos: t }), a;
92
93
  }
93
- class Q {
94
+ class Z {
94
95
  constructor(a) {
95
96
  this.pos = 0, this.tokens = a;
96
97
  }
@@ -168,14 +169,14 @@ class Q {
168
169
  if (this.peek().type !== "RPAREN")
169
170
  for (r.push(this.parseExpression()); this.peek().type === "COMMA"; )
170
171
  this.advance(), r.push(this.parseExpression());
171
- if (this.expect("RPAREN"), !Object.prototype.hasOwnProperty.call(U, t))
172
+ if (this.expect("RPAREN"), !Object.prototype.hasOwnProperty.call(Q, t))
172
173
  throw new A(
173
- `Unknown function '${t}'. Available: ${Object.keys(U).join(", ")}`,
174
+ `Unknown function '${t}'. Available: ${Object.keys(Q).join(", ")}`,
174
175
  a.pos
175
176
  );
176
177
  return { kind: "call", name: t, args: r };
177
178
  }
178
- return Object.prototype.hasOwnProperty.call(J, t) ? { kind: "number", value: J[t] } : { kind: "variable", name: t };
179
+ return Object.prototype.hasOwnProperty.call(ae, t) ? { kind: "number", value: ae[t] } : { kind: "variable", name: t };
179
180
  }
180
181
  if (a.type === "LPAREN") {
181
182
  this.advance();
@@ -196,7 +197,7 @@ class Q {
196
197
  );
197
198
  }
198
199
  }
199
- function E(e, a) {
200
+ function R(e, a) {
200
201
  switch (e.kind) {
201
202
  case "number":
202
203
  return e.value;
@@ -204,10 +205,10 @@ function E(e, a) {
204
205
  if (Object.prototype.hasOwnProperty.call(a, e.name)) return a[e.name];
205
206
  throw new A(`Unknown variable '${e.name}'`, 0);
206
207
  case "unary":
207
- const t = E(e.operand, a);
208
+ const t = R(e.operand, a);
208
209
  return e.op === "-" ? -t : t;
209
210
  case "binary": {
210
- const r = E(e.left, a), i = E(e.right, a);
211
+ const r = R(e.left, a), i = R(e.right, a);
211
212
  switch (e.op) {
212
213
  case "+":
213
214
  return r + i;
@@ -223,11 +224,11 @@ function E(e, a) {
223
224
  break;
224
225
  }
225
226
  case "call": {
226
- const r = U[e.name], i = e.args.map((n) => E(n, a));
227
+ const r = Q[e.name], i = e.args.map((n) => R(n, a));
227
228
  return r(...i);
228
229
  }
229
230
  case "array":
230
- return e.elements.map((r) => E(r, a));
231
+ return e.elements.map((r) => R(r, a));
231
232
  }
232
233
  throw new A("Invalid AST node", 0);
233
234
  }
@@ -236,82 +237,82 @@ class A extends Error {
236
237
  super(a), this.name = "ExpressionError", this.position = t;
237
238
  }
238
239
  }
239
- function mt(e) {
240
- const a = K(e), t = new Q(a).parse();
241
- return (r) => E(t, r);
240
+ function It(e) {
241
+ const a = Y(e), t = new Z(a).parse();
242
+ return (r) => R(t, r);
242
243
  }
243
- function yt(e) {
244
- const a = K(e), t = new Q(a).parse();
244
+ function St(e) {
245
+ const a = Y(e), t = new Z(a).parse();
245
246
  if (t.kind !== "array" || t.elements.length !== 2)
246
247
  throw new A(
247
248
  'Vector expression must be an array of 2 elements, e.g. "[-y, x]"',
248
249
  0
249
250
  );
250
- return (r) => E(t, r);
251
+ return (r) => R(t, r);
251
252
  }
252
- function ae(e) {
253
+ function ce(e) {
253
254
  try {
254
- const a = K(e);
255
- return new Q(a).parse(), null;
255
+ const a = Y(e);
256
+ return new Z(a).parse(), null;
256
257
  } catch (a) {
257
258
  return a instanceof A ? `${a.message} (at position ${a.position})` : String(a);
258
259
  }
259
260
  }
260
- const G = {
261
- linear: Fe,
262
- easeInQuad: Ee,
263
- easeOutQuad: pe,
264
- easeInOutQuad: ze,
265
- easeInCubic: Ae,
266
- easeOutCubic: Ce,
267
- easeInOutCubic: Oe,
268
- easeInQuart: $e,
269
- easeOutQuart: Se,
270
- easeInOutQuart: Ie,
271
- easeInSine: ke,
272
- easeOutSine: we,
273
- easeInOutSine: ve,
274
- easeInExpo: de,
275
- easeOutExpo: xe,
276
- easeInOutExpo: be,
277
- easeInBack: ye,
278
- easeOutBack: me,
279
- easeOutElastic: ge,
280
- easeOutBounce: oe
261
+ const X = {
262
+ linear: _e,
263
+ easeInQuad: Me,
264
+ easeOutQuad: Pe,
265
+ easeInOutQuad: Fe,
266
+ easeInCubic: Te,
267
+ easeOutCubic: Re,
268
+ easeInOutCubic: Ee,
269
+ easeInQuart: ze,
270
+ easeOutQuart: pe,
271
+ easeInOutQuart: Ae,
272
+ easeInSine: Oe,
273
+ easeOutSine: Ce,
274
+ easeInOutSine: $e,
275
+ easeInExpo: Se,
276
+ easeOutExpo: Ie,
277
+ easeInOutExpo: ke,
278
+ easeInBack: ve,
279
+ easeOutBack: we,
280
+ easeOutElastic: de,
281
+ easeOutBounce: xe
281
282
  };
282
- function o(e) {
283
+ function f(e) {
283
284
  if (e !== void 0) {
284
285
  if (typeof e == "string") {
285
- const a = G[e];
286
+ const a = X[e];
286
287
  if (!a) {
287
- const t = Object.keys(G), r = t.find((n) => n.toLowerCase() === e.toLowerCase()), i = r ? ` Did you mean '${r}'?` : "";
288
+ const t = Object.keys(X), r = t.find((n) => n.toLowerCase() === e.toLowerCase()), i = r ? ` Did you mean '${r}'?` : "";
288
289
  throw new Error(`Unknown easing '${e}'.${i} Available: ${t.join(", ")}`);
289
290
  }
290
291
  return a;
291
292
  }
292
293
  if (e.type === "spring")
293
- return Pe({
294
+ return De({
294
295
  stiffness: e.stiffness,
295
296
  damping: e.damping,
296
297
  mass: e.mass
297
298
  });
298
299
  if (e.type === "cubicBezier")
299
- return Re(e.x1, e.y1, e.x2, e.y2);
300
+ return Ne(e.x1, e.y1, e.x2, e.y2);
300
301
  throw new Error(`Unknown easing type: ${e.type}`);
301
302
  }
302
303
  }
303
- const B = Object.keys(G);
304
- function re(e) {
304
+ const H = Object.keys(X);
305
+ function le(e) {
305
306
  const a = [];
306
307
  if (!e || typeof e != "object")
307
308
  return a.push({ path: "", message: "Document must be an object", severity: "error" }), { valid: !1, errors: a };
308
309
  const t = e;
309
- return t.version !== "1.0" && a.push({ path: "version", message: `Expected version "1.0", got "${t.version}"`, severity: "error" }), !t.root || typeof t.root != "object" ? (a.push({ path: "root", message: 'Missing or invalid "root" node', severity: "error" }), { valid: a.filter((r) => r.severity === "error").length === 0, errors: a }) : (bt(t.root, "root", a), {
310
+ return t.version !== "1.0" && a.push({ path: "version", message: `Expected version "1.0", got "${t.version}"`, severity: "error" }), !t.root || typeof t.root != "object" ? (a.push({ path: "root", message: 'Missing or invalid "root" node', severity: "error" }), { valid: a.filter((r) => r.severity === "error").length === 0, errors: a }) : ($t(t.root, "root", a), {
310
311
  valid: a.filter((r) => r.severity === "error").length === 0,
311
312
  errors: a
312
313
  });
313
314
  }
314
- const Y = ["scene", "player", "presentation"], _ = ["card", "slide", "square"], q = [
315
+ const re = ["scene", "player", "presentation"], V = ["card", "slide", "square"], G = [
315
316
  "sequence",
316
317
  "group",
317
318
  "bezierCurve",
@@ -340,196 +341,196 @@ const Y = ["scene", "player", "presentation"], _ = ["card", "slide", "square"],
340
341
  "parallel",
341
342
  "player",
342
343
  "scene"
343
- ], Z = ["none", "fade", "slide-left", "slide-up", "zoom"];
344
- function bt(e, a, t) {
344
+ ], ie = ["none", "fade", "slide-left", "slide-up", "zoom"];
345
+ function $t(e, a, t) {
345
346
  const r = e.type;
346
- if (!Y.includes(r)) {
347
- t.push({ path: `${a}.type`, message: `Root type must be one of: ${Y.join(", ")}. Got "${r}"`, severity: "error" });
347
+ if (!re.includes(r)) {
348
+ t.push({ path: `${a}.type`, message: `Root type must be one of: ${re.join(", ")}. Got "${r}"`, severity: "error" });
348
349
  return;
349
350
  }
350
- r === "scene" || r === "player" ? ie(e, a, r, t) : r === "presentation" && xt(e, a, t);
351
+ r === "scene" || r === "player" ? ue(e, a, r, t) : r === "presentation" && Ct(e, a, t);
351
352
  }
352
- function ie(e, a, t, r) {
353
- Bt(e, "durationInFrames", a, r), b(e, "width", a, r), b(e, "height", a, r), b(e, "fps", a, r), z(e, "background", a, r), e.preset !== void 0 && (typeof e.preset != "string" || !_.includes(e.preset)) && r.push({ path: `${a}.preset`, message: `preset must be one of: ${_.join(", ")}. Got "${e.preset}"`, severity: "error" }), t === "player" && (W(e, "controls", a, r), W(e, "loop", a, r), W(e, "autoPlay", a, r)), p(e, a, r);
353
+ function ue(e, a, t, r) {
354
+ Jt(e, "durationInFrames", a, r), m(e, "width", a, r), m(e, "height", a, r), m(e, "fps", a, r), p(e, "background", a, r), e.preset !== void 0 && (typeof e.preset != "string" || !V.includes(e.preset)) && r.push({ path: `${a}.preset`, message: `preset must be one of: ${V.join(", ")}. Got "${e.preset}"`, severity: "error" }), t === "player" && (W(e, "controls", a, r), W(e, "loop", a, r), W(e, "autoPlay", a, r)), z(e, a, r);
354
355
  }
355
- function xt(e, a, t) {
356
- if (b(e, "width", a, t), b(e, "height", a, t), z(e, "background", a, t), b(e, "transitionDuration", a, t), W(e, "showHud", a, t), W(e, "showNotes", a, t), e.preset !== void 0 && (typeof e.preset != "string" || !_.includes(e.preset)) && t.push({ path: `${a}.preset`, message: `preset must be one of: ${_.join(", ")}. Got "${e.preset}"`, severity: "error" }), e.transition !== void 0 && (Z.includes(e.transition) || t.push({
356
+ function Ct(e, a, t) {
357
+ if (m(e, "width", a, t), m(e, "height", a, t), p(e, "background", a, t), m(e, "transitionDuration", a, t), W(e, "showHud", a, t), W(e, "showNotes", a, t), e.preset !== void 0 && (typeof e.preset != "string" || !V.includes(e.preset)) && t.push({ path: `${a}.preset`, message: `preset must be one of: ${V.join(", ")}. Got "${e.preset}"`, severity: "error" }), e.transition !== void 0 && (ie.includes(e.transition) || t.push({
357
358
  path: `${a}.transition`,
358
- message: `Invalid transition "${e.transition}". Must be one of: ${Z.join(", ")}`,
359
+ message: `Invalid transition "${e.transition}". Must be one of: ${ie.join(", ")}`,
359
360
  severity: "error"
360
361
  })), !Array.isArray(e.slides)) {
361
362
  t.push({ path: `${a}.slides`, message: 'Presentation must have a "slides" array', severity: "error" });
362
363
  return;
363
364
  }
364
365
  e.slides.length === 0 && t.push({ path: `${a}.slides`, message: "Presentation must have at least one slide", severity: "warning" }), e.slides.forEach((r, i) => {
365
- dt(r, `${a}.slides[${i}]`, t);
366
+ Ot(r, `${a}.slides[${i}]`, t);
366
367
  });
367
368
  }
368
- function dt(e, a, t) {
369
+ function Ot(e, a, t) {
369
370
  if (!e || typeof e != "object") {
370
371
  t.push({ path: a, message: "Slide must be an object", severity: "error" });
371
372
  return;
372
373
  }
373
- z(e, "title", a, t), z(e, "notes", a, t), z(e, "background", a, t), e.children !== void 0 && (Array.isArray(e.children) ? e.children.forEach((r, i) => {
374
- ne(r, `${a}.children[${i}]`, t);
374
+ p(e, "title", a, t), p(e, "notes", a, t), p(e, "background", a, t), e.children !== void 0 && (Array.isArray(e.children) ? e.children.forEach((r, i) => {
375
+ he(r, `${a}.children[${i}]`, t);
375
376
  }) : t.push({ path: `${a}.children`, message: "Slide children must be an array", severity: "error" }));
376
377
  }
377
- function p(e, a, t) {
378
+ function z(e, a, t) {
378
379
  if (!Array.isArray(e.children)) {
379
380
  t.push({ path: `${a}.children`, message: 'Expected "children" array', severity: "error" });
380
381
  return;
381
382
  }
382
383
  e.children.forEach((r, i) => {
383
- ne(r, `${a}.children[${i}]`, t);
384
+ he(r, `${a}.children[${i}]`, t);
384
385
  });
385
386
  }
386
- function ne(e, a, t) {
387
+ function he(e, a, t) {
387
388
  if (!e || typeof e != "object") {
388
389
  t.push({ path: a, message: "Element must be an object", severity: "error" });
389
390
  return;
390
391
  }
391
392
  const r = e.type;
392
- if (!r || !q.includes(r)) {
393
- const i = r ? se(r, q) : "";
393
+ if (!r || !G.includes(r)) {
394
+ const i = r ? fe(r, G) : "";
394
395
  t.push({
395
396
  path: `${a}.type`,
396
- message: `Unknown element type "${r}".${i} Valid types: ${q.join(", ")}`,
397
+ message: `Unknown element type "${r}".${i} Valid types: ${G.join(", ")}`,
397
398
  severity: "error"
398
399
  });
399
400
  return;
400
401
  }
401
402
  switch (r) {
402
403
  case "bezierCurve":
403
- vt(e, a, t);
404
+ At(e, a, t);
404
405
  break;
405
406
  case "circle":
406
- wt(e, a, t);
407
+ pt(e, a, t);
407
408
  break;
408
409
  case "line":
409
- kt(e, a, t);
410
+ zt(e, a, t);
410
411
  break;
411
412
  case "arrow":
412
- It(e, a, t);
413
+ Et(e, a, t);
413
414
  break;
414
415
  case "rect":
415
- St(e, a, t);
416
+ Rt(e, a, t);
416
417
  break;
417
418
  case "polygon":
418
- $t(e, a, t);
419
+ Tt(e, a, t);
419
420
  break;
420
421
  case "text":
421
- Ot(e, a, t);
422
+ Ft(e, a, t);
422
423
  break;
423
424
  case "image":
424
- Vt(e, a, t);
425
+ Kt(e, a, t);
425
426
  break;
426
427
  case "axes":
427
- Ct(e, a, t);
428
+ Pt(e, a, t);
428
429
  break;
429
430
  case "functionPlot":
430
- At(e, a, t);
431
+ Mt(e, a, t);
431
432
  break;
432
433
  case "vector":
433
- zt(e, a, t);
434
+ _t(e, a, t);
434
435
  break;
435
436
  case "vectorField":
436
- pt(e, a, t);
437
+ Dt(e, a, t);
437
438
  break;
438
439
  case "matrix":
439
- Et(e, a, t);
440
+ Nt(e, a, t);
440
441
  break;
441
442
  case "graph":
442
- Ft(e, a, t);
443
+ Wt(e, a, t);
443
444
  break;
444
445
  case "latex":
445
- Pt(e, a, t);
446
+ Lt(e, a, t);
446
447
  break;
447
448
  case "barChart":
448
- jt(e, a, t);
449
+ Xt(e, a, t);
449
450
  break;
450
451
  case "sequence":
451
- Rt(e, a, t);
452
+ Vt(e, a, t);
452
453
  break;
453
454
  case "group":
454
- Lt(e, a, t);
455
+ Qt(e, a, t);
455
456
  break;
456
457
  case "parallel":
457
- p(e, a, t);
458
+ z(e, a, t);
458
459
  break;
459
460
  case "fadeIn":
460
461
  case "fadeOut":
461
462
  case "draw":
462
463
  case "write":
463
- Tt(e, a, t);
464
+ Bt(e, a, t);
464
465
  break;
465
466
  case "transform":
466
- Mt(e, a, t);
467
+ jt(e, a, t);
467
468
  break;
468
469
  case "morph":
469
- Nt(e, a, t);
470
+ qt(e, a, t);
470
471
  break;
471
472
  case "stagger":
472
- Wt(e, a, t);
473
+ Ut(e, a, t);
473
474
  break;
474
475
  case "scene":
475
476
  case "player":
476
- ie(e, a, r, t);
477
+ ue(e, a, r, t);
477
478
  break;
478
479
  }
479
480
  }
480
- function vt(e, a, t) {
481
- h(e, "x1", a, t), h(e, "y1", a, t), h(e, "cx1", a, t), h(e, "cy1", a, t), h(e, "x2", a, t), h(e, "y2", a, t), e.cx2 !== void 0 && R(e, "cx2", a, t), e.cy2 !== void 0 && R(e, "cy2", a, t), w(e, a, t);
481
+ function At(e, a, t) {
482
+ h(e, "x1", a, t), h(e, "y1", a, t), h(e, "cx1", a, t), h(e, "cy1", a, t), h(e, "x2", a, t), h(e, "y2", a, t), e.cx2 !== void 0 && P(e, "cx2", a, t), e.cy2 !== void 0 && P(e, "cy2", a, t), v(e, a, t);
482
483
  }
483
- function wt(e, a, t) {
484
- h(e, "cx", a, t), h(e, "cy", a, t), F(e, "r", a, t), w(e, a, t);
484
+ function pt(e, a, t) {
485
+ h(e, "cx", a, t), h(e, "cy", a, t), T(e, "r", a, t), v(e, a, t);
485
486
  }
486
- function kt(e, a, t) {
487
- h(e, "x1", a, t), h(e, "y1", a, t), h(e, "x2", a, t), h(e, "y2", a, t), w(e, a, t);
487
+ function zt(e, a, t) {
488
+ h(e, "x1", a, t), h(e, "y1", a, t), h(e, "x2", a, t), h(e, "y2", a, t), v(e, a, t);
488
489
  }
489
- function It(e, a, t) {
490
- h(e, "x1", a, t), h(e, "y1", a, t), h(e, "x2", a, t), h(e, "y2", a, t), w(e, a, t);
490
+ function Et(e, a, t) {
491
+ h(e, "x1", a, t), h(e, "y1", a, t), h(e, "x2", a, t), h(e, "y2", a, t), v(e, a, t);
491
492
  }
492
- function St(e, a, t) {
493
- h(e, "x", a, t), h(e, "y", a, t), F(e, "width", a, t), F(e, "height", a, t), w(e, a, t);
493
+ function Rt(e, a, t) {
494
+ h(e, "x", a, t), h(e, "y", a, t), T(e, "width", a, t), T(e, "height", a, t), v(e, a, t);
494
495
  }
495
- function $t(e, a, t) {
496
+ function Tt(e, a, t) {
496
497
  Array.isArray(e.points) ? e.points.length < 3 ? t.push({ path: `${a}.points`, message: "Polygon requires at least 3 points", severity: "error" }) : e.points.forEach((r, i) => {
497
498
  (!Array.isArray(r) || r.length !== 2 || typeof r[0] != "number" || typeof r[1] != "number") && t.push({ path: `${a}.points[${i}]`, message: "Each point must be [number, number]", severity: "error" });
498
- }) : t.push({ path: `${a}.points`, message: 'Polygon requires a "points" array', severity: "error" }), w(e, a, t);
499
+ }) : t.push({ path: `${a}.points`, message: 'Polygon requires a "points" array', severity: "error" }), v(e, a, t);
499
500
  }
500
- function Ot(e, a, t) {
501
- h(e, "x", a, t), h(e, "y", a, t), typeof e.content != "string" && t.push({ path: `${a}.content`, message: 'Text requires a "content" string', severity: "error" }), w(e, a, t);
501
+ function Ft(e, a, t) {
502
+ h(e, "x", a, t), h(e, "y", a, t), typeof e.content != "string" && t.push({ path: `${a}.content`, message: 'Text requires a "content" string', severity: "error" }), v(e, a, t);
502
503
  }
503
- function Ct(e, a, t) {
504
- S(e, "domain", a, t), S(e, "range", a, t), S(e, "origin", a, t), V(e, a, t);
504
+ function Pt(e, a, t) {
505
+ I(e, "domain", a, t), I(e, "range", a, t), I(e, "origin", a, t), B(e, a, t);
505
506
  }
506
- function At(e, a, t) {
507
+ function Mt(e, a, t) {
507
508
  if (typeof e.fn != "string")
508
509
  t.push({ path: `${a}.fn`, message: 'FunctionPlot requires a "fn" expression string', severity: "error" });
509
510
  else {
510
- const r = ae(e.fn);
511
+ const r = ce(e.fn);
511
512
  r && t.push({ path: `${a}.fn`, message: `Invalid expression: ${r}`, severity: "error" });
512
513
  }
513
- S(e, "domain", a, t), V(e, a, t);
514
+ I(e, "domain", a, t), B(e, a, t);
514
515
  }
515
- function zt(e, a, t) {
516
- (!Array.isArray(e.to) || e.to.length !== 2) && t.push({ path: `${a}.to`, message: 'Vector requires a "to" array of [number, number]', severity: "error" }), S(e, "from", a, t), V(e, a, t);
516
+ function _t(e, a, t) {
517
+ (!Array.isArray(e.to) || e.to.length !== 2) && t.push({ path: `${a}.to`, message: 'Vector requires a "to" array of [number, number]', severity: "error" }), I(e, "from", a, t), B(e, a, t);
517
518
  }
518
- function pt(e, a, t) {
519
+ function Dt(e, a, t) {
519
520
  if (typeof e.fn != "string")
520
521
  t.push({ path: `${a}.fn`, message: 'VectorField requires a "fn" expression string', severity: "error" });
521
522
  else {
522
- const r = ae(e.fn);
523
+ const r = ce(e.fn);
523
524
  r && t.push({ path: `${a}.fn`, message: `Invalid vector expression: ${r}`, severity: "error" });
524
525
  }
525
- S(e, "domain", a, t), S(e, "range", a, t), V(e, a, t);
526
+ I(e, "domain", a, t), I(e, "range", a, t), B(e, a, t);
526
527
  }
527
- function Et(e, a, t) {
528
+ function Nt(e, a, t) {
528
529
  Array.isArray(e.values) ? e.values.forEach((r, i) => {
529
530
  Array.isArray(r) || t.push({ path: `${a}.values[${i}]`, message: "Each matrix row must be an array", severity: "error" });
530
- }) : t.push({ path: `${a}.values`, message: 'Matrix requires a "values" 2D array', severity: "error" }), w(e, a, t);
531
+ }) : t.push({ path: `${a}.values`, message: 'Matrix requires a "values" 2D array', severity: "error" }), v(e, a, t);
531
532
  }
532
- function Ft(e, a, t) {
533
+ function Wt(e, a, t) {
533
534
  if (!Array.isArray(e.nodes))
534
535
  t.push({ path: `${a}.nodes`, message: 'Graph requires a "nodes" array', severity: "error" });
535
536
  else {
@@ -540,19 +541,19 @@ function Ft(e, a, t) {
540
541
  (typeof i.from != "string" || !r.has(i.from)) && t.push({ path: `${a}.edges[${n}].from`, message: `Edge "from" references unknown node "${i.from}"`, severity: "error" }), (typeof i.to != "string" || !r.has(i.to)) && t.push({ path: `${a}.edges[${n}].to`, message: `Edge "to" references unknown node "${i.to}"`, severity: "error" });
541
542
  });
542
543
  }
543
- w(e, a, t);
544
+ v(e, a, t);
544
545
  }
545
- function Pt(e, a, t) {
546
- typeof e.expression != "string" && t.push({ path: `${a}.expression`, message: 'LaTeX requires an "expression" string', severity: "error" }), h(e, "x", a, t), h(e, "y", a, t), w(e, a, t);
546
+ function Lt(e, a, t) {
547
+ typeof e.expression != "string" && t.push({ path: `${a}.expression`, message: 'LaTeX requires an "expression" string', severity: "error" }), h(e, "x", a, t), h(e, "y", a, t), v(e, a, t);
547
548
  }
548
- function Rt(e, a, t) {
549
- h(e, "from", a, t), qt(e, "durationInFrames", a, t), p(e, a, t);
549
+ function Vt(e, a, t) {
550
+ h(e, "from", a, t), Yt(e, "durationInFrames", a, t), z(e, a, t);
550
551
  }
551
- function Tt(e, a, t) {
552
- b(e, "duration", a, t), T(e, a, t), p(e, a, t);
552
+ function Bt(e, a, t) {
553
+ m(e, "duration", a, t), M(e, a, t), z(e, a, t);
553
554
  }
554
- function Mt(e, a, t) {
555
- if (b(e, "duration", a, t), T(e, a, t), e.translate !== void 0) {
555
+ function jt(e, a, t) {
556
+ if (m(e, "duration", a, t), M(e, a, t), e.translate !== void 0) {
556
557
  const r = e.translate;
557
558
  (!r || typeof r != "object") && t.push({ path: `${a}.translate`, message: "translate must be { from: [x,y], to: [x,y] }", severity: "error" });
558
559
  }
@@ -568,51 +569,51 @@ function Mt(e, a, t) {
568
569
  const r = e.opacity;
569
570
  (!r || typeof r != "object" || typeof r.from != "number" || typeof r.to != "number") && t.push({ path: `${a}.opacity`, message: "opacity must be { from: number, to: number }", severity: "error" });
570
571
  }
571
- p(e, a, t);
572
+ z(e, a, t);
572
573
  }
573
- function Nt(e, a, t) {
574
- b(e, "duration", a, t), T(e, a, t), z(e, "fromColor", a, t), z(e, "toColor", a, t), p(e, a, t);
574
+ function qt(e, a, t) {
575
+ m(e, "duration", a, t), M(e, a, t), p(e, "fromColor", a, t), p(e, "toColor", a, t), z(e, a, t);
575
576
  }
576
- function Wt(e, a, t) {
577
- b(e, "staggerDelay", a, t), T(e, a, t), p(e, a, t);
577
+ function Ut(e, a, t) {
578
+ m(e, "staggerDelay", a, t), M(e, a, t), z(e, a, t);
578
579
  }
579
- function w(e, a, t) {
580
- b(e, "fadeIn", a, t), b(e, "fadeOut", a, t), b(e, "draw", a, t), T(e, a, t), Dt(e, a, t);
580
+ function v(e, a, t) {
581
+ m(e, "fadeIn", a, t), m(e, "fadeOut", a, t), m(e, "draw", a, t), M(e, a, t), Ht(e, a, t);
581
582
  }
582
- function V(e, a, t) {
583
- b(e, "fadeIn", a, t), b(e, "fadeOut", a, t), b(e, "draw", a, t), T(e, a, t), _t(e, a, t);
583
+ function B(e, a, t) {
584
+ m(e, "fadeIn", a, t), m(e, "fadeOut", a, t), m(e, "draw", a, t), M(e, a, t), Gt(e, a, t);
584
585
  }
585
- const ee = ["none", "circle", "ellipse"];
586
- function Dt(e, a, t) {
587
- if (R(e, "rotation", a, t), S(e, "rotationOrigin", a, t), S(e, "translate", a, t), R(e, "zIndex", a, t), e.scale !== void 0) {
586
+ const ne = ["none", "circle", "ellipse"];
587
+ function Ht(e, a, t) {
588
+ if (P(e, "rotation", a, t), I(e, "rotationOrigin", a, t), I(e, "translate", a, t), P(e, "zIndex", a, t), e.scale !== void 0) {
588
589
  const r = e.scale;
589
590
  typeof r == "number" || Array.isArray(r) && r.length === 2 && typeof r[0] == "number" && typeof r[1] == "number" || t.push({ path: `${a}.scale`, message: '"scale" must be a number or [number, number]', severity: "error" });
590
591
  }
591
592
  }
592
- function _t(e, a, t) {
593
- R(e, "rotation", a, t), S(e, "rotationOrigin", a, t), S(e, "translate", a, t), R(e, "zIndex", a, t);
593
+ function Gt(e, a, t) {
594
+ P(e, "rotation", a, t), I(e, "rotationOrigin", a, t), I(e, "translate", a, t), P(e, "zIndex", a, t);
594
595
  }
595
- function Vt(e, a, t) {
596
- typeof e.src != "string" && t.push({ path: `${a}.src`, message: 'Image requires a "src" string', severity: "error" }), h(e, "x", a, t), h(e, "y", a, t), F(e, "width", a, t), F(e, "height", a, t), z(e, "preserveAspectRatio", a, t), e.borderRadius !== void 0 && (typeof e.borderRadius != "number" || e.borderRadius < 0) && t.push({ path: `${a}.borderRadius`, message: '"borderRadius" must be a number >= 0', severity: "error" }), e.clipShape !== void 0 && (ee.includes(e.clipShape) || t.push({
596
+ function Kt(e, a, t) {
597
+ typeof e.src != "string" && t.push({ path: `${a}.src`, message: 'Image requires a "src" string', severity: "error" }), h(e, "x", a, t), h(e, "y", a, t), T(e, "width", a, t), T(e, "height", a, t), p(e, "preserveAspectRatio", a, t), e.borderRadius !== void 0 && (typeof e.borderRadius != "number" || e.borderRadius < 0) && t.push({ path: `${a}.borderRadius`, message: '"borderRadius" must be a number >= 0', severity: "error" }), e.clipShape !== void 0 && (ne.includes(e.clipShape) || t.push({
597
598
  path: `${a}.clipShape`,
598
- message: `Invalid clipShape "${e.clipShape}". Must be one of: ${ee.join(", ")}`,
599
+ message: `Invalid clipShape "${e.clipShape}". Must be one of: ${ne.join(", ")}`,
599
600
  severity: "error"
600
- })), w(e, a, t);
601
+ })), v(e, a, t);
601
602
  }
602
- function Lt(e, a, t) {
603
- p(e, a, t), w(e, a, t);
603
+ function Qt(e, a, t) {
604
+ z(e, a, t), v(e, a, t);
604
605
  }
605
- function jt(e, a, t) {
606
- h(e, "x", a, t), h(e, "y", a, t), F(e, "width", a, t), F(e, "height", a, t), Array.isArray(e.bars) || t.push({ path: `${a}.bars`, message: 'BarChart requires a "bars" array', severity: "error" }), w(e, a, t);
606
+ function Xt(e, a, t) {
607
+ h(e, "x", a, t), h(e, "y", a, t), T(e, "width", a, t), T(e, "height", a, t), Array.isArray(e.bars) || t.push({ path: `${a}.bars`, message: 'BarChart requires a "bars" array', severity: "error" }), v(e, a, t);
607
608
  }
608
- function T(e, a, t) {
609
+ function M(e, a, t) {
609
610
  if (e.easing !== void 0) {
610
611
  if (typeof e.easing == "string") {
611
- if (!B.includes(e.easing)) {
612
- const r = se(e.easing, B);
612
+ if (!H.includes(e.easing)) {
613
+ const r = fe(e.easing, H);
613
614
  t.push({
614
615
  path: `${a}.easing`,
615
- message: `Unknown easing "${e.easing}".${r} Available: ${B.join(", ")}`,
616
+ message: `Unknown easing "${e.easing}".${r} Available: ${H.join(", ")}`,
616
617
  severity: "error"
617
618
  });
618
619
  }
@@ -635,79 +636,57 @@ function T(e, a, t) {
635
636
  function h(e, a, t, r) {
636
637
  typeof e[a] != "number" && r.push({ path: `${t}.${a}`, message: `Required numeric field "${a}" is missing or not a number`, severity: "error" });
637
638
  }
638
- function F(e, a, t, r) {
639
+ function T(e, a, t, r) {
639
640
  (typeof e[a] != "number" || e[a] <= 0) && r.push({ path: `${t}.${a}`, message: `"${a}" must be a positive number`, severity: "error" });
640
641
  }
641
- function Bt(e, a, t, r) {
642
+ function Jt(e, a, t, r) {
642
643
  const i = e[a];
643
644
  (typeof i != "number" || i <= 0 || !Number.isInteger(i)) && r.push({ path: `${t}.${a}`, message: `"${a}" must be a positive integer`, severity: "error" });
644
645
  }
645
- function b(e, a, t, r) {
646
+ function m(e, a, t, r) {
646
647
  e[a] !== void 0 && (typeof e[a] != "number" || e[a] <= 0) && r.push({ path: `${t}.${a}`, message: `"${a}" must be a positive number`, severity: "error" });
647
648
  }
648
- function qt(e, a, t, r) {
649
+ function Yt(e, a, t, r) {
649
650
  const i = e[a];
650
651
  i !== void 0 && (typeof i != "number" || i <= 0 || !Number.isInteger(i)) && r.push({ path: `${t}.${a}`, message: `"${a}" must be a positive integer`, severity: "error" });
651
652
  }
652
- function z(e, a, t, r) {
653
+ function p(e, a, t, r) {
653
654
  e[a] !== void 0 && typeof e[a] != "string" && r.push({ path: `${t}.${a}`, message: `"${a}" must be a string`, severity: "error" });
654
655
  }
655
- function R(e, a, t, r) {
656
+ function P(e, a, t, r) {
656
657
  e[a] !== void 0 && typeof e[a] != "number" && r.push({ path: `${t}.${a}`, message: `"${a}" must be a number`, severity: "error" });
657
658
  }
658
659
  function W(e, a, t, r) {
659
660
  e[a] !== void 0 && typeof e[a] != "boolean" && r.push({ path: `${t}.${a}`, message: `"${a}" must be a boolean`, severity: "error" });
660
661
  }
661
- function S(e, a, t, r) {
662
+ function I(e, a, t, r) {
662
663
  const i = e[a];
663
664
  i !== void 0 && (!Array.isArray(i) || i.length !== 2 || typeof i[0] != "number" || typeof i[1] != "number") && r.push({ path: `${t}.${a}`, message: `"${a}" must be [number, number]`, severity: "error" });
664
665
  }
665
- function se(e, a) {
666
+ function fe(e, a) {
666
667
  const t = e.toLowerCase(), r = a.find((n) => n.toLowerCase() === t);
667
668
  if (r) return ` Did you mean '${r}'?`;
668
669
  const i = a.find((n) => n.toLowerCase().startsWith(t.slice(0, 4)));
669
670
  return i ? ` Did you mean '${i}'?` : "";
670
671
  }
671
- const ce = {
672
- foreground: { cssVar: "--elucim-foreground", fallback: "#c8d6e5" },
673
- background: { cssVar: "--elucim-background", fallback: "#0a0a1e" },
674
- title: { cssVar: "--elucim-title", fallback: "#e0e7ff" },
675
- subtitle: { cssVar: "--elucim-subtitle", fallback: "#94a3b8" },
676
- accent: { cssVar: "--elucim-accent", fallback: "#4fc3f7" },
677
- muted: { cssVar: "--elucim-muted", fallback: "#64748b" },
678
- surface: { cssVar: "--elucim-surface", fallback: "#1e293b" },
679
- border: { cssVar: "--elucim-border", fallback: "#334155" },
680
- primary: { cssVar: "--elucim-primary", fallback: "#4fc3f7" },
681
- secondary: { cssVar: "--elucim-secondary", fallback: "#a78bfa" },
682
- tertiary: { cssVar: "--elucim-tertiary", fallback: "#f472b6" },
683
- success: { cssVar: "--elucim-success", fallback: "#34d399" },
684
- warning: { cssVar: "--elucim-warning", fallback: "#fbbf24" },
685
- error: { cssVar: "--elucim-error", fallback: "#f87171" }
686
- }, oa = Object.keys(ce);
687
- function u(e) {
688
- if (e === void 0) return;
689
- if (!e.startsWith("$")) return e;
690
- const a = e.slice(1), t = ce[a];
691
- return t ? `var(${t.cssVar}, ${t.fallback})` : `var(--elucim-${a})`;
692
- }
693
- const Ut = {
672
+ const Zt = {
694
673
  card: [640, 360],
695
674
  slide: [1280, 720],
696
675
  square: [600, 600]
697
676
  };
698
- function L(e, a, t) {
677
+ function j(e, a, t) {
699
678
  if (!e) return { width: a, height: t };
700
- const [r, i] = Ut[e];
679
+ const [r, i] = Zt[e];
701
680
  return { width: a ?? r, height: t ?? i };
702
681
  }
703
- function le(e, a) {
682
+ function ge(e, a) {
704
683
  switch (e.type) {
705
684
  case "scene":
706
- return H(e, a);
685
+ return J(e, a);
707
686
  case "player":
708
687
  if ((a == null ? void 0 : a.frame) !== void 0) {
709
- const { width: t, height: r } = L(e.preset, e.width, e.height);
710
- return H(
688
+ const { width: t, height: r } = j(e.preset, e.width, e.height);
689
+ return J(
711
690
  {
712
691
  width: t,
713
692
  height: r,
@@ -719,15 +698,15 @@ function le(e, a) {
719
698
  a
720
699
  );
721
700
  }
722
- return ue(e, a);
701
+ return oe(e, a);
723
702
  case "presentation":
724
- return Gt(e, a);
703
+ return ea(e, a);
725
704
  }
726
705
  }
727
- function H(e, a) {
728
- const t = (a == null ? void 0 : a.frame) !== void 0, { width: r, height: i } = L(e.preset, e.width, e.height);
706
+ function J(e, a) {
707
+ const t = (a == null ? void 0 : a.frame) !== void 0, { width: r, height: i } = j(e.preset, e.width, e.height);
729
708
  return /* @__PURE__ */ l(
730
- Me,
709
+ Le,
731
710
  {
732
711
  width: r,
733
712
  height: i,
@@ -735,15 +714,16 @@ function H(e, a) {
735
714
  durationInFrames: e.durationInFrames,
736
715
  background: u(e.background),
737
716
  colorScheme: a == null ? void 0 : a.colorScheme,
717
+ fitToContainer: a == null ? void 0 : a.fitToContainer,
738
718
  ...t ? { frame: a.frame, autoPlay: !1 } : {},
739
- children: e.children.map((n, s) => v(n, s))
719
+ children: e.children.map((n, s) => w(n, s))
740
720
  }
741
721
  );
742
722
  }
743
- function ue(e, a) {
744
- const { width: t, height: r } = L(e.preset, e.width, e.height);
723
+ function oe(e, a) {
724
+ const { width: t, height: r } = j(e.preset, e.width, e.height);
745
725
  return /* @__PURE__ */ l(
746
- Ne,
726
+ Ve,
747
727
  {
748
728
  ref: a == null ? void 0 : a.playerRef,
749
729
  width: t,
@@ -751,18 +731,20 @@ function ue(e, a) {
751
731
  fps: e.fps,
752
732
  durationInFrames: e.durationInFrames,
753
733
  background: u(e.background),
754
- controls: e.controls,
755
- loop: e.loop,
756
- autoPlay: e.autoPlay,
734
+ controls: (a == null ? void 0 : a.controls) ?? e.controls,
735
+ loop: (a == null ? void 0 : a.loop) ?? e.loop,
736
+ autoPlay: (a == null ? void 0 : a.autoPlay) ?? e.autoPlay,
737
+ onPlayStateChange: a == null ? void 0 : a.onPlayStateChange,
738
+ fitToContainer: a == null ? void 0 : a.fitToContainer,
757
739
  colorScheme: a == null ? void 0 : a.colorScheme,
758
- children: e.children.map((i, n) => v(i, n))
740
+ children: e.children.map((i, n) => w(i, n))
759
741
  }
760
742
  );
761
743
  }
762
- function Gt(e, a) {
763
- const { width: t, height: r } = L(e.preset, e.width, e.height);
744
+ function ea(e, a) {
745
+ const { width: t, height: r } = j(e.preset, e.width, e.height);
764
746
  return /* @__PURE__ */ l(
765
- Te,
747
+ We,
766
748
  {
767
749
  width: t,
768
750
  height: r,
@@ -772,38 +754,38 @@ function Gt(e, a) {
772
754
  showHUD: e.showHud,
773
755
  showNotes: e.showNotes,
774
756
  colorScheme: a == null ? void 0 : a.colorScheme,
775
- children: e.slides.map((i, n) => Ht(i, n))
757
+ children: e.slides.map((i, n) => ta(i, n))
776
758
  }
777
759
  );
778
760
  }
779
- function Ht(e, a) {
761
+ function ta(e, a) {
780
762
  var t;
781
- return /* @__PURE__ */ l(We, { title: e.title, notes: e.notes, background: u(e.background), children: (t = e.children) == null ? void 0 : t.map((r, i) => v(r, i)) }, a);
763
+ return /* @__PURE__ */ l(Be, { title: e.title, notes: e.notes, background: u(e.background), children: (t = e.children) == null ? void 0 : t.map((r, i) => w(r, i)) }, a);
782
764
  }
783
- function v(e, a) {
765
+ function w(e, a) {
784
766
  var t, r, i, n;
785
767
  switch (e.type) {
786
768
  case "sequence":
787
- return /* @__PURE__ */ l(lt, { from: e.from, durationInFrames: e.durationInFrames, name: e.name, children: e.children.map((s, c) => v(s, c)) }, a);
769
+ return /* @__PURE__ */ l(ot, { from: e.from, durationInFrames: e.durationInFrames, name: e.name, children: e.children.map((s, c) => w(s, c)) }, a);
788
770
  case "group":
789
771
  return /* @__PURE__ */ l(
790
- ct,
772
+ gt,
791
773
  {
792
774
  fadeIn: e.fadeIn,
793
775
  fadeOut: e.fadeOut,
794
- easing: o(e.easing),
776
+ easing: f(e.easing),
795
777
  rotation: e.rotation,
796
778
  rotationOrigin: e.rotationOrigin,
797
779
  scale: e.scale,
798
780
  translate: e.translate,
799
781
  zIndex: e.zIndex,
800
- children: e.children.map((s, c) => v(s, c))
782
+ children: e.children.map((s, c) => w(s, c))
801
783
  },
802
784
  a
803
785
  );
804
786
  case "bezierCurve":
805
787
  return /* @__PURE__ */ l(
806
- st,
788
+ ft,
807
789
  {
808
790
  x1: e.x1,
809
791
  y1: e.y1,
@@ -821,7 +803,7 @@ function v(e, a) {
821
803
  fadeIn: e.fadeIn,
822
804
  fadeOut: e.fadeOut,
823
805
  draw: e.draw,
824
- easing: o(e.easing),
806
+ easing: f(e.easing),
825
807
  rotation: e.rotation,
826
808
  rotationOrigin: e.rotationOrigin,
827
809
  scale: e.scale,
@@ -832,7 +814,7 @@ function v(e, a) {
832
814
  );
833
815
  case "circle":
834
816
  return /* @__PURE__ */ l(
835
- nt,
817
+ ht,
836
818
  {
837
819
  cx: e.cx,
838
820
  cy: e.cy,
@@ -844,7 +826,7 @@ function v(e, a) {
844
826
  fadeIn: e.fadeIn,
845
827
  fadeOut: e.fadeOut,
846
828
  draw: e.draw,
847
- easing: o(e.easing),
829
+ easing: f(e.easing),
848
830
  rotation: e.rotation,
849
831
  rotationOrigin: e.rotationOrigin,
850
832
  scale: e.scale,
@@ -855,7 +837,7 @@ function v(e, a) {
855
837
  );
856
838
  case "line":
857
839
  return /* @__PURE__ */ l(
858
- it,
840
+ ut,
859
841
  {
860
842
  x1: e.x1,
861
843
  y1: e.y1,
@@ -868,7 +850,7 @@ function v(e, a) {
868
850
  fadeIn: e.fadeIn,
869
851
  fadeOut: e.fadeOut,
870
852
  draw: e.draw,
871
- easing: o(e.easing),
853
+ easing: f(e.easing),
872
854
  rotation: e.rotation,
873
855
  rotationOrigin: e.rotationOrigin,
874
856
  scale: e.scale,
@@ -879,7 +861,7 @@ function v(e, a) {
879
861
  );
880
862
  case "arrow":
881
863
  return /* @__PURE__ */ l(
882
- rt,
864
+ lt,
883
865
  {
884
866
  x1: e.x1,
885
867
  y1: e.y1,
@@ -893,7 +875,7 @@ function v(e, a) {
893
875
  fadeIn: e.fadeIn,
894
876
  fadeOut: e.fadeOut,
895
877
  draw: e.draw,
896
- easing: o(e.easing),
878
+ easing: f(e.easing),
897
879
  rotation: e.rotation,
898
880
  rotationOrigin: e.rotationOrigin,
899
881
  scale: e.scale,
@@ -904,7 +886,7 @@ function v(e, a) {
904
886
  );
905
887
  case "rect":
906
888
  return /* @__PURE__ */ l(
907
- at,
889
+ ct,
908
890
  {
909
891
  x: e.x,
910
892
  y: e.y,
@@ -920,7 +902,7 @@ function v(e, a) {
920
902
  fadeIn: e.fadeIn,
921
903
  fadeOut: e.fadeOut,
922
904
  draw: e.draw,
923
- easing: o(e.easing),
905
+ easing: f(e.easing),
924
906
  rotation: e.rotation,
925
907
  rotationOrigin: e.rotationOrigin,
926
908
  scale: e.scale,
@@ -931,7 +913,7 @@ function v(e, a) {
931
913
  );
932
914
  case "polygon":
933
915
  return /* @__PURE__ */ l(
934
- tt,
916
+ st,
935
917
  {
936
918
  points: e.points,
937
919
  fill: u(e.fill),
@@ -942,7 +924,7 @@ function v(e, a) {
942
924
  fadeIn: e.fadeIn,
943
925
  fadeOut: e.fadeOut,
944
926
  draw: e.draw,
945
- easing: o(e.easing),
927
+ easing: f(e.easing),
946
928
  rotation: e.rotation,
947
929
  rotationOrigin: e.rotationOrigin,
948
930
  scale: e.scale,
@@ -953,7 +935,7 @@ function v(e, a) {
953
935
  );
954
936
  case "text":
955
937
  return /* @__PURE__ */ l(
956
- j,
938
+ U,
957
939
  {
958
940
  x: e.x,
959
941
  y: e.y,
@@ -966,7 +948,7 @@ function v(e, a) {
966
948
  opacity: e.opacity,
967
949
  fadeIn: e.fadeIn,
968
950
  fadeOut: e.fadeOut,
969
- easing: o(e.easing),
951
+ easing: f(e.easing),
970
952
  rotation: e.rotation,
971
953
  rotationOrigin: e.rotationOrigin,
972
954
  scale: e.scale,
@@ -978,7 +960,7 @@ function v(e, a) {
978
960
  );
979
961
  case "image":
980
962
  return /* @__PURE__ */ l(
981
- et,
963
+ nt,
982
964
  {
983
965
  src: e.src,
984
966
  x: e.x,
@@ -991,7 +973,7 @@ function v(e, a) {
991
973
  opacity: e.opacity,
992
974
  fadeIn: e.fadeIn,
993
975
  fadeOut: e.fadeOut,
994
- easing: o(e.easing),
976
+ easing: f(e.easing),
995
977
  rotation: e.rotation,
996
978
  rotationOrigin: e.rotationOrigin,
997
979
  scale: e.scale,
@@ -1002,7 +984,7 @@ function v(e, a) {
1002
984
  );
1003
985
  case "axes":
1004
986
  return /* @__PURE__ */ l(
1005
- Ze,
987
+ it,
1006
988
  {
1007
989
  domain: e.domain,
1008
990
  range: e.range,
@@ -1019,7 +1001,7 @@ function v(e, a) {
1019
1001
  fadeIn: e.fadeIn,
1020
1002
  fadeOut: e.fadeOut,
1021
1003
  draw: e.draw,
1022
- easing: o(e.easing),
1004
+ easing: f(e.easing),
1023
1005
  rotation: e.rotation,
1024
1006
  rotationOrigin: e.rotationOrigin,
1025
1007
  translate: e.translate,
@@ -1030,10 +1012,10 @@ function v(e, a) {
1030
1012
  case "functionPlot": {
1031
1013
  let s;
1032
1014
  try {
1033
- s = mt(e.fn);
1015
+ s = It(e.fn);
1034
1016
  } catch {
1035
1017
  return /* @__PURE__ */ l(
1036
- j,
1018
+ U,
1037
1019
  {
1038
1020
  x: ((t = e.origin) == null ? void 0 : t[0]) ?? 400,
1039
1021
  y: (((r = e.origin) == null ? void 0 : r[1]) ?? 300) - 20,
@@ -1046,7 +1028,7 @@ function v(e, a) {
1046
1028
  );
1047
1029
  }
1048
1030
  return /* @__PURE__ */ l(
1049
- Ye,
1031
+ rt,
1050
1032
  {
1051
1033
  fn: (c) => s({ x: c }),
1052
1034
  domain: e.domain,
@@ -1057,7 +1039,7 @@ function v(e, a) {
1057
1039
  strokeWidth: e.strokeWidth,
1058
1040
  samples: e.samples,
1059
1041
  draw: e.draw,
1060
- easing: o(e.easing),
1042
+ easing: f(e.easing),
1061
1043
  opacity: e.opacity,
1062
1044
  rotation: e.rotation,
1063
1045
  rotationOrigin: e.rotationOrigin,
@@ -1069,7 +1051,7 @@ function v(e, a) {
1069
1051
  }
1070
1052
  case "vector":
1071
1053
  return /* @__PURE__ */ l(
1072
- Je,
1054
+ at,
1073
1055
  {
1074
1056
  from: e.from,
1075
1057
  to: e.to,
@@ -1085,7 +1067,7 @@ function v(e, a) {
1085
1067
  fadeIn: e.fadeIn,
1086
1068
  fadeOut: e.fadeOut,
1087
1069
  draw: e.draw,
1088
- easing: o(e.easing),
1070
+ easing: f(e.easing),
1089
1071
  rotation: e.rotation,
1090
1072
  rotationOrigin: e.rotationOrigin,
1091
1073
  translate: e.translate,
@@ -1096,10 +1078,10 @@ function v(e, a) {
1096
1078
  case "vectorField": {
1097
1079
  let s;
1098
1080
  try {
1099
- s = yt(e.fn);
1081
+ s = St(e.fn);
1100
1082
  } catch {
1101
1083
  return /* @__PURE__ */ l(
1102
- j,
1084
+ U,
1103
1085
  {
1104
1086
  x: ((i = e.origin) == null ? void 0 : i[0]) ?? 400,
1105
1087
  y: (((n = e.origin) == null ? void 0 : n[1]) ?? 300) - 20,
@@ -1112,9 +1094,9 @@ function v(e, a) {
1112
1094
  );
1113
1095
  }
1114
1096
  return /* @__PURE__ */ l(
1115
- Xe,
1097
+ tt,
1116
1098
  {
1117
- fn: (c, x) => s({ x: c, y: x }),
1099
+ fn: (c, y) => s({ x: c, y }),
1118
1100
  domain: e.domain,
1119
1101
  range: e.range,
1120
1102
  step: e.step,
@@ -1128,7 +1110,7 @@ function v(e, a) {
1128
1110
  maxLength: e.maxLength,
1129
1111
  fadeIn: e.fadeIn,
1130
1112
  fadeOut: e.fadeOut,
1131
- easing: o(e.easing),
1113
+ easing: f(e.easing),
1132
1114
  rotation: e.rotation,
1133
1115
  rotationOrigin: e.rotationOrigin,
1134
1116
  translate: e.translate,
@@ -1139,7 +1121,7 @@ function v(e, a) {
1139
1121
  }
1140
1122
  case "matrix":
1141
1123
  return /* @__PURE__ */ l(
1142
- Qe,
1124
+ et,
1143
1125
  {
1144
1126
  values: e.values,
1145
1127
  x: e.x,
@@ -1150,7 +1132,7 @@ function v(e, a) {
1150
1132
  fontSize: e.fontSize,
1151
1133
  fadeIn: e.fadeIn,
1152
1134
  fadeOut: e.fadeOut,
1153
- easing: o(e.easing),
1135
+ easing: f(e.easing),
1154
1136
  rotation: e.rotation,
1155
1137
  rotationOrigin: e.rotationOrigin,
1156
1138
  scale: e.scale,
@@ -1161,7 +1143,7 @@ function v(e, a) {
1161
1143
  );
1162
1144
  case "graph":
1163
1145
  return /* @__PURE__ */ l(
1164
- Ke,
1146
+ Ze,
1165
1147
  {
1166
1148
  nodes: e.nodes,
1167
1149
  edges: e.edges,
@@ -1173,7 +1155,7 @@ function v(e, a) {
1173
1155
  labelFontSize: e.labelFontSize,
1174
1156
  fadeIn: e.fadeIn,
1175
1157
  fadeOut: e.fadeOut,
1176
- easing: o(e.easing),
1158
+ easing: f(e.easing),
1177
1159
  rotation: e.rotation,
1178
1160
  rotationOrigin: e.rotationOrigin,
1179
1161
  scale: e.scale,
@@ -1184,7 +1166,7 @@ function v(e, a) {
1184
1166
  );
1185
1167
  case "latex":
1186
1168
  return /* @__PURE__ */ l(
1187
- He,
1169
+ Ye,
1188
1170
  {
1189
1171
  expression: e.expression,
1190
1172
  x: e.x,
@@ -1194,7 +1176,7 @@ function v(e, a) {
1194
1176
  align: e.align,
1195
1177
  fadeIn: e.fadeIn,
1196
1178
  fadeOut: e.fadeOut,
1197
- easing: o(e.easing),
1179
+ easing: f(e.easing),
1198
1180
  rotation: e.rotation,
1199
1181
  rotationOrigin: e.rotationOrigin,
1200
1182
  scale: e.scale,
@@ -1205,7 +1187,7 @@ function v(e, a) {
1205
1187
  );
1206
1188
  case "barChart":
1207
1189
  return /* @__PURE__ */ l(
1208
- Ge,
1190
+ Je,
1209
1191
  {
1210
1192
  bars: e.bars,
1211
1193
  x: e.x,
@@ -1221,7 +1203,7 @@ function v(e, a) {
1221
1203
  valueFormat: e.valueFormat,
1222
1204
  fadeIn: e.fadeIn,
1223
1205
  fadeOut: e.fadeOut,
1224
- easing: o(e.easing),
1206
+ easing: f(e.easing),
1225
1207
  rotation: e.rotation,
1226
1208
  rotationOrigin: e.rotationOrigin,
1227
1209
  scale: e.scale,
@@ -1231,189 +1213,159 @@ function v(e, a) {
1231
1213
  a
1232
1214
  );
1233
1215
  case "fadeIn":
1234
- return /* @__PURE__ */ l(Ue, { duration: e.duration, easing: o(e.easing), children: e.children.map((s, c) => v(s, c)) }, a);
1216
+ return /* @__PURE__ */ l(Xe, { duration: e.duration, easing: f(e.easing), children: e.children.map((s, c) => w(s, c)) }, a);
1235
1217
  case "fadeOut":
1236
- return /* @__PURE__ */ l(qe, { duration: e.duration, totalFrames: e.totalFrames, easing: o(e.easing), children: e.children.map((s, c) => v(s, c)) }, a);
1218
+ return /* @__PURE__ */ l(Qe, { duration: e.duration, totalFrames: e.totalFrames, easing: f(e.easing), children: e.children.map((s, c) => w(s, c)) }, a);
1237
1219
  case "draw":
1238
- return /* @__PURE__ */ l(Be, { duration: e.duration, pathLength: e.pathLength, easing: o(e.easing), children: v(e.children[0], 0) }, a);
1220
+ return /* @__PURE__ */ l(Ke, { duration: e.duration, pathLength: e.pathLength, easing: f(e.easing), children: w(e.children[0], 0) }, a);
1239
1221
  case "write":
1240
- return /* @__PURE__ */ l(je, { duration: e.duration, easing: o(e.easing), children: e.children.map((s, c) => v(s, c)) }, a);
1222
+ return /* @__PURE__ */ l(Ge, { duration: e.duration, easing: f(e.easing), children: e.children.map((s, c) => w(s, c)) }, a);
1241
1223
  case "transform":
1242
1224
  return /* @__PURE__ */ l(
1243
- Le,
1225
+ He,
1244
1226
  {
1245
1227
  duration: e.duration,
1246
- easing: o(e.easing),
1228
+ easing: f(e.easing),
1247
1229
  translate: e.translate,
1248
1230
  scale: e.scale,
1249
1231
  rotate: e.rotate,
1250
1232
  opacity: e.opacity,
1251
- children: e.children.map((s, c) => v(s, c))
1233
+ children: e.children.map((s, c) => w(s, c))
1252
1234
  },
1253
1235
  a
1254
1236
  );
1255
1237
  case "morph":
1256
1238
  return /* @__PURE__ */ l(
1257
- Ve,
1239
+ Ue,
1258
1240
  {
1259
1241
  duration: e.duration,
1260
- easing: o(e.easing),
1242
+ easing: f(e.easing),
1261
1243
  fromColor: u(e.fromColor),
1262
1244
  toColor: u(e.toColor),
1263
1245
  fromOpacity: e.fromOpacity,
1264
1246
  toOpacity: e.toOpacity,
1265
1247
  fromScale: e.fromScale,
1266
1248
  toScale: e.toScale,
1267
- children: e.children.map((s, c) => v(s, c))
1249
+ children: e.children.map((s, c) => w(s, c))
1268
1250
  },
1269
1251
  a
1270
1252
  );
1271
1253
  case "stagger":
1272
- return /* @__PURE__ */ l(_e, { staggerDelay: e.staggerDelay, easing: o(e.easing), children: e.children.map((s, c) => v(s, c)) }, a);
1254
+ return /* @__PURE__ */ l(qe, { staggerDelay: e.staggerDelay, easing: f(e.easing), children: e.children.map((s, c) => w(s, c)) }, a);
1273
1255
  case "parallel":
1274
- return /* @__PURE__ */ l(De, { children: e.children.map((s, c) => v(s, c)) }, a);
1256
+ return /* @__PURE__ */ l(je, { children: e.children.map((s, c) => w(s, c)) }, a);
1275
1257
  case "scene":
1276
- return /* @__PURE__ */ l(X.Fragment, { children: H(e) }, a);
1258
+ return /* @__PURE__ */ l(K.Fragment, { children: J(e) }, a);
1277
1259
  case "player":
1278
- return /* @__PURE__ */ l(X.Fragment, { children: ue(e) }, a);
1260
+ return /* @__PURE__ */ l(K.Fragment, { children: oe(e) }, a);
1279
1261
  default:
1280
1262
  return null;
1281
1263
  }
1282
1264
  }
1283
- const he = {
1284
- background: "#0a0a1e",
1285
- title: "#e0e7ff",
1286
- subtitle: "#94a3b8",
1287
- primary: "#4fc3f7",
1288
- secondary: "#a78bfa",
1289
- tertiary: "#f472b6",
1290
- muted: "#64748b",
1291
- text: "#c8d6e5",
1292
- boxFill: "rgba(79,195,247,0.12)",
1293
- boxStroke: "#4fc3f7",
1294
- success: "#34d399",
1295
- warning: "#fbbf24",
1296
- error: "#f87171",
1297
- palette: ["#4fc3f7", "#a78bfa", "#f472b6", "#34d399", "#fbbf24", "#fb923c", "#6366f1", "#22d3ee"]
1298
- }, Kt = {
1299
- background: "#f8fafc",
1300
- title: "#1e293b",
1301
- subtitle: "#64748b",
1302
- primary: "#2563eb",
1303
- secondary: "#7c3aed",
1304
- tertiary: "#db2777",
1305
- muted: "#94a3b8",
1306
- text: "#334155",
1307
- boxFill: "rgba(37,99,235,0.08)",
1308
- boxStroke: "#2563eb",
1309
- success: "#16a34a",
1310
- warning: "#d97706",
1311
- error: "#dc2626",
1312
- palette: ["#2563eb", "#7c3aed", "#db2777", "#16a34a", "#d97706", "#ea580c", "#4f46e5", "#0891b2"]
1313
- };
1314
- function Qt(e) {
1315
- if (!e) return {};
1316
- const a = {};
1317
- for (const [t, r] of Object.entries(e))
1318
- r !== void 0 && (a[`--elucim-${t}`] = r);
1319
- return a;
1320
- }
1321
- function fe(e) {
1322
- return {
1323
- "--elucim-foreground": e.text,
1324
- "--elucim-background": e.background,
1325
- "--elucim-title": e.title,
1326
- "--elucim-subtitle": e.subtitle,
1327
- "--elucim-accent": e.primary,
1328
- "--elucim-muted": e.muted,
1329
- "--elucim-surface": e.background,
1330
- "--elucim-primary": e.primary,
1331
- "--elucim-secondary": e.secondary,
1332
- "--elucim-tertiary": e.tertiary,
1333
- "--elucim-success": e.success,
1334
- "--elucim-warning": e.warning,
1335
- "--elucim-error": e.error
1336
- };
1337
- }
1338
- const Xt = fe(he), Jt = fe(Kt);
1339
- function Yt(e) {
1265
+ function aa(e) {
1340
1266
  if (typeof window > "u" || typeof window.matchMedia != "function") return () => {
1341
1267
  };
1342
1268
  const a = window.matchMedia("(prefers-color-scheme: dark)");
1343
1269
  return a.addEventListener("change", e), () => a.removeEventListener("change", e);
1344
1270
  }
1345
- function Zt() {
1271
+ function ra() {
1346
1272
  return typeof window > "u" || typeof window.matchMedia != "function" ? !0 : window.matchMedia("(prefers-color-scheme: dark)").matches;
1347
1273
  }
1348
- function ea() {
1274
+ function ia() {
1349
1275
  return !0;
1350
1276
  }
1351
- function ta() {
1352
- return ot(Yt, Zt, ea);
1277
+ function na() {
1278
+ return vt(aa, ra, ia);
1279
+ }
1280
+ class sa extends K.Component {
1281
+ constructor() {
1282
+ super(...arguments), this.state = { error: null };
1283
+ }
1284
+ static getDerivedStateFromError(a) {
1285
+ return { error: a };
1286
+ }
1287
+ componentDidCatch(a) {
1288
+ var t, r;
1289
+ (r = (t = this.props).onRenderError) == null || r.call(t, a);
1290
+ }
1291
+ render() {
1292
+ return this.state.error ? this.props.fallback !== void 0 ? this.props.fallback : /* @__PURE__ */ E(
1293
+ "div",
1294
+ {
1295
+ style: { color: "#ff6b6b", fontFamily: "monospace", padding: 16, fontSize: 13 },
1296
+ "data-testid": "dsl-render-error",
1297
+ children: [
1298
+ /* @__PURE__ */ l("strong", { children: "Render Error:" }),
1299
+ " ",
1300
+ this.state.error.message
1301
+ ]
1302
+ }
1303
+ ) : this.props.children;
1304
+ }
1353
1305
  }
1354
- const ga = ut(function({ dsl: a, className: t, style: r, theme: i, colorScheme: n, poster: s, onError: c }, x) {
1355
- const m = ht(null), k = ta();
1356
- ft(x, () => ({
1306
+ const da = xt(function({ dsl: a, className: t, style: r, theme: i, colorScheme: n, poster: s, controls: c, autoPlay: y, loop: d, fitToContainer: S, onPlayStateChange: b, onRenderError: g, fallback: x, onError: C }, O) {
1307
+ const $ = dt(null), _ = na();
1308
+ wt(O, () => ({
1357
1309
  getSvgElement: () => {
1358
- var f;
1359
- return ((f = m.current) == null ? void 0 : f.getSvgElement()) ?? null;
1310
+ var o;
1311
+ return ((o = $.current) == null ? void 0 : o.getSvgElement()) ?? null;
1360
1312
  },
1361
- seekToFrame: (f) => {
1362
- var C;
1363
- return (C = m.current) == null ? void 0 : C.seekToFrame(f);
1313
+ seekToFrame: (o) => {
1314
+ var F;
1315
+ return (F = $.current) == null ? void 0 : F.seekToFrame(o);
1364
1316
  },
1365
1317
  getTotalFrames: () => {
1366
- var f;
1367
- return ((f = m.current) == null ? void 0 : f.getTotalFrames()) ?? 0;
1318
+ var o;
1319
+ return ((o = $.current) == null ? void 0 : o.getTotalFrames()) ?? 0;
1368
1320
  },
1369
1321
  play: () => {
1370
- var f;
1371
- return (f = m.current) == null ? void 0 : f.play();
1322
+ var o;
1323
+ return (o = $.current) == null ? void 0 : o.play();
1372
1324
  },
1373
1325
  pause: () => {
1374
- var f;
1375
- return (f = m.current) == null ? void 0 : f.pause();
1326
+ var o;
1327
+ return (o = $.current) == null ? void 0 : o.pause();
1376
1328
  },
1377
1329
  isPlaying: () => {
1378
- var f;
1379
- return ((f = m.current) == null ? void 0 : f.isPlaying()) ?? !1;
1330
+ var o;
1331
+ return ((o = $.current) == null ? void 0 : o.isPlaying()) ?? !1;
1380
1332
  }
1381
1333
  }));
1382
- const y = re(a);
1383
- if (!y.valid) {
1384
- const f = y.errors.filter((I) => I.severity === "error").map((I) => ({ path: I.path, message: I.message }));
1385
- c == null || c(f);
1386
- const C = /* @__PURE__ */ new Map();
1387
- for (const I of f) {
1388
- const M = I.path.split("."), N = M.length > 1 ? M.slice(0, -1).join(".") : I.path, D = C.get(N) ?? [];
1389
- D.push(I), C.set(N, D);
1334
+ const ee = le(a);
1335
+ if (!ee.valid) {
1336
+ const o = ee.errors.filter((k) => k.severity === "error").map((k) => ({ path: k.path, message: k.message }));
1337
+ C == null || C(o);
1338
+ const F = /* @__PURE__ */ new Map();
1339
+ for (const k of o) {
1340
+ const D = k.path.split("."), N = D.length > 1 ? D.slice(0, -1).join(".") : k.path, L = F.get(N) ?? [];
1341
+ L.push(k), F.set(N, L);
1390
1342
  }
1391
- return /* @__PURE__ */ P(
1343
+ return /* @__PURE__ */ E(
1392
1344
  "div",
1393
1345
  {
1394
1346
  className: t,
1395
1347
  style: { color: "#ff6b6b", fontFamily: "monospace", padding: 16, fontSize: 13, ...r },
1396
1348
  "data-testid": "dsl-error",
1397
1349
  children: [
1398
- /* @__PURE__ */ P("strong", { children: [
1350
+ /* @__PURE__ */ E("strong", { children: [
1399
1351
  "Elucim DSL Validation Errors (",
1400
- f.length,
1352
+ o.length,
1401
1353
  "):"
1402
1354
  ] }),
1403
- [...C.entries()].map(([I, M]) => /* @__PURE__ */ P("details", { open: !0, style: { marginTop: 8 }, children: [
1404
- /* @__PURE__ */ P("summary", { style: { cursor: "pointer", fontWeight: "bold" }, children: [
1405
- I,
1355
+ [...F.entries()].map(([k, D]) => /* @__PURE__ */ E("details", { open: !0, style: { marginTop: 8 }, children: [
1356
+ /* @__PURE__ */ E("summary", { style: { cursor: "pointer", fontWeight: "bold" }, children: [
1357
+ k,
1406
1358
  " (",
1407
- M.length,
1359
+ D.length,
1408
1360
  ")"
1409
1361
  ] }),
1410
- /* @__PURE__ */ l("ul", { style: { margin: "4px 0", paddingLeft: 20 }, children: M.map((N, D) => /* @__PURE__ */ P("li", { children: [
1362
+ /* @__PURE__ */ l("ul", { style: { margin: "4px 0", paddingLeft: 20 }, children: D.map((N, L) => /* @__PURE__ */ E("li", { children: [
1411
1363
  /* @__PURE__ */ l("code", { style: { color: "#ffa07a" }, children: N.path }),
1412
1364
  ": ",
1413
1365
  N.message
1414
- ] }, D)) })
1415
- ] }, I)),
1416
- /* @__PURE__ */ P("details", { style: { marginTop: 12 }, children: [
1366
+ ] }, L)) })
1367
+ ] }, k)),
1368
+ /* @__PURE__ */ E("details", { style: { marginTop: 12 }, children: [
1417
1369
  /* @__PURE__ */ l("summary", { style: { cursor: "pointer", opacity: 0.7 }, children: "Raw JSON" }),
1418
1370
  /* @__PURE__ */ l("pre", { style: { fontSize: 11, maxHeight: 300, overflow: "auto", marginTop: 4, padding: 8, background: "rgba(0,0,0,0.3)", borderRadius: 4 }, children: JSON.stringify(a, null, 2) })
1419
1371
  ] })
@@ -1421,17 +1373,22 @@ const ga = ut(function({ dsl: a, className: t, style: r, theme: i, colorScheme:
1421
1373
  }
1422
1374
  );
1423
1375
  }
1424
- const g = Qt(i);
1425
- let d = {};
1426
- n && (d = (n === "auto" ? k : n === "dark") ? Xt : Jt);
1427
- const $ = s !== void 0 ? aa(s, a) : void 0, O = n ? n === "auto" ? k ? "dark" : "light" : n : void 0;
1428
- return /* @__PURE__ */ l("div", { className: t, style: { ...d, ...g, ...r }, "data-testid": "dsl-root", children: le(a.root, {
1429
- frame: $ == null ? void 0 : $.frame,
1430
- playerRef: m,
1431
- colorScheme: O
1432
- }) });
1376
+ const me = mt(i);
1377
+ let te = {};
1378
+ n && (te = (n === "auto" ? _ : n === "dark") ? yt : bt);
1379
+ const q = s !== void 0 ? ca(s, a) : void 0, ye = n ? n === "auto" ? _ ? "dark" : "light" : n : void 0, be = ge(a.root, {
1380
+ frame: q == null ? void 0 : q.frame,
1381
+ playerRef: $,
1382
+ colorScheme: ye,
1383
+ controls: c,
1384
+ autoPlay: y,
1385
+ loop: d,
1386
+ fitToContainer: S,
1387
+ onPlayStateChange: b
1388
+ });
1389
+ return /* @__PURE__ */ l("div", { className: t, style: { ...te, ...me, ...r }, "data-testid": "dsl-root", children: /* @__PURE__ */ l(sa, { onRenderError: g, fallback: x, children: be }) });
1433
1390
  });
1434
- function aa(e, a) {
1391
+ function ca(e, a) {
1435
1392
  if (e === "first") return { frame: 0 };
1436
1393
  if (e === "last") {
1437
1394
  const r = a.root.durationInFrames ?? 1;
@@ -1439,8 +1396,8 @@ function aa(e, a) {
1439
1396
  }
1440
1397
  return { frame: e };
1441
1398
  }
1442
- function ra(e, a, t) {
1443
- const r = re(e);
1399
+ function la(e, a, t) {
1400
+ const r = le(e);
1444
1401
  if (!r.valid) {
1445
1402
  const s = r.errors.filter((c) => c.severity === "error");
1446
1403
  throw new Error(
@@ -1451,59 +1408,59 @@ ${s.map((c) => ` ${c.path}: ${c.message}`).join(`
1451
1408
  }
1452
1409
  const i = { ...e.root };
1453
1410
  t != null && t.width && (i.width = t.width), t != null && t.height && (i.height = t.height);
1454
- const n = le(i, { frame: a });
1455
- return gt(n);
1411
+ const n = ge(i, { frame: a });
1412
+ return kt(n);
1456
1413
  }
1457
- function te(e) {
1414
+ function se(e) {
1458
1415
  let a;
1459
1416
  do
1460
1417
  a = e, e = e.replace(/var\(--[a-z][\w-]*,\s*([^)]+)\)/gi, "$1");
1461
1418
  while (e !== a);
1462
1419
  return e = e.replace(/var\(--[a-z][\w-]*\)/gi, "none"), e = e.replace(/light-dark\([^,]+,\s*([^)]+)\)/gi, "$1"), e;
1463
1420
  }
1464
- async function ma(e, a, t) {
1465
- const r = (t == null ? void 0 : t.scale) ?? 2, n = ra(e, a, {
1421
+ async function wa(e, a, t) {
1422
+ const r = (t == null ? void 0 : t.scale) ?? 2, n = la(e, a, {
1466
1423
  width: t == null ? void 0 : t.width,
1467
1424
  height: t == null ? void 0 : t.height
1468
1425
  }).match(/<svg[\s\S]*<\/svg>/);
1469
1426
  if (!n)
1470
1427
  throw new Error("renderToSvgString did not produce an SVG element");
1471
1428
  let s = n[0];
1472
- const c = s.match(/viewBox="0 0 (\d+(?:\.\d+)?) (\d+(?:\.\d+)?)"/), x = (t == null ? void 0 : t.width) ?? (c ? parseFloat(c[1]) : 800), m = (t == null ? void 0 : t.height) ?? (c ? parseFloat(c[2]) : 600), k = Math.round(x * r), y = Math.round(m * r);
1473
- s = s.replace(/width="100%"/, `width="${k}"`).replace(/height="100%"/, `height="${y}"`), s.includes("xmlns=") || (s = s.replace("<svg", '<svg xmlns="http://www.w3.org/2000/svg"')), s = s.replace(/style="[^"]*position:\s*absolute[^"]*"/, "");
1429
+ const c = s.match(/viewBox="0 0 (\d+(?:\.\d+)?) (\d+(?:\.\d+)?)"/), y = (t == null ? void 0 : t.width) ?? (c ? parseFloat(c[1]) : 800), d = (t == null ? void 0 : t.height) ?? (c ? parseFloat(c[2]) : 600), S = Math.round(y * r), b = Math.round(d * r);
1430
+ s = s.replace(/width="100%"/, `width="${S}"`).replace(/height="100%"/, `height="${b}"`), s.includes("xmlns=") || (s = s.replace("<svg", '<svg xmlns="http://www.w3.org/2000/svg"')), s = s.replace(/style="[^"]*position:\s*absolute[^"]*"/, "");
1474
1431
  let g = e.root.background ?? "#ffffff";
1475
- g.startsWith("$") && (g = u(g) ?? "#ffffff"), g = te(g);
1476
- const d = `<rect width="${x}" height="${m}" fill="${g}"/>`;
1477
- s = s.replace(/>/, `>${d}`), s = te(s);
1432
+ g.startsWith("$") && (g = u(g) ?? "#ffffff"), g = se(g);
1433
+ const x = `<rect width="${y}" height="${d}" fill="${g}"/>`;
1434
+ s = s.replace(/>/, `>${x}`), s = se(s);
1478
1435
  const O = `data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(s)))}`;
1479
1436
  if (typeof Image < "u" && typeof document < "u")
1480
- return na(O, k, y);
1437
+ return ha(O, S, b);
1481
1438
  if (typeof OffscreenCanvas < "u")
1482
- return ia(O, k, y);
1439
+ return ua(O, S, b);
1483
1440
  throw new Error("renderToPng requires Image+document (browser) or OffscreenCanvas (worker)");
1484
1441
  }
1485
- async function ia(e, a, t) {
1442
+ async function ua(e, a, t) {
1486
1443
  const i = await (await fetch(e)).blob(), n = await createImageBitmap(i, { resizeWidth: a, resizeHeight: t }), s = new OffscreenCanvas(a, t);
1487
1444
  s.getContext("2d").drawImage(n, 0, 0, a, t), n.close();
1488
- const m = await (await s.convertToBlob({ type: "image/png" })).arrayBuffer();
1489
- return new Uint8Array(m);
1445
+ const d = await (await s.convertToBlob({ type: "image/png" })).arrayBuffer();
1446
+ return new Uint8Array(d);
1490
1447
  }
1491
- function na(e, a, t) {
1448
+ function ha(e, a, t) {
1492
1449
  return new Promise((r, i) => {
1493
1450
  const n = new Image();
1494
1451
  n.onload = () => {
1495
1452
  const s = document.createElement("canvas");
1496
1453
  s.width = a, s.height = t, s.getContext("2d").drawImage(n, 0, 0, a, t), s.toBlob(
1497
- (x) => {
1498
- if (!x) return i(new Error("Failed to render PNG from SVG"));
1499
- x.arrayBuffer().then((m) => r(new Uint8Array(m)));
1454
+ (y) => {
1455
+ if (!y) return i(new Error("Failed to render PNG from SVG"));
1456
+ y.arrayBuffer().then((d) => r(new Uint8Array(d)));
1500
1457
  },
1501
1458
  "image/png"
1502
1459
  );
1503
1460
  }, n.onerror = () => i(new Error("Failed to load SVG data URI for PNG render")), n.src = e;
1504
1461
  });
1505
1462
  }
1506
- class sa {
1463
+ class fa {
1507
1464
  constructor(a, t = 30, r = 900, i = 640) {
1508
1465
  this.elements = [], this.cursor = 0, this.theme = a, this._fps = t, this._width = r, this._height = i;
1509
1466
  }
@@ -1597,7 +1554,7 @@ class sa {
1597
1554
  y: t.y,
1598
1555
  content: a,
1599
1556
  fontSize: t.fontSize ?? 14,
1600
- fill: t.color ?? this.theme.text,
1557
+ fill: t.color ?? this.theme.foreground,
1601
1558
  textAnchor: t.anchor ?? "middle",
1602
1559
  fontWeight: t.fontWeight,
1603
1560
  fontFamily: t.fontFamily
@@ -1677,7 +1634,7 @@ class sa {
1677
1634
  width: t.width,
1678
1635
  height: t.height,
1679
1636
  barColor: t.barColor ?? this.theme.primary,
1680
- labelColor: t.labelColor ?? this.theme.text,
1637
+ labelColor: t.labelColor ?? this.theme.foreground,
1681
1638
  labelFontSize: t.labelFontSize,
1682
1639
  maxValue: t.maxValue,
1683
1640
  valueFormat: t.valueFormat,
@@ -1695,7 +1652,7 @@ class sa {
1695
1652
  x: (t == null ? void 0 : t.x) ?? this.cx,
1696
1653
  y: (t == null ? void 0 : t.y) ?? 300,
1697
1654
  cellSize: (t == null ? void 0 : t.cellSize) ?? 50,
1698
- color: (t == null ? void 0 : t.color) ?? this.theme.text,
1655
+ color: (t == null ? void 0 : t.color) ?? this.theme.foreground,
1699
1656
  bracketColor: (t == null ? void 0 : t.bracketColor) ?? this.theme.primary,
1700
1657
  fontSize: t == null ? void 0 : t.fontSize,
1701
1658
  fadeIn: r
@@ -1722,35 +1679,35 @@ class sa {
1722
1679
  * Returns the box positions for follow-up arrows, etc.
1723
1680
  */
1724
1681
  boxRow(a, t) {
1725
- const r = (t == null ? void 0 : t.boxWidth) ?? 80, i = (t == null ? void 0 : t.boxHeight) ?? 40, n = (t == null ? void 0 : t.gap) ?? 12, s = (t == null ? void 0 : t.y) ?? 250, c = a.length * r + (a.length - 1) * n, x = (this._width - c) / 2;
1682
+ const r = (t == null ? void 0 : t.boxWidth) ?? 80, i = (t == null ? void 0 : t.boxHeight) ?? 40, n = (t == null ? void 0 : t.gap) ?? 12, s = (t == null ? void 0 : t.y) ?? 250, c = a.length * r + (a.length - 1) * n, y = (this._width - c) / 2;
1726
1683
  t == null || t.fadeIn;
1727
- const m = a.map((y, g) => {
1728
- const d = x + g * (r + n);
1729
- return { x: d, y: s, w: r, h: i, cx: d + r / 2, cy: s + i / 2 };
1730
- }), k = a.map((y, g) => {
1731
- var f, C;
1732
- const d = m[g], $ = ((f = t == null ? void 0 : t.colors) == null ? void 0 : f[g]) ?? this.theme.boxFill, O = ((C = t == null ? void 0 : t.strokeColors) == null ? void 0 : C[g]) ?? this.theme.boxStroke;
1684
+ const d = a.map((b, g) => {
1685
+ const x = y + g * (r + n);
1686
+ return { x, y: s, w: r, h: i, cx: x + r / 2, cy: s + i / 2 };
1687
+ }), S = a.map((b, g) => {
1688
+ var $, _;
1689
+ const x = d[g], C = (($ = t == null ? void 0 : t.colors) == null ? void 0 : $[g]) ?? this.theme.boxFill, O = ((_ = t == null ? void 0 : t.strokeColors) == null ? void 0 : _[g]) ?? this.theme.boxStroke;
1733
1690
  return {
1734
1691
  type: "group",
1735
1692
  children: [
1736
1693
  {
1737
1694
  type: "rect",
1738
- x: d.x,
1739
- y: d.y,
1695
+ x: x.x,
1696
+ y: x.y,
1740
1697
  width: r,
1741
1698
  height: i,
1742
- fill: $,
1699
+ fill: C,
1743
1700
  stroke: O,
1744
1701
  strokeWidth: 1.5,
1745
1702
  rx: 6
1746
1703
  },
1747
1704
  {
1748
1705
  type: "text",
1749
- x: d.cx,
1750
- y: d.cy + 5,
1751
- content: y,
1706
+ x: x.cx,
1707
+ y: x.cy + 5,
1708
+ content: b,
1752
1709
  fontSize: (t == null ? void 0 : t.fontSize) ?? 13,
1753
- fill: (t == null ? void 0 : t.textColor) ?? this.theme.text,
1710
+ fill: (t == null ? void 0 : t.textColor) ?? this.theme.foreground,
1754
1711
  textAnchor: "middle",
1755
1712
  fontFamily: t == null ? void 0 : t.fontFamily
1756
1713
  }
@@ -1760,8 +1717,8 @@ class sa {
1760
1717
  return this.addAtCursor({
1761
1718
  type: "stagger",
1762
1719
  staggerDelay: 3,
1763
- children: k
1764
- }, 8 + a.length * 2), m;
1720
+ children: S
1721
+ }, 8 + a.length * 2), d;
1765
1722
  }
1766
1723
  /**
1767
1724
  * Render a vertical stack of labeled boxes.
@@ -1769,12 +1726,12 @@ class sa {
1769
1726
  boxColumn(a, t) {
1770
1727
  const r = (t == null ? void 0 : t.boxWidth) ?? 160, i = (t == null ? void 0 : t.boxHeight) ?? 36, n = (t == null ? void 0 : t.gap) ?? 8, s = (t == null ? void 0 : t.y) ?? 150, c = (t == null ? void 0 : t.x) ?? this.cx;
1771
1728
  t == null || t.fadeIn;
1772
- const x = a.map((k, y) => {
1773
- const g = s + y * (i + n);
1729
+ const y = a.map((S, b) => {
1730
+ const g = s + b * (i + n);
1774
1731
  return { x: c - r / 2, y: g, w: r, h: i, cx: c, cy: g + i / 2 };
1775
- }), m = a.map((k, y) => {
1776
- var $, O;
1777
- const g = x[y], d = (($ = t == null ? void 0 : t.colors) == null ? void 0 : $[y]) ?? this.theme.boxFill;
1732
+ }), d = a.map((S, b) => {
1733
+ var C, O;
1734
+ const g = y[b], x = ((C = t == null ? void 0 : t.colors) == null ? void 0 : C[b]) ?? this.theme.boxFill;
1778
1735
  return {
1779
1736
  type: "group",
1780
1737
  children: [
@@ -1784,8 +1741,8 @@ class sa {
1784
1741
  y: g.y,
1785
1742
  width: r,
1786
1743
  height: i,
1787
- fill: d,
1788
- stroke: (O = t == null ? void 0 : t.colors) != null && O[y] ? t.colors[y] : this.theme.boxStroke,
1744
+ fill: x,
1745
+ stroke: (O = t == null ? void 0 : t.colors) != null && O[b] ? t.colors[b] : this.theme.boxStroke,
1789
1746
  strokeWidth: 1.5,
1790
1747
  rx: 6
1791
1748
  },
@@ -1793,9 +1750,9 @@ class sa {
1793
1750
  type: "text",
1794
1751
  x: g.cx,
1795
1752
  y: g.cy + 5,
1796
- content: k,
1753
+ content: S,
1797
1754
  fontSize: (t == null ? void 0 : t.fontSize) ?? 13,
1798
- fill: (t == null ? void 0 : t.textColor) ?? this.theme.text,
1755
+ fill: (t == null ? void 0 : t.textColor) ?? this.theme.foreground,
1799
1756
  textAnchor: "middle"
1800
1757
  }
1801
1758
  ]
@@ -1804,8 +1761,8 @@ class sa {
1804
1761
  return this.addAtCursor({
1805
1762
  type: "stagger",
1806
1763
  staggerDelay: 3,
1807
- children: m
1808
- }, 8 + a.length * 2), x;
1764
+ children: d
1765
+ }, 8 + a.length * 2), y;
1809
1766
  }
1810
1767
  /**
1811
1768
  * Draw arrows connecting sequential positions (e.g., output of boxRow/boxColumn).
@@ -1888,9 +1845,46 @@ class sa {
1888
1845
  return { elements: this.elements, durationInFrames: a };
1889
1846
  }
1890
1847
  }
1891
- class ca {
1848
+ const ga = {
1849
+ foreground: "#c8d6e5",
1850
+ background: "#0a0a1e",
1851
+ title: "#e0e7ff",
1852
+ subtitle: "#94a3b8",
1853
+ primary: "#4fc3f7",
1854
+ secondary: "#a78bfa",
1855
+ tertiary: "#f472b6",
1856
+ muted: "#64748b",
1857
+ surface: "#1e293b",
1858
+ border: "#334155",
1859
+ accent: "#4fc3f7",
1860
+ success: "#34d399",
1861
+ warning: "#fbbf24",
1862
+ error: "#f87171",
1863
+ boxFill: "rgba(79,195,247,0.12)",
1864
+ boxStroke: "#4fc3f7",
1865
+ palette: ["#4fc3f7", "#a78bfa", "#f472b6", "#34d399", "#fbbf24", "#fb923c", "#6366f1", "#22d3ee"]
1866
+ }, va = {
1867
+ foreground: "#334155",
1868
+ background: "#f8fafc",
1869
+ title: "#1e293b",
1870
+ subtitle: "#64748b",
1871
+ primary: "#2563eb",
1872
+ secondary: "#7c3aed",
1873
+ tertiary: "#db2777",
1874
+ muted: "#94a3b8",
1875
+ surface: "#ffffff",
1876
+ border: "#e2e8f0",
1877
+ accent: "#2563eb",
1878
+ success: "#16a34a",
1879
+ warning: "#d97706",
1880
+ error: "#dc2626",
1881
+ boxFill: "rgba(37,99,235,0.08)",
1882
+ boxStroke: "#2563eb",
1883
+ palette: ["#2563eb", "#7c3aed", "#db2777", "#16a34a", "#d97706", "#ea580c", "#4f46e5", "#0891b2"]
1884
+ };
1885
+ class oa {
1892
1886
  constructor(a, t, r) {
1893
- this._slides = [], this._title = a, this._theme = t ?? he, this._opts = {
1887
+ this._slides = [], this._title = a, this._theme = t ?? ga, this._opts = {
1894
1888
  width: 900,
1895
1889
  height: 640,
1896
1890
  fps: 30,
@@ -1908,7 +1902,7 @@ class ca {
1908
1902
  /** Build the final ElucimDocument */
1909
1903
  build() {
1910
1904
  const a = this._slides.map((r) => {
1911
- const i = new sa(
1905
+ const i = new fa(
1912
1906
  this._theme,
1913
1907
  this._opts.fps,
1914
1908
  this._opts.width,
@@ -1954,31 +1948,36 @@ class ca {
1954
1948
  return JSON.stringify(this.build(), null, a ? 2 : void 0);
1955
1949
  }
1956
1950
  }
1957
- function ya(e, a, t) {
1958
- return new ca(e, a, t);
1951
+ function ka(e, a, t) {
1952
+ return new oa(e, a, t);
1959
1953
  }
1960
1954
  export {
1961
- ga as DslRenderer,
1962
- ca as PresentationBuilder,
1963
- ce as SEMANTIC_TOKENS,
1964
- sa as SlideBuilder,
1965
- oa as TOKEN_NAMES,
1966
- mt as compileExpression,
1967
- yt as compileVectorExpression,
1968
- he as darkTheme,
1969
- Kt as lightTheme,
1970
- ya as presentation,
1971
- v as renderElement,
1972
- ue as renderPlayer,
1973
- Gt as renderPresentation,
1974
- le as renderRoot,
1975
- H as renderScene,
1976
- Ht as renderSlide,
1977
- ma as renderToPng,
1978
- ra as renderToSvgString,
1979
- u as resolveColor,
1980
- o as resolveEasing,
1981
- te as stripCssFunctions,
1982
- re as validate,
1983
- ae as validateExpression
1955
+ $a as DARK_THEME,
1956
+ Ca as DARK_THEME_VARS,
1957
+ da as DslRenderer,
1958
+ Oa as LIGHT_THEME,
1959
+ Aa as LIGHT_THEME_VARS,
1960
+ oa as PresentationBuilder,
1961
+ pa as SEMANTIC_TOKENS,
1962
+ fa as SlideBuilder,
1963
+ za as TOKEN_NAMES,
1964
+ It as compileExpression,
1965
+ St as compileVectorExpression,
1966
+ ga as darkTheme,
1967
+ va as lightTheme,
1968
+ ka as presentation,
1969
+ w as renderElement,
1970
+ oe as renderPlayer,
1971
+ ea as renderPresentation,
1972
+ ge as renderRoot,
1973
+ J as renderScene,
1974
+ ta as renderSlide,
1975
+ wa as renderToPng,
1976
+ la as renderToSvgString,
1977
+ Ea as resolveColor,
1978
+ f as resolveEasing,
1979
+ se as stripCssFunctions,
1980
+ Ra as themeToVars,
1981
+ le as validate,
1982
+ ce as validateExpression
1984
1983
  };