function patternKey(regionIds, criteriaKeys) {
    return `${regionIds.join(',')}\u0001${criteriaKeys.join('\u0001')}`;
}
export function createDepPatternStore() {
    const criteriaPatterns = new Map();
    return {
        reset() {
            criteriaPatterns.clear();
        },
        getCriteriaPattern({ regionIds, criteriaKeys, versionStamp }) {
            const existing = criteriaPatterns.get(patternKey(regionIds, criteriaKeys));
            return existing?.versionStamp === versionStamp ? existing : undefined;
        },
        setCriteriaPattern({ regionIds, criteriaKeys, versionStamp, rows, length }) {
            const entry = {
                rows,
                length,
                versionStamp,
            };
            criteriaPatterns.set(patternKey(regionIds, criteriaKeys), entry);
            return entry;
        },
    };
}
//# sourceMappingURL=dep-pattern-store.js.map