/**
 * StrandSelector — observe one writer's isolated worldline.
 *
 * @module domain/types/StrandSelector
 */
import QueryError from "../errors/QueryError.js";
import WorldlineSelector, { validateCeiling } from "./WorldlineSelector.js";
/**
 * Worldline selector pinned to a single strand's visible patch universe.
 *
 * Used for branch-and-compare workflows where you want one writer's
 * isolated perspective.
 */
class StrandSelector extends WorldlineSelector {
    /** The strand identifier. */
    strandId;
    /** Lamport ceiling for time-travel. */
    ceiling;
    /**
     * Creates a StrandSelector.
     */
    constructor(strandId, ceiling) {
        super();
        if (typeof strandId !== 'string' || strandId.length === 0) {
            throw new QueryError('strandId must be a non-empty string', { code: 'E_SELECTOR_INVALID' });
        }
        this.strandId = strandId;
        this.ceiling = validateCeiling(ceiling);
        Object.freeze(this);
    }
    /**
     * Deep-clone this selector.
     */
    clone() {
        return new StrandSelector(this.strandId, this.ceiling);
    }
    /**
     * Convert to a plain DTO for the public API.
     */
    toDTO() {
        return { kind: 'strand', strandId: this.strandId, ceiling: this.ceiling };
    }
}
WorldlineSelector._register('strand', StrandSelector);
export default StrandSelector;
