import { d as N, V as O, r, c as n, o as a, w as t, j as c, l as e, D as l, H as X, aI as L, p as k, A as w, B as W, ca as h, gW as S, gX as b, X as $, ac as j, __tla as __tla_0 } from "./index-9PRMimni.js";
import { c as A, __tla as __tla_1 } from "./columns-DY6kUOTk.js";
import { B as F } from "./Table-0PViRYCf.js";
let J;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    let H;
    H = {
        name: "CrewCertificatesChecklist"
    };
    J = N({
        ...H,
        props: {
            readonly: {
                type: Boolean,
                default: !1
            }
        },
        setup (x, { expose: B }) {
            const { t: i } = O(), T = x, s = r(), u = r([]), o = r(), I = r(T.readonly), d = r([]), p = A(), { methods: { updateIsEdit: _ } } = p;
            function D() {
                o.value = !0, _(e(o));
            }
            function m() {
                o.value = !1, _(e(o));
            }
            function R() {
                return s.value?.getDataSource();
            }
            function V(f) {
                m(), s.value?.setStriped(!1), s.value?.setBordered(!0), u.value = f, d.value = p.CrewCertificatesChecklistColumns, j(()=>{
                    s.value?.reload();
                });
            }
            return B({
                handleOpen: V,
                voList: R
            }), (f, g)=>{
                const y = W, v = L, z = X, E = $;
                return a(), n(E, null, {
                    default: t(()=>[
                            c(e(F), {
                                ref_key: "crew2TableRef",
                                ref: s,
                                columns: e(d),
                                dataSource: e(u),
                                "row-key": (C)=>C.id,
                                autoScrollX: !0,
                                immediate: !1,
                                pagination: !1,
                                "can-resize": !1,
                                "show-table-setting": !1
                            }, {
                                toolbar: t(()=>[
                                        e(I) ? l("", !0) : (a(), n(z, {
                                            key: 0,
                                            reverse: ""
                                        }, {
                                            default: t(()=>[
                                                    e(o) ? l("", !0) : (a(), n(v, {
                                                        key: 0,
                                                        trigger: "hover"
                                                    }, {
                                                        trigger: t(()=>[
                                                                c(y, {
                                                                    type: "primary",
                                                                    strong: "",
                                                                    bordered: "",
                                                                    secondary: "",
                                                                    class: "size-7",
                                                                    onClick: D
                                                                }, {
                                                                    icon: t(()=>[
                                                                            (a(), n(h(e(S)(e(b).edit))))
                                                                        ]),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        default: t(()=>[
                                                                k(" " + w(e(i)("common.optionsEditText")), 1)
                                                            ]),
                                                        _: 1
                                                    })),
                                                    e(o) ? (a(), n(v, {
                                                        key: 1,
                                                        trigger: "hover"
                                                    }, {
                                                        trigger: t(()=>[
                                                                c(y, {
                                                                    type: "primary",
                                                                    strong: "",
                                                                    bordered: "",
                                                                    secondary: "",
                                                                    class: "size-7",
                                                                    onClick: g[0] || (g[0] = (C)=>m())
                                                                }, {
                                                                    icon: t(()=>[
                                                                            (a(), n(h(e(S)(e(b).save))))
                                                                        ]),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        default: t(()=>[
                                                                k(" " + w(e(i)("common.saveText")), 1)
                                                            ]),
                                                        _: 1
                                                    })) : l("", !0)
                                                ]),
                                            _: 1
                                        }))
                                    ]),
                                _: 1
                            }, 8, [
                                "columns",
                                "dataSource",
                                "row-key"
                            ])
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { J as _, __tla };
