import _extends from "@babel/runtime/helpers/esm/extends";
import { computed } from 'vue';
const normalizeMaskConfig = mask => {
  if (mask && typeof mask === 'object') {
    return mask;
  }
  if (typeof mask === 'boolean') {
    return {
      enabled: mask,
      blur: mask
    };
  }
  return {};
};
export const useMergedMask = (mask, contextMask, prefixCls) => {
  return computed(() => {
    const maskConfig = normalizeMaskConfig(mask === null || mask === void 0 ? void 0 : mask.value);
    const contextMaskConfig = normalizeMaskConfig(contextMask === null || contextMask === void 0 ? void 0 : contextMask.value);
    const mergedConfig = _extends(_extends({}, contextMaskConfig), maskConfig);
    const className = mergedConfig.blur !== false ? `${prefixCls === null || prefixCls === void 0 ? void 0 : prefixCls.value}-mask-blur` : undefined;
    return {
      enabled: mergedConfig.enabled !== false,
      classNames: {
        mask: className
      }
    };
  });
};