@kolkrabbi/design-editor 0.15.0 → 0.17.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.
@@ -1,19 +1,19 @@
1
- import { B as e, Ft as t, It as n, L as r, S as i, Xt as a, Zt as o, a as s, b as c, c as l, i as u, it as d, j as f, l as p, n as m, o as h, ot as g, r as _, rt as v, tt as y, u as b, w as x, wt as S, x as C } from "./rolls-CkmuE-Ya.js";
2
- import { c as w, d as T, f as E, l as D, n as O, o as k, p as A, r as j, t as M } from "./registry-CSOtIU7o.js";
3
- import { c as N, n as P, s as F } from "./generators-DG5yqNy1.js";
4
- import { n as I, r as L, t as ee } from "./useLayerEdit-BDXtPeAP.js";
5
- import { a as te, c as R, d as ne, f as z, i as re, l as B, n as ie, o as ae, r as oe, s as se, u as ce } from "./effects-DzHdDgL4.js";
6
- import { t as le } from "./BindDot-CuCS4LS-.js";
7
- import { a as ue, i as de, n as fe, o as pe, r as me, s as he } from "./motion-DtxlM5Bu.js";
8
- import { A as ge, B as _e, C as ve, D as ye, E as be, F as xe, G as Se, H as Ce, I as we, L as Te, M as Ee, N as De, O as Oe, P as ke, R as Ae, S as je, T as Me, U as Ne, V as Pe, W as Fe, _ as Ie, a as Le, b as Re, c as ze, d as Be, f as Ve, g as He, h as Ue, i as We, j as Ge, k as Ke, l as qe, m as Je, n as Ye, o as Xe, p as Ze, r as Qe, s as $e, t as et, u as tt, v as nt, w as rt, x as it, y as at, z as ot } from "./core-Dr8KZNAY.js";
9
- import { Button as V, Divider as st, Dropdown as ct, FullscreenOverlay as lt, LabeledControlSection as H, SegmentedToggle as U, ToggleSwitch as ut, Tooltip as dt } from "@kolkrabbi/kol-component";
10
- import { createContext as ft, useCallback as pt, useContext as mt, useEffect as W, useRef as G, useState as K } from "react";
11
- import { Fragment as q, jsx as J, jsxs as Y } from "react/jsx-runtime";
12
- import { Icon as X } from "@kolkrabbi/kol-icons";
13
- import { useDragResize as ht, useTheme as gt } from "@kolkrabbi/kol-framework";
1
+ import { B as e, Ft as t, It as n, L as r, S as i, Xt as a, Zt as o, a as s, at as c, b as l, c as u, i as d, it as f, j as p, l as m, n as h, o as g, ot as _, r as v, rt as y, tt as b, u as x, w as S, wt as ee, x as C } from "./rolls-CkmuE-Ya.js";
2
+ import { c as w, d as T, f as E, l as D, n as O, o as k, p as te, r as A, t as j } from "./registry-CSOtIU7o.js";
3
+ import { c as M, n as N, s as P } from "./generators-B0uhjxUs.js";
4
+ import { n as F, r as I, t as ne } from "./useLayerEdit-BDXtPeAP.js";
5
+ import { a as L, c as R, d as re, f as z, i as ie, l as B, n as ae, o as oe, r as se, s as ce, u as le } from "./effects-B743CHEU.js";
6
+ import { t as ue } from "./BindDot-CuCS4LS-.js";
7
+ import { a as V, i as de, n as fe, o as pe, r as me, s as he } from "./motion-9j3WO6a2.js";
8
+ import { A as ge, B as _e, C as ve, D as ye, E as be, F as xe, G as Se, H as Ce, I as we, K as Te, L as Ee, M as De, N as Oe, O as ke, P as Ae, R as je, S as Me, T as Ne, U as Pe, V as Fe, W as Ie, _ as Le, a as Re, b as ze, c as Be, d as Ve, f as He, g as Ue, h as We, i as Ge, j as Ke, k as qe, l as Je, m as Ye, n as Xe, o as Ze, p as Qe, q as $e, r as et, s as tt, t as nt, u as rt, v as it, w as at, x as ot, y as st, z as ct } from "./core-Cq8xJc_c.js";
9
+ import { Button as H, Divider as lt, Dropdown as ut, FullscreenOverlay as dt, LabeledControlSection as U, SegmentedToggle as W, ToggleSwitch as ft, Tooltip as G } from "@kolkrabbi/kol-component";
10
+ import { createContext as pt, useCallback as mt, useContext as ht, useEffect as K, useRef as q, useState as J } from "react";
11
+ import { Fragment as Y, jsx as X, jsxs as Z } from "react/jsx-runtime";
12
+ import { Icon as Q } from "@kolkrabbi/kol-icons";
13
+ import { useDragResize as gt, useTheme as _t } from "@kolkrabbi/kol-framework";
14
14
  //#region src/editor/labs/useLabsLayer.js
