@beeintel/batch-image 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FONT-LICENSE.txt +93 -0
- package/README.md +181 -2
- package/dist/assets/11st-D7qGO5e4.webp +0 -0
- package/dist/assets/UPNG-CPfdwFSy.js +2298 -0
- package/dist/assets/adjust-card-B63b81iV.webp +0 -0
- package/dist/assets/adjust-final.worker-C2JbTvv5.js +6945 -0
- package/dist/assets/amazon-CjTtpZTq.webp +0 -0
- package/dist/assets/ascii_art-B4UGbtGs.webp +0 -0
- package/dist/assets/auction-j26eVUQO.webp +0 -0
- package/dist/assets/background-DGdZUdkL.webp +0 -0
- package/dist/assets/background-card-wK7DRpvM.png +0 -0
- package/dist/assets/body-CUFdRg8w.webp +0 -0
- package/dist/assets/bounded-cutout.worker-BZR6mbaI.js +9615 -0
- package/dist/assets/brand-mark-card-cFUeDeO2.webp +0 -0
- package/dist/assets/buyma-dAxYNjow.webp +0 -0
- package/dist/assets/codec.worker-7W6hmsm6.js +7349 -0
- package/dist/assets/contour_lines-C_CqrgV1.webp +0 -0
- package/dist/assets/creema-B1tWyCPx.webp +0 -0
- package/dist/assets/crop-final.worker-Owin7TvX.js +7035 -0
- package/dist/assets/cutout-CzMvV5An.webp +0 -0
- package/dist/assets/cutout-card-CN4gNFBz.png +0 -0
- package/dist/assets/cutout.worker-DyH6Prbn.js +3894 -0
- package/dist/assets/depop-CkVC5Fn1.webp +0 -0
- package/dist/assets/dewrinkle-kFzP6LqD.webp +0 -0
- package/dist/assets/dither-CcxmO2e6.webp +0 -0
- package/dist/assets/douyin-CP_HwBDF.webp +0 -0
- package/dist/assets/download.worker-DnGSB6P_.js +17779 -0
- package/dist/assets/duotone-Cdg_3fQf.webp +0 -0
- package/dist/assets/ebay-CxLfrRAf.webp +0 -0
- package/dist/assets/edit-Cv-txfZm.webp +0 -0
- package/dist/assets/effect.worker-qu1eCcII.js +9227 -0
- package/dist/assets/engraving-BENh1O2O.webp +0 -0
- package/dist/assets/etsy-CSvz9GpY.webp +0 -0
- package/dist/assets/expand-C60VE9nK.webp +0 -0
- package/dist/assets/facebook-Ca2nJJiQ.webp +0 -0
- package/dist/assets/film_stock-Bqauwcq4.webp +0 -0
- package/dist/assets/final.worker-BnzJ3N5C.js +7035 -0
- package/dist/assets/final.worker-Csc1zoYS.js +7054 -0
- package/dist/assets/final.worker-DzBFT9xk.js +6922 -0
- package/dist/assets/final.worker-XpgKnlaz.js +7217 -0
- package/dist/assets/flatlay-CPiVmlAa.webp +0 -0
- package/dist/assets/flatlay-fold-B-CRYy87.webp +0 -0
- package/dist/assets/flatlay-open-Dzas8okC.webp +0 -0
- package/dist/assets/g-market-DXuYK_JH.webp +0 -0
- package/dist/assets/ghost-BCEAx_Zx.webp +0 -0
- package/dist/assets/ghost-front-WFgA4sUo.webp +0 -0
- package/dist/assets/ghost-three-quarter-Rt8cXj34.webp +0 -0
- package/dist/assets/gif-CObOIITx.js +303 -0
- package/dist/assets/glass_tiles-3IXP-Hmg.webp +0 -0
- package/dist/assets/glitch_art-D1i3qben.webp +0 -0
- package/dist/assets/glitch_blur-C4q_9zyq.webp +0 -0
- package/dist/assets/glow-Bv9EHBU5.webp +0 -0
- package/dist/assets/gradient_map-BR-UVYMP.webp +0 -0
- package/dist/assets/halftone-CWdKu2_6.webp +0 -0
- package/dist/assets/holo_sticker-BQDikLg2.webp +0 -0
- package/dist/assets/idus-7diqRNPs.webp +0 -0
- package/dist/assets/imagetracer.worker-CgunQTPG.js +7096 -0
- package/dist/assets/instagram-Bf0IVidT.webp +0 -0
- package/dist/assets/kakao-talk-Df79L_Mv.webp +0 -0
- package/dist/assets/kaleidoscope-BxqMZuWo.webp +0 -0
- package/dist/assets/karrot-BXFPhDwt.webp +0 -0
- package/dist/assets/kaufland-BDDy6e0C.webp +0 -0
- package/dist/assets/lazada-ConR4e1O.webp +0 -0
- package/dist/assets/lens_flare-DgyiAv_j.webp +0 -0
- package/dist/assets/light_leak-kUdpoFuC.webp +0 -0
- package/dist/assets/line-Dr1j___B.webp +0 -0
- package/dist/assets/linkedin-4s_9Wh03.webp +0 -0
- package/dist/assets/lo_fi-DSdl3yY_.webp +0 -0
- package/dist/assets/logo-preparation.worker-D9oa7SME.js +420 -0
- package/dist/assets/mercado-libre-C8CskEiS.webp +0 -0
- package/dist/assets/mercari-jp-DHj7nz4O.webp +0 -0
- package/dist/assets/metadata.worker-B_9_BgN1.js +6456 -0
- package/dist/assets/mirror_collage-JtSKCeSh.webp +0 -0
- package/dist/assets/model-BbeF-fsf.webp +0 -0
- package/dist/assets/model-BjWhieit.webp +0 -0
- package/dist/assets/momo-BWXO_8Df.webp +0 -0
- package/dist/assets/motion_blur-B8YUHeSg.webp +0 -0
- package/dist/assets/naver-xQKL8lWg.webp +0 -0
- package/dist/assets/nuvemshop-DPt6rnA-.webp +0 -0
- package/dist/assets/olx-B87gp-Il.webp +0 -0
- package/dist/assets/orient-card-Da0ii6mX.webp +0 -0
- package/dist/assets/orient-final.worker-CdF5Y5zD.js +6909 -0
- package/dist/assets/orientation-preview.worker-B7uFzz3J.js +6865 -0
- package/dist/assets/ort.bundle.min-CreFV8V1.js +9311 -0
- package/dist/assets/ort.webgpu.bundle.min-CAudaHZO.js +9311 -0
- package/dist/assets/otto-market-DWZyNKJn.webp +0 -0
- package/dist/assets/paper_texture-CXphyIrs.webp +0 -0
- package/dist/assets/pinterest-ByZqih2J.webp +0 -0
- package/dist/assets/polish-DFy6LNG7.webp +0 -0
- package/dist/assets/poshmark-DnZi2vA1.webp +0 -0
- package/dist/assets/posterize-SpLVGq1s.webp +0 -0
- package/dist/assets/preview.worker-DcrCKKWl.js +380 -0
- package/dist/assets/qoo10-C1pq81Jx.webp +0 -0
- package/dist/assets/rakuten-ulYog1hL.webp +0 -0
- package/dist/assets/recolor-mBX7vdFT.webp +0 -0
- package/dist/assets/resize-DVEAl0Um.webp +0 -0
- package/dist/assets/runtime-0663b902fb3937883a34.wasm +0 -0
- package/dist/assets/runtime-355a5c80c7bfdf8737de.mjs +2817 -0
- package/dist/assets/runtime-49871f5a4409519797e1.wasm +0 -0
- package/dist/assets/runtime-74cf72f9a2b7befc115a.mjs +2817 -0
- package/dist/assets/shadow-card-DTZEH60r.png +0 -0
- package/dist/assets/shopee-Bxfei6sj.webp +0 -0
- package/dist/assets/shopify-wVaBafcF.webp +0 -0
- package/dist/assets/shopline-DMoaJ7Bh.webp +0 -0
- package/dist/assets/sparkle-CD5GSGip.webp +0 -0
- package/dist/assets/ssg-DQoFx5u5.webp +0 -0
- package/dist/assets/staging-CIc8pQJ6.webp +0 -0
- package/dist/assets/standard-cutout.worker-BYLzdpR-.js +1261 -0
- package/dist/assets/text-DQW2mBGp.webp +0 -0
- package/dist/assets/textured_glass-D2coxp7n.webp +0 -0
- package/dist/assets/tga-VGxWDes0.js +752 -0
- package/dist/assets/tilt_shift-BKs46yeX.webp +0 -0
- package/dist/assets/transformers.web-DB57cIO5.js +28891 -0
- package/dist/assets/tritone-CcR4qizk.webp +0 -0
- package/dist/assets/upscale-BrLadyUk.webp +0 -0
- package/dist/assets/upscale-creative-DnZnQufJ.webp +0 -0
- package/dist/assets/upscale-crisp-Ckdmbsnn.webp +0 -0
- package/dist/assets/vinted-1QDsxvC6.webp +0 -0
- package/dist/assets/watercolor-CV67zYNE.webp +0 -0
- package/dist/assets/watermark-CpPrxaT5.webp +0 -0
- package/dist/assets/wave_distortion-CV5jVfK4.webp +0 -0
- package/dist/assets/whatsapp-CWJxqzR6.webp +0 -0
- package/dist/assets/worker-DfrCFP3O.js +55 -0
- package/dist/assets/xerox_noise-CbbHY1S1.webp +0 -0
- package/dist/assets/youtube-DS12d5mi.webp +0 -0
- package/dist/assets/zalando-CenfWOwz.webp +0 -0
- package/dist/browser-adapter.d.ts +4 -0
- package/dist/browser-cutout-capability.d.ts +4 -0
- package/dist/browser-cutout-resources.d.ts +3 -0
- package/dist/browser-local-capabilities.d.ts +5 -0
- package/dist/capabilities.d.ts +18 -0
- package/dist/chunks/AdjustToolPanel-B6dtlFlj.js +195 -0
- package/dist/chunks/BackgroundToolPanel-C3Rr9d4S.js +41 -0
- package/dist/chunks/BatchMaterials-DDoJTaS5.js +806 -0
- package/dist/chunks/BatchModeChoices-DeBARgvY.js +111 -0
- package/dist/chunks/BatchOutputColorPicker-D7WIDS4_.js +75 -0
- package/dist/chunks/BatchReferenceFields-Cr5WgFRJ.js +316 -0
- package/dist/chunks/BeautifyToolPanel-DDZXDQKM.js +215 -0
- package/dist/chunks/BrandMarkToolPanel-vKobk_R3.js +1179 -0
- package/dist/chunks/ContentTrimControl-BKCJEst5.js +297 -0
- package/dist/chunks/CropToolPanel-C_sW5tWL.js +218 -0
- package/dist/chunks/CutoutToolPanel-B7ObmiWd.js +73 -0
- package/dist/chunks/DisclosureToolPanel-F3ccFJIF.js +76 -0
- package/dist/chunks/ExpandToolPanel-BKjj5UJA.js +67 -0
- package/dist/chunks/ImageEffectsToolPanel-CsDIBpT6.js +966 -0
- package/dist/chunks/IpAuditToolPanel-CduDfFh-.js +96 -0
- package/dist/chunks/ListingToolPanel-8pJ2_zvI.js +783 -0
- package/dist/chunks/MaterialSelectionPlate-CW7HaS6v.js +30 -0
- package/dist/chunks/MetadataToolPanel-C8XJOamN.js +104 -0
- package/dist/chunks/OrientToolPanel-C1AzQchm.js +161 -0
- package/dist/chunks/PluginActionFooter.vue_vue_type_script_setup_true_lang-BGe419qz.js +102 -0
- package/dist/chunks/ResizeToolPanel-DWikcj2G.js +1178 -0
- package/dist/chunks/RetouchToolPanel-B4eQKk2W.js +350 -0
- package/dist/chunks/ShadowToolPanel-Bbj76hQd.js +254 -0
- package/dist/chunks/SvgExportToolPanel-BRxpzd7q.js +219 -0
- package/dist/chunks/TranslationToolPanel-Bxv8U2WY.js +125 -0
- package/dist/chunks/UpscaleToolPanel-BRIgpszs.js +127 -0
- package/dist/chunks/engine-D-T-1RSx.js +69 -0
- package/dist/chunks/entry-CboOSe2r.js +42945 -0
- package/dist/chunks/gpu-CScw5MNG.js +231 -0
- package/dist/chunks/hosted-resources-COzZ7nZY.js +8196 -0
- package/dist/chunks/loader-circle-CylCgDqP.js +16 -0
- package/dist/chunks/motionFeatures-D67ghPG1.js +4405 -0
- package/dist/chunks/search-BwsDnulU.js +18 -0
- package/dist/chunks/standard-cutout-vPpP6xBc.js +45 -0
- package/dist/chunks/static-logo-2F9ORZWc.js +34 -0
- package/dist/config.d.ts +66 -0
- package/dist/contracts.d.ts +272 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +13 -0
- package/dist/node/catalog.mjs +45 -0
- package/dist/node/cli.mjs +11 -0
- package/dist/node/index.d.mts +20 -0
- package/dist/node/index.mjs +2 -0
- package/dist/node/prepare.mjs +114 -0
- package/dist/node/vite.mjs +46 -0
- package/dist/processing.d.ts +1 -0
- package/dist/processing.js +12105 -0
- package/dist/remote-contracts.d.ts +114 -0
- package/dist/resource-contracts.d.ts +40 -0
- package/dist/resources/cutout/9ae2e5375a34fa413530954dc20d085d175faffc86108c13619220d0557f80bf.json +1 -0
- package/dist/resources/cutout/f119dabecc64bc436d3d08425dde96ec2598fd40541eba97d8d53a4e8bbdcaea.json +1 -0
- package/dist/resources/cutout/resources.json +195 -0
- package/dist/resources/cutout/sources.json +294 -0
- package/dist/resources.json +1191 -0
- package/dist/service-contracts.d.ts +43 -0
- package/dist/slots.d.ts +21 -0
- package/dist/style.css +1 -0
- package/dist/types/batch/api.d.ts +89 -0
- package/dist/types/batch/cutout-output.d.ts +2 -0
- package/dist/types/batch/features/background/engine.d.mts +12 -0
- package/dist/types/batch/features/basic-edit/contracts.d.ts +87 -0
- package/dist/types/batch/features/basic-edit/engine.d.mts +96 -0
- package/dist/types/batch/features/brand-mark/contracts.d.ts +84 -0
- package/dist/types/batch/features/brand-mark/engine.d.mts +68 -0
- package/dist/types/batch/features/export-compression/contracts.d.ts +44 -0
- package/dist/types/batch/features/export-compression/gifenc.d.ts +33 -0
- package/dist/types/batch/features/export-compression/plan.d.ts +45 -0
- package/dist/types/batch/features/export-compression/presentation.d.ts +70 -0
- package/dist/types/batch/features/export-compression/upng.d.ts +6 -0
- package/dist/types/batch/features/final-image/resize.d.mts +15 -0
- package/dist/types/batch/features/image-effects/contracts.d.ts +58 -0
- package/dist/types/batch/features/image-effects/gpu-pixel-runtime.d.ts +15 -0
- package/dist/types/batch/features/image-effects/photo-audit.d.ts +21 -0
- package/dist/types/batch/features/image-effects/photo-v7-cpu.d.ts +9 -0
- package/dist/types/batch/features/image-effects/profiles-v4.d.ts +157 -0
- package/dist/types/batch/features/image-effects/profiles-v5.d.ts +20 -0
- package/dist/types/batch/features/image-effects/profiles-v6.d.ts +14 -0
- package/dist/types/batch/features/image-effects/profiles-v7.d.ts +53 -0
- package/dist/types/batch/features/image-effects/profiles-v8.d.ts +113 -0
- package/dist/types/batch/features/image-effects/profiles-v9.d.ts +20 -0
- package/dist/types/batch/features/image-translation/params.d.ts +257 -0
- package/dist/types/batch/features/listing-remake/transport.d.ts +21 -0
- package/dist/types/batch/features/metadata/bytes.d.mts +13 -0
- package/dist/types/batch/features/metadata/containers.d.mts +20 -0
- package/dist/types/batch/features/metadata/declaration.d.mts +5 -0
- package/dist/types/batch/features/metadata/engine.d.mts +9 -0
- package/dist/types/batch/features/metadata/exchange.d.mts +48 -0
- package/dist/types/batch/features/shadow/contracts.d.ts +43 -0
- package/dist/types/batch/features/shadow/engine.d.mts +33 -0
- package/dist/types/batch/features/svg-export/download-contract.d.ts +33 -0
- package/dist/types/batch/features/svg-export/download-prepare.d.ts +2 -0
- package/dist/types/batch/features/svg-export/download.d.ts +7 -0
- package/dist/types/batch/features/svg-export/imagetracer.d.ts +6 -0
- package/dist/types/batch/features/svg-export/optimizer.d.ts +2 -0
- package/dist/types/batch/ids.d.ts +1 -0
- package/dist/types/batch/model.d.ts +317 -0
- package/dist/types/batch/public/config.d.ts +66 -0
- package/dist/types/batch/public/contracts.d.ts +272 -0
- package/dist/types/batch/public/remote-contracts.d.ts +114 -0
- package/dist/types/batch/public/resource-contracts.d.ts +40 -0
- package/dist/types/batch/public/service-contracts.d.ts +43 -0
- package/dist/types/batch/queue.d.ts +34 -0
- package/dist/types/batch/receipts.d.ts +85 -0
- package/dist/types/batch/retention.d.ts +13 -0
- package/dist/types/onnxruntime-web.d.ts +5 -0
- package/dist/types/plugins/cutout/core/hosted-resources.d.ts +11 -0
- package/dist/types/processing.d.ts +18 -0
- package/dist/types/shared/svg-security.d.mts +4 -0
- package/dist/types/workspace-worker.d.ts +2 -0
- package/package.json +91 -3
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { defineComponent as D, computed as g, ref as h, watch as V, openBlock as a, createBlock as w, normalizeClass as F, withCtx as S, createElementVNode as l, toDisplayString as n, unref as t, createElementBlock as i, Fragment as E, renderList as N, createCommentVNode as v, createVNode as x, createTextVNode as I, nextTick as j } from "vue";
|
|
2
|
+
import { F as B, aS as q, G as L, aT as G, az as U, aU as Z, aV as R, _ as $ } from "./entry-CboOSe2r.js";
|
|
3
|
+
import { L as M } from "./loader-circle-CylCgDqP.js";
|
|
4
|
+
function W(c, o) {
|
|
5
|
+
return c ? c.matchingOngoing ? { kind: "running", operation: c.matchingOngoing } : c.currentIntent && c.latest?.summary.terminal && c.latest.intent === c.currentIntent && !(o?.projectId === c.projectId && o.operationId === c.latest.summary.operationId) ? { kind: "completed", operation: c.latest } : { kind: "draft" } : { kind: "draft" };
|
|
6
|
+
}
|
|
7
|
+
const X = { class: "svg-description" }, H = ["disabled"], J = ["value", "checked", "onChange"], K = { class: "svg-choice-copy" }, Q = { class: "svg-choice-heading" }, Y = { key: 0 }, ee = { class: "svg-profile" }, te = ["value"], oe = { value: "raw" }, ne = { value: "p3" }, ae = { value: "p2" }, le = { value: "p1" }, se = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "svg-export-note svg-optimization-note"
|
|
10
|
+
}, ie = { class: "svg-export-note" }, ue = { class: "svg-actions" }, re = ["disabled", "aria-busy"], ve = {
|
|
11
|
+
key: 1,
|
|
12
|
+
class: "svg-error"
|
|
13
|
+
}, ce = {
|
|
14
|
+
key: 2,
|
|
15
|
+
class: "svg-error"
|
|
16
|
+
}, de = ["aria-label"], pe = { key: 0 }, ge = { key: 1 }, _e = { key: 2 }, me = { key: 3 }, ke = {
|
|
17
|
+
key: 4,
|
|
18
|
+
role: "alert"
|
|
19
|
+
}, ye = { key: 5 }, ze = ["disabled", "aria-busy"], fe = /* @__PURE__ */ D({
|
|
20
|
+
__name: "SvgExportToolPanel",
|
|
21
|
+
props: {
|
|
22
|
+
context: {}
|
|
23
|
+
},
|
|
24
|
+
setup(c) {
|
|
25
|
+
const { ui: o } = B(), T = c, e = g(() => T.context), p = h(!1), f = h();
|
|
26
|
+
V(
|
|
27
|
+
() => e.value.svgResult?.flow?.projectId,
|
|
28
|
+
() => {
|
|
29
|
+
f.value = void 0;
|
|
30
|
+
},
|
|
31
|
+
{ flush: "sync" }
|
|
32
|
+
);
|
|
33
|
+
const u = g(
|
|
34
|
+
() => W(e.value.svgResult?.flow, f.value)
|
|
35
|
+
), C = h();
|
|
36
|
+
async function A() {
|
|
37
|
+
const d = e.value.svgResult?.flow;
|
|
38
|
+
d?.latest && (f.value = { projectId: d.projectId, operationId: d.latest.summary.operationId }), await j(), C.value?.querySelector("input:checked")?.focus();
|
|
39
|
+
}
|
|
40
|
+
const k = g(
|
|
41
|
+
() => e.value.draft.svgExport ?? q
|
|
42
|
+
), y = g(() => k.value.engine), z = (d) => e.value.modeAllowed ? e.value.modeAllowed(d) : d === "imagetracer" ? typeof Worker < "u" && typeof OffscreenCanvas < "u" && typeof createImageBitmap < "u" : e.value.view.aiAvailable !== !1 && (e.value.view.svgEngines ?? (e.value.view.availableTools.includes("vectorize_svg") ? ["recraft", "image2svg"] : [])).includes(d), b = g(
|
|
43
|
+
() => k.value.optimize ? k.value.optimizationProfile : "raw"
|
|
44
|
+
), s = g(() => e.value.svgResult?.summary), _ = g(() => e.value.svgResult?.preparation);
|
|
45
|
+
function P(d) {
|
|
46
|
+
e.value.updateDraft({ svgExport: { ...k.value, ...d } });
|
|
47
|
+
}
|
|
48
|
+
async function O() {
|
|
49
|
+
if (!(u.value.kind === "running" || p.value || e.value.readonly || e.value.executionAvailable === !1 || e.value.view.count < 1 || !z(y.value))) {
|
|
50
|
+
p.value = !0;
|
|
51
|
+
try {
|
|
52
|
+
await e.value.requestSubmit();
|
|
53
|
+
} finally {
|
|
54
|
+
p.value = !1;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return (d, m) => (a(), w(L, {
|
|
59
|
+
class: F(["svg-export-panel", { "svg-completed": u.value.kind === "completed" }]),
|
|
60
|
+
context: e.value,
|
|
61
|
+
layout: "contained",
|
|
62
|
+
"body-class": "svg-export-options"
|
|
63
|
+
}, {
|
|
64
|
+
actions: S(() => [
|
|
65
|
+
l("div", ue, [
|
|
66
|
+
x(t(Z), {
|
|
67
|
+
name: "mainAction",
|
|
68
|
+
action: {
|
|
69
|
+
toolId: e.value.toolId,
|
|
70
|
+
entryId: e.value.entryId,
|
|
71
|
+
params: e.value.submissionParams,
|
|
72
|
+
count: e.value.view.count,
|
|
73
|
+
disabled: e.value.readonly || e.value.executionAvailable === !1 || e.value.submitting || !z(y.value),
|
|
74
|
+
submit: e.value.requestSubmit
|
|
75
|
+
}
|
|
76
|
+
}, null, 8, ["action"]),
|
|
77
|
+
u.value.kind !== "completed" ? (a(), i("button", {
|
|
78
|
+
key: 0,
|
|
79
|
+
class: "primary-action svg-submit",
|
|
80
|
+
type: "button",
|
|
81
|
+
disabled: u.value.kind === "running" || e.value.readonly || e.value.executionAvailable === !1 || p.value || e.value.submitting || e.value.view.count < 1 || !z(y.value),
|
|
82
|
+
"aria-busy": u.value.kind === "running" || p.value || e.value.submitting,
|
|
83
|
+
onClick: O
|
|
84
|
+
}, [
|
|
85
|
+
u.value.kind === "running" || p.value || e.value.submitting ? (a(), w(t(M), {
|
|
86
|
+
key: 0,
|
|
87
|
+
class: "svg-working",
|
|
88
|
+
size: 17,
|
|
89
|
+
"aria-hidden": "true"
|
|
90
|
+
})) : (a(), w(t(R), {
|
|
91
|
+
key: 1,
|
|
92
|
+
size: 17
|
|
93
|
+
})),
|
|
94
|
+
I(n(u.value.kind === "running" ? t(o)("tools.vectorize_svg.running") + " " + t(o)(
|
|
95
|
+
u.value.operation.summary.unknown ? "tools.vectorize_svg.unknown" : "tools.vectorize_svg.resultProgress",
|
|
96
|
+
{
|
|
97
|
+
count: u.value.operation.summary.unknown,
|
|
98
|
+
done: u.value.operation.summary.ended,
|
|
99
|
+
total: u.value.operation.summary.total,
|
|
100
|
+
succeeded: u.value.operation.summary.succeeded
|
|
101
|
+
}
|
|
102
|
+
) : p.value || e.value.submitting ? t(o)("tools.vectorize_svg.running") : t(o)(
|
|
103
|
+
s.value ? "tools.vectorize_svg.enqueueSelected" : "tools.vectorize_svg.startSelected",
|
|
104
|
+
{
|
|
105
|
+
count: e.value.view.count
|
|
106
|
+
}
|
|
107
|
+
)), 1)
|
|
108
|
+
], 8, re)) : v("", !0),
|
|
109
|
+
u.value.kind !== "completed" && !z(y.value) ? (a(), i("p", ve, n(t(o)("tools.vectorize_svg.unavailable")), 1)) : v("", !0),
|
|
110
|
+
e.value.view.count < 1 ? (a(), i("p", ce, n(t(o)("tools.vectorize_svg.emptySelection")), 1)) : v("", !0),
|
|
111
|
+
s.value?.terminal ? (a(), i("section", {
|
|
112
|
+
key: 3,
|
|
113
|
+
class: "svg-result",
|
|
114
|
+
"aria-live": "polite",
|
|
115
|
+
"aria-label": t(o)("tools.vectorize_svg.resultTitle")
|
|
116
|
+
}, [
|
|
117
|
+
l("strong", null, n(t(o)("tools.vectorize_svg.resultTitle")), 1),
|
|
118
|
+
l("p", null, n(t(o)("tools.vectorize_svg.resultProgress", {
|
|
119
|
+
done: s.value.ended,
|
|
120
|
+
total: s.value.total,
|
|
121
|
+
succeeded: s.value.succeeded
|
|
122
|
+
})), 1),
|
|
123
|
+
s.value.failed ? (a(), i("p", pe, n(t(o)("tools.vectorize_svg.failed", { count: s.value.failed })), 1)) : v("", !0),
|
|
124
|
+
s.value.cancelled || s.value.skipped ? (a(), i("p", ge, n(t(o)("tools.vectorize_svg.notCompleted", {
|
|
125
|
+
count: s.value.cancelled + s.value.skipped
|
|
126
|
+
})), 1)) : v("", !0),
|
|
127
|
+
s.value.unknown ? (a(), i("p", _e, n(t(o)("tools.vectorize_svg.unknown", { count: s.value.unknown })), 1)) : v("", !0),
|
|
128
|
+
s.value.pending ? (a(), i("p", me, n(t(o)("tools.vectorize_svg.processing", { count: s.value.pending })), 1)) : v("", !0),
|
|
129
|
+
_.value?.kind === "error" ? (a(), i("p", ke, n(t(o)("tools.vectorize_svg.archiveFailure")), 1)) : v("", !0),
|
|
130
|
+
_.value?.kind === "cancelled" ? (a(), i("p", ye, n(t(o)("tools.vectorize_svg.preparationCancelled")), 1)) : v("", !0),
|
|
131
|
+
l("button", {
|
|
132
|
+
type: "button",
|
|
133
|
+
class: "primary-action",
|
|
134
|
+
disabled: !s.value.canDownload || _.value?.kind === "preparing",
|
|
135
|
+
"aria-busy": _.value?.kind === "preparing",
|
|
136
|
+
onClick: m[1] || (m[1] = (r) => e.value.svgResult?.download())
|
|
137
|
+
}, [
|
|
138
|
+
x(t(R), { size: 16 }),
|
|
139
|
+
I(n(_.value?.kind === "preparing" ? t(o)("tools.vectorize_svg.preparing") : t(o)("tools.vectorize_svg.downloadZipCount", {
|
|
140
|
+
label: t(o)(
|
|
141
|
+
b.value === "raw" ? "tools.vectorize_svg.downloadRawZip" : "tools.vectorize_svg.downloadOptimizedZip"
|
|
142
|
+
),
|
|
143
|
+
count: s.value.succeeded
|
|
144
|
+
})), 1)
|
|
145
|
+
], 8, ze),
|
|
146
|
+
_.value?.kind === "preparing" ? (a(), i("button", {
|
|
147
|
+
key: 6,
|
|
148
|
+
type: "button",
|
|
149
|
+
class: "svg-cancel",
|
|
150
|
+
onClick: m[2] || (m[2] = (r) => e.value.svgResult?.cancel())
|
|
151
|
+
}, n(t(o)("tools.vectorize_svg.cancelPreparation")), 1)) : v("", !0)
|
|
152
|
+
], 8, de)) : v("", !0),
|
|
153
|
+
u.value.kind === "completed" ? (a(), i("button", {
|
|
154
|
+
key: 4,
|
|
155
|
+
type: "button",
|
|
156
|
+
class: "svg-continue",
|
|
157
|
+
onClick: A
|
|
158
|
+
}, n(t(o)("tools.vectorize_svg.continueConversion")), 1)) : v("", !0)
|
|
159
|
+
])
|
|
160
|
+
]),
|
|
161
|
+
default: S(() => [
|
|
162
|
+
l("p", X, n(t(o)("tools.vectorize_svg.description")), 1),
|
|
163
|
+
l("fieldset", {
|
|
164
|
+
ref_key: "generationOptions",
|
|
165
|
+
ref: C,
|
|
166
|
+
class: "svg-options",
|
|
167
|
+
disabled: e.value.readonly || p.value || e.value.submitting
|
|
168
|
+
}, [
|
|
169
|
+
u.value.kind !== "completed" ? (a(), i(E, { key: 0 }, [
|
|
170
|
+
l("legend", null, n(t(o)("tools.vectorize_svg.generationMode")), 1),
|
|
171
|
+
(a(!0), i(E, null, N(t(G).filter(
|
|
172
|
+
(r) => e.value.modeAllowed?.(r.engine) !== !1
|
|
173
|
+
), (r) => (a(), i("label", {
|
|
174
|
+
key: r.engine,
|
|
175
|
+
class: "svg-choice"
|
|
176
|
+
}, [
|
|
177
|
+
l("input", {
|
|
178
|
+
type: "radio",
|
|
179
|
+
name: "svg-engine",
|
|
180
|
+
value: r.engine,
|
|
181
|
+
checked: y.value === r.engine,
|
|
182
|
+
onChange: (be) => P({ engine: r.engine })
|
|
183
|
+
}, null, 40, J),
|
|
184
|
+
l("span", K, [
|
|
185
|
+
l("strong", Q, n(t(o)(`tools.vectorize_svg.${r.title}`)), 1),
|
|
186
|
+
l("small", null, n(t(o)(`tools.vectorize_svg.${r.description}`)), 1),
|
|
187
|
+
z(r.engine) ? v("", !0) : (a(), i("small", Y, n(t(o)("tools.vectorize_svg.unavailable")), 1))
|
|
188
|
+
])
|
|
189
|
+
]))), 128))
|
|
190
|
+
], 64)) : v("", !0),
|
|
191
|
+
l("label", ee, [
|
|
192
|
+
l("span", null, n(t(o)("tools.vectorize_svg.optimizationProfile")), 1),
|
|
193
|
+
l("select", {
|
|
194
|
+
value: b.value,
|
|
195
|
+
onChange: m[0] || (m[0] = (r) => P({
|
|
196
|
+
optimize: r.target.value !== "raw",
|
|
197
|
+
optimizationProfile: r.target.value === "raw" ? k.value.optimizationProfile : r.target.value
|
|
198
|
+
}))
|
|
199
|
+
}, [
|
|
200
|
+
l("option", oe, n(t(o)("tools.vectorize_svg.uncompressed")), 1),
|
|
201
|
+
l("option", ne, n(t(o)("tools.vectorize_svg.conservative")), 1),
|
|
202
|
+
l("option", ae, n(t(o)("tools.vectorize_svg.balancedRecommended")), 1),
|
|
203
|
+
l("option", le, n(t(o)("tools.vectorize_svg.sizeFirst")), 1)
|
|
204
|
+
], 40, te)
|
|
205
|
+
]),
|
|
206
|
+
b.value !== "raw" ? (a(), i("p", se, n(t(o)("tools.vectorize_svg.optimizationNote")), 1)) : v("", !0)
|
|
207
|
+
], 8, H),
|
|
208
|
+
l("p", ie, [
|
|
209
|
+
x(t(U), { size: 14 }),
|
|
210
|
+
I(n(t(o)("tools.vectorize_svg.compareNote")), 1)
|
|
211
|
+
])
|
|
212
|
+
]),
|
|
213
|
+
_: 1
|
|
214
|
+
}, 8, ["class", "context"]));
|
|
215
|
+
}
|
|
216
|
+
}), Ie = /* @__PURE__ */ $(fe, [["__scopeId", "data-v-7fab4cab"]]);
|
|
217
|
+
export {
|
|
218
|
+
Ie as default
|
|
219
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { defineComponent as C, computed as T, openBlock as u, createElementBlock as d, createElementVNode as r, createTextVNode as x, toDisplayString as i, unref as e, Fragment as b, renderList as V, createCommentVNode as F, createBlock as A, withCtx as y, createVNode as k } from "vue";
|
|
2
|
+
import { F as L, H as I, _ as N, G as B } from "./entry-CboOSe2r.js";
|
|
3
|
+
import { a$ as P, b0 as E, b1 as S, S as U } from "./hosted-resources-COzZ7nZY.js";
|
|
4
|
+
import { u as $, a as O, _ as D, b as G } from "./PluginActionFooter.vue_vue_type_script_setup_true_lang-BGe419qz.js";
|
|
5
|
+
const R = { class: "translation-fields" }, H = ["value"], M = {
|
|
6
|
+
disabled: "",
|
|
7
|
+
value: ""
|
|
8
|
+
}, W = ["value"], j = ["value"], q = { key: 0 }, z = ["value", "placeholder"], J = ["value", "placeholder"], K = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "hint",
|
|
11
|
+
role: "alert"
|
|
12
|
+
}, Q = /* @__PURE__ */ C({
|
|
13
|
+
__name: "TranslationFields",
|
|
14
|
+
props: {
|
|
15
|
+
modelValue: {}
|
|
16
|
+
},
|
|
17
|
+
emits: ["update:modelValue"],
|
|
18
|
+
setup(a, { emit: g }) {
|
|
19
|
+
const { ui: o, uiText: f, uiTargetLanguage: c } = L(), _ = a, v = g, m = I(), n = T(() => m?.config.value.toolOptions?.translation?.targets), h = T(() => {
|
|
20
|
+
if (n.value) return "";
|
|
21
|
+
const l = _.modelValue;
|
|
22
|
+
return l.targetLanguage || l.termsText || l.notes ? P(l) : "";
|
|
23
|
+
});
|
|
24
|
+
function w(l) {
|
|
25
|
+
if (n.value) {
|
|
26
|
+
n.value.some((t) => t.code === l) && v("update:modelValue", {
|
|
27
|
+
targetLanguage: null,
|
|
28
|
+
targetCode: l,
|
|
29
|
+
termsText: "",
|
|
30
|
+
notes: ""
|
|
31
|
+
});
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const s = U(l);
|
|
35
|
+
s && p({ targetLanguage: s.language, targetLocale: s.locale });
|
|
36
|
+
}
|
|
37
|
+
function p(l) {
|
|
38
|
+
v("update:modelValue", { ..._.modelValue, ...l });
|
|
39
|
+
}
|
|
40
|
+
return (l, s) => (u(), d("div", R, [
|
|
41
|
+
r("label", null, [
|
|
42
|
+
x(i(e(o)("tools.image_translation.translationFields_966a23e8")), 1),
|
|
43
|
+
r("select", {
|
|
44
|
+
value: n.value ? a.modelValue.targetCode ?? "" : e(E)(a.modelValue),
|
|
45
|
+
onChange: s[0] || (s[0] = (t) => w(t.target.value))
|
|
46
|
+
}, [
|
|
47
|
+
r("option", M, i(e(o)("tools.image_translation.translationFields_adf0e5eb")), 1),
|
|
48
|
+
(u(!0), d(b, null, V(n.value ?? [], (t) => (u(), d("option", {
|
|
49
|
+
key: t.code,
|
|
50
|
+
value: t.code
|
|
51
|
+
}, i(t.label), 9, W))), 128)),
|
|
52
|
+
(u(!0), d(b, null, V(n.value ? [] : e(S), (t) => (u(), d("option", {
|
|
53
|
+
key: t.locale,
|
|
54
|
+
value: t.locale
|
|
55
|
+
}, i(e(c)(t.locale)), 9, j))), 128))
|
|
56
|
+
], 40, H)
|
|
57
|
+
]),
|
|
58
|
+
n.value ? F("", !0) : (u(), d("details", q, [
|
|
59
|
+
r("summary", null, i(e(o)("tools.image_translation.translationFields_86ffbbfc")), 1),
|
|
60
|
+
r("label", null, [
|
|
61
|
+
x(i(e(o)("tools.image_translation.translationFields_497466ea")), 1),
|
|
62
|
+
r("textarea", {
|
|
63
|
+
value: a.modelValue.termsText,
|
|
64
|
+
maxlength: "4900",
|
|
65
|
+
rows: "3",
|
|
66
|
+
placeholder: e(o)("tools.image_translation.translationFields_2c7cb6c8"),
|
|
67
|
+
onInput: s[1] || (s[1] = (t) => p({ termsText: t.target.value }))
|
|
68
|
+
}, null, 40, z)
|
|
69
|
+
]),
|
|
70
|
+
r("label", null, [
|
|
71
|
+
x(i(e(o)("tools.image_translation.translationFields_a495d2e4")), 1),
|
|
72
|
+
r("textarea", {
|
|
73
|
+
value: a.modelValue.notes,
|
|
74
|
+
maxlength: "1000",
|
|
75
|
+
rows: "3",
|
|
76
|
+
placeholder: e(o)("tools.image_translation.translationFields_f18de538"),
|
|
77
|
+
onInput: s[2] || (s[2] = (t) => p({ notes: t.target.value }))
|
|
78
|
+
}, null, 40, J)
|
|
79
|
+
])
|
|
80
|
+
])),
|
|
81
|
+
h.value ? (u(), d("p", K, i(e(f)(h.value)), 1)) : F("", !0)
|
|
82
|
+
]));
|
|
83
|
+
}
|
|
84
|
+
}), X = /* @__PURE__ */ N(Q, [["__scopeId", "data-v-eede59c8"]]), Y = ["disabled"], Z = /* @__PURE__ */ C({
|
|
85
|
+
__name: "TranslationToolPanel",
|
|
86
|
+
props: {
|
|
87
|
+
context: {}
|
|
88
|
+
},
|
|
89
|
+
setup(a) {
|
|
90
|
+
const { ui: g } = L(), o = a, f = I(), c = $(() => o.context), _ = T(() => {
|
|
91
|
+
const m = f?.config.value.toolOptions?.translation?.targets;
|
|
92
|
+
return m ? !m.some((n) => n.code === c.value.translation.targetCode) : !!P(c.value.translation);
|
|
93
|
+
}), v = O(() => o.context, "translation");
|
|
94
|
+
return (m, n) => (u(), A(B, {
|
|
95
|
+
context: a.context,
|
|
96
|
+
layout: "contained",
|
|
97
|
+
help: e(g)("tools.image_translation.translationFields_9f7615dc") + " " + e(g)("tools.image_translation.translationFields_5e86b15d")
|
|
98
|
+
}, {
|
|
99
|
+
actions: y(() => [
|
|
100
|
+
k(D, {
|
|
101
|
+
class: "translation-action",
|
|
102
|
+
context: a.context,
|
|
103
|
+
"show-service-status": !1,
|
|
104
|
+
available: e(G)(a.context),
|
|
105
|
+
ready: !_.value
|
|
106
|
+
}, null, 8, ["context", "available", "ready"])
|
|
107
|
+
]),
|
|
108
|
+
default: y(() => [
|
|
109
|
+
r("fieldset", {
|
|
110
|
+
class: "tool-fields plugin-fields",
|
|
111
|
+
disabled: a.context.readonly
|
|
112
|
+
}, [
|
|
113
|
+
k(X, {
|
|
114
|
+
"model-value": e(c).translation,
|
|
115
|
+
"onUpdate:modelValue": e(v)
|
|
116
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"])
|
|
117
|
+
], 8, Y)
|
|
118
|
+
]),
|
|
119
|
+
_: 1
|
|
120
|
+
}, 8, ["context", "help"]));
|
|
121
|
+
}
|
|
122
|
+
}), oe = /* @__PURE__ */ N(Z, [["__scopeId", "data-v-43f85ca5"]]);
|
|
123
|
+
export {
|
|
124
|
+
oe as default
|
|
125
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { defineComponent as w, computed as y, watch as U, openBlock as r, createElementBlock as p, createVNode as b, unref as a, toDisplayString as o, createCommentVNode as x, createElementVNode as c, createTextVNode as B, ref as P, createBlock as k, withCtx as V } from "vue";
|
|
2
|
+
import { F as C, aL as N, aM as E, aA as h, _ as I, G as R } from "./entry-CboOSe2r.js";
|
|
3
|
+
import { B as S } from "./BatchModeChoices-DeBARgvY.js";
|
|
4
|
+
import { u as T, a as A, b as F, _ as D } from "./PluginActionFooter.vue_vue_type_script_setup_true_lang-BGe419qz.js";
|
|
5
|
+
const $ = { class: "upscale-fields tool-fields" }, z = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "tool-note"
|
|
8
|
+
}, G = ["aria-label", "value", "disabled"], L = ["disabled"], _ = { value: "2" }, j = ["disabled"], q = { class: "hint" }, H = { class: "hint" }, J = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "hint",
|
|
11
|
+
role: "alert"
|
|
12
|
+
}, K = { class: "tool-note" }, O = /* @__PURE__ */ w({
|
|
13
|
+
__name: "UpscaleFields",
|
|
14
|
+
props: {
|
|
15
|
+
modelValue: {},
|
|
16
|
+
writer: { type: Boolean },
|
|
17
|
+
available: { type: Boolean, default: !0 },
|
|
18
|
+
upscaleModes: { default: () => ["crisp"] },
|
|
19
|
+
sources: { default: () => [] },
|
|
20
|
+
recovery: {}
|
|
21
|
+
},
|
|
22
|
+
emits: ["update:modelValue", "ready"],
|
|
23
|
+
setup(e, { emit: u }) {
|
|
24
|
+
const { ui: l, uiText: m } = C(), t = e, v = u, i = y(
|
|
25
|
+
() => N(t.modelValue, t.writer, t.available, t.upscaleModes)
|
|
26
|
+
), n = y(() => {
|
|
27
|
+
try {
|
|
28
|
+
return E(t.modelValue, t.upscaleModes), "";
|
|
29
|
+
} catch (s) {
|
|
30
|
+
return s.message;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
U(i, (s) => v("ready", s), { immediate: !0 });
|
|
34
|
+
function f(s) {
|
|
35
|
+
t.recovery && s.mode && s.mode !== t.modelValue.mode || t.writer && t.available && v("update:modelValue", { ...t.modelValue, ...s });
|
|
36
|
+
}
|
|
37
|
+
function M(s) {
|
|
38
|
+
const d = s.target.value;
|
|
39
|
+
f({ scale: d === "native" ? "native" : Number(d) });
|
|
40
|
+
}
|
|
41
|
+
return (s, d) => (r(), p("div", $, [
|
|
42
|
+
b(S, {
|
|
43
|
+
class: "upscale-models",
|
|
44
|
+
label: a(l)("tools.upscale.upscaleFields_a870d353"),
|
|
45
|
+
"model-value": e.modelValue.mode,
|
|
46
|
+
disabled: !e.writer || !e.available,
|
|
47
|
+
options: [
|
|
48
|
+
{
|
|
49
|
+
value: "crisp",
|
|
50
|
+
label: a(l)("tools.upscale.nested_ab3ab2d2"),
|
|
51
|
+
image: a(h)("mode-cards-v3/upscale-crisp.webp"),
|
|
52
|
+
description: a(l)("tools.upscale.nested_0e44cec5"),
|
|
53
|
+
disabled: !e.upscaleModes.includes("crisp") || !!e.recovery && e.modelValue.mode !== "crisp"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
value: "creative",
|
|
57
|
+
label: a(l)("tools.upscale.nested_38df25c8"),
|
|
58
|
+
image: a(h)("mode-cards-v3/upscale-creative.webp"),
|
|
59
|
+
description: a(l)("tools.upscale.nested_fb2c4a21"),
|
|
60
|
+
disabled: !e.upscaleModes.includes("creative") || !!e.recovery && e.modelValue.mode !== "creative"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"onUpdate:modelValue": d[0] || (d[0] = (g) => f({ mode: g }))
|
|
64
|
+
}, null, 8, ["label", "model-value", "disabled", "options"]),
|
|
65
|
+
e.recovery ? (r(), p("p", z, o(a(l)("tools.upscale.upscaleFields_abaa83de")), 1)) : x("", !0),
|
|
66
|
+
c("label", null, [
|
|
67
|
+
B(o(a(l)("tools.upscale.upscaleFields_d9091912")), 1),
|
|
68
|
+
c("select", {
|
|
69
|
+
"aria-label": a(l)("tools.upscale.upscaleFields_ea5ae1bc"),
|
|
70
|
+
value: e.modelValue.scale,
|
|
71
|
+
disabled: !e.writer || !e.available || !e.upscaleModes.includes(e.modelValue.mode),
|
|
72
|
+
onChange: M
|
|
73
|
+
}, [
|
|
74
|
+
c("option", {
|
|
75
|
+
value: "native",
|
|
76
|
+
disabled: !!e.recovery
|
|
77
|
+
}, o(a(l)("tools.upscale.upscaleFields_db7727f4")), 9, L),
|
|
78
|
+
c("option", _, o(a(l)("tools.upscale.upscaleFields_eab35e23")), 1),
|
|
79
|
+
c("option", {
|
|
80
|
+
value: "4",
|
|
81
|
+
disabled: e.recovery === "shortfall"
|
|
82
|
+
}, o(a(l)("tools.upscale.upscaleFields_f6bc186c")), 9, j)
|
|
83
|
+
], 40, G)
|
|
84
|
+
]),
|
|
85
|
+
c("p", q, o(a(l)("tools.upscale.upscaleFields_c35709e1")), 1),
|
|
86
|
+
c("p", H, o(a(l)("tools.upscale.upscaleFields_b5ba1069")), 1),
|
|
87
|
+
n.value ? (r(), p("p", J, o(n.value), 1)) : x("", !0),
|
|
88
|
+
c("p", K, o(a(l)("tools.upscale.upscaleFields_02346136")), 1)
|
|
89
|
+
]));
|
|
90
|
+
}
|
|
91
|
+
}), Q = /* @__PURE__ */ I(O, [["__scopeId", "data-v-f284a047"]]), ee = /* @__PURE__ */ w({
|
|
92
|
+
__name: "UpscaleToolPanel",
|
|
93
|
+
props: {
|
|
94
|
+
context: {}
|
|
95
|
+
},
|
|
96
|
+
setup(e) {
|
|
97
|
+
const u = e, l = T(() => u.context), m = P(!1), t = A(() => u.context, "upscale");
|
|
98
|
+
return (v, i) => (r(), k(R, {
|
|
99
|
+
context: e.context,
|
|
100
|
+
layout: "contained"
|
|
101
|
+
}, {
|
|
102
|
+
actions: V(() => [
|
|
103
|
+
b(D, {
|
|
104
|
+
context: e.context,
|
|
105
|
+
available: a(F)(e.context),
|
|
106
|
+
ready: m.value
|
|
107
|
+
}, null, 8, ["context", "available", "ready"])
|
|
108
|
+
]),
|
|
109
|
+
default: V(() => [
|
|
110
|
+
b(Q, {
|
|
111
|
+
"model-value": a(l).upscale,
|
|
112
|
+
writer: !e.context.readonly,
|
|
113
|
+
available: a(F)(e.context),
|
|
114
|
+
"upscale-modes": e.context.view.upscaleModes,
|
|
115
|
+
sources: e.context.view.upscaleSources,
|
|
116
|
+
recovery: e.context.view.upscaleRecovery,
|
|
117
|
+
"onUpdate:modelValue": a(t),
|
|
118
|
+
onReady: i[0] || (i[0] = (n) => m.value = n)
|
|
119
|
+
}, null, 8, ["model-value", "writer", "available", "upscale-modes", "sources", "recovery", "onUpdate:modelValue"])
|
|
120
|
+
]),
|
|
121
|
+
_: 1
|
|
122
|
+
}, 8, ["context"]));
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
export {
|
|
126
|
+
ee as default
|
|
127
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { L as i } from "./hosted-resources-COzZ7nZY.js";
|
|
2
|
+
const d = "" + new URL("../assets/bounded-cutout.worker-BZR6mbaI.js", import.meta.url).href, f = "" + new URL("../assets/cutout.worker-DyH6Prbn.js", import.meta.url).href;
|
|
3
|
+
function w(o, r, t) {
|
|
4
|
+
return o.startsWith("fetch:") ? {
|
|
5
|
+
label: o.includes("models") ? "正在加载本地模型" : "正在加载推理引擎",
|
|
6
|
+
fraction: t > 0 ? Math.min(1, r / t) : null
|
|
7
|
+
} : { label: {
|
|
8
|
+
"compute:decode": "正在读取图片",
|
|
9
|
+
"compute:inference": "正在识别主体",
|
|
10
|
+
"compute:mask": "正在生成透明背景",
|
|
11
|
+
"compute:encode": "正在生成 PNG"
|
|
12
|
+
}[o] || "正在准备", fraction: null };
|
|
13
|
+
}
|
|
14
|
+
class k {
|
|
15
|
+
constructor(r, t) {
|
|
16
|
+
this.options = t, this.model = r;
|
|
17
|
+
}
|
|
18
|
+
worker = null;
|
|
19
|
+
pending = null;
|
|
20
|
+
model;
|
|
21
|
+
run(r, t = () => {
|
|
22
|
+
}, s = "transparent", c = !1, p = 0) {
|
|
23
|
+
const l = this.options?.resources;
|
|
24
|
+
if (!l)
|
|
25
|
+
return Promise.reject(new Error("MISSING_RESOURCE: 显式模型/ORT资源尚未配置"));
|
|
26
|
+
if (this.pending) return Promise.reject(new Error("正在处理上一张图片。"));
|
|
27
|
+
this.worker ??= this.options ? this.options.workerUrl ? i(this.options.workerUrl, { type: "module" }) : i(d, { type: "module" }) : i(f, { type: "module" });
|
|
28
|
+
const n = this.worker;
|
|
29
|
+
return new Promise((h, m) => {
|
|
30
|
+
const a = setTimeout(
|
|
31
|
+
() => this.dispose(new Error("处理超时,请重试或使用更小的图片。")),
|
|
32
|
+
18e4
|
|
33
|
+
), u = () => {
|
|
34
|
+
clearTimeout(a), this.pending = null;
|
|
35
|
+
};
|
|
36
|
+
this.pending = (e) => {
|
|
37
|
+
u(), m(e);
|
|
38
|
+
}, n.onmessage = ({ data: e }) => {
|
|
39
|
+
e.type === "progress" ? t(w(e.key, e.current, e.total)) : e.type === "result" ? (u(), h(e)) : e.type === "error" && this.dispose(new Error(e.error));
|
|
40
|
+
}, n.onerror = (e) => {
|
|
41
|
+
e.preventDefault(), this.dispose(new Error(e.message || "本地推理引擎无法启动。"));
|
|
42
|
+
}, n.postMessage({
|
|
43
|
+
blob: r,
|
|
44
|
+
model: this.model,
|
|
45
|
+
background: s,
|
|
46
|
+
trimTransparent: c,
|
|
47
|
+
trimPadding: p,
|
|
48
|
+
threads: this.options?.threads,
|
|
49
|
+
resources: l
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
dispose(r = new Error("已取消处理。")) {
|
|
54
|
+
this.worker?.terminate(), this.worker = null, this.pending?.(r), this.pending = null;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async function b(o) {
|
|
58
|
+
const r = await createImageBitmap(o);
|
|
59
|
+
try {
|
|
60
|
+
const t = new OffscreenCanvas(r.width, r.height), s = t.getContext("2d");
|
|
61
|
+
return s.fillStyle = "#fff", s.fillRect(0, 0, t.width, t.height), s.drawImage(r, 0, 0), await t.convertToBlob({ type: "image/png" });
|
|
62
|
+
} finally {
|
|
63
|
+
r.close();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
k as CutoutEngine,
|
|
68
|
+
b as whiteBackground
|
|
69
|
+
};
|