"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MemberVarsGen = void 0;
const contractSchema_1 = require("../contractSchema");
const generator_1 = require("../generator");
class MemberVarsGen {
    gen(schema) {
        let members = ``;
        if (schema.hasLiteRef() && schema.liteRefArrayLength(0) === 0) {
            members += `` +
                `struct DynamicLiteRefs {\n` +
                `    uint256[] slots; // 4 per\n` +
                `    mapping(uint64 => uint256) idx;\n` +
                `}\n\n` +
                `mapping(uint256 => DynamicLiteRefs) internal _dynamicLiterefStorage; // tokenId => indexed slots\n` +
                `\n`;
        }
        const hasAnyPatchType = [contractSchema_1.Feature.PATCH, contractSchema_1.Feature.PATCH1155, contractSchema_1.Feature.PATCHACCOUNT].some(patch => schema.features.includes(patch));
        if (hasAnyPatchType) {
            members += `uint256 private _nextTokenId;\n\n`;
        }
        return (0, generator_1.ind)(4, members);
    }
}
exports.MemberVarsGen = MemberVarsGen;
