Files
qhmes/web-dist/js/cron-BgP3IAPd-riMowXKQ.js

3 lines
93 KiB
Java
Raw Normal View History

2026-06-16 18:19:57 +08:00
import{r as lt}from"./dayjs.min-3azO_lpC-BamC5rSi.js";import{c as gi,n as pi}from"./_commonjsHelpers-B52_cu2H-BG14nIm9.js";var wi=Object.defineProperty,vi=Object.defineProperties,ki=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertySymbols,ys=Object.prototype.hasOwnProperty,gs=Object.prototype.propertyIsEnumerable,Si=Math.pow,as=(m,f,h)=>f in m?wi(m,f,{enumerable:!0,configurable:!0,writable:!0,value:h}):m[f]=h,M=(m,f)=>{for(var h in f||(f={}))ys.call(f,h)&&as(m,h,f[h]);if(se)for(var h of se(f))gs.call(f,h)&&as(m,h,f[h]);return m},it=(m,f)=>vi(m,ki(f)),os=(m,f)=>{var h={};for(var u in m)ys.call(m,u)&&f.indexOf(u)<0&&(h[u]=m[u]);if(m!=null&&se)for(var u of se(m))f.indexOf(u)<0&&gs.call(m,u)&&(h[u]=m[u]);return h},Q={},us;function Oi(){if(us)return Q;us=1,Object.defineProperty(Q,"__esModule",{value:!0});class m extends Error{}class f extends m{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class h extends m{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class u extends m{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class c extends m{}class y extends m{constructor(t){super(`Invalid unit ${t}`)}}class g extends m{}class k extends m{constructor(){super("Zone is an abstract class")}}const d="numeric",p="short",O="long",v={year:d,month:d,day:d},L={year:d,month:p,day:d},N={year:d,month:p,day:d,weekday:p},z={year:d,month:O,day:d},W={year:d,month:O,day:d,weekday:O},F={hour:d,minute:d},V={hour:d,minute:d,second:d},j={hour:d,minute:d,second:d,timeZoneName:p},G={hour:d,minute:d,second:d,timeZoneName:O},E={hour:d,minute:d,hourCycle:"h23"},Z={hour:d,minute:d,second:d,hourCycle:"h23"},H={hour:d,minute:d,second:d,hourCycle:"h23",timeZoneName:p},K={hour:d,minute:d,second:d,hourCycle:"h23",timeZoneName:O},ot={year:d,month:d,day:d,hour:d,minute:d},Le={year:d,month:d,day:d,hour:d,minute:d,second:d},ze={year:d,month:p,day:d,hour:d,minute:d},je={year:d,month:p,day:d,hour:d,minute:d,second:d},ws={year:d,month:p,day:d,weekday:p,hour:d,minute:d},Ae={year:d,month:O,day:d,hour:d,minute:d,timeZoneName:p},Ue={year:d,month:O,day:d,hour:d,minute:d,second:d,timeZoneName:p},qe={year:d,month:O,day:d,weekday:O,hour:d,minute:d,timeZoneName:O},Ye={year:d,month:O,day:d,weekday:O,hour:d,minute:d,second:d,timeZoneName:O};class gt{get type(){throw new k}get name(){throw new k}get ianaName(){return this.name}get isUniversal(){throw new k}offsetName(t,e){throw new k}formatOffset(t,e){throw new k}offset(t){throw new k}equals(t){throw new k}get isValid(){throw new k}}let ie=null;class xt extends gt{static get instance(){return ie===null&&(ie=new xt),ie}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:s}){return wn(t,e,s)}formatOffset(t,e){return Vt(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}const ae=new Map;function vs(n){let t=ae.get(n);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),ae.set(n,t)),t}const ks={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Ss(n,t){const e=n.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(e),[,r,i,a,o,l,w,S]=s;return[a,r,i,o,l,w,S]}function Os(n,t){const e=n.formatToParts(t),s=[];for(let r=0;r<e.length;r++){const{type:i,value:a}=e[r],o=ks[i];i==="era"?s[o]=a:D(o)||(s[o]=parseInt(a,10))}return s}const oe=new Map;class at extends gt{static create(t){let e=oe.get(t);return e===void 0&&oe.set(t,e=new at(t)),e}static resetCache(){oe.clear(),ae.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch(e){return!1}}constructor(t){super(),this.zoneName=t,this.valid=at.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:s}){return wn(t
`),c={variables:{},expressions:[],errors:{}},y=0,g=u.length;y<g;y++){var k=u[y],d=null,p=k.trim();if(p.length>0){if(p.match(/^#/))continue;if(d=p.match(/^(.*)=(.*)$/))c.variables[d[1]]=d[2];else{var O=null;try{O=f._parseEntry("0 "+p),c.expressions.push(O.interval)}catch(v){c.errors[p]=v}}}}return c},f.parseFile=function(h,u){Ei.readFile(h,function(c,y){if(c){u(c);return}return u(null,f.parseString(y.toString()))})},Ze=f,Ze}var Vi=Ii();const Fi=pi(Vi),Ci="__custom__";function ps(m){const f=m?lt(m):null;return!f||!f.isValid()?{second:0,minute:0,hour:0}:{second:f.second(),minute:f.minute(),hour:f.hour()}}function _i(m){const{second:f,minute:h,hour:u}=ps(m);return[{label:"每分钟",value:`${f} 0/1 * * * ?`,type:"minute"},{label:"每小时",value:`${f} ${h} 0/1 * * ?`,type:"hour"},{label:"每天",value:`${f} ${h} ${u} * * ?`,type:"day"},{label:"自定义",value:Ci,type:"custom"}]}function Hi(m,f){const h=_i(m),u=h.find(c=>c.type===f);return u?u.value:h[0].value}function $i(m,f){const h=[];if(!m)return h;const u=f&&f.count&&f.count>0?f.count:10,c=f?ms(f.startTime):void 0,y=f?ms(f.endTime):void 0;if(c&&y&&lt(c).isAfter(y))return h;const g={currentDate:c?lt(c).subtract(1,"second").toDate():new Date};c&&(g.startDate=c),y&&(g.endDate=y);try{const k=Fi.parseExpression(m,g);for(let d=0;d<u;d++){let p;try{p=k.next()}catch(v){break}const O=typeof p.toDate=="function"?p.toDate():new Date(p);if(y&&lt(O).isAfter(y))break;h.push(lt(O).format("YYYY-MM-DD HH:mm:ss"))}}catch(k){}return h}function ms(m){if(m==null)return;const f=lt(m);if(f.isValid())return f.toDate()}function Pi(m){var f,h;const u=[],c=m.now?lt(m.now).format("YYYY-MM-DD HH:mm:ss"):lt().format("YYYY-MM-DD HH:mm:ss"),y=(f=m.startTime)!=null?f:c,g=(h=m.endTime)!=null?h:void 0,k=m.previewCount,d=$i(m.cronExp,{count:k,startTime:y,endTime:g});if(d.length>0&&(u.push({key:"start",text:d[0],type:"start"}),d[1]&&u.push({key:"second",text:d[1],type:"normal"}),d[2]&&u.push({key:"third",text:d[2],type:"normal"}),u.push({key:"ellipsis",text:"",type:"ellipsis"})),g){const p=lt(g).format("YYYY-MM-DD HH:mm:ss");u.push({key:"end",text:p,type:"end"})}else u.push({key:"infinite",text:"永不结束",type:"infinite"});if(!u.length){const p=c;u.push({key:"fallback",text:p,type:"start"}),u.push({key:"ellipsis",text:"",type:"ellipsis"}),u.push({key:"infinite",text:"永不结束",type:"infinite"})}return u}function Wi(m){const{second:f,minute:h}=ps(m);return{time:{second:f,minute:h},hour:{mode:"every"},day:{type:"day",day:{mode:"every"}},month:{mode:"every"}}}function Ri(m){var f,h;const u=m!=null?m:Wi(),c=A((f=u.time)==null?void 0:f.second,0,59,0),y=A((h=u.time)==null?void 0:h.minute,0,59,0),g=Zi(u.hour),k=Li(u.month),{dayField:d,weekField:p}=zi(u.day);return`${c} ${y} ${g} ${d} ${k} ${p}`}function Ji(m){const f=m?m.trim().split(/\s+/):[];if(f.length<6)return null;const[h,u,c,y,g,k]=f,d={second:A(Number(h),0,59,0),minute:A(Number(u),0,59,0)},p=ji(c);if(!p)return null;const O=Ai(g);if(!O)return null;const v=Ui(y,k);return v?{time:d,hour:p,day:v,month:O}:null}function A(m,f,h,u){const c=typeof m=="number"&&Number.isFinite(m)?Math.floor(m):NaN;return Number.isNaN(c)?u:c<f?f:c>h?h:c}function Zi(m){var f;if(!m)return"*";const h={mode:(f=m.mode)!=null?f:"every",range:m.range,values:m.values,interval:m.interval};if(h.mode==="range"&&h.range&&h.range.length===2){const[u,c]=h.range;return`${A(u,0,23,0)}-${A(c,0,23,23)}`}if(h.mode==="value"&&Array.isArray(h.values)&&h.values.length>0){const u=Array.from(new Set(h.values.map(c=>A(c,0,23,0))));return u.sort((c,y)=>c-y),u.join(",")}if(h.mode==="interval"&&h.interval){const u=A(h.interval.start,0,23,0),c=A(h.interval.step,1,23,1);return`${u}/${c}`}return"*"}function Li(m){var f;if(!m)return"*";const h={mode:(f=m.mode)!=null?f:"every",values:m.values};if(h.mode==="value"&&Array.isArray(h.values)&&h.values.length>0){const u=Array.from(new Set(h.values.map(c=>A(c,1,12,1))));return u.sort((c,y)=>c-y),u.join(",")}return"*"}function zi(m){var f;if(((m==null?void 0:m.type)==="week"?"week":"day")=="week"){const u=(f=m==null?void 0:m.week)==null?void 0:f.values,c=A