@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,1178 @@
1
+ import { defineComponent as ae, useId as Le, computed as P, openBlock as d, createElementBlock as u, unref as e, createElementVNode as s, createCommentVNode as b, defineAsyncComponent as Ze, ref as k, watch as j, onActivated as Ge, nextTick as O, createVNode as v, withCtx as K, Fragment as U, renderList as E, toDisplayString as c, normalizeClass as Qe, createBlock as J, createTextVNode as F } from "vue";
2
+ import { J as oe, F as ie, _ as _e, K as fe, L as te, N as Ye, O as Xe, Q as Y, S as et, T as tt, U as pe, V as lt, W as we, P as at, R as ot, X as ze, Y as it, Z as st, $ as ye, a0 as nt, a1 as le, a2 as rt, G as dt } from "./entry-DK9FjQZ_.js";
3
+ import { ar as Ue, ao as Se } from "./hosted-resources-COzZ7nZY.js";
4
+ import { B as ke } from "./BatchOutputColorPicker-CCvmIF-b.js";
5
+ import { C as ut } from "./ContentTrimControl-BQfigZPq.js";
6
+ import { S as ct } from "./search-BjTSm1KS.js";
7
+ import { u as ht, a as mt, c as bt, _ as vt, n as gt } from "./PluginActionFooter.vue_vue_type_script_setup_true_lang-C2kJCYeA.js";
8
+ /**
9
+ * @license @lucide/vue v1.47.0 - ISC
10
+ *
11
+ * This source code is licensed under the ISC license.
12
+ * See the LICENSE file in the root directory of this source tree.
13
+ */
14
+ const ft = {
15
+ name: "arrow-left-right",
16
+ size: 24,
17
+ node: [
18
+ ["path", { d: "M8 3 4 7l4 4", key: "9rb6wj" }],
19
+ ["path", { d: "M4 7h16", key: "6tx8e3" }],
20
+ ["path", { d: "m16 21 4-4-4-4", key: "siv7j2" }],
21
+ ["path", { d: "M20 17H4", key: "h6l3hr" }]
22
+ ]
23
+ }, Ce = oe(ft);
24
+ /**
25
+ * @license @lucide/vue v1.47.0 - ISC
26
+ *
27
+ * This source code is licensed under the ISC license.
28
+ * See the LICENSE file in the root directory of this source tree.
29
+ */
30
+ const pt = {
31
+ name: "lock-open",
32
+ size: 24,
33
+ node: [
34
+ ["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
35
+ ["path", { d: "M7 11V7a5 5 0 0 1 9.9-1", key: "1mm8w8" }]
36
+ ],
37
+ aliases: ["unlock"]
38
+ }, wt = oe(pt);
39
+ /**
40
+ * @license @lucide/vue v1.47.0 - ISC
41
+ *
42
+ * This source code is licensed under the ISC license.
43
+ * See the LICENSE file in the root directory of this source tree.
44
+ */
45
+ const zt = {
46
+ name: "lock",
47
+ size: 24,
48
+ node: [
49
+ ["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
50
+ ["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
51
+ ]
52
+ }, yt = oe(zt), kt = ["viewBox", "aria-label"], Ct = ["id", "width", "height"], Pt = ["width", "height"], Vt = ["width", "height"], xt = ["x", "y", "width", "height"], $t = ["id"], Rt = ["width", "height"], Lt = ["width", "height", "fill"], _t = ["clip-path"], Ut = ["x", "y", "width", "height", "viewBox"], St = ["width", "height"], It = ["points"], Mt = ["cx", "cy", "r"], Dt = ["d"], Bt = ["x", "y", "width", "height"], Et = ["width", "height"], At = /* @__PURE__ */ ae({
53
+ __name: "SizeCropIllustration",
54
+ props: {
55
+ label: {},
56
+ width: {},
57
+ height: {},
58
+ method: {},
59
+ anchor: {},
60
+ background: { default: "#ffffff" },
61
+ sourceWidth: { default: 5461 },
62
+ sourceHeight: { default: 4096 },
63
+ allowEnlargement: { type: Boolean, default: !0 }
64
+ },
65
+ setup(t) {
66
+ const { ui: M, uiText: x } = ie(), i = t, h = Le(), l = P(() => {
67
+ if (i.method === "crop") {
68
+ const z = Ue(i.sourceWidth, i.sourceHeight, {
69
+ version: 1,
70
+ ratio: `${i.width}:${i.height}`,
71
+ anchor: i.anchor
72
+ });
73
+ return {
74
+ width: i.sourceWidth,
75
+ height: i.sourceHeight,
76
+ image: { x: 0, y: 0, width: i.sourceWidth, height: i.sourceHeight },
77
+ crop: z,
78
+ mask: `M0 0h${i.sourceWidth}v${i.sourceHeight}h-${i.sourceWidth}Z M${z.x} ${z.y}h${z.width}v${z.height}h-${z.width}Z`
79
+ };
80
+ }
81
+ const p = Se(i.sourceWidth, i.sourceHeight, {
82
+ width: i.width,
83
+ height: i.height,
84
+ fit: i.method,
85
+ position: i.anchor,
86
+ background: i.background,
87
+ allowEnlargement: i.allowEnlargement
88
+ });
89
+ return {
90
+ width: p.width,
91
+ height: p.height,
92
+ image: p.imageRect,
93
+ crop: void 0,
94
+ mask: void 0
95
+ };
96
+ });
97
+ return (p, z) => (d(), u("svg", {
98
+ viewBox: `0 0 ${l.value.width} ${l.value.height}`,
99
+ role: "img",
100
+ "aria-label": e(x)(t.label),
101
+ preserveAspectRatio: "xMidYMid meet",
102
+ class: "size-illustration"
103
+ }, [
104
+ s("defs", null, [
105
+ s("pattern", {
106
+ id: `${e(h)}-checker`,
107
+ width: l.value.width / 8,
108
+ height: l.value.height / 8,
109
+ patternUnits: "userSpaceOnUse"
110
+ }, [
111
+ s("rect", {
112
+ width: l.value.width / 8,
113
+ height: l.value.height / 8,
114
+ fill: "#ffffff"
115
+ }, null, 8, Pt),
116
+ s("rect", {
117
+ width: l.value.width / 16,
118
+ height: l.value.height / 16,
119
+ fill: "#e4e4e7"
120
+ }, null, 8, Vt),
121
+ s("rect", {
122
+ x: l.value.width / 16,
123
+ y: l.value.height / 16,
124
+ width: l.value.width / 16,
125
+ height: l.value.height / 16,
126
+ fill: "#e4e4e7"
127
+ }, null, 8, xt)
128
+ ], 8, Ct),
129
+ s("clipPath", {
130
+ id: `${e(h)}-clip`
131
+ }, [
132
+ s("rect", {
133
+ x: "0",
134
+ y: "0",
135
+ width: l.value.width,
136
+ height: l.value.height
137
+ }, null, 8, Rt)
138
+ ], 8, $t)
139
+ ]),
140
+ s("rect", {
141
+ x: "0",
142
+ y: "0",
143
+ width: l.value.width,
144
+ height: l.value.height,
145
+ fill: t.background === "transparent" ? `url(#${e(h)}-checker)` : t.background
146
+ }, null, 8, Lt),
147
+ s("g", {
148
+ "clip-path": `url(#${e(h)}-clip)`
149
+ }, [
150
+ (d(), u("svg", {
151
+ x: l.value.image.x,
152
+ y: l.value.image.y,
153
+ width: l.value.image.width,
154
+ height: l.value.image.height,
155
+ viewBox: `0 0 ${t.sourceWidth} ${t.sourceHeight}`,
156
+ preserveAspectRatio: "none",
157
+ class: "size-illustration-photo"
158
+ }, [
159
+ s("rect", {
160
+ x: "0",
161
+ y: "0",
162
+ width: t.sourceWidth,
163
+ height: t.sourceHeight,
164
+ fill: "#eff3e8"
165
+ }, null, 8, St),
166
+ s("polygon", {
167
+ points: `0,${t.sourceHeight} ${t.sourceWidth * 0.4},${t.sourceHeight * 0.4} ${t.sourceWidth * 0.83},${t.sourceHeight}`,
168
+ fill: "#b7c69f"
169
+ }, null, 8, It),
170
+ s("circle", {
171
+ cx: t.sourceWidth * 0.76,
172
+ cy: t.sourceHeight * 0.24,
173
+ r: Math.min(t.sourceWidth, t.sourceHeight) * 0.075,
174
+ fill: "#91a76d"
175
+ }, null, 8, Mt)
176
+ ], 8, Ut)),
177
+ l.value.mask ? (d(), u("path", {
178
+ key: 0,
179
+ d: l.value.mask,
180
+ fill: "#24262a",
181
+ "fill-opacity": ".2",
182
+ "fill-rule": "evenodd"
183
+ }, null, 8, Dt)) : b("", !0)
184
+ ], 8, _t),
185
+ l.value.crop ? (d(), u("rect", {
186
+ key: 0,
187
+ class: "size-illustration-crop",
188
+ x: l.value.crop.x,
189
+ y: l.value.crop.y,
190
+ width: l.value.crop.width,
191
+ height: l.value.crop.height,
192
+ fill: "none",
193
+ stroke: "#84a447",
194
+ "stroke-width": "1.5",
195
+ "vector-effect": "non-scaling-stroke"
196
+ }, null, 8, Bt)) : (d(), u("rect", {
197
+ key: 1,
198
+ x: "0",
199
+ y: "0",
200
+ width: l.value.width,
201
+ height: l.value.height,
202
+ fill: "none",
203
+ stroke: "#a6b690",
204
+ "stroke-width": "1",
205
+ "vector-effect": "non-scaling-stroke"
206
+ }, null, 8, Et))
207
+ ], 8, kt));
208
+ }
209
+ }), X = /* @__PURE__ */ _e(At, [["__scopeId", "data-v-219fa766"]]), Tt = "" + new URL("../assets/amazon-CjTtpZTq.webp", import.meta.url).href, Ht = "" + new URL("../assets/ebay-CxLfrRAf.webp", import.meta.url).href, Wt = "" + new URL("../assets/etsy-CSvz9GpY.webp", import.meta.url).href, Ot = "" + new URL("../assets/shopify-wVaBafcF.webp", import.meta.url).href, Pe = "" + new URL("../assets/facebook-Ca2nJJiQ.webp", import.meta.url).href, Kt = "" + new URL("../assets/instagram-Bf0IVidT.webp", import.meta.url).href, qt = "" + new URL("../assets/mercado-libre-C8CskEiS.webp", import.meta.url).href, Ve = "" + new URL("../assets/whatsapp-CWJxqzR6.webp", import.meta.url).href, xe = "" + new URL("../assets/line-Dr1j___B.webp", import.meta.url).href, Nt = "" + new URL("../assets/poshmark-DnZi2vA1.webp", import.meta.url).href, jt = "" + new URL("../assets/depop-CkVC5Fn1.webp", import.meta.url).href, Ft = "" + new URL("../assets/vinted-1QDsxvC6.webp", import.meta.url).href, Jt = "" + new URL("../assets/shopee-Bxfei6sj.webp", import.meta.url).href, Zt = "" + new URL("../assets/lazada-ConR4e1O.webp", import.meta.url).href, Gt = "" + new URL("../assets/momo-BWXO_8Df.webp", import.meta.url).href, Qt = "" + new URL("../assets/shopline-DMoaJ7Bh.webp", import.meta.url).href, Yt = "" + new URL("../assets/nuvemshop-DPt6rnA-.webp", import.meta.url).href, $e = "" + new URL("../assets/mercari-jp-DHj7nz4O.webp", import.meta.url).href, Xt = "" + new URL("../assets/creema-B1tWyCPx.webp", import.meta.url).href, el = "" + new URL("../assets/rakuten-ulYog1hL.webp", import.meta.url).href, tl = "" + new URL("../assets/qoo10-C1pq81Jx.webp", import.meta.url).href, ll = "" + new URL("../assets/buyma-dAxYNjow.webp", import.meta.url).href, al = "" + new URL("../assets/naver-xQKL8lWg.webp", import.meta.url).href, ol = "" + new URL("../assets/karrot-BXFPhDwt.webp", import.meta.url).href, il = "" + new URL("../assets/g-market-DXuYK_JH.webp", import.meta.url).href, sl = "" + new URL("../assets/ssg-DQoFx5u5.webp", import.meta.url).href, nl = "" + new URL("../assets/idus-7diqRNPs.webp", import.meta.url).href, rl = "" + new URL("../assets/auction-j26eVUQO.webp", import.meta.url).href, dl = "" + new URL("../assets/11st-D7qGO5e4.webp", import.meta.url).href, ul = "" + new URL("../assets/kakao-talk-Df79L_Mv.webp", import.meta.url).href, cl = "" + new URL("../assets/otto-market-DWZyNKJn.webp", import.meta.url).href, hl = "" + new URL("../assets/zalando-CenfWOwz.webp", import.meta.url).href, ml = "" + new URL("../assets/kaufland-BDDy6e0C.webp", import.meta.url).href, bl = "" + new URL("../assets/olx-B87gp-Il.webp", import.meta.url).href, vl = "" + new URL("../assets/douyin-CP_HwBDF.webp", import.meta.url).href, gl = "" + new URL("../assets/youtube-DS12d5mi.webp", import.meta.url).href, fl = "" + new URL("../assets/linkedin-4s_9Wh03.webp", import.meta.url).href, pl = "" + new URL("../assets/pinterest-ByZqih2J.webp", import.meta.url).href, Re = Object.freeze({
210
+ Amazon: Tt,
211
+ eBay: Ht,
212
+ Etsy: Wt,
213
+ Shopify: Ot,
214
+ Facebook: Pe,
215
+ Instagram: Kt,
216
+ "Mercado Libre": qt,
217
+ WhatsApp: Ve,
218
+ LINE: xe,
219
+ Poshmark: Nt,
220
+ Depop: jt,
221
+ Vinted: Ft,
222
+ Shopee: Jt,
223
+ Lazada: Zt,
224
+ MOMO: Gt,
225
+ Shopline: Qt,
226
+ Nuvemshop: Yt,
227
+ "Mercari JP": $e,
228
+ Creema: Xt,
229
+ Rakuten: el,
230
+ Qoo10: tl,
231
+ BUYMA: ll,
232
+ Naver: al,
233
+ Karrot: ol,
234
+ "G Market": il,
235
+ SSG: sl,
236
+ Idus: nl,
237
+ Auction: rl,
238
+ "11st": dl,
239
+ "Kakao Talk": ul,
240
+ "Otto Market": cl,
241
+ Zalando: hl,
242
+ Kaufland: ml,
243
+ OLX: bl,
244
+ 抖音: vl,
245
+ YouTube: gl,
246
+ LinkedIn: fl,
247
+ Pinterest: pl,
248
+ "Facebook Marketplace": Pe,
249
+ "WhatsApp Business": Ve,
250
+ "LINE Shop": xe,
251
+ Mercari: $e
252
+ });
253
+ function ee(t) {
254
+ const M = Object.prototype.hasOwnProperty.call(Re, t) ? Re[t] : void 0;
255
+ return M ? { src: M, alt: t } : void 0;
256
+ }
257
+ const wl = ["aria-label"], zl = ["aria-label"], yl = ["id", "aria-controls", "aria-selected", "tabindex", "disabled", "data-size-mode", "onClick", "onKeydown"], kl = {
258
+ key: 0,
259
+ class: "size-search"
260
+ }, Cl = ["disabled", "aria-label", "aria-controls", "aria-expanded", "aria-activedescendant", "value", "placeholder"], Pl = ["disabled", "aria-label", "title"], Vl = {
261
+ class: "size-selection-note",
262
+ role: "status"
263
+ }, xl = {
264
+ key: 1,
265
+ class: "size-snapshot-note"
266
+ }, $l = ["id", "aria-labelledby", "disabled"], Rl = { class: "size-catalog-heading" }, Ll = ["aria-label", "title"], _l = ["id", "aria-label"], Ul = ["aria-label"], Sl = ["id", "aria-selected", "tabindex", "data-option-index", "title", "onClick"], Il = { class: "size-platform-mark" }, Ml = ["src", "alt"], Dl = ["title"], Bl = {
267
+ key: 2,
268
+ viewBox: "0 0 24 24",
269
+ "aria-hidden": "true"
270
+ }, El = { class: "size-catalog-copy" }, Al = { key: 0 }, Tl = { key: 1 }, Hl = { key: 2 }, Wl = { class: "size-catalog-icons" }, Ol = {
271
+ viewBox: "0 0 24 24",
272
+ "aria-hidden": "true"
273
+ }, Kl = ["x", "y", "width", "height"], ql = {
274
+ key: 0,
275
+ class: "size-empty"
276
+ }, Nl = ["aria-label", "disabled"], jl = ["id", "aria-labelledby", "disabled"], Fl = {
277
+ key: 1,
278
+ class: "size-background"
279
+ }, Jl = {
280
+ key: 0,
281
+ class: "size-quick-presets"
282
+ }, Zl = ["aria-label", "aria-pressed", "title", "onClick"], Gl = {
283
+ viewBox: "0 0 24 24",
284
+ "aria-hidden": "true"
285
+ }, Ql = ["width", "height"], Yl = {
286
+ key: 0,
287
+ d: "M9 12h6M12 9v6",
288
+ stroke: "currentColor",
289
+ "stroke-width": "1.4"
290
+ }, Xl = {
291
+ key: 1,
292
+ d: "M8 12h8M12 8v8",
293
+ stroke: "currentColor",
294
+ "stroke-width": "1.4"
295
+ }, ea = {
296
+ key: 2,
297
+ class: "size-template-label"
298
+ }, ta = ["title"], la = {
299
+ key: 3,
300
+ class: "size-original-note"
301
+ }, aa = { class: "size-specification" }, oa = ["title"], ia = {
302
+ key: 0,
303
+ class: "size-preset-actions"
304
+ }, sa = ["aria-label", "title"], na = ["aria-label"], ra = ["data-method", "aria-label", "aria-checked", "tabindex", "title", "onClick", "onKeydown"], da = {
305
+ key: 0,
306
+ class: "size-current-output",
307
+ role: "status"
308
+ }, ua = { class: "size-dimensions" }, ca = ["aria-label", "value", "aria-invalid", "aria-describedby"], ha = { class: "size-dimension-icons" }, ma = ["aria-label", "title", "aria-checked", "disabled"], ba = ["aria-label", "title", "disabled"], va = ["aria-label", "value", "aria-invalid", "aria-describedby"], ga = ["id"], fa = { class: "size-position-controls" }, pa = ["aria-label"], wa = ["aria-label", "title", "aria-pressed", "onClick"], za = { class: "size-position-examples" }, ya = {
309
+ key: 2,
310
+ class: "size-background"
311
+ }, ka = {
312
+ key: 3,
313
+ class: "size-advanced"
314
+ }, Ca = ["tabindex", "aria-disabled"], Pa = { class: "size-enlarge-field" }, Va = ["aria-label", "aria-checked"], xa = ["aria-label", "value"], $a = ["value"], Ra = ["aria-label"], La = /* @__PURE__ */ ae({
315
+ name: "SizeCropPanel",
316
+ __name: "SizeCropPanel",
317
+ props: {
318
+ modelValue: {},
319
+ disabled: { type: Boolean },
320
+ count: {},
321
+ currentWidth: {},
322
+ currentHeight: {},
323
+ scopeKey: {},
324
+ viewingSnapshot: { type: Boolean },
325
+ hideReset: { type: Boolean },
326
+ trimPreviewSource: {},
327
+ trimEstimateApplied: { type: Boolean }
328
+ },
329
+ emits: ["update:modelValue", "validity"],
330
+ setup(t, { expose: M, emit: x }) {
331
+ const { ui: i, uiText: h } = ie(), l = t, p = x, z = Ze(
332
+ () => import("./MaterialSelectionPlate-DhioUjdW.js")
333
+ ), S = k(!1);
334
+ let D = !1;
335
+ j(
336
+ () => l.modelValue,
337
+ () => {
338
+ S.value = D, D = !1;
339
+ }
340
+ );
341
+ const g = Le(), f = k(!1), y = k(""), $ = k(0), m = k(-1), R = k(), Q = k(), se = k(), A = k(String(l.modelValue.width)), T = k(String(l.modelValue.height)), w = k(""), ne = k(!0), L = P(() => l.modelValue.method === "trim" ? "trim" : "size"), Ie = [
342
+ { value: "size", label: "尺寸 / 比例" },
343
+ { value: "trim", label: "按内容裁边" }
344
+ ], I = [
345
+ { value: "contain", label: "完整保留", help: "等比缩放,可留白" },
346
+ { value: "cover", label: "裁满画布", help: "等比铺满,裁去边缘" },
347
+ { value: "crop", label: "仅裁切", help: "只按比例裁切,不缩放" }
348
+ ], re = [
349
+ { value: "lanczos3", label: "Lanczos3 · 清晰" },
350
+ { value: "mitchell", label: "Mitchell · 平衡" },
351
+ { value: "cubic", label: "Catmull-Rom · 平滑" },
352
+ { value: "linear", label: "Bilinear · 柔和" }
353
+ ], de = [
354
+ { value: "top-left", label: "左上", symbol: "↖" },
355
+ { value: "top", label: "顶部", symbol: "↑" },
356
+ { value: "top-right", label: "右上", symbol: "↗" },
357
+ { value: "left", label: "左侧", symbol: "←" },
358
+ { value: "center", label: "居中", symbol: "·" },
359
+ { value: "right", label: "右侧", symbol: "→" },
360
+ { value: "bottom-left", label: "左下", symbol: "↙" },
361
+ { value: "bottom", label: "底部", symbol: "↓" },
362
+ { value: "bottom-right", label: "右下", symbol: "↘" }
363
+ ], ue = {
364
+ "standard-square": "方图",
365
+ "standard-portrait": "竖图",
366
+ "standard-landscape": "横图",
367
+ custom: "自定义"
368
+ }, Me = { original: "保持各图当前尺寸", custom: "自定义尺寸" }, De = {
369
+ reference: "参考尺寸",
370
+ "official-minimum": "官方最低尺寸",
371
+ "official-recommended": "官方建议尺寸"
372
+ }, H = P(
373
+ () => ["original", "custom"].includes(l.modelValue.presetId) ? void 0 : fe(l.modelValue.presetId)
374
+ ), Be = P(
375
+ () => l.modelValue.sizeMode === "original" ? i("tools.resize.sizeCropPanel_2dfe85f0") : H.value ? [H.value.platform, h(H.value.label)].filter(Boolean).join(" · ") : i("tools.resize.sizeCropPanel_8a2e2847")
376
+ ), Ee = P(() => te(l.modelValue)), C = P(() => Ye(y.value)), Ae = P(() => {
377
+ if (y.value.trim())
378
+ return [
379
+ {
380
+ id: "search",
381
+ label: i("tools.resize.sizeCropPanel_88d72ece"),
382
+ options: C.value.map((n, a) => ({ preset: n, index: a }))
383
+ }
384
+ ];
385
+ const o = [];
386
+ return C.value.forEach((n, a) => {
387
+ let r = o.find((V) => V.id === n.group);
388
+ r || (r = {
389
+ id: n.group,
390
+ label: Xe.find((V) => V.id === n.group)?.label ?? n.group,
391
+ options: []
392
+ }, o.push(r)), r.options.push({ preset: n, index: a });
393
+ }), o;
394
+ }), Te = P(
395
+ () => m.value >= 0 && C.value[m.value] ? `${g}-option-${C.value[m.value].id}` : void 0
396
+ ), He = P(
397
+ () => i(
398
+ l.modelValue.method === "contain" ? "tools.resize.positionAligned" : "tools.resize.positionKept",
399
+ {
400
+ position: h(
401
+ de.find((o) => o.value === l.modelValue.anchor)?.label || "居中"
402
+ )
403
+ }
404
+ )
405
+ ), ce = P(() => {
406
+ if (l.modelValue.method === "trim") return i("tools.crop.contentTrim.singlePreview");
407
+ if (l.modelValue.sizeMode === "original") return "";
408
+ if (l.modelValue.method !== "crop") {
409
+ if (l.modelValue.allowEnlargement || l.viewingSnapshot || !l.currentWidth || !l.currentHeight)
410
+ return "";
411
+ try {
412
+ const o = Se(l.currentWidth, l.currentHeight, {
413
+ width: l.modelValue.width,
414
+ height: l.modelValue.height,
415
+ fit: l.modelValue.method,
416
+ background: l.modelValue.background,
417
+ position: l.modelValue.anchor,
418
+ allowEnlargement: !1
419
+ });
420
+ return o.skipped ? i("tools.resize.sizeCropPanel_113e4bd6", { p0: o.width, p1: o.height }) : "";
421
+ } catch {
422
+ return "";
423
+ }
424
+ }
425
+ if (l.viewingSnapshot || !l.currentWidth || !l.currentHeight)
426
+ return i("tools.resize.sizeCropPanel_347ab08e");
427
+ try {
428
+ const o = Ue(l.currentWidth, l.currentHeight, {
429
+ version: 1,
430
+ ratio: `${l.modelValue.width}:${l.modelValue.height}`,
431
+ anchor: l.modelValue.anchor
432
+ });
433
+ return i("tools.resize.sizeCropPanel_c87c0205", { p0: o.width, p1: o.height });
434
+ } catch {
435
+ return i("tools.resize.sizeCropPanel_fd9f2cab");
436
+ }
437
+ });
438
+ function q(o) {
439
+ return o ? o.id === "original" ? "保持每张图片当前版本的像素尺寸,无需处理;不是恢复上传原图。" : o.id === "custom" ? "自选模板宽高或裁切比例。" : `${o.platform} · ${h(o.label)} · ${o.width} × ${o.height} · ${we(o)} · ${h(De[o.basis])}${o.source ? ` · ${i("common.source")}: ${h(o.source)}` : ""}` : "可自定义宽高与处理方式。";
440
+ }
441
+ function N(o) {
442
+ const n = Number(o);
443
+ return !!o.trim() && Number.isInteger(n) && n >= 1 && n <= 4096;
444
+ }
445
+ function B() {
446
+ l.disabled || p(
447
+ "validity",
448
+ l.modelValue.method === "trim" ? ne.value : !w.value && N(A.value) && N(T.value)
449
+ );
450
+ }
451
+ function W(o = l.modelValue) {
452
+ A.value = String(o.width), T.value = String(o.height), w.value = "", B();
453
+ }
454
+ function _(o, n) {
455
+ l.disabled || (D = !!n?.detail, p("update:modelValue", ze({ ...l.modelValue, ...o })));
456
+ }
457
+ function he(o, n) {
458
+ l.disabled || L.value === o || (D = !!n?.detail, f.value = !1, p("update:modelValue", it(l.modelValue, o)));
459
+ }
460
+ function We(o, n) {
461
+ if (l.disabled || o.defaultPrevented) return;
462
+ let a;
463
+ if (["ArrowLeft", "ArrowRight"].includes(o.key)) a = n === "size" ? "trim" : "size";
464
+ else if (o.key === "Home") a = "size";
465
+ else if (o.key === "End") a = "trim";
466
+ else return;
467
+ o.preventDefault(), o.stopPropagation();
468
+ const r = o.currentTarget.closest("[role=tablist]");
469
+ he(a), O(
470
+ () => r?.querySelector(`[data-size-mode="${a}"]`)?.focus()
471
+ );
472
+ }
473
+ function Oe(o) {
474
+ (o === "transparent" || /^#[0-9a-f]{6}$/i.test(o)) && _({ background: o.toLowerCase() });
475
+ }
476
+ function Ke(o) {
477
+ const n = o.target.value;
478
+ re.some((a) => a.value === n) && _({ kernel: n });
479
+ }
480
+ function Z(o, n) {
481
+ if (l.disabled) return;
482
+ D = !!n?.detail;
483
+ const a = st(l.modelValue, o);
484
+ W(a), p("update:modelValue", a), G();
485
+ }
486
+ function me(o, n) {
487
+ if (l.disabled) return;
488
+ const a = n.target.value;
489
+ if (o === "width" ? A.value = a : T.value = a, w.value = "", !N(a) || !l.modelValue.lockRatio && (!N(A.value) || !N(T.value))) {
490
+ w.value = "宽高需为 1–4096 的整数。", B();
491
+ return;
492
+ }
493
+ try {
494
+ let r = ye(l.modelValue, o, Number(a));
495
+ if (!l.modelValue.lockRatio) {
496
+ const V = o === "width" ? "height" : "width";
497
+ r = ye(
498
+ r,
499
+ V,
500
+ Number(V === "width" ? A.value : T.value)
501
+ );
502
+ }
503
+ W(r), p("update:modelValue", r);
504
+ } catch {
505
+ w.value = "锁定比例后的宽高需在 1–4096 之间。", B();
506
+ }
507
+ }
508
+ function be() {
509
+ if (l.disabled || w.value) return;
510
+ const o = nt(l.modelValue);
511
+ W(o), p("update:modelValue", o);
512
+ }
513
+ function qe() {
514
+ if (l.disabled) return;
515
+ const o = ze(le);
516
+ W(o), p("update:modelValue", o);
517
+ }
518
+ function G() {
519
+ const o = f.value;
520
+ R.value && ($.value = R.value.scrollTop), f.value = !1, o && O(() => se.value?.focus());
521
+ }
522
+ function Ne() {
523
+ return f.value ? (G(), !0) : !1;
524
+ }
525
+ M({ dismissOverlay: Ne, hasOverlay: () => f.value });
526
+ async function je() {
527
+ l.disabled || (f.value = !0, m.value = C.value.findIndex((o) => o.id === l.modelValue.presetId), await O(), R.value && (R.value.scrollTop = $.value), Q.value?.focus());
528
+ }
529
+ function Fe(o) {
530
+ l.disabled || (y.value = o.target.value, m.value = -1, $.value = 0, y.value.trim() && (f.value = !0), R.value && (R.value.scrollTop = 0));
531
+ }
532
+ function ve(o) {
533
+ if (l.disabled || o.defaultPrevented) return;
534
+ if (o.key === "Escape") {
535
+ o.preventDefault(), o.stopPropagation(), G();
536
+ return;
537
+ }
538
+ const n = o.target.closest("[data-option-index]");
539
+ if (!(o.target !== Q.value && !n)) {
540
+ if (!f.value && ["ArrowDown", "ArrowUp", "Home", "End", "Enter"].includes(o.key) && (f.value = !0, m.value = -1), o.key === "Enter" && C.value.length) {
541
+ const a = n ? Number(n.dataset.optionIndex) : Math.max(0, m.value);
542
+ o.preventDefault(), o.stopPropagation(), Z(C.value[a].id);
543
+ return;
544
+ }
545
+ ["ArrowDown", "ArrowUp", "Home", "End"].includes(o.key) && (o.preventDefault(), o.stopPropagation(), C.value.length && (n && (m.value = Number(n.dataset.optionIndex)), o.key === "Home" ? m.value = 0 : o.key === "End" ? m.value = C.value.length - 1 : o.key === "ArrowDown" ? m.value = (m.value + 1) % C.value.length : m.value = m.value <= 0 ? C.value.length - 1 : m.value - 1, O(() => {
546
+ const a = R.value?.querySelector(
547
+ `[data-option-index="${m.value}"]`
548
+ );
549
+ a?.scrollIntoView?.({ block: "nearest" }), n && a?.focus();
550
+ })));
551
+ }
552
+ }
553
+ function Je(o, n) {
554
+ if (l.disabled || o.defaultPrevented) return;
555
+ const a = I.findIndex((ge) => ge.value === n);
556
+ let r;
557
+ if (o.key === "ArrowRight" || o.key === "ArrowDown") r = (a + 1) % I.length;
558
+ else if (o.key === "ArrowLeft" || o.key === "ArrowUp")
559
+ r = (a + I.length - 1) % I.length;
560
+ else if (o.key === "Home") r = 0;
561
+ else if (o.key === "End") r = I.length - 1;
562
+ else return;
563
+ o.preventDefault(), o.stopPropagation(), _({ method: I[r].value });
564
+ const V = o.currentTarget?.parentElement;
565
+ O(
566
+ () => V?.querySelector(`[data-method="${I[r].value}"]`)?.focus()
567
+ );
568
+ }
569
+ return j(
570
+ [
571
+ () => l.modelValue.width,
572
+ () => l.modelValue.height,
573
+ () => l.modelValue.presetId,
574
+ () => l.modelValue.sizeMode
575
+ ],
576
+ () => W(),
577
+ { immediate: !0 }
578
+ ), j(
579
+ () => l.modelValue.method,
580
+ () => B()
581
+ ), j(
582
+ () => l.scopeKey,
583
+ () => {
584
+ y.value = "", $.value = 0, m.value = -1, f.value = !1, W();
585
+ }
586
+ ), j(
587
+ () => l.disabled,
588
+ (o) => {
589
+ o ? f.value = !1 : B();
590
+ }
591
+ ), Ge(() => {
592
+ S.value = !1, B(), f.value && O(() => {
593
+ R.value && (R.value.scrollTop = $.value);
594
+ });
595
+ }), (o, n) => (d(), u("section", {
596
+ class: "size-crop-panel material-selection-controls",
597
+ "aria-label": e(i)("tools.resize.sizeCropPanel_46d77e1e")
598
+ }, [
599
+ v(e(Y), {
600
+ id: `${e(g)}-material-modes`
601
+ }, {
602
+ default: K(() => [
603
+ s("div", {
604
+ class: "size-mode-tabs",
605
+ role: "tablist",
606
+ "aria-label": e(h)("处理目标")
607
+ }, [
608
+ (d(), u(U, null, E(Ie, (a) => s("button", {
609
+ id: `${e(g)}-${a.value}-tab`,
610
+ key: a.value,
611
+ type: "button",
612
+ role: "tab",
613
+ "aria-controls": `${e(g)}-mode-page`,
614
+ "aria-selected": L.value === a.value,
615
+ tabindex: L.value === a.value ? 0 : -1,
616
+ disabled: t.disabled,
617
+ "data-size-mode": a.value,
618
+ onClick: (r) => he(a.value, r),
619
+ onKeydown: (r) => We(r, a.value)
620
+ }, [
621
+ v(e(z), {
622
+ selected: L.value === a.value,
623
+ animate: S.value
624
+ }, null, 8, ["selected", "animate"]),
625
+ s("span", null, c(e(h)(a.label)), 1)
626
+ ], 40, yl)), 64))
627
+ ], 8, zl)
628
+ ]),
629
+ _: 1
630
+ }, 8, ["id"]),
631
+ L.value === "size" ? (d(), u("div", kl, [
632
+ v(e(ct), { size: 15 }),
633
+ s("input", {
634
+ ref_key: "searchInput",
635
+ ref: Q,
636
+ type: "search",
637
+ disabled: t.disabled,
638
+ "aria-label": e(i)("tools.resize.sizeCropPanel_83918892"),
639
+ role: "combobox",
640
+ "aria-controls": f.value ? `${e(g)}-catalog` : void 0,
641
+ "aria-expanded": f.value,
642
+ "aria-activedescendant": f.value ? Te.value : void 0,
643
+ value: y.value,
644
+ placeholder: e(i)("tools.resize.sizeCropPanel_afce8afc"),
645
+ onInput: Fe,
646
+ onKeydown: ve
647
+ }, null, 40, Cl),
648
+ s("button", {
649
+ ref_key: "catalogButton",
650
+ ref: se,
651
+ type: "button",
652
+ class: "size-browse-icon",
653
+ disabled: t.disabled,
654
+ "aria-label": e(i)("tools.resize.sizeCropPanel_81807c31"),
655
+ title: e(i)("tools.resize.sizeCropPanel_4be6e4b2"),
656
+ onClick: je
657
+ }, [
658
+ v(e(et), { size: 15 })
659
+ ], 8, Pl)
660
+ ])) : b("", !0),
661
+ s("p", Vl, c(t.count === void 0 ? e(i)("tools.resize.sizeCropPanel_90b436bd", { p0: e(i)("tools.resize.nested_638af896") }) : e(i)("tools.resize.applySelected", { count: t.count }, t.count)), 1),
662
+ t.viewingSnapshot ? (d(), u("p", xl, c(e(i)("tools.resize.sizeCropPanel_17f0beee")), 1)) : b("", !0),
663
+ f.value ? (d(), u("fieldset", {
664
+ key: 2,
665
+ id: `${e(g)}-mode-page`,
666
+ role: "tabpanel",
667
+ "aria-labelledby": `${e(g)}-${L.value}-tab`,
668
+ class: "size-catalog",
669
+ disabled: t.disabled,
670
+ onKeydown: ve
671
+ }, [
672
+ s("div", Rl, [
673
+ s("button", {
674
+ type: "button",
675
+ "aria-label": e(i)("tools.resize.sizeCropPanel_70d27247"),
676
+ title: e(i)("tools.resize.sizeCropPanel_70d27247"),
677
+ onClick: G
678
+ }, [
679
+ v(e(tt), {
680
+ class: "directional-icon",
681
+ size: 16
682
+ })
683
+ ], 8, Ll),
684
+ s("strong", null, c(e(i)("tools.resize.sizeCropPanel_e2396e63")), 1),
685
+ s("small", null, c(C.value.length), 1)
686
+ ]),
687
+ s("div", {
688
+ ref_key: "catalogScroll",
689
+ ref: R,
690
+ class: "size-catalog-scroll",
691
+ onScroll: n[1] || (n[1] = (a) => $.value = a.target.scrollTop)
692
+ }, [
693
+ s("div", {
694
+ id: `${e(g)}-catalog`,
695
+ role: "listbox",
696
+ "aria-label": e(i)("tools.resize.sizeCropPanel_154d27a1")
697
+ }, [
698
+ (d(!0), u(U, null, E(Ae.value, (a) => (d(), u("section", {
699
+ key: a.id,
700
+ class: "size-catalog-group",
701
+ role: "group",
702
+ "aria-label": e(h)(a.label)
703
+ }, [
704
+ s("h2", null, c(e(h)(a.label)), 1),
705
+ (d(!0), u(U, null, E(a.options, ({ preset: r, index: V }) => (d(), u("button", {
706
+ id: `${e(g)}-option-${r.id}`,
707
+ key: r.id,
708
+ type: "button",
709
+ role: "option",
710
+ "aria-selected": r.id === t.modelValue.presetId,
711
+ tabindex: m.value === V ? 0 : -1,
712
+ class: Qe({ "catalog-active": m.value === V }),
713
+ "data-option-index": V,
714
+ title: q(r),
715
+ onClick: (ge) => Z(r.id)
716
+ }, [
717
+ s("span", Il, [
718
+ e(ee)(r.platform) ? (d(), u("img", {
719
+ key: 0,
720
+ src: e(ee)(r.platform)?.src,
721
+ alt: e(ee)(r.platform)?.alt,
722
+ loading: "lazy",
723
+ decoding: "async"
724
+ }, null, 8, Ml)) : r.platform ? (d(), u("span", {
725
+ key: 1,
726
+ class: "size-logo-pending",
727
+ title: e(i)("tools.resize.sizeCropPanel_3cdfa056")
728
+ }, "…", 8, Dl)) : (d(), u("svg", Bl, [...n[10] || (n[10] = [
729
+ s("rect", {
730
+ x: "4",
731
+ y: "4",
732
+ width: "16",
733
+ height: "16",
734
+ rx: "2",
735
+ fill: "none",
736
+ stroke: "currentColor",
737
+ "stroke-width": "1.5"
738
+ }, null, -1)
739
+ ])]))
740
+ ]),
741
+ s("span", El, [
742
+ s("strong", null, c(e(h)([r.platform, e(h)(r.label)].filter(Boolean).join(" · "))), 1),
743
+ r.id === "original" ? (d(), u("small", Al, c(e(i)("tools.resize.sizeCropPanel_9634746f")), 1)) : r.id === "custom" ? (d(), u("small", Tl, c(e(i)("tools.resize.sizeCropPanel_62883eae")), 1)) : (d(), u("small", Hl, c(r.width) + " × " + c(r.height) + " · " + c(e(te)(r)), 1))
744
+ ]),
745
+ s("span", Wl, [
746
+ v(e(pe), {
747
+ size: 13,
748
+ role: "img",
749
+ "aria-hidden": !1,
750
+ "aria-label": q(r)
751
+ }, null, 8, ["aria-label"]),
752
+ (d(), u("svg", Ol, [
753
+ s("rect", {
754
+ x: 12 - Math.min(18, 18 * r.width / r.height) / 2,
755
+ y: 12 - Math.min(18, 18 * r.height / r.width) / 2,
756
+ width: Math.min(18, 18 * r.width / r.height),
757
+ height: Math.min(18, 18 * r.height / r.width),
758
+ rx: "1",
759
+ fill: "none",
760
+ stroke: "currentColor",
761
+ "stroke-width": "1.5"
762
+ }, null, 8, Kl)
763
+ ]))
764
+ ])
765
+ ], 10, Sl))), 128))
766
+ ], 8, Ul))), 128))
767
+ ], 8, _l),
768
+ C.value.length ? b("", !0) : (d(), u("div", ql, [
769
+ s("p", null, c(e(i)("tools.resize.sizeCropPanel_7d65f2c5")), 1),
770
+ s("button", {
771
+ type: "button",
772
+ "aria-label": e(i)("tools.resize.sizeCropPanel_74f73eaa"),
773
+ disabled: t.disabled,
774
+ onClick: n[0] || (n[0] = (a) => Z("custom"))
775
+ }, c(e(i)("tools.resize.sizeCropPanel_74f73eaa")), 9, Nl)
776
+ ]))
777
+ ], 544)
778
+ ], 40, $l)) : (d(), u("fieldset", {
779
+ key: 3,
780
+ id: `${e(g)}-mode-page`,
781
+ role: "tabpanel",
782
+ "aria-labelledby": `${e(g)}-${L.value}-tab`,
783
+ class: "size-settings",
784
+ disabled: t.disabled
785
+ }, [
786
+ L.value === "trim" ? (d(), J(ut, {
787
+ key: 0,
788
+ class: "size-trim-option",
789
+ enabled: !0,
790
+ "show-switch": !1,
791
+ help: e(i)("common.audit.trimHelp"),
792
+ padding: t.modelValue.trimPadding ?? 0,
793
+ "padding-color": t.modelValue.trimPaddingColor ?? "transparent",
794
+ disabled: t.disabled,
795
+ source: t.trimPreviewSource,
796
+ "estimate-applied": t.trimEstimateApplied,
797
+ onPadding: n[2] || (n[2] = (a) => _({ trimPadding: a })),
798
+ onValidity: n[3] || (n[3] = (a) => {
799
+ ne.value = a, B();
800
+ })
801
+ }, null, 8, ["help", "padding", "padding-color", "disabled", "source", "estimate-applied"])) : b("", !0),
802
+ L.value === "trim" && (t.modelValue.trimPadding ?? 0) > 0 ? (d(), u("div", Fl, [
803
+ s("span", null, c(e(i)("tools.resize.sizeCropPanel_360c6f27")), 1),
804
+ v(ke, {
805
+ "model-value": t.modelValue.trimPaddingColor ?? "transparent",
806
+ disabled: t.disabled,
807
+ "onUpdate:modelValue": n[4] || (n[4] = (a) => _({ trimPaddingColor: a }))
808
+ }, null, 8, ["model-value", "disabled"])
809
+ ])) : b("", !0),
810
+ v(e(Y), {
811
+ id: `${e(g)}-material-presets`
812
+ }, {
813
+ default: K(() => [
814
+ t.modelValue.method !== "trim" ? (d(), u("div", Jl, [
815
+ (d(!0), u(U, null, E(e(lt), (a) => (d(), u("button", {
816
+ key: a,
817
+ type: "button",
818
+ "aria-label": e(h)(Me[a] ?? ue[a]),
819
+ "aria-pressed": t.modelValue.presetId === a,
820
+ title: a === "original" ? e(i)("tools.resize.sizeCropPanel_2f1fc2ba") : a === "custom" ? e(i)("tools.resize.sizeCropPanel_48ee658b") : q(e(fe)(a)),
821
+ onClick: (r) => Z(a, r)
822
+ }, [
823
+ v(e(z), {
824
+ selected: t.modelValue.presetId === a,
825
+ animate: S.value
826
+ }, null, 8, ["selected", "animate"]),
827
+ (d(), u("svg", Gl, [
828
+ s("rect", {
829
+ x: "4",
830
+ y: "4",
831
+ width: a === "standard-portrait" ? 12 : 16,
832
+ height: a === "standard-landscape" ? 11 : 16,
833
+ rx: "2",
834
+ fill: "none",
835
+ stroke: "currentColor",
836
+ "stroke-width": "1.4"
837
+ }, null, 8, Ql),
838
+ a === "custom" ? (d(), u("path", Yl)) : b("", !0),
839
+ a === "original" ? (d(), u("path", Xl)) : b("", !0)
840
+ ])),
841
+ s("span", null, c(e(h)(ue[a])), 1)
842
+ ], 8, Zl))), 128))
843
+ ])) : b("", !0)
844
+ ]),
845
+ _: 1
846
+ }, 8, ["id"]),
847
+ t.modelValue.method !== "trim" ? (d(), u("div", ea, [
848
+ s("strong", {
849
+ title: t.modelValue.sizeMode === "original" ? e(i)("tools.resize.sizeCropPanel_a89cc481") : void 0
850
+ }, c(Be.value), 9, ta),
851
+ H.value ? (d(), J(e(pe), {
852
+ key: 0,
853
+ size: 14,
854
+ "aria-label": q(H.value),
855
+ role: "img",
856
+ "aria-hidden": !1,
857
+ title: q(H.value)
858
+ }, null, 8, ["aria-label", "title"])) : b("", !0)
859
+ ])) : b("", !0),
860
+ t.modelValue.sizeMode === "original" && t.modelValue.method !== "trim" ? (d(), u("p", la, c(e(i)("tools.resize.sizeCropPanel_88a14bd8")), 1)) : b("", !0),
861
+ t.modelValue.sizeMode !== "original" && t.modelValue.method !== "trim" ? (d(), u(U, { key: 4 }, [
862
+ s("div", aa, [
863
+ s("p", {
864
+ class: "size-template-meta",
865
+ title: e(i)("tools.resize.sizeCropPanel_84bfaf1d", { p0: e(we)(t.modelValue) })
866
+ }, c(t.modelValue.width) + " × " + c(t.modelValue.height) + c(t.modelValue.method === "crop" ? e(i)("tools.resize.sizeCropPanel_6418f8c9") : " px") + " · " + c(Ee.value), 9, oa),
867
+ t.modelValue.presetId !== "custom" ? (d(), u("div", ia, [
868
+ s("button", {
869
+ type: "button",
870
+ "aria-label": e(i)("tools.resize.sizeCropPanel_a33be51c"),
871
+ title: e(i)("tools.resize.sizeCropPanel_222b4e3b"),
872
+ onClick: be
873
+ }, [
874
+ v(e(Ce), { size: 13 })
875
+ ], 8, sa)
876
+ ])) : b("", !0)
877
+ ]),
878
+ v(e(Y), {
879
+ id: `${e(g)}-material-methods`
880
+ }, {
881
+ default: K(() => [
882
+ s("div", {
883
+ class: "size-methods",
884
+ role: "radiogroup",
885
+ "aria-label": e(i)("tools.resize.sizeCropPanel_9e09420b")
886
+ }, [
887
+ (d(), u(U, null, E(I, (a) => s("button", {
888
+ key: a.value,
889
+ type: "button",
890
+ role: "radio",
891
+ "data-method": a.value,
892
+ "aria-label": e(h)(a.label),
893
+ "aria-checked": t.modelValue.method === a.value,
894
+ tabindex: t.modelValue.method === a.value ? 0 : -1,
895
+ title: e(h)(a.help),
896
+ onClick: (r) => _({ method: a.value }, r),
897
+ onKeydown: (r) => Je(r, a.value)
898
+ }, [
899
+ v(e(z), {
900
+ selected: t.modelValue.method === a.value,
901
+ animate: S.value
902
+ }, null, 8, ["selected", "animate"]),
903
+ v(X, {
904
+ label: e(i)("tools.resize.sizeCropPanel_5549425d", { p0: e(h)(a.label) }),
905
+ width: t.modelValue.width,
906
+ height: t.modelValue.height,
907
+ method: a.value,
908
+ anchor: t.modelValue.anchor,
909
+ "allow-enlargement": t.modelValue.allowEnlargement,
910
+ background: a.value === "contain" ? t.modelValue.background : "#ffffff"
911
+ }, null, 8, ["label", "width", "height", "method", "anchor", "allow-enlargement", "background"]),
912
+ s("span", null, [
913
+ s("strong", null, c(e(h)(a.label)), 1),
914
+ s("small", null, c(e(h)(a.help)), 1)
915
+ ])
916
+ ], 40, ra)), 64))
917
+ ], 8, na)
918
+ ]),
919
+ _: 1
920
+ }, 8, ["id"]),
921
+ ce.value ? (d(), u("p", da, c(ce.value), 1)) : b("", !0),
922
+ t.modelValue.presetId === "custom" ? (d(), u(U, { key: 1 }, [
923
+ s("div", ua, [
924
+ s("label", null, [
925
+ F(c(t.modelValue.method === "crop" ? e(i)("tools.resize.sizeCropPanel_84da7fd0") : e(i)("tools.resize.sizeCropPanel_b9121834")), 1),
926
+ s("input", {
927
+ type: "number",
928
+ min: "1",
929
+ max: "4096",
930
+ step: "1",
931
+ required: "",
932
+ "aria-label": t.modelValue.method === "crop" ? e(i)("tools.resize.sizeCropPanel_8ff0ab56") : e(i)("tools.resize.sizeCropPanel_b9121834"),
933
+ value: A.value,
934
+ "aria-invalid": !!w.value,
935
+ "aria-describedby": w.value ? `${e(g)}-error` : void 0,
936
+ onInput: n[5] || (n[5] = (a) => me("width", a))
937
+ }, null, 40, ca)
938
+ ]),
939
+ s("div", ha, [
940
+ s("button", {
941
+ type: "button",
942
+ role: "switch",
943
+ "aria-label": e(i)("tools.resize.sizeCropPanel_430adb6e"),
944
+ title: e(i)("tools.resize.sizeCropPanel_430adb6e"),
945
+ "aria-checked": t.modelValue.lockRatio,
946
+ disabled: t.disabled || !!w.value,
947
+ onClick: n[6] || (n[6] = (a) => !w.value && _({ lockRatio: !t.modelValue.lockRatio }))
948
+ }, [
949
+ t.modelValue.lockRatio ? (d(), J(e(yt), {
950
+ key: 0,
951
+ size: 13
952
+ })) : (d(), J(e(wt), {
953
+ key: 1,
954
+ size: 13
955
+ }))
956
+ ], 8, ma),
957
+ s("button", {
958
+ type: "button",
959
+ "aria-label": e(i)("tools.resize.sizeCropPanel_a33be51c"),
960
+ title: e(i)("tools.resize.sizeCropPanel_a33be51c"),
961
+ disabled: t.disabled || !!w.value,
962
+ onClick: be
963
+ }, [
964
+ v(e(Ce), { size: 13 })
965
+ ], 8, ba)
966
+ ]),
967
+ s("label", null, [
968
+ F(c(t.modelValue.method === "crop" ? e(i)("tools.resize.sizeCropPanel_cd1cb056") : e(i)("tools.resize.sizeCropPanel_24b4b2d0")), 1),
969
+ s("input", {
970
+ type: "number",
971
+ min: "1",
972
+ max: "4096",
973
+ step: "1",
974
+ required: "",
975
+ "aria-label": t.modelValue.method === "crop" ? e(i)("tools.resize.sizeCropPanel_3aed521e") : e(i)("tools.resize.sizeCropPanel_24b4b2d0"),
976
+ value: T.value,
977
+ "aria-invalid": !!w.value,
978
+ "aria-describedby": w.value ? `${e(g)}-error` : void 0,
979
+ onInput: n[7] || (n[7] = (a) => me("height", a))
980
+ }, null, 40, va)
981
+ ])
982
+ ]),
983
+ w.value ? (d(), u("p", {
984
+ key: 0,
985
+ id: `${e(g)}-error`,
986
+ class: "size-input-error",
987
+ role: "alert"
988
+ }, c(e(h)(w.value)), 9, ga)) : b("", !0)
989
+ ], 64)) : b("", !0),
990
+ (d(), u("div", {
991
+ key: t.modelValue.method,
992
+ class: "size-position"
993
+ }, [
994
+ s("span", null, [
995
+ F(c(t.modelValue.method === "contain" ? e(i)("tools.resize.sizeCropPanel_85424d66") : e(i)("tools.adjust.basicCropPanel_3968f6fd")), 1),
996
+ v(at, {
997
+ text: He.value + " " + e(i)("tools.resize.sizeCropPanel_86ab646d") + " / " + e(i)("tools.resize.sizeCropPanel_577124ca")
998
+ }, null, 8, ["text"])
999
+ ]),
1000
+ s("div", fa, [
1001
+ s("div", {
1002
+ class: "size-anchors",
1003
+ role: "group",
1004
+ "aria-label": e(i)("tools.resize.sizeCropPanel_630f1805")
1005
+ }, [
1006
+ (d(), u(U, null, E(de, (a) => s("button", {
1007
+ key: a.value,
1008
+ type: "button",
1009
+ "aria-label": e(i)("tools.resize.sizeCropPanel_efb8bf18", { p0: e(h)(a.label) }),
1010
+ title: e(h)(a.label),
1011
+ "aria-pressed": t.modelValue.anchor === a.value,
1012
+ onClick: (r) => _({ anchor: a.value })
1013
+ }, c(a.symbol), 9, wa)), 64))
1014
+ ], 8, pa),
1015
+ s("div", za, [
1016
+ s("figure", null, [
1017
+ v(X, {
1018
+ label: e(i)("tools.resize.sizeCropPanel_888a36a0"),
1019
+ width: t.modelValue.width,
1020
+ height: t.modelValue.height,
1021
+ method: t.modelValue.method,
1022
+ anchor: t.modelValue.anchor,
1023
+ background: t.modelValue.background
1024
+ }, null, 8, ["label", "width", "height", "method", "anchor", "background"])
1025
+ ]),
1026
+ s("figure", null, [
1027
+ v(X, {
1028
+ label: e(i)("tools.resize.sizeCropPanel_385e86d0"),
1029
+ width: t.modelValue.width,
1030
+ height: t.modelValue.height,
1031
+ method: t.modelValue.method,
1032
+ anchor: t.modelValue.anchor,
1033
+ background: t.modelValue.background,
1034
+ "source-width": 4096,
1035
+ "source-height": 5461
1036
+ }, null, 8, ["label", "width", "height", "method", "anchor", "background"])
1037
+ ])
1038
+ ])
1039
+ ])
1040
+ ])),
1041
+ t.modelValue.method === "contain" ? (d(), u("div", ya, [
1042
+ s("span", null, c(e(i)("tools.resize.sizeCropPanel_360c6f27")), 1),
1043
+ v(ke, {
1044
+ "model-value": t.modelValue.background,
1045
+ disabled: t.disabled,
1046
+ "onUpdate:modelValue": Oe
1047
+ }, null, 8, ["model-value", "disabled"])
1048
+ ])) : b("", !0),
1049
+ t.modelValue.method !== "crop" ? (d(), u("details", ka, [
1050
+ s("summary", {
1051
+ tabindex: t.disabled ? -1 : 0,
1052
+ "aria-disabled": t.disabled,
1053
+ onClick: n[8] || (n[8] = (a) => t.disabled && a.preventDefault())
1054
+ }, c(e(i)("tools.resize.sizeCropPanel_44455611")), 9, Ca),
1055
+ s("div", Pa, [
1056
+ s("span", null, c(e(i)("tools.resize.sizeCropPanel_cf811ee0")), 1),
1057
+ s("button", {
1058
+ type: "button",
1059
+ role: "switch",
1060
+ class: "batch-switch",
1061
+ "aria-label": e(i)("tools.resize.sizeCropPanel_cf811ee0"),
1062
+ "aria-checked": t.modelValue.allowEnlargement,
1063
+ onClick: n[9] || (n[9] = (a) => _({ allowEnlargement: !t.modelValue.allowEnlargement }))
1064
+ }, [...n[11] || (n[11] = [
1065
+ s("span", null, null, -1)
1066
+ ])], 8, Va)
1067
+ ]),
1068
+ s("label", null, [
1069
+ F(c(e(i)("tools.resize.sizeCropPanel_186f04c4")), 1),
1070
+ s("select", {
1071
+ "aria-label": e(i)("tools.resize.sizeCropPanel_186f04c4"),
1072
+ value: t.modelValue.kernel,
1073
+ onChange: Ke
1074
+ }, [
1075
+ (d(), u(U, null, E(re, (a) => s("option", {
1076
+ key: a.value,
1077
+ value: a.value
1078
+ }, c(e(h)(a.label)), 9, $a)), 64))
1079
+ ], 40, xa)
1080
+ ]),
1081
+ s("p", null, c(e(i)("tools.resize.sizeCropPanel_2454a5d9")), 1)
1082
+ ])) : b("", !0)
1083
+ ], 64)) : b("", !0),
1084
+ t.hideReset ? b("", !0) : (d(), u("button", {
1085
+ key: 5,
1086
+ type: "button",
1087
+ class: "size-reset",
1088
+ "aria-label": e(i)("tools.resize.sizeCropPanel_a02f0a52"),
1089
+ onClick: qe
1090
+ }, [
1091
+ v(e(ot), { size: 14 }),
1092
+ F(c(e(i)("tools.resize.sizeCropPanel_a02f0a52")), 1)
1093
+ ], 8, Ra))
1094
+ ], 8, jl))
1095
+ ], 8, wl));
1096
+ }
1097
+ }), _a = /* @__PURE__ */ _e(La, [["__scopeId", "data-v-d78d2312"]]), Ua = {
1098
+ key: 0,
1099
+ class: "hint"
1100
+ }, Ta = /* @__PURE__ */ ae({
1101
+ name: "ResizeToolPanel",
1102
+ __name: "ResizeToolPanel",
1103
+ props: {
1104
+ context: {}
1105
+ },
1106
+ setup(t, { expose: M }) {
1107
+ const { ui: x, uiText: i } = ie(), h = t, l = ht(() => h.context), p = k(), z = k(!0), S = P(
1108
+ () => l.value.sizeCrop.sizeMode === "original" && l.value.sizeCrop.method !== "trim"
1109
+ ), D = P(() => {
1110
+ try {
1111
+ return rt(l.value.sizeCrop).toolId;
1112
+ } catch {
1113
+ return "resize";
1114
+ }
1115
+ }), g = P(() => {
1116
+ if (S.value) return x("common.toolPanel_12d37070");
1117
+ if (h.context.view.waitingCount) return;
1118
+ const y = l.value.sizeCrop;
1119
+ return y.method === "trim" ? x("tools.crop.contentTrim.action", { count: h.context.view.count }) : y.method === "crop" ? x("common.toolPanel_4a01f39f", {
1120
+ p0: te(y),
1121
+ p1: h.context.view.count
1122
+ }) : x("common.toolPanel_3c907be8", {
1123
+ p0: y.allowEnlargement ? x("common.toolPanel_fb04addb") : x("common.toolPanel_57060c88"),
1124
+ p1: y.width,
1125
+ p2: y.height,
1126
+ p3: h.context.view.count
1127
+ });
1128
+ });
1129
+ M({
1130
+ hasOverlay: () => !!p.value?.hasOverlay(),
1131
+ dismissOverlay: () => !!p.value?.dismissOverlay()
1132
+ });
1133
+ const f = mt(() => h.context, "sizeCrop");
1134
+ return (y, $) => (d(), J(dt, {
1135
+ context: t.context,
1136
+ layout: "contained",
1137
+ changed: e(bt)(e(l).sizeCrop, e(le)),
1138
+ "body-class": "plugin-size-body",
1139
+ onReset: $[1] || ($[1] = (m) => t.context.resetDraft({ sizeCrop: { ...e(le) } }))
1140
+ }, {
1141
+ actions: K(() => [
1142
+ v(vt, {
1143
+ context: t.context,
1144
+ available: e(gt)(t.context, D.value),
1145
+ ready: z.value && !S.value,
1146
+ label: g.value
1147
+ }, {
1148
+ default: K(() => [
1149
+ e(l).sizeCrop.sizeMode === "fixed" && e(l).sizeCrop.method !== "crop" && e(l).sizeCrop.method !== "trim" && !e(l).sizeCrop.allowEnlargement ? (d(), u("p", Ua, c(e(x)("common.toolPanel_76515609")), 1)) : b("", !0)
1150
+ ]),
1151
+ _: 1
1152
+ }, 8, ["context", "available", "ready", "label"])
1153
+ ]),
1154
+ default: K(() => [
1155
+ v(_a, {
1156
+ ref_key: "panel",
1157
+ ref: p,
1158
+ "model-value": e(l).sizeCrop,
1159
+ "hide-reset": !0,
1160
+ disabled: t.context.readonly,
1161
+ count: t.context.view.count,
1162
+ "scope-key": t.context.view.batchId,
1163
+ "current-width": t.context.view.currentWidth,
1164
+ "current-height": t.context.view.currentHeight,
1165
+ "viewing-snapshot": t.context.view.viewingSnapshot,
1166
+ "trim-preview-source": t.context.view.currentImageSource,
1167
+ "trim-estimate-applied": t.context.view.trimEstimateApplied,
1168
+ "onUpdate:modelValue": e(f),
1169
+ onValidity: $[0] || ($[0] = (m) => z.value = m)
1170
+ }, null, 8, ["model-value", "disabled", "count", "scope-key", "current-width", "current-height", "viewing-snapshot", "trim-preview-source", "trim-estimate-applied", "onUpdate:modelValue"])
1171
+ ]),
1172
+ _: 1
1173
+ }, 8, ["context", "changed"]));
1174
+ }
1175
+ });
1176
+ export {
1177
+ Ta as default
1178
+ };