require("./Meter.css");
var $a0b996a550bb0891$exports = require("./Field.cjs");
var $5eb75e0c130e0669$exports = require("../../icons/Skeleton.cjs");
var $6367bc87eb7d24ad$exports = require("./Content.cjs");
var $150382364eecc4bc$exports = require("./useDOMRef.cjs");
var $ac757a4c2bd72aee$exports = require("../../icons/useSpectrumContextProps.cjs");
var $aQdtU$reactjsxruntime = require("react/jsx-runtime");
var $aQdtU$reactariacomponentsMeter = require("react-aria-components/Meter");
var $aQdtU$react = require("react");


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

$parcel$export(module.exports, "MeterContext", () => $f53cdf036c04454a$export$8b645da15a96b44f);
$parcel$export(module.exports, "Meter", () => $f53cdf036c04454a$export$62e3ae2a4090b879);
/*
 * 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 $f53cdf036c04454a$export$8b645da15a96b44f = /*#__PURE__*/ (0, $aQdtU$react.createContext)(null);
const $f53cdf036c04454a$var$wrapper = function anonymous(props, overrides) {
    let rules = " ";
    let position = false;
    let minWidth = false;
    let maxWidth = 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] === "N") minWidth = true;
        if (p[1] === "L") maxWidth = true;
        rules += p[0];
    }
    if (props.staticColor === "white") rules += ' -Ovbhqd-gcwrnr12';
    else if (props.staticColor === "black") rules += ' -Ovbhqd-g4hn3s12';
    if (!position) rules += ' _Pc12';
    rules += ' se12';
    if (props.labelPosition === "side") rules += ' DPlN5qb12';
    else if (props.labelPosition === "top") rules += ' Dxumf9b12';
    if (props.labelPosition === "side") rules += ' Cvv4gue12';
    else if (props.labelPosition === "top") rules += ' CC0Gyo12';
    rules += ' ea12';
    rules += ' _Bb12';
    if (!minWidth) rules += ' Nl12';
    if (!maxWidth) rules += ' Lk12';
    if (props.size === "XL") rules += ' -BhX7R-Fz12';
    else if (props.size === "L") rules += ' -BhX7R-Fv12';
    else if (props.size === "S") rules += ' -BhX7R-Fp12';
    else if (props.size === "XS") rules += ' -BhX7R-Fn12';
    else rules += ' -BhX7R-Fx12';
    rules += ' -dTMmze-Fe12';
    rules += ' -AJjOLd-UCwrhQe12';
    rules += ' qg12';
    return rules;
};
const $f53cdf036c04454a$var$valueStyles = function anonymous(props) {
    let rules = " ";
    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.isStaticColor) rules += ' pl12';
    else if (props.isDisabled) rules += ' pp12';
    else rules += ' pv12';
    rules += ' plb12';
    rules += ' ri12';
    rules += ' z8bmXs12';
    rules += ' y8bmXs12';
    rules += ' B8bmXs12';
    rules += ' A8bmXs12';
    return rules;
};
const $f53cdf036c04454a$var$trackStyles = function anonymous(props) {
    let rules = " ";
    rules += ' zMY0fn12';
    rules += ' yMY0fn12';
    rules += ' BMY0fn12';
    rules += ' AMY0fn12';
    if (props.size === "XL") rules += ' Nl12';
    else if (props.size === "L") rules += ' Nj12';
    else if (props.size === "S") rules += ' Nf12';
    else if (props.size === "XS") rules += ' Ne12';
    else rules += ' Nk12';
    if (props.isQuiet) rules += ' _qd12';
    else rules += ' _qtb12';
    if (props.size === "XL") rules += ' -Anxdcc-Zt12';
    else if (props.size === "L") rules += ' -Anxdcc-ZStdtne12';
    else if (props.size === "S") rules += ' -Anxdcc-Zr12';
    else rules += ' -Anxdcc-Z3fn9H12';
    rules += ' __v6TNLWb12';
    rules += ' _Nc12';
    rules += ' Pc12';
    rules += ' og12';
    rules += ' ng12';
    rules += ' kg12';
    rules += ' jg12';
    if (props.isStaticColor) rules += ' gh12';
    else rules += ' gE12';
    rules += ' glb12';
    rules += ' _Ma12';
    rules += ' _Mlb12';
    rules += ' _Le12';
    rules += ' _Llf12';
    rules += ' Oj12';
    rules += ' Olb12';
    rules += ' _9c12';
    if (props.size === "XL") rules += ' Fj12';
    else if (props.size === "L") rules += ' Fi12';
    else if (props.size === "M") rules += ' Fg12';
    else if (props.size === "S") rules += ' Fe12';
    else rules += ' Fg12';
    return rules;
};
const $f53cdf036c04454a$var$fillStyles = function anonymous(props) {
    let rules = " ";
    rules += ' Fb12';
    rules += ' _je12';
    rules += ' og12';
    rules += ' ng12';
    rules += ' kg12';
    rules += ' jg12';
    if (props.isStaticColor) rules += ' gj12';
    else if (props.variant === "negative") rules += ' gFLVMS12';
    else if (props.variant === "notice") rules += ' g9VrKkd12';
    else if (props.variant === "positive") rules += ' gp17Jm12';
    else rules += ' gG1ze4d12';
    rules += ' glc12';
    return rules;
};
const $f53cdf036c04454a$export$62e3ae2a4090b879 = /*#__PURE__*/ (0, $aQdtU$react.forwardRef)(function Meter(props, ref) {
    [props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $f53cdf036c04454a$export$8b645da15a96b44f);
    let domRef = (0, $150382364eecc4bc$exports.useDOMRef)(ref);
    let { label: label, size: size = 'M', staticColor: staticColor, styles: styles, UNSAFE_className: UNSAFE_className = '', UNSAFE_style: UNSAFE_style, variant: variant = 'informative', labelPosition: labelPosition = 'top', ...groupProps } = props;
    let isStaticColor = !!staticColor;
    return /*#__PURE__*/ (0, $aQdtU$reactjsxruntime.jsx)((0, $aQdtU$reactariacomponentsMeter.Meter), {
        ...groupProps,
        ref: domRef,
        style: UNSAFE_style,
        className: UNSAFE_className + $f53cdf036c04454a$var$wrapper({
            size: size,
            variant: variant,
            staticColor: staticColor,
            labelPosition: labelPosition
        }, styles),
        children: ({ percentage: percentage, valueText: valueText })=>/*#__PURE__*/ (0, $aQdtU$reactjsxruntime.jsxs)((0, $aQdtU$reactjsxruntime.Fragment), {
                children: [
                    label && /*#__PURE__*/ (0, $aQdtU$reactjsxruntime.jsx)((0, $a0b996a550bb0891$exports.FieldLabel), {
                        size: size,
                        labelAlign: "start",
                        labelPosition: labelPosition,
                        staticColor: staticColor,
                        children: label
                    }),
                    label && /*#__PURE__*/ (0, $aQdtU$reactjsxruntime.jsx)((0, $6367bc87eb7d24ad$exports.Text), {
                        styles: $f53cdf036c04454a$var$valueStyles({
                            size: size,
                            labelAlign: 'end',
                            isStaticColor: isStaticColor
                        }),
                        children: valueText
                    }),
                    /*#__PURE__*/ (0, $aQdtU$reactjsxruntime.jsx)((0, $5eb75e0c130e0669$exports.SkeletonWrapper), {
                        children: /*#__PURE__*/ (0, $aQdtU$reactjsxruntime.jsx)("div", {
                            className: $f53cdf036c04454a$var$trackStyles({
                                isStaticColor: isStaticColor,
                                size: size
                            }),
                            children: /*#__PURE__*/ (0, $aQdtU$reactjsxruntime.jsx)("div", {
                                className: $f53cdf036c04454a$var$fillStyles({
                                    isStaticColor: isStaticColor,
                                    variant: variant
                                }),
                                style: {
                                    width: percentage + '%'
                                }
                            })
                        })
                    })
                ]
            })
    });
});


//# sourceMappingURL=Meter.cjs.map
