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 = " _ub11 _vb11 Na11 Fb11 _Na11 Pc11 -dLGswc-h3TDrc11 sd11 eb11 __Wb11";
const $d19642654b699f84$var$dateSegment = function anonymous(props) {
    let rules = " ";
    rules += ' _Le11';
    rules += ' -zNggOc-RWHrbc11';
    if (props.isFocused) rules += ' g_h11';
    else rules += ' g911';
    if (props.isFocused) rules += ' gle11';
    else rules += ' gl911';
    if (props.isFocused) rules += ' px11';
    if (props.isFocused) rules += ' ple11';
    rules += ' oLvNfn11';
    rules += ' nLvNfn11';
    rules += ' kLvNfn11';
    rules += ' jLvNfn11';
    if (props.isPunctuation) rules += ' Sd11';
    else rules += ' Sj11';
    if (props.isPunctuation) rules += ' Rd11';
    else rules += ' Rj11';
    rules += ' Tj11';
    rules += ' Qj11';
    rules += ' _yb11';
    return rules;
};
const $d19642654b699f84$var$iconStyles = " sd11 eb11 _Cb11";
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 = 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] === "z") gridColumnStart = true;
                if (p[1] === "y") gridColumnEnd = true;
                rules += p[0];
            }
            rules += ' se11';
            if (props.isInForm) {
                if (!gridColumnStart) rules += ' z2mU11';
            }
            if (props.isInForm) {
                if (props.labelPosition === "side") {
                    if (!gridColumnEnd) rules += ' yvoofG11';
                }
            }
            if (props.isInForm) rules += ' DLwlgod11';
            else {
                if (props.labelPosition === "side") rules += ' DPlN5qb11';
                else if (props.labelPosition === "top") rules += ' DM8Mfn11';
            }
            if (props.labelPosition === "side") rules += ' EPlN5qb11';
            else if (props.labelPosition === "top") rules += ' E4w1sLc11';
            if (props.labelPosition === "side") rules += ' CbRM95c11';
            else if (props.labelPosition === "top") rules += ' Cxaocre11';
            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';
            }
            rules += ' ea11';
            rules += ' _Fd11';
            rules += ' _FnuYUweb11';
            if (props.size === "XL") rules += ' -BhX7R-Fz11';
            else if (props.size === "L") rules += ' -BhX7R-Fv11';
            else if (props.size === "S") rules += ' -BhX7R-Fp11';
            else if (props.size === "XS") rules += ' -BhX7R-Fn11';
            else rules += ' -BhX7R-Fx11';
            rules += ' -AJjOLd-UVkF0Db11';
            rules += ' qg11';
            rules += ' __ca11';
            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 += ' zXcEWr11';
                            rules += ' yXcEWr11';
                            rules += ' BXcEWr11';
                            rules += ' AXcEWr11';
                            if (props.size === "XL") rules += ' Nl11';
                            else if (props.size === "L") rules += ' Nj11';
                            else if (props.size === "S") rules += ' Nf11';
                            else if (props.size === "XS") rules += ' Ne11';
                            else rules += ' Nk11';
                            if (props.isQuiet) rules += ' _qd11';
                            else rules += ' _qtb11';
                            if (props.size === "XL") rules += ' -Anxdcc-Zt11';
                            else if (props.size === "L") rules += ' -Anxdcc-ZStdtne11';
                            else if (props.size === "S") rules += ' -Anxdcc-Zr11';
                            else rules += ' -Anxdcc-Z3fn9H11';
                            rules += ' __v6TNLWb11';
                            rules += ' __Wb11';
                            rules += ' SMBFGYc11';
                            rules += ' RfBFGYc11';
                            rules += ' -S_-Sv11';
                            rules += ' -R_-Rv11';
                            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), {
        className: "",
        ...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
