import { computed as u } from "vue";
import "../../../config-provider/index.mjs";
import { getAcceptText as i } from "../utils/accept.mjs";
import { uploadBeforeUpload as r, uploadCustomRequest as n } from "../utils/upload.mjs";
import { useLocale as s } from "../../../config-provider/hooks/use-locale.mjs";
function R(e) {
  const { t: o } = s(), c = u(
    () => e.title || o("ap.apUpload.clickOrDragUpload")
  ), m = u(
    () => e.subTitle || `${o("ap.apUpload.supportExtension")}：${i(e.accept)}，${o(
      "ap.apUpload.maxWarnUploadFileSize",
      {
        maxSize: e.maxSize
      }
    )}`
  );
  function l(t, a) {
    return r(t, a, e) && (e?.beforeUpload?.(t, a) ?? !0);
  }
  return { title: c, subTitle: m, beforeUpload: l, customRequest: (t) => {
    e?.customRequest ? e?.customRequest?.(t) : n?.(t, e);
  } };
}
export {
  R as useSingleProps
};
