import{d as p,p as f,C as b,i as u,w as g,c as h,o as v,a as i,b as o,u as a,m as C,e as w,g as d,t,v as n,f as y,F as k}from"./app-BidmlC59.js";import{_ as V}from"./AdminLayout.vue_vue_type_script_setup_true_lang-BCOjo3I6.js";import{_ as B,a as D,b as F}from"./coloris-B5SA2h-i.js";import{_ as L}from"./Files.vue_vue_type_script_setup_true_lang-RfZgjaKd.js";import"./simplebar.min-hRaQJumN.js";import"./useToastify-Bhe2cyz3.js";import"./coloris--ejmIHou.js";import"./portal.esm-DCp8ZhOj.js";/* empty css                             *//* empty css              */import"./Pagination.vue_vue_type_script_setup_true_lang-DQBGGaaV.js";import"./SearchList.vue_vue_type_script_setup_true_lang-Mz6dy287.js";import"./useCopyToClipboard-CsEpRQpU.js";import"./useRandomNum-BTw6623a.js";const N={class:"container-fluid"},S={class:"add-colors card"},I={class:"card-body"},M={class:"modal-body"},T={class:"row"},U={class:"col-md-6 col-12 mb-4"},j={for:"eaColorLabel",class:"d-block form-label fw-bold lts-05"},x=["placeholder"],E={class:"col-12 color-picker mb-4"},R={for:"eaColorCode",class:"d-block form-label fw-bold lts-05"},q={class:"col-12 mb-5"},z={class:"fw-bold lts-05 mb-3 d-block"},A={class:"fw-normal text-info fs-9 ms-1"},G={class:"color-box add-image clickable","data-bs-toggle":"modal","data-bs-target":"#mediaLibrary","data-bs-input":"color"},H=["src"],J={class:"col-12"},K={class:"fs-8 lts-05 text-gray"},O={class:"modal-footer"},P={class:"btn btn-sm btn-primary px-3"},mo=p({layout:V,__name:"Create",setup(Q){$(()=>{B(),D({parent:"#addColor",el:"#eaColorCode",alpha:!1,selectInput:!1,defaultColor:"#0060ff",swatches:["#ffc107","#f4a261","#ff9c22","#e76f51","#fc5b61","#dc3545","#264653","#2a9d8f","#21d9c0","#0097e6","#07b","#0060ff"]}),F()});const r=f(null),s=b({color:"#000000",label:null,image:null}),m=()=>{s.image=r.value,s.post(route("admin.product.colors.store"),{replace:!0,onSuccess:()=>{$("#addColor .modal-close").trigger("click"),s.color="",s.label=null,s.image=null}})},_=u("mediaData");return g(_,e=>{e.type=="color"&&e.file!=null&&(r.value=e.file.url)}),(e,l)=>(v(),h(k,null,[i(a(C),{title:e.$t("messages.title.add_color")},null,8,["title"]),o("div",N,[i(L,{title:e.$t("messages.sentence.add_color")},null,8,["title"]),o("div",S,[o("div",I,[o("form",{onSubmit:w(m,["prevent"]),style:{direction:"rtl"}},[o("div",M,[o("div",T,[o("div",U,[o("label",j,t(e.$t("messages.sentence.color_name"))+": ",1),d(o("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>a(s).label=c),type:"text",placeholder:e.$t("messages.sentence.example_light_red"),class:"form-control",id:"eaColorLabel"},null,8,x),[[n,a(s).label]])]),o("div",E,[o("label",R,t(e.$t("messages.sentence.choose_color"))+": ",1),d(o("input",{id:"eaColorCode","onUpdate:modelValue":l[1]||(l[1]=c=>a(s).color=c)},null,512),[[n,a(s).color]])]),o("div",q,[o("span",z,[y(t(e.$t("messages.sentence.image_by_color"))+": ",1),o("span",A,"("+t(e.$t("messages.word.optional"))+")",1)]),o("div",G,[o("img",{src:r.value!=null?r.value:"/img/temp/blank-gray.png",alt:"رنگ"},null,8,H)])]),o("div",J,[o("p",K,t(e.$t("messages.sentence.msg_id_480201")),1)]),l[2]||(l[2]=o("div",{class:"col-12 mb-4"},[o("div",{class:"border"})],-1))])]),o("div",O,[o("button",P,t(e.$t("messages.word.create")),1)])],32)])])])],64))}});export{mo as default};
