/**
 * Filter UMD entry — seekora-react-sdk.filter.umd.js
 *
 * Exposes Facets, HierarchicalMenu, RangeSlider, MobileFilters (full).
 * At module load time, registers all filter components into the shared
 * window.SeekoraReact primitive registry so LayoutRenderer can resolve them.
 *
 * Load order: core UMD must be on window before this file executes.
 *
 * SCRUM-268
 */
import React from "react";
import { createRoot } from "react-dom/client";
import { Facets } from "./components/Facets";
import { HierarchicalMenu } from "./components/HierarchicalMenu";
import { RangeSlider } from "./components/RangeSlider";
import { RangeInput } from "./components/RangeInput";
import { MobileFilters, MobileFiltersButton } from "./components/MobileFilters";
import { FacetDropdown } from "./components/FacetDropdown";
export { Facets, HierarchicalMenu, RangeSlider, RangeInput, MobileFilters, MobileFiltersButton, FacetDropdown, };
// ---------------------------------------------------------------------------
// Mount helpers
// ---------------------------------------------------------------------------
export function mountFacets(el, props) {
    const root = createRoot(el);
    root.render(React.createElement(Facets, props));
    return { unmount: () => root.unmount() };
}
export function mountHierarchicalMenu(el, props) {
    const root = createRoot(el);
    root.render(React.createElement(HierarchicalMenu, props));
    return { unmount: () => root.unmount() };
}
export function mountRangeSlider(el, props) {
    const root = createRoot(el);
    root.render(React.createElement(RangeSlider, props));
    return { unmount: () => root.unmount() };
}
export function mountRangeInput(el, props) {
    const root = createRoot(el);
    root.render(React.createElement(RangeInput, props));
    return { unmount: () => root.unmount() };
}
export function mountMobileFilters(el, props) {
    const root = createRoot(el);
    root.render(React.createElement(MobileFilters, props));
    return { unmount: () => root.unmount() };
}
export function mountFacetDropdown(el, props) {
    const root = createRoot(el);
    root.render(React.createElement(FacetDropdown, props));
    return { unmount: () => root.unmount() };
}
// ---------------------------------------------------------------------------
// Self-registration into core primitive registry at module load time.
// window.SeekoraReact.registerPrimitive must exist (loaded from core UMD).
// ---------------------------------------------------------------------------
(function registerFilterPrimitives() {
    if (typeof window !== "undefined" &&
        window.SeekoraReact &&
        typeof window.SeekoraReact.registerPrimitive === "function") {
        const reg = window.SeekoraReact.registerPrimitive;
        reg("Facets", Facets);
        reg("HierarchicalMenu", HierarchicalMenu);
        reg("RangeSlider", RangeSlider);
        reg("RangeInput", RangeInput);
        reg("MobileFilters", MobileFilters);
        reg("MobileFiltersButton", MobileFiltersButton);
        reg("FacetDropdown", FacetDropdown);
    }
})();
