import { Logger as e } from "../../error-handling/logger.mjs";
//#region libs/shared/common/src/functions/auto-deposit-back-helpers/update-hinkal.ts
var t = (t, n, r) => {
	try {
		let e = t.outCommitments?.flat(), i = t.encryptedOutputs?.flat(), a = t.inputNullifiers?.flat(), o = r.merkleTreeHinkalByChain[n].getStartIndex(), s = BigInt(r.merkleTreeHinkalByChain[n].toJSON().count);
		(e.length !== 0 || i.length !== 0 || a.length !== 0) && (e.length !== 0 && e.forEach((e) => {
			e === "0" || e === "0x" || r.merkleTreeHinkalByChain[n].insert(BigInt(e), o + s);
		}), i.length !== 0 && i.forEach((e) => {
			e === "0" || e === "0x" || r.encryptedOutputsByChain[n].push({
				value: e,
				isPositive: !0,
				isBlocked: !1
			});
		}), a.length !== 0 && a.forEach((e) => {
			e === "0" || e === "0x" || r.nullifiersByChain[n].add(e);
		}), r.updateMerkleTreeUpdates(!1));
	} catch (t) {
		e.error("updateHinkal error", { error: t });
	}
};
//#endregion
export { t as updateHinkal };
