require("./Badge.css");
var $e991cbcdf82ced71$exports = require("./CenterBaseline.cjs");
var $bde97c91243ed164$exports = require("../icons/Icon.cjs");
var $5eb75e0c130e0669$exports = require("../icons/Skeleton.cjs");
var $6367bc87eb7d24ad$exports = require("./Content.cjs");
var $ac757a4c2bd72aee$exports = require("../icons/useSpectrumContextProps.cjs");
var $26Nq1$reactjsxruntime = require("react/jsx-runtime");
var $26Nq1$reactariacomponents = require("react-aria-components");
var $26Nq1$reactariautils = require("@react-aria/utils");
var $26Nq1$react = require("react");
var $26Nq1$reactspectrumutils = require("@react-spectrum/utils");


function $parcel$interopDefault(a) {
  return a && a.__esModule ? a.default : a;
}

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

$parcel$export(module.exports, "BadgeContext", () => $660a621e3a266afc$export$1d4627584e49159a);
$parcel$export(module.exports, "Badge", () => $660a621e3a266afc$export$37acb3580601e69a);
/*
 * 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 $660a621e3a266afc$export$1d4627584e49159a = /*#__PURE__*/ (0, $26Nq1$react.createContext)(null);
const $660a621e3a266afc$var$badge = function anonymous(props, overrides) {
    let rules = " ";
    let minWidth = 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] === "N") minWidth = true;
        rules += p[0];
    }
    if (props.size === "XL") {
        rules += ' uk12';
        rules += ' ucJ9TBTb12';
        rules += ' ud3Euai12';
        rules += ' uea12';
        rules += ' ugb12';
        rules += ' uhd12';
        rules += ' uje12';
        rules += ' u2NhKxcl12';
        rules += ' uic12';
    } else if (props.size === "L") {
        rules += ' uk12';
        rules += ' ucJ9TBTb12';
        rules += ' ud3Euai12';
        rules += ' uea12';
        rules += ' ugb12';
        rules += ' uhd12';
        rules += ' uje12';
        rules += ' u2NhKxcl12';
        rules += ' uic12';
    } else if (props.size === "S") {
        rules += ' uk12';
        rules += ' ucJ9TBTb12';
        rules += ' ud3Euai12';
        rules += ' uea12';
        rules += ' ugb12';
        rules += ' uhd12';
        rules += ' uje12';
        rules += ' u2NhKxcl12';
        rules += ' uic12';
    } else if (props.size === "XS") {
        rules += ' uk12';
        rules += ' ucJ9TBTb12';
        rules += ' ud3Euai12';
        rules += ' uea12';
        rules += ' ugb12';
        rules += ' uhd12';
        rules += ' uje12';
        rules += ' u2NhKxcl12';
        rules += ' uic12';
    } else {
        rules += ' uk12';
        rules += ' ucJ9TBTb12';
        rules += ' ud3Euai12';
        rules += ' uea12';
        rules += ' ugb12';
        rules += ' uhd12';
        rules += ' uje12';
        rules += ' u2NhKxcl12';
        rules += ' uic12';
    }
    if (props.size === "XL") {
        rules += ' -_6BNtrc-e12';
        rules += ' vx12';
    } else if (props.size === "L") {
        rules += ' -_6BNtrc-d12';
        rules += ' vx12';
    } else if (props.size === "S") {
        rules += ' -_6BNtrc-b12';
        rules += ' vx12';
    } else if (props.size === "XS") {
        rules += ' -_6BNtrc-a12';
        rules += ' vx12';
    } else {
        rules += ' -_6BNtrc-c12';
        rules += ' vx12';
    }
    if (props.size === "XL") {
        rules += ' xb12';
        rules += ' _xa12';
    } else if (props.size === "L") {
        rules += ' xb12';
        rules += ' _xa12';
    } else if (props.size === "S") {
        rules += ' xb12';
        rules += ' _xa12';
    } else if (props.size === "XS") {
        rules += ' xb12';
        rules += ' _xa12';
    } else {
        rules += ' xb12';
        rules += ' _xa12';
    }
    if (props.size === "XL") {
        rules += ' _Fd12';
        rules += ' _FnuYUweb12';
    } else if (props.size === "L") {
        rules += ' _Fd12';
        rules += ' _FnuYUweb12';
    } else if (props.size === "S") {
        rules += ' _Fd12';
        rules += ' _FnuYUweb12';
    } else if (props.size === "XS") {
        rules += ' _Fd12';
        rules += ' _FnuYUweb12';
    } else {
        rules += ' _Fd12';
        rules += ' _FnuYUweb12';
    }
    if (props.fillStyle === "outline") rules += ' pm12';
    else if (props.fillStyle === "subtle") rules += ' pm12';
    else if (props.fillStyle === "bold") {
        if (props.variant === "celery") rules += ' pg12';
        else if (props.variant === "chartreuse") rules += ' pg12';
        else if (props.variant === "yellow") rules += ' pg12';
        else if (props.variant === "orange") rules += ' pg12';
        else if (props.variant === "notice") rules += ' pg12';
        else rules += ' px12';
    }
    rules += ' sd12';
    rules += ' ea12';
    rules += ' egLWx3bb12';
    rules += ' _oa12';
    rules += ' Sv12';
    rules += ' SgLWx3bd12';
    rules += ' Rv12';
    rules += ' RgLWx3bd12';
    if (props.size === "XL") {
        if (!minWidth) rules += ' Nl12';
    } else if (props.size === "L") {
        if (!minWidth) rules += ' Nj12';
    } else if (props.size === "S") {
        if (!minWidth) rules += ' Nf12';
    } else if (props.size === "XS") {
        if (!minWidth) rules += ' Ne12';
    } else if (!minWidth) rules += ' Nk12';
    if (props.size === "XL") rules += ' -SFnbic-_JaP8ec12';
    else if (props.size === "L") rules += ' -SFnbic-_J0K2hn12';
    else if (props.size === "S") rules += ' -SFnbic-_JJOW22b12';
    else if (props.size === "XS") rules += ' -SFnbic-_JICefdd12';
    else rules += ' -SFnbic-_Jb12';
    rules += ' -Bu7z1c-ob12';
    rules += ' oj12';
    rules += ' nj12';
    rules += ' kj12';
    rules += ' jj12';
    rules += ' qc12';
    rules += ' qsd12';
    rules += ' -Qg41Lb-IAxCW0c12';
    rules += ' -Qg41Lb-gLWx3bIy12';
    rules += ' MAyFGYc12';
    rules += ' Td12';
    rules += ' Qd12';
    rules += ' -aRvJDd-Tu7Fubd12';
    rules += ' _Ca12';
    if (props.fillStyle === "outline") rules += ' g_g12';
    else if (props.fillStyle === "subtle") {
        if (props.variant === "silver") rules += ' g_f12';
        else if (props.variant === "cinnamon") rules += ' gP12';
        else if (props.variant === "brown") rules += ' gO12';
        else if (props.variant === "turquoise") rules += ' gy12';
        else if (props.variant === "pink") rules += ' gT12';
        else if (props.variant === "magenta") rules += ' gS12';
        else if (props.variant === "fuchsia") rules += ' gR12';
        else if (props.variant === "purple") rules += ' gM12';
        else if (props.variant === "indigo") rules += ' gK12';
        else if (props.variant === "blue") rules += ' gG12';
        else if (props.variant === "cyan") rules += ' gC12';
        else if (props.variant === "seafoam") rules += ' gz12';
        else if (props.variant === "green") rules += ' gA12';
        else if (props.variant === "celery") rules += ' gv12';
        else if (props.variant === "chartreuse") rules += ' gJ12';
        else if (props.variant === "yellow") rules += ' gW12';
        else if (props.variant === "orange") rules += ' gV12';
        else if (props.variant === "red") rules += ' gU12';
        else if (props.variant === "gray") rules += ' gI12';
        else if (props.variant === "negative") rules += ' gU12';
        else if (props.variant === "notice") rules += ' gV12';
        else if (props.variant === "positive") rules += ' gA12';
        else if (props.variant === "neutral") rules += ' gI12';
        else if (props.variant === "informative") rules += ' gG12';
        else if (props.variant === "accent") rules += ' gG12';
    } else if (props.fillStyle === "bold") {
        if (props.variant === "silver") rules += ' gm12';
        else if (props.variant === "cinnamon") rules += ' gq12';
        else if (props.variant === "brown") rules += ' gn12';
        else if (props.variant === "turquoise") rules += ' g512';
        else if (props.variant === "pink") rules += ' gx12';
        else if (props.variant === "magenta") rules += ' gD12';
        else if (props.variant === "fuchsia") rules += ' gr12';
        else if (props.variant === "purple") rules += ' go12';
        else if (props.variant === "indigo") rules += ' gl12';
        else if (props.variant === "blue") rules += ' g212';
        else if (props.variant === "cyan") rules += ' gk12';
        else if (props.variant === "seafoam") rules += ' g412';
        else if (props.variant === "green") rules += ' g112';
        else if (props.variant === "celery") rules += ' g712';
        else if (props.variant === "chartreuse") rules += ' gp12';
        else if (props.variant === "yellow") rules += ' gN12';
        else if (props.variant === "orange") rules += ' gQ12';
        else if (props.variant === "red") rules += ' gB12';
        else if (props.variant === "gray") rules += ' g612';
        else if (props.variant === "negative") rules += ' gB12';
        else if (props.variant === "notice") rules += ' gQ12';
        else if (props.variant === "positive") rules += ' g112';
        else if (props.variant === "neutral") rules += ' g612';
        else if (props.variant === "informative") rules += ' g212';
        else if (props.variant === "accent") rules += ' g212';
    }
    rules += ' _jf12';
    rules += ' _kJ8iPYd12';
    rules += ' hXMFGYc12';
    rules += ' mc12';
    rules += ' lc12';
    if (props.fillStyle === "outline") {
        if (props.variant === "negative") rules += ' iFLVMS12';
        else if (props.variant === "notice") rules += ' i9VrKkd12';
        else if (props.variant === "positive") rules += ' ip17Jm12';
        else if (props.variant === "neutral") rules += ' i0ruhAb12';
        else if (props.variant === "informative") rules += ' iG1ze4d12';
        else if (props.variant === "accent") rules += ' iG1ze4d12';
    } else rules += ' iA12';
    rules += ' -_8sjo0b-t5ZbAob12';
    if (props.size === "XL") rules += ' -M_-Mk12';
    else if (props.size === "L") rules += ' -M_-Mh12';
    else if (props.size === "S") rules += ' -M_-Mg12';
    else if (props.size === "XS") rules += ' -M_-Mf12';
    else rules += ' -M_-Mi12';
    rules += ' -_k_-_kc12';
    rules += ' -h_-hc12';
    return rules;
};
const $660a621e3a266afc$export$37acb3580601e69a = /*#__PURE__*/ (0, $26Nq1$react.forwardRef)(function Badge(props1, ref) {
    [props1, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props1, ref, $660a621e3a266afc$export$1d4627584e49159a);
    let { children: children, variant: variant = 'neutral', size: size = 'S', fillStyle: fillStyle = 'bold', overflowMode: overflowMode = 'wrap', ...otherProps } = props1; // useProviderProps(props) in v3
    let domRef = (0, $26Nq1$reactspectrumutils.useDOMRef)(ref);
    let isTextOnly = (0, ($parcel$interopDefault($26Nq1$react))).Children.toArray(props1.children).every((c)=>!/*#__PURE__*/ (0, ($parcel$interopDefault($26Nq1$react))).isValidElement(c));
    return /*#__PURE__*/ (0, $26Nq1$reactjsxruntime.jsx)((0, $26Nq1$reactariacomponents.Provider), {
        values: [
            [
                (0, $6367bc87eb7d24ad$exports.TextContext),
                {
                    styles: function anonymous(props) {
                        let rules = " ";
                        rules += ' TAzEcG12';
                        rules += ' QAzEcG12';
                        rules += ' _Jb12';
                        rules += ' _Nc12';
                        rules += ' Pc12';
                        rules += ' _Yb12';
                        if (props.overflowMode === "wrap") rules += ' _7b12';
                        else if (props.overflowMode === "truncate") rules += ' _7c12';
                        return rules;
                    }({
                        overflowMode: overflowMode
                    })
                }
            ],
            [
                (0, $26Nq1$reactariacomponents.TextContext),
                {}
            ],
            [
                (0, $bde97c91243ed164$exports.IconContext),
                {
                    render: (0, $e991cbcdf82ced71$exports.centerBaseline)({
                        slot: 'icon',
                        styles: " _Ja12"
                    }),
                    styles: " ZuUmpre12 FuUmpre12 I67logd12 _va12"
                }
            ]
        ],
        children: /*#__PURE__*/ (0, $26Nq1$reactjsxruntime.jsx)((0, $5eb75e0c130e0669$exports.SkeletonWrapper), {
            children: /*#__PURE__*/ (0, $26Nq1$reactjsxruntime.jsx)("span", {
                ...(0, $26Nq1$reactariautils.filterDOMProps)(otherProps),
                role: "presentation",
                className: (props1.UNSAFE_className || '') + $660a621e3a266afc$var$badge({
                    variant: variant,
                    size: size,
                    fillStyle: fillStyle
                }, props1.styles),
                style: props1.UNSAFE_style,
                ref: domRef,
                children: typeof children === 'string' || isTextOnly ? /*#__PURE__*/ (0, $26Nq1$reactjsxruntime.jsx)((0, $6367bc87eb7d24ad$exports.Text), {
                    children: children
                }) : children
            })
        })
    });
});


//# sourceMappingURL=Badge.cjs.map
