import { a as _sfc_main$7, i as _sfc_main$1, n as _sfc_main$3, o as _sfc_main$4, r as _sfc_main$6, s as _sfc_main$5, t as _sfc_main$2, x as _sfc_main$8, z as http_default } from "../ssr.js";
import { usePage } from "@inertiajs/vue3";
import { createVNode, mergeProps, onMounted, ref, resolveDynamicComponent, unref, useSSRContext } from "vue";
import { ssrInterpolate, ssrRenderAttrs, ssrRenderComponent, ssrRenderVNode } from "vue/server-renderer";
//#region resources/js/Pages/Sma/Product/Transfer/QuickView.vue
var _sfc_main = {
	__name: "QuickView",
	__ssrInlineRender: true,
	props: [
		"current",
		"custom_fields",
		"editRow",
		"xfetch"
	],
	setup(__props) {
		const page = usePage();
		const props = __props;
		const loading = ref(true);
		const transfer = ref(null);
		const templateComponent = {
			One: _sfc_main$1,
			Two: _sfc_main$2,
			Three: _sfc_main$3,
			Four: _sfc_main$4,
			Five: _sfc_main$5,
			Six: _sfc_main$6,
			Minimal: _sfc_main$7
		};
		onMounted(async () => {
			if (props.xfetch) {
				transfer.value = props.current;
				loading.value = false;
			} else await http_default.get(route("transfers.show", {
				transfer: props.current.id,
				json: true
			})).then((res) => {
				transfer.value = res.data;
				loading.value = false;
			}).catch(() => loading.value = false);
		});
		return (_ctx, _push, _parent, _attrs) => {
			if (loading.value) {
				_push(`<div${ssrRenderAttrs(mergeProps({ class: "relative h-64" }, _attrs))}>`);
				_push(ssrRenderComponent(unref(_sfc_main$8), null, null, _parent));
				_push(`</div>`);
			} else if (transfer.value) ssrRenderVNode(_push, createVNode(resolveDynamicComponent(templateComponent[unref(page).props.settings?.sale_template || "One"]), mergeProps({
				type: "transfer",
				xfetch: __props.xfetch,
				record: transfer.value,
				editRow: __props.editRow,
				custom_fields: __props.custom_fields
			}, _attrs), null), _parent);
			else _push(`<div${ssrRenderAttrs(mergeProps({ class: "flex min-h-64 items-center justify-center p-6 text-lg font-thin" }, _attrs))}>${ssrInterpolate(_ctx.$t("No data found, the record might not belong to the selected store."))}</div>`);
		};
	}
};
var _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
	const ssrContext = useSSRContext();
	(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("resources/js/Pages/Sma/Product/Transfer/QuickView.vue");
	return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
//#endregion
export { _sfc_main as default };
