import{o as e}from"./chunk-mlkTr37E.js";import{t}from"./lodash-DulIlzb9.js";import{f as n}from"./cache-hsasTrVL.js";import{t as r}from"./init-BAEIYk91.js";var i=e(t()),a=async(e=``,t=1,n=20,a=`name`,o=``)=>{let s={page_number:t,page_size:n};e&&a&&(s.keyword=e,s.search_type=a),o&&(s.cursor=o),s.count_list_types=[`sold_out`,`banned`,`deboosted`,`deleted`,`unlisted`,`reviewing`].join(`,`);let c=await r.get(`/api/v3/mpsku/list/search_product_list`,{params:s}),l=i.default.get(c,`data.products`,[]);return{listProduct:l,cursor:i.default.get(c,`data.page_info.cursor`,``),total:i.default.get(c,`data.page_info.total`,0),count:l.length}},o=async(e=1,t=20,r=``)=>{let i=new n([e,t,r].join(`-`)),o=await i.get();if(o)return o;let s=await a(``,e,t,`name`,r);return s.listProduct.length&&await i.set(s),s};export{a as n,o as t};