"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const index = require("../api/index.js");
require("../../../../node_modules/element-plus/es/index.js");
;/* empty css                                                          */
;/* empty css                                                              */
;/* empty css                                                                */
const index$1 = require("../../../../node_modules/element-plus/es/components/message/index.js");
async function getJsonAsyncUtil($http, id, type, initOption) {
  let option = {};
  const busMode = "base-server";
  let data = await index.default.findByTemplateKey($http, {
    templateKey: id,
    type,
    moduleType: busMode,
    timestamp: Date.now(),
    templateVersion: "v5"
  });
  if (data) {
    option = JSON.parse(data);
  }
  if (initOption) {
    option = Object.assign(option, initOption);
  }
  if ("{}" == JSON.stringify(option)) {
    let errorMsg = "未找到 [ " + id + " ] 表单模板或表单模板未配置";
    index$1.ElMessage.error(errorMsg);
    throw new Error(errorMsg);
  }
  return option;
}
exports.default = getJsonAsyncUtil;
