'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
require('../config/index.js');
require('./batch-editing.vue.js');
var batchEditing_vue_vue_type_script_setup_true_lang = require('./batch-editing.vue2.js');
var apiModal = require('../config/api-modal.js');

"use strict";
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
  ...{ name: "LlApiModal" },
  __name: "api-modal",
  props: apiModal.apiModalProps,
  emits: apiModal.apiModalEmits,
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emits = __emit;
    const innerValue = vue.ref(props.value);
    const disabled = vue.inject("disabled");
    const handleCancel = () => {
      emits("update:open", false);
    };
    const handleOk = () => {
      emits("update:open", false);
      emits("ok", innerValue.value);
    };
    vue.watch(innerValue, (n) => {
      emits("update:value", n);
    });
    return (_ctx, _cache) => {
      const _component_ll_codemirror_editor_vue3 = vue.resolveComponent("ll-codemirror-editor-vue3");
      const _component_ll_textarea = vue.resolveComponent("ll-textarea");
      const _component_ll_new_modal = vue.resolveComponent("ll-new-modal");
      return vue.openBlock(), vue.createBlock(_component_ll_new_modal, {
        open: props.open,
        title: "\u7F16\u8F91",
        width: "700px",
        onOk: handleOk,
        onCancel: handleCancel
      }, {
        default: vue.withCtx(() => [
          props.type === "code" ? (vue.openBlock(), vue.createBlock(_component_ll_codemirror_editor_vue3, {
            key: 0,
            value: innerValue.value,
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => innerValue.value = $event),
            language: "json",
            disabled: vue.unref(disabled),
            height: "500px",
            options: { minimap: { enabled: false } }
          }, null, 8, ["value", "disabled"])) : vue.createCommentVNode("v-if", true),
          props.type === "textarea" ? (vue.openBlock(), vue.createBlock(_component_ll_textarea, {
            key: 1,
            value: innerValue.value,
            "onUpdate:value": _cache[1] || (_cache[1] = ($event) => innerValue.value = $event),
            disabled: vue.unref(disabled),
            autosize: { minRows: 15 }
          }, null, 8, ["value", "disabled"])) : vue.createCommentVNode("v-if", true),
          props.type === "batch" ? (vue.openBlock(), vue.createBlock(batchEditing_vue_vue_type_script_setup_true_lang.default, {
            key: 2,
            value: innerValue.value,
            "onUpdate:value": _cache[2] || (_cache[2] = ($event) => innerValue.value = $event)
          }, null, 8, ["value"])) : vue.createCommentVNode("v-if", true)
        ]),
        _: 1
        /* STABLE */
      }, 8, ["open"]);
    };
  }
});

exports.default = _sfc_main;
//# sourceMappingURL=api-modal.vue2.js.map
