"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const bodyFooterJs_1 = require("./bodyFooterJs");
const bodyHeaderJs_1 = require("./bodyHeaderJs");
function initBodyJs(parser) {
    const { webViewHooks } = parser;
    bodyHeaderJs_1.default(parser);
    bodyFooterJs_1.default(parser);
    webViewHooks.bodyHtmlHook.tapPromise('body', (bodyArr) => __awaiter(this, void 0, void 0, function* () {
        const headerJs = yield webViewHooks.bodyHeaderJsHook.promise([]);
        const footerJs = yield webViewHooks.bodyFooterJsHook.promise([]);
        return headerJs.concat(bodyArr).concat([
            `
            <div id="app">
                <el-form ref="form" :model="form" label-width="80px">
                <el-form-item label="key">
                    <el-input placeholder="请输入内容" v-model="form.key" clearable>
                    </el-input>
                </el-form-item>
                <el-form-item v-for="item in form.langs" :key="item.langKey" :label="item.langKey">
                    <el-input
                        type="textarea"
                        placeholder="请输入内容"
                        v-model="item.value"
                        clearable>
                    </el-input>
                </el-form-item>
                <el-form-item>
                    <el-button v-for="item in btns" :key="item.key" type="primary" @click="onSubmit(item)">{{item.text}}</el-button>
                </el-form-item>
                </el-form>
            </div>    
            `
        ]).concat(footerJs);
    }));
}
exports.default = initBodyJs;
//# sourceMappingURL=bodyHtml.js.map