"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.E2EInputTest = exports.filledIconProps = exports.outlineIconProps = void 0;
const React = __importStar(require("react"));
const e2e_testing_1 = require("@fluentui-react-native/e2e-testing");
const input_1 = require("@fluentui-react-native/input");
const stack_1 = require("@fluentui-react-native/stack");
const text_1 = require("@fluentui-react-native/text");
const filledIcon_svg_1 = __importDefault(require("../../../assets/filledIcon.svg"));
const outlineIcon_svg_1 = __importDefault(require("../../../assets/outlineIcon.svg"));
const styles_1 = require("../Common/styles");
const TestProps_1 = require("../Common/TestProps");
exports.outlineIconProps = { svgSource: { src: outlineIcon_svg_1.default, viewBox: '0 0 20 20' } };
exports.filledIconProps = { svgSource: { src: filledIcon_svg_1.default, viewBox: '0 0 20 20' } };
const E2EInputTest = () => {
    const [error, setError] = React.useState('');
    const [text, setText] = React.useState(e2e_testing_1.INPUT_START_STRING);
    return (React.createElement(stack_1.Stack, { style: styles_1.stackStyle },
        React.createElement(text_1.Text
        /* For Android E2E testing purposes, testProps must be passed in after accessibilityLabel. */
        , { ...(0, TestProps_1.testProps)(e2e_testing_1.INPUT_TEXT) }, text),
        React.createElement(input_1.Input, { error: error, defaultIcon: exports.outlineIconProps, value: text, focusedStateIcon: exports.filledIconProps, textInputProps: { autoFocus: true }, placeholder: "Only text upto 5 characters!", assistiveText: "Assistive Text", label: "Label", onChange: (text) => {
                setText(text);
                if (text.length > 5) {
                    setError('Text must be less than 5 characters!');
                    setText(e2e_testing_1.INPUT_ERROR_STRING);
                }
                else {
                    setError('');
                }
            }, ...(0, TestProps_1.testProps)(e2e_testing_1.INPUT_TEST_COMPONENT), accessoryIconAccessibilityLabel: e2e_testing_1.INPUT_TEST_COMPONENT_DISMISS_BUTTON, accessoryButtonOnPress: () => {
                setText(e2e_testing_1.INPUT_ONCLICK_STRING);
            } })));
};
exports.E2EInputTest = E2EInputTest;
//# sourceMappingURL=E2EInputTest.js.map