

import { __decorateMetadata } from "../../../../_virtual/_@oxc-project_runtime@0.95.0/helpers/decorateMetadata.mjs";
import { __decorate } from "../../../../_virtual/_@oxc-project_runtime@0.95.0/helpers/decorate.mjs";
import { JsonTransformer } from "../../../../utils/JsonTransformer.mjs";
import { IsInstanceOrArrayOfInstances, IsUri } from "../../../../utils/validators.mjs";
import "../../../../utils/index.mjs";
import { CREDENTIALS_CONTEXT_V1_URL, VERIFIABLE_PRESENTATION_TYPE } from "../../constants.mjs";
import { IsCredentialJsonLdContext, IsVerifiablePresentationType } from "../../validators.mjs";
import { W3cJsonLdVerifiableCredential } from "../../data-integrity/models/W3cJsonLdVerifiableCredential.mjs";
import { W3cJwtVerifiableCredential } from "../../jwt-vc/W3cJwtVerifiableCredential.mjs";
import { W3cVerifiableCredentialTransformer } from "../credential/W3cVerifiableCredential.mjs";
import { IsW3cHolder, W3cHolder, W3cHolderTransformer } from "./W3cHolder.mjs";
import { Expose } from "class-transformer";
import { IsOptional, ValidateNested } from "class-validator";

//#region src/modules/vc/models/presentation/W3cPresentation.ts
var _ref, _ref2;
var W3cPresentation = class {
	constructor(options) {
		if (options) {
			this.id = options.id;
			this.context = options.context ?? [CREDENTIALS_CONTEXT_V1_URL];
			this.type = options.type ?? [VERIFIABLE_PRESENTATION_TYPE];
			this.verifiableCredential = options.verifiableCredential;
			if (options.holder) this.holder = typeof options.holder === "string" ? options.holder : new W3cHolder(options.holder);
		}
	}
	get holderId() {
		if (!this.holder) return null;
		return this.holder instanceof W3cHolder ? this.holder.id : this.holder;
	}
	toJSON() {
		return JsonTransformer.toJSON(this);
	}
};
__decorate([
	Expose({ name: "@context" }),
	IsCredentialJsonLdContext(),
	__decorateMetadata("design:type", typeof (_ref = typeof Array !== "undefined" && Array) === "function" ? _ref : Object)
], W3cPresentation.prototype, "context", void 0);
__decorate([
	IsOptional(),
	IsUri(),
	__decorateMetadata("design:type", String)
], W3cPresentation.prototype, "id", void 0);
__decorate([IsVerifiablePresentationType(), __decorateMetadata("design:type", typeof (_ref2 = typeof Array !== "undefined" && Array) === "function" ? _ref2 : Object)], W3cPresentation.prototype, "type", void 0);
__decorate([
	W3cHolderTransformer(),
	IsW3cHolder(),
	IsOptional(),
	__decorateMetadata("design:type", Object)
], W3cPresentation.prototype, "holder", void 0);
__decorate([
	W3cVerifiableCredentialTransformer(),
	IsInstanceOrArrayOfInstances({ classType: [W3cJsonLdVerifiableCredential, W3cJwtVerifiableCredential] }),
	ValidateNested({ each: true }),
	__decorateMetadata("design:type", Object)
], W3cPresentation.prototype, "verifiableCredential", void 0);

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