import { d as G, u as J, eV as K, f as Q, e as Y, r as P, a4 as Z, bl as T, aw as ee, c as n, o as a, w as e, l as o, W as oe, j as t, H as te, i as f, aI as ae, p as d, A as c, B as ne, ca as b, gW as v, gX as C, h, D as k, F as x, U as re, a9 as se, M as ie, f2 as le, cC as ce, X as pe, ii as ue, ac as N, __tla as __tla_0 } from "./index-9PRMimni.js";
import { u as me } from "./useTags-C1thGhjF.js";
import { _ as de, c as _e, __tla as __tla_1 } from "./index.vue_vue_type_script_setup_true_lang-aJ7O0bSt.js";
import { a as q, C as A } from "./helper-ICuV4Aye.js";
import { g as fe } from "./jobPlanDetails-5wu16ZE_.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import "./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";
import "./vuedraggable.umd-Co2xEC3p.js";
import "./BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js";
import "./BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.js";
import "./BasicSelect.vue_vue_type_style_index_0_scoped_772d51cc_lang-Brp6PjEU.js";
import "./index-DkvzUEqh.js";
import { __tla as __tla_2 } from "./index.vue_vue_type_style_index_0_scoped_b974e5ec_lang-_0QwzFKM.js";
import "./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";
import "./print-CT_2hrjP.js";
import { H as ye, __tla as __tla_3 } from "./index-8tHZJCCW.js";
import "./schemas-BmKi-UM9.js";
import "./props-CLtNejQT.js";
import { _ as ge } from "./index.vue_vue_type_script_setup_true_lang-JmSzb3da.js";
import "./tabsView-BXskTdVh.js";
import "./BasicForm-dL_oCSPM.js";
import "./Render.vue_vue_type_script_lang-DKUYY0Zw.js";
import "./SingleImageUpload-CNx4b9eC.js";
import "./ImageUpload-DUsnro3W.js";
import "./componentSetting-DVhNDBTO.js";
import "./BasicSelect-C_uwzMkE.js";
import "./dictionary-BRse4lkf.js";
import "./AutoComplete-Dv1Bqed4.js";
import "./TreeSelect-BZh2DeCh.js";
import "./useForm-CKmgcynv.js";
import "./usePageCache-DluHn7Yy.js";
import "./equipmentMainLibrary-bJTzj5mC.js";
import "./isEmpty-BUg1OsQj.js";
import "./propTypes-CebMRUpe.js";
import "./index-kKnqLkWM.js";
import "./jobOrder-CGbsc7bp.js";
import "./has-CjqcrIOV.js";
import "./componentMap-CElCaWis.js";
import "./format-DgF6KtHk.js";
import "./omit-B2_8Y6O_.js";
import "./_flatRest-DBrd2CHT.js";
import "./flatten-DeoUZLdb.js";
import "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./useModal-CO65vga3.js";
import "./TimelineItem-Bkds7ZW8.js";
import "./Flex-CTSf12gq.js";
import "./jobPlanExtensionDetails-Bhx4BFqn.js";
let fo;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_2;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_3;
        } catch  {}
    })()
]).then(async ()=>{
    let be, ve;
    be = {
        class: "text-[18px] font-medium",
        style: {
            color: "var(--n-text-color)"
        }
    };
    ve = {
        class: "h-[22px]"
    };
    fo = G({
        __name: "index",
        setup (Ce) {
            const B = J(), { t: r } = K(), { closeCurrent: E } = me(), p = Q(), j = Y(), M = P(!0), u = p.query.id ? Number(p.query.id) : null, S = Z(()=>p.query.terminate === "1" && p.query.type !== "view" && q === A.VESSEL), s = P(), y = T("approvalModalRef"), R = T("historyModal");
            function V() {
                y.value?.handleOpenModal({
                    type: "pass"
                });
            }
            function z() {
                y.value?.handleOpenModal({
                    type: "reject"
                });
            }
            function $() {
                ue({
                    busId: u,
                    moduleCode: "jobPlanCancel",
                    subModuleCode: s.value?.subModuleCode
                }).then(()=>{
                    B.success(r("jobPlan.viewDetails.terminateSuccess")), w();
                });
            }
            function F() {
                R.value?.handleOpenModal();
            }
            async function H() {
                u && (s.value = await fe(u), M.value = s.value?.canApprove === !1 || p.query.type === "view");
            }
            function w() {
                const D = "PMS_jobPlan", i = p.query?.sourceRouteName;
                try {
                    E(), i && N(()=>{
                        j.replace({
                            name: i
                        });
                    });
                } catch (l) {
                    console.warn("Error closing tab:", l), N(()=>{
                        j.replace({
                            name: D
                        });
                    });
                }
            }
            return ee(()=>{
                H();
            }), (D, i)=>{
                const l = ne, m = ae, g = te, L = le, O = ie, W = re, I = oe, U = ce, X = pe;
                return a(), n(X, null, {
                    default: e(()=>[
                            o(u) ? (a(), n(I, {
                                key: 0,
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: e(()=>[
                                        t(g, {
                                            class: "mb-4",
                                            justify: "space-between"
                                        }, {
                                            default: e(()=>[
                                                    t(g, null, {
                                                        default: e(()=>[
                                                                t(m, {
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: e(()=>[
                                                                            t(l, {
                                                                                type: "text",
                                                                                class: "size-7",
                                                                                onClick: w
                                                                            }, {
                                                                                icon: e(()=>[
                                                                                        (a(), n(b(o(v)(o(C).back, "text-[14px]"))))
                                                                                    ]),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: e(()=>[
                                                                            d(" " + c(o(r)("common.backText")), 1)
                                                                        ]),
                                                                    _: 1
                                                                }),
                                                                f("h1", be, c(o(r)("common.menu.jobPlanCancelDetails")), 1)
                                                            ]),
                                                        _: 1
                                                    }),
                                                    t(g, null, {
                                                        default: e(()=>[
                                                                !M.value && o(q) === o(A).OFFICE ? (a(), h(x, {
                                                                    key: 0
                                                                }, [
                                                                    t(m, {
                                                                        trigger: "hover"
                                                                    }, {
                                                                        trigger: e(()=>[
                                                                                t(l, {
                                                                                    type: "primary",
                                                                                    strong: "",
                                                                                    bordered: "",
                                                                                    secondary: "",
                                                                                    class: "size-7",
                                                                                    onClick: V
                                                                                }, {
                                                                                    icon: e(()=>i[0] || (i[0] = [
                                                                                            f("i", {
                                                                                                class: "iconfont icon-Approve text-[#0ec06a]"
                                                                                            }, null, -1)
                                                                                        ])),
                                                                                    _: 1
                                                                                })
                                                                            ]),
                                                                        default: e(()=>[
                                                                                d(" " + c(o(r)("jobPlan.viewDetails.btnApprove")), 1)
                                                                            ]),
                                                                        _: 1
                                                                    }),
                                                                    t(m, {
                                                                        trigger: "hover"
                                                                    }, {
                                                                        trigger: e(()=>[
                                                                                t(l, {
                                                                                    type: "primary",
                                                                                    strong: "",
                                                                                    bordered: "",
                                                                                    secondary: "",
                                                                                    class: "size-7",
                                                                                    onClick: z
                                                                                }, {
                                                                                    icon: e(()=>i[1] || (i[1] = [
                                                                                            f("i", {
                                                                                                class: "iconfont icon-Returned text-[#0ec06a]"
                                                                                            }, null, -1)
                                                                                        ])),
                                                                                    _: 1
                                                                                })
                                                                            ]),
                                                                        default: e(()=>[
                                                                                d(" " + c(o(r)("jobPlan.viewDetails.btnReject")), 1)
                                                                            ]),
                                                                        _: 1
                                                                    })
                                                                ], 64)) : k("", !0),
                                                                o(S) ? (a(), n(m, {
                                                                    key: 1,
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: e(()=>[
                                                                            t(l, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-7",
                                                                                onClick: $
                                                                            }, {
                                                                                icon: e(()=>[
                                                                                        (a(), n(b(o(v)(o(C).terminate, "text-[#0ec06a]"))))
                                                                                    ]),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: e(()=>[
                                                                            d(" " + c(o(r)("jobPlan.viewDetails.btnTerminate")), 1)
                                                                        ]),
                                                                    _: 1
                                                                })) : k("", !0),
                                                                t(m, {
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: e(()=>[
                                                                            t(l, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-7",
                                                                                onClick: F
                                                                            }, {
                                                                                icon: e(()=>[
                                                                                        (a(), n(b(o(v)(o(C).log, "text-[#0ec06a]"))))
                                                                                    ]),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: e(()=>[
                                                                            d(" " + c(o(r)("jobPlan.viewDetails.history")), 1)
                                                                        ]),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        }),
                                        s.value ? (a(), n(de, {
                                            key: 0,
                                            data: s.value
                                        }, null, 8, [
                                            "data"
                                        ])) : (a(), n(W, {
                                            key: 1,
                                            "x-gap": 8,
                                            "y-gap": 16,
                                            cols: 5
                                        }, {
                                            default: e(()=>[
                                                    (a(!0), h(x, null, se(o(_e)(), (_)=>(a(), n(O, {
                                                            key: _.field,
                                                            span: _.giProps?.span
                                                        }, {
                                                            default: e(()=>[
                                                                    _.hidden ? k("", !0) : (a(), h(x, {
                                                                        key: 0
                                                                    }, [
                                                                        f("div", ve, c(_.label), 1),
                                                                        t(L, {
                                                                            class: "text-[#fafafc]",
                                                                            height: 58,
                                                                            sharp: !1
                                                                        })
                                                                    ], 64))
                                                                ]),
                                                            _: 2
                                                        }, 1032, [
                                                            "span"
                                                        ]))), 128))
                                                ]),
                                            _: 1
                                        })),
                                        t(o(ye), {
                                            ref_key: "historyModal",
                                            ref: R,
                                            busId: o(u),
                                            moduleCode: "jobPlanCancel"
                                        }, null, 8, [
                                            "busId"
                                        ]),
                                        t(ge, {
                                            ref_key: "approvalModalRef",
                                            ref: y,
                                            busId: o(u),
                                            jobCode: s.value?.jobCode,
                                            moduleCode: s.value?.moduleCode
                                        }, null, 8, [
                                            "busId",
                                            "jobCode",
                                            "moduleCode"
                                        ])
                                    ]),
                                _: 1
                            })) : (a(), n(I, {
                                key: 1,
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: e(()=>[
                                        t(U, {
                                            class: "h-full",
                                            description: "No Cancel ID provided in the query parameters."
                                        })
                                    ]),
                                _: 1
                            }))
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { fo as default, __tla };
