@jam-comments/server-utilities 0.0.4 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,36 +1,2 @@
1
- var jn=Object.defineProperty,En=Object.defineProperties;var Pn=Object.getOwnPropertyDescriptors;var Te=Object.getOwnPropertySymbols;var Bn=Object.prototype.hasOwnProperty,Sn=Object.prototype.propertyIsEnumerable;var De=(m,b,v)=>b in m?jn(m,b,{enumerable:!0,configurable:!0,writable:!0,value:v}):m[b]=v,Ge=(m,b)=>{for(var v in b||(b={}))Bn.call(b,v)&&De(m,v,b[v]);if(Te)for(var v of Te(b))Sn.call(b,v)&&De(m,v,b[v]);return m},We=(m,b)=>En(m,Pn(b));(function(m,b){typeof exports=="object"&&typeof module<"u"?b(exports):typeof define=="function"&&define.amd?define(["exports"],b):(m=typeof globalThis<"u"?globalThis:m||self,b(m.JamComments={}))})(this,function(m){"use strict";var b=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},v={exports:{}},Ve={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]};const E=Ve,se={};for(const e of Object.keys(E))se[E[e]]=e;const f={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"]}};var le=f;for(const e of Object.keys(f)){if(!("channels"in f[e]))throw new Error("missing channels property: "+e);if(!("labels"in f[e]))throw new Error("missing channel labels property: "+e);if(f[e].labels.length!==f[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:r}=f[e];delete f[e].channels,delete f[e].labels,Object.defineProperty(f[e],"channels",{value:t}),Object.defineProperty(f[e],"labels",{value:r})}f.rgb.hsl=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.min(t,r,n),s=Math.max(t,r,n),l=s-o;let i,a;s===o?i=0:t===s?i=(r-n)/l:r===s?i=2+(n-t)/l:n===s&&(i=4+(t-r)/l),i=Math.min(i*60,360),i<0&&(i+=360);const u=(o+s)/2;return s===o?a=0:u<=.5?a=l/(s+o):a=l/(2-s-o),[i,a*100,u*100]},f.rgb.hsv=function(e){let t,r,n,o,s;const l=e[0]/255,i=e[1]/255,a=e[2]/255,u=Math.max(l,i,a),h=u-Math.min(l,i,a),c=function(d){return(u-d)/6/h+1/2};return h===0?(o=0,s=0):(s=h/u,t=c(l),r=c(i),n=c(a),l===u?o=n-r:i===u?o=1/3+t-n:a===u&&(o=2/3+r-t),o<0?o+=1:o>1&&(o-=1)),[o*360,s*100,u*100]},f.rgb.hwb=function(e){const t=e[0],r=e[1];let n=e[2];const o=f.rgb.hsl(e)[0],s=1/255*Math.min(t,Math.min(r,n));return n=1-1/255*Math.max(t,Math.max(r,n)),[o,s*100,n*100]},f.rgb.cmyk=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.min(1-t,1-r,1-n),s=(1-t-o)/(1-o)||0,l=(1-r-o)/(1-o)||0,i=(1-n-o)/(1-o)||0;return[s*100,l*100,i*100,o*100]};function Je(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}f.rgb.keyword=function(e){const t=se[e];if(t)return t;let r=1/0,n;for(const o of Object.keys(E)){const s=E[o],l=Je(e,s);l<r&&(r=l,n=o)}return n},f.keyword.rgb=function(e){return E[e]},f.rgb.xyz=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;const o=t*.4124+r*.3576+n*.1805,s=t*.2126+r*.7152+n*.0722,l=t*.0193+r*.1192+n*.9505;return[o*100,s*100,l*100]},f.rgb.lab=function(e){const t=f.rgb.xyz(e);let r=t[0],n=t[1],o=t[2];r/=95.047,n/=100,o/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;const s=116*n-16,l=500*(r-n),i=200*(n-o);return[s,l,i]},f.hsl.rgb=function(e){const t=e[0]/360,r=e[1]/100,n=e[2]/100;let o,s,l;if(r===0)return l=n*255,[l,l,l];n<.5?o=n*(1+r):o=n+r-n*r;const i=2*n-o,a=[0,0,0];for(let u=0;u<3;u++)s=t+1/3*-(u-1),s<0&&s++,s>1&&s--,6*s<1?l=i+(o-i)*6*s:2*s<1?l=o:3*s<2?l=i+(o-i)*(2/3-s)*6:l=i,a[u]=l*255;return a},f.hsl.hsv=function(e){const t=e[0];let r=e[1]/100,n=e[2]/100,o=r;const s=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,o*=s<=1?s:2-s;const l=(n+r)/2,i=n===0?2*o/(s+o):2*r/(n+r);return[t,i*100,l*100]},f.hsv.rgb=function(e){const t=e[0]/60,r=e[1]/100;let n=e[2]/100;const o=Math.floor(t)%6,s=t-Math.floor(t),l=255*n*(1-r),i=255*n*(1-r*s),a=255*n*(1-r*(1-s));switch(n*=255,o){case 0:return[n,a,l];case 1:return[i,n,l];case 2:return[l,n,a];case 3:return[l,i,n];case 4:return[a,l,n];case 5:return[n,l,i]}},f.hsv.hsl=function(e){const t=e[0],r=e[1]/100,n=e[2]/100,o=Math.max(n,.01);let s,l;l=(2-r)*n;const i=(2-r)*o;return s=r*o,s/=i<=1?i:2-i,s=s||0,l/=2,[t,s*100,l*100]},f.hwb.rgb=function(e){const t=e[0]/360;let r=e[1]/100,n=e[2]/100;const o=r+n;let s;o>1&&(r/=o,n/=o);const l=Math.floor(6*t),i=1-n;s=6*t-l,(l&1)!==0&&(s=1-s);const a=r+s*(i-r);let u,h,c;switch(l){default:case 6:case 0:u=i,h=a,c=r;break;case 1:u=a,h=i,c=r;break;case 2:u=r,h=i,c=a;break;case 3:u=r,h=a,c=i;break;case 4:u=a,h=r,c=i;break;case 5:u=i,h=r,c=a;break}return[u*255,h*255,c*255]},f.cmyk.rgb=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100,o=e[3]/100,s=1-Math.min(1,t*(1-o)+o),l=1-Math.min(1,r*(1-o)+o),i=1-Math.min(1,n*(1-o)+o);return[s*255,l*255,i*255]},f.xyz.rgb=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100;let o,s,l;return o=t*3.2406+r*-1.5372+n*-.4986,s=t*-.9689+r*1.8758+n*.0415,l=t*.0557+r*-.204+n*1.057,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),l=Math.min(Math.max(0,l),1),[o*255,s*255,l*255]},f.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];t/=95.047,r/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;const o=116*r-16,s=500*(t-r),l=200*(r-n);return[o,s,l]},f.lab.xyz=function(e){const t=e[0],r=e[1],n=e[2];let o,s,l;s=(t+16)/116,o=r/500+s,l=s-n/200;const i=s**3,a=o**3,u=l**3;return s=i>.008856?i:(s-16/116)/7.787,o=a>.008856?a:(o-16/116)/7.787,l=u>.008856?u:(l-16/116)/7.787,o*=95.047,s*=100,l*=108.883,[o,s,l]},f.lab.lch=function(e){const t=e[0],r=e[1],n=e[2];let o;o=Math.atan2(n,r)*360/2/Math.PI,o<0&&(o+=360);const l=Math.sqrt(r*r+n*n);return[t,l,o]},f.lch.lab=function(e){const t=e[0],r=e[1],o=e[2]/360*2*Math.PI,s=r*Math.cos(o),l=r*Math.sin(o);return[t,s,l]},f.rgb.ansi16=function(e,t=null){const[r,n,o]=e;let s=t===null?f.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),s===0)return 30;let l=30+(Math.round(o/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return s===2&&(l+=60),l},f.hsv.ansi16=function(e){return f.rgb.ansi16(f.hsv.rgb(e),e[2])},f.rgb.ansi256=function(e){const t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},f.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const r=(~~(e>50)+1)*.5,n=(t&1)*r*255,o=(t>>1&1)*r*255,s=(t>>2&1)*r*255;return[n,o,s]},f.ansi256.rgb=function(e){if(e>=232){const s=(e-232)*10+8;return[s,s,s]}e-=16;let t;const r=Math.floor(e/36)/5*255,n=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[r,n,o]},f.rgb.hex=function(e){const r=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r},f.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];t[0].length===3&&(r=r.split("").map(i=>i+i).join(""));const n=parseInt(r,16),o=n>>16&255,s=n>>8&255,l=n&255;return[o,s,l]},f.rgb.hcg=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.max(Math.max(t,r),n),s=Math.min(Math.min(t,r),n),l=o-s;let i,a;return l<1?i=s/(1-l):i=0,l<=0?a=0:o===t?a=(r-n)/l%6:o===r?a=2+(n-t)/l:a=4+(t-r)/l,a/=6,a%=1,[a*360,l*100,i*100]},f.hsl.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r);let o=0;return n<1&&(o=(r-.5*n)/(1-n)),[e[0],n*100,o*100]},f.hsv.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=t*r;let o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],n*100,o*100]},f.hcg.rgb=function(e){const t=e[0]/360,r=e[1]/100,n=e[2]/100;if(r===0)return[n*255,n*255,n*255];const o=[0,0,0],s=t%1*6,l=s%1,i=1-l;let a=0;switch(Math.floor(s)){case 0:o[0]=1,o[1]=l,o[2]=0;break;case 1:o[0]=i,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=l;break;case 3:o[0]=0,o[1]=i,o[2]=1;break;case 4:o[0]=l,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=i}return a=(1-r)*n,[(r*o[0]+a)*255,(r*o[1]+a)*255,(r*o[2]+a)*255]},f.hcg.hsv=function(e){const t=e[1]/100,r=e[2]/100,n=t+r*(1-t);let o=0;return n>0&&(o=t/n),[e[0],o*100,n*100]},f.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let o=0;return n>0&&n<.5?o=t/(2*n):n>=.5&&n<1&&(o=t/(2*(1-n))),[e[0],o*100,n*100]},f.hcg.hwb=function(e){const t=e[1]/100,r=e[2]/100,n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]},f.hwb.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=1-r,o=n-t;let s=0;return o<1&&(s=(n-o)/(1-o)),[e[0],o*100,s*100]},f.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},f.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},f.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},f.gray.hsl=function(e){return[0,0,e[0]]},f.gray.hsv=f.gray.hsl,f.gray.hwb=function(e){return[0,100,e[0]]},f.gray.cmyk=function(e){return[0,0,0,e[0]]},f.gray.lab=function(e){return[e[0],0,0]},f.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},f.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const q=le;function Xe(){const e={},t=Object.keys(q);for(let r=t.length,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}function Ke(e){const t=Xe(),r=[e];for(t[e].distance=0;r.length;){const n=r.pop(),o=Object.keys(q[n]);for(let s=o.length,l=0;l<s;l++){const i=o[l],a=t[i];a.distance===-1&&(a.distance=t[n].distance+1,a.parent=n,r.unshift(i))}}return t}function Ye(e,t){return function(r){return t(e(r))}}function He(e,t){const r=[t[e].parent,e];let n=q[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)r.unshift(t[o].parent),n=Ye(q[t[o].parent][o],n),o=t[o].parent;return n.conversion=r,n}var Qe=function(e){const t=Ke(e),r={},n=Object.keys(t);for(let o=n.length,s=0;s<o;s++){const l=n[s];t[l].parent!==null&&(r[l]=He(l,t))}return r};const G=le,Ze=Qe,x={},et=Object.keys(G);function tt(e){const t=function(...r){const n=r[0];return n==null?n:(n.length>1&&(r=n),e(r))};return"conversion"in e&&(t.conversion=e.conversion),t}function nt(e){const t=function(...r){const n=r[0];if(n==null)return n;n.length>1&&(r=n);const o=e(r);if(typeof o=="object")for(let s=o.length,l=0;l<s;l++)o[l]=Math.round(o[l]);return o};return"conversion"in e&&(t.conversion=e.conversion),t}et.forEach(e=>{x[e]={},Object.defineProperty(x[e],"channels",{value:G[e].channels}),Object.defineProperty(x[e],"labels",{value:G[e].labels});const t=Ze(e);Object.keys(t).forEach(n=>{const o=t[n];x[e][n]=nt(o),x[e][n].raw=tt(o)})});var rt=x;(function(e){const t=(h,c)=>(...d)=>`\x1B[${h(...d)+c}m`,r=(h,c)=>(...d)=>{const g=h(...d);return`\x1B[${38+c};5;${g}m`},n=(h,c)=>(...d)=>{const g=h(...d);return`\x1B[${38+c};2;${g[0]};${g[1]};${g[2]}m`},o=h=>h,s=(h,c,d)=>[h,c,d],l=(h,c,d)=>{Object.defineProperty(h,c,{get:()=>{const g=d();return Object.defineProperty(h,c,{value:g,enumerable:!0,configurable:!0}),g},enumerable:!0,configurable:!0})};let i;const a=(h,c,d,g)=>{i===void 0&&(i=rt);const w=g?10:0,y={};for(const[$,_]of Object.entries(i)){const A=$==="ansi16"?"ansi":$;$===c?y[A]=h(d,w):typeof _=="object"&&(y[A]=h(_[c],w))}return y};function u(){const h=new Map,c={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],blackBright:[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]}};c.color.gray=c.color.blackBright,c.bgColor.bgGray=c.bgColor.bgBlackBright,c.color.grey=c.color.blackBright,c.bgColor.bgGrey=c.bgColor.bgBlackBright;for(const[d,g]of Object.entries(c)){for(const[w,y]of Object.entries(g))c[w]={open:`\x1B[${y[0]}m`,close:`\x1B[${y[1]}m`},g[w]=c[w],h.set(y[0],y[1]);Object.defineProperty(c,d,{value:g,enumerable:!1})}return Object.defineProperty(c,"codes",{value:h,enumerable:!1}),c.color.close="\x1B[39m",c.bgColor.close="\x1B[49m",l(c.color,"ansi",()=>a(t,"ansi16",o,!1)),l(c.color,"ansi256",()=>a(r,"ansi256",o,!1)),l(c.color,"ansi16m",()=>a(n,"rgb",s,!1)),l(c.bgColor,"ansi",()=>a(t,"ansi16",o,!0)),l(c.bgColor,"ansi256",()=>a(r,"ansi256",o,!0)),l(c.bgColor,"ansi16m",()=>a(n,"rgb",s,!0)),c}Object.defineProperty(e,"exports",{enumerable:!0,get:u})})(v);var ot={stdout:!1,stderr:!1},st={stringReplaceAll:(e,t,r)=>{let n=e.indexOf(t);if(n===-1)return e;const o=t.length;let s=0,l="";do l+=e.substr(s,n-s)+t+r,s=n+o,n=e.indexOf(t,s);while(n!==-1);return l+=e.substr(s),l},stringEncaseCRLFWithFirstIndex:(e,t,r,n)=>{let o=0,s="";do{const l=e[n-1]==="\r";s+=e.substr(o,(l?n-1:n)-o)+t+(l?`\r
2
- `:`
3
- `)+r,o=n+1,n=e.indexOf(`
4
- `,o)}while(n!==-1);return s+=e.substr(o),s}};const lt=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,ie=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,it=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,ct=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,at=new Map([["n",`
5
- `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function ce(e){const t=e[0]==="u",r=e[1]==="{";return t&&!r&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(parseInt(e.slice(2,-1),16)):at.get(e)||e}function ut(e,t){const r=[],n=t.trim().split(/\s*,\s*/g);let o;for(const s of n){const l=Number(s);if(!Number.isNaN(l))r.push(l);else if(o=s.match(it))r.push(o[2].replace(ct,(i,a,u)=>a?ce(a):u));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${e}')`)}return r}function ht(e){ie.lastIndex=0;const t=[];let r;for(;(r=ie.exec(e))!==null;){const n=r[1];if(r[2]){const o=ut(n,r[2]);t.push([n].concat(o))}else t.push([n])}return t}function ae(e,t){const r={};for(const o of t)for(const s of o.styles)r[s[0]]=o.inverse?null:s.slice(1);let n=e;for(const[o,s]of Object.entries(r))if(!!Array.isArray(s)){if(!(o in n))throw new Error(`Unknown Chalk style: ${o}`);n=s.length>0?n[o](...s):n[o]}return n}var ft=(e,t)=>{const r=[],n=[];let o=[];if(t.replace(lt,(s,l,i,a,u,h)=>{if(l)o.push(ce(l));else if(a){const c=o.join("");o=[],n.push(r.length===0?c:ae(e,r)(c)),r.push({inverse:i,styles:ht(a)})}else if(u){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(ae(e,r)(o.join(""))),o=[],r.pop()}else o.push(h)}),n.push(o.join("")),r.length>0){const s=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(s)}return n.join("")};const P=v.exports,{stdout:W,stderr:V}=ot,{stringReplaceAll:pt,stringEncaseCRLFWithFirstIndex:dt}=st,{isArray:I}=Array,ue=["ansi","ansi","ansi256","ansi16m"],O=Object.create(null),gt=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const r=W?W.level:0;e.level=t.level===void 0?r:t.level};class mt{constructor(t){return he(t)}}const he=e=>{const t={};return gt(t,e),t.template=(...r)=>de(t.template,...r),Object.setPrototypeOf(t,R.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=mt,t.template};function R(e){return he(e)}for(const[e,t]of Object.entries(P))O[e]={get(){const r=F(this,J(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:r}),r}};O.visible={get(){const e=F(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};const fe=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const e of fe)O[e]={get(){const{level:t}=this;return function(...r){const n=J(P.color[ue[t]][e](...r),P.color.close,this._styler);return F(this,n,this._isEmpty)}}};for(const e of fe){const t="bg"+e[0].toUpperCase()+e.slice(1);O[t]={get(){const{level:r}=this;return function(...n){const o=J(P.bgColor[ue[r]][e](...n),P.bgColor.close,this._styler);return F(this,o,this._isEmpty)}}}}const bt=Object.defineProperties(()=>{},We(Ge({},O),{level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}})),J=(e,t,r)=>{let n,o;return r===void 0?(n=e,o=t):(n=r.openAll+e,o=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:o,parent:r}},F=(e,t,r)=>{const n=(...o)=>I(o[0])&&I(o[0].raw)?pe(n,de(n,...o)):pe(n,o.length===1?""+o[0]:o.join(" "));return Object.setPrototypeOf(n,bt),n._generator=e,n._styler=t,n._isEmpty=r,n},pe=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let r=e._styler;if(r===void 0)return t;const{openAll:n,closeAll:o}=r;if(t.indexOf("\x1B")!==-1)for(;r!==void 0;)t=pt(t,r.close,r.open),r=r.parent;const s=t.indexOf(`
6
- `);return s!==-1&&(t=dt(t,o,n,s)),n+t+o};let X;const de=(e,...t)=>{const[r]=t;if(!I(r)||!I(r.raw))return t.join(" ");const n=t.slice(1),o=[r.raw[0]];for(let s=1;s<r.length;s++)o.push(String(n[s-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[s]));return X===void 0&&(X=ft),X(e,o.join(""))};Object.defineProperties(R.prototype,O);const N=R();N.supportsColor=W,N.stderr=R({level:V?V.level:0}),N.stderr.supportsColor=V;var yt=N,ge=e=>{console.log(`${yt.magenta("JamComments:")} ${e}`)},vt=Object.defineProperty,wt=Object.defineProperties,kt=Object.getOwnPropertyDescriptors,me=Object.getOwnPropertySymbols,Ct=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable,be=(e,t,r)=>t in e?vt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xt=(e,t)=>{for(var r in t||(t={}))Ct.call(t,r)&&be(e,r,t[r]);if(me)for(var r of me(t))$t.call(t,r)&&be(e,r,t[r]);return e},Ot=(e,t)=>wt(e,kt(t)),ye={exports:{}},Mt={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]};const B=Mt,ve={};for(const e of Object.keys(B))ve[B[e]]=e;const p={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"]}};var we=p;for(const e of Object.keys(p)){if(!("channels"in p[e]))throw new Error("missing channels property: "+e);if(!("labels"in p[e]))throw new Error("missing channel labels property: "+e);if(p[e].labels.length!==p[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:r}=p[e];delete p[e].channels,delete p[e].labels,Object.defineProperty(p[e],"channels",{value:t}),Object.defineProperty(p[e],"labels",{value:r})}p.rgb.hsl=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.min(t,r,n),s=Math.max(t,r,n),l=s-o;let i,a;s===o?i=0:t===s?i=(r-n)/l:r===s?i=2+(n-t)/l:n===s&&(i=4+(t-r)/l),i=Math.min(i*60,360),i<0&&(i+=360);const u=(o+s)/2;return s===o?a=0:u<=.5?a=l/(s+o):a=l/(2-s-o),[i,a*100,u*100]},p.rgb.hsv=function(e){let t,r,n,o,s;const l=e[0]/255,i=e[1]/255,a=e[2]/255,u=Math.max(l,i,a),h=u-Math.min(l,i,a),c=function(d){return(u-d)/6/h+1/2};return h===0?(o=0,s=0):(s=h/u,t=c(l),r=c(i),n=c(a),l===u?o=n-r:i===u?o=1/3+t-n:a===u&&(o=2/3+r-t),o<0?o+=1:o>1&&(o-=1)),[o*360,s*100,u*100]},p.rgb.hwb=function(e){const t=e[0],r=e[1];let n=e[2];const o=p.rgb.hsl(e)[0],s=1/255*Math.min(t,Math.min(r,n));return n=1-1/255*Math.max(t,Math.max(r,n)),[o,s*100,n*100]},p.rgb.cmyk=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.min(1-t,1-r,1-n),s=(1-t-o)/(1-o)||0,l=(1-r-o)/(1-o)||0,i=(1-n-o)/(1-o)||0;return[s*100,l*100,i*100,o*100]};function jt(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}p.rgb.keyword=function(e){const t=ve[e];if(t)return t;let r=1/0,n;for(const o of Object.keys(B)){const s=B[o],l=jt(e,s);l<r&&(r=l,n=o)}return n},p.keyword.rgb=function(e){return B[e]},p.rgb.xyz=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;const o=t*.4124+r*.3576+n*.1805,s=t*.2126+r*.7152+n*.0722,l=t*.0193+r*.1192+n*.9505;return[o*100,s*100,l*100]},p.rgb.lab=function(e){const t=p.rgb.xyz(e);let r=t[0],n=t[1],o=t[2];r/=95.047,n/=100,o/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;const s=116*n-16,l=500*(r-n),i=200*(n-o);return[s,l,i]},p.hsl.rgb=function(e){const t=e[0]/360,r=e[1]/100,n=e[2]/100;let o,s,l;if(r===0)return l=n*255,[l,l,l];n<.5?o=n*(1+r):o=n+r-n*r;const i=2*n-o,a=[0,0,0];for(let u=0;u<3;u++)s=t+1/3*-(u-1),s<0&&s++,s>1&&s--,6*s<1?l=i+(o-i)*6*s:2*s<1?l=o:3*s<2?l=i+(o-i)*(2/3-s)*6:l=i,a[u]=l*255;return a},p.hsl.hsv=function(e){const t=e[0];let r=e[1]/100,n=e[2]/100,o=r;const s=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,o*=s<=1?s:2-s;const l=(n+r)/2,i=n===0?2*o/(s+o):2*r/(n+r);return[t,i*100,l*100]},p.hsv.rgb=function(e){const t=e[0]/60,r=e[1]/100;let n=e[2]/100;const o=Math.floor(t)%6,s=t-Math.floor(t),l=255*n*(1-r),i=255*n*(1-r*s),a=255*n*(1-r*(1-s));switch(n*=255,o){case 0:return[n,a,l];case 1:return[i,n,l];case 2:return[l,n,a];case 3:return[l,i,n];case 4:return[a,l,n];case 5:return[n,l,i]}},p.hsv.hsl=function(e){const t=e[0],r=e[1]/100,n=e[2]/100,o=Math.max(n,.01);let s,l;l=(2-r)*n;const i=(2-r)*o;return s=r*o,s/=i<=1?i:2-i,s=s||0,l/=2,[t,s*100,l*100]},p.hwb.rgb=function(e){const t=e[0]/360;let r=e[1]/100,n=e[2]/100;const o=r+n;let s;o>1&&(r/=o,n/=o);const l=Math.floor(6*t),i=1-n;s=6*t-l,(l&1)!==0&&(s=1-s);const a=r+s*(i-r);let u,h,c;switch(l){default:case 6:case 0:u=i,h=a,c=r;break;case 1:u=a,h=i,c=r;break;case 2:u=r,h=i,c=a;break;case 3:u=r,h=a,c=i;break;case 4:u=a,h=r,c=i;break;case 5:u=i,h=r,c=a;break}return[u*255,h*255,c*255]},p.cmyk.rgb=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100,o=e[3]/100,s=1-Math.min(1,t*(1-o)+o),l=1-Math.min(1,r*(1-o)+o),i=1-Math.min(1,n*(1-o)+o);return[s*255,l*255,i*255]},p.xyz.rgb=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100;let o,s,l;return o=t*3.2406+r*-1.5372+n*-.4986,s=t*-.9689+r*1.8758+n*.0415,l=t*.0557+r*-.204+n*1.057,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),l=Math.min(Math.max(0,l),1),[o*255,s*255,l*255]},p.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];t/=95.047,r/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;const o=116*r-16,s=500*(t-r),l=200*(r-n);return[o,s,l]},p.lab.xyz=function(e){const t=e[0],r=e[1],n=e[2];let o,s,l;s=(t+16)/116,o=r/500+s,l=s-n/200;const i=s**3,a=o**3,u=l**3;return s=i>.008856?i:(s-16/116)/7.787,o=a>.008856?a:(o-16/116)/7.787,l=u>.008856?u:(l-16/116)/7.787,o*=95.047,s*=100,l*=108.883,[o,s,l]},p.lab.lch=function(e){const t=e[0],r=e[1],n=e[2];let o;o=Math.atan2(n,r)*360/2/Math.PI,o<0&&(o+=360);const l=Math.sqrt(r*r+n*n);return[t,l,o]},p.lch.lab=function(e){const t=e[0],r=e[1],o=e[2]/360*2*Math.PI,s=r*Math.cos(o),l=r*Math.sin(o);return[t,s,l]},p.rgb.ansi16=function(e,t=null){const[r,n,o]=e;let s=t===null?p.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),s===0)return 30;let l=30+(Math.round(o/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return s===2&&(l+=60),l},p.hsv.ansi16=function(e){return p.rgb.ansi16(p.hsv.rgb(e),e[2])},p.rgb.ansi256=function(e){const t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},p.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const r=(~~(e>50)+1)*.5,n=(t&1)*r*255,o=(t>>1&1)*r*255,s=(t>>2&1)*r*255;return[n,o,s]},p.ansi256.rgb=function(e){if(e>=232){const s=(e-232)*10+8;return[s,s,s]}e-=16;let t;const r=Math.floor(e/36)/5*255,n=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[r,n,o]},p.rgb.hex=function(e){const r=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r},p.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];t[0].length===3&&(r=r.split("").map(i=>i+i).join(""));const n=parseInt(r,16),o=n>>16&255,s=n>>8&255,l=n&255;return[o,s,l]},p.rgb.hcg=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.max(Math.max(t,r),n),s=Math.min(Math.min(t,r),n),l=o-s;let i,a;return l<1?i=s/(1-l):i=0,l<=0?a=0:o===t?a=(r-n)/l%6:o===r?a=2+(n-t)/l:a=4+(t-r)/l,a/=6,a%=1,[a*360,l*100,i*100]},p.hsl.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r);let o=0;return n<1&&(o=(r-.5*n)/(1-n)),[e[0],n*100,o*100]},p.hsv.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=t*r;let o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],n*100,o*100]},p.hcg.rgb=function(e){const t=e[0]/360,r=e[1]/100,n=e[2]/100;if(r===0)return[n*255,n*255,n*255];const o=[0,0,0],s=t%1*6,l=s%1,i=1-l;let a=0;switch(Math.floor(s)){case 0:o[0]=1,o[1]=l,o[2]=0;break;case 1:o[0]=i,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=l;break;case 3:o[0]=0,o[1]=i,o[2]=1;break;case 4:o[0]=l,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=i}return a=(1-r)*n,[(r*o[0]+a)*255,(r*o[1]+a)*255,(r*o[2]+a)*255]},p.hcg.hsv=function(e){const t=e[1]/100,r=e[2]/100,n=t+r*(1-t);let o=0;return n>0&&(o=t/n),[e[0],o*100,n*100]},p.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let o=0;return n>0&&n<.5?o=t/(2*n):n>=.5&&n<1&&(o=t/(2*(1-n))),[e[0],o*100,n*100]},p.hcg.hwb=function(e){const t=e[1]/100,r=e[2]/100,n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]},p.hwb.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=1-r,o=n-t;let s=0;return o<1&&(s=(n-o)/(1-o)),[e[0],o*100,s*100]},p.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},p.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},p.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},p.gray.hsl=function(e){return[0,0,e[0]]},p.gray.hsv=p.gray.hsl,p.gray.hwb=function(e){return[0,100,e[0]]},p.gray.cmyk=function(e){return[0,0,0,e[0]]},p.gray.lab=function(e){return[e[0],0,0]},p.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},p.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const L=we;function Et(){const e={},t=Object.keys(L);for(let r=t.length,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}function Pt(e){const t=Et(),r=[e];for(t[e].distance=0;r.length;){const n=r.pop(),o=Object.keys(L[n]);for(let s=o.length,l=0;l<s;l++){const i=o[l],a=t[i];a.distance===-1&&(a.distance=t[n].distance+1,a.parent=n,r.unshift(i))}}return t}function Bt(e,t){return function(r){return t(e(r))}}function St(e,t){const r=[t[e].parent,e];let n=L[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)r.unshift(t[o].parent),n=Bt(L[t[o].parent][o],n),o=t[o].parent;return n.conversion=r,n}var _t=function(e){const t=Pt(e),r={},n=Object.keys(t);for(let o=n.length,s=0;s<o;s++){const l=n[s];t[l].parent!==null&&(r[l]=St(l,t))}return r};const K=we,At=_t,M={},qt=Object.keys(K);function It(e){const t=function(...r){const n=r[0];return n==null?n:(n.length>1&&(r=n),e(r))};return"conversion"in e&&(t.conversion=e.conversion),t}function Rt(e){const t=function(...r){const n=r[0];if(n==null)return n;n.length>1&&(r=n);const o=e(r);if(typeof o=="object")for(let s=o.length,l=0;l<s;l++)o[l]=Math.round(o[l]);return o};return"conversion"in e&&(t.conversion=e.conversion),t}qt.forEach(e=>{M[e]={},Object.defineProperty(M[e],"channels",{value:K[e].channels}),Object.defineProperty(M[e],"labels",{value:K[e].labels});const t=At(e);Object.keys(t).forEach(n=>{const o=t[n];M[e][n]=Rt(o),M[e][n].raw=It(o)})});var Ft=M;(function(e){const t=(h,c)=>(...d)=>`\x1B[${h(...d)+c}m`,r=(h,c)=>(...d)=>{const g=h(...d);return`\x1B[${38+c};5;${g}m`},n=(h,c)=>(...d)=>{const g=h(...d);return`\x1B[${38+c};2;${g[0]};${g[1]};${g[2]}m`},o=h=>h,s=(h,c,d)=>[h,c,d],l=(h,c,d)=>{Object.defineProperty(h,c,{get:()=>{const g=d();return Object.defineProperty(h,c,{value:g,enumerable:!0,configurable:!0}),g},enumerable:!0,configurable:!0})};let i;const a=(h,c,d,g)=>{i===void 0&&(i=Ft);const w=g?10:0,y={};for(const[$,_]of Object.entries(i)){const A=$==="ansi16"?"ansi":$;$===c?y[A]=h(d,w):typeof _=="object"&&(y[A]=h(_[c],w))}return y};function u(){const h=new Map,c={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],blackBright:[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]}};c.color.gray=c.color.blackBright,c.bgColor.bgGray=c.bgColor.bgBlackBright,c.color.grey=c.color.blackBright,c.bgColor.bgGrey=c.bgColor.bgBlackBright;for(const[d,g]of Object.entries(c)){for(const[w,y]of Object.entries(g))c[w]={open:`\x1B[${y[0]}m`,close:`\x1B[${y[1]}m`},g[w]=c[w],h.set(y[0],y[1]);Object.defineProperty(c,d,{value:g,enumerable:!1})}return Object.defineProperty(c,"codes",{value:h,enumerable:!1}),c.color.close="\x1B[39m",c.bgColor.close="\x1B[49m",l(c.color,"ansi",()=>a(t,"ansi16",o,!1)),l(c.color,"ansi256",()=>a(r,"ansi256",o,!1)),l(c.color,"ansi16m",()=>a(n,"rgb",s,!1)),l(c.bgColor,"ansi",()=>a(t,"ansi16",o,!0)),l(c.bgColor,"ansi256",()=>a(r,"ansi256",o,!0)),l(c.bgColor,"ansi16m",()=>a(n,"rgb",s,!0)),c}Object.defineProperty(e,"exports",{enumerable:!0,get:u})})(ye);var Nt={stdout:!1,stderr:!1},Lt={stringReplaceAll:(e,t,r)=>{let n=e.indexOf(t);if(n===-1)return e;const o=t.length;let s=0,l="";do l+=e.substr(s,n-s)+t+r,s=n+o,n=e.indexOf(t,s);while(n!==-1);return l+=e.substr(s),l},stringEncaseCRLFWithFirstIndex:(e,t,r,n)=>{let o=0,s="";do{const l=e[n-1]==="\r";s+=e.substr(o,(l?n-1:n)-o)+t+(l?`\r
7
- `:`
8
- `)+r,o=n+1,n=e.indexOf(`
9
- `,o)}while(n!==-1);return s+=e.substr(o),s}};const Ut=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,ke=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,zt=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,Tt=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,Dt=new Map([["n",`
10
- `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function Ce(e){const t=e[0]==="u",r=e[1]==="{";return t&&!r&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(parseInt(e.slice(2,-1),16)):Dt.get(e)||e}function Gt(e,t){const r=[],n=t.trim().split(/\s*,\s*/g);let o;for(const s of n){const l=Number(s);if(!Number.isNaN(l))r.push(l);else if(o=s.match(zt))r.push(o[2].replace(Tt,(i,a,u)=>a?Ce(a):u));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${e}')`)}return r}function Wt(e){ke.lastIndex=0;const t=[];let r;for(;(r=ke.exec(e))!==null;){const n=r[1];if(r[2]){const o=Gt(n,r[2]);t.push([n].concat(o))}else t.push([n])}return t}function $e(e,t){const r={};for(const o of t)for(const s of o.styles)r[s[0]]=o.inverse?null:s.slice(1);let n=e;for(const[o,s]of Object.entries(r))if(!!Array.isArray(s)){if(!(o in n))throw new Error(`Unknown Chalk style: ${o}`);n=s.length>0?n[o](...s):n[o]}return n}var Vt=(e,t)=>{const r=[],n=[];let o=[];if(t.replace(Ut,(s,l,i,a,u,h)=>{if(l)o.push(Ce(l));else if(a){const c=o.join("");o=[],n.push(r.length===0?c:$e(e,r)(c)),r.push({inverse:i,styles:Wt(a)})}else if(u){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push($e(e,r)(o.join(""))),o=[],r.pop()}else o.push(h)}),n.push(o.join("")),r.length>0){const s=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(s)}return n.join("")};const S=ye.exports,{stdout:Y,stderr:H}=Nt,{stringReplaceAll:Jt,stringEncaseCRLFWithFirstIndex:Xt}=Lt,{isArray:U}=Array,xe=["ansi","ansi","ansi256","ansi16m"],j=Object.create(null),Kt=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const r=Y?Y.level:0;e.level=t.level===void 0?r:t.level};class Yt{constructor(t){return Oe(t)}}const Oe=e=>{const t={};return Kt(t,e),t.template=(...r)=>Ee(t.template,...r),Object.setPrototypeOf(t,z.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=Yt,t.template};function z(e){return Oe(e)}for(const[e,t]of Object.entries(S))j[e]={get(){const r=T(this,Q(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:r}),r}};j.visible={get(){const e=T(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};const Me=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const e of Me)j[e]={get(){const{level:t}=this;return function(...r){const n=Q(S.color[xe[t]][e](...r),S.color.close,this._styler);return T(this,n,this._isEmpty)}}};for(const e of Me){const t="bg"+e[0].toUpperCase()+e.slice(1);j[t]={get(){const{level:r}=this;return function(...n){const o=Q(S.bgColor[xe[r]][e](...n),S.bgColor.close,this._styler);return T(this,o,this._isEmpty)}}}}const Ht=Object.defineProperties(()=>{},Ot(xt({},j),{level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}})),Q=(e,t,r)=>{let n,o;return r===void 0?(n=e,o=t):(n=r.openAll+e,o=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:o,parent:r}},T=(e,t,r)=>{const n=(...o)=>U(o[0])&&U(o[0].raw)?je(n,Ee(n,...o)):je(n,o.length===1?""+o[0]:o.join(" "));return Object.setPrototypeOf(n,Ht),n._generator=e,n._styler=t,n._isEmpty=r,n},je=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let r=e._styler;if(r===void 0)return t;const{openAll:n,closeAll:o}=r;if(t.indexOf("\x1B")!==-1)for(;r!==void 0;)t=Jt(t,r.close,r.open),r=r.parent;const s=t.indexOf(`
11
- `);return s!==-1&&(t=Xt(t,o,n,s)),n+t+o};let Z;const Ee=(e,...t)=>{const[r]=t;if(!U(r)||!U(r.raw))return t.join(" ");const n=t.slice(1),o=[r.raw[0]];for(let s=1;s<r.length;s++)o.push(String(n[s-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[s]));return Z===void 0&&(Z=Vt),Z(e,o.join(""))};Object.defineProperties(z.prototype,j);const ee=z();ee.supportsColor=Y,ee.stderr=z({level:H?H.level:0}),ee.stderr.supportsColor=H;var Qt=()=>(typeof process<"u"&&process.env&&process.env.NODE_ENV&&process.env.NODE_ENV.toLowerCase())!=="production";const Zt="https://service.jamcomments.com",Pe="http://localhost:4000";var en=(e=null)=>typeof window<"u"&&window.jcForceLocal?Pe:e||(process.env.NODE_ENV==="production"?Zt:Pe),tn=Object.defineProperty,Be=Object.getOwnPropertySymbols,nn=Object.prototype.hasOwnProperty,rn=Object.prototype.propertyIsEnumerable,Se=(e,t,r)=>t in e?tn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,on=(e,t)=>{for(var r in t||(t={}))nn.call(t,r)&&Se(e,r,t[r]);if(Be)for(var r of Be(t))rn.call(t,r)&&Se(e,r,t[r]);return e};function sn(e,t){const r=new URL(e);for(const n in t)r.searchParams.append(n,t[n]);return r.toString()}async function ln({endpoint:e,fetchOptions:t,query:r,variables:n}){const o={query:r,variables:JSON.stringify(n)},{method:s="POST",headers:l={}}=t,i=/get/i.test(s),a=i?sn(e,o):e;try{const u=await fetch(a,{method:s.toUpperCase(),headers:on({"Content-Type":`application/${i?"x-www-form-urlencoded":"json"}`},l),body:i?null:JSON.stringify(o)}),{data:h,errors:c}=await u.json(),d={data:h};return c&&(d.errors=c),d}catch(u){return{errors:[u]}}}function cn({endpoint:e,method:t,headers:r}){return{send:async(o,s={})=>ln({endpoint:e,query:o,variables:s,fetchOptions:{method:t,headers:r}})}}var _e=[{id:"1",name:"Joanne King",emailAddress:"joanne@example.com",content:"<blockquote>This is some random quote.</blockquote><p>That's good stuff! Thanks for posting.</p>",path:null,createdAt:"1620462061499",status:"approved"},{id:"2",name:"Jennyfer Abbott",emailAddress:"jennyfer@example.com",content:`Animi voluptatem quae quas eius et error id. Ipsum amet corporis. Non corrupti eum et vel harum ut mollitia rerum laborum. Sunt est id et. Beatae nobis sit id qui ut ducimus sapiente placeat. Minus atque rerum natus et. Libero velit corporis. Blanditiis enim aut enim est ex qui omnis nemo dolorem.
12
-
13
- Vel asperiores molestias qui accusamus est libero voluptas. Blanditiis doloremque sint qui facere voluptatum et possimus aliquid. Eos enim iste qui aliquid suscipit a. Et nemo rerum voluptatem quia. Accusantium non sunt velit et temporibus beatae numquam omnis magnam. Nulla facere exercitationem est fugiat incidunt architecto corporis beatae et. Modi error quod qui rem aut.`,path:null,createdAt:"1586054668000",status:"approved"},{id:"3",name:"Carmella Gutkowski",emailAddress:"carmella@example.com",content:"Dolores delectus qui id rem aut. Modi voluptate laborum dolorum suscipit optio eaque. Cum est non temporibus voluptas incidunt.",path:null,createdAt:"1578537868000",status:"approved"},{id:"4",name:"Coby Sawayn",emailAddress:"coby@example.com",content:"Occaecati necessitatibus assumenda quia. Quam esse voluptas necessitatibus tenetur similique deleniti voluptas. Est voluptas nobis. Necessitatibus eum repellendus et commodi quasi corrupti. Cupiditate tempore quasi labore.",path:null,createdAt:"1602254668000",status:"approved"},{id:"5",name:"Florence Wolf",emailAddress:"florence@example.com",content:"Possimus vitae adipisci dolorum adipisci quaerat ut itaque. Dolorem delectus pariatur maxime qui voluptatem.",path:null,createdAt:"1591713868000",status:"approved"}],an=function(t,r){if(r=r.split(":")[0],t=+t,!t)return!1;switch(r){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0},te={},un=Object.prototype.hasOwnProperty,hn;function Ae(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function qe(e){try{return encodeURIComponent(e)}catch{return null}}function fn(e){for(var t=/([^=?#&]+)=?([^&]*)/g,r={},n;n=t.exec(e);){var o=Ae(n[1]),s=Ae(n[2]);o===null||s===null||o in r||(r[o]=s)}return r}function pn(e,t){t=t||"";var r=[],n,o;typeof t!="string"&&(t="?");for(o in e)if(un.call(e,o)){if(n=e[o],!n&&(n===null||n===hn||isNaN(n))&&(n=""),o=qe(o),n=qe(n),o===null||n===null)continue;r.push(o+"="+n)}return r.length?t+r.join("&"):""}te.stringify=pn,te.parse=fn;var Ie=an,D=te,dn=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,Re=/[\n\r\t]/g,gn=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,Fe=/:\d+$/,mn=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,bn=/^[a-zA-Z]:/;function ne(e){return(e||"").toString().replace(dn,"")}var re=[["#","hash"],["?","query"],function(t,r){return k(r.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],Ne={hash:1,query:1};function Le(e){var t;typeof window<"u"?t=window:typeof b<"u"?t=b:typeof self<"u"?t=self:t={};var r=t.location||{};e=e||r;var n={},o=typeof e,s;if(e.protocol==="blob:")n=new C(unescape(e.pathname),{});else if(o==="string"){n=new C(e,{});for(s in Ne)delete n[s]}else if(o==="object"){for(s in e)s in Ne||(n[s]=e[s]);n.slashes===void 0&&(n.slashes=gn.test(e.href))}return n}function k(e){return e==="file:"||e==="ftp:"||e==="http:"||e==="https:"||e==="ws:"||e==="wss:"}function Ue(e,t){e=ne(e),e=e.replace(Re,""),t=t||{};var r=mn.exec(e),n=r[1]?r[1].toLowerCase():"",o=!!r[2],s=!!r[3],l=0,i;return o?s?(i=r[2]+r[3]+r[4],l=r[2].length+r[3].length):(i=r[2]+r[4],l=r[2].length):s?(i=r[3]+r[4],l=r[3].length):i=r[4],n==="file:"?l>=2&&(i=i.slice(2)):k(n)?i=r[4]:n?o&&(i=i.slice(2)):l>=2&&k(t.protocol)&&(i=r[4]),{protocol:n,slashes:o||k(n),slashesCount:l,rest:i}}function yn(e,t){if(e==="")return t;for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,o=r[n-1],s=!1,l=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),l++):l&&(n===0&&(s=!0),r.splice(n,1),l--);return s&&r.unshift(""),(o==="."||o==="..")&&r.push(""),r.join("/")}function C(e,t,r){if(e=ne(e),e=e.replace(Re,""),!(this instanceof C))return new C(e,t,r);var n,o,s,l,i,a,u=re.slice(),h=typeof t,c=this,d=0;for(h!=="object"&&h!=="string"&&(r=t,t=null),r&&typeof r!="function"&&(r=D.parse),t=Le(t),o=Ue(e||"",t),n=!o.protocol&&!o.slashes,c.slashes=o.slashes||n&&t.slashes,c.protocol=o.protocol||t.protocol||"",e=o.rest,(o.protocol==="file:"&&(o.slashesCount!==2||bn.test(e))||!o.slashes&&(o.protocol||o.slashesCount<2||!k(c.protocol)))&&(u[3]=[/(.*)/,"pathname"]);d<u.length;d++){if(l=u[d],typeof l=="function"){e=l(e,c);continue}s=l[0],a=l[1],s!==s?c[a]=e:typeof s=="string"?(i=s==="@"?e.lastIndexOf(s):e.indexOf(s),~i&&(typeof l[2]=="number"?(c[a]=e.slice(0,i),e=e.slice(i+l[2])):(c[a]=e.slice(i),e=e.slice(0,i)))):(i=s.exec(e))&&(c[a]=i[1],e=e.slice(0,i.index)),c[a]=c[a]||n&&l[3]&&t[a]||"",l[4]&&(c[a]=c[a].toLowerCase())}r&&(c.query=r(c.query)),n&&t.slashes&&c.pathname.charAt(0)!=="/"&&(c.pathname!==""||t.pathname!=="")&&(c.pathname=yn(c.pathname,t.pathname)),c.pathname.charAt(0)!=="/"&&k(c.protocol)&&(c.pathname="/"+c.pathname),Ie(c.port,c.protocol)||(c.host=c.hostname,c.port=""),c.username=c.password="",c.auth&&(i=c.auth.indexOf(":"),~i?(c.username=c.auth.slice(0,i),c.username=encodeURIComponent(decodeURIComponent(c.username)),c.password=c.auth.slice(i+1),c.password=encodeURIComponent(decodeURIComponent(c.password))):c.username=encodeURIComponent(decodeURIComponent(c.auth)),c.auth=c.password?c.username+":"+c.password:c.username),c.origin=c.protocol!=="file:"&&k(c.protocol)&&c.host?c.protocol+"//"+c.host:"null",c.href=c.toString()}function vn(e,t,r){var n=this;switch(e){case"query":typeof t=="string"&&t.length&&(t=(r||D.parse)(t)),n[e]=t;break;case"port":n[e]=t,Ie(t,n.protocol)?t&&(n.host=n.hostname+":"+t):(n.host=n.hostname,n[e]="");break;case"hostname":n[e]=t,n.port&&(t+=":"+n.port),n.host=t;break;case"host":n[e]=t,Fe.test(t)?(t=t.split(":"),n.port=t.pop(),n.hostname=t.join(":")):(n.hostname=t,n.port="");break;case"protocol":n.protocol=t.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(t){var o=e==="pathname"?"/":"#";n[e]=t.charAt(0)!==o?o+t:t}else n[e]=t;break;case"username":case"password":n[e]=encodeURIComponent(t);break;case"auth":var s=t.indexOf(":");~s?(n.username=t.slice(0,s),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=t.slice(s+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(t))}for(var l=0;l<re.length;l++){var i=re[l];i[4]&&(n[i[1]]=n[i[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&k(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function wn(e){(!e||typeof e!="function")&&(e=D.stringify);var t,r=this,n=r.host,o=r.protocol;o&&o.charAt(o.length-1)!==":"&&(o+=":");var s=o+(r.protocol&&r.slashes||k(r.protocol)?"//":"");return r.username?(s+=r.username,r.password&&(s+=":"+r.password),s+="@"):r.password?(s+=":"+r.password,s+="@"):r.protocol!=="file:"&&k(r.protocol)&&!n&&r.pathname!=="/"&&(s+="@"),(n[n.length-1]===":"||Fe.test(r.hostname)&&!r.port)&&(n+=":"),s+=n+r.pathname,t=typeof r.query=="object"?e(r.query):r.query,t&&(s+=t.charAt(0)!=="?"?"?"+t:t),r.hash&&(s+=r.hash),s}C.prototype={set:vn,toString:wn},C.extractProtocol=Ue,C.location=Le,C.trimLeft=ne,C.qs=D;var kn=C;const oe=e=>(new kn(e).pathname||"").replace(/^(\/{1,})|\/{1,}$/g,""),Cn=(e,t)=>{const r=oe(t);return e.filter(n=>n.path?oe(n.path)===r:!1)},ze=e=>/(^<[a-z]+>)(.*)(<\/[a-z]+>)$/.test(e)?e:e.split(/(?:\r\n|\r|\n)/).filter(t=>!!t).map(t=>`<p>${t.trim()}</p>`).join(""),$n=50,xn=`
14
- fragment commentFields on Comment {
15
- createdAt
16
- name
17
- content
18
- path
19
- id
20
- }
21
-
22
- query Comments($domain: String!, $status: String, $skip: Int, $perPage: Int, $path: String){
23
- comments(domain: $domain, status: $status, skip: $skip, perPage: $perPage, path: $path) {
24
- items {
25
- ...commentFields
26
- children {
27
- ...commentFields
28
- }
29
- }
30
- meta {
31
- hasMore
32
- }
33
- }
34
- }`;class On{constructor({domain:t,apiKey:r,isDev:n=Qt()}){this.isDev=n,this.domain=t,this.client=cn({endpoint:`${en()}/graphql`,headers:{"x-api-key":r}})}async _getBatchOfComments({skip:t=0,path:r=""}){const{data:n,errors:o}=await this.client.send(xn,{domain:this.domain,status:"approved",perPage:$n,path:r,skip:t});if(!n&&o&&o.length)throw new Error(`Something went wrong with JamComments! Here's the error:
35
-
36
- ${JSON.stringify(o)}`);const{items:s,meta:l}=n.comments;if(o&&o.length)throw new Error(o[0].message);return ge(`Fetched a batch of ${s.length} comments.`),{comments:s,hasMore:l.hasMore}}_prepareDummyComments(){const t=_e.map(r=>r.createdAt).sort().reverse();return _e.map((r,n)=>(r.createdAt=t[n],delete r.emailAddress,r))}_prepareContent(t){return t.map(r=>(r.content=ze(r.content),r))}async getAllComments(t=""){if(this.isDev)return this._prepareContent(this._prepareDummyComments());let r=[],n=0,o=!1;do{const s=await this._getBatchOfComments({skip:n,path:t});o=s.hasMore,n=n+s.comments.length,r=[...r,...s.comments]}while(o);return this._prepareContent(r)}}var Mn=On;m.CommentFetcher=Mn,m.filterByUrl=Cn,m.log=ge,m.makeHtmlReady=ze,m.parsePath=oe,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(w,C){typeof exports=="object"&&typeof module<"u"?C(exports):typeof define=="function"&&define.amd?define(["exports"],C):(w=typeof globalThis<"u"?globalThis:w||self,C(w.JamComments={}))})(this,function(w){"use strict";const C=()=>{var e;return typeof process<"u"&&((e=process.env)==null?void 0:e.JAM_COMMENTS_BASE_URL)?process.env.JAM_COMMENTS_BASE_URL:"https://go.jamcomments.com"},T=e=>async({path:t,domain:r,apiKey:n,embedScript:a=!1})=>{const o=new URLSearchParams({path:t,domain:r,force_embed:"1",embed_script:a?"1":"0"}),s=await fetch(`${C()}/api/markup?${o}`,{method:"GET",headers:{Authorization:`Bearer ${n}`,Accept:"application/json","X-Platform":e}});if(s.status===401)throw"Unauthorized! Are your domain and API key set correctly?";if(!s.ok)throw`Request failed! Status code: ${s.status}, message: ${s.statusText}`;return await s.text()};var S={exports:{}},q=/[|\\{}()[\]^$+*?.]/g,z=function(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(q,"\\$&")},_={exports:{}},$={exports:{}},G={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]},k=G,R={};for(var j in k)k.hasOwnProperty(j)&&(R[k[j]]=j);var c=$.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(var 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);var N=c[y].channels,I=c[y].labels;delete c[y].channels,delete c[y].labels,Object.defineProperty(c[y],"channels",{value:N}),Object.defineProperty(c[y],"labels",{value:I})}c.rgb.hsl=function(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255,a=Math.min(t,r,n),o=Math.max(t,r,n),s=o-a,i,l,v;return o===a?i=0:t===o?i=(r-n)/s:r===o?i=2+(n-t)/s:n===o&&(i=4+(t-r)/s),i=Math.min(i*60,360),i<0&&(i+=360),v=(a+o)/2,o===a?l=0:v<=.5?l=s/(o+a):l=s/(2-o-a),[i,l*100,v*100]},c.rgb.hsv=function(e){var t,r,n,a,o,s=e[0]/255,i=e[1]/255,l=e[2]/255,v=Math.max(s,i,l),u=v-Math.min(s,i,l),h=function(d){return(v-d)/6/u+1/2};return u===0?a=o=0:(o=u/v,t=h(s),r=h(i),n=h(l),s===v?a=n-r:i===v?a=1/3+t-n:l===v&&(a=2/3+r-t),a<0?a+=1:a>1&&(a-=1)),[a*360,o*100,v*100]},c.rgb.hwb=function(e){var t=e[0],r=e[1],n=e[2],a=c.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(r,n));return n=1-1/255*Math.max(t,Math.max(r,n)),[a,o*100,n*100]},c.rgb.cmyk=function(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255,a,o,s,i;return i=Math.min(1-t,1-r,1-n),a=(1-t-i)/(1-i)||0,o=(1-r-i)/(1-i)||0,s=(1-n-i)/(1-i)||0,[a*100,o*100,s*100,i*100]};function U(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}c.rgb.keyword=function(e){var t=R[e];if(t)return t;var r=1/0,n;for(var a in k)if(k.hasOwnProperty(a)){var o=k[a],s=U(e,o);s<r&&(r=s,n=a)}return n},c.keyword.rgb=function(e){return k[e]},c.rgb.xyz=function(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255;t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var a=t*.4124+r*.3576+n*.1805,o=t*.2126+r*.7152+n*.0722,s=t*.0193+r*.1192+n*.9505;return[a*100,o*100,s*100]},c.rgb.lab=function(e){var t=c.rgb.xyz(e),r=t[0],n=t[1],a=t[2],o,s,i;return r/=95.047,n/=100,a/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,o=116*n-16,s=500*(r-n),i=200*(n-a),[o,s,i]},c.hsl.rgb=function(e){var t=e[0]/360,r=e[1]/100,n=e[2]/100,a,o,s,i,l;if(r===0)return l=n*255,[l,l,l];n<.5?o=n*(1+r):o=n+r-n*r,a=2*n-o,i=[0,0,0];for(var v=0;v<3;v++)s=t+1/3*-(v-1),s<0&&s++,s>1&&s--,6*s<1?l=a+(o-a)*6*s:2*s<1?l=o:3*s<2?l=a+(o-a)*(2/3-s)*6:l=a,i[v]=l*255;return i},c.hsl.hsv=function(e){var t=e[0],r=e[1]/100,n=e[2]/100,a=r,o=Math.max(n,.01),s,i;return n*=2,r*=n<=1?n:2-n,a*=o<=1?o:2-o,i=(n+r)/2,s=n===0?2*a/(o+a):2*r/(n+r),[t,s*100,i*100]},c.hsv.rgb=function(e){var t=e[0]/60,r=e[1]/100,n=e[2]/100,a=Math.floor(t)%6,o=t-Math.floor(t),s=255*n*(1-r),i=255*n*(1-r*o),l=255*n*(1-r*(1-o));switch(n*=255,a){case 0:return[n,l,s];case 1:return[i,n,s];case 2:return[s,n,l];case 3:return[s,i,n];case 4:return[l,s,n];case 5:return[n,s,i]}},c.hsv.hsl=function(e){var t=e[0],r=e[1]/100,n=e[2]/100,a=Math.max(n,.01),o,s,i;return i=(2-r)*n,o=(2-r)*a,s=r*a,s/=o<=1?o:2-o,s=s||0,i/=2,[t,s*100,i*100]},c.hwb.rgb=function(e){var t=e[0]/360,r=e[1]/100,n=e[2]/100,a=r+n,o,s,i,l;a>1&&(r/=a,n/=a),o=Math.floor(6*t),s=1-n,i=6*t-o,(o&1)!==0&&(i=1-i),l=r+i*(s-r);var v,u,h;switch(o){default:case 6:case 0:v=s,u=l,h=r;break;case 1:v=l,u=s,h=r;break;case 2:v=r,u=s,h=l;break;case 3:v=r,u=l,h=s;break;case 4:v=l,u=r,h=s;break;case 5:v=s,u=r,h=l;break}return[v*255,u*255,h*255]},c.cmyk.rgb=function(e){var t=e[0]/100,r=e[1]/100,n=e[2]/100,a=e[3]/100,o,s,i;return o=1-Math.min(1,t*(1-a)+a),s=1-Math.min(1,r*(1-a)+a),i=1-Math.min(1,n*(1-a)+a),[o*255,s*255,i*255]},c.xyz.rgb=function(e){var t=e[0]/100,r=e[1]/100,n=e[2]/100,a,o,s;return a=t*3.2406+r*-1.5372+n*-.4986,o=t*-.9689+r*1.8758+n*.0415,s=t*.0557+r*-.204+n*1.057,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[a*255,o*255,s*255]},c.xyz.lab=function(e){var t=e[0],r=e[1],n=e[2],a,o,s;return t/=95.047,r/=100,n/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,a=116*r-16,o=500*(t-r),s=200*(r-n),[a,o,s]},c.lab.xyz=function(e){var t=e[0],r=e[1],n=e[2],a,o,s;o=(t+16)/116,a=r/500+o,s=o-n/200;var i=Math.pow(o,3),l=Math.pow(a,3),v=Math.pow(s,3);return o=i>.008856?i:(o-16/116)/7.787,a=l>.008856?l:(a-16/116)/7.787,s=v>.008856?v:(s-16/116)/7.787,a*=95.047,o*=100,s*=108.883,[a,o,s]},c.lab.lch=function(e){var t=e[0],r=e[1],n=e[2],a,o,s;return a=Math.atan2(n,r),o=a*360/2/Math.PI,o<0&&(o+=360),s=Math.sqrt(r*r+n*n),[t,s,o]},c.lch.lab=function(e){var t=e[0],r=e[1],n=e[2],a,o,s;return s=n/360*2*Math.PI,a=r*Math.cos(s),o=r*Math.sin(s),[t,a,o]},c.rgb.ansi16=function(e){var t=e[0],r=e[1],n=e[2],a=1 in arguments?arguments[1]:c.rgb.hsv(e)[2];if(a=Math.round(a/50),a===0)return 30;var o=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));return a===2&&(o+=60),o},c.hsv.ansi16=function(e){return c.rgb.ansi16(c.hsv.rgb(e),e[2])},c.rgb.ansi256=function(e){var t=e[0],r=e[1],n=e[2];if(t===r&&r===n)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;var a=16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5);return a},c.ansi16.rgb=function(e){var t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];var r=(~~(e>50)+1)*.5,n=(t&1)*r*255,a=(t>>1&1)*r*255,o=(t>>2&1)*r*255;return[n,a,o]},c.ansi256.rgb=function(e){if(e>=232){var t=(e-232)*10+8;return[t,t,t]}e-=16;var r,n=Math.floor(e/36)/5*255,a=Math.floor((r=e%36)/6)/5*255,o=r%6/5*255;return[n,a,o]},c.rgb.hex=function(e){var t=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255),r=t.toString(16).toUpperCase();return"000000".substring(r.length)+r},c.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var r=t[0];t[0].length===3&&(r=r.split("").map(function(i){return i+i}).join(""));var n=parseInt(r,16),a=n>>16&255,o=n>>8&255,s=n&255;return[a,o,s]},c.rgb.hcg=function(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255,a=Math.max(Math.max(t,r),n),o=Math.min(Math.min(t,r),n),s=a-o,i,l;return s<1?i=o/(1-s):i=0,s<=0?l=0:a===t?l=(r-n)/s%6:a===r?l=2+(n-t)/s:l=4+(t-r)/s+4,l/=6,l%=1,[l*360,s*100,i*100]},c.hsl.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=1,a=0;return r<.5?n=2*t*r:n=2*t*(1-r),n<1&&(a=(r-.5*n)/(1-n)),[e[0],n*100,a*100]},c.hsv.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=t*r,a=0;return n<1&&(a=(r-n)/(1-n)),[e[0],n*100,a*100]},c.hcg.rgb=function(e){var t=e[0]/360,r=e[1]/100,n=e[2]/100;if(r===0)return[n*255,n*255,n*255];var a=[0,0,0],o=t%1*6,s=o%1,i=1-s,l=0;switch(Math.floor(o)){case 0:a[0]=1,a[1]=s,a[2]=0;break;case 1:a[0]=i,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=s;break;case 3:a[0]=0,a[1]=i,a[2]=1;break;case 4:a[0]=s,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=i}return l=(1-r)*n,[(r*a[0]+l)*255,(r*a[1]+l)*255,(r*a[2]+l)*255]},c.hcg.hsv=function(e){var t=e[1]/100,r=e[2]/100,n=t+r*(1-t),a=0;return n>0&&(a=t/n),[e[0],a*100,n*100]},c.hcg.hsl=function(e){var t=e[1]/100,r=e[2]/100,n=r*(1-t)+.5*t,a=0;return n>0&&n<.5?a=t/(2*n):n>=.5&&n<1&&(a=t/(2*(1-n))),[e[0],a*100,n*100]},c.hcg.hwb=function(e){var t=e[1]/100,r=e[2]/100,n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]},c.hwb.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=1-r,a=n-t,o=0;return a<1&&(o=(n-a)/(1-a)),[e[0],a*100,o*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 t=Math.round(e[0]/100*255)&255,r=(t<<16)+(t<<8)+t,n=r.toString(16).toUpperCase();return"000000".substring(n.length)+n},c.rgb.gray=function(e){var t=(e[0]+e[1]+e[2])/3;return[t/255*100]};var E=$.exports;function L(){for(var e={},t=Object.keys(E),r=t.length,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}function J(e){var t=L(),r=[e];for(t[e].distance=0;r.length;)for(var n=r.pop(),a=Object.keys(E[n]),o=a.length,s=0;s<o;s++){var i=a[s],l=t[i];l.distance===-1&&(l.distance=t[n].distance+1,l.parent=n,r.unshift(i))}return t}function X(e,t){return function(r){return t(e(r))}}function W(e,t){for(var r=[t[e].parent,e],n=E[t[e].parent][e],a=t[e].parent;t[a].parent;)r.unshift(t[a].parent),n=X(E[t[a].parent][a],n),a=t[a].parent;return n.conversion=r,n}var D=function(e){for(var t=J(e),r={},n=Object.keys(t),a=n.length,o=0;o<a;o++){var s=n[o],i=t[s];i.parent!==null&&(r[s]=W(s,t))}return r},O=$.exports,K=D,M={},Y=Object.keys(O);function H(e){var t=function(r){return r==null?r:(arguments.length>1&&(r=Array.prototype.slice.call(arguments)),e(r))};return"conversion"in e&&(t.conversion=e.conversion),t}function Q(e){var t=function(r){if(r==null)return r;arguments.length>1&&(r=Array.prototype.slice.call(arguments));var n=e(r);if(typeof n=="object")for(var a=n.length,o=0;o<a;o++)n[o]=Math.round(n[o]);return n};return"conversion"in e&&(t.conversion=e.conversion),t}Y.forEach(function(e){M[e]={},Object.defineProperty(M[e],"channels",{value:O[e].channels}),Object.defineProperty(M[e],"labels",{value:O[e].labels});var t=K(e),r=Object.keys(t);r.forEach(function(n){var a=t[n];M[e][n]=Q(a),M[e][n].raw=H(a)})});var V=M;(function(e){const t=V,r=(s,i)=>function(){return`\x1B[${s.apply(t,arguments)+i}m`},n=(s,i)=>function(){const l=s.apply(t,arguments);return`\x1B[${38+i};5;${l}m`},a=(s,i)=>function(){const l=s.apply(t,arguments);return`\x1B[${38+i};2;${l[0]};${l[1]};${l[2]}m`};function o(){const s=new Map,i={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]}};i.color.grey=i.color.gray;for(const u of Object.keys(i)){const h=i[u];for(const d of Object.keys(h)){const x=h[d];i[d]={open:`\x1B[${x[0]}m`,close:`\x1B[${x[1]}m`},h[d]=i[d],s.set(x[0],x[1])}Object.defineProperty(i,u,{value:h,enumerable:!1}),Object.defineProperty(i,"codes",{value:s,enumerable:!1})}const l=u=>u,v=(u,h,d)=>[u,h,d];i.color.close="\x1B[39m",i.bgColor.close="\x1B[49m",i.color.ansi={ansi:r(l,0)},i.color.ansi256={ansi256:n(l,0)},i.color.ansi16m={rgb:a(v,0)},i.bgColor.ansi={ansi:r(l,10)},i.bgColor.ansi256={ansi256:n(l,10)},i.bgColor.ansi16m={rgb:a(v,10)};for(let u of Object.keys(t)){if(typeof t[u]!="object")continue;const h=t[u];u==="ansi16"&&(u="ansi"),"ansi16"in h&&(i.color.ansi[u]=r(h.ansi16,0),i.bgColor.ansi[u]=r(h.ansi16,10)),"ansi256"in h&&(i.color.ansi256[u]=n(h.ansi256,0),i.bgColor.ansi256[u]=n(h.ansi256,10)),"rgb"in h&&(i.color.ansi16m[u]=a(h.rgb,0),i.bgColor.ansi16m[u]=a(h.rgb,10))}return i}Object.defineProperty(e,"exports",{enumerable:!0,get:o})})(_);var Z={stdout:!1,stderr:!1};const ee=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,P=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,re=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,ne=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi,ae=new Map([["n",`
2
+ `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function A(e){return e[0]==="u"&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):ae.get(e)||e}function te(e,t){const r=[],n=t.trim().split(/\s*,\s*/g);let a;for(const o of n)if(!isNaN(o))r.push(Number(o));else if(a=o.match(re))r.push(a[2].replace(ne,(s,i,l)=>i?A(i):l));else throw new Error(`Invalid Chalk template style argument: ${o} (in style '${e}')`);return r}function se(e){P.lastIndex=0;const t=[];let r;for(;(r=P.exec(e))!==null;){const n=r[1];if(r[2]){const a=te(n,r[2]);t.push([n].concat(a))}else t.push([n])}return t}function F(e,t){const r={};for(const a of t)for(const o of a.styles)r[o[0]]=a.inverse?null:o.slice(1);let n=e;for(const a of Object.keys(r))if(Array.isArray(r[a])){if(!(a in n))throw new Error(`Unknown Chalk style: ${a}`);r[a].length>0?n=n[a].apply(n,r[a]):n=n[a]}return n}var oe=(e,t)=>{const r=[],n=[];let a=[];if(t.replace(ee,(o,s,i,l,v,u)=>{if(s)a.push(A(s));else if(l){const h=a.join("");a=[],n.push(r.length===0?h:F(e,r)(h)),r.push({inverse:i,styles:se(l)})}else if(v){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(F(e,r)(a.join(""))),a=[],r.pop()}else a.push(u)}),n.push(a.join("")),r.length>0){const o=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(o)}return n.join("")};(function(e){const t=z,r=_.exports,n=Z.stdout,a=oe,o=process.platform==="win32"&&!({}.TERM||"").toLowerCase().startsWith("xterm"),s=["ansi","ansi","ansi256","ansi16m"],i=new Set(["gray"]),l=Object.create(null);function v(g,f){f=f||{};const b=0;g.level=f.level===void 0?b:f.level,g.enabled="enabled"in f?f.enabled:g.level>0}function u(g){if(!this||!(this instanceof u)||this.template){const f={};return v(f,g),f.template=function(){const b=[].slice.call(arguments);return ue.apply(null,[f.template].concat(b))},Object.setPrototypeOf(f,u.prototype),Object.setPrototypeOf(f.template,f),f.template.constructor=u,f.template}v(this,g)}o&&(r.blue.open="\x1B[94m");for(const g of Object.keys(r))r[g].closeRe=new RegExp(t(r[g].close),"g"),l[g]={get(){const f=r[g];return d.call(this,this._styles?this._styles.concat(f):[f],this._empty,g)}};l.visible={get(){return d.call(this,this._styles||[],!0,"visible")}},r.color.closeRe=new RegExp(t(r.color.close),"g");for(const g of Object.keys(r.color.ansi))i.has(g)||(l[g]={get(){const f=this.level;return function(){const m={open:r.color[s[f]][g].apply(null,arguments),close:r.color.close,closeRe:r.color.closeRe};return d.call(this,this._styles?this._styles.concat(m):[m],this._empty,g)}}});r.bgColor.closeRe=new RegExp(t(r.bgColor.close),"g");for(const g of Object.keys(r.bgColor.ansi)){if(i.has(g))continue;const f="bg"+g[0].toUpperCase()+g.slice(1);l[f]={get(){const b=this.level;return function(){const p={open:r.bgColor[s[b]][g].apply(null,arguments),close:r.bgColor.close,closeRe:r.bgColor.closeRe};return d.call(this,this._styles?this._styles.concat(p):[p],this._empty,g)}}}}const h=Object.defineProperties(()=>{},l);function d(g,f,b){const m=function(){return x.apply(m,arguments)};m._styles=g,m._empty=f;const p=this;return Object.defineProperty(m,"level",{enumerable:!0,get(){return p.level},set(B){p.level=B}}),Object.defineProperty(m,"enabled",{enumerable:!0,get(){return p.enabled},set(B){p.enabled=B}}),m.hasGrey=this.hasGrey||b==="gray"||b==="grey",m.__proto__=h,m}function x(){const g=arguments,f=g.length;let b=String(arguments[0]);if(f===0)return"";if(f>1)for(let p=1;p<f;p++)b+=" "+g[p];if(!this.enabled||this.level<=0||!b)return this._empty?"":b;const m=r.dim.open;o&&this.hasGrey&&(r.dim.open="");for(const p of this._styles.slice().reverse())b=p.open+b.replace(p.closeRe,p.open)+p.close,b=b.replace(/\r?\n/g,`${p.close}$&${p.open}`);return r.dim.open=m,b}function ue(g,f){if(!Array.isArray(f))return[].slice.call(arguments,1).join(" ");const b=[].slice.call(arguments,2),m=[f.raw[0]];for(let p=1;p<f.length;p++)m.push(String(b[p-1]).replace(/[{}\\]/g,"\\$&")),m.push(String(f.raw[p]));return a(g,m.join(""))}Object.defineProperties(u.prototype,l),e.exports=u(),e.exports.supportsColor=n,e.exports.default=e.exports})(S);var ie=S.exports;const le=e=>{console.log(`${ie.magenta("JamComments:")} ${e}`)},ce=e=>{console.error(`JamComments: ${e}`)};w.log=le,w.logError=ce,w.markupFetcher=T,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/dist/log.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const log: (message: any) => void;
2
- export default log;
1
+ export declare const log: (message: string) => void;
2
+ export declare const logError: (message: string) => void;
@@ -0,0 +1 @@
1
+ export declare const markupFetcher: (platform: string) => Function;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jam-comments/server-utilities",
3
- "version": "0.0.4",
3
+ "version": "1.0.1",
4
4
  "description": "Various JavaScript utilities for JamComments.",
5
5
  "main": "dist/index.umd.js",
6
6
  "module": "dist/index.es.js",
@@ -15,7 +15,7 @@
15
15
  "scripts": {
16
16
  "watch": "npm run build -- --watch",
17
17
  "build": "vite build && tsc",
18
- "test": "jest --config ./jest.config.js",
18
+ "test": "echo 'No tests here...'",
19
19
  "prettify": "prettier ./**/*.{js,md,ts} --write",
20
20
  "prepare": "npm run build"
21
21
  },
@@ -44,5 +44,5 @@
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "gitHead": "d9dcd04a7df86a85ee5ddaeab947da3384333c6d"
47
+ "gitHead": "d93b58294d410c7de8e5c9a57ad9bc1a292467e6"
48
48
  }
@@ -1,40 +0,0 @@
1
- declare class CommentFetcher {
2
- isDev: any;
3
- domain: any;
4
- client: any;
5
- constructor({ domain, apiKey, isDev }: {
6
- domain: any;
7
- apiKey: any;
8
- isDev?: boolean;
9
- });
10
- /**
11
- * Retrieve a batch of comments.
12
- *
13
- * @param {number} skip
14
- * @returns {object}
15
- */
16
- _getBatchOfComments({ skip, path }: {
17
- skip?: number;
18
- path?: string;
19
- }): Promise<{
20
- comments: any[];
21
- hasMore: boolean;
22
- }>;
23
- _prepareDummyComments(): {
24
- id: string;
25
- name: string;
26
- emailAddress: string;
27
- content: string;
28
- path: any;
29
- createdAt: string;
30
- status: string;
31
- }[];
32
- _prepareContent(comments: any[]): any[];
33
- /**
34
- * Get all the comments until there are no more remaining.
35
- *
36
- * @returns Promise<array>
37
- */
38
- getAllComments(path?: string): Promise<any[]>;
39
- }
40
- export default CommentFetcher;
package/dist/utils.d.ts DELETED
@@ -1,9 +0,0 @@
1
- /**
2
- * Gets the path from a URL with no leading or trailing slashes.
3
- */
4
- export declare const parsePath: (urlOrPath: string) => string;
5
- /**
6
- * Filter out the comments that don't belong to a certain URL.
7
- */
8
- export declare const filterByUrl: (comments: any[], urlOrPath: string) => any[];
9
- export declare const makeHtmlReady: (content: string) => string;