@hpcc-js/comms 3.12.0 → 3.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.umd.cjs +1 -1
- package/dist/browser/index.umd.cjs.map +1 -1
- package/dist/node/index.cjs +9 -9
- package/dist/node/index.cjs.map +3 -3
- package/dist/node/index.js +10 -10
- package/dist/node/index.js.map +3 -3
- package/package.json +3 -3
- package/src/connection.ts +2 -2
- package/src/index.common.ts +0 -1
- package/src/index.node.ts +1 -8
package/dist/node/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var to=Object.create;var hs=Object.defineProperty;var so=Object.getOwnPropertyDescriptor;var no=Object.getOwnPropertyNames;var ro=Object.getPrototypeOf,io=Object.prototype.hasOwnProperty;var Ds=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),oo=(n,e)=>{for(var t in e)hs(n,t,{get:e[t],enumerable:!0})},Wr=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of no(e))!io.call(n,r)&&r!==t&&hs(n,r,{get:()=>e[r],enumerable:!(s=so(e,r))||s.enumerable});return n};var We=(n,e,t)=>(t=n!=null?to(ro(n)):{},Wr(e||!n||!n.__esModule?hs(t,"default",{value:n,enumerable:!0}):t,n)),ao=n=>Wr(hs({},"__esModule",{value:!0}),n);var Hr=Ds((ws,Vr)=>{(function(n,e){typeof ws=="object"&&typeof Vr<"u"?e(ws):typeof define=="function"&&define.amd?define(["exports"],e):e(n.d3=n.d3||{})})(ws,(function(n){"use strict";function e(c,C){return c<C?-1:c>C?1:c>=C?0:NaN}function t(c){return c.length===1&&(c=s(c)),{left:function(C,x,f,d){for(f==null&&(f=0),d==null&&(d=C.length);f<d;){var h=f+d>>>1;c(C[h],x)<0?f=h+1:d=h}return f},right:function(C,x,f,d){for(f==null&&(f=0),d==null&&(d=C.length);f<d;){var h=f+d>>>1;c(C[h],x)>0?d=h:f=h+1}return f}}}function s(c){return function(C,x){return e(c(C),x)}}var r=t(e),i=r.right,o=r.left;function u(c,C){C==null&&(C=l);for(var x=0,f=c.length-1,d=c[0],h=new Array(f<0?0:f);x<f;)h[x]=C(d,d=c[++x]);return h}function l(c,C){return[c,C]}function R(c,C,x){var f=c.length,d=C.length,h=new Array(f*d),E,L,Y,le;for(x==null&&(x=l),E=Y=0;E<f;++E)for(le=c[E],L=0;L<d;++L,++Y)h[Y]=x(le,C[L]);return h}function p(c,C){return C<c?-1:C>c?1:C>=c?0:NaN}function F(c){return c===null?NaN:+c}function y(c,C){var x=c.length,f=0,d=-1,h=0,E,L,Y=0;if(C==null)for(;++d<x;)isNaN(E=F(c[d]))||(L=E-h,h+=L/++f,Y+=L*(E-h));else for(;++d<x;)isNaN(E=F(C(c[d],d,c)))||(L=E-h,h+=L/++f,Y+=L*(E-h));if(f>1)return Y/(f-1)}function M(c,C){var x=y(c,C);return x&&Math.sqrt(x)}function Q(c,C){var x=c.length,f=-1,d,h,E;if(C==null){for(;++f<x;)if((d=c[f])!=null&&d>=d)for(h=E=d;++f<x;)(d=c[f])!=null&&(h>d&&(h=d),E<d&&(E=d))}else for(;++f<x;)if((d=C(c[f],f,c))!=null&&d>=d)for(h=E=d;++f<x;)(d=C(c[f],f,c))!=null&&(h>d&&(h=d),E<d&&(E=d));return[h,E]}var V=Array.prototype,N=V.slice,q=V.map;function k(c){return function(){return c}}function I(c){return c}function b(c,C,x){c=+c,C=+C,x=(d=arguments.length)<2?(C=c,c=0,1):d<3?1:+x;for(var f=-1,d=Math.max(0,Math.ceil((C-c)/x))|0,h=new Array(d);++f<d;)h[f]=c+f*x;return h}var j=Math.sqrt(50),ue=Math.sqrt(10),D=Math.sqrt(2);function P(c,C,x){var f,d=-1,h,E,L;if(C=+C,c=+c,x=+x,c===C&&x>0)return[c];if((f=C<c)&&(h=c,c=C,C=h),(L=w(c,C,x))===0||!isFinite(L))return[];if(L>0)for(c=Math.ceil(c/L),C=Math.floor(C/L),E=new Array(h=Math.ceil(C-c+1));++d<h;)E[d]=(c+d)*L;else for(c=Math.floor(c*L),C=Math.ceil(C*L),E=new Array(h=Math.ceil(c-C+1));++d<h;)E[d]=(c-d)/L;return f&&E.reverse(),E}function w(c,C,x){var f=(C-c)/Math.max(0,x),d=Math.floor(Math.log(f)/Math.LN10),h=f/Math.pow(10,d);return d>=0?(h>=j?10:h>=ue?5:h>=D?2:1)*Math.pow(10,d):-Math.pow(10,-d)/(h>=j?10:h>=ue?5:h>=D?2:1)}function v(c,C,x){var f=Math.abs(C-c)/Math.max(0,x),d=Math.pow(10,Math.floor(Math.log(f)/Math.LN10)),h=f/d;return h>=j?d*=10:h>=ue?d*=5:h>=D&&(d*=2),C<c?-d:d}function z(c){return Math.ceil(Math.log(c.length)/Math.LN2)+1}function se(){var c=I,C=Q,x=z;function f(d){var h,E=d.length,L,Y=new Array(E);for(h=0;h<E;++h)Y[h]=c(d[h],h,d);var le=C(Y),ye=le[0],he=le[1],Z=x(Y,ye,he);Array.isArray(Z)||(Z=v(ye,he,Z),Z=b(Math.ceil(ye/Z)*Z,he,Z));for(var pe=Z.length;Z[0]<=ye;)Z.shift(),--pe;for(;Z[pe-1]>he;)Z.pop(),--pe;var ne=new Array(pe+1),He;for(h=0;h<=pe;++h)He=ne[h]=[],He.x0=h>0?Z[h-1]:ye,He.x1=h<pe?Z[h]:he;for(h=0;h<E;++h)L=Y[h],ye<=L&&L<=he&&ne[i(Z,L,0,pe)].push(d[h]);return ne}return f.value=function(d){return arguments.length?(c=typeof d=="function"?d:k(d),f):c},f.domain=function(d){return arguments.length?(C=typeof d=="function"?d:k([d[0],d[1]]),f):C},f.thresholds=function(d){return arguments.length?(x=typeof d=="function"?d:Array.isArray(d)?k(N.call(d)):k(d),f):x},f}function O(c,C,x){if(x==null&&(x=F),!!(f=c.length)){if((C=+C)<=0||f<2)return+x(c[0],0,c);if(C>=1)return+x(c[f-1],f-1,c);var f,d=(f-1)*C,h=Math.floor(d),E=+x(c[h],h,c),L=+x(c[h+1],h+1,c);return E+(L-E)*(d-h)}}function fe(c,C,x){return c=q.call(c,F).sort(e),Math.ceil((x-C)/(2*(O(c,.75)-O(c,.25))*Math.pow(c.length,-1/3)))}function Te(c,C,x){return Math.ceil((x-C)/(3.5*M(c)*Math.pow(c.length,-1/3)))}function ve(c,C){var x=c.length,f=-1,d,h;if(C==null){for(;++f<x;)if((d=c[f])!=null&&d>=d)for(h=d;++f<x;)(d=c[f])!=null&&d>h&&(h=d)}else for(;++f<x;)if((d=C(c[f],f,c))!=null&&d>=d)for(h=d;++f<x;)(d=C(c[f],f,c))!=null&&d>h&&(h=d);return h}function rt(c,C){var x=c.length,f=x,d=-1,h,E=0;if(C==null)for(;++d<x;)isNaN(h=F(c[d]))?--f:E+=h;else for(;++d<x;)isNaN(h=F(C(c[d],d,c)))?--f:E+=h;if(f)return E/f}function J(c,C){var x=c.length,f=-1,d,h=[];if(C==null)for(;++f<x;)isNaN(d=F(c[f]))||h.push(d);else for(;++f<x;)isNaN(d=F(C(c[f],f,c)))||h.push(d);return O(h.sort(e),.5)}function we(c){for(var C=c.length,x,f=-1,d=0,h,E;++f<C;)d+=c[f].length;for(h=new Array(d);--C>=0;)for(E=c[C],x=E.length;--x>=0;)h[--d]=E[x];return h}function Re(c,C){var x=c.length,f=-1,d,h;if(C==null){for(;++f<x;)if((d=c[f])!=null&&d>=d)for(h=d;++f<x;)(d=c[f])!=null&&h>d&&(h=d)}else for(;++f<x;)if((d=C(c[f],f,c))!=null&&d>=d)for(h=d;++f<x;)(d=C(c[f],f,c))!=null&&h>d&&(h=d);return h}function ce(c,C){for(var x=C.length,f=new Array(x);x--;)f[x]=c[C[x]];return f}function Fe(c,C){if(x=c.length){var x,f=0,d=0,h,E=c[d];for(C==null&&(C=e);++f<x;)(C(h=c[f],E)<0||C(E,E)!==0)&&(E=h,d=f);if(C(E,E)===0)return d}}function Ie(c,C,x){for(var f=(x??c.length)-(C=C==null?0:+C),d,h;f;)h=Math.random()*f--|0,d=c[f+C],c[f+C]=c[h+C],c[h+C]=d;return c}function Me(c,C){var x=c.length,f=-1,d,h=0;if(C==null)for(;++f<x;)(d=+c[f])&&(h+=d);else for(;++f<x;)(d=+C(c[f],f,c))&&(h+=d);return h}function Ne(c){if(!(h=c.length))return[];for(var C=-1,x=Re(c,Se),f=new Array(x);++C<x;)for(var d=-1,h,E=f[C]=new Array(h);++d<h;)E[d]=c[d][C];return f}function Se(c){return c.length}function Ve(){return Ne(arguments)}n.bisect=i,n.bisectRight=i,n.bisectLeft=o,n.ascending=e,n.bisector=t,n.cross=R,n.descending=p,n.deviation=M,n.extent=Q,n.histogram=se,n.thresholdFreedmanDiaconis=fe,n.thresholdScott=Te,n.thresholdSturges=z,n.max=ve,n.mean=rt,n.median=J,n.merge=we,n.min=Re,n.pairs=u,n.permute=ce,n.quantile=O,n.range=b,n.scan=Fe,n.shuffle=Ie,n.sum=Me,n.ticks=P,n.tickIncrement=w,n.tickStep=v,n.transpose=Ne,n.variance=y,n.zip=Ve,Object.defineProperty(n,"__esModule",{value:!0})}))});var Xn=Ds((js,Or)=>{(function(n,e){typeof js=="object"&&typeof Or<"u"?e(js):typeof define=="function"&&define.amd?define(["exports"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.d3=n.d3||{}))})(js,(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,P){if((w=(D=P?D.toExponential(P-1):D.toExponential()).indexOf("e"))<0)return null;var w,v=D.slice(0,w);return[v.length>1?v[0]+v.slice(2):v,+D.slice(w+1)]}function s(D){return D=t(Math.abs(D)),D?D[1]:NaN}function r(D,P){return function(w,v){for(var z=w.length,se=[],O=0,fe=D[0],Te=0;z>0&&fe>0&&(Te+fe+1>v&&(fe=Math.max(1,v-Te)),se.push(w.substring(z-=fe,z+fe)),!((Te+=fe+1)>v));)fe=D[O=(O+1)%D.length];return se.reverse().join(P)}}function i(D){return function(P){return P.replace(/[0-9]/g,function(w){return D[+w]})}}var o=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function u(D){if(!(P=o.exec(D)))throw new Error("invalid format: "+D);var P;return new l({fill:P[1],align:P[2],sign:P[3],symbol:P[4],zero:P[5],width:P[6],comma:P[7],precision:P[8]&&P[8].slice(1),trim:P[9],type:P[10]})}u.prototype=l.prototype;function l(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+""}l.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 R(D){e:for(var P=D.length,w=1,v=-1,z;w<P;++w)switch(D[w]){case".":v=z=w;break;case"0":v===0&&(v=w),z=w;break;default:if(!+D[w])break e;v>0&&(v=0);break}return v>0?D.slice(0,v)+D.slice(z+1):D}var p;function F(D,P){var w=t(D,P);if(!w)return D+"";var v=w[0],z=w[1],se=z-(p=Math.max(-8,Math.min(8,Math.floor(z/3)))*3)+1,O=v.length;return se===O?v:se>O?v+new Array(se-O+1).join("0"):se>0?v.slice(0,se)+"."+v.slice(se):"0."+new Array(1-se).join("0")+t(D,Math.max(0,P+se-1))[0]}function y(D,P){var w=t(D,P);if(!w)return D+"";var v=w[0],z=w[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,P){return(D*100).toFixed(P)},b:function(D){return Math.round(D).toString(2)},c:function(D){return D+""},d:e,e:function(D,P){return D.toExponential(P)},f:function(D,P){return D.toFixed(P)},g:function(D,P){return D.toPrecision(P)},o:function(D){return Math.round(D).toString(8)},p:function(D,P){return y(D*100,P)},r:y,s:F,X:function(D){return Math.round(D).toString(16).toUpperCase()},x:function(D){return Math.round(D).toString(16)}};function Q(D){return D}var V=Array.prototype.map,N=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function q(D){var P=D.grouping===void 0||D.thousands===void 0?Q:r(V.call(D.grouping,Number),D.thousands+""),w=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?Q:i(V.call(D.numerals,String)),O=D.percent===void 0?"%":D.percent+"",fe=D.minus===void 0?"-":D.minus+"",Te=D.nan===void 0?"NaN":D.nan+"";function ve(J){J=u(J);var we=J.fill,Re=J.align,ce=J.sign,Fe=J.symbol,Ie=J.zero,Me=J.width,Ne=J.comma,Se=J.precision,Ve=J.trim,c=J.type;c==="n"?(Ne=!0,c="g"):M[c]||(Se===void 0&&(Se=12),Ve=!0,c="g"),(Ie||we==="0"&&Re==="=")&&(Ie=!0,we="0",Re="=");var C=Fe==="$"?w:Fe==="#"&&/[boxX]/.test(c)?"0"+c.toLowerCase():"",x=Fe==="$"?v:/[%p]/.test(c)?O:"",f=M[c],d=/[defgprs%]/.test(c);Se=Se===void 0?6:/[gprs]/.test(c)?Math.max(1,Math.min(21,Se)):Math.max(0,Math.min(20,Se));function h(E){var L=C,Y=x,le,ye,he;if(c==="c")Y=f(E)+Y,E="";else{E=+E;var Z=E<0||1/E<0;if(E=isNaN(E)?Te:f(Math.abs(E),Se),Ve&&(E=R(E)),Z&&+E==0&&ce!=="+"&&(Z=!1),L=(Z?ce==="("?ce:fe:ce==="-"||ce==="("?"":ce)+L,Y=(c==="s"?N[8+p/3]:"")+Y+(Z&&ce==="("?")":""),d){for(le=-1,ye=E.length;++le<ye;)if(he=E.charCodeAt(le),48>he||he>57){Y=(he===46?z+E.slice(le+1):E.slice(le))+Y,E=E.slice(0,le);break}}}Ne&&!Ie&&(E=P(E,1/0));var pe=L.length+E.length+Y.length,ne=pe<Me?new Array(Me-pe+1).join(we):"";switch(Ne&&Ie&&(E=P(ne+E,ne.length?Me-Y.length:1/0),ne=""),Re){case"<":E=L+E+Y+ne;break;case"=":E=L+ne+E+Y;break;case"^":E=ne.slice(0,pe=ne.length>>1)+L+E+Y+ne.slice(pe);break;default:E=ne+L+E+Y;break}return se(E)}return h.toString=function(){return J+""},h}function rt(J,we){var Re=ve((J=u(J),J.type="f",J)),ce=Math.max(-8,Math.min(8,Math.floor(s(we)/3)))*3,Fe=Math.pow(10,-ce),Ie=N[8+ce/3];return function(Me){return Re(Fe*Me)+Ie}}return{format:ve,formatPrefix:rt}}var k;I({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function I(D){return k=q(D),n.format=k.format,n.formatPrefix=k.formatPrefix,k}function b(D){return Math.max(0,-s(Math.abs(D)))}function j(D,P){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(s(P)/3)))*3-s(Math.abs(D)))}function ue(D,P){return D=Math.abs(D),P=Math.abs(P)-D,Math.max(0,s(P)-s(D))+1}n.FormatSpecifier=l,n.formatDefaultLocale=I,n.formatLocale=q,n.formatSpecifier=u,n.precisionFixed=b,n.precisionPrefix=j,n.precisionRound=ue,Object.defineProperty(n,"__esModule",{value:!0})}))});var Xr=Ds((_s,Yr)=>{(function(n,e){typeof _s=="object"&&typeof Yr<"u"?e(_s):typeof define=="function"&&define.amd?define(["exports"],e):(n=n||self,e(n.d3=n.d3||{}))})(_s,function(n){"use strict";var e=new Date,t=new Date;function s(g,S,te,ls){function ie(B){return g(B=arguments.length===0?new Date:new Date(+B)),B}return ie.floor=function(B){return g(B=new Date(+B)),B},ie.ceil=function(B){return g(B=new Date(B-1)),S(B,1),g(B),B},ie.round=function(B){var X=ie(B),xe=ie.ceil(B);return B-X<xe-B?X:xe},ie.offset=function(B,X){return S(B=new Date(+B),X==null?1:Math.floor(X)),B},ie.range=function(B,X,xe){var Nt=[],ps;if(B=ie.ceil(B),xe=xe==null?1:Math.floor(xe),!(B<X)||!(xe>0))return Nt;do Nt.push(ps=new Date(+B)),S(B,xe),g(B);while(ps<B&&B<X);return Nt},ie.filter=function(B){return s(function(X){if(X>=X)for(;g(X),!B(X);)X.setTime(X-1)},function(X,xe){if(X>=X)if(xe<0)for(;++xe<=0;)for(;S(X,-1),!B(X););else for(;--xe>=0;)for(;S(X,1),!B(X););})},te&&(ie.count=function(B,X){return e.setTime(+B),t.setTime(+X),g(e),g(t),Math.floor(te(e,t))},ie.every=function(B){return B=Math.floor(B),!isFinite(B)||!(B>0)?null:B>1?ie.filter(ls?function(X){return ls(X)%B===0}:function(X){return ie.count(0,X)%B===0}):ie}),ie}var r=s(function(){},function(g,S){g.setTime(+g+S)},function(g,S){return S-g});r.every=function(g){return g=Math.floor(g),!isFinite(g)||!(g>0)?null:g>1?s(function(S){S.setTime(Math.floor(S/g)*g)},function(S,te){S.setTime(+S+te*g)},function(S,te){return(te-S)/g}):r};var i=r.range,o=1e3,u=6e4,l=36e5,R=864e5,p=6048e5,F=s(function(g){g.setTime(g-g.getMilliseconds())},function(g,S){g.setTime(+g+S*o)},function(g,S){return(S-g)/o},function(g){return g.getUTCSeconds()}),y=F.range,M=s(function(g){g.setTime(g-g.getMilliseconds()-g.getSeconds()*o)},function(g,S){g.setTime(+g+S*u)},function(g,S){return(S-g)/u},function(g){return g.getMinutes()}),Q=M.range,V=s(function(g){g.setTime(g-g.getMilliseconds()-g.getSeconds()*o-g.getMinutes()*u)},function(g,S){g.setTime(+g+S*l)},function(g,S){return(S-g)/l},function(g){return g.getHours()}),N=V.range,q=s(function(g){g.setHours(0,0,0,0)},function(g,S){g.setDate(g.getDate()+S)},function(g,S){return(S-g-(S.getTimezoneOffset()-g.getTimezoneOffset())*u)/R},function(g){return g.getDate()-1}),k=q.range;function I(g){return s(function(S){S.setDate(S.getDate()-(S.getDay()+7-g)%7),S.setHours(0,0,0,0)},function(S,te){S.setDate(S.getDate()+te*7)},function(S,te){return(te-S-(te.getTimezoneOffset()-S.getTimezoneOffset())*u)/p})}var b=I(0),j=I(1),ue=I(2),D=I(3),P=I(4),w=I(5),v=I(6),z=b.range,se=j.range,O=ue.range,fe=D.range,Te=P.range,ve=w.range,rt=v.range,J=s(function(g){g.setDate(1),g.setHours(0,0,0,0)},function(g,S){g.setMonth(g.getMonth()+S)},function(g,S){return S.getMonth()-g.getMonth()+(S.getFullYear()-g.getFullYear())*12},function(g){return g.getMonth()}),we=J.range,Re=s(function(g){g.setMonth(0,1),g.setHours(0,0,0,0)},function(g,S){g.setFullYear(g.getFullYear()+S)},function(g,S){return S.getFullYear()-g.getFullYear()},function(g){return g.getFullYear()});Re.every=function(g){return!isFinite(g=Math.floor(g))||!(g>0)?null:s(function(S){S.setFullYear(Math.floor(S.getFullYear()/g)*g),S.setMonth(0,1),S.setHours(0,0,0,0)},function(S,te){S.setFullYear(S.getFullYear()+te*g)})};var ce=Re.range,Fe=s(function(g){g.setUTCSeconds(0,0)},function(g,S){g.setTime(+g+S*u)},function(g,S){return(S-g)/u},function(g){return g.getUTCMinutes()}),Ie=Fe.range,Me=s(function(g){g.setUTCMinutes(0,0,0)},function(g,S){g.setTime(+g+S*l)},function(g,S){return(S-g)/l},function(g){return g.getUTCHours()}),Ne=Me.range,Se=s(function(g){g.setUTCHours(0,0,0,0)},function(g,S){g.setUTCDate(g.getUTCDate()+S)},function(g,S){return(S-g)/R},function(g){return g.getUTCDate()-1}),Ve=Se.range;function c(g){return s(function(S){S.setUTCDate(S.getUTCDate()-(S.getUTCDay()+7-g)%7),S.setUTCHours(0,0,0,0)},function(S,te){S.setUTCDate(S.getUTCDate()+te*7)},function(S,te){return(te-S)/p})}var C=c(0),x=c(1),f=c(2),d=c(3),h=c(4),E=c(5),L=c(6),Y=C.range,le=x.range,ye=f.range,he=d.range,Z=h.range,pe=E.range,ne=L.range,He=s(function(g){g.setUTCDate(1),g.setUTCHours(0,0,0,0)},function(g,S){g.setUTCMonth(g.getUTCMonth()+S)},function(g,S){return S.getUTCMonth()-g.getUTCMonth()+(S.getUTCFullYear()-g.getUTCFullYear())*12},function(g){return g.getUTCMonth()}),bn=He.range,wt=s(function(g){g.setUTCMonth(0,1),g.setUTCHours(0,0,0,0)},function(g,S){g.setUTCFullYear(g.getUTCFullYear()+S)},function(g,S){return S.getUTCFullYear()-g.getUTCFullYear()},function(g){return g.getUTCFullYear()});wt.every=function(g){return!isFinite(g=Math.floor(g))||!(g>0)?null:s(function(S){S.setUTCFullYear(Math.floor(S.getUTCFullYear()/g)*g),S.setUTCMonth(0,1),S.setUTCHours(0,0,0,0)},function(S,te){S.setUTCFullYear(S.getUTCFullYear()+te*g)})};var Pn=wt.range;n.timeDay=q,n.timeDays=k,n.timeFriday=w,n.timeFridays=ve,n.timeHour=V,n.timeHours=N,n.timeInterval=s,n.timeMillisecond=r,n.timeMilliseconds=i,n.timeMinute=M,n.timeMinutes=Q,n.timeMonday=j,n.timeMondays=se,n.timeMonth=J,n.timeMonths=we,n.timeSaturday=v,n.timeSaturdays=rt,n.timeSecond=F,n.timeSeconds=y,n.timeSunday=b,n.timeSundays=z,n.timeThursday=P,n.timeThursdays=Te,n.timeTuesday=ue,n.timeTuesdays=O,n.timeWednesday=D,n.timeWednesdays=fe,n.timeWeek=b,n.timeWeeks=z,n.timeYear=Re,n.timeYears=ce,n.utcDay=Se,n.utcDays=Ve,n.utcFriday=E,n.utcFridays=pe,n.utcHour=Me,n.utcHours=Ne,n.utcMillisecond=r,n.utcMilliseconds=i,n.utcMinute=Fe,n.utcMinutes=Ie,n.utcMonday=x,n.utcMondays=le,n.utcMonth=He,n.utcMonths=bn,n.utcSaturday=L,n.utcSaturdays=ne,n.utcSecond=F,n.utcSeconds=y,n.utcSunday=C,n.utcSundays=Y,n.utcThursday=h,n.utcThursdays=Z,n.utcTuesday=f,n.utcTuesdays=ye,n.utcWednesday=d,n.utcWednesdays=he,n.utcWeek=C,n.utcWeeks=Y,n.utcYear=wt,n.utcYears=Pn,Object.defineProperty(n,"__esModule",{value:!0})})});var zr=Ds((Os,qr)=>{(function(n,e){typeof Os=="object"&&typeof qr<"u"?e(Os,Xr()):typeof define=="function"&&define.amd?define(["exports","d3-time"],e):(n=n||self,e(n.d3=n.d3||{},n.d3))})(Os,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,A){return{y:a,m,d:A,H:0,M:0,S:0,L:0}}function i(a){var m=a.dateTime,A=a.date,W=a.time,je=a.periods,it=a.days,gs=a.shortDays,ds=a.months,ms=a.shortMonths,Wi=y(je),Ui=M(je),Ei=y(it),Fi=M(it),bi=y(gs),Pi=M(gs),Ii=y(ds),Mi=M(ds),Ti=y(ms),wi=M(ms),ot={a:ji,A:_i,b:Oi,B:Yi,c:null,d:J,e:J,f:Ie,g:E,G:Y,H:we,I:Re,j:ce,L:Fe,m:Me,M:Ne,p:Xi,q:qi,Q:Cr,s:Rr,S:Se,u:Ve,U:c,V:x,w:f,W:d,x:null,X:null,y:h,Y:L,Z:le,"%":Dr},at={a:zi,A:Ji,b:Ki,B:Zi,c:null,d:ye,e:ye,f:He,g:xe,G:ps,H:he,I:Z,j:pe,L:ne,m:bn,M:wt,p:$i,q:eo,Q:Cr,s:Rr,S:Pn,u:g,U:S,V:ls,w:ie,W:B,x:null,X:null,y:X,Y:Nt,Z:Ri,"%":Dr},Ni={a:Qi,A:Li,b:Gi,B:ki,c:vi,d:P,e:P,f:fe,g:b,G:I,H:v,I:v,j:w,L:O,m:D,M:z,p:Bi,q:ue,Q:ve,s:rt,S:se,u:V,U:N,V:q,w:Q,W:k,x:Vi,X:Hi,y:b,Y:I,Z:j,"%":Te};ot.x=_e(A,ot),ot.X=_e(W,ot),ot.c=_e(m,ot),at.x=_e(A,at),at.X=_e(W,at),at.c=_e(m,at);function _e(T,H){return function(_){var U=[],Ae=-1,K=0,be=T.length,Pe,ut,Ar;for(_ instanceof Date||(_=new Date(+_));++Ae<be;)T.charCodeAt(Ae)===37&&(U.push(T.slice(K,Ae)),(ut=o[Pe=T.charAt(++Ae)])!=null?Pe=T.charAt(++Ae):ut=Pe==="e"?" ":"0",(Ar=H[Pe])&&(Pe=Ar(_,ut)),U.push(Pe),K=Ae+1);return U.push(T.slice(K,Ae)),U.join("")}}function xr(T,H){return function(_){var U=r(1900,void 0,1),Ae=fs(U,T,_+="",0),K,be;if(Ae!=_.length)return null;if("Q"in U)return new Date(U.Q);if("s"in U)return new Date(U.s*1e3+("L"in U?U.L:0));if(H&&!("Z"in U)&&(U.Z=0),"p"in U&&(U.H=U.H%12+U.p*12),U.m===void 0&&(U.m="q"in U?U.q:0),"V"in U){if(U.V<1||U.V>53)return null;"w"in U||(U.w=1),"Z"in U?(K=s(r(U.y,0,1)),be=K.getUTCDay(),K=be>4||be===0?e.utcMonday.ceil(K):e.utcMonday(K),K=e.utcDay.offset(K,(U.V-1)*7),U.y=K.getUTCFullYear(),U.m=K.getUTCMonth(),U.d=K.getUTCDate()+(U.w+6)%7):(K=t(r(U.y,0,1)),be=K.getDay(),K=be>4||be===0?e.timeMonday.ceil(K):e.timeMonday(K),K=e.timeDay.offset(K,(U.V-1)*7),U.y=K.getFullYear(),U.m=K.getMonth(),U.d=K.getDate()+(U.w+6)%7)}else("W"in U||"U"in U)&&("w"in U||(U.w="u"in U?U.u%7:"W"in U?1:0),be="Z"in U?s(r(U.y,0,1)).getUTCDay():t(r(U.y,0,1)).getDay(),U.m=0,U.d="W"in U?(U.w+6)%7+U.W*7-(be+5)%7:U.w+U.U*7-(be+6)%7);return"Z"in U?(U.H+=U.Z/100|0,U.M+=U.Z%100,s(U)):t(U)}}function fs(T,H,_,U){for(var Ae=0,K=H.length,be=_.length,Pe,ut;Ae<K;){if(U>=be)return-1;if(Pe=H.charCodeAt(Ae++),Pe===37){if(Pe=H.charAt(Ae++),ut=Ni[Pe in o?H.charAt(Ae++):Pe],!ut||(U=ut(T,_,U))<0)return-1}else if(Pe!=_.charCodeAt(U++))return-1}return U}function Bi(T,H,_){var U=Wi.exec(H.slice(_));return U?(T.p=Ui[U[0].toLowerCase()],_+U[0].length):-1}function Qi(T,H,_){var U=bi.exec(H.slice(_));return U?(T.w=Pi[U[0].toLowerCase()],_+U[0].length):-1}function Li(T,H,_){var U=Ei.exec(H.slice(_));return U?(T.w=Fi[U[0].toLowerCase()],_+U[0].length):-1}function Gi(T,H,_){var U=Ti.exec(H.slice(_));return U?(T.m=wi[U[0].toLowerCase()],_+U[0].length):-1}function ki(T,H,_){var U=Ii.exec(H.slice(_));return U?(T.m=Mi[U[0].toLowerCase()],_+U[0].length):-1}function vi(T,H,_){return fs(T,m,H,_)}function Vi(T,H,_){return fs(T,A,H,_)}function Hi(T,H,_){return fs(T,W,H,_)}function ji(T){return gs[T.getDay()]}function _i(T){return it[T.getDay()]}function Oi(T){return ms[T.getMonth()]}function Yi(T){return ds[T.getMonth()]}function Xi(T){return je[+(T.getHours()>=12)]}function qi(T){return 1+~~(T.getMonth()/3)}function zi(T){return gs[T.getUTCDay()]}function Ji(T){return it[T.getUTCDay()]}function Ki(T){return ms[T.getUTCMonth()]}function Zi(T){return ds[T.getUTCMonth()]}function $i(T){return je[+(T.getUTCHours()>=12)]}function eo(T){return 1+~~(T.getUTCMonth()/3)}return{format:function(T){var H=_e(T+="",ot);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=_e(T+="",at);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"},u=/^\s*\d+/,l=/^%/,R=/[\\^$*+?|[\]().{}]/g;function p(a,m,A){var W=a<0?"-":"",je=(W?-a:a)+"",it=je.length;return W+(it<A?new Array(A-it+1).join(m)+je:je)}function F(a){return a.replace(R,"\\$&")}function y(a){return new RegExp("^(?:"+a.map(F).join("|")+")","i")}function M(a){for(var m={},A=-1,W=a.length;++A<W;)m[a[A].toLowerCase()]=A;return m}function Q(a,m,A){var W=u.exec(m.slice(A,A+1));return W?(a.w=+W[0],A+W[0].length):-1}function V(a,m,A){var W=u.exec(m.slice(A,A+1));return W?(a.u=+W[0],A+W[0].length):-1}function N(a,m,A){var W=u.exec(m.slice(A,A+2));return W?(a.U=+W[0],A+W[0].length):-1}function q(a,m,A){var W=u.exec(m.slice(A,A+2));return W?(a.V=+W[0],A+W[0].length):-1}function k(a,m,A){var W=u.exec(m.slice(A,A+2));return W?(a.W=+W[0],A+W[0].length):-1}function I(a,m,A){var W=u.exec(m.slice(A,A+4));return W?(a.y=+W[0],A+W[0].length):-1}function b(a,m,A){var W=u.exec(m.slice(A,A+2));return W?(a.y=+W[0]+(+W[0]>68?1900:2e3),A+W[0].length):-1}function j(a,m,A){var W=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(m.slice(A,A+6));return W?(a.Z=W[1]?0:-(W[2]+(W[3]||"00")),A+W[0].length):-1}function ue(a,m,A){var W=u.exec(m.slice(A,A+1));return W?(a.q=W[0]*3-3,A+W[0].length):-1}function D(a,m,A){var W=u.exec(m.slice(A,A+2));return W?(a.m=W[0]-1,A+W[0].length):-1}function P(a,m,A){var W=u.exec(m.slice(A,A+2));return W?(a.d=+W[0],A+W[0].length):-1}function w(a,m,A){var W=u.exec(m.slice(A,A+3));return W?(a.m=0,a.d=+W[0],A+W[0].length):-1}function v(a,m,A){var W=u.exec(m.slice(A,A+2));return W?(a.H=+W[0],A+W[0].length):-1}function z(a,m,A){var W=u.exec(m.slice(A,A+2));return W?(a.M=+W[0],A+W[0].length):-1}function se(a,m,A){var W=u.exec(m.slice(A,A+2));return W?(a.S=+W[0],A+W[0].length):-1}function O(a,m,A){var W=u.exec(m.slice(A,A+3));return W?(a.L=+W[0],A+W[0].length):-1}function fe(a,m,A){var W=u.exec(m.slice(A,A+6));return W?(a.L=Math.floor(W[0]/1e3),A+W[0].length):-1}function Te(a,m,A){var W=l.exec(m.slice(A,A+1));return W?A+W[0].length:-1}function ve(a,m,A){var W=u.exec(m.slice(A));return W?(a.Q=+W[0],A+W[0].length):-1}function rt(a,m,A){var W=u.exec(m.slice(A));return W?(a.s=+W[0],A+W[0].length):-1}function J(a,m){return p(a.getDate(),m,2)}function we(a,m){return p(a.getHours(),m,2)}function Re(a,m){return p(a.getHours()%12||12,m,2)}function ce(a,m){return p(1+e.timeDay.count(e.timeYear(a),a),m,3)}function Fe(a,m){return p(a.getMilliseconds(),m,3)}function Ie(a,m){return Fe(a,m)+"000"}function Me(a,m){return p(a.getMonth()+1,m,2)}function Ne(a,m){return p(a.getMinutes(),m,2)}function Se(a,m){return p(a.getSeconds(),m,2)}function Ve(a){var m=a.getDay();return m===0?7:m}function c(a,m){return p(e.timeSunday.count(e.timeYear(a)-1,a),m,2)}function C(a){var m=a.getDay();return m>=4||m===0?e.timeThursday(a):e.timeThursday.ceil(a)}function x(a,m){return a=C(a),p(e.timeThursday.count(e.timeYear(a),a)+(e.timeYear(a).getDay()===4),m,2)}function f(a){return a.getDay()}function d(a,m){return p(e.timeMonday.count(e.timeYear(a)-1,a),m,2)}function h(a,m){return p(a.getFullYear()%100,m,2)}function E(a,m){return a=C(a),p(a.getFullYear()%100,m,2)}function L(a,m){return p(a.getFullYear()%1e4,m,4)}function Y(a,m){var A=a.getDay();return a=A>=4||A===0?e.timeThursday(a):e.timeThursday.ceil(a),p(a.getFullYear()%1e4,m,4)}function le(a){var m=a.getTimezoneOffset();return(m>0?"-":(m*=-1,"+"))+p(m/60|0,"0",2)+p(m%60,"0",2)}function ye(a,m){return p(a.getUTCDate(),m,2)}function he(a,m){return p(a.getUTCHours(),m,2)}function Z(a,m){return p(a.getUTCHours()%12||12,m,2)}function pe(a,m){return p(1+e.utcDay.count(e.utcYear(a),a),m,3)}function ne(a,m){return p(a.getUTCMilliseconds(),m,3)}function He(a,m){return ne(a,m)+"000"}function bn(a,m){return p(a.getUTCMonth()+1,m,2)}function wt(a,m){return p(a.getUTCMinutes(),m,2)}function Pn(a,m){return p(a.getUTCSeconds(),m,2)}function g(a){var m=a.getUTCDay();return m===0?7:m}function S(a,m){return p(e.utcSunday.count(e.utcYear(a)-1,a),m,2)}function te(a){var m=a.getUTCDay();return m>=4||m===0?e.utcThursday(a):e.utcThursday.ceil(a)}function ls(a,m){return a=te(a),p(e.utcThursday.count(e.utcYear(a),a)+(e.utcYear(a).getUTCDay()===4),m,2)}function ie(a){return a.getUTCDay()}function B(a,m){return p(e.utcMonday.count(e.utcYear(a)-1,a),m,2)}function X(a,m){return p(a.getUTCFullYear()%100,m,2)}function xe(a,m){return a=te(a),p(a.getUTCFullYear()%100,m,2)}function Nt(a,m){return p(a.getUTCFullYear()%1e4,m,4)}function ps(a,m){var A=a.getUTCDay();return a=A>=4||A===0?e.utcThursday(a):e.utcThursday.ceil(a),p(a.getUTCFullYear()%1e4,m,4)}function Ri(){return"+0000"}function Dr(){return"%"}function Cr(a){return+a}function Rr(a){return Math.floor(+a/1e3)}var Ct;Sr({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 Sr(a){return Ct=i(a),n.timeFormat=Ct.format,n.timeParse=Ct.parse,n.utcFormat=Ct.utcFormat,n.utcParse=Ct.utcParse,Ct}var yr="%Y-%m-%dT%H:%M:%S.%LZ";function Si(a){return a.toISOString()}var yi=Date.prototype.toISOString?Si:n.utcFormat(yr);function xi(a){var m=new Date(a);return isNaN(m)?null:m}var Ai=+new Date("2000-01-01T00:00:00.000Z")?xi:n.utcParse(yr);n.isoFormat=yi,n.isoParse=Ai,n.timeFormatDefaultLocale=Sr,n.timeFormatLocale=i,Object.defineProperty(n,"__esModule",{value:!0})})});var ga={};oo(ga,{AccessService:()=>Mn,AccountService:()=>Tn,Activity:()=>ir,Attr:()=>hn,Attribute:()=>Ke,BUILD_VERSION:()=>lo,BaseScope:()=>Ks,ClientTools:()=>It,CloudService:()=>wn,CodesignService:()=>Nn,Connection:()=>Ss,DFUArrayActions:()=>Wo,DFUChangeProtection:()=>Eo,DFUChangeRestriction:()=>Fo,DFUDefFileFormat:()=>Uo,DFUService:()=>St,DFUWorkunit:()=>gr,DFUWorkunitCache:()=>fn,DFUXRefService:()=>Qn,DaliService:()=>Bn,Definition:()=>Cn,ECLGraph:()=>vt,ECLScope:()=>Dt,ESPConnection:()=>ys,ESPExceptions:()=>Xe,EclService:()=>Lt,EclccErrors:()=>us,ElkService:()=>Gn,EnvchkErrors:()=>Wn,Errors:()=>as,Field:()=>Dn,File:()=>Sn,FileSpray:()=>Rt,FileSprayService:()=>qe,FileSprayStates:()=>Nr,Folder:()=>yn,GlobalResultCache:()=>Js,GraphCache:()=>Vt,Import:()=>is,LocalWorkunit:()=>En,LogType:()=>kr,LogaccessService:()=>kn,LogicalFile:()=>or,LogicalFileCache:()=>an,Machine:()=>es,MachineCache:()=>un,MachineService:()=>Ge,PKG_NAME:()=>uo,PKG_VERSION:()=>co,PackageProcessService:()=>vn,PropertyType:()=>si,Query:()=>lr,QueryGraph:()=>rs,RelatedProperty:()=>ni,Resource:()=>_t,ResourcesService:()=>Vn,Result:()=>Jt,ResultCache:()=>Kt,SMCService:()=>yt,SashaService:()=>jn,Scope:()=>At,ScopeEdge:()=>er,ScopeGraph:()=>Ht,ScopeSubgraph:()=>Zn,ScopeVertex:()=>$n,Service:()=>G,Source:()=>Rn,SourceFile:()=>Zt,Store:()=>pr,StoreCache:()=>mn,StoreService:()=>xt,TargetAudience:()=>vr,TargetCluster:()=>pt,TargetClusterCache:()=>ln,Timer:()=>$t,Topology:()=>ts,TopologyCache:()=>gn,TopologyService:()=>oe,ValueChangedMessage:()=>tt,Version:()=>Pt,WUStateID:()=>Hs,WUUpdate:()=>Je,Workspace:()=>xn,Workunit:()=>lt,WorkunitCache:()=>sn,WorkunitsService:()=>re,WorkunitsServiceEx:()=>kt,WsAccess:()=>In,WsCodesign:()=>Fs,WsDfu:()=>ct,WsLogaccess:()=>$,WsSMC:()=>_n,WsSasha:()=>Hn,WsTopology:()=>On,WsWorkunits:()=>ge,XGMMLEdge:()=>Kn,XGMMLGraph:()=>Ys,XGMMLSubgraph:()=>zn,XGMMLVertex:()=>Jn,XSDNode:()=>Ot,XSDSchema:()=>qt,XSDSimpleType:()=>Xt,XSDXMLNode:()=>Yt,attachWorkspace:()=>st,clearAllClientToolsCache:()=>pa,createConnection:()=>Bt,createGraph:()=>jt,createXGMMLGraph:()=>tr,defaultTargetCluster:()=>zo,deserializeResponse:()=>Fr,get:()=>Mr,hookSend:()=>ho,instanceOfIConnection:()=>mo,instanceOfIOptions:()=>po,isArray:()=>wr,isECLResult:()=>Yn,isExceptions:()=>Co,isWUInfoWorkunit:()=>Mo,isWUQueryECLWorkunit:()=>Io,jsonp:()=>br,locateAllClientTools:()=>hi,locateClientTools:()=>fr,parseXSD:()=>qs,parseXSD2:()=>To,post:()=>Ir,qualifiedIDBoundary:()=>la,send:()=>Tr,serializeRequest:()=>Oe,setTransportFactory:()=>Do,splitMetric:()=>ri,targetClusters:()=>qo,walkXmlJson:()=>Un});module.exports=ao(ga);var me=require("@hpcc-js/util"),Di=require("@xmldom/xmldom"),nt=We(require("node-fetch"),1),Ce=We(require("node:https"),1),cs=require("undici"),Ci=We(require("abort-controller"),1);var Ur=`
|
|
1
|
+
"use strict";var to=Object.create;var hs=Object.defineProperty;var so=Object.getOwnPropertyDescriptor;var no=Object.getOwnPropertyNames;var ro=Object.getPrototypeOf,io=Object.prototype.hasOwnProperty;var Ds=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),oo=(n,e)=>{for(var t in e)hs(n,t,{get:e[t],enumerable:!0})},Wr=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of no(e))!io.call(n,r)&&r!==t&&hs(n,r,{get:()=>e[r],enumerable:!(s=so(e,r))||s.enumerable});return n};var Ae=(n,e,t)=>(t=n!=null?to(ro(n)):{},Wr(e||!n||!n.__esModule?hs(t,"default",{value:n,enumerable:!0}):t,n)),ao=n=>Wr(hs({},"__esModule",{value:!0}),n);var Hr=Ds((ws,Vr)=>{(function(n,e){typeof ws=="object"&&typeof Vr<"u"?e(ws):typeof define=="function"&&define.amd?define(["exports"],e):e(n.d3=n.d3||{})})(ws,(function(n){"use strict";function e(c,C){return c<C?-1:c>C?1:c>=C?0:NaN}function t(c){return c.length===1&&(c=s(c)),{left:function(C,x,f,d){for(f==null&&(f=0),d==null&&(d=C.length);f<d;){var h=f+d>>>1;c(C[h],x)<0?f=h+1:d=h}return f},right:function(C,x,f,d){for(f==null&&(f=0),d==null&&(d=C.length);f<d;){var h=f+d>>>1;c(C[h],x)>0?d=h:f=h+1}return f}}}function s(c){return function(C,x){return e(c(C),x)}}var r=t(e),i=r.right,o=r.left;function u(c,C){C==null&&(C=l);for(var x=0,f=c.length-1,d=c[0],h=new Array(f<0?0:f);x<f;)h[x]=C(d,d=c[++x]);return h}function l(c,C){return[c,C]}function R(c,C,x){var f=c.length,d=C.length,h=new Array(f*d),E,L,Y,le;for(x==null&&(x=l),E=Y=0;E<f;++E)for(le=c[E],L=0;L<d;++L,++Y)h[Y]=x(le,C[L]);return h}function p(c,C){return C<c?-1:C>c?1:C>=c?0:NaN}function F(c){return c===null?NaN:+c}function y(c,C){var x=c.length,f=0,d=-1,h=0,E,L,Y=0;if(C==null)for(;++d<x;)isNaN(E=F(c[d]))||(L=E-h,h+=L/++f,Y+=L*(E-h));else for(;++d<x;)isNaN(E=F(C(c[d],d,c)))||(L=E-h,h+=L/++f,Y+=L*(E-h));if(f>1)return Y/(f-1)}function M(c,C){var x=y(c,C);return x&&Math.sqrt(x)}function Q(c,C){var x=c.length,f=-1,d,h,E;if(C==null){for(;++f<x;)if((d=c[f])!=null&&d>=d)for(h=E=d;++f<x;)(d=c[f])!=null&&(h>d&&(h=d),E<d&&(E=d))}else for(;++f<x;)if((d=C(c[f],f,c))!=null&&d>=d)for(h=E=d;++f<x;)(d=C(c[f],f,c))!=null&&(h>d&&(h=d),E<d&&(E=d));return[h,E]}var V=Array.prototype,N=V.slice,q=V.map;function k(c){return function(){return c}}function I(c){return c}function b(c,C,x){c=+c,C=+C,x=(d=arguments.length)<2?(C=c,c=0,1):d<3?1:+x;for(var f=-1,d=Math.max(0,Math.ceil((C-c)/x))|0,h=new Array(d);++f<d;)h[f]=c+f*x;return h}var j=Math.sqrt(50),ue=Math.sqrt(10),D=Math.sqrt(2);function P(c,C,x){var f,d=-1,h,E,L;if(C=+C,c=+c,x=+x,c===C&&x>0)return[c];if((f=C<c)&&(h=c,c=C,C=h),(L=w(c,C,x))===0||!isFinite(L))return[];if(L>0)for(c=Math.ceil(c/L),C=Math.floor(C/L),E=new Array(h=Math.ceil(C-c+1));++d<h;)E[d]=(c+d)*L;else for(c=Math.floor(c*L),C=Math.ceil(C*L),E=new Array(h=Math.ceil(c-C+1));++d<h;)E[d]=(c-d)/L;return f&&E.reverse(),E}function w(c,C,x){var f=(C-c)/Math.max(0,x),d=Math.floor(Math.log(f)/Math.LN10),h=f/Math.pow(10,d);return d>=0?(h>=j?10:h>=ue?5:h>=D?2:1)*Math.pow(10,d):-Math.pow(10,-d)/(h>=j?10:h>=ue?5:h>=D?2:1)}function v(c,C,x){var f=Math.abs(C-c)/Math.max(0,x),d=Math.pow(10,Math.floor(Math.log(f)/Math.LN10)),h=f/d;return h>=j?d*=10:h>=ue?d*=5:h>=D&&(d*=2),C<c?-d:d}function z(c){return Math.ceil(Math.log(c.length)/Math.LN2)+1}function se(){var c=I,C=Q,x=z;function f(d){var h,E=d.length,L,Y=new Array(E);for(h=0;h<E;++h)Y[h]=c(d[h],h,d);var le=C(Y),Se=le[0],fe=le[1],Z=x(Y,Se,fe);Array.isArray(Z)||(Z=v(Se,fe,Z),Z=b(Math.ceil(Se/Z)*Z,fe,Z));for(var pe=Z.length;Z[0]<=Se;)Z.shift(),--pe;for(;Z[pe-1]>fe;)Z.pop(),--pe;var ne=new Array(pe+1),je;for(h=0;h<=pe;++h)je=ne[h]=[],je.x0=h>0?Z[h-1]:Se,je.x1=h<pe?Z[h]:fe;for(h=0;h<E;++h)L=Y[h],Se<=L&&L<=fe&&ne[i(Z,L,0,pe)].push(d[h]);return ne}return f.value=function(d){return arguments.length?(c=typeof d=="function"?d:k(d),f):c},f.domain=function(d){return arguments.length?(C=typeof d=="function"?d:k([d[0],d[1]]),f):C},f.thresholds=function(d){return arguments.length?(x=typeof d=="function"?d:Array.isArray(d)?k(N.call(d)):k(d),f):x},f}function O(c,C,x){if(x==null&&(x=F),!!(f=c.length)){if((C=+C)<=0||f<2)return+x(c[0],0,c);if(C>=1)return+x(c[f-1],f-1,c);var f,d=(f-1)*C,h=Math.floor(d),E=+x(c[h],h,c),L=+x(c[h+1],h+1,c);return E+(L-E)*(d-h)}}function me(c,C,x){return c=q.call(c,F).sort(e),Math.ceil((x-C)/(2*(O(c,.75)-O(c,.25))*Math.pow(c.length,-1/3)))}function Te(c,C,x){return Math.ceil((x-C)/(3.5*M(c)*Math.pow(c.length,-1/3)))}function Ve(c,C){var x=c.length,f=-1,d,h;if(C==null){for(;++f<x;)if((d=c[f])!=null&&d>=d)for(h=d;++f<x;)(d=c[f])!=null&&d>h&&(h=d)}else for(;++f<x;)if((d=C(c[f],f,c))!=null&&d>=d)for(h=d;++f<x;)(d=C(c[f],f,c))!=null&&d>h&&(h=d);return h}function rt(c,C){var x=c.length,f=x,d=-1,h,E=0;if(C==null)for(;++d<x;)isNaN(h=F(c[d]))?--f:E+=h;else for(;++d<x;)isNaN(h=F(C(c[d],d,c)))?--f:E+=h;if(f)return E/f}function J(c,C){var x=c.length,f=-1,d,h=[];if(C==null)for(;++f<x;)isNaN(d=F(c[f]))||h.push(d);else for(;++f<x;)isNaN(d=F(C(c[f],f,c)))||h.push(d);return O(h.sort(e),.5)}function we(c){for(var C=c.length,x,f=-1,d=0,h,E;++f<C;)d+=c[f].length;for(h=new Array(d);--C>=0;)for(E=c[C],x=E.length;--x>=0;)h[--d]=E[x];return h}function Ce(c,C){var x=c.length,f=-1,d,h;if(C==null){for(;++f<x;)if((d=c[f])!=null&&d>=d)for(h=d;++f<x;)(d=c[f])!=null&&h>d&&(h=d)}else for(;++f<x;)if((d=C(c[f],f,c))!=null&&d>=d)for(h=d;++f<x;)(d=C(c[f],f,c))!=null&&h>d&&(h=d);return h}function ce(c,C){for(var x=C.length,f=new Array(x);x--;)f[x]=c[C[x]];return f}function Fe(c,C){if(x=c.length){var x,f=0,d=0,h,E=c[d];for(C==null&&(C=e);++f<x;)(C(h=c[f],E)<0||C(E,E)!==0)&&(E=h,d=f);if(C(E,E)===0)return d}}function Ie(c,C,x){for(var f=(x??c.length)-(C=C==null?0:+C),d,h;f;)h=Math.random()*f--|0,d=c[f+C],c[f+C]=c[h+C],c[h+C]=d;return c}function Me(c,C){var x=c.length,f=-1,d,h=0;if(C==null)for(;++f<x;)(d=+c[f])&&(h+=d);else for(;++f<x;)(d=+C(c[f],f,c))&&(h+=d);return h}function Ne(c){if(!(h=c.length))return[];for(var C=-1,x=Ce(c,Re),f=new Array(x);++C<x;)for(var d=-1,h,E=f[C]=new Array(h);++d<h;)E[d]=c[d][C];return f}function Re(c){return c.length}function He(){return Ne(arguments)}n.bisect=i,n.bisectRight=i,n.bisectLeft=o,n.ascending=e,n.bisector=t,n.cross=R,n.descending=p,n.deviation=M,n.extent=Q,n.histogram=se,n.thresholdFreedmanDiaconis=me,n.thresholdScott=Te,n.thresholdSturges=z,n.max=Ve,n.mean=rt,n.median=J,n.merge=we,n.min=Ce,n.pairs=u,n.permute=ce,n.quantile=O,n.range=b,n.scan=Fe,n.shuffle=Ie,n.sum=Me,n.ticks=P,n.tickIncrement=w,n.tickStep=v,n.transpose=Ne,n.variance=y,n.zip=He,Object.defineProperty(n,"__esModule",{value:!0})}))});var Yn=Ds((js,Or)=>{(function(n,e){typeof js=="object"&&typeof Or<"u"?e(js):typeof define=="function"&&define.amd?define(["exports"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.d3=n.d3||{}))})(js,(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,P){if((w=(D=P?D.toExponential(P-1):D.toExponential()).indexOf("e"))<0)return null;var w,v=D.slice(0,w);return[v.length>1?v[0]+v.slice(2):v,+D.slice(w+1)]}function s(D){return D=t(Math.abs(D)),D?D[1]:NaN}function r(D,P){return function(w,v){for(var z=w.length,se=[],O=0,me=D[0],Te=0;z>0&&me>0&&(Te+me+1>v&&(me=Math.max(1,v-Te)),se.push(w.substring(z-=me,z+me)),!((Te+=me+1)>v));)me=D[O=(O+1)%D.length];return se.reverse().join(P)}}function i(D){return function(P){return P.replace(/[0-9]/g,function(w){return D[+w]})}}var o=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function u(D){if(!(P=o.exec(D)))throw new Error("invalid format: "+D);var P;return new l({fill:P[1],align:P[2],sign:P[3],symbol:P[4],zero:P[5],width:P[6],comma:P[7],precision:P[8]&&P[8].slice(1),trim:P[9],type:P[10]})}u.prototype=l.prototype;function l(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+""}l.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 R(D){e:for(var P=D.length,w=1,v=-1,z;w<P;++w)switch(D[w]){case".":v=z=w;break;case"0":v===0&&(v=w),z=w;break;default:if(!+D[w])break e;v>0&&(v=0);break}return v>0?D.slice(0,v)+D.slice(z+1):D}var p;function F(D,P){var w=t(D,P);if(!w)return D+"";var v=w[0],z=w[1],se=z-(p=Math.max(-8,Math.min(8,Math.floor(z/3)))*3)+1,O=v.length;return se===O?v:se>O?v+new Array(se-O+1).join("0"):se>0?v.slice(0,se)+"."+v.slice(se):"0."+new Array(1-se).join("0")+t(D,Math.max(0,P+se-1))[0]}function y(D,P){var w=t(D,P);if(!w)return D+"";var v=w[0],z=w[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,P){return(D*100).toFixed(P)},b:function(D){return Math.round(D).toString(2)},c:function(D){return D+""},d:e,e:function(D,P){return D.toExponential(P)},f:function(D,P){return D.toFixed(P)},g:function(D,P){return D.toPrecision(P)},o:function(D){return Math.round(D).toString(8)},p:function(D,P){return y(D*100,P)},r:y,s:F,X:function(D){return Math.round(D).toString(16).toUpperCase()},x:function(D){return Math.round(D).toString(16)}};function Q(D){return D}var V=Array.prototype.map,N=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function q(D){var P=D.grouping===void 0||D.thousands===void 0?Q:r(V.call(D.grouping,Number),D.thousands+""),w=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?Q:i(V.call(D.numerals,String)),O=D.percent===void 0?"%":D.percent+"",me=D.minus===void 0?"-":D.minus+"",Te=D.nan===void 0?"NaN":D.nan+"";function Ve(J){J=u(J);var we=J.fill,Ce=J.align,ce=J.sign,Fe=J.symbol,Ie=J.zero,Me=J.width,Ne=J.comma,Re=J.precision,He=J.trim,c=J.type;c==="n"?(Ne=!0,c="g"):M[c]||(Re===void 0&&(Re=12),He=!0,c="g"),(Ie||we==="0"&&Ce==="=")&&(Ie=!0,we="0",Ce="=");var C=Fe==="$"?w:Fe==="#"&&/[boxX]/.test(c)?"0"+c.toLowerCase():"",x=Fe==="$"?v:/[%p]/.test(c)?O:"",f=M[c],d=/[defgprs%]/.test(c);Re=Re===void 0?6:/[gprs]/.test(c)?Math.max(1,Math.min(21,Re)):Math.max(0,Math.min(20,Re));function h(E){var L=C,Y=x,le,Se,fe;if(c==="c")Y=f(E)+Y,E="";else{E=+E;var Z=E<0||1/E<0;if(E=isNaN(E)?Te:f(Math.abs(E),Re),He&&(E=R(E)),Z&&+E==0&&ce!=="+"&&(Z=!1),L=(Z?ce==="("?ce:me:ce==="-"||ce==="("?"":ce)+L,Y=(c==="s"?N[8+p/3]:"")+Y+(Z&&ce==="("?")":""),d){for(le=-1,Se=E.length;++le<Se;)if(fe=E.charCodeAt(le),48>fe||fe>57){Y=(fe===46?z+E.slice(le+1):E.slice(le))+Y,E=E.slice(0,le);break}}}Ne&&!Ie&&(E=P(E,1/0));var pe=L.length+E.length+Y.length,ne=pe<Me?new Array(Me-pe+1).join(we):"";switch(Ne&&Ie&&(E=P(ne+E,ne.length?Me-Y.length:1/0),ne=""),Ce){case"<":E=L+E+Y+ne;break;case"=":E=L+ne+E+Y;break;case"^":E=ne.slice(0,pe=ne.length>>1)+L+E+Y+ne.slice(pe);break;default:E=ne+L+E+Y;break}return se(E)}return h.toString=function(){return J+""},h}function rt(J,we){var Ce=Ve((J=u(J),J.type="f",J)),ce=Math.max(-8,Math.min(8,Math.floor(s(we)/3)))*3,Fe=Math.pow(10,-ce),Ie=N[8+ce/3];return function(Me){return Ce(Fe*Me)+Ie}}return{format:Ve,formatPrefix:rt}}var k;I({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function I(D){return k=q(D),n.format=k.format,n.formatPrefix=k.formatPrefix,k}function b(D){return Math.max(0,-s(Math.abs(D)))}function j(D,P){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(s(P)/3)))*3-s(Math.abs(D)))}function ue(D,P){return D=Math.abs(D),P=Math.abs(P)-D,Math.max(0,s(P)-s(D))+1}n.FormatSpecifier=l,n.formatDefaultLocale=I,n.formatLocale=q,n.formatSpecifier=u,n.precisionFixed=b,n.precisionPrefix=j,n.precisionRound=ue,Object.defineProperty(n,"__esModule",{value:!0})}))});var Xr=Ds((_s,Yr)=>{(function(n,e){typeof _s=="object"&&typeof Yr<"u"?e(_s):typeof define=="function"&&define.amd?define(["exports"],e):(n=n||self,e(n.d3=n.d3||{}))})(_s,function(n){"use strict";var e=new Date,t=new Date;function s(g,S,te,ls){function ie(B){return g(B=arguments.length===0?new Date:new Date(+B)),B}return ie.floor=function(B){return g(B=new Date(+B)),B},ie.ceil=function(B){return g(B=new Date(B-1)),S(B,1),g(B),B},ie.round=function(B){var X=ie(B),ye=ie.ceil(B);return B-X<ye-B?X:ye},ie.offset=function(B,X){return S(B=new Date(+B),X==null?1:Math.floor(X)),B},ie.range=function(B,X,ye){var Nt=[],ps;if(B=ie.ceil(B),ye=ye==null?1:Math.floor(ye),!(B<X)||!(ye>0))return Nt;do Nt.push(ps=new Date(+B)),S(B,ye),g(B);while(ps<B&&B<X);return Nt},ie.filter=function(B){return s(function(X){if(X>=X)for(;g(X),!B(X);)X.setTime(X-1)},function(X,ye){if(X>=X)if(ye<0)for(;++ye<=0;)for(;S(X,-1),!B(X););else for(;--ye>=0;)for(;S(X,1),!B(X););})},te&&(ie.count=function(B,X){return e.setTime(+B),t.setTime(+X),g(e),g(t),Math.floor(te(e,t))},ie.every=function(B){return B=Math.floor(B),!isFinite(B)||!(B>0)?null:B>1?ie.filter(ls?function(X){return ls(X)%B===0}:function(X){return ie.count(0,X)%B===0}):ie}),ie}var r=s(function(){},function(g,S){g.setTime(+g+S)},function(g,S){return S-g});r.every=function(g){return g=Math.floor(g),!isFinite(g)||!(g>0)?null:g>1?s(function(S){S.setTime(Math.floor(S/g)*g)},function(S,te){S.setTime(+S+te*g)},function(S,te){return(te-S)/g}):r};var i=r.range,o=1e3,u=6e4,l=36e5,R=864e5,p=6048e5,F=s(function(g){g.setTime(g-g.getMilliseconds())},function(g,S){g.setTime(+g+S*o)},function(g,S){return(S-g)/o},function(g){return g.getUTCSeconds()}),y=F.range,M=s(function(g){g.setTime(g-g.getMilliseconds()-g.getSeconds()*o)},function(g,S){g.setTime(+g+S*u)},function(g,S){return(S-g)/u},function(g){return g.getMinutes()}),Q=M.range,V=s(function(g){g.setTime(g-g.getMilliseconds()-g.getSeconds()*o-g.getMinutes()*u)},function(g,S){g.setTime(+g+S*l)},function(g,S){return(S-g)/l},function(g){return g.getHours()}),N=V.range,q=s(function(g){g.setHours(0,0,0,0)},function(g,S){g.setDate(g.getDate()+S)},function(g,S){return(S-g-(S.getTimezoneOffset()-g.getTimezoneOffset())*u)/R},function(g){return g.getDate()-1}),k=q.range;function I(g){return s(function(S){S.setDate(S.getDate()-(S.getDay()+7-g)%7),S.setHours(0,0,0,0)},function(S,te){S.setDate(S.getDate()+te*7)},function(S,te){return(te-S-(te.getTimezoneOffset()-S.getTimezoneOffset())*u)/p})}var b=I(0),j=I(1),ue=I(2),D=I(3),P=I(4),w=I(5),v=I(6),z=b.range,se=j.range,O=ue.range,me=D.range,Te=P.range,Ve=w.range,rt=v.range,J=s(function(g){g.setDate(1),g.setHours(0,0,0,0)},function(g,S){g.setMonth(g.getMonth()+S)},function(g,S){return S.getMonth()-g.getMonth()+(S.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,S){g.setFullYear(g.getFullYear()+S)},function(g,S){return S.getFullYear()-g.getFullYear()},function(g){return g.getFullYear()});Ce.every=function(g){return!isFinite(g=Math.floor(g))||!(g>0)?null:s(function(S){S.setFullYear(Math.floor(S.getFullYear()/g)*g),S.setMonth(0,1),S.setHours(0,0,0,0)},function(S,te){S.setFullYear(S.getFullYear()+te*g)})};var ce=Ce.range,Fe=s(function(g){g.setUTCSeconds(0,0)},function(g,S){g.setTime(+g+S*u)},function(g,S){return(S-g)/u},function(g){return g.getUTCMinutes()}),Ie=Fe.range,Me=s(function(g){g.setUTCMinutes(0,0,0)},function(g,S){g.setTime(+g+S*l)},function(g,S){return(S-g)/l},function(g){return g.getUTCHours()}),Ne=Me.range,Re=s(function(g){g.setUTCHours(0,0,0,0)},function(g,S){g.setUTCDate(g.getUTCDate()+S)},function(g,S){return(S-g)/R},function(g){return g.getUTCDate()-1}),He=Re.range;function c(g){return s(function(S){S.setUTCDate(S.getUTCDate()-(S.getUTCDay()+7-g)%7),S.setUTCHours(0,0,0,0)},function(S,te){S.setUTCDate(S.getUTCDate()+te*7)},function(S,te){return(te-S)/p})}var C=c(0),x=c(1),f=c(2),d=c(3),h=c(4),E=c(5),L=c(6),Y=C.range,le=x.range,Se=f.range,fe=d.range,Z=h.range,pe=E.range,ne=L.range,je=s(function(g){g.setUTCDate(1),g.setUTCHours(0,0,0,0)},function(g,S){g.setUTCMonth(g.getUTCMonth()+S)},function(g,S){return S.getUTCMonth()-g.getUTCMonth()+(S.getUTCFullYear()-g.getUTCFullYear())*12},function(g){return g.getUTCMonth()}),Fn=je.range,wt=s(function(g){g.setUTCMonth(0,1),g.setUTCHours(0,0,0,0)},function(g,S){g.setUTCFullYear(g.getUTCFullYear()+S)},function(g,S){return S.getUTCFullYear()-g.getUTCFullYear()},function(g){return g.getUTCFullYear()});wt.every=function(g){return!isFinite(g=Math.floor(g))||!(g>0)?null:s(function(S){S.setUTCFullYear(Math.floor(S.getUTCFullYear()/g)*g),S.setUTCMonth(0,1),S.setUTCHours(0,0,0,0)},function(S,te){S.setUTCFullYear(S.getUTCFullYear()+te*g)})};var bn=wt.range;n.timeDay=q,n.timeDays=k,n.timeFriday=w,n.timeFridays=Ve,n.timeHour=V,n.timeHours=N,n.timeInterval=s,n.timeMillisecond=r,n.timeMilliseconds=i,n.timeMinute=M,n.timeMinutes=Q,n.timeMonday=j,n.timeMondays=se,n.timeMonth=J,n.timeMonths=we,n.timeSaturday=v,n.timeSaturdays=rt,n.timeSecond=F,n.timeSeconds=y,n.timeSunday=b,n.timeSundays=z,n.timeThursday=P,n.timeThursdays=Te,n.timeTuesday=ue,n.timeTuesdays=O,n.timeWednesday=D,n.timeWednesdays=me,n.timeWeek=b,n.timeWeeks=z,n.timeYear=Ce,n.timeYears=ce,n.utcDay=Re,n.utcDays=He,n.utcFriday=E,n.utcFridays=pe,n.utcHour=Me,n.utcHours=Ne,n.utcMillisecond=r,n.utcMilliseconds=i,n.utcMinute=Fe,n.utcMinutes=Ie,n.utcMonday=x,n.utcMondays=le,n.utcMonth=je,n.utcMonths=Fn,n.utcSaturday=L,n.utcSaturdays=ne,n.utcSecond=F,n.utcSeconds=y,n.utcSunday=C,n.utcSundays=Y,n.utcThursday=h,n.utcThursdays=Z,n.utcTuesday=f,n.utcTuesdays=Se,n.utcWednesday=d,n.utcWednesdays=fe,n.utcWeek=C,n.utcWeeks=Y,n.utcYear=wt,n.utcYears=bn,Object.defineProperty(n,"__esModule",{value:!0})})});var zr=Ds((Os,qr)=>{(function(n,e){typeof Os=="object"&&typeof qr<"u"?e(Os,Xr()):typeof define=="function"&&define.amd?define(["exports","d3-time"],e):(n=n||self,e(n.d3=n.d3||{},n.d3))})(Os,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,A){return{y:a,m,d:A,H:0,M:0,S:0,L:0}}function i(a){var m=a.dateTime,A=a.date,W=a.time,_e=a.periods,it=a.days,gs=a.shortDays,ds=a.months,ms=a.shortMonths,Wi=y(_e),Ui=M(_e),Ei=y(it),Fi=M(it),bi=y(gs),Pi=M(gs),Ii=y(ds),Mi=M(ds),Ti=y(ms),wi=M(ms),ot={a:ji,A:_i,b:Oi,B:Yi,c:null,d:J,e:J,f:Ie,g:E,G:Y,H:we,I:Ce,j:ce,L:Fe,m:Me,M:Ne,p:Xi,q:qi,Q:Cr,s:Rr,S:Re,u:He,U:c,V:x,w:f,W:d,x:null,X:null,y:h,Y:L,Z:le,"%":Dr},at={a:zi,A:Ji,b:Ki,B:Zi,c:null,d:Se,e:Se,f:je,g:ye,G:ps,H:fe,I:Z,j:pe,L:ne,m:Fn,M:wt,p:$i,q:eo,Q:Cr,s:Rr,S:bn,u:g,U:S,V:ls,w:ie,W:B,x:null,X:null,y:X,Y:Nt,Z:Ri,"%":Dr},Ni={a:Qi,A:Li,b:Gi,B:ki,c:vi,d:P,e:P,f:me,g:b,G:I,H:v,I:v,j:w,L:O,m:D,M:z,p:Bi,q:ue,Q:Ve,s:rt,S:se,u:V,U:N,V:q,w:Q,W:k,x:Vi,X:Hi,y:b,Y:I,Z:j,"%":Te};ot.x=Oe(A,ot),ot.X=Oe(W,ot),ot.c=Oe(m,ot),at.x=Oe(A,at),at.X=Oe(W,at),at.c=Oe(m,at);function Oe(T,H){return function(_){var U=[],xe=-1,K=0,be=T.length,Pe,ut,Ar;for(_ instanceof Date||(_=new Date(+_));++xe<be;)T.charCodeAt(xe)===37&&(U.push(T.slice(K,xe)),(ut=o[Pe=T.charAt(++xe)])!=null?Pe=T.charAt(++xe):ut=Pe==="e"?" ":"0",(Ar=H[Pe])&&(Pe=Ar(_,ut)),U.push(Pe),K=xe+1);return U.push(T.slice(K,xe)),U.join("")}}function xr(T,H){return function(_){var U=r(1900,void 0,1),xe=fs(U,T,_+="",0),K,be;if(xe!=_.length)return null;if("Q"in U)return new Date(U.Q);if("s"in U)return new Date(U.s*1e3+("L"in U?U.L:0));if(H&&!("Z"in U)&&(U.Z=0),"p"in U&&(U.H=U.H%12+U.p*12),U.m===void 0&&(U.m="q"in U?U.q:0),"V"in U){if(U.V<1||U.V>53)return null;"w"in U||(U.w=1),"Z"in U?(K=s(r(U.y,0,1)),be=K.getUTCDay(),K=be>4||be===0?e.utcMonday.ceil(K):e.utcMonday(K),K=e.utcDay.offset(K,(U.V-1)*7),U.y=K.getUTCFullYear(),U.m=K.getUTCMonth(),U.d=K.getUTCDate()+(U.w+6)%7):(K=t(r(U.y,0,1)),be=K.getDay(),K=be>4||be===0?e.timeMonday.ceil(K):e.timeMonday(K),K=e.timeDay.offset(K,(U.V-1)*7),U.y=K.getFullYear(),U.m=K.getMonth(),U.d=K.getDate()+(U.w+6)%7)}else("W"in U||"U"in U)&&("w"in U||(U.w="u"in U?U.u%7:"W"in U?1:0),be="Z"in U?s(r(U.y,0,1)).getUTCDay():t(r(U.y,0,1)).getDay(),U.m=0,U.d="W"in U?(U.w+6)%7+U.W*7-(be+5)%7:U.w+U.U*7-(be+6)%7);return"Z"in U?(U.H+=U.Z/100|0,U.M+=U.Z%100,s(U)):t(U)}}function fs(T,H,_,U){for(var xe=0,K=H.length,be=_.length,Pe,ut;xe<K;){if(U>=be)return-1;if(Pe=H.charCodeAt(xe++),Pe===37){if(Pe=H.charAt(xe++),ut=Ni[Pe in o?H.charAt(xe++):Pe],!ut||(U=ut(T,_,U))<0)return-1}else if(Pe!=_.charCodeAt(U++))return-1}return U}function Bi(T,H,_){var U=Wi.exec(H.slice(_));return U?(T.p=Ui[U[0].toLowerCase()],_+U[0].length):-1}function Qi(T,H,_){var U=bi.exec(H.slice(_));return U?(T.w=Pi[U[0].toLowerCase()],_+U[0].length):-1}function Li(T,H,_){var U=Ei.exec(H.slice(_));return U?(T.w=Fi[U[0].toLowerCase()],_+U[0].length):-1}function Gi(T,H,_){var U=Ti.exec(H.slice(_));return U?(T.m=wi[U[0].toLowerCase()],_+U[0].length):-1}function ki(T,H,_){var U=Ii.exec(H.slice(_));return U?(T.m=Mi[U[0].toLowerCase()],_+U[0].length):-1}function vi(T,H,_){return fs(T,m,H,_)}function Vi(T,H,_){return fs(T,A,H,_)}function Hi(T,H,_){return fs(T,W,H,_)}function ji(T){return gs[T.getDay()]}function _i(T){return it[T.getDay()]}function Oi(T){return ms[T.getMonth()]}function Yi(T){return ds[T.getMonth()]}function Xi(T){return _e[+(T.getHours()>=12)]}function qi(T){return 1+~~(T.getMonth()/3)}function zi(T){return gs[T.getUTCDay()]}function Ji(T){return it[T.getUTCDay()]}function Ki(T){return ms[T.getUTCMonth()]}function Zi(T){return ds[T.getUTCMonth()]}function $i(T){return _e[+(T.getUTCHours()>=12)]}function eo(T){return 1+~~(T.getUTCMonth()/3)}return{format:function(T){var H=Oe(T+="",ot);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+="",at);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"},u=/^\s*\d+/,l=/^%/,R=/[\\^$*+?|[\]().{}]/g;function p(a,m,A){var W=a<0?"-":"",_e=(W?-a:a)+"",it=_e.length;return W+(it<A?new Array(A-it+1).join(m)+_e:_e)}function F(a){return a.replace(R,"\\$&")}function y(a){return new RegExp("^(?:"+a.map(F).join("|")+")","i")}function M(a){for(var m={},A=-1,W=a.length;++A<W;)m[a[A].toLowerCase()]=A;return m}function Q(a,m,A){var W=u.exec(m.slice(A,A+1));return W?(a.w=+W[0],A+W[0].length):-1}function V(a,m,A){var W=u.exec(m.slice(A,A+1));return W?(a.u=+W[0],A+W[0].length):-1}function N(a,m,A){var W=u.exec(m.slice(A,A+2));return W?(a.U=+W[0],A+W[0].length):-1}function q(a,m,A){var W=u.exec(m.slice(A,A+2));return W?(a.V=+W[0],A+W[0].length):-1}function k(a,m,A){var W=u.exec(m.slice(A,A+2));return W?(a.W=+W[0],A+W[0].length):-1}function I(a,m,A){var W=u.exec(m.slice(A,A+4));return W?(a.y=+W[0],A+W[0].length):-1}function b(a,m,A){var W=u.exec(m.slice(A,A+2));return W?(a.y=+W[0]+(+W[0]>68?1900:2e3),A+W[0].length):-1}function j(a,m,A){var W=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(m.slice(A,A+6));return W?(a.Z=W[1]?0:-(W[2]+(W[3]||"00")),A+W[0].length):-1}function ue(a,m,A){var W=u.exec(m.slice(A,A+1));return W?(a.q=W[0]*3-3,A+W[0].length):-1}function D(a,m,A){var W=u.exec(m.slice(A,A+2));return W?(a.m=W[0]-1,A+W[0].length):-1}function P(a,m,A){var W=u.exec(m.slice(A,A+2));return W?(a.d=+W[0],A+W[0].length):-1}function w(a,m,A){var W=u.exec(m.slice(A,A+3));return W?(a.m=0,a.d=+W[0],A+W[0].length):-1}function v(a,m,A){var W=u.exec(m.slice(A,A+2));return W?(a.H=+W[0],A+W[0].length):-1}function z(a,m,A){var W=u.exec(m.slice(A,A+2));return W?(a.M=+W[0],A+W[0].length):-1}function se(a,m,A){var W=u.exec(m.slice(A,A+2));return W?(a.S=+W[0],A+W[0].length):-1}function O(a,m,A){var W=u.exec(m.slice(A,A+3));return W?(a.L=+W[0],A+W[0].length):-1}function me(a,m,A){var W=u.exec(m.slice(A,A+6));return W?(a.L=Math.floor(W[0]/1e3),A+W[0].length):-1}function Te(a,m,A){var W=l.exec(m.slice(A,A+1));return W?A+W[0].length:-1}function Ve(a,m,A){var W=u.exec(m.slice(A));return W?(a.Q=+W[0],A+W[0].length):-1}function rt(a,m,A){var W=u.exec(m.slice(A));return W?(a.s=+W[0],A+W[0].length):-1}function J(a,m){return p(a.getDate(),m,2)}function we(a,m){return p(a.getHours(),m,2)}function Ce(a,m){return p(a.getHours()%12||12,m,2)}function ce(a,m){return p(1+e.timeDay.count(e.timeYear(a),a),m,3)}function Fe(a,m){return p(a.getMilliseconds(),m,3)}function Ie(a,m){return Fe(a,m)+"000"}function Me(a,m){return p(a.getMonth()+1,m,2)}function Ne(a,m){return p(a.getMinutes(),m,2)}function Re(a,m){return p(a.getSeconds(),m,2)}function He(a){var m=a.getDay();return m===0?7:m}function c(a,m){return p(e.timeSunday.count(e.timeYear(a)-1,a),m,2)}function C(a){var m=a.getDay();return m>=4||m===0?e.timeThursday(a):e.timeThursday.ceil(a)}function x(a,m){return a=C(a),p(e.timeThursday.count(e.timeYear(a),a)+(e.timeYear(a).getDay()===4),m,2)}function f(a){return a.getDay()}function d(a,m){return p(e.timeMonday.count(e.timeYear(a)-1,a),m,2)}function h(a,m){return p(a.getFullYear()%100,m,2)}function E(a,m){return a=C(a),p(a.getFullYear()%100,m,2)}function L(a,m){return p(a.getFullYear()%1e4,m,4)}function Y(a,m){var A=a.getDay();return a=A>=4||A===0?e.timeThursday(a):e.timeThursday.ceil(a),p(a.getFullYear()%1e4,m,4)}function le(a){var m=a.getTimezoneOffset();return(m>0?"-":(m*=-1,"+"))+p(m/60|0,"0",2)+p(m%60,"0",2)}function Se(a,m){return p(a.getUTCDate(),m,2)}function fe(a,m){return p(a.getUTCHours(),m,2)}function Z(a,m){return p(a.getUTCHours()%12||12,m,2)}function pe(a,m){return p(1+e.utcDay.count(e.utcYear(a),a),m,3)}function ne(a,m){return p(a.getUTCMilliseconds(),m,3)}function je(a,m){return ne(a,m)+"000"}function Fn(a,m){return p(a.getUTCMonth()+1,m,2)}function wt(a,m){return p(a.getUTCMinutes(),m,2)}function bn(a,m){return p(a.getUTCSeconds(),m,2)}function g(a){var m=a.getUTCDay();return m===0?7:m}function S(a,m){return p(e.utcSunday.count(e.utcYear(a)-1,a),m,2)}function te(a){var m=a.getUTCDay();return m>=4||m===0?e.utcThursday(a):e.utcThursday.ceil(a)}function ls(a,m){return a=te(a),p(e.utcThursday.count(e.utcYear(a),a)+(e.utcYear(a).getUTCDay()===4),m,2)}function ie(a){return a.getUTCDay()}function B(a,m){return p(e.utcMonday.count(e.utcYear(a)-1,a),m,2)}function X(a,m){return p(a.getUTCFullYear()%100,m,2)}function ye(a,m){return a=te(a),p(a.getUTCFullYear()%100,m,2)}function Nt(a,m){return p(a.getUTCFullYear()%1e4,m,4)}function ps(a,m){var A=a.getUTCDay();return a=A>=4||A===0?e.utcThursday(a):e.utcThursday.ceil(a),p(a.getUTCFullYear()%1e4,m,4)}function Ri(){return"+0000"}function Dr(){return"%"}function Cr(a){return+a}function Rr(a){return Math.floor(+a/1e3)}var Ct;Sr({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 Sr(a){return Ct=i(a),n.timeFormat=Ct.format,n.timeParse=Ct.parse,n.utcFormat=Ct.utcFormat,n.utcParse=Ct.utcParse,Ct}var yr="%Y-%m-%dT%H:%M:%S.%LZ";function Si(a){return a.toISOString()}var yi=Date.prototype.toISOString?Si:n.utcFormat(yr);function xi(a){var m=new Date(a);return isNaN(m)?null:m}var Ai=+new Date("2000-01-01T00:00:00.000Z")?xi:n.utcParse(yr);n.isoFormat=yi,n.isoParse=Ai,n.timeFormatDefaultLocale=Sr,n.timeFormatLocale=i,Object.defineProperty(n,"__esModule",{value:!0})})});var ga={};oo(ga,{AccessService:()=>In,AccountService:()=>Mn,Activity:()=>rr,Attr:()=>hn,Attribute:()=>Ke,BUILD_VERSION:()=>lo,BaseScope:()=>Ks,ClientTools:()=>It,CloudService:()=>Tn,CodesignService:()=>wn,Connection:()=>Ss,DFUArrayActions:()=>Wo,DFUChangeProtection:()=>Eo,DFUChangeRestriction:()=>Fo,DFUDefFileFormat:()=>Uo,DFUService:()=>St,DFUWorkunit:()=>pr,DFUWorkunitCache:()=>fn,DFUXRefService:()=>Bn,DaliService:()=>Nn,Definition:()=>Cn,ECLGraph:()=>vt,ECLScope:()=>Dt,ESPConnection:()=>ys,ESPExceptions:()=>Xe,EclService:()=>Lt,EclccErrors:()=>us,ElkService:()=>Ln,EnvchkErrors:()=>Wn,Errors:()=>as,Field:()=>Dn,File:()=>Sn,FileSpray:()=>Rt,FileSprayService:()=>qe,FileSprayStates:()=>Nr,Folder:()=>yn,GlobalResultCache:()=>Js,GraphCache:()=>Vt,Import:()=>is,LocalWorkunit:()=>En,LogType:()=>kr,LogaccessService:()=>Gn,LogicalFile:()=>ir,LogicalFileCache:()=>an,Machine:()=>es,MachineCache:()=>un,MachineService:()=>ke,PKG_NAME:()=>uo,PKG_VERSION:()=>co,PackageProcessService:()=>kn,PropertyType:()=>si,Query:()=>cr,QueryGraph:()=>rs,RelatedProperty:()=>ni,Resource:()=>_t,ResourcesService:()=>vn,Result:()=>Jt,ResultCache:()=>Kt,SMCService:()=>yt,SashaService:()=>Hn,Scope:()=>At,ScopeEdge:()=>$n,ScopeGraph:()=>Ht,ScopeSubgraph:()=>Kn,ScopeVertex:()=>Zn,Service:()=>G,Source:()=>Rn,SourceFile:()=>Zt,Store:()=>lr,StoreCache:()=>mn,StoreService:()=>xt,TargetAudience:()=>vr,TargetCluster:()=>pt,TargetClusterCache:()=>ln,Timer:()=>$t,Topology:()=>ts,TopologyCache:()=>gn,TopologyService:()=>oe,ValueChangedMessage:()=>tt,Version:()=>Pt,WUStateID:()=>Hs,WUUpdate:()=>Je,Workspace:()=>xn,Workunit:()=>lt,WorkunitCache:()=>sn,WorkunitsService:()=>re,WorkunitsServiceEx:()=>kt,WsAccess:()=>Pn,WsCodesign:()=>Fs,WsDfu:()=>ct,WsLogaccess:()=>$,WsSMC:()=>jn,WsSasha:()=>Vn,WsTopology:()=>_n,WsWorkunits:()=>ge,XGMMLEdge:()=>Jn,XGMMLGraph:()=>Ys,XGMMLSubgraph:()=>qn,XGMMLVertex:()=>zn,XSDNode:()=>Ot,XSDSchema:()=>qt,XSDSimpleType:()=>Xt,XSDXMLNode:()=>Yt,attachWorkspace:()=>st,clearAllClientToolsCache:()=>pa,createConnection:()=>Bt,createGraph:()=>jt,createXGMMLGraph:()=>er,defaultTargetCluster:()=>zo,deserializeResponse:()=>Fr,get:()=>Mr,hookSend:()=>ho,instanceOfIConnection:()=>mo,instanceOfIOptions:()=>po,isArray:()=>wr,isECLResult:()=>On,isExceptions:()=>Co,isWUInfoWorkunit:()=>Mo,isWUQueryECLWorkunit:()=>Io,jsonp:()=>br,locateAllClientTools:()=>hi,locateClientTools:()=>mr,parseXSD:()=>qs,parseXSD2:()=>To,post:()=>Ir,qualifiedIDBoundary:()=>la,send:()=>Tr,serializeRequest:()=>Ye,setTransportFactory:()=>Do,splitMetric:()=>ri,targetClusters:()=>qo,walkXmlJson:()=>Un});module.exports=ao(ga);var Ee=require("@hpcc-js/util"),Di=require("@xmldom/xmldom"),nt=Ae(require("node-fetch"),1),De=Ae(require("node:https"),1),hr=require("node:buffer"),cs=require("undici"),Ci=Ae(require("abort-controller"),1);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 Fn=require("node:buffer");var uo="__PACKAGE_NAME__",co="__PACKAGE_VERSION__",lo="__BUILD_VERSION__";var Qt=require("@hpcc-js/util");var Ye=require("@hpcc-js/util"),Er=(0,Ye.scopedLogger)("comms/connection.ts");function po(n){return"baseUrl"in n}var go={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function mo(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 Oe(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,u)=>{typeof o=="object"?(i=!0,s.push(Oe(o,e,t+Be(`${r}.${u}`,e)))):s.push(t+Be(`${r}_i${u}`,e)+"="+Oe(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(Oe(n[r].Item,e,t+Be(r,e))),s.push(t+Be(`${r}.itemcount`,e)+"="+n[r].Item.length)):s.push(Oe(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 br(n,e,t={},s="json",r){return r&&console.warn("Header attributes ignored for JSONP connections"),new Promise((i,o)=>{let u=n.timeoutSecs*1e3,l=5e3,R="jsonp_callback_"+Math.round(Math.random()*999999);window[R]=function(Q){u=0,M(),i(s==="json"&&typeof Q=="string"?Fr(Q):Q)};let p=document.createElement("script"),F=(0,Ye.join)(n.baseUrl,e);F+=F.indexOf("?")>=0?"&":"?",p.src=F+"jsonp="+R+"&"+Oe(t,n.encodeRequest),document.body.appendChild(p);let y=setInterval(function(){u<=0?clearInterval(y):(u-=l,u<=0?(clearInterval(y),Er.error("Request timeout: "+p.src),M(),o(Error("Request timeout: "+p.src))):Er.debug("Request pending ("+u/1e3+" sec): "+p.src))},l);function M(){delete window[R],document.body.removeChild(p)}})}function fo(n){return n.userID?{Authorization:`Basic ${btoa(`${n.userID}:${n.password}`)}`}:{}}var Cs={};function Pr(n,e,t,s,r){s={...fo(n),...s},t={credentials:Cs[n.baseUrl]?"omit":"include",...t,headers:s},fetch.__setGlobalDispatcher&&fetch.__setGlobalDispatcher(fetch.__defaultAgent),n.baseUrl.indexOf("https:")===0&&(n.rejectUnauthorized===!1&&fetch.__rejectUnauthorizedAgent?fetch.__setGlobalDispatcher?fetch.__setGlobalDispatcher(fetch.__rejectUnauthorizedAgent):t.agent=fetch.__rejectUnauthorizedAgent:fetch.__trustwaveAgent&&(t.agent=fetch.__trustwaveAgent));function i(o){if(o.ok)return r==="json"?o.json():o.text();throw new Error(o.statusText)}return(0,Ye.promiseTimeout)(n.timeoutSecs*1e3,fetch((0,Ye.join)(n.baseUrl,e),t).then(i).catch(o=>(t.credentials=Cs[n.baseUrl]?"include":"omit",fetch((0,Ye.join)(n.baseUrl,e),t).then(i).then(u=>(Cs[n.baseUrl]=!Cs[n.baseUrl],u)))))}function Ir(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:Oe(t,n.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...r},s)}function Mr(n,e,t,s="json",r){let i;return t.abortSignal_&&(i=t.abortSignal_,delete t.abortSignal_),Pr(n,`${e}?${Oe(t,n.encodeRequest)}`,{method:"get",signal:i},{...r},s)}function Tr(n,e,t,s="json",r){let i;switch(n.type){case"jsonp":i=br(n,e,t,s,r);break;case"get":i=Mr(n,e,t,s,r);break;case"post":default:i=Ir(n,e,t,s,r);break}return i}var Rs=Tr;function ho(n){let e=Rs;return n&&(Rs=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={...go,...e},this)}send(e,t,s="json",r){return this._opts.hookSend?this._opts.hookSend(this._opts,e,t,s,Rs,r):Rs(this._opts,e,t,s,r)}clone(){return new n(this.opts())}},Bt=function(n){return new Ss(n)};function Do(n){let e=Bt;return Bt=n,e}function wr(n){return Object.prototype.toString.call(n)==="[object Array]"}var Xe=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 Xe||n.isESPExceptions&&Array.isArray(n.Exception)}function Ro(n){return n.send!==void 0}var ys=class n{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,t,s){this._connection=Ro(e)?e:Bt(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(wr(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 u={...t,ver_:this._version};r&&(u.upload_=!0),i&&(u.abortSignal_=i);let l,R="json";switch(s){case"text":l=(0,Qt.join)(this._service,e),R="text";break;case"xsd":l=(0,Qt.join)(this._service,e+".xsd"),R="text";break;case"json2":l=(0,Qt.join)(this._service,e+"/json"),s="json",e=e.split("/").pop();break;default:l=(0,Qt.join)(this._service,e+".json")}return this._connection.send(l,u,R).then(p=>{if(s==="json"){let F;if(p&&p.Exceptions)throw new Xe(e,u,p.Exceptions);if(p&&(F=p[o||e+"Response"]),!F)throw new Xe(e,u,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return F}return p})}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 ys(e,t,s)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};var Rt;(e=>{let n;(l=>(l.Delete="Delete",l.Protect="Protect",l.Unprotect="Unprotect",l.Restore="Restore",l.SetToFailed="SetToFailed",l.Archive="Archive"))(n=e.DFUWUActions||={})})(Rt||={});var xs=class extends G{constructor(e){super(e,"FileSpray","1.27")}AbortDFUWorkunit(e){return this._connection.send("AbortDFUWorkunit",e,"json",!1,void 0,"AbortDFUWorkunitResponse")}Copy(e){return this._connection.send("Copy",e,"json",!1,void 0,"CopyResponse")}CreateDFUPublisherWorkunit(e){return this._connection.send("CreateDFUPublisherWorkunit",e,"json",!1,void 0,"CreateDFUPublisherWorkunitResponse")}CreateDFUWorkunit(e){return this._connection.send("CreateDFUWorkunit",e,"json",!1,void 0,"CreateDFUWorkunitResponse")}DFUWUFile(e){return this._connection.send("DFUWUFile",e,"json",!1,void 0,"DFUWUFileResponse")}DFUWUSearch(e){return this._connection.send("DFUWUSearch",e,"json",!1,void 0,"DFUWUSearchResponse")}DFUWorkunitsAction(e){return this._connection.send("DFUWorkunitsAction",e,"json",!1,void 0,"DFUWorkunitsActionResponse")}DeleteDFUWorkunit(e){return this._connection.send("DeleteDFUWorkunit",e,"json",!1,void 0,"DeleteDFUWorkunitResponse")}DeleteDFUWorkunits(e){return this._connection.send("DeleteDFUWorkunits",e,"json",!1,void 0,"DeleteDFUWorkunitsResponse")}DeleteDropZoneFiles(e){return this._connection.send("DeleteDropZoneFiles",e,"json",!1,void 0,"DFUWorkunitsActionResponse")}Despray(e){return this._connection.send("Despray",e,"json",!1,void 0,"DesprayResponse")}DfuMonitor(e){return this._connection.send("DfuMonitor",e,"json",!1,void 0,"DfuMonitorResponse")}DropZoneFileSearch(e){return this._connection.send("DropZoneFileSearch",e,"json",!1,void 0,"DropZoneFileSearchResponse")}DropZoneFiles(e){return this._connection.send("DropZoneFiles",e,"json",!1,void 0,"DropZoneFilesResponse")}EchoDateTime(e){return this._connection.send("EchoDateTime",e,"json",!1,void 0,"EchoDateTimeResponse")}FileList(e){return this._connection.send("FileList",e,"json",!1,void 0,"FileListResponse")}GetDFUExceptions(e){return this._connection.send("GetDFUExceptions",e,"json",!1,void 0,"GetDFUExceptionsResponse")}GetDFUProgress(e){return this._connection.send("GetDFUProgress",e,"json",!1,void 0,"ProgressResponse")}GetDFUServerQueues(e){return this._connection.send("GetDFUServerQueues",e,"json",!1,void 0,"GetDFUServerQueuesResponse")}GetDFUWorkunit(e){return this._connection.send("GetDFUWorkunit",e,"json",!1,void 0,"GetDFUWorkunitResponse")}GetDFUWorkunits(e){return this._connection.send("GetDFUWorkunits",e,"json",!1,void 0,"GetDFUWorkunitsResponse")}GetRemoteTargets(e){return this._connection.send("GetRemoteTargets",e,"json",!1,void 0,"GetRemoteTargetsResponse")}GetSprayTargets(e){return this._connection.send("GetSprayTargets",e,"json",!1,void 0,"GetSprayTargetsResponse")}OpenSave(e){return this._connection.send("OpenSave",e,"json",!1,void 0,"OpenSaveResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"FileSprayPingResponse")}Rename(e){return this._connection.send("Rename",e,"json",!1,void 0,"RenameResponse")}Replicate(e){return this._connection.send("Replicate",e,"json",!1,void 0,"ReplicateResponse")}ShowResult(e){return this._connection.send("ShowResult",e,"json",!1,void 0,"ShowResultResponse")}SprayFixed(e){return this._connection.send("SprayFixed",e,"json",!1,void 0,"SprayFixedResponse")}SprayVariable(e){return this._connection.send("SprayVariable",e,"json",!1,void 0,"SprayResponse")}SubmitDFUWorkunit(e){return this._connection.send("SubmitDFUWorkunit",e,"json",!1,void 0,"SubmitDFUWorkunitResponse")}UpdateDFUWorkunit(e){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,void 0,"UpdateDFUWorkunitResponse")}};var Nr=(p=>(p[p.unknown=0]="unknown",p[p.scheduled=1]="scheduled",p[p.queued=2]="queued",p[p.started=3]="started",p[p.aborted=4]="aborted",p[p.failed=5]="failed",p[p.finished=6]="finished",p[p.monitoring=7]="monitoring",p[p.aborting=8]="aborting",p[p.notfound=999]="notfound",p))(Nr||{}),qe=class extends xs{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;(R=>(R.User="User",R.Group="Group"))(n=o.ViewMemberType||={});let e;(y=>(y.username="username",y.fullname="fullname",y.passwordexpiration="passwordexpiration",y.employeeID="employeeID",y.employeeNumber="employeeNumber"))(e=o.UserSortBy||={});let t;(R=>(R.Name="Name",R.ManagedBy="ManagedBy"))(t=o.GroupSortBy||={});let s;(p=>(p.Any="Any",p.User="User",p.Group="Group"))(s=o.AccountTypeReq||={});let r;(R=>(R.Name="Name",R.Type="Type"))(r=o.ResourcePermissionSortBy||={});let i;(l=>l.Name="Name")(i=o.ResourceSortBy||={})})(In||={});var As=class extends G{constructor(e){super(e,"ws_access","1.17")}AccountPermissions(e){return this._connection.send("AccountPermissions",e,"json",!1,void 0,"AccountPermissionsResponse")}AccountPermissionsV2(e){return this._connection.send("AccountPermissionsV2",e,"json",!1,void 0,"AccountPermissionsV2Response")}AddUser(e){return this._connection.send("AddUser",e,"json",!1,void 0,"AddUserResponse")}AddView(e){return this._connection.send("AddView",e,"json",!1,void 0,"AddViewResponse")}AddViewColumn(e){return this._connection.send("AddViewColumn",e,"json",!1,void 0,"AddViewColumnResponse")}AddViewMember(e){return this._connection.send("AddViewMember",e,"json",!1,void 0,"AddViewMemberResponse")}ClearPermissionsCache(e){return this._connection.send("ClearPermissionsCache",e,"json",!1,void 0,"ClearPermissionsCacheResponse")}DeleteView(e){return this._connection.send("DeleteView",e,"json",!1,void 0,"DeleteViewResponse")}DeleteViewColumn(e){return this._connection.send("DeleteViewColumn",e,"json",!1,void 0,"DeleteViewColumnResponse")}DeleteViewMember(e){return this._connection.send("DeleteViewMember",e,"json",!1,void 0,"DeleteViewMemberResponse")}DisableScopeScans(e){return this._connection.send("DisableScopeScans",e,"json",!1,void 0,"DisableScopeScansResponse")}EnableScopeScans(e){return this._connection.send("EnableScopeScans",e,"json",!1,void 0,"EnableScopeScansResponse")}FilePermission(e){return this._connection.send("FilePermission",e,"json",!1,void 0,"FilePermissionResponse")}GroupAction(e){return this._connection.send("GroupAction",e,"json",!1,void 0,"GroupActionResponse")}GroupAdd(e){return this._connection.send("GroupAdd",e,"json",!1,void 0,"GroupAddResponse")}GroupEdit(e){return this._connection.send("GroupEdit",e,"json",!1,void 0,"GroupEditResponse")}GroupMemberEdit(e){return this._connection.send("GroupMemberEdit",e,"json",!1,void 0,"GroupMemberEditResponse")}GroupMemberEditInput(e){return this._connection.send("GroupMemberEditInput",e,"json",!1,void 0,"GroupMemberEditInputResponse")}GroupMemberQuery(e){return this._connection.send("GroupMemberQuery",e,"json",!1,void 0,"GroupMemberQueryResponse")}GroupQuery(e){return this._connection.send("GroupQuery",e,"json",!1,void 0,"GroupQueryResponse")}Groups(e){return this._connection.send("Groups",e,"json",!1,void 0,"GroupResponse")}PermissionAction(e){return this._connection.send("PermissionAction",e,"json",!1,void 0,"PermissionActionResponse")}Permissions(e){return this._connection.send("Permissions",e,"json",!1,void 0,"BasednsResponse")}PermissionsReset(e){return this._connection.send("PermissionsReset",e,"json",!1,void 0,"PermissionsResetResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_accessPingResponse")}QueryScopeScansEnabled(e){return this._connection.send("QueryScopeScansEnabled",e,"json",!1,void 0,"QueryScopeScansEnabledResponse")}QueryUserViewColumns(e){return this._connection.send("QueryUserViewColumns",e,"json",!1,void 0,"QueryUserViewColumnsResponse")}QueryViewColumns(e){return this._connection.send("QueryViewColumns",e,"json",!1,void 0,"QueryViewColumnsResponse")}QueryViewMembers(e){return this._connection.send("QueryViewMembers",e,"json",!1,void 0,"QueryViewMembersResponse")}QueryViews(e){return this._connection.send("QueryViews",e,"json",!1,void 0,"QueryViewsResponse")}ResourceAdd(e){return this._connection.send("ResourceAdd",e,"json",!1,void 0,"ResourceAddResponse")}ResourceDelete(e){return this._connection.send("ResourceDelete",e,"json",!1,void 0,"ResourceDeleteResponse")}ResourcePermissionQuery(e){return this._connection.send("ResourcePermissionQuery",e,"json",!1,void 0,"ResourcePermissionQueryResponse")}ResourcePermissions(e){return this._connection.send("ResourcePermissions",e,"json",!1,void 0,"ResourcePermissionsResponse")}ResourceQuery(e){return this._connection.send("ResourceQuery",e,"json",!1,void 0,"ResourceQueryResponse")}Resources(e){return this._connection.send("Resources",e,"json",!1,void 0,"ResourcesResponse")}UserAccountExport(e){return this._connection.send("UserAccountExport",e,"json",!1,void 0,"UserAccountExportResponse")}UserAction(e){return this._connection.send("UserAction",e,"json",!1,void 0,"UserActionResponse")}UserEdit(e){return this._connection.send("UserEdit",e,"json",!1,void 0,"UserEditResponse")}UserGroupEdit(e){return this._connection.send("UserGroupEdit",e,"json",!1,void 0,"UserGroupEditResponse")}UserGroupEditInput(e){return this._connection.send("UserGroupEditInput",e,"json",!1,void 0,"UserGroupEditInputResponse")}UserInfoEdit(e){return this._connection.send("UserInfoEdit",e,"json",!1,void 0,"UserInfoEditResponse")}UserInfoEditInput(e){return this._connection.send("UserInfoEditInput",e,"json",!1,void 0,"UserInfoEditInputResponse")}UserPosix(e){return this._connection.send("UserPosix",e,"json",!1,void 0,"UserPosixResponse")}UserPosixInput(e){return this._connection.send("UserPosixInput",e,"json",!1,void 0,"UserPosixInputResponse")}UserQuery(e){return this._connection.send("UserQuery",e,"json",!1,void 0,"UserQueryResponse")}UserResetPass(e){return this._connection.send("UserResetPass",e,"json",!1,void 0,"UserResetPassResponse")}UserResetPassInput(e){return this._connection.send("UserResetPassInput",e,"json",!1,void 0,"UserResetPassInputResponse")}UserSudoers(e){return this._connection.send("UserSudoers",e,"json",!1,void 0,"UserSudoersResponse")}UserSudoersInput(e){return this._connection.send("UserSudoersInput",e,"json",!1,void 0,"UserSudoersInputResponse")}Users(e){return this._connection.send("Users",e,"json",!1,void 0,"UserResponse")}};var Mn=class extends As{};var Ws=class extends G{constructor(e){super(e,"ws_account","1.07")}MyAccount(e){return this._connection.send("MyAccount",e,"json",!1,void 0,"MyAccountResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_accountPingResponse")}UpdateUser(e){return this._connection.send("UpdateUser",e,"json",!1,void 0,"UpdateUserResponse")}UpdateUserInput(e){return this._connection.send("UpdateUserInput",e,"json",!1,void 0,"UpdateUserInputResponse")}VerifyUser(e){return this._connection.send("VerifyUser",e,"json",!1,void 0,"VerifyUserResponse")}};var Tn=class extends Ws{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 Br=require("@hpcc-js/util");var Us=class extends G{constructor(e){super(e,"WsCloud","1.02")}GetPODs(e){return this._connection.send("GetPODs",e,"json",!1,void 0,"GetPODsResponse")}GetServices(e){return this._connection.send("GetServices",e,"json",!1,void 0,"GetServicesResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsCloudPingResponse")}};var So=(0,Br.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 Ao(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 wn=class extends Us{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 Ao(t?.items??[])}catch(t){return So.error(`Error parsing V1Pods json '${t instanceof Error?t.message:String(t)}'`),[]}})}};var Fs;(e=>{let n;(s=>s.gpg="gpg")(n=e.SigningMethodType||={})})(Fs||={});var Es=class extends G{constructor(e){super(e,"ws_codesign","1.1")}ListUserIDs(e){return this._connection.send("ListUserIDs",e,"json",!1,void 0,"ListUserIDsResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_codesignPingResponse")}Sign(e){return this._connection.send("Sign",e,"json",!1,void 0,"SignResponse")}Verify(e){return this._connection.send("Verify",e,"json",!1,void 0,"VerifyResponse")}};var Nn=class extends Es{ListUserIDsEx(e){return super.ListUserIDs(e).then(t=>t.UserIDs.Item).catch(t=>[])}Sign(e){return super.Sign({SigningMethod:Fs.SigningMethodType.gpg,...e})}};var bs=class extends G{constructor(e){super(e,"WSDali","1.07")}Add(e){return this._connection.send("Add",e,"json",!1,void 0,"ResultResponse")}ClearTraceTransactions(e){return this._connection.send("ClearTraceTransactions",e,"json",!1,void 0,"ResultResponse")}Count(e){return this._connection.send("Count",e,"json",!1,void 0,"CountResponse")}DFSCheck(e){return this._connection.send("DFSCheck",e,"json",!1,void 0,"ResultResponse")}DFSExists(e){return this._connection.send("DFSExists",e,"json",!1,void 0,"BooleanResponse")}DFSLS(e){return this._connection.send("DFSLS",e,"json",!1,void 0,"ResultResponse")}Delete(e){return this._connection.send("Delete",e,"json",!1,void 0,"ResultResponse")}DisconnectClientConnection(e){return this._connection.send("DisconnectClientConnection",e,"json",!1,void 0,"ResultResponse")}GetClients(e){return this._connection.send("GetClients",e,"json",!1,void 0,"ResultResponse")}GetConnections(e){return this._connection.send("GetConnections",e,"json",!1,void 0,"ResultResponse")}GetDFSCSV(e){return this._connection.send("GetDFSCSV",e,"json",!1,void 0,"ResultResponse")}GetDFSMap(e){return this._connection.send("GetDFSMap",e,"json",!1,void 0,"ResultResponse")}GetDFSParents(e){return this._connection.send("GetDFSParents",e,"json",!1,void 0,"ResultResponse")}GetLogicalFile(e){return this._connection.send("GetLogicalFile",e,"json",!1,void 0,"ResultResponse")}GetLogicalFilePart(e){return this._connection.send("GetLogicalFilePart",e,"json",!1,void 0,"ResultResponse")}GetProtectedList(e){return this._connection.send("GetProtectedList",e,"json",!1,void 0,"ResultResponse")}GetSDSStats(e){return this._connection.send("GetSDSStats",e,"json",!1,void 0,"ResultResponse")}GetSDSSubscribers(e){return this._connection.send("GetSDSSubscribers",e,"json",!1,void 0,"ResultResponse")}GetValue(e){return this._connection.send("GetValue",e,"json",!1,void 0,"ResultResponse")}Import(e){return this._connection.send("Import",e,"json",!1,void 0,"ResultResponse")}ListSDSLocks(e){return this._connection.send("ListSDSLocks",e,"json",!1,void 0,"ResultResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WSDaliPingResponse")}SaveSDSStore(e){return this._connection.send("SaveSDSStore",e,"json",!1,void 0,"ResultResponse")}SetLogicalFilePartAttr(e){return this._connection.send("SetLogicalFilePartAttr",e,"json",!1,void 0,"ResultResponse")}SetProtected(e){return this._connection.send("SetProtected",e,"json",!1,void 0,"ResultResponse")}SetTraceSlowTransactions(e){return this._connection.send("SetTraceSlowTransactions",e,"json",!1,void 0,"ResultResponse")}SetTraceTransactions(e){return this._connection.send("SetTraceTransactions",e,"json",!1,void 0,"ResultResponse")}SetUnprotected(e){return this._connection.send("SetUnprotected",e,"json",!1,void 0,"ResultResponse")}SetValue(e){return this._connection.send("SetValue",e,"json",!1,void 0,"ResultResponse")}UnlockSDSLock(e){return this._connection.send("UnlockSDSLock",e,"json",!1,void 0,"ResultResponse")}};var Bn=class extends bs{};var ct;(u=>{let n;(y=>(y.Delete="Delete",y.AddToSuperfile="Add To Superfile",y.ChangeProtection="Change Protection",y.ChangeRestriction="Change Restriction"))(n=u.DFUArrayActions||={});let e;(y=>(y[y.NoChange=0]="NoChange",y[y.Protect=1]="Protect",y[y.Unprotect=2]="Unprotect",y[y.UnprotectAll=3]="UnprotectAll"))(e=u.DFUChangeProtection||={});let t;(F=>(F[F.NoChange=0]="NoChange",F[F.Restrict=1]="Restrict",F[F.Unrestricted=2]="Unrestricted"))(t=u.DFUChangeRestriction||={});let s;(p=>(p.xml="xml",p.def="def"))(s=u.DFUDefFileFormat||={});let r;(F=>(F.Token="Token",F.Engine="Engine",F.External="External"))(r=u.FileAccessRole||={});let i;(M=>(M.None="None",M.Access="Access",M.Read="Read",M.Write="Write",M.Full="Full"))(i=u.SecAccessType||={});let o;(N=>(N.Flat="Flat",N.Index="Index",N.Xml="Xml",N.Csv="Csv",N.Json="Json",N.IndexLocal="IndexLocal",N.IndexPartitioned="IndexPartitioned",N.Unset="Unset"))(o=u.DFUFileType||={})})(ct||={});var Ps=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 Wo=ct.DFUArrayActions,Uo=ct.DFUDefFileFormat,Eo=ct.DFUChangeProtection,Fo=ct.DFUChangeRestriction,St=class extends Ps{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 Is=class extends G{constructor(e){super(e,"WsDFUXRef","1.04")}DFUXRefArrayAction(e){return this._connection.send("DFUXRefArrayAction",e,"json",!1,void 0,"DFUXRefArrayActionResponse")}DFUXRefBuild(e){return this._connection.send("DFUXRefBuild",e,"json",!1,void 0,"DFUXRefBuildResponse")}DFUXRefBuildCancel(e){return this._connection.send("DFUXRefBuildCancel",e,"json",!1,void 0,"DFUXRefBuildCancelResponse")}DFUXRefCleanDirectories(e){return this._connection.send("DFUXRefCleanDirectories",e,"json",!1,void 0,"DFUXRefCleanDirectoriesResponse")}DFUXRefDirectories(e){return this._connection.send("DFUXRefDirectories",e,"json",!1,void 0,"DFUXRefDirectoriesQueryResponse")}DFUXRefFoundFiles(e){return this._connection.send("DFUXRefFoundFiles",e,"json",!1,void 0,"DFUXRefFoundFilesQueryResponse")}DFUXRefList(e){return this._connection.send("DFUXRefList",e,"json",!1,void 0,"DFUXRefListResponse")}DFUXRefLostFiles(e){return this._connection.send("DFUXRefLostFiles",e,"json",!1,void 0,"DFUXRefLostFilesQueryResponse")}DFUXRefMessages(e){return this._connection.send("DFUXRefMessages",e,"json",!1,void 0,"DFUXRefMessagesQueryResponse")}DFUXRefOrphanFiles(e){return this._connection.send("DFUXRefOrphanFiles",e,"json",!1,void 0,"DFUXRefOrphanFilesQueryResponse")}DFUXRefUnusedFiles(e){return this._connection.send("DFUXRefUnusedFiles",e,"json",!1,void 0,"DFUXRefUnusedFilesResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsDFUXRefPingResponse")}};var Qn=class extends Is{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 Qr(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:Ln(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:bo(e)}}default:throw new Error("Unknown field type")}}function Ln(n){n.Row&&n.Row instanceof Array&&(n=n.Row[0]);let e=[];for(let t in n)e.push(Qr(t,n[t]));return e}function bo(n){let e={};for(let t in n)e[t]=Qr(t,n[t]);return e}var Lt=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(Ln)}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]=Ln(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 Xe(r,s,{Source:"wsEcl.submit",Exception:i.Results.Exception});return i.Results})}};var Ms=class extends G{constructor(e){super(e,"ws_elk","1")}GetConfigDetails(e){return this._connection.send("GetConfigDetails",e,"json",!1,void 0,"GetConfigDetailsResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_elkPingResponse")}};var Gn=class extends Ms{};var Gr=require("@hpcc-js/util");var $;(l=>{let n;(P=>(P.global="global",P.workunits="workunits",P.components="components",P.audience="audience",P.class="class",P.instance="instance",P.node="node",P.message="message",P.logid="logid",P.processid="processid",P.threadid="threadid",P.timestamp="timestamp",P.pod="pod",P.traceid="traceid",P.spanid="spanid"))(n=l.LogColumnType||={});let e;(Q=>(Q.string="string",Q.numeric="numeric",Q.datetime="datetime",Q.enum="enum",Q.epoch="epoch"))(e=l.LogColumnValueType||={});let t;(b=>(b[b.All=0]="All",b[b.ByJobID=1]="ByJobID",b[b.ByComponent=2]="ByComponent",b[b.ByLogType=3]="ByLogType",b[b.ByTargetAudience=4]="ByTargetAudience",b[b.BySourceInstance=5]="BySourceInstance",b[b.BySourceNode=6]="BySourceNode",b[b.ByFieldName=7]="ByFieldName",b[b.ByPod=8]="ByPod",b[b.ByTraceID=9]="ByTraceID",b[b.BySpanID=10]="BySpanID"))(t=l.LogAccessType||={});let s;(y=>(y[y.Success=0]="Success",y[y.Warning=1]="Warning",y[y.Fail=2]="Fail"))(s=l.LogAccessStatusCode||={});let r;(y=>(y[y.NONE=0]="NONE",y[y.AND=1]="AND",y[y.OR=2]="OR"))(r=l.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=l.LogSelectColumnMode||={});let o;(b=>(b[b.ByDate=0]="ByDate",b[b.ByJobID=1]="ByJobID",b[b.ByComponent=2]="ByComponent",b[b.ByLogType=3]="ByLogType",b[b.ByTargetAudience=4]="ByTargetAudience",b[b.BySourceInstance=5]="BySourceInstance",b[b.BySourceNode=6]="BySourceNode",b[b.ByFieldName=7]="ByFieldName",b[b.ByPod=8]="ByPod",b[b.ByTraceID=9]="ByTraceID",b[b.BySpanID=10]="BySpanID"))(o=l.SortColumType||={});let u;(F=>(F[F.ASC=0]="ASC",F[F.DSC=1]="DSC"))(u=l.SortDirection||={})})($||={});var Ts=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 Lr=(0,Gr.scopedLogger)("@hpcc-js/comms/services/wsLogaccess.ts");var kr=(o=>(o.Disaster="DIS",o.Error="ERR",o.Warning="WRN",o.Information="INF",o.Progress="PRO",o.Metric="MET",o))(kr||{}),vr=(r=>(r.Operator="OPR",r.User="USR",r.Programmer="PRO",r.Audit="ADT",r))(vr||{}),kn=class extends Ts{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}async GetLogsEx(e){let t=await this.GetLogAccessInfo(),s={};t.Columns.Column.forEach(u=>s[u.LogType]=u.Name);let r=u=>{let l={};for(let R in s)u?.fields?l[R]=Object.assign({},...u.fields)[s[R]]??"":l[R]="";return l},i={Filter:{leftBinaryFilter:{BinaryLogFilter:[{leftFilter:{LogCategory:$.LogAccessType.All}}]}},Range:{StartDate:new Date(0).toISOString()},LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:$.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:$.SortColumType.ByDate,ColumnName:"",Direction:0}]}},o=[];for(let u in e){let l;u in s&&(Object.values($.LogColumnType).includes(u)?l=u:l=s[u]);let R;if(l){switch(l){case $.LogColumnType.workunits:case"hpcc.log.jobid":R=$.LogAccessType.ByJobID;break;case $.LogColumnType.audience:case"hpcc.log.audience":R=$.LogAccessType.ByTargetAudience;break;case $.LogColumnType.class:case"hpcc.log.class":R=$.LogAccessType.ByLogType;break;case $.LogColumnType.components:case"kubernetes.container.name":R=$.LogAccessType.ByComponent;break;default:R=$.LogAccessType.ByFieldName,l=s[u]}if(Array.isArray(e[u]))e[u].forEach(p=>{R===$.LogAccessType.ByComponent&&(p+="*"),o.push({LogCategory:R,SearchField:l,SearchByValue:p})});else{let p=e[u];R===$.LogAccessType.ByComponent&&(p+="*"),o.push({LogCategory:R,SearchField:l,SearchByValue:p})}}}if(o.length>2){let u=i.Filter.leftBinaryFilter.BinaryLogFilter[0];o.forEach((l,R)=>{let p=$.LogAccessFilterOperator.AND;R>0?(o[R-1].SearchField===l.SearchField&&(p=$.LogAccessFilterOperator.OR),R===o.length-1?(u.Operator=p,u.rightFilter=l):(u.Operator=p,u.rightBinaryFilter={BinaryLogFilter:[{leftFilter:l}]},u=u.rightBinaryFilter.BinaryLogFilter[0])):u.leftFilter=l})}else delete i.Filter.leftBinaryFilter,i.Filter.leftFilter={LogCategory:$.LogAccessType.All},o[0]?.SearchField&&(i.Filter.leftFilter={LogCategory:o[0]?.LogCategory,SearchField:o[0]?.SearchField,SearchByValue:o[0]?.SearchByValue}),o[1]?.SearchField&&(i.Filter.Operator=$.LogAccessFilterOperator.AND,o[0].SearchField===o[1].SearchField&&(i.Filter.Operator=$.LogAccessFilterOperator.OR),i.Filter.rightFilter={LogCategory:o[1]?.LogCategory,SearchField:o[1]?.SearchField,SearchByValue:o[1]?.SearchByValue});return e.StartDate&&(i.Range.StartDate=e.StartDate.toISOString()),e.EndDate&&(i.Range.EndDate=e.EndDate.toISOString()),this.GetLogs(i).then(u=>{try{let l=JSON.parse(u.LogLines),R=[];switch(t.RemoteLogManagerType){case"azureloganalyticscurl":case"elasticstack":case"grafanacurl":R=l.lines?.map(r)??[];break;default:Lr.warning(`Unknown RemoteLogManagerType: ${t.RemoteLogManagerType}`),R=[]}return{lines:R,total:u.TotalLogLinesAvailable??1e4}}catch(l){Lr.error(l.message??l)}return{lines:[],total:0}})}};var jr=require("@hpcc-js/util"),ze=We(Hr(),1);var Po;(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||={})})(Po||={});var Ns=class extends G{constructor(e){super(e,"ws_machine","1.19")}GetComponentStatus(e){return this._connection.send("GetComponentStatus",e,"json",!1,void 0,"GetComponentStatusResponse")}GetComponentUsage(e){return this._connection.send("GetComponentUsage",e,"json",!1,void 0,"GetComponentUsageResponse")}GetMachineInfo(e){return this._connection.send("GetMachineInfo",e,"json",!1,void 0,"GetMachineInfoResponse")}GetMachineInfoEx(e){return this._connection.send("GetMachineInfoEx",e,"json",!1,void 0,"GetMachineInfoResponseEx")}GetMetrics(e){return this._connection.send("GetMetrics",e,"json",!1,void 0,"MetricsResponse")}GetNodeGroupUsage(e){return this._connection.send("GetNodeGroupUsage",e,"json",!1,void 0,"GetNodeGroupUsageResponse")}GetTargetClusterInfo(e){return this._connection.send("GetTargetClusterInfo",e,"json",!1,void 0,"GetTargetClusterInfoResponse")}GetTargetClusterUsage(e){return this._connection.send("GetTargetClusterUsage",e,"json",!1,void 0,"GetTargetClusterUsageResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_machinePingResponse")}UpdateComponentStatus(e){return this._connection.send("UpdateComponentStatus",e,"json",!1,void 0,"UpdateComponentStatusResponse")}};var Ge=class extends Ns{GetTargetClusterUsageEx(e,t=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:t}).then(s=>(0,jr.exists)("TargetClusterUsages.TargetClusterUsage",s)?s.TargetClusterUsages.TargetClusterUsage:[]).then(s=>s.filter(r=>!!r.ComponentUsages).map(r=>{let i=r.ComponentUsages.ComponentUsage.map(o=>{let u=(o.MachineUsages&&o.MachineUsages.MachineUsage?o.MachineUsages.MachineUsage:[]).map(l=>{let R=l.DiskUsages&&l.DiskUsages.DiskUsage?l.DiskUsages.DiskUsage.map(p=>({...p,InUse:p.InUse*1024,Total:(p.InUse+p.Available)*1024,PercentUsed:100-p.PercentAvailable})):[];return{Name:l.Name,NetAddress:l.NetAddress,Description:l.Description,DiskUsages:R,mean:(0,ze.mean)(R.filter(p=>!isNaN(p.PercentUsed)),p=>p.PercentUsed),max:(0,ze.max)(R.filter(p=>!isNaN(p.PercentUsed)),p=>p.PercentUsed)}});return{Type:o.Type,Name:o.Name,Description:o.Description,MachineUsages:u,MachineUsagesDescription:u.reduce((l,R)=>l+(R.Description||""),""),mean:(0,ze.mean)(u.filter(l=>!isNaN(l.mean)),l=>l.mean),max:(0,ze.max)(u.filter(l=>!isNaN(l.max)),l=>l.max)}});return{Name:r.Name,Description:r.Description,ComponentUsages:i,ComponentUsagesDescription:i.reduce((o,u)=>o+(u.MachineUsagesDescription||""),""),mean:(0,ze.mean)(i.filter(o=>!isNaN(o.mean)),o=>o.mean),max:(0,ze.max)(i.filter(o=>!isNaN(o.max)),o=>o.max)}}))}};var Bs=class extends G{constructor(e){super(e,"WsPackageProcess","1.07")}ActivatePackage(e){return this._connection.send("ActivatePackage",e,"json",!1,void 0,"ActivatePackageResponse")}AddPackage(e){return this._connection.send("AddPackage",e,"json",!1,void 0,"AddPackageResponse")}AddPartToPackageMap(e){return this._connection.send("AddPartToPackageMap",e,"json",!1,void 0,"AddPartToPackageMapResponse")}CopyPackageMap(e){return this._connection.send("CopyPackageMap",e,"json",!1,void 0,"CopyPackageMapResponse")}DeActivatePackage(e){return this._connection.send("DeActivatePackage",e,"json",!1,void 0,"DeActivatePackageResponse")}DeletePackage(e){return this._connection.send("DeletePackage",e,"json",!1,void 0,"DeletePackageResponse")}Echo(e){return this._connection.send("Echo",e,"json",!1,void 0,"EchoResponse")}GetPackage(e){return this._connection.send("GetPackage",e,"json",!1,void 0,"GetPackageResponse")}GetPackageMapById(e){return this._connection.send("GetPackageMapById",e,"json",!1,void 0,"GetPackageMapByIdResponse")}GetPackageMapSelectOptions(e){return this._connection.send("GetPackageMapSelectOptions",e,"json",!1,void 0,"GetPackageMapSelectOptionsResponse")}GetPartFromPackageMap(e){return this._connection.send("GetPartFromPackageMap",e,"json",!1,void 0,"GetPartFromPackageMapResponse")}GetQueryFileMapping(e){return this._connection.send("GetQueryFileMapping",e,"json",!1,void 0,"GetQueryFileMappingResponse")}ListPackage(e){return this._connection.send("ListPackage",e,"json",!1,void 0,"ListPackageResponse")}ListPackages(e){return this._connection.send("ListPackages",e,"json",!1,void 0,"ListPackagesResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsPackageProcessPingResponse")}RemovePartFromPackageMap(e){return this._connection.send("RemovePartFromPackageMap",e,"json",!1,void 0,"RemovePartFromPackageMapResponse")}ValidatePackage(e){return this._connection.send("ValidatePackage",e,"json",!1,void 0,"ValidatePackageResponse")}};var vn=class extends Bs{};var Qs=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 Qs{};var Hn;(e=>{let n;(r=>(r.ECL="ECL",r.DFU="DFU"))(n=e.WUTypes||={})})(Hn||={});var Ls=class extends G{constructor(e){super(e,"WSSasha","1.01")}ArchiveWU(e){return this._connection.send("ArchiveWU",e,"json",!1,void 0,"ResultResponse")}GetVersion(e){return this._connection.send("GetVersion",e,"json",!1,void 0,"ResultResponse")}ListWU(e){return this._connection.send("ListWU",e,"json",!1,void 0,"ResultResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WSSashaPingResponse")}RestoreWU(e){return this._connection.send("RestoreWU",e,"json",!1,void 0,"ResultResponse")}};var jn=class extends Ls{};var _n;(t=>{let n;(l=>(l.ALL="ALL",l.READ="READ",l.WRITE="WRITE",l.HOLD="HOLD",l.SUB="SUB"))(n=t.LockModes||={});let e;(F=>(F.Attach="Attach",F.Detach="Detach",F.State="State",F.Reload="Reload",F.ReloadRetry="ReloadRetry",F.MemLock="MemLock",F.MemUnlock="MemUnlock",F.GetMemLocked="GetMemLocked"))(e=t.RoxieControlCmdType||={})})(_n||={});var Gs=class extends G{constructor(e){super(e,"WsSMC","1.28")}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")}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 yt=class extends Gs{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(t=>({Running:{ActiveWorkunit:[]},...t}))}};var ks=class extends G{constructor(e){super(e,"wsstore","1.02")}CreateStore(e){return this._connection.send("CreateStore",e,"json",!1,void 0,"CreateStoreResponse")}Delete(e){return this._connection.send("Delete",e,"json",!1,void 0,"DeleteResponse")}DeleteNamespace(e){return this._connection.send("DeleteNamespace",e,"json",!1,void 0,"DeleteNamespaceResponse")}Fetch(e){return this._connection.send("Fetch",e,"json",!1,void 0,"FetchResponse")}FetchAll(e){return this._connection.send("FetchAll",e,"json",!1,void 0,"FetchAllResponse")}FetchKeyMetadata(e){return this._connection.send("FetchKeyMetadata",e,"json",!1,void 0,"FetchKeyMDResponse")}ListKeys(e){return this._connection.send("ListKeys",e,"json",!1,void 0,"ListKeysResponse")}ListNamespaces(e){return this._connection.send("ListNamespaces",e,"json",!1,void 0,"ListNamespacesResponse")}ListStores(e){return this._connection.send("ListStores",e,"json",!1,void 0,"ListStoresResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"wsstorePingResponse")}Set(e){return this._connection.send("Set",e,"json",!1,void 0,"SetResponse")}};var xt=class extends ks{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 On;(s=>{let n;(o=>(o.XML="XML",o.YAML="YAML"))(n=s.TpConfigResponseFormat||={});let e;(u=>(u.All="All",u.QueriesOnly="QueriesOnly",u.WorkunitsOnly="WorkunitsOnly"))(e=s.RoxieQueueFilter||={});let t;(Q=>(Q.ALLNODES="ALLNODES",Q.THORMACHINES="THORMACHINES",Q.HOLEMACHINES="HOLEMACHINES",Q.ROXIEMACHINES="ROXIEMACHINES",Q.MACHINES="MACHINES",Q.AVAILABLEMACHINES="AVAILABLEMACHINES",Q.DROPZONE="DROPZONE",Q.STANDBYNNODE="STANDBYNNODE",Q.THORSPARENODES="THORSPARENODES",Q.HOLESTANDBYNODES="HOLESTANDBYNODES"))(t=s.TpMachineType||={})})(On||={});var vs=class extends G{constructor(e){super(e,"WsTopology","1.33")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsTopologyPingResponse")}SystemLog(e){return this._connection.send("SystemLog",e,"json",!1,void 0,"SystemLogResponse")}TpClusterInfo(e){return this._connection.send("TpClusterInfo",e,"json",!1,void 0,"TpClusterInfoResponse")}TpClusterQuery(e){return this._connection.send("TpClusterQuery",e,"json",!1,void 0,"TpClusterQueryResponse")}TpComponentConfiguration(e){return this._connection.send("TpComponentConfiguration",e,"json",!1,void 0,"TpComponentConfigurationResponse")}TpConfiguredComponents(e){return this._connection.send("TpConfiguredComponents",e,"json",!1,void 0,"TpConfiguredComponentsResponse")}TpDropZoneQuery(e){return this._connection.send("TpDropZoneQuery",e,"json",!1,void 0,"TpDropZoneQueryResponse")}TpGetComponentFile(e){return this._connection.send("TpGetComponentFile",e,"json",!1,void 0,"TpGetComponentFileResponse")}TpGetServicePlugins(e){return this._connection.send("TpGetServicePlugins",e,"json",!1,void 0,"TpGetServicePluginsResponse")}TpGroupQuery(e){return this._connection.send("TpGroupQuery",e,"json",!1,void 0,"TpGroupQueryResponse")}TpListLogFiles(e){return this._connection.send("TpListLogFiles",e,"json",!1,void 0,"TpListLogFilesResponse")}TpListTargetClusters(e){return this._connection.send("TpListTargetClusters",e,"json",!1,void 0,"TpListTargetClustersResponse")}TpLogFile(e){return this._connection.send("TpLogFile",e,"json",!1,void 0,"TpLogFileResponse")}TpLogFileDisplay(e){return this._connection.send("TpLogFileDisplay",e,"json",!1,void 0,"TpLogFileResponse")}TpLogicalClusterQuery(e){return this._connection.send("TpLogicalClusterQuery",e,"json",!1,void 0,"TpLogicalClusterQueryResponse")}TpMachineInfo(e){return this._connection.send("TpMachineInfo",e,"json",!1,void 0,"TpMachineInfoResponse")}TpMachineQuery(e){return this._connection.send("TpMachineQuery",e,"json",!1,void 0,"TpMachineQueryResponse")}TpServiceQuery(e){return this._connection.send("TpServiceQuery",e,"json",!1,void 0,"TpServiceQueryResponse")}TpSetMachineStatus(e){return this._connection.send("TpSetMachineStatus",e,"json",!1,void 0,"TpSetMachineStatusResponse")}TpSwapNode(e){return this._connection.send("TpSwapNode",e,"json",!1,void 0,"TpSwapNodeResponse")}TpTargetClusterQuery(e){return this._connection.send("TpTargetClusterQuery",e,"json",!1,void 0,"TpTargetClusterQueryResponse")}TpThorStatus(e){return this._connection.send("TpThorStatus",e,"json",!1,void 0,"TpThorStatusResponse")}TpXMLFile(e){return this._connection.send("TpXMLFile",e,"json",!1,void 0,"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 Vs=require("@hpcc-js/util");var ge;(N=>{let n;(O=>(O.Abort="Abort",O.Delete="Delete",O.Deschedule="Deschedule",O.Reschedule="Reschedule",O.Pause="Pause",O.PauseNow="PauseNow",O.Protect="Protect",O.Unprotect="Unprotect",O.Restore="Restore",O.Resume="Resume",O.SetToFailed="SetToFailed",O.Archive="Archive"))(n=N.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=N.LogSelectColumnMode||={});let t;(I=>(I[I.ASC=0]="ASC",I[I.DSC=1]="DSC"))(t=N.SortDirection||={});let s;(w=>(w.ALL="ALL",w.DIS="DIS",w.ERR="ERR",w.WRN="WRN",w.INF="INF",w.PRO="PRO",w.MET="MET",w.EVT="EVT"))(s=N.LogEventClass||={});let r;(b=>(b.Single="Single",b.List="List",b.Multi="Multi"))(r=N.WUDetailsAttrValueType||={});let i;(b=>(b.SyntaxCheck="SyntaxCheck",b.Deploy="Deploy",b.Publish="Publish"))(i=N.EclDefinitionActions||={});let o;(b=>(b.xml="xml",b.json="json",b.text="text"))(o=N.ErrorMessageFormat||={});let u;(b=>(b[b.XML=0]="XML",b[b.JSON=1]="JSON",b[b.CSV=2]="CSV"))(u=N.LogAccessLogFormat||={});let l;(j=>(j.info="info",j.warning="warning",j.error="error",j.alert="alert"))(l=N.WUExceptionSeverity||={});let R;(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"))(R=N.WUQueryFilterSuspendedType||={});let p;(ue=>(ue.All="All",ue.Id="Id",ue.Name="Name",ue.Alias="Alias",ue.Status="Status"))(p=N.WUQuerySetFilterType||={});let F;(b=>(b.All="All",b.Protected="Protected",b.NotProtected="NotProtected"))(F=N.WUProtectFilter||={});let y;(k=>k.Deactivate="Deactivate")(y=N.QuerySetAliasActionTypes||={});let M;(I=>(I.None="None",I.ActivateImportedActive="ActivateImportedActive"))(M=N.QuerysetImportActivation||={});let Q;(w=>(w.Suspend="Suspend",w.Unsuspend="Unsuspend",w.ToggleSuspend="ToggleSuspend",w.Activate="Activate",w.Delete="Delete",w.DeleteQueriesAndWUs="DeleteQueriesAndWUs",w.RemoveAllAliases="RemoveAllAliases",w.ResetQueryStats="ResetQueryStats"))(Q=N.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=N.WUQueryActivationMode||={})})(ge||={});var Gt=class extends G{constructor(e){super(e,"WsWorkunits","2.02")}GVCAjaxGraph(e){return this._connection.send("GVCAjaxGraph",e,"json",!1,void 0,"GVCAjaxGraphResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsWorkunitsPingResponse")}WUAbort(e){return this._connection.send("WUAbort",e,"json",!1,void 0,"WUAbortResponse")}WUAction(e){return this._connection.send("WUAction",e,"json",!1,void 0,"WUActionResponse")}WUAddLocalFileToWorkunit(e){return this._connection.send("WUAddLocalFileToWorkunit",e,"json",!1,void 0,"WUAddLocalFileToWorkunitResponse")}WUAnalyseHotspot(e){return this._connection.send("WUAnalyseHotspot",e,"json",!1,void 0,"WUAnalyseHotspotResponse")}WUCDebug(e){return this._connection.send("WUCDebug",e,"json",!1,void 0,"WUDebugResponse")}WUCheckFeatures(e){return this._connection.send("WUCheckFeatures",e,"json",!1,void 0,"WUCheckFeaturesResponse")}WUClusterJobQueueLOG(e){return this._connection.send("WUClusterJobQueueLOG",e,"json",!1,void 0,"WUClusterJobQueueLOGResponse")}WUClusterJobQueueXLS(e){return this._connection.send("WUClusterJobQueueXLS",e,"json",!1,void 0,"WUClusterJobQueueXLSResponse")}WUClusterJobSummaryXLS(e){return this._connection.send("WUClusterJobSummaryXLS",e,"json",!1,void 0,"WUClusterJobSummaryXLSResponse")}WUClusterJobXLS(e){return this._connection.send("WUClusterJobXLS",e,"json",!1,void 0,"WUClusterJobXLSResponse")}WUCompileECL(e){return this._connection.send("WUCompileECL",e,"json",!1,void 0,"WUCompileECLResponse")}WUCopyLogicalFiles(e){return this._connection.send("WUCopyLogicalFiles",e,"json",!1,void 0,"WUCopyLogicalFilesResponse")}WUCopyQuerySet(e){return this._connection.send("WUCopyQuerySet",e,"json",!1,void 0,"WUCopyQuerySetResponse")}WUCreate(e){return this._connection.send("WUCreate",e,"json",!1,void 0,"WUCreateResponse")}WUCreateAndUpdate(e){return this._connection.send("WUCreateAndUpdate",e,"json",!1,void 0,"WUUpdateResponse")}WUCreateZAPInfo(e){return this._connection.send("WUCreateZAPInfo",e,"json",!1,void 0,"WUCreateZAPInfoResponse")}WUDelete(e){return this._connection.send("WUDelete",e,"json",!1,void 0,"WUDeleteResponse")}WUDeployWorkunit(e){return this._connection.send("WUDeployWorkunit",e,"json",!1,void 0,"WUDeployWorkunitResponse")}WUDetails(e){return this._connection.send("WUDetails",e,"json",!1,void 0,"WUDetailsResponse")}WUDetailsMeta(e){return this._connection.send("WUDetailsMeta",e,"json",!1,void 0,"WUDetailsMetaResponse")}WUEclDefinitionAction(e){return this._connection.send("WUEclDefinitionAction",e,"json",!1,void 0,"WUEclDefinitionActionResponse")}WUExport(e){return this._connection.send("WUExport",e,"json",!1,void 0,"WUExportResponse")}WUFile(e){return this._connection.send("WUFile",e,"json",!1,void 0,"WULogFileResponse")}WUFullResult(e){return this._connection.send("WUFullResult",e,"json",!1,void 0,"WUFullResultResponse")}WUGVCGraphInfo(e){return this._connection.send("WUGVCGraphInfo",e,"json",!1,void 0,"WUGVCGraphInfoResponse")}WUGetArchiveFile(e){return this._connection.send("WUGetArchiveFile",e,"json",!1,void 0,"WUGetArchiveFileResponse")}WUGetDependancyTrees(e){return this._connection.send("WUGetDependancyTrees",e,"json",!1,void 0,"WUGetDependancyTreesResponse")}WUGetGraph(e){return this._connection.send("WUGetGraph",e,"json",!1,void 0,"WUGetGraphResponse")}WUGetGraphNameAndTypes(e){return this._connection.send("WUGetGraphNameAndTypes",e,"json",!1,void 0,"WUGetGraphNameAndTypesResponse")}WUGetNumFileToCopy(e){return this._connection.send("WUGetNumFileToCopy",e,"json",!1,void 0,"WUGetNumFileToCopyResponse")}WUGetPlugins(e){return this._connection.send("WUGetPlugins",e,"json",!1,void 0,"WUGetPluginsResponse")}WUGetStats(e){return this._connection.send("WUGetStats",e,"json",!1,void 0,"WUGetStatsResponse")}WUGetThorJobList(e){return this._connection.send("WUGetThorJobList",e,"json",!1,void 0,"WUGetThorJobListResponse")}WUGetThorJobQueue(e){return this._connection.send("WUGetThorJobQueue",e,"json",!1,void 0,"WUGetThorJobQueueResponse")}WUGetZAPInfo(e){return this._connection.send("WUGetZAPInfo",e,"json",!1,void 0,"WUGetZAPInfoResponse")}WUGraphInfo(e){return this._connection.send("WUGraphInfo",e,"json",!1,void 0,"WUGraphInfoResponse")}WUGraphTiming(e){return this._connection.send("WUGraphTiming",e,"json",!1,void 0,"WUGraphTimingResponse")}WUInfo(e){return this._connection.send("WUInfo",e,"json",!1,void 0,"WUInfoResponse")}WUInfoDetails(e){return this._connection.send("WUInfoDetails",e,"json",!1,void 0,"WUInfoResponse")}WUJobList(e){return this._connection.send("WUJobList",e,"json",!1,void 0,"WUJobListResponse")}WULightWeightQuery(e){return this._connection.send("WULightWeightQuery",e,"json",!1,void 0,"WULightWeightQueryResponse")}WUListArchiveFiles(e){return this._connection.send("WUListArchiveFiles",e,"json",!1,void 0,"WUListArchiveFilesResponse")}WUListLocalFileRequired(e){return this._connection.send("WUListLocalFileRequired",e,"json",!1,void 0,"WUListLocalFileRequiredResponse")}WUListQueries(e){return this._connection.send("WUListQueries",e,"json",!1,void 0,"WUListQueriesResponse")}WUListQueriesUsingFile(e){return this._connection.send("WUListQueriesUsingFile",e,"json",!1,void 0,"WUListQueriesUsingFileResponse")}WUMultiQuerysetDetails(e){return this._connection.send("WUMultiQuerysetDetails",e,"json",!1,void 0,"WUMultiQuerySetDetailsResponse")}WUProcessGraph(e){return this._connection.send("WUProcessGraph",e,"json",!1,void 0,"WUProcessGraphResponse")}WUProtect(e){return this._connection.send("WUProtect",e,"json",!1,void 0,"WUProtectResponse")}WUPublishWorkunit(e){return this._connection.send("WUPublishWorkunit",e,"json",!1,void 0,"WUPublishWorkunitResponse")}WUPushEvent(e){return this._connection.send("WUPushEvent",e,"json",!1,void 0,"WUPushEventResponse")}WUQuery(e){return this._connection.send("WUQuery",e,"json",!1,void 0,"WUQueryResponse")}WUQueryConfig(e){return this._connection.send("WUQueryConfig",e,"json",!1,void 0,"WUQueryConfigResponse")}WUQueryDetails(e){return this._connection.send("WUQueryDetails",e,"json",!1,void 0,"WUQueryDetailsResponse")}WUQueryDetailsLightWeight(e){return this._connection.send("WUQueryDetailsLightWeight",e,"json",!1,void 0,"WUQueryDetailsResponse")}WUQueryFiles(e){return this._connection.send("WUQueryFiles",e,"json",!1,void 0,"WUQueryFilesResponse")}WUQueryGetGraph(e){return this._connection.send("WUQueryGetGraph",e,"json",!1,void 0,"WUQueryGetGraphResponse")}WUQueryGetSummaryStats(e){return this._connection.send("WUQueryGetSummaryStats",e,"json",!1,void 0,"WUQueryGetSummaryStatsResponse")}WUQuerysetAliasAction(e){return this._connection.send("WUQuerysetAliasAction",e,"json",!1,void 0,"WUQuerySetAliasActionResponse")}WUQuerysetCopyQuery(e){return this._connection.send("WUQuerysetCopyQuery",e,"json",!1,void 0,"WUQuerySetCopyQueryResponse")}WUQuerysetDetails(e){return this._connection.send("WUQuerysetDetails",e,"json",!1,void 0,"WUQuerySetDetailsResponse")}WUQuerysetExport(e){return this._connection.send("WUQuerysetExport",e,"json",!1,void 0,"WUQuerysetExportResponse")}WUQuerysetImport(e){return this._connection.send("WUQuerysetImport",e,"json",!1,void 0,"WUQuerysetImportResponse")}WUQuerysetQueryAction(e){return this._connection.send("WUQuerysetQueryAction",e,"json",!1,void 0,"WUQuerySetQueryActionResponse")}WUQuerysets(e){return this._connection.send("WUQuerysets",e,"json",!1,void 0,"WUQuerysetsResponse")}WURecreateQuery(e){return this._connection.send("WURecreateQuery",e,"json",!1,void 0,"WURecreateQueryResponse")}WUResubmit(e){return this._connection.send("WUResubmit",e,"json",!1,void 0,"WUResubmitResponse")}WUResult(e){return this._connection.send("WUResult",e,"json",!1,void 0,"WUResultResponse")}WUResultBin(e){return this._connection.send("WUResultBin",e,"json",!1,void 0,"WUResultBinResponse")}WUResultSummary(e){return this._connection.send("WUResultSummary",e,"json",!1,void 0,"WUResultSummaryResponse")}WUResultView(e){return this._connection.send("WUResultView",e,"json",!1,void 0,"WUResultViewResponse")}WURun(e){return this._connection.send("WURun",e,"json",!1,void 0,"WURunResponse")}WUSchedule(e){return this._connection.send("WUSchedule",e,"json",!1,void 0,"WUScheduleResponse")}WUShowScheduled(e){return this._connection.send("WUShowScheduled",e,"json",!1,void 0,"WUShowScheduledResponse")}WUSubmit(e){return this._connection.send("WUSubmit",e,"json",!1,void 0,"WUSubmitResponse")}WUSyntaxCheckECL(e){return this._connection.send("WUSyntaxCheckECL",e,"json",!1,void 0,"WUSyntaxCheckResponse")}WUUpdate(e){return this._connection.send("WUUpdate",e,"json",!1,void 0,"WUUpdateResponse")}WUUpdateQueryEntry(e){return this._connection.send("WUUpdateQueryEntry",e,"json",!1,void 0,"WUUpdateQueryEntryResponse")}WUWaitCompiled(e){return this._connection.send("WUWaitCompiled",e,"json",!1,void 0,"WUWaitResponse")}WUWaitComplete(e){return this._connection.send("WUWaitComplete",e,"json",!1,void 0,"WUWaitResponse")}};var Hs=(I=>(I[I.Unknown=0]="Unknown",I[I.Compiled=1]="Compiled",I[I.Running=2]="Running",I[I.Completed=3]="Completed",I[I.Failed=4]="Failed",I[I.Archived=5]="Archived",I[I.Aborting=6]="Aborting",I[I.Aborted=7]="Aborted",I[I.Blocked=8]="Blocked",I[I.Submitted=9]="Submitted",I[I.Scheduled=10]="Scheduled",I[I.Compiling=11]="Compiling",I[I.Wait=12]="Wait",I[I.UploadingFiled=13]="UploadingFiled",I[I.DebugPaused=14]="DebugPaused",I[I.DebugRunning=15]="DebugRunning",I[I.Paused=16]="Paused",I[I.LAST=17]="LAST",I[I.NotFound=999]="NotFound",I))(Hs||{}),Je;(e=>{let n;(y=>(y[y.Unknown=0]="Unknown",y[y.Compile=1]="Compile",y[y.Check=2]="Check",y[y.Run=3]="Run",y[y.ExecuteExisting=4]="ExecuteExisting",y[y.Pause=5]="Pause",y[y.PauseNow=6]="PauseNow",y[y.Resume=7]="Resume",y[y.Debug=8]="Debug",y[y.__size=9]="__size"))(n=e.Action||={})})(Je||={});function Yn(n){return typeof n.Name=="string"}function Io(n){return n.TotalClusterTime!==void 0}function Mo(n){return n.StateEx!==void 0}var re=class extends Gt{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,Vs.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,Vs.xml2json)(t.Result).children();return r.length?r[0]:null})}},kt=class extends Gt{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};var on=require("@hpcc-js/util");var Ue=require("@hpcc-js/util"),ti=We(Xn(),1),nn=We(zr(),1);var ae=require("@hpcc-js/util"),vt=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=>jt(t)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(t=>jt(t))}},Vt=class extends ae.Cache{constructor(){super(e=>ae.Cache.hash([e.Name]))}};function Jr(n,e,t){t=t||[],t.push(n),e(n.name,n.$,n.children(),t),n.children().forEach(s=>{Jr(s,e,t)}),t.pop()}function qn(n){let e={};return n.forEach(t=>{t.name==="att"&&(e[t.$.name]=t.$.value)}),e}var Ys=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 Ys(u=>u._.id),o=[i.root];return Jr(e,(u,l,R,p)=>{let F=o[o.length-1];switch(u){case"graph":break;case"node":if(R.length&&R[0].children().length&&R[0].children()[0].name==="graph"){let Q=F.createSubgraph(qn(R));o.push(Q),t[l.id]=Q}let y=F.createVertex(qn(R));s[l.id]=y;break;case"edge":let M=F.createEdge(s[l.source],s[l.target],qn(R));r[l.id]=M;break;default:}}),i}var Ht=class extends ae.Graph{},Zn=class extends ae.Subgraph{},$n=class extends ae.Vertex{},er=class extends ae.Edge{};function jt(n){let e={},t={},s={},r;for(let i of n)switch(i.ScopeType){case"graph":r=new Ht(p=>p._.Id,i),e[i.ScopeName]=r.root;break;case"subgraph":r||(r=new Ht(p=>p._.Id,i),e[i.ScopeName]=r.root);let o=i.parentScope().split(":"),u=e[i.parentScope()];for(;o.length&&!u;)u=e[o.join(":")],o.pop();if(!u)console.warn(`Missing SG:Parent (${i.Id}): ${i.parentScope()}`);else{let p=u;e[i.ScopeName]=p.createSubgraph(i)}break;case"activity":let l=e[i.parentScope()];l?s[i.ScopeName]=l.createVertex(i):console.warn(`Missing A:Parent (${i.Id}): ${i.parentScope()}`);break;case"edge":t[i.ScopeName]=i;break;case"function":let R=s[i.parentScope()];R?R._.children().push(i):console.warn(`Missing F:Parent (${i.Id}): ${i.parentScope()}`);break}for(let i in t){let o=t[i],u=e[o.parentScope()];if(!u)console.warn(`Missing E:Parent (${o.Id}): ${o.parentScope()}`);else{let l=u;try{let R=r.vertex(o.attr("IdSource").RawValue),p=r.vertex(o.attr("IdTarget").RawValue);l.createEdge(R,p,o)}catch{console.warn(`Invalid Edge: ${i}`)}}}return r}var Kr=require("@hpcc-js/util"),_t=class extends Kr.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="",u="";s.indexOf(i)===0&&(o=s.substr(i.length),u=r[r.length-1]),this.set({URL:t,DisplayName:u,DisplayPath:o})}};var Qe=require("@hpcc-js/util");var zt=require("@hpcc-js/util"),Ot=class{e;constructor(e){this.e=e}fix(){delete this.e}},Yt=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}},Xt=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()}},qt=class{root;simpleTypes={};fields(){return this.root.children()}},Xs=class extends zt.SAXStackParser{schema=new qt;simpleType;simpleTypes={};xsdStack=new zt.Stack;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":let t=new Yt(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 Xt(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 qs(n){let e=new Xs;return e.parse(n),e.schema}var sr=class extends Xs{_rootName;schema=new qt;simpleTypes={};xsdStack=new zt.Stack;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":let t=new Yt(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 Xt(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 To(n,e){let t=new sr(e);return t.parse(n),t.schema}var Js=class extends Qe.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}},zs=new Js,Jt=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=zs.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=zs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+s},()=>new n(e,t,s)):typeof s=="string"&&(i=zs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new n(e,t,s)))),i}static attachLogicalFile(e,t,s){return zs.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=qs(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 u=o??this._bypassCache;return this.WUResult(e,t,!s,r,i,u).then(l=>{let R=l.Result;return delete l.Result,this.set({...l}),(0,Qe.exists)("XmlSchema.xml",R)&&(this.xsdSchema=qs(R.XmlSchema.xml)),(0,Qe.exists)("Row",R)?R.Row:this.ResultName&&(0,Qe.exists)(this.ResultName,R)?R[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 u={NamedValue:{itemcount:0}};for(let R in r)u.NamedValue[u.NamedValue.itemcount++]={Name:R,Value:r[R]};let l={FilterBy:u};return this.Wuid&&this.ResultName!==void 0?(l.Wuid=this.Wuid,l.ResultName=this.ResultName):this.Wuid&&this.ResultSequence!==void 0?(l.Wuid=this.Wuid,l.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(l.LogicalName=this.LogicalFileName,l.Cluster=this.NodeGroup):this.LogicalFileName&&(l.LogicalName=this.LogicalFileName),l.Start=e,l.Count=t,l.SuppressXmlSchema=s,l.BypassCachedResult=o,this.connection.WUResult(l,i).then(R=>R)}},Kt=class extends Qe.Cache{constructor(){super(e=>Qe.Cache.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};var nr=require("@hpcc-js/util"),Ke=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)}},Ks=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 Ke(this,s))}),t.start&&t.end?(t.start.FormattedEnd=t.end.Formatted,e.push(new Ke(this,t.start))):t.start?e.push(new Ke(this,t.start)):t.end&&e.push(new Ke(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 Ke(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let t="",s=[];t=this.Id,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__",co="__PACKAGE_VERSION__",lo="__BUILD_VERSION__";var Qt=require("@hpcc-js/util");var Qe=require("@hpcc-js/util"),Er=(0,Qe.scopedLogger)("comms/connection.ts");function po(n){return"baseUrl"in n}var go={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function mo(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 Ye(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,u)=>{typeof o=="object"?(i=!0,s.push(Ye(o,e,t+Be(`${r}.${u}`,e)))):s.push(t+Be(`${r}_i${u}`,e)+"="+Ye(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(Ye(n[r].Item,e,t+Be(r,e))),s.push(t+Be(`${r}.itemcount`,e)+"="+n[r].Item.length)):s.push(Ye(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 br(n,e,t={},s="json",r){return r&&console.warn("Header attributes ignored for JSONP connections"),new Promise((i,o)=>{let u=n.timeoutSecs*1e3,l=5e3,R="jsonp_callback_"+Math.round(Math.random()*999999);window[R]=function(Q){u=0,M(),i(s==="json"&&typeof Q=="string"?Fr(Q):Q)};let p=document.createElement("script"),F=(0,Qe.join)(n.baseUrl,e);F+=F.indexOf("?")>=0?"&":"?",p.src=F+"jsonp="+R+"&"+Ye(t,n.encodeRequest),document.body.appendChild(p);let y=setInterval(function(){u<=0?clearInterval(y):(u-=l,u<=0?(clearInterval(y),Er.error("Request timeout: "+p.src),M(),o(Error("Request timeout: "+p.src))):Er.debug("Request pending ("+u/1e3+" sec): "+p.src))},l);function M(){delete window[R],document.body.removeChild(p)}})}function fo(n){return n.userID?{Authorization:`Basic ${(0,Qe.utf8ToBase64)(`${n.userID}:${n.password}`)}`}:{}}var Cs={};function Pr(n,e,t,s,r){s={...fo(n),...s},t={credentials:Cs[n.baseUrl]?"omit":"include",...t,headers:s},fetch.__setGlobalDispatcher&&fetch.__setGlobalDispatcher(fetch.__defaultAgent),n.baseUrl.indexOf("https:")===0&&(n.rejectUnauthorized===!1&&fetch.__rejectUnauthorizedAgent?fetch.__setGlobalDispatcher?fetch.__setGlobalDispatcher(fetch.__rejectUnauthorizedAgent):t.agent=fetch.__rejectUnauthorizedAgent:fetch.__trustwaveAgent&&(t.agent=fetch.__trustwaveAgent));function i(o){if(o.ok)return r==="json"?o.json():o.text();throw new Error(o.statusText)}return(0,Qe.promiseTimeout)(n.timeoutSecs*1e3,fetch((0,Qe.join)(n.baseUrl,e),t).then(i).catch(o=>(t.credentials=Cs[n.baseUrl]?"include":"omit",fetch((0,Qe.join)(n.baseUrl,e),t).then(i).then(u=>(Cs[n.baseUrl]=!Cs[n.baseUrl],u)))))}function Ir(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:Ye(t,n.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...r},s)}function Mr(n,e,t,s="json",r){let i;return t.abortSignal_&&(i=t.abortSignal_,delete t.abortSignal_),Pr(n,`${e}?${Ye(t,n.encodeRequest)}`,{method:"get",signal:i},{...r},s)}function Tr(n,e,t,s="json",r){let i;switch(n.type){case"jsonp":i=br(n,e,t,s,r);break;case"get":i=Mr(n,e,t,s,r);break;case"post":default:i=Ir(n,e,t,s,r);break}return i}var Rs=Tr;function ho(n){let e=Rs;return n&&(Rs=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={...go,...e},this)}send(e,t,s="json",r){return this._opts.hookSend?this._opts.hookSend(this._opts,e,t,s,Rs,r):Rs(this._opts,e,t,s,r)}clone(){return new n(this.opts())}},Bt=function(n){return new Ss(n)};function Do(n){let e=Bt;return Bt=n,e}function wr(n){return Object.prototype.toString.call(n)==="[object Array]"}var Xe=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 Xe||n.isESPExceptions&&Array.isArray(n.Exception)}function Ro(n){return n.send!==void 0}var ys=class n{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,t,s){this._connection=Ro(e)?e:Bt(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(wr(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 u={...t,ver_:this._version};r&&(u.upload_=!0),i&&(u.abortSignal_=i);let l,R="json";switch(s){case"text":l=(0,Qt.join)(this._service,e),R="text";break;case"xsd":l=(0,Qt.join)(this._service,e+".xsd"),R="text";break;case"json2":l=(0,Qt.join)(this._service,e+"/json"),s="json",e=e.split("/").pop();break;default:l=(0,Qt.join)(this._service,e+".json")}return this._connection.send(l,u,R).then(p=>{if(s==="json"){let F;if(p&&p.Exceptions)throw new Xe(e,u,p.Exceptions);if(p&&(F=p[o||e+"Response"]),!F)throw new Xe(e,u,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return F}return p})}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 ys(e,t,s)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};var Rt;(e=>{let n;(l=>(l.Delete="Delete",l.Protect="Protect",l.Unprotect="Unprotect",l.Restore="Restore",l.SetToFailed="SetToFailed",l.Archive="Archive"))(n=e.DFUWUActions||={})})(Rt||={});var xs=class extends G{constructor(e){super(e,"FileSpray","1.27")}AbortDFUWorkunit(e){return this._connection.send("AbortDFUWorkunit",e,"json",!1,void 0,"AbortDFUWorkunitResponse")}Copy(e){return this._connection.send("Copy",e,"json",!1,void 0,"CopyResponse")}CreateDFUPublisherWorkunit(e){return this._connection.send("CreateDFUPublisherWorkunit",e,"json",!1,void 0,"CreateDFUPublisherWorkunitResponse")}CreateDFUWorkunit(e){return this._connection.send("CreateDFUWorkunit",e,"json",!1,void 0,"CreateDFUWorkunitResponse")}DFUWUFile(e){return this._connection.send("DFUWUFile",e,"json",!1,void 0,"DFUWUFileResponse")}DFUWUSearch(e){return this._connection.send("DFUWUSearch",e,"json",!1,void 0,"DFUWUSearchResponse")}DFUWorkunitsAction(e){return this._connection.send("DFUWorkunitsAction",e,"json",!1,void 0,"DFUWorkunitsActionResponse")}DeleteDFUWorkunit(e){return this._connection.send("DeleteDFUWorkunit",e,"json",!1,void 0,"DeleteDFUWorkunitResponse")}DeleteDFUWorkunits(e){return this._connection.send("DeleteDFUWorkunits",e,"json",!1,void 0,"DeleteDFUWorkunitsResponse")}DeleteDropZoneFiles(e){return this._connection.send("DeleteDropZoneFiles",e,"json",!1,void 0,"DFUWorkunitsActionResponse")}Despray(e){return this._connection.send("Despray",e,"json",!1,void 0,"DesprayResponse")}DfuMonitor(e){return this._connection.send("DfuMonitor",e,"json",!1,void 0,"DfuMonitorResponse")}DropZoneFileSearch(e){return this._connection.send("DropZoneFileSearch",e,"json",!1,void 0,"DropZoneFileSearchResponse")}DropZoneFiles(e){return this._connection.send("DropZoneFiles",e,"json",!1,void 0,"DropZoneFilesResponse")}EchoDateTime(e){return this._connection.send("EchoDateTime",e,"json",!1,void 0,"EchoDateTimeResponse")}FileList(e){return this._connection.send("FileList",e,"json",!1,void 0,"FileListResponse")}GetDFUExceptions(e){return this._connection.send("GetDFUExceptions",e,"json",!1,void 0,"GetDFUExceptionsResponse")}GetDFUProgress(e){return this._connection.send("GetDFUProgress",e,"json",!1,void 0,"ProgressResponse")}GetDFUServerQueues(e){return this._connection.send("GetDFUServerQueues",e,"json",!1,void 0,"GetDFUServerQueuesResponse")}GetDFUWorkunit(e){return this._connection.send("GetDFUWorkunit",e,"json",!1,void 0,"GetDFUWorkunitResponse")}GetDFUWorkunits(e){return this._connection.send("GetDFUWorkunits",e,"json",!1,void 0,"GetDFUWorkunitsResponse")}GetRemoteTargets(e){return this._connection.send("GetRemoteTargets",e,"json",!1,void 0,"GetRemoteTargetsResponse")}GetSprayTargets(e){return this._connection.send("GetSprayTargets",e,"json",!1,void 0,"GetSprayTargetsResponse")}OpenSave(e){return this._connection.send("OpenSave",e,"json",!1,void 0,"OpenSaveResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"FileSprayPingResponse")}Rename(e){return this._connection.send("Rename",e,"json",!1,void 0,"RenameResponse")}Replicate(e){return this._connection.send("Replicate",e,"json",!1,void 0,"ReplicateResponse")}ShowResult(e){return this._connection.send("ShowResult",e,"json",!1,void 0,"ShowResultResponse")}SprayFixed(e){return this._connection.send("SprayFixed",e,"json",!1,void 0,"SprayFixedResponse")}SprayVariable(e){return this._connection.send("SprayVariable",e,"json",!1,void 0,"SprayResponse")}SubmitDFUWorkunit(e){return this._connection.send("SubmitDFUWorkunit",e,"json",!1,void 0,"SubmitDFUWorkunitResponse")}UpdateDFUWorkunit(e){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,void 0,"UpdateDFUWorkunitResponse")}};var Nr=(p=>(p[p.unknown=0]="unknown",p[p.scheduled=1]="scheduled",p[p.queued=2]="queued",p[p.started=3]="started",p[p.aborted=4]="aborted",p[p.failed=5]="failed",p[p.finished=6]="finished",p[p.monitoring=7]="monitoring",p[p.aborting=8]="aborting",p[p.notfound=999]="notfound",p))(Nr||{}),qe=class extends xs{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 Pn;(o=>{let n;(R=>(R.User="User",R.Group="Group"))(n=o.ViewMemberType||={});let e;(y=>(y.username="username",y.fullname="fullname",y.passwordexpiration="passwordexpiration",y.employeeID="employeeID",y.employeeNumber="employeeNumber"))(e=o.UserSortBy||={});let t;(R=>(R.Name="Name",R.ManagedBy="ManagedBy"))(t=o.GroupSortBy||={});let s;(p=>(p.Any="Any",p.User="User",p.Group="Group"))(s=o.AccountTypeReq||={});let r;(R=>(R.Name="Name",R.Type="Type"))(r=o.ResourcePermissionSortBy||={});let i;(l=>l.Name="Name")(i=o.ResourceSortBy||={})})(Pn||={});var As=class extends G{constructor(e){super(e,"ws_access","1.17")}AccountPermissions(e){return this._connection.send("AccountPermissions",e,"json",!1,void 0,"AccountPermissionsResponse")}AccountPermissionsV2(e){return this._connection.send("AccountPermissionsV2",e,"json",!1,void 0,"AccountPermissionsV2Response")}AddUser(e){return this._connection.send("AddUser",e,"json",!1,void 0,"AddUserResponse")}AddView(e){return this._connection.send("AddView",e,"json",!1,void 0,"AddViewResponse")}AddViewColumn(e){return this._connection.send("AddViewColumn",e,"json",!1,void 0,"AddViewColumnResponse")}AddViewMember(e){return this._connection.send("AddViewMember",e,"json",!1,void 0,"AddViewMemberResponse")}ClearPermissionsCache(e){return this._connection.send("ClearPermissionsCache",e,"json",!1,void 0,"ClearPermissionsCacheResponse")}DeleteView(e){return this._connection.send("DeleteView",e,"json",!1,void 0,"DeleteViewResponse")}DeleteViewColumn(e){return this._connection.send("DeleteViewColumn",e,"json",!1,void 0,"DeleteViewColumnResponse")}DeleteViewMember(e){return this._connection.send("DeleteViewMember",e,"json",!1,void 0,"DeleteViewMemberResponse")}DisableScopeScans(e){return this._connection.send("DisableScopeScans",e,"json",!1,void 0,"DisableScopeScansResponse")}EnableScopeScans(e){return this._connection.send("EnableScopeScans",e,"json",!1,void 0,"EnableScopeScansResponse")}FilePermission(e){return this._connection.send("FilePermission",e,"json",!1,void 0,"FilePermissionResponse")}GroupAction(e){return this._connection.send("GroupAction",e,"json",!1,void 0,"GroupActionResponse")}GroupAdd(e){return this._connection.send("GroupAdd",e,"json",!1,void 0,"GroupAddResponse")}GroupEdit(e){return this._connection.send("GroupEdit",e,"json",!1,void 0,"GroupEditResponse")}GroupMemberEdit(e){return this._connection.send("GroupMemberEdit",e,"json",!1,void 0,"GroupMemberEditResponse")}GroupMemberEditInput(e){return this._connection.send("GroupMemberEditInput",e,"json",!1,void 0,"GroupMemberEditInputResponse")}GroupMemberQuery(e){return this._connection.send("GroupMemberQuery",e,"json",!1,void 0,"GroupMemberQueryResponse")}GroupQuery(e){return this._connection.send("GroupQuery",e,"json",!1,void 0,"GroupQueryResponse")}Groups(e){return this._connection.send("Groups",e,"json",!1,void 0,"GroupResponse")}PermissionAction(e){return this._connection.send("PermissionAction",e,"json",!1,void 0,"PermissionActionResponse")}Permissions(e){return this._connection.send("Permissions",e,"json",!1,void 0,"BasednsResponse")}PermissionsReset(e){return this._connection.send("PermissionsReset",e,"json",!1,void 0,"PermissionsResetResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_accessPingResponse")}QueryScopeScansEnabled(e){return this._connection.send("QueryScopeScansEnabled",e,"json",!1,void 0,"QueryScopeScansEnabledResponse")}QueryUserViewColumns(e){return this._connection.send("QueryUserViewColumns",e,"json",!1,void 0,"QueryUserViewColumnsResponse")}QueryViewColumns(e){return this._connection.send("QueryViewColumns",e,"json",!1,void 0,"QueryViewColumnsResponse")}QueryViewMembers(e){return this._connection.send("QueryViewMembers",e,"json",!1,void 0,"QueryViewMembersResponse")}QueryViews(e){return this._connection.send("QueryViews",e,"json",!1,void 0,"QueryViewsResponse")}ResourceAdd(e){return this._connection.send("ResourceAdd",e,"json",!1,void 0,"ResourceAddResponse")}ResourceDelete(e){return this._connection.send("ResourceDelete",e,"json",!1,void 0,"ResourceDeleteResponse")}ResourcePermissionQuery(e){return this._connection.send("ResourcePermissionQuery",e,"json",!1,void 0,"ResourcePermissionQueryResponse")}ResourcePermissions(e){return this._connection.send("ResourcePermissions",e,"json",!1,void 0,"ResourcePermissionsResponse")}ResourceQuery(e){return this._connection.send("ResourceQuery",e,"json",!1,void 0,"ResourceQueryResponse")}Resources(e){return this._connection.send("Resources",e,"json",!1,void 0,"ResourcesResponse")}UserAccountExport(e){return this._connection.send("UserAccountExport",e,"json",!1,void 0,"UserAccountExportResponse")}UserAction(e){return this._connection.send("UserAction",e,"json",!1,void 0,"UserActionResponse")}UserEdit(e){return this._connection.send("UserEdit",e,"json",!1,void 0,"UserEditResponse")}UserGroupEdit(e){return this._connection.send("UserGroupEdit",e,"json",!1,void 0,"UserGroupEditResponse")}UserGroupEditInput(e){return this._connection.send("UserGroupEditInput",e,"json",!1,void 0,"UserGroupEditInputResponse")}UserInfoEdit(e){return this._connection.send("UserInfoEdit",e,"json",!1,void 0,"UserInfoEditResponse")}UserInfoEditInput(e){return this._connection.send("UserInfoEditInput",e,"json",!1,void 0,"UserInfoEditInputResponse")}UserPosix(e){return this._connection.send("UserPosix",e,"json",!1,void 0,"UserPosixResponse")}UserPosixInput(e){return this._connection.send("UserPosixInput",e,"json",!1,void 0,"UserPosixInputResponse")}UserQuery(e){return this._connection.send("UserQuery",e,"json",!1,void 0,"UserQueryResponse")}UserResetPass(e){return this._connection.send("UserResetPass",e,"json",!1,void 0,"UserResetPassResponse")}UserResetPassInput(e){return this._connection.send("UserResetPassInput",e,"json",!1,void 0,"UserResetPassInputResponse")}UserSudoers(e){return this._connection.send("UserSudoers",e,"json",!1,void 0,"UserSudoersResponse")}UserSudoersInput(e){return this._connection.send("UserSudoersInput",e,"json",!1,void 0,"UserSudoersInputResponse")}Users(e){return this._connection.send("Users",e,"json",!1,void 0,"UserResponse")}};var In=class extends As{};var Ws=class extends G{constructor(e){super(e,"ws_account","1.07")}MyAccount(e){return this._connection.send("MyAccount",e,"json",!1,void 0,"MyAccountResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_accountPingResponse")}UpdateUser(e){return this._connection.send("UpdateUser",e,"json",!1,void 0,"UpdateUserResponse")}UpdateUserInput(e){return this._connection.send("UpdateUserInput",e,"json",!1,void 0,"UpdateUserInputResponse")}VerifyUser(e){return this._connection.send("VerifyUser",e,"json",!1,void 0,"VerifyUserResponse")}};var Mn=class extends Ws{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 Br=require("@hpcc-js/util");var Us=class extends G{constructor(e){super(e,"WsCloud","1.02")}GetPODs(e){return this._connection.send("GetPODs",e,"json",!1,void 0,"GetPODsResponse")}GetServices(e){return this._connection.send("GetServices",e,"json",!1,void 0,"GetServicesResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsCloudPingResponse")}};var So=(0,Br.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 Ao(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 Us{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 Ao(t?.items??[])}catch(t){return So.error(`Error parsing V1Pods json '${t instanceof Error?t.message:String(t)}'`),[]}})}};var Fs;(e=>{let n;(s=>s.gpg="gpg")(n=e.SigningMethodType||={})})(Fs||={});var Es=class extends G{constructor(e){super(e,"ws_codesign","1.1")}ListUserIDs(e){return this._connection.send("ListUserIDs",e,"json",!1,void 0,"ListUserIDsResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_codesignPingResponse")}Sign(e){return this._connection.send("Sign",e,"json",!1,void 0,"SignResponse")}Verify(e){return this._connection.send("Verify",e,"json",!1,void 0,"VerifyResponse")}};var wn=class extends Es{ListUserIDsEx(e){return super.ListUserIDs(e).then(t=>t.UserIDs.Item).catch(t=>[])}Sign(e){return super.Sign({SigningMethod:Fs.SigningMethodType.gpg,...e})}};var bs=class extends G{constructor(e){super(e,"WSDali","1.07")}Add(e){return this._connection.send("Add",e,"json",!1,void 0,"ResultResponse")}ClearTraceTransactions(e){return this._connection.send("ClearTraceTransactions",e,"json",!1,void 0,"ResultResponse")}Count(e){return this._connection.send("Count",e,"json",!1,void 0,"CountResponse")}DFSCheck(e){return this._connection.send("DFSCheck",e,"json",!1,void 0,"ResultResponse")}DFSExists(e){return this._connection.send("DFSExists",e,"json",!1,void 0,"BooleanResponse")}DFSLS(e){return this._connection.send("DFSLS",e,"json",!1,void 0,"ResultResponse")}Delete(e){return this._connection.send("Delete",e,"json",!1,void 0,"ResultResponse")}DisconnectClientConnection(e){return this._connection.send("DisconnectClientConnection",e,"json",!1,void 0,"ResultResponse")}GetClients(e){return this._connection.send("GetClients",e,"json",!1,void 0,"ResultResponse")}GetConnections(e){return this._connection.send("GetConnections",e,"json",!1,void 0,"ResultResponse")}GetDFSCSV(e){return this._connection.send("GetDFSCSV",e,"json",!1,void 0,"ResultResponse")}GetDFSMap(e){return this._connection.send("GetDFSMap",e,"json",!1,void 0,"ResultResponse")}GetDFSParents(e){return this._connection.send("GetDFSParents",e,"json",!1,void 0,"ResultResponse")}GetLogicalFile(e){return this._connection.send("GetLogicalFile",e,"json",!1,void 0,"ResultResponse")}GetLogicalFilePart(e){return this._connection.send("GetLogicalFilePart",e,"json",!1,void 0,"ResultResponse")}GetProtectedList(e){return this._connection.send("GetProtectedList",e,"json",!1,void 0,"ResultResponse")}GetSDSStats(e){return this._connection.send("GetSDSStats",e,"json",!1,void 0,"ResultResponse")}GetSDSSubscribers(e){return this._connection.send("GetSDSSubscribers",e,"json",!1,void 0,"ResultResponse")}GetValue(e){return this._connection.send("GetValue",e,"json",!1,void 0,"ResultResponse")}Import(e){return this._connection.send("Import",e,"json",!1,void 0,"ResultResponse")}ListSDSLocks(e){return this._connection.send("ListSDSLocks",e,"json",!1,void 0,"ResultResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WSDaliPingResponse")}SaveSDSStore(e){return this._connection.send("SaveSDSStore",e,"json",!1,void 0,"ResultResponse")}SetLogicalFilePartAttr(e){return this._connection.send("SetLogicalFilePartAttr",e,"json",!1,void 0,"ResultResponse")}SetProtected(e){return this._connection.send("SetProtected",e,"json",!1,void 0,"ResultResponse")}SetTraceSlowTransactions(e){return this._connection.send("SetTraceSlowTransactions",e,"json",!1,void 0,"ResultResponse")}SetTraceTransactions(e){return this._connection.send("SetTraceTransactions",e,"json",!1,void 0,"ResultResponse")}SetUnprotected(e){return this._connection.send("SetUnprotected",e,"json",!1,void 0,"ResultResponse")}SetValue(e){return this._connection.send("SetValue",e,"json",!1,void 0,"ResultResponse")}UnlockSDSLock(e){return this._connection.send("UnlockSDSLock",e,"json",!1,void 0,"ResultResponse")}};var Nn=class extends bs{};var ct;(u=>{let n;(y=>(y.Delete="Delete",y.AddToSuperfile="Add To Superfile",y.ChangeProtection="Change Protection",y.ChangeRestriction="Change Restriction"))(n=u.DFUArrayActions||={});let e;(y=>(y[y.NoChange=0]="NoChange",y[y.Protect=1]="Protect",y[y.Unprotect=2]="Unprotect",y[y.UnprotectAll=3]="UnprotectAll"))(e=u.DFUChangeProtection||={});let t;(F=>(F[F.NoChange=0]="NoChange",F[F.Restrict=1]="Restrict",F[F.Unrestricted=2]="Unrestricted"))(t=u.DFUChangeRestriction||={});let s;(p=>(p.xml="xml",p.def="def"))(s=u.DFUDefFileFormat||={});let r;(F=>(F.Token="Token",F.Engine="Engine",F.External="External"))(r=u.FileAccessRole||={});let i;(M=>(M.None="None",M.Access="Access",M.Read="Read",M.Write="Write",M.Full="Full"))(i=u.SecAccessType||={});let o;(N=>(N.Flat="Flat",N.Index="Index",N.Xml="Xml",N.Csv="Csv",N.Json="Json",N.IndexLocal="IndexLocal",N.IndexPartitioned="IndexPartitioned",N.Unset="Unset"))(o=u.DFUFileType||={})})(ct||={});var Ps=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 Wo=ct.DFUArrayActions,Uo=ct.DFUDefFileFormat,Eo=ct.DFUChangeProtection,Fo=ct.DFUChangeRestriction,St=class extends Ps{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 Is=class extends G{constructor(e){super(e,"WsDFUXRef","1.04")}DFUXRefArrayAction(e){return this._connection.send("DFUXRefArrayAction",e,"json",!1,void 0,"DFUXRefArrayActionResponse")}DFUXRefBuild(e){return this._connection.send("DFUXRefBuild",e,"json",!1,void 0,"DFUXRefBuildResponse")}DFUXRefBuildCancel(e){return this._connection.send("DFUXRefBuildCancel",e,"json",!1,void 0,"DFUXRefBuildCancelResponse")}DFUXRefCleanDirectories(e){return this._connection.send("DFUXRefCleanDirectories",e,"json",!1,void 0,"DFUXRefCleanDirectoriesResponse")}DFUXRefDirectories(e){return this._connection.send("DFUXRefDirectories",e,"json",!1,void 0,"DFUXRefDirectoriesQueryResponse")}DFUXRefFoundFiles(e){return this._connection.send("DFUXRefFoundFiles",e,"json",!1,void 0,"DFUXRefFoundFilesQueryResponse")}DFUXRefList(e){return this._connection.send("DFUXRefList",e,"json",!1,void 0,"DFUXRefListResponse")}DFUXRefLostFiles(e){return this._connection.send("DFUXRefLostFiles",e,"json",!1,void 0,"DFUXRefLostFilesQueryResponse")}DFUXRefMessages(e){return this._connection.send("DFUXRefMessages",e,"json",!1,void 0,"DFUXRefMessagesQueryResponse")}DFUXRefOrphanFiles(e){return this._connection.send("DFUXRefOrphanFiles",e,"json",!1,void 0,"DFUXRefOrphanFilesQueryResponse")}DFUXRefUnusedFiles(e){return this._connection.send("DFUXRefUnusedFiles",e,"json",!1,void 0,"DFUXRefUnusedFilesResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsDFUXRefPingResponse")}};var Bn=class extends Is{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 Qr(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:bo(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(Qr(t,n[t]));return e}function bo(n){let e={};for(let t in n)e[t]=Qr(t,n[t]);return e}var Lt=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 Xe(r,s,{Source:"wsEcl.submit",Exception:i.Results.Exception});return i.Results})}};var Ms=class extends G{constructor(e){super(e,"ws_elk","1")}GetConfigDetails(e){return this._connection.send("GetConfigDetails",e,"json",!1,void 0,"GetConfigDetailsResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_elkPingResponse")}};var Ln=class extends Ms{};var Gr=require("@hpcc-js/util");var $;(l=>{let n;(P=>(P.global="global",P.workunits="workunits",P.components="components",P.audience="audience",P.class="class",P.instance="instance",P.node="node",P.message="message",P.logid="logid",P.processid="processid",P.threadid="threadid",P.timestamp="timestamp",P.pod="pod",P.traceid="traceid",P.spanid="spanid"))(n=l.LogColumnType||={});let e;(Q=>(Q.string="string",Q.numeric="numeric",Q.datetime="datetime",Q.enum="enum",Q.epoch="epoch"))(e=l.LogColumnValueType||={});let t;(b=>(b[b.All=0]="All",b[b.ByJobID=1]="ByJobID",b[b.ByComponent=2]="ByComponent",b[b.ByLogType=3]="ByLogType",b[b.ByTargetAudience=4]="ByTargetAudience",b[b.BySourceInstance=5]="BySourceInstance",b[b.BySourceNode=6]="BySourceNode",b[b.ByFieldName=7]="ByFieldName",b[b.ByPod=8]="ByPod",b[b.ByTraceID=9]="ByTraceID",b[b.BySpanID=10]="BySpanID"))(t=l.LogAccessType||={});let s;(y=>(y[y.Success=0]="Success",y[y.Warning=1]="Warning",y[y.Fail=2]="Fail"))(s=l.LogAccessStatusCode||={});let r;(y=>(y[y.NONE=0]="NONE",y[y.AND=1]="AND",y[y.OR=2]="OR"))(r=l.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=l.LogSelectColumnMode||={});let o;(b=>(b[b.ByDate=0]="ByDate",b[b.ByJobID=1]="ByJobID",b[b.ByComponent=2]="ByComponent",b[b.ByLogType=3]="ByLogType",b[b.ByTargetAudience=4]="ByTargetAudience",b[b.BySourceInstance=5]="BySourceInstance",b[b.BySourceNode=6]="BySourceNode",b[b.ByFieldName=7]="ByFieldName",b[b.ByPod=8]="ByPod",b[b.ByTraceID=9]="ByTraceID",b[b.BySpanID=10]="BySpanID"))(o=l.SortColumType||={});let u;(F=>(F[F.ASC=0]="ASC",F[F.DSC=1]="DSC"))(u=l.SortDirection||={})})($||={});var Ts=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 Lr=(0,Gr.scopedLogger)("@hpcc-js/comms/services/wsLogaccess.ts");var kr=(o=>(o.Disaster="DIS",o.Error="ERR",o.Warning="WRN",o.Information="INF",o.Progress="PRO",o.Metric="MET",o))(kr||{}),vr=(r=>(r.Operator="OPR",r.User="USR",r.Programmer="PRO",r.Audit="ADT",r))(vr||{}),Gn=class extends Ts{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}async GetLogsEx(e){let t=await this.GetLogAccessInfo(),s={};t.Columns.Column.forEach(u=>s[u.LogType]=u.Name);let r=u=>{let l={};for(let R in s)u?.fields?l[R]=Object.assign({},...u.fields)[s[R]]??"":l[R]="";return l},i={Filter:{leftBinaryFilter:{BinaryLogFilter:[{leftFilter:{LogCategory:$.LogAccessType.All}}]}},Range:{StartDate:new Date(0).toISOString()},LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:$.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:$.SortColumType.ByDate,ColumnName:"",Direction:0}]}},o=[];for(let u in e){let l;u in s&&(Object.values($.LogColumnType).includes(u)?l=u:l=s[u]);let R;if(l){switch(l){case $.LogColumnType.workunits:case"hpcc.log.jobid":R=$.LogAccessType.ByJobID;break;case $.LogColumnType.audience:case"hpcc.log.audience":R=$.LogAccessType.ByTargetAudience;break;case $.LogColumnType.class:case"hpcc.log.class":R=$.LogAccessType.ByLogType;break;case $.LogColumnType.components:case"kubernetes.container.name":R=$.LogAccessType.ByComponent;break;default:R=$.LogAccessType.ByFieldName,l=s[u]}if(Array.isArray(e[u]))e[u].forEach(p=>{R===$.LogAccessType.ByComponent&&(p+="*"),o.push({LogCategory:R,SearchField:l,SearchByValue:p})});else{let p=e[u];R===$.LogAccessType.ByComponent&&(p+="*"),o.push({LogCategory:R,SearchField:l,SearchByValue:p})}}}if(o.length>2){let u=i.Filter.leftBinaryFilter.BinaryLogFilter[0];o.forEach((l,R)=>{let p=$.LogAccessFilterOperator.AND;R>0?(o[R-1].SearchField===l.SearchField&&(p=$.LogAccessFilterOperator.OR),R===o.length-1?(u.Operator=p,u.rightFilter=l):(u.Operator=p,u.rightBinaryFilter={BinaryLogFilter:[{leftFilter:l}]},u=u.rightBinaryFilter.BinaryLogFilter[0])):u.leftFilter=l})}else delete i.Filter.leftBinaryFilter,i.Filter.leftFilter={LogCategory:$.LogAccessType.All},o[0]?.SearchField&&(i.Filter.leftFilter={LogCategory:o[0]?.LogCategory,SearchField:o[0]?.SearchField,SearchByValue:o[0]?.SearchByValue}),o[1]?.SearchField&&(i.Filter.Operator=$.LogAccessFilterOperator.AND,o[0].SearchField===o[1].SearchField&&(i.Filter.Operator=$.LogAccessFilterOperator.OR),i.Filter.rightFilter={LogCategory:o[1]?.LogCategory,SearchField:o[1]?.SearchField,SearchByValue:o[1]?.SearchByValue});return e.StartDate&&(i.Range.StartDate=e.StartDate.toISOString()),e.EndDate&&(i.Range.EndDate=e.EndDate.toISOString()),this.GetLogs(i).then(u=>{try{let l=JSON.parse(u.LogLines),R=[];switch(t.RemoteLogManagerType){case"azureloganalyticscurl":case"elasticstack":case"grafanacurl":R=l.lines?.map(r)??[];break;default:Lr.warning(`Unknown RemoteLogManagerType: ${t.RemoteLogManagerType}`),R=[]}return{lines:R,total:u.TotalLogLinesAvailable??1e4}}catch(l){Lr.error(l.message??l)}return{lines:[],total:0}})}};var jr=require("@hpcc-js/util"),ze=Ae(Hr(),1);var Po;(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||={})})(Po||={});var Ns=class extends G{constructor(e){super(e,"ws_machine","1.19")}GetComponentStatus(e){return this._connection.send("GetComponentStatus",e,"json",!1,void 0,"GetComponentStatusResponse")}GetComponentUsage(e){return this._connection.send("GetComponentUsage",e,"json",!1,void 0,"GetComponentUsageResponse")}GetMachineInfo(e){return this._connection.send("GetMachineInfo",e,"json",!1,void 0,"GetMachineInfoResponse")}GetMachineInfoEx(e){return this._connection.send("GetMachineInfoEx",e,"json",!1,void 0,"GetMachineInfoResponseEx")}GetMetrics(e){return this._connection.send("GetMetrics",e,"json",!1,void 0,"MetricsResponse")}GetNodeGroupUsage(e){return this._connection.send("GetNodeGroupUsage",e,"json",!1,void 0,"GetNodeGroupUsageResponse")}GetTargetClusterInfo(e){return this._connection.send("GetTargetClusterInfo",e,"json",!1,void 0,"GetTargetClusterInfoResponse")}GetTargetClusterUsage(e){return this._connection.send("GetTargetClusterUsage",e,"json",!1,void 0,"GetTargetClusterUsageResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_machinePingResponse")}UpdateComponentStatus(e){return this._connection.send("UpdateComponentStatus",e,"json",!1,void 0,"UpdateComponentStatusResponse")}};var ke=class extends Ns{GetTargetClusterUsageEx(e,t=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:t}).then(s=>(0,jr.exists)("TargetClusterUsages.TargetClusterUsage",s)?s.TargetClusterUsages.TargetClusterUsage:[]).then(s=>s.filter(r=>!!r.ComponentUsages).map(r=>{let i=r.ComponentUsages.ComponentUsage.map(o=>{let u=(o.MachineUsages&&o.MachineUsages.MachineUsage?o.MachineUsages.MachineUsage:[]).map(l=>{let R=l.DiskUsages&&l.DiskUsages.DiskUsage?l.DiskUsages.DiskUsage.map(p=>({...p,InUse:p.InUse*1024,Total:(p.InUse+p.Available)*1024,PercentUsed:100-p.PercentAvailable})):[];return{Name:l.Name,NetAddress:l.NetAddress,Description:l.Description,DiskUsages:R,mean:(0,ze.mean)(R.filter(p=>!isNaN(p.PercentUsed)),p=>p.PercentUsed),max:(0,ze.max)(R.filter(p=>!isNaN(p.PercentUsed)),p=>p.PercentUsed)}});return{Type:o.Type,Name:o.Name,Description:o.Description,MachineUsages:u,MachineUsagesDescription:u.reduce((l,R)=>l+(R.Description||""),""),mean:(0,ze.mean)(u.filter(l=>!isNaN(l.mean)),l=>l.mean),max:(0,ze.max)(u.filter(l=>!isNaN(l.max)),l=>l.max)}});return{Name:r.Name,Description:r.Description,ComponentUsages:i,ComponentUsagesDescription:i.reduce((o,u)=>o+(u.MachineUsagesDescription||""),""),mean:(0,ze.mean)(i.filter(o=>!isNaN(o.mean)),o=>o.mean),max:(0,ze.max)(i.filter(o=>!isNaN(o.max)),o=>o.max)}}))}};var Bs=class extends G{constructor(e){super(e,"WsPackageProcess","1.07")}ActivatePackage(e){return this._connection.send("ActivatePackage",e,"json",!1,void 0,"ActivatePackageResponse")}AddPackage(e){return this._connection.send("AddPackage",e,"json",!1,void 0,"AddPackageResponse")}AddPartToPackageMap(e){return this._connection.send("AddPartToPackageMap",e,"json",!1,void 0,"AddPartToPackageMapResponse")}CopyPackageMap(e){return this._connection.send("CopyPackageMap",e,"json",!1,void 0,"CopyPackageMapResponse")}DeActivatePackage(e){return this._connection.send("DeActivatePackage",e,"json",!1,void 0,"DeActivatePackageResponse")}DeletePackage(e){return this._connection.send("DeletePackage",e,"json",!1,void 0,"DeletePackageResponse")}Echo(e){return this._connection.send("Echo",e,"json",!1,void 0,"EchoResponse")}GetPackage(e){return this._connection.send("GetPackage",e,"json",!1,void 0,"GetPackageResponse")}GetPackageMapById(e){return this._connection.send("GetPackageMapById",e,"json",!1,void 0,"GetPackageMapByIdResponse")}GetPackageMapSelectOptions(e){return this._connection.send("GetPackageMapSelectOptions",e,"json",!1,void 0,"GetPackageMapSelectOptionsResponse")}GetPartFromPackageMap(e){return this._connection.send("GetPartFromPackageMap",e,"json",!1,void 0,"GetPartFromPackageMapResponse")}GetQueryFileMapping(e){return this._connection.send("GetQueryFileMapping",e,"json",!1,void 0,"GetQueryFileMappingResponse")}ListPackage(e){return this._connection.send("ListPackage",e,"json",!1,void 0,"ListPackageResponse")}ListPackages(e){return this._connection.send("ListPackages",e,"json",!1,void 0,"ListPackagesResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsPackageProcessPingResponse")}RemovePartFromPackageMap(e){return this._connection.send("RemovePartFromPackageMap",e,"json",!1,void 0,"RemovePartFromPackageMapResponse")}ValidatePackage(e){return this._connection.send("ValidatePackage",e,"json",!1,void 0,"ValidatePackageResponse")}};var kn=class extends Bs{};var Qs=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 Qs{};var Vn;(e=>{let n;(r=>(r.ECL="ECL",r.DFU="DFU"))(n=e.WUTypes||={})})(Vn||={});var Ls=class extends G{constructor(e){super(e,"WSSasha","1.01")}ArchiveWU(e){return this._connection.send("ArchiveWU",e,"json",!1,void 0,"ResultResponse")}GetVersion(e){return this._connection.send("GetVersion",e,"json",!1,void 0,"ResultResponse")}ListWU(e){return this._connection.send("ListWU",e,"json",!1,void 0,"ResultResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WSSashaPingResponse")}RestoreWU(e){return this._connection.send("RestoreWU",e,"json",!1,void 0,"ResultResponse")}};var Hn=class extends Ls{};var jn;(t=>{let n;(l=>(l.ALL="ALL",l.READ="READ",l.WRITE="WRITE",l.HOLD="HOLD",l.SUB="SUB"))(n=t.LockModes||={});let e;(F=>(F.Attach="Attach",F.Detach="Detach",F.State="State",F.Reload="Reload",F.ReloadRetry="ReloadRetry",F.MemLock="MemLock",F.MemUnlock="MemUnlock",F.GetMemLocked="GetMemLocked"))(e=t.RoxieControlCmdType||={})})(jn||={});var Gs=class extends G{constructor(e){super(e,"WsSMC","1.28")}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")}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 yt=class extends Gs{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(t=>({Running:{ActiveWorkunit:[]},...t}))}};var ks=class extends G{constructor(e){super(e,"wsstore","1.02")}CreateStore(e){return this._connection.send("CreateStore",e,"json",!1,void 0,"CreateStoreResponse")}Delete(e){return this._connection.send("Delete",e,"json",!1,void 0,"DeleteResponse")}DeleteNamespace(e){return this._connection.send("DeleteNamespace",e,"json",!1,void 0,"DeleteNamespaceResponse")}Fetch(e){return this._connection.send("Fetch",e,"json",!1,void 0,"FetchResponse")}FetchAll(e){return this._connection.send("FetchAll",e,"json",!1,void 0,"FetchAllResponse")}FetchKeyMetadata(e){return this._connection.send("FetchKeyMetadata",e,"json",!1,void 0,"FetchKeyMDResponse")}ListKeys(e){return this._connection.send("ListKeys",e,"json",!1,void 0,"ListKeysResponse")}ListNamespaces(e){return this._connection.send("ListNamespaces",e,"json",!1,void 0,"ListNamespacesResponse")}ListStores(e){return this._connection.send("ListStores",e,"json",!1,void 0,"ListStoresResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"wsstorePingResponse")}Set(e){return this._connection.send("Set",e,"json",!1,void 0,"SetResponse")}};var xt=class extends ks{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;(u=>(u.All="All",u.QueriesOnly="QueriesOnly",u.WorkunitsOnly="WorkunitsOnly"))(e=s.RoxieQueueFilter||={});let t;(Q=>(Q.ALLNODES="ALLNODES",Q.THORMACHINES="THORMACHINES",Q.HOLEMACHINES="HOLEMACHINES",Q.ROXIEMACHINES="ROXIEMACHINES",Q.MACHINES="MACHINES",Q.AVAILABLEMACHINES="AVAILABLEMACHINES",Q.DROPZONE="DROPZONE",Q.STANDBYNNODE="STANDBYNNODE",Q.THORSPARENODES="THORSPARENODES",Q.HOLESTANDBYNODES="HOLESTANDBYNODES"))(t=s.TpMachineType||={})})(_n||={});var vs=class extends G{constructor(e){super(e,"WsTopology","1.33")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsTopologyPingResponse")}SystemLog(e){return this._connection.send("SystemLog",e,"json",!1,void 0,"SystemLogResponse")}TpClusterInfo(e){return this._connection.send("TpClusterInfo",e,"json",!1,void 0,"TpClusterInfoResponse")}TpClusterQuery(e){return this._connection.send("TpClusterQuery",e,"json",!1,void 0,"TpClusterQueryResponse")}TpComponentConfiguration(e){return this._connection.send("TpComponentConfiguration",e,"json",!1,void 0,"TpComponentConfigurationResponse")}TpConfiguredComponents(e){return this._connection.send("TpConfiguredComponents",e,"json",!1,void 0,"TpConfiguredComponentsResponse")}TpDropZoneQuery(e){return this._connection.send("TpDropZoneQuery",e,"json",!1,void 0,"TpDropZoneQueryResponse")}TpGetComponentFile(e){return this._connection.send("TpGetComponentFile",e,"json",!1,void 0,"TpGetComponentFileResponse")}TpGetServicePlugins(e){return this._connection.send("TpGetServicePlugins",e,"json",!1,void 0,"TpGetServicePluginsResponse")}TpGroupQuery(e){return this._connection.send("TpGroupQuery",e,"json",!1,void 0,"TpGroupQueryResponse")}TpListLogFiles(e){return this._connection.send("TpListLogFiles",e,"json",!1,void 0,"TpListLogFilesResponse")}TpListTargetClusters(e){return this._connection.send("TpListTargetClusters",e,"json",!1,void 0,"TpListTargetClustersResponse")}TpLogFile(e){return this._connection.send("TpLogFile",e,"json",!1,void 0,"TpLogFileResponse")}TpLogFileDisplay(e){return this._connection.send("TpLogFileDisplay",e,"json",!1,void 0,"TpLogFileResponse")}TpLogicalClusterQuery(e){return this._connection.send("TpLogicalClusterQuery",e,"json",!1,void 0,"TpLogicalClusterQueryResponse")}TpMachineInfo(e){return this._connection.send("TpMachineInfo",e,"json",!1,void 0,"TpMachineInfoResponse")}TpMachineQuery(e){return this._connection.send("TpMachineQuery",e,"json",!1,void 0,"TpMachineQueryResponse")}TpServiceQuery(e){return this._connection.send("TpServiceQuery",e,"json",!1,void 0,"TpServiceQueryResponse")}TpSetMachineStatus(e){return this._connection.send("TpSetMachineStatus",e,"json",!1,void 0,"TpSetMachineStatusResponse")}TpSwapNode(e){return this._connection.send("TpSwapNode",e,"json",!1,void 0,"TpSwapNodeResponse")}TpTargetClusterQuery(e){return this._connection.send("TpTargetClusterQuery",e,"json",!1,void 0,"TpTargetClusterQueryResponse")}TpThorStatus(e){return this._connection.send("TpThorStatus",e,"json",!1,void 0,"TpThorStatusResponse")}TpXMLFile(e){return this._connection.send("TpXMLFile",e,"json",!1,void 0,"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 Vs=require("@hpcc-js/util");var ge;(N=>{let n;(O=>(O.Abort="Abort",O.Delete="Delete",O.Deschedule="Deschedule",O.Reschedule="Reschedule",O.Pause="Pause",O.PauseNow="PauseNow",O.Protect="Protect",O.Unprotect="Unprotect",O.Restore="Restore",O.Resume="Resume",O.SetToFailed="SetToFailed",O.Archive="Archive"))(n=N.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=N.LogSelectColumnMode||={});let t;(I=>(I[I.ASC=0]="ASC",I[I.DSC=1]="DSC"))(t=N.SortDirection||={});let s;(w=>(w.ALL="ALL",w.DIS="DIS",w.ERR="ERR",w.WRN="WRN",w.INF="INF",w.PRO="PRO",w.MET="MET",w.EVT="EVT"))(s=N.LogEventClass||={});let r;(b=>(b.Single="Single",b.List="List",b.Multi="Multi"))(r=N.WUDetailsAttrValueType||={});let i;(b=>(b.SyntaxCheck="SyntaxCheck",b.Deploy="Deploy",b.Publish="Publish"))(i=N.EclDefinitionActions||={});let o;(b=>(b.xml="xml",b.json="json",b.text="text"))(o=N.ErrorMessageFormat||={});let u;(b=>(b[b.XML=0]="XML",b[b.JSON=1]="JSON",b[b.CSV=2]="CSV"))(u=N.LogAccessLogFormat||={});let l;(j=>(j.info="info",j.warning="warning",j.error="error",j.alert="alert"))(l=N.WUExceptionSeverity||={});let R;(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"))(R=N.WUQueryFilterSuspendedType||={});let p;(ue=>(ue.All="All",ue.Id="Id",ue.Name="Name",ue.Alias="Alias",ue.Status="Status"))(p=N.WUQuerySetFilterType||={});let F;(b=>(b.All="All",b.Protected="Protected",b.NotProtected="NotProtected"))(F=N.WUProtectFilter||={});let y;(k=>k.Deactivate="Deactivate")(y=N.QuerySetAliasActionTypes||={});let M;(I=>(I.None="None",I.ActivateImportedActive="ActivateImportedActive"))(M=N.QuerysetImportActivation||={});let Q;(w=>(w.Suspend="Suspend",w.Unsuspend="Unsuspend",w.ToggleSuspend="ToggleSuspend",w.Activate="Activate",w.Delete="Delete",w.DeleteQueriesAndWUs="DeleteQueriesAndWUs",w.RemoveAllAliases="RemoveAllAliases",w.ResetQueryStats="ResetQueryStats"))(Q=N.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=N.WUQueryActivationMode||={})})(ge||={});var Gt=class extends G{constructor(e){super(e,"WsWorkunits","2.02")}GVCAjaxGraph(e){return this._connection.send("GVCAjaxGraph",e,"json",!1,void 0,"GVCAjaxGraphResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsWorkunitsPingResponse")}WUAbort(e){return this._connection.send("WUAbort",e,"json",!1,void 0,"WUAbortResponse")}WUAction(e){return this._connection.send("WUAction",e,"json",!1,void 0,"WUActionResponse")}WUAddLocalFileToWorkunit(e){return this._connection.send("WUAddLocalFileToWorkunit",e,"json",!1,void 0,"WUAddLocalFileToWorkunitResponse")}WUAnalyseHotspot(e){return this._connection.send("WUAnalyseHotspot",e,"json",!1,void 0,"WUAnalyseHotspotResponse")}WUCDebug(e){return this._connection.send("WUCDebug",e,"json",!1,void 0,"WUDebugResponse")}WUCheckFeatures(e){return this._connection.send("WUCheckFeatures",e,"json",!1,void 0,"WUCheckFeaturesResponse")}WUClusterJobQueueLOG(e){return this._connection.send("WUClusterJobQueueLOG",e,"json",!1,void 0,"WUClusterJobQueueLOGResponse")}WUClusterJobQueueXLS(e){return this._connection.send("WUClusterJobQueueXLS",e,"json",!1,void 0,"WUClusterJobQueueXLSResponse")}WUClusterJobSummaryXLS(e){return this._connection.send("WUClusterJobSummaryXLS",e,"json",!1,void 0,"WUClusterJobSummaryXLSResponse")}WUClusterJobXLS(e){return this._connection.send("WUClusterJobXLS",e,"json",!1,void 0,"WUClusterJobXLSResponse")}WUCompileECL(e){return this._connection.send("WUCompileECL",e,"json",!1,void 0,"WUCompileECLResponse")}WUCopyLogicalFiles(e){return this._connection.send("WUCopyLogicalFiles",e,"json",!1,void 0,"WUCopyLogicalFilesResponse")}WUCopyQuerySet(e){return this._connection.send("WUCopyQuerySet",e,"json",!1,void 0,"WUCopyQuerySetResponse")}WUCreate(e){return this._connection.send("WUCreate",e,"json",!1,void 0,"WUCreateResponse")}WUCreateAndUpdate(e){return this._connection.send("WUCreateAndUpdate",e,"json",!1,void 0,"WUUpdateResponse")}WUCreateZAPInfo(e){return this._connection.send("WUCreateZAPInfo",e,"json",!1,void 0,"WUCreateZAPInfoResponse")}WUDelete(e){return this._connection.send("WUDelete",e,"json",!1,void 0,"WUDeleteResponse")}WUDeployWorkunit(e){return this._connection.send("WUDeployWorkunit",e,"json",!1,void 0,"WUDeployWorkunitResponse")}WUDetails(e){return this._connection.send("WUDetails",e,"json",!1,void 0,"WUDetailsResponse")}WUDetailsMeta(e){return this._connection.send("WUDetailsMeta",e,"json",!1,void 0,"WUDetailsMetaResponse")}WUEclDefinitionAction(e){return this._connection.send("WUEclDefinitionAction",e,"json",!1,void 0,"WUEclDefinitionActionResponse")}WUExport(e){return this._connection.send("WUExport",e,"json",!1,void 0,"WUExportResponse")}WUFile(e){return this._connection.send("WUFile",e,"json",!1,void 0,"WULogFileResponse")}WUFullResult(e){return this._connection.send("WUFullResult",e,"json",!1,void 0,"WUFullResultResponse")}WUGVCGraphInfo(e){return this._connection.send("WUGVCGraphInfo",e,"json",!1,void 0,"WUGVCGraphInfoResponse")}WUGetArchiveFile(e){return this._connection.send("WUGetArchiveFile",e,"json",!1,void 0,"WUGetArchiveFileResponse")}WUGetDependancyTrees(e){return this._connection.send("WUGetDependancyTrees",e,"json",!1,void 0,"WUGetDependancyTreesResponse")}WUGetGraph(e){return this._connection.send("WUGetGraph",e,"json",!1,void 0,"WUGetGraphResponse")}WUGetGraphNameAndTypes(e){return this._connection.send("WUGetGraphNameAndTypes",e,"json",!1,void 0,"WUGetGraphNameAndTypesResponse")}WUGetNumFileToCopy(e){return this._connection.send("WUGetNumFileToCopy",e,"json",!1,void 0,"WUGetNumFileToCopyResponse")}WUGetPlugins(e){return this._connection.send("WUGetPlugins",e,"json",!1,void 0,"WUGetPluginsResponse")}WUGetStats(e){return this._connection.send("WUGetStats",e,"json",!1,void 0,"WUGetStatsResponse")}WUGetThorJobList(e){return this._connection.send("WUGetThorJobList",e,"json",!1,void 0,"WUGetThorJobListResponse")}WUGetThorJobQueue(e){return this._connection.send("WUGetThorJobQueue",e,"json",!1,void 0,"WUGetThorJobQueueResponse")}WUGetZAPInfo(e){return this._connection.send("WUGetZAPInfo",e,"json",!1,void 0,"WUGetZAPInfoResponse")}WUGraphInfo(e){return this._connection.send("WUGraphInfo",e,"json",!1,void 0,"WUGraphInfoResponse")}WUGraphTiming(e){return this._connection.send("WUGraphTiming",e,"json",!1,void 0,"WUGraphTimingResponse")}WUInfo(e){return this._connection.send("WUInfo",e,"json",!1,void 0,"WUInfoResponse")}WUInfoDetails(e){return this._connection.send("WUInfoDetails",e,"json",!1,void 0,"WUInfoResponse")}WUJobList(e){return this._connection.send("WUJobList",e,"json",!1,void 0,"WUJobListResponse")}WULightWeightQuery(e){return this._connection.send("WULightWeightQuery",e,"json",!1,void 0,"WULightWeightQueryResponse")}WUListArchiveFiles(e){return this._connection.send("WUListArchiveFiles",e,"json",!1,void 0,"WUListArchiveFilesResponse")}WUListLocalFileRequired(e){return this._connection.send("WUListLocalFileRequired",e,"json",!1,void 0,"WUListLocalFileRequiredResponse")}WUListQueries(e){return this._connection.send("WUListQueries",e,"json",!1,void 0,"WUListQueriesResponse")}WUListQueriesUsingFile(e){return this._connection.send("WUListQueriesUsingFile",e,"json",!1,void 0,"WUListQueriesUsingFileResponse")}WUMultiQuerysetDetails(e){return this._connection.send("WUMultiQuerysetDetails",e,"json",!1,void 0,"WUMultiQuerySetDetailsResponse")}WUProcessGraph(e){return this._connection.send("WUProcessGraph",e,"json",!1,void 0,"WUProcessGraphResponse")}WUProtect(e){return this._connection.send("WUProtect",e,"json",!1,void 0,"WUProtectResponse")}WUPublishWorkunit(e){return this._connection.send("WUPublishWorkunit",e,"json",!1,void 0,"WUPublishWorkunitResponse")}WUPushEvent(e){return this._connection.send("WUPushEvent",e,"json",!1,void 0,"WUPushEventResponse")}WUQuery(e){return this._connection.send("WUQuery",e,"json",!1,void 0,"WUQueryResponse")}WUQueryConfig(e){return this._connection.send("WUQueryConfig",e,"json",!1,void 0,"WUQueryConfigResponse")}WUQueryDetails(e){return this._connection.send("WUQueryDetails",e,"json",!1,void 0,"WUQueryDetailsResponse")}WUQueryDetailsLightWeight(e){return this._connection.send("WUQueryDetailsLightWeight",e,"json",!1,void 0,"WUQueryDetailsResponse")}WUQueryFiles(e){return this._connection.send("WUQueryFiles",e,"json",!1,void 0,"WUQueryFilesResponse")}WUQueryGetGraph(e){return this._connection.send("WUQueryGetGraph",e,"json",!1,void 0,"WUQueryGetGraphResponse")}WUQueryGetSummaryStats(e){return this._connection.send("WUQueryGetSummaryStats",e,"json",!1,void 0,"WUQueryGetSummaryStatsResponse")}WUQuerysetAliasAction(e){return this._connection.send("WUQuerysetAliasAction",e,"json",!1,void 0,"WUQuerySetAliasActionResponse")}WUQuerysetCopyQuery(e){return this._connection.send("WUQuerysetCopyQuery",e,"json",!1,void 0,"WUQuerySetCopyQueryResponse")}WUQuerysetDetails(e){return this._connection.send("WUQuerysetDetails",e,"json",!1,void 0,"WUQuerySetDetailsResponse")}WUQuerysetExport(e){return this._connection.send("WUQuerysetExport",e,"json",!1,void 0,"WUQuerysetExportResponse")}WUQuerysetImport(e){return this._connection.send("WUQuerysetImport",e,"json",!1,void 0,"WUQuerysetImportResponse")}WUQuerysetQueryAction(e){return this._connection.send("WUQuerysetQueryAction",e,"json",!1,void 0,"WUQuerySetQueryActionResponse")}WUQuerysets(e){return this._connection.send("WUQuerysets",e,"json",!1,void 0,"WUQuerysetsResponse")}WURecreateQuery(e){return this._connection.send("WURecreateQuery",e,"json",!1,void 0,"WURecreateQueryResponse")}WUResubmit(e){return this._connection.send("WUResubmit",e,"json",!1,void 0,"WUResubmitResponse")}WUResult(e){return this._connection.send("WUResult",e,"json",!1,void 0,"WUResultResponse")}WUResultBin(e){return this._connection.send("WUResultBin",e,"json",!1,void 0,"WUResultBinResponse")}WUResultSummary(e){return this._connection.send("WUResultSummary",e,"json",!1,void 0,"WUResultSummaryResponse")}WUResultView(e){return this._connection.send("WUResultView",e,"json",!1,void 0,"WUResultViewResponse")}WURun(e){return this._connection.send("WURun",e,"json",!1,void 0,"WURunResponse")}WUSchedule(e){return this._connection.send("WUSchedule",e,"json",!1,void 0,"WUScheduleResponse")}WUShowScheduled(e){return this._connection.send("WUShowScheduled",e,"json",!1,void 0,"WUShowScheduledResponse")}WUSubmit(e){return this._connection.send("WUSubmit",e,"json",!1,void 0,"WUSubmitResponse")}WUSyntaxCheckECL(e){return this._connection.send("WUSyntaxCheckECL",e,"json",!1,void 0,"WUSyntaxCheckResponse")}WUUpdate(e){return this._connection.send("WUUpdate",e,"json",!1,void 0,"WUUpdateResponse")}WUUpdateQueryEntry(e){return this._connection.send("WUUpdateQueryEntry",e,"json",!1,void 0,"WUUpdateQueryEntryResponse")}WUWaitCompiled(e){return this._connection.send("WUWaitCompiled",e,"json",!1,void 0,"WUWaitResponse")}WUWaitComplete(e){return this._connection.send("WUWaitComplete",e,"json",!1,void 0,"WUWaitResponse")}};var Hs=(I=>(I[I.Unknown=0]="Unknown",I[I.Compiled=1]="Compiled",I[I.Running=2]="Running",I[I.Completed=3]="Completed",I[I.Failed=4]="Failed",I[I.Archived=5]="Archived",I[I.Aborting=6]="Aborting",I[I.Aborted=7]="Aborted",I[I.Blocked=8]="Blocked",I[I.Submitted=9]="Submitted",I[I.Scheduled=10]="Scheduled",I[I.Compiling=11]="Compiling",I[I.Wait=12]="Wait",I[I.UploadingFiled=13]="UploadingFiled",I[I.DebugPaused=14]="DebugPaused",I[I.DebugRunning=15]="DebugRunning",I[I.Paused=16]="Paused",I[I.LAST=17]="LAST",I[I.NotFound=999]="NotFound",I))(Hs||{}),Je;(e=>{let n;(y=>(y[y.Unknown=0]="Unknown",y[y.Compile=1]="Compile",y[y.Check=2]="Check",y[y.Run=3]="Run",y[y.ExecuteExisting=4]="ExecuteExisting",y[y.Pause=5]="Pause",y[y.PauseNow=6]="PauseNow",y[y.Resume=7]="Resume",y[y.Debug=8]="Debug",y[y.__size=9]="__size"))(n=e.Action||={})})(Je||={});function On(n){return typeof n.Name=="string"}function Io(n){return n.TotalClusterTime!==void 0}function Mo(n){return n.StateEx!==void 0}var re=class extends Gt{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,Vs.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,Vs.xml2json)(t.Result).children();return r.length?r[0]:null})}},kt=class extends Gt{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};var on=require("@hpcc-js/util");var We=require("@hpcc-js/util"),ti=Ae(Yn(),1),nn=Ae(zr(),1);var ae=require("@hpcc-js/util"),vt=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=>jt(t)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(t=>jt(t))}},Vt=class extends ae.Cache{constructor(){super(e=>ae.Cache.hash([e.Name]))}};function Jr(n,e,t){t=t||[],t.push(n),e(n.name,n.$,n.children(),t),n.children().forEach(s=>{Jr(s,e,t)}),t.pop()}function Xn(n){let e={};return n.forEach(t=>{t.name==="att"&&(e[t.$.name]=t.$.value)}),e}var Ys=class extends ae.Graph{},qn=class extends ae.Subgraph{},zn=class extends ae.Vertex{},Jn=class extends ae.Edge{};function er(n,e){let t={},s={},r={},i=new Ys(u=>u._.id),o=[i.root];return Jr(e,(u,l,R,p)=>{let F=o[o.length-1];switch(u){case"graph":break;case"node":if(R.length&&R[0].children().length&&R[0].children()[0].name==="graph"){let Q=F.createSubgraph(Xn(R));o.push(Q),t[l.id]=Q}let y=F.createVertex(Xn(R));s[l.id]=y;break;case"edge":let M=F.createEdge(s[l.source],s[l.target],Xn(R));r[l.id]=M;break;default:}}),i}var Ht=class extends ae.Graph{},Kn=class extends ae.Subgraph{},Zn=class extends ae.Vertex{},$n=class extends ae.Edge{};function jt(n){let e={},t={},s={},r;for(let i of n)switch(i.ScopeType){case"graph":r=new Ht(p=>p._.Id,i),e[i.ScopeName]=r.root;break;case"subgraph":r||(r=new Ht(p=>p._.Id,i),e[i.ScopeName]=r.root);let o=i.parentScope().split(":"),u=e[i.parentScope()];for(;o.length&&!u;)u=e[o.join(":")],o.pop();if(!u)console.warn(`Missing SG:Parent (${i.Id}): ${i.parentScope()}`);else{let p=u;e[i.ScopeName]=p.createSubgraph(i)}break;case"activity":let l=e[i.parentScope()];l?s[i.ScopeName]=l.createVertex(i):console.warn(`Missing A:Parent (${i.Id}): ${i.parentScope()}`);break;case"edge":t[i.ScopeName]=i;break;case"function":let R=s[i.parentScope()];R?R._.children().push(i):console.warn(`Missing F:Parent (${i.Id}): ${i.parentScope()}`);break}for(let i in t){let o=t[i],u=e[o.parentScope()];if(!u)console.warn(`Missing E:Parent (${o.Id}): ${o.parentScope()}`);else{let l=u;try{let R=r.vertex(o.attr("IdSource").RawValue),p=r.vertex(o.attr("IdTarget").RawValue);l.createEdge(R,p,o)}catch{console.warn(`Invalid Edge: ${i}`)}}}return r}var Kr=require("@hpcc-js/util"),_t=class extends Kr.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="",u="";s.indexOf(i)===0&&(o=s.substr(i.length),u=r[r.length-1]),this.set({URL:t,DisplayName:u,DisplayPath:o})}};var Le=require("@hpcc-js/util");var zt=require("@hpcc-js/util"),Ot=class{e;constructor(e){this.e=e}fix(){delete this.e}},Yt=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}},Xt=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()}},qt=class{root;simpleTypes={};fields(){return this.root.children()}},Xs=class extends zt.SAXStackParser{schema=new qt;simpleType;simpleTypes={};xsdStack=new zt.Stack;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":let t=new Yt(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 Xt(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 qs(n){let e=new Xs;return e.parse(n),e.schema}var tr=class extends Xs{_rootName;schema=new qt;simpleTypes={};xsdStack=new zt.Stack;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":let t=new Yt(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 Xt(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 To(n,e){let t=new tr(e);return t.parse(n),t.schema}var Js=class extends Le.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}},zs=new Js,Jt=class n extends Le.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=zs.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=zs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+s},()=>new n(e,t,s)):typeof s=="string"&&(i=zs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new n(e,t,s)))),i}static attachLogicalFile(e,t,s){return zs.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}):On(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=qs(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 u=o??this._bypassCache;return this.WUResult(e,t,!s,r,i,u).then(l=>{let R=l.Result;return delete l.Result,this.set({...l}),(0,Le.exists)("XmlSchema.xml",R)&&(this.xsdSchema=qs(R.XmlSchema.xml)),(0,Le.exists)("Row",R)?R.Row:this.ResultName&&(0,Le.exists)(this.ResultName,R)?R[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 u={NamedValue:{itemcount:0}};for(let R in r)u.NamedValue[u.NamedValue.itemcount++]={Name:R,Value:r[R]};let l={FilterBy:u};return this.Wuid&&this.ResultName!==void 0?(l.Wuid=this.Wuid,l.ResultName=this.ResultName):this.Wuid&&this.ResultSequence!==void 0?(l.Wuid=this.Wuid,l.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(l.LogicalName=this.LogicalFileName,l.Cluster=this.NodeGroup):this.LogicalFileName&&(l.LogicalName=this.LogicalFileName),l.Start=e,l.Count=t,l.SuppressXmlSchema=s,l.BypassCachedResult=o,this.connection.WUResult(l,i).then(R=>R)}},Kt=class extends Le.Cache{constructor(){super(e=>Le.Cache.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};var sr=require("@hpcc-js/util"),Ke=class extends sr.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)}},Ks=class extends sr.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 Ke(this,s))}),t.start&&t.end?(t.start.FormattedEnd=t.end.Formatted,e.push(new Ke(this,t.start))):t.start?e.push(new Ke(this,t.start)):t.end&&e.push(new Ke(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 Ke(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let t="",s=[];t=this.Id,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 Ks{wu;constructor(e,t){super(t),this.wu=e}};var Zr=require("@hpcc-js/util");var Zt=class extends Zr.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 Zs=require("@hpcc-js/util");var $t=class extends Zs.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,Zs.espTime2Seconds)(s.Value);this.set({Wuid:t,Seconds:Math.round(r*1e3)/1e3,HasSubGraphId:s.SubGraphId!==void 0,...s})}};var wo=(0,nn.utcFormat)("%Y-%m-%dT%H:%M:%S.%LZ"),No=(0,nn.utcParse)("%Y-%m-%dT%H:%M:%S.%LZ"),Bo=(0,ti.format)(",");function Qo(n){return n&&!isNaN(+n)?Bo(+n):n}var $r="DefinitionList",Lo=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,si=["Avg","Min","Max","Delta","StdDev"],ni=["SkewMin","SkewMax","NodeMin","NodeMax"],Go=/[A-Z][a-z]*/g;function ko(n){for(let t of ni){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(Go);if(e?.length){let t=e.shift(),s=e.join("");for(let r of si){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 ei={};function ri(n){let e=ei[n];return e||(e=ko(n),ei[n]=e),e}function Le(n,e){return n.__formattedProps?.[e]??n[e]}function $s(n){if(n===void 0)return;let e=parseFloat(n);return isNaN(e)?void 0:e}function vo(n,e,t){let s=ri(e);if(!t[s.measure]){t[s.label]=!0;let r=$s(n[`${s.measure}Avg${s.label}`]),i=$s(n[`${s.measure}Min${s.label}`]),o=$s(n[`${s.measure}Max${s.label}`]),u=$s(n[`${s.measure}StdDev${s.label}`]),l=Math.max((r-i)/u,(o-r)/u);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(l)?void 0:l,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 en=(0,Ue.scopedLogger)("workunit.ts"),sn=class extends Ue.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}},tn=new sn,lt=class n extends Ue.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")||Hs[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 Kt;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,()=>Jt.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 $t(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 vt(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 _t(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 Zt(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")}static create(e){let t=new n(e);return t.connection.WUCreate().then(s=>(tn.set(t),t.set(s.Workunit),t))}static attach(e,t,s){let r=tn.get({BaseUrl:e.baseUrl,Wuid:t},()=>new n(e,t));return s&&r.set(s),r}static existsLocal(e,t){return tn.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,Je.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=Je.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===Je.Action.Debug&&(t=Je.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===Je.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(){switch(this.StateID){case 999:return!0;default:}return!1}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(ge.ECLWUActions.SetToFailed)}pause(){return this.WUAction(ge.ECLWUActions.Pause)}pauseNow(){return this.WUAction(ge.ECLWUActions.PauseNow)}resume(){return this.WUAction(ge.ECLWUActions.Resume)}abort(){return this.WUAction(ge.ECLWUActions.Abort)}protect(){return this.WUAction(ge.ECLWUActions.Protect)}unprotect(){return this.WUAction(ge.ECLWUActions.Unprotect)}delete(){return this.WUAction(ge.ECLWUActions.Delete)}restore(){return this.WUAction(ge.ECLWUActions.Restore)}deschedule(){return this.WUAction(ge.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(ge.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 u=t[o],l={},R={};if(u.Id&&u.Properties?.Property)for(let V of u.Properties.Property){let N=V.Measure,q=V.Name,k=V.RawValue;if(N==="ns"&&(V.Measure="s"),q==="Kind"){let I=parseInt(k,10);V.Formatted=r.get(I)??k}switch(s[q]={Name:V.Name,Measure:V.Measure,Creator:V.Creator,CreatorType:V.CreatorType},V.Measure){case"bool":l[q]=!!+k;break;case"sz":l[q]=+k;break;case"s":l[q]=+k/1e9;break;case"ns":l[q]=+k;break;case"ts":l[q]=new Date(+k/1e3).toISOString();break;case"cnt":l[q]=+k;break;case"cost":l[q]=+k/1e6;break;case"node":l[q]=+k;break;case"skw":l[q]=+k;break;case"cpu":case"ppm":case"ip":case"cy":case"en":case"txt":case"id":case"fname":default:l[q]=k}R[q]=Qo(V.Formatted??l[q])}let p={id:u.Id,name:u.ScopeName,type:u.ScopeType,Kind:u.Kind,Label:u.Label,__formattedProps:R,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...l},F=p[$r];if(F)try{let V=JSON.parse(F.split("\\").join("\\\\")),N=[];for(let q=0;q<V.length;q++){let k=V[q].match(Lo);k&&N.push({filePath:(k[1]??"")+k[2]+k[3],line:parseInt(k[5],10),col:parseInt(k[6],10)})}p[$r]=N}catch{en.error(`Unexpected "DefinitionList": ${F}`)}let y={},M=0,Q="";for(let V in p)if(!V.startsWith("__")){let N=vo(p,V,y);N&&(p.__groupedProps[N.Key]=N,!isNaN(N.StdDevs)&&N.StdDevs>M&&(M=N.StdDevs,Q=N.Key))}p.__StdDevs=M,p.__StdDevsSource=Q,i[o]=p}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],u=o.parentScope();u&&r[u]?r[u].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=>jt(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=No(i.start);o.setMilliseconds(o.getMilliseconds()+i.elapsed/1e6),i.finish=wo(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 switch(e){case"changed":super.on(e,t,s);break;default:}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 en.warning(`Unexpected ESP exception: ${t.message}`),t;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),tn.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 en.warning(`Unexpected ESP exception: ${s.message}`),s;return{}})}WUResubmit(e){return this.connection.WUResubmit((0,Ue.deepMixinT)({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails((0,Ue.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,Ue.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:ge.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){let t=new kt({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 Ue.XMLNode(e)}).catch(s=>(en.error(s),Promise.resolve(new Ue.XMLNode(e)))):Promise.resolve(new Ue.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=>jo(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(u=>{o[u.name]=u.content}),o}))}},rr="definition";function Vo(n){return n._[rr]!==void 0}function Ho(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 jo(n,e){let t=[];for(let s of n.vertices)if(Vo(s)){let r=Ho(s);(r&&!e||e===r.file)&&t.push(r)}return t.sort((s,r)=>s.line-r.line)}var rn,ir=class n extends on.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 rn||(rn=new n(e)),t&&rn.set(t),rn}constructor(e){super(),e instanceof yt?this.connection=e:this.connection=new yt(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(t=>e===""||t.ClusterName===e).map(t=>lt.attach(this.connection.connectionOptions(),t.Wuid,t))}setBanner(e){return this.connection.SetBanner({...e}).then(t=>(this.set(t),this))}lazyRefresh=(0,on.debounce)(async()=>{let e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}};var Wt=require("@hpcc-js/util");var _o=(0,Wt.scopedLogger)("logicalFile.ts"),an=class extends Wt.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}},Oo=new an,or=class n extends Wt.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=Oo.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 un=class extends cn.Cache{constructor(){super(e=>e.Address)}},Yo=new un,es=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=Yo.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 ft=require("@hpcc-js/util"),ii=We(Xn(),1);var gt=require("@hpcc-js/util");var pn=require("@hpcc-js/util");var ln=class extends pn.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}},Xo=new ln,pt=class n extends pn.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=>es.attach(this.machineConnection,e.Address,e))}static attach(e,t,s){let r=Xo.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 qo(n){let e;return n instanceof oe?e=n:e=new oe(n),e.TpListTargetClusters({}).then(t=>t.TargetClusters.TpClusterNameType.map(s=>pt.attach(n,s.Name,s)))}var ar={};function zo(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(u=>{s||(s=u),!r&&u.IsDefault===!0&&(r=u),!i&&u.Type==="hthor"&&(i=u)});let o=r||i||s;return pt.attach(n,o.Name,o)})}return ar[n.baseUrl]}var gn=class extends gt.Cache{constructor(){super(e=>e.BaseUrl)}},Jo=new gn,ts=class n extends gt.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=>pt.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,t){let s=Jo.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,gt.exists)("ServiceList.TpEspServers.TpEspServer",t)){for(let o of t.ServiceList.TpEspServers.TpEspServer)if((0,gt.exists)("TpBindings.TpBinding",o))for(let u of o.TpBindings.TpBinding)u.Service===e&&u.Protocol+":"===s&&(i=u.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){if(this.isCallback(t))switch(e){case"changed":super.on(e,t);break;default:}else switch(e){case"changed":super.on(e,t,s);break;default:}return this._monitor(),this}};function Ze(n,e,t){e==="__proto__"||e==="constructor"||e==="prototype"||(n[e]=t)}function ss(n){return n=""+n,n.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g," ").replace(/\r/g," ")}function Ko(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,u=+t[5]||0,l=+t[6]||0,R=+t[7]||0;return s*24*60*60+r*60*60+i*60+o+u/1e3+l/1e6+R/1e9}function $e(n,e){let t=n.indexOf(e);return t!==-1?parseFloat(n.substring(0,t)):-1}function Zo(n){if(n){if(!isNaN(+n))return parseFloat(n)}else return 0;let e=$e(n,"Kb");return e>=0?e*1024:(e=$e(n,"Mb"),e>=0?e*Math.pow(1024,2):(e=$e(n,"Gb"),e>=0?e*Math.pow(1024,3):(e=$e(n,"Tb"),e>=0?e*Math.pow(1024,4):(e=$e(n,"Pb"),e>=0?e*Math.pow(1024,5):(e=$e(n,"Eb"),e>=0?e*Math.pow(1024,6):(e=$e(n,"Zb"),e>=0?e*Math.pow(1024,7):(e=$e(n,"b"),e>=0?e:0)))))))}function $o(n){return n?parseFloat(n):0}var ur=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+'="'+ss(i[o])+'"':r+='<att name="'+o+'" value="'+ss(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+'="'+ss(r[i])+'"':s+='<att name="'+i+'" value="'+ss(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,u=null;for(;i>=0&&o>=0&&s[i]===r[o];)u=s[i],--i,--o;return u}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="'+ss(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))}},ns=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}},et=class extends ns{_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)})}},dt=class extends ns{_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)}},mt=class extends ns{_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]}},rs=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 et}isVertex(e){return e instanceof dt}isEdge(e){return e instanceof mt}getGlobalType(e){return e instanceof dt?3:e instanceof mt?4:e instanceof et?2:e instanceof n?1:0}getGlobalTypeString(e){return e instanceof dt?"Vertex":e instanceof mt?"Edge":e instanceof et?"Cluster":e instanceof n?"Graph":"Unknown"}getItem(e,t){if(!this.idx[t])switch(e.tagName){case"graph":let r=new et(this,t);this.subgraphs.push(r),this.idx[t]=r;break;case"node":let i=new dt(this,t);this.vertices.push(i),this.idx[t]=i;break;case"edge":let o=new mt(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=>{Ze(s,r.name,r.value)}),s}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof et?this.subgraphs=this.subgraphs.filter(t=>e!==t):e instanceof dt?this.vertices=this.vertices.filter(t=>e!==t):e instanceof mt&&(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 F=this.getChildByTagName(o,"graph");if(F){i=!0;let y=this.walkDocument(F,r.getAttribute("id"));s.addSubgraph(y)}}if(!i){let F=this.walkDocument(r,r.getAttribute("id"));s.addVertex(F)}break;case"att":let u=r.getAttribute("name"),l="_"+u,R=r.getAttribute("value");u.indexOf("Time")===0?(Ze(s,l,R),Ze(s,u,""+Ko(R))):u.indexOf("Size")===0?(Ze(s,l,R),Ze(s,u,""+Zo(R))):u.indexOf("Skew")===0?(Ze(s,l,R),Ze(s,u,""+$o(R))):Ze(s,u,R);break;case"edge":let p=this.walkDocument(r,r.getAttribute("id"));if(p.NumRowsProcessed!==void 0?p._eclwatchCount=p.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):p.Count!==void 0?p._eclwatchCount=p.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):p.count!==void 0&&(p._eclwatchCount=p.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),p.inputProgress&&(p._eclwatchInputProgress="["+p.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),p.SkewMaxRowsProcessed&&p.SkewMinRowsProcessed&&(p._eclwatchSkew="+"+p.SkewMaxRowsProcessed+", "+p.SkewMinRowsProcessed),!p._dependsOn){if(!p._childGraph){if(p._sourceActivity||p._targetActivity){p._isSpill=!0;let F=p.getSource();F&&(F._isSpill=!0);let y=p.getTarget();y&&(y._isSpill=!0)}}}s.addEdge(p);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 et&&t.remove()})}removeSpillVertices(){[...this.vertices].forEach(t=>{t.isSpill()&&t.remove()})}getLocalisedXGMML(e,t,s,r){let i=new ur(this);return i.calcVisibility(e,t,s,r),i.writeXgmml(),"<graph>"+i.m_xgmml+"</graph>"}};var dn=(0,ft.scopedLogger)("@hpcc-js/comms/ecl/query.ts"),ea=(0,ii.format)("~s");function ta(n){return!isNaN(parseFloat(n))&&!isNaN(n-0)}var cr=class extends ft.Cache{constructor(){super(e=>ft.Cache.hash([e.QueryId,e.QuerySet]))}},sa=new cr,lr=class n extends ft.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=ts.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:t,QueryId:s,...r})}static attach(e,t,s,r){let i=sa.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 Lt({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){dn.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){dn.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 rs,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=lt.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],u=s[2].map(l=>{let R=l.Id[0];if(R==="a"||R==="e"){let p=r.idx[l.Id.substring(1)];if(!p)return dn.debug(`Missing graph data for metric ID: ${l.Id}`),l;let F=new Set(l.Properties.Property.map(M=>M.Name)),y=[];for(let M in p){let Q=M.charAt(0);if(Q!=="_"&&Q===Q.toUpperCase()&&!F.has(M)){let V=p[M],N=typeof V;if(N==="string"||N==="number"||N==="boolean"){let k=ta(V)?parseFloat(V):V,I=V;M.indexOf("Time")>=0&&(k=k/1e9,I=ea(k)+"s"),y.push({Name:M,RawValue:k,Formatted:I})}}}y.length>0&&l.Properties.Property.push(...y)}return l});return t.normalizeDetails(i,u)}):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 dn.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 Ut=require("@hpcc-js/util");var mn=class extends Ut.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}},na=new mn,tt=class extends Ut.Message{constructor(t,s,r){super();this.key=t;this.value=s;this.oldValue=r}get canConflate(){return!0}conflate(t){return this.key===t.key?(this.value=t.value,!0):!1}void(){return this.value===this.oldValue}},pr=class n{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new Ut.Dispatch;static attach(e,t="HPCCApps",s,r=!0){return na.get({BaseUrl:e.baseUrl,Name:t,UserSpecific:r,Namespace:s},()=>new n(e,t,s,r))}constructor(e,t,s,r){e instanceof xt?this.connection=e:this.connection=new xt(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 tt(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 tt(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 tt(i.Key,i.Value,o))}),e)for(let i in r)this._dispatch.post(new tt(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 tt(e,void 0,r))}).catch(s=>{console.error(`Store.delete(${e}) failed:`,s)})}monitor(e){return this._dispatch.attach(e)}};var Et=require("@hpcc-js/util");var ra=(0,Et.scopedLogger)("@hpcc-js/comms/dfuWorkunit.ts");var fn=class extends Et.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}},oi=new fn,gr=class n extends Et.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=>(oi.set(s),s.set(r.result),s))}static attach(e,t,s){let r=oi.get({BaseUrl:e.baseUrl,ID:t},()=>new n(e,t));return s&&r.set(s),r}static sprayFixed(e,t){let s=new qe(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 qe(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 qe(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(){switch(this.State){case 999:return!0;default:}return!1}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(Rt.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===Rt.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 switch(e){case"changed":super.on(e,t,s);break;default:}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 qe(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 ra.warning(`Unexpected ESP exception: ${t.message}`),t;return{}})}};var mi=We(require("node:child_process"),1),fi=We(require("node:crypto"),1),de=We(require("node:fs"),1),ke=We(require("node:os"),1),De=We(require("node:path"),1),Mt=require("@hpcc-js/util");var ht=We(require("node:fs"),1),ee=We(require("node:path"),1),Ee=require("@hpcc-js/util");var ia=(0,Ee.scopedLogger)("clienttools/eclmeta"),oa=!1;function Ft(n,e,t){if(oa){for(let s in n){let r=`${e}.${s}`;s!=="$"&&t[s]===void 0&&t[s.toLowerCase()+"s"]===void 0&&ia.debug(r)}n.$&&Ft(n.$,e+".$",t)}}var hn=class{__attrs;name;constructor(e){this.__attrs=e.$,this.name=e.$.name}},Dn=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}},Dt=class{get scope(){return this}name;type;sourcePath;line;start;body;end;definitions;constructor(e,t,s,r,i=1,o=0,u=0,l=Number.MAX_VALUE){this.name=e,this.type=t,this.sourcePath=ee.normalize(s),this.line=+i-1,this.start=+o,this.body=+u,this.end=+l,this.definitions=this.parseDefinitions(r)}parseDefinitions(e=[]){return e.map(t=>{let s=new Cn(this.sourcePath,t);return Ft(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,Ee.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}))}},Cn=class extends Dt{__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 Ft(t,"attr",s),s})}parseFields(e=[]){return e.map(t=>{let s=new Dn(this,t);return Ft(t,"field",s),s})}suggestions(){return super.suggestions().concat(this.fields.map(e=>({name:e.name,type:e.type})))}},is=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}},Rn=class extends Dt{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 Ee.XMLNode("");s.appendAttribute("name","$"),s.appendAttribute("ref",t.join(".")),this.imports=[new is(s),...this.parseImports(e.children("Import"))]}parseImports(e=[]){return e.map(t=>{let s=new is(t);return Ft(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}},aa=n=>ee.basename(n).indexOf(".")===0,ai=n=>ht.lstatSync(n).isDirectory()&&!aa(n),ua=n=>[".ecl",".ecllib"].indexOf(ee.extname(n).toLowerCase())>=0,ui=n=>ht.readdirSync(n).map(e=>ee.join(n,e)).filter(e=>ai(e)||ua(e)),Sn=class extends Dt{constructor(e,t){super(e,"file",t,[])}suggestions(){return[]}},yn=class extends Dt{constructor(e,t){super(e,"folder",t,[])}suggestions(){return ui(this.sourcePath).map(e=>({name:ee.basename(e,".ecl"),type:"folder"}))}},xn=class{_workspacePath;_eclccPath;_clientTools;_sourceByID=new Ee.DictionaryNoCase;_sourceByPath=new Ee.Dictionary;_test=new Ee.DictionaryNoCase;constructor(e,t){this._workspacePath=e,this._eclccPath=t}refresh(){this.primeWorkspace(),this.primeClientTools()}primeClientTools(){return fr(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]&&ht.existsSync(e[t])&&this.walkChildFolders(e[t],e[t]);return this})}primeWorkspace(){ht.existsSync(this._workspacePath)&&this.visitFolder(this._workspacePath,this._workspacePath)}walkChildFolders(e,t,s=!1){for(let r of ui(e))ai(r)?this.visitFolder(r,t,s):this.visitFile(r,t,s)}visitFile(e,t,s=!1){let r=ee.parse(e),i=ee.join(r.dir,r.name),o=ee.relative(t,i).split(ee.sep).join(".");(s||!this._test.has(o))&&this._test.set(o,new Sn("",e))}visitFolder(e,t,s=!1){let r=ee.relative(t,e).split(ee.sep).join(".");(s||!this._test.has(r))&&(this._test.set(r,new yn(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 Rn(t);if(Ft(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=ee.dirname(o),--i;this.visitFolder(o,ee.dirname(o))}}this.walkSource(s)}}parseMetaXML(e){let t=new mr;return t.parse(e),this.parseSources(t.sources),t.sources.map(s=>ee.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 l of i.imports)if(l.name.toLowerCase()===o[0].toLowerCase()){l.ref?o[0]=l.ref:o.shift();break}let u=o.join(".");!r&&this._test.has(u)&&(r=this._test.get(u).scope),r||(u=[...i.name.split("."),...o].join("."),this._test.has(u)&&(r=this._test.get(u).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 Ee.Dictionary;function st(n,e){let t=ee.normalize(n);if(!dr.has(t)){let s=new xn(t,e);dr.set(t,s),s.refresh()}return dr.get(t)}function ca(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 la(n,e,t){for(;ca(n,e,t);)e+=t?-1:1;return e+(t?1:-1)}var mr=class extends Ee.SAXStackParser{sources=[];endXMLNode(e){switch(e.name){case"Source":this.sources.push(e);break;default:break}super.endXMLNode(e)}};var bt=(0,Mt.scopedLogger)("clienttools/eclcc"),hr=ke.type()==="Windows_NT"?".exe":"";function ci(n){return n.split(`\r
|
|
915
|
+
</div>`}},At=class extends Ks{wu;constructor(e,t){super(t),this.wu=e}};var Zr=require("@hpcc-js/util");var Zt=class extends Zr.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 Zs=require("@hpcc-js/util");var $t=class extends Zs.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,Zs.espTime2Seconds)(s.Value);this.set({Wuid:t,Seconds:Math.round(r*1e3)/1e3,HasSubGraphId:s.SubGraphId!==void 0,...s})}};var wo=(0,nn.utcFormat)("%Y-%m-%dT%H:%M:%S.%LZ"),No=(0,nn.utcParse)("%Y-%m-%dT%H:%M:%S.%LZ"),Bo=(0,ti.format)(",");function Qo(n){return n&&!isNaN(+n)?Bo(+n):n}var $r="DefinitionList",Lo=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,si=["Avg","Min","Max","Delta","StdDev"],ni=["SkewMin","SkewMax","NodeMin","NodeMax"],Go=/[A-Z][a-z]*/g;function ko(n){for(let t of ni){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(Go);if(e?.length){let t=e.shift(),s=e.join("");for(let r of si){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 ei={};function ri(n){let e=ei[n];return e||(e=ko(n),ei[n]=e),e}function Ge(n,e){return n.__formattedProps?.[e]??n[e]}function $s(n){if(n===void 0)return;let e=parseFloat(n);return isNaN(e)?void 0:e}function vo(n,e,t){let s=ri(e);if(!t[s.measure]){t[s.label]=!0;let r=$s(n[`${s.measure}Avg${s.label}`]),i=$s(n[`${s.measure}Min${s.label}`]),o=$s(n[`${s.measure}Max${s.label}`]),u=$s(n[`${s.measure}StdDev${s.label}`]),l=Math.max((r-i)/u,(o-r)/u);return{Key:`${s.measure}${s.label}`,Value:Ge(n,`${s.measure}${s.label}`),Avg:Ge(n,`${s.measure}Avg${s.label}`),Min:Ge(n,`${s.measure}Min${s.label}`),Max:Ge(n,`${s.measure}Max${s.label}`),Delta:Ge(n,`${s.measure}Delta${s.label}`),StdDev:Ge(n,`${s.measure}StdDev${s.label}`),StdDevs:isNaN(l)?void 0:l,SkewMin:Ge(n,`SkewMin${s.label}`),SkewMax:Ge(n,`SkewMax${s.label}`),NodeMin:Ge(n,`NodeMin${s.label}`),NodeMax:Ge(n,`NodeMax${s.label}`)}}return null}var en=(0,We.scopedLogger)("workunit.ts"),sn=class extends We.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}},tn=new sn,lt=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")||Hs[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 Kt;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,()=>Jt.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 $t(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 vt(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 _t(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 Zt(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")}static create(e){let t=new n(e);return t.connection.WUCreate().then(s=>(tn.set(t),t.set(s.Workunit),t))}static attach(e,t,s){let r=tn.get({BaseUrl:e.baseUrl,Wuid:t},()=>new n(e,t));return s&&r.set(s),r}static existsLocal(e,t){return tn.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,Je.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=Je.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===Je.Action.Debug&&(t=Je.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===Je.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(){switch(this.StateID){case 999:return!0;default:}return!1}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(ge.ECLWUActions.SetToFailed)}pause(){return this.WUAction(ge.ECLWUActions.Pause)}pauseNow(){return this.WUAction(ge.ECLWUActions.PauseNow)}resume(){return this.WUAction(ge.ECLWUActions.Resume)}abort(){return this.WUAction(ge.ECLWUActions.Abort)}protect(){return this.WUAction(ge.ECLWUActions.Protect)}unprotect(){return this.WUAction(ge.ECLWUActions.Unprotect)}delete(){return this.WUAction(ge.ECLWUActions.Delete)}restore(){return this.WUAction(ge.ECLWUActions.Restore)}deschedule(){return this.WUAction(ge.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(ge.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 u=t[o],l={},R={};if(u.Id&&u.Properties?.Property)for(let V of u.Properties.Property){let N=V.Measure,q=V.Name,k=V.RawValue;if(N==="ns"&&(V.Measure="s"),q==="Kind"){let I=parseInt(k,10);V.Formatted=r.get(I)??k}switch(s[q]={Name:V.Name,Measure:V.Measure,Creator:V.Creator,CreatorType:V.CreatorType},V.Measure){case"bool":l[q]=!!+k;break;case"sz":l[q]=+k;break;case"s":l[q]=+k/1e9;break;case"ns":l[q]=+k;break;case"ts":l[q]=new Date(+k/1e3).toISOString();break;case"cnt":l[q]=+k;break;case"cost":l[q]=+k/1e6;break;case"node":l[q]=+k;break;case"skw":l[q]=+k;break;case"cpu":case"ppm":case"ip":case"cy":case"en":case"txt":case"id":case"fname":default:l[q]=k}R[q]=Qo(V.Formatted??l[q])}let p={id:u.Id,name:u.ScopeName,type:u.ScopeType,Kind:u.Kind,Label:u.Label,__formattedProps:R,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...l},F=p[$r];if(F)try{let V=JSON.parse(F.split("\\").join("\\\\")),N=[];for(let q=0;q<V.length;q++){let k=V[q].match(Lo);k&&N.push({filePath:(k[1]??"")+k[2]+k[3],line:parseInt(k[5],10),col:parseInt(k[6],10)})}p[$r]=N}catch{en.error(`Unexpected "DefinitionList": ${F}`)}let y={},M=0,Q="";for(let V in p)if(!V.startsWith("__")){let N=vo(p,V,y);N&&(p.__groupedProps[N.Key]=N,!isNaN(N.StdDevs)&&N.StdDevs>M&&(M=N.StdDevs,Q=N.Key))}p.__StdDevs=M,p.__StdDevsSource=Q,i[o]=p}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],u=o.parentScope();u&&r[u]?r[u].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=>jt(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=No(i.start);o.setMilliseconds(o.getMilliseconds()+i.elapsed/1e6),i.finish=wo(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 switch(e){case"changed":super.on(e,t,s);break;default:}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 en.warning(`Unexpected ESP exception: ${t.message}`),t;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),tn.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 en.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:ge.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){let t=new kt({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=>(en.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=er(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(t=>jo(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(u=>{o[u.name]=u.content}),o}))}},nr="definition";function Vo(n){return n._[nr]!==void 0}function Ho(n){let e=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(n._[nr]);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._[nr]}`)}function jo(n,e){let t=[];for(let s of n.vertices)if(Vo(s)){let r=Ho(s);(r&&!e||e===r.file)&&t.push(r)}return t.sort((s,r)=>s.line-r.line)}var rn,rr=class n extends on.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 rn||(rn=new n(e)),t&&rn.set(t),rn}constructor(e){super(),e instanceof yt?this.connection=e:this.connection=new yt(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(t=>e===""||t.ClusterName===e).map(t=>lt.attach(this.connection.connectionOptions(),t.Wuid,t))}setBanner(e){return this.connection.SetBanner({...e}).then(t=>(this.set(t),this))}lazyRefresh=(0,on.debounce)(async()=>{let e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}};var Wt=require("@hpcc-js/util");var _o=(0,Wt.scopedLogger)("logicalFile.ts"),an=class extends Wt.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}},Oo=new an,ir=class n extends Wt.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=Oo.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 un=class extends cn.Cache{constructor(){super(e=>e.Address)}},Yo=new un,es=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=Yo.get({Address:t},()=>new n(e));return s&&r.set(s),r}constructor(e){super(),e instanceof ke?this.connection=e:this.connection=new ke(e)}};var ft=require("@hpcc-js/util"),ii=Ae(Yn(),1);var gt=require("@hpcc-js/util");var pn=require("@hpcc-js/util");var ln=class extends pn.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}},Xo=new ln,pt=class n extends pn.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=>es.attach(this.machineConnection,e.Address,e))}static attach(e,t,s){let r=Xo.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 ke(e.connectionOptions())):(this.connection=new oe(e),this.machineConnection=new ke(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 qo(n){let e;return n instanceof oe?e=n:e=new oe(n),e.TpListTargetClusters({}).then(t=>t.TargetClusters.TpClusterNameType.map(s=>pt.attach(n,s.Name,s)))}var or={};function zo(n){if(!or[n.baseUrl]){let e;n instanceof oe?e=n:e=new oe(n),or[n.baseUrl]=e.TpListTargetClusters({}).then(t=>{let s,r,i;t.TargetClusters.TpClusterNameType.forEach(u=>{s||(s=u),!r&&u.IsDefault===!0&&(r=u),!i&&u.Type==="hthor"&&(i=u)});let o=r||i||s;return pt.attach(n,o.Name,o)})}return or[n.baseUrl]}var gn=class extends gt.Cache{constructor(){super(e=>e.BaseUrl)}},Jo=new gn,ts=class n extends gt.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=>pt.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,t){let s=Jo.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,gt.exists)("ServiceList.TpEspServers.TpEspServer",t)){for(let o of t.ServiceList.TpEspServers.TpEspServer)if((0,gt.exists)("TpBindings.TpBinding",o))for(let u of o.TpBindings.TpBinding)u.Service===e&&u.Protocol+":"===s&&(i=u.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){if(this.isCallback(t))switch(e){case"changed":super.on(e,t);break;default:}else switch(e){case"changed":super.on(e,t,s);break;default:}return this._monitor(),this}};function Ze(n,e,t){e==="__proto__"||e==="constructor"||e==="prototype"||(n[e]=t)}function ss(n){return n=""+n,n.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g," ").replace(/\r/g," ")}function Ko(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,u=+t[5]||0,l=+t[6]||0,R=+t[7]||0;return s*24*60*60+r*60*60+i*60+o+u/1e3+l/1e6+R/1e9}function $e(n,e){let t=n.indexOf(e);return t!==-1?parseFloat(n.substring(0,t)):-1}function Zo(n){if(n){if(!isNaN(+n))return parseFloat(n)}else return 0;let e=$e(n,"Kb");return e>=0?e*1024:(e=$e(n,"Mb"),e>=0?e*Math.pow(1024,2):(e=$e(n,"Gb"),e>=0?e*Math.pow(1024,3):(e=$e(n,"Tb"),e>=0?e*Math.pow(1024,4):(e=$e(n,"Pb"),e>=0?e*Math.pow(1024,5):(e=$e(n,"Eb"),e>=0?e*Math.pow(1024,6):(e=$e(n,"Zb"),e>=0?e*Math.pow(1024,7):(e=$e(n,"b"),e>=0?e:0)))))))}function $o(n){return n?parseFloat(n):0}var ar=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+'="'+ss(i[o])+'"':r+='<att name="'+o+'" value="'+ss(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+'="'+ss(r[i])+'"':s+='<att name="'+i+'" value="'+ss(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,u=null;for(;i>=0&&o>=0&&s[i]===r[o];)u=s[i],--i,--o;return u}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="'+ss(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))}},ns=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}},et=class extends ns{_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)})}},dt=class extends ns{_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)}},mt=class extends ns{_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]}},rs=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 et}isVertex(e){return e instanceof dt}isEdge(e){return e instanceof mt}getGlobalType(e){return e instanceof dt?3:e instanceof mt?4:e instanceof et?2:e instanceof n?1:0}getGlobalTypeString(e){return e instanceof dt?"Vertex":e instanceof mt?"Edge":e instanceof et?"Cluster":e instanceof n?"Graph":"Unknown"}getItem(e,t){if(!this.idx[t])switch(e.tagName){case"graph":let r=new et(this,t);this.subgraphs.push(r),this.idx[t]=r;break;case"node":let i=new dt(this,t);this.vertices.push(i),this.idx[t]=i;break;case"edge":let o=new mt(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=>{Ze(s,r.name,r.value)}),s}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof et?this.subgraphs=this.subgraphs.filter(t=>e!==t):e instanceof dt?this.vertices=this.vertices.filter(t=>e!==t):e instanceof mt&&(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 F=this.getChildByTagName(o,"graph");if(F){i=!0;let y=this.walkDocument(F,r.getAttribute("id"));s.addSubgraph(y)}}if(!i){let F=this.walkDocument(r,r.getAttribute("id"));s.addVertex(F)}break;case"att":let u=r.getAttribute("name"),l="_"+u,R=r.getAttribute("value");u.indexOf("Time")===0?(Ze(s,l,R),Ze(s,u,""+Ko(R))):u.indexOf("Size")===0?(Ze(s,l,R),Ze(s,u,""+Zo(R))):u.indexOf("Skew")===0?(Ze(s,l,R),Ze(s,u,""+$o(R))):Ze(s,u,R);break;case"edge":let p=this.walkDocument(r,r.getAttribute("id"));if(p.NumRowsProcessed!==void 0?p._eclwatchCount=p.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):p.Count!==void 0?p._eclwatchCount=p.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):p.count!==void 0&&(p._eclwatchCount=p.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),p.inputProgress&&(p._eclwatchInputProgress="["+p.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),p.SkewMaxRowsProcessed&&p.SkewMinRowsProcessed&&(p._eclwatchSkew="+"+p.SkewMaxRowsProcessed+", "+p.SkewMinRowsProcessed),!p._dependsOn){if(!p._childGraph){if(p._sourceActivity||p._targetActivity){p._isSpill=!0;let F=p.getSource();F&&(F._isSpill=!0);let y=p.getTarget();y&&(y._isSpill=!0)}}}s.addEdge(p);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 et&&t.remove()})}removeSpillVertices(){[...this.vertices].forEach(t=>{t.isSpill()&&t.remove()})}getLocalisedXGMML(e,t,s,r){let i=new ar(this);return i.calcVisibility(e,t,s,r),i.writeXgmml(),"<graph>"+i.m_xgmml+"</graph>"}};var dn=(0,ft.scopedLogger)("@hpcc-js/comms/ecl/query.ts"),ea=(0,ii.format)("~s");function ta(n){return!isNaN(parseFloat(n))&&!isNaN(n-0)}var ur=class extends ft.Cache{constructor(){super(e=>ft.Cache.hash([e.QueryId,e.QuerySet]))}},sa=new ur,cr=class n extends ft.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=ts.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:t,QueryId:s,...r})}static attach(e,t,s,r){let i=sa.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 Lt({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){dn.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){dn.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 rs,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=lt.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],u=s[2].map(l=>{let R=l.Id[0];if(R==="a"||R==="e"){let p=r.idx[l.Id.substring(1)];if(!p)return dn.debug(`Missing graph data for metric ID: ${l.Id}`),l;let F=new Set(l.Properties.Property.map(M=>M.Name)),y=[];for(let M in p){let Q=M.charAt(0);if(Q!=="_"&&Q===Q.toUpperCase()&&!F.has(M)){let V=p[M],N=typeof V;if(N==="string"||N==="number"||N==="boolean"){let k=ta(V)?parseFloat(V):V,I=V;M.indexOf("Time")>=0&&(k=k/1e9,I=ea(k)+"s"),y.push({Name:M,RawValue:k,Formatted:I})}}}y.length>0&&l.Properties.Property.push(...y)}return l});return t.normalizeDetails(i,u)}):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 dn.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 Ut=require("@hpcc-js/util");var mn=class extends Ut.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}},na=new mn,tt=class extends Ut.Message{constructor(t,s,r){super();this.key=t;this.value=s;this.oldValue=r}get canConflate(){return!0}conflate(t){return this.key===t.key?(this.value=t.value,!0):!1}void(){return this.value===this.oldValue}},lr=class n{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new Ut.Dispatch;static attach(e,t="HPCCApps",s,r=!0){return na.get({BaseUrl:e.baseUrl,Name:t,UserSpecific:r,Namespace:s},()=>new n(e,t,s,r))}constructor(e,t,s,r){e instanceof xt?this.connection=e:this.connection=new xt(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 tt(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 tt(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 tt(i.Key,i.Value,o))}),e)for(let i in r)this._dispatch.post(new tt(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 tt(e,void 0,r))}).catch(s=>{console.error(`Store.delete(${e}) failed:`,s)})}monitor(e){return this._dispatch.attach(e)}};var Et=require("@hpcc-js/util");var ra=(0,Et.scopedLogger)("@hpcc-js/comms/dfuWorkunit.ts");var fn=class extends Et.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}},oi=new fn,pr=class n extends Et.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=>(oi.set(s),s.set(r.result),s))}static attach(e,t,s){let r=oi.get({BaseUrl:e.baseUrl,ID:t},()=>new n(e,t));return s&&r.set(s),r}static sprayFixed(e,t){let s=new qe(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 qe(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 qe(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(){switch(this.State){case 999:return!0;default:}return!1}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(Rt.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===Rt.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 switch(e){case"changed":super.on(e,t,s);break;default:}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 qe(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 ra.warning(`Unexpected ESP exception: ${t.message}`),t;return{}})}};var mi=Ae(require("node:child_process"),1),fi=Ae(require("node:crypto"),1),de=Ae(require("node:fs"),1),ve=Ae(require("node:os"),1),he=Ae(require("node:path"),1),Mt=require("@hpcc-js/util");var ht=Ae(require("node:fs"),1),ee=Ae(require("node:path"),1),Ue=require("@hpcc-js/util");var ia=(0,Ue.scopedLogger)("clienttools/eclmeta"),oa=!1;function Ft(n,e,t){if(oa){for(let s in n){let r=`${e}.${s}`;s!=="$"&&t[s]===void 0&&t[s.toLowerCase()+"s"]===void 0&&ia.debug(r)}n.$&&Ft(n.$,e+".$",t)}}var hn=class{__attrs;name;constructor(e){this.__attrs=e.$,this.name=e.$.name}},Dn=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}},Dt=class{get scope(){return this}name;type;sourcePath;line;start;body;end;definitions;constructor(e,t,s,r,i=1,o=0,u=0,l=Number.MAX_VALUE){this.name=e,this.type=t,this.sourcePath=ee.normalize(s),this.line=+i-1,this.start=+o,this.body=+u,this.end=+l,this.definitions=this.parseDefinitions(r)}parseDefinitions(e=[]){return e.map(t=>{let s=new Cn(this.sourcePath,t);return Ft(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,Ue.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}))}},Cn=class extends Dt{__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 Ft(t,"attr",s),s})}parseFields(e=[]){return e.map(t=>{let s=new Dn(this,t);return Ft(t,"field",s),s})}suggestions(){return super.suggestions().concat(this.fields.map(e=>({name:e.name,type:e.type})))}},is=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}},Rn=class extends Dt{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 Ue.XMLNode("");s.appendAttribute("name","$"),s.appendAttribute("ref",t.join(".")),this.imports=[new is(s),...this.parseImports(e.children("Import"))]}parseImports(e=[]){return e.map(t=>{let s=new is(t);return Ft(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}},aa=n=>ee.basename(n).indexOf(".")===0,ai=n=>ht.lstatSync(n).isDirectory()&&!aa(n),ua=n=>[".ecl",".ecllib"].indexOf(ee.extname(n).toLowerCase())>=0,ui=n=>ht.readdirSync(n).map(e=>ee.join(n,e)).filter(e=>ai(e)||ua(e)),Sn=class extends Dt{constructor(e,t){super(e,"file",t,[])}suggestions(){return[]}},yn=class extends Dt{constructor(e,t){super(e,"folder",t,[])}suggestions(){return ui(this.sourcePath).map(e=>({name:ee.basename(e,".ecl"),type:"folder"}))}},xn=class{_workspacePath;_eclccPath;_clientTools;_sourceByID=new Ue.DictionaryNoCase;_sourceByPath=new Ue.Dictionary;_test=new Ue.DictionaryNoCase;constructor(e,t){this._workspacePath=e,this._eclccPath=t}refresh(){this.primeWorkspace(),this.primeClientTools()}primeClientTools(){return mr(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]&&ht.existsSync(e[t])&&this.walkChildFolders(e[t],e[t]);return this})}primeWorkspace(){ht.existsSync(this._workspacePath)&&this.visitFolder(this._workspacePath,this._workspacePath)}walkChildFolders(e,t,s=!1){for(let r of ui(e))ai(r)?this.visitFolder(r,t,s):this.visitFile(r,t,s)}visitFile(e,t,s=!1){let r=ee.parse(e),i=ee.join(r.dir,r.name),o=ee.relative(t,i).split(ee.sep).join(".");(s||!this._test.has(o))&&this._test.set(o,new Sn("",e))}visitFolder(e,t,s=!1){let r=ee.relative(t,e).split(ee.sep).join(".");(s||!this._test.has(r))&&(this._test.set(r,new yn(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 Rn(t);if(Ft(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=ee.dirname(o),--i;this.visitFolder(o,ee.dirname(o))}}this.walkSource(s)}}parseMetaXML(e){let t=new dr;return t.parse(e),this.parseSources(t.sources),t.sources.map(s=>ee.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 l of i.imports)if(l.name.toLowerCase()===o[0].toLowerCase()){l.ref?o[0]=l.ref:o.shift();break}let u=o.join(".");!r&&this._test.has(u)&&(r=this._test.get(u).scope),r||(u=[...i.name.split("."),...o].join("."),this._test.has(u)&&(r=this._test.get(u).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)}},gr=new Ue.Dictionary;function st(n,e){let t=ee.normalize(n);if(!gr.has(t)){let s=new xn(t,e);gr.set(t,s),s.refresh()}return gr.get(t)}function ca(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 la(n,e,t){for(;ca(n,e,t);)e+=t?-1:1;return e+(t?1:-1)}var dr=class extends Ue.SAXStackParser{sources=[];endXMLNode(e){switch(e.name){case"Source":this.sources.push(e);break;default:break}super.endXMLNode(e)}};var bt=(0,Mt.scopedLogger)("clienttools/eclcc"),fr=ve.type()==="Windows_NT"?".exe":"";function ci(n){return n.split(`\r
|
|
916
916
|
`).join(`
|
|
917
917
|
`).split("\r").join(`
|
|
918
|
-
`)}var Pt=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}`}},li="error",pi="warning",as=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===li)}hasError(){return this.errors().length>0}warnings(){return this.errWarn.filter(e=>e.severity===pi)}hasWarning(){return this.warnings().length>0}info(){return this.errWarn.filter(e=>[li,pi].indexOf(e.severity)<0)}hasOther(){return this.info().length>0}unknown(){return this.errOther}hasUnknown(){return this.unknown().length>0}},us=class extends as{constructor(e,t){if(super(t),e&&e.length)for(let s of e.split(
|
|
918
|
+
`)}var Pt=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}`}},li="error",pi="warning",as=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===li)}hasError(){return this.errors().length>0}warnings(){return this.errWarn.filter(e=>e.severity===pi)}hasWarning(){return this.warnings().length>0}info(){return this.errWarn.filter(e=>[li,pi].indexOf(e.severity)<0)}hasOther(){return this.info().length>0}unknown(){return this.errOther}hasUnknown(){return this.unknown().length>0}},us=class extends as{constructor(e,t){if(super(t),e&&e.length)for(let s of e.split(ve.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,u,l,R,p]=r,F=+o,y=+u,M=R+": "+p;this.errWarn.push({filePath:i,line:F,col:y,msg:M,severity:l});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&&(bt.warning(`parseECLErrors: Unable to parse "${s}"`),this.errOther.push(s))}this._checked=t}},Wn=class extends as{_lines;constructor(e,t,s){super(s);let r=de.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(
|
|
920
|
+
`),t&&t.length)for(let i of t.split(ve.EOL)){let o=/(Warning|Error) : Path\=(\S*?)(\[\S*\])? Message\=(.*)/.exec(i);if(o){let[,u,l,R,p]=o,F=`${l} ${R||""}: ${p}`,[y,M]=this.locate(l);this.errWarn.push({filePath:e,line:y,col:M,msg:F,severity:u});continue}o||(bt.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 Un(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=>{Un(i,e,t)}):typeof r=="object"&&Un(r,e,t)}t.pop()}var En=class{jsonWU;constructor(e){this.jsonWU=e}bpGetValidLocations(e){let t=[];if((0,Mt.exists)("W_LOCAL.Graphs",this.jsonWU)){let s="";Un(this.jsonWU.W_LOCAL.Graphs,(r,i,o)=>{if(r==="$"&&i.id&&(s=i.id),r==="$"&&i.name==="definition"){let u=/([a-z,A-Z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(i.value);if(u){let[,l,R,p]=u,F=+R,y=+p;e===l&&t.push({file:l,line:F,col:y,id:s})}}})}return t}},It=class n{eclccPath;envchkPath;eclBundlePath;binPath;cwd;includeFolders;_legacyMode;_args;_version;constructor(e,t,s=[],r=!1,i=[],o){this.eclccPath=e,this.binPath=he.dirname(this.eclccPath),this.envchkPath=he.join(this.binPath,"envchk"+fr),this.eclBundlePath=he.join(this.binPath,"ecl-bundle"+fr),this.cwd=he.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 de.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"+he.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 Pt(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=de.readFileSync(e,"ascii"),o=(0,Mt.xml2json)(i);t&&de.unlink(e,u=>{}),s(o)})}createWU(e){let t=he.join(ve.tmpdir(),`eclcc-wu-tmp-${fi.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=he.normalize(t+".xml");return(this.exists(i)?this.loadXMLDoc(i,!0):Promise.resolve({})).then(u=>new En(u))})}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 us(s.stderr,[])}))}attachWorkspace(){return st(this.cwd)}fetchMeta(e){return Promise.all([st(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){bt.error(`fetchMeta: Error parsing XML - ${r?.message??"unknown"}`)}return t})}syntaxCheck(e,t=["-syntax"]){return Promise.all([st(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){bt.error(`syntaxCheck: Error parsing XML - ${o?.message??"unknown"}`)}return new us(r?r.stderr:"",i)})}envCheck(e,t=[]){return Promise.all([st(this.cwd),this.execFile(this.envchkPath,this.cwd,this.args([...t,e]),"envchk",`Cannot find ${this.envchkPath}`)]).then(([s,r])=>new Wn(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=>ci(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=>ci(i.stdout).split(`
|
|
922
|
-
`)).then(i=>{let o={};i.forEach(u=>{let l=u.split(":");o[l.shift().trim()]=l.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([st(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([st(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,u)=>{bt.debug(`${e} ${s.join(" ")}`);let l=mi.spawn(e,s,{cwd:t}),R="",p="";l.stdout.on("data",F=>{R+=F.toString()}),l.stderr.on("data",F=>{p+=F.toString()}),l.on("close",(F,y)=>{o({code:F,stdout:R.trim(),stderr:p.trim()})})})}};function An(n,e){if(n){let t=
|
|
923
|
-
`):
|
|
924
|
-
`)):typeof
|
|
925
|
-
`);
|
|
922
|
+
`)).then(i=>{let o={};i.forEach(u=>{let l=u.split(":");o[l.shift().trim()]=l.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([st(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([st(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,u)=>{bt.debug(`${e} ${s.join(" ")}`);let l=mi.spawn(e,s,{cwd:t}),R="",p="";l.stdout.on("data",F=>{R+=F.toString()}),l.stderr.on("data",F=>{p+=F.toString()}),l.on("close",(F,y)=>{o({code:F,stdout:R.trim(),stderr:p.trim()})})})}};function An(n,e){if(n){let t=he.join(n,"HPCCSystems");if(de.existsSync(t)&&de.statSync(t).isDirectory()){if(ve.type()!=="Windows_NT"){let s=he.join(t,"bin","eclcc");de.existsSync(s)&&e.push(new It(s))}de.readdirSync(t).forEach(s=>{let r=he.join(t,s,"clienttools","bin","eclcc"+fr);if(de.existsSync(r)){let i=he.basename(s);new Pt(i).exists()&&e.push(new It(r))}})}}}var os;function pa(){os=void 0}function hi(){if(os)return os;let n=[];switch(ve.type()){case"Windows_NT":let e=process.env["ProgramFiles(x86)"]||"";e&&An(e,n);let t=process.env.ProgramFiles||"";t&&An(t,n),!e&&!t&&An("c:\\Program Files (x86)",n);break;case"Linux":case"Darwin":An("/opt",n);break;default:break}return os=Promise.all(n.map(e=>e.version())).then(()=>(n.sort((e,t)=>t.versionSync().compare(e.versionSync())),n)),os}var gi="";function di(n){let e=`Using eclccPath setting: ${n}`;gi!==e&&(bt.info(e),gi=e)}function mr(n="",e="",t=".",s=[],r=!1,i=[]){return n&&de.existsSync(n)?(di(n),Promise.resolve(new It(n,t,s,r,i))):hi().then(o=>{if(!o.length)throw new Error("Unable to locate ECL Client Tools.");let u=new Pt(e),l,R;for(let F of o){let y=F.versionSync();if(y.exists()&&(l||(l=F),!R&&u.major===y.major&&(R=F),u.major===y.major&&u.minor===y.minor))return F.clone(t,s,r,i)}let p=R||l;return di(p.eclccPath),p.clone(t,s,r,i)})}Ee.root.DOMParser=Di.DOMParser;typeof Ee.root.fetch>"u"?(Ee.root.fetch=nt.default,Ee.root.Headers=nt.Headers,Ee.root.Request=nt.Request,Ee.root.Response=nt.Response,Ee.root.fetch.__rejectUnauthorizedAgent=new De.Agent({rejectUnauthorized:!1})):(Ee.root.fetch.__defaultAgent=new cs.Agent,Ee.root.fetch.__rejectUnauthorizedAgent=new cs.Agent({connect:{rejectUnauthorized:!1}}),Ee.root.fetch.__setGlobalDispatcher=cs.setGlobalDispatcher);typeof Ee.root.AbortController>"u"&&(Ee.root.AbortController=Ci.default);var Tt="";De.globalAgent.options.ca!==void 0&&(Array.isArray(De.globalAgent.options.ca)&&De.globalAgent.options.ca.length?typeof De.globalAgent.options.ca[0]=="string"?Tt=De.globalAgent.options.ca.join(`
|
|
923
|
+
`):De.globalAgent.options.ca[0]instanceof hr.Buffer&&(Tt=De.globalAgent.options.ca.map(n=>n.toString()).join(`
|
|
924
|
+
`)):typeof De.globalAgent.options.ca=="string"?Tt=De.globalAgent.options.ca:De.globalAgent.options.ca instanceof hr.Buffer&&(Tt=De.globalAgent.options.ca.toString()),Tt+=`
|
|
925
|
+
`);Ee.root.fetch.__trustwaveAgent=new De.Agent({ca:Tt+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
|