@ministryofjustice/hmpps-digital-prison-reporting-frontend
Version:
The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.
49 lines • 97.1 kB
JavaScript
var Co=Object.create;var nr=Object.defineProperty;var Ao=Object.getOwnPropertyDescriptor;var Ro=Object.getOwnPropertyNames;var ko=Object.getPrototypeOf,Mo=Object.prototype.hasOwnProperty;var S=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Lo=(r,e)=>{for(var t in e)nr(r,t,{get:e[t],enumerable:!0})},xt=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ro(e))!Mo.call(r,i)&&i!==t&&nr(r,i,{get:()=>e[i],enumerable:!(n=Ao(e,i))||n.enumerable});return r};var Dt=(r,e,t)=>(t=r!=null?Co(ko(r)):{},xt(e||!r||!r.__esModule?nr(t,"default",{value:r,enumerable:!0}):t,r)),To=r=>xt(nr({},"__esModule",{value:!0}),r);var Bt=S((Ya,kr)=>{var No=Object.prototype.hasOwnProperty;function Pt(r){return"[Throws: "+(r?r.message:"?")+"]"}function jo(r,e){if(No.call(r,e))try{return r[e]}catch(t){return Pt(t)}return r[e]}function Ft(r){var e=[];function t(n){if(n===null||typeof n!="object")return n;if(e.indexOf(n)!==-1)return"[Circular]";if(e.push(n),typeof n.toJSON=="function")try{var i=t(n.toJSON());return e.pop(),i}catch(a){return Pt(a)}if(Array.isArray(n)){var o=n.map(t);return e.pop(),o}var s=Object.keys(n).reduce(function(a,u){return a[u]=t(jo(n,u)),a},{});return e.pop(),s}return t(r)}kr.exports=function(r,e,t){return JSON.stringify(Ft(r),e,t)};kr.exports.ensureProperties=Ft});var qt=S((Xa,Gt)=>{var q=require("fs"),Fe=require("path");Gt.exports=ir;ir.ncp=ir;function ir(r,e,t,n){var i=n;n||(i=t,t={});var o=process.cwd(),s=Fe.resolve(o,r),a=Fe.resolve(o,e),u=t.filter,l=t.rename,c=t.transform,v=t.clobber!==!1,f=t.modified,h=t.dereference,d=null,m=0,k=0,p=0,_=t.limit||ir.limit||16;_=_<1?1:_>512?512:_,j(s);function j(y){if(m++,u){if(u instanceof RegExp){if(!u.test(y))return V(!0)}else if(typeof u=="function"&&!u(y))return V(!0)}return E(y)}function E(y){var b=h?q.stat:q.lstat;if(p>=_)return setImmediate(function(){E(y)});p++,b(y,function(O,T){var z={};if(O)return $(O);if(z.name=y,z.mode=T.mode,z.mtime=T.mtime,z.atime=T.atime,T.isDirectory())return U(z);if(T.isFile())return C(z);if(T.isSymbolicLink())return w(y)})}function C(y){var b=y.name.replace(s,a);l&&(b=l(b)),ee(b,function(O){if(O)return K(y,b);if(v&&W(b,function(){K(y,b)}),f){var T=h?q.stat:q.lstat;T(b,function(z,Pe){if(y.mtime.getTime()>Pe.mtime.getTime())K(y,b);else return V()})}else return V()})}function K(y,b){var O=q.createReadStream(y.name),T=q.createWriteStream(b,{mode:y.mode});O.on("error",$),T.on("error",$),c?c(O,T,y):T.on("open",function(){O.pipe(T)}),T.once("finish",function(){f&&q.utimesSync(b,y.atime,y.mtime),V()})}function W(y,b){q.unlink(y,function(O){return O?$(O):b()})}function U(y){var b=y.name.replace(s,a);ee(b,function(O){if(O)return N(y,b);te(y.name)})}function N(y,b){q.mkdir(b,y.mode,function(O){if(O)return $(O);te(y.name)})}function te(y){q.readdir(y,function(b,O){return b?$(b):(O.forEach(function(T){j(Fe.join(y,T))}),V())})}function w(y){var b=y.replace(s,a);q.readlink(y,function(O,T){if(O)return $(O);X(T,b)})}function X(y,b){h&&(y=Fe.resolve(o,y)),ee(b,function(O){if(O)return H(y,b);q.readlink(b,function(T,z){return T?$(T):(h&&(z=Fe.resolve(o,z)),z===y?V():W(b,function(){H(y,b)}))})})}function H(y,b){q.symlink(y,b,function(O){return O?$(O):V()})}function ee(y,b){q.lstat(y,function(O){return O&&O.code==="ENOENT"?b(!0):b(!1)})}function $(y){return t.stopOnError?i(y):(!d&&t.errs?d=q.createWriteStream(t.errs):d||(d=[]),typeof d.write>"u"?d.push(y):d.write(y.stack+`
`),V())}function V(y){if(y||p--,k++,m===k&&p===0&&i!==void 0)return i(d||null)}}});var zt=S((Za,Ut)=>{Ut.exports=function(r,e){for(var t=[],n=0;n<r.length;n++){var i=e(r[n],n);Io(i)?t.push.apply(t,i):t.push(i)}return t};var Io=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"}});var Jt=S((Ka,Qt)=>{"use strict";Qt.exports=$t;function $t(r,e,t){r instanceof RegExp&&(r=Wt(r,t)),e instanceof RegExp&&(e=Wt(e,t));var n=Vt(r,e,t);return n&&{start:n[0],end:n[1],pre:t.slice(0,n[0]),body:t.slice(n[0]+r.length,n[1]),post:t.slice(n[1]+e.length)}}function Wt(r,e){var t=e.match(r);return t?t[0]:null}$t.range=Vt;function Vt(r,e,t){var n,i,o,s,a,u=t.indexOf(r),l=t.indexOf(e,u+1),c=u;if(u>=0&&l>0){if(r===e)return[u,l];for(n=[],o=t.length;c>=0&&!a;)c==u?(n.push(c),u=t.indexOf(r,c+1)):n.length==1?a=[n.pop(),l]:(i=n.pop(),i<o&&(o=i,s=l),l=t.indexOf(e,c+1)),c=u<l&&u>=0?u:l;n.length&&(a=[o,s])}return a}});var tn=S((Ha,rn)=>{var xo=zt(),Yt=Jt();rn.exports=Fo;var Xt="\0SLASH"+Math.random()+"\0",Zt="\0OPEN"+Math.random()+"\0",Lr="\0CLOSE"+Math.random()+"\0",Kt="\0COMMA"+Math.random()+"\0",Ht="\0PERIOD"+Math.random()+"\0";function Mr(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}function Do(r){return r.split("\\\\").join(Xt).split("\\{").join(Zt).split("\\}").join(Lr).split("\\,").join(Kt).split("\\.").join(Ht)}function Po(r){return r.split(Xt).join("\\").split(Zt).join("{").split(Lr).join("}").split(Kt).join(",").split(Ht).join(".")}function en(r){if(!r)return[""];var e=[],t=Yt("{","}",r);if(!t)return r.split(",");var n=t.pre,i=t.body,o=t.post,s=n.split(",");s[s.length-1]+="{"+i+"}";var a=en(o);return o.length&&(s[s.length-1]+=a.shift(),s.push.apply(s,a)),e.push.apply(e,s),e}function Fo(r){return r?(r.substr(0,2)==="{}"&&(r="\\{\\}"+r.substr(2)),Ee(Do(r),!0).map(Po)):[]}function Bo(r){return"{"+r+"}"}function Go(r){return/^-?0\d/.test(r)}function qo(r,e){return r<=e}function Uo(r,e){return r>=e}function Ee(r,e){var t=[],n=Yt("{","}",r);if(!n||/\$$/.test(n.pre))return[r];var i=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),s=i||o,a=n.body.indexOf(",")>=0;if(!s&&!a)return n.post.match(/,.*\}/)?(r=n.pre+"{"+n.body+Lr+n.post,Ee(r)):[r];var u;if(s)u=n.body.split(/\.\./);else if(u=en(n.body),u.length===1&&(u=Ee(u[0],!1).map(Bo),u.length===1)){var c=n.post.length?Ee(n.post,!1):[""];return c.map(function(w){return n.pre+u[0]+w})}var l=n.pre,c=n.post.length?Ee(n.post,!1):[""],v;if(s){var f=Mr(u[0]),h=Mr(u[1]),d=Math.max(u[0].length,u[1].length),m=u.length==3?Math.abs(Mr(u[2])):1,k=qo,p=h<f;p&&(m*=-1,k=Uo);var _=u.some(Go);v=[];for(var j=f;k(j,h);j+=m){var E;if(o)E=String.fromCharCode(j),E==="\\"&&(E="");else if(E=String(j),_){var C=d-E.length;if(C>0){var K=new Array(C+1).join("0");j<0?E="-"+K+E.slice(1):E=K+E}}v.push(E)}}else v=xo(u,function(te){return Ee(te,!1)});for(var W=0;W<v.length;W++)for(var U=0;U<c.length;U++){var N=l+v[W]+c[U];(!e||s||N)&&t.push(N)}return t}});var ar=S((eu,un)=>{un.exports=Q;Q.Minimatch=D;var Be=function(){try{return require("path")}catch{}}()||{sep:"/"};Q.sep=Be.sep;var jr=Q.GLOBSTAR=D.GLOBSTAR={},zo=tn(),nn={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},Tr="[^/]",Nr=Tr+"*?",Wo="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",$o="(?:(?!(?:\\/|^)\\.).)*?",on=Vo("().*{}+?[]^$\\!");function Vo(r){return r.split("").reduce(function(e,t){return e[t]=!0,e},{})}var sn=/\/+/;Q.filter=Qo;function Qo(r,e){return e=e||{},function(t,n,i){return Q(t,r,e)}}function ce(r,e){e=e||{};var t={};return Object.keys(r).forEach(function(n){t[n]=r[n]}),Object.keys(e).forEach(function(n){t[n]=e[n]}),t}Q.defaults=function(r){if(!r||typeof r!="object"||!Object.keys(r).length)return Q;var e=Q,t=function(i,o,s){return e(i,o,ce(r,s))};return t.Minimatch=function(i,o){return new e.Minimatch(i,ce(r,o))},t.Minimatch.defaults=function(i){return e.defaults(ce(r,i)).Minimatch},t.filter=function(i,o){return e.filter(i,ce(r,o))},t.defaults=function(i){return e.defaults(ce(r,i))},t.makeRe=function(i,o){return e.makeRe(i,ce(r,o))},t.braceExpand=function(i,o){return e.braceExpand(i,ce(r,o))},t.match=function(n,i,o){return e.match(n,i,ce(r,o))},t};D.defaults=function(r){return Q.defaults(r).Minimatch};function Q(r,e,t){return sr(e),t||(t={}),!t.nocomment&&e.charAt(0)==="#"?!1:new D(e,t).match(r)}function D(r,e){if(!(this instanceof D))return new D(r,e);sr(r),e||(e={}),r=r.trim(),!e.allowWindowsEscape&&Be.sep!=="/"&&(r=r.split(Be.sep).join("/")),this.options=e,this.set=[],this.pattern=r,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.make()}D.prototype.debug=function(){};D.prototype.make=Jo;function Jo(){var r=this.pattern,e=this.options;if(!e.nocomment&&r.charAt(0)==="#"){this.comment=!0;return}if(!r){this.empty=!0;return}this.parseNegate();var t=this.globSet=this.braceExpand();e.debug&&(this.debug=function(){console.error.apply(console,arguments)}),this.debug(this.pattern,t),t=this.globParts=t.map(function(n){return n.split(sn)}),this.debug(this.pattern,t),t=t.map(function(n,i,o){return n.map(this.parse,this)},this),this.debug(this.pattern,t),t=t.filter(function(n){return n.indexOf(!1)===-1}),this.debug(this.pattern,t),this.set=t}D.prototype.parseNegate=Yo;function Yo(){var r=this.pattern,e=!1,t=this.options,n=0;if(!t.nonegate){for(var i=0,o=r.length;i<o&&r.charAt(i)==="!";i++)e=!e,n++;n&&(this.pattern=r.substr(n)),this.negate=e}}Q.braceExpand=function(r,e){return an(r,e)};D.prototype.braceExpand=an;function an(r,e){return e||(this instanceof D?e=this.options:e={}),r=typeof r>"u"?this.pattern:r,sr(r),e.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:zo(r)}var Xo=1024*64,sr=function(r){if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>Xo)throw new TypeError("pattern is too long")};D.prototype.parse=Zo;var or={};function Zo(r,e){sr(r);var t=this.options;if(r==="**")if(t.noglobstar)r="*";else return jr;if(r==="")return"";var n="",i=!!t.nocase,o=!1,s=[],a=[],u,l=!1,c=-1,v=-1,f=r.charAt(0)==="."?"":t.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",h=this;function d(){if(u){switch(u){case"*":n+=Nr,i=!0;break;case"?":n+=Tr,i=!0;break;default:n+="\\"+u;break}h.debug("clearStateChar %j %j",u,n),u=!1}}for(var m=0,k=r.length,p;m<k&&(p=r.charAt(m));m++){if(this.debug("%s %s %s %j",r,m,n,p),o&&on[p]){n+="\\"+p,o=!1;continue}switch(p){case"/":return!1;case"\\":d(),o=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",r,m,n,p),l){this.debug(" in class"),p==="!"&&m===v+1&&(p="^"),n+=p;continue}h.debug("call clearStateChar %j",u),d(),u=p,t.noext&&d();continue;case"(":if(l){n+="(";continue}if(!u){n+="\\(";continue}s.push({type:u,start:m-1,reStart:n.length,open:nn[u].open,close:nn[u].close}),n+=u==="!"?"(?:(?!(?:":"(?:",this.debug("plType %j %j",u,n),u=!1;continue;case")":if(l||!s.length){n+="\\)";continue}d(),i=!0;var _=s.pop();n+=_.close,_.type==="!"&&a.push(_),_.reEnd=n.length;continue;case"|":if(l||!s.length||o){n+="\\|",o=!1;continue}d(),n+="|";continue;case"[":if(d(),l){n+="\\"+p;continue}l=!0,v=m,c=n.length,n+=p;continue;case"]":if(m===v+1||!l){n+="\\"+p,o=!1;continue}var j=r.substring(v+1,m);try{RegExp("["+j+"]")}catch{var E=this.parse(j,or);n=n.substr(0,c)+"\\["+E[0]+"\\]",i=i||E[1],l=!1;continue}i=!0,l=!1,n+=p;continue;default:d(),o?o=!1:on[p]&&!(p==="^"&&l)&&(n+="\\"),n+=p}}for(l&&(j=r.substr(v+1),E=this.parse(j,or),n=n.substr(0,c)+"\\["+E[0],i=i||E[1]),_=s.pop();_;_=s.pop()){var C=n.slice(_.reStart+_.open.length);this.debug("setting tail",n,_),C=C.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(T,z,Pe){return Pe||(Pe="\\"),z+z+Pe+"|"}),this.debug(`tail=%j
%s`,C,C,_,n);var K=_.type==="*"?Nr:_.type==="?"?Tr:"\\"+_.type;i=!0,n=n.slice(0,_.reStart)+K+"\\("+C}d(),o&&(n+="\\\\");var W=!1;switch(n.charAt(0)){case"[":case".":case"(":W=!0}for(var U=a.length-1;U>-1;U--){var N=a[U],te=n.slice(0,N.reStart),w=n.slice(N.reStart,N.reEnd-8),X=n.slice(N.reEnd-8,N.reEnd),H=n.slice(N.reEnd);X+=H;var ee=te.split("(").length-1,$=H;for(m=0;m<ee;m++)$=$.replace(/\)[+*?]?/,"");H=$;var V="";H===""&&e!==or&&(V="$");var y=te+w+H+V+X;n=y}if(n!==""&&i&&(n="(?=.)"+n),W&&(n=f+n),e===or)return[n,i];if(!i)return Ho(r);var b=t.nocase?"i":"";try{var O=new RegExp("^"+n+"$",b)}catch{return new RegExp("$.")}return O._glob=r,O._src=n,O}Q.makeRe=function(r,e){return new D(r,e||{}).makeRe()};D.prototype.makeRe=Ko;function Ko(){if(this.regexp||this.regexp===!1)return this.regexp;var r=this.set;if(!r.length)return this.regexp=!1,this.regexp;var e=this.options,t=e.noglobstar?Nr:e.dot?Wo:$o,n=e.nocase?"i":"",i=r.map(function(o){return o.map(function(s){return s===jr?t:typeof s=="string"?es(s):s._src}).join("\\/")}).join("|");i="^(?:"+i+")$",this.negate&&(i="^(?!"+i+").*$");try{this.regexp=new RegExp(i,n)}catch{this.regexp=!1}return this.regexp}Q.match=function(r,e,t){t=t||{};var n=new D(e,t);return r=r.filter(function(i){return n.match(i)}),n.options.nonull&&!r.length&&r.push(e),r};D.prototype.match=function(e,t){if(typeof t>"u"&&(t=this.partial),this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;var n=this.options;Be.sep!=="/"&&(e=e.split(Be.sep).join("/")),e=e.split(sn),this.debug(this.pattern,"split",e);var i=this.set;this.debug(this.pattern,"set",i);var o,s;for(s=e.length-1;s>=0&&(o=e[s],!o);s--);for(s=0;s<i.length;s++){var a=i[s],u=e;n.matchBase&&a.length===1&&(u=[o]);var l=this.matchOne(u,a,t);if(l)return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate};D.prototype.matchOne=function(r,e,t){var n=this.options;this.debug("matchOne",{this:this,file:r,pattern:e}),this.debug("matchOne",r.length,e.length);for(var i=0,o=0,s=r.length,a=e.length;i<s&&o<a;i++,o++){this.debug("matchOne loop");var u=e[o],l=r[i];if(this.debug(e,u,l),u===!1)return!1;if(u===jr){this.debug("GLOBSTAR",[e,u,l]);var c=i,v=o+1;if(v===a){for(this.debug("** at the end");i<s;i++)if(r[i]==="."||r[i]===".."||!n.dot&&r[i].charAt(0)===".")return!1;return!0}for(;c<s;){var f=r[c];if(this.debug(`
globstar while`,r,c,e,v,f),this.matchOne(r.slice(c),e.slice(v),t))return this.debug("globstar found match!",c,s,f),!0;if(f==="."||f===".."||!n.dot&&f.charAt(0)==="."){this.debug("dot detected!",r,c,e,v);break}this.debug("globstar swallow a segment, and continue"),c++}return!!(t&&(this.debug(`
>>> no match, partial?`,r,c,e,v),c===s))}var h;if(typeof u=="string"?(h=l===u,this.debug("string match",u,l,h)):(h=l.match(u),this.debug("pattern match",u,l,h)),!h)return!1}if(i===s&&o===a)return!0;if(i===s)return t;if(o===a)return i===s-1&&r[i]==="";throw new Error("wtf?")};function Ho(r){return r.replace(/\\(.)/g,"$1")}function es(r){return r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var ln=S((ru,Ir)=>{typeof Object.create=="function"?Ir.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Ir.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}});var cn=S((tu,Dr)=>{try{if(xr=require("util"),typeof xr.inherits!="function")throw"";Dr.exports=xr.inherits}catch{Dr.exports=ln()}var xr});var lr=S((nu,ur)=>{"use strict";function fn(r){return r.charAt(0)==="/"}function hn(r){var e=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,t=e.exec(r),n=t[1]||"",i=!!(n&&n.charAt(1)!==":");return!!(t[2]||i)}ur.exports=process.platform==="win32"?hn:fn;ur.exports.posix=fn;ur.exports.win32=hn});var Br=S(ne=>{ne.alphasort=gn;ne.alphasorti=vn;ne.setopts=os;ne.ownProp=dn;ne.makeAbs=Fr;ne.finish=ss;ne.mark=as;ne.isIgnored=mn;ne.childrenIgnored=us;function dn(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var be=require("path"),rs=ar(),ts=lr(),Pr=rs.Minimatch;function vn(r,e){return r.toLowerCase().localeCompare(e.toLowerCase())}function gn(r,e){return r.localeCompare(e)}function ns(r,e){r.ignore=e.ignore||[],Array.isArray(r.ignore)||(r.ignore=[r.ignore]),r.ignore.length&&(r.ignore=r.ignore.map(is))}function is(r){var e=null;if(r.slice(-3)==="/**"){var t=r.replace(/(\/\*\*)+$/,"");e=new Pr(t,{dot:!0})}return{matcher:new Pr(r,{dot:!0}),gmatcher:e}}function os(r,e,t){if(t||(t={}),t.matchBase&&e.indexOf("/")===-1){if(t.noglobstar)throw new Error("base matching requires globstar");e="**/"+e}r.silent=!!t.silent,r.pattern=e,r.strict=t.strict!==!1,r.realpath=!!t.realpath,r.realpathCache=t.realpathCache||Object.create(null),r.follow=!!t.follow,r.dot=!!t.dot,r.mark=!!t.mark,r.nodir=!!t.nodir,r.nodir&&(r.mark=!0),r.sync=!!t.sync,r.nounique=!!t.nounique,r.nonull=!!t.nonull,r.nosort=!!t.nosort,r.nocase=!!t.nocase,r.stat=!!t.stat,r.noprocess=!!t.noprocess,r.maxLength=t.maxLength||1/0,r.cache=t.cache||Object.create(null),r.statCache=t.statCache||Object.create(null),r.symlinks=t.symlinks||Object.create(null),ns(r,t),r.changedCwd=!1;var n=process.cwd();dn(t,"cwd")?(r.cwd=t.cwd,r.changedCwd=be.resolve(t.cwd)!==n):r.cwd=n,r.root=t.root||be.resolve(r.cwd,"/"),r.root=be.resolve(r.root),process.platform==="win32"&&(r.root=r.root.replace(/\\/g,"/")),r.nomount=!!t.nomount,t.nonegate=!0,t.nocomment=!0,r.minimatch=new Pr(e,t),r.options=r.minimatch.options}function ss(r){for(var e=r.nounique,t=e?[]:Object.create(null),n=0,i=r.matches.length;n<i;n++){var o=r.matches[n];if(!o||Object.keys(o).length===0){if(r.nonull){var s=r.minimatch.globSet[n];e?t.push(s):t[s]=!0}}else{var a=Object.keys(o);e?t.push.apply(t,a):a.forEach(function(u){t[u]=!0})}}if(e||(t=Object.keys(t)),r.nosort||(t=t.sort(r.nocase?vn:gn)),r.mark){for(var n=0;n<t.length;n++)t[n]=r._mark(t[n]);r.nodir&&(t=t.filter(function(u){return!/\/$/.test(u)}))}r.ignore.length&&(t=t.filter(function(u){return!mn(r,u)})),r.found=t}function as(r,e){var t=Fr(r,e),n=r.cache[t],i=e;if(n){var o=n==="DIR"||Array.isArray(n),s=e.slice(-1)==="/";if(o&&!s?i+="/":!o&&s&&(i=i.slice(0,-1)),i!==e){var a=Fr(r,i);r.statCache[a]=r.statCache[t],r.cache[a]=r.cache[t]}}return i}function Fr(r,e){var t=e;return e.charAt(0)==="/"?t=be.join(r.root,e):ts(e)||e===""?t=e:r.changedCwd?t=be.resolve(r.cwd,e):t=be.resolve(e),t}function mn(r,e){return r.ignore.length?r.ignore.some(function(t){return t.matcher.match(e)||!!(t.gmatcher&&t.gmatcher.match(e))}):!1}function us(r,e){return r.ignore.length?r.ignore.some(function(t){return!!(t.gmatcher&&t.gmatcher.match(e))}):!1}});var wn=S((cu,Sn)=>{Sn.exports=_n;_n.GlobSync=x;var Ge=require("fs"),pn=ar(),ou=pn.Minimatch,su=Ur().Glob,au=require("util"),Gr=require("path"),yn=require("assert"),cr=lr(),fe=Br(),uu=fe.alphasort,lu=fe.alphasorti,ls=fe.setopts,qr=fe.ownProp,cs=fe.childrenIgnored;function _n(r,e){if(typeof e=="function"||arguments.length===3)throw new TypeError(`callback provided to sync glob
See: https://github.com/isaacs/node-glob/issues/167`);return new x(r,e).found}function x(r,e){if(!r)throw new Error("must provide pattern");if(typeof e=="function"||arguments.length===3)throw new TypeError(`callback provided to sync glob
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof x))return new x(r,e);if(ls(this,r,e),this.noprocess)return this;var t=this.minimatch.set.length;this.matches=new Array(t);for(var n=0;n<t;n++)this._process(this.minimatch.set[n],n,!1);this._finish()}x.prototype._finish=function(){if(yn(this instanceof x),this.realpath){var r=this;this.matches.forEach(function(e,t){var n=r.matches[t]=Object.create(null);for(var i in e)try{i=r._makeAbs(i);var o=Ge.realpathSync(i,r.realpathCache);n[o]=!0}catch(s){if(s.syscall==="stat")n[r._makeAbs(i)]=!0;else throw s}})}fe.finish(this)};x.prototype._process=function(r,e,t){yn(this instanceof x);for(var n=0;typeof r[n]=="string";)n++;var i;switch(n){case r.length:this._processSimple(r.join("/"),e);return;case 0:i=null;break;default:i=r.slice(0,n).join("/");break}var o=r.slice(n),s;i===null?s=".":((cr(i)||cr(r.join("/")))&&(!i||!cr(i))&&(i="/"+i),s=i);var a=this._makeAbs(s);if(!cs(this,s)){var u=o[0]===pn.GLOBSTAR;u?this._processGlobStar(i,s,a,o,e,t):this._processReaddir(i,s,a,o,e,t)}};x.prototype._processReaddir=function(r,e,t,n,i,o){var s=this._readdir(t,o);if(s){for(var a=n[0],u=!!this.minimatch.negate,l=a._glob,c=this.dot||l.charAt(0)===".",v=[],f=0;f<s.length;f++){var h=s[f];if(h.charAt(0)!=="."||c){var d;u&&!r?d=!h.match(a):d=h.match(a),d&&v.push(h)}}var m=v.length;if(m!==0){if(n.length===1&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(var f=0;f<m;f++){var h=v[f];r&&(r.slice(-1)!=="/"?h=r+"/"+h:h=r+h),h.charAt(0)==="/"&&!this.nomount&&(h=Gr.join(this.root,h)),this.matches[i][h]=!0}return}n.shift();for(var f=0;f<m;f++){var h=v[f],k;r?k=[r,h]:k=[h],this._process(k.concat(n),i,o)}}}};x.prototype._emitMatch=function(r,e){var t=this._makeAbs(e);if(this.mark&&(e=this._mark(e)),!this.matches[r][e]){if(this.nodir){var n=this.cache[this._makeAbs(e)];if(n==="DIR"||Array.isArray(n))return}this.matches[r][e]=!0,this.stat&&this._stat(e)}};x.prototype._readdirInGlobStar=function(r){if(this.follow)return this._readdir(r,!1);var e,t,n;try{t=Ge.lstatSync(r)}catch{return null}var i=t.isSymbolicLink();return this.symlinks[r]=i,!i&&!t.isDirectory()?this.cache[r]="FILE":e=this._readdir(r,!1),e};x.prototype._readdir=function(r,e){var t;if(e&&!qr(this.symlinks,r))return this._readdirInGlobStar(r);if(qr(this.cache,r)){var n=this.cache[r];if(!n||n==="FILE")return null;if(Array.isArray(n))return n}try{return this._readdirEntries(r,Ge.readdirSync(r))}catch(i){return this._readdirError(r,i),null}};x.prototype._readdirEntries=function(r,e){if(!this.mark&&!this.stat)for(var t=0;t<e.length;t++){var n=e[t];r==="/"?n=r+n:n=r+"/"+n,this.cache[n]=!0}return this.cache[r]=e,e};x.prototype._readdirError=function(r,e){switch(e.code){case"ENOTSUP":case"ENOTDIR":this.cache[this._makeAbs(r)]="FILE";break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(r)]=!1;break;default:if(this.cache[this._makeAbs(r)]=!1,this.strict)throw e;this.silent||console.error("glob error",e);break}};x.prototype._processGlobStar=function(r,e,t,n,i,o){var s=this._readdir(t,o);if(s){var a=n.slice(1),u=r?[r]:[],l=u.concat(a);this._process(l,i,!1);var c=s.length,v=this.symlinks[t];if(!(v&&o))for(var f=0;f<c;f++){var h=s[f];if(!(h.charAt(0)==="."&&!this.dot)){var d=u.concat(s[f],a);this._process(d,i,!0);var m=u.concat(s[f],n);this._process(m,i,!0)}}}};x.prototype._processSimple=function(r,e){var t=this._stat(r);if(this.matches[e]||(this.matches[e]=Object.create(null)),!!t){if(r&&cr(r)&&!this.nomount){var n=/[\/\\]$/.test(r);r.charAt(0)==="/"?r=Gr.join(this.root,r):(r=Gr.resolve(this.root,r),n&&(r+="/"))}process.platform==="win32"&&(r=r.replace(/\\/g,"/")),this.matches[e][r]=!0}};x.prototype._stat=function(r){var e=this._makeAbs(r),t=r.slice(-1)==="/";if(r.length>this.maxLength)return!1;if(!this.stat&&qr(this.cache,e)){var s=this.cache[e];if(Array.isArray(s)&&(s="DIR"),!t||s==="DIR")return s;if(t&&s==="FILE")return!1}var n,i=this.statCache[e];if(!i){var o;try{o=Ge.lstatSync(e)}catch{return!1}if(o.isSymbolicLink())try{i=Ge.statSync(e)}catch{i=o}else i=o}this.statCache[e]=i;var s=i.isDirectory()?"DIR":"FILE";return this.cache[e]=this.cache[e]||s,t&&s!=="DIR"?!1:s};x.prototype._mark=function(r){return fe.mark(this,r)};x.prototype._makeAbs=function(r){return fe.makeAbs(this,r)}});var zr=S((fu,bn)=>{bn.exports=En;function En(r,e){if(r&&e)return En(r)(e);if(typeof r!="function")throw new TypeError("need wrapper function");return Object.keys(r).forEach(function(n){t[n]=r[n]}),t;function t(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var o=r.apply(this,n),s=n[n.length-1];return typeof o=="function"&&o!==s&&Object.keys(s).forEach(function(a){o[a]=s[a]}),o}}});var $r=S((hu,Wr)=>{var On=zr();Wr.exports=On(fr);Wr.exports.strict=On(Cn);fr.proto=fr(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return fr(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return Cn(this)},configurable:!0})});function fr(r){var e=function(){return e.called?e.value:(e.called=!0,e.value=r.apply(this,arguments))};return e.called=!1,e}function Cn(r){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=r.apply(this,arguments)},t=r.name||"Function wrapped with `once`";return e.onceError=t+" shouldn't be called more than once",e.called=!1,e}});var Rn=S((du,An)=>{var fs=zr(),qe=Object.create(null),hs=$r();An.exports=fs(ds);function ds(r,e){return qe[r]?(qe[r].push(e),null):(qe[r]=[e],vs(r))}function vs(r){return hs(function e(){var t=qe[r],n=t.length,i=gs(arguments);try{for(var o=0;o<n;o++)t[o].apply(null,i)}finally{t.length>n?(t.splice(0,n),process.nextTick(function(){e.apply(null,i)})):delete qe[r]}})}function gs(r){for(var e=r.length,t=[],n=0;n<e;n++)t[n]=r[n];return t}});var Ur=S((yu,Mn)=>{Mn.exports=ge;var Ue=require("fs"),kn=ar(),vu=kn.Minimatch,ms=cn(),ps=require("events").EventEmitter,Vr=require("path"),Qr=require("assert"),hr=lr(),Yr=wn(),oe=Br(),gu=oe.alphasort,mu=oe.alphasorti,ys=oe.setopts,Jr=oe.ownProp,Xr=Rn(),pu=require("util"),_s=oe.childrenIgnored,Ss=oe.isIgnored,ws=$r();function ge(r,e,t){if(typeof e=="function"&&(t=e,e={}),e||(e={}),e.sync){if(t)throw new TypeError("callback provided to sync glob");return Yr(r,e)}return new R(r,e,t)}ge.sync=Yr;var Es=ge.GlobSync=Yr.GlobSync;ge.glob=ge;function bs(r,e){if(e===null||typeof e!="object")return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r}ge.hasMagic=function(r,e){var t=bs({},e);t.noprocess=!0;var n=new R(r,t),i=n.minimatch.set;if(i.length>1)return!0;for(var o=0;o<i[0].length;o++)if(typeof i[0][o]!="string")return!0;return!1};ge.Glob=R;ms(R,ps);function R(r,e,t){if(typeof e=="function"&&(t=e,e=null),e&&e.sync){if(t)throw new TypeError("callback provided to sync glob");return new Es(r,e)}if(!(this instanceof R))return new R(r,e,t);ys(this,r,e),this._didRealPath=!1;var i=this.minimatch.set.length;this.matches=new Array(i),typeof t=="function"&&(t=ws(t),this.on("error",t),this.on("end",function(a){t(null,a)}));var n=this,i=this.minimatch.set.length;if(this._processing=0,this.matches=new Array(i),this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(i===0)return s();for(var o=0;o<i;o++)this._process(this.minimatch.set[o],o,!1,s);function s(){--n._processing,n._processing<=0&&n._finish()}}R.prototype._finish=function(){if(Qr(this instanceof R),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();oe.finish(this),this.emit("end",this.found)}};R.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=!0;var r=this.matches.length;if(r===0)return this._finish();for(var e=this,t=0;t<this.matches.length;t++)this._realpathSet(t,n);function n(){--r===0&&e._finish()}};R.prototype._realpathSet=function(r,e){var t=this.matches[r];if(!t)return e();var n=Object.keys(t),i=this,o=n.length;if(o===0)return e();var s=this.matches[r]=Object.create(null);n.forEach(function(a,u){a=i._makeAbs(a),Ue.realpath(a,i.realpathCache,function(l,c){l?l.syscall==="stat"?s[a]=!0:i.emit("error",l):s[c]=!0,--o===0&&(i.matches[r]=s,e())})})};R.prototype._mark=function(r){return oe.mark(this,r)};R.prototype._makeAbs=function(r){return oe.makeAbs(this,r)};R.prototype.abort=function(){this.aborted=!0,this.emit("abort")};R.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))};R.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var r=this._emitQueue.slice(0);this._emitQueue.length=0;for(var e=0;e<r.length;e++){var t=r[e];this._emitMatch(t[0],t[1])}}if(this._processQueue.length){var n=this._processQueue.slice(0);this._processQueue.length=0;for(var e=0;e<n.length;e++){var i=n[e];this._processing--,this._process(i[0],i[1],i[2],i[3])}}}};R.prototype._process=function(r,e,t,n){if(Qr(this instanceof R),Qr(typeof n=="function"),!this.aborted){if(this._processing++,this.paused){this._processQueue.push([r,e,t,n]);return}for(var i=0;typeof r[i]=="string";)i++;var o;switch(i){case r.length:this._processSimple(r.join("/"),e,n);return;case 0:o=null;break;default:o=r.slice(0,i).join("/");break}var s=r.slice(i),a;o===null?a=".":((hr(o)||hr(r.join("/")))&&(!o||!hr(o))&&(o="/"+o),a=o);var u=this._makeAbs(a);if(_s(this,a))return n();var l=s[0]===kn.GLOBSTAR;l?this._processGlobStar(o,a,u,s,e,t,n):this._processReaddir(o,a,u,s,e,t,n)}};R.prototype._processReaddir=function(r,e,t,n,i,o,s){var a=this;this._readdir(t,o,function(u,l){return a._processReaddir2(r,e,t,n,i,o,l,s)})};R.prototype._processReaddir2=function(r,e,t,n,i,o,s,a){if(!s)return a();for(var u=n[0],l=!!this.minimatch.negate,c=u._glob,v=this.dot||c.charAt(0)===".",f=[],h=0;h<s.length;h++){var d=s[h];if(d.charAt(0)!=="."||v){var m;l&&!r?m=!d.match(u):m=d.match(u),m&&f.push(d)}}var k=f.length;if(k===0)return a();if(n.length===1&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(var h=0;h<k;h++){var d=f[h];r&&(r!=="/"?d=r+"/"+d:d=r+d),d.charAt(0)==="/"&&!this.nomount&&(d=Vr.join(this.root,d)),this._emitMatch(i,d)}return a()}n.shift();for(var h=0;h<k;h++){var d=f[h],p;r&&(r!=="/"?d=r+"/"+d:d=r+d),this._process([d].concat(n),i,o,a)}a()};R.prototype._emitMatch=function(r,e){if(!this.aborted&&!this.matches[r][e]&&!Ss(this,e)){if(this.paused){this._emitQueue.push([r,e]);return}var t=this._makeAbs(e);if(this.nodir){var n=this.cache[t];if(n==="DIR"||Array.isArray(n))return}this.mark&&(e=this._mark(e)),this.matches[r][e]=!0;var i=this.statCache[t];i&&this.emit("stat",e,i),this.emit("match",e)}};R.prototype._readdirInGlobStar=function(r,e){if(this.aborted)return;if(this.follow)return this._readdir(r,!1,e);var t="lstat\0"+r,n=this,i=Xr(t,o);i&&Ue.lstat(r,i);function o(s,a){if(s)return e();var u=a.isSymbolicLink();n.symlinks[r]=u,!u&&!a.isDirectory()?(n.cache[r]="FILE",e()):n._readdir(r,!1,e)}};R.prototype._readdir=function(r,e,t){if(!this.aborted&&(t=Xr("readdir\0"+r+"\0"+e,t),!!t)){if(e&&!Jr(this.symlinks,r))return this._readdirInGlobStar(r,t);if(Jr(this.cache,r)){var n=this.cache[r];if(!n||n==="FILE")return t();if(Array.isArray(n))return t(null,n)}var i=this;Ue.readdir(r,Os(this,r,t))}};function Os(r,e,t){return function(n,i){n?r._readdirError(e,n,t):r._readdirEntries(e,i,t)}}R.prototype._readdirEntries=function(r,e,t){if(!this.aborted){if(!this.mark&&!this.stat)for(var n=0;n<e.length;n++){var i=e[n];r==="/"?i=r+i:i=r+"/"+i,this.cache[i]=!0}return this.cache[r]=e,t(null,e)}};R.prototype._readdirError=function(r,e,t){if(!this.aborted){switch(e.code){case"ENOTSUP":case"ENOTDIR":this.cache[this._makeAbs(r)]="FILE";break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(r)]=!1;break;default:this.cache[this._makeAbs(r)]=!1,this.strict&&(this.emit("error",e),this.abort()),this.silent||console.error("glob error",e);break}return t()}};R.prototype._processGlobStar=function(r,e,t,n,i,o,s){var a=this;this._readdir(t,o,function(u,l){a._processGlobStar2(r,e,t,n,i,o,l,s)})};R.prototype._processGlobStar2=function(r,e,t,n,i,o,s,a){if(!s)return a();var u=n.slice(1),l=r?[r]:[],c=l.concat(u);this._process(c,i,!1,a);var v=this.symlinks[t],f=s.length;if(v&&o)return a();for(var h=0;h<f;h++){var d=s[h];if(!(d.charAt(0)==="."&&!this.dot)){var m=l.concat(s[h],u);this._process(m,i,!0,a);var k=l.concat(s[h],n);this._process(k,i,!0,a)}}a()};R.prototype._processSimple=function(r,e,t){var n=this;this._stat(r,function(i,o){n._processSimple2(r,e,i,o,t)})};R.prototype._processSimple2=function(r,e,t,n,i){if(this.matches[e]||(this.matches[e]=Object.create(null)),!n)return i();if(r&&hr(r)&&!this.nomount){var o=/[\/\\]$/.test(r);r.charAt(0)==="/"?r=Vr.join(this.root,r):(r=Vr.resolve(this.root,r),o&&(r+="/"))}process.platform==="win32"&&(r=r.replace(/\\/g,"/")),this._emitMatch(e,r),i()};R.prototype._stat=function(r,e){var t=this._makeAbs(r),n=r.slice(-1)==="/";if(r.length>this.maxLength)return e();if(!this.stat&&Jr(this.cache,t)){var i=this.cache[t];if(Array.isArray(i)&&(i="DIR"),!n||i==="DIR")return e(null,i);if(n&&i==="FILE")return e()}var o,s=this.statCache[t];if(s!==void 0){if(s===!1)return e(null,s);var a=s.isDirectory()?"DIR":"FILE";return n&&a==="FILE"?e():e(null,a,s)}var u=this,l=Xr("stat\0"+t,c);l&&Ue.lstat(t,l);function c(v,f){if(f&&f.isSymbolicLink())return Ue.stat(t,function(h,d){h?u._stat2(r,t,null,f,e):u._stat2(r,t,h,d,e)});u._stat2(r,t,v,f,e)}};R.prototype._stat2=function(r,e,t,n,i){if(t)return this.statCache[e]=!1,i();var o=r.slice(-1)==="/";if(this.statCache[e]=n,e.slice(-1)==="/"&&!n.isDirectory())return i(null,!1,n);var s=n.isDirectory()?"DIR":"FILE";return this.cache[e]=this.cache[e]||s,o&&s!=="DIR"?i():i(null,s,n)}});var xn=S((_u,In)=>{In.exports=et;et.sync=jn;var A=require("assert"),Ln=require("path"),gr=require("fs"),mr=Ur(),Tn={nosort:!0,nocomment:!0,nonegate:!0,silent:!0},Zr=0,Hr=process.platform==="win32";function Nn(r){var e=["unlink","chmod","stat","lstat","rmdir","readdir"];e.forEach(function(t){r[t]=r[t]||gr[t],t=t+"Sync",r[t]=r[t]||gr[t]}),r.maxBusyTries=r.maxBusyTries||3,r.emfileWait=r.emfileWait||1e3,r.disableGlob=r.disableGlob||!1}function et(r,e,t){typeof e=="function"&&(t=e,e={}),A(r,"rimraf: missing path"),A.equal(typeof r,"string","rimraf: path should be a string"),A(e,"rimraf: missing options"),A.equal(typeof e,"object","rimraf: options should be object"),A.equal(typeof t,"function","rimraf: callback function required"),Nn(e);var n=0,i=null,o=0;if(e.disableGlob||!mr.hasMagic(r))return a(null,[r]);gr.lstat(r,function(u,l){if(!u)return a(null,[r]);mr(r,Tn,a)});function s(u){i=i||u,--o===0&&t(i)}function a(u,l){if(u)return t(u);if(o=l.length,o===0)return t();l.forEach(function(c){Kr(c,e,function v(f){if(f){if(Hr&&(f.code==="EBUSY"||f.code==="ENOTEMPTY"||f.code==="EPERM")&&n<e.maxBusyTries){n++;var h=n*100;return setTimeout(function(){Kr(c,e,v)},h)}if(f.code==="EMFILE"&&Zr<e.emfileWait)return setTimeout(function(){Kr(c,e,v)},Zr++);f.code==="ENOENT"&&(f=null)}Zr=0,s(f)})})}}function Kr(r,e,t){A(r),A(e),A(typeof t=="function"),e.lstat(r,function(n,i){if(n&&n.code==="ENOENT")return t(null);if(i&&i.isDirectory())return dr(r,e,n,t);e.unlink(r,function(o){if(o){if(o.code==="ENOENT")return t(null);if(o.code==="EPERM")return Hr?Cs(r,e,o,t):dr(r,e,o,t);if(o.code==="EISDIR")return dr(r,e,o,t)}return t(o)})})}function Cs(r,e,t,n){A(r),A(e),A(typeof n=="function"),t&&A(t instanceof Error),e.chmod(r,666,function(i){i?n(i.code==="ENOENT"?null:t):e.stat(r,function(o,s){o?n(o.code==="ENOENT"?null:t):s.isDirectory()?dr(r,e,t,n):e.unlink(r,n)})})}function As(r,e,t){A(r),A(e),t&&A(t instanceof Error);try{e.chmodSync(r,666)}catch(i){if(i.code==="ENOENT")return;throw t}try{var n=e.statSync(r)}catch(i){if(i.code==="ENOENT")return;throw t}n.isDirectory()?vr(r,e,t):e.unlinkSync(r)}function dr(r,e,t,n){A(r),A(e),t&&A(t instanceof Error),A(typeof n=="function"),e.rmdir(r,function(i){i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")?Rs(r,e,n):i&&i.code==="ENOTDIR"?n(t):n(i)})}function Rs(r,e,t){A(r),A(e),A(typeof t=="function"),e.readdir(r,function(n,i){if(n)return t(n);var o=i.length;if(o===0)return e.rmdir(r,t);var s;i.forEach(function(a){et(Ln.join(r,a),e,function(u){if(!s){if(u)return t(s=u);--o===0&&e.rmdir(r,t)}})})})}function jn(r,e){e=e||{},Nn(e),A(r,"rimraf: missing path"),A.equal(typeof r,"string","rimraf: path should be a string"),A(e,"rimraf: missing options"),A.equal(typeof e,"object","rimraf: options should be object");var t;if(e.disableGlob||!mr.hasMagic(r))t=[r];else try{gr.lstatSync(r),t=[r]}catch{t=mr.sync(r,Tn)}if(t.length)for(var n=0;n<t.length;n++){var r=t[n];try{var i=e.lstatSync(r)}catch(s){if(s.code==="ENOENT")return}try{i&&i.isDirectory()?vr(r,e,null):e.unlinkSync(r)}catch(s){if(s.code==="ENOENT")return;if(s.code==="EPERM")return Hr?As(r,e,s):vr(r,e,s);if(s.code!=="EISDIR")throw s;vr(r,e,s)}}}function vr(r,e,t){A(r),A(e),t&&A(t instanceof Error);try{e.rmdirSync(r)}catch(n){if(n.code==="ENOENT")return;if(n.code==="ENOTDIR")throw t;(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")&&ks(r,e)}}function ks(r,e){A(r),A(e),e.readdirSync(r).forEach(function(t){jn(Ln.join(r,t),e)}),e.rmdirSync(r,e)}});var Bn=S((Su,Fn)=>{var ze=require("path"),Dn=require("fs"),Pn=parseInt("0777",8);Fn.exports=Oe.mkdirp=Oe.mkdirP=Oe;function Oe(r,e,t,n){typeof e=="function"?(t=e,e={}):(!e||typeof e!="object")&&(e={mode:e});var i=e.mode,o=e.fs||Dn;i===void 0&&(i=Pn),n||(n=null);var s=t||function(){};r=ze.resolve(r),o.mkdir(r,i,function(a){if(!a)return n=n||r,s(null,n);switch(a.code){case"ENOENT":if(ze.dirname(r)===r)return s(a);Oe(ze.dirname(r),e,function(u,l){u?s(u,l):Oe(r,e,s,l)});break;default:o.stat(r,function(u,l){u||!l.isDirectory()?s(a,n):s(null,n)});break}})}Oe.sync=function r(e,t,n){(!t||typeof t!="object")&&(t={mode:t});var i=t.mode,o=t.fs||Dn;i===void 0&&(i=Pn),n||(n=null),e=ze.resolve(e);try{o.mkdirSync(e,i),n=n||e}catch(a){switch(a.code){case"ENOENT":n=r(ze.dirname(e),t,n),r(e,t,n);break;default:var s;try{s=o.statSync(e)}catch{throw a}if(!s.isDirectory())throw a;break}}return n}});var Wn=S((wu,zn)=>{var Ce=require("fs"),Ms=qt().ncp,Ls=require("path"),Gn=xn(),Ts=Bn();zn.exports=Ns;function Ns(r,e,t,n){typeof t=="function"&&(n=t,t={});var i=!!t.mkdirp,o=t.clobber!==!1,s=t.limit||16;i?a():u();function a(){Ts(Ls.dirname(e),function(l){if(l)return n(l);u()})}function u(){o?Ce.rename(r,e,function(l){if(!l)return n();if(l.code!=="EXDEV")return n(l);qn(r,e,o,s,n)}):Ce.link(r,e,function(l){if(l){if(l.code==="EXDEV"){qn(r,e,o,s,n);return}if(l.code==="EISDIR"||l.code==="EPERM"){Un(r,e,o,s,n);return}n(l);return}Ce.unlink(r,n)})}}function qn(r,e,t,n,i){var o=t?"w":"wx",s=Ce.createReadStream(r),a=Ce.createWriteStream(e,{flags:o});s.on("error",function(l){s.destroy(),a.destroy(),a.removeListener("close",u),l.code==="EISDIR"||l.code==="EPERM"?Un(r,e,t,n,i):i(l)}),a.on("error",function(l){s.destroy(),a.destroy(),a.removeListener("close",u),i(l)}),a.once("close",u),s.pipe(a);function u(){Ce.unlink(r,i)}}function Un(r,e,t,n,i){var o={stopOnErr:!0,clobber:!1,limit:n};t?Gn(e,{disableGlob:!0},function(a){if(a)return i(a);s()}):s();function s(){Ms(r,e,o,function(a){if(a)return i(a[0]);Gn(r,{disableGlob:!0},i)})}}});var Vn=S(rt=>{var $n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");rt.encode=function(r){if(0<=r&&r<$n.length)return $n[r];throw new TypeError("Must be between 0 and 63: "+r)};rt.decode=function(r){var e=65,t=90,n=97,i=122,o=48,s=57,a=43,u=47,l=26,c=52;return e<=r&&r<=t?r-e:n<=r&&r<=i?r-n+l:o<=r&&r<=s?r-o+c:r==a?62:r==u?63:-1}});var it=S(nt=>{var Qn=Vn(),tt=5,Jn=1<<tt,Yn=Jn-1,Xn=Jn;function js(r){return r<0?(-r<<1)+1:(r<<1)+0}function Is(r){var e=(r&1)===1,t=r>>1;return e?-t:t}nt.encode=function(e){var t="",n,i=js(e);do n=i&Yn,i>>>=tt,i>0&&(n|=Xn),t+=Qn.encode(n);while(i>0);return t};nt.decode=function(e,t,n){var i=e.length,o=0,s=0,a,u;do{if(t>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(u=Qn.decode(e.charCodeAt(t++)),u===-1)throw new Error("Invalid base64 digit: "+e.charAt(t-1));a=!!(u&Xn),u&=Yn,o=o+(u<<s),s+=tt}while(a);n.value=Is(o),n.rest=t}});var ke=S(G=>{function xs(r,e,t){if(e in r)return r[e];if(arguments.length===3)return t;throw new Error('"'+e+'" is a required argument.')}G.getArg=xs;var Zn=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Ds=/^data:.+\,.+$/;function We(r){var e=r.match(Zn);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}G.urlParse=We;function Ae(r){var e="";return r.scheme&&(e+=r.scheme+":"),e+="//",r.auth&&(e+=r.auth+"@"),r.host&&(e+=r.host),r.port&&(e+=":"+r.port),r.path&&(e+=r.path),e}G.urlGenerate=Ae;function ot(r){var e=r,t=We(r);if(t){if(!t.path)return r;e=t.path}for(var n=G.isAbsolute(e),i=e.split(/\/+/),o,s=0,a=i.length-1;a>=0;a--)o=i[a],o==="."?i.splice(a,1):o===".."?s++:s>0&&(o===""?(i.splice(a+1,s),s=0):(i.splice(a,2),s--));return e=i.join("/"),e===""&&(e=n?"/":"."),t?(t.path=e,Ae(t)):e}G.normalize=ot;function Kn(r,e){r===""&&(r="."),e===""&&(e=".");var t=We(e),n=We(r);if(n&&(r=n.path||"/"),t&&!t.scheme)return n&&(t.scheme=n.scheme),Ae(t);if(t||e.match(Ds))return e;if(n&&!n.host&&!n.path)return n.host=e,Ae(n);var i=e.charAt(0)==="/"?e:ot(r.replace(/\/+$/,"")+"/"+e);return n?(n.path=i,Ae(n)):i}G.join=Kn;G.isAbsolute=function(r){return r.charAt(0)==="/"||Zn.test(r)};function Ps(r,e){r===""&&(r="."),r=r.replace(/\/$/,"");for(var t=0;e.indexOf(r+"/")!==0;){var n=r.lastIndexOf("/");if(n<0||(r=r.slice(0,n),r.match(/^([^\/]+:\/)?\/*$/)))return e;++t}return Array(t+1).join("../")+e.substr(r.length+1)}G.relative=Ps;var Hn=function(){var r=Object.create(null);return!("__proto__"in r)}();function ei(r){return r}function Fs(r){return ri(r)?"$"+r:r}G.toSetString=Hn?ei:Fs;function Bs(r){return ri(r)?r.slice(1):r}G.fromSetString=Hn?ei:Bs;function ri(r){if(!r)return!1;var e=r.length;if(e<9||r.charCodeAt(e-1)!==95||r.charCodeAt(e-2)!==95||r.charCodeAt(e-3)!==111||r.charCodeAt(e-4)!==116||r.charCodeAt(e-5)!==111||r.charCodeAt(e-6)!==114||r.charCodeAt(e-7)!==112||r.charCodeAt(e-8)!==95||r.charCodeAt(e-9)!==95)return!1;for(var t=e-10;t>=0;t--)if(r.charCodeAt(t)!==36)return!1;return!0}function Gs(r,e,t){var n=Re(r.source,e.source);return n!==0||(n=r.originalLine-e.originalLine,n!==0)||(n=r.originalColumn-e.originalColumn,n!==0||t)||(n=r.generatedColumn-e.generatedColumn,n!==0)||(n=r.generatedLine-e.generatedLine,n!==0)?n:Re(r.name,e.name)}G.compareByOriginalPositions=Gs;function qs(r,e,t){var n=r.generatedLine-e.generatedLine;return n!==0||(n=r.generatedColumn-e.generatedColumn,n!==0||t)||(n=Re(r.source,e.source),n!==0)||(n=r.originalLine-e.originalLine,n!==0)||(n=r.originalColumn-e.originalColumn,n!==0)?n:Re(r.name,e.name)}G.compareByGeneratedPositionsDeflated=qs;function Re(r,e){return r===e?0:r===null?1:e===null?-1:r>e?1:-1}function Us(r,e){var t=r.generatedLine-e.generatedLine;return t!==0||(t=r.generatedColumn-e.generatedColumn,t!==0)||(t=Re(r.source,e.source),t!==0)||(t=r.originalLine-e.originalLine,t!==0)||(t=r.originalColumn-e.originalColumn,t!==0)?t:Re(r.name,e.name)}G.compareByGeneratedPositionsInflated=Us;function zs(r){return JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}G.parseSourceMapInput=zs;function Ws(r,e,t){if(e=e||"",r&&(r[r.length-1]!=="/"&&e[0]!=="/"&&(r+="/"),e=r+e),t){var n=We(t);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var i=n.path.lastIndexOf("/");i>=0&&(n.path=n.path.substring(0,i+1))}e=Kn(Ae(n),e)}return ot(e)}G.computeSourceURL=Ws});var ut=S(ti=>{var st=ke(),at=Object.prototype.hasOwnProperty,me=typeof Map<"u";function se(){this._array=[],this._set=me?new Map:Object.create(null)}se.fromArray=function(e,t){for(var n=new se,i=0,o=e.length;i<o;i++)n.add(e[i],t);return n};se.prototype.size=function(){return me?this._set.size:Object.getOwnPropertyNames(this._set).length};se.prototype.add=function(e,t){var n=me?e:st.toSetString(e),i=me?this.has(e):at.call(this._set,n),o=this._array.length;(!i||t)&&this._array.push(e),i||(me?this._set.set(e,o):this._set[n]=o)};se.prototype.has=function(e){if(me)return this._set.has(e);var t=st.toSetString(e);return at.call(this._set,t)};se.prototype.indexOf=function(e){if(me){var t=this._set.get(e);if(t>=0)return t}else{var n=st.toSetString(e);if(at.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};se.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};se.prototype.toArray=function(){return this._array.slice()};ti.ArraySet=se});var oi=S(ii=>{var ni=ke();function $s(r,e){var t=r.generatedLine,n=e.generatedLine,i=r.generatedColumn,o=e.generatedColumn;return n>t||n==t&&o>=i||ni.compareByGeneratedPositionsInflated(r,e)<=0}function pr(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}pr.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)};pr.prototype.add=function(e){$s(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};pr.prototype.toArray=function(){return this._sorted||(this._array.sort(ni.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};ii.MappingList=pr});var lt=S(si=>{var $e=it(),I=ke(),yr=ut().ArraySet,Vs=oi().MappingList;function Z(r){r||(r={}),this._file=I.getArg(r,"file",null),this._sourceRoot=I.getArg(r,"sourceRoot",null),this._skipValidation=I.getArg(r,"skipValidation",!1),this._sources=new yr,this._names=new yr,this._mappings=new Vs,this._sourcesContents=null}Z.prototype._version=3;Z.fromSourceMap=function(e){var t=e.sourceRoot,n=new Z({file:e.file,sourceRoot:t});return e.eachMapping(function(i){var o={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(o.source=i.source,t!=null&&(o.source=I.relative(t,o.source)),o.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(o.name=i.name)),n.addMapping(o)}),e.sources.forEach(function(i){var o=i;t!==null&&(o=I.relative(t,i)),n._sources.has(o)||n._sources.add(o);var s=e.sourceContentFor(i);s!=null&&n.setSourceContent(i,s)}),n};Z.prototype.addMapping=function(e){var t=I.getArg(e,"generated"),n=I.getArg(e,"original",null),i=I.getArg(e,"source",null),o=I.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,i,o),i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),o!=null&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:o})};Z.prototype.setSourceContent=function(e,t){var n=e;this._sourceRoot!=null&&(n=I.relative(this._sourceRoot,n)),t!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[I.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[I.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};Z.prototype.applySourceMap=function(e,t,n){var i=t;if(t==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=e.file}var o=this._sourceRoot;o!=null&&(i=I.relative(o,i));var s=new yr,a=new yr;this._mappings.unsortedForEach(function(u){if(u.source===i&&u.originalLine!=null){var l=e.originalPositionFor({line:u.originalLine,column:u.originalColumn});l.source!=null&&(u.source=l.source,n!=null&&(u.source=I.join(n,u.source)),o!=null&&(u.source=I.relative(o,u.source)),u.originalLine=l.line,u.originalColumn=l.column,l.name!=null&&(u.name=l.name))}var c=u.source;c!=null&&!s.has(c)&&s.add(c);var v=u.name;v!=null&&!a.has(v)&&a.add(v)},this),this._sources=s,this._names=a,e.sources.forEach(function(u){var l=e.sourceContentFor(u);l!=null&&(n!=null&&(u=I.join(n,u)),o!=null&&(u=I.relative(o,u)),this.setSourceContent(u,l))},this)};Z.prototype._validateMapping=function(e,t,n,i){if(t&&typeof t.line!="number"&&typeof t.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!t&&!n&&!i)){if(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:i}))}};Z.prototype._serializeMappings=function(){for(var e=0,t=1,n=0,i=0,o=0,s=0,a="",u,l,c,v,f=this._mappings.toArray(),h=0,d=f.length;h<d;h++){if(l=f[h],u="",l.generatedLine!==t)for(e=0;l.generatedLine!==t;)u+=";",t++;else if(h>0){if(!I.compareByGeneratedPositionsInflated(l,f[h-1]))continue;u+=","}u+=$e.encode(l.generatedColumn-e),e=l.generatedColumn,l.source!=null&&(v=this._sources.indexOf(l.source),u+=$e.encode(v-s),s=v,u+=$e.encode(l.originalLine-1-i),i=l.originalLine-1,u+=$e.encode(l.originalColumn-n),n=l.originalColumn,l.name!=null&&(c=this._names.indexOf(l.name),u+=$e.encode(c-o),o=c)),a+=u}return a};Z.prototype._generateSourcesContent=function(e,t){return e.map(function(n){if(!this._sourcesContents)return null;t!=null&&(n=I.relative(t,n));var i=I.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};Z.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};Z.prototype.toString=function(){return JSON.stringify(this.toJSON())};si.SourceMapGenerator=Z});var ai=S(pe=>{pe.GREATEST_LOWER_BOUND=1;pe.LEAST_UPPER_BOUND=2;function ct(r,e,t,n,i,o){var s=Math.floor((e-r)/2)+r,a=i(t,n[s],!0);return a===0?s:a>0?e-s>1?ct(s,e,t,n,i,o):o==pe.LEAST_UPPER_BOUND?e<n.length?e:-1:s:s-r>1?ct(r,s,t,n,i,o):o==pe.LEAST_UPPER_BOUND?s:r<0?-1:r}pe.search=function(e,t,n,i){if(t.length===0)return-1;var o=ct(-1,t.length,e,t,n,i||pe.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&n(t[o],t[o-1],!0)===0;)--o;return o}});var li=S(ui=>{function ft(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}function Qs(r,e){return Math.round(r+Math.random()*(e-r))}function ht(r,e,t,n){if(t<n){var i=Qs(t,n),o=t-1;ft(r,i,n);for(var s=r[n],a=t;a<n;a++)e(r[a],s)<=0&&(o+=1,ft(r,o,a));ft(r,o+1,a);var u=o+1;ht(r,e,t,u-1),ht(r,e,u+1,n)}}ui.quickSort=function(r,e){ht(r,e,0,r.length-1)}});var fi=S(_r=>{var g=ke(),dt=ai(),Me=ut().ArraySet,Js=it(),Ve=li().quickSort;function M(r,e){var t=r;return typeof r=="string"&&(t=g.parseSourceMapInput(r)),t.sections!=null?new re(t,e):new P(t,e)}M.fromSourceMap=function(r,e){return P.fromSourceMap(r,e)};M.prototype._version=3;M.prototype.__generatedMappings=null;Object.defineProperty(M.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});M.prototype.__originalMappings=null;Object.defineProperty(M.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});M.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return n===";"||n===","};M.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")};M.GENERATED_ORDER=1;M.ORIGINAL_ORDER=2;M.GREATEST_LOWER_BOUND=1;M.LEAST_UPPER_BOUND=2;M.prototype.eachMapping=function(e,t,n){var i=t||null,o=n||M.GENERATED_ORDER,s;switch(o){case M.GENERATED_ORDER:s=this._generatedMappings;break;case M.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var a=this.sourceRoot;s.map(function(u){var l=u.source===null?null:this._sources.at(u.source);return l=g.computeSourceURL(a,l,this._sourceMapURL),{source:l,generatedLine:u.generatedLine,generatedColumn:u.generatedColumn,originalLine:u.originalLine,originalColumn:u.originalColumn,name:u.name===null?null:this._names.at(u.name)}},this).forEach(e,i)};M.prototype.allGeneratedPositionsFor=function(e){var t=g.getArg(e,"line"),n={source:g.getArg(e,"source"),originalLine:t,originalColumn:g.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",g.compareByOriginalPositions,dt.LEAST_UPPER_BOUND);if(o>=0){var s=this._originalMappings[o];if(e.column===void 0)for(var a=s.originalLine;s&&s.originalLine===a;)i.push({line:g.getArg(s,"generatedLine",null),column:g.getArg(s,"generatedColumn",null),lastColumn:g.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++o];else for(var u=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==u;)i.push({line:g.getArg(s,"generatedLine",null),column:g.getArg(s,"generatedColumn",null),lastColumn:g.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++o]}return i};_r.SourceMapConsumer=M;function P(r,e){var t=r;typeof r=="string"&&(t=g.parseSourceMapInput(r));var n=g.getArg(t,"version"),i=g.getArg(t,"sources"),o=g.getArg(t,"names",[]),s=g.getArg(t,"sourceRoot",null),a=g.getArg(t,"sourcesContent",null),u=g.getArg(t,"mappings"),l=g.getArg(t,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=g.normalize(s)),i=i.map(String).map(g.normalize).map(function(c){return s&&g.isAbsolute(s)&&g.isAbsolute(c)?g.relative(s,c):c}),this._names=Me.fromArray(o.map(String),!0),this._sources=Me.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(c){return g.computeSourceURL(s,c,e)}),this.sourceRoot=s,this.sourcesContent=a,this._mappings=u,this._sourceMapURL=e,this.file=l}P.prototype=Object.create(M.prototype);P.prototype.consumer=M;P.prototype._findSourceIndex=function(r){var e=r;if(this.sourceRoot!=null&&(e=g.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var t;for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==r)return t;return-1};P.fromSourceMap=function(e,t){var n=Object.create(P.prototype),i=n._names=Me.fromArray(e._names.toArray(),!0),o=n._sources=Me.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=t,n._absoluteSources=n._sources.toArray().map(function(h){return g.computeSourceURL(n.sourceRoot,h,t)});for(var s=e._mappings.toArray().slice(),a=n.__generatedMappings=[],u=n.__originalMappings=[],l=0,c=s.length;l<c;l++){var v=s[l],f=new ci;f.generatedLine=v.generatedLine,f.generatedColumn=v.generatedColumn,v.source&&(f.source=o.indexOf(v.source),f.originalLine=v.originalLine,f.originalColumn=v.originalColumn,v.name&&(f.name=i.indexOf(v.name)),u.push(f)),a.push(f)}return Ve(n.__originalMappings,g.compareByOriginalPositions),n};P.prototype._version=3;Object.defineProperty(P.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function ci(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}P.prototype._parseMappings=function(e,t){for(var n=1,i=0,o=0,s=0,a=0,u=0,l=e.length,c=0,v={},f={},h=[],d=[],m,k,p,_,j;c<l;)if(e.charAt(c)===";")n++,c++,i=0;else if(e.charAt(c)===",")c++;else{for(m=new ci,m.generatedLine=n,_=c;_<l&&!this._charIsMappingSeparator(e,_);_++);if(k=e.slice(c,_),p=v[k],p)c+=k.length;else{for(p=[];c<_;)Js.decode(e,c,f),j=f.value,c=f.rest,p.push(j);if(p.length===2)throw new Error("Found a source, but no line and column");if(p.length===3)throw new Error("Found a source and line, but no column");v[k]=p}m.generatedColumn=i+p[0],i=m.generatedColumn,p.length>1&&(m.source=a+p[1],a+=p[1],m.originalLine=o+p[2],o=m.originalLine,m.originalLine+=1,m.originalColumn=s+p[3],s=m.originalColumn,p.length>4&&(m.name=u+p[4],u+=p[4])),d.push(m),typeof m.originalLine=="number"&&h.push(m)}Ve(d,g.compareByGeneratedPositionsDeflated),this.__generatedMappings=d,Ve(h,g.compareByOriginalPositions),this.__originalMappings=h};P.prototype._findMapping=function(e,t,n,i,o,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[i]);return dt.search(e,t,o,s)};P.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}};P.prototype.originalPositionFor=function(e){var t={generatedLine:g.getArg(e,"line"),generatedColumn:g.getArg(e,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",g.compareByGeneratedPositionsDeflated,g.getArg(e,"bias",M.GREATEST_LOWER_BOUND));if(n>=0){var i=this._generatedMappings[n];if(i.generatedLine===t.generatedLine){var o=g.getArg(i,"source",null);o!==null&&(o=this._sources.at(o),o=g.computeSourceURL(this.sourceRoot,o,this._sourceMapURL));var s=g.getArg(i,"name",null);return s!==null&&(s=this._names.at(s)),{source:o,line:g.getArg(i,"originalLine",null),column:g.getArg(i,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}};P.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};P.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var i=e;this.sourceRoot!=null&&(i=g.relative(this.sourceRoot,i));var o;if(this.sourceRoot!=null&&(o=g.urlParse(this.sourceRoot))){var s=i.replace(/^file:\/\//,"");if(o.scheme=="file"&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!o.path||o.path=="/")&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(t)return null;throw new Error('"'+i+'" is not in the SourceMap.')};P.prototype.generatedPositionFor=function(e){var t=g.getArg(e,"source");if(t=this._findSourceIndex(t),t<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:g.getArg(e,"line"),originalColumn:g.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",g.compareByOriginalPositions,g.getArg(e,"bias",M.GREATEST_LOWER_BOUND));if(i>=0){var o=this._originalMappings[i];if(o.source===n.source)return{line:g.getArg(o,"generatedLine",null),column:g.getArg(o,"generatedColumn",null),lastColumn:g.getArg(o,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};_r.BasicSourceMapConsumer=P;function re(r,e){var t=r;typeof r=="string"&&(t=g.parseSourceMapInput(r));var n=g.getArg(t,"version"),i=g.getArg(t,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new Me,this._names=new Me;var o={line:-1,column:0};this._sections=i.map(function(s){if(s.url)throw new Error("Support for url field in sections not implemented.");var a=g.getArg(s,"offset"),u=g.getArg(a,"line"),l=g.getArg(a,"column");if(u<o.line||u===o.line&&l<o.column)throw new Error("Section offsets must be ordered and non-overlapping.");return o=a,{generatedOffset:{generatedLine:u+1,generatedColumn:l+1},consumer:new M(g.getArg(s,"map"),e)}})}re.prototype=Object.create(M.prototype);re.prototype.constructor=M;re.prototype._version=3;Object.defineProperty(re.prototype,"sources",{get:function(){for(var r=[],e=0;e<this._sections.length;e++)for(var t=0;t<this._sections[e].consumer.sources.length;t++)r.push(this._sections[e].consumer.sources[t]);return r}});re.prototype.originalPositionFor=function(e){var t={generatedLine:g.getArg(e,"line"),generatedColumn:g.getArg(e,"column")},n=dt.search(t,this._sections,function(o,s){var a=o.generatedLine-s.generatedOffset.generatedLine;return a||o.generatedColumn-s.generatedOffset.generatedColumn}),i=this._sections[n];return i?i.consumer.originalPositionFor({line:t.generatedLine-(i.generatedOffset.generatedLine-1),column:t.generatedColumn-(i.generatedOffset.generatedLine===t.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};re.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};re.prototype.sourceContentFor=function(e,t){for(var n=0;n<this._sections.length;n++){var i=this._sections[n],o=i.consumer.sourceContentFor(e,!0);if(o)return o}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')};re.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(n.consumer._findSourceIndex(g.getArg(e,"source"))!==-1){var i=n.consumer.generatedPositionFor(e);if(i){var o={line:i.line+(n.generatedOffset.generatedLine-1),column:i.column+(n.generatedOffset.generatedLine===i.line?n.generatedOffset.generatedColumn-1:0)};return o}}}return{line:null,column:null}};re.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var i=this._sections[n],o=i.consumer._generatedMappings,s=0;s<o.length;s++){var a=o[s],u=i.consumer._sources.at(a.source);u=g.computeSourceURL(i.consumer.sourceRoot,u,this._sourceMapURL),this._sources.add(u),u=this._sources.indexOf(u);var l=null;a.name&&(l=i.consumer._names.at(a.name),this._names.add(l),l=this._names.indexOf(l));var c={source:u,generatedLine:a.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(i.generatedOffset.generatedLine===a.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:l};this.__generatedMappings.push(c),typeof c.originalLine=="number"&&this.__originalMappings.push(c)}Ve(this.__generatedMappings,g.compareByGeneratedPositionsDeflated),Ve(this.__originalMappings,g.compareByOriginalPositions)};_r.IndexedSourceMapConsumer=re});var di=S(hi=>{var Ys=lt().SourceMapGenerator,Sr=ke(),Xs=/(\r?\n)/,Zs=10,Le="$$$isSourceNode$$$";function J(r,e,t,n,i){this.children=[],this.sourceContents={},this.line=r??null,this.column=e??null,this.source=t??null,this.name=i??null,this[Le]=!0,n!=null&&this.add(n)}J.fromStringWithSourceMap=function(e,t,n){var i=new J,o=e.split(Xs),s=0,a=function(){var f=d(),h=d()||"";return f+h;function d(){return s<o.length?o[s++]:void 0}},u=1,l=0,c=null;return t.eachMapping(function(f){if(c!==null)if(u<f.generatedLine)v(c,a()),u++,l=0;else{var h=o[s]||"",d=h.substr(0,f.generatedColumn-l);o[s]=h.substr(f.generatedColumn-l),l=f.generatedColumn,v(c,d),c=f;return}for(;u<f.generatedLine;)i.add(a()),u++;if(l<f.generatedColumn){var h=o[s]||"";i.add(h.substr(0,f.generatedColumn)),o[s]=h.substr(f.generatedColumn),l=f.generatedColumn}c=f},this),s<o.length&&(c&&v(c,a()),i.add(o.splice(s).join(""))),t.sources.forEach(function(f){var h=t.sourceContentFor(f);h!=null&&(n!=null&&(f=Sr.join(n,f)),i.setSourceContent(f,h))}),i;function v(f,h){if(f===null||f.source===void 0)i.add(h);else{var d=n?Sr.join(n,f.source):f.source;i.add(new J(f.originalLine,f.originalColumn,d,h,f.name))}}};J.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(t){this.add(t)},this);else if(e[Le]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};J.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else if(e[Le]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};J.prototype.walk=function(e){for(var t,n=0,i=this.children.length;n<i;n++)t=this.children[n],t[Le]?t.walk(e):t!==""&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})};J.prototype.join=function(e){var t,n,i=this.children.length;if(i>0){for(t=[],n=0;n<i-1;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this};J.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[Le]?n.replaceRight(e,t):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this};J.prototype.setSourceContent=function(e,t){this.sourceContents[Sr.toSetString(e)]=t};J.prototype.walkSourceContents=function(e){for(var t=0,n=this.children.length;t<n;t++)this.children[t][Le]&&this.children[t].walkSourceContents(e);for(var i=Object.keys(this.sourceContents),t=0,n=i.length;t<n;t++)e(Sr.fromSetString(i[t]),this.sourceContents[i[t]])};J.prototype.toString=function(){var e="";return this.walk(function(t){e+=t}),e};J.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},n=new Ys(e),i=!1,o=null,s=null,a=null,u=null;return this.walk(function(l,c){t.code+=l,c.source!==null&&c.line!==null&&c.column!==null?((o!==c.source||s!==c.line||a!==c.column||u!==c.name)&&n.addMapping({source:c.source,original:{line:c.line,column:c.column},generated:{line:t.line,column:t.column},name:c.name}),o=c.source,s=c.line,a=c.column,u=c.name,i=!0):i&&(n.addMapping({generated:{line:t.line,column:t.column}}),o=null,i=!1);for(var v=0,f=l.length;v<f;v++)l.charCodeAt(v)===Zs?(t.line++,t.column=0,v+1===f?(o=null,i=!1):i&&n.addMapping({source:c.source,original:{line:c.line,column:c.column},generated:{line:t.line,column:t.column},name:c.name})):t.column++}),this.walkSourceContents(function(l,c){n.setSourceContent(l,c)}),{code:t.code,map:n}};hi.SourceNode=J});var vi=S(wr=>{wr.SourceMapGenerator=lt().SourceMapGenerator;wr.SourceMapConsumer=fi().SourceMapConsumer;wr.SourceNode=di().SourceNode});var mi=S((ju,gi)=>{var Ks=Object.prototype.toString,vt=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function Hs(r){return Ks.call(r).slice(8,-1)==="ArrayBuffer"}function ea(r,e,t){e>>>=0;var n=r.byteLength-e;if(n<0)throw new RangeError("'offset' is out of bounds");if(t===void 0)t=n;else if(t>>>=0,t>n)throw new RangeError("'length' is out of bounds");return vt?Buffer.from(r.slice(e,e+t)):new Buffer(new Uint8Array(r.slice(e,e+t)))}function ra(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return vt?Buffer.from(r,e):new Buffer(r,e)}function ta(r,e,t){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return Hs(r)?ea(r,e,t):typeof r=="string"?ra(r,e):vt?Buffer.from(r):new Buffer(r)}gi.exports=ta});var Oi=S((_e,yt)=>{var na=vi().SourceMapConsumer,gt=require("path"),ie;try{ie=require("fs"),(!ie.existsSync||!ie.readFileSync)&&(ie=null)}catch{}var ia=mi();function pi(r,e){return r.require(e)}var yi=!1,_i=!1,mt=!1,Qe="auto",ye={},Je={},oa=/^data:application\/json[^,]+base64,/,he=[],de=[];function _t(){return Qe==="browser"?!0:Qe==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function sa(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}function aa(){return typeof process=="object"&&process!==null?process.version:""}function ua(){if(typeof process=="object"&&process!==null)return process.stderr}function la(r){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(r)}function Er(r){return function(e){for(var t=0;t<r.length;t++){var n=r[t](e);if(n)return n}return null}}var St=Er(he);he.push(function(r){if(r=r.trim(),/^file:/.test(r)&&(r=r.replace(/file:\/\/\/(\w:)?/,function(n,i){return i?"":"/"})),r in ye)return ye[r];var e="";try{if(ie)ie.existsSync(r)&&(e=ie.readFileSync(r,"utf8"));else{var t=new XMLHttpRequest;t.open("GET",r,!1),t.send(null),t.readyState===4&&t.status===200&&(e=t.responseText)}}catch{}return ye[r]=e});function pt(r,e){if(!r)return e;var t=gt.dirname(r),n=/^\w+:\/\/[^\/]*/.exec(t),i=n?n[0]:"",o=t.slice(i.length);return i&&/^\/\w\:/.test(o)?(i+="/",i+gt.resolve(t.slice(i.length),e).replace(/\\/g,"/")):i+gt.resolve(t.slice(i.length),e)}function ca(r){var e;if(_t())try{var t=new XMLHttpRequest;t.open("GET",r,!1),t.send(null),e=t.readyState===4?t.responseText:null;var n=t.getResponseHeader("SourceMap")||t.getResponseHeader("X-SourceMap");if(n)return n}catch{}e=St(r);for(var i=/(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg,o,s;s=i.exec(e);)o=s;return o?o[1]:null}var wt=Er(de);de.push(function(r){var e=ca(r);if(!e)return null;var t;if(oa.test(e)){var n=e.slice(e.indexOf(",")+1);t=ia(n,"base64").toString(),e=r}else e=pt(r,e),t=St(e);return t?{url:e,map:t}:null});function Et(r){var e=Je[r.source];if(!e){var t=wt(r.source);t?(e=Je[r.source]={url:t.url,map:new na(t.map)},e.map.sourcesContent&&e.map.sources.forEach(function(i,o){var s=e.map.sourcesContent[o];if(s){var a=pt(e.url,i);ye[a]=s}})):e=Je[r.source]={url:null,map:null}}if(e&&e.map&&typeof e.map.originalPositionFor=="function"){var n=e.map.originalPositionFor(r);if(n.source!==null)return n.source=pt(e.url,n.source),n}return r}function wi(r){var e=/^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(r);if(e){var t=Et({source:e[2],line:+e[3],column:e[4]-1});return"eval at "+e[1]+" ("+t.source+":"+t.line+":"+(t.column+1)+")"}return e=/^eval at ([^(]+) \((.+)\)$/.exec(r),e?"eval at "+e[1]+" ("+wi(e[2])+")":r}function fa(){var r,e="";if(this.isNative())e="native";else{r=this.getScriptNameOrSourceURL(),!r&&this.isEval()&&(e=this.getEvalOrigin(),e+=", "),r?e+=r:e+="<anonymous>";var t=this.getLineNumber();if(t!=null){e+=":"+t;var n=this.getColumnNumber();n&&(e+=":"+n)}}var i="",o=this.getFunctionName(),s=!0,a=this.isConstructor(),u=!(this.isToplevel()||a);if(u){var l=this.getTypeName();l==="[object Object]"&&(l="null");var c=this.getMethodName();o?(l&&o.indexOf(l)!=0&&(i+=l+"."),i+=o,c&&o.indexOf("."+c)!=o.length-c.length-1&&(i+=" [as "+c+"]")):i+=l+"."+(c||"<anonymous>")}else a?i+="new "+(o||"<anonymous>"):o?i+=o:(i+=e,s=!1);return s&&(i+=" ("+e+")"),i}function Si(r){var e={};return Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(function(t){e[t]=/^(?:is|get)/.test(t)?function(){return r[t].call(r)}:r[t]}),e.toString=fa,e}function Ei(r,e){if(e===void 0&&(e={nextPosition:null,curPosition:null}),r.isNative())return e.curPosition=null,r;var t=r.getFileName()||r.getScriptNameOrSourceURL();if(t){var n=r.getLineNumber(),i=r.getColumnNumber()-1,o=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/,s=o.test(aa())?0:62;n===1&&i>s&&!_t()&&!r.isEval()&&(i-=s);var a=Et({source:t,line:n,column:i});e.curPosition=a,r=Si(r);var u=r.getFunctionName;return r.getFunctionName=function(){return e.nextPosition==null?u():e.nextPosition.name||u()},r.getFileName=function(){return a.source},r.getLineNumber=function(){return a.line},r.getColumnNumber=function(){return a.column+1},r.getScriptNameOrSourceURL=function(){return a.source},r}var l=r.isEval()&&r.getEvalOrigin();return l&&(l=wi(l),r=Si(r),r.getEvalOrigin=function(){return l}),r}function ha(r,e){mt&&(ye={},Je={});for(var t=r.name||"Error",n=r.message||"",i=t+": "+n,o={nextPosition:null,curPosition:null},s=[],a=e.length-1;a>=0;a--)s.push(`
at `+Ei(e[a],o)),o.nextPosition=o.curPosition;return o.curPosition=o.nextPosition=null,i+s.reverse().join("")}function bi(r){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(r.stack);if(e){var t=e[1],n=+e[2],i=+e[3],o=ye[t];if(!o&&ie&&ie.existsSync(t))try{o=ie.readFileSync(t,"utf8")}catch{o=""}if(o){var s=o.split(/(?:\r\n|\r|\n)/)[n-1];if(s)return t+":"+n+`
`+s+`
`+new Array(i).join(" ")+"^"}}return null}function da(r){var e=bi(r),t=ua();t&&t._handle&&t._handle.setBlocking&&t._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(r.stack),la(1)}function va(){var r=process.emit;process.emit=function(e){if(e==="uncaughtException"){var t=arguments[1]&&arguments[1].stack,n=this.listeners(e).length>0;if(t&&!n)return da(arguments[1])}return r.apply(this,arguments)}}var ga=he.slice(0),ma=de.slice(0);_e.wrapCallSite=Ei;_e.getErrorSource=bi;_e.mapSourcePosition=Et;_e.retrieveSourceMap=wt;_e.install=function(r){if(r=r||{},r.environment&&(Qe=r.environment,["node","browser","auto"].indexOf(Qe)===-1))throw new Error("environment "+Qe+" was unknown. Available options are {auto, browser, node}");if(r.retrieveFile&&(r.overrideRetrieveFile&&(he.length=0),he.unshift(r.retrieveFile)),r.retrieveSourceMap&&(r.overrideRetrieveSourceMap&&(de.length=0),de.unshift(r.retrieveSourceMap)),r.hookRequire&&!_t()){var e=pi(yt,"module"),t=e.prototype._compile;t.__sourceMapSupport||(e.prototype._compile=function(o,s){return ye[s]=o,Je[s]=void 0,t.call(this,o,s)},e.prototype._compile.__sourceMapSupport=!0)}if(mt||(mt="emptyCacheBetweenOperations"in r?r.emptyCacheBetweenOperations:!1),yi||(yi=!0,Error.prepareStackTrace=ha),!_i){var n="handleUncaughtExceptions"in r?r.handleUncaughtExceptions:!0;try{var i=pi(yt,"worker_threads");i.isMainThread===!1&&(n=!1)}catch{}n&&sa()&&(_i=!0,va())}};_e.resetRetrieveHandlers=function(){he.length=0,de.length=0,he=ga.slice(0),de=ma.slice(0),wt=Er(de),St=Er(he)}});var ji=S((xu,B)=>{var pa="1.8.15",Ai=0,Ne=function(e){var t=["XXX: "+e].concat(Array.prototype.slice.call(arguments,1));console.error.apply(this,t)},Ne=function(){},we;typeof process<"u"&&process.versions&&(process.versions.nw?we="nw":process.versions.node&&(we="node"));!we&&typeof window<"u"&&window.window===window&&(we="browser");if(!we)throw new Error("unknown runtime environment");var br,ae,Te;if(we==="browser")br={hostname:function(){return window.location.host}},ae={},Te=null;else{br=require("os"),ae=require("fs");try{Te=require("dtrace-provider")}catch{Te=null}}var le=require("util"),ue=require("assert"),He=require("events").EventEmitter,ya=require("stream");try{Xe=Bt()}catch{Xe=null}var Xe;process.env.BUNYAN_TEST_NO_SAFE_JSON_STRINGIFY&&(Xe=null);try{Ze=Wn()}catch{Ze=null}var Ze;try{Or=Oi()}catch{Or=null}var Or;function Se(r){if(r==null)return r;if(Array.isArray(r))return r.slice();if(typeof r=="object"){var e={};return Object.keys(r).forEach(function(t){e[t]=r[t]}),e}else return r}var F=le.format;F||(bt=le.inspect,Ci=/%[sdj%]/g,F=function(e){if(typeof e!="string"){for(var t=[],n=0;n<arguments.length;n++)t.push(bt(arguments[n]));return t.join(" ")}for(var n=1,i=arguments,o=i.length,s=String(e).replace(Ci,function(u){if(n>=o)return u;switch(u){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":return Ni(i[n++]);case"%%":return"%";default:return u}}),a=i[n];n<o;a=i[++n])a===null||typeof a!="object"?s+=" "+a:s+=" "+bt(a);return s});var bt,Ci;function At(){if(this!==void 0){var r={},e=Error.stackTraceLimit,t=Error.prepareStackTrace;return Error.stackTraceLimit=3,Error.prepareStackTrace=function(n,i){var o=i[2];Or&&(o=Or.wrapCallSite(o)),r.file=o.getFileName(),r.line=o.getLineNumber();var s=o.getFunctionName();s&&(r.func=s)},Error.captureStackTrace(this,At),this.stack,Error.stackTraceLimit=e,Error.prepareStackTrace=t,r}}function _a(r,e){e||(e=" ");var t=r.split(/\r?\n/g);return e+t.join(`
`+e)}function Rt(r,e){if(ue.ok(r),e){if(Ot[e])return;Ot[e]=!0}process.stderr.write(r+`
`)}function Sa(r){return Ot[r]}var Ot={};function Ri(){}Ri.prototype.write=function(r){r.level<er?console.log(r):r.level<Cr?console.info(r):r.level<Ar?console.warn(r):console.error(r)};var kt=10,Mt=20,er=30,Cr=40,Ar=50,Lt=60,je={trace:kt,debug:Mt,info:er,warn:Cr,error:Ar,fatal:Lt},ki={};Object.keys(je).forEach(function(r){ki[je[r]]=r});var Ye=void 0,Ct=Te&&{};function Ke(r){var e,t=typeof r;if(t==="string"){if(e=je[r.toLowerCase()],!e)throw new Error(F('unknown level name: "%s"',r))}else{if(t!=="number")throw new TypeError(F("cannot resolve level: invalid arg (%s):",t,r));if(r<0||Math.floor(r)!==r)throw new TypeError(F("level is not a positive integer: %s",r));e=r}return e}function wa(r){return r instanceof ya.Writable?!0:typeof r.write=="function"}function L(r,e,t){if(Ne("Logger start:",r),!(this instanceof L))return new L(r,e);var n;if(e!==void 0&&(n=r,r=e,!(n instanceof L)))throw new TypeError("invalid Logger creation: do not pass a second arg");if(!r)throw new TypeError("options (object) is required");if(n){if(r.name)throw new TypeError("invalid options.name: child cannot set logger name")}else if(!r.name)throw new TypeError("options.name (string) is required");if(r.stream&&r.streams)throw new TypeError('cannot mix "streams" and "stream" options');if(r.streams&&!Array.isArray(r.streams))throw new TypeError("invalid options.streams: must be an array");if(r.serializers&&(typeof r.serializers!="object"||Array.isArray(r.serializers)))throw new TypeError("invalid options.serializers: must be an object");if(He.call(this),n&&t){this._isSimpleChild=!0,this._level=n._level,this.streams=n.streams,this.serializers=n.serializers,this.src=n.src;for(var f=this.fields={},i=Object.keys(n.fields),o=0;o<i.length;o++){var s=i[o];f[s]=n.fields[s]}for(var a=Object.keys(r),o=0;o<a.length;o++){var s=a[o];f[s]=r[s]}return}var u=this;if(n){this._level=n._level,this.streams=[];for(var o=0;o<n.streams.length;o++){var l=Se(n.streams[o]);l.closeOnExit=!1,this.streams.push(l)}this.serializers=Se(n.serializers),this.src=n.src,this.fields=Se(n.fields),r.level&&this.level(r.level)}else this._level=Number.POSITIVE_INFINITY,this.streams=[],this.serializers=null,this.src=!1,this.fields={};if(!Ye&&Te){Ye=Te.createDTraceProvider("bunyan");for(var c in je){var v;Ct[je[c]]=v=Ye.addProbe("log-"+c,"char *"),v.dtp=Ye}Ye.enable()}r.stream?u.addStream({type:"stream",stream:r.stream,closeOnExit:!1,level:r.level}):r.streams?r.streams.forEach(function(h){u.addStream(h,r.level)}):n&&r.level?this.level(r.level):n||(we==="browser"?u.addStream({type:"raw",stream:new Ri,closeOnExit:!1,level:r.level}):u.addStream({type:"stream",stream:process.stdout,closeOnExit:!1,level:r.level})),r.serializers&&u.addSerializers(r.serializers),r.src&&(this.src=!0),Ne("Logger: ",u);var f=Se(r);delete f.stream,delete f.level,delete f.streams,delete f.serializers,delete f.src,this.serializers&&this._applySerializers(f),!f.hostname&&!u.fields.hostname&&(f.hostname=br.hostname()),f.pid||(f.pid=process.pid),Object.keys(f).forEach(function(h){u.fields[h]=f[h]})}le.inherits(L,He);L.prototype.addStream=function(e,t){var n=this;switch(t==null&&(t=er),e=Se(e),e.type||(e.stream?e.type="stream":e.path&&(e.type="file")),e.raw=e.type==="raw",e.level!==void 0?e.level=Ke(e.level):e.level=Ke(t),e.level<n._level&&(n._level=e.level),e.type){case"stream":ue.ok(wa(e.stream),'"stream" stream is not writable: '+le.inspect(e.stream)),e.closeOnExit||(e.closeOnExit=!1);break;case"file":e.reemitErrorEvents===void 0&&(e.reemitErrorEvents=!0),e.stream?e.closeOnExit||(e.closeOnExit=!1):(e.stream=ae.createWriteStream(e.path,{flags:"a",encoding:"utf8"}),e.closeOnExit||(e.closeOnExit=!0));break;case"rotating-file":ue.ok(!e.stream,'"rotating-file" stream should not give a "stream"'),ue.ok(e.path),ue.ok(Ze,'"rotating-file" stream type is not supported: missing "mv" module'),e.stream=new Y(e),e.closeOnExit||(e.closeOnExit=!0);break;case"raw":e.closeOnExit||(e.closeOnExit=!1);break;default:throw new TypeError('unknown stream type "'+e.type+'"')}e.reemitErrorEvents&&typeof e.stream.on=="function"&&e.stream.on("error",function(o){n.emit("error",o,e)}),n.streams.push(e),delete n.haveNonRawStreams};L.prototype.addSerializers=function(e){var t=this;t.serializers||(t.serializers={}),Object.keys(e).forEach(function(n){var i=e[n];if(typeof i!="function")throw new TypeError(F('invalid serializer for "%s" field: must be a function',n));t.serializers[n]=i})};L.prototype.child=function(r,e){return new this.constructor(this,r||{},e)};L.prototype.reopenFileStreams=function(){var r=this;r.streams.forEach(function(e){e.type==="file"&&(e.stream&&(e.stream.end(),e.stream.destroySoon(),delete e.stream),e.stream=ae.createWriteStream(e.path,{flags:"a",encoding:"utf8"}),e.stream.on("error",function(t){r.emit("error",t,e)}))})};L.prototype.level=function(e){if(e===void 0)return this._level;for(var t=Ke(e),n=this.streams.length,i=0;i<n;i++)this.streams[i].level=t;this._level=t};L.prototype.levels=function(e,t){if(e===void 0)return ue.equal(t,void 0),this.streams.map(function(u){return u.level});var n;if(typeof e=="number"){if(n=this.streams[e],n===void 0)throw new Error("invalid stream index: "+e)}else{for(var i=this.streams.length,o=0;o<i;o++){var s=this.streams[o];if(s.name===e){n=s;break}}if(!n)throw new Error(F('no stream with name "%s"',e))}if(t===void 0)return n.level;var a=Ke(t);n.level=a,a<this._level&&(this._level=a)};L.prototype._applySerializers=function(r,e){var t=this;Ne("_applySerializers: excludeFields",e),Object.keys(this.serializers).forEach(function(n){if(!(r[n]===void 0||e&&e[n])){Ne('_applySerializers; apply to "%s" key',n);try{r[n]=t.serializers[n](r[n])}catch(i){Rt(F(`bunyan: ERROR: Exception thrown from the "%s" Bunyan serializer. This should never happen. This is a bug in that serializer function.
%s`,n,i.stack||i)),r[n]=F('(Error in Bunyan log "%s" serializer broke field. See stderr for details.)',n)}}})};L.prototype._emit=function(r,e){var t;if(this.haveNonRawStreams===void 0){for(this.haveNonRawStreams=!1,t=0;t<this.streams.length;t++)if(!this.streams[t].raw){this.haveNonRawStreams=!0;break}}var n;if((e||this.haveNonRawStreams)&&(n=Ni(r)+br.EOL),e)return n;var i=r.level;for(t=0;t<this.streams.length;t++){var o=this.streams[t];o.level<=i&&(Ne('writing log rec "%s" to "%s" stream (%d <= %d): %j',r.msg,o.type,o.level,i,r),o.stream.write(o.raw?r:n))}return n};function Mi(r,e,t){var n,i,o;t[0]instanceof Error?(i={err:r.serializers&&r.serializers.err?r.serializers.err(t[0]):L.stdSerializers.err(t[0])},n={err:!0},t.length===1?o=[i.err.message]:o=t.slice(1)):typeof t[0]!="object"||Array.isArray(t[0])?(i=null,o=t.slice()):Buffer.isBuffer(t[0])?(i=null,o=t.slice(),o[0]=le.inspect(o[0])):(i=t[0],i&&t.length===1&&i.err&&i.err instanceof Error?o=[i.err.message]:o=t.slice(1));var s=Se(r.fields),a=s.level=e,u=i?Se(i):null;return u&&(r.serializers&&r._applySerializers(u,n),Object.keys(u).forEach(function(l){s[l]=u[l]})),s.msg=F.apply(r,o),s.time||(s.time=new Date),r.src&&!s.src&&(s.src=At()),s.v=Ai,s}function Ea(r,e,t,n){return[r||e._emit(Mi(e,t,n),!0)]}function Ie(r){return function(){var e=this,t=null,n=null;if(this._emit){if(arguments.length===0)return this._level<=r}else{var i="unbound";if(!Sa[i]){var o=At();Rt(F("bunyan usage error: %s:%s: attempt to log with an unbound log method: `this` is: %s",o.file,o.line,le.inspect(this)),i)}return}for(var s=new Array(arguments.length),a=0;a<s.length;++a)s[a]=arguments[a];this._level<=r&&(n=Mi(e,r,s),t=this._emit(n)),Ct&&Ct[r].fire(Ea,t,e,r,s)}}L.prototype.trace=Ie(kt);L.prototype.debug=Ie(Mt);L.prototype.info=Ie(er);L.prototype.warn=Ie(Cr);L.prototype.error=Ie(Ar);L.prototype.fatal=Ie(Lt);L.stdSerializers={};L.stdSerializers.req=function(r){return!r||!r.connection?r:{method:r.method,url:r.originalUrl||r.url,headers:r.headers,remoteAddress:r.connection.remoteAddress,remotePort:r.connection.remotePort}};L.stdSerializers.res=function(r){return!r||!r.statusCode?r:{statusCode:r.statusCode,header:r._header}};function Li(r){var e=r.stack||r.toString();if(r.cause&&typeof r.cause=="function"){var t=r.cause();t&&(e+=`
Caused by: `+Li(t))}return e}var Iu=L.stdSerializers.err=function(r){if(!r||!r.stack)return r;var e={message:r.message,name:r.name,stack:Li(r),code:r.code,signal:r.signal};return e};function ba(){var r=new Set;return function(e,t){return!t||typeof t!="object"?t:r.has(t)?"[Circular]":(r.add(t),t)}}function Oa(){var r=[];return function(e,t){return!t||typeof t!="object"?t:r.indexOf(t)!==-1?"[Circular]":(r.push(t),t)}}var Ti=typeof Set<"u"?ba:Oa;function Ni(r){try{return JSON.stringify(r)}catch{try{return JSON.stringify(r,Ti())}catch(n){if(Xe)return Xe(r);var e=n.stack.split(/\n/g,3).join(`
`);return Rt('bunyan: ERROR: Exception in `JSON.stringify(rec)`. You can install the "safe-json-stringify" module to have Bunyan fallback to safer stringification. Record:\n'+_a(F(`%s
%s`,le.inspect(r),n.stack)),e),F("(Exception in JSON.stringify(rec): %j. See stderr for details.)",n.message)}}}var Y=null;Ze&&(Y=function(e){if(this.path=e.path,this.count=e.count==null?10:e.count,ue.equal(typeof this.count,"number",F('rotating-file stream "count" is not a number: %j (%s) in %j',this.count,typeof this.count,this)),ue.ok(this.count>=0,F('rotating-file stream "count" is not >= 0: %j in %j',this.count,this)),e.period){var t={hourly:"1h",daily:"1d",weekly:"1w",monthly:"1m",yearly:"1y"}[e.period]||e.period,n=/^([1-9][0-9]*)([hdwmy]|ms)$/.exec(t);if(!n)throw new Error(F('invalid period: "%s"',e.period));this.periodNum=Number(n[1]),this.periodScope=n[2]}else this.periodNum=1,this.periodScope="d";var i=null;try{var o=ae.statSync(this.path);i=o.mtime.getTime()}catch{}var s=!1;if(i){var a=this._calcRotTime(0);i<a&&(s=!0)}this.stream=ae.createWriteStream(this.path,{flags:"a",encoding:"utf8"}),this.rotQueue=[],this.rotating=!1,s?(this._debug("rotateAfterOpen -> call rotate()"),this.rotate()):this._setupNextRot()},le.inherits(Y,He),Y.prototype._debug=function(){if(0)var r;else return!1},Y.prototype._setupNextRot=function(){this.rotAt=this._calcRotTime(1),this._setRotationTimer()},Y.prototype._setRotationTimer=function(){var r=this,e=this.rotAt-Date.now(),t=2147483647;e>t&&(e=t),this.timeout=setTimeout(function(){r._debug("_setRotationTimer timeout -> call rotate()"),r.rotate()},e),typeof this.timeout.unref=="function"&&this.timeout.unref()},Y.prototype._calcRotTime=function(e){this._debug("_calcRotTime: %s%s",this.periodNum,this.periodScope);var t=new Date;this._debug(" now local: %s",t),this._debug(" now utc: %s",t.toISOString());var n;switch(this.periodScope){case"ms":this.rotAt?n=this.rotAt+this.periodNum*e:n=Date.now()+this.periodNum*e;break;case"h":this.rotAt?n=this.rotAt+this.periodNum*60*60*1e3*e:n=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours()+e);break;case"d":this.rotAt?n=this.rotAt+this.periodNum*24*60*60*1e3*e:n=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()+e);break;case"w":if(this.rotAt)n=this.rotAt+this.periodNum*7*24*60*60*1e3*e;else{var i=7-t.getUTCDay();e<1&&(i=-t.getUTCDay()),(e>1||e<-1)&&(i+=7*e),n=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()+i)}break;case"m":this.rotAt?n=Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+this.periodNum*e,1):n=Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+e,1);break;case"y":this.rotAt?n=Date.UTC(t.getUTCFullYear()+this.periodNum*e,0,1):n=Date.UTC(t.getUTCFullYear()+e,0,1);break;default:ue.fail(F('invalid period scope: "%s"',this.periodScope))}if(this._debug()){this._debug(" **rotAt**: %s (utc: %s)",n,new Date(n).toUTCString());var o=Date.now();this._debug(" now: %s (%sms == %smin == %sh to go)",o,n-o,(n-o)/1e3/60,(n-o)/1e3/60/60)}return n},Y.prototype.rotate=function(){var e=this;if(e.rotAt&&e.rotAt>Date.now())return e._setRotationTimer();if(this._debug("rotate"),e.rotating)throw new TypeError("cannot start a rotation when already rotating");e.rotating=!0,e.stream.end();function t(){var s=e.path+"."+String(o-1);o===0&&(s=e.path),o-=1,e._debug(" rm %s",s),ae.unlink(s,function(a){n()})}function n(){if(e.count===0||o<0)return i();var s=e.path,a=e.path+"."+String(o);o>0&&(s+="."+String(o-1)),o-=1,ae.exists(s,function(u){u?(e._debug(" mv %s %s",s,a),Ze(s,a,function(l){l?(e.emit("error",l),i()):n()})):n()})}function i(){e._debug(" open %s",e.path),e.stream=ae.createWriteStream(e.path,{flags:"a",encoding:"utf8"});for(var s=e.rotQueue,a=s.length,u=0;u<a;u++)e.stream.write(s[u]);e.rotQueue=[],e.rotating=!1,e.emit("drain"),e._setupNextRot()}var o=this.count;t()},Y.prototype.write=function(e){return this.rotating?(this.rotQueue.push(e),!1):this.stream.write(e)},Y.prototype.end=function(e){this.stream.end()},Y.prototype.destroy=function(e){this.stream.destroy()},Y.prototype.destroySoon=function(e){this.stream.destroySoon()});function xe(r){this.limit=r&&r.limit?r.limit:100,this.writable=!0,this.records=[],He.call(this)}le.inherits(xe,He);xe.prototype.write=function(r){if(!this.writable)throw new Error("RingBuffer has been ended already");return this.records.push(r),this.records.length>this.limit&&this.records.shift(),!0};xe.prototype.end=function(){arguments.length>0&&this.write.apply(this,Array.prototype.slice.call(arguments)),this.writable=!1};xe.prototype.destroy=function(){this.writable=!1,this.emit("close")};xe.prototype.destroySoon=function(){this.destroy()};B.exports=L;B.exports.TRACE=kt;B.exports.DEBUG=Mt;B.exports.INFO=er;B.exports.WARN=Cr;B.exports.ERROR=Ar;B.exports.FATAL=Lt;B.exports.resolveLevel=Ke;B.exports.levelFromName=je;B.exports.nameFromLevel=ki;B.exports.VERSION=pa;B.exports.LOG_VERSION=Ai;B.exports.createLogger=function(e){return new L(e)};B.exports.RingBuffer=xe;B.exports.RotatingFileStream=Y;B.exports.safeCycles=Ti});var xi=S((Du,Ii)=>{var Ca=Object.prototype.hasOwnProperty,Aa=Object.prototype.toString,Ra=function(r){var e=typeof r=="function"&&!(r instanceof RegExp)||Aa.call(r)==="[object Function]";return!e&&typeof window<"u"&&(e=r===window.setTimeout||r===window.alert||r===window.confirm||r===window.prompt),e};Ii.exports=function(e,t){if(!Ra(t))throw new TypeError("iterator must be a function");var n,i,o=typeof e=="string",s=e.length,a=arguments.length>2?arguments[2]:null;if(s===+s)for(n=0;n<s;n++)a===null?t(o?e.charAt(n):e[n],n,e):t.call(a,o?e.charAt(n):e[n],n,e);else for(i in e)Ca.call(e,i)&&(a===null?t(e[i],i,e):t.call(a,e[i],i,e))}});var Fi=S((Pu,Pi)=>{var Di=Object.prototype.toString;Pi.exports=function(e){var t=Di.call(e),n=t==="[object Arguments]";return n||(n=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Di.call(e.callee)==="[object Function]"),n}});var Gi=S((Fu,Bi)=>{(function(){"use strict";var r=Object.prototype.hasOwnProperty,e=Object.prototype.toString,t=xi(),n=Fi(),i=!{toString:null}.propertyIsEnumerable("toString"),o=function(){}.propertyIsEnumerable("prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],a;a=function(l){var c=l!==null&&typeof l=="object",v=e.call(l)==="[object Function]",f=n(l),h=[];if(!c&&!v&&!f)throw new TypeError("Object.keys called on a non-object");if(f)t(l,function(_){h.push(_)});else{var d,m=o&&v;for(d in l)!(m&&d==="prototype")&&r.call(l,d)&&h.push(d)}if(i){var k=l.constructor,p=k&&k.prototype===l;t(s,function(_){!(p&&_==="constructor")&&r.call(l,_)&&h.push(_)})}return h},Bi.exports=a})()});var Ui=S((Bu,qi)=>{qi.exports=Object.keys||Gi()});var Wi=S((Gu,zi)=>{zi.exports=ka;function ka(r){return r!==null&&(typeof r=="object"||typeof r=="function")}});var Tt=S((qu,$i)=>{var Ma=Ui(),La=Wi();$i.exports=Ta;function Ta(){for(var r={},e=0;e<arguments.length;e++){var t=arguments[e];if(La(t))for(var n=Ma(t),i=0;i<n.length;i++){var o=n[i];r[o]=t[o]}}return r}});var Yi=S((Uu,Ji)=>{"use strict";var Vi={white:37,black:30,blue:34,cyan:36,green:32,magenta:35,red:31,yellow:33,brightBlack:90,brightRed:91,brightGreen:92,brightYellow:93,brightBlue:94,brightMagenta:95,brightCyan:96,brightWhite:97},Qi={bgBlack:40,bgRed:41,bgGreen:42,bgYellow:43,bgBlue:44,bgMagenta:45,bgCyan:46,bgWhite:47,bgBrightBlack:100,bgBrightRed:101,bgBrightGreen:102,bgBrightYellow:103,bgBrightBlue:104,bgBrightMagenta:105,bgBrightCyan:106,bgBrightWhite:107},Nt={};Object.keys(Vi).forEach(function(r){Nt[r]=function(e){return"\x1B["+Vi[r]+"m"+e+"\x1B[39m"}});Object.keys(Qi).forEach(function(r){Nt[r]=function(e){return"\x1B["+Qi[r]+"m"+e+"\x1B[49m"}});Ji.exports=Nt});var Ki=S((zu,Zi)=>{"use strict";var jt={reset:[0,22],bright:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],blink:[5,25],inverse:[7,27]},Xi={};Object.keys(jt).forEach(function(r){Xi[r]=function(e){var t=jt[r][0],n=jt[r][1];return"\x1B["+t+"m"+e+"\x1B["+n+"m"}});Zi.exports=Xi});var _o=S((Wu,yo)=>{"use strict";var to=require("util"),ve=to.format,Na=require("http"),ja=Tt(),Ia=Yi(),xa=Ki(),Da=ja(xa,Ia),no=1,io=2,oo=3,so=4,ao=5,uo=6,Pa={long:no,json:io,inspect:oo,simple:so,short:ao,bunyan:uo},lo=10,co=20,fo=30,ho=40,vo=50,go=60,Hi={trace:lo,debug:co,info:fo,warn:ho,error:vo,fatal:go},Fa={},mo={},po={};Object.keys(Hi).forEach(function(r){var e=Hi[r];Fa[e]=r,mo[e]=r.toUpperCase(),po[e]=(r.length===4?" ":"")+r.toUpperCase()});function eo(r){return!(r.v===null||r.level===null||r.name===null||r.hostname===null||r.pid===null||r.time===null||r.msg===null)}function De(r){return" "+r.split(/\r?\n/).join(`
`)}function Ba(r,e){if(!r)return"";var t=Da[e];return t?t(r):r}function Ga(r,e){return r}function ro(r){switch(r){case lo:return"TRACE";case co:return"DEBUG";case fo:return"INFO";case ho:return"WARN";case vo:return"ERROR";case go:return"FATAL"}}yo.exports=function(e,t){function n(w){var X="";if(w.header)X+=w.header.trimRight();else if(w.headers){w.statusCode&&(X+=ve(`HTTP/1.1 %s %s
`,w.statusCode,Na.STATUS_CODES[w.statusCode]));var H=w.headers;X+=Object.keys(H).map(function(ee){return ee+": "+H[ee]}).join(`
`)}delete w.header,delete w.headers,delete w.statusCode,w.body&&(X+=`
`+(typeof w.body=="object"?JSON.stringify(w.body,null,2):w.body),delete w.body),w.trailer&&(X+=`
`+w.trailer),delete w.trailer,X&&_.push(De(X)),Object.keys(w).forEach(function(ee){e["res."+ee]=w[ee]})}var i=!1,o,s=e.line,a=t.color?Ba:Ga,u=isNaN(t.outputMode)?Pa[t.outputMode]:t.outputMode;switch(u){case ao:i=!0;case no:if(!eo(e))return s+`
`;delete e.v,i&&e.time[10]=="T"?(o=e.time.substr(11),o=a(o,"brightBlack")):o=a("["+e.time+"]","brightBlack"),delete e.time;var l=e.name;delete e.name,e.component&&(l+="/"+e.component),delete e.component,i||(l+="/"+e.pid),delete e.pid;var c=po[e.level]||"LVL"+e.level;if(t.color){var v=t.colorFromLevel||{10:"brightBlack",20:"brightBlack",30:"cyan",40:"magenta",50:"red",60:"inverse"};c=a(c,v[e.level])}delete e.level;var f="",h,d,m="";e.src&&e.src.file&&(h=e.src,h.func?f=ve(" (%s:%d in %s)",h.file,h.line,h.func):f=ve(" (%s:%d)",h.file,h.line),f=a(f,"green")),delete e.src;var k=e.hostname;delete e.hostname;var p=[],_=[];e.req_id&&p.push("req_id="+e.req_id),delete e.req_id;var j;if(e.msg.indexOf(`
`)!==-1?(j="",_.push(De(a(e.msg,"cyan")))):j=" "+a(e.msg,"cyan"),delete e.msg,e.req&&typeof e.req=="object"){var E=e.req;delete e.req,d=E.headers,h=ve("%s %s HTTP/%s%s",E.method,E.url,E.httpVersion||"1.1",d?`
`+Object.keys(d).map(function(w){return w+": "+d[w]}).join(`
`):""),delete E.url,delete E.method,delete E.httpVersion,delete E.headers,E.body&&(h+=`
`+(typeof E.body=="object"?JSON.stringify(E.body,null,2):E.body),delete E.body),E.trailers&&Object.keys(E.trailers)>0&&(h+=`
`+Object.keys(E.trailers).map(function(w){return w+": "+E.trailers[w]}).join(`
`)),delete E.trailers,_.push(De(h)),Object.keys(E).forEach(function(w){e["req."+w]=E[w]})}if(e.client_req&&typeof e.client_req=="object"){var C=e.client_req;delete e.client_req,d=C.headers,h="",C.address&&(m="Host: "+C.address,C.port&&(m+=":"+C.port),m+=`
`),delete C.headers,delete C.address,delete C.port,h+=ve(`%s %s HTTP/%s
%s%s`,C.method,C.url,C.httpVersion||"1.1",m,d?Object.keys(d).map(function(w){return w+": "+d[w]}).join(`
`):""),delete C.method,delete C.url,delete C.httpVersion,C.body&&(h+=`
`+(typeof C.body=="object"?JSON.stringify(C.body,null,2):C.body),delete C.body),Object.keys(C).forEach(function(w){e["client_req."+w]=C[w]}),_.push(De(h))}e.res&&typeof e.res=="object"&&(n(e.res),delete e.res),e.client_res&&typeof e.client_res=="object"&&(n(e.client_res),delete e.res),e.err&&e.err.stack&&(_.push(De(e.err.stack)),delete e.err);for(var K=Object.keys(e),W=0;W<K.length;W++){var U=K[W],N=e[U],te=!1;typeof N!="string"&&(N=JSON.stringify(N,null,2),te=!0),N.indexOf(`
`)!==-1||N.length>50?_.push(De(U+": "+N)):!te&&(N.indexOf(" ")!=-1||N.length===0)?p.push(U+"="+JSON.stringify(N)):p.push(U+"="+N)}return p=a(p.length?" ("+p.join(", ")+")":"","brightBlack"),_=a(_.length?_.join(`
--
`)+`
`:"","brightBlack"),i?ve(`%s %s %s:%s%s
%s`,o,c,l,j,p,_):ve(`%s %s: %s on %s%s:%s%s
%s`,o,c,l,k||"<no-hostname>",f,j,p,_);case oo:return to.inspect(e,!1,1/0,!0)+`
`;case uo:return t.levelInString&&(e.level=ro(e.level)),JSON.stringify(e,null,0)+`
`;case io:return t.levelInString&&(e.level=ro(e.level)),JSON.stringify(e,null,t.jsonIndent)+`
`;case so:return eo(e)?ve(`%s - %s
`,mo[e.level]||"LVL"+e.level,e.msg):s+`
`;default:throw new Error("unknown output mode: "+t.outputMode)}}});var Eo=S(($u,wo)=>{"use strict";var qa=require("stream"),Ua=require("util"),za=_o(),Wa=Tt(),So=qa.Writable;wo.exports=rr;Ua.inherits(rr,So);function rr(r,e){if(!(this instanceof rr))return new rr(r,e);r=r||{},r.objectMode=!0,So.call(this,r),this.opts=Wa({outputMode:"short",color:!0,colorFromLevel:{10:"brightBlack",20:"brightBlack",30:"green",40:"magenta",50:"red",60:"brightRed"}},r),this.out=e||process.stdout}rr.prototype._write=function(r,e,t){var n;try{n=JSON.parse(r),this.out.write(za(n,this.opts))}catch{this.out.write(r)}t()}});var Qa={};Lo(Qa,{default:()=>Rr});module.exports=To(Qa);var bo=Dt(ji()),Oo=Dt(Eo()),$a=(0,Oo.default)({outputMode:"short",color:!1}),Va=bo.default.createLogger({name:"Digital Prison Reporting:",stream:$a,level:"debug"}),It=Va;var tr=class{constructor(e){this.reportDataStore=e;this.reportStore=e}async getState(e){return this.reportStore.getUserConfig(e)}async saveState(e,t){await this.reportStore.setUserConfig(e,t)}findIndexByExecutionId(e,t){return t.findIndex(n=>n.executionId===e)}findIndexByTableId(e,t){return t.findIndex(n=>n.tableId===e)}};var Rr=class extends tr{constructor(e){super(e),It.info("Service created: DownloadPermissionService")}async saveDownloadPermissionData(e,t,n){let i=await this.getState(e);i.downloadPermissions||(i.downloadPermissions=[]),await this.downloadEnabled(e,t,n)||(i.downloadPermissions.push({reportId:t,id:n}),It.info(`Download permission granted for ${e}: ${t} - ${n}`),await this.saveState(e,i))}async removeDownloadPermissionData(e,t,n){let i=await this.getState(e),o=i.downloadPermissions.findIndex(s=>s.id===n);o>=0&&i.downloadPermissions.splice(o,1),await this.saveState(e,i)}async downloadEnabled(e,t,n){let i=await this.getState(e);return i.downloadPermissions?!!i.downloadPermissions.find(s=>s.id===n&&s.reportId===t):!1}async getAllDownloadPermissions(e){return(await this.getState(e)).downloadPermissions}};
//# sourceMappingURL=service.js.map