import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateMetadata.mjs";
import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.mjs";
import { BaseDidCommMessage } from "./BaseDidCommMessage.mjs";
import { AckDecorated } from "./decorators/ack/AckDecoratorExtension.mjs";
import { AttachmentDecorated } from "./decorators/attachment/AttachmentExtension.mjs";
import { L10nDecorated } from "./decorators/l10n/L10nDecoratorExtension.mjs";
import { ServiceDecorated } from "./decorators/service/ServiceDecoratorExtension.mjs";
import { ThreadDecorated } from "./decorators/thread/ThreadDecoratorExtension.mjs";
import { TimingDecorated } from "./decorators/timing/TimingDecoratorExtension.mjs";
import { TransportDecorated } from "./decorators/transport/TransportDecoratorExtension.mjs";
import { replaceNewDidCommPrefixWithLegacyDidSovOnMessage } from "./util/messageType.mjs";
import { JsonTransformer } from "@credo-ts/core";
import { Exclude } from "class-transformer";

//#region ../didcomm/src/DidCommMessage.ts
const Decorated = ThreadDecorated(L10nDecorated(TransportDecorated(TimingDecorated(AckDecorated(AttachmentDecorated(ServiceDecorated(BaseDidCommMessage)))))));
var DidCommMessage = class extends Decorated {
	constructor(..._args) {
		super(..._args);
		this.allowDidSovPrefix = false;
		this.allowQueueTransport = true;
	}
	toJSON({ useDidSovPrefixWhereAllowed } = {}) {
		const json = JsonTransformer.toJSON(this);
		if (this.allowDidSovPrefix && useDidSovPrefixWhereAllowed) replaceNewDidCommPrefixWithLegacyDidSovOnMessage(json);
		return json;
	}
	is(Class) {
		return this.type === Class.type.messageTypeUri;
	}
};
__decorate([Exclude(), __decorateMetadata("design:type", Boolean)], DidCommMessage.prototype, "allowDidSovPrefix", void 0);
__decorate([Exclude(), __decorateMetadata("design:type", Boolean)], DidCommMessage.prototype, "allowQueueTransport", void 0);

//#endregion
export { DidCommMessage };
//# sourceMappingURL=DidCommMessage.mjs.map