import { _ as C, ad as L, ab as x, a2 as T } from "./template-rpthWlT9.js";
import { r as R, V as E, bk as _, Z as l, H as p, c9 as b, c8 as k, k as g, cb as c, ae as N, __tla as __tla_0 } from "./index-9PRMimni.js";
import { f as V } from "./format-DgF6KtHk.js";
import { v as U, __tla as __tla_1 } from "./schemas-DzvLPsci.js";
let q, $;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    const v = await C(), D = await x(), S = await L("Other Training");
    await T();
    function z(t) {
        return {
            1: {
                color: "rgba(91, 196, 139, 0.12)",
                textColor: "rgba(91, 196, 139, 1)",
                borderColor: "rgba(91, 196, 139, 0.50)"
            },
            2: {
                color: "rgba(148, 99, 226, 0.12)",
                textColor: "rgba(148, 99, 226, 1)",
                borderColor: "rgba(148, 99, 226, 0.50)"
            },
            3: {
                color: "rgba(23, 182, 235, 0.12)",
                textColor: "rgba(23, 182, 235, 1)",
                borderColor: "rgba(23, 182, 235, 0.50)"
            },
            4: {
                color: "rgba(63, 195, 63, 0.12)",
                textColor: "rgba(63, 195, 63, 1)",
                borderColor: "rgba(63, 195, 63, 0.50)"
            },
            5: {
                color: "rgba(210, 76, 76, 0.12)",
                textColor: "rgba(210, 76, 76, 1)",
                borderColor: "rgba(210, 76, 76, 0.50)"
            },
            6: {
                color: "rgba(33, 128, 241, 0.12)",
                textColor: "rgba(33, 128, 241, 1)",
                borderColor: "rgba(33, 128, 241, 0.50)"
            },
            7: {
                color: "rgba(227, 107, 181, 0.12)",
                textColor: "rgba(227, 107, 181, 1)",
                borderColor: "rgba(227, 107, 181, 0.50)"
            },
            8: {
                color: "rgba(226, 121, 47, 0.12)",
                textColor: "rgba(226, 121, 47, 1)",
                borderColor: "rgba(226, 121, 47, 0.50)"
            },
            9: {
                color: "rgba(29, 204, 183, 0.12)",
                textColor: "rgba(29, 204, 183, 1)",
                borderColor: "rgba(29, 204, 183, 0.50)"
            }
        }[t];
    }
    function y(t) {
        const a = t ? new Date(t) : new Date, s = a.getFullYear(), d = String(a.getMonth() + 1).padStart(2, "0"), u = String(a.getDate()).padStart(2, "0");
        return `${s}-${d}-${u}`;
    }
    const w = [
        {
            label: "适任",
            labelEn: "Qualified",
            value: "Yes"
        },
        {
            label: "不适任",
            labelEn: "Unqualified",
            value: "No"
        }
    ], I = [
        {
            label: "优秀",
            labelEn: "Excellent",
            value: "1"
        },
        {
            label: "好",
            labelEn: "Fine",
            value: "2"
        },
        {
            label: "不适任",
            labelEn: "Unqualified",
            value: "3"
        }
    ], { t: i } = E(), o = _();
    $ = function() {
        return {
            columns: [
                {
                    title: i("configureForm.no"),
                    key: "",
                    width: 60,
                    render (a, s) {
                        return s + 1;
                    }
                },
                {
                    title: i("crewTraining.crewName"),
                    width: 160,
                    key: o.getLocale === "en" ? "crewNameEn" : "crewName"
                },
                {
                    title: i("configureForm.rank"),
                    key: "dutyId",
                    width: 160,
                    render: (a)=>(a.dutyId ? a.dutyId.split(",").map((u)=>+u) : []).map((u)=>{
                            const m = v.find((f)=>f.id === u);
                            return o.getLocale === "en" ? m?.shortNameEn || "" : m?.name || "";
                        }).filter((u)=>u).join(", ")
                },
                {
                    title: i("crewTraining.vesselName"),
                    width: 160,
                    key: o.getLocale === "en" ? "vesselNameEn" : "vesselName"
                },
                {
                    title: i("crewTraining.trainingType"),
                    key: "type",
                    width: 200,
                    render (a) {
                        const s = S.find((d)=>d?.value === a.type);
                        return o.getLocale === "en" ? s?.labelEn : s?.label;
                    }
                },
                {
                    title: i("crewTraining.trainingLocation"),
                    width: 160,
                    key: "trainingLocation"
                },
                {
                    title: i("crewTraining.status"),
                    key: "status",
                    width: 160,
                    render: (a)=>{
                        const s = D.find((u)=>u.value == a.status) || {
                            label: a.status,
                            labelEn: a.status
                        }, d = z(a.status);
                        return l(N, {
                            color: d,
                            bordered: !1
                        }, {
                            default: ()=>o.getLocale === "en" ? s.labelEn : s.label
                        });
                    }
                }
            ]
        };
    };
    i("crewTraining.trainingDate"), i("crewTraining.trainingLocation"), i("crewTraining.trainers");
    i("configureForm.no"), i("interview.crewName"), i("crewTraining.plannedRank"), i("crewTraining.plannedVessel");
    q = function() {
        const t = R(!1), a = [
            {
                title: i("crewTraining.evaluationContent"),
                key: o.getLocale === "en" ? "contentEn" : "contentCn"
            },
            {
                title: i("interview.result"),
                key: "isQualified",
                render (e) {
                    return l(k, {
                        value: e.isQualified,
                        disabled: t.value,
                        onUpdateValue (n) {
                            e.isQualified = n;
                        }
                    }, ()=>l(p, {}, w.map((n)=>l(b, {
                                value: n.value,
                                label: o.getLocale === "en" ? n.labelEn : n.label
                            }))));
                }
            }
        ], s = [
            {
                title: i("crewTraining.trainingContents"),
                key: o.getLocale === "en" ? "contentEn" : "contentCn"
            },
            {
                title: i("interview.result"),
                key: "isQualified",
                render (e) {
                    return e.isRemark ? l(g, {
                        style: {
                            width: "500px"
                        }
                    }, {
                        type: "textarea",
                        style: {
                            width: "100%"
                        },
                        value: e.remark,
                        disabled: t.value,
                        autosize: {
                            minRows: 2,
                            maxRows: 3
                        },
                        onUpdateValue (n) {
                            e.remark = n;
                        }
                    }) : l(k, {
                        value: e.isQualified,
                        disabled: t.value,
                        onUpdateValue (n) {
                            e.isQualified = n;
                        }
                    }, ()=>l(p, {}, w.map((n)=>l(b, {
                                value: n.value,
                                label: o.getLocale === "en" ? n.labelEn : n.label
                            }))));
                }
            }
        ], d = [
            {
                key: o.getLocale === "en" ? "titleEn" : "title",
                title: i("interview.no"),
                rowSpan: (e, n)=>n === 2 ? 2 : 1
            },
            {
                title: i("crewTraining.content"),
                key: o.getLocale === "en" ? "contentEn" : "content",
                render (e, n) {
                    const r = o.getLocale === "en" ? "contentEn" : "content";
                    return n > 11 ? l(g, {
                        style: {
                            width: "500px"
                        }
                    }, {
                        type: "textarea",
                        style: {
                            width: "100%"
                        },
                        value: e.remark,
                        disabled: t.value,
                        autosize: {
                            minRows: 2,
                            maxRows: 3
                        },
                        onUpdateValue (h) {
                            e.remark = h;
                        }
                    }) : e[r];
                }
            },
            {
                title: i("crewTraining.learningSituation"),
                key: "isQualified",
                render (e, n) {
                    if (n < 12) return l(k, {
                        value: e.isQualified,
                        disabled: t.value,
                        onUpdateValue (r) {
                            e.isQualified = r;
                        }
                    }, ()=>l(p, {}, I.map((r)=>l(b, {
                                value: r.value,
                                label: o.getLocale === "en" ? r.labelEn : r.label
                            }))));
                }
            }
        ], u = [
            {
                key: o.getLocale === "en" ? "nameContentEn" : "nameContent",
                align: "left",
                ellipsis: !0,
                width: 300
            },
            {
                key: "remark",
                align: "left",
                ellipsis: !0,
                render (e, n) {
                    return n === 1 ? l(c, {
                        value: e.remark,
                        disabled: t.value,
                        autosize: {
                            minRows: 1,
                            maxRows: 3
                        },
                        style: {
                            width: "100%"
                        },
                        onUpdateValue (r) {
                            e.remark = y(r);
                        }
                    }) : l(g, {
                        value: e.remark,
                        disabled: t.value,
                        autosize: {
                            minRows: 1,
                            maxRows: 3
                        },
                        style: {
                            width: "100%"
                        },
                        onUpdateValue (r) {
                            e.remark = r;
                        }
                    });
                }
            },
            {
                key: o.getLocale === "en" ? "titleEn" : "title",
                ellipsis: !0,
                align: "left"
            },
            {
                key: "remark2",
                align: "left",
                width: 400,
                ellipsis: !0,
                render (e, n) {
                    return n === 1 ? l(c, {
                        value: e.remark2,
                        disabled: t.value,
                        autosize: {
                            minRows: 1,
                            maxRows: 3
                        },
                        style: {
                            width: "100%"
                        },
                        onUpdateValue (r) {
                            e.remark2 = y(r);
                        }
                    }) : l(g, {
                        value: e.remark2,
                        disabled: t.value,
                        autosize: {
                            minRows: 1,
                            maxRows: 3
                        },
                        style: {
                            width: "100%"
                        },
                        onUpdateValue (r) {
                            e.remark2 = r;
                        }
                    });
                }
            }
        ], m = [
            {
                key: o.getLocale === "en" ? "nameContentEn" : "nameContent",
                align: "left",
                ellipsis: !0,
                width: 300
            },
            {
                key: "remark",
                align: "left",
                ellipsis: !0,
                colSpan: (e, n)=>n === 5 ? 3 : 1,
                render (e, n) {
                    return n === 1 ? l(c, {
                        value: e.remark,
                        disabled: t.value,
                        autosize: {
                            minRows: 1,
                            maxRows: 3
                        },
                        style: {
                            width: "100%"
                        },
                        onUpdateValue (r) {
                            e.remark = y(r);
                        }
                    }) : l(g, {
                        value: e.remark,
                        disabled: t.value,
                        autosize: {
                            minRows: 1,
                            maxRows: 3
                        },
                        style: {
                            width: "100%"
                        },
                        onUpdateValue (r) {
                            e.remark = r;
                        }
                    });
                }
            },
            {
                key: o.getLocale === "en" ? "titleEn" : "title",
                ellipsis: !0,
                align: "left"
            },
            {
                key: "remark2",
                align: "left",
                width: 400,
                ellipsis: !0,
                render (e, n) {
                    return n === 1 ? l(c, {
                        value: e.remark2,
                        disabled: t.value,
                        autosize: {
                            minRows: 1,
                            maxRows: 3
                        },
                        style: {
                            width: "100%"
                        },
                        onUpdateValue (r) {
                            e.remark2 = y(r);
                        }
                    }) : l(g, {
                        value: e.remark2,
                        disabled: t.value,
                        style: {
                            width: "100%"
                        },
                        onUpdateValue (r) {
                            e.remark2 = r;
                        }
                    });
                }
            }
        ];
        return {
            methods: {
                updateReadOnly: (e)=>{
                    t.value = e;
                }
            },
            evaluationColumns1: a,
            evaluationColumns2: s,
            sMSColumns: d,
            masterColumns: u,
            chiefColumns: m
        };
    };
});
export { q as e, $ as i, __tla };
