

const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.js');
const require_decorateMetadata = require('../../../../_virtual/_@oxc-project_runtime@0.95.0/helpers/decorateMetadata.js');
const require_decorate = require('../../../../_virtual/_@oxc-project_runtime@0.95.0/helpers/decorate.js');
const require_array = require('../../../../utils/array.js');
const require_JsonTransformer = require('../../../../utils/JsonTransformer.js');
const require_validators = require('../../../../utils/validators.js');
require('../../../../utils/index.js');
const require_ClaimFormat = require('../../models/ClaimFormat.js');
const require_W3cCredential = require('../../models/credential/W3cCredential.js');
const require_DataIntegrityProof = require('./DataIntegrityProof.js');
const require_LinkedDataProof = require('./LinkedDataProof.js');
const require_ProofTransformer = require('./ProofTransformer.js');
let class_validator = require("class-validator");
class_validator = require_rolldown_runtime.__toESM(class_validator);

//#region src/modules/vc/data-integrity/models/W3cJsonLdVerifiableCredential.ts
var W3cJsonLdVerifiableCredential = class W3cJsonLdVerifiableCredential extends require_W3cCredential.W3cCredential {
	constructor(options) {
		super(options);
		if (options) this.proof = require_array.mapSingleOrArray(options.proof, (proof) => {
			if (proof.cryptosuite) return new require_DataIntegrityProof.DataIntegrityProof(proof);
			return new require_LinkedDataProof.LinkedDataProof(proof);
		});
	}
	get proofTypes() {
		return (require_array.asArray(this.proof) ?? []).map((proof) => proof.type);
	}
	get dataIntegrityCryptosuites() {
		return (require_array.asArray(this.proof) ?? []).filter((proof) => proof.type === "DataIntegrityProof" && "cryptosuite" in proof).map((proof) => proof.cryptosuite);
	}
	toJson() {
		return require_JsonTransformer.JsonTransformer.toJSON(this);
	}
	static fromJson(json) {
		return require_JsonTransformer.JsonTransformer.fromJSON(json, W3cJsonLdVerifiableCredential);
	}
	/**
	* The {@link ClaimFormat} of the credential. For JSON-LD credentials this is always `ldp_vc`.
	*/
	get claimFormat() {
		return require_ClaimFormat.ClaimFormat.LdpVc;
	}
	/**
	* Get the encoded variant of the W3C Verifiable Credential. For JSON-LD credentials this is
	* a JSON object.
	*/
	get encoded() {
		return this.toJson();
	}
	get jsonCredential() {
		return this.toJson();
	}
};
require_decorate.__decorate([
	require_ProofTransformer.ProofTransformer(),
	require_validators.IsInstanceOrArrayOfInstances({ classType: [require_LinkedDataProof.LinkedDataProof, require_DataIntegrityProof.DataIntegrityProof] }),
	(0, class_validator.ValidateNested)(),
	require_decorateMetadata.__decorateMetadata("design:type", Object)
], W3cJsonLdVerifiableCredential.prototype, "proof", void 0);

//#endregion
exports.W3cJsonLdVerifiableCredential = W3cJsonLdVerifiableCredential;