import{i as w}from"./isArray.1703796278973.js";const i={1:"星期一",2:"星期二",3:"星期三",4:"星期四",5:"星期五",6:"星期六",7:"星期日"},$={seconds:"秒",minutes:"分",hours:"小时"},g=(e,t)=>{let n=0;const s=[],r=t==="week";return w(e)&&e.forEach((f,u)=>{const o=Number(f),c=e[u+1],h=e[u-1],l=o+1,p=o-1;l===c&&p!==h?n=o:p===h&&l!==c?o-n>=2?s.push(r?`${i[n]} - ${i[o]}`:`${n} - ${o}号`):(s.push(r?i[n]:`${n}号`),s.push(r?i[o]:`${o}号`)):p!==h&&l!==c&&s.push(r?i[o]:`${o}号`)}),s},d=e=>{var r;let t="每天",n,s;if(e.trigger==="cron")return n=e.cron,{time:n};if((r=e.when)!=null&&r.length){t=e.trigger==="week"?"每周":"每月";const u=g(e.when||[],e.trigger).splice(0,3);t+=u.join("、"),t+=`...等${e.when.length}天`}return e.once?n=e.once.time+" 执行1次":e.period&&(n=e.period.from+"-"+e.period.to,s=`每${e.period.every}${$[e.period.unit]}执行1次`),{when:t,time:n,extraTime:s}};export{d as h,i as n};
