"use strict";const e=require("../vendor.js");e.dayjs.locale("zh-cn"),e.dayjs.extend(e.relativeTime),exports.ShowLastTime=function(t){return t?e.dayjs(t).fromNow():"-"},exports.generateTimeSlots=function(t=null){const o=t?e.dayjs(t):e.dayjs(),r=(t?e.dayjs(t):e.dayjs()).valueOf(),s=[];let n=8;for(;n<18;){const e=Math.min(n+2,18),t=o.hour(n).minute(0).second(0),u=o.hour(e).minute(0).second(0),a=t.format("HH:mm"),f=u.format("HH:mm"),i=r>=t.valueOf()&&rr&&s.push({label:i?"两个小时内":`${a}-${f}`,str:a,end:f,isCurrent:i,date:o.format("YYYY-MM-DD"),startTimestamp:t.valueOf(),endTimestamp:u.valueOf()}),n=e}return console.log("slots",s),s},exports.getCurrentHour=function(){const e=new Date,t=e.getHours(),o=e.getMinutes();return console.log(t,o,"dayjs().hour()"),{currentHour:t,currentMinute:o}},exports.getTheFutureDay=function(t=1){return e.dayjs().add(t,"day").format("YYYY-MM-DD")},exports.getTimeStatus=function(t){const o=e.dayjs(),r=e.dayjs(t);if(r.isBefore(o)){const e=o.diff(r,"hour"),t=o.diff(r,"minute")%60;let s="已过期望处理时间:";return e>0&&(s+=`${e}个小时`),t>0&&(s+=`${t}分钟`),{label:s,status:"4",color:"#EA0000"}}{const e=r.diff(o,"hour"),t=r.diff(o,"minute")%60;let s,n;e>=24?(s="1",n="#24BC21"):e>=2?(s="2",n="#0082FA"):(s="3",n="#F97316");const u=Math.floor(e/24),a=e%24;let f="期望处理时间还剩:";return u>0&&(f+=`${u}天`),a>0&&(f+=`${a}个小时`),t>0&&(f+=`${t}分钟`),{label:f,status:s,color:n}}},exports.specificTime=function(t){const o=e.dayjs(),r=e.dayjs(t);let s=Math.abs(r.diff(o,"hour",!0))<=2||r.isBefore(o);return console.log(s,"hoursDiff"),s};