@beeintel/batch-image 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/FONT-LICENSE.txt +93 -0
  2. package/README.md +184 -3
  3. package/dist/assets/11st-D7qGO5e4.webp +0 -0
  4. package/dist/assets/UPNG-CPfdwFSy.js +2298 -0
  5. package/dist/assets/adjust-card-B63b81iV.webp +0 -0
  6. package/dist/assets/adjust-final.worker-C2JbTvv5.js +6945 -0
  7. package/dist/assets/amazon-CjTtpZTq.webp +0 -0
  8. package/dist/assets/ascii_art-B4UGbtGs.webp +0 -0
  9. package/dist/assets/auction-j26eVUQO.webp +0 -0
  10. package/dist/assets/background-DGdZUdkL.webp +0 -0
  11. package/dist/assets/background-card-wK7DRpvM.png +0 -0
  12. package/dist/assets/body-CUFdRg8w.webp +0 -0
  13. package/dist/assets/bounded-cutout.worker-BZR6mbaI.js +9615 -0
  14. package/dist/assets/brand-mark-card-cFUeDeO2.webp +0 -0
  15. package/dist/assets/buyma-dAxYNjow.webp +0 -0
  16. package/dist/assets/codec.worker-7W6hmsm6.js +7349 -0
  17. package/dist/assets/contour_lines-C_CqrgV1.webp +0 -0
  18. package/dist/assets/creema-B1tWyCPx.webp +0 -0
  19. package/dist/assets/crop-final.worker-Owin7TvX.js +7035 -0
  20. package/dist/assets/cutout-CzMvV5An.webp +0 -0
  21. package/dist/assets/cutout-card-CN4gNFBz.png +0 -0
  22. package/dist/assets/cutout.worker-DyH6Prbn.js +3894 -0
  23. package/dist/assets/depop-CkVC5Fn1.webp +0 -0
  24. package/dist/assets/dewrinkle-kFzP6LqD.webp +0 -0
  25. package/dist/assets/dither-CcxmO2e6.webp +0 -0
  26. package/dist/assets/douyin-CP_HwBDF.webp +0 -0
  27. package/dist/assets/download.worker-DnGSB6P_.js +17779 -0
  28. package/dist/assets/duotone-Cdg_3fQf.webp +0 -0
  29. package/dist/assets/ebay-CxLfrRAf.webp +0 -0
  30. package/dist/assets/edit-Cv-txfZm.webp +0 -0
  31. package/dist/assets/effect.worker-qu1eCcII.js +9227 -0
  32. package/dist/assets/engraving-BENh1O2O.webp +0 -0
  33. package/dist/assets/etsy-CSvz9GpY.webp +0 -0
  34. package/dist/assets/expand-C60VE9nK.webp +0 -0
  35. package/dist/assets/facebook-Ca2nJJiQ.webp +0 -0
  36. package/dist/assets/film_stock-Bqauwcq4.webp +0 -0
  37. package/dist/assets/final.worker-BnzJ3N5C.js +7035 -0
  38. package/dist/assets/final.worker-Csc1zoYS.js +7054 -0
  39. package/dist/assets/final.worker-DzBFT9xk.js +6922 -0
  40. package/dist/assets/final.worker-XpgKnlaz.js +7217 -0
  41. package/dist/assets/flatlay-CPiVmlAa.webp +0 -0
  42. package/dist/assets/flatlay-fold-B-CRYy87.webp +0 -0
  43. package/dist/assets/flatlay-open-Dzas8okC.webp +0 -0
  44. package/dist/assets/g-market-DXuYK_JH.webp +0 -0
  45. package/dist/assets/ghost-BCEAx_Zx.webp +0 -0
  46. package/dist/assets/ghost-front-WFgA4sUo.webp +0 -0
  47. package/dist/assets/ghost-three-quarter-Rt8cXj34.webp +0 -0
  48. package/dist/assets/gif-CObOIITx.js +303 -0
  49. package/dist/assets/glass_tiles-3IXP-Hmg.webp +0 -0
  50. package/dist/assets/glitch_art-D1i3qben.webp +0 -0
  51. package/dist/assets/glitch_blur-C4q_9zyq.webp +0 -0
  52. package/dist/assets/glow-Bv9EHBU5.webp +0 -0
  53. package/dist/assets/gradient_map-BR-UVYMP.webp +0 -0
  54. package/dist/assets/halftone-CWdKu2_6.webp +0 -0
  55. package/dist/assets/holo_sticker-BQDikLg2.webp +0 -0
  56. package/dist/assets/idus-7diqRNPs.webp +0 -0
  57. package/dist/assets/imagetracer.worker-CgunQTPG.js +7096 -0
  58. package/dist/assets/instagram-Bf0IVidT.webp +0 -0
  59. package/dist/assets/kakao-talk-Df79L_Mv.webp +0 -0
  60. package/dist/assets/kaleidoscope-BxqMZuWo.webp +0 -0
  61. package/dist/assets/karrot-BXFPhDwt.webp +0 -0
  62. package/dist/assets/kaufland-BDDy6e0C.webp +0 -0
  63. package/dist/assets/lazada-ConR4e1O.webp +0 -0
  64. package/dist/assets/lens_flare-DgyiAv_j.webp +0 -0
  65. package/dist/assets/light_leak-kUdpoFuC.webp +0 -0
  66. package/dist/assets/line-Dr1j___B.webp +0 -0
  67. package/dist/assets/linkedin-4s_9Wh03.webp +0 -0
  68. package/dist/assets/lo_fi-DSdl3yY_.webp +0 -0
  69. package/dist/assets/logo-preparation.worker-D9oa7SME.js +420 -0
  70. package/dist/assets/mercado-libre-C8CskEiS.webp +0 -0
  71. package/dist/assets/mercari-jp-DHj7nz4O.webp +0 -0
  72. package/dist/assets/metadata.worker-B_9_BgN1.js +6456 -0
  73. package/dist/assets/mirror_collage-JtSKCeSh.webp +0 -0
  74. package/dist/assets/model-BbeF-fsf.webp +0 -0
  75. package/dist/assets/model-BjWhieit.webp +0 -0
  76. package/dist/assets/momo-BWXO_8Df.webp +0 -0
  77. package/dist/assets/motion_blur-B8YUHeSg.webp +0 -0
  78. package/dist/assets/naver-xQKL8lWg.webp +0 -0
  79. package/dist/assets/nuvemshop-DPt6rnA-.webp +0 -0
  80. package/dist/assets/olx-B87gp-Il.webp +0 -0
  81. package/dist/assets/orient-card-Da0ii6mX.webp +0 -0
  82. package/dist/assets/orient-final.worker-CdF5Y5zD.js +6909 -0
  83. package/dist/assets/orientation-preview.worker-B7uFzz3J.js +6865 -0
  84. package/dist/assets/ort.bundle.min-CreFV8V1.js +9311 -0
  85. package/dist/assets/ort.webgpu.bundle.min-CAudaHZO.js +9311 -0
  86. package/dist/assets/otto-market-DWZyNKJn.webp +0 -0
  87. package/dist/assets/paper_texture-CXphyIrs.webp +0 -0
  88. package/dist/assets/pinterest-ByZqih2J.webp +0 -0
  89. package/dist/assets/polish-DFy6LNG7.webp +0 -0
  90. package/dist/assets/poshmark-DnZi2vA1.webp +0 -0
  91. package/dist/assets/posterize-SpLVGq1s.webp +0 -0
  92. package/dist/assets/preview.worker-DcrCKKWl.js +380 -0
  93. package/dist/assets/qoo10-C1pq81Jx.webp +0 -0
  94. package/dist/assets/rakuten-ulYog1hL.webp +0 -0
  95. package/dist/assets/recolor-mBX7vdFT.webp +0 -0
  96. package/dist/assets/resize-DVEAl0Um.webp +0 -0
  97. package/dist/assets/runtime-0663b902fb3937883a34.wasm +0 -0
  98. package/dist/assets/runtime-355a5c80c7bfdf8737de.mjs +2817 -0
  99. package/dist/assets/runtime-49871f5a4409519797e1.wasm +0 -0
  100. package/dist/assets/runtime-74cf72f9a2b7befc115a.mjs +2817 -0
  101. package/dist/assets/shadow-card-DTZEH60r.png +0 -0
  102. package/dist/assets/shopee-Bxfei6sj.webp +0 -0
  103. package/dist/assets/shopify-wVaBafcF.webp +0 -0
  104. package/dist/assets/shopline-DMoaJ7Bh.webp +0 -0
  105. package/dist/assets/sparkle-CD5GSGip.webp +0 -0
  106. package/dist/assets/ssg-DQoFx5u5.webp +0 -0
  107. package/dist/assets/staging-CIc8pQJ6.webp +0 -0
  108. package/dist/assets/standard-cutout.worker-BYLzdpR-.js +1261 -0
  109. package/dist/assets/text-DQW2mBGp.webp +0 -0
  110. package/dist/assets/textured_glass-D2coxp7n.webp +0 -0
  111. package/dist/assets/tga-VGxWDes0.js +752 -0
  112. package/dist/assets/tilt_shift-BKs46yeX.webp +0 -0
  113. package/dist/assets/transformers.web-DB57cIO5.js +28891 -0
  114. package/dist/assets/tritone-CcR4qizk.webp +0 -0
  115. package/dist/assets/upscale-BrLadyUk.webp +0 -0
  116. package/dist/assets/upscale-creative-DnZnQufJ.webp +0 -0
  117. package/dist/assets/upscale-crisp-Ckdmbsnn.webp +0 -0
  118. package/dist/assets/vinted-1QDsxvC6.webp +0 -0
  119. package/dist/assets/watercolor-CV67zYNE.webp +0 -0
  120. package/dist/assets/watermark-CpPrxaT5.webp +0 -0
  121. package/dist/assets/wave_distortion-CV5jVfK4.webp +0 -0
  122. package/dist/assets/whatsapp-CWJxqzR6.webp +0 -0
  123. package/dist/assets/worker-DfrCFP3O.js +55 -0
  124. package/dist/assets/xerox_noise-CbbHY1S1.webp +0 -0
  125. package/dist/assets/youtube-DS12d5mi.webp +0 -0
  126. package/dist/assets/zalando-CenfWOwz.webp +0 -0
  127. package/dist/browser-adapter.d.ts +4 -0
  128. package/dist/browser-cutout-capability.d.ts +4 -0
  129. package/dist/browser-cutout-resources.d.ts +3 -0
  130. package/dist/browser-local-capabilities.d.ts +5 -0
  131. package/dist/capabilities.d.ts +18 -0
  132. package/dist/chunks/AdjustToolPanel-BELqYSUR.js +195 -0
  133. package/dist/chunks/BackgroundToolPanel-Dy_l8KFl.js +41 -0
  134. package/dist/chunks/BatchMaterials-niGKrga3.js +806 -0
  135. package/dist/chunks/BatchModeChoices-BRqn6zNI.js +111 -0
  136. package/dist/chunks/BatchOutputColorPicker-CCvmIF-b.js +75 -0
  137. package/dist/chunks/BatchReferenceFields-C4t7OSTw.js +316 -0
  138. package/dist/chunks/BeautifyToolPanel-Dc-ddaBC.js +215 -0
  139. package/dist/chunks/BrandMarkToolPanel-FKxXth_3.js +1179 -0
  140. package/dist/chunks/ContentTrimControl-BQfigZPq.js +297 -0
  141. package/dist/chunks/CropToolPanel-BhSuHkYm.js +218 -0
  142. package/dist/chunks/CutoutToolPanel-BfaZZSE_.js +73 -0
  143. package/dist/chunks/DisclosureToolPanel-B_oc5fld.js +76 -0
  144. package/dist/chunks/ExpandToolPanel-D_ZODTUZ.js +67 -0
  145. package/dist/chunks/ImageEffectsToolPanel-BRLPIt4q.js +966 -0
  146. package/dist/chunks/IpAuditToolPanel-DfY-mBSe.js +96 -0
  147. package/dist/chunks/ListingToolPanel-B9Yh3LBK.js +783 -0
  148. package/dist/chunks/MaterialSelectionPlate-DhioUjdW.js +30 -0
  149. package/dist/chunks/MetadataToolPanel-KVrtb3K0.js +104 -0
  150. package/dist/chunks/OrientToolPanel-BTrwaWBm.js +161 -0
  151. package/dist/chunks/PluginActionFooter.vue_vue_type_script_setup_true_lang-C2kJCYeA.js +102 -0
  152. package/dist/chunks/ResizeToolPanel-Ch_-WR74.js +1178 -0
  153. package/dist/chunks/RetouchToolPanel-BTS33Dsd.js +350 -0
  154. package/dist/chunks/ShadowToolPanel-DxJE4eyV.js +254 -0
  155. package/dist/chunks/SvgExportToolPanel-RHmuQARH.js +219 -0
  156. package/dist/chunks/TranslationToolPanel-B_qTA1hM.js +125 -0
  157. package/dist/chunks/UpscaleToolPanel-D0H-j2Tr.js +127 -0
  158. package/dist/chunks/engine-D-T-1RSx.js +69 -0
  159. package/dist/chunks/entry-DK9FjQZ_.js +42946 -0
  160. package/dist/chunks/gpu-CScw5MNG.js +231 -0
  161. package/dist/chunks/hosted-resources-COzZ7nZY.js +8196 -0
  162. package/dist/chunks/loader-circle-UFoEem2a.js +16 -0
  163. package/dist/chunks/motionFeatures-D4miwXxc.js +4405 -0
  164. package/dist/chunks/search-BjTSm1KS.js +18 -0
  165. package/dist/chunks/standard-cutout-vPpP6xBc.js +45 -0
  166. package/dist/chunks/static-logo-2F9ORZWc.js +34 -0
  167. package/dist/config.d.ts +66 -0
  168. package/dist/contracts.d.ts +272 -0
  169. package/dist/index.d.ts +23 -0
  170. package/dist/index.js +13 -0
  171. package/dist/node/catalog.mjs +45 -0
  172. package/dist/node/cli.mjs +11 -0
  173. package/dist/node/index.d.mts +20 -0
  174. package/dist/node/index.mjs +2 -0
  175. package/dist/node/prepare.mjs +114 -0
  176. package/dist/node/vite.mjs +46 -0
  177. package/dist/processing.d.ts +1 -0
  178. package/dist/processing.js +12105 -0
  179. package/dist/remote-contracts.d.ts +114 -0
  180. package/dist/resource-contracts.d.ts +40 -0
  181. package/dist/resources/cutout/9ae2e5375a34fa413530954dc20d085d175faffc86108c13619220d0557f80bf.json +1 -0
  182. package/dist/resources/cutout/f119dabecc64bc436d3d08425dde96ec2598fd40541eba97d8d53a4e8bbdcaea.json +1 -0
  183. package/dist/resources/cutout/resources.json +195 -0
  184. package/dist/resources/cutout/sources.json +294 -0
  185. package/dist/resources.json +1191 -0
  186. package/dist/service-contracts.d.ts +43 -0
  187. package/dist/slots.d.ts +21 -0
  188. package/dist/style.css +1 -0
  189. package/dist/types/batch/api.d.ts +89 -0
  190. package/dist/types/batch/cutout-output.d.ts +2 -0
  191. package/dist/types/batch/features/background/engine.d.mts +12 -0
  192. package/dist/types/batch/features/basic-edit/contracts.d.ts +87 -0
  193. package/dist/types/batch/features/basic-edit/engine.d.mts +96 -0
  194. package/dist/types/batch/features/brand-mark/contracts.d.ts +84 -0
  195. package/dist/types/batch/features/brand-mark/engine.d.mts +68 -0
  196. package/dist/types/batch/features/export-compression/contracts.d.ts +44 -0
  197. package/dist/types/batch/features/export-compression/gifenc.d.ts +33 -0
  198. package/dist/types/batch/features/export-compression/plan.d.ts +45 -0
  199. package/dist/types/batch/features/export-compression/presentation.d.ts +70 -0
  200. package/dist/types/batch/features/export-compression/upng.d.ts +6 -0
  201. package/dist/types/batch/features/final-image/resize.d.mts +15 -0
  202. package/dist/types/batch/features/image-effects/contracts.d.ts +58 -0
  203. package/dist/types/batch/features/image-effects/gpu-pixel-runtime.d.ts +15 -0
  204. package/dist/types/batch/features/image-effects/photo-audit.d.ts +21 -0
  205. package/dist/types/batch/features/image-effects/photo-v7-cpu.d.ts +9 -0
  206. package/dist/types/batch/features/image-effects/profiles-v4.d.ts +157 -0
  207. package/dist/types/batch/features/image-effects/profiles-v5.d.ts +20 -0
  208. package/dist/types/batch/features/image-effects/profiles-v6.d.ts +14 -0
  209. package/dist/types/batch/features/image-effects/profiles-v7.d.ts +53 -0
  210. package/dist/types/batch/features/image-effects/profiles-v8.d.ts +113 -0
  211. package/dist/types/batch/features/image-effects/profiles-v9.d.ts +20 -0
  212. package/dist/types/batch/features/image-translation/params.d.ts +257 -0
  213. package/dist/types/batch/features/listing-remake/transport.d.ts +21 -0
  214. package/dist/types/batch/features/metadata/bytes.d.mts +13 -0
  215. package/dist/types/batch/features/metadata/containers.d.mts +20 -0
  216. package/dist/types/batch/features/metadata/declaration.d.mts +5 -0
  217. package/dist/types/batch/features/metadata/engine.d.mts +9 -0
  218. package/dist/types/batch/features/metadata/exchange.d.mts +48 -0
  219. package/dist/types/batch/features/shadow/contracts.d.ts +43 -0
  220. package/dist/types/batch/features/shadow/engine.d.mts +33 -0
  221. package/dist/types/batch/features/svg-export/download-contract.d.ts +33 -0
  222. package/dist/types/batch/features/svg-export/download-prepare.d.ts +2 -0
  223. package/dist/types/batch/features/svg-export/download.d.ts +7 -0
  224. package/dist/types/batch/features/svg-export/imagetracer.d.ts +6 -0
  225. package/dist/types/batch/features/svg-export/optimizer.d.ts +2 -0
  226. package/dist/types/batch/ids.d.ts +1 -0
  227. package/dist/types/batch/model.d.ts +317 -0
  228. package/dist/types/batch/public/config.d.ts +66 -0
  229. package/dist/types/batch/public/contracts.d.ts +272 -0
  230. package/dist/types/batch/public/remote-contracts.d.ts +114 -0
  231. package/dist/types/batch/public/resource-contracts.d.ts +40 -0
  232. package/dist/types/batch/public/service-contracts.d.ts +43 -0
  233. package/dist/types/batch/queue.d.ts +34 -0
  234. package/dist/types/batch/receipts.d.ts +85 -0
  235. package/dist/types/batch/retention.d.ts +13 -0
  236. package/dist/types/onnxruntime-web.d.ts +5 -0
  237. package/dist/types/plugins/cutout/core/hosted-resources.d.ts +11 -0
  238. package/dist/types/processing.d.ts +18 -0
  239. package/dist/types/shared/svg-security.d.mts +4 -0
  240. package/dist/types/workspace-worker.d.ts +2 -0
  241. package/package.json +95 -6
