svelte-product-mockup 0.0.4 → 0.0.6

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,162 +1,162 @@
1
1
  import "svelte/internal/disclose-version";
2
2
  import * as e from "svelte/internal/client";
3
- import { onMount as Te, tick as xt, onDestroy as kt, untrack as Ge } from "svelte";
4
- import { fade as Qe } from "svelte/transition";
5
- import { beforeNavigate as Mt, pushState as Tt } from "$app/navigation";
6
- import { browser as St } from "$app/environment";
7
- function Nt(r, a) {
8
- const t = new Uint8ClampedArray(r.data), { brightness: s, contrast: n, saturation: i, hue: l, exposure: f, gamma: h, shadows: w, highlights: d, vibrance: _, temperature: m, tint: T } = a;
3
+ import { onMount as Te, tick as Mt, onDestroy as Tt, untrack as Ge } from "svelte";
4
+ import { fade as $e } from "svelte/transition";
5
+ import { beforeNavigate as St, pushState as It } from "$app/navigation";
6
+ import { browser as zt } from "$app/environment";
7
+ function Pt(o, r) {
8
+ const t = new Uint8ClampedArray(o.data), { brightness: a, contrast: n, saturation: s, hue: l, exposure: f, gamma: h, shadows: w, highlights: u, vibrance: g, temperature: p, tint: T } = r;
9
9
  for (let v = 0; v < t.length; v += 4) {
10
- let y = t[v], x = t[v + 1], I = t[v + 2];
11
- t[v + 3] !== 0 && (y = Ze(y, s), x = Ze(x, s), I = Ze(I, s), y = Oe(y, n), x = Oe(x, n), I = Oe(I, n), [y, x, I] = It(y, x, I, i), [y, x, I] = Ct(y, x, I, l), [y, x, I] = Pt(y, x, I, f), [y, x, I] = Rt(y, x, I, h), [y, x, I] = Wt(y, x, I, w, d), [y, x, I] = zt(y, x, I, _), [y, x, I] = Dt(y, x, I, m, T), t[v] = Le(y), t[v + 1] = Le(x), t[v + 2] = Le(I));
10
+ let y = t[v], x = t[v + 1], z = t[v + 2];
11
+ t[v + 3] !== 0 && (y = Be(y, a), x = Be(x, a), z = Be(z, a), y = Le(y, n), x = Le(x, n), z = Le(z, n), [y, x, z] = Ct(y, x, z, s), [y, x, z] = Nt(y, x, z, l), [y, x, z] = Rt(y, x, z, f), [y, x, z] = jt(y, x, z, h), [y, x, z] = Wt(y, x, z, w, u), [y, x, z] = Yt(y, x, z, g), [y, x, z] = Dt(y, x, z, p, T), t[v] = qe(y), t[v + 1] = qe(x), t[v + 2] = qe(z));
12
12
  }
13
- return new ImageData(t, r.width, r.height);
13
+ return new ImageData(t, o.width, o.height);
14
14
  }
15
- function Ze(r, a) {
16
- return r + a * 255;
15
+ function Be(o, r) {
16
+ return o + r * 255;
17
17
  }
18
- function Oe(r, a) {
19
- return 259 * (a * 255 + 255) / (255 * (259 - a * 255)) * (r - 128) + 128;
18
+ function Le(o, r) {
19
+ return 259 * (r * 255 + 255) / (255 * (259 - r * 255)) * (o - 128) + 128;
20
20
  }
21
- function It(r, a, t, s) {
22
- const n = 0.299 * r + 0.587 * a + 0.114 * t, i = 1 + s;
21
+ function Ct(o, r, t, a) {
22
+ const n = 0.299 * o + 0.587 * r + 0.114 * t, s = 1 + a;
23
23
  return [
24
- n + i * (r - n),
25
- n + i * (a - n),
26
- n + i * (t - n)
24
+ n + s * (o - n),
25
+ n + s * (r - n),
26
+ n + s * (t - n)
27
27
  ];
28
28
  }
29
- function Ct(r, a, t, s) {
30
- const n = s * Math.PI / 180, i = Math.cos(n), l = Math.sin(n), f = [
31
- i + (1 - i) / 3,
32
- 1 / 3 * (1 - i) - Math.sqrt(1 / 3) * l,
33
- 1 / 3 * (1 - i) + Math.sqrt(1 / 3) * l,
34
- 1 / 3 * (1 - i) + Math.sqrt(1 / 3) * l,
35
- i + 1 / 3 * (1 - i),
36
- 1 / 3 * (1 - i) - Math.sqrt(1 / 3) * l,
37
- 1 / 3 * (1 - i) - Math.sqrt(1 / 3) * l,
38
- 1 / 3 * (1 - i) + Math.sqrt(1 / 3) * l,
39
- i + 1 / 3 * (1 - i)
29
+ function Nt(o, r, t, a) {
30
+ const n = a * Math.PI / 180, s = Math.cos(n), l = Math.sin(n), f = [
31
+ s + (1 - s) / 3,
32
+ 1 / 3 * (1 - s) - Math.sqrt(1 / 3) * l,
33
+ 1 / 3 * (1 - s) + Math.sqrt(1 / 3) * l,
34
+ 1 / 3 * (1 - s) + Math.sqrt(1 / 3) * l,
35
+ s + 1 / 3 * (1 - s),
36
+ 1 / 3 * (1 - s) - Math.sqrt(1 / 3) * l,
37
+ 1 / 3 * (1 - s) - Math.sqrt(1 / 3) * l,
38
+ 1 / 3 * (1 - s) + Math.sqrt(1 / 3) * l,
39
+ s + 1 / 3 * (1 - s)
40
40
  ];
41
41
  return [
42
- r * f[0] + a * f[1] + t * f[2],
43
- r * f[3] + a * f[4] + t * f[5],
44
- r * f[6] + a * f[7] + t * f[8]
42
+ o * f[0] + r * f[1] + t * f[2],
43
+ o * f[3] + r * f[4] + t * f[5],
44
+ o * f[6] + r * f[7] + t * f[8]
45
45
  ];
46
46
  }
47
- function Pt(r, a, t, s) {
48
- const n = Math.pow(2, s);
49
- return [r * n, a * n, t * n];
47
+ function Rt(o, r, t, a) {
48
+ const n = Math.pow(2, a);
49
+ return [o * n, r * n, t * n];
50
50
  }
51
- function Rt(r, a, t, s) {
52
- const n = 1 / s;
51
+ function jt(o, r, t, a) {
52
+ const n = 1 / a;
53
53
  return [
54
+ Math.pow(o / 255, n) * 255,
54
55
  Math.pow(r / 255, n) * 255,
55
- Math.pow(a / 255, n) * 255,
56
56
  Math.pow(t / 255, n) * 255
57
57
  ];
58
58
  }
59
- function Wt(r, a, t, s, n) {
60
- const i = 0.299 * r + 0.587 * a + 0.114 * t;
59
+ function Wt(o, r, t, a, n) {
60
+ const s = 0.299 * o + 0.587 * r + 0.114 * t;
61
61
  let l = 1;
62
- return i < 128 ? l = 1 + s : l = 1 + n, [r * l, a * l, t * l];
62
+ return s < 128 ? l = 1 + a : l = 1 + n, [o * l, r * l, t * l];
63
63
  }
64
- function zt(r, a, t, s) {
65
- const n = Math.max(r, a, t), i = Math.min(r, a, t), l = n === 0 ? 0 : (n - i) / n, f = 1 + s * (1 - l);
66
- return [r * f, a * f, t * f];
64
+ function Yt(o, r, t, a) {
65
+ const n = Math.max(o, r, t), s = Math.min(o, r, t), l = n === 0 ? 0 : (n - s) / n, f = 1 + a * (1 - l);
66
+ return [o * f, r * f, t * f];
67
67
  }
68
- function Dt(r, a, t, s, n) {
69
- let i = r, l = a, f = t;
70
- return s > 0 ? (i += s * 0.1, f -= s * 0.1) : (i += s * 0.05, f -= s * 0.05), n > 0 ? (i += n * 0.1, l -= n * 0.05) : (i += n * 0.05, l -= n * 0.1), [i, l, f];
68
+ function Dt(o, r, t, a, n) {
69
+ let s = o, l = r, f = t;
70
+ return a > 0 ? (s += a * 0.1, f -= a * 0.1) : (s += a * 0.05, f -= a * 0.05), n > 0 ? (s += n * 0.1, l -= n * 0.05) : (s += n * 0.05, l -= n * 0.1), [s, l, f];
71
71
  }
72
- function Le(r) {
73
- return Math.max(0, Math.min(255, r));
72
+ function qe(o) {
73
+ return Math.max(0, Math.min(255, o));
74
74
  }
75
- function Xt(r, a, t) {
76
- const s = r / a;
75
+ function Xt(o, r, t) {
76
+ const a = o / r;
77
77
  switch (t.mode) {
78
78
  case "scale":
79
79
  const n = t.scale ?? 1;
80
80
  return {
81
- width: r * n,
82
- height: a * n,
81
+ width: o * n,
82
+ height: r * n,
83
83
  sourceX: 0,
84
84
  sourceY: 0,
85
- sourceWidth: r,
86
- sourceHeight: a
85
+ sourceWidth: o,
86
+ sourceHeight: r
87
87
  };
88
88
  case "px":
89
- let i = t.width ?? r, l = t.height ?? a;
89
+ let s = t.width ?? o, l = t.height ?? r;
90
90
  if (t.maintainAspectRatio) {
91
- if (i && !l)
92
- l = i / s;
93
- else if (l && !i)
94
- i = l * s;
95
- else if (i && l) {
96
- const C = Math.min(i / r, l / a);
97
- i = r * C, l = a * C;
91
+ if (s && !l)
92
+ l = s / a;
93
+ else if (l && !s)
94
+ s = l * a;
95
+ else if (s && l) {
96
+ const P = Math.min(s / o, l / r);
97
+ s = o * P, l = r * P;
98
98
  }
99
99
  }
100
- return t.minWidth && (i = Math.max(i, t.minWidth)), t.maxWidth && (i = Math.min(i, t.maxWidth)), t.minHeight && (l = Math.max(l, t.minHeight)), t.maxHeight && (l = Math.min(l, t.maxHeight)), {
101
- width: i,
100
+ return t.minWidth && (s = Math.max(s, t.minWidth)), t.maxWidth && (s = Math.min(s, t.maxWidth)), t.minHeight && (l = Math.max(l, t.minHeight)), t.maxHeight && (l = Math.min(l, t.maxHeight)), {
101
+ width: s,
102
102
  height: l,
103
103
  sourceX: 0,
104
104
  sourceY: 0,
105
- sourceWidth: r,
106
- sourceHeight: a
105
+ sourceWidth: o,
106
+ sourceHeight: r
107
107
  };
108
108
  case "fit":
109
- const f = t.width ?? r, h = t.height ?? a, w = Math.min(f / r, h / a);
109
+ const f = t.width ?? o, h = t.height ?? r, w = Math.min(f / o, h / r);
110
110
  return {
111
- width: r * w,
112
- height: a * w,
111
+ width: o * w,
112
+ height: r * w,
113
113
  sourceX: 0,
114
114
  sourceY: 0,
115
- sourceWidth: r,
116
- sourceHeight: a
115
+ sourceWidth: o,
116
+ sourceHeight: r
117
117
  };
118
118
  case "fill":
119
- const d = t.width ?? r, _ = t.height ?? a, m = Math.max(d / r, _ / a), T = d / m, v = _ / m;
119
+ const u = t.width ?? o, g = t.height ?? r, p = Math.max(u / o, g / r), T = u / p, v = g / p;
120
120
  return {
121
- width: d,
122
- height: _,
123
- sourceX: (r - T) / 2,
124
- sourceY: (a - v) / 2,
121
+ width: u,
122
+ height: g,
123
+ sourceX: (o - T) / 2,
124
+ sourceY: (r - v) / 2,
125
125
  sourceWidth: T,
126
126
  sourceHeight: v
127
127
  };
128
128
  case "cover":
129
- const y = t.width ?? r, x = t.height ?? a;
129
+ const y = t.width ?? o, x = t.height ?? r;
130
130
  return {
131
131
  width: y,
132
132
  height: x,
133
133
  sourceX: 0,
134
134
  sourceY: 0,
135
- sourceWidth: r,
136
- sourceHeight: a
135
+ sourceWidth: o,
136
+ sourceHeight: r
137
137
  };
138
138
  case "contain":
139
- const I = t.width ?? r, b = t.height ?? a, k = Math.min(I / r, b / a);
139
+ const z = t.width ?? o, _ = t.height ?? r, k = Math.min(z / o, _ / r);
140
140
  return {
141
- width: r * k,
142
- height: a * k,
141
+ width: o * k,
142
+ height: r * k,
143
143
  sourceX: 0,
144
144
  sourceY: 0,
145
- sourceWidth: r,
146
- sourceHeight: a
145
+ sourceWidth: o,
146
+ sourceHeight: r
147
147
  };
148
148
  default:
149
149
  return {
150
- width: r,
151
- height: a,
150
+ width: o,
151
+ height: r,
152
152
  sourceX: 0,
153
153
  sourceY: 0,
154
- sourceWidth: r,
155
- sourceHeight: a
154
+ sourceWidth: o,
155
+ sourceHeight: r
156
156
  };
157
157
  }
158
158
  }
159
- const ie = {
159
+ const se = {
160
160
  scale: 1,
161
161
  translateX: 0,
162
162
  translateY: 0
@@ -171,7 +171,7 @@ const ie = {
171
171
  rotationX: 0,
172
172
  rotationY: 0,
173
173
  rotationZ: 0
174
- }, se = {
174
+ }, ae = {
175
175
  rotationX: 0,
176
176
  rotationY: 0,
177
177
  rotationZ: 0,
@@ -181,324 +181,324 @@ const ie = {
181
181
  rotationX: 0,
182
182
  rotationY: 0,
183
183
  rotationZ: 0
184
- }, $e = {
184
+ }, Qe = {
185
185
  type: "warp",
186
186
  shape: "none",
187
187
  enabled: !1,
188
188
  quality: 1,
189
- image: { ...ie },
189
+ image: { ...se },
190
190
  cylinder: { ...ce },
191
- plane: { ...se },
191
+ plane: { ...ae },
192
192
  sphere: { ...ke }
193
193
  };
194
- function Yt(r) {
195
- const t = new OffscreenCanvas(r.width, r.height).getContext("2d");
194
+ function Zt(o) {
195
+ const t = new OffscreenCanvas(o.width, o.height).getContext("2d");
196
196
  if (!t) throw new Error("Failed to create canvas context");
197
- return t.drawImage(r, 0, 0), t.getImageData(0, 0, r.width, r.height);
197
+ return t.drawImage(o, 0, 0), t.getImageData(0, 0, o.width, o.height);
198
198
  }
199
- function Bt(r, a, t) {
200
- const s = r.width, n = r.height, i = r.data;
201
- if (a < 0 || a >= s || t < 0 || t >= n)
199
+ function Bt(o, r, t) {
200
+ const a = o.width, n = o.height, s = o.data;
201
+ if (r < 0 || r >= a || t < 0 || t >= n)
202
202
  return null;
203
- const l = Math.floor(a), f = Math.floor(t), h = Math.min(l + 1, s - 1), w = Math.min(f + 1, n - 1), d = a - l, _ = t - f, m = (g, u) => {
204
- const p = (u * s + g) * 4;
203
+ const l = Math.floor(r), f = Math.floor(t), h = Math.min(l + 1, a - 1), w = Math.min(f + 1, n - 1), u = r - l, g = t - f, p = (b, d) => {
204
+ const m = (d * a + b) * 4;
205
205
  return {
206
- r: i[p],
207
- g: i[p + 1],
208
- b: i[p + 2],
209
- a: i[p + 3]
206
+ r: s[m],
207
+ g: s[m + 1],
208
+ b: s[m + 2],
209
+ a: s[m + 3]
210
210
  };
211
- }, T = m(l, f), v = m(h, f), y = m(l, w), x = m(h, w), I = (g, u, p) => g + (u - g) * p, b = I(I(T.r, v.r, d), I(y.r, x.r, d), _), k = I(I(T.g, v.g, d), I(y.g, x.g, d), _), C = I(I(T.b, v.b, d), I(y.b, x.b, d), _), S = I(I(T.a, v.a, d), I(y.a, x.a, d), _);
212
- return { r: b, g: k, b: C, a: S };
211
+ }, T = p(l, f), v = p(h, f), y = p(l, w), x = p(h, w), z = (b, d, m) => b + (d - b) * m, _ = z(z(T.r, v.r, u), z(y.r, x.r, u), g), k = z(z(T.g, v.g, u), z(y.g, x.g, u), g), P = z(z(T.b, v.b, u), z(y.b, x.b, u), g), S = z(z(T.a, v.a, u), z(y.a, x.a, u), g);
212
+ return { r: _, g: k, b: P, a: S };
213
213
  }
214
- function He(r, a, t, s, n, i, l, f, h, w) {
215
- const d = Yt(a), _ = w?.showDepthVis ?? !1, m = w?.maxZ ?? 500, T = h ?? {
214
+ function Ve(o, r, t, a, n, s, l, f, h, w) {
215
+ const u = Zt(r), g = w?.showDepthVis ?? !1, p = w?.maxZ ?? 500, T = h ?? {
216
216
  minX: -n / 2,
217
- minY: -i / 2,
217
+ minY: -s / 2,
218
218
  maxX: n / 2,
219
- maxY: i / 2
220
- }, v = T.maxX - T.minX, y = T.maxY - T.minY, x = Math.floor(v * l), I = Math.floor(y * l);
221
- if (x <= 0 || I <= 0) return;
222
- const b = new ImageData(x, I), k = b.data;
223
- for (let p = 0; p < I; p++)
224
- for (let o = 0; o < x; o++) {
225
- const c = T.minX + o / l, M = T.minY + p / l, N = f(c, M);
226
- if (!N || N.z <= 0)
219
+ maxY: s / 2
220
+ }, v = T.maxX - T.minX, y = T.maxY - T.minY, x = Math.floor(v * l), z = Math.floor(y * l);
221
+ if (x <= 0 || z <= 0) return;
222
+ const _ = new ImageData(x, z), k = _.data;
223
+ for (let m = 0; m < z; m++)
224
+ for (let i = 0; i < x; i++) {
225
+ const c = T.minX + i / l, M = T.minY + m / l, I = f(c, M);
226
+ if (!I || I.z <= 0)
227
227
  continue;
228
- const B = (p * x + o) * 4;
229
- if (_) {
230
- const J = Math.min(1, Math.max(0, N.z / m)), Z = Math.floor(J * 200 + 55);
231
- k[B] = Math.floor(Z * 0.3), k[B + 1] = Math.floor(Z * 0.6), k[B + 2] = Z, k[B + 3] = 200;
228
+ const X = (m * x + i) * 4;
229
+ if (g) {
230
+ const J = Math.min(1, Math.max(0, I.z / p)), B = Math.floor(J * 200 + 55);
231
+ k[X] = Math.floor(B * 0.3), k[X + 1] = Math.floor(B * 0.6), k[X + 2] = B, k[X + 3] = 200;
232
232
  } else {
233
- const { u: J, v: Z } = N, U = Bt(d, J, Z);
234
- U && (k[B] = Math.round(U.r), k[B + 1] = Math.round(U.g), k[B + 2] = Math.round(U.b), k[B + 3] = Math.round(U.a));
233
+ const { u: J, v: B } = I, A = Bt(u, J, B);
234
+ A && (k[X] = Math.round(A.r), k[X + 1] = Math.round(A.g), k[X + 2] = Math.round(A.b), k[X + 3] = Math.round(A.a));
235
235
  }
236
236
  }
237
- const C = new OffscreenCanvas(x, I), S = C.getContext("2d");
237
+ const P = new OffscreenCanvas(x, z), S = P.getContext("2d");
238
238
  if (!S) return;
239
- S.putImageData(b, 0, 0);
240
- const g = t + T.minX, u = s + T.minY;
241
- l !== 1 ? r.drawImage(C, g, u, v, y) : r.drawImage(C, g, u);
239
+ S.putImageData(_, 0, 0);
240
+ const b = t + T.minX, d = a + T.minY;
241
+ l !== 1 ? o.drawImage(P, b, d, v, y) : o.drawImage(P, b, d);
242
242
  }
243
- function Ae(r, a, t, s = 20) {
244
- if (!("save" in r)) return;
245
- const n = r;
246
- n.save(), n.strokeStyle = "#00ff00", n.lineWidth = 2, n.beginPath(), n.moveTo(a - s, t), n.lineTo(a + s, t), n.stroke(), n.beginPath(), n.moveTo(a, t - s), n.lineTo(a, t + s), n.stroke(), n.fillStyle = "#00ff00", n.beginPath(), n.arc(a, t, 3, 0, Math.PI * 2), n.fill(), n.restore();
243
+ function Ue(o, r, t, a = 20) {
244
+ if (!("save" in o)) return;
245
+ const n = o;
246
+ n.save(), n.strokeStyle = "#00ff00", n.lineWidth = 2, n.beginPath(), n.moveTo(r - a, t), n.lineTo(r + a, t), n.stroke(), n.beginPath(), n.moveTo(r, t - a), n.lineTo(r, t + a), n.stroke(), n.fillStyle = "#00ff00", n.beginPath(), n.arc(r, t, 3, 0, Math.PI * 2), n.fill(), n.restore();
247
247
  }
248
- function re(r, a, t, s, n, i) {
249
- const l = Math.cos(s), f = Math.sin(s), h = Math.cos(n), w = Math.sin(n), d = Math.cos(i), _ = Math.sin(i);
250
- let m = r, T = a, v = t;
251
- if (i !== 0) {
252
- const y = m, x = T;
253
- m = y * d - x * _, T = y * _ + x * d;
248
+ function oe(o, r, t, a, n, s) {
249
+ const l = Math.cos(a), f = Math.sin(a), h = Math.cos(n), w = Math.sin(n), u = Math.cos(s), g = Math.sin(s);
250
+ let p = o, T = r, v = t;
251
+ if (s !== 0) {
252
+ const y = p, x = T;
253
+ p = y * u - x * g, T = y * g + x * u;
254
254
  }
255
255
  if (n !== 0) {
256
- const y = m, x = v;
257
- m = y * h + x * w, v = -y * w + x * h;
256
+ const y = p, x = v;
257
+ p = y * h + x * w, v = -y * w + x * h;
258
258
  }
259
- if (s !== 0) {
259
+ if (a !== 0) {
260
260
  const y = T, x = v;
261
261
  T = y * l - x * f, v = y * f + x * l;
262
262
  }
263
- return [m, T, v];
263
+ return [p, T, v];
264
264
  }
265
- function Et(r, a, t, s, n, i) {
266
- const l = Math.cos(s), f = Math.sin(s), h = Math.cos(n), w = Math.sin(n), d = Math.cos(i), _ = Math.sin(i);
267
- let m = r, T = a, v = t;
268
- if (s !== 0) {
265
+ function Lt(o, r, t, a, n, s) {
266
+ const l = Math.cos(a), f = Math.sin(a), h = Math.cos(n), w = Math.sin(n), u = Math.cos(s), g = Math.sin(s);
267
+ let p = o, T = r, v = t;
268
+ if (a !== 0) {
269
269
  const y = T, x = v;
270
270
  T = y * l + x * f, v = -y * f + x * l;
271
271
  }
272
272
  if (n !== 0) {
273
- const y = m, x = v;
274
- m = y * h - x * w, v = y * w + x * h;
273
+ const y = p, x = v;
274
+ p = y * h - x * w, v = y * w + x * h;
275
275
  }
276
- if (i !== 0) {
277
- const y = m, x = T;
278
- m = y * d + x * _, T = -y * _ + x * d;
276
+ if (s !== 0) {
277
+ const y = p, x = T;
278
+ p = y * u + x * g, T = -y * g + x * u;
279
279
  }
280
- return [m, T, v];
280
+ return [p, T, v];
281
281
  }
282
- function Zt(r, a, t, s, n, i) {
283
- if (!("save" in r)) return;
284
- const l = r;
282
+ function qt(o, r, t, a, n, s) {
283
+ if (!("save" in o)) return;
284
+ const l = o;
285
285
  l.save(), l.strokeStyle = "#ff6600", l.lineWidth = 1.5, l.setLineDash([4, 6]);
286
286
  const f = 50, h = 3;
287
287
  for (let w = -h; w <= h; w++) {
288
- const d = w * f, _ = [];
289
- for (let m = -10; m <= 10; m++) {
290
- const T = m * f, v = i(d, T);
291
- v && _.push({ x: a + v.x, y: t + v.y });
288
+ const u = w * f, g = [];
289
+ for (let p = -10; p <= 10; p++) {
290
+ const T = p * f, v = s(u, T);
291
+ v && g.push({ x: r + v.x, y: t + v.y });
292
292
  }
293
- if (_.length > 1) {
294
- l.beginPath(), l.moveTo(_[0].x, _[0].y);
295
- for (let m = 1; m < _.length; m++)
296
- l.lineTo(_[m].x, _[m].y);
293
+ if (g.length > 1) {
294
+ l.beginPath(), l.moveTo(g[0].x, g[0].y);
295
+ for (let p = 1; p < g.length; p++)
296
+ l.lineTo(g[p].x, g[p].y);
297
297
  l.stroke();
298
298
  }
299
299
  }
300
300
  for (let w = -h; w <= h; w++) {
301
- const d = w * f, _ = [];
302
- for (let m = -10; m <= 10; m++) {
303
- const T = m * f, v = i(T, d);
304
- v && _.push({ x: a + v.x, y: t + v.y });
301
+ const u = w * f, g = [];
302
+ for (let p = -10; p <= 10; p++) {
303
+ const T = p * f, v = s(T, u);
304
+ v && g.push({ x: r + v.x, y: t + v.y });
305
305
  }
306
- if (_.length > 1) {
307
- l.beginPath(), l.moveTo(_[0].x, _[0].y);
308
- for (let m = 1; m < _.length; m++)
309
- l.lineTo(_[m].x, _[m].y);
306
+ if (g.length > 1) {
307
+ l.beginPath(), l.moveTo(g[0].x, g[0].y);
308
+ for (let p = 1; p < g.length; p++)
309
+ l.lineTo(g[p].x, g[p].y);
310
310
  l.stroke();
311
311
  }
312
312
  }
313
313
  l.restore();
314
314
  }
315
- function Ot(r, a, t, s, n, i, l, f) {
316
- if (!("save" in r)) return;
317
- const h = r;
315
+ function Et(o, r, t, a, n, s, l, f) {
316
+ if (!("save" in o)) return;
317
+ const h = o;
318
318
  h.save(), h.lineWidth = 2, h.setLineDash([6, 4]);
319
- const w = Math.sin(i);
320
- let d = 1 / 0, _ = -1 / 0;
321
- const m = (p, o, c) => {
322
- const M = o * w, N = f / (f + M);
319
+ const w = Math.sin(s);
320
+ let u = 1 / 0, g = -1 / 0;
321
+ const p = (m, i, c) => {
322
+ const M = i * w, I = f / (f + M);
323
323
  return {
324
- x: a + p * N,
325
- y: t + o * N,
324
+ x: r + m * I,
325
+ y: t + i * I,
326
326
  z: c
327
327
  };
328
- }, T = (p, o, c) => {
329
- const M = c - o;
328
+ }, T = (m, i, c) => {
329
+ const M = c - i;
330
330
  if (M < 1e-3) return "#ff6600";
331
- const N = (p - o) / M, B = Math.round(100 + N * 155), J = Math.round(30 + N * 70), Z = Math.round(0 + N * 0);
332
- return `rgb(${B},${J},${Z})`;
333
- }, v = 32, y = [], x = [], I = [], b = [], k = i > 0.01 ? -Math.PI / 2 : 0, C = i > 0.01 ? Math.PI / 2 : Math.PI * 2, S = i < -0.01 ? -Math.PI / 2 : 0, g = i < -0.01 ? Math.PI / 2 : Math.PI * 2;
334
- for (let p = 0; p <= v; p++) {
335
- const o = p / v, c = k + o * (C - k), M = Math.sin(c) * s, N = Math.cos(c) * s, B = -n / 2, [J, Z, U] = re(M, B, N, i, 0, l), z = m(J, Z, U);
336
- y.push(z), d = Math.min(d, U), _ = Math.max(_, U);
337
- }
338
- for (let p = 0; p <= v; p++) {
339
- const o = p / v, c = S + o * (g - S), M = Math.sin(c) * s, N = Math.cos(c) * s, B = n / 2, [J, Z, U] = re(M, B, N, i, 0, l), z = m(J, Z, U);
340
- x.push(z), d = Math.min(d, U), _ = Math.max(_, U);
341
- }
342
- for (let p = 0; p <= 10; p++) {
343
- const o = p / 10, c = -n / 2 + o * n, [M, N, B] = re(-s, c, 0, i, 0, l);
344
- I.push(m(M, N, B)), d = Math.min(d, B), _ = Math.max(_, B);
345
- const [J, Z, U] = re(s, c, 0, i, 0, l);
346
- b.push(m(J, Z, U)), d = Math.min(d, U), _ = Math.max(_, U);
347
- }
348
- const u = (p) => {
349
- for (let o = 0; o < p.length - 1; o++) {
350
- const c = p[o], M = p[o + 1], N = (c.z + M.z) / 2;
351
- h.strokeStyle = T(N, d, _), h.beginPath(), h.moveTo(c.x, c.y), h.lineTo(M.x, M.y), h.stroke();
331
+ const I = (m - i) / M, X = Math.round(100 + I * 155), J = Math.round(30 + I * 70), B = Math.round(0 + I * 0);
332
+ return `rgb(${X},${J},${B})`;
333
+ }, v = 32, y = [], x = [], z = [], _ = [], k = s > 0.01 ? -Math.PI / 2 : 0, P = s > 0.01 ? Math.PI / 2 : Math.PI * 2, S = s < -0.01 ? -Math.PI / 2 : 0, b = s < -0.01 ? Math.PI / 2 : Math.PI * 2;
334
+ for (let m = 0; m <= v; m++) {
335
+ const i = m / v, c = k + i * (P - k), M = Math.sin(c) * a, I = Math.cos(c) * a, X = -n / 2, [J, B, A] = oe(M, X, I, s, 0, l), j = p(J, B, A);
336
+ y.push(j), u = Math.min(u, A), g = Math.max(g, A);
337
+ }
338
+ for (let m = 0; m <= v; m++) {
339
+ const i = m / v, c = S + i * (b - S), M = Math.sin(c) * a, I = Math.cos(c) * a, X = n / 2, [J, B, A] = oe(M, X, I, s, 0, l), j = p(J, B, A);
340
+ x.push(j), u = Math.min(u, A), g = Math.max(g, A);
341
+ }
342
+ for (let m = 0; m <= 10; m++) {
343
+ const i = m / 10, c = -n / 2 + i * n, [M, I, X] = oe(-a, c, 0, s, 0, l);
344
+ z.push(p(M, I, X)), u = Math.min(u, X), g = Math.max(g, X);
345
+ const [J, B, A] = oe(a, c, 0, s, 0, l);
346
+ _.push(p(J, B, A)), u = Math.min(u, A), g = Math.max(g, A);
347
+ }
348
+ const d = (m) => {
349
+ for (let i = 0; i < m.length - 1; i++) {
350
+ const c = m[i], M = m[i + 1], I = (c.z + M.z) / 2;
351
+ h.strokeStyle = T(I, u, g), h.beginPath(), h.moveTo(c.x, c.y), h.lineTo(M.x, M.y), h.stroke();
352
352
  }
353
353
  };
354
- u(y), u(x), u(I), u(b), h.restore();
354
+ d(y), d(x), d(z), d(_), h.restore();
355
355
  }
356
- function Lt(r, a, t, s, n, i, l, f, h, w) {
357
- const { diameter: d, perspective: _, rotationX: m, rotationZ: T } = l, v = d / 2, y = m * Math.PI / 180, x = T * Math.PI / 180, I = Math.abs(y) > 1e-3, b = _ ?? 1, k = b > 0.01 ? v * (10 / b) : v * 1e3, C = f.scale, S = f.translateX, g = f.translateY;
358
- let u = {
356
+ function Ot(o, r, t, a, n, s, l, f, h, w) {
357
+ const { diameter: u, perspective: g, rotationX: p, rotationZ: T } = l, v = u / 2, y = p * Math.PI / 180, x = T * Math.PI / 180, z = Math.abs(y) > 1e-3, _ = g ?? 1, k = _ > 0.01 ? v * (10 / _) : v * 1e3, P = f.scale, S = f.translateX, b = f.translateY;
358
+ let d = {
359
359
  minX: -v,
360
- minY: -i / 2,
360
+ minY: -s / 2,
361
361
  maxX: v,
362
- maxY: i / 2
362
+ maxY: s / 2
363
363
  };
364
- if (I) {
364
+ if (z) {
365
365
  const c = [
366
- { x: -v, y: -i / 2 },
367
- { x: v, y: -i / 2 },
368
- { x: v, y: i / 2 },
369
- { x: -v, y: i / 2 }
366
+ { x: -v, y: -s / 2 },
367
+ { x: v, y: -s / 2 },
368
+ { x: v, y: s / 2 },
369
+ { x: -v, y: s / 2 }
370
370
  ], M = [];
371
- for (const B of c) {
372
- const [J, Z, U] = re(B.x, B.y, v, y, 0, x), z = k / (k + U);
373
- M.push({ x: J * z, y: Z * z });
374
- const [E, O, j] = re(B.x, B.y, 0, y, 0, x), L = k / (k + j);
375
- M.push({ x: E * L, y: O * L });
371
+ for (const X of c) {
372
+ const [J, B, A] = oe(X.x, X.y, v, y, 0, x), j = k / (k + A);
373
+ M.push({ x: J * j, y: B * j });
374
+ const [Z, L, E] = oe(X.x, X.y, 0, y, 0, x), q = k / (k + E);
375
+ M.push({ x: Z * q, y: L * q });
376
376
  }
377
- const N = v * Math.abs(Math.sin(y));
378
- M.length > 0 && (u = {
379
- minX: Math.min(...M.map((B) => B.x)) - 2,
380
- minY: Math.min(...M.map((B) => B.y)) - N - 2,
381
- maxX: Math.max(...M.map((B) => B.x)) + 2,
382
- maxY: Math.max(...M.map((B) => B.y)) + N + 2
377
+ const I = v * Math.abs(Math.sin(y));
378
+ M.length > 0 && (d = {
379
+ minX: Math.min(...M.map((X) => X.x)) - 2,
380
+ minY: Math.min(...M.map((X) => X.y)) - I - 2,
381
+ maxX: Math.max(...M.map((X) => X.x)) + 2,
382
+ maxY: Math.max(...M.map((X) => X.y)) + I + 2
383
383
  });
384
384
  }
385
- const p = (c, M) => {
386
- const N = Math.cos(x), B = Math.sin(x), J = c * N + M * B, Z = -c * B + M * N, U = Math.cos(y), z = Math.sin(y), E = Z * z, O = k / (k + E), j = J / O, L = Z / O;
387
- if (Math.abs(j) > v) return null;
388
- const K = Math.sqrt(v * v - j * j);
389
- if (Math.abs(U) < 0.01) return null;
390
- const H = (L + K * z) / U, G = H * z + K * U;
385
+ const m = (c, M) => {
386
+ const I = Math.cos(x), X = Math.sin(x), J = c * I + M * X, B = -c * X + M * I, A = Math.cos(y), j = Math.sin(y), Z = B * j, L = k / (k + Z), E = J / L, q = B / L;
387
+ if (Math.abs(E) > v) return null;
388
+ const K = Math.sqrt(v * v - E * E);
389
+ if (Math.abs(A) < 0.01) return null;
390
+ const V = (q + K * j) / A, G = V * j + K * A;
391
391
  if (G < 0) return null;
392
- const D = Math.asin(j / v) * v / n + 0.5, R = H / i + 0.5, V = (D - 0.5 - S) / C + 0.5, A = (R - 0.5 - g) / C + 0.5;
393
- return V >= 0 && V <= 1 && A >= 0 && A <= 1 ? { u: V * a.width, v: A * a.height, z: G } : null;
394
- }, o = w.showDepthVis ? { showDepthVis: !0, maxZ: v } : void 0;
395
- w.showBounds && Ot(r, t, s, v, i, y, x, k), He(r, a, t, s, n, i, h, p, u, o), w.showCrosshair && Ae(r, t, s);
392
+ const W = Math.asin(E / v) * v / n + 0.5, N = V / s + 0.5, H = (W - 0.5 - S) / P + 0.5, U = (N - 0.5 - b) / P + 0.5;
393
+ return H >= 0 && H <= 1 && U >= 0 && U <= 1 ? { u: H * r.width, v: U * r.height, z: G } : null;
394
+ }, i = w.showDepthVis ? { showDepthVis: !0, maxZ: v } : void 0;
395
+ w.showBounds && Et(o, t, a, v, s, y, x, k), Ve(o, r, t, a, n, s, h, m, d, i), w.showCrosshair && Ue(o, t, a);
396
396
  }
397
- function jt(r, a, t, s, n, i, l, f, h, w) {
398
- const { rotationX: d, rotationY: _, rotationZ: m, depthScale: T } = l, v = d * (Math.PI / 180), y = _ * (Math.PI / 180), x = m * (Math.PI / 180), I = Math.abs(v) > 1e-3 || Math.abs(y) > 1e-3 || Math.abs(x) > 1e-3, b = f.scale, k = f.translateX, C = f.translateY, S = T * 1e-3, g = S > 1e-4 ? 1 / S : 1e4, u = (Z, U) => {
399
- const [z, E, O] = re(Z, U, 0, v, y, x), j = O + g;
400
- if (j <= 0) return null;
401
- const L = g / j, K = z * L, H = E * L;
402
- return { x: K, y: H, z: O };
397
+ function Vt(o, r, t, a, n, s, l, f, h, w) {
398
+ const { rotationX: u, rotationY: g, rotationZ: p, depthScale: T } = l, v = u * (Math.PI / 180), y = g * (Math.PI / 180), x = p * (Math.PI / 180), z = Math.abs(v) > 1e-3 || Math.abs(y) > 1e-3 || Math.abs(x) > 1e-3, _ = f.scale, k = f.translateX, P = f.translateY, S = T * 1e-3, b = S > 1e-4 ? 1 / S : 1e4, d = (B, A) => {
399
+ const [j, Z, L] = oe(B, A, 0, v, y, x), E = L + b;
400
+ if (E <= 0) return null;
401
+ const q = b / E, K = j * q, V = Z * q;
402
+ return { x: K, y: V, z: L };
403
403
  };
404
- let p = -n / 2, o = n / 2, c = -i / 2, M = i / 2;
405
- if (I) {
406
- const Z = [];
407
- for (let z = 0; z <= 10; z++) {
408
- const E = z / 10, O = -n / 2 + E * n, j = u(O, -i / 2);
409
- j && Z.push({ x: j.x, y: j.y });
410
- const L = u(O, i / 2);
411
- L && Z.push({ x: L.x, y: L.y });
412
- const K = -i / 2 + E * i, H = u(-n / 2, K);
413
- H && Z.push({ x: H.x, y: H.y });
414
- const G = u(n / 2, K);
415
- G && Z.push({ x: G.x, y: G.y });
404
+ let m = -n / 2, i = n / 2, c = -s / 2, M = s / 2;
405
+ if (z) {
406
+ const B = [];
407
+ for (let j = 0; j <= 10; j++) {
408
+ const Z = j / 10, L = -n / 2 + Z * n, E = d(L, -s / 2);
409
+ E && B.push({ x: E.x, y: E.y });
410
+ const q = d(L, s / 2);
411
+ q && B.push({ x: q.x, y: q.y });
412
+ const K = -s / 2 + Z * s, V = d(-n / 2, K);
413
+ V && B.push({ x: V.x, y: V.y });
414
+ const G = d(n / 2, K);
415
+ G && B.push({ x: G.x, y: G.y });
416
416
  }
417
- if (Z.length > 0) {
418
- p = Math.min(...Z.map((L) => L.x)), o = Math.max(...Z.map((L) => L.x)), c = Math.min(...Z.map((L) => L.y)), M = Math.max(...Z.map((L) => L.y));
419
- const z = Math.sqrt(v * v + y * y + x * x), E = 2, O = z * Math.max(n, i) * 0.1, j = E + O;
420
- p -= j, o += j, c -= j, M += j;
417
+ if (B.length > 0) {
418
+ m = Math.min(...B.map((q) => q.x)), i = Math.max(...B.map((q) => q.x)), c = Math.min(...B.map((q) => q.y)), M = Math.max(...B.map((q) => q.y));
419
+ const j = Math.sqrt(v * v + y * y + x * x), Z = 2, L = j * Math.max(n, s) * 0.1, E = Z + L;
420
+ m -= E, i += E, c -= E, M += E;
421
421
  }
422
422
  }
423
- const N = { minX: p, minY: c, maxX: o, maxY: M }, B = (Z, U) => {
424
- if (!I) {
425
- const Ie = Z / n + 0.5, ze = U / i + 0.5, me = (Ie - 0.5 - k) / b + 0.5, ye = (ze - 0.5 - C) / b + 0.5;
426
- return me >= 0 && me <= 1 && ye >= 0 && ye <= 1 ? {
427
- u: me * a.width,
428
- v: ye * a.height,
423
+ const I = { minX: m, minY: c, maxX: i, maxY: M }, X = (B, A) => {
424
+ if (!z) {
425
+ const ze = B / n + 0.5, je = A / s + 0.5, pe = (ze - 0.5 - k) / _ + 0.5, ye = (je - 0.5 - P) / _ + 0.5;
426
+ return pe >= 0 && pe <= 1 && ye >= 0 && ye <= 1 ? {
427
+ u: pe * r.width,
428
+ v: ye * r.height,
429
429
  z: 1
430
430
  } : null;
431
431
  }
432
- const [z, E, O] = re(0, 0, 1, v, y, x), j = 0, L = 0, K = 0, H = -g, G = Z - L, X = U - K, Y = 0 - H, D = Math.sqrt(G * G + X * X + Y * Y), R = G / D, V = X / D, A = Y / D, ue = R * z + V * E + A * O;
433
- if (Math.abs(ue) < 1e-4)
432
+ const [j, Z, L] = oe(0, 0, 1, v, y, x), E = 0, q = 0, K = 0, V = -b, G = B - q, Y = A - K, D = 0 - V, W = Math.sqrt(G * G + Y * Y + D * D), N = G / W, H = Y / W, U = D / W, de = N * j + H * Z + U * L;
433
+ if (Math.abs(de) < 1e-4)
434
434
  return null;
435
- const oe = -(L * z + K * E + H * O + j) / ue;
436
- if (oe < 0)
435
+ const ie = -(q * j + K * Z + V * L + E) / de;
436
+ if (ie < 0)
437
437
  return null;
438
- const he = L + R * oe, _e = K + V * oe, le = H + A * oe;
439
- if (le < H)
438
+ const he = q + N * ie, ge = K + H * ie, le = V + U * ie;
439
+ if (le < V)
440
440
  return null;
441
- const [ge, We] = Et(he, _e, le, v, y, x), Se = ge / n + 0.5, de = We / i + 0.5, Ne = le + g, be = (Se - 0.5 - k) / b + 0.5, pe = (de - 0.5 - C) / b + 0.5;
442
- return be >= 0 && be <= 1 && pe >= 0 && pe <= 1 ? {
443
- u: be * a.width,
444
- v: pe * a.height,
445
- z: Ne
441
+ const [be, Re] = Lt(he, ge, le, v, y, x), Se = be / n + 0.5, ue = Re / s + 0.5, Ie = le + b, _e = (Se - 0.5 - k) / _ + 0.5, me = (ue - 0.5 - P) / _ + 0.5;
442
+ return _e >= 0 && _e <= 1 && me >= 0 && me <= 1 ? {
443
+ u: _e * r.width,
444
+ v: me * r.height,
445
+ z: Ie
446
446
  } : null;
447
- }, J = w.showDepthVis ? { showDepthVis: !0, maxZ: g * 0.5 } : void 0;
448
- w.showBounds && Zt(r, t, s, n, i, u), He(r, a, t, s, n, i, h, B, N, J), w.showCrosshair && Ae(r, t, s);
447
+ }, J = w.showDepthVis ? { showDepthVis: !0, maxZ: b * 0.5 } : void 0;
448
+ w.showBounds && qt(o, t, a, n, s, d), Ve(o, r, t, a, n, s, h, X, I, J), w.showCrosshair && Ue(o, t, a);
449
449
  }
450
- function qt(r, a, t, s, n) {
451
- if (!("save" in r)) return;
452
- const i = r;
453
- if (i.save(), i.strokeStyle = "#ff6600", i.lineWidth = 2, i.setLineDash([6, 4]), i.beginPath(), i.arc(a, t, s, 0, Math.PI * 2), i.stroke(), i.beginPath(), i.moveTo(a - s, t), i.lineTo(a + s, t), i.stroke(), i.beginPath(), i.moveTo(a, t - s), i.lineTo(a, t + s), i.stroke(), i.beginPath(), i.moveTo(a - s, t - s), i.lineTo(a - s, t + s), i.stroke(), i.beginPath(), i.moveTo(a + s, t - s), i.lineTo(a + s, t + s), i.stroke(), Math.abs(n) > 1e-3) {
454
- i.strokeStyle = "#ffaa00";
455
- const l = Math.cos(n), f = Math.sin(n), h = s * 0.7;
456
- i.beginPath(), i.moveTo(a + l * h, t + f * h), i.lineTo(a - l * h, t - f * h), i.stroke(), i.beginPath(), i.moveTo(a - f * h, t + l * h), i.lineTo(a + f * h, t - l * h), i.stroke();
457
- }
458
- i.restore();
450
+ function Ut(o, r, t, a, n) {
451
+ if (!("save" in o)) return;
452
+ const s = o;
453
+ if (s.save(), s.strokeStyle = "#ff6600", s.lineWidth = 2, s.setLineDash([6, 4]), s.beginPath(), s.arc(r, t, a, 0, Math.PI * 2), s.stroke(), s.beginPath(), s.moveTo(r - a, t), s.lineTo(r + a, t), s.stroke(), s.beginPath(), s.moveTo(r, t - a), s.lineTo(r, t + a), s.stroke(), s.beginPath(), s.moveTo(r - a, t - a), s.lineTo(r - a, t + a), s.stroke(), s.beginPath(), s.moveTo(r + a, t - a), s.lineTo(r + a, t + a), s.stroke(), Math.abs(n) > 1e-3) {
454
+ s.strokeStyle = "#ffaa00";
455
+ const l = Math.cos(n), f = Math.sin(n), h = a * 0.7;
456
+ s.beginPath(), s.moveTo(r + l * h, t + f * h), s.lineTo(r - l * h, t - f * h), s.stroke(), s.beginPath(), s.moveTo(r - f * h, t + l * h), s.lineTo(r + f * h, t - l * h), s.stroke();
457
+ }
458
+ s.restore();
459
459
  }
460
- function Ht(r, a, t, s, n, i, l, f, h, w) {
461
- const { radius: d, rotationZ: _ } = l, m = _ * (Math.PI / 180), T = f.scale, v = f.translateX, y = f.translateY, x = {
462
- minX: -d,
463
- minY: -d,
464
- maxX: d,
465
- maxY: d
466
- }, I = (k, C) => {
467
- const S = Math.sqrt(k * k + C * C);
468
- if (S > d) return null;
469
- const g = Math.sqrt(d * d - k * k - C * C), p = Math.asin(S / d) * d, o = Math.atan2(C, k) - m, c = p * Math.cos(o), M = p * Math.sin(o), N = c / n + 0.5, B = M / i + 0.5, J = (N - 0.5 - v) / T + 0.5, Z = (B - 0.5 - y) / T + 0.5;
470
- return J >= 0 && J <= 1 && Z >= 0 && Z <= 1 ? {
471
- u: J * a.width,
472
- v: Z * a.height,
473
- z: g
460
+ function At(o, r, t, a, n, s, l, f, h, w) {
461
+ const { radius: u, rotationZ: g } = l, p = g * (Math.PI / 180), T = f.scale, v = f.translateX, y = f.translateY, x = {
462
+ minX: -u,
463
+ minY: -u,
464
+ maxX: u,
465
+ maxY: u
466
+ }, z = (k, P) => {
467
+ const S = Math.sqrt(k * k + P * P);
468
+ if (S > u) return null;
469
+ const b = Math.sqrt(u * u - k * k - P * P), m = Math.asin(S / u) * u, i = Math.atan2(P, k) - p, c = m * Math.cos(i), M = m * Math.sin(i), I = c / n + 0.5, X = M / s + 0.5, J = (I - 0.5 - v) / T + 0.5, B = (X - 0.5 - y) / T + 0.5;
470
+ return J >= 0 && J <= 1 && B >= 0 && B <= 1 ? {
471
+ u: J * r.width,
472
+ v: B * r.height,
473
+ z: b
474
474
  } : null;
475
- }, b = w.showDepthVis ? { showDepthVis: !0, maxZ: d } : void 0;
476
- w.showBounds && qt(r, t, s, d, m), He(r, a, t, s, n, i, h, I, x, b), w.showCrosshair && Ae(r, t, s);
475
+ }, _ = w.showDepthVis ? { showDepthVis: !0, maxZ: u } : void 0;
476
+ w.showBounds && Ut(o, t, a, u, p), Ve(o, r, t, a, n, s, h, z, x, _), w.showCrosshair && Ue(o, t, a);
477
477
  }
478
- function At(r, a, t, s, n, i, l) {
479
- r.drawImage(a, t - n / 2, s - i / 2, n, i);
478
+ function Ht(o, r, t, a, n, s, l) {
479
+ o.drawImage(r, t - n / 2, a - s / 2, n, s);
480
480
  }
481
- function Ut(r, a, t, s, n, i, l) {
481
+ function Ft(o, r, t, a, n, s, l) {
482
482
  if (!l.enabled || l.shape === "none") {
483
- r.drawImage(a, t - n / 2, s - i / 2, n, i);
483
+ o.drawImage(r, t - n / 2, a - s / 2, n, s);
484
484
  return;
485
485
  }
486
- const f = l.quality ?? 1, h = l.image ?? ie, w = l.debug ?? ve;
486
+ const f = l.quality ?? 1, h = l.image ?? se, w = l.debug ?? ve;
487
487
  switch (l.shape) {
488
488
  case "cylinder":
489
- l.cylinder && Lt(r, a, t, s, n, i, l.cylinder, h, f, w);
489
+ l.cylinder && Ot(o, r, t, a, n, s, l.cylinder, h, f, w);
490
490
  break;
491
491
  case "plane":
492
- l.plane && jt(r, a, t, s, n, i, l.plane, h, f, w);
492
+ l.plane && Vt(o, r, t, a, n, s, l.plane, h, f, w);
493
493
  break;
494
494
  case "sphere":
495
- l.sphere && Ht(r, a, t, s, n, i, l.sphere, h, f, w);
495
+ l.sphere && At(o, r, t, a, n, s, l.sphere, h, f, w);
496
496
  break;
497
497
  case "custom":
498
- l.custom && At(r, a, t, s, n, i, l.custom);
498
+ l.custom && Ht(o, r, t, a, n, s, l.custom);
499
499
  break;
500
500
  default:
501
- r.drawImage(a, t - n / 2, s - i / 2, n, i);
501
+ o.drawImage(r, t - n / 2, a - s / 2, n, s);
502
502
  }
503
503
  }
504
504
  const ee = {
@@ -520,38 +520,38 @@ const ee = {
520
520
  scale: 1,
521
521
  maintainAspectRatio: !0
522
522
  };
523
- function et(r, a) {
524
- let t = r, s = r.width, n = r.height;
525
- const i = Vt(a);
526
- for (const l of i)
523
+ function et(o, r) {
524
+ let t = o, a = o.width, n = o.height;
525
+ const s = Kt(r);
526
+ for (const l of s)
527
527
  switch (l.type) {
528
528
  case "resize":
529
- const f = Xt(s, n, l);
530
- s = f.width, n = f.height;
529
+ const f = Xt(a, n, l);
530
+ a = f.width, n = f.height;
531
531
  break;
532
532
  case "restyle":
533
- t = Ft(t, l);
533
+ t = Jt(t, l);
534
534
  break;
535
535
  }
536
536
  return {
537
537
  image: t,
538
- width: s,
538
+ width: a,
539
539
  height: n
540
540
  };
541
541
  }
542
- function Vt(r) {
543
- const a = ["resize", "restyle", "warp"];
544
- return r.sort((t, s) => {
545
- const n = a.indexOf(t.type), i = a.indexOf(s.type);
546
- return n - i;
542
+ function Kt(o) {
543
+ const r = ["resize", "restyle", "warp"];
544
+ return o.sort((t, a) => {
545
+ const n = r.indexOf(t.type), s = r.indexOf(a.type);
546
+ return n - s;
547
547
  });
548
548
  }
549
- function Ft(r, a) {
550
- const t = new OffscreenCanvas(r.width, r.height), s = t.getContext("2d");
551
- if (!s) return r;
552
- s.drawImage(r, 0, 0);
553
- const n = s.getImageData(0, 0, r.width, r.height), i = Nt(n, a);
554
- return s.putImageData(i, 0, 0), t.transferToImageBitmap();
549
+ function Jt(o, r) {
550
+ const t = new OffscreenCanvas(o.width, o.height), a = t.getContext("2d");
551
+ if (!a) return o;
552
+ a.drawImage(o, 0, 0);
553
+ const n = a.getImageData(0, 0, o.width, o.height), s = Pt(n, r);
554
+ return a.putImageData(s, 0, 0), t.transferToImageBitmap();
555
555
  }
556
556
  class at {
557
557
  latestInput = null;
@@ -559,11 +559,11 @@ class at {
559
559
  timeoutId = null;
560
560
  onFlush;
561
561
  TRAILING_MS = 32;
562
- constructor(a) {
563
- this.onFlush = a;
562
+ constructor(r) {
563
+ this.onFlush = r;
564
564
  }
565
- queue(a) {
566
- this.latestInput = a, this.timeoutId !== null && clearTimeout(this.timeoutId), this.rafPending || (this.rafPending = !0, requestAnimationFrame(() => {
565
+ queue(r) {
566
+ this.latestInput = r, this.timeoutId !== null && clearTimeout(this.timeoutId), this.rafPending || (this.rafPending = !0, requestAnimationFrame(() => {
567
567
  this.rafPending = !1, this.flush();
568
568
  })), this.timeoutId = setTimeout(() => {
569
569
  this.timeoutId = null, this.flush();
@@ -572,14 +572,34 @@ class at {
572
572
  flush() {
573
573
  if (this.latestInput === null) return;
574
574
  this.timeoutId !== null && (clearTimeout(this.timeoutId), this.timeoutId = null);
575
- const a = this.latestInput;
576
- this.latestInput = null, this.onFlush(a);
575
+ const r = this.latestInput;
576
+ this.latestInput = null, this.onFlush(r);
577
577
  }
578
578
  destroy() {
579
579
  this.timeoutId !== null && (clearTimeout(this.timeoutId), this.timeoutId = null), this.latestInput = null;
580
580
  }
581
581
  }
582
- class Kt {
582
+ const st = '(function(){"use strict";const ot={scale:1,translateX:0,translateY:0},at={showBounds:!1,showDepthVis:!1,showCrosshair:!1};({...ot});function et(c){const n=new OffscreenCanvas(c.width,c.height).getContext("2d");if(!n)throw new Error("Failed to create canvas context");return n.drawImage(c,0,0),n.getImageData(0,0,c.width,c.height)}function ct(c,e,n){const s=c.width,o=c.height,t=c.data;if(e<0||e>=s||n<0||n>=o)return null;const a=Math.floor(e),u=Math.floor(n),r=Math.min(a+1,s-1),M=Math.min(u+1,o-1),l=e-a,m=n-u,f=(Y,z)=>{const d=(z*s+Y)*4;return{r:t[d],g:t[d+1],b:t[d+2],a:t[d+3]}},g=f(a,u),i=f(r,u),p=f(a,M),h=f(r,M),S=(Y,z,d)=>Y+(z-Y)*d,X=S(S(g.r,i.r,l),S(p.r,h.r,l),m),v=S(S(g.g,i.g,l),S(p.g,h.g,l),m),V=S(S(g.b,i.b,l),S(p.b,h.b,l),m),B=S(S(g.a,i.a,l),S(p.a,h.a,l),m);return{r:X,g:v,b:V,a:B}}function J(c,e,n,s,o,t,a,u,r,M){const l=et(e),m=M?.showDepthVis??!1,f=M?.maxZ??500,g=r??{minX:-o/2,minY:-t/2,maxX:o/2,maxY:t/2},i=g.maxX-g.minX,p=g.maxY-g.minY,h=Math.floor(i*a),S=Math.floor(p*a);if(h<=0||S<=0)return;const X=new ImageData(h,S),v=X.data;for(let d=0;d<S;d++)for(let P=0;P<h;P++){const T=g.minX+P/a,b=g.minY+d/a,I=u(T,b);if(!I||I.z<=0)continue;const y=(d*h+P)*4;if(m){const Z=Math.min(1,Math.max(0,I.z/f)),x=Math.floor(Z*200+55);v[y]=Math.floor(x*.3),v[y+1]=Math.floor(x*.6),v[y+2]=x,v[y+3]=200}else{const{u:Z,v:x}=I,w=ct(l,Z,x);w&&(v[y]=Math.round(w.r),v[y+1]=Math.round(w.g),v[y+2]=Math.round(w.b),v[y+3]=Math.round(w.a))}}const V=new OffscreenCanvas(h,S),B=V.getContext("2d");if(!B)return;B.putImageData(X,0,0);const Y=n+g.minX,z=s+g.minY;a!==1?c.drawImage(V,Y,z,i,p):c.drawImage(V,Y,z)}function K(c,e,n,s=20){if(!("save"in c))return;const o=c;o.save(),o.strokeStyle="#00ff00",o.lineWidth=2,o.beginPath(),o.moveTo(e-s,n),o.lineTo(e+s,n),o.stroke(),o.beginPath(),o.moveTo(e,n-s),o.lineTo(e,n+s),o.stroke(),o.fillStyle="#00ff00",o.beginPath(),o.arc(e,n,3,0,Math.PI*2),o.fill(),o.restore()}function U(c,e,n,s,o,t){const a=Math.cos(s),u=Math.sin(s),r=Math.cos(o),M=Math.sin(o),l=Math.cos(t),m=Math.sin(t);let f=c,g=e,i=n;if(t!==0){const p=f,h=g;f=p*l-h*m,g=p*m+h*l}if(o!==0){const p=f,h=i;f=p*r+h*M,i=-p*M+h*r}if(s!==0){const p=g,h=i;g=p*a-h*u,i=p*u+h*a}return[f,g,i]}function it(c,e,n,s,o,t){const a=Math.cos(s),u=Math.sin(s),r=Math.cos(o),M=Math.sin(o),l=Math.cos(t),m=Math.sin(t);let f=c,g=e,i=n;if(s!==0){const p=g,h=i;g=p*a+h*u,i=-p*u+h*a}if(o!==0){const p=f,h=i;f=p*r-h*M,i=p*M+h*r}if(t!==0){const p=f,h=g;f=p*l+h*m,g=-p*m+h*l}return[f,g,i]}function rt(c,e,n,s,o,t){if(!("save"in c))return;const a=c;a.save(),a.strokeStyle="#ff6600",a.lineWidth=1.5,a.setLineDash([4,6]);const u=50,r=3;for(let M=-r;M<=r;M++){const l=M*u,m=[];for(let f=-10;f<=10;f++){const g=f*u,i=t(l,g);i&&m.push({x:e+i.x,y:n+i.y})}if(m.length>1){a.beginPath(),a.moveTo(m[0].x,m[0].y);for(let f=1;f<m.length;f++)a.lineTo(m[f].x,m[f].y);a.stroke()}}for(let M=-r;M<=r;M++){const l=M*u,m=[];for(let f=-10;f<=10;f++){const g=f*u,i=t(g,l);i&&m.push({x:e+i.x,y:n+i.y})}if(m.length>1){a.beginPath(),a.moveTo(m[0].x,m[0].y);for(let f=1;f<m.length;f++)a.lineTo(m[f].x,m[f].y);a.stroke()}}a.restore()}function lt(c,e,n,s,o,t,a,u){if(!("save"in c))return;const r=c;r.save(),r.lineWidth=2,r.setLineDash([6,4]);const M=Math.sin(t);let l=1/0,m=-1/0;const f=(d,P,T)=>{const b=P*M,I=u/(u+b);return{x:e+d*I,y:n+P*I,z:T}},g=(d,P,T)=>{const b=T-P;if(b<.001)return"#ff6600";const I=(d-P)/b,y=Math.round(100+I*155),Z=Math.round(30+I*70),x=Math.round(0+I*0);return`rgb(${y},${Z},${x})`},i=32,p=[],h=[],S=[],X=[],v=t>.01?-Math.PI/2:0,V=t>.01?Math.PI/2:Math.PI*2,B=t<-.01?-Math.PI/2:0,Y=t<-.01?Math.PI/2:Math.PI*2;for(let d=0;d<=i;d++){const P=d/i,T=v+P*(V-v),b=Math.sin(T)*s,I=Math.cos(T)*s,y=-o/2,[Z,x,w]=U(b,y,I,t,0,a),k=f(Z,x,w);p.push(k),l=Math.min(l,w),m=Math.max(m,w)}for(let d=0;d<=i;d++){const P=d/i,T=B+P*(Y-B),b=Math.sin(T)*s,I=Math.cos(T)*s,y=o/2,[Z,x,w]=U(b,y,I,t,0,a),k=f(Z,x,w);h.push(k),l=Math.min(l,w),m=Math.max(m,w)}for(let d=0;d<=10;d++){const P=d/10,T=-o/2+P*o,[b,I,y]=U(-s,T,0,t,0,a);S.push(f(b,I,y)),l=Math.min(l,y),m=Math.max(m,y);const[Z,x,w]=U(s,T,0,t,0,a);X.push(f(Z,x,w)),l=Math.min(l,w),m=Math.max(m,w)}const z=d=>{for(let P=0;P<d.length-1;P++){const T=d[P],b=d[P+1],I=(T.z+b.z)/2;r.strokeStyle=g(I,l,m),r.beginPath(),r.moveTo(T.x,T.y),r.lineTo(b.x,b.y),r.stroke()}};z(p),z(h),z(S),z(X),r.restore()}function ft(c,e,n,s,o,t,a,u,r,M){const{diameter:l,perspective:m,rotationX:f,rotationZ:g}=a,i=l/2,p=f*Math.PI/180,h=g*Math.PI/180,S=Math.abs(p)>.001,X=m??1,v=X>.01?i*(10/X):i*1e3,V=u.scale,B=u.translateX,Y=u.translateY;let z={minX:-i,minY:-t/2,maxX:i,maxY:t/2};if(S){const T=[{x:-i,y:-t/2},{x:i,y:-t/2},{x:i,y:t/2},{x:-i,y:t/2}],b=[];for(const y of T){const[Z,x,w]=U(y.x,y.y,i,p,0,h),k=v/(v+w);b.push({x:Z*k,y:x*k});const[j,W,C]=U(y.x,y.y,0,p,0,h),D=v/(v+C);b.push({x:j*D,y:W*D})}const I=i*Math.abs(Math.sin(p));b.length>0&&(z={minX:Math.min(...b.map(y=>y.x))-2,minY:Math.min(...b.map(y=>y.y))-I-2,maxX:Math.max(...b.map(y=>y.x))+2,maxY:Math.max(...b.map(y=>y.y))+I+2})}const d=(T,b)=>{const I=Math.cos(h),y=Math.sin(h),Z=T*I+b*y,x=-T*y+b*I,w=Math.cos(p),k=Math.sin(p),j=x*k,W=v/(v+j),C=Z/W,D=x/W;if(Math.abs(C)>i)return null;const E=Math.sqrt(i*i-C*C);if(Math.abs(w)<.01)return null;const L=(D+E*k)/w,O=L*k+E*w;if(O<0)return null;const F=Math.asin(C/i)*i/o+.5,$=L/t+.5,q=(F-.5-B)/V+.5,A=($-.5-Y)/V+.5;return q>=0&&q<=1&&A>=0&&A<=1?{u:q*e.width,v:A*e.height,z:O}:null},P=M.showDepthVis?{showDepthVis:!0,maxZ:i}:void 0;M.showBounds&&lt(c,n,s,i,t,p,h,v),J(c,e,n,s,o,t,r,d,z,P),M.showCrosshair&&K(c,n,s)}function ht(c,e,n,s,o,t,a,u,r,M){const{rotationX:l,rotationY:m,rotationZ:f,depthScale:g}=a,i=l*(Math.PI/180),p=m*(Math.PI/180),h=f*(Math.PI/180),S=Math.abs(i)>.001||Math.abs(p)>.001||Math.abs(h)>.001,X=u.scale,v=u.translateX,V=u.translateY,B=g*.001,Y=B>1e-4?1/B:1e4,z=(x,w)=>{const[k,j,W]=U(x,w,0,i,p,h),C=W+Y;if(C<=0)return null;const D=Y/C,E=k*D,L=j*D;return{x:E,y:L,z:W}};let d=-o/2,P=o/2,T=-t/2,b=t/2;if(S){const x=[];for(let k=0;k<=10;k++){const j=k/10,W=-o/2+j*o,C=z(W,-t/2);C&&x.push({x:C.x,y:C.y});const D=z(W,t/2);D&&x.push({x:D.x,y:D.y});const E=-t/2+j*t,L=z(-o/2,E);L&&x.push({x:L.x,y:L.y});const O=z(o/2,E);O&&x.push({x:O.x,y:O.y})}if(x.length>0){d=Math.min(...x.map(D=>D.x)),P=Math.max(...x.map(D=>D.x)),T=Math.min(...x.map(D=>D.y)),b=Math.max(...x.map(D=>D.y));const k=Math.sqrt(i*i+p*p+h*h),j=2,W=k*Math.max(o,t)*.1,C=j+W;d-=C,P+=C,T-=C,b+=C}}const I={minX:d,minY:T,maxX:P,maxY:b},y=(x,w)=>{if(!S){const wt=x/o+.5,St=w/t+.5,tt=(wt-.5-v)/X+.5,nt=(St-.5-V)/X+.5;return tt>=0&&tt<=1&&nt>=0&&nt<=1?{u:tt*e.width,v:nt*e.height,z:1}:null}const[k,j,W]=U(0,0,1,i,p,h),C=0,D=0,E=0,L=-Y,O=x-D,R=w-E,H=0-L,F=Math.sqrt(O*O+R*R+H*H),$=O/F,q=R/F,A=H/F,st=$*k+q*j+A*W;if(Math.abs(st)<1e-4)return null;const G=-(D*k+E*j+L*W+C)/st;if(G<0)return null;const yt=D+$*G,xt=E+q*G,N=L+A*G;if(N<L)return null;const[bt,vt]=it(yt,xt,N,i,p,h),Pt=bt/o+.5,Tt=vt/t+.5,It=N+Y,Q=(Pt-.5-v)/X+.5,_=(Tt-.5-V)/X+.5;return Q>=0&&Q<=1&&_>=0&&_<=1?{u:Q*e.width,v:_*e.height,z:It}:null},Z=M.showDepthVis?{showDepthVis:!0,maxZ:Y*.5}:void 0;M.showBounds&&rt(c,n,s,o,t,z),J(c,e,n,s,o,t,r,y,I,Z),M.showCrosshair&&K(c,n,s)}function pt(c,e,n,s,o){if(!("save"in c))return;const t=c;if(t.save(),t.strokeStyle="#ff6600",t.lineWidth=2,t.setLineDash([6,4]),t.beginPath(),t.arc(e,n,s,0,Math.PI*2),t.stroke(),t.beginPath(),t.moveTo(e-s,n),t.lineTo(e+s,n),t.stroke(),t.beginPath(),t.moveTo(e,n-s),t.lineTo(e,n+s),t.stroke(),t.beginPath(),t.moveTo(e-s,n-s),t.lineTo(e-s,n+s),t.stroke(),t.beginPath(),t.moveTo(e+s,n-s),t.lineTo(e+s,n+s),t.stroke(),Math.abs(o)>.001){t.strokeStyle="#ffaa00";const a=Math.cos(o),u=Math.sin(o),r=s*.7;t.beginPath(),t.moveTo(e+a*r,n+u*r),t.lineTo(e-a*r,n-u*r),t.stroke(),t.beginPath(),t.moveTo(e-u*r,n+a*r),t.lineTo(e+u*r,n-a*r),t.stroke()}t.restore()}function mt(c,e,n,s,o,t,a,u,r,M){const{radius:l,rotationZ:m}=a,f=m*(Math.PI/180),g=u.scale,i=u.translateX,p=u.translateY,h={minX:-l,minY:-l,maxX:l,maxY:l},S=(v,V)=>{const B=Math.sqrt(v*v+V*V);if(B>l)return null;const Y=Math.sqrt(l*l-v*v-V*V),d=Math.asin(B/l)*l,P=Math.atan2(V,v)-f,T=d*Math.cos(P),b=d*Math.sin(P),I=T/o+.5,y=b/t+.5,Z=(I-.5-i)/g+.5,x=(y-.5-p)/g+.5;return Z>=0&&Z<=1&&x>=0&&x<=1?{u:Z*e.width,v:x*e.height,z:Y}:null},X=M.showDepthVis?{showDepthVis:!0,maxZ:l}:void 0;M.showBounds&&pt(c,n,s,l,f),J(c,e,n,s,o,t,r,S,h,X),M.showCrosshair&&K(c,n,s)}function ut(c,e,n,s,o,t,a){c.drawImage(e,n-o/2,s-t/2,o,t)}function dt(c,e,n,s,o,t,a){if(!a.enabled||a.shape==="none"){c.drawImage(e,n-o/2,s-t/2,o,t);return}const u=a.quality??1,r=a.image??ot,M=a.debug??at;switch(a.shape){case"cylinder":a.cylinder&&ft(c,e,n,s,o,t,a.cylinder,r,u,M);break;case"plane":a.plane&&ht(c,e,n,s,o,t,a.plane,r,u,M);break;case"sphere":a.sphere&&mt(c,e,n,s,o,t,a.sphere,r,u,M);break;case"custom":a.custom&&ut(c,e,n,s,o,t,a.custom);break;default:c.drawImage(e,n-o/2,s-t/2,o,t)}}self.onmessage=async c=>{const{type:e,payload:n}=c.data;if(e==="render"){const s=performance.now();try{const o=await Mt(n),t=performance.now()-s,a={type:"complete",payload:{id:n.id,result:o,frameTime:t}};self.postMessage(a,[o])}catch(o){const t={type:"error",payload:{id:n.id,error:o instanceof Error?o.message:String(o)}};self.postMessage(t)}}};async function Mt(c){const{canvasWidth:e,canvasHeight:n,layers:s,images:o}=c;performance.now();const t=new OffscreenCanvas(e,n),a=t.getContext("2d");if(!a)throw new Error("Failed to get 2d context");a.fillStyle="#ffffff",a.fillRect(0,0,e,n);for(let r=0;r<s.length;r++){const M=s[r],l=o[r];l&&gt(a,l,M)}return await createImageBitmap(t)}function gt(c,e,n){c.save(),c.globalAlpha=n.opacity;const s=n.x,o=n.y;c.translate(s,o),c.rotate(n.rotation*Math.PI/180),n.warp&&n.warp.enabled&&n.warp.shape!=="none"?dt(c,e,0,0,n.width,n.height,n.warp):c.drawImage(e,-n.width/2,-n.height/2,n.width,n.height),c.restore()}})();\n', tt = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", st], { type: "text/javascript;charset=utf-8" });
583
+ function Gt(o) {
584
+ let r;
585
+ try {
586
+ if (r = tt && (self.URL || self.webkitURL).createObjectURL(tt), !r) throw "";
587
+ const t = new Worker(r, {
588
+ name: o?.name
589
+ });
590
+ return t.addEventListener("error", () => {
591
+ (self.URL || self.webkitURL).revokeObjectURL(r);
592
+ }), t;
593
+ } catch {
594
+ return new Worker(
595
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(st),
596
+ {
597
+ name: o?.name
598
+ }
599
+ );
600
+ }
601
+ }
602
+ class $t {
583
603
  worker = null;
584
604
  batcher;
585
605
  pendingRequest = null;
@@ -587,66 +607,59 @@ class Kt {
587
607
  frameId = 0;
588
608
  lastCompletedId = 0;
589
609
  options;
590
- constructor(a) {
591
- this.options = a, this.batcher = new at((t) => this.submitToWorker(t)), this.initWorker();
610
+ constructor(r) {
611
+ this.options = r, this.batcher = new at((t) => this.submitToWorker(t)), this.initWorker();
592
612
  }
593
613
  initWorker() {
594
614
  try {
595
- this.worker = new Worker(
596
- new URL(
597
- /* @vite-ignore */
598
- "/assets/render.worker-CozETkb6.js",
599
- import.meta.url
600
- ),
601
- { type: "module" }
602
- ), this.worker.onmessage = (a) => {
603
- this.handleWorkerMessage(a.data);
604
- }, this.worker.onerror = (a) => {
605
- console.error("Worker error:", a), this.options.onError?.(`Worker error: ${a.message}`);
615
+ this.worker = new Gt(), this.worker.onmessage = (r) => {
616
+ this.handleWorkerMessage(r.data);
617
+ }, this.worker.onerror = (r) => {
618
+ console.error("Worker error:", r), this.options.onError?.(`Worker error: ${r.message}`);
606
619
  };
607
- } catch (a) {
608
- console.error("Failed to create worker:", a), this.options.onError?.("Failed to create render worker");
620
+ } catch (r) {
621
+ console.error("Failed to create worker:", r), this.options.onError?.("Failed to create render worker");
609
622
  }
610
623
  }
611
- request(a) {
612
- this.batcher.queue(a);
624
+ request(r) {
625
+ this.batcher.queue(r);
613
626
  }
614
- submitToWorker(a) {
615
- const t = ++this.frameId, s = {
616
- ...a,
627
+ submitToWorker(r) {
628
+ const t = ++this.frameId, a = {
629
+ ...r,
617
630
  id: t
618
631
  };
619
- this.isWorking ? this.pendingRequest = s : this.sendToWorker(s);
632
+ this.isWorking ? this.pendingRequest = a : this.sendToWorker(a);
620
633
  }
621
- sendToWorker(a) {
634
+ sendToWorker(r) {
622
635
  if (!this.worker) return;
623
636
  this.isWorking = !0;
624
- const t = { type: "render", payload: a }, s = a.images.filter((n) => n instanceof ImageBitmap);
625
- this.worker.postMessage(t, s);
637
+ const t = { type: "render", payload: r }, a = r.images.filter((n) => n instanceof ImageBitmap);
638
+ this.worker.postMessage(t, a);
626
639
  }
627
- handleWorkerMessage(a) {
628
- if (a.type === "error") {
629
- console.error("Render error:", a.payload.error), this.isWorking = !1, this.processNext();
640
+ handleWorkerMessage(r) {
641
+ if (r.type === "error") {
642
+ console.error("Render error:", r.payload.error), this.isWorking = !1, this.processNext();
630
643
  return;
631
644
  }
632
- const { id: t, result: s, frameTime: n } = a.payload;
645
+ const { id: t, result: a, frameTime: n } = r.payload;
633
646
  if (this.isWorking = !1, t <= this.lastCompletedId) {
634
- s.close(), this.processNext();
647
+ a.close(), this.processNext();
635
648
  return;
636
649
  }
637
- this.lastCompletedId = t, this.options.onResult(s, n), this.processNext();
650
+ this.lastCompletedId = t, this.options.onResult(a, n), this.processNext();
638
651
  }
639
652
  processNext() {
640
653
  if (this.pendingRequest) {
641
- const a = this.pendingRequest;
642
- this.pendingRequest = null, this.sendToWorker(a);
654
+ const r = this.pendingRequest;
655
+ this.pendingRequest = null, this.sendToWorker(r);
643
656
  }
644
657
  }
645
658
  destroy() {
646
659
  this.batcher.destroy(), this.worker && (this.worker.terminate(), this.worker = null);
647
660
  }
648
661
  }
649
- function qe(r, a, t = {}, s) {
662
+ function Oe(o, r, t = {}, a) {
650
663
  const n = {
651
664
  loadedImages: /* @__PURE__ */ new Map(),
652
665
  imageBitmaps: /* @__PURE__ */ new Map(),
@@ -658,115 +671,115 @@ function qe(r, a, t = {}, s) {
658
671
  ctx: null,
659
672
  renderStartTime: null
660
673
  };
661
- n.ctx = r.getContext("2d");
662
- function i(b, k) {
663
- return Object.keys(k).length === 0 ? b : {
664
- ...b,
665
- layers: b.layers.map((C) => {
666
- const S = C.name || C.id, g = k[S];
667
- return g ? {
668
- ...C,
669
- src: g
670
- } : C;
674
+ n.ctx = o.getContext("2d");
675
+ function s(_, k) {
676
+ return Object.keys(k).length === 0 ? _ : {
677
+ ..._,
678
+ layers: _.layers.map((P) => {
679
+ const S = P.name || P.id, b = k[S];
680
+ return b ? {
681
+ ...P,
682
+ src: b
683
+ } : P;
671
684
  })
672
685
  };
673
686
  }
674
687
  if (!n.ctx)
675
688
  return () => {
676
689
  };
677
- let l = a, f = t;
690
+ let l = r, f = t;
678
691
  function h() {
679
- return i(l, f);
680
- }
681
- h(), n.scheduler = new Kt({
682
- onResult: (b, k) => {
683
- if (n.ctx && r)
684
- if (n.ctx.drawImage(b, 0, 0, r.width, r.height), b.close(), n.renderStartTime !== null) {
685
- const C = performance.now() - n.renderStartTime;
686
- s?.(C), n.renderStartTime = null;
692
+ return s(l, f);
693
+ }
694
+ h(), n.scheduler = new $t({
695
+ onResult: (_, k) => {
696
+ if (n.ctx && o)
697
+ if (n.ctx.drawImage(_, 0, 0, o.width, o.height), _.close(), n.renderStartTime !== null) {
698
+ const P = performance.now() - n.renderStartTime;
699
+ a?.(P), n.renderStartTime = null;
687
700
  } else
688
- s?.(k);
701
+ a?.(k);
689
702
  },
690
- onError: (b) => {
691
- console.warn("Worker render failed, falling back to main thread:", b), n.useWorker = !1, m();
703
+ onError: (_) => {
704
+ console.warn("Worker render failed, falling back to main thread:", _), n.useWorker = !1, p();
692
705
  }
693
706
  });
694
707
  function w() {
695
- if (!r || !n.ctx) return;
696
- const b = h(), k = b.layers.map((S) => S.src).join(","), C = b.layers.map((S) => {
697
- const g = S.effects.find((c) => c.type === "warp"), u = S.effects.find((c) => c.type === "restyle"), p = g ? `${g.enabled}:${g.shape}` : "none", o = u ? JSON.stringify(u) : "none";
698
- return `${S.id}:${S.transform.x},${S.transform.y},${S.transform.scale},${S.transform.rotation},${S.opacity},${S.visible}:${p}:${o}`;
708
+ if (!o || !n.ctx) return;
709
+ const _ = h(), k = _.layers.map((S) => S.src).join(","), P = _.layers.map((S) => {
710
+ const b = S.effects.find((c) => c.type === "warp"), d = S.effects.find((c) => c.type === "restyle"), m = b ? `${b.enabled}:${b.shape}` : "none", i = d ? JSON.stringify(d) : "none";
711
+ return `${S.id}:${S.transform.x},${S.transform.y},${S.transform.scale},${S.transform.rotation},${S.opacity},${S.visible}:${m}:${i}`;
699
712
  }).join("|");
700
- (r.width !== b.width || r.height !== b.height) && (r.width = b.width, r.height = b.height), k !== n.lastSources ? (n.lastSources = k, n.imagesLoaded = !1, _()) : n.imagesLoaded && C !== n.lastRenderKey ? (n.lastRenderKey = C, m()) : n.imagesLoaded ? n.imagesLoaded && m() : h().layers.length > 0 && _();
713
+ (o.width !== _.width || o.height !== _.height) && (o.width = _.width, o.height = _.height), k !== n.lastSources ? (n.lastSources = k, n.imagesLoaded = !1, g()) : n.imagesLoaded && P !== n.lastRenderKey ? (n.lastRenderKey = P, p()) : n.imagesLoaded ? n.imagesLoaded && p() : h().layers.length > 0 && g();
701
714
  }
702
- async function d(b) {
703
- if (n.loadedImages.has(b))
704
- return n.loadedImages.get(b);
705
- const k = b.startsWith("data:");
706
- let S = b.startsWith("/") || b.startsWith("./") || b.startsWith("../");
715
+ async function u(_) {
716
+ if (n.loadedImages.has(_))
717
+ return n.loadedImages.get(_);
718
+ const k = _.startsWith("data:");
719
+ let S = _.startsWith("/") || _.startsWith("./") || _.startsWith("../");
707
720
  if (!k && !S && typeof window < "u")
708
721
  try {
709
- S = new URL(b, window.location.href).origin === window.location.origin;
722
+ S = new URL(_, window.location.href).origin === window.location.origin;
710
723
  } catch {
711
724
  S = !0;
712
725
  }
713
- const g = new Image();
726
+ const b = new Image();
714
727
  try {
715
- if (await new Promise((u, p) => {
716
- const o = setTimeout(() => {
717
- p(new Error("Image load timeout"));
728
+ if (await new Promise((d, m) => {
729
+ const i = setTimeout(() => {
730
+ m(new Error("Image load timeout"));
718
731
  }, 3e4);
719
- g.onload = () => {
720
- clearTimeout(o), u();
721
- }, g.onerror = (c) => {
722
- clearTimeout(o), p(c);
723
- }, g.src = b;
724
- }), n.loadedImages.set(b, g), !k && !S)
732
+ b.onload = () => {
733
+ clearTimeout(i), d();
734
+ }, b.onerror = (c) => {
735
+ clearTimeout(i), m(c);
736
+ }, b.src = _;
737
+ }), n.loadedImages.set(_, b), !k && !S)
725
738
  try {
726
- const u = new Image();
727
- u.crossOrigin = "anonymous", await new Promise((p, o) => {
728
- u.onload = () => p(), u.onerror = () => o(new Error("CORS failed")), u.src = b;
729
- }), n.loadedImages.set(b, u);
739
+ const d = new Image();
740
+ d.crossOrigin = "anonymous", await new Promise((m, i) => {
741
+ d.onload = () => m(), d.onerror = () => i(new Error("CORS failed")), d.src = _;
742
+ }), n.loadedImages.set(_, d);
730
743
  try {
731
- const p = await createImageBitmap(u);
732
- n.imageBitmaps.set(b, p);
733
- } catch (p) {
734
- console.warn("Failed to create ImageBitmap:", p);
744
+ const m = await createImageBitmap(d);
745
+ n.imageBitmaps.set(_, m);
746
+ } catch (m) {
747
+ console.warn("Failed to create ImageBitmap:", m);
735
748
  }
736
- return u;
749
+ return d;
737
750
  } catch {
738
- console.warn(`Image loaded but CORS not available for ${b}. Canvas operations may be limited.`);
751
+ console.warn(`Image loaded but CORS not available for ${_}. Canvas operations may be limited.`);
739
752
  try {
740
- const p = await createImageBitmap(g);
741
- n.imageBitmaps.set(b, p);
753
+ const m = await createImageBitmap(b);
754
+ n.imageBitmaps.set(_, m);
742
755
  } catch {
743
756
  }
744
- return g;
757
+ return b;
745
758
  }
746
759
  else {
747
760
  try {
748
- const u = await createImageBitmap(g);
749
- n.imageBitmaps.set(b, u);
750
- } catch (u) {
751
- console.warn("Failed to create ImageBitmap:", u);
761
+ const d = await createImageBitmap(b);
762
+ n.imageBitmaps.set(_, d);
763
+ } catch (d) {
764
+ console.warn("Failed to create ImageBitmap:", d);
752
765
  }
753
- return g;
766
+ return b;
754
767
  }
755
- } catch (u) {
756
- return console.error(`Failed to load image: ${b}`, u), null;
768
+ } catch (d) {
769
+ return console.error(`Failed to load image: ${_}`, d), null;
757
770
  }
758
771
  }
759
- async function _() {
772
+ async function g() {
760
773
  performance.now();
761
- const b = h();
762
- if (b.layers.length === 0) {
763
- n.imagesLoaded = !0, n.ctx && m();
774
+ const _ = h();
775
+ if (_.layers.length === 0) {
776
+ n.imagesLoaded = !0, n.ctx && p();
764
777
  return;
765
778
  }
766
- await Promise.all(b.layers.map((k) => d(k.src))), n.imagesLoaded = !0, n.ctx && r && m();
779
+ await Promise.all(_.layers.map((k) => u(k.src))), n.imagesLoaded = !0, n.ctx && o && p();
767
780
  }
768
- function m() {
769
- if (!(!n.ctx || !r)) {
781
+ function p() {
782
+ if (!(!n.ctx || !o)) {
770
783
  if (n.useWorker && n.scheduler) {
771
784
  T();
772
785
  return;
@@ -777,32 +790,32 @@ function qe(r, a, t = {}, s) {
777
790
  async function T() {
778
791
  if (!n.scheduler) return;
779
792
  n.renderStartTime = performance.now();
780
- const b = h(), k = [], C = [];
793
+ const _ = h(), k = [], P = [];
781
794
  let S = !1;
782
- for (const g of b.layers) {
783
- if (!g.visible) continue;
784
- const u = n.loadedImages.get(g.src), p = n.imageBitmaps.get(g.src);
785
- if (!u) continue;
786
- if (!p) {
795
+ for (const b of _.layers) {
796
+ if (!b.visible) continue;
797
+ const d = n.loadedImages.get(b.src), m = n.imageBitmaps.get(b.src);
798
+ if (!d) continue;
799
+ if (!m) {
787
800
  S = !0;
788
801
  continue;
789
802
  }
790
- const o = et(p, g.effects), c = g.effects.find((z) => z.type === "warp");
791
- let M = o.width, N = o.height;
792
- const B = M * g.transform.scale, J = N * g.transform.scale;
793
- let Z;
794
- if (o.image instanceof ImageBitmap)
795
- Z = o.image;
803
+ const i = et(m, b.effects), c = b.effects.find((j) => j.type === "warp");
804
+ let M = i.width, I = i.height;
805
+ const X = M * b.transform.scale, J = I * b.transform.scale;
806
+ let B;
807
+ if (i.image instanceof ImageBitmap)
808
+ B = i.image;
796
809
  else
797
810
  try {
798
- Z = await createImageBitmap(o.image);
799
- } catch (z) {
800
- console.warn("Failed to create bitmap from processed image, falling back to main thread:", z), v();
811
+ B = await createImageBitmap(i.image);
812
+ } catch (j) {
813
+ console.warn("Failed to create bitmap from processed image, falling back to main thread:", j), v();
801
814
  return;
802
815
  }
803
- let U = null;
816
+ let A = null;
804
817
  if (c) {
805
- const z = {
818
+ const j = {
806
819
  type: "warp",
807
820
  shape: c.shape,
808
821
  enabled: !!c.enabled,
@@ -813,199 +826,208 @@ function qe(r, a, t = {}, s) {
813
826
  translateY: Number(c.image?.translateY ?? 0)
814
827
  }
815
828
  };
816
- c.debug && (z.debug = {
829
+ c.debug && (j.debug = {
817
830
  showBounds: !!c.debug.showBounds,
818
831
  showDepthVis: !!c.debug.showDepthVis,
819
832
  showCrosshair: !!c.debug.showCrosshair
820
- }), c.cylinder && (z.cylinder = {
833
+ }), c.cylinder && (j.cylinder = {
821
834
  diameter: Number(c.cylinder.diameter),
822
835
  pitch: Number(c.cylinder.pitch),
823
836
  perspective: Number(c.cylinder.perspective),
824
837
  rotationX: Number(c.cylinder.rotationX),
825
838
  rotationY: Number(c.cylinder.rotationY),
826
839
  rotationZ: Number(c.cylinder.rotationZ)
827
- }), c.plane && (z.plane = {
840
+ }), c.plane && (j.plane = {
828
841
  rotationX: Number(c.plane.rotationX),
829
842
  rotationY: Number(c.plane.rotationY),
830
843
  rotationZ: Number(c.plane.rotationZ),
831
844
  depthScale: Number(c.plane.depthScale)
832
- }), c.sphere && (z.sphere = {
845
+ }), c.sphere && (j.sphere = {
833
846
  radius: Number(c.sphere.radius),
834
847
  rotationX: Number(c.sphere.rotationX),
835
848
  rotationY: Number(c.sphere.rotationY),
836
849
  rotationZ: Number(c.sphere.rotationZ)
837
- }), c.custom && (z.custom = {
850
+ }), c.custom && (j.custom = {
838
851
  formula: String(c.custom.formula),
839
852
  parameters: Object.fromEntries(
840
- Object.entries(c.custom.parameters || {}).map(([E, O]) => [E, Number(O)])
853
+ Object.entries(c.custom.parameters || {}).map(([Z, L]) => [Z, Number(L)])
841
854
  )
842
- }), U = z;
855
+ }), A = j;
843
856
  }
844
857
  k.push({
845
- id: String(g.id),
846
- x: Number(g.transform.x),
847
- y: Number(g.transform.y),
848
- width: Number(B),
858
+ id: String(b.id),
859
+ x: Number(b.transform.x),
860
+ y: Number(b.transform.y),
861
+ width: Number(X),
849
862
  height: Number(J),
850
- rotation: Number(g.transform.rotation),
851
- opacity: Number(g.opacity),
852
- warp: U
853
- }), C.push(Z);
863
+ rotation: Number(b.transform.rotation),
864
+ opacity: Number(b.opacity),
865
+ warp: A
866
+ }), P.push(B);
854
867
  }
855
868
  if (S || k.length === 0) {
856
869
  v();
857
870
  return;
858
871
  }
859
872
  try {
860
- const g = await Promise.all(
861
- C.map((u) => createImageBitmap(u))
873
+ const b = await Promise.all(
874
+ P.map((d) => createImageBitmap(d))
862
875
  );
863
876
  n.scheduler?.request({
864
- canvasWidth: b.width,
865
- canvasHeight: b.height,
877
+ canvasWidth: _.width,
878
+ canvasHeight: _.height,
866
879
  layers: k,
867
- images: g
880
+ images: b
868
881
  });
869
- } catch (g) {
870
- console.warn("Failed to clone bitmaps for worker, falling back to main thread:", g), v();
882
+ } catch (b) {
883
+ console.warn("Failed to clone bitmaps for worker, falling back to main thread:", b), v();
871
884
  }
872
885
  }
873
886
  function v() {
874
- if (!n.ctx || !r) return;
875
- const b = n.renderStartTime ?? performance.now(), k = h();
887
+ if (!n.ctx || !o) return;
888
+ const _ = n.renderStartTime ?? performance.now(), k = h();
876
889
  n.ctx.fillStyle = "#ffffff", n.ctx.fillRect(0, 0, k.width, k.height);
877
890
  for (const S of k.layers) {
878
891
  if (!S.visible) continue;
879
892
  performance.now();
880
- const g = n.loadedImages.get(S.src);
881
- if (!g) continue;
882
- if (!g.complete || g.naturalWidth === 0) {
893
+ const b = n.loadedImages.get(S.src);
894
+ if (!b) continue;
895
+ if (!b.complete || b.naturalWidth === 0) {
883
896
  console.warn("Image not fully loaded:", S.src);
884
897
  continue;
885
898
  }
886
- const u = et(g, S.effects), p = S.effects.find((Z) => Z.type === "warp");
887
- let o = u.width, c = u.height;
899
+ const d = et(b, S.effects), m = S.effects.find((B) => B.type === "warp");
900
+ let i = d.width, c = d.height;
888
901
  n.ctx.save(), n.ctx.globalAlpha = S.opacity;
889
- const M = S.transform.x, N = S.transform.y;
890
- n.ctx.translate(M, N), n.ctx.rotate(S.transform.rotation * Math.PI / 180);
891
- const B = o * S.transform.scale, J = c * S.transform.scale;
902
+ const M = S.transform.x, I = S.transform.y;
903
+ n.ctx.translate(M, I), n.ctx.rotate(S.transform.rotation * Math.PI / 180);
904
+ const X = i * S.transform.scale, J = c * S.transform.scale;
892
905
  try {
893
- p && p.enabled && p.shape !== "none" ? Ut(n.ctx, u.image, 0, 0, B, J, p) : n.ctx.drawImage(u.image, -B / 2, -J / 2, B, J);
894
- } catch (Z) {
895
- console.warn("Failed to draw image to canvas (may be CORS issue):", S.src, Z);
906
+ m && m.enabled && m.shape !== "none" ? Ft(n.ctx, d.image, 0, 0, X, J, m) : n.ctx.drawImage(d.image, -X / 2, -J / 2, X, J);
907
+ } catch (B) {
908
+ console.warn("Failed to draw image to canvas (may be CORS issue):", S.src, B);
896
909
  }
897
910
  n.ctx.restore();
898
911
  }
899
- const C = performance.now() - b;
900
- s?.(C), n.renderStartTime !== null && (n.renderStartTime = null);
912
+ const P = performance.now() - _;
913
+ a?.(P), n.renderStartTime !== null && (n.renderStartTime = null);
901
914
  }
902
915
  w();
903
- function y(b, k) {
904
- l = b, k !== void 0 && (f = k), w();
916
+ function y(_, k) {
917
+ l = _, k !== void 0 && (f = k), w();
905
918
  }
906
919
  function x() {
907
920
  n.scheduler?.destroy();
908
- for (const b of n.imageBitmaps.values())
909
- b.close();
921
+ for (const _ of n.imageBitmaps.values())
922
+ _.close();
910
923
  }
911
- const I = x;
912
- return I.update = y, I;
924
+ const z = x;
925
+ return z.update = y, z;
913
926
  }
914
- var Jt = e.from_html('<div><canvas class="canvas svelte-1xdpk2w"></canvas></div>');
915
- function Ja(r, a) {
916
- e.push(a, !0);
917
- let t = e.prop(a, "imageOverrides", 19, () => ({})), s = e.prop(a, "objectFit", 3, "contain"), n = e.state(null);
927
+ var Qt = e.from_html('<div><canvas class="canvas svelte-1xdpk2w"></canvas></div>');
928
+ const en = {
929
+ hash: "svelte-1xdpk2w",
930
+ code: ".mockup-renderer.svelte-1xdpk2w {position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:100%;overflow:hidden;}.canvas.svelte-1xdpk2w {display:block;max-width:100%;max-height:100%;}.mockup-renderer.contain.svelte-1xdpk2w .canvas:where(.svelte-1xdpk2w) {width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain;}.mockup-renderer.cover.svelte-1xdpk2w .canvas:where(.svelte-1xdpk2w) {width:100%;height:100%;object-fit:cover;}"
931
+ };
932
+ function ma(o, r) {
933
+ e.push(r, !0), e.append_styles(o, en);
934
+ let t = e.prop(r, "imageOverrides", 19, () => ({})), a = e.prop(r, "objectFit", 3, "contain"), n = e.state(null);
918
935
  Te(() => {
919
936
  if (e.get(n))
920
- return qe(e.get(n), a.mockup.composition, t());
937
+ return Oe(e.get(n), r.mockup.composition, t());
921
938
  });
922
- var i = Jt();
939
+ var s = Qt();
923
940
  let l;
924
- var f = e.child(i);
925
- e.bind_this(f, (h) => e.set(n, h), () => e.get(n)), e.reset(i), e.template_effect(() => l = e.set_class(i, 1, "mockup-renderer svelte-1xdpk2w", null, l, {
926
- contain: s() === "contain",
927
- cover: s() === "cover"
928
- })), e.append(r, i), e.pop();
941
+ var f = e.child(s);
942
+ e.bind_this(f, (h) => e.set(n, h), () => e.get(n)), e.reset(s), e.template_effect(() => l = e.set_class(s, 1, "mockup-renderer svelte-1xdpk2w", null, l, {
943
+ contain: a() === "contain",
944
+ cover: a() === "cover"
945
+ })), e.append(o, s), e.pop();
929
946
  }
930
- const Gt = {
947
+ const tn = {
931
948
  x: 0,
932
949
  y: 0,
933
950
  scale: 1,
934
951
  rotation: 0
935
- }, Qt = {
936
- transform: { ...Gt },
952
+ }, nn = {
953
+ transform: { ...tn },
937
954
  opacity: 1,
938
955
  visible: !0,
939
956
  effects: []
940
- }, Ce = {
957
+ }, Pe = {
941
958
  zoom: 1,
942
959
  panX: 0,
943
960
  panY: 0
944
- }, st = {
961
+ }, ot = {
945
962
  width: 800,
946
963
  height: 600,
947
964
  layers: [],
948
965
  effects: []
949
966
  };
950
- var $t = e.from_html('<div class="zoomable-canvas svelte-zjsyu1" role="application" aria-label="Zoomable canvas - scroll to zoom, drag to pan"><div class="canvas-frame svelte-zjsyu1"><!></div> <div class="view-controls svelte-zjsyu1"><span class="zoom-indicator svelte-zjsyu1"> </span> <button class="reset-btn svelte-zjsyu1">Reset</button></div></div>');
951
- function en(r, a) {
952
- let t = e.state(e.proxy({ ...Ce })), s = e.state(!1), n = e.state(e.proxy({ x: 0, y: 0 }));
953
- function i(b) {
954
- b.preventDefault();
955
- const k = b.deltaY > 0 ? 0.9 : 1.1, C = Math.max(0.25, Math.min(4, e.get(t).zoom * k));
956
- e.set(t, { ...e.get(t), zoom: C }, !0);
957
- }
958
- function l(b) {
959
- b.button === 0 && (e.set(s, !0), e.set(
967
+ var rn = e.from_html('<div class="zoomable-canvas svelte-zjsyu1" role="application" aria-label="Zoomable canvas - scroll to zoom, drag to pan"><div class="canvas-frame svelte-zjsyu1"><!></div> <div class="view-controls svelte-zjsyu1"><span class="zoom-indicator svelte-zjsyu1"> </span> <button class="reset-btn svelte-zjsyu1">Reset</button></div></div>');
968
+ const an = {
969
+ hash: "svelte-zjsyu1",
970
+ code: ".zoomable-canvas.svelte-zjsyu1 {width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:var(--color-bg, #f5f5f5);overflow:hidden;cursor:grab;position:relative;}.zoomable-canvas.svelte-zjsyu1:active {cursor:grabbing;}.canvas-frame.svelte-zjsyu1 {transform-origin:center center;box-shadow:0 4px 16px rgba(0, 0, 0, 0.1);}.view-controls.svelte-zjsyu1 {position:absolute;bottom:1rem;right:1rem;display:flex;align-items:center;gap:0.5rem;background:rgba(0, 0, 0, 0.7);padding:0.3rem 0.5rem;border-radius:4px;}.zoom-indicator.svelte-zjsyu1 {color:#fff;font-size:0.75rem;font-family:monospace;min-width:2.5rem;text-align:center;}.reset-btn.svelte-zjsyu1 {background:transparent;border:1px solid rgba(255, 255, 255, 0.3);color:rgba(255, 255, 255, 0.8);padding:0.2rem 0.5rem;border-radius:3px;font-size:0.75rem;cursor:pointer;transition:all 200ms;}.reset-btn.svelte-zjsyu1:hover {border-color:rgba(255, 255, 255, 0.6);color:#fff;}"
971
+ };
972
+ function sn(o, r) {
973
+ e.append_styles(o, an);
974
+ let t = e.state(e.proxy({ ...Pe })), a = e.state(!1), n = e.state(e.proxy({ x: 0, y: 0 }));
975
+ function s(_) {
976
+ _.preventDefault();
977
+ const k = _.deltaY > 0 ? 0.9 : 1.1, P = Math.max(0.25, Math.min(4, e.get(t).zoom * k));
978
+ e.set(t, { ...e.get(t), zoom: P }, !0);
979
+ }
980
+ function l(_) {
981
+ _.button === 0 && (e.set(a, !0), e.set(
960
982
  n,
961
983
  {
962
- x: b.clientX - e.get(t).panX,
963
- y: b.clientY - e.get(t).panY
984
+ x: _.clientX - e.get(t).panX,
985
+ y: _.clientY - e.get(t).panY
964
986
  },
965
987
  !0
966
988
  ));
967
989
  }
968
- function f(b) {
969
- e.get(s) && e.set(
990
+ function f(_) {
991
+ e.get(a) && e.set(
970
992
  t,
971
993
  {
972
994
  ...e.get(t),
973
- panX: b.clientX - e.get(n).x,
974
- panY: b.clientY - e.get(n).y
995
+ panX: _.clientX - e.get(n).x,
996
+ panY: _.clientY - e.get(n).y
975
997
  },
976
998
  !0
977
999
  );
978
1000
  }
979
1001
  function h() {
980
- e.set(s, !1);
1002
+ e.set(a, !1);
981
1003
  }
982
1004
  function w() {
983
- e.set(t, { ...Ce }, !0);
984
- }
985
- const d = e.derived(() => `transform: scale(${e.get(t).zoom}) translate(${e.get(t).panX / e.get(t).zoom}px, ${e.get(t).panY / e.get(t).zoom}px);`);
986
- var _ = $t();
987
- _.__mousedown = l, _.__mousemove = f, _.__mouseup = h;
988
- var m = e.child(_), T = e.child(m);
989
- e.snippet(T, () => a.children), e.reset(m);
990
- var v = e.sibling(m, 2), y = e.child(v), x = e.child(y);
1005
+ e.set(t, { ...Pe }, !0);
1006
+ }
1007
+ const u = e.derived(() => `transform: scale(${e.get(t).zoom}) translate(${e.get(t).panX / e.get(t).zoom}px, ${e.get(t).panY / e.get(t).zoom}px);`);
1008
+ var g = rn();
1009
+ g.__mousedown = l, g.__mousemove = f, g.__mouseup = h;
1010
+ var p = e.child(g), T = e.child(p);
1011
+ e.snippet(T, () => r.children), e.reset(p);
1012
+ var v = e.sibling(p, 2), y = e.child(v), x = e.child(y);
991
1013
  e.reset(y);
992
- var I = e.sibling(y, 2);
993
- I.__click = w, e.reset(v), e.reset(_), e.template_effect(
994
- (b) => {
995
- e.set_style(m, e.get(d)), e.set_text(x, `${b ?? ""}%`);
1014
+ var z = e.sibling(y, 2);
1015
+ z.__click = w, e.reset(v), e.reset(g), e.template_effect(
1016
+ (_) => {
1017
+ e.set_style(p, e.get(u)), e.set_text(x, `${_ ?? ""}%`);
996
1018
  },
997
1019
  [() => Math.round(e.get(t).zoom * 100)]
998
- ), e.event("wheel", _, i), e.event("mouseleave", _, h), e.append(r, _);
1020
+ ), e.event("wheel", g, s), e.event("mouseleave", g, h), e.append(o, g);
999
1021
  }
1000
1022
  e.delegate(["mousedown", "mousemove", "mouseup", "click"]);
1001
- function tn(r, a, t = {}, s) {
1002
- let n = a, i = t, l = null;
1003
- const f = new at((d) => {
1004
- l?.update ? l.update(d.config, d.overrides) : (l?.(), l = qe(r, d.config, d.overrides, s));
1023
+ function on(o, r, t = {}, a) {
1024
+ let n = r, s = t, l = null;
1025
+ const f = new at((u) => {
1026
+ l?.update ? l.update(u.config, u.overrides) : (l?.(), l = Oe(o, u.config, u.overrides, a));
1005
1027
  });
1006
- l = qe(r, n, i, s);
1007
- function h(d, _) {
1008
- n = d, _ !== void 0 && (i = _), f.queue({ config: n, overrides: i });
1028
+ l = Oe(o, n, s, a);
1029
+ function h(u, g) {
1030
+ n = u, g !== void 0 && (s = g), f.queue({ config: n, overrides: s });
1009
1031
  }
1010
1032
  return {
1011
1033
  update: h,
@@ -1014,357 +1036,383 @@ function tn(r, a, t = {}, s) {
1014
1036
  }
1015
1037
  };
1016
1038
  }
1017
- var nn = e.from_html('<div class="render-time svelte-1p1rf8j"> </div>'), an = e.from_html('<div><canvas class="canvas svelte-1p1rf8j"></canvas> <!></div>');
1018
- function sn(r, a) {
1019
- e.push(a, !0);
1020
- let t = e.prop(a, "imageOverrides", 19, () => ({})), s = e.prop(a, "objectFit", 3, "contain"), n = e.prop(a, "debounceMs", 3, 100), i = e.state(null), l = e.state(null), f = e.state(0), h = e.state(null), w = null, d = e.state(""), _ = e.state(""), m = e.state(null);
1039
+ var ln = e.from_html('<div class="render-time svelte-1p1rf8j"> </div>'), cn = e.from_html('<div><canvas class="canvas svelte-1p1rf8j"></canvas> <!></div>');
1040
+ const dn = {
1041
+ hash: "svelte-1p1rf8j",
1042
+ code: ".mockup-renderer.svelte-1p1rf8j {position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:100%;overflow:hidden;}.canvas.svelte-1p1rf8j {display:block;max-width:100%;max-height:100%;}.mockup-renderer.contain.svelte-1p1rf8j .canvas:where(.svelte-1p1rf8j) {width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain;}.mockup-renderer.cover.svelte-1p1rf8j .canvas:where(.svelte-1p1rf8j) {width:100%;height:100%;object-fit:cover;}.render-time.svelte-1p1rf8j {position:absolute;top:8px;right:8px;background:rgba(0, 0, 0, 0.7);color:white;padding:4px 8px;border-radius:4px;font-size:12px;font-family:monospace;pointer-events:none;z-index:10;}"
1043
+ };
1044
+ function un(o, r) {
1045
+ e.push(r, !0), e.append_styles(o, dn);
1046
+ let t = e.prop(r, "imageOverrides", 19, () => ({})), a = e.prop(r, "objectFit", 3, "contain"), n = e.prop(r, "debounceMs", 3, 100), s = e.state(null), l = e.state(null), f = e.state(0), h = e.state(null), w = null, u = e.state(""), g = e.state(""), p = e.state(null);
1021
1047
  const T = 3;
1022
1048
  function v() {
1023
1049
  if (!e.get(l)) return;
1024
- const g = JSON.stringify(a.mockup.composition), u = JSON.stringify(t());
1025
- g === e.get(d) && u === e.get(_) || (e.update(f), e.set(
1050
+ const b = JSON.stringify(r.mockup.composition), d = JSON.stringify(t());
1051
+ b === e.get(u) && d === e.get(g) || (e.update(f), e.set(
1026
1052
  h,
1027
1053
  {
1028
- composition: a.mockup.composition,
1054
+ composition: r.mockup.composition,
1029
1055
  overrides: t()
1030
1056
  },
1031
1057
  !0
1032
1058
  ), e.get(f) >= T ? (e.set(f, 0), w && (clearTimeout(w), w = null), e.get(h) && (Ge(() => {
1033
- e.get(l).update(e.get(h).composition, e.get(h).overrides), e.set(d, g, !0), e.set(_, u, !0);
1059
+ e.get(l).update(e.get(h).composition, e.get(h).overrides), e.set(u, b, !0), e.set(g, d, !0);
1034
1060
  }), e.set(h, null))) : (w && clearTimeout(w), w = setTimeout(
1035
1061
  () => {
1036
1062
  e.get(l) && e.get(h) && (Ge(() => {
1037
- e.get(l).update(e.get(h).composition, e.get(h).overrides), e.set(d, JSON.stringify(e.get(h).composition), !0), e.set(_, JSON.stringify(e.get(h).overrides), !0);
1063
+ e.get(l).update(e.get(h).composition, e.get(h).overrides), e.set(u, JSON.stringify(e.get(h).composition), !0), e.set(g, JSON.stringify(e.get(h).overrides), !0);
1038
1064
  }), e.set(h, null), e.set(f, 0)), w = null;
1039
1065
  },
1040
1066
  n()
1041
1067
  )));
1042
1068
  }
1043
- Te(() => (xt().then(() => {
1044
- e.get(i) && (e.set(
1069
+ Te(() => (Mt().then(() => {
1070
+ e.get(s) && (e.set(
1045
1071
  l,
1046
- tn(e.get(i), a.mockup.composition, t(), (g) => {
1047
- e.set(m, g, !0);
1072
+ on(e.get(s), r.mockup.composition, t(), (b) => {
1073
+ e.set(p, b, !0);
1048
1074
  }),
1049
1075
  !0
1050
- ), e.set(d, JSON.stringify(a.mockup.composition), !0), e.set(_, JSON.stringify(t()), !0));
1076
+ ), e.set(u, JSON.stringify(r.mockup.composition), !0), e.set(g, JSON.stringify(t()), !0));
1051
1077
  }), () => {
1052
1078
  w && clearTimeout(w), e.get(l)?.cleanup();
1053
1079
  }));
1054
- const y = e.derived(() => JSON.stringify(a.mockup.composition)), x = e.derived(() => JSON.stringify(t()));
1080
+ const y = e.derived(() => JSON.stringify(r.mockup.composition)), x = e.derived(() => JSON.stringify(t()));
1055
1081
  e.user_effect(() => {
1056
1082
  e.get(y), e.get(x), e.get(l) && v();
1057
- }), kt(() => {
1083
+ }), Tt(() => {
1058
1084
  w && clearTimeout(w), e.get(l)?.cleanup();
1059
1085
  });
1060
- var I = an();
1061
- let b;
1062
- var k = e.child(I);
1063
- e.bind_this(k, (g) => e.set(i, g), () => e.get(i));
1064
- var C = e.sibling(k, 2);
1086
+ var z = cn();
1087
+ let _;
1088
+ var k = e.child(z);
1089
+ e.bind_this(k, (b) => e.set(s, b), () => e.get(s));
1090
+ var P = e.sibling(k, 2);
1065
1091
  {
1066
- var S = (g) => {
1067
- var u = nn(), p = e.child(u);
1068
- e.reset(u), e.template_effect((o) => e.set_text(p, `${o ?? ""}ms`), [() => e.get(m).toFixed(1)]), e.append(g, u);
1092
+ var S = (b) => {
1093
+ var d = ln(), m = e.child(d);
1094
+ e.reset(d), e.template_effect((i) => e.set_text(m, `${i ?? ""}ms`), [() => e.get(p).toFixed(1)]), e.append(b, d);
1069
1095
  };
1070
- e.if(C, (g) => {
1071
- e.get(m) !== null && g(S);
1096
+ e.if(P, (b) => {
1097
+ e.get(p) !== null && b(S);
1072
1098
  });
1073
1099
  }
1074
- e.reset(I), e.template_effect(() => b = e.set_class(I, 1, "mockup-renderer svelte-1p1rf8j", null, b, {
1075
- contain: s() === "contain",
1076
- cover: s() === "cover"
1077
- })), e.append(r, I), e.pop();
1100
+ e.reset(z), e.template_effect(() => _ = e.set_class(z, 1, "mockup-renderer svelte-1p1rf8j", null, _, {
1101
+ contain: a() === "contain",
1102
+ cover: a() === "cover"
1103
+ })), e.append(o, z), e.pop();
1078
1104
  }
1079
- var rn = e.from_svg('<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>');
1080
- function on(r, a) {
1081
- let t = e.prop(a, "fontSize", 3, "1em"), s = e.prop(a, "color", 3, "currentColor");
1082
- var n = rn();
1105
+ var mn = e.from_svg('<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>');
1106
+ function pn(o, r) {
1107
+ let t = e.prop(r, "fontSize", 3, "1em"), a = e.prop(r, "color", 3, "currentColor");
1108
+ var n = mn();
1083
1109
  e.template_effect(() => {
1084
- e.set_style(n, `font-size: ${t() ?? ""};`), e.set_attribute(n, "stroke", s());
1085
- }), e.append(r, n);
1110
+ e.set_style(n, `font-size: ${t() ?? ""};`), e.set_attribute(n, "stroke", a());
1111
+ }), e.append(o, n);
1086
1112
  }
1087
- var ln = e.from_svg('<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>');
1088
- function cn(r, a) {
1089
- let t = e.prop(a, "fontSize", 3, "1em"), s = e.prop(a, "color", 3, "currentColor");
1090
- var n = ln();
1113
+ var vn = e.from_svg('<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>');
1114
+ function fn(o, r) {
1115
+ let t = e.prop(r, "fontSize", 3, "1em"), a = e.prop(r, "color", 3, "currentColor");
1116
+ var n = vn();
1091
1117
  e.template_effect(() => {
1092
- e.set_style(n, `font-size: ${t() ?? ""};`), e.set_attribute(n, "stroke", s());
1093
- }), e.append(r, n);
1118
+ e.set_style(n, `font-size: ${t() ?? ""};`), e.set_attribute(n, "stroke", a());
1119
+ }), e.append(o, n);
1094
1120
  }
1095
- var un = e.from_svg('<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke-width="2"><path d="M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"></path></svg>');
1096
- function Ue(r, a) {
1097
- let t = e.prop(a, "fontSize", 3, "1em"), s = e.prop(a, "color", 3, "currentColor");
1098
- var n = un();
1121
+ var hn = e.from_svg('<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke-width="2"><path d="M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"></path></svg>');
1122
+ function Ae(o, r) {
1123
+ let t = e.prop(r, "fontSize", 3, "1em"), a = e.prop(r, "color", 3, "currentColor");
1124
+ var n = hn();
1099
1125
  e.template_effect(() => {
1100
- e.set_style(n, `font-size: ${t() ?? ""};`), e.set_attribute(n, "stroke", s());
1101
- }), e.append(r, n);
1126
+ e.set_style(n, `font-size: ${t() ?? ""};`), e.set_attribute(n, "stroke", a());
1127
+ }), e.append(o, n);
1102
1128
  }
1103
- var dn = e.from_svg('<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"></path><path d="M3 3v5h5"></path></svg>');
1104
- function pn(r, a) {
1105
- let t = e.prop(a, "fontSize", 3, "1em"), s = e.prop(a, "color", 3, "currentColor");
1106
- var n = dn();
1129
+ var gn = e.from_svg('<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"></path><path d="M3 3v5h5"></path></svg>');
1130
+ function bn(o, r) {
1131
+ let t = e.prop(r, "fontSize", 3, "1em"), a = e.prop(r, "color", 3, "currentColor");
1132
+ var n = gn();
1107
1133
  e.template_effect(() => {
1108
- e.set_style(n, `font-size: ${t() ?? ""};`), e.set_attribute(n, "stroke", s());
1109
- }), e.append(r, n);
1134
+ e.set_style(n, `font-size: ${t() ?? ""};`), e.set_attribute(n, "stroke", a());
1135
+ }), e.append(o, n);
1110
1136
  }
1111
- var mn = e.from_html('<button type="button" class="reset-btn svelte-18gpljp" title="Reset to default"><!></button>'), vn = e.from_html('<div class="control-group"><div class="control-row svelte-18gpljp"><!> <label class="control-label svelte-18gpljp"><span class="label-text svelte-18gpljp"> </span> <div class="control-content svelte-18gpljp"><!></div></label></div></div>');
1112
- function F(r, a) {
1113
- var t = vn(), s = e.child(t), n = e.child(s);
1137
+ var _n = e.from_html('<button type="button" class="reset-btn svelte-18gpljp" title="Reset to default"><!></button>'), yn = e.from_html('<div class="control-group"><div class="control-row svelte-18gpljp"><!> <label class="control-label svelte-18gpljp"><span class="label-text svelte-18gpljp"> </span> <div class="control-content svelte-18gpljp"><!></div></label></div></div>');
1138
+ const wn = {
1139
+ hash: "svelte-18gpljp",
1140
+ code: ".control-row.svelte-18gpljp {display:flex;align-items:center;gap:0.25rem;min-width:0;max-width:100%;}.reset-btn.svelte-18gpljp {display:flex;align-items:center;justify-content:center;padding:0.25rem;background:transparent;border:none;border-radius:4px;color:var(--color-text-muted, #666);cursor:pointer;opacity:0.5;transition:opacity 0.15s, color 0.15s;}.reset-btn.svelte-18gpljp:hover {opacity:1;color:var(--color-primary, #007bff);}.control-label.svelte-18gpljp {display:flex;align-items:center;gap:0.5rem;flex:1;min-width:0;}.label-text.svelte-18gpljp {width:80px;flex-shrink:0;font-size:0.875rem;color:var(--color-text-muted, #666);}.control-content.svelte-18gpljp {flex:1;display:flex;align-items:center;gap:0.5rem;min-width:0;max-width:100%;overflow:hidden;}"
1141
+ };
1142
+ function F(o, r) {
1143
+ e.append_styles(o, wn);
1144
+ var t = yn(), a = e.child(t), n = e.child(a);
1114
1145
  {
1115
- var i = (_) => {
1116
- var m = mn();
1117
- m.__click = function(...v) {
1118
- a.onReset?.apply(this, v);
1146
+ var s = (g) => {
1147
+ var p = _n();
1148
+ p.__click = function(...v) {
1149
+ r.onReset?.apply(this, v);
1119
1150
  };
1120
- var T = e.child(m);
1121
- pn(T, { fontSize: "0.875rem" }), e.reset(m), e.append(_, m);
1151
+ var T = e.child(p);
1152
+ bn(T, { fontSize: "0.875rem" }), e.reset(p), e.append(g, p);
1122
1153
  };
1123
- e.if(n, (_) => {
1124
- a.onReset && _(i);
1154
+ e.if(n, (g) => {
1155
+ r.onReset && g(s);
1125
1156
  });
1126
1157
  }
1127
1158
  var l = e.sibling(n, 2), f = e.child(l), h = e.child(f, !0);
1128
1159
  e.reset(f);
1129
- var w = e.sibling(f, 2), d = e.child(w);
1130
- e.snippet(d, () => a.children), e.reset(w), e.reset(l), e.reset(s), e.reset(t), e.template_effect(() => e.set_text(h, a.label)), e.append(r, t);
1160
+ var w = e.sibling(f, 2), u = e.child(w);
1161
+ e.snippet(u, () => r.children), e.reset(w), e.reset(l), e.reset(a), e.reset(t), e.template_effect(() => e.set_text(h, r.label)), e.append(o, t);
1131
1162
  }
1132
1163
  e.delegate(["click"]);
1133
- var fn = e.from_html('<input type="range" step="1" class="svelte-efcks6"/> <input type="number" class="manual-input svelte-efcks6" step="1"/>', 1), hn = e.from_html('<input type="range" step="1" class="svelte-efcks6"/> <input type="number" class="manual-input svelte-efcks6" step="1"/>', 1), _n = e.from_html('<input type="range" step="1" min="-360" max="360" class="svelte-efcks6"/> <input type="number" class="manual-input svelte-efcks6" step="1"/>', 1), gn = e.from_html('<input type="range" min="0" max="1" step="0.01" class="svelte-efcks6"/> <input type="number" class="manual-input svelte-efcks6" step="0.01" min="0" max="1"/>', 1), bn = e.from_html('<details class="section svelte-efcks6" open=""><summary class="section-title svelte-efcks6">Position & Transform</summary> <div class="section-content svelte-efcks6"><details class="subsection svelte-efcks6" open=""><summary class="subsection-title svelte-efcks6">Position</summary> <div class="subsection-content svelte-efcks6"><!> <!></div></details> <details class="subsection svelte-efcks6" open=""><summary class="subsection-title svelte-efcks6">Transform</summary> <div class="subsection-content svelte-efcks6"><!> <!></div></details></div></details>');
1134
- function yn(r, a) {
1135
- e.push(a, !0);
1136
- let t = e.prop(a, "transform", 7), s = e.prop(a, "opacity", 7);
1164
+ var xn = e.from_html('<input type="range" step="1" class="svelte-efcks6"/> <input type="number" class="manual-input svelte-efcks6" step="1"/>', 1), kn = e.from_html('<input type="range" step="1" class="svelte-efcks6"/> <input type="number" class="manual-input svelte-efcks6" step="1"/>', 1), Mn = e.from_html('<input type="range" step="1" min="-360" max="360" class="svelte-efcks6"/> <input type="number" class="manual-input svelte-efcks6" step="1"/>', 1), Tn = e.from_html('<input type="range" min="0" max="1" step="0.01" class="svelte-efcks6"/> <input type="number" class="manual-input svelte-efcks6" step="0.01" min="0" max="1"/>', 1), Sn = e.from_html('<details class="section svelte-efcks6" open=""><summary class="section-title svelte-efcks6">Position & Transform</summary> <div class="section-content svelte-efcks6"><details class="subsection svelte-efcks6" open=""><summary class="subsection-title svelte-efcks6">Position</summary> <div class="subsection-content svelte-efcks6"><!> <!></div></details> <details class="subsection svelte-efcks6" open=""><summary class="subsection-title svelte-efcks6">Transform</summary> <div class="subsection-content svelte-efcks6"><!> <!></div></details></div></details>');
1165
+ const In = {
1166
+ hash: "svelte-efcks6",
1167
+ code: `.section.svelte-efcks6 {border-top:1px solid var(--color-border, #ccc);border-bottom:1px solid var(--color-border, #ccc);background:var(--color-surface, #fff);min-width:0;}.section-title.svelte-efcks6 {padding:0.75rem 0;font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);cursor:pointer;list-style:none;display:flex;align-items:center;gap:0.5rem;border-bottom:1px solid var(--color-border, #eee);}.section-title.svelte-efcks6::-webkit-details-marker {display:none;}.section-title.svelte-efcks6::before {content:'▶';font-size:0.625rem;transition:transform 0.15s ease;}.section[open].svelte-efcks6 > .section-title:where(.svelte-efcks6)::before {transform:rotate(90deg);}.section-content.svelte-efcks6 {padding:0.75rem 0;display:flex;flex-direction:column;gap:0.75rem;}.manual-input.svelte-efcks6 {width:60px;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;}input[type="range"].svelte-efcks6 {flex:1;min-width:0;max-width:100%;}.subsection.svelte-efcks6 {margin-top:0.75rem;border-top:1px solid var(--color-border, #e0e0e0);}.subsection.svelte-efcks6:first-child {margin-top:0;border-top:none;}.subsection-title.svelte-efcks6 {padding:0.5rem 0;font-size:0.75rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:var(--color-text-muted, #666);cursor:pointer;list-style:none;display:flex;align-items:center;gap:0.5rem;}.subsection-title.svelte-efcks6::-webkit-details-marker {display:none;}.subsection-title.svelte-efcks6::before {content:'▶';font-size:0.625rem;transition:transform 0.15s ease;}.subsection[open].svelte-efcks6 > .subsection-title:where(.svelte-efcks6)::before {transform:rotate(90deg);}.subsection-content.svelte-efcks6 {padding-bottom:0.25rem;}`
1168
+ };
1169
+ function zn(o, r) {
1170
+ e.push(r, !0), e.append_styles(o, In);
1171
+ let t = e.prop(r, "transform", 7), a = e.prop(r, "opacity", 7);
1137
1172
  const n = {
1138
- x: Math.round(a.canvasWidth / 2),
1139
- y: Math.round(a.canvasHeight / 2),
1173
+ x: Math.round(r.canvasWidth / 2),
1174
+ y: Math.round(r.canvasHeight / 2),
1140
1175
  rotation: 0,
1141
1176
  opacity: 1
1142
1177
  };
1143
- function i(C) {
1144
- a.onTransformChange({ ...t(), ...C });
1178
+ function s(P) {
1179
+ r.onTransformChange({ ...t(), ...P });
1145
1180
  }
1146
- const l = -a.canvasWidth / 2, f = a.canvasWidth * 1.5, h = -a.canvasHeight / 2, w = a.canvasHeight * 1.5;
1147
- var d = bn(), _ = e.sibling(e.child(d), 2), m = e.child(_), T = e.sibling(e.child(m), 2), v = e.child(T);
1181
+ const l = -r.canvasWidth / 2, f = r.canvasWidth * 1.5, h = -r.canvasHeight / 2, w = r.canvasHeight * 1.5;
1182
+ var u = Sn(), g = e.sibling(e.child(u), 2), p = e.child(g), T = e.sibling(e.child(p), 2), v = e.child(T);
1148
1183
  F(v, {
1149
1184
  label: "Position X",
1150
- onReset: () => i({ x: n.x }),
1151
- children: (C, S) => {
1152
- var g = fn(), u = e.first_child(g);
1153
- e.remove_input_defaults(u), u.__input = (o) => i({ x: Number(o.currentTarget.value) });
1154
- var p = e.sibling(u, 2);
1155
- e.remove_input_defaults(p), p.__input = (o) => i({ x: Number(o.currentTarget.value) }), e.template_effect(() => {
1156
- e.set_attribute(u, "min", l), e.set_attribute(u, "max", f);
1157
- }), e.bind_value(u, () => t().x, (o) => t().x = o), e.bind_value(p, () => t().x, (o) => t().x = o), e.append(C, g);
1185
+ onReset: () => s({ x: n.x }),
1186
+ children: (P, S) => {
1187
+ var b = xn(), d = e.first_child(b);
1188
+ e.remove_input_defaults(d), d.__input = (i) => s({ x: Number(i.currentTarget.value) });
1189
+ var m = e.sibling(d, 2);
1190
+ e.remove_input_defaults(m), m.__input = (i) => s({ x: Number(i.currentTarget.value) }), e.template_effect(() => {
1191
+ e.set_attribute(d, "min", l), e.set_attribute(d, "max", f);
1192
+ }), e.bind_value(d, () => t().x, (i) => t().x = i), e.bind_value(m, () => t().x, (i) => t().x = i), e.append(P, b);
1158
1193
  }
1159
1194
  });
1160
1195
  var y = e.sibling(v, 2);
1161
1196
  F(y, {
1162
1197
  label: "Position Y",
1163
- onReset: () => i({ y: n.y }),
1164
- children: (C, S) => {
1165
- var g = hn(), u = e.first_child(g);
1166
- e.remove_input_defaults(u), u.__input = (o) => i({ y: Number(o.currentTarget.value) });
1167
- var p = e.sibling(u, 2);
1168
- e.remove_input_defaults(p), p.__input = (o) => i({ y: Number(o.currentTarget.value) }), e.template_effect(() => {
1169
- e.set_attribute(u, "min", h), e.set_attribute(u, "max", w);
1170
- }), e.bind_value(u, () => t().y, (o) => t().y = o), e.bind_value(p, () => t().y, (o) => t().y = o), e.append(C, g);
1198
+ onReset: () => s({ y: n.y }),
1199
+ children: (P, S) => {
1200
+ var b = kn(), d = e.first_child(b);
1201
+ e.remove_input_defaults(d), d.__input = (i) => s({ y: Number(i.currentTarget.value) });
1202
+ var m = e.sibling(d, 2);
1203
+ e.remove_input_defaults(m), m.__input = (i) => s({ y: Number(i.currentTarget.value) }), e.template_effect(() => {
1204
+ e.set_attribute(d, "min", h), e.set_attribute(d, "max", w);
1205
+ }), e.bind_value(d, () => t().y, (i) => t().y = i), e.bind_value(m, () => t().y, (i) => t().y = i), e.append(P, b);
1171
1206
  }
1172
- }), e.reset(T), e.reset(m);
1173
- var x = e.sibling(m, 2), I = e.sibling(e.child(x), 2), b = e.child(I);
1174
- F(b, {
1207
+ }), e.reset(T), e.reset(p);
1208
+ var x = e.sibling(p, 2), z = e.sibling(e.child(x), 2), _ = e.child(z);
1209
+ F(_, {
1175
1210
  label: "Rotation (°)",
1176
- onReset: () => i({ rotation: n.rotation }),
1177
- children: (C, S) => {
1178
- var g = _n(), u = e.first_child(g);
1179
- e.remove_input_defaults(u), u.__input = (o) => i({ rotation: Number(o.currentTarget.value) });
1180
- var p = e.sibling(u, 2);
1181
- e.remove_input_defaults(p), p.__input = (o) => i({ rotation: Number(o.currentTarget.value) }), e.bind_value(u, () => t().rotation, (o) => t().rotation = o), e.bind_value(p, () => t().rotation, (o) => t().rotation = o), e.append(C, g);
1211
+ onReset: () => s({ rotation: n.rotation }),
1212
+ children: (P, S) => {
1213
+ var b = Mn(), d = e.first_child(b);
1214
+ e.remove_input_defaults(d), d.__input = (i) => s({ rotation: Number(i.currentTarget.value) });
1215
+ var m = e.sibling(d, 2);
1216
+ e.remove_input_defaults(m), m.__input = (i) => s({ rotation: Number(i.currentTarget.value) }), e.bind_value(d, () => t().rotation, (i) => t().rotation = i), e.bind_value(m, () => t().rotation, (i) => t().rotation = i), e.append(P, b);
1182
1217
  }
1183
1218
  });
1184
- var k = e.sibling(b, 2);
1219
+ var k = e.sibling(_, 2);
1185
1220
  F(k, {
1186
1221
  label: "Opacity",
1187
- onReset: () => a.onOpacityChange(n.opacity),
1188
- children: (C, S) => {
1189
- var g = gn(), u = e.first_child(g);
1190
- e.remove_input_defaults(u), u.__input = (o) => a.onOpacityChange(Number(o.currentTarget.value));
1191
- var p = e.sibling(u, 2);
1192
- e.remove_input_defaults(p), p.__input = (o) => a.onOpacityChange(Number(o.currentTarget.value)), e.bind_value(u, s), e.bind_value(p, s), e.append(C, g);
1222
+ onReset: () => r.onOpacityChange(n.opacity),
1223
+ children: (P, S) => {
1224
+ var b = Tn(), d = e.first_child(b);
1225
+ e.remove_input_defaults(d), d.__input = (i) => r.onOpacityChange(Number(i.currentTarget.value));
1226
+ var m = e.sibling(d, 2);
1227
+ e.remove_input_defaults(m), m.__input = (i) => r.onOpacityChange(Number(i.currentTarget.value)), e.bind_value(d, a), e.bind_value(m, a), e.append(P, b);
1193
1228
  }
1194
- }), e.reset(I), e.reset(x), e.reset(_), e.reset(d), e.append(r, d), e.pop();
1229
+ }), e.reset(z), e.reset(x), e.reset(g), e.reset(u), e.append(o, u), e.pop();
1195
1230
  }
1196
1231
  e.delegate(["input"]);
1197
- var wn = e.from_html('<select class="mode-select svelte-1qmrgom"><option>Scale</option><option>Px</option></select>'), xn = e.from_html('<input type="range" step="0.1" min="0.1" max="10" class="svelte-1qmrgom"/> <input type="number" class="manual-input svelte-1qmrgom" step="0.1" min="0.1" max="10"/>', 1), kn = e.from_html('<input type="number" class="px-input svelte-1qmrgom" step="1" min="1" placeholder="Auto"/> <select class="constraint-select svelte-1qmrgom"><option>None</option><option>Min</option><option>Max</option></select>', 1), Mn = e.from_html('<input type="number" class="px-input svelte-1qmrgom" step="1" min="1" placeholder="Auto"/> <select class="constraint-select svelte-1qmrgom"><option>None</option><option>Min</option><option>Max</option></select>', 1), Tn = e.from_html('<input type="checkbox"/>'), Sn = e.from_html("<!> <!> <!>", 1), Nn = e.from_html('<details class="section svelte-1qmrgom" open=""><summary class="section-title svelte-1qmrgom">Sizing</summary> <div class="section-content svelte-1qmrgom"><!> <!></div></details>');
1198
- function In(r, a) {
1199
- e.push(a, !0);
1200
- let t = e.prop(a, "effect", 3, fe);
1201
- function s(d) {
1202
- a.onChange({ ...t(), ...d });
1203
- }
1204
- var n = Nn(), i = e.sibling(e.child(n), 2), l = e.child(i);
1232
+ var Pn = e.from_html('<select class="mode-select svelte-1qmrgom"><option>Scale</option><option>Px</option></select>'), Cn = e.from_html('<input type="range" step="0.1" min="0.1" max="10" class="svelte-1qmrgom"/> <input type="number" class="manual-input svelte-1qmrgom" step="0.1" min="0.1" max="10"/>', 1), Nn = e.from_html('<input type="number" class="px-input svelte-1qmrgom" step="1" min="1" placeholder="Auto"/> <select class="constraint-select svelte-1qmrgom"><option>None</option><option>Min</option><option>Max</option></select>', 1), Rn = e.from_html('<input type="number" class="px-input svelte-1qmrgom" step="1" min="1" placeholder="Auto"/> <select class="constraint-select svelte-1qmrgom"><option>None</option><option>Min</option><option>Max</option></select>', 1), jn = e.from_html('<input type="checkbox"/>'), Wn = e.from_html("<!> <!> <!>", 1), Yn = e.from_html('<details class="section svelte-1qmrgom" open=""><summary class="section-title svelte-1qmrgom">Sizing</summary> <div class="section-content svelte-1qmrgom"><!> <!></div></details>');
1233
+ const Dn = {
1234
+ hash: "svelte-1qmrgom",
1235
+ code: `.section.svelte-1qmrgom {border-top:1px solid var(--color-border, #ccc);border-bottom:1px solid var(--color-border, #ccc);background:var(--color-surface, #fff);min-width:0;}.section-title.svelte-1qmrgom {padding:0.75rem 0;font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);cursor:pointer;list-style:none;display:flex;align-items:center;gap:0.5rem;border-bottom:1px solid var(--color-border, #eee);}.section-title.svelte-1qmrgom::-webkit-details-marker {display:none;}.section-title.svelte-1qmrgom::before {content:'▶';font-size:0.625rem;transition:transform 0.15s ease;}.section[open].svelte-1qmrgom > .section-title:where(.svelte-1qmrgom)::before {transform:rotate(90deg);}.section-content.svelte-1qmrgom {padding:0.75rem 0;display:flex;flex-direction:column;gap:0.75rem;}.mode-select.svelte-1qmrgom {padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;background:var(--color-surface, #fff);}.px-input.svelte-1qmrgom {width:50px;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;appearance:textfield;-moz-appearance:textfield;}.px-input.svelte-1qmrgom::-webkit-outer-spin-button,
1236
+ .px-input.svelte-1qmrgom::-webkit-inner-spin-button {-webkit-appearance:none;margin:0;}.constraint-select.svelte-1qmrgom {width:70px;flex-shrink:0;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;}.manual-input.svelte-1qmrgom {width:60px;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;}input[type="range"].svelte-1qmrgom {flex:1;min-width:0;max-width:100%;}`
1237
+ };
1238
+ function Xn(o, r) {
1239
+ e.push(r, !0), e.append_styles(o, Dn);
1240
+ let t = e.prop(r, "effect", 3, fe);
1241
+ function a(u) {
1242
+ r.onChange({ ...t(), ...u });
1243
+ }
1244
+ var n = Yn(), s = e.sibling(e.child(n), 2), l = e.child(s);
1205
1245
  F(l, {
1206
1246
  label: "Mode",
1207
- onReset: () => s({ mode: fe.mode }),
1208
- children: (d, _) => {
1209
- var m = wn();
1210
- m.__change = (x) => s({ mode: x.currentTarget.value });
1211
- var T = e.child(m);
1247
+ onReset: () => a({ mode: fe.mode }),
1248
+ children: (u, g) => {
1249
+ var p = Pn();
1250
+ p.__change = (x) => a({ mode: x.currentTarget.value });
1251
+ var T = e.child(p);
1212
1252
  T.value = T.__value = "scale";
1213
1253
  var v = e.sibling(T);
1214
- v.value = v.__value = "px", e.reset(m);
1254
+ v.value = v.__value = "px", e.reset(p);
1215
1255
  var y;
1216
- e.init_select(m), e.template_effect(() => {
1217
- y !== (y = t().mode) && (m.value = (m.__value = t().mode) ?? "", e.select_option(m, t().mode));
1218
- }), e.append(d, m);
1256
+ e.init_select(p), e.template_effect(() => {
1257
+ y !== (y = t().mode) && (p.value = (p.__value = t().mode) ?? "", e.select_option(p, t().mode));
1258
+ }), e.append(u, p);
1219
1259
  }
1220
1260
  });
1221
1261
  var f = e.sibling(l, 2);
1222
1262
  {
1223
- var h = (d) => {
1224
- F(d, {
1263
+ var h = (u) => {
1264
+ F(u, {
1225
1265
  label: "Scale",
1226
- onReset: () => s({ scale: fe.scale }),
1227
- children: (_, m) => {
1228
- var T = xn(), v = e.first_child(T);
1229
- e.remove_input_defaults(v), v.__input = (x) => s({ scale: Number(x.currentTarget.value) });
1266
+ onReset: () => a({ scale: fe.scale }),
1267
+ children: (g, p) => {
1268
+ var T = Cn(), v = e.first_child(T);
1269
+ e.remove_input_defaults(v), v.__input = (x) => a({ scale: Number(x.currentTarget.value) });
1230
1270
  var y = e.sibling(v, 2);
1231
- e.remove_input_defaults(y), y.__input = (x) => s({ scale: Number(x.currentTarget.value) }), e.template_effect(() => {
1271
+ e.remove_input_defaults(y), y.__input = (x) => a({ scale: Number(x.currentTarget.value) }), e.template_effect(() => {
1232
1272
  e.set_value(v, t().scale ?? 1), e.set_value(y, t().scale ?? 1);
1233
- }), e.append(_, T);
1273
+ }), e.append(g, T);
1234
1274
  }
1235
1275
  });
1236
- }, w = (d) => {
1237
- var _ = Sn(), m = e.first_child(_);
1238
- F(m, {
1276
+ }, w = (u) => {
1277
+ var g = Wn(), p = e.first_child(g);
1278
+ F(p, {
1239
1279
  label: "Width",
1240
- onReset: () => s({ width: void 0, minWidth: void 0, maxWidth: void 0 }),
1280
+ onReset: () => a({ width: void 0, minWidth: void 0, maxWidth: void 0 }),
1241
1281
  children: (y, x) => {
1242
- var I = kn(), b = e.first_child(I);
1243
- e.remove_input_defaults(b), b.__input = (p) => {
1244
- const o = p.currentTarget.value ? Number(p.currentTarget.value) : void 0, c = t().minWidth !== void 0 ? "min" : t().maxWidth !== void 0 ? "max" : "";
1245
- s(c === "min" ? { width: o, minWidth: o, maxWidth: void 0 } : c === "max" ? { width: o, maxWidth: o, minWidth: void 0 } : { width: o });
1282
+ var z = Nn(), _ = e.first_child(z);
1283
+ e.remove_input_defaults(_), _.__input = (m) => {
1284
+ const i = m.currentTarget.value ? Number(m.currentTarget.value) : void 0, c = t().minWidth !== void 0 ? "min" : t().maxWidth !== void 0 ? "max" : "";
1285
+ a(c === "min" ? { width: i, minWidth: i, maxWidth: void 0 } : c === "max" ? { width: i, maxWidth: i, minWidth: void 0 } : { width: i });
1246
1286
  };
1247
- var k = e.sibling(b, 2);
1248
- k.__change = (p) => {
1249
- const o = t().width ?? t().minWidth ?? t().maxWidth;
1250
- p.currentTarget.value === "min" && o !== void 0 ? s({ minWidth: o, maxWidth: void 0 }) : p.currentTarget.value === "max" && o !== void 0 ? s({ maxWidth: o, minWidth: void 0 }) : s({ minWidth: void 0, maxWidth: void 0 });
1287
+ var k = e.sibling(_, 2);
1288
+ k.__change = (m) => {
1289
+ const i = t().width ?? t().minWidth ?? t().maxWidth;
1290
+ m.currentTarget.value === "min" && i !== void 0 ? a({ minWidth: i, maxWidth: void 0 }) : m.currentTarget.value === "max" && i !== void 0 ? a({ maxWidth: i, minWidth: void 0 }) : a({ minWidth: void 0, maxWidth: void 0 });
1251
1291
  };
1252
- var C = e.child(k);
1253
- C.value = C.__value = "";
1254
- var S = e.sibling(C);
1292
+ var P = e.child(k);
1293
+ P.value = P.__value = "";
1294
+ var S = e.sibling(P);
1255
1295
  S.value = S.__value = "min";
1256
- var g = e.sibling(S);
1257
- g.value = g.__value = "max", e.reset(k);
1258
- var u;
1296
+ var b = e.sibling(S);
1297
+ b.value = b.__value = "max", e.reset(k);
1298
+ var d;
1259
1299
  e.init_select(k), e.template_effect(() => {
1260
- e.set_value(b, t().width ?? t().minWidth ?? t().maxWidth ?? ""), u !== (u = t().minWidth !== void 0 ? "min" : t().maxWidth !== void 0 ? "max" : "") && (k.value = k.__value = t().minWidth !== void 0 ? "min" : t().maxWidth !== void 0 ? "max" : "", e.select_option(k, t().minWidth !== void 0 ? "min" : t().maxWidth !== void 0 ? "max" : ""));
1261
- }), e.append(y, I);
1300
+ e.set_value(_, t().width ?? t().minWidth ?? t().maxWidth ?? ""), d !== (d = t().minWidth !== void 0 ? "min" : t().maxWidth !== void 0 ? "max" : "") && (k.value = k.__value = t().minWidth !== void 0 ? "min" : t().maxWidth !== void 0 ? "max" : "", e.select_option(k, t().minWidth !== void 0 ? "min" : t().maxWidth !== void 0 ? "max" : ""));
1301
+ }), e.append(y, z);
1262
1302
  }
1263
1303
  });
1264
- var T = e.sibling(m, 2);
1304
+ var T = e.sibling(p, 2);
1265
1305
  F(T, {
1266
1306
  label: "Height",
1267
- onReset: () => s({
1307
+ onReset: () => a({
1268
1308
  height: void 0,
1269
1309
  minHeight: void 0,
1270
1310
  maxHeight: void 0
1271
1311
  }),
1272
1312
  children: (y, x) => {
1273
- var I = Mn(), b = e.first_child(I);
1274
- e.remove_input_defaults(b), b.__input = (p) => {
1275
- const o = p.currentTarget.value ? Number(p.currentTarget.value) : void 0, c = t().minHeight !== void 0 ? "min" : t().maxHeight !== void 0 ? "max" : "";
1276
- s(c === "min" ? { height: o, minHeight: o, maxHeight: void 0 } : c === "max" ? { height: o, maxHeight: o, minHeight: void 0 } : { height: o });
1313
+ var z = Rn(), _ = e.first_child(z);
1314
+ e.remove_input_defaults(_), _.__input = (m) => {
1315
+ const i = m.currentTarget.value ? Number(m.currentTarget.value) : void 0, c = t().minHeight !== void 0 ? "min" : t().maxHeight !== void 0 ? "max" : "";
1316
+ a(c === "min" ? { height: i, minHeight: i, maxHeight: void 0 } : c === "max" ? { height: i, maxHeight: i, minHeight: void 0 } : { height: i });
1277
1317
  };
1278
- var k = e.sibling(b, 2);
1279
- k.__change = (p) => {
1280
- const o = t().height ?? t().minHeight ?? t().maxHeight;
1281
- p.currentTarget.value === "min" && o !== void 0 ? s({ minHeight: o, maxHeight: void 0 }) : p.currentTarget.value === "max" && o !== void 0 ? s({ maxHeight: o, minHeight: void 0 }) : s({ minHeight: void 0, maxHeight: void 0 });
1318
+ var k = e.sibling(_, 2);
1319
+ k.__change = (m) => {
1320
+ const i = t().height ?? t().minHeight ?? t().maxHeight;
1321
+ m.currentTarget.value === "min" && i !== void 0 ? a({ minHeight: i, maxHeight: void 0 }) : m.currentTarget.value === "max" && i !== void 0 ? a({ maxHeight: i, minHeight: void 0 }) : a({ minHeight: void 0, maxHeight: void 0 });
1282
1322
  };
1283
- var C = e.child(k);
1284
- C.value = C.__value = "";
1285
- var S = e.sibling(C);
1323
+ var P = e.child(k);
1324
+ P.value = P.__value = "";
1325
+ var S = e.sibling(P);
1286
1326
  S.value = S.__value = "min";
1287
- var g = e.sibling(S);
1288
- g.value = g.__value = "max", e.reset(k);
1289
- var u;
1327
+ var b = e.sibling(S);
1328
+ b.value = b.__value = "max", e.reset(k);
1329
+ var d;
1290
1330
  e.init_select(k), e.template_effect(() => {
1291
- e.set_value(b, t().height ?? t().minHeight ?? t().maxHeight ?? ""), u !== (u = t().minHeight !== void 0 ? "min" : t().maxHeight !== void 0 ? "max" : "") && (k.value = k.__value = t().minHeight !== void 0 ? "min" : t().maxHeight !== void 0 ? "max" : "", e.select_option(k, t().minHeight !== void 0 ? "min" : t().maxHeight !== void 0 ? "max" : ""));
1292
- }), e.append(y, I);
1331
+ e.set_value(_, t().height ?? t().minHeight ?? t().maxHeight ?? ""), d !== (d = t().minHeight !== void 0 ? "min" : t().maxHeight !== void 0 ? "max" : "") && (k.value = k.__value = t().minHeight !== void 0 ? "min" : t().maxHeight !== void 0 ? "max" : "", e.select_option(k, t().minHeight !== void 0 ? "min" : t().maxHeight !== void 0 ? "max" : ""));
1332
+ }), e.append(y, z);
1293
1333
  }
1294
1334
  });
1295
1335
  var v = e.sibling(T, 2);
1296
1336
  F(v, {
1297
1337
  label: "Maintain Aspect",
1298
- onReset: () => s({ maintainAspectRatio: fe.maintainAspectRatio }),
1338
+ onReset: () => a({ maintainAspectRatio: fe.maintainAspectRatio }),
1299
1339
  children: (y, x) => {
1300
- var I = Tn();
1301
- e.remove_input_defaults(I), I.__change = (b) => s({ maintainAspectRatio: b.currentTarget.checked }), e.template_effect(() => e.set_checked(I, t().maintainAspectRatio ?? !0)), e.append(y, I);
1340
+ var z = jn();
1341
+ e.remove_input_defaults(z), z.__change = (_) => a({ maintainAspectRatio: _.currentTarget.checked }), e.template_effect(() => e.set_checked(z, t().maintainAspectRatio ?? !0)), e.append(y, z);
1302
1342
  }
1303
- }), e.append(d, _);
1343
+ }), e.append(u, g);
1304
1344
  };
1305
- e.if(f, (d) => {
1306
- t().mode === "scale" ? d(h) : d(w, !1);
1345
+ e.if(f, (u) => {
1346
+ t().mode === "scale" ? u(h) : u(w, !1);
1307
1347
  });
1308
1348
  }
1309
- e.reset(i), e.reset(n), e.append(r, n), e.pop();
1349
+ e.reset(s), e.reset(n), e.append(o, n), e.pop();
1310
1350
  }
1311
1351
  e.delegate(["change", "input"]);
1312
- var Cn = e.from_html('<span class="section-toggle svelte-1h62jm0"> </span>'), Pn = e.from_html('<div class="section-content svelte-1h62jm0"><!></div>'), Rn = e.from_html('<div class="section svelte-1h62jm0"><div class="section-header svelte-1h62jm0"><h3 class="section-title svelte-1h62jm0"> </h3> <!></div> <!></div>');
1313
- function Wn(r, a) {
1314
- e.push(a, !0);
1315
- let t = e.state(e.proxy(a.config.defaultCollapsed ?? !1));
1316
- var s = Rn(), n = e.child(s);
1317
- n.__click = () => a.config.collapsible && e.set(t, !e.get(t));
1318
- var i = e.child(n), l = e.child(i, !0);
1319
- e.reset(i);
1320
- var f = e.sibling(i, 2);
1352
+ var Zn = e.from_html('<span class="section-toggle svelte-1h62jm0"> </span>'), Bn = e.from_html('<div class="section-content svelte-1h62jm0"><!></div>'), Ln = e.from_html('<div class="section svelte-1h62jm0"><div class="section-header svelte-1h62jm0"><h3 class="section-title svelte-1h62jm0"> </h3> <!></div> <!></div>');
1353
+ const qn = {
1354
+ hash: "svelte-1h62jm0",
1355
+ code: ".section.svelte-1h62jm0 {border-top:1px solid var(--color-border, #ccc);border-bottom:1px solid var(--color-border, #ccc);background:var(--color-surface, #fff);min-width:0;}.section-header.svelte-1h62jm0 {display:flex;align-items:center;justify-content:space-between;padding:0.75rem 0;border-bottom:1px solid var(--color-border, #eee);cursor:pointer;}.section-title.svelte-1h62jm0 {margin:0;font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);}.section-toggle.svelte-1h62jm0 {font-size:0.75rem;color:var(--color-text-muted, #666);}.section-content.svelte-1h62jm0 {padding:0.75rem 0;display:flex;flex-direction:column;gap:0.75rem;}"
1356
+ };
1357
+ function En(o, r) {
1358
+ e.push(r, !0), e.append_styles(o, qn);
1359
+ let t = e.state(e.proxy(r.config.defaultCollapsed ?? !1));
1360
+ var a = Ln(), n = e.child(a);
1361
+ n.__click = () => r.config.collapsible && e.set(t, !e.get(t));
1362
+ var s = e.child(n), l = e.child(s, !0);
1363
+ e.reset(s);
1364
+ var f = e.sibling(s, 2);
1321
1365
  {
1322
- var h = (_) => {
1323
- var m = Cn(), T = e.child(m, !0);
1324
- e.reset(m), e.template_effect(() => e.set_text(T, e.get(t) ? "▼" : "▲")), e.append(_, m);
1366
+ var h = (g) => {
1367
+ var p = Zn(), T = e.child(p, !0);
1368
+ e.reset(p), e.template_effect(() => e.set_text(T, e.get(t) ? "▼" : "▲")), e.append(g, p);
1325
1369
  };
1326
- e.if(f, (_) => {
1327
- a.config.collapsible && _(h);
1370
+ e.if(f, (g) => {
1371
+ r.config.collapsible && g(h);
1328
1372
  });
1329
1373
  }
1330
1374
  e.reset(n);
1331
1375
  var w = e.sibling(n, 2);
1332
1376
  {
1333
- var d = (_) => {
1334
- var m = Pn(), T = e.child(m);
1335
- e.snippet(T, () => a.children), e.reset(m), e.append(_, m);
1377
+ var u = (g) => {
1378
+ var p = Bn(), T = e.child(p);
1379
+ e.snippet(T, () => r.children), e.reset(p), e.append(g, p);
1336
1380
  };
1337
- e.if(w, (_) => {
1338
- e.get(t) || _(d);
1381
+ e.if(w, (g) => {
1382
+ e.get(t) || g(u);
1339
1383
  });
1340
1384
  }
1341
- e.reset(s), e.template_effect(() => e.set_text(l, a.config.title)), e.append(r, s), e.pop();
1385
+ e.reset(a), e.template_effect(() => e.set_text(l, r.config.title)), e.append(o, a), e.pop();
1342
1386
  }
1343
1387
  e.delegate(["click"]);
1344
- var zn = e.from_html('<input type="checkbox"/>'), Dn = e.from_html('<select class="shape-select svelte-1ani6pi"><option>None</option><option>Plane</option><option>Cylinder</option><option>Sphere</option></select>'), Xn = e.from_html('<input type="range" step="0.5" min="0.5" max="4" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.5" min="0.5" max="4"/>', 1), Yn = e.from_html('<input type="range" step="0.05" min="0.1" max="5" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.05" min="0.1" max="5"/>', 1), Bn = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.01" min="-1" max="1"/>', 1), En = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.01" min="-1" max="1"/>', 1), Zn = e.from_html('<details class="subsection svelte-1ani6pi" open=""><summary class="subsection-title svelte-1ani6pi">Image Position & Sizing</summary> <div class="subsection-content svelte-1ani6pi"><!> <!> <!></div></details>'), On = e.from_html('<input type="range" step="1" min="-90" max="90" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-90" max="90"/>', 1), Ln = e.from_html('<input type="range" step="1" min="-90" max="90" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-90" max="90"/>', 1), jn = e.from_html('<input type="range" step="1" min="-180" max="180" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-180" max="180"/>', 1), qn = e.from_html('<input type="range" step="0.1" min="0" max="3" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.1" min="0" max="3"/>', 1), Hn = e.from_html('<details class="subsection svelte-1ani6pi" open=""><summary class="subsection-title svelte-1ani6pi">Surface Settings</summary> <div class="subsection-content svelte-1ani6pi"><!> <!> <!> <!></div></details>'), An = e.from_html('<input type="range" step="10" min="50" max="2000" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="10" min="50" max="2000"/>', 1), Un = e.from_html('<input type="range" step="0.1" min="0" max="5" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.1" min="0" max="10"/>', 1), Vn = e.from_html('<input type="range" step="1" min="-90" max="90" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-90" max="90"/>', 1), Fn = e.from_html('<input type="range" step="1" min="-180" max="180" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-180" max="180"/>', 1), Kn = e.from_html('<details class="subsection svelte-1ani6pi" open=""><summary class="subsection-title svelte-1ani6pi">Surface Settings</summary> <div class="subsection-content svelte-1ani6pi"><!> <!> <!> <!></div></details>'), Jn = e.from_html('<input type="range" step="10" min="50" max="1000" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="10" min="50" max="1000"/>', 1), Gn = e.from_html('<input type="range" step="1" min="-180" max="180" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-180" max="180"/>', 1), Qn = e.from_html('<details class="subsection svelte-1ani6pi" open=""><summary class="subsection-title svelte-1ani6pi">Surface Settings</summary> <div class="subsection-content svelte-1ani6pi"><!> <!></div></details>'), $n = e.from_html('<input type="checkbox"/>'), ea = e.from_html('<input type="checkbox"/>'), ta = e.from_html('<input type="checkbox"/>'), na = e.from_html('<details class="subsection svelte-1ani6pi"><summary class="subsection-title svelte-1ani6pi">Debug Visualization</summary> <div class="subsection-content svelte-1ani6pi"><!> <!> <!></div></details>'), aa = e.from_html("<!> <!> <!> <!> <!> <!> <!>", 1), sa = e.from_html("<!> <!>", 1);
1345
- function ia(r, a) {
1346
- e.push(a, !0);
1347
- const t = e.derived(() => a.effect ?? $e), s = e.derived(() => e.get(t).image ?? ie), n = e.derived(() => e.get(t).debug ?? ve);
1348
- function i(T) {
1388
+ var On = e.from_html('<input type="checkbox"/>'), Vn = e.from_html('<select class="shape-select svelte-1ani6pi"><option>None</option><option>Plane</option><option>Cylinder</option><option>Sphere</option></select>'), Un = e.from_html('<input type="range" step="0.5" min="0.5" max="4" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.5" min="0.5" max="4"/>', 1), An = e.from_html('<input type="range" step="0.05" min="0.1" max="5" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.05" min="0.1" max="5"/>', 1), Hn = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.01" min="-1" max="1"/>', 1), Fn = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.01" min="-1" max="1"/>', 1), Kn = e.from_html('<details class="subsection svelte-1ani6pi" open=""><summary class="subsection-title svelte-1ani6pi">Image Position & Sizing</summary> <div class="subsection-content svelte-1ani6pi"><!> <!> <!></div></details>'), Jn = e.from_html('<input type="range" step="1" min="-90" max="90" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-90" max="90"/>', 1), Gn = e.from_html('<input type="range" step="1" min="-90" max="90" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-90" max="90"/>', 1), $n = e.from_html('<input type="range" step="1" min="-180" max="180" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-180" max="180"/>', 1), Qn = e.from_html('<input type="range" step="0.1" min="0" max="3" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.1" min="0" max="3"/>', 1), er = e.from_html('<details class="subsection svelte-1ani6pi" open=""><summary class="subsection-title svelte-1ani6pi">Surface Settings</summary> <div class="subsection-content svelte-1ani6pi"><!> <!> <!> <!></div></details>'), tr = e.from_html('<input type="range" step="10" min="50" max="2000" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="10" min="50" max="2000"/>', 1), nr = e.from_html('<input type="range" step="0.1" min="0" max="5" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.1" min="0" max="10"/>', 1), rr = e.from_html('<input type="range" step="1" min="-90" max="90" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-90" max="90"/>', 1), ar = e.from_html('<input type="range" step="1" min="-180" max="180" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-180" max="180"/>', 1), sr = e.from_html('<details class="subsection svelte-1ani6pi" open=""><summary class="subsection-title svelte-1ani6pi">Surface Settings</summary> <div class="subsection-content svelte-1ani6pi"><!> <!> <!> <!></div></details>'), or = e.from_html('<input type="range" step="10" min="50" max="1000" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="10" min="50" max="1000"/>', 1), ir = e.from_html('<input type="range" step="1" min="-180" max="180" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-180" max="180"/>', 1), lr = e.from_html('<details class="subsection svelte-1ani6pi" open=""><summary class="subsection-title svelte-1ani6pi">Surface Settings</summary> <div class="subsection-content svelte-1ani6pi"><!> <!></div></details>'), cr = e.from_html('<input type="checkbox"/>'), dr = e.from_html('<input type="checkbox"/>'), ur = e.from_html('<input type="checkbox"/>'), mr = e.from_html('<details class="subsection svelte-1ani6pi"><summary class="subsection-title svelte-1ani6pi">Debug Visualization</summary> <div class="subsection-content svelte-1ani6pi"><!> <!> <!></div></details>'), pr = e.from_html("<!> <!> <!> <!> <!> <!> <!>", 1), vr = e.from_html("<!> <!>", 1);
1389
+ const fr = {
1390
+ hash: "svelte-1ani6pi",
1391
+ code: `.shape-select.svelte-1ani6pi {padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;background:var(--color-surface, #fff);}.manual-input.svelte-1ani6pi {width:60px;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;}input[type="range"].svelte-1ani6pi {flex:1;min-width:0;max-width:100%;}.subsection.svelte-1ani6pi {margin-top:0.75rem;border-top:1px solid var(--color-border, #e0e0e0);}.subsection-title.svelte-1ani6pi {padding:0.5rem 0;font-size:0.75rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:var(--color-text-muted, #666);cursor:pointer;list-style:none;display:flex;align-items:center;gap:0.5rem;}.subsection-title.svelte-1ani6pi::-webkit-details-marker {display:none;}.subsection-title.svelte-1ani6pi::before {content:'▶';font-size:0.625rem;transition:transform 0.15s ease;}.subsection[open].svelte-1ani6pi > .subsection-title:where(.svelte-1ani6pi)::before {transform:rotate(90deg);}.subsection-content.svelte-1ani6pi {padding-bottom:0.25rem;}`
1392
+ };
1393
+ function hr(o, r) {
1394
+ e.push(r, !0), e.append_styles(o, fr);
1395
+ const t = e.derived(() => r.effect ?? Qe), a = e.derived(() => e.get(t).image ?? se), n = e.derived(() => e.get(t).debug ?? ve);
1396
+ function s(T) {
1349
1397
  const v = { ...e.get(t), ...T };
1350
- a.onChange(v);
1398
+ r.onChange(v);
1351
1399
  }
1352
1400
  function l(T) {
1353
- i({
1401
+ s({
1354
1402
  image: {
1355
- ...ie,
1403
+ ...se,
1356
1404
  ...e.get(t).image,
1357
1405
  ...T
1358
1406
  }
1359
1407
  });
1360
1408
  }
1361
1409
  function f(T) {
1362
- i({
1410
+ s({
1363
1411
  debug: { ...ve, ...e.get(t).debug, ...T }
1364
1412
  });
1365
1413
  }
1366
1414
  function h(T) {
1367
- i({
1415
+ s({
1368
1416
  cylinder: {
1369
1417
  ...ce,
1370
1418
  ...e.get(t).cylinder,
@@ -1373,12 +1421,12 @@ function ia(r, a) {
1373
1421
  });
1374
1422
  }
1375
1423
  function w(T) {
1376
- i({
1377
- plane: { ...se, ...e.get(t).plane, ...T }
1424
+ s({
1425
+ plane: { ...ae, ...e.get(t).plane, ...T }
1378
1426
  });
1379
1427
  }
1380
- function d(T) {
1381
- i({
1428
+ function u(T) {
1429
+ s({
1382
1430
  sphere: {
1383
1431
  ...ke,
1384
1432
  ...e.get(t).sphere,
@@ -1386,310 +1434,310 @@ function ia(r, a) {
1386
1434
  }
1387
1435
  });
1388
1436
  }
1389
- function _() {
1390
- e.get(t).enabled ? i({ enabled: !1 }) : i({
1437
+ function g() {
1438
+ e.get(t).enabled ? s({ enabled: !1 }) : s({
1391
1439
  enabled: !0,
1392
1440
  shape: "plane",
1393
- plane: e.get(t).plane ?? { ...se },
1394
- image: e.get(t).image ?? { ...ie }
1441
+ plane: e.get(t).plane ?? { ...ae },
1442
+ image: e.get(t).image ?? { ...se }
1395
1443
  });
1396
1444
  }
1397
- const m = { id: "warp", title: "Warp", collapsible: !0 };
1398
- Wn(r, {
1445
+ const p = { id: "warp", title: "Warp", collapsible: !0 };
1446
+ En(o, {
1399
1447
  get config() {
1400
- return m;
1448
+ return p;
1401
1449
  },
1402
1450
  children: (T, v) => {
1403
- var y = sa(), x = e.first_child(y);
1451
+ var y = vr(), x = e.first_child(y);
1404
1452
  F(x, {
1405
1453
  label: "Enabled",
1406
- children: (k, C) => {
1407
- var S = zn();
1408
- e.remove_input_defaults(S), S.__change = _, e.template_effect(() => e.set_checked(S, e.get(t).enabled)), e.append(k, S);
1454
+ children: (k, P) => {
1455
+ var S = On();
1456
+ e.remove_input_defaults(S), S.__change = g, e.template_effect(() => e.set_checked(S, e.get(t).enabled)), e.append(k, S);
1409
1457
  }
1410
1458
  });
1411
- var I = e.sibling(x, 2);
1459
+ var z = e.sibling(x, 2);
1412
1460
  {
1413
- var b = (k) => {
1414
- var C = aa(), S = e.first_child(C);
1461
+ var _ = (k) => {
1462
+ var P = pr(), S = e.first_child(P);
1415
1463
  F(S, {
1416
1464
  label: "Shape",
1417
- children: (z, E) => {
1418
- var O = Dn();
1419
- O.__change = (X) => {
1420
- const Y = X.currentTarget.value;
1421
- i({ shape: Y }), Y === "cylinder" && !e.get(t).cylinder && i({ cylinder: { ...ce } }), Y === "plane" && !e.get(t).plane && i({ plane: { ...se } }), Y === "sphere" && !e.get(t).sphere && i({ sphere: { ...ke } });
1465
+ children: (j, Z) => {
1466
+ var L = Vn();
1467
+ L.__change = (Y) => {
1468
+ const D = Y.currentTarget.value;
1469
+ s({ shape: D }), D === "cylinder" && !e.get(t).cylinder && s({ cylinder: { ...ce } }), D === "plane" && !e.get(t).plane && s({ plane: { ...ae } }), D === "sphere" && !e.get(t).sphere && s({ sphere: { ...ke } });
1422
1470
  };
1423
- var j = e.child(O);
1424
- j.value = j.__value = "none";
1425
- var L = e.sibling(j);
1426
- L.value = L.__value = "plane";
1427
- var K = e.sibling(L);
1471
+ var E = e.child(L);
1472
+ E.value = E.__value = "none";
1473
+ var q = e.sibling(E);
1474
+ q.value = q.__value = "plane";
1475
+ var K = e.sibling(q);
1428
1476
  K.value = K.__value = "cylinder";
1429
- var H = e.sibling(K);
1430
- H.value = H.__value = "sphere", e.reset(O);
1477
+ var V = e.sibling(K);
1478
+ V.value = V.__value = "sphere", e.reset(L);
1431
1479
  var G;
1432
- e.init_select(O), e.template_effect(() => {
1433
- G !== (G = e.get(t).shape) && (O.value = (O.__value = e.get(t).shape) ?? "", e.select_option(O, e.get(t).shape));
1434
- }), e.append(z, O);
1480
+ e.init_select(L), e.template_effect(() => {
1481
+ G !== (G = e.get(t).shape) && (L.value = (L.__value = e.get(t).shape) ?? "", e.select_option(L, e.get(t).shape));
1482
+ }), e.append(j, L);
1435
1483
  }
1436
1484
  });
1437
- var g = e.sibling(S, 2);
1438
- F(g, {
1485
+ var b = e.sibling(S, 2);
1486
+ F(b, {
1439
1487
  label: "Quality",
1440
- onReset: () => i({ quality: $e.quality }),
1441
- children: (z, E) => {
1442
- var O = Xn(), j = e.first_child(O);
1443
- e.remove_input_defaults(j), j.__input = (K) => i({ quality: Number(K.currentTarget.value) });
1444
- var L = e.sibling(j, 2);
1445
- e.remove_input_defaults(L), L.__input = (K) => i({ quality: Number(K.currentTarget.value) }), e.template_effect(() => {
1446
- e.set_value(j, e.get(t).quality ?? 1), e.set_value(L, e.get(t).quality ?? 1);
1447
- }), e.append(z, O);
1488
+ onReset: () => s({ quality: Qe.quality }),
1489
+ children: (j, Z) => {
1490
+ var L = Un(), E = e.first_child(L);
1491
+ e.remove_input_defaults(E), E.__input = (K) => s({ quality: Number(K.currentTarget.value) });
1492
+ var q = e.sibling(E, 2);
1493
+ e.remove_input_defaults(q), q.__input = (K) => s({ quality: Number(K.currentTarget.value) }), e.template_effect(() => {
1494
+ e.set_value(E, e.get(t).quality ?? 1), e.set_value(q, e.get(t).quality ?? 1);
1495
+ }), e.append(j, L);
1448
1496
  }
1449
1497
  });
1450
- var u = e.sibling(g, 2);
1498
+ var d = e.sibling(b, 2);
1451
1499
  {
1452
- var p = (z) => {
1453
- var E = Zn(), O = e.sibling(e.child(E), 2), j = e.child(O);
1454
- F(j, {
1500
+ var m = (j) => {
1501
+ var Z = Kn(), L = e.sibling(e.child(Z), 2), E = e.child(L);
1502
+ F(E, {
1455
1503
  label: "Scale",
1456
- onReset: () => l({ scale: ie.scale }),
1457
- children: (H, G) => {
1458
- var X = Yn(), Y = e.first_child(X);
1459
- e.remove_input_defaults(Y), Y.__input = (R) => l({ scale: Number(R.currentTarget.value) });
1460
- var D = e.sibling(Y, 2);
1461
- e.remove_input_defaults(D), D.__input = (R) => l({ scale: Number(R.currentTarget.value) }), e.template_effect(() => {
1462
- e.set_value(Y, e.get(s).scale), e.set_value(D, e.get(s).scale);
1463
- }), e.append(H, X);
1504
+ onReset: () => l({ scale: se.scale }),
1505
+ children: (V, G) => {
1506
+ var Y = An(), D = e.first_child(Y);
1507
+ e.remove_input_defaults(D), D.__input = (N) => l({ scale: Number(N.currentTarget.value) });
1508
+ var W = e.sibling(D, 2);
1509
+ e.remove_input_defaults(W), W.__input = (N) => l({ scale: Number(N.currentTarget.value) }), e.template_effect(() => {
1510
+ e.set_value(D, e.get(a).scale), e.set_value(W, e.get(a).scale);
1511
+ }), e.append(V, Y);
1464
1512
  }
1465
1513
  });
1466
- var L = e.sibling(j, 2);
1467
- F(L, {
1514
+ var q = e.sibling(E, 2);
1515
+ F(q, {
1468
1516
  label: "Translate X",
1469
- onReset: () => l({ translateX: ie.translateX }),
1470
- children: (H, G) => {
1471
- var X = Bn(), Y = e.first_child(X);
1472
- e.remove_input_defaults(Y), Y.__input = (R) => l({ translateX: Number(R.currentTarget.value) });
1473
- var D = e.sibling(Y, 2);
1474
- e.remove_input_defaults(D), D.__input = (R) => l({ translateX: Number(R.currentTarget.value) }), e.template_effect(() => {
1475
- e.set_value(Y, e.get(s).translateX), e.set_value(D, e.get(s).translateX);
1476
- }), e.append(H, X);
1517
+ onReset: () => l({ translateX: se.translateX }),
1518
+ children: (V, G) => {
1519
+ var Y = Hn(), D = e.first_child(Y);
1520
+ e.remove_input_defaults(D), D.__input = (N) => l({ translateX: Number(N.currentTarget.value) });
1521
+ var W = e.sibling(D, 2);
1522
+ e.remove_input_defaults(W), W.__input = (N) => l({ translateX: Number(N.currentTarget.value) }), e.template_effect(() => {
1523
+ e.set_value(D, e.get(a).translateX), e.set_value(W, e.get(a).translateX);
1524
+ }), e.append(V, Y);
1477
1525
  }
1478
1526
  });
1479
- var K = e.sibling(L, 2);
1527
+ var K = e.sibling(q, 2);
1480
1528
  F(K, {
1481
1529
  label: "Translate Y",
1482
- onReset: () => l({ translateY: ie.translateY }),
1483
- children: (H, G) => {
1484
- var X = En(), Y = e.first_child(X);
1485
- e.remove_input_defaults(Y), Y.__input = (R) => l({ translateY: Number(R.currentTarget.value) });
1486
- var D = e.sibling(Y, 2);
1487
- e.remove_input_defaults(D), D.__input = (R) => l({ translateY: Number(R.currentTarget.value) }), e.template_effect(() => {
1488
- e.set_value(Y, e.get(s).translateY), e.set_value(D, e.get(s).translateY);
1489
- }), e.append(H, X);
1530
+ onReset: () => l({ translateY: se.translateY }),
1531
+ children: (V, G) => {
1532
+ var Y = Fn(), D = e.first_child(Y);
1533
+ e.remove_input_defaults(D), D.__input = (N) => l({ translateY: Number(N.currentTarget.value) });
1534
+ var W = e.sibling(D, 2);
1535
+ e.remove_input_defaults(W), W.__input = (N) => l({ translateY: Number(N.currentTarget.value) }), e.template_effect(() => {
1536
+ e.set_value(D, e.get(a).translateY), e.set_value(W, e.get(a).translateY);
1537
+ }), e.append(V, Y);
1490
1538
  }
1491
- }), e.reset(O), e.reset(E), e.append(z, E);
1539
+ }), e.reset(L), e.reset(Z), e.append(j, Z);
1492
1540
  };
1493
- e.if(u, (z) => {
1494
- e.get(t).shape !== "none" && z(p);
1541
+ e.if(d, (j) => {
1542
+ e.get(t).shape !== "none" && j(m);
1495
1543
  });
1496
1544
  }
1497
- var o = e.sibling(u, 2);
1545
+ var i = e.sibling(d, 2);
1498
1546
  {
1499
- var c = (z) => {
1500
- const E = e.derived(() => e.get(t).plane);
1501
- var O = Hn(), j = e.sibling(e.child(O), 2), L = e.child(j);
1502
- F(L, {
1547
+ var c = (j) => {
1548
+ const Z = e.derived(() => e.get(t).plane);
1549
+ var L = er(), E = e.sibling(e.child(L), 2), q = e.child(E);
1550
+ F(q, {
1503
1551
  label: "Rotation X",
1504
- onReset: () => w({ rotationX: se.rotationX }),
1505
- children: (X, Y) => {
1506
- var D = On(), R = e.first_child(D);
1507
- e.remove_input_defaults(R), R.__input = (A) => w({ rotationX: Number(A.currentTarget.value) });
1508
- var V = e.sibling(R, 2);
1509
- e.remove_input_defaults(V), V.__input = (A) => w({ rotationX: Number(A.currentTarget.value) }), e.template_effect(() => {
1510
- e.set_value(R, e.get(E).rotationX), e.set_value(V, e.get(E).rotationX);
1511
- }), e.append(X, D);
1552
+ onReset: () => w({ rotationX: ae.rotationX }),
1553
+ children: (Y, D) => {
1554
+ var W = Jn(), N = e.first_child(W);
1555
+ e.remove_input_defaults(N), N.__input = (U) => w({ rotationX: Number(U.currentTarget.value) });
1556
+ var H = e.sibling(N, 2);
1557
+ e.remove_input_defaults(H), H.__input = (U) => w({ rotationX: Number(U.currentTarget.value) }), e.template_effect(() => {
1558
+ e.set_value(N, e.get(Z).rotationX), e.set_value(H, e.get(Z).rotationX);
1559
+ }), e.append(Y, W);
1512
1560
  }
1513
1561
  });
1514
- var K = e.sibling(L, 2);
1562
+ var K = e.sibling(q, 2);
1515
1563
  F(K, {
1516
1564
  label: "Rotation Y",
1517
- onReset: () => w({ rotationY: se.rotationY }),
1518
- children: (X, Y) => {
1519
- var D = Ln(), R = e.first_child(D);
1520
- e.remove_input_defaults(R), R.__input = (A) => w({ rotationY: Number(A.currentTarget.value) });
1521
- var V = e.sibling(R, 2);
1522
- e.remove_input_defaults(V), V.__input = (A) => w({ rotationY: Number(A.currentTarget.value) }), e.template_effect(() => {
1523
- e.set_value(R, e.get(E).rotationY), e.set_value(V, e.get(E).rotationY);
1524
- }), e.append(X, D);
1565
+ onReset: () => w({ rotationY: ae.rotationY }),
1566
+ children: (Y, D) => {
1567
+ var W = Gn(), N = e.first_child(W);
1568
+ e.remove_input_defaults(N), N.__input = (U) => w({ rotationY: Number(U.currentTarget.value) });
1569
+ var H = e.sibling(N, 2);
1570
+ e.remove_input_defaults(H), H.__input = (U) => w({ rotationY: Number(U.currentTarget.value) }), e.template_effect(() => {
1571
+ e.set_value(N, e.get(Z).rotationY), e.set_value(H, e.get(Z).rotationY);
1572
+ }), e.append(Y, W);
1525
1573
  }
1526
1574
  });
1527
- var H = e.sibling(K, 2);
1528
- F(H, {
1575
+ var V = e.sibling(K, 2);
1576
+ F(V, {
1529
1577
  label: "Rotation Z",
1530
- onReset: () => w({ rotationZ: se.rotationZ }),
1531
- children: (X, Y) => {
1532
- var D = jn(), R = e.first_child(D);
1533
- e.remove_input_defaults(R), R.__input = (A) => w({ rotationZ: Number(A.currentTarget.value) });
1534
- var V = e.sibling(R, 2);
1535
- e.remove_input_defaults(V), V.__input = (A) => w({ rotationZ: Number(A.currentTarget.value) }), e.template_effect(() => {
1536
- e.set_value(R, e.get(E).rotationZ), e.set_value(V, e.get(E).rotationZ);
1537
- }), e.append(X, D);
1578
+ onReset: () => w({ rotationZ: ae.rotationZ }),
1579
+ children: (Y, D) => {
1580
+ var W = $n(), N = e.first_child(W);
1581
+ e.remove_input_defaults(N), N.__input = (U) => w({ rotationZ: Number(U.currentTarget.value) });
1582
+ var H = e.sibling(N, 2);
1583
+ e.remove_input_defaults(H), H.__input = (U) => w({ rotationZ: Number(U.currentTarget.value) }), e.template_effect(() => {
1584
+ e.set_value(N, e.get(Z).rotationZ), e.set_value(H, e.get(Z).rotationZ);
1585
+ }), e.append(Y, W);
1538
1586
  }
1539
1587
  });
1540
- var G = e.sibling(H, 2);
1588
+ var G = e.sibling(V, 2);
1541
1589
  F(G, {
1542
1590
  label: "Perspective",
1543
- onReset: () => w({ depthScale: se.depthScale }),
1544
- children: (X, Y) => {
1545
- var D = qn(), R = e.first_child(D);
1546
- e.remove_input_defaults(R), R.__input = (A) => w({ depthScale: Number(A.currentTarget.value) });
1547
- var V = e.sibling(R, 2);
1548
- e.remove_input_defaults(V), V.__input = (A) => w({ depthScale: Number(A.currentTarget.value) }), e.template_effect(() => {
1549
- e.set_value(R, e.get(E).depthScale), e.set_value(V, e.get(E).depthScale);
1550
- }), e.append(X, D);
1591
+ onReset: () => w({ depthScale: ae.depthScale }),
1592
+ children: (Y, D) => {
1593
+ var W = Qn(), N = e.first_child(W);
1594
+ e.remove_input_defaults(N), N.__input = (U) => w({ depthScale: Number(U.currentTarget.value) });
1595
+ var H = e.sibling(N, 2);
1596
+ e.remove_input_defaults(H), H.__input = (U) => w({ depthScale: Number(U.currentTarget.value) }), e.template_effect(() => {
1597
+ e.set_value(N, e.get(Z).depthScale), e.set_value(H, e.get(Z).depthScale);
1598
+ }), e.append(Y, W);
1551
1599
  }
1552
- }), e.reset(j), e.reset(O), e.append(z, O);
1600
+ }), e.reset(E), e.reset(L), e.append(j, L);
1553
1601
  };
1554
- e.if(o, (z) => {
1555
- e.get(t).shape === "plane" && e.get(t).plane && z(c);
1602
+ e.if(i, (j) => {
1603
+ e.get(t).shape === "plane" && e.get(t).plane && j(c);
1556
1604
  });
1557
1605
  }
1558
- var M = e.sibling(o, 2);
1606
+ var M = e.sibling(i, 2);
1559
1607
  {
1560
- var N = (z) => {
1561
- const E = e.derived(() => e.get(t).cylinder);
1562
- var O = Kn(), j = e.sibling(e.child(O), 2), L = e.child(j);
1563
- F(L, {
1608
+ var I = (j) => {
1609
+ const Z = e.derived(() => e.get(t).cylinder);
1610
+ var L = sr(), E = e.sibling(e.child(L), 2), q = e.child(E);
1611
+ F(q, {
1564
1612
  label: "Diameter",
1565
1613
  onReset: () => h({ diameter: ce.diameter }),
1566
- children: (X, Y) => {
1567
- var D = An(), R = e.first_child(D);
1568
- e.remove_input_defaults(R), R.__input = (A) => h({ diameter: Number(A.currentTarget.value) });
1569
- var V = e.sibling(R, 2);
1570
- e.remove_input_defaults(V), V.__input = (A) => h({ diameter: Number(A.currentTarget.value) }), e.template_effect(() => {
1571
- e.set_value(R, e.get(E).diameter), e.set_value(V, e.get(E).diameter);
1572
- }), e.append(X, D);
1614
+ children: (Y, D) => {
1615
+ var W = tr(), N = e.first_child(W);
1616
+ e.remove_input_defaults(N), N.__input = (U) => h({ diameter: Number(U.currentTarget.value) });
1617
+ var H = e.sibling(N, 2);
1618
+ e.remove_input_defaults(H), H.__input = (U) => h({ diameter: Number(U.currentTarget.value) }), e.template_effect(() => {
1619
+ e.set_value(N, e.get(Z).diameter), e.set_value(H, e.get(Z).diameter);
1620
+ }), e.append(Y, W);
1573
1621
  }
1574
1622
  });
1575
- var K = e.sibling(L, 2);
1623
+ var K = e.sibling(q, 2);
1576
1624
  F(K, {
1577
1625
  label: "Perspective",
1578
1626
  onReset: () => h({ perspective: ce.perspective }),
1579
- children: (X, Y) => {
1580
- var D = Un(), R = e.first_child(D);
1581
- e.remove_input_defaults(R), R.__input = (A) => h({ perspective: Number(A.currentTarget.value) });
1582
- var V = e.sibling(R, 2);
1583
- e.remove_input_defaults(V), V.__input = (A) => h({ perspective: Number(A.currentTarget.value) }), e.template_effect(() => {
1584
- e.set_value(R, e.get(E).perspective ?? 1), e.set_value(V, e.get(E).perspective ?? 1);
1585
- }), e.append(X, D);
1627
+ children: (Y, D) => {
1628
+ var W = nr(), N = e.first_child(W);
1629
+ e.remove_input_defaults(N), N.__input = (U) => h({ perspective: Number(U.currentTarget.value) });
1630
+ var H = e.sibling(N, 2);
1631
+ e.remove_input_defaults(H), H.__input = (U) => h({ perspective: Number(U.currentTarget.value) }), e.template_effect(() => {
1632
+ e.set_value(N, e.get(Z).perspective ?? 1), e.set_value(H, e.get(Z).perspective ?? 1);
1633
+ }), e.append(Y, W);
1586
1634
  }
1587
1635
  });
1588
- var H = e.sibling(K, 2);
1589
- F(H, {
1636
+ var V = e.sibling(K, 2);
1637
+ F(V, {
1590
1638
  label: "Tilt (X)",
1591
1639
  onReset: () => h({ rotationX: ce.rotationX }),
1592
- children: (X, Y) => {
1593
- var D = Vn(), R = e.first_child(D);
1594
- e.remove_input_defaults(R), R.__input = (A) => h({ rotationX: Number(A.currentTarget.value) });
1595
- var V = e.sibling(R, 2);
1596
- e.remove_input_defaults(V), V.__input = (A) => h({ rotationX: Number(A.currentTarget.value) }), e.template_effect(() => {
1597
- e.set_value(R, e.get(E).rotationX), e.set_value(V, e.get(E).rotationX);
1598
- }), e.append(X, D);
1640
+ children: (Y, D) => {
1641
+ var W = rr(), N = e.first_child(W);
1642
+ e.remove_input_defaults(N), N.__input = (U) => h({ rotationX: Number(U.currentTarget.value) });
1643
+ var H = e.sibling(N, 2);
1644
+ e.remove_input_defaults(H), H.__input = (U) => h({ rotationX: Number(U.currentTarget.value) }), e.template_effect(() => {
1645
+ e.set_value(N, e.get(Z).rotationX), e.set_value(H, e.get(Z).rotationX);
1646
+ }), e.append(Y, W);
1599
1647
  }
1600
1648
  });
1601
- var G = e.sibling(H, 2);
1649
+ var G = e.sibling(V, 2);
1602
1650
  F(G, {
1603
1651
  label: "Spin (Z)",
1604
1652
  onReset: () => h({ rotationZ: ce.rotationZ }),
1605
- children: (X, Y) => {
1606
- var D = Fn(), R = e.first_child(D);
1607
- e.remove_input_defaults(R), R.__input = (A) => h({ rotationZ: Number(A.currentTarget.value) });
1608
- var V = e.sibling(R, 2);
1609
- e.remove_input_defaults(V), V.__input = (A) => h({ rotationZ: Number(A.currentTarget.value) }), e.template_effect(() => {
1610
- e.set_value(R, e.get(E).rotationZ), e.set_value(V, e.get(E).rotationZ);
1611
- }), e.append(X, D);
1653
+ children: (Y, D) => {
1654
+ var W = ar(), N = e.first_child(W);
1655
+ e.remove_input_defaults(N), N.__input = (U) => h({ rotationZ: Number(U.currentTarget.value) });
1656
+ var H = e.sibling(N, 2);
1657
+ e.remove_input_defaults(H), H.__input = (U) => h({ rotationZ: Number(U.currentTarget.value) }), e.template_effect(() => {
1658
+ e.set_value(N, e.get(Z).rotationZ), e.set_value(H, e.get(Z).rotationZ);
1659
+ }), e.append(Y, W);
1612
1660
  }
1613
- }), e.reset(j), e.reset(O), e.append(z, O);
1661
+ }), e.reset(E), e.reset(L), e.append(j, L);
1614
1662
  };
1615
- e.if(M, (z) => {
1616
- e.get(t).shape === "cylinder" && e.get(t).cylinder && z(N);
1663
+ e.if(M, (j) => {
1664
+ e.get(t).shape === "cylinder" && e.get(t).cylinder && j(I);
1617
1665
  });
1618
1666
  }
1619
- var B = e.sibling(M, 2);
1667
+ var X = e.sibling(M, 2);
1620
1668
  {
1621
- var J = (z) => {
1622
- const E = e.derived(() => e.get(t).sphere);
1623
- var O = Qn(), j = e.sibling(e.child(O), 2), L = e.child(j);
1624
- F(L, {
1669
+ var J = (j) => {
1670
+ const Z = e.derived(() => e.get(t).sphere);
1671
+ var L = lr(), E = e.sibling(e.child(L), 2), q = e.child(E);
1672
+ F(q, {
1625
1673
  label: "Radius",
1626
- onReset: () => d({ radius: ke.radius }),
1627
- children: (H, G) => {
1628
- var X = Jn(), Y = e.first_child(X);
1629
- e.remove_input_defaults(Y), Y.__input = (R) => d({ radius: Number(R.currentTarget.value) });
1630
- var D = e.sibling(Y, 2);
1631
- e.remove_input_defaults(D), D.__input = (R) => d({ radius: Number(R.currentTarget.value) }), e.template_effect(() => {
1632
- e.set_value(Y, e.get(E).radius), e.set_value(D, e.get(E).radius);
1633
- }), e.append(H, X);
1674
+ onReset: () => u({ radius: ke.radius }),
1675
+ children: (V, G) => {
1676
+ var Y = or(), D = e.first_child(Y);
1677
+ e.remove_input_defaults(D), D.__input = (N) => u({ radius: Number(N.currentTarget.value) });
1678
+ var W = e.sibling(D, 2);
1679
+ e.remove_input_defaults(W), W.__input = (N) => u({ radius: Number(N.currentTarget.value) }), e.template_effect(() => {
1680
+ e.set_value(D, e.get(Z).radius), e.set_value(W, e.get(Z).radius);
1681
+ }), e.append(V, Y);
1634
1682
  }
1635
1683
  });
1636
- var K = e.sibling(L, 2);
1684
+ var K = e.sibling(q, 2);
1637
1685
  F(K, {
1638
1686
  label: "Spin (Z)",
1639
- onReset: () => d({ rotationZ: ke.rotationZ }),
1640
- children: (H, G) => {
1641
- var X = Gn(), Y = e.first_child(X);
1642
- e.remove_input_defaults(Y), Y.__input = (R) => d({ rotationZ: Number(R.currentTarget.value) });
1643
- var D = e.sibling(Y, 2);
1644
- e.remove_input_defaults(D), D.__input = (R) => d({ rotationZ: Number(R.currentTarget.value) }), e.template_effect(() => {
1645
- e.set_value(Y, e.get(E).rotationZ), e.set_value(D, e.get(E).rotationZ);
1646
- }), e.append(H, X);
1687
+ onReset: () => u({ rotationZ: ke.rotationZ }),
1688
+ children: (V, G) => {
1689
+ var Y = ir(), D = e.first_child(Y);
1690
+ e.remove_input_defaults(D), D.__input = (N) => u({ rotationZ: Number(N.currentTarget.value) });
1691
+ var W = e.sibling(D, 2);
1692
+ e.remove_input_defaults(W), W.__input = (N) => u({ rotationZ: Number(N.currentTarget.value) }), e.template_effect(() => {
1693
+ e.set_value(D, e.get(Z).rotationZ), e.set_value(W, e.get(Z).rotationZ);
1694
+ }), e.append(V, Y);
1647
1695
  }
1648
- }), e.reset(j), e.reset(O), e.append(z, O);
1696
+ }), e.reset(E), e.reset(L), e.append(j, L);
1649
1697
  };
1650
- e.if(B, (z) => {
1651
- e.get(t).shape === "sphere" && e.get(t).sphere && z(J);
1698
+ e.if(X, (j) => {
1699
+ e.get(t).shape === "sphere" && e.get(t).sphere && j(J);
1652
1700
  });
1653
1701
  }
1654
- var Z = e.sibling(B, 2);
1702
+ var B = e.sibling(X, 2);
1655
1703
  {
1656
- var U = (z) => {
1657
- var E = na(), O = e.sibling(e.child(E), 2), j = e.child(O);
1658
- F(j, {
1704
+ var A = (j) => {
1705
+ var Z = mr(), L = e.sibling(e.child(Z), 2), E = e.child(L);
1706
+ F(E, {
1659
1707
  label: "Show Grid/Bounds",
1660
1708
  onReset: () => f({ showBounds: ve.showBounds }),
1661
- children: (H, G) => {
1662
- var X = $n();
1663
- e.remove_input_defaults(X), X.__change = (Y) => f({ showBounds: Y.currentTarget.checked }), e.template_effect(() => e.set_checked(X, e.get(n).showBounds)), e.append(H, X);
1709
+ children: (V, G) => {
1710
+ var Y = cr();
1711
+ e.remove_input_defaults(Y), Y.__change = (D) => f({ showBounds: D.currentTarget.checked }), e.template_effect(() => e.set_checked(Y, e.get(n).showBounds)), e.append(V, Y);
1664
1712
  }
1665
1713
  });
1666
- var L = e.sibling(j, 2);
1667
- F(L, {
1714
+ var q = e.sibling(E, 2);
1715
+ F(q, {
1668
1716
  label: "Depth Shader",
1669
1717
  onReset: () => f({ showDepthVis: ve.showDepthVis }),
1670
- children: (H, G) => {
1671
- var X = ea();
1672
- e.remove_input_defaults(X), X.__change = (Y) => f({ showDepthVis: Y.currentTarget.checked }), e.template_effect(() => e.set_checked(X, e.get(n).showDepthVis)), e.append(H, X);
1718
+ children: (V, G) => {
1719
+ var Y = dr();
1720
+ e.remove_input_defaults(Y), Y.__change = (D) => f({ showDepthVis: D.currentTarget.checked }), e.template_effect(() => e.set_checked(Y, e.get(n).showDepthVis)), e.append(V, Y);
1673
1721
  }
1674
1722
  });
1675
- var K = e.sibling(L, 2);
1723
+ var K = e.sibling(q, 2);
1676
1724
  F(K, {
1677
1725
  label: "Crosshair",
1678
1726
  onReset: () => f({ showCrosshair: ve.showCrosshair }),
1679
- children: (H, G) => {
1680
- var X = ta();
1681
- e.remove_input_defaults(X), X.__change = (Y) => f({ showCrosshair: Y.currentTarget.checked }), e.template_effect(() => e.set_checked(X, e.get(n).showCrosshair)), e.append(H, X);
1727
+ children: (V, G) => {
1728
+ var Y = ur();
1729
+ e.remove_input_defaults(Y), Y.__change = (D) => f({ showCrosshair: D.currentTarget.checked }), e.template_effect(() => e.set_checked(Y, e.get(n).showCrosshair)), e.append(V, Y);
1682
1730
  }
1683
- }), e.reset(O), e.reset(E), e.append(z, E);
1731
+ }), e.reset(L), e.reset(Z), e.append(j, Z);
1684
1732
  };
1685
- e.if(Z, (z) => {
1686
- e.get(t).shape !== "none" && z(U);
1733
+ e.if(B, (j) => {
1734
+ e.get(t).shape !== "none" && j(A);
1687
1735
  });
1688
1736
  }
1689
- e.append(k, C);
1737
+ e.append(k, P);
1690
1738
  };
1691
- e.if(I, (k) => {
1692
- e.get(t).enabled && k(b);
1739
+ e.if(z, (k) => {
1740
+ e.get(t).enabled && k(_);
1693
1741
  });
1694
1742
  }
1695
1743
  e.append(T, y);
@@ -1698,464 +1746,487 @@ function ia(r, a) {
1698
1746
  }), e.pop();
1699
1747
  }
1700
1748
  e.delegate(["change", "input"]);
1701
- var ra = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), oa = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), la = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), ca = e.from_html('<input type="range" step="1" min="-180" max="180" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="1" min="-180" max="180"/>', 1), ua = e.from_html('<input type="range" step="0.01" min="-2" max="2" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-2" max="2"/>', 1), da = e.from_html('<input type="range" step="0.01" min="0.1" max="3" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="0.1" max="3"/>', 1), pa = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), ma = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), va = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), fa = e.from_html('<input type="range" step="1" min="-100" max="100" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="1" min="-100" max="100"/>', 1), ha = e.from_html('<input type="range" step="1" min="-100" max="100" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="1" min="-100" max="100"/>', 1), _a = e.from_html('<details class="section svelte-1f6utug" open=""><summary class="section-title svelte-1f6utug">Restyle</summary> <div class="section-content svelte-1f6utug"><details class="subsection svelte-1f6utug" open=""><summary class="subsection-title svelte-1f6utug">Basic Adjustments</summary> <div class="subsection-content svelte-1f6utug"><!> <!> <!> <!></div></details> <details class="subsection svelte-1f6utug" open=""><summary class="subsection-title svelte-1f6utug">Exposure & Tone</summary> <div class="subsection-content svelte-1f6utug"><!> <!> <!> <!></div></details> <details class="subsection svelte-1f6utug" open=""><summary class="subsection-title svelte-1f6utug">Color & White Balance</summary> <div class="subsection-content svelte-1f6utug"><!> <!> <!></div></details></div></details>');
1702
- function ga(r, a) {
1703
- e.push(a, !0);
1704
- let t = e.prop(a, "effect", 3, ee);
1705
- function s(u) {
1706
- a.onChange({ ...t(), ...u });
1749
+ var gr = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), br = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), _r = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), yr = e.from_html('<input type="range" step="1" min="-180" max="180" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="1" min="-180" max="180"/>', 1), wr = e.from_html('<input type="range" step="0.01" min="-2" max="2" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-2" max="2"/>', 1), xr = e.from_html('<input type="range" step="0.01" min="0.1" max="3" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="0.1" max="3"/>', 1), kr = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), Mr = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), Tr = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), Sr = e.from_html('<input type="range" step="1" min="-100" max="100" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="1" min="-100" max="100"/>', 1), Ir = e.from_html('<input type="range" step="1" min="-100" max="100" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="1" min="-100" max="100"/>', 1), zr = e.from_html('<details class="section svelte-1f6utug" open=""><summary class="section-title svelte-1f6utug">Restyle</summary> <div class="section-content svelte-1f6utug"><details class="subsection svelte-1f6utug" open=""><summary class="subsection-title svelte-1f6utug">Basic Adjustments</summary> <div class="subsection-content svelte-1f6utug"><!> <!> <!> <!></div></details> <details class="subsection svelte-1f6utug" open=""><summary class="subsection-title svelte-1f6utug">Exposure & Tone</summary> <div class="subsection-content svelte-1f6utug"><!> <!> <!> <!></div></details> <details class="subsection svelte-1f6utug" open=""><summary class="subsection-title svelte-1f6utug">Color & White Balance</summary> <div class="subsection-content svelte-1f6utug"><!> <!> <!></div></details></div></details>');
1750
+ const Pr = {
1751
+ hash: "svelte-1f6utug",
1752
+ code: `.section.svelte-1f6utug {border-top:1px solid var(--color-border, #ccc);border-bottom:1px solid var(--color-border, #ccc);background:var(--color-surface, #fff);min-width:0;}.section-title.svelte-1f6utug {padding:0.75rem 0;font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);cursor:pointer;list-style:none;display:flex;align-items:center;gap:0.5rem;border-bottom:1px solid var(--color-border, #eee);}.section-title.svelte-1f6utug::-webkit-details-marker {display:none;}.section-title.svelte-1f6utug::before {content:'▶';font-size:0.625rem;transition:transform 0.15s ease;}.section[open].svelte-1f6utug > .section-title:where(.svelte-1f6utug)::before {transform:rotate(90deg);}.section-content.svelte-1f6utug {padding:0.75rem 0;display:flex;flex-direction:column;gap:0.75rem;}.manual-input.svelte-1f6utug {width:60px;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;}input[type="range"].svelte-1f6utug {flex:1;min-width:0;max-width:100%;}.subsection.svelte-1f6utug {margin-top:0.75rem;border-top:1px solid var(--color-border, #e0e0e0);}.subsection.svelte-1f6utug:first-child {margin-top:0;border-top:none;}.subsection-title.svelte-1f6utug {padding:0.5rem 0;font-size:0.75rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:var(--color-text-muted, #666);cursor:pointer;list-style:none;display:flex;align-items:center;gap:0.5rem;}.subsection-title.svelte-1f6utug::-webkit-details-marker {display:none;}.subsection-title.svelte-1f6utug::before {content:'▶';font-size:0.625rem;transition:transform 0.15s ease;}.subsection[open].svelte-1f6utug > .subsection-title:where(.svelte-1f6utug)::before {transform:rotate(90deg);}.subsection-content.svelte-1f6utug {padding-bottom:0.25rem;}`
1753
+ };
1754
+ function Cr(o, r) {
1755
+ e.push(r, !0), e.append_styles(o, Pr);
1756
+ let t = e.prop(r, "effect", 3, ee);
1757
+ function a(d) {
1758
+ r.onChange({ ...t(), ...d });
1707
1759
  }
1708
- var n = _a(), i = e.sibling(e.child(n), 2), l = e.child(i), f = e.sibling(e.child(l), 2), h = e.child(f);
1760
+ var n = zr(), s = e.sibling(e.child(n), 2), l = e.child(s), f = e.sibling(e.child(l), 2), h = e.child(f);
1709
1761
  F(h, {
1710
1762
  label: "Brightness",
1711
- onReset: () => s({ brightness: ee.brightness }),
1712
- children: (u, p) => {
1713
- var o = ra(), c = e.first_child(o);
1714
- e.remove_input_defaults(c), c.__input = (N) => s({ brightness: Number(N.currentTarget.value) });
1763
+ onReset: () => a({ brightness: ee.brightness }),
1764
+ children: (d, m) => {
1765
+ var i = gr(), c = e.first_child(i);
1766
+ e.remove_input_defaults(c), c.__input = (I) => a({ brightness: Number(I.currentTarget.value) });
1715
1767
  var M = e.sibling(c, 2);
1716
- e.remove_input_defaults(M), M.__input = (N) => s({ brightness: Number(N.currentTarget.value) }), e.template_effect(() => {
1768
+ e.remove_input_defaults(M), M.__input = (I) => a({ brightness: Number(I.currentTarget.value) }), e.template_effect(() => {
1717
1769
  e.set_value(c, t().brightness), e.set_value(M, t().brightness);
1718
- }), e.append(u, o);
1770
+ }), e.append(d, i);
1719
1771
  }
1720
1772
  });
1721
1773
  var w = e.sibling(h, 2);
1722
1774
  F(w, {
1723
1775
  label: "Contrast",
1724
- onReset: () => s({ contrast: ee.contrast }),
1725
- children: (u, p) => {
1726
- var o = oa(), c = e.first_child(o);
1727
- e.remove_input_defaults(c), c.__input = (N) => s({ contrast: Number(N.currentTarget.value) });
1776
+ onReset: () => a({ contrast: ee.contrast }),
1777
+ children: (d, m) => {
1778
+ var i = br(), c = e.first_child(i);
1779
+ e.remove_input_defaults(c), c.__input = (I) => a({ contrast: Number(I.currentTarget.value) });
1728
1780
  var M = e.sibling(c, 2);
1729
- e.remove_input_defaults(M), M.__input = (N) => s({ contrast: Number(N.currentTarget.value) }), e.template_effect(() => {
1781
+ e.remove_input_defaults(M), M.__input = (I) => a({ contrast: Number(I.currentTarget.value) }), e.template_effect(() => {
1730
1782
  e.set_value(c, t().contrast), e.set_value(M, t().contrast);
1731
- }), e.append(u, o);
1783
+ }), e.append(d, i);
1732
1784
  }
1733
1785
  });
1734
- var d = e.sibling(w, 2);
1735
- F(d, {
1786
+ var u = e.sibling(w, 2);
1787
+ F(u, {
1736
1788
  label: "Saturation",
1737
- onReset: () => s({ saturation: ee.saturation }),
1738
- children: (u, p) => {
1739
- var o = la(), c = e.first_child(o);
1740
- e.remove_input_defaults(c), c.__input = (N) => s({ saturation: Number(N.currentTarget.value) });
1789
+ onReset: () => a({ saturation: ee.saturation }),
1790
+ children: (d, m) => {
1791
+ var i = _r(), c = e.first_child(i);
1792
+ e.remove_input_defaults(c), c.__input = (I) => a({ saturation: Number(I.currentTarget.value) });
1741
1793
  var M = e.sibling(c, 2);
1742
- e.remove_input_defaults(M), M.__input = (N) => s({ saturation: Number(N.currentTarget.value) }), e.template_effect(() => {
1794
+ e.remove_input_defaults(M), M.__input = (I) => a({ saturation: Number(I.currentTarget.value) }), e.template_effect(() => {
1743
1795
  e.set_value(c, t().saturation), e.set_value(M, t().saturation);
1744
- }), e.append(u, o);
1796
+ }), e.append(d, i);
1745
1797
  }
1746
1798
  });
1747
- var _ = e.sibling(d, 2);
1748
- F(_, {
1799
+ var g = e.sibling(u, 2);
1800
+ F(g, {
1749
1801
  label: "Hue (°)",
1750
- onReset: () => s({ hue: ee.hue }),
1751
- children: (u, p) => {
1752
- var o = ca(), c = e.first_child(o);
1753
- e.remove_input_defaults(c), c.__input = (N) => s({ hue: Number(N.currentTarget.value) });
1802
+ onReset: () => a({ hue: ee.hue }),
1803
+ children: (d, m) => {
1804
+ var i = yr(), c = e.first_child(i);
1805
+ e.remove_input_defaults(c), c.__input = (I) => a({ hue: Number(I.currentTarget.value) });
1754
1806
  var M = e.sibling(c, 2);
1755
- e.remove_input_defaults(M), M.__input = (N) => s({ hue: Number(N.currentTarget.value) }), e.template_effect(() => {
1807
+ e.remove_input_defaults(M), M.__input = (I) => a({ hue: Number(I.currentTarget.value) }), e.template_effect(() => {
1756
1808
  e.set_value(c, t().hue), e.set_value(M, t().hue);
1757
- }), e.append(u, o);
1809
+ }), e.append(d, i);
1758
1810
  }
1759
1811
  }), e.reset(f), e.reset(l);
1760
- var m = e.sibling(l, 2), T = e.sibling(e.child(m), 2), v = e.child(T);
1812
+ var p = e.sibling(l, 2), T = e.sibling(e.child(p), 2), v = e.child(T);
1761
1813
  F(v, {
1762
1814
  label: "Exposure",
1763
- onReset: () => s({ exposure: ee.exposure }),
1764
- children: (u, p) => {
1765
- var o = ua(), c = e.first_child(o);
1766
- e.remove_input_defaults(c), c.__input = (N) => s({ exposure: Number(N.currentTarget.value) });
1815
+ onReset: () => a({ exposure: ee.exposure }),
1816
+ children: (d, m) => {
1817
+ var i = wr(), c = e.first_child(i);
1818
+ e.remove_input_defaults(c), c.__input = (I) => a({ exposure: Number(I.currentTarget.value) });
1767
1819
  var M = e.sibling(c, 2);
1768
- e.remove_input_defaults(M), M.__input = (N) => s({ exposure: Number(N.currentTarget.value) }), e.template_effect(() => {
1820
+ e.remove_input_defaults(M), M.__input = (I) => a({ exposure: Number(I.currentTarget.value) }), e.template_effect(() => {
1769
1821
  e.set_value(c, t().exposure), e.set_value(M, t().exposure);
1770
- }), e.append(u, o);
1822
+ }), e.append(d, i);
1771
1823
  }
1772
1824
  });
1773
1825
  var y = e.sibling(v, 2);
1774
1826
  F(y, {
1775
1827
  label: "Gamma",
1776
- onReset: () => s({ gamma: ee.gamma }),
1777
- children: (u, p) => {
1778
- var o = da(), c = e.first_child(o);
1779
- e.remove_input_defaults(c), c.__input = (N) => s({ gamma: Number(N.currentTarget.value) });
1828
+ onReset: () => a({ gamma: ee.gamma }),
1829
+ children: (d, m) => {
1830
+ var i = xr(), c = e.first_child(i);
1831
+ e.remove_input_defaults(c), c.__input = (I) => a({ gamma: Number(I.currentTarget.value) });
1780
1832
  var M = e.sibling(c, 2);
1781
- e.remove_input_defaults(M), M.__input = (N) => s({ gamma: Number(N.currentTarget.value) }), e.template_effect(() => {
1833
+ e.remove_input_defaults(M), M.__input = (I) => a({ gamma: Number(I.currentTarget.value) }), e.template_effect(() => {
1782
1834
  e.set_value(c, t().gamma), e.set_value(M, t().gamma);
1783
- }), e.append(u, o);
1835
+ }), e.append(d, i);
1784
1836
  }
1785
1837
  });
1786
1838
  var x = e.sibling(y, 2);
1787
1839
  F(x, {
1788
1840
  label: "Shadows",
1789
- onReset: () => s({ shadows: ee.shadows }),
1790
- children: (u, p) => {
1791
- var o = pa(), c = e.first_child(o);
1792
- e.remove_input_defaults(c), c.__input = (N) => s({ shadows: Number(N.currentTarget.value) });
1841
+ onReset: () => a({ shadows: ee.shadows }),
1842
+ children: (d, m) => {
1843
+ var i = kr(), c = e.first_child(i);
1844
+ e.remove_input_defaults(c), c.__input = (I) => a({ shadows: Number(I.currentTarget.value) });
1793
1845
  var M = e.sibling(c, 2);
1794
- e.remove_input_defaults(M), M.__input = (N) => s({ shadows: Number(N.currentTarget.value) }), e.template_effect(() => {
1846
+ e.remove_input_defaults(M), M.__input = (I) => a({ shadows: Number(I.currentTarget.value) }), e.template_effect(() => {
1795
1847
  e.set_value(c, t().shadows), e.set_value(M, t().shadows);
1796
- }), e.append(u, o);
1848
+ }), e.append(d, i);
1797
1849
  }
1798
1850
  });
1799
- var I = e.sibling(x, 2);
1800
- F(I, {
1851
+ var z = e.sibling(x, 2);
1852
+ F(z, {
1801
1853
  label: "Highlights",
1802
- onReset: () => s({ highlights: ee.highlights }),
1803
- children: (u, p) => {
1804
- var o = ma(), c = e.first_child(o);
1805
- e.remove_input_defaults(c), c.__input = (N) => s({ highlights: Number(N.currentTarget.value) });
1854
+ onReset: () => a({ highlights: ee.highlights }),
1855
+ children: (d, m) => {
1856
+ var i = Mr(), c = e.first_child(i);
1857
+ e.remove_input_defaults(c), c.__input = (I) => a({ highlights: Number(I.currentTarget.value) });
1806
1858
  var M = e.sibling(c, 2);
1807
- e.remove_input_defaults(M), M.__input = (N) => s({ highlights: Number(N.currentTarget.value) }), e.template_effect(() => {
1859
+ e.remove_input_defaults(M), M.__input = (I) => a({ highlights: Number(I.currentTarget.value) }), e.template_effect(() => {
1808
1860
  e.set_value(c, t().highlights), e.set_value(M, t().highlights);
1809
- }), e.append(u, o);
1861
+ }), e.append(d, i);
1810
1862
  }
1811
- }), e.reset(T), e.reset(m);
1812
- var b = e.sibling(m, 2), k = e.sibling(e.child(b), 2), C = e.child(k);
1813
- F(C, {
1863
+ }), e.reset(T), e.reset(p);
1864
+ var _ = e.sibling(p, 2), k = e.sibling(e.child(_), 2), P = e.child(k);
1865
+ F(P, {
1814
1866
  label: "Vibrance",
1815
- onReset: () => s({ vibrance: ee.vibrance }),
1816
- children: (u, p) => {
1817
- var o = va(), c = e.first_child(o);
1818
- e.remove_input_defaults(c), c.__input = (N) => s({ vibrance: Number(N.currentTarget.value) });
1867
+ onReset: () => a({ vibrance: ee.vibrance }),
1868
+ children: (d, m) => {
1869
+ var i = Tr(), c = e.first_child(i);
1870
+ e.remove_input_defaults(c), c.__input = (I) => a({ vibrance: Number(I.currentTarget.value) });
1819
1871
  var M = e.sibling(c, 2);
1820
- e.remove_input_defaults(M), M.__input = (N) => s({ vibrance: Number(N.currentTarget.value) }), e.template_effect(() => {
1872
+ e.remove_input_defaults(M), M.__input = (I) => a({ vibrance: Number(I.currentTarget.value) }), e.template_effect(() => {
1821
1873
  e.set_value(c, t().vibrance), e.set_value(M, t().vibrance);
1822
- }), e.append(u, o);
1874
+ }), e.append(d, i);
1823
1875
  }
1824
1876
  });
1825
- var S = e.sibling(C, 2);
1877
+ var S = e.sibling(P, 2);
1826
1878
  F(S, {
1827
1879
  label: "Temperature",
1828
- onReset: () => s({ temperature: ee.temperature }),
1829
- children: (u, p) => {
1830
- var o = fa(), c = e.first_child(o);
1831
- e.remove_input_defaults(c), c.__input = (N) => s({ temperature: Number(N.currentTarget.value) });
1880
+ onReset: () => a({ temperature: ee.temperature }),
1881
+ children: (d, m) => {
1882
+ var i = Sr(), c = e.first_child(i);
1883
+ e.remove_input_defaults(c), c.__input = (I) => a({ temperature: Number(I.currentTarget.value) });
1832
1884
  var M = e.sibling(c, 2);
1833
- e.remove_input_defaults(M), M.__input = (N) => s({ temperature: Number(N.currentTarget.value) }), e.template_effect(() => {
1885
+ e.remove_input_defaults(M), M.__input = (I) => a({ temperature: Number(I.currentTarget.value) }), e.template_effect(() => {
1834
1886
  e.set_value(c, t().temperature), e.set_value(M, t().temperature);
1835
- }), e.append(u, o);
1887
+ }), e.append(d, i);
1836
1888
  }
1837
1889
  });
1838
- var g = e.sibling(S, 2);
1839
- F(g, {
1890
+ var b = e.sibling(S, 2);
1891
+ F(b, {
1840
1892
  label: "Tint",
1841
- onReset: () => s({ tint: ee.tint }),
1842
- children: (u, p) => {
1843
- var o = ha(), c = e.first_child(o);
1844
- e.remove_input_defaults(c), c.__input = (N) => s({ tint: Number(N.currentTarget.value) });
1893
+ onReset: () => a({ tint: ee.tint }),
1894
+ children: (d, m) => {
1895
+ var i = Ir(), c = e.first_child(i);
1896
+ e.remove_input_defaults(c), c.__input = (I) => a({ tint: Number(I.currentTarget.value) });
1845
1897
  var M = e.sibling(c, 2);
1846
- e.remove_input_defaults(M), M.__input = (N) => s({ tint: Number(N.currentTarget.value) }), e.template_effect(() => {
1898
+ e.remove_input_defaults(M), M.__input = (I) => a({ tint: Number(I.currentTarget.value) }), e.template_effect(() => {
1847
1899
  e.set_value(c, t().tint), e.set_value(M, t().tint);
1848
- }), e.append(u, o);
1900
+ }), e.append(d, i);
1849
1901
  }
1850
- }), e.reset(k), e.reset(b), e.reset(i), e.reset(n), e.append(r, n), e.pop();
1902
+ }), e.reset(k), e.reset(_), e.reset(s), e.reset(n), e.append(o, n), e.pop();
1851
1903
  }
1852
1904
  e.delegate(["input"]);
1853
- var ba = e.from_html('<div class="layer-name-section svelte-et76o3"><label class="form-label svelte-et76o3">Layer Name (for overrides)</label> <input type="text" class="form-input svelte-et76o3" placeholder="e.g., front, back, logo"/> <p class="form-hint svelte-et76o3">Use this name as the key when overriding images in the renderer</p></div>'), ya = e.from_html('<div class="layer-controls svelte-et76o3"><div class="layer-header svelte-et76o3"><button class="visibility-toggle svelte-et76o3"><!></button> <span class="layer-preview svelte-et76o3"><img alt="Layer preview" class="svelte-et76o3"/></span> <button class="delete-btn svelte-et76o3" aria-label="Delete layer"><!></button></div> <!> <div class="sections svelte-et76o3"><!> <!> <!> <!></div></div>');
1854
- function wa(r, a) {
1855
- e.push(a, !0);
1856
- const t = e.derived(() => a.layer.effects.find((c) => c.type === "resize") ?? fe), s = e.derived(() => a.layer.effects.find((c) => c.type === "restyle") ?? ee), n = e.derived(() => a.layer.effects.find((o) => o.type === "warp"));
1857
- function i(o) {
1858
- const c = a.layer.effects.filter((M) => M.type !== "resize");
1859
- a.onEffectsChange([...c, o]);
1860
- }
1861
- function l(o) {
1862
- const c = a.layer.effects.filter((M) => M.type !== "restyle");
1863
- a.onEffectsChange([...c, o]);
1864
- }
1865
- function f(o) {
1866
- const c = a.layer.effects.filter((M) => M.type !== "warp");
1867
- o ? a.onEffectsChange([...c, o]) : a.onEffectsChange(c);
1868
- }
1869
- var h = ya(), w = e.child(h), d = e.child(w);
1870
- d.__click = () => a.onVisibilityChange(!a.layer.visible);
1871
- var _ = e.child(d);
1905
+ var Nr = e.from_html('<div class="layer-name-section svelte-et76o3"><label class="form-label svelte-et76o3">Layer Name (for overrides)</label> <input type="text" class="form-input svelte-et76o3" placeholder="e.g., front, back, logo"/> <p class="form-hint svelte-et76o3">Use this name as the key when overriding images in the renderer</p></div>'), Rr = e.from_html('<div class="layer-controls svelte-et76o3"><div class="layer-header svelte-et76o3"><button class="visibility-toggle svelte-et76o3"><!></button> <span class="layer-preview svelte-et76o3"><img alt="Layer preview" class="svelte-et76o3"/></span> <button class="delete-btn svelte-et76o3" aria-label="Delete layer"><!></button></div> <!> <div class="sections svelte-et76o3"><!> <!> <!> <!></div></div>');
1906
+ const jr = {
1907
+ hash: "svelte-et76o3",
1908
+ code: ".layer-controls.svelte-et76o3 {border-radius:4px;padding-top:0.75rem;padding-bottom:0.75rem;margin-bottom:0.5rem;background:var(--color-surface, #fff);}.layer-header.svelte-et76o3 {display:flex;align-items:center;gap:0.5rem;margin-bottom:0.75rem;padding-bottom:0.75rem;border-bottom:1px solid var(--color-border, #eee);}.visibility-toggle.svelte-et76o3 {background:none;border:none;cursor:pointer;padding:0.25rem;display:flex;align-items:center;justify-content:center;color:var(--color-text, #000);}.layer-preview.svelte-et76o3 {flex:1;display:flex;align-items:center;justify-content:center;height:40px;overflow:hidden;border-radius:4px;background:#f5f5f5;}.layer-preview.svelte-et76o3 img:where(.svelte-et76o3) {max-width:100%;max-height:100%;object-fit:contain;}.delete-btn.svelte-et76o3 {background:#ef4444;color:white;border:none;border-radius:4px;width:24px;height:24px;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;}.delete-btn.svelte-et76o3:hover {background:#dc2626;}.layer-name-section.svelte-et76o3 {padding:0 0.75rem;margin-bottom:0.75rem;}.layer-name-section.svelte-et76o3 .form-label:where(.svelte-et76o3) {display:block;font-size:0.75rem;font-weight:500;color:var(--color-text-muted, #666);margin-bottom:0.25rem;text-transform:uppercase;letter-spacing:0.5px;}.layer-name-section.svelte-et76o3 .form-input:where(.svelte-et76o3) {width:100%;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;font-family:inherit;}.layer-name-section.svelte-et76o3 .form-input:where(.svelte-et76o3):focus {outline:none;border-color:var(--color-primary, #3b82f6);}.form-hint.svelte-et76o3 {font-size:0.75rem;color:var(--color-text-muted, #666);margin:0.25rem 0 0 0;}.sections.svelte-et76o3 {display:flex;flex-direction:column;gap:0;overflow:hidden;min-width:0;}"
1909
+ };
1910
+ function Wr(o, r) {
1911
+ e.push(r, !0), e.append_styles(o, jr);
1912
+ const t = e.derived(() => r.layer.effects.find((c) => c.type === "resize") ?? fe), a = e.derived(() => r.layer.effects.find((c) => c.type === "restyle") ?? ee), n = e.derived(() => r.layer.effects.find((i) => i.type === "warp"));
1913
+ function s(i) {
1914
+ const c = r.layer.effects.filter((M) => M.type !== "resize");
1915
+ r.onEffectsChange([...c, i]);
1916
+ }
1917
+ function l(i) {
1918
+ const c = r.layer.effects.filter((M) => M.type !== "restyle");
1919
+ r.onEffectsChange([...c, i]);
1920
+ }
1921
+ function f(i) {
1922
+ const c = r.layer.effects.filter((M) => M.type !== "warp");
1923
+ i ? r.onEffectsChange([...c, i]) : r.onEffectsChange(c);
1924
+ }
1925
+ var h = Rr(), w = e.child(h), u = e.child(w);
1926
+ u.__click = () => r.onVisibilityChange(!r.layer.visible);
1927
+ var g = e.child(u);
1872
1928
  {
1873
- var m = (o) => {
1874
- on(o, {});
1875
- }, T = (o) => {
1876
- cn(o, {});
1929
+ var p = (i) => {
1930
+ pn(i, {});
1931
+ }, T = (i) => {
1932
+ fn(i, {});
1877
1933
  };
1878
- e.if(_, (o) => {
1879
- a.layer.visible ? o(m) : o(T, !1);
1934
+ e.if(g, (i) => {
1935
+ r.layer.visible ? i(p) : i(T, !1);
1880
1936
  });
1881
1937
  }
1882
- e.reset(d);
1883
- var v = e.sibling(d, 2), y = e.child(v);
1938
+ e.reset(u);
1939
+ var v = e.sibling(u, 2), y = e.child(v);
1884
1940
  e.reset(v);
1885
1941
  var x = e.sibling(v, 2);
1886
- x.__click = function(...o) {
1887
- a.onDelete?.apply(this, o);
1942
+ x.__click = function(...i) {
1943
+ r.onDelete?.apply(this, i);
1888
1944
  };
1889
- var I = e.child(x);
1890
- Ue(I, {}), e.reset(x), e.reset(w);
1891
- var b = e.sibling(w, 2);
1945
+ var z = e.child(x);
1946
+ Ae(z, {}), e.reset(x), e.reset(w);
1947
+ var _ = e.sibling(w, 2);
1892
1948
  {
1893
- var k = (o) => {
1894
- var c = ba(), M = e.child(c), N = e.sibling(M, 2);
1895
- e.remove_input_defaults(N), N.__input = (B) => a.onNameChange(B.currentTarget.value), e.next(2), e.reset(c), e.template_effect(() => {
1896
- e.set_attribute(M, "for", `layer-name-${a.layer.id ?? ""}`), e.set_attribute(N, "id", `layer-name-${a.layer.id ?? ""}`), e.set_value(N, a.layer.name || "");
1897
- }), e.append(o, c);
1949
+ var k = (i) => {
1950
+ var c = Nr(), M = e.child(c), I = e.sibling(M, 2);
1951
+ e.remove_input_defaults(I), I.__input = (X) => r.onNameChange(X.currentTarget.value), e.next(2), e.reset(c), e.template_effect(() => {
1952
+ e.set_attribute(M, "for", `layer-name-${r.layer.id ?? ""}`), e.set_attribute(I, "id", `layer-name-${r.layer.id ?? ""}`), e.set_value(I, r.layer.name || "");
1953
+ }), e.append(i, c);
1898
1954
  };
1899
- e.if(b, (o) => {
1900
- a.onNameChange && o(k);
1955
+ e.if(_, (i) => {
1956
+ r.onNameChange && i(k);
1901
1957
  });
1902
1958
  }
1903
- var C = e.sibling(b, 2), S = e.child(C);
1904
- In(S, {
1959
+ var P = e.sibling(_, 2), S = e.child(P);
1960
+ Xn(S, {
1905
1961
  get effect() {
1906
1962
  return e.get(t);
1907
1963
  },
1908
- onChange: i
1964
+ onChange: s
1909
1965
  });
1910
- var g = e.sibling(S, 2);
1911
- ga(g, {
1966
+ var b = e.sibling(S, 2);
1967
+ Cr(b, {
1912
1968
  get effect() {
1913
- return e.get(s);
1969
+ return e.get(a);
1914
1970
  },
1915
1971
  onChange: l
1916
1972
  });
1917
- var u = e.sibling(g, 2);
1918
- yn(u, {
1973
+ var d = e.sibling(b, 2);
1974
+ zn(d, {
1919
1975
  get transform() {
1920
- return a.layer.transform;
1976
+ return r.layer.transform;
1921
1977
  },
1922
1978
  get opacity() {
1923
- return a.layer.opacity;
1979
+ return r.layer.opacity;
1924
1980
  },
1925
1981
  get canvasWidth() {
1926
- return a.canvasWidth;
1982
+ return r.canvasWidth;
1927
1983
  },
1928
1984
  get canvasHeight() {
1929
- return a.canvasHeight;
1985
+ return r.canvasHeight;
1930
1986
  },
1931
1987
  get onTransformChange() {
1932
- return a.onTransformChange;
1988
+ return r.onTransformChange;
1933
1989
  },
1934
1990
  get onOpacityChange() {
1935
- return a.onOpacityChange;
1991
+ return r.onOpacityChange;
1936
1992
  },
1937
1993
  get layerId() {
1938
- return a.layer.id;
1994
+ return r.layer.id;
1939
1995
  }
1940
1996
  });
1941
- var p = e.sibling(u, 2);
1942
- ia(p, {
1997
+ var m = e.sibling(d, 2);
1998
+ hr(m, {
1943
1999
  get effect() {
1944
2000
  return e.get(n);
1945
2001
  },
1946
2002
  onChange: f
1947
- }), e.reset(C), e.reset(h), e.template_effect(() => {
1948
- e.set_attribute(d, "aria-label", a.layer.visible ? "Hide layer" : "Show layer"), e.set_attribute(y, "src", a.layer.src);
1949
- }), e.append(r, h), e.pop();
2003
+ }), e.reset(P), e.reset(h), e.template_effect(() => {
2004
+ e.set_attribute(u, "aria-label", r.layer.visible ? "Hide layer" : "Show layer"), e.set_attribute(y, "src", r.layer.src);
2005
+ }), e.append(o, h), e.pop();
1950
2006
  }
1951
2007
  e.delegate(["click", "input"]);
1952
- var xa = e.from_html('<button type="button" class="modal-backdrop svelte-ta60gp" aria-label="Close modal"></button> <div><!></div>', 1);
1953
- function ka(r, a) {
1954
- e.push(a, !0);
1955
- let t = !1, s = !1;
1956
- const n = St && /iPhone|iPad|iPod/.test(navigator.userAgent) && !("MSStream" in window);
1957
- function i(T) {
2008
+ var Yr = e.from_html('<button type="button" class="modal-backdrop svelte-ta60gp" aria-label="Close modal"></button> <div><!></div>', 1);
2009
+ const Dr = {
2010
+ hash: "svelte-ta60gp",
2011
+ code: ".modal-backdrop.svelte-ta60gp {position:fixed;inset:0;z-index:10000;background:var(--color-overlay-darker);backdrop-filter:blur(4px);border:none;padding:0;margin:0;cursor:pointer;border-radius:unset;}.modal-backdrop.svelte-ta60gp:hover {background:var(--color-overlay-darker) !important;}.modal-content.svelte-ta60gp {position:fixed;top:0;left:0;right:0;height:100dvh;z-index:10001;overflow-y:auto;-webkit-overflow-scrolling:touch;pointer-events:none;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);}.modal-content.ios-safari.svelte-ta60gp {height:100dvh;overflow-y:auto;}.modal-content.svelte-ta60gp > * {pointer-events:auto;margin:0 auto;}"
2012
+ };
2013
+ function Xr(o, r) {
2014
+ e.push(r, !0), e.append_styles(o, Dr);
2015
+ let t = !1, a = !1;
2016
+ const n = zt && /iPhone|iPad|iPod/.test(navigator.userAgent) && !("MSStream" in window);
2017
+ function s(T) {
1958
2018
  T.key === "Escape" && (T.preventDefault(), f());
1959
2019
  }
1960
2020
  function l() {
1961
- t && (t = !1, a.onclose());
2021
+ t && (t = !1, r.onclose());
1962
2022
  }
1963
2023
  function f() {
1964
- t && (t = !1, history.back()), a.onclose();
2024
+ t && (t = !1, history.back()), r.onclose();
1965
2025
  }
1966
- Mt(() => {
1967
- s = !0;
1968
- }), Te(() => (n || (document.documentElement.style.overflow = "hidden", document.body.style.overflow = "hidden"), Tt("", { modal: !0 }), t = !0, () => {
1969
- n || (document.documentElement.style.overflow = "", document.body.style.overflow = ""), t && !s && history.back();
2026
+ St(() => {
2027
+ a = !0;
2028
+ }), Te(() => (n || (document.documentElement.style.overflow = "hidden", document.body.style.overflow = "hidden"), It("", { modal: !0 }), t = !0, () => {
2029
+ n || (document.documentElement.style.overflow = "", document.body.style.overflow = ""), t && !a && history.back();
1970
2030
  }));
1971
- var h = xa();
1972
- e.event("keydown", e.window, i), e.event("popstate", e.window, l);
2031
+ var h = Yr();
2032
+ e.event("keydown", e.window, s), e.event("popstate", e.window, l);
1973
2033
  var w = e.first_child(h);
1974
2034
  w.__click = f;
1975
- var d = e.sibling(w, 2);
1976
- let _;
1977
- var m = e.child(d);
1978
- e.snippet(m, () => a.children), e.reset(d), e.template_effect(() => _ = e.set_class(d, 1, "modal-content svelte-ta60gp", null, _, { "ios-safari": n })), e.transition(7, w, () => Qe, () => ({ duration: 100 })), e.transition(7, d, () => Qe, () => ({ duration: 100 })), e.append(r, h), e.pop();
2035
+ var u = e.sibling(w, 2);
2036
+ let g;
2037
+ var p = e.child(u);
2038
+ e.snippet(p, () => r.children), e.reset(u), e.template_effect(() => g = e.set_class(u, 1, "modal-content svelte-ta60gp", null, g, { "ios-safari": n })), e.transition(7, w, () => $e, () => ({ duration: 100 })), e.transition(7, u, () => $e, () => ({ duration: 100 })), e.append(o, h), e.pop();
1979
2039
  }
1980
2040
  e.delegate(["click"]);
1981
- var Ma = e.from_svg('<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke-width="2"><path d="M12 5v14M5 12h14"></path></svg>');
1982
- function Me(r, a) {
1983
- let t = e.prop(a, "fontSize", 3, "1em"), s = e.prop(a, "color", 3, "currentColor");
1984
- var n = Ma();
2041
+ var Zr = e.from_svg('<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke-width="2"><path d="M12 5v14M5 12h14"></path></svg>');
2042
+ function Me(o, r) {
2043
+ let t = e.prop(r, "fontSize", 3, "1em"), a = e.prop(r, "color", 3, "currentColor");
2044
+ var n = Zr();
1985
2045
  e.template_effect(() => {
1986
- e.set_style(n, `font-size: ${t() ?? ""};`), e.set_attribute(n, "stroke", s());
1987
- }), e.append(r, n);
2046
+ e.set_style(n, `font-size: ${t() ?? ""};`), e.set_attribute(n, "stroke", a());
2047
+ }), e.append(o, n);
1988
2048
  }
1989
- const Pe = "product-mockups", it = "product-mockups-current";
1990
- function Ta(r, a = Pe) {
2049
+ const Ce = "product-mockups", it = "product-mockups-current";
2050
+ function Br(o, r = Ce) {
1991
2051
  try {
1992
- const t = Re(), s = t.findIndex((n) => n.id === r.id);
1993
- return s >= 0 ? t[s] = { ...r, updatedAt: Date.now() } : t.push({ ...r, updatedAt: Date.now() }), localStorage.setItem(a, JSON.stringify(t)), !0;
2052
+ const t = Ne(), a = t.findIndex((n) => n.id === o.id);
2053
+ return a >= 0 ? t[a] = { ...o, updatedAt: Date.now() } : t.push({ ...o, updatedAt: Date.now() }), localStorage.setItem(r, JSON.stringify(t)), !0;
1994
2054
  } catch (t) {
1995
2055
  return console.error("Failed to save mockup:", t), !1;
1996
2056
  }
1997
2057
  }
1998
- function Re(r = Pe) {
2058
+ function Ne(o = Ce) {
1999
2059
  try {
2000
- const a = localStorage.getItem(r);
2001
- return a ? JSON.parse(a).map((s) => {
2002
- const n = s.composition ?? s.canvas ?? { ...st };
2060
+ const r = localStorage.getItem(o);
2061
+ return r ? JSON.parse(r).map((a) => {
2062
+ const n = a.composition ?? a.canvas ?? { ...ot };
2003
2063
  return {
2004
- ...s,
2005
- view: s.view ?? { ...Ce },
2064
+ ...a,
2065
+ view: a.view ?? { ...Pe },
2006
2066
  composition: {
2007
2067
  ...n,
2008
2068
  effects: n.effects ?? [],
2009
- layers: n.layers?.map((i) => ({
2010
- ...i,
2011
- effects: i.effects ?? []
2069
+ layers: n.layers?.map((s) => ({
2070
+ ...s,
2071
+ effects: s.effects ?? []
2012
2072
  })) ?? []
2013
2073
  }
2014
2074
  };
2015
2075
  }) : [];
2016
- } catch (a) {
2017
- return console.error("Failed to load mockups:", a), [];
2076
+ } catch (r) {
2077
+ return console.error("Failed to load mockups:", r), [];
2018
2078
  }
2019
2079
  }
2020
- function Sa(r, a = Pe) {
2021
- return Re(a).find((s) => s.id === r) ?? null;
2080
+ function Lr(o, r = Ce) {
2081
+ return Ne(r).find((a) => a.id === o) ?? null;
2022
2082
  }
2023
- function Na(r, a = Pe) {
2083
+ function qr(o, r = Ce) {
2024
2084
  try {
2025
- const s = Re(a).filter((n) => n.id !== r);
2026
- return localStorage.setItem(a, JSON.stringify(s)), !0;
2085
+ const a = Ne(r).filter((n) => n.id !== o);
2086
+ return localStorage.setItem(r, JSON.stringify(a)), !0;
2027
2087
  } catch (t) {
2028
2088
  return console.error("Failed to delete mockup:", t), !1;
2029
2089
  }
2030
2090
  }
2031
- function je(r, a = it) {
2091
+ function Ee(o, r = it) {
2032
2092
  try {
2033
- r ? localStorage.setItem(a, r) : localStorage.removeItem(a);
2093
+ o ? localStorage.setItem(r, o) : localStorage.removeItem(r);
2034
2094
  } catch (t) {
2035
2095
  console.error("Failed to save current mockup ID:", t);
2036
2096
  }
2037
2097
  }
2038
- function Ia(r = it) {
2098
+ function Er(o = it) {
2039
2099
  try {
2040
- return localStorage.getItem(r);
2100
+ return localStorage.getItem(o);
2041
2101
  } catch {
2042
2102
  return null;
2043
2103
  }
2044
2104
  }
2045
- function tt(r = "Untitled Mockup") {
2105
+ function nt(o = "Untitled Mockup") {
2046
2106
  return {
2047
2107
  id: crypto.randomUUID(),
2048
- name: r,
2049
- composition: { ...st },
2050
- view: { ...Ce },
2108
+ name: o,
2109
+ composition: { ...ot },
2110
+ view: { ...Pe },
2051
2111
  createdAt: Date.now(),
2052
2112
  updatedAt: Date.now()
2053
2113
  };
2054
2114
  }
2055
- var Ca = e.from_html('<div class="empty-state svelte-33nadc"><p class="svelte-33nadc">No mockups yet. Create your first mockup to get started!</p> <button class="new-mockup-btn primary svelte-33nadc" type="button"><!> Create Mockup</button></div>'), Pa = e.from_html('<div role="button" tabindex="0"><div class="mockup-card-header svelte-33nadc"><h3 class="mockup-card-title svelte-33nadc"> </h3> <div class="mockup-card-actions svelte-33nadc"><button class="copy-btn svelte-33nadc" type="button" aria-label="Copy config">Copy Config</button> <button class="delete-btn svelte-33nadc" type="button" aria-label="Delete mockup"><!></button></div></div> <div class="mockup-card-info svelte-33nadc"><div class="mockup-card-stat svelte-33nadc"><span class="stat-label svelte-33nadc">Layers:</span> <span class="stat-value svelte-33nadc"> </span></div> <div class="mockup-card-stat svelte-33nadc"><span class="stat-label svelte-33nadc">Size:</span> <span class="stat-value svelte-33nadc"> </span></div></div> <div class="mockup-card-footer svelte-33nadc"><div class="mockup-card-date svelte-33nadc"><span class="date-label svelte-33nadc">Updated:</span> <span class="date-value svelte-33nadc"> </span></div></div></div>'), Ra = e.from_html('<div class="mockup-grid svelte-33nadc"></div>'), Wa = e.from_html('<div class="mockup-list-container svelte-33nadc"><div class="mockup-list-header svelte-33nadc"><h2 class="svelte-33nadc">All Mockups</h2> <button class="new-mockup-btn svelte-33nadc" type="button"><!> New Mockup</button></div> <!></div>');
2056
- function za(r, a) {
2057
- e.push(a, !0);
2058
- let t = e.prop(a, "storageKey", 3, "product-mockups"), s = e.state(e.proxy([]));
2115
+ var Or = e.from_html('<div class="empty-state svelte-33nadc"><p class="svelte-33nadc">No mockups yet. Create your first mockup to get started!</p> <button class="new-mockup-btn primary svelte-33nadc" type="button"><!> Create Mockup</button></div>'), Vr = e.from_html('<div role="button" tabindex="0"><div class="mockup-card-header svelte-33nadc"><h3 class="mockup-card-title svelte-33nadc"> </h3> <div class="mockup-card-actions svelte-33nadc"><button class="copy-btn svelte-33nadc" type="button" aria-label="Copy config">Copy Config</button> <button class="delete-btn svelte-33nadc" type="button" aria-label="Delete mockup"><!></button></div></div> <div class="mockup-card-info svelte-33nadc"><div class="mockup-card-stat svelte-33nadc"><span class="stat-label svelte-33nadc">Layers:</span> <span class="stat-value svelte-33nadc"> </span></div> <div class="mockup-card-stat svelte-33nadc"><span class="stat-label svelte-33nadc">Size:</span> <span class="stat-value svelte-33nadc"> </span></div></div> <div class="mockup-card-footer svelte-33nadc"><div class="mockup-card-date svelte-33nadc"><span class="date-label svelte-33nadc">Updated:</span> <span class="date-value svelte-33nadc"> </span></div></div></div>'), Ur = e.from_html('<div class="mockup-grid svelte-33nadc"></div>'), Ar = e.from_html('<div class="mockup-list-container svelte-33nadc"><div class="mockup-list-header svelte-33nadc"><h2 class="svelte-33nadc">All Mockups</h2> <button class="new-mockup-btn svelte-33nadc" type="button"><!> New Mockup</button></div> <!></div>');
2116
+ const Hr = {
2117
+ hash: "svelte-33nadc",
2118
+ code: ".mockup-list-container.svelte-33nadc {background:var(--color-surface, #fff);border-radius:8px;padding:2rem;max-width:900px;width:100%;margin:2rem auto;max-height:calc(100dvh - 4rem);overflow-y:auto;box-shadow:0 10px 40px rgba(0, 0, 0, 0.2);}.mockup-list-header.svelte-33nadc {display:flex;align-items:center;justify-content:space-between;margin-bottom:2rem;gap:1rem;}.mockup-list-header.svelte-33nadc h2:where(.svelte-33nadc) {font-size:1.5rem;font-weight:600;color:var(--color-text, #111);margin:0;}.new-mockup-btn.svelte-33nadc {display:flex;align-items:center;gap:0.5rem;padding:0.5rem 1rem;background:var(--color-primary, #3b82f6);color:white;border:none;border-radius:6px;cursor:pointer;font-size:0.875rem;font-weight:500;transition:background 200ms;}.new-mockup-btn.svelte-33nadc:hover {background:var(--color-primary-dark, #2563eb);}.new-mockup-btn.primary.svelte-33nadc {margin-top:1rem;}.empty-state.svelte-33nadc {text-align:center;padding:4rem 2rem;color:var(--color-text-muted, #666);}.empty-state.svelte-33nadc p:where(.svelte-33nadc) {font-size:1rem;margin-bottom:1.5rem;}.mockup-grid.svelte-33nadc {display:grid;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));gap:1rem;}.mockup-card.svelte-33nadc {background:var(--color-surface-alt, #f5f5f5);border:2px solid var(--color-border, #ccc);border-radius:8px;padding:1rem;cursor:pointer;transition:all 200ms;display:flex;flex-direction:column;gap:0.75rem;}.mockup-card.svelte-33nadc:hover {border-color:var(--color-primary, #3b82f6);background:var(--color-surface, #fff);transform:translateY(-2px);box-shadow:0 4px 12px rgba(0, 0, 0, 0.1);}.mockup-card.current.svelte-33nadc {border-color:var(--color-primary, #3b82f6);background:var(--color-primary-light, #eff6ff);}.mockup-card-header.svelte-33nadc {display:flex;align-items:flex-start;justify-content:space-between;gap:0.5rem;}.mockup-card-title.svelte-33nadc {font-size:1rem;font-weight:600;color:var(--color-text, #111);margin:0;flex:1;word-break:break-word;}.mockup-card-actions.svelte-33nadc {display:flex;align-items:center;gap:0.5rem;flex-shrink:0;}.copy-btn.svelte-33nadc {background:transparent;border:1px solid var(--color-primary, #3b82f6);color:var(--color-primary, #3b82f6);cursor:pointer;padding:0.25rem 0.5rem;border-radius:4px;font-size:0.75rem;transition:all 200ms;display:flex;align-items:center;justify-content:center;}.copy-btn.svelte-33nadc:hover {background:var(--color-primary, #3b82f6);color:white;}.delete-btn.svelte-33nadc {background:transparent;border:none;color:var(--color-text-muted, #666);cursor:pointer;padding:0.25rem;border-radius:4px;display:flex;align-items:center;justify-content:center;transition:all 200ms;flex-shrink:0;}.delete-btn.svelte-33nadc:hover {background:#ef4444;color:white;}.mockup-card-info.svelte-33nadc {display:flex;gap:1rem;font-size:0.875rem;}.mockup-card-stat.svelte-33nadc {display:flex;flex-direction:column;gap:0.25rem;}.stat-label.svelte-33nadc {color:var(--color-text-muted, #666);font-size:0.75rem;text-transform:uppercase;}.stat-value.svelte-33nadc {color:var(--color-text, #111);font-weight:500;}.mockup-card-footer.svelte-33nadc {margin-top:auto;padding-top:0.75rem;border-top:1px solid var(--color-border, #ccc);}.mockup-card-date.svelte-33nadc {display:flex;flex-direction:column;gap:0.25rem;font-size:0.75rem;}.date-label.svelte-33nadc {color:var(--color-text-muted, #666);text-transform:uppercase;}.date-value.svelte-33nadc {color:var(--color-text, #111);}"
2119
+ };
2120
+ function Fr(o, r) {
2121
+ e.push(r, !0), e.append_styles(o, Hr);
2122
+ let t = e.prop(r, "storageKey", 3, "product-mockups"), a = e.state(e.proxy([]));
2059
2123
  function n() {
2060
- e.set(s, Re(t()), !0);
2124
+ e.set(a, Ne(t()), !0);
2061
2125
  }
2062
2126
  Te(() => {
2063
2127
  n();
2064
2128
  });
2065
- function i(d) {
2066
- a.onSelect(d), a.onclose();
2129
+ function s(u) {
2130
+ r.onSelect(u), r.onclose();
2067
2131
  }
2068
2132
  function l() {
2069
- a.onNew(), a.onclose();
2133
+ r.onNew(), r.onclose();
2070
2134
  }
2071
- function f(d, _) {
2072
- d.stopPropagation(), confirm("Are you sure you want to delete this mockup?") && (Na(_, t()), n());
2135
+ function f(u, g) {
2136
+ u.stopPropagation(), confirm("Are you sure you want to delete this mockup?") && (qr(g, t()), n());
2073
2137
  }
2074
- async function h(d, _) {
2075
- d.stopPropagation();
2138
+ async function h(u, g) {
2139
+ u.stopPropagation();
2076
2140
  try {
2077
- const m = JSON.stringify(_, null, 2);
2078
- await navigator.clipboard.writeText(m);
2079
- } catch (m) {
2080
- console.error("Failed to copy config:", m);
2141
+ const p = JSON.stringify(g, null, 2);
2142
+ await navigator.clipboard.writeText(p);
2143
+ } catch (p) {
2144
+ console.error("Failed to copy config:", p);
2081
2145
  }
2082
2146
  }
2083
- function w(d) {
2084
- const _ = new Date(d);
2085
- return _.toLocaleDateString() + " " + _.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
2147
+ function w(u) {
2148
+ const g = new Date(u);
2149
+ return g.toLocaleDateString() + " " + g.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
2086
2150
  }
2087
- ka(r, {
2151
+ Xr(o, {
2088
2152
  get onclose() {
2089
- return a.onclose;
2153
+ return r.onclose;
2090
2154
  },
2091
- children: (d, _) => {
2092
- var m = Wa(), T = e.child(m), v = e.sibling(e.child(T), 2);
2155
+ children: (u, g) => {
2156
+ var p = Ar(), T = e.child(p), v = e.sibling(e.child(T), 2);
2093
2157
  v.__click = l;
2094
2158
  var y = e.child(v);
2095
2159
  Me(y, {}), e.next(), e.reset(v), e.reset(T);
2096
2160
  var x = e.sibling(T, 2);
2097
2161
  {
2098
- var I = (k) => {
2099
- var C = Ca(), S = e.sibling(e.child(C), 2);
2162
+ var z = (k) => {
2163
+ var P = Or(), S = e.sibling(e.child(P), 2);
2100
2164
  S.__click = l;
2101
- var g = e.child(S);
2102
- Me(g, {}), e.next(), e.reset(S), e.reset(C), e.append(k, C);
2103
- }, b = (k) => {
2104
- var C = Ra();
2105
- e.each(C, 21, () => e.get(s), (S) => S.id, (S, g) => {
2106
- var u = Pa();
2107
- let p;
2108
- u.__click = () => i(e.get(g)), u.__keydown = (D) => D.key === "Enter" && i(e.get(g));
2109
- var o = e.child(u), c = e.child(o), M = e.child(c, !0);
2165
+ var b = e.child(S);
2166
+ Me(b, {}), e.next(), e.reset(S), e.reset(P), e.append(k, P);
2167
+ }, _ = (k) => {
2168
+ var P = Ur();
2169
+ e.each(P, 21, () => e.get(a), (S) => S.id, (S, b) => {
2170
+ var d = Vr();
2171
+ let m;
2172
+ d.__click = () => s(e.get(b)), d.__keydown = (W) => W.key === "Enter" && s(e.get(b));
2173
+ var i = e.child(d), c = e.child(i), M = e.child(c, !0);
2110
2174
  e.reset(c);
2111
- var N = e.sibling(c, 2), B = e.child(N);
2112
- B.__click = (D) => h(D, e.get(g));
2113
- var J = e.sibling(B, 2);
2114
- J.__click = (D) => f(D, e.get(g).id);
2115
- var Z = e.child(J);
2116
- Ue(Z, {}), e.reset(J), e.reset(N), e.reset(o);
2117
- var U = e.sibling(o, 2), z = e.child(U), E = e.sibling(e.child(z), 2), O = e.child(E, !0);
2118
- e.reset(E), e.reset(z);
2119
- var j = e.sibling(z, 2), L = e.sibling(e.child(j), 2), K = e.child(L);
2120
- e.reset(L), e.reset(j), e.reset(U);
2121
- var H = e.sibling(U, 2), G = e.child(H), X = e.sibling(e.child(G), 2), Y = e.child(X, !0);
2122
- e.reset(X), e.reset(G), e.reset(H), e.reset(u), e.template_effect(
2123
- (D) => {
2124
- p = e.set_class(u, 1, "mockup-card svelte-33nadc", null, p, { current: e.get(g).id === a.currentMockupId }), e.set_text(M, e.get(g).name), e.set_text(O, e.get(g).composition.layers.length), e.set_text(K, `${e.get(g).composition.width ?? ""} × ${e.get(g).composition.height ?? ""}`), e.set_text(Y, D);
2175
+ var I = e.sibling(c, 2), X = e.child(I);
2176
+ X.__click = (W) => h(W, e.get(b));
2177
+ var J = e.sibling(X, 2);
2178
+ J.__click = (W) => f(W, e.get(b).id);
2179
+ var B = e.child(J);
2180
+ Ae(B, {}), e.reset(J), e.reset(I), e.reset(i);
2181
+ var A = e.sibling(i, 2), j = e.child(A), Z = e.sibling(e.child(j), 2), L = e.child(Z, !0);
2182
+ e.reset(Z), e.reset(j);
2183
+ var E = e.sibling(j, 2), q = e.sibling(e.child(E), 2), K = e.child(q);
2184
+ e.reset(q), e.reset(E), e.reset(A);
2185
+ var V = e.sibling(A, 2), G = e.child(V), Y = e.sibling(e.child(G), 2), D = e.child(Y, !0);
2186
+ e.reset(Y), e.reset(G), e.reset(V), e.reset(d), e.template_effect(
2187
+ (W) => {
2188
+ m = e.set_class(d, 1, "mockup-card svelte-33nadc", null, m, { current: e.get(b).id === r.currentMockupId }), e.set_text(M, e.get(b).name), e.set_text(L, e.get(b).composition.layers.length), e.set_text(K, `${e.get(b).composition.width ?? ""} × ${e.get(b).composition.height ?? ""}`), e.set_text(D, W);
2125
2189
  },
2126
- [() => w(e.get(g).updatedAt)]
2127
- ), e.append(S, u);
2128
- }), e.reset(C), e.append(k, C);
2190
+ [() => w(e.get(b).updatedAt)]
2191
+ ), e.append(S, d);
2192
+ }), e.reset(P), e.append(k, P);
2129
2193
  };
2130
2194
  e.if(x, (k) => {
2131
- e.get(s).length === 0 ? k(I) : k(b, !1);
2195
+ e.get(a).length === 0 ? k(z) : k(_, !1);
2132
2196
  });
2133
2197
  }
2134
- e.reset(m), e.append(d, m);
2198
+ e.reset(p), e.append(u, p);
2135
2199
  },
2136
2200
  $$slots: { default: !0 }
2137
2201
  }), e.pop();
2138
2202
  }
2139
2203
  e.delegate(["click", "keydown"]);
2140
- var Da = e.from_svg('<svg width=".4em" height="1em" viewBox="8 2 8 20" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18l6-6-6-6"></path></svg>');
2141
- function nt(r, a) {
2142
- let t = e.prop(a, "fontSize", 3, "1em"), s = e.prop(a, "color", 3, "currentColor");
2143
- var n = Da();
2204
+ var Kr = e.from_svg('<svg width=".4em" height="1em" viewBox="8 2 8 20" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18l6-6-6-6"></path></svg>');
2205
+ function rt(o, r) {
2206
+ let t = e.prop(r, "fontSize", 3, "1em"), a = e.prop(r, "color", 3, "currentColor");
2207
+ var n = Kr();
2144
2208
  e.template_effect(() => {
2145
- e.set_style(n, `font-size: ${t() ?? ""}; ${(a.rotate && `rotate: ${a.rotate};`) ?? ""}`), e.set_attribute(n, "stroke", s());
2146
- }), e.append(r, n);
2209
+ e.set_style(n, `font-size: ${t() ?? ""}; ${(r.rotate && `rotate: ${r.rotate};`) ?? ""}`), e.set_attribute(n, "stroke", a());
2210
+ }), e.append(o, n);
2147
2211
  }
2148
- const Xa = "product-mockups", Ya = "product-mockups-current";
2149
- var Ba = e.from_html('<header class="header-logos svelte-w47swm"><!></header>'), Ea = e.from_html('<div class="url-input-group svelte-w47swm"><input type="url" placeholder="https://example.com/image.jpg" class="svelte-w47swm"/> <button type="button" class="svelte-w47swm">Add</button></div>'), Za = e.from_html('<div class="no-layers svelte-w47swm">No layers yet. Add an image to get started.</div>'), Oa = e.from_html('<code class="layer-key-badge svelte-w47swm"> </code>'), La = e.from_html('<div role="button" tabindex="0"><div class="layer-item-preview svelte-w47swm"><img alt="Layer preview" class="svelte-w47swm"/></div> <div class="layer-item-info svelte-w47swm"><span class="layer-item-name svelte-w47swm"> <!></span> <div class="layer-item-actions svelte-w47swm"><button class="layer-order-btn svelte-w47swm" aria-label="Move up"><!></button> <button class="layer-order-btn svelte-w47swm" aria-label="Move down"><!></button> <button class="layer-delete-btn svelte-w47swm" aria-label="Delete layer"><!></button></div></div></div>'), ja = e.from_html('<div class="layers-list svelte-w47swm"></div>'), qa = e.from_html('<div class="canvas-header svelte-w47swm"><!></div>'), Ha = e.from_html('<div class="processor-container svelte-w47swm"><sidebar class="svelte-w47swm"><!> <div class="editor-items svelte-w47swm"><div class="editor-section svelte-w47swm"><div class="mockup-name-header svelte-w47swm"><div class="mockup-title-group svelte-w47swm"><h3 class="mockup-name-title svelte-w47swm">Mockup</h3></div> <div class="mockup-buttons-group svelte-w47swm"><button class="new-mockup-btn svelte-w47swm" type="button"><!> New Mockup</button> <button class="view-all-btn svelte-w47swm" type="button">View All</button></div></div> <label class="form-label svelte-w47swm">Mockup Name</label> <div class="name-input-group svelte-w47swm"><input type="text" class="form-input name-input svelte-w47swm" placeholder="Mockup name..."/> <button class="copy-config-btn svelte-w47swm" type="button">Copy Config</button></div></div> <div class="editor-section svelte-w47swm"><div class="sidebar-title-2 svelte-w47swm">Canvas Setup</div> <div class="canvas-size-controls svelte-w47swm"><div class="form-input-group svelte-w47swm"><label class="form-label svelte-w47swm">Width</label> <input type="number" class="form-input svelte-w47swm" min="100" max="5000"/></div> <div class="form-input-group svelte-w47swm"><label class="form-label svelte-w47swm">Height</label> <input type="number" class="form-input svelte-w47swm" min="100" max="5000"/></div></div></div> <div class="editor-section svelte-w47swm"><div class="layers-header svelte-w47swm"><div class="layers-title svelte-w47swm"> </div> <div class="add-layer-buttons svelte-w47swm"><button class="add-layer-btn secondary svelte-w47swm" type="button"><!> </button> <label class="add-layer-btn svelte-w47swm"><!> File <input type="file" accept="image/*" style="display: none;"/></label></div></div> <!> <!></div> <!></div></sidebar> <div class="output-canvas svelte-w47swm"><!> <!></div> <!></div>');
2150
- function Ga(r, a) {
2151
- e.push(a, !0);
2152
- let t = e.prop(a, "storageKey", 3, Xa), s = e.prop(a, "currentMockupKey", 3, Ya), n = e.state(e.proxy(tt())), i = e.state(""), l = e.state(null), f = e.state(""), h = e.state(!1), w = e.state(!1), d = null;
2153
- e.derived(() => e.get(l) ? e.get(n).composition.layers.find((P) => P.id === e.get(l)) ?? null : null);
2154
- function _(P) {
2155
- const W = {
2212
+ const Jr = "product-mockups", Gr = "product-mockups-current";
2213
+ var $r = e.from_html('<header class="header-logos svelte-w47swm"><!></header>'), Qr = e.from_html('<div class="url-input-group svelte-w47swm"><input type="url" placeholder="https://example.com/image.jpg" class="svelte-w47swm"/> <button type="button" class="svelte-w47swm">Add</button></div>'), ea = e.from_html('<div class="no-layers svelte-w47swm">No layers yet. Add an image to get started.</div>'), ta = e.from_html('<code class="layer-key-badge svelte-w47swm"> </code>'), na = e.from_html('<div role="button" tabindex="0"><div class="layer-item-preview svelte-w47swm"><img alt="Layer preview" class="svelte-w47swm"/></div> <div class="layer-item-info svelte-w47swm"><span class="layer-item-name svelte-w47swm"> <!></span> <div class="layer-item-actions svelte-w47swm"><button class="layer-order-btn svelte-w47swm" aria-label="Move up"><!></button> <button class="layer-order-btn svelte-w47swm" aria-label="Move down"><!></button> <button class="layer-delete-btn svelte-w47swm" aria-label="Delete layer"><!></button></div></div></div>'), ra = e.from_html('<div class="layers-list svelte-w47swm"></div>'), aa = e.from_html('<div class="canvas-header svelte-w47swm"><!></div>'), sa = e.from_html('<div class="processor-container svelte-w47swm"><sidebar class="svelte-w47swm"><!> <div class="editor-items svelte-w47swm"><div class="editor-section svelte-w47swm"><div class="mockup-name-header svelte-w47swm"><div class="mockup-title-group svelte-w47swm"><h3 class="mockup-name-title svelte-w47swm">Mockup</h3></div> <div class="mockup-buttons-group svelte-w47swm"><button class="new-mockup-btn svelte-w47swm" type="button"><!> New Mockup</button> <button class="view-all-btn svelte-w47swm" type="button">View All</button></div></div> <label class="form-label svelte-w47swm">Mockup Name</label> <div class="name-input-group svelte-w47swm"><input type="text" class="form-input name-input svelte-w47swm" placeholder="Mockup name..."/> <button class="copy-config-btn svelte-w47swm" type="button">Copy Config</button></div></div> <div class="editor-section svelte-w47swm"><div class="sidebar-title-2 svelte-w47swm">Canvas Setup</div> <div class="canvas-size-controls svelte-w47swm"><div class="form-input-group svelte-w47swm"><label class="form-label svelte-w47swm">Width</label> <input type="number" class="form-input svelte-w47swm" min="100" max="5000"/></div> <div class="form-input-group svelte-w47swm"><label class="form-label svelte-w47swm">Height</label> <input type="number" class="form-input svelte-w47swm" min="100" max="5000"/></div></div></div> <div class="editor-section svelte-w47swm"><div class="layers-header svelte-w47swm"><div class="layers-title svelte-w47swm"> </div> <div class="add-layer-buttons svelte-w47swm"><button class="add-layer-btn secondary svelte-w47swm" type="button"><!> </button> <label class="add-layer-btn svelte-w47swm"><!> File <input type="file" accept="image/*" style="display: none;"/></label></div></div> <!> <!></div> <!></div></sidebar> <div class="output-canvas svelte-w47swm"><!> <!></div> <!></div>');
2214
+ const oa = {
2215
+ hash: "svelte-w47swm",
2216
+ code: `.form-label.svelte-w47swm {display:block;font-size:0.75rem;font-weight:500;color:var(--color-text-muted, #666);margin-bottom:0.375rem;}.form-input.svelte-w47swm {width:100%;padding-top:0.5rem;padding-bottom:0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;margin-bottom:1rem;}.form-input-group.svelte-w47swm .form-input:where(.svelte-w47swm) {margin-bottom:0;}.form-input.svelte-w47swm:focus {outline:none;border-color:var(--color-primary, #3b82f6);}.form-input-group.svelte-w47swm {display:flex;flex-direction:column;gap:0.25rem;}.processor-container.svelte-w47swm {display:flex;height:100%;overflow:hidden;}sidebar.svelte-w47swm {min-width:360px;flex-shrink:0;background:var(--color-surface, #fff);border-right:1px solid var(--color-border, #ccc);display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;padding-left:1rem;}.header-logos.svelte-w47swm {display:flex;gap:1rem;font-size:1.5rem;padding:0.5rem;padding-right:1rem;border-bottom:1px solid var(--color-border, #ccc);align-items:center;flex-wrap:wrap;}.editor-items.svelte-w47swm {flex:1;overflow-y:auto;padding:0;padding-right:0.5rem;display:flex;flex-direction:column;}.editor-section.svelte-w47swm {border-bottom:1px solid var(--color-border, #ccc);padding:0.25rem 0 0.75rem 0;}.output-canvas.svelte-w47swm {flex:1;display:flex;min-width:0;background:var(--color-bg, #f5f5f5);overflow:hidden;position:relative;flex-shrink:0;}.canvas-header.svelte-w47swm {display:none;}.sidebar-title-2.svelte-w47swm {font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);padding:0.75rem 0 0.25rem 0;margin-bottom:0.5rem;}.layers-header.svelte-w47swm {display:flex;align-items:center;justify-content:space-between;gap:0.5rem;margin-bottom:0.5rem;}.layers-title.svelte-w47swm {font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);flex:1;}.add-layer-buttons.svelte-w47swm {display:flex;gap:0.25rem;}.add-layer-btn.svelte-w47swm {padding:0.375rem 0.75rem;background:var(--color-primary, #3b82f6);color:white;border:none;border-radius:4px;cursor:pointer;font-size:0.875rem;transition:background 200ms;display:flex;align-items:center;gap:0.375rem;}.add-layer-btn.svelte-w47swm:hover {background:var(--color-primary-dark, #2563eb);}.add-layer-btn.secondary.svelte-w47swm {background:transparent;color:var(--color-text, #111);border:1px solid var(--color-border, #ccc);}.add-layer-btn.secondary.svelte-w47swm:hover {background:var(--color-bg, #f5f5f5);}.url-input-group.svelte-w47swm {display:flex;gap:0.5rem;margin-top:0.5rem;padding:0.75rem;background:var(--color-surface-alt, #f5f5f5);border-radius:4px;}.url-input-group.svelte-w47swm input:where(.svelte-w47swm) {flex:1;padding-top:0.375rem;padding-bottom:0.375rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;}.url-input-group.svelte-w47swm button:where(.svelte-w47swm) {padding:0.375rem 0.75rem;background:var(--color-primary, #3b82f6);color:white;border:none;border-radius:4px;cursor:pointer;font-size:0.875rem;transition:background 200ms;}.url-input-group.svelte-w47swm button:where(.svelte-w47swm):hover {background:var(--color-primary-dark, #2563eb);}.canvas-size-controls.svelte-w47swm {display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;margin-bottom:1rem;margin-top:0;}.form-input-group.svelte-w47swm {display:flex;flex-direction:column;}.no-layers.svelte-w47swm {padding:1rem;text-align:center;color:var(--color-text-muted, #666);font-size:0.875rem;}.layers-list.svelte-w47swm {display:flex;flex-direction:column;gap:0.5rem;}.layer-item.svelte-w47swm {display:flex;align-items:center;gap:0.5rem;padding:0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;cursor:pointer;transition:all 200ms;background:var(--color-surface, #fff);}.layer-item.svelte-w47swm:hover {border-color:var(--color-primary, #3b82f6);background:var(--color-surface-alt, #f5f5f5);}.layer-item.selected.svelte-w47swm {border-color:var(--color-primary, #3b82f6);background:var(--color-primary-light, #eff6ff);}.layer-item-preview.svelte-w47swm {width:40px;height:40px;flex-shrink:0;border-radius:4px;overflow:hidden;background:#f5f5f5;display:flex;align-items:center;justify-content:center;}.layer-item-preview.svelte-w47swm img:where(.svelte-w47swm) {width:100%;height:100%;object-fit:cover;}.layer-item-info.svelte-w47swm {flex:1;display:flex;align-items:center;justify-content:space-between;gap:0.5rem;}.layer-item-name.svelte-w47swm {font-size:0.875rem;color:var(--color-text, #111);display:flex;flex-direction:column;gap:0.25rem;}.layer-key-badge.svelte-w47swm {font-size:0.7rem;font-family:monospace;background:var(--color-primary-light, #eff6ff);color:var(--color-primary, #3b82f6);padding:0.125rem 0.375rem;border-radius:3px;font-weight:500;}.layer-item-actions.svelte-w47swm {display:flex;gap:0.25rem;align-items:center;}.layer-order-btn.svelte-w47swm {background:transparent;border:1px solid var(--color-border, #ccc);border-radius:3px;width:24px;height:24px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all 200ms;color:var(--color-text, #000);padding:0;}.layer-order-btn.svelte-w47swm:hover:not(:disabled) {background:var(--color-primary, #3b82f6);border-color:var(--color-primary, #3b82f6);color:white;}.layer-order-btn.svelte-w47swm:disabled {opacity:0.3;cursor:not-allowed;}.layer-delete-btn.svelte-w47swm {background:#ef4444;color:white;border:none;border-radius:3px;display:flex;align-items:center;justify-content:center;padding:0;width:24px;height:24px;cursor:pointer;font-size:1rem;line-height:1;transition:background 200ms;}.layer-delete-btn.svelte-w47swm:hover {background:#dc2626;}.mockup-name-header.svelte-w47swm {display:flex;align-items:center;justify-content:space-between;margin-bottom:0.5rem;}.mockup-title-group.svelte-w47swm {display:flex;align-items:center;gap:0.5rem;}.mockup-buttons-group.svelte-w47swm {display:flex;align-items:center;gap:0.5rem;}.new-mockup-btn.svelte-w47swm {padding:0.375rem 0.75rem;background:var(--color-primary, #3b82f6);color:white;border:none;border-radius:4px;cursor:pointer;font-size:0.875rem;transition:background 200ms;display:flex;align-items:center;gap:0.375rem;}.new-mockup-btn.svelte-w47swm:hover {background:var(--color-primary-dark, #2563eb);}.mockup-name-title.svelte-w47swm {font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);margin:0;}.view-all-btn.svelte-w47swm {padding:0.375rem 0.75rem;background:transparent;color:var(--color-primary, #3b82f6);border:1px solid var(--color-primary, #3b82f6);border-radius:4px;cursor:pointer;font-size:0.875rem;transition:all 200ms;}.view-all-btn.svelte-w47swm:hover {background:var(--color-primary, #3b82f6);color:white;}.form-label.svelte-w47swm {display:block;font-size:0.875rem;font-weight:500;color:var(--color-text, #111);margin-bottom:0.25rem;}.form-input.svelte-w47swm {width:100%;padding:0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;margin-bottom:0.75rem;}.name-input-group.svelte-w47swm {display:flex;gap:0.5rem;align-items:stretch;}.name-input.svelte-w47swm {flex:1;margin-bottom:0;min-width:0;}.copy-config-btn.svelte-w47swm {padding:0.375rem 0.75rem;background:transparent;color:var(--color-primary, #3b82f6);border:1px solid var(--color-primary, #3b82f6);border-radius:4px;cursor:pointer;font-size:0.875rem;transition:all 200ms;white-space:nowrap;flex-shrink:0;}.copy-config-btn.svelte-w47swm:hover {background:var(--color-primary, #3b82f6);color:white;}.no-layers.svelte-w47swm {text-align:center;color:var(--color-text-muted, #666);font-size:0.875rem;padding:2rem;}
2217
+
2218
+ @media (max-width: 768px) {.processor-container.svelte-w47swm {flex-direction:column;height:100%;}sidebar.svelte-w47swm {min-width:unset;width:100%;border-right:none;border-top:1px solid var(--color-border, #ccc);order:2;flex-shrink:1;overflow-y:auto;}sidebar.svelte-w47swm .header-logos:where(.svelte-w47swm) {display:none;}.output-canvas.svelte-w47swm {order:1;flex:0 0 50vh;height:50vh;min-height:50vh;}.canvas-header.svelte-w47swm {display:flex;position:absolute;top:0;left:0;right:0;z-index:10;gap:1rem;font-size:1.5rem;padding:0.5rem 1rem;align-items:center;flex-wrap:wrap;}
2219
+ }`
2220
+ };
2221
+ function pa(o, r) {
2222
+ e.push(r, !0), e.append_styles(o, oa);
2223
+ let t = e.prop(r, "storageKey", 3, Jr), a = e.prop(r, "currentMockupKey", 3, Gr), n = e.state(e.proxy(nt())), s = e.state(""), l = e.state(null), f = e.state(""), h = e.state(!1), w = e.state(!1), u = null;
2224
+ e.derived(() => e.get(l) ? e.get(n).composition.layers.find((C) => C.id === e.get(l)) ?? null : null);
2225
+ function g(C) {
2226
+ const R = {
2156
2227
  id: crypto.randomUUID(),
2157
- src: P,
2158
- ...Qt,
2228
+ src: C,
2229
+ ...nn,
2159
2230
  effects: [{ ...fe }],
2160
2231
  transform: {
2161
2232
  x: e.get(n).composition.width / 2,
@@ -2164,217 +2235,217 @@ function Ga(r, a) {
2164
2235
  rotation: 0
2165
2236
  }
2166
2237
  };
2167
- e.get(n).composition.layers.push(W), e.set(l, W.id, !0), p();
2238
+ e.get(n).composition.layers.push(R), e.set(l, R.id, !0), m();
2168
2239
  }
2169
- function m() {
2170
- const P = e.get(f).trim();
2171
- P && (_(P), e.set(f, ""), e.set(h, !1));
2172
- }
2173
- function T(P) {
2174
- const W = P.currentTarget, q = W.files?.[0];
2175
- if (q) {
2176
- const Q = new FileReader();
2177
- Q.onload = (ne) => {
2178
- const $ = ne.target?.result;
2179
- typeof $ == "string" && _($);
2180
- }, Q.readAsDataURL(q);
2240
+ function p() {
2241
+ const C = e.get(f).trim();
2242
+ C && (g(C), e.set(f, ""), e.set(h, !1));
2243
+ }
2244
+ function T(C) {
2245
+ const R = C.currentTarget, O = R.files?.[0];
2246
+ if (O) {
2247
+ const $ = new FileReader();
2248
+ $.onload = (ne) => {
2249
+ const Q = ne.target?.result;
2250
+ typeof Q == "string" && g(Q);
2251
+ }, $.readAsDataURL(O);
2181
2252
  }
2182
- W.value = "";
2253
+ R.value = "";
2183
2254
  }
2184
- function v(P) {
2185
- e.set(l, P, !0);
2255
+ function v(C) {
2256
+ e.set(l, C, !0);
2186
2257
  }
2187
- function y(P, W) {
2188
- const q = e.get(n).composition.layers.find((Q) => Q.id === P);
2189
- q && (q.transform = W, p());
2258
+ function y(C, R) {
2259
+ const O = e.get(n).composition.layers.find(($) => $.id === C);
2260
+ O && (O.transform = R, m());
2190
2261
  }
2191
- function x(P, W) {
2192
- const q = e.get(n).composition.layers.find((Q) => Q.id === P);
2193
- q && (q.opacity = W, p());
2262
+ function x(C, R) {
2263
+ const O = e.get(n).composition.layers.find(($) => $.id === C);
2264
+ O && (O.opacity = R, m());
2194
2265
  }
2195
- function I(P, W) {
2196
- const q = e.get(n).composition.layers.find((Q) => Q.id === P);
2197
- q && (q.visible = W, p());
2266
+ function z(C, R) {
2267
+ const O = e.get(n).composition.layers.find(($) => $.id === C);
2268
+ O && (O.visible = R, m());
2198
2269
  }
2199
- function b(P, W) {
2200
- const q = e.get(n).composition.layers.find((Q) => Q.id === P);
2201
- q && (q.effects = W, p());
2270
+ function _(C, R) {
2271
+ const O = e.get(n).composition.layers.find(($) => $.id === C);
2272
+ O && (O.effects = R, m());
2202
2273
  }
2203
- function k(P, W) {
2204
- const q = e.get(n).composition.layers.find((Q) => Q.id === P);
2205
- q && (q.name = W.trim() || void 0, p());
2274
+ function k(C, R) {
2275
+ const O = e.get(n).composition.layers.find(($) => $.id === C);
2276
+ O && (O.name = R.trim() || void 0, m());
2206
2277
  }
2207
- function C(P) {
2208
- e.get(n).composition.layers = e.get(n).composition.layers.filter((W) => W.id !== P), e.get(l) === P && e.set(l, null), p();
2278
+ function P(C) {
2279
+ e.get(n).composition.layers = e.get(n).composition.layers.filter((R) => R.id !== C), e.get(l) === C && e.set(l, null), m();
2209
2280
  }
2210
- function S(P) {
2211
- const W = e.get(n).composition.layers.findIndex((q) => q.id === P);
2212
- if (W > 0) {
2213
- const q = [...e.get(n).composition.layers];
2214
- [q[W - 1], q[W]] = [q[W], q[W - 1]], e.get(n).composition.layers = q, p();
2281
+ function S(C) {
2282
+ const R = e.get(n).composition.layers.findIndex((O) => O.id === C);
2283
+ if (R > 0) {
2284
+ const O = [...e.get(n).composition.layers];
2285
+ [O[R - 1], O[R]] = [O[R], O[R - 1]], e.get(n).composition.layers = O, m();
2215
2286
  }
2216
2287
  }
2217
- function g(P) {
2218
- const W = e.get(n).composition.layers.findIndex((q) => q.id === P);
2219
- if (W >= 0 && W < e.get(n).composition.layers.length - 1) {
2220
- const q = [...e.get(n).composition.layers];
2221
- [q[W], q[W + 1]] = [q[W + 1], q[W]], e.get(n).composition.layers = q, p();
2288
+ function b(C) {
2289
+ const R = e.get(n).composition.layers.findIndex((O) => O.id === C);
2290
+ if (R >= 0 && R < e.get(n).composition.layers.length - 1) {
2291
+ const O = [...e.get(n).composition.layers];
2292
+ [O[R], O[R + 1]] = [O[R + 1], O[R]], e.get(n).composition.layers = O, m();
2222
2293
  }
2223
2294
  }
2224
- function u(P, W) {
2225
- e.get(n).composition.width = P, e.get(n).composition.height = W, p();
2295
+ function d(C, R) {
2296
+ e.get(n).composition.width = C, e.get(n).composition.height = R, m();
2226
2297
  }
2227
- function p() {
2228
- d && clearTimeout(d), d = setTimeout(
2298
+ function m() {
2299
+ u && clearTimeout(u), u = setTimeout(
2229
2300
  () => {
2230
- o();
2301
+ i();
2231
2302
  },
2232
2303
  500
2233
2304
  );
2234
2305
  }
2235
- function o() {
2236
- e.get(n).name = e.get(i) || "Untitled Mockup", e.get(n).updatedAt = Date.now(), Ta(e.get(n), t()), je(e.get(n).id, s());
2306
+ function i() {
2307
+ e.get(n).name = e.get(s) || "Untitled Mockup", e.get(n).updatedAt = Date.now(), Br(e.get(n), t()), Ee(e.get(n).id, a());
2237
2308
  }
2238
2309
  function c() {
2239
- o();
2240
- const P = tt();
2241
- e.set(n, P, !0), e.set(i, P.name, !0), je(null, s());
2310
+ i();
2311
+ const C = nt();
2312
+ e.set(n, C, !0), e.set(s, C.name, !0), Ee(null, a());
2242
2313
  }
2243
- function M(P) {
2244
- o(), e.set(n, P, !0), e.set(i, P.name, !0), je(P.id, s()), e.set(w, !1);
2314
+ function M(C) {
2315
+ i(), e.set(n, C, !0), e.set(s, C.name, !0), Ee(C.id, a()), e.set(w, !1);
2245
2316
  }
2246
- function N() {
2317
+ function I() {
2247
2318
  c(), e.set(w, !1);
2248
2319
  }
2249
- async function B() {
2320
+ async function X() {
2250
2321
  try {
2251
- const P = JSON.stringify(e.get(n), null, 2);
2252
- await navigator.clipboard.writeText(P);
2253
- } catch (P) {
2254
- console.error("Failed to copy config:", P);
2322
+ const C = JSON.stringify(e.get(n), null, 2);
2323
+ await navigator.clipboard.writeText(C);
2324
+ } catch (C) {
2325
+ console.error("Failed to copy config:", C);
2255
2326
  }
2256
2327
  }
2257
2328
  Te(() => {
2258
- const P = Ia(s());
2259
- if (P) {
2260
- const W = Sa(P, t());
2261
- W && (e.set(n, W, !0), e.set(i, W.name, !0));
2329
+ const C = Er(a());
2330
+ if (C) {
2331
+ const R = Lr(C, t());
2332
+ R && (e.set(n, R, !0), e.set(s, R.name, !0));
2262
2333
  }
2263
2334
  return () => {
2264
- d && clearTimeout(d), o();
2335
+ u && clearTimeout(u), i();
2265
2336
  };
2266
2337
  });
2267
- var J = Ha(), Z = e.child(J), U = e.child(Z);
2338
+ var J = sa(), B = e.child(J), A = e.child(B);
2268
2339
  {
2269
- var z = (P) => {
2270
- var W = Ba(), q = e.child(W);
2271
- e.snippet(q, () => a.children), e.reset(W), e.append(P, W);
2340
+ var j = (C) => {
2341
+ var R = $r(), O = e.child(R);
2342
+ e.snippet(O, () => r.children), e.reset(R), e.append(C, R);
2272
2343
  };
2273
- e.if(U, (P) => {
2274
- a.children && P(z);
2344
+ e.if(A, (C) => {
2345
+ r.children && C(j);
2275
2346
  });
2276
2347
  }
2277
- var E = e.sibling(U, 2), O = e.child(E), j = e.child(O), L = e.sibling(e.child(j), 2), K = e.child(L);
2348
+ var Z = e.sibling(A, 2), L = e.child(Z), E = e.child(L), q = e.sibling(e.child(E), 2), K = e.child(q);
2278
2349
  K.__click = c;
2279
- var H = e.child(K);
2280
- Me(H, {}), e.next(), e.reset(K);
2350
+ var V = e.child(K);
2351
+ Me(V, {}), e.next(), e.reset(K);
2281
2352
  var G = e.sibling(K, 2);
2282
- G.__click = () => e.set(w, !0), e.reset(L), e.reset(j);
2283
- var X = e.sibling(j, 4), Y = e.child(X);
2284
- e.remove_input_defaults(Y), Y.__input = () => {
2285
- p();
2353
+ G.__click = () => e.set(w, !0), e.reset(q), e.reset(E);
2354
+ var Y = e.sibling(E, 4), D = e.child(Y);
2355
+ e.remove_input_defaults(D), D.__input = () => {
2356
+ m();
2286
2357
  };
2287
- var D = e.sibling(Y, 2);
2288
- D.__click = B, e.reset(X), e.reset(O);
2289
- var R = e.sibling(O, 2), V = e.sibling(e.child(R), 2), A = e.child(V), ue = e.sibling(e.child(A), 2);
2290
- e.remove_input_defaults(ue), ue.__input = (P) => u(Number(P.currentTarget.value), e.get(n).composition.height), e.reset(A);
2291
- var oe = e.sibling(A, 2), he = e.sibling(e.child(oe), 2);
2292
- e.remove_input_defaults(he), he.__input = (P) => u(e.get(n).composition.width, Number(P.currentTarget.value)), e.reset(oe), e.reset(V), e.reset(R);
2293
- var _e = e.sibling(R, 2), le = e.child(_e), ge = e.child(le), We = e.child(ge);
2294
- e.reset(ge);
2295
- var Se = e.sibling(ge, 2), de = e.child(Se);
2296
- de.__click = () => e.set(h, !e.get(h));
2297
- var Ne = e.child(de);
2298
- Me(Ne, {});
2299
- var be = e.sibling(Ne);
2300
- e.reset(de);
2301
- var pe = e.sibling(de, 2), Ie = e.child(pe);
2358
+ var W = e.sibling(D, 2);
2359
+ W.__click = X, e.reset(Y), e.reset(L);
2360
+ var N = e.sibling(L, 2), H = e.sibling(e.child(N), 2), U = e.child(H), de = e.sibling(e.child(U), 2);
2361
+ e.remove_input_defaults(de), de.__input = (C) => d(Number(C.currentTarget.value), e.get(n).composition.height), e.reset(U);
2362
+ var ie = e.sibling(U, 2), he = e.sibling(e.child(ie), 2);
2363
+ e.remove_input_defaults(he), he.__input = (C) => d(e.get(n).composition.width, Number(C.currentTarget.value)), e.reset(ie), e.reset(H), e.reset(N);
2364
+ var ge = e.sibling(N, 2), le = e.child(ge), be = e.child(le), Re = e.child(be);
2365
+ e.reset(be);
2366
+ var Se = e.sibling(be, 2), ue = e.child(Se);
2367
+ ue.__click = () => e.set(h, !e.get(h));
2368
+ var Ie = e.child(ue);
2302
2369
  Me(Ie, {});
2303
- var ze = e.sibling(Ie, 2);
2304
- ze.__change = T, e.reset(pe), e.reset(Se), e.reset(le);
2305
- var me = e.sibling(le, 2);
2370
+ var _e = e.sibling(Ie);
2371
+ e.reset(ue);
2372
+ var me = e.sibling(ue, 2), ze = e.child(me);
2373
+ Me(ze, {});
2374
+ var je = e.sibling(ze, 2);
2375
+ je.__change = T, e.reset(me), e.reset(Se), e.reset(le);
2376
+ var pe = e.sibling(le, 2);
2306
2377
  {
2307
- var ye = (P) => {
2308
- var W = Ea(), q = e.child(W);
2309
- e.remove_input_defaults(q), q.__keydown = (ne) => ne.key === "Enter" && m();
2310
- var Q = e.sibling(q, 2);
2311
- Q.__click = m, e.reset(W), e.bind_value(q, () => e.get(f), (ne) => e.set(f, ne)), e.append(P, W);
2378
+ var ye = (C) => {
2379
+ var R = Qr(), O = e.child(R);
2380
+ e.remove_input_defaults(O), O.__keydown = (ne) => ne.key === "Enter" && p();
2381
+ var $ = e.sibling(O, 2);
2382
+ $.__click = p, e.reset(R), e.bind_value(O, () => e.get(f), (ne) => e.set(f, ne)), e.append(C, R);
2312
2383
  };
2313
- e.if(me, (P) => {
2314
- e.get(h) && P(ye);
2384
+ e.if(pe, (C) => {
2385
+ e.get(h) && C(ye);
2315
2386
  });
2316
2387
  }
2317
- var rt = e.sibling(me, 2);
2388
+ var lt = e.sibling(pe, 2);
2318
2389
  {
2319
- var ot = (P) => {
2320
- var W = Za();
2321
- e.append(P, W);
2322
- }, lt = (P) => {
2323
- var W = ja();
2324
- e.each(W, 23, () => e.get(n).composition.layers, (q) => q.id, (q, Q, ne) => {
2325
- var $ = La();
2390
+ var ct = (C) => {
2391
+ var R = ea();
2392
+ e.append(C, R);
2393
+ }, dt = (C) => {
2394
+ var R = ra();
2395
+ e.each(R, 23, () => e.get(n).composition.layers, (O) => O.id, (O, $, ne) => {
2396
+ var Q = na();
2326
2397
  let te;
2327
- $.__click = () => v(e.get(Q).id), $.__keydown = (ae) => ae.key === "Enter" && v(e.get(Q).id);
2328
- var Xe = e.child($), ft = e.child(Xe);
2329
- e.reset(Xe);
2330
- var Fe = e.sibling(Xe, 2), Ye = e.child(Fe), Ke = e.child(Ye), ht = e.sibling(Ke);
2398
+ Q.__click = () => v(e.get($).id), Q.__keydown = (re) => re.key === "Enter" && v(e.get($).id);
2399
+ var Ye = e.child(Q), gt = e.child(Ye);
2400
+ e.reset(Ye);
2401
+ var Fe = e.sibling(Ye, 2), De = e.child(Fe), Ke = e.child(De), bt = e.sibling(Ke);
2331
2402
  {
2332
- var _t = (ae) => {
2333
- var Ee = Oa(), wt = e.child(Ee, !0);
2334
- e.reset(Ee), e.template_effect(() => e.set_text(wt, e.get(Q).name)), e.append(ae, Ee);
2403
+ var _t = (re) => {
2404
+ var Ze = ta(), kt = e.child(Ze, !0);
2405
+ e.reset(Ze), e.template_effect(() => e.set_text(kt, e.get($).name)), e.append(re, Ze);
2335
2406
  };
2336
- e.if(ht, (ae) => {
2337
- e.get(Q).name && ae(_t);
2407
+ e.if(bt, (re) => {
2408
+ e.get($).name && re(_t);
2338
2409
  });
2339
2410
  }
2340
- e.reset(Ye);
2341
- var Je = e.sibling(Ye, 2), we = e.child(Je);
2342
- we.__click = (ae) => {
2343
- ae.stopPropagation(), S(e.get(Q).id);
2411
+ e.reset(De);
2412
+ var Je = e.sibling(De, 2), we = e.child(Je);
2413
+ we.__click = (re) => {
2414
+ re.stopPropagation(), S(e.get($).id);
2344
2415
  };
2345
- var gt = e.child(we);
2346
- nt(gt, { rotate: "-90deg" }), e.reset(we);
2416
+ var yt = e.child(we);
2417
+ rt(yt, { rotate: "-90deg" }), e.reset(we);
2347
2418
  var xe = e.sibling(we, 2);
2348
- xe.__click = (ae) => {
2349
- ae.stopPropagation(), g(e.get(Q).id);
2419
+ xe.__click = (re) => {
2420
+ re.stopPropagation(), b(e.get($).id);
2350
2421
  };
2351
- var bt = e.child(xe);
2352
- nt(bt, { rotate: "90deg" }), e.reset(xe);
2353
- var Be = e.sibling(xe, 2);
2354
- Be.__click = (ae) => {
2355
- ae.stopPropagation(), C(e.get(Q).id);
2422
+ var wt = e.child(xe);
2423
+ rt(wt, { rotate: "90deg" }), e.reset(xe);
2424
+ var Xe = e.sibling(xe, 2);
2425
+ Xe.__click = (re) => {
2426
+ re.stopPropagation(), P(e.get($).id);
2356
2427
  };
2357
- var yt = e.child(Be);
2358
- Ue(yt, {}), e.reset(Be), e.reset(Je), e.reset(Fe), e.reset($), e.template_effect(() => {
2359
- te = e.set_class($, 1, "layer-item svelte-w47swm", null, te, { selected: e.get(l) === e.get(Q).id }), e.set_attribute(ft, "src", e.get(Q).src), e.set_text(Ke, `${(e.get(Q).name || `Layer ${e.get(ne) + 1}`) ?? ""} `), we.disabled = e.get(ne) === 0, xe.disabled = e.get(ne) === e.get(n).composition.layers.length - 1;
2360
- }), e.append(q, $);
2361
- }), e.reset(W), e.append(P, W);
2428
+ var xt = e.child(Xe);
2429
+ Ae(xt, {}), e.reset(Xe), e.reset(Je), e.reset(Fe), e.reset(Q), e.template_effect(() => {
2430
+ te = e.set_class(Q, 1, "layer-item svelte-w47swm", null, te, { selected: e.get(l) === e.get($).id }), e.set_attribute(gt, "src", e.get($).src), e.set_text(Ke, `${(e.get($).name || `Layer ${e.get(ne) + 1}`) ?? ""} `), we.disabled = e.get(ne) === 0, xe.disabled = e.get(ne) === e.get(n).composition.layers.length - 1;
2431
+ }), e.append(O, Q);
2432
+ }), e.reset(R), e.append(C, R);
2362
2433
  };
2363
- e.if(rt, (P) => {
2364
- e.get(n).composition.layers.length === 0 ? P(ot) : P(lt, !1);
2434
+ e.if(lt, (C) => {
2435
+ e.get(n).composition.layers.length === 0 ? C(ct) : C(dt, !1);
2365
2436
  });
2366
2437
  }
2367
- e.reset(_e);
2368
- var ct = e.sibling(_e, 2);
2438
+ e.reset(ge);
2439
+ var ut = e.sibling(ge, 2);
2369
2440
  {
2370
- var ut = (P) => {
2371
- const W = e.derived(() => e.get(n).composition.layers.find(($) => $.id === e.get(l)));
2372
- var q = e.comment(), Q = e.first_child(q);
2441
+ var mt = (C) => {
2442
+ const R = e.derived(() => e.get(n).composition.layers.find((Q) => Q.id === e.get(l)));
2443
+ var O = e.comment(), $ = e.first_child(O);
2373
2444
  {
2374
- var ne = ($) => {
2375
- wa($, {
2445
+ var ne = (Q) => {
2446
+ Wr(Q, {
2376
2447
  get layer() {
2377
- return e.get(W);
2448
+ return e.get(R);
2378
2449
  },
2379
2450
  get canvasWidth() {
2380
2451
  return e.get(n).composition.width;
@@ -2382,52 +2453,52 @@ function Ga(r, a) {
2382
2453
  get canvasHeight() {
2383
2454
  return e.get(n).composition.height;
2384
2455
  },
2385
- onTransformChange: (te) => y(e.get(W).id, te),
2386
- onOpacityChange: (te) => x(e.get(W).id, te),
2387
- onVisibilityChange: (te) => I(e.get(W).id, te),
2388
- onEffectsChange: (te) => b(e.get(W).id, te),
2389
- onNameChange: (te) => k(e.get(W).id, te),
2390
- onDelete: () => C(e.get(W).id)
2456
+ onTransformChange: (te) => y(e.get(R).id, te),
2457
+ onOpacityChange: (te) => x(e.get(R).id, te),
2458
+ onVisibilityChange: (te) => z(e.get(R).id, te),
2459
+ onEffectsChange: (te) => _(e.get(R).id, te),
2460
+ onNameChange: (te) => k(e.get(R).id, te),
2461
+ onDelete: () => P(e.get(R).id)
2391
2462
  });
2392
2463
  };
2393
- e.if(Q, ($) => {
2394
- e.get(W) && $(ne);
2464
+ e.if($, (Q) => {
2465
+ e.get(R) && Q(ne);
2395
2466
  });
2396
2467
  }
2397
- e.append(P, q);
2468
+ e.append(C, O);
2398
2469
  };
2399
- e.if(ct, (P) => {
2400
- e.get(l) && P(ut);
2470
+ e.if(ut, (C) => {
2471
+ e.get(l) && C(mt);
2401
2472
  });
2402
2473
  }
2403
- e.reset(E), e.reset(Z);
2404
- var De = e.sibling(Z, 2), Ve = e.child(De);
2474
+ e.reset(Z), e.reset(B);
2475
+ var We = e.sibling(B, 2), He = e.child(We);
2405
2476
  {
2406
- var dt = (P) => {
2407
- var W = qa(), q = e.child(W);
2408
- e.snippet(q, () => a.children), e.reset(W), e.append(P, W);
2477
+ var pt = (C) => {
2478
+ var R = aa(), O = e.child(R);
2479
+ e.snippet(O, () => r.children), e.reset(R), e.append(C, R);
2409
2480
  };
2410
- e.if(Ve, (P) => {
2411
- a.children && P(dt);
2481
+ e.if(He, (C) => {
2482
+ r.children && C(pt);
2412
2483
  });
2413
2484
  }
2414
- var pt = e.sibling(Ve, 2);
2415
- en(pt, {
2416
- children: (P, W) => {
2417
- sn(P, {
2485
+ var vt = e.sibling(He, 2);
2486
+ sn(vt, {
2487
+ children: (C, R) => {
2488
+ un(C, {
2418
2489
  get mockup() {
2419
2490
  return e.get(n);
2420
2491
  }
2421
2492
  });
2422
2493
  }
2423
- }), e.reset(De);
2424
- var mt = e.sibling(De, 2);
2494
+ }), e.reset(We);
2495
+ var ft = e.sibling(We, 2);
2425
2496
  {
2426
- var vt = (P) => {
2427
- za(P, {
2497
+ var ht = (C) => {
2498
+ Fr(C, {
2428
2499
  onclose: () => e.set(w, !1),
2429
2500
  onSelect: M,
2430
- onNew: N,
2501
+ onNew: I,
2431
2502
  get currentMockupId() {
2432
2503
  return e.get(n).id;
2433
2504
  },
@@ -2436,45 +2507,45 @@ function Ga(r, a) {
2436
2507
  }
2437
2508
  });
2438
2509
  };
2439
- e.if(mt, (P) => {
2440
- e.get(w) && P(vt);
2510
+ e.if(ft, (C) => {
2511
+ e.get(w) && C(ht);
2441
2512
  });
2442
2513
  }
2443
2514
  e.reset(J), e.template_effect(() => {
2444
- e.set_value(ue, e.get(n).composition.width), e.set_value(he, e.get(n).composition.height), e.set_text(We, `Layers (${e.get(n).composition.layers.length ?? ""})`), e.set_text(be, ` ${e.get(h) ? "Cancel" : "URL"}`);
2445
- }), e.bind_value(Y, () => e.get(i), (P) => e.set(i, P)), e.append(r, J), e.pop();
2515
+ e.set_value(de, e.get(n).composition.width), e.set_value(he, e.get(n).composition.height), e.set_text(Re, `Layers (${e.get(n).composition.layers.length ?? ""})`), e.set_text(_e, ` ${e.get(h) ? "Cancel" : "URL"}`);
2516
+ }), e.bind_value(D, () => e.get(s), (C) => e.set(s, C)), e.append(o, J), e.pop();
2446
2517
  }
2447
2518
  e.delegate(["click", "input", "change", "keydown"]);
2448
2519
  export {
2449
- Ya as CURRENT_MOCKUP_KEY,
2520
+ Gr as CURRENT_MOCKUP_KEY,
2450
2521
  at as InputBatcher,
2451
- wa as LayerControls,
2452
- Ga as MockupEditor,
2453
- sn as MockupEditorRenderer,
2454
- za as MockupListModal,
2455
- Ja as MockupRenderer,
2456
- Kt as RenderScheduler,
2457
- Xa as STORAGE_KEY,
2458
- en as ZoomableCanvas,
2459
- tt as createNewMockup,
2460
- st as defaultComposition,
2522
+ Wr as LayerControls,
2523
+ pa as MockupEditor,
2524
+ un as MockupEditorRenderer,
2525
+ Fr as MockupListModal,
2526
+ ma as MockupRenderer,
2527
+ $t as RenderScheduler,
2528
+ Jr as STORAGE_KEY,
2529
+ sn as ZoomableCanvas,
2530
+ nt as createNewMockup,
2531
+ ot as defaultComposition,
2461
2532
  ce as defaultCylinderWarp,
2462
- ie as defaultImageOnSurface,
2463
- Qt as defaultLayer,
2464
- se as defaultPlaneWarp,
2533
+ se as defaultImageOnSurface,
2534
+ nn as defaultLayer,
2535
+ ae as defaultPlaneWarp,
2465
2536
  fe as defaultResizeEffect,
2466
2537
  ee as defaultRestyleEffect,
2467
2538
  ke as defaultSphereWarp,
2468
- Gt as defaultTransform,
2469
- Ce as defaultView,
2539
+ tn as defaultTransform,
2540
+ Pe as defaultView,
2470
2541
  ve as defaultWarpDebug,
2471
- $e as defaultWarpEffect,
2472
- Na as deleteMockup,
2473
- Re as loadAllMockups,
2474
- Ia as loadCurrentMockupId,
2475
- Sa as loadMockup,
2476
- qe as renderMockupCanvas,
2477
- tn as renderMockupCanvasEditor,
2478
- je as saveCurrentMockupId,
2479
- Ta as saveMockup
2542
+ Qe as defaultWarpEffect,
2543
+ qr as deleteMockup,
2544
+ Ne as loadAllMockups,
2545
+ Er as loadCurrentMockupId,
2546
+ Lr as loadMockup,
2547
+ Oe as renderMockupCanvas,
2548
+ on as renderMockupCanvasEditor,
2549
+ Ee as saveCurrentMockupId,
2550
+ Br as saveMockup
2480
2551
  };