import{o as e}from"./chunk-mlkTr37E.js";import{t}from"./i18n-BLPMFYcN.js";import{t as n}from"./query-string-RcCSSKcJ.js";import{t as r}from"./lodash-BtwhQj49.js";import{n as i,t as a}from"./moment-BMP7hRUy.js";import{c as o,i as s,o as c}from"./utils-TqnRpWKT.js";import{t as l}from"./str-D4Not8kC.js";import{t as u}from"./category-BQh0Dyyn.js";var d=e(r()),f={columns:[{type:`selection`,width:60,align:`center`},{title:`#`,key:`index`,sortable:!0,width:70},{title:t.t(`PRODUCT_NAME`),key:`name`,slot:`name`,sortable:!0,width:400},{title:t.t(`PRODUCT_IMAGE`),key:`image`,slot:`image`,width:80},{title:t.t(`PRODUCT_CATEGORY`),key:`categoryName`,sortable:!0},{title:t.t(`PRODUCT_BRAND`),key:`brand`,sortable:!0},{title:t.t(`PRODUCT_TIME_CREATE`),key:`showTime`,sortable:!0},{title:t.t(`PRODUCT_MODEL_PRICE`),key:`price`,sortable:!0,render:(e,t)=>e(`span`,l(t.row.price))},{title:t.t(`PRODUCT_MODEL_DISCOUNT`),key:`discount`},{title:t.t(`PRODUCT_MODEL_SOLD`),key:`sold`,sortable:!0,render:(e,t)=>e(`span`,l(t.row.sold))},{title:t.t(`PRODUCT_MODEL_TOTAL_SALE`),key:`sale`,sortable:!0,render:(e,t)=>e(`span`,l(t.row.sale))},{title:t.t(`TABLE_ACTION`),slot:`action`}],rows:[]},p=(e,t=0)=>{let r=e.itemid,l=e.shopid,f=e.price/1e5,p=e.global_cat?e.global_cat.catid.at(-1):e.catid,m=u(p)||{id:p,name:p,tree:p},h=n.stringifyUrl({url:`/shopee/spy/product`,query:{productId:r,shopId:l}}),g=new Date(e.ctime*1e3),_=m.display_name||m.name,v=m.tree||_;return{index:t+1,productId:r,shopId:l,categoryId:p,categoryName:_,categoryTree:v,productUrl:c(r,l),videoUrl:d.default.get(e,`video_info_list[0].formats[0].url`,``),shopUrl:o(l),spyUrl:h,name:e.name,location:e.shop_location,shopName:e.shop_name,status:e.item_status,image:s(e.image),brand:e.brand||`No Brand`,stock:e.stock,timeCreate:g,showTime:a(g),year:i(g),price:f,sale:e.historical_sold*f,sold:e.historical_sold,discount:e.discount||`0%`,currency:e.currency,modelCount:0,likeCount:e.liked_count,commentCount:e.cmt_count,ratingCount:e.item_rating.rating_count[0],ratingStart:e.item_rating.rating_star}},m={columns:[{title:t.t(`PRODUCT_MODEL_NAME`),key:`name`},{title:t.t(`PRODUCT_IMAGE_NAME`),key:`image`,slot:`image`},{title:t.t(`PRODUCT_MODEL_PRICE_BEFORE_DISCOUNT`),key:`price`,sortable:!0,render:(e,t)=>e(`span`,l(t.row.price))},{title:t.t(`PRODUCT_MODEL_PRICE`),key:`promotion`,sortable:!0,render:(e,t)=>e(`span`,l(t.row.promotion))},{title:t.t(`PRODUCT_MODEL_DISCOUNT`),key:`discount`,render:(e,t)=>e(`span`,`${t.row.discount}%`)},{title:t.t(`PRODUCT_MODEL_STOCK`),key:`stock`,sortable:!0,render:(e,t)=>e(`span`,l(t.row.stock))},{title:t.t(`PRODUCT_MODEL_SOLD`),key:`sold`,sortable:!0,render:(e,t)=>e(`span`,l(t.row.sold))},{title:t.t(`PRODUCT_MODEL_TOTAL_SALE`),key:`sale`,sortable:!0,render:(e,t)=>e(`span`,l(t.row.sale))}]},h={columns:[{title:t.t(`PRODUCT_NAME`),key:`name`,slot:`name`,width:300},{title:t.t(`PRODUCT_IMAGE`),key:`image`,slot:`image`,width:80},{title:t.t(`PRODUCT_TIME_CREATE`),key:`showTime`,width:120},{title:t.t(`SHOP_NAME`),key:`shopName`,slot:`shopName`,width:150},{title:t.t(`PRODUCT_MODEL_PRICE`),key:`promotion`,render:(e,t)=>e(`span`,l(t.row.promotion))},{title:t.t(`PRODUCT_MODEL_DISCOUNT`),key:`discount`},{title:t.t(`PRODUCT_MODEL_SOLD`),key:`sold`,render:(e,t)=>e(`span`,l(t.row.sold))},{title:t.t(`PRODUCT_MODEL_INCRASE`),key:`soldInc`,render:(e,t)=>e(`span`,l(t.row.soldInc))},{title:t.t(`PRODUCT_MODEL_TOTAL_SALE`),key:`sale`,render:(e,t)=>e(`span`,l(t.row.sale))},{title:t.t(`TABLE_ACTION`),slot:`action`}]};export{h as i,f as n,m as r,p as t};