@beeintel/batch-image 1.0.1 → 1.1.1

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.
Files changed (60) hide show
  1. package/README.md +188 -184
  2. package/dist/chunks/{AdjustToolPanel-BELqYSUR.js → AdjustToolPanel-BEqQFYEO.js} +30 -29
  3. package/dist/chunks/BackgroundToolPanel-Dw3uT7S-.js +43 -0
  4. package/dist/chunks/{BatchMaterials-niGKrga3.js → BatchMaterials-HiK3VQc3.js} +1 -1
  5. package/dist/chunks/BatchModeChoices-BAslK92y.js +118 -0
  6. package/dist/chunks/{BatchOutputColorPicker-CCvmIF-b.js → BatchOutputColorPicker-CgtnQBA3.js} +1 -1
  7. package/dist/chunks/BatchReferenceFields-DbjXtKC4.js +308 -0
  8. package/dist/chunks/BeautifyToolPanel-imF6jnTG.js +220 -0
  9. package/dist/chunks/{BrandMarkToolPanel-FKxXth_3.js → BrandMarkToolPanel-C-gouhaT.js} +319 -333
  10. package/dist/chunks/{ContentTrimControl-BQfigZPq.js → ContentTrimControl-LgNIZbXa.js} +2 -2
  11. package/dist/chunks/{CropToolPanel-BhSuHkYm.js → CropToolPanel-DsPgFUWI.js} +60 -56
  12. package/dist/chunks/CutoutToolPanel-BhJngz89.js +78 -0
  13. package/dist/chunks/DisclosureToolPanel-DOaWm-im.js +72 -0
  14. package/dist/chunks/ExpandToolPanel-CuufFNiC.js +69 -0
  15. package/dist/chunks/{ImageEffectsToolPanel-BRLPIt4q.js → ImageEffectsToolPanel-BsfBZdYp.js} +63 -52
  16. package/dist/chunks/{IpAuditToolPanel-DfY-mBSe.js → IpAuditToolPanel-DOB7TEoI.js} +15 -13
  17. package/dist/chunks/{ListingToolPanel-B9Yh3LBK.js → ListingToolPanel-Dapetiw-.js} +170 -184
  18. package/dist/chunks/{MaterialSelectionPlate-DhioUjdW.js → MaterialSelectionPlate-BjNttUh8.js} +4 -4
  19. package/dist/chunks/MetadataToolPanel-G56L-VTi.js +116 -0
  20. package/dist/chunks/{OrientToolPanel-BTrwaWBm.js → OrientToolPanel-BJHfMixX.js} +3 -3
  21. package/dist/chunks/PluginActionFooter.vue_vue_type_script_setup_true_lang-DI8W37RA.js +122 -0
  22. package/dist/chunks/ResizeToolPanel-HDDArzWx.js +1171 -0
  23. package/dist/chunks/RetouchToolPanel-Drei3Dj7.js +358 -0
  24. package/dist/chunks/ShadowToolPanel-BM5MRfYB.js +258 -0
  25. package/dist/chunks/SvgExportToolPanel-D3KNi5AS.js +208 -0
  26. package/dist/chunks/TranslationToolPanel-DbNO3IKA.js +104 -0
  27. package/dist/chunks/{UpscaleToolPanel-D0H-j2Tr.js → UpscaleToolPanel-5kT1uUl0.js} +44 -39
  28. package/dist/chunks/arrow-up-DT1zSe8a.js +18 -0
  29. package/dist/chunks/{engine-D-T-1RSx.js → engine-BZ0nkcqj.js} +1 -1
  30. package/dist/chunks/{entry-DK9FjQZ_.js → entry-FNjvjYxd.js} +7512 -7395
  31. package/dist/chunks/{hosted-resources-COzZ7nZY.js → hosted-resources-C3iu_zn4.js} +2 -2
  32. package/dist/chunks/{loader-circle-UFoEem2a.js → loader-circle-pki8gM3_.js} +1 -1
  33. package/dist/chunks/{motionFeatures-D4miwXxc.js → motionFeatures-Cp11tdeb.js} +1 -1
  34. package/dist/chunks/{search-BjTSm1KS.js → search-BNwQCPna.js} +1 -1
  35. package/dist/chunks/{standard-cutout-vPpP6xBc.js → standard-cutout-iIOMfl6q.js} +1 -1
  36. package/dist/chunks/{static-logo-2F9ORZWc.js → static-logo-7HK4ubmZ.js} +1 -1
  37. package/dist/config.d.ts +6 -0
  38. package/dist/index.d.ts +1 -0
  39. package/dist/index.js +6 -5
  40. package/dist/processing.js +3 -3
  41. package/dist/resources.json +113 -103
  42. package/dist/slots.d.ts +2 -0
  43. package/dist/style.css +1 -1
  44. package/dist/tool-links.d.ts +10 -0
  45. package/dist/types/batch/public/config.d.ts +6 -0
  46. package/package.json +95 -95
  47. package/dist/chunks/BackgroundToolPanel-Dy_l8KFl.js +0 -41
  48. package/dist/chunks/BatchModeChoices-BRqn6zNI.js +0 -111
  49. package/dist/chunks/BatchReferenceFields-C4t7OSTw.js +0 -316
  50. package/dist/chunks/BeautifyToolPanel-Dc-ddaBC.js +0 -215
  51. package/dist/chunks/CutoutToolPanel-BfaZZSE_.js +0 -73
  52. package/dist/chunks/DisclosureToolPanel-B_oc5fld.js +0 -76
  53. package/dist/chunks/ExpandToolPanel-D_ZODTUZ.js +0 -67
  54. package/dist/chunks/MetadataToolPanel-KVrtb3K0.js +0 -104
  55. package/dist/chunks/PluginActionFooter.vue_vue_type_script_setup_true_lang-C2kJCYeA.js +0 -102
  56. package/dist/chunks/ResizeToolPanel-Ch_-WR74.js +0 -1178
  57. package/dist/chunks/RetouchToolPanel-BTS33Dsd.js +0 -350
  58. package/dist/chunks/ShadowToolPanel-DxJE4eyV.js +0 -254
  59. package/dist/chunks/SvgExportToolPanel-RHmuQARH.js +0 -219
  60. package/dist/chunks/TranslationToolPanel-B_qTA1hM.js +0 -125
@@ -1,11 +1,11 @@
1
- import { defineComponent as He, inject as ka, ref as j, onMounted as Ue, watch as J, onUnmounted as je, computed as D, openBlock as w, createElementBlock as L, withModifiers as Ge, unref as n, createElementVNode as P, Fragment as de, renderList as ve, toDisplayString as y, createBlock as he, createCommentVNode as z, createVNode as ce, createTextVNode as re, nextTick as xe, withCtx as Me } from "vue";
2
- import { a6 as ge, a7 as _e, a8 as ie, a9 as fa, F as Je, aa as ha, ab as ya, ac as We, ad as wa, ae as _a, af as Pa, ag as ke, ah as Ia, ai as Ea, a3 as $e, aj as La, P as xa, R as Ma, ak as Ve, al as $, am as Va, an as Fe, ao as Xe, ap as Aa, aq as Ba, ar as fe, _ as Ca, G as qa, as as Sa } from "./entry-DK9FjQZ_.js";
3
- import { L as Oa, n as Z, r as ue, a_ as ne, a1 as ye } from "./hosted-resources-COzZ7nZY.js";
4
- import { C as Ra } from "./ContentTrimControl-BQfigZPq.js";
5
- import { a as Ta } from "./static-logo-2F9ORZWc.js";
6
- import { u as Na, a as Da, _ as za, n as Ka } from "./PluginActionFooter.vue_vue_type_script_setup_true_lang-C2kJCYeA.js";
7
- const Ua = "" + new URL("../assets/logo-preparation.worker-D9oa7SME.js", import.meta.url).href;
8
- function Ye(i) {
1
+ import { defineComponent as $e, inject as va, ref as j, onMounted as ze, watch as J, onUnmounted as Ke, computed as K, openBlock as I, createElementBlock as L, withModifiers as Ue, unref as n, createElementVNode as P, Fragment as de, renderList as ve, toDisplayString as w, createBlock as he, createCommentVNode as z, createVNode as ce, createTextVNode as re, nextTick as Me, withCtx as xe } from "vue";
2
+ import { a6 as ge, a7 as _e, a8 as ie, a9 as ka, F as Fe, aa as fa, ab as ha, ac as je, ad as ya, ae as wa, af as ke, ag as _a, ah as Pa, a3 as Ge, ai as Ia, P as Ea, R as La, aj as Ve, ak as $, al as Ma, am as We, an as He, ao as xa, ap as Va, aq as fe, _ as Aa, G as Ba, ar as qa } from "./entry-FNjvjYxd.js";
3
+ import { L as Sa, n as Z, r as ue, a_ as ne, a1 as ye } from "./hosted-resources-C3iu_zn4.js";
4
+ import { C as Ca } from "./ContentTrimControl-LgNIZbXa.js";
5
+ import { a as Oa } from "./static-logo-7HK4ubmZ.js";
6
+ import { u as Ra, a as Ta, _ as Na, n as Da } from "./PluginActionFooter.vue_vue_type_script_setup_true_lang-DI8W37RA.js";
7
+ const za = "" + new URL("../assets/logo-preparation.worker-D9oa7SME.js", import.meta.url).href;
8
+ function Je(i) {
9
9
  const s = new OffscreenCanvas(i.width, i.height), a = s.getContext("2d");
10
10
  if (!a) throw new Error("浏览器不支持本机 Logo 处理");
11
11
  a.drawImage(i, 0, 0);
@@ -16,7 +16,7 @@ function Ye(i) {
16
16
  });
17
17
  }
18
18
  const Ae = () => new DOMException("Logo 准备已取消", "AbortError");
