"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,o)=>{for(var r in o)__defProp(e,r,{get:o[r],enumerable:!0})},__copyProps=(e,o,r,t)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let i of __getOwnPropNames(o))__hasOwnProp.call(e,i)||i===r||__defProp(e,i,{get:()=>o[i],enumerable:!(t=__getOwnPropDesc(o,i))||t.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),upload_files_menu_item_exports={};__export(upload_files_menu_item_exports,{UploadFilesMenuItem:()=>UploadFilesMenuItem}),module.exports=__toCommonJS(upload_files_menu_item_exports);var import_components=require("@wordpress/components"),import_element=require("@wordpress/element"),import_i18n=require("@wordpress/i18n"),import_icons=require("@wordpress/icons"),import_media_utils=require("@wordpress/media-utils");function UploadFilesMenuItem({allowedTypes:e,maxUploadFileSize:o,onUploadSuccess:r,onUploadError:t}){const i=o||window.productBlockEditorSettings?.maxUploadFileSize||10485760;return(0,import_element.createElement)(import_components.FormFileUpload,{multiple:!0,onChange:function(o){const n=Array.from(o.currentTarget.files??[]);(0,import_media_utils.uploadMedia)({allowedTypes:e,filesList:n,maxUploadFileSize:i,onFileChange:r,onError:t})},render:({openFileDialog:e})=>(0,import_element.createElement)(import_components.MenuItem,{icon:import_icons.upload,iconPosition:"left",onClick:e,info:(0,import_i18n.__)("Select files from your device","woocommerce")},(0,import_i18n.__)("Upload","woocommerce"))})}