import { _ as __nuxt_component_49 } from './MainLoader-BFnVrwHB.mjs';
import { i as useLocalePath, u as useI18n, g as useRoute, h as useRouter, b as useNuxtApp, d as useLazyAsyncData, f as useRuntimeConfig, j as _sfc_main$3, m as useToast, P as POSITION, _ as _sfc_main$g, F as Form, n as __nuxt_component_1, o as _sfc_main$9, p as _sfc_main$7 } from './server.mjs';
import { _ as _sfc_main$4 } from './MetaTags-C8KDkLj_.mjs';
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderClass, ssrInterpolate, ssrRenderList, ssrRenderAttr, ssrIncludeBooleanAttr } from 'vue/server-renderer';
import { p as publicAssetsURL } from '../_/nitro.mjs';
import { withAsyncContext, watch, mergeProps, unref, useSSRContext, ref, withCtx, createVNode, toDisplayString, openBlock, createBlock } from 'vue';
import _sfc_main$5 from './BlogSocialMedia-Cj3AFZC1.mjs';
import * as yup from 'yup';
import 'unhead';
import '@unhead/shared';
import 'vue-router';
import 'vue-social-sharing';
import 'axios';
import '@headlessui/vue';
import 'node:http';
import 'node:https';
import 'node:fs';
import 'node:url';
import 'ipx';
import 'node:path';
import './components-BFogvFSQ.mjs';

