UNPKG

@ministryofjustice/hmpps-digital-prison-reporting-frontend

Version:

The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.

59 lines 149 kB
var so=Object.create;var Mt=Object.defineProperty;var oo=Object.getOwnPropertyDescriptor;var uo=Object.getOwnPropertyNames;var lo=Object.getPrototypeOf,co=Object.prototype.hasOwnProperty;var F=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),fo=(t,e)=>{for(var r in e)Mt(t,r,{get:e[r],enumerable:!0})},Nn=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of uo(e))!co.call(t,i)&&i!==r&&Mt(t,i,{get:()=>e[i],enumerable:!(n=oo(e,i))||n.enumerable});return t};var re=(t,e,r)=>(r=t!=null?so(lo(t)):{},Nn(e||!t||!t.__esModule?Mt(r,"default",{value:t,enumerable:!0}):r,t)),ho=t=>Nn(Mt({},"__esModule",{value:!0}),t);var cr=F((Nc,lr)=>{"use strict";var $n=require("url"),kn=$n.parse,Ft=$n.Url;lr.exports=In;lr.exports.original=mo;function In(t){var e=t.url;if(e!==void 0){var r=t._parsedUrl;return Pn(e,r)?r:(r=Yn(e),r._raw=e,t._parsedUrl=r)}}function mo(t){var e=t.originalUrl;if(typeof e!="string")return In(t);var r=t._parsedOriginalUrl;return Pn(e,r)?r:(r=Yn(e),r._raw=e,t._parsedOriginalUrl=r)}function Yn(t){if(typeof t!="string"||t.charCodeAt(0)!==47)return kn(t);for(var e=t,r=null,n=null,i=1;i<t.length;i++)switch(t.charCodeAt(i)){case 63:n===null&&(e=t.substring(0,i),r=t.substring(i+1),n=t.substring(i));break;case 9:case 10:case 12:case 13:case 32:case 35:case 160:case 65279:return kn(t)}var a=Ft!==void 0?new Ft:{};return a.path=t,a.href=t,a.pathname=e,n!==null&&(a.query=r,a.search=n),a}function Pn(t,e){return typeof e=="object"&&e!==null&&(Ft===void 0||e instanceof Ft)&&e._raw===t}});var at=F((hr,dr)=>{(function(t,e){typeof hr=="object"&&typeof dr<"u"?dr.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(hr,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",a="minute",s="hour",o="day",u="week",l="month",c="quarter",m="year",f="date",h="Invalid Date",d=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,R={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(A){var _=["th","st","nd","rd"],v=A%100;return"["+A+(_[(v-20)%10]||_[v]||_[0])+"]"}},y=function(A,_,v){var E=String(A);return!E||E.length>=_?A:""+Array(_+1-E.length).join(v)+A},w={s:y,z:function(A){var _=-A.utcOffset(),v=Math.abs(_),E=Math.floor(v/60),S=v%60;return(_<=0?"+":"-")+y(E,2,"0")+":"+y(S,2,"0")},m:function A(_,v){if(_.date()<v.date())return-A(v,_);var E=12*(v.year()-_.year())+(v.month()-_.month()),S=_.clone().add(E,l),g=v-S<0,b=_.clone().add(E+(g?-1:1),l);return+(-(E+(v-S)/(g?S-b:b-S))||0)},a:function(A){return A<0?Math.ceil(A)||0:Math.floor(A)},p:function(A){return{M:l,y:m,w:u,d:o,D:f,h:s,m:a,s:i,ms:n,Q:c}[A]||String(A||"").toLowerCase().replace(/s$/,"")},u:function(A){return A===void 0}},$="en",C={};C[$]=R;var x="$isDayjsObject",j=function(A){return A instanceof U||!(!A||!A[x])},V=function A(_,v,E){var S;if(!_)return $;if(typeof _=="string"){var g=_.toLowerCase();C[g]&&(S=g),v&&(C[g]=v,S=g);var b=_.split("-");if(!S&&b.length>1)return A(b[0])}else{var D=_.name;C[D]=_,S=D}return!E&&S&&($=S),S||!E&&$},k=function(A,_){if(j(A))return A.clone();var v=typeof _=="object"?_:{};return v.date=A,v.args=arguments,new U(v)},T=w;T.l=V,T.i=j,T.w=function(A,_){return k(A,{locale:_.$L,utc:_.$u,x:_.$x,$offset:_.$offset})};var U=function(){function A(v){this.$L=V(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[x]=!0}var _=A.prototype;return _.parse=function(v){this.$d=function(E){var S=E.date,g=E.utc;if(S===null)return new Date(NaN);if(T.u(S))return new Date;if(S instanceof Date)return new Date(S);if(typeof S=="string"&&!/Z$/i.test(S)){var b=S.match(d);if(b){var D=b[2]-1||0,M=(b[7]||"0").substring(0,3);return g?new Date(Date.UTC(b[1],D,b[3]||1,b[4]||0,b[5]||0,b[6]||0,M)):new Date(b[1],D,b[3]||1,b[4]||0,b[5]||0,b[6]||0,M)}}return new Date(S)}(v),this.init()},_.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==h},_.isSame=function(v,E){var S=k(v);return this.startOf(E)<=S&&S<=this.endOf(E)},_.isAfter=function(v,E){return k(v)<this.startOf(E)},_.isBefore=function(v,E){return this.endOf(E)<k(v)},_.$g=function(v,E,S){return T.u(v)?this[E]:this.set(S,v)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(v,E){var S=this,g=!!T.u(E)||E,b=T.p(v),D=function(ce,W){var oe=T.w(S.$u?Date.UTC(S.$y,W,ce):new Date(S.$y,W,ce),S);return g?oe:oe.endOf(o)},M=function(ce,W){return T.w(S.toDate()[ce].apply(S.toDate("s"),(g?[0,0,0,0]:[23,59,59,999]).slice(W)),S)},I=this.$W,B=this.$M,te=this.$D,De="set"+(this.$u?"UTC":"");switch(b){case m:return g?D(1,0):D(31,11);case l:return g?D(1,B):D(0,B+1);case u:var me=this.$locale().weekStart||0,Oe=(I<me?I+7:I)-me;return D(g?te-Oe:te+(6-Oe),B);case o:case f:return M(De+"Hours",0);case s:return M(De+"Minutes",1);case a:return M(De+"Seconds",2);case i:return M(De+"Milliseconds",3);default:return this.clone()}},_.endOf=function(v){return this.startOf(v,!1)},_.$set=function(v,E){var S,g=T.p(v),b="set"+(this.$u?"UTC":""),D=(S={},S[o]=b+"Date",S[f]=b+"Date",S[l]=b+"Month",S[m]=b+"FullYear",S[s]=b+"Hours",S[a]=b+"Minutes",S[i]=b+"Seconds",S[n]=b+"Milliseconds",S)[g],M=g===o?this.$D+(E-this.$W):E;if(g===l||g===m){var I=this.clone().set(f,1);I.$d[D](M),I.init(),this.$d=I.set(f,Math.min(this.$D,I.daysInMonth())).$d}else D&&this.$d[D](M);return this.init(),this},_.set=function(v,E){return this.clone().$set(v,E)},_.get=function(v){return this[T.p(v)]()},_.add=function(v,E){var S,g=this;v=Number(v);var b=T.p(E),D=function(B){var te=k(g);return T.w(te.date(te.date()+Math.round(B*v)),g)};if(b===l)return this.set(l,this.$M+v);if(b===m)return this.set(m,this.$y+v);if(b===o)return D(1);if(b===u)return D(7);var M=(S={},S[a]=e,S[s]=r,S[i]=t,S)[b]||1,I=this.$d.getTime()+v*M;return T.w(I,this)},_.subtract=function(v,E){return this.add(-1*v,E)},_.format=function(v){var E=this,S=this.$locale();if(!this.isValid())return S.invalidDate||h;var g=v||"YYYY-MM-DDTHH:mm:ssZ",b=T.z(this),D=this.$H,M=this.$m,I=this.$M,B=S.weekdays,te=S.months,De=S.meridiem,me=function(W,oe,pe,we){return W&&(W[oe]||W(E,g))||pe[oe].slice(0,we)},Oe=function(W){return T.s(D%12||12,W,"0")},ce=De||function(W,oe,pe){var we=W<12?"AM":"PM";return pe?we.toLowerCase():we};return g.replace(p,function(W,oe){return oe||function(pe){switch(pe){case"YY":return String(E.$y).slice(-2);case"YYYY":return T.s(E.$y,4,"0");case"M":return I+1;case"MM":return T.s(I+1,2,"0");case"MMM":return me(S.monthsShort,I,te,3);case"MMMM":return me(te,I);case"D":return E.$D;case"DD":return T.s(E.$D,2,"0");case"d":return String(E.$W);case"dd":return me(S.weekdaysMin,E.$W,B,2);case"ddd":return me(S.weekdaysShort,E.$W,B,3);case"dddd":return B[E.$W];case"H":return String(D);case"HH":return T.s(D,2,"0");case"h":return Oe(1);case"hh":return Oe(2);case"a":return ce(D,M,!0);case"A":return ce(D,M,!1);case"m":return String(M);case"mm":return T.s(M,2,"0");case"s":return String(E.$s);case"ss":return T.s(E.$s,2,"0");case"SSS":return T.s(E.$ms,3,"0");case"Z":return b}return null}(W)||b.replace(":","")})},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(v,E,S){var g,b=this,D=T.p(E),M=k(v),I=(M.utcOffset()-this.utcOffset())*e,B=this-M,te=function(){return T.m(b,M)};switch(D){case m:g=te()/12;break;case l:g=te();break;case c:g=te()/3;break;case u:g=(B-I)/6048e5;break;case o:g=(B-I)/864e5;break;case s:g=B/r;break;case a:g=B/e;break;case i:g=B/t;break;default:g=B}return S?g:T.a(g)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return C[this.$L]},_.locale=function(v,E){if(!v)return this.$L;var S=this.clone(),g=V(v,E,!0);return g&&(S.$L=g),S},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},A}(),O=U.prototype;return k.prototype=O,[["$ms",n],["$s",i],["$m",a],["$H",s],["$W",o],["$M",l],["$y",m],["$D",f]].forEach(function(A){O[A[1]]=function(_){return this.$g(_,A[0],A[1])}}),k.extend=function(A,_){return A.$i||(A(_,U,k),A.$i=!0),k},k.locale=V,k.isDayjs=j,k.unix=function(A){return k(1e3*A)},k.en=C[$],k.Ls=C,k.p={},k})});var st=F((mr,pr)=>{(function(t,e){typeof mr=="object"&&typeof pr<"u"?pr.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(mr,function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,s={},o=function(d){return(d=+d)+(d>68?1900:2e3)},u=function(d){return function(p){this[d]=+p}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(d){(this.zone||(this.zone={})).offset=function(p){if(!p||p==="Z")return 0;var R=p.match(/([+-]|\d\d)/g),y=60*R[1]+(+R[2]||0);return y===0?0:R[0]==="+"?-y:y}(d)}],c=function(d){var p=s[d];return p&&(p.indexOf?p:p.s.concat(p.f))},m=function(d,p){var R,y=s.meridiem;if(y){for(var w=1;w<=24;w+=1)if(d.indexOf(y(w,0,p))>-1){R=w>12;break}}else R=d===(p?"pm":"PM");return R},f={A:[a,function(d){this.afternoon=m(d,!1)}],a:[a,function(d){this.afternoon=m(d,!0)}],Q:[r,function(d){this.month=3*(d-1)+1}],S:[r,function(d){this.milliseconds=100*+d}],SS:[n,function(d){this.milliseconds=10*+d}],SSS:[/\d{3}/,function(d){this.milliseconds=+d}],s:[i,u("seconds")],ss:[i,u("seconds")],m:[i,u("minutes")],mm:[i,u("minutes")],H:[i,u("hours")],h:[i,u("hours")],HH:[i,u("hours")],hh:[i,u("hours")],D:[i,u("day")],DD:[n,u("day")],Do:[a,function(d){var p=s.ordinal,R=d.match(/\d+/);if(this.day=R[0],p)for(var y=1;y<=31;y+=1)p(y).replace(/\[|\]/g,"")===d&&(this.day=y)}],w:[i,u("week")],ww:[n,u("week")],M:[i,u("month")],MM:[n,u("month")],MMM:[a,function(d){var p=c("months"),R=(c("monthsShort")||p.map(function(y){return y.slice(0,3)})).indexOf(d)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[a,function(d){var p=c("months").indexOf(d)+1;if(p<1)throw new Error;this.month=p%12||p}],Y:[/[+-]?\d+/,u("year")],YY:[n,function(d){this.year=o(d)}],YYYY:[/\d{4}/,u("year")],Z:l,ZZ:l};function h(d){var p,R;p=d,R=s&&s.formats;for(var y=(d=p.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(k,T,U){var O=U&&U.toUpperCase();return T||R[U]||t[U]||R[O].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(A,_,v){return _||v.slice(1)})})).match(e),w=y.length,$=0;$<w;$+=1){var C=y[$],x=f[C],j=x&&x[0],V=x&&x[1];y[$]=V?{regex:j,parser:V}:C.replace(/^\[|\]$/g,"")}return function(k){for(var T={},U=0,O=0;U<w;U+=1){var A=y[U];if(typeof A=="string")O+=A.length;else{var _=A.regex,v=A.parser,E=k.slice(O),S=_.exec(E)[0];v.call(T,S),k=k.replace(S,"")}}return function(g){var b=g.afternoon;if(b!==void 0){var D=g.hours;b?D<12&&(g.hours+=12):D===12&&(g.hours=0),delete g.afternoon}}(T),T}}return function(d,p,R){R.p.customParseFormat=!0,d&&d.parseTwoDigitYear&&(o=d.parseTwoDigitYear);var y=p.prototype,w=y.parse;y.parse=function($){var C=$.date,x=$.utc,j=$.args;this.$u=x;var V=j[1];if(typeof V=="string"){var k=j[2]===!0,T=j[3]===!0,U=k||T,O=j[2];T&&(O=j[2]),s=this.$locale(),!k&&O&&(s=R.Ls[O]),this.$d=function(E,S,g,b){try{if(["x","X"].indexOf(S)>-1)return new Date((S==="X"?1e3:1)*E);var D=h(S)(E),M=D.year,I=D.month,B=D.day,te=D.hours,De=D.minutes,me=D.seconds,Oe=D.milliseconds,ce=D.zone,W=D.week,oe=new Date,pe=B||(M||I?1:oe.getDate()),we=M||oe.getFullYear(),Ot=0;M&&!I||(Ot=I>0?I-1:oe.getMonth());var Ct,ar=te||0,sr=De||0,or=me||0,ur=Oe||0;return ce?new Date(Date.UTC(we,Ot,pe,ar,sr,or,ur+60*ce.offset*1e3)):g?new Date(Date.UTC(we,Ot,pe,ar,sr,or,ur)):(Ct=new Date(we,Ot,pe,ar,sr,or,ur),W&&(Ct=b(Ct).week(W).toDate()),Ct)}catch{return new Date("")}}(C,V,x,R),this.init(),O&&O!==!0&&(this.$L=this.locale(O).$L),U&&C!=this.format(V)&&(this.$d=new Date("")),s={}}else if(V instanceof Array)for(var A=V.length,_=1;_<=A;_+=1){j[1]=V[_-1];var v=R.apply(this,j);if(v.isValid()){this.$d=v.$d,this.$L=v.$L,this.init();break}_===A&&(this.$d=new Date(""))}else w.call(this,$)}}})});var zn=F((gr,vr)=>{(function(t,e){typeof gr=="object"&&typeof vr<"u"?vr.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_isBetween=e()})(gr,function(){"use strict";return function(t,e,r){e.prototype.isBetween=function(n,i,a,s){var o=r(n),u=r(i),l=(s=s||"()")[0]==="(",c=s[1]===")";return(l?this.isAfter(o,a):!this.isBefore(o,a))&&(c?this.isBefore(u,a):!this.isAfter(u,a))||(l?this.isBefore(o,a):!this.isAfter(o,a))&&(c?this.isAfter(u,a):!this.isBefore(u,a))}}})});var gi=F((Nf,Ar)=>{var du=Object.prototype.hasOwnProperty;function mi(t){return"[Throws: "+(t?t.message:"?")+"]"}function mu(t,e){if(du.call(t,e))try{return t[e]}catch(r){return mi(r)}return t[e]}function pi(t){var e=[];function r(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=r(n.toJSON());return e.pop(),i}catch(o){return mi(o)}if(Array.isArray(n)){var a=n.map(r);return e.pop(),a}var s=Object.keys(n).reduce(function(o,u){return o[u]=r(mu(n,u)),o},{});return e.pop(),s}return r(t)}Ar.exports=function(t,e,r){return JSON.stringify(pi(t),e,r)};Ar.exports.ensureProperties=pi});var yi=F((kf,vi)=>{var ee=require("fs"),lt=require("path");vi.exports=$t;$t.ncp=$t;function $t(t,e,r,n){var i=n;n||(i=r,r={});var a=process.cwd(),s=lt.resolve(a,t),o=lt.resolve(a,e),u=r.filter,l=r.rename,c=r.transform,m=r.clobber!==!1,f=r.modified,h=r.dereference,d=null,p=0,R=0,y=0,w=r.limit||$t.limit||16;w=w<1?1:w>512?512:w,$(s);function $(g){if(p++,u){if(u instanceof RegExp){if(!u.test(g))return S(!0)}else if(typeof u=="function"&&!u(g))return S(!0)}return C(g)}function C(g){var b=h?ee.stat:ee.lstat;if(y>=w)return setImmediate(function(){C(g)});y++,b(g,function(D,M){var I={};if(D)return E(D);if(I.name=g,I.mode=M.mode,I.mtime=M.mtime,I.atime=M.atime,M.isDirectory())return k(I);if(M.isFile())return x(I);if(M.isSymbolicLink())return O(g)})}function x(g){var b=g.name.replace(s,o);l&&(b=l(b)),v(b,function(D){if(D)return j(g,b);if(m&&V(b,function(){j(g,b)}),f){var M=h?ee.stat:ee.lstat;M(b,function(I,B){if(g.mtime.getTime()>B.mtime.getTime())j(g,b);else return S()})}else return S()})}function j(g,b){var D=ee.createReadStream(g.name),M=ee.createWriteStream(b,{mode:g.mode});D.on("error",E),M.on("error",E),c?c(D,M,g):M.on("open",function(){D.pipe(M)}),M.once("finish",function(){f&&ee.utimesSync(b,g.atime,g.mtime),S()})}function V(g,b){ee.unlink(g,function(D){return D?E(D):b()})}function k(g){var b=g.name.replace(s,o);v(b,function(D){if(D)return T(g,b);U(g.name)})}function T(g,b){ee.mkdir(b,g.mode,function(D){if(D)return E(D);U(g.name)})}function U(g){ee.readdir(g,function(b,D){return b?E(b):(D.forEach(function(M){$(lt.join(g,M))}),S())})}function O(g){var b=g.replace(s,o);ee.readlink(g,function(D,M){if(D)return E(D);A(M,b)})}function A(g,b){h&&(g=lt.resolve(a,g)),v(b,function(D){if(D)return _(g,b);ee.readlink(b,function(M,I){return M?E(M):(h&&(I=lt.resolve(a,I)),I===g?S():V(b,function(){_(g,b)}))})})}function _(g,b){ee.symlink(g,b,function(D){return D?E(D):S()})}function v(g,b){ee.lstat(g,function(D){return D&&D.code==="ENOENT"?b(!0):b(!1)})}function E(g){return r.stopOnError?i(g):(!d&&r.errs?d=ee.createWriteStream(r.errs):d||(d=[]),typeof d.write>"u"?d.push(g):d.write(g.stack+`

`),S())}function S(g){if(g||y--,R++,p===R&&y===0&&i!==void 0)return i(d||null)}}});var bi=F(($f,Si)=>{Si.exports=function(t,e){for(var r=[],n=0;n<t.length;n++){var i=e(t[n],n);pu(i)?r.push.apply(r,i):r.push(i)}return r};var pu=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"}});var Ri=F((If,Ei)=>{"use strict";Ei.exports=Di;function Di(t,e,r){t instanceof RegExp&&(t=_i(t,r)),e instanceof RegExp&&(e=_i(e,r));var n=wi(t,e,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+t.length,n[1]),post:r.slice(n[1]+e.length)}}function _i(t,e){var r=e.match(t);return r?r[0]:null}Di.range=wi;function wi(t,e,r){var n,i,a,s,o,u=r.indexOf(t),l=r.indexOf(e,u+1),c=u;if(u>=0&&l>0){if(t===e)return[u,l];for(n=[],a=r.length;c>=0&&!o;)c==u?(n.push(c),u=r.indexOf(t,c+1)):n.length==1?o=[n.pop(),l]:(i=n.pop(),i<a&&(a=i,s=l),l=r.indexOf(e,c+1)),c=u<l&&u>=0?u:l;n.length&&(o=[a,s])}return o}});var xi=F((Yf,Fi)=>{var gu=bi(),Ai=Ri();Fi.exports=Su;var Li="\0SLASH"+Math.random()+"\0",Ti="\0OPEN"+Math.random()+"\0",Tr="\0CLOSE"+Math.random()+"\0",Oi="\0COMMA"+Math.random()+"\0",Ci="\0PERIOD"+Math.random()+"\0";function Lr(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function vu(t){return t.split("\\\\").join(Li).split("\\{").join(Ti).split("\\}").join(Tr).split("\\,").join(Oi).split("\\.").join(Ci)}function yu(t){return t.split(Li).join("\\").split(Ti).join("{").split(Tr).join("}").split(Oi).join(",").split(Ci).join(".")}function Mi(t){if(!t)return[""];var e=[],r=Ai("{","}",t);if(!r)return t.split(",");var n=r.pre,i=r.body,a=r.post,s=n.split(",");s[s.length-1]+="{"+i+"}";var o=Mi(a);return a.length&&(s[s.length-1]+=o.shift(),s.push.apply(s,o)),e.push.apply(e,s),e}function Su(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),je(vu(t),!0).map(yu)):[]}function bu(t){return"{"+t+"}"}function _u(t){return/^-?0\d/.test(t)}function Du(t,e){return t<=e}function wu(t,e){return t>=e}function je(t,e){var r=[],n=Ai("{","}",t);if(!n||/\$$/.test(n.pre))return[t];var i=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),s=i||a,o=n.body.indexOf(",")>=0;if(!s&&!o)return n.post.match(/,.*\}/)?(t=n.pre+"{"+n.body+Tr+n.post,je(t)):[t];var u;if(s)u=n.body.split(/\.\./);else if(u=Mi(n.body),u.length===1&&(u=je(u[0],!1).map(bu),u.length===1)){var c=n.post.length?je(n.post,!1):[""];return c.map(function(O){return n.pre+u[0]+O})}var l=n.pre,c=n.post.length?je(n.post,!1):[""],m;if(s){var f=Lr(u[0]),h=Lr(u[1]),d=Math.max(u[0].length,u[1].length),p=u.length==3?Math.abs(Lr(u[2])):1,R=Du,y=h<f;y&&(p*=-1,R=wu);var w=u.some(_u);m=[];for(var $=f;R($,h);$+=p){var C;if(a)C=String.fromCharCode($),C==="\\"&&(C="");else if(C=String($),w){var x=d-C.length;if(x>0){var j=new Array(x+1).join("0");$<0?C="-"+j+C.slice(1):C=j+C}}m.push(C)}}else m=gu(u,function(U){return je(U,!1)});for(var V=0;V<m.length;V++)for(var k=0;k<c.length;k++){var T=l+m[V]+c[k];(!e||s||T)&&r.push(T)}return r}});var Pt=F((Pf,Yi)=>{Yi.exports=ie;ie.Minimatch=X;var ct=function(){try{return require("path")}catch{}}()||{sep:"/"};ie.sep=ct.sep;var Mr=ie.GLOBSTAR=X.GLOBSTAR={},Eu=xi(),Ni={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},Or="[^/]",Cr=Or+"*?",Ru="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Au="(?:(?!(?:\\/|^)\\.).)*?",ki=Lu("().*{}+?[]^$\\!");function Lu(t){return t.split("").reduce(function(e,r){return e[r]=!0,e},{})}var $i=/\/+/;ie.filter=Tu;function Tu(t,e){return e=e||{},function(r,n,i){return ie(r,t,e)}}function Ee(t,e){e=e||{};var r={};return Object.keys(t).forEach(function(n){r[n]=t[n]}),Object.keys(e).forEach(function(n){r[n]=e[n]}),r}ie.defaults=function(t){if(!t||typeof t!="object"||!Object.keys(t).length)return ie;var e=ie,r=function(i,a,s){return e(i,a,Ee(t,s))};return r.Minimatch=function(i,a){return new e.Minimatch(i,Ee(t,a))},r.Minimatch.defaults=function(i){return e.defaults(Ee(t,i)).Minimatch},r.filter=function(i,a){return e.filter(i,Ee(t,a))},r.defaults=function(i){return e.defaults(Ee(t,i))},r.makeRe=function(i,a){return e.makeRe(i,Ee(t,a))},r.braceExpand=function(i,a){return e.braceExpand(i,Ee(t,a))},r.match=function(n,i,a){return e.match(n,i,Ee(t,a))},r};X.defaults=function(t){return ie.defaults(t).Minimatch};function ie(t,e,r){return Yt(e),r||(r={}),!r.nocomment&&e.charAt(0)==="#"?!1:new X(e,r).match(t)}function X(t,e){if(!(this instanceof X))return new X(t,e);Yt(t),e||(e={}),t=t.trim(),!e.allowWindowsEscape&&ct.sep!=="/"&&(t=t.split(ct.sep).join("/")),this.options=e,this.set=[],this.pattern=t,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.make()}X.prototype.debug=function(){};X.prototype.make=Ou;function Ou(){var t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate();var r=this.globSet=this.braceExpand();e.debug&&(this.debug=function(){console.error.apply(console,arguments)}),this.debug(this.pattern,r),r=this.globParts=r.map(function(n){return n.split($i)}),this.debug(this.pattern,r),r=r.map(function(n,i,a){return n.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(n){return n.indexOf(!1)===-1}),this.debug(this.pattern,r),this.set=r}X.prototype.parseNegate=Cu;function Cu(){var t=this.pattern,e=!1,r=this.options,n=0;if(!r.nonegate){for(var i=0,a=t.length;i<a&&t.charAt(i)==="!";i++)e=!e,n++;n&&(this.pattern=t.substr(n)),this.negate=e}}ie.braceExpand=function(t,e){return Ii(t,e)};X.prototype.braceExpand=Ii;function Ii(t,e){return e||(this instanceof X?e=this.options:e={}),t=typeof t>"u"?this.pattern:t,Yt(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:Eu(t)}var Mu=1024*64,Yt=function(t){if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>Mu)throw new TypeError("pattern is too long")};X.prototype.parse=Fu;var It={};function Fu(t,e){Yt(t);var r=this.options;if(t==="**")if(r.noglobstar)t="*";else return Mr;if(t==="")return"";var n="",i=!!r.nocase,a=!1,s=[],o=[],u,l=!1,c=-1,m=-1,f=t.charAt(0)==="."?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",h=this;function d(){if(u){switch(u){case"*":n+=Cr,i=!0;break;case"?":n+=Or,i=!0;break;default:n+="\\"+u;break}h.debug("clearStateChar %j %j",u,n),u=!1}}for(var p=0,R=t.length,y;p<R&&(y=t.charAt(p));p++){if(this.debug("%s	%s %s %j",t,p,n,y),a&&ki[y]){n+="\\"+y,a=!1;continue}switch(y){case"/":return!1;case"\\":d(),a=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s	%s %s %j <-- stateChar",t,p,n,y),l){this.debug("  in class"),y==="!"&&p===m+1&&(y="^"),n+=y;continue}h.debug("call clearStateChar %j",u),d(),u=y,r.noext&&d();continue;case"(":if(l){n+="(";continue}if(!u){n+="\\(";continue}s.push({type:u,start:p-1,reStart:n.length,open:Ni[u].open,close:Ni[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 w=s.pop();n+=w.close,w.type==="!"&&o.push(w),w.reEnd=n.length;continue;case"|":if(l||!s.length||a){n+="\\|",a=!1;continue}d(),n+="|";continue;case"[":if(d(),l){n+="\\"+y;continue}l=!0,m=p,c=n.length,n+=y;continue;case"]":if(p===m+1||!l){n+="\\"+y,a=!1;continue}var $=t.substring(m+1,p);try{RegExp("["+$+"]")}catch{var C=this.parse($,It);n=n.substr(0,c)+"\\["+C[0]+"\\]",i=i||C[1],l=!1;continue}i=!0,l=!1,n+=y;continue;default:d(),a?a=!1:ki[y]&&!(y==="^"&&l)&&(n+="\\"),n+=y}}for(l&&($=t.substr(m+1),C=this.parse($,It),n=n.substr(0,c)+"\\["+C[0],i=i||C[1]),w=s.pop();w;w=s.pop()){var x=n.slice(w.reStart+w.open.length);this.debug("setting tail",n,w),x=x.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(M,I,B){return B||(B="\\"),I+I+B+"|"}),this.debug(`tail=%j
   %s`,x,x,w,n);var j=w.type==="*"?Cr:w.type==="?"?Or:"\\"+w.type;i=!0,n=n.slice(0,w.reStart)+j+"\\("+x}d(),a&&(n+="\\\\");var V=!1;switch(n.charAt(0)){case"[":case".":case"(":V=!0}for(var k=o.length-1;k>-1;k--){var T=o[k],U=n.slice(0,T.reStart),O=n.slice(T.reStart,T.reEnd-8),A=n.slice(T.reEnd-8,T.reEnd),_=n.slice(T.reEnd);A+=_;var v=U.split("(").length-1,E=_;for(p=0;p<v;p++)E=E.replace(/\)[+*?]?/,"");_=E;var S="";_===""&&e!==It&&(S="$");var g=U+O+_+S+A;n=g}if(n!==""&&i&&(n="(?=.)"+n),V&&(n=f+n),e===It)return[n,i];if(!i)return Nu(t);var b=r.nocase?"i":"";try{var D=new RegExp("^"+n+"$",b)}catch{return new RegExp("$.")}return D._glob=t,D._src=n,D}ie.makeRe=function(t,e){return new X(t,e||{}).makeRe()};X.prototype.makeRe=xu;function xu(){if(this.regexp||this.regexp===!1)return this.regexp;var t=this.set;if(!t.length)return this.regexp=!1,this.regexp;var e=this.options,r=e.noglobstar?Cr:e.dot?Ru:Au,n=e.nocase?"i":"",i=t.map(function(a){return a.map(function(s){return s===Mr?r:typeof s=="string"?ku(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}ie.match=function(t,e,r){r=r||{};var n=new X(e,r);return t=t.filter(function(i){return n.match(i)}),n.options.nonull&&!t.length&&t.push(e),t};X.prototype.match=function(e,r){if(typeof r>"u"&&(r=this.partial),this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;var n=this.options;ct.sep!=="/"&&(e=e.split(ct.sep).join("/")),e=e.split($i),this.debug(this.pattern,"split",e);var i=this.set;this.debug(this.pattern,"set",i);var a,s;for(s=e.length-1;s>=0&&(a=e[s],!a);s--);for(s=0;s<i.length;s++){var o=i[s],u=e;n.matchBase&&o.length===1&&(u=[a]);var l=this.matchOne(u,o,r);if(l)return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate};X.prototype.matchOne=function(t,e,r){var n=this.options;this.debug("matchOne",{this:this,file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var i=0,a=0,s=t.length,o=e.length;i<s&&a<o;i++,a++){this.debug("matchOne loop");var u=e[a],l=t[i];if(this.debug(e,u,l),u===!1)return!1;if(u===Mr){this.debug("GLOBSTAR",[e,u,l]);var c=i,m=a+1;if(m===o){for(this.debug("** at the end");i<s;i++)if(t[i]==="."||t[i]===".."||!n.dot&&t[i].charAt(0)===".")return!1;return!0}for(;c<s;){var f=t[c];if(this.debug(`
globstar while`,t,c,e,m,f),this.matchOne(t.slice(c),e.slice(m),r))return this.debug("globstar found match!",c,s,f),!0;if(f==="."||f===".."||!n.dot&&f.charAt(0)==="."){this.debug("dot detected!",t,c,e,m);break}this.debug("globstar swallow a segment, and continue"),c++}return!!(r&&(this.debug(`
>>> no match, partial?`,t,c,e,m),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&&a===o)return!0;if(i===s)return r;if(a===o)return i===s-1&&t[i]==="";throw new Error("wtf?")};function Nu(t){return t.replace(/\\(.)/g,"$1")}function ku(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var Pi=F((Vf,Fr)=>{typeof Object.create=="function"?Fr.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Fr.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}});var Vi=F((Uf,Nr)=>{try{if(xr=require("util"),typeof xr.inherits!="function")throw"";Nr.exports=xr.inherits}catch{Nr.exports=Pi()}var xr});var Ut=F((jf,Vt)=>{"use strict";function Ui(t){return t.charAt(0)==="/"}function ji(t){var e=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,r=e.exec(t),n=r[1]||"",i=!!(n&&n.charAt(1)!==":");return!!(r[2]||i)}Vt.exports=process.platform==="win32"?ji:Ui;Vt.exports.posix=Ui;Vt.exports.win32=ji});var Ir=F(he=>{he.alphasort=Bi;he.alphasorti=Gi;he.setopts=Vu;he.ownProp=qi;he.makeAbs=$r;he.finish=Uu;he.mark=ju;he.isIgnored=Hi;he.childrenIgnored=qu;function qi(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var qe=require("path"),$u=Pt(),Iu=Ut(),kr=$u.Minimatch;function Gi(t,e){return t.toLowerCase().localeCompare(e.toLowerCase())}function Bi(t,e){return t.localeCompare(e)}function Yu(t,e){t.ignore=e.ignore||[],Array.isArray(t.ignore)||(t.ignore=[t.ignore]),t.ignore.length&&(t.ignore=t.ignore.map(Pu))}function Pu(t){var e=null;if(t.slice(-3)==="/**"){var r=t.replace(/(\/\*\*)+$/,"");e=new kr(r,{dot:!0})}return{matcher:new kr(t,{dot:!0}),gmatcher:e}}function Vu(t,e,r){if(r||(r={}),r.matchBase&&e.indexOf("/")===-1){if(r.noglobstar)throw new Error("base matching requires globstar");e="**/"+e}t.silent=!!r.silent,t.pattern=e,t.strict=r.strict!==!1,t.realpath=!!r.realpath,t.realpathCache=r.realpathCache||Object.create(null),t.follow=!!r.follow,t.dot=!!r.dot,t.mark=!!r.mark,t.nodir=!!r.nodir,t.nodir&&(t.mark=!0),t.sync=!!r.sync,t.nounique=!!r.nounique,t.nonull=!!r.nonull,t.nosort=!!r.nosort,t.nocase=!!r.nocase,t.stat=!!r.stat,t.noprocess=!!r.noprocess,t.maxLength=r.maxLength||1/0,t.cache=r.cache||Object.create(null),t.statCache=r.statCache||Object.create(null),t.symlinks=r.symlinks||Object.create(null),Yu(t,r),t.changedCwd=!1;var n=process.cwd();qi(r,"cwd")?(t.cwd=r.cwd,t.changedCwd=qe.resolve(r.cwd)!==n):t.cwd=n,t.root=r.root||qe.resolve(t.cwd,"/"),t.root=qe.resolve(t.root),process.platform==="win32"&&(t.root=t.root.replace(/\\/g,"/")),t.nomount=!!r.nomount,r.nonegate=!0,r.nocomment=!0,t.minimatch=new kr(e,r),t.options=t.minimatch.options}function Uu(t){for(var e=t.nounique,r=e?[]:Object.create(null),n=0,i=t.matches.length;n<i;n++){var a=t.matches[n];if(!a||Object.keys(a).length===0){if(t.nonull){var s=t.minimatch.globSet[n];e?r.push(s):r[s]=!0}}else{var o=Object.keys(a);e?r.push.apply(r,o):o.forEach(function(u){r[u]=!0})}}if(e||(r=Object.keys(r)),t.nosort||(r=r.sort(t.nocase?Gi:Bi)),t.mark){for(var n=0;n<r.length;n++)r[n]=t._mark(r[n]);t.nodir&&(r=r.filter(function(u){return!/\/$/.test(u)}))}t.ignore.length&&(r=r.filter(function(u){return!Hi(t,u)})),t.found=r}function ju(t,e){var r=$r(t,e),n=t.cache[r],i=e;if(n){var a=n==="DIR"||Array.isArray(n),s=e.slice(-1)==="/";if(a&&!s?i+="/":!a&&s&&(i=i.slice(0,-1)),i!==e){var o=$r(t,i);t.statCache[o]=t.statCache[r],t.cache[o]=t.cache[r]}}return i}function $r(t,e){var r=e;return e.charAt(0)==="/"?r=qe.join(t.root,e):Iu(e)||e===""?r=e:t.changedCwd?r=qe.resolve(t.cwd,e):r=qe.resolve(e),r}function Hi(t,e){return t.ignore.length?t.ignore.some(function(r){return r.matcher.match(e)||!!(r.gmatcher&&r.gmatcher.match(e))}):!1}function qu(t,e){return t.ignore.length?t.ignore.some(function(r){return!!(r.gmatcher&&r.gmatcher.match(e))}):!1}});var Ji=F((Xf,Qi)=>{Qi.exports=Xi;Xi.GlobSync=z;var ft=require("fs"),zi=Pt(),Gf=zi.Minimatch,Bf=Vr().Glob,Hf=require("util"),Yr=require("path"),Wi=require("assert"),jt=Ut(),Re=Ir(),zf=Re.alphasort,Wf=Re.alphasorti,Gu=Re.setopts,Pr=Re.ownProp,Bu=Re.childrenIgnored;function Xi(t,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 z(t,e).found}function z(t,e){if(!t)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 z))return new z(t,e);if(Gu(this,t,e),this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var n=0;n<r;n++)this._process(this.minimatch.set[n],n,!1);this._finish()}z.prototype._finish=function(){if(Wi(this instanceof z),this.realpath){var t=this;this.matches.forEach(function(e,r){var n=t.matches[r]=Object.create(null);for(var i in e)try{i=t._makeAbs(i);var a=ft.realpathSync(i,t.realpathCache);n[a]=!0}catch(s){if(s.syscall==="stat")n[t._makeAbs(i)]=!0;else throw s}})}Re.finish(this)};z.prototype._process=function(t,e,r){Wi(this instanceof z);for(var n=0;typeof t[n]=="string";)n++;var i;switch(n){case t.length:this._processSimple(t.join("/"),e);return;case 0:i=null;break;default:i=t.slice(0,n).join("/");break}var a=t.slice(n),s;i===null?s=".":((jt(i)||jt(t.join("/")))&&(!i||!jt(i))&&(i="/"+i),s=i);var o=this._makeAbs(s);if(!Bu(this,s)){var u=a[0]===zi.GLOBSTAR;u?this._processGlobStar(i,s,o,a,e,r):this._processReaddir(i,s,o,a,e,r)}};z.prototype._processReaddir=function(t,e,r,n,i,a){var s=this._readdir(r,a);if(s){for(var o=n[0],u=!!this.minimatch.negate,l=o._glob,c=this.dot||l.charAt(0)===".",m=[],f=0;f<s.length;f++){var h=s[f];if(h.charAt(0)!=="."||c){var d;u&&!t?d=!h.match(o):d=h.match(o),d&&m.push(h)}}var p=m.length;if(p!==0){if(n.length===1&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(var f=0;f<p;f++){var h=m[f];t&&(t.slice(-1)!=="/"?h=t+"/"+h:h=t+h),h.charAt(0)==="/"&&!this.nomount&&(h=Yr.join(this.root,h)),this.matches[i][h]=!0}return}n.shift();for(var f=0;f<p;f++){var h=m[f],R;t?R=[t,h]:R=[h],this._process(R.concat(n),i,a)}}}};z.prototype._emitMatch=function(t,e){var r=this._makeAbs(e);if(this.mark&&(e=this._mark(e)),!this.matches[t][e]){if(this.nodir){var n=this.cache[this._makeAbs(e)];if(n==="DIR"||Array.isArray(n))return}this.matches[t][e]=!0,this.stat&&this._stat(e)}};z.prototype._readdirInGlobStar=function(t){if(this.follow)return this._readdir(t,!1);var e,r,n;try{r=ft.lstatSync(t)}catch{return null}var i=r.isSymbolicLink();return this.symlinks[t]=i,!i&&!r.isDirectory()?this.cache[t]="FILE":e=this._readdir(t,!1),e};z.prototype._readdir=function(t,e){var r;if(e&&!Pr(this.symlinks,t))return this._readdirInGlobStar(t);if(Pr(this.cache,t)){var n=this.cache[t];if(!n||n==="FILE")return null;if(Array.isArray(n))return n}try{return this._readdirEntries(t,ft.readdirSync(t))}catch(i){return this._readdirError(t,i),null}};z.prototype._readdirEntries=function(t,e){if(!this.mark&&!this.stat)for(var r=0;r<e.length;r++){var n=e[r];t==="/"?n=t+n:n=t+"/"+n,this.cache[n]=!0}return this.cache[t]=e,e};z.prototype._readdirError=function(t,e){switch(e.code){case"ENOTSUP":case"ENOTDIR":this.cache[this._makeAbs(t)]="FILE";break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=!1;break;default:if(this.cache[this._makeAbs(t)]=!1,this.strict)throw e;this.silent||console.error("glob error",e);break}};z.prototype._processGlobStar=function(t,e,r,n,i,a){var s=this._readdir(r,a);if(s){var o=n.slice(1),u=t?[t]:[],l=u.concat(o);this._process(l,i,!1);var c=s.length,m=this.symlinks[r];if(!(m&&a))for(var f=0;f<c;f++){var h=s[f];if(!(h.charAt(0)==="."&&!this.dot)){var d=u.concat(s[f],o);this._process(d,i,!0);var p=u.concat(s[f],n);this._process(p,i,!0)}}}};z.prototype._processSimple=function(t,e){var r=this._stat(t);if(this.matches[e]||(this.matches[e]=Object.create(null)),!!r){if(t&&jt(t)&&!this.nomount){var n=/[\/\\]$/.test(t);t.charAt(0)==="/"?t=Yr.join(this.root,t):(t=Yr.resolve(this.root,t),n&&(t+="/"))}process.platform==="win32"&&(t=t.replace(/\\/g,"/")),this.matches[e][t]=!0}};z.prototype._stat=function(t){var e=this._makeAbs(t),r=t.slice(-1)==="/";if(t.length>this.maxLength)return!1;if(!this.stat&&Pr(this.cache,e)){var s=this.cache[e];if(Array.isArray(s)&&(s="DIR"),!r||s==="DIR")return s;if(r&&s==="FILE")return!1}var n,i=this.statCache[e];if(!i){var a;try{a=ft.lstatSync(e)}catch{return!1}if(a.isSymbolicLink())try{i=ft.statSync(e)}catch{i=a}else i=a}this.statCache[e]=i;var s=i.isDirectory()?"DIR":"FILE";return this.cache[e]=this.cache[e]||s,r&&s!=="DIR"?!1:s};z.prototype._mark=function(t){return Re.mark(this,t)};z.prototype._makeAbs=function(t){return Re.makeAbs(this,t)}});var Ur=F((Qf,Zi)=>{Zi.exports=Ki;function Ki(t,e){if(t&&e)return Ki(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(n){r[n]=t[n]}),r;function r(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var a=t.apply(this,n),s=n[n.length-1];return typeof a=="function"&&a!==s&&Object.keys(s).forEach(function(o){a[o]=s[o]}),a}}});var qr=F((Jf,jr)=>{var ea=Ur();jr.exports=ea(qt);jr.exports.strict=ea(ta);qt.proto=qt(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return qt(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return ta(this)},configurable:!0})});function qt(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function ta(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}});var na=F((Kf,ra)=>{var Hu=Ur(),ht=Object.create(null),zu=qr();ra.exports=Hu(Wu);function Wu(t,e){return ht[t]?(ht[t].push(e),null):(ht[t]=[e],Xu(t))}function Xu(t){return zu(function e(){var r=ht[t],n=r.length,i=Qu(arguments);try{for(var a=0;a<n;a++)r[a].apply(null,i)}finally{r.length>n?(r.splice(0,n),process.nextTick(function(){e.apply(null,i)})):delete ht[t]}})}function Qu(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n]=t[n];return r}});var Vr=F((nh,aa)=>{aa.exports=Me;var dt=require("fs"),ia=Pt(),Zf=ia.Minimatch,Ju=Vi(),Ku=require("events").EventEmitter,Gr=require("path"),Br=require("assert"),Gt=Ut(),zr=Ji(),ve=Ir(),eh=ve.alphasort,th=ve.alphasorti,Zu=ve.setopts,Hr=ve.ownProp,Wr=na(),rh=require("util"),el=ve.childrenIgnored,tl=ve.isIgnored,rl=qr();function Me(t,e,r){if(typeof e=="function"&&(r=e,e={}),e||(e={}),e.sync){if(r)throw new TypeError("callback provided to sync glob");return zr(t,e)}return new P(t,e,r)}Me.sync=zr;var nl=Me.GlobSync=zr.GlobSync;Me.glob=Me;function il(t,e){if(e===null||typeof e!="object")return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}Me.hasMagic=function(t,e){var r=il({},e);r.noprocess=!0;var n=new P(t,r),i=n.minimatch.set;if(i.length>1)return!0;for(var a=0;a<i[0].length;a++)if(typeof i[0][a]!="string")return!0;return!1};Me.Glob=P;Ju(P,Ku);function P(t,e,r){if(typeof e=="function"&&(r=e,e=null),e&&e.sync){if(r)throw new TypeError("callback provided to sync glob");return new nl(t,e)}if(!(this instanceof P))return new P(t,e,r);Zu(this,t,e),this._didRealPath=!1;var i=this.minimatch.set.length;this.matches=new Array(i),typeof r=="function"&&(r=rl(r),this.on("error",r),this.on("end",function(o){r(null,o)}));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 a=0;a<i;a++)this._process(this.minimatch.set[a],a,!1,s);function s(){--n._processing,n._processing<=0&&n._finish()}}P.prototype._finish=function(){if(Br(this instanceof P),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();ve.finish(this),this.emit("end",this.found)}};P.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=!0;var t=this.matches.length;if(t===0)return this._finish();for(var e=this,r=0;r<this.matches.length;r++)this._realpathSet(r,n);function n(){--t===0&&e._finish()}};P.prototype._realpathSet=function(t,e){var r=this.matches[t];if(!r)return e();var n=Object.keys(r),i=this,a=n.length;if(a===0)return e();var s=this.matches[t]=Object.create(null);n.forEach(function(o,u){o=i._makeAbs(o),dt.realpath(o,i.realpathCache,function(l,c){l?l.syscall==="stat"?s[o]=!0:i.emit("error",l):s[c]=!0,--a===0&&(i.matches[t]=s,e())})})};P.prototype._mark=function(t){return ve.mark(this,t)};P.prototype._makeAbs=function(t){return ve.makeAbs(this,t)};P.prototype.abort=function(){this.aborted=!0,this.emit("abort")};P.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))};P.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var t=this._emitQueue.slice(0);this._emitQueue.length=0;for(var e=0;e<t.length;e++){var r=t[e];this._emitMatch(r[0],r[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])}}}};P.prototype._process=function(t,e,r,n){if(Br(this instanceof P),Br(typeof n=="function"),!this.aborted){if(this._processing++,this.paused){this._processQueue.push([t,e,r,n]);return}for(var i=0;typeof t[i]=="string";)i++;var a;switch(i){case t.length:this._processSimple(t.join("/"),e,n);return;case 0:a=null;break;default:a=t.slice(0,i).join("/");break}var s=t.slice(i),o;a===null?o=".":((Gt(a)||Gt(t.join("/")))&&(!a||!Gt(a))&&(a="/"+a),o=a);var u=this._makeAbs(o);if(el(this,o))return n();var l=s[0]===ia.GLOBSTAR;l?this._processGlobStar(a,o,u,s,e,r,n):this._processReaddir(a,o,u,s,e,r,n)}};P.prototype._processReaddir=function(t,e,r,n,i,a,s){var o=this;this._readdir(r,a,function(u,l){return o._processReaddir2(t,e,r,n,i,a,l,s)})};P.prototype._processReaddir2=function(t,e,r,n,i,a,s,o){if(!s)return o();for(var u=n[0],l=!!this.minimatch.negate,c=u._glob,m=this.dot||c.charAt(0)===".",f=[],h=0;h<s.length;h++){var d=s[h];if(d.charAt(0)!=="."||m){var p;l&&!t?p=!d.match(u):p=d.match(u),p&&f.push(d)}}var R=f.length;if(R===0)return o();if(n.length===1&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(var h=0;h<R;h++){var d=f[h];t&&(t!=="/"?d=t+"/"+d:d=t+d),d.charAt(0)==="/"&&!this.nomount&&(d=Gr.join(this.root,d)),this._emitMatch(i,d)}return o()}n.shift();for(var h=0;h<R;h++){var d=f[h],y;t&&(t!=="/"?d=t+"/"+d:d=t+d),this._process([d].concat(n),i,a,o)}o()};P.prototype._emitMatch=function(t,e){if(!this.aborted&&!this.matches[t][e]&&!tl(this,e)){if(this.paused){this._emitQueue.push([t,e]);return}var r=this._makeAbs(e);if(this.nodir){var n=this.cache[r];if(n==="DIR"||Array.isArray(n))return}this.mark&&(e=this._mark(e)),this.matches[t][e]=!0;var i=this.statCache[r];i&&this.emit("stat",e,i),this.emit("match",e)}};P.prototype._readdirInGlobStar=function(t,e){if(this.aborted)return;if(this.follow)return this._readdir(t,!1,e);var r="lstat\0"+t,n=this,i=Wr(r,a);i&&dt.lstat(t,i);function a(s,o){if(s)return e();var u=o.isSymbolicLink();n.symlinks[t]=u,!u&&!o.isDirectory()?(n.cache[t]="FILE",e()):n._readdir(t,!1,e)}};P.prototype._readdir=function(t,e,r){if(!this.aborted&&(r=Wr("readdir\0"+t+"\0"+e,r),!!r)){if(e&&!Hr(this.symlinks,t))return this._readdirInGlobStar(t,r);if(Hr(this.cache,t)){var n=this.cache[t];if(!n||n==="FILE")return r();if(Array.isArray(n))return r(null,n)}var i=this;dt.readdir(t,al(this,t,r))}};function al(t,e,r){return function(n,i){n?t._readdirError(e,n,r):t._readdirEntries(e,i,r)}}P.prototype._readdirEntries=function(t,e,r){if(!this.aborted){if(!this.mark&&!this.stat)for(var n=0;n<e.length;n++){var i=e[n];t==="/"?i=t+i:i=t+"/"+i,this.cache[i]=!0}return this.cache[t]=e,r(null,e)}};P.prototype._readdirError=function(t,e,r){if(!this.aborted){switch(e.code){case"ENOTSUP":case"ENOTDIR":this.cache[this._makeAbs(t)]="FILE";break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=!1;break;default:this.cache[this._makeAbs(t)]=!1,this.strict&&(this.emit("error",e),this.abort()),this.silent||console.error("glob error",e);break}return r()}};P.prototype._processGlobStar=function(t,e,r,n,i,a,s){var o=this;this._readdir(r,a,function(u,l){o._processGlobStar2(t,e,r,n,i,a,l,s)})};P.prototype._processGlobStar2=function(t,e,r,n,i,a,s,o){if(!s)return o();var u=n.slice(1),l=t?[t]:[],c=l.concat(u);this._process(c,i,!1,o);var m=this.symlinks[r],f=s.length;if(m&&a)return o();for(var h=0;h<f;h++){var d=s[h];if(!(d.charAt(0)==="."&&!this.dot)){var p=l.concat(s[h],u);this._process(p,i,!0,o);var R=l.concat(s[h],n);this._process(R,i,!0,o)}}o()};P.prototype._processSimple=function(t,e,r){var n=this;this._stat(t,function(i,a){n._processSimple2(t,e,i,a,r)})};P.prototype._processSimple2=function(t,e,r,n,i){if(this.matches[e]||(this.matches[e]=Object.create(null)),!n)return i();if(t&&Gt(t)&&!this.nomount){var a=/[\/\\]$/.test(t);t.charAt(0)==="/"?t=Gr.join(this.root,t):(t=Gr.resolve(this.root,t),a&&(t+="/"))}process.platform==="win32"&&(t=t.replace(/\\/g,"/")),this._emitMatch(e,t),i()};P.prototype._stat=function(t,e){var r=this._makeAbs(t),n=t.slice(-1)==="/";if(t.length>this.maxLength)return e();if(!this.stat&&Hr(this.cache,r)){var i=this.cache[r];if(Array.isArray(i)&&(i="DIR"),!n||i==="DIR")return e(null,i);if(n&&i==="FILE")return e()}var a,s=this.statCache[r];if(s!==void 0){if(s===!1)return e(null,s);var o=s.isDirectory()?"DIR":"FILE";return n&&o==="FILE"?e():e(null,o,s)}var u=this,l=Wr("stat\0"+r,c);l&&dt.lstat(r,l);function c(m,f){if(f&&f.isSymbolicLink())return dt.stat(r,function(h,d){h?u._stat2(t,r,null,f,e):u._stat2(t,r,h,d,e)});u._stat2(t,r,m,f,e)}};P.prototype._stat2=function(t,e,r,n,i){if(r)return this.statCache[e]=!1,i();var a=t.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,a&&s!=="DIR"?i():i(null,s,n)}});var fa=F((ih,ca)=>{ca.exports=Kr;Kr.sync=la;var Y=require("assert"),sa=require("path"),zt=require("fs"),Wt=Vr(),oa={nosort:!0,nocomment:!0,nonegate:!0,silent:!0},Xr=0,Jr=process.platform==="win32";function ua(t){var e=["unlink","chmod","stat","lstat","rmdir","readdir"];e.forEach(function(r){t[r]=t[r]||zt[r],r=r+"Sync",t[r]=t[r]||zt[r]}),t.maxBusyTries=t.maxBusyTries||3,t.emfileWait=t.emfileWait||1e3,t.disableGlob=t.disableGlob||!1}function Kr(t,e,r){typeof e=="function"&&(r=e,e={}),Y(t,"rimraf: missing path"),Y.equal(typeof t,"string","rimraf: path should be a string"),Y(e,"rimraf: missing options"),Y.equal(typeof e,"object","rimraf: options should be object"),Y.equal(typeof r,"function","rimraf: callback function required"),ua(e);var n=0,i=null,a=0;if(e.disableGlob||!Wt.hasMagic(t))return o(null,[t]);zt.lstat(t,function(u,l){if(!u)return o(null,[t]);Wt(t,oa,o)});function s(u){i=i||u,--a===0&&r(i)}function o(u,l){if(u)return r(u);if(a=l.length,a===0)return r();l.forEach(function(c){Qr(c,e,function m(f){if(f){if(Jr&&(f.code==="EBUSY"||f.code==="ENOTEMPTY"||f.code==="EPERM")&&n<e.maxBusyTries){n++;var h=n*100;return setTimeout(function(){Qr(c,e,m)},h)}if(f.code==="EMFILE"&&Xr<e.emfileWait)return setTimeout(function(){Qr(c,e,m)},Xr++);f.code==="ENOENT"&&(f=null)}Xr=0,s(f)})})}}function Qr(t,e,r){Y(t),Y(e),Y(typeof r=="function"),e.lstat(t,function(n,i){if(n&&n.code==="ENOENT")return r(null);if(i&&i.isDirectory())return Bt(t,e,n,r);e.unlink(t,function(a){if(a){if(a.code==="ENOENT")return r(null);if(a.code==="EPERM")return Jr?sl(t,e,a,r):Bt(t,e,a,r);if(a.code==="EISDIR")return Bt(t,e,a,r)}return r(a)})})}function sl(t,e,r,n){Y(t),Y(e),Y(typeof n=="function"),r&&Y(r instanceof Error),e.chmod(t,666,function(i){i?n(i.code==="ENOENT"?null:r):e.stat(t,function(a,s){a?n(a.code==="ENOENT"?null:r):s.isDirectory()?Bt(t,e,r,n):e.unlink(t,n)})})}function ol(t,e,r){Y(t),Y(e),r&&Y(r instanceof Error);try{e.chmodSync(t,666)}catch(i){if(i.code==="ENOENT")return;throw r}try{var n=e.statSync(t)}catch(i){if(i.code==="ENOENT")return;throw r}n.isDirectory()?Ht(t,e,r):e.unlinkSync(t)}function Bt(t,e,r,n){Y(t),Y(e),r&&Y(r instanceof Error),Y(typeof n=="function"),e.rmdir(t,function(i){i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")?ul(t,e,n):i&&i.code==="ENOTDIR"?n(r):n(i)})}function ul(t,e,r){Y(t),Y(e),Y(typeof r=="function"),e.readdir(t,function(n,i){if(n)return r(n);var a=i.length;if(a===0)return e.rmdir(t,r);var s;i.forEach(function(o){Kr(sa.join(t,o),e,function(u){if(!s){if(u)return r(s=u);--a===0&&e.rmdir(t,r)}})})})}function la(t,e){e=e||{},ua(e),Y(t,"rimraf: missing path"),Y.equal(typeof t,"string","rimraf: path should be a string"),Y(e,"rimraf: missing options"),Y.equal(typeof e,"object","rimraf: options should be object");var r;if(e.disableGlob||!Wt.hasMagic(t))r=[t];else try{zt.lstatSync(t),r=[t]}catch{r=Wt.sync(t,oa)}if(r.length)for(var n=0;n<r.length;n++){var t=r[n];try{var i=e.lstatSync(t)}catch(s){if(s.code==="ENOENT")return}try{i&&i.isDirectory()?Ht(t,e,null):e.unlinkSync(t)}catch(s){if(s.code==="ENOENT")return;if(s.code==="EPERM")return Jr?ol(t,e,s):Ht(t,e,s);if(s.code!=="EISDIR")throw s;Ht(t,e,s)}}}function Ht(t,e,r){Y(t),Y(e),r&&Y(r instanceof Error);try{e.rmdirSync(t)}catch(n){if(n.code==="ENOENT")return;if(n.code==="ENOTDIR")throw r;(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")&&ll(t,e)}}function ll(t,e){Y(t),Y(e),e.readdirSync(t).forEach(function(r){la(sa.join(t,r),e)}),e.rmdirSync(t,e)}});var pa=F((ah,ma)=>{var mt=require("path"),ha=require("fs"),da=parseInt("0777",8);ma.exports=Ge.mkdirp=Ge.mkdirP=Ge;function Ge(t,e,r,n){typeof e=="function"?(r=e,e={}):(!e||typeof e!="object")&&(e={mode:e});var i=e.mode,a=e.fs||ha;i===void 0&&(i=da),n||(n=null);var s=r||function(){};t=mt.resolve(t),a.mkdir(t,i,function(o){if(!o)return n=n||t,s(null,n);switch(o.code){case"ENOENT":if(mt.dirname(t)===t)return s(o);Ge(mt.dirname(t),e,function(u,l){u?s(u,l):Ge(t,e,s,l)});break;default:a.stat(t,function(u,l){u||!l.isDirectory()?s(o,n):s(null,n)});break}})}Ge.sync=function t(e,r,n){(!r||typeof r!="object")&&(r={mode:r});var i=r.mode,a=r.fs||ha;i===void 0&&(i=da),n||(n=null),e=mt.resolve(e);try{a.mkdirSync(e,i),n=n||e}catch(o){switch(o.code){case"ENOENT":n=t(mt.dirname(e),r,n),t(e,r,n);break;default:var s;try{s=a.statSync(e)}catch{throw o}if(!s.isDirectory())throw o;break}}return n}});var ba=F((sh,Sa)=>{var Be=require("fs"),cl=yi().ncp,fl=require("path"),ga=fa(),hl=pa();Sa.exports=dl;function dl(t,e,r,n){typeof r=="function"&&(n=r,r={});var i=!!r.mkdirp,a=r.clobber!==!1,s=r.limit||16;i?o():u();function o(){hl(fl.dirname(e),function(l){if(l)return n(l);u()})}function u(){a?Be.rename(t,e,function(l){if(!l)return n();if(l.code!=="EXDEV")return n(l);va(t,e,a,s,n)}):Be.link(t,e,function(l){if(l){if(l.code==="EXDEV"){va(t,e,a,s,n);return}if(l.code==="EISDIR"||l.code==="EPERM"){ya(t,e,a,s,n);return}n(l);return}Be.unlink(t,n)})}}function va(t,e,r,n,i){var a=r?"w":"wx",s=Be.createReadStream(t),o=Be.createWriteStream(e,{flags:a});s.on("error",function(l){s.destroy(),o.destroy(),o.removeListener("close",u),l.code==="EISDIR"||l.code==="EPERM"?ya(t,e,r,n,i):i(l)}),o.on("error",function(l){s.destroy(),o.destroy(),o.removeListener("close",u),i(l)}),o.once("close",u),s.pipe(o);function u(){Be.unlink(t,i)}}function ya(t,e,r,n,i){var a={stopOnErr:!0,clobber:!1,limit:n};r?ga(e,{disableGlob:!0},function(o){if(o)return i(o);s()}):s();function s(){cl(t,e,a,function(o){if(o)return i(o[0]);ga(t,{disableGlob:!0},i)})}}});var Da=F(Zr=>{var _a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Zr.encode=function(t){if(0<=t&&t<_a.length)return _a[t];throw new TypeError("Must be between 0 and 63: "+t)};Zr.decode=function(t){var e=65,r=90,n=97,i=122,a=48,s=57,o=43,u=47,l=26,c=52;return e<=t&&t<=r?t-e:n<=t&&t<=i?t-n+l:a<=t&&t<=s?t-a+c:t==o?62:t==u?63:-1}});var rn=F(tn=>{var wa=Da(),en=5,Ea=1<<en,Ra=Ea-1,Aa=Ea;function ml(t){return t<0?(-t<<1)+1:(t<<1)+0}function pl(t){var e=(t&1)===1,r=t>>1;return e?-r:r}tn.encode=function(e){var r="",n,i=ml(e);do n=i&Ra,i>>>=en,i>0&&(n|=Aa),r+=wa.encode(n);while(i>0);return r};tn.decode=function(e,r,n){var i=e.length,a=0,s=0,o,u;do{if(r>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(u=wa.decode(e.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));o=!!(u&Aa),u&=Ra,a=a+(u<<s),s+=en}while(o);n.value=pl(a),n.rest=r}});var We=F(Z=>{function gl(t,e,r){if(e in t)return t[e];if(arguments.length===3)return r;throw new Error('"'+e+'" is a required argument.')}Z.getArg=gl;var La=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,vl=/^data:.+\,.+$/;function pt(t){var e=t.match(La);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}Z.urlParse=pt;function He(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}Z.urlGenerate=He;function nn(t){var e=t,r=pt(t);if(r){if(!r.path)return t;e=r.path}for(var n=Z.isAbsolute(e),i=e.split(/\/+/),a,s=0,o=i.length-1;o>=0;o--)a=i[o],a==="."?i.splice(o,1):a===".."?s++:s>0&&(a===""?(i.splice(o+1,s),s=0):(i.splice(o,2),s--));return e=i.join("/"),e===""&&(e=n?"/":"."),r?(r.path=e,He(r)):e}Z.normalize=nn;function Ta(t,e){t===""&&(t="."),e===""&&(e=".");var r=pt(e),n=pt(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),He(r);if(r||e.match(vl))return e;if(n&&!n.host&&!n.path)return n.host=e,He(n);var i=e.charAt(0)==="/"?e:nn(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=i,He(n)):i}Z.join=Ta;Z.isAbsolute=function(t){return t.charAt(0)==="/"||La.test(t)};function yl(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var r=0;e.indexOf(t+"/")!==0;){var n=t.lastIndexOf("/");if(n<0||(t=t.slice(0,n),t.match(/^([^\/]+:\/)?\/*$/)))return e;++r}return Array(r+1).join("../")+e.substr(t.length+1)}Z.relative=yl;var Oa=function(){var t=Object.create(null);return!("__proto__"in t)}();function Ca(t){return t}function Sl(t){return Ma(t)?"$"+t:t}Z.toSetString=Oa?Ca:Sl;function bl(t){return Ma(t)?t.slice(1):t}Z.fromSetString=Oa?Ca:bl;function Ma(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var r=e-10;r>=0;r--)if(t.charCodeAt(r)!==36)return!1;return!0}function _l(t,e,r){var n=ze(t.source,e.source);return n!==0||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:ze(t.name,e.name)}Z.compareByOriginalPositions=_l;function Dl(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=ze(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:ze(t.name,e.name)}Z.compareByGeneratedPositionsDeflated=Dl;function ze(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}function wl(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=ze(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:ze(t.name,e.name)}Z.compareByGeneratedPositionsInflated=wl;function El(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}Z.parseSourceMapInput=El;function Rl(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=pt(r);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=Ta(He(n),e)}return nn(e)}Z.computeSourceURL=Rl});var on=F(Fa=>{var an=We(),sn=Object.prototype.hasOwnProperty,Fe=typeof Map<"u";function ye(){this._array=[],this._set=Fe?new Map:Object.create(null)}ye.fromArray=function(e,r){for(var n=new ye,i=0,a=e.length;i<a;i++)n.add(e[i],r);return n};ye.prototype.size=function(){return Fe?this._set.size:Object.getOwnPropertyNames(this._set).length};ye.prototype.add=function(e,r){var n=Fe?e:an.toSetString(e),i=Fe?this.has(e):sn.call(this._set,n),a=this._array.length;(!i||r)&&this._array.push(e),i||(Fe?this._set.set(e,a):this._set[n]=a)};ye.prototype.has=function(e){if(Fe)return this._set.has(e);var r=an.toSetString(e);return sn.call(this._set,r)};ye.prototype.indexOf=function(e){if(Fe){var r=this._set.get(e);if(r>=0)return r}else{var n=an.toSetString(e);if(sn.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};ye.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};ye.prototype.toArray=function(){return this._array.slice()};Fa.ArraySet=ye});var ka=F(Na=>{var xa=We();function Al(t,e){var r=t.generatedLine,n=e.generatedLine,i=t.generatedColumn,a=e.generatedColumn;return n>r||n==r&&a>=i||xa.compareByGeneratedPositionsInflated(t,e)<=0}function Xt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Xt.prototype.unsortedForEach=function(e,r){this._array.forEach(e,r)};Xt.prototype.add=function(e){Al(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};Xt.prototype.toArray=function(){return this._sorted||(this._array.sort(xa.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};Na.MappingList=Xt});var un=F($a=>{var gt=rn(),H=We(),Qt=on().ArraySet,Ll=ka().MappingList;function ue(t){t||(t={}),this._file=H.getArg(t,"file",null),this._sourceRoot=H.getArg(t,"sourceRoot",null),this._skipValidation=H.getArg(t,"skipValidation",!1),this._sources=new Qt,this._names=new Qt,this._mappings=new Ll,this._sourcesContents=null}ue.prototype._version=3;ue.fromSourceMap=function(e){var r=e.sourceRoot,n=new ue({file:e.file,sourceRoot:r});return e.eachMapping(function(i){var a={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(a.source=i.source,r!=null&&(a.source=H.relative(r,a.source)),a.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(a.name=i.name)),n.addMapping(a)}),e.sources.forEach(function(i){var a=i;r!==null&&(a=H.relative(r,i)),n._sources.has(a)||n._sources.add(a);var s=e.sourceContentFor(i);s!=null&&n.setSourceContent(i,s)}),n};ue.prototype.addMapping=function(e){var r=H.getArg(e,"generated"),n=H.getArg(e,"original",null),i=H.getArg(e,"source",null),a=H.getArg(e,"name",null);this._skipValidation||this._validateMapping(r,n,i,a),i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),a!=null&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:a})};ue.prototype.setSourceContent=function(e,r){var n=e;this._sourceRoot!=null&&(n=H.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[H.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[H.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};ue.prototype.applySourceMap=function(e,r,n){var i=r;if(r==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 a=this._sourceRoot;a!=null&&(i=H.relative(a,i));var s=new Qt,o=new Qt;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=H.join(n,u.source)),a!=null&&(u.source=H.relative(a,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 m=u.name;m!=null&&!o.has(m)&&o.add(m)},this),this._sources=s,this._names=o,e.sources.forEach(function(u){var l=e.sourceContentFor(u);l!=null&&(n!=null&&(u=H.join(n,u)),a!=null&&(u=H.relative(a,u)),this.setSourceContent(u,l))},this)};ue.prototype._validateMapping=function(e,r,n,i){if(r&&typeof r.line!="number"&&typeof r.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&&!r&&!n&&!i)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:i}))}};ue.prototype._serializeMappings=function(){for(var e=0,r=1,n=0,i=0,a=0,s=0,o="",u,l,c,m,f=this._mappings.toArray(),h=0,d=f.length;h<d;h++){if(l=f[h],u="",l.generatedLine!==r)for(e=0;l.generatedLine!==r;)u+=";",r++;else if(h>0){if(!H.compareByGeneratedPositionsInflated(l,f[h-1]))continue;u+=","}u+=gt.encode(l.generatedColumn-e),e=l.generatedColumn,l.source!=null&&(m=this._sources.indexOf(l.source),u+=gt.encode(m-s),s=m,u+=gt.encode(l.originalLine-1-i),i=l.originalLine-1,u+=gt.encode(l.originalColumn-n),n=l.originalColumn,l.name!=null&&(c=this._names.indexOf(l.name),u+=gt.encode(c-a),a=c)),o+=u}return o};ue.prototype._generateSourcesContent=function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=H.relative(r,n));var i=H.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};ue.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};ue.prototype.toString=function(){return JSON.stringify(this.toJSON())};$a.SourceMapGenerator=ue});var Ia=F(xe=>{xe.GREATEST_LOWER_BOUND=1;xe.LEAST_UPPER_BOUND=2;function ln(t,e,r,n,i,a){var s=Math.floor((e-t)/2)+t,o=i(r,n[s],!0);return o===0?s:o>0?e-s>1?ln(s,e,r,n,i,a):a==xe.LEAST_UPPER_BOUND?e<n.length?e:-1:s:s-t>1?ln(t,s,r,n,i,a):a==xe.LEAST_UPPER_BOUND?s:t<0?-1:t}xe.search=function(e,r,n,i){if(r.length===0)return-1;var a=ln(-1,r.length,e,r,n,i||xe.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&n(r[a],r[a-1],!0)===0;)--a;return a}});var Pa=F(Ya=>{function cn(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Tl(t,e){return Math.round(t+Math.random()*(e-t))}function fn(t,e,r,n){if(r<n){var i=Tl(r,n),a=r-1;cn(t,i,n);for(var s=t[n],o=r;o<n;o++)e(t[o],s)<=0&&(a+=1,cn(t,a,o));cn(t,a+1,o);var u=a+1;fn(t,e,r,u-1),fn(t,e,u+1,n)}}Ya.quickSort=function(t,e){fn(t,e,0,t.length-1)}});var Ua=F(Jt=>{var L=We(),hn=Ia(),Xe=on().ArraySet,Ol=rn(),vt=Pa().quickSort;function q(t,e){var r=t;return typeof t=="string"&&(r=L.parseSourceMapInput(t)),r.sections!=null?new le(r,e):new Q(r,e)}q.fromSourceMap=function(t,e){return Q.fromSourceMap(t,e)};q.prototype._version=3;q.prototype.__generatedMappings=null;Object.defineProperty(q.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});q.prototype.__originalMappings=null;Object.defineProperty(q.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});q.prototype._charIsMappingSeparator=function(e,r){var n=e.charAt(r);return n===";"||n===","};q.prototype._parseMappings=function(e,r){throw new Error("Subclasses must implement _parseMappings")};q.GENERATED_ORDER=1;q.ORIGINAL_ORDER=2;q.GREATEST_LOWER_BOUND=1;q.LEAST_UPPER_BOUND=2;q.prototype.eachMapping=function(e,r,n){var i=r||null,a=n||q.GENERATED_ORDER,s;switch(a){case q.GENERATED_ORDER:s=this._generatedMappings;break;case q.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var o=this.sourceRoot;s.map(function(u){var l=u.source===null?null:this._sources.at(u.source);return l=L.computeSourceURL(o,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)};q.prototype.allGeneratedPositionsFor=function(e){var r=L.getArg(e,"line"),n={source:L.getArg(e,"source"),originalLine:r,originalColumn:L.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],a=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",L.compareByOriginalPositions,hn.LEAST_UPPER_BOUND);if(a>=0){var s=this._originalMappings[a];if(e.column===void 0)for(var o=s.originalLine;s&&s.originalLine===o;)i.push({line:L.getArg(s,"generatedLine",null),column:L.getArg(s,"generatedColumn",null),lastColumn:L.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a];else for(var u=s.originalColumn;s&&s.originalLine===r&&s.originalColumn==u;)i.push({line:L.getArg(s,"generatedLine",null),column:L.getArg(s,"generatedColumn",null),lastColumn:L.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a]}return i};Jt.SourceMapConsumer=q;function Q(t,e){var r=t;typeof t=="string"&&(r=L.parseSourceMapInput(t));var n=L.getArg(r,"version"),i=L.getArg(r,"sources"),a=L.getArg(r,"names",[]),s=L.getArg(r,"sourceRoot",null),o=L.getArg(r,"sourcesContent",null),u=L.getArg(r,"mappings"),l=L.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=L.normalize(s)),i=i.map(String).map(L.normalize).map(function(c){return s&&L.isAbsolute(s)&&L.isAbsolute(c)?L.relative(s,c):c}),this._names=Xe.fromArray(a.map(String),!0),this._sources=Xe.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(c){return L.computeSourceURL(s,c,e)}),this.sourceRoot=s,this.sourcesContent=o,this._mappings=u,this._sourceMapURL=e,this.file=l}Q.prototype=Object.create(q.prototype);Q.prototype.consumer=q;Q.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=L.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==t)return r;return-1};Q.fromSourceMap=function(e,r){var n=Object.create(Q.prototype),i=n._names=Xe.fromArray(e._names.toArray(),!0),a=n._sources=Xe.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=r,n._absoluteSources=n._sources.toArray().map(function(h){return L.computeSourceURL(n.sourceRoot,h,r)});for(var s=e._mappings.toArray().slice(),o=n.__generatedMappings=[],u=n.__originalMappings=[],l=0,c=s.length;l<c;l++){var m=s[l],f=new Va;f.generatedLine=m.generatedLine,f.generatedColumn=m.generatedColumn,m.source&&(f.source=a.indexOf(m.source),f.originalLine=m.originalLine,f.originalColumn=m.originalColumn,m.name&&(f.name=i.indexOf(m.name)),u.push(f)),o.push(f)}return vt(n.__originalMappings,L.compareByOriginalPositions),n};Q.prototype._version=3;Object.defineProperty(Q.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function Va(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}Q.prototype._parseMappings=function(e,r){for(var n=1,i=0,a=0,s=0,o=0,u=0,l=e.length,c=0,m={},f={},h=[],d=[],p,R,y,w,$;c<l;)if(e.charAt(c)===";")n++,c++,i=0;else if(e.charAt(c)===",")c++;else{for(p=new Va,p.generatedLine=n,w=c;w<l&&!this._charIsMappingSeparator(e,w);w++);if(R=e.slice(c,w),y=m[R],y)c+=R.length;else{for(y=[];c<w;)Ol.decode(e,c,f),$=f.value,c=f.rest,y.push($);if(y.length===2)throw new Error("Found a source, but no line and column");if(y.length===3)throw new Error("Found a source and line, but no column");m[R]=y}p.generatedColumn=i+y[0],i=p.generatedColumn,y.length>1&&(p.source=o+y[1],o+=y[1],p.originalLine=a+y[2],a=p.originalLine,p.originalLine+=1,p.originalColumn=s+y[3],s=p.originalColumn,y.length>4&&(p.name=u+y[4],u+=y[4])),d.push(p),typeof p.originalLine=="number"&&h.push(p)}vt(d,L.compareByGeneratedPositionsDeflated),this.__generatedMappings=d,vt(h,L.compareByOriginalPositions),this.__originalMappings=h};Q.prototype._findMapping=function(e,r,n,i,a,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 hn.search(e,r,a,s)};Q.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var r=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(r.generatedLine===n.generatedLine){r.lastGeneratedColumn=n.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}};Q.prototype.originalPositionFor=function(e){var r={generatedLine:L.getArg(e,"line"),generatedColumn:L.getArg(e,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",L.compareByGeneratedPositionsDeflated,L.getArg(e,"bias",q.GREATEST_LOWER_BOUND));if(n>=0){var i=this._generatedMappings[n];if(i.generatedLine===r.generatedLine){var a=L.getArg(i,"source",null);a!==null&&(a=this._sources.at(a),a=L.computeSourceURL(this.sourceRoot,a,this._sourceMapURL));var s=L.getArg(i,"name",null);return s!==null&&(s=this._names.at(s)),{source:a,line:L.getArg(i,"originalLine",null),column:L.getArg(i,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}};Q.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};Q.prototype.sourceContentFor=function(e,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var i=e;this.sourceRoot!=null&&(i=L.relative(this.sourceRoot,i));var a;if(this.sourceRoot!=null&&(a=L.urlParse(this.sourceRoot))){var s=i.replace(/^file:\/\//,"");if(a.scheme=="file"&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!a.path||a.path=="/")&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(r)return null;throw new Error('"'+i+'" is not in the SourceMap.')};Q.prototype.generatedPositionFor=function(e){var r=L.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:L.getArg(e,"line"),originalColumn:L.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",L.compareByOriginalPositions,L.getArg(e,"bias",q.GREATEST_LOWER_BOUND));if(i>=0){var a=this._originalMappings[i];if(a.source===n.source)return{line:L.getArg(a,"generatedLine",null),column:L.getArg(a,"generatedColumn",null),lastColumn:L.getArg(a,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Jt.BasicSourceMapConsumer=Q;function le(t,e){var r=t;typeof t=="string"&&(r=L.parseSourceMapInput(t));var n=L.getArg(r,"version"),i=L.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new Xe,this._names=new Xe;var a={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 o=L.getArg(s,"offset"),u=L.getArg(o,"line"),l=L.getArg(o,"column");if(u<a.line||u===a.line&&l<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=o,{generatedOffset:{generatedLine:u+1,generatedColumn:l+1},consumer:new q(L.getArg(s,"map"),e)}})}le.prototype=Object.create(q.prototype);le.prototype.constructor=q;le.prototype._version=3;Object.defineProperty(le.prototype,"sources",{get:function(){for(var t=[],e=0;e<this._sections.length;e++)for(var r=0;r<this._sections[e].consumer.sources.length;r++)t.push(this._sections[e].consumer.sources[r]);return t}});le.prototype.originalPositionFor=function(e){var r={generatedLine:L.getArg(e,"line"),generatedColumn:L.getArg(e,"column")},n=hn.search(r,this._sections,function(a,s){var o=a.generatedLine-s.generatedOffset.generatedLine;return o||a.generatedColumn-s.generatedOffset.generatedColumn}),i=this._sections[n];return i?i.consumer.originalPositionFor({line:r.generatedLine-(i.generatedOffset.generatedLine-1),column:r.generatedColumn-(i.generatedOffset.generatedLine===r.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};le.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};le.prototype.sourceContentFor=function(e,r){for(var n=0;n<this._sections.length;n++){var i=this._sections[n],a=i.consumer.sourceContentFor(e,!0);if(a)return a}if(r)return null;throw new Error('"'+e+'" is not in the SourceMap.')};le.prototype.generatedPositionFor=function(e){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(n.consumer._findSourceIndex(L.getArg(e,"source"))!==-1){var i=n.consumer.generatedPositionFor(e);if(i){var a={line:i.line+(n.generatedOffset.generatedLine-1),column:i.column+(n.generatedOffset.generatedLine===i.line?n.generatedOffset.generatedColumn-1:0)};return a}}}return{line:null,column:null}};le.prototype._parseMappings=function(e,r){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var i=this._sections[n],a=i.consumer._generatedMappings,s=0;s<a.length;s++){var o=a[s],u=i.consumer._sources.at(o.source);u=L.computeSourceURL(i.consumer.sourceRoot,u,this._sourceMapURL),this._sources.add(u),u=this._sources.indexOf(u);var l=null;o.name&&(l=i.consumer._names.at(o.name),this._names.add(l),l=this._names.indexOf(l));var c={source:u,generatedLine:o.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:o.generatedColumn+(i.generatedOffset.generatedLine===o.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:o.originalLine,originalColumn:o.originalColumn,name:l};this.__generatedMappings.push(c),typeof c.originalLine=="number"&&this.__originalMappings.push(c)}vt(this.__generatedMappings,L.compareByGeneratedPositionsDeflated),vt(this.__originalMappings,L.compareByOriginalPositions)};Jt.IndexedSourceMapConsumer=le});var qa=F(ja=>{var Cl=un().SourceMapGenerator,Kt=We(),Ml=/(\r?\n)/,Fl=10,Qe="$$$isSourceNode$$$";function ae(t,e,r,n,i){this.children=[],this.sourceContents={},this.line=t??null,this.column=e??null,this.source=r??null,this.name=i??null,this[Qe]=!0,n!=null&&this.add(n)}ae.fromStringWithSourceMap=function(e,r,n){var i=new ae,a=e.split(Ml),s=0,o=function(){var f=d(),h=d()||"";return f+h;function d(){return s<a.length?a[s++]:void 0}},u=1,l=0,c=null;return r.eachMapping(function(f){if(c!==null)if(u<f.generatedLine)m(c,o()),u++,l=0;else{var h=a[s]||"",d=h.substr(0,f.generatedColumn-l);a[s]=h.substr(f.generatedColumn-l),l=f.generatedColumn,m(c,d),c=f;return}for(;u<f.generatedLine;)i.add(o()),u++;if(l<f.generatedColumn){var h=a[s]||"";i.add(h.substr(0,f.generatedColumn)),a[s]=h.substr(f.generatedColumn),l=f.generatedColumn}c=f},this),s<a.length&&(c&&m(c,o()),i.add(a.splice(s).join(""))),r.sources.forEach(function(f){var h=r.sourceContentFor(f);h!=null&&(n!=null&&(f=Kt.join(n,f)),i.setSourceContent(f,h))}),i;function m(f,h){if(f===null||f.source===void 0)i.add(h);else{var d=n?Kt.join(n,f.source):f.source;i.add(new ae(f.originalLine,f.originalColumn,d,h,f.name))}}};ae.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(r){this.add(r)},this);else if(e[Qe]||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};ae.prototype.prepend=function(e){if(Array.isArray(e))for(var r=e.length-1;r>=0;r--)this.prepend(e[r]);else if(e[Qe]||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};ae.prototype.walk=function(e){for(var r,n=0,i=this.children.length;n<i;n++)r=this.children[n],r[Qe]?r.walk(e):r!==""&&e(r,{source:this.source,line:this.line,column:this.column,name:this.name})};ae.prototype.join=function(e){var r,n,i=this.children.length;if(i>0){for(r=[],n=0;n<i-1;n++)r.push(this.children[n]),r.push(e);r.push(this.children[n]),this.children=r}return this};ae.prototype.replaceRight=function(e,r){var n=this.children[this.children.length-1];return n[Qe]?n.replaceRight(e,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,r):this.children.push("".replace(e,r)),this};ae.prototype.setSourceContent=function(e,r){this.sourceContents[Kt.toSetString(e)]=r};ae.prototype.walkSourceContents=function(e){for(var r=0,n=this.children.length;r<n;r++)this.children[r][Qe]&&this.children[r].walkSourceContents(e);for(var i=Object.keys(this.sourceContents),r=0,n=i.length;r<n;r++)e(Kt.fromSetString(i[r]),this.sourceContents[i[r]])};ae.prototype.toString=function(){var e="";return this.walk(function(r){e+=r}),e};ae.prototype.toStringWithSourceMap=function(e){var r={code:"",line:1,column:0},n=new Cl(e),i=!1,a=null,s=null,o=null,u=null;return this.walk(function(l,c){r.code+=l,c.source!==null&&c.line!==null&&c.column!==null?((a!==c.source||s!==c.line||o!==c.column||u!==c.name)&&n.addMapping({source:c.source,original:{line:c.line,column:c.column},generated:{line:r.line,column:r.column},name:c.name}),a=c.source,s=c.line,o=c.column,u=c.name,i=!0):i&&(n.addMapping({generated:{line:r.line,column:r.column}}),a=null,i=!1);for(var m=0,f=l.length;m<f;m++)l.charCodeAt(m)===Fl?(r.line++,r.column=0,m+1===f?(a=null,i=!1):i&&n.addMapping({source:c.source,original:{line:c.line,column:c.column},generated:{line:r.line,column:r.column},name:c.name})):r.column++}),this.walkSourceContents(function(l,c){n.setSourceContent(l,c)}),{code:r.code,map:n}};ja.SourceNode=ae});var Ga=F(Zt=>{Zt.SourceMapGenerator=un().SourceMapGenerator;Zt.SourceMapConsumer=Ua().SourceMapConsumer;Zt.SourceNode=qa().SourceNode});var Ha=F((yh,Ba)=>{var xl=Object.prototype.toString,dn=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function Nl(t){return xl.call(t).slice(8,-1)==="ArrayBuffer"}function kl(t,e,r){e>>>=0;var n=t.byteLength-e;if(n<0)throw new RangeError("'offset' is out of bounds");if(r===void 0)r=n;else if(r>>>=0,r>n)throw new RangeError("'length' is out of bounds");return dn?Buffer.from(t.slice(e,e+r)):new Buffer(new Uint8Array(t.slice(e,e+r)))}function $l(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return dn?Buffer.from(t,e):new Buffer(t,e)}function Il(t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return Nl(t)?kl(t,e,r):typeof t=="string"?$l(t,e):dn?Buffer.from(t):new Buffer(t)}Ba.exports=Il});var es=F((ke,vn)=>{var Yl=Ga().SourceMapConsumer,mn=require("path"),de;try{de=require("fs"),(!de.existsSync||!de.readFileSync)&&(de=null)}catch{}var Pl=Ha();function za(t,e){return t.require(e)}var Wa=!1,Xa=!1,pn=!1,yt="auto",Ne={},St={},Vl=/^data:application\/json[^,]+base64,/,Ae=[],Le=[];function yn(){return yt==="browser"?!0:yt==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function Ul(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}function jl(){return typeof process=="object"&&process!==null?process.version:""}function ql(){if(typeof process=="object"&&process!==null)return process.stderr}function Gl(t){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(t)}function er(t){return function(e){for(var r=0;r<t.length;r++){var n=t[r](e);if(n)return n}return null}}var Sn=er(Ae);Ae.push(function(t){if(t=t.trim(),/^file:/.test(t)&&(t=t.replace(/file:\/\/\/(\w:)?/,function(n,i){return i?"":"/"})),t in Ne)return Ne[t];var e="";try{if(de)de.existsSync(t)&&(e=de.readFileSync(t,"utf8"));else{var r=new XMLHttpRequest;r.open("GET",t,!1),r.send(null),r.readyState===4&&r.status===200&&(e=r.responseText)}}catch{}return Ne[t]=e});function gn(t,e){if(!t)return e;var r=mn.dirname(t),n=/^\w+:\/\/[^\/]*/.exec(r),i=n?n[0]:"",a=r.slice(i.length);return i&&/^\/\w\:/.test(a)?(i+="/",i+mn.resolve(r.slice(i.length),e).replace(/\\/g,"/")):i+mn.resolve(r.slice(i.length),e)}function Bl(t){var e;if(yn())try{var r=new XMLHttpRequest;r.open("GET",t,!1),r.send(null),e=r.readyState===4?r.responseText:null;var n=r.getResponseHeader("SourceMap")||r.getResponseHeader("X-SourceMap");if(n)return n}catch{}e=Sn(t);for(var i=/(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg,a,s;s=i.exec(e);)a=s;return a?a[1]:null}var bn=er(Le);Le.push(function(t){var e=Bl(t);if(!e)return null;var r;if(Vl.test(e)){var n=e.slice(e.indexOf(",")+1);r=Pl(n,"base64").toString(),e=t}else e=gn(t,e),r=Sn(e);return r?{url:e,map:r}:null});function _n(t){var e=St[t.source];if(!e){var r=bn(t.source);r?(e=St[t.source]={url:r.url,map:new Yl(r.map)},e.map.sourcesContent&&e.map.sources.forEach(function(i,a){var s=e.map.sourcesContent[a];if(s){var o=gn(e.url,i);Ne[o]=s}})):e=St[t.source]={url:null,map:null}}if(e&&e.map&&typeof e.map.originalPositionFor=="function"){var n=e.map.originalPositionFor(t);if(n.source!==null)return n.source=gn(e.url,n.source),n}return t}function Ja(t){var e=/^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(t);if(e){var r=_n({source:e[2],line:+e[3],column:e[4]-1});return"eval at "+e[1]+" ("+r.source+":"+r.line+":"+(r.column+1)+")"}return e=/^eval at ([^(]+) \((.+)\)$/.exec(t),e?"eval at "+e[1]+" ("+Ja(e[2])+")":t}function Hl(){var t,e="";if(this.isNative())e="native";else{t=this.getScriptNameOrSourceURL(),!t&&this.isEval()&&(e=this.getEvalOrigin(),e+=", "),t?e+=t:e+="<anonymous>";var r=this.getLineNumber();if(r!=null){e+=":"+r;var n=this.getColumnNumber();n&&(e+=":"+n)}}var i="",a=this.getFunctionName(),s=!0,o=this.isConstructor(),u=!(this.isToplevel()||o);if(u){var l=this.getTypeName();l==="[object Object]"&&(l="null");var c=this.getMethodName();a?(l&&a.indexOf(l)!=0&&(i+=l+"."),i+=a,c&&a.indexOf("."+c)!=a.length-c.length-1&&(i+=" [as "+c+"]")):i+=l+"."+(c||"<anonymous>")}else o?i+="new "+(a||"<anonymous>"):a?i+=a:(i+=e,s=!1);return s&&(i+=" ("+e+")"),i}function Qa(t){var e={};return Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(function(r){e[r]=/^(?:is|get)/.test(r)?function(){return t[r].call(t)}:t[r]}),e.toString=Hl,e}function Ka(t,e){if(e===void 0&&(e={nextPosition:null,curPosition:null}),t.isNative())return e.curPosition=null,t;var r=t.getFileName()||t.getScriptNameOrSourceURL();if(r){var n=t.getLineNumber(),i=t.getColumnNumber()-1,a=/^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=a.test(jl())?0:62;n===1&&i>s&&!yn()&&!t.isEval()&&(i-=s);var o=_n({source:r,line:n,column:i});e.curPosition=o,t=Qa(t);var u=t.getFunctionName;return t.getFunctionName=function(){return e.nextPosition==null?u():e.nextPosition.name||u()},t.getFileName=function(){return o.source},t.getLineNumber=function(){return o.line},t.getColumnNumber=function(){return o.column+1},t.getScriptNameOrSourceURL=function(){return o.source},t}var l=t.isEval()&&t.getEvalOrigin();return l&&(l=Ja(l),t=Qa(t),t.getEvalOrigin=function(){return l}),t}function zl(t,e){pn&&(Ne={},St={});for(var r=t.name||"Error",n=t.message||"",i=r+": "+n,a={nextPosition:null,curPosition:null},s=[],o=e.length-1;o>=0;o--)s.push(`
    at `+Ka(e[o],a)),a.nextPosition=a.curPosition;return a.curPosition=a.nextPosition=null,i+s.reverse().join("")}function Za(t){var e=/\n    at [^(]+ \((.*):(\d+):(\d+)\)/.exec(t.stack);if(e){var r=e[1],n=+e[2],i=+e[3],a=Ne[r];if(!a&&de&&de.existsSync(r))try{a=de.readFileSync(r,"utf8")}catch{a=""}if(a){var s=a.split(/(?:\r\n|\r|\n)/)[n-1];if(s)return r+":"+n+`
`+s+`
`+new Array(i).join(" ")+"^"}}return null}function Wl(t){var e=Za(t),r=ql();r&&r._handle&&r._handle.setBlocking&&r._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(t.stack),Gl(1)}function Xl(){var t=process.emit;process.emit=function(e){if(e==="uncaughtException"){var r=arguments[1]&&arguments[1].stack,n=this.listeners(e).length>0;if(r&&!n)return Wl(arguments[1])}return t.apply(this,arguments)}}var Ql=Ae.slice(0),Jl=Le.slice(0);ke.wrapCallSite=Ka;ke.getErrorSource=Za;ke.mapSourcePosition=_n;ke.retrieveSourceMap=bn;ke.install=function(t){if(t=t||{},t.environment&&(yt=t.environment,["node","browser","auto"].indexOf(yt)===-1))throw new Error("environment "+yt+" was unknown. Available options are {auto, browser, node}");if(t.retrieveFile&&(t.overrideRetrieveFile&&(Ae.length=0),Ae.unshift(t.retrieveFile)),t.retrieveSourceMap&&(t.overrideRetrieveSourceMap&&(Le.length=0),Le.unshift(t.retrieveSourceMap)),t.hookRequire&&!yn()){var e=za(vn,"module"),r=e.prototype._compile;r.__sourceMapSupport||(e.prototype._compile=function(a,s){return Ne[s]=a,St[s]=void 0,r.call(this,a,s)},e.prototype._compile.__sourceMapSupport=!0)}if(pn||(pn="emptyCacheBetweenOperations"in t?t.emptyCacheBetweenOperations:!1),Wa||(Wa=!0,Error.prepareStackTrace=zl),!Xa){var n="handleUncaughtExceptions"in t?t.handleUncaughtExceptions:!0;try{var i=za(vn,"worker_threads");i.isMainThread===!1&&(n=!1)}catch{}n&&Ul()&&(Xa=!0,Xl())}};ke.resetRetrieveHandlers=function(){Ae.length=0,Le.length=0,Ae=Ql.slice(0),Le=Jl.slice(0),bn=er(Le),Sn=er(Ae)}});var ls=F((bh,K)=>{var Kl="1.8.15",rs=0,Ke=function(e){var r=["XXX: "+e].concat(Array.prototype.slice.call(arguments,1));console.error.apply(this,r)},Ke=function(){},Ie;typeof process<"u"&&process.versions&&(process.versions.nw?Ie="nw":process.versions.node&&(Ie="node"));!Ie&&typeof window<"u"&&window.window===window&&(Ie="browser");if(!Ie)throw new Error("unknown runtime environment");var tr,Se,Je;if(Ie==="browser")tr={hostname:function(){return window.location.host}},Se={},Je=null;else{tr=require("os"),Se=require("fs");try{Je=require("dtrace-provider")}catch{Je=null}}var _e=require("util"),be=require("assert"),Et=require("events").EventEmitter,Zl=require("stream");try{_t=gi()}catch{_t=null}var _t;process.env.BUNYAN_TEST_NO_SAFE_JSON_STRINGIFY&&(_t=null);try{Dt=ba()}catch{Dt=null}var Dt;try{rr=es()}catch{rr=null}var rr;function $e(t){if(t==null)return t;if(Array.isArray(t))return t.slice();if(typeof t=="object"){var e={};return Object.keys(t).forEach(function(r){e[r]=t[r]}),e}else return t}var J=_e.format;J||(Dn=_e.inspect,ts=/%[sdj%]/g,J=function(e){if(typeof e!="string"){for(var r=[],n=0;n<arguments.length;n++)r.push(Dn(arguments[n]));return r.join(" ")}for(var n=1,i=arguments,a=i.length,s=String(e).replace(ts,function(u){if(n>=a)return u;switch(u){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":return us(i[n++]);case"%%":return"%";default:return u}}),o=i[n];n<a;o=i[++n])o===null||typeof o!="object"?s+=" "+o:s+=" "+Dn(o);return s});var Dn,ts;function Rn(){if(this!==void 0){var t={},e=Error.stackTraceLimit,r=Error.prepareStackTrace;return Error.stackTraceLimit=3,Error.prepareStackTrace=function(n,i){var a=i[2];rr&&(a=rr.wrapCallSite(a)),t.file=a.getFileName(),t.line=a.getLineNumber();var s=a.getFunctionName();s&&(t.func=s)},Error.captureStackTrace(this,Rn),this.stack,Error.stackTraceLimit=e,Error.prepareStackTrace=r,t}}function ec(t,e){e||(e="    ");var r=t.split(/\r?\n/g);return e+r.join(`
`+e)}function An(t,e){if(be.ok(t),e){if(wn[e])return;wn[e]=!0}process.stderr.write(t+`
`)}function tc(t){return wn[t]}var wn={};function ns(){}ns.prototype.write=function(t){t.level<Rt?console.log(t):t.level<nr?console.info(t):t.level<ir?console.warn(t):console.error(t)};var Ln=10,Tn=20,Rt=30,nr=40,ir=50,On=60,Ze={trace:Ln,debug:Tn,info:Rt,warn:nr,error:ir,fatal:On},is={};Object.keys(Ze).forEach(function(t){is[Ze[t]]=t});var bt=void 0,En=Je&&{};function wt(t){var e,r=typeof t;if(r==="string"){if(e=Ze[t.toLowerCase()],!e)throw new Error(J('unknown level name: "%s"',t))}else{if(r!=="number")throw new TypeError(J("cannot resolve level: invalid arg (%s):",r,t));if(t<0||Math.floor(t)!==t)throw new TypeError(J("level is not a positive integer: %s",t));e=t}return e}function rc(t){return t instanceof Zl.Writable?!0:typeof t.write=="function"}function G(t,e,r){if(Ke("Logger start:",t),!(this instanceof G))return new G(t,e);var n;if(e!==void 0&&(n=t,t=e,!(n instanceof G)))throw new TypeError("invalid Logger creation: do not pass a second arg");if(!t)throw new TypeError("options (object) is required");if(n){if(t.name)throw new TypeError("invalid options.name: child cannot set logger name")}else if(!t.name)throw new TypeError("options.name (string) is required");if(t.stream&&t.streams)throw new TypeError('cannot mix "streams" and "stream" options');if(t.streams&&!Array.isArray(t.streams))throw new TypeError("invalid options.streams: must be an array");if(t.serializers&&(typeof t.serializers!="object"||Array.isArray(t.serializers)))throw new TypeError("invalid options.serializers: must be an object");if(Et.call(this),n&&r){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),a=0;a<i.length;a++){var s=i[a];f[s]=n.fields[s]}for(var o=Object.keys(t),a=0;a<o.length;a++){var s=o[a];f[s]=t[s]}return}var u=this;if(n){this._level=n._level,this.streams=[];for(var a=0;a<n.streams.length;a++){var l=$e(n.streams[a]);l.closeOnExit=!1,this.streams.push(l)}this.serializers=$e(n.serializers),this.src=n.src,this.fields=$e(n.fields),t.level&&this.level(t.level)}else this._level=Number.POSITIVE_INFINITY,this.streams=[],this.serializers=null,this.src=!1,this.fields={};if(!bt&&Je){bt=Je.createDTraceProvider("bunyan");for(var c in Ze){var m;En[Ze[c]]=m=bt.addProbe("log-"+c,"char *"),m.dtp=bt}bt.enable()}t.stream?u.addStream({type:"stream",stream:t.stream,closeOnExit:!1,level:t.level}):t.streams?t.streams.forEach(function(h){u.addStream(h,t.level)}):n&&t.level?this.level(t.level):n||(Ie==="browser"?u.addStream({type:"raw",stream:new ns,closeOnExit:!1,level:t.level}):u.addStream({type:"stream",stream:process.stdout,closeOnExit:!1,level:t.level})),t.serializers&&u.addSerializers(t.serializers),t.src&&(this.src=!0),Ke("Logger: ",u);var f=$e(t);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=tr.hostname()),f.pid||(f.pid=process.pid),Object.keys(f).forEach(function(h){u.fields[h]=f[h]})}_e.inherits(G,Et);G.prototype.addStream=function(e,r){var n=this;switch(r==null&&(r=Rt),e=$e(e),e.type||(e.stream?e.type="stream":e.path&&(e.type="file")),e.raw=e.type==="raw",e.level!==void 0?e.level=wt(e.level):e.level=wt(r),e.level<n._level&&(n._level=e.level),e.type){case"stream":be.ok(rc(e.stream),'"stream" stream is not writable: '+_e.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=Se.createWriteStream(e.path,{flags:"a",encoding:"utf8"}),e.closeOnExit||(e.closeOnExit=!0));break;case"rotating-file":be.ok(!e.stream,'"rotating-file" stream should not give a "stream"'),be.ok(e.path),be.ok(Dt,'"rotating-file" stream type is not supported: missing "mv" module'),e.stream=new se(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(a){n.emit("error",a,e)}),n.streams.push(e),delete n.haveNonRawStreams};G.prototype.addSerializers=function(e){var r=this;r.serializers||(r.serializers={}),Object.keys(e).forEach(function(n){var i=e[n];if(typeof i!="function")throw new TypeError(J('invalid serializer for "%s" field: must be a function',n));r.serializers[n]=i})};G.prototype.child=function(t,e){return new this.constructor(this,t||{},e)};G.prototype.reopenFileStreams=function(){var t=this;t.streams.forEach(function(e){e.type==="file"&&(e.stream&&(e.stream.end(),e.stream.destroySoon(),delete e.stream),e.stream=Se.createWriteStream(e.path,{flags:"a",encoding:"utf8"}),e.stream.on("error",function(r){t.emit("error",r,e)}))})};G.prototype.level=function(e){if(e===void 0)return this._level;for(var r=wt(e),n=this.streams.length,i=0;i<n;i++)this.streams[i].level=r;this._level=r};G.prototype.levels=function(e,r){if(e===void 0)return be.equal(r,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,a=0;a<i;a++){var s=this.streams[a];if(s.name===e){n=s;break}}if(!n)throw new Error(J('no stream with name "%s"',e))}if(r===void 0)return n.level;var o=wt(r);n.level=o,o<this._level&&(this._level=o)};G.prototype._applySerializers=function(t,e){var r=this;Ke("_applySerializers: excludeFields",e),Object.keys(this.serializers).forEach(function(n){if(!(t[n]===void 0||e&&e[n])){Ke('_applySerializers; apply to "%s" key',n);try{t[n]=r.serializers[n](t[n])}catch(i){An(J(`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)),t[n]=J('(Error in Bunyan log "%s" serializer broke field. See stderr for details.)',n)}}})};G.prototype._emit=function(t,e){var r;if(this.haveNonRawStreams===void 0){for(this.haveNonRawStreams=!1,r=0;r<this.streams.length;r++)if(!this.streams[r].raw){this.haveNonRawStreams=!0;break}}var n;if((e||this.haveNonRawStreams)&&(n=us(t)+tr.EOL),e)return n;var i=t.level;for(r=0;r<this.streams.length;r++){var a=this.streams[r];a.level<=i&&(Ke('writing log rec "%s" to "%s" stream (%d <= %d): %j',t.msg,a.type,a.level,i,t),a.stream.write(a.raw?t:n))}return n};function as(t,e,r){var n,i,a;r[0]instanceof Error?(i={err:t.serializers&&t.serializers.err?t.serializers.err(r[0]):G.stdSerializers.err(r[0])},n={err:!0},r.length===1?a=[i.err.message]:a=r.slice(1)):typeof r[0]!="object"||Array.isArray(r[0])?(i=null,a=r.slice()):Buffer.isBuffer(r[0])?(i=null,a=r.slice(),a[0]=_e.inspect(a[0])):(i=r[0],i&&r.length===1&&i.err&&i.err instanceof Error?a=[i.err.message]:a=r.slice(1));var s=$e(t.fields),o=s.level=e,u=i?$e(i):null;return u&&(t.serializers&&t._applySerializers(u,n),Object.keys(u).forEach(function(l){s[l]=u[l]})),s.msg=J.apply(t,a),s.time||(s.time=new Date),t.src&&!s.src&&(s.src=Rn()),s.v=rs,s}function nc(t,e,r,n){return[t||e._emit(as(e,r,n),!0)]}function et(t){return function(){var e=this,r=null,n=null;if(this._emit){if(arguments.length===0)return this._level<=t}else{var i="unbound";if(!tc[i]){var a=Rn();An(J("bunyan usage error: %s:%s: attempt to log with an unbound log method: `this` is: %s",a.file,a.line,_e.inspect(this)),i)}return}for(var s=new Array(arguments.length),o=0;o<s.length;++o)s[o]=arguments[o];this._level<=t&&(n=as(e,t,s),r=this._emit(n)),En&&En[t].fire(nc,r,e,t,s)}}G.prototype.trace=et(Ln);G.prototype.debug=et(Tn);G.prototype.info=et(Rt);G.prototype.warn=et(nr);G.prototype.error=et(ir);G.prototype.fatal=et(On);G.stdSerializers={};G.stdSerializers.req=function(t){return!t||!t.connection?t:{method:t.method,url:t.originalUrl||t.url,headers:t.headers,remoteAddress:t.connection.remoteAddress,remotePort:t.connection.remotePort}};G.stdSerializers.res=function(t){return!t||!t.statusCode?t:{statusCode:t.statusCode,header:t._header}};function ss(t){var e=t.stack||t.toString();if(t.cause&&typeof t.cause=="function"){var r=t.cause();r&&(e+=`
Caused by: `+ss(r))}return e}var Sh=G.stdSerializers.err=function(t){if(!t||!t.stack)return t;var e={message:t.message,name:t.name,stack:ss(t),code:t.code,signal:t.signal};return e};function ic(){var t=new Set;return function(e,r){return!r||typeof r!="object"?r:t.has(r)?"[Circular]":(t.add(r),r)}}function ac(){var t=[];return function(e,r){return!r||typeof r!="object"?r:t.indexOf(r)!==-1?"[Circular]":(t.push(r),r)}}var os=typeof Set<"u"?ic:ac;function us(t){try{return JSON.stringify(t)}catch{try{return JSON.stringify(t,os())}catch(n){if(_t)return _t(t);var e=n.stack.split(/\n/g,3).join(`
`);return An('bunyan: ERROR: Exception in `JSON.stringify(rec)`. You can install the "safe-json-stringify" module to have Bunyan fallback to safer stringification. Record:\n'+ec(J(`%s
%s`,_e.inspect(t),n.stack)),e),J("(Exception in JSON.stringify(rec): %j. See stderr for details.)",n.message)}}}var se=null;Dt&&(se=function(e){if(this.path=e.path,this.count=e.count==null?10:e.count,be.equal(typeof this.count,"number",J('rotating-file stream "count" is not a number: %j (%s) in %j',this.count,typeof this.count,this)),be.ok(this.count>=0,J('rotating-file stream "count" is not >= 0: %j in %j',this.count,this)),e.period){var r={hourly:"1h",daily:"1d",weekly:"1w",monthly:"1m",yearly:"1y"}[e.period]||e.period,n=/^([1-9][0-9]*)([hdwmy]|ms)$/.exec(r);if(!n)throw new Error(J('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 a=Se.statSync(this.path);i=a.mtime.getTime()}catch{}var s=!1;if(i){var o=this._calcRotTime(0);i<o&&(s=!0)}this.stream=Se.createWriteStream(this.path,{flags:"a",encoding:"utf8"}),this.rotQueue=[],this.rotating=!1,s?(this._debug("rotateAfterOpen -> call rotate()"),this.rotate()):this._setupNextRot()},_e.inherits(se,Et),se.prototype._debug=function(){if(0)var t;else return!1},se.prototype._setupNextRot=function(){this.rotAt=this._calcRotTime(1),this._setRotationTimer()},se.prototype._setRotationTimer=function(){var t=this,e=this.rotAt-Date.now(),r=2147483647;e>r&&(e=r),this.timeout=setTimeout(function(){t._debug("_setRotationTimer timeout -> call rotate()"),t.rotate()},e),typeof this.timeout.unref=="function"&&this.timeout.unref()},se.prototype._calcRotTime=function(e){this._debug("_calcRotTime: %s%s",this.periodNum,this.periodScope);var r=new Date;this._debug("  now local: %s",r),this._debug("    now utc: %s",r.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(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),r.getUTCHours()+e);break;case"d":this.rotAt?n=this.rotAt+this.periodNum*24*60*60*1e3*e:n=Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()+e);break;case"w":if(this.rotAt)n=this.rotAt+this.periodNum*7*24*60*60*1e3*e;else{var i=7-r.getUTCDay();e<1&&(i=-r.getUTCDay()),(e>1||e<-1)&&(i+=7*e),n=Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()+i)}break;case"m":this.rotAt?n=Date.UTC(r.getUTCFullYear(),r.getUTCMonth()+this.periodNum*e,1):n=Date.UTC(r.getUTCFullYear(),r.getUTCMonth()+e,1);break;case"y":this.rotAt?n=Date.UTC(r.getUTCFullYear()+this.periodNum*e,0,1):n=Date.UTC(r.getUTCFullYear()+e,0,1);break;default:be.fail(J('invalid period scope: "%s"',this.periodScope))}if(this._debug()){this._debug("  **rotAt**: %s (utc: %s)",n,new Date(n).toUTCString());var a=Date.now();this._debug("        now: %s (%sms == %smin == %sh to go)",a,n-a,(n-a)/1e3/60,(n-a)/1e3/60/60)}return n},se.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 r(){var s=e.path+"."+String(a-1);a===0&&(s=e.path),a-=1,e._debug("  rm %s",s),Se.unlink(s,function(o){n()})}function n(){if(e.count===0||a<0)return i();var s=e.path,o=e.path+"."+String(a);a>0&&(s+="."+String(a-1)),a-=1,Se.exists(s,function(u){u?(e._debug("  mv %s %s",s,o),Dt(s,o,function(l){l?(e.emit("error",l),i()):n()})):n()})}function i(){e._debug("  open %s",e.path),e.stream=Se.createWriteStream(e.path,{flags:"a",encoding:"utf8"});for(var s=e.rotQueue,o=s.length,u=0;u<o;u++)e.stream.write(s[u]);e.rotQueue=[],e.rotating=!1,e.emit("drain"),e._setupNextRot()}var a=this.count;r()},se.prototype.write=function(e){return this.rotating?(this.rotQueue.push(e),!1):this.stream.write(e)},se.prototype.end=function(e){this.stream.end()},se.prototype.destroy=function(e){this.stream.destroy()},se.prototype.destroySoon=function(e){this.stream.destroySoon()});function tt(t){this.limit=t&&t.limit?t.limit:100,this.writable=!0,this.records=[],Et.call(this)}_e.inherits(tt,Et);tt.prototype.write=function(t){if(!this.writable)throw new Error("RingBuffer has been ended already");return this.records.push(t),this.records.length>this.limit&&this.records.shift(),!0};tt.prototype.end=function(){arguments.length>0&&this.write.apply(this,Array.prototype.slice.call(arguments)),this.writable=!1};tt.prototype.destroy=function(){this.writable=!1,this.emit("close")};tt.prototype.destroySoon=function(){this.destroy()};K.exports=G;K.exports.TRACE=Ln;K.exports.DEBUG=Tn;K.exports.INFO=Rt;K.exports.WARN=nr;K.exports.ERROR=ir;K.exports.FATAL=On;K.exports.resolveLevel=wt;K.exports.levelFromName=Ze;K.exports.nameFromLevel=is;K.exports.VERSION=Kl;K.exports.LOG_VERSION=rs;K.exports.createLogger=function(e){return new G(e)};K.exports.RingBuffer=tt;K.exports.RotatingFileStream=se;K.exports.safeCycles=os});var fs=F((_h,cs)=>{var sc=Object.prototype.hasOwnProperty,oc=Object.prototype.toString,uc=function(t){var e=typeof t=="function"&&!(t instanceof RegExp)||oc.call(t)==="[object Function]";return!e&&typeof window<"u"&&(e=t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt),e};cs.exports=function(e,r){if(!uc(r))throw new TypeError("iterator must be a function");var n,i,a=typeof e=="string",s=e.length,o=arguments.length>2?arguments[2]:null;if(s===+s)for(n=0;n<s;n++)o===null?r(a?e.charAt(n):e[n],n,e):r.call(o,a?e.charAt(n):e[n],n,e);else for(i in e)sc.call(e,i)&&(o===null?r(e[i],i,e):r.call(o,e[i],i,e))}});var ms=F((Dh,ds)=>{var hs=Object.prototype.toString;ds.exports=function(e){var r=hs.call(e),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&hs.call(e.callee)==="[object Function]"),n}});var gs=F((wh,ps)=>{(function(){"use strict";var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,r=fs(),n=ms(),i=!{toString:null}.propertyIsEnumerable("toString"),a=function(){}.propertyIsEnumerable("prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o;o=function(l){var c=l!==null&&typeof l=="object",m=e.call(l)==="[object Function]",f=n(l),h=[];if(!c&&!m&&!f)throw new TypeError("Object.keys called on a non-object");if(f)r(l,function(w){h.push(w)});else{var d,p=a&&m;for(d in l)!(p&&d==="prototype")&&t.call(l,d)&&h.push(d)}if(i){var R=l.constructor,y=R&&R.prototype===l;r(s,function(w){!(y&&w==="constructor")&&t.call(l,w)&&h.push(w)})}return h},ps.exports=o})()});var ys=F((Eh,vs)=>{vs.exports=Object.keys||gs()});var bs=F((Rh,Ss)=>{Ss.exports=lc;function lc(t){return t!==null&&(typeof t=="object"||typeof t=="function")}});var Cn=F((Ah,_s)=>{var cc=ys(),fc=bs();_s.exports=hc;function hc(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];if(fc(r))for(var n=cc(r),i=0;i<n.length;i++){var a=n[i];t[a]=r[a]}}return t}});var Rs=F((Lh,Es)=>{"use strict";var Ds={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},ws={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},Mn={};Object.keys(Ds).forEach(function(t){Mn[t]=function(e){return"\x1B["+Ds[t]+"m"+e+"\x1B[39m"}});Object.keys(ws).forEach(function(t){Mn[t]=function(e){return"\x1B["+ws[t]+"m"+e+"\x1B[49m"}});Es.exports=Mn});var Ts=F((Th,Ls)=>{"use strict";var Fn={reset:[0,22],bright:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],blink:[5,25],inverse:[7,27]},As={};Object.keys(Fn).forEach(function(t){As[t]=function(e){var r=Fn[t][0],n=Fn[t][1];return"\x1B["+r+"m"+e+"\x1B["+n+"m"}});Ls.exports=As});var Ws=F((Oh,zs)=>{"use strict";var Fs=require("util"),Te=Fs.format,dc=require("http"),mc=Cn(),pc=Rs(),gc=Ts(),vc=mc(gc,pc),xs=1,Ns=2,ks=3,$s=4,Is=5,Ys=6,yc={long:xs,json:Ns,inspect:ks,simple:$s,short:Is,bunyan:Ys},Ps=10,Vs=20,Us=30,js=40,qs=50,Gs=60,Os={trace:Ps,debug:Vs,info:Us,warn:js,error:qs,fatal:Gs},Sc={},Bs={},Hs={};Object.keys(Os).forEach(function(t){var e=Os[t];Sc[e]=t,Bs[e]=t.toUpperCase(),Hs[e]=(t.length===4?" ":"")+t.toUpperCase()});function Cs(t){return!(t.v===null||t.level===null||t.name===null||t.hostname===null||t.pid===null||t.time===null||t.msg===null)}function rt(t){return"  "+t.split(/\r?\n/).join(`
  `)}function bc(t,e){if(!t)return"";var r=vc[e];return r?r(t):t}function _c(t,e){return t}function Ms(t){switch(t){case Ps:return"TRACE";case Vs:return"DEBUG";case Us:return"INFO";case js:return"WARN";case qs:return"ERROR";case Gs:return"FATAL"}}zs.exports=function(e,r){function n(O){var A="";if(O.header)A+=O.header.trimRight();else if(O.headers){O.statusCode&&(A+=Te(`HTTP/1.1 %s %s
`,O.statusCode,dc.STATUS_CODES[O.statusCode]));var _=O.headers;A+=Object.keys(_).map(function(v){return v+": "+_[v]}).join(`
`)}delete O.header,delete O.headers,delete O.statusCode,O.body&&(A+=`

`+(typeof O.body=="object"?JSON.stringify(O.body,null,2):O.body),delete O.body),O.trailer&&(A+=`
`+O.trailer),delete O.trailer,A&&w.push(rt(A)),Object.keys(O).forEach(function(v){e["res."+v]=O[v]})}var i=!1,a,s=e.line,o=r.color?bc:_c,u=isNaN(r.outputMode)?yc[r.outputMode]:r.outputMode;switch(u){case Is:i=!0;case xs:if(!Cs(e))return s+`
`;delete e.v,i&&e.time[10]=="T"?(a=e.time.substr(11),a=o(a,"brightBlack")):a=o("["+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=Hs[e.level]||"LVL"+e.level;if(r.color){var m=r.colorFromLevel||{10:"brightBlack",20:"brightBlack",30:"cyan",40:"magenta",50:"red",60:"inverse"};c=o(c,m[e.level])}delete e.level;var f="",h,d,p="";e.src&&e.src.file&&(h=e.src,h.func?f=Te(" (%s:%d in %s)",h.file,h.line,h.func):f=Te(" (%s:%d)",h.file,h.line),f=o(f,"green")),delete e.src;var R=e.hostname;delete e.hostname;var y=[],w=[];e.req_id&&y.push("req_id="+e.req_id),delete e.req_id;var $;if(e.msg.indexOf(`
`)!==-1?($="",w.push(rt(o(e.msg,"cyan")))):$=" "+o(e.msg,"cyan"),delete e.msg,e.req&&typeof e.req=="object"){var C=e.req;delete e.req,d=C.headers,h=Te("%s %s HTTP/%s%s",C.method,C.url,C.httpVersion||"1.1",d?`
`+Object.keys(d).map(function(O){return O+": "+d[O]}).join(`
`):""),delete C.url,delete C.method,delete C.httpVersion,delete C.headers,C.body&&(h+=`

`+(typeof C.body=="object"?JSON.stringify(C.body,null,2):C.body),delete C.body),C.trailers&&Object.keys(C.trailers)>0&&(h+=`
`+Object.keys(C.trailers).map(function(O){return O+": "+C.trailers[O]}).join(`
`)),delete C.trailers,w.push(rt(h)),Object.keys(C).forEach(function(O){e["req."+O]=C[O]})}if(e.client_req&&typeof e.client_req=="object"){var x=e.client_req;delete e.client_req,d=x.headers,h="",x.address&&(p="Host: "+x.address,x.port&&(p+=":"+x.port),p+=`
`),delete x.headers,delete x.address,delete x.port,h+=Te(`%s %s HTTP/%s
%s%s`,x.method,x.url,x.httpVersion||"1.1",p,d?Object.keys(d).map(function(O){return O+": "+d[O]}).join(`
`):""),delete x.method,delete x.url,delete x.httpVersion,x.body&&(h+=`

`+(typeof x.body=="object"?JSON.stringify(x.body,null,2):x.body),delete x.body),Object.keys(x).forEach(function(O){e["client_req."+O]=x[O]}),w.push(rt(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&&(w.push(rt(e.err.stack)),delete e.err);for(var j=Object.keys(e),V=0;V<j.length;V++){var k=j[V],T=e[k],U=!1;typeof T!="string"&&(T=JSON.stringify(T,null,2),U=!0),T.indexOf(`
`)!==-1||T.length>50?w.push(rt(k+": "+T)):!U&&(T.indexOf(" ")!=-1||T.length===0)?y.push(k+"="+JSON.stringify(T)):y.push(k+"="+T)}return y=o(y.length?" ("+y.join(", ")+")":"","brightBlack"),w=o(w.length?w.join(`
  --
`)+`
`:"","brightBlack"),i?Te(`%s %s %s:%s%s
%s`,a,c,l,$,y,w):Te(`%s %s: %s on %s%s:%s%s
%s`,a,c,l,R||"<no-hostname>",f,$,y,w);case ks:return Fs.inspect(e,!1,1/0,!0)+`
`;case Ys:return r.levelInString&&(e.level=Ms(e.level)),JSON.stringify(e,null,0)+`
`;case Ns:return r.levelInString&&(e.level=Ms(e.level)),JSON.stringify(e,null,r.jsonIndent)+`
`;case $s:return Cs(e)?Te(`%s - %s
`,Bs[e.level]||"LVL"+e.level,e.msg):s+`
`;default:throw new Error("unknown output mode: "+r.outputMode)}}});var Js=F((Ch,Qs)=>{"use strict";var Dc=require("stream"),wc=require("util"),Ec=Ws(),Rc=Cn(),Xs=Dc.Writable;Qs.exports=At;wc.inherits(At,Xs);function At(t,e){if(!(this instanceof At))return new At(t,e);t=t||{},t.objectMode=!0,Xs.call(this,t),this.opts=Rc({outputMode:"short",color:!0,colorFromLevel:{10:"brightBlack",20:"brightBlack",30:"green",40:"magenta",50:"red",60:"brightRed"}},t),this.out=e||process.stdout}At.prototype._write=function(t,e,r){var n;try{n=JSON.parse(t),this.out.write(Ec(n,this.opts))}catch{this.out.write(t)}r()}});var Mc={};fo(Mc,{default:()=>Cc});module.exports=ho(Mc);var to=re(cr());var fr="~clear~",po=(t,e,r)=>{let n;e?(n={...t,selectedPage:"1"},Object.keys(e).forEach(a=>{e[a]?n[a]=e[a]:Object.keys(n).filter(s=>s===a||s.startsWith(`${a}.`)).forEach(s=>{n[s]=fr})})):n={selectedPage:"1",pageSize:t.pageSize,sortColumn:t.sortColumn,sortedAsc:t.sortedAsc,dataProductDefinitionsPath:t.dataProductDefinitionsPath};let i={};return Object.keys(n).filter(a=>n[a]).forEach(a=>{i[a]=n[a]}),go(i,r)},go=(t,e)=>`?${Object.keys(t).flatMap(n=>{let i=e?.find(s=>`filters.${s.name}`===n),a=t[n];return Array.isArray(a)?a.map(s=>`${encodeURI(n)}=${encodeURI(s)}`):i&&i.filter.type.toLowerCase()==="Multiselect".toLowerCase()?a.split(",").map(o=>`${encodeURI(n)}=${encodeURI(o)}`):[`${encodeURI(n)}=${encodeURI(a)}`]}).join("&")}`,Un=t=>t&&t!==""?`?dataProductDefinitionsPath=${t}`:"";var nt=po;var jn=(t,e)=>t.includes(e)?t:t.concat(e);var vo=t=>t.filter(e=>e.mandatory).map(e=>e.name),yo=t=>t.filter(e=>e.visible).map(e=>e.name),qn=(t,e)=>[...vo(t),...e].reduce(jn,[]),xt={getColumns:(t,e=null)=>{let{fields:r}=t;return{name:"columns",options:r.filter(i=>!t.sections||!t.sections.includes(i.name)).map(i=>({text:i.display,value:i.name,disabled:i.mandatory})),text:"Select report columns",value:qn(r,e??yo(r))}},ensureMandatoryColumns:qn};var fe="filters.",it=class{constructor({fields:e,template:r,queryParams:n,definitionsPath:i,filtersPrefix:a=fe}){if(this.selectedPage=n.selectedPage?Number(n.selectedPage):1,this.pageSize=n.pageSize&&r?Number(n.pageSize):this.getDefaultPageSize(r),this.sortColumn=n.sortColumn?n.sortColumn.toString():this.getDefaultSortColumn(e),this.sortedAsc=n.sortedAsc!=="false",this.dataProductDefinitionsPath=i??(n.dataProductDefinitionsPath?n.dataProductDefinitionsPath.toString():null),this.filtersPrefix=a,n.columns){let l=typeof n.columns=="string"?n.columns.split(","):n.columns;this.columns=xt.ensureMandatoryColumns(e,l)}else this.columns=e.filter(l=>l.visible).map(l=>l.name);let s,o,u=e.find(l=>l.type==="date"&&l.filter&&l.filter.type==="daterange"||l.type==="date"&&l.filter&&l.filter.type==="date");u&&({min:s,max:o}=u.filter),this.filters={},Object.keys(n).filter(l=>l.startsWith(this.filtersPrefix)).filter(l=>n[l]).forEach(l=>{let c=l.replace(this.filtersPrefix,""),m=n[l].toString();c.includes(".start")&&s&&new Date(m)<new Date(s)&&(m=s),c.includes(".end")&&o&&new Date(m)>new Date(o)&&(m=o),m!=="no-filter"&&(this.filters[c]=m)}),u&&u.filter.type==="daterange"&&(s&&Object.keys(n).some(l=>l.includes(this.filtersPrefix))&&Object.keys(n).every(l=>!l.includes(".start"))&&(this.filters[`${u.name}.start`]=s),o&&Object.keys(n).some(l=>l.includes(this.filtersPrefix))&&Object.keys(n).every(l=>!l.includes(".end"))&&(this.filters[`${u.name}.end`]=o)),u&&u.filter.type==="date"&&s&&Object.keys(n).some(l=>l.includes(this.filtersPrefix))&&Object.keys(n).every(l=>!l.includes(u.name))&&(this.filters[`${u.name}.start`]=s)}getDefaultSortColumn(e){let r=e.find(n=>n.defaultsort);return r?r.name:e.find(n=>n.sortable)?.name}toRecordWithFilterPrefix(e=!1){let r={selectedPage:this.selectedPage.toString(),pageSize:this.pageSize.toString(),sortColumn:this.sortColumn,sortedAsc:this.sortedAsc.toString(),columns:this.columns};return this.dataProductDefinitionsPath&&(r.dataProductDefinitionsPath=this.dataProductDefinitionsPath),Object.keys(this.filters).forEach(n=>{let i=this.filters[n];(!e||i!==fr)&&(r[`${this.filtersPrefix}${n}`]=i)}),r}getDefaultPageSize(e){switch(e){case"list-section":case"summary-section":case"row-section-child":case"parent-child":return 5e4;default:return 20}}};var Nt="selectedPage",So="pageSize",bo=1,_o=20,Do=(t,e,r,n,i)=>{let a=Math.ceil(r/n),s=[];return Array(a).fill(0).forEach((o,u)=>{let l=u+1;e.set(Nt,`${l}`),l===1||l===a||l>=i-1&&l<=i+1?s.push({number:l,href:`${t}?${e.toString()}`,current:l===i}):(l===2||l===a-1)&&s.push({ellipsis:!0})}),{pages:s,pagesLength:a}},wo=(t,e,r,n,i)=>{let a=new URLSearchParams(e);if(n>0){if(i===r)return;let s=i+1;return a.set(Nt,`${s}`),`${t}?${a.toString()}`}},Eo=(t,e,r)=>{let n=new URLSearchParams(e);if(r===1)return;let i=r-1;return n.set(Nt,`${i}`),`${t}?${n.toString()}`},Ro=t=>{let e=[10,20,100,200,t];return e.map((r,n)=>n===e.length-1?{value:t,text:"All"}:{value:r,text:r.toString()})},Gn={getPaginationData:(t,e,r)=>{let{search:n}=t,i=n?r.originalUrl.split(n)[0]:r.originalUrl,a=new URLSearchParams(n),s=+a.get(So)||_o,o=+a.get(Nt)||bo,{pages:u,pagesLength:l}=Do(i,a,e,s,o);return{next:wo(i,n,l,e,o),prev:Eo(i,n,o),pages:u,pageSize:s,currentPage:o,totalRows:e,sizes:Ro(e)}}};var Bn={getTotals:(t,e,r,n)=>{let i="",a=(e-1)*t,s=a+n;return a===0&&r===s?i=r===1?`${r} total result`:`${r} total results`:i=r>0?`Showing <strong>${a+1}</strong> to <strong>${s}</strong> of <strong>${r}</strong> results`:"0-0 of 0",i}};var Pe={refresh:{id:"dpr-button-refresh",disabled:!1,tooltipText:"Refresh",ariaLabelText:"refresh report"},printable:{id:"dpr-button-printable",disabled:!1,tooltipText:"Print screen",ariaLabelText:"print report"},sharable:{id:"dpr-button-sharable",disabled:!1,tooltipText:"Email\xA0report link",ariaLabelText:"share report request via email"},copy:{id:"dpr-button-copy",disabled:!1,tooltipText:"Copy report link",ariaLabelText:"report request"},downloadable:{id:"dpr-button-downloadable",disabled:!1,tooltipText:"Download",ariaLabelText:"download report"}};var Ao=({refresh:t,print:e,share:r,copy:n,download:i})=>{let a=[];return t&&t.url&&t.executionId&&a.push(Lo(Pe.refresh,t)),e&&a.push(Mo(Pe.printable,e)),r&&a.push(To(Pe.sharable,r)),n&&a.push(Oo(Pe.copy,n)),i&&a.push(Co(Pe.downloadable,i)),a},Lo=(t,e)=>{let{url:r}=e;return{...t,href:r}},To=(t,e)=>{let{reportName:r,name:n,url:i}=e,a=`mailto:?subject=${r}-${n}&body=${encodeURIComponent(i)}`;return{...t,href:a}},Oo=(t,e)=>{let{url:r}=e;return{...t,href:r}},Co=(t,e)=>{let{canDownload:r,enabled:n}=e,{tooltipText:i,ariaLabelText:a}=t;return{...t,tooltipText:r?i:"Enable download",disabled:!n,attributes:{...e},ariaLabelText:n?a:`${a}, disabled`}},Mo=(t,e)=>{let{enabled:r}=e,{ariaLabelText:n}=t;return{...t,disabled:!r,href:"#",ariaLabelText:r?n:`${n}, disabled`}},Hn={getActions:Ao};var ne=re(at()),Qn=re(st()),Jn=re(zn());var yr=(t,e,r)=>{let{min:n,max:i}=t,a;n?a=Wn(n,e):a=e;let s;return i?s=Xn(i,r):s=r,{start:a,end:s}},Wn=(t,e)=>{let r=new Date(t);return new Date(e)<r?t:e},Xn=(t,e)=>{let r=new Date(t);return new Date(e)>r?t:e},Fo=t=>{let{min:e,max:r,defaultValue:n}=t,i,a;e&&(i=e),r&&(a=r);let s=/^\d{1,4}-\d{1,2}-\d{2,2} - \d{1,4}-\d{1,2}-\d{1,2}$/,o;return n&&n.match(s)?([i,a]=n.split(" - "),o=yr(t,i,a)):n?o=n:o=yr(t,i,a),o};function xo(t){return t.start!==void 0||t.end!==void 0}var Ce={compareMax:Xn,compareMin:Wn,isDateRange:xo,setDateRangeValuesWithinMinMax:yr,getStartAndEndValueFromDefinition:Fo};ne.default.extend(Qn.default);var No=(t,e,r,n)=>{ne.default.extend(Jn.default);let i=(0,ne.default)(r),a=(0,ne.default)(n),s=t?t.isBetween(i,a,"day","[]"):!0,o=e?e.isBetween(i,a,"day","[]"):!0;return s&&o},Kn=t=>{let e,r;switch(t){case"none":e="",r="";break;case"yesterday":e=(0,ne.default)(),r=e.subtract(1,"day");break;case"tomorrow":r=(0,ne.default)(),e=r.add(1,"day");break;case"last-week":e=(0,ne.default)(),r=e.subtract(1,"week");break;case"next-week":r=(0,ne.default)(),e=r.add(1,"week");break;case"last-month":e=(0,ne.default)(),r=e.subtract(1,"month");break;case"next-month":r=(0,ne.default)(),e=r.add(1,"month");break;default:break}return{endDate:e,startDate:r}},ko=(t,e,r)=>{let n=e.query[`${r}${t.name}.start`],i=e.query[`${r}${t.name}.end`],a=e.query[`${r}${t.name}.relative-duration`];return{start:n||t.min,end:i||t.max,...a&&{relative:a}}},$o=(t,e)=>{let r=e.split(".")[0],n=Object.keys(t.body).filter(a=>a.includes(r)).map(a=>({name:a,value:t.body[a]})),i={start:"",end:""};return n.forEach(a=>{a.name.includes("start")&&(i.start=a.value),a.name.includes("end")&&(i.end=a.value)}),{value:i,name:r}},Io=(t,e)=>{let r={start:"",end:""},{start:n,end:i}=t.value;return n&&(r.start=(0,ne.default)(n,"D/M/YYYY").format("YYYY-MM-DD").toString()),i&&(r.end=(0,ne.default)(i,"D/M/YYYY").format("YYYY-MM-DD").toString()),{...e,value:r}},Zn=(t,e)=>{t||(t="1977-05-25"),e||(e="9999-01-01");let r=ei();return r.forEach(n=>{if(n.value){let{endDate:i,startDate:a}=Kn(n.value);No(a,i,t,e)||(n.disabled=!0)}}),r.filter(n=>n.value!=="none").every(n=>n.value===null||n.disabled)&&(r=[]),r},Yo=t=>{let r=ei().find(n=>n.value===t);return r?r.text:""},ei=()=>[{value:"none",text:"None"},{value:"yesterday",text:"Yesterday"},{value:"tomorrow",text:"Tomorrow"},{value:"last-week",text:"Last week"},{value:"next-week",text:"Next week"},{value:"last-month",text:"Last month"},{value:"next-month",text:"Next month"}],Po=(t,e)=>{let r=Ce.getStartAndEndValueFromDefinition(t),n=Zn(t.min,t.max);return{...e,min:t.min,max:t.max,relativeOptions:n,value:r}},Vo=(t,e,r)=>{let n=t.defaultValue.split(" - "),i;return n.length>=1&&(i=`${r}${e}.start=${n[0]}`,n.length>=2&&(i=`${i}&${r}${e}.end=${n[1]}`)),i},ge={calcDates:Kn,getRelativeDateOptions:Zn,getFilterFromDefinition:Po,setValueFromRequest:ko,getQueryFromDefinition:Vo,mapRelativeValue:Yo,setDefaultValue:$o,setFilterValueFromDefault:Io};var Uo=(t,e)=>{let r=[void 0,null,""];return t.filter(n=>n.value&&Object.prototype.hasOwnProperty.call(n.value,"start")&&!r.includes(n.value.start)||n.value&&Object.prototype.hasOwnProperty.call(n.value,"end")&&!r.includes(n.value.end)||n.value&&!Object.prototype.hasOwnProperty.call(n.value,"start")&&!Object.prototype.hasOwnProperty.call(n.value,"end")).filter(n=>n.value&&n.value!=="no-filter").map(n=>{let i=`${n.value}`,a=[`"${i}"`],s=[`${e}${n.name}`],o="",u=!1,l;n.type.toLowerCase()==="DateRange".toLowerCase()&&({key:s,value:a,disabled:u,cantRemoveClass:o,displayValue:i,constraints:l}=ti(n,e)),n.type.toLowerCase()==="GranularDateRange".toLowerCase()&&({key:s,value:a,disabled:u,cantRemoveClass:o,displayValue:i,constraints:l}=ii(n,e)),n.type.toLowerCase()==="Date".toLowerCase()&&({key:s,value:a,disabled:u,cantRemoveClass:o,displayValue:i,constraints:l}=jo(n,e)),(n.type.toLowerCase()==="Autocomplete".toLowerCase()||n.type.toLowerCase()==="Radio".toLowerCase()||n.type.toLowerCase()==="Select".toLowerCase())&&({key:s,value:a,displayValue:i}=ri(n,e)),n.type.toLowerCase()==="Multiselect".toLowerCase()&&({key:s,value:a,displayValue:i}=ni(n,e));let c;return u?c=`Selected Filter: ${n.text}: ${i}. This filter cant be removed. Update the filter input to change the value`:c=`Selected Filter: ${n.text}: ${i}. Click to clear this filter`,{text:n.text,displayValue:i,key:JSON.stringify(s),value:a,disabled:u,constraints:l,classes:`interactive-remove-filter-button${o}`,attributes:{"aria-label":c}}})},ti=(t,e)=>{let r=t.value.start||"Open start",n=t.value.end||"Open end",i=`${e}${t.name}`,a=[`${i}.start`,`${i}.end`],s=[`"${r}"`,`"${n}"`],o=`${r} - ${n}`;t.value.relative&&(a.push(`${i}.relative-duration`),s.push(`"${t.value.relative}"`),o=ge.mapRelativeValue(t.value.relative));let u=Sr(t,a),{disabled:l,cantRemoveClass:c,displayValue:m}=ai(t,s,o);return{key:a,value:s,displayValue:m||o,disabled:l,cantRemoveClass:c,constraints:u}},Sr=(t,e,r=!1)=>{let n=[],{min:i,max:a}=t;return i&&n.push({key:e[0],value:i}),a&&!r&&n.push({key:e[1],value:a}),n.length?n:void 0},ri=(t,e)=>{let n=t.options.find(s=>s.value===t.value).text,i=[`${e}${t.name}`],a=[`"${t.value}"`];return{key:i,value:a,displayValue:n}},ni=(t,e)=>{let n=t.value.split(","),i=n.map(o=>t.options.find(l=>l.value===o).text).filter((o,u)=>u<3).join(", ");i=n.length>3?`${i} + ${n.length-3} more`:i;let a=n.map(o=>`"${o}"`);return{key:[`${e}${t.name}`],value:a,displayValue:i}},ii=(t,e)=>{let r=t.value.start||"Open start",n=t.value.end||"Open end",i=t.value.quickFilter?.value,a=`${e}${t.name}`,s=[`${a}.start`,`${a}.end`,`${a}.granularity`],o=[`"${r}"`,`"${n}"`,`"${t.value.granularity.value}"`],u=Sr(t,s),l,c=t.value.granularity.display;i&&i!=="none"?(s.push(`${a}.quick-filter`),o.push(`"${t.value.quickFilter.value}"`),l=`${t.value.quickFilter.display}: ${c}`):l=`${r} - ${n}: ${c}`;let{disabled:m,cantRemoveClass:f,displayValue:h}=ai(t,o,l);return{key:s,value:o,displayValue:h||l,disabled:m,constraints:u,cantRemoveClass:f}},jo=(t,e)=>{let r=[`${e}${t.name}`],n=`${t.value}`,i=[`"${n}"`],a=Sr(t,r,!0),{disabled:s,cantRemoveClass:o,displayValue:u}=qo(t,i,n);return{key:r,value:i,displayValue:u||n,disabled:s,constraints:a,cantRemoveClass:o}},ai=(t,e,r)=>{let{min:n,max:i}=t;return n&&e[0].includes(n)&&i&&e[1].includes(i)?{disabled:!0,cantRemoveClass:" interactive-remove-filter-button--disabled",displayValue:`${r} (maximum range)`}:{disabled:!1,cantRemoveClass:"",displayValue:r}},qo=(t,e,r)=>{let{min:n,max:i}=t;if(n&&e[0].includes(n)||i&&e[0].includes(i)){let a;return e[0].includes(n)&&(a="min"),e[0].includes(i)&&(a="max"),{disabled:!0,cantRemoveClass:" interactive-remove-filter-button--disabled",displayValue:`${r} (${a} date)`}}return{disabled:!1,cantRemoveClass:"",displayValue:r}},Go=(t,e)=>{let{query:r}=t,n="filters.";return e.filter(i=>r[`filters.${i.name}`]||r[`filters.${i.name}.start`]||r[`filters.${i.name}.end`]).map(i=>{let{value:a}=i;return i.type.toLowerCase()==="Multiselect".toLowerCase()&&(a=ni(i,"filters").displayValue),(i.type.toLowerCase()==="Autocomplete".toLowerCase()||i.type.toLowerCase()==="Radio".toLowerCase()||i.type.toLowerCase()==="Select".toLowerCase())&&(a=ri(i,n).displayValue),i.type.toLowerCase()==="DateRange".toLowerCase()&&(a=ti(i,n).displayValue),i.type.toLowerCase()==="GranularDateRange".toLowerCase()&&(a=ii(i,n).displayValue),{id:i.name,name:i.text,value:a}})},si={getSelectedFilters:Uo,getQuerySummary:Go};var br=re(at()),oi=re(st());br.default.extend(oi.default);var ui=t=>{let{defaultValue:e,min:r,max:n}=t,i;return e&&(i=e,r&&(i=Ce.compareMin(r,i)),n&&(i=Ce.compareMax(n,i))),i},Bo=(t,e,r)=>{let{min:n,max:i,mandatory:a}=t,s=e.query[`${r}${t.name}`],o=s;return a&&!s&&(o=n||i||"1977-05-25"),o},Ho=(t,e)=>{let r=t.value?(0,br.default)(t.value,"D/M/YYYY").format("YYYY-MM-DD").toString():"";return{...e,value:r}},zo=(t,e)=>({...e,value:ui(t),min:t.min,max:t.max}),kt={setDateValueWithinMinMax:ui,getFilterFromDefinition:zo,setValueFromRequest:Bo,setFilterValueFromDefault:Ho};var N=re(at()),li=re(st());N.default.extend(li.default);var _r=(t,e,r)=>{let n,i;switch(t){case"daily":n=!1,i=!1;break;case"monthly":{let a=(0,N.default)(e).startOf("month"),s=(0,N.default)(r).endOf("month");n=!a.isSame(e,"day"),i=!s.isSame(r,"day")}break;case"annually":{let a=(0,N.default)(e).startOf("year"),s=(0,N.default)(r).endOf("year");n=!a.isSame(e,"day"),i=!s.isSame(r,"day")}break;default:n=!1,i=!1;break}return{start:n,end:i}},Dr=()=>[{value:"none",text:"None"},{value:"today",text:"Today"},{value:"past",text:"Past:",disabled:!0},{value:"yesterday",text:"Yesterday"},{value:"last-seven-days",text:"Last 7 days"},{value:"last-thirty-days",text:"Last 30 days"},{value:"last-month",text:"Last month"},{value:"last-full-month",text:"Last full month"},{value:"last-ninety-days",text:"Last 90 days"},{value:"last-three-months",text:"Last 3 months"},{value:"last-full-three-months",text:"Last full 3 months"},{value:"last-six-months",text:"Last 6 months"},{value:"last-full-six-months",text:"Last full 6 months"},{value:"last-year",text:"Last year"},{value:"last-full-year",text:"Last full year"},{value:"future",text:"Future:",disabled:!0},{value:"tomorrow",text:"Tomorrow"},{value:"next-seven-days",text:"Next 7 days"},{value:"next-thirty-days",text:"Next 30 days"},{value:"next-month",text:"Next month"},{value:"next-full-month",text:"Next full month"},{value:"next-ninety-days",text:"Next 90 days"},{value:"next-three-months",text:"Next 3 months"},{value:"next-full-three-months",text:"Next full 3 months"},{value:"next-six-months",text:"Next 6 months"},{value:"next-full-six-months",text:"Next full 6 months"},{value:"next-year",text:"Next year"},{value:"next-full-year",text:"Next full year"}],wr=()=>[{value:"hourly",text:"Hourly"},{value:"daily",text:"Daily"},{value:"monthly",text:"Monthly"},{value:"annually",text:"Annually"}],Wo=(t,e)=>{let r=e,n=["annually","monthly"],i=["annually"];return t.includes("month")&&i.includes(t)&&(r="monthly"),t.includes("day")&&n.includes(t)&&(r="daily"),r},Er=t=>{let e,r,n;switch(t){case"today":r=(0,N.default)(),e=(0,N.default)(),n="daily";break;case"yesterday":r=(0,N.default)().subtract(1,"day"),e=(0,N.default)().subtract(1,"day"),n="daily";break;case"last-seven-days":r=(0,N.default)(),e=r.subtract(7,"day").add(1,"day"),n="daily";break;case"last-thirty-days":r=(0,N.default)(),e=r.subtract(30,"day").add(1,"day"),n="daily";break;case"last-month":r=(0,N.default)(),e=r.subtract(1,"month").add(1,"day"),n="monthly";break;case"last-full-month":r=(0,N.default)().subtract(1,"month").endOf("month"),e=r.startOf("month"),n="monthly";break;case"last-ninety-days":r=(0,N.default)(),e=r.subtract(90,"day").add(1,"day"),n="daily";break;case"last-three-months":r=(0,N.default)(),e=r.subtract(3,"month").add(1,"day"),n="monthly";break;case"last-full-three-months":r=(0,N.default)().subtract(1,"month").endOf("month"),e=r.subtract(2,"month").startOf("month"),n="monthly";break;case"last-six-months":r=(0,N.default)(),e=r.subtract(6,"month").add(1,"day"),n="monthly";break;case"last-full-six-months":r=(0,N.default)().subtract(1,"month").endOf("month"),e=r.subtract(6,"month").startOf("month"),n="monthly";break;case"last-year":r=(0,N.default)(),e=r.subtract(1,"year").add(1,"day"),n="annually";break;case"last-full-year":r=(0,N.default)().subtract(1,"year").endOf("year"),e=r.startOf("year"),n="annually";break;case"tomorrow":r=(0,N.default)().add(1,"day"),e=(0,N.default)().add(1,"day"),n="daily";break;case"next-seven-days":e=(0,N.default)(),r=(0,N.default)().add(7,"day").subtract(1,"day"),n="daily";break;case"next-thirty-days":e=(0,N.default)(),r=(0,N.default)().add(30,"day").subtract(1,"day"),n="daily";break;case"next-month":e=(0,N.default)(),r=(0,N.default)().add(1,"month").subtract(1,"day"),n="monthly";break;case"next-full-month":e=(0,N.default)().add(1,"month").startOf("month"),r=e.endOf("month"),n="monthly";break;case"next-ninety-days":e=(0,N.default)(),r=(0,N.default)().add(90,"day").subtract(1,"day"),n="daily";break;case"next-three-months":e=(0,N.default)(),r=(0,N.default)().add(3,"month").subtract(1,"day"),n="monthly";break;case"next-full-three-months":e=(0,N.default)().add(1,"month").startOf("month"),r=e.add(2,"month").endOf("month"),n="monthly";break;case"next-year":e=(0,N.default)(),r=(0,N.default)().add(1,"year").subtract(1,"day"),n="annually";break;case"next-full-year":e=(0,N.default)().add(1,"year").startOf("year"),r=e.endOf("year"),n="annually";break;default:r=(0,N.default)(),e=(0,N.default)(),n="daily";break}return{start:e.format("YYYY-MM-DD").toString(),end:r.format("YYYY-MM-DD").toString(),granularity:n}},ot=(t,e)=>e.find(n=>n.value===t).text||t,Xo=(t,e,r)=>{let{preventDefault:n}=e.query,i=e.query[`${r}${t.name}.quick-filter`],a=e.query[`${r}${t.name}.granularity`],s,o;i&&i!=="none"?({start:s,end:o}=Er(i),a=Wo(i,a)):(a=e.query[`${r}${t.name}.granularity`],s=e.query[`${r}${t.name}.start`],o=e.query[`${r}${t.name}.end`]);let u=n?null:t.value?.start,l=n?null:t.value?.end,c=n?"daily":t.value?.granularity.value,m=n?"none":t.value?.quickFilter.value,f=wr(),h=Dr(),d=s||u||t.min,p=o||l||t.max,R=a||c,y=i||m;return{start:d,end:p,granularity:{value:R,display:ot(R,f)},quickFilter:{value:y,display:ot(y,h)},partialDate:{..._r(R,d,p)}}},Qo=(t,e)=>{let r=e.split(".")[0],n=Object.keys(t.body).filter(a=>a.includes(r)).map(a=>({name:a,value:t.body[a]})),i={start:"",end:"",granularity:null,quickFilter:null};return n.forEach(a=>{a.name.includes("start")&&(i.start=a.value),a.name.includes("end")&&(i.end=a.value),a.name.includes("granularity")&&(i.granularity=a.value),a.name.includes("granularity")&&(i.quickFilter=a.value)}),i=i.start!==""&&i.end!==""&&i.granularity&&i.quickFilter?i:"",{value:i,name:r}},Jo=(t,e)=>{let{granularity:r,quickFilter:n,start:i,end:a}=t.value,s={start:i?(0,N.default)(i,"D/M/YYYY").format("YYYY-MM-DD").toString():"",end:a?(0,N.default)(a,"D/M/YYYY").format("YYYY-MM-DD").toString():"",granularity:{value:r,display:e.granularityOptions.find(o=>o.value===r)?.text},quickFilter:{value:n,display:e.quickFilterOptions.find(o=>o.value===n)?.text}};return{...e,value:s}},Ko=(t,e)=>{let r,n=t.defaultQuickFilterValue,i=wr(),a=Dr();if(n){let{start:s,end:o,granularity:u}=Er(n);r={start:s,end:o,granularity:{value:u,display:ot(u,i)},quickFilter:{value:n,display:ot(n,a)},partialDate:{..._r(u,s,o)}}}else{r=Ce.getStartAndEndValueFromDefinition(t);let s=r.granularity?r.granularity.value:t.defaultGranularity||"daily";r={...r,granularity:{value:s,display:ot(s,i)},quickFilter:{value:"none",display:"None"},partialDate:{..._r(s,r.start,r.end)}}}return{...e,min:t.min,max:t.max,value:r,quickFilterOptions:Dr(),granularityOptions:wr()}},Zo=(t,e,r,n)=>{let i=[];if(t.defaultQuickFilterValue){let{start:a,end:s,granularity:o}=Er(t.defaultQuickFilterValue);i.push(`${r}${e}.quick-filter=${t.defaultQuickFilterValue}`),i.push(`${r}${e}.granularity=${o}`),i.push(`${r}${e}.start=${a}`),i.push(`${r}${e}.end=${s}`)}else t.defaultGranularity&&n?(i.push(`${r}${e}.granularity=${t.defaultGranularity}`),i.push(`${n}`)):t.defaultGranularity&&i.push(`${r}${e}.granularity=${t.defaultGranularity}`);return i.join("&")},Ve={getFilterFromDefinition:Ko,setValueFromRequest:Xo,getQueryFromDefinition:Zo,setDefaultValue:Qo,setFilterValueFromDefault:Jo};var eu=(t,e,r)=>{let n=e.query[`${r}${t.name}`],i,a;return n?.length&&(i=Array.isArray(n)?n:[n],a=i.join(",")),{requestfilterValue:a||null,requestfilterValues:i||[]}},tu=(t,e,r)=>(t.defaultValue?t.defaultValue.split(","):[]).map(i=>`${r}${e}=${i}`).join("&"),ru=(t,e)=>{let n=t.value.split(","),i=n.map(o=>t.options.find(l=>l.value===o).text).filter((o,u)=>u<3).join(", ");i=n.length>3?`${i} + ${n.length-3} more`:i;let a=n.map(o=>`"${o}"`);return{key:[`${e}${t.name}`],value:a,displayValue:i}},Rr={getQueryFromDefinition:tu,setValueFromRequest:eu,getMultiselectValues:ru};var nu=t=>{let e=t.locals.csrfToken||"csrfToken",r=t.locals.user?.uuid?t.locals.user.uuid:"userId",n=t.locals.user?.token?t.locals.user.token:"token",i=t.locals.user?.activeCaseLoadId||"",a=t.locals.pathSuffix||"",s=t.locals.routePrefix||"",o=t.locals.definitions||[],u=t.locals.requestedReports||[],l=t.locals.recentlyViewedReports||[],c=t.locals.bookmarks||[],{bookmarkingEnabled:m,downloadingEnabled:f,definitionsPath:h,dpdPathFromQuery:d,dpdPathFromConfig:p,nestedBaseUrl:R}=t.locals;return{csrfToken:e,userId:r,token:n,definitions:o,requestedReports:u,recentlyViewedReports:l,bookmarks:c,bookmarkingEnabled:m,downloadingEnabled:f,dpdPathFromQuery:d,dpdPathFromConfig:p,definitionsPath:h,pathSuffix:a,routePrefix:s,activeCaseLoadId:i,nestedBaseUrl:R}},iu=(t,e)=>(e&&(t.query={...t.query,dataProductDefinitionsPath:e}),t.query),Ue={getValues:nu,setDdpPathToReqQuery:iu};var ci=(t,e,r="filters.")=>{let{preventDefault:n}=e.query;return Object.keys(e.query).every(i=>!i.includes(r))&&!n?t:t.map(i=>{let a,s;i.type.toLowerCase()==="DateRange".toLowerCase()?a=ge.setValueFromRequest(i,e,r):i.type.toLowerCase()==="GranularDateRange".toLowerCase()?a=Ve.setValueFromRequest(i,e,r):i.type.toLowerCase()==="Date".toLowerCase()?a=kt.setValueFromRequest(i,e,r):i.type.toLowerCase()==="Multiselect".toLowerCase()?{requestfilterValue:a,requestfilterValues:s}=Rr.setValueFromRequest(i,e,r):a=e.query[`${r}${i.name}`];let o=null;return a?o=a:n&&(o=null),{...i,value:o,...s&&{values:s}}})},su=(t,e)=>{let r=t.some(n=>e.findIndex(a=>a.name===n.name)!==-1);return t.map(n=>{let i=e.find(o=>o.name===n.name),a={...n},s=n.type.toLocaleLowerCase();if(s==="Multiselect".toLocaleLowerCase()){let o=r?"":a.value;o=i?i.value:o;let u=r?[]:a.values;u=i?i.value.split(","):u,a={...a,value:o,values:u}}else if(s==="Date".toLocaleLowerCase()){let o=r?"":a.value;i=i||{...i,value:o},a=kt.setFilterValueFromDefault(i,a)}else if(s==="DateRange".toLocaleLowerCase()){let o=r?{start:"",end:""}:a.value;i=i||{...i,value:o},a=ge.setFilterValueFromDefault(i,a)}else if(s==="GranularDateRange".toLocaleLowerCase()){let o=r?{start:"",end:"",granularity:"",quickFilter:""}:a.value;i=i||{...i,value:o},a=Ve.setFilterValueFromDefault(i,a)}else{let o=r?"":a.value;o=i?i.value:o,a={...n,value:o}}return a})},ou=(t,e)=>{let r=t.filter(n=>n.filter);return e&&(r=r.filter(n=>n.filter.interactive)),r.filter(n=>n.filter&&n.filter.defaultValue).map(n=>{let{filter:i}=n;if(i.type.toLowerCase()==="DateRange".toLowerCase())return ge.getQueryFromDefinition(i,n.name,fe);if(i.type.toLowerCase()==="Multiselect".toLowerCase())return Rr.getQueryFromDefinition(i,n.name,fe);if(i.type.toLowerCase()==="GranularDateRange".toLowerCase()){let a=ge.getQueryFromDefinition(i,n.name,fe);return Ve.getQueryFromDefinition(i,n.name,fe,a)}return`${fe}${n.name}=${i.defaultValue}`}).join("&")},uu=async(t,e,r)=>{let{token:n,definitionsPath:i}=Ue.getValues(e),{reportId:a,id:s,type:o}=t.body,l=await(o==="report"?r.reportingService:r.dashboardService).getDefinition(n,a,s,i),c=o==="report"?l.variant.specification.fields:l.filterFields,m=Object.keys(t.body).filter(h=>h.includes("filters.")).map(h=>({name:h.replace("filters.",""),value:t.body[h]})).map(h=>{let d=h.name.split(".")[0],p=c.find(w=>w.name===d),{value:R,name:y}=h;if(p){let w=p.filter?.type.toLocaleLowerCase();w==="Multiselect".toLocaleLowerCase()&&(R=h.value.join(",")),w==="DateRange".toLocaleLowerCase()&&({value:R,name:y}=ge.setDefaultValue(t,y)),w==="GranularDateRange".toLocaleLowerCase()&&({name:y,value:R}=Ve.setDefaultValue(t,y))}return{name:y,value:R}}),f=Array.from(new Set(m.map(h=>h.name))).map(h=>m.find(d=>d.name===h));return f=f.filter(h=>h.value!==""),f},lu=(t,e)=>{let{activeCaseLoadId:r}=Ue.getValues(t);return e.forEach(n=>{n.type.toLocaleLowerCase()==="Autocomplete".toLocaleLowerCase()&&n.text.toLocaleLowerCase().includes("establishment")&&r.length&&(n.value=r)}),e},fi=(t,e)=>t.filter(r=>r.filter).filter(r=>{if(e!==void 0){let n=r.filter.interactive;return n===void 0?!e:e===n}return!0}).map(r=>{let{display:n,name:i,filter:a}=r,{type:s,staticOptions:o,dynamicOptions:u,defaultValue:l,mandatory:c,pattern:m}=a,f=o?o.map(p=>({value:p.name,text:p.display})):[],h={text:n,name:i,type:s,value:l||null,minimumLength:u?u.minimumLength:null,dynamicResourceEndpoint:null,mandatory:c||!1,pattern:m},d={value:"no-filter",text:"None",disabled:!1};switch(s){case"Autocomplete".toLowerCase():h={...h,options:f};break;case"Radio":c||f.unshift(d),h={...h,options:f};break;case"Select":{c||f.unshift(d),f.unshift({value:"",text:"Select your option",disabled:!0,selected:!0}),h={...h,options:f};break}case"Multiselect".toLowerCase():h={...h,options:f,values:l?l.split(","):[]};break;case"DateRange".toLowerCase():h=ge.getFilterFromDefinition(a,h);break;case"Date".toLowerCase():h=kt.getFilterFromDefinition(a,h);break;case"GranularDateRange".toLocaleLowerCase():{let p=a;h=Ve.getFilterFromDefinition(p,h);break}default:break}return h}),cu=(t,e,r,n)=>{let i={},{fields:a}=e.specification,{preventDefault:s}=n.query;if(Object.keys(t.filters).length===0&&!s&&a.filter(u=>u.filter&&u.filter.defaultValue).forEach(u=>{if(u.filter.type.toLowerCase()==="DateRange".toLowerCase()){let l=u.filter.defaultValue.split(" - ");l.length>=1&&(i[`${fe}${u.name}.start`]=l[0],l.length>=2&&(i[`${fe}${u.name}.end`]=l[1]))}else i[`${fe}${u.name}`]=u.filter.defaultValue}),Object.keys(i).length>0){let u=nt(t.toRecordWithFilterPrefix(),i,a);return r.redirect(`${n.baseUrl}${n.path}${u}`),!0}return!1},fu=async({fields:t,req:e,interactive:r=!1,prefix:n="filters."})=>{let i=await fi(t,r),a=ci(i,e),s=si.getSelectedFilters(a,n);return{filters:a,selectedFilters:s}},hi={getFiltersFromDefinition:fi,setFilterValuesFromRequest:ci,getFilters:fu,setFilterQueryFromFilterDefinition:ou,redirectWithDefaultFilters:cu,setFilterValuesFromSavedDefaults:su,setUserDefinedDefaultValuesForReport:uu,setUserContextDefaults:lu};var di=re(cr());var ut=class{constructor(e){this.build=()=>this.userStoreItem;this.initialiseItem=()=>this.addReportData({type:this.requestFormData.type,reportId:this.requestFormData.reportId,reportName:this.requestFormData.reportName,description:this.requestFormData.description,id:this.requestFormData.id,name:this.requestFormData.name});this.addReportData=({type:e,reportId:r,reportName:n,description:i,id:a,name:s})=>(this.userStoreItem={type:e,reportId:r,reportName:n,description:i,id:a,name:s,timestamp:{}},this);this.addExecutionData=e=>(this.userStoreItem={...this.userStoreItem,...e},this);this.addChildExecutionData=e=>(this.userStoreItem={...this.userStoreItem,childExecutionData:e},this);this.addFilters=e=>{let r=new URLSearchParams(e).toString();return this.userStoreItem={...this.userStoreItem,filters:{data:e,queryString:r}},this};this.addSortData=e=>{let r=new URLSearchParams(e).toString();return this.userStoreItem={...this.userStoreItem,sortBy:{data:e,queryString:r}},this};this.addRequestUrls=e=>{let{origin:r,pathname:n,search:i,href:a,defaultInteractiveQueryString:s}=this.requestFormData,{executionId:o,dataProductDefinitionsPath:u,dpdPathFromQuery:l}=this.userStoreItem,c=l?`${Un(u)}`:"",m=e.baseUrl.replace("/filters",`/${o}/status`),f=`${r}${m}`;return this.userStoreItem={...this.userStoreItem,url:{origin:r,request:{fullUrl:a,pathname:n,search:i},polling:{fullUrl:f,pathname:m},report:{...s?.length&&{search:c.length?`${c}&${s}`:`?${s}`,default:`?${s}`}}}},this};this.addAsyncUrls=e=>(this.userStoreItem={...this.userStoreItem,url:e},this);this.addReportUrls=e=>{let r=e.get("host"),n=`${e.protocol}://${e.get("host")}${e.originalUrl}`,i=(0,di.default)(e);return this.userStoreItem={...this.userStoreItem,url:{origin:r||this.userStoreItem.url.origin,...this.userStoreItem.url?.request&&{request:this.userStoreItem.url.request},...this.userStoreItem.url?.polling&&{polling:this.userStoreItem.url.polling},report:{...this.userStoreItem.url?.report&&this.userStoreItem.url.report,fullUrl:n,...i.search&&{search:i.search}}}},this};this.addLoadType=e=>(this.userStoreItem={...this.userStoreItem,loadType:e},this);this.addQuery=e=>(this.userStoreItem={...this.userStoreItem,query:{data:e.query,summary:e.querySummary}},this);this.addInteractiveQuery=e=>(e&&(this.userStoreItem={...this.userStoreItem,interactiveQuery:{data:e.query,summary:e.querySummary}}),this);this.addStatus=e=>(this.userStoreItem={...this.userStoreItem,status:e},this);this.addMetrics=e=>(this.userStoreItem={...this.userStoreItem,metrics:e.map(r=>({name:r.display}))},this);this.addTimestamp=()=>{let{status:e}=this.userStoreItem,r=new Date;switch(e){case"FAILED":this.userStoreItem.timestamp.failed=r;break;case"EXPIRED":this.userStoreItem.timestamp.expired=r;break;case"ABORTED":this.userStoreItem.timestamp.aborted=r;break;case"FINISHED":this.userStoreItem.timestamp.completed=r;break;case"SUBMITTED":this.userStoreItem.timestamp.requested=r;break;case"STARTED":case"PICKED":break;default:this.userStoreItem.timestamp.lastViewed=r;break}return this};this.addDefinitionsPath=(e,r)=>(e&&(this.userStoreItem={...this.userStoreItem,dataProductDefinitionsPath:e,dpdPathFromQuery:r}),this);this.requestFormData=e,this.requestFormData&&this.initialiseItem()}};var Ye=re(at()),eo=re(st());var Ks=re(ls()),Zs=re(Js()),Ac=(0,Zs.default)({outputMode:"short",color:!1}),Lc=Ks.default.createLogger({name:"Digital Prison Reporting:",stream:Ac,level:"debug"}),xn=Lc;var Lt=class{constructor(){this.isoDateRegEx=/^(\d{4}[/-](0?[1-9]|1[012])[/-](0?[1-9]|[12][0-9]|3[01]))/;this.localDateRegEx=/^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{4}$/;this.localDateShortYearRegEx=/^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{2}$/;this.localDateTimeRegEx=/^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{4} [0-2]\d:[0-5]\d$/;this.localDateTimeShortYearRegEx=/^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{2} [0-2]\d:[0-5]\d$/;this.isoFormat="YYYY-MM-DD";this.localDateFormatInput="D/M/YYYY";this.localDateFormatOutput="DD/MM/YYYY";this.localDateShortYearFormatInput="D/M/YY";this.localDateShortYearFormatOutput="DD/MM/YY";this.localDateTimeFormatInput="D/M/YYYY HH:mm";this.localDateTimeFormatOutput="DD/MM/YYYY HH:mm";this.localDateTimeShortYearFormatInput="D/M/YY HH:mm";this.localDateTimeShortYearFormatOutput="DD/MM/YY HH:mm"}getDateType(e){if(e&&e.match){if(e.match(this.isoDateRegEx))return"iso";if(e.match(this.localDateRegEx))return"local-date";if(e.match(this.localDateShortYearRegEx))return"local-date-short-year";if(e.match(this.localDateTimeRegEx))return"local-datetime";if(e.match(this.localDateTimeShortYearRegEx))return"local-datetime-short-year"}return"none"}getDateWrapper(e){switch(Ye.default.extend(eo.default),this.getDateType(e)){case"iso":return(0,Ye.default)(e);case"local-date":return(0,Ye.default)(e,this.localDateFormatInput);case"local-date-short-year":return(0,Ye.default)(e,this.localDateShortYearFormatInput);case"local-datetime":return(0,Ye.default)(e,this.localDateTimeFormatInput);case"local-datetime-short-year":return(0,Ye.default)(e,this.localDateTimeShortYearFormatInput);default:return null}}isDate(e){return this.getDateType(e)!=="none"}toDateString(e,r){let n=this.getDateWrapper(e);if(n)switch(r){case"iso":return n.format(this.isoFormat);case"local-date":return n.format(this.localDateFormatOutput);case"local-date-short-year":return n.format(this.localDateShortYearFormatOutput);case"local-datetime":return n.format(this.localDateTimeFormatOutput);case"local-datetime-short-year":return n.format(this.localDateTimeShortYearFormatOutput);default:return xn.warn(`Invalid date type: ${r}`),null}return e&&xn.warn(`Could not map non-date value : ${e}`),null}};var Tt=class{constructor(e,r=!1){this.columns=[];this.reportSummaries={};this.reportQuery=null;this.currentQueryParams=null;this.dateMapper=new Lt;this.fields=e,this.sortData=r}mapDate(e){return e?this.dateMapper.toDateString(e,"local-datetime-short-year"):""}mapBoolean(e){return e?e.substring(0,1).toUpperCase()+e.substring(1).toLowerCase():""}mapRow(e,r="",n=[]){return this.fields.filter(i=>this.columns.includes(i.name)).map(i=>{let s=n.find(o=>o.name===i.name)??i;return this.mapCell(s,e,r)})}mapCell(e,r,n=""){let i=this.mapCellValue(e,r[e.name]),a="string",s=n;e.wordWrap&&(s+=` data-table-cell-wrap-${e.wordWrap.toLowerCase()}`),e.header&&(s+=" govuk-table__header"),(e.type==="double"||e.type==="long")&&(a="numeric");let o=e.type==="HTML";return{fieldName:e.name,...o?{html:i}:{text:i},format:a,classes:s.trim()}}mapCellValue(e,r){if(e.calculated)return r;switch(e.type){case"boolean":return this.mapBoolean(r);case"date":case"time":return this.mapDate(r);default:return r}}mapHeader(e=!1,r=null){return this.fields.filter(n=>this.columns.includes(n.name)).map(n=>{if(this.reportQuery&&!e&&n.sortable){let i="none",a=nt(this.currentQueryParams,{sortColumn:n.name,sortedAsc:"true"});return n.name===this.reportQuery.sortColumn&&(i=this.reportQuery.sortedAsc?"ascending":"descending",this.reportQuery.sortedAsc&&(a=nt(this.currentQueryParams,{sortColumn:n.name,sortedAsc:"false"}))),{html:`<a data-column="${n.name}" class="data-table-header-button data-table-header-button-sort-${i}" href="${a}">${n.display}</a>`,classes:r}}return{text:n.display,classes:r}})}mapData(e){let r=this.mapSummary("table-header"),n=this.mergeCells(e.map(a=>this.mapRow(a))),i=this.mapSummary("table-footer");return r.concat(n).concat(i)}mergeCells(e){let r=this.fields.filter(i=>i.mergeRows).map(i=>i.name);if(r.length===0)return e;let n={};return r.forEach(i=>{n[i]=e.reduce((a,s)=>{let o=this.getCellByFieldName(s,i),u=o.text??o.html;return{...a,[u]:(a[u]??0)+1}},{})}),e.map(i=>{let a=[...i];return r.forEach(s=>{let o=this.getCellByFieldName(i,s),u=o.text??o.html,l=n[s][u];switch(l){case-1:a=a.filter(c=>c.fieldName!==s);break;case 1:break;default:o.rowspan=l,n[s][u]=-1}}),a})}getCellByFieldName(e,r){return e.find(n=>n.fieldName===r)}mapSummary(e){return this.reportSummaries[e]?this.reportSummaries[e].flatMap(r=>r.data.map(n=>this.mapRow(n,`dpr-report-summary-cell dpr-report-summary-cell-${e}`,r.fields))):[]}sort(e){return this.appendSortKeyToData(e).sort(this.sortKeyComparison()).map(r=>({...r}))}sortKeyComparison(){return(e,r)=>{let n=e.sortKey,i=r.sortKey;return n===i?0:n<i?-1:1}}appendSortKeyToData(e,r=null){let n=r||this.fields;return e.map(i=>{let a=this.getSortKey(i,n);return{...i,sortKey:a}})}mapNamesToFields(e){return e.map(r=>this.fields.find(n=>n.name===r))}getSortKey(e,r){return r.map(n=>{let i=e[n.name];return i===null?"zzzzzzzz":this.dateMapper.isDate(i)?this.dateMapper.toDateString(i,"iso"):this.mapCellValue(n,i)}).join("-").toLowerCase()}convertDataTableToHtml(e){let r=e.head.map(i=>`<th scope='col' class='govuk-table__header'>${i.html??i.text}</th>`),n=e.rows.map(i=>`<tr class='govuk-table__row'>${i.map(a=>`<td class='govuk-table__cell govuk-table__cell--${a.format} ${a.classes}'>${a.html??a.text}</td>`).join("")}</tr>`);return`<table class='govuk-table'><thead class='govuk-table__head'>${r.join("")}</thead><tbody class='govuk-table__body'>${n.join("")}</tbody></table>`}withHeaderOptions({reportQuery:e,columns:r,interactive:n}){return n?this.withHeaderSortOptions(e):this.withNoHeaderOptions(r)}withHeaderSortOptions(e){return this.reportQuery=e,this.columns=e.columns,this.currentQueryParams=this.reportQuery.toRecordWithFilterPrefix(),this}withNoHeaderOptions(e){return this.columns=e,this}buildTable(e){let r=this.mapData(this.sortData?this.sort(e):e);return{head:this.mapHeader(),rows:r,rowCount:e.length,colCount:this.columns.length}}withSummaries(e){return this.reportSummaries=e,this}withSortedData(e=!0){return this.sortData=e,this}};var ro=(t,e,r,n,i,a,s,o,u,l)=>{let{name:c,variant:m,id:f}=e,{name:h,id:d,printable:p}=m,R={enabled:a>0,name:h,reportName:c,csrfToken:t,reportId:f,id:d,columns:r.value,loadType:"sync",definitionPath:s,canDownload:i,currentUrl:o,currentQueryParams:u,nestedBaseUrl:l};return Hn.getActions({download:R,print:{enabled:p},share:{reportName:c,name:h,url:n},copy:{url:n}})},Tc=async(t,e,r,n,i,a,s,o)=>{let u={type:"report",reportId:a,id:s,reportName:r,description:i,name:n},l=new ut().addReportData(u).addStatus("READY").addTimestamp().addReportUrls(t).build();await e.recentlyViewedService.setRecentlyViewed(l,o)},no=async({services:t,req:e,token:r,reportId:n,id:i,dataProductDefinitionsPath:a})=>{let s=await t.reportingService.getDefinition(r,n,i,a),{variant:o}=s,{resourceName:u,specification:l}=o,c=new it({fields:l.fields,template:l.template,queryParams:e.query,definitionsPath:a});return{reportData:await t.reportingService.getListWithWarnings(u,r,c),reportDefinition:s,reportQuery:c}},Oc=async({req:t,res:e,services:r})=>{let{token:n,csrfToken:i,userId:a}=Ue.getValues(e),{reportId:s,id:o}=t.params,u=t.query.dataProductDefinitionsPath,{reportData:l,reportDefinition:c,reportQuery:m}=await no({services:r,req:t,token:n,reportId:s,id:o,dataProductDefinitionsPath:u}),f=await r.reportingService.getCount(c.variant.resourceName,n,m),h=await r.downloadPermissionService.downloadEnabled(a,s,o),d=await r.bookmarkService.isBookmarked(o,s,a),p=await ao({req:t,res:e,reportDefinition:c,reportQuery:m,reportData:l,count:f,csrfToken:i,canDownload:h});return Object.keys(p).length&&Tc(t,r,s,o,p.reportName,p.name,p.description,a),{renderData:{...p,csrfToken:i,loadType:"sync",reportId:s,id:o,bookmarked:d,dataProductDefinitionsPath:u}}},io=async(t,e,r,n,i)=>{let a=(0,to.default)(t),s=`${t.protocol}://${t.get("host")}${t.originalUrl}`,o=a.search?t.originalUrl.split(a.search)[0]:t.originalUrl,u=Gn.getPaginationData(a,e,t),l=new Tt(r.fields).withHeaderSortOptions(n).buildTable(i),c=Bn.getTotals(u.pageSize,u.currentPage,u.totalRows,l.rowCount),m=await hi.getFilters({fields:r.fields,req:t}),f=xt.getColumns(r,n.columns);return{dataTable:[l],totals:c,filterData:m,columns:f,pagination:u,reportUrl:o.replace("/download-disabled","").replace("/download-disabled?",""),reportSearch:a.search,encodedSearch:a.search?encodeURIComponent(a.search):void 0,fullUrl:s}},ao=async({req:t,res:e,reportDefinition:r,reportQuery:n,reportData:i,count:a,csrfToken:s,canDownload:o})=>{let{dataProductDefinitionsPath:u}=t.query,{nestedBaseUrl:l}=Ue.getValues(e),{name:c,description:m}=r,{specification:f,name:h,description:d,classification:p,printable:R}=r.variant,{data:y}=i,w=await io(t,a,f,n,y),$=ro(s,r,w.columns,`${t.protocol}://${t.get("host")}${t.originalUrl}`,o,a,u,w.reportUrl,w.reportSearch,l);return{...w,reportName:c,name:h,description:d||m,count:a,type:"report",classification:p,printable:R,actions:$,warnings:i.warnings,canDownload:o,nestedBaseUrl:l}},Cc={getRenderData:ao,getReport:Oc,getReportData:no,getReportRenderData:io,setActions:ro};
/*! Bundled license information:

parseurl/index.js:
  (*!
   * parseurl
   * Copyright(c) 2014 Jonathan Ong
   * Copyright(c) 2014-2017 Douglas Christopher Wilson
   * MIT Licensed
   *)
*/
//# sourceMappingURL=utils.js.map