const toString = Object.prototype.toString;
function getTag(value) {
  if (value === null) {
    return "[object Null]";
  } else if (value === void 0) {
    return "[object Undefined]";
  }
  return toString.call(value);
}
function isObjectLike(value) {
  return typeof value === "object" && value !== null;
}
function isBoolean(value) {
  return value === true || value === false || isObjectLike(value) && getTag(value) === "[object Boolean]";
}
function isString(value) {
  return typeof value === "string" || isObjectLike(value) && getTag(value) === "[object String]";
}
function isNumber(value) {
  return typeof value === "number" || isObjectLike(value) && getTag(value) === "[object Number]";
}
function isSymbol(value) {
  return typeof value === "symbol" || isObjectLike(value) && getTag(value) === "[object Symbol]";
}
function isDate(value) {
  return isObjectLike(value) && getTag(value) === "[object Date]";
}
const isFunction = (val) => typeof val === "function";
function isInteger(val) {
  return isNumber(val) && val % 1 === 0;
}
function isDecimal(val) {
  return isNumber(val) && val % 1 !== 0;
}
function isNegative(val) {
  return isNumber(val) && val < 0;
}
function isPositive(val) {
  return isNumber(val) && val > 0;
}
function isOdd(val) {
  return isNumber(val) && val % 2 !== 0;
}
function isEven(val) {
  return isNumber(val) && val % 2 === 0;
}
function isStringNumber(val) {
  if (!isString(val)) {
    return false;
  }
  return !Number.isNaN(Number(val));
}
function isUndefined(val) {
  return val === void 0;
}
function isNull(val) {
  return val === null;
}
function isNil(val) {
  return isUndefined(val) || isNull(val);
}
function isError(value) {
  if (!isObjectLike(value)) {
    return false;
  }
  const tag = getTag(value);
  return tag === "[object Error]" || tag === "[object DOMException]" || typeof value.message === "string" && typeof value.name === "string" && !isPlainObject(value);
}
function isPlainObject(value) {
  if (!isObjectLike(value) || getTag(value) !== "[object Object]") {
    return false;
  }
  if (Object.getPrototypeOf(value) === null) {
    return true;
  }
  let proto = value;
  while (Object.getPrototypeOf(proto) !== null) {
    proto = Object.getPrototypeOf(proto);
  }
  return Object.getPrototypeOf(value) === proto;
}
const isHttps = () => {
  return window.location.protocol.startsWith("https");
};
const isClient = typeof window !== "undefined" && typeof document !== "undefined";
const isIOS = /* @__PURE__ */ getIsIOS();
function getIsIOS() {
  return isClient && window?.navigator?.userAgent && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || // The new iPad Pro Gen3 does not identify itself as iPad, but as Macintosh.
  // https://github.com/vueuse/vueuse/issues/3577
  window?.navigator?.maxTouchPoints > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent));
}
var FileType = /* @__PURE__ */ ((FileType2) => {
  FileType2["Video"] = "Video";
  FileType2["Image"] = "Image";
  FileType2["Pdf"] = "Pdf";
  FileType2["Word"] = "Word";
  FileType2["Excel"] = "Excel";
  FileType2["Ppt"] = "Ppt";
  FileType2["Text"] = "Text";
  FileType2["Psd"] = "Psd";
  FileType2["Zip"] = "Zip";
  return FileType2;
})(FileType || {});
const FILE_EXTENSIONS = {
  ["Video" /* Video */]: ["mp4", "avi", "rmvb", "rm", "wmv", "mpg", "mpeg", "mov", "mkv", "flv"],
  ["Image" /* Image */]: ["jpg", "jpeg", "png", "gif", "webp", "svg", "bmp"],
  ["Pdf" /* Pdf */]: ["pdf"],
  ["Word" /* Word */]: ["doc", "docx"],
  ["Excel" /* Excel */]: ["xls", "xlsx"],
  ["Ppt" /* Ppt */]: ["ppt", "pptx"],
  ["Text" /* Text */]: ["txt"],
  ["Psd" /* Psd */]: ["psd"],
  ["Zip" /* Zip */]: ["zip", "rar", "7z"]
};
const createExtensionRegex = (extensions) => {
  return new RegExp(`\\.(${extensions.join("|")})$`, "i");
};
const isFileType = (url, type) => {
  if (!isString(url)) return false;
  const baseUrl = url.split("?")[0];
  const regex = createExtensionRegex(FILE_EXTENSIONS[type]);
  return regex.test(baseUrl);
};
const isVideoUrl = (url) => isFileType(url, "Video" /* Video */);
const isImageUrl = (url) => isFileType(url, "Image" /* Image */);
const isPDF = (url) => isFileType(url, "Pdf" /* Pdf */);
const isWord = (url) => isFileType(url, "Word" /* Word */);
const isExcel = (url) => isFileType(url, "Excel" /* Excel */);
const isPPT = (url) => isFileType(url, "Ppt" /* Ppt */);
const isText = (url) => isFileType(url, "Text" /* Text */);
const isPSD = (url) => isFileType(url, "Psd" /* Psd */);
const isZip = (url) => isFileType(url, "Zip" /* Zip */);
const MOBILE_DEVICE_REGEX = /android|webos|iphone|ipod|blackberry|iemobile|opera mini/i;
const TABLET_DEVICE_REGEX = /ipad|android(?!.*mobile)|tablet/i;
const DINGTALK_REGEX = /dingtalk/i;
const isMobile = () => {
  if (!isClient) return false;
  const ua = navigator.userAgent.toLowerCase();
  const isMobileDevice = MOBILE_DEVICE_REGEX.test(ua);
  const isTabletDevice = TABLET_DEVICE_REGEX.test(ua);
  return isMobileDevice || isTabletDevice;
};
const isDingTalk = () => {
  if (!isClient) return false;
  const ua = navigator.userAgent.toLowerCase();
  return DINGTALK_REGEX.test(ua);
};

export { DINGTALK_REGEX, FILE_EXTENSIONS, FileType, MOBILE_DEVICE_REGEX, TABLET_DEVICE_REGEX, getTag, isBoolean, isClient, isDate, isDecimal, isDingTalk, isError, isEven, isExcel, isFunction, isHttps, isIOS, isImageUrl, isInteger, isMobile, isNegative, isNil, isNull, isNumber, isObjectLike, isOdd, isPDF, isPPT, isPSD, isPlainObject, isPositive, isString, isStringNumber, isSymbol, isText, isUndefined, isVideoUrl, isWord, isZip };
//# sourceMappingURL=is.mjs.map
