import{o as e}from"./chunk-mlkTr37E.js";import{t}from"./i18n-CrIi2yxS.js";import{t as n}from"./moment-BencVxx-.js";import{t as r}from"./init-BAEIYk91.js";var i=e(n()),a=async(e=10,t=0,n=`all`,a=``,o=``)=>{let s={campaign_state:n,sort_key:`performance`,sort_direction:`1`,start_time:(0,i.default)().subtract(12,`months`).unix(),end_time:(0,i.default)().unix(),offset:t,limit:e};return o&&(s.campaign_type=`search`,s.search_content=o),a&&(s.campaign_type=a),(await r.get(`/api/marketing/v3/pas/homepage/`,{params:s})).data.campaign_ads_list||[]},o=async e=>(await r.get(`/api/marketing/v3/pas/campaign/`,{params:{campaignid:e}})).data||null,s=async(e,t)=>{let n={campaignid:Number(e),placement:0,keyword_list:[t]};return await r.put(`/api/marketing/v3/pas/search/`,n)},c=async(e,t)=>{let n={campaignid:Number(e),placement:0,keyword_list:[t]};return await r.put(`/api/marketing/v3/pas/search/`,n)};t.t(`ADS_CAMPAGIN_STATUS.all`),t.t(`ADS_CAMPAGIN_STATUS.ongoing`),t.t(`ADS_CAMPAGIN_TYPE.keyword`),t.t(`ADS_CAMPAGIN_TYPE.shop`);var l=[{title:`#`,key:`index`,width:60},{title:t.t(`ADS_CAMPAGIN_COLUM_TYPE`),key:`type`,width:100},{title:t.t(`ADS_CAMPAGIN_COLUM_NAME`),key:`name`,slot:`name`},{title:t.t(`ADS_CAMPAGIN_COLUM_KEYWORD`),key:`countKeyword`,width:100},{title:t.t(`ADS_CAMPAGIN_COLUM_STATE`),key:`state`,width:100},{title:t.t(`ADS_CAMPAGIN_COLUM_START`),key:`timeStart`,width:120},{title:t.t(`ADS_CAMPAGIN_COLUM_DAILY_EXPENSE`),key:`dailyExpense`,width:120},{title:t.t(`ADS_CAMPAGIN_COLUM_DAILY_QUOTA`),key:`dailyQuota`,width:120},{title:t.t(`ADS_CAMPAGIN_COLUM_TOTAL_EXPENSE`),key:`totalExpense`,width:120}],u=[{type:`selection`,width:60,align:`center`},{title:`#`,key:`index`,width:60},{title:t.t(`KEYWORD_COLUM.KEYWORD`),key:`keyword`,slot:`keyword`,width:220},{title:t.t(`KEYWORD_COLUM.TYPE`),slot:`type`,width:120,key:`type`},{title:t.t(`KEYWORD_COLUM.PRICE_OLD`),key:`priceOld`},{title:t.t(`KEYWORD_COLUM.PRICE_CHANGE`),key:`price`,slot:`price`},{title:t.t(`TABLE_COLUM_ACTION`),slot:`action`}],d=e=>Math.floor(e,0),f=e=>new Date(e*1e3);export{s as a,c,f as i,l as n,o,u as r,a as s,d as t};