import{_ as T}from"./vU4aS4uy.js";import{_ as E}from"./DuhDFJjj.js";import{a as F}from"./Z4eZ-m2s.js";import{u as H,s as M,k as A,O as G,j as J,d as p,w as u,m as l,o as n,b as t,c as a,t as e,F as k,g as $,G as K,H as O,K as q,f as g,D as Q,J as m,e as y,E as b}from"./Bgmy51Qv.js";import{u as W}from"./CYl1ofbh.js";import{u as X}from"./BE7GDBwC.js";import"./7pZkuj9N.js";import"./BHvLfWtM.js";import"./hSbGpNHU.js";import"./ByXs6QR-.js";import"./D_7E8SMU.js";import"./DKgjlGGV.js";const Y={class:"lite-bold"},Z={class:"w-50x mx-w-50x"},v={class:"w-50x mx-w-50x"},tt=["value"],et={class:"mx-w-400x"},st={key:1},ot={class:"dply-felx f-wrap gap-10 mx-w-300x j-left"},lt={key:1},nt={key:0},rt=["onClick"],at=["onClick"],bt={__name:"index",setup(it){const w=H(),{setting:x}=M(w),f=A(()=>{var o;return((o=x.value)==null?void 0:o.currency_icon)||"$"}),{t:i}=G(),C=J({title:{title:i("index.title")},category_id:{title:i("category.catUp")},purchased:{title:i("prod.purchased")},selling:{title:i("prod.selling")},offered:{title:i("prod.offered")},created_at:{title:i("category.date")},status:{title:i("category.status")}}),{getStatus:L,getThumbImageURL:B}=X(),{cbList:_,deleteBulk:P,listPageRef:N,setItemList:R,checkAll:h,editNode:D,deleteNode:I}=W();return(o,r)=>{const S=T,c=E,V=F;return n(),p(V,{ref_key:"listPageRef",ref:N,"list-api":"getProducts","delete-api":"deleteProduct","route-name":"products",name:o.$t("title.prod"),"order-options":l(C),gate:"product",onDeleteBulk:l(P),onList:l(R)},{table:u(({list:z})=>[t("tr",Y,[t("th",Z,[t("input",{type:"checkbox",onChange:r[0]||(r[0]=(...s)=>l(h)&&l(h)(...s))},null,32)]),t("th",null,e(o.$t("index.title")),1),t("th",null,e(o.$t("category.status")),1),t("th",null,e(o.$t("prod.brand")),1),t("th",null,e(o.$t("error.cat")),1),t("th",null,e(o.$t("prod.tRule")),1),t("th",null,e(o.$t("prod.purchased"))+"("+e(l(f))+")",1),t("th",null,e(o.$t("prod.selling"))+"("+e(l(f))+")",1),t("th",null,e(o.$t("prod.offered"))+"("+e(l(f))+")",1),t("th",null,e(o.$t("category.created")),1),r[2]||(r[2]=t("th",null,null,-1)),r[3]||(r[3]=t("th",null,null,-1))]),(n(!0),a(k,null,$(z,(s,U)=>(n(),a("tr",{key:U},[t("td",v,[K(t("input",{type:"checkbox",value:s.id,"onUpdate:modelValue":r[1]||(r[1]=d=>O(_)?_.value=d:null)},null,8,tt),[[q,l(_)]])]),t("td",null,[g(c,{class:"dply-felx j-left link",to:`/products/${s.id}`},{default:u(()=>[g(S,{class:"mr-20","lazy-src":l(B)(s.image),alt:s.title},null,8,["lazy-src","alt"]),t("h5",et,e(s.title),1)]),_:2},1032,["to"])]),t("td",{class:Q(["status",{active:s.status==1}])},[t("span",null,e(l(L)(s.status)),1)],2),t("td",null,[s.brand?(n(),p(c,{key:0,class:"link",to:`brands/${s.brand.id}`},{default:u(()=>[m(e(s.brand.title),1)]),_:2},1032,["to"])):(n(),a("span",st,e(o.$t("prod.na")),1))]),t("td",null,[t("span",ot,[(n(!0),a(k,null,$(s.product_categories,(d,j)=>(n(),p(c,{key:j,class:"link",to:`/categories/${d.category.id}`},{default:u(()=>[m(e(d.category.title),1)]),_:2},1032,["to"]))),128))])]),t("td",null,[s.tax_rules?(n(),p(c,{key:0,class:"link",to:`tax-rules/${s.tax_rules.id}`},{default:u(()=>[m(e(s.tax_rules.title),1)]),_:2},1032,["to"])):(n(),a("span",lt,e(o.$t("prod.na")),1))]),t("td",null,e(s.purchased),1),t("td",null,e(s.selling),1),t("td",null,[s.offered?(n(),a("span",nt,e(s.offered),1)):y("",!0)]),t("td",null,e(s.created),1),t("td",null,[g(c,{class:"lite-btn button",to:`/rating-reviews?product=${s.id}`},{default:u(()=>[m(e(o.$t("prod.reviews")),1)]),_:2},1032,["to"])]),t("td",null,[o.$can("product","edit")?(n(),a("button",{key:0,onClick:b(d=>l(D)(s),["prevent"]),class:"lite-btn"},e(o.$t("category.edit")),9,rt)):y("",!0),o.$can("product","delete")?(n(),a("button",{key:1,onClick:b(d=>l(I)(s),["prevent"]),class:"delete-btn lite-btn"},e(o.$t("category.delete")),9,at)):y("",!0)])]))),128))]),_:1},8,["name","order-options","onDeleteBulk","onList"])}}};export{bt as default};
