constructor(mount, input, config) {
    this.mount = mount;
    this.input = input;
    this.config = config;

    const useObserver = !config.disableMutationObserver && 'MutationObserver' in (globalThis.window || EMPTY.OBJ);

    this.state = StateCache.get(mount) || /** @type {TransactionState} */ ({
      measure: makeMeasure(this),
      svgElements: new Set(),
      scriptsToExecute: new Map(),
      mutationObserver: useObserver && new globalThis.window.MutationObserver(() => {
        this.state.isDirty = true;
      }),
    });

    this.tasks = /** @type {Function[]} */ (
      getConfig('tasks', defaultTasks, undefined, config)
    ).slice();

    // Store calls to trigger after the transaction has ended.
    this.endedCallbacks = new Set();

    StateCache.set(mount, this.state);
  }
@constructor
@param {Mount} mount
@param {ValidInput} input
@param {TransactionConfig} config