export class DirectScalarPhysicalSliceTracker {
    trustedSheetId;
    trusted = true;
    previousInputRow = -1;
    previousInputCol = -1;
    previousFormulaRow = -1;
    previousFormulaCol = -1;
    markUntrusted() {
        this.trusted = false;
    }
    noteCell(sheetId, row, col, kind) {
        if (!this.trusted) {
            return;
        }
        if (this.trustedSheetId === undefined) {
            this.trustedSheetId = sheetId;
        }
        else if (this.trustedSheetId !== sheetId) {
            this.markUntrusted();
            return;
        }
        if (kind === 'input') {
            if (row < this.previousInputRow || (row === this.previousInputRow && col < this.previousInputCol)) {
                this.markUntrusted();
                return;
            }
            this.previousInputRow = row;
            this.previousInputCol = col;
            return;
        }
        if (row < this.previousFormulaRow || (row === this.previousFormulaRow && col < this.previousFormulaCol)) {
            this.markUntrusted();
            return;
        }
        this.previousFormulaRow = row;
        this.previousFormulaCol = col;
    }
    getTrustedSheetIdForTrackedChanges(explicitChangedCount, changedLength) {
        if (!this.trusted || this.trustedSheetId === undefined || explicitChangedCount <= 0 || explicitChangedCount >= changedLength) {
            return undefined;
        }
        return this.trustedSheetId;
    }
}
//# sourceMappingURL=operation-direct-scalar-physical-slice-tracker.js.map