import { d as G, u as J, eV as K, f as Q, e as Y, r as I, a4 as Z, bl as T, aw as ee, c as n, o as a, w as o, l as e, W as oe, j as t, H as te, i as E, aI as ae, p as m, A as l, B as ne, ca as d, gW as _, gX as f, h, D as C, F as x, U as re, a9 as se, M as ie, f2 as le, cC as pe, X as ce, 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 P, C as q } from "./helper-ICuV4Aye.js";
import { t 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-BVez9b-m.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 (he) {
            const B = J(), { t: s } = K(), { closeCurrent: S } = me(), p = Q(), k = Y(), M = I(!0), c = p.query.extensionId ? Number(p.query.extensionId) : null, V = Z(()=>p.query.terminate === "1" && p.query.type !== "view" && P === q.VESSEL), r = I(), g = T("approvalModalRef"), R = T("historyModal");
            function A() {
                g.value?.handleOpenModal({
                    type: "pass"
                });
            }
            function z() {
                g.value?.handleOpenModal({
                    type: "reject"
                });
            }
            function $() {
                ue({
                    busId: c,
                    moduleCode: r.value?.moduleCode,
                    subModuleCode: r.value?.subModuleCode
                }).then(()=>{
                    B.success(s("jobPlan.viewDetails.terminateSuccess")), j();
                });
            }
            function F() {
                R.value?.handleOpenModal();
            }
            async function H() {
                c && (r.value = await fe(c), M.value = r.value?.canApprove === !1 || p.query.type === "view");
            }
            function j() {
                const w = "PMS_jobPlan", b = p.query?.sourceRouteName;
                try {
                    S(), b && N(()=>{
                        k.replace({
                            name: b
                        });
                    });
                } catch (i) {
                    console.warn("Error closing tab:", i), N(()=>{
                        k.replace({
                            name: w
                        });
                    });
                }
            }
            return ee(()=>{
                H();
            }), (w, b)=>{
                const i = ne, u = ae, v = te, L = le, O = ie, W = re, D = oe, U = pe, X = ce;
                return a(), n(X, null, {
                    default: o(()=>[
                            e(c) ? (a(), n(D, {
                                key: 0,
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: o(()=>[
                                        t(v, {
                                            class: "mb-4",
                                            justify: "space-between"
                                        }, {
                                            default: o(()=>[
                                                    t(v, null, {
                                                        default: o(()=>[
                                                                t(u, {
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: o(()=>[
                                                                            t(i, {
                                                                                type: "text",
                                                                                class: "size-7",
                                                                                onClick: j
                                                                            }, {
                                                                                icon: o(()=>[
                                                                                        (a(), n(d(e(_)(e(f).back, "text-[14px]"))))
                                                                                    ]),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: o(()=>[
                                                                            m(" " + l(e(s)("common.backText")), 1)
                                                                        ]),
                                                                    _: 1
                                                                }),
                                                                E("h1", be, l(e(s)("common.menu.jobPlanExtensionDetails")), 1)
                                                            ]),
                                                        _: 1
                                                    }),
                                                    t(v, null, {
                                                        default: o(()=>[
                                                                !M.value && e(P) === e(q).OFFICE ? (a(), h(x, {
                                                                    key: 0
                                                                }, [
                                                                    t(u, {
                                                                        trigger: "hover"
                                                                    }, {
                                                                        trigger: o(()=>[
                                                                                t(i, {
                                                                                    type: "primary",
                                                                                    strong: "",
                                                                                    bordered: "",
                                                                                    secondary: "",
                                                                                    class: "size-7",
                                                                                    onClick: A
                                                                                }, {
                                                                                    icon: o(()=>[
                                                                                            (a(), n(d(e(_)(e(f).approve, "text-[#0ec06a]"))))
                                                                                        ]),
                                                                                    _: 1
                                                                                })
                                                                            ]),
                                                                        default: o(()=>[
                                                                                m(" " + l(e(s)("jobPlan.viewDetails.btnApprove")), 1)
                                                                            ]),
                                                                        _: 1
                                                                    }),
                                                                    t(u, {
                                                                        trigger: "hover"
                                                                    }, {
                                                                        trigger: o(()=>[
                                                                                t(i, {
                                                                                    type: "primary",
                                                                                    strong: "",
                                                                                    bordered: "",
                                                                                    secondary: "",
                                                                                    class: "size-7",
                                                                                    onClick: z
                                                                                }, {
                                                                                    icon: o(()=>[
                                                                                            (a(), n(d(e(_)(e(f).returned, "text-[#0ec06a]"))))
                                                                                        ]),
                                                                                    _: 1
                                                                                })
                                                                            ]),
                                                                        default: o(()=>[
                                                                                m(" " + l(e(s)("jobPlan.viewDetails.btnReject")), 1)
                                                                            ]),
                                                                        _: 1
                                                                    })
                                                                ], 64)) : C("", !0),
                                                                e(V) ? (a(), n(u, {
                                                                    key: 1,
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: o(()=>[
                                                                            t(i, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-7",
                                                                                onClick: $
                                                                            }, {
                                                                                icon: o(()=>[
                                                                                        (a(), n(d(e(_)(e(f).terminate, "text-[#0ec06a]"))))
                                                                                    ]),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: o(()=>[
                                                                            m(" " + l(e(s)("jobPlan.viewDetails.btnTerminate")), 1)
                                                                        ]),
                                                                    _: 1
                                                                })) : C("", !0),
                                                                t(u, {
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: o(()=>[
                                                                            t(i, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-7",
                                                                                onClick: F
                                                                            }, {
                                                                                icon: o(()=>[
                                                                                        (a(), n(d(e(_)(e(f).log, "text-[#0ec06a]"))))
                                                                                    ]),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: o(()=>[
                                                                            m(" " + l(e(s)("jobPlan.viewDetails.history")), 1)
                                                                        ]),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        }),
                                        r.value ? (a(), n(de, {
                                            key: 0,
                                            data: r.value
                                        }, null, 8, [
                                            "data"
                                        ])) : (a(), n(W, {
                                            key: 1,
                                            "x-gap": 8,
                                            "y-gap": 16,
                                            cols: 5
                                        }, {
                                            default: o(()=>[
                                                    (a(!0), h(x, null, se(e(_e)(), (y)=>(a(), n(O, {
                                                            key: y.field,
                                                            span: y.giProps?.span
                                                        }, {
                                                            default: o(()=>[
                                                                    y.hidden ? C("", !0) : (a(), h(x, {
                                                                        key: 0
                                                                    }, [
                                                                        E("div", ve, l(y.label), 1),
                                                                        t(L, {
                                                                            class: "text-[#fafafc]",
                                                                            height: 58,
                                                                            sharp: !1
                                                                        })
                                                                    ], 64))
                                                                ]),
                                                            _: 2
                                                        }, 1032, [
                                                            "span"
                                                        ]))), 128))
                                                ]),
                                            _: 1
                                        })),
                                        t(e(ye), {
                                            ref_key: "historyModal",
                                            ref: R,
                                            busId: e(c),
                                            moduleCode: r.value?.moduleCode
                                        }, null, 8, [
                                            "busId",
                                            "moduleCode"
                                        ]),
                                        t(ge, {
                                            ref_key: "approvalModalRef",
                                            ref: g,
                                            busId: e(c),
                                            jobCode: r.value?.jobCode,
                                            moduleCode: r.value?.moduleCode
                                        }, null, 8, [
                                            "busId",
                                            "jobCode",
                                            "moduleCode"
                                        ])
                                    ]),
                                _: 1
                            })) : (a(), n(D, {
                                key: 1,
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: o(()=>[
                                        t(U, {
                                            class: "h-full",
                                            description: "No Extension ID provided in the query parameters."
                                        })
                                    ]),
                                _: 1
                            }))
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { fo as default, __tla };
