Files
service-finder/frontend_admin/.nuxt/dist/server/_nuxt/edit-ZNmjSMhu.js
2026-07-02 11:52:22 +00:00

504 lines
41 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { defineComponent, useSSRContext, ref, computed, watch, mergeProps, reactive, createVNode, resolveDynamicComponent } from "vue";
import { ssrRenderAttrs, ssrRenderClass, ssrIncludeBooleanAttr, ssrInterpolate, ssrRenderList, ssrRenderComponent, ssrRenderAttr, ssrRenderVNode, ssrLooseContain } from "vue/server-renderer";
import "/app/node_modules/klona/dist/index.mjs";
import "/app/node_modules/hookable/dist/index.mjs";
import "../server.mjs";
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
import { useRoute, useRouter } from "vue-router";
import "/app/node_modules/ofetch/dist/node.mjs";
import "#internal/nuxt/paths";
import "/app/node_modules/unctx/dist/index.mjs";
import "/app/node_modules/h3/dist/index.mjs";
import "pinia";
import "/app/node_modules/defu/dist/defu.mjs";
import "/app/node_modules/ufo/dist/index.mjs";
import "/app/node_modules/cookie-es/dist/index.mjs";
import "/app/node_modules/destr/dist/index.mjs";
import "/app/node_modules/ohash/dist/index.mjs";
import "/app/node_modules/@unhead/vue/dist/index.mjs";
import "@vue/devtools-api";
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
__name: "TreeNode",
__ssrInlineRender: true,
props: {
node: {},
selectedIds: {},
expandedIds: {}
},
emits: ["toggle", "toggle-expand"],
setup(__props) {
return (_ctx, _push, _parent, _attrs) => {
const _component_TreeNode = _sfc_main$3;
_push(`<div${ssrRenderAttrs(_attrs)}><div class="flex items-center gap-2 py-1"><button class="text-slate-500 hover:text-slate-300 transition w-4 h-4 flex items-center justify-center"><svg class="${ssrRenderClass([__props.expandedIds.has(__props.node.id) ? "rotate-90" : "", "w-3 h-3 transition-transform"])}" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg></button><label class="flex items-center gap-2 cursor-pointer flex-1"><input type="checkbox"${ssrIncludeBooleanAttr(__props.selectedIds.includes(__props.node.id)) ? " checked" : ""} class="w-4 h-4 rounded border-slate-500 bg-slate-700 text-indigo-500 focus:ring-indigo-500/50"><span class="text-sm text-slate-300">${ssrInterpolate(__props.node.name_hu || __props.node.name_en || __props.node.key)}</span><span class="text-xs text-slate-500">(Szint ${ssrInterpolate(__props.node.level)})</span></label></div>`);
if (__props.expandedIds.has(__props.node.id) && __props.node.children?.length) {
_push(`<div class="ml-6 border-l border-slate-700 pl-3"><!--[-->`);
ssrRenderList(__props.node.children, (child) => {
_push(`<div>`);
_push(ssrRenderComponent(_component_TreeNode, {
node: child,
"selected-ids": __props.selectedIds,
"expanded-ids": __props.expandedIds,
onToggle: (id) => _ctx.$emit("toggle", id),
onToggleExpand: (id) => _ctx.$emit("toggle-expand", id)
}, null, _parent));
_push(`</div>`);
});
_push(`<!--]--></div>`);
} else {
_push(`<!---->`);
}
_push(`</div>`);
};
}
});
const _sfc_setup$3 = _sfc_main$3.setup;
_sfc_main$3.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/TreeNode.vue");
return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
};
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
__name: "SmartLocationInput",
__ssrInlineRender: true,
props: {
modelValue: { default: null },
label: { default: "" },
placeholder: { default: "Kezdj el gépelni (irányítószám vagy város)..." },
minChars: { default: 2 },
countryCode: { default: "HU" },
debounceMs: { default: 300 }
},
emits: ["update:modelValue", "select"],
setup(__props, { emit: __emit }) {
const props = __props;
ref(null);
const query = ref("");
const selectedItem = ref(props.modelValue);
const items = ref([]);
const searching = ref(false);
const showDropdown = ref(false);
const highlightedIndex = ref(0);
const displayText = computed(() => {
if (selectedItem.value) {
return `${selectedItem.value.zip_code} ${selectedItem.value.city}`;
}
return query.value;
});
const filteredItems = computed(() => {
if (!query.value || query.value.length < props.minChars) return [];
const q = query.value.toLowerCase();
return items.value.filter(
(item) => item.zip_code.toLowerCase().includes(q) || item.city.toLowerCase().includes(q)
);
});
watch(
() => props.modelValue,
(val) => {
selectedItem.value = val;
}
);
return (_ctx, _push, _parent, _attrs) => {
_push(`<div${ssrRenderAttrs(mergeProps({ class: "relative" }, _attrs))} data-v-b43e13ca>`);
if (__props.label) {
_push(`<label class="block text-sm font-medium text-slate-300 mb-1" data-v-b43e13ca>${ssrInterpolate(__props.label)}</label>`);
} else {
_push(`<!---->`);
}
_push(`<div class="relative" data-v-b43e13ca><input${ssrRenderAttr("value", displayText.value)}${ssrRenderAttr("placeholder", __props.placeholder)} class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-b43e13ca>`);
if (searching.value) {
_push(`<svg class="absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 animate-spin text-slate-400" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-b43e13ca><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" data-v-b43e13ca></path></svg>`);
} else {
_push(`<!---->`);
}
if (selectedItem.value && !searching.value) {
_push(`<button class="absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 hover:text-white transition" type="button" data-v-b43e13ca><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-b43e13ca><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" data-v-b43e13ca></path></svg></button>`);
} else {
_push(`<!---->`);
}
_push(`</div>`);
if (showDropdown.value && filteredItems.value.length > 0) {
_push(`<div class="absolute z-50 mt-1 w-full bg-slate-800 border border-slate-600 rounded-lg shadow-xl max-h-60 overflow-y-auto" data-v-b43e13ca><!--[-->`);
ssrRenderList(filteredItems.value, (item, index) => {
_push(`<button class="${ssrRenderClass([index === highlightedIndex.value ? "bg-indigo-500/20 text-white" : "text-slate-300 hover:bg-slate-700", "w-full text-left px-3 py-2 text-sm transition flex items-center gap-2"])}" data-v-b43e13ca><span class="font-mono text-indigo-400" data-v-b43e13ca>${ssrInterpolate(item.zip_code)}</span><span data-v-b43e13ca>${ssrInterpolate(item.city)}</span><span class="text-xs text-slate-500 ml-auto" data-v-b43e13ca>${ssrInterpolate(item.country_code)}</span></button>`);
});
_push(`<!--]--></div>`);
} else {
_push(`<!---->`);
}
if (showDropdown.value && query.value.length >= __props.minChars && filteredItems.value.length === 0 && !searching.value) {
_push(`<div class="absolute z-50 mt-1 w-full bg-slate-800 border border-slate-600 rounded-lg shadow-xl p-3 text-sm text-slate-400" data-v-b43e13ca> Nincs találat </div>`);
} else {
_push(`<!---->`);
}
_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/SmartLocationInput.vue");
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
};
const __nuxt_component_0 = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-b43e13ca"]]);
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
__name: "SharedAddressForm",
__ssrInlineRender: true,
props: {
modelValue: { default: () => ({
zip: null,
city: null,
street_name: null,
street_type: null,
house_number: null,
stairwell: null,
floor: null,
door: null,
parcel_id: null,
full_address_text: null,
latitude: null,
longitude: null
}) }
},
emits: ["update:modelValue"],
setup(__props, { emit: __emit }) {
const props = __props;
const emit = __emit;
const selectedLocation = computed(() => {
if (props.modelValue?.zip && props.modelValue?.city) {
return {
id: 0,
// We don't have the DB id here, but SmartLocationInput handles this
zip_code: props.modelValue.zip,
city: props.modelValue.city,
country_code: "HU"
};
}
return null;
});
function onLocationSelected(location) {
const updated = { ...props.modelValue };
if (location) {
updated.zip = location.zip_code;
updated.city = location.city;
} else {
updated.zip = null;
updated.city = null;
}
emit("update:modelValue", updated);
}
return (_ctx, _push, _parent, _attrs) => {
const _component_SmartLocationInput = __nuxt_component_0;
_push(`<div${ssrRenderAttrs(_attrs)}><div class="bg-slate-800 rounded-xl border border-slate-700 p-6 mb-6"><h2 class="text-lg font-semibold text-white mb-4">Cím adatok</h2><div class="grid grid-cols-1 md:grid-cols-2 gap-4"><div class="md:col-span-2">`);
_push(ssrRenderComponent(_component_SmartLocationInput, {
"model-value": selectedLocation.value,
"onUpdate:modelValue": onLocationSelected,
label: "Irányítószám / Város",
placeholder: "Kezdj el gépelni (pl. 1011 vagy Budapest)..."
}, null, _parent));
_push(`</div><div><label class="block text-sm font-medium text-slate-300 mb-1">Utca neve</label><input${ssrRenderAttr("value", __props.modelValue.street_name)} placeholder="pl. Egressy" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm"></div><div><label class="block text-sm font-medium text-slate-300 mb-1">Közterület jellege</label><select${ssrRenderAttr("value", __props.modelValue.street_type)} class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm"><option value="">Válassz...</option><option value="utca">utca</option><option value="út">út</option><option value="tér">tér</option><option value="körút">körút</option><option value="sugárút">sugárút</option><option value="köz">köz</option><option value="sétány">sétány</option><option value="lakópark">lakópark</option><option value="liget">liget</option><option value="erdő">erdő</option><option value="dűlő">dűlő</option><option value="major">major</option><option value="puszta">puszta</option><option value="sziget">sziget</option><option value="telep">telep</option></select></div><div><label class="block text-sm font-medium text-slate-300 mb-1">Házszám</label><input${ssrRenderAttr("value", __props.modelValue.house_number)} placeholder="pl. 4/b" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm"></div><div><label class="block text-sm font-medium text-slate-300 mb-1">Lépcsőház</label><input${ssrRenderAttr("value", __props.modelValue.stairwell)} placeholder="pl. 1" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm"></div><div><label class="block text-sm font-medium text-slate-300 mb-1">Emelet</label><input${ssrRenderAttr("value", __props.modelValue.floor)} placeholder="pl. 3" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm"></div><div><label class="block text-sm font-medium text-slate-300 mb-1">Ajtó</label><input${ssrRenderAttr("value", __props.modelValue.door)} placeholder="pl. A" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm"></div><div><label class="block text-sm font-medium text-slate-300 mb-1">Helyrajzi szám (hrsz)</label><input${ssrRenderAttr("value", __props.modelValue.parcel_id)} placeholder="pl. 12345/6" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm"></div></div></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/SharedAddressForm.vue");
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "edit",
__ssrInlineRender: true,
setup(__props) {
const VEHICLE_CLASSES = [
{ key: "car", label: "Személyautó" },
{ key: "motorcycle", label: "Motorkerékpár" },
{ key: "truck", label: "Teherautó" },
{ key: "hgv", label: "Nehézgépjármű (HGV)" },
{ key: "light_commercial", label: "Kishaszonjármű" },
{ key: "personal", label: "Személyes" },
{ key: "boat", label: "Csónak/Vízi" },
{ key: "other", label: "Egyéb" }
];
const route = useRoute();
useRouter();
computed(() => Number(route.params.id));
const loading = ref(true);
const error = ref(false);
const provider = ref(null);
const saveLoading = ref(false);
const toast = ref(null);
const activeTab = ref("basic");
const tabs = [
{ key: "basic", label: "Alapadatok & Kapcsolat", icon: "svg" },
{ key: "matrix", label: "Szolgáltatások & Járművek", icon: "svg" },
{ key: "location", label: "Helyszín & Lokáció", icon: "svg" },
{ key: "hours", label: "Nyitvatartás", icon: "svg" }
];
const categoryTree = ref([]);
const treeLoading = ref(false);
const expandedNodes = ref(/* @__PURE__ */ new Set());
const brandInput = ref("");
const propulsionInput = ref("");
const form = reactive({
name: "",
address: "",
city: "",
address_zip: "",
address_street_name: "",
address_street_type: "",
address_house_number: "",
plus_code: "",
contact_phone: "",
contact_email: "",
website: "",
category: "",
category_ids: [],
supported_vehicle_classes: [],
specializations: {
brands: [],
propulsion: []
},
opening_hours: {},
is_always_open: false,
// Nested address object matching AddressIn schema (used by SharedAddressForm)
address: {
zip: "",
city: "",
street_name: "",
street_type: "",
house_number: "",
stairwell: "",
floor: "",
door: "",
parcel_id: "",
full_address_text: "",
latitude: null,
longitude: null
}
});
const hasChanges = computed(() => {
if (!provider.value) return false;
const p = provider.value;
if (form.name !== (p.name || "")) return true;
if (form.address !== (p.address || "")) return true;
if (form.plus_code !== (p.plus_code || "")) return true;
if (form.address.zip !== (p.address_zip || "")) return true;
if (form.address.city !== (p.city || "")) return true;
if (form.address.street_name !== (p.address_street_name || "")) return true;
if (form.address.street_type !== (p.address_street_type || "")) return true;
if (form.address.house_number !== (p.address_house_number || "")) return true;
if (form.contact_phone !== (p.contact_phone || "")) return true;
if (form.contact_email !== (p.contact_email || "")) return true;
if (form.website !== (p.website || "")) return true;
if (form.category !== (p.category || "")) return true;
const sortedFormCategories = [...form.category_ids].sort();
const sortedOrigCategories = [...p.category_ids || []].sort();
if (JSON.stringify(sortedFormCategories) !== JSON.stringify(sortedOrigCategories)) return true;
const sortedFormClasses = [...form.supported_vehicle_classes].sort();
const sortedOrigClasses = [...p.supported_vehicle_classes || []].sort();
if (JSON.stringify(sortedFormClasses) !== JSON.stringify(sortedOrigClasses)) return true;
const normalizeSpec = (spec) => ({
brands: Array.isArray(spec?.brands) ? [...spec.brands].sort() : [],
propulsion: Array.isArray(spec?.propulsion) ? [...spec.propulsion].sort() : []
});
if (JSON.stringify(normalizeSpec(form.specializations)) !== JSON.stringify(normalizeSpec(p.specializations))) return true;
const DAYS2 = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"];
const normalizeHours = (hours) => {
const result = {};
const daysSource = hours?.days || hours;
for (const day of DAYS2) {
const slot = daysSource?.[day];
if (slot && typeof slot === "object" && slot.open && slot.close) {
result[day] = { open: slot.open, close: slot.close };
} else {
result[day] = null;
}
}
return result;
};
if (JSON.stringify(normalizeHours(form.opening_hours)) !== JSON.stringify(normalizeHours(p.opening_hours))) return true;
if (form.is_always_open !== (p.opening_hours?.always_open === true)) return true;
return false;
});
function findCategoryById(id, nodes) {
for (const node of nodes) {
if (node.id === id) return node;
if (node.children?.length) {
const found = findCategoryById(id, node.children);
if (found) return found;
}
}
return null;
}
function getCategoryName(id) {
const node = findCategoryById(id, categoryTree.value);
if (!node) return `#${id}`;
return node.name_hu || node.name_en || node.key;
}
function toggleCategory(id) {
const idx = form.category_ids.indexOf(id);
if (idx >= 0) {
form.category_ids.splice(idx, 1);
} else {
form.category_ids.push(id);
}
}
function toggleTreeNode(id) {
const newSet = new Set(expandedNodes.value);
if (newSet.has(id)) {
newSet.delete(id);
} else {
newSet.add(id);
}
expandedNodes.value = newSet;
}
function isCategorySelected(id) {
return form.category_ids.includes(id);
}
const DAYS = [
{ key: "monday", label: "Hétfő" },
{ key: "tuesday", label: "Kedd" },
{ key: "wednesday", label: "Szerda" },
{ key: "thursday", label: "Csütörtök" },
{ key: "friday", label: "Péntek" },
{ key: "saturday", label: "Szombat" },
{ key: "sunday", label: "Vasárnap" }
];
return (_ctx, _push, _parent, _attrs) => {
const _component_TreeNode = _sfc_main$3;
const _component_SharedAddressForm = _sfc_main$1;
_push(`<div${ssrRenderAttrs(_attrs)} data-v-ab22d560><div class="mb-8" data-v-ab22d560><button class="inline-flex items-center gap-1.5 text-sm text-slate-400 hover:text-white transition mb-4" data-v-ab22d560><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-ab22d560><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" data-v-ab22d560></path></svg> Vissza a szolgáltatóhoz </button><h1 class="text-2xl font-bold text-white" data-v-ab22d560>Szolgáltató szerkesztése</h1><p class="text-slate-400 mt-1" data-v-ab22d560>Szolgáltató #${ssrInterpolate(_ctx.$route.params.id)}</p></div>`);
if (loading.value) {
_push(`<div class="flex items-center justify-center py-20" data-v-ab22d560><div class="text-slate-400 flex items-center gap-3" data-v-ab22d560><svg class="w-5 h-5 animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-ab22d560><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" data-v-ab22d560></path></svg><span data-v-ab22d560>Szolgáltató betöltése...</span></div></div>`);
} else if (error.value) {
_push(`<div class="bg-rose-500/10 border border-rose-500/30 rounded-xl p-6 mb-8" data-v-ab22d560><p class="text-rose-400" data-v-ab22d560>Hiba történt a szolgáltató betöltése közben.</p><button class="mt-3 text-sm text-rose-300 hover:text-rose-200 underline" data-v-ab22d560>Újrapróbálkozás</button></div>`);
} else if (!provider.value) {
_push(`<div class="bg-slate-800 rounded-xl border border-slate-700 p-6" data-v-ab22d560><p class="text-slate-400 text-center py-12" data-v-ab22d560>A szolgáltató nem található.</p></div>`);
} else {
_push(`<!--[--><div class="border-b border-slate-700 mb-6" data-v-ab22d560><nav class="flex gap-6 -mb-px" data-v-ab22d560><!--[-->`);
ssrRenderList(tabs, (tab) => {
_push(`<button class="${ssrRenderClass([activeTab.value === tab.key ? "text-indigo-400 border-indigo-400" : "text-slate-400 border-transparent hover:text-slate-300", "pb-3 text-sm font-medium border-b-2 transition flex items-center gap-2"])}" data-v-ab22d560>`);
ssrRenderVNode(_push, createVNode(resolveDynamicComponent(tab.icon), { class: "w-4 h-4" }, null), _parent);
_push(` ${ssrInterpolate(tab.label)}</button>`);
});
_push(`<!--]--></nav></div>`);
if (activeTab.value === "basic") {
_push(`<div class="max-w-3xl" data-v-ab22d560><form data-v-ab22d560><div class="bg-slate-800 rounded-xl border border-slate-700 p-6 mb-6" data-v-ab22d560><h2 class="text-lg font-semibold text-white mb-4" data-v-ab22d560>Alapadatok</h2><div class="grid grid-cols-1 md:grid-cols-2 gap-4" data-v-ab22d560><div class="md:col-span-2" data-v-ab22d560><label class="block text-sm font-medium text-slate-300 mb-1" data-v-ab22d560>Név *</label><input${ssrRenderAttr("value", form.name)} required class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-ab22d560></div><div data-v-ab22d560><label class="block text-sm font-medium text-slate-300 mb-1" data-v-ab22d560>Kategória</label><input${ssrRenderAttr("value", form.category)} placeholder="pl. Autószerviz, Gumiszerviz" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-ab22d560></div><div data-v-ab22d560><label class="block text-sm font-medium text-slate-300 mb-1" data-v-ab22d560>Forrás</label><div class="w-full px-3 py-2 bg-slate-700/50 border border-slate-600 rounded-lg text-slate-400 text-sm" data-v-ab22d560>${ssrInterpolate(provider.value.source)}</div></div></div></div><div class="bg-slate-800 rounded-xl border border-slate-700 p-6 mb-6" data-v-ab22d560><h2 class="text-lg font-semibold text-white mb-4" data-v-ab22d560>Elérhetőség</h2><div class="grid grid-cols-1 md:grid-cols-2 gap-4" data-v-ab22d560><div data-v-ab22d560><label class="block text-sm font-medium text-slate-300 mb-1" data-v-ab22d560>Telefon</label><input${ssrRenderAttr("value", form.contact_phone)} placeholder="+36 30 123 4567" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-ab22d560></div><div data-v-ab22d560><label class="block text-sm font-medium text-slate-300 mb-1" data-v-ab22d560>Email</label><input${ssrRenderAttr("value", form.contact_email)} type="email" placeholder="info@example.com" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-ab22d560></div><div class="md:col-span-2" data-v-ab22d560><label class="block text-sm font-medium text-slate-300 mb-1" data-v-ab22d560>Weboldal</label><input${ssrRenderAttr("value", form.website)} placeholder="https://..." class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-ab22d560></div></div></div></form></div>`);
} else {
_push(`<!---->`);
}
if (activeTab.value === "matrix") {
_push(`<div class="max-w-4xl" data-v-ab22d560><div class="bg-slate-800 rounded-xl border border-slate-700 p-6 mb-6" data-v-ab22d560><h2 class="text-lg font-semibold text-white mb-2" data-v-ab22d560>3D Képesség Mátrix</h2><p class="text-sm text-slate-400 mb-6" data-v-ab22d560> Állítsd be, hogy a szolgáltató milyen járműosztályokhoz, szolgáltatási kategóriákhoz és specializációkhoz tartozik. </p><div class="mb-8" data-v-ab22d560><h3 class="text-md font-medium text-white mb-3 flex items-center gap-2" data-v-ab22d560><span class="w-6 h-6 rounded-full bg-indigo-500/20 text-indigo-400 flex items-center justify-center text-xs font-bold" data-v-ab22d560>A</span> Járműosztályok (Vehicle Classes) </h3><p class="text-xs text-slate-500 mb-3" data-v-ab22d560>Mely járműtípusokat szervizeli a szolgáltató?</p><div class="grid grid-cols-2 md:grid-cols-4 gap-3" data-v-ab22d560><!--[-->`);
ssrRenderList(VEHICLE_CLASSES, (vc) => {
_push(`<label class="${ssrRenderClass([form.supported_vehicle_classes.includes(vc.key) ? "bg-indigo-500/10 border-indigo-500/40 text-indigo-300" : "bg-slate-700/50 border-slate-600 hover:border-slate-500 text-slate-300", "flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition"])}" data-v-ab22d560><input type="checkbox"${ssrRenderAttr("value", vc.key)}${ssrIncludeBooleanAttr(form.supported_vehicle_classes.includes(vc.key)) ? " checked" : ""} class="w-4 h-4 rounded border-slate-500 bg-slate-700 text-indigo-500 focus:ring-indigo-500/50" data-v-ab22d560><span class="text-sm" data-v-ab22d560>${ssrInterpolate(vc.label)}</span></label>`);
});
_push(`<!--]--></div></div><div class="mb-8" data-v-ab22d560><h3 class="text-md font-medium text-white mb-3 flex items-center gap-2" data-v-ab22d560><span class="w-6 h-6 rounded-full bg-emerald-500/20 text-emerald-400 flex items-center justify-center text-xs font-bold" data-v-ab22d560>B</span> Szolgáltatási Kategóriák (Expertise Tags) </h3><p class="text-xs text-slate-500 mb-3" data-v-ab22d560>Válaszd ki a szolgáltatóhoz tartozó kategóriákat a hierarchikus fából.</p>`);
if (treeLoading.value) {
_push(`<div class="flex items-center gap-2 text-sm text-slate-400 py-4" data-v-ab22d560><svg class="w-4 h-4 animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-ab22d560><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" data-v-ab22d560></path></svg><span data-v-ab22d560>Kategóriák betöltése...</span></div>`);
} else {
_push(`<div class="space-y-1 max-h-96 overflow-y-auto pr-2" data-v-ab22d560><!--[-->`);
ssrRenderList(categoryTree.value, (node) => {
_push(`<div class="ml-0" data-v-ab22d560><div class="flex items-center gap-2 py-1" data-v-ab22d560><button class="text-slate-500 hover:text-slate-300 transition w-4 h-4 flex items-center justify-center" data-v-ab22d560><svg class="${ssrRenderClass([expandedNodes.value.has(node.id) ? "rotate-90" : "", "w-3 h-3 transition-transform"])}" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-ab22d560><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" data-v-ab22d560></path></svg></button><label class="flex items-center gap-2 cursor-pointer flex-1" data-v-ab22d560><input type="checkbox"${ssrIncludeBooleanAttr(isCategorySelected(node.id)) ? " checked" : ""} class="w-4 h-4 rounded border-slate-500 bg-slate-700 text-indigo-500 focus:ring-indigo-500/50" data-v-ab22d560><span class="text-sm font-medium text-white" data-v-ab22d560>${ssrInterpolate(node.name_hu || node.name_en || node.key)}</span><span class="text-xs text-slate-500" data-v-ab22d560>(Szint ${ssrInterpolate(node.level)})</span></label></div>`);
if (expandedNodes.value.has(node.id) && node.children?.length) {
_push(`<div class="ml-6 border-l border-slate-700 pl-3" data-v-ab22d560><!--[-->`);
ssrRenderList(node.children, (child) => {
_push(`<div data-v-ab22d560>`);
_push(ssrRenderComponent(_component_TreeNode, {
node: child,
"selected-ids": form.category_ids,
"expanded-ids": expandedNodes.value,
onToggle: toggleCategory,
onToggleExpand: toggleTreeNode
}, null, _parent));
_push(`</div>`);
});
_push(`<!--]--></div>`);
} else {
_push(`<!---->`);
}
_push(`</div>`);
});
_push(`<!--]--></div>`);
}
if (form.category_ids.length > 0) {
_push(`<div class="mt-4 flex flex-wrap gap-2" data-v-ab22d560><!--[-->`);
ssrRenderList(form.category_ids, (id) => {
_push(`<span class="inline-flex items-center gap-1 px-2 py-1 bg-indigo-500/10 text-indigo-300 rounded-full text-xs" data-v-ab22d560>${ssrInterpolate(getCategoryName(id))} <button class="hover:text-white transition" data-v-ab22d560><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-ab22d560><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" data-v-ab22d560></path></svg></button></span>`);
});
_push(`<!--]--></div>`);
} else {
_push(`<!---->`);
}
_push(`</div><div class="mb-4" data-v-ab22d560><h3 class="text-md font-medium text-white mb-3 flex items-center gap-2" data-v-ab22d560><span class="w-6 h-6 rounded-full bg-amber-500/20 text-amber-400 flex items-center justify-center text-xs font-bold" data-v-ab22d560>C</span> Specializációk </h3><p class="text-xs text-slate-500 mb-3" data-v-ab22d560>Adj meg speciális márkákat, hajtáslánc típusokat vagy egyéb címkéket.</p><div class="grid grid-cols-1 md:grid-cols-2 gap-6" data-v-ab22d560><div data-v-ab22d560><label class="block text-sm font-medium text-slate-300 mb-1" data-v-ab22d560>Márkák (Brands)</label><div class="flex flex-wrap gap-2 mb-2" data-v-ab22d560><!--[-->`);
ssrRenderList(form.specializations.brands, (brand, idx) => {
_push(`<span class="inline-flex items-center gap-1 px-2 py-1 bg-amber-500/10 text-amber-300 rounded-full text-xs" data-v-ab22d560>${ssrInterpolate(brand)} <button class="hover:text-white transition" data-v-ab22d560><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-ab22d560><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" data-v-ab22d560></path></svg></button></span>`);
});
_push(`<!--]--></div><div class="flex gap-2" data-v-ab22d560><input${ssrRenderAttr("value", brandInput.value)} placeholder="pl. Volvo, Scania" class="flex-1 px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-ab22d560><button${ssrIncludeBooleanAttr(!brandInput.value.trim()) ? " disabled" : ""} class="px-3 py-2 bg-indigo-600 hover:bg-indigo-500 disabled:bg-indigo-600/50 text-white rounded-lg text-sm transition" data-v-ab22d560> Hozzáad </button></div></div><div data-v-ab22d560><label class="block text-sm font-medium text-slate-300 mb-1" data-v-ab22d560>Hajtáslánc (Propulsion)</label><div class="flex flex-wrap gap-2 mb-2" data-v-ab22d560><!--[-->`);
ssrRenderList(form.specializations.propulsion, (prop, idx) => {
_push(`<span class="inline-flex items-center gap-1 px-2 py-1 bg-emerald-500/10 text-emerald-300 rounded-full text-xs" data-v-ab22d560>${ssrInterpolate(prop)} <button class="hover:text-white transition" data-v-ab22d560><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-ab22d560><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" data-v-ab22d560></path></svg></button></span>`);
});
_push(`<!--]--></div><div class="flex gap-2" data-v-ab22d560><input${ssrRenderAttr("value", propulsionInput.value)} placeholder="pl. EV, Hybrid, Diesel" class="flex-1 px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-ab22d560><button${ssrIncludeBooleanAttr(!propulsionInput.value.trim()) ? " disabled" : ""} class="px-3 py-2 bg-indigo-600 hover:bg-indigo-500 disabled:bg-indigo-600/50 text-white rounded-lg text-sm transition" data-v-ab22d560> Hozzáad </button></div></div></div></div></div></div>`);
} else {
_push(`<!---->`);
}
if (activeTab.value === "location") {
_push(`<div class="max-w-3xl" data-v-ab22d560><form data-v-ab22d560>`);
_push(ssrRenderComponent(_component_SharedAddressForm, {
modelValue: form.address,
"onUpdate:modelValue": ($event) => form.address = $event
}, null, _parent));
_push(`<div class="bg-slate-800 rounded-xl border border-slate-700 p-6 mb-6" data-v-ab22d560><h2 class="text-lg font-semibold text-white mb-4" data-v-ab22d560>További helyszín adatok</h2><div class="grid grid-cols-1 md:grid-cols-2 gap-4" data-v-ab22d560><div class="md:col-span-2" data-v-ab22d560><label class="block text-sm font-medium text-slate-300 mb-1" data-v-ab22d560>Teljes cím szövege</label><input${ssrRenderAttr("value", form.address.full_address_text)} placeholder="Teljes cím szövege" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-ab22d560></div><div class="md:col-span-2" data-v-ab22d560><label class="block text-sm font-medium text-slate-300 mb-1" data-v-ab22d560>Plus Code</label><input${ssrRenderAttr("value", form.plus_code)} placeholder="8FVC9X8V+XV" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-ab22d560></div></div></div></form></div>`);
} else {
_push(`<!---->`);
}
if (activeTab.value === "hours") {
_push(`<div class="max-w-3xl" data-v-ab22d560><div class="bg-slate-800 rounded-xl border border-slate-700 p-6 mb-6" data-v-ab22d560><h2 class="text-lg font-semibold text-white mb-2" data-v-ab22d560>Nyitvatartás</h2><p class="text-sm text-slate-400 mb-6" data-v-ab22d560> Állítsd be a szolgáltató nyitvatartási idejét napokra bontva. </p><div class="mb-6 p-4 rounded-lg border bg-indigo-500/5 border-indigo-500/20" data-v-ab22d560><label class="flex items-center gap-3 cursor-pointer" data-v-ab22d560><input type="checkbox"${ssrIncludeBooleanAttr(Array.isArray(form.is_always_open) ? ssrLooseContain(form.is_always_open, null) : form.is_always_open) ? " checked" : ""} class="w-5 h-5 rounded border-slate-500 bg-slate-700 text-indigo-500 focus:ring-indigo-500/50" data-v-ab22d560><div data-v-ab22d560><span class="text-sm font-medium text-white" data-v-ab22d560>Folyamatos (0-24) nyitvatartás</span><p class="text-xs text-slate-400 mt-0.5" data-v-ab22d560>A szolgáltató a hét minden napján 0-24 óráig nyitva van</p></div></label></div><div class="${ssrRenderClass([{ "opacity-50 pointer-events-none": form.is_always_open }, "flex flex-wrap gap-2 mb-6"])}" data-v-ab22d560><button class="px-3 py-1.5 text-xs font-medium rounded-lg border border-emerald-600/30 text-emerald-400 hover:bg-emerald-600/10 transition" data-v-ab22d560> 24/7 Folyamatos nyitvatartás </button><button class="px-3 py-1.5 text-xs font-medium rounded-lg border border-indigo-600/30 text-indigo-400 hover:bg-indigo-600/10" data-v-ab22d560> Hétköznapok másolása (Hétfő → K-P) </button><button class="px-3 py-1.5 text-xs font-medium rounded-lg border border-rose-600/30 text-rose-400 hover:bg-rose-600/10" data-v-ab22d560> Összes törlése </button></div><div class="${ssrRenderClass([{ "opacity-50 pointer-events-none": form.is_always_open }, "space-y-3"])}" data-v-ab22d560><!--[-->`);
ssrRenderList(DAYS, (day) => {
_push(`<div class="${ssrRenderClass([form.opening_hours[day.key] ? "bg-indigo-500/5 border-indigo-500/20" : "bg-slate-700/30 border-slate-600", "flex items-center gap-4 p-4 rounded-lg border"])}" data-v-ab22d560><label class="flex items-center gap-2 w-36 flex-shrink-0 cursor-pointer" data-v-ab22d560><input type="checkbox"${ssrIncludeBooleanAttr(!!form.opening_hours[day.key]) ? " checked" : ""}${ssrIncludeBooleanAttr(form.is_always_open) ? " disabled" : ""} class="w-4 h-4 rounded border-slate-500 bg-slate-700 text-indigo-500 focus:ring-indigo-500/50" data-v-ab22d560><span class="text-sm font-medium text-white" data-v-ab22d560>${ssrInterpolate(day.label)}</span></label>`);
if (form.opening_hours[day.key]) {
_push(`<div class="flex items-center gap-2" data-v-ab22d560><input type="time"${ssrRenderAttr("value", form.opening_hours[day.key]?.open || "08:00")}${ssrIncludeBooleanAttr(form.is_always_open) ? " disabled" : ""} class="w-28 px-2 py-1.5 bg-slate-700 border border-slate-600 rounded-lg text-white text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 disabled:opacity-50" data-v-ab22d560><span class="text-slate-500 text-sm" data-v-ab22d560></span><input type="time"${ssrRenderAttr("value", form.opening_hours[day.key]?.close || "17:00")}${ssrIncludeBooleanAttr(form.is_always_open) ? " disabled" : ""} class="w-28 px-2 py-1.5 bg-slate-700 border border-slate-600 rounded-lg text-white text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 disabled:opacity-50" data-v-ab22d560></div>`);
} else {
_push(`<span class="text-sm text-slate-500 italic" data-v-ab22d560>Zárva</span>`);
}
_push(`</div>`);
});
_push(`<!--]--></div></div></div>`);
} else {
_push(`<!---->`);
}
_push(`<div class="sticky bottom-0 bg-slate-900/90 backdrop-blur-sm border-t border-slate-700 -mx-6 px-6 py-4 mt-8" data-v-ab22d560><div class="flex items-center justify-between max-w-4xl" data-v-ab22d560><div class="text-sm text-slate-400" data-v-ab22d560>`);
if (hasChanges.value) {
_push(`<span class="text-amber-400" data-v-ab22d560>● Módosítások el nem mentve</span>`);
} else {
_push(`<span class="text-slate-500" data-v-ab22d560>Nincs változás</span>`);
}
_push(`</div><div class="flex gap-3" data-v-ab22d560><button class="px-4 py-2 text-sm text-slate-400 hover:text-white transition" data-v-ab22d560> Mégse </button><button${ssrIncludeBooleanAttr(saveLoading.value || !hasChanges.value) ? " disabled" : ""} class="px-6 py-2 bg-indigo-600 hover:bg-indigo-500 disabled:bg-indigo-600/50 text-white rounded-lg text-sm font-medium transition flex items-center gap-2" data-v-ab22d560>`);
if (saveLoading.value) {
_push(`<svg class="w-4 h-4 animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-ab22d560><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" data-v-ab22d560></path></svg>`);
} else {
_push(`<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-ab22d560><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-ab22d560></path></svg>`);
}
_push(` Mentés </button></div></div></div><!--]-->`);
}
if (toast.value) {
_push(`<div class="${ssrRenderClass([toast.value.type === "success" ? "bg-emerald-600 text-white" : "bg-rose-600 text-white", "fixed top-4 right-4 z-50 px-4 py-3 rounded-lg shadow-xl text-sm font-medium transition-all duration-300"])}" data-v-ab22d560>${ssrInterpolate(toast.value.message)}</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/providers/[id]/edit.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const edit = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ab22d560"]]);
export {
edit as default
};
//# sourceMappingURL=edit-ZNmjSMhu.js.map