diff --git a/index.js b/index.js index c3a6ec1..73910f3 100755 --- a/index.js +++ b/index.js @@ -1,4 +1,7 @@ #!/usr/bin/env node -var K0=Object.create;var l0=Object.defineProperty;var X0=Object.getOwnPropertyDescriptor;var J0=Object.getOwnPropertyNames;var Z0=Object.getPrototypeOf,Q0=Object.prototype.hasOwnProperty;var E=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var e2=(e,r,a,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of J0(r))!Q0.call(e,t)&&t!==a&&l0(e,t,{get:()=>r[t],enumerable:!(n=X0(r,t))||n.enumerable});return e};var Y=(e,r,a)=>(a=e!=null?K0(Z0(e)):{},e2(r||!e||!e.__esModule?l0(a,"default",{value:e,enumerable:!0}):a,e));var c0=E((I2,i0)=>{"use strict";var r2=/[|\\{}()[\]^$+*?.]/g;i0.exports=function(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(r2,"\\$&")}});var f0=E(($2,u0)=>{"use strict";u0.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var K=E((P2,p0)=>{var O=f0(),g0={};for(D in O)O.hasOwnProperty(D)&&(g0[O[D]]=D);var D,c=p0.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(y in c)if(c.hasOwnProperty(y)){if(!("channels"in c[y]))throw new Error("missing channels property: "+y);if(!("labels"in c[y]))throw new Error("missing channel labels property: "+y);if(c[y].labels.length!==c[y].channels)throw new Error("channel and label counts mismatch: "+y);v0=c[y].channels,h0=c[y].labels,delete c[y].channels,delete c[y].labels,Object.defineProperty(c[y],"channels",{value:v0}),Object.defineProperty(c[y],"labels",{value:h0})}var v0,h0,y;c.rgb.hsl=function(e){var r=e[0]/255,a=e[1]/255,n=e[2]/255,t=Math.min(r,a,n),s=Math.max(r,a,n),l=s-t,i,o,u;return s===t?i=0:r===s?i=(a-n)/l:a===s?i=2+(n-r)/l:n===s&&(i=4+(r-a)/l),i=Math.min(i*60,360),i<0&&(i+=360),u=(t+s)/2,s===t?o=0:u<=.5?o=l/(s+t):o=l/(2-s-t),[i,o*100,u*100]};c.rgb.hsv=function(e){var r,a,n,t,s,l=e[0]/255,i=e[1]/255,o=e[2]/255,u=Math.max(l,i,o),h=u-Math.min(l,i,o),f=function(g){return(u-g)/6/h+1/2};return h===0?t=s=0:(s=h/u,r=f(l),a=f(i),n=f(o),l===u?t=n-a:i===u?t=1/3+r-n:o===u&&(t=2/3+a-r),t<0?t+=1:t>1&&(t-=1)),[t*360,s*100,u*100]};c.rgb.hwb=function(e){var r=e[0],a=e[1],n=e[2],t=c.rgb.hsl(e)[0],s=1/255*Math.min(r,Math.min(a,n));return n=1-1/255*Math.max(r,Math.max(a,n)),[t,s*100,n*100]};c.rgb.cmyk=function(e){var r=e[0]/255,a=e[1]/255,n=e[2]/255,t,s,l,i;return i=Math.min(1-r,1-a,1-n),t=(1-r-i)/(1-i)||0,s=(1-a-i)/(1-i)||0,l=(1-n-i)/(1-i)||0,[t*100,s*100,l*100,i*100]};function a2(e,r){return Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2)+Math.pow(e[2]-r[2],2)}c.rgb.keyword=function(e){var r=g0[e];if(r)return r;var a=1/0,n;for(var t in O)if(O.hasOwnProperty(t)){var s=O[t],l=a2(e,s);l.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,a=a>.04045?Math.pow((a+.055)/1.055,2.4):a/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var t=r*.4124+a*.3576+n*.1805,s=r*.2126+a*.7152+n*.0722,l=r*.0193+a*.1192+n*.9505;return[t*100,s*100,l*100]};c.rgb.lab=function(e){var r=c.rgb.xyz(e),a=r[0],n=r[1],t=r[2],s,l,i;return a/=95.047,n/=100,t/=108.883,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,s=116*n-16,l=500*(a-n),i=200*(n-t),[s,l,i]};c.hsl.rgb=function(e){var r=e[0]/360,a=e[1]/100,n=e[2]/100,t,s,l,i,o;if(a===0)return o=n*255,[o,o,o];n<.5?s=n*(1+a):s=n+a-n*a,t=2*n-s,i=[0,0,0];for(var u=0;u<3;u++)l=r+1/3*-(u-1),l<0&&l++,l>1&&l--,6*l<1?o=t+(s-t)*6*l:2*l<1?o=s:3*l<2?o=t+(s-t)*(2/3-l)*6:o=t,i[u]=o*255;return i};c.hsl.hsv=function(e){var r=e[0],a=e[1]/100,n=e[2]/100,t=a,s=Math.max(n,.01),l,i;return n*=2,a*=n<=1?n:2-n,t*=s<=1?s:2-s,i=(n+a)/2,l=n===0?2*t/(s+t):2*a/(n+a),[r,l*100,i*100]};c.hsv.rgb=function(e){var r=e[0]/60,a=e[1]/100,n=e[2]/100,t=Math.floor(r)%6,s=r-Math.floor(r),l=255*n*(1-a),i=255*n*(1-a*s),o=255*n*(1-a*(1-s));switch(n*=255,t){case 0:return[n,o,l];case 1:return[i,n,l];case 2:return[l,n,o];case 3:return[l,i,n];case 4:return[o,l,n];case 5:return[n,l,i]}};c.hsv.hsl=function(e){var r=e[0],a=e[1]/100,n=e[2]/100,t=Math.max(n,.01),s,l,i;return i=(2-a)*n,s=(2-a)*t,l=a*t,l/=s<=1?s:2-s,l=l||0,i/=2,[r,l*100,i*100]};c.hwb.rgb=function(e){var r=e[0]/360,a=e[1]/100,n=e[2]/100,t=a+n,s,l,i,o;t>1&&(a/=t,n/=t),s=Math.floor(6*r),l=1-n,i=6*r-s,s&1&&(i=1-i),o=a+i*(l-a);var u,h,f;switch(s){default:case 6:case 0:u=l,h=o,f=a;break;case 1:u=o,h=l,f=a;break;case 2:u=a,h=l,f=o;break;case 3:u=a,h=o,f=l;break;case 4:u=o,h=a,f=l;break;case 5:u=l,h=a,f=o;break}return[u*255,h*255,f*255]};c.cmyk.rgb=function(e){var r=e[0]/100,a=e[1]/100,n=e[2]/100,t=e[3]/100,s,l,i;return s=1-Math.min(1,r*(1-t)+t),l=1-Math.min(1,a*(1-t)+t),i=1-Math.min(1,n*(1-t)+t),[s*255,l*255,i*255]};c.xyz.rgb=function(e){var r=e[0]/100,a=e[1]/100,n=e[2]/100,t,s,l;return t=r*3.2406+a*-1.5372+n*-.4986,s=r*-.9689+a*1.8758+n*.0415,l=r*.0557+a*-.204+n*1.057,t=t>.0031308?1.055*Math.pow(t,1/2.4)-.055:t*12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,l=l>.0031308?1.055*Math.pow(l,1/2.4)-.055:l*12.92,t=Math.min(Math.max(0,t),1),s=Math.min(Math.max(0,s),1),l=Math.min(Math.max(0,l),1),[t*255,s*255,l*255]};c.xyz.lab=function(e){var r=e[0],a=e[1],n=e[2],t,s,l;return r/=95.047,a/=100,n/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,t=116*a-16,s=500*(r-a),l=200*(a-n),[t,s,l]};c.lab.xyz=function(e){var r=e[0],a=e[1],n=e[2],t,s,l;s=(r+16)/116,t=a/500+s,l=s-n/200;var i=Math.pow(s,3),o=Math.pow(t,3),u=Math.pow(l,3);return s=i>.008856?i:(s-16/116)/7.787,t=o>.008856?o:(t-16/116)/7.787,l=u>.008856?u:(l-16/116)/7.787,t*=95.047,s*=100,l*=108.883,[t,s,l]};c.lab.lch=function(e){var r=e[0],a=e[1],n=e[2],t,s,l;return t=Math.atan2(n,a),s=t*360/2/Math.PI,s<0&&(s+=360),l=Math.sqrt(a*a+n*n),[r,l,s]};c.lch.lab=function(e){var r=e[0],a=e[1],n=e[2],t,s,l;return l=n/360*2*Math.PI,t=a*Math.cos(l),s=a*Math.sin(l),[r,t,s]};c.rgb.ansi16=function(e){var r=e[0],a=e[1],n=e[2],t=1 in arguments?arguments[1]:c.rgb.hsv(e)[2];if(t=Math.round(t/50),t===0)return 30;var s=30+(Math.round(n/255)<<2|Math.round(a/255)<<1|Math.round(r/255));return t===2&&(s+=60),s};c.hsv.ansi16=function(e){return c.rgb.ansi16(c.hsv.rgb(e),e[2])};c.rgb.ansi256=function(e){var r=e[0],a=e[1],n=e[2];if(r===a&&a===n)return r<8?16:r>248?231:Math.round((r-8)/247*24)+232;var t=16+36*Math.round(r/255*5)+6*Math.round(a/255*5)+Math.round(n/255*5);return t};c.ansi16.rgb=function(e){var r=e%10;if(r===0||r===7)return e>50&&(r+=3.5),r=r/10.5*255,[r,r,r];var a=(~~(e>50)+1)*.5,n=(r&1)*a*255,t=(r>>1&1)*a*255,s=(r>>2&1)*a*255;return[n,t,s]};c.ansi256.rgb=function(e){if(e>=232){var r=(e-232)*10+8;return[r,r,r]}e-=16;var a,n=Math.floor(e/36)/5*255,t=Math.floor((a=e%36)/6)/5*255,s=a%6/5*255;return[n,t,s]};c.rgb.hex=function(e){var r=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255),a=r.toString(16).toUpperCase();return"000000".substring(a.length)+a};c.hex.rgb=function(e){var r=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!r)return[0,0,0];var a=r[0];r[0].length===3&&(a=a.split("").map(function(i){return i+i}).join(""));var n=parseInt(a,16),t=n>>16&255,s=n>>8&255,l=n&255;return[t,s,l]};c.rgb.hcg=function(e){var r=e[0]/255,a=e[1]/255,n=e[2]/255,t=Math.max(Math.max(r,a),n),s=Math.min(Math.min(r,a),n),l=t-s,i,o;return l<1?i=s/(1-l):i=0,l<=0?o=0:t===r?o=(a-n)/l%6:t===a?o=2+(n-r)/l:o=4+(r-a)/l+4,o/=6,o%=1,[o*360,l*100,i*100]};c.hsl.hcg=function(e){var r=e[1]/100,a=e[2]/100,n=1,t=0;return a<.5?n=2*r*a:n=2*r*(1-a),n<1&&(t=(a-.5*n)/(1-n)),[e[0],n*100,t*100]};c.hsv.hcg=function(e){var r=e[1]/100,a=e[2]/100,n=r*a,t=0;return n<1&&(t=(a-n)/(1-n)),[e[0],n*100,t*100]};c.hcg.rgb=function(e){var r=e[0]/360,a=e[1]/100,n=e[2]/100;if(a===0)return[n*255,n*255,n*255];var t=[0,0,0],s=r%1*6,l=s%1,i=1-l,o=0;switch(Math.floor(s)){case 0:t[0]=1,t[1]=l,t[2]=0;break;case 1:t[0]=i,t[1]=1,t[2]=0;break;case 2:t[0]=0,t[1]=1,t[2]=l;break;case 3:t[0]=0,t[1]=i,t[2]=1;break;case 4:t[0]=l,t[1]=0,t[2]=1;break;default:t[0]=1,t[1]=0,t[2]=i}return o=(1-a)*n,[(a*t[0]+o)*255,(a*t[1]+o)*255,(a*t[2]+o)*255]};c.hcg.hsv=function(e){var r=e[1]/100,a=e[2]/100,n=r+a*(1-r),t=0;return n>0&&(t=r/n),[e[0],t*100,n*100]};c.hcg.hsl=function(e){var r=e[1]/100,a=e[2]/100,n=a*(1-r)+.5*r,t=0;return n>0&&n<.5?t=r/(2*n):n>=.5&&n<1&&(t=r/(2*(1-n))),[e[0],t*100,n*100]};c.hcg.hwb=function(e){var r=e[1]/100,a=e[2]/100,n=r+a*(1-r);return[e[0],(n-r)*100,(1-n)*100]};c.hwb.hcg=function(e){var r=e[1]/100,a=e[2]/100,n=1-a,t=n-r,s=0;return t<1&&(s=(n-t)/(1-t)),[e[0],t*100,s*100]};c.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};c.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};c.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};c.gray.hsl=c.gray.hsv=function(e){return[0,0,e[0]]};c.gray.hwb=function(e){return[0,100,e[0]]};c.gray.cmyk=function(e){return[0,0,0,e[0]]};c.gray.lab=function(e){return[e[0],0,0]};c.gray.hex=function(e){var r=Math.round(e[0]/100*255)&255,a=(r<<16)+(r<<8)+r,n=a.toString(16).toUpperCase();return"000000".substring(n.length)+n};c.rgb.gray=function(e){var r=(e[0]+e[1]+e[2])/3;return[r/255*100]}});var b0=E((Y2,d0)=>{var q=K();function t2(){for(var e={},r=Object.keys(q),a=r.length,n=0;n{var X=K(),l2=b0(),_={},i2=Object.keys(X);function c2(e){var r=function(a){return a==null?a:(arguments.length>1&&(a=Array.prototype.slice.call(arguments)),e(a))};return"conversion"in e&&(r.conversion=e.conversion),r}function u2(e){var r=function(a){if(a==null)return a;arguments.length>1&&(a=Array.prototype.slice.call(arguments));var n=e(a);if(typeof n=="object")for(var t=n.length,s=0;s{"use strict";var T=y0(),H=(e,r)=>function(){return`\x1B[${e.apply(T,arguments)+r}m`},V=(e,r)=>function(){let a=e.apply(T,arguments);return`\x1B[${38+r};5;${a}m`},G=(e,r)=>function(){let a=e.apply(T,arguments);return`\x1B[${38+r};2;${a[0]};${a[1]};${a[2]}m`};function f2(){let e=new Map,r={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};r.color.grey=r.color.gray;for(let t of Object.keys(r)){let s=r[t];for(let l of Object.keys(s)){let i=s[l];r[l]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},s[l]=r[l],e.set(i[0],i[1])}Object.defineProperty(r,t,{value:s,enumerable:!1}),Object.defineProperty(r,"codes",{value:e,enumerable:!1})}let a=t=>t,n=(t,s,l)=>[t,s,l];r.color.close="\x1B[39m",r.bgColor.close="\x1B[49m",r.color.ansi={ansi:H(a,0)},r.color.ansi256={ansi256:V(a,0)},r.color.ansi16m={rgb:G(n,0)},r.bgColor.ansi={ansi:H(a,10)},r.bgColor.ansi256={ansi256:V(a,10)},r.bgColor.ansi16m={rgb:G(n,10)};for(let t of Object.keys(T)){if(typeof T[t]!="object")continue;let s=T[t];t==="ansi16"&&(t="ansi"),"ansi16"in s&&(r.color.ansi[t]=H(s.ansi16,0),r.bgColor.ansi[t]=H(s.ansi16,10)),"ansi256"in s&&(r.color.ansi256[t]=V(s.ansi256,0),r.bgColor.ansi256[t]=V(s.ansi256,10)),"rgb"in s&&(r.color.ansi16m[t]=G(s.rgb,0),r.bgColor.ansi16m[t]=G(s.rgb,10))}return r}Object.defineProperty(m0,"exports",{enumerable:!0,get:f2})});var M0=E((H2,k0)=>{"use strict";k0.exports=(e,r)=>{r=r||process.argv;let a=e.startsWith("-")?"":e.length===1?"-":"--",n=r.indexOf(a+e),t=r.indexOf("--");return n!==-1&&(t===-1?!0:n{"use strict";var v2=require("os"),w=M0(),x=process.env,L;w("no-color")||w("no-colors")||w("color=false")?L=!1:(w("color")||w("colors")||w("color=true")||w("color=always"))&&(L=!0);"FORCE_COLOR"in x&&(L=x.FORCE_COLOR.length===0||parseInt(x.FORCE_COLOR,10)!==0);function h2(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function g2(e){if(L===!1)return 0;if(w("color=16m")||w("color=full")||w("color=truecolor"))return 3;if(w("color=256"))return 2;if(e&&!e.isTTY&&L!==!0)return 0;let r=L?1:0;if(process.platform==="win32"){let a=v2.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in x)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(a=>a in x)||x.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in x)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(x.TEAMCITY_VERSION)?1:0;if(x.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in x){let a=parseInt((x.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(x.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(x.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(x.TERM)||"COLORTERM"in x?1:(x.TERM==="dumb",r)}function J(e){let r=g2(e);return h2(r)}E0.exports={supportsColor:J,stdout:J(process.stdout),stderr:J(process.stderr)}});var _0=E((G2,A0)=>{"use strict";var p2=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,R0=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,d2=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,b2=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi,x2=new Map([["n",` -`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function S0(e){return e[0]==="u"&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):x2.get(e)||e}function y2(e,r){let a=[],n=r.trim().split(/\s*,\s*/g),t;for(let s of n)if(!isNaN(s))a.push(Number(s));else if(t=s.match(d2))a.push(t[2].replace(b2,(l,i,o)=>i?S0(i):o));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${e}')`);return a}function m2(e){R0.lastIndex=0;let r=[],a;for(;(a=R0.exec(e))!==null;){let n=a[1];if(a[2]){let t=y2(n,a[2]);r.push([n].concat(t))}else r.push([n])}return r}function O0(e,r){let a={};for(let t of r)for(let s of t.styles)a[s[0]]=t.inverse?null:s.slice(1);let n=e;for(let t of Object.keys(a))if(Array.isArray(a[t])){if(!(t in n))throw new Error(`Unknown Chalk style: ${t}`);a[t].length>0?n=n[t].apply(n,a[t]):n=n[t]}return n}A0.exports=(e,r)=>{let a=[],n=[],t=[];if(r.replace(p2,(s,l,i,o,u,h)=>{if(l)t.push(S0(l));else if(o){let f=t.join("");t=[],n.push(a.length===0?f:O0(e,a)(f)),a.push({inverse:i,styles:m2(o)})}else if(u){if(a.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(O0(e,a)(t.join(""))),t=[],a.pop()}else t.push(h)}),n.push(t.join("")),a.length>0){let s=`Chalk template literal is missing ${a.length} closing bracket${a.length===1?"":"s"} (\`}\`)`;throw new Error(s)}return n.join("")}});var e0=E((U2,j)=>{"use strict";var Q=c0(),p=w0(),Z=C0().stdout,w2=_0(),L0=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),N0=["ansi","ansi","ansi256","ansi16m"],B0=new Set(["gray"]),N=Object.create(null);function T0(e,r){r=r||{};let a=Z?Z.level:0;e.level=r.level===void 0?a:r.level,e.enabled="enabled"in r?r.enabled:e.level>0}function B(e){if(!this||!(this instanceof B)||this.template){let r={};return T0(r,e),r.template=function(){let a=[].slice.call(arguments);return E2.apply(null,[r.template].concat(a))},Object.setPrototypeOf(r,B.prototype),Object.setPrototypeOf(r.template,r),r.template.constructor=B,r.template}T0(this,e)}L0&&(p.blue.open="\x1B[94m");for(let e of Object.keys(p))p[e].closeRe=new RegExp(Q(p[e].close),"g"),N[e]={get(){let r=p[e];return U.call(this,this._styles?this._styles.concat(r):[r],this._empty,e)}};N.visible={get(){return U.call(this,this._styles||[],!0,"visible")}};p.color.closeRe=new RegExp(Q(p.color.close),"g");for(let e of Object.keys(p.color.ansi))B0.has(e)||(N[e]={get(){let r=this.level;return function(){let n={open:p.color[N0[r]][e].apply(null,arguments),close:p.color.close,closeRe:p.color.closeRe};return U.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}});p.bgColor.closeRe=new RegExp(Q(p.bgColor.close),"g");for(let e of Object.keys(p.bgColor.ansi)){if(B0.has(e))continue;let r="bg"+e[0].toUpperCase()+e.slice(1);N[r]={get(){let a=this.level;return function(){let t={open:p.bgColor[N0[a]][e].apply(null,arguments),close:p.bgColor.close,closeRe:p.bgColor.closeRe};return U.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}}}}var k2=Object.defineProperties(()=>{},N);function U(e,r,a){let n=function(){return M2.apply(n,arguments)};n._styles=e,n._empty=r;let t=this;return Object.defineProperty(n,"level",{enumerable:!0,get(){return t.level},set(s){t.level=s}}),Object.defineProperty(n,"enabled",{enumerable:!0,get(){return t.enabled},set(s){t.enabled=s}}),n.hasGrey=this.hasGrey||a==="gray"||a==="grey",n.__proto__=k2,n}function M2(){let e=arguments,r=e.length,a=String(arguments[0]);if(r===0)return"";if(r>1)for(let t=1;t2100)return o;for(let f=1900;f<=2100;f++){let g=C2(f);if(s-=g,s<=0){o.year=f,s+=g;break}}l=H0(o.year),i=t0(o.year);for(let f=0;f0&&f>=i&&(o.leap=f===i,o.month-=1);break}if(o.custom=q0[h]||"",u){let f=u.slice(r*4,(r+1)*4);+f.slice(0,2)===a?o.solarTerms=r0[r*2]:+f.slice(2)===a&&(o.solarTerms=r0[r*2+1])}return o.festival=D0[`${r+1}.${a}`]||"",o.leap||(o.month===11&&o.day===l.pop()?(o.festival=F["12.30"],o.lunarFestival=F["12.30"]):(o.festival=F[`${o.month+1}.${o.day}`]||o.festival,o.lunarFestival=F[`${o.month+1}.${o.day}`]||"")),o.yearCN=n0(o.year),o.monthCN=(o.leap>0?"\u95F0":"")+F0[o.month]+"\u6708",o.day<11?o.dayCN=k[0]+k[o.day]:o.day<20?o.dayCN=k[10]+k[o.day-10]:o.day===20?o.dayCN=k[2]+k[10]:o.day<30?o.dayCN=k[20]+k[o.day-20]:o.day===30&&(o.dayCN=k[3]+k[10]),o.short=o.festival?o.festival:o.solarTerms?o.solarTerms:o.day===1?o.monthCN:o.dayCN,o}function C2(e){var r=H0(e);return r.reduce((a,n)=>a+=n,0)}function t0(e){var r=z[e-1900];return r&15}function R2(e){var r=z[e-1900],a=t0(e);return a>0?r&983040?30:29:0}function H0(e){var r=z[e-1900],a=t0(e),n=R2(e),t=[];for(let s=32768;s>8;s>>=1)t.push(r&s?30:29);return a>0&&t.splice(a,0,n),t}function n0(e){var r=(e-3)%10,a=(e-3)%12;return r=r===0?10:r,a=a===0?12:a,$0[r-1]+P0[a-1]+I0[(e-4)%12]+"\u5E74"}var O2=["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"].map((e,r)=>(e="\u661F\u671F"+e,(r===0||r===6)&&(e=v.default.red(e))," "+e+" "+v.default.grey("\u2502"))),$=v.default.grey("\u2502"),S2=v.default.grey("\u251C"),A2=v.default.grey("\u2514"),J2=v.default.grey("\u2502"+(" ".repeat(10)+"\u2502").repeat(7));function U0(){var e=new Date;return[e.getFullYear(),e.getMonth()]}function V0(e,r){return new Date(e,r+1,0).getDate()}function G0(e,r,a){return new Date(e,r,a||1).getDay()}function _2({year:e,month:r,day:a},n){return n.year===e&&n.month===r&&n.day===a}function T2(){var e=new Date;return{year:e.getFullYear(),month:e.getMonth(),day:e.getDate()}}function L2(e,r){var a=V0(e,r-1),n=V0(e,r),t=1-G0(e,r),s=0,l=T2(),i=[],o,u,h,f;t<1&&(o=e,u=r-1,u<0&&(u=11,o--));for(let g=t;g<=n;g++){let M={day:g<1?a- -g:(g+"").padStart(2,"0")},A;if(g>0){let o0=G0(e,r,g);A=W(e,r,g),M.weekend=o0===0||o0===6,M.picked=!!_2({year:e,month:r,day:g},l),M.highlight=!!A.festival||!!A.solarTerms}else A=W(o,u,a+g),M.grey=1;M.lunar=A.short,M.custom=A.custom,i.push(M)}s=i.length%7,s=s>0?7-s:0,s>0&&(h=e,f=r+1,f>11&&(f=0,h++));for(let g=1;g<=s;g++){let M=W(h,f,g);i.push({day:(g+"").padStart(2,"0"),lunar:M.short,custom:M.custom,grey:1})}return i}function N2(e,r){var a=`${e}\u5E74${r+1}\u6708${" ".repeat(10)}${n0(e,r)}`;a=v.default.grey("\u2502 ")+v.default.cyan(a)+" ".repeat(71-a.length-2)+v.default.grey("\u2502"),console.log(v.default.grey("\u250C\u2500"+"\u2500".repeat(75)+"\u2510")),console.log(v.default.grey("\u2502"+" ".repeat(76)+"\u2502")),console.log(a),console.log(v.default.grey("\u2502"+" ".repeat(76)+"\u2502")),console.log(v.default.grey("\u251C"+"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C".repeat(7).slice(0,-1)+"\u2524")),console.log(v.default.grey("\u2502")+O2.join("")),console.log(v.default.grey("\u251C"+"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C".repeat(7).slice(0,-1)+"\u2524"))}function B2(e,r){var a=L2(e,r),n=0,t=3*Math.ceil(a.length/7);for(let s=0;s=0?f=" ".repeat(h):g=g.slice(0,h),o.picked?l+=g+v.default.bgBlue.white(f+o.lunar+f)+g+$:(o.lunar&&(o.lunar=o.highlight?v.default.cyan(o.lunar):o.weekend?v.default.redBright(o.lunar):v.default.grey(o.lunar)),l+=" ".repeat(h+2)+o.lunar+" ".repeat(h+2)+$);break}}l&&console.log(l)}}function S(e,r){N2(e,r),B2(e,r)}var W0="1.2.6",C=process.argv.slice(2),P=C.shift(),[m,b]=U0();function s0(e){for(let r=0;r<12;r++)S(e,r),r<11&&console.log("")}function d(...e){e[0]=e[0].padEnd(20," "),e.length>1&&e.splice(1,0," - "),console.log.apply(null,e)}function j2(){d("=".repeat(64)),d(`\u7EC8\u7AEF\u7248\u4E07\u5E74\u5386 v${W0}, \u4F5C\u8005: \u5B87\u5929`),d("=".repeat(64)),d("\u7528\u6CD5: cal [command] args..."),d("Commands:"),d(" -y {year}","\u6253\u5370\u6307\u5B9A\u5E74\u4EFD\u7684\u65E5\u5386"),d(" -m","\u6253\u5370\u6307\u5B9A\u6708\u4EFD\u7684\u65E5\u5386"),d(" -c","\u5BFC\u5165\u81EA\u5B9A\u4E49\u4F11\u5047\u65E5, \u5FC5\u987B\u662F\u6807\u51C6json\u683C\u5F0F, \u8BED\u6CD5\u770B\u4E0B\u9762\u7684\u793A\u4F8B"),d(" -h","\u67E5\u770B\u5E2E\u52A9\u6587\u6863"),d(" -v",`\u67E5\u770B\u7A0B\u5E8F\u7684\u7248\u672C -`),d("\u793A\u4F8B: "),d(" cal "+R.default.grey("# \u4E0D\u5E26\u53C2\u6570\u6253\u5370\u5F53\u524D\u5E74\u6708")),d(" cal -y "+R.default.grey("# -y \u4E0D\u63A5\u53C2\u6570, \u6253\u5370\u5F53\u524D\u5E74\u7684\u6240\u6709\u6708\u4EFD")),d(" cal -y 2000 "+R.default.grey("# \u6253\u5370\u6307\u5B9A\u5E74\u4EFD\u7684\u6240\u6709\u6708\u4EFD")),d(" cal -y 2021 5 "+R.default.grey("# \u6253\u5370\u6307\u5B9A\u5E74\u4EFD, \u6307\u5B9A\u6708\u4EFD")),d(" cal -y 2000 -m 3 "+R.default.grey("# \u540C\u4E0A")),d(" cal -m 5 "+R.default.grey("# \u6253\u5370\u5F53\u524D\u5E74\u4EFD\u7684 \u6307\u5B9A\u6708\u4EFD")),d(' cal -c {"2021.12.11":"\u73ED","2021.12.12":"\u4F11"} '+R.default.grey("# \u5BFC\u5165\u81EA\u5B9A\u4E49\u4F11\u5047\u65E5")),process.exit()}switch(P){case"-y":switch(C.length){case 0:s0(m);break;case 1:case 2:m=+C.shift(),b=+C.shift(),m===m?b<13&&b>0?S(m,b-1):s0(m):console.log("-y \u53C2\u6570\u5F02\u5E38");break;case 3:m=+C.shift(),P=C.shift(),b=+C.pop(),P==="-m"&&b<13&&b>0?S(m,b-1):console.log("-m \u53C2\u6570\u5F02\u5E38");break;default:console.log("-y \u53C2\u6570\u5F02\u5E38");break}break;case"-m":b=+C.shift(),b<13&&b>0?S(m,b-1):console.log("-m \u53C2\u6570\u5F02\u5E38");break;case"-v":d(W0);break;case"-h":j2();break;case"-c":let e=C.shift();if(e)try{JSON.parse(e),z0.default.writeFileSync(I,e),console.log("\u5BFC\u5165\u6210\u529F")}catch{console.log("\u9519\u8BEF\u7684json\u6570\u636E")}else console.log("\u5BFC\u5165\u7684\u6570\u636E\u4E3A\u7A7A");break;default:P?(m=+P,b=+C.shift(),m===m?b<13&&b>0?S(m,b-1):s0(m):console.log("\u53C2\u6570\u5F02\u5E38")):S(m,b);break}process.exit(); +var A0=Object.create;var q=Object.defineProperty;var C0=Object.getOwnPropertyDescriptor;var O0=Object.getOwnPropertyNames;var E0=Object.getPrototypeOf,R0=Object.prototype.hasOwnProperty;var S0=(e,r,t,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of O0(r))!R0.call(e,n)&&n!==t&&q(e,n,{get:()=>r[n],enumerable:!(a=C0(r,n))||a.enumerable});return e};var N=(e,r,t)=>(t=e!=null?A0(E0(e)):{},S0(r||!e||!e.__esModule?q(t,"default",{value:e,enumerable:!0}):t,e));var v0=N(require("fs"));var z=(e=0)=>r=>`\x1B[${r+e}m`,Q=(e=0)=>r=>`\x1B[${38+e};5;${r}m`,X=(e=0)=>(r,t,a)=>`\x1B[${38+e};2;${r};${t};${a}m`,x={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},e2=Object.keys(x.modifier),N0=Object.keys(x.color),L0=Object.keys(x.bgColor),r2=[...N0,...L0];function M0(){let e=new Map;for(let[r,t]of Object.entries(x)){for(let[a,n]of Object.entries(t))x[a]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},t[a]=x[a],e.set(n[0],n[1]);Object.defineProperty(x,r,{value:t,enumerable:!1})}return Object.defineProperty(x,"codes",{value:e,enumerable:!1}),x.color.close="\x1B[39m",x.bgColor.close="\x1B[49m",x.color.ansi=z(),x.color.ansi256=Q(),x.color.ansi16m=X(),x.bgColor.ansi=z(10),x.bgColor.ansi256=Q(10),x.bgColor.ansi16m=X(10),Object.defineProperties(x,{rgbToAnsi256:{value(r,t,a){return r===t&&t===a?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(t/255*5)+Math.round(a/255*5)},enumerable:!1},hexToRgb:{value(r){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(r.toString(16));if(!t)return[0,0,0];let[a]=t;a.length===3&&(a=[...a].map(l=>l+l).join(""));let n=Number.parseInt(a,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:r=>x.rgbToAnsi256(...x.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value(r){if(r<8)return 30+r;if(r<16)return 90+(r-8);let t,a,n;if(r>=232)t=((r-232)*10+8)/255,a=t,n=t;else{r-=16;let d=r%36;t=Math.floor(r/36)/5,a=Math.floor(d/6)/5,n=d%6/5}let l=Math.max(t,a,n)*2;if(l===0)return 30;let i=30+(Math.round(n)<<2|Math.round(a)<<1|Math.round(t));return l===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(r,t,a)=>x.ansi256ToAnsi(x.rgbToAnsi256(r,t,a)),enumerable:!1},hexToAnsi:{value:r=>x.ansi256ToAnsi(x.hexToAnsi256(r)),enumerable:!1}}),x}var _0=M0(),v=_0;var w=N(require("process"),1),r0=N(require("os"),1),$=N(require("tty"),1);function y(e,r=globalThis.Deno?globalThis.Deno.args:w.default.argv){let t=e.startsWith("-")?"":e.length===1?"-":"--",a=r.indexOf(t+e),n=r.indexOf("--");return a!==-1&&(n===-1||a=2,has16m:e>=3}}function F0(e,{streamIsTTY:r,sniffFlags:t=!0}={}){let a=I0();a!==void 0&&(k=a);let n=t?k:a;if(n===0)return 0;if(t){if(y("color=16m")||y("color=full")||y("color=truecolor"))return 3;if(y("color=256"))return 2}if("TF_BUILD"in f&&"AGENT_NAME"in f)return 1;if(e&&!r&&n===void 0)return 0;let l=n||0;if(f.TERM==="dumb")return l;if(w.default.platform==="win32"){let i=r0.default.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in f)return"GITHUB_ACTIONS"in f||"GITEA_ACTIONS"in f?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(i=>i in f)||f.CI_NAME==="codeship"?1:l;if("TEAMCITY_VERSION"in f)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(f.TEAMCITY_VERSION)?1:0;if(f.COLORTERM==="truecolor"||f.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in f){let i=Number.parseInt((f.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(f.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(f.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(f.TERM)||"COLORTERM"in f?1:l}function e0(e,r={}){let t=F0(e,{streamIsTTY:e&&e.isTTY,...r});return B0(t)}var k0={stdout:e0({isTTY:$.default.isatty(1)}),stderr:e0({isTTY:$.default.isatty(2)})},t0=k0;function o0(e,r,t){let a=e.indexOf(r);if(a===-1)return e;let n=r.length,l=0,i="";do i+=e.slice(l,a)+r+t,l=a+n,a=e.indexOf(r,l);while(a!==-1);return i+=e.slice(l),i}function a0(e,r,t,a){let n=0,l="";do{let i=e[a-1]==="\r";l+=e.slice(n,i?a-1:a)+r+(i?`\r +`:` +`)+t,n=a+1,a=e.indexOf(` +`,n)}while(a!==-1);return l+=e.slice(n),l}var{stdout:n0,stderr:l0}=t0,P=Symbol("GENERATOR"),R=Symbol("STYLER"),L=Symbol("IS_EMPTY"),s0=["ansi","ansi","ansi256","ansi16m"],S=Object.create(null),w0=(e,r={})=>{if(r.level&&!(Number.isInteger(r.level)&&r.level>=0&&r.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=n0?n0.level:0;e.level=r.level===void 0?t:r.level};var Y0=e=>{let r=(...t)=>t.join(" ");return w0(r,e),Object.setPrototypeOf(r,M.prototype),r};function M(e){return Y0(e)}Object.setPrototypeOf(M.prototype,Function.prototype);for(let[e,r]of Object.entries(v))S[e]={get(){let t=Y(this,G(r.open,r.close,this[R]),this[L]);return Object.defineProperty(this,e,{value:t}),t}};S.visible={get(){let e=Y(this,this[R],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var V=(e,r,t,...a)=>e==="rgb"?r==="ansi16m"?v[t].ansi16m(...a):r==="ansi256"?v[t].ansi256(v.rgbToAnsi256(...a)):v[t].ansi(v.rgbToAnsi(...a)):e==="hex"?V("rgb",r,t,...v.hexToRgb(...a)):v[t][e](...a),D0=["rgb","hex","ansi256"];for(let e of D0){S[e]={get(){let{level:t}=this;return function(...a){let n=G(V(e,s0[t],"color",...a),v.color.close,this[R]);return Y(this,n,this[L])}}};let r="bg"+e[0].toUpperCase()+e.slice(1);S[r]={get(){let{level:t}=this;return function(...a){let n=G(V(e,s0[t],"bgColor",...a),v.bgColor.close,this[R]);return Y(this,n,this[L])}}}}var j0=Object.defineProperties(()=>{},{...S,level:{enumerable:!0,get(){return this[P].level},set(e){this[P].level=e}}}),G=(e,r,t)=>{let a,n;return t===void 0?(a=e,n=r):(a=t.openAll+e,n=r+t.closeAll),{open:e,close:r,openAll:a,closeAll:n,parent:t}},Y=(e,r,t)=>{let a=(...n)=>$0(a,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(a,j0),a[P]=e,a[R]=r,a[L]=t,a},$0=(e,r)=>{if(e.level<=0||!r)return e[L]?"":r;let t=e[R];if(t===void 0)return r;let{openAll:a,closeAll:n}=t;if(r.includes("\x1B"))for(;t!==void 0;)r=o0(r,t.close,t.open),t=t.parent;let l=r.indexOf(` +`);return l!==-1&&(r=a0(r,n,a,l)),a+r+n};Object.defineProperties(M.prototype,S);var P0=M(),i2=M({level:l0?l0.level:0});var s=P0;var i0=require("path"),D=[19416,19168,42352,21717,53856,55632,91476,22176,39632,21970,19168,42422,42192,53840,119381,46400,54944,44450,38320,84343,18800,42160,46261,27216,27968,109396,11104,38256,21234,18800,25958,54432,59984,92821,23248,11104,100067,37600,116951,51536,54432,120998,46416,22176,107956,9680,37584,53938,43344,46423,27808,46416,86869,19872,42416,83315,21168,43432,59728,27296,44710,43856,19296,43748,42352,21088,62051,55632,23383,22176,38608,19925,19152,42192,54484,53840,54616,46400,46752,103846,38320,18864,43380,42160,45690,27216,27968,44870,43872,38256,19189,18800,25776,29859,59984,27480,23232,43872,38613,37600,51552,55636,54432,55888,30034,22176,43959,9680,37584,51893,43344,46240,47780,44368,21977,19360,42416,86390,21168,43312,31060,27296,44368,23378,19296,42726,42208,53856,60005,54576,23200,30371,38608,19195,19152,42192,118966,53840,54560,56645,46496,22224,21938,18864,42359,42160,43600,111189,27936,44448,84835,37744,18936,18800,25776,92326,59984,27424,108228,43744,37600,53987,51552,54615,54432,55888,23893,22176,42704,21972,21200,43448,43344,46240,46758,44368,21920,43940,42416,21168,45683,26928,29495,27296,44368,84821,19296,42352,21732,53600,59752,54560,55968,92838,22224,19168,43476,41680,53584,62034,54560],c0=["\u6B63","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341","\u51AC","\u814A"],T={0:"\u521D",1:"\u4E00",2:"\u4E8C",3:"\u4E09",4:"\u56DB",5:"\u4E94",6:"\u516D",7:"\u4E03",8:"\u516B",9:"\u4E5D",10:"\u5341",20:"\u5EFF"},x0=["\u9F20","\u725B","\u864E","\u5154","\u9F99","\u86C7","\u9A6C","\u7F8A","\u7334","\u9E21","\u72D7","\u732A"],u0=["\u7532","\u4E59","\u4E19","\u4E01","\u620A","\u5DF1","\u5E9A","\u8F9B","\u58EC","\u7678"],f0=["\u5B50","\u4E11","\u5BC5","\u536F","\u8FB0","\u5DF3","\u5348","\u672A","\u7533","\u9149","\u620C","\u4EA5"],H=["\u5C0F\u5BD2","\u5927\u5BD2","\u7ACB\u6625","\u96E8\u6C34","\u60CA\u86F0","\u6625\u5206","\u6E05\u660E","\u8C37\u96E8","\u7ACB\u590F","\u5C0F\u6EE1","\u8292\u79CD","\u590F\u81F3","\u5C0F\u6691","\u5927\u6691","\u7ACB\u79CB","\u5904\u6691","\u767D\u9732","\u79CB\u5206","\u5BD2\u9732","\u971C\u964D","\u7ACB\u51AC","\u5C0F\u96EA","\u5927\u96EA","\u51AC\u81F3"],d0=["062004190621052006210622072308230823092408230722","062104190621052106220622082308240824092408230822","062105190621062106220722082408240824092408230823","062105200722062107220722082409240924092408230823","072105200621052006210622072308230823092408230722","062104190621052106220622082308240824092408230822","062105190621062106220622082408240824092408230823","062105200722062107220722082409240924092408230823","072105200621052006210622072308230823092408230722","062104190621052106220622082308240824092408230822","062105190621062106220622082408240824092408230823","062105200722062107220722082409240924092408230823","072105200621052006210622072308230823092408220722","062004190621052106220622082308240823092408230822","062104190621052106220622082408240824092408230823","062105200622062106220722082408240924092408230823","062105200621052006210622072308230823082408220722","062004190621052106210622082308240823092408230822","062104190621052106220622082408240824092408230822","062105200622062106220722082408240924092408230823","062105200621052006210622072308230823082408220722","062004190621052006210622082308240823092408230722","062104190621052106220622082408240824092408230822","062105190621062106220722082408240924092408230823","062105200621052006210622072308230823082408220722","062004190621052006210622082308240823092408230722","062104190621052106220622082308240824092408230822","062105190621062106220722082408240924092408230823","062105200621052006210622072308230823082307220722","062004190621052006210622072308230823092408230722","062104190621052106220622082308240824092408230822","062105190621062106220722082408240824092408230823","062105200621052006210621072308230823082307220722","062004190621052006210622072308230823092408230722","062104190621052106220622082308240824092408230822","062105190621062106220622082408240824092408230823","062105200621052006210621072308230823082307220722","062004190621052006210622072308230823092408230722","062104190621052106220622082308240824092408230822","062105190621062106220622082408240824092408230823","062105200621052006210621072308230823082307220722","062004190621052006210622072308230823092408230722","062104190621052106220622082308240824092408230822","062105190621062106220622082408240824092408230823","062105200621052005210621072308230823082307220722","062004190621052006210622072308230823082408220722","062004190621052106220622082308240823092408230822","062104190621052106220622082408240824092408230823","062105200521052005210621072307230823082307220722","052004190621052006210622072308230823082408220722","062004190621052006210622082308240823092408230822","062104190621052106220622082408240824092408230823","062105200521052005210621072307230823082307220722","052004190621052006210622072308230823082408220722","062004190621052006210622082308240823092408230722","062104190621052106220622082308240824092408230822","062105200520052005210621072307230823082307220722","052004190621052006210622072308230823082408220722","062004190621052006210622072308230823092408230722","062104190621052106220622082308240824092408230822","062105190520052005210621072307230723082307220722","052004190621052006210621072308230823082307220722","062004190621052006210622072308230823092408230722","062104190621052106220622082308240824092408230822","062105190520052005210621072307230723082307220722","052004190621052006210621072308230823082307220722","062004190621052006210622072308230823092408230722","062104190621052106220622082308240824092408230822","062105190520052005210521072307230723082307220722","052004190621052006210621072308230823082307220722","062004190621052006210622072308230823092408230722","062104190621052106220622082308240824092408230822","062105190520052005210521072307230723082307220722","052004190621052005210621072308230823082307220722","062004190621052006210622072308230823092408230722","062104190621052106220622082308240823092408230822","062105190520042005210521072307230723082307220722","052004190621052005210621072307230823082307220722","062004190621052006210622072308230823082408230722","062004190621052106210622082308240823092408230822","062105190520042005210521072307230723082307220722","052004190621052005210621072307230823082307220722","062004190621052006210622072308230823082408220722","062004190621052006210622082308240823092408230822","062104190520042005210521072207230723082307220722","052004190521052005210621072307230823082307220722","052004190621052006210622072308230823082408220722","062004190621052006210622072308240823092408230722","062104190520042005210521072207230723082307220721","052004190520052005210621072307230723082307220722","052004190621052006210621072308230823082408220722","062004190621052006210622072308230823092408230722","062104190520042005210521072207230723082307220721","052004180520052005210621072307230723082307220722","052004190621052006210621072308230823082307220722","062004190621052006210622072308230823092408230722","062104190520042005210521072207230723082307220721","052004180520052005210521072307230723082307220722","052004190621052006210621072308230823082307220722","062004190621052006210622072308230823092408230722","062104190520042005210521072207230723082307220721","052004180520052005210521072307230723082307220722","052004190621052006210621072308230823082307220722","062004190621052006210622072308230823092408230722","062104190520042005210521072207230723082307220721","052004180520052005210521072307230723082307220722","052004190621052005210621072307230823082307220722","062004190621052006210622072308230823092408230722","062104190520042005210521072207230722082307220721","052004180520042005210521072307230723082307220722","052004190621052005210621072307230823082307220722","062004190621052006210622072308230823082408230722","062104190520042005200521072207230722082307220721","052004180520042005210521072207230723082307220722","052004190621052005210621072307230823082307220722","062004190621052006210622072308230823082408220722","062004190520041905200521072207230722082307220721","052003180520042005210521072207230723082307220722","052004190521052005210621072307230823082307220722","052004190621052006210621072308230823082408220722","062004190520041905200521062207220722082307220721","052003180520042005210521072207230723082307220721","052004190520052005210621072307230723082307220722","052004190621052006210621072308230823082408220722","062004190520041905200521062207220722082307220621","052003180520042005210521072207230723082307220721","052004180520052005210521072307230723082307220722","052004190621052006210621072308230823082307220722","062004190520041905200521062207220722082307220621","052003180520042005210521072207230723082307220721","052004180520052005210521072307230723082307220722","052004190621052006210621072308230823082307220722","062004190520041905200521062207220722082307220621","052003180520042005210521072207230723082307220721","052004180520052005210521072307230723082307220722","052004190621052005210621072307230823082307220722","062004190520041905200521062207220722082307220621","052003180520042005210521072207230723082307220721","052004180520052005210521072307230723082307220722","052004190621052005210621072307230823082307220722","062004190520041905200521062207220722082307220621","052003180520042005200521072207230722082307220721","052004180520042005210521072307230723082307220722","052004190621052005210621072307230823082307220722","062004190520041905200521062207220722072307220621","052003180520041905200521072207230722082307220721","052004180520042005210521072207230723082307220722","052004190621052005210621072307230823082307220722","062004190520041905200520062207220722072307210621","051903180520041905200521062207220722082307220721","052003180520042005210521072207230723082307220722","052004190520052005210621072307230723082307220722","052004190520041905200520062207220722072307210621","051903180520041905200521062207220722082307220721","052003180520042005210521072207230723082307220722","052004190520052005210521072307230723082307220722","052004190520041905200520062207220722072307210621","051903180520041905200521062207220722082307220621","052003180520042005210521072207230723082307220721","052004190520052005210521072307230723082307220722","052004190520041905200520062207220722072206210621","051903180520041905200521062207220722082307220621","052003180520042005210521072207230723082307220721","052004180520052005210521072307230723082307220722","052004190520041905200520062207220722072206210621","051903180520041905200521062207220722082307220621","052003180520042005210521072207230723082307220721","052004180520052005210521072307230723082307220722","052004190520041904200520062206220722072206210621","051903180520041905200521062207220722082307220621","052003180520042005200521072207230722082307220721","052004180520052005210521072307230723082307220722","052004190520041904200520062206220722072206210621","051903180520041905200521062207220722072307220621","052003180520042005200521072207230722082307220721","052004180520042005210521072207230723082307220722","052004190520041904200520062206220722072206210621","051903180520041905200521062207220722072307220621","052003180520041905200521062207230722082307220721","052004180520042005210521072207230723082307220722","052004190520041904200520062206220722072206210621","051903180520041905200520062207220722072307210621","052003180520041905200521062207220722082307220721","052003180520042005210521072207230723082307220722","052004190419041904200520062206220622072206210621","041903180520041905200520062207220722072307210621","051903180520041905200521062207220722082307220721","052003180520042005210521072207230723082307220722","052004190419041904200420062206220622072206210621","041903180520041905200520062207220722072307210621","051903180520041905200521062207220722082307220621","052003180520042005210521072207230723082307220721","052004190419041904200420062206220622072206210621","041903180520041905200520062207220722072206210621","051903180520041905200521062207220722082307220621","052003180520042005210521072207230723082307220721","052004180419041904200420062206220622072206210621","041903180520041905200520062206220722072206210621","051903180520041905200521062207220722082307220621","052003180520042005210521072207230723082307220721","052004180520052005210521072307230723082307220722"],_={"1.1":"\u6625\u8282","1.15":"\u5143\u5BB5\u8282","2.2":"\u9F99\u62AC\u5934","3.3":"\u4E0A\u5DF3\u8282","5.5":"\u7AEF\u5348\u8282","7.7":"\u4E03\u5915\u8282","7.15":"\u4E2D\u5143\u8282","8.15":"\u4E2D\u79CB\u8282","9.9":"\u91CD\u9633\u8282","10.1":"\u5BD2\u8863\u8282","10.15":"\u4E0B\u5143\u8282","12.8":"\u814A\u516B\u8282","12.23":"\u5317\u65B9\u5C0F\u5E74","12.24":"\u5357\u65B9\u5C0F\u5E74","12.30":"\u9664\u5915"},b0={"1.1":"\u5143\u65E6","2.14":"\u60C5\u4EBA\u8282","3.8":"\u5987\u5973\u8282","3.12":"\u690D\u6811\u8282","4.1":"\u611A\u4EBA\u8282","5.1":"\u52B3\u52A8\u8282","5.4":"\u9752\u5E74\u8282","5.12":"\u62A4\u58EB\u8282","6.1":"\u513F\u7AE5\u8282","7.1":"\u5EFA\u515A\u8282","8.1":"\u5EFA\u519B\u8282","9.10":"\u6559\u5E08\u8282","10.1":"\u56FD\u5E86\u8282","12.24":"\u5E73\u5B89\u591C","12.25":"\u5723\u8BDE\u8282"},I=(0,i0.join)(process.env.HOME||process.env.LOCALAPPDATA,".festivals.json");var U=N(require("fs"));var p0={};if(U.default.existsSync(I))try{p0=JSON.parse(U.default.readFileSync(I))}catch{}function j(e=1901,r=0,t=1){var a=Date.UTC(1900,0,31),n=Date.UTC(e,r,t),l=(n-a)/(24*60*60*1e3)+1,i,d,o={short:"",solarTerms:"",festival:"",lunarFestival:""},h=d0[e-1900],m=`${e}.${r+1}.${t}`;if(e<1901||e>2100)return o;for(let c=1900;c<=2100;c++){let u=V0(c);if(l-=u,l<=0){o.year=c,l+=u;break}}i=g0(o.year),d=K(o.year);for(let c=0;c0&&c>=d&&(o.leap=c===d,o.month-=1);break}if(o.custom=p0[m]||"",h){let c=h.slice(r*4,(r+1)*4);+c.slice(0,2)===t?o.solarTerms=H[r*2]:+c.slice(2)===t&&(o.solarTerms=H[r*2+1])}return o.festival=b0[`${r+1}.${t}`]||"",o.leap||(o.month===11&&o.day===i.pop()?(o.festival=_["12.30"],o.lunarFestival=_["12.30"]):(o.festival=_[`${o.month+1}.${o.day}`]||o.festival,o.lunarFestival=_[`${o.month+1}.${o.day}`]||"")),o.yearCN=W(o.year),o.monthCN=(o.leap>0?"\u95F0":"")+c0[o.month]+"\u6708",o.day<11?o.dayCN=T[0]+T[o.day]:o.day<20?o.dayCN=T[10]+T[o.day-10]:o.day===20?o.dayCN=T[2]+T[10]:o.day<30?o.dayCN=T[20]+T[o.day-20]:o.day===30&&(o.dayCN=T[3]+T[10]),o.short=o.festival?o.festival:o.solarTerms?o.solarTerms:o.day===1?o.monthCN:o.dayCN,o}function V0(e){var r=g0(e);return r.reduce((t,a)=>t+=a,0)}function K(e){var r=D[e-1900];return r&15}function G0(e){var r=D[e-1900],t=K(e);return t>0?r&983040?30:29:0}function g0(e){var r=D[e-1900],t=K(e),a=G0(e),n=[];for(let l=32768;l>8;l>>=1)n.push(r&l?30:29);return t>0&&n.splice(t,0,a),n}function W(e){var r=(e-3)%10,t=(e-3)%12;return r=r===0?10:r,t=t===0?12:t,u0[r-1]+f0[t-1]+x0[(e-4)%12]+"\u5E74"}var H0=["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"].map((e,r)=>(e="\u661F\u671F"+e,(r===0||r===6)&&(e=s.red(e))," "+e+" "+s.grey("\u2502"))),B=s.grey("\u2502"),U0=s.grey("\u251C"),K0=s.grey("\u2514"),p2=s.grey("\u2502"+(" ".repeat(10)+"\u2502").repeat(7));function y0(){var e=new Date;return[e.getFullYear(),e.getMonth()]}function h0(e,r){return new Date(e,r+1,0).getDate()}function m0(e,r,t){return new Date(e,r,t||1).getDay()}function W0({year:e,month:r,day:t},a){return a.year===e&&a.month===r&&a.day===t}function J0(){var e=new Date;return{year:e.getFullYear(),month:e.getMonth(),day:e.getDate()}}function Z0(e,r){var t=h0(e,r-1),a=h0(e,r),n=1-m0(e,r),l=0,i=J0(),d=[],o,h,m,c;n<1&&(o=e,h=r-1,h<0&&(h=11,o--));for(let u=n;u<=a;u++){let A={day:u<1?t- -u:(u+"").padStart(2,"0")},E;if(u>0){let Z=m0(e,r,u);E=j(e,r,u),A.weekend=Z===0||Z===6,A.picked=!!W0({year:e,month:r,day:u},i),A.highlight=!!E.festival||!!E.solarTerms}else E=j(o,h,t+u),A.grey=1;A.lunar=E.short,A.custom=E.custom,d.push(A)}l=42-d.length,l>0&&(m=e,c=r+1,c>11&&(c=0,m++));for(let u=1;u<=l;u++){let A=j(m,c,u);d.push({day:(u+"").padStart(2,"0"),lunar:A.short,custom:A.custom,grey:1})}return d}function q0(e,r){var t=`${e}\u5E74${r+1}\u6708${" ".repeat(10)}${W(e,r)}`;t=s.grey("\u2502 ")+s.cyan(t)+" ".repeat(71-t.length-2)+s.grey("\u2502"),console.log(s.grey("\u250C\u2500"+"\u2500".repeat(75)+"\u2510")),console.log(s.grey("\u2502"+" ".repeat(76)+"\u2502")),console.log(t),console.log(s.grey("\u2502"+" ".repeat(76)+"\u2502")),console.log(s.grey("\u251C"+"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C".repeat(7).slice(0,-1)+"\u2524")),console.log(s.grey("\u2502")+H0.join("")),console.log(s.grey("\u251C"+"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C".repeat(7).slice(0,-1)+"\u2524"))}function z0(e,r){var t=Z0(e,r),a=0,n=3*Math.ceil(t.length/7);for(let l=0;l=0?c=" ".repeat(m):u=u.slice(0,m),o.picked?i+=u+s.bgBlue.white(c+o.lunar+c)+u+B:(o.lunar&&(o.lunar=o.highlight?s.cyan(o.lunar):o.weekend?s.redBright(o.lunar):s.grey(o.lunar)),i+=" ".repeat(m+2)+o.lunar+" ".repeat(m+2)+B);break}}i&&console.log(i)}}function O(e,r){q0(e,r),z0(e,r)}var T0="1.2.7",C=process.argv.slice(2),F=C.shift(),[g,p]=y0();function J(e){for(let r=0;r<12;r++)O(e,r),r<11&&console.log("")}function b(...e){e[0]=e[0].padEnd(20," "),e.length>1&&e.splice(1,0," - "),console.log.apply(null,e)}function Q0(){b("=".repeat(64)),b(`\u7EC8\u7AEF\u7248\u4E07\u5E74\u5386 v${T0}, \u4F5C\u8005: \u5B87\u5929`),b("=".repeat(64)),b("\u7528\u6CD5: cal [command] args..."),b("Commands:"),b(" -y {year}","\u6253\u5370\u6307\u5B9A\u5E74\u4EFD\u7684\u65E5\u5386"),b(" -m","\u6253\u5370\u6307\u5B9A\u6708\u4EFD\u7684\u65E5\u5386"),b(" -c","\u5BFC\u5165\u81EA\u5B9A\u4E49\u4F11\u5047\u65E5, \u5FC5\u987B\u662F\u6807\u51C6json\u683C\u5F0F, \u8BED\u6CD5\u770B\u4E0B\u9762\u7684\u793A\u4F8B"),b(" -h","\u67E5\u770B\u5E2E\u52A9\u6587\u6863"),b(" -v",`\u67E5\u770B\u7A0B\u5E8F\u7684\u7248\u672C +`),b("\u793A\u4F8B: "),b(" cal "+s.grey("# \u4E0D\u5E26\u53C2\u6570\u6253\u5370\u5F53\u524D\u5E74\u6708")),b(" cal -y "+s.grey("# -y \u4E0D\u63A5\u53C2\u6570, \u6253\u5370\u5F53\u524D\u5E74\u7684\u6240\u6709\u6708\u4EFD")),b(" cal -y 2000 "+s.grey("# \u6253\u5370\u6307\u5B9A\u5E74\u4EFD\u7684\u6240\u6709\u6708\u4EFD")),b(" cal -y 2021 5 "+s.grey("# \u6253\u5370\u6307\u5B9A\u5E74\u4EFD, \u6307\u5B9A\u6708\u4EFD")),b(" cal -y 2000 -m 3 "+s.grey("# \u540C\u4E0A")),b(" cal -m 5 "+s.grey("# \u6253\u5370\u5F53\u524D\u5E74\u4EFD\u7684 \u6307\u5B9A\u6708\u4EFD")),b(' cal -c {"2021.12.11":"\u73ED","2021.12.12":"\u4F11"} '+s.grey("# \u5BFC\u5165\u81EA\u5B9A\u4E49\u4F11\u5047\u65E5")),process.exit()}switch(F){case"-y":switch(C.length){case 0:J(g);break;case 1:case 2:g=+C.shift(),p=+C.shift(),g===g?p<13&&p>0?O(g,p-1):J(g):console.log("-y \u53C2\u6570\u5F02\u5E38");break;case 3:g=+C.shift(),F=C.shift(),p=+C.pop(),F==="-m"&&p<13&&p>0?O(g,p-1):console.log("-m \u53C2\u6570\u5F02\u5E38");break;default:console.log("-y \u53C2\u6570\u5F02\u5E38");break}break;case"-m":p=+C.shift(),p<13&&p>0?O(g,p-1):console.log("-m \u53C2\u6570\u5F02\u5E38");break;case"-v":b(T0);break;case"-h":Q0();break;case"-c":let e=C.shift();if(e)try{JSON.parse(e),v0.default.writeFileSync(I,e),console.log("\u5BFC\u5165\u6210\u529F")}catch{console.log("\u9519\u8BEF\u7684json\u6570\u636E")}else console.log("\u5BFC\u5165\u7684\u6570\u636E\u4E3A\u7A7A");break;default:F?(g=+F,p=+C.shift(),g===g?p<13&&p>0?O(g,p-1):J(g):console.log("\u53C2\u6570\u5F02\u5E38")):O(g,p);break}process.exit(); diff --git a/package.json b/package.json index 1b20d68..5fb5907 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "bash-calendar", "description": "终端版万年历", - "version": "1.2.6", + "version": "1.2.7", "author": "yutent ", "bin": { "calendar": "index.js", diff --git a/src/calendar.js b/src/calendar.js index ebcc1e9..c0cb64e 100644 --- a/src/calendar.js +++ b/src/calendar.js @@ -92,8 +92,9 @@ export function getCalendarTable(year, month) { list.push(tmp) } - nd = list.length % 7 - nd = nd > 0 ? 7 - nd : 0 + // nd = list.length % 7 + // nd = nd > 0 ? 7 - nd : 0 + nd = 42 - list.length // 统一补够6行 // 修正年月日的数值, 以匹配节假日 if (nd > 0) { @@ -140,7 +141,7 @@ function drawThead(year, month) { function drawTbody(year, month) { var table = getCalendarTable(year, month) var line = 0 - var maxi = 3 * Math.ceil(table.length / 7) + var maxi = 3 * Math.ceil(table.length / 7) // 每个单元格占3行, 所以要 * 3 // i 是 纵坐标, j是横坐标格子 for (let i = 0; i < maxi + 1; i++) {