@praeko/studio-kit 0.1.0 → 0.2.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.
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- // src/pecas.tsx
1
+ // src/parts.tsx
2
2
  import { Loop, OffthreadVideo, interpolate, spring, staticFile, useCurrentFrame, useVideoConfig, Img, AbsoluteFill } from "remotion";
3
- import { FPS, pop, ramp, rgba, surge, useTema } from "@praeko/studio-core";
3
+ import { FPS, appear, pop, ramp, rgba, useTheme } from "@praeko/studio-core";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
- var PainelD = ({ titulo, dur, children }) => {
6
- const { destaque: LAMP, texto: INK, fonte: FONT } = useTema();
5
+ var Panel = ({ title, dur, children }) => {
6
+ const { accent: LAMP, text: INK, font: FONT } = useTheme();
7
7
  const frame = useCurrentFrame();
8
8
  const { fps } = useVideoConfig();
9
9
  const pop3 = spring({ frame, fps, config: { damping: 13, stiffness: 190 } });
@@ -32,68 +32,71 @@ var PainelD = ({ titulo, dur, children }) => {
32
32
  boxSizing: "border-box"
33
33
  },
34
34
  children: [
35
- /* @__PURE__ */ jsx("div", { style: { fontSize: 38, letterSpacing: 5, color: LAMP, whiteSpace: "nowrap" }, children: titulo }),
35
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 38, letterSpacing: 5, color: LAMP, whiteSpace: "nowrap" }, children: title }),
36
36
  /* @__PURE__ */ jsx("div", { style: { flex: 1, display: "flex", flexDirection: "column", justifyContent: "center", gap: 40, minHeight: 0 }, children })
37
37
  ]
38
38
  }
39
39
  );
40
40
  };
