import { a as shouldLogVerbose } from "./globals-CHNs9cIE.js";
import { a as chunkText } from "./chunk-BtlfY-D4.js";
import "./runtime-env-DwOXvHiR.js";
import "./reply-chunking-BVDPb1Kg.js";
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-DncEiu7R.js";
import { n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-DW856HPs.js";
import { t as createWhatsAppOutboundBase } from "./outbound-base-BYTFEPXg.js";
//#region extensions/whatsapp/src/outbound-adapter.ts
let whatsAppSendModulePromise;
function loadWhatsAppSendModule() {
	whatsAppSendModulePromise ??= import("./send-CALQZio5.js");
	return whatsAppSendModulePromise;
}
function normalizeOutboundText(text) {
	return normalizeWhatsAppPayloadText(text);
}
const whatsappOutbound = createWhatsAppOutboundBase({
	chunker: chunkText,
	sendMessageWhatsApp: async (to, text, options) => await (await loadWhatsAppSendModule()).sendMessageWhatsApp(to, normalizeOutboundText(text), { ...options }),
	sendPollWhatsApp: async (to, poll, options) => await (await loadWhatsAppSendModule()).sendPollWhatsApp(to, poll, options),
	shouldLogVerbose: () => shouldLogVerbose(),
	resolveTarget: ({ to, allowFrom, mode }) => resolveWhatsAppOutboundTarget({
		to,
		allowFrom,
		mode
	}),
	normalizeText: normalizeOutboundText,
	skipEmptyText: true
});
//#endregion
export { whatsappOutbound as t };
