import { defineComponent, ref, reactive, computed, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrRenderList, ssrRenderAttr, ssrIncludeBooleanAttr, ssrLooseContain, ssrLooseEqual, ssrInterpolate, ssrRenderStyle, ssrRenderClass } from 'vue/server-renderer'; import { u as useApi } from './useApi-B7CB0Cnn.mjs'; import { u as useToast } from './useToast-BwtTR9dH.mjs'; import { _ as _export_sfc } from './server.mjs'; import './auth-QFkCoU1C.mjs'; import 'pinia'; import '../nitro/nitro.mjs'; import 'node:http'; import 'node:https'; import 'node:events'; import 'node:buffer'; import 'node:fs'; import 'node:path'; import 'node:crypto'; import 'node:url'; import '../routes/renderer.mjs'; import 'vue-bundle-renderer/runtime'; import 'unhead/server'; import 'devalue'; import 'unhead/utils'; import 'perfect-debounce'; const SCAT_STT = 1; const SCAT_TTS = 2; const SCAT_MT = 3; const SCAT_AST = 4; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "calltranslate", __ssrInlineRender: true, setup(__props) { const LANGS = [ { c: "zh", n: "中文" }, { c: "en", n: "英文" }, { c: "ja", n: "日语" }, { c: "ko", n: "韩语" }, { c: "fr", n: "法语" }, { c: "de", n: "德语" }, { c: "es", n: "西班牙语" }, { c: "pt", n: "葡萄牙语" }, { c: "ru", n: "俄语" }, { c: "ar", n: "阿拉伯语" }, { c: "th", n: "泰语" }, { c: "vi", n: "越南语" }, { c: "id", n: "印尼语" }, { c: "ms", n: "马来语" }, { c: "hi", n: "印地语" } ]; function langName(c) { const x = LANGS.find((l) => l.c === c); return x ? x.n : c || ""; } const REGIONS = [ { value: 1, label: "中国" }, { value: 2, label: "美国" }, { value: 3, label: "东亚" }, { value: 4, label: "东南亚" }, { value: 5, label: "南亚" }, { value: 6, label: "中东" }, { value: 7, label: "欧洲" }, { value: 8, label: "俄罗斯" }, { value: 9, label: "非洲" }, { value: 10, label: "南美" }, { value: 11, label: "北美" }, { value: 12, label: "大洋洲" }, { value: 13, label: "巴西" }, { value: 14, label: "印度" } ]; useApi(); useToast(); const allSvcs = ref([]); const pairs = ref([]); const curRegion = ref(REGIONS.length ? REGIONS[0].value : 1); const editorOpen = ref(false); const editingPair = ref(null); ref(0); const ed = reactive({ src: "zh", dst: "en", bidir: false, mode: 0, asr: "", mt: "", tts: "", ast: "", enable: true }); function svcsByCat(cat) { return allSvcs.value.filter( (s) => s.enable && (s.categories || "").split(",").map(Number).indexOf(cat) >= 0 ); } function svcName(id) { const s = allSvcs.value.find((x) => x.id === id); return s ? s.name : id || "未配置"; } const syncOpen = ref(false); const syncDesc = ref(""); const syncTargets = ref([]); const syncRegions = computed(() => REGIONS.filter((r) => r.value !== curRegion.value)); return (_ctx, _push, _parent, _attrs) => { _push(`

通话翻译配置

按区域和语言对配置翻译服务。支持三段式(ASR→MT→TTS)和端到端 AST 两种模式。

区域

${ssrInterpolate(editingPair.value ? "编辑语言对" : "新增语言对")}

🧩 三段式拼接
ASR → MT → TTS
⚡ 端到端 AST
单服务直接完成语音翻译
`); if (ed.mode === 0) { _push(`
`); } else { _push(`
`); } _push(`
`); if (!pairs.value.length) { _push(`
🌐

当前区域暂无语言对配置

`); } else { _push(``); } _push(``); ssrRenderList(pairs.value, (p) => { _push(`
${ssrInterpolate(langName(p.src_lang))}${ssrInterpolate(p.bidir ? "⇄" : "→")}${ssrInterpolate(langName(p.dst_lang))}
`); if (p.mode === 0) { _push(`三段式拼接`); } else { _push(`端到端 AST`); } if (p.enable) { _push(`启用`); } else { _push(`停用`); } _push(`
`); if (p.mode === 0) { _push(`
ASR: ${ssrInterpolate(svcName(p.asr_svc_id))}→MT: ${ssrInterpolate(svcName(p.mt_svc_id))}→TTS: ${ssrInterpolate(svcName(p.tts_svc_id))}
`); } else { _push(`
AST: ${ssrInterpolate(svcName(p.ast_svc_id))}
`); } _push(`
`); }); _push(`

同步到其他区域

${ssrInterpolate(syncDesc.value)}

✦ 同步内容:服务组合(模式 + 各段服务)将被复制到目标区域。
选择目标区域
`); ssrRenderList(syncRegions.value, (r) => { _push(``); }); _push(`

⚠ 目标区域相同语言对已存在则覆盖,否则新建。

`); }; } }); const _sfc_setup = _sfc_main.setup; _sfc_main.setup = (props, ctx) => { const ssrContext = useSSRContext(); (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/calltranslate.vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; const calltranslate = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-23837fd5"]]); export { calltranslate as default }; //# sourceMappingURL=calltranslate-qCADGfI8.mjs.map