41
- var Caixa = ({ t, q, cor: cor4, children, mono, size = 48, dim, dash }) => {
42
- const { caixa: CAIXA, texto: INK, fonte: FONT, mono: MONO } = useTema();
43
- return /* @__PURE__ */ jsx("div", { style: { background: CAIXA, border: `4px ${dash ? "dashed" : "solid"} ${cor4}`, borderRadius: 22, padding: "18px 28px", fontFamily: mono ? MONO : FONT, fontSize: size, textAlign: "center", whiteSpace: "nowrap", color: INK, opacity: surge(t, q) * (dim ? 0.55 : 1), translate: `0px ${(1 - surge(t, q)) * 30}px` }, children });
41
+ var Box = ({ t, q, color: color2, children, mono, size = 48, dim, dash }) => {
42
+ const { box: BOX, text: INK, font: FONT, mono: MONO } = useTheme();
43
+ return /* @__PURE__ */ jsx("div", { style: { background: BOX, border: `4px ${dash ? "dashed" : "solid"} ${color2}`, borderRadius: 22, padding: "18px 28px", fontFamily: mono ? MONO : FONT, fontSize: size, textAlign: "center", whiteSpace: "nowrap", color: INK, opacity: appear(t, q) * (dim ? 0.55 : 1), translate: `0px ${(1 - appear(t, q)) * 30}px` }, children });
44
44
  };
45
- var Linha = ({ t, q, cor: cor4, size = 46, children }) => {
46
- const { caixa: CAIXA, texto: INK, fonte: FONT, destaque: LAMP } = useTema();
47
- return /* @__PURE__ */ jsx("div", { style: { background: CAIXA, border: `4px solid ${cor4 ?? LAMP}`, borderRadius: 24, padding: "22px 30px", fontSize: size, opacity: surge(t, q), translate: `${(1 - surge(t, q)) * 70}px 0px`, whiteSpace: "nowrap", display: "flex", alignItems: "center", gap: 22, fontFamily: FONT, color: INK }, children });
45
+ var Line = ({ t, q, color: color2, size = 46, children }) => {
46
+ const { box: BOX, text: INK, font: FONT, accent: LAMP } = useTheme();
47
+ return /* @__PURE__ */ jsx("div", { style: { background: BOX, border: `4px solid ${color2 ?? LAMP}`, borderRadius: 24, padding: "22px 30px", fontSize: size, opacity: appear(t, q), translate: `${(1 - appear(t, q)) * 70}px 0px`, whiteSpace: "nowrap", display: "flex", alignItems: "center", gap: 22, fontFamily: FONT, color: INK }, children });
48
48
  };
49
- var Big = ({ t, q, cor: cor4, size, mono, children }) => {
50
- const { texto: INK, fonte: FONT, mono: MONO } = useTema();
51
- return /* @__PURE__ */ jsx("div", { style: { fontFamily: mono ? MONO : FONT, fontSize: size, fontWeight: 900, color: cor4 ?? INK, textAlign: "center", lineHeight: 1.05, opacity: surge(t, q, 0.25), scale: String(pop(t, q)), whiteSpace: "nowrap" }, children });
49
+ var Big = ({ t, q, color: color2, size, mono, children }) => {
50
+ const { text: INK, font: FONT, mono: MONO } = useTheme();
51
+ return /* @__PURE__ */ jsx("div", { style: { fontFamily: mono ? MONO : FONT, fontSize: size, fontWeight: 900, color: color2 ?? INK, textAlign: "center", lineHeight: 1.05, opacity: appear(t, q, 0.25), scale: String(pop(t, q)), whiteSpace: "nowrap" }, children });
52
52
  };
53
- var Balao = ({ t, q, cor: cor4, children, autor = "\u2014 um jogador, no chat" }) => {
54
- const { caixa: CAIXA, texto: INK, fonte: FONT, mono: MONO, suave: MUTED } = useTema();
55
- return /* @__PURE__ */ jsxs("div", { style: { position: "relative", background: CAIXA, border: `4px solid ${cor4}`, borderRadius: 28, padding: "28px 34px", fontFamily: FONT, fontSize: 46, lineHeight: 1.25, color: INK, textAlign: "center", opacity: surge(t, q), translate: `0px ${(1 - surge(t, q)) * 30}px` }, children: [
56
- /* @__PURE__ */ jsx("span", { style: { position: "absolute", left: 24, top: -34, fontSize: 90, color: cor4, lineHeight: 1 }, children: "\u201C" }),
53
+ var Bubble = ({ t, q, color: color2, children, author = "\u2014 someone, in the chat" }) => {
54
+ const { box: BOX, text: INK, font: FONT, mono: MONO, muted: MUTED } = useTheme();
55
+ return /* @__PURE__ */ jsxs("div", { style: { position: "relative", background: BOX, border: `4px solid ${color2}`, borderRadius: 28, padding: "28px 34px", fontFamily: FONT, fontSize: 46, lineHeight: 1.25, color: INK, textAlign: "center", opacity: appear(t, q), translate: `0px ${(1 - appear(t, q)) * 30}px` }, children: [
56
+ /* @__PURE__ */ jsx("span", { style: { position: "absolute", left: 24, top: -34, fontSize: 90, color: color2, lineHeight: 1 }, children: "\u201C" }),
57
57
  children,
58
- /* @__PURE__ */ jsx("div", { style: { fontFamily: MONO, fontSize: 26, color: MUTED, marginTop: 16 }, children: autor })
58
+ /* @__PURE__ */ jsx("div", { style: { fontFamily: MONO, fontSize: 26, color: MUTED, marginTop: 16 }, children: author })
59
59
  ] });
60
60
  };
61
- var Codigo = ({ t, q, titulo, cor: cor4, linhas }) => {
62
- const { caixa: CAIXA, texto: INK, mono: MONO } = useTema();
63
- return /* @__PURE__ */ jsxs("div", { style: { background: CAIXA, borderRadius: 24, overflow: "hidden", border: `4px solid ${cor4}`, opacity: surge(t, q), translate: `0px ${(1 - surge(t, q)) * 30}px` }, children: [
64
- /* @__PURE__ */ jsx("div", { style: { background: "#1c1830", padding: "12px 26px", fontFamily: MONO, fontSize: 26, color: "#8b86a8", whiteSpace: "nowrap" }, children: titulo }),
65
- /* @__PURE__ */ jsx("div", { style: { fontFamily: MONO, fontSize: 30, lineHeight: 1.6, padding: "20px 0" }, children: linhas.map((l, i) => /* @__PURE__ */ jsx("div", { style: { whiteSpace: "pre", padding: "0 26px", color: l.cor || INK, background: l.marca ? `${l.cor}26` : "transparent", borderLeft: `6px solid ${l.marca ? l.cor : "transparent"}` }, children: l.s }, i)) })
61
+ var Code = ({ t, q, title, color: color2, lines }) => {
62
+ const { box: BOX, text: INK, mono: MONO } = useTheme();
63
+ return /* @__PURE__ */ jsxs("div", { style: { background: BOX, borderRadius: 24, overflow: "hidden", border: `4px solid ${color2}`, opacity: appear(t, q), translate: `0px ${(1 - appear(t, q)) * 30}px` }, children: [
64
+ /* @__PURE__ */ jsx("div", { style: { background: "#1c1830", padding: "12px 26px", fontFamily: MONO, fontSize: 26, color: "#8b86a8", whiteSpace: "nowrap" }, children: title }),
65
+ /* @__PURE__ */ jsx("div", { style: { fontFamily: MONO, fontSize: 30, lineHeight: 1.6, padding: "20px 0" }, children: lines.map((l, i) => /* @__PURE__ */ jsx("div", { style: { whiteSpace: "pre", padding: "0 26px", color: l.color || INK, background: l.mark ? `${l.color}26` : "transparent", borderLeft: `6px solid ${l.mark ? l.color : "transparent"}` }, children: l.s }, i)) })
66
66
  ] });
67
67
  };
68
- var Janela = ({ t, q, src, duracao, de, left, top, w, reg = [0, 0, 1920, 1080], tag = "CENA REAL DO JOGO", dur }) => {
69
- const { destaque: LAMP, texto: INK, erro: RUIM, mono: MONO } = useTema();
70
- const s = w / reg[2], h = w * reg[3] / reg[2], o = surge(t, q, 0.5);
68
+ var Window = ({ t, q, src, clipDuration, from, left, top, w, reg = [0, 0, 1920, 1080], tag = "REAL FOOTAGE", dur }) => {
69
+ const { accent: LAMP, text: INK, error: BAD, mono: MONO } = useTheme();
70
+ const s = w / reg[2], h = w * reg[3] / reg[2], o = appear(t, q, 0.5);
71
71
  const push = 1 + 0.07 * ramp(t, q, q + dur);
72
- const total = duracao - de;
72
+ const total = clipDuration - from;
73
73
  return /* @__PURE__ */ jsxs("div", { style: { position: "absolute", left, top, width: w, height: h, borderRadius: 26, overflow: "hidden", border: `4px solid ${LAMP}`, boxShadow: `0 0 70px ${rgba(LAMP, 0.25)}, 0 24px 60px rgba(0,0,0,.6)`, opacity: o, translate: `0px ${(1 - o) * 40}px`, background: "#0b0b10" }, children: [
74
- /* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: 0, scale: String(push), transformOrigin: "50% 60%" }, children: /* @__PURE__ */ jsx(Loop, { durationInFrames: Math.round(total * FPS), children: /* @__PURE__ */ jsx(OffthreadVideo, { src: staticFile(src), startFrom: Math.round(de * FPS), muted: true, style: { position: "absolute", left: -reg[0] * s, top: -reg[1] * s, width: 1920 * s, height: 1080 * s, imageRendering: "pixelated" } }) }) }),
74
+ /* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: 0, scale: String(push), transformOrigin: "50% 60%" }, children: /* @__PURE__ */ jsx(Loop, { durationInFrames: Math.round(total * FPS), children: /* @__PURE__ */ jsx(OffthreadVideo, { src: staticFile(src), startFrom: Math.round(from * FPS), muted: true, style: { position: "absolute", left: -reg[0] * s, top: -reg[1] * s, width: 1920 * s, height: 1080 * s, imageRendering: "pixelated" } }) }) }),
75
75
  /* @__PURE__ */ jsxs("div", { style: { position: "absolute", left: 14, bottom: 12, background: "rgba(10,8,6,.78)", color: INK, fontFamily: MONO, fontSize: 22, padding: "4px 14px", borderRadius: 10, display: "flex", gap: 10, alignItems: "center" }, children: [
76
- /* @__PURE__ */ jsx("span", { style: { width: 12, height: 12, borderRadius: 6, background: RUIM, opacity: 0.5 + 0.5 * Math.abs(Math.sin(t * 4)) } }),
76
+ /* @__PURE__ */ jsx("span", { style: { width: 12, height: 12, borderRadius: 6, background: BAD, opacity: 0.5 + 0.5 * Math.abs(Math.sin(t * 4)) } }),
77
77
  tag
78
78
  ] })
79
79
  ] });
80
80
  };
81
- var Celular = ({ t, q, src, duracao, de, left, top, w, dur }) => {
82
- const { destaque: LAMP } = useTema();
83
- const h = w * 1920 / 1080, o = surge(t, q, 0.5);
84
- return /* @__PURE__ */ jsx("div", { style: { position: "absolute", left, top, width: w, height: h, borderRadius: 46, border: "10px solid #0b0b10", outline: `3px solid ${LAMP}`, overflow: "hidden", boxShadow: `0 0 70px ${rgba(LAMP, 0.22)}, 0 24px 60px rgba(0,0,0,.6)`, opacity: o, translate: `0px ${(1 - o) * 50}px`, background: "#0b0b10", scale: String(0.96 + 0.04 * ramp(t, q, q + dur)) }, children: /* @__PURE__ */ jsx(Loop, { durationInFrames: Math.round((duracao - de) * FPS), children: /* @__PURE__ */ jsx(OffthreadVideo, { src: staticFile(src), startFrom: Math.round(de * FPS), muted: true, style: { width: "100%", height: "100%", objectFit: "cover" } }) }) });
81
+ var Phone = ({ t, q, src, clipDuration, from, left, top, w, dur }) => {
82
+ const { accent: LAMP } = useTheme();
83
+ const h = w * 1920 / 1080, o = appear(t, q, 0.5);
84
+ return /* @__PURE__ */ jsx("div", { style: { position: "absolute", left, top, width: w, height: h, borderRadius: 46, border: "10px solid #0b0b10", outline: `3px solid ${LAMP}`, overflow: "hidden", boxShadow: `0 0 70px ${rgba(LAMP, 0.22)}, 0 24px 60px rgba(0,0,0,.6)`, opacity: o, translate: `0px ${(1 - o) * 50}px`, background: "#0b0b10", scale: String(0.96 + 0.04 * ramp(t, q, q + dur)) }, children: /* @__PURE__ */ jsx(Loop, { durationInFrames: Math.round((clipDuration - from) * FPS), children: /* @__PURE__ */ jsx(OffthreadVideo, { src: staticFile(src), startFrom: Math.round(from * FPS), muted: true, style: { width: "100%", height: "100%", objectFit: "cover" } }) }) });
85
85
  };
86
- var Gato = ({ nome, tam = 220 }) => /* @__PURE__ */ jsx("div", { style: { background: "#1c1830", border: "6px solid #3a3358", borderRadius: 30, padding: 12 }, children: /* @__PURE__ */ jsx(Img, { src: staticFile(`gatos/gato-${nome}.png`), style: { width: tam, height: tam, imageRendering: "pixelated" } }) });
87
- var Moldura = ({ glow, titulo, cor: cor4, children, tam = 130 }) => {
88
- const { fundoCapa: BG, texto: INK, destaque: LAMP, fonte: FONT, handle } = useTema();
86
+ var Mascot = ({ name, size = 220, path }) => {
87
+ const { mascotPath } = useTheme();
88
+ return /* @__PURE__ */ jsx("div", { style: { background: "#1c1830", border: "6px solid #3a3358", borderRadius: 30, padding: 12 }, children: /* @__PURE__ */ jsx(Img, { src: staticFile(path ?? (mascotPath ?? "mascots/{name}.png").replace("{name}", name)), style: { width: size, height: size, imageRendering: "pixelated" } }) });
89
+ };
90
+ var Frame = ({ glow, title, color: color2, children, size = 130 }) => {
91
+ const { coverBackground: BG, text: INK, accent: LAMP, font: FONT, handle } = useTheme();
89
92
  return /* @__PURE__ */ jsxs(AbsoluteFill, { style: { background: `radial-gradient(ellipse at 50% 44%, ${glow} 0%, rgba(0,0,0,0) 56%), ${BG}`, alignItems: "center", fontFamily: FONT, textAlign: "center" }, children: [
90
- /* @__PURE__ */ jsxs("div", { style: { marginTop: 350, fontSize: tam, fontWeight: 900, color: INK, lineHeight: 1.02, textShadow: "0 8px 0 #000", whiteSpace: "nowrap" }, children: [
91
- titulo[0],
93
+ /* @__PURE__ */ jsxs("div", { style: { marginTop: 350, fontSize: size, fontWeight: 900, color: INK, lineHeight: 1.02, textShadow: "0 8px 0 #000", whiteSpace: "nowrap" }, children: [
94
+ title[0],
92
95
  /* @__PURE__ */ jsx("br", {}),
93
- /* @__PURE__ */ jsx("span", { style: { color: cor4 }, children: titulo[1] }),
94
- titulo[2] ? /* @__PURE__ */ jsxs(Fragment, { children: [
96
+ /* @__PURE__ */ jsx("span", { style: { color: color2 }, children: title[1] }),
97
+ title[2] ? /* @__PURE__ */ jsxs(Fragment, { children: [
95
98
  /* @__PURE__ */ jsx("br", {}),
96
- titulo[2]
99
+ title[2]
97
100
  ] }) : null
98
101
  ] }),
99
102
  /* @__PURE__ */ jsx("div", { style: { marginTop: 130, display: "flex", flexDirection: "column", alignItems: "center", width: 1e3, transform: "scale(1.16)", transformOrigin: "top center" }, children }),
@@ -101,391 +104,400 @@ var Moldura = ({ glow, titulo, cor: cor4, children, tam = 130 }) => {
101
104
  ] });
102
105
  };
103
106
 
104
- // src/declarativo.tsx
107
+ // src/declarative.tsx
105
108
  import { Composition, Still, useCurrentFrame as useCurrentFrame2 } from "remotion";
106
- import { Episodio, FPS as FPS2, TemaProvider, mkAt, pop as pop2, ramp as ramp2, surge as surge2, useTema as useTema2 } from "@praeko/studio-core";
109
+ import { Episode, FPS as FPS2, ThemeProvider, makeAt, pop as pop2, ramp as ramp2, appear as appear2, useTheme as useTheme2 } from "@praeko/studio-core";
110
+
111
+ // src/color.ts
112
+ var resolveColor = (theme, name) => {
113
+ if (!name) return void 0;
114
+ if (name.startsWith("#")) return name;
115
+ const value = theme[name];
116
+ return value ?? name;
117
+ };
118
+
119
+ // src/declarative.tsx
107
120
  import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
108
- var cor = (T, c) => c ? T[c] && !c.startsWith("#") ? T[c] : c : void 0;
109
- var estilo = (it, base = {}) => {
121
+ var style = (it, base = {}) => {
110
122
  const p = it.pos;
111
123
  return p ? { position: "absolute", left: p.left, right: p.right, top: p.top, bottom: p.bottom, width: p.w, height: p.h, ...base } : base;
112
124
  };
113
- var alinhar = { centro: "center", inicio: "flex-start", fim: "flex-end", esticar: "stretch" };
114
- var Texto = ({ it, t }) => {
115
- const T = useTema2();
116
- const q = it.em ?? 0.3, linhas = String(it.texto).split("\n");
125
+ var alignMap = { center: "center", start: "flex-start", end: "flex-end", stretch: "stretch" };
126
+ var TextItem = ({ it, t }) => {
127
+ const T = useTheme2();
128
+ const q = it.at ?? 0.3, lines = String(it.text).split("\n");
117
129
  const base = {
118
- ...it.fonte ? { fontFamily: it.fonte === "mono" ? T.mono : T.fonte } : {},
119
- fontSize: it.tamanho ?? 40,
120
- color: cor(T, it.cor) ?? T.texto,
121
- ...it.alinhar === "esquerda" ? { textAlign: "left" } : { textAlign: "center" },
122
- ...it.semFade ? {} : { opacity: surge2(t, q) },
123
- ...it.altura ? { lineHeight: it.altura } : {},
124
- ...it.peso ? { fontWeight: it.peso } : {},
130
+ ...it.font ? { fontFamily: it.font === "mono" ? T.mono : T.font } : {},
131
+ fontSize: it.size ?? 40,
132
+ color: resolveColor(T, it.color) ?? T.text,
133
+ ...it.align === "left" ? { textAlign: "left" } : { textAlign: "center" },
134
+ ...it.noFade ? {} : { opacity: appear2(t, q) },
135
+ ...it.lineHeight ? { lineHeight: it.lineHeight } : {},
136
+ ...it.weight ? { fontWeight: it.weight } : {},
125
137
  ...it.pop ? { scale: String(pop2(t, q)) } : {},
126
- ...it.semQuebra ? { whiteSpace: "nowrap" } : {}
138
+ ...it.noWrap ? { whiteSpace: "nowrap" } : {}
127
139
  };
128
- return /* @__PURE__ */ jsx2("div", { style: estilo(it, base), children: linhas.map((l, i) => /* @__PURE__ */ jsxs2("span", { children: [
140
+ return /* @__PURE__ */ jsx2("div", { style: style(it, base), children: lines.map((l, i) => /* @__PURE__ */ jsxs2("span", { children: [
129
141
  l,
130
- i < linhas.length - 1 ? /* @__PURE__ */ jsx2("br", {}) : null
142
+ i < lines.length - 1 ? /* @__PURE__ */ jsx2("br", {}) : null
131
143
  ] }, i)) });
132
144
  };
133
- var Barra = ({ it, t }) => {
134
- const T = useTema2();
135
- const q = it.em ?? 0.3, pr = it.preenche ?? {}, de = pr.de ?? 0, ate = pr.ate ?? 1;
136
- const p = pr.duracao ? de + (ate - de) * ramp2(t, pr.inicio ?? q, (pr.inicio ?? q) + pr.duracao) : ate;
137
- const g = (it.gradiente ?? [T.erro, T.erro]).map((c) => {
145
+ var BarItem = ({ it, t }) => {
146
+ const T = useTheme2();
147
+ const q = it.at ?? 0.3, pr = it.fill ?? {}, from = pr.from ?? 0, to = pr.to ?? 1;
148
+ const p = pr.duration ? from + (to - from) * ramp2(t, pr.start ?? q, (pr.start ?? q) + pr.duration) : to;
149
+ const g = (it.gradient ?? [T.error, T.error]).map((c) => {
138
150
  const [n, ...r] = String(c).split(" ");
139
- return [cor(T, n), ...r].join(" ");
151
+ return [resolveColor(T, n), ...r].join(" ");
140
152
  });
141
- const fim = it.brilhoAoFim && p > 0.98;
142
- const dentro = { width: `${p * 100}%`, height: "100%", background: it.gradienteAngulo === false ? g[0] : `linear-gradient(90deg, ${g.join(", ")})` };
143
- return /* @__PURE__ */ jsx2("div", { style: estilo(it, { height: it.altura ?? 40, borderRadius: it.raio ?? 14, background: it.fundo ?? "#1d1812", ...it.borda === false ? {} : { border: `${it.borda ?? 3}px solid #3a2f22` }, overflow: "hidden", ...it.semFade ? {} : { opacity: surge2(t, q) }, ...fim ? { boxShadow: `0 0 40px ${cor(T, it.brilhoAoFim)}` } : {} }), children: /* @__PURE__ */ jsx2("div", { style: dentro }) });
144
- };
145
- var Barras = ({ it, t }) => {
146
- const T = useTema2();
147
- const q0 = it.em ?? 0.3;
148
- return /* @__PURE__ */ jsx2("div", { style: estilo(it, { display: "flex", flexDirection: "column", gap: it.gap ?? 16 }), children: it.linhas.map((l, i) => {
149
- const q = q0 + i * (it.passo ?? 0.5);
150
- return /* @__PURE__ */ jsxs2("div", { style: { display: "flex", alignItems: "center", gap: 18, opacity: surge2(t, q) }, children: [
151
- /* @__PURE__ */ jsx2("div", { style: { width: it.larguraRotulo ?? 190, fontFamily: T.mono, fontSize: 30, color: T.suave, whiteSpace: "nowrap" }, children: l.rotulo }),
152
- /* @__PURE__ */ jsx2("div", { style: { height: 34, width: (it.larguraMax ?? 640) * (l.valor / it.max) * ramp2(t, q, q + 0.9), borderRadius: 10, background: `linear-gradient(90deg, #b9453a, ${cor(T, it.cor) ?? T.erro})` } }),
153
- /* @__PURE__ */ jsx2("div", { style: { fontFamily: T.mono, fontSize: 30, color: cor(T, it.cor) ?? T.erro, fontWeight: 900 }, children: l.texto })
153
+ const end = it.glowAtEnd && p > 0.98;
154
+ const inner = { width: `${p * 100}%`, height: "100%", background: it.gradientAngle === false ? g[0] : `linear-gradient(90deg, ${g.join(", ")})` };
155
+ return /* @__PURE__ */ jsx2("div", { style: style(it, { height: it.height ?? 40, borderRadius: it.radius ?? 14, background: it.background ?? "#1d1812", ...it.border === false ? {} : { border: `${it.border ?? 3}px solid #3a2f22` }, overflow: "hidden", ...it.noFade ? {} : { opacity: appear2(t, q) }, ...end ? { boxShadow: `0 0 40px ${resolveColor(T, it.glowAtEnd)}` } : {} }), children: /* @__PURE__ */ jsx2("div", { style: inner }) });
156
+ };
157
+ var BarsItem = ({ it, t }) => {
158
+ const T = useTheme2();
159
+ const q0 = it.at ?? 0.3;
160
+ return /* @__PURE__ */ jsx2("div", { style: style(it, { display: "flex", flexDirection: "column", gap: it.gap ?? 16 }), children: it.lines.map((l, i) => {
161
+ const q = q0 + i * (it.step ?? 0.5);
162
+ return /* @__PURE__ */ jsxs2("div", { style: { display: "flex", alignItems: "center", gap: 18, opacity: appear2(t, q) }, children: [
163
+ /* @__PURE__ */ jsx2("div", { style: { width: it.labelWidth ?? 190, fontFamily: T.mono, fontSize: 30, color: T.muted, whiteSpace: "nowrap" }, children: l.label }),
164
+ /* @__PURE__ */ jsx2("div", { style: { height: 34, width: (it.maxWidth ?? 640) * (l.value / it.max) * ramp2(t, q, q + 0.9), borderRadius: 10, background: `linear-gradient(90deg, #b9453a, ${resolveColor(T, it.color) ?? T.error})` } }),
165
+ /* @__PURE__ */ jsx2("div", { style: { fontFamily: T.mono, fontSize: 30, color: resolveColor(T, it.color) ?? T.error, fontWeight: 900 }, children: l.text })
154
166
  ] }, i);
155
167
  }) });
156
168
  };
157
169
  var Render = ({ it, t, dur }) => {
158
- const T = useTema2();
159
- const q = it.em ?? 0.3;
160
- const filhos = it.itens?.map((f, i) => /* @__PURE__ */ jsx2(Render, { it: f, t, dur }, i));
161
- switch (it.tipo) {
162
- case "texto":
163
- return /* @__PURE__ */ jsx2(Texto, { it, t });
170
+ const T = useTheme2();
171
+ const q = it.at ?? 0.3;
172
+ const children = it.items?.map((f, i) => /* @__PURE__ */ jsx2(Render, { it: f, t, dur }, i));
173
+ switch (it.type) {
174
+ case "text":
175
+ return /* @__PURE__ */ jsx2(TextItem, { it, t });
164
176
  case "big":
165
- return /* @__PURE__ */ jsx2("div", { style: estilo(it, it.pos ? { display: "flex", justifyContent: "center" } : {}), children: /* @__PURE__ */ jsx2(Big, { t, q, cor: cor(T, it.cor), size: it.tamanho, mono: it.mono, children: it.texto }) });
166
- case "caixa":
167
- return /* @__PURE__ */ jsx2(Caixa, { t, q, cor: cor(T, it.cor) ?? T.destaque, size: it.tamanho, mono: it.mono, dim: it.apagada, dash: it.tracejada, children: it.texto });
168
- case "linha":
169
- return /* @__PURE__ */ jsx2(Linha, { t, q, cor: cor(T, it.cor), size: it.tamanho, children: it.partes.map((p, i) => /* @__PURE__ */ jsx2("span", { style: { ...p.mono ? { fontFamily: T.mono } : {}, ...p.cor ? { color: cor(T, p.cor) } : {}, ...p.peso ? { fontWeight: p.peso } : {} }, children: p.texto }, i)) });
170
- case "balao":
171
- return /* @__PURE__ */ jsx2(Balao, { t, q, cor: cor(T, it.cor) ?? T.info, autor: it.autor, children: it.texto });
172
- case "codigo":
173
- return /* @__PURE__ */ jsx2(Codigo, { t, q, titulo: it.titulo, cor: cor(T, it.cor) ?? T.erro, linhas: it.linhas.map((l) => ({ ...l, cor: cor(T, l.cor) })) });
174
- case "janela":
175
- return /* @__PURE__ */ jsx2(Janela, { t, q, src: it.src, duracao: it.duracaoClipe, de: it.de ?? 0, left: it.pos.left, top: it.pos.top, w: it.pos.w, reg: it.reg, tag: it.tag, dur });
176
- case "celular":
177
- return /* @__PURE__ */ jsx2(Celular, { t, q, src: it.src, duracao: it.duracaoClipe, de: it.de ?? 0, left: it.pos.left, top: it.pos.top, w: it.pos.w, dur });
178
- case "barra":
179
- return /* @__PURE__ */ jsx2(Barra, { it, t });
180
- case "barras":
181
- return /* @__PURE__ */ jsx2(Barras, { it, t });
182
- case "pilha":
183
- return /* @__PURE__ */ jsx2("div", { style: estilo(it, { display: "flex", flexDirection: "column", gap: it.gap ?? 20, alignItems: alinhar[it.alinhar ?? "esticar"] }), children: filhos });
184
- case "fila":
185
- return /* @__PURE__ */ jsx2("div", { style: estilo(it, it.espalhar ? { display: "flex", justifyContent: "space-between" } : it.centrar === false ? { display: "flex", gap: it.gap ?? 20 } : { display: "flex", justifyContent: "center", alignItems: "center", gap: it.gap ?? 20, whiteSpace: "nowrap" }), children: filhos });
186
- case "cartao": {
187
- const o = surge2(t, q);
188
- return /* @__PURE__ */ jsx2("div", { style: estilo(it, { background: T.caixa, border: `4px solid ${cor(T, it.cor) ?? T.destaque}`, borderRadius: 24, padding: "20px 24px", fontFamily: T.mono, fontSize: it.tamanho ?? 40, color: T.texto, opacity: o, translate: `${(1 - o) * 60}px 0px` }), children: it.linhas.map((l, i) => /* @__PURE__ */ jsxs2("span", { children: [
189
- l.map((p, k) => /* @__PURE__ */ jsx2("span", { style: { ...p.cor ? { color: cor(T, p.cor) } : {}, ...p.peso ? { fontWeight: p.peso } : {} }, children: p.texto }, k)),
190
- i < it.linhas.length - 1 ? /* @__PURE__ */ jsx2("br", {}) : null
177
+ return /* @__PURE__ */ jsx2("div", { style: style(it, it.pos ? { display: "flex", justifyContent: "center" } : {}), children: /* @__PURE__ */ jsx2(Big, { t, q, color: resolveColor(T, it.color), size: it.size, mono: it.mono, children: it.text }) });
178
+ case "box":
179
+ return /* @__PURE__ */ jsx2(Box, { t, q, color: resolveColor(T, it.color) ?? T.accent, size: it.size, mono: it.mono, dim: it.dim, dash: it.dashed, children: it.text });
180
+ case "line":
181
+ return /* @__PURE__ */ jsx2(Line, { t, q, color: resolveColor(T, it.color), size: it.size, children: it.parts.map((p, i) => /* @__PURE__ */ jsx2("span", { style: { ...p.mono ? { fontFamily: T.mono } : {}, ...p.color ? { color: resolveColor(T, p.color) } : {}, ...p.weight ? { fontWeight: p.weight } : {} }, children: p.text }, i)) });
182
+ case "bubble":
183
+ return /* @__PURE__ */ jsx2(Bubble, { t, q, color: resolveColor(T, it.color) ?? T.info, author: it.author, children: it.text });
184
+ case "code":
185
+ return /* @__PURE__ */ jsx2(Code, { t, q, title: it.title, color: resolveColor(T, it.color) ?? T.error, lines: it.lines.map((l) => ({ ...l, color: resolveColor(T, l.color) })) });
186
+ case "window":
187
+ return /* @__PURE__ */ jsx2(Window, { t, q, src: it.src, clipDuration: it.clipDuration, from: it.from ?? 0, left: it.pos.left, top: it.pos.top, w: it.pos.w, reg: it.reg, tag: it.tag, dur });
188
+ case "phone":
189
+ return /* @__PURE__ */ jsx2(Phone, { t, q, src: it.src, clipDuration: it.clipDuration, from: it.from ?? 0, left: it.pos.left, top: it.pos.top, w: it.pos.w, dur });
190
+ case "bar":
191
+ return /* @__PURE__ */ jsx2(BarItem, { it, t });
192
+ case "bars":
193
+ return /* @__PURE__ */ jsx2(BarsItem, { it, t });
194
+ case "stack":
195
+ return /* @__PURE__ */ jsx2("div", { style: style(it, { display: "flex", flexDirection: "column", gap: it.gap ?? 20, alignItems: alignMap[it.align ?? "stretch"] }), children });
196
+ case "row":
197
+ return /* @__PURE__ */ jsx2("div", { style: style(it, it.spread ? { display: "flex", justifyContent: "space-between" } : it.center === false ? { display: "flex", gap: it.gap ?? 20 } : { display: "flex", justifyContent: "center", alignItems: "center", gap: it.gap ?? 20, whiteSpace: "nowrap" }), children });
198
+ case "card": {
199
+ const o = appear2(t, q);
200
+ return /* @__PURE__ */ jsx2("div", { style: style(it, { background: T.box, border: `4px solid ${resolveColor(T, it.color) ?? T.accent}`, borderRadius: 24, padding: "20px 24px", fontFamily: T.mono, fontSize: it.size ?? 40, color: T.text, opacity: o, translate: `${(1 - o) * 60}px 0px` }), children: it.lines.map((l, i) => /* @__PURE__ */ jsxs2("span", { children: [
201
+ l.map((p, k) => /* @__PURE__ */ jsx2("span", { style: { ...p.color ? { color: resolveColor(T, p.color) } : {}, ...p.weight ? { fontWeight: p.weight } : {} }, children: p.text }, k)),
202
+ i < it.lines.length - 1 ? /* @__PURE__ */ jsx2("br", {}) : null
191
203
  ] }, i)) });
192
204
  }
193
205
  default:
194
206
  return /* @__PURE__ */ jsxs2("div", { style: { color: "#f00", fontSize: 30 }, children: [
195
- "tipo desconhecido: ",
196
- it.tipo
207
+ "unknown type: ",
208
+ it.type
197
209
  ] });
198
210
  }
199
211
  };
200
- var CenaDecl = ({ spec, painelDur, dur }) => {
212
+ var SceneDecl = ({ spec, panelDur, dur }) => {
201
213
  const t = useCurrentFrame2() / FPS2;
202
- const itens = (spec.itens ?? []).map((it, i) => /* @__PURE__ */ jsx2(Render, { it, t, dur }, i));
203
- if ((spec.layout ?? "painel") === "livre") return /* @__PURE__ */ jsx2(Fragment2, { children: itens });
204
- return /* @__PURE__ */ jsx2(PainelD, { titulo: spec.titulo ?? "", dur: painelDur, children: itens });
214
+ const items = (spec.items ?? []).map((it, i) => /* @__PURE__ */ jsx2(Render, { it, t, dur }, i));
215
+ if ((spec.layout ?? "panel") === "free") return /* @__PURE__ */ jsx2(Fragment2, { children: items });
216
+ return /* @__PURE__ */ jsx2(Panel, { title: spec.title ?? "", dur: panelDur, children: items });
205
217
  };
206
- var resolver = (it, at) => {
218
+ var resolve = (it, at) => {
207
219
  const o = { ...it };
208
- if (it.quando !== void 0) {
209
- const [f, n] = Array.isArray(it.quando) ? it.quando : [it.quando, 0];
210
- o.em = at(f, n) + (it.deslocar ?? 0);
211
- delete o.quando;
220
+ if (it.when !== void 0) {
221
+ const [f, n] = Array.isArray(it.when) ? it.when : [it.when, 0];
222
+ o.at = at(f, n) + (it.offset ?? 0);
223
+ delete o.when;
212
224
  }
213
- if (it.itens) o.itens = it.itens.map((f) => resolver(f, at));
225
+ if (it.items) o.items = it.items.map((f) => resolve(f, at));
214
226
  return o;
215
227
  };
216
- function epDataDeSpec(spec, palavras, pecas = {}) {
217
- const S = spec.cenas.map((c) => c.inicio);
218
- const fimDe = (i) => spec.cenas[i].fim ?? (i + 1 < S.length ? S[i + 1] : spec.fechamento.a);
219
- const A = mkAt(palavras, S);
228
+ function episodeDataFromSpec(spec, words, components = {}) {
229
+ const S = spec.scenes.map((c) => c.start);
230
+ const endOf = (i) => spec.scenes[i].end ?? (i + 1 < S.length ? S[i + 1] : spec.outro.a);
231
+ const A = makeAt(words, S);
220
232
  return {
221
233
  id: spec.id,
222
234
  durS: spec.durS,
223
- legendaPx: spec.legendaPx,
224
- voz: spec.voz,
225
- palavras,
226
- fundoLinhas: spec.fundoLinhas,
227
- golpes: spec.golpes,
228
- fechamento: spec.fechamento,
229
- cenas: spec.cenas.map((c, i) => {
230
- const painelDur = fimDe(i) - c.inicio;
231
- const rs = { ...c, itens: c.itens?.map((it) => resolver(it, (f, n) => A(i)(f, n))) };
235
+ captionPx: spec.captionPx,
236
+ voice: spec.voice,
237
+ words,
238
+ backgroundLines: spec.backgroundLines,
239
+ hits: spec.hits,
240
+ outro: spec.outro,
241
+ scenes: spec.scenes.map((c, i) => {
242
+ const panelDur = endOf(i) - c.start;
243
+ const resolved = { ...c, items: c.items?.map((it) => resolve(it, (f, n) => A(i)(f, n))) };
232
244
  return {
233
- a: c.inicio,
234
- b: i + 1 < S.length ? S[i + 1] - 0.1 : fimDe(i) - 0.1,
235
- rotulo: c.rotulo,
236
- sons: c.sons,
237
- C: c.componente ? pecas[c.componente] ?? (() => /* @__PURE__ */ jsxs2("div", { style: { color: "#f00", fontSize: 40 }, children: [
238
- 'componente "',
239
- c.componente,
240
- '" n\xE3o registrado'
241
- ] })) : ({ dur }) => /* @__PURE__ */ jsx2(CenaDecl, { spec: rs, painelDur, dur })
245
+ a: c.start,
246
+ b: i + 1 < S.length ? S[i + 1] - 0.1 : endOf(i) - 0.1,
247
+ label: c.label,
248
+ sounds: c.sounds,
249
+ C: c.component ? components[c.component] ?? (() => /* @__PURE__ */ jsxs2("div", { style: { color: "#f00", fontSize: 40 }, children: [
250
+ 'component "',
251
+ c.component,
252
+ '" is not registered'
253
+ ] })) : ({ dur }) => /* @__PURE__ */ jsx2(SceneDecl, { spec: resolved, panelDur, dur })
242
254
  };
243
255
  })
244
256
  };
245
257
  }
246
- var CapaDecl = ({ spec }) => {
247
- const T = useTema2();
248
- return /* @__PURE__ */ jsx2(Moldura, { glow: spec.glow ?? "rgba(244,185,66,.16)", titulo: spec.titulo ?? ["", "", ""], cor: cor(T, spec.cor) ?? T.destaque, tam: spec.tam, children: (spec.itens ?? []).map((it, i) => /* @__PURE__ */ jsx2(Render, { it, t: 99, dur: 99 }, i)) });
258
+ var CoverDecl = ({ spec }) => {
259
+ const T = useTheme2();
260
+ return /* @__PURE__ */ jsx2(Frame, { glow: spec.glow ?? "rgba(244,185,66,.16)", title: spec.title ?? ["", "", ""], color: resolveColor(T, spec.color) ?? T.accent, size: spec.size, children: (spec.items ?? []).map((it, i) => /* @__PURE__ */ jsx2(Render, { it, t: 99, dur: 99 }, i)) });
249
261
  };
250
- var EpisodioDecl = ({ spec, palavras, tema, pecas = {} }) => {
251
- const d = epDataDeSpec(spec, palavras, pecas);
252
- const CapaC = spec.capa?.componente ? pecas[spec.capa.componente] : void 0;
262
+ var EpisodeDecl = ({ spec, words, theme, components = {} }) => {
263
+ const d = episodeDataFromSpec(spec, words, components);
264
+ const CoverC = spec.cover?.component ? components[spec.cover.component] : void 0;
253
265
  return /* @__PURE__ */ jsxs2(Fragment2, { children: [
254
- /* @__PURE__ */ jsx2(Composition, { id: spec.id, component: () => /* @__PURE__ */ jsx2(TemaProvider, { tema, children: /* @__PURE__ */ jsx2(Episodio, { d }) }), durationInFrames: Math.round(spec.durS * FPS2), fps: FPS2, width: 1080, height: 1920 }),
255
- spec.capa ? /* @__PURE__ */ jsx2(Still, { id: spec.capa.id, component: () => /* @__PURE__ */ jsx2(TemaProvider, { tema, children: CapaC ? /* @__PURE__ */ jsx2(CapaC, {}) : /* @__PURE__ */ jsx2(CapaDecl, { spec: spec.capa, palavras }) }), width: 1080, height: 1920 }) : null
266
+ /* @__PURE__ */ jsx2(Composition, { id: spec.id, component: () => /* @__PURE__ */ jsx2(ThemeProvider, { theme, children: /* @__PURE__ */ jsx2(Episode, { d }) }), durationInFrames: Math.round(spec.durS * FPS2), fps: FPS2, width: 1080, height: 1920 }),
267
+ spec.cover ? /* @__PURE__ */ jsx2(Still, { id: spec.cover.id, component: () => /* @__PURE__ */ jsx2(ThemeProvider, { theme, children: CoverC ? /* @__PURE__ */ jsx2(CoverC, {}) : /* @__PURE__ */ jsx2(CoverDecl, { spec: spec.cover }) }), width: 1080, height: 1920 }) : null
256
268
  ] });
257
269
  };
258
270
 
259
- // src/longo.tsx
260
- import { useTema as useTema3 } from "@praeko/studio-core";
271
+ // src/long-parts.tsx
272
+ import { useTheme as useTheme3 } from "@praeko/studio-core";
261
273
  import { interpolate as interpolate2 } from "remotion";
262
274
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
263
275
  var clamp = { extrapolateLeft: "clamp", extrapolateRight: "clamp" };
264
- var surgeL = (t, q, d = 0.3) => interpolate2(t, [q, q + d], [0, 1], clamp);
276
+ var appearL = (t, q, d = 0.3) => interpolate2(t, [q, q + d], [0, 1], clamp);
265
277
  var KW = /^(UPDATE|SET|WHERE|AND|INSERT|INTO|SELECT|FROM|CASE|WHEN|THEN|END|AS|VALUES|IS|NOT|NULL|const|await|if)$/;
266
278
  var FN = /^(changes|abs|json_set|json_remove|json_extract)$/;
267
279
  var colorize = (s, c) => s.split(/(--.*$|\/\/.*$|'[^']*'|\b\w+\b)/).map((p, i) => {
268
280
  if (!p) return null;
269
- let cor4 = c.texto;
270
- if (/^(--|\/\/)/.test(p)) cor4 = c.suave;
271
- else if (/^'/.test(p)) cor4 = c.ok;
272
- else if (KW.test(p)) cor4 = c.destaque;
273
- else if (/^\d+$/.test(p)) cor4 = "#7fb4ff";
274
- else if (FN.test(p)) cor4 = c.info;
275
- return /* @__PURE__ */ jsx3("span", { style: { color: cor4 }, children: p }, i);
281
+ let color2 = c.text;
282
+ if (/^(--|\/\/)/.test(p)) color2 = c.muted;
283
+ else if (/^'/.test(p)) color2 = c.ok;
284
+ else if (KW.test(p)) color2 = c.accent;
285
+ else if (/^\d+$/.test(p)) color2 = "#7fb4ff";
286
+ else if (FN.test(p)) color2 = c.info;
287
+ return /* @__PURE__ */ jsx3("span", { style: { color: color2 }, children: p }, i);
276
288
  });
277
- var CodigoL = ({ titulo, lines, t, q, w, size = 32, left, top }) => {
278
- const T = useTema3();
279
- const o = surgeL(t, q);
280
- return /* @__PURE__ */ jsxs3("div", { style: { position: "absolute", left, top, width: w, background: T.codigo, border: `3px solid #3a2f22`, borderRadius: 22, overflow: "hidden", opacity: o, transform: `translateY(${(1 - o) * 24}px)` }, children: [
281
- /* @__PURE__ */ jsx3("div", { style: { background: "#262034", padding: "10px 26px", fontFamily: T.mono, fontSize: 26, color: "#9a95b8", whiteSpace: "nowrap" }, children: titulo }),
289
+ var CodeL = ({ title, lines, t, q, w, size = 32, left, top }) => {
290
+ const T = useTheme3();
291
+ const o = appearL(t, q);
292
+ return /* @__PURE__ */ jsxs3("div", { style: { position: "absolute", left, top, width: w, background: T.code, border: `3px solid #3a2f22`, borderRadius: 22, overflow: "hidden", opacity: o, transform: `translateY(${(1 - o) * 24}px)` }, children: [
293
+ /* @__PURE__ */ jsx3("div", { style: { background: "#262034", padding: "10px 26px", fontFamily: T.mono, fontSize: 26, color: "#9a95b8", whiteSpace: "nowrap" }, children: title }),
282
294
  /* @__PURE__ */ jsx3("div", { style: { padding: "18px 0", fontFamily: T.mono, fontSize: size, lineHeight: 1.5 }, children: lines.map((l, i) => {
283
295
  const on = l.hl ? t >= l.hl[0] && t < l.hl[1] : false;
284
- return /* @__PURE__ */ jsx3("div", { style: { whiteSpace: "pre", padding: "0 26px", borderLeft: `6px solid ${on ? l.red ? T.erro : T.destaque : "transparent"}`, background: on ? l.red ? "rgba(255,107,94,.16)" : "rgba(244,185,66,.16)" : "transparent" }, children: colorize(l.s, T) || " " }, i);
296
+ return /* @__PURE__ */ jsx3("div", { style: { whiteSpace: "pre", padding: "0 26px", borderLeft: `6px solid ${on ? l.red ? T.error : T.accent : "transparent"}`, background: on ? l.red ? "rgba(255,107,94,.16)" : "rgba(244,185,66,.16)" : "transparent" }, children: colorize(l.s, T) || " " }, i);
285
297
  }) })
286
298
  ] });
287
299
  };
288
- var CartaoL = ({ t, q, left, top, w, h, cor: cor4, children }) => {
289
- const T = useTema3();
290
- const o = surgeL(t, q);
291
- return /* @__PURE__ */ jsx3("div", { style: { position: "absolute", left, top, width: w, height: h, boxSizing: "border-box", background: T.caixaLongo ?? T.caixa, border: `4px solid ${cor4 ?? T.destaque}`, borderRadius: 24, padding: "20px 28px", fontFamily: T.fonte, color: T.texto, opacity: o, transform: `translateY(${(1 - o) * 26}px)`, display: "flex", flexDirection: "column", justifyContent: "center", gap: 8 }, children });
300
+ var CardL = ({ t, q, left, top, w, h, color: color2, children }) => {
301
+ const T = useTheme3();
302
+ const o = appearL(t, q);
303
+ return /* @__PURE__ */ jsx3("div", { style: { position: "absolute", left, top, width: w, height: h, boxSizing: "border-box", background: T.longBox ?? T.box, border: `4px solid ${color2 ?? T.accent}`, borderRadius: 24, padding: "20px 28px", fontFamily: T.font, color: T.text, opacity: o, transform: `translateY(${(1 - o) * 26}px)`, display: "flex", flexDirection: "column", justifyContent: "center", gap: 8 }, children });
292
304
  };
293
- var ChipL = ({ t, q, left, top, cor: cor4, size = 34, children }) => {
294
- const T = useTema3();
295
- const o = surgeL(t, q);
296
- return /* @__PURE__ */ jsx3("div", { style: { position: "absolute", left, top, opacity: o, transform: `scale(${1.15 - 0.15 * o})`, transformOrigin: "left center", fontFamily: T.fonte, fontSize: size, color: T.fundo, background: cor4 ?? T.destaque, borderRadius: 16, padding: "10px 26px", whiteSpace: "nowrap" }, children });
305
+ var ChipL = ({ t, q, left, top, color: color2, size = 34, children }) => {
306
+ const T = useTheme3();
307
+ const o = appearL(t, q);
308
+ return /* @__PURE__ */ jsx3("div", { style: { position: "absolute", left, top, opacity: o, transform: `scale(${1.15 - 0.15 * o})`, transformOrigin: "left center", fontFamily: T.font, fontSize: size, color: T.background, background: color2 ?? T.accent, borderRadius: 16, padding: "10px 26px", whiteSpace: "nowrap" }, children });
297
309
  };
298
- var TxtL = ({ t, q, left, top, w, size = 44, cor: cor4, align = "left", mono, children }) => {
299
- const T = useTema3();
300
- const o = surgeL(t, q);
301
- return /* @__PURE__ */ jsx3("div", { style: { position: "absolute", left, top, width: w, opacity: o, transform: `translateY(${(1 - o) * 18}px)`, fontFamily: mono ? T.mono : T.fonte, fontSize: size, color: cor4 ?? T.texto, textAlign: align, lineHeight: 1.2 }, children });
310
+ var TextL = ({ t, q, left, top, w, size = 44, color: color2, align = "left", mono, children }) => {
311
+ const T = useTheme3();
312
+ const o = appearL(t, q);
313
+ return /* @__PURE__ */ jsx3("div", { style: { position: "absolute", left, top, width: w, opacity: o, transform: `translateY(${(1 - o) * 18}px)`, fontFamily: mono ? T.mono : T.font, fontSize: size, color: color2 ?? T.text, textAlign: align, lineHeight: 1.2 }, children });
302
314
  };
303
315
 
304
- // src/longo-decl.tsx
316
+ // src/long-decl.tsx
305
317
  import { Composition as Composition2 } from "remotion";
306
- import { FPS as FPS3, Longo, TemaProvider as TemaProvider3, mkAtG, useTema as useTemaLocal } from "@praeko/studio-core";
318
+ import { FPS as FPS3, Long, ThemeProvider as ThemeProvider3, makeAtGlobal, useTheme as useTheme5 } from "@praeko/studio-core";
307
319
  import { interpolate as interpolate3, Easing } from "remotion";
308
320
 
309
- // src/capa-longo.tsx
321
+ // src/long-cover.tsx
310
322
  import { Still as Still2 } from "remotion";
311
- import { TemaProvider as TemaProvider2, rgba as rgba2, useTema as useTema4 } from "@praeko/studio-core";
323
+ import { ThemeProvider as ThemeProvider2, rgba as rgba2, useTheme as useTheme4 } from "@praeko/studio-core";
312
324
  import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
313
- var cor2 = (T, c) => c && !c.startsWith("#") && T[c] ? T[c] : c;
314
- var Cartao = ({ spec, w, escala = 1 }) => {
315
- const T = useTema4();
316
- if (!spec.codigo) return null;
317
- const px = (n) => n * escala;
318
- return /* @__PURE__ */ jsxs4("div", { style: { width: w, background: T.codigo, border: `${px(5)}px solid ${T.destaque}`, borderRadius: px(24), overflow: "hidden", textAlign: "left" }, children: [
319
- /* @__PURE__ */ jsx4("div", { style: { background: "#262034", padding: `${px(8)}px ${px(22)}px`, fontFamily: T.mono, fontSize: px(24), color: "#9a95b8" }, children: spec.codigo.titulo }),
320
- /* @__PURE__ */ jsx4("div", { style: { padding: `${px(18)}px ${px(24)}px`, fontFamily: T.mono, fontSize: px(30), lineHeight: 1.5, whiteSpace: "pre" }, children: spec.codigo.linhas.map((l, i) => l.hl ? /* @__PURE__ */ jsx4("div", { style: { background: rgba2(T.destaque, 0.2), borderLeft: `${px(6)}px solid ${T.destaque}`, marginLeft: -px(24), paddingLeft: px(18) }, children: colorize(l.s, T) }, i) : /* @__PURE__ */ jsx4("div", { children: colorize(l.s, T) }, i)) })
325
+ var color = resolveColor;
326
+ var CodeCard = ({ spec, w, scale = 1 }) => {
327
+ const T = useTheme4();
328
+ if (!spec.code) return null;
329
+ const px = (n) => n * scale;
330
+ return /* @__PURE__ */ jsxs4("div", { style: { width: w, background: T.code, border: `${px(5)}px solid ${T.accent}`, borderRadius: px(24), overflow: "hidden", textAlign: "left" }, children: [
331
+ /* @__PURE__ */ jsx4("div", { style: { background: "#262034", padding: `${px(8)}px ${px(22)}px`, fontFamily: T.mono, fontSize: px(24), color: "#9a95b8" }, children: spec.code.title }),
332
+ /* @__PURE__ */ jsx4("div", { style: { padding: `${px(18)}px ${px(24)}px`, fontFamily: T.mono, fontSize: px(30), lineHeight: 1.5, whiteSpace: "pre" }, children: spec.code.lines.map((l, i) => l.hl ? /* @__PURE__ */ jsx4("div", { style: { background: rgba2(T.accent, 0.2), borderLeft: `${px(6)}px solid ${T.accent}`, marginLeft: -px(24), paddingLeft: px(18) }, children: colorize(l.s, T) }, i) : /* @__PURE__ */ jsx4("div", { children: colorize(l.s, T) }, i)) })
321
333
  ] });
322
334
  };
323
- var Chips = ({ spec, escala = 1, coluna }) => {
324
- const T = useTema4();
325
- return /* @__PURE__ */ jsx4("div", { style: { display: "flex", flexDirection: coluna ? "column" : "row", alignItems: coluna ? "flex-start" : void 0, gap: 24 * escala }, children: (spec.chips ?? []).map((c, i) => /* @__PURE__ */ jsx4("div", { style: { background: cor2(T, c.cor) ?? T.destaque, color: T.fundo, fontSize: 48 * escala, padding: `${10 * escala}px ${34 * escala}px`, borderRadius: 18 * escala }, children: c.texto }, i)) });
335
+ var Chips = ({ spec, scale = 1, column }) => {
336
+ const T = useTheme4();
337
+ return /* @__PURE__ */ jsx4("div", { style: { display: "flex", flexDirection: column ? "column" : "row", alignItems: column ? "flex-start" : void 0, gap: 24 * scale }, children: (spec.chips ?? []).map((c, i) => /* @__PURE__ */ jsx4("div", { style: { background: color(T, c.color) ?? T.accent, color: T.background, fontSize: 48 * scale, padding: `${10 * scale}px ${34 * scale}px`, borderRadius: 18 * scale }, children: c.text }, i)) });
326
338
  };
327
- var CapaLongo16x9 = ({ spec }) => {
328
- const T = useTema4();
329
- return /* @__PURE__ */ jsxs4("div", { style: { width: 1280, height: 720, background: `radial-gradient(900px 500px at 75% 30%, ${rgba2(T.destaque, 0.16)}, ${T.fundo} 70%)`, position: "relative", fontFamily: T.fonte, color: T.texto, overflow: "hidden" }, children: [
330
- /* @__PURE__ */ jsxs4("div", { style: { position: "absolute", left: 70, top: 70, fontSize: 92, lineHeight: 1.05, color: T.texto }, children: [
331
- spec.titulo[0],
339
+ var LongCover16x9 = ({ spec }) => {
340
+ const T = useTheme4();
341
+ return /* @__PURE__ */ jsxs4("div", { style: { width: 1280, height: 720, background: `radial-gradient(900px 500px at 75% 30%, ${rgba2(T.accent, 0.16)}, ${T.background} 70%)`, position: "relative", fontFamily: T.font, color: T.text, overflow: "hidden" }, children: [
342
+ /* @__PURE__ */ jsxs4("div", { style: { position: "absolute", left: 70, top: 70, fontSize: 92, lineHeight: 1.05, color: T.text }, children: [
343
+ spec.title[0],
332
344
  /* @__PURE__ */ jsx4("br", {}),
333
- /* @__PURE__ */ jsx4("span", { style: { color: cor2(T, spec.cor) ?? T.destaque }, children: spec.titulo[1] })
345
+ /* @__PURE__ */ jsx4("span", { style: { color: color(T, spec.color) ?? T.accent }, children: spec.title[1] })
334
346
  ] }),
335
- /* @__PURE__ */ jsx4("div", { style: { position: "absolute", left: 70, top: 310 }, children: /* @__PURE__ */ jsx4(Cartao, { spec, w: 700 }) }),
336
- /* @__PURE__ */ jsx4("div", { style: { position: "absolute", left: 70, top: 560 }, children: /* @__PURE__ */ jsx4(Chips, { spec, escala: 0.9 }) }),
337
- spec.gato ? /* @__PURE__ */ jsx4("div", { style: { position: "absolute", right: 70, top: 150 }, children: /* @__PURE__ */ jsx4(Gato, { nome: spec.gato, tam: 380 }) }) : null,
338
- /* @__PURE__ */ jsx4("div", { style: { position: "absolute", right: 70, bottom: 50, fontSize: 34, color: T.destaque, letterSpacing: 2 }, children: T.handle })
347
+ /* @__PURE__ */ jsx4("div", { style: { position: "absolute", left: 70, top: 310 }, children: /* @__PURE__ */ jsx4(CodeCard, { spec, w: 700 }) }),
348
+ /* @__PURE__ */ jsx4("div", { style: { position: "absolute", left: 70, top: 560 }, children: /* @__PURE__ */ jsx4(Chips, { spec, scale: 0.9 }) }),
349
+ spec.mascot ? /* @__PURE__ */ jsx4("div", { style: { position: "absolute", right: 70, top: 150 }, children: /* @__PURE__ */ jsx4(Mascot, { name: spec.mascot, size: 380 }) }) : null,
350
+ /* @__PURE__ */ jsx4("div", { style: { position: "absolute", right: 70, bottom: 50, fontSize: 34, color: T.accent, letterSpacing: 2 }, children: T.handle })
339
351
  ] });
340
352
  };
341
- var CapaLongoVertical = ({ spec }) => {
342
- const T = useTema4();
343
- return /* @__PURE__ */ jsx4(Moldura, { glow: spec.glow ?? rgba2(T.destaque, 0.16), titulo: [spec.titulo[0], spec.titulo[1]], cor: cor2(T, spec.cor) ?? T.destaque, tam: spec.titulo.some((l) => l.length > 11) ? 104 : 130, children: /* @__PURE__ */ jsxs4("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: 34 }, children: [
344
- /* @__PURE__ */ jsx4(Cartao, { spec, w: 780, escala: 1 }),
353
+ var LongCoverVertical = ({ spec }) => {
354
+ const T = useTheme4();
355
+ return /* @__PURE__ */ jsx4(Frame, { glow: spec.glow ?? rgba2(T.accent, 0.16), title: [spec.title[0], spec.title[1]], color: color(T, spec.color) ?? T.accent, size: spec.title.some((l) => l.length > 11) ? 104 : 130, children: /* @__PURE__ */ jsxs4("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: 34 }, children: [
356
+ /* @__PURE__ */ jsx4(CodeCard, { spec, w: 780, scale: 1 }),
345
357
  /* @__PURE__ */ jsxs4("div", { style: { display: "flex", alignItems: "center", gap: 30 }, children: [
346
- spec.gato ? /* @__PURE__ */ jsx4(Gato, { nome: spec.gato, tam: 210 }) : null,
347
- /* @__PURE__ */ jsx4(Chips, { spec, escala: 0.7, coluna: true })
358
+ spec.mascot ? /* @__PURE__ */ jsx4(Mascot, { name: spec.mascot, size: 210 }) : null,
359
+ /* @__PURE__ */ jsx4(Chips, { spec, scale: 0.7, column: true })
348
360
  ] })
349
361
  ] }) });
350
362
  };
351
- var CapasLongo = ({ spec, tema }) => /* @__PURE__ */ jsxs4(Fragment3, { children: [
352
- /* @__PURE__ */ jsx4(Still2, { id: spec.id, component: () => /* @__PURE__ */ jsx4(TemaProvider2, { tema, children: /* @__PURE__ */ jsx4(CapaLongo16x9, { spec }) }), width: 1280, height: 720 }),
353
- /* @__PURE__ */ jsx4(Still2, { id: `${spec.id}Vertical`, component: () => /* @__PURE__ */ jsx4(TemaProvider2, { tema, children: /* @__PURE__ */ jsx4(CapaLongoVertical, { spec }) }), width: 1080, height: 1920 })
363
+ var LongCovers = ({ spec, theme }) => /* @__PURE__ */ jsxs4(Fragment3, { children: [
364
+ /* @__PURE__ */ jsx4(Still2, { id: spec.id, component: () => /* @__PURE__ */ jsx4(ThemeProvider2, { theme, children: /* @__PURE__ */ jsx4(LongCover16x9, { spec }) }), width: 1280, height: 720 }),
365
+ /* @__PURE__ */ jsx4(Still2, { id: `${spec.id}Vertical`, component: () => /* @__PURE__ */ jsx4(ThemeProvider2, { theme, children: /* @__PURE__ */ jsx4(LongCoverVertical, { spec }) }), width: 1080, height: 1920 })
354
366
  ] });
355
367
 
356
- // src/longo-decl.tsx
368
+ // src/long-decl.tsx
357
369
  import { Fragment as Fragment4, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
358
- var cor3 = (T, c) => c && !c.startsWith("#") && T[c] ? T[c] : c;
359
- var Partes = ({ it }) => {
360
- const T = useTemaLocal();
361
- if (!it.partes) return /* @__PURE__ */ jsx5(Fragment4, { children: it.texto });
362
- return /* @__PURE__ */ jsx5(Fragment4, { children: it.partes.map((p, i) => /* @__PURE__ */ jsx5("span", { style: { ...p.cor ? { color: cor3(T, p.cor) } : {}, ...p.mono ? { fontFamily: T.mono } : {} }, children: p.texto }, i)) });
370
+ var TextParts = ({ it }) => {
371
+ const T = useTheme5();
372
+ if (!it.parts) return /* @__PURE__ */ jsx5(Fragment4, { children: it.text });
373
+ return /* @__PURE__ */ jsx5(Fragment4, { children: it.parts.map((p, i) => /* @__PURE__ */ jsx5("span", { style: { ...p.color ? { color: resolveColor(T, p.color) } : {}, ...p.mono ? { fontFamily: T.mono } : {} }, children: p.text }, i)) });
363
374
  };
364
375
  var clampL = { extrapolateLeft: "clamp", extrapolateRight: "clamp" };
365
- var BarraL = ({ it, t, q, T }) => {
366
- const p = it.pos ?? {}, dur = it.duracao ?? 1.4, v = it.valor ?? 1, h = it.altura ?? 46;
367
- const o = surgeL(t, q), f = interpolate3(t, [q, q + dur], [0, v], { ...clampL, easing: Easing.out(Easing.cubic) });
368
- const c = cor3(T, it.cor) ?? T.destaque;
369
- return /* @__PURE__ */ jsxs5("div", { style: { position: "absolute", left: p.left, top: p.top, width: p.w, opacity: o, fontFamily: T.fonte }, children: [
370
- it.rotulo ? /* @__PURE__ */ jsx5("div", { style: { fontSize: it.tamanho ?? 30, color: T.suave, marginBottom: 8 }, children: it.rotulo }) : null,
376
+ var BarL = ({ it, t, q, T }) => {
377
+ const p = it.pos ?? {}, dur = it.duration ?? 1.4, v = it.value ?? 1, h = it.height ?? 46;
378
+ const o = appearL(t, q), f = interpolate3(t, [q, q + dur], [0, v], { ...clampL, easing: Easing.out(Easing.cubic) });
379
+ const c = resolveColor(T, it.color) ?? T.accent;
380
+ return /* @__PURE__ */ jsxs5("div", { style: { position: "absolute", left: p.left, top: p.top, width: p.w, opacity: o, fontFamily: T.font }, children: [
381
+ it.label ? /* @__PURE__ */ jsx5("div", { style: { fontSize: it.size ?? 30, color: T.muted, marginBottom: 8 }, children: it.label }) : null,
371
382
  /* @__PURE__ */ jsxs5("div", { style: { position: "relative", height: h, borderRadius: h / 2, background: "rgba(255,255,255,.07)", border: `3px solid ${c}`, overflow: "hidden" }, children: [
372
383
  /* @__PURE__ */ jsx5("div", { style: { position: "absolute", left: 0, top: 0, bottom: 0, width: `${f * 100}%`, background: `linear-gradient(90deg, ${c}88, ${c})` } }),
373
- it.texto ? /* @__PURE__ */ jsx5("div", { style: { position: "absolute", right: 22, top: 0, bottom: 0, display: "flex", alignItems: "center", fontSize: Math.round(h * 0.55), color: T.texto, fontWeight: 900, textShadow: "0 2px 8px rgba(0,0,0,.8)" }, children: it.texto }) : null
384
+ it.text ? /* @__PURE__ */ jsx5("div", { style: { position: "absolute", right: 22, top: 0, bottom: 0, display: "flex", alignItems: "center", fontSize: Math.round(h * 0.55), color: T.text, fontWeight: 900, textShadow: "0 2px 8px rgba(0,0,0,.8)" }, children: it.text }) : null
374
385
  ] })
375
386
  ] });
376
387
  };
377
- var ContadorL = ({ it, t, q, T }) => {
378
- const p = it.pos ?? {}, dur = it.duracao ?? 1.6, a = it.de ?? 0, b = it.ate ?? 0, casas = it.casas ?? 0;
379
- const o = surgeL(t, q), n = interpolate3(t, [q, q + dur], [a, b], { ...clampL, easing: Easing.out(Easing.cubic) });
380
- const s = n.toLocaleString("pt-BR", { minimumFractionDigits: casas, maximumFractionDigits: casas });
381
- return /* @__PURE__ */ jsxs5("div", { style: { position: "absolute", left: p.left, top: p.top, width: p.w, opacity: o, fontFamily: it.mono ? T.mono : T.fonte, fontSize: it.tamanho ?? 96, fontWeight: 900, color: cor3(T, it.cor) ?? T.destaque, lineHeight: 1.1, textAlign: it.alinhar === "centro" ? "center" : "left" }, children: [
382
- it.prefixo ?? "",
388
+ var CounterL = ({ it, t, q, T }) => {
389
+ const p = it.pos ?? {}, dur = it.duration ?? 1.6, a = it.from ?? 0, b = it.to ?? 0, decimals = it.decimals ?? 0;
390
+ const o = appearL(t, q), n = interpolate3(t, [q, q + dur], [a, b], { ...clampL, easing: Easing.out(Easing.cubic) });
391
+ const s = n.toLocaleString("pt-BR", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
392
+ return /* @__PURE__ */ jsxs5("div", { style: { position: "absolute", left: p.left, top: p.top, width: p.w, opacity: o, fontFamily: it.mono ? T.mono : T.font, fontSize: it.size ?? 96, fontWeight: 900, color: resolveColor(T, it.color) ?? T.accent, lineHeight: 1.1, textAlign: it.align === "center" ? "center" : "left" }, children: [
393
+ it.prefix ?? "",
383
394
  s,
384
- it.sufixo ?? ""
395
+ it.suffix ?? ""
385
396
  ] });
386
397
  };
387
- function longoDeSpec(spec, palavras, T, pecas = {}) {
388
- const at = mkAtG(palavras);
389
- const q = (x) => typeof x === "number" ? x : typeof x === "string" ? at(x) : at(x.quando, x.nth ?? 0, x.depois ?? 0) + (x.mais ?? 0);
398
+ function longDataFromSpec(spec, words, T, components = {}) {
399
+ const at = makeAtGlobal(words);
400
+ const q = (x) => typeof x === "number" ? x : typeof x === "string" ? at(x) : at(x.when, x.nth ?? 0, x.after ?? 0) + (x.plus ?? 0);
390
401
  const Item = ({ it, t }) => {
391
402
  const p = it.pos ?? {};
392
- switch (it.tipo) {
393
- case "codigo":
403
+ switch (it.type) {
404
+ case "code":
394
405
  return /* @__PURE__ */ jsx5(
395
- CodigoL,
406
+ CodeL,
396
407
  {
397
- titulo: it.titulo,
408
+ title: it.title,
398
409
  t,
399
- q: q(it.quando),
410
+ q: q(it.when),
400
411
  w: p.w,
401
412
  left: p.left,
402
413
  top: p.top,
403
- size: it.tamanho,
404
- lines: it.linhas.map((l) => ({ s: l.s, ...l.hl ? { hl: [q(l.hl[0]), q(l.hl[1])] } : {}, ...l.vermelho ? { red: true } : {} }))
414
+ size: it.size,
415
+ lines: it.lines.map((l) => ({ s: l.s, ...l.hl ? { hl: [q(l.hl[0]), q(l.hl[1])] } : {}, ...l.red ? { red: true } : {} }))
405
416
  }
406
417
  );
407
- case "cartao":
408
- return /* @__PURE__ */ jsx5(CartaoL, { t, q: q(it.quando), left: p.left, top: p.top, w: p.w, h: p.h, cor: cor3(T, it.cor), children: it.itens.map((f, i) => /* @__PURE__ */ jsx5(Item, { it: f, t }, i)) });
409
- case "texto":
410
- return /* @__PURE__ */ jsx5("div", { style: { fontSize: it.tamanho, color: cor3(T, it.cor), ...it.espacar ? { letterSpacing: it.espacar } : {}, ...it.quando !== void 0 ? { opacity: surgeL(t, q(it.quando)) } : {} }, children: /* @__PURE__ */ jsx5(Partes, { it }) });
418
+ case "card":
419
+ return /* @__PURE__ */ jsx5(CardL, { t, q: q(it.when), left: p.left, top: p.top, w: p.w, h: p.h, color: resolveColor(T, it.color), children: it.items.map((f, i) => /* @__PURE__ */ jsx5(Item, { it: f, t }, i)) });
420
+ case "text":
421
+ return /* @__PURE__ */ jsx5("div", { style: { fontSize: it.size, color: resolveColor(T, it.color), ...it.spacing ? { letterSpacing: it.spacing } : {}, ...it.when !== void 0 ? { opacity: appearL(t, q(it.when)) } : {} }, children: /* @__PURE__ */ jsx5(TextParts, { it }) });
411
422
  case "chip":
412
- return /* @__PURE__ */ jsx5(ChipL, { t, q: q(it.quando), left: p.left, top: p.top, cor: cor3(T, it.cor), size: it.tamanho, children: it.texto });
413
- case "txt":
414
- return /* @__PURE__ */ jsx5(TxtL, { t, q: q(it.quando), left: p.left, top: p.top, w: p.w, size: it.tamanho, cor: cor3(T, it.cor), align: it.alinhar === "centro" ? "center" : "left", mono: it.mono, children: /* @__PURE__ */ jsx5(Partes, { it }) });
423
+ return /* @__PURE__ */ jsx5(ChipL, { t, q: q(it.when), left: p.left, top: p.top, color: resolveColor(T, it.color), size: it.size, children: it.text });
424
+ case "freetext":
425
+ return /* @__PURE__ */ jsx5(TextL, { t, q: q(it.when), left: p.left, top: p.top, w: p.w, size: it.size, color: resolveColor(T, it.color), align: it.align === "center" ? "center" : "left", mono: it.mono, children: /* @__PURE__ */ jsx5(TextParts, { it }) });
415
426
  case "video":
416
- return /* @__PURE__ */ jsx5(Janela, { t, q: q(it.quando), src: it.src, duracao: it.duracaoClipe, de: it.de ?? 0, left: p.left, top: p.top, w: p.w, reg: it.reg ?? [0, 0, 1920, 1080], tag: it.tag ?? "jogo", dur: it.dur ?? 20 });
417
- case "celular":
418
- return /* @__PURE__ */ jsx5(Celular, { t, q: q(it.quando), src: it.src, duracao: it.duracaoClipe, de: it.de ?? 0, left: p.left, top: p.top, w: p.w, dur: it.dur ?? 20 });
419
- case "barra":
420
- return /* @__PURE__ */ jsx5(BarraL, { it, t, q: q(it.quando), T });
421
- case "contador":
422
- return /* @__PURE__ */ jsx5(ContadorL, { it, t, q: q(it.quando), T });
423
- case "fluxo": {
424
- const nos = it.nos ?? [], tam = it.tamanho ?? 34, c0 = cor3(T, it.cor) ?? T.destaque;
425
- return /* @__PURE__ */ jsx5("div", { style: { position: "absolute", left: p.left, top: p.top, width: p.w, display: "flex", alignItems: "center", justifyContent: "space-between", fontFamily: T.fonte }, children: nos.map((n, i) => {
426
- const o = surgeL(t, q(n.quando)), c = cor3(T, n.cor) ?? c0;
427
- return /* @__PURE__ */ jsxs5("div", { style: { display: "flex", alignItems: "center", flex: i < nos.length - 1 ? 1 : void 0 }, children: [
428
- /* @__PURE__ */ jsx5("div", { style: { opacity: o, transform: `scale(${0.85 + 0.15 * o})`, background: T.caixaLongo ?? T.caixa, border: `4px solid ${c}`, borderRadius: 22, padding: "16px 26px", fontSize: tam, color: T.texto, textAlign: "center", lineHeight: 1.2, whiteSpace: "pre-line" }, children: n.texto }),
429
- i < nos.length - 1 ? /* @__PURE__ */ jsx5("div", { style: { flex: 1, textAlign: "center", fontSize: tam * 1.2, color: T.suave, opacity: surgeL(t, q(nos[i + 1].quando)) }, children: "\u2192" }) : null
427
+ return /* @__PURE__ */ jsx5(Window, { t, q: q(it.when), src: it.src, clipDuration: it.clipDuration, from: it.from ?? 0, left: p.left, top: p.top, w: p.w, reg: it.reg ?? [0, 0, 1920, 1080], tag: it.tag ?? "footage", dur: it.motionDuration ?? 20 });
428
+ case "phone":
429
+ return /* @__PURE__ */ jsx5(Phone, { t, q: q(it.when), src: it.src, clipDuration: it.clipDuration, from: it.from ?? 0, left: p.left, top: p.top, w: p.w, dur: it.motionDuration ?? 20 });
430
+ case "bar":
431
+ return /* @__PURE__ */ jsx5(BarL, { it, t, q: q(it.when), T });
432
+ case "counter":
433
+ return /* @__PURE__ */ jsx5(CounterL, { it, t, q: q(it.when), T });
434
+ case "flow": {
435
+ const nodes = it.nodes ?? [], size = it.size ?? 34, c0 = resolveColor(T, it.color) ?? T.accent;
436
+ return /* @__PURE__ */ jsx5("div", { style: { position: "absolute", left: p.left, top: p.top, width: p.w, display: "flex", alignItems: "center", justifyContent: "space-between", fontFamily: T.font }, children: nodes.map((n, i) => {
437
+ const o = appearL(t, q(n.when)), c = resolveColor(T, n.color) ?? c0;
438
+ return /* @__PURE__ */ jsxs5("div", { style: { display: "flex", alignItems: "center", flex: i < nodes.length - 1 ? 1 : void 0 }, children: [
439
+ /* @__PURE__ */ jsx5("div", { style: { opacity: o, transform: `scale(${0.85 + 0.15 * o})`, background: T.longBox ?? T.box, border: `4px solid ${c}`, borderRadius: 22, padding: "16px 26px", fontSize: size, color: T.text, textAlign: "center", lineHeight: 1.2, whiteSpace: "pre-line" }, children: n.text }),
440
+ i < nodes.length - 1 ? /* @__PURE__ */ jsx5("div", { style: { flex: 1, textAlign: "center", fontSize: size * 1.2, color: T.muted, opacity: appearL(t, q(nodes[i + 1].when)) }, children: "\u2192" }) : null
430
441
  ] }, i);
431
442
  }) });
432
443
  }
433
444
  default:
434
445
  return /* @__PURE__ */ jsxs5("div", { style: { color: "#f00", fontSize: 30 }, children: [
435
- "tipo desconhecido: ",
436
- it.tipo
446
+ "unknown type: ",
447
+ it.type
437
448
  ] });
438
449
  }
439
450
  };
440
- const S = spec.cenas.map((c) => c.inicio);
451
+ const S = spec.scenes.map((c) => c.start);
441
452
  return {
442
453
  id: spec.id,
443
454
  durS: spec.durS,
444
- voz: spec.voz,
445
- palavras,
446
- ...spec.fecho ? { fecho: { a: spec.fecho.inicio, texto: spec.fecho.texto, link: spec.fecho.link, imagem: spec.fecho.imagem } } : {},
447
- cenas: spec.cenas.map((c, i) => ({
455
+ voice: spec.voice,
456
+ words,
457
+ ...spec.endcard ? { endcard: { a: spec.endcard.start, text: spec.endcard.text, link: spec.endcard.link, image: spec.endcard.image } } : {},
458
+ scenes: spec.scenes.map((c, i) => ({
448
459
  n: c.n ?? String(i + 1),
449
- titulo: c.titulo,
450
- a: c.inicio,
460
+ title: c.title,
461
+ a: c.start,
451
462
  b: i + 1 < S.length ? S[i + 1] : spec.durS,
452
- C: c.componente ? pecas[c.componente] ?? (() => /* @__PURE__ */ jsxs5("div", { style: { color: "#f00", fontSize: 40 }, children: [
453
- 'componente "',
454
- c.componente,
455
- '" n\xE3o registrado'
456
- ] })) : ({ t }) => /* @__PURE__ */ jsx5(Fragment4, { children: (c.itens ?? []).map((it, k) => /* @__PURE__ */ jsx5(Item, { it, t }, k)) })
463
+ C: c.component ? components[c.component] ?? (() => /* @__PURE__ */ jsxs5("div", { style: { color: "#f00", fontSize: 40 }, children: [
464
+ 'component "',
465
+ c.component,
466
+ '" is not registered'
467
+ ] })) : ({ t }) => /* @__PURE__ */ jsx5(Fragment4, { children: (c.items ?? []).map((it, k) => /* @__PURE__ */ jsx5(Item, { it, t }, k)) })
457
468
  }))
458
469
  };
459
470
  }
460
- var LongoDecl = ({ spec, palavras, tema, pecas }) => {
461
- const d = longoDeSpec(spec, palavras, tema, pecas);
471
+ var LongDecl = ({ spec, words, theme, components }) => {
472
+ const d = longDataFromSpec(spec, words, theme, components);
462
473
  return /* @__PURE__ */ jsxs5(Fragment4, { children: [
463
- /* @__PURE__ */ jsx5(Composition2, { id: spec.id, component: () => /* @__PURE__ */ jsx5(TemaProvider3, { tema, children: /* @__PURE__ */ jsx5(Longo, { d }) }), durationInFrames: Math.round(spec.durS * FPS3), fps: FPS3, width: d.largura ?? 1920, height: d.altura ?? 1080 }),
464
- spec.capa ? /* @__PURE__ */ jsx5(CapasLongo, { spec: spec.capa, tema }) : null
474
+ /* @__PURE__ */ jsx5(Composition2, { id: spec.id, component: () => /* @__PURE__ */ jsx5(ThemeProvider3, { theme, children: /* @__PURE__ */ jsx5(Long, { d }) }), durationInFrames: Math.round(spec.durS * FPS3), fps: FPS3, width: d.width ?? 1920, height: d.height ?? 1080 }),
475
+ spec.cover ? /* @__PURE__ */ jsx5(LongCovers, { spec: spec.cover, theme }) : null
465
476
  ] });
466
477
  };
467
478
  export {
468
- Balao,
469
479
  Big,
470
- Caixa,
471
- CapaLongo16x9,
472
- CapaLongoVertical,
473
- CapasLongo,
474
- CartaoL,
475
- Celular,
480
+ Box,
481
+ Bubble,
482
+ CardL,
476
483
  ChipL,
477
- Codigo,
478
- CodigoL,
479
- EpisodioDecl,
480
- Gato,
481
- Janela,
482
- Linha,
483
- LongoDecl,
484
- Moldura,
485
- PainelD,
486
- TxtL,
484
+ Code,
485
+ CodeL,
486
+ EpisodeDecl,
487
+ Frame,
488
+ Line,
489
+ LongCover16x9,
490
+ LongCoverVertical,
491
+ LongCovers,
492
+ LongDecl,
493
+ Mascot,
494
+ Panel,
495
+ Phone,
496
+ TextL,
497
+ Window,
498
+ appearL,
487
499
  colorize,
488
- epDataDeSpec,
489
- longoDeSpec,
490
- surgeL
500
+ episodeDataFromSpec,
501
+ longDataFromSpec,
502
+ resolveColor
491
503
  };