'use client';'use strict';

var chunkY3NOL3WI_cjs = require('./chunk-Y3NOL3WI.cjs');
var chunk4SZXQT5I_cjs = require('./chunk-4SZXQT5I.cjs');
var chunk5XB54L7P_cjs = require('./chunk-5XB54L7P.cjs');
var css = require('@onbeam/styled-system/css');
var reactDropzoneEsm = require('react-dropzone-esm');
var recipes = require('@onbeam/styled-system/recipes');
var jsxRuntime = require('react/jsx-runtime');

var k={i18n:{placeholderTitle:"Drag & drop your file here, or click to upload",uploadButton:"upload",replaceButton:"replace",removeButton:"remove",loadingText:"Uploading..."}},u=chunk5XB54L7P_cjs.a(({as:v="div",fileSrc:p,label:z,hasError:D=!1,errorMessage:s,className:N,options:f,isLoading:g,onRemoveFile:b,...i},B)=>{let l=!!s||D,r={...k.i18n,...i.i18n},{getRootProps:y,getInputProps:h,open:x,isDragActive:E}=reactDropzoneEsm.useDropzone({...f,noKeyboard:!0,multiple:!1,maxFiles:1}),o=recipes.dropzone(),a;return g?a=jsxRuntime.jsx("div",{className:o.dropzone,children:jsxRuntime.jsxs("div",{className:o.dropzoneContent,children:[jsxRuntime.jsx("span",{className:o.loadingText,children:r.loadingText}),jsxRuntime.jsx(chunk4SZXQT5I_cjs.a,{variant:"spinner",className:o.loader})]})}):p?a=jsxRuntime.jsxs("div",{className:o.imgItem,children:[jsxRuntime.jsx("div",{children:jsxRuntime.jsx("img",{className:o.img,src:p,alt:""})}),jsxRuntime.jsxs("div",{className:o.actions,children:[jsxRuntime.jsx(chunkY3NOL3WI_cjs.a,{size:"sm",type:"button",className:o.button,onClick:x,children:r.replaceButton}),jsxRuntime.jsx(chunkY3NOL3WI_cjs.a,{size:"sm",type:"button",className:o.button,onClick:b,children:r.removeButton})]})]}):a=jsxRuntime.jsx("div",{className:o.dropzone,...y(),children:jsxRuntime.jsxs("div",{className:o.dropzoneContent,children:[jsxRuntime.jsxs("div",{className:o.placeholder,children:[jsxRuntime.jsx("span",{className:o.placeholderTitle,children:r.placeholderTitle}),r.placeholderSubtitle&&jsxRuntime.jsx("span",{className:o.placeholderSubtitle,children:r.placeholderSubtitle})]}),jsxRuntime.jsx(chunkY3NOL3WI_cjs.a,{size:"sm",type:"button",children:r.uploadButton})]})}),jsxRuntime.jsxs("label",{className:css.cx(o.root,N),children:[z,jsxRuntime.jsxs(v,{ref:B,className:css.cx(recipes.noiseBackground(),recipes.gridBackground(),o.wrapper),"data-error":l,...i,children:[jsxRuntime.jsx("input",{...h()}),jsxRuntime.jsx("div",{className:o.container,"data-drag-active":E,"data-error":l,children:a})]}),s]})});u.displayName="Dropzone";

Object.defineProperty(exports, "b", {
	enumerable: true,
	get: function () { return reactDropzoneEsm.ErrorCode; }
});
exports.a = u;
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-RYGSCTCO.cjs.map