

const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.js');
const require_decorateMetadata = require('../../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateMetadata.js');
const require_decorate = require('../../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.js');
const require_validators = require('../../../../utils/validators.js');
let class_transformer = require("class-transformer");
class_transformer = require_rolldown_runtime.__toESM(class_transformer);
let class_validator = require("class-validator");
class_validator = require_rolldown_runtime.__toESM(class_validator);

//#region src/modules/vc/models/credential/W3cIssuer.ts
var W3cIssuer = class {
	constructor(options) {
		if (options) this.id = options.id;
	}
};
require_decorate.__decorate([require_validators.IsUri(), require_decorateMetadata.__decorateMetadata("design:type", String)], W3cIssuer.prototype, "id", void 0);
function W3cIssuerTransformer() {
	return (0, class_transformer.Transform)(({ value, type }) => {
		if (type === class_transformer.TransformationType.PLAIN_TO_CLASS) {
			if ((0, class_validator.isString)(value)) return value;
			return (0, class_transformer.plainToInstance)(W3cIssuer, value);
		}
		if (type === class_transformer.TransformationType.CLASS_TO_PLAIN) {
			if ((0, class_validator.isString)(value)) return value;
			return (0, class_transformer.instanceToPlain)(value);
		}
		return value;
	});
}
function IsW3cIssuer(validationOptions) {
	return (0, class_validator.ValidateBy)({
		name: "IsW3cIssuer",
		validator: {
			validate: (value) => {
				if (typeof value === "string") return require_validators.isUri(value);
				if ((0, class_validator.isInstance)(value, W3cIssuer)) return require_validators.isUri(value.id);
				return false;
			},
			defaultMessage: (0, class_validator.buildMessage)((eachPrefix) => `${eachPrefix}$property must be an URI or an object with an id property which is an URI`, validationOptions)
		}
	}, validationOptions);
}

//#endregion
exports.IsW3cIssuer = IsW3cIssuer;
exports.W3cIssuer = W3cIssuer;
exports.W3cIssuerTransformer = W3cIssuerTransformer;