Files
appco_dist/.output/server/chunks/build/index-__jwkyv5.mjs
T
2025-07-24 21:13:13 +03:30

3730 lines
207 KiB
JavaScript

import { defineComponent, ref, watch, shallowRef, unref, withCtx, createVNode, createBlock, openBlock, Fragment, renderList, createSlots, createTextVNode, toDisplayString, createCommentVNode, useSlots, computed, mergeProps, renderSlot, reactive, nextTick, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrInterpolate, ssrRenderList, ssrRenderAttr, ssrRenderClass, ssrRenderSlot } from 'vue/server-renderer';
import { Swiper, SwiperSlide } from 'swiper/vue';
import { EffectCoverflow, Pagination } from 'swiper/modules';
import { s as selectedFeatures, b as setItems, i as items, v as variants, u as updateMyAttrs, c as formFields, o as original, m as mediaFilesUrl, d as priceType, e as addToVariants, g as myAttributes, h as featureItems, j as getFeatures, k as createFeature, l as createFeatureAttribute, n as editItems } from './handle-DbjkEnGN.mjs';
import { B as BasicIconOld, b as baseButtonIconSize, u as usePrefix } from './BasicIconOld-I4c2ShMu.mjs';
import { a as useConfigStore, u as useRouter, aX as hotSelect, a1 as Button, e as api$1 } from './server.mjs';
import { a as inputRules, i as inputRulesNoMessage, j as justNumberNoMessage, b as justNumberRequiredNoMessage, c as justNumberRequired, d as justNumberRequiredMaxMin } from './inputRules-BErREp_b.mjs';
import { _ as _sfc_main$5 } from './BasicInput-BEP6ZgUl.mjs';
import { _ as _sfc_main$3 } from './BasicTextArea-Cj0DwXpZ.mjs';
import { _ as _sfc_main$6, S as Select, a as SelectOption } from './BasicSelect-DsjcJY9Q.mjs';
import { _ as _sfc_main$7 } from './BasicButton-B-4QDu9v.mjs';
import { s as stdin_default, C as Collapse, _ as __nuxt_component_6, b as Checkbox } from './index-v_kULVR1.mjs';
import { F as Form, _ as _sfc_main$8 } from './index-DwUxJCFD.mjs';
import { T as Tag } from './index-BLBX3jXD.mjs';
import { _ as __nuxt_component_1 } from './FormItem-DY7uTw8_.mjs';
import { _ as __nuxt_component_4 } from './index-_EOUO1YE.mjs';
import { differenceBy, cloneDeep } from 'lodash-es';
import { u as useProductStore } from './product-Cl3m1YR_.mjs';
import { useRoute } from 'vue-router';
import { _ as _sfc_main$4 } from './InstaInput-DyBbOQDW.mjs';
import { _ as __nuxt_component_1$1, R as Radio } from './RadioButton--E7lmHK3.mjs';
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
__name: "AttributeAddEditInProduct",
__ssrInlineRender: true,
props: {
open: { type: Boolean, default: false },
data: {}
},
emits: ["update:open", "update:isEdit", "success"],
setup(__props, { emit: __emit }) {
const activeNames = ref();
const formFields2 = reactive({});
ref();
const config = useConfigStore();
const sheetRef = ref(null);
const loading = ref(false);
ref(false);
const featureText = ref();
const attrText = ref();
watch(activeNames, () => {
console.log(activeNames.value);
});
const show = computed({
get() {
return props.open;
},
set(value) {
emits("update:open", value);
}
});
const addFeature = async () => {
try {
loading.value = true;
await createFeature({ name: featureText.value });
api$1.success(config.useString("addedSuccessfully"));
await getFeatures();
featureText.value = void 0;
} catch (e) {
console.log("error", e);
api$1.error(config.useString("errorInSubmittingData"));
} finally {
loading.value = false;
}
};
function handleChangeSelectedFeature(val) {
activeNames.value = featureItems.value.find((x) => x.id === val).name;
console.log(activeNames.value, val, featureItems.value);
}
const addAttr = async (id) => {
try {
loading.value = true;
await createFeatureAttribute({
attribute_id: id,
value: attrText.value
});
api$1.success(config.useString("addedSuccessfully"));
await editItems(id);
attrText.value = void 0;
} catch (e) {
console.log("error", e);
api$1.error(config.useString("errorInSubmittingData"));
} finally {
loading.value = false;
}
};
const props = __props;
const emits = __emit;
const addForm = () => {
resetSheet();
};
const VNodes = defineComponent({
props: {
vnodes: {
type: Object,
required: true
}
},
render() {
return this.vnodes;
}
});
function addToItemFeature(e, val) {
val.new_feature = val.attribute_values.filter((x) => e.includes(x.id));
console.log(e, val, "test");
}
const addAttribute = () => {
selectedFeatures.value.push(null);
console.log(selectedFeatures.value);
};
function resetSheet() {
const defaultFormFields = {
id: void 0,
name: "",
created_at: void 0,
updated_at: void 0,
attribute_values: []
};
Object.assign(formFields2, defaultFormFields);
}
watch(props, (value) => {
if (value.open) {
openSheet();
} else {
closeSheet();
}
addForm();
});
async function openSheet() {
var _a;
await nextTick();
await ((_a = sheetRef.value) == null ? void 0 : _a.setOpen());
}
async function closeSheet() {
var _a;
await nextTick();
await ((_a = sheetRef.value) == null ? void 0 : _a.setClose());
emits("update:open", false);
}
return (_ctx, _push, _parent, _attrs) => {
const _component_van_action_sheet = stdin_default;
const _component_AFormItem = __nuxt_component_1;
const _component_a_select = Select;
const _component_a_select_option = SelectOption;
const _component_a_divider = __nuxt_component_4;
const _component_a_collapse = Collapse;
const _component_a_collapse_panel = __nuxt_component_6;
const _component_ATag = Tag;
const _component_a_checkbox = Checkbox;
_push(ssrRenderComponent(_component_van_action_sheet, mergeProps({
show: show.value,
"onUpdate:show": ($event) => show.value = $event
}, _attrs), {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div flex w-full justify-center items-center flex-col p-2${_scopeId}><div bg-gray-500 h-2px w-2.5rem${_scopeId}></div><div class="flex gap-4 w-full items-center justify-between px-5 pt-5"${_scopeId}><div class="flex items-center"${_scopeId}>`);
_push2(ssrRenderComponent(_sfc_main$8, {
class: "w-1rem mt-2 me-5",
onClick: closeSheet
}, null, _parent2, _scopeId));
_push2(`<div mt-3 font-semibold${_scopeId}>${ssrInterpolate(unref(config).useString("productAttributes"))}</div></div><div class="mt-3 text-primary text-sm flex items-center"${_scopeId}>`);
_push2(ssrRenderComponent(BasicIconOld, { icon: "vuesax-linear:add" }, null, _parent2, _scopeId));
_push2(`<div${_scopeId}>${ssrInterpolate(unref(config).useString("addAttribute"))}</div></div></div></div><div class="max-h-60vh min-h-50vh flex flex-col gap-4 overflow-y-auto px-5 mt3 pb-10"${_scopeId}>`);
if (unref(selectedFeatures).length == 0) {
_push2(`<div class=""${_scopeId}><div class="flex justify-center mt-2"${_scopeId}>`);
_push2(ssrRenderComponent(BasicIconOld, {
icon: "vuesax-linear:tag-2",
size: "100",
color: "gray"
}, null, _parent2, _scopeId));
_push2(`</div><div class="text-center mt-2"${_scopeId}>${ssrInterpolate(unref(config).useString("introducingAttributes"))}</div>`);
_push2(ssrRenderComponent(_sfc_main$7, {
class: "h-10 mt-5",
type: "primary",
block: "",
onClick: addAttribute
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(unref(config).useString("addAttribute"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("addAttribute")), 1)
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
_push2(`<!---->`);
}
_push2(`<!--[-->`);
ssrRenderList(unref(selectedFeatures), (item, index) => {
_push2(`<!--[-->`);
if (unref(selectedFeatures)[index] === null) {
_push2(`<div class="${ssrRenderClass([unref(config).isNightStore ? "bg-zinc-8" : "bg-gray-50 shadow-lg", "rounded-lg p-4"])}"${_scopeId}><div class="mb2"${_scopeId}>${ssrInterpolate(unref(config).useString("newFeature"))}</div>`);
_push2(ssrRenderComponent(_component_AFormItem, {
label: unref(config).useString("featureName")
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<div class="flex gap-2"${_scopeId2}>`);
_push3(ssrRenderComponent(_component_a_select, {
value: unref(selectedFeatures)[index],
"onUpdate:value": ($event) => unref(selectedFeatures)[index] = $event,
class: "w-full",
placeholder: unref(config).useString("searchFeatureOrAddNewInList"),
"show-search": "",
"filter-option": (inputValue, option) => {
return option.lable.toLowerCase().indexOf(inputValue.toLowerCase()) >= 0;
},
size: "large",
onChange: handleChangeSelectedFeature,
autofocus: false,
getPopupContainer: (trigger) => trigger.parentNode,
onFocus: (e) => e.preventDefault()
}, {
notFoundContent: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`<div class="w-full text-center font-semibold"${_scopeId3}>${ssrInterpolate(unref(config).useString("pleaseSelectAtLeastOneOption"))}</div>`);
} else {
return [
createVNode("div", { class: "w-full text-center font-semibold" }, toDisplayString(unref(config).useString("pleaseSelectAtLeastOneOption")), 1)
];
}
}),
dropdownRender: withCtx(({ menuNode: menu }, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(unref(VNodes), { vnodes: menu }, null, _parent4, _scopeId3));
_push4(ssrRenderComponent(_component_a_divider, { style: { "margin": "4px 0" } }, null, _parent4, _scopeId3));
_push4(`<div class="flex items-center gap-2"${_scopeId3}>`);
_push4(ssrRenderComponent(_sfc_main$5, {
ref_for: true,
ref: "inputRef",
value: featureText.value,
"onUpdate:value": ($event) => featureText.value = $event,
"place-holder": unref(config).useString("pleaseEnterAttribute"),
class: "flex-1"
}, null, _parent4, _scopeId3));
_push4(ssrRenderComponent(_sfc_main$7, {
onClick: addFeature,
type: "primary",
class: "h-full"
}, {
default: withCtx((_3, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`<div class="flex items-center"${_scopeId4}>`);
_push5(ssrRenderComponent(BasicIconOld, { icon: "vuesax-linear:add" }, null, _parent5, _scopeId4));
_push5(`<div${_scopeId4}>${ssrInterpolate(unref(config).useString("addItem"))}</div></div>`);
} else {
return [
createVNode("div", { class: "flex items-center" }, [
createVNode(BasicIconOld, { icon: "vuesax-linear:add" }),
createVNode("div", null, toDisplayString(unref(config).useString("addItem")), 1)
])
];
}
}),
_: 2
}, _parent4, _scopeId3));
_push4(`</div>`);
} else {
return [
createVNode(unref(VNodes), { vnodes: menu }, null, 8, ["vnodes"]),
createVNode(_component_a_divider, { style: { "margin": "4px 0" } }),
createVNode("div", { class: "flex items-center gap-2" }, [
createVNode(_sfc_main$5, {
ref_for: true,
ref: "inputRef",
value: featureText.value,
"onUpdate:value": ($event) => featureText.value = $event,
"place-holder": unref(config).useString("pleaseEnterAttribute"),
class: "flex-1"
}, null, 8, ["value", "onUpdate:value", "place-holder"]),
createVNode(_sfc_main$7, {
onClick: addFeature,
type: "primary",
class: "h-full"
}, {
default: withCtx(() => [
createVNode("div", { class: "flex items-center" }, [
createVNode(BasicIconOld, { icon: "vuesax-linear:add" }),
createVNode("div", null, toDisplayString(unref(config).useString("addItem")), 1)
])
]),
_: 1
})
])
];
}
}),
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`<!--[-->`);
ssrRenderList(unref(featureItems), (val, i) => {
_push4(ssrRenderComponent(_component_a_select_option, {
lable: val.name,
key: i,
value: val.id
}, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`${ssrInterpolate(val.name)}`);
} else {
return [
createTextVNode(toDisplayString(val.name), 1)
];
}
}),
_: 2
}, _parent4, _scopeId3));
});
_push4(`<!--]-->`);
} else {
return [
(openBlock(true), createBlock(Fragment, null, renderList(unref(featureItems), (val, i) => {
return openBlock(), createBlock(_component_a_select_option, {
lable: val.name,
key: i,
value: val.id
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(val.name), 1)
]),
_: 2
}, 1032, ["lable", "value"]);
}), 128))
];
}
}),
_: 2
}, _parent3, _scopeId2));
_push3(`</div>`);
} else {
return [
createVNode("div", { class: "flex gap-2" }, [
createVNode(_component_a_select, {
value: unref(selectedFeatures)[index],
"onUpdate:value": ($event) => unref(selectedFeatures)[index] = $event,
class: "w-full",
placeholder: unref(config).useString("searchFeatureOrAddNewInList"),
"show-search": "",
"filter-option": (inputValue, option) => {
return option.lable.toLowerCase().indexOf(inputValue.toLowerCase()) >= 0;
},
size: "large",
onChange: handleChangeSelectedFeature,
autofocus: false,
getPopupContainer: (trigger) => trigger.parentNode,
onFocus: (e) => e.preventDefault()
}, {
notFoundContent: withCtx(() => [
createVNode("div", { class: "w-full text-center font-semibold" }, toDisplayString(unref(config).useString("pleaseSelectAtLeastOneOption")), 1)
]),
dropdownRender: withCtx(({ menuNode: menu }) => [
createVNode(unref(VNodes), { vnodes: menu }, null, 8, ["vnodes"]),
createVNode(_component_a_divider, { style: { "margin": "4px 0" } }),
createVNode("div", { class: "flex items-center gap-2" }, [
createVNode(_sfc_main$5, {
ref_for: true,
ref: "inputRef",
value: featureText.value,
"onUpdate:value": ($event) => featureText.value = $event,
"place-holder": unref(config).useString("pleaseEnterAttribute"),
class: "flex-1"
}, null, 8, ["value", "onUpdate:value", "place-holder"]),
createVNode(_sfc_main$7, {
onClick: addFeature,
type: "primary",
class: "h-full"
}, {
default: withCtx(() => [
createVNode("div", { class: "flex items-center" }, [
createVNode(BasicIconOld, { icon: "vuesax-linear:add" }),
createVNode("div", null, toDisplayString(unref(config).useString("addItem")), 1)
])
]),
_: 1
})
])
]),
default: withCtx(() => [
(openBlock(true), createBlock(Fragment, null, renderList(unref(featureItems), (val, i) => {
return openBlock(), createBlock(_component_a_select_option, {
lable: val.name,
key: i,
value: val.id
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(val.name), 1)
]),
_: 2
}, 1032, ["lable", "value"]);
}), 128))
]),
_: 2
}, 1032, ["value", "onUpdate:value", "placeholder", "filter-option", "getPopupContainer", "onFocus"])
])
];
}
}),
_: 2
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
_push2(`<!---->`);
}
_push2(`<!--]-->`);
});
_push2(`<!--]--><div class="h-full"${_scopeId}><div${_scopeId}><div class="w-full mb-2 attr_collapse"${_scopeId}>`);
_push2(ssrRenderComponent(_component_a_collapse, {
class: "attr_collapse",
activeKey: activeNames.value,
"onUpdate:activeKey": ($event) => activeNames.value = $event,
collapsible: "header",
accordion: "",
"expand-icon-position": "end"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<!--[-->`);
ssrRenderList(unref(items), (item, index) => {
_push3(ssrRenderComponent(_component_a_collapse_panel, {
key: item.name,
header: item.name
}, {
extra: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`<div class="flex gap-2"${_scopeId3}>`);
_push4(ssrRenderComponent(BasicIconOld, {
icon: "vuesax-linear:trash",
color: "gray",
onClick: () => {
unref(items).splice(index, 1);
unref(selectedFeatures).splice(index, 1);
}
}, null, _parent4, _scopeId3));
_push4(`<span class="border-r-1.5 ms-2"${_scopeId3}></span></div>`);
} else {
return [
createVNode("div", { class: "flex gap-2" }, [
createVNode(BasicIconOld, {
icon: "vuesax-linear:trash",
color: "gray",
onClick: () => {
unref(items).splice(index, 1);
unref(selectedFeatures).splice(index, 1);
}
}, null, 8, ["onClick"]),
createVNode("span", { class: "border-r-1.5 ms-2" })
])
];
}
}),
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
var _a, _b, _c, _d, _e, _f;
if (_push4) {
_push4(`<div class="bg-gray-2 h-1px mx4 mb2"${_scopeId3}></div><div class="${ssrRenderClass([unref(config).isNightStore ? "bg-zinc-9" : "bg-white", "mx4 my3 p4 rounded-lg mb5"])}"${_scopeId3}><div class=""${_scopeId3}>`);
_push4(ssrRenderComponent(_component_AFormItem, {
label: unref(config).useString("addFeatureValue")
}, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(ssrRenderComponent(_component_a_select, {
value: item.new_feature_id,
"onUpdate:value": ($event) => item.new_feature_id = $event,
class: "w-full",
mode: "multiple",
placeholder: unref(config).useString("pleaseSelectItems"),
onChange: ($event) => {
addToItemFeature($event, item);
},
getPopupContainer: (trigger) => trigger.parentNode,
onFocus: (e) => e.preventDefault(),
autofocus: false
}, {
dropdownRender: withCtx(({ menuNode: menu }, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(ssrRenderComponent(unref(VNodes), { vnodes: menu }, null, _parent6, _scopeId5));
_push6(ssrRenderComponent(_component_a_divider, { style: { "margin": "4px 0" } }, null, _parent6, _scopeId5));
_push6(`<div class="flex items-center gap-2"${_scopeId5}>`);
_push6(ssrRenderComponent(_sfc_main$5, {
ref_for: true,
ref: "inputRef",
value: attrText.value,
"onUpdate:value": ($event) => attrText.value = $event,
"place-holder": unref(config).useString("pleaseEnterAttribute"),
class: "flex-1"
}, null, _parent6, _scopeId5));
_push6(ssrRenderComponent(_sfc_main$7, {
onClick: ($event) => addAttr(item.id),
type: "primary",
class: "h-full"
}, {
default: withCtx((_5, _push7, _parent7, _scopeId6) => {
if (_push7) {
_push7(`<div class="flex items-center"${_scopeId6}>`);
_push7(ssrRenderComponent(BasicIconOld, { icon: "vuesax-linear:add" }, null, _parent7, _scopeId6));
_push7(`<div${_scopeId6}>${ssrInterpolate(unref(config).useString("addItem"))}</div></div>`);
} else {
return [
createVNode("div", { class: "flex items-center" }, [
createVNode(BasicIconOld, { icon: "vuesax-linear:add" }),
createVNode("div", null, toDisplayString(unref(config).useString("addItem")), 1)
])
];
}
}),
_: 2
}, _parent6, _scopeId5));
_push6(`</div>`);
} else {
return [
createVNode(unref(VNodes), { vnodes: menu }, null, 8, ["vnodes"]),
createVNode(_component_a_divider, { style: { "margin": "4px 0" } }),
createVNode("div", { class: "flex items-center gap-2" }, [
createVNode(_sfc_main$5, {
ref_for: true,
ref: "inputRef",
value: attrText.value,
"onUpdate:value": ($event) => attrText.value = $event,
"place-holder": unref(config).useString("pleaseEnterAttribute"),
class: "flex-1"
}, null, 8, ["value", "onUpdate:value", "place-holder"]),
createVNode(_sfc_main$7, {
onClick: ($event) => addAttr(item.id),
type: "primary",
class: "h-full"
}, {
default: withCtx(() => [
createVNode("div", { class: "flex items-center" }, [
createVNode(BasicIconOld, { icon: "vuesax-linear:add" }),
createVNode("div", null, toDisplayString(unref(config).useString("addItem")), 1)
])
]),
_: 2
}, 1032, ["onClick"])
])
];
}
}),
notFoundContent: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(`<div class="w-full text-center font-semibold"${_scopeId5}>${ssrInterpolate(unref(config).useString("pleaseSelectItems"))}</div>`);
} else {
return [
createVNode("div", { class: "w-full text-center font-semibold" }, toDisplayString(unref(config).useString("pleaseSelectItems")), 1)
];
}
}),
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(`<!--[-->`);
ssrRenderList(item.attribute_values, (val, i) => {
_push6(ssrRenderComponent(_component_a_select_option, {
key: i,
value: val.id,
label: val.value
}, {
default: withCtx((_6, _push7, _parent7, _scopeId6) => {
if (_push7) {
_push7(`${ssrInterpolate(val.value)}`);
} else {
return [
createTextVNode(toDisplayString(val.value), 1)
];
}
}),
_: 2
}, _parent6, _scopeId5));
});
_push6(`<!--]-->`);
} else {
return [
(openBlock(true), createBlock(Fragment, null, renderList(item.attribute_values, (val, i) => {
return openBlock(), createBlock(_component_a_select_option, {
key: i,
value: val.id,
label: val.value
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(val.value), 1)
]),
_: 2
}, 1032, ["value", "label"]);
}), 128))
];
}
}),
_: 2
}, _parent5, _scopeId4));
} else {
return [
createVNode(_component_a_select, {
value: item.new_feature_id,
"onUpdate:value": ($event) => item.new_feature_id = $event,
class: "w-full",
mode: "multiple",
placeholder: unref(config).useString("pleaseSelectItems"),
onChange: ($event) => {
addToItemFeature($event, item);
},
getPopupContainer: (trigger) => trigger.parentNode,
onFocus: (e) => e.preventDefault(),
autofocus: false
}, {
dropdownRender: withCtx(({ menuNode: menu }) => [
createVNode(unref(VNodes), { vnodes: menu }, null, 8, ["vnodes"]),
createVNode(_component_a_divider, { style: { "margin": "4px 0" } }),
createVNode("div", { class: "flex items-center gap-2" }, [
createVNode(_sfc_main$5, {
ref_for: true,
ref: "inputRef",
value: attrText.value,
"onUpdate:value": ($event) => attrText.value = $event,
"place-holder": unref(config).useString("pleaseEnterAttribute"),
class: "flex-1"
}, null, 8, ["value", "onUpdate:value", "place-holder"]),
createVNode(_sfc_main$7, {
onClick: ($event) => addAttr(item.id),
type: "primary",
class: "h-full"
}, {
default: withCtx(() => [
createVNode("div", { class: "flex items-center" }, [
createVNode(BasicIconOld, { icon: "vuesax-linear:add" }),
createVNode("div", null, toDisplayString(unref(config).useString("addItem")), 1)
])
]),
_: 2
}, 1032, ["onClick"])
])
]),
notFoundContent: withCtx(() => [
createVNode("div", { class: "w-full text-center font-semibold" }, toDisplayString(unref(config).useString("pleaseSelectItems")), 1)
]),
default: withCtx(() => [
(openBlock(true), createBlock(Fragment, null, renderList(item.attribute_values, (val, i) => {
return openBlock(), createBlock(_component_a_select_option, {
key: i,
value: val.id,
label: val.value
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(val.value), 1)
]),
_: 2
}, 1032, ["value", "label"]);
}), 128))
]),
_: 2
}, 1032, ["value", "onUpdate:value", "placeholder", "onChange", "getPopupContainer", "onFocus"])
];
}
}),
_: 2
}, _parent4, _scopeId3));
_push4(`</div>`);
if (((_a = item == null ? void 0 : item.new_feature) == null ? void 0 : _a.length) > 0) {
_push4(`<div class="bg-gray-2 h-1px -mt2 mb2"${_scopeId3}></div>`);
} else {
_push4(`<!---->`);
}
if (((_b = item == null ? void 0 : item.new_feature) == null ? void 0 : _b.length) > 0) {
_push4(`<div${_scopeId3}>${ssrInterpolate(unref(config).useString("items"))}:</div>`);
} else {
_push4(`<!---->`);
}
_push4(`<div class="flex flex-col gap-1 mt-2"${_scopeId3}><!--[-->`);
ssrRenderList(item.new_feature, (val, ind) => {
_push4(ssrRenderComponent(_component_ATag, { class: "w-full" }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`<div class="flex p-2 justify-between w-full gap-8"${_scopeId4}><div class="w-full text-base"${_scopeId4}>${ssrInterpolate(val.value)}</div>`);
_push5(ssrRenderComponent(BasicIconOld, {
icon: "vuesax-linear:trash",
color: "red",
onClick: () => {
var _a2, _b2;
(_a2 = item == null ? void 0 : item.new_feature_id) == null ? void 0 : _a2.splice(ind, 1);
(_b2 = item == null ? void 0 : item.new_feature) == null ? void 0 : _b2.splice(ind, 1);
}
}, null, _parent5, _scopeId4));
_push5(`</div>`);
} else {
return [
createVNode("div", { class: "flex p-2 justify-between w-full gap-8" }, [
createVNode("div", { class: "w-full text-base" }, toDisplayString(val.value), 1),
createVNode(BasicIconOld, {
icon: "vuesax-linear:trash",
color: "red",
onClick: () => {
var _a2, _b2;
(_a2 = item == null ? void 0 : item.new_feature_id) == null ? void 0 : _a2.splice(ind, 1);
(_b2 = item == null ? void 0 : item.new_feature) == null ? void 0 : _b2.splice(ind, 1);
}
}, null, 8, ["onClick"])
])
];
}
}),
_: 2
}, _parent4, _scopeId3));
});
_push4(`<!--]--></div>`);
if (((_c = item == null ? void 0 : item.new_feature) == null ? void 0 : _c.length) > 0) {
_push4(`<div class="flex mt-10 items-center"${_scopeId3}><div class=""${_scopeId3}>`);
_push4(ssrRenderComponent(_component_a_checkbox, {
checked: item.show_in_product,
"onUpdate:checked": ($event) => item.show_in_product = $event
}, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`${ssrInterpolate(unref(config).useString("showInProductPage"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("showInProductPage")), 1)
];
}
}),
_: 2
}, _parent4, _scopeId3));
_push4(ssrRenderComponent(_component_a_checkbox, {
onChange: ($event) => unref(updateMyAttrs)(unref(items)),
checked: item.show_in_variable,
"onUpdate:checked": ($event) => item.show_in_variable = $event
}, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`${ssrInterpolate(unref(config).useString("showInVariants"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("showInVariants")), 1)
];
}
}),
_: 2
}, _parent4, _scopeId3));
_push4(`</div></div>`);
} else {
_push4(`<!---->`);
}
_push4(`</div>`);
} else {
return [
createVNode("div", { class: "bg-gray-2 h-1px mx4 mb2" }),
createVNode("div", {
class: ["mx4 my3 p4 rounded-lg mb5", unref(config).isNightStore ? "bg-zinc-9" : "bg-white"]
}, [
createVNode("div", { class: "" }, [
createVNode(_component_AFormItem, {
label: unref(config).useString("addFeatureValue")
}, {
default: withCtx(() => [
createVNode(_component_a_select, {
value: item.new_feature_id,
"onUpdate:value": ($event) => item.new_feature_id = $event,
class: "w-full",
mode: "multiple",
placeholder: unref(config).useString("pleaseSelectItems"),
onChange: ($event) => {
addToItemFeature($event, item);
},
getPopupContainer: (trigger) => trigger.parentNode,
onFocus: (e) => e.preventDefault(),
autofocus: false
}, {
dropdownRender: withCtx(({ menuNode: menu }) => [
createVNode(unref(VNodes), { vnodes: menu }, null, 8, ["vnodes"]),
createVNode(_component_a_divider, { style: { "margin": "4px 0" } }),
createVNode("div", { class: "flex items-center gap-2" }, [
createVNode(_sfc_main$5, {
ref_for: true,
ref: "inputRef",
value: attrText.value,
"onUpdate:value": ($event) => attrText.value = $event,
"place-holder": unref(config).useString("pleaseEnterAttribute"),
class: "flex-1"
}, null, 8, ["value", "onUpdate:value", "place-holder"]),
createVNode(_sfc_main$7, {
onClick: ($event) => addAttr(item.id),
type: "primary",
class: "h-full"
}, {
default: withCtx(() => [
createVNode("div", { class: "flex items-center" }, [
createVNode(BasicIconOld, { icon: "vuesax-linear:add" }),
createVNode("div", null, toDisplayString(unref(config).useString("addItem")), 1)
])
]),
_: 2
}, 1032, ["onClick"])
])
]),
notFoundContent: withCtx(() => [
createVNode("div", { class: "w-full text-center font-semibold" }, toDisplayString(unref(config).useString("pleaseSelectItems")), 1)
]),
default: withCtx(() => [
(openBlock(true), createBlock(Fragment, null, renderList(item.attribute_values, (val, i) => {
return openBlock(), createBlock(_component_a_select_option, {
key: i,
value: val.id,
label: val.value
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(val.value), 1)
]),
_: 2
}, 1032, ["value", "label"]);
}), 128))
]),
_: 2
}, 1032, ["value", "onUpdate:value", "placeholder", "onChange", "getPopupContainer", "onFocus"])
]),
_: 2
}, 1032, ["label"])
]),
((_d = item == null ? void 0 : item.new_feature) == null ? void 0 : _d.length) > 0 ? (openBlock(), createBlock("div", {
key: 0,
class: "bg-gray-2 h-1px -mt2 mb2"
})) : createCommentVNode("", true),
((_e = item == null ? void 0 : item.new_feature) == null ? void 0 : _e.length) > 0 ? (openBlock(), createBlock("div", { key: 1 }, toDisplayString(unref(config).useString("items")) + ":", 1)) : createCommentVNode("", true),
createVNode("div", { class: "flex flex-col gap-1 mt-2" }, [
(openBlock(true), createBlock(Fragment, null, renderList(item.new_feature, (val, ind) => {
return openBlock(), createBlock(_component_ATag, { class: "w-full" }, {
default: withCtx(() => [
createVNode("div", { class: "flex p-2 justify-between w-full gap-8" }, [
createVNode("div", { class: "w-full text-base" }, toDisplayString(val.value), 1),
createVNode(BasicIconOld, {
icon: "vuesax-linear:trash",
color: "red",
onClick: () => {
var _a2, _b2;
(_a2 = item == null ? void 0 : item.new_feature_id) == null ? void 0 : _a2.splice(ind, 1);
(_b2 = item == null ? void 0 : item.new_feature) == null ? void 0 : _b2.splice(ind, 1);
}
}, null, 8, ["onClick"])
])
]),
_: 2
}, 1024);
}), 256))
]),
((_f = item == null ? void 0 : item.new_feature) == null ? void 0 : _f.length) > 0 ? (openBlock(), createBlock("div", {
key: 2,
class: "flex mt-10 items-center"
}, [
createVNode("div", { class: "" }, [
createVNode(_component_a_checkbox, {
checked: item.show_in_product,
"onUpdate:checked": ($event) => item.show_in_product = $event
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("showInProductPage")), 1)
]),
_: 2
}, 1032, ["checked", "onUpdate:checked"]),
createVNode(_component_a_checkbox, {
onChange: ($event) => unref(updateMyAttrs)(unref(items)),
checked: item.show_in_variable,
"onUpdate:checked": ($event) => item.show_in_variable = $event
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("showInVariants")), 1)
]),
_: 2
}, 1032, ["onChange", "checked", "onUpdate:checked"])
])
])) : createCommentVNode("", true)
], 2)
];
}
}),
_: 2
}, _parent3, _scopeId2));
});
_push3(`<!--]-->`);
} else {
return [
(openBlock(true), createBlock(Fragment, null, renderList(unref(items), (item, index) => {
return openBlock(), createBlock(_component_a_collapse_panel, {
key: item.name,
header: item.name
}, {
extra: withCtx(() => [
createVNode("div", { class: "flex gap-2" }, [
createVNode(BasicIconOld, {
icon: "vuesax-linear:trash",
color: "gray",
onClick: () => {
unref(items).splice(index, 1);
unref(selectedFeatures).splice(index, 1);
}
}, null, 8, ["onClick"]),
createVNode("span", { class: "border-r-1.5 ms-2" })
])
]),
default: withCtx(() => {
var _a, _b, _c;
return [
createVNode("div", { class: "bg-gray-2 h-1px mx4 mb2" }),
createVNode("div", {
class: ["mx4 my3 p4 rounded-lg mb5", unref(config).isNightStore ? "bg-zinc-9" : "bg-white"]
}, [
createVNode("div", { class: "" }, [
createVNode(_component_AFormItem, {
label: unref(config).useString("addFeatureValue")
}, {
default: withCtx(() => [
createVNode(_component_a_select, {
value: item.new_feature_id,
"onUpdate:value": ($event) => item.new_feature_id = $event,
class: "w-full",
mode: "multiple",
placeholder: unref(config).useString("pleaseSelectItems"),
onChange: ($event) => {
addToItemFeature($event, item);
},
getPopupContainer: (trigger) => trigger.parentNode,
onFocus: (e) => e.preventDefault(),
autofocus: false
}, {
dropdownRender: withCtx(({ menuNode: menu }) => [
createVNode(unref(VNodes), { vnodes: menu }, null, 8, ["vnodes"]),
createVNode(_component_a_divider, { style: { "margin": "4px 0" } }),
createVNode("div", { class: "flex items-center gap-2" }, [
createVNode(_sfc_main$5, {
ref_for: true,
ref: "inputRef",
value: attrText.value,
"onUpdate:value": ($event) => attrText.value = $event,
"place-holder": unref(config).useString("pleaseEnterAttribute"),
class: "flex-1"
}, null, 8, ["value", "onUpdate:value", "place-holder"]),
createVNode(_sfc_main$7, {
onClick: ($event) => addAttr(item.id),
type: "primary",
class: "h-full"
}, {
default: withCtx(() => [
createVNode("div", { class: "flex items-center" }, [
createVNode(BasicIconOld, { icon: "vuesax-linear:add" }),
createVNode("div", null, toDisplayString(unref(config).useString("addItem")), 1)
])
]),
_: 2
}, 1032, ["onClick"])
])
]),
notFoundContent: withCtx(() => [
createVNode("div", { class: "w-full text-center font-semibold" }, toDisplayString(unref(config).useString("pleaseSelectItems")), 1)
]),
default: withCtx(() => [
(openBlock(true), createBlock(Fragment, null, renderList(item.attribute_values, (val, i) => {
return openBlock(), createBlock(_component_a_select_option, {
key: i,
value: val.id,
label: val.value
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(val.value), 1)
]),
_: 2
}, 1032, ["value", "label"]);
}), 128))
]),
_: 2
}, 1032, ["value", "onUpdate:value", "placeholder", "onChange", "getPopupContainer", "onFocus"])
]),
_: 2
}, 1032, ["label"])
]),
((_a = item == null ? void 0 : item.new_feature) == null ? void 0 : _a.length) > 0 ? (openBlock(), createBlock("div", {
key: 0,
class: "bg-gray-2 h-1px -mt2 mb2"
})) : createCommentVNode("", true),
((_b = item == null ? void 0 : item.new_feature) == null ? void 0 : _b.length) > 0 ? (openBlock(), createBlock("div", { key: 1 }, toDisplayString(unref(config).useString("items")) + ":", 1)) : createCommentVNode("", true),
createVNode("div", { class: "flex flex-col gap-1 mt-2" }, [
(openBlock(true), createBlock(Fragment, null, renderList(item.new_feature, (val, ind) => {
return openBlock(), createBlock(_component_ATag, { class: "w-full" }, {
default: withCtx(() => [
createVNode("div", { class: "flex p-2 justify-between w-full gap-8" }, [
createVNode("div", { class: "w-full text-base" }, toDisplayString(val.value), 1),
createVNode(BasicIconOld, {
icon: "vuesax-linear:trash",
color: "red",
onClick: () => {
var _a2, _b2;
(_a2 = item == null ? void 0 : item.new_feature_id) == null ? void 0 : _a2.splice(ind, 1);
(_b2 = item == null ? void 0 : item.new_feature) == null ? void 0 : _b2.splice(ind, 1);
}
}, null, 8, ["onClick"])
])
]),
_: 2
}, 1024);
}), 256))
]),
((_c = item == null ? void 0 : item.new_feature) == null ? void 0 : _c.length) > 0 ? (openBlock(), createBlock("div", {
key: 2,
class: "flex mt-10 items-center"
}, [
createVNode("div", { class: "" }, [
createVNode(_component_a_checkbox, {
checked: item.show_in_product,
"onUpdate:checked": ($event) => item.show_in_product = $event
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("showInProductPage")), 1)
]),
_: 2
}, 1032, ["checked", "onUpdate:checked"]),
createVNode(_component_a_checkbox, {
onChange: ($event) => unref(updateMyAttrs)(unref(items)),
checked: item.show_in_variable,
"onUpdate:checked": ($event) => item.show_in_variable = $event
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("showInVariants")), 1)
]),
_: 2
}, 1032, ["onChange", "checked", "onUpdate:checked"])
])
])) : createCommentVNode("", true)
], 2)
];
}),
_: 2
}, 1032, ["header"]);
}), 128))
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div></div></div></div>`);
if (unref(selectedFeatures).length !== 0) {
_push2(`<div class="px3 py-2"${_scopeId}>`);
_push2(ssrRenderComponent(_sfc_main$7, {
size: "large",
block: "",
type: "primary",
onClick: ($event) => show.value = false
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(unref(config).useString("submitChanges"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("submitChanges")), 1)
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
_push2(`<!---->`);
}
} else {
return [
createVNode("div", {
flex: "",
"w-full": "",
"justify-center": "",
"items-center": "",
"flex-col": "",
"p-2": ""
}, [
createVNode("div", {
"bg-gray-500": "",
"h-2px": "",
"w-2.5rem": ""
}),
createVNode("div", { class: "flex gap-4 w-full items-center justify-between px-5 pt-5" }, [
createVNode("div", { class: "flex items-center" }, [
createVNode(_sfc_main$8, {
class: "w-1rem mt-2 me-5",
onClick: closeSheet
}),
createVNode("div", {
"mt-3": "",
"font-semibold": ""
}, toDisplayString(unref(config).useString("productAttributes")), 1)
]),
createVNode("div", {
class: "mt-3 text-primary text-sm flex items-center",
onClick: addAttribute
}, [
createVNode(BasicIconOld, { icon: "vuesax-linear:add" }),
createVNode("div", null, toDisplayString(unref(config).useString("addAttribute")), 1)
])
])
]),
createVNode("div", { class: "max-h-60vh min-h-50vh flex flex-col gap-4 overflow-y-auto px-5 mt3 pb-10" }, [
unref(selectedFeatures).length == 0 ? (openBlock(), createBlock("div", {
key: 0,
class: ""
}, [
createVNode("div", { class: "flex justify-center mt-2" }, [
createVNode(BasicIconOld, {
icon: "vuesax-linear:tag-2",
size: "100",
color: "gray"
})
]),
createVNode("div", { class: "text-center mt-2" }, toDisplayString(unref(config).useString("introducingAttributes")), 1),
createVNode(_sfc_main$7, {
class: "h-10 mt-5",
type: "primary",
block: "",
onClick: addAttribute
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("addAttribute")), 1)
]),
_: 1
})
])) : createCommentVNode("", true),
(openBlock(true), createBlock(Fragment, null, renderList(unref(selectedFeatures), (item, index) => {
return openBlock(), createBlock(Fragment, null, [
unref(selectedFeatures)[index] === null ? (openBlock(), createBlock("div", {
key: 0,
class: ["rounded-lg p-4", unref(config).isNightStore ? "bg-zinc-8" : "bg-gray-50 shadow-lg"]
}, [
createVNode("div", { class: "mb2" }, toDisplayString(unref(config).useString("newFeature")), 1),
createVNode(_component_AFormItem, {
label: unref(config).useString("featureName")
}, {
default: withCtx(() => [
createVNode("div", { class: "flex gap-2" }, [
createVNode(_component_a_select, {
value: unref(selectedFeatures)[index],
"onUpdate:value": ($event) => unref(selectedFeatures)[index] = $event,
class: "w-full",
placeholder: unref(config).useString("searchFeatureOrAddNewInList"),
"show-search": "",
"filter-option": (inputValue, option) => {
return option.lable.toLowerCase().indexOf(inputValue.toLowerCase()) >= 0;
},
size: "large",
onChange: handleChangeSelectedFeature,
autofocus: false,
getPopupContainer: (trigger) => trigger.parentNode,
onFocus: (e) => e.preventDefault()
}, {
notFoundContent: withCtx(() => [
createVNode("div", { class: "w-full text-center font-semibold" }, toDisplayString(unref(config).useString("pleaseSelectAtLeastOneOption")), 1)
]),
dropdownRender: withCtx(({ menuNode: menu }) => [
createVNode(unref(VNodes), { vnodes: menu }, null, 8, ["vnodes"]),
createVNode(_component_a_divider, { style: { "margin": "4px 0" } }),
createVNode("div", { class: "flex items-center gap-2" }, [
createVNode(_sfc_main$5, {
ref_for: true,
ref: "inputRef",
value: featureText.value,
"onUpdate:value": ($event) => featureText.value = $event,
"place-holder": unref(config).useString("pleaseEnterAttribute"),
class: "flex-1"
}, null, 8, ["value", "onUpdate:value", "place-holder"]),
createVNode(_sfc_main$7, {
onClick: addFeature,
type: "primary",
class: "h-full"
}, {
default: withCtx(() => [
createVNode("div", { class: "flex items-center" }, [
createVNode(BasicIconOld, { icon: "vuesax-linear:add" }),
createVNode("div", null, toDisplayString(unref(config).useString("addItem")), 1)
])
]),
_: 1
})
])
]),
default: withCtx(() => [
(openBlock(true), createBlock(Fragment, null, renderList(unref(featureItems), (val, i) => {
return openBlock(), createBlock(_component_a_select_option, {
lable: val.name,
key: i,
value: val.id
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(val.name), 1)
]),
_: 2
}, 1032, ["lable", "value"]);
}), 128))
]),
_: 2
}, 1032, ["value", "onUpdate:value", "placeholder", "filter-option", "getPopupContainer", "onFocus"])
])
]),
_: 2
}, 1032, ["label"])
], 2)) : createCommentVNode("", true)
], 64);
}), 256)),
createVNode("div", { class: "h-full" }, [
createVNode("div", null, [
createVNode("div", { class: "w-full mb-2 attr_collapse" }, [
createVNode(_component_a_collapse, {
class: "attr_collapse",
activeKey: activeNames.value,
"onUpdate:activeKey": ($event) => activeNames.value = $event,
collapsible: "header",
accordion: "",
"expand-icon-position": "end"
}, {
default: withCtx(() => [
(openBlock(true), createBlock(Fragment, null, renderList(unref(items), (item, index) => {
return openBlock(), createBlock(_component_a_collapse_panel, {
key: item.name,
header: item.name
}, {
extra: withCtx(() => [
createVNode("div", { class: "flex gap-2" }, [
createVNode(BasicIconOld, {
icon: "vuesax-linear:trash",
color: "gray",
onClick: () => {
unref(items).splice(index, 1);
unref(selectedFeatures).splice(index, 1);
}
}, null, 8, ["onClick"]),
createVNode("span", { class: "border-r-1.5 ms-2" })
])
]),
default: withCtx(() => {
var _a, _b, _c;
return [
createVNode("div", { class: "bg-gray-2 h-1px mx4 mb2" }),
createVNode("div", {
class: ["mx4 my3 p4 rounded-lg mb5", unref(config).isNightStore ? "bg-zinc-9" : "bg-white"]
}, [
createVNode("div", { class: "" }, [
createVNode(_component_AFormItem, {
label: unref(config).useString("addFeatureValue")
}, {
default: withCtx(() => [
createVNode(_component_a_select, {
value: item.new_feature_id,
"onUpdate:value": ($event) => item.new_feature_id = $event,
class: "w-full",
mode: "multiple",
placeholder: unref(config).useString("pleaseSelectItems"),
onChange: ($event) => {
addToItemFeature($event, item);
},
getPopupContainer: (trigger) => trigger.parentNode,
onFocus: (e) => e.preventDefault(),
autofocus: false
}, {
dropdownRender: withCtx(({ menuNode: menu }) => [
createVNode(unref(VNodes), { vnodes: menu }, null, 8, ["vnodes"]),
createVNode(_component_a_divider, { style: { "margin": "4px 0" } }),
createVNode("div", { class: "flex items-center gap-2" }, [
createVNode(_sfc_main$5, {
ref_for: true,
ref: "inputRef",
value: attrText.value,
"onUpdate:value": ($event) => attrText.value = $event,
"place-holder": unref(config).useString("pleaseEnterAttribute"),
class: "flex-1"
}, null, 8, ["value", "onUpdate:value", "place-holder"]),
createVNode(_sfc_main$7, {
onClick: ($event) => addAttr(item.id),
type: "primary",
class: "h-full"
}, {
default: withCtx(() => [
createVNode("div", { class: "flex items-center" }, [
createVNode(BasicIconOld, { icon: "vuesax-linear:add" }),
createVNode("div", null, toDisplayString(unref(config).useString("addItem")), 1)
])
]),
_: 2
}, 1032, ["onClick"])
])
]),
notFoundContent: withCtx(() => [
createVNode("div", { class: "w-full text-center font-semibold" }, toDisplayString(unref(config).useString("pleaseSelectItems")), 1)
]),
default: withCtx(() => [
(openBlock(true), createBlock(Fragment, null, renderList(item.attribute_values, (val, i) => {
return openBlock(), createBlock(_component_a_select_option, {
key: i,
value: val.id,
label: val.value
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(val.value), 1)
]),
_: 2
}, 1032, ["value", "label"]);
}), 128))
]),
_: 2
}, 1032, ["value", "onUpdate:value", "placeholder", "onChange", "getPopupContainer", "onFocus"])
]),
_: 2
}, 1032, ["label"])
]),
((_a = item == null ? void 0 : item.new_feature) == null ? void 0 : _a.length) > 0 ? (openBlock(), createBlock("div", {
key: 0,
class: "bg-gray-2 h-1px -mt2 mb2"
})) : createCommentVNode("", true),
((_b = item == null ? void 0 : item.new_feature) == null ? void 0 : _b.length) > 0 ? (openBlock(), createBlock("div", { key: 1 }, toDisplayString(unref(config).useString("items")) + ":", 1)) : createCommentVNode("", true),
createVNode("div", { class: "flex flex-col gap-1 mt-2" }, [
(openBlock(true), createBlock(Fragment, null, renderList(item.new_feature, (val, ind) => {
return openBlock(), createBlock(_component_ATag, { class: "w-full" }, {
default: withCtx(() => [
createVNode("div", { class: "flex p-2 justify-between w-full gap-8" }, [
createVNode("div", { class: "w-full text-base" }, toDisplayString(val.value), 1),
createVNode(BasicIconOld, {
icon: "vuesax-linear:trash",
color: "red",
onClick: () => {
var _a2, _b2;
(_a2 = item == null ? void 0 : item.new_feature_id) == null ? void 0 : _a2.splice(ind, 1);
(_b2 = item == null ? void 0 : item.new_feature) == null ? void 0 : _b2.splice(ind, 1);
}
}, null, 8, ["onClick"])
])
]),
_: 2
}, 1024);
}), 256))
]),
((_c = item == null ? void 0 : item.new_feature) == null ? void 0 : _c.length) > 0 ? (openBlock(), createBlock("div", {
key: 2,
class: "flex mt-10 items-center"
}, [
createVNode("div", { class: "" }, [
createVNode(_component_a_checkbox, {
checked: item.show_in_product,
"onUpdate:checked": ($event) => item.show_in_product = $event
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("showInProductPage")), 1)
]),
_: 2
}, 1032, ["checked", "onUpdate:checked"]),
createVNode(_component_a_checkbox, {
onChange: ($event) => unref(updateMyAttrs)(unref(items)),
checked: item.show_in_variable,
"onUpdate:checked": ($event) => item.show_in_variable = $event
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("showInVariants")), 1)
]),
_: 2
}, 1032, ["onChange", "checked", "onUpdate:checked"])
])
])) : createCommentVNode("", true)
], 2)
];
}),
_: 2
}, 1032, ["header"]);
}), 128))
]),
_: 1
}, 8, ["activeKey", "onUpdate:activeKey"])
])
])
])
]),
unref(selectedFeatures).length !== 0 ? (openBlock(), createBlock("div", {
key: 0,
class: "px3 py-2"
}, [
createVNode(_sfc_main$7, {
size: "large",
block: "",
type: "primary",
onClick: ($event) => show.value = false
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("submitChanges")), 1)
]),
_: 1
}, 8, ["onClick"])
])) : createCommentVNode("", true)
];
}
}),
_: 1
}, _parent));
};
}
});
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("views/add/product/components/AttributeAddEditInProduct.vue");
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
};
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
__name: "BasicButtonOld",
__ssrInlineRender: true,
props: {
icon: {},
iconSize: { default: baseButtonIconSize },
iconClass: { default: "" },
suffixIcon: { type: Boolean },
type: {},
size: {},
loading: { type: Boolean }
},
setup(__props) {
const slot = useSlots();
const _class = computed(() => {
if (!slot.default) {
return "!px-1 !py-1";
}
return "";
});
const _loading = computed(() => {
if (props.loading) {
return "flex";
} else return "unset";
});
const { prefixCls } = usePrefix("main-button");
const props = __props;
return (_ctx, _push, _parent, _attrs) => {
const _component_AButton = Button;
const _cssVars = { style: {
":--4c652d46": _loading.value
} };
_push(ssrRenderComponent(_component_AButton, mergeProps({
type: props.type,
size: props.size,
class: [unref(prefixCls), _class.value],
loading: props.loading
}, _attrs, _cssVars), {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div class="${ssrRenderClass([[{ "flex-row-reverse": _ctx.suffixIcon }], "flex items-center gap-1 justify-center flex-row-reverse gap-2 py-1 px-2"])}"${_scopeId}>`);
if (_ctx.$slots.default) {
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
} else {
_push2(`<!---->`);
}
if (_ctx.icon) {
_push2(ssrRenderComponent(BasicIconOld, {
size: _ctx.iconSize,
icon: _ctx.icon,
class: _ctx.iconClass
}, null, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
_push2(`</div>`);
} else {
return [
createVNode("div", {
class: ["flex items-center gap-1 justify-center flex-row-reverse gap-2 py-1 px-2", [{ "flex-row-reverse": _ctx.suffixIcon }]]
}, [
_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true),
_ctx.icon ? (openBlock(), createBlock(BasicIconOld, {
key: 1,
size: _ctx.iconSize,
icon: _ctx.icon,
class: _ctx.iconClass
}, null, 8, ["size", "icon", "class"])) : createCommentVNode("", true)
], 2)
];
}
}),
_: 3
}, _parent));
};
}
});
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/BasicPacks/BasicButtonOld.vue");
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "index",
__ssrInlineRender: true,
emits: ["update:visible", "update:isEdit", "success"],
setup(__props, { emit: __emit }) {
const config = useConfigStore();
const isVideo = (file) => (file == null ? void 0 : file.includes(".mp4")) || (file == null ? void 0 : file.includes("video"));
const modules = [EffectCoverflow, Pagination];
ref("1");
const collections = ref(null);
const addFeatureModal = ref(false);
const route = useRoute();
const router = useRouter();
const loading = ref(false);
const dragKey = ref(0);
let selectedFeaturesLength = 0;
function onBackPage() {
router.back();
}
function deleteVariant(val) {
var _a, _b, _c;
(_b = variants.value) == null ? void 0 : _b.splice((_a = variants.value) == null ? void 0 : _a.indexOf(val), 1);
formFields.variants.splice((_c = variants.value) == null ? void 0 : _c.indexOf(val), 1);
}
function changeCollections() {
if (formFields.collection_id !== 1 || formFields.collection_id !== 2)
formFields.auto_calculate = true;
}
watch(selectedFeatures, async (new_features, oldFeatures) => {
console.log(new_features, 4444444444);
if ((new_features == null ? void 0 : new_features.length) > selectedFeaturesLength) {
try {
loading.value = true;
console.log(new_features, 5555555);
await setItems(new_features);
selectedFeaturesLength = selectedFeatures.value.length;
dragKey.value++;
} catch (e) {
console.log(e);
} finally {
loading.value = false;
}
} else {
const deletedObject = differenceBy(oldFeatures, new_features);
selectedFeaturesLength = selectedFeatures.value.length;
const index = items.value.findIndex((x) => deletedObject[0] === x.id);
if (index !== -1) {
variants.value.forEach((val) => {
val.attribute_values[index] = null;
});
items.value.splice(index, 1);
dragKey.value++;
}
}
}, { deep: true });
watch(
items,
(newValue) => {
updateMyAttrs(items.value, 0);
},
{ deep: true }
);
useProductStore();
function reloadFeatures() {
getFeatures();
}
const formRef = ref();
ref(["0"]);
cloneDeep(formFields);
ref(null);
ref([]);
const isEditForm = ref(false);
ref([{ field: "athlete", rowDrag: true }, { field: "country" }]);
shallowRef();
const attributeData = ref([]);
ref({
width: 170,
filter: true
});
ref(null);
return (_ctx, _push, _parent, _attrs) => {
const _component_AForm = Form;
const _component_AFormItem = __nuxt_component_1;
const _component_a_select = Select;
const _component_a_select_option = SelectOption;
const _component_a_radio_group = __nuxt_component_1$1;
const _component_a_radio = Radio;
const _component_a_tag = Tag;
_push(`<!--[--><div><div class="flex absolute top-0 right-0 left-0 gap-8 items-center justify-between p-4"><div class="flex gap-4">`);
_push(ssrRenderComponent(BasicIconOld, {
icon: unref(config).isRTL ? "vuesax-linear:arrow-right" : "vuesax-linear:arrow-left",
onClick: onBackPage
}, null, _parent));
_push(`<div font-semibold>${ssrInterpolate(unref(route).name == "infProduct_edit" ? unref(config).useString("editProduct") : unref(config).useString("newProduct"))}</div></div><div class="text-primary text-sm">${ssrInterpolate(unref(route).name == "infProduct_edit" ? unref(config).useString("edit") : unref(config).useString("create"))}</div></div><div class="swiper-container pt-4rem">`);
_push(ssrRenderComponent(unref(Swiper), {
effect: "coverflow",
grabCursor: true,
centeredSlides: true,
slidesPerView: "auto",
coverflowEffect: {
rotate: 50,
stretch: -10,
depth: 90,
modifier: 1,
slideShadows: true
},
pagination: true,
modules,
class: "mySwiper"
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<!--[-->`);
ssrRenderList([unref(original), ...unref(mediaFilesUrl)], (media, index) => {
_push2(ssrRenderComponent(unref(SwiperSlide), {
key: index,
class: "small-slide"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<div class="media-wrapper"${_scopeId2}>`);
if (isVideo(media.url)) {
_push3(`<video${ssrRenderAttr("src", media.url)} controls class="media video"${_scopeId2}></video>`);
} else {
_push3(`<img${ssrRenderAttr("src", media.url)} class="media"${_scopeId2}>`);
}
_push3(`</div>`);
} else {
return [
createVNode("div", { class: "media-wrapper" }, [
isVideo(media.url) ? (openBlock(), createBlock("video", {
key: 0,
src: media.url,
controls: "",
class: "media video"
}, null, 8, ["src"])) : (openBlock(), createBlock("img", {
key: 1,
src: media.url,
class: "media"
}, null, 8, ["src"]))
])
];
}
}),
_: 2
}, _parent2, _scopeId));
});
_push2(`<!--]-->`);
_push2(ssrRenderComponent(unref(SwiperSlide), { class: "small-slide" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<div class="h-full w-full flex justify-center items-center"${_scopeId2}><div class="rounded-full bg-gray-50 flex items-center justify-center aspect-square w-16 shadow-lg text-xl text-gray-400"${_scopeId2}><span${_scopeId2}>+</span></div></div>`);
} else {
return [
createVNode("div", { class: "h-full w-full flex justify-center items-center" }, [
createVNode("div", {
class: "rounded-full bg-gray-50 flex items-center justify-center aspect-square w-16 shadow-lg text-xl text-gray-400",
onClick: ($event) => unref(router).back()
}, [
createVNode("span", null, "+")
], 8, ["onClick"])
])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
(openBlock(true), createBlock(Fragment, null, renderList([unref(original), ...unref(mediaFilesUrl)], (media, index) => {
return openBlock(), createBlock(unref(SwiperSlide), {
key: index,
class: "small-slide"
}, {
default: withCtx(() => [
createVNode("div", { class: "media-wrapper" }, [
isVideo(media.url) ? (openBlock(), createBlock("video", {
key: 0,
src: media.url,
controls: "",
class: "media video"
}, null, 8, ["src"])) : (openBlock(), createBlock("img", {
key: 1,
src: media.url,
class: "media"
}, null, 8, ["src"]))
])
]),
_: 2
}, 1024);
}), 128)),
createVNode(unref(SwiperSlide), { class: "small-slide" }, {
default: withCtx(() => [
createVNode("div", { class: "h-full w-full flex justify-center items-center" }, [
createVNode("div", {
class: "rounded-full bg-gray-50 flex items-center justify-center aspect-square w-16 shadow-lg text-xl text-gray-400",
onClick: ($event) => unref(router).back()
}, [
createVNode("span", null, "+")
], 8, ["onClick"])
])
]),
_: 1
})
];
}
}),
_: 1
}, _parent));
_push(`</div><div class="p-4 pb-10">`);
_push(ssrRenderComponent(_component_AForm, {
model: unref(formFields),
ref_key: "formRef",
ref: formRef
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_AFormItem, {
label: "",
name: "description",
rules: unref(inputRules)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$3, {
"place-holder": unref(config).useString("addACaption"),
value: unref(formFields).description,
"onUpdate:value": ($event) => unref(formFields).description = $event,
class: "customCaption border-zinc-5"
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$3, {
"place-holder": unref(config).useString("addACaption"),
value: unref(formFields).description,
"onUpdate:value": ($event) => unref(formFields).description = $event,
class: "customCaption border-zinc-5"
}, null, 8, ["place-holder", "value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`<div class="border-1 border-solid mt-5 py-5 border-gray-500 rounded-lg px-3"${_scopeId}><div class="${ssrRenderClass([unref(config).isNightStore ? "bg-[#121212]" : "bg-white", "relative top--8 px-2 w-fit flex gap-2 items-center"])}"${_scopeId}>`);
_push2(ssrRenderComponent(BasicIconOld, { icon: "vuesax-linear:document-text" }, null, _parent2, _scopeId));
_push2(`<div class="text-[18px]"${_scopeId}>${ssrInterpolate(unref(config).useString("productInformation"))}</div></div>`);
_push2(ssrRenderComponent(_sfc_main$4, {
rules: unref(inputRulesNoMessage)(),
value: unref(formFields).title_fa,
"onUpdate:value": ($event) => unref(formFields).title_fa = $event,
label: "name",
name: "title_fa"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("name"),
value: unref(formFields).title_fa,
"onUpdate:value": ($event) => unref(formFields).title_fa = $event
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("name"),
value: unref(formFields).title_fa,
"onUpdate:value": ($event) => unref(formFields).title_fa = $event
}, null, 8, ["place-holder", "value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).collection_id,
"onUpdate:value": ($event) => unref(formFields).collection_id = $event,
label: "category"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$6, {
autofocus: false,
value: unref(formFields).collection_id,
"onUpdate:value": ($event) => unref(formFields).collection_id = $event,
items: collections.value,
placeholder: unref(config).useString("selectAnOption"),
size: "small",
"key-name": "id",
"value-name": "title",
focusable: false,
onChange: changeCollections,
getPopupContainer: (trigger) => trigger.parentNode
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$6, {
autofocus: false,
value: unref(formFields).collection_id,
"onUpdate:value": ($event) => unref(formFields).collection_id = $event,
items: collections.value,
placeholder: unref(config).useString("selectAnOption"),
size: "small",
"key-name": "id",
"value-name": "title",
focusable: false,
onChange: changeCollections,
getPopupContainer: (trigger) => trigger.parentNode
}, null, 8, ["value", "onUpdate:value", "items", "placeholder", "getPopupContainer"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).code,
"onUpdate:value": ($event) => unref(formFields).code = $event,
label: "code"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("code"),
value: unref(formFields).code,
"onUpdate:value": ($event) => unref(formFields).code = $event
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("code"),
value: unref(formFields).code,
"onUpdate:value": ($event) => unref(formFields).code = $event
}, null, 8, ["place-holder", "value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
if (unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2) {
_push2(`<div${_scopeId}>`);
if (unref(config).useModule("productPercentFeeField")) {
_push2(ssrRenderComponent(_sfc_main$4, {
rules: unref(justNumberNoMessage)(),
value: unref(formFields).rial_fee,
"onUpdate:value": ($event) => unref(formFields).rial_fee = $event,
label: "rialFee",
name: "rial_fee"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("rialFee"),
value: unref(formFields).rial_fee,
"onUpdate:value": ($event) => unref(formFields).rial_fee = $event,
type: "price",
"addon-after": unref(config).lang == "en" ? unref(config).priceUnit : false,
"addon-before": unref(config).lang == "fa" ? unref(config).priceUnit : false
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("rialFee"),
value: unref(formFields).rial_fee,
"onUpdate:value": ($event) => unref(formFields).rial_fee = $event,
type: "price",
"addon-after": unref(config).lang == "en" ? unref(config).priceUnit : false,
"addon-before": unref(config).lang == "fa" ? unref(config).priceUnit : false
}, null, 8, ["place-holder", "value", "onUpdate:value", "addon-after", "addon-before"])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
if (unref(config).useModule("productPercentFeeField")) {
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).percent_fee,
"onUpdate:value": ($event) => unref(formFields).percent_fee = $event,
label: "percentFee",
rules: unref(justNumberRequiredNoMessage)(),
name: "percent_fee"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("percentFee"),
value: unref(formFields).percent_fee,
"onUpdate:value": ($event) => unref(formFields).percent_fee = $event,
type: "number",
inputmode: "decimal",
"addon-after": unref(config).lang == "en" ? "%" : false,
"addon-before": unref(config).lang == "fa" ? "%" : false
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("percentFee"),
value: unref(formFields).percent_fee,
"onUpdate:value": ($event) => unref(formFields).percent_fee = $event,
type: "number",
inputmode: "decimal",
"addon-after": unref(config).lang == "en" ? "%" : false,
"addon-before": unref(config).lang == "fa" ? "%" : false
}, null, 8, ["place-holder", "value", "onUpdate:value", "addon-after", "addon-before"])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
_push2(`</div>`);
} else {
_push2(`<!---->`);
}
if (unref(config).useModule("productWeightField") && unref(priceType) === 1 && (unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2)) {
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).weight,
"onUpdate:value": ($event) => unref(formFields).weight = $event,
label: "weight",
rules: unref(justNumberRequiredNoMessage)(),
name: "weight"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("weight"),
value: unref(formFields).weight,
"onUpdate:value": ($event) => unref(formFields).weight = $event,
type: "number",
inputmode: "decimal"
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("weight"),
value: unref(formFields).weight,
"onUpdate:value": ($event) => unref(formFields).weight = $event,
type: "number",
inputmode: "decimal"
}, null, 8, ["place-holder", "value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
if (unref(priceType) === 1) {
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).price,
"onUpdate:value": ($event) => unref(formFields).price = $event,
label: "price",
rules: unref(formFields).auto_calculate ? "" : unref(justNumberRequiredNoMessage)(),
name: "price"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("price"),
value: unref(formFields).price,
"onUpdate:value": ($event) => unref(formFields).price = $event,
type: "price",
disabled: unref(formFields).auto_calculate,
"addon-before": unref(config).priceUnit
}, createSlots({ _: 2 }, [
unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2 ? {
name: "addonAfter",
fn: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_select, {
value: unref(formFields).auto_calculate,
"onUpdate:value": ($event) => unref(formFields).auto_calculate = $event,
style: { "width": "90px" },
onChange: ($event) => unref(formFields).auto_calculate ? unref(formFields).price = void 0 : ""
}, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(ssrRenderComponent(_component_a_select_option, { value: true }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(`${ssrInterpolate(unref(config).useString("auto"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("auto")), 1)
];
}
}),
_: 1
}, _parent5, _scopeId4));
_push5(ssrRenderComponent(_component_a_select_option, { value: false }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(`${ssrInterpolate(unref(config).useString("manual"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("manual")), 1)
];
}
}),
_: 1
}, _parent5, _scopeId4));
} else {
return [
createVNode(_component_a_select_option, { value: true }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("auto")), 1)
]),
_: 1
}),
createVNode(_component_a_select_option, { value: false }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("manual")), 1)
]),
_: 1
})
];
}
}),
_: 1
}, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_select, {
value: unref(formFields).auto_calculate,
"onUpdate:value": ($event) => unref(formFields).auto_calculate = $event,
style: { "width": "90px" },
onChange: ($event) => unref(formFields).auto_calculate ? unref(formFields).price = void 0 : ""
}, {
default: withCtx(() => [
createVNode(_component_a_select_option, { value: true }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("auto")), 1)
]),
_: 1
}),
createVNode(_component_a_select_option, { value: false }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("manual")), 1)
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value", "onChange"])
];
}
}),
key: "0"
} : void 0
]), _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("price"),
value: unref(formFields).price,
"onUpdate:value": ($event) => unref(formFields).price = $event,
type: "price",
disabled: unref(formFields).auto_calculate,
"addon-before": unref(config).priceUnit
}, createSlots({ _: 2 }, [
unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2 ? {
name: "addonAfter",
fn: withCtx(() => [
createVNode(_component_a_select, {
value: unref(formFields).auto_calculate,
"onUpdate:value": ($event) => unref(formFields).auto_calculate = $event,
style: { "width": "90px" },
onChange: ($event) => unref(formFields).auto_calculate ? unref(formFields).price = void 0 : ""
}, {
default: withCtx(() => [
createVNode(_component_a_select_option, { value: true }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("auto")), 1)
]),
_: 1
}),
createVNode(_component_a_select_option, { value: false }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("manual")), 1)
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value", "onChange"])
]),
key: "0"
} : void 0
]), 1032, ["place-holder", "value", "onUpdate:value", "disabled", "addon-before"])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
if (unref(priceType) === 1) {
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).count,
"onUpdate:value": ($event) => unref(formFields).count = $event,
label: "count",
rules: unref(justNumberNoMessage)(),
name: "count"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("count"),
value: unref(formFields).count,
"onUpdate:value": ($event) => unref(formFields).count = $event,
type: "number"
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("count"),
value: unref(formFields).count,
"onUpdate:value": ($event) => unref(formFields).count = $event,
type: "number"
}, null, 8, ["place-holder", "value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
_push2(ssrRenderComponent(_sfc_main$4, {
height: "9rem",
value: unref(formFields).count,
"onUpdate:value": ($event) => unref(formFields).count = $event,
label: "pack"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_radio_group, {
class: "flex flex-col gap-4",
value: unref(formFields).sell_type,
"onUpdate:value": ($event) => unref(formFields).sell_type = $event
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_radio, { value: "numeric" }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`<div class="!flex !flex-col !w-full"${_scopeId4}><div class=""${_scopeId4}>${ssrInterpolate(unref(config).useString("single"))}</div><div class="!text-xs text-gray-5"${_scopeId4}>${ssrInterpolate(unref(config).useString("easyDes"))}</div></div>`);
} else {
return [
createVNode("div", { class: "!flex !flex-col !w-full" }, [
createVNode("div", { class: "" }, toDisplayString(unref(config).useString("single")), 1),
createVNode("div", { class: "!text-xs text-gray-5" }, toDisplayString(unref(config).useString("easyDes")), 1)
])
];
}
}),
_: 1
}, _parent4, _scopeId3));
_push4(ssrRenderComponent(_component_a_radio, { value: "box" }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`<div class="!flex !flex-col !w-full"${_scopeId4}><div class=""${_scopeId4}>${ssrInterpolate(unref(config).useString("box"))}</div><div class="!text-xs text-gray-5"${_scopeId4}>${ssrInterpolate(unref(config).useString("variantDes"))}</div></div>`);
} else {
return [
createVNode("div", { class: "!flex !flex-col !w-full" }, [
createVNode("div", { class: "" }, toDisplayString(unref(config).useString("box")), 1),
createVNode("div", { class: "!text-xs text-gray-5" }, toDisplayString(unref(config).useString("variantDes")), 1)
])
];
}
}),
_: 1
}, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_radio, { value: "numeric" }, {
default: withCtx(() => [
createVNode("div", { class: "!flex !flex-col !w-full" }, [
createVNode("div", { class: "" }, toDisplayString(unref(config).useString("single")), 1),
createVNode("div", { class: "!text-xs text-gray-5" }, toDisplayString(unref(config).useString("easyDes")), 1)
])
]),
_: 1
}),
createVNode(_component_a_radio, { value: "box" }, {
default: withCtx(() => [
createVNode("div", { class: "!flex !flex-col !w-full" }, [
createVNode("div", { class: "" }, toDisplayString(unref(config).useString("box")), 1),
createVNode("div", { class: "!text-xs text-gray-5" }, toDisplayString(unref(config).useString("variantDes")), 1)
])
]),
_: 1
})
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_radio_group, {
class: "flex flex-col gap-4",
value: unref(formFields).sell_type,
"onUpdate:value": ($event) => unref(formFields).sell_type = $event
}, {
default: withCtx(() => [
createVNode(_component_a_radio, { value: "numeric" }, {
default: withCtx(() => [
createVNode("div", { class: "!flex !flex-col !w-full" }, [
createVNode("div", { class: "" }, toDisplayString(unref(config).useString("single")), 1),
createVNode("div", { class: "!text-xs text-gray-5" }, toDisplayString(unref(config).useString("easyDes")), 1)
])
]),
_: 1
}),
createVNode(_component_a_radio, { value: "box" }, {
default: withCtx(() => [
createVNode("div", { class: "!flex !flex-col !w-full" }, [
createVNode("div", { class: "" }, toDisplayString(unref(config).useString("box")), 1),
createVNode("div", { class: "!text-xs text-gray-5" }, toDisplayString(unref(config).useString("variantDes")), 1)
])
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
if (unref(formFields).sell_type === "box") {
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).box_size,
"onUpdate:value": ($event) => unref(formFields).box_size = $event,
name: "box_size",
rules: unref(inputRules)(),
label: "countInBox"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
value: unref(formFields).box_size,
"onUpdate:value": ($event) => unref(formFields).box_size = $event,
type: "number",
onClick: unref(hotSelect),
"addon-after": unref(config).lang == "en" ? unref(config).useString("numberInCarton") : false,
"addon-before": unref(config).lang == "fa" ? unref(config).useString("numberInCarton") : false
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
value: unref(formFields).box_size,
"onUpdate:value": ($event) => unref(formFields).box_size = $event,
type: "number",
onClick: unref(hotSelect),
"addon-after": unref(config).lang == "en" ? unref(config).useString("numberInCarton") : false,
"addon-before": unref(config).lang == "fa" ? unref(config).useString("numberInCarton") : false
}, null, 8, ["value", "onUpdate:value", "onClick", "addon-after", "addon-before"])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
_push2(`</div>`);
if (unref(priceType) === 1) {
_push2(`<div class="border-1 border-solid mt-5 py-5 border-gray-500 rounded-lg px-3"${_scopeId}><div class="${ssrRenderClass([unref(config).isNightStore ? "bg-[#121212]" : "bg-white", "relative top--8 px-2 w-fit flex gap-2 items-center"])}"${_scopeId}>`);
_push2(ssrRenderComponent(BasicIconOld, { icon: "vuesax-linear:discount-circle" }, null, _parent2, _scopeId));
_push2(`<div class="text-[18px]"${_scopeId}>${ssrInterpolate(unref(config).useString("discount"))}</div></div>`);
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).discount_type,
"onUpdate:value": ($event) => unref(formFields).discount_type = $event,
label: "discountType"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_radio_group, {
value: unref(formFields).discount_type,
"onUpdate:value": ($event) => unref(formFields).discount_type = $event
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_radio, { value: void 0 }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`${ssrInterpolate(unref(config).useString("disable"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("disable")), 1)
];
}
}),
_: 1
}, _parent4, _scopeId3));
_push4(ssrRenderComponent(_component_a_radio, { value: "simple" }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`${ssrInterpolate(unref(config).useString("simple"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("simple")), 1)
];
}
}),
_: 1
}, _parent4, _scopeId3));
_push4(ssrRenderComponent(_component_a_radio, { value: "percent" }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`${ssrInterpolate(unref(config).useString("percent"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("percent")), 1)
];
}
}),
_: 1
}, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_radio, { value: void 0 }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("disable")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "simple" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("simple")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "percent" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("percent")), 1)
]),
_: 1
})
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_radio_group, {
value: unref(formFields).discount_type,
"onUpdate:value": ($event) => unref(formFields).discount_type = $event
}, {
default: withCtx(() => [
createVNode(_component_a_radio, { value: void 0 }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("disable")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "simple" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("simple")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "percent" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("percent")), 1)
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
if (unref(priceType) === 1 && unref(formFields).discount_type) {
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).discount,
"onUpdate:value": ($event) => unref(formFields).discount = $event,
rules: unref(justNumberRequired)(),
name: "discount",
label: "amount"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
if (unref(formFields).discount_type) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("amount"),
value: unref(formFields).discount,
"onUpdate:value": ($event) => unref(formFields).discount = $event,
type: unref(formFields).discount_type === "simple" ? "price" : "number",
"addon-before": unref(formFields).discount_type === "simple" ? unref(config).priceUnit : "%"
}, null, _parent3, _scopeId2));
} else {
_push3(`<!---->`);
}
} else {
return [
unref(formFields).discount_type ? (openBlock(), createBlock(_sfc_main$5, {
key: 0,
"place-holder": unref(config).useString("amount"),
value: unref(formFields).discount,
"onUpdate:value": ($event) => unref(formFields).discount = $event,
type: unref(formFields).discount_type === "simple" ? "price" : "number",
"addon-before": unref(formFields).discount_type === "simple" ? unref(config).priceUnit : "%"
}, null, 8, ["place-holder", "value", "onUpdate:value", "type", "addon-before"])) : createCommentVNode("", true)
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
_push2(`</div>`);
} else {
_push2(`<!---->`);
}
if (isEditForm.value) {
_push2(`<div class="border-1 border-solid mt-5 py-5 border-gray-500 rounded-lg px-3"${_scopeId}><div class="${ssrRenderClass([unref(config).isNightStore ? "bg-[#121212]" : "bg-white", "relative top--8 px-2 w-fit flex gap-2 items-center"])}"${_scopeId}>`);
_push2(ssrRenderComponent(BasicIconOld, { icon: "vuesax-linear:google-1" }, null, _parent2, _scopeId));
_push2(`<div class="text-[18px]"${_scopeId}>${ssrInterpolate(unref(config).useString("seo"))}</div></div>`);
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).seo_title,
"onUpdate:value": ($event) => unref(formFields).seo_title = $event,
name: "seo_title",
label: "seoTitle"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("seoTitle"),
value: unref(formFields).seo_title,
"onUpdate:value": ($event) => unref(formFields).seo_title = $event
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("seoTitle"),
value: unref(formFields).seo_title,
"onUpdate:value": ($event) => unref(formFields).seo_title = $event
}, null, 8, ["place-holder", "value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).meta,
"onUpdate:value": ($event) => unref(formFields).meta = $event,
name: "meta",
label: "meta"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("meta"),
value: unref(formFields).meta,
"onUpdate:value": ($event) => unref(formFields).meta = $event
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("meta"),
value: unref(formFields).meta,
"onUpdate:value": ($event) => unref(formFields).meta = $event
}, null, 8, ["place-holder", "value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).meta,
"onUpdate:value": ($event) => unref(formFields).meta = $event,
key: "body",
class: "mt-3",
label: "aboutProduct"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<div dir="ltr"${_scopeId2}>`);
_push3(ssrRenderComponent(_sfc_main$3, {
value: unref(formFields).body,
"place-holder": unref(config).useString("writeAnyThingAboutProduct")
}, null, _parent3, _scopeId2));
_push3(`</div>`);
} else {
return [
createVNode("div", { dir: "ltr" }, [
createVNode(_sfc_main$3, {
value: unref(formFields).body,
"place-holder": unref(config).useString("writeAnyThingAboutProduct")
}, null, 8, ["value", "place-holder"])
])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
_push2(`<!---->`);
}
_push2(`<div class="border-1 border-solid mt-5 py-5 border-gray-500 rounded-lg px-3"${_scopeId}><div class="${ssrRenderClass([unref(config).isNightStore ? "bg-[#121212]" : "bg-white", "relative top--8 px-2 w-fit flex gap-2 items-center"])}"${_scopeId}>`);
_push2(ssrRenderComponent(BasicIconOld, { icon: "vuesax-linear:layer" }, null, _parent2, _scopeId));
_push2(`<div class="text-[18px]"${_scopeId}>${ssrInterpolate(unref(config).useString("attributes"))}</div></div>`);
if (unref(items).length === 0) {
_push2(`<div class="flex items-center gap-2"${_scopeId}><div class="gap-2"${_scopeId}><div class="mb-1"${_scopeId}>${ssrInterpolate(unref(config).useString("desAttribute"))}</div>`);
_push2(ssrRenderComponent(_sfc_main$7, {
type: "primary",
onClick: ($event) => addFeatureModal.value = true,
size: "small",
class: "!h-full !py-0 mt2"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<div class="flex items-center"${_scopeId2}>`);
_push3(ssrRenderComponent(BasicIconOld, { icon: "vuesax-linear:add" }, null, _parent3, _scopeId2));
_push3(`<div${_scopeId2}>${ssrInterpolate(unref(config).useString("addAttribute"))}</div></div>`);
} else {
return [
createVNode("div", { class: "flex items-center" }, [
createVNode(BasicIconOld, { icon: "vuesax-linear:add" }),
createVNode("div", null, toDisplayString(unref(config).useString("addAttribute")), 1)
])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
_push2(ssrRenderComponent(BasicIconOld, {
icon: "vuesax-linear:tag-2",
size: "50",
color: "gray"
}, null, _parent2, _scopeId));
_push2(`</div>`);
} else {
_push2(`<div${_scopeId}><!--[-->`);
ssrRenderList(unref(items), (val, i) => {
_push2(`<div class="mb3"${_scopeId}><div class="flex gap-2"${_scopeId}><div${_scopeId}>`);
_push2(ssrRenderComponent(BasicIconOld, { icon: "vuesax-linear:note-2" }, null, _parent2, _scopeId));
_push2(`</div><div${_scopeId}>${ssrInterpolate(val.name)}</div></div><div class="mt2"${_scopeId}><!--[-->`);
ssrRenderList(val.new_feature, (attr) => {
_push2(ssrRenderComponent(_component_a_tag, null, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(attr.value)}`);
} else {
return [
createTextVNode(toDisplayString(attr.value), 1)
];
}
}),
_: 2
}, _parent2, _scopeId));
});
_push2(`<!--]--></div></div>`);
});
_push2(`<!--]--><div class="flex justify-end"${_scopeId}>`);
_push2(ssrRenderComponent(_sfc_main$1, {
type: "primary",
icon: "vuesax-linear:edit-2",
onClick: ($event) => addFeatureModal.value = true
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(unref(config).useString("edit"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("edit")), 1)
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div></div>`);
}
_push2(`</div>`);
if (unref(priceType) == 2) {
_push2(`<div class="border-1 border-solid mt-5 py-5 border-gray-500 rounded-lg px-3"${_scopeId}><div class="${ssrRenderClass([unref(config).isNightStore ? "bg-[#121212]" : "bg-white", "relative top--8 px-2 w-fit flex gap-2 items-center"])}"${_scopeId}>`);
_push2(ssrRenderComponent(BasicIconOld, { icon: "vuesax-linear:data" }, null, _parent2, _scopeId));
_push2(`<div class="text-[18px]"${_scopeId}>${ssrInterpolate(unref(config).useString("variants"))}</div></div>`);
_push2(ssrRenderComponent(_sfc_main$7, {
disabled: unref(myAttributes).length === 0,
type: "primary",
class: "px-10 !h-2.5rem",
size: "small",
block: "",
onClick: ($event) => unref(addToVariants)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<div class="flex"${_scopeId2}>`);
_push3(ssrRenderComponent(BasicIconOld, { icon: "vuesax-linear:add" }, null, _parent3, _scopeId2));
_push3(`<div${_scopeId2}>${ssrInterpolate(unref(config).useString("addVariant"))}</div></div>`);
} else {
return [
createVNode("div", { class: "flex" }, [
createVNode(BasicIconOld, { icon: "vuesax-linear:add" }),
createVNode("div", null, toDisplayString(unref(config).useString("addVariant")), 1)
])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`<!--[-->`);
ssrRenderList(unref(formFields).variants, (item, index) => {
_push2(`<div class="${ssrRenderClass([unref(config).isNightStore ? "bg-zinc-9" : "bg-gray-100", "w-full rounded-lg mt-2 p-2"])}"${_scopeId}><div class="grid grid-cols-2 gap-2 rounded-lg border-1 border-solid p-2 border-gray-200 w-full"${_scopeId}><!--[-->`);
ssrRenderList(unref(myAttributes), (val, ind) => {
_push2(`<div class="w-full"${_scopeId}>`);
_push2(ssrRenderComponent(_component_AFormItem, {
label: val == null ? void 0 : val.name
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$6, {
value: unref(formFields).variants[index].attribute_values[unref(myAttributes)[ind].valueKey],
"onUpdate:value": ($event) => unref(formFields).variants[index].attribute_values[unref(myAttributes)[ind].valueKey] = $event,
items: val == null ? void 0 : val.values,
placeholder: unref(config).useString("pleaseSelectAnOption"),
size: "large",
"key-name": "id",
"value-name": "value"
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$6, {
value: unref(formFields).variants[index].attribute_values[unref(myAttributes)[ind].valueKey],
"onUpdate:value": ($event) => unref(formFields).variants[index].attribute_values[unref(myAttributes)[ind].valueKey] = $event,
items: val == null ? void 0 : val.values,
placeholder: unref(config).useString("pleaseSelectAnOption"),
size: "large",
"key-name": "id",
"value-name": "value"
}, null, 8, ["value", "onUpdate:value", "items", "placeholder"])
];
}
}),
_: 2
}, _parent2, _scopeId));
_push2(`</div>`);
});
_push2(`<!--]--></div><div class=""${_scopeId}><div class=""${_scopeId}>`);
_push2(ssrRenderComponent(_component_AFormItem, {
name: ["variants", index, "sku"],
label: unref(config).useString("code")
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("code"),
value: unref(formFields).variants[index].sku,
"onUpdate:value": ($event) => unref(formFields).variants[index].sku = $event
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("code"),
value: unref(formFields).variants[index].sku,
"onUpdate:value": ($event) => unref(formFields).variants[index].sku = $event
}, null, 8, ["place-holder", "value", "onUpdate:value"])
];
}
}),
_: 2
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_AFormItem, {
name: ["variants", index, "price"],
label: unref(config).useString("price"),
rules: unref(formFields).variants[index].auto_calculate ? "" : unref(justNumberRequired)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("price"),
value: unref(formFields).variants[index].price,
"onUpdate:value": ($event) => unref(formFields).variants[index].price = $event,
type: "price",
disabled: unref(formFields).variants[index].auto_calculate,
"addon-before": unref(config).priceUnit
}, createSlots({ _: 2 }, [
unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2 ? {
name: "addonAfter",
fn: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_select, {
value: unref(formFields).variants[index].auto_calculate,
"onUpdate:value": ($event) => unref(formFields).variants[index].auto_calculate = $event,
style: { "width": "90px" },
onChange: ($event) => unref(formFields).variants[index].auto_calculate ? unref(formFields).variants[index].price = void 0 : ""
}, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(ssrRenderComponent(_component_a_select_option, { value: true }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(`${ssrInterpolate(unref(config).useString("auto"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("auto")), 1)
];
}
}),
_: 2
}, _parent5, _scopeId4));
_push5(ssrRenderComponent(_component_a_select_option, { value: false }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(`${ssrInterpolate(unref(config).useString("manual"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("manual")), 1)
];
}
}),
_: 2
}, _parent5, _scopeId4));
} else {
return [
createVNode(_component_a_select_option, { value: true }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("auto")), 1)
]),
_: 1
}),
createVNode(_component_a_select_option, { value: false }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("manual")), 1)
]),
_: 1
})
];
}
}),
_: 2
}, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_select, {
value: unref(formFields).variants[index].auto_calculate,
"onUpdate:value": ($event) => unref(formFields).variants[index].auto_calculate = $event,
style: { "width": "90px" },
onChange: ($event) => unref(formFields).variants[index].auto_calculate ? unref(formFields).variants[index].price = void 0 : ""
}, {
default: withCtx(() => [
createVNode(_component_a_select_option, { value: true }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("auto")), 1)
]),
_: 1
}),
createVNode(_component_a_select_option, { value: false }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("manual")), 1)
]),
_: 1
})
]),
_: 2
}, 1032, ["value", "onUpdate:value", "onChange"])
];
}
}),
key: "0"
} : void 0
]), _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("price"),
value: unref(formFields).variants[index].price,
"onUpdate:value": ($event) => unref(formFields).variants[index].price = $event,
type: "price",
disabled: unref(formFields).variants[index].auto_calculate,
"addon-before": unref(config).priceUnit
}, createSlots({ _: 2 }, [
unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2 ? {
name: "addonAfter",
fn: withCtx(() => [
createVNode(_component_a_select, {
value: unref(formFields).variants[index].auto_calculate,
"onUpdate:value": ($event) => unref(formFields).variants[index].auto_calculate = $event,
style: { "width": "90px" },
onChange: ($event) => unref(formFields).variants[index].auto_calculate ? unref(formFields).variants[index].price = void 0 : ""
}, {
default: withCtx(() => [
createVNode(_component_a_select_option, { value: true }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("auto")), 1)
]),
_: 1
}),
createVNode(_component_a_select_option, { value: false }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("manual")), 1)
]),
_: 1
})
]),
_: 2
}, 1032, ["value", "onUpdate:value", "onChange"])
]),
key: "0"
} : void 0
]), 1032, ["place-holder", "value", "onUpdate:value", "disabled", "addon-before"])
];
}
}),
_: 2
}, _parent2, _scopeId));
if (unref(config).useModule("productWe@ightField") && (unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2)) {
_push2(ssrRenderComponent(_component_AFormItem, {
label: unref(config).useString("weight"),
name: ["variants", index, "weight"],
rules: unref(justNumberRequired)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("weight"),
value: unref(formFields).variants[index].weight,
"onUpdate:value": ($event) => unref(formFields).variants[index].weight = $event,
inputmode: "decimal",
type: "number",
"addon-before": unref(config).useString("gram")
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("weight"),
value: unref(formFields).variants[index].weight,
"onUpdate:value": ($event) => unref(formFields).variants[index].weight = $event,
inputmode: "decimal",
type: "number",
"addon-before": unref(config).useString("gram")
}, null, 8, ["place-holder", "value", "onUpdate:value", "addon-before"])
];
}
}),
_: 2
}, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
_push2(ssrRenderComponent(_component_AFormItem, {
name: ["variants", index, "discount_type"],
label: unref(config).useString("discountType")
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_radio_group, {
value: unref(formFields).variants[index].discount_type,
"onUpdate:value": ($event) => unref(formFields).variants[index].discount_type = $event
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_radio, { value: void 0 }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`${ssrInterpolate(unref(config).useString("disable"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("disable")), 1)
];
}
}),
_: 2
}, _parent4, _scopeId3));
_push4(ssrRenderComponent(_component_a_radio, { value: "simple" }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`${ssrInterpolate(unref(config).useString("simple"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("simple")), 1)
];
}
}),
_: 2
}, _parent4, _scopeId3));
_push4(ssrRenderComponent(_component_a_radio, { value: "percent" }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`${ssrInterpolate(unref(config).useString("percent"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("percent")), 1)
];
}
}),
_: 2
}, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_radio, { value: void 0 }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("disable")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "simple" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("simple")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "percent" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("percent")), 1)
]),
_: 1
})
];
}
}),
_: 2
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_radio_group, {
value: unref(formFields).variants[index].discount_type,
"onUpdate:value": ($event) => unref(formFields).variants[index].discount_type = $event
}, {
default: withCtx(() => [
createVNode(_component_a_radio, { value: void 0 }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("disable")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "simple" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("simple")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "percent" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("percent")), 1)
]),
_: 1
})
]),
_: 2
}, 1032, ["value", "onUpdate:value"])
];
}
}),
_: 2
}, _parent2, _scopeId));
if (unref(formFields).variants[index].discount_type && unref(priceType) === 2) {
_push2(ssrRenderComponent(_component_AFormItem, {
name: ["variants", index, "discount"],
label: unref(config).useString("amount"),
rules: unref(formFields).variants[index].discount_type === "simple" ? unref(justNumberRequiredMaxMin)(unref(formFields).variants[index].price) : unref(justNumberRequiredMaxMin)(-1)
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("amount"),
value: unref(formFields).variants[index].discount,
"onUpdate:value": ($event) => unref(formFields).variants[index].discount = $event,
type: unref(formFields).variants[index].discount_type === "simple" ? "price" : "number",
"addon-after": unref(formFields).variants[index].discount_type === "simple" ? unref(config).priceUnit : "%"
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("amount"),
value: unref(formFields).variants[index].discount,
"onUpdate:value": ($event) => unref(formFields).variants[index].discount = $event,
type: unref(formFields).variants[index].discount_type === "simple" ? "price" : "number",
"addon-after": unref(formFields).variants[index].discount_type === "simple" ? unref(config).priceUnit : "%"
}, null, 8, ["place-holder", "value", "onUpdate:value", "type", "addon-after"])
];
}
}),
_: 2
}, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
_push2(ssrRenderComponent(_component_AFormItem, {
name: ["variants", index, "stock"],
label: unref(config).useString("stock")
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("stock"),
onClick: unref(hotSelect),
value: unref(formFields).variants[index].stock,
"onUpdate:value": ($event) => unref(formFields).variants[index].stock = $event,
type: "number"
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("stock"),
onClick: unref(hotSelect),
value: unref(formFields).variants[index].stock,
"onUpdate:value": ($event) => unref(formFields).variants[index].stock = $event,
type: "number"
}, null, 8, ["place-holder", "onClick", "value", "onUpdate:value"])
];
}
}),
_: 2
}, _parent2, _scopeId));
_push2(`</div>`);
_push2(ssrRenderComponent(_sfc_main$7, {
icon: "vuesax-linear:trash",
danger: "",
block: "",
class: "!h-3rem",
onClick: ($event) => deleteVariant(item)
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<div${_scopeId2}>${ssrInterpolate(unref(config).useString("deleteVariant"))}</div>`);
} else {
return [
createVNode("div", null, toDisplayString(unref(config).useString("deleteVariant")), 1)
];
}
}),
_: 2
}, _parent2, _scopeId));
_push2(`</div></div>`);
});
_push2(`<!--]--></div>`);
} else {
_push2(`<!---->`);
}
} else {
return [
createVNode(_component_AFormItem, {
label: "",
name: "description",
rules: unref(inputRules)()
}, {
default: withCtx(() => [
createVNode(_sfc_main$3, {
"place-holder": unref(config).useString("addACaption"),
value: unref(formFields).description,
"onUpdate:value": ($event) => unref(formFields).description = $event,
class: "customCaption border-zinc-5"
}, null, 8, ["place-holder", "value", "onUpdate:value"])
]),
_: 1
}, 8, ["rules"]),
createVNode("div", { class: "border-1 border-solid mt-5 py-5 border-gray-500 rounded-lg px-3" }, [
createVNode("div", {
class: ["relative top--8 px-2 w-fit flex gap-2 items-center", unref(config).isNightStore ? "bg-[#121212]" : "bg-white"]
}, [
createVNode(BasicIconOld, { icon: "vuesax-linear:document-text" }),
createVNode("div", { class: "text-[18px]" }, toDisplayString(unref(config).useString("productInformation")), 1)
], 2),
createVNode(_sfc_main$4, {
rules: unref(inputRulesNoMessage)(),
value: unref(formFields).title_fa,
"onUpdate:value": ($event) => unref(formFields).title_fa = $event,
label: "name",
name: "title_fa"
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("name"),
value: unref(formFields).title_fa,
"onUpdate:value": ($event) => unref(formFields).title_fa = $event
}, null, 8, ["place-holder", "value", "onUpdate:value"])
]),
_: 1
}, 8, ["rules", "value", "onUpdate:value"]),
createVNode(_sfc_main$4, {
value: unref(formFields).collection_id,
"onUpdate:value": ($event) => unref(formFields).collection_id = $event,
label: "category"
}, {
default: withCtx(() => [
createVNode(_sfc_main$6, {
autofocus: false,
value: unref(formFields).collection_id,
"onUpdate:value": ($event) => unref(formFields).collection_id = $event,
items: collections.value,
placeholder: unref(config).useString("selectAnOption"),
size: "small",
"key-name": "id",
"value-name": "title",
focusable: false,
onChange: changeCollections,
getPopupContainer: (trigger) => trigger.parentNode
}, null, 8, ["value", "onUpdate:value", "items", "placeholder", "getPopupContainer"])
]),
_: 1
}, 8, ["value", "onUpdate:value"]),
createVNode(_sfc_main$4, {
value: unref(formFields).code,
"onUpdate:value": ($event) => unref(formFields).code = $event,
label: "code"
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("code"),
value: unref(formFields).code,
"onUpdate:value": ($event) => unref(formFields).code = $event
}, null, 8, ["place-holder", "value", "onUpdate:value"])
]),
_: 1
}, 8, ["value", "onUpdate:value"]),
unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2 ? (openBlock(), createBlock("div", { key: 0 }, [
unref(config).useModule("productPercentFeeField") ? (openBlock(), createBlock(_sfc_main$4, {
key: 0,
rules: unref(justNumberNoMessage)(),
value: unref(formFields).rial_fee,
"onUpdate:value": ($event) => unref(formFields).rial_fee = $event,
label: "rialFee",
name: "rial_fee"
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("rialFee"),
value: unref(formFields).rial_fee,
"onUpdate:value": ($event) => unref(formFields).rial_fee = $event,
type: "price",
"addon-after": unref(config).lang == "en" ? unref(config).priceUnit : false,
"addon-before": unref(config).lang == "fa" ? unref(config).priceUnit : false
}, null, 8, ["place-holder", "value", "onUpdate:value", "addon-after", "addon-before"])
]),
_: 1
}, 8, ["rules", "value", "onUpdate:value"])) : createCommentVNode("", true),
unref(config).useModule("productPercentFeeField") ? (openBlock(), createBlock(_sfc_main$4, {
key: 1,
value: unref(formFields).percent_fee,
"onUpdate:value": ($event) => unref(formFields).percent_fee = $event,
label: "percentFee",
rules: unref(justNumberRequiredNoMessage)(),
name: "percent_fee"
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("percentFee"),
value: unref(formFields).percent_fee,
"onUpdate:value": ($event) => unref(formFields).percent_fee = $event,
type: "number",
inputmode: "decimal",
"addon-after": unref(config).lang == "en" ? "%" : false,
"addon-before": unref(config).lang == "fa" ? "%" : false
}, null, 8, ["place-holder", "value", "onUpdate:value", "addon-after", "addon-before"])
]),
_: 1
}, 8, ["value", "onUpdate:value", "rules"])) : createCommentVNode("", true)
])) : createCommentVNode("", true),
unref(config).useModule("productWeightField") && unref(priceType) === 1 && (unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2) ? (openBlock(), createBlock(_sfc_main$4, {
key: 1,
value: unref(formFields).weight,
"onUpdate:value": ($event) => unref(formFields).weight = $event,
label: "weight",
rules: unref(justNumberRequiredNoMessage)(),
name: "weight"
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("weight"),
value: unref(formFields).weight,
"onUpdate:value": ($event) => unref(formFields).weight = $event,
type: "number",
inputmode: "decimal"
}, null, 8, ["place-holder", "value", "onUpdate:value"])
]),
_: 1
}, 8, ["value", "onUpdate:value", "rules"])) : createCommentVNode("", true),
unref(priceType) === 1 ? (openBlock(), createBlock(_sfc_main$4, {
key: 2,
value: unref(formFields).price,
"onUpdate:value": ($event) => unref(formFields).price = $event,
label: "price",
rules: unref(formFields).auto_calculate ? "" : unref(justNumberRequiredNoMessage)(),
name: "price"
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("price"),
value: unref(formFields).price,
"onUpdate:value": ($event) => unref(formFields).price = $event,
type: "price",
disabled: unref(formFields).auto_calculate,
"addon-before": unref(config).priceUnit
}, createSlots({ _: 2 }, [
unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2 ? {
name: "addonAfter",
fn: withCtx(() => [
createVNode(_component_a_select, {
value: unref(formFields).auto_calculate,
"onUpdate:value": ($event) => unref(formFields).auto_calculate = $event,
style: { "width": "90px" },
onChange: ($event) => unref(formFields).auto_calculate ? unref(formFields).price = void 0 : ""
}, {
default: withCtx(() => [
createVNode(_component_a_select_option, { value: true }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("auto")), 1)
]),
_: 1
}),
createVNode(_component_a_select_option, { value: false }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("manual")), 1)
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value", "onChange"])
]),
key: "0"
} : void 0
]), 1032, ["place-holder", "value", "onUpdate:value", "disabled", "addon-before"])
]),
_: 1
}, 8, ["value", "onUpdate:value", "rules"])) : createCommentVNode("", true),
unref(priceType) === 1 ? (openBlock(), createBlock(_sfc_main$4, {
key: 3,
value: unref(formFields).count,
"onUpdate:value": ($event) => unref(formFields).count = $event,
label: "count",
rules: unref(justNumberNoMessage)(),
name: "count"
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("count"),
value: unref(formFields).count,
"onUpdate:value": ($event) => unref(formFields).count = $event,
type: "number"
}, null, 8, ["place-holder", "value", "onUpdate:value"])
]),
_: 1
}, 8, ["value", "onUpdate:value", "rules"])) : createCommentVNode("", true),
createVNode(_sfc_main$4, {
height: "9rem",
value: unref(formFields).count,
"onUpdate:value": ($event) => unref(formFields).count = $event,
label: "pack"
}, {
default: withCtx(() => [
createVNode(_component_a_radio_group, {
class: "flex flex-col gap-4",
value: unref(formFields).sell_type,
"onUpdate:value": ($event) => unref(formFields).sell_type = $event
}, {
default: withCtx(() => [
createVNode(_component_a_radio, { value: "numeric" }, {
default: withCtx(() => [
createVNode("div", { class: "!flex !flex-col !w-full" }, [
createVNode("div", { class: "" }, toDisplayString(unref(config).useString("single")), 1),
createVNode("div", { class: "!text-xs text-gray-5" }, toDisplayString(unref(config).useString("easyDes")), 1)
])
]),
_: 1
}),
createVNode(_component_a_radio, { value: "box" }, {
default: withCtx(() => [
createVNode("div", { class: "!flex !flex-col !w-full" }, [
createVNode("div", { class: "" }, toDisplayString(unref(config).useString("box")), 1),
createVNode("div", { class: "!text-xs text-gray-5" }, toDisplayString(unref(config).useString("variantDes")), 1)
])
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value"])
]),
_: 1
}, 8, ["value", "onUpdate:value"]),
unref(formFields).sell_type === "box" ? (openBlock(), createBlock(_sfc_main$4, {
key: 4,
value: unref(formFields).box_size,
"onUpdate:value": ($event) => unref(formFields).box_size = $event,
name: "box_size",
rules: unref(inputRules)(),
label: "countInBox"
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
value: unref(formFields).box_size,
"onUpdate:value": ($event) => unref(formFields).box_size = $event,
type: "number",
onClick: unref(hotSelect),
"addon-after": unref(config).lang == "en" ? unref(config).useString("numberInCarton") : false,
"addon-before": unref(config).lang == "fa" ? unref(config).useString("numberInCarton") : false
}, null, 8, ["value", "onUpdate:value", "onClick", "addon-after", "addon-before"])
]),
_: 1
}, 8, ["value", "onUpdate:value", "rules"])) : createCommentVNode("", true)
]),
unref(priceType) === 1 ? (openBlock(), createBlock("div", {
key: 0,
class: "border-1 border-solid mt-5 py-5 border-gray-500 rounded-lg px-3"
}, [
createVNode("div", {
class: ["relative top--8 px-2 w-fit flex gap-2 items-center", unref(config).isNightStore ? "bg-[#121212]" : "bg-white"]
}, [
createVNode(BasicIconOld, { icon: "vuesax-linear:discount-circle" }),
createVNode("div", { class: "text-[18px]" }, toDisplayString(unref(config).useString("discount")), 1)
], 2),
createVNode(_sfc_main$4, {
value: unref(formFields).discount_type,
"onUpdate:value": ($event) => unref(formFields).discount_type = $event,
label: "discountType"
}, {
default: withCtx(() => [
createVNode(_component_a_radio_group, {
value: unref(formFields).discount_type,
"onUpdate:value": ($event) => unref(formFields).discount_type = $event
}, {
default: withCtx(() => [
createVNode(_component_a_radio, { value: void 0 }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("disable")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "simple" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("simple")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "percent" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("percent")), 1)
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value"])
]),
_: 1
}, 8, ["value", "onUpdate:value"]),
unref(priceType) === 1 && unref(formFields).discount_type ? (openBlock(), createBlock(_sfc_main$4, {
key: 0,
value: unref(formFields).discount,
"onUpdate:value": ($event) => unref(formFields).discount = $event,
rules: unref(justNumberRequired)(),
name: "discount",
label: "amount"
}, {
default: withCtx(() => [
unref(formFields).discount_type ? (openBlock(), createBlock(_sfc_main$5, {
key: 0,
"place-holder": unref(config).useString("amount"),
value: unref(formFields).discount,
"onUpdate:value": ($event) => unref(formFields).discount = $event,
type: unref(formFields).discount_type === "simple" ? "price" : "number",
"addon-before": unref(formFields).discount_type === "simple" ? unref(config).priceUnit : "%"
}, null, 8, ["place-holder", "value", "onUpdate:value", "type", "addon-before"])) : createCommentVNode("", true)
]),
_: 1
}, 8, ["value", "onUpdate:value", "rules"])) : createCommentVNode("", true)
])) : createCommentVNode("", true),
isEditForm.value ? (openBlock(), createBlock("div", {
key: 1,
class: "border-1 border-solid mt-5 py-5 border-gray-500 rounded-lg px-3"
}, [
createVNode("div", {
class: ["relative top--8 px-2 w-fit flex gap-2 items-center", unref(config).isNightStore ? "bg-[#121212]" : "bg-white"]
}, [
createVNode(BasicIconOld, { icon: "vuesax-linear:google-1" }),
createVNode("div", { class: "text-[18px]" }, toDisplayString(unref(config).useString("seo")), 1)
], 2),
createVNode(_sfc_main$4, {
value: unref(formFields).seo_title,
"onUpdate:value": ($event) => unref(formFields).seo_title = $event,
name: "seo_title",
label: "seoTitle"
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("seoTitle"),
value: unref(formFields).seo_title,
"onUpdate:value": ($event) => unref(formFields).seo_title = $event
}, null, 8, ["place-holder", "value", "onUpdate:value"])
]),
_: 1
}, 8, ["value", "onUpdate:value"]),
createVNode(_sfc_main$4, {
value: unref(formFields).meta,
"onUpdate:value": ($event) => unref(formFields).meta = $event,
name: "meta",
label: "meta"
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("meta"),
value: unref(formFields).meta,
"onUpdate:value": ($event) => unref(formFields).meta = $event
}, null, 8, ["place-holder", "value", "onUpdate:value"])
]),
_: 1
}, 8, ["value", "onUpdate:value"]),
createVNode(_sfc_main$4, {
value: unref(formFields).meta,
"onUpdate:value": ($event) => unref(formFields).meta = $event,
key: "body",
class: "mt-3",
label: "aboutProduct"
}, {
default: withCtx(() => [
createVNode("div", { dir: "ltr" }, [
createVNode(_sfc_main$3, {
value: unref(formFields).body,
"place-holder": unref(config).useString("writeAnyThingAboutProduct")
}, null, 8, ["value", "place-holder"])
])
]),
_: 1
}, 8, ["value", "onUpdate:value"])
])) : createCommentVNode("", true),
createVNode("div", { class: "border-1 border-solid mt-5 py-5 border-gray-500 rounded-lg px-3" }, [
createVNode("div", {
class: ["relative top--8 px-2 w-fit flex gap-2 items-center", unref(config).isNightStore ? "bg-[#121212]" : "bg-white"]
}, [
createVNode(BasicIconOld, { icon: "vuesax-linear:layer" }),
createVNode("div", { class: "text-[18px]" }, toDisplayString(unref(config).useString("attributes")), 1)
], 2),
unref(items).length === 0 ? (openBlock(), createBlock("div", {
key: 0,
class: "flex items-center gap-2"
}, [
createVNode("div", { class: "gap-2" }, [
createVNode("div", { class: "mb-1" }, toDisplayString(unref(config).useString("desAttribute")), 1),
createVNode(_sfc_main$7, {
type: "primary",
onClick: ($event) => addFeatureModal.value = true,
size: "small",
class: "!h-full !py-0 mt2"
}, {
default: withCtx(() => [
createVNode("div", { class: "flex items-center" }, [
createVNode(BasicIconOld, { icon: "vuesax-linear:add" }),
createVNode("div", null, toDisplayString(unref(config).useString("addAttribute")), 1)
])
]),
_: 1
}, 8, ["onClick"])
]),
createVNode(BasicIconOld, {
icon: "vuesax-linear:tag-2",
size: "50",
color: "gray"
})
])) : (openBlock(), createBlock("div", { key: 1 }, [
(openBlock(true), createBlock(Fragment, null, renderList(unref(items), (val, i) => {
return openBlock(), createBlock("div", { class: "mb3" }, [
createVNode("div", { class: "flex gap-2" }, [
createVNode("div", null, [
createVNode(BasicIconOld, { icon: "vuesax-linear:note-2" })
]),
createVNode("div", null, toDisplayString(val.name), 1)
]),
createVNode("div", { class: "mt2" }, [
(openBlock(true), createBlock(Fragment, null, renderList(val.new_feature, (attr) => {
return openBlock(), createBlock(_component_a_tag, null, {
default: withCtx(() => [
createTextVNode(toDisplayString(attr.value), 1)
]),
_: 2
}, 1024);
}), 256))
])
]);
}), 256)),
createVNode("div", { class: "flex justify-end" }, [
createVNode(_sfc_main$1, {
type: "primary",
icon: "vuesax-linear:edit-2",
onClick: ($event) => addFeatureModal.value = true
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("edit")), 1)
]),
_: 1
}, 8, ["onClick"])
])
]))
]),
unref(priceType) == 2 ? (openBlock(), createBlock("div", {
key: 2,
class: "border-1 border-solid mt-5 py-5 border-gray-500 rounded-lg px-3"
}, [
createVNode("div", {
class: ["relative top--8 px-2 w-fit flex gap-2 items-center", unref(config).isNightStore ? "bg-[#121212]" : "bg-white"]
}, [
createVNode(BasicIconOld, { icon: "vuesax-linear:data" }),
createVNode("div", { class: "text-[18px]" }, toDisplayString(unref(config).useString("variants")), 1)
], 2),
createVNode(_sfc_main$7, {
disabled: unref(myAttributes).length === 0,
type: "primary",
class: "px-10 !h-2.5rem",
size: "small",
block: "",
onClick: ($event) => unref(addToVariants)()
}, {
default: withCtx(() => [
createVNode("div", { class: "flex" }, [
createVNode(BasicIconOld, { icon: "vuesax-linear:add" }),
createVNode("div", null, toDisplayString(unref(config).useString("addVariant")), 1)
])
]),
_: 1
}, 8, ["disabled", "onClick"]),
(openBlock(true), createBlock(Fragment, null, renderList(unref(formFields).variants, (item, index) => {
return openBlock(), createBlock("div", {
key: index,
onChange: ($event) => variants.value = unref(formFields).variants,
class: ["w-full rounded-lg mt-2 p-2", unref(config).isNightStore ? "bg-zinc-9" : "bg-gray-100"]
}, [
createVNode("div", { class: "grid grid-cols-2 gap-2 rounded-lg border-1 border-solid p-2 border-gray-200 w-full" }, [
(openBlock(true), createBlock(Fragment, null, renderList(unref(myAttributes), (val, ind) => {
return openBlock(), createBlock("div", {
class: "w-full",
onFocus: (e) => e.preventDefault()
}, [
createVNode(_component_AFormItem, {
label: val == null ? void 0 : val.name
}, {
default: withCtx(() => [
createVNode(_sfc_main$6, {
value: unref(formFields).variants[index].attribute_values[unref(myAttributes)[ind].valueKey],
"onUpdate:value": ($event) => unref(formFields).variants[index].attribute_values[unref(myAttributes)[ind].valueKey] = $event,
items: val == null ? void 0 : val.values,
placeholder: unref(config).useString("pleaseSelectAnOption"),
size: "large",
"key-name": "id",
"value-name": "value"
}, null, 8, ["value", "onUpdate:value", "items", "placeholder"])
]),
_: 2
}, 1032, ["label"])
], 40, ["onFocus"]);
}), 256))
]),
createVNode("div", { class: "" }, [
createVNode("div", { class: "" }, [
createVNode(_component_AFormItem, {
name: ["variants", index, "sku"],
label: unref(config).useString("code")
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("code"),
value: unref(formFields).variants[index].sku,
"onUpdate:value": ($event) => unref(formFields).variants[index].sku = $event
}, null, 8, ["place-holder", "value", "onUpdate:value"])
]),
_: 2
}, 1032, ["name", "label"]),
createVNode(_component_AFormItem, {
name: ["variants", index, "price"],
label: unref(config).useString("price"),
rules: unref(formFields).variants[index].auto_calculate ? "" : unref(justNumberRequired)()
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("price"),
value: unref(formFields).variants[index].price,
"onUpdate:value": ($event) => unref(formFields).variants[index].price = $event,
type: "price",
disabled: unref(formFields).variants[index].auto_calculate,
"addon-before": unref(config).priceUnit
}, createSlots({ _: 2 }, [
unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2 ? {
name: "addonAfter",
fn: withCtx(() => [
createVNode(_component_a_select, {
value: unref(formFields).variants[index].auto_calculate,
"onUpdate:value": ($event) => unref(formFields).variants[index].auto_calculate = $event,
style: { "width": "90px" },
onChange: ($event) => unref(formFields).variants[index].auto_calculate ? unref(formFields).variants[index].price = void 0 : ""
}, {
default: withCtx(() => [
createVNode(_component_a_select_option, { value: true }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("auto")), 1)
]),
_: 1
}),
createVNode(_component_a_select_option, { value: false }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("manual")), 1)
]),
_: 1
})
]),
_: 2
}, 1032, ["value", "onUpdate:value", "onChange"])
]),
key: "0"
} : void 0
]), 1032, ["place-holder", "value", "onUpdate:value", "disabled", "addon-before"])
]),
_: 2
}, 1032, ["name", "label", "rules"]),
unref(config).useModule("productWe@ightField") && (unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2) ? (openBlock(), createBlock(_component_AFormItem, {
key: 0,
label: unref(config).useString("weight"),
name: ["variants", index, "weight"],
rules: unref(justNumberRequired)()
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("weight"),
value: unref(formFields).variants[index].weight,
"onUpdate:value": ($event) => unref(formFields).variants[index].weight = $event,
inputmode: "decimal",
type: "number",
"addon-before": unref(config).useString("gram")
}, null, 8, ["place-holder", "value", "onUpdate:value", "addon-before"])
]),
_: 2
}, 1032, ["label", "name", "rules"])) : createCommentVNode("", true),
createVNode(_component_AFormItem, {
name: ["variants", index, "discount_type"],
label: unref(config).useString("discountType")
}, {
default: withCtx(() => [
createVNode(_component_a_radio_group, {
value: unref(formFields).variants[index].discount_type,
"onUpdate:value": ($event) => unref(formFields).variants[index].discount_type = $event
}, {
default: withCtx(() => [
createVNode(_component_a_radio, { value: void 0 }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("disable")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "simple" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("simple")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "percent" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("percent")), 1)
]),
_: 1
})
]),
_: 2
}, 1032, ["value", "onUpdate:value"])
]),
_: 2
}, 1032, ["name", "label"]),
unref(formFields).variants[index].discount_type && unref(priceType) === 2 ? (openBlock(), createBlock(_component_AFormItem, {
key: 1,
name: ["variants", index, "discount"],
label: unref(config).useString("amount"),
rules: unref(formFields).variants[index].discount_type === "simple" ? unref(justNumberRequiredMaxMin)(unref(formFields).variants[index].price) : unref(justNumberRequiredMaxMin)(-1)
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("amount"),
value: unref(formFields).variants[index].discount,
"onUpdate:value": ($event) => unref(formFields).variants[index].discount = $event,
type: unref(formFields).variants[index].discount_type === "simple" ? "price" : "number",
"addon-after": unref(formFields).variants[index].discount_type === "simple" ? unref(config).priceUnit : "%"
}, null, 8, ["place-holder", "value", "onUpdate:value", "type", "addon-after"])
]),
_: 2
}, 1032, ["name", "label", "rules"])) : createCommentVNode("", true),
createVNode(_component_AFormItem, {
name: ["variants", index, "stock"],
label: unref(config).useString("stock")
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("stock"),
onClick: unref(hotSelect),
value: unref(formFields).variants[index].stock,
"onUpdate:value": ($event) => unref(formFields).variants[index].stock = $event,
type: "number"
}, null, 8, ["place-holder", "onClick", "value", "onUpdate:value"])
]),
_: 2
}, 1032, ["name", "label"])
]),
createVNode(_sfc_main$7, {
icon: "vuesax-linear:trash",
danger: "",
block: "",
class: "!h-3rem",
onClick: ($event) => deleteVariant(item)
}, {
default: withCtx(() => [
createVNode("div", null, toDisplayString(unref(config).useString("deleteVariant")), 1)
]),
_: 2
}, 1032, ["onClick"])
])
], 42, ["onChange"]);
}), 128))
])) : createCommentVNode("", true)
];
}
}),
_: 1
}, _parent));
_push(`</div></div>`);
_push(ssrRenderComponent(_sfc_main$2, {
open: addFeatureModal.value,
"onUpdate:open": ($event) => addFeatureModal.value = $event,
data: attributeData.value,
onSuccess: reloadFeatures
}, null, _parent));
_push(`<!--]-->`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("views/add/product/information/index.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as _ };
//# sourceMappingURL=index-__jwkyv5.mjs.map