"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "Switch", {
    enumerable: true,
    get: function() {
        return Switch;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
const _reactswitch = /*#__PURE__*/ _interop_require_wildcard(require("@radix-ui/react-switch"));
const _css = require("../utils/css");
const _classvarianceauthority = require("class-variance-authority");
function _getRequireWildcardCache(nodeInterop) {
    if (typeof WeakMap !== "function") return null;
    var cacheBabelInterop = new WeakMap();
    var cacheNodeInterop = new WeakMap();
    return (_getRequireWildcardCache = function(nodeInterop) {
        return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
    })(nodeInterop);
}
function _interop_require_wildcard(obj, nodeInterop) {
    if (!nodeInterop && obj && obj.__esModule) {
        return obj;
    }
    if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
        return {
            default: obj
        };
    }
    var cache = _getRequireWildcardCache(nodeInterop);
    if (cache && cache.has(obj)) {
        return cache.get(obj);
    }
    var newObj = {
        __proto__: null
    };
    var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
    for(var key in obj){
        if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
            var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
            if (desc && (desc.get || desc.set)) {
                Object.defineProperty(newObj, key, desc);
            } else {
                newObj[key] = obj[key];
            }
        }
    }
    newObj.default = obj;
    if (cache) {
        cache.set(obj, newObj);
    }
    return newObj;
}
const switchVariants = (0, _classvarianceauthority.cva)("", {
    variants: {
        color: {
            primary: "data-[state=checked]:orderly-bg-primary data-[state=unchecked]:orderly-bg-base-100",
            profit: "data-[state=checked]:orderly-bg-trade-profit data-[state=unchecked]:orderly-bg-base-100",
            loss: "data-[state=checked]:orderly-bg-trade-loss data-[state=unchecked]:orderly-bg-base-100"
        }
    },
    defaultVariants: {
        color: "primary"
    }
});
const Switch = /*#__PURE__*/ _react.forwardRef(({ className, color, thumbClassName, ...props }, ref)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_reactswitch.Root, {
        className: (0, _css.cn)("orderly-peer orderly-inline-flex orderly-h-[14px] desktop:orderly-h-[20px] orderly-w-[32px] desktop:orderly-w-[40px] orderly-shrink-0 orderly-cursor-pointer orderly-items-center orderly-rounded-full orderly-border-2 desktop:orderly-border-4 orderly-border-transparent orderly-transition-colors focus-visible:orderly-outline-none focus-visible:orderly-ring-2 focus-visible:orderly-ring-ring focus-visible:orderly-ring-offset-2 focus-visible:orderly-ring-offset-base-700 disabled:orderly-cursor-not-allowed disabled:orderly-opacity-50", `orderly-switch orderly-switch-color-${color}`, switchVariants({
            color,
            className
        })),
        ...props,
        ref: ref,
        children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactswitch.Thumb, {
            className: (0, _css.cn)("orderly-pointer-events-none orderly-block orderly-h-[10px] orderly-w-[10px] orderly-rounded-full orderly-bg-white orderly-shadow-lg orderly-ring-0 orderly-transition-transform data-[state=checked]:orderly-translate-x-[18px] data-[state=checked]:desktop:orderly-translate-x-[20px] data-[state=unchecked]:orderly-translate-x-[1] desktop:orderly-h-[13.3px] desktop:orderly-w-[13.3px]", thumbClassName)
        })
    }));
Switch.displayName = _reactswitch.Root.displayName;

//# sourceMappingURL=switch.js.map