const _imports_0$1 = publicAssetsURL("/listLogo.svg");
const _sfc_main$2 = {
  __name: "CareerDescription",
  __ssrInlineRender: true,
  props: {
    title: {
      required: true
    },
    items: {
      required: true
    }
  },
  setup(__props) {
    return (_ctx, _push, _parent, _attrs) => {
      var _a;
      _push(`<div${ssrRenderAttrs(_attrs)}><h2 class="text-2xl leading-[2.2rem] md:text-4xl font-semibold mb-3 md:leading-[3.5rem] text-text">${ssrInterpolate(__props.title)}</h2>`);
      if (typeof __props.items == "object") {
        _push(`<ul class="list-image"><!--[-->`);
        ssrRenderList(__props.items, (item) => {
          _push(`<li class="max-w-[600px]"><img width="22" height="22"${ssrRenderAttr("src", _imports_0$1)} alt="logo" class="object-contain"><p>${ssrInterpolate(item.description)}</p></li>`);
        });
        _push(`<!--]--></ul>`);
      } else {
        _push(`<div>${(_a = __props.items) != null ? _a : ""}</div>`);
      }
      _push(`</div>`);
    };
  }
};
const _sfc_setup$2 = _sfc_main$2.setup;
_sfc_main$2.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/career/CareerDescription.vue");
  return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
};
const _imports_0 = "data:image/svg+xml,%3csvg%20width='33'%20height='35'%20viewBox='0%200%2033%2035'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.84285%2017.034C4.75411%2017.034%203.78771%2017.5232%203.14513%2018.306L3.10873%2018.3503L3.08687%2018.3722C2.55665%2019.0612%202.26879%2019.9444%202.36066%2020.8975L2.36157%2020.907L2.98513%2028.7015C3.11172%2029.9905%203.21638%2030.6454%203.55932%2031.0735C3.82723%2031.4079%204.47304%2031.8454%206.46649%2031.8454H26.08C28.0734%2031.8454%2028.7193%2031.4079%2028.9872%2031.0735C29.3301%2030.6453%2029.4348%2029.9905%2029.5614%2028.7014L30.1854%2020.9008L30.1871%2020.8851C30.2914%2019.9118%2029.9824%2019.0212%2029.4056%2018.3267L29.2415%2018.1291C28.6153%2017.4589%2027.7181%2017.034%2026.7036%2017.034H5.84285ZM29.4471%2018.3597C29.4563%2018.3689%2029.4529%2018.366%2029.442%2018.3546L29.4471%2018.3597ZM1.37619%2016.7755C2.44872%2015.4962%204.05329%2014.6953%205.84285%2014.6953H26.7036C28.4992%2014.6953%2030.0904%2015.5013%2031.1458%2016.7527C31.1659%2016.7744%2031.197%2016.8096%2031.2309%2016.8547C31.2427%2016.8704%2031.2603%2016.8944%2031.2808%2016.9261C32.181%2018.0555%2032.6806%2019.5226%2032.5142%2021.1177L31.8909%2028.9089L31.8899%2028.9193C31.8853%2028.9656%2031.8808%2029.0126%2031.8762%2029.0601C31.7727%2030.1312%2031.6401%2031.5023%2030.8124%2032.5356C29.872%2033.7095%2028.3117%2034.1841%2026.08%2034.1841H6.46649C4.23477%2034.1841%202.67446%2033.7095%201.73406%2032.5356C0.906362%2031.5023%200.77383%2030.1312%200.670295%2029.0601C0.665698%2029.0126%200.661157%2028.9656%200.656616%2028.9193L0.655595%2028.9089L0.0318369%2021.1119C-0.120543%2019.5032%200.386181%2018.0082%201.29554%2016.8667L1.33665%2016.8151L1.37619%2016.7755Z'%20fill='%2329398C'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.1726%204.03234C4.55053%204.65441%204.18985%205.84762%204.18985%208.50645V16.5358C4.18985%2017.1816%203.66633%2017.7051%203.02052%2017.7051C2.37472%2017.7051%201.8512%2017.1816%201.8512%2016.5358V8.50645C1.8512%205.86433%202.15314%203.74445%203.51892%202.37866C4.8847%201.01288%207.00459%200.710938%209.64671%200.710938H11.6268C12.7219%200.710938%2013.5713%200.872368%2014.2812%201.29891C14.9374%201.69321%2015.3598%202.25736%2015.7015%202.71375C15.7154%202.73234%2015.7291%202.75074%2015.7428%202.76895L15.7441%202.77072L17.7208%205.41669C17.9986%205.78115%2018.0665%205.84982%2018.1441%205.89684C18.1908%205.92519%2018.3543%206.01189%2018.9078%206.01189H22.8835C25.5256%206.01189%2027.6455%206.31383%2029.0113%207.67961C30.3771%209.04539%2030.679%2011.1653%2030.679%2013.8074V16.5981C30.679%2017.2439%2030.1555%2017.7675%2029.5097%2017.7675C28.8639%2017.7675%2028.3404%2017.2439%2028.3404%2016.5981V13.8074C28.3404%2011.1486%2027.9797%209.95536%2027.3576%209.33329C26.7355%208.71122%2025.5423%208.35054%2022.8835%208.35054H18.9078C18.136%208.35054%2017.4888%208.23456%2016.9314%207.89651C16.4391%207.59796%2016.119%207.17527%2015.901%206.88735C15.886%206.86746%2015.8714%206.84821%2015.8573%206.82969L15.8506%206.82086L13.8719%204.17215C13.8716%204.17181%2013.8714%204.17148%2013.8711%204.17115C13.4723%203.63943%2013.3018%203.43878%2013.0767%203.30353C12.8784%203.18439%2012.5117%203.04959%2011.6268%203.04959H9.64671C6.98788%203.04959%205.79467%203.41027%205.1726%204.03234Z'%20fill='%2329398C'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11.0968%2025.2201C11.0968%2024.5743%2011.6203%2024.0508%2012.2661%2024.0508H20.2799C20.9257%2024.0508%2021.4492%2024.5743%2021.4492%2025.2201C21.4492%2025.8659%2020.9257%2026.3894%2020.2799%2026.3894H12.2661C11.6203%2026.3894%2011.0968%2025.8659%2011.0968%2025.2201Z'%20fill='%2329398C'/%3e%3c/svg%3e";
const _sfc_main$1 = {
  __name: "CareerForm",
  __ssrInlineRender: true,
  props: {
    items: {
      required: false
    },
    options: {
      required: false
    },
    id: {
      required: false
    },
    name: {
      required: false
    },
    placeholder: {
      required: false
    }
  },
  setup(__props) {
    useRoute();
    const props = __props;
    const toast = useToast();
    const config = useRuntimeConfig();
    const i18n = useI18n();
    const phone_code = ref(null);
    ref(null);
    const upload_data_name = ref(null);
    const schema = yup.object({
      full_name: yup.string().required(i18n.t("FORMS.Validation.name")),
      email: yup.string().email(i18n.t("FORMS.Validation.validEmail")).required(i18n.t("FORMS.Validation.email")),
      phone: yup.string().required(i18n.t("FORMS.Validation.phone")),
      // jobTitle: yup.object().required(i18n.t("FORMS.Validation.jobTitle")),
      message: yup.string().required(i18n.t("FORMS.Validation.message")),
      cv_pdf: yup.string().required(i18n.t("FORMS.Validation.cv_pdf"))
    });
    function getPhoneCode(e, s) {
      phone_code.value = e;
    }
    function getUploadData(e, s) {
      upload_data_name.value = e.target.files[0].name;
    }
    const btnLoading = ref(false);
    function onSubmit(e, actions) {
      btnLoading.value = true;
      const SUBMITDATA = new FormData();
      SUBMITDATA.append(`email`, e.email);
      SUBMITDATA.append("fullname", e.full_name);
      SUBMITDATA.append("phone", e.phone);
      SUBMITDATA.append("message", e.message);
      SUBMITDATA.append("job_title", e.jobTitle);
      SUBMITDATA.append("cv", e.cv_pdf);
      SUBMITDATA.append("phone_code", phone_code.value.phone_code);
      SUBMITDATA.append("career_id", props.id);
      $fetch("career/apply", {
        method: "POST",
        body: SUBMITDATA,
        baseURL: config.public.baseURL,
        headers: {
          "Accept-Language": i18n.locale.value
        }
      }).then((res) => {
        btnLoading.value = false;
        actions.resetForm();
        toast.success(res.message, {
          timeout: 2e3,
          position: i18n.locale.value == "en" ? POSITION.BOTTOM_RIGHT : POSITION.BOTTOM_LEFT
        });
      }).catch((err) => {
        btnLoading.value = false;
        toast.error(err.response._data.message, {
          timeout: 2e3,
          position: i18n.locale.value == "en" ? POSITION.BOTTOM_RIGHT : POSITION.BOTTOM_LEFT
        });
      });
    }
    ref([]);
    return (_ctx, _push, _parent, _attrs) => {
      const _component_nuxt_img = _sfc_main$g;
      const _component_VeeForm = Form;
      const _component_inputs_base = __nuxt_component_1;
      const _component_inputs_phone = _sfc_main$9;
      const _component_inputs_textarea = _sfc_main$7;
      _push(`<div${ssrRenderAttrs(mergeProps({ class: "container min-h-fit py-[5%]" }, _attrs))}><div class="careerForm"><div class="lg:pe-20 lg:ps-9 text-center space-y-3 mb-[20px]"><div class="bg-[#29398C] w-fit p-4 rounded-full m-auto">`);
      _push(ssrRenderComponent(_component_nuxt_img, {
        src: "careerIcon.svg",
        class: "m-auto",
        width: "20",
        height: "20",
        alt: ""
      }, null, _parent));
      _push(`</div><h1 class="text-4xl lg:text-5xl lg:leading-[3.5rem] 2xl:text-7 font-bold text-primary">${ssrInterpolate(_ctx.$t("TITLES.joinTeam"))}</h1></div>`);
      _push(ssrRenderComponent(_component_VeeForm, {
        as: "div",
        onSubmit,
        "validation-schema": unref(schema)
      }, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`<form class="careerForm lg:grid lg:grid-cols-2 grid-cols-1 gap-6 space-y-5 lg:space-y-0"${_scopeId}>`);
            _push2(ssrRenderComponent(_component_inputs_base, {
              id: "full_name",
              name: "full_name",
              placeholder: _ctx.$t("FORMS.Placeholders.fullName")
            }, null, _parent2, _scopeId));
            _push2(ssrRenderComponent(_component_inputs_phone, {
              onCode_change: ($event) => getPhoneCode($event, unref(schema)),
              placeholder: _ctx.$t("FORMS.Placeholders.yourPhone"),
              phoneColor: "color:black !important"
            }, null, _parent2, _scopeId));
            _push2(ssrRenderComponent(_component_inputs_base, {
              id: "email_address",
              name: "email",
              type: "email",
              placeholder: _ctx.$t("FORMS.Placeholders.email")
            }, null, _parent2, _scopeId));
            _push2(ssrRenderComponent(_component_inputs_base, {
              id: "jobTitle",
              name: "jobTitle",
              placeholder: _ctx.$t("FORMS.Placeholders.jobTitle")
            }, null, _parent2, _scopeId));
            _push2(`<div class="custom-file-upload"${_scopeId}>`);
            _push2(ssrRenderComponent(_component_inputs_base, {
              type: "file",
              accept: ".pdf, .doc, .docx",
              id: "cv_pdf",
              name: "cv_pdf",
              onChange: ($event) => getUploadData($event, unref(schema)),
              placeholder: _ctx.$t("FORMS.Placeholders.uploadCv")
            }, null, _parent2, _scopeId));
            _push2(`<label for="cv_pdf" class="text-center space-y-3 pb-4 block cursor-pointer"${_scopeId}><p class="text-[#8F98C5] text-lg font-medium text-start p-2 pl-4"${_scopeId}>${ssrInterpolate(_ctx.$t("FORMS.Placeholders.uploadCv"))}</p>`);
            if (unref(upload_data_name)) {
              _push2(`<p class="text-text font-bold text-xl text-center p-2 pl-4"${_scopeId}>${ssrInterpolate(unref(upload_data_name))}</p>`);
            } else {
              _push2(`<img${ssrRenderAttr("src", _imports_0)} class="m-auto" alt="uploadCV"${_scopeId}>`);
            }
            _push2(`<p${_scopeId}>${ssrInterpolate(_ctx.$t("TITLES.uploadDescription"))}</p></label></div>`);
            _push2(ssrRenderComponent(_component_inputs_textarea, {
              rows: "4",
              id: "message",
              name: "message",
              class: "careerTextArea",
              placeholder: _ctx.$t("FORMS.Placeholders.TypeYourMessageHere")
            }, null, _parent2, _scopeId));
            _push2(`<div class="flex items-center justify-between col-span-2"${_scopeId}><button${ssrIncludeBooleanAttr(unref(btnLoading)) ? " disabled" : ""} class="m-auto base-btn" type="submit"${_scopeId}>${ssrInterpolate(_ctx.$t("BUTTONS.send"))}</button></div></form>`);
          } else {
            return [
              createVNode("form", { class: "careerForm lg:grid lg:grid-cols-2 grid-cols-1 gap-6 space-y-5 lg:space-y-0" }, [
                createVNode(_component_inputs_base, {
                  id: "full_name",
                  name: "full_name",
                  placeholder: _ctx.$t("FORMS.Placeholders.fullName")
                }, null, 8, ["placeholder"]),
                createVNode(_component_inputs_phone, {
                  onCode_change: ($event) => getPhoneCode($event, unref(schema)),
                  placeholder: _ctx.$t("FORMS.Placeholders.yourPhone"),
                  phoneColor: "color:black !important"
                }, null, 8, ["onCode_change", "placeholder"]),
                createVNode(_component_inputs_base, {
                  id: "email_address",
                  name: "email",
                  type: "email",
                  placeholder: _ctx.$t("FORMS.Placeholders.email")
                }, null, 8, ["placeholder"]),
                createVNode(_component_inputs_base, {
                  id: "jobTitle",
                  name: "jobTitle",
                  placeholder: _ctx.$t("FORMS.Placeholders.jobTitle")
                }, null, 8, ["placeholder"]),
                createVNode("div", { class: "custom-file-upload" }, [
                  createVNode(_component_inputs_base, {
                    type: "file",
                    accept: ".pdf, .doc, .docx",
                    id: "cv_pdf",
                    name: "cv_pdf",
                    onChange: ($event) => getUploadData($event, unref(schema)),
                    placeholder: _ctx.$t("FORMS.Placeholders.uploadCv")
                  }, null, 8, ["onChange", "placeholder"]),
                  createVNode("label", {
                    for: "cv_pdf",
                    class: "text-center space-y-3 pb-4 block cursor-pointer"
                  }, [
                    createVNode("p", { class: "text-[#8F98C5] text-lg font-medium text-start p-2 pl-4" }, toDisplayString(_ctx.$t("FORMS.Placeholders.uploadCv")), 1),
                    unref(upload_data_name) ? (openBlock(), createBlock("p", {
                      key: 0,
                      class: "text-text font-bold text-xl text-center p-2 pl-4"
                    }, toDisplayString(unref(upload_data_name)), 1)) : (openBlock(), createBlock("img", {
                      key: 1,
                      src: _imports_0,
                      class: "m-auto",
                      alt: "uploadCV"
                    })),
                    createVNode("p", null, toDisplayString(_ctx.$t("TITLES.uploadDescription")), 1)
                  ])
                ]),
                createVNode(_component_inputs_textarea, {
                  rows: "4",
                  id: "message",
                  name: "message",
                  class: "careerTextArea",
                  placeholder: _ctx.$t("FORMS.Placeholders.TypeYourMessageHere")
                }, null, 8, ["placeholder"]),
                createVNode("div", { class: "flex items-center justify-between col-span-2" }, [
                  createVNode("button", {
                    disabled: unref(btnLoading),
                    class: "m-auto base-btn",
                    type: "submit"
                  }, toDisplayString(_ctx.$t("BUTTONS.send")), 9, ["disabled"])
                ])
              ])
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(`</div></div>`);
    };
  }
};
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/career/CareerForm.vue");
  return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const _sfc_main = {
  __name: "index",
  __ssrInlineRender: true,
  async setup(__props) {
    let __temp, __restore;
    const localePath = useLocalePath();
    const config = useRuntimeConfig();
    const { locale } = useI18n();
    const route = useRoute();
    const router = useRouter();
    const axios = useNuxtApp().$axios;
    const { data: pageData, error, pending } = ([__temp, __restore] = withAsyncContext(() => useLazyAsyncData(
      `career`,
      () => axios.get(`career/${encodeURI(route.params.slug)}`, {
        baseURL: config.public.baseURL,
        headers: {
          "Accept-Language": locale.value
        }
      }).then((res) => res.data.data).catch((err) => err)
    )), __temp = await __temp, __restore(), __temp);
    watch(
      () => pageData.value,
      (newVal, old) => {
        if (old && old.id == newVal.id) {
          if (route.params.slug != newVal.slug) {
            router.push(localePath(`/careers/${newVal.slug}`));
          }
        }
      },
      {
        immediate: true,
        deep: true
      }
    );
    return (_ctx, _push, _parent, _attrs) => {
      var _a;
      const _component_MainLoader = __nuxt_component_49;
      const _component_NotFound = _sfc_main$3;
      const _component_meta_tags = _sfc_main$4;
      const _component_career_description = _sfc_main$2;
      const _component_blog_social_media = _sfc_main$5;
      const _component_career_form = _sfc_main$1;
      _push(`<div${ssrRenderAttrs(mergeProps({ class: "container py-11" }, _attrs))}>`);
      if (unref(pending)) {
        _push(ssrRenderComponent(_component_MainLoader, null, null, _parent));
      } else {
        _push(`<!---->`);
      }
      if (unref(error)) {
        _push(ssrRenderComponent(_component_NotFound, null, null, _parent));
      } else {
        _push(`<!---->`);
      }
      if (unref(pageData)) {
        _push(`<!--[-->`);
        _push(ssrRenderComponent(_component_meta_tags, {
          metas: unref(pageData).meta
        }, null, _parent));
        _push(`<div class="flex items-center gap-2 mb-5"><i class="${ssrRenderClass([unref(pageData).icon, "flex justify-center items-center rounded-full bg-[#3578ff] text-white w-11 h-11 mt-3"])}"></i><h1 class="text-2xl leading-[2.2rem] md:text-4xl font-bold md:leading-[3.5rem]">${ssrInterpolate(unref(pageData).title)}</h1></div><div class="flex lg:flex-row flex-col mb-11 gap-8"><div class="border rounded-3xl p-5 md:p-10 lg:w-[90%] space-y-4">`);
        if (unref(pageData).description) {
          _push(ssrRenderComponent(_component_career_description, {
            title: _ctx.$t("TITLES.jobDescription"),
            items: unref(pageData).description
          }, null, _parent));
        } else {
          _push(`<!---->`);
        }
        if (unref(pageData).responsibilities) {
          _push(ssrRenderComponent(_component_career_description, {
            title: _ctx.$t("TITLES.responsibilities"),
            items: unref(pageData).responsibilities
          }, null, _parent));
        } else {
          _push(`<!---->`);
        }
        if (unref(pageData).requirements) {
          _push(ssrRenderComponent(_component_career_description, {
            title: _ctx.$t("TITLES.requirements"),
            items: unref(pageData).requirements
          }, null, _parent));
        } else {
          _push(`<!---->`);
        }
        _push(`</div>`);
        _push(ssrRenderComponent(_component_blog_social_media, {
          "route-link": "careers",
          item: unref(pageData),
          class: "lg:w-[60px]"
        }, null, _parent));
        _push(`</div><div class="container">`);
        _push(ssrRenderComponent(_component_career_form, {
          id: (_a = unref(pageData)) == null ? void 0 : _a.id,
          name: "budget",
          options: "options",
          placeholder: _ctx.$t("FORMS.Placeholders.selectBudget")
        }, null, _parent));
        _push(`</div><!--]-->`);
      } else {
        _push(`<!---->`);
      }
      _push(`</div>`);
    };
  }
};
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/careers/[slug]/index.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};

export { _sfc_main as default };
//# sourceMappingURL=index-DofRwFpT.mjs.map
