@feedmepos/mf-menu 1.0.1-dev.2 → 1.0.1-dev.3

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 (58) hide show
  1. package/dist/{App-CdIN4s5n.js → App-DEoljb3M.js} +546 -533
  2. package/dist/{BindingTable.vue_vue_type_script_setup_true_lang-CoHlJwpz.js → BindingTable.vue_vue_type_script_setup_true_lang-DACfW6SY.js} +1 -1
  3. package/dist/{Catalog-DjAubC9s.js → Catalog-B6mXH-Ez.js} +4 -4
  4. package/dist/{CatalogBinding-5JNRTbyZ.js → CatalogBinding-CZbbxQCa.js} +3 -3
  5. package/dist/{CatalogEditTabs.vue_vue_type_script_setup_true_lang-BorOjk1k.js → CatalogEditTabs.vue_vue_type_script_setup_true_lang-CFjBkgkl.js} +3 -3
  6. package/dist/{CatalogEditor.vue_vue_type_script_setup_true_lang-CkF7O_V-.js → CatalogEditor.vue_vue_type_script_setup_true_lang-owNQUf8y.js} +6 -6
  7. package/dist/{CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-3fL43MuR.js → CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-DJLjbLGK.js} +3 -3
  8. package/dist/{Category-COug7fz8.js → Category-B37n9Row.js} +2 -2
  9. package/dist/{Category-BbiN4hd7.js → Category-DHGrowud.js} +5 -5
  10. package/dist/{CategoryList.vue_vue_type_script_setup_true_lang-B_9aPMIN.js → CategoryList.vue_vue_type_script_setup_true_lang-_Ux8uXwn.js} +92 -91
  11. package/dist/{CookingGuide-Dg7kuF6l.js → CookingGuide-4i1KsBxo.js} +262 -256
  12. package/dist/{Group-BRpmTqyT.js → Group-DVB_G6lM.js} +5 -5
  13. package/dist/{Group-C-hwlkgJ.js → Group-N5_9GK2v.js} +2 -2
  14. package/dist/{GroupList.vue_vue_type_script_setup_true_lang-DowoJ3WM.js → GroupList.vue_vue_type_script_setup_true_lang-BDWyiP8J.js} +5 -5
  15. package/dist/{Ingredient-BQYnARdC.js → Ingredient-C-puVgJK.js} +3 -3
  16. package/dist/{LinkProductSideSheet.vue_vue_type_script_setup_true_lang-CgTDkHle.js → LinkProductSideSheet.vue_vue_type_script_setup_true_lang-ChDd6vJd.js} +1 -1
  17. package/dist/{MenuSetting-DsdM2_OW.js → MenuSetting-QhU37DTL.js} +3 -3
  18. package/dist/{OrderPacing-5x2YH-_l.js → OrderPacing-COY_HJ8I.js} +96 -93
  19. package/dist/{OrderPacingFields.vue_vue_type_script_setup_true_lang-DVGJjpiM.js → OrderPacingFields.vue_vue_type_script_setup_true_lang-BAbojJnz.js} +1 -1
  20. package/dist/{Preview-AdgGTYlQ.js → Preview-DrbsRznu.js} +1 -1
  21. package/dist/{PriceTierNotice.vue_vue_type_script_setup_true_lang-vmxVZ2ya.js → PriceTierNotice.vue_vue_type_script_setup_true_lang-BTJwvrlT.js} +1 -1
  22. package/dist/{PrintRoute-COkCv4gf.js → PrintRoute-DVJAvYq-.js} +158 -152
  23. package/dist/{Product-BJFb_J4h.js → Product-ClT1oFVA.js} +4 -4
  24. package/dist/{ProductEditorHost.vue_vue_type_script_setup_true_lang-Tpp8MBYS.js → ProductEditorHost.vue_vue_type_script_setup_true_lang-B4qpB-yA.js} +2 -2
  25. package/dist/{ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-C25Pwqme.js → ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-BWZwFal7.js} +3 -3
  26. package/dist/{ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-BMAtAK9D.js → ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-yZSYrcYe.js} +1 -1
  27. package/dist/{ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-Dl4Zr5tx.js → ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-3SaYTgCI.js} +1181 -1174
  28. package/dist/ProductInternalTools-DRcfn5DE.js +2147 -0
  29. package/dist/{ProductInventoryDialog-C3ruRWU5.js → ProductInventoryDialog-i48yqlp_.js} +1 -1
  30. package/dist/{ProductInventoryDialog.vue_vue_type_script_setup_true_lang-MpdIixqI.js → ProductInventoryDialog.vue_vue_type_script_setup_true_lang-C7z4BHKp.js} +1 -1
  31. package/dist/{ProductList.vue_vue_type_script_setup_true_lang-9_ohgfqE.js → ProductList.vue_vue_type_script_setup_true_lang-DkIwQeby.js} +1990 -1967
  32. package/dist/{ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-Ctbz-8cd.js → ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-Dr0r1hYM.js} +1 -1
  33. package/dist/{Products-DMrjQFfu.js → Products-B4yaF9Y5.js} +3 -3
  34. package/dist/{Publish-f6g0dIao.js → Publish-D8pKpnju.js} +3 -3
  35. package/dist/{Recipe-p-wxadSN.js → Recipe-Cz4s5W4k.js} +3 -3
  36. package/dist/{Scheduler-CtebRafn.js → Scheduler-xE_rjFjJ.js} +3 -3
  37. package/dist/{ServingSequence-CEd4ywOQ.js → ServingSequence-BjD1Xn6Q.js} +103 -97
  38. package/dist/{Setting-bPKadRu-.js → Setting-BrD0NB_a.js} +6 -6
  39. package/dist/{Subcategory-DBCnIP0b.js → Subcategory-wbHw1iCU.js} +141 -129
  40. package/dist/{Takeaway-VBkdW1DM.js → Takeaway-CIqSThUQ.js} +5 -5
  41. package/dist/{Takeaway-GNRHR5kN.js → Takeaway-DM7weBPk.js} +2 -2
  42. package/dist/{TakeawayList.vue_vue_type_script_setup_true_lang-DvX3k0Jg.js → TakeawayList.vue_vue_type_script_setup_true_lang-HZP5jmAy.js} +117 -111
  43. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-D1qaEVUu.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CLeJxNfG.js} +6 -6
  44. package/dist/{Unit-DbGKIprZ.js → Unit-RHuHWCCg.js} +2 -2
  45. package/dist/{Variant-_edSAKif.js → Variant-MA-mdYxx.js} +114 -108
  46. package/dist/{_id_-BNVtBV3q.js → _id_-CO1c1eIn.js} +3 -3
  47. package/dist/{app-BlTv5xag.js → app-DnIyFwTs.js} +420 -406
  48. package/dist/app.js +1 -1
  49. package/dist/apps/mf-menu/src/router/shared.d.ts +33 -0
  50. package/dist/apps/mf-menu/src/sdk/import-export.d.ts +8 -2
  51. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  52. package/dist/assets/{menu-compute-BzchkTYh.js → menu-compute-BYzYhsd6.js} +2 -2
  53. package/dist/assets/{validate-menu-CTV_cJNG.js → validate-menu-oaYEuMiz.js} +2 -2
  54. package/dist/mf-menu.css +1 -1
  55. package/dist/{provide-dbE6Qt1z.js → provide-UZbVvMqZ.js} +56729 -55678
  56. package/dist/{useActionFeedback-CdY_C_HX.js → useActionFeedback-CfPMryOm.js} +1 -1
  57. package/package.json +1 -1
  58. package/dist/ProductInternalTools-thlSvqbA.js +0 -2906