@@ -0,0 +1,783 @@
1
+ import { defineComponent as ee, ref as $, computed as le, watch as A, onBeforeUnmount as de, openBlock as p, createElementBlock as h, withModifiers as Q, unref as a, normalizeClass as Y, createElementVNode as u, toDisplayString as v, Fragment as ie, renderList as ne, createCommentVNode as E, createVNode as I, createTextVNode as K, nextTick as J, useId as ve, onMounted as ge, normalizeStyle as pe, createBlock as O, withCtx as te } from "vue";
2
+ import { J as se, F as ae, aw as fe, ai as be, ah as ke, ax as he, ay as ye, _ as oe, aj as _e, S as ce, a4 as me, az as we, G as Pe } from "./entry-DK9FjQZ_.js";
3
+ import { L as xe } from "./loader-circle-UFoEem2a.js";
4
+ import { u as Le, a as $e, b as ue, _ as Ie } from "./PluginActionFooter.vue_vue_type_script_setup_true_lang-C2kJCYeA.js";
5
+ /**
6
+ * @license @lucide/vue v1.47.0 - ISC
7
+ *
8
+ * This source code is licensed under the ISC license.
9
+ * See the LICENSE file in the root directory of this source tree.
10
+ */
11
+ const Ce = {
12
+ name: "external-link",
13
+ size: 24,
14
+ node: [
15
+ ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
16
+ ["path", { d: "M10 14 21 3", key: "gplh6r" }],
17
+ ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
18
+ ]
19
+ }, Ve = se(Ce);
20
+ /**
21
+ * @license @lucide/vue v1.47.0 - ISC
22
+ *
23
+ * This source code is licensed under the ISC license.
24
+ * See the LICENSE file in the root directory of this source tree.
25
+ */
26
+ const Ee = {
27
+ name: "layout-template",
28
+ size: 24,
29
+ node: [
30
+ ["rect", { width: "18", height: "7", x: "3", y: "3", rx: "1", key: "f1a2em" }],
31
+ ["rect", { width: "9", height: "7", x: "3", y: "14", rx: "1", key: "jqznyg" }],
32
+ ["rect", { width: "5", height: "7", x: "16", y: "14", rx: "1", key: "q5h2i8" }]
33
+ ]
34
+ }, Re = se(Ee);
35
+ /**
36
+ * @license @lucide/vue v1.47.0 - ISC
37
+ *
38
+ * This source code is licensed under the ISC license.
39
+ * See the LICENSE file in the root directory of this source tree.
40
+ */
41
+ const Ae = {
42
+ name: "refresh-cw",
43
+ size: 24,
44
+ node: [
45
+ ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
46
+ ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
47
+ ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
48
+ ["path", { d: "M8 16H3v5", key: "1cv678" }]
49
+ ]
50
+ }, re = se(Ae), ze = ["aria-label", "aria-busy"], Se = { class: "picker-heading" }, Ue = { class: "picker-hint" }, Be = ["multiple", "disabled", "aria-label"], Me = { class: "product-preview" }, Te = ["src", "alt"], De = ["src", "alt"], Fe = { class: "product-number" }, qe = {
51
+ key: 2,
52
+ class: "upload-state",
53
+ role: "status"
54
+ }, Ke = ["href", "aria-label"], Ne = {
55
+ key: 0,
56
+ class: "slot-error",
57
+ role: "alert"
58
+ }, Ge = { class: "product-actions" }, je = ["disabled", "aria-label", "onClick"], He = ["disabled", "aria-label", "onClick"], Je = ["disabled", "aria-label", "onClick"], Oe = ["disabled", "aria-label"], We = {
59
+ key: 0,
60
+ class: "picker-notice",
61
+ role: "status"
62
+ }, Xe = /* @__PURE__ */ ee({
63
+ __name: "ProductImagePicker",
64
+ props: {
65
+ modelValue: {},
66
+ disabled: { type: Boolean },
67
+ scopeKey: {},
68
+ upload: { type: Function }
69
+ },
70
+ emits: ["update:modelValue", "busy"],
71
+ setup(l, { emit: R }) {
72
+ const { ui: t, uiText: C } = ae(), r = l, z = R;
73
+ let x = 0, w = 0, P = !0;
74
+ const d = (e) => JSON.stringify([e.assetId, e.assetVersionId, e.sha256]), y = (e) => JSON.stringify(e.map(d)), k = (e) => ({
75
+ id: ++x,
76
+ asset: { ...e },
77
+ state: "ready",
78
+ token: 0
79
+ }), n = $(r.modelValue.slice(0, 4).map(k)), g = fe(
80
+ () => n.value.flatMap((e) => e.asset ? [e.asset] : [])
81
+ ), s = $(), L = $(null), V = $(""), S = $(!1);
82
+ let U = y(r.modelValue);
83
+ const B = [], N = le(() => n.value.some((e) => e.state !== "ready"));
84
+ A(N, (e) => z("busy", e), { immediate: !0, flush: "sync" });
85
+ function M(e) {
86
+ e.preview && URL.revokeObjectURL(e.preview), e.preview = void 0;
87
+ }
88
+ function F(e) {
89
+ w++, n.value.forEach(M), n.value = e.slice(0, 4).map(k), L.value = null, V.value = "", S.value = !1, B.length = 0;
90
+ }
91
+ A(
92
+ () => r.modelValue,
93
+ (e) => {
94
+ const m = y(e), o = B.indexOf(m);
95
+ if (m !== U && o < 0) F(e);
96
+ else {
97
+ o >= 0 && B.splice(0, o + 1);
98
+ const _ = new Map(e.map((f) => [d(f), f]));
99
+ for (const f of n.value)
100
+ if (f.asset) {
101
+ const D = _.get(d(f.asset));
102
+ D && (f.asset = { ...D });
103
+ }
104
+ }
105
+ U = m;
106
+ },
107
+ { deep: !0, flush: "sync" }
108
+ ), A(
109
+ () => r.scopeKey,
110
+ () => F(r.modelValue),
111
+ { flush: "sync" }
112
+ ), A(
113
+ () => r.disabled,
114
+ (e) => {
115
+ e && F(r.modelValue);
116
+ },
117
+ { flush: "sync" }
118
+ ), de(() => {
119
+ P = !1, F([]);
120
+ });
121
+ function W() {
122
+ const e = n.value.flatMap((m) => m.asset ? [{ ...m.asset }] : []);
123
+ B.push(y(e)), z("update:modelValue", e);
124
+ }
125
+ async function G(e) {
126
+ if (r.disabled || !e.file || e.state === "uploading") return;
127
+ const m = w, o = ++e.token;
128
+ e.state = "uploading", e.preview || (e.preview = URL.createObjectURL(e.file));
129
+ const _ = () => P && !r.disabled && w === m && e.token === o && n.value.some((f) => f.id === e.id);
130
+ try {
131
+ const f = await he(e.file);
132
+ if (!_()) return;
133
+ const D = await r.upload(f.file);
134
+ if (!_()) return;
135
+ e.asset = { ...D }, e.state = "ready", e.file = void 0, M(e), W();
136
+ } catch {
137
+ _() && (e.state = "failed");
138
+ }
139
+ }
140
+ async function j(e) {
141
+ r.disabled || e?.state === "uploading" || !e && n.value.length >= 4 || (L.value = e?.id ?? null, await J(), P && !r.disabled && s.value?.click());
142
+ }
143
+ function i(e, m = null) {
144
+ if (r.disabled || !e.length) return;
145
+ const o = e.filter(
146
+ (f) => ["image/png", "image/jpeg", "image/webp"].includes(f.type)
147
+ );
148
+ if (V.value = o.length !== e.length ? "请选择 PNG、JPEG 或 WebP 图片。" : "", m !== null) {
149
+ const f = n.value.find((D) => D.id === m);
150
+ if (!f || f.state === "uploading" || !o[0]) return;
151
+ M(f), f.file = o[0], f.state = "failed", G(f);
152
+ return;
153
+ }
154
+ const _ = 4 - n.value.length;
155
+ o.length > _ && (V.value = "商品图最多 4 张,超出的图片未上传。");
156
+ for (const f of o.slice(0, _)) {
157
+ const D = { id: ++x, file: f, state: "failed", token: 0 };
158
+ n.value.push(D), G(n.value[n.value.length - 1]);
159
+ }
160
+ }
161
+ function b(e) {
162
+ const m = e.target, o = Array.from(m.files ?? []), _ = L.value;
163
+ m.value = "", L.value = null, i(o, _);
164
+ }
165
+ function c(e) {
166
+ const m = ye(e);
167
+ m.length && (e.preventDefault(), e.stopPropagation(), !r.disabled && i(m));
168
+ }
169
+ function T(e) {
170
+ S.value = !1, i(Array.from(e.dataTransfer?.files ?? []));
171
+ }
172
+ function X(e) {
173
+ r.disabled || (e.token++, M(e), n.value = n.value.filter((m) => m.id !== e.id), W());
174
+ }
175
+ const q = (e) => g.get(e), H = (e) => g.get(e);
176
+ return (e, m) => (p(), h("div", {
177
+ class: Y(["product-picker", { "is-dragging": S.value, "is-disabled": l.disabled }]),
178
+ "data-testid": "product-dropzone",
179
+ tabindex: "0",
180
+ "aria-label": a(t)("tools.listing_remake.productImagePicker_0a6a4dcd"),
181
+ onPaste: c,
182
+ "aria-busy": N.value,
183
+ onDragover: m[1] || (m[1] = Q((o) => S.value = !l.disabled, ["prevent"])),
184
+ onDragleave: m[2] || (m[2] = Q((o) => S.value = !1, ["prevent"])),
185
+ onDrop: Q(T, ["prevent", "stop"])
186
+ }, [
187
+ u("div", Se, [
188
+ u("span", null, v(a(t)("tools.listing_remake.productImagePicker_4bfdac53")), 1),
189
+ u("small", null, v(n.value.length) + "/4", 1)
190
+ ]),
191
+ u("p", Ue, v(a(t)("tools.listing_remake.productImagePicker_39fb6b8b")), 1),
192
+ u("input", {
193
+ ref_key: "input",
194
+ ref: s,
195
+ type: "file",
196
+ hidden: "",
197
+ accept: "image/png,image/jpeg,image/webp",
198
+ multiple: L.value === null,
199
+ disabled: l.disabled || L.value === null && n.value.length >= 4,
200
+ "aria-label": a(t)("tools.listing_remake.productImagePicker_fddf94f3"),
201
+ onChange: b
202
+ }, null, 40, Be),
203
+ u("div", {
204
+ class: Y(["product-grid", { empty: !n.value.length }])
205
+ }, [
206
+ (p(!0), h(ie, null, ne(n.value, (o, _) => (p(), h("div", {
207
+ key: o.id,
208
+ class: Y(["product-slot", { "has-error": o.state === "failed" }]),
209
+ "data-product-slot": ""
210
+ }, [
211
+ u("div", Me, [
212
+ o.preview && o.state !== "failed" || !o.asset && o.preview ? (p(), h("img", {
213
+ key: 0,
214
+ src: o.preview,
215
+ alt: a(t)("tools.listing_remake.productImagePicker_0f5d1e89", { p0: _ + 1 })
216
+ }, null, 8, Te)) : o.asset && q(o.asset) ? (p(), h("img", {
217
+ key: 1,
218
+ src: q(o.asset),
219
+ alt: a(t)("tools.listing_remake.productImagePicker_215123d8", { p0: _ + 1 })
220
+ }, null, 8, De)) : E("", !0),
221
+ u("span", Fe, "A" + v(_ + 1), 1),
222
+ o.state === "uploading" ? (p(), h("span", qe, [
223
+ I(a(xe), {
224
+ size: 14,
225
+ class: "spinner",
226
+ "aria-hidden": "true"
227
+ }),
228
+ K(v(a(t)("tools.listing_remake.productImagePicker_403b055e")), 1)
229
+ ])) : E("", !0),
230
+ o.asset && o.state !== "uploading" && H(o.asset) ? (p(), h("a", {
231
+ key: 3,
232
+ class: "view-image",
233
+ href: H(o.asset),
234
+ target: "_blank",
235
+ rel: "noopener noreferrer",
236
+ "aria-label": a(t)("tools.listing_remake.productImagePicker_ed8a8c8e", { p0: _ + 1 })
237
+ }, [
238
+ I(a(Ve), {
239
+ size: 13,
240
+ "aria-hidden": "true"
241
+ })
242
+ ], 8, Ke)) : E("", !0)
243
+ ]),
244
+ o.state === "failed" ? (p(), h("p", Ne, v(o.asset ? a(t)("tools.listing_remake.productImagePicker_8cd858e1") : a(t)("tools.listing_remake.productImagePicker_9a5fc6f3")), 1)) : E("", !0),
245
+ u("div", Ge, [
246
+ o.state === "failed" ? (p(), h("button", {
247
+ key: 0,
248
+ type: "button",
249
+ disabled: l.disabled,
250
+ "aria-label": a(t)("tools.listing_remake.productImagePicker_057ee503", { p0: _ + 1 }),
251
+ onClick: (f) => G(o)
252
+ }, [
253
+ I(a(re), {
254
+ size: 12,
255
+ "aria-hidden": "true"
256
+ }),
257
+ K(v(a(t)("tools.listing_remake.productImagePicker_b8784c8d")), 1)
258
+ ], 8, je)) : (p(), h("button", {
259
+ key: 1,
260
+ type: "button",
261
+ disabled: l.disabled || o.state === "uploading",
262
+ "aria-label": a(t)("tools.listing_remake.productImagePicker_7379e7e6", { p0: _ + 1 }),
263
+ onClick: (f) => j(o)
264
+ }, [
265
+ I(a(re), {
266
+ size: 12,
267
+ "aria-hidden": "true"
268
+ }),
269
+ K(v(a(t)("tools.listing_remake.productImagePicker_131b13aa")), 1)
270
+ ], 8, He)),
271
+ u("button", {
272
+ type: "button",
273
+ disabled: l.disabled,
274
+ "aria-label": a(t)("tools.listing_remake.productImagePicker_3aff083d", { p0: _ + 1 }),
275
+ onClick: (f) => X(o)
276
+ }, [
277
+ I(a(be), {
278
+ size: 12,
279
+ "aria-hidden": "true"
280
+ })
281
+ ], 8, Je)
282
+ ])
283
+ ], 2))), 128)),
284
+ n.value.length < 4 ? (p(), h("button", {
285
+ key: 0,
286
+ class: "add-product",
287
+ type: "button",
288
+ disabled: l.disabled,
289
+ "aria-label": a(t)("tools.listing_remake.productImagePicker_82376c3b"),
290
+ onClick: m[0] || (m[0] = (o) => j())
291
+ }, [
292
+ I(a(ke), {
293
+ size: 21,
294
+ "aria-hidden": "true"
295
+ }),
296
+ u("span", null, v(a(t)("common.app_9f0d4e46")), 1),
297
+ u("small", null, v(a(t)("tools.listing_remake.productImagePicker_9c3ce301")), 1)
298
+ ], 8, Oe)) : E("", !0)
299
+ ], 2),
300
+ V.value ? (p(), h("p", We, v(a(C)(V.value)), 1)) : E("", !0)
301
+ ], 42, ze));
302
+ }
303
+ }), Qe = /* @__PURE__ */ oe(Xe, [["__scopeId", "data-v-cc96a960"]]), Z = [
304
+ {
305
+ value: "English (US)",
306
+ label: "英语 · 美国",
307
+ code: "en-US",
308
+ aliases: ["English", "United States", "USA", "美式"]
309
+ },
310
+ {
311
+ value: "English (UK)",
312
+ label: "英语 · 英国",
313
+ code: "en-GB",
314
+ aliases: ["English", "United Kingdom", "UK", "英式"]
315
+ },
316
+ { value: "English (CA)", label: "英语 · 加拿大", code: "en-CA", aliases: ["English", "Canada"] },
317
+ {
318
+ value: "English (AU)",
319
+ label: "英语 · 澳大利亚",
320
+ code: "en-AU",
321
+ aliases: ["English", "Australia", "澳洲"]
322
+ },
323
+ { value: "English (IN)", label: "英语 · 印度", code: "en-IN", aliases: ["English", "India"] },
324
+ {
325
+ value: "French (FR)",
326
+ label: "法语 · 法国",
327
+ code: "fr-FR",
328
+ aliases: ["French", "France", "Français"]
329
+ },
330
+ {
331
+ value: "French (CA)",
332
+ label: "法语 · 加拿大",
333
+ code: "fr-CA",
334
+ aliases: ["French", "Canada", "Québec", "魁北克"]
335
+ },
336
+ { value: "French (BE)", label: "法语 · 比利时", code: "fr-BE", aliases: ["French", "Belgium"] },
337
+ {
338
+ value: "Simplified Chinese",
339
+ label: "简体中文",
340
+ code: "zh-CN",
341
+ aliases: ["Chinese", "简中", "中国", "China", "普通话", "Mandarin"]
342
+ },
343
+ {
344
+ value: "Traditional Chinese",
345
+ label: "繁体中文",
346
+ code: "zh-TW",
347
+ aliases: ["Chinese", "繁中", "台湾", "臺灣", "Taiwan", "香港", "Hong Kong", "zh-HK"]
348
+ },
349
+ { value: "Japanese", label: "日语 · 日本", code: "ja-JP", aliases: ["Japan", "日本語"] },
350
+ { value: "German", label: "德语 · 德国", code: "de-DE", aliases: ["Germany", "Deutsch"] },
351
+ {
352
+ value: "Spanish (ES)",
353
+ label: "西班牙语 · 西班牙",
354
+ code: "es-ES",
355
+ aliases: ["Spanish", "Spain", "Español", "西语"]
356
+ },
357
+ {
358
+ value: "Spanish (MX)",
359
+ label: "西班牙语 · 墨西哥",
360
+ code: "es-MX",
361
+ aliases: ["Spanish", "Mexico", "Español", "西语"]
362
+ },
363
+ {
364
+ value: "Portuguese (Brazil)",
365
+ label: "葡萄牙语 · 巴西",
366
+ code: "pt-BR",
367
+ aliases: ["Portuguese", "Brazil", "Brasil", "Português", "葡语"]
368
+ },
369
+ {
370
+ value: "Portuguese (Portugal)",
371
+ label: "葡萄牙语 · 葡萄牙",
372
+ code: "pt-PT",
373
+ aliases: ["Portuguese", "Portugal", "Português", "葡语"]
374
+ },
375
+ { value: "Italian", label: "意大利语 · 意大利", code: "it-IT", aliases: ["Italy", "Italiano"] },
376
+ { value: "Korean", label: "韩语 · 韩国", code: "ko-KR", aliases: ["Korea", "한국어"] },
377
+ { value: "Dutch", label: "荷兰语 · 荷兰", code: "nl-NL", aliases: ["Netherlands", "Nederlands"] },
378
+ { value: "Arabic", label: "阿拉伯语", code: "ar", aliases: ["العربية"] }
379
+ ];
380
+ function Ye(l) {
381
+ const R = l.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean);
382
+ return Z.filter((t) => {
383
+ const C = [t.value, t.label, t.code, ...t.aliases].join(" ").toLocaleLowerCase();
384
+ return R.every((r) => C.includes(r));
385
+ });
386
+ }
387
+ const Ze = ["for"], ea = { class: "lir-language-input" }, aa = ["id", "value", "disabled", "placeholder", "aria-expanded", "aria-controls", "aria-activedescendant"], ta = ["aria-label", "disabled"], la = ["aria-label", "aria-expanded", "disabled"], ia = ["id", "aria-label", "data-placement"], na = ["id", "aria-selected", "data-value", "data-custom", "onClick"], sa = { key: 0 }, oa = { class: "hint" }, ua = /* @__PURE__ */ ee({
388
+ __name: "TargetLanguagePicker",
389
+ props: {
390
+ modelValue: {},
391
+ disabled: { type: Boolean }
392
+ },
393
+ emits: ["update:modelValue"],
394
+ setup(l, { emit: R }) {
395
+ const { ui: t, uiText: C, uiTargetLanguage: r, batchI18n: z } = ae(), x = l, w = R, P = $(), d = $(!1), y = $(""), k = $(-1), n = ve(), g = (i) => {
396
+ const b = Z.find((c) => c.value === i);
397
+ return b ? r(b.code) : i;
398
+ }, s = $(g(x.modelValue)), L = $("below"), V = $(240), S = $(66);
399
+ function U() {
400
+ if (!d.value || !P.value) return;
401
+ const i = P.value.getBoundingClientRect(), b = P.value.querySelector(".lir-language-input")?.getBoundingClientRect();
402
+ if (!b) return;
403
+ const c = P.value.closest(".tools-panel")?.getBoundingClientRect(), T = Math.min(window.innerHeight, c?.bottom ?? window.innerHeight), X = Math.max(0, c?.top ?? 0), q = Math.max(0, T - b.bottom - 5), H = Math.max(0, b.top - X - 5);
404
+ L.value = q < 240 && H > q ? "above" : "below", V.value = Math.min(240, L.value === "above" ? H : q), S.value = L.value === "above" ? i.bottom - b.top + 5 : b.bottom - i.top + 5;
405
+ }
406
+ A(d, async (i) => {
407
+ i && (await J(), U());
408
+ }), A(
409
+ () => x.modelValue,
410
+ (i) => {
411
+ s.value = g(i);
412
+ }
413
+ ), A(z.global.locale, () => {
414
+ y.value.trim() || (s.value = g(x.modelValue));
415
+ }), A(
416
+ () => x.disabled,
417
+ (i) => {
418
+ i && (d.value = !1);
419
+ }
420
+ ), A(k, async (i) => {
421
+ await J(), d.value && i >= 0 && P.value?.querySelector(`[id="${n}-option-${i}"]`)?.scrollIntoView?.({ block: "nearest" });
422
+ });
423
+ const B = le(() => {
424
+ const i = Z.filter(
425
+ (c) => Ye(y.value).includes(c) || y.value.trim().toLocaleLowerCase().split(/\s+/).every((T) => r(c.code).toLocaleLowerCase().includes(T))
426
+ ).map((c) => ({
427
+ value: c.value,
428
+ label: r(c.code),
429
+ detail: c.value,
430
+ custom: !1
431
+ }));
432
+ return y.value.trim() ? Z.some(
433
+ (c) => c.value.toLowerCase() === y.value.trim().toLowerCase() || c.label === y.value.trim()
434
+ ) ? i : [
435
+ ...i,
436
+ {
437
+ value: y.value,
438
+ label: t("tools.listing_remake.targetLanguagePicker_4ac2d6d3", { p0: y.value }),
439
+ detail: t("tools.listing_remake.targetLanguagePicker_6cc17587"),
440
+ custom: !0
441
+ }
442
+ ] : [
443
+ {
444
+ value: "",
445
+ label: t("tools.listing_remake.targetLanguagePicker_a930c338"),
446
+ detail: "",
447
+ custom: !1
448
+ },
449
+ ...i
450
+ ];
451
+ });
452
+ A(
453
+ () => B.value.length,
454
+ async () => {
455
+ await J(), U();
456
+ }
457
+ );
458
+ function N() {
459
+ x.disabled || (y.value = "", k.value = -1, d.value = !0);
460
+ }
461
+ function M(i) {
462
+ x.disabled || (s.value = g(i), y.value = "", k.value = -1, d.value = !1, w("update:modelValue", i));
463
+ }
464
+ function F(i) {
465
+ x.disabled || (s.value = i.target.value, y.value = s.value, k.value = -1, d.value = !0, w("update:modelValue", s.value));
466
+ }
467
+ function W(i) {
468
+ if (!(x.disabled || i.isComposing || i.keyCode === 229)) {
469
+ if (i.key === "Escape") {
470
+ d.value = !1, k.value = -1, i.preventDefault();
471
+ return;
472
+ }
473
+ if (i.key === "ArrowDown" || i.key === "ArrowUp") {
474
+ i.preventDefault(), d.value || (y.value = "", d.value = !0, k.value = -1);
475
+ const b = B.value.length;
476
+ b && (k.value = i.key === "ArrowDown" ? (k.value + 1) % b : k.value <= 0 ? b - 1 : k.value - 1);
477
+ } else i.key === "Enter" && d.value && (i.preventDefault(), k.value >= 0 ? M(B.value[k.value].value) : d.value = !1);
478
+ }
479
+ }
480
+ function G(i) {
481
+ P.value?.contains(i.relatedTarget) || (d.value = !1);
482
+ }
483
+ function j(i) {
484
+ P.value?.contains(i.target) || (d.value = !1);
485
+ }
486
+ return ge(() => {
487
+ document.addEventListener("pointerdown", j), window.addEventListener("resize", U), document.addEventListener("scroll", U, !0);
488
+ }), de(() => {
489
+ document.removeEventListener("pointerdown", j), window.removeEventListener("resize", U), document.removeEventListener("scroll", U, !0);
490
+ }), (i, b) => (p(), h("div", {
491
+ ref_key: "root",
492
+ ref: P,
493
+ class: "lir-language-picker",
494
+ onFocusout: G
495
+ }, [
496
+ u("label", {
497
+ for: `${a(n)}-input`
498
+ }, v(a(t)("tools.listing_remake.targetLanguagePicker_c9dfdcf7")), 9, Ze),
499
+ u("div", ea, [
500
+ u("input", {
501
+ id: `${a(n)}-input`,
502
+ name: "targetLanguage",
503
+ role: "combobox",
504
+ value: s.value,
505
+ disabled: l.disabled,
506
+ placeholder: a(t)("tools.listing_remake.targetLanguagePicker_a930c338"),
507
+ maxlength: "100",
508
+ autocomplete: "off",
509
+ "aria-autocomplete": "list",
510
+ "aria-haspopup": "listbox",
511
+ "aria-expanded": d.value,
512
+ "aria-controls": `${a(n)}-list`,
513
+ "aria-activedescendant": d.value && k.value >= 0 ? `${a(n)}-option-${k.value}` : void 0,
514
+ onFocus: N,
515
+ onInput: F,
516
+ onKeydown: W
517
+ }, null, 40, aa),
518
+ s.value ? (p(), h("button", {
519
+ key: 0,
520
+ type: "button",
521
+ "aria-label": a(t)("tools.listing_remake.targetLanguagePicker_a89e3879"),
522
+ disabled: l.disabled,
523
+ onClick: b[0] || (b[0] = (c) => M(""))
524
+ }, [
525
+ I(a(_e), {
526
+ size: 14,
527
+ "aria-hidden": "true"
528
+ })
529
+ ], 8, ta)) : E("", !0),
530
+ u("button", {
531
+ type: "button",
532
+ "aria-label": a(t)("tools.listing_remake.targetLanguagePicker_8863a1ae"),
533
+ "aria-expanded": d.value,
534
+ disabled: l.disabled,
535
+ onClick: b[1] || (b[1] = (c) => d.value ? d.value = !1 : N())
536
+ }, [
537
+ I(a(ce), {
538
+ size: 15,
539
+ "aria-hidden": "true"
540
+ })
541
+ ], 8, la)
542
+ ]),
543
+ d.value && !l.disabled ? (p(), h("div", {
544
+ key: 0,
545
+ id: `${a(n)}-list`,
546
+ role: "listbox",
547
+ "aria-label": a(t)("tools.image_translation.translationFields_966a23e8"),
548
+ class: "lir-language-list",
549
+ "data-placement": L.value,
550
+ style: pe({
551
+ maxHeight: `${V.value}px`,
552
+ top: L.value === "below" ? `${S.value}px` : void 0,
553
+ bottom: L.value === "above" ? `${S.value}px` : void 0
554
+ })
555
+ }, [
556
+ (p(!0), h(ie, null, ne(B.value, (c, T) => (p(), h("button", {
557
+ id: `${a(n)}-option-${T}`,
558
+ key: c.value,
559
+ type: "button",
560
+ role: "option",
561
+ "aria-selected": l.modelValue === c.value,
562
+ "data-value": c.value,
563
+ "data-custom": c.custom,
564
+ class: Y({ active: k.value === T }),
565
+ onPointerdown: b[2] || (b[2] = Q(() => {
566
+ }, ["prevent"])),
567
+ onClick: (X) => M(c.value)
568
+ }, [
569
+ u("span", null, [
570
+ K(v(a(C)(c.label)), 1),
571
+ l.modelValue === c.value ? (p(), O(a(me), {
572
+ key: 0,
573
+ size: 13,
574
+ "aria-hidden": "true"
575
+ })) : E("", !0)
576
+ ]),
577
+ c.detail ? (p(), h("small", sa, v(c.detail), 1)) : E("", !0)
578
+ ], 42, na))), 128))
579
+ ], 12, ia)) : E("", !0),
580
+ u("p", oa, v(a(t)("tools.listing_remake.targetLanguagePicker_fce2cda5")), 1)
581
+ ], 544));
582
+ }
583
+ }), ra = /* @__PURE__ */ oe(ua, [["__scopeId", "data-v-b5813e79"]]), da = ["disabled"], ca = {
584
+ class: "reference-summary",
585
+ "data-testid": "reference-count"
586
+ }, ma = ["open"], va = { class: "optional-label" }, ga = {
587
+ class: "sr-only",
588
+ for: "lir-product-info"
589
+ }, pa = ["value", "placeholder"], fa = { class: "lir-section" }, ba = {
590
+ class: "lir-label",
591
+ id: "lir-mode-label"
592
+ }, ka = ["aria-label"], ha = ["data-mode", "aria-checked", "tabindex", "disabled", "onClick", "onKeydown"], ya = { class: "mode-card-top" }, _a = { class: "requirements-label" }, wa = ["value", "placeholder"], Pa = /* @__PURE__ */ ee({
593
+ __name: "ListingRemakePanel",
594
+ props: {
595
+ modelValue: {},
596
+ disabled: { type: Boolean },
597
+ scopeKey: {},
598
+ count: {},
599
+ upload: { type: Function }
600
+ },
601
+ emits: ["update:modelValue", "busy"],
602
+ setup(l, { emit: R }) {
603
+ const { ui: t, uiText: C } = ae(), r = l, z = R, x = $(), w = [
604
+ { value: "close_transfer", title: "贴近复刻", description: "贴近参考布局" },
605
+ { value: "transformative_remake", title: "翻新复刻", description: "翻新场景表达" }
606
+ ], P = le(
607
+ () => [r.modelValue.visualStyle, r.modelValue.extraRequirements].filter(Boolean).join(`
608
+
609
+ `)
610
+ );
611
+ function d(n) {
612
+ if (r.disabled) return;
613
+ const g = { ...r.modelValue, ...n };
614
+ z("update:modelValue", {
615
+ ...g,
616
+ productAssets: g.productAssets.map((s) => ({ ...s }))
617
+ });
618
+ }
619
+ function y(n) {
620
+ d({ visualStyle: "", extraRequirements: n });
621
+ }
622
+ async function k(n, g) {
623
+ if (r.disabled) return;
624
+ let s = g;
625
+ if (["ArrowLeft", "ArrowUp"].includes(n.key))
626
+ s = (g + w.length - 1) % w.length;
627
+ else if (["ArrowRight", "ArrowDown"].includes(n.key)) s = (g + 1) % w.length;
628
+ else if (n.key === "Home") s = 0;
629
+ else if (n.key === "End") s = w.length - 1;
630
+ else if (!["Enter", " "].includes(n.key)) return;
631
+ n.preventDefault(), d({ remakeLevel: w[s].value }), await J(), x.value?.querySelector(`[data-mode="${w[s].value}"]`)?.focus();
632
+ }
633
+ return (n, g) => (p(), h("fieldset", {
634
+ class: "tool-fields lir-fields",
635
+ disabled: l.disabled
636
+ }, [
637
+ u("div", ca, [
638
+ u("span", null, v(a(t)("tools.listing_remake.listingRemakePanel_e8a1ec99")), 1),
639
+ u("strong", null, v(a(t)("tools.listing_remake.listingRemakePanel_e8038b46", { p0: l.count ?? 0 })), 1)
640
+ ]),
641
+ I(Qe, {
642
+ "scope-key": l.scopeKey,
643
+ "model-value": l.modelValue.productAssets,
644
+ disabled: l.disabled,
645
+ upload: l.upload,
646
+ "onUpdate:modelValue": g[0] || (g[0] = (s) => d({ productAssets: s })),
647
+ onBusy: g[1] || (g[1] = (s) => z("busy", s))
648
+ }, null, 8, ["scope-key", "model-value", "disabled", "upload"]),
649
+ u("details", {
650
+ class: "product-facts",
651
+ open: l.modelValue.productInfo ? !0 : void 0
652
+ }, [
653
+ u("summary", null, [
654
+ u("span", null, [
655
+ K(v(a(t)("tools.listing_remake.listingRemakePanel_d241dc8f")), 1),
656
+ u("span", va, v(a(t)("tools.listing_remake.listingRemakePanel_53735240")), 1)
657
+ ]),
658
+ I(a(ce), {
659
+ size: 15,
660
+ "aria-hidden": "true"
661
+ })
662
+ ]),
663
+ u("p", null, v(a(t)("tools.listing_remake.listingRemakePanel_4b49d6ad")), 1),
664
+ u("label", ga, v(a(t)("tools.listing_remake.listingRemakePanel_51e36734")), 1),
665
+ u("textarea", {
666
+ id: "lir-product-info",
667
+ name: "productInfo",
668
+ value: l.modelValue.productInfo,
669
+ maxlength: "4000",
670
+ rows: "3",
671
+ placeholder: a(t)("tools.listing_remake.listingRemakePanel_9cbbe05c"),
672
+ onInput: g[2] || (g[2] = (s) => d({ productInfo: s.target.value }))
673
+ }, null, 40, pa)
674
+ ], 8, ma),
675
+ u("section", fa, [
676
+ u("span", ba, v(a(t)("tools.listing_remake.listingRemakePanel_a821d8b1")), 1),
677
+ u("div", {
678
+ ref_key: "modeGroup",
679
+ ref: x,
680
+ class: "mode-cards",
681
+ role: "radiogroup",
682
+ "aria-label": a(t)("tools.listing_remake.listingRemakePanel_b2f7e8b0")
683
+ }, [
684
+ (p(), h(ie, null, ne(w, (s, L) => u("button", {
685
+ key: s.value,
686
+ type: "button",
687
+ role: "radio",
688
+ "data-mode": s.value,
689
+ "aria-checked": l.modelValue.remakeLevel === s.value,
690
+ tabindex: l.modelValue.remakeLevel === s.value ? 0 : -1,
691
+ disabled: l.disabled,
692
+ onClick: (V) => d({ remakeLevel: s.value }),
693
+ onKeydown: (V) => k(V, L)
694
+ }, [
695
+ u("span", ya, [
696
+ s.value === "close_transfer" ? (p(), O(a(Re), {
697
+ key: 0,
698
+ size: 17,
699
+ "aria-hidden": "true"
700
+ })) : (p(), O(a(we), {
701
+ key: 1,
702
+ size: 17,
703
+ "aria-hidden": "true"
704
+ })),
705
+ l.modelValue.remakeLevel === s.value ? (p(), O(a(me), {
706
+ key: 2,
707
+ size: 14,
708
+ class: "mode-check",
709
+ "aria-hidden": "true"
710
+ })) : E("", !0)
711
+ ]),
712
+ u("strong", null, v(a(C)(s.title)), 1),
713
+ u("small", null, v(a(C)(s.description)), 1)
714
+ ], 40, ha)), 64))
715
+ ], 8, ka)
716
+ ]),
717
+ I(ra, {
718
+ "model-value": l.modelValue.targetLanguage,
719
+ disabled: l.disabled,
720
+ "onUpdate:modelValue": g[3] || (g[3] = (s) => d({ targetLanguage: s }))
721
+ }, null, 8, ["model-value", "disabled"]),
722
+ u("label", _a, [
723
+ K(v(a(t)("common.toolPanel_40c2f529")), 1),
724
+ u("textarea", {
725
+ name: "combinedRequirements",
726
+ value: P.value,
727
+ maxlength: "4000",
728
+ rows: "3",
729
+ placeholder: a(t)("tools.listing_remake.listingRemakePanel_7f8144e1"),
730
+ onInput: g[4] || (g[4] = (s) => y(s.target.value))
731
+ }, null, 40, wa)
732
+ ])
733
+ ], 8, da));
734
+ }
735
+ }), xa = /* @__PURE__ */ oe(Pa, [["__scopeId", "data-v-30ea34a0"]]), La = {
736
+ class: "hint",
737
+ "data-testid": "lir-submission-summary"
738
+ }, Ea = /* @__PURE__ */ ee({
739
+ __name: "ListingToolPanel",
740
+ props: {
741
+ context: {}
742
+ },
743
+ setup(l) {
744
+ const { ui: R } = ae(), t = l, C = Le(() => t.context), r = $(!1), z = $e(() => t.context, "lir");
745
+ return (x, w) => (p(), O(Pe, {
746
+ context: l.context,
747
+ layout: "contained",
748
+ class: "lir-panel"
749
+ }, {
750
+ actions: te(() => [
751
+ I(Ie, {
752
+ context: l.context,
753
+ available: a(ue)(l.context),
754
+ ready: !!a(C).lir.productAssets.length && !r.value,
755
+ label: r.value ? a(R)("common.toolPanel_dfd62459") : void 0
756
+ }, {
757
+ default: te(() => [
758
+ u("p", La, v(a(R)("common.toolPanel_d3ef5424", {
759
+ p0: a(C).lir.productAssets.length,
760
+ p1: l.context.view.count
761
+ })), 1)
762
+ ]),
763
+ _: 1
764
+ }, 8, ["context", "available", "ready", "label"])
765
+ ]),
766
+ default: te(() => [
767
+ I(xa, {
768
+ "scope-key": l.context.view.batchId,
769
+ "model-value": a(C).lir,
770
+ disabled: l.context.readonly || !a(ue)(l.context),
771
+ count: l.context.view.count,
772
+ upload: l.context.uploadReference,
773
+ "onUpdate:modelValue": a(z),
774
+ onBusy: w[0] || (w[0] = (P) => r.value = P)
775
+ }, null, 8, ["scope-key", "model-value", "disabled", "count", "upload", "onUpdate:modelValue"])
776
+ ]),
777
+ _: 1
778
+ }, 8, ["context"]));
779
+ }
780
+ });
781
+ export {
782
+ Ea as default
783
+ };