require("./Radio.css");
var $e991cbcdf82ced71$exports = require("./CenterBaseline.cjs");
var $bfa4962d90c8af48$exports = require("./Form.cjs");
var $2061c83559b50a66$exports = require("./pressScale.cjs");
var $fd22C$reactjsxruntime = require("react/jsx-runtime");
var $fd22C$reactariacomponents = require("react-aria-components");
var $fd22C$react = require("react");
var $fd22C$reactspectrumutils = require("@react-spectrum/utils");


function $parcel$export(e, n, v, s) {
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}

$parcel$export(module.exports, "Radio", () => $49f41f366ec3019f$export$d7b12c4107be0d61);
/*
 * Copyright 2024 Adobe. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */ 






const $49f41f366ec3019f$var$wrapper = function anonymous(props, overrides) {
    let rules = " ";
    let position = false;
    let gridColumnStart = false;
    let matches = String(overrides || '').matchAll(/(?:^|\s)(J|G|I|H|_u|_v|_s|__A|_d|_J|z|y|B|A|_P|_9|W|_l|_A|_z|_6|Z|N|L)[^\s]+/g);
    for (let p of matches){
        if (p[1] === "_P") position = true;
        if (p[1] === "z") gridColumnStart = true;
        rules += p[0];
    }
    rules += ' sd11';
    if (!position) rules += ' _Pc11';
    rules += ' qf11';
    rules += ' ea11';
    if (props.size === "XL") {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    } else if (props.size === "L") {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    } else if (props.size === "S") {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    } else if (props.size === "XS") {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    } else {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    }
    if (props.size === "XL") {
        rules += ' -_6BNtrc-e11';
        rules += ' vx11';
    } else if (props.size === "L") {
        rules += ' -_6BNtrc-d11';
        rules += ' vx11';
    } else if (props.size === "S") {
        rules += ' -_6BNtrc-b11';
        rules += ' vx11';
    } else if (props.size === "XS") {
        rules += ' -_6BNtrc-a11';
        rules += ' vx11';
    } else {
        rules += ' -_6BNtrc-c11';
        rules += ' vx11';
    }
    if (props.size === "XL") {
        rules += ' xb11';
        rules += ' _xa11';
    } else if (props.size === "L") {
        rules += ' xb11';
        rules += ' _xa11';
    } else if (props.size === "S") {
        rules += ' xb11';
        rules += ' _xa11';
    } else if (props.size === "XS") {
        rules += ' xb11';
        rules += ' _xa11';
    } else {
        rules += ' xb11';
        rules += ' _xa11';
    }
    if (props.size === "XL") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else if (props.size === "L") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else if (props.size === "S") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else if (props.size === "XS") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    }
    if (props.isDisabled) {
        rules += ' pp11';
        rules += ' plc11';
    } else {
        if (props.isPressed) rules += ' po11';
        else if (props.isFocusVisible) rules += ' po11';
        else if (props.isHovered) rules += ' po11';
        else rules += ' pt11';
    }
    rules += ' Yc11';
    rules += ' Xb11';
    rules += ' _2b11';
    if (props.isInForm) {
        if (!gridColumnStart) rules += ' zhJUGr11';
    }
    rules += ' __ca11';
    return rules;
};
const $49f41f366ec3019f$var$circle = function anonymous(props) {
    let rules = " ";
    if (props.isFocusVisible) rules += ' _Lf11';
    else rules += ' _Le11';
    rules += ' Oh11';
    rules += ' Olc11';
    rules += ' _Mc11';
    rules += ' _Kd11';
    if (props.size === "XL") rules += ' Zm11';
    else if (props.size === "L") rules += ' Zl11';
    else if (props.size === "S") rules += ' Zk11';
    else rules += ' Zu11';
    rules += ' FRuFGYc11';
    rules += ' _va11';
    rules += ' sd11';
    rules += ' eb11';
    rules += ' _Ca11';
    rules += ' Yd11';
    rules += ' Xb11';
    rules += ' _2b11';
    rules += ' og11';
    rules += ' ng11';
    rules += ' kg11';
    rules += ' jg11';
    rules += ' _jf11';
    rules += ' _oa11';
    if (props.isSelected) rules += ' _kUXU7p11';
    else rules += ' _k7m7Gv11';
    if (props.isSelected) rules += ' hUXU7p11';
    else rules += ' h7m7Gv11';
    if (props.isSelected) rules += ' mUXU7p11';
    else rules += ' m7m7Gv11';
    if (props.isSelected) rules += ' lUXU7p11';
    else rules += ' l7m7Gv11';
    rules += ' _yb11';
    rules += ' gX11';
    if (props.isDisabled) {
        rules += ' io11';
        rules += ' ilc11';
    } else if (props.isInvalid) {
        if (props.isPressed) rules += ' im11';
        else if (props.isFocusVisible) rules += ' im11';
        else if (props.isHovered) rules += ' im11';
        else rules += ' ip11';
        rules += ' ile11';
    } else if (props.isSelected) {
        if (props.isEmphasized) {
            if (props.isPressed) rules += ' iu11';
            else if (props.isFocusVisible) rules += ' iu11';
            else if (props.isHovered) rules += ' iu11';
            else rules += ' iw11';
        }
        rules += ' ild11';
    } else {
        if (props.isPressed) rules += ' in11';
        else if (props.isFocusVisible) rules += ' in11';
        else if (props.isHovered) rules += ' in11';
        else rules += ' iv11';
        rules += ' ila11';
    }
    if (props.size === "XL") rules += ' -F_-Fn11';
    else if (props.size === "L") rules += ' -F_-Fm11';
    else if (props.size === "S") rules += ' -F_-Fl11';
    else rules += ' -F_-Ft11';
    return rules;
};
const $49f41f366ec3019f$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $fd22C$react.forwardRef)(function Radio(props, ref) {
    let { children: children, UNSAFE_className: UNSAFE_className = '', UNSAFE_style: UNSAFE_style } = props;
    let circleRef = (0, $fd22C$react.useRef)(null);
    let inputRef = (0, $fd22C$react.useRef)(null);
    let domRef = (0, $fd22C$reactspectrumutils.useFocusableRef)(ref, inputRef);
    let isInForm = !!(0, $fd22C$react.useContext)((0, $bfa4962d90c8af48$exports.FormContext));
    let { size: size = 'M', ...allProps } = (0, $bfa4962d90c8af48$exports.useFormProps)(props);
    return /*#__PURE__*/ (0, $fd22C$reactjsxruntime.jsx)((0, $fd22C$reactariacomponents.Radio), {
        ...allProps,
        ref: domRef,
        inputRef: inputRef,
        style: UNSAFE_style,
        className: (renderProps)=>UNSAFE_className + $49f41f366ec3019f$var$wrapper({
                ...renderProps,
                isInForm: isInForm,
                size: size
            }, allProps.styles),
        children: (renderProps)=>/*#__PURE__*/ (0, $fd22C$reactjsxruntime.jsxs)((0, $fd22C$reactjsxruntime.Fragment), {
                children: [
                    /*#__PURE__*/ (0, $fd22C$reactjsxruntime.jsx)((0, $e991cbcdf82ced71$exports.CenterBaseline), {
                        children: /*#__PURE__*/ (0, $fd22C$reactjsxruntime.jsx)("div", {
                            ref: circleRef,
                            style: (0, $2061c83559b50a66$exports.pressScale)(circleRef)(renderProps),
                            className: $49f41f366ec3019f$var$circle({
                                ...renderProps,
                                isEmphasized: allProps.isEmphasized,
                                isSelected: renderProps.isSelected,
                                size: size
                            })
                        })
                    }),
                    children
                ]
            })
    });
});


//# sourceMappingURL=Radio.cjs.map