@@ -1,2906 +0,0 @@
1
- import { defineComponent as ce, ref as ee, computed as D, openBlock as F, createBlock as L, unref as c, withCtx as O, createElementVNode as y, toDisplayString as I, createElementBlock as T, Fragment as Y, renderList as ie, createVNode as M, createCommentVNode as R, normalizeClass as Fe, normalizeStyle as yt, createTextVNode as He, h as x, withModifiers as Je, shallowRef as qt, onBeforeUnmount as Gt, watch as Ht } from "vue";
2
- import { useI18n as ge } from "@feedmepos/mf-common";
3
- import { useSnackbar as bt, components as $, SnackbarPosition as Ne } from "@feedmepos/ui-library";
4
- import { _ as Wt } from "./PageLayout.vue_vue_type_script_setup_true_lang-B3szUH39.js";
5
- import { B as wt, b as Ae, a as lt, u as Ze } from "./provide-dbE6Qt1z.js";
6
- import { r as Xt, c as Jt, _ as kt, a as Yt } from "./ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-BMAtAK9D.js";
7
- import { _ as xt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
- var ft = {}, Qt = (function(a, e, o, n, t) {
9
- var s = new Worker(ft[e] || (ft[e] = URL.createObjectURL(new Blob([
10
- a + ';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'
11
- ], { type: "text/javascript" }))));
12
- return s.onmessage = function(i) {
13
- var f = i.data, m = f.$e$;
14
- if (m) {
15
- var g = new Error(m[0]);
16
- g.code = m[1], g.stack = m[2], t(g, null);
17
- } else
18
- t(null, f);
19
- }, s.postMessage(o, n), s;
20
- }), P = Uint8Array, Q = Uint16Array, Oe = Int32Array, Ie = new P([
21
- 0,
22
- 0,
23
- 0,
24
- 0,
25
- 0,
26
- 0,
27
- 0,
28
- 0,
29
- 1,
30
- 1,
31
- 1,
32
- 1,
33
- 2,
34
- 2,
35
- 2,
36
- 2,
37
- 3,
38
- 3,
39
- 3,
40
- 3,
41
- 4,
42
- 4,
43
- 4,
44
- 4,
45
- 5,
46
- 5,
47
- 5,
48
- 5,
49
- 0,
50
- /* unused */
51
- 0,
52
- 0,
53
- /* impossible */
54
- 0
55
- ]), Se = new P([
56
- 0,
57
- 0,
58
- 0,
59
- 0,
60
- 1,
61
- 1,
62
- 2,
63
- 2,
64
- 3,
65
- 3,
66
- 4,
67
- 4,
68
- 5,
69
- 5,
70
- 6,
71
- 6,
72
- 7,
73
- 7,
74
- 8,
75
- 8,
76
- 9,
77
- 9,
78
- 10,
79
- 10,
80
- 11,
81
- 11,
82
- 12,
83
- 12,
84
- 13,
85
- 13,
86
- /* unused */
87
- 0,
88
- 0
89
- ]), Te = new P([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), $t = function(a, e) {
90
- for (var o = new Q(31), n = 0; n < 31; ++n)
91
- o[n] = e += 1 << a[n - 1];
92
- for (var t = new Oe(o[30]), n = 1; n < 30; ++n)
93
- for (var s = o[n]; s < o[n + 1]; ++s)
94
- t[s] = s - o[n] << 5 | n;
95
- return { b: o, r: t };
96
- }, Ft = $t(Ie, 2), st = Ft.b, De = Ft.r;
97
- st[28] = 258, De[258] = 28;
98
- var Ct = $t(Se, 0), It = Ct.b, et = Ct.r, Ue = new Q(32768);
99
- for (var V = 0; V < 32768; ++V) {
100
- var ve = (V & 43690) >> 1 | (V & 21845) << 1;
101
- ve = (ve & 52428) >> 2 | (ve & 13107) << 2, ve = (ve & 61680) >> 4 | (ve & 3855) << 4, Ue[V] = ((ve & 65280) >> 8 | (ve & 255) << 8) >> 1;
102
- }
103
- var le = (function(a, e, o) {
104
- for (var n = a.length, t = 0, s = new Q(e); t < n; ++t)
105
- a[t] && ++s[a[t] - 1];
106
- var i = new Q(e);
107
- for (t = 1; t < e; ++t)
108
- i[t] = i[t - 1] + s[t - 1] << 1;
109
- var f;
110
- if (o) {
111
- f = new Q(1 << e);
112
- var m = 15 - e;
113
- for (t = 0; t < n; ++t)
114
- if (a[t])
115
- for (var g = t << 4 | a[t], u = e - a[t], p = i[a[t] - 1]++ << u, _ = p | (1 << u) - 1; p <= _; ++p)
116
- f[Ue[p] >> m] = g;
117
- } else
118
- for (f = new Q(n), t = 0; t < n; ++t)
119
- a[t] && (f[t] = Ue[i[a[t] - 1]++] >> 15 - a[t]);
120
- return f;
121
- }), fe = new P(288);
122
- for (var V = 0; V < 144; ++V)
123
- fe[V] = 8;
124
- for (var V = 144; V < 256; ++V)
125
- fe[V] = 9;
126
- for (var V = 256; V < 280; ++V)
127
- fe[V] = 7;
128
- for (var V = 280; V < 288; ++V)
129
- fe[V] = 8;
130
- var Ce = new P(32);
131
- for (var V = 0; V < 32; ++V)
132
- Ce[V] = 5;
133
- var St = /* @__PURE__ */ le(fe, 9, 0), Bt = /* @__PURE__ */ le(fe, 9, 1), zt = /* @__PURE__ */ le(Ce, 5, 0), Mt = /* @__PURE__ */ le(Ce, 5, 1), Ve = function(a) {
134
- for (var e = a[0], o = 1; o < a.length; ++o)
135
- a[o] > e && (e = a[o]);
136
- return e;
137
- }, ne = function(a, e, o) {
138
- var n = e / 8 | 0;
139
- return (a[n] | a[n + 1] << 8) >> (e & 7) & o;
140
- }, Pe = function(a, e) {
141
- var o = e / 8 | 0;
142
- return (a[o] | a[o + 1] << 8 | a[o + 2] << 16) >> (e & 7);
143
- }, je = function(a) {
144
- return (a + 7) / 8 | 0;
145
- }, ye = function(a, e, o) {
146
- return (e == null || e < 0) && (e = 0), (o == null || o > a.length) && (o = a.length), new P(a.subarray(e, o));
147
- }, Tt = [
148
- "unexpected EOF",
149
- "invalid block type",
150
- "invalid length/literal",
151
- "invalid distance",
152
- "stream finished",
153
- "no stream handler",
154
- ,
155
- // determined by compression function
156
- "no callback",
157
- "invalid UTF-8 data",
158
- "extra field too long",
159
- "date not in range 1980-2099",
160
- "filename too long",
161
- "stream finishing",
162
- "invalid zip data"
163
- // determined by unknown compression method
164
- ], q = function(a, e, o) {
165
- var n = new Error(e || Tt[a]);
166
- if (n.code = a, Error.captureStackTrace && Error.captureStackTrace(n, q), !o)
167
- throw n;
168
- return n;
169
- }, Ut = function(a, e, o, n) {
170
- var t = a.length, s = n ? n.length : 0;
171
- if (!t || e.f && !e.l)
172
- return o || new P(0);
173
- var i = !o, f = i || e.i != 2, m = e.i;
174
- i && (o = new P(t * 3));
175
- var g = function(ze) {
176
- var Me = o.length;
177
- if (ze > Me) {
178
- var ke = new P(Math.max(Me * 2, ze));
179
- ke.set(o), o = ke;
180
- }
181
- }, u = e.f || 0, p = e.p || 0, _ = e.b || 0, S = e.l, U = e.d, k = e.m, C = e.n, h = t * 8;
182
- do {
183
- if (!S) {
184
- u = ne(a, p, 1);
185
- var d = ne(a, p + 1, 3);
186
- if (p += 3, d)
187
- if (d == 1)
188
- S = Bt, U = Mt, k = 9, C = 5;
189
- else if (d == 2) {
190
- var b = ne(a, p, 31) + 257, z = ne(a, p + 10, 15) + 4, w = b + ne(a, p + 5, 31) + 1;
191
- p += 14;
192
- for (var B = new P(w), j = new P(19), A = 0; A < z; ++A)
193
- j[Te[A]] = ne(a, p + A * 3, 7);
194
- p += z * 3;
195
- for (var K = Ve(j), se = (1 << K) - 1, H = le(j, K, 1), A = 0; A < w; ) {
196
- var W = H[ne(a, p, se)];
197
- p += W & 15;
198
- var v = W >> 4;
199
- if (v < 16)
200
- B[A++] = v;
201
- else {
202
- var G = 0, E = 0;
203
- for (v == 16 ? (E = 3 + ne(a, p, 3), p += 2, G = B[A - 1]) : v == 17 ? (E = 3 + ne(a, p, 7), p += 3) : v == 18 && (E = 11 + ne(a, p, 127), p += 7); E--; )
204
- B[A++] = G;
205
- }
206
- }
207
- var Z = B.subarray(0, b), X = B.subarray(b);
208
- k = Ve(Z), C = Ve(X), S = le(Z, k, 1), U = le(X, C, 1);
209
- } else
210
- q(1);
211
- else {
212
- var v = je(p) + 4, r = a[v - 4] | a[v - 3] << 8, l = v + r;
213
- if (l > t) {
214
- m && q(0);
215
- break;
216
- }
217
- f && g(_ + r), o.set(a.subarray(v, l), _), e.b = _ += r, e.p = p = l * 8, e.f = u;
218
- continue;
219
- }
220
- if (p > h) {
221
- m && q(0);
222
- break;
223
- }
224
- }
225
- f && g(_ + 131072);
226
- for (var Be = (1 << k) - 1, oe = (1 << C) - 1, pe = p; ; pe = p) {
227
- var G = S[Pe(a, p) & Be], te = G >> 4;
228
- if (p += G & 15, p > h) {
229
- m && q(0);
230
- break;
231
- }
232
- if (G || q(2), te < 256)
233
- o[_++] = te;
234
- else if (te == 256) {
235
- pe = p, S = null;
236
- break;
237
- } else {
238
- var ae = te - 254;
239
- if (te > 264) {
240
- var A = te - 257, N = Ie[A];
241
- ae = ne(a, p, (1 << N) - 1) + st[A], p += N;
242
- }
243
- var ue = U[Pe(a, p) & oe], be = ue >> 4;
244
- ue || q(3), p += ue & 15;
245
- var X = It[be];
246
- if (be > 3) {
247
- var N = Se[be];
248
- X += Pe(a, p) & (1 << N) - 1, p += N;
249
- }
250
- if (p > h) {
251
- m && q(0);
252
- break;
253
- }
254
- f && g(_ + 131072);
255
- var we = _ + ae;
256
- if (_ < X) {
257
- var Re = s - X, Le = Math.min(X, we);
258
- for (Re + _ < 0 && q(3); _ < Le; ++_)
259
- o[_] = n[Re + _];
260
- }
261
- for (; _ < we; ++_)
262
- o[_] = o[_ - X];
263
- }
264
- }
265
- e.l = S, e.p = pe, e.b = _, e.f = u, S && (u = 1, e.m = k, e.d = U, e.n = C);
266
- } while (!u);
267
- return _ != o.length && i ? ye(o, 0, _) : o.subarray(0, _);
268
- }, me = function(a, e, o) {
269
- o <<= e & 7;
270
- var n = e / 8 | 0;
271
- a[n] |= o, a[n + 1] |= o >> 8;
272
- }, xe = function(a, e, o) {
273
- o <<= e & 7;
274
- var n = e / 8 | 0;
275
- a[n] |= o, a[n + 1] |= o >> 8, a[n + 2] |= o >> 16;
276
- }, Ke = function(a, e) {
277
- for (var o = [], n = 0; n < a.length; ++n)
278
- a[n] && o.push({ s: n, f: a[n] });
279
- var t = o.length, s = o.slice();
280
- if (!t)
281
- return { t: ct, l: 0 };
282
- if (t == 1) {
283
- var i = new P(o[0].s + 1);
284
- return i[o[0].s] = 1, { t: i, l: 1 };
285
- }
286
- o.sort(function(l, b) {
287
- return l.f - b.f;
288
- }), o.push({ s: -1, f: 25001 });
289
- var f = o[0], m = o[1], g = 0, u = 1, p = 2;
290
- for (o[0] = { s: -1, f: f.f + m.f, l: f, r: m }; u != t - 1; )
291
- f = o[o[g].f < o[p].f ? g++ : p++], m = o[g != u && o[g].f < o[p].f ? g++ : p++], o[u++] = { s: -1, f: f.f + m.f, l: f, r: m };
292
- for (var _ = s[0].s, n = 1; n < t; ++n)
293
- s[n].s > _ && (_ = s[n].s);
294
- var S = new Q(_ + 1), U = qe(o[u - 1], S, 0);
295
- if (U > e) {
296
- var n = 0, k = 0, C = U - e, h = 1 << C;
297
- for (s.sort(function(b, z) {
298
- return S[z.s] - S[b.s] || b.f - z.f;
299
- }); n < t; ++n) {
300
- var d = s[n].s;
301
- if (S[d] > e)
302
- k += h - (1 << U - S[d]), S[d] = e;
303
- else
304
- break;
305
- }
306
- for (k >>= C; k > 0; ) {
307
- var v = s[n].s;
308
- S[v] < e ? k -= 1 << e - S[v]++ - 1 : ++n;
309
- }
310
- for (; n >= 0 && k; --n) {
311
- var r = s[n].s;
312
- S[r] == e && (--S[r], ++k);
313
- }
314
- U = e;
315
- }
316
- return { t: new P(S), l: U };
317
- }, qe = function(a, e, o) {
318
- return a.s == -1 ? Math.max(qe(a.l, e, o + 1), qe(a.r, e, o + 1)) : e[a.s] = o;
319
- }, tt = function(a) {
320
- for (var e = a.length; e && !a[--e]; )
321
- ;
322
- for (var o = new Q(++e), n = 0, t = a[0], s = 1, i = function(m) {
323
- o[n++] = m;
324
- }, f = 1; f <= e; ++f)
325
- if (a[f] == t && f != e)
326
- ++s;
327
- else {
328
- if (!t && s > 2) {
329
- for (; s > 138; s -= 138)
330
- i(32754);
331
- s > 2 && (i(s > 10 ? s - 11 << 5 | 28690 : s - 3 << 5 | 12305), s = 0);
332
- } else if (s > 3) {
333
- for (i(t), --s; s > 6; s -= 6)
334
- i(8304);
335
- s > 2 && (i(s - 3 << 5 | 8208), s = 0);
336
- }
337
- for (; s--; )
338
- i(t);
339
- s = 1, t = a[f];
340
- }
341
- return { c: o.subarray(0, n), n: e };
342
- }, $e = function(a, e) {
343
- for (var o = 0, n = 0; n < e.length; ++n)
344
- o += a[n] * e[n];
345
- return o;
346
- }, it = function(a, e, o) {
347
- var n = o.length, t = je(e + 2);
348
- a[t] = n & 255, a[t + 1] = n >> 8, a[t + 2] = a[t] ^ 255, a[t + 3] = a[t + 1] ^ 255;
349
- for (var s = 0; s < n; ++s)
350
- a[t + s + 4] = o[s];
351
- return (t + 4 + n) * 8;
352
- }, at = function(a, e, o, n, t, s, i, f, m, g, u) {
353
- me(e, u++, o), ++t[256];
354
- for (var p = Ke(t, 15), _ = p.t, S = p.l, U = Ke(s, 15), k = U.t, C = U.l, h = tt(_), d = h.c, v = h.n, r = tt(k), l = r.c, b = r.n, z = new Q(19), w = 0; w < d.length; ++w)
355
- ++z[d[w] & 31];
356
- for (var w = 0; w < l.length; ++w)
357
- ++z[l[w] & 31];
358
- for (var B = Ke(z, 7), j = B.t, A = B.l, K = 19; K > 4 && !j[Te[K - 1]]; --K)
359
- ;
360
- var se = g + 5 << 3, H = $e(t, fe) + $e(s, Ce) + i, W = $e(t, _) + $e(s, k) + i + 14 + 3 * K + $e(z, j) + 2 * z[16] + 3 * z[17] + 7 * z[18];
361
- if (m >= 0 && se <= H && se <= W)
362
- return it(e, u, a.subarray(m, m + g));
363
- var G, E, Z, X;
364
- if (me(e, u, 1 + (W < H)), u += 2, W < H) {
365
- G = le(_, S, 0), E = _, Z = le(k, C, 0), X = k;
366
- var Be = le(j, A, 0);
367
- me(e, u, v - 257), me(e, u + 5, b - 1), me(e, u + 10, K - 4), u += 14;
368
- for (var w = 0; w < K; ++w)
369
- me(e, u + 3 * w, j[Te[w]]);
370
- u += 3 * K;
371
- for (var oe = [d, l], pe = 0; pe < 2; ++pe)
372
- for (var te = oe[pe], w = 0; w < te.length; ++w) {
373
- var ae = te[w] & 31;
374
- me(e, u, Be[ae]), u += j[ae], ae > 15 && (me(e, u, te[w] >> 5 & 127), u += te[w] >> 12);
375
- }
376
- } else
377
- G = St, E = fe, Z = zt, X = Ce;
378
- for (var w = 0; w < f; ++w) {
379
- var N = n[w];
380
- if (N > 255) {
381
- var ae = N >> 18 & 31;
382
- xe(e, u, G[ae + 257]), u += E[ae + 257], ae > 7 && (me(e, u, N >> 23 & 31), u += Ie[ae]);
383
- var ue = N & 31;
384
- xe(e, u, Z[ue]), u += X[ue], ue > 3 && (xe(e, u, N >> 5 & 8191), u += Se[ue]);
385
- } else
386
- xe(e, u, G[N]), u += E[N];
387
- }
388
- return xe(e, u, G[256]), u + E[256];
389
- }, At = /* @__PURE__ */ new Oe([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), ct = /* @__PURE__ */ new P(0), Ot = function(a, e, o, n, t, s) {
390
- var i = s.z || a.length, f = new P(n + i + 5 * (1 + Math.ceil(i / 7e3)) + t), m = f.subarray(n, f.length - t), g = s.l, u = (s.r || 0) & 7;
391
- if (e) {
392
- u && (m[0] = s.r >> 3);
393
- for (var p = At[e - 1], _ = p >> 13, S = p & 8191, U = (1 << o) - 1, k = s.p || new Q(32768), C = s.h || new Q(U + 1), h = Math.ceil(o / 3), d = 2 * h, v = function(Xe) {
394
- return (a[Xe] ^ a[Xe + 1] << h ^ a[Xe + 2] << d) & U;
395
- }, r = new Oe(25e3), l = new Q(288), b = new Q(32), z = 0, w = 0, B = s.i || 0, j = 0, A = s.w || 0, K = 0; B + 2 < i; ++B) {
396
- var se = v(B), H = B & 32767, W = C[se];
397
- if (k[H] = W, C[se] = H, A <= B) {
398
- var G = i - B;
399
- if ((z > 7e3 || j > 24576) && (G > 423 || !g)) {
400
- u = at(a, m, 0, r, l, b, w, j, K, B - K, u), j = z = w = 0, K = B;
401
- for (var E = 0; E < 286; ++E)
402
- l[E] = 0;
403
- for (var E = 0; E < 30; ++E)
404
- b[E] = 0;
405
- }
406
- var Z = 2, X = 0, Be = S, oe = H - W & 32767;
407
- if (G > 2 && se == v(B - oe))
408
- for (var pe = Math.min(_, G) - 1, te = Math.min(32767, B), ae = Math.min(258, G); oe <= te && --Be && H != W; ) {
409
- if (a[B + Z] == a[B + Z - oe]) {
410
- for (var N = 0; N < ae && a[B + N] == a[B + N - oe]; ++N)
411
- ;
412
- if (N > Z) {
413
- if (Z = N, X = oe, N > pe)
414
- break;
415
- for (var ue = Math.min(oe, N - 2), be = 0, E = 0; E < ue; ++E) {
416
- var we = B - oe + E & 32767, Re = k[we], Le = we - Re & 32767;
417
- Le > be && (be = Le, W = we);
418
- }
419
- }
420
- }
421
- H = W, W = k[H], oe += H - W & 32767;
422
- }
423
- if (X) {
424
- r[j++] = 268435456 | De[Z] << 18 | et[X];
425
- var ze = De[Z] & 31, Me = et[X] & 31;
426
- w += Ie[ze] + Se[Me], ++l[257 + ze], ++b[Me], A = B + Z, ++z;
427
- } else
428
- r[j++] = a[B], ++l[a[B]];
429
- }
430
- }
431
- for (B = Math.max(B, A); B < i; ++B)
432
- r[j++] = a[B], ++l[a[B]];
433
- u = at(a, m, g, r, l, b, w, j, K, B - K, u), g || (s.r = u & 7 | m[u / 8 | 0] << 3, u -= 7, s.h = C, s.p = k, s.i = B, s.w = A);
434
- } else {
435
- for (var B = s.w || 0; B < i + g; B += 65535) {
436
- var ke = B + 65535;
437
- ke >= i && (m[u / 8 | 0] = g, ke = i), u = it(m, u + 1, a.subarray(B, ke));
438
- }
439
- s.i = i;
440
- }
441
- return ye(f, 0, n + je(u) + t);
442
- }, Zt = /* @__PURE__ */ (function() {
443
- for (var a = new Int32Array(256), e = 0; e < 256; ++e) {
444
- for (var o = e, n = 9; --n; )
445
- o = (o & 1 && -306674912) ^ o >>> 1;
446
- a[e] = o;
447
- }
448
- return a;
449
- })(), ea = function() {
450
- var a = -1;
451
- return {
452
- p: function(e) {
453
- for (var o = a, n = 0; n < e.length; ++n)
454
- o = Zt[o & 255 ^ e[n]] ^ o >>> 8;
455
- a = o;
456
- },
457
- d: function() {
458
- return ~a;
459
- }
460
- };
461
- }, jt = function(a, e, o, n, t) {
462
- if (!t && (t = { l: 1 }, e.dictionary)) {
463
- var s = e.dictionary.subarray(-32768), i = new P(s.length + a.length);
464
- i.set(s), i.set(a, s.length), a = i, t.w = s.length;
465
- }
466
- return Ot(a, e.level == null ? 6 : e.level, e.mem == null ? t.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(a.length))) * 1.5) : 20 : 12 + e.mem, o, n, t);
467
- }, ut = function(a, e) {
468
- var o = {};
469
- for (var n in a)
470
- o[n] = a[n];
471
- for (var n in e)
472
- o[n] = e[n];
473
- return o;
474
- }, gt = function(a, e, o) {
475
- for (var n = a(), t = a.toString(), s = t.slice(t.indexOf("[") + 1, t.lastIndexOf("]")).replace(/\s+/g, "").split(","), i = 0; i < n.length; ++i) {
476
- var f = n[i], m = s[i];
477
- if (typeof f == "function") {
478
- e += ";" + m + "=";
479
- var g = f.toString();
480
- if (f.prototype)
481
- if (g.indexOf("[native code]") != -1) {
482
- var u = g.indexOf(" ", 8) + 1;
483
- e += g.slice(u, g.indexOf("(", u));
484
- } else {
485
- e += g;
486
- for (var p in f.prototype)
487
- e += ";" + m + ".prototype." + p + "=" + f.prototype[p].toString();
488
- }
489
- else
490
- e += g;
491
- } else
492
- o[m] = f;
493
- }
494
- return e;
495
- }, Ee = [], ta = function(a) {
496
- var e = [];
497
- for (var o in a)
498
- a[o].buffer && e.push((a[o] = new a[o].constructor(a[o])).buffer);
499
- return e;
500
- }, aa = function(a, e, o, n) {
501
- if (!Ee[o]) {
502
- for (var t = "", s = {}, i = a.length - 1, f = 0; f < i; ++f)
503
- t = gt(a[f], t, s);
504
- Ee[o] = { c: gt(a[i], t, s), e: s };
505
- }
506
- var m = ut({}, Ee[o].e);
507
- return Qt(Ee[o].c + ";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=" + e.toString() + "}", o, m, ta(m), n);
508
- }, oa = function() {
509
- return [P, Q, Oe, Ie, Se, Te, st, It, Bt, Mt, Ue, Tt, le, Ve, ne, Pe, je, ye, q, Ut, dt, We, Rt];
510
- }, na = function() {
511
- return [P, Q, Oe, Ie, Se, Te, De, et, St, fe, zt, Ce, Ue, At, ct, le, me, xe, Ke, qe, tt, $e, it, at, je, ye, Ot, jt, mt, We];
512
- }, We = function(a) {
513
- return postMessage(a, [a.buffer]);
514
- }, Rt = function(a) {
515
- return a && {
516
- out: a.size && new P(a.size),
517
- dictionary: a.dictionary
518
- };
519
- }, Lt = function(a, e, o, n, t, s) {
520
- var i = aa(o, n, t, function(f, m) {
521
- i.terminate(), s(f, m);
522
- });
523
- return i.postMessage([a, e], e.consume ? [a.buffer] : []), function() {
524
- i.terminate();
525
- };
526
- }, de = function(a, e) {
527
- return a[e] | a[e + 1] << 8;
528
- }, re = function(a, e) {
529
- return (a[e] | a[e + 1] << 8 | a[e + 2] << 16 | a[e + 3] << 24) >>> 0;
530
- }, Ye = function(a, e) {
531
- return re(a, e) + re(a, e + 4) * 4294967296;
532
- }, J = function(a, e, o) {
533
- for (; o; ++e)
534
- a[e] = o, o >>>= 8;
535
- };
536
- function ra(a, e, o) {
537
- return o || (o = e, e = {}), typeof o != "function" && q(7), Lt(a, e, [
538
- na
539
- ], function(n) {
540
- return We(mt(n.data[0], n.data[1]));
541
- }, 0, o);
542
- }
543
- function mt(a, e) {
544
- return jt(a, e || {}, 0, 0);
545
- }
546
- function la(a, e, o) {
547
- return o || (o = e, e = {}), typeof o != "function" && q(7), Lt(a, e, [
548
- oa
549
- ], function(n) {
550
- return We(dt(n.data[0], Rt(n.data[1])));
551
- }, 1, o);
552
- }
553
- function dt(a, e) {
554
- return Ut(a, { i: 2 }, e && e.out, e && e.dictionary);
555
- }
556
- var Et = function(a, e, o, n) {
557
- for (var t in a) {
558
- var s = a[t], i = e + t, f = n;
559
- Array.isArray(s) && (f = ut(n, s[1]), s = s[0]), ArrayBuffer.isView(s) ? o[i] = [s, f] : (o[i += "/"] = [new P(0), f], Et(s, i, o, n));
560
- }
561
- }, vt = typeof TextEncoder < "u" && /* @__PURE__ */ new TextEncoder(), ot = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), sa = 0;
562
- try {
563
- ot.decode(ct, { stream: !0 }), sa = 1;
564
- } catch {
565
- }
566
- var ia = function(a) {
567
- for (var e = "", o = 0; ; ) {
568
- var n = a[o++], t = (n > 127) + (n > 223) + (n > 239);
569
- if (o + t > a.length)
570
- return { s: e, r: ye(a, o - 1) };
571
- t ? t == 3 ? (n = ((n & 15) << 18 | (a[o++] & 63) << 12 | (a[o++] & 63) << 6 | a[o++] & 63) - 65536, e += String.fromCharCode(55296 | n >> 10, 56320 | n & 1023)) : t & 1 ? e += String.fromCharCode((n & 31) << 6 | a[o++] & 63) : e += String.fromCharCode((n & 15) << 12 | (a[o++] & 63) << 6 | a[o++] & 63) : e += String.fromCharCode(n);
572
- }
573
- };
574
- function _t(a, e) {
575
- var o;
576
- if (vt)
577
- return vt.encode(a);
578
- for (var n = a.length, t = new P(a.length + (a.length >> 1)), s = 0, i = function(g) {
579
- t[s++] = g;
580
- }, o = 0; o < n; ++o) {
581
- if (s + 5 > t.length) {
582
- var f = new P(s + 8 + (n - o << 1));
583
- f.set(t), t = f;
584
- }
585
- var m = a.charCodeAt(o);
586
- m < 128 || e ? i(m) : m < 2048 ? (i(192 | m >> 6), i(128 | m & 63)) : m > 55295 && m < 57344 ? (m = 65536 + (m & 1047552) | a.charCodeAt(++o) & 1023, i(240 | m >> 18), i(128 | m >> 12 & 63), i(128 | m >> 6 & 63), i(128 | m & 63)) : (i(224 | m >> 12), i(128 | m >> 6 & 63), i(128 | m & 63));
587
- }
588
- return ye(t, 0, s);
589
- }
590
- function ca(a, e) {
591
- if (e) {
592
- for (var o = "", n = 0; n < a.length; n += 16384)
593
- o += String.fromCharCode.apply(null, a.subarray(n, n + 16384));
594
- return o;
595
- } else {
596
- if (ot)
597
- return ot.decode(a);
598
- var t = ia(a), s = t.s, o = t.r;
599
- return o.length && q(8), s;
600
- }
601
- }
602
- var ua = function(a, e) {
603
- return e + 30 + de(a, e + 26) + de(a, e + 28);
604
- }, ma = function(a, e, o) {
605
- var n = de(a, e + 28), t = de(a, e + 30), s = ca(a.subarray(e + 46, e + 46 + n), !(de(a, e + 8) & 2048)), i = e + 46 + n, f = da(a, i, t, o, re(a, e + 20), re(a, e + 24), re(a, e + 42)), m = f[0], g = f[1], u = f[2];
606
- return [de(a, e + 10), m, g, s, i + t + de(a, e + 32), u];
607
- }, da = function(a, e, o, n, t, s, i) {
608
- var f = t == 4294967295, m = s == 4294967295, g = i == 4294967295, u = e + o, p = f + m + g;
609
- if (n && p) {
610
- for (; e + 4 < u; e += 4 + de(a, e + 2))
611
- if (de(a, e) == 1)
612
- return [
613
- f ? Ye(a, e + 4 + 8 * m) : t,
614
- m ? Ye(a, e + 4) : s,
615
- g ? Ye(a, e + 4 + 8 * (m + f)) : i,
616
- 1
617
- ];
618
- n < 2 && q(13);
619
- }
620
- return [t, s, i, 0];
621
- }, nt = function(a) {
622
- var e = 0;
623
- if (a)
624
- for (var o in a) {
625
- var n = a[o].length;
626
- n > 65535 && q(9), e += n + 4;
627
- }
628
- return e;
629
- }, ht = function(a, e, o, n, t, s, i, f) {
630
- var m = n.length, g = o.extra, u = f && f.length, p = nt(g);
631
- J(a, e, i != null ? 33639248 : 67324752), e += 4, i != null && (a[e++] = 20, a[e++] = o.os), a[e] = 20, e += 2, a[e++] = o.flag << 1 | (s < 0 && 8), a[e++] = t && 8, a[e++] = o.compression & 255, a[e++] = o.compression >> 8;
632
- var _ = new Date(o.mtime == null ? Date.now() : o.mtime), S = _.getFullYear() - 1980;
633
- if ((S < 0 || S > 119) && q(10), J(a, e, S << 25 | _.getMonth() + 1 << 21 | _.getDate() << 16 | _.getHours() << 11 | _.getMinutes() << 5 | _.getSeconds() >> 1), e += 4, s != -1 && (J(a, e, o.crc), J(a, e + 4, s < 0 ? -s - 2 : s), J(a, e + 8, o.size)), J(a, e + 12, m), J(a, e + 14, p), e += 16, i != null && (J(a, e, u), J(a, e + 6, o.attrs), J(a, e + 10, i), e += 14), a.set(n, e), e += m, p)
634
- for (var U in g) {
635
- var k = g[U], C = k.length;
636
- J(a, e, +U), J(a, e + 2, C), a.set(k, e + 4), e += 4 + C;
637
- }
638
- return u && (a.set(f, e), e += u), e;
639
- }, pa = function(a, e, o, n, t) {
640
- J(a, e, 101010256), J(a, e + 8, o), J(a, e + 10, o), J(a, e + 12, n), J(a, e + 16, t);
641
- };
642
- function fa(a, e, o) {
643
- o || (o = e, e = {}), typeof o != "function" && q(7);
644
- var n = {};
645
- Et(a, "", n, e);
646
- var t = Object.keys(n), s = t.length, i = 0, f = 0, m = s, g = new Array(s), u = [], p = function() {
647
- for (var C = 0; C < u.length; ++C)
648
- u[C]();
649
- }, _ = function(C, h) {
650
- Ge(function() {
651
- o(C, h);
652
- });
653
- };
654
- Ge(function() {
655
- _ = o;
656
- });
657
- var S = function() {
658
- var C = new P(f + 22), h = i, d = f - i;
659
- f = 0;
660
- for (var v = 0; v < m; ++v) {
661
- var r = g[v];
662
- try {
663
- var l = r.c.length;
664
- ht(C, f, r, r.f, r.u, l);
665
- var b = 30 + r.f.length + nt(r.extra), z = f + b;
666
- C.set(r.c, z), ht(C, i, r, r.f, r.u, l, f, r.m), i += 16 + b + (r.m ? r.m.length : 0), f = z + l;
667
- } catch (w) {
668
- return _(w, null);
669
- }
670
- }
671
- pa(C, i, g.length, d, h), _(null, C);
672
- };
673
- s || S();
674
- for (var U = function(C) {
675
- var h = t[C], d = n[h], v = d[0], r = d[1], l = ea(), b = v.length;
676
- l.p(v);
677
- var z = _t(h), w = z.length, B = r.comment, j = B && _t(B), A = j && j.length, K = nt(r.extra), se = r.level == 0 ? 0 : 8, H = function(W, G) {
678
- if (W)
679
- p(), _(W, null);
680
- else {
681
- var E = G.length;
682
- g[C] = ut(r, {
683
- size: b,
684
- crc: l.d(),
685
- c: G,
686
- f: z,
687
- m: j,
688
- u: w != h.length || j && B.length != A,
689
- compression: se
690
- }), i += 30 + w + K + E, f += 76 + 2 * (w + K) + (A || 0) + E, --s || S();
691
- }
692
- };
693
- if (w > 65535 && H(q(11, 0, 1), null), !se)
694
- H(null, v);
695
- else if (b < 16e4)
696
- try {
697
- H(null, mt(v, r));
698
- } catch (W) {
699
- H(W, null);
700
- }
701
- else
702
- u.push(ra(v, r, H));
703
- }, k = 0; k < m; ++k)
704
- U(k);
705
- return p;
706
- }
707
- var Ge = typeof queueMicrotask == "function" ? queueMicrotask : typeof setTimeout == "function" ? setTimeout : function(a) {
708
- a();
709
- };
710
- function ga(a, e, o) {
711
- o || (o = e, e = {}), typeof o != "function" && q(7);
712
- var n = [], t = function() {
713
- for (var C = 0; C < n.length; ++C)
714
- n[C]();
715
- }, s = {}, i = function(C, h) {
716
- Ge(function() {
717
- o(C, h);
718
- });
719
- };
720
- Ge(function() {
721
- i = o;
722
- });
723
- for (var f = a.length - 22; re(a, f) != 101010256; --f)
724
- if (!f || a.length - f > 65558)
725
- return i(q(13, 0, 1), null), t;
726
- var m = de(a, f + 8);
727
- if (m) {
728
- var g = m, u = re(a, f + 16), p = re(a, f - 20) == 117853008;
729
- if (p) {
730
- var _ = re(a, f - 12);
731
- p = re(a, _) == 101075792, p && (g = m = re(a, _ + 32), u = re(a, _ + 48));
732
- }
733
- for (var S = e && e.filter, U = function(C) {
734
- var h = ma(a, u, p), d = h[0], v = h[1], r = h[2], l = h[3], b = h[4], z = h[5], w = ua(a, z);
735
- u = b;
736
- var B = function(A, K) {
737
- A ? (t(), i(A, null)) : (K && (s[l] = K), --m || i(null, s));
738
- };
739
- if (!S || S({
740
- name: l,
741
- size: v,
742
- originalSize: r,
743
- compression: d
744
- }))
745
- if (!d)
746
- B(null, ye(a, w, w + v));
747
- else if (d == 8) {
748
- var j = a.subarray(w, w + v);
749
- if (r < 524288 || v > 0.8 * r)
750
- try {
751
- B(null, dt(j, { out: new P(r) }));
752
- } catch (A) {
753
- B(A, null);
754
- }
755
- else
756
- n.push(la(j, { size: r }, B));
757
- } else
758
- B(q(14, "unknown compression type " + d, 1), null);
759
- else
760
- B(null, null);
761
- }, k = 0; k < g; ++k)
762
- U(k);
763
- } else
764
- i(null, {});
765
- return t;
766
- }
767
- const va = /\.(jpe?g|png|webp|gif|bmp|heic|heif|tiff?)$/i, _a = 4;
768
- function ha(a) {
769
- return a.split("/").some((e) => e.startsWith(".") || e === "__MACOSX");
770
- }
771
- function Vt(a) {
772
- return Array.from(a).map((e) => ({
773
- path: e.webkitRelativePath || e.name,
774
- file: e
775
- }));
776
- }
777
- async function ya(a) {
778
- const e = Array.from(a.items).map((t) => {
779
- var s;
780
- return (s = t.webkitGetAsEntry) == null ? void 0 : s.call(t);
781
- }).filter((t) => !!t);
782
- if (!e.length) return Vt(Array.from(a.files));
783
- const o = [];
784
- async function n(t, s) {
785
- if (t.isFile) {
786
- const f = await new Promise(
787
- (m, g) => t.file(m, g)
788
- );
789
- o.push({ path: `${s}${t.name}`, file: f });
790
- return;
791
- }
792
- const i = t.createReader();
793
- for (; ; ) {
794
- const f = await new Promise(
795
- (m, g) => i.readEntries(m, g)
796
- );
797
- if (!f.length) break;
798
- for (const m of f) await n(m, `${s}${t.name}/`);
799
- }
800
- }
801
- for (const t of e) await n(t, "");
802
- return o;
803
- }
804
- function ba(a) {
805
- return new Promise(
806
- (e, o) => ga(a, (n, t) => n ? o(n) : e(t))
807
- );
808
- }
809
- function rt(a) {
810
- var o;
811
- const e = ((o = a.split(".").pop()) == null ? void 0 : o.toLowerCase()) ?? "";
812
- return {
813
- jpg: "image/jpeg",
814
- jpeg: "image/jpeg",
815
- png: "image/png",
816
- webp: "image/webp",
817
- gif: "image/gif",
818
- json: "application/json"
819
- }[e] ?? "application/octet-stream";
820
- }
821
- async function wa(a) {
822
- const e = [];
823
- for (const o of a) {
824
- if (!/\.zip$/i.test(o.path)) {
825
- e.push(o);
826
- continue;
827
- }
828
- const n = await ba(
829
- new Uint8Array(await o.file.arrayBuffer())
830
- );
831
- for (const [t, s] of Object.entries(n)) {
832
- if (t.endsWith("/")) continue;
833
- const i = t.split("/").pop() ?? t;
834
- e.push({
835
- path: t,
836
- file: new File([s], i, { type: rt(t) })
837
- });
838
- }
839
- }
840
- return e;
841
- }
842
- async function Pt(a) {
843
- const e = await crypto.subtle.digest("SHA-256", a);
844
- return Array.from(new Uint8Array(e)).map((o) => o.toString(16).padStart(2, "0")).join("");
845
- }
846
- function Kt(a) {
847
- return {
848
- contentType: a.blob.type || "image/jpeg",
849
- fileName: a.fileName,
850
- width: a.width,
851
- height: a.height,
852
- byteLength: a.blob.size,
853
- bytes: a.blob,
854
- readDataUrl: () => Xt(a.blob)
855
- };
856
- }
857
- async function Nt(a, e, o) {
858
- const n = new Array(a.length);
859
- let t = 0, s = 0;
860
- async function i() {
861
- for (; t < a.length; ) {
862
- const f = t++;
863
- n[f] = await e(a[f], f), o == null || o(++s);
864
- }
865
- }
866
- return await Promise.all(Array.from({ length: _a }, i)), n;
867
- }
868
- async function ka(a, e, o) {
869
- const n = (await wa(a)).filter((u) => !ha(u.path)), t = n.find(
870
- (u) => u.path.split("/").pop() === wt
871
- );
872
- let s = null;
873
- if (t)
874
- try {
875
- s = {
876
- path: t.path,
877
- data: JSON.parse(await t.file.text())
878
- };
879
- } catch {
880
- s = null;
881
- }
882
- const i = n.filter((u) => va.test(u.path)), f = n.length - i.length - (t ? 1 : 0), m = /* @__PURE__ */ new Map(), g = await Nt(
883
- i,
884
- async (u, p) => {
885
- const _ = `file-${p}`, S = await u.file.arrayBuffer(), k = /\.(jpe?g|png|webp)$/i.test(u.path) ? await Jt(
886
- new File([S], u.file.name, {
887
- type: u.file.type || rt(u.path)
888
- })
889
- ).catch(() => null) : null;
890
- return k && m.set(_, URL.createObjectURL(k.blob)), {
891
- key: _,
892
- path: u.path,
893
- contentType: u.file.type || rt(u.path),
894
- byteLength: u.file.size,
895
- sha256: await Pt(S),
896
- prepared: k ? Kt(k) : null
897
- };
898
- },
899
- (u) => o == null ? void 0 : o(u, i.length)
900
- );
901
- return {
902
- source: {
903
- label: e.label,
904
- kind: e.kind,
905
- totalBytes: a.reduce((u, p) => u + p.file.size, 0),
906
- files: g,
907
- ignoredCount: f,
908
- manifest: s
909
- },
910
- previews: m
911
- };
912
- }
913
- function Qe(a) {
914
- for (const e of a.values()) URL.revokeObjectURL(e);
915
- a.clear();
916
- }
917
- function xa(a) {
918
- return Kt(a);
919
- }
920
- async function $a(a, e, o) {
921
- const n = {}, t = {};
922
- let s = 0;
923
- await Nt(
924
- a.entries,
925
- async (m) => {
926
- try {
927
- const g = await fetch(m.url, { cache: "no-store" });
928
- if (!g.ok) throw new Error(String(g.status));
929
- const u = await g.arrayBuffer();
930
- n[m.key] = await Pt(u), t[m.path] = new Uint8Array(u);
931
- } catch {
932
- s++;
933
- }
934
- },
935
- (m) => o == null ? void 0 : o(m, a.entries.length)
936
- );
937
- const i = e(n);
938
- t[i.path] = new TextEncoder().encode(i.content);
939
- const f = await new Promise(
940
- (m, g) => fa(
941
- t,
942
- { level: 0 },
943
- (u, p) => u ? g(u) : m(p)
944
- )
945
- );
946
- return { blob: new Blob([f], { type: "application/zip" }), failed: s };
947
- }
948
- function Fa(a, e) {
949
- const o = URL.createObjectURL(a), n = document.createElement("a");
950
- n.href = o, n.download = e, n.click(), setTimeout(() => URL.revokeObjectURL(o), 1e4);
951
- }
952
- const Ca = { class: "flex flex-col gap-4" }, Ia = { class: "fm-typo-en-title-sm-600" }, Sa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ba = { class: "flex flex-col gap-16" }, za = { class: "flex flex-col gap-8" }, Ma = { class: "fm-typo-en-body-lg-600" }, Ta = { class: "grid grid-cols-4 gap-8" }, Ua = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Aa = { class: "flex flex-col gap-8" }, Oa = { class: "fm-typo-en-body-lg-600" }, ja = {
953
- key: 0,
954
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
955
- }, Ra = { class: "fm-typo-en-body-sm-600" }, La = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ea = {
956
- key: 0,
957
- class: "flex flex-col gap-4"
958
- }, Va = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Pa = { class: "flex w-full items-center justify-end gap-8" }, Ka = /* @__PURE__ */ ce({
959
- __name: "BatchImageDownloadDialog",
960
- props: {
961
- overview: {}
962
- },
963
- emits: ["close"],
964
- setup(a, { emit: e }) {
965
- const o = a, n = e, { t } = ge(), s = Ae(), i = bt(), f = lt(), m = ee(
966
- o.overview.download.formats.filter(
967
- (k) => k.kind === "original" || o.overview.coverage.ratios.some(
968
- (C) => C.id === k.id && C.required
969
- )
970
- ).map((k) => k.id)
971
- ), g = ee(!1), u = D(() => {
972
- const k = t("menu.product_batch_image.download.sample_category"), C = t("menu.product_batch_image.setup.naming.sample_name"), h = (d) => t("menu.product_batch_image.download.tree_entry", {
973
- path: t("menu.product_batch_image.download.sample_entry", {
974
- category: k,
975
- name: C,
976
- suffix: d
977
- })
978
- });
979
- return [
980
- h(".jpg"),
981
- h("@16x9.jpg"),
982
- h(" #2.jpg"),
983
- t("menu.product_batch_image.download.tree_last", {
984
- path: wt
985
- })
986
- ];
987
- }), p = ee(null), _ = D(
988
- () => o.overview.download.formats.map((k) => ({
989
- id: k.id,
990
- label: k.label ?? t("menu.product_image.manage.original")
991
- }))
992
- );
993
- function S(k, C) {
994
- m.value = C ? [.../* @__PURE__ */ new Set([...m.value, k])] : m.value.filter((h) => h !== k);
995
- }
996
- async function U() {
997
- var k;
998
- p.value = { done: 0, total: 0 };
999
- try {
1000
- const C = await f.productBatchImage.planDownload({
1001
- formatIds: m.value,
1002
- coverOnly: g.value
1003
- });
1004
- if (C.kind !== "success") {
1005
- i.open({
1006
- type: "error",
1007
- title: C.kind === "failure" ? s(C.error.message) : C.kind === "rejected" ? t(((k = C.issues[0]) == null ? void 0 : k.code) ?? "menu.error.unexpected") : t("menu.error.unexpected"),
1008
- position: Ne.BOTTOM
1009
- });
1010
- return;
1011
- }
1012
- const h = C.value, { blob: d, failed: v } = await $a(
1013
- h,
1014
- (r) => f.productBatchImage.downloadManifest(h, r),
1015
- (r, l) => {
1016
- p.value = { done: r, total: l };
1017
- }
1018
- );
1019
- Fa(d, h.archiveName), i.open({
1020
- type: v ? "warning" : "success",
1021
- title: v ? t("menu.product_batch_image.download.partial", { count: v }) : t("menu.product_batch_image.download.done", {
1022
- count: h.entries.length
1023
- }),
1024
- position: Ne.BOTTOM
1025
- }), n("close");
1026
- } finally {
1027
- p.value = null;
1028
- }
1029
- }
1030
- return (k, C) => (F(), L(c($).FmDialog, {
1031
- "model-value": !0,
1032
- "max-width": 600,
1033
- "onUpdate:modelValue": C[2] || (C[2] = (h) => !h && !p.value && n("close"))
1034
- }, {
1035
- "dialog-header": O(() => [
1036
- y("div", Ca, [
1037
- y("p", Ia, I(c(t)("menu.product_batch_image.download.title")), 1),
1038
- y("p", Sa, I(c(t)("menu.product_batch_image.download.subtitle", {
1039
- count: k.overview.productCount,
1040
- images: k.overview.coverage.withImages + k.overview.coverage.legacyOnly
1041
- })), 1)
1042
- ])
1043
- ]),
1044
- "dialog-footer": O(() => [
1045
- y("div", Pa, [
1046
- M(c($).FmButton, {
1047
- variant: "tertiary",
1048
- label: c(t)("menu.common.actions.cancel"),
1049
- disabled: !!p.value,
1050
- onClick: C[1] || (C[1] = (h) => n("close"))
1051
- }, null, 8, ["label", "disabled"]),
1052
- M(c($).FmButton, {
1053
- variant: "primary",
1054
- "prepend-icon": "download",
1055
- label: c(t)("menu.product_batch_image.download.action"),
1056
- disabled: !!p.value || !m.value.length,
1057
- onClick: U
1058
- }, null, 8, ["label", "disabled"])
1059
- ])
1060
- ]),
1061
- default: O(() => [
1062
- y("div", Ba, [
1063
- y("section", za, [
1064
- y("p", Ma, I(c(t)("menu.product_batch_image.download.formats")), 1),
1065
- y("div", Ta, [
1066
- (F(!0), T(Y, null, ie(_.value, (h) => (F(), L(c($).FmCheckbox, {
1067
- key: h.id,
1068
- "model-value": m.value.includes(h.id),
1069
- value: "",
1070
- label: h.label,
1071
- "onUpdate:modelValue": (d) => S(h.id, d)
1072
- }, null, 8, ["model-value", "label", "onUpdate:modelValue"]))), 128))
1073
- ]),
1074
- y("p", Ua, I(c(t)("menu.product_batch_image.download.formats_hint")), 1)
1075
- ]),
1076
- y("section", Aa, [
1077
- y("p", Oa, I(c(t)("menu.product_batch_image.download.images")), 1),
1078
- M(c($).FmRadioGroup, {
1079
- "model-value": g.value ? "cover" : "all",
1080
- class: "flex gap-16",
1081
- "onUpdate:modelValue": C[0] || (C[0] = (h) => g.value = h === "cover")
1082
- }, {
1083
- default: O(() => [
1084
- M(c($).FmRadio, {
1085
- value: "all",
1086
- label: c(t)("menu.product_batch_image.download.all_images", {
1087
- count: k.overview.download.allImages
1088
- })
1089
- }, null, 8, ["label"]),
1090
- M(c($).FmRadio, {
1091
- value: "cover",
1092
- label: c(t)("menu.product_batch_image.download.cover_only", {
1093
- count: k.overview.download.coverImages
1094
- })
1095
- }, null, 8, ["label"])
1096
- ]),
1097
- _: 1
1098
- }, 8, ["model-value"]),
1099
- k.overview.download.legacyProducts ? (F(), T("p", ja, I(c(t)("menu.product_batch_image.download.legacy_hint", {
1100
- count: k.overview.download.legacyProducts
1101
- })), 1)) : R("", !0)
1102
- ]),
1103
- M(c($).FmCard, {
1104
- variant: "outlined",
1105
- class: "flex flex-col gap-4 p-12"
1106
- }, {
1107
- default: O(() => [
1108
- y("code", Ra, I(c(t)("menu.product_batch_image.download.sample_archive")), 1),
1109
- (F(!0), T(Y, null, ie(u.value, (h) => (F(), T("code", {
1110
- key: h,
1111
- class: "fm-typo-en-body-sm-400"
1112
- }, I(h), 1))), 128))
1113
- ]),
1114
- _: 1
1115
- }),
1116
- y("p", La, I(c(t)("menu.product_batch_image.download.round_trip_hint")), 1),
1117
- p.value ? (F(), T("div", Ea, [
1118
- y("p", Va, I(c(t)("menu.product_batch_image.download.progress", {
1119
- done: p.value.done,
1120
- total: p.value.total
1121
- })), 1),
1122
- M(c($).FmProgressBar, {
1123
- value: p.value.total ? p.value.done / p.value.total * 100 : 0,
1124
- indeterminate: !p.value.total
1125
- }, null, 8, ["value", "indeterminate"])
1126
- ])) : R("", !0)
1127
- ])
1128
- ]),
1129
- _: 1
1130
- }));
1131
- }
1132
- }), Na = { class: "flex flex-wrap gap-4" }, Da = /* @__PURE__ */ ce({
1133
- __name: "BatchImageFormatChips",
1134
- props: {
1135
- formats: {}
1136
- },
1137
- setup(a) {
1138
- const e = a, { t: o } = ge(), n = {
1139
- uploaded: "is-uploaded",
1140
- file: "is-uploaded",
1141
- ai: "is-ai",
1142
- generating: "is-generating",
1143
- failed: "is-failed",
1144
- missing: "is-missing"
1145
- };
1146
- function t(i) {
1147
- switch (i) {
1148
- case "ai":
1149
- return o("menu.product_batch_image.format.ai");
1150
- case "generating":
1151
- return o("menu.product_batch_image.format.generating");
1152
- case "failed":
1153
- return o("menu.product_batch_image.format.failed");
1154
- case "missing":
1155
- return o("menu.product_batch_image.format.missing");
1156
- case "file":
1157
- return o("menu.product_batch_image.format.file");
1158
- default:
1159
- return "";
1160
- }
1161
- }
1162
- const s = () => e.formats.map((i) => {
1163
- const f = t(i.source);
1164
- return {
1165
- id: i.id,
1166
- label: f ? o("menu.product_batch_image.format.chip", {
1167
- label: i.label,
1168
- state: f
1169
- }) : i.label,
1170
- variant: n[i.source],
1171
- ratio: `${i.width} / ${i.height}`
1172
- };
1173
- });
1174
- return (i, f) => (F(), T("div", Na, [
1175
- (F(!0), T(Y, null, ie(s(), (m) => (F(), T("span", {
1176
- key: m.id,
1177
- class: Fe(["batch-format-chip fm-typo-en-body-sm-600", m.variant])
1178
- }, [
1179
- y("i", {
1180
- class: "batch-format-chip__ratio",
1181
- style: yt({ aspectRatio: m.ratio }),
1182
- "aria-hidden": "true"
1183
- }, null, 4),
1184
- He(" " + I(m.label), 1)
1185
- ], 2))), 128))
1186
- ]));
1187
- }
1188
- }), pt = /* @__PURE__ */ xt(Da, [["__scopeId", "data-v-ed54f76d"]]), qa = { class: "inline-flex items-center gap-4 whitespace-nowrap rounded-[6px] bg-fm-color-neutral-gray-100 py-[1px] pl-[6px] pr-8 fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, Dt = /* @__PURE__ */ ce({
1189
- __name: "BatchImageLegacyChip",
1190
- setup(a) {
1191
- const { t: e } = ge();
1192
- return (o, n) => (F(), T("span", qa, [
1193
- M(c($).FmIcon, {
1194
- name: "image",
1195
- outline: "",
1196
- color: "neutral-gray-400",
1197
- size: "sm"
1198
- }),
1199
- He(" " + I(c(e)("menu.product_batch_image.legacy_thumbnail")), 1)
1200
- ]));
1201
- }
1202
- }), Ga = ["src", "alt"], he = /* @__PURE__ */ ce({
1203
- __name: "BatchImageThumb",
1204
- props: {
1205
- src: { default: null },
1206
- alt: {},
1207
- size: { default: "md" }
1208
- },
1209
- setup(a) {
1210
- return (e, o) => (F(), L(c($).FmCard, {
1211
- variant: "outlined",
1212
- class: Fe([
1213
- "flex shrink-0 items-center justify-center overflow-hidden rounded-md",
1214
- e.size === "sm" ? "w-32 !h-32" : e.size === "lg" ? "w-64 !h-64" : "w-40 !h-40"
1215
- ])
1216
- }, {
1217
- default: O(() => [
1218
- e.src ? (F(), T("img", {
1219
- key: 0,
1220
- src: e.src,
1221
- alt: e.alt,
1222
- class: "h-full w-full object-cover"
1223
- }, null, 8, Ga)) : (F(), L(c($).FmIcon, {
1224
- key: 1,
1225
- name: "image",
1226
- outline: "",
1227
- color: "neutral-gray-300",
1228
- size: "sm"
1229
- }))
1230
- ]),
1231
- _: 1
1232
- }, 8, ["class"]));
1233
- }
1234
- }), Ha = /* @__PURE__ */ ce({
1235
- __name: "BatchImageBadge",
1236
- props: {
1237
- label: {},
1238
- variant: {}
1239
- },
1240
- setup(a) {
1241
- return (e, o) => (F(), T("span", {
1242
- class: Fe(["batch-image-badge", [
1243
- `is-${e.variant}`,
1244
- e.variant === "cover" ? "" : "fm-typo-en-body-sm-600"
1245
- ]])
1246
- }, I(e.label), 3));
1247
- }
1248
- }), _e = /* @__PURE__ */ xt(Ha, [["__scopeId", "data-v-10dcba04"]]), Wa = { class: "flex flex-col gap-4" }, Xa = { class: "fm-typo-en-title-sm-600" }, Ja = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ya = { class: "flex flex-col gap-16" }, Qa = { class: "flex flex-col gap-8" }, Za = { class: "flex justify-between fm-typo-en-body-md-400" }, eo = { class: "fm-typo-en-body-md-600" }, to = { class: "text-fm-color-typo-secondary" }, ao = { class: "flex items-start gap-12" }, oo = { class: "flex flex-col" }, no = { class: "fm-typo-en-body-md-600" }, ro = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, lo = { class: "flex w-full items-center justify-between gap-12" }, so = { class: "flex flex-col" }, io = { class: "fm-typo-en-body-md-600" }, co = {
1249
- key: 0,
1250
- class: "fm-typo-en-body-sm-400 text-fm-color-system-error-300"
1251
- }, uo = { class: "flex w-full items-center justify-between gap-12" }, mo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, po = /* @__PURE__ */ ce({
1252
- __name: "BatchImageProgressDialog",
1253
- props: {
1254
- progress: {}
1255
- },
1256
- emits: ["stop"],
1257
- setup(a, { emit: e }) {
1258
- const o = a, n = e, { t } = ge(), s = Ae(), i = D(
1259
- () => o.progress.totalFiles ? Math.round(
1260
- o.progress.uploadedFiles / o.progress.totalFiles * 100
1261
- ) : 0
1262
- ), f = D(() => {
1263
- const p = ["upload", "save", "cleanup"].indexOf(o.progress.step);
1264
- return [
1265
- {
1266
- key: "upload",
1267
- title: t("menu.product_batch_image.progress.step.upload"),
1268
- detail: t("menu.product_batch_image.progress.step.upload_detail", {
1269
- done: o.progress.finishedProducts,
1270
- total: o.progress.totalProducts
1271
- }),
1272
- state: p > 0 ? "done" : "now"
1273
- },
1274
- {
1275
- key: "save",
1276
- title: t("menu.product_batch_image.progress.step.save"),
1277
- detail: t("menu.product_batch_image.progress.step.save_detail"),
1278
- state: p > 1 ? "done" : p === 1 ? "now" : "next"
1279
- },
1280
- {
1281
- key: "generate",
1282
- title: t("menu.product_batch_image.progress.step.generate"),
1283
- detail: t("menu.product_batch_image.progress.step.generate_detail", {
1284
- count: o.progress.generatingFormats
1285
- }),
1286
- state: "next"
1287
- }
1288
- ];
1289
- });
1290
- function m(u, p, _) {
1291
- switch (u) {
1292
- case "done":
1293
- return t("menu.product_batch_image.progress.status.done");
1294
- case "failed":
1295
- return t("menu.product_batch_image.progress.status.failed");
1296
- case "skipped":
1297
- return t("menu.product_batch_image.progress.status.skipped");
1298
- case "uploading":
1299
- return t("menu.product_batch_image.progress.status.uploading", {
1300
- done: p,
1301
- total: _
1302
- });
1303
- default:
1304
- return t("menu.product_batch_image.progress.status.waiting");
1305
- }
1306
- }
1307
- const g = {
1308
- done: "success",
1309
- failed: "critical",
1310
- skipped: "neutral",
1311
- uploading: "info",
1312
- waiting: "neutral"
1313
- };
1314
- return (u, p) => (F(), L(c($).FmDialog, {
1315
- "model-value": !0,
1316
- "max-width": 620,
1317
- "close-button": !1
1318
- }, {
1319
- "dialog-header": O(() => [
1320
- y("div", Wa, [
1321
- y("p", Xa, I(c(t)("menu.product_batch_image.progress.title")), 1),
1322
- y("p", Ja, I(c(t)("menu.product_batch_image.progress.keep_open")), 1)
1323
- ])
1324
- ]),
1325
- "dialog-footer": O(() => [
1326
- y("div", uo, [
1327
- y("p", mo, I(c(t)("menu.product_batch_image.progress.stop_hint")), 1),
1328
- M(c($).FmButton, {
1329
- variant: "secondary",
1330
- disabled: u.progress.stopping || u.progress.step !== "upload",
1331
- label: u.progress.stopping ? c(t)("menu.product_batch_image.progress.stopping") : c(t)("menu.product_batch_image.progress.stop"),
1332
- onClick: p[0] || (p[0] = (_) => n("stop"))
1333
- }, null, 8, ["disabled", "label"])
1334
- ])
1335
- ]),
1336
- default: O(() => [
1337
- y("div", Ya, [
1338
- y("div", Qa, [
1339
- y("div", Za, [
1340
- y("span", eo, I(c(t)("menu.product_batch_image.progress.uploading")), 1),
1341
- y("span", to, I(c(t)("menu.product_batch_image.progress.counts", {
1342
- files: u.progress.uploadedFiles,
1343
- totalFiles: u.progress.totalFiles,
1344
- products: u.progress.finishedProducts,
1345
- totalProducts: u.progress.totalProducts
1346
- })), 1)
1347
- ]),
1348
- M(c($).FmProgressBar, { value: i.value }, null, 8, ["value"])
1349
- ]),
1350
- M(c($).FmList, null, {
1351
- default: O(() => [
1352
- (F(!0), T(Y, null, ie(f.value, (_) => (F(), L(c($).FmListItem, {
1353
- key: _.key,
1354
- class: "!px-0"
1355
- }, {
1356
- default: O(() => [
1357
- y("div", ao, [
1358
- M(c($).FmIcon, {
1359
- name: _.state === "done" ? "check_circle" : _.state === "now" ? "pending" : "radio_button_unchecked",
1360
- color: _.state === "done" ? "system-success-300" : _.state === "now" ? "primary" : "neutral-gray-300"
1361
- }, null, 8, ["name", "color"]),
1362
- y("div", oo, [
1363
- y("span", no, I(_.title), 1),
1364
- y("span", ro, I(_.detail), 1)
1365
- ])
1366
- ])
1367
- ]),
1368
- _: 2
1369
- }, 1024))), 128))
1370
- ]),
1371
- _: 1
1372
- }),
1373
- M(c($).FmList, {
1374
- separator: "",
1375
- class: "max-h-[240px] overflow-y-auto rounded-md border border-fm-color-neutral-gray-100"
1376
- }, {
1377
- default: O(() => [
1378
- (F(!0), T(Y, null, ie(u.progress.rows, (_) => (F(), L(c($).FmListItem, {
1379
- key: _.productId
1380
- }, {
1381
- default: O(() => [
1382
- y("div", lo, [
1383
- y("div", so, [
1384
- y("span", io, I(_.name), 1),
1385
- _.error ? (F(), T("span", co, I(c(s)(_.error)), 1)) : R("", !0)
1386
- ]),
1387
- M(_e, {
1388
- variant: g[_.status],
1389
- label: m(_.status, _.doneFiles, _.totalFiles)
1390
- }, null, 8, ["variant", "label"])
1391
- ])
1392
- ]),
1393
- _: 2
1394
- }, 1024))), 128))
1395
- ]),
1396
- _: 1
1397
- })
1398
- ])
1399
- ]),
1400
- _: 1
1401
- }));
1402
- }
1403
- }), fo = { class: "flex flex-col gap-16 py-16" }, go = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, vo = { class: "fm-typo-en-body-md-400" }, _o = { class: "fm-typo-en-body-md-400" }, ho = { class: "fm-typo-en-body-md-400" }, yo = {
1404
- key: 3,
1405
- class: "fm-typo-en-body-sm-400 text-fm-color-system-warning-300"
1406
- }, bo = { class: "grid grid-cols-2 gap-12 md:grid-cols-4" }, wo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ko = { class: "fm-typo-en-title-sm-600 tabular-nums" }, xo = {
1407
- key: 0,
1408
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
1409
- }, $o = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Fo = /* @__PURE__ */ ce({
1410
- __name: "BatchImageResult",
1411
- props: {
1412
- result: {},
1413
- sourceLabel: {}
1414
- },
1415
- emits: ["retry", "close"],
1416
- setup(a, { emit: e }) {
1417
- const o = a, n = e, { t } = ge(), s = Ae(), i = {
1418
- done: ["success", "menu.product_batch_image.result.status.done"],
1419
- generating: ["info", "menu.product_batch_image.result.status.generating"],
1420
- format_failed: [
1421
- "warning",
1422
- "menu.product_batch_image.result.status.format_failed"
1423
- ],
1424
- failed: ["critical", "menu.product_batch_image.result.status.failed"],
1425
- partial: ["warning", "menu.product_batch_image.result.status.partial"]
1426
- }, f = D(() => [
1427
- {
1428
- id: "product",
1429
- header: () => t("menu.product_batch_image.columns.product"),
1430
- enableSorting: !1,
1431
- cell: (g) => {
1432
- const u = g.row.original;
1433
- return x("div", { class: "flex items-center gap-8 py-8" }, [
1434
- x(he, { src: u.coverUrl, alt: u.name }),
1435
- x("div", { class: "flex flex-col" }, [
1436
- x("span", { class: "fm-typo-en-body-md-600" }, u.name),
1437
- u.code ? x(
1438
- "span",
1439
- {
1440
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
1441
- },
1442
- u.code
1443
- ) : null
1444
- ])
1445
- ]);
1446
- }
1447
- },
1448
- {
1449
- id: "images",
1450
- header: () => t("menu.product_batch_image.columns.images"),
1451
- size: 100,
1452
- enableSorting: !1,
1453
- cell: (g) => x(
1454
- "span",
1455
- { class: "fm-typo-en-body-md-400" },
1456
- String(g.row.original.imageCount)
1457
- )
1458
- },
1459
- {
1460
- id: "formats",
1461
- header: () => t("menu.product_batch_image.columns.formats"),
1462
- enableSorting: !1,
1463
- cell: (g) => {
1464
- const u = g.row.original;
1465
- return u.error ? x(
1466
- "span",
1467
- { class: "fm-typo-en-body-sm-400 text-fm-color-system-error-300" },
1468
- s(u.error)
1469
- ) : u.formats ? x(pt, { formats: u.formats }) : null;
1470
- }
1471
- },
1472
- {
1473
- id: "status",
1474
- header: () => t("menu.product_batch_image.result.columns.status"),
1475
- size: 170,
1476
- enableSorting: !1,
1477
- cell: (g) => {
1478
- const u = g.row.original, [p, _] = i[u.status];
1479
- return x(_e, { variant: p, label: t(_) });
1480
- }
1481
- }
1482
- ]), m = D(
1483
- () => o.result.failed.length ? [
1484
- {
1485
- label: t("menu.product_batch_image.result.retry", {
1486
- count: o.result.failed.length
1487
- }),
1488
- click: () => n("retry")
1489
- }
1490
- ] : []
1491
- );
1492
- return (g, u) => (F(), L(kt, {
1493
- show: !0,
1494
- title: c(t)("menu.product_batch_image.result.title"),
1495
- "primary-action": { label: c(t)("menu.product_batch_image.result.done") },
1496
- "secondary-actions": m.value,
1497
- onOnPrimary: u[0] || (u[0] = (p) => n("close")),
1498
- onOnCancel: u[1] || (u[1] = (p) => n("close"))
1499
- }, {
1500
- default: O(() => [
1501
- y("div", fo, [
1502
- y("p", go, I(g.sourceLabel), 1),
1503
- g.result.updated ? (F(), L(c($).FmCard, {
1504
- key: 0,
1505
- variant: "outlined",
1506
- class: "flex items-center gap-8 p-12"
1507
- }, {
1508
- default: O(() => [
1509
- M(c($).FmIcon, {
1510
- name: "check_circle",
1511
- color: "system-success-300"
1512
- }),
1513
- y("span", vo, I(c(t)("menu.product_batch_image.result.updated", {
1514
- count: g.result.updated
1515
- })), 1)
1516
- ]),
1517
- _: 1
1518
- })) : R("", !0),
1519
- g.result.saveError ? (F(), L(c($).FmCard, {
1520
- key: 1,
1521
- variant: "outlined",
1522
- class: "flex items-center gap-8 p-12"
1523
- }, {
1524
- default: O(() => [
1525
- M(c($).FmIcon, {
1526
- name: "error",
1527
- color: "system-error-300"
1528
- }),
1529
- y("span", _o, I(c(t)("menu.product_batch_image.result.save_failed", {
1530
- reason: c(s)(g.result.saveError)
1531
- })), 1)
1532
- ]),
1533
- _: 1
1534
- })) : g.result.failed.length ? (F(), L(c($).FmCard, {
1535
- key: 2,
1536
- variant: "outlined",
1537
- class: "flex items-center gap-8 p-12"
1538
- }, {
1539
- default: O(() => [
1540
- M(c($).FmIcon, {
1541
- name: "error",
1542
- color: "system-error-300"
1543
- }),
1544
- y("span", ho, I(c(t)("menu.product_batch_image.result.failed", {
1545
- count: g.result.failed.length
1546
- })), 1)
1547
- ]),
1548
- _: 1
1549
- })) : R("", !0),
1550
- g.result.cleanupFailed ? (F(), T("p", yo, I(c(t)("menu.product_image.error.cleanup_failed")), 1)) : R("", !0),
1551
- y("div", bo, [
1552
- (F(!0), T(Y, null, ie([
1553
- [
1554
- "menu.product_batch_image.result.kpi.updated",
1555
- String(g.result.updated),
1556
- null
1557
- ],
1558
- [
1559
- "menu.product_batch_image.result.kpi.images",
1560
- String(g.result.imagesUploaded),
1561
- null
1562
- ],
1563
- [
1564
- "menu.product_batch_image.result.kpi.formats",
1565
- String(g.result.formats.done),
1566
- c(t)("menu.product_batch_image.coverage.of_total", {
1567
- total: g.result.formats.total
1568
- })
1569
- ],
1570
- [
1571
- "menu.product_batch_image.result.kpi.skipped",
1572
- String(g.result.skippedFiles),
1573
- null
1574
- ]
1575
- ], (p) => (F(), L(c($).FmCard, {
1576
- key: p[0],
1577
- variant: "outlined",
1578
- class: "flex flex-col gap-4 p-12"
1579
- }, {
1580
- default: O(() => [
1581
- y("span", wo, I(c(t)(p[0])), 1),
1582
- y("span", ko, [
1583
- He(I(p[1]) + " ", 1),
1584
- p[2] ? (F(), T("small", xo, I(p[2]), 1)) : R("", !0)
1585
- ])
1586
- ]),
1587
- _: 2
1588
- }, 1024))), 128))
1589
- ]),
1590
- y("p", $o, I(c(t)("menu.product_batch_image.result.generation_hint")), 1),
1591
- M(c($).FmTable, {
1592
- "column-defs": f.value,
1593
- "row-data": [...g.result.rows],
1594
- "page-size": g.result.rows.length || 1,
1595
- "get-row-id": (p) => p.productId,
1596
- "hide-footer": "",
1597
- "shrink-at": !1
1598
- }, null, 8, ["column-defs", "row-data", "page-size", "get-row-id"])
1599
- ])
1600
- ]),
1601
- _: 1
1602
- }, 8, ["title", "primary-action", "secondary-actions"]));
1603
- }
1604
- }), Co = {
1605
- key: 0,
1606
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
1607
- }, Io = { class: "flex flex-col gap-16 py-16" }, So = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Bo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, zo = { class: "flex-1 fm-typo-en-body-md-400" }, Mo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, To = /* @__PURE__ */ ce({
1608
- __name: "BatchImageReview",
1609
- props: {
1610
- session: {},
1611
- view: {},
1612
- previews: {}
1613
- },
1614
- emits: ["back", "start", "crop"],
1615
- setup(a, { emit: e }) {
1616
- const o = a, n = e, { t } = ge(), s = Ae(), i = ee("ready"), f = D(() => [
1617
- {
1618
- value: "ready",
1619
- label: t("menu.product_batch_image.review.tabs.ready", {
1620
- count: o.view.counts.ready
1621
- })
1622
- },
1623
- {
1624
- value: "attention",
1625
- label: t("menu.product_batch_image.review.tabs.attention", {
1626
- count: o.view.counts.attentionOpen
1627
- })
1628
- },
1629
- {
1630
- value: "unmatched",
1631
- label: t("menu.product_batch_image.review.tabs.unmatched", {
1632
- count: o.view.counts.unmatchedOpen
1633
- })
1634
- }
1635
- ]), m = D(
1636
- () => {
1637
- var r;
1638
- return [
1639
- (r = o.view.source) == null ? void 0 : r.label,
1640
- o.view.via === "manifest" ? t("menu.product_batch_image.review.via_manifest") : t("menu.product_batch_image.review.via_name"),
1641
- o.view.via === "name" ? o.view.mode === "replace" ? t("menu.product_batch_image.setup.mode.replace") : t("menu.product_batch_image.setup.mode.append") : null,
1642
- o.view.generateMissing && o.view.via === "name" ? t("menu.product_batch_image.review.ai_fills") : null
1643
- ].filter(Boolean).join(t("menu.product_batch_image.separator"));
1644
- }
1645
- ), g = (r) => r.split("/").pop() ?? r;
1646
- function u(r) {
1647
- const l = r.change;
1648
- switch (l.kind) {
1649
- case "replace":
1650
- return t("menu.product_batch_image.review.change.replace", {
1651
- from: l.from,
1652
- to: l.to
1653
- });
1654
- case "replace_legacy":
1655
- return t("menu.product_batch_image.review.change.replace_legacy");
1656
- case "add":
1657
- return t("menu.product_batch_image.review.change.add", {
1658
- count: l.to
1659
- });
1660
- case "append":
1661
- return t("menu.product_batch_image.review.change.append", {
1662
- from: l.from,
1663
- to: l.to
1664
- });
1665
- case "update":
1666
- return t("menu.product_batch_image.review.change.update", {
1667
- count: l.files
1668
- });
1669
- }
1670
- }
1671
- const p = D(() => [
1672
- {
1673
- id: "include",
1674
- header: () => x($.FmCheckbox, {
1675
- modelValue: o.view.counts.included === o.view.counts.ready,
1676
- value: "",
1677
- "aria-label": t("menu.product_batch_image.review.include_all"),
1678
- "onUpdate:modelValue": (r) => o.session.setAllIncluded(r)
1679
- }),
1680
- size: 48,
1681
- enableSorting: !1,
1682
- cell: (r) => {
1683
- const l = r.row.original;
1684
- return x($.FmCheckbox, {
1685
- modelValue: l.included,
1686
- value: "",
1687
- "aria-label": t("menu.product_batch_image.review.include", {
1688
- name: l.name
1689
- }),
1690
- "onUpdate:modelValue": (b) => o.session.setIncluded(l.productId, b)
1691
- });
1692
- }
1693
- },
1694
- {
1695
- id: "product",
1696
- header: () => t("menu.product_batch_image.columns.product"),
1697
- size: 220,
1698
- enableSorting: !1,
1699
- cell: (r) => {
1700
- const l = r.row.original;
1701
- return x("div", { class: "flex flex-col gap-4 py-8" }, [
1702
- x("span", { class: "fm-typo-en-body-md-600" }, l.name),
1703
- l.code ? x(
1704
- "span",
1705
- {
1706
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
1707
- },
1708
- l.code
1709
- ) : null,
1710
- l.renamedFrom ? x(_e, {
1711
- variant: "info",
1712
- label: t("menu.product_batch_image.review.renamed", {
1713
- name: l.name
1714
- })
1715
- }) : null
1716
- ]);
1717
- }
1718
- },
1719
- {
1720
- id: "current",
1721
- header: () => t("menu.product_batch_image.review.columns.current"),
1722
- size: 160,
1723
- enableSorting: !1,
1724
- cell: (r) => {
1725
- const l = r.row.original;
1726
- return l.currentCount ? x("div", { class: "flex items-center" }, [
1727
- ...l.currentImageUrls.map(
1728
- (b, z) => x(he, {
1729
- key: b,
1730
- src: b,
1731
- alt: t("menu.product_batch_image.image_alt", {
1732
- name: l.name,
1733
- index: z + 1
1734
- }),
1735
- class: z ? "-ml-12" : ""
1736
- })
1737
- ),
1738
- l.currentLegacy ? x(Dt, { class: "ml-8" }) : null
1739
- ]) : x(
1740
- "span",
1741
- { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
1742
- t("menu.product_batch_image.no_image")
1743
- );
1744
- }
1745
- },
1746
- {
1747
- id: "next",
1748
- header: () => t("menu.product_batch_image.review.columns.next"),
1749
- enableSorting: !1,
1750
- cell: (r) => {
1751
- const l = r.row.original, b = l.changes.filter((w) => w.kind !== "new_image").map(
1752
- (w) => x(
1753
- "div",
1754
- { class: "flex items-center gap-8", key: w.fileKey },
1755
- [
1756
- x(he, {
1757
- src: o.previews.get(w.fileKey) ?? null,
1758
- alt: g(w.path),
1759
- size: "sm"
1760
- }),
1761
- x("div", { class: "flex flex-col" }, [
1762
- x(
1763
- "code",
1764
- { class: "fm-typo-en-body-sm-600" },
1765
- g(w.path)
1766
- ),
1767
- x(
1768
- "span",
1769
- {
1770
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
1771
- },
1772
- w.kind === "replace_original" ? w.regenerated ? t(
1773
- "menu.product_batch_image.review.replace_original_ai",
1774
- {
1775
- index: w.imageIndex,
1776
- count: w.regenerated
1777
- }
1778
- ) : t(
1779
- "menu.product_batch_image.review.replace_original",
1780
- {
1781
- index: w.imageIndex
1782
- }
1783
- ) : t("menu.product_batch_image.review.replace_format", {
1784
- index: w.imageIndex,
1785
- ratio: w.formatLabel ?? ""
1786
- })
1787
- )
1788
- ])
1789
- ]
1790
- )
1791
- ), z = l.newImages.map(
1792
- (w) => x(
1793
- $.FmCard,
1794
- {
1795
- key: w.fileKey,
1796
- variant: "outlined",
1797
- class: "flex gap-8 p-8"
1798
- },
1799
- () => [
1800
- x("div", { class: "relative" }, [
1801
- x(he, {
1802
- src: o.previews.get(w.fileKey) ?? null,
1803
- alt: g(w.fileName),
1804
- size: "lg"
1805
- }),
1806
- w.isCover ? x(_e, {
1807
- class: "absolute left-4 top-4",
1808
- variant: "cover",
1809
- label: t("menu.product_image.cover_badge")
1810
- }) : null
1811
- ]),
1812
- x("div", { class: "flex flex-col gap-4" }, [
1813
- x(
1814
- "code",
1815
- { class: "fm-typo-en-body-sm-600" },
1816
- t("menu.product_batch_image.review.new_image", {
1817
- index: w.position,
1818
- name: g(w.fileName)
1819
- })
1820
- ),
1821
- w.formats.length ? x(pt, { formats: w.formats }) : null
1822
- ])
1823
- ]
1824
- )
1825
- );
1826
- return x("div", { class: "flex flex-wrap gap-8 py-8" }, [
1827
- ...b,
1828
- ...z
1829
- ]);
1830
- }
1831
- },
1832
- {
1833
- id: "change",
1834
- header: () => t("menu.product_batch_image.review.columns.change"),
1835
- size: 170,
1836
- enableSorting: !1,
1837
- cell: (r) => {
1838
- const l = r.row.original;
1839
- return x("div", { class: "flex flex-col items-start gap-4 py-8" }, [
1840
- x(_e, {
1841
- variant: l.included ? l.change.kind === "add" ? "success" : "info" : "neutral",
1842
- label: l.included ? u(l) : t("menu.product_batch_image.review.excluded")
1843
- }),
1844
- l.included && l.removedImages > 0 ? x(
1845
- "span",
1846
- {
1847
- class: "fm-typo-en-body-sm-600 text-fm-color-system-warning-400"
1848
- },
1849
- t("menu.product_batch_image.review.images_removed", {
1850
- count: l.removedImages
1851
- })
1852
- ) : null
1853
- ]);
1854
- }
1855
- }
1856
- ]), _ = {
1857
- skip: "menu.product_batch_image.attention.actions.skip",
1858
- add_as_new_image: "menu.product_batch_image.attention.actions.add_as_new_image",
1859
- use_as_original: "menu.product_batch_image.attention.actions.use_as_original",
1860
- add_format: "menu.product_batch_image.attention.actions.add_format"
1861
- };
1862
- function S(r) {
1863
- return r.code ? t("menu.product_batch_image.product_option", {
1864
- name: r.name,
1865
- code: r.code
1866
- }) : r.name;
1867
- }
1868
- const U = ee(""), k = D(() => (o.view, o.session.productOptions(U.value).map((r) => ({
1869
- label: S(r),
1870
- value: r.productId
1871
- }))));
1872
- function C(r) {
1873
- return r && !k.value.some((l) => l.value === r.productId) ? [
1874
- { label: S(r), value: r.productId },
1875
- ...k.value
1876
- ] : k.value;
1877
- }
1878
- function h(r, l, b, z) {
1879
- return x("div", { class: "flex items-center gap-8 py-8" }, [
1880
- x(he, {
1881
- src: o.previews.get(r) ?? null,
1882
- alt: g(l)
1883
- }),
1884
- x("div", { class: "flex flex-col" }, [
1885
- x("code", { class: "fm-typo-en-body-sm-600 break-all" }, l),
1886
- b && z ? x(
1887
- "span",
1888
- { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
1889
- t("menu.product_batch_image.review.dimensions", {
1890
- width: b,
1891
- height: z
1892
- })
1893
- ) : null
1894
- ])
1895
- ]);
1896
- }
1897
- const d = D(() => [
1898
- {
1899
- id: "file",
1900
- header: () => t("menu.product_batch_image.review.columns.file"),
1901
- size: 280,
1902
- enableSorting: !1,
1903
- cell: (r) => {
1904
- const l = r.row.original;
1905
- return h(l.fileKey, l.path, l.width, l.height);
1906
- }
1907
- },
1908
- {
1909
- id: "product",
1910
- header: () => t("menu.product_batch_image.columns.product"),
1911
- size: 200,
1912
- enableSorting: !1,
1913
- cell: (r) => {
1914
- const l = r.row.original;
1915
- return x(
1916
- "span",
1917
- { class: "fm-typo-en-body-md-400" },
1918
- l.product ? S(l.product) : l.candidates.map(S).join(", ") || t("menu.catalog.empty_value")
1919
- );
1920
- }
1921
- },
1922
- {
1923
- id: "issue",
1924
- header: () => t("menu.product_batch_image.review.columns.issue"),
1925
- enableSorting: !1,
1926
- cell: (r) => {
1927
- const l = r.row.original;
1928
- return x("div", { class: "flex flex-col gap-4 py-8" }, [
1929
- x(
1930
- "span",
1931
- {
1932
- class: [
1933
- "fm-typo-en-body-md-600",
1934
- l.state === "fixed" ? "text-fm-color-system-success-300" : l.state === "skipped" ? "text-fm-color-typo-secondary" : ""
1935
- ]
1936
- },
1937
- s(l.title)
1938
- ),
1939
- x(
1940
- "span",
1941
- { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
1942
- s(l.detail)
1943
- )
1944
- ]);
1945
- }
1946
- },
1947
- {
1948
- id: "fix",
1949
- header: () => t("menu.product_batch_image.review.columns.fix"),
1950
- size: 320,
1951
- enableSorting: !1,
1952
- cell: (r) => {
1953
- const l = r.row.original;
1954
- return l.state !== "open" ? x("div", { class: "flex items-center gap-8" }, [
1955
- x(_e, {
1956
- variant: l.state === "fixed" ? "success" : "neutral",
1957
- label: l.state === "fixed" ? l.product && l.issue === "ambiguous" ? t("menu.product_batch_image.attention.assigned_to", {
1958
- name: S(l.product)
1959
- }) : t("menu.product_batch_image.attention.fixed") : t("menu.product_batch_image.attention.skipped.title")
1960
- }),
1961
- l.undoable ? x($.FmButton, {
1962
- variant: "tertiary",
1963
- label: t("menu.product_batch_image.attention.actions.undo"),
1964
- onClick: () => o.session.resolve(l.fileKey, null)
1965
- }) : null
1966
- ]) : l.issue === "ambiguous" ? x("div", { class: "flex items-center gap-8" }, [
1967
- x($.FmSelect, {
1968
- class: "flex-1",
1969
- modelValue: null,
1970
- items: l.candidates.map((b) => ({
1971
- label: S(b),
1972
- value: b.productId
1973
- })),
1974
- placeholder: t(
1975
- "menu.product_batch_image.attention.choose_product"
1976
- ),
1977
- "aria-label": t(
1978
- "menu.product_batch_image.attention.choose_product_for",
1979
- {
1980
- file: g(l.path)
1981
- }
1982
- ),
1983
- "onUpdate:modelValue": (b) => o.session.assign(l.fileKey, b)
1984
- }),
1985
- x($.FmButton, {
1986
- variant: "tertiary",
1987
- label: t(_.skip),
1988
- onClick: () => o.session.resolve(l.fileKey, "skip")
1989
- })
1990
- ]) : x("div", { class: "flex flex-wrap items-center gap-8" }, [
1991
- l.crop ? x($.FmButton, {
1992
- variant: "primary",
1993
- prependIcon: "crop",
1994
- label: t("menu.product_batch_image.attention.actions.crop", {
1995
- ratio: l.crop.label
1996
- }),
1997
- onClick: () => n("crop", l)
1998
- }) : null,
1999
- ...l.actions.map(
2000
- (b) => x($.FmButton, {
2001
- key: b,
2002
- variant: b === "skip" ? "tertiary" : "secondary",
2003
- label: t(_[b]),
2004
- onClick: () => o.session.resolve(l.fileKey, b)
2005
- })
2006
- )
2007
- ]);
2008
- }
2009
- }
2010
- ]), v = D(() => [
2011
- {
2012
- id: "file",
2013
- header: () => t("menu.product_batch_image.review.columns.file"),
2014
- size: 300,
2015
- enableSorting: !1,
2016
- cell: (r) => {
2017
- const l = r.row.original;
2018
- return h(l.fileKey, l.path, l.width, l.height);
2019
- }
2020
- },
2021
- {
2022
- id: "reason",
2023
- header: () => t("menu.product_batch_image.review.columns.reason"),
2024
- enableSorting: !1,
2025
- cell: (r) => {
2026
- const l = r.row.original;
2027
- return x("div", { class: "flex flex-col gap-4 py-8" }, [
2028
- x("span", { class: "fm-typo-en-body-md-600" }, s(l.reason)),
2029
- x(
2030
- "span",
2031
- { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
2032
- s(l.detail)
2033
- )
2034
- ]);
2035
- }
2036
- },
2037
- {
2038
- id: "assign",
2039
- header: () => t("menu.product_batch_image.review.columns.assign"),
2040
- size: 360,
2041
- enableSorting: !1,
2042
- cell: (r) => {
2043
- var b;
2044
- const l = r.row.original;
2045
- return x("div", { class: "flex items-center gap-8" }, [
2046
- x($.FmSelect, {
2047
- class: "flex-1",
2048
- modelValue: ((b = l.assigned) == null ? void 0 : b.productId) ?? null,
2049
- items: C(l.assigned),
2050
- searchable: !0,
2051
- onSearch: async (z) => {
2052
- U.value = z;
2053
- },
2054
- clearable: !0,
2055
- placeholder: t("menu.product_batch_image.attention.choose_product"),
2056
- "aria-label": t(
2057
- "menu.product_batch_image.attention.choose_product_for",
2058
- {
2059
- file: g(l.path)
2060
- }
2061
- ),
2062
- "onUpdate:modelValue": (z) => o.session.assign(l.fileKey, z ?? null)
2063
- }),
2064
- l.assigned ? x(_e, {
2065
- variant: "success",
2066
- label: t("menu.product_batch_image.unmatched.assigned")
2067
- }) : l.suggestion ? x($.FmButton, {
2068
- variant: "secondary",
2069
- label: t("menu.product_batch_image.unmatched.use"),
2070
- onClick: () => o.session.acceptSuggestions([l.fileKey])
2071
- }) : null
2072
- ]);
2073
- }
2074
- }
2075
- ]);
2076
- return (r, l) => (F(), L(kt, {
2077
- show: !0,
2078
- title: c(t)("menu.product_batch_image.review.title"),
2079
- "primary-action": {
2080
- label: c(t)("menu.product_batch_image.review.start", {
2081
- count: r.view.counts.included
2082
- }),
2083
- disabled: r.view.start.state !== "allowed"
2084
- },
2085
- "secondary-actions": [
2086
- { label: c(t)("menu.common.actions.back"), click: () => n("back") }
2087
- ],
2088
- onOnPrimary: l[2] || (l[2] = (b) => n("start")),
2089
- onOnCancel: l[3] || (l[3] = (b) => n("back"))
2090
- }, {
2091
- "append-title": O(() => [
2092
- r.view.counts.attentionOpen ? (F(), T("span", Co, I(c(t)("menu.product_batch_image.review.unresolved_skipped", {
2093
- count: r.view.counts.attentionOpen
2094
- })), 1)) : R("", !0)
2095
- ]),
2096
- default: O(() => [
2097
- y("div", Io, [
2098
- y("p", So, I(m.value), 1),
2099
- M(c($).FmTabs, {
2100
- "model-value": i.value,
2101
- items: f.value,
2102
- "onUpdate:modelValue": l[0] || (l[0] = (b) => i.value = b)
2103
- }, null, 8, ["model-value", "items"]),
2104
- i.value === "ready" ? (F(), T(Y, { key: 0 }, [
2105
- y("p", Bo, I(c(t)("menu.product_batch_image.review.legend")), 1),
2106
- M(c($).FmTable, {
2107
- "column-defs": p.value,
2108
- "row-data": [...r.view.ready],
2109
- "page-size": r.view.ready.length || 1,
2110
- "get-row-id": (b) => b.productId,
2111
- "hide-footer": "",
2112
- "shrink-at": !1
2113
- }, null, 8, ["column-defs", "row-data", "page-size", "get-row-id"])
2114
- ], 64)) : i.value === "attention" ? (F(), L(c($).FmTable, {
2115
- key: 1,
2116
- "column-defs": d.value,
2117
- "row-data": [...r.view.attention],
2118
- "page-size": r.view.attention.length || 1,
2119
- "get-row-id": (b) => b.fileKey,
2120
- "hide-footer": "",
2121
- "shrink-at": !1
2122
- }, null, 8, ["column-defs", "row-data", "page-size", "get-row-id"])) : (F(), T(Y, { key: 2 }, [
2123
- r.view.counts.nearMatches ? (F(), L(c($).FmCard, {
2124
- key: 0,
2125
- variant: "outlined",
2126
- class: "flex items-center gap-12 p-12"
2127
- }, {
2128
- default: O(() => [
2129
- M(c($).FmIcon, {
2130
- name: "info",
2131
- outline: "",
2132
- color: "system-info-300"
2133
- }),
2134
- y("p", zo, I(c(t)("menu.product_batch_image.unmatched.near_matches", {
2135
- count: r.view.counts.nearMatches
2136
- })), 1),
2137
- M(c($).FmButton, {
2138
- variant: "secondary",
2139
- label: c(t)("menu.product_batch_image.unmatched.use_all"),
2140
- onClick: l[1] || (l[1] = (b) => r.session.acceptSuggestions())
2141
- }, null, 8, ["label"])
2142
- ]),
2143
- _: 1
2144
- })) : R("", !0),
2145
- M(c($).FmTable, {
2146
- "column-defs": v.value,
2147
- "row-data": [...r.view.unmatched],
2148
- "page-size": r.view.unmatched.length || 1,
2149
- "get-row-id": (b) => b.fileKey,
2150
- "hide-footer": "",
2151
- "shrink-at": !1
2152
- }, null, 8, ["column-defs", "row-data", "page-size", "get-row-id"]),
2153
- y("p", Mo, I(c(t)("menu.product_batch_image.unmatched.hint")), 1)
2154
- ], 64))
2155
- ])
2156
- ]),
2157
- _: 1
2158
- }, 8, ["title", "primary-action", "secondary-actions"]));
2159
- }
2160
- }), Uo = { class: "flex flex-col gap-4" }, Ao = { class: "fm-typo-en-title-md-600" }, Oo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, jo = { class: "flex flex-col gap-24" }, Ro = { class: "flex flex-col gap-8" }, Lo = { class: "fm-typo-en-body-lg-600" }, Eo = { class: "flex flex-1 flex-col gap-4" }, Vo = { class: "fm-typo-en-body-md-600" }, Po = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ko = {
2161
- key: 0,
2162
- class: "flex flex-col gap-4"
2163
- }, No = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Do = { class: "flex flex-1 flex-col gap-4" }, qo = { class: "fm-typo-en-body-md-600" }, Go = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ho = { class: "fm-typo-en-body-md-400" }, Wo = { class: "grid grid-cols-4 gap-8" }, Xo = { class: "fm-typo-en-title-sm-600 tabular-nums" }, Jo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Yo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Qo = {
2164
- key: 0,
2165
- class: "fm-typo-en-body-md-400 text-fm-color-system-warning-300"
2166
- }, Zo = { class: "grid grid-cols-4 gap-8" }, en = { class: "fm-typo-en-title-sm-600 tabular-nums" }, tn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, an = { class: "flex flex-col gap-8" }, on = { class: "fm-typo-en-body-lg-600" }, nn = { class: "fm-typo-en-body-sm-600" }, rn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ln = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, sn = { class: "flex flex-col gap-8" }, cn = { class: "fm-typo-en-body-lg-600" }, un = {
2167
- key: 1,
2168
- class: "flex flex-col gap-8"
2169
- }, mn = { class: "fm-typo-en-body-lg-600" }, dn = { class: "flex w-full items-center justify-end gap-8" }, pn = { class: "mr-auto fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, fn = /* @__PURE__ */ ce({
2170
- __name: "BatchImageUpdateSheet",
2171
- props: {
2172
- session: {},
2173
- view: {},
2174
- productCount: {},
2175
- reading: {}
2176
- },
2177
- emits: ["pick", "clear", "review", "cancel"],
2178
- setup(a, { emit: e }) {
2179
- const o = a, n = e, { t, n: s, d: i } = ge(), f = ee(null), m = ee(null), g = ee(!1);
2180
- function u(d, v) {
2181
- var b;
2182
- const r = d.length === 1 && /\.zip$/i.test(d[0].path), l = (b = d[0]) != null && b.path.includes("/") ? d[0].path.split("/")[0] : null;
2183
- return {
2184
- label: r ? d[0].file.name : l || t("menu.product_batch_image.setup.files_label", {
2185
- count: d.length
2186
- }),
2187
- kind: r ? "zip" : l ? "folder" : v
2188
- };
2189
- }
2190
- function p(d, v) {
2191
- const r = d.target, l = Vt(r.files ?? []);
2192
- r.value = "", n("pick", l, u(l, v));
2193
- }
2194
- async function _(d) {
2195
- if (g.value = !1, !d.dataTransfer) return;
2196
- const v = await ya(d.dataTransfer);
2197
- n("pick", v, u(v, "files"));
2198
- }
2199
- const S = D(() => {
2200
- const d = t("menu.product_batch_image.setup.naming.sample_name"), v = t("menu.product_batch_image.setup.naming.sample_folder"), r = (l, b) => t("menu.product_batch_image.setup.naming.example_file", {
2201
- name: l,
2202
- suffix: b
2203
- });
2204
- return [
2205
- [r(d, ".jpg"), t("menu.product_batch_image.setup.naming.original")],
2206
- [
2207
- r(d, "@16x9.jpg"),
2208
- t("menu.product_batch_image.setup.naming.format")
2209
- ],
2210
- [
2211
- r(d, " #2.jpg"),
2212
- t("menu.product_batch_image.setup.naming.second")
2213
- ],
2214
- [
2215
- r(v, "/2@4x3.jpg"),
2216
- t("menu.product_batch_image.setup.naming.folder")
2217
- ]
2218
- ];
2219
- }), U = (d) => s(Math.round(d / 1024 / 1024 * 10) / 10), k = D(
2220
- () => !!o.view.source && !o.reading && (o.view.counts.ready > 0 || o.view.attention.length > 0 || o.view.unmatched.length > 0)
2221
- ), C = D(
2222
- () => o.view.via === "manifest" ? t("menu.product_batch_image.setup.review_changes", {
2223
- count: o.view.summary.changed + o.view.summary.newFiles
2224
- }) : t("menu.product_batch_image.setup.review_products", {
2225
- count: o.view.summary.matchedProducts
2226
- })
2227
- ), h = D(
2228
- () => o.view.manifestExportedAt ? i(new Date(o.view.manifestExportedAt)) : ""
2229
- );
2230
- return (d, v) => (F(), L(c($).FmSideSheet, {
2231
- "model-value": !0,
2232
- "max-width": 560,
2233
- "dismiss-away": "",
2234
- "onUpdate:modelValue": v[12] || (v[12] = (r) => !r && n("cancel"))
2235
- }, {
2236
- "side-sheet-header": O(() => [
2237
- y("div", Uo, [
2238
- y("p", Ao, I(c(t)("menu.product_batch_image.setup.title")), 1),
2239
- y("p", Oo, I(c(t)("menu.product_batch_image.scope.all", { count: d.productCount })), 1)
2240
- ])
2241
- ]),
2242
- "side-sheet-footer": O(() => [
2243
- y("div", dn, [
2244
- y("p", pn, I(c(t)("menu.product_batch_image.setup.no_changes_yet")), 1),
2245
- M(c($).FmButton, {
2246
- class: "shrink-0",
2247
- variant: "tertiary",
2248
- label: c(t)("menu.common.actions.cancel"),
2249
- onClick: v[10] || (v[10] = (r) => n("cancel"))
2250
- }, null, 8, ["label"]),
2251
- M(c($).FmButton, {
2252
- class: "shrink-0",
2253
- variant: "primary",
2254
- label: C.value,
2255
- disabled: !k.value,
2256
- onClick: v[11] || (v[11] = (r) => n("review"))
2257
- }, null, 8, ["label", "disabled"])
2258
- ])
2259
- ]),
2260
- default: O(() => [
2261
- y("div", jo, [
2262
- y("section", Ro, [
2263
- y("p", Lo, I(c(t)("menu.product_batch_image.setup.files")), 1),
2264
- y("div", {
2265
- class: Fe([
2266
- "flex items-center gap-12 rounded-md border border-dashed p-16",
2267
- g.value ? "border-fm-color-primary" : "border-fm-color-neutral-gray-300"
2268
- ]),
2269
- onDragleave: v[4] || (v[4] = Je((r) => g.value = !1, ["prevent"])),
2270
- onDragover: v[5] || (v[5] = Je((r) => g.value = !0, ["prevent"])),
2271
- onDrop: Je(_, ["prevent"])
2272
- }, [
2273
- M(c($).FmIcon, {
2274
- name: "cloud_upload",
2275
- outline: "",
2276
- color: "primary"
2277
- }),
2278
- y("div", Eo, [
2279
- y("p", Vo, I(c(t)("menu.product_batch_image.setup.drop_hint")), 1),
2280
- y("p", Po, I(c(t)("menu.product_batch_image.setup.accepts")), 1)
2281
- ]),
2282
- M(c($).FmButton, {
2283
- variant: "secondary",
2284
- label: c(t)("menu.product_batch_image.setup.choose_files"),
2285
- onClick: v[0] || (v[0] = (r) => {
2286
- var l;
2287
- return (l = f.value) == null ? void 0 : l.click();
2288
- })
2289
- }, null, 8, ["label"]),
2290
- M(c($).FmButton, {
2291
- variant: "secondary",
2292
- "prepend-icon": "folder",
2293
- label: c(t)("menu.product_batch_image.setup.choose_folder"),
2294
- onClick: v[1] || (v[1] = (r) => {
2295
- var l;
2296
- return (l = m.value) == null ? void 0 : l.click();
2297
- })
2298
- }, null, 8, ["label"]),
2299
- y("input", {
2300
- ref_key: "fileInput",
2301
- ref: f,
2302
- class: "hidden",
2303
- type: "file",
2304
- multiple: "",
2305
- accept: "image/*,.zip,application/zip",
2306
- onChange: v[2] || (v[2] = (r) => p(r, "files"))
2307
- }, null, 544),
2308
- y("input", {
2309
- ref_key: "folderInput",
2310
- ref: m,
2311
- class: "hidden",
2312
- type: "file",
2313
- webkitdirectory: "",
2314
- onChange: v[3] || (v[3] = (r) => p(r, "folder"))
2315
- }, null, 544)
2316
- ], 34),
2317
- d.reading ? (F(), T("div", Ko, [
2318
- y("p", No, I(c(t)("menu.product_batch_image.setup.reading", {
2319
- done: d.reading.done,
2320
- total: d.reading.total
2321
- })), 1),
2322
- M(c($).FmProgressBar, {
2323
- value: d.reading.total ? d.reading.done / d.reading.total * 100 : 0,
2324
- indeterminate: !d.reading.total
2325
- }, null, 8, ["value", "indeterminate"])
2326
- ])) : R("", !0),
2327
- d.view.source && !d.reading ? (F(), L(c($).FmCard, {
2328
- key: 1,
2329
- variant: "outlined",
2330
- class: "flex items-center gap-12 p-12"
2331
- }, {
2332
- default: O(() => [
2333
- M(c($).FmIcon, {
2334
- name: d.view.source.kind === "folder" ? "folder" : "folder_zip",
2335
- outline: "",
2336
- color: "neutral-gray-400"
2337
- }, null, 8, ["name"]),
2338
- y("div", Do, [
2339
- y("p", qo, I(d.view.source.label), 1),
2340
- y("p", Go, I(c(t)("menu.product_batch_image.setup.source_meta", {
2341
- size: U(d.view.source.totalBytes),
2342
- count: d.view.source.fileCount,
2343
- ignored: d.view.source.ignoredCount
2344
- })), 1)
2345
- ]),
2346
- M(c($).FmButton, {
2347
- variant: "tertiary",
2348
- label: c(t)("menu.common.actions.remove"),
2349
- onClick: v[6] || (v[6] = (r) => n("clear"))
2350
- }, null, 8, ["label"])
2351
- ]),
2352
- _: 1
2353
- })) : R("", !0)
2354
- ]),
2355
- d.view.source && !d.reading ? (F(), T(Y, { key: 0 }, [
2356
- d.view.via === "manifest" ? (F(), T(Y, { key: 0 }, [
2357
- M(c($).FmCard, {
2358
- variant: "outlined",
2359
- class: "flex items-start gap-8 p-12"
2360
- }, {
2361
- default: O(() => [
2362
- M(c($).FmIcon, {
2363
- name: "check_circle",
2364
- color: "system-success-300"
2365
- }),
2366
- y("p", Ho, I(c(t)("menu.product_batch_image.setup.manifest_found", {
2367
- date: h.value
2368
- })), 1)
2369
- ]),
2370
- _: 1
2371
- }),
2372
- y("div", Wo, [
2373
- (F(!0), T(Y, null, ie([
2374
- [
2375
- d.view.summary.changed,
2376
- "menu.product_batch_image.setup.stat.changed"
2377
- ],
2378
- [
2379
- d.view.summary.unchanged,
2380
- "menu.product_batch_image.setup.stat.unchanged"
2381
- ],
2382
- [
2383
- d.view.summary.newFiles,
2384
- "menu.product_batch_image.setup.stat.new_files"
2385
- ],
2386
- [
2387
- d.view.summary.cannotMatch,
2388
- "menu.product_batch_image.setup.stat.cannot_match"
2389
- ]
2390
- ], (r) => (F(), T("div", {
2391
- key: r[1],
2392
- class: Fe([
2393
- "flex flex-col gap-2 rounded-[8px] px-12 py-8",
2394
- r[0] > 0 && r[1] === "menu.product_batch_image.setup.stat.cannot_match" ? "bg-fm-color-system-warning-100 text-fm-color-system-warning-400" : "bg-fm-color-neutral-gray-100"
2395
- ])
2396
- }, [
2397
- y("span", Xo, I(r[0]), 1),
2398
- y("span", Jo, I(c(t)(r[1])), 1)
2399
- ], 2))), 128))
2400
- ]),
2401
- d.view.formatsEnabled ? (F(), L(c($).FmCheckbox, {
2402
- key: 0,
2403
- "model-value": d.view.redoAi,
2404
- value: "",
2405
- label: c(t)("menu.product_batch_image.setup.redo_ai"),
2406
- sublabel: c(t)("menu.product_batch_image.setup.redo_ai_hint"),
2407
- "onUpdate:modelValue": v[7] || (v[7] = (r) => d.session.setRedoAi(r))
2408
- }, null, 8, ["model-value", "label", "sublabel"])) : R("", !0),
2409
- y("p", Yo, I(c(t)("menu.product_batch_image.setup.in_place_hint")), 1)
2410
- ], 64)) : (F(), T(Y, { key: 1 }, [
2411
- d.view.foreignManifest ? (F(), T("p", Qo, I(c(t)("menu.product_batch_image.setup.foreign_manifest")), 1)) : R("", !0),
2412
- y("div", Zo, [
2413
- (F(!0), T(Y, null, ie([
2414
- [
2415
- d.view.summary.matchedProducts,
2416
- "menu.product_batch_image.setup.stat.matched"
2417
- ],
2418
- [
2419
- d.view.summary.images,
2420
- "menu.product_batch_image.setup.stat.images"
2421
- ],
2422
- [
2423
- d.view.summary.ownFormatFiles,
2424
- "menu.product_batch_image.setup.stat.own_formats"
2425
- ],
2426
- [
2427
- d.view.summary.toCheck,
2428
- "menu.product_batch_image.setup.stat.to_check"
2429
- ]
2430
- ], (r) => (F(), T("div", {
2431
- key: r[1],
2432
- class: Fe([
2433
- "flex flex-col gap-2 rounded-[8px] px-12 py-8",
2434
- r[0] > 0 && r[1] === "menu.product_batch_image.setup.stat.to_check" ? "bg-fm-color-system-warning-100 text-fm-color-system-warning-400" : "bg-fm-color-neutral-gray-100"
2435
- ])
2436
- }, [
2437
- y("span", en, I(r[0]), 1),
2438
- y("span", tn, I(c(t)(r[1])), 1)
2439
- ], 2))), 128))
2440
- ]),
2441
- y("section", an, [
2442
- y("p", on, I(c(t)("menu.product_batch_image.setup.naming_title")), 1),
2443
- M(c($).FmCard, {
2444
- variant: "outlined",
2445
- class: "flex flex-col gap-4 p-12"
2446
- }, {
2447
- default: O(() => [
2448
- (F(!0), T(Y, null, ie(S.value, (r) => (F(), T("div", {
2449
- key: r[0],
2450
- class: "flex justify-between gap-12"
2451
- }, [
2452
- y("code", nn, I(r[0]), 1),
2453
- y("span", rn, I(r[1]), 1)
2454
- ]))), 128))
2455
- ]),
2456
- _: 1
2457
- }),
2458
- y("p", ln, I(c(t)("menu.product_batch_image.setup.naming_hint")), 1)
2459
- ]),
2460
- y("section", sn, [
2461
- y("p", cn, I(c(t)("menu.product_batch_image.setup.existing_title")), 1),
2462
- M(c($).FmRadioGroup, {
2463
- "model-value": d.view.mode,
2464
- class: "flex flex-col gap-8",
2465
- "onUpdate:modelValue": v[8] || (v[8] = (r) => d.session.setMode(r))
2466
- }, {
2467
- default: O(() => [
2468
- M(c($).FmRadio, {
2469
- value: "replace",
2470
- label: c(t)("menu.product_batch_image.setup.mode.replace"),
2471
- sublabel: c(t)("menu.product_batch_image.setup.mode.replace_hint")
2472
- }, null, 8, ["label", "sublabel"]),
2473
- M(c($).FmRadio, {
2474
- value: "append",
2475
- label: c(t)("menu.product_batch_image.setup.mode.append"),
2476
- sublabel: c(t)("menu.product_batch_image.setup.mode.append_hint")
2477
- }, null, 8, ["label", "sublabel"])
2478
- ]),
2479
- _: 1
2480
- }, 8, ["model-value"])
2481
- ]),
2482
- d.view.formatsEnabled ? (F(), T("section", un, [
2483
- y("p", mn, I(c(t)("menu.product_batch_image.setup.missing_title")), 1),
2484
- M(c($).FmCheckbox, {
2485
- "model-value": d.view.generateMissing,
2486
- value: "",
2487
- label: c(t)("menu.product_batch_image.setup.generate_missing", {
2488
- count: d.view.summary.formatsToGenerate
2489
- }),
2490
- sublabel: c(t)("menu.product_batch_image.setup.generate_missing_hint", {
2491
- required: d.view.requiredFormats.join(", "),
2492
- menu: d.view.menuFormats.join(", ") || c(t)("menu.catalog.empty_value")
2493
- }),
2494
- "onUpdate:modelValue": v[9] || (v[9] = (r) => d.session.setGenerateMissing(r))
2495
- }, null, 8, ["model-value", "label", "sublabel"])
2496
- ])) : R("", !0)
2497
- ], 64))
2498
- ], 64)) : R("", !0)
2499
- ])
2500
- ]),
2501
- _: 1
2502
- }));
2503
- }
2504
- }), gn = /* @__PURE__ */ ce({
2505
- __name: "BatchImageUpdateFlow",
2506
- emits: ["close"],
2507
- setup(a, { emit: e }) {
2508
- const o = e, { t: n } = ge(), t = bt(), s = lt(), i = s.productBatchImage.openImport(), f = Ze(i), m = D(
2509
- () => f.value.status === "ready" ? f.value.value : null
2510
- ), g = Ze(s.productBatchImage.overview), u = D(
2511
- () => g.value.status === "ready" ? g.value.value.productCount : 0
2512
- ), p = ee("setup"), _ = qt(/* @__PURE__ */ new Map()), S = ee(null);
2513
- async function U(l, b) {
2514
- if (l.length) {
2515
- S.value = { done: 0, total: 0 };
2516
- try {
2517
- const z = await ka(l, b, (w, B) => {
2518
- S.value = { done: w, total: B };
2519
- });
2520
- Qe(_.value), _.value = z.previews, i.setSource(z.source);
2521
- } catch {
2522
- t.open({
2523
- type: "error",
2524
- title: n("menu.product_batch_image.setup.read_failed"),
2525
- position: Ne.BOTTOM
2526
- });
2527
- } finally {
2528
- S.value = null;
2529
- }
2530
- }
2531
- }
2532
- function k() {
2533
- i.clearSource(), Qe(_.value), _.value = /* @__PURE__ */ new Map();
2534
- }
2535
- async function C() {
2536
- var b;
2537
- const l = await i.start();
2538
- l.kind === "rejected" && t.open({
2539
- type: "error",
2540
- title: n(((b = l.issues[0]) == null ? void 0 : b.code) ?? "menu.error.unexpected"),
2541
- position: Ne.BOTTOM
2542
- });
2543
- }
2544
- const h = ee(null);
2545
- async function d(l) {
2546
- const b = _.value.get(l.fileKey);
2547
- if (!b || !l.crop) return;
2548
- const z = await (await fetch(b)).blob();
2549
- h.value = {
2550
- row: l,
2551
- file: new File([z], l.path.split("/").pop() ?? "image.jpg", {
2552
- type: z.type || "image/jpeg"
2553
- })
2554
- };
2555
- }
2556
- function v(l) {
2557
- const b = h.value;
2558
- if (h.value = null, !b || !l) return;
2559
- const z = new Map(_.value), w = z.get(b.row.fileKey);
2560
- w && URL.revokeObjectURL(w), z.set(b.row.fileKey, URL.createObjectURL(l.blob)), _.value = z, i.replaceFile(b.row.fileKey, xa(l));
2561
- }
2562
- function r() {
2563
- var l;
2564
- ((l = m.value) == null ? void 0 : l.phase) !== "running" && o("close");
2565
- }
2566
- return Gt(() => {
2567
- i.dispose(), Qe(_.value);
2568
- }), (l, b) => {
2569
- var z, w, B, j;
2570
- return m.value ? (F(), T(Y, { key: 0 }, [
2571
- m.value.phase === "draft" && p.value === "setup" ? (F(), L(fn, {
2572
- key: 0,
2573
- session: c(i),
2574
- view: m.value,
2575
- "product-count": u.value,
2576
- reading: S.value,
2577
- onPick: U,
2578
- onClear: k,
2579
- onReview: b[0] || (b[0] = (A) => p.value = "review"),
2580
- onCancel: r
2581
- }, null, 8, ["session", "view", "product-count", "reading"])) : R("", !0),
2582
- m.value.phase !== "finished" && p.value === "review" ? (F(), L(To, {
2583
- key: 1,
2584
- session: c(i),
2585
- view: m.value,
2586
- previews: _.value,
2587
- onBack: b[1] || (b[1] = (A) => p.value = "setup"),
2588
- onStart: C,
2589
- onCrop: d
2590
- }, null, 8, ["session", "view", "previews"])) : R("", !0),
2591
- m.value.phase === "running" && m.value.progress ? (F(), L(po, {
2592
- key: 2,
2593
- progress: m.value.progress,
2594
- onStop: b[2] || (b[2] = (A) => c(i).stop())
2595
- }, null, 8, ["progress"])) : R("", !0),
2596
- m.value.phase === "finished" && m.value.result ? (F(), L(Fo, {
2597
- key: 3,
2598
- result: m.value.result,
2599
- "source-label": ((z = m.value.source) == null ? void 0 : z.label) ?? "",
2600
- onRetry: b[3] || (b[3] = (A) => c(i).retryFailed()),
2601
- onClose: r
2602
- }, null, 8, ["result", "source-label"])) : R("", !0),
2603
- h.value ? (F(), L(Yt, {
2604
- key: 4,
2605
- file: h.value.file,
2606
- "aspect-ratio": ((w = h.value.row.crop) == null ? void 0 : w.aspectRatio) ?? null,
2607
- "ratio-label": ((B = h.value.row.crop) == null ? void 0 : B.label) ?? null,
2608
- hint: c(n)("menu.product_batch_image.attention.crop_hint", {
2609
- ratio: ((j = h.value.row.crop) == null ? void 0 : j.label) ?? ""
2610
- }),
2611
- mode: "upload",
2612
- onCancel: b[4] || (b[4] = (A) => h.value = null),
2613
- onConfirm: v
2614
- }, null, 8, ["file", "aspect-ratio", "ratio-label", "hint"])) : R("", !0)
2615
- ], 64)) : R("", !0);
2616
- };
2617
- }
2618
- }), vn = { class: "ml-auto flex items-center gap-8" }, _n = {
2619
- key: 0,
2620
- class: "flex justify-center py-48"
2621
- }, hn = {
2622
- key: 1,
2623
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
2624
- }, yn = {
2625
- key: 2,
2626
- class: "flex flex-col gap-16"
2627
- }, bn = {
2628
- key: 0,
2629
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
2630
- }, wn = { class: "flex flex-wrap items-center gap-12" }, kn = { class: "w-[320px]" }, xn = { class: "min-w-[240px] flex-1" }, $n = { class: "whitespace-nowrap rounded-lg bg-fm-color-neutral-gray-100 px-12 py-8 fm-typo-en-body-md-600" }, Fn = { class: "overflow-hidden rounded-[10px] border border-solid border-fm-color-neutral-gray-200" }, Cn = { class: "-mb-px -mr-px grid grid-cols-[repeat(auto-fit,minmax(160px,1fr))]" }, In = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Sn = { class: "fm-typo-en-title-sm-600 tabular-nums" }, Bn = {
2631
- key: 0,
2632
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
2633
- }, zn = {
2634
- key: 0,
2635
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
2636
- }, Mn = {
2637
- class: "mt-auto flex h-4 overflow-hidden rounded-full bg-fm-color-neutral-gray-100",
2638
- "aria-hidden": "true"
2639
- }, En = /* @__PURE__ */ ce({
2640
- __name: "ProductInternalTools",
2641
- setup(a) {
2642
- const { t: e } = ge(), o = Ae(), t = lt().productBatchImage, s = Ze(t.overview), i = D(
2643
- () => s.value.status === "ready" ? s.value.value : null
2644
- ), f = ee("");
2645
- let m = null;
2646
- Ht(f, (h) => {
2647
- m && clearTimeout(m), m = setTimeout(() => t.setFilter({ search: h }), 200);
2648
- });
2649
- const g = D(
2650
- () => {
2651
- var h;
2652
- return (((h = i.value) == null ? void 0 : h.categories) ?? []).map((d) => ({
2653
- label: d.label,
2654
- value: d.id
2655
- }));
2656
- }
2657
- ), u = ee(!1), p = ee(!1);
2658
- function _(h) {
2659
- return h.state === "disabled" && h.reason ? o(h.reason) : "";
2660
- }
2661
- const S = {
2662
- uploaded: "var(--fm-color-system-green-300)",
2663
- ai: "var(--fm-color-secondary-plum)",
2664
- legacy: "var(--fm-color-neutral-gray-300)",
2665
- none: "var(--fm-color-system-red-300)"
2666
- }, U = (h, d) => d > 0 ? Math.min(100, h / d * 100) : 0, k = D(() => {
2667
- const h = i.value;
2668
- if (!h) return [];
2669
- const { coverage: d, productCount: v } = h;
2670
- return [
2671
- {
2672
- id: "with-images",
2673
- label: e("menu.product_batch_image.coverage.with_images"),
2674
- value: String(d.withImages),
2675
- total: e("menu.product_batch_image.coverage.of_total", {
2676
- total: v
2677
- }),
2678
- segments: [
2679
- {
2680
- colour: S.uploaded,
2681
- share: U(d.withImages, v)
2682
- }
2683
- ]
2684
- },
2685
- {
2686
- id: "legacy",
2687
- label: e("menu.product_batch_image.coverage.legacy"),
2688
- value: String(d.legacyOnly),
2689
- segments: [
2690
- {
2691
- colour: S.legacy,
2692
- share: U(d.legacyOnly, v)
2693
- }
2694
- ]
2695
- },
2696
- {
2697
- id: "no-image",
2698
- label: e("menu.product_batch_image.coverage.no_image"),
2699
- value: String(d.noImage),
2700
- segments: [
2701
- { colour: S.none, share: U(d.noImage, v) }
2702
- ]
2703
- },
2704
- ...d.ratios.map((r) => ({
2705
- id: `ratio-${r.id}`,
2706
- label: r.required ? e("menu.product_batch_image.coverage.required_format", {
2707
- ratio: r.label
2708
- }) : e("menu.product_batch_image.coverage.menu_format", {
2709
- ratio: r.label
2710
- }),
2711
- value: String(r.uploaded + r.ai),
2712
- total: e("menu.product_batch_image.coverage.of_total", {
2713
- total: r.total
2714
- }),
2715
- note: e("menu.product_batch_image.coverage.split", {
2716
- uploaded: r.uploaded,
2717
- ai: r.ai
2718
- }),
2719
- segments: [
2720
- { colour: S.uploaded, share: U(r.uploaded, r.total) },
2721
- { colour: S.ai, share: U(r.ai, r.total) }
2722
- ]
2723
- }))
2724
- ];
2725
- }), C = D(() => [
2726
- {
2727
- id: "images",
2728
- header: () => e("menu.product_batch_image.columns.images"),
2729
- size: 150,
2730
- enableSorting: !1,
2731
- cell: (h) => {
2732
- const d = h.row.original, v = d.imageUrls.length ? d.imageUrls.map(
2733
- (r, l) => x(he, {
2734
- key: r,
2735
- src: r,
2736
- alt: e("menu.product_batch_image.image_alt", {
2737
- name: d.name,
2738
- index: l + 1
2739
- }),
2740
- class: l ? "-ml-12" : ""
2741
- })
2742
- ) : [x(he, { alt: d.name })];
2743
- return x("div", { class: "flex items-center py-8" }, [
2744
- ...v,
2745
- d.imageCount > 1 ? x(
2746
- "span",
2747
- {
2748
- class: "ml-8 fm-typo-en-body-sm-600 text-fm-color-typo-secondary"
2749
- },
2750
- String(d.imageCount)
2751
- ) : null
2752
- ]);
2753
- }
2754
- },
2755
- {
2756
- accessorKey: "code",
2757
- header: () => e("menu.product_batch_image.columns.code"),
2758
- size: 110,
2759
- cell: (h) => x(
2760
- "span",
2761
- { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
2762
- h.row.original.code ?? e("menu.catalog.empty_value")
2763
- )
2764
- },
2765
- {
2766
- accessorKey: "name",
2767
- header: () => e("menu.product_batch_image.columns.name"),
2768
- cell: (h) => x(
2769
- "span",
2770
- { class: "fm-typo-en-body-md-600" },
2771
- h.row.original.name
2772
- )
2773
- },
2774
- {
2775
- id: "category",
2776
- header: () => e("menu.product_batch_image.columns.category"),
2777
- size: 160,
2778
- enableSorting: !1,
2779
- cell: (h) => x(
2780
- "span",
2781
- { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
2782
- h.row.original.categoryLabel ?? e("menu.product_batch_image.no_category")
2783
- )
2784
- },
2785
- {
2786
- id: "formats",
2787
- header: () => e("menu.product_batch_image.columns.formats"),
2788
- enableSorting: !1,
2789
- cell: (h) => {
2790
- const d = h.row.original;
2791
- return d.legacyOnly ? x(Dt) : d.formats ? x(pt, { formats: d.formats }) : x(
2792
- "span",
2793
- { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
2794
- d.imageCount ? e("menu.catalog.empty_value") : e("menu.product_batch_image.no_image")
2795
- );
2796
- }
2797
- }
2798
- ]);
2799
- return (h, d) => (F(), L(Wt, {
2800
- heading: c(e)("menu.productInternalTools.title")
2801
- }, {
2802
- "append-heading": O(() => {
2803
- var v, r;
2804
- return [
2805
- y("div", vn, [
2806
- M(c($).FmButton, {
2807
- variant: "secondary",
2808
- "prepend-icon": "download",
2809
- label: c(e)("menu.product_batch_image.actions.download"),
2810
- disabled: ((v = i.value) == null ? void 0 : v.downloadAction.state) !== "allowed",
2811
- onClick: d[0] || (d[0] = (l) => p.value = !0)
2812
- }, null, 8, ["label", "disabled"]),
2813
- M(c($).FmButton, {
2814
- variant: "primary",
2815
- "prepend-icon": "upload",
2816
- label: c(e)("menu.product_batch_image.actions.update"),
2817
- disabled: ((r = i.value) == null ? void 0 : r.update.state) !== "allowed",
2818
- onClick: d[1] || (d[1] = (l) => u.value = !0)
2819
- }, null, 8, ["label", "disabled"])
2820
- ])
2821
- ];
2822
- }),
2823
- default: O(() => [
2824
- c(s).status === "loading" ? (F(), T("div", _n, [
2825
- M(c($).FmCircularProgress)
2826
- ])) : c(s).status === "unavailable" ? (F(), T("p", hn, I(c(o)(c(s).reason)), 1)) : i.value ? (F(), T("div", yn, [
2827
- i.value.update.state === "disabled" ? (F(), T("p", bn, I(_(i.value.update)), 1)) : R("", !0),
2828
- y("div", wn, [
2829
- y("div", kn, [
2830
- M(c($).FmSelect, {
2831
- "model-value": [...i.value.filter.categoryIds],
2832
- items: g.value,
2833
- multiselect: "",
2834
- searchable: "",
2835
- clearable: "",
2836
- placeholder: c(e)("menu.product_batch_image.filters.all_categories"),
2837
- "aria-label": c(e)("menu.product_batch_image.filters.categories"),
2838
- "onUpdate:modelValue": d[2] || (d[2] = (v) => c(t).setFilter({ categoryIds: v }))
2839
- }, null, 8, ["model-value", "items", "placeholder", "aria-label"])
2840
- ]),
2841
- y("div", xn, [
2842
- M(c($).FmSearch, {
2843
- modelValue: f.value,
2844
- "onUpdate:modelValue": d[3] || (d[3] = (v) => f.value = v),
2845
- placeholder: c(e)("menu.product_batch_image.filters.search")
2846
- }, null, 8, ["modelValue", "placeholder"])
2847
- ]),
2848
- y("span", $n, I(i.value.filtered ? c(e)("menu.product_batch_image.scope.filtered", {
2849
- count: i.value.productCount,
2850
- total: i.value.totalProductCount
2851
- }) : c(e)("menu.product_batch_image.scope.all", {
2852
- count: i.value.productCount
2853
- })), 1)
2854
- ]),
2855
- y("div", Fn, [
2856
- y("div", Cn, [
2857
- (F(!0), T(Y, null, ie(k.value, (v) => (F(), T("div", {
2858
- key: v.id,
2859
- class: "flex flex-col gap-4 border-0 border-b border-r border-solid border-fm-color-neutral-gray-200 px-16 py-12"
2860
- }, [
2861
- y("span", In, I(v.label), 1),
2862
- y("span", Sn, [
2863
- He(I(v.value) + " ", 1),
2864
- v.total ? (F(), T("small", Bn, I(v.total), 1)) : R("", !0)
2865
- ]),
2866
- v.note ? (F(), T("span", zn, I(v.note), 1)) : R("", !0),
2867
- y("div", Mn, [
2868
- (F(!0), T(Y, null, ie(v.segments, (r, l) => (F(), T("i", {
2869
- key: l,
2870
- class: "block h-full",
2871
- style: yt({
2872
- width: `${r.share}%`,
2873
- background: r.colour
2874
- })
2875
- }, null, 4))), 128))
2876
- ])
2877
- ]))), 128))
2878
- ])
2879
- ]),
2880
- M(c($).FmTable, {
2881
- "column-defs": C.value,
2882
- "row-data": [...i.value.rows],
2883
- "page-size": i.value.rows.length || 1,
2884
- "get-row-id": (v) => v.id,
2885
- "hide-footer": "",
2886
- "pin-header-row": "",
2887
- "shrink-at": !1
2888
- }, null, 8, ["column-defs", "row-data", "page-size", "get-row-id"])
2889
- ])) : R("", !0),
2890
- u.value ? (F(), L(gn, {
2891
- key: 3,
2892
- onClose: d[4] || (d[4] = (v) => u.value = !1)
2893
- })) : R("", !0),
2894
- p.value && i.value ? (F(), L(Ka, {
2895
- key: 4,
2896
- overview: i.value,
2897
- onClose: d[5] || (d[5] = (v) => p.value = !1)
2898
- }, null, 8, ["overview"])) : R("", !0)
2899
- ]),
2900
- _: 1
2901
- }, 8, ["heading"]));
2902
- }
2903
- });
2904
- export {
2905
- En as default
2906
- };