@hpcc-js/comms 3.15.8 → 3.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";var so=Object.create;var ms=Object.defineProperty;var no=Object.getOwnPropertyDescriptor;var ro=Object.getOwnPropertyNames;var io=Object.getPrototypeOf,oo=Object.prototype.hasOwnProperty;var hs=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),ao=(n,e)=>{for(var t in e)ms(n,t,{get:e[t],enumerable:!0})},br=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ro(e))!oo.call(n,r)&&r!==t&&ms(n,r,{get:()=>e[r],enumerable:!(s=no(e,r))||s.enumerable});return n};var Ie=(n,e,t)=>(t=n!=null?so(io(n)):{},br(e||!n||!n.__esModule?ms(t,"default",{value:n,enumerable:!0}):t,n)),co=n=>br(ms({},"__esModule",{value:!0}),n);var Or=hs((Ts,jr)=>{(function(n,e){typeof Ts=="object"&&typeof jr<"u"?e(Ts):typeof define=="function"&&define.amd?define(["exports"],e):e(n.d3=n.d3||{})})(Ts,(function(n){"use strict";function e(u,S){return u<S?-1:u>S?1:u>=S?0:NaN}function t(u){return u.length===1&&(u=s(u)),{left:function(S,A,h,p){for(h==null&&(h=0),p==null&&(p=S.length);h<p;){var f=h+p>>>1;u(S[f],A)<0?h=f+1:p=f}return h},right:function(S,A,h,p){for(h==null&&(h=0),p==null&&(p=S.length);h<p;){var f=h+p>>>1;u(S[f],A)>0?p=f:h=f+1}return h}}}function s(u){return function(S,A){return e(u(S),A)}}var r=t(e),i=r.right,o=r.left;function c(u,S){S==null&&(S=d);for(var A=0,h=u.length-1,p=u[0],f=new Array(h<0?0:h);A<h;)f[A]=S(p,p=u[++A]);return f}function d(u,S){return[u,S]}function y(u,S,A){var h=u.length,p=S.length,f=new Array(h*p),U,L,Y,le;for(A==null&&(A=d),U=Y=0;U<h;++U)for(le=u[U],L=0;L<p;++L,++Y)f[Y]=A(le,S[L]);return f}function l(u,S){return S<u?-1:S>u?1:S>=u?0:NaN}function E(u){return u===null?NaN:+u}function R(u,S){var A=u.length,h=0,p=-1,f=0,U,L,Y=0;if(S==null)for(;++p<A;)isNaN(U=E(u[p]))||(L=U-f,f+=L/++h,Y+=L*(U-f));else for(;++p<A;)isNaN(U=E(S(u[p],p,u)))||(L=U-f,f+=L/++h,Y+=L*(U-f));if(h>1)return Y/(h-1)}function M(u,S){var A=R(u,S);return A&&Math.sqrt(A)}function w(u,S){var A=u.length,h=-1,p,f,U;if(S==null){for(;++h<A;)if((p=u[h])!=null&&p>=p)for(f=U=p;++h<A;)(p=u[h])!=null&&(f>p&&(f=p),U<p&&(U=p))}else for(;++h<A;)if((p=S(u[h],h,u))!=null&&p>=p)for(f=U=p;++h<A;)(p=S(u[h],h,u))!=null&&(f>p&&(f=p),U<p&&(U=p));return[f,U]}var V=Array.prototype,B=V.slice,q=V.map;function k(u){return function(){return u}}function P(u){return u}function F(u,S,A){u=+u,S=+S,A=(p=arguments.length)<2?(S=u,u=0,1):p<3?1:+A;for(var h=-1,p=Math.max(0,Math.ceil((S-u)/A))|0,f=new Array(p);++h<p;)f[h]=u+h*A;return f}var j=Math.sqrt(50),ce=Math.sqrt(10),D=Math.sqrt(2);function I(u,S,A){var h,p=-1,f,U,L;if(S=+S,u=+u,A=+A,u===S&&A>0)return[u];if((h=S<u)&&(f=u,u=S,S=f),(L=N(u,S,A))===0||!isFinite(L))return[];if(L>0)for(u=Math.ceil(u/L),S=Math.floor(S/L),U=new Array(f=Math.ceil(S-u+1));++p<f;)U[p]=(u+p)*L;else for(u=Math.floor(u*L),S=Math.ceil(S*L),U=new Array(f=Math.ceil(u-S+1));++p<f;)U[p]=(u-p)/L;return h&&U.reverse(),U}function N(u,S,A){var h=(S-u)/Math.max(0,A),p=Math.floor(Math.log(h)/Math.LN10),f=h/Math.pow(10,p);return p>=0?(f>=j?10:f>=ce?5:f>=D?2:1)*Math.pow(10,p):-Math.pow(10,-p)/(f>=j?10:f>=ce?5:f>=D?2:1)}function v(u,S,A){var h=Math.abs(S-u)/Math.max(0,A),p=Math.pow(10,Math.floor(Math.log(h)/Math.LN10)),f=h/p;return f>=j?p*=10:f>=ce?p*=5:f>=D&&(p*=2),S<u?-p:p}function z(u){return Math.ceil(Math.log(u.length)/Math.LN2)+1}function se(){var u=P,S=w,A=z;function h(p){var f,U=p.length,L,Y=new Array(U);for(f=0;f<U;++f)Y[f]=u(p[f],f,p);var le=S(Y),Re=le[0],fe=le[1],Z=A(Y,Re,fe);Array.isArray(Z)||(Z=v(Re,fe,Z),Z=F(Math.ceil(Re/Z)*Z,fe,Z));for(var ge=Z.length;Z[0]<=Re;)Z.shift(),--ge;for(;Z[ge-1]>fe;)Z.pop(),--ge;var ne=new Array(ge+1),He;for(f=0;f<=ge;++f)He=ne[f]=[],He.x0=f>0?Z[f-1]:Re,He.x1=f<ge?Z[f]:fe;for(f=0;f<U;++f)L=Y[f],Re<=L&&L<=fe&&ne[i(Z,L,0,ge)].push(p[f]);return ne}return h.value=function(p){return arguments.length?(u=typeof p=="function"?p:k(p),h):u},h.domain=function(p){return arguments.length?(S=typeof p=="function"?p:k([p[0],p[1]]),h):S},h.thresholds=function(p){return arguments.length?(A=typeof p=="function"?p:Array.isArray(p)?k(B.call(p)):k(p),h):A},h}function _(u,S,A){if(A==null&&(A=E),!!(h=u.length)){if((S=+S)<=0||h<2)return+A(u[0],0,u);if(S>=1)return+A(u[h-1],h-1,u);var h,p=(h-1)*S,f=Math.floor(p),U=+A(u[f],f,u),L=+A(u[f+1],f+1,u);return U+(L-U)*(p-f)}}function he(u,S,A){return u=q.call(u,E).sort(e),Math.ceil((A-S)/(2*(_(u,.75)-_(u,.25))*Math.pow(u.length,-1/3)))}function Te(u,S,A){return Math.ceil((A-S)/(3.5*M(u)*Math.pow(u.length,-1/3)))}function ve(u,S){var A=u.length,h=-1,p,f;if(S==null){for(;++h<A;)if((p=u[h])!=null&&p>=p)for(f=p;++h<A;)(p=u[h])!=null&&p>f&&(f=p)}else for(;++h<A;)if((p=S(u[h],h,u))!=null&&p>=p)for(f=p;++h<A;)(p=S(u[h],h,u))!=null&&p>f&&(f=p);return f}function st(u,S){var A=u.length,h=A,p=-1,f,U=0;if(S==null)for(;++p<A;)isNaN(f=E(u[p]))?--h:U+=f;else for(;++p<A;)isNaN(f=E(S(u[p],p,u)))?--h:U+=f;if(h)return U/h}function J(u,S){var A=u.length,h=-1,p,f=[];if(S==null)for(;++h<A;)isNaN(p=E(u[h]))||f.push(p);else for(;++h<A;)isNaN(p=E(S(u[h],h,u)))||f.push(p);return _(f.sort(e),.5)}function we(u){for(var S=u.length,A,h=-1,p=0,f,U;++h<S;)p+=u[h].length;for(f=new Array(p);--S>=0;)for(U=u[S],A=U.length;--A>=0;)f[--p]=U[A];return f}function Se(u,S){var A=u.length,h=-1,p,f;if(S==null){for(;++h<A;)if((p=u[h])!=null&&p>=p)for(f=p;++h<A;)(p=u[h])!=null&&f>p&&(f=p)}else for(;++h<A;)if((p=S(u[h],h,u))!=null&&p>=p)for(f=p;++h<A;)(p=S(u[h],h,u))!=null&&f>p&&(f=p);return f}function ue(u,S){for(var A=S.length,h=new Array(A);A--;)h[A]=u[S[A]];return h}function Ue(u,S){if(A=u.length){var A,h=0,p=0,f,U=u[p];for(S==null&&(S=e);++h<A;)(S(f=u[h],U)<0||S(U,U)!==0)&&(U=f,p=h);if(S(U,U)===0)return p}}function Pe(u,S,A){for(var h=(A??u.length)-(S=S==null?0:+S),p,f;h;)f=Math.random()*h--|0,p=u[h+S],u[h+S]=u[f+S],u[f+S]=p;return u}function Me(u,S){var A=u.length,h=-1,p,f=0;if(S==null)for(;++h<A;)(p=+u[h])&&(f+=p);else for(;++h<A;)(p=+S(u[h],h,u))&&(f+=p);return f}function Ne(u){if(!(f=u.length))return[];for(var S=-1,A=Se(u,Ce),h=new Array(A);++S<A;)for(var p=-1,f,U=h[S]=new Array(f);++p<f;)U[p]=u[p][S];return h}function Ce(u){return u.length}function Ve(){return Ne(arguments)}n.bisect=i,n.bisectRight=i,n.bisectLeft=o,n.ascending=e,n.bisector=t,n.cross=y,n.descending=l,n.deviation=M,n.extent=w,n.histogram=se,n.thresholdFreedmanDiaconis=he,n.thresholdScott=Te,n.thresholdSturges=z,n.max=ve,n.mean=st,n.median=J,n.merge=we,n.min=Se,n.pairs=c,n.permute=ue,n.quantile=_,n.range=F,n.scan=Ue,n.shuffle=Pe,n.sum=Me,n.ticks=I,n.tickIncrement=N,n.tickStep=v,n.transpose=Ne,n.variance=R,n.zip=Ve,Object.defineProperty(n,"__esModule",{value:!0})}))});var Xr=hs((Ls,Yr)=>{(function(n,e){typeof Ls=="object"&&typeof Yr<"u"?e(Ls):typeof define=="function"&&define.amd?define(["exports"],e):(n=n||self,e(n.d3=n.d3||{}))})(Ls,function(n){"use strict";var e=new Date,t=new Date;function s(g,C,ee,cs){function ie(Q){return g(Q=arguments.length===0?new Date:new Date(+Q)),Q}return ie.floor=function(Q){return g(Q=new Date(+Q)),Q},ie.ceil=function(Q){return g(Q=new Date(Q-1)),C(Q,1),g(Q),Q},ie.round=function(Q){var X=ie(Q),Ae=ie.ceil(Q);return Q-X<Ae-Q?X:Ae},ie.offset=function(Q,X){return C(Q=new Date(+Q),X==null?1:Math.floor(X)),Q},ie.range=function(Q,X,Ae){var wt=[],us;if(Q=ie.ceil(Q),Ae=Ae==null?1:Math.floor(Ae),!(Q<X)||!(Ae>0))return wt;do wt.push(us=new Date(+Q)),C(Q,Ae),g(Q);while(us<Q&&Q<X);return wt},ie.filter=function(Q){return s(function(X){if(X>=X)for(;g(X),!Q(X);)X.setTime(X-1)},function(X,Ae){if(X>=X)if(Ae<0)for(;++Ae<=0;)for(;C(X,-1),!Q(X););else for(;--Ae>=0;)for(;C(X,1),!Q(X););})},ee&&(ie.count=function(Q,X){return e.setTime(+Q),t.setTime(+X),g(e),g(t),Math.floor(ee(e,t))},ie.every=function(Q){return Q=Math.floor(Q),!isFinite(Q)||!(Q>0)?null:Q>1?ie.filter(cs?function(X){return cs(X)%Q===0}:function(X){return ie.count(0,X)%Q===0}):ie}),ie}var r=s(function(){},function(g,C){g.setTime(+g+C)},function(g,C){return C-g});r.every=function(g){return g=Math.floor(g),!isFinite(g)||!(g>0)?null:g>1?s(function(C){C.setTime(Math.floor(C/g)*g)},function(C,ee){C.setTime(+C+ee*g)},function(C,ee){return(ee-C)/g}):r};var i=r.range,o=1e3,c=6e4,d=36e5,y=864e5,l=6048e5,E=s(function(g){g.setTime(g-g.getMilliseconds())},function(g,C){g.setTime(+g+C*o)},function(g,C){return(C-g)/o},function(g){return g.getUTCSeconds()}),R=E.range,M=s(function(g){g.setTime(g-g.getMilliseconds()-g.getSeconds()*o)},function(g,C){g.setTime(+g+C*c)},function(g,C){return(C-g)/c},function(g){return g.getMinutes()}),w=M.range,V=s(function(g){g.setTime(g-g.getMilliseconds()-g.getSeconds()*o-g.getMinutes()*c)},function(g,C){g.setTime(+g+C*d)},function(g,C){return(C-g)/d},function(g){return g.getHours()}),B=V.range,q=s(function(g){g.setHours(0,0,0,0)},function(g,C){g.setDate(g.getDate()+C)},function(g,C){return(C-g-(C.getTimezoneOffset()-g.getTimezoneOffset())*c)/y},function(g){return g.getDate()-1}),k=q.range;function P(g){return s(function(C){C.setDate(C.getDate()-(C.getDay()+7-g)%7),C.setHours(0,0,0,0)},function(C,ee){C.setDate(C.getDate()+ee*7)},function(C,ee){return(ee-C-(ee.getTimezoneOffset()-C.getTimezoneOffset())*c)/l})}var F=P(0),j=P(1),ce=P(2),D=P(3),I=P(4),N=P(5),v=P(6),z=F.range,se=j.range,_=ce.range,he=D.range,Te=I.range,ve=N.range,st=v.range,J=s(function(g){g.setDate(1),g.setHours(0,0,0,0)},function(g,C){g.setMonth(g.getMonth()+C)},function(g,C){return C.getMonth()-g.getMonth()+(C.getFullYear()-g.getFullYear())*12},function(g){return g.getMonth()}),we=J.range,Se=s(function(g){g.setMonth(0,1),g.setHours(0,0,0,0)},function(g,C){g.setFullYear(g.getFullYear()+C)},function(g,C){return C.getFullYear()-g.getFullYear()},function(g){return g.getFullYear()});Se.every=function(g){return!isFinite(g=Math.floor(g))||!(g>0)?null:s(function(C){C.setFullYear(Math.floor(C.getFullYear()/g)*g),C.setMonth(0,1),C.setHours(0,0,0,0)},function(C,ee){C.setFullYear(C.getFullYear()+ee*g)})};var ue=Se.range,Ue=s(function(g){g.setUTCSeconds(0,0)},function(g,C){g.setTime(+g+C*c)},function(g,C){return(C-g)/c},function(g){return g.getUTCMinutes()}),Pe=Ue.range,Me=s(function(g){g.setUTCMinutes(0,0,0)},function(g,C){g.setTime(+g+C*d)},function(g,C){return(C-g)/d},function(g){return g.getUTCHours()}),Ne=Me.range,Ce=s(function(g){g.setUTCHours(0,0,0,0)},function(g,C){g.setUTCDate(g.getUTCDate()+C)},function(g,C){return(C-g)/y},function(g){return g.getUTCDate()-1}),Ve=Ce.range;function u(g){return s(function(C){C.setUTCDate(C.getUTCDate()-(C.getUTCDay()+7-g)%7),C.setUTCHours(0,0,0,0)},function(C,ee){C.setUTCDate(C.getUTCDate()+ee*7)},function(C,ee){return(ee-C)/l})}var S=u(0),A=u(1),h=u(2),p=u(3),f=u(4),U=u(5),L=u(6),Y=S.range,le=A.range,Re=h.range,fe=p.range,Z=f.range,ge=U.range,ne=L.range,He=s(function(g){g.setUTCDate(1),g.setUTCHours(0,0,0,0)},function(g,C){g.setUTCMonth(g.getUTCMonth()+C)},function(g,C){return C.getUTCMonth()-g.getUTCMonth()+(C.getUTCFullYear()-g.getUTCFullYear())*12},function(g){return g.getUTCMonth()}),En=He.range,Tt=s(function(g){g.setUTCMonth(0,1),g.setUTCHours(0,0,0,0)},function(g,C){g.setUTCFullYear(g.getUTCFullYear()+C)},function(g,C){return C.getUTCFullYear()-g.getUTCFullYear()},function(g){return g.getUTCFullYear()});Tt.every=function(g){return!isFinite(g=Math.floor(g))||!(g>0)?null:s(function(C){C.setUTCFullYear(Math.floor(C.getUTCFullYear()/g)*g),C.setUTCMonth(0,1),C.setUTCHours(0,0,0,0)},function(C,ee){C.setUTCFullYear(C.getUTCFullYear()+ee*g)})};var Fn=Tt.range;n.timeDay=q,n.timeDays=k,n.timeFriday=N,n.timeFridays=ve,n.timeHour=V,n.timeHours=B,n.timeInterval=s,n.timeMillisecond=r,n.timeMilliseconds=i,n.timeMinute=M,n.timeMinutes=w,n.timeMonday=j,n.timeMondays=se,n.timeMonth=J,n.timeMonths=we,n.timeSaturday=v,n.timeSaturdays=st,n.timeSecond=E,n.timeSeconds=R,n.timeSunday=F,n.timeSundays=z,n.timeThursday=I,n.timeThursdays=Te,n.timeTuesday=ce,n.timeTuesdays=_,n.timeWednesday=D,n.timeWednesdays=he,n.timeWeek=F,n.timeWeeks=z,n.timeYear=Se,n.timeYears=ue,n.utcDay=Ce,n.utcDays=Ve,n.utcFriday=U,n.utcFridays=ge,n.utcHour=Me,n.utcHours=Ne,n.utcMillisecond=r,n.utcMilliseconds=i,n.utcMinute=Ue,n.utcMinutes=Pe,n.utcMonday=A,n.utcMondays=le,n.utcMonth=He,n.utcMonths=En,n.utcSaturday=L,n.utcSaturdays=ne,n.utcSecond=E,n.utcSeconds=R,n.utcSunday=S,n.utcSundays=Y,n.utcThursday=f,n.utcThursdays=Z,n.utcTuesday=h,n.utcTuesdays=Re,n.utcWednesday=p,n.utcWednesdays=fe,n.utcWeek=S,n.utcWeeks=Y,n.utcYear=Tt,n.utcYears=Fn,Object.defineProperty(n,"__esModule",{value:!0})})});var jn=hs((Gs,qr)=>{(function(n,e){typeof Gs=="object"&&typeof qr<"u"?e(Gs,Xr()):typeof define=="function"&&define.amd?define(["exports","d3-time"],e):(n=n||self,e(n.d3=n.d3||{},n.d3))})(Gs,function(n,e){"use strict";function t(a){if(0<=a.y&&a.y<100){var m=new Date(-1,a.m,a.d,a.H,a.M,a.S,a.L);return m.setFullYear(a.y),m}return new Date(a.y,a.m,a.d,a.H,a.M,a.S,a.L)}function s(a){if(0<=a.y&&a.y<100){var m=new Date(Date.UTC(-1,a.m,a.d,a.H,a.M,a.S,a.L));return m.setUTCFullYear(a.y),m}return new Date(Date.UTC(a.y,a.m,a.d,a.H,a.M,a.S,a.L))}function r(a,m,x){return{y:a,m,d:x,H:0,M:0,S:0,L:0}}function i(a){var m=a.dateTime,x=a.date,W=a.time,je=a.periods,nt=a.days,ls=a.shortDays,gs=a.months,ps=a.shortMonths,bi=R(je),Ui=M(je),Ei=R(nt),Fi=M(nt),Ii=R(ls),Pi=M(ls),Mi=R(gs),Ti=M(gs),wi=R(ps),Ni=M(ps),rt={a:Oi,A:_i,b:Yi,B:Xi,c:null,d:J,e:J,f:Pe,g:U,G:Y,H:we,I:Se,j:ue,L:Ue,m:Me,M:Ne,p:qi,q:zi,Q:Cr,s:Rr,S:Ce,u:Ve,U:u,V:A,w:h,W:p,x:null,X:null,y:f,Y:L,Z:le,"%":Sr},it={a:Ji,A:Ki,b:Zi,B:$i,c:null,d:Re,e:Re,f:He,g:Ae,G:us,H:fe,I:Z,j:ge,L:ne,m:En,M:Tt,p:eo,q:to,Q:Cr,s:Rr,S:Fn,u:g,U:C,V:cs,w:ie,W:Q,x:null,X:null,y:X,Y:wt,Z:Ri,"%":Sr},Bi={a:Li,A:Gi,b:ki,B:vi,c:Vi,d:I,e:I,f:he,g:F,G:P,H:v,I:v,j:N,L:_,m:D,M:z,p:Qi,q:ce,Q:ve,s:st,S:se,u:V,U:B,V:q,w,W:k,x:Hi,X:ji,y:F,Y:P,Z:j,"%":Te};rt.x=Oe(x,rt),rt.X=Oe(W,rt),rt.c=Oe(m,rt),it.x=Oe(x,it),it.X=Oe(W,it),it.c=Oe(m,it);function Oe(T,H){return function(O){var b=[],ye=-1,K=0,Ee=T.length,Fe,ot,Wr;for(O instanceof Date||(O=new Date(+O));++ye<Ee;)T.charCodeAt(ye)===37&&(b.push(T.slice(K,ye)),(ot=o[Fe=T.charAt(++ye)])!=null?Fe=T.charAt(++ye):ot=Fe==="e"?" ":"0",(Wr=H[Fe])&&(Fe=Wr(O,ot)),b.push(Fe),K=ye+1);return b.push(T.slice(K,ye)),b.join("")}}function xr(T,H){return function(O){var b=r(1900,void 0,1),ye=ds(b,T,O+="",0),K,Ee;if(ye!=O.length)return null;if("Q"in b)return new Date(b.Q);if("s"in b)return new Date(b.s*1e3+("L"in b?b.L:0));if(H&&!("Z"in b)&&(b.Z=0),"p"in b&&(b.H=b.H%12+b.p*12),b.m===void 0&&(b.m="q"in b?b.q:0),"V"in b){if(b.V<1||b.V>53)return null;"w"in b||(b.w=1),"Z"in b?(K=s(r(b.y,0,1)),Ee=K.getUTCDay(),K=Ee>4||Ee===0?e.utcMonday.ceil(K):e.utcMonday(K),K=e.utcDay.offset(K,(b.V-1)*7),b.y=K.getUTCFullYear(),b.m=K.getUTCMonth(),b.d=K.getUTCDate()+(b.w+6)%7):(K=t(r(b.y,0,1)),Ee=K.getDay(),K=Ee>4||Ee===0?e.timeMonday.ceil(K):e.timeMonday(K),K=e.timeDay.offset(K,(b.V-1)*7),b.y=K.getFullYear(),b.m=K.getMonth(),b.d=K.getDate()+(b.w+6)%7)}else("W"in b||"U"in b)&&("w"in b||(b.w="u"in b?b.u%7:"W"in b?1:0),Ee="Z"in b?s(r(b.y,0,1)).getUTCDay():t(r(b.y,0,1)).getDay(),b.m=0,b.d="W"in b?(b.w+6)%7+b.W*7-(Ee+5)%7:b.w+b.U*7-(Ee+6)%7);return"Z"in b?(b.H+=b.Z/100|0,b.M+=b.Z%100,s(b)):t(b)}}function ds(T,H,O,b){for(var ye=0,K=H.length,Ee=O.length,Fe,ot;ye<K;){if(b>=Ee)return-1;if(Fe=H.charCodeAt(ye++),Fe===37){if(Fe=H.charAt(ye++),ot=Bi[Fe in o?H.charAt(ye++):Fe],!ot||(b=ot(T,O,b))<0)return-1}else if(Fe!=O.charCodeAt(b++))return-1}return b}function Qi(T,H,O){var b=bi.exec(H.slice(O));return b?(T.p=Ui[b[0].toLowerCase()],O+b[0].length):-1}function Li(T,H,O){var b=Ii.exec(H.slice(O));return b?(T.w=Pi[b[0].toLowerCase()],O+b[0].length):-1}function Gi(T,H,O){var b=Ei.exec(H.slice(O));return b?(T.w=Fi[b[0].toLowerCase()],O+b[0].length):-1}function ki(T,H,O){var b=wi.exec(H.slice(O));return b?(T.m=Ni[b[0].toLowerCase()],O+b[0].length):-1}function vi(T,H,O){var b=Mi.exec(H.slice(O));return b?(T.m=Ti[b[0].toLowerCase()],O+b[0].length):-1}function Vi(T,H,O){return ds(T,m,H,O)}function Hi(T,H,O){return ds(T,x,H,O)}function ji(T,H,O){return ds(T,W,H,O)}function Oi(T){return ls[T.getDay()]}function _i(T){return nt[T.getDay()]}function Yi(T){return ps[T.getMonth()]}function Xi(T){return gs[T.getMonth()]}function qi(T){return je[+(T.getHours()>=12)]}function zi(T){return 1+~~(T.getMonth()/3)}function Ji(T){return ls[T.getUTCDay()]}function Ki(T){return nt[T.getUTCDay()]}function Zi(T){return ps[T.getUTCMonth()]}function $i(T){return gs[T.getUTCMonth()]}function eo(T){return je[+(T.getUTCHours()>=12)]}function to(T){return 1+~~(T.getUTCMonth()/3)}return{format:function(T){var H=Oe(T+="",rt);return H.toString=function(){return T},H},parse:function(T){var H=xr(T+="",!1);return H.toString=function(){return T},H},utcFormat:function(T){var H=Oe(T+="",it);return H.toString=function(){return T},H},utcParse:function(T){var H=xr(T+="",!0);return H.toString=function(){return T},H}}}var o={"-":"",_:" ",0:"0"},c=/^\s*\d+/,d=/^%/,y=/[\\^$*+?|[\]().{}]/g;function l(a,m,x){var W=a<0?"-":"",je=(W?-a:a)+"",nt=je.length;return W+(nt<x?new Array(x-nt+1).join(m)+je:je)}function E(a){return a.replace(y,"\\$&")}function R(a){return new RegExp("^(?:"+a.map(E).join("|")+")","i")}function M(a){for(var m={},x=-1,W=a.length;++x<W;)m[a[x].toLowerCase()]=x;return m}function w(a,m,x){var W=c.exec(m.slice(x,x+1));return W?(a.w=+W[0],x+W[0].length):-1}function V(a,m,x){var W=c.exec(m.slice(x,x+1));return W?(a.u=+W[0],x+W[0].length):-1}function B(a,m,x){var W=c.exec(m.slice(x,x+2));return W?(a.U=+W[0],x+W[0].length):-1}function q(a,m,x){var W=c.exec(m.slice(x,x+2));return W?(a.V=+W[0],x+W[0].length):-1}function k(a,m,x){var W=c.exec(m.slice(x,x+2));return W?(a.W=+W[0],x+W[0].length):-1}function P(a,m,x){var W=c.exec(m.slice(x,x+4));return W?(a.y=+W[0],x+W[0].length):-1}function F(a,m,x){var W=c.exec(m.slice(x,x+2));return W?(a.y=+W[0]+(+W[0]>68?1900:2e3),x+W[0].length):-1}function j(a,m,x){var W=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(m.slice(x,x+6));return W?(a.Z=W[1]?0:-(W[2]+(W[3]||"00")),x+W[0].length):-1}function ce(a,m,x){var W=c.exec(m.slice(x,x+1));return W?(a.q=W[0]*3-3,x+W[0].length):-1}function D(a,m,x){var W=c.exec(m.slice(x,x+2));return W?(a.m=W[0]-1,x+W[0].length):-1}function I(a,m,x){var W=c.exec(m.slice(x,x+2));return W?(a.d=+W[0],x+W[0].length):-1}function N(a,m,x){var W=c.exec(m.slice(x,x+3));return W?(a.m=0,a.d=+W[0],x+W[0].length):-1}function v(a,m,x){var W=c.exec(m.slice(x,x+2));return W?(a.H=+W[0],x+W[0].length):-1}function z(a,m,x){var W=c.exec(m.slice(x,x+2));return W?(a.M=+W[0],x+W[0].length):-1}function se(a,m,x){var W=c.exec(m.slice(x,x+2));return W?(a.S=+W[0],x+W[0].length):-1}function _(a,m,x){var W=c.exec(m.slice(x,x+3));return W?(a.L=+W[0],x+W[0].length):-1}function he(a,m,x){var W=c.exec(m.slice(x,x+6));return W?(a.L=Math.floor(W[0]/1e3),x+W[0].length):-1}function Te(a,m,x){var W=d.exec(m.slice(x,x+1));return W?x+W[0].length:-1}function ve(a,m,x){var W=c.exec(m.slice(x));return W?(a.Q=+W[0],x+W[0].length):-1}function st(a,m,x){var W=c.exec(m.slice(x));return W?(a.s=+W[0],x+W[0].length):-1}function J(a,m){return l(a.getDate(),m,2)}function we(a,m){return l(a.getHours(),m,2)}function Se(a,m){return l(a.getHours()%12||12,m,2)}function ue(a,m){return l(1+e.timeDay.count(e.timeYear(a),a),m,3)}function Ue(a,m){return l(a.getMilliseconds(),m,3)}function Pe(a,m){return Ue(a,m)+"000"}function Me(a,m){return l(a.getMonth()+1,m,2)}function Ne(a,m){return l(a.getMinutes(),m,2)}function Ce(a,m){return l(a.getSeconds(),m,2)}function Ve(a){var m=a.getDay();return m===0?7:m}function u(a,m){return l(e.timeSunday.count(e.timeYear(a)-1,a),m,2)}function S(a){var m=a.getDay();return m>=4||m===0?e.timeThursday(a):e.timeThursday.ceil(a)}function A(a,m){return a=S(a),l(e.timeThursday.count(e.timeYear(a),a)+(e.timeYear(a).getDay()===4),m,2)}function h(a){return a.getDay()}function p(a,m){return l(e.timeMonday.count(e.timeYear(a)-1,a),m,2)}function f(a,m){return l(a.getFullYear()%100,m,2)}function U(a,m){return a=S(a),l(a.getFullYear()%100,m,2)}function L(a,m){return l(a.getFullYear()%1e4,m,4)}function Y(a,m){var x=a.getDay();return a=x>=4||x===0?e.timeThursday(a):e.timeThursday.ceil(a),l(a.getFullYear()%1e4,m,4)}function le(a){var m=a.getTimezoneOffset();return(m>0?"-":(m*=-1,"+"))+l(m/60|0,"0",2)+l(m%60,"0",2)}function Re(a,m){return l(a.getUTCDate(),m,2)}function fe(a,m){return l(a.getUTCHours(),m,2)}function Z(a,m){return l(a.getUTCHours()%12||12,m,2)}function ge(a,m){return l(1+e.utcDay.count(e.utcYear(a),a),m,3)}function ne(a,m){return l(a.getUTCMilliseconds(),m,3)}function He(a,m){return ne(a,m)+"000"}function En(a,m){return l(a.getUTCMonth()+1,m,2)}function Tt(a,m){return l(a.getUTCMinutes(),m,2)}function Fn(a,m){return l(a.getUTCSeconds(),m,2)}function g(a){var m=a.getUTCDay();return m===0?7:m}function C(a,m){return l(e.utcSunday.count(e.utcYear(a)-1,a),m,2)}function ee(a){var m=a.getUTCDay();return m>=4||m===0?e.utcThursday(a):e.utcThursday.ceil(a)}function cs(a,m){return a=ee(a),l(e.utcThursday.count(e.utcYear(a),a)+(e.utcYear(a).getUTCDay()===4),m,2)}function ie(a){return a.getUTCDay()}function Q(a,m){return l(e.utcMonday.count(e.utcYear(a)-1,a),m,2)}function X(a,m){return l(a.getUTCFullYear()%100,m,2)}function Ae(a,m){return a=ee(a),l(a.getUTCFullYear()%100,m,2)}function wt(a,m){return l(a.getUTCFullYear()%1e4,m,4)}function us(a,m){var x=a.getUTCDay();return a=x>=4||x===0?e.utcThursday(a):e.utcThursday.ceil(a),l(a.getUTCFullYear()%1e4,m,4)}function Ri(){return"+0000"}function Sr(){return"%"}function Cr(a){return+a}function Rr(a){return Math.floor(+a/1e3)}var ft;Ar({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ar(a){return ft=i(a),n.timeFormat=ft.format,n.timeParse=ft.parse,n.utcFormat=ft.utcFormat,n.utcParse=ft.utcParse,ft}var yr="%Y-%m-%dT%H:%M:%S.%LZ";function Ai(a){return a.toISOString()}var yi=Date.prototype.toISOString?Ai:n.utcFormat(yr);function xi(a){var m=new Date(a);return isNaN(m)?null:m}var Wi=+new Date("2000-01-01T00:00:00.000Z")?xi:n.utcParse(yr);n.isoFormat=yi,n.isoParse=Wi,n.timeFormatDefaultLocale=Ar,n.timeFormatLocale=i,Object.defineProperty(n,"__esModule",{value:!0})})});var Xn=hs((Os,Kr)=>{(function(n,e){typeof Os=="object"&&typeof Kr<"u"?e(Os):typeof define=="function"&&define.amd?define(["exports"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.d3=n.d3||{}))})(Os,(function(n){"use strict";function e(D){return Math.abs(D=Math.round(D))>=1e21?D.toLocaleString("en").replace(/,/g,""):D.toString(10)}function t(D,I){if((N=(D=I?D.toExponential(I-1):D.toExponential()).indexOf("e"))<0)return null;var N,v=D.slice(0,N);return[v.length>1?v[0]+v.slice(2):v,+D.slice(N+1)]}function s(D){return D=t(Math.abs(D)),D?D[1]:NaN}function r(D,I){return function(N,v){for(var z=N.length,se=[],_=0,he=D[0],Te=0;z>0&&he>0&&(Te+he+1>v&&(he=Math.max(1,v-Te)),se.push(N.substring(z-=he,z+he)),!((Te+=he+1)>v));)he=D[_=(_+1)%D.length];return se.reverse().join(I)}}function i(D){return function(I){return I.replace(/[0-9]/g,function(N){return D[+N]})}}var o=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function c(D){if(!(I=o.exec(D)))throw new Error("invalid format: "+D);var I;return new d({fill:I[1],align:I[2],sign:I[3],symbol:I[4],zero:I[5],width:I[6],comma:I[7],precision:I[8]&&I[8].slice(1),trim:I[9],type:I[10]})}c.prototype=d.prototype;function d(D){this.fill=D.fill===void 0?" ":D.fill+"",this.align=D.align===void 0?">":D.align+"",this.sign=D.sign===void 0?"-":D.sign+"",this.symbol=D.symbol===void 0?"":D.symbol+"",this.zero=!!D.zero,this.width=D.width===void 0?void 0:+D.width,this.comma=!!D.comma,this.precision=D.precision===void 0?void 0:+D.precision,this.trim=!!D.trim,this.type=D.type===void 0?"":D.type+""}d.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function y(D){e:for(var I=D.length,N=1,v=-1,z;N<I;++N)switch(D[N]){case".":v=z=N;break;case"0":v===0&&(v=N),z=N;break;default:if(!+D[N])break e;v>0&&(v=0);break}return v>0?D.slice(0,v)+D.slice(z+1):D}var l;function E(D,I){var N=t(D,I);if(!N)return D+"";var v=N[0],z=N[1],se=z-(l=Math.max(-8,Math.min(8,Math.floor(z/3)))*3)+1,_=v.length;return se===_?v:se>_?v+new Array(se-_+1).join("0"):se>0?v.slice(0,se)+"."+v.slice(se):"0."+new Array(1-se).join("0")+t(D,Math.max(0,I+se-1))[0]}function R(D,I){var N=t(D,I);if(!N)return D+"";var v=N[0],z=N[1];return z<0?"0."+new Array(-z).join("0")+v:v.length>z+1?v.slice(0,z+1)+"."+v.slice(z+1):v+new Array(z-v.length+2).join("0")}var M={"%":function(D,I){return(D*100).toFixed(I)},b:function(D){return Math.round(D).toString(2)},c:function(D){return D+""},d:e,e:function(D,I){return D.toExponential(I)},f:function(D,I){return D.toFixed(I)},g:function(D,I){return D.toPrecision(I)},o:function(D){return Math.round(D).toString(8)},p:function(D,I){return R(D*100,I)},r:R,s:E,X:function(D){return Math.round(D).toString(16).toUpperCase()},x:function(D){return Math.round(D).toString(16)}};function w(D){return D}var V=Array.prototype.map,B=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function q(D){var I=D.grouping===void 0||D.thousands===void 0?w:r(V.call(D.grouping,Number),D.thousands+""),N=D.currency===void 0?"":D.currency[0]+"",v=D.currency===void 0?"":D.currency[1]+"",z=D.decimal===void 0?".":D.decimal+"",se=D.numerals===void 0?w:i(V.call(D.numerals,String)),_=D.percent===void 0?"%":D.percent+"",he=D.minus===void 0?"-":D.minus+"",Te=D.nan===void 0?"NaN":D.nan+"";function ve(J){J=c(J);var we=J.fill,Se=J.align,ue=J.sign,Ue=J.symbol,Pe=J.zero,Me=J.width,Ne=J.comma,Ce=J.precision,Ve=J.trim,u=J.type;u==="n"?(Ne=!0,u="g"):M[u]||(Ce===void 0&&(Ce=12),Ve=!0,u="g"),(Pe||we==="0"&&Se==="=")&&(Pe=!0,we="0",Se="=");var S=Ue==="$"?N:Ue==="#"&&/[boxX]/.test(u)?"0"+u.toLowerCase():"",A=Ue==="$"?v:/[%p]/.test(u)?_:"",h=M[u],p=/[defgprs%]/.test(u);Ce=Ce===void 0?6:/[gprs]/.test(u)?Math.max(1,Math.min(21,Ce)):Math.max(0,Math.min(20,Ce));function f(U){var L=S,Y=A,le,Re,fe;if(u==="c")Y=h(U)+Y,U="";else{U=+U;var Z=U<0||1/U<0;if(U=isNaN(U)?Te:h(Math.abs(U),Ce),Ve&&(U=y(U)),Z&&+U==0&&ue!=="+"&&(Z=!1),L=(Z?ue==="("?ue:he:ue==="-"||ue==="("?"":ue)+L,Y=(u==="s"?B[8+l/3]:"")+Y+(Z&&ue==="("?")":""),p){for(le=-1,Re=U.length;++le<Re;)if(fe=U.charCodeAt(le),48>fe||fe>57){Y=(fe===46?z+U.slice(le+1):U.slice(le))+Y,U=U.slice(0,le);break}}}Ne&&!Pe&&(U=I(U,1/0));var ge=L.length+U.length+Y.length,ne=ge<Me?new Array(Me-ge+1).join(we):"";switch(Ne&&Pe&&(U=I(ne+U,ne.length?Me-Y.length:1/0),ne=""),Se){case"<":U=L+U+Y+ne;break;case"=":U=L+ne+U+Y;break;case"^":U=ne.slice(0,ge=ne.length>>1)+L+U+Y+ne.slice(ge);break;default:U=ne+L+U+Y;break}return se(U)}return f.toString=function(){return J+""},f}function st(J,we){var Se=ve((J=c(J),J.type="f",J)),ue=Math.max(-8,Math.min(8,Math.floor(s(we)/3)))*3,Ue=Math.pow(10,-ue),Pe=B[8+ue/3];return function(Me){return Se(Ue*Me)+Pe}}return{format:ve,formatPrefix:st}}var k;P({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function P(D){return k=q(D),n.format=k.format,n.formatPrefix=k.formatPrefix,k}function F(D){return Math.max(0,-s(Math.abs(D)))}function j(D,I){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(s(I)/3)))*3-s(Math.abs(D)))}function ce(D,I){return D=Math.abs(D),I=Math.abs(I)-D,Math.max(0,s(I)-s(D))+1}n.FormatSpecifier=d,n.formatDefaultLocale=P,n.formatLocale=q,n.formatSpecifier=c,n.precisionFixed=F,n.precisionPrefix=j,n.precisionRound=ce,Object.defineProperty(n,"__esModule",{value:!0})}))});var Aa={};ao(Aa,{AccessService:()=>Pn,AccountService:()=>Mn,Activity:()=>ir,Attr:()=>hn,Attribute:()=>Je,BUILD_VERSION:()=>go,BaseScope:()=>Js,ClientTools:()=>Ft,CloudService:()=>Tn,CodesignService:()=>wn,Connection:()=>Ss,DFUArrayActions:()=>bo,DFUChangeProtection:()=>Eo,DFUChangeRestriction:()=>Fo,DFUDefFileFormat:()=>Uo,DFUService:()=>St,DFUWorkunit:()=>pr,DFUWorkunitCache:()=>mn,DFUXRefService:()=>Bn,DaliService:()=>Nn,Definition:()=>Dn,ECLGraph:()=>kt,ECLScope:()=>ht,ESPConnection:()=>Cs,ESPExceptions:()=>Ye,EclService:()=>Qt,EclccErrors:()=>as,ElkService:()=>Ln,EnvchkErrors:()=>xn,Errors:()=>os,Field:()=>fn,File:()=>Cn,FileSpray:()=>Dt,FileSprayService:()=>Xe,FileSprayStates:()=>Br,Folder:()=>Rn,GlobalResultCache:()=>zs,GraphCache:()=>vt,Import:()=>rs,LocalWorkunit:()=>bn,LogType:()=>vr,LogaccessService:()=>Gn,LogicalFile:()=>or,LogicalFileCache:()=>on,Machine:()=>$t,MachineCache:()=>an,MachineService:()=>Ge,PKG_NAME:()=>uo,PKG_VERSION:()=>lo,PackageProcessService:()=>kn,PropertyType:()=>ri,Query:()=>lr,QueryGraph:()=>ns,RelatedProperty:()=>ii,Resource:()=>jt,ResourcesService:()=>vn,Result:()=>zt,ResultCache:()=>Jt,SMCService:()=>Ct,SashaService:()=>Hn,Scope:()=>At,ScopeEdge:()=>er,ScopeGraph:()=>Vt,ScopeSubgraph:()=>Zn,ScopeVertex:()=>$n,Service:()=>G,Source:()=>Sn,SourceFile:()=>Kt,Store:()=>gr,StoreCache:()=>dn,StoreService:()=>Rt,TargetAudience:()=>Vr,TargetCluster:()=>ut,TargetClusterCache:()=>un,Timer:()=>Zt,Topology:()=>es,TopologyCache:()=>gn,TopologyService:()=>oe,ValueChangedMessage:()=>et,Version:()=>Et,WUStateID:()=>js,WUUpdate:()=>ze,Workspace:()=>An,Workunit:()=>ct,WorkunitCache:()=>tn,WorkunitsService:()=>re,WorkunitsServiceEx:()=>Gt,WsAccess:()=>In,WsCodesign:()=>bs,WsDfu:()=>at,WsLogaccess:()=>te,WsSMC:()=>On,WsSasha:()=>Vn,WsTopology:()=>_n,WsWorkunits:()=>de,XGMMLEdge:()=>Kn,XGMMLGraph:()=>_s,XGMMLSubgraph:()=>zn,XGMMLVertex:()=>Jn,XSDNode:()=>Ot,XSDSchema:()=>Xt,XSDSimpleType:()=>Yt,XSDXMLNode:()=>_t,attachWorkspace:()=>tt,clearAllClientToolsCache:()=>Ra,createConnection:()=>Nt,createGraph:()=>Ht,createXGMMLGraph:()=>tr,defaultTargetCluster:()=>ra,deserializeResponse:()=>Fr,get:()=>Tr,hookSend:()=>Do,instanceOfIConnection:()=>ho,instanceOfIOptions:()=>po,isArray:()=>Nr,isECLResult:()=>Yn,isExceptions:()=>Co,isWUInfoWorkunit:()=>vo,isWUQueryECLWorkunit:()=>ko,jsonp:()=>Ir,locateAllClientTools:()=>Si,locateClientTools:()=>hr,parseXSD:()=>Xs,parseXSD2:()=>Vo,post:()=>Mr,qualifiedIDBoundary:()=>Ca,send:()=>wr,serializeRequest:()=>_e,setTransportFactory:()=>So,splitMetric:()=>oi,targetClusters:()=>na,walkXmlJson:()=>Wn});module.exports=co(Aa);var Mt=require("@hpcc-js/util"),Ci=require("@xmldom/xmldom"),be=Ie(require("node:https"),1),Dr=require("node:buffer"),Un=require("undici");var Ur=`
1
+ "use strict";var so=Object.create;var ms=Object.defineProperty;var no=Object.getOwnPropertyDescriptor;var ro=Object.getOwnPropertyNames;var io=Object.getPrototypeOf,oo=Object.prototype.hasOwnProperty;var hs=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),ao=(n,e)=>{for(var t in e)ms(n,t,{get:e[t],enumerable:!0})},br=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ro(e))!oo.call(n,r)&&r!==t&&ms(n,r,{get:()=>e[r],enumerable:!(s=no(e,r))||s.enumerable});return n};var Pe=(n,e,t)=>(t=n!=null?so(io(n)):{},br(e||!n||!n.__esModule?ms(t,"default",{value:n,enumerable:!0}):t,n)),co=n=>br(ms({},"__esModule",{value:!0}),n);var Or=hs((Ts,jr)=>{(function(n,e){typeof Ts=="object"&&typeof jr<"u"?e(Ts):typeof define=="function"&&define.amd?define(["exports"],e):e(n.d3=n.d3||{})})(Ts,(function(n){"use strict";function e(u,D){return u<D?-1:u>D?1:u>=D?0:NaN}function t(u){return u.length===1&&(u=s(u)),{left:function(D,A,f,p){for(f==null&&(f=0),p==null&&(p=D.length);f<p;){var S=f+p>>>1;u(D[S],A)<0?f=S+1:p=S}return f},right:function(D,A,f,p){for(f==null&&(f=0),p==null&&(p=D.length);f<p;){var S=f+p>>>1;u(D[S],A)>0?p=S:f=S+1}return f}}}function s(u){return function(D,A){return e(u(D),A)}}var r=t(e),i=r.right,o=r.left;function c(u,D){D==null&&(D=d);for(var A=0,f=u.length-1,p=u[0],S=new Array(f<0?0:f);A<f;)S[A]=D(p,p=u[++A]);return S}function d(u,D){return[u,D]}function x(u,D,A){var f=u.length,p=D.length,S=new Array(f*p),U,G,q,ge;for(A==null&&(A=d),U=q=0;U<f;++U)for(ge=u[U],G=0;G<p;++G,++q)S[q]=A(ge,D[G]);return S}function l(u,D){return D<u?-1:D>u?1:D>=u?0:NaN}function E(u){return u===null?NaN:+u}function R(u,D){var A=u.length,f=0,p=-1,S=0,U,G,q=0;if(D==null)for(;++p<A;)isNaN(U=E(u[p]))||(G=U-S,S+=G/++f,q+=G*(U-S));else for(;++p<A;)isNaN(U=E(D(u[p],p,u)))||(G=U-S,S+=G/++f,q+=G*(U-S));if(f>1)return q/(f-1)}function I(u,D){var A=R(u,D);return A&&Math.sqrt(A)}function N(u,D){var A=u.length,f=-1,p,S,U;if(D==null){for(;++f<A;)if((p=u[f])!=null&&p>=p)for(S=U=p;++f<A;)(p=u[f])!=null&&(S>p&&(S=p),U<p&&(U=p))}else for(;++f<A;)if((p=D(u[f],f,u))!=null&&p>=p)for(S=U=p;++f<A;)(p=D(u[f],f,u))!=null&&(S>p&&(S=p),U<p&&(U=p));return[S,U]}var V=Array.prototype,j=V.slice,X=V.map;function w(u){return function(){return u}}function M(u){return u}function T(u,D,A){u=+u,D=+D,A=(p=arguments.length)<2?(D=u,u=0,1):p<3?1:+A;for(var f=-1,p=Math.max(0,Math.ceil((D-u)/A))|0,S=new Array(p);++f<p;)S[f]=u+f*A;return S}var ne=Math.sqrt(50),_=Math.sqrt(10),m=Math.sqrt(2);function F(u,D,A){var f,p=-1,S,U,G;if(D=+D,u=+u,A=+A,u===D&&A>0)return[u];if((f=D<u)&&(S=u,u=D,D=S),(G=L(u,D,A))===0||!isFinite(G))return[];if(G>0)for(u=Math.ceil(u/G),D=Math.floor(D/G),U=new Array(S=Math.ceil(D-u+1));++p<S;)U[p]=(u+p)*G;else for(u=Math.floor(u*G),D=Math.ceil(D*G),U=new Array(S=Math.ceil(u-D+1));++p<S;)U[p]=(u-p)/G;return f&&U.reverse(),U}function L(u,D,A){var f=(D-u)/Math.max(0,A),p=Math.floor(Math.log(f)/Math.LN10),S=f/Math.pow(10,p);return p>=0?(S>=ne?10:S>=_?5:S>=m?2:1)*Math.pow(10,p):-Math.pow(10,-p)/(S>=ne?10:S>=_?5:S>=m?2:1)}function v(u,D,A){var f=Math.abs(D-u)/Math.max(0,A),p=Math.pow(10,Math.floor(Math.log(f)/Math.LN10)),S=f/p;return S>=ne?p*=10:S>=_?p*=5:S>=m&&(p*=2),D<u?-p:p}function Q(u){return Math.ceil(Math.log(u.length)/Math.LN2)+1}function se(){var u=M,D=N,A=Q;function f(p){var S,U=p.length,G,q=new Array(U);for(S=0;S<U;++S)q[S]=u(p[S],S,p);var ge=D(q),Ae=ge[0],Se=ge[1],Z=A(q,Ae,Se);Array.isArray(Z)||(Z=v(Ae,Se,Z),Z=T(Math.ceil(Ae/Z)*Z,Se,Z));for(var pe=Z.length;Z[0]<=Ae;)Z.shift(),--pe;for(;Z[pe-1]>Se;)Z.pop(),--pe;var re=new Array(pe+1),He;for(S=0;S<=pe;++S)He=re[S]=[],He.x0=S>0?Z[S-1]:Ae,He.x1=S<pe?Z[S]:Se;for(S=0;S<U;++S)G=q[S],Ae<=G&&G<=Se&&re[i(Z,G,0,pe)].push(p[S]);return re}return f.value=function(p){return arguments.length?(u=typeof p=="function"?p:w(p),f):u},f.domain=function(p){return arguments.length?(D=typeof p=="function"?p:w([p[0],p[1]]),f):D},f.thresholds=function(p){return arguments.length?(A=typeof p=="function"?p:Array.isArray(p)?w(j.call(p)):w(p),f):A},f}function oe(u,D,A){if(A==null&&(A=E),!!(f=u.length)){if((D=+D)<=0||f<2)return+A(u[0],0,u);if(D>=1)return+A(u[f-1],f-1,u);var f,p=(f-1)*D,S=Math.floor(p),U=+A(u[S],S,u),G=+A(u[S+1],S+1,u);return U+(G-U)*(p-S)}}function fe(u,D,A){return u=X.call(u,E).sort(e),Math.ceil((A-D)/(2*(oe(u,.75)-oe(u,.25))*Math.pow(u.length,-1/3)))}function H(u,D,A){return Math.ceil((A-D)/(3.5*I(u)*Math.pow(u.length,-1/3)))}function ve(u,D){var A=u.length,f=-1,p,S;if(D==null){for(;++f<A;)if((p=u[f])!=null&&p>=p)for(S=p;++f<A;)(p=u[f])!=null&&p>S&&(S=p)}else for(;++f<A;)if((p=D(u[f],f,u))!=null&&p>=p)for(S=p;++f<A;)(p=D(u[f],f,u))!=null&&p>S&&(S=p);return S}function st(u,D){var A=u.length,f=A,p=-1,S,U=0;if(D==null)for(;++p<A;)isNaN(S=E(u[p]))?--f:U+=S;else for(;++p<A;)isNaN(S=E(D(u[p],p,u)))?--f:U+=S;if(f)return U/f}function J(u,D){var A=u.length,f=-1,p,S=[];if(D==null)for(;++f<A;)isNaN(p=E(u[f]))||S.push(p);else for(;++f<A;)isNaN(p=E(D(u[f],f,u)))||S.push(p);return oe(S.sort(e),.5)}function we(u){for(var D=u.length,A,f=-1,p=0,S,U;++f<D;)p+=u[f].length;for(S=new Array(p);--D>=0;)for(U=u[D],A=U.length;--A>=0;)S[--p]=U[A];return S}function Ce(u,D){var A=u.length,f=-1,p,S;if(D==null){for(;++f<A;)if((p=u[f])!=null&&p>=p)for(S=p;++f<A;)(p=u[f])!=null&&S>p&&(S=p)}else for(;++f<A;)if((p=D(u[f],f,u))!=null&&p>=p)for(S=p;++f<A;)(p=D(u[f],f,u))!=null&&S>p&&(S=p);return S}function le(u,D){for(var A=D.length,f=new Array(A);A--;)f[A]=u[D[A]];return f}function Ee(u,D){if(A=u.length){var A,f=0,p=0,S,U=u[p];for(D==null&&(D=e);++f<A;)(D(S=u[f],U)<0||D(U,U)!==0)&&(U=S,p=f);if(D(U,U)===0)return p}}function Me(u,D,A){for(var f=(A??u.length)-(D=D==null?0:+D),p,S;f;)S=Math.random()*f--|0,p=u[f+D],u[f+D]=u[S+D],u[S+D]=p;return u}function Te(u,D){var A=u.length,f=-1,p,S=0;if(D==null)for(;++f<A;)(p=+u[f])&&(S+=p);else for(;++f<A;)(p=+D(u[f],f,u))&&(S+=p);return S}function Ne(u){if(!(S=u.length))return[];for(var D=-1,A=Ce(u,Re),f=new Array(A);++D<A;)for(var p=-1,S,U=f[D]=new Array(S);++p<S;)U[p]=u[p][D];return f}function Re(u){return u.length}function Ve(){return Ne(arguments)}n.bisect=i,n.bisectRight=i,n.bisectLeft=o,n.ascending=e,n.bisector=t,n.cross=x,n.descending=l,n.deviation=I,n.extent=N,n.histogram=se,n.thresholdFreedmanDiaconis=fe,n.thresholdScott=H,n.thresholdSturges=Q,n.max=ve,n.mean=st,n.median=J,n.merge=we,n.min=Ce,n.pairs=c,n.permute=le,n.quantile=oe,n.range=T,n.scan=Ee,n.shuffle=Me,n.sum=Te,n.ticks=F,n.tickIncrement=L,n.tickStep=v,n.transpose=Ne,n.variance=R,n.zip=Ve,Object.defineProperty(n,"__esModule",{value:!0})}))});var Xr=hs((Ls,Yr)=>{(function(n,e){typeof Ls=="object"&&typeof Yr<"u"?e(Ls):typeof define=="function"&&define.amd?define(["exports"],e):(n=n||self,e(n.d3=n.d3||{}))})(Ls,function(n){"use strict";var e=new Date,t=new Date;function s(g,C,ee,cs){function ae(B){return g(B=arguments.length===0?new Date:new Date(+B)),B}return ae.floor=function(B){return g(B=new Date(+B)),B},ae.ceil=function(B){return g(B=new Date(B-1)),C(B,1),g(B),B},ae.round=function(B){var z=ae(B),xe=ae.ceil(B);return B-z<xe-B?z:xe},ae.offset=function(B,z){return C(B=new Date(+B),z==null?1:Math.floor(z)),B},ae.range=function(B,z,xe){var wt=[],us;if(B=ae.ceil(B),xe=xe==null?1:Math.floor(xe),!(B<z)||!(xe>0))return wt;do wt.push(us=new Date(+B)),C(B,xe),g(B);while(us<B&&B<z);return wt},ae.filter=function(B){return s(function(z){if(z>=z)for(;g(z),!B(z);)z.setTime(z-1)},function(z,xe){if(z>=z)if(xe<0)for(;++xe<=0;)for(;C(z,-1),!B(z););else for(;--xe>=0;)for(;C(z,1),!B(z););})},ee&&(ae.count=function(B,z){return e.setTime(+B),t.setTime(+z),g(e),g(t),Math.floor(ee(e,t))},ae.every=function(B){return B=Math.floor(B),!isFinite(B)||!(B>0)?null:B>1?ae.filter(cs?function(z){return cs(z)%B===0}:function(z){return ae.count(0,z)%B===0}):ae}),ae}var r=s(function(){},function(g,C){g.setTime(+g+C)},function(g,C){return C-g});r.every=function(g){return g=Math.floor(g),!isFinite(g)||!(g>0)?null:g>1?s(function(C){C.setTime(Math.floor(C/g)*g)},function(C,ee){C.setTime(+C+ee*g)},function(C,ee){return(ee-C)/g}):r};var i=r.range,o=1e3,c=6e4,d=36e5,x=864e5,l=6048e5,E=s(function(g){g.setTime(g-g.getMilliseconds())},function(g,C){g.setTime(+g+C*o)},function(g,C){return(C-g)/o},function(g){return g.getUTCSeconds()}),R=E.range,I=s(function(g){g.setTime(g-g.getMilliseconds()-g.getSeconds()*o)},function(g,C){g.setTime(+g+C*c)},function(g,C){return(C-g)/c},function(g){return g.getMinutes()}),N=I.range,V=s(function(g){g.setTime(g-g.getMilliseconds()-g.getSeconds()*o-g.getMinutes()*c)},function(g,C){g.setTime(+g+C*d)},function(g,C){return(C-g)/d},function(g){return g.getHours()}),j=V.range,X=s(function(g){g.setHours(0,0,0,0)},function(g,C){g.setDate(g.getDate()+C)},function(g,C){return(C-g-(C.getTimezoneOffset()-g.getTimezoneOffset())*c)/x},function(g){return g.getDate()-1}),w=X.range;function M(g){return s(function(C){C.setDate(C.getDate()-(C.getDay()+7-g)%7),C.setHours(0,0,0,0)},function(C,ee){C.setDate(C.getDate()+ee*7)},function(C,ee){return(ee-C-(ee.getTimezoneOffset()-C.getTimezoneOffset())*c)/l})}var T=M(0),ne=M(1),_=M(2),m=M(3),F=M(4),L=M(5),v=M(6),Q=T.range,se=ne.range,oe=_.range,fe=m.range,H=F.range,ve=L.range,st=v.range,J=s(function(g){g.setDate(1),g.setHours(0,0,0,0)},function(g,C){g.setMonth(g.getMonth()+C)},function(g,C){return C.getMonth()-g.getMonth()+(C.getFullYear()-g.getFullYear())*12},function(g){return g.getMonth()}),we=J.range,Ce=s(function(g){g.setMonth(0,1),g.setHours(0,0,0,0)},function(g,C){g.setFullYear(g.getFullYear()+C)},function(g,C){return C.getFullYear()-g.getFullYear()},function(g){return g.getFullYear()});Ce.every=function(g){return!isFinite(g=Math.floor(g))||!(g>0)?null:s(function(C){C.setFullYear(Math.floor(C.getFullYear()/g)*g),C.setMonth(0,1),C.setHours(0,0,0,0)},function(C,ee){C.setFullYear(C.getFullYear()+ee*g)})};var le=Ce.range,Ee=s(function(g){g.setUTCSeconds(0,0)},function(g,C){g.setTime(+g+C*c)},function(g,C){return(C-g)/c},function(g){return g.getUTCMinutes()}),Me=Ee.range,Te=s(function(g){g.setUTCMinutes(0,0,0)},function(g,C){g.setTime(+g+C*d)},function(g,C){return(C-g)/d},function(g){return g.getUTCHours()}),Ne=Te.range,Re=s(function(g){g.setUTCHours(0,0,0,0)},function(g,C){g.setUTCDate(g.getUTCDate()+C)},function(g,C){return(C-g)/x},function(g){return g.getUTCDate()-1}),Ve=Re.range;function u(g){return s(function(C){C.setUTCDate(C.getUTCDate()-(C.getUTCDay()+7-g)%7),C.setUTCHours(0,0,0,0)},function(C,ee){C.setUTCDate(C.getUTCDate()+ee*7)},function(C,ee){return(ee-C)/l})}var D=u(0),A=u(1),f=u(2),p=u(3),S=u(4),U=u(5),G=u(6),q=D.range,ge=A.range,Ae=f.range,Se=p.range,Z=S.range,pe=U.range,re=G.range,He=s(function(g){g.setUTCDate(1),g.setUTCHours(0,0,0,0)},function(g,C){g.setUTCMonth(g.getUTCMonth()+C)},function(g,C){return C.getUTCMonth()-g.getUTCMonth()+(C.getUTCFullYear()-g.getUTCFullYear())*12},function(g){return g.getUTCMonth()}),En=He.range,Tt=s(function(g){g.setUTCMonth(0,1),g.setUTCHours(0,0,0,0)},function(g,C){g.setUTCFullYear(g.getUTCFullYear()+C)},function(g,C){return C.getUTCFullYear()-g.getUTCFullYear()},function(g){return g.getUTCFullYear()});Tt.every=function(g){return!isFinite(g=Math.floor(g))||!(g>0)?null:s(function(C){C.setUTCFullYear(Math.floor(C.getUTCFullYear()/g)*g),C.setUTCMonth(0,1),C.setUTCHours(0,0,0,0)},function(C,ee){C.setUTCFullYear(C.getUTCFullYear()+ee*g)})};var Fn=Tt.range;n.timeDay=X,n.timeDays=w,n.timeFriday=L,n.timeFridays=ve,n.timeHour=V,n.timeHours=j,n.timeInterval=s,n.timeMillisecond=r,n.timeMilliseconds=i,n.timeMinute=I,n.timeMinutes=N,n.timeMonday=ne,n.timeMondays=se,n.timeMonth=J,n.timeMonths=we,n.timeSaturday=v,n.timeSaturdays=st,n.timeSecond=E,n.timeSeconds=R,n.timeSunday=T,n.timeSundays=Q,n.timeThursday=F,n.timeThursdays=H,n.timeTuesday=_,n.timeTuesdays=oe,n.timeWednesday=m,n.timeWednesdays=fe,n.timeWeek=T,n.timeWeeks=Q,n.timeYear=Ce,n.timeYears=le,n.utcDay=Re,n.utcDays=Ve,n.utcFriday=U,n.utcFridays=pe,n.utcHour=Te,n.utcHours=Ne,n.utcMillisecond=r,n.utcMilliseconds=i,n.utcMinute=Ee,n.utcMinutes=Me,n.utcMonday=A,n.utcMondays=ge,n.utcMonth=He,n.utcMonths=En,n.utcSaturday=G,n.utcSaturdays=re,n.utcSecond=E,n.utcSeconds=R,n.utcSunday=D,n.utcSundays=q,n.utcThursday=S,n.utcThursdays=Z,n.utcTuesday=f,n.utcTuesdays=Ae,n.utcWednesday=p,n.utcWednesdays=Se,n.utcWeek=D,n.utcWeeks=q,n.utcYear=Tt,n.utcYears=Fn,Object.defineProperty(n,"__esModule",{value:!0})})});var jn=hs((Gs,qr)=>{(function(n,e){typeof Gs=="object"&&typeof qr<"u"?e(Gs,Xr()):typeof define=="function"&&define.amd?define(["exports","d3-time"],e):(n=n||self,e(n.d3=n.d3||{},n.d3))})(Gs,function(n,e){"use strict";function t(a){if(0<=a.y&&a.y<100){var h=new Date(-1,a.m,a.d,a.H,a.M,a.S,a.L);return h.setFullYear(a.y),h}return new Date(a.y,a.m,a.d,a.H,a.M,a.S,a.L)}function s(a){if(0<=a.y&&a.y<100){var h=new Date(Date.UTC(-1,a.m,a.d,a.H,a.M,a.S,a.L));return h.setUTCFullYear(a.y),h}return new Date(Date.UTC(a.y,a.m,a.d,a.H,a.M,a.S,a.L))}function r(a,h,y){return{y:a,m:h,d:y,H:0,M:0,S:0,L:0}}function i(a){var h=a.dateTime,y=a.date,W=a.time,je=a.periods,nt=a.days,ls=a.shortDays,gs=a.months,ps=a.shortMonths,bi=R(je),Ui=I(je),Ei=R(nt),Fi=I(nt),Ii=R(ls),Pi=I(ls),Mi=R(gs),Ti=I(gs),wi=R(ps),Ni=I(ps),rt={a:Oi,A:_i,b:Yi,B:Xi,c:null,d:J,e:J,f:Me,g:U,G:q,H:we,I:Ce,j:le,L:Ee,m:Te,M:Ne,p:qi,q:zi,Q:Cr,s:Rr,S:Re,u:Ve,U:u,V:A,w:f,W:p,x:null,X:null,y:S,Y:G,Z:ge,"%":Dr},it={a:Ji,A:Ki,b:Zi,B:$i,c:null,d:Ae,e:Ae,f:He,g:xe,G:us,H:Se,I:Z,j:pe,L:re,m:En,M:Tt,p:eo,q:to,Q:Cr,s:Rr,S:Fn,u:g,U:C,V:cs,w:ae,W:B,x:null,X:null,y:z,Y:wt,Z:Ri,"%":Dr},Bi={a:Li,A:Gi,b:ki,B:vi,c:Vi,d:F,e:F,f:fe,g:T,G:M,H:v,I:v,j:L,L:oe,m,M:Q,p:Qi,q:_,Q:ve,s:st,S:se,u:V,U:j,V:X,w:N,W:w,x:Hi,X:ji,y:T,Y:M,Z:ne,"%":H};rt.x=Oe(y,rt),rt.X=Oe(W,rt),rt.c=Oe(h,rt),it.x=Oe(y,it),it.X=Oe(W,it),it.c=Oe(h,it);function Oe(P,O){return function(Y){var b=[],ye=-1,K=0,Fe=P.length,Ie,ot,Wr;for(Y instanceof Date||(Y=new Date(+Y));++ye<Fe;)P.charCodeAt(ye)===37&&(b.push(P.slice(K,ye)),(ot=o[Ie=P.charAt(++ye)])!=null?Ie=P.charAt(++ye):ot=Ie==="e"?" ":"0",(Wr=O[Ie])&&(Ie=Wr(Y,ot)),b.push(Ie),K=ye+1);return b.push(P.slice(K,ye)),b.join("")}}function yr(P,O){return function(Y){var b=r(1900,void 0,1),ye=ds(b,P,Y+="",0),K,Fe;if(ye!=Y.length)return null;if("Q"in b)return new Date(b.Q);if("s"in b)return new Date(b.s*1e3+("L"in b?b.L:0));if(O&&!("Z"in b)&&(b.Z=0),"p"in b&&(b.H=b.H%12+b.p*12),b.m===void 0&&(b.m="q"in b?b.q:0),"V"in b){if(b.V<1||b.V>53)return null;"w"in b||(b.w=1),"Z"in b?(K=s(r(b.y,0,1)),Fe=K.getUTCDay(),K=Fe>4||Fe===0?e.utcMonday.ceil(K):e.utcMonday(K),K=e.utcDay.offset(K,(b.V-1)*7),b.y=K.getUTCFullYear(),b.m=K.getUTCMonth(),b.d=K.getUTCDate()+(b.w+6)%7):(K=t(r(b.y,0,1)),Fe=K.getDay(),K=Fe>4||Fe===0?e.timeMonday.ceil(K):e.timeMonday(K),K=e.timeDay.offset(K,(b.V-1)*7),b.y=K.getFullYear(),b.m=K.getMonth(),b.d=K.getDate()+(b.w+6)%7)}else("W"in b||"U"in b)&&("w"in b||(b.w="u"in b?b.u%7:"W"in b?1:0),Fe="Z"in b?s(r(b.y,0,1)).getUTCDay():t(r(b.y,0,1)).getDay(),b.m=0,b.d="W"in b?(b.w+6)%7+b.W*7-(Fe+5)%7:b.w+b.U*7-(Fe+6)%7);return"Z"in b?(b.H+=b.Z/100|0,b.M+=b.Z%100,s(b)):t(b)}}function ds(P,O,Y,b){for(var ye=0,K=O.length,Fe=Y.length,Ie,ot;ye<K;){if(b>=Fe)return-1;if(Ie=O.charCodeAt(ye++),Ie===37){if(Ie=O.charAt(ye++),ot=Bi[Ie in o?O.charAt(ye++):Ie],!ot||(b=ot(P,Y,b))<0)return-1}else if(Ie!=Y.charCodeAt(b++))return-1}return b}function Qi(P,O,Y){var b=bi.exec(O.slice(Y));return b?(P.p=Ui[b[0].toLowerCase()],Y+b[0].length):-1}function Li(P,O,Y){var b=Ii.exec(O.slice(Y));return b?(P.w=Pi[b[0].toLowerCase()],Y+b[0].length):-1}function Gi(P,O,Y){var b=Ei.exec(O.slice(Y));return b?(P.w=Fi[b[0].toLowerCase()],Y+b[0].length):-1}function ki(P,O,Y){var b=wi.exec(O.slice(Y));return b?(P.m=Ni[b[0].toLowerCase()],Y+b[0].length):-1}function vi(P,O,Y){var b=Mi.exec(O.slice(Y));return b?(P.m=Ti[b[0].toLowerCase()],Y+b[0].length):-1}function Vi(P,O,Y){return ds(P,h,O,Y)}function Hi(P,O,Y){return ds(P,y,O,Y)}function ji(P,O,Y){return ds(P,W,O,Y)}function Oi(P){return ls[P.getDay()]}function _i(P){return nt[P.getDay()]}function Yi(P){return ps[P.getMonth()]}function Xi(P){return gs[P.getMonth()]}function qi(P){return je[+(P.getHours()>=12)]}function zi(P){return 1+~~(P.getMonth()/3)}function Ji(P){return ls[P.getUTCDay()]}function Ki(P){return nt[P.getUTCDay()]}function Zi(P){return ps[P.getUTCMonth()]}function $i(P){return gs[P.getUTCMonth()]}function eo(P){return je[+(P.getUTCHours()>=12)]}function to(P){return 1+~~(P.getUTCMonth()/3)}return{format:function(P){var O=Oe(P+="",rt);return O.toString=function(){return P},O},parse:function(P){var O=yr(P+="",!1);return O.toString=function(){return P},O},utcFormat:function(P){var O=Oe(P+="",it);return O.toString=function(){return P},O},utcParse:function(P){var O=yr(P+="",!0);return O.toString=function(){return P},O}}}var o={"-":"",_:" ",0:"0"},c=/^\s*\d+/,d=/^%/,x=/[\\^$*+?|[\]().{}]/g;function l(a,h,y){var W=a<0?"-":"",je=(W?-a:a)+"",nt=je.length;return W+(nt<y?new Array(y-nt+1).join(h)+je:je)}function E(a){return a.replace(x,"\\$&")}function R(a){return new RegExp("^(?:"+a.map(E).join("|")+")","i")}function I(a){for(var h={},y=-1,W=a.length;++y<W;)h[a[y].toLowerCase()]=y;return h}function N(a,h,y){var W=c.exec(h.slice(y,y+1));return W?(a.w=+W[0],y+W[0].length):-1}function V(a,h,y){var W=c.exec(h.slice(y,y+1));return W?(a.u=+W[0],y+W[0].length):-1}function j(a,h,y){var W=c.exec(h.slice(y,y+2));return W?(a.U=+W[0],y+W[0].length):-1}function X(a,h,y){var W=c.exec(h.slice(y,y+2));return W?(a.V=+W[0],y+W[0].length):-1}function w(a,h,y){var W=c.exec(h.slice(y,y+2));return W?(a.W=+W[0],y+W[0].length):-1}function M(a,h,y){var W=c.exec(h.slice(y,y+4));return W?(a.y=+W[0],y+W[0].length):-1}function T(a,h,y){var W=c.exec(h.slice(y,y+2));return W?(a.y=+W[0]+(+W[0]>68?1900:2e3),y+W[0].length):-1}function ne(a,h,y){var W=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(h.slice(y,y+6));return W?(a.Z=W[1]?0:-(W[2]+(W[3]||"00")),y+W[0].length):-1}function _(a,h,y){var W=c.exec(h.slice(y,y+1));return W?(a.q=W[0]*3-3,y+W[0].length):-1}function m(a,h,y){var W=c.exec(h.slice(y,y+2));return W?(a.m=W[0]-1,y+W[0].length):-1}function F(a,h,y){var W=c.exec(h.slice(y,y+2));return W?(a.d=+W[0],y+W[0].length):-1}function L(a,h,y){var W=c.exec(h.slice(y,y+3));return W?(a.m=0,a.d=+W[0],y+W[0].length):-1}function v(a,h,y){var W=c.exec(h.slice(y,y+2));return W?(a.H=+W[0],y+W[0].length):-1}function Q(a,h,y){var W=c.exec(h.slice(y,y+2));return W?(a.M=+W[0],y+W[0].length):-1}function se(a,h,y){var W=c.exec(h.slice(y,y+2));return W?(a.S=+W[0],y+W[0].length):-1}function oe(a,h,y){var W=c.exec(h.slice(y,y+3));return W?(a.L=+W[0],y+W[0].length):-1}function fe(a,h,y){var W=c.exec(h.slice(y,y+6));return W?(a.L=Math.floor(W[0]/1e3),y+W[0].length):-1}function H(a,h,y){var W=d.exec(h.slice(y,y+1));return W?y+W[0].length:-1}function ve(a,h,y){var W=c.exec(h.slice(y));return W?(a.Q=+W[0],y+W[0].length):-1}function st(a,h,y){var W=c.exec(h.slice(y));return W?(a.s=+W[0],y+W[0].length):-1}function J(a,h){return l(a.getDate(),h,2)}function we(a,h){return l(a.getHours(),h,2)}function Ce(a,h){return l(a.getHours()%12||12,h,2)}function le(a,h){return l(1+e.timeDay.count(e.timeYear(a),a),h,3)}function Ee(a,h){return l(a.getMilliseconds(),h,3)}function Me(a,h){return Ee(a,h)+"000"}function Te(a,h){return l(a.getMonth()+1,h,2)}function Ne(a,h){return l(a.getMinutes(),h,2)}function Re(a,h){return l(a.getSeconds(),h,2)}function Ve(a){var h=a.getDay();return h===0?7:h}function u(a,h){return l(e.timeSunday.count(e.timeYear(a)-1,a),h,2)}function D(a){var h=a.getDay();return h>=4||h===0?e.timeThursday(a):e.timeThursday.ceil(a)}function A(a,h){return a=D(a),l(e.timeThursday.count(e.timeYear(a),a)+(e.timeYear(a).getDay()===4),h,2)}function f(a){return a.getDay()}function p(a,h){return l(e.timeMonday.count(e.timeYear(a)-1,a),h,2)}function S(a,h){return l(a.getFullYear()%100,h,2)}function U(a,h){return a=D(a),l(a.getFullYear()%100,h,2)}function G(a,h){return l(a.getFullYear()%1e4,h,4)}function q(a,h){var y=a.getDay();return a=y>=4||y===0?e.timeThursday(a):e.timeThursday.ceil(a),l(a.getFullYear()%1e4,h,4)}function ge(a){var h=a.getTimezoneOffset();return(h>0?"-":(h*=-1,"+"))+l(h/60|0,"0",2)+l(h%60,"0",2)}function Ae(a,h){return l(a.getUTCDate(),h,2)}function Se(a,h){return l(a.getUTCHours(),h,2)}function Z(a,h){return l(a.getUTCHours()%12||12,h,2)}function pe(a,h){return l(1+e.utcDay.count(e.utcYear(a),a),h,3)}function re(a,h){return l(a.getUTCMilliseconds(),h,3)}function He(a,h){return re(a,h)+"000"}function En(a,h){return l(a.getUTCMonth()+1,h,2)}function Tt(a,h){return l(a.getUTCMinutes(),h,2)}function Fn(a,h){return l(a.getUTCSeconds(),h,2)}function g(a){var h=a.getUTCDay();return h===0?7:h}function C(a,h){return l(e.utcSunday.count(e.utcYear(a)-1,a),h,2)}function ee(a){var h=a.getUTCDay();return h>=4||h===0?e.utcThursday(a):e.utcThursday.ceil(a)}function cs(a,h){return a=ee(a),l(e.utcThursday.count(e.utcYear(a),a)+(e.utcYear(a).getUTCDay()===4),h,2)}function ae(a){return a.getUTCDay()}function B(a,h){return l(e.utcMonday.count(e.utcYear(a)-1,a),h,2)}function z(a,h){return l(a.getUTCFullYear()%100,h,2)}function xe(a,h){return a=ee(a),l(a.getUTCFullYear()%100,h,2)}function wt(a,h){return l(a.getUTCFullYear()%1e4,h,4)}function us(a,h){var y=a.getUTCDay();return a=y>=4||y===0?e.utcThursday(a):e.utcThursday.ceil(a),l(a.getUTCFullYear()%1e4,h,4)}function Ri(){return"+0000"}function Dr(){return"%"}function Cr(a){return+a}function Rr(a){return Math.floor(+a/1e3)}var ft;Ar({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ar(a){return ft=i(a),n.timeFormat=ft.format,n.timeParse=ft.parse,n.utcFormat=ft.utcFormat,n.utcParse=ft.utcParse,ft}var xr="%Y-%m-%dT%H:%M:%S.%LZ";function Ai(a){return a.toISOString()}var xi=Date.prototype.toISOString?Ai:n.utcFormat(xr);function yi(a){var h=new Date(a);return isNaN(h)?null:h}var Wi=+new Date("2000-01-01T00:00:00.000Z")?yi:n.utcParse(xr);n.isoFormat=xi,n.isoParse=Wi,n.timeFormatDefaultLocale=Ar,n.timeFormatLocale=i,Object.defineProperty(n,"__esModule",{value:!0})})});var Xn=hs((Os,Kr)=>{(function(n,e){typeof Os=="object"&&typeof Kr<"u"?e(Os):typeof define=="function"&&define.amd?define(["exports"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.d3=n.d3||{}))})(Os,(function(n){"use strict";function e(m){return Math.abs(m=Math.round(m))>=1e21?m.toLocaleString("en").replace(/,/g,""):m.toString(10)}function t(m,F){if((L=(m=F?m.toExponential(F-1):m.toExponential()).indexOf("e"))<0)return null;var L,v=m.slice(0,L);return[v.length>1?v[0]+v.slice(2):v,+m.slice(L+1)]}function s(m){return m=t(Math.abs(m)),m?m[1]:NaN}function r(m,F){return function(L,v){for(var Q=L.length,se=[],oe=0,fe=m[0],H=0;Q>0&&fe>0&&(H+fe+1>v&&(fe=Math.max(1,v-H)),se.push(L.substring(Q-=fe,Q+fe)),!((H+=fe+1)>v));)fe=m[oe=(oe+1)%m.length];return se.reverse().join(F)}}function i(m){return function(F){return F.replace(/[0-9]/g,function(L){return m[+L]})}}var o=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function c(m){if(!(F=o.exec(m)))throw new Error("invalid format: "+m);var F;return new d({fill:F[1],align:F[2],sign:F[3],symbol:F[4],zero:F[5],width:F[6],comma:F[7],precision:F[8]&&F[8].slice(1),trim:F[9],type:F[10]})}c.prototype=d.prototype;function d(m){this.fill=m.fill===void 0?" ":m.fill+"",this.align=m.align===void 0?">":m.align+"",this.sign=m.sign===void 0?"-":m.sign+"",this.symbol=m.symbol===void 0?"":m.symbol+"",this.zero=!!m.zero,this.width=m.width===void 0?void 0:+m.width,this.comma=!!m.comma,this.precision=m.precision===void 0?void 0:+m.precision,this.trim=!!m.trim,this.type=m.type===void 0?"":m.type+""}d.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function x(m){e:for(var F=m.length,L=1,v=-1,Q;L<F;++L)switch(m[L]){case".":v=Q=L;break;case"0":v===0&&(v=L),Q=L;break;default:if(!+m[L])break e;v>0&&(v=0);break}return v>0?m.slice(0,v)+m.slice(Q+1):m}var l;function E(m,F){var L=t(m,F);if(!L)return m+"";var v=L[0],Q=L[1],se=Q-(l=Math.max(-8,Math.min(8,Math.floor(Q/3)))*3)+1,oe=v.length;return se===oe?v:se>oe?v+new Array(se-oe+1).join("0"):se>0?v.slice(0,se)+"."+v.slice(se):"0."+new Array(1-se).join("0")+t(m,Math.max(0,F+se-1))[0]}function R(m,F){var L=t(m,F);if(!L)return m+"";var v=L[0],Q=L[1];return Q<0?"0."+new Array(-Q).join("0")+v:v.length>Q+1?v.slice(0,Q+1)+"."+v.slice(Q+1):v+new Array(Q-v.length+2).join("0")}var I={"%":function(m,F){return(m*100).toFixed(F)},b:function(m){return Math.round(m).toString(2)},c:function(m){return m+""},d:e,e:function(m,F){return m.toExponential(F)},f:function(m,F){return m.toFixed(F)},g:function(m,F){return m.toPrecision(F)},o:function(m){return Math.round(m).toString(8)},p:function(m,F){return R(m*100,F)},r:R,s:E,X:function(m){return Math.round(m).toString(16).toUpperCase()},x:function(m){return Math.round(m).toString(16)}};function N(m){return m}var V=Array.prototype.map,j=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function X(m){var F=m.grouping===void 0||m.thousands===void 0?N:r(V.call(m.grouping,Number),m.thousands+""),L=m.currency===void 0?"":m.currency[0]+"",v=m.currency===void 0?"":m.currency[1]+"",Q=m.decimal===void 0?".":m.decimal+"",se=m.numerals===void 0?N:i(V.call(m.numerals,String)),oe=m.percent===void 0?"%":m.percent+"",fe=m.minus===void 0?"-":m.minus+"",H=m.nan===void 0?"NaN":m.nan+"";function ve(J){J=c(J);var we=J.fill,Ce=J.align,le=J.sign,Ee=J.symbol,Me=J.zero,Te=J.width,Ne=J.comma,Re=J.precision,Ve=J.trim,u=J.type;u==="n"?(Ne=!0,u="g"):I[u]||(Re===void 0&&(Re=12),Ve=!0,u="g"),(Me||we==="0"&&Ce==="=")&&(Me=!0,we="0",Ce="=");var D=Ee==="$"?L:Ee==="#"&&/[boxX]/.test(u)?"0"+u.toLowerCase():"",A=Ee==="$"?v:/[%p]/.test(u)?oe:"",f=I[u],p=/[defgprs%]/.test(u);Re=Re===void 0?6:/[gprs]/.test(u)?Math.max(1,Math.min(21,Re)):Math.max(0,Math.min(20,Re));function S(U){var G=D,q=A,ge,Ae,Se;if(u==="c")q=f(U)+q,U="";else{U=+U;var Z=U<0||1/U<0;if(U=isNaN(U)?H:f(Math.abs(U),Re),Ve&&(U=x(U)),Z&&+U==0&&le!=="+"&&(Z=!1),G=(Z?le==="("?le:fe:le==="-"||le==="("?"":le)+G,q=(u==="s"?j[8+l/3]:"")+q+(Z&&le==="("?")":""),p){for(ge=-1,Ae=U.length;++ge<Ae;)if(Se=U.charCodeAt(ge),48>Se||Se>57){q=(Se===46?Q+U.slice(ge+1):U.slice(ge))+q,U=U.slice(0,ge);break}}}Ne&&!Me&&(U=F(U,1/0));var pe=G.length+U.length+q.length,re=pe<Te?new Array(Te-pe+1).join(we):"";switch(Ne&&Me&&(U=F(re+U,re.length?Te-q.length:1/0),re=""),Ce){case"<":U=G+U+q+re;break;case"=":U=G+re+U+q;break;case"^":U=re.slice(0,pe=re.length>>1)+G+U+q+re.slice(pe);break;default:U=re+G+U+q;break}return se(U)}return S.toString=function(){return J+""},S}function st(J,we){var Ce=ve((J=c(J),J.type="f",J)),le=Math.max(-8,Math.min(8,Math.floor(s(we)/3)))*3,Ee=Math.pow(10,-le),Me=j[8+le/3];return function(Te){return Ce(Ee*Te)+Me}}return{format:ve,formatPrefix:st}}var w;M({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function M(m){return w=X(m),n.format=w.format,n.formatPrefix=w.formatPrefix,w}function T(m){return Math.max(0,-s(Math.abs(m)))}function ne(m,F){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(s(F)/3)))*3-s(Math.abs(m)))}function _(m,F){return m=Math.abs(m),F=Math.abs(F)-m,Math.max(0,s(F)-s(m))+1}n.FormatSpecifier=d,n.formatDefaultLocale=M,n.formatLocale=X,n.formatSpecifier=c,n.precisionFixed=T,n.precisionPrefix=ne,n.precisionRound=_,Object.defineProperty(n,"__esModule",{value:!0})}))});var Aa={};ao(Aa,{AccessService:()=>Pn,AccountService:()=>Mn,Activity:()=>ir,Attr:()=>hn,Attribute:()=>Je,BUILD_VERSION:()=>go,BaseScope:()=>Js,ClientTools:()=>Ft,CloudService:()=>Tn,CodesignService:()=>wn,Connection:()=>Ds,DFUArrayActions:()=>bo,DFUChangeProtection:()=>Eo,DFUChangeRestriction:()=>Fo,DFUDefFileFormat:()=>Uo,DFUService:()=>Dt,DFUWorkunit:()=>pr,DFUWorkunitCache:()=>mn,DFUXRefService:()=>Bn,DaliService:()=>Nn,Definition:()=>Sn,ECLGraph:()=>kt,ECLScope:()=>ht,ESPConnection:()=>Cs,ESPExceptions:()=>Ye,EclService:()=>Qt,EclccErrors:()=>as,ElkService:()=>Ln,EnvchkErrors:()=>yn,Errors:()=>os,Field:()=>fn,File:()=>Cn,FileSpray:()=>St,FileSprayService:()=>Xe,FileSprayStates:()=>Br,Folder:()=>Rn,GlobalResultCache:()=>zs,GraphCache:()=>vt,Import:()=>rs,LocalWorkunit:()=>bn,LogType:()=>vr,LogaccessService:()=>Gn,LogicalFile:()=>or,LogicalFileCache:()=>on,Machine:()=>$t,MachineCache:()=>an,MachineService:()=>Ge,PKG_NAME:()=>uo,PKG_VERSION:()=>lo,PackageProcessService:()=>kn,PropertyType:()=>ri,Query:()=>lr,QueryGraph:()=>ns,RelatedProperty:()=>ii,Resource:()=>jt,ResourcesService:()=>vn,Result:()=>zt,ResultCache:()=>Jt,SMCService:()=>Ct,SashaService:()=>Hn,Scope:()=>At,ScopeEdge:()=>er,ScopeGraph:()=>Vt,ScopeSubgraph:()=>Zn,ScopeVertex:()=>$n,Service:()=>k,Source:()=>Dn,SourceFile:()=>Kt,Store:()=>gr,StoreCache:()=>dn,StoreService:()=>Rt,TargetAudience:()=>Vr,TargetCluster:()=>ut,TargetClusterCache:()=>un,Timer:()=>Zt,Topology:()=>es,TopologyCache:()=>gn,TopologyService:()=>ce,ValueChangedMessage:()=>et,Version:()=>Et,WUStateID:()=>js,WUUpdate:()=>ze,Workspace:()=>An,Workunit:()=>ct,WorkunitCache:()=>tn,WorkunitsService:()=>ie,WorkunitsServiceEx:()=>Gt,WsAccess:()=>In,WsCodesign:()=>bs,WsDfu:()=>at,WsLogaccess:()=>te,WsSMC:()=>On,WsSasha:()=>Vn,WsTopology:()=>_n,WsWorkunits:()=>me,XGMMLEdge:()=>Kn,XGMMLGraph:()=>_s,XGMMLSubgraph:()=>zn,XGMMLVertex:()=>Jn,XSDNode:()=>Ot,XSDSchema:()=>Xt,XSDSimpleType:()=>Yt,XSDXMLNode:()=>_t,attachWorkspace:()=>tt,clearAllClientToolsCache:()=>Ra,createConnection:()=>Nt,createGraph:()=>Ht,createXGMMLGraph:()=>tr,defaultTargetCluster:()=>ra,deserializeResponse:()=>Fr,get:()=>Tr,hookSend:()=>So,instanceOfIConnection:()=>ho,instanceOfIOptions:()=>po,isArray:()=>Nr,isECLResult:()=>Yn,isExceptions:()=>Co,isWUInfoWorkunit:()=>vo,isWUQueryECLWorkunit:()=>ko,jsonp:()=>Ir,locateAllClientTools:()=>Di,locateClientTools:()=>hr,parseXSD:()=>Xs,parseXSD2:()=>Vo,post:()=>Mr,qualifiedIDBoundary:()=>Ca,send:()=>wr,serializeRequest:()=>_e,setTransportFactory:()=>Do,splitMetric:()=>oi,targetClusters:()=>na,walkXmlJson:()=>Wn});module.exports=co(Aa);var Mt=require("@hpcc-js/util"),Ci=require("@xmldom/xmldom"),Ue=Pe(require("node:https"),1),Sr=require("node:buffer"),Un=require("undici");var Ur=`
2
2
  Trustwave Secure Global Extended Validation CA, Level 1
3
3
  SecureTrust Corporation
4
4
  00F6F61CE4A3635BB0CA8AACEEFCB2D0F0
@@ -907,20 +907,20 @@ AZKXRRJ+oPM+rRk6ct30UJMDEr5E0k9BpIycnR+j9sKS50gU/k6bpZFXrsY3crsC
907
907
  MGclCrEMXu6pY5Jv5ZAL/mYiykf9ijH3g/56vxC+GCsej/YpHpRZ744hN8tRmKVu
908
908
  Sw==
909
909
  -----END CERTIFICATE-----
910
- `;var uo="__PACKAGE_NAME__",lo="__PACKAGE_VERSION__",go="__BUILD_VERSION__";var Bt=require("@hpcc-js/util");var pe=require("@hpcc-js/util"),Er=(0,pe.scopedLogger)("comms/connection.ts");function po(n){return"baseUrl"in n}var mo={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function ho(n){return typeof n.opts=="function"&&typeof n.send=="function"&&typeof n.clone=="function"}function Be(n,e){return e===void 0||e===!0?encodeURIComponent(n):""+n}function _e(n,e=!0,t=""){if(t&&(t+="."),typeof n!="object")return Be(n,e);let s=[];for(let r in n)if(n.hasOwnProperty(r))if(n[r]instanceof Array){let i=!1;n[r].forEach((o,c)=>{typeof o=="object"?(i=!0,s.push(_e(o,e,t+Be(`${r}.${c}`,e)))):s.push(t+Be(`${r}_i${c}`,e)+"="+_e(o,e))}),i&&s.push(t+Be(`${r}.itemcount`,e)+"="+n[r].length)}else typeof n[r]=="object"?n[r]&&n[r].Item instanceof Array?(s.push(_e(n[r].Item,e,t+Be(r,e))),s.push(t+Be(`${r}.itemcount`,e)+"="+n[r].Item.length)):s.push(_e(n[r],e,t+Be(r,e))):n[r]!==void 0?s.push(t+Be(r,e)+"="+Be(n[r],e)):s.push(t+Be(r,e));return s.join("&")}function Fr(n){return JSON.parse(n)}function Ir(n,e,t={},s="json",r){return r&&console.warn("Header attributes ignored for JSONP connections"),new Promise((i,o)=>{let c=n.timeoutSecs*1e3,d=5e3,y="jsonp_callback_"+Math.round(Math.random()*999999);window[y]=function(w){c=0,M(),i(s==="json"&&typeof w=="string"?Fr(w):w)};let l=document.createElement("script"),E=(0,pe.join)(n.baseUrl,e);E+=E.indexOf("?")>=0?"&":"?",l.src=E+"jsonp="+y+"&"+_e(t,n.encodeRequest),document.body.appendChild(l);let R=setInterval(function(){c<=0?clearInterval(R):(c-=d,c<=0?(clearInterval(R),Er.error("Request timeout: "+l.src),M(),o(Error("Request timeout: "+l.src))):Er.debug("Request pending ("+c/1e3+" sec): "+l.src))},d);function M(){delete window[y],document.body.removeChild(l)}})}function fo(n){return n.userID?{Authorization:`Basic ${(0,pe.utf8ToBase64)(`${n.userID}:${n.password}`)}`}:{}}var fs={};function Pr(n,e,t,s,r){s={...fo(n),...s},t={credentials:fs[n.baseUrl]?"omit":"include",...t,headers:s},n.baseUrl.indexOf("https:")===0&&(n.rejectUnauthorized===!1&&pe.root.__hpcc_rejectUnauthorizedAgent?t.dispatcher=pe.root.__hpcc_rejectUnauthorizedAgent:pe.root.__hpcc_trustwaveAgent&&(t.agent=pe.root.__hpcc_trustwaveAgent));function i(c){if(c.ok)return r==="json"?c.json():c.text();throw new Error(c.statusText)}let o=pe.root.__hpcc_undiciFetch??fetch;return(0,pe.promiseTimeout)(n.timeoutSecs*1e3,o((0,pe.join)(n.baseUrl,e),t).then(i).catch(c=>(t.credentials=fs[n.baseUrl]?"include":"omit",o((0,pe.join)(n.baseUrl,e),t).then(i).then(d=>(fs[n.baseUrl]=!fs[n.baseUrl],d)))))}function Mr(n,e,t,s="json",r){t.upload_&&(delete t.upload_,e+="?upload_");let i;return t.abortSignal_&&(i=t.abortSignal_,delete t.abortSignal_),Pr(n,e,{method:"post",body:_e(t,n.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...r},s)}function Tr(n,e,t,s="json",r){let i;return t.abortSignal_&&(i=t.abortSignal_,delete t.abortSignal_),Pr(n,`${e}?${_e(t,n.encodeRequest)}`,{method:"get",signal:i},{...r},s)}function wr(n,e,t,s="json",r){let i;switch(n.type){case"jsonp":i=Ir(n,e,t,s,r);break;case"get":i=Tr(n,e,t,s,r);break;default:i=Mr(n,e,t,s,r);break}return i}var Ds=wr;function Do(n){let e=Ds;return n&&(Ds=n),e}var Ss=class n{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return arguments.length===0?this._opts:(this._opts={...mo,...e},this)}send(e,t,s="json",r){return this._opts.hookSend?this._opts.hookSend(this._opts,e,t,s,Ds,r):Ds(this._opts,e,t,s,r)}clone(){return new n(this.opts())}},Nt=function(n){return new Ss(n)};function So(n){let e=Nt;return Nt=n,e}function Nr(n){return Object.prototype.toString.call(n)==="[object Array]"}var Ye=class extends Error{isESPExceptions=!0;action;request;Source;Exception;constructor(e,t,s){super("ESPException: "+s.Source),this.action=e,this.request=t,this.Source=s.Source,this.Exception=s.Exception,s.Exception.length?this.message=`${s.Exception[0].Code}: ${s.Exception[0].Message}`:this.message=""}};function Co(n){return n instanceof Ye||n.isESPExceptions&&Array.isArray(n.Exception)}function Ro(n){return n.send!==void 0}var Cs=class n{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,t,s){this._connection=Ro(e)?e:Nt(e),this._service=t,this._version=s}service(e){return e===void 0?this._service:(this._service=e,this)}version(e){return e===void 0?this._version:(this._version=e,this)}toESPStringArray(e,t){if(Nr(e[t])){for(let s=0;s<e[t].length;++s)e[t+"_i"+s]=e[t][s];delete e[t]}return e}opts(e){return e===void 0?this._connection.opts():(this._connection.opts(e),this)}send(e,t={},s="json",r=!1,i,o){let c={...t,ver_:this._version};r&&(c.upload_=!0),i&&(c.abortSignal_=i);let d,y="json";switch(s){case"text":d=(0,Bt.join)(this._service,e),y="text";break;case"xsd":d=(0,Bt.join)(this._service,e+".xsd"),y="text";break;case"json2":d=(0,Bt.join)(this._service,e+"/json"),s="json",e=e.split("/").pop();break;default:d=(0,Bt.join)(this._service,e+".json")}return this._connection.send(d,c,y).then(l=>{if(s==="json"){let E;if(l&&l.Exceptions)throw new Ye(e,c,l.Exceptions);if(l&&(E=l[o||e+"Response"]),!E)throw new Ye(e,c,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return E}return l})}clone(){return new n(this._connection.clone(),this._service,this._version)}},G=class{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,t,s){this._connection=new Cs(e,t,s)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};var Dt;(t=>{let n;(y=>(y.Delete="Delete",y.Protect="Protect",y.Unprotect="Unprotect",y.Restore="Restore",y.SetToFailed="SetToFailed",y.Archive="Archive"))(n=t.DFUWUActions||={});let e;(w=>(w.copy="copy",w.remove="remove",w.move="move",w.rename="rename",w.replicate="replicate",w.import="import",w.export="export",w.monitor="monitor",w.copymerge="copymerge",w.supercopy="supercopy",w.publish="publish"))(e=t.DFUCommand||={})})(Dt||={});var Rs=class extends G{constructor(e){super(e,"FileSpray","1.29")}AbortDFUWorkunit(e,t){return this._connection.send("AbortDFUWorkunit",e,"json",!1,t,"AbortDFUWorkunitResponse")}Copy(e,t){return this._connection.send("Copy",e,"json",!1,t,"CopyResponse")}CreateDFUPublisherWorkunit(e,t){return this._connection.send("CreateDFUPublisherWorkunit",e,"json",!1,t,"CreateDFUPublisherWorkunitResponse")}CreateDFUWorkunit(e,t){return this._connection.send("CreateDFUWorkunit",e,"json",!1,t,"CreateDFUWorkunitResponse")}DFUWUFile(e,t){return this._connection.send("DFUWUFile",e,"json",!1,t,"DFUWUFileResponse")}DFUWUSearch(e,t){return this._connection.send("DFUWUSearch",e,"json",!1,t,"DFUWUSearchResponse")}DFUWorkunitsAction(e,t){return this._connection.send("DFUWorkunitsAction",e,"json",!1,t,"DFUWorkunitsActionResponse")}DeleteDFUWorkunit(e,t){return this._connection.send("DeleteDFUWorkunit",e,"json",!1,t,"DeleteDFUWorkunitResponse")}DeleteDFUWorkunits(e,t){return this._connection.send("DeleteDFUWorkunits",e,"json",!1,t,"DeleteDFUWorkunitsResponse")}DeleteDropZoneFiles(e,t){return this._connection.send("DeleteDropZoneFiles",e,"json",!1,t,"DFUWorkunitsActionResponse")}Despray(e,t){return this._connection.send("Despray",e,"json",!1,t,"DesprayResponse")}DfuMonitor(e,t){return this._connection.send("DfuMonitor",e,"json",!1,t,"DfuMonitorResponse")}DropZoneFileSearch(e,t){return this._connection.send("DropZoneFileSearch",e,"json",!1,t,"DropZoneFileSearchResponse")}DropZoneFiles(e,t){return this._connection.send("DropZoneFiles",e,"json",!1,t,"DropZoneFilesResponse")}EchoDateTime(e,t){return this._connection.send("EchoDateTime",e,"json",!1,t,"EchoDateTimeResponse")}FileList(e,t){return this._connection.send("FileList",e,"json",!1,t,"FileListResponse")}GetDFUExceptions(e,t){return this._connection.send("GetDFUExceptions",e,"json",!1,t,"GetDFUExceptionsResponse")}GetDFUProgress(e,t){return this._connection.send("GetDFUProgress",e,"json",!1,t,"ProgressResponse")}GetDFUServerQueues(e,t){return this._connection.send("GetDFUServerQueues",e,"json",!1,t,"GetDFUServerQueuesResponse")}GetDFUWorkunit(e,t){return this._connection.send("GetDFUWorkunit",e,"json",!1,t,"GetDFUWorkunitResponse")}GetDFUWorkunits(e,t){return this._connection.send("GetDFUWorkunits",e,"json",!1,t,"GetDFUWorkunitsResponse")}GetRemoteTargets(e,t){return this._connection.send("GetRemoteTargets",e,"json",!1,t,"GetRemoteTargetsResponse")}GetSprayTargets(e,t){return this._connection.send("GetSprayTargets",e,"json",!1,t,"GetSprayTargetsResponse")}OpenSave(e,t){return this._connection.send("OpenSave",e,"json",!1,t,"OpenSaveResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"FileSprayPingResponse")}Rename(e,t){return this._connection.send("Rename",e,"json",!1,t,"RenameResponse")}Replicate(e,t){return this._connection.send("Replicate",e,"json",!1,t,"ReplicateResponse")}ShowResult(e,t){return this._connection.send("ShowResult",e,"json",!1,t,"ShowResultResponse")}SprayFixed(e,t){return this._connection.send("SprayFixed",e,"json",!1,t,"SprayFixedResponse")}SprayVariable(e,t){return this._connection.send("SprayVariable",e,"json",!1,t,"SprayResponse")}SubmitDFUWorkunit(e,t){return this._connection.send("SubmitDFUWorkunit",e,"json",!1,t,"SubmitDFUWorkunitResponse")}UpdateDFUWorkunit(e,t){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,t,"UpdateDFUWorkunitResponse")}};var Br=(l=>(l[l.unknown=0]="unknown",l[l.scheduled=1]="scheduled",l[l.queued=2]="queued",l[l.started=3]="started",l[l.aborted=4]="aborted",l[l.failed=5]="failed",l[l.finished=6]="finished",l[l.monitoring=7]="monitoring",l[l.aborting=8]="aborting",l[l.notfound=999]="notfound",l))(Br||{}),Xe=class extends Rs{DFUWUFileEx(e){return this._connection.send("DFUWUFile",e,"text")}SprayFixedEx(e){return this._connection.send("SprayFixed",e)}SprayVariableEx(e){return this._connection.send("SprayVariable",e,"json",!1,null,"SprayResponse")}DesprayEx(e){return this._connection.send("Despray",e)}UpdateDFUWorkunitEx(e){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,void 0,"UpdateDFUWorkunitResponse")}};var In;(o=>{let n;(y=>(y.User="User",y.Group="Group"))(n=o.ViewMemberType||={});let e;(R=>(R.username="username",R.fullname="fullname",R.passwordexpiration="passwordexpiration",R.employeeID="employeeID",R.employeeNumber="employeeNumber"))(e=o.UserSortBy||={});let t;(y=>(y.Name="Name",y.ManagedBy="ManagedBy"))(t=o.GroupSortBy||={});let s;(l=>(l.Any="Any",l.User="User",l.Group="Group"))(s=o.AccountTypeReq||={});let r;(y=>(y.Name="Name",y.Type="Type"))(r=o.ResourcePermissionSortBy||={});let i;(d=>d.Name="Name")(i=o.ResourceSortBy||={})})(In||={});var As=class extends G{constructor(e){super(e,"ws_access","1.17")}AccountPermissions(e,t){return this._connection.send("AccountPermissions",e,"json",!1,t,"AccountPermissionsResponse")}AccountPermissionsV2(e,t){return this._connection.send("AccountPermissionsV2",e,"json",!1,t,"AccountPermissionsV2Response")}AddUser(e,t){return this._connection.send("AddUser",e,"json",!1,t,"AddUserResponse")}AddView(e,t){return this._connection.send("AddView",e,"json",!1,t,"AddViewResponse")}AddViewColumn(e,t){return this._connection.send("AddViewColumn",e,"json",!1,t,"AddViewColumnResponse")}AddViewMember(e,t){return this._connection.send("AddViewMember",e,"json",!1,t,"AddViewMemberResponse")}ClearPermissionsCache(e,t){return this._connection.send("ClearPermissionsCache",e,"json",!1,t,"ClearPermissionsCacheResponse")}DeleteView(e,t){return this._connection.send("DeleteView",e,"json",!1,t,"DeleteViewResponse")}DeleteViewColumn(e,t){return this._connection.send("DeleteViewColumn",e,"json",!1,t,"DeleteViewColumnResponse")}DeleteViewMember(e,t){return this._connection.send("DeleteViewMember",e,"json",!1,t,"DeleteViewMemberResponse")}DisableScopeScans(e,t){return this._connection.send("DisableScopeScans",e,"json",!1,t,"DisableScopeScansResponse")}EnableScopeScans(e,t){return this._connection.send("EnableScopeScans",e,"json",!1,t,"EnableScopeScansResponse")}FilePermission(e,t){return this._connection.send("FilePermission",e,"json",!1,t,"FilePermissionResponse")}GroupAction(e,t){return this._connection.send("GroupAction",e,"json",!1,t,"GroupActionResponse")}GroupAdd(e,t){return this._connection.send("GroupAdd",e,"json",!1,t,"GroupAddResponse")}GroupEdit(e,t){return this._connection.send("GroupEdit",e,"json",!1,t,"GroupEditResponse")}GroupMemberEdit(e,t){return this._connection.send("GroupMemberEdit",e,"json",!1,t,"GroupMemberEditResponse")}GroupMemberEditInput(e,t){return this._connection.send("GroupMemberEditInput",e,"json",!1,t,"GroupMemberEditInputResponse")}GroupMemberQuery(e,t){return this._connection.send("GroupMemberQuery",e,"json",!1,t,"GroupMemberQueryResponse")}GroupQuery(e,t){return this._connection.send("GroupQuery",e,"json",!1,t,"GroupQueryResponse")}Groups(e,t){return this._connection.send("Groups",e,"json",!1,t,"GroupResponse")}PermissionAction(e,t){return this._connection.send("PermissionAction",e,"json",!1,t,"PermissionActionResponse")}Permissions(e,t){return this._connection.send("Permissions",e,"json",!1,t,"BasednsResponse")}PermissionsReset(e,t){return this._connection.send("PermissionsReset",e,"json",!1,t,"PermissionsResetResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_accessPingResponse")}QueryScopeScansEnabled(e,t){return this._connection.send("QueryScopeScansEnabled",e,"json",!1,t,"QueryScopeScansEnabledResponse")}QueryUserViewColumns(e,t){return this._connection.send("QueryUserViewColumns",e,"json",!1,t,"QueryUserViewColumnsResponse")}QueryViewColumns(e,t){return this._connection.send("QueryViewColumns",e,"json",!1,t,"QueryViewColumnsResponse")}QueryViewMembers(e,t){return this._connection.send("QueryViewMembers",e,"json",!1,t,"QueryViewMembersResponse")}QueryViews(e,t){return this._connection.send("QueryViews",e,"json",!1,t,"QueryViewsResponse")}ResourceAdd(e,t){return this._connection.send("ResourceAdd",e,"json",!1,t,"ResourceAddResponse")}ResourceDelete(e,t){return this._connection.send("ResourceDelete",e,"json",!1,t,"ResourceDeleteResponse")}ResourcePermissionQuery(e,t){return this._connection.send("ResourcePermissionQuery",e,"json",!1,t,"ResourcePermissionQueryResponse")}ResourcePermissions(e,t){return this._connection.send("ResourcePermissions",e,"json",!1,t,"ResourcePermissionsResponse")}ResourceQuery(e,t){return this._connection.send("ResourceQuery",e,"json",!1,t,"ResourceQueryResponse")}Resources(e,t){return this._connection.send("Resources",e,"json",!1,t,"ResourcesResponse")}UserAccountExport(e,t){return this._connection.send("UserAccountExport",e,"json",!1,t,"UserAccountExportResponse")}UserAction(e,t){return this._connection.send("UserAction",e,"json",!1,t,"UserActionResponse")}UserEdit(e,t){return this._connection.send("UserEdit",e,"json",!1,t,"UserEditResponse")}UserGroupEdit(e,t){return this._connection.send("UserGroupEdit",e,"json",!1,t,"UserGroupEditResponse")}UserGroupEditInput(e,t){return this._connection.send("UserGroupEditInput",e,"json",!1,t,"UserGroupEditInputResponse")}UserInfoEdit(e,t){return this._connection.send("UserInfoEdit",e,"json",!1,t,"UserInfoEditResponse")}UserInfoEditInput(e,t){return this._connection.send("UserInfoEditInput",e,"json",!1,t,"UserInfoEditInputResponse")}UserPosix(e,t){return this._connection.send("UserPosix",e,"json",!1,t,"UserPosixResponse")}UserPosixInput(e,t){return this._connection.send("UserPosixInput",e,"json",!1,t,"UserPosixInputResponse")}UserQuery(e,t){return this._connection.send("UserQuery",e,"json",!1,t,"UserQueryResponse")}UserResetPass(e,t){return this._connection.send("UserResetPass",e,"json",!1,t,"UserResetPassResponse")}UserResetPassInput(e,t){return this._connection.send("UserResetPassInput",e,"json",!1,t,"UserResetPassInputResponse")}UserSudoers(e,t){return this._connection.send("UserSudoers",e,"json",!1,t,"UserSudoersResponse")}UserSudoersInput(e,t){return this._connection.send("UserSudoersInput",e,"json",!1,t,"UserSudoersInputResponse")}Users(e,t){return this._connection.send("Users",e,"json",!1,t,"UserResponse")}};var Pn=class extends As{};var ys=class extends G{constructor(e){super(e,"ws_account","1.07")}MyAccount(e,t){return this._connection.send("MyAccount",e,"json",!1,t,"MyAccountResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_accountPingResponse")}UpdateUser(e,t){return this._connection.send("UpdateUser",e,"json",!1,t,"UpdateUserResponse")}UpdateUserInput(e,t){return this._connection.send("UpdateUserInput",e,"json",!1,t,"UpdateUserInputResponse")}VerifyUser(e,t){return this._connection.send("VerifyUser",e,"json",!1,t,"VerifyUserResponse")}};var Mn=class extends ys{VerifyUser(e){return this._connection.send("VerifyUser",e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(s=>s.Code===20043))return{retcode:20043,Exceptions:{Source:"wsAccount",Exception:t.Exception}};throw t})}};var Qr=require("@hpcc-js/util");var xs=class extends G{constructor(e){super(e,"WsCloud","1.02")}GetPODs(e,t){return this._connection.send("GetPODs",e,"json",!1,t,"GetPODsResponse")}GetServices(e,t){return this._connection.send("GetServices",e,"json",!1,t,"GetServicesResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsCloudPingResponse")}};var Ao=(0,Qr.scopedLogger)("@hpcc-js/comms/services/wsCloud.ts");function yo(n){return n?.Pods!==void 0}function xo(n){return n.spec?.containers?.reduce((e,t)=>(t.ports?.forEach(s=>{e.push({ContainerPort:s.containerPort,Name:s.name,Protocol:s.protocol})}),e),[])??[]}function Wo(n){return n.filter(e=>{let t=e?.metadata?.labels??{};return t.hasOwnProperty("app.kubernetes.io/part-of")&&t["app.kubernetes.io/part-of"]==="HPCC-Platform"}).map(e=>{let t=new Date(e.metadata?.creationTimestamp);return{Name:e.metadata.name,Status:e.status?.phase,CreationTimestamp:t.toISOString(),ContainerName:e.status?.containerStatuses?.reduce((s,r)=>(r.name&&s.push(r.name),s),[]).join(", ")??"",ContainerCount:e.spec?.containers?.length??0,ContainerReadyCount:e.status?.containerStatuses?.reduce((s,r)=>s+(r.ready?1:0),0),ContainerRestartCount:e.status?.containerStatuses?.reduce((s,r)=>s+r.restartCount,0),Ports:{Port:xo(e)}}})}var Tn=class extends xs{getPODs(){return super.GetPODs({}).then(e=>{if(yo(e))return e.Pods?.Pod??[];try{let t=typeof e.Result=="string"?JSON.parse(e.Result):e.Result;return Wo(t?.items??[])}catch(t){return Ao.error(`Error parsing V1Pods json '${t instanceof Error?t.message:String(t)}'`),[]}})}};var bs;(e=>{let n;(s=>s.gpg="gpg")(n=e.SigningMethodType||={})})(bs||={});var Ws=class extends G{constructor(e){super(e,"ws_codesign","1.1")}ListUserIDs(e,t){return this._connection.send("ListUserIDs",e,"json",!1,t,"ListUserIDsResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_codesignPingResponse")}Sign(e,t){return this._connection.send("Sign",e,"json",!1,t,"SignResponse")}Verify(e,t){return this._connection.send("Verify",e,"json",!1,t,"VerifyResponse")}};var wn=class extends Ws{ListUserIDsEx(e){return super.ListUserIDs(e).then(t=>t.UserIDs.Item).catch(t=>[])}Sign(e){return super.Sign({SigningMethod:bs.SigningMethodType.gpg,...e})}};var Us=class extends G{constructor(e){super(e,"WSDali","1.07")}Add(e,t){return this._connection.send("Add",e,"json",!1,t,"ResultResponse")}ClearTraceTransactions(e,t){return this._connection.send("ClearTraceTransactions",e,"json",!1,t,"ResultResponse")}Count(e,t){return this._connection.send("Count",e,"json",!1,t,"CountResponse")}DFSCheck(e,t){return this._connection.send("DFSCheck",e,"json",!1,t,"ResultResponse")}DFSExists(e,t){return this._connection.send("DFSExists",e,"json",!1,t,"BooleanResponse")}DFSLS(e,t){return this._connection.send("DFSLS",e,"json",!1,t,"ResultResponse")}Delete(e,t){return this._connection.send("Delete",e,"json",!1,t,"ResultResponse")}DisconnectClientConnection(e,t){return this._connection.send("DisconnectClientConnection",e,"json",!1,t,"ResultResponse")}GetClients(e,t){return this._connection.send("GetClients",e,"json",!1,t,"ResultResponse")}GetConnections(e,t){return this._connection.send("GetConnections",e,"json",!1,t,"ResultResponse")}GetDFSCSV(e,t){return this._connection.send("GetDFSCSV",e,"json",!1,t,"ResultResponse")}GetDFSMap(e,t){return this._connection.send("GetDFSMap",e,"json",!1,t,"ResultResponse")}GetDFSParents(e,t){return this._connection.send("GetDFSParents",e,"json",!1,t,"ResultResponse")}GetLogicalFile(e,t){return this._connection.send("GetLogicalFile",e,"json",!1,t,"ResultResponse")}GetLogicalFilePart(e,t){return this._connection.send("GetLogicalFilePart",e,"json",!1,t,"ResultResponse")}GetProtectedList(e,t){return this._connection.send("GetProtectedList",e,"json",!1,t,"ResultResponse")}GetSDSStats(e,t){return this._connection.send("GetSDSStats",e,"json",!1,t,"ResultResponse")}GetSDSSubscribers(e,t){return this._connection.send("GetSDSSubscribers",e,"json",!1,t,"ResultResponse")}GetValue(e,t){return this._connection.send("GetValue",e,"json",!1,t,"ResultResponse")}Import(e,t){return this._connection.send("Import",e,"json",!1,t,"ResultResponse")}ListSDSLocks(e,t){return this._connection.send("ListSDSLocks",e,"json",!1,t,"ResultResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WSDaliPingResponse")}SaveSDSStore(e,t){return this._connection.send("SaveSDSStore",e,"json",!1,t,"ResultResponse")}SetLogicalFilePartAttr(e,t){return this._connection.send("SetLogicalFilePartAttr",e,"json",!1,t,"ResultResponse")}SetProtected(e,t){return this._connection.send("SetProtected",e,"json",!1,t,"ResultResponse")}SetTraceSlowTransactions(e,t){return this._connection.send("SetTraceSlowTransactions",e,"json",!1,t,"ResultResponse")}SetTraceTransactions(e,t){return this._connection.send("SetTraceTransactions",e,"json",!1,t,"ResultResponse")}SetUnprotected(e,t){return this._connection.send("SetUnprotected",e,"json",!1,t,"ResultResponse")}SetValue(e,t){return this._connection.send("SetValue",e,"json",!1,t,"ResultResponse")}UnlockSDSLock(e,t){return this._connection.send("UnlockSDSLock",e,"json",!1,t,"ResultResponse")}};var Nn=class extends Us{};var at;(c=>{let n;(R=>(R.Delete="Delete",R.AddToSuperfile="Add To Superfile",R.ChangeProtection="Change Protection",R.ChangeRestriction="Change Restriction"))(n=c.DFUArrayActions||={});let e;(R=>(R[R.NoChange=0]="NoChange",R[R.Protect=1]="Protect",R[R.Unprotect=2]="Unprotect",R[R.UnprotectAll=3]="UnprotectAll"))(e=c.DFUChangeProtection||={});let t;(E=>(E[E.NoChange=0]="NoChange",E[E.Restrict=1]="Restrict",E[E.Unrestricted=2]="Unrestricted"))(t=c.DFUChangeRestriction||={});let s;(l=>(l.xml="xml",l.def="def"))(s=c.DFUDefFileFormat||={});let r;(E=>(E.Token="Token",E.Engine="Engine",E.External="External"))(r=c.FileAccessRole||={});let i;(M=>(M.None="None",M.Access="Access",M.Read="Read",M.Write="Write",M.Full="Full"))(i=c.SecAccessType||={});let o;(B=>(B.Flat="Flat",B.Index="Index",B.Xml="Xml",B.Csv="Csv",B.Json="Json",B.IndexLocal="IndexLocal",B.IndexPartitioned="IndexPartitioned",B.Unset="Unset"))(o=c.DFUFileType||={})})(at||={});var Es=class extends G{constructor(e){super(e,"WsDfu","1.67")}Add(e){return this._connection.send("Add",e,"json",!1,void 0,"AddResponse")}AddRemote(e){return this._connection.send("AddRemote",e,"json",!1,void 0,"AddRemoteResponse")}AddtoSuperfile(e){return this._connection.send("AddtoSuperfile",e,"json",!1,void 0,"AddtoSuperfileResponse")}DFUArrayAction(e){return this._connection.send("DFUArrayAction",e,"json",!1,void 0,"DFUArrayActionResponse")}DFUBrowseData(e){return this._connection.send("DFUBrowseData",e,"json",!1,void 0,"DFUBrowseDataResponse")}DFUDefFile(e){return this._connection.send("DFUDefFile",e,"json",!1,void 0,"DFUDefFileResponse")}DFUFileAccess(e){return this._connection.send("DFUFileAccess",e,"json",!1,void 0,"DFUFileAccessResponse")}DFUFileAccessV2(e){return this._connection.send("DFUFileAccessV2",e,"json",!1,void 0,"DFUFileAccessResponse")}DFUFileCreate(e){return this._connection.send("DFUFileCreate",e,"json",!1,void 0,"DFUFileCreateResponse")}DFUFileCreateV2(e){return this._connection.send("DFUFileCreateV2",e,"json",!1,void 0,"DFUFileCreateResponse")}DFUFilePublish(e){return this._connection.send("DFUFilePublish",e,"json",!1,void 0,"DFUFilePublishResponse")}DFUFileView(e){return this._connection.send("DFUFileView",e,"json",!1,void 0,"DFUFileViewResponse")}DFUGetDataColumns(e){return this._connection.send("DFUGetDataColumns",e,"json",!1,void 0,"DFUGetDataColumnsResponse")}DFUGetFileMetaData(e){return this._connection.send("DFUGetFileMetaData",e,"json",!1,void 0,"DFUGetFileMetaDataResponse")}DFUGetMetaInquiry(e){return this._connection.send("DFUGetMetaInquiry",e,"json",!1,void 0,"DFUMetaInquiryResponse")}DFUInfo(e){return this._connection.send("DFUInfo",e,"json",!1,void 0,"DFUInfoResponse")}DFUQuery(e){return this._connection.send("DFUQuery",e,"json",!1,void 0,"DFUQueryResponse")}DFURecordTypeInfo(e){return this._connection.send("DFURecordTypeInfo",e,"json",!1,void 0,"DFURecordTypeInfoResponse")}DFUSearch(e){return this._connection.send("DFUSearch",e,"json",!1,void 0,"DFUSearchResponse")}DFUSearchData(e){return this._connection.send("DFUSearchData",e,"json",!1,void 0,"DFUSearchDataResponse")}DFUSpace(e){return this._connection.send("DFUSpace",e,"json",!1,void 0,"DFUSpaceResponse")}EclRecordTypeInfo(e){return this._connection.send("EclRecordTypeInfo",e,"json",!1,void 0,"EclRecordTypeInfoResponse")}EraseHistory(e){return this._connection.send("EraseHistory",e,"json",!1,void 0,"EraseHistoryResponse")}ListHistory(e){return this._connection.send("ListHistory",e,"json",!1,void 0,"ListHistoryResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsDfuPingResponse")}Savexml(e){return this._connection.send("Savexml",e,"json",!1,void 0,"SavexmlResponse")}SuperfileAction(e){return this._connection.send("SuperfileAction",e,"json",!1,void 0,"SuperfileActionResponse")}SuperfileList(e){return this._connection.send("SuperfileList",e,"json",!1,void 0,"SuperfileListResponse")}};var bo=at.DFUArrayActions,Uo=at.DFUDefFileFormat,Eo=at.DFUChangeProtection,Fo=at.DFUChangeRestriction,St=class extends Es{DFUFile(e){return this._connection.send("DFUDefFile",e,"text")}async recursiveFetchLogicalFiles(e){let t=[],s=[];return await Promise.all(e.map(r=>this.DFUInfo({Cluster:r.NodeGroup,Name:r.Name,IncludeJsonTypeInfo:!1,IncludeBinTypeInfo:!1,ForceIndexInfo:!1}).then(i=>{for(let o of i?.FileDetail?.Superfiles?.DFULogicalFile??[])t.push(o);for(let o of i?.FileDetail?.subfiles?.Item??[])s.push(o)}))),s.concat(t.length?await this.recursiveFetchLogicalFiles(t):[])}};var Fs=class extends G{constructor(e){super(e,"WsDFUXRef","1.04")}DFUXRefArrayAction(e,t){return this._connection.send("DFUXRefArrayAction",e,"json",!1,t,"DFUXRefArrayActionResponse")}DFUXRefBuild(e,t){return this._connection.send("DFUXRefBuild",e,"json",!1,t,"DFUXRefBuildResponse")}DFUXRefBuildCancel(e,t){return this._connection.send("DFUXRefBuildCancel",e,"json",!1,t,"DFUXRefBuildCancelResponse")}DFUXRefCleanDirectories(e,t){return this._connection.send("DFUXRefCleanDirectories",e,"json",!1,t,"DFUXRefCleanDirectoriesResponse")}DFUXRefDirectories(e,t){return this._connection.send("DFUXRefDirectories",e,"json",!1,t,"DFUXRefDirectoriesQueryResponse")}DFUXRefFoundFiles(e,t){return this._connection.send("DFUXRefFoundFiles",e,"json",!1,t,"DFUXRefFoundFilesQueryResponse")}DFUXRefList(e,t){return this._connection.send("DFUXRefList",e,"json",!1,t,"DFUXRefListResponse")}DFUXRefLostFiles(e,t){return this._connection.send("DFUXRefLostFiles",e,"json",!1,t,"DFUXRefLostFilesQueryResponse")}DFUXRefMessages(e,t){return this._connection.send("DFUXRefMessages",e,"json",!1,t,"DFUXRefMessagesQueryResponse")}DFUXRefOrphanFiles(e,t){return this._connection.send("DFUXRefOrphanFiles",e,"json",!1,t,"DFUXRefOrphanFilesQueryResponse")}DFUXRefUnusedFiles(e,t){return this._connection.send("DFUXRefUnusedFiles",e,"json",!1,t,"DFUXRefUnusedFilesResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsDFUXRefPingResponse")}};var Bn=class extends Fs{DFUXRefDirectoriesEx(e){return this._connection.send("DFUXRefDirectories",e,"json",!1,void 0,"DFUXRefDirectoriesQueryResponse")}DFUXRefListEx(e){return this._connection.send("DFUXRefList",e,"json",!1,void 0,"DFUXRefListResponse")}};function Lr(n,e){let t=typeof e;switch(t){case"boolean":case"number":case"string":return{id:n,type:t};case"object":if(e.Row instanceof Array&&(e=e.Row),e instanceof Array)return{id:n,type:"dataset",children:Qn(e[0])};if(e instanceof Object){if(e.Item&&e.Item instanceof Array&&e.Item.length===1){let s=typeof e.Item[0];if(s==="string"||s==="number")return{id:n,type:"set",fieldType:s};throw new Error("Unknown field type")}return{id:n,type:"object",fields:Io(e)}}default:throw new Error("Unknown field type")}}function Qn(n){n.Row&&n.Row instanceof Array&&(n=n.Row[0]);let e=[];for(let t in n)e.push(Lr(t,n[t]));return e}function Io(n){let e={};for(let t in n)e[t]=Lr(t,n[t]);return e}var Qt=class extends G{constructor(e){super(e,"WsEcl","0")}opts(){return this._connection.opts()}requestJson(e,t){return this._connection.send(`example/request/query/${e}/${t}/json`,{},"text").then(s=>{let r=JSON.parse(s);for(let i in r)return r[i];return{}}).then(Qn)}responseJson(e,t){return this._connection.send(`example/response/query/${e}/${t}/json`,{},"text").then(s=>{let r=JSON.parse(s);for(let i in r)return r[i].Results;return{}}).then(s=>{let r={};for(let i in s)r[i]=Qn(s[i]);return r})}submit(e,t,s){let r=`submit/query/${e}/${t}`;return this._connection.send(r,s,"json2").then(i=>{if(i.Results&&i.Results.Exception)throw new Ye(r,s,{Source:"wsEcl.submit",Exception:i.Results.Exception});return i.Results})}};var Is=class extends G{constructor(e){super(e,"ws_elk","1")}GetConfigDetails(e,t){return this._connection.send("GetConfigDetails",e,"json",!1,t,"GetConfigDetailsResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_elkPingResponse")}};var Ln=class extends Is{};var kr=require("@hpcc-js/util");var te;(d=>{let n;(I=>(I.global="global",I.workunits="workunits",I.components="components",I.audience="audience",I.class="class",I.instance="instance",I.node="node",I.message="message",I.logid="logid",I.processid="processid",I.threadid="threadid",I.timestamp="timestamp",I.pod="pod",I.traceid="traceid",I.spanid="spanid"))(n=d.LogColumnType||={});let e;(w=>(w.string="string",w.numeric="numeric",w.datetime="datetime",w.enum="enum",w.epoch="epoch"))(e=d.LogColumnValueType||={});let t;(F=>(F[F.All=0]="All",F[F.ByJobID=1]="ByJobID",F[F.ByComponent=2]="ByComponent",F[F.ByLogType=3]="ByLogType",F[F.ByTargetAudience=4]="ByTargetAudience",F[F.BySourceInstance=5]="BySourceInstance",F[F.BySourceNode=6]="BySourceNode",F[F.ByFieldName=7]="ByFieldName",F[F.ByPod=8]="ByPod",F[F.ByTraceID=9]="ByTraceID",F[F.BySpanID=10]="BySpanID"))(t=d.LogAccessType||={});let s;(R=>(R[R.Success=0]="Success",R[R.Warning=1]="Warning",R[R.Fail=2]="Fail"))(s=d.LogAccessStatusCode||={});let r;(R=>(R[R.NONE=0]="NONE",R[R.AND=1]="AND",R[R.OR=2]="OR"))(r=d.LogAccessFilterOperator||={});let i;(M=>(M[M.MIN=0]="MIN",M[M.DEFAULT=1]="DEFAULT",M[M.ALL=2]="ALL",M[M.CUSTOM=3]="CUSTOM"))(i=d.LogSelectColumnMode||={});let o;(F=>(F[F.ByDate=0]="ByDate",F[F.ByJobID=1]="ByJobID",F[F.ByComponent=2]="ByComponent",F[F.ByLogType=3]="ByLogType",F[F.ByTargetAudience=4]="ByTargetAudience",F[F.BySourceInstance=5]="BySourceInstance",F[F.BySourceNode=6]="BySourceNode",F[F.ByFieldName=7]="ByFieldName",F[F.ByPod=8]="ByPod",F[F.ByTraceID=9]="ByTraceID",F[F.BySpanID=10]="BySpanID"))(o=d.SortColumType||={});let c;(E=>(E[E.ASC=0]="ASC",E[E.DSC=1]="DSC"))(c=d.SortDirection||={})})(te||={});var Ps=class extends G{constructor(e){super(e,"ws_logaccess","1.08")}GetHealthReport(e){return this._connection.send("GetHealthReport",e,"json",!1,void 0,"GetHealthReportResponse")}GetLogAccessInfo(e){return this._connection.send("GetLogAccessInfo",e,"json",!1,void 0,"GetLogAccessInfoResponse")}GetLogs(e){return this._connection.send("GetLogs",e,"json",!1,void 0,"GetLogsResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_logaccessPingResponse")}};var Gr=(0,kr.scopedLogger)("@hpcc-js/comms/services/wsLogaccess.ts");var vr=(o=>(o.Disaster="DIS",o.Error="ERR",o.Warning="WRN",o.Information="INF",o.Progress="PRO",o.Metric="MET",o))(vr||{}),Vr=(r=>(r.Operator="OPR",r.User="USR",r.Programmer="PRO",r.Audit="ADT",r))(Vr||{}),Po=new Set(["azureloganalyticscurl","elasticstack","grafanacurl"]),Mo=new Set(Object.values(te.LogColumnType));function To(n){switch(n){case te.LogColumnType.workunits:case"hpcc.log.jobid":return te.LogAccessType.ByJobID;case te.LogColumnType.audience:case"hpcc.log.audience":return te.LogAccessType.ByTargetAudience;case te.LogColumnType.class:case"hpcc.log.class":return te.LogAccessType.ByLogType;case te.LogColumnType.components:case"kubernetes.container.name":return te.LogAccessType.ByComponent;default:return te.LogAccessType.ByFieldName}}var wo=["audience","class","workunits","message","processid","logid","threadid","timestamp","components","instance"];function No(n,e){let t=[];for(let s of wo){let r=n[s];if(r==null||r===""||Array.isArray(r)&&r.length===0||!(s in e))continue;let o=Mo.has(s)?s:e[s],c=To(o);c===te.LogAccessType.ByFieldName&&(o=e[s]);let d=c===te.LogAccessType.ByComponent,y=Array.isArray(r)?r:[r];for(let l of y)t.push({LogCategory:c,SearchField:o,SearchByValue:d?l+"*":l})}return t}function Ms(n){let e={leftFilter:n[0]},t=e;for(let s=1;s<n.length;s++)t.Operator=te.LogAccessFilterOperator.OR,s===n.length-1?t.rightFilter=n[s]:(t.rightBinaryFilter={BinaryLogFilter:[{leftFilter:n[s]}]},t=t.rightBinaryFilter.BinaryLogFilter[0]);return e}function Hr(n){let[e,...t]=n,s={};if(e.length===1?s.leftFilter=e[0]:s.leftBinaryFilter={BinaryLogFilter:[Ms(e)]},t.length===0)return s;if(s.Operator=te.LogAccessFilterOperator.AND,t.length===1){let[r]=t;r.length===1?s.rightFilter=r[0]:s.rightBinaryFilter={BinaryLogFilter:[Ms(r)]}}else s.rightBinaryFilter={BinaryLogFilter:[Hr(t)]};return s}function Bo(n){let e=new Map;for(let o of n){let c=e.get(o.SearchField);c?c.push(o):e.set(o.SearchField,[o])}let t=[...e.values()];if(t.length===0)return{leftFilter:{LogCategory:te.LogAccessType.All}};let[s,...r]=t,i={};if(s.length===1?i.leftFilter=s[0]:i.leftBinaryFilter={BinaryLogFilter:[Ms(s)]},r.length===0)return i;if(i.Operator=te.LogAccessFilterOperator.AND,r.length===1){let[o]=r;o.length===1?i.rightFilter=o[0]:i.rightBinaryFilter={BinaryLogFilter:[Ms(o)]}}else i.rightBinaryFilter={BinaryLogFilter:[Hr(r)]};return i}var Gn=class extends Ps{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}convertLogLine(e,t){let s={},r=t?.fields?Object.assign({},...t.fields):null;for(let i in e)s[i]=r?r[e[i]]??"":"";return s}async GetLogsEx(e){let t=await this.GetLogAccessInfo(),s={};t.Columns.Column.forEach(c=>s[c.LogType]=c.Name);let r=No(e,s),i={StartDate:e.StartDate instanceof Date?e.StartDate.toISOString():new Date(0).toISOString()};e.EndDate instanceof Date&&(i.EndDate=e.EndDate.toISOString());let o={Filter:Bo(r),Range:i,LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:te.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:te.SortColumType.ByDate,ColumnName:"",Direction:0}]}};return this.GetLogs(o).then(c=>{try{let d=JSON.parse(c.LogLines);return{lines:Po.has(t.RemoteLogManagerType)?d.lines?.map(l=>this.convertLogLine(s,l))??[]:(Gr.warning(`Unknown RemoteLogManagerType: ${t.RemoteLogManagerType}`),[]),total:c.TotalLogLinesAvailable??1e4}}catch(d){Gr.error(d.message??d)}return{lines:[],total:0}})}};var _r=require("@hpcc-js/util"),qe=Ie(Or(),1);var Qo;(t=>{let n;(i=>(i[i.THRESHOLD_PERCENTAGE=0]="THRESHOLD_PERCENTAGE",i[i.THRESHOLD_MB=1]="THRESHOLD_MB"))(n=t.ThresholdType||={});let e;(M=>(M.ALLNODES="ALLNODES",M.THORMACHINES="THORMACHINES",M.HOLEMACHINES="HOLEMACHINES",M.ROXIEMACHINES="ROXIEMACHINES",M.MACHINES="MACHINES",M.AVAILABLEMACHINES="AVAILABLEMACHINES",M.DROPZONE="DROPZONE",M.STANDBYNNODE="STANDBYNNODE",M.THORSPARENODES="THORSPARENODES",M.HOLESTANDBYNODES="HOLESTANDBYNODES"))(e=t.TpMachineType||={})})(Qo||={});var ws=class extends G{constructor(e){super(e,"ws_machine","1.19")}GetComponentStatus(e,t){return this._connection.send("GetComponentStatus",e,"json",!1,t,"GetComponentStatusResponse")}GetComponentUsage(e,t){return this._connection.send("GetComponentUsage",e,"json",!1,t,"GetComponentUsageResponse")}GetMachineInfo(e,t){return this._connection.send("GetMachineInfo",e,"json",!1,t,"GetMachineInfoResponse")}GetMachineInfoEx(e,t){return this._connection.send("GetMachineInfoEx",e,"json",!1,t,"GetMachineInfoResponseEx")}GetMetrics(e,t){return this._connection.send("GetMetrics",e,"json",!1,t,"MetricsResponse")}GetNodeGroupUsage(e,t){return this._connection.send("GetNodeGroupUsage",e,"json",!1,t,"GetNodeGroupUsageResponse")}GetTargetClusterInfo(e,t){return this._connection.send("GetTargetClusterInfo",e,"json",!1,t,"GetTargetClusterInfoResponse")}GetTargetClusterUsage(e,t){return this._connection.send("GetTargetClusterUsage",e,"json",!1,t,"GetTargetClusterUsageResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_machinePingResponse")}UpdateComponentStatus(e,t){return this._connection.send("UpdateComponentStatus",e,"json",!1,t,"UpdateComponentStatusResponse")}};var Ge=class extends ws{GetTargetClusterUsageEx(e,t=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:t}).then(s=>(0,_r.exists)("TargetClusterUsages.TargetClusterUsage",s)?s.TargetClusterUsages.TargetClusterUsage:[]).then(s=>s.filter(r=>!!r.ComponentUsages).map(r=>{let i=r.ComponentUsages.ComponentUsage.map(o=>{let c=(o.MachineUsages&&o.MachineUsages.MachineUsage?o.MachineUsages.MachineUsage:[]).map(d=>{let y=d.DiskUsages&&d.DiskUsages.DiskUsage?d.DiskUsages.DiskUsage.map(l=>({...l,InUse:l.InUse*1024,Total:(l.InUse+l.Available)*1024,PercentUsed:100-l.PercentAvailable})):[];return{Name:d.Name,NetAddress:d.NetAddress,Description:d.Description,DiskUsages:y,mean:(0,qe.mean)(y.filter(l=>!isNaN(l.PercentUsed)),l=>l.PercentUsed),max:(0,qe.max)(y.filter(l=>!isNaN(l.PercentUsed)),l=>l.PercentUsed)}});return{Type:o.Type,Name:o.Name,Description:o.Description,MachineUsages:c,MachineUsagesDescription:c.reduce((d,y)=>d+(y.Description||""),""),mean:(0,qe.mean)(c.filter(d=>!isNaN(d.mean)),d=>d.mean),max:(0,qe.max)(c.filter(d=>!isNaN(d.max)),d=>d.max)}});return{Name:r.Name,Description:r.Description,ComponentUsages:i,ComponentUsagesDescription:i.reduce((o,c)=>o+(c.MachineUsagesDescription||""),""),mean:(0,qe.mean)(i.filter(o=>!isNaN(o.mean)),o=>o.mean),max:(0,qe.max)(i.filter(o=>!isNaN(o.max)),o=>o.max)}}))}};var Ns=class extends G{constructor(e){super(e,"WsPackageProcess","1.08")}ActivatePackage(e,t){return this._connection.send("ActivatePackage",e,"json",!1,t,"ActivatePackageResponse")}AddPackage(e,t){return this._connection.send("AddPackage",e,"json",!1,t,"AddPackageResponse")}AddPartToPackageMap(e,t){return this._connection.send("AddPartToPackageMap",e,"json",!1,t,"AddPartToPackageMapResponse")}CopyPackageMap(e,t){return this._connection.send("CopyPackageMap",e,"json",!1,t,"CopyPackageMapResponse")}DeActivatePackage(e,t){return this._connection.send("DeActivatePackage",e,"json",!1,t,"DeActivatePackageResponse")}DeletePackage(e,t){return this._connection.send("DeletePackage",e,"json",!1,t,"DeletePackageResponse")}Echo(e,t){return this._connection.send("Echo",e,"json",!1,t,"EchoResponse")}GetPackage(e,t){return this._connection.send("GetPackage",e,"json",!1,t,"GetPackageResponse")}GetPackageMapById(e,t){return this._connection.send("GetPackageMapById",e,"json",!1,t,"GetPackageMapByIdResponse")}GetPackageMapSelectOptions(e,t){return this._connection.send("GetPackageMapSelectOptions",e,"json",!1,t,"GetPackageMapSelectOptionsResponse")}GetPartFromPackageMap(e,t){return this._connection.send("GetPartFromPackageMap",e,"json",!1,t,"GetPartFromPackageMapResponse")}GetQueryFileMapping(e,t){return this._connection.send("GetQueryFileMapping",e,"json",!1,t,"GetQueryFileMappingResponse")}ListPackage(e,t){return this._connection.send("ListPackage",e,"json",!1,t,"ListPackageResponse")}ListPackages(e,t){return this._connection.send("ListPackages",e,"json",!1,t,"ListPackagesResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsPackageProcessPingResponse")}RemovePartFromPackageMap(e,t){return this._connection.send("RemovePartFromPackageMap",e,"json",!1,t,"RemovePartFromPackageMapResponse")}ValidatePackage(e,t){return this._connection.send("ValidatePackage",e,"json",!1,t,"ValidatePackageResponse")}};var kn=class extends Ns{};var Bs=class extends G{constructor(e){super(e,"WsResources","1.01")}Ping(e){return this._connection.send("Ping",e)}ServiceQuery(e){return this._connection.send("ServiceQuery",e)}WebLinksQuery(e){return this._connection.send("WebLinksQuery",e)}};var vn=class extends Bs{};var Vn;(e=>{let n;(r=>(r.ECL="ECL",r.DFU="DFU"))(n=e.WUTypes||={})})(Vn||={});var Qs=class extends G{constructor(e){super(e,"WSSasha","1.01")}ArchiveWU(e,t){return this._connection.send("ArchiveWU",e,"json",!1,t,"ResultResponse")}GetVersion(e,t){return this._connection.send("GetVersion",e,"json",!1,t,"ResultResponse")}ListWU(e,t){return this._connection.send("ListWU",e,"json",!1,t,"ResultResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WSSashaPingResponse")}RestoreWU(e,t){return this._connection.send("RestoreWU",e,"json",!1,t,"ResultResponse")}};var Hn=class extends Qs{};var zr=Ie(jn(),1);var On;(t=>{let n;(d=>(d.ALL="ALL",d.READ="READ",d.WRITE="WRITE",d.HOLD="HOLD",d.SUB="SUB"))(n=t.LockModes||={});let e;(E=>(E.Attach="Attach",E.Detach="Detach",E.State="State",E.Reload="Reload",E.ReloadRetry="ReloadRetry",E.MemLock="MemLock",E.MemUnlock="MemUnlock",E.GetMemLocked="GetMemLocked"))(e=t.RoxieControlCmdType||={})})(On||={});var ks=class extends G{constructor(e){super(e,"WsSMC","1.29")}Activity(e){return this._connection.send("Activity",e,"json",!1,void 0,"ActivityResponse")}BrowseResources(e){return this._connection.send("BrowseResources",e,"json",!1,void 0,"BrowseResourcesResponse")}ClearQueue(e){return this._connection.send("ClearQueue",e,"json",!1,void 0,"SMCQueueResponse")}GetBuildInfo(e){return this._connection.send("GetBuildInfo",e,"json",!1,void 0,"GetBuildInfoResponse")}GetGlobalMetrics(e){return this._connection.send("GetGlobalMetrics",e,"json",!1,void 0,"GetGlobalMetricsResponse")}GetStatusServerInfo(e){return this._connection.send("GetStatusServerInfo",e,"json",!1,void 0,"GetStatusServerInfoResponse")}GetThorQueueAvailability(e){return this._connection.send("GetThorQueueAvailability",e,"json",!1,void 0,"GetThorQueueAvailabilityResponse")}Index(e){return this._connection.send("Index",e,"json",!1,void 0,"SMCIndexResponse")}LockQuery(e){return this._connection.send("LockQuery",e,"json",!1,void 0,"LockQueryResponse")}MoveJobBack(e){return this._connection.send("MoveJobBack",e,"json",!1,void 0,"SMCJobResponse")}MoveJobDown(e){return this._connection.send("MoveJobDown",e,"json",!1,void 0,"SMCJobResponse")}MoveJobFront(e){return this._connection.send("MoveJobFront",e,"json",!1,void 0,"SMCJobResponse")}MoveJobUp(e){return this._connection.send("MoveJobUp",e,"json",!1,void 0,"SMCJobResponse")}NotInCommunityEdition(e){return this._connection.send("NotInCommunityEdition",e,"json",!1,void 0,"NotInCommunityEditionResponse")}PauseQueue(e){return this._connection.send("PauseQueue",e,"json",!1,void 0,"SMCQueueResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsSMCPingResponse")}RecordGlobalMetrics(e){return this._connection.send("RecordGlobalMetrics",e,"json",!1,void 0,"RecordGlobalMetricsResponse")}RemoveJob(e){return this._connection.send("RemoveJob",e,"json",!1,void 0,"SMCJobResponse")}ResumeQueue(e){return this._connection.send("ResumeQueue",e,"json",!1,void 0,"SMCQueueResponse")}RoxieControlCmd(e){return this._connection.send("RoxieControlCmd",e,"json",!1,void 0,"RoxieControlCmdResponse")}RoxieXrefCmd(e){return this._connection.send("RoxieXrefCmd",e,"json",!1,void 0,"RoxieXrefCmdResponse")}SetBanner(e){return this._connection.send("SetBanner",e,"json",!1,void 0,"SetBannerResponse")}SetJobPriority(e){return this._connection.send("SetJobPriority",e,"json",!1,void 0,"SMCPriorityResponse")}StopQueue(e){return this._connection.send("StopQueue",e,"json",!1,void 0,"SMCQueueResponse")}};var Lo=(0,zr.timeParse)("%Y%m%d%H");function Go(n){return typeof n=="number"||typeof n=="string"&&n.trim()!==""&&!isNaN(+n)}var Ct=class extends ks{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(t=>({Running:{ActiveWorkunit:[]},...t}))}parseGlobalMetric(e,t){return e.startsWith("Cost")?+t/1e6:e.startsWith("Date")?Lo(t):e.startsWith("Num")?+t:e.startsWith("Time")?+t/1e9:e.startsWith("When")?new Date(+t/1e3).toISOString():Go(t)?+t:t}GetNormalisedGlobalMetrics(e){return super.GetGlobalMetrics(e).then(t=>{let s=[];for(let r of t?.GlobalMetrics?.GlobalMetric||[]){let i={Category:r.Category,Start:this.parseGlobalMetric("Date",r.DateTimeRange?.Start),End:this.parseGlobalMetric("Date",r.DateTimeRange?.End),dimensions:{},stats:{}};for(let o of r.Dimensions?.Dimension||[])i.dimensions[o.Name]=o.Value;for(let o of r.Stats?.Stat||[])i.stats[o.Name]=this.parseGlobalMetric(o.Name,o.Value);s.push(i)}return s})}};var vs=class extends G{constructor(e){super(e,"wsstore","1.02")}CreateStore(e,t){return this._connection.send("CreateStore",e,"json",!1,t,"CreateStoreResponse")}Delete(e,t){return this._connection.send("Delete",e,"json",!1,t,"DeleteResponse")}DeleteNamespace(e,t){return this._connection.send("DeleteNamespace",e,"json",!1,t,"DeleteNamespaceResponse")}Fetch(e,t){return this._connection.send("Fetch",e,"json",!1,t,"FetchResponse")}FetchAll(e,t){return this._connection.send("FetchAll",e,"json",!1,t,"FetchAllResponse")}FetchKeyMetadata(e,t){return this._connection.send("FetchKeyMetadata",e,"json",!1,t,"FetchKeyMDResponse")}ListKeys(e,t){return this._connection.send("ListKeys",e,"json",!1,t,"ListKeysResponse")}ListNamespaces(e,t){return this._connection.send("ListNamespaces",e,"json",!1,t,"ListNamespacesResponse")}ListStores(e,t){return this._connection.send("ListStores",e,"json",!1,t,"ListStoresResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"wsstorePingResponse")}Set(e,t){return this._connection.send("Set",e,"json",!1,t,"SetResponse")}};var Rt=class extends vs{Delete(e){return super.Delete(e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(s=>s.Code===-1))return{Exceptions:void 0,Success:!0};throw t})}Fetch(e){return super.Fetch(e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(s=>s.Code===-1))return{Exceptions:void 0,Value:void 0};throw t})}};var _n;(s=>{let n;(o=>(o.XML="XML",o.YAML="YAML"))(n=s.TpConfigResponseFormat||={});let e;(c=>(c.All="All",c.QueriesOnly="QueriesOnly",c.WorkunitsOnly="WorkunitsOnly"))(e=s.RoxieQueueFilter||={});let t;(w=>(w.ALLNODES="ALLNODES",w.THORMACHINES="THORMACHINES",w.HOLEMACHINES="HOLEMACHINES",w.ROXIEMACHINES="ROXIEMACHINES",w.MACHINES="MACHINES",w.AVAILABLEMACHINES="AVAILABLEMACHINES",w.DROPZONE="DROPZONE",w.STANDBYNNODE="STANDBYNNODE",w.THORSPARENODES="THORSPARENODES",w.HOLESTANDBYNODES="HOLESTANDBYNODES"))(t=s.TpMachineType||={})})(_n||={});var Vs=class extends G{constructor(e){super(e,"WsTopology","1.33")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsTopologyPingResponse")}SystemLog(e,t){return this._connection.send("SystemLog",e,"json",!1,t,"SystemLogResponse")}TpClusterInfo(e,t){return this._connection.send("TpClusterInfo",e,"json",!1,t,"TpClusterInfoResponse")}TpClusterQuery(e,t){return this._connection.send("TpClusterQuery",e,"json",!1,t,"TpClusterQueryResponse")}TpComponentConfiguration(e,t){return this._connection.send("TpComponentConfiguration",e,"json",!1,t,"TpComponentConfigurationResponse")}TpConfiguredComponents(e,t){return this._connection.send("TpConfiguredComponents",e,"json",!1,t,"TpConfiguredComponentsResponse")}TpDropZoneQuery(e,t){return this._connection.send("TpDropZoneQuery",e,"json",!1,t,"TpDropZoneQueryResponse")}TpGetComponentFile(e,t){return this._connection.send("TpGetComponentFile",e,"json",!1,t,"TpGetComponentFileResponse")}TpGetServicePlugins(e,t){return this._connection.send("TpGetServicePlugins",e,"json",!1,t,"TpGetServicePluginsResponse")}TpGroupQuery(e,t){return this._connection.send("TpGroupQuery",e,"json",!1,t,"TpGroupQueryResponse")}TpListLogFiles(e,t){return this._connection.send("TpListLogFiles",e,"json",!1,t,"TpListLogFilesResponse")}TpListTargetClusters(e,t){return this._connection.send("TpListTargetClusters",e,"json",!1,t,"TpListTargetClustersResponse")}TpLogFile(e,t){return this._connection.send("TpLogFile",e,"json",!1,t,"TpLogFileResponse")}TpLogFileDisplay(e,t){return this._connection.send("TpLogFileDisplay",e,"json",!1,t,"TpLogFileResponse")}TpLogicalClusterQuery(e,t){return this._connection.send("TpLogicalClusterQuery",e,"json",!1,t,"TpLogicalClusterQueryResponse")}TpMachineInfo(e,t){return this._connection.send("TpMachineInfo",e,"json",!1,t,"TpMachineInfoResponse")}TpMachineQuery(e,t){return this._connection.send("TpMachineQuery",e,"json",!1,t,"TpMachineQueryResponse")}TpServiceQuery(e,t){return this._connection.send("TpServiceQuery",e,"json",!1,t,"TpServiceQueryResponse")}TpSetMachineStatus(e,t){return this._connection.send("TpSetMachineStatus",e,"json",!1,t,"TpSetMachineStatusResponse")}TpSwapNode(e,t){return this._connection.send("TpSwapNode",e,"json",!1,t,"TpSwapNodeResponse")}TpTargetClusterQuery(e,t){return this._connection.send("TpTargetClusterQuery",e,"json",!1,t,"TpTargetClusterQueryResponse")}TpThorStatus(e,t){return this._connection.send("TpThorStatus",e,"json",!1,t,"TpThorStatusResponse")}TpXMLFile(e,t){return this._connection.send("TpXMLFile",e,"json",!1,t,"TpXMLFileResponse")}};var oe=class extends Vs{connectionOptions(){return this._connection.opts()}protocol(){return this._connection.opts().baseUrl.split("//")[0]}ip(){return this._connection.opts().baseUrl.split("//")[1].split(":")[0]}DefaultTpLogicalClusterQuery(e={}){return this.TpLogicalClusterQuery(e).then(t=>{if(t.default)return t.default;let s,r;return t.TpLogicalClusters.TpLogicalCluster.some((i,o)=>(o===0&&(r=i),i.Type==="hthor"?(s=i,!0):!1)),s||r})}};var Hs=require("@hpcc-js/util");var de;(B=>{let n;(_=>(_.Abort="Abort",_.Delete="Delete",_.Deschedule="Deschedule",_.Reschedule="Reschedule",_.Pause="Pause",_.PauseNow="PauseNow",_.Protect="Protect",_.Unprotect="Unprotect",_.Restore="Restore",_.Resume="Resume",_.SetToFailed="SetToFailed",_.Archive="Archive"))(n=B.ECLWUActions||={});let e;(j=>(j[j.MIN=0]="MIN",j[j.DEFAULT=1]="DEFAULT",j[j.ALL=2]="ALL",j[j.CUSTOM=3]="CUSTOM"))(e=B.LogSelectColumnMode||={});let t;(P=>(P[P.ASC=0]="ASC",P[P.DSC=1]="DSC"))(t=B.SortDirection||={});let s;(N=>(N.ALL="ALL",N.DIS="DIS",N.ERR="ERR",N.WRN="WRN",N.INF="INF",N.PRO="PRO",N.MET="MET",N.EVT="EVT"))(s=B.LogEventClass||={});let r;(F=>(F.Single="Single",F.List="List",F.Multi="Multi"))(r=B.WUDetailsAttrValueType||={});let i;(F=>(F.SyntaxCheck="SyntaxCheck",F.Deploy="Deploy",F.Publish="Publish"))(i=B.EclDefinitionActions||={});let o;(F=>(F.xml="xml",F.json="json",F.text="text"))(o=B.ErrorMessageFormat||={});let c;(F=>(F[F.XML=0]="XML",F[F.JSON=1]="JSON",F[F.CSV=2]="CSV"))(c=B.LogAccessLogFormat||={});let d;(j=>(j.info="info",j.warning="warning",j.error="error",j.alert="alert"))(d=B.WUExceptionSeverity||={});let y;(D=>(D.Allqueries="All queries",D.Notsuspended="Not suspended",D.Suspended="Suspended",D.Suspendedbyuser="Suspended by user",D.Suspendedbyfirstnode="Suspended by first node",D.Suspendedbyanynode="Suspended by any node"))(y=B.WUQueryFilterSuspendedType||={});let l;(ce=>(ce.All="All",ce.Id="Id",ce.Name="Name",ce.Alias="Alias",ce.Status="Status"))(l=B.WUQuerySetFilterType||={});let E;(F=>(F.All="All",F.Protected="Protected",F.NotProtected="NotProtected"))(E=B.WUProtectFilter||={});let R;(k=>k.Deactivate="Deactivate")(R=B.QuerySetAliasActionTypes||={});let M;(P=>(P.None="None",P.ActivateImportedActive="ActivateImportedActive"))(M=B.QuerysetImportActivation||={});let w;(N=>(N.Suspend="Suspend",N.Unsuspend="Unsuspend",N.ToggleSuspend="ToggleSuspend",N.Activate="Activate",N.Delete="Delete",N.DeleteQueriesAndWUs="DeleteQueriesAndWUs",N.RemoveAllAliases="RemoveAllAliases",N.ResetQueryStats="ResetQueryStats"))(w=B.QuerySetQueryActionTypes||={});let V;(j=>(j[j.DoNotActivateQuery=0]="DoNotActivateQuery",j[j.ActivateQuery=1]="ActivateQuery",j[j.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",j[j.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious"))(V=B.WUQueryActivationMode||={})})(de||={});var Lt=class extends G{constructor(e){super(e,"WsWorkunits","2.08")}GVCAjaxGraph(e,t){return this._connection.send("GVCAjaxGraph",e,"json",!1,t,"GVCAjaxGraphResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsWorkunitsPingResponse")}WUAbort(e,t){return this._connection.send("WUAbort",e,"json",!1,t,"WUAbortResponse")}WUAction(e,t){return this._connection.send("WUAction",e,"json",!1,t,"WUActionResponse")}WUAddLocalFileToWorkunit(e,t){return this._connection.send("WUAddLocalFileToWorkunit",e,"json",!1,t,"WUAddLocalFileToWorkunitResponse")}WUAnalyseHotspot(e,t){return this._connection.send("WUAnalyseHotspot",e,"json",!1,t,"WUAnalyseHotspotResponse")}WUCDebug(e,t){return this._connection.send("WUCDebug",e,"json",!1,t,"WUDebugResponse")}WUCheckFeatures(e,t){return this._connection.send("WUCheckFeatures",e,"json",!1,t,"WUCheckFeaturesResponse")}WUClusterJobQueueLOG(e,t){return this._connection.send("WUClusterJobQueueLOG",e,"json",!1,t,"WUClusterJobQueueLOGResponse")}WUClusterJobQueueXLS(e,t){return this._connection.send("WUClusterJobQueueXLS",e,"json",!1,t,"WUClusterJobQueueXLSResponse")}WUClusterJobSummaryXLS(e,t){return this._connection.send("WUClusterJobSummaryXLS",e,"json",!1,t,"WUClusterJobSummaryXLSResponse")}WUClusterJobXLS(e,t){return this._connection.send("WUClusterJobXLS",e,"json",!1,t,"WUClusterJobXLSResponse")}WUCompileECL(e,t){return this._connection.send("WUCompileECL",e,"json",!1,t,"WUCompileECLResponse")}WUCopyLogicalFiles(e,t){return this._connection.send("WUCopyLogicalFiles",e,"json",!1,t,"WUCopyLogicalFilesResponse")}WUCopyQuerySet(e,t){return this._connection.send("WUCopyQuerySet",e,"json",!1,t,"WUCopyQuerySetResponse")}WUCreate(e,t){return this._connection.send("WUCreate",e,"json",!1,t,"WUCreateResponse")}WUCreateAndUpdate(e,t){return this._connection.send("WUCreateAndUpdate",e,"json",!1,t,"WUUpdateResponse")}WUCreateZAPInfo(e,t){return this._connection.send("WUCreateZAPInfo",e,"json",!1,t,"WUCreateZAPInfoResponse")}WUDelete(e,t){return this._connection.send("WUDelete",e,"json",!1,t,"WUDeleteResponse")}WUDeployWorkunit(e,t){return this._connection.send("WUDeployWorkunit",e,"json",!1,t,"WUDeployWorkunitResponse")}WUDetails(e,t){return this._connection.send("WUDetails",e,"json",!1,t,"WUDetailsResponse")}WUDetailsMeta(e,t){return this._connection.send("WUDetailsMeta",e,"json",!1,t,"WUDetailsMetaResponse")}WUEclDefinitionAction(e,t){return this._connection.send("WUEclDefinitionAction",e,"json",!1,t,"WUEclDefinitionActionResponse")}WUExport(e,t){return this._connection.send("WUExport",e,"json",!1,t,"WUExportResponse")}WUFile(e,t){return this._connection.send("WUFile",e,"json",!1,t,"WULogFileResponse")}WUFullResult(e,t){return this._connection.send("WUFullResult",e,"json",!1,t,"WUFullResultResponse")}WUGVCGraphInfo(e,t){return this._connection.send("WUGVCGraphInfo",e,"json",!1,t,"WUGVCGraphInfoResponse")}WUGetArchiveFile(e,t){return this._connection.send("WUGetArchiveFile",e,"json",!1,t,"WUGetArchiveFileResponse")}WUGetDependancyTrees(e,t){return this._connection.send("WUGetDependancyTrees",e,"json",!1,t,"WUGetDependancyTreesResponse")}WUGetGraph(e,t){return this._connection.send("WUGetGraph",e,"json",!1,t,"WUGetGraphResponse")}WUGetGraphNameAndTypes(e,t){return this._connection.send("WUGetGraphNameAndTypes",e,"json",!1,t,"WUGetGraphNameAndTypesResponse")}WUGetNumFileToCopy(e,t){return this._connection.send("WUGetNumFileToCopy",e,"json",!1,t,"WUGetNumFileToCopyResponse")}WUGetPlugins(e,t){return this._connection.send("WUGetPlugins",e,"json",!1,t,"WUGetPluginsResponse")}WUGetStats(e,t){return this._connection.send("WUGetStats",e,"json",!1,t,"WUGetStatsResponse")}WUGetThorJobList(e,t){return this._connection.send("WUGetThorJobList",e,"json",!1,t,"WUGetThorJobListResponse")}WUGetThorJobQueue(e,t){return this._connection.send("WUGetThorJobQueue",e,"json",!1,t,"WUGetThorJobQueueResponse")}WUGetZAPInfo(e,t){return this._connection.send("WUGetZAPInfo",e,"json",!1,t,"WUGetZAPInfoResponse")}WUGraphInfo(e,t){return this._connection.send("WUGraphInfo",e,"json",!1,t,"WUGraphInfoResponse")}WUGraphTiming(e,t){return this._connection.send("WUGraphTiming",e,"json",!1,t,"WUGraphTimingResponse")}WUInfo(e,t){return this._connection.send("WUInfo",e,"json",!1,t,"WUInfoResponse")}WUInfoDetails(e,t){return this._connection.send("WUInfoDetails",e,"json",!1,t,"WUInfoResponse")}WUJobList(e,t){return this._connection.send("WUJobList",e,"json",!1,t,"WUJobListResponse")}WULightWeightQuery(e,t){return this._connection.send("WULightWeightQuery",e,"json",!1,t,"WULightWeightQueryResponse")}WUListArchiveFiles(e,t){return this._connection.send("WUListArchiveFiles",e,"json",!1,t,"WUListArchiveFilesResponse")}WUListLocalFileRequired(e,t){return this._connection.send("WUListLocalFileRequired",e,"json",!1,t,"WUListLocalFileRequiredResponse")}WUListQueries(e,t){return this._connection.send("WUListQueries",e,"json",!1,t,"WUListQueriesResponse")}WUListQueriesUsingFile(e,t){return this._connection.send("WUListQueriesUsingFile",e,"json",!1,t,"WUListQueriesUsingFileResponse")}WUMultiQuerysetDetails(e,t){return this._connection.send("WUMultiQuerysetDetails",e,"json",!1,t,"WUMultiQuerySetDetailsResponse")}WUProcessGraph(e,t){return this._connection.send("WUProcessGraph",e,"json",!1,t,"WUProcessGraphResponse")}WUProtect(e,t){return this._connection.send("WUProtect",e,"json",!1,t,"WUProtectResponse")}WUPublishWorkunit(e,t){return this._connection.send("WUPublishWorkunit",e,"json",!1,t,"WUPublishWorkunitResponse")}WUPushEvent(e,t){return this._connection.send("WUPushEvent",e,"json",!1,t,"WUPushEventResponse")}WUQuery(e,t){return this._connection.send("WUQuery",e,"json",!1,t,"WUQueryResponse")}WUQueryConfig(e,t){return this._connection.send("WUQueryConfig",e,"json",!1,t,"WUQueryConfigResponse")}WUQueryDetails(e,t){return this._connection.send("WUQueryDetails",e,"json",!1,t,"WUQueryDetailsResponse")}WUQueryDetailsLightWeight(e,t){return this._connection.send("WUQueryDetailsLightWeight",e,"json",!1,t,"WUQueryDetailsResponse")}WUQueryFiles(e,t){return this._connection.send("WUQueryFiles",e,"json",!1,t,"WUQueryFilesResponse")}WUQueryGetGraph(e,t){return this._connection.send("WUQueryGetGraph",e,"json",!1,t,"WUQueryGetGraphResponse")}WUQueryGetSummaryStats(e,t){return this._connection.send("WUQueryGetSummaryStats",e,"json",!1,t,"WUQueryGetSummaryStatsResponse")}WUQuerysetAliasAction(e,t){return this._connection.send("WUQuerysetAliasAction",e,"json",!1,t,"WUQuerySetAliasActionResponse")}WUQuerysetCopyQuery(e,t){return this._connection.send("WUQuerysetCopyQuery",e,"json",!1,t,"WUQuerySetCopyQueryResponse")}WUQuerysetDetails(e,t){return this._connection.send("WUQuerysetDetails",e,"json",!1,t,"WUQuerySetDetailsResponse")}WUQuerysetExport(e,t){return this._connection.send("WUQuerysetExport",e,"json",!1,t,"WUQuerysetExportResponse")}WUQuerysetImport(e,t){return this._connection.send("WUQuerysetImport",e,"json",!1,t,"WUQuerysetImportResponse")}WUQuerysetQueryAction(e,t){return this._connection.send("WUQuerysetQueryAction",e,"json",!1,t,"WUQuerySetQueryActionResponse")}WUQuerysets(e,t){return this._connection.send("WUQuerysets",e,"json",!1,t,"WUQuerysetsResponse")}WURecreateQuery(e,t){return this._connection.send("WURecreateQuery",e,"json",!1,t,"WURecreateQueryResponse")}WUResubmit(e,t){return this._connection.send("WUResubmit",e,"json",!1,t,"WUResubmitResponse")}WUResult(e,t){return this._connection.send("WUResult",e,"json",!1,t,"WUResultResponse")}WUResultBin(e,t){return this._connection.send("WUResultBin",e,"json",!1,t,"WUResultBinResponse")}WUResultSummary(e,t){return this._connection.send("WUResultSummary",e,"json",!1,t,"WUResultSummaryResponse")}WUResultView(e,t){return this._connection.send("WUResultView",e,"json",!1,t,"WUResultViewResponse")}WURun(e,t){return this._connection.send("WURun",e,"json",!1,t,"WURunResponse")}WUSchedule(e,t){return this._connection.send("WUSchedule",e,"json",!1,t,"WUScheduleResponse")}WUShowScheduled(e,t){return this._connection.send("WUShowScheduled",e,"json",!1,t,"WUShowScheduledResponse")}WUSubmit(e,t){return this._connection.send("WUSubmit",e,"json",!1,t,"WUSubmitResponse")}WUSyntaxCheckECL(e,t){return this._connection.send("WUSyntaxCheckECL",e,"json",!1,t,"WUSyntaxCheckResponse")}WUUpdate(e,t){return this._connection.send("WUUpdate",e,"json",!1,t,"WUUpdateResponse")}WUUpdateQueryEntry(e,t){return this._connection.send("WUUpdateQueryEntry",e,"json",!1,t,"WUUpdateQueryEntryResponse")}WUWaitCompiled(e,t){return this._connection.send("WUWaitCompiled",e,"json",!1,t,"WUWaitResponse")}WUWaitComplete(e,t){return this._connection.send("WUWaitComplete",e,"json",!1,t,"WUWaitResponse")}};var js=(P=>(P[P.Unknown=0]="Unknown",P[P.Compiled=1]="Compiled",P[P.Running=2]="Running",P[P.Completed=3]="Completed",P[P.Failed=4]="Failed",P[P.Archived=5]="Archived",P[P.Aborting=6]="Aborting",P[P.Aborted=7]="Aborted",P[P.Blocked=8]="Blocked",P[P.Submitted=9]="Submitted",P[P.Scheduled=10]="Scheduled",P[P.Compiling=11]="Compiling",P[P.Wait=12]="Wait",P[P.UploadingFiled=13]="UploadingFiled",P[P.DebugPaused=14]="DebugPaused",P[P.DebugRunning=15]="DebugRunning",P[P.Paused=16]="Paused",P[P.LAST=17]="LAST",P[P.NotFound=999]="NotFound",P))(js||{}),ze;(e=>{let n;(R=>(R[R.Unknown=0]="Unknown",R[R.Compile=1]="Compile",R[R.Check=2]="Check",R[R.Run=3]="Run",R[R.ExecuteExisting=4]="ExecuteExisting",R[R.Pause=5]="Pause",R[R.PauseNow=6]="PauseNow",R[R.Resume=7]="Resume",R[R.Debug=8]="Debug",R[R.__size=9]="__size"))(n=e.Action||={})})(ze||={});function Yn(n){return typeof n.Name=="string"}function ko(n){return n.TotalClusterTime!==void 0}function vo(n){return n.StateEx!==void 0}var re=class extends Lt{constructor(e){super(e)}Ping(){return this._connection.send("Ping",{},"json",!1,void 0,"WsWorkunitsPingResponse").then(()=>({result:!0}))}WUQuery(e={},t){return this._connection.send("WUQuery",e,"json",!1,t).then(s=>(0,Hs.deepMixin)({Workunits:{ECLWorkunit:[]}},s))}WUInfo(e){let t={Wuid:"",TruncateEclTo64k:!0,IncludeExceptions:!1,IncludeGraphs:!1,IncludeSourceFiles:!1,IncludeResults:!1,IncludeResultsViewNames:!1,IncludeVariables:!1,IncludeTimers:!1,IncludeDebugValues:!1,IncludeApplicationValues:!1,IncludeWorkflows:!1,IncludeXmlSchemas:!1,IncludeResourceURLs:!1,IncludeECL:!1,IncludeHelpers:!1,IncludeAllowedClusters:!1,IncludeTotalClusterTime:!1,IncludeServiceNames:!1,SuppressResultSchemas:!0,...e};return super.WUInfo(t)}WUCreate(){return super.WUCreate({})}WUUpdate(e){return this._connection.send("WUUpdate",e,"json",!0)}WUResubmit(e){return this._connection.toESPStringArray(e,"Wuids"),super.WUResubmit(e)}WUAction(e){return e.ActionType=e.WUActionType,super.WUAction(e)}WUResult(e,t){return this._connection.send("WUResult",e,"json",!1,t)}WUFileEx(e){return this._connection.send("WUFile",e,"text")}_WUDetailsMetaPromise;WUDetailsMeta(e){return this._WUDetailsMetaPromise||(this._WUDetailsMetaPromise=super.WUDetailsMeta(e)),this._WUDetailsMetaPromise}WUCDebugEx(e){return this._connection.send("WUCDebug",e,void 0,void 0,void 0,"WUDebug").then(t=>{let r=(0,Hs.xml2json)(t.Result).children();return r.length?r[0]:null})}},Gt=class extends Lt{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};var rn=require("@hpcc-js/util");var xe=require("@hpcc-js/util"),ni=Ie(Xn(),1),sn=Ie(jn(),1);var ae=require("@hpcc-js/util"),kt=class extends ae.StateObject{wu;get properties(){return this.get()}get Name(){return this.get("Name")}get Label(){return this.get("Label")}get Type(){return this.get("Type")}get Complete(){return this.get("Complete")}get WhenStarted(){return this.get("WhenStarted")}get WhenFinished(){return this.get("WhenFinished")}get Time(){return this.get("Time")}get Running(){return this.get("Running")}get RunningId(){return this.get("RunningId")}get Failed(){return this.get("Failed")}constructor(e,t,s){super(),this.wu=e;let r=0;for(let i of s)if(i.GraphName===t.Name&&!i.HasSubGraphId){r=Math.round(i.Seconds*1e3)/1e3;break}this.set({Time:r,...t})}fetchScopeGraph(e){return e?this.wu.fetchGraphDetails([e],["subgraph"]).then(t=>Ht(t)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(t=>Ht(t))}},vt=class extends ae.Cache{constructor(){super(e=>ae.Cache.hash([e.Name]))}};function Zr(n,e,t){t=t||[],t.push(n),e(n.name,n.$,n.children(),t),n.children().forEach(s=>{Zr(s,e,t)}),t.pop()}function qn(n){let e={};return n.forEach(t=>{t.name==="att"&&(e[t.$.name]=t.$.value)}),e}var _s=class extends ae.Graph{},zn=class extends ae.Subgraph{},Jn=class extends ae.Vertex{},Kn=class extends ae.Edge{};function tr(n,e){let t={},s={},r={},i=new _s(c=>c._.id),o=[i.root];return Zr(e,(c,d,y,l)=>{let E=o[o.length-1];switch(c){case"graph":break;case"node":if(y.length&&y[0].children().length&&y[0].children()[0].name==="graph"){let w=E.createSubgraph(qn(y));o.push(w),t[d.id]=w}let R=E.createVertex(qn(y));s[d.id]=R;break;case"edge":let M=E.createEdge(s[d.source],s[d.target],qn(y));r[d.id]=M;break;default:}}),i}var Vt=class extends ae.Graph{},Zn=class extends ae.Subgraph{},$n=class extends ae.Vertex{},er=class extends ae.Edge{};function Ht(n){let e={},t={},s={},r;for(let i of n)switch(i.ScopeType){case"graph":r=new Vt(l=>l._.Id,i),e[i.ScopeName]=r.root;break;case"subgraph":r||(r=new Vt(l=>l._.Id,i),e[i.ScopeName]=r.root);let o=i.parentScope().split(":"),c=e[i.parentScope()];for(;o.length&&!c;)c=e[o.join(":")],o.pop();if(!c)console.warn(`Missing SG:Parent (${i.Id}): ${i.parentScope()}`);else{let l=c;e[i.ScopeName]=l.createSubgraph(i)}break;case"activity":let d=e[i.parentScope()];d?s[i.ScopeName]=d.createVertex(i):console.warn(`Missing A:Parent (${i.Id}): ${i.parentScope()}`);break;case"edge":t[i.ScopeName]=i;break;case"function":let y=s[i.parentScope()];y?y._.children().push(i):console.warn(`Missing F:Parent (${i.Id}): ${i.parentScope()}`);break}for(let i in t){let o=t[i],c=e[o.parentScope()];if(!c)console.warn(`Missing E:Parent (${o.Id}): ${o.parentScope()}`);else{let d=c;try{let y=r.vertex(o.attr("IdSource").RawValue),l=r.vertex(o.attr("IdTarget").RawValue);d.createEdge(y,l,o)}catch{console.warn(`Invalid Edge: ${i}`)}}}return r}var $r=require("@hpcc-js/util"),jt=class extends $r.StateObject{wu;get properties(){return this.get()}get URL(){return this.get("URL")}get DisplayName(){return this.get("DisplayName")}get DisplayPath(){return this.get("DisplayPath")}constructor(e,t){super(),this.wu=e;let s=t.split("\\").join("/"),r=s.split("/"),i="res/"+this.wu.Wuid+"/",o="",c="";s.indexOf(i)===0&&(o=s.substr(i.length),c=r[r.length-1]),this.set({URL:t,DisplayName:c,DisplayPath:o})}};var Qe=require("@hpcc-js/util");var qt=require("@hpcc-js/util"),Ot=class{e;constructor(e){this.e=e}fix(){delete this.e}},_t=class extends Ot{name;type;isSet=!1;attrs={};_children=[];constructor(e){super(e)}append(e){this._children.push(e),this.type||(this.type="hpcc:childDataset")}fix(){this.name=this.e.$.name,this.type=this.e.$.type;for(let t=this._children.length-1;t>=0;--t){let s=this._children[t];s.name==="Row"&&s.type===void 0&&(this._children.push(...s._children),this._children.splice(t,1))}let e=this.setOfType();e&&(this.type=e,this.isSet=!0,this._children=[])}children(){return this._children}isAll(e){return e.name==="All"&&e.type===void 0}setOfType(){let e=this.children();if(this.type===void 0&&e.length===2){if(this.isAll(e[0]))return e[1].type;if(this.isAll(e[1]))return e[0].type}}charWidth(){let e=-1;switch(this.type){case"xs:boolean":e=5;break;case"xs:integer":e=8;break;case"xs:nonNegativeInteger":e=8;break;case"xs:double":e=8;break;case"xs:string":e=32;break;default:let t="0123456789",s=this.type.lastIndexOf("_"),r=s>0?s:this.type.length,i=r-1;for(;i>=0&&t.indexOf(this.type.charAt(i))!==-1;--i);i+1<r&&(e=parseInt(this.type.substring(i+1,r),10)),this.type.indexOf("data")===0&&(e*=2);break}return e<this.name.length&&(e=this.name.length),e}},Yt=class extends Ot{name;type;maxLength;_restricition;_maxLength;constructor(e){super(e)}append(e){switch(e.name){case"xs:restriction":this._restricition=e;break;case"xs:maxLength":this._maxLength=e;break;default:}}fix(){this.name=this.e.$.name,this.type=this._restricition.$.base,this.maxLength=this._maxLength?+this._maxLength.$.value:void 0,delete this._restricition,delete this._maxLength,super.fix()}},Xt=class{root;simpleTypes={};fields(){return this.root.children()}},Ys=class extends qt.SAXStackParser{schema=new Xt;simpleType;simpleTypes={};xsdStack=new qt.Stack;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":let t=new _t(e);this.schema.root?this.xsdStack.depth()&&this.xsdStack.top().append(t):this.schema.root=t,this.xsdStack.push(t);break;case"xs:simpleType":this.simpleType=new Yt(e);break;default:break}}endXMLNode(e){switch(e.name){case"xs:element":this.xsdStack.pop().fix();break;case"xs:simpleType":this.simpleType.fix(),this.simpleTypes[this.simpleType.name]=this.simpleType,delete this.simpleType;break;case"xs:appinfo":let s=this.xsdStack.top();for(let r in e.$)s.attrs[r]=e.$[r];break;default:this.simpleType&&this.simpleType.append(e)}super.endXMLNode(e)}};function Xs(n){let e=new Ys;return e.parse(n),e.schema}var sr=class extends Ys{_rootName;schema=new Xt;simpleTypes={};xsdStack=new qt.Stack;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":let t=new _t(e);!this.schema.root&&this._rootName===e.$.name&&(this.schema.root=t),this.xsdStack.depth()&&this.xsdStack.top().append(t),this.xsdStack.push(t);break;case"xsd:simpleType":this.simpleType=new Yt(e);break;default:break}}endXMLNode(e){switch(e.name){case"xsd:element":this.xsdStack.pop().fix();break;case"xsd:simpleType":break;default:break}super.endXMLNode(e)}};function Vo(n,e){let t=new sr(e);return t.parse(n),t.schema}var zs=class extends Qe.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}},qs=new zs,zt=class n extends Qe.StateObject{connection;_bypassCache=!1;get BaseUrl(){return this.connection.baseUrl}xsdSchema;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get ResultName(){return this.get("ResultName")}get ResultSequence(){return this.get("ResultSequence")}get LogicalFileName(){return this.get("LogicalFileName")}get Name(){return this.get("Name")}get Sequence(){return this.get("Sequence")}get Value(){return this.get("Value")}get Link(){return this.get("Link")}get FileName(){return this.get("FileName")}get IsSupplied(){return this.get("IsSupplied")}get ShowFileContent(){return this.get("ShowFileContent")}get Total(){return this.get("Total")}get ECLSchemas(){return this.get("ECLSchemas")}get NodeGroup(){return this.get("NodeGroup")}get ResultViews(){return this.get("ResultViews")}get XmlSchema(){return this.get("XmlSchema")}static attach(e,t,s,r){let i;return Array.isArray(r)?(i=qs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s.Name},()=>new n(e,t,s,r)),i.set(s)):typeof r>"u"&&(typeof s=="number"?i=qs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+s},()=>new n(e,t,s)):typeof s=="string"&&(i=qs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new n(e,t,s)))),i}static attachLogicalFile(e,t,s){return qs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new n(e,t,s,!0))}constructor(e,t,s,r){super(),e instanceof re?this.connection=e:this.connection=new re(e),typeof r=="boolean"&&r===!0?this.set({NodeGroup:t,LogicalFileName:s}):Yn(s)&&Array.isArray(r)?this.set({...s,Wuid:t,ResultName:s.Name,ResultViews:r}):typeof r>"u"?typeof s=="number"?this.set({Wuid:t,ResultSequence:s}):typeof s=="string"?this.set({Wuid:t,ResultName:s}):console.warn("Unknown Result.attach (1)"):console.warn("Unknown Result.attach (2)")}isComplete(){return this.Total!==-1}bypassCache(e){return e===void 0?this._bypassCache:(this._bypassCache=e,this)}_fetchXMLSchemaPromise;fetchXMLSchema(e=!1){return(!this._fetchXMLSchemaPromise||e)&&(this._fetchXMLSchemaPromise=this.WUResult().then(t=>t.Result?.XmlSchema?.xml?(this.xsdSchema=Xs(t.Result.XmlSchema.xml),this.xsdSchema):null)),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(e=0,t=-1,s=!1,r={},i,o){let c=o??this._bypassCache;return this.WUResult(e,t,!s,r,i,c).then(d=>{let y=d.Result;return delete d.Result,this.set({...d}),(0,Qe.exists)("XmlSchema.xml",y)&&(this.xsdSchema=Xs(y.XmlSchema.xml)),(0,Qe.exists)("Row",y)?y.Row:this.ResultName&&(0,Qe.exists)(this.ResultName,y)?y[this.ResultName].Row:[]})}rootField(){return this.xsdSchema?this.xsdSchema.root:null}fields(){return this.xsdSchema?this.xsdSchema.root.children():[]}WUResult(e=0,t=1,s=!1,r={},i,o=!1){let c={NamedValue:{itemcount:0}};for(let y in r)c.NamedValue[c.NamedValue.itemcount++]={Name:y,Value:r[y]};let d={FilterBy:c};return this.Wuid&&this.ResultName!==void 0?(d.Wuid=this.Wuid,d.ResultName=this.ResultName):this.Wuid&&this.ResultSequence!==void 0?(d.Wuid=this.Wuid,d.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(d.LogicalName=this.LogicalFileName,d.Cluster=this.NodeGroup):this.LogicalFileName&&(d.LogicalName=this.LogicalFileName),d.Start=e,d.Count=t,d.SuppressXmlSchema=s,d.BypassCachedResult=o,this.connection.WUResult(d,i).then(y=>y)}},Jt=class extends Qe.Cache{constructor(){super(e=>Qe.Cache.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};var nr=require("@hpcc-js/util"),Je=class extends nr.StateObject{scope;get properties(){return this.get()}get Name(){return this.get("Name")}get RawValue(){return this.get("RawValue")}get Formatted(){return this.get("Formatted")}get FormattedEnd(){return this.get("FormattedEnd")}get Measure(){return this.get("Measure")}get Creator(){return this.get("Creator")}get CreatorType(){return this.get("CreatorType")}constructor(e,t){super(),this.scope=e,this.set(t)}},Js=class extends nr.StateObject{_attributeMap={};_children=[];get properties(){return this.get()}get ScopeName(){return this.get("ScopeName")}get Id(){return this.get("Id")}get ScopeType(){return this.get("ScopeType")}get Properties(){return this.get("Properties",{Property:[]})}get Notes(){return this.get("Notes",{Note:[]})}get SinkActivity(){return this.get("SinkActivity")}get CAttributes(){let e=[],t={start:null,end:null};return this.Properties.Property.forEach(s=>{s.Measure==="ts"&&s.Name.indexOf("Started")>=0?t.start=s:this.ScopeName&&s.Measure==="ts"&&s.Name.indexOf("Finished")>=0?t.end=s:e.push(new Je(this,s))}),t.start&&t.end?(t.start.FormattedEnd=t.end.Formatted,e.push(new Je(this,t.start))):t.start?e.push(new Je(this,t.start)):t.end&&e.push(new Je(this,t.end)),e}constructor(e){super(),this.update(e)}update(e){this.set(e),this.CAttributes.forEach(t=>{this._attributeMap[t.Name]=t}),this.Properties.Property=[];for(let t in this._attributeMap)this._attributeMap.hasOwnProperty(t)&&this.Properties.Property.push(this._attributeMap[t].properties)}parentScope(){let e=this.ScopeName.split(":");return e.pop(),e.join(":")}children(e){return arguments.length?(this._children=e,this):this._children}walk(e){if(e.start(this))return!0;for(let t of this.children())if(t.walk(e))return!0;return e.end(this)}formattedAttrs(){let e={};for(let t in this._attributeMap)e[t]=this._attributeMap[t].Formatted||this._attributeMap[t].RawValue;return e}rawAttrs(){let e={};for(let t in this._attributeMap)e[t]=this._attributeMap[t].RawValue;return e}hasAttr(e){return this._attributeMap[e]!==void 0}attr(e){return this._attributeMap[e]||new Je(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let t=this.Id,s=[];s.push(`<tr><td class="key">ID:</td><td class="value">${this.Id}</td></tr>`),e&&s.push(`<tr><td class="key">Parent ID:</td><td class="value">${e.Id}</td></tr>`),s.push(`<tr><td class="key">Scope:</td><td class="value">${this.ScopeName}</td></tr>`);let r=this.formattedAttrs();for(let i in r)i==="Label"?t=r[i]:s.push(`<tr><td class="key">${i}</td><td class="value">${r[i]}</td></tr>`);return`<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">
910
+ `;var uo="__PACKAGE_NAME__",lo="__PACKAGE_VERSION__",go="__BUILD_VERSION__";var Bt=require("@hpcc-js/util");var de=require("@hpcc-js/util"),Er=(0,de.scopedLogger)("comms/connection.ts");function po(n){return"baseUrl"in n}var mo={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function ho(n){return typeof n.opts=="function"&&typeof n.send=="function"&&typeof n.clone=="function"}function Be(n,e){return e===void 0||e===!0?encodeURIComponent(n):""+n}function _e(n,e=!0,t=""){if(t&&(t+="."),typeof n!="object")return Be(n,e);let s=[];for(let r in n)if(n.hasOwnProperty(r))if(n[r]instanceof Array){let i=!1;n[r].forEach((o,c)=>{typeof o=="object"?(i=!0,s.push(_e(o,e,t+Be(`${r}.${c}`,e)))):s.push(t+Be(`${r}_i${c}`,e)+"="+_e(o,e))}),i&&s.push(t+Be(`${r}.itemcount`,e)+"="+n[r].length)}else typeof n[r]=="object"?n[r]&&n[r].Item instanceof Array?(s.push(_e(n[r].Item,e,t+Be(r,e))),s.push(t+Be(`${r}.itemcount`,e)+"="+n[r].Item.length)):s.push(_e(n[r],e,t+Be(r,e))):n[r]!==void 0?s.push(t+Be(r,e)+"="+Be(n[r],e)):s.push(t+Be(r,e));return s.join("&")}function Fr(n){return JSON.parse(n)}function Ir(n,e,t={},s="json",r){return r&&console.warn("Header attributes ignored for JSONP connections"),new Promise((i,o)=>{let c=n.timeoutSecs*1e3,d=5e3,x="jsonp_callback_"+Math.round(Math.random()*999999);window[x]=function(N){c=0,I(),i(s==="json"&&typeof N=="string"?Fr(N):N)};let l=document.createElement("script"),E=(0,de.join)(n.baseUrl,e);E+=E.indexOf("?")>=0?"&":"?",l.src=E+"jsonp="+x+"&"+_e(t,n.encodeRequest),document.body.appendChild(l);let R=setInterval(function(){c<=0?clearInterval(R):(c-=d,c<=0?(clearInterval(R),Er.error("Request timeout: "+l.src),I(),o(Error("Request timeout: "+l.src))):Er.debug("Request pending ("+c/1e3+" sec): "+l.src))},d);function I(){delete window[x],document.body.removeChild(l)}})}function fo(n){return n.userID?{Authorization:`Basic ${(0,de.utf8ToBase64)(`${n.userID}:${n.password}`)}`}:{}}var fs={};function Pr(n,e,t,s,r){s={...fo(n),...s},t={credentials:fs[n.baseUrl]?"omit":"include",...t,headers:s},n.baseUrl.indexOf("https:")===0&&(n.rejectUnauthorized===!1&&de.root.__hpcc_rejectUnauthorizedAgent?t.dispatcher=de.root.__hpcc_rejectUnauthorizedAgent:de.root.__hpcc_trustwaveAgent&&(t.agent=de.root.__hpcc_trustwaveAgent));function i(c){if(c.ok)return r==="json"?c.json():c.text();throw new Error(c.statusText)}let o=de.root.__hpcc_undiciFetch??fetch;return(0,de.promiseTimeout)(n.timeoutSecs*1e3,o((0,de.join)(n.baseUrl,e),t).then(i).catch(c=>(t.credentials=fs[n.baseUrl]?"include":"omit",o((0,de.join)(n.baseUrl,e),t).then(i).then(d=>(fs[n.baseUrl]=!fs[n.baseUrl],d)))))}function Mr(n,e,t,s="json",r){t.upload_&&(delete t.upload_,e+="?upload_");let i;return t.abortSignal_&&(i=t.abortSignal_,delete t.abortSignal_),Pr(n,e,{method:"post",body:_e(t,n.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...r},s)}function Tr(n,e,t,s="json",r){let i;return t.abortSignal_&&(i=t.abortSignal_,delete t.abortSignal_),Pr(n,`${e}?${_e(t,n.encodeRequest)}`,{method:"get",signal:i},{...r},s)}function wr(n,e,t,s="json",r){let i;switch(n.type){case"jsonp":i=Ir(n,e,t,s,r);break;case"get":i=Tr(n,e,t,s,r);break;default:i=Mr(n,e,t,s,r);break}return i}var Ss=wr;function So(n){let e=Ss;return n&&(Ss=n),e}var Ds=class n{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return arguments.length===0?this._opts:(this._opts={...mo,...e},this)}send(e,t,s="json",r){return this._opts.hookSend?this._opts.hookSend(this._opts,e,t,s,Ss,r):Ss(this._opts,e,t,s,r)}clone(){return new n(this.opts())}},Nt=function(n){return new Ds(n)};function Do(n){let e=Nt;return Nt=n,e}function Nr(n){return Object.prototype.toString.call(n)==="[object Array]"}var Ye=class extends Error{isESPExceptions=!0;action;request;Source;Exception;constructor(e,t,s){super("ESPException: "+s.Source),this.action=e,this.request=t,this.Source=s.Source,this.Exception=s.Exception,s.Exception.length?this.message=`${s.Exception[0].Code}: ${s.Exception[0].Message}`:this.message=""}};function Co(n){return n instanceof Ye||n.isESPExceptions&&Array.isArray(n.Exception)}function Ro(n){return n.send!==void 0}var Cs=class n{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,t,s){this._connection=Ro(e)?e:Nt(e),this._service=t,this._version=s}service(e){return e===void 0?this._service:(this._service=e,this)}version(e){return e===void 0?this._version:(this._version=e,this)}toESPStringArray(e,t){if(Nr(e[t])){for(let s=0;s<e[t].length;++s)e[t+"_i"+s]=e[t][s];delete e[t]}return e}opts(e){return e===void 0?this._connection.opts():(this._connection.opts(e),this)}send(e,t={},s="json",r=!1,i,o){let c={...t,ver_:this._version};r&&(c.upload_=!0),i&&(c.abortSignal_=i);let d,x="json";switch(s){case"text":d=(0,Bt.join)(this._service,e),x="text";break;case"xsd":d=(0,Bt.join)(this._service,e+".xsd"),x="text";break;case"json2":d=(0,Bt.join)(this._service,e+"/json"),s="json",e=e.split("/").pop();break;default:d=(0,Bt.join)(this._service,e+".json")}return this._connection.send(d,c,x).then(l=>{if(s==="json"){let E;if(l&&l.Exceptions)throw new Ye(e,c,l.Exceptions);if(l&&(E=l[o||e+"Response"]),!E)throw new Ye(e,c,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return E}return l})}clone(){return new n(this._connection.clone(),this._service,this._version)}},k=class{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,t,s){this._connection=new Cs(e,t,s)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};var St;(t=>{let n;(x=>(x.Delete="Delete",x.Protect="Protect",x.Unprotect="Unprotect",x.Restore="Restore",x.SetToFailed="SetToFailed",x.Archive="Archive"))(n=t.DFUWUActions||={});let e;(N=>(N.copy="copy",N.remove="remove",N.move="move",N.rename="rename",N.replicate="replicate",N.import="import",N.export="export",N.monitor="monitor",N.copymerge="copymerge",N.supercopy="supercopy",N.publish="publish"))(e=t.DFUCommand||={})})(St||={});var Rs=class extends k{constructor(e){super(e,"FileSpray","1.29")}AbortDFUWorkunit(e,t){return this._connection.send("AbortDFUWorkunit",e,"json",!1,t,"AbortDFUWorkunitResponse")}Copy(e,t){return this._connection.send("Copy",e,"json",!1,t,"CopyResponse")}CreateDFUPublisherWorkunit(e,t){return this._connection.send("CreateDFUPublisherWorkunit",e,"json",!1,t,"CreateDFUPublisherWorkunitResponse")}CreateDFUWorkunit(e,t){return this._connection.send("CreateDFUWorkunit",e,"json",!1,t,"CreateDFUWorkunitResponse")}DFUWUFile(e,t){return this._connection.send("DFUWUFile",e,"json",!1,t,"DFUWUFileResponse")}DFUWUSearch(e,t){return this._connection.send("DFUWUSearch",e,"json",!1,t,"DFUWUSearchResponse")}DFUWorkunitsAction(e,t){return this._connection.send("DFUWorkunitsAction",e,"json",!1,t,"DFUWorkunitsActionResponse")}DeleteDFUWorkunit(e,t){return this._connection.send("DeleteDFUWorkunit",e,"json",!1,t,"DeleteDFUWorkunitResponse")}DeleteDFUWorkunits(e,t){return this._connection.send("DeleteDFUWorkunits",e,"json",!1,t,"DeleteDFUWorkunitsResponse")}DeleteDropZoneFiles(e,t){return this._connection.send("DeleteDropZoneFiles",e,"json",!1,t,"DFUWorkunitsActionResponse")}Despray(e,t){return this._connection.send("Despray",e,"json",!1,t,"DesprayResponse")}DfuMonitor(e,t){return this._connection.send("DfuMonitor",e,"json",!1,t,"DfuMonitorResponse")}DropZoneFileSearch(e,t){return this._connection.send("DropZoneFileSearch",e,"json",!1,t,"DropZoneFileSearchResponse")}DropZoneFiles(e,t){return this._connection.send("DropZoneFiles",e,"json",!1,t,"DropZoneFilesResponse")}EchoDateTime(e,t){return this._connection.send("EchoDateTime",e,"json",!1,t,"EchoDateTimeResponse")}FileList(e,t){return this._connection.send("FileList",e,"json",!1,t,"FileListResponse")}GetDFUExceptions(e,t){return this._connection.send("GetDFUExceptions",e,"json",!1,t,"GetDFUExceptionsResponse")}GetDFUProgress(e,t){return this._connection.send("GetDFUProgress",e,"json",!1,t,"ProgressResponse")}GetDFUServerQueues(e,t){return this._connection.send("GetDFUServerQueues",e,"json",!1,t,"GetDFUServerQueuesResponse")}GetDFUWorkunit(e,t){return this._connection.send("GetDFUWorkunit",e,"json",!1,t,"GetDFUWorkunitResponse")}GetDFUWorkunits(e,t){return this._connection.send("GetDFUWorkunits",e,"json",!1,t,"GetDFUWorkunitsResponse")}GetRemoteTargets(e,t){return this._connection.send("GetRemoteTargets",e,"json",!1,t,"GetRemoteTargetsResponse")}GetSprayTargets(e,t){return this._connection.send("GetSprayTargets",e,"json",!1,t,"GetSprayTargetsResponse")}OpenSave(e,t){return this._connection.send("OpenSave",e,"json",!1,t,"OpenSaveResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"FileSprayPingResponse")}Rename(e,t){return this._connection.send("Rename",e,"json",!1,t,"RenameResponse")}Replicate(e,t){return this._connection.send("Replicate",e,"json",!1,t,"ReplicateResponse")}ShowResult(e,t){return this._connection.send("ShowResult",e,"json",!1,t,"ShowResultResponse")}SprayFixed(e,t){return this._connection.send("SprayFixed",e,"json",!1,t,"SprayFixedResponse")}SprayVariable(e,t){return this._connection.send("SprayVariable",e,"json",!1,t,"SprayResponse")}SubmitDFUWorkunit(e,t){return this._connection.send("SubmitDFUWorkunit",e,"json",!1,t,"SubmitDFUWorkunitResponse")}UpdateDFUWorkunit(e,t){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,t,"UpdateDFUWorkunitResponse")}};var Br=(l=>(l[l.unknown=0]="unknown",l[l.scheduled=1]="scheduled",l[l.queued=2]="queued",l[l.started=3]="started",l[l.aborted=4]="aborted",l[l.failed=5]="failed",l[l.finished=6]="finished",l[l.monitoring=7]="monitoring",l[l.aborting=8]="aborting",l[l.notfound=999]="notfound",l))(Br||{}),Xe=class extends Rs{DFUWUFileEx(e){return this._connection.send("DFUWUFile",e,"text")}SprayFixedEx(e){return this._connection.send("SprayFixed",e)}SprayVariableEx(e){return this._connection.send("SprayVariable",e,"json",!1,null,"SprayResponse")}DesprayEx(e){return this._connection.send("Despray",e)}UpdateDFUWorkunitEx(e){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,void 0,"UpdateDFUWorkunitResponse")}};var In;(o=>{let n;(x=>(x.User="User",x.Group="Group"))(n=o.ViewMemberType||={});let e;(R=>(R.username="username",R.fullname="fullname",R.passwordexpiration="passwordexpiration",R.employeeID="employeeID",R.employeeNumber="employeeNumber"))(e=o.UserSortBy||={});let t;(x=>(x.Name="Name",x.ManagedBy="ManagedBy"))(t=o.GroupSortBy||={});let s;(l=>(l.Any="Any",l.User="User",l.Group="Group"))(s=o.AccountTypeReq||={});let r;(x=>(x.Name="Name",x.Type="Type"))(r=o.ResourcePermissionSortBy||={});let i;(d=>d.Name="Name")(i=o.ResourceSortBy||={})})(In||={});var As=class extends k{constructor(e){super(e,"ws_access","1.17")}AccountPermissions(e,t){return this._connection.send("AccountPermissions",e,"json",!1,t,"AccountPermissionsResponse")}AccountPermissionsV2(e,t){return this._connection.send("AccountPermissionsV2",e,"json",!1,t,"AccountPermissionsV2Response")}AddUser(e,t){return this._connection.send("AddUser",e,"json",!1,t,"AddUserResponse")}AddView(e,t){return this._connection.send("AddView",e,"json",!1,t,"AddViewResponse")}AddViewColumn(e,t){return this._connection.send("AddViewColumn",e,"json",!1,t,"AddViewColumnResponse")}AddViewMember(e,t){return this._connection.send("AddViewMember",e,"json",!1,t,"AddViewMemberResponse")}ClearPermissionsCache(e,t){return this._connection.send("ClearPermissionsCache",e,"json",!1,t,"ClearPermissionsCacheResponse")}DeleteView(e,t){return this._connection.send("DeleteView",e,"json",!1,t,"DeleteViewResponse")}DeleteViewColumn(e,t){return this._connection.send("DeleteViewColumn",e,"json",!1,t,"DeleteViewColumnResponse")}DeleteViewMember(e,t){return this._connection.send("DeleteViewMember",e,"json",!1,t,"DeleteViewMemberResponse")}DisableScopeScans(e,t){return this._connection.send("DisableScopeScans",e,"json",!1,t,"DisableScopeScansResponse")}EnableScopeScans(e,t){return this._connection.send("EnableScopeScans",e,"json",!1,t,"EnableScopeScansResponse")}FilePermission(e,t){return this._connection.send("FilePermission",e,"json",!1,t,"FilePermissionResponse")}GroupAction(e,t){return this._connection.send("GroupAction",e,"json",!1,t,"GroupActionResponse")}GroupAdd(e,t){return this._connection.send("GroupAdd",e,"json",!1,t,"GroupAddResponse")}GroupEdit(e,t){return this._connection.send("GroupEdit",e,"json",!1,t,"GroupEditResponse")}GroupMemberEdit(e,t){return this._connection.send("GroupMemberEdit",e,"json",!1,t,"GroupMemberEditResponse")}GroupMemberEditInput(e,t){return this._connection.send("GroupMemberEditInput",e,"json",!1,t,"GroupMemberEditInputResponse")}GroupMemberQuery(e,t){return this._connection.send("GroupMemberQuery",e,"json",!1,t,"GroupMemberQueryResponse")}GroupQuery(e,t){return this._connection.send("GroupQuery",e,"json",!1,t,"GroupQueryResponse")}Groups(e,t){return this._connection.send("Groups",e,"json",!1,t,"GroupResponse")}PermissionAction(e,t){return this._connection.send("PermissionAction",e,"json",!1,t,"PermissionActionResponse")}Permissions(e,t){return this._connection.send("Permissions",e,"json",!1,t,"BasednsResponse")}PermissionsReset(e,t){return this._connection.send("PermissionsReset",e,"json",!1,t,"PermissionsResetResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_accessPingResponse")}QueryScopeScansEnabled(e,t){return this._connection.send("QueryScopeScansEnabled",e,"json",!1,t,"QueryScopeScansEnabledResponse")}QueryUserViewColumns(e,t){return this._connection.send("QueryUserViewColumns",e,"json",!1,t,"QueryUserViewColumnsResponse")}QueryViewColumns(e,t){return this._connection.send("QueryViewColumns",e,"json",!1,t,"QueryViewColumnsResponse")}QueryViewMembers(e,t){return this._connection.send("QueryViewMembers",e,"json",!1,t,"QueryViewMembersResponse")}QueryViews(e,t){return this._connection.send("QueryViews",e,"json",!1,t,"QueryViewsResponse")}ResourceAdd(e,t){return this._connection.send("ResourceAdd",e,"json",!1,t,"ResourceAddResponse")}ResourceDelete(e,t){return this._connection.send("ResourceDelete",e,"json",!1,t,"ResourceDeleteResponse")}ResourcePermissionQuery(e,t){return this._connection.send("ResourcePermissionQuery",e,"json",!1,t,"ResourcePermissionQueryResponse")}ResourcePermissions(e,t){return this._connection.send("ResourcePermissions",e,"json",!1,t,"ResourcePermissionsResponse")}ResourceQuery(e,t){return this._connection.send("ResourceQuery",e,"json",!1,t,"ResourceQueryResponse")}Resources(e,t){return this._connection.send("Resources",e,"json",!1,t,"ResourcesResponse")}UserAccountExport(e,t){return this._connection.send("UserAccountExport",e,"json",!1,t,"UserAccountExportResponse")}UserAction(e,t){return this._connection.send("UserAction",e,"json",!1,t,"UserActionResponse")}UserEdit(e,t){return this._connection.send("UserEdit",e,"json",!1,t,"UserEditResponse")}UserGroupEdit(e,t){return this._connection.send("UserGroupEdit",e,"json",!1,t,"UserGroupEditResponse")}UserGroupEditInput(e,t){return this._connection.send("UserGroupEditInput",e,"json",!1,t,"UserGroupEditInputResponse")}UserInfoEdit(e,t){return this._connection.send("UserInfoEdit",e,"json",!1,t,"UserInfoEditResponse")}UserInfoEditInput(e,t){return this._connection.send("UserInfoEditInput",e,"json",!1,t,"UserInfoEditInputResponse")}UserPosix(e,t){return this._connection.send("UserPosix",e,"json",!1,t,"UserPosixResponse")}UserPosixInput(e,t){return this._connection.send("UserPosixInput",e,"json",!1,t,"UserPosixInputResponse")}UserQuery(e,t){return this._connection.send("UserQuery",e,"json",!1,t,"UserQueryResponse")}UserResetPass(e,t){return this._connection.send("UserResetPass",e,"json",!1,t,"UserResetPassResponse")}UserResetPassInput(e,t){return this._connection.send("UserResetPassInput",e,"json",!1,t,"UserResetPassInputResponse")}UserSudoers(e,t){return this._connection.send("UserSudoers",e,"json",!1,t,"UserSudoersResponse")}UserSudoersInput(e,t){return this._connection.send("UserSudoersInput",e,"json",!1,t,"UserSudoersInputResponse")}Users(e,t){return this._connection.send("Users",e,"json",!1,t,"UserResponse")}};var Pn=class extends As{};var xs=class extends k{constructor(e){super(e,"ws_account","1.07")}MyAccount(e,t){return this._connection.send("MyAccount",e,"json",!1,t,"MyAccountResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_accountPingResponse")}UpdateUser(e,t){return this._connection.send("UpdateUser",e,"json",!1,t,"UpdateUserResponse")}UpdateUserInput(e,t){return this._connection.send("UpdateUserInput",e,"json",!1,t,"UpdateUserInputResponse")}VerifyUser(e,t){return this._connection.send("VerifyUser",e,"json",!1,t,"VerifyUserResponse")}};var Mn=class extends xs{VerifyUser(e){return this._connection.send("VerifyUser",e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(s=>s.Code===20043))return{retcode:20043,Exceptions:{Source:"wsAccount",Exception:t.Exception}};throw t})}};var Qr=require("@hpcc-js/util");var ys=class extends k{constructor(e){super(e,"WsCloud","1.02")}GetPODs(e,t){return this._connection.send("GetPODs",e,"json",!1,t,"GetPODsResponse")}GetServices(e,t){return this._connection.send("GetServices",e,"json",!1,t,"GetServicesResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsCloudPingResponse")}};var Ao=(0,Qr.scopedLogger)("@hpcc-js/comms/services/wsCloud.ts");function xo(n){return n?.Pods!==void 0}function yo(n){return n.spec?.containers?.reduce((e,t)=>(t.ports?.forEach(s=>{e.push({ContainerPort:s.containerPort,Name:s.name,Protocol:s.protocol})}),e),[])??[]}function Wo(n){return n.filter(e=>{let t=e?.metadata?.labels??{};return t.hasOwnProperty("app.kubernetes.io/part-of")&&t["app.kubernetes.io/part-of"]==="HPCC-Platform"}).map(e=>{let t=new Date(e.metadata?.creationTimestamp);return{Name:e.metadata.name,Status:e.status?.phase,CreationTimestamp:t.toISOString(),ContainerName:e.status?.containerStatuses?.reduce((s,r)=>(r.name&&s.push(r.name),s),[]).join(", ")??"",ContainerCount:e.spec?.containers?.length??0,ContainerReadyCount:e.status?.containerStatuses?.reduce((s,r)=>s+(r.ready?1:0),0),ContainerRestartCount:e.status?.containerStatuses?.reduce((s,r)=>s+r.restartCount,0),Ports:{Port:yo(e)}}})}var Tn=class extends ys{getPODs(){return super.GetPODs({}).then(e=>{if(xo(e))return e.Pods?.Pod??[];try{let t=typeof e.Result=="string"?JSON.parse(e.Result):e.Result;return Wo(t?.items??[])}catch(t){return Ao.error(`Error parsing V1Pods json '${t instanceof Error?t.message:String(t)}'`),[]}})}};var bs;(e=>{let n;(s=>s.gpg="gpg")(n=e.SigningMethodType||={})})(bs||={});var Ws=class extends k{constructor(e){super(e,"ws_codesign","1.1")}ListUserIDs(e,t){return this._connection.send("ListUserIDs",e,"json",!1,t,"ListUserIDsResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_codesignPingResponse")}Sign(e,t){return this._connection.send("Sign",e,"json",!1,t,"SignResponse")}Verify(e,t){return this._connection.send("Verify",e,"json",!1,t,"VerifyResponse")}};var wn=class extends Ws{ListUserIDsEx(e){return super.ListUserIDs(e).then(t=>t.UserIDs.Item).catch(t=>[])}Sign(e){return super.Sign({SigningMethod:bs.SigningMethodType.gpg,...e})}};var Us=class extends k{constructor(e){super(e,"WSDali","1.07")}Add(e,t){return this._connection.send("Add",e,"json",!1,t,"ResultResponse")}ClearTraceTransactions(e,t){return this._connection.send("ClearTraceTransactions",e,"json",!1,t,"ResultResponse")}Count(e,t){return this._connection.send("Count",e,"json",!1,t,"CountResponse")}DFSCheck(e,t){return this._connection.send("DFSCheck",e,"json",!1,t,"ResultResponse")}DFSExists(e,t){return this._connection.send("DFSExists",e,"json",!1,t,"BooleanResponse")}DFSLS(e,t){return this._connection.send("DFSLS",e,"json",!1,t,"ResultResponse")}Delete(e,t){return this._connection.send("Delete",e,"json",!1,t,"ResultResponse")}DisconnectClientConnection(e,t){return this._connection.send("DisconnectClientConnection",e,"json",!1,t,"ResultResponse")}GetClients(e,t){return this._connection.send("GetClients",e,"json",!1,t,"ResultResponse")}GetConnections(e,t){return this._connection.send("GetConnections",e,"json",!1,t,"ResultResponse")}GetDFSCSV(e,t){return this._connection.send("GetDFSCSV",e,"json",!1,t,"ResultResponse")}GetDFSMap(e,t){return this._connection.send("GetDFSMap",e,"json",!1,t,"ResultResponse")}GetDFSParents(e,t){return this._connection.send("GetDFSParents",e,"json",!1,t,"ResultResponse")}GetLogicalFile(e,t){return this._connection.send("GetLogicalFile",e,"json",!1,t,"ResultResponse")}GetLogicalFilePart(e,t){return this._connection.send("GetLogicalFilePart",e,"json",!1,t,"ResultResponse")}GetProtectedList(e,t){return this._connection.send("GetProtectedList",e,"json",!1,t,"ResultResponse")}GetSDSStats(e,t){return this._connection.send("GetSDSStats",e,"json",!1,t,"ResultResponse")}GetSDSSubscribers(e,t){return this._connection.send("GetSDSSubscribers",e,"json",!1,t,"ResultResponse")}GetValue(e,t){return this._connection.send("GetValue",e,"json",!1,t,"ResultResponse")}Import(e,t){return this._connection.send("Import",e,"json",!1,t,"ResultResponse")}ListSDSLocks(e,t){return this._connection.send("ListSDSLocks",e,"json",!1,t,"ResultResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WSDaliPingResponse")}SaveSDSStore(e,t){return this._connection.send("SaveSDSStore",e,"json",!1,t,"ResultResponse")}SetLogicalFilePartAttr(e,t){return this._connection.send("SetLogicalFilePartAttr",e,"json",!1,t,"ResultResponse")}SetProtected(e,t){return this._connection.send("SetProtected",e,"json",!1,t,"ResultResponse")}SetTraceSlowTransactions(e,t){return this._connection.send("SetTraceSlowTransactions",e,"json",!1,t,"ResultResponse")}SetTraceTransactions(e,t){return this._connection.send("SetTraceTransactions",e,"json",!1,t,"ResultResponse")}SetUnprotected(e,t){return this._connection.send("SetUnprotected",e,"json",!1,t,"ResultResponse")}SetValue(e,t){return this._connection.send("SetValue",e,"json",!1,t,"ResultResponse")}UnlockSDSLock(e,t){return this._connection.send("UnlockSDSLock",e,"json",!1,t,"ResultResponse")}};var Nn=class extends Us{};var at;(c=>{let n;(R=>(R.Delete="Delete",R.AddToSuperfile="Add To Superfile",R.ChangeProtection="Change Protection",R.ChangeRestriction="Change Restriction"))(n=c.DFUArrayActions||={});let e;(R=>(R[R.NoChange=0]="NoChange",R[R.Protect=1]="Protect",R[R.Unprotect=2]="Unprotect",R[R.UnprotectAll=3]="UnprotectAll"))(e=c.DFUChangeProtection||={});let t;(E=>(E[E.NoChange=0]="NoChange",E[E.Restrict=1]="Restrict",E[E.Unrestricted=2]="Unrestricted"))(t=c.DFUChangeRestriction||={});let s;(l=>(l.xml="xml",l.def="def"))(s=c.DFUDefFileFormat||={});let r;(E=>(E.Token="Token",E.Engine="Engine",E.External="External"))(r=c.FileAccessRole||={});let i;(I=>(I.None="None",I.Access="Access",I.Read="Read",I.Write="Write",I.Full="Full"))(i=c.SecAccessType||={});let o;(j=>(j.Flat="Flat",j.Index="Index",j.Xml="Xml",j.Csv="Csv",j.Json="Json",j.IndexLocal="IndexLocal",j.IndexPartitioned="IndexPartitioned",j.Unset="Unset"))(o=c.DFUFileType||={})})(at||={});var Es=class extends k{constructor(e){super(e,"WsDfu","1.67")}Add(e){return this._connection.send("Add",e,"json",!1,void 0,"AddResponse")}AddRemote(e){return this._connection.send("AddRemote",e,"json",!1,void 0,"AddRemoteResponse")}AddtoSuperfile(e){return this._connection.send("AddtoSuperfile",e,"json",!1,void 0,"AddtoSuperfileResponse")}DFUArrayAction(e){return this._connection.send("DFUArrayAction",e,"json",!1,void 0,"DFUArrayActionResponse")}DFUBrowseData(e){return this._connection.send("DFUBrowseData",e,"json",!1,void 0,"DFUBrowseDataResponse")}DFUDefFile(e){return this._connection.send("DFUDefFile",e,"json",!1,void 0,"DFUDefFileResponse")}DFUFileAccess(e){return this._connection.send("DFUFileAccess",e,"json",!1,void 0,"DFUFileAccessResponse")}DFUFileAccessV2(e){return this._connection.send("DFUFileAccessV2",e,"json",!1,void 0,"DFUFileAccessResponse")}DFUFileCreate(e){return this._connection.send("DFUFileCreate",e,"json",!1,void 0,"DFUFileCreateResponse")}DFUFileCreateV2(e){return this._connection.send("DFUFileCreateV2",e,"json",!1,void 0,"DFUFileCreateResponse")}DFUFilePublish(e){return this._connection.send("DFUFilePublish",e,"json",!1,void 0,"DFUFilePublishResponse")}DFUFileView(e){return this._connection.send("DFUFileView",e,"json",!1,void 0,"DFUFileViewResponse")}DFUGetDataColumns(e){return this._connection.send("DFUGetDataColumns",e,"json",!1,void 0,"DFUGetDataColumnsResponse")}DFUGetFileMetaData(e){return this._connection.send("DFUGetFileMetaData",e,"json",!1,void 0,"DFUGetFileMetaDataResponse")}DFUGetMetaInquiry(e){return this._connection.send("DFUGetMetaInquiry",e,"json",!1,void 0,"DFUMetaInquiryResponse")}DFUInfo(e){return this._connection.send("DFUInfo",e,"json",!1,void 0,"DFUInfoResponse")}DFUQuery(e){return this._connection.send("DFUQuery",e,"json",!1,void 0,"DFUQueryResponse")}DFURecordTypeInfo(e){return this._connection.send("DFURecordTypeInfo",e,"json",!1,void 0,"DFURecordTypeInfoResponse")}DFUSearch(e){return this._connection.send("DFUSearch",e,"json",!1,void 0,"DFUSearchResponse")}DFUSearchData(e){return this._connection.send("DFUSearchData",e,"json",!1,void 0,"DFUSearchDataResponse")}DFUSpace(e){return this._connection.send("DFUSpace",e,"json",!1,void 0,"DFUSpaceResponse")}EclRecordTypeInfo(e){return this._connection.send("EclRecordTypeInfo",e,"json",!1,void 0,"EclRecordTypeInfoResponse")}EraseHistory(e){return this._connection.send("EraseHistory",e,"json",!1,void 0,"EraseHistoryResponse")}ListHistory(e){return this._connection.send("ListHistory",e,"json",!1,void 0,"ListHistoryResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsDfuPingResponse")}Savexml(e){return this._connection.send("Savexml",e,"json",!1,void 0,"SavexmlResponse")}SuperfileAction(e){return this._connection.send("SuperfileAction",e,"json",!1,void 0,"SuperfileActionResponse")}SuperfileList(e){return this._connection.send("SuperfileList",e,"json",!1,void 0,"SuperfileListResponse")}};var bo=at.DFUArrayActions,Uo=at.DFUDefFileFormat,Eo=at.DFUChangeProtection,Fo=at.DFUChangeRestriction,Dt=class extends Es{DFUFile(e){return this._connection.send("DFUDefFile",e,"text")}async recursiveFetchLogicalFiles(e){let t=[],s=[];return await Promise.all(e.map(r=>this.DFUInfo({Cluster:r.NodeGroup,Name:r.Name,IncludeJsonTypeInfo:!1,IncludeBinTypeInfo:!1,ForceIndexInfo:!1}).then(i=>{for(let o of i?.FileDetail?.Superfiles?.DFULogicalFile??[])t.push(o);for(let o of i?.FileDetail?.subfiles?.Item??[])s.push(o)}))),s.concat(t.length?await this.recursiveFetchLogicalFiles(t):[])}};var Fs=class extends k{constructor(e){super(e,"WsDFUXRef","1.04")}DFUXRefArrayAction(e,t){return this._connection.send("DFUXRefArrayAction",e,"json",!1,t,"DFUXRefArrayActionResponse")}DFUXRefBuild(e,t){return this._connection.send("DFUXRefBuild",e,"json",!1,t,"DFUXRefBuildResponse")}DFUXRefBuildCancel(e,t){return this._connection.send("DFUXRefBuildCancel",e,"json",!1,t,"DFUXRefBuildCancelResponse")}DFUXRefCleanDirectories(e,t){return this._connection.send("DFUXRefCleanDirectories",e,"json",!1,t,"DFUXRefCleanDirectoriesResponse")}DFUXRefDirectories(e,t){return this._connection.send("DFUXRefDirectories",e,"json",!1,t,"DFUXRefDirectoriesQueryResponse")}DFUXRefFoundFiles(e,t){return this._connection.send("DFUXRefFoundFiles",e,"json",!1,t,"DFUXRefFoundFilesQueryResponse")}DFUXRefList(e,t){return this._connection.send("DFUXRefList",e,"json",!1,t,"DFUXRefListResponse")}DFUXRefLostFiles(e,t){return this._connection.send("DFUXRefLostFiles",e,"json",!1,t,"DFUXRefLostFilesQueryResponse")}DFUXRefMessages(e,t){return this._connection.send("DFUXRefMessages",e,"json",!1,t,"DFUXRefMessagesQueryResponse")}DFUXRefOrphanFiles(e,t){return this._connection.send("DFUXRefOrphanFiles",e,"json",!1,t,"DFUXRefOrphanFilesQueryResponse")}DFUXRefUnusedFiles(e,t){return this._connection.send("DFUXRefUnusedFiles",e,"json",!1,t,"DFUXRefUnusedFilesResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsDFUXRefPingResponse")}};var Bn=class extends Fs{DFUXRefDirectoriesEx(e){return this._connection.send("DFUXRefDirectories",e,"json",!1,void 0,"DFUXRefDirectoriesQueryResponse")}DFUXRefListEx(e){return this._connection.send("DFUXRefList",e,"json",!1,void 0,"DFUXRefListResponse")}};function Lr(n,e){let t=typeof e;switch(t){case"boolean":case"number":case"string":return{id:n,type:t};case"object":if(e.Row instanceof Array&&(e=e.Row),e instanceof Array)return{id:n,type:"dataset",children:Qn(e[0])};if(e instanceof Object){if(e.Item&&e.Item instanceof Array&&e.Item.length===1){let s=typeof e.Item[0];if(s==="string"||s==="number")return{id:n,type:"set",fieldType:s};throw new Error("Unknown field type")}return{id:n,type:"object",fields:Io(e)}}default:throw new Error("Unknown field type")}}function Qn(n){n.Row&&n.Row instanceof Array&&(n=n.Row[0]);let e=[];for(let t in n)e.push(Lr(t,n[t]));return e}function Io(n){let e={};for(let t in n)e[t]=Lr(t,n[t]);return e}var Qt=class extends k{constructor(e){super(e,"WsEcl","0")}opts(){return this._connection.opts()}requestJson(e,t){return this._connection.send(`example/request/query/${e}/${t}/json`,{},"text").then(s=>{let r=JSON.parse(s);for(let i in r)return r[i];return{}}).then(Qn)}responseJson(e,t){return this._connection.send(`example/response/query/${e}/${t}/json`,{},"text").then(s=>{let r=JSON.parse(s);for(let i in r)return r[i].Results;return{}}).then(s=>{let r={};for(let i in s)r[i]=Qn(s[i]);return r})}submit(e,t,s){let r=`submit/query/${e}/${t}`;return this._connection.send(r,s,"json2").then(i=>{if(i.Results&&i.Results.Exception)throw new Ye(r,s,{Source:"wsEcl.submit",Exception:i.Results.Exception});return i.Results})}};var Is=class extends k{constructor(e){super(e,"ws_elk","1")}GetConfigDetails(e,t){return this._connection.send("GetConfigDetails",e,"json",!1,t,"GetConfigDetailsResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_elkPingResponse")}};var Ln=class extends Is{};var kr=require("@hpcc-js/util");var te;(d=>{let n;(F=>(F.global="global",F.workunits="workunits",F.components="components",F.audience="audience",F.class="class",F.instance="instance",F.node="node",F.message="message",F.logid="logid",F.processid="processid",F.threadid="threadid",F.timestamp="timestamp",F.pod="pod",F.traceid="traceid",F.spanid="spanid"))(n=d.LogColumnType||={});let e;(N=>(N.string="string",N.numeric="numeric",N.datetime="datetime",N.enum="enum",N.epoch="epoch"))(e=d.LogColumnValueType||={});let t;(T=>(T[T.All=0]="All",T[T.ByJobID=1]="ByJobID",T[T.ByComponent=2]="ByComponent",T[T.ByLogType=3]="ByLogType",T[T.ByTargetAudience=4]="ByTargetAudience",T[T.BySourceInstance=5]="BySourceInstance",T[T.BySourceNode=6]="BySourceNode",T[T.ByFieldName=7]="ByFieldName",T[T.ByPod=8]="ByPod",T[T.ByTraceID=9]="ByTraceID",T[T.BySpanID=10]="BySpanID"))(t=d.LogAccessType||={});let s;(R=>(R[R.Success=0]="Success",R[R.Warning=1]="Warning",R[R.Fail=2]="Fail"))(s=d.LogAccessStatusCode||={});let r;(R=>(R[R.NONE=0]="NONE",R[R.AND=1]="AND",R[R.OR=2]="OR"))(r=d.LogAccessFilterOperator||={});let i;(I=>(I[I.MIN=0]="MIN",I[I.DEFAULT=1]="DEFAULT",I[I.ALL=2]="ALL",I[I.CUSTOM=3]="CUSTOM"))(i=d.LogSelectColumnMode||={});let o;(T=>(T[T.ByDate=0]="ByDate",T[T.ByJobID=1]="ByJobID",T[T.ByComponent=2]="ByComponent",T[T.ByLogType=3]="ByLogType",T[T.ByTargetAudience=4]="ByTargetAudience",T[T.BySourceInstance=5]="BySourceInstance",T[T.BySourceNode=6]="BySourceNode",T[T.ByFieldName=7]="ByFieldName",T[T.ByPod=8]="ByPod",T[T.ByTraceID=9]="ByTraceID",T[T.BySpanID=10]="BySpanID"))(o=d.SortColumType||={});let c;(E=>(E[E.ASC=0]="ASC",E[E.DSC=1]="DSC"))(c=d.SortDirection||={})})(te||={});var Ps=class extends k{constructor(e){super(e,"ws_logaccess","1.08")}GetHealthReport(e){return this._connection.send("GetHealthReport",e,"json",!1,void 0,"GetHealthReportResponse")}GetLogAccessInfo(e){return this._connection.send("GetLogAccessInfo",e,"json",!1,void 0,"GetLogAccessInfoResponse")}GetLogs(e){return this._connection.send("GetLogs",e,"json",!1,void 0,"GetLogsResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_logaccessPingResponse")}};var Gr=(0,kr.scopedLogger)("@hpcc-js/comms/services/wsLogaccess.ts");var vr=(o=>(o.Disaster="DIS",o.Error="ERR",o.Warning="WRN",o.Information="INF",o.Progress="PRO",o.Metric="MET",o))(vr||{}),Vr=(r=>(r.Operator="OPR",r.User="USR",r.Programmer="PRO",r.Audit="ADT",r))(Vr||{}),Po=new Set(["azureloganalyticscurl","elasticstack","grafanacurl"]),Mo=new Set(Object.values(te.LogColumnType));function To(n){switch(n){case te.LogColumnType.workunits:case"hpcc.log.jobid":return te.LogAccessType.ByJobID;case te.LogColumnType.audience:case"hpcc.log.audience":return te.LogAccessType.ByTargetAudience;case te.LogColumnType.class:case"hpcc.log.class":return te.LogAccessType.ByLogType;case te.LogColumnType.components:case"kubernetes.container.name":return te.LogAccessType.ByComponent;default:return te.LogAccessType.ByFieldName}}var wo=["audience","class","workunits","message","processid","logid","threadid","timestamp","components","instance"];function No(n,e){let t=[];for(let s of wo){let r=n[s];if(r==null||r===""||Array.isArray(r)&&r.length===0||!(s in e))continue;let o=Mo.has(s)?s:e[s],c=To(o);c===te.LogAccessType.ByFieldName&&(o=e[s]);let d=c===te.LogAccessType.ByComponent,x=Array.isArray(r)?r:[r];for(let l of x)t.push({LogCategory:c,SearchField:o,SearchByValue:d?l+"*":l})}return t}function Ms(n){let e={leftFilter:n[0]},t=e;for(let s=1;s<n.length;s++)t.Operator=te.LogAccessFilterOperator.OR,s===n.length-1?t.rightFilter=n[s]:(t.rightBinaryFilter={BinaryLogFilter:[{leftFilter:n[s]}]},t=t.rightBinaryFilter.BinaryLogFilter[0]);return e}function Hr(n){let[e,...t]=n,s={};if(e.length===1?s.leftFilter=e[0]:s.leftBinaryFilter={BinaryLogFilter:[Ms(e)]},t.length===0)return s;if(s.Operator=te.LogAccessFilterOperator.AND,t.length===1){let[r]=t;r.length===1?s.rightFilter=r[0]:s.rightBinaryFilter={BinaryLogFilter:[Ms(r)]}}else s.rightBinaryFilter={BinaryLogFilter:[Hr(t)]};return s}function Bo(n){let e=new Map;for(let o of n){let c=e.get(o.SearchField);c?c.push(o):e.set(o.SearchField,[o])}let t=[...e.values()];if(t.length===0)return{leftFilter:{LogCategory:te.LogAccessType.All}};let[s,...r]=t,i={};if(s.length===1?i.leftFilter=s[0]:i.leftBinaryFilter={BinaryLogFilter:[Ms(s)]},r.length===0)return i;if(i.Operator=te.LogAccessFilterOperator.AND,r.length===1){let[o]=r;o.length===1?i.rightFilter=o[0]:i.rightBinaryFilter={BinaryLogFilter:[Ms(o)]}}else i.rightBinaryFilter={BinaryLogFilter:[Hr(r)]};return i}var Gn=class extends Ps{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}convertLogLine(e,t){let s={},r=t?.fields?Object.assign({},...t.fields):null;for(let i in e)s[i]=r?r[e[i]]??"":"";return s}async GetLogsEx(e){let t=await this.GetLogAccessInfo(),s={};t.Columns.Column.forEach(c=>s[c.LogType]=c.Name);let r=No(e,s),i={StartDate:e.StartDate instanceof Date?e.StartDate.toISOString():new Date(0).toISOString()};e.EndDate instanceof Date&&(i.EndDate=e.EndDate.toISOString());let o={Filter:Bo(r),Range:i,LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:te.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:te.SortColumType.ByDate,ColumnName:"",Direction:0}]}};return this.GetLogs(o).then(c=>{try{let d=JSON.parse(c.LogLines);return{lines:Po.has(t.RemoteLogManagerType)?d.lines?.map(l=>this.convertLogLine(s,l))??[]:(Gr.warning(`Unknown RemoteLogManagerType: ${t.RemoteLogManagerType}`),[]),total:c.TotalLogLinesAvailable??1e4}}catch(d){Gr.error(d.message??d)}return{lines:[],total:0}})}};var _r=require("@hpcc-js/util"),qe=Pe(Or(),1);var Qo;(t=>{let n;(i=>(i[i.THRESHOLD_PERCENTAGE=0]="THRESHOLD_PERCENTAGE",i[i.THRESHOLD_MB=1]="THRESHOLD_MB"))(n=t.ThresholdType||={});let e;(I=>(I.ALLNODES="ALLNODES",I.THORMACHINES="THORMACHINES",I.HOLEMACHINES="HOLEMACHINES",I.ROXIEMACHINES="ROXIEMACHINES",I.MACHINES="MACHINES",I.AVAILABLEMACHINES="AVAILABLEMACHINES",I.DROPZONE="DROPZONE",I.STANDBYNNODE="STANDBYNNODE",I.THORSPARENODES="THORSPARENODES",I.HOLESTANDBYNODES="HOLESTANDBYNODES"))(e=t.TpMachineType||={})})(Qo||={});var ws=class extends k{constructor(e){super(e,"ws_machine","1.19")}GetComponentStatus(e,t){return this._connection.send("GetComponentStatus",e,"json",!1,t,"GetComponentStatusResponse")}GetComponentUsage(e,t){return this._connection.send("GetComponentUsage",e,"json",!1,t,"GetComponentUsageResponse")}GetMachineInfo(e,t){return this._connection.send("GetMachineInfo",e,"json",!1,t,"GetMachineInfoResponse")}GetMachineInfoEx(e,t){return this._connection.send("GetMachineInfoEx",e,"json",!1,t,"GetMachineInfoResponseEx")}GetMetrics(e,t){return this._connection.send("GetMetrics",e,"json",!1,t,"MetricsResponse")}GetNodeGroupUsage(e,t){return this._connection.send("GetNodeGroupUsage",e,"json",!1,t,"GetNodeGroupUsageResponse")}GetTargetClusterInfo(e,t){return this._connection.send("GetTargetClusterInfo",e,"json",!1,t,"GetTargetClusterInfoResponse")}GetTargetClusterUsage(e,t){return this._connection.send("GetTargetClusterUsage",e,"json",!1,t,"GetTargetClusterUsageResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_machinePingResponse")}UpdateComponentStatus(e,t){return this._connection.send("UpdateComponentStatus",e,"json",!1,t,"UpdateComponentStatusResponse")}};var Ge=class extends ws{GetTargetClusterUsageEx(e,t=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:t}).then(s=>(0,_r.exists)("TargetClusterUsages.TargetClusterUsage",s)?s.TargetClusterUsages.TargetClusterUsage:[]).then(s=>s.filter(r=>!!r.ComponentUsages).map(r=>{let i=r.ComponentUsages.ComponentUsage.map(o=>{let c=(o.MachineUsages&&o.MachineUsages.MachineUsage?o.MachineUsages.MachineUsage:[]).map(d=>{let x=d.DiskUsages&&d.DiskUsages.DiskUsage?d.DiskUsages.DiskUsage.map(l=>({...l,InUse:l.InUse*1024,Total:(l.InUse+l.Available)*1024,PercentUsed:100-l.PercentAvailable})):[];return{Name:d.Name,NetAddress:d.NetAddress,Description:d.Description,DiskUsages:x,mean:(0,qe.mean)(x.filter(l=>!isNaN(l.PercentUsed)),l=>l.PercentUsed),max:(0,qe.max)(x.filter(l=>!isNaN(l.PercentUsed)),l=>l.PercentUsed)}});return{Type:o.Type,Name:o.Name,Description:o.Description,MachineUsages:c,MachineUsagesDescription:c.reduce((d,x)=>d+(x.Description||""),""),mean:(0,qe.mean)(c.filter(d=>!isNaN(d.mean)),d=>d.mean),max:(0,qe.max)(c.filter(d=>!isNaN(d.max)),d=>d.max)}});return{Name:r.Name,Description:r.Description,ComponentUsages:i,ComponentUsagesDescription:i.reduce((o,c)=>o+(c.MachineUsagesDescription||""),""),mean:(0,qe.mean)(i.filter(o=>!isNaN(o.mean)),o=>o.mean),max:(0,qe.max)(i.filter(o=>!isNaN(o.max)),o=>o.max)}}))}};var Ns=class extends k{constructor(e){super(e,"WsPackageProcess","1.08")}ActivatePackage(e,t){return this._connection.send("ActivatePackage",e,"json",!1,t,"ActivatePackageResponse")}AddPackage(e,t){return this._connection.send("AddPackage",e,"json",!1,t,"AddPackageResponse")}AddPartToPackageMap(e,t){return this._connection.send("AddPartToPackageMap",e,"json",!1,t,"AddPartToPackageMapResponse")}CopyPackageMap(e,t){return this._connection.send("CopyPackageMap",e,"json",!1,t,"CopyPackageMapResponse")}DeActivatePackage(e,t){return this._connection.send("DeActivatePackage",e,"json",!1,t,"DeActivatePackageResponse")}DeletePackage(e,t){return this._connection.send("DeletePackage",e,"json",!1,t,"DeletePackageResponse")}Echo(e,t){return this._connection.send("Echo",e,"json",!1,t,"EchoResponse")}GetPackage(e,t){return this._connection.send("GetPackage",e,"json",!1,t,"GetPackageResponse")}GetPackageMapById(e,t){return this._connection.send("GetPackageMapById",e,"json",!1,t,"GetPackageMapByIdResponse")}GetPackageMapSelectOptions(e,t){return this._connection.send("GetPackageMapSelectOptions",e,"json",!1,t,"GetPackageMapSelectOptionsResponse")}GetPartFromPackageMap(e,t){return this._connection.send("GetPartFromPackageMap",e,"json",!1,t,"GetPartFromPackageMapResponse")}GetQueryFileMapping(e,t){return this._connection.send("GetQueryFileMapping",e,"json",!1,t,"GetQueryFileMappingResponse")}ListPackage(e,t){return this._connection.send("ListPackage",e,"json",!1,t,"ListPackageResponse")}ListPackages(e,t){return this._connection.send("ListPackages",e,"json",!1,t,"ListPackagesResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsPackageProcessPingResponse")}RemovePartFromPackageMap(e,t){return this._connection.send("RemovePartFromPackageMap",e,"json",!1,t,"RemovePartFromPackageMapResponse")}ValidatePackage(e,t){return this._connection.send("ValidatePackage",e,"json",!1,t,"ValidatePackageResponse")}};var kn=class extends Ns{};var Bs=class extends k{constructor(e){super(e,"WsResources","1.01")}Ping(e){return this._connection.send("Ping",e)}ServiceQuery(e){return this._connection.send("ServiceQuery",e)}WebLinksQuery(e){return this._connection.send("WebLinksQuery",e)}};var vn=class extends Bs{};var Vn;(e=>{let n;(r=>(r.ECL="ECL",r.DFU="DFU"))(n=e.WUTypes||={})})(Vn||={});var Qs=class extends k{constructor(e){super(e,"WSSasha","1.01")}ArchiveWU(e,t){return this._connection.send("ArchiveWU",e,"json",!1,t,"ResultResponse")}GetVersion(e,t){return this._connection.send("GetVersion",e,"json",!1,t,"ResultResponse")}ListWU(e,t){return this._connection.send("ListWU",e,"json",!1,t,"ResultResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WSSashaPingResponse")}RestoreWU(e,t){return this._connection.send("RestoreWU",e,"json",!1,t,"ResultResponse")}};var Hn=class extends Qs{};var zr=Pe(jn(),1);var On;(t=>{let n;(d=>(d.ALL="ALL",d.READ="READ",d.WRITE="WRITE",d.HOLD="HOLD",d.SUB="SUB"))(n=t.LockModes||={});let e;(E=>(E.Attach="Attach",E.Detach="Detach",E.State="State",E.Reload="Reload",E.ReloadRetry="ReloadRetry",E.MemLock="MemLock",E.MemUnlock="MemUnlock",E.GetMemLocked="GetMemLocked"))(e=t.RoxieControlCmdType||={})})(On||={});var ks=class extends k{constructor(e){super(e,"WsSMC","1.29")}Activity(e){return this._connection.send("Activity",e,"json",!1,void 0,"ActivityResponse")}BrowseResources(e){return this._connection.send("BrowseResources",e,"json",!1,void 0,"BrowseResourcesResponse")}ClearQueue(e){return this._connection.send("ClearQueue",e,"json",!1,void 0,"SMCQueueResponse")}GetBuildInfo(e){return this._connection.send("GetBuildInfo",e,"json",!1,void 0,"GetBuildInfoResponse")}GetGlobalMetrics(e){return this._connection.send("GetGlobalMetrics",e,"json",!1,void 0,"GetGlobalMetricsResponse")}GetStatusServerInfo(e){return this._connection.send("GetStatusServerInfo",e,"json",!1,void 0,"GetStatusServerInfoResponse")}GetThorQueueAvailability(e){return this._connection.send("GetThorQueueAvailability",e,"json",!1,void 0,"GetThorQueueAvailabilityResponse")}Index(e){return this._connection.send("Index",e,"json",!1,void 0,"SMCIndexResponse")}LockQuery(e){return this._connection.send("LockQuery",e,"json",!1,void 0,"LockQueryResponse")}MoveJobBack(e){return this._connection.send("MoveJobBack",e,"json",!1,void 0,"SMCJobResponse")}MoveJobDown(e){return this._connection.send("MoveJobDown",e,"json",!1,void 0,"SMCJobResponse")}MoveJobFront(e){return this._connection.send("MoveJobFront",e,"json",!1,void 0,"SMCJobResponse")}MoveJobUp(e){return this._connection.send("MoveJobUp",e,"json",!1,void 0,"SMCJobResponse")}NotInCommunityEdition(e){return this._connection.send("NotInCommunityEdition",e,"json",!1,void 0,"NotInCommunityEditionResponse")}PauseQueue(e){return this._connection.send("PauseQueue",e,"json",!1,void 0,"SMCQueueResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsSMCPingResponse")}RecordGlobalMetrics(e){return this._connection.send("RecordGlobalMetrics",e,"json",!1,void 0,"RecordGlobalMetricsResponse")}RemoveJob(e){return this._connection.send("RemoveJob",e,"json",!1,void 0,"SMCJobResponse")}ResumeQueue(e){return this._connection.send("ResumeQueue",e,"json",!1,void 0,"SMCQueueResponse")}RoxieControlCmd(e){return this._connection.send("RoxieControlCmd",e,"json",!1,void 0,"RoxieControlCmdResponse")}RoxieXrefCmd(e){return this._connection.send("RoxieXrefCmd",e,"json",!1,void 0,"RoxieXrefCmdResponse")}SetBanner(e){return this._connection.send("SetBanner",e,"json",!1,void 0,"SetBannerResponse")}SetJobPriority(e){return this._connection.send("SetJobPriority",e,"json",!1,void 0,"SMCPriorityResponse")}StopQueue(e){return this._connection.send("StopQueue",e,"json",!1,void 0,"SMCQueueResponse")}};var Lo=(0,zr.timeParse)("%Y%m%d%H");function Go(n){return typeof n=="number"||typeof n=="string"&&n.trim()!==""&&!isNaN(+n)}var Ct=class extends ks{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(t=>({Running:{ActiveWorkunit:[]},...t}))}parseGlobalMetric(e,t){return e.startsWith("Cost")?+t/1e6:e.startsWith("Date")?Lo(t):e.startsWith("Num")?+t:e.startsWith("Time")?+t/1e9:e.startsWith("When")?new Date(+t/1e3).toISOString():Go(t)?+t:t}GetNormalisedGlobalMetrics(e){return super.GetGlobalMetrics(e).then(t=>{let s=[];for(let r of t?.GlobalMetrics?.GlobalMetric||[]){let i={Category:r.Category,Start:this.parseGlobalMetric("Date",r.DateTimeRange?.Start),End:this.parseGlobalMetric("Date",r.DateTimeRange?.End),dimensions:{},stats:{}};for(let o of r.Dimensions?.Dimension||[])i.dimensions[o.Name]=o.Value;for(let o of r.Stats?.Stat||[])i.stats[o.Name]=this.parseGlobalMetric(o.Name,o.Value);s.push(i)}return s})}};var vs=class extends k{constructor(e){super(e,"wsstore","1.02")}CreateStore(e,t){return this._connection.send("CreateStore",e,"json",!1,t,"CreateStoreResponse")}Delete(e,t){return this._connection.send("Delete",e,"json",!1,t,"DeleteResponse")}DeleteNamespace(e,t){return this._connection.send("DeleteNamespace",e,"json",!1,t,"DeleteNamespaceResponse")}Fetch(e,t){return this._connection.send("Fetch",e,"json",!1,t,"FetchResponse")}FetchAll(e,t){return this._connection.send("FetchAll",e,"json",!1,t,"FetchAllResponse")}FetchKeyMetadata(e,t){return this._connection.send("FetchKeyMetadata",e,"json",!1,t,"FetchKeyMDResponse")}ListKeys(e,t){return this._connection.send("ListKeys",e,"json",!1,t,"ListKeysResponse")}ListNamespaces(e,t){return this._connection.send("ListNamespaces",e,"json",!1,t,"ListNamespacesResponse")}ListStores(e,t){return this._connection.send("ListStores",e,"json",!1,t,"ListStoresResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"wsstorePingResponse")}Set(e,t){return this._connection.send("Set",e,"json",!1,t,"SetResponse")}};var Rt=class extends vs{Delete(e){return super.Delete(e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(s=>s.Code===-1))return{Exceptions:void 0,Success:!0};throw t})}Fetch(e){return super.Fetch(e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(s=>s.Code===-1))return{Exceptions:void 0,Value:void 0};throw t})}};var _n;(s=>{let n;(o=>(o.XML="XML",o.YAML="YAML"))(n=s.TpConfigResponseFormat||={});let e;(c=>(c.All="All",c.QueriesOnly="QueriesOnly",c.WorkunitsOnly="WorkunitsOnly"))(e=s.RoxieQueueFilter||={});let t;(N=>(N.ALLNODES="ALLNODES",N.THORMACHINES="THORMACHINES",N.HOLEMACHINES="HOLEMACHINES",N.ROXIEMACHINES="ROXIEMACHINES",N.MACHINES="MACHINES",N.AVAILABLEMACHINES="AVAILABLEMACHINES",N.DROPZONE="DROPZONE",N.STANDBYNNODE="STANDBYNNODE",N.THORSPARENODES="THORSPARENODES",N.HOLESTANDBYNODES="HOLESTANDBYNODES"))(t=s.TpMachineType||={})})(_n||={});var Vs=class extends k{constructor(e){super(e,"WsTopology","1.33")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsTopologyPingResponse")}SystemLog(e,t){return this._connection.send("SystemLog",e,"json",!1,t,"SystemLogResponse")}TpClusterInfo(e,t){return this._connection.send("TpClusterInfo",e,"json",!1,t,"TpClusterInfoResponse")}TpClusterQuery(e,t){return this._connection.send("TpClusterQuery",e,"json",!1,t,"TpClusterQueryResponse")}TpComponentConfiguration(e,t){return this._connection.send("TpComponentConfiguration",e,"json",!1,t,"TpComponentConfigurationResponse")}TpConfiguredComponents(e,t){return this._connection.send("TpConfiguredComponents",e,"json",!1,t,"TpConfiguredComponentsResponse")}TpDropZoneQuery(e,t){return this._connection.send("TpDropZoneQuery",e,"json",!1,t,"TpDropZoneQueryResponse")}TpGetComponentFile(e,t){return this._connection.send("TpGetComponentFile",e,"json",!1,t,"TpGetComponentFileResponse")}TpGetServicePlugins(e,t){return this._connection.send("TpGetServicePlugins",e,"json",!1,t,"TpGetServicePluginsResponse")}TpGroupQuery(e,t){return this._connection.send("TpGroupQuery",e,"json",!1,t,"TpGroupQueryResponse")}TpListLogFiles(e,t){return this._connection.send("TpListLogFiles",e,"json",!1,t,"TpListLogFilesResponse")}TpListTargetClusters(e,t){return this._connection.send("TpListTargetClusters",e,"json",!1,t,"TpListTargetClustersResponse")}TpLogFile(e,t){return this._connection.send("TpLogFile",e,"json",!1,t,"TpLogFileResponse")}TpLogFileDisplay(e,t){return this._connection.send("TpLogFileDisplay",e,"json",!1,t,"TpLogFileResponse")}TpLogicalClusterQuery(e,t){return this._connection.send("TpLogicalClusterQuery",e,"json",!1,t,"TpLogicalClusterQueryResponse")}TpMachineInfo(e,t){return this._connection.send("TpMachineInfo",e,"json",!1,t,"TpMachineInfoResponse")}TpMachineQuery(e,t){return this._connection.send("TpMachineQuery",e,"json",!1,t,"TpMachineQueryResponse")}TpServiceQuery(e,t){return this._connection.send("TpServiceQuery",e,"json",!1,t,"TpServiceQueryResponse")}TpSetMachineStatus(e,t){return this._connection.send("TpSetMachineStatus",e,"json",!1,t,"TpSetMachineStatusResponse")}TpSwapNode(e,t){return this._connection.send("TpSwapNode",e,"json",!1,t,"TpSwapNodeResponse")}TpTargetClusterQuery(e,t){return this._connection.send("TpTargetClusterQuery",e,"json",!1,t,"TpTargetClusterQueryResponse")}TpThorStatus(e,t){return this._connection.send("TpThorStatus",e,"json",!1,t,"TpThorStatusResponse")}TpXMLFile(e,t){return this._connection.send("TpXMLFile",e,"json",!1,t,"TpXMLFileResponse")}};var ce=class extends Vs{connectionOptions(){return this._connection.opts()}protocol(){return this._connection.opts().baseUrl.split("//")[0]}ip(){return this._connection.opts().baseUrl.split("//")[1].split(":")[0]}DefaultTpLogicalClusterQuery(e={}){return this.TpLogicalClusterQuery(e).then(t=>{if(t.default)return t.default;let s,r;return t.TpLogicalClusters.TpLogicalCluster.some((i,o)=>(o===0&&(r=i),i.Type==="hthor"?(s=i,!0):!1)),s||r})}};var Hs=require("@hpcc-js/util");var me;(w=>{let n;(H=>(H.Abort="Abort",H.Delete="Delete",H.Deschedule="Deschedule",H.Reschedule="Reschedule",H.Pause="Pause",H.PauseNow="PauseNow",H.Protect="Protect",H.Unprotect="Unprotect",H.Restore="Restore",H.Resume="Resume",H.SetToFailed="SetToFailed",H.Archive="Archive"))(n=w.ECLWUActions||={});let e;(m=>(m[m.MIN=0]="MIN",m[m.DEFAULT=1]="DEFAULT",m[m.ALL=2]="ALL",m[m.CUSTOM=3]="CUSTOM"))(e=w.LogSelectColumnMode||={});let t;(ne=>(ne[ne.ASC=0]="ASC",ne[ne.DSC=1]="DSC"))(t=w.SortDirection||={});let s;(Q=>(Q.ALL="ALL",Q.DIS="DIS",Q.ERR="ERR",Q.WRN="WRN",Q.INF="INF",Q.PRO="PRO",Q.MET="MET",Q.EVT="EVT"))(s=w.LogEventClass||={});let r;(_=>(_.Single="Single",_.List="List",_.Multi="Multi"))(r=w.WUDetailsAttrValueType||={});let i;(_=>(_.SyntaxCheck="SyntaxCheck",_.Deploy="Deploy",_.Publish="Publish"))(i=w.EclDefinitionActions||={});let o;(_=>(_.xml="xml",_.json="json",_.text="text"))(o=w.ErrorMessageFormat||={});let c;(_=>(_[_.XML=0]="XML",_[_.JSON=1]="JSON",_[_.CSV=2]="CSV"))(c=w.LogAccessLogFormat||={});let d;(m=>(m.info="info",m.warning="warning",m.error="error",m.alert="alert"))(d=w.WUExceptionSeverity||={});let x;(m=>(m[m.OriginalText=0]="OriginalText",m[m.Attachment=1]="Attachment",m[m.ZIP=2]="ZIP",m[m.GZIP=3]="GZIP"))(x=w.WUFileDownloadOption||={});let l;(H=>(H.XML="XML",H.cpp="cpp",H.dll="dll",H.res="res",H.log="log",H.WUECL="WUECL",H.ThorLog="ThorLog",H.ThorSlaveLog="ThorSlaveLog",H.EclAgentLog="EclAgentLog",H.ArchiveQuery="ArchiveQuery",H.ComponentLog="ComponentLog",H.PostMortem="PostMortem"))(l=w.WUFileType||={});let E;(L=>(L.Allqueries="All queries",L.Notsuspended="Not suspended",L.Suspended="Suspended",L.Suspendedbyuser="Suspended by user",L.Suspendedbyfirstnode="Suspended by first node",L.Suspendedbyanynode="Suspended by any node"))(E=w.WUQueryFilterSuspendedType||={});let R;(F=>(F.All="All",F.Id="Id",F.Name="Name",F.Alias="Alias",F.Status="Status"))(R=w.WUQuerySetFilterType||={});let I;(_=>(_.All="All",_.Protected="Protected",_.NotProtected="NotProtected"))(I=w.WUProtectFilter||={});let N;(T=>T.Deactivate="Deactivate")(N=w.QuerySetAliasActionTypes||={});let V;(ne=>(ne.None="None",ne.ActivateImportedActive="ActivateImportedActive"))(V=w.QuerysetImportActivation||={});let j;(Q=>(Q.Suspend="Suspend",Q.Unsuspend="Unsuspend",Q.ToggleSuspend="ToggleSuspend",Q.Activate="Activate",Q.Delete="Delete",Q.DeleteQueriesAndWUs="DeleteQueriesAndWUs",Q.RemoveAllAliases="RemoveAllAliases",Q.ResetQueryStats="ResetQueryStats"))(j=w.QuerySetQueryActionTypes||={});let X;(m=>(m[m.DoNotActivateQuery=0]="DoNotActivateQuery",m[m.ActivateQuery=1]="ActivateQuery",m[m.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",m[m.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious"))(X=w.WUQueryActivationMode||={})})(me||={});var Lt=class extends k{constructor(e){super(e,"WsWorkunits","2.10")}GVCAjaxGraph(e,t){return this._connection.send("GVCAjaxGraph",e,"json",!1,t,"GVCAjaxGraphResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsWorkunitsPingResponse")}WUAbort(e,t){return this._connection.send("WUAbort",e,"json",!1,t,"WUAbortResponse")}WUAction(e,t){return this._connection.send("WUAction",e,"json",!1,t,"WUActionResponse")}WUAddLocalFileToWorkunit(e,t){return this._connection.send("WUAddLocalFileToWorkunit",e,"json",!1,t,"WUAddLocalFileToWorkunitResponse")}WUAnalyseHotspot(e,t){return this._connection.send("WUAnalyseHotspot",e,"json",!1,t,"WUAnalyseHotspotResponse")}WUCDebug(e,t){return this._connection.send("WUCDebug",e,"json",!1,t,"WUDebugResponse")}WUCheckFeatures(e,t){return this._connection.send("WUCheckFeatures",e,"json",!1,t,"WUCheckFeaturesResponse")}WUClusterJobQueueLOG(e,t){return this._connection.send("WUClusterJobQueueLOG",e,"json",!1,t,"WUClusterJobQueueLOGResponse")}WUClusterJobQueueXLS(e,t){return this._connection.send("WUClusterJobQueueXLS",e,"json",!1,t,"WUClusterJobQueueXLSResponse")}WUClusterJobSummaryXLS(e,t){return this._connection.send("WUClusterJobSummaryXLS",e,"json",!1,t,"WUClusterJobSummaryXLSResponse")}WUClusterJobXLS(e,t){return this._connection.send("WUClusterJobXLS",e,"json",!1,t,"WUClusterJobXLSResponse")}WUCompileECL(e,t){return this._connection.send("WUCompileECL",e,"json",!1,t,"WUCompileECLResponse")}WUCopyLogicalFiles(e,t){return this._connection.send("WUCopyLogicalFiles",e,"json",!1,t,"WUCopyLogicalFilesResponse")}WUCopyQuerySet(e,t){return this._connection.send("WUCopyQuerySet",e,"json",!1,t,"WUCopyQuerySetResponse")}WUCreate(e,t){return this._connection.send("WUCreate",e,"json",!1,t,"WUCreateResponse")}WUCreateAndUpdate(e,t){return this._connection.send("WUCreateAndUpdate",e,"json",!1,t,"WUUpdateResponse")}WUCreateZAPInfo(e,t){return this._connection.send("WUCreateZAPInfo",e,"json",!1,t,"WUCreateZAPInfoResponse")}WUDelete(e,t){return this._connection.send("WUDelete",e,"json",!1,t,"WUDeleteResponse")}WUDeployWorkunit(e,t){return this._connection.send("WUDeployWorkunit",e,"json",!1,t,"WUDeployWorkunitResponse")}WUDetails(e,t){return this._connection.send("WUDetails",e,"json",!1,t,"WUDetailsResponse")}WUDetailsMeta(e,t){return this._connection.send("WUDetailsMeta",e,"json",!1,t,"WUDetailsMetaResponse")}WUEclDefinitionAction(e,t){return this._connection.send("WUEclDefinitionAction",e,"json",!1,t,"WUEclDefinitionActionResponse")}WUExport(e,t){return this._connection.send("WUExport",e,"json",!1,t,"WUExportResponse")}WUFile(e,t){return this._connection.send("WUFile",e,"json",!1,t,"WULogFileResponse")}WUFullResult(e,t){return this._connection.send("WUFullResult",e,"json",!1,t,"WUFullResultResponse")}WUGVCGraphInfo(e,t){return this._connection.send("WUGVCGraphInfo",e,"json",!1,t,"WUGVCGraphInfoResponse")}WUGetArchiveFile(e,t){return this._connection.send("WUGetArchiveFile",e,"json",!1,t,"WUGetArchiveFileResponse")}WUGetDependancyTrees(e,t){return this._connection.send("WUGetDependancyTrees",e,"json",!1,t,"WUGetDependancyTreesResponse")}WUGetGraph(e,t){return this._connection.send("WUGetGraph",e,"json",!1,t,"WUGetGraphResponse")}WUGetGraphNameAndTypes(e,t){return this._connection.send("WUGetGraphNameAndTypes",e,"json",!1,t,"WUGetGraphNameAndTypesResponse")}WUGetNumFileToCopy(e,t){return this._connection.send("WUGetNumFileToCopy",e,"json",!1,t,"WUGetNumFileToCopyResponse")}WUGetPlugins(e,t){return this._connection.send("WUGetPlugins",e,"json",!1,t,"WUGetPluginsResponse")}WUGetStats(e,t){return this._connection.send("WUGetStats",e,"json",!1,t,"WUGetStatsResponse")}WUGetThorJobList(e,t){return this._connection.send("WUGetThorJobList",e,"json",!1,t,"WUGetThorJobListResponse")}WUGetThorJobQueue(e,t){return this._connection.send("WUGetThorJobQueue",e,"json",!1,t,"WUGetThorJobQueueResponse")}WUGetZAPInfo(e,t){return this._connection.send("WUGetZAPInfo",e,"json",!1,t,"WUGetZAPInfoResponse")}WUGraphInfo(e,t){return this._connection.send("WUGraphInfo",e,"json",!1,t,"WUGraphInfoResponse")}WUGraphTiming(e,t){return this._connection.send("WUGraphTiming",e,"json",!1,t,"WUGraphTimingResponse")}WUHelperFileArchive(e,t){return this._connection.send("WUHelperFileArchive",e,"json",!1,t,"WUHelperFileArchiveResponse")}WUInfo(e,t){return this._connection.send("WUInfo",e,"json",!1,t,"WUInfoResponse")}WUInfoDetails(e,t){return this._connection.send("WUInfoDetails",e,"json",!1,t,"WUInfoResponse")}WUJobList(e,t){return this._connection.send("WUJobList",e,"json",!1,t,"WUJobListResponse")}WULightWeightQuery(e,t){return this._connection.send("WULightWeightQuery",e,"json",!1,t,"WULightWeightQueryResponse")}WUListArchiveFiles(e,t){return this._connection.send("WUListArchiveFiles",e,"json",!1,t,"WUListArchiveFilesResponse")}WUListLocalFileRequired(e,t){return this._connection.send("WUListLocalFileRequired",e,"json",!1,t,"WUListLocalFileRequiredResponse")}WUListQueries(e,t){return this._connection.send("WUListQueries",e,"json",!1,t,"WUListQueriesResponse")}WUListQueriesUsingFile(e,t){return this._connection.send("WUListQueriesUsingFile",e,"json",!1,t,"WUListQueriesUsingFileResponse")}WUMultiQuerysetDetails(e,t){return this._connection.send("WUMultiQuerysetDetails",e,"json",!1,t,"WUMultiQuerySetDetailsResponse")}WUProcessGraph(e,t){return this._connection.send("WUProcessGraph",e,"json",!1,t,"WUProcessGraphResponse")}WUProtect(e,t){return this._connection.send("WUProtect",e,"json",!1,t,"WUProtectResponse")}WUPublishWorkunit(e,t){return this._connection.send("WUPublishWorkunit",e,"json",!1,t,"WUPublishWorkunitResponse")}WUPushEvent(e,t){return this._connection.send("WUPushEvent",e,"json",!1,t,"WUPushEventResponse")}WUQuery(e,t){return this._connection.send("WUQuery",e,"json",!1,t,"WUQueryResponse")}WUQueryConfig(e,t){return this._connection.send("WUQueryConfig",e,"json",!1,t,"WUQueryConfigResponse")}WUQueryDetails(e,t){return this._connection.send("WUQueryDetails",e,"json",!1,t,"WUQueryDetailsResponse")}WUQueryDetailsLightWeight(e,t){return this._connection.send("WUQueryDetailsLightWeight",e,"json",!1,t,"WUQueryDetailsResponse")}WUQueryFiles(e,t){return this._connection.send("WUQueryFiles",e,"json",!1,t,"WUQueryFilesResponse")}WUQueryGetGraph(e,t){return this._connection.send("WUQueryGetGraph",e,"json",!1,t,"WUQueryGetGraphResponse")}WUQueryGetSummaryStats(e,t){return this._connection.send("WUQueryGetSummaryStats",e,"json",!1,t,"WUQueryGetSummaryStatsResponse")}WUQuerysetAliasAction(e,t){return this._connection.send("WUQuerysetAliasAction",e,"json",!1,t,"WUQuerySetAliasActionResponse")}WUQuerysetCopyQuery(e,t){return this._connection.send("WUQuerysetCopyQuery",e,"json",!1,t,"WUQuerySetCopyQueryResponse")}WUQuerysetDetails(e,t){return this._connection.send("WUQuerysetDetails",e,"json",!1,t,"WUQuerySetDetailsResponse")}WUQuerysetExport(e,t){return this._connection.send("WUQuerysetExport",e,"json",!1,t,"WUQuerysetExportResponse")}WUQuerysetImport(e,t){return this._connection.send("WUQuerysetImport",e,"json",!1,t,"WUQuerysetImportResponse")}WUQuerysetQueryAction(e,t){return this._connection.send("WUQuerysetQueryAction",e,"json",!1,t,"WUQuerySetQueryActionResponse")}WUQuerysets(e,t){return this._connection.send("WUQuerysets",e,"json",!1,t,"WUQuerysetsResponse")}WURecreateQuery(e,t){return this._connection.send("WURecreateQuery",e,"json",!1,t,"WURecreateQueryResponse")}WUResubmit(e,t){return this._connection.send("WUResubmit",e,"json",!1,t,"WUResubmitResponse")}WUResult(e,t){return this._connection.send("WUResult",e,"json",!1,t,"WUResultResponse")}WUResultBin(e,t){return this._connection.send("WUResultBin",e,"json",!1,t,"WUResultBinResponse")}WUResultSummary(e,t){return this._connection.send("WUResultSummary",e,"json",!1,t,"WUResultSummaryResponse")}WUResultView(e,t){return this._connection.send("WUResultView",e,"json",!1,t,"WUResultViewResponse")}WURun(e,t){return this._connection.send("WURun",e,"json",!1,t,"WURunResponse")}WUSchedule(e,t){return this._connection.send("WUSchedule",e,"json",!1,t,"WUScheduleResponse")}WUShowScheduled(e,t){return this._connection.send("WUShowScheduled",e,"json",!1,t,"WUShowScheduledResponse")}WUSubmit(e,t){return this._connection.send("WUSubmit",e,"json",!1,t,"WUSubmitResponse")}WUSyntaxCheckECL(e,t){return this._connection.send("WUSyntaxCheckECL",e,"json",!1,t,"WUSyntaxCheckResponse")}WUUpdate(e,t){return this._connection.send("WUUpdate",e,"json",!1,t,"WUUpdateResponse")}WUUpdateQueryEntry(e,t){return this._connection.send("WUUpdateQueryEntry",e,"json",!1,t,"WUUpdateQueryEntryResponse")}WUWaitCompiled(e,t){return this._connection.send("WUWaitCompiled",e,"json",!1,t,"WUWaitResponse")}WUWaitComplete(e,t){return this._connection.send("WUWaitComplete",e,"json",!1,t,"WUWaitResponse")}};var js=(M=>(M[M.Unknown=0]="Unknown",M[M.Compiled=1]="Compiled",M[M.Running=2]="Running",M[M.Completed=3]="Completed",M[M.Failed=4]="Failed",M[M.Archived=5]="Archived",M[M.Aborting=6]="Aborting",M[M.Aborted=7]="Aborted",M[M.Blocked=8]="Blocked",M[M.Submitted=9]="Submitted",M[M.Scheduled=10]="Scheduled",M[M.Compiling=11]="Compiling",M[M.Wait=12]="Wait",M[M.UploadingFiled=13]="UploadingFiled",M[M.DebugPaused=14]="DebugPaused",M[M.DebugRunning=15]="DebugRunning",M[M.Paused=16]="Paused",M[M.LAST=17]="LAST",M[M.NotFound=999]="NotFound",M))(js||{}),ze;(e=>{let n;(R=>(R[R.Unknown=0]="Unknown",R[R.Compile=1]="Compile",R[R.Check=2]="Check",R[R.Run=3]="Run",R[R.ExecuteExisting=4]="ExecuteExisting",R[R.Pause=5]="Pause",R[R.PauseNow=6]="PauseNow",R[R.Resume=7]="Resume",R[R.Debug=8]="Debug",R[R.__size=9]="__size"))(n=e.Action||={})})(ze||={});function Yn(n){return typeof n.Name=="string"}function ko(n){return n.TotalClusterTime!==void 0}function vo(n){return n.StateEx!==void 0}var ie=class extends Lt{constructor(e){super(e)}Ping(){return this._connection.send("Ping",{},"json",!1,void 0,"WsWorkunitsPingResponse").then(()=>({result:!0}))}WUQuery(e={},t){return this._connection.send("WUQuery",e,"json",!1,t).then(s=>(0,Hs.deepMixin)({Workunits:{ECLWorkunit:[]}},s))}WUInfo(e){let t={Wuid:"",TruncateEclTo64k:!0,IncludeExceptions:!1,IncludeGraphs:!1,IncludeSourceFiles:!1,IncludeResults:!1,IncludeResultsViewNames:!1,IncludeVariables:!1,IncludeTimers:!1,IncludeDebugValues:!1,IncludeApplicationValues:!1,IncludeWorkflows:!1,IncludeXmlSchemas:!1,IncludeResourceURLs:!1,IncludeECL:!1,IncludeHelpers:!1,IncludeAllowedClusters:!1,IncludeTotalClusterTime:!1,IncludeServiceNames:!1,SuppressResultSchemas:!0,...e};return super.WUInfo(t)}WUCreate(){return super.WUCreate({})}WUUpdate(e){return this._connection.send("WUUpdate",e,"json",!0)}WUResubmit(e){return this._connection.toESPStringArray(e,"Wuids"),super.WUResubmit(e)}WUAction(e){return e.ActionType=e.WUActionType,super.WUAction(e)}WUResult(e,t){return this._connection.send("WUResult",e,"json",!1,t)}WUFileEx(e){return this._connection.send("WUFile",e,"text")}_WUDetailsMetaPromise;WUDetailsMeta(e){return this._WUDetailsMetaPromise||(this._WUDetailsMetaPromise=super.WUDetailsMeta(e)),this._WUDetailsMetaPromise}WUCDebugEx(e){return this._connection.send("WUCDebug",e,void 0,void 0,void 0,"WUDebug").then(t=>{let r=(0,Hs.xml2json)(t.Result).children();return r.length?r[0]:null})}},Gt=class extends Lt{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};var rn=require("@hpcc-js/util");var We=require("@hpcc-js/util"),ni=Pe(Xn(),1),sn=Pe(jn(),1);var ue=require("@hpcc-js/util"),kt=class extends ue.StateObject{wu;get properties(){return this.get()}get Name(){return this.get("Name")}get Label(){return this.get("Label")}get Type(){return this.get("Type")}get Complete(){return this.get("Complete")}get WhenStarted(){return this.get("WhenStarted")}get WhenFinished(){return this.get("WhenFinished")}get Time(){return this.get("Time")}get Running(){return this.get("Running")}get RunningId(){return this.get("RunningId")}get Failed(){return this.get("Failed")}constructor(e,t,s){super(),this.wu=e;let r=0;for(let i of s)if(i.GraphName===t.Name&&!i.HasSubGraphId){r=Math.round(i.Seconds*1e3)/1e3;break}this.set({Time:r,...t})}fetchScopeGraph(e){return e?this.wu.fetchGraphDetails([e],["subgraph"]).then(t=>Ht(t)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(t=>Ht(t))}},vt=class extends ue.Cache{constructor(){super(e=>ue.Cache.hash([e.Name]))}};function Zr(n,e,t){t=t||[],t.push(n),e(n.name,n.$,n.children(),t),n.children().forEach(s=>{Zr(s,e,t)}),t.pop()}function qn(n){let e={};return n.forEach(t=>{t.name==="att"&&(e[t.$.name]=t.$.value)}),e}var _s=class extends ue.Graph{},zn=class extends ue.Subgraph{},Jn=class extends ue.Vertex{},Kn=class extends ue.Edge{};function tr(n,e){let t={},s={},r={},i=new _s(c=>c._.id),o=[i.root];return Zr(e,(c,d,x,l)=>{let E=o[o.length-1];switch(c){case"graph":break;case"node":if(x.length&&x[0].children().length&&x[0].children()[0].name==="graph"){let N=E.createSubgraph(qn(x));o.push(N),t[d.id]=N}let R=E.createVertex(qn(x));s[d.id]=R;break;case"edge":let I=E.createEdge(s[d.source],s[d.target],qn(x));r[d.id]=I;break;default:}}),i}var Vt=class extends ue.Graph{},Zn=class extends ue.Subgraph{},$n=class extends ue.Vertex{},er=class extends ue.Edge{};function Ht(n){let e={},t={},s={},r;for(let i of n)switch(i.ScopeType){case"graph":r=new Vt(l=>l._.Id,i),e[i.ScopeName]=r.root;break;case"subgraph":r||(r=new Vt(l=>l._.Id,i),e[i.ScopeName]=r.root);let o=i.parentScope().split(":"),c=e[i.parentScope()];for(;o.length&&!c;)c=e[o.join(":")],o.pop();if(!c)console.warn(`Missing SG:Parent (${i.Id}): ${i.parentScope()}`);else{let l=c;e[i.ScopeName]=l.createSubgraph(i)}break;case"activity":let d=e[i.parentScope()];d?s[i.ScopeName]=d.createVertex(i):console.warn(`Missing A:Parent (${i.Id}): ${i.parentScope()}`);break;case"edge":t[i.ScopeName]=i;break;case"function":let x=s[i.parentScope()];x?x._.children().push(i):console.warn(`Missing F:Parent (${i.Id}): ${i.parentScope()}`);break}for(let i in t){let o=t[i],c=e[o.parentScope()];if(!c)console.warn(`Missing E:Parent (${o.Id}): ${o.parentScope()}`);else{let d=c;try{let x=r.vertex(o.attr("IdSource").RawValue),l=r.vertex(o.attr("IdTarget").RawValue);d.createEdge(x,l,o)}catch{console.warn(`Invalid Edge: ${i}`)}}}return r}var $r=require("@hpcc-js/util"),jt=class extends $r.StateObject{wu;get properties(){return this.get()}get URL(){return this.get("URL")}get DisplayName(){return this.get("DisplayName")}get DisplayPath(){return this.get("DisplayPath")}constructor(e,t){super(),this.wu=e;let s=t.split("\\").join("/"),r=s.split("/"),i="res/"+this.wu.Wuid+"/",o="",c="";s.indexOf(i)===0&&(o=s.substr(i.length),c=r[r.length-1]),this.set({URL:t,DisplayName:c,DisplayPath:o})}};var Qe=require("@hpcc-js/util");var qt=require("@hpcc-js/util"),Ot=class{e;constructor(e){this.e=e}fix(){delete this.e}},_t=class extends Ot{name;type;isSet=!1;attrs={};_children=[];constructor(e){super(e)}append(e){this._children.push(e),this.type||(this.type="hpcc:childDataset")}fix(){this.name=this.e.$.name,this.type=this.e.$.type;for(let t=this._children.length-1;t>=0;--t){let s=this._children[t];s.name==="Row"&&s.type===void 0&&(this._children.push(...s._children),this._children.splice(t,1))}let e=this.setOfType();e&&(this.type=e,this.isSet=!0,this._children=[])}children(){return this._children}isAll(e){return e.name==="All"&&e.type===void 0}setOfType(){let e=this.children();if(this.type===void 0&&e.length===2){if(this.isAll(e[0]))return e[1].type;if(this.isAll(e[1]))return e[0].type}}charWidth(){let e=-1;switch(this.type){case"xs:boolean":e=5;break;case"xs:integer":e=8;break;case"xs:nonNegativeInteger":e=8;break;case"xs:double":e=8;break;case"xs:string":e=32;break;default:let t="0123456789",s=this.type.lastIndexOf("_"),r=s>0?s:this.type.length,i=r-1;for(;i>=0&&t.indexOf(this.type.charAt(i))!==-1;--i);i+1<r&&(e=parseInt(this.type.substring(i+1,r),10)),this.type.indexOf("data")===0&&(e*=2);break}return e<this.name.length&&(e=this.name.length),e}},Yt=class extends Ot{name;type;maxLength;_restricition;_maxLength;constructor(e){super(e)}append(e){switch(e.name){case"xs:restriction":this._restricition=e;break;case"xs:maxLength":this._maxLength=e;break;default:}}fix(){this.name=this.e.$.name,this.type=this._restricition.$.base,this.maxLength=this._maxLength?+this._maxLength.$.value:void 0,delete this._restricition,delete this._maxLength,super.fix()}},Xt=class{root;simpleTypes={};fields(){return this.root.children()}},Ys=class extends qt.SAXStackParser{schema=new Xt;simpleType;simpleTypes={};xsdStack=new qt.Stack;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":let t=new _t(e);this.schema.root?this.xsdStack.depth()&&this.xsdStack.top().append(t):this.schema.root=t,this.xsdStack.push(t);break;case"xs:simpleType":this.simpleType=new Yt(e);break;default:break}}endXMLNode(e){switch(e.name){case"xs:element":this.xsdStack.pop().fix();break;case"xs:simpleType":this.simpleType.fix(),this.simpleTypes[this.simpleType.name]=this.simpleType,delete this.simpleType;break;case"xs:appinfo":let s=this.xsdStack.top();for(let r in e.$)s.attrs[r]=e.$[r];break;default:this.simpleType&&this.simpleType.append(e)}super.endXMLNode(e)}};function Xs(n){let e=new Ys;return e.parse(n),e.schema}var sr=class extends Ys{_rootName;schema=new Xt;simpleTypes={};xsdStack=new qt.Stack;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":let t=new _t(e);!this.schema.root&&this._rootName===e.$.name&&(this.schema.root=t),this.xsdStack.depth()&&this.xsdStack.top().append(t),this.xsdStack.push(t);break;case"xsd:simpleType":this.simpleType=new Yt(e);break;default:break}}endXMLNode(e){switch(e.name){case"xsd:element":this.xsdStack.pop().fix();break;case"xsd:simpleType":break;default:break}super.endXMLNode(e)}};function Vo(n,e){let t=new sr(e);return t.parse(n),t.schema}var zs=class extends Qe.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}},qs=new zs,zt=class n extends Qe.StateObject{connection;_bypassCache=!1;get BaseUrl(){return this.connection.baseUrl}xsdSchema;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get ResultName(){return this.get("ResultName")}get ResultSequence(){return this.get("ResultSequence")}get LogicalFileName(){return this.get("LogicalFileName")}get Name(){return this.get("Name")}get Sequence(){return this.get("Sequence")}get Value(){return this.get("Value")}get Link(){return this.get("Link")}get FileName(){return this.get("FileName")}get IsSupplied(){return this.get("IsSupplied")}get ShowFileContent(){return this.get("ShowFileContent")}get Total(){return this.get("Total")}get ECLSchemas(){return this.get("ECLSchemas")}get NodeGroup(){return this.get("NodeGroup")}get ResultViews(){return this.get("ResultViews")}get XmlSchema(){return this.get("XmlSchema")}static attach(e,t,s,r){let i;return Array.isArray(r)?(i=qs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s.Name},()=>new n(e,t,s,r)),i.set(s)):typeof r>"u"&&(typeof s=="number"?i=qs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+s},()=>new n(e,t,s)):typeof s=="string"&&(i=qs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new n(e,t,s)))),i}static attachLogicalFile(e,t,s){return qs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new n(e,t,s,!0))}constructor(e,t,s,r){super(),e instanceof ie?this.connection=e:this.connection=new ie(e),typeof r=="boolean"&&r===!0?this.set({NodeGroup:t,LogicalFileName:s}):Yn(s)&&Array.isArray(r)?this.set({...s,Wuid:t,ResultName:s.Name,ResultViews:r}):typeof r>"u"?typeof s=="number"?this.set({Wuid:t,ResultSequence:s}):typeof s=="string"?this.set({Wuid:t,ResultName:s}):console.warn("Unknown Result.attach (1)"):console.warn("Unknown Result.attach (2)")}isComplete(){return this.Total!==-1}bypassCache(e){return e===void 0?this._bypassCache:(this._bypassCache=e,this)}_fetchXMLSchemaPromise;fetchXMLSchema(e=!1){return(!this._fetchXMLSchemaPromise||e)&&(this._fetchXMLSchemaPromise=this.WUResult().then(t=>t.Result?.XmlSchema?.xml?(this.xsdSchema=Xs(t.Result.XmlSchema.xml),this.xsdSchema):null)),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(e=0,t=-1,s=!1,r={},i,o){let c=o??this._bypassCache;return this.WUResult(e,t,!s,r,i,c).then(d=>{let x=d.Result;return delete d.Result,this.set({...d}),(0,Qe.exists)("XmlSchema.xml",x)&&(this.xsdSchema=Xs(x.XmlSchema.xml)),(0,Qe.exists)("Row",x)?x.Row:this.ResultName&&(0,Qe.exists)(this.ResultName,x)?x[this.ResultName].Row:[]})}rootField(){return this.xsdSchema?this.xsdSchema.root:null}fields(){return this.xsdSchema?this.xsdSchema.root.children():[]}WUResult(e=0,t=1,s=!1,r={},i,o=!1){let c={NamedValue:{itemcount:0}};for(let x in r)c.NamedValue[c.NamedValue.itemcount++]={Name:x,Value:r[x]};let d={FilterBy:c};return this.Wuid&&this.ResultName!==void 0?(d.Wuid=this.Wuid,d.ResultName=this.ResultName):this.Wuid&&this.ResultSequence!==void 0?(d.Wuid=this.Wuid,d.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(d.LogicalName=this.LogicalFileName,d.Cluster=this.NodeGroup):this.LogicalFileName&&(d.LogicalName=this.LogicalFileName),d.Start=e,d.Count=t,d.SuppressXmlSchema=s,d.BypassCachedResult=o,this.connection.WUResult(d,i).then(x=>x)}},Jt=class extends Qe.Cache{constructor(){super(e=>Qe.Cache.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};var nr=require("@hpcc-js/util"),Je=class extends nr.StateObject{scope;get properties(){return this.get()}get Name(){return this.get("Name")}get RawValue(){return this.get("RawValue")}get Formatted(){return this.get("Formatted")}get FormattedEnd(){return this.get("FormattedEnd")}get Measure(){return this.get("Measure")}get Creator(){return this.get("Creator")}get CreatorType(){return this.get("CreatorType")}constructor(e,t){super(),this.scope=e,this.set(t)}},Js=class extends nr.StateObject{_attributeMap={};_children=[];get properties(){return this.get()}get ScopeName(){return this.get("ScopeName")}get Id(){return this.get("Id")}get ScopeType(){return this.get("ScopeType")}get Properties(){return this.get("Properties",{Property:[]})}get Notes(){return this.get("Notes",{Note:[]})}get SinkActivity(){return this.get("SinkActivity")}get CAttributes(){let e=[],t={start:null,end:null};return this.Properties.Property.forEach(s=>{s.Measure==="ts"&&s.Name.indexOf("Started")>=0?t.start=s:this.ScopeName&&s.Measure==="ts"&&s.Name.indexOf("Finished")>=0?t.end=s:e.push(new Je(this,s))}),t.start&&t.end?(t.start.FormattedEnd=t.end.Formatted,e.push(new Je(this,t.start))):t.start?e.push(new Je(this,t.start)):t.end&&e.push(new Je(this,t.end)),e}constructor(e){super(),this.update(e)}update(e){this.set(e),this.CAttributes.forEach(t=>{this._attributeMap[t.Name]=t}),this.Properties.Property=[];for(let t in this._attributeMap)this._attributeMap.hasOwnProperty(t)&&this.Properties.Property.push(this._attributeMap[t].properties)}parentScope(){let e=this.ScopeName.split(":");return e.pop(),e.join(":")}children(e){return arguments.length?(this._children=e,this):this._children}walk(e){if(e.start(this))return!0;for(let t of this.children())if(t.walk(e))return!0;return e.end(this)}formattedAttrs(){let e={};for(let t in this._attributeMap)e[t]=this._attributeMap[t].Formatted||this._attributeMap[t].RawValue;return e}rawAttrs(){let e={};for(let t in this._attributeMap)e[t]=this._attributeMap[t].RawValue;return e}hasAttr(e){return this._attributeMap[e]!==void 0}attr(e){return this._attributeMap[e]||new Je(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let t=this.Id,s=[];s.push(`<tr><td class="key">ID:</td><td class="value">${this.Id}</td></tr>`),e&&s.push(`<tr><td class="key">Parent ID:</td><td class="value">${e.Id}</td></tr>`),s.push(`<tr><td class="key">Scope:</td><td class="value">${this.ScopeName}</td></tr>`);let r=this.formattedAttrs();for(let i in r)i==="Label"?t=r[i]:s.push(`<tr><td class="key">${i}</td><td class="value">${r[i]}</td></tr>`);return`<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">
911
911
  <h4 align="center">${t}</h4>
912
912
  <table>
913
913
  ${s.join("")}
914
914
  </table>
915
- </div>`}},At=class extends Js{wu;constructor(e,t){super(t),this.wu=e}};var ei=require("@hpcc-js/util");var Kt=class extends ei.StateObject{connection;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get FileCluster(){return this.get("FileCluster")}get Name(){return this.get("Name")}get IsSuperFile(){return this.get("IsSuperFile")}get Subs(){return this.get("Subs")}get Count(){return this.get("Count")}get ECLSourceFiles(){return this.get("ECLSourceFiles")}constructor(e,t,s){super(),e instanceof re?this.connection=e:this.connection=new re(e),this.set({Wuid:t,...s})}};var Ks=require("@hpcc-js/util");var Zt=class extends Ks.StateObject{connection;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get Name(){return this.get("Name")}get Value(){return this.get("Value")}get Seconds(){return this.get("Seconds")}get GraphName(){return this.get("GraphName")}get SubGraphId(){return this.get("SubGraphId")}get HasSubGraphId(){return this.get("HasSubGraphId")}get count(){return this.get("count")}get Timestamp(){return this.get("Timestamp")}get When(){return this.get("When")}constructor(e,t,s){super(),e instanceof re?this.connection=e:this.connection=new re(e);let r=(0,Ks.espTime2Seconds)(s.Value);this.set({Wuid:t,Seconds:Math.round(r*1e3)/1e3,HasSubGraphId:s.SubGraphId!==void 0,...s})}};var Ho=(0,sn.utcFormat)("%Y-%m-%dT%H:%M:%S.%LZ"),jo=(0,sn.utcParse)("%Y-%m-%dT%H:%M:%S.%LZ"),Oo=(0,ni.format)(",");function _o(n){return n&&!isNaN(+n)?Oo(+n):n}var ti="DefinitionList",Yo=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,ri=["Avg","Min","Max","Delta","StdDev"],ii=["SkewMin","SkewMax","NodeMin","NodeMax"],Xo=/[A-Z][a-z]*/g;function qo(n){for(let t of ii){let s=n.indexOf(t);if(s===0){let i=n.slice(s+t.length);return{measure:"",ext:t,label:i}}}let e=n.match(Xo);if(e?.length){let t=e.shift(),s=e.join("");for(let r of ri){let i=s.indexOf(r);if(i===0)return s=s.slice(i+r.length),{measure:t,ext:r,label:s}}return{measure:t,ext:"",label:s}}return{measure:"",ext:"",label:n}}var si={};function oi(n){let e=si[n];return e||(e=qo(n),si[n]=e),e}function Le(n,e){return n.__formattedProps?.[e]??n[e]}function Zs(n){if(n===void 0)return;let e=parseFloat(n);return isNaN(e)?void 0:e}function zo(n,e,t){let s=oi(e);if(!t[s.measure]){t[s.label]=!0;let r=Zs(n[`${s.measure}Avg${s.label}`]),i=Zs(n[`${s.measure}Min${s.label}`]),o=Zs(n[`${s.measure}Max${s.label}`]),c=Zs(n[`${s.measure}StdDev${s.label}`]),d=Math.max((r-i)/c,(o-r)/c);return{Key:`${s.measure}${s.label}`,Value:Le(n,`${s.measure}${s.label}`),Avg:Le(n,`${s.measure}Avg${s.label}`),Min:Le(n,`${s.measure}Min${s.label}`),Max:Le(n,`${s.measure}Max${s.label}`),Delta:Le(n,`${s.measure}Delta${s.label}`),StdDev:Le(n,`${s.measure}StdDev${s.label}`),StdDevs:isNaN(d)?void 0:d,SkewMin:Le(n,`SkewMin${s.label}`),SkewMax:Le(n,`SkewMax${s.label}`),NodeMin:Le(n,`NodeMin${s.label}`),NodeMax:Le(n,`NodeMax${s.label}`)}}return null}var $s=(0,xe.scopedLogger)("workunit.ts"),tn=class extends xe.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}},en=new tn,ct=class n extends xe.StateObject{connection;topologyConnection;get BaseUrl(){return this.connection.baseUrl}_debugMode=!1;_debugAllGraph;_submitAction;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get Owner(){return this.get("Owner","")}get Cluster(){return this.get("Cluster","")}get Jobname(){return this.get("Jobname","")}get Description(){return this.get("Description","")}get ActionEx(){return this.get("ActionEx","")}get StateID(){return this.get("StateID",0)}get State(){return this.get("State")||js[this.StateID]}get Protected(){return this.get("Protected",!1)}get Exceptions(){return this.get("Exceptions",{ECLException:[]})}get ResultViews(){return this.get("ResultViews",{View:[]})}_resultCache=new Jt;get ResultCount(){return this.get("ResultCount",0)}get Results(){return this.get("Results",{ECLResult:[]})}get CResults(){return this.Results.ECLResult.map(e=>this._resultCache.get(e,()=>zt.attach(this.connection,this.Wuid,e,this.ResultViews.View)))}get SequenceResults(){let e={};return this.CResults.forEach(t=>{e[t.Sequence]=t}),e}get Timers(){return this.get("Timers",{ECLTimer:[]})}get CTimers(){return this.Timers.ECLTimer.map(e=>new Zt(this.connection,this.Wuid,e))}_graphCache=new vt;get GraphCount(){return this.get("GraphCount",0)}get Graphs(){return this.get("Graphs",{ECLGraph:[]})}get CGraphs(){return this.Graphs.ECLGraph.map(e=>this._graphCache.get(e,()=>new kt(this,e,this.CTimers)))}get ThorLogList(){return this.get("ThorLogList")}get ResourceURLCount(){return this.get("ResourceURLCount",0)}get ResourceURLs(){return this.get("ResourceURLs",{URL:[]})}get CResourceURLs(){return this.ResourceURLs.URL.map(e=>new jt(this,e))}get TotalClusterTime(){return this.get("TotalClusterTime","")}get DateTimeScheduled(){return this.get("DateTimeScheduled")}get IsPausing(){return this.get("IsPausing")}get ThorLCR(){return this.get("ThorLCR")}get ApplicationValues(){return this.get("ApplicationValues",{ApplicationValue:[]})}get HasArchiveQuery(){return this.get("HasArchiveQuery")}get StateEx(){return this.get("StateEx")}get PriorityClass(){return this.get("PriorityClass")}get PriorityLevel(){return this.get("PriorityLevel")}get Snapshot(){return this.get("Snapshot")}get ResultLimit(){return this.get("ResultLimit")}get EventSchedule(){return this.get("EventSchedule")}get Query(){return this.get("Query")}get HelpersCount(){return this.get("HelpersCount",0)}get Helpers(){return this.get("Helpers",{ECLHelpFile:[]})}get DebugValues(){return this.get("DebugValues")}get AllowedClusters(){return this.get("AllowedClusters")}get ErrorCount(){return this.get("ErrorCount",0)}get WarningCount(){return this.get("WarningCount",0)}get InfoCount(){return this.get("InfoCount",0)}get AlertCount(){return this.get("AlertCount",0)}get SourceFileCount(){return this.get("SourceFileCount",0)}get SourceFiles(){return this.get("SourceFiles",{ECLSourceFile:[]})}get CSourceFiles(){return this.SourceFiles.ECLSourceFile.map(e=>new Kt(this.connection,this.Wuid,e))}get VariableCount(){return this.get("VariableCount",0)}get Variables(){return this.get("Variables",{ECLResult:[]})}get TimerCount(){return this.get("TimerCount",0)}get HasDebugValue(){return this.get("HasDebugValue")}get ApplicationValueCount(){return this.get("ApplicationValueCount",0)}get XmlParams(){return this.get("XmlParams")}get AccessFlag(){return this.get("AccessFlag")}get ClusterFlag(){return this.get("ClusterFlag")}get ResultViewCount(){return this.get("ResultViewCount",0)}get DebugValueCount(){return this.get("DebugValueCount",0)}get WorkflowCount(){return this.get("WorkflowCount",0)}get Archived(){return this.get("Archived")}get RoxieCluster(){return this.get("RoxieCluster")}get DebugState(){return this.get("DebugState",{})}get Queue(){return this.get("Queue")}get Active(){return this.get("Active")}get Action(){return this.get("Action")}get Scope(){return this.get("Scope")}get AbortBy(){return this.get("AbortBy")}get AbortTime(){return this.get("AbortTime")}get Workflows(){return this.get("Workflows")}get TimingData(){return this.get("TimingData")}get HelpersDesc(){return this.get("HelpersDesc")}get GraphsDesc(){return this.get("GraphsDesc")}get SourceFilesDesc(){return this.get("SourceFilesDesc")}get ResultsDesc(){return this.get("ResultsDesc")}get VariablesDesc(){return this.get("VariablesDesc")}get TimersDesc(){return this.get("TimersDesc")}get DebugValuesDesc(){return this.get("DebugValuesDesc")}get ApplicationValuesDesc(){return this.get("ApplicationValuesDesc")}get WorkflowsDesc(){return this.get("WorkflowsDesc")}get ServiceNames(){return this.get("ServiceNames")}get CompileCost(){return this.get("CompileCost")}get ExecuteCost(){return this.get("ExecuteCost")}get FileAccessCost(){return this.get("FileAccessCost")}get NoAccess(){return this.get("NoAccess")}get ECLWUProcessList(){return this.get("ECLWUProcessList")}get CostSavingPotential(){return this.get("CostSavingPotential")}get FailureDesc(){return this.get("FailureDesc")}static create(e){let t=new n(e);return t.connection.WUCreate().then(s=>(en.set(t),t.set(s.Workunit),t))}static attach(e,t,s){let r=en.get({BaseUrl:e.baseUrl,Wuid:t},()=>new n(e,t));return s&&r.set(s),r}static existsLocal(e,t){return en.has({BaseUrl:e,Wuid:t})}static submit(e,t,s,r=!1){return n.create(e).then(i=>i.update({QueryText:s})).then(i=>r?i.submit(t,ze.Action.Compile):i.submit(t))}static compile(e,t,s){return n.submit(e,t,s,!0)}static query(e,t){return new re(e).WUQuery(t).then(r=>r.Workunits.ECLWorkunit.map(function(i){return n.attach(e,i.Wuid,i)}))}constructor(e,t){super(),this.connection=new re(e),this.topologyConnection=new oe(e),this.clearState(t)}clearState(e){this.clear({Wuid:e,StateID:0})}update(e){return this.connection.WUUpdate({...e,Wuid:this.Wuid,StateOrig:this.StateID,JobnameOrig:this.Jobname,DescriptionOrig:this.Description,ProtectedOrig:this.Protected,ClusterOrig:this.Cluster}).then(t=>(this.set(t.Workunit),this))}submit(e,t=ze.Action.Run,s){let r;return e!==void 0?r=Promise.resolve(e):r=this.topologyConnection.DefaultTpLogicalClusterQuery().then(i=>i.Name),this._debugMode=!1,t===ze.Action.Debug&&(t=ze.Action.Run,this._debugMode=!0),r.then(i=>this.connection.WUUpdate({Wuid:this.Wuid,Action:t,ResultLimit:s,DebugValues:{DebugValue:[{Name:"Debug",Value:this._debugMode?"1":""}]}}).then(o=>(this.set(o.Workunit),this._submitAction=t,this.connection.WUSubmit({Wuid:this.Wuid,Cluster:i})))).then(()=>this)}isComplete(){switch(this.StateID){case 1:return this.ActionEx==="compile"||this._submitAction===ze.Action.Compile;case 3:case 4:case 7:case 999:return!0;default:}return!1}isFailed(){switch(this.StateID){case 7:case 4:return!0;default:}return!1}isDeleted(){return this.StateID===999}isDebugging(){switch(this.StateID){case 14:case 15:return!0;default:}return this._debugMode}isRunning(){switch(this.StateID){case 1:case 2:case 6:case 8:case 14:case 15:return!0;default:}return!1}setToFailed(){return this.WUAction(de.ECLWUActions.SetToFailed)}pause(){return this.WUAction(de.ECLWUActions.Pause)}pauseNow(){return this.WUAction(de.ECLWUActions.PauseNow)}resume(){return this.WUAction(de.ECLWUActions.Resume)}abort(){return this.WUAction(de.ECLWUActions.Abort)}protect(){return this.WUAction(de.ECLWUActions.Protect)}unprotect(){return this.WUAction(de.ECLWUActions.Unprotect)}delete(){return this.WUAction(de.ECLWUActions.Delete)}restore(){return this.WUAction(de.ECLWUActions.Restore)}deschedule(){return this.WUAction(de.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(de.ECLWUActions.Reschedule)}resubmit(){return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!1}).then(()=>(this.clearState(this.Wuid),this.refresh().then(()=>(this._monitor(),this))))}clone(){return this.WUResubmit({CloneWorkunit:!0,ResetWorkflow:!1}).then(e=>n.attach(this.connection.opts(),e.WUs.WU[0].WUID).refresh())}async refreshState(){return await this.WUQuery(),this.StateID===1&&!this.ActionEx&&!this._submitAction&&await this.refreshInfo(),this}async refreshInfo(e){return await this.WUInfo(e),this}async refreshDebug(){return await this.debugStatus(),this}async refresh(e=!1,t){return e?await Promise.all([this.refreshInfo(t),this.refreshDebug()]):await this.refreshState(),this}eclExceptions(){return this.Exceptions.ECLException}fetchArchive(){return this.connection.WUFileEx({Wuid:this.Wuid,Type:"ArchiveQuery"})}fetchECLExceptions(){return this.WUInfo({IncludeExceptions:!0}).then(()=>this.eclExceptions())}fetchResults(){return this.WUInfo({IncludeResults:!0}).then(()=>this.CResults)}fetchGraphs(){return this.WUInfo({IncludeGraphs:!0}).then(()=>this.CGraphs)}fetchQuery(){return this.WUInfo({IncludeECL:!0,TruncateEclTo64k:!1}).then(()=>this.Query)}fetchHelpers(){return this.WUInfo({IncludeHelpers:!0}).then(()=>this.Helpers?.ECLHelpFile||[])}fetchAllowedClusters(){return this.WUInfo({IncludeAllowedClusters:!0}).then(()=>this.AllowedClusters?.AllowedCluster||[])}fetchTotalClusterTime(){return this.WUInfo({IncludeTotalClusterTime:!0}).then(()=>this.TotalClusterTime)}fetchServiceNames(){return this.WUInfo({IncludeServiceNames:!0}).then(()=>this.ServiceNames?.Item)}fetchDetailsMeta(e={}){return this.WUDetailsMeta(e)}fetchDetailsRaw(e={}){return this.WUDetails(e).then(t=>t.Scopes.Scope)}normalizeDetails(e,t){let s={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},r=new Map;for(let o of e.Activities?.Activity??[])r.set(o.Kind,o.Name);let i=new Array(t.length);for(let o=0;o<t.length;o++){let c=t[o],d={},y={};if(c.Properties?.Property)for(let V of c.Properties.Property){let B=V.Measure,q=V.Name,k=V.RawValue;if(B==="ns"&&(V.Measure="s"),q==="Kind"){let P=parseInt(k,10);V.Formatted=r.get(P)??k}switch(s[q]={Name:V.Name,Measure:V.Measure,Creator:V.Creator,CreatorType:V.CreatorType},V.Measure){case"bool":d[q]=!!+k;break;case"sz":d[q]=+k;break;case"s":d[q]=+k/1e9;break;case"ns":d[q]=+k;break;case"ts":d[q]=new Date(+k/1e3).toISOString();break;case"cnt":d[q]=+k;break;case"cost":d[q]=+k/1e6;break;case"node":d[q]=+k;break;case"skw":d[q]=+k;break;default:d[q]=k}y[q]=_o(V.Formatted??d[q])}let l={id:c.Id,name:c.ScopeName,type:c.ScopeType,Kind:c.Kind,Label:c.Label,__formattedProps:y,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...d},E=l[ti];if(E)try{let V=JSON.parse(E.split("\\").join("\\\\")),B=[];for(let q=0;q<V.length;q++){let k=V[q].match(Yo);k&&B.push({filePath:(k[1]??"")+k[2]+k[3],line:parseInt(k[5],10),col:parseInt(k[6],10)})}l[ti]=B}catch{$s.error(`Unexpected "DefinitionList": ${E}`)}let R={},M=0,w="";for(let V in l)if(!V.startsWith("__")){let B=zo(l,V,R);B&&(l.__groupedProps[B.Key]=B,!isNaN(B.StdDevs)&&B.StdDevs>M&&(M=B.StdDevs,w=B.Key))}l.__StdDevs=M,l.__StdDevsSource=w,i[o]=l}return{meta:e,columns:s,data:i}}fetchDetailsNormalized(e={}){return Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(t=>this.normalizeDetails(t[0],t[1]))}fetchInfo(e={}){return this.WUInfo(e)}fetchDetails(e={}){return this.WUDetails(e).then(t=>t.Scopes.Scope.map(s=>new At(this,s)))}fetchDetailsHierarchy(e={}){return this.WUDetails(e).then(t=>{let s=[],r={};t.Scopes.Scope.forEach(i=>{if(r[i.ScopeName])return r[i.ScopeName].update(i),null;{let o=new At(this,i);return r[o.ScopeName]=o,o}});for(let i in r)if(r.hasOwnProperty(i)){let o=r[i],c=o.parentScope();c&&r[c]?r[c].children().push(o):s.push(o)}return s})}fetchGraphDetails(e=[],t){return this.fetchDetails({ScopeFilter:{MaxDepth:999999,Ids:e,ScopeTypes:t},NestedFilter:{Depth:999999,ScopeTypes:["graph","subgraph","activity","edge","function"]},PropertiesToReturn:{AllStatistics:!0,AllAttributes:!0,AllHints:!0,AllProperties:!0,AllScopes:!0},ScopeOptions:{IncludeId:!0,IncludeScope:!0,IncludeScopeType:!0},PropertyOptions:{IncludeName:!0,IncludeRawValue:!0,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}})}fetchScopeGraphs(e=[]){return this.fetchGraphDetails(e,["graph"]).then(t=>Ht(t))}fetchTimeElapsed(){return this.fetchDetails({ScopeFilter:{PropertyFilters:{PropertyFilter:[{Name:"TimeElapsed"}]}}}).then(e=>{let t={};e.forEach(r=>{t[r.ScopeName]=t[r.ScopeName]||{scope:r.ScopeName,start:null,elapsed:null,finish:null},r.CAttributes.forEach(i=>{i.Name==="TimeElapsed"?t[r.ScopeName].elapsed=+i.RawValue:i.Measure==="ts"&&i.Name.indexOf("Started")>=0&&(t[r.ScopeName].start=i.Formatted)})});let s=[];for(let r in t){let i=t[r];if(i.start&&i.elapsed){let o=jo(i.start);o.setMilliseconds(o.getMilliseconds()+i.elapsed/1e6),i.finish=Ho(o),s.push(i)}}return s.sort((r,i)=>r.start<i.start?-1:r.start>i.start?1:0),s})}_monitor(){if(this.isComplete()){this._monitorTickCount=0;return}super._monitor()}_monitorTimeoutDuration(){let e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?1e3:this._monitorTickCount<=3?3e3:this._monitorTickCount<=5?5e3:this._monitorTickCount<=7?1e4:e}on(e,t,s){if(this.isCallback(t))switch(e){case"completed":super.on("propChanged","StateID",r=>{this.isComplete()&&t([r])});break;case"changed":super.on(e,t);break;default:}else e==="changed"&&super.on(e,t,s);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,s)=>{let r=this.watch(i=>{e&&e(i),this.isComplete()&&(r.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,s)=>{let r=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(r.release(),t(this))})})}WUQuery(e={}){return this.connection.WUQuery({...e,Wuid:this.Wuid}).then(t=>(t.Workunits.ECLWorkunit.length===0?(this.clearState(this.Wuid),this.set("StateID",999)):this.set(t.Workunits.ECLWorkunit[0]),t)).catch(t=>{if(!t.Exception.some(r=>r.Code===20081?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw $s.warning(`Unexpected ESP exception: ${t.message}`),t;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),en.set(this),e))}WUInfo(e={}){let t=e.IncludeResults||e.IncludeResultsViewNames;return this.connection.WUInfo({...e,Wuid:this.Wuid,IncludeResults:t,IncludeResultsViewNames:t,SuppressResultSchemas:!1}).then(s=>(this.set(s.Workunit),t&&this.set({ResultViews:s.ResultViews}),s)).catch(s=>{if(!s.Exception.some(i=>i.Code===20080?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw $s.warning(`Unexpected ESP exception: ${s.message}`),s;return{}})}WUResubmit(e){return this.connection.WUResubmit((0,xe.deepMixinT)({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails((0,xe.deepMixinT)({ScopeFilter:{MaxDepth:9999},ScopeOptions:{IncludeMatchedScopesInResults:!0,IncludeScope:!0,IncludeId:!1,IncludeScopeType:!1},PropertyOptions:{IncludeName:!0,IncludeRawValue:!1,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}},e,{WUID:this.Wuid})).then(t=>(0,xe.deepMixinT)({Scopes:{Scope:[]}},t))}WUAction(e){return this.connection.WUAction({Wuids:{Item:[this.Wuid]},WUActionType:e}).then(t=>this.refresh().then(()=>(this._monitor(),t)))}publish(e){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:e||this.Jobname,AllowForeignFiles:!0,Activate:de.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){let t=new Gt({baseUrl:""}),s={Wuid:this.Wuid,Cluster:this.Cluster,JobName:this.Jobname,AllowForeignFiles:!0,Activate:1,Wait:5e3,...e};return t.WUPublishWorkunitEx(s)}WUCDebug(e,t={}){let s="";for(let r in t)t.hasOwnProperty(r)&&(s+=` ${r}='${t[r]}'`);return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:`<debug:${e} uid='${this.Wuid}'${s}/>`}).then(r=>r)}debug(e,t){return this.isDebugging()?this.WUCDebug(e,t).then(s=>{let r=s.children(e);return r.length?r[0]:new xe.XMLNode(e)}).catch(s=>($s.error(s),Promise.resolve(new xe.XMLNode(e)))):Promise.resolve(new xe.XMLNode(e))}debugStatus(){return this.isDebugging()?this.debug("status").then(e=>{let t={...this.DebugState,...e.$};return this.set({DebugState:t}),e}):Promise.resolve({DebugState:{state:"unknown"}})}debugContinue(e=""){return this.debug("continue",{mode:e})}debugStep(e){return this.debug("step",{mode:e})}debugPause(){return this.debug("interrupt")}debugQuit(){return this.debug("quit")}debugDeleteAllBreakpoints(){return this.debug("delete",{idx:0})}debugBreakpointResponseParser(e){return e.children().map(t=>{if(t.name==="break")return t.$})}debugBreakpointAdd(e,t,s){return this.debug("breakpoint",{id:e,mode:t,action:s}).then(r=>this.debugBreakpointResponseParser(r))}debugBreakpointList(){return this.debug("list").then(e=>this.debugBreakpointResponseParser(e))}debugGraph(){return this._debugAllGraph&&this.DebugState._prevGraphSequenceNum===this.DebugState.graphSequenceNum?Promise.resolve(this._debugAllGraph):this.debug("graph",{name:"all"}).then(e=>(this.DebugState._prevGraphSequenceNum=this.DebugState.graphSequenceNum,this._debugAllGraph=tr(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(t=>Zo(t,e))}debugPrint(e,t=0,s=10){return this.debug("print",{edgeID:e,startRow:t,numRows:s}).then(r=>r.children().map(i=>{let o={};return i.children().forEach(c=>{o[c.name]=c.content}),o}))}},rr="definition";function Jo(n){return n._[rr]!==void 0}function Ko(n){let e=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(n._[rr]);if(e){let[,t,s,r]=e;return t.replace(/\/\.\//g,"/"),{id:n._.id,file:t,line:+s,column:+r}}throw new Error(`Bad definition: ${n._[rr]}`)}function Zo(n,e){let t=[];for(let s of n.vertices)if(Jo(s)){let r=Ko(s);(r&&!e||e===r.file)&&t.push(r)}return t.sort((s,r)=>s.line-r.line)}var nn,ir=class n extends rn.StateObject{connection;get properties(){return this.get()}get Exceptions(){return this.get("Exceptions")}get Build(){return this.get("Build")}get ThorClusterList(){return this.get("ThorClusterList")}get RoxieClusterList(){return this.get("RoxieClusterList")}get HThorClusterList(){return this.get("HThorClusterList")}get DFUJobs(){return this.get("DFUJobs")}get Running(){return this.get("Running",{ActiveWorkunit:[]})}get BannerContent(){return this.get("BannerContent")}get BannerColor(){return this.get("BannerColor")}get BannerSize(){return this.get("BannerSize")}get BannerScroll(){return this.get("BannerScroll")}get ChatURL(){return this.get("ChatURL")}get ShowBanner(){return this.get("ShowBanner")}get ShowChatURL(){return this.get("ShowChatURL")}get SortBy(){return this.get("SortBy")}get Descending(){return this.get("Descending")}get SuperUser(){return this.get("SuperUser")}get AccessRight(){return this.get("AccessRight")}get ServerJobQueues(){return this.get("ServerJobQueues")}get ActivityTime(){return this.get("ActivityTime")}get DaliDetached(){return this.get("DaliDetached")}static attach(e,t){return nn||(nn=new n(e)),t&&nn.set(t),nn}constructor(e){super(),e instanceof Ct?this.connection=e:this.connection=new Ct(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(t=>e===""||t.ClusterName===e).map(t=>ct.attach(this.connection.connectionOptions(),t.Wuid,t))}setBanner(e){return this.connection.SetBanner({...e}).then(t=>(this.set(t),this))}lazyRefresh=(0,rn.debounce)(async()=>{let e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}};var yt=require("@hpcc-js/util");var $o=(0,yt.scopedLogger)("logicalFile.ts"),on=class extends yt.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}},ea=new on,or=class n extends yt.StateObject{connection;get BaseUrl(){return this.connection.baseUrl}get Cluster(){return this.get("Cluster")}get Name(){return this.get("Name")}get Filename(){return this.get("Filename")}get Prefix(){return this.get("Prefix")}get NodeGroup(){return this.get("NodeGroup")}get NumParts(){return this.get("NumParts")}get Description(){return this.get("Description")}get Dir(){return this.get("Dir")}get PathMask(){return this.get("PathMask")}get Filesize(){return this.get("Filesize")}get FileSizeInt64(){return this.get("FileSizeInt64")}get RecordSize(){return this.get("RecordSize")}get RecordCount(){return this.get("RecordCount")}get RecordSizeInt64(){return this.get("RecordSizeInt64")}get RecordCountInt64(){return this.get("RecordCountInt64")}get Wuid(){return this.get("Wuid")}get Owner(){return this.get("Owner")}get JobName(){return this.get("JobName")}get Persistent(){return this.get("Persistent")}get Format(){return this.get("Format")}get MaxRecordSize(){return this.get("MaxRecordSize")}get CsvSeparate(){return this.get("CsvSeparate")}get CsvQuote(){return this.get("CsvQuote")}get CsvTerminate(){return this.get("CsvTerminate")}get CsvEscape(){return this.get("CsvEscape")}get Modified(){return this.get("Modified")}get Ecl(){return this.get("Ecl")}get Stat(){return this.get("Stat")}get DFUFilePartsOnClusters(){return this.get("DFUFilePartsOnClusters")}get isSuperfile(){return this.get("isSuperfile")}get ShowFileContent(){return this.get("ShowFileContent")}get subfiles(){return this.get("subfiles")}get Superfiles(){return this.get("Superfiles")}get ProtectList(){return this.get("ProtectList")}get FromRoxieCluster(){return this.get("FromRoxieCluster")}get Graphs(){return this.get("Graphs")}get UserPermission(){return this.get("UserPermission")}get ContentType(){return this.get("ContentType")}get CompressedFileSize(){return this.get("CompressedFileSize")}get PercentCompressed(){return this.get("PercentCompressed")}get IsCompressed(){return this.get("IsCompressed")}get BrowseData(){return this.get("BrowseData")}get jsonInfo(){return this.get("jsonInfo")}get binInfo(){return this.get("binInfo")}get PackageID(){return this.get("PackageID")}get Partition(){return this.get("Partition")}get Blooms(){return this.get("Blooms")}get ExpireDays(){return this.get("ExpireDays")}get KeyType(){return this.get("KeyType")}get IsRestricted(){return this.get("IsRestricted")}get AtRestCost(){return this.get("AtRestCost")}get AccessCost(){return this.get("AccessCost")}get StateID(){return this.get("StateID")}get ExpirationDate(){return this.get("ExpirationDate")}get ExtendedIndexInfo(){return this.get("ExtendedIndexInfo")}get CompressionType(){return this.get("CompressionType")}get properties(){return this.get()}static attach(e,t,s,r){let i=ea.get({BaseUrl:e.baseUrl,Cluster:t,Name:s},()=>new n(e,t,s));return r&&i.set(r),i}constructor(e,t,s){super(),e instanceof St?this.connection=e:this.connection=new St(e),this.clear({Cluster:t,Name:s})}filePartsOnCluster(){return[...this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[]]}fileParts(){let e=[];for(let t of this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[])for(let s of t?.DFUFileParts?.DFUPart||[]){let r={...t,...s};delete r.DFUFileParts,e.push(r)}return e}update(e){return this.connection.DFUInfo({...e,Cluster:this.Cluster,Name:this.Name}).then(t=>(this.set({Cluster:this.Cluster,...t.FileDetail}),t))}fetchInfo(){return this.connection.DFUInfo({Cluster:this.Cluster,Name:this.Name}).then(e=>(this.set({Cluster:this.Cluster,...e.FileDetail,ProtectList:e?.FileDetail?.ProtectList??{DFUFileProtect:[]}}),e.FileDetail)).catch(e=>{if(!e.Exception.some(s=>s.Code===20038?(this.set("Name",this.Name+" (Deleted)"),this.set("StateID",999),!0):!1))throw $o.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}fetchDefFile(e){return this.connection.DFUFile({Name:this.Name,Format:e})}fetchAllLogicalFiles(){return this.connection.recursiveFetchLogicalFiles([this])}fetchListHistory(){return this.connection.ListHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}eraseHistory(){return this.connection.EraseHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}};var cn=require("@hpcc-js/util");var an=class extends cn.Cache{constructor(){super(e=>e.Address)}},ta=new an,$t=class n extends cn.StateObject{connection;get Address(){return this.get("Address")}get ConfigAddress(){return this.get("ConfigAddress")}get Name(){return this.get("Name")}get ProcessType(){return this.get("ProcessType")}get DisplayType(){return this.get("DisplayType")}get Description(){return this.get("Description")}get AgentVersion(){return this.get("AgentVersion")}get Contact(){return this.get("Contact")}get Location(){return this.get("Location")}get UpTime(){return this.get("UpTime")}get ComponentName(){return this.get("ComponentName")}get ComponentPath(){return this.get("ComponentPath")}get RoxieState(){return this.get("RoxieState")}get RoxieStateDetails(){return this.get("RoxieStateDetails")}get OS(){return this.get("OS")}get ProcessNumber(){return this.get("ProcessNumber")}get Channels(){return this.get("Channels")}get Processors(){return this.get("Processors")}get Storage(){return this.get("Storage")}get Running(){return this.get("Running")}get PhysicalMemory(){return this.get("PhysicalMemory")}get VirtualMemory(){return this.get("VirtualMemory")}get ComponentInfo(){return this.get("ComponentInfo")}get Exception(){return this.get("Exception")}static attach(e,t,s){let r=ta.get({Address:t},()=>new n(e));return s&&r.set(s),r}constructor(e){super(),e instanceof Ge?this.connection=e:this.connection=new Ge(e)}};var dt=require("@hpcc-js/util"),ai=Ie(Xn(),1);var lt=require("@hpcc-js/util");var ln=require("@hpcc-js/util");var un=class extends ln.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}},sa=new un,ut=class n extends ln.StateObject{connection;machineConnection;get BaseUrl(){return this.connection.baseUrl}get Name(){return this.get("Name")}get Prefix(){return this.get("Prefix")}get Type(){return this.get("Type")}get IsDefault(){return this.get("IsDefault")}get TpClusters(){return this.get("TpClusters")}get TpEclCCServers(){return this.get("TpEclCCServers")}get TpEclServers(){return this.get("TpEclServers")}get TpEclAgents(){return this.get("TpEclAgents")}get TpEclSchedulers(){return this.get("TpEclSchedulers")}get MachineInfoEx(){return this.get("MachineInfoEx",[])}get CMachineInfoEx(){return this.MachineInfoEx.map(e=>$t.attach(this.machineConnection,e.Address,e))}static attach(e,t,s){let r=sa.get({BaseUrl:e.baseUrl,Name:t},()=>new n(e,t));return s&&r.set(s),r}constructor(e,t){super(),e instanceof oe?(this.connection=e,this.machineConnection=new Ge(e.connectionOptions())):(this.connection=new oe(e),this.machineConnection=new Ge(e)),this.clear({Name:t})}fetchMachines(e={}){return this.machineConnection.GetTargetClusterInfo({TargetClusters:{Item:[`${this.Type}:${this.Name}`]},...e}).then(t=>{let s=[];for(let r of t.TargetClusterInfoList.TargetClusterInfo)for(let i of r.Processes.MachineInfoEx)s.push(i);return this.set("MachineInfoEx",s),this.CMachineInfoEx})}machineStats(){let e=0,t=0,s=0;for(let r of this.CMachineInfoEx)for(let i of r.Storage.StorageInfo){t+=i.Available,s+=i.Total;let o=1-i.Available/i.Total;o>e&&(e=o)}return{maxDisk:e,meanDisk:1-(s?t/s:1)}}fetchUsage(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])}};function na(n){let e;return n instanceof oe?e=n:e=new oe(n),e.TpListTargetClusters({}).then(t=>t.TargetClusters.TpClusterNameType.map(s=>ut.attach(n,s.Name,s)))}var ar={};function ra(n){if(!ar[n.baseUrl]){let e;n instanceof oe?e=n:e=new oe(n),ar[n.baseUrl]=e.TpListTargetClusters({}).then(t=>{let s,r,i;t.TargetClusters.TpClusterNameType.forEach(c=>{s||(s=c),!r&&c.IsDefault===!0&&(r=c),!i&&c.Type==="hthor"&&(i=c)});let o=r||i||s;return ut.attach(n,o.Name,o)})}return ar[n.baseUrl]}var gn=class extends lt.Cache{constructor(){super(e=>e.BaseUrl)}},ia=new gn,es=class n extends lt.StateObject{connection;get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get TargetClusters(){return this.get("TargetClusters")}get CTargetClusters(){return this.TargetClusters.map(e=>ut.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,t){let s=ia.get({BaseUrl:e.baseUrl},()=>new n(e));return t&&s.set(t),s}constructor(e){super(),e instanceof oe?this.connection=e:this.connection=new oe(e)}GetESPServiceBaseURL(e=""){return this.connection.TpServiceQuery({}).then(t=>{let s=this.connection.protocol(),r=this.connection.ip(),i=s==="https:"?"18002":"8002";if((0,lt.exists)("ServiceList.TpEspServers.TpEspServer",t)){for(let o of t.ServiceList.TpEspServers.TpEspServer)if((0,lt.exists)("TpBindings.TpBinding",o))for(let c of o.TpBindings.TpBinding)c.Service===e&&c.Protocol+":"===s&&(i=c.Port)}return`${s}//${r}:${i}/`})}fetchTargetClusters(){return this.connection.TpTargetClusterQuery({Type:"ROOT"}).then(e=>(this.set({TargetClusters:e.TpTargetClusters?.TpTargetCluster??[]}),this.CTargetClusters))}fetchLogicalClusters(e={}){return this.connection.TpLogicalClusterQuery(e).then(t=>(this.set({LogicalClusters:t.TpLogicalClusters.TpLogicalCluster}),this.LogicalClusters))}fetchServices(e={}){return this.connection.TpServiceQuery(e).then(t=>(this.set({Services:t.ServiceList}),this.Services))}_prevRefresh;refresh(e=!1){return(!this._prevRefresh||e)&&(this._prevRefresh=Promise.all([this.fetchTargetClusters(),this.fetchLogicalClusters(),this.fetchServices()]).then(()=>this)),this._prevRefresh}on(e,t,s){return this.isCallback(t)?e==="changed"&&super.on(e,t):e==="changed"&&super.on(e,t,s),this._monitor(),this}};function Ke(n,e,t){e==="__proto__"||e==="constructor"||e==="prototype"||(n[e]=t)}function ts(n){return n=""+n,n.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"&#10;").replace(/\r/g,"&#13;")}function oa(n){if(n){if(!isNaN(+n))return parseFloat(n)}else return 0;let t=/(?:(?:(\d+).days.)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+\.\d+|\d+)s))|(?:(\d+\.\d+|\d+)ms|(\d+\.\d+|\d+)us|(\d+\.\d+|\d+)ns)/.exec(n);if(!t)return 0;let s=+t[1]||0,r=+t[2]||0,i=+t[3]||0,o=+t[4]||0,c=+t[5]||0,d=+t[6]||0,y=+t[7]||0;return s*24*60*60+r*60*60+i*60+o+c/1e3+d/1e6+y/1e9}function Ze(n,e){let t=n.indexOf(e);return t!==-1?parseFloat(n.substring(0,t)):-1}function aa(n){if(n){if(!isNaN(+n))return parseFloat(n)}else return 0;let e=Ze(n,"Kb");return e>=0?e*1024:(e=Ze(n,"Mb"),e>=0?e*Math.pow(1024,2):(e=Ze(n,"Gb"),e>=0?e*Math.pow(1024,3):(e=Ze(n,"Tb"),e>=0?e*Math.pow(1024,4):(e=Ze(n,"Pb"),e>=0?e*Math.pow(1024,5):(e=Ze(n,"Eb"),e>=0?e*Math.pow(1024,6):(e=Ze(n,"Zb"),e>=0?e*Math.pow(1024,7):(e=Ze(n,"b"),e>=0?e:0)))))))}function ca(n){return n?parseFloat(n):0}var cr=class{graph;m_xgmml;m_visibleSubgraphs;m_visibleVertices;m_semiVisibleVertices;m_visibleEdges;noSpills;constructor(e){this.graph=e,this.m_xgmml="",this.m_visibleSubgraphs={},this.m_visibleVertices={},this.m_semiVisibleVertices={},this.m_visibleEdges={}}calcVisibility(e,t,s,r){this.noSpills=r,e.forEach(i=>{this.graph.isVertex(i)?(this.calcInVertexVisibility(i,s),this.calcOutVertexVisibility(i,s)):this.graph.isEdge(i)?(this.calcInVertexVisibility(i.getSource(),s-1),this.calcOutVertexVisibility(i.getTarget(),s-1)):this.graph.isSubgraph(i)&&(this.m_visibleSubgraphs[i.__hpcc_id]=i,this.calcSubgraphVisibility(i,t-1))}),this.calcVisibility2()}calcInVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getInEdges().forEach(s=>{this.calcInVertexVisibility(s.getSource(),t-1)})}calcOutVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getOutEdges().forEach(s=>{this.calcOutVertexVisibility(s.getTarget(),t-1)})}calcSubgraphVisibility(e,t){if(t<0)return;t>0&&e.__hpcc_subgraphs.forEach((r,i)=>{this.calcSubgraphVisibility(r,t-1)}),e.__hpcc_subgraphs.forEach((r,i)=>{this.m_visibleSubgraphs[r.__hpcc_id]=r}),e.__hpcc_vertices.forEach((r,i)=>{this.m_visibleVertices[r.__hpcc_id]=r});let s={};this.graph.edges.forEach((r,i)=>{r.getSource().__hpcc_parent!==r.getTarget().__hpcc_parent&&e===this.getCommonAncestor(r)&&(s[r.getSource().__hpcc_parent.__hpcc_id+"::"+r.getTarget().__hpcc_parent.__hpcc_id]||(s[r.getSource().__hpcc_parent.__hpcc_id+"::"+r.getTarget().__hpcc_parent.__hpcc_id]=!0,this.m_visibleEdges[r.__hpcc_id]=r))})}buildVertexString(e,t){let s="",r="",i=e.getProperties();for(let o in i)t&&o.indexOf("_kind")>=0?r+='<att name="_kind" value="point"/>':o==="id"||o==="label"?s+=" "+o+'="'+ts(i[o])+'"':r+='<att name="'+o+'" value="'+ts(i[o])+'"/>';return"<node"+s+">"+r+"</node>"}buildEdgeString(e){let t="",s="",r=e.getProperties();for(let i in r)i.toLowerCase()==="id"||i.toLowerCase()==="label"||i.toLowerCase()==="source"||i.toLowerCase()==="target"?t+=" "+i+'="'+ts(r[i])+'"':s+='<att name="'+i+'" value="'+ts(r[i])+'"/>';return"<edge"+t+">"+s+"</edge>"}getAncestors(e,t){let s=e.__hpcc_parent;for(;s;)t.push(s),s=s.__hpcc_parent}getCommonAncestorV(e,t){let s=[],r=[];this.getAncestors(e,s),this.getAncestors(t,r);let i=s.length-1,o=r.length-1,c=null;for(;i>=0&&o>=0&&s[i]===r[o];)c=s[i],--i,--o;return c}getCommonAncestor(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())}calcAncestorVisibility(e){let t=[];this.getAncestors(e,t),t.forEach((s,r)=>{this.m_visibleSubgraphs[s.__hpcc_id]=s})}calcVisibility2(){for(let e in this.m_visibleVertices){let t=this.m_visibleVertices[e];t.getInEdges().forEach((s,r)=>{this.m_visibleEdges[s.__hpcc_id]=s}),t.getOutEdges().forEach((s,r)=>{this.m_visibleEdges[s.__hpcc_id]=s}),this.calcAncestorVisibility(t)}this.calcSemiVisibleVertices()}addSemiVisibleEdge(e){e&&!this.m_visibleEdges[e.__hpcc_id]&&(this.m_visibleEdges[e.__hpcc_id]=e)}addSemiVisibleVertex(e){this.m_visibleVertices[e.__hpcc_id]||(this.m_semiVisibleVertices[e.__hpcc_id]=e,this.calcAncestorVisibility(e))}calcSemiVisibleVertices(){for(let e in this.m_visibleEdges){let t=this.m_visibleEdges[e],s=t.getSource();for(this.addSemiVisibleVertex(s);this.noSpills&&s.isSpill();){let i=s.getInEdges();if(i.length)this.addSemiVisibleEdge(i[0]),s=i[0].getSource(),this.addSemiVisibleVertex(s);else break}let r=t.getTarget();for(this.addSemiVisibleVertex(r);this.noSpills&&r.isSpill();){let i=r.getOutEdges();if(i.length)this.addSemiVisibleEdge(i[0]),r=i[0].getTarget(),this.addSemiVisibleVertex(r);else break}}}writeXgmml(){this.subgraphVisited(this.graph.subgraphs[0],!0),this.graph.edges.forEach((e,t)=>{this.edgeVisited(e)})}subgraphVisited(e,t=!1){if(this.m_visibleSubgraphs[e.__hpcc_id]){let s="";this.m_xgmml+=t?"":'<node id="'+e.__hpcc_id+'"><att><graph>';let r=this.m_xgmml.length;if(e.walkSubgraphs(this),e.walkVertices(this),r===this.m_xgmml.length){let o=e.__hpcc_vertices[0];o&&(this.m_xgmml+=this.buildVertexString(o,!0))}let i=e.getProperties();for(let o in i)s+='<att name="'+o+'" value="'+ts(i[o])+'"/>';this.m_xgmml+=t?"":"</graph></att>"+s+"</node>"}return!1}vertexVisited(e){this.m_visibleVertices[e.__hpcc_id]?this.m_xgmml+=this.buildVertexString(e,!1):this.m_semiVisibleVertices[e.__hpcc_id]&&(this.m_xgmml+=this.buildVertexString(e,!0))}edgeVisited(e){this.m_visibleEdges[e.__hpcc_id]&&(this.m_xgmml+=this.buildEdgeString(e))}},ss=class{__hpcc_graph;__hpcc_parent;__widget;__hpcc_id;_globalID;constructor(e,t){this.__hpcc_graph=e,this.__hpcc_id=t,this._globalID=t}getProperties(){let e={};for(let t in this)t.indexOf("__")!==0&&this.hasOwnProperty(t)&&(e[t]=this[t]);return e}},$e=class extends ss{_globalType;__hpcc_subgraphs;__hpcc_vertices;__hpcc_edges;id;constructor(e,t){super(e,t),this._globalType=t==="0"?"Graph":"Cluster",this.__hpcc_subgraphs=[],this.__hpcc_vertices=[],this.__hpcc_edges=[],this.id=t}addSubgraph(e){e.__hpcc_parent=this,this.__hpcc_subgraphs.some(t=>e===t)||this.__hpcc_subgraphs.push(e)}addVertex(e){e.__hpcc_parent=this,this.__hpcc_vertices.some(t=>e===t)||this.__hpcc_vertices.push(e)}removeVertex(e){this.__hpcc_vertices=this.__hpcc_vertices.filter(t=>e!==t)}addEdge(e){e.__hpcc_parent=this,this.__hpcc_edges.some(t=>e===t)||this.__hpcc_edges.push(e)}removeEdge(e){this.__hpcc_edges=this.__hpcc_edges.filter(t=>e!==t)}remove(){this.__hpcc_subgraphs.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),this.__hpcc_vertices.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),this.__hpcc_edges.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),delete this.__hpcc_parent,this.__hpcc_graph.removeItem(this)}walkSubgraphs(e){this.__hpcc_subgraphs.forEach((t,s)=>{e.subgraphVisited(t)&&t.walkSubgraphs(e)})}walkVertices(e){this.__hpcc_vertices.forEach((t,s)=>{e.vertexVisited(t)})}},gt=class extends ss{_globalType="Vertex";_isSpill;constructor(e,t){super(e,t)}isSpill(){return this._isSpill}remove(){let e=this.getInVertices();e.length<=1&&console.warn(this.__hpcc_id+": remove only supports single or zero inputs activities..."),this.getInEdges().forEach(t=>{t.remove()}),this.getOutEdges().forEach(t=>{t.setSource(e[0])}),this.__hpcc_parent?.removeVertex(this),this.__hpcc_graph.removeItem(this)}getInVertices(){return this.getInEdges().map(e=>e.getSource())}getInEdges(){return this.__hpcc_graph.edges.filter(e=>e.getTarget()===this)}getOutVertices(){return this.getOutEdges().map(e=>e.getTarget())}getOutEdges(){return this.__hpcc_graph.edges.filter(e=>e.getSource()===this)}},pt=class extends ss{_globalType="Edge";_sourceActivity;source;_targetActivity;target;constructor(e,t){super(e,t),this._globalType="Edge"}remove(){this.__hpcc_graph.subgraphs.forEach(e=>{e.removeEdge(this)}),this.__hpcc_graph.removeItem(this)}getSource(){return this.__hpcc_graph.idx[this._sourceActivity||this.source]}setSource(e){this._sourceActivity?this._sourceActivity=e.__hpcc_id:this.source&&(this.source=e.__hpcc_id),this.__widget&&this.__widget.setSource(this.getSource().__widget)}getTarget(){return this.__hpcc_graph.idx[this._targetActivity||this.target]}},ns=class n{idx={};subgraphs=[];vertices=[];edges=[];xgmml="";constructor(){this.clear()}clear(){this.xgmml="",this.idx={},this.subgraphs=[],this.vertices=[],this.edges=[]}load(e){this.clear(),this.merge(e)}merge(e){this.xgmml=e;let s=new DOMParser().parseFromString(e,"text/xml");this.walkDocument(s.documentElement,"0")}isSubgraph(e){return e instanceof $e}isVertex(e){return e instanceof gt}isEdge(e){return e instanceof pt}getGlobalType(e){return e instanceof gt?3:e instanceof pt?4:e instanceof $e?2:e instanceof n?1:0}getGlobalTypeString(e){return e instanceof gt?"Vertex":e instanceof pt?"Edge":e instanceof $e?"Cluster":e instanceof n?"Graph":"Unknown"}getItem(e,t){if(!this.idx[t])switch(e.tagName){case"graph":let r=new $e(this,t);this.subgraphs.push(r),this.idx[t]=r;break;case"node":let i=new gt(this,t);this.vertices.push(i),this.idx[t]=i;break;case"edge":let o=new pt(this,t);this.edges.push(o),this.idx[t]=o;break;default:console.warn("Graph.getItem - Unknown Node Type!");break}let s=this.idx[t];return Array.from(e.attributes).forEach(r=>{Ke(s,r.name,r.value)}),s}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof $e?this.subgraphs=this.subgraphs.filter(t=>e!==t):e instanceof gt?this.vertices=this.vertices.filter(t=>e!==t):e instanceof pt&&(this.edges=this.edges.filter(t=>e!==t))}getChildByTagName(e,t){let s=null;return Array.from(e.childNodes).some(r=>{if(r.tagName===t)return s=r,!0}),s}walkDocument(e,t){let s=this.getItem(e,t);return e.childNodes.forEach(r=>{switch(r.nodeType){case 1:switch(r.tagName){case"graph":break;case"node":let i=!1,o=this.getChildByTagName(r,"att");if(o){let E=this.getChildByTagName(o,"graph");if(E){i=!0;let R=this.walkDocument(E,r.getAttribute("id"));s.addSubgraph(R)}}if(!i){let E=this.walkDocument(r,r.getAttribute("id"));s.addVertex(E)}break;case"att":let c=r.getAttribute("name"),d="_"+c,y=r.getAttribute("value");c.indexOf("Time")===0?(Ke(s,d,y),Ke(s,c,""+oa(y))):c.indexOf("Size")===0?(Ke(s,d,y),Ke(s,c,""+aa(y))):c.indexOf("Skew")===0?(Ke(s,d,y),Ke(s,c,""+ca(y))):Ke(s,c,y);break;case"edge":let l=this.walkDocument(r,r.getAttribute("id"));if(l.NumRowsProcessed!==void 0?l._eclwatchCount=l.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):l.Count!==void 0?l._eclwatchCount=l.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):l.count!==void 0&&(l._eclwatchCount=l.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),l.inputProgress&&(l._eclwatchInputProgress="["+l.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),l.SkewMaxRowsProcessed&&l.SkewMinRowsProcessed&&(l._eclwatchSkew="+"+l.SkewMaxRowsProcessed+", "+l.SkewMinRowsProcessed),!l._dependsOn){if(!l._childGraph){if(l._sourceActivity||l._targetActivity){l._isSpill=!0;let E=l.getSource();E&&(E._isSpill=!0);let R=l.getTarget();R&&(R._isSpill=!0)}}}s.addEdge(l);break;default:break}break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:break;default:break}}),s}removeSubgraphs(){[...this.subgraphs].forEach(t=>{t.__hpcc_parent instanceof $e&&t.remove()})}removeSpillVertices(){[...this.vertices].forEach(t=>{t.isSpill()&&t.remove()})}getLocalisedXGMML(e,t,s,r){let i=new cr(this);return i.calcVisibility(e,t,s,r),i.writeXgmml(),"<graph>"+i.m_xgmml+"</graph>"}};var pn=(0,dt.scopedLogger)("@hpcc-js/comms/ecl/query.ts"),ua=(0,ai.format)("~s");function la(n){return!isNaN(parseFloat(n))&&!isNaN(n-0)}var ur=class extends dt.Cache{constructor(){super(e=>dt.Cache.hash([e.QueryId,e.QuerySet]))}},ga=new ur,lr=class n extends dt.StateObject{wsWorkunitsService;get BaseUrl(){return this.wsWorkunitsService.baseUrl}topology;_requestSchema;_responseSchema;get properties(){return this.get()}get Exceptions(){return this.get("Exceptions")}get QueryId(){return this.get("QueryId")}get QuerySet(){return this.get("QuerySet")}get QueryName(){return this.get("QueryName")}get Wuid(){return this.get("Wuid")}get Dll(){return this.get("Dll")}get Suspended(){return this.get("Suspended")}get Activated(){return this.get("Activated")}get SuspendedBy(){return this.get("SuspendedBy")}get Clusters(){return this.get("Clusters")}get PublishedBy(){return this.get("PublishedBy")}get Comment(){return this.get("Comment")}get LogicalFiles(){return this.get("LogicalFiles")}get SuperFiles(){return this.get("SuperFiles")}get IsLibrary(){return this.get("IsLibrary")}get Priority(){return this.get("Priority")}get WUSnapShot(){return this.get("WUSnapShot")}get CompileTime(){return this.get("CompileTime")}get LibrariesUsed(){return this.get("LibrariesUsed")}get CountGraphs(){return this.get("CountGraphs")}get ResourceURLCount(){return this.get("ResourceURLCount")}get WsEclAddresses(){return this.get("WsEclAddresses")}get WUGraphs(){return this.get("WUGraphs")}get WUTimers(){return this.get("WUTimers")}get PriorityID(){return this.get("PriorityID")}constructor(e,t,s,r){super(),e instanceof re?this.wsWorkunitsService=e:this.wsWorkunitsService=new re(e),this.topology=es.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:t,QueryId:s,...r})}static attach(e,t,s,r){let i=ga.get({BaseUrl:e.baseUrl,QuerySet:t,QueryId:s},()=>new n(e,t,s));return r&&i.set(r),i}_eclService;async wsEclService(){return this._eclService||(this._eclService=this.topology.fetchServices({}).then(e=>{for(let t of e?.TpEspServers?.TpEspServer??[])for(let s of t?.TpBindings?.TpBinding??[])if(s?.Service==="ws_ecl"){let r=`${s.Protocol}://${globalThis.location.hostname}:${s.Port}`;return new Qt({baseUrl:r})}})),this._eclService}async fetchDetails(){let e=await this.wsWorkunitsService.WUQueryDetails({QuerySet:this.QuerySet,QueryId:this.QueryId,IncludeStateOnClusters:!0,IncludeSuperFiles:!0,IncludeWsEclAddresses:!0,CheckAllNodes:!1});this.set({...e})}async fetchRequestSchema(){let e=await this.wsEclService();try{this._requestSchema=await e?.requestJson(this.QuerySet,this.QueryId)??[]}catch(t){pn.debug(t.message??t),this._requestSchema=[]}}async fetchResponseSchema(){let e=await this.wsEclService();try{this._responseSchema=await e?.responseJson(this.QuerySet,this.QueryId)??{}}catch(t){pn.debug(t.message??t),this._responseSchema={}}}async fetchSchema(){await Promise.all([this.fetchRequestSchema(),this.fetchResponseSchema()])}fetchSummaryStats(){return this.wsWorkunitsService.WUQueryGetSummaryStats({Target:this.QuerySet,QueryId:this.QueryId})}fetchGraph(e="",t=""){return this.wsWorkunitsService.WUQueryGetGraph({Target:this.QuerySet,QueryId:this.QueryId,GraphName:e,SubGraphId:t}).then(s=>{let r=new ns,i=!0;for(let o of s?.Graphs?.ECLGraphEx||[])i?(r.load(o.Graph),i=!1):r.merge(o.Graph);return r})}fetchDetailsNormalized(e={}){let t=ct.attach(this.wsWorkunitsService,this.Wuid);return t?Promise.all([this.fetchGraph(),t.fetchDetailsMeta(),t.fetchDetailsRaw(e)]).then(s=>{let r=s[0],i=s[1],c=s[2].map(d=>{let y=d.Id[0];if(y==="a"||y==="e"){let l=r.idx[d.Id.substring(1)];if(!l)return pn.debug(`Missing graph data for metric ID: ${d.Id}`),d;let E=new Set(d.Properties.Property.map(M=>M.Name)),R=[];for(let M in l){let w=M.charAt(0);if(w!=="_"&&w===w.toUpperCase()&&!E.has(M)){let V=l[M],B=typeof V;if(B==="string"||B==="number"||B==="boolean"){let k=la(V)?parseFloat(V):V,P=V;M.indexOf("Time")>=0&&(k=k/1e9,P=ua(k)+"s"),R.push({Name:M,RawValue:k,Formatted:P})}}}R.length>0&&d.Properties.Property.push(...R)}return d});return t.normalizeDetails(i,c)}):Promise.resolve({meta:void 0,columns:void 0,data:void 0})}async submit(e){let t=await this.wsEclService();try{return t?.submit(this.QuerySet,this.QueryId,e).then(s=>{for(let r in s)s[r]=s[r].Row;return s})??[]}catch(s){return pn.debug(s.message??s),[]}}async refresh(){return await Promise.all([this.fetchDetails(),this.fetchSchema()]),this}requestFields(){return this._requestSchema?this._requestSchema:[]}responseFields(){return this._responseSchema?this._responseSchema:{}}resultNames(){let e=[];for(let t in this.responseFields())e.push(t);return e}resultFields(e){return this._responseSchema[e]?this._responseSchema[e]:[]}};var xt=require("@hpcc-js/util");var dn=class extends xt.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}},pa=new dn,et=class extends xt.Message{constructor(t,s,r){super();this.key=t;this.value=s;this.oldValue=r}key;value;oldValue;get canConflate(){return!0}conflate(t){return this.key===t.key?(this.value=t.value,!0):!1}void(){return this.value===this.oldValue}},gr=class n{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new xt.Dispatch;static attach(e,t="HPCCApps",s,r=!0){return pa.get({BaseUrl:e.baseUrl,Name:t,UserSpecific:r,Namespace:s},()=>new n(e,t,s,r))}constructor(e,t,s,r){e instanceof Rt?this.connection=e:this.connection=new Rt(e),this.Name=t,this.UserSpecific=r,this.Namespace=s}_knownValues={};create(){this.connection.CreateStore({Name:this.Name,Type:"",Description:""})}set(e,t,s=!0){return this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e,Value:t}).then(r=>{let i=this._knownValues[e];this._knownValues[e]=t,s&&this._dispatch.post(new et(e,t,i))}).catch(r=>{console.error(`Store.set("${e}", "${t}") failed:`,r)})}get(e,t=!0){return this.connection.Fetch({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(s=>{let r=this._knownValues[e];return this._knownValues[e]=s.Value,t&&this._dispatch.post(new et(e,s.Value,r)),s.Value}).catch(s=>{console.error(`Store.get(${e}) failed:`,s)})}getAll(e=!0){return this.connection.FetchAll({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace}).then(t=>{let s={},r=this._knownValues;if(this._knownValues={},t.Pairs.Pair.forEach(i=>{let o=this._knownValues[i.Key];this._knownValues[i.Key]=i.Value,delete r[i.Key],s[i.Key]=i.Value,e&&this._dispatch.post(new et(i.Key,i.Value,o))}),e)for(let i in r)this._dispatch.post(new et(i,void 0,r[i]));return s}).catch(t=>(console.error("Store.getAll failed:",t),{}))}delete(e,t=!0){return this.connection.Delete({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(s=>{let r=this._knownValues[e];delete this._knownValues[e],t&&this._dispatch.post(new et(e,void 0,r))}).catch(s=>{console.error(`Store.delete(${e}) failed:`,s)})}monitor(e){return this._dispatch.attach(e)}};var Wt=require("@hpcc-js/util");var da=(0,Wt.scopedLogger)("@hpcc-js/comms/dfuWorkunit.ts");var mn=class extends Wt.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}},ci=new mn,pr=class n extends Wt.StateObject{connection;topologyConnection;get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get ID(){return this.get("ID")}get DFUServerName(){return this.get("DFUServerName")}get ClusterName(){return this.get("ClusterName")}get JobName(){return this.get("JobName")}get Queue(){return this.get("Queue")}get User(){return this.get("User")}get isProtected(){return this.get("isProtected")}get Command(){return this.get("Command")}get CommandMessage(){return this.get("CommandMessage")}get PercentDone(){return this.get("PercentDone")}get SecsLeft(){return this.get("SecsLeft")}get ProgressMessage(){return this.get("ProgressMessage")}get SummaryMessage(){return this.get("SummaryMessage")}get State(){return this.get("State",0)}get SourceLogicalName(){return this.get("SourceLogicalName")}get SourceIP(){return this.get("SourceIP")}get SourceFilePath(){return this.get("SourceFilePath")}get SourceDali(){return this.get("SourceDali")}get SourceRecordSize(){return this.get("SourceRecordSize")}get SourceFormat(){return this.get("SourceFormat")}get RowTag(){return this.get("RowTag")}get SourceNumParts(){return this.get("SourceNumParts")}get SourceDirectory(){return this.get("SourceDirectory")}get DestLogicalName(){return this.get("DestLogicalName")}get DestGroupName(){return this.get("DestGroupName")}get DestDirectory(){return this.get("DestDirectory")}get DestIP(){return this.get("DestIP")}get DestFilePath(){return this.get("DestFilePath")}get DestFormat(){return this.get("DestFormat")}get DestNumParts(){return this.get("DestNumParts")}get DestRecordSize(){return this.get("DestRecordSize")}get Replicate(){return this.get("Replicate")}get Overwrite(){return this.get("Overwrite")}get Compress(){return this.get("Compress")}get SourceCsvSeparate(){return this.get("SourceCsvSeparate")}get SourceCsvQuote(){return this.get("SourceCsvQuote")}get SourceCsvTerminate(){return this.get("SourceCsvTerminate")}get SourceCsvEscape(){return this.get("SourceCsvEscape")}get TimeStarted(){return this.get("TimeStarted")}get TimeStopped(){return this.get("TimeStopped")}get StateMessage(){return this.get("StateMessage")}get MonitorEventName(){return this.get("MonitorEventName")}get MonitorSub(){return this.get("MonitorSub")}get MonitorShotLimit(){return this.get("MonitorShotLimit")}get SourceDiffKeyName(){return this.get("SourceDiffKeyName")}get DestDiffKeyName(){return this.get("DestDiffKeyName")}get Archived(){return this.get("Archived")}get encrypt(){return this.get("encrypt")}get decrypt(){return this.get("decrypt")}get failIfNoSourceFile(){return this.get("failIfNoSourceFile")}get recordStructurePresent(){return this.get("recordStructurePresent")}get quotedTerminator(){return this.get("quotedTerminator")}get preserveCompression(){return this.get("preserveCompression")}get expireDays(){return this.get("expireDays")}get PreserveFileParts(){return this.get("PreserveFileParts")}get FileAccessCost(){return this.get("FileAccessCost")}get KbPerSecAve(){return this.get("KbPerSecAve")}get KbPerSec(){return this.get("KbPerSec")}static create(e,t){let s=new n(e);return s.connection.CreateDFUWorkunit({DFUServerQueue:t}).then(r=>(ci.set(s),s.set(r.result),s))}static attach(e,t,s){let r=ci.get({BaseUrl:e.baseUrl,ID:t},()=>new n(e,t));return s&&r.set(s),r}static sprayFixed(e,t){let s=new Xe(e);return s.SprayFixedEx({...t}).then(r=>{let i=r.wuid;return s.GetDFUWorkunit({wuid:i}).then(o=>n.attach(e,i,o.result))})}static sprayVariable(e,t){let s=new Xe(e);return s.SprayVariableEx({...t}).then(r=>{let i=r.wuid;return s.GetDFUWorkunit({wuid:i}).then(o=>n.attach(e,i,o.result))})}static despray(e,t){let s=new Xe(e);return s.DesprayEx({...t}).then(r=>{let i=r.wuid;return s.GetDFUWorkunit({wuid:i}).then(o=>n.attach(e,i,o.result))})}update(e){return this.connection.UpdateDFUWorkunitEx({wu:{JobName:e?.wu?.JobName??this.JobName,isProtected:e?.wu?.isProtected??this.isProtected,ID:this.ID,State:this.State},ClusterOrig:this.ClusterName,JobNameOrig:this.JobName,isProtectedOrig:this.isProtected,StateOrig:this.State})}isComplete(){switch(this.State){case 6:case 5:case 4:case 999:return!0;default:}return!1}isFailed(){return!!(this.isComplete()&&this.State!==6)}isDeleted(){return this.State===999}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(Dt.DFUWUActions.Delete).then(e=>this.refresh().then(()=>(this._monitor(),e)))}async refresh(e=!1){return await this.GetDFUWorkunit(),this}fetchXML(e){return this.DFUWUFile()}_monitor(){if(this.isComplete()){this._monitorTickCount=0;return}super._monitor()}_monitorTimeoutDuration(){let e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?3e3:this._monitorTickCount<=5?6e3:this._monitorTickCount<=7?12e3:e}DFUWUFile(e={}){return this.connection.DFUWUFileEx({...e,Wuid:this.ID}).then(t=>t).catch(t=>"")}DFUWUAction(e){return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:e}).then(t=>e===Dt.DFUWUActions.Delete?t:this.refresh().then(()=>(this._monitor(),t)))}on(e,t,s){if(this.isCallback(t))switch(e){case"finished":super.on("propChanged","State",r=>{this.isComplete()&&t([r])});break;case"changed":super.on(e,t);break;default:}else e==="changed"&&super.on(e,t,s);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,s)=>{let r=this.watch(i=>{e&&e(i),this.isComplete()&&(r.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,s)=>{let r=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(r.release(),t(this))})})}constructor(e,t){super(),this.connection=new Xe(e),this.topologyConnection=new oe(e),this.clearState(t)}clearState(e){this.clear({ID:e,State:0})}GetDFUWorkunit(e={}){return this.connection.GetDFUWorkunit({...e,wuid:this.ID}).then(t=>(this.set(t.result),t)).catch(t=>{if(!t.Exception.some(r=>r.Code===20080||r.Code===20081?(this.clearState(this.ID),this.set("State",999),!0):!1))throw da.warning(`Unexpected ESP exception: ${t.message}`),t;return{}})}};var fi=Ie(require("node:child_process"),1),Di=Ie(require("node:crypto"),1),me=Ie(require("node:fs"),1),ke=Ie(require("node:os"),1),De=Ie(require("node:path"),1),It=require("@hpcc-js/util");var mt=Ie(require("node:fs"),1),$=Ie(require("node:path"),1),We=require("@hpcc-js/util");var ma=(0,We.scopedLogger)("clienttools/eclmeta"),ha=!1;function bt(n,e,t){if(ha){for(let s in n){let r=`${e}.${s}`;s!=="$"&&t[s]===void 0&&t[s.toLowerCase()+"s"]===void 0&&ma.debug(r)}n.$&&bt(n.$,e+".$",t)}}var hn=class{__attrs;name;constructor(e){this.__attrs=e.$,this.name=e.$.name}},fn=class{__attrs;definition;get scope(){return this.definition}name;type;constructor(e,t){this.__attrs=t.$,this.definition=e,this.name=t.$.name,this.type=t.$.type}},ht=class{get scope(){return this}name;type;sourcePath;line;start;body;end;definitions;constructor(e,t,s,r,i=1,o=0,c=0,d=Number.MAX_VALUE){this.name=e,this.type=t,this.sourcePath=$.normalize(s),this.line=+i-1,this.start=+o,this.body=+c,this.end=+d,this.definitions=this.parseDefinitions(r)}parseDefinitions(e=[]){return e.map(t=>{let s=new Dn(this.sourcePath,t);return bt(t,"definition",s),s})}contains(e){return e>=this.start&&e<=this.end}scopeStackAt(e){let t=[];return this.contains(e)&&(t.push(this),this.definitions.forEach(s=>{t=s.scopeStackAt(e).concat(t)})),t}_resolve(e=[],t){let s=t.split("."),r=s.shift(),i=(0,We.find)(e,o=>typeof o.name=="string"&&typeof r=="string"&&o.name.toLowerCase()===r.toLowerCase());return i&&i.definitions.length&&s.length?this._resolve(i.definitions,s.join(".")):i}resolve(e){return this._resolve(this.definitions,e)}suggestions(){return this.definitions.map(e=>({name:e.name,type:this.type}))}},Dn=class extends ht{__attrs;exported;shared;fullname;inherittype;attrs;fields;constructor(e,t){super(t.$.name,t.$.type,e,t.children("Definition"),t.$.line,t.$.start,t.$.body,t.$.end),this.__attrs=t.$,this.exported=!!t.$.exported,this.shared=!!t.$.shared,this.fullname=t.$.fullname,this.inherittype=t.$.inherittype,this.attrs=this.parseAttrs(t.children("Attr")),this.fields=this.parseFields(t.children("Field"))}parseAttrs(e=[]){return e.map(t=>{let s=new hn(t);return bt(t,"attr",s),s})}parseFields(e=[]){return e.map(t=>{let s=new fn(this,t);return bt(t,"field",s),s})}suggestions(){return super.suggestions().concat(this.fields.map(e=>({name:e.name,type:e.type})))}},rs=class{__attrs;name;ref;start;end;line;constructor(e){this.__attrs=e.$,this.name=e.$.name,this.ref=e.$.ref,this.start=e.$.start,this.end=e.$.end,this.line=e.$.line}},Sn=class extends ht{imports;__attrs;constructor(e){super(e.$.name,"source",e.$.sourcePath,e.children("Definition")),this.__attrs=e.$;let t=e.$.name.split(".");t.pop();let s=new We.XMLNode("");s.appendAttribute("name","$"),s.appendAttribute("ref",t.join(".")),this.imports=[new rs(s),...this.parseImports(e.children("Import"))]}parseImports(e=[]){return e.map(t=>{let s=new rs(t);return bt(t,"import",s),s})}resolve(e,t){let s;return!s&&t!==void 0&&this.scopeStackAt(t).some(i=>(s=i.resolve(e),!!s)),s||(s=super.resolve(e)),s}},fa=n=>$.basename(n).indexOf(".")===0,ui=n=>mt.lstatSync(n).isDirectory()&&!fa(n),Da=n=>[".ecl",".ecllib"].indexOf($.extname(n).toLowerCase())>=0,li=n=>mt.readdirSync(n).map(e=>$.join(n,e)).filter(e=>ui(e)||Da(e)),Cn=class extends ht{constructor(e,t){super(e,"file",t,[])}suggestions(){return[]}},Rn=class extends ht{constructor(e,t){super(e,"folder",t,[])}suggestions(){return li(this.sourcePath).map(e=>({name:$.basename(e,".ecl"),type:"folder"}))}},An=class{_workspacePath;_eclccPath;_clientTools;_sourceByID=new We.DictionaryNoCase;_sourceByPath=new We.Dictionary;_test=new We.DictionaryNoCase;constructor(e,t){this._workspacePath=e,this._eclccPath=t}refresh(){this.primeWorkspace(),this.primeClientTools()}primeClientTools(){return hr(this._eclccPath,"",this._workspacePath).then(e=>(this._clientTools=e,e.paths())).then(e=>{for(let t of["ECLCC_ECLLIBRARY_PATH","ECLCC_PLUGIN_PATH"])e[t]&&mt.existsSync(e[t])&&this.walkChildFolders(e[t],e[t]);return this})}primeWorkspace(){mt.existsSync(this._workspacePath)&&this.visitFolder(this._workspacePath,this._workspacePath)}walkChildFolders(e,t,s=!1){for(let r of li(e))ui(r)?this.visitFolder(r,t,s):this.visitFile(r,t,s)}visitFile(e,t,s=!1){let r=$.parse(e),i=$.join(r.dir,r.name),o=$.relative(t,i).split($.sep).join(".");(s||!this._test.has(o))&&this._test.set(o,new Cn("",e))}visitFolder(e,t,s=!1){let r=$.relative(t,e).split($.sep).join(".");(s||!this._test.has(r))&&(this._test.set(r,new Rn(r,e)),this.walkChildFolders(e,t,s))}buildStack(e,t,s){let r=t.split(".");s&&e[e.length-1]===r[0]&&r.shift();let i=[...e,...r],o=i.join(".");return{stack:i,qid:o}}walkECLScope(e,t){let s=this.buildStack(e,t.name,!0);this._test.set(s.qid,t);for(let r of t.definitions)this.walkDefinition(s.stack,r)}walkField(e,t){let s=this.buildStack(e,t.name,!1);this._test.set(s.qid,t)}walkDefinition(e,t){let s=this.buildStack(e,t.name,!0);this.walkECLScope(e,t);for(let r of t.fields)this.walkField(s.stack,r)}walkSource(e){this.walkECLScope([],e)}parseSources(e=[]){for(let t of e)if(t.$.name){let s=new Sn(t);if(bt(t,"source",s),this._sourceByID.set(s.name,s),this._sourceByPath.set(s.sourcePath,s),s.name){let i=s.name.split(".").length;if(i>1){let o=s.sourcePath;for(;i>1;)o=$.dirname(o),--i;this.visitFolder(o,$.dirname(o))}}this.walkSource(s)}}parseMetaXML(e){let t=new mr;return t.parse(e),this.parseSources(t.sources),t.sources.map(s=>$.normalize(s.$.sourcePath))}resolveQualifiedID(e,t,s){let r;if(!r&&this._test.has(t)&&(r=this._test.get(t).scope),!r&&this._sourceByPath.has(e)){let i=this._sourceByPath.get(e),o=t.split(".");for(let d of i.imports)if(d.name.toLowerCase()===o[0].toLowerCase()){d.ref?o[0]=d.ref:o.shift();break}let c=o.join(".");!r&&this._test.has(c)&&(r=this._test.get(c).scope),r||(c=[...i.name.split("."),...o].join("."),this._test.has(c)&&(r=this._test.get(c).scope))}return r}resolvePartialID(e,t,s){t=t.toLowerCase();let r=t.split(".");r.pop();let i=r.length===1?r[0]:r.join(".");return this.resolveQualifiedID(e,i,s)}},dr=new We.Dictionary;function tt(n,e){let t=$.normalize(n);if(!dr.has(t)){let s=new An(t,e);dr.set(t,s),s.refresh()}return dr.get(t)}function Sa(n,e,t){if(e<0)return!1;let s=n.charAt(e);return(t?/[a-zA-Z\d_\.$]/:/[a-zA-Z\d_]/).test(s)}function Ca(n,e,t){for(;Sa(n,e,t);)e+=t?-1:1;return e+(t?1:-1)}var mr=class extends We.SAXStackParser{sources=[];endXMLNode(e){e.name==="Source"&&this.sources.push(e),super.endXMLNode(e)}};var Ut=(0,It.scopedLogger)("clienttools/eclcc"),fr=ke.type()==="Windows_NT"?".exe":"";function gi(n){return n.split(`\r
915
+ </div>`}},At=class extends Js{wu;constructor(e,t){super(t),this.wu=e}};var ei=require("@hpcc-js/util");var Kt=class extends ei.StateObject{connection;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get FileCluster(){return this.get("FileCluster")}get Name(){return this.get("Name")}get IsSuperFile(){return this.get("IsSuperFile")}get Subs(){return this.get("Subs")}get Count(){return this.get("Count")}get ECLSourceFiles(){return this.get("ECLSourceFiles")}constructor(e,t,s){super(),e instanceof ie?this.connection=e:this.connection=new ie(e),this.set({Wuid:t,...s})}};var Ks=require("@hpcc-js/util");var Zt=class extends Ks.StateObject{connection;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get Name(){return this.get("Name")}get Value(){return this.get("Value")}get Seconds(){return this.get("Seconds")}get GraphName(){return this.get("GraphName")}get SubGraphId(){return this.get("SubGraphId")}get HasSubGraphId(){return this.get("HasSubGraphId")}get count(){return this.get("count")}get Timestamp(){return this.get("Timestamp")}get When(){return this.get("When")}constructor(e,t,s){super(),e instanceof ie?this.connection=e:this.connection=new ie(e);let r=(0,Ks.espTime2Seconds)(s.Value);this.set({Wuid:t,Seconds:Math.round(r*1e3)/1e3,HasSubGraphId:s.SubGraphId!==void 0,...s})}};var Ho=(0,sn.utcFormat)("%Y-%m-%dT%H:%M:%S.%LZ"),jo=(0,sn.utcParse)("%Y-%m-%dT%H:%M:%S.%LZ"),Oo=(0,ni.format)(",");function _o(n){return n&&!isNaN(+n)?Oo(+n):n}var ti="DefinitionList",Yo=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,ri=["Avg","Min","Max","Delta","StdDev"],ii=["SkewMin","SkewMax","NodeMin","NodeMax"],Xo=/[A-Z][a-z]*/g;function qo(n){for(let t of ii){let s=n.indexOf(t);if(s===0){let i=n.slice(s+t.length);return{measure:"",ext:t,label:i}}}let e=n.match(Xo);if(e?.length){let t=e.shift(),s=e.join("");for(let r of ri){let i=s.indexOf(r);if(i===0)return s=s.slice(i+r.length),{measure:t,ext:r,label:s}}return{measure:t,ext:"",label:s}}return{measure:"",ext:"",label:n}}var si={};function oi(n){let e=si[n];return e||(e=qo(n),si[n]=e),e}function Le(n,e){return n.__formattedProps?.[e]??n[e]}function Zs(n){if(n===void 0)return;let e=parseFloat(n);return isNaN(e)?void 0:e}function zo(n,e,t){let s=oi(e);if(!t[s.measure]){t[s.label]=!0;let r=Zs(n[`${s.measure}Avg${s.label}`]),i=Zs(n[`${s.measure}Min${s.label}`]),o=Zs(n[`${s.measure}Max${s.label}`]),c=Zs(n[`${s.measure}StdDev${s.label}`]),d=Math.max((r-i)/c,(o-r)/c);return{Key:`${s.measure}${s.label}`,Value:Le(n,`${s.measure}${s.label}`),Avg:Le(n,`${s.measure}Avg${s.label}`),Min:Le(n,`${s.measure}Min${s.label}`),Max:Le(n,`${s.measure}Max${s.label}`),Delta:Le(n,`${s.measure}Delta${s.label}`),StdDev:Le(n,`${s.measure}StdDev${s.label}`),StdDevs:isNaN(d)?void 0:d,SkewMin:Le(n,`SkewMin${s.label}`),SkewMax:Le(n,`SkewMax${s.label}`),NodeMin:Le(n,`NodeMin${s.label}`),NodeMax:Le(n,`NodeMax${s.label}`)}}return null}var $s=(0,We.scopedLogger)("workunit.ts"),tn=class extends We.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}},en=new tn,ct=class n extends We.StateObject{connection;topologyConnection;get BaseUrl(){return this.connection.baseUrl}_debugMode=!1;_debugAllGraph;_submitAction;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get Owner(){return this.get("Owner","")}get Cluster(){return this.get("Cluster","")}get Jobname(){return this.get("Jobname","")}get Description(){return this.get("Description","")}get ActionEx(){return this.get("ActionEx","")}get StateID(){return this.get("StateID",0)}get State(){return this.get("State")||js[this.StateID]}get Protected(){return this.get("Protected",!1)}get Exceptions(){return this.get("Exceptions",{ECLException:[]})}get ResultViews(){return this.get("ResultViews",{View:[]})}_resultCache=new Jt;get ResultCount(){return this.get("ResultCount",0)}get Results(){return this.get("Results",{ECLResult:[]})}get CResults(){return this.Results.ECLResult.map(e=>this._resultCache.get(e,()=>zt.attach(this.connection,this.Wuid,e,this.ResultViews.View)))}get SequenceResults(){let e={};return this.CResults.forEach(t=>{e[t.Sequence]=t}),e}get Timers(){return this.get("Timers",{ECLTimer:[]})}get CTimers(){return this.Timers.ECLTimer.map(e=>new Zt(this.connection,this.Wuid,e))}_graphCache=new vt;get GraphCount(){return this.get("GraphCount",0)}get Graphs(){return this.get("Graphs",{ECLGraph:[]})}get CGraphs(){return this.Graphs.ECLGraph.map(e=>this._graphCache.get(e,()=>new kt(this,e,this.CTimers)))}get ThorLogList(){return this.get("ThorLogList")}get ResourceURLCount(){return this.get("ResourceURLCount",0)}get ResourceURLs(){return this.get("ResourceURLs",{URL:[]})}get CResourceURLs(){return this.ResourceURLs.URL.map(e=>new jt(this,e))}get TotalClusterTime(){return this.get("TotalClusterTime","")}get DateTimeScheduled(){return this.get("DateTimeScheduled")}get IsPausing(){return this.get("IsPausing")}get ThorLCR(){return this.get("ThorLCR")}get ApplicationValues(){return this.get("ApplicationValues",{ApplicationValue:[]})}get HasArchiveQuery(){return this.get("HasArchiveQuery")}get StateEx(){return this.get("StateEx")}get PriorityClass(){return this.get("PriorityClass")}get PriorityLevel(){return this.get("PriorityLevel")}get Snapshot(){return this.get("Snapshot")}get ResultLimit(){return this.get("ResultLimit")}get EventSchedule(){return this.get("EventSchedule")}get Query(){return this.get("Query")}get HelpersCount(){return this.get("HelpersCount",0)}get Helpers(){return this.get("Helpers",{ECLHelpFile:[]})}get DebugValues(){return this.get("DebugValues")}get AllowedClusters(){return this.get("AllowedClusters")}get ErrorCount(){return this.get("ErrorCount",0)}get WarningCount(){return this.get("WarningCount",0)}get InfoCount(){return this.get("InfoCount",0)}get AlertCount(){return this.get("AlertCount",0)}get SourceFileCount(){return this.get("SourceFileCount",0)}get SourceFiles(){return this.get("SourceFiles",{ECLSourceFile:[]})}get CSourceFiles(){return this.SourceFiles.ECLSourceFile.map(e=>new Kt(this.connection,this.Wuid,e))}get VariableCount(){return this.get("VariableCount",0)}get Variables(){return this.get("Variables",{ECLResult:[]})}get TimerCount(){return this.get("TimerCount",0)}get HasDebugValue(){return this.get("HasDebugValue")}get ApplicationValueCount(){return this.get("ApplicationValueCount",0)}get XmlParams(){return this.get("XmlParams")}get AccessFlag(){return this.get("AccessFlag")}get ClusterFlag(){return this.get("ClusterFlag")}get ResultViewCount(){return this.get("ResultViewCount",0)}get DebugValueCount(){return this.get("DebugValueCount",0)}get WorkflowCount(){return this.get("WorkflowCount",0)}get Archived(){return this.get("Archived")}get RoxieCluster(){return this.get("RoxieCluster")}get DebugState(){return this.get("DebugState",{})}get Queue(){return this.get("Queue")}get Active(){return this.get("Active")}get Action(){return this.get("Action")}get Scope(){return this.get("Scope")}get AbortBy(){return this.get("AbortBy")}get AbortTime(){return this.get("AbortTime")}get AbortReason(){return this.get("AbortReason")}get Workflows(){return this.get("Workflows")}get TimingData(){return this.get("TimingData")}get HelpersDesc(){return this.get("HelpersDesc")}get GraphsDesc(){return this.get("GraphsDesc")}get SourceFilesDesc(){return this.get("SourceFilesDesc")}get ResultsDesc(){return this.get("ResultsDesc")}get VariablesDesc(){return this.get("VariablesDesc")}get TimersDesc(){return this.get("TimersDesc")}get DebugValuesDesc(){return this.get("DebugValuesDesc")}get ApplicationValuesDesc(){return this.get("ApplicationValuesDesc")}get WorkflowsDesc(){return this.get("WorkflowsDesc")}get ServiceNames(){return this.get("ServiceNames")}get CompileCost(){return this.get("CompileCost")}get ExecuteCost(){return this.get("ExecuteCost")}get FileAccessCost(){return this.get("FileAccessCost")}get NoAccess(){return this.get("NoAccess")}get ECLWUProcessList(){return this.get("ECLWUProcessList")}get CostSavingPotential(){return this.get("CostSavingPotential")}get FailureDesc(){return this.get("FailureDesc")}get FileSummaries(){return this.get("FileSummaries")}static create(e){let t=new n(e);return t.connection.WUCreate().then(s=>(en.set(t),t.set(s.Workunit),t))}static attach(e,t,s){let r=en.get({BaseUrl:e.baseUrl,Wuid:t},()=>new n(e,t));return s&&r.set(s),r}static existsLocal(e,t){return en.has({BaseUrl:e,Wuid:t})}static submit(e,t,s,r=!1){return n.create(e).then(i=>i.update({QueryText:s})).then(i=>r?i.submit(t,ze.Action.Compile):i.submit(t))}static compile(e,t,s){return n.submit(e,t,s,!0)}static query(e,t){return new ie(e).WUQuery(t).then(r=>r.Workunits.ECLWorkunit.map(function(i){return n.attach(e,i.Wuid,i)}))}constructor(e,t){super(),this.connection=new ie(e),this.topologyConnection=new ce(e),this.clearState(t)}clearState(e){this.clear({Wuid:e,StateID:0})}update(e){return this.connection.WUUpdate({...e,Wuid:this.Wuid,StateOrig:this.StateID,JobnameOrig:this.Jobname,DescriptionOrig:this.Description,ProtectedOrig:this.Protected,ClusterOrig:this.Cluster}).then(t=>(this.set(t.Workunit),this))}submit(e,t=ze.Action.Run,s){let r;return e!==void 0?r=Promise.resolve(e):r=this.topologyConnection.DefaultTpLogicalClusterQuery().then(i=>i.Name),this._debugMode=!1,t===ze.Action.Debug&&(t=ze.Action.Run,this._debugMode=!0),r.then(i=>this.connection.WUUpdate({Wuid:this.Wuid,Action:t,ResultLimit:s,DebugValues:{DebugValue:[{Name:"Debug",Value:this._debugMode?"1":""}]}}).then(o=>(this.set(o.Workunit),this._submitAction=t,this.connection.WUSubmit({Wuid:this.Wuid,Cluster:i})))).then(()=>this)}isComplete(){switch(this.StateID){case 1:return this.ActionEx==="compile"||this._submitAction===ze.Action.Compile;case 3:case 4:case 7:case 999:return!0;default:}return!1}isFailed(){switch(this.StateID){case 7:case 4:return!0;default:}return!1}isDeleted(){return this.StateID===999}isDebugging(){switch(this.StateID){case 14:case 15:return!0;default:}return this._debugMode}isRunning(){switch(this.StateID){case 1:case 2:case 6:case 8:case 14:case 15:return!0;default:}return!1}setToFailed(){return this.WUAction(me.ECLWUActions.SetToFailed)}pause(){return this.WUAction(me.ECLWUActions.Pause)}pauseNow(){return this.WUAction(me.ECLWUActions.PauseNow)}resume(){return this.WUAction(me.ECLWUActions.Resume)}abort(){return this.WUAction(me.ECLWUActions.Abort)}protect(){return this.WUAction(me.ECLWUActions.Protect)}unprotect(){return this.WUAction(me.ECLWUActions.Unprotect)}delete(){return this.WUAction(me.ECLWUActions.Delete)}restore(){return this.WUAction(me.ECLWUActions.Restore)}deschedule(){return this.WUAction(me.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(me.ECLWUActions.Reschedule)}resubmit(){return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!1}).then(()=>(this.clearState(this.Wuid),this.refresh().then(()=>(this._monitor(),this))))}clone(){return this.WUResubmit({CloneWorkunit:!0,ResetWorkflow:!1}).then(e=>n.attach(this.connection.opts(),e.WUs.WU[0].WUID).refresh())}async refreshState(){return await this.WUQuery(),this.StateID===1&&!this.ActionEx&&!this._submitAction&&await this.refreshInfo(),this}async refreshInfo(e){return await this.WUInfo(e),this}async refreshDebug(){return await this.debugStatus(),this}async refresh(e=!1,t){return e?await Promise.all([this.refreshInfo(t),this.refreshDebug()]):await this.refreshState(),this}eclExceptions(){return this.Exceptions.ECLException}fetchArchive(){return this.connection.WUFileEx({Wuid:this.Wuid,Type:"ArchiveQuery"})}fetchECLExceptions(){return this.WUInfo({IncludeExceptions:!0}).then(()=>this.eclExceptions())}fetchResults(){return this.WUInfo({IncludeResults:!0}).then(()=>this.CResults)}fetchGraphs(){return this.WUInfo({IncludeGraphs:!0}).then(()=>this.CGraphs)}fetchQuery(){return this.WUInfo({IncludeECL:!0,TruncateEclTo64k:!1}).then(()=>this.Query)}fetchHelpers(){return this.WUInfo({IncludeHelpers:!0}).then(()=>this.Helpers?.ECLHelpFile||[])}fetchAllowedClusters(){return this.WUInfo({IncludeAllowedClusters:!0}).then(()=>this.AllowedClusters?.AllowedCluster||[])}fetchTotalClusterTime(){return this.WUInfo({IncludeTotalClusterTime:!0}).then(()=>this.TotalClusterTime)}fetchServiceNames(){return this.WUInfo({IncludeServiceNames:!0}).then(()=>this.ServiceNames?.Item)}fetchDetailsMeta(e={}){return this.WUDetailsMeta(e)}fetchDetailsRaw(e={}){return this.WUDetails(e).then(t=>t.Scopes.Scope)}normalizeDetails(e,t){let s={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},r=new Map;for(let o of e.Activities?.Activity??[])r.set(o.Kind,o.Name);let i=new Array(t.length);for(let o=0;o<t.length;o++){let c=t[o],d={},x={};if(c.Properties?.Property)for(let V of c.Properties.Property){let j=V.Measure,X=V.Name,w=V.RawValue;if(j==="ns"&&(V.Measure="s"),X==="Kind"){let M=parseInt(w,10);V.Formatted=r.get(M)??w}switch(s[X]={Name:V.Name,Measure:V.Measure,Creator:V.Creator,CreatorType:V.CreatorType},V.Measure){case"bool":d[X]=!!+w;break;case"sz":d[X]=+w;break;case"s":d[X]=+w/1e9;break;case"ns":d[X]=+w;break;case"ts":d[X]=new Date(+w/1e3).toISOString();break;case"cnt":d[X]=+w;break;case"cost":d[X]=+w/1e6;break;case"node":d[X]=+w;break;case"skw":d[X]=+w;break;default:d[X]=w}x[X]=_o(V.Formatted??d[X])}let l={id:c.Id,name:c.ScopeName,type:c.ScopeType,Kind:c.Kind,Label:c.Label,__formattedProps:x,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...d},E=l[ti];if(E)try{let V=JSON.parse(E.split("\\").join("\\\\")),j=[];for(let X=0;X<V.length;X++){let w=V[X].match(Yo);w&&j.push({filePath:(w[1]??"")+w[2]+w[3],line:parseInt(w[5],10),col:parseInt(w[6],10)})}l[ti]=j}catch{$s.error(`Unexpected "DefinitionList": ${E}`)}let R={},I=0,N="";for(let V in l)if(!V.startsWith("__")){let j=zo(l,V,R);j&&(l.__groupedProps[j.Key]=j,!isNaN(j.StdDevs)&&j.StdDevs>I&&(I=j.StdDevs,N=j.Key))}l.__StdDevs=I,l.__StdDevsSource=N,i[o]=l}return{meta:e,columns:s,data:i}}fetchDetailsNormalized(e={}){return Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(t=>this.normalizeDetails(t[0],t[1]))}fetchInfo(e={}){return this.WUInfo(e)}fetchDetails(e={}){return this.WUDetails(e).then(t=>t.Scopes.Scope.map(s=>new At(this,s)))}fetchDetailsHierarchy(e={}){return this.WUDetails(e).then(t=>{let s=[],r={};t.Scopes.Scope.forEach(i=>{if(r[i.ScopeName])return r[i.ScopeName].update(i),null;{let o=new At(this,i);return r[o.ScopeName]=o,o}});for(let i in r)if(r.hasOwnProperty(i)){let o=r[i],c=o.parentScope();c&&r[c]?r[c].children().push(o):s.push(o)}return s})}fetchGraphDetails(e=[],t){return this.fetchDetails({ScopeFilter:{MaxDepth:999999,Ids:e,ScopeTypes:t},NestedFilter:{Depth:999999,ScopeTypes:["graph","subgraph","activity","edge","function"]},PropertiesToReturn:{AllStatistics:!0,AllAttributes:!0,AllHints:!0,AllProperties:!0,AllScopes:!0},ScopeOptions:{IncludeId:!0,IncludeScope:!0,IncludeScopeType:!0},PropertyOptions:{IncludeName:!0,IncludeRawValue:!0,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}})}fetchScopeGraphs(e=[]){return this.fetchGraphDetails(e,["graph"]).then(t=>Ht(t))}fetchTimeElapsed(){return this.fetchDetails({ScopeFilter:{PropertyFilters:{PropertyFilter:[{Name:"TimeElapsed"}]}}}).then(e=>{let t={};e.forEach(r=>{t[r.ScopeName]=t[r.ScopeName]||{scope:r.ScopeName,start:null,elapsed:null,finish:null},r.CAttributes.forEach(i=>{i.Name==="TimeElapsed"?t[r.ScopeName].elapsed=+i.RawValue:i.Measure==="ts"&&i.Name.indexOf("Started")>=0&&(t[r.ScopeName].start=i.Formatted)})});let s=[];for(let r in t){let i=t[r];if(i.start&&i.elapsed){let o=jo(i.start);o.setMilliseconds(o.getMilliseconds()+i.elapsed/1e6),i.finish=Ho(o),s.push(i)}}return s.sort((r,i)=>r.start<i.start?-1:r.start>i.start?1:0),s})}_monitor(){if(this.isComplete()){this._monitorTickCount=0;return}super._monitor()}_monitorTimeoutDuration(){let e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?1e3:this._monitorTickCount<=3?3e3:this._monitorTickCount<=5?5e3:this._monitorTickCount<=7?1e4:e}on(e,t,s){if(this.isCallback(t))switch(e){case"completed":super.on("propChanged","StateID",r=>{this.isComplete()&&t([r])});break;case"changed":super.on(e,t);break;default:}else e==="changed"&&super.on(e,t,s);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,s)=>{let r=this.watch(i=>{e&&e(i),this.isComplete()&&(r.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,s)=>{let r=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(r.release(),t(this))})})}WUQuery(e={}){return this.connection.WUQuery({...e,Wuid:this.Wuid}).then(t=>(t.Workunits.ECLWorkunit.length===0?(this.clearState(this.Wuid),this.set("StateID",999)):this.set(t.Workunits.ECLWorkunit[0]),t)).catch(t=>{if(!t.Exception.some(r=>r.Code===20081?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw $s.warning(`Unexpected ESP exception: ${t.message}`),t;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),en.set(this),e))}WUInfo(e={}){let t=e.IncludeResults||e.IncludeResultsViewNames;return this.connection.WUInfo({...e,Wuid:this.Wuid,IncludeResults:t,IncludeResultsViewNames:t,SuppressResultSchemas:!1}).then(s=>(this.set(s.Workunit),t&&this.set({ResultViews:s.ResultViews}),s)).catch(s=>{if(!s.Exception.some(i=>i.Code===20080?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw $s.warning(`Unexpected ESP exception: ${s.message}`),s;return{}})}WUResubmit(e){return this.connection.WUResubmit((0,We.deepMixinT)({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails((0,We.deepMixinT)({ScopeFilter:{MaxDepth:9999},ScopeOptions:{IncludeMatchedScopesInResults:!0,IncludeScope:!0,IncludeId:!1,IncludeScopeType:!1},PropertyOptions:{IncludeName:!0,IncludeRawValue:!1,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}},e,{WUID:this.Wuid})).then(t=>(0,We.deepMixinT)({Scopes:{Scope:[]}},t))}WUAction(e){return this.connection.WUAction({Wuids:{Item:[this.Wuid]},WUActionType:e}).then(t=>this.refresh().then(()=>(this._monitor(),t)))}publish(e){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:e||this.Jobname,AllowForeignFiles:!0,Activate:me.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){let t=new Gt({baseUrl:""}),s={Wuid:this.Wuid,Cluster:this.Cluster,JobName:this.Jobname,AllowForeignFiles:!0,Activate:1,Wait:5e3,...e};return t.WUPublishWorkunitEx(s)}WUCDebug(e,t={}){let s="";for(let r in t)t.hasOwnProperty(r)&&(s+=` ${r}='${t[r]}'`);return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:`<debug:${e} uid='${this.Wuid}'${s}/>`}).then(r=>r)}debug(e,t){return this.isDebugging()?this.WUCDebug(e,t).then(s=>{let r=s.children(e);return r.length?r[0]:new We.XMLNode(e)}).catch(s=>($s.error(s),Promise.resolve(new We.XMLNode(e)))):Promise.resolve(new We.XMLNode(e))}debugStatus(){return this.isDebugging()?this.debug("status").then(e=>{let t={...this.DebugState,...e.$};return this.set({DebugState:t}),e}):Promise.resolve({DebugState:{state:"unknown"}})}debugContinue(e=""){return this.debug("continue",{mode:e})}debugStep(e){return this.debug("step",{mode:e})}debugPause(){return this.debug("interrupt")}debugQuit(){return this.debug("quit")}debugDeleteAllBreakpoints(){return this.debug("delete",{idx:0})}debugBreakpointResponseParser(e){return e.children().map(t=>{if(t.name==="break")return t.$})}debugBreakpointAdd(e,t,s){return this.debug("breakpoint",{id:e,mode:t,action:s}).then(r=>this.debugBreakpointResponseParser(r))}debugBreakpointList(){return this.debug("list").then(e=>this.debugBreakpointResponseParser(e))}debugGraph(){return this._debugAllGraph&&this.DebugState._prevGraphSequenceNum===this.DebugState.graphSequenceNum?Promise.resolve(this._debugAllGraph):this.debug("graph",{name:"all"}).then(e=>(this.DebugState._prevGraphSequenceNum=this.DebugState.graphSequenceNum,this._debugAllGraph=tr(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(t=>Zo(t,e))}debugPrint(e,t=0,s=10){return this.debug("print",{edgeID:e,startRow:t,numRows:s}).then(r=>r.children().map(i=>{let o={};return i.children().forEach(c=>{o[c.name]=c.content}),o}))}},rr="definition";function Jo(n){return n._[rr]!==void 0}function Ko(n){let e=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(n._[rr]);if(e){let[,t,s,r]=e;return t.replace(/\/\.\//g,"/"),{id:n._.id,file:t,line:+s,column:+r}}throw new Error(`Bad definition: ${n._[rr]}`)}function Zo(n,e){let t=[];for(let s of n.vertices)if(Jo(s)){let r=Ko(s);(r&&!e||e===r.file)&&t.push(r)}return t.sort((s,r)=>s.line-r.line)}var nn,ir=class n extends rn.StateObject{connection;get properties(){return this.get()}get Exceptions(){return this.get("Exceptions")}get Build(){return this.get("Build")}get ThorClusterList(){return this.get("ThorClusterList")}get RoxieClusterList(){return this.get("RoxieClusterList")}get HThorClusterList(){return this.get("HThorClusterList")}get DFUJobs(){return this.get("DFUJobs")}get Running(){return this.get("Running",{ActiveWorkunit:[]})}get BannerContent(){return this.get("BannerContent")}get BannerColor(){return this.get("BannerColor")}get BannerSize(){return this.get("BannerSize")}get BannerScroll(){return this.get("BannerScroll")}get ChatURL(){return this.get("ChatURL")}get ShowBanner(){return this.get("ShowBanner")}get ShowChatURL(){return this.get("ShowChatURL")}get SortBy(){return this.get("SortBy")}get Descending(){return this.get("Descending")}get SuperUser(){return this.get("SuperUser")}get AccessRight(){return this.get("AccessRight")}get ServerJobQueues(){return this.get("ServerJobQueues")}get ActivityTime(){return this.get("ActivityTime")}get DaliDetached(){return this.get("DaliDetached")}static attach(e,t){return nn||(nn=new n(e)),t&&nn.set(t),nn}constructor(e){super(),e instanceof Ct?this.connection=e:this.connection=new Ct(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(t=>e===""||t.ClusterName===e).map(t=>ct.attach(this.connection.connectionOptions(),t.Wuid,t))}setBanner(e){return this.connection.SetBanner({...e}).then(t=>(this.set(t),this))}lazyRefresh=(0,rn.debounce)(async()=>{let e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}};var xt=require("@hpcc-js/util");var $o=(0,xt.scopedLogger)("logicalFile.ts"),on=class extends xt.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}},ea=new on,or=class n extends xt.StateObject{connection;get BaseUrl(){return this.connection.baseUrl}get Cluster(){return this.get("Cluster")}get Name(){return this.get("Name")}get Filename(){return this.get("Filename")}get Prefix(){return this.get("Prefix")}get NodeGroup(){return this.get("NodeGroup")}get NumParts(){return this.get("NumParts")}get Description(){return this.get("Description")}get Dir(){return this.get("Dir")}get PathMask(){return this.get("PathMask")}get Filesize(){return this.get("Filesize")}get FileSizeInt64(){return this.get("FileSizeInt64")}get RecordSize(){return this.get("RecordSize")}get RecordCount(){return this.get("RecordCount")}get RecordSizeInt64(){return this.get("RecordSizeInt64")}get RecordCountInt64(){return this.get("RecordCountInt64")}get Wuid(){return this.get("Wuid")}get Owner(){return this.get("Owner")}get JobName(){return this.get("JobName")}get Persistent(){return this.get("Persistent")}get Format(){return this.get("Format")}get MaxRecordSize(){return this.get("MaxRecordSize")}get CsvSeparate(){return this.get("CsvSeparate")}get CsvQuote(){return this.get("CsvQuote")}get CsvTerminate(){return this.get("CsvTerminate")}get CsvEscape(){return this.get("CsvEscape")}get Modified(){return this.get("Modified")}get Ecl(){return this.get("Ecl")}get Stat(){return this.get("Stat")}get DFUFilePartsOnClusters(){return this.get("DFUFilePartsOnClusters")}get isSuperfile(){return this.get("isSuperfile")}get ShowFileContent(){return this.get("ShowFileContent")}get subfiles(){return this.get("subfiles")}get Superfiles(){return this.get("Superfiles")}get ProtectList(){return this.get("ProtectList")}get FromRoxieCluster(){return this.get("FromRoxieCluster")}get Graphs(){return this.get("Graphs")}get UserPermission(){return this.get("UserPermission")}get ContentType(){return this.get("ContentType")}get CompressedFileSize(){return this.get("CompressedFileSize")}get PercentCompressed(){return this.get("PercentCompressed")}get IsCompressed(){return this.get("IsCompressed")}get BrowseData(){return this.get("BrowseData")}get jsonInfo(){return this.get("jsonInfo")}get binInfo(){return this.get("binInfo")}get PackageID(){return this.get("PackageID")}get Partition(){return this.get("Partition")}get Blooms(){return this.get("Blooms")}get ExpireDays(){return this.get("ExpireDays")}get KeyType(){return this.get("KeyType")}get IsRestricted(){return this.get("IsRestricted")}get AtRestCost(){return this.get("AtRestCost")}get AccessCost(){return this.get("AccessCost")}get StateID(){return this.get("StateID")}get ExpirationDate(){return this.get("ExpirationDate")}get ExtendedIndexInfo(){return this.get("ExtendedIndexInfo")}get CompressionType(){return this.get("CompressionType")}get properties(){return this.get()}static attach(e,t,s,r){let i=ea.get({BaseUrl:e.baseUrl,Cluster:t,Name:s},()=>new n(e,t,s));return r&&i.set(r),i}constructor(e,t,s){super(),e instanceof Dt?this.connection=e:this.connection=new Dt(e),this.clear({Cluster:t,Name:s})}filePartsOnCluster(){return[...this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[]]}fileParts(){let e=[];for(let t of this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[])for(let s of t?.DFUFileParts?.DFUPart||[]){let r={...t,...s};delete r.DFUFileParts,e.push(r)}return e}update(e){return this.connection.DFUInfo({...e,Cluster:this.Cluster,Name:this.Name}).then(t=>(this.set({Cluster:this.Cluster,...t.FileDetail}),t))}fetchInfo(){return this.connection.DFUInfo({Cluster:this.Cluster,Name:this.Name}).then(e=>(this.set({Cluster:this.Cluster,...e.FileDetail,ProtectList:e?.FileDetail?.ProtectList??{DFUFileProtect:[]}}),e.FileDetail)).catch(e=>{if(!e.Exception.some(s=>s.Code===20038?(this.set("Name",this.Name+" (Deleted)"),this.set("StateID",999),!0):!1))throw $o.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}fetchDefFile(e){return this.connection.DFUFile({Name:this.Name,Format:e})}fetchAllLogicalFiles(){return this.connection.recursiveFetchLogicalFiles([this])}fetchListHistory(){return this.connection.ListHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}eraseHistory(){return this.connection.EraseHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}};var cn=require("@hpcc-js/util");var an=class extends cn.Cache{constructor(){super(e=>e.Address)}},ta=new an,$t=class n extends cn.StateObject{connection;get Address(){return this.get("Address")}get ConfigAddress(){return this.get("ConfigAddress")}get Name(){return this.get("Name")}get ProcessType(){return this.get("ProcessType")}get DisplayType(){return this.get("DisplayType")}get Description(){return this.get("Description")}get AgentVersion(){return this.get("AgentVersion")}get Contact(){return this.get("Contact")}get Location(){return this.get("Location")}get UpTime(){return this.get("UpTime")}get ComponentName(){return this.get("ComponentName")}get ComponentPath(){return this.get("ComponentPath")}get RoxieState(){return this.get("RoxieState")}get RoxieStateDetails(){return this.get("RoxieStateDetails")}get OS(){return this.get("OS")}get ProcessNumber(){return this.get("ProcessNumber")}get Channels(){return this.get("Channels")}get Processors(){return this.get("Processors")}get Storage(){return this.get("Storage")}get Running(){return this.get("Running")}get PhysicalMemory(){return this.get("PhysicalMemory")}get VirtualMemory(){return this.get("VirtualMemory")}get ComponentInfo(){return this.get("ComponentInfo")}get Exception(){return this.get("Exception")}static attach(e,t,s){let r=ta.get({Address:t},()=>new n(e));return s&&r.set(s),r}constructor(e){super(),e instanceof Ge?this.connection=e:this.connection=new Ge(e)}};var dt=require("@hpcc-js/util"),ai=Pe(Xn(),1);var lt=require("@hpcc-js/util");var ln=require("@hpcc-js/util");var un=class extends ln.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}},sa=new un,ut=class n extends ln.StateObject{connection;machineConnection;get BaseUrl(){return this.connection.baseUrl}get Name(){return this.get("Name")}get Prefix(){return this.get("Prefix")}get Type(){return this.get("Type")}get IsDefault(){return this.get("IsDefault")}get TpClusters(){return this.get("TpClusters")}get TpEclCCServers(){return this.get("TpEclCCServers")}get TpEclServers(){return this.get("TpEclServers")}get TpEclAgents(){return this.get("TpEclAgents")}get TpEclSchedulers(){return this.get("TpEclSchedulers")}get MachineInfoEx(){return this.get("MachineInfoEx",[])}get CMachineInfoEx(){return this.MachineInfoEx.map(e=>$t.attach(this.machineConnection,e.Address,e))}static attach(e,t,s){let r=sa.get({BaseUrl:e.baseUrl,Name:t},()=>new n(e,t));return s&&r.set(s),r}constructor(e,t){super(),e instanceof ce?(this.connection=e,this.machineConnection=new Ge(e.connectionOptions())):(this.connection=new ce(e),this.machineConnection=new Ge(e)),this.clear({Name:t})}fetchMachines(e={}){return this.machineConnection.GetTargetClusterInfo({TargetClusters:{Item:[`${this.Type}:${this.Name}`]},...e}).then(t=>{let s=[];for(let r of t.TargetClusterInfoList.TargetClusterInfo)for(let i of r.Processes.MachineInfoEx)s.push(i);return this.set("MachineInfoEx",s),this.CMachineInfoEx})}machineStats(){let e=0,t=0,s=0;for(let r of this.CMachineInfoEx)for(let i of r.Storage.StorageInfo){t+=i.Available,s+=i.Total;let o=1-i.Available/i.Total;o>e&&(e=o)}return{maxDisk:e,meanDisk:1-(s?t/s:1)}}fetchUsage(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])}};function na(n){let e;return n instanceof ce?e=n:e=new ce(n),e.TpListTargetClusters({}).then(t=>t.TargetClusters.TpClusterNameType.map(s=>ut.attach(n,s.Name,s)))}var ar={};function ra(n){if(!ar[n.baseUrl]){let e;n instanceof ce?e=n:e=new ce(n),ar[n.baseUrl]=e.TpListTargetClusters({}).then(t=>{let s,r,i;t.TargetClusters.TpClusterNameType.forEach(c=>{s||(s=c),!r&&c.IsDefault===!0&&(r=c),!i&&c.Type==="hthor"&&(i=c)});let o=r||i||s;return ut.attach(n,o.Name,o)})}return ar[n.baseUrl]}var gn=class extends lt.Cache{constructor(){super(e=>e.BaseUrl)}},ia=new gn,es=class n extends lt.StateObject{connection;get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get TargetClusters(){return this.get("TargetClusters")}get CTargetClusters(){return this.TargetClusters.map(e=>ut.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,t){let s=ia.get({BaseUrl:e.baseUrl},()=>new n(e));return t&&s.set(t),s}constructor(e){super(),e instanceof ce?this.connection=e:this.connection=new ce(e)}GetESPServiceBaseURL(e=""){return this.connection.TpServiceQuery({}).then(t=>{let s=this.connection.protocol(),r=this.connection.ip(),i=s==="https:"?"18002":"8002";if((0,lt.exists)("ServiceList.TpEspServers.TpEspServer",t)){for(let o of t.ServiceList.TpEspServers.TpEspServer)if((0,lt.exists)("TpBindings.TpBinding",o))for(let c of o.TpBindings.TpBinding)c.Service===e&&c.Protocol+":"===s&&(i=c.Port)}return`${s}//${r}:${i}/`})}fetchTargetClusters(){return this.connection.TpTargetClusterQuery({Type:"ROOT"}).then(e=>(this.set({TargetClusters:e.TpTargetClusters?.TpTargetCluster??[]}),this.CTargetClusters))}fetchLogicalClusters(e={}){return this.connection.TpLogicalClusterQuery(e).then(t=>(this.set({LogicalClusters:t.TpLogicalClusters.TpLogicalCluster}),this.LogicalClusters))}fetchServices(e={}){return this.connection.TpServiceQuery(e).then(t=>(this.set({Services:t.ServiceList}),this.Services))}_prevRefresh;refresh(e=!1){return(!this._prevRefresh||e)&&(this._prevRefresh=Promise.all([this.fetchTargetClusters(),this.fetchLogicalClusters(),this.fetchServices()]).then(()=>this)),this._prevRefresh}on(e,t,s){return this.isCallback(t)?e==="changed"&&super.on(e,t):e==="changed"&&super.on(e,t,s),this._monitor(),this}};function Ke(n,e,t){e==="__proto__"||e==="constructor"||e==="prototype"||(n[e]=t)}function ts(n){return n=""+n,n.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"&#10;").replace(/\r/g,"&#13;")}function oa(n){if(n){if(!isNaN(+n))return parseFloat(n)}else return 0;let t=/(?:(?:(\d+).days.)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+\.\d+|\d+)s))|(?:(\d+\.\d+|\d+)ms|(\d+\.\d+|\d+)us|(\d+\.\d+|\d+)ns)/.exec(n);if(!t)return 0;let s=+t[1]||0,r=+t[2]||0,i=+t[3]||0,o=+t[4]||0,c=+t[5]||0,d=+t[6]||0,x=+t[7]||0;return s*24*60*60+r*60*60+i*60+o+c/1e3+d/1e6+x/1e9}function Ze(n,e){let t=n.indexOf(e);return t!==-1?parseFloat(n.substring(0,t)):-1}function aa(n){if(n){if(!isNaN(+n))return parseFloat(n)}else return 0;let e=Ze(n,"Kb");return e>=0?e*1024:(e=Ze(n,"Mb"),e>=0?e*Math.pow(1024,2):(e=Ze(n,"Gb"),e>=0?e*Math.pow(1024,3):(e=Ze(n,"Tb"),e>=0?e*Math.pow(1024,4):(e=Ze(n,"Pb"),e>=0?e*Math.pow(1024,5):(e=Ze(n,"Eb"),e>=0?e*Math.pow(1024,6):(e=Ze(n,"Zb"),e>=0?e*Math.pow(1024,7):(e=Ze(n,"b"),e>=0?e:0)))))))}function ca(n){return n?parseFloat(n):0}var cr=class{graph;m_xgmml;m_visibleSubgraphs;m_visibleVertices;m_semiVisibleVertices;m_visibleEdges;noSpills;constructor(e){this.graph=e,this.m_xgmml="",this.m_visibleSubgraphs={},this.m_visibleVertices={},this.m_semiVisibleVertices={},this.m_visibleEdges={}}calcVisibility(e,t,s,r){this.noSpills=r,e.forEach(i=>{this.graph.isVertex(i)?(this.calcInVertexVisibility(i,s),this.calcOutVertexVisibility(i,s)):this.graph.isEdge(i)?(this.calcInVertexVisibility(i.getSource(),s-1),this.calcOutVertexVisibility(i.getTarget(),s-1)):this.graph.isSubgraph(i)&&(this.m_visibleSubgraphs[i.__hpcc_id]=i,this.calcSubgraphVisibility(i,t-1))}),this.calcVisibility2()}calcInVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getInEdges().forEach(s=>{this.calcInVertexVisibility(s.getSource(),t-1)})}calcOutVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getOutEdges().forEach(s=>{this.calcOutVertexVisibility(s.getTarget(),t-1)})}calcSubgraphVisibility(e,t){if(t<0)return;t>0&&e.__hpcc_subgraphs.forEach((r,i)=>{this.calcSubgraphVisibility(r,t-1)}),e.__hpcc_subgraphs.forEach((r,i)=>{this.m_visibleSubgraphs[r.__hpcc_id]=r}),e.__hpcc_vertices.forEach((r,i)=>{this.m_visibleVertices[r.__hpcc_id]=r});let s={};this.graph.edges.forEach((r,i)=>{r.getSource().__hpcc_parent!==r.getTarget().__hpcc_parent&&e===this.getCommonAncestor(r)&&(s[r.getSource().__hpcc_parent.__hpcc_id+"::"+r.getTarget().__hpcc_parent.__hpcc_id]||(s[r.getSource().__hpcc_parent.__hpcc_id+"::"+r.getTarget().__hpcc_parent.__hpcc_id]=!0,this.m_visibleEdges[r.__hpcc_id]=r))})}buildVertexString(e,t){let s="",r="",i=e.getProperties();for(let o in i)t&&o.indexOf("_kind")>=0?r+='<att name="_kind" value="point"/>':o==="id"||o==="label"?s+=" "+o+'="'+ts(i[o])+'"':r+='<att name="'+o+'" value="'+ts(i[o])+'"/>';return"<node"+s+">"+r+"</node>"}buildEdgeString(e){let t="",s="",r=e.getProperties();for(let i in r)i.toLowerCase()==="id"||i.toLowerCase()==="label"||i.toLowerCase()==="source"||i.toLowerCase()==="target"?t+=" "+i+'="'+ts(r[i])+'"':s+='<att name="'+i+'" value="'+ts(r[i])+'"/>';return"<edge"+t+">"+s+"</edge>"}getAncestors(e,t){let s=e.__hpcc_parent;for(;s;)t.push(s),s=s.__hpcc_parent}getCommonAncestorV(e,t){let s=[],r=[];this.getAncestors(e,s),this.getAncestors(t,r);let i=s.length-1,o=r.length-1,c=null;for(;i>=0&&o>=0&&s[i]===r[o];)c=s[i],--i,--o;return c}getCommonAncestor(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())}calcAncestorVisibility(e){let t=[];this.getAncestors(e,t),t.forEach((s,r)=>{this.m_visibleSubgraphs[s.__hpcc_id]=s})}calcVisibility2(){for(let e in this.m_visibleVertices){let t=this.m_visibleVertices[e];t.getInEdges().forEach((s,r)=>{this.m_visibleEdges[s.__hpcc_id]=s}),t.getOutEdges().forEach((s,r)=>{this.m_visibleEdges[s.__hpcc_id]=s}),this.calcAncestorVisibility(t)}this.calcSemiVisibleVertices()}addSemiVisibleEdge(e){e&&!this.m_visibleEdges[e.__hpcc_id]&&(this.m_visibleEdges[e.__hpcc_id]=e)}addSemiVisibleVertex(e){this.m_visibleVertices[e.__hpcc_id]||(this.m_semiVisibleVertices[e.__hpcc_id]=e,this.calcAncestorVisibility(e))}calcSemiVisibleVertices(){for(let e in this.m_visibleEdges){let t=this.m_visibleEdges[e],s=t.getSource();for(this.addSemiVisibleVertex(s);this.noSpills&&s.isSpill();){let i=s.getInEdges();if(i.length)this.addSemiVisibleEdge(i[0]),s=i[0].getSource(),this.addSemiVisibleVertex(s);else break}let r=t.getTarget();for(this.addSemiVisibleVertex(r);this.noSpills&&r.isSpill();){let i=r.getOutEdges();if(i.length)this.addSemiVisibleEdge(i[0]),r=i[0].getTarget(),this.addSemiVisibleVertex(r);else break}}}writeXgmml(){this.subgraphVisited(this.graph.subgraphs[0],!0),this.graph.edges.forEach((e,t)=>{this.edgeVisited(e)})}subgraphVisited(e,t=!1){if(this.m_visibleSubgraphs[e.__hpcc_id]){let s="";this.m_xgmml+=t?"":'<node id="'+e.__hpcc_id+'"><att><graph>';let r=this.m_xgmml.length;if(e.walkSubgraphs(this),e.walkVertices(this),r===this.m_xgmml.length){let o=e.__hpcc_vertices[0];o&&(this.m_xgmml+=this.buildVertexString(o,!0))}let i=e.getProperties();for(let o in i)s+='<att name="'+o+'" value="'+ts(i[o])+'"/>';this.m_xgmml+=t?"":"</graph></att>"+s+"</node>"}return!1}vertexVisited(e){this.m_visibleVertices[e.__hpcc_id]?this.m_xgmml+=this.buildVertexString(e,!1):this.m_semiVisibleVertices[e.__hpcc_id]&&(this.m_xgmml+=this.buildVertexString(e,!0))}edgeVisited(e){this.m_visibleEdges[e.__hpcc_id]&&(this.m_xgmml+=this.buildEdgeString(e))}},ss=class{__hpcc_graph;__hpcc_parent;__widget;__hpcc_id;_globalID;constructor(e,t){this.__hpcc_graph=e,this.__hpcc_id=t,this._globalID=t}getProperties(){let e={};for(let t in this)t.indexOf("__")!==0&&this.hasOwnProperty(t)&&(e[t]=this[t]);return e}},$e=class extends ss{_globalType;__hpcc_subgraphs;__hpcc_vertices;__hpcc_edges;id;constructor(e,t){super(e,t),this._globalType=t==="0"?"Graph":"Cluster",this.__hpcc_subgraphs=[],this.__hpcc_vertices=[],this.__hpcc_edges=[],this.id=t}addSubgraph(e){e.__hpcc_parent=this,this.__hpcc_subgraphs.some(t=>e===t)||this.__hpcc_subgraphs.push(e)}addVertex(e){e.__hpcc_parent=this,this.__hpcc_vertices.some(t=>e===t)||this.__hpcc_vertices.push(e)}removeVertex(e){this.__hpcc_vertices=this.__hpcc_vertices.filter(t=>e!==t)}addEdge(e){e.__hpcc_parent=this,this.__hpcc_edges.some(t=>e===t)||this.__hpcc_edges.push(e)}removeEdge(e){this.__hpcc_edges=this.__hpcc_edges.filter(t=>e!==t)}remove(){this.__hpcc_subgraphs.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),this.__hpcc_vertices.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),this.__hpcc_edges.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),delete this.__hpcc_parent,this.__hpcc_graph.removeItem(this)}walkSubgraphs(e){this.__hpcc_subgraphs.forEach((t,s)=>{e.subgraphVisited(t)&&t.walkSubgraphs(e)})}walkVertices(e){this.__hpcc_vertices.forEach((t,s)=>{e.vertexVisited(t)})}},gt=class extends ss{_globalType="Vertex";_isSpill;constructor(e,t){super(e,t)}isSpill(){return this._isSpill}remove(){let e=this.getInVertices();e.length<=1&&console.warn(this.__hpcc_id+": remove only supports single or zero inputs activities..."),this.getInEdges().forEach(t=>{t.remove()}),this.getOutEdges().forEach(t=>{t.setSource(e[0])}),this.__hpcc_parent?.removeVertex(this),this.__hpcc_graph.removeItem(this)}getInVertices(){return this.getInEdges().map(e=>e.getSource())}getInEdges(){return this.__hpcc_graph.edges.filter(e=>e.getTarget()===this)}getOutVertices(){return this.getOutEdges().map(e=>e.getTarget())}getOutEdges(){return this.__hpcc_graph.edges.filter(e=>e.getSource()===this)}},pt=class extends ss{_globalType="Edge";_sourceActivity;source;_targetActivity;target;constructor(e,t){super(e,t),this._globalType="Edge"}remove(){this.__hpcc_graph.subgraphs.forEach(e=>{e.removeEdge(this)}),this.__hpcc_graph.removeItem(this)}getSource(){return this.__hpcc_graph.idx[this._sourceActivity||this.source]}setSource(e){this._sourceActivity?this._sourceActivity=e.__hpcc_id:this.source&&(this.source=e.__hpcc_id),this.__widget&&this.__widget.setSource(this.getSource().__widget)}getTarget(){return this.__hpcc_graph.idx[this._targetActivity||this.target]}},ns=class n{idx={};subgraphs=[];vertices=[];edges=[];xgmml="";constructor(){this.clear()}clear(){this.xgmml="",this.idx={},this.subgraphs=[],this.vertices=[],this.edges=[]}load(e){this.clear(),this.merge(e)}merge(e){this.xgmml=e;let s=new DOMParser().parseFromString(e,"text/xml");this.walkDocument(s.documentElement,"0")}isSubgraph(e){return e instanceof $e}isVertex(e){return e instanceof gt}isEdge(e){return e instanceof pt}getGlobalType(e){return e instanceof gt?3:e instanceof pt?4:e instanceof $e?2:e instanceof n?1:0}getGlobalTypeString(e){return e instanceof gt?"Vertex":e instanceof pt?"Edge":e instanceof $e?"Cluster":e instanceof n?"Graph":"Unknown"}getItem(e,t){if(!this.idx[t])switch(e.tagName){case"graph":let r=new $e(this,t);this.subgraphs.push(r),this.idx[t]=r;break;case"node":let i=new gt(this,t);this.vertices.push(i),this.idx[t]=i;break;case"edge":let o=new pt(this,t);this.edges.push(o),this.idx[t]=o;break;default:console.warn("Graph.getItem - Unknown Node Type!");break}let s=this.idx[t];return Array.from(e.attributes).forEach(r=>{Ke(s,r.name,r.value)}),s}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof $e?this.subgraphs=this.subgraphs.filter(t=>e!==t):e instanceof gt?this.vertices=this.vertices.filter(t=>e!==t):e instanceof pt&&(this.edges=this.edges.filter(t=>e!==t))}getChildByTagName(e,t){let s=null;return Array.from(e.childNodes).some(r=>{if(r.tagName===t)return s=r,!0}),s}walkDocument(e,t){let s=this.getItem(e,t);return e.childNodes.forEach(r=>{switch(r.nodeType){case 1:switch(r.tagName){case"graph":break;case"node":let i=!1,o=this.getChildByTagName(r,"att");if(o){let E=this.getChildByTagName(o,"graph");if(E){i=!0;let R=this.walkDocument(E,r.getAttribute("id"));s.addSubgraph(R)}}if(!i){let E=this.walkDocument(r,r.getAttribute("id"));s.addVertex(E)}break;case"att":let c=r.getAttribute("name"),d="_"+c,x=r.getAttribute("value");c.indexOf("Time")===0?(Ke(s,d,x),Ke(s,c,""+oa(x))):c.indexOf("Size")===0?(Ke(s,d,x),Ke(s,c,""+aa(x))):c.indexOf("Skew")===0?(Ke(s,d,x),Ke(s,c,""+ca(x))):Ke(s,c,x);break;case"edge":let l=this.walkDocument(r,r.getAttribute("id"));if(l.NumRowsProcessed!==void 0?l._eclwatchCount=l.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):l.Count!==void 0?l._eclwatchCount=l.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):l.count!==void 0&&(l._eclwatchCount=l.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),l.inputProgress&&(l._eclwatchInputProgress="["+l.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),l.SkewMaxRowsProcessed&&l.SkewMinRowsProcessed&&(l._eclwatchSkew="+"+l.SkewMaxRowsProcessed+", "+l.SkewMinRowsProcessed),!l._dependsOn){if(!l._childGraph){if(l._sourceActivity||l._targetActivity){l._isSpill=!0;let E=l.getSource();E&&(E._isSpill=!0);let R=l.getTarget();R&&(R._isSpill=!0)}}}s.addEdge(l);break;default:break}break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:break;default:break}}),s}removeSubgraphs(){[...this.subgraphs].forEach(t=>{t.__hpcc_parent instanceof $e&&t.remove()})}removeSpillVertices(){[...this.vertices].forEach(t=>{t.isSpill()&&t.remove()})}getLocalisedXGMML(e,t,s,r){let i=new cr(this);return i.calcVisibility(e,t,s,r),i.writeXgmml(),"<graph>"+i.m_xgmml+"</graph>"}};var pn=(0,dt.scopedLogger)("@hpcc-js/comms/ecl/query.ts"),ua=(0,ai.format)("~s");function la(n){return!isNaN(parseFloat(n))&&!isNaN(n-0)}var ur=class extends dt.Cache{constructor(){super(e=>dt.Cache.hash([e.QueryId,e.QuerySet]))}},ga=new ur,lr=class n extends dt.StateObject{wsWorkunitsService;get BaseUrl(){return this.wsWorkunitsService.baseUrl}topology;_requestSchema;_responseSchema;get properties(){return this.get()}get Exceptions(){return this.get("Exceptions")}get QueryId(){return this.get("QueryId")}get QuerySet(){return this.get("QuerySet")}get QueryName(){return this.get("QueryName")}get Wuid(){return this.get("Wuid")}get Dll(){return this.get("Dll")}get Suspended(){return this.get("Suspended")}get Activated(){return this.get("Activated")}get SuspendedBy(){return this.get("SuspendedBy")}get Clusters(){return this.get("Clusters")}get PublishedBy(){return this.get("PublishedBy")}get Comment(){return this.get("Comment")}get LogicalFiles(){return this.get("LogicalFiles")}get SuperFiles(){return this.get("SuperFiles")}get IsLibrary(){return this.get("IsLibrary")}get Priority(){return this.get("Priority")}get WUSnapShot(){return this.get("WUSnapShot")}get CompileTime(){return this.get("CompileTime")}get LibrariesUsed(){return this.get("LibrariesUsed")}get CountGraphs(){return this.get("CountGraphs")}get ResourceURLCount(){return this.get("ResourceURLCount")}get WsEclAddresses(){return this.get("WsEclAddresses")}get WUGraphs(){return this.get("WUGraphs")}get WUTimers(){return this.get("WUTimers")}get PriorityID(){return this.get("PriorityID")}constructor(e,t,s,r){super(),e instanceof ie?this.wsWorkunitsService=e:this.wsWorkunitsService=new ie(e),this.topology=es.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:t,QueryId:s,...r})}static attach(e,t,s,r){let i=ga.get({BaseUrl:e.baseUrl,QuerySet:t,QueryId:s},()=>new n(e,t,s));return r&&i.set(r),i}_eclService;async wsEclService(){return this._eclService||(this._eclService=this.topology.fetchServices({}).then(e=>{for(let t of e?.TpEspServers?.TpEspServer??[])for(let s of t?.TpBindings?.TpBinding??[])if(s?.Service==="ws_ecl"){let r=`${s.Protocol}://${globalThis.location.hostname}:${s.Port}`;return new Qt({baseUrl:r})}})),this._eclService}async fetchDetails(){let e=await this.wsWorkunitsService.WUQueryDetails({QuerySet:this.QuerySet,QueryId:this.QueryId,IncludeStateOnClusters:!0,IncludeSuperFiles:!0,IncludeWsEclAddresses:!0,CheckAllNodes:!1});this.set({...e})}async fetchRequestSchema(){let e=await this.wsEclService();try{this._requestSchema=await e?.requestJson(this.QuerySet,this.QueryId)??[]}catch(t){pn.debug(t.message??t),this._requestSchema=[]}}async fetchResponseSchema(){let e=await this.wsEclService();try{this._responseSchema=await e?.responseJson(this.QuerySet,this.QueryId)??{}}catch(t){pn.debug(t.message??t),this._responseSchema={}}}async fetchSchema(){await Promise.all([this.fetchRequestSchema(),this.fetchResponseSchema()])}fetchSummaryStats(){return this.wsWorkunitsService.WUQueryGetSummaryStats({Target:this.QuerySet,QueryId:this.QueryId})}fetchGraph(e="",t=""){return this.wsWorkunitsService.WUQueryGetGraph({Target:this.QuerySet,QueryId:this.QueryId,GraphName:e,SubGraphId:t}).then(s=>{let r=new ns,i=!0;for(let o of s?.Graphs?.ECLGraphEx||[])i?(r.load(o.Graph),i=!1):r.merge(o.Graph);return r})}fetchDetailsNormalized(e={}){let t=ct.attach(this.wsWorkunitsService,this.Wuid);return t?Promise.all([this.fetchGraph(),t.fetchDetailsMeta(),t.fetchDetailsRaw(e)]).then(s=>{let r=s[0],i=s[1],c=s[2].map(d=>{let x=d.Id[0];if(x==="a"||x==="e"){let l=r.idx[d.Id.substring(1)];if(!l)return pn.debug(`Missing graph data for metric ID: ${d.Id}`),d;let E=new Set(d.Properties.Property.map(I=>I.Name)),R=[];for(let I in l){let N=I.charAt(0);if(N!=="_"&&N===N.toUpperCase()&&!E.has(I)){let V=l[I],j=typeof V;if(j==="string"||j==="number"||j==="boolean"){let w=la(V)?parseFloat(V):V,M=V;I.indexOf("Time")>=0&&(w=w/1e9,M=ua(w)+"s"),R.push({Name:I,RawValue:w,Formatted:M})}}}R.length>0&&d.Properties.Property.push(...R)}return d});return t.normalizeDetails(i,c)}):Promise.resolve({meta:void 0,columns:void 0,data:void 0})}async submit(e){let t=await this.wsEclService();try{return t?.submit(this.QuerySet,this.QueryId,e).then(s=>{for(let r in s)s[r]=s[r].Row;return s})??[]}catch(s){return pn.debug(s.message??s),[]}}async refresh(){return await Promise.all([this.fetchDetails(),this.fetchSchema()]),this}requestFields(){return this._requestSchema?this._requestSchema:[]}responseFields(){return this._responseSchema?this._responseSchema:{}}resultNames(){let e=[];for(let t in this.responseFields())e.push(t);return e}resultFields(e){return this._responseSchema[e]?this._responseSchema[e]:[]}};var yt=require("@hpcc-js/util");var dn=class extends yt.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}},pa=new dn,et=class extends yt.Message{constructor(t,s,r){super();this.key=t;this.value=s;this.oldValue=r}key;value;oldValue;get canConflate(){return!0}conflate(t){return this.key===t.key?(this.value=t.value,!0):!1}void(){return this.value===this.oldValue}},gr=class n{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new yt.Dispatch;static attach(e,t="HPCCApps",s,r=!0){return pa.get({BaseUrl:e.baseUrl,Name:t,UserSpecific:r,Namespace:s},()=>new n(e,t,s,r))}constructor(e,t,s,r){e instanceof Rt?this.connection=e:this.connection=new Rt(e),this.Name=t,this.UserSpecific=r,this.Namespace=s}_knownValues={};create(){this.connection.CreateStore({Name:this.Name,Type:"",Description:""})}set(e,t,s=!0){return this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e,Value:t}).then(r=>{let i=this._knownValues[e];this._knownValues[e]=t,s&&this._dispatch.post(new et(e,t,i))}).catch(r=>{console.error(`Store.set("${e}", "${t}") failed:`,r)})}get(e,t=!0){return this.connection.Fetch({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(s=>{let r=this._knownValues[e];return this._knownValues[e]=s.Value,t&&this._dispatch.post(new et(e,s.Value,r)),s.Value}).catch(s=>{console.error(`Store.get(${e}) failed:`,s)})}getAll(e=!0){return this.connection.FetchAll({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace}).then(t=>{let s={},r=this._knownValues;if(this._knownValues={},t.Pairs.Pair.forEach(i=>{let o=this._knownValues[i.Key];this._knownValues[i.Key]=i.Value,delete r[i.Key],s[i.Key]=i.Value,e&&this._dispatch.post(new et(i.Key,i.Value,o))}),e)for(let i in r)this._dispatch.post(new et(i,void 0,r[i]));return s}).catch(t=>(console.error("Store.getAll failed:",t),{}))}delete(e,t=!0){return this.connection.Delete({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(s=>{let r=this._knownValues[e];delete this._knownValues[e],t&&this._dispatch.post(new et(e,void 0,r))}).catch(s=>{console.error(`Store.delete(${e}) failed:`,s)})}monitor(e){return this._dispatch.attach(e)}};var Wt=require("@hpcc-js/util");var da=(0,Wt.scopedLogger)("@hpcc-js/comms/dfuWorkunit.ts");var mn=class extends Wt.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}},ci=new mn,pr=class n extends Wt.StateObject{connection;topologyConnection;get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get ID(){return this.get("ID")}get DFUServerName(){return this.get("DFUServerName")}get ClusterName(){return this.get("ClusterName")}get JobName(){return this.get("JobName")}get Queue(){return this.get("Queue")}get User(){return this.get("User")}get isProtected(){return this.get("isProtected")}get Command(){return this.get("Command")}get CommandMessage(){return this.get("CommandMessage")}get PercentDone(){return this.get("PercentDone")}get SecsLeft(){return this.get("SecsLeft")}get ProgressMessage(){return this.get("ProgressMessage")}get SummaryMessage(){return this.get("SummaryMessage")}get State(){return this.get("State",0)}get SourceLogicalName(){return this.get("SourceLogicalName")}get SourceIP(){return this.get("SourceIP")}get SourceFilePath(){return this.get("SourceFilePath")}get SourceDali(){return this.get("SourceDali")}get SourceRecordSize(){return this.get("SourceRecordSize")}get SourceFormat(){return this.get("SourceFormat")}get RowTag(){return this.get("RowTag")}get SourceNumParts(){return this.get("SourceNumParts")}get SourceDirectory(){return this.get("SourceDirectory")}get DestLogicalName(){return this.get("DestLogicalName")}get DestGroupName(){return this.get("DestGroupName")}get DestDirectory(){return this.get("DestDirectory")}get DestIP(){return this.get("DestIP")}get DestFilePath(){return this.get("DestFilePath")}get DestFormat(){return this.get("DestFormat")}get DestNumParts(){return this.get("DestNumParts")}get DestRecordSize(){return this.get("DestRecordSize")}get Replicate(){return this.get("Replicate")}get Overwrite(){return this.get("Overwrite")}get Compress(){return this.get("Compress")}get SourceCsvSeparate(){return this.get("SourceCsvSeparate")}get SourceCsvQuote(){return this.get("SourceCsvQuote")}get SourceCsvTerminate(){return this.get("SourceCsvTerminate")}get SourceCsvEscape(){return this.get("SourceCsvEscape")}get TimeStarted(){return this.get("TimeStarted")}get TimeStopped(){return this.get("TimeStopped")}get StateMessage(){return this.get("StateMessage")}get StateReason(){return this.get("StateReason")}get MonitorEventName(){return this.get("MonitorEventName")}get MonitorSub(){return this.get("MonitorSub")}get MonitorShotLimit(){return this.get("MonitorShotLimit")}get SourceDiffKeyName(){return this.get("SourceDiffKeyName")}get DestDiffKeyName(){return this.get("DestDiffKeyName")}get Archived(){return this.get("Archived")}get encrypt(){return this.get("encrypt")}get decrypt(){return this.get("decrypt")}get failIfNoSourceFile(){return this.get("failIfNoSourceFile")}get recordStructurePresent(){return this.get("recordStructurePresent")}get quotedTerminator(){return this.get("quotedTerminator")}get preserveCompression(){return this.get("preserveCompression")}get expireDays(){return this.get("expireDays")}get PreserveFileParts(){return this.get("PreserveFileParts")}get FileAccessCost(){return this.get("FileAccessCost")}get KbPerSecAve(){return this.get("KbPerSecAve")}get KbPerSec(){return this.get("KbPerSec")}static create(e,t){let s=new n(e);return s.connection.CreateDFUWorkunit({DFUServerQueue:t}).then(r=>(ci.set(s),s.set(r.result),s))}static attach(e,t,s){let r=ci.get({BaseUrl:e.baseUrl,ID:t},()=>new n(e,t));return s&&r.set(s),r}static sprayFixed(e,t){let s=new Xe(e);return s.SprayFixedEx({...t}).then(r=>{let i=r.wuid;return s.GetDFUWorkunit({wuid:i}).then(o=>n.attach(e,i,o.result))})}static sprayVariable(e,t){let s=new Xe(e);return s.SprayVariableEx({...t}).then(r=>{let i=r.wuid;return s.GetDFUWorkunit({wuid:i}).then(o=>n.attach(e,i,o.result))})}static despray(e,t){let s=new Xe(e);return s.DesprayEx({...t}).then(r=>{let i=r.wuid;return s.GetDFUWorkunit({wuid:i}).then(o=>n.attach(e,i,o.result))})}update(e){return this.connection.UpdateDFUWorkunitEx({wu:{JobName:e?.wu?.JobName??this.JobName,isProtected:e?.wu?.isProtected??this.isProtected,ID:this.ID,State:this.State},ClusterOrig:this.ClusterName,JobNameOrig:this.JobName,isProtectedOrig:this.isProtected,StateOrig:this.State})}isComplete(){switch(this.State){case 6:case 5:case 4:case 999:return!0;default:}return!1}isFailed(){return!!(this.isComplete()&&this.State!==6)}isDeleted(){return this.State===999}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(St.DFUWUActions.Delete).then(e=>this.refresh().then(()=>(this._monitor(),e)))}async refresh(e=!1){return await this.GetDFUWorkunit(),this}fetchXML(e){return this.DFUWUFile()}_monitor(){if(this.isComplete()){this._monitorTickCount=0;return}super._monitor()}_monitorTimeoutDuration(){let e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?3e3:this._monitorTickCount<=5?6e3:this._monitorTickCount<=7?12e3:e}DFUWUFile(e={}){return this.connection.DFUWUFileEx({...e,Wuid:this.ID}).then(t=>t).catch(t=>"")}DFUWUAction(e){return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:e}).then(t=>e===St.DFUWUActions.Delete?t:this.refresh().then(()=>(this._monitor(),t)))}on(e,t,s){if(this.isCallback(t))switch(e){case"finished":super.on("propChanged","State",r=>{this.isComplete()&&t([r])});break;case"changed":super.on(e,t);break;default:}else e==="changed"&&super.on(e,t,s);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,s)=>{let r=this.watch(i=>{e&&e(i),this.isComplete()&&(r.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,s)=>{let r=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(r.release(),t(this))})})}constructor(e,t){super(),this.connection=new Xe(e),this.topologyConnection=new ce(e),this.clearState(t)}clearState(e){this.clear({ID:e,State:0})}GetDFUWorkunit(e={}){return this.connection.GetDFUWorkunit({...e,wuid:this.ID}).then(t=>(this.set(t.result),t)).catch(t=>{if(!t.Exception.some(r=>r.Code===20080||r.Code===20081?(this.clearState(this.ID),this.set("State",999),!0):!1))throw da.warning(`Unexpected ESP exception: ${t.message}`),t;return{}})}};var fi=Pe(require("node:child_process"),1),Si=Pe(require("node:crypto"),1),he=Pe(require("node:fs"),1),ke=Pe(require("node:os"),1),De=Pe(require("node:path"),1),It=require("@hpcc-js/util");var mt=Pe(require("node:fs"),1),$=Pe(require("node:path"),1),be=require("@hpcc-js/util");var ma=(0,be.scopedLogger)("clienttools/eclmeta"),ha=!1;function bt(n,e,t){if(ha){for(let s in n){let r=`${e}.${s}`;s!=="$"&&t[s]===void 0&&t[s.toLowerCase()+"s"]===void 0&&ma.debug(r)}n.$&&bt(n.$,e+".$",t)}}var hn=class{__attrs;name;constructor(e){this.__attrs=e.$,this.name=e.$.name}},fn=class{__attrs;definition;get scope(){return this.definition}name;type;constructor(e,t){this.__attrs=t.$,this.definition=e,this.name=t.$.name,this.type=t.$.type}},ht=class{get scope(){return this}name;type;sourcePath;line;start;body;end;definitions;constructor(e,t,s,r,i=1,o=0,c=0,d=Number.MAX_VALUE){this.name=e,this.type=t,this.sourcePath=$.normalize(s),this.line=+i-1,this.start=+o,this.body=+c,this.end=+d,this.definitions=this.parseDefinitions(r)}parseDefinitions(e=[]){return e.map(t=>{let s=new Sn(this.sourcePath,t);return bt(t,"definition",s),s})}contains(e){return e>=this.start&&e<=this.end}scopeStackAt(e){let t=[];return this.contains(e)&&(t.push(this),this.definitions.forEach(s=>{t=s.scopeStackAt(e).concat(t)})),t}_resolve(e=[],t){let s=t.split("."),r=s.shift(),i=(0,be.find)(e,o=>typeof o.name=="string"&&typeof r=="string"&&o.name.toLowerCase()===r.toLowerCase());return i&&i.definitions.length&&s.length?this._resolve(i.definitions,s.join(".")):i}resolve(e){return this._resolve(this.definitions,e)}suggestions(){return this.definitions.map(e=>({name:e.name,type:this.type}))}},Sn=class extends ht{__attrs;exported;shared;fullname;inherittype;attrs;fields;constructor(e,t){super(t.$.name,t.$.type,e,t.children("Definition"),t.$.line,t.$.start,t.$.body,t.$.end),this.__attrs=t.$,this.exported=!!t.$.exported,this.shared=!!t.$.shared,this.fullname=t.$.fullname,this.inherittype=t.$.inherittype,this.attrs=this.parseAttrs(t.children("Attr")),this.fields=this.parseFields(t.children("Field"))}parseAttrs(e=[]){return e.map(t=>{let s=new hn(t);return bt(t,"attr",s),s})}parseFields(e=[]){return e.map(t=>{let s=new fn(this,t);return bt(t,"field",s),s})}suggestions(){return super.suggestions().concat(this.fields.map(e=>({name:e.name,type:e.type})))}},rs=class{__attrs;name;ref;start;end;line;constructor(e){this.__attrs=e.$,this.name=e.$.name,this.ref=e.$.ref,this.start=e.$.start,this.end=e.$.end,this.line=e.$.line}},Dn=class extends ht{imports;__attrs;constructor(e){super(e.$.name,"source",e.$.sourcePath,e.children("Definition")),this.__attrs=e.$;let t=e.$.name.split(".");t.pop();let s=new be.XMLNode("");s.appendAttribute("name","$"),s.appendAttribute("ref",t.join(".")),this.imports=[new rs(s),...this.parseImports(e.children("Import"))]}parseImports(e=[]){return e.map(t=>{let s=new rs(t);return bt(t,"import",s),s})}resolve(e,t){let s;return!s&&t!==void 0&&this.scopeStackAt(t).some(i=>(s=i.resolve(e),!!s)),s||(s=super.resolve(e)),s}},fa=n=>$.basename(n).indexOf(".")===0,ui=n=>mt.lstatSync(n).isDirectory()&&!fa(n),Sa=n=>[".ecl",".ecllib"].indexOf($.extname(n).toLowerCase())>=0,li=n=>mt.readdirSync(n).map(e=>$.join(n,e)).filter(e=>ui(e)||Sa(e)),Cn=class extends ht{constructor(e,t){super(e,"file",t,[])}suggestions(){return[]}},Rn=class extends ht{constructor(e,t){super(e,"folder",t,[])}suggestions(){return li(this.sourcePath).map(e=>({name:$.basename(e,".ecl"),type:"folder"}))}},An=class{_workspacePath;_eclccPath;_clientTools;_sourceByID=new be.DictionaryNoCase;_sourceByPath=new be.Dictionary;_test=new be.DictionaryNoCase;constructor(e,t){this._workspacePath=e,this._eclccPath=t}refresh(){this.primeWorkspace(),this.primeClientTools()}primeClientTools(){return hr(this._eclccPath,"",this._workspacePath).then(e=>(this._clientTools=e,e.paths())).then(e=>{for(let t of["ECLCC_ECLLIBRARY_PATH","ECLCC_PLUGIN_PATH"])e[t]&&mt.existsSync(e[t])&&this.walkChildFolders(e[t],e[t]);return this})}primeWorkspace(){mt.existsSync(this._workspacePath)&&this.visitFolder(this._workspacePath,this._workspacePath)}walkChildFolders(e,t,s=!1){for(let r of li(e))ui(r)?this.visitFolder(r,t,s):this.visitFile(r,t,s)}visitFile(e,t,s=!1){let r=$.parse(e),i=$.join(r.dir,r.name),o=$.relative(t,i).split($.sep).join(".");(s||!this._test.has(o))&&this._test.set(o,new Cn("",e))}visitFolder(e,t,s=!1){let r=$.relative(t,e).split($.sep).join(".");(s||!this._test.has(r))&&(this._test.set(r,new Rn(r,e)),this.walkChildFolders(e,t,s))}buildStack(e,t,s){let r=t.split(".");s&&e[e.length-1]===r[0]&&r.shift();let i=[...e,...r],o=i.join(".");return{stack:i,qid:o}}walkECLScope(e,t){let s=this.buildStack(e,t.name,!0);this._test.set(s.qid,t);for(let r of t.definitions)this.walkDefinition(s.stack,r)}walkField(e,t){let s=this.buildStack(e,t.name,!1);this._test.set(s.qid,t)}walkDefinition(e,t){let s=this.buildStack(e,t.name,!0);this.walkECLScope(e,t);for(let r of t.fields)this.walkField(s.stack,r)}walkSource(e){this.walkECLScope([],e)}parseSources(e=[]){for(let t of e)if(t.$.name){let s=new Dn(t);if(bt(t,"source",s),this._sourceByID.set(s.name,s),this._sourceByPath.set(s.sourcePath,s),s.name){let i=s.name.split(".").length;if(i>1){let o=s.sourcePath;for(;i>1;)o=$.dirname(o),--i;this.visitFolder(o,$.dirname(o))}}this.walkSource(s)}}parseMetaXML(e){let t=new mr;return t.parse(e),this.parseSources(t.sources),t.sources.map(s=>$.normalize(s.$.sourcePath))}resolveQualifiedID(e,t,s){let r;if(!r&&this._test.has(t)&&(r=this._test.get(t).scope),!r&&this._sourceByPath.has(e)){let i=this._sourceByPath.get(e),o=t.split(".");for(let d of i.imports)if(d.name.toLowerCase()===o[0].toLowerCase()){d.ref?o[0]=d.ref:o.shift();break}let c=o.join(".");!r&&this._test.has(c)&&(r=this._test.get(c).scope),r||(c=[...i.name.split("."),...o].join("."),this._test.has(c)&&(r=this._test.get(c).scope))}return r}resolvePartialID(e,t,s){t=t.toLowerCase();let r=t.split(".");r.pop();let i=r.length===1?r[0]:r.join(".");return this.resolveQualifiedID(e,i,s)}},dr=new be.Dictionary;function tt(n,e){let t=$.normalize(n);if(!dr.has(t)){let s=new An(t,e);dr.set(t,s),s.refresh()}return dr.get(t)}function Da(n,e,t){if(e<0)return!1;let s=n.charAt(e);return(t?/[a-zA-Z\d_\.$]/:/[a-zA-Z\d_]/).test(s)}function Ca(n,e,t){for(;Da(n,e,t);)e+=t?-1:1;return e+(t?1:-1)}var mr=class extends be.SAXStackParser{sources=[];endXMLNode(e){e.name==="Source"&&this.sources.push(e),super.endXMLNode(e)}};var Ut=(0,It.scopedLogger)("clienttools/eclcc"),fr=ke.type()==="Windows_NT"?".exe":"";function gi(n){return n.split(`\r
916
916
  `).join(`
917
917
  `).split("\r").join(`
918
- `)}var Et=class{prefix="";major=0;minor=0;patch=0;postfix="";constructor(e){let t=e.split(" ");if(t.length){let s=/(?:(\w+)_)?(\d+)\.(\d+)\.(\d+)(?:-(.*))?/.exec(t[t.length-1]);s&&(this.prefix=s[1]||"",this.major=+s[2]||0,this.minor=+s[3]||0,this.patch=+s[4]||0,this.postfix=s[5]||"")}}parse(e){}exists(){return this.major!==0||this.minor!==0||this.patch!==0||this.postfix!==""}compare(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch?-1:this.postfix===""&&e.postfix!==""?1:this.postfix.localeCompare(e.postfix)}toString(){return`${this.prefix}_${this.major}.${this.minor}.${this.patch}-${this.postfix}`}},pi="error",di="warning",os=class{_checked;errWarn=[];errOther=[];constructor(e){this._checked=e}checked(){return this._checked}all(){return this.errWarn}errors(){return this.errWarn.filter(e=>e.severity===pi)}hasError(){return this.errors().length>0}warnings(){return this.errWarn.filter(e=>e.severity===di)}hasWarning(){return this.warnings().length>0}info(){return this.errWarn.filter(e=>[pi,di].indexOf(e.severity)<0)}hasOther(){return this.info().length>0}unknown(){return this.errOther}hasUnknown(){return this.unknown().length>0}},as=class extends os{constructor(e,t){if(super(t),e&&e.length)for(let s of e.split(ke.EOL)){let r=/([a-zA-Z]:\\(?:[- \w\.\d]+\\)*(?:[- \w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\) ?: ?(error|warning|info) C(\d*) ?: ?(.*)/.exec(s);if(r){let[,i,o,c,d,y,l]=r,E=+o,R=+c,M=y+": "+l;this.errWarn.push({filePath:i,line:E,col:R,msg:M,severity:d});continue}if(r=/(error|warning|info): (.*)/i.exec(s),r){let[,i,o]=r;this.errWarn.push({filePath:"",line:0,col:0,msg:o,severity:i});continue}r=/\d error(s?), \d warning(s?)/.exec(s),!r&&(Ut.warning(`parseECLErrors: Unable to parse "${s}"`),this.errOther.push(s))}this._checked=t}},xn=class extends os{_lines;constructor(e,t,s){super(s);let r=me.readFileSync(e,"utf8");if(r=r.replace(/\r\n/g,`
918
+ `)}var Et=class{prefix="";major=0;minor=0;patch=0;postfix="";constructor(e){let t=e.split(" ");if(t.length){let s=/(?:(\w+)_)?(\d+)\.(\d+)\.(\d+)(?:-(.*))?/.exec(t[t.length-1]);s&&(this.prefix=s[1]||"",this.major=+s[2]||0,this.minor=+s[3]||0,this.patch=+s[4]||0,this.postfix=s[5]||"")}}parse(e){}exists(){return this.major!==0||this.minor!==0||this.patch!==0||this.postfix!==""}compare(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch?-1:this.postfix===""&&e.postfix!==""?1:this.postfix.localeCompare(e.postfix)}toString(){return`${this.prefix}_${this.major}.${this.minor}.${this.patch}-${this.postfix}`}},pi="error",di="warning",os=class{_checked;errWarn=[];errOther=[];constructor(e){this._checked=e}checked(){return this._checked}all(){return this.errWarn}errors(){return this.errWarn.filter(e=>e.severity===pi)}hasError(){return this.errors().length>0}warnings(){return this.errWarn.filter(e=>e.severity===di)}hasWarning(){return this.warnings().length>0}info(){return this.errWarn.filter(e=>[pi,di].indexOf(e.severity)<0)}hasOther(){return this.info().length>0}unknown(){return this.errOther}hasUnknown(){return this.unknown().length>0}},as=class extends os{constructor(e,t){if(super(t),e&&e.length)for(let s of e.split(ke.EOL)){let r=/([a-zA-Z]:\\(?:[- \w\.\d]+\\)*(?:[- \w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\) ?: ?(error|warning|info) C(\d*) ?: ?(.*)/.exec(s);if(r){let[,i,o,c,d,x,l]=r,E=+o,R=+c,I=x+": "+l;this.errWarn.push({filePath:i,line:E,col:R,msg:I,severity:d});continue}if(r=/(error|warning|info): (.*)/i.exec(s),r){let[,i,o]=r;this.errWarn.push({filePath:"",line:0,col:0,msg:o,severity:i});continue}r=/\d error(s?), \d warning(s?)/.exec(s),!r&&(Ut.warning(`parseECLErrors: Unable to parse "${s}"`),this.errOther.push(s))}this._checked=t}},yn=class extends os{_lines;constructor(e,t,s){super(s);let r=he.readFileSync(e,"utf8");if(r=r.replace(/\r\n/g,`
919
919
  `),this._lines=r.split(`
920
- `),t&&t.length)for(let i of t.split(ke.EOL)){let o=/(Warning|Error) : Path\=(\S*?)(\[\S*\])? Message\=(.*)/.exec(i);if(o){let[,c,d,y,l]=o,E=`${d} ${y||""}: ${l}`,[R,M]=this.locate(d);this.errWarn.push({filePath:e,line:R,col:M,msg:E,severity:c});continue}o||(Ut.warning(`parseECLErrors: Unable to parse "${i}"`),this.errOther.push(i))}this._checked=s}locate(e){let t=e.split("/");if(t.length&&t[0]===""&&t.shift(),t.length>0){let s=0;for(let r of this._lines){let i="<"+t[0];if((r.indexOf(i+" ")>=0||r.indexOf(i+">")>=0)&&(t.shift(),t.length===0))return[s+1,r.indexOf(i)+1];++s}}return[0,0]}};function Wn(n,e,t){t=t||[],t.push(n);for(let s in n)if(n.hasOwnProperty(s)){let r=n[s];e(s,r,t),r instanceof Array?r.forEach(i=>{Wn(i,e,t)}):typeof r=="object"&&Wn(r,e,t)}t.pop()}var bn=class{jsonWU;constructor(e){this.jsonWU=e}bpGetValidLocations(e){let t=[];if((0,It.exists)("W_LOCAL.Graphs",this.jsonWU)){let s="";Wn(this.jsonWU.W_LOCAL.Graphs,(r,i,o)=>{if(r==="$"&&i.id&&(s=i.id),r==="$"&&i.name==="definition"){let c=/([a-z,A-Z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(i.value);if(c){let[,d,y,l]=c,E=+y,R=+l;e===d&&t.push({file:d,line:E,col:R,id:s})}}})}return t}},Ft=class n{eclccPath;envchkPath;eclBundlePath;binPath;cwd;includeFolders;_legacyMode;_args;_version;constructor(e,t,s=[],r=!1,i=[],o){this.eclccPath=e,this.binPath=De.dirname(this.eclccPath),this.envchkPath=De.join(this.binPath,"envchk"+fr),this.eclBundlePath=De.join(this.binPath,"ecl-bundle"+fr),this.cwd=De.normalize(t||this.binPath),this.includeFolders=s,this._legacyMode=r,this._args=i,this._version=o}clone(e,t,s=!1,r=[]){return new n(this.eclccPath,e,t,s,r,this._version)}exists(e){try{return me.accessSync(e),!0}catch{}return!1}args(e=[]){let t=[...this._args];return this._legacyMode&&t.push("-legacy"),t.concat(this.includeFolders.map(s=>"-I"+De.normalize(s))).concat(e)}version(){return this._version?Promise.resolve(this._version):this.execFile(this.eclccPath,this.binPath,this.args(["--version"]),"eclcc",`Cannot find ${this.eclccPath}`).then(e=>(this._version=new Et(e.stdout),this._version))}versionSync(){return this._version}_paths={};paths(){return this.execFile(this.eclccPath,this.cwd,this.args(["-showpaths"]),"eclcc",`Cannot find ${this.eclccPath}`).then(e=>{if(e&&e.stdout&&e.stdout.length){let t=e.stdout.split(/\r?\n/);for(let s of t){let r=s.split("=");r.length===2&&(this._paths[r[0]]=r[1])}}return this._paths})}loadXMLDoc(e,t){return new Promise((s,r)=>{let i=me.readFileSync(e,"ascii"),o=(0,It.xml2json)(i);t&&me.unlink(e,c=>{}),s(o)})}createWU(e){let t=De.join(ke.tmpdir(),`eclcc-wu-tmp-${Di.randomBytes(8).toString("hex")}`),s=["-o"+t,"-wu"].concat([e]);return this.execFile(this.eclccPath,this.cwd,this.args(s),"eclcc",`Cannot find ${this.eclccPath}`).then(r=>{let i=De.normalize(t+".xml");return(this.exists(i)?this.loadXMLDoc(i,!0):Promise.resolve({})).then(c=>new bn(c))})}createArchive(e){let t=["-E"].concat([e]);return this.execFile(this.eclccPath,this.cwd,this.args(t),"eclcc",`Cannot find ${this.eclccPath}`).then(s=>({content:s.stdout,err:new as(s.stderr,[])}))}attachWorkspace(){return tt(this.cwd)}fetchMeta(e){return Promise.all([tt(this.cwd),this.execFile(this.eclccPath,this.cwd,this.args(["-M",e]),"eclcc",`Cannot find ${this.eclccPath}`)]).then(([t,s])=>{try{s&&s.stdout&&s.stdout.length&&t.parseMetaXML(s.stdout)}catch(r){Ut.error(`fetchMeta: Error parsing XML - ${r?.message??"unknown"}`)}return t})}syntaxCheck(e,t=["-syntax"]){return Promise.all([tt(this.cwd),this.execFile(this.eclccPath,this.cwd,this.args([...t,"-M",e]),"eclcc",`Cannot find ${this.eclccPath}`)]).then(([s,r])=>{let i=[];try{r&&r.stdout&&r.stdout.length&&(i=s.parseMetaXML(r.stdout))}catch(o){Ut.error(`syntaxCheck: Error parsing XML - ${o?.message??"unknown"}`)}return new as(r?r.stderr:"",i)})}envCheck(e,t=[]){return Promise.all([tt(this.cwd),this.execFile(this.envchkPath,this.cwd,this.args([...t,e]),"envchk",`Cannot find ${this.envchkPath}`)]).then(([s,r])=>new xn(e,r?r.stderr:"",[]))}bundleList(){let e=/\|(.*)\|(.*)\|(.*)\|/g;return Promise.all([fetch("https://raw.githubusercontent.com/hpcc-systems/ecl-bundles/master/README.rst").then(t=>t.text()).then(t=>{let s=[],r=e.exec(t);for(;r;)s.push({name:r[1].trim(),description:r[2].trim(),url:r[3].trim()}),r=e.exec(t);return s}),this.execFile(this.eclBundlePath,this.cwd,this.args(["list"]),"ecl-bundle",`Cannot find ${this.eclBundlePath}`).then(t=>gi(t.stdout).split(`
920
+ `),t&&t.length)for(let i of t.split(ke.EOL)){let o=/(Warning|Error) : Path\=(\S*?)(\[\S*\])? Message\=(.*)/.exec(i);if(o){let[,c,d,x,l]=o,E=`${d} ${x||""}: ${l}`,[R,I]=this.locate(d);this.errWarn.push({filePath:e,line:R,col:I,msg:E,severity:c});continue}o||(Ut.warning(`parseECLErrors: Unable to parse "${i}"`),this.errOther.push(i))}this._checked=s}locate(e){let t=e.split("/");if(t.length&&t[0]===""&&t.shift(),t.length>0){let s=0;for(let r of this._lines){let i="<"+t[0];if((r.indexOf(i+" ")>=0||r.indexOf(i+">")>=0)&&(t.shift(),t.length===0))return[s+1,r.indexOf(i)+1];++s}}return[0,0]}};function Wn(n,e,t){t=t||[],t.push(n);for(let s in n)if(n.hasOwnProperty(s)){let r=n[s];e(s,r,t),r instanceof Array?r.forEach(i=>{Wn(i,e,t)}):typeof r=="object"&&Wn(r,e,t)}t.pop()}var bn=class{jsonWU;constructor(e){this.jsonWU=e}bpGetValidLocations(e){let t=[];if((0,It.exists)("W_LOCAL.Graphs",this.jsonWU)){let s="";Wn(this.jsonWU.W_LOCAL.Graphs,(r,i,o)=>{if(r==="$"&&i.id&&(s=i.id),r==="$"&&i.name==="definition"){let c=/([a-z,A-Z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(i.value);if(c){let[,d,x,l]=c,E=+x,R=+l;e===d&&t.push({file:d,line:E,col:R,id:s})}}})}return t}},Ft=class n{eclccPath;envchkPath;eclBundlePath;binPath;cwd;includeFolders;_legacyMode;_args;_version;constructor(e,t,s=[],r=!1,i=[],o){this.eclccPath=e,this.binPath=De.dirname(this.eclccPath),this.envchkPath=De.join(this.binPath,"envchk"+fr),this.eclBundlePath=De.join(this.binPath,"ecl-bundle"+fr),this.cwd=De.normalize(t||this.binPath),this.includeFolders=s,this._legacyMode=r,this._args=i,this._version=o}clone(e,t,s=!1,r=[]){return new n(this.eclccPath,e,t,s,r,this._version)}exists(e){try{return he.accessSync(e),!0}catch{}return!1}args(e=[]){let t=[...this._args];return this._legacyMode&&t.push("-legacy"),t.concat(this.includeFolders.map(s=>"-I"+De.normalize(s))).concat(e)}version(){return this._version?Promise.resolve(this._version):this.execFile(this.eclccPath,this.binPath,this.args(["--version"]),"eclcc",`Cannot find ${this.eclccPath}`).then(e=>(this._version=new Et(e.stdout),this._version))}versionSync(){return this._version}_paths={};paths(){return this.execFile(this.eclccPath,this.cwd,this.args(["-showpaths"]),"eclcc",`Cannot find ${this.eclccPath}`).then(e=>{if(e&&e.stdout&&e.stdout.length){let t=e.stdout.split(/\r?\n/);for(let s of t){let r=s.split("=");r.length===2&&(this._paths[r[0]]=r[1])}}return this._paths})}loadXMLDoc(e,t){return new Promise((s,r)=>{let i=he.readFileSync(e,"ascii"),o=(0,It.xml2json)(i);t&&he.unlink(e,c=>{}),s(o)})}createWU(e){let t=De.join(ke.tmpdir(),`eclcc-wu-tmp-${Si.randomBytes(8).toString("hex")}`),s=["-o"+t,"-wu"].concat([e]);return this.execFile(this.eclccPath,this.cwd,this.args(s),"eclcc",`Cannot find ${this.eclccPath}`).then(r=>{let i=De.normalize(t+".xml");return(this.exists(i)?this.loadXMLDoc(i,!0):Promise.resolve({})).then(c=>new bn(c))})}createArchive(e){let t=["-E"].concat([e]);return this.execFile(this.eclccPath,this.cwd,this.args(t),"eclcc",`Cannot find ${this.eclccPath}`).then(s=>({content:s.stdout,err:new as(s.stderr,[])}))}attachWorkspace(){return tt(this.cwd)}fetchMeta(e){return Promise.all([tt(this.cwd),this.execFile(this.eclccPath,this.cwd,this.args(["-M",e]),"eclcc",`Cannot find ${this.eclccPath}`)]).then(([t,s])=>{try{s&&s.stdout&&s.stdout.length&&t.parseMetaXML(s.stdout)}catch(r){Ut.error(`fetchMeta: Error parsing XML - ${r?.message??"unknown"}`)}return t})}syntaxCheck(e,t=["-syntax"]){return Promise.all([tt(this.cwd),this.execFile(this.eclccPath,this.cwd,this.args([...t,"-M",e]),"eclcc",`Cannot find ${this.eclccPath}`)]).then(([s,r])=>{let i=[];try{r&&r.stdout&&r.stdout.length&&(i=s.parseMetaXML(r.stdout))}catch(o){Ut.error(`syntaxCheck: Error parsing XML - ${o?.message??"unknown"}`)}return new as(r?r.stderr:"",i)})}envCheck(e,t=[]){return Promise.all([tt(this.cwd),this.execFile(this.envchkPath,this.cwd,this.args([...t,e]),"envchk",`Cannot find ${this.envchkPath}`)]).then(([s,r])=>new yn(e,r?r.stderr:"",[]))}bundleList(){let e=/\|(.*)\|(.*)\|(.*)\|/g;return Promise.all([fetch("https://raw.githubusercontent.com/hpcc-systems/ecl-bundles/master/README.rst").then(t=>t.text()).then(t=>{let s=[],r=e.exec(t);for(;r;)s.push({name:r[1].trim(),description:r[2].trim(),url:r[3].trim()}),r=e.exec(t);return s}),this.execFile(this.eclBundlePath,this.cwd,this.args(["list"]),"ecl-bundle",`Cannot find ${this.eclBundlePath}`).then(t=>gi(t.stdout).split(`
921
921
  `)).then(t=>{let s={};return Promise.all(t.filter(r=>!!r).map(r=>this.execFile(this.eclBundlePath,this.cwd,this.args(["info",r]),"ecl-bundle",`Cannot find ${this.eclBundlePath}`).then(i=>gi(i.stdout).split(`
922
- `)).then(i=>{let o={};i.forEach(c=>{let d=c.split(":");o[d.shift().trim()]=d.join(":").trim()}),s[r]={name:r,props:o}}))).then(()=>s)})]).then(([t,s])=>{t.forEach(r=>{s[r.name]&&(r.props=s[r.name].props,delete s[r.name])});for(let r in s)t.push({name:r,url:"",description:"",props:s[r].props});return t}).catch(t=>[])}bundleInstall(e){return Promise.all([tt(this.cwd),this.execFile(this.eclBundlePath,this.cwd,this.args(["install",e]),"ecl-bundle",`Cannot find ${this.eclBundlePath}`)]).then(([t,s])=>s)}bundleUninstall(e){return Promise.all([tt(this.cwd),this.execFile(this.eclBundlePath,this.cwd,this.args(["uninstall",e]),"ecl-bundle",`Cannot find ${this.eclBundlePath}`)]).then(([t,s])=>s)}execFile(e,t,s,r,i){return new Promise((o,c)=>{Ut.debug(`${e} ${s.join(" ")}`);let d=fi.spawn(e,s,{cwd:t}),y="",l="";d.stdout.on("data",E=>{y+=E.toString()}),d.stderr.on("data",E=>{l+=E.toString()}),d.on("close",(E,R)=>{o({code:E,stdout:y.trim(),stderr:l.trim()})})})}};function yn(n,e){if(n){let t=De.join(n,"HPCCSystems");if(me.existsSync(t)&&me.statSync(t).isDirectory()){if(ke.type()!=="Windows_NT"){let s=De.join(t,"bin","eclcc");me.existsSync(s)&&e.push(new Ft(s))}me.readdirSync(t).forEach(s=>{let r=De.join(t,s,"clienttools","bin","eclcc"+fr);if(me.existsSync(r)){let i=De.basename(s);new Et(i).exists()&&e.push(new Ft(r))}})}}}var is;function Ra(){is=void 0}function Si(){if(is)return is;let n=[];switch(ke.type()){case"Windows_NT":let e=process.env["ProgramFiles(x86)"]||"";e&&yn(e,n);let t=process.env.ProgramFiles||"";t&&yn(t,n),!e&&!t&&yn("c:\\Program Files (x86)",n);break;case"Linux":case"Darwin":yn("/opt",n);break;default:break}return is=Promise.all(n.map(e=>e.version())).then(()=>(n.sort((e,t)=>t.versionSync().compare(e.versionSync())),n)),is}var mi="";function hi(n){let e=`Using eclccPath setting: ${n}`;mi!==e&&(Ut.info(e),mi=e)}function hr(n="",e="",t=".",s=[],r=!1,i=[]){return n&&me.existsSync(n)?(hi(n),Promise.resolve(new Ft(n,t,s,r,i))):Si().then(o=>{if(!o.length)throw new Error("Unable to locate ECL Client Tools.");let c=new Et(e),d,y;for(let E of o){let R=E.versionSync();if(R.exists()&&(d||(d=E),!y&&c.major===R.major&&(y=E),c.major===R.major&&c.minor===R.minor))return E.clone(t,s,r,i)}let l=y||d;return hi(l.eclccPath),l.clone(t,s,r,i)})}Mt.root.DOMParser=Ci.DOMParser;if(Mt.root.fetch===void 0)throw new Error("@hpcc-js/comms requires Node.js >= 18.0.0 for native fetch support");Mt.root.__hpcc_undiciFetch=Un.fetch;Mt.root.__hpcc_rejectUnauthorizedAgent=new Un.Agent({connect:{rejectUnauthorized:!1}});var Pt="";be.globalAgent.options.ca!==void 0&&(Array.isArray(be.globalAgent.options.ca)&&be.globalAgent.options.ca.length?typeof be.globalAgent.options.ca[0]=="string"?Pt=be.globalAgent.options.ca.join(`
923
- `):be.globalAgent.options.ca[0]instanceof Dr.Buffer&&(Pt=be.globalAgent.options.ca.map(n=>n.toString()).join(`
924
- `)):typeof be.globalAgent.options.ca=="string"?Pt=be.globalAgent.options.ca:be.globalAgent.options.ca instanceof Dr.Buffer&&(Pt=be.globalAgent.options.ca.toString()),Pt+=`
925
- `);Mt.root.__hpcc_trustwaveAgent=new be.Agent({ca:Pt+Ur});0&&(module.exports={AccessService,AccountService,Activity,Attr,Attribute,BUILD_VERSION,BaseScope,ClientTools,CloudService,CodesignService,Connection,DFUArrayActions,DFUChangeProtection,DFUChangeRestriction,DFUDefFileFormat,DFUService,DFUWorkunit,DFUWorkunitCache,DFUXRefService,DaliService,Definition,ECLGraph,ECLScope,ESPConnection,ESPExceptions,EclService,EclccErrors,ElkService,EnvchkErrors,Errors,Field,File,FileSpray,FileSprayService,FileSprayStates,Folder,GlobalResultCache,GraphCache,Import,LocalWorkunit,LogType,LogaccessService,LogicalFile,LogicalFileCache,Machine,MachineCache,MachineService,PKG_NAME,PKG_VERSION,PackageProcessService,PropertyType,Query,QueryGraph,RelatedProperty,Resource,ResourcesService,Result,ResultCache,SMCService,SashaService,Scope,ScopeEdge,ScopeGraph,ScopeSubgraph,ScopeVertex,Service,Source,SourceFile,Store,StoreCache,StoreService,TargetAudience,TargetCluster,TargetClusterCache,Timer,Topology,TopologyCache,TopologyService,ValueChangedMessage,Version,WUStateID,WUUpdate,Workspace,Workunit,WorkunitCache,WorkunitsService,WorkunitsServiceEx,WsAccess,WsCodesign,WsDfu,WsLogaccess,WsSMC,WsSasha,WsTopology,WsWorkunits,XGMMLEdge,XGMMLGraph,XGMMLSubgraph,XGMMLVertex,XSDNode,XSDSchema,XSDSimpleType,XSDXMLNode,attachWorkspace,clearAllClientToolsCache,createConnection,createGraph,createXGMMLGraph,defaultTargetCluster,deserializeResponse,get,hookSend,instanceOfIConnection,instanceOfIOptions,isArray,isECLResult,isExceptions,isWUInfoWorkunit,isWUQueryECLWorkunit,jsonp,locateAllClientTools,locateClientTools,parseXSD,parseXSD2,post,qualifiedIDBoundary,send,serializeRequest,setTransportFactory,splitMetric,targetClusters,walkXmlJson});
922
+ `)).then(i=>{let o={};i.forEach(c=>{let d=c.split(":");o[d.shift().trim()]=d.join(":").trim()}),s[r]={name:r,props:o}}))).then(()=>s)})]).then(([t,s])=>{t.forEach(r=>{s[r.name]&&(r.props=s[r.name].props,delete s[r.name])});for(let r in s)t.push({name:r,url:"",description:"",props:s[r].props});return t}).catch(t=>[])}bundleInstall(e){return Promise.all([tt(this.cwd),this.execFile(this.eclBundlePath,this.cwd,this.args(["install",e]),"ecl-bundle",`Cannot find ${this.eclBundlePath}`)]).then(([t,s])=>s)}bundleUninstall(e){return Promise.all([tt(this.cwd),this.execFile(this.eclBundlePath,this.cwd,this.args(["uninstall",e]),"ecl-bundle",`Cannot find ${this.eclBundlePath}`)]).then(([t,s])=>s)}execFile(e,t,s,r,i){return new Promise((o,c)=>{Ut.debug(`${e} ${s.join(" ")}`);let d=fi.spawn(e,s,{cwd:t}),x="",l="";d.stdout.on("data",E=>{x+=E.toString()}),d.stderr.on("data",E=>{l+=E.toString()}),d.on("close",(E,R)=>{o({code:E,stdout:x.trim(),stderr:l.trim()})})})}};function xn(n,e){if(n){let t=De.join(n,"HPCCSystems");if(he.existsSync(t)&&he.statSync(t).isDirectory()){if(ke.type()!=="Windows_NT"){let s=De.join(t,"bin","eclcc");he.existsSync(s)&&e.push(new Ft(s))}he.readdirSync(t).forEach(s=>{let r=De.join(t,s,"clienttools","bin","eclcc"+fr);if(he.existsSync(r)){let i=De.basename(s);new Et(i).exists()&&e.push(new Ft(r))}})}}}var is;function Ra(){is=void 0}function Di(){if(is)return is;let n=[];switch(ke.type()){case"Windows_NT":let e=process.env["ProgramFiles(x86)"]||"";e&&xn(e,n);let t=process.env.ProgramFiles||"";t&&xn(t,n),!e&&!t&&xn("c:\\Program Files (x86)",n);break;case"Linux":case"Darwin":xn("/opt",n);break;default:break}return is=Promise.all(n.map(e=>e.version())).then(()=>(n.sort((e,t)=>t.versionSync().compare(e.versionSync())),n)),is}var mi="";function hi(n){let e=`Using eclccPath setting: ${n}`;mi!==e&&(Ut.info(e),mi=e)}function hr(n="",e="",t=".",s=[],r=!1,i=[]){return n&&he.existsSync(n)?(hi(n),Promise.resolve(new Ft(n,t,s,r,i))):Di().then(o=>{if(!o.length)throw new Error("Unable to locate ECL Client Tools.");let c=new Et(e),d,x;for(let E of o){let R=E.versionSync();if(R.exists()&&(d||(d=E),!x&&c.major===R.major&&(x=E),c.major===R.major&&c.minor===R.minor))return E.clone(t,s,r,i)}let l=x||d;return hi(l.eclccPath),l.clone(t,s,r,i)})}Mt.root.DOMParser=Ci.DOMParser;if(Mt.root.fetch===void 0)throw new Error("@hpcc-js/comms requires Node.js >= 18.0.0 for native fetch support");Mt.root.__hpcc_undiciFetch=Un.fetch;Mt.root.__hpcc_rejectUnauthorizedAgent=new Un.Agent({connect:{rejectUnauthorized:!1}});var Pt="";Ue.globalAgent.options.ca!==void 0&&(Array.isArray(Ue.globalAgent.options.ca)&&Ue.globalAgent.options.ca.length?typeof Ue.globalAgent.options.ca[0]=="string"?Pt=Ue.globalAgent.options.ca.join(`
923
+ `):Ue.globalAgent.options.ca[0]instanceof Sr.Buffer&&(Pt=Ue.globalAgent.options.ca.map(n=>n.toString()).join(`
924
+ `)):typeof Ue.globalAgent.options.ca=="string"?Pt=Ue.globalAgent.options.ca:Ue.globalAgent.options.ca instanceof Sr.Buffer&&(Pt=Ue.globalAgent.options.ca.toString()),Pt+=`
925
+ `);Mt.root.__hpcc_trustwaveAgent=new Ue.Agent({ca:Pt+Ur});0&&(module.exports={AccessService,AccountService,Activity,Attr,Attribute,BUILD_VERSION,BaseScope,ClientTools,CloudService,CodesignService,Connection,DFUArrayActions,DFUChangeProtection,DFUChangeRestriction,DFUDefFileFormat,DFUService,DFUWorkunit,DFUWorkunitCache,DFUXRefService,DaliService,Definition,ECLGraph,ECLScope,ESPConnection,ESPExceptions,EclService,EclccErrors,ElkService,EnvchkErrors,Errors,Field,File,FileSpray,FileSprayService,FileSprayStates,Folder,GlobalResultCache,GraphCache,Import,LocalWorkunit,LogType,LogaccessService,LogicalFile,LogicalFileCache,Machine,MachineCache,MachineService,PKG_NAME,PKG_VERSION,PackageProcessService,PropertyType,Query,QueryGraph,RelatedProperty,Resource,ResourcesService,Result,ResultCache,SMCService,SashaService,Scope,ScopeEdge,ScopeGraph,ScopeSubgraph,ScopeVertex,Service,Source,SourceFile,Store,StoreCache,StoreService,TargetAudience,TargetCluster,TargetClusterCache,Timer,Topology,TopologyCache,TopologyService,ValueChangedMessage,Version,WUStateID,WUUpdate,Workspace,Workunit,WorkunitCache,WorkunitsService,WorkunitsServiceEx,WsAccess,WsCodesign,WsDfu,WsLogaccess,WsSMC,WsSasha,WsTopology,WsWorkunits,XGMMLEdge,XGMMLGraph,XGMMLSubgraph,XGMMLVertex,XSDNode,XSDSchema,XSDSimpleType,XSDXMLNode,attachWorkspace,clearAllClientToolsCache,createConnection,createGraph,createXGMMLGraph,defaultTargetCluster,deserializeResponse,get,hookSend,instanceOfIConnection,instanceOfIOptions,isArray,isECLResult,isExceptions,isWUInfoWorkunit,isWUQueryECLWorkunit,jsonp,locateAllClientTools,locateClientTools,parseXSD,parseXSD2,post,qualifiedIDBoundary,send,serializeRequest,setTransportFactory,splitMetric,targetClusters,walkXmlJson});
926
926
  //# sourceMappingURL=index.cjs.map