@antontranelis/money-printer 1.0.5 → 1.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.cjs +1 -1
- package/dist/index.js +444 -454
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { create as
|
|
3
|
-
import { persist as
|
|
4
|
-
import { useState as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
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 N, useCallback as C, useRef as $, useEffect as G } from "react";
|
|
5
|
+
import ye from "jspdf";
|
|
6
|
+
const V = {
|
|
7
7
|
personalInfo: {
|
|
8
8
|
name: "",
|
|
9
9
|
email: "",
|
|
@@ -23,10 +23,10 @@ const G = {
|
|
|
23
23
|
currentSide: "front",
|
|
24
24
|
isEnhancing: !1,
|
|
25
25
|
isExporting: !1
|
|
26
|
-
},
|
|
27
|
-
|
|
26
|
+
}, w = fe()(
|
|
27
|
+
be(
|
|
28
28
|
(e) => ({
|
|
29
|
-
...
|
|
29
|
+
...V,
|
|
30
30
|
setPersonalInfo: (t) => e((a) => ({
|
|
31
31
|
personalInfo: { ...a.personalInfo, ...t }
|
|
32
32
|
})),
|
|
@@ -72,7 +72,7 @@ const G = {
|
|
|
72
72
|
setHours: (t) => e((a) => ({
|
|
73
73
|
voucherConfig: { ...a.voucherConfig, hours: t }
|
|
74
74
|
})),
|
|
75
|
-
reset: () => e(
|
|
75
|
+
reset: () => e(V)
|
|
76
76
|
}),
|
|
77
77
|
{
|
|
78
78
|
name: "money-generator-storage",
|
|
@@ -82,7 +82,7 @@ const G = {
|
|
|
82
82
|
})
|
|
83
83
|
}
|
|
84
84
|
)
|
|
85
|
-
),
|
|
85
|
+
), we = {
|
|
86
86
|
header: {
|
|
87
87
|
title: "Money Generator",
|
|
88
88
|
subtitle: "Erstelle deinen persönlichen Zeitgutschein"
|
|
@@ -129,7 +129,7 @@ const G = {
|
|
|
129
129
|
bill: {
|
|
130
130
|
descriptionText: "Für diesen Schein erhältst du {hours} {hourLabel} meiner Zeit oder ein gleichwertiges Dankeschön"
|
|
131
131
|
}
|
|
132
|
-
},
|
|
132
|
+
}, ve = {
|
|
133
133
|
header: {
|
|
134
134
|
title: "Money Generator",
|
|
135
135
|
subtitle: "Create your personal time voucher"
|
|
@@ -176,20 +176,20 @@ const G = {
|
|
|
176
176
|
bill: {
|
|
177
177
|
descriptionText: "This voucher entitles you to {hours} {hourLabel} of my time or an equivalent thank you"
|
|
178
178
|
}
|
|
179
|
-
},
|
|
180
|
-
function
|
|
181
|
-
return
|
|
179
|
+
}, xe = { de: we, en: ve };
|
|
180
|
+
function z(e) {
|
|
181
|
+
return xe[e];
|
|
182
182
|
}
|
|
183
183
|
function J(e, t, a) {
|
|
184
184
|
if (a && a.trim())
|
|
185
185
|
return a;
|
|
186
|
-
const n =
|
|
186
|
+
const n = z(e), r = t === 1 ? n.form.voucher.hourLabel : n.form.voucher.hoursLabel;
|
|
187
187
|
return n.bill.descriptionText.replace("{hours}", t.toString()).replace("{hourLabel}", r);
|
|
188
188
|
}
|
|
189
|
-
function
|
|
190
|
-
const e =
|
|
191
|
-
return /* @__PURE__ */
|
|
192
|
-
/* @__PURE__ */
|
|
189
|
+
function Ve() {
|
|
190
|
+
const e = w((r) => r.voucherConfig.language), t = w((r) => r.personalInfo), a = w((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
193
|
/* @__PURE__ */ l("label", { className: "label", children: /* @__PURE__ */ l("span", { className: "label-text font-medium", children: n.form.personalInfo.name }) }),
|
|
194
194
|
/* @__PURE__ */ l(
|
|
195
195
|
"input",
|
|
@@ -202,7 +202,7 @@ function Oe() {
|
|
|
202
202
|
}
|
|
203
203
|
)
|
|
204
204
|
] }),
|
|
205
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ m("div", { className: "form-control", children: [
|
|
206
206
|
/* @__PURE__ */ l("label", { className: "label", children: /* @__PURE__ */ l("span", { className: "label-text font-medium", children: n.form.personalInfo.email }) }),
|
|
207
207
|
/* @__PURE__ */ l(
|
|
208
208
|
"input",
|
|
@@ -215,7 +215,7 @@ function Oe() {
|
|
|
215
215
|
}
|
|
216
216
|
)
|
|
217
217
|
] }),
|
|
218
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ m("div", { className: "form-control", children: [
|
|
219
219
|
/* @__PURE__ */ l("label", { className: "label", children: /* @__PURE__ */ l("span", { className: "label-text font-medium", children: n.form.personalInfo.phone }) }),
|
|
220
220
|
/* @__PURE__ */ l(
|
|
221
221
|
"input",
|
|
@@ -230,7 +230,7 @@ function Oe() {
|
|
|
230
230
|
] })
|
|
231
231
|
] });
|
|
232
232
|
}
|
|
233
|
-
const
|
|
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 = {
|
|
234
234
|
vintage: "portrait in the style of vintage currency engraving, fine line work, crosshatching, sepia tones, detailed stippling, classic bank note portrait style",
|
|
235
235
|
engraved: "portrait as detailed intaglio engraving, currency bill style, fine parallel lines, high contrast, official government portrait",
|
|
236
236
|
currency: "portrait rendered as US dollar bill engraving, official currency portrait style, green tint, fine line engraving technique"
|
|
@@ -245,80 +245,80 @@ const K = {}, be = "https://api.stability.ai/v1/generation", ye = "https://api.s
|
|
|
245
245
|
{ width: 832, height: 1216 },
|
|
246
246
|
{ width: 896, height: 1152 }
|
|
247
247
|
];
|
|
248
|
-
function
|
|
248
|
+
function Ee(e, t) {
|
|
249
249
|
const a = e / t;
|
|
250
250
|
let n = Z[0], r = 1 / 0;
|
|
251
|
-
for (const
|
|
252
|
-
const
|
|
253
|
-
|
|
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);
|
|
254
254
|
}
|
|
255
255
|
return n;
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function Pe(e) {
|
|
258
258
|
return new Promise((t, a) => {
|
|
259
259
|
const n = new Image();
|
|
260
260
|
n.onload = () => {
|
|
261
|
-
const r =
|
|
262
|
-
|
|
263
|
-
const
|
|
264
|
-
if (!
|
|
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
265
|
a(new Error("Failed to get canvas context"));
|
|
266
266
|
return;
|
|
267
267
|
}
|
|
268
|
-
const
|
|
269
|
-
let
|
|
270
|
-
|
|
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
271
|
}, n.onerror = () => a(new Error("Failed to load image")), n.src = e;
|
|
272
272
|
});
|
|
273
273
|
}
|
|
274
274
|
function ee(e) {
|
|
275
|
-
var
|
|
276
|
-
const t = e.split(","), a = ((
|
|
277
|
-
for (let
|
|
278
|
-
|
|
279
|
-
return new Blob([
|
|
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 });
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function q() {
|
|
282
282
|
var t;
|
|
283
|
-
const e = typeof import.meta < "u" && (
|
|
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
284
|
return e && e !== "your-api-key-here" ? e : typeof localStorage < "u" ? localStorage.getItem(Q) : null;
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function Se(e) {
|
|
287
287
|
localStorage.setItem(Q, e);
|
|
288
288
|
}
|
|
289
|
-
function
|
|
290
|
-
return
|
|
289
|
+
function Ce() {
|
|
290
|
+
return q() !== null;
|
|
291
291
|
}
|
|
292
|
-
async function
|
|
293
|
-
const t =
|
|
292
|
+
async function Ze(e) {
|
|
293
|
+
const t = q();
|
|
294
294
|
if (!t)
|
|
295
295
|
throw new Error("No Stability AI API key configured");
|
|
296
|
-
const { imageDataUrl: a, style: n, strength: r = 0.35 } = e,
|
|
297
|
-
|
|
298
|
-
const
|
|
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`, {
|
|
299
299
|
method: "POST",
|
|
300
300
|
headers: {
|
|
301
301
|
Authorization: `Bearer ${t}`,
|
|
302
302
|
Accept: "application/json"
|
|
303
303
|
},
|
|
304
|
-
body:
|
|
304
|
+
body: o
|
|
305
305
|
});
|
|
306
|
-
if (!
|
|
307
|
-
const
|
|
308
|
-
throw console.error("Stability AI error:",
|
|
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}`);
|
|
309
309
|
}
|
|
310
|
-
const
|
|
311
|
-
if (!
|
|
310
|
+
const u = await c.json();
|
|
311
|
+
if (!u.artifacts || u.artifacts.length === 0)
|
|
312
312
|
throw new Error("No image generated");
|
|
313
|
-
return `data:image/png;base64,${
|
|
313
|
+
return `data:image/png;base64,${u.artifacts[0].base64}`;
|
|
314
314
|
}
|
|
315
|
-
async function
|
|
316
|
-
const t =
|
|
315
|
+
async function Ae(e) {
|
|
316
|
+
const t = q();
|
|
317
317
|
if (!t)
|
|
318
318
|
throw new Error("No Stability AI API key configured");
|
|
319
319
|
const a = ee(e), n = new FormData();
|
|
320
320
|
n.append("image", a, "image.png"), n.append("output_format", "png");
|
|
321
|
-
const r = await fetch(
|
|
321
|
+
const r = await fetch(ke, {
|
|
322
322
|
method: "POST",
|
|
323
323
|
headers: {
|
|
324
324
|
Authorization: `Bearer ${t}`,
|
|
@@ -327,63 +327,63 @@ async function Ee(e) {
|
|
|
327
327
|
body: n
|
|
328
328
|
});
|
|
329
329
|
if (!r.ok) {
|
|
330
|
-
const
|
|
331
|
-
throw console.error("Stability AI remove background error:",
|
|
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}`);
|
|
332
332
|
}
|
|
333
|
-
const
|
|
334
|
-
return new Promise((
|
|
335
|
-
const
|
|
336
|
-
|
|
333
|
+
const s = await r.blob();
|
|
334
|
+
return new Promise((d, o) => {
|
|
335
|
+
const i = new FileReader();
|
|
336
|
+
i.onload = () => d(i.result), i.onerror = () => o(new Error("Failed to read result")), i.readAsDataURL(s);
|
|
337
337
|
});
|
|
338
338
|
}
|
|
339
|
-
async function
|
|
339
|
+
async function Te(e) {
|
|
340
340
|
return new Promise((t, a) => {
|
|
341
341
|
const n = new Image();
|
|
342
342
|
n.onload = () => {
|
|
343
|
-
const r = document.createElement("canvas"),
|
|
344
|
-
if (!
|
|
343
|
+
const r = document.createElement("canvas"), s = r.getContext("2d");
|
|
344
|
+
if (!s) {
|
|
345
345
|
a(new Error("Failed to get canvas context"));
|
|
346
346
|
return;
|
|
347
347
|
}
|
|
348
|
-
r.width = n.width, r.height = n.height,
|
|
349
|
-
const
|
|
350
|
-
for (let
|
|
351
|
-
const
|
|
352
|
-
if (
|
|
353
|
-
const
|
|
354
|
-
let
|
|
355
|
-
|
|
356
|
-
const
|
|
357
|
-
|
|
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
|
+
const b = 0.299 * c + 0.587 * u + 0.114 * g, h = 1.4;
|
|
354
|
+
let x = 259 * (h * 255 + 255) / (255 * (259 - h * 255)) * (b - 128) + 128;
|
|
355
|
+
x = Math.max(0, Math.min(255, x));
|
|
356
|
+
const v = Math.min(255, x * 1.1 + 20), S = Math.min(255, x * 0.95 + 10), y = Math.min(255, x * 0.8);
|
|
357
|
+
o[i] = v, o[i + 1] = S, o[i + 2] = y;
|
|
358
358
|
}
|
|
359
|
-
|
|
359
|
+
s.putImageData(d, 0, 0), t(r.toDataURL("image/png"));
|
|
360
360
|
}, n.onerror = () => a(new Error("Failed to load image")), n.src = e;
|
|
361
361
|
});
|
|
362
362
|
}
|
|
363
|
-
function
|
|
364
|
-
const [e, t] =
|
|
365
|
-
|
|
366
|
-
}, []),
|
|
367
|
-
async (
|
|
368
|
-
t(!0),
|
|
363
|
+
function Le() {
|
|
364
|
+
const [e, t] = N(!1), [a, n] = N(!1), [r, s] = N(null), [d, o] = N(Ce()), i = C(() => s(null), []), c = C((f) => {
|
|
365
|
+
Se(f), o(!0), s(null);
|
|
366
|
+
}, []), u = C(
|
|
367
|
+
async (f, b = "vintage") => {
|
|
368
|
+
t(!0), s(null);
|
|
369
369
|
try {
|
|
370
|
-
return await
|
|
370
|
+
return await Te(f);
|
|
371
371
|
} catch (h) {
|
|
372
372
|
const E = h instanceof Error ? h.message : "Enhancement failed";
|
|
373
|
-
throw
|
|
373
|
+
throw s(E), h;
|
|
374
374
|
} finally {
|
|
375
375
|
t(!1);
|
|
376
376
|
}
|
|
377
377
|
},
|
|
378
378
|
[]
|
|
379
|
-
),
|
|
380
|
-
async (
|
|
381
|
-
n(!0),
|
|
379
|
+
), g = C(
|
|
380
|
+
async (f) => {
|
|
381
|
+
n(!0), s(null);
|
|
382
382
|
try {
|
|
383
|
-
return await
|
|
384
|
-
} catch (
|
|
385
|
-
const h =
|
|
386
|
-
throw
|
|
383
|
+
return await Ae(f);
|
|
384
|
+
} catch (b) {
|
|
385
|
+
const h = b instanceof Error ? b.message : "Background removal failed";
|
|
386
|
+
throw s(h), b;
|
|
387
387
|
} finally {
|
|
388
388
|
n(!1);
|
|
389
389
|
}
|
|
@@ -391,22 +391,22 @@ function Ne() {
|
|
|
391
391
|
[]
|
|
392
392
|
);
|
|
393
393
|
return {
|
|
394
|
-
enhance:
|
|
395
|
-
removeBg:
|
|
394
|
+
enhance: u,
|
|
395
|
+
removeBg: g,
|
|
396
396
|
isEnhancing: e,
|
|
397
397
|
isRemovingBg: a,
|
|
398
398
|
error: r,
|
|
399
|
-
hasKey:
|
|
400
|
-
setApiKey:
|
|
401
|
-
clearError:
|
|
399
|
+
hasKey: d,
|
|
400
|
+
setApiKey: c,
|
|
401
|
+
clearError: i
|
|
402
402
|
};
|
|
403
403
|
}
|
|
404
|
-
function
|
|
405
|
-
const n =
|
|
404
|
+
function De({ isOpen: e, onClose: t, onSubmit: a }) {
|
|
405
|
+
const n = w((c) => c.voucherConfig.language), [r, s] = N("");
|
|
406
406
|
if (!e) return null;
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
},
|
|
407
|
+
const d = (c) => {
|
|
408
|
+
c.preventDefault(), r.trim() && (a(r.trim()), s(""), t());
|
|
409
|
+
}, i = {
|
|
410
410
|
de: {
|
|
411
411
|
title: "Stability AI API Key",
|
|
412
412
|
description: "Um die AI-Bildverbesserung zu nutzen, benötigst du einen Stability AI API Key. Du kannst ihn auf platform.stability.ai erhalten.",
|
|
@@ -424,104 +424,104 @@ function Se({ isOpen: e, onClose: t, onSubmit: a }) {
|
|
|
424
424
|
hint: "The key is stored locally in your browser."
|
|
425
425
|
}
|
|
426
426
|
}[n];
|
|
427
|
-
return /* @__PURE__ */
|
|
428
|
-
/* @__PURE__ */
|
|
429
|
-
/* @__PURE__ */ l("h3", { className: "font-bold text-lg", children:
|
|
430
|
-
/* @__PURE__ */ l("p", { className: "py-4 text-sm opacity-80", children:
|
|
431
|
-
/* @__PURE__ */
|
|
432
|
-
/* @__PURE__ */
|
|
427
|
+
return /* @__PURE__ */ m("dialog", { className: "modal modal-open", children: [
|
|
428
|
+
/* @__PURE__ */ m("div", { className: "modal-box", children: [
|
|
429
|
+
/* @__PURE__ */ l("h3", { className: "font-bold text-lg", children: i.title }),
|
|
430
|
+
/* @__PURE__ */ l("p", { className: "py-4 text-sm opacity-80", children: i.description }),
|
|
431
|
+
/* @__PURE__ */ m("form", { onSubmit: d, children: [
|
|
432
|
+
/* @__PURE__ */ m("div", { className: "form-control", children: [
|
|
433
433
|
/* @__PURE__ */ l(
|
|
434
434
|
"input",
|
|
435
435
|
{
|
|
436
436
|
type: "password",
|
|
437
|
-
placeholder:
|
|
437
|
+
placeholder: i.placeholder,
|
|
438
438
|
className: "input input-bordered w-full",
|
|
439
439
|
value: r,
|
|
440
|
-
onChange: (
|
|
440
|
+
onChange: (c) => s(c.target.value),
|
|
441
441
|
autoFocus: !0
|
|
442
442
|
}
|
|
443
443
|
),
|
|
444
|
-
/* @__PURE__ */ l("label", { className: "label", children: /* @__PURE__ */ l("span", { className: "label-text-alt", children:
|
|
444
|
+
/* @__PURE__ */ l("label", { className: "label", children: /* @__PURE__ */ l("span", { className: "label-text-alt", children: i.hint }) })
|
|
445
445
|
] }),
|
|
446
|
-
/* @__PURE__ */
|
|
447
|
-
/* @__PURE__ */ l("button", { type: "button", className: "btn btn-ghost", onClick: t, children:
|
|
448
|
-
/* @__PURE__ */ l("button", { type: "submit", className: "btn btn-primary", disabled: !r.trim(), children:
|
|
446
|
+
/* @__PURE__ */ m("div", { className: "modal-action", children: [
|
|
447
|
+
/* @__PURE__ */ l("button", { type: "button", className: "btn btn-ghost", onClick: t, children: i.cancel }),
|
|
448
|
+
/* @__PURE__ */ l("button", { type: "submit", className: "btn btn-primary", disabled: !r.trim(), children: i.submit })
|
|
449
449
|
] })
|
|
450
450
|
] })
|
|
451
451
|
] }),
|
|
452
452
|
/* @__PURE__ */ l("form", { method: "dialog", className: "modal-backdrop", children: /* @__PURE__ */ l("button", { onClick: t, children: "close" }) })
|
|
453
453
|
] });
|
|
454
454
|
}
|
|
455
|
-
function
|
|
456
|
-
const e =
|
|
457
|
-
async (
|
|
458
|
-
if (!
|
|
455
|
+
function Xe() {
|
|
456
|
+
const e = w((p) => p.voucherConfig.language), t = w((p) => p.portrait), a = w((p) => p.setPortrait), n = w((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] = N(!1), [E, x] = N(!1), [v, S] = N(null), [y, k] = N(!1), [T, L] = N(!1), H = C(
|
|
457
|
+
async (p) => {
|
|
458
|
+
if (!p.type.startsWith("image/"))
|
|
459
459
|
return;
|
|
460
|
-
const
|
|
461
|
-
|
|
462
|
-
var
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
const W = await s(F);
|
|
467
|
-
a(W);
|
|
468
|
-
} catch (W) {
|
|
469
|
-
console.error("Background removal failed, using original:", W), a(F);
|
|
470
|
-
}
|
|
471
|
-
else
|
|
472
|
-
a(F);
|
|
473
|
-
}, x.readAsDataURL(m);
|
|
460
|
+
const P = new FileReader();
|
|
461
|
+
P.onload = async (D) => {
|
|
462
|
+
var _;
|
|
463
|
+
const A = (_ = D.target) == null ? void 0 : _.result;
|
|
464
|
+
S(A), a(A), k(!1), L(!1);
|
|
465
|
+
}, P.readAsDataURL(p);
|
|
474
466
|
},
|
|
475
|
-
[a
|
|
476
|
-
),
|
|
477
|
-
(
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
|
|
467
|
+
[a]
|
|
468
|
+
), W = C(
|
|
469
|
+
(p) => {
|
|
470
|
+
p.preventDefault(), h(!1);
|
|
471
|
+
const P = p.dataTransfer.files[0];
|
|
472
|
+
P && H(P);
|
|
481
473
|
},
|
|
482
|
-
[
|
|
483
|
-
),
|
|
484
|
-
|
|
485
|
-
}, []),
|
|
486
|
-
|
|
487
|
-
}, []),
|
|
488
|
-
var
|
|
489
|
-
(
|
|
490
|
-
},
|
|
491
|
-
var
|
|
492
|
-
const
|
|
493
|
-
|
|
494
|
-
},
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
P(!0);
|
|
498
|
-
return;
|
|
499
|
-
}
|
|
474
|
+
[H]
|
|
475
|
+
), se = C((p) => {
|
|
476
|
+
p.preventDefault(), h(!0);
|
|
477
|
+
}, []), le = C((p) => {
|
|
478
|
+
p.preventDefault(), h(!1);
|
|
479
|
+
}, []), ce = () => {
|
|
480
|
+
var p;
|
|
481
|
+
(p = f.current) == null || p.click();
|
|
482
|
+
}, de = (p) => {
|
|
483
|
+
var D;
|
|
484
|
+
const P = (D = p.target.files) == null ? void 0 : D[0];
|
|
485
|
+
P && H(P);
|
|
486
|
+
}, K = C(async (p, P, D) => {
|
|
487
|
+
let A = p;
|
|
488
|
+
if (P && c)
|
|
500
489
|
try {
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
console.error("Enhancement failed:", m);
|
|
490
|
+
A = await s(A);
|
|
491
|
+
} catch (_) {
|
|
492
|
+
console.error("Background removal failed:", _);
|
|
505
493
|
}
|
|
506
|
-
|
|
507
|
-
}, le = async (m) => {
|
|
508
|
-
if (b(m), t.original)
|
|
494
|
+
if (D)
|
|
509
495
|
try {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
console.error("Enhancement failed:", x);
|
|
496
|
+
A = await r(A, "vintage");
|
|
497
|
+
} catch (_) {
|
|
498
|
+
console.error("Enhancement failed:", _);
|
|
514
499
|
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
500
|
+
a(A);
|
|
501
|
+
}, [c, s, r, a]), he = async () => {
|
|
502
|
+
if (!v) return;
|
|
503
|
+
if (!y && !c) {
|
|
504
|
+
x(!0);
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
const p = !y;
|
|
508
|
+
k(p), await K(v, p, T);
|
|
509
|
+
}, pe = async () => {
|
|
510
|
+
if (!v) return;
|
|
511
|
+
const p = !T;
|
|
512
|
+
L(p), await K(v, y, p);
|
|
513
|
+
}, me = async (p) => {
|
|
514
|
+
u(p), v && (k(!0), await K(v, !0, T));
|
|
515
|
+
}, ue = () => {
|
|
516
|
+
a(null), S(null), k(!1), L(!1);
|
|
517
|
+
}, ge = t.original;
|
|
518
|
+
return /* @__PURE__ */ m("div", { className: "space-y-4", children: [
|
|
519
|
+
t.original ? /* @__PURE__ */ m("div", { className: "space-y-4", children: [
|
|
520
|
+
/* @__PURE__ */ l("div", { className: "flex justify-center", children: /* @__PURE__ */ m("div", { className: "relative", children: [
|
|
521
521
|
/* @__PURE__ */ l("div", { className: "w-32 h-32 rounded-full overflow-hidden border-4 border-currency-gold shadow-lg", children: /* @__PURE__ */ l(
|
|
522
522
|
"img",
|
|
523
523
|
{
|
|
524
|
-
src:
|
|
524
|
+
src: ge || "",
|
|
525
525
|
alt: "Portrait",
|
|
526
526
|
className: "w-full h-full object-cover",
|
|
527
527
|
style: { transform: `scale(${t.zoom})` }
|
|
@@ -531,7 +531,7 @@ function Ye() {
|
|
|
531
531
|
"button",
|
|
532
532
|
{
|
|
533
533
|
className: "btn btn-circle btn-xs btn-error absolute -top-1 -right-1",
|
|
534
|
-
onClick:
|
|
534
|
+
onClick: ue,
|
|
535
535
|
children: /* @__PURE__ */ l(
|
|
536
536
|
"svg",
|
|
537
537
|
{
|
|
@@ -554,10 +554,10 @@ function Ye() {
|
|
|
554
554
|
}
|
|
555
555
|
)
|
|
556
556
|
] }) }),
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ m("div", { className: "form-control", children: [
|
|
558
|
+
/* @__PURE__ */ m("label", { className: "label", children: [
|
|
559
559
|
/* @__PURE__ */ l("span", { className: "label-text", children: g.form.portrait.zoom }),
|
|
560
|
-
/* @__PURE__ */
|
|
560
|
+
/* @__PURE__ */ m("span", { className: "label-text-alt", children: [
|
|
561
561
|
Math.round(t.zoom * 100),
|
|
562
562
|
"%"
|
|
563
563
|
] })
|
|
@@ -570,85 +570,75 @@ function Ye() {
|
|
|
570
570
|
max: "2",
|
|
571
571
|
step: "0.05",
|
|
572
572
|
value: t.zoom,
|
|
573
|
-
onChange: (
|
|
573
|
+
onChange: (p) => n(parseFloat(p.target.value)),
|
|
574
574
|
className: "range range-primary range-sm"
|
|
575
575
|
}
|
|
576
576
|
)
|
|
577
577
|
] }),
|
|
578
|
-
|
|
579
|
-
/* @__PURE__ */ l(
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
{
|
|
600
|
-
strokeLinecap: "round",
|
|
601
|
-
strokeLinejoin: "round",
|
|
602
|
-
strokeWidth: 2,
|
|
603
|
-
d: "M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"
|
|
604
|
-
}
|
|
605
|
-
)
|
|
606
|
-
}
|
|
607
|
-
),
|
|
608
|
-
g.form.portrait.enhance
|
|
609
|
-
] })
|
|
610
|
-
}
|
|
611
|
-
),
|
|
612
|
-
p && /* @__PURE__ */ f("div", { className: "alert alert-warning text-sm py-2", children: [
|
|
613
|
-
/* @__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" }) }),
|
|
614
|
-
/* @__PURE__ */ l("span", { children: p })
|
|
615
|
-
] }),
|
|
616
|
-
t.enhanced && /* @__PURE__ */ l("div", { className: "form-control", children: /* @__PURE__ */ f("label", { className: "label cursor-pointer justify-start gap-3", children: [
|
|
578
|
+
/* @__PURE__ */ m("div", { className: "flex flex-col gap-3", children: [
|
|
579
|
+
/* @__PURE__ */ l("div", { className: "form-control", children: /* @__PURE__ */ m("label", { className: "label cursor-pointer justify-start gap-3", children: [
|
|
580
|
+
/* @__PURE__ */ l(
|
|
581
|
+
"input",
|
|
582
|
+
{
|
|
583
|
+
type: "checkbox",
|
|
584
|
+
className: `toggle toggle-primary ${o ? "opacity-50" : ""}`,
|
|
585
|
+
checked: y,
|
|
586
|
+
onChange: he,
|
|
587
|
+
disabled: o
|
|
588
|
+
}
|
|
589
|
+
),
|
|
590
|
+
/* @__PURE__ */ m("span", { className: "label-text flex items-center gap-2", children: [
|
|
591
|
+
o ? /* @__PURE__ */ m(M, { children: [
|
|
592
|
+
/* @__PURE__ */ l("span", { className: "loading loading-spinner loading-xs" }),
|
|
593
|
+
e === "de" ? "Hintergrund wird entfernt..." : "Removing background..."
|
|
594
|
+
] }) : e === "de" ? "Hintergrund entfernen" : "Remove background",
|
|
595
|
+
!c && /* @__PURE__ */ l("span", { className: "badge badge-sm badge-outline", children: "API" })
|
|
596
|
+
] })
|
|
597
|
+
] }) }),
|
|
598
|
+
/* @__PURE__ */ l("div", { className: "form-control", children: /* @__PURE__ */ m("label", { className: "label cursor-pointer justify-start gap-3", children: [
|
|
617
599
|
/* @__PURE__ */ l(
|
|
618
600
|
"input",
|
|
619
601
|
{
|
|
620
602
|
type: "checkbox",
|
|
621
|
-
className:
|
|
622
|
-
checked:
|
|
623
|
-
onChange:
|
|
603
|
+
className: `toggle toggle-secondary ${d ? "opacity-50" : ""}`,
|
|
604
|
+
checked: T,
|
|
605
|
+
onChange: pe,
|
|
606
|
+
disabled: d
|
|
624
607
|
}
|
|
625
608
|
),
|
|
626
|
-
/* @__PURE__ */ l("span", { className: "label-text", children:
|
|
627
|
-
|
|
609
|
+
/* @__PURE__ */ l("span", { className: "label-text flex items-center gap-2", children: d ? /* @__PURE__ */ m(M, { children: [
|
|
610
|
+
/* @__PURE__ */ l("span", { className: "loading loading-spinner loading-xs" }),
|
|
611
|
+
e === "de" ? "Gravur-Effekt wird angewendet..." : "Applying engraving effect..."
|
|
612
|
+
] }) : e === "de" ? "Gravur-Effekt" : "Engraving effect" })
|
|
613
|
+
] }) }),
|
|
614
|
+
i && /* @__PURE__ */ m("div", { className: "alert alert-warning text-sm py-2", children: [
|
|
615
|
+
/* @__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" }) }),
|
|
616
|
+
/* @__PURE__ */ l("span", { children: i })
|
|
617
|
+
] })
|
|
628
618
|
] })
|
|
629
|
-
] }) : /* @__PURE__ */
|
|
619
|
+
] }) : /* @__PURE__ */ m(
|
|
630
620
|
"div",
|
|
631
621
|
{
|
|
632
|
-
className: `border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors ${
|
|
633
|
-
onDrop:
|
|
634
|
-
onDragOver:
|
|
635
|
-
onDragLeave:
|
|
636
|
-
onClick:
|
|
622
|
+
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"}`,
|
|
623
|
+
onDrop: W,
|
|
624
|
+
onDragOver: se,
|
|
625
|
+
onDragLeave: le,
|
|
626
|
+
onClick: ce,
|
|
637
627
|
children: [
|
|
638
628
|
/* @__PURE__ */ l(
|
|
639
629
|
"input",
|
|
640
630
|
{
|
|
641
|
-
ref:
|
|
631
|
+
ref: f,
|
|
642
632
|
type: "file",
|
|
643
633
|
accept: "image/*",
|
|
644
634
|
className: "hidden",
|
|
645
|
-
onChange:
|
|
635
|
+
onChange: de
|
|
646
636
|
}
|
|
647
637
|
),
|
|
648
|
-
|
|
638
|
+
o ? /* @__PURE__ */ m("div", { className: "flex flex-col items-center gap-2", children: [
|
|
649
639
|
/* @__PURE__ */ l("span", { className: "loading loading-spinner loading-lg text-primary" }),
|
|
650
640
|
/* @__PURE__ */ l("p", { className: "font-medium", children: e === "de" ? "Hintergrund wird entfernt..." : "Removing background..." })
|
|
651
|
-
] }) : /* @__PURE__ */
|
|
641
|
+
] }) : /* @__PURE__ */ m("div", { className: "flex flex-col items-center gap-2", children: [
|
|
652
642
|
/* @__PURE__ */ l(
|
|
653
643
|
"svg",
|
|
654
644
|
{
|
|
@@ -675,60 +665,60 @@ function Ye() {
|
|
|
675
665
|
}
|
|
676
666
|
),
|
|
677
667
|
/* @__PURE__ */ l(
|
|
678
|
-
|
|
668
|
+
De,
|
|
679
669
|
{
|
|
680
|
-
isOpen:
|
|
681
|
-
onClose: () =>
|
|
682
|
-
onSubmit:
|
|
670
|
+
isOpen: E,
|
|
671
|
+
onClose: () => x(!1),
|
|
672
|
+
onSubmit: me
|
|
683
673
|
}
|
|
684
674
|
)
|
|
685
675
|
] });
|
|
686
676
|
}
|
|
687
|
-
function
|
|
677
|
+
function Je() {
|
|
688
678
|
return null;
|
|
689
679
|
}
|
|
690
|
-
const
|
|
680
|
+
const I = typeof import.meta < "u" && "/" || "/", _e = {
|
|
691
681
|
en: {
|
|
692
682
|
1: {
|
|
693
|
-
front: `${
|
|
694
|
-
back: `${
|
|
683
|
+
front: `${I}templates/front_ldpi_en.png`,
|
|
684
|
+
back: `${I}templates/back_ldpi_en.png`,
|
|
695
685
|
width: 1536,
|
|
696
686
|
height: 1024
|
|
697
687
|
},
|
|
698
688
|
5: {
|
|
699
|
-
front: `${
|
|
700
|
-
back: `${
|
|
689
|
+
front: `${I}templates/front_ldpi_en.png`,
|
|
690
|
+
back: `${I}templates/back_ldpi_en.png`,
|
|
701
691
|
width: 1536,
|
|
702
692
|
height: 1024
|
|
703
693
|
},
|
|
704
694
|
10: {
|
|
705
|
-
front: `${
|
|
706
|
-
back: `${
|
|
695
|
+
front: `${I}templates/front_ldpi_en.png`,
|
|
696
|
+
back: `${I}templates/back_ldpi_en.png`,
|
|
707
697
|
width: 1536,
|
|
708
698
|
height: 1024
|
|
709
699
|
}
|
|
710
700
|
},
|
|
711
701
|
de: {
|
|
712
702
|
1: {
|
|
713
|
-
front: `${
|
|
714
|
-
back: `${
|
|
703
|
+
front: `${I}templates/front_hdpi_de.webp`,
|
|
704
|
+
back: `${I}templates/back_hdpi_de.webp`,
|
|
715
705
|
width: 6144,
|
|
716
706
|
height: 3200
|
|
717
707
|
},
|
|
718
708
|
5: {
|
|
719
|
-
front: `${
|
|
720
|
-
back: `${
|
|
709
|
+
front: `${I}templates/front_hdpi_de.webp`,
|
|
710
|
+
back: `${I}templates/back_hdpi_de.webp`,
|
|
721
711
|
width: 6144,
|
|
722
712
|
height: 3200
|
|
723
713
|
},
|
|
724
714
|
10: {
|
|
725
|
-
front: `${
|
|
726
|
-
back: `${
|
|
715
|
+
front: `${I}templates/front_hdpi_de.webp`,
|
|
716
|
+
back: `${I}templates/back_hdpi_de.webp`,
|
|
727
717
|
width: 6144,
|
|
728
718
|
height: 3200
|
|
729
719
|
}
|
|
730
720
|
}
|
|
731
|
-
},
|
|
721
|
+
}, B = {
|
|
732
722
|
front: {
|
|
733
723
|
portrait: {
|
|
734
724
|
x: 768,
|
|
@@ -774,7 +764,7 @@ const k = typeof import.meta < "u" && "/" || "/", Ce = {
|
|
|
774
764
|
align: "center"
|
|
775
765
|
}
|
|
776
766
|
}
|
|
777
|
-
},
|
|
767
|
+
}, R = {
|
|
778
768
|
front: {
|
|
779
769
|
portrait: {
|
|
780
770
|
x: 3074,
|
|
@@ -822,13 +812,13 @@ const k = typeof import.meta < "u" && "/" || "/", Ce = {
|
|
|
822
812
|
}
|
|
823
813
|
};
|
|
824
814
|
function te(e) {
|
|
825
|
-
return e === "de" ?
|
|
815
|
+
return e === "de" ? R : B;
|
|
826
816
|
}
|
|
827
817
|
function ne(e, t) {
|
|
828
|
-
return
|
|
818
|
+
return _e[e][t];
|
|
829
819
|
}
|
|
830
820
|
const O = /* @__PURE__ */ new Map();
|
|
831
|
-
async function
|
|
821
|
+
async function Y(e) {
|
|
832
822
|
return O.has(e) ? O.get(e) : new Promise((t, a) => {
|
|
833
823
|
const n = new Image();
|
|
834
824
|
n.crossOrigin = "anonymous", n.onload = () => {
|
|
@@ -839,121 +829,121 @@ async function j(e) {
|
|
|
839
829
|
function ae(e, t, a, n) {
|
|
840
830
|
e.drawImage(t, 0, 0, a, n);
|
|
841
831
|
}
|
|
842
|
-
function
|
|
843
|
-
e.save(), e.beginPath(), e.ellipse(a, n, r,
|
|
844
|
-
const
|
|
845
|
-
let
|
|
846
|
-
|
|
847
|
-
const
|
|
848
|
-
e.drawImage(t,
|
|
832
|
+
function Be(e, t, a, n, r, s, d = 1) {
|
|
833
|
+
e.save(), e.beginPath(), e.ellipse(a, n, r, s, 0, 0, Math.PI * 2), e.closePath(), e.clip();
|
|
834
|
+
const o = t.width / t.height, i = r / s, c = r * 2, u = s * 2;
|
|
835
|
+
let g, f;
|
|
836
|
+
o > i ? (f = u, g = u * o) : (g = c, f = c / o), g *= d, f *= d;
|
|
837
|
+
const b = a - g / 2, h = n - f / 2;
|
|
838
|
+
e.drawImage(t, b, h, g, f), e.restore();
|
|
849
839
|
}
|
|
850
840
|
function re(e, t, a, n = "#2a3a2a") {
|
|
851
841
|
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();
|
|
852
842
|
}
|
|
853
|
-
function
|
|
843
|
+
function Re(e, t, a, n = "#2a3a2a") {
|
|
854
844
|
e.save(), e.font = `${a.fontSize}px "Times New Roman", serif`, e.textAlign = a.align || "center", e.textBaseline = "top", e.fillStyle = n;
|
|
855
|
-
const r = a.maxWidth || 400,
|
|
856
|
-
let
|
|
857
|
-
for (const
|
|
858
|
-
const
|
|
859
|
-
e.measureText(
|
|
845
|
+
const r = a.maxWidth || 400, s = a.lineHeight || a.fontSize * 1.4, d = t.split(" "), o = [];
|
|
846
|
+
let i = "";
|
|
847
|
+
for (const g of d) {
|
|
848
|
+
const f = i ? `${i} ${g}` : g;
|
|
849
|
+
e.measureText(f).width > r && i ? (o.push(i), i = g) : i = f;
|
|
860
850
|
}
|
|
861
|
-
|
|
862
|
-
const
|
|
863
|
-
let
|
|
864
|
-
for (const
|
|
865
|
-
e.fillText(
|
|
851
|
+
i && o.push(i);
|
|
852
|
+
const c = o.length * s;
|
|
853
|
+
let u = a.y - c / 2;
|
|
854
|
+
for (const g of o)
|
|
855
|
+
e.fillText(g, a.x, u), u += s;
|
|
866
856
|
e.restore();
|
|
867
857
|
}
|
|
868
|
-
function
|
|
869
|
-
e.save(), e.font = `${r.fontSize}px "Times New Roman", serif`, e.textAlign = r.align || "center", e.textBaseline = "middle", e.fillStyle =
|
|
870
|
-
const
|
|
871
|
-
let
|
|
872
|
-
for (const
|
|
873
|
-
|
|
858
|
+
function $e(e, t, a, n, r, s = "#2a3a2a") {
|
|
859
|
+
e.save(), e.font = `${r.fontSize}px "Times New Roman", serif`, e.textAlign = r.align || "center", e.textBaseline = "middle", e.fillStyle = s;
|
|
860
|
+
const d = r.lineHeight || r.fontSize * 1.8, o = [t, a, n].filter(Boolean), i = (o.length - 1) * d;
|
|
861
|
+
let c = r.y - i / 2;
|
|
862
|
+
for (const u of o)
|
|
863
|
+
u && (e.fillText(u, r.x, c), c += d);
|
|
874
864
|
e.restore();
|
|
875
865
|
}
|
|
876
|
-
async function oe(e, t, a, n, r,
|
|
877
|
-
const
|
|
878
|
-
if (!
|
|
879
|
-
e.width =
|
|
880
|
-
const
|
|
881
|
-
if (ae(
|
|
866
|
+
async function oe(e, t, a, n, r, s, d, o = 1) {
|
|
867
|
+
const i = e.getContext("2d");
|
|
868
|
+
if (!i) return;
|
|
869
|
+
e.width = s, e.height = d, i.clearRect(0, 0, s, d);
|
|
870
|
+
const c = await Y(t);
|
|
871
|
+
if (ae(i, c, s, d), a)
|
|
882
872
|
try {
|
|
883
|
-
const
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
873
|
+
const u = await Y(a);
|
|
874
|
+
Be(
|
|
875
|
+
i,
|
|
876
|
+
u,
|
|
887
877
|
r.portrait.x,
|
|
888
878
|
r.portrait.y,
|
|
889
879
|
r.portrait.radiusX,
|
|
890
880
|
r.portrait.radiusY,
|
|
891
|
-
|
|
881
|
+
o
|
|
892
882
|
);
|
|
893
|
-
} catch (
|
|
894
|
-
console.error("Failed to load portrait:",
|
|
883
|
+
} catch (u) {
|
|
884
|
+
console.error("Failed to load portrait:", u);
|
|
895
885
|
}
|
|
896
|
-
n && re(
|
|
886
|
+
n && re(i, n, r.namePlate);
|
|
897
887
|
}
|
|
898
|
-
async function ie(e, t, a, n, r,
|
|
899
|
-
const
|
|
900
|
-
if (!
|
|
901
|
-
e.width =
|
|
902
|
-
const
|
|
903
|
-
ae(
|
|
888
|
+
async function ie(e, t, a, n, r, s, d, o, i) {
|
|
889
|
+
const c = e.getContext("2d");
|
|
890
|
+
if (!c) return;
|
|
891
|
+
e.width = o, e.height = i, c.clearRect(0, 0, o, i);
|
|
892
|
+
const u = await Y(t);
|
|
893
|
+
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);
|
|
904
894
|
}
|
|
905
|
-
function
|
|
906
|
-
const e =
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
895
|
+
function Qe() {
|
|
896
|
+
const e = w((y) => y.voucherConfig.language), t = w((y) => y.voucherConfig.hours), a = w((y) => y.voucherConfig.description), n = w((y) => y.personalInfo), r = w((y) => y.portrait), s = w((y) => y.currentSide), d = w((y) => y.flipSide), o = z(e), i = $(null), c = $(null), u = $(null), [g, f] = N(!1), b = ne(e, t), h = te(e), E = r.useEnhanced && r.enhanced ? r.enhanced : r.original, x = J(e, t, a);
|
|
897
|
+
G(() => {
|
|
898
|
+
i.current && oe(
|
|
899
|
+
i.current,
|
|
900
|
+
b.front,
|
|
911
901
|
E,
|
|
912
902
|
n.name,
|
|
913
903
|
h.front,
|
|
914
|
-
|
|
915
|
-
|
|
904
|
+
b.width,
|
|
905
|
+
b.height,
|
|
916
906
|
r.zoom
|
|
917
907
|
);
|
|
918
|
-
}, [
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
908
|
+
}, [b, E, n.name, h, r.zoom]), G(() => {
|
|
909
|
+
c.current && ie(
|
|
910
|
+
c.current,
|
|
911
|
+
b.back,
|
|
922
912
|
n.name,
|
|
923
913
|
n.email,
|
|
924
914
|
n.phone,
|
|
925
|
-
|
|
915
|
+
x,
|
|
926
916
|
h.back,
|
|
927
|
-
|
|
928
|
-
|
|
917
|
+
b.width,
|
|
918
|
+
b.height
|
|
929
919
|
);
|
|
930
|
-
}, [
|
|
931
|
-
const
|
|
932
|
-
|
|
933
|
-
|
|
920
|
+
}, [b, n, x, h]);
|
|
921
|
+
const v = () => {
|
|
922
|
+
f(!0), setTimeout(() => {
|
|
923
|
+
d(), f(!1);
|
|
934
924
|
}, 150);
|
|
935
|
-
},
|
|
936
|
-
return /* @__PURE__ */
|
|
937
|
-
/* @__PURE__ */
|
|
938
|
-
/* @__PURE__ */
|
|
925
|
+
}, S = b.width / b.height;
|
|
926
|
+
return /* @__PURE__ */ m("div", { className: "space-y-4", children: [
|
|
927
|
+
/* @__PURE__ */ m("div", { className: "flex justify-between items-center", children: [
|
|
928
|
+
/* @__PURE__ */ m("div", { className: "tabs tabs-boxed bg-base-200", children: [
|
|
939
929
|
/* @__PURE__ */ l(
|
|
940
930
|
"button",
|
|
941
931
|
{
|
|
942
|
-
className: `tab ${
|
|
943
|
-
onClick: () =>
|
|
944
|
-
children:
|
|
932
|
+
className: `tab ${s === "front" ? "tab-active bg-primary text-primary-content font-semibold" : ""}`,
|
|
933
|
+
onClick: () => s !== "front" && v(),
|
|
934
|
+
children: o.preview.front
|
|
945
935
|
}
|
|
946
936
|
),
|
|
947
937
|
/* @__PURE__ */ l(
|
|
948
938
|
"button",
|
|
949
939
|
{
|
|
950
|
-
className: `tab ${
|
|
951
|
-
onClick: () =>
|
|
952
|
-
children:
|
|
940
|
+
className: `tab ${s === "back" ? "tab-active bg-primary text-primary-content font-semibold" : ""}`,
|
|
941
|
+
onClick: () => s !== "back" && v(),
|
|
942
|
+
children: o.preview.back
|
|
953
943
|
}
|
|
954
944
|
)
|
|
955
945
|
] }),
|
|
956
|
-
/* @__PURE__ */
|
|
946
|
+
/* @__PURE__ */ m("button", { className: "btn btn-ghost btn-sm", onClick: v, children: [
|
|
957
947
|
/* @__PURE__ */ l(
|
|
958
948
|
"svg",
|
|
959
949
|
{
|
|
@@ -973,28 +963,28 @@ function Ve() {
|
|
|
973
963
|
)
|
|
974
964
|
}
|
|
975
965
|
),
|
|
976
|
-
|
|
966
|
+
o.preview.flip
|
|
977
967
|
] })
|
|
978
968
|
] }),
|
|
979
|
-
/* @__PURE__ */
|
|
969
|
+
/* @__PURE__ */ m(
|
|
980
970
|
"div",
|
|
981
971
|
{
|
|
982
|
-
ref:
|
|
972
|
+
ref: u,
|
|
983
973
|
className: "relative w-full overflow-hidden shadow-lg",
|
|
984
|
-
style: { aspectRatio:
|
|
974
|
+
style: { aspectRatio: S },
|
|
985
975
|
children: [
|
|
986
976
|
/* @__PURE__ */ l(
|
|
987
977
|
"canvas",
|
|
988
978
|
{
|
|
989
|
-
ref:
|
|
990
|
-
className: `absolute inset-0 w-full h-full transition-all duration-300 ${
|
|
979
|
+
ref: i,
|
|
980
|
+
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"}`
|
|
991
981
|
}
|
|
992
982
|
),
|
|
993
983
|
/* @__PURE__ */ l(
|
|
994
984
|
"canvas",
|
|
995
985
|
{
|
|
996
|
-
ref:
|
|
997
|
-
className: `absolute inset-0 w-full h-full transition-all duration-300 ${
|
|
986
|
+
ref: c,
|
|
987
|
+
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"}`
|
|
998
988
|
}
|
|
999
989
|
)
|
|
1000
990
|
]
|
|
@@ -1002,85 +992,85 @@ function Ve() {
|
|
|
1002
992
|
)
|
|
1003
993
|
] });
|
|
1004
994
|
}
|
|
1005
|
-
function
|
|
1006
|
-
const e =
|
|
995
|
+
function et() {
|
|
996
|
+
const e = $(null), t = $(null);
|
|
1007
997
|
return { frontCanvasRef: e, backCanvasRef: t };
|
|
1008
998
|
}
|
|
1009
|
-
async function
|
|
999
|
+
async function ze(e) {
|
|
1010
1000
|
const {
|
|
1011
1001
|
frontTemplateSrc: t,
|
|
1012
1002
|
backTemplateSrc: a,
|
|
1013
1003
|
templateWidth: n,
|
|
1014
1004
|
templateHeight: r,
|
|
1015
|
-
layout:
|
|
1016
|
-
portrait:
|
|
1017
|
-
portraitZoom:
|
|
1018
|
-
name:
|
|
1019
|
-
email:
|
|
1020
|
-
phone:
|
|
1021
|
-
description:
|
|
1022
|
-
} = e,
|
|
1005
|
+
layout: s,
|
|
1006
|
+
portrait: d,
|
|
1007
|
+
portraitZoom: o = 1,
|
|
1008
|
+
name: i,
|
|
1009
|
+
email: c,
|
|
1010
|
+
phone: u,
|
|
1011
|
+
description: g
|
|
1012
|
+
} = e, f = document.createElement("canvas"), b = document.createElement("canvas");
|
|
1023
1013
|
await Promise.all([
|
|
1024
|
-
oe(
|
|
1025
|
-
ie(
|
|
1014
|
+
oe(f, t, d, i, s.front, n, r, o),
|
|
1015
|
+
ie(b, a, i, c, u, g, s.back, n, r)
|
|
1026
1016
|
]);
|
|
1027
|
-
const h = new
|
|
1017
|
+
const h = new ye({
|
|
1028
1018
|
orientation: "landscape",
|
|
1029
1019
|
unit: "mm",
|
|
1030
1020
|
format: "a4"
|
|
1031
|
-
}), E = 297,
|
|
1032
|
-
let
|
|
1033
|
-
|
|
1034
|
-
const
|
|
1035
|
-
h.addImage(
|
|
1036
|
-
const
|
|
1037
|
-
return h.addImage(
|
|
1021
|
+
}), E = 297, x = 210, v = 10, S = n / r;
|
|
1022
|
+
let y = E - v * 2, k = y / S;
|
|
1023
|
+
k > x - v * 2 && (k = x - v * 2, y = k * S);
|
|
1024
|
+
const T = (E - y) / 2, L = (x - k) / 2, H = f.toDataURL("image/jpeg", 0.95);
|
|
1025
|
+
h.addImage(H, "JPEG", T, L, y, k), h.addPage();
|
|
1026
|
+
const W = b.toDataURL("image/jpeg", 0.95);
|
|
1027
|
+
return h.addImage(W, "JPEG", T, L, y, k), h.output("blob");
|
|
1038
1028
|
}
|
|
1039
|
-
function
|
|
1029
|
+
function He(e, t) {
|
|
1040
1030
|
const a = URL.createObjectURL(e), n = document.createElement("a");
|
|
1041
1031
|
n.href = a, n.download = t, document.body.appendChild(n), n.click(), document.body.removeChild(n), URL.revokeObjectURL(a);
|
|
1042
1032
|
}
|
|
1043
|
-
async function
|
|
1044
|
-
const t = await
|
|
1045
|
-
|
|
1033
|
+
async function Me(e) {
|
|
1034
|
+
const t = await ze(e);
|
|
1035
|
+
He(t, e.filename);
|
|
1046
1036
|
}
|
|
1047
|
-
function
|
|
1048
|
-
const e =
|
|
1037
|
+
function tt() {
|
|
1038
|
+
const e = w((h) => h.voucherConfig.language), t = w((h) => h.voucherConfig.hours), a = w((h) => h.voucherConfig.description), n = w((h) => h.personalInfo), r = w((h) => h.portrait), s = w((h) => h.isExporting), d = w((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;
|
|
1049
1039
|
return /* @__PURE__ */ l(
|
|
1050
1040
|
"button",
|
|
1051
1041
|
{
|
|
1052
|
-
className: `btn btn-primary flex-1 ${
|
|
1042
|
+
className: `btn btn-primary flex-1 ${s ? "loading" : ""}`,
|
|
1053
1043
|
onClick: async () => {
|
|
1054
|
-
if (!(!
|
|
1055
|
-
|
|
1044
|
+
if (!(!f || s)) {
|
|
1045
|
+
d(!0);
|
|
1056
1046
|
try {
|
|
1057
1047
|
const h = `zeitgutschein-${t}h-${n.name.replace(/\s+/g, "-").toLowerCase()}.pdf`;
|
|
1058
|
-
await
|
|
1059
|
-
frontTemplateSrc:
|
|
1060
|
-
backTemplateSrc:
|
|
1061
|
-
templateWidth:
|
|
1062
|
-
templateHeight:
|
|
1063
|
-
layout:
|
|
1064
|
-
portrait:
|
|
1048
|
+
await Me({
|
|
1049
|
+
frontTemplateSrc: i.front,
|
|
1050
|
+
backTemplateSrc: i.back,
|
|
1051
|
+
templateWidth: i.width,
|
|
1052
|
+
templateHeight: i.height,
|
|
1053
|
+
layout: c,
|
|
1054
|
+
portrait: u,
|
|
1065
1055
|
portraitZoom: r.zoom,
|
|
1066
1056
|
name: n.name,
|
|
1067
1057
|
email: n.email,
|
|
1068
1058
|
phone: n.phone,
|
|
1069
|
-
description:
|
|
1059
|
+
description: g,
|
|
1070
1060
|
filename: h
|
|
1071
1061
|
});
|
|
1072
1062
|
} catch (h) {
|
|
1073
1063
|
console.error("PDF export failed:", h);
|
|
1074
1064
|
} finally {
|
|
1075
|
-
|
|
1065
|
+
d(!1);
|
|
1076
1066
|
}
|
|
1077
1067
|
}
|
|
1078
1068
|
},
|
|
1079
|
-
disabled: !
|
|
1080
|
-
children:
|
|
1069
|
+
disabled: !f || s,
|
|
1070
|
+
children: s ? /* @__PURE__ */ m(M, { children: [
|
|
1081
1071
|
/* @__PURE__ */ l("span", { className: "loading loading-spinner loading-sm" }),
|
|
1082
|
-
|
|
1083
|
-
] }) : /* @__PURE__ */
|
|
1072
|
+
o.export.exporting
|
|
1073
|
+
] }) : /* @__PURE__ */ m(M, { children: [
|
|
1084
1074
|
/* @__PURE__ */ l(
|
|
1085
1075
|
"svg",
|
|
1086
1076
|
{
|
|
@@ -1100,16 +1090,16 @@ function Ze() {
|
|
|
1100
1090
|
)
|
|
1101
1091
|
}
|
|
1102
1092
|
),
|
|
1103
|
-
|
|
1093
|
+
o.export.button
|
|
1104
1094
|
] })
|
|
1105
1095
|
}
|
|
1106
1096
|
);
|
|
1107
1097
|
}
|
|
1108
|
-
function
|
|
1109
|
-
const e =
|
|
1098
|
+
function Ue() {
|
|
1099
|
+
const e = w((n) => n.voucherConfig.language), t = w((n) => n.setLanguage), a = (n) => {
|
|
1110
1100
|
t(n);
|
|
1111
1101
|
};
|
|
1112
|
-
return /* @__PURE__ */
|
|
1102
|
+
return /* @__PURE__ */ m("div", { className: "join", children: [
|
|
1113
1103
|
/* @__PURE__ */ l(
|
|
1114
1104
|
"button",
|
|
1115
1105
|
{
|
|
@@ -1128,22 +1118,22 @@ function Re() {
|
|
|
1128
1118
|
)
|
|
1129
1119
|
] });
|
|
1130
1120
|
}
|
|
1131
|
-
function
|
|
1132
|
-
const e =
|
|
1133
|
-
return /* @__PURE__ */
|
|
1121
|
+
function nt() {
|
|
1122
|
+
const e = w((a) => a.voucherConfig.language), t = z(e);
|
|
1123
|
+
return /* @__PURE__ */ m("div", { className: "navbar bg-currency-green text-currency-cream shadow-lg", children: [
|
|
1134
1124
|
/* @__PURE__ */ l("div", { className: "navbar-start", children: /* @__PURE__ */ l("a", { className: "btn btn-ghost text-xl font-currency font-bold", children: t.header.title }) }),
|
|
1135
1125
|
/* @__PURE__ */ l("div", { className: "navbar-center hidden sm:flex", children: /* @__PURE__ */ l("span", { className: "text-sm opacity-80", children: t.header.subtitle }) }),
|
|
1136
|
-
/* @__PURE__ */ l("div", { className: "navbar-end", children: /* @__PURE__ */ l(
|
|
1126
|
+
/* @__PURE__ */ l("div", { className: "navbar-end", children: /* @__PURE__ */ l(Ue, {}) })
|
|
1137
1127
|
] });
|
|
1138
1128
|
}
|
|
1139
|
-
const
|
|
1129
|
+
const U = "/", Fe = {
|
|
1140
1130
|
id: "time-voucher-classic-de",
|
|
1141
1131
|
name: "Zeitgutschein Classic",
|
|
1142
1132
|
type: "time-voucher",
|
|
1143
1133
|
category: "classic",
|
|
1144
1134
|
images: {
|
|
1145
|
-
front: `${
|
|
1146
|
-
back: `${
|
|
1135
|
+
front: `${U}templates/front_hdpi_de.jpg`,
|
|
1136
|
+
back: `${U}templates/back_hdpi_de.jpg`,
|
|
1147
1137
|
width: 6144,
|
|
1148
1138
|
height: 4096
|
|
1149
1139
|
},
|
|
@@ -1190,24 +1180,24 @@ const M = "/", $e = {
|
|
|
1190
1180
|
],
|
|
1191
1181
|
layout: {
|
|
1192
1182
|
front: {
|
|
1193
|
-
portrait:
|
|
1194
|
-
name:
|
|
1183
|
+
portrait: R.front.portrait,
|
|
1184
|
+
name: R.front.namePlate
|
|
1195
1185
|
},
|
|
1196
1186
|
back: {
|
|
1197
|
-
name:
|
|
1198
|
-
contactInfo:
|
|
1199
|
-
description:
|
|
1187
|
+
name: R.back.namePlate,
|
|
1188
|
+
contactInfo: R.back.contactInfo,
|
|
1189
|
+
description: R.back.description
|
|
1200
1190
|
}
|
|
1201
1191
|
},
|
|
1202
1192
|
languages: ["de"]
|
|
1203
|
-
},
|
|
1193
|
+
}, We = {
|
|
1204
1194
|
id: "time-voucher-classic-en",
|
|
1205
1195
|
name: "Time Voucher Classic",
|
|
1206
1196
|
type: "time-voucher",
|
|
1207
1197
|
category: "classic",
|
|
1208
1198
|
images: {
|
|
1209
|
-
front: `${
|
|
1210
|
-
back: `${
|
|
1199
|
+
front: `${U}templates/front_ldpi_en.png`,
|
|
1200
|
+
back: `${U}templates/back_ldpi_en.png`,
|
|
1211
1201
|
width: 1536,
|
|
1212
1202
|
height: 1024
|
|
1213
1203
|
},
|
|
@@ -1254,20 +1244,20 @@ const M = "/", $e = {
|
|
|
1254
1244
|
],
|
|
1255
1245
|
layout: {
|
|
1256
1246
|
front: {
|
|
1257
|
-
portrait:
|
|
1258
|
-
name:
|
|
1247
|
+
portrait: B.front.portrait,
|
|
1248
|
+
name: B.front.namePlate
|
|
1259
1249
|
},
|
|
1260
1250
|
back: {
|
|
1261
|
-
name:
|
|
1262
|
-
contactInfo:
|
|
1263
|
-
description:
|
|
1251
|
+
name: B.back.namePlate,
|
|
1252
|
+
contactInfo: B.back.contactInfo,
|
|
1253
|
+
description: B.back.description
|
|
1264
1254
|
}
|
|
1265
1255
|
},
|
|
1266
1256
|
languages: ["en"]
|
|
1267
1257
|
}, X = [
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
],
|
|
1258
|
+
Fe,
|
|
1259
|
+
We
|
|
1260
|
+
], Ke = {
|
|
1271
1261
|
async listTemplates(e) {
|
|
1272
1262
|
let t = [...X];
|
|
1273
1263
|
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;
|
|
@@ -1279,61 +1269,61 @@ const M = "/", $e = {
|
|
|
1279
1269
|
return t;
|
|
1280
1270
|
}
|
|
1281
1271
|
};
|
|
1282
|
-
function
|
|
1272
|
+
function at(e) {
|
|
1283
1273
|
return e === "de" ? "time-voucher-classic-de" : "time-voucher-classic-en";
|
|
1284
1274
|
}
|
|
1285
|
-
let
|
|
1286
|
-
function
|
|
1287
|
-
|
|
1275
|
+
let F = Ke;
|
|
1276
|
+
function rt(e) {
|
|
1277
|
+
F = e;
|
|
1288
1278
|
}
|
|
1289
|
-
function
|
|
1290
|
-
return
|
|
1279
|
+
function ot() {
|
|
1280
|
+
return F;
|
|
1291
1281
|
}
|
|
1292
|
-
async function
|
|
1293
|
-
return
|
|
1282
|
+
async function it(e) {
|
|
1283
|
+
return F.listTemplates(e);
|
|
1294
1284
|
}
|
|
1295
|
-
async function
|
|
1296
|
-
return
|
|
1285
|
+
async function st(e) {
|
|
1286
|
+
return F.getTemplate(e);
|
|
1297
1287
|
}
|
|
1298
1288
|
export {
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1289
|
+
De as ApiKeyModal,
|
|
1290
|
+
Qe as BillPreview,
|
|
1291
|
+
tt as ExportButton,
|
|
1292
|
+
nt as Header,
|
|
1293
|
+
R as LAYOUT_HDPI,
|
|
1294
|
+
B as LAYOUT_LDPI,
|
|
1295
|
+
Ue as LanguageToggle,
|
|
1296
|
+
Ve as PersonalInfoForm,
|
|
1297
|
+
Xe as PortraitUpload,
|
|
1298
|
+
_e as TEMPLATES,
|
|
1299
|
+
Je as VoucherConfig,
|
|
1300
|
+
He as downloadBlob,
|
|
1301
|
+
$e as drawContactInfo,
|
|
1302
|
+
Re as drawMultilineText,
|
|
1303
|
+
Be as drawOvalPortrait,
|
|
1314
1304
|
ae as drawTemplate,
|
|
1315
1305
|
re as drawText,
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1306
|
+
Ze as enhancePortrait,
|
|
1307
|
+
Te as enhancePortraitFallback,
|
|
1308
|
+
Me as exportBillAsPDF,
|
|
1319
1309
|
J as formatDescription,
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1310
|
+
ze as generateBillPDF,
|
|
1311
|
+
q as getApiKey,
|
|
1312
|
+
at as getDefaultTemplateId,
|
|
1323
1313
|
te as getLayout,
|
|
1324
1314
|
ne as getTemplate,
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1315
|
+
st as getTemplateById,
|
|
1316
|
+
ot as getTemplateProvider,
|
|
1317
|
+
Ce as hasApiKey,
|
|
1318
|
+
it as listTemplates,
|
|
1319
|
+
Y as loadImage,
|
|
1320
|
+
Ae as removeBackground,
|
|
1331
1321
|
ie as renderBackSide,
|
|
1332
1322
|
oe as renderFrontSide,
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1323
|
+
Se as setApiKey,
|
|
1324
|
+
rt as setTemplateProvider,
|
|
1325
|
+
Ke as staticTemplateProvider,
|
|
1326
|
+
z as t,
|
|
1327
|
+
et as useBillCanvasRefs,
|
|
1328
|
+
w as useBillStore
|
|
1339
1329
|
};
|