require("./DateField.css");
var $a0b996a550bb0891$exports = require("./Field.cjs");
var $ac757a4c2bd72aee$exports = require("../icons/useSpectrumContextProps.cjs");
var $fCG98$reactjsxruntime = require("react/jsx-runtime");
var $fCG98$reactariacomponents = require("react-aria-components");
var $fCG98$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, "DateFieldContext", () => $d19642654b699f84$export$7b3e670c86da5fe8);
$parcel$export(module.exports, "DateField", () => $d19642654b699f84$export$d9781c7894a82487);
$parcel$export(module.exports, "DateInputContainer", () => $d19642654b699f84$export$3f08d3c48fa697);
$parcel$export(module.exports, "DateInput", () => $d19642654b699f84$export$7edc06cf1783b30f);
$parcel$export(module.exports, "InvalidIndicator", () => $d19642654b699f84$export$19696856283ab185);
/*
 * 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 $d19642654b699f84$export$7b3e670c86da5fe8 = /*#__PURE__*/ (0, $fCG98$react.createContext)(null);
const $d19642654b699f84$var$segmentContainer = " _ub12 _vb12 Na12 Fb12 _Nc12 Pc12 sd12 eb12 __Wb12";
const $d19642654b699f84$var$dateSegment = function anonymous(props) {
    let rules = " ";
    rules += ' _Le12';
    rules += ' -zNggOc-RWHrbc12';
    if (props.isFocused) rules += ' g_h12';
    else rules += ' g912';
    if (props.isFocused) rules += ' gle12';
    else rules += ' gl912';
    if (props.isFocused) rules += ' px12';
    if (props.isFocused) rules += ' ple12';
    rules += ' oLvNfn12';
    rules += ' nLvNfn12';
    rules += ' kLvNfn12';
    rules += ' jLvNfn12';
    if (props.isPunctuation) rules += ' Sd12';
    else rules += ' Sj12';
    if (props.isPunctuation) rules += ' Rd12';
    else rules += ' Rj12';
    rules += ' Tj12';
    rules += ' Qj12';
    rules += ' _yb12';
    return rules;
};
const $d19642654b699f84$var$iconStyles = " sd12 eb12 _Cb12";
const $d19642654b699f84$export$d9781c7894a82487 = /*#__PURE__*/ (0, $fCG98$react.forwardRef)(function DateField(props1, ref) {
    [props1, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props1, ref, $d19642654b699f84$export$7b3e670c86da5fe8);
    let { label: label, contextualHelp: contextualHelp, description: descriptionMessage, errorMessage: errorMessage, isRequired: isRequired, size: size = 'M', labelPosition: labelPosition = 'top', necessityIndicator: necessityIndicator, labelAlign: labelAlign = 'start', UNSAFE_style: UNSAFE_style, UNSAFE_className: UNSAFE_className, styles: styles, ...dateFieldProps } = props1;
    let formContext = (0, $fCG98$react.useContext)((0, $fCG98$reactariacomponents.FormContext));
    return /*#__PURE__*/ (0, $fCG98$reactjsxruntime.jsx)((0, $fCG98$reactariacomponents.DateField), {
        ref: ref,
        isRequired: isRequired,
        ...dateFieldProps,
        style: UNSAFE_style,
        className: (UNSAFE_className || '') + function anonymous(props, overrides) {
            let rules = " ";
            let gridColumnStart = false;
            let gridColumnEnd = false;
            let matches = (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] === "z") gridColumnStart = true;
                if (p[1] === "y") gridColumnEnd = true;
                rules += p[0];
            }
            rules += ' se12';
            if (props.isInForm) {
                if (!gridColumnStart) rules += ' z2mU12';
            }
            if (props.isInForm) {
                if (props.labelPosition === "side") {
                    if (!gridColumnEnd) rules += ' yvoofG12';
                }
            }
            if (props.isInForm) rules += ' DLwlgod12';
            else {
                if (props.labelPosition === "side") rules += ' DPlN5qb12';
                else if (props.labelPosition === "top") rules += ' DM8Mfn12';
            }
            if (props.labelPosition === "side") rules += ' EPlN5qb12';
            else if (props.labelPosition === "top") rules += ' E4w1sLc12';
            if (props.labelPosition === "side") rules += ' CbRM95c12';
            else if (props.labelPosition === "top") rules += ' Cxaocre12';
            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';
            }
            rules += ' ea12';
            rules += ' _Fd12';
            rules += ' _FnuYUweb12';
            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 += ' -AJjOLd-UVkF0Db12';
            rules += ' qg12';
            rules += ' __ca12';
            return rules;
        }({
            isInForm: !!formContext,
            labelPosition: labelPosition,
            size: size
        }, styles),
        children: ({ isDisabled: isDisabled, isInvalid: isInvalid })=>{
            return /*#__PURE__*/ (0, $fCG98$reactjsxruntime.jsxs)((0, $fCG98$reactjsxruntime.Fragment), {
                children: [
                    /*#__PURE__*/ (0, $fCG98$reactjsxruntime.jsx)((0, $a0b996a550bb0891$exports.FieldLabel), {
                        isDisabled: isDisabled,
                        isRequired: isRequired,
                        size: size,
                        labelPosition: labelPosition,
                        labelAlign: labelAlign,
                        necessityIndicator: necessityIndicator,
                        contextualHelp: contextualHelp,
                        children: label
                    }),
                    /*#__PURE__*/ (0, $fCG98$reactjsxruntime.jsxs)((0, $a0b996a550bb0891$exports.FieldGroup), {
                        role: "presentation",
                        isDisabled: isDisabled,
                        isInvalid: isInvalid,
                        size: size,
                        styles: function anonymous(props) {
                            let rules = " ";
                            rules += ' zXcEWr12';
                            rules += ' yXcEWr12';
                            rules += ' BXcEWr12';
                            rules += ' AXcEWr12';
                            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 += ' SMBFGYc12';
                            rules += ' RfBFGYc12';
                            rules += ' -S_-Sv12';
                            rules += ' -R_-Rv12';
                            return rules;
                        }({
                            size: size
                        }),
                        children: [
                            /*#__PURE__*/ (0, $fCG98$reactjsxruntime.jsx)($d19642654b699f84$export$3f08d3c48fa697, {
                                children: /*#__PURE__*/ (0, $fCG98$reactjsxruntime.jsx)($d19642654b699f84$export$7edc06cf1783b30f, {})
                            }),
                            /*#__PURE__*/ (0, $fCG98$reactjsxruntime.jsx)($d19642654b699f84$export$19696856283ab185, {
                                isInvalid: isInvalid,
                                isDisabled: isDisabled
                            })
                        ]
                    }),
                    /*#__PURE__*/ (0, $fCG98$reactjsxruntime.jsx)((0, $a0b996a550bb0891$exports.HelpText), {
                        size: size,
                        isDisabled: isDisabled,
                        isInvalid: isInvalid,
                        description: descriptionMessage,
                        children: errorMessage
                    })
                ]
            });
        }
    });
});
function $d19642654b699f84$export$3f08d3c48fa697(props) {
    return /*#__PURE__*/ (0, $fCG98$reactjsxruntime.jsx)("div", {
        className: $d19642654b699f84$var$segmentContainer,
        children: props.children
    });
}
function $d19642654b699f84$export$7edc06cf1783b30f(props) {
    return /*#__PURE__*/ (0, $fCG98$reactjsxruntime.jsx)((0, $fCG98$reactariacomponents.DateInput), {
        ...props,
        children: (segment)=>/*#__PURE__*/ (0, $fCG98$reactjsxruntime.jsx)((0, $fCG98$reactariacomponents.DateSegment), {
                segment: segment,
                className: (renderProps)=>$d19642654b699f84$var$dateSegment({
                        ...renderProps,
                        isPunctuation: segment.type === 'literal'
                    })
            })
    });
}
function $d19642654b699f84$export$19696856283ab185(props) {
    return props.isInvalid ? /*#__PURE__*/ (0, $fCG98$reactjsxruntime.jsx)("div", {
        className: $d19642654b699f84$var$iconStyles,
        children: /*#__PURE__*/ (0, $fCG98$reactjsxruntime.jsx)((0, $a0b996a550bb0891$exports.FieldErrorIcon), {
            isDisabled: props.isDisabled
        })
    }) : null;
}


//# sourceMappingURL=DateField.cjs.map
