import {Input as $41fb335299a4a39e$export$f5b8910cec6cf069} from "./Input.mjs";
import {filterDOMProps as $6JSwL$filterDOMProps} from "react-aria/private/utils/filterDOMProps";
import {getEventTarget as $6JSwL$getEventTarget} from "react-aria/private/utils/shadowdom/DOMFunctions";
import {PressResponder as $6JSwL$PressResponder} from "react-aria/private/interactions/PressResponder";
import $6JSwL$react, {forwardRef as $6JSwL$forwardRef} from "react";
import {useObjectRef as $6JSwL$useObjectRef} from "react-aria/useObjectRef";

/*
 * Copyright 2023 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 $b325d7bd7e74496a$export$6fb4a10d2c950550 = /*#__PURE__*/ (0, $6JSwL$forwardRef)(function FileTrigger(props, ref) {
    let { onSelect: onSelect, acceptedFileTypes: acceptedFileTypes, allowsMultiple: allowsMultiple, defaultCamera: defaultCamera, children: children, acceptDirectory: acceptDirectory, ...rest } = props;
    let inputRef = (0, $6JSwL$useObjectRef)(ref);
    let domProps = (0, $6JSwL$filterDOMProps)(rest, {
        global: true
    });
    return /*#__PURE__*/ (0, $6JSwL$react).createElement((0, $6JSwL$react).Fragment, null, /*#__PURE__*/ (0, $6JSwL$react).createElement((0, $6JSwL$PressResponder), {
        onPress: ()=>{
            if (inputRef.current?.value) inputRef.current.value = '';
            inputRef.current?.click();
        }
    }, children), /*#__PURE__*/ (0, $6JSwL$react).createElement((0, $41fb335299a4a39e$export$f5b8910cec6cf069), {
        ...domProps,
        className: "",
        type: "file",
        ref: inputRef,
        style: {
            display: 'none'
        },
        accept: acceptedFileTypes?.toString(),
        onChange: (e)=>onSelect?.((0, $6JSwL$getEventTarget)(e).files),
        capture: defaultCamera,
        multiple: allowsMultiple,
        // @ts-expect-error
        webkitdirectory: acceptDirectory ? '' : undefined
    }));
});


export {$b325d7bd7e74496a$export$6fb4a10d2c950550 as FileTrigger};
//# sourceMappingURL=FileTrigger.mjs.map
