

const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.js');
const require_ecJwk = require('../jwk/kty/ec/ecJwk.js');
const require_okpJwk = require('../jwk/kty/okp/okpJwk.js');
const require_common = require('./common.js');
let zod = require("zod");
zod = require_rolldown_runtime.__toESM(zod);

//#region src/modules/kms/options/KmsKeyAgreementEncryptOptions.ts
const zKmsJwkPublicEcdh = zod.z.union([require_okpJwk.zKmsJwkPublicOkp.extend({ crv: require_okpJwk.zKmsJwkPublicOkp.shape.crv.extract(["X25519"]) }), require_ecJwk.zKmsJwkPublicEc.extend({ crv: require_ecJwk.zKmsJwkPublicEc.shape.crv.extract([
	"P-256",
	"P-384",
	"P-521",
	"secp256k1"
]) })]);
const zKmsKeyAgreementEcdhEs = zod.z.object({
	keyId: require_common.zKmsKeyId,
	algorithm: zod.z.literal("ECDH-ES"),
	externalPublicJwk: zKmsJwkPublicEcdh,
	apu: zod.z.optional(zod.z.instanceof(Uint8Array)),
	apv: zod.z.optional(zod.z.instanceof(Uint8Array))
});
const zKmsKeyAgreementEncryptEcdhEsKw = zod.z.object({
	keyId: require_common.zKmsKeyId,
	algorithm: zod.z.enum([
		"ECDH-ES+A128KW",
		"ECDH-ES+A192KW",
		"ECDH-ES+A256KW"
	]),
	externalPublicJwk: zKmsJwkPublicEcdh,
	apu: zod.z.optional(zod.z.instanceof(Uint8Array)),
	apv: zod.z.optional(zod.z.instanceof(Uint8Array))
});
const zKmsKeyAgreementEncryptEcdhHsalsa20 = zod.z.object({
	keyId: require_common.zKmsKeyId.optional(),
	algorithm: zod.z.literal("ECDH-HSALSA20"),
	externalPublicJwk: require_okpJwk.zKmsJwkPublicOkp.extend({ crv: require_okpJwk.zKmsJwkPublicOkp.shape.crv.extract(["X25519"]) })
});
const zKmsKeyAgreementEncryptOptions = zod.z.discriminatedUnion("algorithm", [
	zKmsKeyAgreementEcdhEs,
	zKmsKeyAgreementEncryptEcdhEsKw,
	zKmsKeyAgreementEncryptEcdhHsalsa20
]).describe("Options for key agreement based on an assymetric key.");

//#endregion
exports.zKmsJwkPublicEcdh = zKmsJwkPublicEcdh;
exports.zKmsKeyAgreementEcdhEs = zKmsKeyAgreementEcdhEs;
exports.zKmsKeyAgreementEncryptOptions = zKmsKeyAgreementEncryptOptions;