15
- function Z() {
16
- let { layers: e, addLayer: t, removeLayer: n, updateLayer: r, select: i, beginTransaction: a, commitTransaction: o } = f(), s = pt((s, c) => {
15
+ function vt() {
16
+ let { layers: e, addLayer: t, removeLayer: n, updateLayer: r, select: i, beginTransaction: a, commitTransaction: o } = p(), s = mt((s, c) => {
17
17
  let [l, ...u] = e;
18
18
  a();
19
19
  for (let e of u) n(e.id);
@@ -35,7 +35,7 @@ function Z() {
35
35
  }
36
36
  //#endregion
37
37
  //#region src/editor/labs/catalog.js
38
- var Q = {
38
+ var $ = {
39
39
  "fx:halftone": "ptrn-dot",
40
40
  "fx:scanline": "grid-horizontal",
41
41
  "fx:crt": "desktop",
@@ -58,23 +58,23 @@ var Q = {
58
58
  "misc:Para Type": "aa",
59
59
  "vec:Distressor": "scribble",
60
60
  "vec:Modulator": "dashed-circle"
61
- }, _t = {
61
+ }, yt = {
62
62
  effects: "filter",
63
63
  generative: "layers",
64
64
  vector: "pen-nib",
65
65
  composition: "type",
66
66
  modulation: "frequency",
67
67
  mode: "mode-toggle-01"
68
- }, $ = {
68
+ }, bt = {
69
69
  editor: "desktop",
70
70
  labs: "globe",
71
71
  randomiser: "refresh"
72
- }, vt = [
72
+ }, xt = [
73
73
  "Moiré",
74
74
  "Mesh Gradient",
75
75
  "Reaction",
76
76
  "Halftone"
77
- ], yt = [
77
+ ], St = [
78
78
  {
79
79
  label: "Spaced",
80
80
  patch: {
@@ -106,11 +106,11 @@ var Q = {
106
106
  label: "Spiral",
107
107
  patch: { geometry: "spiral" }
108
108
  }
109
- ], bt = (e = {}) => {
109
+ ], Ct = (e = {}) => {
110
110
  let t = e.geometry ?? "rows";
111
111
  return t === "radial" ? "Vortex" : t === "rings" ? "Rings" : t === "spiral" ? "Spiral" : e.mark === "glyph" ? "Glyph" : e.mark === "lattice" ? "Lattice" : "Spaced";
112
112
  };
113
- function xt({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource: i }) {
113
+ function wt({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource: i }) {
114
114
  let a = (e, a) => {
115
115
  let o = t("photo", {
116
116
  ...i(),
@@ -157,22 +157,22 @@ function xt({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
157
157
  id: "sec:effects",
158
158
  label: "Effects"
159
159
  },
160
- ...ae(z).map((t) => ({
160
+ ...oe(z).map((t) => ({
161
161
  id: `fx:${t.id}`,
162
162
  label: t.label,
163
- icon: Q[`fx:${t.id}`] ?? "square",
164
- pages: t.rack ? re.map((t) => ({
163
+ icon: $[`fx:${t.id}`] ?? "square",
164
+ pages: t.rack ? ie.map((t) => ({
165
165
  label: t.label,
166
166
  onSelect: () => o(t.id),
167
167
  active: e?.fxGroup === t.id
168
- })) : t.id === "pattern" ? vt.map((t) => ({
168
+ })) : t.id === "pattern" ? xt.map((t) => ({
169
169
  label: t,
170
170
  onSelect: () => s(E("optic", t)[0], "optic"),
171
171
  active: e?.loopGroup === "optic" && d?.sub === t
172
- })) : t.id === "scanline" ? yt.map((t) => ({
172
+ })) : t.id === "scanline" ? St.map((t) => ({
173
173
  label: t.label,
174
174
  onSelect: () => a("scanline", t.patch),
175
- active: !e?.fxGroup && u === "scanline" && bt(e?.filters?.[0]?.params) === t.label
175
+ active: !e?.fxGroup && u === "scanline" && Ct(e?.filters?.[0]?.params) === t.label
176
176
  })) : t.filters.map((t) => ({
177
177
  label: t.label ?? t.id,
178
178
  onSelect: () => a(t.id),
@@ -183,10 +183,10 @@ function xt({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
183
183
  id: "sec:generative",
184
184
  label: "Generative"
185
185
  },
186
- ...F.map((e) => ({
186
+ ...P.map((e) => ({
187
187
  id: `gen:${e.label}`,
188
188
  label: e.label,
189
- icon: Q[`gen:${e.label}`] ?? "square",
189
+ icon: $[`gen:${e.label}`] ?? "square",
190
190
  pages: p(e)
191
191
  })),
192
192
  {
@@ -196,13 +196,13 @@ function xt({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
196
196
  {
197
197
  id: "vec:Distressor",
198
198
  label: "Distressor",
199
- icon: Q["vec:Distressor"] ?? "square",
199
+ icon: $["vec:Distressor"] ?? "square",
200
200
  pages: f("distress")
201
201
  },
202
202
  {
203
203
  id: "vec:Modulator",
204
204
  label: "Modulator",
205
- icon: Q["vec:Modulator"] ?? "square",
205
+ icon: $["vec:Modulator"] ?? "square",
206
206
  pages: f("modulator")
207
207
  },
208
208
  {
@@ -212,17 +212,17 @@ function xt({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
212
212
  ...pe.map((t) => ({
213
213
  id: `kin:${t.label}`,
214
214
  label: t.label,
215
- icon: Q[`kin:${t.label}`] ?? "square",
215
+ icon: $[`kin:${t.label}`] ?? "square",
216
216
  pages: t.subs.map((t) => ({
217
217
  label: t,
218
- onSelect: () => c(ue.find((e) => e.sub === t)),
219
- active: e?.type === "kinetic" && ue.some((e) => e.sub === t && e.id === l)
218
+ onSelect: () => c(V.find((e) => e.sub === t)),
219
+ active: e?.type === "kinetic" && V.some((e) => e.sub === t && e.id === l)
220
220
  }))
221
221
  })),
222
- ...N.map((e) => ({
222
+ ...M.map((e) => ({
223
223
  id: `misc:${e.label}`,
224
224
  label: e.label,
225
- icon: Q[`misc:${e.label}`] ?? "square",
225
+ icon: $[`misc:${e.label}`] ?? "square",
226
226
  pages: e.groups.flatMap((e) => f(e, "misc"))
227
227
  })),
228
228
  {
@@ -239,9 +239,9 @@ function xt({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
239
239
  }
240
240
  //#endregion
241
241
  //#region src/editor/labs/LabsNav.jsx
242
- function St() {
243
- let { addFilter: e, patchFilter: n } = f(), { layer: r, setOnly: i } = Z(), a = G(null);
244
- W(() => {
242
+ function Tt() {
243
+ let { addFilter: e, patchFilter: n } = p(), { layer: r, setOnly: i } = vt(), a = q(null);
244
+ K(() => {
245
245
  r?.type === "photo" && r.src && (a.current = {
246
246
  src: r.src,
247
247
  srcType: r.srcType,
@@ -253,7 +253,7 @@ function St() {
253
253
  r?.srcType,
254
254
  r?.fit
255
255
  ]);
256
- let o = xt({
256
+ let o = wt({
257
257
  layer: r,
258
258
  setOnly: i,
259
259
  addFilter: e,
@@ -264,20 +264,20 @@ function St() {
264
264
  fit: r.fit
265
265
  } : a.current ?? {}
266
266
  });
267
- return W(() => {
267
+ return K(() => {
268
268
  let e = /* @__PURE__ */ new Map(), n = [];
269
269
  o.forEach((t) => {
270
270
  if (t.id.startsWith("sec:")) {
271
271
  let e = t.id.slice(4);
272
272
  n.push({
273
- icon: _t[e] ?? "square",
274
- path: `${$e}${t.id}`,
273
+ icon: yt[e] ?? "square",
274
+ path: `${tt}${t.id}`,
275
275
  label: t.label,
276
276
  sub: []
277
277
  });
278
278
  return;
279
279
  }
280
- let r = `${$e}${t.id}`, i = t.pages ?? [], a = t.onSelect ?? i[0]?.onSelect;
280
+ let r = `${tt}${t.id}`, i = t.pages ?? [], a = t.onSelect ?? i[0]?.onSelect;
281
281
  a && e.set(r, a);
282
282
  let o = n[n.length - 1], s = {
283
283
  icon: t.icon,
@@ -286,22 +286,22 @@ function St() {
286
286
  };
287
287
  o?.sub ? o.sub.push(s) : n.push(s);
288
288
  });
289
- let r = Qe() && !Xe();
290
- return ze({
289
+ let r = et() && !Ze();
290
+ return Be({
291
291
  items: n,
292
292
  dispatch: (n) => {
293
293
  let i = e.get(n);
294
294
  return i ? (i(), r && t.play(), !0) : !1;
295
295
  }
296
- }), () => ze(null);
296
+ }), () => Be(null);
297
297
  }), null;
298
298
  }
299
299
  //#endregion
300
300
  //#region src/editor/labs/LabsSourcePicker.jsx
301
- function Ct(e) {
302
- let { patch: t } = ee(e.id), n = G(null), [r, i] = K(!1), a = e.type === "loop" && e.loopGroup === "distress";
301
+ function Et(e) {
302
+ let { patch: t } = ne(e.id), n = q(null), [r, i] = J(!1), a = e.type === "loop" && e.loopGroup === "distress";
303
303
  return {
304
- nodes: /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J("input", {
304
+ nodes: /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X("input", {
305
305
  ref: n,
306
306
  type: "file",
307
307
  accept: a ? ".svg,image/svg+xml" : "image/*,video/*",
@@ -315,7 +315,7 @@ function Ct(e) {
315
315
  return;
316
316
  }
317
317
  if (r.type.startsWith("video/")) {
318
- y(e.id, r), t({
318
+ b(e.id, r), t({
319
319
  src: URL.createObjectURL(r),
320
320
  srcType: "video"
321
321
  });
@@ -327,17 +327,17 @@ function Ct(e) {
327
327
  srcType: "image"
328
328
  }), i.readAsDataURL(r);
329
329
  }
330
- }), /* @__PURE__ */ J(He, {
330
+ }), /* @__PURE__ */ X(Ue, {
331
331
  open: r,
332
332
  onClose: () => i(!1),
333
333
  onPick: (e, { contentType: n } = {}) => {
334
334
  if (a) {
335
- t({ svgSrc: nt(e) });
335
+ t({ svgSrc: it(e) });
336
336
  return;
337
337
  }
338
338
  t({
339
- src: nt(e),
340
- srcType: Ie(n) ? "video" : "image"
339
+ src: it(e),
340
+ srcType: Le(n) ? "video" : "image"
341
341
  });
342
342
  },
343
343
  accept: a ? "svg" : "all"
@@ -346,16 +346,16 @@ function Ct(e) {
346
346
  openLibrary: () => i(!0),
347
347
  openUpload: () => n.current?.click(),
348
348
  openCamera: () => {
349
- at(e.id).then(() => t({
349
+ ot(e.id).then(() => t({
350
350
  src: null,
351
351
  srcType: "webcam"
352
352
  })).catch(() => {});
353
353
  }
354
354
  };
355
355
  }
356
- function wt({ layer: e }) {
357
- let t = i(), n = Ct(e);
358
- return /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(U, {
356
+ function Dt({ layer: e }) {
357
+ let t = i(), n = Et(e);
358
+ return /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X(W, {
359
359
  variant: "filled",
360
360
  value: null,
361
361
  onChange: (e) => ({
@@ -363,13 +363,13 @@ function wt({ layer: e }) {
363
363
  upload: n.openUpload,
364
364
  camera: n.openCamera
365
365
  })[e]?.(),
366
- options: n.svgMode ? Et : Tt,
366
+ options: n.svgMode ? kt : Ot,
367
367
  size: t,
368
368
  ariaLabel: "Source",
369
369
  className: C(t)
370
370
  }), n.nodes] });
371
371
  }
372
- var Tt = [
372
+ var Ot = [
373
373
  {
374
374
  value: "library",
375
375
  label: "Library"
@@ -382,52 +382,52 @@ var Tt = [
382
382
  value: "camera",
383
383
  label: "Camera"
384
384
  }
385
- ], Et = Tt.slice(0, 2);
386
- function Dt({ layer: e }) {
387
- let t = Ct(e), n = "flex-1 flex flex-col items-center justify-center gap-3 cursor-pointer text-oq-48 hover:text-emphasis hover:bg-oq-02 transition-colors";
388
- return /* @__PURE__ */ Y("div", {
385
+ ], kt = Ot.slice(0, 2);
386
+ function At({ layer: e }) {
387
+ let t = Et(e), n = "flex-1 flex flex-col items-center justify-center gap-3 cursor-pointer text-oq-48 hover:text-emphasis hover:bg-oq-02 transition-colors";
388
+ return /* @__PURE__ */ Z("div", {
389
389
  className: "w-full h-full flex items-stretch p-6 gap-px",
390
390
  children: [
391
- /* @__PURE__ */ Y("button", {
391
+ /* @__PURE__ */ Z("button", {
392
392
  type: "button",
393
393
  className: n,
394
394
  onClick: t.openLibrary,
395
- children: [/* @__PURE__ */ J(X, {
395
+ children: [/* @__PURE__ */ X(Q, {
396
396
  name: "image",
397
397
  size: 28
398
- }), /* @__PURE__ */ J("span", {
398
+ }), /* @__PURE__ */ X("span", {
399
399
  className: "kol-mono-12",
400
400
  children: "From library"
401
401
  })]
402
402
  }),
403
- /* @__PURE__ */ J("div", {
403
+ /* @__PURE__ */ X("div", {
404
404
  className: "w-px",
405
- style: { background: "var(--kol-fg-08)" }
405
+ style: { background: "var(--kol-oq-08)" }
406
406
  }),
407
- /* @__PURE__ */ Y("button", {
407
+ /* @__PURE__ */ Z("button", {
408
408
  type: "button",
409
409
  className: n,
410
410
  onClick: t.openUpload,
411
- children: [/* @__PURE__ */ J(X, {
411
+ children: [/* @__PURE__ */ X(Q, {
412
412
  name: "upload",
413
413
  size: 28
414
- }), /* @__PURE__ */ J("span", {
414
+ }), /* @__PURE__ */ X("span", {
415
415
  className: "kol-mono-12",
416
416
  children: "Upload"
417
417
  })]
418
418
  }),
419
- /* @__PURE__ */ J("div", {
419
+ /* @__PURE__ */ X("div", {
420
420
  className: "w-px",
421
- style: { background: "var(--kol-fg-08)" }
421
+ style: { background: "var(--kol-oq-08)" }
422
422
  }),
423
- /* @__PURE__ */ Y("button", {
423
+ /* @__PURE__ */ Z("button", {
424
424
  type: "button",
425
425
  className: n,
426
426
  onClick: t.openCamera,
427
- children: [/* @__PURE__ */ J(X, {
427
+ children: [/* @__PURE__ */ X(Q, {
428
428
  name: "camera",
429
429
  size: 28
430
- }), /* @__PURE__ */ J("span", {
430
+ }), /* @__PURE__ */ X("span", {
431
431
  className: "kol-mono-12",
432
432
  children: "Camera"
433
433
  })]
@@ -438,8 +438,8 @@ function Dt({ layer: e }) {
438
438
  }
439
439
  //#endregion
440
440
  //#region src/editor/labs/LabsParams.jsx
441
- function Ot(e, t) {
442
- W(() => {
441
+ function jt(e, t) {
442
+ K(() => {
443
443
  let n = (n) => {
444
444
  if (n.key !== "r" && n.key !== "R" || n.metaKey || n.ctrlKey || n.altKey) return;
445
445
  let r = n.target;
@@ -448,13 +448,13 @@ function Ot(e, t) {
448
448
  return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
449
449
  });
450
450
  }
451
- var kt = [{
451
+ var Mt = [{
452
452
  value: "effect",
453
453
  label: "Effect"
454
454
  }, {
455
455
  value: "anim",
456
456
  label: "Motion"
457
- }], At = [
457
+ }], Nt = [
458
458
  {
459
459
  value: "generate",
460
460
  label: "Generate"
@@ -467,7 +467,7 @@ var kt = [{
467
467
  value: "anim",
468
468
  label: "Animation"
469
469
  }
470
- ], jt = [
470
+ ], Pt = [
471
471
  {
472
472
  value: "generate",
473
473
  label: "Gen"
@@ -481,18 +481,18 @@ var kt = [{
481
481
  label: "Anim"
482
482
  }
483
483
  ];
484
- function Mt({ options: e, active: t, onPick: n, spread: r = !1, pills: i = !1 }) {
485
- return e?.length ? i ? /* @__PURE__ */ J("div", {
484
+ function Ft({ options: e, active: t, onPick: n, spread: r = !1, pills: i = !1 }) {
485
+ return e?.length ? i ? /* @__PURE__ */ X("div", {
486
486
  className: "flex items-center gap-1 flex-wrap",
487
- children: e.map((e) => /* @__PURE__ */ J("button", {
487
+ children: e.map((e) => /* @__PURE__ */ X("button", {
488
488
  type: "button",
489
489
  onClick: () => n(e.value),
490
490
  className: `px-2 py-0.5 rounded kol-helper-10 tracking-widest border transition-colors cursor-pointer ${e.value === t ? "bg-fg-16 border-oq-24 text-emphasis" : "bg-transparent border-oq-08 text-meta hover:border-oq-16 hover:text-body"}`,
491
491
  children: e.label
492
492
  }, e.value))
493
- }) : /* @__PURE__ */ J("div", {
493
+ }) : /* @__PURE__ */ X("div", {
494
494
  className: `flex flex-wrap items-center gap-x-5 gap-y-1.5${r ? " justify-between" : ""}`,
495
- children: e.map((e) => /* @__PURE__ */ J("button", {
495
+ children: e.map((e) => /* @__PURE__ */ X("button", {
496
496
  type: "button",
497
497
  onClick: () => n(e.value),
498
498
  className: ["kol-helper-12 cursor-pointer", e.value === t ? "text-emphasis" : "text-meta hover:text-emphasis"].join(" "),
@@ -500,15 +500,15 @@ function Mt({ options: e, active: t, onPick: n, spread: r = !1, pills: i = !1 })
500
500
  }, e.value))
501
501
  }) : null;
502
502
  }
503
- function Nt({ chips: e, active: t, onPick: n, spread: r, pills: i, title: a, tabStrip: o, preStrip: s, fx: c = !1, children: l }) {
504
- return /* @__PURE__ */ Y("div", {
503
+ function It({ chips: e, active: t, onPick: n, spread: r, pills: i, title: a, tabStrip: o, preStrip: s, fx: c = !1, children: l }) {
504
+ return /* @__PURE__ */ Z("div", {
505
505
  className: `flex flex-col gap-5${c ? " kol-labs-fx" : ""}`,
506
506
  children: [
507
- a && /* @__PURE__ */ J("p", {
507
+ a && /* @__PURE__ */ X("p", {
508
508
  className: "kol-eyebrow text-fg-96",
509
509
  children: a
510
510
  }),
511
- e && /* @__PURE__ */ J(Mt, {
511
+ e && /* @__PURE__ */ X(Ft, {
512
512
  options: e,
513
513
  active: t,
514
514
  onPick: n,
@@ -521,27 +521,27 @@ function Nt({ chips: e, active: t, onPick: n, spread: r, pills: i, title: a, tab
521
521
  ]
522
522
  });
523
523
  }
524
- function Pt({ layer: t, showMod: n }) {
525
- let a = i(), [o, c] = K("effect");
526
- W(() => {
524
+ function Lt({ layer: t, showMod: n }) {
525
+ let a = i(), [o, c] = J("effect");
526
+ K(() => {
527
527
  let e = () => c("effect");
528
528
  return window.addEventListener("kol:open-effects", e), () => window.removeEventListener("kol:open-effects", e);
529
529
  }, []);
530
- let { addFilter: l, replaceFilter: u, removeFilter: d, toggleFilter: p, updateLayer: h, palette: g } = f(), _ = ee(t.id, { history: "coalesce" }), v = r(t), y = v[0] ?? null, x = ae(z).find((e) => e.id === te(y?.id)), S = x?.id === "halftone", w = S ? (x?.filters ?? []).map((e) => ({
530
+ let { addFilter: l, replaceFilter: u, removeFilter: d, toggleFilter: f, updateLayer: m, palette: g } = p(), _ = ne(t.id, { history: "coalesce" }), v = r(t), y = v[0] ?? null, b = oe(z).find((e) => e.id === L(y?.id)), S = b?.id === "halftone", ee = S ? (b?.filters ?? []).map((e) => ({
531
531
  value: e.id,
532
532
  label: e.label
533
- })) : null, T = !S && y ? y.def.label : null, E = (e) => {
533
+ })) : null, w = !S && y ? y.def.label : null, T = (e) => {
534
534
  if (!y) {
535
535
  l(t.id, e);
536
536
  return;
537
537
  }
538
538
  e !== y.id && u(t.id, 0, e);
539
- }, D = v.map(({ def: e, ...t }) => t), O = y ? {
539
+ }, E = v.map(({ def: e, ...t }) => t), D = y ? {
540
540
  ...t,
541
541
  ...y.params,
542
542
  id: t.id
543
- } : t, k = (e) => (t, n) => {
544
- let r = D.map((r, i) => i === e ? {
543
+ } : t, O = (e) => (t, n) => {
544
+ let r = E.map((r, i) => i === e ? {
545
545
  ...r,
546
546
  params: {
547
547
  ...r.params,
@@ -549,74 +549,74 @@ function Pt({ layer: t, showMod: n }) {
549
549
  }
550
550
  } : r);
551
551
  _.patch({ filters: r });
552
- }, A = k(0), j = n ? (e) => /* @__PURE__ */ J(le, {
553
- layer: O,
552
+ }, k = O(0), te = n ? (e) => /* @__PURE__ */ X(ue, {
553
+ layer: D,
554
554
  param: e,
555
- setProp: A
556
- }) : void 0, M = (e) => {
557
- let n = D.map((t, n) => n === 0 ? {
555
+ setProp: k
556
+ }) : void 0, A = (e) => {
557
+ let n = E.map((t, n) => n === 0 ? {
558
558
  ...t,
559
559
  params: {
560
560
  ...t.params,
561
561
  ...e
562
562
  }
563
563
  } : t);
564
- h(t.id, { filters: n });
564
+ m(t.id, { filters: n });
565
565
  };
566
- Ot(() => {
567
- y && h(t.id, { filters: D.map((e, t) => t === 0 ? {
566
+ jt(() => {
567
+ y && m(t.id, { filters: E.map((e, t) => t === 0 ? {
568
568
  ...e,
569
569
  params: {}
570
570
  } : e) });
571
571
  }, () => {
572
- y && M(s(O, m(y.def.params, O), b()));
572
+ y && A(s(D, h(y.def.params, D), x()));
573
573
  });
574
- let N = t.fxGroup ? re.find((e) => e.id === t.fxGroup) : null;
575
- if (N) {
574
+ let j = t.fxGroup ? ie.find((e) => e.id === t.fxGroup) : null;
575
+ if (j) {
576
576
  let e = {
577
577
  chain: v,
578
578
  layer: t,
579
- hostView: O,
580
- toggleFilter: p,
579
+ hostView: D,
580
+ toggleFilter: f,
581
581
  removeFilter: d,
582
- setStagePropAt: k,
582
+ setStagePropAt: O,
583
583
  palette: g,
584
584
  showMod: n
585
585
  }, r = [{
586
586
  value: "",
587
587
  label: "Add effect…"
588
- }, ...ne(N, z).map((e) => ({
588
+ }, ...re(j, z).map((e) => ({
589
589
  value: e.id,
590
590
  label: `${e.label ?? e.id}${e.kind === "pixi" ? " · GPU" : ""}`
591
591
  }))];
592
- return /* @__PURE__ */ Y(Nt, {
592
+ return /* @__PURE__ */ Z(It, {
593
593
  title: "Effects",
594
594
  fx: !0,
595
- tabStrip: /* @__PURE__ */ J(U, {
595
+ tabStrip: /* @__PURE__ */ X(W, {
596
596
  variant: "filled",
597
597
  value: o,
598
598
  onChange: c,
599
- options: kt,
599
+ options: Mt,
600
600
  size: a,
601
601
  className: C(a)
602
602
  }),
603
- children: [o === "effect" && /* @__PURE__ */ Y(q, { children: [
604
- /* @__PURE__ */ Y(H, {
603
+ children: [o === "effect" && /* @__PURE__ */ Z(Y, { children: [
604
+ /* @__PURE__ */ Z(U, {
605
605
  label: "Effect Stack",
606
606
  divided: !0,
607
- children: [v.length === 0 && /* @__PURE__ */ J(L, {
607
+ children: [v.length === 0 && /* @__PURE__ */ X(I, {
608
608
  className: "kol-mono-10 text-meta",
609
609
  children: "No effects yet — add one below."
610
- }), /* @__PURE__ */ J(Ft, {
610
+ }), /* @__PURE__ */ X(Rt, {
611
611
  ...e,
612
612
  from: 0
613
613
  })]
614
614
  }),
615
- /* @__PURE__ */ J(st, {}),
616
- /* @__PURE__ */ J(H, {
617
- label: N.label,
615
+ /* @__PURE__ */ X(lt, {}),
616
+ /* @__PURE__ */ X(U, {
617
+ label: j.label,
618
618
  divided: !0,
619
- children: /* @__PURE__ */ J(ct, {
619
+ children: /* @__PURE__ */ X(ut, {
620
620
  variant: "subtle",
621
621
  size: a,
622
622
  className: "w-full",
@@ -628,33 +628,33 @@ function Pt({ layer: t, showMod: n }) {
628
628
  }
629
629
  })
630
630
  })
631
- ] }), o === "anim" && y?.def?.sweeps && /* @__PURE__ */ J(oe, {
631
+ ] }), o === "anim" && y?.def?.sweeps && /* @__PURE__ */ X(se, {
632
632
  sweeps: Array.isArray(y.params.sweeps) ? y.params.sweeps : [],
633
- onChange: (e) => A("sweeps", e),
633
+ onChange: (e) => k("sweeps", e),
634
634
  inline: !0
635
635
  })]
636
636
  });
637
637
  }
638
- if (!y) return /* @__PURE__ */ J(Nt, {
639
- chips: w,
638
+ if (!y) return /* @__PURE__ */ X(It, {
639
+ chips: ee,
640
640
  active: null,
641
- onPick: E,
641
+ onPick: T,
642
642
  spread: S,
643
643
  fx: !0,
644
- tabStrip: /* @__PURE__ */ J(U, {
644
+ tabStrip: /* @__PURE__ */ X(W, {
645
645
  variant: "filled",
646
646
  value: o,
647
647
  onChange: c,
648
- options: kt,
648
+ options: Mt,
649
649
  size: a,
650
650
  className: C(a)
651
651
  }),
652
- children: /* @__PURE__ */ J(I, {
653
- schema: Ue,
652
+ children: /* @__PURE__ */ X(F, {
653
+ schema: We,
654
654
  layer: t,
655
655
  setProp: _.setProp,
656
656
  palette: g,
657
- renderAnimate: (e) => /* @__PURE__ */ J(le, {
657
+ renderAnimate: (e) => /* @__PURE__ */ X(ue, {
658
658
  layer: t,
659
659
  param: e,
660
660
  setProp: _.setProp
@@ -663,94 +663,94 @@ function Pt({ layer: t, showMod: n }) {
663
663
  emptyHint: "Pick an effect from the nav."
664
664
  })
665
665
  });
666
- let P = y.def.params.filter((t) => e(t) !== "anim"), F = ce(y.def.id), R = F ? P.findIndex((e) => e.key === F) : -1, B = P.length;
667
- if (R >= 0) {
668
- let e = R;
669
- for (; e + 1 < P.length && P[e + 1].type === "select";) e++;
670
- B = e + 1;
666
+ let M = y.def.params.filter((t) => e(t) !== "anim"), N = le(y.def.id), P = N ? M.findIndex((e) => e.key === N) : -1, R = M.length;
667
+ if (P >= 0) {
668
+ let e = P;
669
+ for (; e + 1 < M.length && M[e + 1].type === "select";) e++;
670
+ R = e + 1;
671
671
  }
672
- let se = R > 0 ? P.slice(0, R) : [], ue = R >= 0 ? P.slice(R, B).map((e) => ({
672
+ let B = P > 0 ? M.slice(0, P) : [], ce = P >= 0 ? M.slice(P, R).map((e) => ({
673
673
  ...e,
674
674
  section: void 0
675
- })) : P, de = {
676
- layer: O,
677
- setProp: A,
675
+ })) : M, V = {
676
+ layer: D,
677
+ setProp: k,
678
678
  palette: g,
679
- renderAnimate: j,
679
+ renderAnimate: te,
680
680
  inline: !0
681
681
  };
682
- return /* @__PURE__ */ Y(Nt, {
683
- chips: w,
682
+ return /* @__PURE__ */ Z(It, {
683
+ chips: ee,
684
684
  active: y.id,
685
- onPick: E,
685
+ onPick: T,
686
686
  spread: S,
687
- title: T,
687
+ title: w,
688
688
  fx: !0,
689
- preStrip: /* @__PURE__ */ J(wt, { layer: t }),
690
- tabStrip: /* @__PURE__ */ J(U, {
689
+ preStrip: /* @__PURE__ */ X(Dt, { layer: t }),
690
+ tabStrip: /* @__PURE__ */ X(W, {
691
691
  variant: "filled",
692
692
  value: o,
693
693
  onChange: c,
694
- options: kt,
694
+ options: Mt,
695
695
  size: a,
696
696
  className: C(a)
697
697
  }),
698
- children: [o === "effect" && /* @__PURE__ */ Y(q, { children: [
699
- se.length > 0 && /* @__PURE__ */ J(I, {
700
- schema: se,
701
- ...de
698
+ children: [o === "effect" && /* @__PURE__ */ Z(Y, { children: [
699
+ B.length > 0 && /* @__PURE__ */ X(F, {
700
+ schema: B,
701
+ ...V
702
702
  }),
703
- /* @__PURE__ */ Y(H, {
703
+ /* @__PURE__ */ Z(U, {
704
704
  divided: !0,
705
- children: [/* @__PURE__ */ J(I, {
706
- schema: ue,
707
- ...de
708
- }), /* @__PURE__ */ J(ie, {
705
+ children: [/* @__PURE__ */ X(F, {
706
+ schema: ce,
707
+ ...V
708
+ }), /* @__PURE__ */ X(ae, {
709
709
  inline: !0,
710
710
  def: y.def,
711
- view: O,
711
+ view: D,
712
712
  tab: "effect",
713
- onPatch: M
713
+ onPatch: A
714
714
  })]
715
715
  }),
716
- /* @__PURE__ */ J(st, {}),
717
- B < P.length && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(I, {
718
- schema: P.slice(B),
719
- ...de
720
- }), /* @__PURE__ */ J(st, {})] }),
721
- /* @__PURE__ */ J(It, {
716
+ /* @__PURE__ */ X(lt, {}),
717
+ R < M.length && /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X(F, {
718
+ schema: M.slice(R),
719
+ ...V
720
+ }), /* @__PURE__ */ X(lt, {})] }),
721
+ /* @__PURE__ */ X(zt, {
722
722
  chain: v,
723
723
  layer: t,
724
- hostView: O,
724
+ hostView: D,
725
725
  addFilter: l,
726
726
  removeFilter: d,
727
- toggleFilter: p,
728
- setStagePropAt: k,
727
+ toggleFilter: f,
728
+ setStagePropAt: O,
729
729
  palette: g,
730
730
  showMod: n
731
731
  })
732
- ] }), o === "anim" && /* @__PURE__ */ Y(q, { children: [
733
- /* @__PURE__ */ J(I, {
732
+ ] }), o === "anim" && /* @__PURE__ */ Z(Y, { children: [
733
+ /* @__PURE__ */ X(F, {
734
734
  schema: y.def.params,
735
- ...de,
735
+ ...V,
736
736
  tab: "anim"
737
737
  }),
738
- /* @__PURE__ */ J(ie, {
738
+ /* @__PURE__ */ X(ae, {
739
739
  inline: !0,
740
740
  def: y.def,
741
- view: O,
741
+ view: D,
742
742
  tab: "anim",
743
- onPatch: M
743
+ onPatch: A
744
744
  }),
745
- y.def.sweeps && /* @__PURE__ */ J(oe, {
745
+ y.def.sweeps && /* @__PURE__ */ X(se, {
746
746
  sweeps: Array.isArray(y.params.sweeps) ? y.params.sweeps : [],
747
- onChange: (e) => A("sweeps", e),
747
+ onChange: (e) => k("sweeps", e),
748
748
  inline: !0
749
749
  })
750
750
  ] })]
751
751
  });
752
752
  }
753
- function Ft({ chain: t, from: n = 0, layer: r, hostView: a, toggleFilter: o, removeFilter: s, setStagePropAt: c, palette: l, showMod: u }) {
753
+ function Rt({ chain: t, from: n = 0, layer: r, hostView: a, toggleFilter: o, removeFilter: s, setStagePropAt: c, palette: l, showMod: u }) {
754
754
  let d = i();
755
755
  return t.slice(n).map((t, i) => {
756
756
  let f = i + n, p = t.enabled !== !1, m = {
@@ -758,36 +758,40 @@ function Ft({ chain: t, from: n = 0, layer: r, hostView: a, toggleFilter: o, rem
758
758
  ...t.params,
759
759
  id: r.id
760
760
  }, h = c(f);
761
- return /* @__PURE__ */ Y("div", {
762
- className: "flex flex-col gap-2 p-2 rounded bg-fg-04",
763
- children: [/* @__PURE__ */ Y("div", {
761
+ return /* @__PURE__ */ Z("div", {
762
+ className: "flex flex-col gap-2 p-2 rounded bg-oq-04",
763
+ children: [/* @__PURE__ */ Z("div", {
764
764
  className: "flex items-center gap-2",
765
- children: [/* @__PURE__ */ J(ut, {
765
+ children: [/* @__PURE__ */ X(ft, {
766
766
  size: d,
767
767
  checked: p,
768
768
  onChange: () => o(r.id, f),
769
769
  label: t.def?.label ?? t.id
770
- }), /* @__PURE__ */ J("button", {
771
- type: "button",
772
- "aria-label": "Remove effect",
773
- onClick: () => s(r.id, f),
774
- className: "ml-auto inline-flex items-center justify-center w-5 h-5 shrink-0 text-oq-64 hover:text-emphasis cursor-pointer",
775
- style: {
776
- border: "none",
777
- background: "transparent"
778
- },
779
- children: /* @__PURE__ */ J(X, {
780
- name: "x",
781
- size: 12
770
+ }), /* @__PURE__ */ X(G, {
771
+ asChild: !0,
772
+ label: "Remove effect",
773
+ children: /* @__PURE__ */ X("button", {
774
+ type: "button",
775
+ "aria-label": "Remove effect",
776
+ onClick: () => s(r.id, f),
777
+ className: "ml-auto inline-flex items-center justify-center w-5 h-5 shrink-0 text-oq-64 hover:text-emphasis cursor-pointer",
778
+ style: {
779
+ border: "none",
780
+ background: "transparent"
781
+ },
782
+ children: /* @__PURE__ */ X(Q, {
783
+ name: "x",
784
+ size: 12
785
+ })
782
786
  })
783
787
  })]
784
- }), p && t.def && /* @__PURE__ */ J(I, {
788
+ }), p && t.def && /* @__PURE__ */ X(F, {
785
789
  schema: t.def.params.filter((t) => e(t) !== "anim"),
786
790
  layer: m,
787
791
  setProp: h,
788
792
  palette: l,
789
793
  inline: !0,
790
- renderAnimate: u ? (e) => /* @__PURE__ */ J(le, {
794
+ renderAnimate: u ? (e) => /* @__PURE__ */ X(ue, {
791
795
  layer: m,
792
796
  param: e,
793
797
  setProp: h
@@ -796,7 +800,7 @@ function Ft({ chain: t, from: n = 0, layer: r, hostView: a, toggleFilter: o, rem
796
800
  }, t.key ?? f);
797
801
  });
798
802
  }
799
- function It({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: a, toggleFilter: o, setStagePropAt: s, palette: c, showMod: l }) {
803
+ function zt({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: a, toggleFilter: o, setStagePropAt: s, palette: c, showMod: l }) {
800
804
  let u = i(), d = [{
801
805
  value: "",
802
806
  label: "Add FX..."
@@ -804,10 +808,10 @@ function It({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: a, to
804
808
  value: e.id,
805
809
  label: e.label ?? e.id
806
810
  }))];
807
- return /* @__PURE__ */ Y(H, {
811
+ return /* @__PURE__ */ Z(U, {
808
812
  label: "Post-Processing",
809
813
  divided: !0,
810
- children: [/* @__PURE__ */ J(Ft, {
814
+ children: [/* @__PURE__ */ X(Rt, {
811
815
  chain: e,
812
816
  from: 1,
813
817
  layer: t,
@@ -817,7 +821,7 @@ function It({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: a, to
817
821
  setStagePropAt: s,
818
822
  palette: c,
819
823
  showMod: l
820
- }), /* @__PURE__ */ J(ct, {
824
+ }), /* @__PURE__ */ X(ut, {
821
825
  variant: "subtle",
822
826
  size: u,
823
827
  className: "w-full",
@@ -830,18 +834,18 @@ function It({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: a, to
830
834
  })]
831
835
  });
832
836
  }
833
- function Lt({ layer: e, showMod: t, tree: n }) {
834
- let r = i(), [a, o] = K("generate"), { updateLayer: c, palette: l } = f(), { setOnly: u } = Z(), d = ee(e.id, { history: "coalesce" }), p = T(e.loopGroup).find((t) => t.id === e.presetId), h = O(e.loopGroup)?.label ?? "", g = e.loopGroup === "paratype" && p?.sub === "Glyphs" ? E("paratype", "Glyphs") : null, _ = g ? g.map((e) => ({
837
+ function Bt({ layer: e, showMod: t, tree: n }) {
838
+ let r = i(), [a, o] = J("generate"), { updateLayer: c, palette: l } = p(), { setOnly: u } = vt(), d = ne(e.id, { history: "coalesce" }), f = T(e.loopGroup).find((t) => t.id === e.presetId), m = O(e.loopGroup)?.label ?? "", g = e.loopGroup === "paratype" && f?.sub === "Glyphs" ? E("paratype", "Glyphs") : null, _ = g ? g.map((e) => ({
835
839
  value: e.id,
836
840
  label: e.label
837
841
  })) : null;
838
- return Ot(() => {
839
- p && u(e.type, D(p, e.loopGroup));
842
+ return jt(() => {
843
+ f && u(e.type, D(f, e.loopGroup));
840
844
  }, () => {
841
845
  let t = k(e.loopId)?.params ?? [];
842
- c(e.id, s(e, m(t, e), b(), { withFilters: !0 }));
843
- }), /* @__PURE__ */ J(Nt, {
844
- title: h,
846
+ c(e.id, s(e, h(t, e), x(), { withFilters: !0 }));
847
+ }), /* @__PURE__ */ X(It, {
848
+ title: m,
845
849
  chips: _,
846
850
  active: e.presetId,
847
851
  onPick: (t) => {
@@ -849,22 +853,22 @@ function Lt({ layer: e, showMod: t, tree: n }) {
849
853
  n && t !== e.presetId && u(e.type, D(n, e.loopGroup));
850
854
  },
851
855
  pills: !0,
852
- preStrip: e.loopGroup === "distress" ? /* @__PURE__ */ J(wt, { layer: e }) : void 0,
853
- tabStrip: /* @__PURE__ */ J(U, {
856
+ preStrip: e.loopGroup === "distress" ? /* @__PURE__ */ X(Dt, { layer: e }) : void 0,
857
+ tabStrip: /* @__PURE__ */ X(W, {
854
858
  variant: "filled",
855
859
  value: a,
856
860
  onChange: o,
857
- options: r === "sm" ? At : jt,
861
+ options: r === "sm" ? Nt : Pt,
858
862
  size: r,
859
863
  className: C(r)
860
864
  }),
861
- children: /* @__PURE__ */ J(P, {
865
+ children: /* @__PURE__ */ X(N, {
862
866
  layer: e,
863
867
  setProp: d.setProp,
864
868
  patch: d.patch,
865
869
  updateLayer: c,
866
870
  palette: l,
867
- renderAnimate: t ? (t) => /* @__PURE__ */ J(le, {
871
+ renderAnimate: t ? (t) => /* @__PURE__ */ X(ue, {
868
872
  layer: e,
869
873
  param: t,
870
874
  setProp: d.setProp
@@ -876,38 +880,38 @@ function Lt({ layer: e, showMod: t, tree: n }) {
876
880
  })
877
881
  });
878
882
  }
879
- function Rt({ layer: e, showMod: t }) {
880
- let n = i(), [r, a] = K("generate"), { updateLayer: o, palette: s } = f(), { setOnly: c } = Z(), l = ee(e.id, { history: "coalesce" }), u = ue.find((t) => t.id === e.presetId), d = pe.find((e) => e.subs.includes(u?.sub))?.label ?? "Kinetic";
881
- return Ot(() => {
883
+ function Vt({ layer: e, showMod: t }) {
884
+ let n = i(), [r, a] = J("generate"), { updateLayer: o, palette: s } = p(), { setOnly: c } = vt(), l = ne(e.id, { history: "coalesce" }), u = V.find((t) => t.id === e.presetId), d = pe.find((e) => e.subs.includes(u?.sub))?.label ?? "Kinetic";
885
+ return jt(() => {
882
886
  u && c("kinetic", {
883
887
  presetId: u.id,
884
888
  presetLabel: u.label,
885
889
  comp: he(u)
886
890
  });
887
891
  }, () => {
888
- let t = b(), n = p(t >>> 0), r = e.comp ?? { instances: [] };
892
+ let t = x(), n = m(t >>> 0), r = e.comp ?? { instances: [] };
889
893
  (r.instances ?? []).forEach((e, t) => {
890
894
  r = de(r, t, n);
891
895
  }), o(e.id, {
892
896
  comp: r,
893
897
  _rollSeed: t
894
898
  });
895
- }), /* @__PURE__ */ J(Nt, {
899
+ }), /* @__PURE__ */ X(It, {
896
900
  title: d,
897
- tabStrip: /* @__PURE__ */ J(U, {
901
+ tabStrip: /* @__PURE__ */ X(W, {
898
902
  variant: "filled",
899
903
  value: r,
900
904
  onChange: a,
901
- options: n === "sm" ? At : jt,
905
+ options: n === "sm" ? Nt : Pt,
902
906
  size: n,
903
907
  className: C(n)
904
908
  }),
905
- children: /* @__PURE__ */ J(me, {
909
+ children: /* @__PURE__ */ X(me, {
906
910
  layer: e,
907
911
  setProp: l.setProp,
908
912
  updateLayer: o,
909
913
  palette: s,
910
- renderAnimate: t ? (t) => /* @__PURE__ */ J(le, {
914
+ renderAnimate: t ? (t) => /* @__PURE__ */ X(ue, {
911
915
  layer: e,
912
916
  param: t,
913
917
  setProp: l.setProp
@@ -917,33 +921,33 @@ function Rt({ layer: e, showMod: t }) {
917
921
  })
918
922
  });
919
923
  }
920
- function zt() {
921
- let { layer: e } = Z(), t = !!g().labsModDots;
922
- return W(() => {
924
+ function Ht() {
925
+ let { layer: e } = vt(), t = !!_().labsModDots;
926
+ return K(() => {
923
927
  let e = (e) => {
924
928
  if (e.key !== "m" && e.key !== "M" || e.metaKey || e.ctrlKey || e.altKey) return;
925
929
  let t = e.target;
926
- t?.tagName === "INPUT" || t?.tagName === "TEXTAREA" || t?.isContentEditable || d("labsModDots", !v().labsModDots);
930
+ t?.tagName === "INPUT" || t?.tagName === "TEXTAREA" || t?.isContentEditable || f("labsModDots", !y().labsModDots);
927
931
  };
928
932
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
929
- }, []), e ? e.type === "photo" ? /* @__PURE__ */ J(Pt, {
933
+ }, []), e ? e.type === "photo" ? /* @__PURE__ */ X(Lt, {
930
934
  layer: e,
931
935
  showMod: t
932
- }, e.id) : e.type === "loop" ? /* @__PURE__ */ J(Lt, {
936
+ }, e.id) : e.type === "loop" ? /* @__PURE__ */ X(Bt, {
933
937
  layer: e,
934
938
  showMod: t
935
- }, e.id) : e.type === "misc" ? /* @__PURE__ */ J(Lt, {
939
+ }, e.id) : e.type === "misc" ? /* @__PURE__ */ X(Bt, {
936
940
  layer: e,
937
941
  showMod: t,
938
- tree: N
939
- }, e.id) : e.type === "kinetic" ? /* @__PURE__ */ J(Rt, {
942
+ tree: M
943
+ }, e.id) : e.type === "kinetic" ? /* @__PURE__ */ X(Vt, {
940
944
  layer: e,
941
945
  showMod: t
942
- }, e.id) : /* @__PURE__ */ J(L, { children: "This layer has no labs surface." }) : /* @__PURE__ */ J(L, { children: "Pick an effect or generator from the nav." });
946
+ }, e.id) : /* @__PURE__ */ X(I, { children: "This layer has no labs surface." }) : /* @__PURE__ */ X(I, { children: "Pick an effect or generator from the nav." });
943
947
  }
944
948
  //#endregion
945
949
  //#region src/editor/labs/LabsShortcuts.jsx
946
- var Bt = [
950
+ var Ut = [
947
951
  ["0.5", "a plain value — stays put (normal slider)"],
948
952
  ["t", "counts up in seconds: 0, 1, 2 …"],
949
953
  ["t*0.1", "counts up slowly"],
@@ -953,79 +957,79 @@ var Bt = [
953
957
  ["wave(t*0.5)*40", "bounce, scaled to 0 … 40"],
954
958
  ["saw(t)", "ramp 0 → 1, repeat"],
955
959
  ["tri(t)", "triangle 0 → 1 → 0"]
956
- ], Vt = [
960
+ ], Wt = [
957
961
  ["Oscillators · 0…1", "wave saw tri pulse(t,w) ease(t,c) bell step(t,n)"],
958
962
  ["Trig", "sin cos tan atan2"],
959
963
  ["Math", "abs floor ceil round sqrt pow"],
960
964
  ["Helpers", "clamp(x,a,b) lerp(a,b,u) mod(a,b) frac smooth"],
961
965
  ["Constants", "PI TAU PHI E"]
962
- ], Ht = () => [...Pe("labs").flatMap(({ items: e }) => e.map((e) => [_e(e.combo), e.label])), ["Esc", "close"]];
963
- function Ut() {
964
- let [e, t] = K(!1);
965
- return W(() => {
966
+ ], Gt = () => [...Pe("labs").flatMap(({ items: e }) => e.map((e) => [Ce(e.combo), e.label])), ["Esc", "close"]];
967
+ function Kt() {
968
+ let [e, t] = J(!1);
969
+ return K(() => {
966
970
  let e = (e) => {
967
971
  let n = e.target;
968
972
  n?.tagName === "INPUT" || n?.tagName === "TEXTAREA" || n?.isContentEditable || (e.key === "Escape" && t(!1), (e.key === "s" || e.key === "S") && !e.metaKey && !e.ctrlKey && !e.altKey && (e.preventDefault(), t((e) => !e)));
969
973
  };
970
974
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
971
- }, []), e ? /* @__PURE__ */ J(lt, {
975
+ }, []), e ? /* @__PURE__ */ X(dt, {
972
976
  open: !0,
973
977
  onClose: () => t(!1),
974
- children: /* @__PURE__ */ Y("div", {
978
+ children: /* @__PURE__ */ Z("div", {
975
979
  className: "flex flex-col",
976
980
  style: {
977
981
  width: 640,
978
982
  maxWidth: "100%"
979
983
  },
980
- children: [/* @__PURE__ */ J("div", {
984
+ children: [/* @__PURE__ */ X("div", {
981
985
  className: "flex items-start justify-between px-6 pt-5",
982
- children: /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("p", {
986
+ children: /* @__PURE__ */ Z("div", { children: [/* @__PURE__ */ X("p", {
983
987
  className: "kol-eyebrow text-meta mb-1",
984
988
  children: "Shortcuts"
985
- }), /* @__PURE__ */ J("p", {
989
+ }), /* @__PURE__ */ X("p", {
986
990
  className: "kol-mono-16 text-emphasis",
987
991
  children: "Animate any value"
988
992
  })] })
989
- }), /* @__PURE__ */ Y("div", {
993
+ }), /* @__PURE__ */ Z("div", {
990
994
  className: "overflow-y-auto px-6 pb-6 flex flex-col gap-5",
991
995
  children: [
992
- /* @__PURE__ */ Y("p", {
996
+ /* @__PURE__ */ Z("p", {
993
997
  className: "kol-mono-12 text-body",
994
998
  children: [
995
999
  "Type math into any slider's number box instead of a number. It re-evaluates every frame, so the value animates — no keyframes.",
996
1000
  " ",
997
- /* @__PURE__ */ J("span", {
1001
+ /* @__PURE__ */ X("span", {
998
1002
  className: "text-emphasis",
999
1003
  children: "t"
1000
1004
  }),
1001
1005
  " is the playhead in seconds, so it pauses / scrubs / tempo-scales with the transport. Drag the slider to clear an expression."
1002
1006
  ]
1003
1007
  }),
1004
- /* @__PURE__ */ J(H, {
1008
+ /* @__PURE__ */ X(U, {
1005
1009
  label: "Examples",
1006
- children: /* @__PURE__ */ J("div", {
1010
+ children: /* @__PURE__ */ X("div", {
1007
1011
  className: "flex flex-col gap-1",
1008
- children: Bt.map(([e, t]) => /* @__PURE__ */ Y("div", {
1012
+ children: Ut.map(([e, t]) => /* @__PURE__ */ Z("div", {
1009
1013
  className: "flex items-center gap-4",
1010
- children: [/* @__PURE__ */ J("code", {
1011
- className: "kol-mono-12 text-emphasis bg-fg-04 rounded px-2 py-0.5",
1014
+ children: [/* @__PURE__ */ X("code", {
1015
+ className: "kol-mono-12 text-emphasis bg-oq-04 rounded px-2 py-0.5",
1012
1016
  style: { minWidth: 132 },
1013
1017
  children: e
1014
- }), /* @__PURE__ */ J("span", {
1018
+ }), /* @__PURE__ */ X("span", {
1015
1019
  className: "kol-mono-12 text-body flex-1 min-w-0",
1016
1020
  children: t
1017
1021
  })]
1018
1022
  }, e))
1019
1023
  })
1020
1024
  }),
1021
- /* @__PURE__ */ J(H, {
1025
+ /* @__PURE__ */ X(U, {
1022
1026
  label: "Loop",
1023
- children: /* @__PURE__ */ Y("p", {
1027
+ children: /* @__PURE__ */ Z("p", {
1024
1028
  className: "kol-mono-12 text-body",
1025
1029
  children: [
1026
1030
  "The transport clock is a loop, not a BPM —",
1027
1031
  " ",
1028
- /* @__PURE__ */ J("span", {
1032
+ /* @__PURE__ */ X("span", {
1029
1033
  className: "text-emphasis",
1030
1034
  children: "Loop / N s"
1031
1035
  }),
@@ -1033,30 +1037,30 @@ function Ut() {
1033
1037
  ]
1034
1038
  })
1035
1039
  }),
1036
- /* @__PURE__ */ J(H, {
1040
+ /* @__PURE__ */ X(U, {
1037
1041
  label: "Functions",
1038
- children: /* @__PURE__ */ J("div", {
1042
+ children: /* @__PURE__ */ X("div", {
1039
1043
  className: "flex flex-col gap-2",
1040
- children: Vt.map(([e, t]) => /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("p", {
1044
+ children: Wt.map(([e, t]) => /* @__PURE__ */ Z("div", { children: [/* @__PURE__ */ X("p", {
1041
1045
  className: "kol-helper-10 text-subtle",
1042
1046
  children: e
1043
- }), /* @__PURE__ */ J("p", {
1047
+ }), /* @__PURE__ */ X("p", {
1044
1048
  className: "kol-mono-12 text-emphasis",
1045
1049
  children: t
1046
1050
  })] }, e))
1047
1051
  })
1048
1052
  }),
1049
- /* @__PURE__ */ J("div", {
1053
+ /* @__PURE__ */ X("div", {
1050
1054
  className: "pt-3 border-t border-oq-08 flex flex-wrap gap-x-5 gap-y-1",
1051
- children: Ht().map(([e, t]) => /* @__PURE__ */ Y("span", {
1055
+ children: Gt().map(([e, t]) => /* @__PURE__ */ Z("span", {
1052
1056
  className: "kol-mono-12",
1053
1057
  children: [
1054
- /* @__PURE__ */ J("span", {
1058
+ /* @__PURE__ */ X("span", {
1055
1059
  className: "text-emphasis",
1056
1060
  children: e
1057
1061
  }),
1058
1062
  " ",
1059
- /* @__PURE__ */ J("span", {
1063
+ /* @__PURE__ */ X("span", {
1060
1064
  className: "text-meta",
1061
1065
  children: t
1062
1066
  })
@@ -1070,23 +1074,23 @@ function Ut() {
1070
1074
  }
1071
1075
  //#endregion
1072
1076
  //#region src/editor/labs/LabsView.jsx
1073
- var Wt = .85, Gt = .3, Kt = 2.5, qt = {
1077
+ var qt = .85, Jt = .3, Yt = 2.5, Xt = {
1074
1078
  0: 1,
1075
1079
  1: .5,
1076
1080
  2: 1,
1077
1081
  3: 1.5,
1078
1082
  4: 2
1079
- }, Jt = "px-2 py-1 rounded border border-oq-08 bg-surface-secondary kol-mono-12 text-emphasis tabular-nums";
1080
- function Yt() {
1081
- let { layer: e } = Z(), t = e?.type === "photo" && !e.src && e.srcType !== "webcam", [n, r] = K(1), [i, a] = K(!1), o = Te(i), s = G(null), c = (e) => Math.min(Kt, Math.max(Gt, e)), l = (e) => r((t) => c(t * (e > 0 ? 1.25 : .8))), { tool: u } = Se(), d = u === "orbit", f = G(d);
1082
- return f.current = d, W(() => {
1083
+ }, Zt = "px-2 py-1 rounded border border-oq-08 bg-surface-secondary kol-mono-12 text-emphasis tabular-nums";
1084
+ function Qt() {
1085
+ let { layer: e } = vt(), t = e?.type === "photo" && !e.src && e.srcType !== "webcam", [n, r] = J(1), [i, a] = J(!1), o = ct(i), s = q(null), c = (e) => Math.min(Yt, Math.max(Jt, e)), l = (e) => r((t) => c(t * (e > 0 ? 1.25 : .8))), { tool: u } = $e(), d = u === "orbit", f = q(d);
1086
+ return f.current = d, K(() => {
1083
1087
  let e = s.current;
1084
1088
  if (!e) return;
1085
1089
  let t = (e) => {
1086
1090
  f.current || (e.preventDefault(), r((t) => c(t * (e.deltaY > 0 ? .94 : 1.06))));
1087
1091
  };
1088
1092
  return e.addEventListener("wheel", t, { passive: !1 }), () => e.removeEventListener("wheel", t);
1089
- }, []), W(() => {
1093
+ }, []), K(() => {
1090
1094
  let e = (e) => {
1091
1095
  if (e.metaKey || e.ctrlKey || e.altKey) return;
1092
1096
  let t = e.target;
@@ -1095,58 +1099,58 @@ function Yt() {
1095
1099
  a((e) => !e);
1096
1100
  return;
1097
1101
  }
1098
- qt[e.key] !== void 0 && r(qt[e.key]);
1102
+ Xt[e.key] !== void 0 && r(Xt[e.key]);
1099
1103
  }
1100
1104
  };
1101
1105
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
1102
- }, []), /* @__PURE__ */ Y("div", {
1106
+ }, []), /* @__PURE__ */ Z("div", {
1103
1107
  ref: s,
1104
1108
  className: "relative w-full h-full flex items-center justify-center",
1105
1109
  style: { background: "var(--kol-surface-secondary)" },
1106
1110
  onDoubleClick: () => r(1),
1107
- children: [t ? /* @__PURE__ */ J(Dt, { layer: e }) : /* @__PURE__ */ J("div", {
1111
+ children: [t ? /* @__PURE__ */ X(At, { layer: e }) : /* @__PURE__ */ X("div", {
1108
1112
  style: {
1109
- width: `${n * Wt * 100}%`,
1110
- height: `${n * Wt * 100}%`
1113
+ width: `${n * qt * 100}%`,
1114
+ height: `${n * qt * 100}%`
1111
1115
  },
1112
- children: /* @__PURE__ */ J(tt, {})
1113
- }), /* @__PURE__ */ Y("div", {
1116
+ children: /* @__PURE__ */ X(rt, {})
1117
+ }), /* @__PURE__ */ Z("div", {
1114
1118
  className: "absolute bottom-3 right-3 z-[3] flex items-center gap-2",
1115
1119
  children: [
1116
- /* @__PURE__ */ J(dt, {
1120
+ /* @__PURE__ */ X(G, {
1117
1121
  label: "Zoom out",
1118
- children: /* @__PURE__ */ J("button", {
1122
+ children: /* @__PURE__ */ X("button", {
1119
1123
  "aria-label": "Zoom out",
1120
1124
  type: "button",
1121
- className: Jt,
1125
+ className: Zt,
1122
1126
  onClick: () => l(-1),
1123
1127
  children: "−"
1124
1128
  })
1125
1129
  }),
1126
- /* @__PURE__ */ J(dt, {
1130
+ /* @__PURE__ */ X(G, {
1127
1131
  label: "Reset zoom (0)",
1128
- children: /* @__PURE__ */ Y("button", {
1132
+ children: /* @__PURE__ */ Z("button", {
1129
1133
  "aria-label": "Reset zoom (0)",
1130
1134
  type: "button",
1131
- className: Jt,
1135
+ className: Zt,
1132
1136
  onClick: () => r(1),
1133
1137
  children: [Math.round(n * 100), "%"]
1134
1138
  })
1135
1139
  }),
1136
- /* @__PURE__ */ J(dt, {
1140
+ /* @__PURE__ */ X(G, {
1137
1141
  label: "Zoom in",
1138
- children: /* @__PURE__ */ J("button", {
1142
+ children: /* @__PURE__ */ X("button", {
1139
1143
  "aria-label": "Zoom in",
1140
1144
  type: "button",
1141
- className: Jt,
1145
+ className: Zt,
1142
1146
  onClick: () => l(1),
1143
1147
  children: "+"
1144
1148
  })
1145
1149
  }),
1146
- i && /* @__PURE__ */ J(dt, {
1150
+ i && /* @__PURE__ */ X(G, {
1147
1151
  label: "Framerate — press F to hide",
1148
- children: /* @__PURE__ */ Y("span", {
1149
- className: Jt,
1152
+ children: /* @__PURE__ */ Z("span", {
1153
+ className: Zt,
1150
1154
  children: [o, " fps"]
1151
1155
  })
1152
1156
  })
@@ -1154,12 +1158,12 @@ function Yt() {
1154
1158
  })]
1155
1159
  });
1156
1160
  }
1157
- function Xt() {
1158
- let e = G(null), { grabProps: t } = ht(e, {
1161
+ function $t() {
1162
+ let e = q(null), { grabProps: t } = gt(e, {
1159
1163
  token: "kol-rail",
1160
1164
  side: "right"
1161
1165
  });
1162
- return W(() => {
1166
+ return K(() => {
1163
1167
  let e = document.documentElement, t = !1, n = () => {
1164
1168
  let t = parseFloat(getComputedStyle(e).getPropertyValue("--kol-shell-rail-width"));
1165
1169
  return Number.isFinite(t) ? t <= 49 : null;
@@ -1196,42 +1200,45 @@ function Xt() {
1196
1200
  }), () => {
1197
1201
  c.disconnect(), l.disconnect();
1198
1202
  };
1199
- }, []), /* @__PURE__ */ Y("div", {
1203
+ }, []), /* @__PURE__ */ Z("div", {
1200
1204
  ref: e,
1201
1205
  className: "kol-compose-rail kol-compose-rail--inspector",
1202
- children: [/* @__PURE__ */ J("div", { ...t }), /* @__PURE__ */ J("div", {
1206
+ children: [/* @__PURE__ */ X("div", { ...t }), /* @__PURE__ */ X("div", {
1203
1207
  className: "kol-compose-inspector-body",
1204
- children: /* @__PURE__ */ J(zt, {})
1208
+ children: /* @__PURE__ */ X(Ht, {})
1205
1209
  })]
1206
1210
  });
1207
1211
  }
1208
- var Zt = ft(null);
1209
- function Qt() {
1210
- let { paramsOpen: e, toggleParams: t } = mt(Zt);
1211
- return /* @__PURE__ */ J("div", {
1212
+ var en = pt(null);
1213
+ function tn() {
1214
+ let { paramsOpen: e, toggleParams: t } = ht(en);
1215
+ return /* @__PURE__ */ X("div", {
1212
1216
  className: "flex h-12 shrink-0 items-center border-b border-oq-08 bg-surface-primary px-2",
1213
- children: /* @__PURE__ */ J(V, {
1214
- variant: "nav",
1215
- size: "lg",
1216
- iconOnly: "panel-right",
1217
- "aria-label": "Parameters",
1218
- pressed: e,
1219
- onClick: t
1217
+ children: /* @__PURE__ */ X(G, {
1218
+ label: "Parameters",
1219
+ children: /* @__PURE__ */ X(H, {
1220
+ variant: "nav",
1221
+ size: "lg",
1222
+ iconOnly: "panel-right",
1223
+ "aria-label": "Parameters",
1224
+ pressed: e,
1225
+ onClick: t
1226
+ })
1220
1227
  })
1221
1228
  });
1222
1229
  }
1223
- function $t() {
1224
- return /* @__PURE__ */ J("div", {
1230
+ function nn() {
1231
+ return /* @__PURE__ */ X("div", {
1225
1232
  className: "kol-compose-rail kol-compose-rail--inspector",
1226
- children: /* @__PURE__ */ J("div", {
1233
+ children: /* @__PURE__ */ X("div", {
1227
1234
  className: "kol-compose-inspector-body",
1228
- children: /* @__PURE__ */ J(zt, {})
1235
+ children: /* @__PURE__ */ X(Ht, {})
1229
1236
  })
1230
1237
  });
1231
1238
  }
1232
- var en = {
1239
+ var rn = {
1233
1240
  topbar: () => null,
1234
- canvas: Yt,
1241
+ canvas: Qt,
1235
1242
  panels: [
1236
1243
  {
1237
1244
  slot: "canvas.footer",
@@ -1241,39 +1248,39 @@ var en = {
1241
1248
  {
1242
1249
  slot: "right.body",
1243
1250
  order: 0,
1244
- Component: Xt
1251
+ Component: $t
1245
1252
  },
1246
1253
  {
1247
1254
  slot: "right.footer",
1248
1255
  order: 0,
1249
- Component: Je
1256
+ Component: Ye
1250
1257
  }
1251
1258
  ]
1252
- }, tn = {
1253
- ...en,
1254
- topbar: Qt,
1255
- panels: en.panels.map((e) => e.Component === Xt ? {
1259
+ }, an = {
1260
+ ...rn,
1261
+ topbar: tn,
1262
+ panels: rn.panels.map((e) => e.Component === $t ? {
1256
1263
  ...e,
1257
- Component: $t
1264
+ Component: nn
1258
1265
  } : e)
1259
1266
  };
1260
- function nn() {
1261
- let { setAspect: e, selectedId: n, select: r } = f(), { layer: i, setOnly: a } = Z(), o = G(!1), s = Qe() && !Xe(), [l, u] = K(!1);
1262
- ot(), W(() => {
1267
+ function on() {
1268
+ let { setAspect: e, selectedId: n, select: r } = p(), { layer: i, setOnly: a } = vt(), o = q(!1), s = et() && !Ze(), [c, u] = J(!1);
1269
+ Fe(), K(() => {
1263
1270
  if (o.current) return;
1264
1271
  o.current = !0;
1265
- let n = v();
1272
+ let n = y();
1266
1273
  n.defaultAspect && n.defaultAspect !== "custom" && e(n.defaultAspect), n.defaultLoopSeconds && t.setLoopSeconds(n.defaultLoopSeconds);
1267
1274
  }, []);
1268
- let d = G(!1);
1269
- W(() => {
1275
+ let d = q(!1);
1276
+ K(() => {
1270
1277
  if (d.current) return;
1271
1278
  d.current = !0;
1272
- let e = new URLSearchParams(window.location.search).get("preset"), t = e ? j(e) : null;
1279
+ let e = new URLSearchParams(window.location.search).get("preset"), t = e ? A(e) : null;
1273
1280
  t && a("loop", D(w(e), t));
1274
1281
  }, [a]);
1275
- let { tool: p, setTool: m } = Se(), h = G(p);
1276
- return h.current = p, W(() => {
1282
+ let { tool: f, setTool: m } = $e(), h = q(f);
1283
+ return h.current = f, K(() => {
1277
1284
  let e = (e) => {
1278
1285
  let n = e.target;
1279
1286
  if (!(n?.tagName === "INPUT" || n?.tagName === "TEXTAREA" || n?.isContentEditable)) {
@@ -1285,79 +1292,79 @@ function nn() {
1285
1292
  }
1286
1293
  };
1287
1294
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
1288
- }, [m]), W(() => {
1295
+ }, [m]), K(() => {
1289
1296
  if (!i?.presetId) return;
1290
1297
  let e = new URLSearchParams(window.location.search);
1291
1298
  e.get("preset") !== i.presetId && (e.set("view", "labs"), e.set("preset", i.presetId), i.loopGroup ? e.set("cat", i.loopGroup) : e.delete("cat"), window.history.replaceState(null, "", `${window.location.pathname}?${e}`));
1292
- }, [i?.presetId, i?.loopGroup]), W(() => {
1299
+ }, [i?.presetId, i?.loopGroup]), K(() => {
1293
1300
  i && n !== i.id && r(i.id);
1294
1301
  }, [
1295
1302
  i,
1296
1303
  n,
1297
1304
  r
1298
- ]), /* @__PURE__ */ Y("div", {
1305
+ ]), /* @__PURE__ */ Z("div", {
1299
1306
  className: "kol-editor-labs contents",
1300
1307
  "data-touch": s || void 0,
1301
- "data-params": l ? "open" : void 0,
1308
+ "data-params": c ? "open" : void 0,
1302
1309
  children: [
1303
- /* @__PURE__ */ J(St, {}),
1304
- s ? /* @__PURE__ */ J(Zt.Provider, {
1310
+ /* @__PURE__ */ X(Tt, {}),
1311
+ s ? /* @__PURE__ */ X(en.Provider, {
1305
1312
  value: {
1306
- paramsOpen: l,
1313
+ paramsOpen: c,
1307
1314
  toggleParams: () => u((e) => !e)
1308
1315
  },
1309
- children: /* @__PURE__ */ J(c.Provider, {
1316
+ children: /* @__PURE__ */ X(l.Provider, {
1310
1317
  value: "md",
1311
- children: /* @__PURE__ */ J(Re, { registry: tn })
1318
+ children: /* @__PURE__ */ X(Me, { registry: an })
1312
1319
  })
1313
- }) : /* @__PURE__ */ J(Re, { registry: en }),
1314
- /* @__PURE__ */ J(Ut, {})
1320
+ }) : /* @__PURE__ */ X(Me, { registry: rn }),
1321
+ /* @__PURE__ */ X(Kt, {})
1315
1322
  ]
1316
1323
  });
1317
1324
  }
1318
- var rn = "kol.editor.labs-draft";
1319
- function an() {
1320
- return /* @__PURE__ */ J(Ze, {
1321
- draftKey: rn,
1322
- children: /* @__PURE__ */ J(nn, {})
1325
+ var sn = "kol.editor.labs-draft";
1326
+ function cn() {
1327
+ return /* @__PURE__ */ X(Qe, {
1328
+ draftKey: sn,
1329
+ children: /* @__PURE__ */ X(on, {})
1323
1330
  });
1324
1331
  }
1325
1332
  //#endregion
1326
1333
  //#region src/editor/mobile/CategoryScreen.jsx
1327
- var on = "w-full [&>span]:w-full [&>span]:justify-between";
1328
- function sn(e) {
1329
- W(() => {
1334
+ var ln = "w-full [&>span]:w-full [&>span]:justify-between";
1335
+ function un(e) {
1336
+ K(() => {
1330
1337
  let t = (t) => {
1331
1338
  t.key === "Escape" && e?.();
1332
1339
  };
1333
1340
  return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
1334
- }, [e]), W(() => {
1341
+ }, [e]), K(() => {
1335
1342
  let e = t.isPlaying();
1336
1343
  return t.pause(), () => {
1337
1344
  e && t.play();
1338
1345
  };
1339
1346
  }, []);
1340
1347
  }
1341
- function cn({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
1342
- return sn(r ?? n), /* @__PURE__ */ J("div", {
1348
+ function dn({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
1349
+ return un(r ?? n), /* @__PURE__ */ X("div", {
1343
1350
  className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center overflow-y-auto p-6",
1344
1351
  style: { zIndex: "var(--kol-z-modal)" },
1345
- children: /* @__PURE__ */ Y("div", {
1352
+ children: /* @__PURE__ */ Z("div", {
1346
1353
  className: "my-auto w-full max-w-sm rounded p-8 flex flex-col gap-6",
1347
1354
  style: { background: "var(--kol-surface-primary)" },
1348
1355
  children: [
1349
- /* @__PURE__ */ J("div", {
1356
+ /* @__PURE__ */ X("div", {
1350
1357
  className: "kol-eyebrow text-body",
1351
1358
  children: "Pick a generator"
1352
1359
  }),
1353
- /* @__PURE__ */ J("div", {
1360
+ /* @__PURE__ */ X("div", {
1354
1361
  className: "flex flex-col gap-2",
1355
- children: F.map((t) => {
1356
- let n = Q[`gen:${t.label}`] ?? "square";
1357
- return /* @__PURE__ */ J(V, {
1362
+ children: P.map((t) => {
1363
+ let n = $[`gen:${t.label}`] ?? "square";
1364
+ return /* @__PURE__ */ X(H, {
1358
1365
  variant: "primary",
1359
1366
  size: "lg",
1360
- className: on,
1367
+ className: ln,
1361
1368
  iconLeft: n,
1362
1369
  iconRight: n,
1363
1370
  onClick: () => e(t),
@@ -1365,9 +1372,9 @@ function cn({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
1365
1372
  }, t.label);
1366
1373
  })
1367
1374
  }),
1368
- /* @__PURE__ */ Y("div", {
1375
+ /* @__PURE__ */ Z("div", {
1369
1376
  className: "flex flex-col gap-2",
1370
- children: [t && /* @__PURE__ */ J(V, {
1377
+ children: [t && /* @__PURE__ */ X(H, {
1371
1378
  variant: "grey",
1372
1379
  size: "lg",
1373
1380
  className: "w-full [&>span]:w-full [&>span]:justify-between",
@@ -1375,7 +1382,7 @@ function cn({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
1375
1382
  iconRight: "image",
1376
1383
  onClick: t,
1377
1384
  children: "Insert image or video"
1378
- }), n && /* @__PURE__ */ J(V, {
1385
+ }), n && /* @__PURE__ */ X(H, {
1379
1386
  variant: "grey",
1380
1387
  size: "lg",
1381
1388
  className: "w-full [&>span]:w-full [&>span]:justify-between",
@@ -1391,37 +1398,37 @@ function cn({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
1391
1398
  }
1392
1399
  //#endregion
1393
1400
  //#region src/editor/mobile/EffectScreen.jsx
1394
- function ln({ layer: e, chain: t, onPick: n, onBack: r }) {
1395
- let [i, a] = K(null);
1396
- sn(r);
1397
- let { engineHost: o } = se(e), s = o && !t.some((e) => e.def?.kind === "engine"), c = R(z.filter((e) => e.kind !== "engine" || s)), l = c.find((e) => e.id === i) ?? null;
1398
- return /* @__PURE__ */ J("div", {
1401
+ function fn({ layer: e, chain: t, onPick: n, onBack: r }) {
1402
+ let [i, a] = J(null);
1403
+ un(r);
1404
+ let { engineHost: o } = ce(e), s = o && !t.some((e) => e.def?.kind === "engine"), c = R(z.filter((e) => e.kind !== "engine" || s)), l = c.find((e) => e.id === i) ?? null;
1405
+ return /* @__PURE__ */ X("div", {
1399
1406
  className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center overflow-y-auto p-6",
1400
1407
  style: { zIndex: "var(--kol-z-modal)" },
1401
- children: /* @__PURE__ */ Y("div", {
1408
+ children: /* @__PURE__ */ Z("div", {
1402
1409
  className: "my-auto w-full max-w-sm rounded p-8 flex flex-col gap-6",
1403
1410
  style: { background: "var(--kol-surface-primary)" },
1404
1411
  children: [
1405
- /* @__PURE__ */ J("div", {
1412
+ /* @__PURE__ */ X("div", {
1406
1413
  className: "kol-eyebrow text-body",
1407
1414
  children: l ? l.label : "Pick an effect"
1408
1415
  }),
1409
- /* @__PURE__ */ J("div", {
1416
+ /* @__PURE__ */ X("div", {
1410
1417
  className: "flex flex-col gap-2",
1411
- children: (l ? l.filters : c).map((e) => /* @__PURE__ */ J(V, {
1418
+ children: (l ? l.filters : c).map((e) => /* @__PURE__ */ X(H, {
1412
1419
  variant: "primary",
1413
1420
  size: "lg",
1414
- className: on,
1421
+ className: ln,
1415
1422
  iconLeft: l ? "filter" : "chevron-right",
1416
1423
  iconRight: l ? "filter" : "chevron-right",
1417
1424
  onClick: () => l ? n(e.id) : a(e.id),
1418
1425
  children: e.label
1419
1426
  }, e.id))
1420
1427
  }),
1421
- /* @__PURE__ */ J(V, {
1428
+ /* @__PURE__ */ X(H, {
1422
1429
  variant: "grey",
1423
1430
  size: "lg",
1424
- className: on,
1431
+ className: ln,
1425
1432
  iconLeft: "arrow-left",
1426
1433
  iconRight: "arrow-left",
1427
1434
  onClick: () => l ? a(null) : r(),
@@ -1433,7 +1440,7 @@ function ln({ layer: e, chain: t, onPick: n, onBack: r }) {
1433
1440
  }
1434
1441
  //#endregion
1435
1442
  //#region src/editor/mobile/MobileOverlay.jsx
1436
- var un = { background: "var(--kol-surface-primary)" }, dn = [
1443
+ var pn = { background: "var(--kol-surface-primary)" }, mn = [
1437
1444
  {
1438
1445
  value: "generate",
1439
1446
  label: "Generate"
@@ -1450,27 +1457,27 @@ var un = { background: "var(--kol-surface-primary)" }, dn = [
1450
1457
  value: "output",
1451
1458
  label: "Output"
1452
1459
  }
1453
- ], fn = dn.filter((e) => e.value !== "generate"), pn = "[&_.kol-seg-cell]:min-w-0 [&_.kol-seg-cell]:px-1 [&_.kol-seg-cell]:overflow-hidden [@media(hover:none)]:[&_.kol-seg-cell:hover]:text-[var(--kol-oq-48)]", mn = 9.6, hn = 10;
1454
- function gn(e) {
1460
+ ], hn = mn.filter((e) => e.value !== "generate"), gn = "[&_.kol-seg-cell]:min-w-0 [&_.kol-seg-cell]:px-1 [&_.kol-seg-cell]:overflow-hidden [@media(hover:none)]:[&_.kol-seg-cell:hover]:text-[var(--kol-oq-48)]", _n = 9.6, vn = 10;
1461
+ function yn(e) {
1455
1462
  let t = Math.min(window.innerWidth, 480) - 24, n = [], r = [], i = 0;
1456
1463
  for (let a of e) {
1457
- let e = a.label.length * mn + hn, o = Math.max(i, e);
1464
+ let e = a.label.length * _n + vn, o = Math.max(i, e);
1458
1465
  r.length && (r.length + 1) * o > t ? (n.push(r), r = [a], i = e) : (r.push(a), i = o);
1459
1466
  }
1460
1467
  return r.length && n.push(r), n;
1461
1468
  }
1462
- function _n({ cells: e }) {
1463
- return gn(e).map((e, t) => /* @__PURE__ */ J(U, {
1469
+ function bn({ cells: e }) {
1470
+ return yn(e).map((e, t) => /* @__PURE__ */ X(W, {
1464
1471
  variant: "filled",
1465
1472
  value: null,
1466
1473
  onChange: (t) => e.find((e) => e.value === t)?.run(),
1467
1474
  options: e,
1468
1475
  size: "lg",
1469
1476
  ariaLabel: "Randomize scope",
1470
- className: pn
1477
+ className: gn
1471
1478
  }, t));
1472
1479
  }
1473
- var vn = [
1480
+ var xn = [
1474
1481
  2,
1475
1482
  4,
1476
1483
  8,
@@ -1479,18 +1486,18 @@ var vn = [
1479
1486
  value: String(e),
1480
1487
  label: `${e}s`
1481
1488
  }));
1482
- function yn() {
1489
+ function Sn() {
1483
1490
  let { loopSeconds: e, setLoopSeconds: t } = n();
1484
- return /* @__PURE__ */ J(U, {
1491
+ return /* @__PURE__ */ X(W, {
1485
1492
  variant: "filled",
1486
1493
  value: String(e),
1487
1494
  onChange: (e) => t(Number(e)),
1488
- options: vn,
1495
+ options: xn,
1489
1496
  size: "lg",
1490
1497
  ariaLabel: "Loop length"
1491
1498
  });
1492
1499
  }
1493
- var bn = [
1500
+ var Cn = [
1494
1501
  {
1495
1502
  value: "9:16",
1496
1503
  label: "9:16"
@@ -1507,7 +1514,7 @@ var bn = [
1507
1514
  value: "1:1",
1508
1515
  label: "1:1"
1509
1516
  }
1510
- ], xn = [
1517
+ ], wn = [
1511
1518
  {
1512
1519
  value: "5:4",
1513
1520
  label: "5:4"
@@ -1525,54 +1532,56 @@ var bn = [
1525
1532
  label: "Fill"
1526
1533
  }
1527
1534
  ];
1528
- function Sn({ layer: e, onSwitchCategory: n, onInsert: i, onRestart: o, aspectValue: c, onAspect: d }) {
1529
- let { updateLayer: p, addFilter: g, removeFilter: v } = f(), { onExportPng: y } = Ee(), [b, x] = K(!1), [S, C] = K(!0), [w, T] = K(!1), [E, D] = K(!1), [A, j] = K("generate"), M = l(e);
1530
- if (!e) return null;
1531
- if (b) return /* @__PURE__ */ J("button", {
1535
+ function Tn({ layer: e, onSwitchCategory: n, onInsert: i, onRestart: o, aspectValue: c, onAspect: l, openEffects: f = !1 }) {
1536
+ let { updateLayer: m, addFilter: _, removeFilter: y } = p(), { onExportPng: b } = Ae(), [x, S] = J(!1), [ee, C] = J(!0), [w, T] = J(!1), [E, D] = J(!1), [te, A] = J("generate"), j = u(e);
1537
+ if (K(() => {
1538
+ f && (C(!0), D(!0));
1539
+ }, [f]), !e) return null;
1540
+ if (x) return /* @__PURE__ */ X("button", {
1532
1541
  "aria-label": "Show controls",
1533
1542
  className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] z-20",
1534
- onClick: () => x(!1)
1543
+ onClick: () => S(!1)
1535
1544
  });
1536
- let N = e.type === "loop", P = N ? `${O(e.loopGroup).label} · ${e.presetLabel}` : "Media", F = N ? k(e.loopId)?.params ?? [] : [], I = N ? h(F, e) : [], L = () => p(e.id, s(e, m(F, e), M.take(), { withFilters: !0 })), ee = (t) => p(e.id, s(e, t.params, M.take(), { stripNoRandom: !!t.motion })), te = () => {
1537
- let t = u(e, M.take());
1538
- t && p(e.id, t);
1539
- }, R = r(e), { effectable: ne } = se(e), z = () => {
1540
- let t = _(e, M.take());
1541
- t && p(e.id, { filters: t });
1545
+ let M = e.type === "loop", N = M ? `${O(e.loopGroup).label} · ${e.presetLabel}` : "Media", P = M ? k(e.loopId)?.params ?? [] : [], F = M ? g(P, e) : [], I = () => m(e.id, s(e, h(P, e), j.take(), { withFilters: !0 })), ne = (t) => m(e.id, s(e, t.params, j.take(), { stripNoRandom: !!t.motion })), L = () => {
1546
+ let t = d(e, j.take());
1547
+ t && m(e.id, t);
1548
+ }, R = r(e), { effectable: re } = ce(e), z = () => {
1549
+ let t = v(e, j.take());
1550
+ t && m(e.id, { filters: t });
1542
1551
  };
1543
- if (!S) return /* @__PURE__ */ Y("div", {
1552
+ if (!ee) return /* @__PURE__ */ Z("div", {
1544
1553
  className: "fixed bottom-[max(0.75rem,env(safe-area-inset-bottom))] left-[var(--fxr-rail,0px)] z-10 flex gap-2 px-3",
1545
1554
  children: [
1546
- /* @__PURE__ */ J(V, {
1555
+ /* @__PURE__ */ X(H, {
1547
1556
  variant: "primary",
1548
1557
  size: "lg",
1549
1558
  onClick: () => C(!0),
1550
- children: /* @__PURE__ */ Y("span", {
1559
+ children: /* @__PURE__ */ Z("span", {
1551
1560
  className: "flex items-center gap-2",
1552
- children: [N ? e.presetLabel : "Media", /* @__PURE__ */ J(X, {
1561
+ children: [M ? e.presetLabel : "Media", /* @__PURE__ */ X(Q, {
1553
1562
  name: "chevron-down",
1554
1563
  size: 16,
1555
1564
  className: "rotate-180"
1556
1565
  })]
1557
1566
  })
1558
1567
  }),
1559
- (N || R.length > 0) && /* @__PURE__ */ J(V, {
1568
+ (M || R.length > 0) && /* @__PURE__ */ X(H, {
1560
1569
  variant: "primary",
1561
1570
  size: "lg",
1562
- onClick: L,
1571
+ onClick: I,
1563
1572
  children: "Randomize all"
1564
1573
  }),
1565
- /* @__PURE__ */ J(V, {
1574
+ /* @__PURE__ */ X(H, {
1566
1575
  variant: "primary",
1567
1576
  size: "lg",
1568
- onClick: () => y(2),
1577
+ onClick: () => b(2),
1569
1578
  children: "Download"
1570
1579
  })
1571
1580
  ]
1572
1581
  });
1573
- let re = (N ? dn : fn).filter((e) => (e.value !== "effects" || ne) && (e.value !== "transport" || a("motion"))), B = re.some((e) => e.value === A) ? A : re[0].value;
1574
- return /* @__PURE__ */ Y(q, { children: [
1575
- w && /* @__PURE__ */ J(cn, {
1582
+ let ie = (M ? mn : hn).filter((e) => (e.value !== "effects" || re) && (e.value !== "transport" || a("motion"))), B = ie.some((e) => e.value === te) ? te : ie[0].value;
1583
+ return /* @__PURE__ */ Z(Y, { children: [
1584
+ w && /* @__PURE__ */ X(dn, {
1576
1585
  onPick: (e) => {
1577
1586
  n(e), T(!1);
1578
1587
  },
@@ -1584,72 +1593,72 @@ function Sn({ layer: e, onSwitchCategory: n, onInsert: i, onRestart: o, aspectVa
1584
1593
  },
1585
1594
  onDismiss: () => T(!1)
1586
1595
  }),
1587
- E && /* @__PURE__ */ J(ln, {
1596
+ E && /* @__PURE__ */ X(fn, {
1588
1597
  layer: e,
1589
1598
  chain: R,
1590
1599
  onPick: (t) => {
1591
- g(e.id, t), D(!1);
1600
+ _(e.id, t), D(!1);
1592
1601
  },
1593
1602
  onBack: () => D(!1)
1594
1603
  }),
1595
- /* @__PURE__ */ Y("div", {
1604
+ /* @__PURE__ */ Z("div", {
1596
1605
  className: "fixed right-0 left-[var(--fxr-rail,0px)] bottom-0 z-10 pb-[env(safe-area-inset-bottom)]",
1597
- style: un,
1598
- children: [/* @__PURE__ */ Y("div", {
1606
+ style: pn,
1607
+ children: [/* @__PURE__ */ Z("div", {
1599
1608
  className: "flex w-full items-center px-3",
1600
- children: [/* @__PURE__ */ Y("button", {
1609
+ children: [/* @__PURE__ */ Z("button", {
1601
1610
  className: "kol-helper-12 text-meta flex flex-1 items-center gap-2 py-2.5",
1602
1611
  onClick: () => C(!1),
1603
- children: [/* @__PURE__ */ J("span", { children: P }), /* @__PURE__ */ J(X, {
1612
+ children: [/* @__PURE__ */ X("span", { children: N }), /* @__PURE__ */ X(Q, {
1604
1613
  name: "chevron-down",
1605
1614
  size: 16,
1606
1615
  className: "text-oq-48"
1607
1616
  })]
1608
- }), /* @__PURE__ */ J("button", {
1617
+ }), /* @__PURE__ */ X("button", {
1609
1618
  className: "kol-helper-12 text-meta py-2.5",
1610
1619
  onClick: o,
1611
1620
  children: "Start over"
1612
1621
  })]
1613
- }), /* @__PURE__ */ Y("div", {
1622
+ }), /* @__PURE__ */ Z("div", {
1614
1623
  className: "px-3 pb-3",
1615
1624
  children: [
1616
- /* @__PURE__ */ J(U, {
1625
+ /* @__PURE__ */ X(W, {
1617
1626
  variant: "filled",
1618
1627
  value: B,
1619
- onChange: j,
1620
- options: re,
1628
+ onChange: A,
1629
+ options: ie,
1621
1630
  size: "lg",
1622
1631
  className: "[&_.kol-seg-cell]:min-w-0 [&_.kol-seg-cell]:px-2 [&_.kol-seg-cell]:overflow-hidden"
1623
1632
  }),
1624
- B === "generate" && N && /* @__PURE__ */ Y("div", {
1633
+ B === "generate" && M && /* @__PURE__ */ Z("div", {
1625
1634
  className: "flex flex-col gap-2 pt-3",
1626
1635
  children: [
1627
- /* @__PURE__ */ Y("div", {
1636
+ /* @__PURE__ */ Z("div", {
1628
1637
  className: "grid grid-cols-2 gap-2",
1629
- children: [/* @__PURE__ */ J(V, {
1638
+ children: [/* @__PURE__ */ X(H, {
1630
1639
  variant: "primary",
1631
1640
  size: "lg",
1632
1641
  iconRight: "refresh",
1633
- onClick: te,
1642
+ onClick: L,
1634
1643
  children: "Preset"
1635
- }), /* @__PURE__ */ J(V, {
1644
+ }), /* @__PURE__ */ X(H, {
1636
1645
  variant: "primary",
1637
1646
  size: "lg",
1638
1647
  onClick: () => T(!0),
1639
1648
  children: "Generator"
1640
1649
  })]
1641
1650
  }),
1642
- /* @__PURE__ */ J(V, {
1651
+ /* @__PURE__ */ X(H, {
1643
1652
  variant: "primary",
1644
1653
  size: "lg",
1645
1654
  className: "w-full",
1646
- onClick: L,
1655
+ onClick: I,
1647
1656
  children: "Randomize all"
1648
1657
  }),
1649
- I.length > 0 && /* @__PURE__ */ J(_n, { cells: [...I.map((e) => ({
1658
+ F.length > 0 && /* @__PURE__ */ X(bn, { cells: [...F.map((e) => ({
1650
1659
  value: e.id,
1651
1660
  label: e.label,
1652
- run: () => ee(e)
1661
+ run: () => ne(e)
1653
1662
  })), {
1654
1663
  value: "__retrigger",
1655
1664
  label: "Re-trigger",
@@ -1657,16 +1666,16 @@ function Sn({ layer: e, onSwitchCategory: n, onInsert: i, onRestart: o, aspectVa
1657
1666
  }] })
1658
1667
  ]
1659
1668
  }),
1660
- B === "effects" && /* @__PURE__ */ Y("div", {
1669
+ B === "effects" && /* @__PURE__ */ Z("div", {
1661
1670
  className: "flex flex-col gap-2 pt-3",
1662
- children: [/* @__PURE__ */ Y("div", {
1671
+ children: [/* @__PURE__ */ Z("div", {
1663
1672
  className: "grid grid-cols-2 gap-2",
1664
- children: [/* @__PURE__ */ J(V, {
1673
+ children: [/* @__PURE__ */ X(H, {
1665
1674
  variant: "primary",
1666
1675
  size: "lg",
1667
1676
  onClick: () => D(!0),
1668
1677
  children: "Add effect"
1669
- }), /* @__PURE__ */ J(V, {
1678
+ }), /* @__PURE__ */ X(H, {
1670
1679
  variant: "primary",
1671
1680
  size: "lg",
1672
1681
  disabled: !R.length,
@@ -1678,9 +1687,9 @@ function Sn({ layer: e, onSwitchCategory: n, onInsert: i, onRestart: o, aspectVa
1678
1687
  ...e,
1679
1688
  ...t.params,
1680
1689
  id: e.id
1681
- }, i = t.def ? h(t.def.params, r) : [], a = (t) => {
1682
- let i = s(r, t.params, M.take(), { stripNoRandom: !!t.motion }), a = R.map(({ def: e, ...t }) => t);
1683
- p(e.id, { filters: a.map((e, t) => t === n ? {
1690
+ }, i = t.def ? g(t.def.params, r) : [], a = (t) => {
1691
+ let i = s(r, t.params, j.take(), { stripNoRandom: !!t.motion }), a = R.map(({ def: e, ...t }) => t);
1692
+ m(e.id, { filters: a.map((e, t) => t === n ? {
1684
1693
  ...e,
1685
1694
  params: {
1686
1695
  ...e.params,
@@ -1688,17 +1697,17 @@ function Sn({ layer: e, onSwitchCategory: n, onInsert: i, onRestart: o, aspectVa
1688
1697
  }
1689
1698
  } : e) });
1690
1699
  };
1691
- return /* @__PURE__ */ Y("div", {
1700
+ return /* @__PURE__ */ Z("div", {
1692
1701
  className: "flex flex-col gap-2",
1693
- children: [/* @__PURE__ */ J(V, {
1702
+ children: [/* @__PURE__ */ X(H, {
1694
1703
  variant: "grey",
1695
1704
  size: "lg",
1696
1705
  className: "w-full [&>span]:w-full [&>span]:justify-between",
1697
1706
  iconLeft: "trash",
1698
1707
  iconRight: "trash",
1699
- onClick: () => v(e.id, n),
1708
+ onClick: () => y(e.id, n),
1700
1709
  children: `${n + 1}. ${t.def?.label ?? t.id}`
1701
- }), i.length > 0 && /* @__PURE__ */ J(_n, { cells: i.map((e) => ({
1710
+ }), i.length > 0 && /* @__PURE__ */ X(bn, { cells: i.map((e) => ({
1702
1711
  value: e.id,
1703
1712
  label: e.label,
1704
1713
  run: () => a(e)
@@ -1706,48 +1715,48 @@ function Sn({ layer: e, onSwitchCategory: n, onInsert: i, onRestart: o, aspectVa
1706
1715
  }, t.key);
1707
1716
  })]
1708
1717
  }),
1709
- B === "transport" && a("motion") && /* @__PURE__ */ Y("div", {
1718
+ B === "transport" && a("motion") && /* @__PURE__ */ Z("div", {
1710
1719
  className: "flex flex-col gap-2 pt-3",
1711
1720
  children: [(() => {
1712
1721
  let e = a("motion").TransportBar;
1713
- return /* @__PURE__ */ J(e, { size: "lg" });
1714
- })(), /* @__PURE__ */ J(yn, {})]
1722
+ return /* @__PURE__ */ X(e, { size: "lg" });
1723
+ })(), /* @__PURE__ */ X(Sn, {})]
1715
1724
  }),
1716
- B === "output" && /* @__PURE__ */ Y("div", {
1725
+ B === "output" && /* @__PURE__ */ Z("div", {
1717
1726
  className: "flex flex-col gap-2 pt-3",
1718
1727
  children: [
1719
- /* @__PURE__ */ J(U, {
1728
+ /* @__PURE__ */ X(W, {
1720
1729
  variant: "filled",
1721
1730
  value: c,
1722
- onChange: d,
1723
- options: bn,
1731
+ onChange: l,
1732
+ options: Cn,
1724
1733
  size: "lg",
1725
1734
  ariaLabel: "Aspect"
1726
1735
  }),
1727
- /* @__PURE__ */ J(U, {
1736
+ /* @__PURE__ */ X(W, {
1728
1737
  variant: "filled",
1729
1738
  value: c,
1730
- onChange: d,
1731
- options: xn,
1739
+ onChange: l,
1740
+ options: wn,
1732
1741
  size: "lg",
1733
1742
  ariaLabel: "Aspect (landscape) and fill"
1734
1743
  }),
1735
- /* @__PURE__ */ Y("div", {
1744
+ /* @__PURE__ */ Z("div", {
1736
1745
  className: "grid grid-cols-3 gap-2",
1737
1746
  children: [
1738
- /* @__PURE__ */ J(V, {
1747
+ /* @__PURE__ */ X(H, {
1739
1748
  variant: "primary",
1740
1749
  size: "lg",
1741
- onClick: () => y(2),
1750
+ onClick: () => b(2),
1742
1751
  children: "Download"
1743
1752
  }),
1744
- /* @__PURE__ */ J(V, {
1753
+ /* @__PURE__ */ X(H, {
1745
1754
  variant: "primary",
1746
1755
  size: "lg",
1747
- onClick: () => x(!0),
1756
+ onClick: () => S(!0),
1748
1757
  children: "Hide UI"
1749
1758
  }),
1750
- /* @__PURE__ */ J(V, {
1759
+ /* @__PURE__ */ X(H, {
1751
1760
  variant: "primary",
1752
1761
  size: "lg",
1753
1762
  onClick: o,
@@ -1764,175 +1773,194 @@ function Sn({ layer: e, onSwitchCategory: n, onInsert: i, onRestart: o, aspectVa
1764
1773
  }
1765
1774
  //#endregion
1766
1775
  //#region src/editor/mobile/MobileView.jsx
1767
- function Cn({ onGenerate: e }) {
1768
- return /* @__PURE__ */ J("div", {
1776
+ function En({ onGenerate: e, onEffects: t, chromes: n }) {
1777
+ return /* @__PURE__ */ X("div", {
1769
1778
  className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center justify-center p-6",
1770
1779
  style: { zIndex: "var(--kol-z-modal)" },
1771
- children: /* @__PURE__ */ Y("div", {
1780
+ children: /* @__PURE__ */ Z("div", {
1772
1781
  className: "w-full max-w-sm rounded p-8 flex flex-col gap-6",
1773
1782
  style: { background: "var(--kol-surface-primary)" },
1774
- children: [/* @__PURE__ */ Y("div", {
1783
+ children: [n ? /* @__PURE__ */ Z("div", {
1775
1784
  className: "flex flex-col gap-2",
1776
- children: [/* @__PURE__ */ J("span", {
1785
+ children: [/* @__PURE__ */ X("span", {
1777
1786
  className: "kol-eyebrow text-body",
1778
1787
  children: "Select chrome"
1779
- }), /* @__PURE__ */ J("span", {
1788
+ }), /* @__PURE__ */ X("span", {
1780
1789
  className: "kol-mono-16 text-emphasis",
1781
1790
  children: "Effexor FXR"
1782
1791
  })]
1783
- }), /* @__PURE__ */ Y("div", {
1792
+ }) : /* @__PURE__ */ X("span", {
1793
+ className: "kol-eyebrow text-body",
1794
+ children: ye("randomiser").label
1795
+ }), /* @__PURE__ */ Z("div", {
1784
1796
  className: "flex flex-col gap-2",
1785
1797
  children: [
1786
- /* @__PURE__ */ J(V, {
1798
+ /* @__PURE__ */ X(H, {
1787
1799
  variant: "primary",
1788
1800
  size: "lg",
1789
- className: on,
1790
- iconLeft: $.randomiser,
1791
- iconRight: $.randomiser,
1801
+ className: ln,
1802
+ iconLeft: bt.randomiser,
1803
+ iconRight: bt.randomiser,
1792
1804
  onClick: e,
1793
1805
  children: "Generate"
1794
1806
  }),
1795
- We() && /* @__PURE__ */ J(V, {
1807
+ /* @__PURE__ */ X(H, {
1808
+ variant: "primary",
1809
+ size: "lg",
1810
+ className: ln,
1811
+ iconLeft: "filter",
1812
+ iconRight: "filter",
1813
+ onClick: t,
1814
+ children: "Effects"
1815
+ }),
1816
+ n && Ge() && /* @__PURE__ */ X(H, {
1796
1817
  variant: "primary",
1797
1818
  size: "lg",
1798
1819
  className: "w-full [&>span]:w-full [&>span]:justify-between",
1799
- iconLeft: $.editor,
1800
- iconRight: $.editor,
1801
- onClick: Ye,
1802
- children: Me("editor").label
1820
+ iconLeft: bt.editor,
1821
+ iconRight: bt.editor,
1822
+ onClick: Xe,
1823
+ children: ye("editor").label
1803
1824
  }),
1804
- /* @__PURE__ */ J(V, {
1825
+ n && /* @__PURE__ */ X(H, {
1805
1826
  variant: "primary",
1806
1827
  size: "lg",
1807
- className: on,
1808
- iconLeft: $.labs,
1809
- iconRight: $.labs,
1810
- onClick: rt,
1811
- children: Me("labs").label
1828
+ className: "w-full [&>span]:w-full [&>span]:justify-between",
1829
+ iconLeft: bt.labs,
1830
+ iconRight: bt.labs,
1831
+ onClick: be,
1832
+ children: ye("labs").label
1812
1833
  })
1813
1834
  ]
1814
1835
  })]
1815
1836
  })
1816
1837
  });
1817
1838
  }
1818
- function wn() {
1819
- let { layers: e, addLayer: n, removeLayer: r, updateLayer: i, canvasW: a, canvasH: o, aspect: s, setAspect: c } = f(), { setTool: l } = Se(), u = () => Qe() && !Xe() ? "entry" : "category", [d, p] = K(u), [m, h] = K(null), [g, _] = K("contain"), [v, y] = K(1), b = G({
1839
+ function Dn() {
1840
+ let { layers: e, addLayer: n, removeLayer: r, updateLayer: i, canvasW: a, canvasH: o, aspect: s, setAspect: c } = p(), { setTool: l } = $e(), u = et() && !Ze(), d = () => "entry", [f, m] = J(d), [h, g] = J(!1), [_, v] = J(null), [y, b] = J("contain"), [x, C] = J(1), w = q({
1820
1841
  pts: /* @__PURE__ */ new Map(),
1821
1842
  startDist: 0,
1822
1843
  startScale: 1
1823
- }), C = G(null), w = () => {
1824
- let [e, t] = [...b.current.pts.values()];
1844
+ }), T = q(null), E = () => {
1845
+ let [e, t] = [...w.current.pts.values()];
1825
1846
  return Math.hypot(e.x - t.x, e.y - t.y);
1826
- }, T = (e) => {
1827
- b.current.pts.set(e.pointerId, {
1847
+ }, D = (e) => {
1848
+ w.current.pts.set(e.pointerId, {
1828
1849
  x: e.clientX,
1829
1850
  y: e.clientY
1830
- }), C.current = b.current.pts.size === 1 ? {
1851
+ }), T.current = w.current.pts.size === 1 ? {
1831
1852
  id: e.pointerId,
1832
1853
  x: e.clientX,
1833
1854
  y: e.clientY,
1834
1855
  t: performance.now()
1835
- } : null, b.current.pts.size === 2 && (b.current.startDist = w(), b.current.startScale = v, t.setStagePointer(null), e.stopPropagation());
1836
- }, E = (e) => {
1837
- let t = b.current;
1856
+ } : null, w.current.pts.size === 2 && (w.current.startDist = E(), w.current.startScale = x, t.setStagePointer(null), e.stopPropagation());
1857
+ }, O = (e) => {
1858
+ let t = w.current;
1838
1859
  t.pts.has(e.pointerId) && (t.pts.set(e.pointerId, {
1839
1860
  x: e.clientX,
1840
1861
  y: e.clientY
1841
- }), t.pts.size >= 2 && t.startDist > 0 && (e.stopPropagation(), y(Math.min(3, Math.max(.5, t.startScale * (w() / t.startDist))))));
1842
- }, D = (e) => {
1843
- let n = C.current;
1844
- if (n && n.id === e.pointerId && e.type === "pointerup" && d === "live" && performance.now() - n.t < 350 && Math.hypot(e.clientX - n.x, e.clientY - n.y) < 12 && O?.type === "loop") {
1845
- let e = k(O.loopId);
1846
- e && e.group !== "penrose" && e.kind !== "engine" && !A(e) && t.rewind();
1862
+ }), t.pts.size >= 2 && t.startDist > 0 && (e.stopPropagation(), C(Math.min(3, Math.max(.5, t.startScale * (E() / t.startDist))))));
1863
+ }, A = (e) => {
1864
+ let n = T.current;
1865
+ if (n && n.id === e.pointerId && e.type === "pointerup" && f === "live" && performance.now() - n.t < 350 && Math.hypot(e.clientX - n.x, e.clientY - n.y) < 12 && M?.type === "loop") {
1866
+ let e = k(M.loopId);
1867
+ e && e.group !== "penrose" && e.kind !== "engine" && !te(e) && t.rewind();
1847
1868
  }
1848
- n?.id === e.pointerId && (C.current = null), b.current.pts.delete(e.pointerId), b.current.pts.size < 2 && (b.current.startDist = 0);
1869
+ n?.id === e.pointerId && (T.current = null), w.current.pts.delete(e.pointerId), w.current.pts.size < 2 && (w.current.startDist = 0);
1849
1870
  };
1850
- gt(), W(() => {
1871
+ _t(), K(() => {
1851
1872
  c("4:5"), l("orbit");
1852
1873
  }, []);
1853
- let O = e.find((e) => e.id === m) ?? (e.length === 1 ? e[0] : null), j = d === "live" && O?.type === "photo" && !O.src && O.srcType !== "webcam";
1854
- W(() => {
1855
- if (!j) return;
1874
+ let M = e.find((e) => e.id === _) ?? (e.length === 1 ? e[0] : null), N = f === "live" && M?.type === "photo" && !M.src && M.srcType !== "webcam";
1875
+ K(() => {
1876
+ if (!N) return;
1856
1877
  let e = (e) => {
1857
1878
  e.key === "Escape" && L();
1858
1879
  };
1859
1880
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
1860
- }), W(() => {
1861
- if (!j) return;
1881
+ }), K(() => {
1882
+ if (!N) return;
1862
1883
  let e = t.isPlaying();
1863
1884
  return t.pause(), () => {
1864
1885
  e && t.play();
1865
1886
  };
1866
- }, [j]);
1867
- let N = (e) => {
1868
- let r = M(e);
1869
- r && (h(n("loop", r)), t.play(), p("live"));
1870
- }, P = (e) => {
1871
- let t = M(e);
1872
- t && m && i(m, t);
1873
- }, F = () => {
1874
- h(n("photo", {
1887
+ }, [N]);
1888
+ let P = (e) => {
1889
+ let r = j(e);
1890
+ r && (v(n("loop", r)), t.play(), m("live"));
1891
+ }, F = (e) => {
1892
+ let t = j(e);
1893
+ t && _ && i(_, t);
1894
+ }, I = () => {
1895
+ v(n("photo", {
1875
1896
  fit: "cover",
1876
1897
  x: 0,
1877
1898
  y: 0,
1878
- w: x,
1879
- h: Math.round(x * o / a)
1880
- })), t.play(), p("live");
1881
- }, I = (e) => {
1899
+ w: S,
1900
+ h: Math.round(S * o / a)
1901
+ })), t.play(), m("live");
1902
+ }, ne = (e) => {
1882
1903
  if (e === "fill") {
1883
- _("cover");
1904
+ b("cover");
1884
1905
  return;
1885
1906
  }
1886
- _("contain"), c(e);
1887
- let t = S[e];
1888
- m && t && i(m, {
1907
+ b("contain"), c(e);
1908
+ let t = ee[e];
1909
+ _ && t && i(_, {
1889
1910
  x: 0,
1890
1911
  y: 0,
1891
- w: x,
1892
- h: Math.round(x * t.h / t.w)
1912
+ w: S,
1913
+ h: Math.round(S * t.h / t.w)
1893
1914
  });
1894
1915
  }, L = () => {
1895
1916
  for (let t of [...e]) r(t.id);
1896
- h(null), y(1), p(u());
1917
+ v(null), C(1), g(!1), m(d());
1897
1918
  };
1898
- return /* @__PURE__ */ Y("div", {
1919
+ return /* @__PURE__ */ Z("div", {
1899
1920
  className: "relative h-dvh bg-black",
1900
1921
  children: [
1901
- /* @__PURE__ */ J("div", {
1922
+ /* @__PURE__ */ X("div", {
1902
1923
  className: "absolute inset-0 touch-none",
1903
- style: { transform: `scale(${v})` },
1904
- onPointerDownCapture: T,
1905
- onPointerMoveCapture: E,
1906
- onPointerUpCapture: D,
1907
- onPointerCancelCapture: D,
1908
- onPointerLeave: D,
1909
- children: /* @__PURE__ */ J(Be, { fit: g })
1924
+ style: { transform: `scale(${x})` },
1925
+ onPointerDownCapture: D,
1926
+ onPointerMoveCapture: O,
1927
+ onPointerUpCapture: A,
1928
+ onPointerCancelCapture: A,
1929
+ onPointerLeave: A,
1930
+ children: /* @__PURE__ */ X(Ve, { fit: y })
1931
+ }),
1932
+ f === "entry" && /* @__PURE__ */ X(En, {
1933
+ chromes: u,
1934
+ onGenerate: () => m("category"),
1935
+ onEffects: () => {
1936
+ g(!0), I();
1937
+ }
1910
1938
  }),
1911
- d === "entry" && /* @__PURE__ */ J(Cn, { onGenerate: () => p("category") }),
1912
- d === "category" && /* @__PURE__ */ J(cn, {
1913
- onPick: N,
1914
- onInsert: F,
1915
- onBack: u() === "entry" ? () => p("entry") : void 0
1939
+ f === "category" && /* @__PURE__ */ X(dn, {
1940
+ onPick: P,
1941
+ onInsert: I,
1942
+ onBack: () => m("entry")
1916
1943
  }),
1917
- d === "live" && /* @__PURE__ */ J(Sn, {
1918
- layer: O,
1919
- onSwitchCategory: P,
1944
+ f === "live" && /* @__PURE__ */ X(Tn, {
1945
+ layer: M,
1946
+ onSwitchCategory: F,
1920
1947
  onInsert: () => {
1921
- L(), F();
1948
+ L(), I();
1922
1949
  },
1923
1950
  onRestart: L,
1924
- aspectValue: g === "cover" ? "fill" : s,
1925
- onAspect: I
1951
+ aspectValue: y === "cover" ? "fill" : s,
1952
+ openEffects: h && !N,
1953
+ onAspect: ne
1926
1954
  }),
1927
- j && /* @__PURE__ */ Y("div", {
1955
+ N && /* @__PURE__ */ Z("div", {
1928
1956
  className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col",
1929
1957
  style: { zIndex: "var(--kol-z-modal)" },
1930
- children: [/* @__PURE__ */ J("div", {
1958
+ children: [/* @__PURE__ */ X("div", {
1931
1959
  className: "flex-1 min-h-0",
1932
- children: /* @__PURE__ */ J(Dt, { layer: O })
1933
- }), /* @__PURE__ */ J("div", {
1960
+ children: /* @__PURE__ */ X(At, { layer: M })
1961
+ }), /* @__PURE__ */ X("div", {
1934
1962
  className: "flex justify-center pb-[max(0.75rem,env(safe-area-inset-bottom))]",
1935
- children: /* @__PURE__ */ J(V, {
1963
+ children: /* @__PURE__ */ X(H, {
1936
1964
  variant: "outline",
1937
1965
  size: "lg",
1938
1966
  onClick: L,
@@ -1943,11 +1971,11 @@ function wn() {
1943
1971
  ]
1944
1972
  });
1945
1973
  }
1946
- function Tn() {
1947
- return /* @__PURE__ */ J(Ze, {
1974
+ function On() {
1975
+ return /* @__PURE__ */ X(Qe, {
1948
1976
  persistDraft: !1,
1949
- children: /* @__PURE__ */ J(wn, {})
1977
+ children: /* @__PURE__ */ X(Dn, {})
1950
1978
  });
1951
1979
  }
1952
1980
  //#endregion
1953
- export { Ke as AppSettingsSections, Ae as BRAND, et as DesignEditor, et as default, ge as DisplaySettingsDrawer, Ze as EditorProviders, we as FilesDialog, Ce as GeneratorLibraryProvider, rn as LABS_DRAFT_KEY, Ne as LIBRARY_SLOT_KEYS, an as LabsView, it as MODES, Tn as MobileView, tt as OutputCanvas, Be as OutputStage, Ve as OutputView, $e as RAIL_EXTRA_PREFIX, je as VIEW_PATHS, De as closeFiles, _e as comboLabel, ve as currentView, Qe as isMobileDevice, ke as openFiles, o as registerPack, be as setMode, ye as setNavigator, ze as setRailExtras, Le as setWantsDesktop, Pe as shortcutsBySection, xe as useFilesDialog, Fe as useGeneratorLibrary, qe as useRailExtras, Ge as useSettingsSections, Xe as wantsDesktop, Oe as withView };
1981
+ export { Ke as AppSettingsSections, _e as BRAND, nt as DesignEditor, nt as default, De as DisplaySettingsDrawer, Qe as EditorProviders, je as FilesDialog, Ie as GeneratorLibraryProvider, sn as LABS_DRAFT_KEY, Se as LIBRARY_SLOT_KEYS, cn as LabsView, ve as MODES, On as MobileView, rt as OutputCanvas, Ve as OutputStage, He as OutputView, tt as RAIL_EXTRA_PREFIX, at as VIEW_PATHS, xe as closeFiles, Ce as comboLabel, Ne as currentView, et as isMobileDevice, we as openFiles, o as registerPack, st as setMediaClient, ze as setMediaProxyBase, ke as setMode, qe as setNavigator, Be as setRailExtras, c as setSettingsStore, Re as setWantsDesktop, Pe as shortcutsBySection, Ee as useFilesDialog, Te as useGeneratorLibrary, Je as useRailExtras, Oe as useSettingsSections, Ze as wantsDesktop, ge as withView };