import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
import { t } from "./engineCallFileType.zod-C-t93kQg.js";
import { computed as n, createBlock as r, createCommentVNode as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, openBlock as l, resolveComponent as u, toDisplayString as d, withCtx as f } from "vue";
//#region src/components/on-demand/wt-call-media-action/wt-call-media-action.vue?vue&type=script&setup=true&lang.ts
var p = { class: "wt-call-media-action__option" }, m = /*#__PURE__*/ e(/* @__PURE__ */ c({
	__name: "wt-call-media-action",
	props: {
		files: {},
		playingFileId: { default: "" }
	},
	emits: ["play", "stop"],
	setup(e, { emit: c }) {
		let m = e, h = c, g = n(() => [...m.files[t.FileTypeAudio] || [], ...m.files[t.FileTypeVideo] || []]), _ = n(() => m.files[t.FileTypeVideo] ? "preview-tag-video" : "play"), v = n(() => g.value.some((e) => e.id === m.playingFileId)), y = n(() => g.value.map(({ name: e, id: t, mimeType: n, type: r }) => ({
			text: e,
			id: t,
			mimeType: n,
			type: r,
			icon: n === "video/mp4" ? "preview-tag-video" : "preview-tag-audio"
		}))), b = ({ option: e }) => {
			m.playingFileId === e.id ? h("stop") : h("play", e);
		};
		return (t, n) => {
			let c = u("wt-icon-btn"), m = u("wt-icon"), h = u("wt-context-menu");
			return l(), r(h, {
				class: "wt-call-media-action",
				options: y.value,
				"max-width": "400px",
				onClick: b
			}, {
				activator: f(({ toggle: e }) => [g.value.length ? (l(), r(c, {
					key: 0,
					icon: v.value ? "stop" : _.value,
					onClick: e
				}, null, 8, ["icon", "onClick"])) : i("", !0)]),
				option: f(({ text: t, id: n, icon: r }) => [a("div", p, [s(m, { icon: n === e.playingFileId ? "stop" : r }, null, 8, ["icon"]), o(" " + d(t), 1)])]),
				_: 1
			}, 8, ["options"]);
		};
	}
}), [["__scopeId", "data-v-a6f7b638"]]);
//#endregion
export { m as default };
