@antontranelis/money-printer 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { jsxs as m, jsx as l, Fragment as M } from "react/jsx-runtime";
2
- import { create as fe } from "zustand";
3
- import { persist as be } from "zustand/middleware";
4
- import { useState as E, useCallback as C, useRef as $, useEffect as G } from "react";
1
+ import { jsxs as u, jsx as l, Fragment as j } from "react/jsx-runtime";
2
+ import { create as ve } from "zustand";
3
+ import { persist as we } from "zustand/middleware";
4
+ import { useState as E, useCallback as T, useRef as D, useEffect as O } from "react";
5
5
  import ye from "jspdf";
6
- const V = {
6
+ const X = {
7
7
  personalInfo: {
8
8
  name: "",
9
9
  email: "",
@@ -23,27 +23,28 @@ const V = {
23
23
  currentSide: "front",
24
24
  isEnhancing: !1,
25
25
  isExporting: !1
26
- }, y = fe()(
27
- be(
26
+ }, w = ve()(
27
+ we(
28
28
  (e) => ({
29
- ...V,
30
- setPersonalInfo: (t) => e((a) => ({
31
- personalInfo: { ...a.personalInfo, ...t }
29
+ ...X,
30
+ setPersonalInfo: (t) => e((n) => ({
31
+ personalInfo: { ...n.personalInfo, ...t }
32
32
  })),
33
- setVoucherConfig: (t) => e((a) => ({
34
- voucherConfig: { ...a.voucherConfig, ...t }
33
+ setVoucherConfig: (t) => e((n) => ({
34
+ voucherConfig: { ...n.voucherConfig, ...t }
35
35
  })),
36
- setPortrait: (t, a = null) => e({
36
+ setPortrait: (t, n = null) => e((a) => ({
37
37
  portrait: {
38
38
  original: t,
39
- enhanced: a,
39
+ enhanced: n,
40
40
  useEnhanced: !1,
41
- zoom: 1
41
+ // Keep current zoom if updating existing portrait, reset to 1 for new portrait
42
+ zoom: a.portrait.original && t ? a.portrait.zoom : 1
42
43
  }
43
- }),
44
- setEnhancedPortrait: (t) => e((a) => ({
44
+ })),
45
+ setEnhancedPortrait: (t) => e((n) => ({
45
46
  portrait: {
46
- ...a.portrait,
47
+ ...n.portrait,
47
48
  enhanced: t,
48
49
  useEnhanced: t !== null
49
50
  }
@@ -54,9 +55,9 @@ const V = {
54
55
  useEnhanced: t.portrait.enhanced ? !t.portrait.useEnhanced : !1
55
56
  }
56
57
  })),
57
- setPortraitZoom: (t) => e((a) => ({
58
+ setPortraitZoom: (t) => e((n) => ({
58
59
  portrait: {
59
- ...a.portrait,
60
+ ...n.portrait,
60
61
  zoom: t
61
62
  }
62
63
  })),
@@ -66,23 +67,24 @@ const V = {
66
67
  })),
67
68
  setIsEnhancing: (t) => e({ isEnhancing: t }),
68
69
  setIsExporting: (t) => e({ isExporting: t }),
69
- setLanguage: (t) => e((a) => ({
70
- voucherConfig: { ...a.voucherConfig, language: t }
70
+ setLanguage: (t) => e((n) => ({
71
+ voucherConfig: { ...n.voucherConfig, language: t }
71
72
  })),
72
- setHours: (t) => e((a) => ({
73
- voucherConfig: { ...a.voucherConfig, hours: t }
73
+ setHours: (t) => e((n) => ({
74
+ voucherConfig: { ...n.voucherConfig, hours: t }
74
75
  })),
75
- reset: () => e(V)
76
+ reset: () => e(X)
76
77
  }),
77
78
  {
78
79
  name: "money-generator-storage",
79
80
  partialize: (e) => ({
80
81
  personalInfo: e.personalInfo,
81
- voucherConfig: e.voucherConfig
82
+ voucherConfig: e.voucherConfig,
83
+ portrait: e.portrait
82
84
  })
83
85
  }
84
86
  )
85
- ), we = {
87
+ ), xe = {
86
88
  header: {
87
89
  title: "Money Generator",
88
90
  subtitle: "Erstelle deinen persönlichen Zeitgutschein"
@@ -129,7 +131,7 @@ const V = {
129
131
  bill: {
130
132
  descriptionText: "Für diesen Schein erhältst du {hours} {hourLabel} meiner Zeit oder ein gleichwertiges Dankeschön"
131
133
  }
132
- }, ve = {
134
+ }, Ie = {
133
135
  header: {
134
136
  title: "Money Generator",
135
137
  subtitle: "Create your personal time voucher"
@@ -176,65 +178,88 @@ const V = {
176
178
  bill: {
177
179
  descriptionText: "This voucher entitles you to {hours} {hourLabel} of my time or an equivalent thank you"
178
180
  }
179
- }, xe = { de: we, en: ve };
180
- function z(e) {
181
- return xe[e];
181
+ }, ke = { de: xe, en: Ie };
182
+ function $(e) {
183
+ return ke[e];
182
184
  }
183
- function J(e, t, a) {
184
- if (a && a.trim())
185
- return a;
186
- const n = z(e), r = t === 1 ? n.form.voucher.hourLabel : n.form.voucher.hoursLabel;
187
- return n.bill.descriptionText.replace("{hours}", t.toString()).replace("{hourLabel}", r);
185
+ function ee(e, t, n) {
186
+ if (n && n.trim())
187
+ return n;
188
+ const a = $(e), r = t === 1 ? a.form.voucher.hourLabel : a.form.voucher.hoursLabel;
189
+ return a.bill.descriptionText.replace("{hours}", t.toString()).replace("{hourLabel}", r);
188
190
  }
189
- function Ve() {
190
- const e = y((r) => r.voucherConfig.language), t = y((r) => r.personalInfo), a = y((r) => r.setPersonalInfo), n = z(e);
191
- return /* @__PURE__ */ m("div", { className: "space-y-4", children: [
192
- /* @__PURE__ */ m("div", { className: "form-control", children: [
193
- /* @__PURE__ */ l("label", { className: "label", children: /* @__PURE__ */ l("span", { className: "label-text font-medium", children: n.form.personalInfo.name }) }),
191
+ function Xe() {
192
+ const e = w((r) => r.voucherConfig.language), t = w((r) => r.personalInfo), n = w((r) => r.setPersonalInfo), a = $(e);
193
+ return /* @__PURE__ */ u("div", { className: "space-y-4", children: [
194
+ /* @__PURE__ */ u("div", { className: "form-control", children: [
195
+ /* @__PURE__ */ l("label", { className: "label", children: /* @__PURE__ */ l("span", { className: "label-text font-medium", children: a.form.personalInfo.name }) }),
194
196
  /* @__PURE__ */ l(
195
197
  "input",
196
198
  {
197
199
  type: "text",
198
- placeholder: n.form.personalInfo.namePlaceholder,
200
+ placeholder: a.form.personalInfo.namePlaceholder,
199
201
  className: "input input-bordered w-full",
200
202
  value: t.name,
201
- onChange: (r) => a({ name: r.target.value })
203
+ onChange: (r) => n({ name: r.target.value })
202
204
  }
203
205
  )
204
206
  ] }),
205
- /* @__PURE__ */ m("div", { className: "form-control", children: [
206
- /* @__PURE__ */ l("label", { className: "label", children: /* @__PURE__ */ l("span", { className: "label-text font-medium", children: n.form.personalInfo.email }) }),
207
+ /* @__PURE__ */ u("div", { className: "form-control", children: [
208
+ /* @__PURE__ */ l("label", { className: "label", children: /* @__PURE__ */ l("span", { className: "label-text font-medium", children: a.form.personalInfo.email }) }),
207
209
  /* @__PURE__ */ l(
208
210
  "input",
209
211
  {
210
212
  type: "email",
211
- placeholder: n.form.personalInfo.emailPlaceholder,
213
+ placeholder: a.form.personalInfo.emailPlaceholder,
212
214
  className: "input input-bordered w-full",
213
215
  value: t.email,
214
- onChange: (r) => a({ email: r.target.value })
216
+ onChange: (r) => n({ email: r.target.value })
215
217
  }
216
218
  )
217
219
  ] }),
218
- /* @__PURE__ */ m("div", { className: "form-control", children: [
219
- /* @__PURE__ */ l("label", { className: "label", children: /* @__PURE__ */ l("span", { className: "label-text font-medium", children: n.form.personalInfo.phone }) }),
220
+ /* @__PURE__ */ u("div", { className: "form-control", children: [
221
+ /* @__PURE__ */ l("label", { className: "label", children: /* @__PURE__ */ l("span", { className: "label-text font-medium", children: a.form.personalInfo.phone }) }),
220
222
  /* @__PURE__ */ l(
221
223
  "input",
222
224
  {
223
225
  type: "tel",
224
- placeholder: n.form.personalInfo.phonePlaceholder,
226
+ placeholder: a.form.personalInfo.phonePlaceholder,
225
227
  className: "input input-bordered w-full",
226
228
  value: t.phone,
227
- onChange: (r) => a({ phone: r.target.value })
229
+ onChange: (r) => n({ phone: r.target.value })
228
230
  }
229
231
  )
230
232
  ] })
231
233
  ] });
232
234
  }
233
- const j = {}, Ie = "https://api.stability.ai/v1/generation", ke = "https://api.stability.ai/v2beta/stable-image/edit/remove-background", Q = "stability_api_key", Ne = {
235
+ async function Ne(e, t = 0.5) {
236
+ return new Promise((n, a) => {
237
+ const r = new Image();
238
+ r.onload = () => {
239
+ const o = document.createElement("canvas"), c = o.getContext("2d");
240
+ if (!c) {
241
+ a(new Error("Failed to get canvas context"));
242
+ return;
243
+ }
244
+ o.width = r.width, o.height = r.height, c.drawImage(r, 0, 0);
245
+ const s = c.getImageData(0, 0, o.width, o.height), i = s.data, d = 1 + t * 0.8;
246
+ for (let h = 0; h < i.length; h += 4) {
247
+ const g = i[h], f = i[h + 1], b = i[h + 2];
248
+ if (i[h + 3] === 0) continue;
249
+ let I = (((0.299 * g + 0.587 * f + 0.114 * b) / 255 - 0.5) * d + 0.5) * 255;
250
+ I = Math.max(0, Math.min(255, I));
251
+ const x = Math.min(255, I * 0.9 + 25), A = Math.min(255, I * 0.78 + 15), y = Math.min(255, I * 0.55 + 5);
252
+ i[h] = Math.round(g * (1 - t) + x * t), i[h + 1] = Math.round(f * (1 - t) + A * t), i[h + 2] = Math.round(b * (1 - t) + y * t);
253
+ }
254
+ c.putImageData(s, 0, 0), n(o.toDataURL("image/png"));
255
+ }, r.onerror = () => a(new Error("Failed to load image")), r.src = e;
256
+ });
257
+ }
258
+ const Ee = "https://api.stability.ai/v1/generation", Pe = "https://api.stability.ai/v2beta/stable-image/edit/remove-background", te = "stability_api_key", Se = {
234
259
  vintage: "portrait in the style of vintage currency engraving, fine line work, crosshatching, sepia tones, detailed stippling, classic bank note portrait style",
235
260
  engraved: "portrait as detailed intaglio engraving, currency bill style, fine parallel lines, high contrast, official government portrait",
236
261
  currency: "portrait rendered as US dollar bill engraving, official currency portrait style, green tint, fine line engraving technique"
237
- }, Z = [
262
+ }, J = [
238
263
  { width: 1024, height: 1024 },
239
264
  { width: 1152, height: 896 },
240
265
  { width: 1216, height: 832 },
@@ -245,166 +270,143 @@ const j = {}, Ie = "https://api.stability.ai/v1/generation", ke = "https://api.s
245
270
  { width: 832, height: 1216 },
246
271
  { width: 896, height: 1152 }
247
272
  ];
248
- function Ee(e, t) {
249
- const a = e / t;
250
- let n = Z[0], r = 1 / 0;
251
- for (const s of Z) {
252
- const d = s.width / s.height, o = Math.abs(a - d);
253
- o < r && (r = o, n = s);
273
+ function Ce(e, t) {
274
+ const n = e / t;
275
+ let a = J[0], r = 1 / 0;
276
+ for (const o of J) {
277
+ const c = o.width / o.height, s = Math.abs(n - c);
278
+ s < r && (r = s, a = o);
254
279
  }
255
- return n;
280
+ return a;
256
281
  }
257
- function Pe(e) {
258
- return new Promise((t, a) => {
259
- const n = new Image();
260
- n.onload = () => {
261
- const r = Ee(n.width, n.height), s = document.createElement("canvas");
262
- s.width = r.width, s.height = r.height;
263
- const d = s.getContext("2d");
264
- if (!d) {
265
- a(new Error("Failed to get canvas context"));
282
+ function Te(e) {
283
+ return new Promise((t, n) => {
284
+ const a = new Image();
285
+ a.onload = () => {
286
+ const r = Ce(a.width, a.height), o = document.createElement("canvas");
287
+ o.width = r.width, o.height = r.height;
288
+ const c = o.getContext("2d");
289
+ if (!c) {
290
+ n(new Error("Failed to get canvas context"));
266
291
  return;
267
292
  }
268
- const o = n.width / n.height, i = r.width / r.height;
269
- let c = 0, u = 0, g = n.width, f = n.height;
270
- o > i ? (g = n.height * i, c = (n.width - g) / 2) : (f = n.width / i, u = (n.height - f) / 2), d.drawImage(n, c, u, g, f, 0, 0, r.width, r.height), t(s.toDataURL("image/png"));
271
- }, n.onerror = () => a(new Error("Failed to load image")), n.src = e;
293
+ const s = a.width / a.height, i = r.width / r.height;
294
+ let d = 0, h = 0, g = a.width, f = a.height;
295
+ s > i ? (g = a.height * i, d = (a.width - g) / 2) : (f = a.width / i, h = (a.height - f) / 2), c.drawImage(a, d, h, g, f, 0, 0, r.width, r.height), t(o.toDataURL("image/png"));
296
+ }, a.onerror = () => n(new Error("Failed to load image")), a.src = e;
272
297
  });
273
298
  }
274
- function ee(e) {
275
- var d;
276
- const t = e.split(","), a = ((d = t[0].match(/:(.*?);/)) == null ? void 0 : d[1]) || "image/png", n = atob(t[1]), r = n.length, s = new Uint8Array(r);
277
- for (let o = 0; o < r; o++)
278
- s[o] = n.charCodeAt(o);
279
- return new Blob([s], { type: a });
299
+ function ne(e) {
300
+ var c;
301
+ const t = e.split(","), n = ((c = t[0].match(/:(.*?);/)) == null ? void 0 : c[1]) || "image/png", a = atob(t[1]), r = a.length, o = new Uint8Array(r);
302
+ for (let s = 0; s < r; s++)
303
+ o[s] = a.charCodeAt(s);
304
+ return new Blob([o], { type: n });
280
305
  }
281
306
  function q() {
282
307
  var t;
283
- const e = typeof import.meta < "u" && (j == null ? void 0 : j.VITE_STABILITY_API_KEY) || typeof process < "u" && ((t = process.env) == null ? void 0 : t.NEXT_PUBLIC_STABILITY_API_KEY);
284
- return e && e !== "your-api-key-here" ? e : typeof localStorage < "u" ? localStorage.getItem(Q) : null;
308
+ const e = typeof import.meta < "u" && "sk-7mEKklrqaltdtgbX0VoZbkA8E1cl939Spn75jSIYRvp1BW0b" || typeof process < "u" && ((t = process.env) == null ? void 0 : t.NEXT_PUBLIC_STABILITY_API_KEY);
309
+ return e && e !== "your-api-key-here" ? e : typeof localStorage < "u" ? localStorage.getItem(te) : null;
285
310
  }
286
- function Se(e) {
287
- localStorage.setItem(Q, e);
311
+ function Ae(e) {
312
+ localStorage.setItem(te, e);
288
313
  }
289
- function Ce() {
314
+ function Le() {
290
315
  return q() !== null;
291
316
  }
292
- async function Ze(e) {
317
+ async function Je(e) {
293
318
  const t = q();
294
319
  if (!t)
295
320
  throw new Error("No Stability AI API key configured");
296
- const { imageDataUrl: a, style: n, strength: r = 0.35 } = e, s = await Pe(a), d = ee(s), o = new FormData();
297
- o.append("init_image", d, "portrait.png"), o.append("init_image_mode", "IMAGE_STRENGTH"), o.append("image_strength", String(1 - r)), o.append("text_prompts[0][text]", Ne[n]), o.append("text_prompts[0][weight]", "1"), o.append("cfg_scale", "7"), o.append("samples", "1"), o.append("steps", "30");
298
- const c = await fetch(`${Ie}/stable-diffusion-xl-1024-v1-0/image-to-image`, {
321
+ const { imageDataUrl: n, style: a, strength: r = 0.35 } = e, o = await Te(n), c = ne(o), s = new FormData();
322
+ s.append("init_image", c, "portrait.png"), s.append("init_image_mode", "IMAGE_STRENGTH"), s.append("image_strength", String(1 - r)), s.append("text_prompts[0][text]", Se[a]), s.append("text_prompts[0][weight]", "1"), s.append("cfg_scale", "7"), s.append("samples", "1"), s.append("steps", "30");
323
+ const d = await fetch(`${Ee}/stable-diffusion-xl-1024-v1-0/image-to-image`, {
299
324
  method: "POST",
300
325
  headers: {
301
326
  Authorization: `Bearer ${t}`,
302
327
  Accept: "application/json"
303
328
  },
304
- body: o
329
+ body: s
305
330
  });
306
- if (!c.ok) {
307
- const g = await c.text();
308
- throw console.error("Stability AI error:", g), c.status === 401 ? new Error("Invalid API key") : c.status === 402 ? new Error("Insufficient credits") : c.status === 429 ? new Error("Rate limit exceeded. Please try again later.") : new Error(`API error: ${c.status}`);
331
+ if (!d.ok) {
332
+ const g = await d.text();
333
+ throw console.error("Stability AI error:", g), d.status === 401 ? new Error("Invalid API key") : d.status === 402 ? new Error("Insufficient credits") : d.status === 429 ? new Error("Rate limit exceeded. Please try again later.") : new Error(`API error: ${d.status}`);
309
334
  }
310
- const u = await c.json();
311
- if (!u.artifacts || u.artifacts.length === 0)
335
+ const h = await d.json();
336
+ if (!h.artifacts || h.artifacts.length === 0)
312
337
  throw new Error("No image generated");
313
- return `data:image/png;base64,${u.artifacts[0].base64}`;
338
+ return `data:image/png;base64,${h.artifacts[0].base64}`;
314
339
  }
315
- async function Ae(e) {
340
+ async function _e(e) {
316
341
  const t = q();
317
342
  if (!t)
318
343
  throw new Error("No Stability AI API key configured");
319
- const a = ee(e), n = new FormData();
320
- n.append("image", a, "image.png"), n.append("output_format", "png");
321
- const r = await fetch(ke, {
344
+ const n = ne(e), a = new FormData();
345
+ a.append("image", n, "image.png"), a.append("output_format", "png");
346
+ const r = await fetch(Pe, {
322
347
  method: "POST",
323
348
  headers: {
324
349
  Authorization: `Bearer ${t}`,
325
350
  Accept: "image/*"
326
351
  },
327
- body: n
352
+ body: a
328
353
  });
329
354
  if (!r.ok) {
330
- const d = await r.text();
331
- throw console.error("Stability AI remove background error:", d), r.status === 401 ? new Error("Invalid API key") : r.status === 402 ? new Error("Insufficient credits") : r.status === 429 ? new Error("Rate limit exceeded. Please try again later.") : new Error(`API error: ${r.status}`);
355
+ const c = await r.text();
356
+ throw console.error("Stability AI remove background error:", c), r.status === 401 ? new Error("Invalid API key") : r.status === 402 ? new Error("Insufficient credits") : r.status === 429 ? new Error("Rate limit exceeded. Please try again later.") : new Error(`API error: ${r.status}`);
332
357
  }
333
- const s = await r.blob();
334
- return new Promise((d, o) => {
358
+ const o = await r.blob();
359
+ return new Promise((c, s) => {
335
360
  const i = new FileReader();
336
- i.onload = () => d(i.result), i.onerror = () => o(new Error("Failed to read result")), i.readAsDataURL(s);
337
- });
338
- }
339
- async function Te(e) {
340
- return new Promise((t, a) => {
341
- const n = new Image();
342
- n.onload = () => {
343
- const r = document.createElement("canvas"), s = r.getContext("2d");
344
- if (!s) {
345
- a(new Error("Failed to get canvas context"));
346
- return;
347
- }
348
- r.width = n.width, r.height = n.height, s.drawImage(n, 0, 0);
349
- const d = s.getImageData(0, 0, r.width, r.height), o = d.data;
350
- for (let i = 0; i < o.length; i += 4) {
351
- const c = o[i], u = o[i + 1], g = o[i + 2];
352
- if (o[i + 3] === 0) continue;
353
- let x = (((0.299 * c + 0.587 * u + 0.114 * g) / 255 - 0.5) * 1.15 + 0.5) * 255;
354
- x = Math.max(0, Math.min(255, x));
355
- const k = Math.min(255, x * 0.95 + 30), v = Math.min(255, x * 0.85 + 20), S = Math.min(255, x * 0.65 + 10);
356
- o[i] = k, o[i + 1] = v, o[i + 2] = S;
357
- }
358
- s.putImageData(d, 0, 0), t(r.toDataURL("image/png"));
359
- }, n.onerror = () => a(new Error("Failed to load image")), n.src = e;
361
+ i.onload = () => c(i.result), i.onerror = () => s(new Error("Failed to read result")), i.readAsDataURL(o);
360
362
  });
361
363
  }
362
- function Le() {
363
- const [e, t] = E(!1), [a, n] = E(!1), [r, s] = E(null), [d, o] = E(Ce()), i = C(() => s(null), []), c = C((f) => {
364
- Se(f), o(!0), s(null);
365
- }, []), u = C(
366
- async (f, b = "vintage") => {
367
- t(!0), s(null);
364
+ function De() {
365
+ const [e, t] = E(!1), [n, a] = E(!1), [r, o] = E(null), [c, s] = E(Le()), i = T(() => o(null), []), d = T((f) => {
366
+ Ae(f), s(!0), o(null);
367
+ }, []), h = T(
368
+ async (f, b = 0.5) => {
369
+ t(!0), o(null);
368
370
  try {
369
- return await Te(f);
370
- } catch (h) {
371
- const x = h instanceof Error ? h.message : "Enhancement failed";
372
- throw s(x), h;
371
+ return await Ne(f, b);
372
+ } catch (m) {
373
+ const S = m instanceof Error ? m.message : "Enhancement failed";
374
+ throw o(S), m;
373
375
  } finally {
374
376
  t(!1);
375
377
  }
376
378
  },
377
379
  []
378
- ), g = C(
380
+ ), g = T(
379
381
  async (f) => {
380
- n(!0), s(null);
382
+ a(!0), o(null);
381
383
  try {
382
- return await Ae(f);
384
+ return await _e(f);
383
385
  } catch (b) {
384
- const h = b instanceof Error ? b.message : "Background removal failed";
385
- throw s(h), b;
386
+ const m = b instanceof Error ? b.message : "Background removal failed";
387
+ throw o(m), b;
386
388
  } finally {
387
- n(!1);
389
+ a(!1);
388
390
  }
389
391
  },
390
392
  []
391
393
  );
392
394
  return {
393
- enhance: u,
395
+ enhance: h,
394
396
  removeBg: g,
395
397
  isEnhancing: e,
396
- isRemovingBg: a,
398
+ isRemovingBg: n,
397
399
  error: r,
398
- hasKey: d,
399
- setApiKey: c,
400
+ hasKey: c,
401
+ setApiKey: d,
400
402
  clearError: i
401
403
  };
402
404
  }
403
- function De({ isOpen: e, onClose: t, onSubmit: a }) {
404
- const n = y((c) => c.voucherConfig.language), [r, s] = E("");
405
+ function Re({ isOpen: e, onClose: t, onSubmit: n }) {
406
+ const a = w((d) => d.voucherConfig.language), [r, o] = E("");
405
407
  if (!e) return null;
406
- const d = (c) => {
407
- c.preventDefault(), r.trim() && (a(r.trim()), s(""), t());
408
+ const c = (d) => {
409
+ d.preventDefault(), r.trim() && (n(r.trim()), o(""), t());
408
410
  }, i = {
409
411
  de: {
410
412
  title: "Stability AI API Key",
@@ -422,13 +424,13 @@ function De({ isOpen: e, onClose: t, onSubmit: a }) {
422
424
  cancel: "Cancel",
423
425
  hint: "The key is stored locally in your browser."
424
426
  }
425
- }[n];
426
- return /* @__PURE__ */ m("dialog", { className: "modal modal-open", children: [
427
- /* @__PURE__ */ m("div", { className: "modal-box", children: [
427
+ }[a];
428
+ return /* @__PURE__ */ u("dialog", { className: "modal modal-open", children: [
429
+ /* @__PURE__ */ u("div", { className: "modal-box", children: [
428
430
  /* @__PURE__ */ l("h3", { className: "font-bold text-lg", children: i.title }),
429
431
  /* @__PURE__ */ l("p", { className: "py-4 text-sm opacity-80", children: i.description }),
430
- /* @__PURE__ */ m("form", { onSubmit: d, children: [
431
- /* @__PURE__ */ m("div", { className: "form-control", children: [
432
+ /* @__PURE__ */ u("form", { onSubmit: c, children: [
433
+ /* @__PURE__ */ u("div", { className: "form-control", children: [
432
434
  /* @__PURE__ */ l(
433
435
  "input",
434
436
  {
@@ -436,13 +438,13 @@ function De({ isOpen: e, onClose: t, onSubmit: a }) {
436
438
  placeholder: i.placeholder,
437
439
  className: "input input-bordered w-full",
438
440
  value: r,
439
- onChange: (c) => s(c.target.value),
441
+ onChange: (d) => o(d.target.value),
440
442
  autoFocus: !0
441
443
  }
442
444
  ),
443
445
  /* @__PURE__ */ l("label", { className: "label", children: /* @__PURE__ */ l("span", { className: "label-text-alt", children: i.hint }) })
444
446
  ] }),
445
- /* @__PURE__ */ m("div", { className: "modal-action", children: [
447
+ /* @__PURE__ */ u("div", { className: "modal-action", children: [
446
448
  /* @__PURE__ */ l("button", { type: "button", className: "btn btn-ghost", onClick: t, children: i.cancel }),
447
449
  /* @__PURE__ */ l("button", { type: "submit", className: "btn btn-primary", disabled: !r.trim(), children: i.submit })
448
450
  ] })
@@ -451,76 +453,102 @@ function De({ isOpen: e, onClose: t, onSubmit: a }) {
451
453
  /* @__PURE__ */ l("form", { method: "dialog", className: "modal-backdrop", children: /* @__PURE__ */ l("button", { onClick: t, children: "close" }) })
452
454
  ] });
453
455
  }
454
- function Xe() {
455
- const e = y((p) => p.voucherConfig.language), t = y((p) => p.portrait), a = y((p) => p.setPortrait), n = y((p) => p.setPortraitZoom), { enhance: r, removeBg: s, isEnhancing: d, isRemovingBg: o, error: i, hasKey: c, setApiKey: u } = Le(), g = z(e), f = $(null), [b, h] = E(!1), [x, k] = E(!1), [v, S] = E(null), [w, N] = E(!1), [T, L] = E(!1), H = C(
456
+ function Qe() {
457
+ const e = w((p) => p.voucherConfig.language), t = w((p) => p.portrait), n = w((p) => p.setPortrait), a = w((p) => p.setPortraitZoom), { enhance: r, removeBg: o, isEnhancing: c, isRemovingBg: s, error: i, hasKey: d, setApiKey: h } = De(), g = $(e), f = D(null), [b, m] = E(!1), [S, I] = E(!1), [x, A] = E(null), [y, P] = E(null), [L, _] = E(!1), [C, M] = E(0), z = D(null);
458
+ O(() => () => {
459
+ z.current && clearTimeout(z.current);
460
+ }, []);
461
+ const W = T(
456
462
  async (p) => {
457
463
  if (!p.type.startsWith("image/"))
458
464
  return;
459
- const P = new FileReader();
460
- P.onload = async (D) => {
461
- var _;
462
- const A = (_ = D.target) == null ? void 0 : _.result;
463
- S(A), a(A), N(!1), L(!1);
464
- }, P.readAsDataURL(p);
465
+ const v = new FileReader();
466
+ v.onload = async (k) => {
467
+ var Z;
468
+ const G = (Z = k.target) == null ? void 0 : Z.result;
469
+ A(G), n(G), _(!1), P(null), M(0);
470
+ }, v.readAsDataURL(p);
465
471
  },
466
- [a]
467
- ), W = C(
472
+ [n]
473
+ ), ce = T(
468
474
  (p) => {
469
- p.preventDefault(), h(!1);
470
- const P = p.dataTransfer.files[0];
471
- P && H(P);
475
+ p.preventDefault(), m(!1);
476
+ const v = p.dataTransfer.files[0];
477
+ v && W(v);
472
478
  },
473
- [H]
474
- ), se = C((p) => {
475
- p.preventDefault(), h(!0);
476
- }, []), le = C((p) => {
477
- p.preventDefault(), h(!1);
478
- }, []), ce = () => {
479
+ [W]
480
+ ), de = T((p) => {
481
+ p.preventDefault(), m(!0);
482
+ }, []), he = T((p) => {
483
+ p.preventDefault(), m(!1);
484
+ }, []), me = () => {
479
485
  var p;
480
486
  (p = f.current) == null || p.click();
481
- }, de = (p) => {
482
- var D;
483
- const P = (D = p.target.files) == null ? void 0 : D[0];
484
- P && H(P);
485
- }, K = C(async (p, P, D) => {
486
- let A = p;
487
- if (P && c)
488
- try {
489
- A = await s(A);
490
- } catch (_) {
491
- console.error("Background removal failed:", _);
492
- }
493
- if (D)
494
- try {
495
- A = await r(A, "vintage");
496
- } catch (_) {
497
- console.error("Enhancement failed:", _);
498
- }
499
- a(A);
500
- }, [c, s, r, a]), he = async () => {
501
- if (!v) return;
502
- if (!w && !c) {
503
- k(!0);
487
+ }, pe = (p) => {
488
+ var k;
489
+ const v = (k = p.target.files) == null ? void 0 : k[0];
490
+ v && W(v);
491
+ }, H = T(async (p, v) => {
492
+ try {
493
+ return await r(p, v);
494
+ } catch (k) {
495
+ return console.error("Enhancement failed:", k), p;
496
+ }
497
+ }, [r]), V = T(async (p) => {
498
+ try {
499
+ const v = await o(p);
500
+ return P(v), v;
501
+ } catch (v) {
502
+ return console.error("Background removal failed:", v), p;
503
+ }
504
+ }, [o]), ue = async () => {
505
+ if (!x) return;
506
+ if (!L && !d) {
507
+ I(!0);
504
508
  return;
505
509
  }
506
- const p = !w;
507
- N(p), await K(v, p, T);
508
- }, pe = async () => {
509
- if (!v) return;
510
- const p = !T;
511
- L(p), await K(v, w, p);
512
- }, me = async (p) => {
513
- u(p), v && (N(!0), await K(v, !0, T));
514
- }, ue = () => {
515
- a(null), S(null), N(!1), L(!1);
516
- }, ge = t.original;
517
- return /* @__PURE__ */ m("div", { className: "space-y-4", children: [
518
- t.original ? /* @__PURE__ */ m("div", { className: "space-y-4", children: [
519
- /* @__PURE__ */ l("div", { className: "flex justify-center", children: /* @__PURE__ */ m("div", { className: "relative", children: [
510
+ const p = !L;
511
+ if (_(p), p) {
512
+ const v = await V(x);
513
+ if (C > 0) {
514
+ const k = await H(v, C);
515
+ n(k);
516
+ } else
517
+ n(v);
518
+ } else if (P(null), C > 0) {
519
+ const v = await H(x, C);
520
+ n(v);
521
+ } else
522
+ n(x);
523
+ }, ge = (p) => {
524
+ M(p), z.current && clearTimeout(z.current), x && (z.current = setTimeout(async () => {
525
+ const v = L && y ? y : x;
526
+ if (p === 0)
527
+ n(v);
528
+ else {
529
+ const k = await H(v, p);
530
+ n(k);
531
+ }
532
+ }, 150));
533
+ }, fe = async (p) => {
534
+ if (h(p), !x) return;
535
+ _(!0);
536
+ const v = await V(x);
537
+ if (C > 0) {
538
+ const k = await H(v, C);
539
+ n(k);
540
+ } else
541
+ n(v);
542
+ }, be = () => {
543
+ n(null), A(null), P(null), _(!1), M(0);
544
+ };
545
+ return /* @__PURE__ */ u("div", { className: "space-y-4", children: [
546
+ t.original ? /* @__PURE__ */ u("div", { className: "flex flex-col items-center space-y-4", children: [
547
+ /* @__PURE__ */ u("div", { className: "relative", children: [
520
548
  /* @__PURE__ */ l("div", { className: "w-32 h-32 rounded-full overflow-hidden border-4 border-currency-gold shadow-lg", children: /* @__PURE__ */ l(
521
549
  "img",
522
550
  {
523
- src: ge || "",
551
+ src: t.original || "",
524
552
  alt: "Portrait",
525
553
  className: "w-full h-full object-cover",
526
554
  style: { transform: `scale(${t.zoom})` }
@@ -530,7 +558,7 @@ function Xe() {
530
558
  "button",
531
559
  {
532
560
  className: "btn btn-circle btn-xs btn-error absolute -top-1 -right-1",
533
- onClick: ue,
561
+ onClick: be,
534
562
  children: /* @__PURE__ */ l(
535
563
  "svg",
536
564
  {
@@ -552,11 +580,11 @@ function Xe() {
552
580
  )
553
581
  }
554
582
  )
555
- ] }) }),
556
- /* @__PURE__ */ m("div", { className: "form-control", children: [
557
- /* @__PURE__ */ m("label", { className: "label", children: [
583
+ ] }),
584
+ /* @__PURE__ */ u("div", { className: "form-control w-full max-w-xs", children: [
585
+ /* @__PURE__ */ u("label", { className: "label", children: [
558
586
  /* @__PURE__ */ l("span", { className: "label-text", children: g.form.portrait.zoom }),
559
- /* @__PURE__ */ m("span", { className: "label-text-alt", children: [
587
+ /* @__PURE__ */ u("span", { className: "label-text-alt", children: [
560
588
  Math.round(t.zoom * 100),
561
589
  "%"
562
590
  ] })
@@ -569,60 +597,67 @@ function Xe() {
569
597
  max: "2",
570
598
  step: "0.05",
571
599
  value: t.zoom,
572
- onChange: (p) => n(parseFloat(p.target.value)),
600
+ onChange: (p) => a(parseFloat(p.target.value)),
573
601
  className: "range range-primary range-sm"
574
602
  }
575
603
  )
576
604
  ] }),
577
- /* @__PURE__ */ m("div", { className: "flex flex-col gap-3", children: [
578
- /* @__PURE__ */ l("div", { className: "form-control", children: /* @__PURE__ */ m("label", { className: "label cursor-pointer justify-start gap-3", children: [
579
- /* @__PURE__ */ l(
580
- "input",
581
- {
582
- type: "checkbox",
583
- className: `toggle toggle-primary ${o ? "opacity-50" : ""}`,
584
- checked: w,
585
- onChange: he,
586
- disabled: o
587
- }
588
- ),
589
- /* @__PURE__ */ m("span", { className: "label-text flex items-center gap-2", children: [
590
- o ? /* @__PURE__ */ m(M, { children: [
591
- /* @__PURE__ */ l("span", { className: "loading loading-spinner loading-xs" }),
592
- e === "de" ? "Hintergrund wird entfernt..." : "Removing background..."
593
- ] }) : e === "de" ? "Hintergrund entfernen" : "Remove background",
594
- !c && /* @__PURE__ */ l("span", { className: "badge badge-sm badge-outline", children: "API" })
605
+ /* @__PURE__ */ u("div", { className: "form-control w-full max-w-xs", children: [
606
+ /* @__PURE__ */ u("label", { className: "label", children: [
607
+ /* @__PURE__ */ u("span", { className: "label-text flex items-center gap-2", children: [
608
+ e === "de" ? "Gravur-Effekt" : "Engraving effect",
609
+ c && /* @__PURE__ */ l("span", { className: "loading loading-spinner loading-xs" })
610
+ ] }),
611
+ /* @__PURE__ */ u("span", { className: "label-text-alt", children: [
612
+ Math.round(C * 100),
613
+ "%"
595
614
  ] })
596
- ] }) }),
597
- /* @__PURE__ */ l("div", { className: "form-control", children: /* @__PURE__ */ m("label", { className: "label cursor-pointer justify-start gap-3", children: [
598
- /* @__PURE__ */ l(
599
- "input",
600
- {
601
- type: "checkbox",
602
- className: `toggle toggle-secondary ${d ? "opacity-50" : ""}`,
603
- checked: T,
604
- onChange: pe,
605
- disabled: d
606
- }
607
- ),
608
- /* @__PURE__ */ l("span", { className: "label-text flex items-center gap-2", children: d ? /* @__PURE__ */ m(M, { children: [
615
+ ] }),
616
+ /* @__PURE__ */ l(
617
+ "input",
618
+ {
619
+ type: "range",
620
+ min: "0",
621
+ max: "1",
622
+ step: "0.05",
623
+ value: C,
624
+ onChange: (p) => ge(parseFloat(p.target.value)),
625
+ className: "range range-secondary range-sm",
626
+ disabled: c
627
+ }
628
+ )
629
+ ] }),
630
+ /* @__PURE__ */ l("div", { className: "form-control", children: /* @__PURE__ */ u("label", { className: "label cursor-pointer justify-start gap-3", children: [
631
+ /* @__PURE__ */ l(
632
+ "input",
633
+ {
634
+ type: "checkbox",
635
+ className: `toggle toggle-primary ${s ? "opacity-50" : ""}`,
636
+ checked: L,
637
+ onChange: ue,
638
+ disabled: s
639
+ }
640
+ ),
641
+ /* @__PURE__ */ u("span", { className: "label-text flex items-center gap-2", children: [
642
+ s ? /* @__PURE__ */ u(j, { children: [
609
643
  /* @__PURE__ */ l("span", { className: "loading loading-spinner loading-xs" }),
610
- e === "de" ? "Gravur-Effekt wird angewendet..." : "Applying engraving effect..."
611
- ] }) : e === "de" ? "Gravur-Effekt" : "Engraving effect" })
612
- ] }) }),
613
- i && /* @__PURE__ */ m("div", { className: "alert alert-warning text-sm py-2", children: [
614
- /* @__PURE__ */ l("svg", { xmlns: "http://www.w3.org/2000/svg", className: "stroke-current shrink-0 h-5 w-5", fill: "none", viewBox: "0 0 24 24", children: /* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }),
615
- /* @__PURE__ */ l("span", { children: i })
644
+ e === "de" ? "Hintergrund wird entfernt..." : "Removing background..."
645
+ ] }) : e === "de" ? "Hintergrund entfernen" : "Remove background",
646
+ !d && /* @__PURE__ */ l("span", { className: "badge badge-sm badge-outline", children: "API" })
616
647
  ] })
648
+ ] }) }),
649
+ i && /* @__PURE__ */ u("div", { className: "alert alert-warning text-sm py-2", children: [
650
+ /* @__PURE__ */ l("svg", { xmlns: "http://www.w3.org/2000/svg", className: "stroke-current shrink-0 h-5 w-5", fill: "none", viewBox: "0 0 24 24", children: /* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }),
651
+ /* @__PURE__ */ l("span", { children: i })
617
652
  ] })
618
- ] }) : /* @__PURE__ */ m(
653
+ ] }) : /* @__PURE__ */ u(
619
654
  "div",
620
655
  {
621
- className: `border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors ${o ? "border-primary bg-primary/10 pointer-events-none" : b ? "border-primary bg-primary/10" : "border-base-300 hover:border-primary hover:bg-base-200"}`,
622
- onDrop: W,
623
- onDragOver: se,
624
- onDragLeave: le,
625
- onClick: ce,
656
+ className: `border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors ${s ? "border-primary bg-primary/10 pointer-events-none" : b ? "border-primary bg-primary/10" : "border-base-300 hover:border-primary hover:bg-base-200"}`,
657
+ onDrop: ce,
658
+ onDragOver: de,
659
+ onDragLeave: he,
660
+ onClick: me,
626
661
  children: [
627
662
  /* @__PURE__ */ l(
628
663
  "input",
@@ -631,13 +666,13 @@ function Xe() {
631
666
  type: "file",
632
667
  accept: "image/*",
633
668
  className: "hidden",
634
- onChange: de
669
+ onChange: pe
635
670
  }
636
671
  ),
637
- o ? /* @__PURE__ */ m("div", { className: "flex flex-col items-center gap-2", children: [
672
+ s ? /* @__PURE__ */ u("div", { className: "flex flex-col items-center gap-2", children: [
638
673
  /* @__PURE__ */ l("span", { className: "loading loading-spinner loading-lg text-primary" }),
639
674
  /* @__PURE__ */ l("p", { className: "font-medium", children: e === "de" ? "Hintergrund wird entfernt..." : "Removing background..." })
640
- ] }) : /* @__PURE__ */ m("div", { className: "flex flex-col items-center gap-2", children: [
675
+ ] }) : /* @__PURE__ */ u("div", { className: "flex flex-col items-center gap-2", children: [
641
676
  /* @__PURE__ */ l(
642
677
  "svg",
643
678
  {
@@ -664,60 +699,60 @@ function Xe() {
664
699
  }
665
700
  ),
666
701
  /* @__PURE__ */ l(
667
- De,
702
+ Re,
668
703
  {
669
- isOpen: x,
670
- onClose: () => k(!1),
671
- onSubmit: me
704
+ isOpen: S,
705
+ onClose: () => I(!1),
706
+ onSubmit: fe
672
707
  }
673
708
  )
674
709
  ] });
675
710
  }
676
- function Je() {
711
+ function et() {
677
712
  return null;
678
713
  }
679
- const I = typeof import.meta < "u" && "/" || "/", _e = {
714
+ const N = typeof import.meta < "u" && "/" || "/", Be = {
680
715
  en: {
681
716
  1: {
682
- front: `${I}templates/front_ldpi_en.png`,
683
- back: `${I}templates/back_ldpi_en.png`,
717
+ front: `${N}templates/front_ldpi_en.png`,
718
+ back: `${N}templates/back_ldpi_en.png`,
684
719
  width: 1536,
685
720
  height: 1024
686
721
  },
687
722
  5: {
688
- front: `${I}templates/front_ldpi_en.png`,
689
- back: `${I}templates/back_ldpi_en.png`,
723
+ front: `${N}templates/front_ldpi_en.png`,
724
+ back: `${N}templates/back_ldpi_en.png`,
690
725
  width: 1536,
691
726
  height: 1024
692
727
  },
693
728
  10: {
694
- front: `${I}templates/front_ldpi_en.png`,
695
- back: `${I}templates/back_ldpi_en.png`,
729
+ front: `${N}templates/front_ldpi_en.png`,
730
+ back: `${N}templates/back_ldpi_en.png`,
696
731
  width: 1536,
697
732
  height: 1024
698
733
  }
699
734
  },
700
735
  de: {
701
736
  1: {
702
- front: `${I}templates/front_hdpi_de.webp`,
703
- back: `${I}templates/back_hdpi_de.webp`,
737
+ front: `${N}templates/front_hdpi_de.webp`,
738
+ back: `${N}templates/back_hdpi_de.webp`,
704
739
  width: 6144,
705
740
  height: 3200
706
741
  },
707
742
  5: {
708
- front: `${I}templates/front_hdpi_de.webp`,
709
- back: `${I}templates/back_hdpi_de.webp`,
743
+ front: `${N}templates/front_hdpi_de.webp`,
744
+ back: `${N}templates/back_hdpi_de.webp`,
710
745
  width: 6144,
711
746
  height: 3200
712
747
  },
713
748
  10: {
714
- front: `${I}templates/front_hdpi_de.webp`,
715
- back: `${I}templates/back_hdpi_de.webp`,
749
+ front: `${N}templates/front_hdpi_de.webp`,
750
+ back: `${N}templates/back_hdpi_de.webp`,
716
751
  width: 6144,
717
752
  height: 3200
718
753
  }
719
754
  }
720
- }, B = {
755
+ }, R = {
721
756
  front: {
722
757
  portrait: {
723
758
  x: 768,
@@ -763,7 +798,7 @@ const I = typeof import.meta < "u" && "/" || "/", _e = {
763
798
  align: "center"
764
799
  }
765
800
  }
766
- }, R = {
801
+ }, B = {
767
802
  front: {
768
803
  portrait: {
769
804
  x: 3074,
@@ -810,139 +845,139 @@ const I = typeof import.meta < "u" && "/" || "/", _e = {
810
845
  }
811
846
  }
812
847
  };
813
- function te(e) {
814
- return e === "de" ? R : B;
848
+ function ae(e) {
849
+ return e === "de" ? B : R;
815
850
  }
816
- function ne(e, t) {
817
- return _e[e][t];
851
+ function re(e, t) {
852
+ return Be[e][t];
818
853
  }
819
- const O = /* @__PURE__ */ new Map();
854
+ const K = /* @__PURE__ */ new Map();
820
855
  async function Y(e) {
821
- return O.has(e) ? O.get(e) : new Promise((t, a) => {
822
- const n = new Image();
823
- n.crossOrigin = "anonymous", n.onload = () => {
824
- O.set(e, n), t(n);
825
- }, n.onerror = a, n.src = e;
856
+ return K.has(e) ? K.get(e) : new Promise((t, n) => {
857
+ const a = new Image();
858
+ a.crossOrigin = "anonymous", a.onload = () => {
859
+ K.set(e, a), t(a);
860
+ }, a.onerror = n, a.src = e;
826
861
  });
827
862
  }
828
- function ae(e, t, a, n) {
829
- e.drawImage(t, 0, 0, a, n);
863
+ function oe(e, t, n, a) {
864
+ e.drawImage(t, 0, 0, n, a);
830
865
  }
831
- function Be(e, t, a, n, r, s, d = 1) {
832
- e.save(), e.beginPath(), e.ellipse(a, n, r, s, 0, 0, Math.PI * 2), e.closePath(), e.clip();
833
- const o = t.width / t.height, i = r / s, c = r * 2, u = s * 2;
866
+ function $e(e, t, n, a, r, o, c = 1) {
867
+ e.save(), e.beginPath(), e.ellipse(n, a, r, o, 0, 0, Math.PI * 2), e.closePath(), e.clip();
868
+ const s = t.width / t.height, i = r / o, d = r * 2, h = o * 2;
834
869
  let g, f;
835
- o > i ? (f = u, g = u * o) : (g = c, f = c / o), g *= d, f *= d;
836
- const b = a - g / 2, h = n - f / 2;
837
- e.drawImage(t, b, h, g, f), e.restore();
870
+ s > i ? (f = h, g = h * s) : (g = d, f = d / s), g *= c, f *= c;
871
+ const b = n - g / 2, m = a - f / 2;
872
+ e.drawImage(t, b, m, g, f), e.restore();
838
873
  }
839
- function re(e, t, a, n = "#2a3a2a") {
840
- e.save(), e.font = `${a.fontSize}px "Times New Roman", serif`, e.textAlign = a.align || "center", e.textBaseline = "middle", e.fillStyle = n, a.maxWidth ? e.fillText(t, a.x, a.y, a.maxWidth) : e.fillText(t, a.x, a.y), e.restore();
874
+ function ie(e, t, n, a = "#2a3a2a") {
875
+ e.save(), e.font = `${n.fontSize}px "Times New Roman", serif`, e.textAlign = n.align || "center", e.textBaseline = "middle", e.fillStyle = a, n.maxWidth ? e.fillText(t, n.x, n.y, n.maxWidth) : e.fillText(t, n.x, n.y), e.restore();
841
876
  }
842
- function Re(e, t, a, n = "#2a3a2a") {
843
- e.save(), e.font = `${a.fontSize}px "Times New Roman", serif`, e.textAlign = a.align || "center", e.textBaseline = "top", e.fillStyle = n;
844
- const r = a.maxWidth || 400, s = a.lineHeight || a.fontSize * 1.4, d = t.split(" "), o = [];
877
+ function Me(e, t, n, a = "#2a3a2a") {
878
+ e.save(), e.font = `${n.fontSize}px "Times New Roman", serif`, e.textAlign = n.align || "center", e.textBaseline = "top", e.fillStyle = a;
879
+ const r = n.maxWidth || 400, o = n.lineHeight || n.fontSize * 1.4, c = t.split(" "), s = [];
845
880
  let i = "";
846
- for (const g of d) {
881
+ for (const g of c) {
847
882
  const f = i ? `${i} ${g}` : g;
848
- e.measureText(f).width > r && i ? (o.push(i), i = g) : i = f;
883
+ e.measureText(f).width > r && i ? (s.push(i), i = g) : i = f;
849
884
  }
850
- i && o.push(i);
851
- const c = o.length * s;
852
- let u = a.y - c / 2;
853
- for (const g of o)
854
- e.fillText(g, a.x, u), u += s;
885
+ i && s.push(i);
886
+ const d = s.length * o;
887
+ let h = n.y - d / 2;
888
+ for (const g of s)
889
+ e.fillText(g, n.x, h), h += o;
855
890
  e.restore();
856
891
  }
857
- function $e(e, t, a, n, r, s = "#2a3a2a") {
858
- e.save(), e.font = `${r.fontSize}px "Times New Roman", serif`, e.textAlign = r.align || "center", e.textBaseline = "middle", e.fillStyle = s;
859
- const d = r.lineHeight || r.fontSize * 1.8, o = [t, a, n].filter(Boolean), i = (o.length - 1) * d;
860
- let c = r.y - i / 2;
861
- for (const u of o)
862
- u && (e.fillText(u, r.x, c), c += d);
892
+ function ze(e, t, n, a, r, o = "#2a3a2a") {
893
+ e.save(), e.font = `${r.fontSize}px "Times New Roman", serif`, e.textAlign = r.align || "center", e.textBaseline = "middle", e.fillStyle = o;
894
+ const c = r.lineHeight || r.fontSize * 1.8, s = [t, n, a].filter(Boolean), i = (s.length - 1) * c;
895
+ let d = r.y - i / 2;
896
+ for (const h of s)
897
+ h && (e.fillText(h, r.x, d), d += c);
863
898
  e.restore();
864
899
  }
865
- async function oe(e, t, a, n, r, s, d, o = 1) {
900
+ async function se(e, t, n, a, r, o, c, s = 1) {
866
901
  const i = e.getContext("2d");
867
902
  if (!i) return;
868
- e.width = s, e.height = d, i.clearRect(0, 0, s, d);
869
- const c = await Y(t);
870
- if (ae(i, c, s, d), a)
903
+ e.width = o, e.height = c, i.clearRect(0, 0, o, c);
904
+ const d = await Y(t);
905
+ if (oe(i, d, o, c), n)
871
906
  try {
872
- const u = await Y(a);
873
- Be(
907
+ const h = await Y(n);
908
+ $e(
874
909
  i,
875
- u,
910
+ h,
876
911
  r.portrait.x,
877
912
  r.portrait.y,
878
913
  r.portrait.radiusX,
879
914
  r.portrait.radiusY,
880
- o
915
+ s
881
916
  );
882
- } catch (u) {
883
- console.error("Failed to load portrait:", u);
917
+ } catch (h) {
918
+ console.error("Failed to load portrait:", h);
884
919
  }
885
- n && re(i, n, r.namePlate);
920
+ a && ie(i, a, r.namePlate);
886
921
  }
887
- async function ie(e, t, a, n, r, s, d, o, i) {
888
- const c = e.getContext("2d");
889
- if (!c) return;
890
- e.width = o, e.height = i, c.clearRect(0, 0, o, i);
891
- const u = await Y(t);
892
- ae(c, u, o, i), d.contactInfo && (a || n || r) && $e(c, a, n, r, d.contactInfo), d.description && s && Re(c, s, d.description), a && re(c, a, d.namePlate);
922
+ async function le(e, t, n, a, r, o, c, s, i) {
923
+ const d = e.getContext("2d");
924
+ if (!d) return;
925
+ e.width = s, e.height = i, d.clearRect(0, 0, s, i);
926
+ const h = await Y(t);
927
+ oe(d, h, s, i), c.contactInfo && (n || a || r) && ze(d, n, a, r, c.contactInfo), c.description && o && Me(d, o, c.description), n && ie(d, n, c.namePlate);
893
928
  }
894
- function Qe() {
895
- const e = y((w) => w.voucherConfig.language), t = y((w) => w.voucherConfig.hours), a = y((w) => w.voucherConfig.description), n = y((w) => w.personalInfo), r = y((w) => w.portrait), s = y((w) => w.currentSide), d = y((w) => w.flipSide), o = z(e), i = $(null), c = $(null), u = $(null), [g, f] = E(!1), b = ne(e, t), h = te(e), x = r.useEnhanced && r.enhanced ? r.enhanced : r.original, k = J(e, t, a);
896
- G(() => {
897
- i.current && oe(
929
+ function tt() {
930
+ const e = w((y) => y.voucherConfig.language), t = w((y) => y.voucherConfig.hours), n = w((y) => y.voucherConfig.description), a = w((y) => y.personalInfo), r = w((y) => y.portrait), o = w((y) => y.currentSide), c = w((y) => y.flipSide), s = $(e), i = D(null), d = D(null), h = D(null), [g, f] = E(!1), b = re(e, t), m = ae(e), S = r.useEnhanced && r.enhanced ? r.enhanced : r.original, I = ee(e, t, n);
931
+ O(() => {
932
+ i.current && se(
898
933
  i.current,
899
934
  b.front,
900
- x,
901
- n.name,
902
- h.front,
935
+ S,
936
+ a.name,
937
+ m.front,
903
938
  b.width,
904
939
  b.height,
905
940
  r.zoom
906
941
  );
907
- }, [b, x, n.name, h, r.zoom]), G(() => {
908
- c.current && ie(
909
- c.current,
942
+ }, [b, S, a.name, m, r.zoom]), O(() => {
943
+ d.current && le(
944
+ d.current,
910
945
  b.back,
911
- n.name,
912
- n.email,
913
- n.phone,
914
- k,
915
- h.back,
946
+ a.name,
947
+ a.email,
948
+ a.phone,
949
+ I,
950
+ m.back,
916
951
  b.width,
917
952
  b.height
918
953
  );
919
- }, [b, n, k, h]);
920
- const v = () => {
954
+ }, [b, a, I, m]);
955
+ const x = () => {
921
956
  f(!0), setTimeout(() => {
922
- d(), f(!1);
957
+ c(), f(!1);
923
958
  }, 150);
924
- }, S = b.width / b.height;
925
- return /* @__PURE__ */ m("div", { className: "space-y-4", children: [
926
- /* @__PURE__ */ m("div", { className: "flex justify-between items-center", children: [
927
- /* @__PURE__ */ m("div", { className: "tabs tabs-boxed bg-base-200", children: [
959
+ }, A = b.width / b.height;
960
+ return /* @__PURE__ */ u("div", { className: "space-y-4", children: [
961
+ /* @__PURE__ */ u("div", { className: "flex justify-between items-center", children: [
962
+ /* @__PURE__ */ u("div", { className: "tabs tabs-boxed bg-base-200", children: [
928
963
  /* @__PURE__ */ l(
929
964
  "button",
930
965
  {
931
- className: `tab ${s === "front" ? "tab-active bg-primary text-primary-content font-semibold" : ""}`,
932
- onClick: () => s !== "front" && v(),
933
- children: o.preview.front
966
+ className: `tab ${o === "front" ? "tab-active bg-primary text-primary-content font-semibold" : ""}`,
967
+ onClick: () => o !== "front" && x(),
968
+ children: s.preview.front
934
969
  }
935
970
  ),
936
971
  /* @__PURE__ */ l(
937
972
  "button",
938
973
  {
939
- className: `tab ${s === "back" ? "tab-active bg-primary text-primary-content font-semibold" : ""}`,
940
- onClick: () => s !== "back" && v(),
941
- children: o.preview.back
974
+ className: `tab ${o === "back" ? "tab-active bg-primary text-primary-content font-semibold" : ""}`,
975
+ onClick: () => o !== "back" && x(),
976
+ children: s.preview.back
942
977
  }
943
978
  )
944
979
  ] }),
945
- /* @__PURE__ */ m("button", { className: "btn btn-ghost btn-sm", onClick: v, children: [
980
+ /* @__PURE__ */ u("button", { className: "btn btn-ghost btn-sm", onClick: x, children: [
946
981
  /* @__PURE__ */ l(
947
982
  "svg",
948
983
  {
@@ -962,28 +997,28 @@ function Qe() {
962
997
  )
963
998
  }
964
999
  ),
965
- o.preview.flip
1000
+ s.preview.flip
966
1001
  ] })
967
1002
  ] }),
968
- /* @__PURE__ */ m(
1003
+ /* @__PURE__ */ u(
969
1004
  "div",
970
1005
  {
971
- ref: u,
1006
+ ref: h,
972
1007
  className: "relative w-full overflow-hidden shadow-lg",
973
- style: { aspectRatio: S },
1008
+ style: { aspectRatio: A },
974
1009
  children: [
975
1010
  /* @__PURE__ */ l(
976
1011
  "canvas",
977
1012
  {
978
1013
  ref: i,
979
- className: `absolute inset-0 w-full h-full transition-all duration-300 ${s === "front" ? g ? "opacity-0 scale-95" : "opacity-100 scale-100" : "opacity-0 scale-95 pointer-events-none"}`
1014
+ className: `absolute inset-0 w-full h-full transition-all duration-300 ${o === "front" ? g ? "opacity-0 scale-95" : "opacity-100 scale-100" : "opacity-0 scale-95 pointer-events-none"}`
980
1015
  }
981
1016
  ),
982
1017
  /* @__PURE__ */ l(
983
1018
  "canvas",
984
1019
  {
985
- ref: c,
986
- className: `absolute inset-0 w-full h-full transition-all duration-300 ${s === "back" ? g ? "opacity-0 scale-95" : "opacity-100 scale-100" : "opacity-0 scale-95 pointer-events-none"}`
1020
+ ref: d,
1021
+ className: `absolute inset-0 w-full h-full transition-all duration-300 ${o === "back" ? g ? "opacity-0 scale-95" : "opacity-100 scale-100" : "opacity-0 scale-95 pointer-events-none"}`
987
1022
  }
988
1023
  )
989
1024
  ]
@@ -991,85 +1026,85 @@ function Qe() {
991
1026
  )
992
1027
  ] });
993
1028
  }
994
- function et() {
995
- const e = $(null), t = $(null);
1029
+ function nt() {
1030
+ const e = D(null), t = D(null);
996
1031
  return { frontCanvasRef: e, backCanvasRef: t };
997
1032
  }
998
- async function ze(e) {
1033
+ async function He(e) {
999
1034
  const {
1000
1035
  frontTemplateSrc: t,
1001
- backTemplateSrc: a,
1002
- templateWidth: n,
1036
+ backTemplateSrc: n,
1037
+ templateWidth: a,
1003
1038
  templateHeight: r,
1004
- layout: s,
1005
- portrait: d,
1006
- portraitZoom: o = 1,
1039
+ layout: o,
1040
+ portrait: c,
1041
+ portraitZoom: s = 1,
1007
1042
  name: i,
1008
- email: c,
1009
- phone: u,
1043
+ email: d,
1044
+ phone: h,
1010
1045
  description: g
1011
1046
  } = e, f = document.createElement("canvas"), b = document.createElement("canvas");
1012
1047
  await Promise.all([
1013
- oe(f, t, d, i, s.front, n, r, o),
1014
- ie(b, a, i, c, u, g, s.back, n, r)
1048
+ se(f, t, c, i, o.front, a, r, s),
1049
+ le(b, n, i, d, h, g, o.back, a, r)
1015
1050
  ]);
1016
- const h = new ye({
1051
+ const m = new ye({
1017
1052
  orientation: "landscape",
1018
1053
  unit: "mm",
1019
1054
  format: "a4"
1020
- }), x = 297, k = 210, v = 10, S = n / r;
1021
- let w = x - v * 2, N = w / S;
1022
- N > k - v * 2 && (N = k - v * 2, w = N * S);
1023
- const T = (x - w) / 2, L = (k - N) / 2, H = f.toDataURL("image/jpeg", 0.95);
1024
- h.addImage(H, "JPEG", T, L, w, N), h.addPage();
1025
- const W = b.toDataURL("image/jpeg", 0.95);
1026
- return h.addImage(W, "JPEG", T, L, w, N), h.output("blob");
1055
+ }), S = 297, I = 210, x = 10, A = a / r;
1056
+ let y = S - x * 2, P = y / A;
1057
+ P > I - x * 2 && (P = I - x * 2, y = P * A);
1058
+ const L = (S - y) / 2, _ = (I - P) / 2, C = f.toDataURL("image/jpeg", 0.95);
1059
+ m.addImage(C, "JPEG", L, _, y, P), m.addPage();
1060
+ const M = b.toDataURL("image/jpeg", 0.95);
1061
+ return m.addImage(M, "JPEG", L, _, y, P), m.output("blob");
1027
1062
  }
1028
- function He(e, t) {
1029
- const a = URL.createObjectURL(e), n = document.createElement("a");
1030
- n.href = a, n.download = t, document.body.appendChild(n), n.click(), document.body.removeChild(n), URL.revokeObjectURL(a);
1063
+ function Ue(e, t) {
1064
+ const n = URL.createObjectURL(e), a = document.createElement("a");
1065
+ a.href = n, a.download = t, document.body.appendChild(a), a.click(), document.body.removeChild(a), URL.revokeObjectURL(n);
1031
1066
  }
1032
- async function Me(e) {
1033
- const t = await ze(e);
1034
- He(t, e.filename);
1067
+ async function Fe(e) {
1068
+ const t = await He(e);
1069
+ Ue(t, e.filename);
1035
1070
  }
1036
- function tt() {
1037
- const e = y((h) => h.voucherConfig.language), t = y((h) => h.voucherConfig.hours), a = y((h) => h.voucherConfig.description), n = y((h) => h.personalInfo), r = y((h) => h.portrait), s = y((h) => h.isExporting), d = y((h) => h.setIsExporting), o = z(e), i = ne(e, t), c = te(e), u = r.useEnhanced && r.enhanced ? r.enhanced : r.original, g = J(e, t, a), f = n.name.trim().length > 0 && n.email.trim().length > 0 && n.phone.trim().length > 0 && r.original !== null;
1071
+ function at() {
1072
+ const e = w((m) => m.voucherConfig.language), t = w((m) => m.voucherConfig.hours), n = w((m) => m.voucherConfig.description), a = w((m) => m.personalInfo), r = w((m) => m.portrait), o = w((m) => m.isExporting), c = w((m) => m.setIsExporting), s = $(e), i = re(e, t), d = ae(e), h = r.useEnhanced && r.enhanced ? r.enhanced : r.original, g = ee(e, t, n), f = a.name.trim().length > 0 && a.email.trim().length > 0 && a.phone.trim().length > 0 && r.original !== null;
1038
1073
  return /* @__PURE__ */ l(
1039
1074
  "button",
1040
1075
  {
1041
- className: `btn btn-primary flex-1 ${s ? "loading" : ""}`,
1076
+ className: `btn btn-primary flex-1 ${o ? "loading" : ""}`,
1042
1077
  onClick: async () => {
1043
- if (!(!f || s)) {
1044
- d(!0);
1078
+ if (!(!f || o)) {
1079
+ c(!0);
1045
1080
  try {
1046
- const h = `zeitgutschein-${t}h-${n.name.replace(/\s+/g, "-").toLowerCase()}.pdf`;
1047
- await Me({
1081
+ const m = `zeitgutschein-${t}h-${a.name.replace(/\s+/g, "-").toLowerCase()}.pdf`;
1082
+ await Fe({
1048
1083
  frontTemplateSrc: i.front,
1049
1084
  backTemplateSrc: i.back,
1050
1085
  templateWidth: i.width,
1051
1086
  templateHeight: i.height,
1052
- layout: c,
1053
- portrait: u,
1087
+ layout: d,
1088
+ portrait: h,
1054
1089
  portraitZoom: r.zoom,
1055
- name: n.name,
1056
- email: n.email,
1057
- phone: n.phone,
1090
+ name: a.name,
1091
+ email: a.email,
1092
+ phone: a.phone,
1058
1093
  description: g,
1059
- filename: h
1094
+ filename: m
1060
1095
  });
1061
- } catch (h) {
1062
- console.error("PDF export failed:", h);
1096
+ } catch (m) {
1097
+ console.error("PDF export failed:", m);
1063
1098
  } finally {
1064
- d(!1);
1099
+ c(!1);
1065
1100
  }
1066
1101
  }
1067
1102
  },
1068
- disabled: !f || s,
1069
- children: s ? /* @__PURE__ */ m(M, { children: [
1103
+ disabled: !f || o,
1104
+ children: o ? /* @__PURE__ */ u(j, { children: [
1070
1105
  /* @__PURE__ */ l("span", { className: "loading loading-spinner loading-sm" }),
1071
- o.export.exporting
1072
- ] }) : /* @__PURE__ */ m(M, { children: [
1106
+ s.export.exporting
1107
+ ] }) : /* @__PURE__ */ u(j, { children: [
1073
1108
  /* @__PURE__ */ l(
1074
1109
  "svg",
1075
1110
  {
@@ -1089,21 +1124,21 @@ function tt() {
1089
1124
  )
1090
1125
  }
1091
1126
  ),
1092
- o.export.button
1127
+ s.export.button
1093
1128
  ] })
1094
1129
  }
1095
1130
  );
1096
1131
  }
1097
- function Ue() {
1098
- const e = y((n) => n.voucherConfig.language), t = y((n) => n.setLanguage), a = (n) => {
1099
- t(n);
1132
+ function We() {
1133
+ const e = w((a) => a.voucherConfig.language), t = w((a) => a.setLanguage), n = (a) => {
1134
+ t(a);
1100
1135
  };
1101
- return /* @__PURE__ */ m("div", { className: "join", children: [
1136
+ return /* @__PURE__ */ u("div", { className: "join", children: [
1102
1137
  /* @__PURE__ */ l(
1103
1138
  "button",
1104
1139
  {
1105
1140
  className: `join-item btn btn-sm ${e === "de" ? "btn-active btn-primary" : "btn-ghost"}`,
1106
- onClick: () => a("de"),
1141
+ onClick: () => n("de"),
1107
1142
  children: "DE"
1108
1143
  }
1109
1144
  ),
@@ -1111,21 +1146,21 @@ function Ue() {
1111
1146
  "button",
1112
1147
  {
1113
1148
  className: `join-item btn btn-sm ${e === "en" ? "btn-active btn-primary" : "btn-ghost"}`,
1114
- onClick: () => a("en"),
1149
+ onClick: () => n("en"),
1115
1150
  children: "EN"
1116
1151
  }
1117
1152
  )
1118
1153
  ] });
1119
1154
  }
1120
- function nt() {
1121
- const e = y((a) => a.voucherConfig.language), t = z(e);
1122
- return /* @__PURE__ */ m("div", { className: "navbar bg-currency-green text-currency-cream shadow-lg", children: [
1155
+ function rt() {
1156
+ const e = w((n) => n.voucherConfig.language), t = $(e);
1157
+ return /* @__PURE__ */ u("div", { className: "navbar bg-currency-green text-currency-cream shadow-lg", children: [
1123
1158
  /* @__PURE__ */ l("div", { className: "navbar-start", children: /* @__PURE__ */ l("a", { className: "btn btn-ghost text-xl font-currency font-bold", children: t.header.title }) }),
1124
1159
  /* @__PURE__ */ l("div", { className: "navbar-center hidden sm:flex", children: /* @__PURE__ */ l("span", { className: "text-sm opacity-80", children: t.header.subtitle }) }),
1125
- /* @__PURE__ */ l("div", { className: "navbar-end", children: /* @__PURE__ */ l(Ue, {}) })
1160
+ /* @__PURE__ */ l("div", { className: "navbar-end", children: /* @__PURE__ */ l(We, {}) })
1126
1161
  ] });
1127
1162
  }
1128
- const U = "/", Fe = {
1163
+ const U = "/", Ke = {
1129
1164
  id: "time-voucher-classic-de",
1130
1165
  name: "Zeitgutschein Classic",
1131
1166
  type: "time-voucher",
@@ -1179,17 +1214,17 @@ const U = "/", Fe = {
1179
1214
  ],
1180
1215
  layout: {
1181
1216
  front: {
1182
- portrait: R.front.portrait,
1183
- name: R.front.namePlate
1217
+ portrait: B.front.portrait,
1218
+ name: B.front.namePlate
1184
1219
  },
1185
1220
  back: {
1186
- name: R.back.namePlate,
1187
- contactInfo: R.back.contactInfo,
1188
- description: R.back.description
1221
+ name: B.back.namePlate,
1222
+ contactInfo: B.back.contactInfo,
1223
+ description: B.back.description
1189
1224
  }
1190
1225
  },
1191
1226
  languages: ["de"]
1192
- }, We = {
1227
+ }, je = {
1193
1228
  id: "time-voucher-classic-en",
1194
1229
  name: "Time Voucher Classic",
1195
1230
  type: "time-voucher",
@@ -1243,86 +1278,86 @@ const U = "/", Fe = {
1243
1278
  ],
1244
1279
  layout: {
1245
1280
  front: {
1246
- portrait: B.front.portrait,
1247
- name: B.front.namePlate
1281
+ portrait: R.front.portrait,
1282
+ name: R.front.namePlate
1248
1283
  },
1249
1284
  back: {
1250
- name: B.back.namePlate,
1251
- contactInfo: B.back.contactInfo,
1252
- description: B.back.description
1285
+ name: R.back.namePlate,
1286
+ contactInfo: R.back.contactInfo,
1287
+ description: R.back.description
1253
1288
  }
1254
1289
  },
1255
1290
  languages: ["en"]
1256
- }, X = [
1257
- Fe,
1258
- We
1259
- ], Ke = {
1291
+ }, Q = [
1292
+ Ke,
1293
+ je
1294
+ ], Oe = {
1260
1295
  async listTemplates(e) {
1261
- let t = [...X];
1262
- return e != null && e.type && (t = t.filter((a) => a.type === e.type)), e != null && e.category && (t = t.filter((a) => a.category === e.category)), e != null && e.language && (t = t.filter((a) => a.languages.includes(e.language))), t;
1296
+ let t = [...Q];
1297
+ return e != null && e.type && (t = t.filter((n) => n.type === e.type)), e != null && e.category && (t = t.filter((n) => n.category === e.category)), e != null && e.language && (t = t.filter((n) => n.languages.includes(e.language))), t;
1263
1298
  },
1264
1299
  async getTemplate(e) {
1265
- const t = X.find((a) => a.id === e);
1300
+ const t = Q.find((n) => n.id === e);
1266
1301
  if (!t)
1267
1302
  throw new Error(`Template not found: ${e}`);
1268
1303
  return t;
1269
1304
  }
1270
1305
  };
1271
- function at(e) {
1306
+ function ot(e) {
1272
1307
  return e === "de" ? "time-voucher-classic-de" : "time-voucher-classic-en";
1273
1308
  }
1274
- let F = Ke;
1275
- function rt(e) {
1309
+ let F = Oe;
1310
+ function it(e) {
1276
1311
  F = e;
1277
1312
  }
1278
- function ot() {
1313
+ function st() {
1279
1314
  return F;
1280
1315
  }
1281
- async function it(e) {
1316
+ async function lt(e) {
1282
1317
  return F.listTemplates(e);
1283
1318
  }
1284
- async function st(e) {
1319
+ async function ct(e) {
1285
1320
  return F.getTemplate(e);
1286
1321
  }
1287
1322
  export {
1288
- De as ApiKeyModal,
1289
- Qe as BillPreview,
1290
- tt as ExportButton,
1291
- nt as Header,
1292
- R as LAYOUT_HDPI,
1293
- B as LAYOUT_LDPI,
1294
- Ue as LanguageToggle,
1295
- Ve as PersonalInfoForm,
1296
- Xe as PortraitUpload,
1297
- _e as TEMPLATES,
1298
- Je as VoucherConfig,
1299
- He as downloadBlob,
1300
- $e as drawContactInfo,
1301
- Re as drawMultilineText,
1302
- Be as drawOvalPortrait,
1303
- ae as drawTemplate,
1304
- re as drawText,
1305
- Ze as enhancePortrait,
1306
- Te as enhancePortraitFallback,
1307
- Me as exportBillAsPDF,
1308
- J as formatDescription,
1309
- ze as generateBillPDF,
1323
+ Re as ApiKeyModal,
1324
+ tt as BillPreview,
1325
+ at as ExportButton,
1326
+ rt as Header,
1327
+ B as LAYOUT_HDPI,
1328
+ R as LAYOUT_LDPI,
1329
+ We as LanguageToggle,
1330
+ Xe as PersonalInfoForm,
1331
+ Qe as PortraitUpload,
1332
+ Be as TEMPLATES,
1333
+ et as VoucherConfig,
1334
+ Ne as applyEngravingEffect,
1335
+ Ue as downloadBlob,
1336
+ ze as drawContactInfo,
1337
+ Me as drawMultilineText,
1338
+ $e as drawOvalPortrait,
1339
+ oe as drawTemplate,
1340
+ ie as drawText,
1341
+ Je as enhancePortrait,
1342
+ Fe as exportBillAsPDF,
1343
+ ee as formatDescription,
1344
+ He as generateBillPDF,
1310
1345
  q as getApiKey,
1311
- at as getDefaultTemplateId,
1312
- te as getLayout,
1313
- ne as getTemplate,
1314
- st as getTemplateById,
1315
- ot as getTemplateProvider,
1316
- Ce as hasApiKey,
1317
- it as listTemplates,
1346
+ ot as getDefaultTemplateId,
1347
+ ae as getLayout,
1348
+ re as getTemplate,
1349
+ ct as getTemplateById,
1350
+ st as getTemplateProvider,
1351
+ Le as hasApiKey,
1352
+ lt as listTemplates,
1318
1353
  Y as loadImage,
1319
- Ae as removeBackground,
1320
- ie as renderBackSide,
1321
- oe as renderFrontSide,
1322
- Se as setApiKey,
1323
- rt as setTemplateProvider,
1324
- Ke as staticTemplateProvider,
1325
- z as t,
1326
- et as useBillCanvasRefs,
1327
- y as useBillStore
1354
+ _e as removeBackground,
1355
+ le as renderBackSide,
1356
+ se as renderFrontSide,
1357
+ Ae as setApiKey,
1358
+ it as setTemplateProvider,
1359
+ Oe as staticTemplateProvider,
1360
+ $ as t,
1361
+ nt as useBillCanvasRefs,
1362
+ w as useBillStore
1328
1363
  };