import { Fragment, jsx, jsxs } from "react/jsx-runtime";
import { useRef } from "react";
import { css } from "@emotion/css";
import { useScrollAssistantStatus } from "./ScrollAssistantStatus.provider.mjs";
import { useJoystick } from "./useJoystick.mjs";
function _tagged_template_literal(strings, raw) {
    if (!raw) raw = strings.slice(0);
    return Object.freeze(Object.defineProperties(strings, {
        raw: {
            value: Object.freeze(raw)
        }
    }));
}
function _templateObject() {
    const data = _tagged_template_literal([
        "\n            position: absolute;\n            top: 0;\n            left: 500px;\n            right: 500px;\n            height: var(--tb-header-height);\n            z-index: 99999;\n            background-color: rgba(226, 252, 173, 0.274);\n          "
    ]);
    _templateObject = function() {
        return data;
    };
    return data;
}
const ScrollAssistantProvider = (param)=>{
    let { children } = param;
    const { enable, setEnable } = useScrollAssistantStatus();
    const ref = useRef();
    useJoystick(ref, {
        onContextmenu () {
            setEnable(false);
        }
    });
    return /*#__PURE__*/ jsxs(Fragment, {
        children: [
            children,
            enable && /*#__PURE__*/ jsx("div", {
                ref: ref,
                className: css(_templateObject())
            })
        ]
    });
};
export { ScrollAssistantProvider };
