export default (shower) => {
    const { stepSelector, activeSlideClass, visitedSlideClass } = shower.options;

    let innerSteps;
    let innerAt;

    const getInnerSteps = () => {
        const { element } = shower.activeSlide;
        return [...element.querySelectorAll(stepSelector)];
    };

    const getInnerAt = () => {
        return innerSteps.filter(
            (step) =>
                step.classList.contains(activeSlideClass) ||
                step.classList.contains(visitedSlideClass),
        ).length;
    };

    const setInnerStepsState = () => {
        if (shower.isListMode) return;

        innerSteps = getInnerSteps();
        innerAt = getInnerAt();

        const slide = shower.activeSlide;
        slide.state.innerStepCount = innerSteps.length;
    };

    shower.addEventListener('start', setInnerStepsState);
    shower.addEventListener('modechange', setInnerStepsState);
    shower.addEventListener('slidechange', setInnerStepsState);

    shower.addEventListener('next', (event) => {
        if (shower.isListMode || event.defaultPrevented || !event.cancelable) return;

        innerAt++;
        innerSteps.forEach((step, index) => {
            step.classList.toggle(visitedSlideClass, index < innerAt - 1);
            step.classList.toggle(activeSlideClass, index === innerAt - 1);
        });

        if (innerAt <= innerSteps.length) {
            event.preventDefault();
        }
    });

    shower.addEventListener('prev', (event) => {
        if (shower.isListMode || event.defaultPrevented || !event.cancelable || !innerAt) return;

        if (innerAt === innerSteps.length) {
            const lastStep = innerSteps[innerAt - 1];
            lastStep.classList.replace(activeSlideClass, visitedSlideClass);
            return;
        }

        innerAt--;
        innerSteps.forEach((step, index) => {
            step.classList.toggle(visitedSlideClass, index < innerAt);
            step.classList.toggle(activeSlideClass, index === innerAt - 1);
        });

        event.preventDefault();
    });
};

@@ -108,622 +108,439 @@
 ns;%0A
-%0A    let innerSteps;%0A    let innerAt;%0A%0A    const getInnerSteps = () =%3E %7B%0A        const %7B element %7D = shower.activeSlide;%0A        return %5B...element.querySelectorAll(stepSelector)%5D;%0A    %7D;%0A%0A    const getInnerAt = () =%3E %7B%0A        return innerSteps.filter(%0A            (step) =%3E%0A                step.classList.contains(activeSlideClass) %7C%7C%0A                step.classList.contains(visitedSlideClass),%0A        ).length;%0A    %7D;%0A%0A    const setInnerStepsState = () =%3E %7B%0A        if (shower.isListMode) return;%0A%0A        innerSteps = getInnerSteps();%0A        innerAt = getInnerAt();%0A%0A        const slide = shower.activeSlide;
+    const activeOrVisitedStepSelector = %60$%7BstepSelector%7D.$%7BactiveSlideClass%7D, $%7BstepSelector%7D.$%7BvisitedSlideClass%7D%60;%0A%0A    let innerSteps;%0A    let innerAt;%0A%0A    const setInnerStepsState = () =%3E %7B%0A        if (shower.isListMode) return;%0A%0A        const slide = shower.activeSlide;%0A%0A        innerAt = slide.element.querySelectorAll(activeOrVisitedStepSelector).length;%0A        innerSteps = slide.element.querySelectorAll(stepSelector);%0A
 %0A   

Drop `getInnerSteps` and `getInnerAt` helpers