import { _ as __nuxt_component_3 } from "./client-only-5c59a7ab.js";
import { ref, computed, watch, useSSRContext } from "vue";
import "hookable";
import { n as useRouter } from "../server.mjs";
import "destr";
import "devalue";
import "klona";
import { ssrRenderComponent } from "vue/server-renderer";
import { useRoute } from "vue-router";
import "v3-infinite-loading";
import "dayjs";
import { u as useAuthStore } from "./auth-6d0727c5.js";
import "ofetch";
import "#internal/nitro";
import "unctx";
import "h3";
import "ufo";
import "@vue/devtools-api";
import "@unhead/ssr";
import "unhead";
import "@unhead/shared";
import "dayjs/locale/fr.js";
import "dayjs/plugin/relativeTime.js";
import "dayjs/plugin/utc.js";
import "dayjs/plugin/timezone.js";
import "@headlessui/vue";
import "vue-i18n";
import "vue3-popper";
import "defu";
const style = "";
const _sfc_main = {
  __name: "resultats",
  __ssrInlineRender: true,
  setup(__props) {
    useRouter();
    useRoute();
    ref([
      { value: "earlier", label: "Départ le plus tôt" },
      { value: "price", label: "Prix le plus bas" }
      // { value: "near_origin", label: "Proche point de départ" },
      // { value: "near_destination", label: "Proche point d'arrivée" },
    ]);
    ref([
      { value: "", label: "Indifférent" },
      { value: "before_coffin", label: "Avant mise en bière" },
      { value: "after_coffin", label: "Après mise en bière" }
    ]);
    ref([
      { label: "Indifférent", value: 1 },
      {
        label: "Hors-normes",
        hint: "Dimensions intérieures du cercueil > 195cm x 60cm",
        value: 0
      }
    ]);
    ref("");
    ref(1);
    ref("earlier");
    computed(() => {
      let sortedRoutes = routes.value;
      if (sortByCoffinType.value === "before_coffin") {
        sortedRoutes = sortedRoutes.filter((route) => {
          return route.coffin_type !== "after_coffin";
        });
      } else if (sortByCoffinType.value === "after_coffin") {
        sortedRoutes = sortedRoutes.filter((route) => {
          return route.coffin_type !== "before_coffin";
        });
      }
      return !!origin.value && !!destination.value;
    });
    const routes = ref([]);
    ref(false);
    ref();
    ref();
    const origin = ref();
    const destination = ref();
    ref();
    ref(false);
    const searchFormRef = ref(null);
    useAuthStore();
    ref({
      current_page: 1,
      from: 1,
      last_page: 1,
      per_page: 10,
      total: 0
    });
    watch(
      () => searchFormRef.value,
      (searchForm) => {
        if (!searchForm) {
          return;
        }
        searchForm.updateFields();
      },
      { immediate: true }
    );
    computed(() => {
      return routes.value;
    });
    return (_ctx, _push, _parent, _attrs) => {
      const _component_ClientOnly = __nuxt_component_3;
      _push(ssrRenderComponent(_component_ClientOnly, _attrs, {}, _parent));
    };
  }
};
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/resultats.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export {
  _sfc_main as default
};
//# sourceMappingURL=resultats-7ae8b503.js.map
