"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../tslib.es6-C4EgNkz1.js"),e=require("react"),i=require("../utils-C9NL3q0j.js"),p=require("classnames"),I=require("../random-id-DlJj_RWH.js"),v=require("../icons/ebay-icon-upload-24/index.js"),c=n=>{var{className:t,as:a="span"}=n,s=u.__rest(n,["className","as"]);return e.createElement(a,Object.assign({className:p("file-input__content-header",t)},s))},o=n=>{var{className:t,as:a="span"}=n,s=u.__rest(n,["className","as"]);return e.createElement(a,Object.assign({className:p("file-input__content-subheader",t)},s))},y=n=>{var{children:t,onInput:a,className:s}=n,l=u.__rest(n,["children","onInput","className"]);const d=I.useRandomId(),[f,m]=e.useState(!1),E=r=>{a&&a(r,{files:r.target.files})},_=()=>m(!0),g=()=>m(!1),h=i.findComponent(t,c),N=i.findComponent(t,o),b=i.excludeComponent(t,c).filter(({type:r})=>r!==o);return e.createElement("div",{className:p("file-input",f&&"file-input___container--dragged-over",s)},e.createElement("div",{className:"file-input__container"},e.createElement("div",{className:"file-input__upload-icon"},e.createElement(v.EbayIconUpload24,null)),e.createElement("div",{className:"file-input__content"},h,N,b&&e.createElement("label",{htmlFor:l.id||d},e.createElement("span",{className:"file-input__content-cta"},b)))),e.createElement("input",Object.assign({},l,{id:l.id||d,type:"file",className:"file-input__input",onChange:E,onDragEnter:_,onDragOver:_,onDragLeave:g,onDrop:g})))};exports.EbayFileInput=y;exports.EbayFileInputHeader=c;exports.EbayFileInputSubheader=o;
