

const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.js');
const require_Hasher = require('../../crypto/hashes/Hasher.js');
const require_ClaimFormat = require('../vc/models/ClaimFormat.js');
require('../../crypto/index.js');
require('../vc/index.js');
let __sd_jwt_decode = require("@sd-jwt/decode");
__sd_jwt_decode = require_rolldown_runtime.__toESM(__sd_jwt_decode);

//#region src/modules/sd-jwt-vc/decodeSdJwtVc.ts
function sdJwtVcHasher(data, alg) {
	return require_Hasher.Hasher.hash(typeof data === "string" ? data : new Uint8Array(data), alg);
}
function decodeSdJwtVc(compactSdJwtVc, typeMetadata) {
	const { jwt, disclosures, kbJwt } = (0, __sd_jwt_decode.decodeSdJwtSync)(compactSdJwtVc, sdJwtVcHasher);
	const prettyClaims = (0, __sd_jwt_decode.getClaimsSync)(jwt.payload, disclosures, sdJwtVcHasher);
	return {
		compact: compactSdJwtVc,
		header: jwt.header,
		payload: jwt.payload,
		prettyClaims,
		claimFormat: require_ClaimFormat.ClaimFormat.SdJwtDc,
		encoded: compactSdJwtVc,
		kbJwt: kbJwt ? {
			payload: kbJwt.payload,
			header: kbJwt.header
		} : void 0,
		...typeMetadata && { typeMetadata }
	};
}

//#endregion
exports.decodeSdJwtVc = decodeSdJwtVc;
exports.sdJwtVcHasher = sdJwtVcHasher;