var j = Object.defineProperty;
var R = (e, t, o) => t in e ? j(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
var F = (e, t, o) => (R(e, typeof t != "symbol" ? t + "" : t, o), o);
import { GridFieldColumnController as W, GridRowController as $, WFStepTraceViewController as q, UploadEditorController as J } from "@ibiz-template/controller";
import { defineComponent as x, computed as L, h as d, getCurrentInstance as N, ref as u, watch as S, toRefs as Y } from "vue";
import { useNamespace as E, useViewController as H, usePropsWatch as B, getUploadProps as K, getEditorEmits as Q, getGridUploadProps as O, useWFStepTraceViewController as X, useWFDynaEditView3Controller as Z, useEditView3Controller as ee } from "@ibiz-template/vue-util";
import { colorBlend as te, IBizContext as oe, isImage as se, uploadFile as re } from "@ibiz-template/core";
import { getCookie as ie } from "qx-util";
import { ViewMode as M } from "@ibiz-template/runtime";
import { ViewType as ne } from "@ibiz-template/model";
const ae = x({
  name: "CodeListGridColumn",
  props: {
    controller: {
      type: W,
      required: !0
    },
    row: {
      type: $,
      required: !0
    }
  },
  setup(e) {
    const t = E("grid-field-column"), o = L(() => {
      var a;
      if (e.controller.model.source.cLConvertMode !== "FRONT")
        return [];
      const n = e.row.data[e.controller.model.codeName];
      return ((a = e.controller.codeListItems) == null ? void 0 : a.length) && n ? n.split(",").map((b) => {
        const w = e.controller.codeListItems.find((f) => f.value === b);
        if (w) {
          const f = w.color || "#515a6e";
          return {
            text: w.text,
            colorStyle: t.cssVarBlock({
              color: f,
              "border-color": f,
              "bg-color": te(f, "#fff")
            })
          };
        }
      }).filter(Boolean) : [];
    }), s = (n) => {
      e.controller.isLinkColumn && e.controller.openLinkView(e.row, n);
    }, i = L(() => {
      let n = "";
      switch (e.controller.model.align) {
        case "LEFT":
          n = "flex-start";
          break;
        case "RIGHT":
          n = "flex-end";
          break;
        default:
          n = "center";
          break;
      }
      return t.cssVarBlock({
        "justify-content": n
      });
    });
    return {
      ns: t,
      alignStyle: i,
      selectedItems: o,
      onCellClick: s
    };
  },
  render() {
    const e = this.controller, t = this.row.data[e.model.codeName];
    return d("div", {
      class: [this.ns.b(), e.isLinkColumn && this.ns.m("link-column")],
      style: this.alignStyle,
      on: {
        click: this.onCellClick
      }
    }, [this.selectedItems.length > 0 ? this.selectedItems.map((o) => d("span", {
      class: this.ns.e("code-list-item"),
      style: o.colorStyle
    }, [o.text])) : d("span", {
      class: this.ns.e("text")
    }, [t])]);
  }
});
class le extends q {
  constructor() {
    super(...arguments);
    F(this, "imgSrc");
  }
  async getUIData() {
    const o = new oe(this.params, this.context), s = await this.entityService.wf.getWFProcessDiagram(o), i = new Blob([s.data]);
    this.imgSrc = URL.createObjectURL(i);
  }
}
const ce = x({
  name: "PresetWFChartView",
  props: {
    context: Object,
    params: {
      type: Object
    },
    modelPath: {
      type: String,
      required: !0
    },
    modal: {
      type: Object
    },
    deName: {
      type: String,
      required: !0
    }
  },
  setup(e) {
    const t = E("preset-wf-chart-view"), {
      proxy: o
    } = N(), s = H(o, (i, n) => new le(e.modelPath, i, n));
    return B(o, "deName", s.setDeName.bind(s)), {
      c: s,
      ns: t
    };
  },
  render() {
    return d("div", {
      class: this.ns.b()
    }, [d("img", {
      attrs: {
        src: this.c.imgSrc
      }
    })]);
  }
});
const de = x({
  name: "WFToolbar",
  props: {
    wfLinks: {
      type: Array,
      required: !0
    }
  },
  setup(e, {
    emit: t
  }) {
    return {
      ns: E("wf-toolbar"),
      handleClick: async (i, n) => {
        t("wf-link-click", i, n);
      }
    };
  },
  render() {
    const e = this.wfLinks || [];
    return d("div", {
      class: `${this.ns.b()}`
    }, [e.length > 0 && e.map((t) => {
      const o = t.sequenceFlowName == "\u9A73\u56DE" || t.sequenceFlowName == "\u53D6\u6D88";
      return d("div", {
        key: t.sequenceFlowId,
        class: [this.ns.e("item"), o ? this.ns.em("item", "reject") : ""]
      }, [d("i-button", {
        attrs: {
          title: t.sequenceFlowName
        },
        on: {
          click: (s) => this.handleClick(t, s)
        }
      }, [t.sequenceFlowName || ""])]);
    })]);
  }
}), ue = typeof btoa == "function", P = typeof Buffer == "function";
typeof TextDecoder == "function" && new TextDecoder();
const _ = typeof TextEncoder == "function" ? new TextEncoder() : void 0, me = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", I = Array.prototype.slice.call(me);
((e) => {
  let t = {};
  return e.forEach((o, s) => t[o] = s), t;
})(I);
const y = String.fromCharCode.bind(String);
typeof Uint8Array.from == "function" && Uint8Array.from.bind(Uint8Array);
const pe = (e) => e.replace(/=/g, "").replace(/[+\/]/g, (t) => t == "+" ? "-" : "_"), he = (e) => {
  let t, o, s, i, n = "";
  const a = e.length % 3;
  for (let c = 0; c < e.length; ) {
    if ((o = e.charCodeAt(c++)) > 255 || (s = e.charCodeAt(c++)) > 255 || (i = e.charCodeAt(c++)) > 255)
      throw new TypeError("invalid character found");
    t = o << 16 | s << 8 | i, n += I[t >> 18 & 63] + I[t >> 12 & 63] + I[t >> 6 & 63] + I[t & 63];
  }
  return a ? n.slice(0, a - 3) + "===".substring(a) : n;
}, G = ue ? (e) => btoa(e) : P ? (e) => Buffer.from(e, "binary").toString("base64") : he, fe = P ? (e) => Buffer.from(e).toString("base64") : (e) => {
  let o = [];
  for (let s = 0, i = e.length; s < i; s += 4096)
    o.push(y.apply(null, e.subarray(s, s + 4096)));
  return G(o.join(""));
}, be = (e) => {
  if (e.length < 2) {
    var t = e.charCodeAt(0);
    return t < 128 ? e : t < 2048 ? y(192 | t >>> 6) + y(128 | t & 63) : y(224 | t >>> 12 & 15) + y(128 | t >>> 6 & 63) + y(128 | t & 63);
  } else {
    var t = 65536 + (e.charCodeAt(0) - 55296) * 1024 + (e.charCodeAt(1) - 56320);
    return y(240 | t >>> 18 & 7) + y(128 | t >>> 12 & 63) + y(128 | t >>> 6 & 63) + y(128 | t & 63);
  }
}, we = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g, ve = (e) => e.replace(we, be), V = P ? (e) => Buffer.from(e, "utf8").toString("base64") : _ ? (e) => fe(_.encode(e)) : (e) => G(ve(e)), z = (e, t = !1) => t ? pe(V(e)) : V(e);
function ye(e, t, o) {
  const s = u([]), i = u({
    Authorization: `Bearer ${ie("access_token")}`
  }), n = u(""), a = u(""), c = {
    count: 0,
    cacheFiles: []
  };
  S(
    () => e.value,
    (r) => {
      s.value = r ? JSON.parse(r) : [];
    },
    { immediate: !0 }
  ), S(
    () => e.data,
    (r) => {
      if (r) {
        const l = o.calcBaseUrl(r);
        n.value = l.uploadUrl, a.value = l.downloadUrl;
      }
    },
    { immediate: !0, deep: !0 }
  ), S(
    s,
    (r) => {
      (r == null ? void 0 : r.length) && a.value && r.forEach((l) => {
        l.url = l.url || a.value.replace("%fileId%", l.id);
      });
    },
    { immediate: !0 }
  ), S(
    a,
    (r) => {
      r && s.value.length && s.value.forEach((l) => {
        l.url = a.value.replace("%fileId%", l.id);
      });
    },
    { immediate: !0 }
  );
  const p = () => {
    const r = [...s.value, ...c.cacheFiles], l = r.length > 0 ? JSON.stringify(r.map((k) => ({ name: k.name, id: k.id }))) : null;
    c.cacheFiles = [], t(l);
  }, b = () => {
    c.count += 1;
  }, w = (r) => {
    !r || (c.cacheFiles.push({
      name: r.filename,
      id: r.fileid
    }), c.count -= 1, c.count === 0 && p());
  }, f = (r) => {
    throw c.count -= 1, r;
  }, g = (r) => {
    if (e.disabled)
      return;
    const l = s.value.findIndex((k) => k.id === r.id);
    l !== -1 && s.value.splice(l, 1), p();
  }, C = (r) => {
    const l = r.url || a.value.replace("%fileId%", r.id);
    o.fileDownload({ url: l, name: r.name });
  }, v = u(!1), U = u(""), T = u("");
  return {
    uploadUrl: n,
    downloadUrl: a,
    headers: i,
    files: s,
    onDownload: C,
    onError: f,
    onRemove: g,
    onSuccess: w,
    beforeUpload: b,
    showModal: v,
    modalTitle: U,
    iframeUrl: T,
    onModalCancel: () => {
      v.value = !1, U.value = "", T.value = "";
    },
    previewFile: (r) => {
      v.value = !0, U.value = r.name;
      const l = window.Environment.previewFileUrl;
      if (l) {
        const k = encodeURIComponent(
          z(
            `${window.location.origin}${r.url}?fullfilename=${r.name}`
          )
        );
        T.value = `${l}/onlinePreview?url=${k}`;
      }
    }
  };
}
const ge = x({
  name: "SyFileUpload",
  props: K(),
  emits: Q(),
  setup(e, {
    emit: t
  }) {
    const o = E("sy-file-upload"), s = e.controller, {
      uploadUrl: i,
      headers: n,
      files: a,
      onDownload: c,
      onError: p,
      onRemove: b,
      onSuccess: w,
      beforeUpload: f,
      showModal: g,
      modalTitle: C,
      iframeUrl: v,
      onModalCancel: U,
      previewFile: T
    } = ye(e, (m) => {
      t("change", m);
    }, s);
    return {
      ns: o,
      c: s,
      uploadUrl: i,
      headers: n,
      files: a,
      onDownload: c,
      onError: p,
      onRemove: b,
      onSuccess: w,
      beforeUpload: f,
      showModal: g,
      modalTitle: C,
      iframeUrl: v,
      onModalCancel: U,
      previewFile: T
    };
  },
  render(e) {
    return e("div", {
      class: [this.ns.b(), this.disabled ? this.ns.m("disabled") : "", this.readonly ? this.ns.m("readonly") : ""]
    }, [e("IUpload", {
      ref: "fileUpload",
      props: {
        action: this.uploadUrl,
        headers: this.headers,
        disabled: this.disabled,
        "default-file-list": this.files,
        multiple: this.c.model.multiple,
        type: this.c.model.isDrag ? "drag" : "select",
        accept: this.c.model.accept,
        "before-upload": this.beforeUpload,
        "on-success": this.onSuccess,
        "on-error": this.onError,
        "on-remove": this.onRemove,
        "on-preview": this.onDownload,
        "show-upload-list": !1
      }
    }, [this.c.model.isDrag ? e("div", {
      class: this.ns.bm("box", "drag")
    }, [e("i-icon", {
      attrs: {
        type: "md-cloud-upload"
      }
    }), e("div", {
      class: this.ns.be("box", "title")
    }, [e("span", ["\u5C06\u6587\u4EF6\u62D6\u5230\u6B64\u5904\uFF0C\u6216"]), e("span", ["\u70B9\u51FB\u4E0A\u4F20"])])]) : e("i-button", {
      attrs: {
        icon: "ios-cloud-upload-outline"
      },
      class: this.ns.bm("box", "select")
    }, ["\u4E0A\u4F20\u6587\u4EF6"])]), e("div", {
      class: this.ns.b("file-list")
    }, [this.files.map((t) => e("div", {
      class: this.ns.b("file-item"),
      key: t.id
    }, [e("div", {
      class: this.ns.b("file-item-left")
    }, [e("i-icon", {
      attrs: {
        type: "md-document"
      }
    })]), e("div", {
      class: this.ns.b("file-item-right")
    }, [e("div", {
      class: this.ns.b("file-item-right-title"),
      on: {
        click: () => this.previewFile(t)
      }
    }, [t.name]), e("div", {
      class: this.ns.b("file-item-right-action")
    }, [e("i-icon", {
      attrs: {
        type: "md-download"
      },
      on: {
        click: () => this.onDownload(t)
      }
    }), e("i-icon", {
      attrs: {
        type: "md-eye"
      },
      on: {
        click: () => this.previewFile(t)
      }
    }), this.disabled || this.readonly ? null : e("i-icon", {
      attrs: {
        type: "md-close"
      },
      on: {
        click: () => this.onRemove(t)
      }
    })])])]))]), e("i-modal", {
      attrs: {
        value: this.showModal,
        title: this.modalTitle,
        "class-name": this.ns.b("modal"),
        width: "70%",
        transfer: !1,
        "footer-hide": !0
      },
      on: {
        "on-cancel": this.onModalCancel
      }
    }, [e("iframe", {
      class: this.ns.b("iframe"),
      attrs: {
        src: this.iframeUrl
      }
    })])]);
  }
});
function D(e, t) {
  if (e.url = t.replace("%fileId%", e.id), e.status || (e.status = "finished"), !e.fileName) {
    const o = e.name.lastIndexOf(".");
    e.fileName = e.name.substring(0, o), e.fileExt = e.name.substring(o), e.isImage = se(e.name);
  }
  return e;
}
function Ce(e) {
  const t = u(""), o = u(""), s = u([]);
  return S(
    e.data,
    (i) => {
      if (i) {
        const n = e.controller.value.calcBaseUrl(i);
        t.value = n.uploadUrl, o.value = n.downloadUrl;
      }
    },
    { immediate: !0, deep: !0 }
  ), S(
    e.value,
    (i) => {
      s.value = i ? JSON.parse(i) : [], s.value.length && o.value && s.value.forEach((n) => {
        D(n, o.value);
      });
    },
    { immediate: !0 }
  ), S(
    o,
    (i) => {
      i && s.value.length && s.value.forEach((n) => {
        D(n, i);
      });
    },
    { immediate: !0 }
  ), {
    downloadUrl: o,
    uploadUrl: t,
    valueList: s
  };
}
function Fe(e) {
  const t = u("undo"), o = u([]), { downloadUrl: s, value: i, uploadUrl: n } = e;
  S(
    i,
    (m) => {
      m.length > 0 && (o.value = [], m.forEach((h) => {
        o.value.push(D(h, s.value));
      }));
    },
    {
      immediate: !0,
      deep: !0
    }
  );
  const a = (m, h) => (h.forEach((r) => {
    o.value.push({
      name: r.name,
      status: r.status,
      percentage: r.percentage,
      id: r.uid,
      url: ""
    });
  }), !0), c = (m) => {
    m.forEach((h) => {
      o.value.find((r) => r.id === h.uid ? (r.percentage = h.percentage, !0) : !1);
    });
  }, p = (m, h) => {
    m.forEach((r) => {
      o.value.find((l) => l.id === r.uid ? (l.status = r.status, l.id = h.data.fileid, l.name = h.data.filename, D(l, s.value), !0) : !1);
    });
  }, b = (m) => {
    m.forEach((h) => {
      o.value.find((r) => r.id === h.uid ? (r.status = h.status, !0) : !1);
    });
  }, w = (m) => {
    t.value = "done";
  }, f = () => {
    re({
      multiple: e.multiple,
      accept: e.accept,
      uploadUrl: n.value,
      beforeUpload: a,
      progress: c,
      success: p,
      error: b,
      finish: w
    });
  }, g = u(!1), C = u(""), v = u("");
  return {
    selectFile: f,
    fileList: o,
    uploadState: t,
    showModal: g,
    modalTitle: C,
    iframeUrl: v,
    onModalCancel: () => {
      g.value = !1, C.value = "", v.value = "";
    },
    previewFile: (m) => {
      g.value = !0, C.value = m.name;
      const h = window.Environment.previewFileUrl;
      if (h) {
        const r = encodeURIComponent(
          z(
            `${window.location.origin}${m.url}?fullfilename=${m.name}`
          )
        );
        v.value = `${h}/onlinePreview?url=${r}`;
      }
    }
  };
}
const xe = x({
  name: "SyGridFileUpload",
  props: O(),
  setup(e) {
    const t = E("sy-grid-file-upload"), {
      value: o,
      data: s,
      controller: i
    } = Y(e), {
      downloadUrl: n,
      uploadUrl: a,
      valueList: c
    } = Ce({
      value: o,
      data: s,
      controller: i
    }), {
      fileList: p,
      showModal: b,
      modalTitle: w,
      iframeUrl: f,
      previewFile: g,
      onModalCancel: C
    } = Fe({
      downloadUrl: n,
      uploadUrl: a,
      value: c
    });
    return {
      ns: t,
      fileList: p,
      showModal: b,
      modalTitle: w,
      iframeUrl: f,
      downloadFile: (U) => {
        e.controller.fileDownload(U);
      },
      previewFile: g,
      onModalCancel: C
    };
  },
  render() {
    return d("grid-editor", {
      attrs: {
        disabled: this.disabled,
        readonly: this.readonly
      },
      class: [this.ns.b(), this.disabled ? this.ns.m("disabled") : "", this.readonly ? this.ns.m("readonly") : ""]
    }, [d("div", {
      class: this.ns.b("file-list")
    }, [this.fileList.map((e) => d("div", {
      class: this.ns.b("file-item"),
      key: e.id
    }, [d("div", {
      class: this.ns.b("file-item-title"),
      on: {
        click: () => this.previewFile(e)
      }
    }, [e.name]), d("div", {
      class: this.ns.b("file-item-action")
    }, [d("i-icon", {
      attrs: {
        type: "md-download"
      },
      on: {
        click: () => this.downloadFile(e)
      }
    }), d("i-icon", {
      attrs: {
        type: "md-eye"
      },
      on: {
        click: () => this.previewFile(e)
      }
    })])]))]), d("i-modal", {
      attrs: {
        value: this.showModal,
        title: this.modalTitle,
        "class-name": this.ns.b("modal"),
        width: "70%",
        transfer: !1,
        "footer-hide": !0
      },
      on: {
        "on-cancel": this.onModalCancel
      }
    }, [d("iframe", {
      class: this.ns.b("iframe"),
      attrs: {
        src: this.iframeUrl
      }
    })])]);
  }
}), Ue = x({
  name: "SyGridFileUploadContainer",
  props: O(),
  render(e) {
    return this.disabled || this.readonly ? e("SyGridFileUpload", {
      props: {
        ...this.$props
      }
    }) : e("IBizGridFileUpload", {
      props: {
        ...this.$props
      }
    });
  }
});
class Se {
  constructor() {
    F(this, "component", ce);
  }
}
class Ee {
  constructor() {
    F(this, "component", ae);
  }
  async createController(t, o) {
    const s = new W(t, o);
    return await s.init(), s;
  }
}
class Te {
  constructor() {
    F(this, "component", "IndexView");
  }
}
const A = x({
  name: "WFStepTraceGrid",
  props: {
    context: Object,
    params: {
      type: Object
    },
    modelPath: {
      type: String,
      required: !0
    },
    modal: {
      type: Object
    },
    deName: {
      type: String,
      required: !0
    }
  },
  setup(e) {
    const {
      proxy: t
    } = N(), o = X(t, e.modelPath);
    B(t, "deName", o.setDeName.bind(o));
    const s = E("wf-step-trace-grid"), i = u([]);
    o.nerve.self.evt.on("mounted", () => {
      var a;
      !o.data || (a = o.data.usertasks) == null || a.forEach((c) => {
        c.identitylinks.length > 0 || (c.comments.length > 0 && c.comments.forEach((p) => {
          i.value.push({
            nodeName: c.userTaskName,
            personName: p.authorName,
            time: p.time,
            content: p.type,
            comment: p.fullMessage
          });
        }), i.value.sort((p, b) => Date.parse(b.time) - Date.parse(p.time)));
      });
    });
    const n = u([{
      title: "\u5904\u7406\u73AF\u8282",
      key: "nodeName",
      width: 180,
      resizable: !0
    }, {
      title: "\u5904\u7406\u4EBA",
      key: "personName",
      width: 180,
      resizable: !0
    }, {
      title: "\u5904\u7406\u65F6\u95F4",
      key: "time",
      width: 180,
      resizable: !0
    }, {
      title: "\u5904\u7406\u5185\u5BB9",
      key: "content",
      width: 180,
      resizable: !0
    }, {
      title: "\u5904\u7406\u610F\u89C1",
      key: "comment"
    }]);
    return {
      c: o,
      ns: s,
      gridData: i,
      columns: n
    };
  },
  render() {
    return d("div", {
      class: this.ns.b()
    }, [d("div", {
      class: this.ns.e("title")
    }, ["\u5BA1\u6279\u4FE1\u606F"]), d("i-table", {
      attrs: {
        "disabled-hover": !0,
        columns: this.columns,
        data: this.gridData
      },
      class: this.ns.e("grid")
    })]);
  }
}), ke = x({
  props: {
    context: Object,
    params: {
      type: Object
    },
    modelPath: {
      type: String,
      required: !0
    },
    modal: {
      type: Object
    }
  },
  setup(e) {
    const {
      proxy: t
    } = N(), o = Z(t, e.modelPath), s = E(`view-${ne.DE_WF_DYNA_EDIT_VIEW3}`.toLowerCase()), i = u(["mainForm"]);
    return {
      c: o,
      ns: s,
      onTabClick: (a) => {
        i.value.includes(a) || i.value.push(a);
      },
      lazyList: i
    };
  },
  render(e) {
    const t = [];
    if (this.c.complete) {
      const {
        activeForm: o
      } = this.c;
      o && this.c.providers[o.name] && t.push(e(this.c.providers[o.name].component, {
        props: {
          modelData: o,
          context: this.c.context,
          params: this.c.params
        },
        style: {
          height: "auto"
        },
        on: {
          neuronInit: this.c.nerve.onNeuronInit("form")
        }
      }));
    }
    if (this.c.complete && this.c.model.drTab.pages[0]) {
      const o = this.c.model.drTab.pages[0], s = this.c.drPages[o.source.name];
      t.push(e(A, {
        attrs: {
          context: s.context,
          params: s.params,
          deName: this.c.model.appEntity.source.codeName,
          modal: this.modal,
          modelPath: o.embedView.source.modelPath
        }
      }));
    }
    return e("view-base", {
      attrs: {
        controller: this.c
      },
      scopedSlots: {
        toolbar: () => this.c.complete ? [this.c.wfLinks.length > 0 && e("wf-toolbar", {
          attrs: {
            wfLinks: this.c.wfLinks
          },
          on: {
            "wf-link-click": (o) => {
              this.c.onLinkClick(o);
            }
          }
        })] : null
      }
    }, [this.c.complete && e("i-tabs", {
      class: [this.ns.be("", "tab")],
      attrs: {
        name: this.c.model.drTab.source.name
      },
      on: {
        "on-click": this.onTabClick
      }
    }, [e("i-tab-pane", {
      class: this.ns.be("", "tab-item"),
      attrs: {
        tab: this.c.model.drTab.source.name,
        label: this.c.model.drTab.source.editItemCaption,
        name: "mainForm"
      }
    }, [t]), this.c.model.drTab.pages.map((o) => {
      const s = this.c.drPages[o.source.name];
      return e("i-tab-pane", {
        class: this.ns.be("", "tab-item"),
        attrs: {
          tab: this.c.model.drTab.source.name,
          disabled: this.c.isNewData,
          label: o.source.caption,
          name: o.source.name
        }
      }, [!this.c.isNewData && this.lazyList.includes(o.source.name) && e("ViewShell", {
        props: {
          context: s.context,
          params: s.params,
          modal: {
            mode: M.EMBED
          },
          modelPath: o.embedView.source.modelPath,
          deName: this.c.model.appEntity.source.codeName
        },
        on: {
          neuronInit: this.c.nerve.onNeuronInit(o.source.name)
        },
        key: s.key
      })]);
    })])]);
  }
});
class Ie {
  constructor() {
    F(this, "component", ke);
  }
}
const De = x({
  name: "SyEditView3",
  props: {
    context: Object,
    params: {
      type: Object
    },
    modelPath: {
      type: String,
      required: !0
    },
    modal: {
      type: Object
    }
  },
  setup(e) {
    const {
      proxy: t
    } = N(), o = ee(t, e.modelPath), s = E("view-deeditview3"), i = u(["mainForm"]);
    return {
      c: o,
      ns: s,
      onTabClick: (a) => {
        i.value.includes(a) || i.value.push(a);
      },
      lazyList: i
    };
  },
  render(e) {
    return e("view-base", {
      attrs: {
        controller: this.c
      }
    }, [this.c.complete && e("i-tabs", {
      class: [this.ns.be("", "tab")],
      attrs: {
        name: this.c.model.drTab.source.name
      },
      on: {
        "on-click": this.onTabClick
      }
    }, [e("i-tab-pane", {
      class: this.ns.be("", "tab-item"),
      attrs: {
        tab: this.c.model.drTab.source.name,
        label: this.c.model.drTab.source.editItemCaption,
        name: "mainForm"
      }
    }, [e("edit-form-control", {
      attrs: {
        modelData: this.c.model.form,
        context: this.c.context,
        params: this.c.params
      },
      style: {
        height: "auto"
      },
      on: {
        neuronInit: this.c.nerve.onNeuronInit(this.c.model.form.source.name)
      }
    }), e(A, {
      attrs: {
        context: this.c.drPages[this.c.model.drTab.pages[0].source.name].context,
        params: this.c.drPages[this.c.model.drTab.pages[0].source.name].params,
        deName: this.c.model.appEntity.source.codeName,
        modal: this.modal,
        modelPath: this.c.model.drTab.pages[0].embedView.source.modelPath
      }
    })]), this.c.model.drTab.pages.map((t) => {
      const o = this.c.drPages[t.source.name];
      if (!!o)
        return e("i-tab-pane", {
          class: this.ns.be("", "tab-item"),
          attrs: {
            tab: this.c.model.drTab.source.name,
            disabled: this.c.isNewData,
            label: t.source.caption,
            name: t.source.name
          }
        }, [!this.c.isNewData && this.lazyList.includes(t.source.name) && e("ViewShell", {
          props: {
            context: o.context,
            params: o.params,
            modal: {
              mode: M.EMBED
            },
            modelPath: t.embedView.source.modelPath,
            deName: this.c.model.appEntity.source.codeName
          },
          on: {
            neuronInit: this.c.nerve.onNeuronInit(t.source.name)
          },
          key: o.key
        })]);
    })])]);
  }
});
class Ne {
  constructor() {
    F(this, "component", De);
  }
}
class Pe {
  constructor() {
    F(this, "formEditor", "SyFileUpload");
    F(this, "gridEditor", "SyGridFileUploadContainer");
  }
  async createController(t, o) {
    const s = new J(t, o);
    return await s.init(), s;
  }
}
const ze = {
  mateUrl: import.meta.url,
  install(e) {
    ibiz.config.enableDataInfoBar = !1, e.component("WfToolbar", de), ibiz.register.view.register(
      "VIEW_CUSTOM_SyWebIndexView",
      new Te()
    ), ibiz.register.view.register(
      "VIEW_CUSTOM_PresetWFChartView",
      new Se()
    ), ibiz.register.gridColumn.register(
      "GRID_COLRENDER_CodeListGridColumn",
      new Ee()
    ), ibiz.register.view.register(
      "VIEW_CUSTOM_SyWfDynaEditView3",
      new Ie()
    ), ibiz.register.view.register(
      "VIEW_CUSTOM_SyEditView3",
      new Ne()
    ), e.component("SyFileUpload", ge), e.component("SyGridFileUpload", xe), e.component("SyGridFileUploadContainer", Ue), ibiz.register.editor.register(
      "EDITOR_CUSTOMSTYLE_SyFileUpload",
      new Pe()
    );
  }
};
export {
  ze as default
};
