import { defineComponent, ref, reactive, inject, watch, resolveDirective, unref, withCtx, createVNode, toDisplayString, createBlock, openBlock, mergeProps, useSSRContext } from "vue";
import { ssrRenderComponent, ssrInterpolate, ssrRenderList, ssrRenderStyle, ssrRenderAttr, ssrIncludeBooleanAttr, ssrLooseContain, ssrRenderAttrs, ssrGetDirectiveProps } from "vue/server-renderer";
import { _ as _sfc_main$1, a as _sfc_main$2 } from "./StoreLayout-BdTm0B5I.js";
import { useForm, Head } from "@inertiajs/vue3";
import Dropdown from "primevue/dropdown/dropdown.esm.js";
import { _ as _sfc_main$3 } from "./FormatedNumInput-B1iGHvfz.js";
import { u as useNumberFormat } from "./useNumberFormat-BUoWzkrL.js";
import "toastify-js";
/* empty css                  */
import "laravel-vue-i18n";
import { _ as _sfc_main$4 } from "./FormatedDecimalsInput-jhmqW0Qg.js";
/* empty css                 */
/* empty css                              */
/* empty css                       */
/* empty css               */
import "jquery";
import "simplebar";
import "resize-observer-polyfill";
import "./useToastify-BxJet4Bm.js";
import "./Pagination-C1AQrLe3.js";
import "./SearchList-BZnYMQPN.js";
import "lodash/debounce.js";
import "primevue/progressbar/progressbar.esm.js";
import "primevue/confirmdialog/confirmdialog.esm.js";
import "primevue/useconfirm/useconfirm.esm.js";
import "./useRandomNum-DNNSqR7b.js";
import "bootstrap";
import "./useNl2br-BIw8h5gy.js";
import "./useRandomStr-4MeWbtRd.js";
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...{
    layout: _sfc_main$1
  },
  __name: "Edit",
  __ssrInlineRender: true,
  props: {
    inventory: {},
    product: {},
    priceModel: {},
    storages: {},
    colors: {},
    originalList: {},
    usedList: {},
    yesOrNoList: {},
    storage_uuid: {},
    exchangeRate: {}
  },
  setup(__props) {
    const props = __props;
    const colorItems = ref([]);
    for (let color in props.colors) {
      colorItems.value.push({ id: props.colors[color].id, label: props.colors[color].label, color: props.colors[color].color });
    }
    const discountTree = reactive(props.inventory.get_discount_tree);
    const optionsList = reactive(props.inventory.get_options);
    const productProps = reactive(props.priceModel);
    const inventoryImageUrl = ref(props.inventory.get_image["url"]);
    const inventoryImageId = ref(props.inventory.get_image["id"]);
    const mediaReactive = inject("mediaData");
    watch(mediaReactive, (media) => {
      if (media.type == "inventory" && media.file != null) {
        inventoryImageId.value = media.file.id;
        inventoryImageUrl.value = media.file.url;
      }
    });
    const editPriceForm = useForm({
      stg: props.storage_uuid,
      storage: props.inventory.storage_id,
      props: productProps,
      price: props.inventory.get_formatted_price,
      discount_price: props.inventory.get_formatted_discount_price,
      discount_expire: props.inventory.jalali_discount_expire != null ? props.inventory.jalali_discount_expire[1] : null,
      is_update_with_currency: Boolean(props.inventory.is_update_with_currency),
      currency_price: props.inventory.get_formatted_currency_price,
      currency_discount_price: props.inventory.get_formatted_currency_discount_price,
      count: props.inventory.get_formatted_count,
      min_sale: props.inventory.get_formatted_min_sale,
      max_sale: props.inventory.get_formatted_max_sale,
      original: props.inventory.original != null ? props.inventory.original : "null",
      used: props.inventory.used != null ? props.inventory.used : "null",
      weight: props.inventory.weight != null ? useNumberFormat(props.inventory.weight) : props.inventory.weight,
      purchase_price: props.inventory.purchase_price != null ? useNumberFormat(props.inventory.purchase_price) : props.inventory.purchase_price,
      image: inventoryImageId.value,
      description: props.inventory.description,
      send_time: props.inventory.send_time,
      discount_tree: discountTree,
      options: optionsList,
      is_update: props.inventory.is_update
    });
    const currencyPriceChange = () => {
      if (props.exchangeRate != null && editPriceForm.currency_price) {
        editPriceForm.price = useNumberFormat(Math.trunc(props.exchangeRate * parseFloat(editPriceForm.currency_price.replace(",", ""))));
      } else {
        editPriceForm.price = "";
      }
    };
    const currencyDiscountPriceChange = (e) => {
      if (props.exchangeRate != null && editPriceForm.currency_discount_price) {
        editPriceForm.discount_price = useNumberFormat(Math.trunc(props.exchangeRate * parseFloat(editPriceForm.currency_discount_price.replace(",", ""))));
      } else {
        editPriceForm.discount_price = "";
      }
    };
    return (_ctx, _push, _parent, _attrs) => {
      const _directive_tooltip = resolveDirective("tooltip");
      _push(`<!--[-->`);
      _push(ssrRenderComponent(unref(Head), {
        title: _ctx.$t("messages.title.edit_inventory")
      }, null, _parent));
      _push(`<div class="container-fluid">`);
      _push(ssrRenderComponent(_sfc_main$2, {
        title: _ctx.$t("messages.sentence.edit_inventory"),
        item: _ctx.$t("messages.word.storages")
      }, null, _parent));
      _push(`<div class="product-list prices-section manage-inventory list mb-4"><div class="card"><div class="card-body"><div class="col-12 mb-3"><span class="badge bg-danger fs-10 lts-05">${ssrInterpolate(_ctx.$t("messages.sentence.msg_id_599652"))}</span><span class="badge bg-info fs-10 lts-05 ms-1">${ssrInterpolate(_ctx.$t("messages.sentence.msg_id_322558"))}</span></div><div class="col-12 dynamic-container mt-2"><div class="price-items"><form><div class="price-item"><div class="row"><div class="col-12 fw-bold text-light-gray mb-3">${ssrInterpolate(_ctx.$t("messages.sentence.select_storage"))}</div><div class="col-lg-4 col-md-6 col-12 mb-3"><label class="form-label lts-05 required">${ssrInterpolate(_ctx.$t("messages.sentence.select_storage"))}</label>`);
      _push(ssrRenderComponent(unref(Dropdown), {
        modelValue: unref(editPriceForm).storage,
        "onUpdate:modelValue": ($event) => unref(editPriceForm).storage = $event,
        options: _ctx.storages,
        optionLabel: "name",
        optionValue: "id",
        placeholder: _ctx.$t("messages.sentence.select_the_storage"),
        type: "text",
        readonly: "",
        class: "pvc-dropdown"
      }, null, _parent));
      _push(`</div>`);
      if (Object.keys(productProps).length > 0) {
        _push(`<div class="col-12"><div class="border-gray-1 mb-3"></div></div>`);
      } else {
        _push(`<!---->`);
      }
      if (Object.keys(productProps).length > 0) {
        _push(`<div class="col-12 fw-bold text-light-gray mb-3">${ssrInterpolate(_ctx.$t("messages.sentence.sale_variables"))}</div>`);
      } else {
        _push(`<!---->`);
      }
      _push(`<!--[-->`);
      ssrRenderList(productProps, (pm, index) => {
        _push(`<!--[-->`);
        if (pm.type == "color") {
          _push(`<div class="col-lg-4 col-md-6 col-12 mb-3"><label class="form-label lts-05 required">${ssrInterpolate(_ctx.$t("messages.sentence.choose_color"))}</label>`);
          _push(ssrRenderComponent(unref(Dropdown), {
            class: "pvc-dropdown",
            modelValue: pm.value,
            "onUpdate:modelValue": ($event) => pm.value = $event,
            options: colorItems.value,
            optionLabel: "label",
            placeholder: _ctx.$t("messages.sentence.choose_color")
          }, {
            value: withCtx((slotProps, _push2, _parent2, _scopeId) => {
              if (_push2) {
                if (slotProps.value) {
                  _push2(`<div class="d-flex align-items-center"${_scopeId}><span class="dropdown-color-item shadow-1" style="${ssrRenderStyle({
                    "background-color": slotProps.value.color,
                    border: slotProps.value.color.includes("#ffffff") ? "solid 1px #dddddd" : ""
                  })}"${_scopeId}></span><div class="dropdown-cutom-item-text"${_scopeId}>${ssrInterpolate(slotProps.value.label)}</div></div>`);
                } else {
                  _push2(`<span${_scopeId}>${ssrInterpolate(slotProps.placeholder)}</span>`);
                }
              } else {
                return [
                  slotProps.value ? (openBlock(), createBlock("div", {
                    key: 0,
                    class: "d-flex align-items-center"
                  }, [
                    createVNode("span", {
                      class: "dropdown-color-item shadow-1",
                      style: {
                        "background-color": slotProps.value.color,
                        border: slotProps.value.color.includes("#ffffff") ? "solid 1px #dddddd" : ""
                      }
                    }, null, 4),
                    createVNode("div", { class: "dropdown-cutom-item-text" }, toDisplayString(slotProps.value.label), 1)
                  ])) : (openBlock(), createBlock("span", { key: 1 }, toDisplayString(slotProps.placeholder), 1))
                ];
              }
            }),
            option: withCtx((slotProps, _push2, _parent2, _scopeId) => {
              if (_push2) {
                _push2(`<div class="d-flex align-items-center"${_scopeId}><span class="dropdown-color-item shadow-1" style="${ssrRenderStyle({
                  "background-color": slotProps.option.color,
                  border: slotProps.option.color.includes("#ffffff") ? "solid 1px #dddddd" : ""
                })}"${_scopeId}></span><div class="dropdown-cutom-item-text"${_scopeId}>${ssrInterpolate(slotProps.option.label)}</div></div>`);
              } else {
                return [
                  createVNode("div", { class: "d-flex align-items-center" }, [
                    createVNode("span", {
                      class: "dropdown-color-item shadow-1",
                      style: {
                        "background-color": slotProps.option.color,
                        border: slotProps.option.color.includes("#ffffff") ? "solid 1px #dddddd" : ""
                      }
                    }, null, 4),
                    createVNode("div", { class: "dropdown-cutom-item-text" }, toDisplayString(slotProps.option.label), 1)
                  ])
                ];
              }
            }),
            _: 2
          }, _parent));
          _push(`</div>`);
        } else {
          _push(`<!---->`);
        }
        if (pm.type == "warranty") {
          _push(`<div class="col-lg-4 col-md-6 col-12 mb-3"><label${ssrRenderAttr("for", "fm-" + index)} class="form-label">${ssrInterpolate(pm.name)}</label><input${ssrRenderAttr("value", pm.value)}${ssrRenderAttr("id", "fm-" + index)} type="text"${ssrRenderAttr("placeholder", _ctx.$t("messages.sentence.default_warranty_content"))} class="form-control"></div>`);
        } else {
          _push(`<!---->`);
        }
        if (pm.type == "text") {
          _push(`<div class="col-lg-4 col-md-6 col-12 mb-3"><label${ssrRenderAttr("for", "fm-" + index)} class="form-label required">${ssrInterpolate(pm.name)}</label><input${ssrRenderAttr("value", pm.value)}${ssrRenderAttr("id", "fm-" + index)} type="text"${ssrRenderAttr("placeholder", _ctx.$t("messages.sentence.sale_variable_value"))} class="form-control"></div>`);
        } else {
          _push(`<!---->`);
        }
        _push(`<!--]-->`);
      });
      _push(`<!--]--><div class="col-12"><div class="border-gray-1 mb-3"></div></div><div class="col-12 fw-bold text-light-gray mb-3">${ssrInterpolate(_ctx.$t("messages.sentence.pricing"))}</div><div class="col-lg-4 col-md-6 col-12 mb-3"><label for="fmPrice" class="form-label required">${ssrInterpolate(_ctx.$t("messages.sentence.product_price"))} <span class="currency mb-0">${ssrInterpolate(_ctx.$t("messages.word.toman"))}</span></label>`);
      _push(ssrRenderComponent(_sfc_main$3, {
        disabled: unref(editPriceForm).is_update_with_currency,
        modelValue: unref(editPriceForm).price,
        "onUpdate:modelValue": ($event) => unref(editPriceForm).price = $event,
        id: "fmPrice",
        type: "text",
        placeholder: _ctx.$t("messages.sentence.unit_price_of_each_piece"),
        class: "form-control"
      }, null, _parent));
      _push(`</div><div class="col-lg-4 col-md-6 col-12 mb-3"><label class="form-label">${ssrInterpolate(_ctx.$t("messages.sentence.discount_price"))} <span class="currency mb-0">${ssrInterpolate(_ctx.$t("messages.word.toman"))}</span>`);
      _push(ssrRenderComponent(_sfc_main$3, {
        disabled: unref(editPriceForm).is_update_with_currency,
        modelValue: unref(editPriceForm).discount_price,
        "onUpdate:modelValue": ($event) => unref(editPriceForm).discount_price = $event,
        type: "text",
        placeholder: _ctx.$t("messages.sentence.unit_discount_price_of_each_piece"),
        class: "form-control"
      }, null, _parent));
      _push(`</label></div><div class="col-lg-4 col-md-6 col-12 mb-3"><label class="form-label">${ssrInterpolate(_ctx.$t("messages.sentence.discount_expire"))} <input${ssrRenderAttr("value", unref(editPriceForm).discount_expire)}${ssrRenderAttr("placeholder", _ctx.$t("messages.sentence.click_for_choose"))} type="text" readonly class="form-control" data-jdp></label></div><div class="col-12 mb-3"><div class="form-check form-switch mb-2 d-flex align-items-center"><label class="form-check-label lts-05 fw-bold" style="${ssrRenderStyle({ "font-size": "13px" })}">${ssrInterpolate(_ctx.$t("messages.sentence.is_update_with_currency"))} <input${ssrIncludeBooleanAttr(Array.isArray(unref(editPriceForm).is_update_with_currency) ? ssrLooseContain(unref(editPriceForm).is_update_with_currency, null) : unref(editPriceForm).is_update_with_currency) ? " checked" : ""} class="form-check-input me-2" type="checkbox" role="switch" style="${ssrRenderStyle({ "position": "relative", "top": "-4px", "transform": "scale(1.2)" })}"></label></div><p class="lts-05 text-gray fw-normal fs-8">${ssrInterpolate(_ctx.$t("messages.sentence.msg_id_21005123"))}</p>`);
      if (unref(editPriceForm).is_update_with_currency) {
        _push(`<div class="row"><div class="col-lg-4 col-md-6 col-12 mb-3"><label for="fmPrice" class="form-label lts-05 required">${ssrInterpolate(_ctx.$t("messages.sentence.foreign_exchange_purchase_price"))} <span class="currency mb-0">${ssrInterpolate(_ctx.$t("messages.sentence.dollar_or_euro_or"))}</span></label>`);
        _push(ssrRenderComponent(_sfc_main$4, {
          onInput: currencyPriceChange,
          modelValue: unref(editPriceForm).currency_price,
          "onUpdate:modelValue": ($event) => unref(editPriceForm).currency_price = $event,
          id: "fmPrice",
          type: "text",
          placeholder: _ctx.$t("messages.sentence.unit_price_of_each_piece"),
          class: "form-control"
        }, null, _parent));
        _push(`</div><div class="col-lg-4 col-md-6 col-12 mb-3"><label class="form-label lts-05">${ssrInterpolate(_ctx.$t("messages.sentence.price_after_discount_for_foreign_currency_purchases"))} <span class="currency mb-0">${ssrInterpolate(_ctx.$t("messages.sentence.dollar_or_euro_or"))}</span>`);
        _push(ssrRenderComponent(_sfc_main$4, {
          onInput: currencyDiscountPriceChange,
          modelValue: unref(editPriceForm).currency_discount_price,
          "onUpdate:modelValue": ($event) => unref(editPriceForm).currency_discount_price = $event,
          type: "text",
          placeholder: _ctx.$t("messages.sentence.unit_discount_price_of_each_piece"),
          class: "form-control"
        }, null, _parent));
        _push(`</label></div></div>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</div><div class="col-12"><div class="border-gray-1 mb-3"></div></div><div class="col-12 fw-bold text-light-gray mb-3">${ssrInterpolate(_ctx.$t("messages.word.inventories"))}</div><div class="col-lg-4 col-md-6 col-12 mb-3"><label for="fmCount" class="form-label required">${ssrInterpolate(_ctx.$t("messages.sentence.inventory_count"))}</label>`);
      _push(ssrRenderComponent(_sfc_main$3, {
        modelValue: unref(editPriceForm).count,
        "onUpdate:modelValue": ($event) => unref(editPriceForm).count = $event,
        id: "fmCount",
        type: "text",
        placeholder: _ctx.$t("messages.sentence.inventory_count"),
        class: "form-control"
      }, null, _parent));
      _push(`</div><div class="col-lg-4 col-md-6 col-12 mb-3"><label class="form-label">${ssrInterpolate(_ctx.$t("messages.sentence.min_sale"))} `);
      _push(ssrRenderComponent(_sfc_main$3, {
        modelValue: unref(editPriceForm).min_sale,
        "onUpdate:modelValue": ($event) => unref(editPriceForm).min_sale = $event,
        type: "text",
        placeholder: _ctx.$t("messages.sentence.min_sale_allowed"),
        class: "form-control"
      }, null, _parent));
      _push(`</label></div><div class="col-lg-4 col-md-6 col-12 mb-3"><label class="form-label">${ssrInterpolate(_ctx.$t("messages.sentence.max_sale"))} `);
      _push(ssrRenderComponent(_sfc_main$3, {
        modelValue: unref(editPriceForm).max_sale,
        "onUpdate:modelValue": ($event) => unref(editPriceForm).max_sale = $event,
        type: "text",
        placeholder: _ctx.$t("messages.sentence.max_sale_allowed"),
        class: "form-control",
        id: "eaMainMaximumOrder"
      }, null, _parent));
      _push(`</label></div><div class="col-12"><div class="border-gray-1 mb-3"></div></div><div class="col-12 fw-bold text-light-gray mb-2">${ssrInterpolate(_ctx.$t("messages.sentence.extra_options"))} <span class="ms-1 text-info fs-10 fw-normal">(${ssrInterpolate(_ctx.$t("messages.word.optional"))})</span></div><div class="col-12 fw-normal text-light-gray fs-9 lts-05 mb-1"><span class="fw-bold ms-1 me-1 fs-7">- </span>${ssrInterpolate(_ctx.$t("messages.sentence.msg_id_50120123"))}</div><div class="col-12 fw-normal text-light-gray fs-9 lts-05 mb-3"><span class="fw-bold ms-1 me-1 fs-7">- </span>${ssrInterpolate(_ctx.$t("messages.sentence.msg_id_698540021"))}</div><div class="col-12 extra-options-container mb-3"><div class="count-discount"><div class="sub"><!--[-->`);
      ssrRenderList(optionsList, (ol, oli) => {
        _push(`<div class="row mb-1"><div class="col-md-8 col-12 p-0 mb-1 mb-md-0"><input${ssrRenderAttr("value", ol.title)} type="text"${ssrRenderAttr("placeholder", _ctx.$t("messages.word.title") + " - (" + _ctx.$t("messages.sentence.msg_id_44012569") + ")")} class="form-control"></div><div class="col-md-4 col-12 p-0 ps-md-1">`);
        _push(ssrRenderComponent(_sfc_main$3, {
          modelValue: ol.price,
          "onUpdate:modelValue": ($event) => ol.price = $event,
          type: "text",
          placeholder: _ctx.$t("messages.sentence.unit_price_in_toman") + " (" + _ctx.$t("messages.sentence.empty_for_free") + ")",
          class: "form-control"
        }, null, _parent));
        _push(`</div><div class="col-12"><i class="remove-item ri-close-line"></i></div></div>`);
      });
      _push(`<!--]--></div><button type="button" class="btn d-none btn-xs btn-square btn-primary mt-2"><i class="ri-add-line"></i></button></div></div><div class="col-12"><div class="border-gray-1 mb-3"></div></div><div class="col-12 fw-bold text-light-gray mb-3">${ssrInterpolate(_ctx.$t("messages.word.transportation"))}</div><div class="col-lg-4 col-md-6 col-12 mb-3"><label class="form-label">${ssrInterpolate(_ctx.$t("messages.sentence.product_weight"))} <span class="currency">${ssrInterpolate(_ctx.$t("messages.word.gram"))}</span>`);
      _push(ssrRenderComponent(_sfc_main$3, {
        modelValue: unref(editPriceForm).weight,
        "onUpdate:modelValue": ($event) => unref(editPriceForm).weight = $event,
        type: "text",
        placeholder: _ctx.$t("messages.sentence.product_weight_in_gram"),
        class: "form-control",
        id: "eaMainMaximumOrder"
      }, null, _parent));
      _push(`</label></div><div class="col-lg-4 col-md-6 col-12 mb-3"><label class="form-label">${ssrInterpolate(_ctx.$t("messages.sentence.send_time"))} <input${ssrRenderAttr("value", unref(editPriceForm).send_time)} type="text"${ssrRenderAttr("placeholder", _ctx.$t("messages.sentence.send_time_placeholder"))} class="form-control" id="eaSendTime"></label></div><div class="col-12"><div class="border-gray-1 mb-3"></div></div><div class="col-12 fw-bold text-light-gray mb-3">${ssrInterpolate(_ctx.$t("messages.word.status"))}</div><div class="col-lg-4 col-md-6 col-12 mb-3"><label class="form-label lts-05">${ssrInterpolate(_ctx.$t("messages.sentence.product_original_type"))}: </label>`);
      _push(ssrRenderComponent(unref(Dropdown), {
        class: "pvc-dropdown",
        modelValue: unref(editPriceForm).original,
        "onUpdate:modelValue": ($event) => unref(editPriceForm).original = $event,
        options: _ctx.originalList,
        display: "chip",
        optionLabel: "label",
        optionValue: "id"
      }, null, _parent));
      _push(`</div><div class="col-lg-4 col-md-6 col-12 mb-3"><label class="form-label lts-05">${ssrInterpolate(_ctx.$t("messages.sentence.product_used_type"))}: </label>`);
      _push(ssrRenderComponent(unref(Dropdown), {
        class: "pvc-dropdown",
        modelValue: unref(editPriceForm).used,
        "onUpdate:modelValue": ($event) => unref(editPriceForm).used = $event,
        options: _ctx.usedList,
        display: "chip",
        optionLabel: "label",
        optionValue: "id"
      }, null, _parent));
      _push(`</div><div class="col-lg-4 col-md-6 col-12 mb-3"><label class="form-label lts-05">${ssrInterpolate(_ctx.$t("messages.sentence.show_update_status"))}: </label>`);
      _push(ssrRenderComponent(unref(Dropdown), {
        class: "pvc-dropdown",
        modelValue: unref(editPriceForm).is_update,
        "onUpdate:modelValue": ($event) => unref(editPriceForm).is_update = $event,
        options: _ctx.yesOrNoList,
        display: "chip",
        optionLabel: "label",
        optionValue: "id"
      }, null, _parent));
      _push(`</div><div class="col-12"><div class="border-gray-1 mb-3"></div></div><div class="col-12 fw-bold text-light-gray mb-3">${ssrInterpolate(_ctx.$t("messages.sentence.additional_details"))} <span class="fw-light fs-10 ms-1 lts-05">${ssrInterpolate(_ctx.$t("messages.word.optional"))}</span></div><div class="col-lg-8 col-md-6 col-12 mb-3"><label class="form-label lts-05" for="eaDescrition">${ssrInterpolate(_ctx.$t("messages.word.description"))}: </label><textarea id="eaDescrition" class="form-control lh-25" rows="3"${ssrRenderAttr("placeholder", _ctx.$t("messages.sentence.msg_id_540101203"))}>${ssrInterpolate(unref(editPriceForm).description)}</textarea><span class="form-control-description lts-05">${ssrInterpolate(_ctx.$t("messages.sentence.msg_id_54002102"))}</span></div><div class="col-lg-4 col-md-6 col-12 mb-3"><label for="fmPrice" class="form-label">${ssrInterpolate(_ctx.$t("messages.sentence.purchase_price"))} <span class="fs-10 text-gray">${ssrInterpolate(_ctx.$t("messages.word.optional"))}</span><span class="currency mb-0">${ssrInterpolate(_ctx.$t("messages.word.toman"))}</span></label>`);
      _push(ssrRenderComponent(_sfc_main$3, {
        modelValue: unref(editPriceForm).purchase_price,
        "onUpdate:modelValue": ($event) => unref(editPriceForm).purchase_price = $event,
        id: "fmPrice",
        type: "text",
        placeholder: _ctx.$t("messages.sentence.unit_price_of_each_piece"),
        class: "form-control"
      }, null, _parent));
      _push(`<span class="input-desc lts-05">${ssrInterpolate(_ctx.$t("messages.sentence.msg_id_54002102"))}</span></div><div class="col-12"><div class="border-gray-1 mb-3"></div></div><div class="col-12 fw-bold text-light-gray mb-3">${ssrInterpolate(_ctx.$t("messages.word.image"))}</div><div class="col-12 mb-4"><label class="form-label lts-05 mb-3">${ssrInterpolate(_ctx.$t("messages.sentence.inventory_image"))}</label>`);
      if (inventoryImageUrl.value != null && inventoryImageId.value != null) {
        _push(`<div class="image-grid"><div class="image-grid--level-one"><div class="image-grid--level-two"><div class="image" style="${ssrRenderStyle("background-image: url(" + inventoryImageUrl.value + ")")}"></div></div></div><i class="remove-image ri-close-line"></i></div>`);
      } else {
        _push(`<button${ssrRenderAttrs(mergeProps({
          "data-bs-toggle": "modal",
          "data-bs-target": "#mediaLibrary",
          "data-bs-input": "inventory",
          type: "button",
          class: "btn btn-square btn-primary btn-sm"
        }, ssrGetDirectiveProps(_ctx, _directive_tooltip, _ctx.$t("messages.word.add"), void 0, { left: true })))}><i class="ri-add-line"></i></button>`);
      }
      _push(`</div>`);
      if (!unref(editPriceForm).is_update_with_currency) {
        _push(`<!--[--><div class="col-12"><div class="border-gray-1 mb-3"></div></div><div class="col-12 fw-bold text-light-gray mb-3">${ssrInterpolate(_ctx.$t("messages.sentence.discount_tree"))}</div><div class="col-12 mb-4 count-discount-container mb-3"><div class="count-discount"><div class="tab-title mb-3"><div><div class="d-flex align-items-center mb-1">${ssrInterpolate(_ctx.$t("messages.sentence.tiered_discount_according_to_quantity"))} <span class="ms-1 text-info">(${ssrInterpolate(_ctx.$t("messages.word.optional"))})</span></div><span class="lts-05">${ssrInterpolate(_ctx.$t("messages.sentence.msg_id_399852"))}</span></div></div><div class="sub"><!--[-->`);
        ssrRenderList(discountTree, (dt, dti) => {
          _push(`<div class="row mb-1"><div class="col-md-6 col-12 p-0 mb-1 mb-md-0">`);
          _push(ssrRenderComponent(_sfc_main$3, {
            modelValue: dt.count,
            "onUpdate:modelValue": ($event) => dt.count = $event,
            type: "text",
            placeholder: _ctx.$t("messages.word.count"),
            class: "form-control"
          }, null, _parent));
          _push(`</div><div class="col-md-6 col-12 p-0 ps-md-2">`);
          _push(ssrRenderComponent(_sfc_main$3, {
            modelValue: dt.price,
            "onUpdate:modelValue": ($event) => dt.price = $event,
            type: "text",
            placeholder: _ctx.$t("messages.sentence.unit_discount_price_of_each_piece") + " - " + _ctx.$t("messages.word.toman"),
            class: "form-control"
          }, null, _parent));
          _push(`</div><div class="col-12"><i class="remove-item ri-close-line"></i></div></div>`);
        });
        _push(`<!--]--></div><button type="button" class="btn d-none btn-xs btn-square btn-primary mt-2"><i class="ri-add-line"></i></button></div></div><!--]-->`);
      } else {
        _push(`<!---->`);
      }
      _push(`</div></div><div class="d-flex align-items-center justify-content-end mt-4"><button class="btn btn-sm btn-primary px-3 ms-2">${ssrInterpolate(_ctx.$t("messages.sentence.edit_inventory"))}</button></div></form></div></div></div></div></div></div><!--]-->`);
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("resources/js/Pages/Store/Storage/Inventory/Edit.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export {
  _sfc_main as default
};