19
- function ja(i) {
19
+ function Ka(i) {
20
20
  let s, a, c = !1, t = 0, g;
21
21
  function u() {
22
22
  s?.dispose(), s = void 0, a?.terminate(), a = void 0;
@@ -32,9 +32,9 @@ function ja(i) {
32
32
  run(l, p) {
33
33
  const R = ["intelligent", "isnet_fp16", "birefnet_quality"].includes(
34
34
  p.method
35
- ), I = p.crop?.kind === "alpha", { signal: f, onProgress: E } = p;
36
- return new Promise((k, M) => {
37
- if (c || f?.aborted) {
35
+ ), y = p.crop?.kind === "alpha", { signal: k, onProgress: V } = p;
36
+ return new Promise((f, M) => {
37
+ if (c || k?.aborted) {
38
38
  M(Ae());
39
39
  return;
40
40
  }
@@ -46,9 +46,9 @@ function ja(i) {
46
46
  M(new Error("Logo 需为5MiB以内的PNG、JPEG或WebP"));
47
47
  return;
48
48
  }
49
- const x = ++t, b = (S) => {
50
- g?.id === x && (g.cleanup(), g = void 0, u(), M(S));
51
- }, h = () => b(Ae()), q = setTimeout(
49
+ const E = ++t, b = (C) => {
50
+ g?.id === E && (g.cleanup(), g = void 0, u(), M(C));
51
+ }, h = () => b(Ae()), S = setTimeout(
52
52
  () => b(
53
53
  Object.assign(new Error("Logo 准备超时,请保留原图或更换素材"), {
54
54
  reason: "local-transient"
@@ -56,15 +56,15 @@ function ja(i) {
56
56
  ),
57
57
  p.method === "birefnet_quality" ? 20 * 6e4 + 3e4 : R ? 21e4 : 3e4
58
58
  );
59
- g = { id: x, reject: M, resolve: k, cleanup: () => {
60
- clearTimeout(q), f?.removeEventListener("abort", h);
61
- } }, f?.addEventListener("abort", h, { once: !0 });
59
+ g = { id: E, reject: M, resolve: f, cleanup: () => {
60
+ clearTimeout(S), k?.removeEventListener("abort", h);
61
+ } }, k?.addEventListener("abort", h, { once: !0 });
62
62
  try {
63
- a ??= Oa(Ua, {
63
+ a ??= Sa(za, {
64
64
  type: "module"
65
- }), a.onmessage = async (S) => {
66
- if (g?.id !== S.data.id) return;
67
- const _ = S.data;
65
+ }), a.onmessage = async (C) => {
66
+ if (g?.id !== C.data.id) return;
67
+ const _ = C.data;
68
68
  if (_.error) {
69
69
  b(Object.assign(new Error(_.error), { reason: _.reason }));
70
70
  return;
@@ -80,7 +80,7 @@ function ja(i) {
80
80
  if (!i || i.supports?.(T) === !1)
81
81
  throw new Error("Logo 本机抠图资源尚未配置");
82
82
  const Y = await crypto.subtle.digest("SHA-256", await _.blob.arrayBuffer());
83
- if (g?.id !== x || f?.aborted) return;
83
+ if (g?.id !== E || k?.aborted) return;
84
84
  s = i.createExecutor();
85
85
  const v = await s.run(
86
86
  {
@@ -98,12 +98,12 @@ function ja(i) {
98
98
  },
99
99
  _.blob,
100
100
  {
101
- signal: f ?? new AbortController().signal,
101
+ signal: k ?? new AbortController().signal,
102
102
  readAsset: async () => {
103
103
  throw new Error("Logo cutout does not reference additional assets");
104
104
  },
105
105
  progress: (d) => {
106
- g?.id === x && !f?.aborted && E?.(d.total ? d.completed / d.total : void 0);
106
+ g?.id === E && !k?.aborted && V?.(d.total ? d.completed / d.total : void 0);
107
107
  }
108
108
  }
109
109
  ).catch((d) => {
@@ -112,9 +112,9 @@ function ja(i) {
112
112
  });
113
113
  });
114
114
  if (v.kind !== "image") throw new Error("Logo 处理结果无效");
115
- if (g?.id !== x || f?.aborted) return;
115
+ if (g?.id !== E || k?.aborted) return;
116
116
  s.dispose(), s = void 0, A = {
117
- id: x,
117
+ id: E,
118
118
  blob: v.blob,
119
119
  width: _.width,
120
120
  height: _.height,
@@ -131,25 +131,25 @@ function ja(i) {
131
131
  throw new Error("Logo PNG 无效");
132
132
  const T = await createImageBitmap(A.blob);
133
133
  try {
134
- if (Ye(T), !I && (T.width !== _.width || T.height !== _.height) || T.width !== A.width || T.height !== A.height || T.width * T.height > _e)
134
+ if (Je(T), !y && (T.width !== _.width || T.height !== _.height) || T.width !== A.width || T.height !== A.height || T.width * T.height > _e)
135
135
  throw new Error("Logo 处理结果尺寸无效");
136
136
  } finally {
137
137
  T.close();
138
138
  }
139
139
  }
140
- if (g?.id !== x || f?.aborted) return;
141
- g.cleanup(), g = void 0, u(), k(A);
140
+ if (g?.id !== E || k?.aborted) return;
141
+ g.cleanup(), g = void 0, u(), f(A);
142
142
  } catch (A) {
143
143
  b(A);
144
144
  }
145
145
  }, a.onerror = () => b(new Error("Logo 准备失败,原图保留")), a.onmessageerror = () => b(new Error("无法读取 Logo 处理结果")), a.postMessage({
146
- id: x,
146
+ id: E,
147
147
  blob: l,
148
148
  normalizeOnly: R || p.method === "original",
149
149
  crop: p.crop
150
150
  });
151
- } catch (S) {
152
- b(S);
151
+ } catch (C) {
152
+ b(C);
153
153
  }
154
154
  });
155
155
  }
@@ -160,7 +160,7 @@ function we(i) {
160
160
  return { clientRequestId: s, operationId: a, itemId: c, inputVersionId: t };
161
161
  }
162
162
  function Be(i) {
163
- const s = ue(i), a = ie(s.source), c = fa(s.settings), t = ue(s.request), g = ue(t.source), u = ue(t.params), l = ue(s.outcome);
163
+ const s = ue(i), a = ie(s.source), c = ka(s.settings), t = ue(s.request), g = ue(t.source), u = ue(t.params), l = ue(s.outcome);
164
164
  if (g.kind !== "asset" || g.assetId !== a.assetId || g.assetVersionId !== a.assetVersionId || t.toolId !== "cutout" || t.toolVersion !== "1" || u.model !== c.background || !["picwish", "ideogram"].includes(c.background))
165
165
  throw new Error("Logo receipt identity invalid");
166
166
  const p = {
@@ -181,24 +181,24 @@ function Be(i) {
181
181
  };
182
182
  if (l.kind === "reserved" || l.kind === "unknown")
183
183
  return { ...R, outcome: { kind: l.kind } };
184
- const I = ye(l.receipt, we(p));
185
- if (l.kind === "receipt") return { ...R, outcome: { kind: "receipt", receipt: I } };
186
- if (l.kind === "ready" && I.status === "succeeded")
184
+ const y = ye(l.receipt, we(p));
185
+ if (l.kind === "receipt") return { ...R, outcome: { kind: "receipt", receipt: y } };
186
+ if (l.kind === "ready" && y.status === "succeeded")
187
187
  return {
188
188
  ...R,
189
- outcome: { kind: "ready", receipt: I, master: ie(l.master) }
189
+ outcome: { kind: "ready", receipt: y, master: ie(l.master) }
190
190
  };
191
191
  throw new Error("Logo receipt state invalid");
192
192
  }
193
- function Ce() {
193
+ function qe() {
194
194
  return new Promise((i, s) => {
195
195
  const a = indexedDB.open("batch-logo-attempts-v2", 1);
196
196
  a.onupgradeneeded = () => a.result.createObjectStore("attempts", { keyPath: "key" }), a.onerror = () => s(a.error), a.onsuccess = () => i(a.result);
197
197
  });
198
198
  }
199
- const Ga = {
199
+ const Ua = {
200
200
  async reserve(i) {
201
- const s = await Ce();
201
+ const s = await qe();
202
202
  return new Promise((a, c) => {
203
203
  const t = s.transaction("attempts", "readwrite"), g = t.objectStore("attempts");
204
204
  let u = { attempt: i, submit: !1 };
@@ -220,7 +220,7 @@ const Ga = {
220
220
  });
221
221
  },
222
222
  async save(i) {
223
- const s = await Ce();
223
+ const s = await qe();
224
224
  return new Promise((a, c) => {
225
225
  const t = s.transaction("attempts", "readwrite"), g = t.objectStore("attempts"), u = g.get(i.key);
226
226
  u.onsuccess = () => {
@@ -240,8 +240,8 @@ const Ga = {
240
240
  });
241
241
  }
242
242
  };
243
- async function Wa(i) {
244
- const s = await Ce();
243
+ async function ja(i) {
244
+ const s = await qe();
245
245
  return new Promise((a, c) => {
246
246
  const t = s.transaction("attempts", "readonly"), g = t.objectStore("attempts").openCursor(), u = [];
247
247
  g.onsuccess = () => {
@@ -261,18 +261,18 @@ async function Wa(i) {
261
261
  };
262
262
  });
263
263
  }
264
- const Qe = "logo-v2";
265
- function Ze(i, s, a) {
264
+ const Xe = "logo-v2";
265
+ function Ye(i, s, a) {
266
266
  return JSON.stringify([
267
267
  i,
268
268
  s.assetId,
269
269
  s.assetVersionId,
270
270
  s.sha256,
271
271
  a.background,
272
- Qe
272
+ Xe
273
273
  ]);
274
274
  }
275
- async function $a(i, s) {
275
+ async function Ga(i, s) {
276
276
  const a = () => {
277
277
  throw new Error("Logo cloud services not configured");
278
278
  }, { document: c, signal: t, ownerBatchId: g } = i, u = c.desired, l = c.original;
@@ -281,12 +281,12 @@ async function $a(i, s) {
281
281
  if (t.aborted) throw new DOMException("Cancelled", "AbortError");
282
282
  };
283
283
  p();
284
- const R = u.background === "original" ? void 0 : c.masters.find((k) => k.background === u.background);
285
- let I = R?.asset;
286
- if (!I && u.background === "original" && (I = l), !I && (u.background === "picwish" || u.background === "ideogram")) {
284
+ const R = u.background === "original" ? void 0 : c.masters.find((f) => f.background === u.background);
285
+ let y = R?.asset;
286
+ if (!y && u.background === "original" && (y = l), !y && (u.background === "picwish" || u.background === "ideogram")) {
287
287
  i.onStage?.("cloud");
288
- const k = s.journal ?? Ga, M = {
289
- key: Ze(g, l, u),
288
+ const f = s.journal ?? Ua, M = {
289
+ key: Ye(g, l, u),
290
290
  ownerBatchId: g,
291
291
  source: l,
292
292
  settings: u,
@@ -301,17 +301,17 @@ async function $a(i, s) {
301
301
  params: { execution: "python", model: u.background, background: "transparent" }
302
302
  },
303
303
  outcome: { kind: "reserved" }
304
- }, x = await k.reserve(M);
305
- let b = x.attempt;
306
- if (b.outcome.kind === "ready") I = ie(b.outcome.master);
304
+ }, E = await f.reserve(M);
305
+ let b = E.attempt;
306
+ if (b.outcome.kind === "ready") y = ie(b.outcome.master);
307
307
  else
308
308
  try {
309
309
  p();
310
- let h = x.submit ? await (s.submit ?? a)(b.request) : b.outcome.kind === "receipt" ? await (s.queryTask ?? a)(b.outcome.receipt.taskId, "python-ai") : await (s.queryRequest ?? a)(
310
+ let h = E.submit ? await (s.submit ?? a)(b.request) : b.outcome.kind === "receipt" ? await (s.queryTask ?? a)(b.outcome.receipt.taskId, "python-ai") : await (s.queryRequest ?? a)(
311
311
  b.request.clientRequestId,
312
312
  "python-ai"
313
313
  );
314
- h = ye(h, we(b.request)), !x.submit && h.status === "failed" && [
314
+ h = ye(h, we(b.request)), !E.submit && h.status === "failed" && [
315
315
  "PROVIDER_PENDING",
316
316
  "PROVIDER_ACCEPTANCE_UNKNOWN",
317
317
  "GATEWAY_UNAVAILABLE",
@@ -319,113 +319,110 @@ async function $a(i, s) {
319
319
  ].includes(h.error?.code ?? "") && (h = ye(
320
320
  await (s.queryOriginal ?? a)(h.taskId),
321
321
  we(b.request)
322
- )), b = { ...b, outcome: { kind: "receipt", receipt: h } }, await k.save(b);
323
- const q = Date.now() + 3e4;
324
- for (; ["accepted", "queued", "running"].includes(h.status) && Date.now() < q && !t.aborted && (await new Promise(
322
+ )), b = { ...b, outcome: { kind: "receipt", receipt: h } }, await f.save(b);
323
+ const S = Date.now() + 3e4;
324
+ for (; ["accepted", "queued", "running"].includes(h.status) && Date.now() < S && !t.aborted && (await new Promise(
325
325
  (G) => setTimeout(G, Math.min(h.pollAfterMs ?? 1500, 3e3))
326
326
  ), !t.aborted); )
327
327
  h = ye(
328
328
  await (s.queryTask ?? a)(h.taskId, "python-ai"),
329
329
  we(b.request)
330
- ), b = { ...b, outcome: { kind: "receipt", receipt: h } }, await k.save(b);
330
+ ), b = { ...b, outcome: { kind: "receipt", receipt: h } }, await f.save(b);
331
331
  if (h.status === "succeeded" && h.result?.kind === "image") {
332
- I = ie(h.result.asset);
332
+ y = ie(h.result.asset);
333
333
  const G = l.orientation && l.orientation >= 5 ? [l.height, l.width] : [l.width, l.height];
334
- if (I.width !== G[0] || I.height !== G[1] || I.mime !== "image/png")
334
+ if (y.width !== G[0] || y.height !== G[1] || y.mime !== "image/png")
335
335
  throw new Error("Logo 处理结果尺寸无效");
336
- const S = await s.read(I, AbortSignal.timeout(3e4)), _ = new Uint8Array(await S.slice(0, 8).arrayBuffer());
336
+ const C = await s.read(y, AbortSignal.timeout(3e4)), _ = new Uint8Array(await C.slice(0, 8).arrayBuffer());
337
337
  if (![137, 80, 78, 71, 13, 10, 26, 10].every((U, T) => _[T] === U))
338
338
  throw new Error("Logo PNG 无效");
339
- const A = await createImageBitmap(S);
339
+ const A = await createImageBitmap(C);
340
340
  try {
341
- if (Ye(A), A.width !== I.width || A.height !== I.height)
341
+ if (Je(A), A.width !== y.width || A.height !== y.height)
342
342
  throw new Error("Logo 处理结果尺寸无效");
343
343
  } finally {
344
344
  A.close();
345
345
  }
346
- await k.save({ ...b, outcome: { kind: "ready", receipt: h, master: I } });
346
+ await f.save({ ...b, outcome: { kind: "ready", receipt: h, master: y } });
347
347
  } else
348
348
  throw Object.assign(new Error("Logo 云端任务尚未完成,请查询原任务"), {
349
349
  reason: "cloud-unknown"
350
350
  });
351
351
  } catch (h) {
352
- throw b.outcome.kind === "reserved" && await k.save({ ...b, outcome: { kind: "unknown" } }), Object.assign(h instanceof Error ? h : new Error(String(h)), {
352
+ throw b.outcome.kind === "reserved" && await f.save({ ...b, outcome: { kind: "unknown" } }), Object.assign(h instanceof Error ? h : new Error(String(h)), {
353
353
  reason: "cloud-unknown"
354
354
  });
355
355
  }
356
356
  }
357
- if (!I) {
357
+ if (!y) {
358
358
  i.onStage?.("model");
359
- const k = await s.read(l, t);
359
+ const f = await s.read(l, t);
360
360
  if (p(), u.background === "picwish" || u.background === "ideogram")
361
361
  throw new Error("Logo cloud result missing");
362
- const M = await s.preparer.run(k, {
362
+ const M = await s.preparer.run(f, {
363
363
  method: u.background,
364
364
  signal: t,
365
365
  onProgress: i.onProgress
366
366
  });
367
- p(), i.onStage?.("save"), I = ie(await s.save(M.blob, "brand-logo-master.png")), p();
367
+ p(), i.onStage?.("save"), y = ie(await s.save(M.blob, "brand-logo-master.png")), p();
368
368
  }
369
369
  p();
370
- const f = {
370
+ const k = {
371
371
  background: u.background,
372
- processorVersion: R?.processorVersion ?? Qe,
373
- asset: I
372
+ processorVersion: R?.processorVersion ?? Xe,
373
+ asset: y
374
374
  };
375
- await i.onMaster?.(f), p();
376
- let E = I;
375
+ await i.onMaster?.(k), p();
376
+ let V = y;
377
377
  if (u.crop.kind === "alpha") {
378
378
  i.onStage?.("derive");
379
- const k = await s.read(I, t);
379
+ const f = await s.read(y, t);
380
380
  p();
381
- const M = await s.preparer.run(k, {
381
+ const M = await s.preparer.run(f, {
382
382
  method: "original",
383
383
  crop: u.crop,
384
384
  signal: t
385
385
  });
386
- p(), i.onStage?.("save"), E = ie(await s.save(M.blob, "brand-logo.png")), p();
386
+ p(), i.onStage?.("save"), V = ie(await s.save(M.blob, "brand-logo.png")), p();
387
387
  }
388
388
  return p(), {
389
389
  ...c,
390
- applied: { settings: u, asset: E },
391
- masters: [...c.masters.filter((k) => k.background !== u.background), f],
390
+ applied: { settings: u, asset: V },
391
+ masters: [...c.masters.filter((f) => f.background !== u.background), k],
392
392
  state: { kind: "idle" }
393
393
  };
394
394
  }
395
- const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label", "aria-checked", "tabindex", "onClick", "onKeydown"], Xa = ["aria-label"], Ya = ["aria-label", "disabled"], Qa = ["src", "alt"], Za = { key: 2 }, eo = ["aria-label"], ao = { class: "logo-background-select" }, oo = ["value", "disabled"], to = { value: "original" }, ro = { value: "solid" }, no = ["value", "disabled"], io = {
395
+ const Wa = ["disabled", "aria-label"], $a = ["aria-label"], Fa = ["aria-label", "aria-checked", "tabindex", "onClick", "onKeydown"], Ha = ["aria-label"], Ja = ["aria-label", "disabled"], Xa = ["src", "alt"], Ya = { key: 2 }, Qa = ["aria-label"], Za = { class: "logo-background-select" }, eo = ["value", "disabled"], ao = { value: "original" }, oo = { value: "solid" }, to = ["value", "disabled"], ro = {
396
396
  key: 1,
397
397
  class: "hint"
398
- }, so = {
398
+ }, no = {
399
399
  key: 2,
400
400
  class: "hint",
401
401
  role: "status"
402
- }, lo = {
402
+ }, io = {
403
403
  key: 3,
404
- class: "hint"
405
- }, uo = {
406
- key: 4,
407
404
  class: "hint logo-progress",
408
405
  role: "status",
409
406
  "aria-live": "polite"
410
- }, co = { class: "logo-progress-label" }, go = ["value"], mo = ["aria-label", "title"], bo = {
407
+ }, so = { class: "logo-progress-label" }, lo = ["value"], uo = ["aria-label", "title"], co = {
408
+ key: 4,
409
+ class: "logo-actions"
410
+ }, go = ["disabled"], mo = {
411
411
  key: 5,
412
412
  class: "logo-actions"
413
- }, po = ["disabled"], vo = {
413
+ }, bo = ["disabled"], po = {
414
414
  key: 6,
415
- class: "logo-actions"
416
- }, ko = ["disabled"], fo = {
417
- key: 7,
418
415
  class: "logo-error",
419
416
  role: "alert"
420
- }, ho = { class: "brand-field-label" }, yo = ["aria-label"], wo = ["aria-label", "aria-pressed", "onClick"], _o = ["aria-label", "min", "max", "value", "onInput"], Po = ["aria-label", "title", "aria-valuetext", "min", "max", "value", "onInput"], Io = {
417
+ }, vo = { class: "brand-field-label" }, ko = ["aria-label"], fo = ["aria-label", "aria-pressed", "onClick"], ho = ["aria-label", "min", "max", "value", "onInput"], yo = ["aria-label", "title", "aria-valuetext", "min", "max", "value", "onInput"], wo = {
421
418
  key: 0,
422
419
  class: "brand-density-ticks",
423
420
  "aria-hidden": "true"
424
- }, Eo = {
425
- key: 9,
421
+ }, _o = {
422
+ key: 8,
426
423
  class: "logo-error",
427
424
  role: "alert"
428
- }, Lo = ["aria-label"], xo = /* @__PURE__ */ He({
425
+ }, Po = ["aria-label"], Io = /* @__PURE__ */ $e({
429
426
  __name: "BrandMarkPanel",
430
427
  props: {
431
428
  modelValue: {},
@@ -439,26 +436,26 @@ const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label",
439
436
  },
440
437
  emits: ["update:modelValue", "validity"],
441
438
  setup(i, { emit: s }) {
442
- const { ui: a, uiText: c } = Je(), t = i, g = s, u = ha(), l = ka(ya, void 0), p = We(() => t.modelValue.logo ?? t.modelValue.originalLogo);
439
+ const { ui: a, uiText: c } = Fe(), t = i, g = s, u = fa(), l = va(ha, void 0), p = je(() => t.modelValue.logo ?? t.modelValue.originalLogo);
443
440
  function R(e) {
444
441
  if (!t.uploadReference) throw Error("参考素材注册能力尚未配置");
445
442
  return t.uploadReference(e);
446
443
  }
447
- const I = j(), f = j(!1), E = j(""), k = j(""), M = j({});
448
- let x = 0, b, h, q, G, S;
444
+ const y = j(), k = j(!1), V = j(""), f = j(""), M = j({});
445
+ let E = 0, b, h, S, G, C;
449
446
  const _ = j([]);
450
447
  async function A() {
451
448
  const e = t.scopeKey ?? "";
452
449
  try {
453
- const r = await Wa(e);
450
+ const r = await ja(e);
454
451
  U && (t.scopeKey ?? "") === e && (_.value = r);
455
452
  } catch {
456
453
  U && (t.scopeKey ?? "") === e && (_.value = []);
457
454
  }
458
455
  }
459
- Ue(A), J(() => t.scopeKey, A);
456
+ ze(A), J(() => t.scopeKey, A);
460
457
  let U = !0;
461
- je(() => {
458
+ Ke(() => {
462
459
  U = !1;
463
460
  });
464
461
  const T = [
@@ -471,20 +468,20 @@ const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label",
471
468
  ["bottom-left", "左下", "↙"],
472
469
  ["bottom", "底部", "↓"],
473
470
  ["bottom-right", "右下", "↘"]
474
- ], Y = j(), v = D(() => wa(t.modelValue)), d = D(() => _a(v.value)), B = D(() => d.value.desired), ea = D(() => ["picwish", "ideogram"].includes(B.value.background)), W = j("");
475
- function qe(e) {
471
+ ], Y = j(), v = K(() => ya(t.modelValue)), d = K(() => wa(v.value)), B = K(() => d.value.desired), Qe = K(() => ["picwish", "ideogram"].includes(B.value.background)), W = j("");
472
+ function Ze(e) {
476
473
  const r = d.value;
477
474
  if (r.kind !== "loaded") return !1;
478
475
  if (r.masters.some((m) => m.background === e)) return !0;
479
476
  const o = r.original;
480
477
  return !!o && _.value.some(
481
- (m) => m.key === Ze(t.scopeKey ?? "", o, { ...r.desired, background: e })
478
+ (m) => m.key === Ye(t.scopeKey ?? "", o, { ...r.desired, background: e })
482
479
  );
483
480
  }
484
481
  function ee(e) {
485
482
  if (e === "original" || e === "solid" || d.value.kind === "loaded" && d.value.masters.some((o) => o.background === e))
486
483
  return !0;
487
- if (!qe(e) && !(t.availableCutoutModes ?? []).includes(e))
484
+ if (!Ze(e) && !(t.availableCutoutModes ?? []).includes(e))
488
485
  return !1;
489
486
  if (e === "picwish" || e === "ideogram") {
490
487
  const o = l?.services;
@@ -497,49 +494,46 @@ const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label",
497
494
  background: "transparent"
498
495
  }) !== !1;
499
496
  }
500
- const Se = D(() => {
501
- const e = B.value.background;
502
- return qe(e) || e === "original" || e === "solid" ? 0 : Pa(e, 1);
503
- }), ae = j(!0), me = j(0), X = D(() => B.value.crop.kind !== "alpha" || ae.value), Oe = D(() => {
497
+ const ae = j(!0), me = j(0), X = K(() => B.value.crop.kind !== "alpha" || ae.value), Se = K(() => {
504
498
  const e = d.value;
505
499
  if (e.kind !== "loaded") return;
506
500
  const r = e.masters.find((o) => o.background === e.desired.background);
507
501
  return e.desired.background === "original" ? e.original : r?.asset ?? e.original;
508
- }), Re = We(() => Oe.value), Pe = D(() => {
509
- const e = d.value, r = Oe.value;
502
+ }), Ce = je(() => Se.value), Pe = K(() => {
503
+ const e = d.value, r = Se.value;
510
504
  if (!(e.kind !== "loaded" || !r))
511
505
  return {
512
- source: Re.value ? {
513
- url: Re.value,
506
+ source: Ce.value ? {
507
+ url: Ce.value,
514
508
  versionId: JSON.stringify([r.assetId, r.assetVersionId, r.sha256])
515
509
  } : void 0,
516
510
  approximate: e.desired.background !== "original" && !e.masters.some((o) => o.background === e.desired.background)
517
511
  };
518
512
  });
519
- function aa(e) {
513
+ function ea(e) {
520
514
  be({
521
515
  ...B.value,
522
516
  crop: e ? { kind: "alpha", padding: 0 } : { kind: "none" }
523
517
  });
524
518
  }
525
- function oa(e) {
519
+ function aa(e) {
526
520
  be({ ...B.value, crop: { kind: "alpha", padding: e } });
527
521
  }
528
522
  function be(e) {
529
- if (t.disabled || f.value && (B.value.background !== "original" || q !== void 0) || e.crop.kind === "alpha" && (!Number.isInteger(e.crop.padding) || e.crop.padding < 0 || e.crop.padding > 1024) || ae.value && Ve(e, B.value)) return;
530
- E.value = "", W.value = "";
523
+ if (t.disabled || k.value && (B.value.background !== "original" || S !== void 0) || e.crop.kind === "alpha" && (!Number.isInteger(e.crop.padding) || e.crop.padding < 0 || e.crop.padding > 1024) || ae.value && Ve(e, B.value)) return;
524
+ V.value = "", W.value = "";
531
525
  const r = d.value;
532
- K(
526
+ D(
533
527
  $(
534
528
  v.value,
535
529
  r.kind === "loaded" ? { ...r, desired: e, state: { kind: "idle" } } : { ...r, desired: e }
536
530
  )
537
531
  );
538
532
  }
539
- function ta() {
540
- me.value++, ae.value = !0, F(), E.value = "", W.value = "";
533
+ function oa() {
534
+ me.value++, ae.value = !0, F(), V.value = "", W.value = "";
541
535
  const e = d.value;
542
- e.kind === "loaded" && K(
536
+ e.kind === "loaded" && D(
543
537
  $(v.value, {
544
538
  ...e,
545
539
  desired: e.applied.settings,
@@ -547,13 +541,13 @@ const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label",
547
541
  })
548
542
  );
549
543
  }
550
- function ra(e) {
551
- const r = e.target.value, o = ["original", "solid", ...$e.map((m) => m.model)].find(
544
+ function ta(e) {
545
+ const r = e.target.value, o = ["original", "solid", ...Ge.map((m) => m.model)].find(
552
546
  (m) => m === r
553
547
  );
554
548
  o && ee(o) && be({ ...B.value, background: o });
555
549
  }
556
- const se = D(() => t.modelValue.mode ?? "single");
550
+ const se = K(() => t.modelValue.mode ?? "single");
557
551
  J(
558
552
  [
559
553
  () => t.resetEpoch,
@@ -566,29 +560,29 @@ const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label",
566
560
  me.value++, ae.value = !0;
567
561
  }
568
562
  );
569
- const na = [
563
+ const ra = [
570
564
  { key: "sizePercent", label: "Logo 大小", min: 1, max: 50, unit: "%" },
571
565
  { key: "marginPercent", label: "边距", min: 0, max: 20, unit: "%" },
572
566
  { key: "density", label: "疏密", min: 0, max: 100, unit: "" },
573
567
  { key: "angle", label: "角度", min: -90, max: 90, unit: "°" },
574
568
  { key: "opacity", label: "不透明度", min: 0, max: 100, unit: "%" }
575
- ], Ie = D(
576
- () => na.filter(
569
+ ], Ie = K(
570
+ () => ra.filter(
577
571
  (e) => se.value === "tile" ? e.key !== "marginPercent" : e.key !== "density" && e.key !== "angle"
578
572
  )
579
573
  );
580
574
  function Ee(e) {
581
575
  return e === "opacity" ? Math.round(v.value.opacity * 100) : v.value[e] ?? (e === "density" ? 50 : -30);
582
576
  }
583
- const Te = D(
577
+ const Oe = K(
584
578
  () => Ie.value.every((e) => {
585
579
  const r = M.value[e.key];
586
580
  if (r === void 0) return !0;
587
581
  const o = Number(r);
588
582
  return r.trim() !== "" && Number.isInteger(o) && o >= e.min && o <= e.max;
589
583
  })
590
- ), ia = D(
591
- () => ke(v.value).kind === "ready" && !f.value && !E.value && Te.value && X.value
584
+ ), na = K(
585
+ () => ke(v.value).kind === "ready" && !k.value && !V.value && Oe.value && X.value
592
586
  );
593
587
  J(
594
588
  () => [
@@ -600,8 +594,8 @@ const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label",
600
594
  ],
601
595
  (e, r) => {
602
596
  const o = ["sizePercent", "marginPercent", "opacity", "density", "angle"], m = { ...M.value };
603
- o.forEach((V, C) => {
604
- e[C] !== r[C] && delete m[V];
597
+ o.forEach((x, q) => {
598
+ e[q] !== r[q] && delete m[x];
605
599
  }), M.value = m;
606
600
  }
607
601
  ), J(
@@ -611,45 +605,45 @@ const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label",
611
605
  }
612
606
  ), J(se, () => {
613
607
  M.value = {};
614
- }), J(ia, (e) => g("validity", e), { immediate: !0 });
615
- function K(e) {
608
+ }), J(na, (e) => g("validity", e), { immediate: !0 });
609
+ function D(e) {
616
610
  t.disabled || g("update:modelValue", { ...v.value, ...e });
617
611
  }
618
- function Ne(e) {
619
- t.disabled || (M.value = {}, g("update:modelValue", Va(t.modelValue, e)));
612
+ function Re(e) {
613
+ t.disabled || (M.value = {}, g("update:modelValue", Ma(t.modelValue, e)));
620
614
  }
621
- function sa(e, r, o, m) {
615
+ function ia(e, r, o, m) {
622
616
  if (t.disabled || e.defaultPrevented) return;
623
- let V;
624
- if (e.key === "ArrowRight" || e.key === "ArrowDown") V = (r + 1) % o.length;
617
+ let x;
618
+ if (e.key === "ArrowRight" || e.key === "ArrowDown") x = (r + 1) % o.length;
625
619
  else if (e.key === "ArrowLeft" || e.key === "ArrowUp")
626
- V = (r + o.length - 1) % o.length;
627
- else if (e.key === "Home") V = 0;
628
- else if (e.key === "End") V = o.length - 1;
620
+ x = (r + o.length - 1) % o.length;
621
+ else if (e.key === "Home") x = 0;
622
+ else if (e.key === "End") x = o.length - 1;
629
623
  else return;
630
624
  e.preventDefault(), e.stopPropagation();
631
- const C = e.currentTarget.parentElement;
632
- m(o[V]), xe(() => C?.querySelectorAll("[role=radio]")[V]?.focus());
625
+ const q = e.currentTarget.parentElement;
626
+ m(o[x]), Me(() => q?.querySelectorAll("[role=radio]")[x]?.focus());
633
627
  }
634
628
  function F() {
635
- clearTimeout(G), G = void 0, q = void 0, x++, b?.abort(), b = void 0, h?.dispose(), h = void 0, f.value = !1, k.value = "", Y.value = void 0;
629
+ clearTimeout(G), G = void 0, S = void 0, E++, b?.abort(), b = void 0, h?.dispose(), h = void 0, k.value = !1, f.value = "", Y.value = void 0;
636
630
  }
637
631
  J(
638
632
  () => [t.disabled, t.scopeKey, t.resetEpoch],
639
633
  () => {
640
- F(), E.value = "", M.value = {};
634
+ F(), V.value = "", M.value = {};
641
635
  },
642
636
  { flush: "sync" }
643
- ), je(F);
644
- function De(e) {
637
+ ), Ke(F);
638
+ function Te(e) {
645
639
  if (!e.width || !e.height || e.width * e.height > _e || e.bytes > ge || !["image/png", "image/jpeg", "image/webp"].includes(e.mime))
646
640
  throw new Error("Logo 需为5MiB、400万像素以内的静态图片");
647
641
  }
648
- async function la(e, r) {
642
+ async function sa(e, r) {
649
643
  if (!l) throw Error("参考素材读取能力尚未配置");
650
- return De(e), Aa(l, e, r);
644
+ return Te(e), xa(l, e, r);
651
645
  }
652
- const Q = D(() => {
646
+ const Q = K(() => {
653
647
  const e = d.value, r = e.kind === "loaded" ? e.original : void 0;
654
648
  return JSON.stringify([
655
649
  t.scopeKey,
@@ -667,16 +661,16 @@ const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label",
667
661
  });
668
662
  function pe() {
669
663
  const e = d.value;
670
- if (!U || t.disabled || f.value || !X.value || e.kind !== "loaded" || !e.original || e.desired.background !== "original")
664
+ if (!U || t.disabled || k.value || !X.value || e.kind !== "loaded" || !e.original || e.desired.background !== "original")
671
665
  return;
672
666
  const r = Q.value;
673
- if (ke(v.value).kind === "ready" || S === r) return;
667
+ if (ke(v.value).kind === "ready" || C === r) return;
674
668
  if (e.state.kind === "failed") {
675
- S = r;
669
+ C = r;
676
670
  return;
677
671
  }
678
- if (S = r, E.value = "", W.value = "", e.desired.crop.kind === "none") {
679
- K(
672
+ if (C = r, V.value = "", W.value = "", e.desired.crop.kind === "none") {
673
+ D(
680
674
  $(v.value, {
681
675
  ...e,
682
676
  applied: { settings: fe(), asset: e.original },
@@ -697,7 +691,7 @@ const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label",
697
691
  Q,
698
692
  () => {
699
693
  const e = d.value;
700
- q?.generation === x && Ve(e.desired, q.expected.desired) && (e.kind === "empty" && q.expected.kind === "empty" || e.kind === "loaded" && q.expected.kind === "loaded" && e.original && q.expected.original && Fe(e.original, q.expected.original)) || (F(), S = void 0, E.value = "", W.value = "", pe());
694
+ S?.generation === E && Ve(e.desired, S.expected.desired) && (e.kind === "empty" && S.expected.kind === "empty" || e.kind === "loaded" && S.expected.kind === "loaded" && e.original && S.expected.original && We(e.original, S.expected.original)) || (F(), C = void 0, V.value = "", W.value = "", pe());
701
695
  },
702
696
  { flush: "sync" }
703
697
  ), J(
@@ -706,53 +700,53 @@ const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label",
706
700
  d.value.kind === "loaded" && d.value.state.kind
707
701
  ],
708
702
  ([e, r], [o, m]) => {
709
- e !== o || m !== "failed" || r !== "idle" || B.value.background !== "original" || (S = void 0, pe());
703
+ e !== o || m !== "failed" || r !== "idle" || B.value.background !== "original" || (C = void 0, pe());
710
704
  },
711
705
  { flush: "post" }
712
- ), Ue(pe);
713
- function da() {
706
+ ), ze(pe);
707
+ function la() {
714
708
  const e = d.value;
715
- e.kind !== "loaded" || e.desired.background !== "original" || (S = Q.value, Le({ ...e, desired: { background: "original", crop: { ...e.desired.crop } } }));
709
+ e.kind !== "loaded" || e.desired.background !== "original" || (C = Q.value, Le({ ...e, desired: { background: "original", crop: { ...e.desired.crop } } }));
716
710
  }
717
711
  async function Le(e) {
718
712
  const r = e ?? d.value;
719
- if (!U || t.disabled || f.value || !X.value || r.kind !== "loaded" || !ee(r.desired.background)) return;
713
+ if (!U || t.disabled || k.value || !X.value || r.kind !== "loaded" || !ee(r.desired.background)) return;
720
714
  F();
721
- const o = x, m = t.scopeKey, V = Q.value;
715
+ const o = E, m = t.scopeKey, x = Q.value;
722
716
  b = new AbortController();
723
- const C = b.signal, H = () => {
717
+ const q = b.signal, H = () => {
724
718
  const O = d.value;
725
- return U && o === x && !t.disabled && !C.aborted && t.scopeKey === m && Q.value === V && X.value && O.kind === "loaded" && !!O.original && !!r.original && Fe(O.original, r.original) && Ve(O.desired, r.desired);
719
+ return U && o === E && !t.disabled && !q.aborted && t.scopeKey === m && Q.value === x && X.value && O.kind === "loaded" && !!O.original && !!r.original && We(O.original, r.original) && Ve(O.desired, r.desired);
726
720
  }, oe = d.value;
727
721
  if (!(!H() || oe.kind !== "loaded")) {
728
- E.value = "", W.value = "", f.value = !0, k.value = r.desired.background === "original" ? a("tools.brand_mark.trimLogo") : ea.value ? "logo-cloud-progress" : "logo-local-progress", K($(v.value, { ...oe, state: { kind: "running" } })), h ??= ja(l?.execution?.local?.cutout);
722
+ V.value = "", W.value = "", k.value = !0, f.value = r.desired.background === "original" ? a("tools.brand_mark.trimLogo") : Qe.value ? "logo-cloud-progress" : "logo-local-progress", D($(v.value, { ...oe, state: { kind: "running" } })), h ??= Ka(l?.execution?.local?.cutout);
729
723
  try {
730
- const O = await $a(
724
+ const O = await Ga(
731
725
  {
732
726
  document: r,
733
727
  ownerBatchId: m ?? "",
734
- signal: C,
728
+ signal: q,
735
729
  onMaster: async (N) => {
736
730
  const le = d.value;
737
- !H() || le.kind !== "loaded" || (K(
731
+ !H() || le.kind !== "loaded" || (D(
738
732
  $(v.value, {
739
733
  ...le,
740
734
  masters: [
741
- ...le.masters.filter((va) => va.background !== N.background),
735
+ ...le.masters.filter((pa) => pa.background !== N.background),
742
736
  N
743
737
  ]
744
738
  })
745
- ), await xe());
739
+ ), await Me());
746
740
  },
747
741
  onStage: (N) => {
748
- H() && (k.value = N === "cloud" ? "logo-cloud-progress" : N === "model" ? "logo-local-progress" : N === "derive" ? a("tools.brand_mark.trimLogo") : "正在保存去底 Logo…");
742
+ H() && (f.value = N === "cloud" ? "logo-cloud-progress" : N === "model" ? "logo-local-progress" : N === "derive" ? a("tools.brand_mark.trimLogo") : "正在保存去底 Logo…");
749
743
  },
750
744
  onProgress: (N) => {
751
745
  H() && (Y.value = N);
752
746
  }
753
747
  },
754
748
  {
755
- read: la,
749
+ read: sa,
756
750
  save: (N, le) => R(new File([N], le, { type: N.type })),
757
751
  preparer: h,
758
752
  submit: u.submitTask,
@@ -762,7 +756,7 @@ const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label",
762
756
  }
763
757
  ), te = d.value;
764
758
  if (!H() || te.kind !== "loaded") return;
765
- K(
759
+ D(
766
760
  $(v.value, {
767
761
  ...te,
768
762
  applied: O.applied,
@@ -775,36 +769,36 @@ const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label",
775
769
  );
776
770
  } catch (O) {
777
771
  const te = d.value;
778
- H() && te.kind === "loaded" && (E.value = O instanceof Error ? O.message : "Logo 准备失败", W.value = O instanceof Error && "reason" in O && typeof O.reason == "string" ? O.reason : "", K($(v.value, { ...te, state: { kind: "failed" } })));
772
+ H() && te.kind === "loaded" && (V.value = O instanceof Error ? O.message : "Logo 准备失败", W.value = O instanceof Error && "reason" in O && typeof O.reason == "string" ? O.reason : "", D($(v.value, { ...te, state: { kind: "failed" } })));
779
773
  } finally {
780
- o === x && (f.value = !1, k.value = "", h?.dispose(), h = void 0), A();
774
+ o === E && (k.value = !1, f.value = "", h?.dispose(), h = void 0), A();
781
775
  }
782
776
  }
783
777
  }
784
- async function ze(e) {
778
+ async function Ne(e) {
785
779
  if (t.disabled || !e) return;
786
780
  F();
787
- const r = x;
788
- S = void 0, E.value = "", f.value = !0, k.value = "正在准备 Logo…", b = new AbortController();
789
- const o = b.signal, m = d.value.desired, V = t.scopeKey;
790
- q = { generation: r, expected: { version: 2, kind: "empty", desired: m } }, K({
781
+ const r = E;
782
+ C = void 0, V.value = "", k.value = !0, f.value = "正在准备 Logo…", b = new AbortController();
783
+ const o = b.signal, m = d.value.desired, x = t.scopeKey;
784
+ S = { generation: r, expected: { version: 2, kind: "empty", desired: m } }, D({
791
785
  logo: void 0,
792
786
  originalLogo: void 0,
793
787
  logoPreparation: { version: 2, kind: "empty", desired: m },
794
788
  preparedLogoVariants: void 0,
795
789
  logoName: e.name,
796
- ownerBatchId: V
790
+ ownerBatchId: x
797
791
  });
798
792
  try {
799
793
  if (!["image/png", "image/jpeg", "image/webp"].includes(e.type) || !e.size || e.size > ge)
800
794
  throw new Error("请选择5MiB以内的PNG、JPEG或WebP Logo");
801
- const C = new Uint8Array(await e.arrayBuffer());
802
- Ta(C);
803
- const H = Ba(C);
795
+ const q = new Uint8Array(await e.arrayBuffer());
796
+ Oa(q);
797
+ const H = Va(q);
804
798
  if (H.width * H.height > _e) throw Error("Logo 超过400万像素");
805
- if (r !== x || t.disabled) return;
799
+ if (r !== E || t.disabled) return;
806
800
  const oe = await R(e);
807
- if (r !== x || t.disabled || (De(oe), t.scopeKey !== V)) return;
801
+ if (r !== E || t.disabled || (Te(oe), t.scopeKey !== x)) return;
808
802
  const O = {
809
803
  version: 2,
810
804
  kind: "loaded",
@@ -814,29 +808,29 @@ const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label",
814
808
  masters: [],
815
809
  state: { kind: "idle" }
816
810
  };
817
- q = { generation: r, expected: O }, K({
811
+ S = { generation: r, expected: O }, D({
818
812
  ...$(v.value, O),
819
813
  logoName: e.name,
820
- ownerBatchId: V
814
+ ownerBatchId: x
821
815
  });
822
- } catch (C) {
823
- r === x && !o.aborted && (E.value = C instanceof Error ? C.message : "Logo 准备失败", K({ logo: void 0 }));
816
+ } catch (q) {
817
+ r === E && !o.aborted && (V.value = q instanceof Error ? q.message : "Logo 准备失败", D({ logo: void 0 }));
824
818
  } finally {
825
- r === x && (f.value = !1, k.value = "", await xe(), r === x && (q = void 0, pe()));
819
+ r === E && (k.value = !1, f.value = "", await Me(), r === E && (S = void 0, pe()));
826
820
  }
827
821
  }
828
- function ua(e) {
822
+ function da(e) {
829
823
  const r = e.target;
830
- ze(r.files?.[0]), r.value = "";
824
+ Ne(r.files?.[0]), r.value = "";
831
825
  }
832
- function ca(e) {
833
- t.disabled || ze(e.dataTransfer?.files[0]);
826
+ function ua(e) {
827
+ t.disabled || Ne(e.dataTransfer?.files[0]);
834
828
  }
835
- function ga() {
829
+ function ca() {
836
830
  if (t.disabled) return;
837
- F(), E.value = "", W.value = "";
831
+ F(), V.value = "", W.value = "";
838
832
  const e = d.value;
839
- e.kind === "loaded" && e.original && K(
833
+ e.kind === "loaded" && e.original && D(
840
834
  $(v.value, {
841
835
  ...e,
842
836
  desired: fe(),
@@ -845,8 +839,8 @@ const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label",
845
839
  })
846
840
  );
847
841
  }
848
- function ma() {
849
- t.disabled || (F(), E.value = "", K({
842
+ function ga() {
843
+ t.disabled || (F(), V.value = "", D({
850
844
  logo: void 0,
851
845
  originalLogo: void 0,
852
846
  preparedLogoVariants: void 0,
@@ -855,12 +849,12 @@ const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label",
855
849
  removeBackground: !1
856
850
  }));
857
851
  }
858
- function Ke(e, r) {
852
+ function De(e, r) {
859
853
  if (t.disabled) return;
860
- const o = r.target.value, m = Number(o), V = Ie.value.find((C) => C.key === e);
861
- V && (M.value = { ...M.value, [e]: o }, o.trim() !== "" && Number.isInteger(m) && m >= V.min && m <= V.max && K({ [e]: e === "opacity" ? m / 100 : m }));
854
+ const o = r.target.value, m = Number(o), x = Ie.value.find((q) => q.key === e);
855
+ x && (M.value = { ...M.value, [e]: o }, o.trim() !== "" && Number.isInteger(m) && m >= x.min && m <= x.max && D({ [e]: e === "opacity" ? m / 100 : m }));
862
856
  }
863
- function ba(e) {
857
+ function ma(e) {
864
858
  [
865
859
  "ArrowLeft",
866
860
  "ArrowRight",
@@ -872,105 +866,105 @@ const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label",
872
866
  "PageDown"
873
867
  ].includes(e.key) && e.stopPropagation();
874
868
  }
875
- function pa() {
869
+ function ba() {
876
870
  if (t.disabled) return;
877
- const e = f.value || G !== void 0;
871
+ const e = k.value || G !== void 0;
878
872
  F(), me.value++, ae.value = !0, M.value = {};
879
873
  const r = d.value, o = e && r.kind === "loaded" ? $(v.value, {
880
874
  ...r,
881
875
  desired: r.applied.settings,
882
876
  state: { kind: "idle" }
883
877
  }) : v.value;
884
- E.value = "", W.value = "", g("update:modelValue", Xe(o));
878
+ V.value = "", W.value = "", g("update:modelValue", He(o));
885
879
  }
886
- return (e, r) => (w(), L("fieldset", {
880
+ return (e, r) => (I(), L("fieldset", {
887
881
  class: "brand-mark-panel",
888
882
  disabled: i.disabled,
889
883
  "aria-label": n(a)("tools.brand_mark.brandMarkPanel_bfd3cc8f"),
890
- onDragover: r[4] || (r[4] = Ge(() => {
884
+ onDragover: r[4] || (r[4] = Ue(() => {
891
885
  }, ["stop", "prevent"])),
892
- onDrop: Ge(ca, ["stop", "prevent"])
886
+ onDrop: Ue(ua, ["stop", "prevent"])
893
887
  }, [
894
888
  P("div", {
895
889
  class: "brand-mode",
896
890
  role: "radiogroup",
897
891
  "aria-label": n(a)("tools.brand_mark.brandMarkPanel_b2722cb0")
898
892
  }, [
899
- (w(!0), L(de, null, ve([
893
+ (I(!0), L(de, null, ve([
900
894
  ["single", n(a)("tools.brand_mark.singleMark")],
901
895
  ["tile", n(a)("common.toolPanel_e415d1fe")]
902
- ].filter((o) => !i.allowedModes || i.allowedModes.includes(o[0])), (o, m) => (w(), L("button", {
896
+ ].filter((o) => !i.allowedModes || i.allowedModes.includes(o[0])), (o, m) => (I(), L("button", {
903
897
  key: o[0],
904
898
  type: "button",
905
899
  role: "radio",
906
900
  "aria-label": o[1],
907
901
  "aria-checked": se.value === o[0],
908
902
  tabindex: se.value === o[0] ? 0 : -1,
909
- onClick: (V) => Ne(o[0]),
910
- onKeydown: (V) => sa(
911
- V,
903
+ onClick: (x) => Re(o[0]),
904
+ onKeydown: (x) => ia(
905
+ x,
912
906
  m,
913
- ["single", "tile"].filter((C) => !i.allowedModes || i.allowedModes.includes(C)),
914
- (C) => Ne(C)
907
+ ["single", "tile"].filter((q) => !i.allowedModes || i.allowedModes.includes(q)),
908
+ (q) => Re(q)
915
909
  )
916
- }, y(o[1]), 41, Ja))), 128))
917
- ], 8, Ha),
910
+ }, w(o[1]), 41, Fa))), 128))
911
+ ], 8, $a),
918
912
  P("input", {
919
913
  ref_key: "picker",
920
- ref: I,
914
+ ref: y,
921
915
  class: "logo-file-input",
922
916
  hidden: "",
923
917
  type: "file",
924
918
  accept: "image/png,image/jpeg,image/webp",
925
919
  "aria-label": n(a)("tools.brand_mark.brandMarkPanel_78f4cf57"),
926
- onChange: ua
927
- }, null, 40, Xa),
920
+ onChange: da
921
+ }, null, 40, Ha),
928
922
  P("button", {
929
923
  class: "logo-upload",
930
924
  type: "button",
931
925
  "aria-label": n(a)("tools.brand_mark.brandMarkPanel_b7603312"),
932
926
  disabled: i.disabled,
933
- onClick: r[0] || (r[0] = (o) => I.value?.click())
927
+ onClick: r[0] || (r[0] = (o) => y.value?.click())
934
928
  }, [
935
- n(p) ? (w(), L("img", {
929
+ n(p) ? (I(), L("img", {
936
930
  key: 0,
937
931
  src: n(p),
938
932
  alt: n(a)("tools.brand_mark.brandMarkPanel_baacf60a"),
939
933
  decoding: "async"
940
- }, null, 8, Qa)) : (w(), he(n(Ia), {
934
+ }, null, 8, Xa)) : (I(), he(n(_a), {
941
935
  key: 1,
942
936
  size: 24
943
937
  })),
944
- n(p) ? z("", !0) : (w(), L("strong", Za, y(i.modelValue.logoName || n(a)("tools.brand_mark.brandMarkPanel_7dcf64ca")), 1)),
945
- P("small", null, y(f.value ? k.value === "logo-cloud-progress" ? n(a)("tools.brand_mark.cloudWaiting") : k.value === "logo-local-progress" ? n(a)("tools.brand_mark.localProgress") : n(c)(k.value) : n(a)("tools.brand_mark.brandMarkPanel_204bfba6")), 1)
946
- ], 8, Ya),
947
- i.modelValue.originalLogo || f.value ? (w(), L("button", {
938
+ n(p) ? z("", !0) : (I(), L("strong", Ya, w(i.modelValue.logoName || n(a)("tools.brand_mark.brandMarkPanel_7dcf64ca")), 1)),
939
+ P("small", null, w(k.value ? f.value === "logo-cloud-progress" ? n(a)("tools.brand_mark.cloudWaiting") : f.value === "logo-local-progress" ? n(a)("tools.brand_mark.localProgress") : n(c)(f.value) : n(a)("tools.brand_mark.brandMarkPanel_204bfba6")), 1)
940
+ ], 8, Ja),
941
+ i.modelValue.originalLogo || k.value ? (I(), L("button", {
948
942
  key: 0,
949
943
  class: "logo-remove",
950
944
  type: "button",
951
945
  "aria-label": n(a)("tools.brand_mark.brandMarkPanel_731cdce5"),
952
- onClick: ma
946
+ onClick: ga
953
947
  }, [
954
- ce(n(Ea), { size: 14 }),
955
- re(y(n(a)("tools.brand_mark.brandMarkPanel_731cdce5")), 1)
956
- ], 8, eo)) : z("", !0),
957
- P("label", ao, [
958
- re(y(n(a)("tools.brand_mark.backgroundMode")) + " ", 1),
948
+ ce(n(Pa), { size: 14 }),
949
+ re(w(n(a)("tools.brand_mark.brandMarkPanel_731cdce5")), 1)
950
+ ], 8, Qa)) : z("", !0),
951
+ P("label", Za, [
952
+ re(w(n(a)("tools.brand_mark.backgroundMode")) + " ", 1),
959
953
  P("select", {
960
954
  value: B.value.background,
961
- disabled: f.value && (B.value.background !== "original" || n(q) !== void 0),
962
- onChange: ra
955
+ disabled: k.value && (B.value.background !== "original" || n(S) !== void 0),
956
+ onChange: ta
963
957
  }, [
964
- P("option", to, y(n(a)("tools.brand_mark.originalMode")), 1),
965
- P("option", ro, y(n(a)("tools.brand_mark.solidRemoval")), 1),
966
- (w(!0), L(de, null, ve(n($e), (o) => (w(), L("option", {
958
+ P("option", ao, w(n(a)("tools.brand_mark.originalMode")), 1),
959
+ P("option", oo, w(n(a)("tools.brand_mark.solidRemoval")), 1),
960
+ (I(!0), L(de, null, ve(n(Ge), (o) => (I(), L("option", {
967
961
  key: o.model,
968
962
  value: o.model,
969
963
  disabled: !ee(o.model)
970
- }, y(n(c)(o.label)) + y(ee(o.model) ? "" : n(a)("common.toolPanel_14a718cd")), 9, no))), 128))
971
- ], 40, oo)
964
+ }, w(n(c)(o.label)) + w(ee(o.model) ? "" : n(a)("common.toolPanel_14a718cd")), 9, to))), 128))
965
+ ], 40, eo)
972
966
  ]),
973
- (w(), he(Ra, {
967
+ (I(), he(Ca, {
974
968
  key: me.value,
975
969
  enabled: B.value.crop.kind === "alpha",
976
970
  padding: B.value.crop.kind === "alpha" ? B.value.crop.padding : 0,
@@ -978,87 +972,86 @@ const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label",
978
972
  hint: n(a)("tools.brand_mark.trimHint"),
979
973
  source: Pe.value?.source,
980
974
  "estimate-applied": Pe.value?.approximate,
981
- disabled: i.disabled || f.value && (B.value.background !== "original" || n(q) !== void 0),
982
- onEnabled: aa,
983
- onPadding: oa,
975
+ disabled: i.disabled || k.value && (B.value.background !== "original" || n(S) !== void 0),
976
+ onEnabled: ea,
977
+ onPadding: aa,
984
978
  onValidity: r[1] || (r[1] = (o) => ae.value = o)
985
979
  }, null, 8, ["enabled", "padding", "hint", "source", "estimate-applied", "disabled"])),
986
- B.value.crop.kind === "alpha" && Pe.value?.approximate ? (w(), L("p", io, y(n(a)("tools.brand_mark.approximateTrim")), 1)) : z("", !0),
987
- n(ke)(v.value).kind === "pending" ? (w(), L("p", so, y(B.value.background !== "original" ? n(a)("tools.brand_mark.settingsPending") : d.value.kind === "loaded" && !d.value.original ? n(a)("tools.brand_mark.uploadOriginal") : d.value.kind === "loaded" && d.value.state.kind === "failed" ? n(a)("tools.brand_mark.preparationFailed") : n(a)("tools.brand_mark.previewPending")), 1)) : z("", !0),
988
- Se.value > 0 ? (w(), L("p", lo, y(n(a)("tools.brand_mark.logoEstimate", { p0: Se.value })), 1)) : z("", !0),
989
- f.value ? (w(), L("div", uo, [
990
- P("span", co, [
980
+ B.value.crop.kind === "alpha" && Pe.value?.approximate ? (I(), L("p", ro, w(n(a)("tools.brand_mark.approximateTrim")), 1)) : z("", !0),
981
+ n(ke)(v.value).kind === "pending" ? (I(), L("p", no, w(B.value.background !== "original" ? n(a)("tools.brand_mark.settingsPending") : d.value.kind === "loaded" && !d.value.original ? n(a)("tools.brand_mark.uploadOriginal") : d.value.kind === "loaded" && d.value.state.kind === "failed" ? n(a)("tools.brand_mark.preparationFailed") : n(a)("tools.brand_mark.previewPending")), 1)) : z("", !0),
982
+ k.value ? (I(), L("div", io, [
983
+ P("span", so, [
991
984
  r[5] || (r[5] = P("span", {
992
985
  class: "logo-activity",
993
986
  "aria-hidden": "true"
994
987
  }, null, -1)),
995
- re(" " + y(k.value === "logo-cloud-progress" ? n(a)("tools.brand_mark.cloudWaiting") : k.value === "logo-local-progress" ? n(a)("tools.brand_mark.localProgress") : n(c)(k.value)), 1)
988
+ re(" " + w(f.value === "logo-cloud-progress" ? n(a)("tools.brand_mark.cloudWaiting") : f.value === "logo-local-progress" ? n(a)("tools.brand_mark.localProgress") : n(c)(f.value)), 1)
996
989
  ]),
997
990
  P("progress", {
998
991
  value: Y.value,
999
992
  max: "1"
1000
- }, null, 8, go),
993
+ }, null, 8, lo),
1001
994
  P("button", {
1002
995
  type: "button",
1003
996
  class: "logo-cancel",
1004
- "aria-label": k.value === "logo-cloud-progress" ? n(a)("tools.brand_mark.stopWaiting") : n(a)("tools.brand_mark.cancelPreparation"),
1005
- title: k.value === "logo-cloud-progress" ? n(a)("tools.brand_mark.stopWaiting") : n(a)("tools.brand_mark.cancelPreparation"),
1006
- onClick: ta
997
+ "aria-label": f.value === "logo-cloud-progress" ? n(a)("tools.brand_mark.stopWaiting") : n(a)("tools.brand_mark.cancelPreparation"),
998
+ title: f.value === "logo-cloud-progress" ? n(a)("tools.brand_mark.stopWaiting") : n(a)("tools.brand_mark.cancelPreparation"),
999
+ onClick: oa
1007
1000
  }, [
1008
- ce(n(La), {
1001
+ ce(n(Ia), {
1009
1002
  size: 16,
1010
1003
  "aria-hidden": "true"
1011
1004
  })
1012
- ], 8, mo)
1013
- ])) : B.value.background === "original" && d.value.kind === "loaded" && d.value.state.kind === "failed" && d.value.original ? (w(), L("div", bo, [
1005
+ ], 8, uo)
1006
+ ])) : B.value.background === "original" && d.value.kind === "loaded" && d.value.state.kind === "failed" && d.value.original ? (I(), L("div", co, [
1014
1007
  P("button", {
1015
1008
  type: "button",
1016
1009
  disabled: !X.value,
1017
- onClick: da
1018
- }, y(n(a)("tools.brand_mark.retryPreview")), 9, po)
1019
- ])) : B.value.background !== "original" && n(ke)(v.value).kind !== "ready" ? (w(), L("div", vo, [
1010
+ onClick: la
1011
+ }, w(n(a)("tools.brand_mark.retryPreview")), 9, go)
1012
+ ])) : B.value.background !== "original" && n(ke)(v.value).kind !== "ready" ? (I(), L("div", mo, [
1020
1013
  P("button", {
1021
1014
  type: "button",
1022
- disabled: !X.value || !ee(B.value.background) || d.value.kind !== "loaded" || !d.value.original || !!E.value && !["local-transient", "cloud-unknown"].includes(W.value),
1015
+ disabled: !X.value || !ee(B.value.background) || d.value.kind !== "loaded" || !d.value.original || !!V.value && !["local-transient", "cloud-unknown"].includes(W.value),
1023
1016
  onClick: r[2] || (r[2] = (o) => Le())
1024
- }, y(W.value === "local-transient" ? n(a)("tools.brand_mark.retryPreparation") : n(a)("tools.brand_mark.processLogo")), 9, ko)
1017
+ }, w(W.value === "local-transient" ? n(a)("tools.brand_mark.retryPreparation") : n(a)("tools.brand_mark.processLogo")), 9, bo)
1025
1018
  ])) : z("", !0),
1026
- E.value ? (w(), L("div", fo, [
1027
- P("p", null, y(n(c)(E.value)), 1),
1019
+ V.value ? (I(), L("div", po, [
1020
+ P("p", null, w(n(c)(V.value)), 1),
1028
1021
  P("button", {
1029
1022
  type: "button",
1030
- onClick: ga
1031
- }, y(n(a)("tools.brand_mark.brandMarkPanel_a3728699")), 1),
1032
- ee("isnet_fp16") && ["inconsistent_corners", "noisy_background", "no_foreground"].includes(W.value) ? (w(), L("button", {
1023
+ onClick: ca
1024
+ }, w(n(a)("tools.brand_mark.brandMarkPanel_a3728699")), 1),
1025
+ ee("isnet_fp16") && ["inconsistent_corners", "noisy_background", "no_foreground"].includes(W.value) ? (I(), L("button", {
1033
1026
  key: 0,
1034
1027
  type: "button",
1035
1028
  onClick: r[3] || (r[3] = (o) => be({ ...B.value, background: "isnet_fp16" }))
1036
- }, y(n(a)("tools.brand_mark.switchFast")), 1)) : z("", !0)
1029
+ }, w(n(a)("tools.brand_mark.switchFast")), 1)) : z("", !0)
1037
1030
  ])) : z("", !0),
1038
- se.value === "single" ? (w(), L(de, { key: 8 }, [
1039
- P("span", ho, y(n(a)("tools.brand_mark.brandMarkPanel_1fb4d574")), 1),
1031
+ se.value === "single" ? (I(), L(de, { key: 7 }, [
1032
+ P("span", vo, w(n(a)("tools.brand_mark.brandMarkPanel_1fb4d574")), 1),
1040
1033
  P("div", {
1041
1034
  class: "brand-anchors",
1042
1035
  role: "group",
1043
1036
  "aria-label": n(a)("tools.brand_mark.brandMarkPanel_1c3852e5")
1044
1037
  }, [
1045
- (w(), L(de, null, ve(T, ([o, m, V]) => P("button", {
1038
+ (I(), L(de, null, ve(T, ([o, m, x]) => P("button", {
1046
1039
  key: o,
1047
1040
  type: "button",
1048
1041
  "aria-label": n(a)("tools.brand_mark.brandMarkPanel_9c441f43", { p0: n(c)(m) }),
1049
1042
  "aria-pressed": i.modelValue.anchor === o,
1050
- onClick: (C) => K({ anchor: o })
1051
- }, y(V), 9, wo)), 64))
1052
- ], 8, yo)
1043
+ onClick: (q) => D({ anchor: o })
1044
+ }, w(x), 9, fo)), 64))
1045
+ ], 8, ko)
1053
1046
  ], 64)) : z("", !0),
1054
- (w(!0), L(de, null, ve(Ie.value, (o) => (w(), L("div", {
1047
+ (I(!0), L(de, null, ve(Ie.value, (o) => (I(), L("div", {
1055
1048
  key: o.key,
1056
1049
  class: "brand-field"
1057
1050
  }, [
1058
1051
  P("label", null, [
1059
1052
  P("span", null, [
1060
- re(y(n(c)(o.label)), 1),
1061
- ["sizePercent", "marginPercent", "angle"].includes(o.key) ? (w(), he(xa, {
1053
+ re(w(n(c)(o.label)), 1),
1054
+ ["sizePercent", "marginPercent", "angle"].includes(o.key) ? (I(), he(Ea, {
1062
1055
  key: 0,
1063
1056
  text: o.key === "angle" ? n(a)("tools.brand_mark.brandMarkPanel_0d6bb2f4") : n(a)(
1064
1057
  o.key === "marginPercent" ? "common.audit.marginHelp" : "common.audit.logoSizeHelp"
@@ -1076,9 +1069,9 @@ const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label",
1076
1069
  max: o.max,
1077
1070
  step: "1",
1078
1071
  value: M.value[o.key] ?? Ee(o.key),
1079
- onInput: (m) => Ke(o.key, m)
1080
- }, null, 40, _o),
1081
- re(y(o.unit), 1)
1072
+ onInput: (m) => De(o.key, m)
1073
+ }, null, 40, ho),
1074
+ re(w(o.unit), 1)
1082
1075
  ])
1083
1076
  ]),
1084
1077
  P("input", {
@@ -1090,84 +1083,77 @@ const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label",
1090
1083
  max: o.max,
1091
1084
  step: "1",
1092
1085
  value: Ee(o.key),
1093
- onInput: (m) => Ke(o.key, m),
1094
- onKeydown: ba
1095
- }, null, 40, Po),
1096
- o.key === "density" ? (w(), L("div", Io, [
1097
- P("span", null, y(n(a)("tools.brand_mark.brandMarkPanel_7812011c")), 1),
1098
- P("span", null, y(n(a)("tools.brand_mark.brandMarkPanel_6bea77ac")), 1),
1099
- P("span", null, y(n(a)("tools.brand_mark.brandMarkPanel_0e3d8855")), 1)
1086
+ onInput: (m) => De(o.key, m),
1087
+ onKeydown: ma
1088
+ }, null, 40, yo),
1089
+ o.key === "density" ? (I(), L("div", wo, [
1090
+ P("span", null, w(n(a)("tools.brand_mark.brandMarkPanel_7812011c")), 1),
1091
+ P("span", null, w(n(a)("tools.brand_mark.brandMarkPanel_6bea77ac")), 1),
1092
+ P("span", null, w(n(a)("tools.brand_mark.brandMarkPanel_0e3d8855")), 1)
1100
1093
  ])) : z("", !0)
1101
1094
  ]))), 128)),
1102
- Te.value ? z("", !0) : (w(), L("p", Eo, y(n(a)("tools.brand_mark.brandMarkPanel_b7a07d1e")), 1)),
1103
- i.hideReset ? z("", !0) : (w(), L("button", {
1104
- key: 10,
1095
+ Oe.value ? z("", !0) : (I(), L("p", _o, w(n(a)("tools.brand_mark.brandMarkPanel_b7a07d1e")), 1)),
1096
+ i.hideReset ? z("", !0) : (I(), L("button", {
1097
+ key: 9,
1105
1098
  type: "button",
1106
1099
  class: "brand-reset",
1107
1100
  "aria-label": n(a)("tools.brand_mark.brandMarkPanel_3086a0b9"),
1108
- onClick: pa
1101
+ onClick: ba
1109
1102
  }, [
1110
- ce(n(Ma), { size: 14 }),
1111
- re(y(n(a)("tools.brand_mark.brandMarkPanel_7fe8ee7c")), 1)
1112
- ], 8, Lo))
1113
- ], 40, Fa));
1103
+ ce(n(La), { size: 14 }),
1104
+ re(w(n(a)("tools.brand_mark.brandMarkPanel_7fe8ee7c")), 1)
1105
+ ], 8, Po))
1106
+ ], 40, Wa));
1114
1107
  }
1115
- }), Mo = /* @__PURE__ */ Ca(xo, [["__scopeId", "data-v-ade0867a"]]), Vo = { class: "hint" }, Ao = {
1108
+ }), Eo = /* @__PURE__ */ Aa(Io, [["__scopeId", "data-v-e5420143"]]), Lo = { class: "hint" }, Mo = {
1116
1109
  key: 0,
1117
1110
  class: "hint"
1118
- }, Bo = {
1111
+ }, xo = {
1119
1112
  key: 1,
1120
1113
  class: "hint"
1121
- }, No = /* @__PURE__ */ He({
1114
+ }, Oo = /* @__PURE__ */ $e({
1122
1115
  __name: "BrandMarkToolPanel",
1123
1116
  props: {
1124
1117
  context: {}
1125
1118
  },
1126
1119
  setup(i) {
1127
- const { ui: s } = Je(), a = i, c = Na(() => a.context), t = j(!1), g = j(0), u = D(() => c.value.brandMark.opacity === 0), l = D(
1128
- () => a.context.view.waitingCount ? void 0 : s("common.toolPanel_3e0a0715", {
1129
- p0: a.context.view.appliedCount ? s("common.toolPanel_9f8d35b3") : s("common.toolPanel_7a8a11ea"),
1130
- p1: c.value.brandMark.mode === "tile" ? s("common.toolPanel_e415d1fe") : s("common.toolPanel_aa9f217c"),
1131
- p2: a.context.view.count
1132
- })
1133
- );
1134
- function p() {
1135
- g.value++, a.context.resetDraft({ brandMark: Xe(c.value.brandMark) });
1120
+ const { ui: s } = Fe(), a = i, c = Ra(() => a.context), t = j(!1), g = j(0), u = K(() => c.value.brandMark.opacity === 0);
1121
+ function l() {
1122
+ g.value++, a.context.resetDraft({ brandMark: He(c.value.brandMark) });
1136
1123
  }
1137
- const R = Da(() => a.context, "brandMark");
1138
- return (I, f) => (w(), he(qa, {
1124
+ const p = Ta(() => a.context, "brandMark");
1125
+ return (R, y) => (I(), he(Ba, {
1139
1126
  context: i.context,
1140
1127
  layout: "contained",
1141
- changed: n(Sa)(n(c).brandMark),
1142
- onReset: p
1128
+ changed: n(qa)(n(c).brandMark),
1129
+ onReset: l
1143
1130
  }, {
1144
- actions: Me(() => [
1145
- ce(za, {
1131
+ actions: xe(() => [
1132
+ ce(Na, {
1146
1133
  context: i.context,
1147
- available: n(Ka)(i.context),
1148
- ready: t.value && !!n(c).brandMark.logo && !u.value,
1149
- label: l.value
1134
+ available: n(Da)(i.context),
1135
+ ready: t.value && !!n(c).brandMark.logo && !u.value
1150
1136
  }, {
1151
- default: Me(() => [
1152
- P("p", Vo, y(n(s)("common.audit.saveVersion")), 1),
1153
- i.context.view.appliedCount ? (w(), L("p", Ao, y(n(s)("common.toolPanel_1c5c7944", { p0: i.context.view.appliedCount })), 1)) : z("", !0),
1154
- u.value ? (w(), L("p", Bo, y(n(s)("common.toolPanel_6cc00dda")), 1)) : z("", !0)
1137
+ default: xe(() => [
1138
+ P("p", Lo, w(n(s)("common.audit.saveVersion")), 1),
1139
+ i.context.view.appliedCount ? (I(), L("p", Mo, w(n(s)("common.toolPanel_1c5c7944", { p0: i.context.view.appliedCount })), 1)) : z("", !0),
1140
+ u.value ? (I(), L("p", xo, w(n(s)("common.toolPanel_6cc00dda")), 1)) : z("", !0)
1155
1141
  ]),
1156
1142
  _: 1
1157
- }, 8, ["context", "available", "ready", "label"])
1143
+ }, 8, ["context", "available", "ready"])
1158
1144
  ]),
1159
- default: Me(() => [
1160
- ce(Mo, {
1145
+ default: xe(() => [
1146
+ ce(Eo, {
1161
1147
  "model-value": n(c).brandMark,
1162
1148
  "hide-reset": !0,
1163
- "allowed-modes": ["single", "tile"].filter((E) => i.context.modeAllowed?.(E) !== !1),
1149
+ "allowed-modes": ["single", "tile"].filter((k) => i.context.modeAllowed?.(k) !== !1),
1164
1150
  disabled: i.context.readonly,
1165
1151
  "scope-key": i.context.view.batchId,
1166
1152
  "reset-epoch": g.value,
1167
1153
  "available-cutout-modes": i.context.view.availableCutoutModes,
1168
1154
  "upload-reference": i.context.uploadReference,
1169
- "onUpdate:modelValue": n(R),
1170
- onValidity: f[0] || (f[0] = (E) => t.value = E)
1155
+ "onUpdate:modelValue": n(p),
1156
+ onValidity: y[0] || (y[0] = (k) => t.value = k)
1171
1157
  }, null, 8, ["model-value", "allowed-modes", "disabled", "scope-key", "reset-epoch", "available-cutout-modes", "upload-reference", "onUpdate:modelValue"])
1172
1158
  ]),
1173
1159
  _: 1
@@ -1175,5 +1161,5 @@ const Fa = ["disabled", "aria-label"], Ha = ["aria-label"], Ja = ["aria-label",
1175
1161
  }
1176
1162
  });
1177
1163
  export {
1178
- No as default
1164
+ Oo as default
1179
1165
  };