@hpcc-js/comms 3.15.4 → 3.15.6

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.
Files changed (130) hide show
  1. package/LICENSE +43 -43
  2. package/README.md +50 -50
  3. package/dist/browser/index.js +1 -1
  4. package/dist/browser/index.js.map +1 -1
  5. package/dist/browser/index.umd.cjs +1 -1
  6. package/dist/browser/index.umd.cjs.map +1 -1
  7. package/dist/node/index.cjs +10 -10
  8. package/dist/node/index.cjs.map +4 -4
  9. package/dist/node/index.js +9 -9
  10. package/dist/node/index.js.map +4 -4
  11. package/package.json +7 -7
  12. package/src/__package__.ts +3 -3
  13. package/src/clienttools/eclMeta.ts +506 -506
  14. package/src/clienttools/eclcc.ts +628 -628
  15. package/src/connection.ts +288 -288
  16. package/src/ecl/activity.ts +82 -82
  17. package/src/ecl/dfuWorkunit.ts +363 -363
  18. package/src/ecl/graph.ts +196 -196
  19. package/src/ecl/logicalFile.ts +196 -196
  20. package/src/ecl/machine.ts +63 -63
  21. package/src/ecl/query.ts +265 -265
  22. package/src/ecl/queryGraph.ts +813 -813
  23. package/src/ecl/resource.ts +39 -39
  24. package/src/ecl/result.ts +245 -245
  25. package/src/ecl/scope.ts +188 -188
  26. package/src/ecl/sourceFile.ts +34 -34
  27. package/src/ecl/store.ts +154 -154
  28. package/src/ecl/targetCluster.ts +149 -149
  29. package/src/ecl/timer.ts +42 -42
  30. package/src/ecl/topology.ts +131 -131
  31. package/src/ecl/workunit.ts +1340 -1340
  32. package/src/ecl/xsdParser.ts +267 -267
  33. package/src/espConnection.ts +164 -164
  34. package/src/index.browser.ts +1 -1
  35. package/src/index.common.ts +40 -40
  36. package/src/index.node.ts +48 -48
  37. package/src/pem/trustwave.ts +909 -909
  38. package/src/services/fileSpray.ts +73 -73
  39. package/src/services/wsAccess.ts +8 -8
  40. package/src/services/wsAccount.ts +27 -27
  41. package/src/services/wsCloud.ts +73 -73
  42. package/src/services/wsCodesign.ts +18 -18
  43. package/src/services/wsDFU.ts +34 -34
  44. package/src/services/wsDFUXRef.ts +121 -121
  45. package/src/services/wsDali.ts +8 -8
  46. package/src/services/wsEcl.ts +123 -123
  47. package/src/services/wsElk.ts +8 -8
  48. package/src/services/wsLogaccess.ts +270 -270
  49. package/src/services/wsMachine.ts +89 -89
  50. package/src/services/wsPackageProcess.ts +8 -8
  51. package/src/services/wsResources.ts +8 -8
  52. package/src/services/wsSMC.ts +80 -80
  53. package/src/services/wsSasha.ts +7 -7
  54. package/src/services/wsStore.ts +32 -32
  55. package/src/services/wsTopology.ts +45 -45
  56. package/src/services/wsWorkunits.ts +151 -151
  57. package/src/services/wsdl/FileSpray/v1.23/FileSpray.ts +1008 -1008
  58. package/src/services/wsdl/FileSpray/v1.25/FileSpray.ts +1040 -1040
  59. package/src/services/wsdl/FileSpray/v1.26/FileSpray.ts +929 -929
  60. package/src/services/wsdl/FileSpray/v1.27/FileSpray.ts +930 -930
  61. package/src/services/wsdl/WsCloud/v1/WsCloud.ts +38 -38
  62. package/src/services/wsdl/WsCloud/v1.02/WsCloud.ts +77 -77
  63. package/src/services/wsdl/WsDFUXRef/v1.02/WsDFUXRef.ts +224 -224
  64. package/src/services/wsdl/WsDFUXRef/v1.04/WsDFUXRef.ts +228 -227
  65. package/src/services/wsdl/WsDali/v1.04/WsDali.ts +216 -216
  66. package/src/services/wsdl/WsDali/v1.07/WsDali.ts +72 -72
  67. package/src/services/wsdl/WsDfu/v1.62/WsDfu.ts +1455 -1455
  68. package/src/services/wsdl/WsDfu/v1.63/WsDfu.ts +1465 -1465
  69. package/src/services/wsdl/WsDfu/v1.65/WsDfu.ts +1244 -1244
  70. package/src/services/wsdl/WsDfu/v1.66/WsDfu.ts +1267 -1267
  71. package/src/services/wsdl/WsDfu/v1.67/WsDfu.ts +1268 -1268
  72. package/src/services/wsdl/WsDfu/v1.68/WsDfu.ts +1301 -0
  73. package/src/services/wsdl/WsESDLConfig/v1.5/WsESDLConfig.ts +366 -0
  74. package/src/services/wsdl/WsFileIO/v1.01/WsFileIO.ts +104 -104
  75. package/src/services/wsdl/WsPackageProcess/v1.04/WsPackageProcess.ts +519 -519
  76. package/src/services/wsdl/WsPackageProcess/v1.07/WsPackageProcess.ts +500 -500
  77. package/src/services/wsdl/WsPackageProcess/v1.08/WsPackageProcess.ts +503 -0
  78. package/src/services/wsdl/WsResources/v1.01/WsResources.ts +119 -119
  79. package/src/services/wsdl/WsSMC/v1.24/WsSMC.ts +665 -665
  80. package/src/services/wsdl/WsSMC/v1.27/WsSMC.ts +591 -591
  81. package/src/services/wsdl/WsSMC/v1.28/WsSMC.ts +645 -645
  82. package/src/services/wsdl/WsSMC/v1.29/WsSMC.ts +660 -660
  83. package/src/services/wsdl/WsSasha/v1.01/WsSasha.ts +18 -18
  84. package/src/services/wsdl/WsTopology/v1.31/WsTopology.ts +856 -856
  85. package/src/services/wsdl/WsTopology/v1.32/WsTopology.ts +786 -786
  86. package/src/services/wsdl/WsTopology/v1.33/WsTopology.ts +835 -835
  87. package/src/services/wsdl/WsWorkunits/v1.88/WsWorkunits.ts +2944 -2944
  88. package/src/services/wsdl/WsWorkunits/v1.94/WsWorkunits.ts +3072 -3072
  89. package/src/services/wsdl/WsWorkunits/v1.95/WsWorkunits.ts +3073 -3073
  90. package/src/services/wsdl/WsWorkunits/v1.97/WsWorkunits.ts +3134 -3134
  91. package/src/services/wsdl/WsWorkunits/v1.98/WsWorkunits.ts +3182 -3182
  92. package/src/services/wsdl/WsWorkunits/v1.99/WsWorkunits.ts +3162 -3162
  93. package/src/services/wsdl/WsWorkunits/v2/WsWorkunits.ts +3153 -3153
  94. package/src/services/wsdl/WsWorkunits/v2.02/WsWorkunits.ts +3162 -3162
  95. package/src/services/wsdl/WsWorkunits/v2.03/WsWorkunits.ts +3164 -3164
  96. package/src/services/wsdl/WsWorkunits/v2.04/WsWorkunits.ts +3171 -3171
  97. package/src/services/wsdl/WsWorkunits/v2.05/WsWorkunits.ts +3177 -0
  98. package/src/services/wsdl/ws_access/v1.16/ws_access.ts +1086 -1086
  99. package/src/services/wsdl/ws_access/v1.17/ws_access.ts +1023 -1023
  100. package/src/services/wsdl/ws_account/v1.05/ws_account.ts +111 -111
  101. package/src/services/wsdl/ws_account/v1.06/ws_account.ts +109 -109
  102. package/src/services/wsdl/ws_account/v1.07/ws_account.ts +114 -114
  103. package/src/services/wsdl/ws_codesign/v1.1/ws_codesign.ts +95 -95
  104. package/src/services/wsdl/ws_elk/v1/ws_elk.ts +47 -47
  105. package/src/services/wsdl/ws_logaccess/v1/ws_logaccess.ts +83 -83
  106. package/src/services/wsdl/ws_logaccess/v1.02/ws_logaccess.ts +161 -161
  107. package/src/services/wsdl/ws_logaccess/v1.03/ws_logaccess.ts +190 -190
  108. package/src/services/wsdl/ws_logaccess/v1.04/ws_logaccess.ts +215 -215
  109. package/src/services/wsdl/ws_logaccess/v1.05/ws_logaccess.ts +219 -219
  110. package/src/services/wsdl/ws_logaccess/v1.08/ws_logaccess.ts +267 -267
  111. package/src/services/wsdl/ws_machine/v1.17/ws_machine.ts +567 -567
  112. package/src/services/wsdl/ws_machine/v1.18/ws_machine.ts +497 -497
  113. package/src/services/wsdl/ws_machine/v1.19/ws_machine.ts +497 -497
  114. package/src/services/wsdl/wsstore/v1.02/wsstore.ts +239 -239
  115. package/types/services/wsPackageProcess.d.ts +1 -1
  116. package/types/services/wsWorkunits.d.ts +1 -1
  117. package/types/services/wsdl/FileSpray/v1.27/FileSpray.d.ts +506 -506
  118. package/types/services/wsdl/WsCloud/v1.02/WsCloud.d.ts +18 -18
  119. package/types/services/wsdl/WsDFUXRef/v1.04/WsDFUXRef.d.ts +58 -57
  120. package/types/services/wsdl/WsDali/v1.07/WsDali.d.ts +42 -42
  121. package/types/services/wsdl/WsPackageProcess/{v1.07 → v1.08}/WsPackageProcess.d.ts +121 -118
  122. package/types/services/wsdl/WsSasha/v1.01/WsSasha.d.ts +13 -13
  123. package/types/services/wsdl/WsTopology/v1.33/WsTopology.d.ts +360 -360
  124. package/types/services/wsdl/WsWorkunits/v2.05/WsWorkunits.d.ts +2571 -0
  125. package/types/services/wsdl/ws_access/v1.17/ws_access.d.ts +268 -268
  126. package/types/services/wsdl/ws_account/v1.07/ws_account.d.ts +34 -34
  127. package/types/services/wsdl/ws_codesign/v1.1/ws_codesign.d.ts +22 -22
  128. package/types/services/wsdl/ws_elk/v1/ws_elk.d.ts +12 -12
  129. package/types/services/wsdl/wsstore/v1.02/wsstore.d.ts +61 -61
  130. package/types/services/wsdl/WsWorkunits/v2.04/WsWorkunits.d.ts +0 -2565
@@ -1,4 +1,4 @@
1
- var Ni=Object.create;var Bn=Object.defineProperty;var Bi=Object.getOwnPropertyDescriptor;var Qi=Object.getOwnPropertyNames;var Li=Object.getPrototypeOf,Gi=Object.prototype.hasOwnProperty;var Nt=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var ki=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Qi(e))!Gi.call(n,r)&&r!==t&&Bn(n,r,{get:()=>e[r],enumerable:!(s=Bi(e,r))||s.enumerable});return n};var mt=(n,e,t)=>(t=n!=null?Ni(Li(n)):{},ki(e||!n||!n.__esModule?Bn(t,"default",{value:n,enumerable:!0}):t,n));var Zn=Nt((Kt,Kn)=>{(function(n,e){typeof Kt=="object"&&typeof Kn<"u"?e(Kt):typeof define=="function"&&define.amd?define(["exports"],e):e(n.d3=n.d3||{})})(Kt,(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,y,f,d){for(f==null&&(f=0),d==null&&(d=C.length);f<d;){var h=f+d>>>1;c(C[h],y)<0?f=h+1:d=h}return f},right:function(C,y,f,d){for(f==null&&(f=0),d==null&&(d=C.length);f<d;){var h=f+d>>>1;c(C[h],y)>0?d=h:f=h+1}return f}}}function s(c){return function(C,y){return e(c(C),y)}}var r=t(e),i=r.right,o=r.left;function u(c,C){C==null&&(C=p);for(var y=0,f=c.length-1,d=c[0],h=new Array(f<0?0:f);y<f;)h[y]=C(d,d=c[++y]);return h}function p(c,C){return[c,C]}function A(c,C,y){var f=c.length,d=C.length,h=new Array(f*d),F,L,Y,ue;for(y==null&&(y=p),F=Y=0;F<f;++F)for(ue=c[F],L=0;L<d;++L,++Y)h[Y]=y(ue,C[L]);return h}function l(c,C){return C<c?-1:C>c?1:C>=c?0:NaN}function x(c){return c===null?NaN:+c}function S(c,C){var y=c.length,f=0,d=-1,h=0,F,L,Y=0;if(C==null)for(;++d<y;)isNaN(F=x(c[d]))||(L=F-h,h+=L/++f,Y+=L*(F-h));else for(;++d<y;)isNaN(F=x(C(c[d],d,c)))||(L=F-h,h+=L/++f,Y+=L*(F-h));if(f>1)return Y/(f-1)}function M(c,C){var y=S(c,C);return y&&Math.sqrt(y)}function Q(c,C){var y=c.length,f=-1,d,h,F;if(C==null){for(;++f<y;)if((d=c[f])!=null&&d>=d)for(h=F=d;++f<y;)(d=c[f])!=null&&(h>d&&(h=d),F<d&&(F=d))}else for(;++f<y;)if((d=C(c[f],f,c))!=null&&d>=d)for(h=F=d;++f<y;)(d=C(c[f],f,c))!=null&&(h>d&&(h=d),F<d&&(F=d));return[h,F]}var V=Array.prototype,N=V.slice,q=V.map;function G(c){return function(){return c}}function I(c){return c}function b(c,C,y){c=+c,C=+C,y=(d=arguments.length)<2?(C=c,c=0,1):d<3?1:+y;for(var f=-1,d=Math.max(0,Math.ceil((C-c)/y))|0,h=new Array(d);++f<d;)h[f]=c+f*y;return h}var j=Math.sqrt(50),oe=Math.sqrt(10),D=Math.sqrt(2);function P(c,C,y){var f,d=-1,h,F,L;if(C=+C,c=+c,y=+y,c===C&&y>0)return[c];if((f=C<c)&&(h=c,c=C,C=h),(L=w(c,C,y))===0||!isFinite(L))return[];if(L>0)for(c=Math.ceil(c/L),C=Math.floor(C/L),F=new Array(h=Math.ceil(C-c+1));++d<h;)F[d]=(c+d)*L;else for(c=Math.floor(c*L),C=Math.ceil(C*L),F=new Array(h=Math.ceil(c-C+1));++d<h;)F[d]=(c-d)/L;return f&&F.reverse(),F}function w(c,C,y){var f=(C-c)/Math.max(0,y),d=Math.floor(Math.log(f)/Math.LN10),h=f/Math.pow(10,d);return d>=0?(h>=j?10:h>=oe?5:h>=D?2:1)*Math.pow(10,d):-Math.pow(10,-d)/(h>=j?10:h>=oe?5:h>=D?2:1)}function k(c,C,y){var f=Math.abs(C-c)/Math.max(0,y),d=Math.pow(10,Math.floor(Math.log(f)/Math.LN10)),h=f/d;return h>=j?d*=10:h>=oe?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,y=z;function f(d){var h,F=d.length,L,Y=new Array(F);for(h=0;h<F;++h)Y[h]=c(d[h],h,d);var ue=C(Y),Ce=ue[0],de=ue[1],Z=y(Y,Ce,de);Array.isArray(Z)||(Z=k(Ce,de,Z),Z=b(Math.ceil(Ce/Z)*Z,de,Z));for(var ce=Z.length;Z[0]<=Ce;)Z.shift(),--ce;for(;Z[ce-1]>de;)Z.pop(),--ce;var ne=new Array(ce+1),Be;for(h=0;h<=ce;++h)Be=ne[h]=[],Be.x0=h>0?Z[h-1]:Ce,Be.x1=h<ce?Z[h]:de;for(h=0;h<F;++h)L=Y[h],Ce<=L&&L<=de&&ne[i(Z,L,0,ce)].push(d[h]);return ne}return f.value=function(d){return arguments.length?(c=typeof d=="function"?d:G(d),f):c},f.domain=function(d){return arguments.length?(C=typeof d=="function"?d:G([d[0],d[1]]),f):C},f.thresholds=function(d){return arguments.length?(y=typeof d=="function"?d:Array.isArray(d)?G(N.call(d)):G(d),f):y},f}function _(c,C,y){if(y==null&&(y=x),!!(f=c.length)){if((C=+C)<=0||f<2)return+y(c[0],0,c);if(C>=1)return+y(c[f-1],f-1,c);var f,d=(f-1)*C,h=Math.floor(d),F=+y(c[h],h,c),L=+y(c[h+1],h+1,c);return F+(L-F)*(d-h)}}function ge(c,C,y){return c=q.call(c,x).sort(e),Math.ceil((y-C)/(2*(_(c,.75)-_(c,.25))*Math.pow(c.length,-1/3)))}function Fe(c,C,y){return Math.ceil((y-C)/(3.5*M(c)*Math.pow(c.length,-1/3)))}function we(c,C){var y=c.length,f=-1,d,h;if(C==null){for(;++f<y;)if((d=c[f])!=null&&d>=d)for(h=d;++f<y;)(d=c[f])!=null&&d>h&&(h=d)}else for(;++f<y;)if((d=C(c[f],f,c))!=null&&d>=d)for(h=d;++f<y;)(d=C(c[f],f,c))!=null&&d>h&&(h=d);return h}function je(c,C){var y=c.length,f=y,d=-1,h,F=0;if(C==null)for(;++d<y;)isNaN(h=x(c[d]))?--f:F+=h;else for(;++d<y;)isNaN(h=x(C(c[d],d,c)))?--f:F+=h;if(f)return F/f}function J(c,C){var y=c.length,f=-1,d,h=[];if(C==null)for(;++f<y;)isNaN(d=x(c[f]))||h.push(d);else for(;++f<y;)isNaN(d=x(C(c[f],f,c)))||h.push(d);return _(h.sort(e),.5)}function be(c){for(var C=c.length,y,f=-1,d=0,h,F;++f<C;)d+=c[f].length;for(h=new Array(d);--C>=0;)for(F=c[C],y=F.length;--y>=0;)h[--d]=F[y];return h}function he(c,C){var y=c.length,f=-1,d,h;if(C==null){for(;++f<y;)if((d=c[f])!=null&&d>=d)for(h=d;++f<y;)(d=c[f])!=null&&h>d&&(h=d)}else for(;++f<y;)if((d=C(c[f],f,c))!=null&&d>=d)for(h=d;++f<y;)(d=C(c[f],f,c))!=null&&h>d&&(h=d);return h}function ae(c,C){for(var y=C.length,f=new Array(y);y--;)f[y]=c[C[y]];return f}function xe(c,C){if(y=c.length){var y,f=0,d=0,h,F=c[d];for(C==null&&(C=e);++f<y;)(C(h=c[f],F)<0||C(F,F)!==0)&&(F=h,d=f);if(C(F,F)===0)return d}}function Ue(c,C,y){for(var f=(y??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 Ee(c,C){var y=c.length,f=-1,d,h=0;if(C==null)for(;++f<y;)(d=+c[f])&&(h+=d);else for(;++f<y;)(d=+C(c[f],f,c))&&(h+=d);return h}function Pe(c){if(!(h=c.length))return[];for(var C=-1,y=he(c,De),f=new Array(y);++C<y;)for(var d=-1,h,F=f[C]=new Array(h);++d<h;)F[d]=c[d][C];return f}function De(c){return c.length}function Ne(){return Pe(arguments)}n.bisect=i,n.bisectRight=i,n.bisectLeft=o,n.ascending=e,n.bisector=t,n.cross=A,n.descending=l,n.deviation=M,n.extent=Q,n.histogram=se,n.thresholdFreedmanDiaconis=ge,n.thresholdScott=Fe,n.thresholdSturges=z,n.max=we,n.mean=je,n.median=J,n.merge=be,n.min=he,n.pairs=u,n.permute=ae,n.quantile=_,n.range=b,n.scan=xe,n.shuffle=Ue,n.sum=Ee,n.ticks=P,n.tickIncrement=w,n.tickStep=k,n.transpose=Pe,n.variance=S,n.zip=Ne,Object.defineProperty(n,"__esModule",{value:!0})}))});var rr=Nt((ss,nr)=>{(function(n,e){typeof ss=="object"&&typeof nr<"u"?e(ss):typeof define=="function"&&define.amd?define(["exports"],e):(n=n||self,e(n.d3=n.d3||{}))})(ss,function(n){"use strict";var e=new Date,t=new Date;function s(g,R,ee,bt){function re(B){return g(B=arguments.length===0?new Date:new Date(+B)),B}return re.floor=function(B){return g(B=new Date(+B)),B},re.ceil=function(B){return g(B=new Date(B-1)),R(B,1),g(B),B},re.round=function(B){var X=re(B),Re=re.ceil(B);return B-X<Re-B?X:Re},re.offset=function(B,X){return R(B=new Date(+B),X==null?1:Math.floor(X)),B},re.range=function(B,X,Re){var dt=[],Pt;if(B=re.ceil(B),Re=Re==null?1:Math.floor(Re),!(B<X)||!(Re>0))return dt;do dt.push(Pt=new Date(+B)),R(B,Re),g(B);while(Pt<B&&B<X);return dt},re.filter=function(B){return s(function(X){if(X>=X)for(;g(X),!B(X);)X.setTime(X-1)},function(X,Re){if(X>=X)if(Re<0)for(;++Re<=0;)for(;R(X,-1),!B(X););else for(;--Re>=0;)for(;R(X,1),!B(X););})},ee&&(re.count=function(B,X){return e.setTime(+B),t.setTime(+X),g(e),g(t),Math.floor(ee(e,t))},re.every=function(B){return B=Math.floor(B),!isFinite(B)||!(B>0)?null:B>1?re.filter(bt?function(X){return bt(X)%B===0}:function(X){return re.count(0,X)%B===0}):re}),re}var r=s(function(){},function(g,R){g.setTime(+g+R)},function(g,R){return R-g});r.every=function(g){return g=Math.floor(g),!isFinite(g)||!(g>0)?null:g>1?s(function(R){R.setTime(Math.floor(R/g)*g)},function(R,ee){R.setTime(+R+ee*g)},function(R,ee){return(ee-R)/g}):r};var i=r.range,o=1e3,u=6e4,p=36e5,A=864e5,l=6048e5,x=s(function(g){g.setTime(g-g.getMilliseconds())},function(g,R){g.setTime(+g+R*o)},function(g,R){return(R-g)/o},function(g){return g.getUTCSeconds()}),S=x.range,M=s(function(g){g.setTime(g-g.getMilliseconds()-g.getSeconds()*o)},function(g,R){g.setTime(+g+R*u)},function(g,R){return(R-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,R){g.setTime(+g+R*p)},function(g,R){return(R-g)/p},function(g){return g.getHours()}),N=V.range,q=s(function(g){g.setHours(0,0,0,0)},function(g,R){g.setDate(g.getDate()+R)},function(g,R){return(R-g-(R.getTimezoneOffset()-g.getTimezoneOffset())*u)/A},function(g){return g.getDate()-1}),G=q.range;function I(g){return s(function(R){R.setDate(R.getDate()-(R.getDay()+7-g)%7),R.setHours(0,0,0,0)},function(R,ee){R.setDate(R.getDate()+ee*7)},function(R,ee){return(ee-R-(ee.getTimezoneOffset()-R.getTimezoneOffset())*u)/l})}var b=I(0),j=I(1),oe=I(2),D=I(3),P=I(4),w=I(5),k=I(6),z=b.range,se=j.range,_=oe.range,ge=D.range,Fe=P.range,we=w.range,je=k.range,J=s(function(g){g.setDate(1),g.setHours(0,0,0,0)},function(g,R){g.setMonth(g.getMonth()+R)},function(g,R){return R.getMonth()-g.getMonth()+(R.getFullYear()-g.getFullYear())*12},function(g){return g.getMonth()}),be=J.range,he=s(function(g){g.setMonth(0,1),g.setHours(0,0,0,0)},function(g,R){g.setFullYear(g.getFullYear()+R)},function(g,R){return R.getFullYear()-g.getFullYear()},function(g){return g.getFullYear()});he.every=function(g){return!isFinite(g=Math.floor(g))||!(g>0)?null:s(function(R){R.setFullYear(Math.floor(R.getFullYear()/g)*g),R.setMonth(0,1),R.setHours(0,0,0,0)},function(R,ee){R.setFullYear(R.getFullYear()+ee*g)})};var ae=he.range,xe=s(function(g){g.setUTCSeconds(0,0)},function(g,R){g.setTime(+g+R*u)},function(g,R){return(R-g)/u},function(g){return g.getUTCMinutes()}),Ue=xe.range,Ee=s(function(g){g.setUTCMinutes(0,0,0)},function(g,R){g.setTime(+g+R*p)},function(g,R){return(R-g)/p},function(g){return g.getUTCHours()}),Pe=Ee.range,De=s(function(g){g.setUTCHours(0,0,0,0)},function(g,R){g.setUTCDate(g.getUTCDate()+R)},function(g,R){return(R-g)/A},function(g){return g.getUTCDate()-1}),Ne=De.range;function c(g){return s(function(R){R.setUTCDate(R.getUTCDate()-(R.getUTCDay()+7-g)%7),R.setUTCHours(0,0,0,0)},function(R,ee){R.setUTCDate(R.getUTCDate()+ee*7)},function(R,ee){return(ee-R)/l})}var C=c(0),y=c(1),f=c(2),d=c(3),h=c(4),F=c(5),L=c(6),Y=C.range,ue=y.range,Ce=f.range,de=d.range,Z=h.range,ce=F.range,ne=L.range,Be=s(function(g){g.setUTCDate(1),g.setUTCHours(0,0,0,0)},function(g,R){g.setUTCMonth(g.getUTCMonth()+R)},function(g,R){return R.getUTCMonth()-g.getUTCMonth()+(R.getUTCFullYear()-g.getUTCFullYear())*12},function(g){return g.getUTCMonth()}),Ls=Be.range,gt=s(function(g){g.setUTCMonth(0,1),g.setUTCHours(0,0,0,0)},function(g,R){g.setUTCFullYear(g.getUTCFullYear()+R)},function(g,R){return R.getUTCFullYear()-g.getUTCFullYear()},function(g){return g.getUTCFullYear()});gt.every=function(g){return!isFinite(g=Math.floor(g))||!(g>0)?null:s(function(R){R.setUTCFullYear(Math.floor(R.getUTCFullYear()/g)*g),R.setUTCMonth(0,1),R.setUTCHours(0,0,0,0)},function(R,ee){R.setUTCFullYear(R.getUTCFullYear()+ee*g)})};var Gs=gt.range;n.timeDay=q,n.timeDays=G,n.timeFriday=w,n.timeFridays=we,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=be,n.timeSaturday=k,n.timeSaturdays=je,n.timeSecond=x,n.timeSeconds=S,n.timeSunday=b,n.timeSundays=z,n.timeThursday=P,n.timeThursdays=Fe,n.timeTuesday=oe,n.timeTuesdays=_,n.timeWednesday=D,n.timeWednesdays=ge,n.timeWeek=b,n.timeWeeks=z,n.timeYear=he,n.timeYears=ae,n.utcDay=De,n.utcDays=Ne,n.utcFriday=F,n.utcFridays=ce,n.utcHour=Ee,n.utcHours=Pe,n.utcMillisecond=r,n.utcMilliseconds=i,n.utcMinute=xe,n.utcMinutes=Ue,n.utcMonday=y,n.utcMondays=ue,n.utcMonth=Be,n.utcMonths=Ls,n.utcSaturday=L,n.utcSaturdays=ne,n.utcSecond=x,n.utcSeconds=S,n.utcSunday=C,n.utcSundays=Y,n.utcThursday=h,n.utcThursdays=Z,n.utcTuesday=f,n.utcTuesdays=Ce,n.utcWednesday=d,n.utcWednesdays=de,n.utcWeek=C,n.utcWeeks=Y,n.utcYear=gt,n.utcYears=Gs,Object.defineProperty(n,"__esModule",{value:!0})})});var Os=Nt((ns,ir)=>{(function(n,e){typeof ns=="object"&&typeof ir<"u"?e(ns,rr()):typeof define=="function"&&define.amd?define(["exports","d3-time"],e):(n=n||self,e(n.d3=n.d3||{},n.d3))})(ns,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,W){return{y:a,m,d:W,H:0,M:0,S:0,L:0}}function i(a){var m=a.dateTime,W=a.date,U=a.time,Qe=a.periods,Oe=a.days,It=a.shortDays,Mt=a.months,Tt=a.shortMonths,ni=S(Qe),ri=M(Qe),ii=S(Oe),oi=M(Oe),ai=S(It),ui=M(It),ci=S(Mt),li=M(Mt),pi=S(Tt),gi=M(Tt),_e={a:xi,A:Wi,b:Ai,B:Ui,c:null,d:J,e:J,f:Ue,g:F,G:Y,H:be,I:he,j:ae,L:xe,m:Ee,M:Pe,p:Ei,q:Fi,Q:Pn,s:In,S:De,u:Ne,U:c,V:y,w:f,W:d,x:null,X:null,y:h,Y:L,Z:ue,"%":bn},Ye={a:bi,A:Pi,b:Ii,B:Mi,c:null,d:Ce,e:Ce,f:Be,g:Re,G:Pt,H:de,I:Z,j:ce,L:ne,m:Ls,M:gt,p:Ti,q:wi,Q:Pn,s:In,S:Gs,u:g,U:R,V:bt,w:re,W:B,x:null,X:null,y:X,Y:dt,Z:Zr,"%":bn},di={a:fi,A:hi,b:Di,B:Ci,c:Ri,d:P,e:P,f:ge,g:b,G:I,H:k,I:k,j:w,L:_,m:D,M:z,p:mi,q:oe,Q:we,s:je,S:se,u:V,U:N,V:q,w:Q,W:G,x:Si,X:yi,y:b,Y:I,Z:j,"%":Fe};_e.x=Le(W,_e),_e.X=Le(U,_e),_e.c=Le(m,_e),Ye.x=Le(W,Ye),Ye.X=Le(U,Ye),Ye.c=Le(m,Ye);function Le(T,H){return function(O){var E=[],Se=-1,K=0,We=T.length,Ae,Xe,Nn;for(O instanceof Date||(O=new Date(+O));++Se<We;)T.charCodeAt(Se)===37&&(E.push(T.slice(K,Se)),(Xe=o[Ae=T.charAt(++Se)])!=null?Ae=T.charAt(++Se):Xe=Ae==="e"?" ":"0",(Nn=H[Ae])&&(Ae=Nn(O,Xe)),E.push(Ae),K=Se+1);return E.push(T.slice(K,Se)),E.join("")}}function wn(T,H){return function(O){var E=r(1900,void 0,1),Se=wt(E,T,O+="",0),K,We;if(Se!=O.length)return null;if("Q"in E)return new Date(E.Q);if("s"in E)return new Date(E.s*1e3+("L"in E?E.L:0));if(H&&!("Z"in E)&&(E.Z=0),"p"in E&&(E.H=E.H%12+E.p*12),E.m===void 0&&(E.m="q"in E?E.q:0),"V"in E){if(E.V<1||E.V>53)return null;"w"in E||(E.w=1),"Z"in E?(K=s(r(E.y,0,1)),We=K.getUTCDay(),K=We>4||We===0?e.utcMonday.ceil(K):e.utcMonday(K),K=e.utcDay.offset(K,(E.V-1)*7),E.y=K.getUTCFullYear(),E.m=K.getUTCMonth(),E.d=K.getUTCDate()+(E.w+6)%7):(K=t(r(E.y,0,1)),We=K.getDay(),K=We>4||We===0?e.timeMonday.ceil(K):e.timeMonday(K),K=e.timeDay.offset(K,(E.V-1)*7),E.y=K.getFullYear(),E.m=K.getMonth(),E.d=K.getDate()+(E.w+6)%7)}else("W"in E||"U"in E)&&("w"in E||(E.w="u"in E?E.u%7:"W"in E?1:0),We="Z"in E?s(r(E.y,0,1)).getUTCDay():t(r(E.y,0,1)).getDay(),E.m=0,E.d="W"in E?(E.w+6)%7+E.W*7-(We+5)%7:E.w+E.U*7-(We+6)%7);return"Z"in E?(E.H+=E.Z/100|0,E.M+=E.Z%100,s(E)):t(E)}}function wt(T,H,O,E){for(var Se=0,K=H.length,We=O.length,Ae,Xe;Se<K;){if(E>=We)return-1;if(Ae=H.charCodeAt(Se++),Ae===37){if(Ae=H.charAt(Se++),Xe=di[Ae in o?H.charAt(Se++):Ae],!Xe||(E=Xe(T,O,E))<0)return-1}else if(Ae!=O.charCodeAt(E++))return-1}return E}function mi(T,H,O){var E=ni.exec(H.slice(O));return E?(T.p=ri[E[0].toLowerCase()],O+E[0].length):-1}function fi(T,H,O){var E=ai.exec(H.slice(O));return E?(T.w=ui[E[0].toLowerCase()],O+E[0].length):-1}function hi(T,H,O){var E=ii.exec(H.slice(O));return E?(T.w=oi[E[0].toLowerCase()],O+E[0].length):-1}function Di(T,H,O){var E=pi.exec(H.slice(O));return E?(T.m=gi[E[0].toLowerCase()],O+E[0].length):-1}function Ci(T,H,O){var E=ci.exec(H.slice(O));return E?(T.m=li[E[0].toLowerCase()],O+E[0].length):-1}function Ri(T,H,O){return wt(T,m,H,O)}function Si(T,H,O){return wt(T,W,H,O)}function yi(T,H,O){return wt(T,U,H,O)}function xi(T){return It[T.getDay()]}function Wi(T){return Oe[T.getDay()]}function Ai(T){return Tt[T.getMonth()]}function Ui(T){return Mt[T.getMonth()]}function Ei(T){return Qe[+(T.getHours()>=12)]}function Fi(T){return 1+~~(T.getMonth()/3)}function bi(T){return It[T.getUTCDay()]}function Pi(T){return Oe[T.getUTCDay()]}function Ii(T){return Tt[T.getUTCMonth()]}function Mi(T){return Mt[T.getUTCMonth()]}function Ti(T){return Qe[+(T.getUTCHours()>=12)]}function wi(T){return 1+~~(T.getUTCMonth()/3)}return{format:function(T){var H=Le(T+="",_e);return H.toString=function(){return T},H},parse:function(T){var H=wn(T+="",!1);return H.toString=function(){return T},H},utcFormat:function(T){var H=Le(T+="",Ye);return H.toString=function(){return T},H},utcParse:function(T){var H=wn(T+="",!0);return H.toString=function(){return T},H}}}var o={"-":"",_:" ",0:"0"},u=/^\s*\d+/,p=/^%/,A=/[\\^$*+?|[\]().{}]/g;function l(a,m,W){var U=a<0?"-":"",Qe=(U?-a:a)+"",Oe=Qe.length;return U+(Oe<W?new Array(W-Oe+1).join(m)+Qe:Qe)}function x(a){return a.replace(A,"\\$&")}function S(a){return new RegExp("^(?:"+a.map(x).join("|")+")","i")}function M(a){for(var m={},W=-1,U=a.length;++W<U;)m[a[W].toLowerCase()]=W;return m}function Q(a,m,W){var U=u.exec(m.slice(W,W+1));return U?(a.w=+U[0],W+U[0].length):-1}function V(a,m,W){var U=u.exec(m.slice(W,W+1));return U?(a.u=+U[0],W+U[0].length):-1}function N(a,m,W){var U=u.exec(m.slice(W,W+2));return U?(a.U=+U[0],W+U[0].length):-1}function q(a,m,W){var U=u.exec(m.slice(W,W+2));return U?(a.V=+U[0],W+U[0].length):-1}function G(a,m,W){var U=u.exec(m.slice(W,W+2));return U?(a.W=+U[0],W+U[0].length):-1}function I(a,m,W){var U=u.exec(m.slice(W,W+4));return U?(a.y=+U[0],W+U[0].length):-1}function b(a,m,W){var U=u.exec(m.slice(W,W+2));return U?(a.y=+U[0]+(+U[0]>68?1900:2e3),W+U[0].length):-1}function j(a,m,W){var U=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(m.slice(W,W+6));return U?(a.Z=U[1]?0:-(U[2]+(U[3]||"00")),W+U[0].length):-1}function oe(a,m,W){var U=u.exec(m.slice(W,W+1));return U?(a.q=U[0]*3-3,W+U[0].length):-1}function D(a,m,W){var U=u.exec(m.slice(W,W+2));return U?(a.m=U[0]-1,W+U[0].length):-1}function P(a,m,W){var U=u.exec(m.slice(W,W+2));return U?(a.d=+U[0],W+U[0].length):-1}function w(a,m,W){var U=u.exec(m.slice(W,W+3));return U?(a.m=0,a.d=+U[0],W+U[0].length):-1}function k(a,m,W){var U=u.exec(m.slice(W,W+2));return U?(a.H=+U[0],W+U[0].length):-1}function z(a,m,W){var U=u.exec(m.slice(W,W+2));return U?(a.M=+U[0],W+U[0].length):-1}function se(a,m,W){var U=u.exec(m.slice(W,W+2));return U?(a.S=+U[0],W+U[0].length):-1}function _(a,m,W){var U=u.exec(m.slice(W,W+3));return U?(a.L=+U[0],W+U[0].length):-1}function ge(a,m,W){var U=u.exec(m.slice(W,W+6));return U?(a.L=Math.floor(U[0]/1e3),W+U[0].length):-1}function Fe(a,m,W){var U=p.exec(m.slice(W,W+1));return U?W+U[0].length:-1}function we(a,m,W){var U=u.exec(m.slice(W));return U?(a.Q=+U[0],W+U[0].length):-1}function je(a,m,W){var U=u.exec(m.slice(W));return U?(a.s=+U[0],W+U[0].length):-1}function J(a,m){return l(a.getDate(),m,2)}function be(a,m){return l(a.getHours(),m,2)}function he(a,m){return l(a.getHours()%12||12,m,2)}function ae(a,m){return l(1+e.timeDay.count(e.timeYear(a),a),m,3)}function xe(a,m){return l(a.getMilliseconds(),m,3)}function Ue(a,m){return xe(a,m)+"000"}function Ee(a,m){return l(a.getMonth()+1,m,2)}function Pe(a,m){return l(a.getMinutes(),m,2)}function De(a,m){return l(a.getSeconds(),m,2)}function Ne(a){var m=a.getDay();return m===0?7:m}function c(a,m){return l(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 y(a,m){return a=C(a),l(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 l(e.timeMonday.count(e.timeYear(a)-1,a),m,2)}function h(a,m){return l(a.getFullYear()%100,m,2)}function F(a,m){return a=C(a),l(a.getFullYear()%100,m,2)}function L(a,m){return l(a.getFullYear()%1e4,m,4)}function Y(a,m){var W=a.getDay();return a=W>=4||W===0?e.timeThursday(a):e.timeThursday.ceil(a),l(a.getFullYear()%1e4,m,4)}function ue(a){var m=a.getTimezoneOffset();return(m>0?"-":(m*=-1,"+"))+l(m/60|0,"0",2)+l(m%60,"0",2)}function Ce(a,m){return l(a.getUTCDate(),m,2)}function de(a,m){return l(a.getUTCHours(),m,2)}function Z(a,m){return l(a.getUTCHours()%12||12,m,2)}function ce(a,m){return l(1+e.utcDay.count(e.utcYear(a),a),m,3)}function ne(a,m){return l(a.getUTCMilliseconds(),m,3)}function Be(a,m){return ne(a,m)+"000"}function Ls(a,m){return l(a.getUTCMonth()+1,m,2)}function gt(a,m){return l(a.getUTCMinutes(),m,2)}function Gs(a,m){return l(a.getUTCSeconds(),m,2)}function g(a){var m=a.getUTCDay();return m===0?7:m}function R(a,m){return l(e.utcSunday.count(e.utcYear(a)-1,a),m,2)}function ee(a){var m=a.getUTCDay();return m>=4||m===0?e.utcThursday(a):e.utcThursday.ceil(a)}function bt(a,m){return a=ee(a),l(e.utcThursday.count(e.utcYear(a),a)+(e.utcYear(a).getUTCDay()===4),m,2)}function re(a){return a.getUTCDay()}function B(a,m){return l(e.utcMonday.count(e.utcYear(a)-1,a),m,2)}function X(a,m){return l(a.getUTCFullYear()%100,m,2)}function Re(a,m){return a=ee(a),l(a.getUTCFullYear()%100,m,2)}function dt(a,m){return l(a.getUTCFullYear()%1e4,m,4)}function Pt(a,m){var W=a.getUTCDay();return a=W>=4||W===0?e.utcThursday(a):e.utcThursday.ceil(a),l(a.getUTCFullYear()%1e4,m,4)}function Zr(){return"+0000"}function bn(){return"%"}function Pn(a){return+a}function In(a){return Math.floor(+a/1e3)}var rt;Mn({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 Mn(a){return rt=i(a),n.timeFormat=rt.format,n.timeParse=rt.parse,n.utcFormat=rt.utcFormat,n.utcParse=rt.utcParse,rt}var Tn="%Y-%m-%dT%H:%M:%S.%LZ";function $r(a){return a.toISOString()}var ei=Date.prototype.toISOString?$r:n.utcFormat(Tn);function ti(a){var m=new Date(a);return isNaN(m)?null:m}var si=+new Date("2000-01-01T00:00:00.000Z")?ti:n.utcParse(Tn);n.isoFormat=ei,n.isoParse=si,n.timeFormatDefaultLocale=Mn,n.timeFormatLocale=i,Object.defineProperty(n,"__esModule",{value:!0})})});var Ys=Nt((us,pr)=>{(function(n,e){typeof us=="object"&&typeof pr<"u"?e(us):typeof define=="function"&&define.amd?define(["exports"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.d3=n.d3||{}))})(us,(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,k=D.slice(0,w);return[k.length>1?k[0]+k.slice(2):k,+D.slice(w+1)]}function s(D){return D=t(Math.abs(D)),D?D[1]:NaN}function r(D,P){return function(w,k){for(var z=w.length,se=[],_=0,ge=D[0],Fe=0;z>0&&ge>0&&(Fe+ge+1>k&&(ge=Math.max(1,k-Fe)),se.push(w.substring(z-=ge,z+ge)),!((Fe+=ge+1)>k));)ge=D[_=(_+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 p({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=p.prototype;function p(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+""}p.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 A(D){e:for(var P=D.length,w=1,k=-1,z;w<P;++w)switch(D[w]){case".":k=z=w;break;case"0":k===0&&(k=w),z=w;break;default:if(!+D[w])break e;k>0&&(k=0);break}return k>0?D.slice(0,k)+D.slice(z+1):D}var l;function x(D,P){var w=t(D,P);if(!w)return D+"";var k=w[0],z=w[1],se=z-(l=Math.max(-8,Math.min(8,Math.floor(z/3)))*3)+1,_=k.length;return se===_?k:se>_?k+new Array(se-_+1).join("0"):se>0?k.slice(0,se)+"."+k.slice(se):"0."+new Array(1-se).join("0")+t(D,Math.max(0,P+se-1))[0]}function S(D,P){var w=t(D,P);if(!w)return D+"";var k=w[0],z=w[1];return z<0?"0."+new Array(-z).join("0")+k:k.length>z+1?k.slice(0,z+1)+"."+k.slice(z+1):k+new Array(z-k.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 S(D*100,P)},r:S,s:x,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]+"",k=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)),_=D.percent===void 0?"%":D.percent+"",ge=D.minus===void 0?"-":D.minus+"",Fe=D.nan===void 0?"NaN":D.nan+"";function we(J){J=u(J);var be=J.fill,he=J.align,ae=J.sign,xe=J.symbol,Ue=J.zero,Ee=J.width,Pe=J.comma,De=J.precision,Ne=J.trim,c=J.type;c==="n"?(Pe=!0,c="g"):M[c]||(De===void 0&&(De=12),Ne=!0,c="g"),(Ue||be==="0"&&he==="=")&&(Ue=!0,be="0",he="=");var C=xe==="$"?w:xe==="#"&&/[boxX]/.test(c)?"0"+c.toLowerCase():"",y=xe==="$"?k:/[%p]/.test(c)?_:"",f=M[c],d=/[defgprs%]/.test(c);De=De===void 0?6:/[gprs]/.test(c)?Math.max(1,Math.min(21,De)):Math.max(0,Math.min(20,De));function h(F){var L=C,Y=y,ue,Ce,de;if(c==="c")Y=f(F)+Y,F="";else{F=+F;var Z=F<0||1/F<0;if(F=isNaN(F)?Fe:f(Math.abs(F),De),Ne&&(F=A(F)),Z&&+F==0&&ae!=="+"&&(Z=!1),L=(Z?ae==="("?ae:ge:ae==="-"||ae==="("?"":ae)+L,Y=(c==="s"?N[8+l/3]:"")+Y+(Z&&ae==="("?")":""),d){for(ue=-1,Ce=F.length;++ue<Ce;)if(de=F.charCodeAt(ue),48>de||de>57){Y=(de===46?z+F.slice(ue+1):F.slice(ue))+Y,F=F.slice(0,ue);break}}}Pe&&!Ue&&(F=P(F,1/0));var ce=L.length+F.length+Y.length,ne=ce<Ee?new Array(Ee-ce+1).join(be):"";switch(Pe&&Ue&&(F=P(ne+F,ne.length?Ee-Y.length:1/0),ne=""),he){case"<":F=L+F+Y+ne;break;case"=":F=L+ne+F+Y;break;case"^":F=ne.slice(0,ce=ne.length>>1)+L+F+Y+ne.slice(ce);break;default:F=ne+L+F+Y;break}return se(F)}return h.toString=function(){return J+""},h}function je(J,be){var he=we((J=u(J),J.type="f",J)),ae=Math.max(-8,Math.min(8,Math.floor(s(be)/3)))*3,xe=Math.pow(10,-ae),Ue=N[8+ae/3];return function(Ee){return he(xe*Ee)+Ue}}return{format:we,formatPrefix:je}}var G;I({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function I(D){return G=q(D),n.format=G.format,n.formatPrefix=G.formatPrefix,G}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 oe(D,P){return D=Math.abs(D),P=Math.abs(P)-D,Math.max(0,s(P)-s(D))+1}n.FormatSpecifier=p,n.formatDefaultLocale=I,n.formatLocale=q,n.formatSpecifier=u,n.precisionFixed=b,n.precisionPrefix=j,n.precisionRound=oe,Object.defineProperty(n,"__esModule",{value:!0})}))});import{root as Ft}from"@hpcc-js/util";import{DOMParser as La}from"@xmldom/xmldom";import*as ye from"node:https";import{Buffer as Kr}from"node:buffer";import{fetch as Ga,Agent as ka}from"undici";var Qn=`
1
+ var Ni=Object.create;var Bn=Object.defineProperty;var Bi=Object.getOwnPropertyDescriptor;var Qi=Object.getOwnPropertyNames;var Li=Object.getPrototypeOf,Gi=Object.prototype.hasOwnProperty;var Nt=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var ki=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Qi(e))!Gi.call(n,r)&&r!==t&&Bn(n,r,{get:()=>e[r],enumerable:!(s=Bi(e,r))||s.enumerable});return n};var mt=(n,e,t)=>(t=n!=null?Ni(Li(n)):{},ki(e||!n||!n.__esModule?Bn(t,"default",{value:n,enumerable:!0}):t,n));var Zn=Nt((Kt,Kn)=>{(function(n,e){typeof Kt=="object"&&typeof Kn<"u"?e(Kt):typeof define=="function"&&define.amd?define(["exports"],e):e(n.d3=n.d3||{})})(Kt,(function(n){"use strict";function e(u,S){return u<S?-1:u>S?1:u>=S?0:NaN}function t(u){return u.length===1&&(u=s(u)),{left:function(S,A,h,d){for(h==null&&(h=0),d==null&&(d=S.length);h<d;){var f=h+d>>>1;u(S[f],A)<0?h=f+1:d=f}return h},right:function(S,A,h,d){for(h==null&&(h=0),d==null&&(d=S.length);h<d;){var f=h+d>>>1;u(S[f],A)>0?d=f:h=f+1}return h}}}function s(u){return function(S,A){return e(u(S),A)}}var r=t(e),i=r.right,o=r.left;function c(u,S){S==null&&(S=g);for(var A=0,h=u.length-1,d=u[0],f=new Array(h<0?0:h);A<h;)f[A]=S(d,d=u[++A]);return f}function g(u,S){return[u,S]}function W(u,S,A){var h=u.length,d=S.length,f=new Array(h*d),E,L,Y,ce;for(A==null&&(A=g),E=Y=0;E<h;++E)for(ce=u[E],L=0;L<d;++L,++Y)f[Y]=A(ce,S[L]);return f}function l(u,S){return S<u?-1:S>u?1:S>=u?0:NaN}function y(u){return u===null?NaN:+u}function R(u,S){var A=u.length,h=0,d=-1,f=0,E,L,Y=0;if(S==null)for(;++d<A;)isNaN(E=y(u[d]))||(L=E-f,f+=L/++h,Y+=L*(E-f));else for(;++d<A;)isNaN(E=y(S(u[d],d,u)))||(L=E-f,f+=L/++h,Y+=L*(E-f));if(h>1)return Y/(h-1)}function M(u,S){var A=R(u,S);return A&&Math.sqrt(A)}function Q(u,S){var A=u.length,h=-1,d,f,E;if(S==null){for(;++h<A;)if((d=u[h])!=null&&d>=d)for(f=E=d;++h<A;)(d=u[h])!=null&&(f>d&&(f=d),E<d&&(E=d))}else for(;++h<A;)if((d=S(u[h],h,u))!=null&&d>=d)for(f=E=d;++h<A;)(d=S(u[h],h,u))!=null&&(f>d&&(f=d),E<d&&(E=d));return[f,E]}var V=Array.prototype,N=V.slice,q=V.map;function G(u){return function(){return u}}function P(u){return u}function F(u,S,A){u=+u,S=+S,A=(d=arguments.length)<2?(S=u,u=0,1):d<3?1:+A;for(var h=-1,d=Math.max(0,Math.ceil((S-u)/A))|0,f=new Array(d);++h<d;)f[h]=u+h*A;return f}var j=Math.sqrt(50),oe=Math.sqrt(10),D=Math.sqrt(2);function I(u,S,A){var h,d=-1,f,E,L;if(S=+S,u=+u,A=+A,u===S&&A>0)return[u];if((h=S<u)&&(f=u,u=S,S=f),(L=w(u,S,A))===0||!isFinite(L))return[];if(L>0)for(u=Math.ceil(u/L),S=Math.floor(S/L),E=new Array(f=Math.ceil(S-u+1));++d<f;)E[d]=(u+d)*L;else for(u=Math.floor(u*L),S=Math.ceil(S*L),E=new Array(f=Math.ceil(u-S+1));++d<f;)E[d]=(u-d)/L;return h&&E.reverse(),E}function w(u,S,A){var h=(S-u)/Math.max(0,A),d=Math.floor(Math.log(h)/Math.LN10),f=h/Math.pow(10,d);return d>=0?(f>=j?10:f>=oe?5:f>=D?2:1)*Math.pow(10,d):-Math.pow(10,-d)/(f>=j?10:f>=oe?5:f>=D?2:1)}function k(u,S,A){var h=Math.abs(S-u)/Math.max(0,A),d=Math.pow(10,Math.floor(Math.log(h)/Math.LN10)),f=h/d;return f>=j?d*=10:f>=oe?d*=5:f>=D&&(d*=2),S<u?-d:d}function z(u){return Math.ceil(Math.log(u.length)/Math.LN2)+1}function se(){var u=P,S=Q,A=z;function h(d){var f,E=d.length,L,Y=new Array(E);for(f=0;f<E;++f)Y[f]=u(d[f],f,d);var ce=S(Y),Se=ce[0],de=ce[1],Z=A(Y,Se,de);Array.isArray(Z)||(Z=k(Se,de,Z),Z=F(Math.ceil(Se/Z)*Z,de,Z));for(var ue=Z.length;Z[0]<=Se;)Z.shift(),--ue;for(;Z[ue-1]>de;)Z.pop(),--ue;var ne=new Array(ue+1),Be;for(f=0;f<=ue;++f)Be=ne[f]=[],Be.x0=f>0?Z[f-1]:Se,Be.x1=f<ue?Z[f]:de;for(f=0;f<E;++f)L=Y[f],Se<=L&&L<=de&&ne[i(Z,L,0,ue)].push(d[f]);return ne}return h.value=function(d){return arguments.length?(u=typeof d=="function"?d:G(d),h):u},h.domain=function(d){return arguments.length?(S=typeof d=="function"?d:G([d[0],d[1]]),h):S},h.thresholds=function(d){return arguments.length?(A=typeof d=="function"?d:Array.isArray(d)?G(N.call(d)):G(d),h):A},h}function _(u,S,A){if(A==null&&(A=y),!!(h=u.length)){if((S=+S)<=0||h<2)return+A(u[0],0,u);if(S>=1)return+A(u[h-1],h-1,u);var h,d=(h-1)*S,f=Math.floor(d),E=+A(u[f],f,u),L=+A(u[f+1],f+1,u);return E+(L-E)*(d-f)}}function pe(u,S,A){return u=q.call(u,y).sort(e),Math.ceil((A-S)/(2*(_(u,.75)-_(u,.25))*Math.pow(u.length,-1/3)))}function Ee(u,S,A){return Math.ceil((A-S)/(3.5*M(u)*Math.pow(u.length,-1/3)))}function we(u,S){var A=u.length,h=-1,d,f;if(S==null){for(;++h<A;)if((d=u[h])!=null&&d>=d)for(f=d;++h<A;)(d=u[h])!=null&&d>f&&(f=d)}else for(;++h<A;)if((d=S(u[h],h,u))!=null&&d>=d)for(f=d;++h<A;)(d=S(u[h],h,u))!=null&&d>f&&(f=d);return f}function je(u,S){var A=u.length,h=A,d=-1,f,E=0;if(S==null)for(;++d<A;)isNaN(f=y(u[d]))?--h:E+=f;else for(;++d<A;)isNaN(f=y(S(u[d],d,u)))?--h:E+=f;if(h)return E/h}function J(u,S){var A=u.length,h=-1,d,f=[];if(S==null)for(;++h<A;)isNaN(d=y(u[h]))||f.push(d);else for(;++h<A;)isNaN(d=y(S(u[h],h,u)))||f.push(d);return _(f.sort(e),.5)}function Fe(u){for(var S=u.length,A,h=-1,d=0,f,E;++h<S;)d+=u[h].length;for(f=new Array(d);--S>=0;)for(E=u[S],A=E.length;--A>=0;)f[--d]=E[A];return f}function fe(u,S){var A=u.length,h=-1,d,f;if(S==null){for(;++h<A;)if((d=u[h])!=null&&d>=d)for(f=d;++h<A;)(d=u[h])!=null&&f>d&&(f=d)}else for(;++h<A;)if((d=S(u[h],h,u))!=null&&d>=d)for(f=d;++h<A;)(d=S(u[h],h,u))!=null&&f>d&&(f=d);return f}function ae(u,S){for(var A=S.length,h=new Array(A);A--;)h[A]=u[S[A]];return h}function ye(u,S){if(A=u.length){var A,h=0,d=0,f,E=u[d];for(S==null&&(S=e);++h<A;)(S(f=u[h],E)<0||S(E,E)!==0)&&(E=f,d=h);if(S(E,E)===0)return d}}function be(u,S,A){for(var h=(A??u.length)-(S=S==null?0:+S),d,f;h;)f=Math.random()*h--|0,d=u[h+S],u[h+S]=u[f+S],u[f+S]=d;return u}function Ue(u,S){var A=u.length,h=-1,d,f=0;if(S==null)for(;++h<A;)(d=+u[h])&&(f+=d);else for(;++h<A;)(d=+S(u[h],h,u))&&(f+=d);return f}function Ie(u){if(!(f=u.length))return[];for(var S=-1,A=fe(u,De),h=new Array(A);++S<A;)for(var d=-1,f,E=h[S]=new Array(f);++d<f;)E[d]=u[d][S];return h}function De(u){return u.length}function Ne(){return Ie(arguments)}n.bisect=i,n.bisectRight=i,n.bisectLeft=o,n.ascending=e,n.bisector=t,n.cross=W,n.descending=l,n.deviation=M,n.extent=Q,n.histogram=se,n.thresholdFreedmanDiaconis=pe,n.thresholdScott=Ee,n.thresholdSturges=z,n.max=we,n.mean=je,n.median=J,n.merge=Fe,n.min=fe,n.pairs=c,n.permute=ae,n.quantile=_,n.range=F,n.scan=ye,n.shuffle=be,n.sum=Ue,n.ticks=I,n.tickIncrement=w,n.tickStep=k,n.transpose=Ie,n.variance=R,n.zip=Ne,Object.defineProperty(n,"__esModule",{value:!0})}))});var rr=Nt((ss,nr)=>{(function(n,e){typeof ss=="object"&&typeof nr<"u"?e(ss):typeof define=="function"&&define.amd?define(["exports"],e):(n=n||self,e(n.d3=n.d3||{}))})(ss,function(n){"use strict";var e=new Date,t=new Date;function s(p,C,ee,Ft){function re(B){return p(B=arguments.length===0?new Date:new Date(+B)),B}return re.floor=function(B){return p(B=new Date(+B)),B},re.ceil=function(B){return p(B=new Date(B-1)),C(B,1),p(B),B},re.round=function(B){var X=re(B),Ce=re.ceil(B);return B-X<Ce-B?X:Ce},re.offset=function(B,X){return C(B=new Date(+B),X==null?1:Math.floor(X)),B},re.range=function(B,X,Ce){var dt=[],It;if(B=re.ceil(B),Ce=Ce==null?1:Math.floor(Ce),!(B<X)||!(Ce>0))return dt;do dt.push(It=new Date(+B)),C(B,Ce),p(B);while(It<B&&B<X);return dt},re.filter=function(B){return s(function(X){if(X>=X)for(;p(X),!B(X);)X.setTime(X-1)},function(X,Ce){if(X>=X)if(Ce<0)for(;++Ce<=0;)for(;C(X,-1),!B(X););else for(;--Ce>=0;)for(;C(X,1),!B(X););})},ee&&(re.count=function(B,X){return e.setTime(+B),t.setTime(+X),p(e),p(t),Math.floor(ee(e,t))},re.every=function(B){return B=Math.floor(B),!isFinite(B)||!(B>0)?null:B>1?re.filter(Ft?function(X){return Ft(X)%B===0}:function(X){return re.count(0,X)%B===0}):re}),re}var r=s(function(){},function(p,C){p.setTime(+p+C)},function(p,C){return C-p});r.every=function(p){return p=Math.floor(p),!isFinite(p)||!(p>0)?null:p>1?s(function(C){C.setTime(Math.floor(C/p)*p)},function(C,ee){C.setTime(+C+ee*p)},function(C,ee){return(ee-C)/p}):r};var i=r.range,o=1e3,c=6e4,g=36e5,W=864e5,l=6048e5,y=s(function(p){p.setTime(p-p.getMilliseconds())},function(p,C){p.setTime(+p+C*o)},function(p,C){return(C-p)/o},function(p){return p.getUTCSeconds()}),R=y.range,M=s(function(p){p.setTime(p-p.getMilliseconds()-p.getSeconds()*o)},function(p,C){p.setTime(+p+C*c)},function(p,C){return(C-p)/c},function(p){return p.getMinutes()}),Q=M.range,V=s(function(p){p.setTime(p-p.getMilliseconds()-p.getSeconds()*o-p.getMinutes()*c)},function(p,C){p.setTime(+p+C*g)},function(p,C){return(C-p)/g},function(p){return p.getHours()}),N=V.range,q=s(function(p){p.setHours(0,0,0,0)},function(p,C){p.setDate(p.getDate()+C)},function(p,C){return(C-p-(C.getTimezoneOffset()-p.getTimezoneOffset())*c)/W},function(p){return p.getDate()-1}),G=q.range;function P(p){return s(function(C){C.setDate(C.getDate()-(C.getDay()+7-p)%7),C.setHours(0,0,0,0)},function(C,ee){C.setDate(C.getDate()+ee*7)},function(C,ee){return(ee-C-(ee.getTimezoneOffset()-C.getTimezoneOffset())*c)/l})}var F=P(0),j=P(1),oe=P(2),D=P(3),I=P(4),w=P(5),k=P(6),z=F.range,se=j.range,_=oe.range,pe=D.range,Ee=I.range,we=w.range,je=k.range,J=s(function(p){p.setDate(1),p.setHours(0,0,0,0)},function(p,C){p.setMonth(p.getMonth()+C)},function(p,C){return C.getMonth()-p.getMonth()+(C.getFullYear()-p.getFullYear())*12},function(p){return p.getMonth()}),Fe=J.range,fe=s(function(p){p.setMonth(0,1),p.setHours(0,0,0,0)},function(p,C){p.setFullYear(p.getFullYear()+C)},function(p,C){return C.getFullYear()-p.getFullYear()},function(p){return p.getFullYear()});fe.every=function(p){return!isFinite(p=Math.floor(p))||!(p>0)?null:s(function(C){C.setFullYear(Math.floor(C.getFullYear()/p)*p),C.setMonth(0,1),C.setHours(0,0,0,0)},function(C,ee){C.setFullYear(C.getFullYear()+ee*p)})};var ae=fe.range,ye=s(function(p){p.setUTCSeconds(0,0)},function(p,C){p.setTime(+p+C*c)},function(p,C){return(C-p)/c},function(p){return p.getUTCMinutes()}),be=ye.range,Ue=s(function(p){p.setUTCMinutes(0,0,0)},function(p,C){p.setTime(+p+C*g)},function(p,C){return(C-p)/g},function(p){return p.getUTCHours()}),Ie=Ue.range,De=s(function(p){p.setUTCHours(0,0,0,0)},function(p,C){p.setUTCDate(p.getUTCDate()+C)},function(p,C){return(C-p)/W},function(p){return p.getUTCDate()-1}),Ne=De.range;function u(p){return s(function(C){C.setUTCDate(C.getUTCDate()-(C.getUTCDay()+7-p)%7),C.setUTCHours(0,0,0,0)},function(C,ee){C.setUTCDate(C.getUTCDate()+ee*7)},function(C,ee){return(ee-C)/l})}var S=u(0),A=u(1),h=u(2),d=u(3),f=u(4),E=u(5),L=u(6),Y=S.range,ce=A.range,Se=h.range,de=d.range,Z=f.range,ue=E.range,ne=L.range,Be=s(function(p){p.setUTCDate(1),p.setUTCHours(0,0,0,0)},function(p,C){p.setUTCMonth(p.getUTCMonth()+C)},function(p,C){return C.getUTCMonth()-p.getUTCMonth()+(C.getUTCFullYear()-p.getUTCFullYear())*12},function(p){return p.getUTCMonth()}),Ls=Be.range,pt=s(function(p){p.setUTCMonth(0,1),p.setUTCHours(0,0,0,0)},function(p,C){p.setUTCFullYear(p.getUTCFullYear()+C)},function(p,C){return C.getUTCFullYear()-p.getUTCFullYear()},function(p){return p.getUTCFullYear()});pt.every=function(p){return!isFinite(p=Math.floor(p))||!(p>0)?null:s(function(C){C.setUTCFullYear(Math.floor(C.getUTCFullYear()/p)*p),C.setUTCMonth(0,1),C.setUTCHours(0,0,0,0)},function(C,ee){C.setUTCFullYear(C.getUTCFullYear()+ee*p)})};var Gs=pt.range;n.timeDay=q,n.timeDays=G,n.timeFriday=w,n.timeFridays=we,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=Fe,n.timeSaturday=k,n.timeSaturdays=je,n.timeSecond=y,n.timeSeconds=R,n.timeSunday=F,n.timeSundays=z,n.timeThursday=I,n.timeThursdays=Ee,n.timeTuesday=oe,n.timeTuesdays=_,n.timeWednesday=D,n.timeWednesdays=pe,n.timeWeek=F,n.timeWeeks=z,n.timeYear=fe,n.timeYears=ae,n.utcDay=De,n.utcDays=Ne,n.utcFriday=E,n.utcFridays=ue,n.utcHour=Ue,n.utcHours=Ie,n.utcMillisecond=r,n.utcMilliseconds=i,n.utcMinute=ye,n.utcMinutes=be,n.utcMonday=A,n.utcMondays=ce,n.utcMonth=Be,n.utcMonths=Ls,n.utcSaturday=L,n.utcSaturdays=ne,n.utcSecond=y,n.utcSeconds=R,n.utcSunday=S,n.utcSundays=Y,n.utcThursday=f,n.utcThursdays=Z,n.utcTuesday=h,n.utcTuesdays=Se,n.utcWednesday=d,n.utcWednesdays=de,n.utcWeek=S,n.utcWeeks=Y,n.utcYear=pt,n.utcYears=Gs,Object.defineProperty(n,"__esModule",{value:!0})})});var Os=Nt((ns,ir)=>{(function(n,e){typeof ns=="object"&&typeof ir<"u"?e(ns,rr()):typeof define=="function"&&define.amd?define(["exports","d3-time"],e):(n=n||self,e(n.d3=n.d3||{},n.d3))})(ns,function(n,e){"use strict";function t(a){if(0<=a.y&&a.y<100){var m=new Date(-1,a.m,a.d,a.H,a.M,a.S,a.L);return m.setFullYear(a.y),m}return new Date(a.y,a.m,a.d,a.H,a.M,a.S,a.L)}function s(a){if(0<=a.y&&a.y<100){var m=new Date(Date.UTC(-1,a.m,a.d,a.H,a.M,a.S,a.L));return m.setUTCFullYear(a.y),m}return new Date(Date.UTC(a.y,a.m,a.d,a.H,a.M,a.S,a.L))}function r(a,m,x){return{y:a,m,d:x,H:0,M:0,S:0,L:0}}function i(a){var m=a.dateTime,x=a.date,b=a.time,Qe=a.periods,Oe=a.days,Pt=a.shortDays,Mt=a.months,Tt=a.shortMonths,ni=R(Qe),ri=M(Qe),ii=R(Oe),oi=M(Oe),ai=R(Pt),ci=M(Pt),ui=R(Mt),li=M(Mt),gi=R(Tt),pi=M(Tt),_e={a:yi,A:xi,b:Wi,B:bi,c:null,d:J,e:J,f:be,g:E,G:Y,H:Fe,I:fe,j:ae,L:ye,m:Ue,M:Ie,p:Ui,q:Ei,Q:In,s:Pn,S:De,u:Ne,U:u,V:A,w:h,W:d,x:null,X:null,y:f,Y:L,Z:ce,"%":Fn},Ye={a:Fi,A:Ii,b:Pi,B:Mi,c:null,d:Se,e:Se,f:Be,g:Ce,G:It,H:de,I:Z,j:ue,L:ne,m:Ls,M:pt,p:Ti,q:wi,Q:In,s:Pn,S:Gs,u:p,U:C,V:Ft,w:re,W:B,x:null,X:null,y:X,Y:dt,Z:Zr,"%":Fn},di={a:hi,A:fi,b:Di,B:Si,c:Ci,d:I,e:I,f:pe,g:F,G:P,H:k,I:k,j:w,L:_,m:D,M:z,p:mi,q:oe,Q:we,s:je,S:se,u:V,U:N,V:q,w:Q,W:G,x:Ri,X:Ai,y:F,Y:P,Z:j,"%":Ee};_e.x=Le(x,_e),_e.X=Le(b,_e),_e.c=Le(m,_e),Ye.x=Le(x,Ye),Ye.X=Le(b,Ye),Ye.c=Le(m,Ye);function Le(T,H){return function(O){var U=[],Re=-1,K=0,xe=T.length,We,Xe,Nn;for(O instanceof Date||(O=new Date(+O));++Re<xe;)T.charCodeAt(Re)===37&&(U.push(T.slice(K,Re)),(Xe=o[We=T.charAt(++Re)])!=null?We=T.charAt(++Re):Xe=We==="e"?" ":"0",(Nn=H[We])&&(We=Nn(O,Xe)),U.push(We),K=Re+1);return U.push(T.slice(K,Re)),U.join("")}}function wn(T,H){return function(O){var U=r(1900,void 0,1),Re=wt(U,T,O+="",0),K,xe;if(Re!=O.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)),xe=K.getUTCDay(),K=xe>4||xe===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)),xe=K.getDay(),K=xe>4||xe===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),xe="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-(xe+5)%7:U.w+U.U*7-(xe+6)%7);return"Z"in U?(U.H+=U.Z/100|0,U.M+=U.Z%100,s(U)):t(U)}}function wt(T,H,O,U){for(var Re=0,K=H.length,xe=O.length,We,Xe;Re<K;){if(U>=xe)return-1;if(We=H.charCodeAt(Re++),We===37){if(We=H.charAt(Re++),Xe=di[We in o?H.charAt(Re++):We],!Xe||(U=Xe(T,O,U))<0)return-1}else if(We!=O.charCodeAt(U++))return-1}return U}function mi(T,H,O){var U=ni.exec(H.slice(O));return U?(T.p=ri[U[0].toLowerCase()],O+U[0].length):-1}function hi(T,H,O){var U=ai.exec(H.slice(O));return U?(T.w=ci[U[0].toLowerCase()],O+U[0].length):-1}function fi(T,H,O){var U=ii.exec(H.slice(O));return U?(T.w=oi[U[0].toLowerCase()],O+U[0].length):-1}function Di(T,H,O){var U=gi.exec(H.slice(O));return U?(T.m=pi[U[0].toLowerCase()],O+U[0].length):-1}function Si(T,H,O){var U=ui.exec(H.slice(O));return U?(T.m=li[U[0].toLowerCase()],O+U[0].length):-1}function Ci(T,H,O){return wt(T,m,H,O)}function Ri(T,H,O){return wt(T,x,H,O)}function Ai(T,H,O){return wt(T,b,H,O)}function yi(T){return Pt[T.getDay()]}function xi(T){return Oe[T.getDay()]}function Wi(T){return Tt[T.getMonth()]}function bi(T){return Mt[T.getMonth()]}function Ui(T){return Qe[+(T.getHours()>=12)]}function Ei(T){return 1+~~(T.getMonth()/3)}function Fi(T){return Pt[T.getUTCDay()]}function Ii(T){return Oe[T.getUTCDay()]}function Pi(T){return Tt[T.getUTCMonth()]}function Mi(T){return Mt[T.getUTCMonth()]}function Ti(T){return Qe[+(T.getUTCHours()>=12)]}function wi(T){return 1+~~(T.getUTCMonth()/3)}return{format:function(T){var H=Le(T+="",_e);return H.toString=function(){return T},H},parse:function(T){var H=wn(T+="",!1);return H.toString=function(){return T},H},utcFormat:function(T){var H=Le(T+="",Ye);return H.toString=function(){return T},H},utcParse:function(T){var H=wn(T+="",!0);return H.toString=function(){return T},H}}}var o={"-":"",_:" ",0:"0"},c=/^\s*\d+/,g=/^%/,W=/[\\^$*+?|[\]().{}]/g;function l(a,m,x){var b=a<0?"-":"",Qe=(b?-a:a)+"",Oe=Qe.length;return b+(Oe<x?new Array(x-Oe+1).join(m)+Qe:Qe)}function y(a){return a.replace(W,"\\$&")}function R(a){return new RegExp("^(?:"+a.map(y).join("|")+")","i")}function M(a){for(var m={},x=-1,b=a.length;++x<b;)m[a[x].toLowerCase()]=x;return m}function Q(a,m,x){var b=c.exec(m.slice(x,x+1));return b?(a.w=+b[0],x+b[0].length):-1}function V(a,m,x){var b=c.exec(m.slice(x,x+1));return b?(a.u=+b[0],x+b[0].length):-1}function N(a,m,x){var b=c.exec(m.slice(x,x+2));return b?(a.U=+b[0],x+b[0].length):-1}function q(a,m,x){var b=c.exec(m.slice(x,x+2));return b?(a.V=+b[0],x+b[0].length):-1}function G(a,m,x){var b=c.exec(m.slice(x,x+2));return b?(a.W=+b[0],x+b[0].length):-1}function P(a,m,x){var b=c.exec(m.slice(x,x+4));return b?(a.y=+b[0],x+b[0].length):-1}function F(a,m,x){var b=c.exec(m.slice(x,x+2));return b?(a.y=+b[0]+(+b[0]>68?1900:2e3),x+b[0].length):-1}function j(a,m,x){var b=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(m.slice(x,x+6));return b?(a.Z=b[1]?0:-(b[2]+(b[3]||"00")),x+b[0].length):-1}function oe(a,m,x){var b=c.exec(m.slice(x,x+1));return b?(a.q=b[0]*3-3,x+b[0].length):-1}function D(a,m,x){var b=c.exec(m.slice(x,x+2));return b?(a.m=b[0]-1,x+b[0].length):-1}function I(a,m,x){var b=c.exec(m.slice(x,x+2));return b?(a.d=+b[0],x+b[0].length):-1}function w(a,m,x){var b=c.exec(m.slice(x,x+3));return b?(a.m=0,a.d=+b[0],x+b[0].length):-1}function k(a,m,x){var b=c.exec(m.slice(x,x+2));return b?(a.H=+b[0],x+b[0].length):-1}function z(a,m,x){var b=c.exec(m.slice(x,x+2));return b?(a.M=+b[0],x+b[0].length):-1}function se(a,m,x){var b=c.exec(m.slice(x,x+2));return b?(a.S=+b[0],x+b[0].length):-1}function _(a,m,x){var b=c.exec(m.slice(x,x+3));return b?(a.L=+b[0],x+b[0].length):-1}function pe(a,m,x){var b=c.exec(m.slice(x,x+6));return b?(a.L=Math.floor(b[0]/1e3),x+b[0].length):-1}function Ee(a,m,x){var b=g.exec(m.slice(x,x+1));return b?x+b[0].length:-1}function we(a,m,x){var b=c.exec(m.slice(x));return b?(a.Q=+b[0],x+b[0].length):-1}function je(a,m,x){var b=c.exec(m.slice(x));return b?(a.s=+b[0],x+b[0].length):-1}function J(a,m){return l(a.getDate(),m,2)}function Fe(a,m){return l(a.getHours(),m,2)}function fe(a,m){return l(a.getHours()%12||12,m,2)}function ae(a,m){return l(1+e.timeDay.count(e.timeYear(a),a),m,3)}function ye(a,m){return l(a.getMilliseconds(),m,3)}function be(a,m){return ye(a,m)+"000"}function Ue(a,m){return l(a.getMonth()+1,m,2)}function Ie(a,m){return l(a.getMinutes(),m,2)}function De(a,m){return l(a.getSeconds(),m,2)}function Ne(a){var m=a.getDay();return m===0?7:m}function u(a,m){return l(e.timeSunday.count(e.timeYear(a)-1,a),m,2)}function S(a){var m=a.getDay();return m>=4||m===0?e.timeThursday(a):e.timeThursday.ceil(a)}function A(a,m){return a=S(a),l(e.timeThursday.count(e.timeYear(a),a)+(e.timeYear(a).getDay()===4),m,2)}function h(a){return a.getDay()}function d(a,m){return l(e.timeMonday.count(e.timeYear(a)-1,a),m,2)}function f(a,m){return l(a.getFullYear()%100,m,2)}function E(a,m){return a=S(a),l(a.getFullYear()%100,m,2)}function L(a,m){return l(a.getFullYear()%1e4,m,4)}function Y(a,m){var x=a.getDay();return a=x>=4||x===0?e.timeThursday(a):e.timeThursday.ceil(a),l(a.getFullYear()%1e4,m,4)}function ce(a){var m=a.getTimezoneOffset();return(m>0?"-":(m*=-1,"+"))+l(m/60|0,"0",2)+l(m%60,"0",2)}function Se(a,m){return l(a.getUTCDate(),m,2)}function de(a,m){return l(a.getUTCHours(),m,2)}function Z(a,m){return l(a.getUTCHours()%12||12,m,2)}function ue(a,m){return l(1+e.utcDay.count(e.utcYear(a),a),m,3)}function ne(a,m){return l(a.getUTCMilliseconds(),m,3)}function Be(a,m){return ne(a,m)+"000"}function Ls(a,m){return l(a.getUTCMonth()+1,m,2)}function pt(a,m){return l(a.getUTCMinutes(),m,2)}function Gs(a,m){return l(a.getUTCSeconds(),m,2)}function p(a){var m=a.getUTCDay();return m===0?7:m}function C(a,m){return l(e.utcSunday.count(e.utcYear(a)-1,a),m,2)}function ee(a){var m=a.getUTCDay();return m>=4||m===0?e.utcThursday(a):e.utcThursday.ceil(a)}function Ft(a,m){return a=ee(a),l(e.utcThursday.count(e.utcYear(a),a)+(e.utcYear(a).getUTCDay()===4),m,2)}function re(a){return a.getUTCDay()}function B(a,m){return l(e.utcMonday.count(e.utcYear(a)-1,a),m,2)}function X(a,m){return l(a.getUTCFullYear()%100,m,2)}function Ce(a,m){return a=ee(a),l(a.getUTCFullYear()%100,m,2)}function dt(a,m){return l(a.getUTCFullYear()%1e4,m,4)}function It(a,m){var x=a.getUTCDay();return a=x>=4||x===0?e.utcThursday(a):e.utcThursday.ceil(a),l(a.getUTCFullYear()%1e4,m,4)}function Zr(){return"+0000"}function Fn(){return"%"}function In(a){return+a}function Pn(a){return Math.floor(+a/1e3)}var rt;Mn({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 Mn(a){return rt=i(a),n.timeFormat=rt.format,n.timeParse=rt.parse,n.utcFormat=rt.utcFormat,n.utcParse=rt.utcParse,rt}var Tn="%Y-%m-%dT%H:%M:%S.%LZ";function $r(a){return a.toISOString()}var ei=Date.prototype.toISOString?$r:n.utcFormat(Tn);function ti(a){var m=new Date(a);return isNaN(m)?null:m}var si=+new Date("2000-01-01T00:00:00.000Z")?ti:n.utcParse(Tn);n.isoFormat=ei,n.isoParse=si,n.timeFormatDefaultLocale=Mn,n.timeFormatLocale=i,Object.defineProperty(n,"__esModule",{value:!0})})});var Ys=Nt((cs,gr)=>{(function(n,e){typeof cs=="object"&&typeof gr<"u"?e(cs):typeof define=="function"&&define.amd?define(["exports"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.d3=n.d3||{}))})(cs,(function(n){"use strict";function e(D){return Math.abs(D=Math.round(D))>=1e21?D.toLocaleString("en").replace(/,/g,""):D.toString(10)}function t(D,I){if((w=(D=I?D.toExponential(I-1):D.toExponential()).indexOf("e"))<0)return null;var w,k=D.slice(0,w);return[k.length>1?k[0]+k.slice(2):k,+D.slice(w+1)]}function s(D){return D=t(Math.abs(D)),D?D[1]:NaN}function r(D,I){return function(w,k){for(var z=w.length,se=[],_=0,pe=D[0],Ee=0;z>0&&pe>0&&(Ee+pe+1>k&&(pe=Math.max(1,k-Ee)),se.push(w.substring(z-=pe,z+pe)),!((Ee+=pe+1)>k));)pe=D[_=(_+1)%D.length];return se.reverse().join(I)}}function i(D){return function(I){return I.replace(/[0-9]/g,function(w){return D[+w]})}}var o=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function c(D){if(!(I=o.exec(D)))throw new Error("invalid format: "+D);var I;return new g({fill:I[1],align:I[2],sign:I[3],symbol:I[4],zero:I[5],width:I[6],comma:I[7],precision:I[8]&&I[8].slice(1),trim:I[9],type:I[10]})}c.prototype=g.prototype;function g(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+""}g.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 W(D){e:for(var I=D.length,w=1,k=-1,z;w<I;++w)switch(D[w]){case".":k=z=w;break;case"0":k===0&&(k=w),z=w;break;default:if(!+D[w])break e;k>0&&(k=0);break}return k>0?D.slice(0,k)+D.slice(z+1):D}var l;function y(D,I){var w=t(D,I);if(!w)return D+"";var k=w[0],z=w[1],se=z-(l=Math.max(-8,Math.min(8,Math.floor(z/3)))*3)+1,_=k.length;return se===_?k:se>_?k+new Array(se-_+1).join("0"):se>0?k.slice(0,se)+"."+k.slice(se):"0."+new Array(1-se).join("0")+t(D,Math.max(0,I+se-1))[0]}function R(D,I){var w=t(D,I);if(!w)return D+"";var k=w[0],z=w[1];return z<0?"0."+new Array(-z).join("0")+k:k.length>z+1?k.slice(0,z+1)+"."+k.slice(z+1):k+new Array(z-k.length+2).join("0")}var M={"%":function(D,I){return(D*100).toFixed(I)},b:function(D){return Math.round(D).toString(2)},c:function(D){return D+""},d:e,e:function(D,I){return D.toExponential(I)},f:function(D,I){return D.toFixed(I)},g:function(D,I){return D.toPrecision(I)},o:function(D){return Math.round(D).toString(8)},p:function(D,I){return R(D*100,I)},r:R,s:y,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 I=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]+"",k=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)),_=D.percent===void 0?"%":D.percent+"",pe=D.minus===void 0?"-":D.minus+"",Ee=D.nan===void 0?"NaN":D.nan+"";function we(J){J=c(J);var Fe=J.fill,fe=J.align,ae=J.sign,ye=J.symbol,be=J.zero,Ue=J.width,Ie=J.comma,De=J.precision,Ne=J.trim,u=J.type;u==="n"?(Ie=!0,u="g"):M[u]||(De===void 0&&(De=12),Ne=!0,u="g"),(be||Fe==="0"&&fe==="=")&&(be=!0,Fe="0",fe="=");var S=ye==="$"?w:ye==="#"&&/[boxX]/.test(u)?"0"+u.toLowerCase():"",A=ye==="$"?k:/[%p]/.test(u)?_:"",h=M[u],d=/[defgprs%]/.test(u);De=De===void 0?6:/[gprs]/.test(u)?Math.max(1,Math.min(21,De)):Math.max(0,Math.min(20,De));function f(E){var L=S,Y=A,ce,Se,de;if(u==="c")Y=h(E)+Y,E="";else{E=+E;var Z=E<0||1/E<0;if(E=isNaN(E)?Ee:h(Math.abs(E),De),Ne&&(E=W(E)),Z&&+E==0&&ae!=="+"&&(Z=!1),L=(Z?ae==="("?ae:pe:ae==="-"||ae==="("?"":ae)+L,Y=(u==="s"?N[8+l/3]:"")+Y+(Z&&ae==="("?")":""),d){for(ce=-1,Se=E.length;++ce<Se;)if(de=E.charCodeAt(ce),48>de||de>57){Y=(de===46?z+E.slice(ce+1):E.slice(ce))+Y,E=E.slice(0,ce);break}}}Ie&&!be&&(E=I(E,1/0));var ue=L.length+E.length+Y.length,ne=ue<Ue?new Array(Ue-ue+1).join(Fe):"";switch(Ie&&be&&(E=I(ne+E,ne.length?Ue-Y.length:1/0),ne=""),fe){case"<":E=L+E+Y+ne;break;case"=":E=L+ne+E+Y;break;case"^":E=ne.slice(0,ue=ne.length>>1)+L+E+Y+ne.slice(ue);break;default:E=ne+L+E+Y;break}return se(E)}return f.toString=function(){return J+""},f}function je(J,Fe){var fe=we((J=c(J),J.type="f",J)),ae=Math.max(-8,Math.min(8,Math.floor(s(Fe)/3)))*3,ye=Math.pow(10,-ae),be=N[8+ae/3];return function(Ue){return fe(ye*Ue)+be}}return{format:we,formatPrefix:je}}var G;P({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function P(D){return G=q(D),n.format=G.format,n.formatPrefix=G.formatPrefix,G}function F(D){return Math.max(0,-s(Math.abs(D)))}function j(D,I){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(s(I)/3)))*3-s(Math.abs(D)))}function oe(D,I){return D=Math.abs(D),I=Math.abs(I)-D,Math.max(0,s(I)-s(D))+1}n.FormatSpecifier=g,n.formatDefaultLocale=P,n.formatLocale=q,n.formatSpecifier=c,n.precisionFixed=F,n.precisionPrefix=j,n.precisionRound=oe,Object.defineProperty(n,"__esModule",{value:!0})}))});import{root as Et}from"@hpcc-js/util";import{DOMParser as La}from"@xmldom/xmldom";import*as Ae from"node:https";import{Buffer as Kr}from"node:buffer";import{fetch as Ga,Agent as ka}from"undici";var Qn=`
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 Ha="__PACKAGE_NAME__",ja="__PACKAGE_VERSION__",Oa="__BUILD_VERSION__";import{join as Gt}from"@hpcc-js/util";import{join as ks,promiseTimeout as vi,root as ft,scopedLogger as Vi,utf8ToBase64 as Hi}from"@hpcc-js/util";var Ln=Vi("comms/connection.ts");function Xa(n){return"baseUrl"in n}var ji={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function qa(n){return typeof n.opts=="function"&&typeof n.send=="function"&&typeof n.clone=="function"}function Ie(n,e){return e===void 0||e===!0?encodeURIComponent(n):""+n}function qe(n,e=!0,t=""){if(t&&(t+="."),typeof n!="object")return Ie(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(qe(o,e,t+Ie(`${r}.${u}`,e)))):s.push(t+Ie(`${r}_i${u}`,e)+"="+qe(o,e))}),i&&s.push(t+Ie(`${r}.itemcount`,e)+"="+n[r].length)}else typeof n[r]=="object"?n[r]&&n[r].Item instanceof Array?(s.push(qe(n[r].Item,e,t+Ie(r,e))),s.push(t+Ie(`${r}.itemcount`,e)+"="+n[r].Item.length)):s.push(qe(n[r],e,t+Ie(r,e))):n[r]!==void 0?s.push(t+Ie(r,e)+"="+Ie(n[r],e)):s.push(t+Ie(r,e));return s.join("&")}function Oi(n){return JSON.parse(n)}function _i(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,p=5e3,A="jsonp_callback_"+Math.round(Math.random()*999999);window[A]=function(Q){u=0,M(),i(s==="json"&&typeof Q=="string"?Oi(Q):Q)};let l=document.createElement("script"),x=ks(n.baseUrl,e);x+=x.indexOf("?")>=0?"&":"?",l.src=x+"jsonp="+A+"&"+qe(t,n.encodeRequest),document.body.appendChild(l);let S=setInterval(function(){u<=0?clearInterval(S):(u-=p,u<=0?(clearInterval(S),Ln.error("Request timeout: "+l.src),M(),o(Error("Request timeout: "+l.src))):Ln.debug("Request pending ("+u/1e3+" sec): "+l.src))},p);function M(){delete window[A],document.body.removeChild(l)}})}function Yi(n){return n.userID?{Authorization:`Basic ${Hi(`${n.userID}:${n.password}`)}`}:{}}var Bt={};function Gn(n,e,t,s,r){s={...Yi(n),...s},t={credentials:Bt[n.baseUrl]?"omit":"include",...t,headers:s},n.baseUrl.indexOf("https:")===0&&(n.rejectUnauthorized===!1&&ft.__hpcc_rejectUnauthorizedAgent?t.dispatcher=ft.__hpcc_rejectUnauthorizedAgent:ft.__hpcc_trustwaveAgent&&(t.agent=ft.__hpcc_trustwaveAgent));function i(u){if(u.ok)return r==="json"?u.json():u.text();throw new Error(u.statusText)}let o=ft.__hpcc_undiciFetch??fetch;return vi(n.timeoutSecs*1e3,o(ks(n.baseUrl,e),t).then(i).catch(u=>(t.credentials=Bt[n.baseUrl]?"include":"omit",o(ks(n.baseUrl,e),t).then(i).then(p=>(Bt[n.baseUrl]=!Bt[n.baseUrl],p)))))}function Xi(n,e,t,s="json",r){t.upload_&&(delete t.upload_,e+="?upload_");let i;return t.abortSignal_&&(i=t.abortSignal_,delete t.abortSignal_),Gn(n,e,{method:"post",body:qe(t,n.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...r},s)}function qi(n,e,t,s="json",r){let i;return t.abortSignal_&&(i=t.abortSignal_,delete t.abortSignal_),Gn(n,`${e}?${qe(t,n.encodeRequest)}`,{method:"get",signal:i},{...r},s)}function zi(n,e,t,s="json",r){let i;switch(n.type){case"jsonp":i=_i(n,e,t,s,r);break;case"get":i=qi(n,e,t,s,r);break;default:i=Xi(n,e,t,s,r);break}return i}var Qt=zi;function za(n){let e=Qt;return n&&(Qt=n),e}var vs=class n{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return arguments.length===0?this._opts:(this._opts={...ji,...e},this)}send(e,t,s="json",r){return this._opts.hookSend?this._opts.hookSend(this._opts,e,t,s,Qt,r):Qt(this._opts,e,t,s,r)}clone(){return new n(this.opts())}},Lt=function(n){return new vs(n)};function Ja(n){let e=Lt;return Lt=n,e}function Ji(n){return Object.prototype.toString.call(n)==="[object Array]"}var ze=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 nu(n){return n instanceof ze||n.isESPExceptions&&Array.isArray(n.Exception)}function Ki(n){return n.send!==void 0}var Vs=class n{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,t,s){this._connection=Ki(e)?e:Lt(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(Ji(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 p,A="json";switch(s){case"text":p=Gt(this._service,e),A="text";break;case"xsd":p=Gt(this._service,e+".xsd"),A="text";break;case"json2":p=Gt(this._service,e+"/json"),s="json",e=e.split("/").pop();break;default:p=Gt(this._service,e+".json")}return this._connection.send(p,u,A).then(l=>{if(s==="json"){let x;if(l&&l.Exceptions)throw new ze(e,u,l.Exceptions);if(l&&(x=l[o||e+"Response"]),!x)throw new ze(e,u,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return x}return l})}clone(){return new n(this._connection.clone(),this._service,this._version)}},v=class{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,t,s){this._connection=new Vs(e,t,s)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};var ht;(e=>{let n;(p=>(p.Delete="Delete",p.Protect="Protect",p.Unprotect="Unprotect",p.Restore="Restore",p.SetToFailed="SetToFailed",p.Archive="Archive"))(n=e.DFUWUActions||={})})(ht||={});var kt=class extends v{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 Zi=(l=>(l[l.unknown=0]="unknown",l[l.scheduled=1]="scheduled",l[l.queued=2]="queued",l[l.started=3]="started",l[l.aborted=4]="aborted",l[l.failed=5]="failed",l[l.finished=6]="finished",l[l.monitoring=7]="monitoring",l[l.aborting=8]="aborting",l[l.notfound=999]="notfound",l))(Zi||{}),$i=(x=>(x.Copy="copy",x.Remove="remove",x.Move="move",x.Rename="rename",x.Replicate="replicate",x.Import="import",x.Export="export",x.Monitor="monitor",x.Copymerge="copymerge",x.Supercopy="supercopy",x.Publish="publish",x))($i||{}),Je=class extends kt{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 kn;(o=>{let n;(A=>(A.User="User",A.Group="Group"))(n=o.ViewMemberType||={});let e;(S=>(S.username="username",S.fullname="fullname",S.passwordexpiration="passwordexpiration",S.employeeID="employeeID",S.employeeNumber="employeeNumber"))(e=o.UserSortBy||={});let t;(A=>(A.Name="Name",A.ManagedBy="ManagedBy"))(t=o.GroupSortBy||={});let s;(l=>(l.Any="Any",l.User="User",l.Group="Group"))(s=o.AccountTypeReq||={});let r;(A=>(A.Name="Name",A.Type="Type"))(r=o.ResourcePermissionSortBy||={});let i;(p=>p.Name="Name")(i=o.ResourceSortBy||={})})(kn||={});var vt=class extends v{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 vn=class extends vt{};var Vt=class extends v{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 Vn=class extends Vt{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})}};import{scopedLogger as eo}from"@hpcc-js/util";var Ht=class extends v{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 to=eo("@hpcc-js/comms/services/wsCloud.ts");function so(n){return n?.Pods!==void 0}function no(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 ro(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:no(e)}}})}var Hn=class extends Ht{getPODs(){return super.GetPODs({}).then(e=>{if(so(e))return e.Pods?.Pod??[];try{let t=typeof e.Result=="string"?JSON.parse(e.Result):e.Result;return ro(t?.items??[])}catch(t){return to.error(`Error parsing V1Pods json '${t instanceof Error?t.message:String(t)}'`),[]}})}};var Hs;(e=>{let n;(s=>s.gpg="gpg")(n=e.SigningMethodType||={})})(Hs||={});var jt=class extends v{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 jn=class extends jt{ListUserIDsEx(e){return super.ListUserIDs(e).then(t=>t.UserIDs.Item).catch(t=>[])}Sign(e){return super.Sign({SigningMethod:Hs.SigningMethodType.gpg,...e})}};var Ot=class extends v{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 On=class extends Ot{};var it;(u=>{let n;(S=>(S.Delete="Delete",S.AddToSuperfile="Add To Superfile",S.ChangeProtection="Change Protection",S.ChangeRestriction="Change Restriction"))(n=u.DFUArrayActions||={});let e;(S=>(S[S.NoChange=0]="NoChange",S[S.Protect=1]="Protect",S[S.Unprotect=2]="Unprotect",S[S.UnprotectAll=3]="UnprotectAll"))(e=u.DFUChangeProtection||={});let t;(x=>(x[x.NoChange=0]="NoChange",x[x.Restrict=1]="Restrict",x[x.Unrestricted=2]="Unrestricted"))(t=u.DFUChangeRestriction||={});let s;(l=>(l.xml="xml",l.def="def"))(s=u.DFUDefFileFormat||={});let r;(x=>(x.Token="Token",x.Engine="Engine",x.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||={})})(it||={});var _t=class extends v{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 Qu=it.DFUArrayActions,Lu=it.DFUDefFileFormat,Gu=it.DFUChangeProtection,ku=it.DFUChangeRestriction,Dt=class extends _t{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 Yt=class extends v{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 _n=class extends Yt{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 Yn(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:js(e[0])};if(e instanceof Object){if(e.Item&&e.Item instanceof Array&&e.Item.length===1){let s=typeof e.Item[0];if(s==="string"||s==="number")return{id:n,type:"set",fieldType:s};throw new Error("Unknown field type")}return{id:n,type:"object",fields:io(e)}}default:throw new Error("Unknown field type")}}function js(n){n.Row&&n.Row instanceof Array&&(n=n.Row[0]);let e=[];for(let t in n)e.push(Yn(t,n[t]));return e}function io(n){let e={};for(let t in n)e[t]=Yn(t,n[t]);return e}var Xt=class extends v{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(js)}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]=js(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 ze(r,s,{Source:"wsEcl.submit",Exception:i.Results.Exception});return i.Results})}};var qt=class extends v{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 Xn=class extends qt{};import{scopedLogger as oo}from"@hpcc-js/util";var te;(p=>{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=p.LogColumnType||={});let e;(Q=>(Q.string="string",Q.numeric="numeric",Q.datetime="datetime",Q.enum="enum",Q.epoch="epoch"))(e=p.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=p.LogAccessType||={});let s;(S=>(S[S.Success=0]="Success",S[S.Warning=1]="Warning",S[S.Fail=2]="Fail"))(s=p.LogAccessStatusCode||={});let r;(S=>(S[S.NONE=0]="NONE",S[S.AND=1]="AND",S[S.OR=2]="OR"))(r=p.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=p.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=p.SortColumType||={});let u;(x=>(x[x.ASC=0]="ASC",x[x.DSC=1]="DSC"))(u=p.SortDirection||={})})(te||={});var zt=class extends v{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 qn=oo("@hpcc-js/comms/services/wsLogaccess.ts");var ao=(o=>(o.Disaster="DIS",o.Error="ERR",o.Warning="WRN",o.Information="INF",o.Progress="PRO",o.Metric="MET",o))(ao||{}),uo=(r=>(r.Operator="OPR",r.User="USR",r.Programmer="PRO",r.Audit="ADT",r))(uo||{}),co=new Set(["azureloganalyticscurl","elasticstack","grafanacurl"]),lo=new Set(Object.values(te.LogColumnType));function po(n){switch(n){case te.LogColumnType.workunits:case"hpcc.log.jobid":return te.LogAccessType.ByJobID;case te.LogColumnType.audience:case"hpcc.log.audience":return te.LogAccessType.ByTargetAudience;case te.LogColumnType.class:case"hpcc.log.class":return te.LogAccessType.ByLogType;case te.LogColumnType.components:case"kubernetes.container.name":return te.LogAccessType.ByComponent;default:return te.LogAccessType.ByFieldName}}var go=["audience","class","workunits","message","processid","logid","threadid","timestamp","components","instance"];function mo(n,e){let t=[];for(let s of go){let r=n[s];if(r==null||r===""||Array.isArray(r)&&r.length===0||!(s in e))continue;let o=lo.has(s)?s:e[s],u=po(o);u===te.LogAccessType.ByFieldName&&(o=e[s]);let p=u===te.LogAccessType.ByComponent,A=Array.isArray(r)?r:[r];for(let l of A)t.push({LogCategory:u,SearchField:o,SearchByValue:p?l+"*":l})}return t}function Jt(n){let e={leftFilter:n[0]},t=e;for(let s=1;s<n.length;s++)t.Operator=te.LogAccessFilterOperator.OR,s===n.length-1?t.rightFilter=n[s]:(t.rightBinaryFilter={BinaryLogFilter:[{leftFilter:n[s]}]},t=t.rightBinaryFilter.BinaryLogFilter[0]);return e}function Jn(n){let[e,...t]=n,s={};if(e.length===1?s.leftFilter=e[0]:s.leftBinaryFilter={BinaryLogFilter:[Jt(e)]},t.length===0)return s;if(s.Operator=te.LogAccessFilterOperator.AND,t.length===1){let[r]=t;r.length===1?s.rightFilter=r[0]:s.rightBinaryFilter={BinaryLogFilter:[Jt(r)]}}else s.rightBinaryFilter={BinaryLogFilter:[Jn(t)]};return s}function fo(n){let e=new Map;for(let o of n){let u=e.get(o.SearchField);u?u.push(o):e.set(o.SearchField,[o])}let t=[...e.values()];if(t.length===0)return{leftFilter:{LogCategory:te.LogAccessType.All}};let[s,...r]=t,i={};if(s.length===1?i.leftFilter=s[0]:i.leftBinaryFilter={BinaryLogFilter:[Jt(s)]},r.length===0)return i;if(i.Operator=te.LogAccessFilterOperator.AND,r.length===1){let[o]=r;o.length===1?i.rightFilter=o[0]:i.rightBinaryFilter={BinaryLogFilter:[Jt(o)]}}else i.rightBinaryFilter={BinaryLogFilter:[Jn(r)]};return i}var zn=class extends zt{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}convertLogLine(e,t){let s={},r=t?.fields?Object.assign({},...t.fields):null;for(let i in e)s[i]=r?r[e[i]]??"":"";return s}async GetLogsEx(e){let t=await this.GetLogAccessInfo(),s={};t.Columns.Column.forEach(u=>s[u.LogType]=u.Name);let r=mo(e,s),i={StartDate:e.StartDate instanceof Date?e.StartDate.toISOString():new Date(0).toISOString()};e.EndDate instanceof Date&&(i.EndDate=e.EndDate.toISOString());let o={Filter:fo(r),Range:i,LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:te.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:te.SortColumType.ByDate,ColumnName:"",Direction:0}]}};return this.GetLogs(o).then(u=>{try{let p=JSON.parse(u.LogLines);return{lines:co.has(t.RemoteLogManagerType)?p.lines?.map(l=>this.convertLogLine(s,l))??[]:(qn.warning(`Unknown RemoteLogManagerType: ${t.RemoteLogManagerType}`),[]),total:u.TotalLogLinesAvailable??1e4}}catch(p){qn.error(p.message??p)}return{lines:[],total:0}})}};var Ge=mt(Zn(),1);import{exists as Do}from"@hpcc-js/util";var ho;(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||={})})(ho||={});var Zt=class extends v{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 Zt{GetTargetClusterUsageEx(e,t=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:t}).then(s=>Do("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(p=>{let A=p.DiskUsages&&p.DiskUsages.DiskUsage?p.DiskUsages.DiskUsage.map(l=>({...l,InUse:l.InUse*1024,Total:(l.InUse+l.Available)*1024,PercentUsed:100-l.PercentAvailable})):[];return{Name:p.Name,NetAddress:p.NetAddress,Description:p.Description,DiskUsages:A,mean:(0,Ge.mean)(A.filter(l=>!isNaN(l.PercentUsed)),l=>l.PercentUsed),max:(0,Ge.max)(A.filter(l=>!isNaN(l.PercentUsed)),l=>l.PercentUsed)}});return{Type:o.Type,Name:o.Name,Description:o.Description,MachineUsages:u,MachineUsagesDescription:u.reduce((p,A)=>p+(A.Description||""),""),mean:(0,Ge.mean)(u.filter(p=>!isNaN(p.mean)),p=>p.mean),max:(0,Ge.max)(u.filter(p=>!isNaN(p.max)),p=>p.max)}});return{Name:r.Name,Description:r.Description,ComponentUsages:i,ComponentUsagesDescription:i.reduce((o,u)=>o+(u.MachineUsagesDescription||""),""),mean:(0,Ge.mean)(i.filter(o=>!isNaN(o.mean)),o=>o.mean),max:(0,Ge.max)(i.filter(o=>!isNaN(o.max)),o=>o.max)}}))}};var $t=class extends v{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 $n=class extends $t{};var es=class extends v{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 er=class extends es{};var tr;(e=>{let n;(r=>(r.ECL="ECL",r.DFU="DFU"))(n=e.WUTypes||={})})(tr||={});var ts=class extends v{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 sr=class extends ts{};var ar=mt(Os(),1);var or;(t=>{let n;(p=>(p.ALL="ALL",p.READ="READ",p.WRITE="WRITE",p.HOLD="HOLD",p.SUB="SUB"))(n=t.LockModes||={});let e;(x=>(x.Attach="Attach",x.Detach="Detach",x.State="State",x.Reload="Reload",x.ReloadRetry="ReloadRetry",x.MemLock="MemLock",x.MemUnlock="MemUnlock",x.GetMemLocked="GetMemLocked"))(e=t.RoxieControlCmdType||={})})(or||={});var rs=class extends v{constructor(e){super(e,"WsSMC","1.29")}Activity(e){return this._connection.send("Activity",e,"json",!1,void 0,"ActivityResponse")}BrowseResources(e){return this._connection.send("BrowseResources",e,"json",!1,void 0,"BrowseResourcesResponse")}ClearQueue(e){return this._connection.send("ClearQueue",e,"json",!1,void 0,"SMCQueueResponse")}GetBuildInfo(e){return this._connection.send("GetBuildInfo",e,"json",!1,void 0,"GetBuildInfoResponse")}GetGlobalMetrics(e){return this._connection.send("GetGlobalMetrics",e,"json",!1,void 0,"GetGlobalMetricsResponse")}GetStatusServerInfo(e){return this._connection.send("GetStatusServerInfo",e,"json",!1,void 0,"GetStatusServerInfoResponse")}GetThorQueueAvailability(e){return this._connection.send("GetThorQueueAvailability",e,"json",!1,void 0,"GetThorQueueAvailabilityResponse")}Index(e){return this._connection.send("Index",e,"json",!1,void 0,"SMCIndexResponse")}LockQuery(e){return this._connection.send("LockQuery",e,"json",!1,void 0,"LockQueryResponse")}MoveJobBack(e){return this._connection.send("MoveJobBack",e,"json",!1,void 0,"SMCJobResponse")}MoveJobDown(e){return this._connection.send("MoveJobDown",e,"json",!1,void 0,"SMCJobResponse")}MoveJobFront(e){return this._connection.send("MoveJobFront",e,"json",!1,void 0,"SMCJobResponse")}MoveJobUp(e){return this._connection.send("MoveJobUp",e,"json",!1,void 0,"SMCJobResponse")}NotInCommunityEdition(e){return this._connection.send("NotInCommunityEdition",e,"json",!1,void 0,"NotInCommunityEditionResponse")}PauseQueue(e){return this._connection.send("PauseQueue",e,"json",!1,void 0,"SMCQueueResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsSMCPingResponse")}RecordGlobalMetrics(e){return this._connection.send("RecordGlobalMetrics",e,"json",!1,void 0,"RecordGlobalMetricsResponse")}RemoveJob(e){return this._connection.send("RemoveJob",e,"json",!1,void 0,"SMCJobResponse")}ResumeQueue(e){return this._connection.send("ResumeQueue",e,"json",!1,void 0,"SMCQueueResponse")}RoxieControlCmd(e){return this._connection.send("RoxieControlCmd",e,"json",!1,void 0,"RoxieControlCmdResponse")}RoxieXrefCmd(e){return this._connection.send("RoxieXrefCmd",e,"json",!1,void 0,"RoxieXrefCmdResponse")}SetBanner(e){return this._connection.send("SetBanner",e,"json",!1,void 0,"SetBannerResponse")}SetJobPriority(e){return this._connection.send("SetJobPriority",e,"json",!1,void 0,"SMCPriorityResponse")}StopQueue(e){return this._connection.send("StopQueue",e,"json",!1,void 0,"SMCQueueResponse")}};var Co=(0,ar.timeParse)("%Y%m%d%H");function Ro(n){return typeof n=="number"||typeof n=="string"&&n.trim()!==""&&!isNaN(+n)}var Ct=class extends rs{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(t=>({Running:{ActiveWorkunit:[]},...t}))}parseGlobalMetric(e,t){return e.startsWith("Cost")?+t/1e6:e.startsWith("Date")?Co(t):e.startsWith("Num")?+t:e.startsWith("Time")?+t/1e9:e.startsWith("When")?new Date(+t/1e3).toISOString():Ro(t)?+t:t}GetNormalisedGlobalMetrics(e){return super.GetGlobalMetrics(e).then(t=>{let s=[];for(let r of t?.GlobalMetrics?.GlobalMetric||[]){let i={Category:r.Category,Start:this.parseGlobalMetric("Date",r.DateTimeRange?.Start),End:this.parseGlobalMetric("Date",r.DateTimeRange?.End),dimensions:{},stats:{}};for(let o of r.Dimensions?.Dimension||[])i.dimensions[o.Name]=o.Value;for(let o of r.Stats?.Stat||[])i.stats[o.Name]=this.parseGlobalMetric(o.Name,o.Value);s.push(i)}return s})}};var is=class extends v{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 Rt=class extends is{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 ur;(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||={})})(ur||={});var os=class extends v{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 le=class extends os{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})}};import{deepMixin as So,xml2json as yo}from"@hpcc-js/util";var me;(N=>{let n;(_=>(_.Abort="Abort",_.Delete="Delete",_.Deschedule="Deschedule",_.Reschedule="Reschedule",_.Pause="Pause",_.PauseNow="PauseNow",_.Protect="Protect",_.Unprotect="Unprotect",_.Restore="Restore",_.Resume="Resume",_.SetToFailed="SetToFailed",_.Archive="Archive"))(n=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 p;(j=>(j.info="info",j.warning="warning",j.error="error",j.alert="alert"))(p=N.WUExceptionSeverity||={});let A;(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"))(A=N.WUQueryFilterSuspendedType||={});let l;(oe=>(oe.All="All",oe.Id="Id",oe.Name="Name",oe.Alias="Alias",oe.Status="Status"))(l=N.WUQuerySetFilterType||={});let x;(b=>(b.All="All",b.Protected="Protected",b.NotProtected="NotProtected"))(x=N.WUProtectFilter||={});let S;(G=>G.Deactivate="Deactivate")(S=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||={})})(me||={});var St=class extends v{constructor(e){super(e,"WsWorkunits","2.04")}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 _s=(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))(_s||{}),Ke;(e=>{let n;(S=>(S[S.Unknown=0]="Unknown",S[S.Compile=1]="Compile",S[S.Check=2]="Check",S[S.Run=3]="Run",S[S.ExecuteExisting=4]="ExecuteExisting",S[S.Pause=5]="Pause",S[S.PauseNow=6]="PauseNow",S[S.Resume=7]="Resume",S[S.Debug=8]="Debug",S[S.__size=9]="__size"))(n=e.Action||={})})(Ke||={});function lr(n){return typeof n.Name=="string"}function vc(n){return n.TotalClusterTime!==void 0}function Vc(n){return n.StateEx!==void 0}var ie=class extends St{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=>So({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=yo(t.Result).children();return r.length?r[0]:null})}},as=class extends St{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};import{debounce as Yo,StateObject as Xo}from"@hpcc-js/util";var Pr=mt(Ys(),1),Fs=mt(Os(),1);import{Cache as Po,deepMixinT as tn,scopedLogger as Io,StateObject as Mo,XMLNode as sn}from"@hpcc-js/util";import{Cache as gr,Edge as Rr,Graph as Sr,StateObject as xo,Subgraph as yr,Vertex as xr}from"@hpcc-js/util";var cs=class extends xo{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=>gs(t)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(t=>gs(t))}},ls=class extends gr{constructor(){super(e=>gr.hash([e.Name]))}};function Wr(n,e,t){t=t||[],t.push(n),e(n.name,n.$,n.children(),t),n.children().forEach(s=>{Wr(s,e,t)}),t.pop()}function Xs(n){let e={};return n.forEach(t=>{t.name==="att"&&(e[t.$.name]=t.$.value)}),e}var qs=class extends Sr{},dr=class extends yr{},mr=class extends xr{},fr=class extends Rr{};function Ar(n,e){let t={},s={},r={},i=new qs(u=>u._.id),o=[i.root];return Wr(e,(u,p,A,l)=>{let x=o[o.length-1];switch(u){case"graph":break;case"node":if(A.length&&A[0].children().length&&A[0].children()[0].name==="graph"){let Q=x.createSubgraph(Xs(A));o.push(Q),t[p.id]=Q}let S=x.createVertex(Xs(A));s[p.id]=S;break;case"edge":let M=x.createEdge(s[p.source],s[p.target],Xs(A));r[p.id]=M;break;default:}}),i}var ps=class extends Sr{},hr=class extends yr{},Dr=class extends xr{},Cr=class extends Rr{};function gs(n){let e={},t={},s={},r;for(let i of n)switch(i.ScopeType){case"graph":r=new ps(l=>l._.Id,i),e[i.ScopeName]=r.root;break;case"subgraph":r||(r=new ps(l=>l._.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 l=u;e[i.ScopeName]=l.createSubgraph(i)}break;case"activity":let p=e[i.parentScope()];p?s[i.ScopeName]=p.createVertex(i):console.warn(`Missing A:Parent (${i.Id}): ${i.parentScope()}`);break;case"edge":t[i.ScopeName]=i;break;case"function":let A=s[i.parentScope()];A?A._.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 p=u;try{let A=r.vertex(o.attr("IdSource").RawValue),l=r.vertex(o.attr("IdTarget").RawValue);p.createEdge(A,l,o)}catch{console.warn(`Invalid Edge: ${i}`)}}}return r}import{StateObject as Wo}from"@hpcc-js/util";var ds=class extends Wo{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})}};import{Cache as Zs,exists as Ks,StateObject as Uo}from"@hpcc-js/util";import{SAXStackParser as Ao,Stack as Ur}from"@hpcc-js/util";var ms=class{e;constructor(e){this.e=e}fix(){delete this.e}},fs=class extends ms{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}},hs=class extends ms{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()}},Ds=class{root;simpleTypes={};fields(){return this.root.children()}},Cs=class extends Ao{schema=new Ds;simpleType;simpleTypes={};xsdStack=new Ur;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":let t=new fs(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 hs(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 Js(n){let e=new Cs;return e.parse(n),e.schema}var zs=class extends Cs{_rootName;schema=new Ds;simpleTypes={};xsdStack=new Ur;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":let t=new fs(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 hs(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 Kc(n,e){let t=new zs(e);return t.parse(n),t.schema}var $s=class extends Zs{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}},Rs=new $s,Ss=class n extends Uo{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=Rs.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=Rs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+s},()=>new n(e,t,s)):typeof s=="string"&&(i=Rs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new n(e,t,s)))),i}static attachLogicalFile(e,t,s){return Rs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new n(e,t,s,!0))}constructor(e,t,s,r){super(),e instanceof ie?this.connection=e:this.connection=new ie(e),typeof r=="boolean"&&r===!0?this.set({NodeGroup:t,LogicalFileName:s}):lr(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=Js(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(p=>{let A=p.Result;return delete p.Result,this.set({...p}),Ks("XmlSchema.xml",A)&&(this.xsdSchema=Js(A.XmlSchema.xml)),Ks("Row",A)?A.Row:this.ResultName&&Ks(this.ResultName,A)?A[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 A in r)u.NamedValue[u.NamedValue.itemcount++]={Name:A,Value:r[A]};let p={FilterBy:u};return this.Wuid&&this.ResultName!==void 0?(p.Wuid=this.Wuid,p.ResultName=this.ResultName):this.Wuid&&this.ResultSequence!==void 0?(p.Wuid=this.Wuid,p.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(p.LogicalName=this.LogicalFileName,p.Cluster=this.NodeGroup):this.LogicalFileName&&(p.LogicalName=this.LogicalFileName),p.Start=e,p.Count=t,p.SuppressXmlSchema=s,p.BypassCachedResult=o,this.connection.WUResult(p,i).then(A=>A)}},ys=class extends Zs{constructor(){super(e=>Zs.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};import{StateObject as Er}from"@hpcc-js/util";var Ze=class extends Er{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)}},en=class extends Er{_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 Ze(this,s))}),t.start&&t.end?(t.start.FormattedEnd=t.end.Formatted,e.push(new Ze(this,t.start))):t.start?e.push(new Ze(this,t.start)):t.end&&e.push(new Ze(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 Ze(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 Ha="__PACKAGE_NAME__",ja="__PACKAGE_VERSION__",Oa="__BUILD_VERSION__";import{join as Gt}from"@hpcc-js/util";import{join as ks,promiseTimeout as vi,root as ht,scopedLogger as Vi,utf8ToBase64 as Hi}from"@hpcc-js/util";var Ln=Vi("comms/connection.ts");function Xa(n){return"baseUrl"in n}var ji={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function qa(n){return typeof n.opts=="function"&&typeof n.send=="function"&&typeof n.clone=="function"}function Pe(n,e){return e===void 0||e===!0?encodeURIComponent(n):""+n}function qe(n,e=!0,t=""){if(t&&(t+="."),typeof n!="object")return Pe(n,e);let s=[];for(let r in n)if(n.hasOwnProperty(r))if(n[r]instanceof Array){let i=!1;n[r].forEach((o,c)=>{typeof o=="object"?(i=!0,s.push(qe(o,e,t+Pe(`${r}.${c}`,e)))):s.push(t+Pe(`${r}_i${c}`,e)+"="+qe(o,e))}),i&&s.push(t+Pe(`${r}.itemcount`,e)+"="+n[r].length)}else typeof n[r]=="object"?n[r]&&n[r].Item instanceof Array?(s.push(qe(n[r].Item,e,t+Pe(r,e))),s.push(t+Pe(`${r}.itemcount`,e)+"="+n[r].Item.length)):s.push(qe(n[r],e,t+Pe(r,e))):n[r]!==void 0?s.push(t+Pe(r,e)+"="+Pe(n[r],e)):s.push(t+Pe(r,e));return s.join("&")}function Oi(n){return JSON.parse(n)}function _i(n,e,t={},s="json",r){return r&&console.warn("Header attributes ignored for JSONP connections"),new Promise((i,o)=>{let c=n.timeoutSecs*1e3,g=5e3,W="jsonp_callback_"+Math.round(Math.random()*999999);window[W]=function(Q){c=0,M(),i(s==="json"&&typeof Q=="string"?Oi(Q):Q)};let l=document.createElement("script"),y=ks(n.baseUrl,e);y+=y.indexOf("?")>=0?"&":"?",l.src=y+"jsonp="+W+"&"+qe(t,n.encodeRequest),document.body.appendChild(l);let R=setInterval(function(){c<=0?clearInterval(R):(c-=g,c<=0?(clearInterval(R),Ln.error("Request timeout: "+l.src),M(),o(Error("Request timeout: "+l.src))):Ln.debug("Request pending ("+c/1e3+" sec): "+l.src))},g);function M(){delete window[W],document.body.removeChild(l)}})}function Yi(n){return n.userID?{Authorization:`Basic ${Hi(`${n.userID}:${n.password}`)}`}:{}}var Bt={};function Gn(n,e,t,s,r){s={...Yi(n),...s},t={credentials:Bt[n.baseUrl]?"omit":"include",...t,headers:s},n.baseUrl.indexOf("https:")===0&&(n.rejectUnauthorized===!1&&ht.__hpcc_rejectUnauthorizedAgent?t.dispatcher=ht.__hpcc_rejectUnauthorizedAgent:ht.__hpcc_trustwaveAgent&&(t.agent=ht.__hpcc_trustwaveAgent));function i(c){if(c.ok)return r==="json"?c.json():c.text();throw new Error(c.statusText)}let o=ht.__hpcc_undiciFetch??fetch;return vi(n.timeoutSecs*1e3,o(ks(n.baseUrl,e),t).then(i).catch(c=>(t.credentials=Bt[n.baseUrl]?"include":"omit",o(ks(n.baseUrl,e),t).then(i).then(g=>(Bt[n.baseUrl]=!Bt[n.baseUrl],g)))))}function Xi(n,e,t,s="json",r){t.upload_&&(delete t.upload_,e+="?upload_");let i;return t.abortSignal_&&(i=t.abortSignal_,delete t.abortSignal_),Gn(n,e,{method:"post",body:qe(t,n.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...r},s)}function qi(n,e,t,s="json",r){let i;return t.abortSignal_&&(i=t.abortSignal_,delete t.abortSignal_),Gn(n,`${e}?${qe(t,n.encodeRequest)}`,{method:"get",signal:i},{...r},s)}function zi(n,e,t,s="json",r){let i;switch(n.type){case"jsonp":i=_i(n,e,t,s,r);break;case"get":i=qi(n,e,t,s,r);break;default:i=Xi(n,e,t,s,r);break}return i}var Qt=zi;function za(n){let e=Qt;return n&&(Qt=n),e}var vs=class n{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return arguments.length===0?this._opts:(this._opts={...ji,...e},this)}send(e,t,s="json",r){return this._opts.hookSend?this._opts.hookSend(this._opts,e,t,s,Qt,r):Qt(this._opts,e,t,s,r)}clone(){return new n(this.opts())}},Lt=function(n){return new vs(n)};function Ja(n){let e=Lt;return Lt=n,e}function Ji(n){return Object.prototype.toString.call(n)==="[object Array]"}var ze=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 nc(n){return n instanceof ze||n.isESPExceptions&&Array.isArray(n.Exception)}function Ki(n){return n.send!==void 0}var Vs=class n{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,t,s){this._connection=Ki(e)?e:Lt(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(Ji(e[t])){for(let s=0;s<e[t].length;++s)e[t+"_i"+s]=e[t][s];delete e[t]}return e}opts(e){return e===void 0?this._connection.opts():(this._connection.opts(e),this)}send(e,t={},s="json",r=!1,i,o){let c={...t,ver_:this._version};r&&(c.upload_=!0),i&&(c.abortSignal_=i);let g,W="json";switch(s){case"text":g=Gt(this._service,e),W="text";break;case"xsd":g=Gt(this._service,e+".xsd"),W="text";break;case"json2":g=Gt(this._service,e+"/json"),s="json",e=e.split("/").pop();break;default:g=Gt(this._service,e+".json")}return this._connection.send(g,c,W).then(l=>{if(s==="json"){let y;if(l&&l.Exceptions)throw new ze(e,c,l.Exceptions);if(l&&(y=l[o||e+"Response"]),!y)throw new ze(e,c,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return y}return l})}clone(){return new n(this._connection.clone(),this._service,this._version)}},v=class{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,t,s){this._connection=new Vs(e,t,s)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};var ft;(e=>{let n;(g=>(g.Delete="Delete",g.Protect="Protect",g.Unprotect="Unprotect",g.Restore="Restore",g.SetToFailed="SetToFailed",g.Archive="Archive"))(n=e.DFUWUActions||={})})(ft||={});var kt=class extends v{constructor(e){super(e,"FileSpray","1.27")}AbortDFUWorkunit(e,t){return this._connection.send("AbortDFUWorkunit",e,"json",!1,t,"AbortDFUWorkunitResponse")}Copy(e,t){return this._connection.send("Copy",e,"json",!1,t,"CopyResponse")}CreateDFUPublisherWorkunit(e,t){return this._connection.send("CreateDFUPublisherWorkunit",e,"json",!1,t,"CreateDFUPublisherWorkunitResponse")}CreateDFUWorkunit(e,t){return this._connection.send("CreateDFUWorkunit",e,"json",!1,t,"CreateDFUWorkunitResponse")}DFUWUFile(e,t){return this._connection.send("DFUWUFile",e,"json",!1,t,"DFUWUFileResponse")}DFUWUSearch(e,t){return this._connection.send("DFUWUSearch",e,"json",!1,t,"DFUWUSearchResponse")}DFUWorkunitsAction(e,t){return this._connection.send("DFUWorkunitsAction",e,"json",!1,t,"DFUWorkunitsActionResponse")}DeleteDFUWorkunit(e,t){return this._connection.send("DeleteDFUWorkunit",e,"json",!1,t,"DeleteDFUWorkunitResponse")}DeleteDFUWorkunits(e,t){return this._connection.send("DeleteDFUWorkunits",e,"json",!1,t,"DeleteDFUWorkunitsResponse")}DeleteDropZoneFiles(e,t){return this._connection.send("DeleteDropZoneFiles",e,"json",!1,t,"DFUWorkunitsActionResponse")}Despray(e,t){return this._connection.send("Despray",e,"json",!1,t,"DesprayResponse")}DfuMonitor(e,t){return this._connection.send("DfuMonitor",e,"json",!1,t,"DfuMonitorResponse")}DropZoneFileSearch(e,t){return this._connection.send("DropZoneFileSearch",e,"json",!1,t,"DropZoneFileSearchResponse")}DropZoneFiles(e,t){return this._connection.send("DropZoneFiles",e,"json",!1,t,"DropZoneFilesResponse")}EchoDateTime(e,t){return this._connection.send("EchoDateTime",e,"json",!1,t,"EchoDateTimeResponse")}FileList(e,t){return this._connection.send("FileList",e,"json",!1,t,"FileListResponse")}GetDFUExceptions(e,t){return this._connection.send("GetDFUExceptions",e,"json",!1,t,"GetDFUExceptionsResponse")}GetDFUProgress(e,t){return this._connection.send("GetDFUProgress",e,"json",!1,t,"ProgressResponse")}GetDFUServerQueues(e,t){return this._connection.send("GetDFUServerQueues",e,"json",!1,t,"GetDFUServerQueuesResponse")}GetDFUWorkunit(e,t){return this._connection.send("GetDFUWorkunit",e,"json",!1,t,"GetDFUWorkunitResponse")}GetDFUWorkunits(e,t){return this._connection.send("GetDFUWorkunits",e,"json",!1,t,"GetDFUWorkunitsResponse")}GetRemoteTargets(e,t){return this._connection.send("GetRemoteTargets",e,"json",!1,t,"GetRemoteTargetsResponse")}GetSprayTargets(e,t){return this._connection.send("GetSprayTargets",e,"json",!1,t,"GetSprayTargetsResponse")}OpenSave(e,t){return this._connection.send("OpenSave",e,"json",!1,t,"OpenSaveResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"FileSprayPingResponse")}Rename(e,t){return this._connection.send("Rename",e,"json",!1,t,"RenameResponse")}Replicate(e,t){return this._connection.send("Replicate",e,"json",!1,t,"ReplicateResponse")}ShowResult(e,t){return this._connection.send("ShowResult",e,"json",!1,t,"ShowResultResponse")}SprayFixed(e,t){return this._connection.send("SprayFixed",e,"json",!1,t,"SprayFixedResponse")}SprayVariable(e,t){return this._connection.send("SprayVariable",e,"json",!1,t,"SprayResponse")}SubmitDFUWorkunit(e,t){return this._connection.send("SubmitDFUWorkunit",e,"json",!1,t,"SubmitDFUWorkunitResponse")}UpdateDFUWorkunit(e,t){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,t,"UpdateDFUWorkunitResponse")}};var Zi=(l=>(l[l.unknown=0]="unknown",l[l.scheduled=1]="scheduled",l[l.queued=2]="queued",l[l.started=3]="started",l[l.aborted=4]="aborted",l[l.failed=5]="failed",l[l.finished=6]="finished",l[l.monitoring=7]="monitoring",l[l.aborting=8]="aborting",l[l.notfound=999]="notfound",l))(Zi||{}),$i=(y=>(y.Copy="copy",y.Remove="remove",y.Move="move",y.Rename="rename",y.Replicate="replicate",y.Import="import",y.Export="export",y.Monitor="monitor",y.Copymerge="copymerge",y.Supercopy="supercopy",y.Publish="publish",y))($i||{}),Je=class extends kt{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 kn;(o=>{let n;(W=>(W.User="User",W.Group="Group"))(n=o.ViewMemberType||={});let e;(R=>(R.username="username",R.fullname="fullname",R.passwordexpiration="passwordexpiration",R.employeeID="employeeID",R.employeeNumber="employeeNumber"))(e=o.UserSortBy||={});let t;(W=>(W.Name="Name",W.ManagedBy="ManagedBy"))(t=o.GroupSortBy||={});let s;(l=>(l.Any="Any",l.User="User",l.Group="Group"))(s=o.AccountTypeReq||={});let r;(W=>(W.Name="Name",W.Type="Type"))(r=o.ResourcePermissionSortBy||={});let i;(g=>g.Name="Name")(i=o.ResourceSortBy||={})})(kn||={});var vt=class extends v{constructor(e){super(e,"ws_access","1.17")}AccountPermissions(e,t){return this._connection.send("AccountPermissions",e,"json",!1,t,"AccountPermissionsResponse")}AccountPermissionsV2(e,t){return this._connection.send("AccountPermissionsV2",e,"json",!1,t,"AccountPermissionsV2Response")}AddUser(e,t){return this._connection.send("AddUser",e,"json",!1,t,"AddUserResponse")}AddView(e,t){return this._connection.send("AddView",e,"json",!1,t,"AddViewResponse")}AddViewColumn(e,t){return this._connection.send("AddViewColumn",e,"json",!1,t,"AddViewColumnResponse")}AddViewMember(e,t){return this._connection.send("AddViewMember",e,"json",!1,t,"AddViewMemberResponse")}ClearPermissionsCache(e,t){return this._connection.send("ClearPermissionsCache",e,"json",!1,t,"ClearPermissionsCacheResponse")}DeleteView(e,t){return this._connection.send("DeleteView",e,"json",!1,t,"DeleteViewResponse")}DeleteViewColumn(e,t){return this._connection.send("DeleteViewColumn",e,"json",!1,t,"DeleteViewColumnResponse")}DeleteViewMember(e,t){return this._connection.send("DeleteViewMember",e,"json",!1,t,"DeleteViewMemberResponse")}DisableScopeScans(e,t){return this._connection.send("DisableScopeScans",e,"json",!1,t,"DisableScopeScansResponse")}EnableScopeScans(e,t){return this._connection.send("EnableScopeScans",e,"json",!1,t,"EnableScopeScansResponse")}FilePermission(e,t){return this._connection.send("FilePermission",e,"json",!1,t,"FilePermissionResponse")}GroupAction(e,t){return this._connection.send("GroupAction",e,"json",!1,t,"GroupActionResponse")}GroupAdd(e,t){return this._connection.send("GroupAdd",e,"json",!1,t,"GroupAddResponse")}GroupEdit(e,t){return this._connection.send("GroupEdit",e,"json",!1,t,"GroupEditResponse")}GroupMemberEdit(e,t){return this._connection.send("GroupMemberEdit",e,"json",!1,t,"GroupMemberEditResponse")}GroupMemberEditInput(e,t){return this._connection.send("GroupMemberEditInput",e,"json",!1,t,"GroupMemberEditInputResponse")}GroupMemberQuery(e,t){return this._connection.send("GroupMemberQuery",e,"json",!1,t,"GroupMemberQueryResponse")}GroupQuery(e,t){return this._connection.send("GroupQuery",e,"json",!1,t,"GroupQueryResponse")}Groups(e,t){return this._connection.send("Groups",e,"json",!1,t,"GroupResponse")}PermissionAction(e,t){return this._connection.send("PermissionAction",e,"json",!1,t,"PermissionActionResponse")}Permissions(e,t){return this._connection.send("Permissions",e,"json",!1,t,"BasednsResponse")}PermissionsReset(e,t){return this._connection.send("PermissionsReset",e,"json",!1,t,"PermissionsResetResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_accessPingResponse")}QueryScopeScansEnabled(e,t){return this._connection.send("QueryScopeScansEnabled",e,"json",!1,t,"QueryScopeScansEnabledResponse")}QueryUserViewColumns(e,t){return this._connection.send("QueryUserViewColumns",e,"json",!1,t,"QueryUserViewColumnsResponse")}QueryViewColumns(e,t){return this._connection.send("QueryViewColumns",e,"json",!1,t,"QueryViewColumnsResponse")}QueryViewMembers(e,t){return this._connection.send("QueryViewMembers",e,"json",!1,t,"QueryViewMembersResponse")}QueryViews(e,t){return this._connection.send("QueryViews",e,"json",!1,t,"QueryViewsResponse")}ResourceAdd(e,t){return this._connection.send("ResourceAdd",e,"json",!1,t,"ResourceAddResponse")}ResourceDelete(e,t){return this._connection.send("ResourceDelete",e,"json",!1,t,"ResourceDeleteResponse")}ResourcePermissionQuery(e,t){return this._connection.send("ResourcePermissionQuery",e,"json",!1,t,"ResourcePermissionQueryResponse")}ResourcePermissions(e,t){return this._connection.send("ResourcePermissions",e,"json",!1,t,"ResourcePermissionsResponse")}ResourceQuery(e,t){return this._connection.send("ResourceQuery",e,"json",!1,t,"ResourceQueryResponse")}Resources(e,t){return this._connection.send("Resources",e,"json",!1,t,"ResourcesResponse")}UserAccountExport(e,t){return this._connection.send("UserAccountExport",e,"json",!1,t,"UserAccountExportResponse")}UserAction(e,t){return this._connection.send("UserAction",e,"json",!1,t,"UserActionResponse")}UserEdit(e,t){return this._connection.send("UserEdit",e,"json",!1,t,"UserEditResponse")}UserGroupEdit(e,t){return this._connection.send("UserGroupEdit",e,"json",!1,t,"UserGroupEditResponse")}UserGroupEditInput(e,t){return this._connection.send("UserGroupEditInput",e,"json",!1,t,"UserGroupEditInputResponse")}UserInfoEdit(e,t){return this._connection.send("UserInfoEdit",e,"json",!1,t,"UserInfoEditResponse")}UserInfoEditInput(e,t){return this._connection.send("UserInfoEditInput",e,"json",!1,t,"UserInfoEditInputResponse")}UserPosix(e,t){return this._connection.send("UserPosix",e,"json",!1,t,"UserPosixResponse")}UserPosixInput(e,t){return this._connection.send("UserPosixInput",e,"json",!1,t,"UserPosixInputResponse")}UserQuery(e,t){return this._connection.send("UserQuery",e,"json",!1,t,"UserQueryResponse")}UserResetPass(e,t){return this._connection.send("UserResetPass",e,"json",!1,t,"UserResetPassResponse")}UserResetPassInput(e,t){return this._connection.send("UserResetPassInput",e,"json",!1,t,"UserResetPassInputResponse")}UserSudoers(e,t){return this._connection.send("UserSudoers",e,"json",!1,t,"UserSudoersResponse")}UserSudoersInput(e,t){return this._connection.send("UserSudoersInput",e,"json",!1,t,"UserSudoersInputResponse")}Users(e,t){return this._connection.send("Users",e,"json",!1,t,"UserResponse")}};var vn=class extends vt{};var Vt=class extends v{constructor(e){super(e,"ws_account","1.07")}MyAccount(e,t){return this._connection.send("MyAccount",e,"json",!1,t,"MyAccountResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_accountPingResponse")}UpdateUser(e,t){return this._connection.send("UpdateUser",e,"json",!1,t,"UpdateUserResponse")}UpdateUserInput(e,t){return this._connection.send("UpdateUserInput",e,"json",!1,t,"UpdateUserInputResponse")}VerifyUser(e,t){return this._connection.send("VerifyUser",e,"json",!1,t,"VerifyUserResponse")}};var Vn=class extends Vt{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})}};import{scopedLogger as eo}from"@hpcc-js/util";var Ht=class extends v{constructor(e){super(e,"WsCloud","1.02")}GetPODs(e,t){return this._connection.send("GetPODs",e,"json",!1,t,"GetPODsResponse")}GetServices(e,t){return this._connection.send("GetServices",e,"json",!1,t,"GetServicesResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsCloudPingResponse")}};var to=eo("@hpcc-js/comms/services/wsCloud.ts");function so(n){return n?.Pods!==void 0}function no(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 ro(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:no(e)}}})}var Hn=class extends Ht{getPODs(){return super.GetPODs({}).then(e=>{if(so(e))return e.Pods?.Pod??[];try{let t=typeof e.Result=="string"?JSON.parse(e.Result):e.Result;return ro(t?.items??[])}catch(t){return to.error(`Error parsing V1Pods json '${t instanceof Error?t.message:String(t)}'`),[]}})}};var Hs;(e=>{let n;(s=>s.gpg="gpg")(n=e.SigningMethodType||={})})(Hs||={});var jt=class extends v{constructor(e){super(e,"ws_codesign","1.1")}ListUserIDs(e,t){return this._connection.send("ListUserIDs",e,"json",!1,t,"ListUserIDsResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_codesignPingResponse")}Sign(e,t){return this._connection.send("Sign",e,"json",!1,t,"SignResponse")}Verify(e,t){return this._connection.send("Verify",e,"json",!1,t,"VerifyResponse")}};var jn=class extends jt{ListUserIDsEx(e){return super.ListUserIDs(e).then(t=>t.UserIDs.Item).catch(t=>[])}Sign(e){return super.Sign({SigningMethod:Hs.SigningMethodType.gpg,...e})}};var Ot=class extends v{constructor(e){super(e,"WSDali","1.07")}Add(e,t){return this._connection.send("Add",e,"json",!1,t,"ResultResponse")}ClearTraceTransactions(e,t){return this._connection.send("ClearTraceTransactions",e,"json",!1,t,"ResultResponse")}Count(e,t){return this._connection.send("Count",e,"json",!1,t,"CountResponse")}DFSCheck(e,t){return this._connection.send("DFSCheck",e,"json",!1,t,"ResultResponse")}DFSExists(e,t){return this._connection.send("DFSExists",e,"json",!1,t,"BooleanResponse")}DFSLS(e,t){return this._connection.send("DFSLS",e,"json",!1,t,"ResultResponse")}Delete(e,t){return this._connection.send("Delete",e,"json",!1,t,"ResultResponse")}DisconnectClientConnection(e,t){return this._connection.send("DisconnectClientConnection",e,"json",!1,t,"ResultResponse")}GetClients(e,t){return this._connection.send("GetClients",e,"json",!1,t,"ResultResponse")}GetConnections(e,t){return this._connection.send("GetConnections",e,"json",!1,t,"ResultResponse")}GetDFSCSV(e,t){return this._connection.send("GetDFSCSV",e,"json",!1,t,"ResultResponse")}GetDFSMap(e,t){return this._connection.send("GetDFSMap",e,"json",!1,t,"ResultResponse")}GetDFSParents(e,t){return this._connection.send("GetDFSParents",e,"json",!1,t,"ResultResponse")}GetLogicalFile(e,t){return this._connection.send("GetLogicalFile",e,"json",!1,t,"ResultResponse")}GetLogicalFilePart(e,t){return this._connection.send("GetLogicalFilePart",e,"json",!1,t,"ResultResponse")}GetProtectedList(e,t){return this._connection.send("GetProtectedList",e,"json",!1,t,"ResultResponse")}GetSDSStats(e,t){return this._connection.send("GetSDSStats",e,"json",!1,t,"ResultResponse")}GetSDSSubscribers(e,t){return this._connection.send("GetSDSSubscribers",e,"json",!1,t,"ResultResponse")}GetValue(e,t){return this._connection.send("GetValue",e,"json",!1,t,"ResultResponse")}Import(e,t){return this._connection.send("Import",e,"json",!1,t,"ResultResponse")}ListSDSLocks(e,t){return this._connection.send("ListSDSLocks",e,"json",!1,t,"ResultResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WSDaliPingResponse")}SaveSDSStore(e,t){return this._connection.send("SaveSDSStore",e,"json",!1,t,"ResultResponse")}SetLogicalFilePartAttr(e,t){return this._connection.send("SetLogicalFilePartAttr",e,"json",!1,t,"ResultResponse")}SetProtected(e,t){return this._connection.send("SetProtected",e,"json",!1,t,"ResultResponse")}SetTraceSlowTransactions(e,t){return this._connection.send("SetTraceSlowTransactions",e,"json",!1,t,"ResultResponse")}SetTraceTransactions(e,t){return this._connection.send("SetTraceTransactions",e,"json",!1,t,"ResultResponse")}SetUnprotected(e,t){return this._connection.send("SetUnprotected",e,"json",!1,t,"ResultResponse")}SetValue(e,t){return this._connection.send("SetValue",e,"json",!1,t,"ResultResponse")}UnlockSDSLock(e,t){return this._connection.send("UnlockSDSLock",e,"json",!1,t,"ResultResponse")}};var On=class extends Ot{};var it;(c=>{let n;(R=>(R.Delete="Delete",R.AddToSuperfile="Add To Superfile",R.ChangeProtection="Change Protection",R.ChangeRestriction="Change Restriction"))(n=c.DFUArrayActions||={});let e;(R=>(R[R.NoChange=0]="NoChange",R[R.Protect=1]="Protect",R[R.Unprotect=2]="Unprotect",R[R.UnprotectAll=3]="UnprotectAll"))(e=c.DFUChangeProtection||={});let t;(y=>(y[y.NoChange=0]="NoChange",y[y.Restrict=1]="Restrict",y[y.Unrestricted=2]="Unrestricted"))(t=c.DFUChangeRestriction||={});let s;(l=>(l.xml="xml",l.def="def"))(s=c.DFUDefFileFormat||={});let r;(y=>(y.Token="Token",y.Engine="Engine",y.External="External"))(r=c.FileAccessRole||={});let i;(M=>(M.None="None",M.Access="Access",M.Read="Read",M.Write="Write",M.Full="Full"))(i=c.SecAccessType||={});let o;(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=c.DFUFileType||={})})(it||={});var _t=class extends v{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 Qc=it.DFUArrayActions,Lc=it.DFUDefFileFormat,Gc=it.DFUChangeProtection,kc=it.DFUChangeRestriction,Dt=class extends _t{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 Yt=class extends v{constructor(e){super(e,"WsDFUXRef","1.04")}DFUXRefArrayAction(e,t){return this._connection.send("DFUXRefArrayAction",e,"json",!1,t,"DFUXRefArrayActionResponse")}DFUXRefBuild(e,t){return this._connection.send("DFUXRefBuild",e,"json",!1,t,"DFUXRefBuildResponse")}DFUXRefBuildCancel(e,t){return this._connection.send("DFUXRefBuildCancel",e,"json",!1,t,"DFUXRefBuildCancelResponse")}DFUXRefCleanDirectories(e,t){return this._connection.send("DFUXRefCleanDirectories",e,"json",!1,t,"DFUXRefCleanDirectoriesResponse")}DFUXRefDirectories(e,t){return this._connection.send("DFUXRefDirectories",e,"json",!1,t,"DFUXRefDirectoriesQueryResponse")}DFUXRefFoundFiles(e,t){return this._connection.send("DFUXRefFoundFiles",e,"json",!1,t,"DFUXRefFoundFilesQueryResponse")}DFUXRefList(e,t){return this._connection.send("DFUXRefList",e,"json",!1,t,"DFUXRefListResponse")}DFUXRefLostFiles(e,t){return this._connection.send("DFUXRefLostFiles",e,"json",!1,t,"DFUXRefLostFilesQueryResponse")}DFUXRefMessages(e,t){return this._connection.send("DFUXRefMessages",e,"json",!1,t,"DFUXRefMessagesQueryResponse")}DFUXRefOrphanFiles(e,t){return this._connection.send("DFUXRefOrphanFiles",e,"json",!1,t,"DFUXRefOrphanFilesQueryResponse")}DFUXRefUnusedFiles(e,t){return this._connection.send("DFUXRefUnusedFiles",e,"json",!1,t,"DFUXRefUnusedFilesResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsDFUXRefPingResponse")}};var _n=class extends Yt{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 Yn(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:js(e[0])};if(e instanceof Object){if(e.Item&&e.Item instanceof Array&&e.Item.length===1){let s=typeof e.Item[0];if(s==="string"||s==="number")return{id:n,type:"set",fieldType:s};throw new Error("Unknown field type")}return{id:n,type:"object",fields:io(e)}}default:throw new Error("Unknown field type")}}function js(n){n.Row&&n.Row instanceof Array&&(n=n.Row[0]);let e=[];for(let t in n)e.push(Yn(t,n[t]));return e}function io(n){let e={};for(let t in n)e[t]=Yn(t,n[t]);return e}var Xt=class extends v{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(js)}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]=js(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 ze(r,s,{Source:"wsEcl.submit",Exception:i.Results.Exception});return i.Results})}};var qt=class extends v{constructor(e){super(e,"ws_elk","1")}GetConfigDetails(e,t){return this._connection.send("GetConfigDetails",e,"json",!1,t,"GetConfigDetailsResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_elkPingResponse")}};var Xn=class extends qt{};import{scopedLogger as oo}from"@hpcc-js/util";var te;(g=>{let n;(I=>(I.global="global",I.workunits="workunits",I.components="components",I.audience="audience",I.class="class",I.instance="instance",I.node="node",I.message="message",I.logid="logid",I.processid="processid",I.threadid="threadid",I.timestamp="timestamp",I.pod="pod",I.traceid="traceid",I.spanid="spanid"))(n=g.LogColumnType||={});let e;(Q=>(Q.string="string",Q.numeric="numeric",Q.datetime="datetime",Q.enum="enum",Q.epoch="epoch"))(e=g.LogColumnValueType||={});let t;(F=>(F[F.All=0]="All",F[F.ByJobID=1]="ByJobID",F[F.ByComponent=2]="ByComponent",F[F.ByLogType=3]="ByLogType",F[F.ByTargetAudience=4]="ByTargetAudience",F[F.BySourceInstance=5]="BySourceInstance",F[F.BySourceNode=6]="BySourceNode",F[F.ByFieldName=7]="ByFieldName",F[F.ByPod=8]="ByPod",F[F.ByTraceID=9]="ByTraceID",F[F.BySpanID=10]="BySpanID"))(t=g.LogAccessType||={});let s;(R=>(R[R.Success=0]="Success",R[R.Warning=1]="Warning",R[R.Fail=2]="Fail"))(s=g.LogAccessStatusCode||={});let r;(R=>(R[R.NONE=0]="NONE",R[R.AND=1]="AND",R[R.OR=2]="OR"))(r=g.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=g.LogSelectColumnMode||={});let o;(F=>(F[F.ByDate=0]="ByDate",F[F.ByJobID=1]="ByJobID",F[F.ByComponent=2]="ByComponent",F[F.ByLogType=3]="ByLogType",F[F.ByTargetAudience=4]="ByTargetAudience",F[F.BySourceInstance=5]="BySourceInstance",F[F.BySourceNode=6]="BySourceNode",F[F.ByFieldName=7]="ByFieldName",F[F.ByPod=8]="ByPod",F[F.ByTraceID=9]="ByTraceID",F[F.BySpanID=10]="BySpanID"))(o=g.SortColumType||={});let c;(y=>(y[y.ASC=0]="ASC",y[y.DSC=1]="DSC"))(c=g.SortDirection||={})})(te||={});var zt=class extends v{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 qn=oo("@hpcc-js/comms/services/wsLogaccess.ts");var ao=(o=>(o.Disaster="DIS",o.Error="ERR",o.Warning="WRN",o.Information="INF",o.Progress="PRO",o.Metric="MET",o))(ao||{}),co=(r=>(r.Operator="OPR",r.User="USR",r.Programmer="PRO",r.Audit="ADT",r))(co||{}),uo=new Set(["azureloganalyticscurl","elasticstack","grafanacurl"]),lo=new Set(Object.values(te.LogColumnType));function go(n){switch(n){case te.LogColumnType.workunits:case"hpcc.log.jobid":return te.LogAccessType.ByJobID;case te.LogColumnType.audience:case"hpcc.log.audience":return te.LogAccessType.ByTargetAudience;case te.LogColumnType.class:case"hpcc.log.class":return te.LogAccessType.ByLogType;case te.LogColumnType.components:case"kubernetes.container.name":return te.LogAccessType.ByComponent;default:return te.LogAccessType.ByFieldName}}var po=["audience","class","workunits","message","processid","logid","threadid","timestamp","components","instance"];function mo(n,e){let t=[];for(let s of po){let r=n[s];if(r==null||r===""||Array.isArray(r)&&r.length===0||!(s in e))continue;let o=lo.has(s)?s:e[s],c=go(o);c===te.LogAccessType.ByFieldName&&(o=e[s]);let g=c===te.LogAccessType.ByComponent,W=Array.isArray(r)?r:[r];for(let l of W)t.push({LogCategory:c,SearchField:o,SearchByValue:g?l+"*":l})}return t}function Jt(n){let e={leftFilter:n[0]},t=e;for(let s=1;s<n.length;s++)t.Operator=te.LogAccessFilterOperator.OR,s===n.length-1?t.rightFilter=n[s]:(t.rightBinaryFilter={BinaryLogFilter:[{leftFilter:n[s]}]},t=t.rightBinaryFilter.BinaryLogFilter[0]);return e}function Jn(n){let[e,...t]=n,s={};if(e.length===1?s.leftFilter=e[0]:s.leftBinaryFilter={BinaryLogFilter:[Jt(e)]},t.length===0)return s;if(s.Operator=te.LogAccessFilterOperator.AND,t.length===1){let[r]=t;r.length===1?s.rightFilter=r[0]:s.rightBinaryFilter={BinaryLogFilter:[Jt(r)]}}else s.rightBinaryFilter={BinaryLogFilter:[Jn(t)]};return s}function ho(n){let e=new Map;for(let o of n){let c=e.get(o.SearchField);c?c.push(o):e.set(o.SearchField,[o])}let t=[...e.values()];if(t.length===0)return{leftFilter:{LogCategory:te.LogAccessType.All}};let[s,...r]=t,i={};if(s.length===1?i.leftFilter=s[0]:i.leftBinaryFilter={BinaryLogFilter:[Jt(s)]},r.length===0)return i;if(i.Operator=te.LogAccessFilterOperator.AND,r.length===1){let[o]=r;o.length===1?i.rightFilter=o[0]:i.rightBinaryFilter={BinaryLogFilter:[Jt(o)]}}else i.rightBinaryFilter={BinaryLogFilter:[Jn(r)]};return i}var zn=class extends zt{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}convertLogLine(e,t){let s={},r=t?.fields?Object.assign({},...t.fields):null;for(let i in e)s[i]=r?r[e[i]]??"":"";return s}async GetLogsEx(e){let t=await this.GetLogAccessInfo(),s={};t.Columns.Column.forEach(c=>s[c.LogType]=c.Name);let r=mo(e,s),i={StartDate:e.StartDate instanceof Date?e.StartDate.toISOString():new Date(0).toISOString()};e.EndDate instanceof Date&&(i.EndDate=e.EndDate.toISOString());let o={Filter:ho(r),Range:i,LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:te.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:te.SortColumType.ByDate,ColumnName:"",Direction:0}]}};return this.GetLogs(o).then(c=>{try{let g=JSON.parse(c.LogLines);return{lines:uo.has(t.RemoteLogManagerType)?g.lines?.map(l=>this.convertLogLine(s,l))??[]:(qn.warning(`Unknown RemoteLogManagerType: ${t.RemoteLogManagerType}`),[]),total:c.TotalLogLinesAvailable??1e4}}catch(g){qn.error(g.message??g)}return{lines:[],total:0}})}};var Ge=mt(Zn(),1);import{exists as Do}from"@hpcc-js/util";var fo;(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||={})})(fo||={});var Zt=class extends v{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 Zt{GetTargetClusterUsageEx(e,t=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:t}).then(s=>Do("TargetClusterUsages.TargetClusterUsage",s)?s.TargetClusterUsages.TargetClusterUsage:[]).then(s=>s.filter(r=>!!r.ComponentUsages).map(r=>{let i=r.ComponentUsages.ComponentUsage.map(o=>{let c=(o.MachineUsages&&o.MachineUsages.MachineUsage?o.MachineUsages.MachineUsage:[]).map(g=>{let W=g.DiskUsages&&g.DiskUsages.DiskUsage?g.DiskUsages.DiskUsage.map(l=>({...l,InUse:l.InUse*1024,Total:(l.InUse+l.Available)*1024,PercentUsed:100-l.PercentAvailable})):[];return{Name:g.Name,NetAddress:g.NetAddress,Description:g.Description,DiskUsages:W,mean:(0,Ge.mean)(W.filter(l=>!isNaN(l.PercentUsed)),l=>l.PercentUsed),max:(0,Ge.max)(W.filter(l=>!isNaN(l.PercentUsed)),l=>l.PercentUsed)}});return{Type:o.Type,Name:o.Name,Description:o.Description,MachineUsages:c,MachineUsagesDescription:c.reduce((g,W)=>g+(W.Description||""),""),mean:(0,Ge.mean)(c.filter(g=>!isNaN(g.mean)),g=>g.mean),max:(0,Ge.max)(c.filter(g=>!isNaN(g.max)),g=>g.max)}});return{Name:r.Name,Description:r.Description,ComponentUsages:i,ComponentUsagesDescription:i.reduce((o,c)=>o+(c.MachineUsagesDescription||""),""),mean:(0,Ge.mean)(i.filter(o=>!isNaN(o.mean)),o=>o.mean),max:(0,Ge.max)(i.filter(o=>!isNaN(o.max)),o=>o.max)}}))}};var $t=class extends v{constructor(e){super(e,"WsPackageProcess","1.08")}ActivatePackage(e,t){return this._connection.send("ActivatePackage",e,"json",!1,t,"ActivatePackageResponse")}AddPackage(e,t){return this._connection.send("AddPackage",e,"json",!1,t,"AddPackageResponse")}AddPartToPackageMap(e,t){return this._connection.send("AddPartToPackageMap",e,"json",!1,t,"AddPartToPackageMapResponse")}CopyPackageMap(e,t){return this._connection.send("CopyPackageMap",e,"json",!1,t,"CopyPackageMapResponse")}DeActivatePackage(e,t){return this._connection.send("DeActivatePackage",e,"json",!1,t,"DeActivatePackageResponse")}DeletePackage(e,t){return this._connection.send("DeletePackage",e,"json",!1,t,"DeletePackageResponse")}Echo(e,t){return this._connection.send("Echo",e,"json",!1,t,"EchoResponse")}GetPackage(e,t){return this._connection.send("GetPackage",e,"json",!1,t,"GetPackageResponse")}GetPackageMapById(e,t){return this._connection.send("GetPackageMapById",e,"json",!1,t,"GetPackageMapByIdResponse")}GetPackageMapSelectOptions(e,t){return this._connection.send("GetPackageMapSelectOptions",e,"json",!1,t,"GetPackageMapSelectOptionsResponse")}GetPartFromPackageMap(e,t){return this._connection.send("GetPartFromPackageMap",e,"json",!1,t,"GetPartFromPackageMapResponse")}GetQueryFileMapping(e,t){return this._connection.send("GetQueryFileMapping",e,"json",!1,t,"GetQueryFileMappingResponse")}ListPackage(e,t){return this._connection.send("ListPackage",e,"json",!1,t,"ListPackageResponse")}ListPackages(e,t){return this._connection.send("ListPackages",e,"json",!1,t,"ListPackagesResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsPackageProcessPingResponse")}RemovePartFromPackageMap(e,t){return this._connection.send("RemovePartFromPackageMap",e,"json",!1,t,"RemovePartFromPackageMapResponse")}ValidatePackage(e,t){return this._connection.send("ValidatePackage",e,"json",!1,t,"ValidatePackageResponse")}};var $n=class extends $t{};var es=class extends v{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 er=class extends es{};var tr;(e=>{let n;(r=>(r.ECL="ECL",r.DFU="DFU"))(n=e.WUTypes||={})})(tr||={});var ts=class extends v{constructor(e){super(e,"WSSasha","1.01")}ArchiveWU(e,t){return this._connection.send("ArchiveWU",e,"json",!1,t,"ResultResponse")}GetVersion(e,t){return this._connection.send("GetVersion",e,"json",!1,t,"ResultResponse")}ListWU(e,t){return this._connection.send("ListWU",e,"json",!1,t,"ResultResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WSSashaPingResponse")}RestoreWU(e,t){return this._connection.send("RestoreWU",e,"json",!1,t,"ResultResponse")}};var sr=class extends ts{};var ar=mt(Os(),1);var or;(t=>{let n;(g=>(g.ALL="ALL",g.READ="READ",g.WRITE="WRITE",g.HOLD="HOLD",g.SUB="SUB"))(n=t.LockModes||={});let e;(y=>(y.Attach="Attach",y.Detach="Detach",y.State="State",y.Reload="Reload",y.ReloadRetry="ReloadRetry",y.MemLock="MemLock",y.MemUnlock="MemUnlock",y.GetMemLocked="GetMemLocked"))(e=t.RoxieControlCmdType||={})})(or||={});var rs=class extends v{constructor(e){super(e,"WsSMC","1.29")}Activity(e){return this._connection.send("Activity",e,"json",!1,void 0,"ActivityResponse")}BrowseResources(e){return this._connection.send("BrowseResources",e,"json",!1,void 0,"BrowseResourcesResponse")}ClearQueue(e){return this._connection.send("ClearQueue",e,"json",!1,void 0,"SMCQueueResponse")}GetBuildInfo(e){return this._connection.send("GetBuildInfo",e,"json",!1,void 0,"GetBuildInfoResponse")}GetGlobalMetrics(e){return this._connection.send("GetGlobalMetrics",e,"json",!1,void 0,"GetGlobalMetricsResponse")}GetStatusServerInfo(e){return this._connection.send("GetStatusServerInfo",e,"json",!1,void 0,"GetStatusServerInfoResponse")}GetThorQueueAvailability(e){return this._connection.send("GetThorQueueAvailability",e,"json",!1,void 0,"GetThorQueueAvailabilityResponse")}Index(e){return this._connection.send("Index",e,"json",!1,void 0,"SMCIndexResponse")}LockQuery(e){return this._connection.send("LockQuery",e,"json",!1,void 0,"LockQueryResponse")}MoveJobBack(e){return this._connection.send("MoveJobBack",e,"json",!1,void 0,"SMCJobResponse")}MoveJobDown(e){return this._connection.send("MoveJobDown",e,"json",!1,void 0,"SMCJobResponse")}MoveJobFront(e){return this._connection.send("MoveJobFront",e,"json",!1,void 0,"SMCJobResponse")}MoveJobUp(e){return this._connection.send("MoveJobUp",e,"json",!1,void 0,"SMCJobResponse")}NotInCommunityEdition(e){return this._connection.send("NotInCommunityEdition",e,"json",!1,void 0,"NotInCommunityEditionResponse")}PauseQueue(e){return this._connection.send("PauseQueue",e,"json",!1,void 0,"SMCQueueResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsSMCPingResponse")}RecordGlobalMetrics(e){return this._connection.send("RecordGlobalMetrics",e,"json",!1,void 0,"RecordGlobalMetricsResponse")}RemoveJob(e){return this._connection.send("RemoveJob",e,"json",!1,void 0,"SMCJobResponse")}ResumeQueue(e){return this._connection.send("ResumeQueue",e,"json",!1,void 0,"SMCQueueResponse")}RoxieControlCmd(e){return this._connection.send("RoxieControlCmd",e,"json",!1,void 0,"RoxieControlCmdResponse")}RoxieXrefCmd(e){return this._connection.send("RoxieXrefCmd",e,"json",!1,void 0,"RoxieXrefCmdResponse")}SetBanner(e){return this._connection.send("SetBanner",e,"json",!1,void 0,"SetBannerResponse")}SetJobPriority(e){return this._connection.send("SetJobPriority",e,"json",!1,void 0,"SMCPriorityResponse")}StopQueue(e){return this._connection.send("StopQueue",e,"json",!1,void 0,"SMCQueueResponse")}};var So=(0,ar.timeParse)("%Y%m%d%H");function Co(n){return typeof n=="number"||typeof n=="string"&&n.trim()!==""&&!isNaN(+n)}var St=class extends rs{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(t=>({Running:{ActiveWorkunit:[]},...t}))}parseGlobalMetric(e,t){return e.startsWith("Cost")?+t/1e6:e.startsWith("Date")?So(t):e.startsWith("Num")?+t:e.startsWith("Time")?+t/1e9:e.startsWith("When")?new Date(+t/1e3).toISOString():Co(t)?+t:t}GetNormalisedGlobalMetrics(e){return super.GetGlobalMetrics(e).then(t=>{let s=[];for(let r of t?.GlobalMetrics?.GlobalMetric||[]){let i={Category:r.Category,Start:this.parseGlobalMetric("Date",r.DateTimeRange?.Start),End:this.parseGlobalMetric("Date",r.DateTimeRange?.End),dimensions:{},stats:{}};for(let o of r.Dimensions?.Dimension||[])i.dimensions[o.Name]=o.Value;for(let o of r.Stats?.Stat||[])i.stats[o.Name]=this.parseGlobalMetric(o.Name,o.Value);s.push(i)}return s})}};var is=class extends v{constructor(e){super(e,"wsstore","1.02")}CreateStore(e,t){return this._connection.send("CreateStore",e,"json",!1,t,"CreateStoreResponse")}Delete(e,t){return this._connection.send("Delete",e,"json",!1,t,"DeleteResponse")}DeleteNamespace(e,t){return this._connection.send("DeleteNamespace",e,"json",!1,t,"DeleteNamespaceResponse")}Fetch(e,t){return this._connection.send("Fetch",e,"json",!1,t,"FetchResponse")}FetchAll(e,t){return this._connection.send("FetchAll",e,"json",!1,t,"FetchAllResponse")}FetchKeyMetadata(e,t){return this._connection.send("FetchKeyMetadata",e,"json",!1,t,"FetchKeyMDResponse")}ListKeys(e,t){return this._connection.send("ListKeys",e,"json",!1,t,"ListKeysResponse")}ListNamespaces(e,t){return this._connection.send("ListNamespaces",e,"json",!1,t,"ListNamespacesResponse")}ListStores(e,t){return this._connection.send("ListStores",e,"json",!1,t,"ListStoresResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"wsstorePingResponse")}Set(e,t){return this._connection.send("Set",e,"json",!1,t,"SetResponse")}};var Ct=class extends is{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 cr;(s=>{let n;(o=>(o.XML="XML",o.YAML="YAML"))(n=s.TpConfigResponseFormat||={});let e;(c=>(c.All="All",c.QueriesOnly="QueriesOnly",c.WorkunitsOnly="WorkunitsOnly"))(e=s.RoxieQueueFilter||={});let t;(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||={})})(cr||={});var os=class extends v{constructor(e){super(e,"WsTopology","1.33")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsTopologyPingResponse")}SystemLog(e,t){return this._connection.send("SystemLog",e,"json",!1,t,"SystemLogResponse")}TpClusterInfo(e,t){return this._connection.send("TpClusterInfo",e,"json",!1,t,"TpClusterInfoResponse")}TpClusterQuery(e,t){return this._connection.send("TpClusterQuery",e,"json",!1,t,"TpClusterQueryResponse")}TpComponentConfiguration(e,t){return this._connection.send("TpComponentConfiguration",e,"json",!1,t,"TpComponentConfigurationResponse")}TpConfiguredComponents(e,t){return this._connection.send("TpConfiguredComponents",e,"json",!1,t,"TpConfiguredComponentsResponse")}TpDropZoneQuery(e,t){return this._connection.send("TpDropZoneQuery",e,"json",!1,t,"TpDropZoneQueryResponse")}TpGetComponentFile(e,t){return this._connection.send("TpGetComponentFile",e,"json",!1,t,"TpGetComponentFileResponse")}TpGetServicePlugins(e,t){return this._connection.send("TpGetServicePlugins",e,"json",!1,t,"TpGetServicePluginsResponse")}TpGroupQuery(e,t){return this._connection.send("TpGroupQuery",e,"json",!1,t,"TpGroupQueryResponse")}TpListLogFiles(e,t){return this._connection.send("TpListLogFiles",e,"json",!1,t,"TpListLogFilesResponse")}TpListTargetClusters(e,t){return this._connection.send("TpListTargetClusters",e,"json",!1,t,"TpListTargetClustersResponse")}TpLogFile(e,t){return this._connection.send("TpLogFile",e,"json",!1,t,"TpLogFileResponse")}TpLogFileDisplay(e,t){return this._connection.send("TpLogFileDisplay",e,"json",!1,t,"TpLogFileResponse")}TpLogicalClusterQuery(e,t){return this._connection.send("TpLogicalClusterQuery",e,"json",!1,t,"TpLogicalClusterQueryResponse")}TpMachineInfo(e,t){return this._connection.send("TpMachineInfo",e,"json",!1,t,"TpMachineInfoResponse")}TpMachineQuery(e,t){return this._connection.send("TpMachineQuery",e,"json",!1,t,"TpMachineQueryResponse")}TpServiceQuery(e,t){return this._connection.send("TpServiceQuery",e,"json",!1,t,"TpServiceQueryResponse")}TpSetMachineStatus(e,t){return this._connection.send("TpSetMachineStatus",e,"json",!1,t,"TpSetMachineStatusResponse")}TpSwapNode(e,t){return this._connection.send("TpSwapNode",e,"json",!1,t,"TpSwapNodeResponse")}TpTargetClusterQuery(e,t){return this._connection.send("TpTargetClusterQuery",e,"json",!1,t,"TpTargetClusterQueryResponse")}TpThorStatus(e,t){return this._connection.send("TpThorStatus",e,"json",!1,t,"TpThorStatusResponse")}TpXMLFile(e,t){return this._connection.send("TpXMLFile",e,"json",!1,t,"TpXMLFileResponse")}};var le=class extends os{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})}};import{deepMixin as Ro,xml2json as Ao}from"@hpcc-js/util";var me;(N=>{let n;(_=>(_.Abort="Abort",_.Delete="Delete",_.Deschedule="Deschedule",_.Reschedule="Reschedule",_.Pause="Pause",_.PauseNow="PauseNow",_.Protect="Protect",_.Unprotect="Unprotect",_.Restore="Restore",_.Resume="Resume",_.SetToFailed="SetToFailed",_.Archive="Archive"))(n=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;(P=>(P[P.ASC=0]="ASC",P[P.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;(F=>(F.Single="Single",F.List="List",F.Multi="Multi"))(r=N.WUDetailsAttrValueType||={});let i;(F=>(F.SyntaxCheck="SyntaxCheck",F.Deploy="Deploy",F.Publish="Publish"))(i=N.EclDefinitionActions||={});let o;(F=>(F.xml="xml",F.json="json",F.text="text"))(o=N.ErrorMessageFormat||={});let c;(F=>(F[F.XML=0]="XML",F[F.JSON=1]="JSON",F[F.CSV=2]="CSV"))(c=N.LogAccessLogFormat||={});let g;(j=>(j.info="info",j.warning="warning",j.error="error",j.alert="alert"))(g=N.WUExceptionSeverity||={});let W;(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"))(W=N.WUQueryFilterSuspendedType||={});let l;(oe=>(oe.All="All",oe.Id="Id",oe.Name="Name",oe.Alias="Alias",oe.Status="Status"))(l=N.WUQuerySetFilterType||={});let y;(F=>(F.All="All",F.Protected="Protected",F.NotProtected="NotProtected"))(y=N.WUProtectFilter||={});let R;(G=>G.Deactivate="Deactivate")(R=N.QuerySetAliasActionTypes||={});let M;(P=>(P.None="None",P.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||={})})(me||={});var Rt=class extends v{constructor(e){super(e,"WsWorkunits","2.05")}GVCAjaxGraph(e,t){return this._connection.send("GVCAjaxGraph",e,"json",!1,t,"GVCAjaxGraphResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsWorkunitsPingResponse")}WUAbort(e,t){return this._connection.send("WUAbort",e,"json",!1,t,"WUAbortResponse")}WUAction(e,t){return this._connection.send("WUAction",e,"json",!1,t,"WUActionResponse")}WUAddLocalFileToWorkunit(e,t){return this._connection.send("WUAddLocalFileToWorkunit",e,"json",!1,t,"WUAddLocalFileToWorkunitResponse")}WUAnalyseHotspot(e,t){return this._connection.send("WUAnalyseHotspot",e,"json",!1,t,"WUAnalyseHotspotResponse")}WUCDebug(e,t){return this._connection.send("WUCDebug",e,"json",!1,t,"WUDebugResponse")}WUCheckFeatures(e,t){return this._connection.send("WUCheckFeatures",e,"json",!1,t,"WUCheckFeaturesResponse")}WUClusterJobQueueLOG(e,t){return this._connection.send("WUClusterJobQueueLOG",e,"json",!1,t,"WUClusterJobQueueLOGResponse")}WUClusterJobQueueXLS(e,t){return this._connection.send("WUClusterJobQueueXLS",e,"json",!1,t,"WUClusterJobQueueXLSResponse")}WUClusterJobSummaryXLS(e,t){return this._connection.send("WUClusterJobSummaryXLS",e,"json",!1,t,"WUClusterJobSummaryXLSResponse")}WUClusterJobXLS(e,t){return this._connection.send("WUClusterJobXLS",e,"json",!1,t,"WUClusterJobXLSResponse")}WUCompileECL(e,t){return this._connection.send("WUCompileECL",e,"json",!1,t,"WUCompileECLResponse")}WUCopyLogicalFiles(e,t){return this._connection.send("WUCopyLogicalFiles",e,"json",!1,t,"WUCopyLogicalFilesResponse")}WUCopyQuerySet(e,t){return this._connection.send("WUCopyQuerySet",e,"json",!1,t,"WUCopyQuerySetResponse")}WUCreate(e,t){return this._connection.send("WUCreate",e,"json",!1,t,"WUCreateResponse")}WUCreateAndUpdate(e,t){return this._connection.send("WUCreateAndUpdate",e,"json",!1,t,"WUUpdateResponse")}WUCreateZAPInfo(e,t){return this._connection.send("WUCreateZAPInfo",e,"json",!1,t,"WUCreateZAPInfoResponse")}WUDelete(e,t){return this._connection.send("WUDelete",e,"json",!1,t,"WUDeleteResponse")}WUDeployWorkunit(e,t){return this._connection.send("WUDeployWorkunit",e,"json",!1,t,"WUDeployWorkunitResponse")}WUDetails(e,t){return this._connection.send("WUDetails",e,"json",!1,t,"WUDetailsResponse")}WUDetailsMeta(e,t){return this._connection.send("WUDetailsMeta",e,"json",!1,t,"WUDetailsMetaResponse")}WUEclDefinitionAction(e,t){return this._connection.send("WUEclDefinitionAction",e,"json",!1,t,"WUEclDefinitionActionResponse")}WUExport(e,t){return this._connection.send("WUExport",e,"json",!1,t,"WUExportResponse")}WUFile(e,t){return this._connection.send("WUFile",e,"json",!1,t,"WULogFileResponse")}WUFullResult(e,t){return this._connection.send("WUFullResult",e,"json",!1,t,"WUFullResultResponse")}WUGVCGraphInfo(e,t){return this._connection.send("WUGVCGraphInfo",e,"json",!1,t,"WUGVCGraphInfoResponse")}WUGetArchiveFile(e,t){return this._connection.send("WUGetArchiveFile",e,"json",!1,t,"WUGetArchiveFileResponse")}WUGetDependancyTrees(e,t){return this._connection.send("WUGetDependancyTrees",e,"json",!1,t,"WUGetDependancyTreesResponse")}WUGetGraph(e,t){return this._connection.send("WUGetGraph",e,"json",!1,t,"WUGetGraphResponse")}WUGetGraphNameAndTypes(e,t){return this._connection.send("WUGetGraphNameAndTypes",e,"json",!1,t,"WUGetGraphNameAndTypesResponse")}WUGetNumFileToCopy(e,t){return this._connection.send("WUGetNumFileToCopy",e,"json",!1,t,"WUGetNumFileToCopyResponse")}WUGetPlugins(e,t){return this._connection.send("WUGetPlugins",e,"json",!1,t,"WUGetPluginsResponse")}WUGetStats(e,t){return this._connection.send("WUGetStats",e,"json",!1,t,"WUGetStatsResponse")}WUGetThorJobList(e,t){return this._connection.send("WUGetThorJobList",e,"json",!1,t,"WUGetThorJobListResponse")}WUGetThorJobQueue(e,t){return this._connection.send("WUGetThorJobQueue",e,"json",!1,t,"WUGetThorJobQueueResponse")}WUGetZAPInfo(e,t){return this._connection.send("WUGetZAPInfo",e,"json",!1,t,"WUGetZAPInfoResponse")}WUGraphInfo(e,t){return this._connection.send("WUGraphInfo",e,"json",!1,t,"WUGraphInfoResponse")}WUGraphTiming(e,t){return this._connection.send("WUGraphTiming",e,"json",!1,t,"WUGraphTimingResponse")}WUInfo(e,t){return this._connection.send("WUInfo",e,"json",!1,t,"WUInfoResponse")}WUInfoDetails(e,t){return this._connection.send("WUInfoDetails",e,"json",!1,t,"WUInfoResponse")}WUJobList(e,t){return this._connection.send("WUJobList",e,"json",!1,t,"WUJobListResponse")}WULightWeightQuery(e,t){return this._connection.send("WULightWeightQuery",e,"json",!1,t,"WULightWeightQueryResponse")}WUListArchiveFiles(e,t){return this._connection.send("WUListArchiveFiles",e,"json",!1,t,"WUListArchiveFilesResponse")}WUListLocalFileRequired(e,t){return this._connection.send("WUListLocalFileRequired",e,"json",!1,t,"WUListLocalFileRequiredResponse")}WUListQueries(e,t){return this._connection.send("WUListQueries",e,"json",!1,t,"WUListQueriesResponse")}WUListQueriesUsingFile(e,t){return this._connection.send("WUListQueriesUsingFile",e,"json",!1,t,"WUListQueriesUsingFileResponse")}WUMultiQuerysetDetails(e,t){return this._connection.send("WUMultiQuerysetDetails",e,"json",!1,t,"WUMultiQuerySetDetailsResponse")}WUProcessGraph(e,t){return this._connection.send("WUProcessGraph",e,"json",!1,t,"WUProcessGraphResponse")}WUProtect(e,t){return this._connection.send("WUProtect",e,"json",!1,t,"WUProtectResponse")}WUPublishWorkunit(e,t){return this._connection.send("WUPublishWorkunit",e,"json",!1,t,"WUPublishWorkunitResponse")}WUPushEvent(e,t){return this._connection.send("WUPushEvent",e,"json",!1,t,"WUPushEventResponse")}WUQuery(e,t){return this._connection.send("WUQuery",e,"json",!1,t,"WUQueryResponse")}WUQueryConfig(e,t){return this._connection.send("WUQueryConfig",e,"json",!1,t,"WUQueryConfigResponse")}WUQueryDetails(e,t){return this._connection.send("WUQueryDetails",e,"json",!1,t,"WUQueryDetailsResponse")}WUQueryDetailsLightWeight(e,t){return this._connection.send("WUQueryDetailsLightWeight",e,"json",!1,t,"WUQueryDetailsResponse")}WUQueryFiles(e,t){return this._connection.send("WUQueryFiles",e,"json",!1,t,"WUQueryFilesResponse")}WUQueryGetGraph(e,t){return this._connection.send("WUQueryGetGraph",e,"json",!1,t,"WUQueryGetGraphResponse")}WUQueryGetSummaryStats(e,t){return this._connection.send("WUQueryGetSummaryStats",e,"json",!1,t,"WUQueryGetSummaryStatsResponse")}WUQuerysetAliasAction(e,t){return this._connection.send("WUQuerysetAliasAction",e,"json",!1,t,"WUQuerySetAliasActionResponse")}WUQuerysetCopyQuery(e,t){return this._connection.send("WUQuerysetCopyQuery",e,"json",!1,t,"WUQuerySetCopyQueryResponse")}WUQuerysetDetails(e,t){return this._connection.send("WUQuerysetDetails",e,"json",!1,t,"WUQuerySetDetailsResponse")}WUQuerysetExport(e,t){return this._connection.send("WUQuerysetExport",e,"json",!1,t,"WUQuerysetExportResponse")}WUQuerysetImport(e,t){return this._connection.send("WUQuerysetImport",e,"json",!1,t,"WUQuerysetImportResponse")}WUQuerysetQueryAction(e,t){return this._connection.send("WUQuerysetQueryAction",e,"json",!1,t,"WUQuerySetQueryActionResponse")}WUQuerysets(e,t){return this._connection.send("WUQuerysets",e,"json",!1,t,"WUQuerysetsResponse")}WURecreateQuery(e,t){return this._connection.send("WURecreateQuery",e,"json",!1,t,"WURecreateQueryResponse")}WUResubmit(e,t){return this._connection.send("WUResubmit",e,"json",!1,t,"WUResubmitResponse")}WUResult(e,t){return this._connection.send("WUResult",e,"json",!1,t,"WUResultResponse")}WUResultBin(e,t){return this._connection.send("WUResultBin",e,"json",!1,t,"WUResultBinResponse")}WUResultSummary(e,t){return this._connection.send("WUResultSummary",e,"json",!1,t,"WUResultSummaryResponse")}WUResultView(e,t){return this._connection.send("WUResultView",e,"json",!1,t,"WUResultViewResponse")}WURun(e,t){return this._connection.send("WURun",e,"json",!1,t,"WURunResponse")}WUSchedule(e,t){return this._connection.send("WUSchedule",e,"json",!1,t,"WUScheduleResponse")}WUShowScheduled(e,t){return this._connection.send("WUShowScheduled",e,"json",!1,t,"WUShowScheduledResponse")}WUSubmit(e,t){return this._connection.send("WUSubmit",e,"json",!1,t,"WUSubmitResponse")}WUSyntaxCheckECL(e,t){return this._connection.send("WUSyntaxCheckECL",e,"json",!1,t,"WUSyntaxCheckResponse")}WUUpdate(e,t){return this._connection.send("WUUpdate",e,"json",!1,t,"WUUpdateResponse")}WUUpdateQueryEntry(e,t){return this._connection.send("WUUpdateQueryEntry",e,"json",!1,t,"WUUpdateQueryEntryResponse")}WUWaitCompiled(e,t){return this._connection.send("WUWaitCompiled",e,"json",!1,t,"WUWaitResponse")}WUWaitComplete(e,t){return this._connection.send("WUWaitComplete",e,"json",!1,t,"WUWaitResponse")}};var _s=(P=>(P[P.Unknown=0]="Unknown",P[P.Compiled=1]="Compiled",P[P.Running=2]="Running",P[P.Completed=3]="Completed",P[P.Failed=4]="Failed",P[P.Archived=5]="Archived",P[P.Aborting=6]="Aborting",P[P.Aborted=7]="Aborted",P[P.Blocked=8]="Blocked",P[P.Submitted=9]="Submitted",P[P.Scheduled=10]="Scheduled",P[P.Compiling=11]="Compiling",P[P.Wait=12]="Wait",P[P.UploadingFiled=13]="UploadingFiled",P[P.DebugPaused=14]="DebugPaused",P[P.DebugRunning=15]="DebugRunning",P[P.Paused=16]="Paused",P[P.LAST=17]="LAST",P[P.NotFound=999]="NotFound",P))(_s||{}),Ke;(e=>{let n;(R=>(R[R.Unknown=0]="Unknown",R[R.Compile=1]="Compile",R[R.Check=2]="Check",R[R.Run=3]="Run",R[R.ExecuteExisting=4]="ExecuteExisting",R[R.Pause=5]="Pause",R[R.PauseNow=6]="PauseNow",R[R.Resume=7]="Resume",R[R.Debug=8]="Debug",R[R.__size=9]="__size"))(n=e.Action||={})})(Ke||={});function lr(n){return typeof n.Name=="string"}function vu(n){return n.TotalClusterTime!==void 0}function Vu(n){return n.StateEx!==void 0}var ie=class extends Rt{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=>Ro({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=Ao(t.Result).children();return r.length?r[0]:null})}},as=class extends Rt{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};import{debounce as Yo,StateObject as Xo}from"@hpcc-js/util";var Ir=mt(Ys(),1),Es=mt(Os(),1);import{Cache as Io,deepMixinT as tn,scopedLogger as Po,StateObject as Mo,XMLNode as sn}from"@hpcc-js/util";import{Cache as pr,Edge as Cr,Graph as Rr,StateObject as yo,Subgraph as Ar,Vertex as yr}from"@hpcc-js/util";var us=class extends yo{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=>ps(t)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(t=>ps(t))}},ls=class extends pr{constructor(){super(e=>pr.hash([e.Name]))}};function xr(n,e,t){t=t||[],t.push(n),e(n.name,n.$,n.children(),t),n.children().forEach(s=>{xr(s,e,t)}),t.pop()}function Xs(n){let e={};return n.forEach(t=>{t.name==="att"&&(e[t.$.name]=t.$.value)}),e}var qs=class extends Rr{},dr=class extends Ar{},mr=class extends yr{},hr=class extends Cr{};function Wr(n,e){let t={},s={},r={},i=new qs(c=>c._.id),o=[i.root];return xr(e,(c,g,W,l)=>{let y=o[o.length-1];switch(c){case"graph":break;case"node":if(W.length&&W[0].children().length&&W[0].children()[0].name==="graph"){let Q=y.createSubgraph(Xs(W));o.push(Q),t[g.id]=Q}let R=y.createVertex(Xs(W));s[g.id]=R;break;case"edge":let M=y.createEdge(s[g.source],s[g.target],Xs(W));r[g.id]=M;break;default:}}),i}var gs=class extends Rr{},fr=class extends Ar{},Dr=class extends yr{},Sr=class extends Cr{};function ps(n){let e={},t={},s={},r;for(let i of n)switch(i.ScopeType){case"graph":r=new gs(l=>l._.Id,i),e[i.ScopeName]=r.root;break;case"subgraph":r||(r=new gs(l=>l._.Id,i),e[i.ScopeName]=r.root);let o=i.parentScope().split(":"),c=e[i.parentScope()];for(;o.length&&!c;)c=e[o.join(":")],o.pop();if(!c)console.warn(`Missing SG:Parent (${i.Id}): ${i.parentScope()}`);else{let l=c;e[i.ScopeName]=l.createSubgraph(i)}break;case"activity":let g=e[i.parentScope()];g?s[i.ScopeName]=g.createVertex(i):console.warn(`Missing A:Parent (${i.Id}): ${i.parentScope()}`);break;case"edge":t[i.ScopeName]=i;break;case"function":let W=s[i.parentScope()];W?W._.children().push(i):console.warn(`Missing F:Parent (${i.Id}): ${i.parentScope()}`);break}for(let i in t){let o=t[i],c=e[o.parentScope()];if(!c)console.warn(`Missing E:Parent (${o.Id}): ${o.parentScope()}`);else{let g=c;try{let W=r.vertex(o.attr("IdSource").RawValue),l=r.vertex(o.attr("IdTarget").RawValue);g.createEdge(W,l,o)}catch{console.warn(`Invalid Edge: ${i}`)}}}return r}import{StateObject as xo}from"@hpcc-js/util";var ds=class extends xo{wu;get properties(){return this.get()}get URL(){return this.get("URL")}get DisplayName(){return this.get("DisplayName")}get DisplayPath(){return this.get("DisplayPath")}constructor(e,t){super(),this.wu=e;let s=t.split("\\").join("/"),r=s.split("/"),i="res/"+this.wu.Wuid+"/",o="",c="";s.indexOf(i)===0&&(o=s.substr(i.length),c=r[r.length-1]),this.set({URL:t,DisplayName:c,DisplayPath:o})}};import{Cache as Zs,exists as Ks,StateObject as bo}from"@hpcc-js/util";import{SAXStackParser as Wo,Stack as br}from"@hpcc-js/util";var ms=class{e;constructor(e){this.e=e}fix(){delete this.e}},hs=class extends ms{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}},fs=class extends ms{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()}},Ds=class{root;simpleTypes={};fields(){return this.root.children()}},Ss=class extends Wo{schema=new Ds;simpleType;simpleTypes={};xsdStack=new br;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":let t=new hs(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 fs(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 Js(n){let e=new Ss;return e.parse(n),e.schema}var zs=class extends Ss{_rootName;schema=new Ds;simpleTypes={};xsdStack=new br;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":let t=new hs(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 fs(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 Ku(n,e){let t=new zs(e);return t.parse(n),t.schema}var $s=class extends Zs{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}},Cs=new $s,Rs=class n extends bo{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=Cs.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=Cs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+s},()=>new n(e,t,s)):typeof s=="string"&&(i=Cs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new n(e,t,s)))),i}static attachLogicalFile(e,t,s){return Cs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new n(e,t,s,!0))}constructor(e,t,s,r){super(),e instanceof ie?this.connection=e:this.connection=new ie(e),typeof r=="boolean"&&r===!0?this.set({NodeGroup:t,LogicalFileName:s}):lr(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=Js(t.Result.XmlSchema.xml),this.xsdSchema):null)),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(e=0,t=-1,s=!1,r={},i,o){let c=o??this._bypassCache;return this.WUResult(e,t,!s,r,i,c).then(g=>{let W=g.Result;return delete g.Result,this.set({...g}),Ks("XmlSchema.xml",W)&&(this.xsdSchema=Js(W.XmlSchema.xml)),Ks("Row",W)?W.Row:this.ResultName&&Ks(this.ResultName,W)?W[this.ResultName].Row:[]})}rootField(){return this.xsdSchema?this.xsdSchema.root:null}fields(){return this.xsdSchema?this.xsdSchema.root.children():[]}WUResult(e=0,t=1,s=!1,r={},i,o=!1){let c={NamedValue:{itemcount:0}};for(let W in r)c.NamedValue[c.NamedValue.itemcount++]={Name:W,Value:r[W]};let g={FilterBy:c};return this.Wuid&&this.ResultName!==void 0?(g.Wuid=this.Wuid,g.ResultName=this.ResultName):this.Wuid&&this.ResultSequence!==void 0?(g.Wuid=this.Wuid,g.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(g.LogicalName=this.LogicalFileName,g.Cluster=this.NodeGroup):this.LogicalFileName&&(g.LogicalName=this.LogicalFileName),g.Start=e,g.Count=t,g.SuppressXmlSchema=s,g.BypassCachedResult=o,this.connection.WUResult(g,i).then(W=>W)}},As=class extends Zs{constructor(){super(e=>Zs.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};import{StateObject as Ur}from"@hpcc-js/util";var Ze=class extends Ur{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)}},en=class extends Ur{_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 Ze(this,s))}),t.start&&t.end?(t.start.FormattedEnd=t.end.Formatted,e.push(new Ze(this,t.start))):t.start?e.push(new Ze(this,t.start)):t.end&&e.push(new Ze(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 Ze(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>`}},yt=class extends en{wu;constructor(e,t){super(t),this.wu=e}};import{StateObject as Eo}from"@hpcc-js/util";var xs=class extends Eo{connection;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get FileCluster(){return this.get("FileCluster")}get Name(){return this.get("Name")}get IsSuperFile(){return this.get("IsSuperFile")}get Subs(){return this.get("Subs")}get Count(){return this.get("Count")}get ECLSourceFiles(){return this.get("ECLSourceFiles")}constructor(e,t,s){super(),e instanceof ie?this.connection=e:this.connection=new ie(e),this.set({Wuid:t,...s})}};import{espTime2Seconds as Fo,StateObject as bo}from"@hpcc-js/util";var Ws=class extends bo{connection;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get Name(){return this.get("Name")}get Value(){return this.get("Value")}get Seconds(){return this.get("Seconds")}get GraphName(){return this.get("GraphName")}get SubGraphId(){return this.get("SubGraphId")}get HasSubGraphId(){return this.get("HasSubGraphId")}get count(){return this.get("count")}get Timestamp(){return this.get("Timestamp")}get When(){return this.get("When")}constructor(e,t,s){super(),e instanceof ie?this.connection=e:this.connection=new ie(e);let r=Fo(s.Value);this.set({Wuid:t,Seconds:Math.round(r*1e3)/1e3,HasSubGraphId:s.SubGraphId!==void 0,...s})}};var To=(0,Fs.utcFormat)("%Y-%m-%dT%H:%M:%S.%LZ"),wo=(0,Fs.utcParse)("%Y-%m-%dT%H:%M:%S.%LZ"),No=(0,Pr.format)(",");function Bo(n){return n&&!isNaN(+n)?No(+n):n}var Fr="DefinitionList",Qo=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,Lo=["Avg","Min","Max","Delta","StdDev"],Go=["SkewMin","SkewMax","NodeMin","NodeMax"],ko=/[A-Z][a-z]*/g;function vo(n){for(let t of Go){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(ko);if(e?.length){let t=e.shift(),s=e.join("");for(let r of Lo){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 br={};function Vo(n){let e=br[n];return e||(e=vo(n),br[n]=e),e}function Me(n,e){return n.__formattedProps?.[e]??n[e]}function As(n){if(n===void 0)return;let e=parseFloat(n);return isNaN(e)?void 0:e}function Ho(n,e,t){let s=Vo(e);if(!t[s.measure]){t[s.label]=!0;let r=As(n[`${s.measure}Avg${s.label}`]),i=As(n[`${s.measure}Min${s.label}`]),o=As(n[`${s.measure}Max${s.label}`]),u=As(n[`${s.measure}StdDev${s.label}`]),p=Math.max((r-i)/u,(o-r)/u);return{Key:`${s.measure}${s.label}`,Value:Me(n,`${s.measure}${s.label}`),Avg:Me(n,`${s.measure}Avg${s.label}`),Min:Me(n,`${s.measure}Min${s.label}`),Max:Me(n,`${s.measure}Max${s.label}`),Delta:Me(n,`${s.measure}Delta${s.label}`),StdDev:Me(n,`${s.measure}StdDev${s.label}`),StdDevs:isNaN(p)?void 0:p,SkewMin:Me(n,`SkewMin${s.label}`),SkewMax:Me(n,`SkewMax${s.label}`),NodeMin:Me(n,`NodeMin${s.label}`),NodeMax:Me(n,`NodeMax${s.label}`)}}return null}var Us=Io("workunit.ts"),nn=class extends Po{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}},Es=new nn,ot=class n extends Mo{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")||_s[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 ys;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,()=>Ss.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 Ws(this.connection,this.Wuid,e))}_graphCache=new ls;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 cs(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 ds(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 xs(this.connection,this.Wuid,e))}get VariableCount(){return this.get("VariableCount",0)}get Variables(){return this.get("Variables",{ECLResult:[]})}get TimerCount(){return this.get("TimerCount",0)}get HasDebugValue(){return this.get("HasDebugValue")}get ApplicationValueCount(){return this.get("ApplicationValueCount",0)}get XmlParams(){return this.get("XmlParams")}get AccessFlag(){return this.get("AccessFlag")}get ClusterFlag(){return this.get("ClusterFlag")}get ResultViewCount(){return this.get("ResultViewCount",0)}get DebugValueCount(){return this.get("DebugValueCount",0)}get WorkflowCount(){return this.get("WorkflowCount",0)}get Archived(){return this.get("Archived")}get RoxieCluster(){return this.get("RoxieCluster")}get DebugState(){return this.get("DebugState",{})}get Queue(){return this.get("Queue")}get Active(){return this.get("Active")}get Action(){return this.get("Action")}get Scope(){return this.get("Scope")}get AbortBy(){return this.get("AbortBy")}get AbortTime(){return this.get("AbortTime")}get Workflows(){return this.get("Workflows")}get TimingData(){return this.get("TimingData")}get HelpersDesc(){return this.get("HelpersDesc")}get GraphsDesc(){return this.get("GraphsDesc")}get SourceFilesDesc(){return this.get("SourceFilesDesc")}get ResultsDesc(){return this.get("ResultsDesc")}get VariablesDesc(){return this.get("VariablesDesc")}get TimersDesc(){return this.get("TimersDesc")}get DebugValuesDesc(){return this.get("DebugValuesDesc")}get ApplicationValuesDesc(){return this.get("ApplicationValuesDesc")}get WorkflowsDesc(){return this.get("WorkflowsDesc")}get ServiceNames(){return this.get("ServiceNames")}get CompileCost(){return this.get("CompileCost")}get ExecuteCost(){return this.get("ExecuteCost")}get FileAccessCost(){return this.get("FileAccessCost")}get NoAccess(){return this.get("NoAccess")}get ECLWUProcessList(){return this.get("ECLWUProcessList")}get CostSavingPotential(){return this.get("CostSavingPotential")}static create(e){let t=new n(e);return t.connection.WUCreate().then(s=>(Es.set(t),t.set(s.Workunit),t))}static attach(e,t,s){let r=Es.get({BaseUrl:e.baseUrl,Wuid:t},()=>new n(e,t));return s&&r.set(s),r}static existsLocal(e,t){return Es.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,Ke.Action.Compile):i.submit(t))}static compile(e,t,s){return n.submit(e,t,s,!0)}static query(e,t){return new ie(e).WUQuery(t).then(r=>r.Workunits.ECLWorkunit.map(function(i){return n.attach(e,i.Wuid,i)}))}constructor(e,t){super(),this.connection=new ie(e),this.topologyConnection=new le(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=Ke.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===Ke.Action.Debug&&(t=Ke.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===Ke.Action.Compile;case 3:case 4:case 7:case 999:return!0;default:}return!1}isFailed(){switch(this.StateID){case 7:case 4:return!0;default:}return!1}isDeleted(){return this.StateID===999}isDebugging(){switch(this.StateID){case 14:case 15:return!0;default:}return this._debugMode}isRunning(){switch(this.StateID){case 1:case 2:case 6:case 8:case 14:case 15:return!0;default:}return!1}setToFailed(){return this.WUAction(me.ECLWUActions.SetToFailed)}pause(){return this.WUAction(me.ECLWUActions.Pause)}pauseNow(){return this.WUAction(me.ECLWUActions.PauseNow)}resume(){return this.WUAction(me.ECLWUActions.Resume)}abort(){return this.WUAction(me.ECLWUActions.Abort)}protect(){return this.WUAction(me.ECLWUActions.Protect)}unprotect(){return this.WUAction(me.ECLWUActions.Unprotect)}delete(){return this.WUAction(me.ECLWUActions.Delete)}restore(){return this.WUAction(me.ECLWUActions.Restore)}deschedule(){return this.WUAction(me.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(me.ECLWUActions.Reschedule)}resubmit(){return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!1}).then(()=>(this.clearState(this.Wuid),this.refresh().then(()=>(this._monitor(),this))))}clone(){return this.WUResubmit({CloneWorkunit:!0,ResetWorkflow:!1}).then(e=>n.attach(this.connection.opts(),e.WUs.WU[0].WUID).refresh())}async refreshState(){return await this.WUQuery(),this.StateID===1&&!this.ActionEx&&!this._submitAction&&await this.refreshInfo(),this}async refreshInfo(e){return await this.WUInfo(e),this}async refreshDebug(){return await this.debugStatus(),this}async refresh(e=!1,t){return e?await Promise.all([this.refreshInfo(t),this.refreshDebug()]):await this.refreshState(),this}eclExceptions(){return this.Exceptions.ECLException}fetchArchive(){return this.connection.WUFileEx({Wuid:this.Wuid,Type:"ArchiveQuery"})}fetchECLExceptions(){return this.WUInfo({IncludeExceptions:!0}).then(()=>this.eclExceptions())}fetchResults(){return this.WUInfo({IncludeResults:!0}).then(()=>this.CResults)}fetchGraphs(){return this.WUInfo({IncludeGraphs:!0}).then(()=>this.CGraphs)}fetchQuery(){return this.WUInfo({IncludeECL:!0,TruncateEclTo64k:!1}).then(()=>this.Query)}fetchHelpers(){return this.WUInfo({IncludeHelpers:!0}).then(()=>this.Helpers?.ECLHelpFile||[])}fetchAllowedClusters(){return this.WUInfo({IncludeAllowedClusters:!0}).then(()=>this.AllowedClusters?.AllowedCluster||[])}fetchTotalClusterTime(){return this.WUInfo({IncludeTotalClusterTime:!0}).then(()=>this.TotalClusterTime)}fetchServiceNames(){return this.WUInfo({IncludeServiceNames:!0}).then(()=>this.ServiceNames?.Item)}fetchDetailsMeta(e={}){return this.WUDetailsMeta(e)}fetchDetailsRaw(e={}){return this.WUDetails(e).then(t=>t.Scopes.Scope)}normalizeDetails(e,t){let s={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},r=new Map;for(let o of e.Activities?.Activity??[])r.set(o.Kind,o.Name);let i=new Array(t.length);for(let o=0;o<t.length;o++){let u=t[o],p={},A={};if(u.Id&&u.Properties?.Property)for(let V of u.Properties.Property){let N=V.Measure,q=V.Name,G=V.RawValue;if(N==="ns"&&(V.Measure="s"),q==="Kind"){let I=parseInt(G,10);V.Formatted=r.get(I)??G}switch(s[q]={Name:V.Name,Measure:V.Measure,Creator:V.Creator,CreatorType:V.CreatorType},V.Measure){case"bool":p[q]=!!+G;break;case"sz":p[q]=+G;break;case"s":p[q]=+G/1e9;break;case"ns":p[q]=+G;break;case"ts":p[q]=new Date(+G/1e3).toISOString();break;case"cnt":p[q]=+G;break;case"cost":p[q]=+G/1e6;break;case"node":p[q]=+G;break;case"skw":p[q]=+G;break;default:p[q]=G}A[q]=Bo(V.Formatted??p[q])}let l={id:u.Id,name:u.ScopeName,type:u.ScopeType,Kind:u.Kind,Label:u.Label,__formattedProps:A,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...p},x=l[Fr];if(x)try{let V=JSON.parse(x.split("\\").join("\\\\")),N=[];for(let q=0;q<V.length;q++){let G=V[q].match(Qo);G&&N.push({filePath:(G[1]??"")+G[2]+G[3],line:parseInt(G[5],10),col:parseInt(G[6],10)})}l[Fr]=N}catch{Us.error(`Unexpected "DefinitionList": ${x}`)}let S={},M=0,Q="";for(let V in l)if(!V.startsWith("__")){let N=Ho(l,V,S);N&&(l.__groupedProps[N.Key]=N,!isNaN(N.StdDevs)&&N.StdDevs>M&&(M=N.StdDevs,Q=N.Key))}l.__StdDevs=M,l.__StdDevsSource=Q,i[o]=l}return{meta:e,columns:s,data:i}}fetchDetailsNormalized(e={}){return Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(t=>this.normalizeDetails(t[0],t[1]))}fetchInfo(e={}){return this.WUInfo(e)}fetchDetails(e={}){return this.WUDetails(e).then(t=>t.Scopes.Scope.map(s=>new yt(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 yt(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=>gs(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=wo(i.start);o.setMilliseconds(o.getMilliseconds()+i.elapsed/1e6),i.finish=To(o),s.push(i)}}return s.sort((r,i)=>r.start<i.start?-1:r.start>i.start?1:0),s})}_monitor(){if(this.isComplete()){this._monitorTickCount=0;return}super._monitor()}_monitorTimeoutDuration(){let e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?1e3:this._monitorTickCount<=3?3e3:this._monitorTickCount<=5?5e3:this._monitorTickCount<=7?1e4:e}on(e,t,s){if(this.isCallback(t))switch(e){case"completed":super.on("propChanged","StateID",r=>{this.isComplete()&&t([r])});break;case"changed":super.on(e,t);break;default:}else e==="changed"&&super.on(e,t,s);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,s)=>{let r=this.watch(i=>{e&&e(i),this.isComplete()&&(r.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,s)=>{let r=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(r.release(),t(this))})})}WUQuery(e={}){return this.connection.WUQuery({...e,Wuid:this.Wuid}).then(t=>(t.Workunits.ECLWorkunit.length===0?(this.clearState(this.Wuid),this.set("StateID",999)):this.set(t.Workunits.ECLWorkunit[0]),t)).catch(t=>{if(!t.Exception.some(r=>r.Code===20081?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw Us.warning(`Unexpected ESP exception: ${t.message}`),t;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),Es.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 Us.warning(`Unexpected ESP exception: ${s.message}`),s;return{}})}WUResubmit(e){return this.connection.WUResubmit(tn({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails(tn({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=>tn({Scopes:{Scope:[]}},t))}WUAction(e){return this.connection.WUAction({Wuids:{Item:[this.Wuid]},WUActionType:e}).then(t=>this.refresh().then(()=>(this._monitor(),t)))}publish(e){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:e||this.Jobname,AllowForeignFiles:!0,Activate:me.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){let t=new as({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 sn(e)}).catch(s=>(Us.error(s),Promise.resolve(new sn(e)))):Promise.resolve(new sn(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=Ar(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(t=>_o(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}))}},rn="definition";function jo(n){return n._[rn]!==void 0}function Oo(n){let e=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(n._[rn]);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._[rn]}`)}function _o(n,e){let t=[];for(let s of n.vertices)if(jo(s)){let r=Oo(s);(r&&!e||e===r.file)&&t.push(r)}return t.sort((s,r)=>s.line-r.line)}var bs,Ir=class n extends Xo{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 bs||(bs=new n(e)),t&&bs.set(t),bs}constructor(e){super(),e instanceof Ct?this.connection=e:this.connection=new Ct(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(t=>e===""||t.ClusterName===e).map(t=>ot.attach(this.connection.connectionOptions(),t.Wuid,t))}setBanner(e){return this.connection.SetBanner({...e}).then(t=>(this.set(t),this))}lazyRefresh=Yo(async()=>{let e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}};import{Cache as qo,scopedLogger as zo,StateObject as Jo}from"@hpcc-js/util";var Ko=zo("logicalFile.ts"),on=class extends qo{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}},Zo=new on,Mr=class n extends Jo{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=Zo.get({BaseUrl:e.baseUrl,Cluster:t,Name:s},()=>new n(e,t,s));return r&&i.set(r),i}constructor(e,t,s){super(),e instanceof Dt?this.connection=e:this.connection=new Dt(e),this.clear({Cluster:t,Name:s})}filePartsOnCluster(){return[...this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[]]}fileParts(){let e=[];for(let t of this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[])for(let s of t?.DFUFileParts?.DFUPart||[]){let r={...t,...s};delete r.DFUFileParts,e.push(r)}return e}update(e){return this.connection.DFUInfo({...e,Cluster:this.Cluster,Name:this.Name}).then(t=>(this.set({Cluster:this.Cluster,...t.FileDetail}),t))}fetchInfo(){return this.connection.DFUInfo({Cluster:this.Cluster,Name:this.Name}).then(e=>(this.set({Cluster:this.Cluster,...e.FileDetail,ProtectList:e?.FileDetail?.ProtectList??{DFUFileProtect:[]}}),e.FileDetail)).catch(e=>{if(!e.Exception.some(s=>s.Code===20038?(this.set("Name",this.Name+" (Deleted)"),this.set("StateID",999),!0):!1))throw Ko.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||[])}};import{Cache as $o,StateObject as ea}from"@hpcc-js/util";var an=class extends $o{constructor(){super(e=>e.Address)}},ta=new an,Ps=class n extends ea{connection;get Address(){return this.get("Address")}get ConfigAddress(){return this.get("ConfigAddress")}get Name(){return this.get("Name")}get ProcessType(){return this.get("ProcessType")}get DisplayType(){return this.get("DisplayType")}get Description(){return this.get("Description")}get AgentVersion(){return this.get("AgentVersion")}get Contact(){return this.get("Contact")}get Location(){return this.get("Location")}get UpTime(){return this.get("UpTime")}get ComponentName(){return this.get("ComponentName")}get ComponentPath(){return this.get("ComponentPath")}get RoxieState(){return this.get("RoxieState")}get RoxieStateDetails(){return this.get("RoxieStateDetails")}get OS(){return this.get("OS")}get ProcessNumber(){return this.get("ProcessNumber")}get Channels(){return this.get("Channels")}get Processors(){return this.get("Processors")}get Storage(){return this.get("Storage")}get Running(){return this.get("Running")}get PhysicalMemory(){return this.get("PhysicalMemory")}get VirtualMemory(){return this.get("VirtualMemory")}get ComponentInfo(){return this.get("ComponentInfo")}get Exception(){return this.get("Exception")}static attach(e,t,s){let r=ta.get({Address:t},()=>new n(e));return s&&r.set(s),r}constructor(e){super(),e instanceof ke?this.connection=e:this.connection=new ke(e)}};var Br=mt(Ys(),1);import{Cache as wr,StateObject as pa,scopedLogger as ga}from"@hpcc-js/util";import{Cache as ia,exists as Tr,StateObject as oa}from"@hpcc-js/util";import{Cache as sa,StateObject as na}from"@hpcc-js/util";var cn=class extends sa{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}},ra=new cn,at=class n extends na{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=>Ps.attach(this.machineConnection,e.Address,e))}static attach(e,t,s){let r=ra.get({BaseUrl:e.baseUrl,Name:t},()=>new n(e,t));return s&&r.set(s),r}constructor(e,t){super(),e instanceof le?(this.connection=e,this.machineConnection=new ke(e.connectionOptions())):(this.connection=new le(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 sp(n){let e;return n instanceof le?e=n:e=new le(n),e.TpListTargetClusters({}).then(t=>t.TargetClusters.TpClusterNameType.map(s=>at.attach(n,s.Name,s)))}var un={};function np(n){if(!un[n.baseUrl]){let e;n instanceof le?e=n:e=new le(n),un[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 at.attach(n,o.Name,o)})}return un[n.baseUrl]}var ln=class extends ia{constructor(){super(e=>e.BaseUrl)}},aa=new ln,Is=class n extends oa{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=>at.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,t){let s=aa.get({BaseUrl:e.baseUrl},()=>new n(e));return t&&s.set(t),s}constructor(e){super(),e instanceof le?this.connection=e:this.connection=new le(e)}GetESPServiceBaseURL(e=""){return this.connection.TpServiceQuery({}).then(t=>{let s=this.connection.protocol(),r=this.connection.ip(),i=s==="https:"?"18002":"8002";if(Tr("ServiceList.TpEspServers.TpEspServer",t)){for(let o of t.ServiceList.TpEspServers.TpEspServer)if(Tr("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){return this.isCallback(t)?e==="changed"&&super.on(e,t):e==="changed"&&super.on(e,t,s),this._monitor(),this}};function ve(n,e,t){e==="__proto__"||e==="constructor"||e==="prototype"||(n[e]=t)}function xt(n){return n=""+n,n.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"&#10;").replace(/\r/g,"&#13;")}function ua(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,p=+t[6]||0,A=+t[7]||0;return s*24*60*60+r*60*60+i*60+o+u/1e3+p/1e6+A/1e9}function Ve(n,e){let t=n.indexOf(e);return t!==-1?parseFloat(n.substring(0,t)):-1}function ca(n){if(n){if(!isNaN(+n))return parseFloat(n)}else return 0;let e=Ve(n,"Kb");return e>=0?e*1024:(e=Ve(n,"Mb"),e>=0?e*Math.pow(1024,2):(e=Ve(n,"Gb"),e>=0?e*Math.pow(1024,3):(e=Ve(n,"Tb"),e>=0?e*Math.pow(1024,4):(e=Ve(n,"Pb"),e>=0?e*Math.pow(1024,5):(e=Ve(n,"Eb"),e>=0?e*Math.pow(1024,6):(e=Ve(n,"Zb"),e>=0?e*Math.pow(1024,7):(e=Ve(n,"b"),e>=0?e:0)))))))}function la(n){return n?parseFloat(n):0}var pn=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+'="'+xt(i[o])+'"':r+='<att name="'+o+'" value="'+xt(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+'="'+xt(r[i])+'"':s+='<att name="'+i+'" value="'+xt(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="'+xt(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))}},Wt=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}},He=class extends Wt{_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)})}},$e=class extends Wt{_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)}},et=class extends Wt{_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]}},Ms=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 He}isVertex(e){return e instanceof $e}isEdge(e){return e instanceof et}getGlobalType(e){return e instanceof $e?3:e instanceof et?4:e instanceof He?2:e instanceof n?1:0}getGlobalTypeString(e){return e instanceof $e?"Vertex":e instanceof et?"Edge":e instanceof He?"Cluster":e instanceof n?"Graph":"Unknown"}getItem(e,t){if(!this.idx[t])switch(e.tagName){case"graph":let r=new He(this,t);this.subgraphs.push(r),this.idx[t]=r;break;case"node":let i=new $e(this,t);this.vertices.push(i),this.idx[t]=i;break;case"edge":let o=new et(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=>{ve(s,r.name,r.value)}),s}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof He?this.subgraphs=this.subgraphs.filter(t=>e!==t):e instanceof $e?this.vertices=this.vertices.filter(t=>e!==t):e instanceof et&&(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 x=this.getChildByTagName(o,"graph");if(x){i=!0;let S=this.walkDocument(x,r.getAttribute("id"));s.addSubgraph(S)}}if(!i){let x=this.walkDocument(r,r.getAttribute("id"));s.addVertex(x)}break;case"att":let u=r.getAttribute("name"),p="_"+u,A=r.getAttribute("value");u.indexOf("Time")===0?(ve(s,p,A),ve(s,u,""+ua(A))):u.indexOf("Size")===0?(ve(s,p,A),ve(s,u,""+ca(A))):u.indexOf("Skew")===0?(ve(s,p,A),ve(s,u,""+la(A))):ve(s,u,A);break;case"edge":let l=this.walkDocument(r,r.getAttribute("id"));if(l.NumRowsProcessed!==void 0?l._eclwatchCount=l.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):l.Count!==void 0?l._eclwatchCount=l.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):l.count!==void 0&&(l._eclwatchCount=l.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),l.inputProgress&&(l._eclwatchInputProgress="["+l.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),l.SkewMaxRowsProcessed&&l.SkewMinRowsProcessed&&(l._eclwatchSkew="+"+l.SkewMaxRowsProcessed+", "+l.SkewMinRowsProcessed),!l._dependsOn){if(!l._childGraph){if(l._sourceActivity||l._targetActivity){l._isSpill=!0;let x=l.getSource();x&&(x._isSpill=!0);let S=l.getTarget();S&&(S._isSpill=!0)}}}s.addEdge(l);break;default:break}break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:break;default:break}}),s}removeSubgraphs(){[...this.subgraphs].forEach(t=>{t.__hpcc_parent instanceof He&&t.remove()})}removeSpillVertices(){[...this.vertices].forEach(t=>{t.isSpill()&&t.remove()})}getLocalisedXGMML(e,t,s,r){let i=new pn(this);return i.calcVisibility(e,t,s,r),i.writeXgmml(),"<graph>"+i.m_xgmml+"</graph>"}};var Ts=ga("@hpcc-js/comms/ecl/query.ts"),da=(0,Br.format)("~s");function ma(n){return!isNaN(parseFloat(n))&&!isNaN(n-0)}var gn=class extends wr{constructor(){super(e=>wr.hash([e.QueryId,e.QuerySet]))}},fa=new gn,Nr=class n extends pa{wsWorkunitsService;get BaseUrl(){return this.wsWorkunitsService.baseUrl}topology;_requestSchema;_responseSchema;get properties(){return this.get()}get Exceptions(){return this.get("Exceptions")}get QueryId(){return this.get("QueryId")}get QuerySet(){return this.get("QuerySet")}get QueryName(){return this.get("QueryName")}get Wuid(){return this.get("Wuid")}get Dll(){return this.get("Dll")}get Suspended(){return this.get("Suspended")}get Activated(){return this.get("Activated")}get SuspendedBy(){return this.get("SuspendedBy")}get Clusters(){return this.get("Clusters")}get PublishedBy(){return this.get("PublishedBy")}get Comment(){return this.get("Comment")}get LogicalFiles(){return this.get("LogicalFiles")}get SuperFiles(){return this.get("SuperFiles")}get IsLibrary(){return this.get("IsLibrary")}get Priority(){return this.get("Priority")}get WUSnapShot(){return this.get("WUSnapShot")}get CompileTime(){return this.get("CompileTime")}get LibrariesUsed(){return this.get("LibrariesUsed")}get CountGraphs(){return this.get("CountGraphs")}get ResourceURLCount(){return this.get("ResourceURLCount")}get WsEclAddresses(){return this.get("WsEclAddresses")}get WUGraphs(){return this.get("WUGraphs")}get WUTimers(){return this.get("WUTimers")}get PriorityID(){return this.get("PriorityID")}constructor(e,t,s,r){super(),e instanceof ie?this.wsWorkunitsService=e:this.wsWorkunitsService=new ie(e),this.topology=Is.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:t,QueryId:s,...r})}static attach(e,t,s,r){let i=fa.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 Xt({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){Ts.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){Ts.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 Ms,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=ot.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(p=>{let A=p.Id[0];if(A==="a"||A==="e"){let l=r.idx[p.Id.substring(1)];if(!l)return Ts.debug(`Missing graph data for metric ID: ${p.Id}`),p;let x=new Set(p.Properties.Property.map(M=>M.Name)),S=[];for(let M in l){let Q=M.charAt(0);if(Q!=="_"&&Q===Q.toUpperCase()&&!x.has(M)){let V=l[M],N=typeof V;if(N==="string"||N==="number"||N==="boolean"){let G=ma(V)?parseFloat(V):V,I=V;M.indexOf("Time")>=0&&(G=G/1e9,I=da(G)+"s"),S.push({Name:M,RawValue:G,Formatted:I})}}}S.length>0&&p.Properties.Property.push(...S)}return p});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 Ts.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]:[]}};import{Cache as ha,Dispatch as Da,Message as Ca}from"@hpcc-js/util";var dn=class extends ha{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}},Ra=new dn,tt=class extends Ca{constructor(t,s,r){super();this.key=t;this.value=s;this.oldValue=r}key;value;oldValue;get canConflate(){return!0}conflate(t){return this.key===t.key?(this.value=t.value,!0):!1}void(){return this.value===this.oldValue}},Qr=class n{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new Da;static attach(e,t="HPCCApps",s,r=!0){return Ra.get({BaseUrl:e.baseUrl,Name:t,UserSpecific:r,Namespace:s},()=>new n(e,t,s,r))}constructor(e,t,s,r){e instanceof Rt?this.connection=e:this.connection=new Rt(e),this.Name=t,this.UserSpecific=r,this.Namespace=s}_knownValues={};create(){this.connection.CreateStore({Name:this.Name,Type:"",Description:""})}set(e,t,s=!0){return this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e,Value:t}).then(r=>{let i=this._knownValues[e];this._knownValues[e]=t,s&&this._dispatch.post(new 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)}};import{Cache as Sa,scopedLogger as ya,StateObject as xa}from"@hpcc-js/util";var Wa=ya("@hpcc-js/comms/dfuWorkunit.ts");var mn=class extends Sa{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}},Lr=new mn,Gr=class n extends xa{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=>(Lr.set(s),s.set(r.result),s))}static attach(e,t,s){let r=Lr.get({BaseUrl:e.baseUrl,ID:t},()=>new n(e,t));return s&&r.set(s),r}static sprayFixed(e,t){let s=new Je(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 Je(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 Je(e);return s.DesprayEx({...t}).then(r=>{let i=r.wuid;return s.GetDFUWorkunit({wuid:i}).then(o=>n.attach(e,i,o.result))})}update(e){return this.connection.UpdateDFUWorkunitEx({wu:{JobName:e?.wu?.JobName??this.JobName,isProtected:e?.wu?.isProtected??this.isProtected,ID:this.ID,State:this.State},ClusterOrig:this.ClusterName,JobNameOrig:this.JobName,isProtectedOrig:this.isProtected,StateOrig:this.State})}isComplete(){switch(this.State){case 6:case 5:case 4:case 999:return!0;default:}return!1}isFailed(){return!!(this.isComplete()&&this.State!==6)}isDeleted(){return this.State===999}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(ht.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===ht.DFUWUActions.Delete?t:this.refresh().then(()=>(this._monitor(),t)))}on(e,t,s){if(this.isCallback(t))switch(e){case"finished":super.on("propChanged","State",r=>{this.isComplete()&&t([r])});break;case"changed":super.on(e,t);break;default:}else e==="changed"&&super.on(e,t,s);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,s)=>{let r=this.watch(i=>{e&&e(i),this.isComplete()&&(r.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,s)=>{let r=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(r.release(),t(this))})})}constructor(e,t){super(),this.connection=new Je(e),this.topologyConnection=new le(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 Wa.warning(`Unexpected ESP exception: ${t.message}`),t;return{}})}};import*as zr from"node:child_process";import*as Jr from"node:crypto";import*as pe from"node:fs";import*as Te from"node:os";import*as fe from"node:path";import{exists as wa,scopedLogger as Na,xml2json as Ba}from"@hpcc-js/util";import*as st from"node:fs";import*as $ from"node:path";import{Dictionary as vr,DictionaryNoCase as kr,find as Aa,SAXStackParser as Ua,scopedLogger as Ea,XMLNode as Fa}from"@hpcc-js/util";var ba=Ea("clienttools/eclmeta"),Pa=!1;function ut(n,e,t){if(Pa){for(let s in n){let r=`${e}.${s}`;s!=="$"&&t[s]===void 0&&t[s.toLowerCase()+"s"]===void 0&&ba.debug(r)}n.$&&ut(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}},ct=class{get scope(){return this}name;type;sourcePath;line;start;body;end;definitions;constructor(e,t,s,r,i=1,o=0,u=0,p=Number.MAX_VALUE){this.name=e,this.type=t,this.sourcePath=$.normalize(s),this.line=+i-1,this.start=+o,this.body=+u,this.end=+p,this.definitions=this.parseDefinitions(r)}parseDefinitions(e=[]){return e.map(t=>{let s=new Cn(this.sourcePath,t);return ut(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=Aa(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 ct{__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 ut(t,"attr",s),s})}parseFields(e=[]){return e.map(t=>{let s=new Dn(this,t);return ut(t,"field",s),s})}suggestions(){return super.suggestions().concat(this.fields.map(e=>({name:e.name,type:e.type})))}},ws=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 ct{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 Fa("");s.appendAttribute("name","$"),s.appendAttribute("ref",t.join(".")),this.imports=[new ws(s),...this.parseImports(e.children("Import"))]}parseImports(e=[]){return e.map(t=>{let s=new ws(t);return ut(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}},Ia=n=>$.basename(n).indexOf(".")===0,Vr=n=>st.lstatSync(n).isDirectory()&&!Ia(n),Ma=n=>[".ecl",".ecllib"].indexOf($.extname(n).toLowerCase())>=0,Hr=n=>st.readdirSync(n).map(e=>$.join(n,e)).filter(e=>Vr(e)||Ma(e)),Sn=class extends ct{constructor(e,t){super(e,"file",t,[])}suggestions(){return[]}},yn=class extends ct{constructor(e,t){super(e,"folder",t,[])}suggestions(){return Hr(this.sourcePath).map(e=>({name:$.basename(e,".ecl"),type:"folder"}))}},xn=class{_workspacePath;_eclccPath;_clientTools;_sourceByID=new kr;_sourceByPath=new vr;_test=new kr;constructor(e,t){this._workspacePath=e,this._eclccPath=t}refresh(){this.primeWorkspace(),this.primeClientTools()}primeClientTools(){return jr(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]&&st.existsSync(e[t])&&this.walkChildFolders(e[t],e[t]);return this})}primeWorkspace(){st.existsSync(this._workspacePath)&&this.visitFolder(this._workspacePath,this._workspacePath)}walkChildFolders(e,t,s=!1){for(let r of Hr(e))Vr(r)?this.visitFolder(r,t,s):this.visitFile(r,t,s)}visitFile(e,t,s=!1){let r=$.parse(e),i=$.join(r.dir,r.name),o=$.relative(t,i).split($.sep).join(".");(s||!this._test.has(o))&&this._test.set(o,new Sn("",e))}visitFolder(e,t,s=!1){let r=$.relative(t,e).split($.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(ut(t,"source",s),this._sourceByID.set(s.name,s),this._sourceByPath.set(s.sourcePath,s),s.name){let i=s.name.split(".").length;if(i>1){let o=s.sourcePath;for(;i>1;)o=$.dirname(o),--i;this.visitFolder(o,$.dirname(o))}}this.walkSource(s)}}parseMetaXML(e){let t=new Wn;return t.parse(e),this.parseSources(t.sources),t.sources.map(s=>$.normalize(s.$.sourcePath))}resolveQualifiedID(e,t,s){let r;if(!r&&this._test.has(t)&&(r=this._test.get(t).scope),!r&&this._sourceByPath.has(e)){let i=this._sourceByPath.get(e),o=t.split(".");for(let p of i.imports)if(p.name.toLowerCase()===o[0].toLowerCase()){p.ref?o[0]=p.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)}},fn=new vr;function nt(n,e){let t=$.normalize(n);if(!fn.has(t)){let s=new xn(t,e);fn.set(t,s),s.refresh()}return fn.get(t)}function Ta(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 Fg(n,e,t){for(;Ta(n,e,t);)e+=t?-1:1;return e+(t?1:-1)}var Wn=class extends Ua{sources=[];endXMLNode(e){e.name==="Source"&&this.sources.push(e),super.endXMLNode(e)}};var lt=Na("clienttools/eclcc"),An=Te.type()==="Windows_NT"?".exe":"";function Or(n){return n.split(`\r
915
+ </div>`}},At=class extends en{wu;constructor(e,t){super(t),this.wu=e}};import{StateObject as Uo}from"@hpcc-js/util";var ys=class extends Uo{connection;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get FileCluster(){return this.get("FileCluster")}get Name(){return this.get("Name")}get IsSuperFile(){return this.get("IsSuperFile")}get Subs(){return this.get("Subs")}get Count(){return this.get("Count")}get ECLSourceFiles(){return this.get("ECLSourceFiles")}constructor(e,t,s){super(),e instanceof ie?this.connection=e:this.connection=new ie(e),this.set({Wuid:t,...s})}};import{espTime2Seconds as Eo,StateObject as Fo}from"@hpcc-js/util";var xs=class extends Fo{connection;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get Name(){return this.get("Name")}get Value(){return this.get("Value")}get Seconds(){return this.get("Seconds")}get GraphName(){return this.get("GraphName")}get SubGraphId(){return this.get("SubGraphId")}get HasSubGraphId(){return this.get("HasSubGraphId")}get count(){return this.get("count")}get Timestamp(){return this.get("Timestamp")}get When(){return this.get("When")}constructor(e,t,s){super(),e instanceof ie?this.connection=e:this.connection=new ie(e);let r=Eo(s.Value);this.set({Wuid:t,Seconds:Math.round(r*1e3)/1e3,HasSubGraphId:s.SubGraphId!==void 0,...s})}};var To=(0,Es.utcFormat)("%Y-%m-%dT%H:%M:%S.%LZ"),wo=(0,Es.utcParse)("%Y-%m-%dT%H:%M:%S.%LZ"),No=(0,Ir.format)(",");function Bo(n){return n&&!isNaN(+n)?No(+n):n}var Er="DefinitionList",Qo=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,Lo=["Avg","Min","Max","Delta","StdDev"],Go=["SkewMin","SkewMax","NodeMin","NodeMax"],ko=/[A-Z][a-z]*/g;function vo(n){for(let t of Go){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(ko);if(e?.length){let t=e.shift(),s=e.join("");for(let r of Lo){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 Fr={};function Vo(n){let e=Fr[n];return e||(e=vo(n),Fr[n]=e),e}function Me(n,e){return n.__formattedProps?.[e]??n[e]}function Ws(n){if(n===void 0)return;let e=parseFloat(n);return isNaN(e)?void 0:e}function Ho(n,e,t){let s=Vo(e);if(!t[s.measure]){t[s.label]=!0;let r=Ws(n[`${s.measure}Avg${s.label}`]),i=Ws(n[`${s.measure}Min${s.label}`]),o=Ws(n[`${s.measure}Max${s.label}`]),c=Ws(n[`${s.measure}StdDev${s.label}`]),g=Math.max((r-i)/c,(o-r)/c);return{Key:`${s.measure}${s.label}`,Value:Me(n,`${s.measure}${s.label}`),Avg:Me(n,`${s.measure}Avg${s.label}`),Min:Me(n,`${s.measure}Min${s.label}`),Max:Me(n,`${s.measure}Max${s.label}`),Delta:Me(n,`${s.measure}Delta${s.label}`),StdDev:Me(n,`${s.measure}StdDev${s.label}`),StdDevs:isNaN(g)?void 0:g,SkewMin:Me(n,`SkewMin${s.label}`),SkewMax:Me(n,`SkewMax${s.label}`),NodeMin:Me(n,`NodeMin${s.label}`),NodeMax:Me(n,`NodeMax${s.label}`)}}return null}var bs=Po("workunit.ts"),nn=class extends Io{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}},Us=new nn,ot=class n extends Mo{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")||_s[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 As;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,()=>Rs.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 xs(this.connection,this.Wuid,e))}_graphCache=new ls;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 us(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 ds(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 ys(this.connection,this.Wuid,e))}get VariableCount(){return this.get("VariableCount",0)}get Variables(){return this.get("Variables",{ECLResult:[]})}get TimerCount(){return this.get("TimerCount",0)}get HasDebugValue(){return this.get("HasDebugValue")}get ApplicationValueCount(){return this.get("ApplicationValueCount",0)}get XmlParams(){return this.get("XmlParams")}get AccessFlag(){return this.get("AccessFlag")}get ClusterFlag(){return this.get("ClusterFlag")}get ResultViewCount(){return this.get("ResultViewCount",0)}get DebugValueCount(){return this.get("DebugValueCount",0)}get WorkflowCount(){return this.get("WorkflowCount",0)}get Archived(){return this.get("Archived")}get RoxieCluster(){return this.get("RoxieCluster")}get DebugState(){return this.get("DebugState",{})}get Queue(){return this.get("Queue")}get Active(){return this.get("Active")}get Action(){return this.get("Action")}get Scope(){return this.get("Scope")}get AbortBy(){return this.get("AbortBy")}get AbortTime(){return this.get("AbortTime")}get Workflows(){return this.get("Workflows")}get TimingData(){return this.get("TimingData")}get HelpersDesc(){return this.get("HelpersDesc")}get GraphsDesc(){return this.get("GraphsDesc")}get SourceFilesDesc(){return this.get("SourceFilesDesc")}get ResultsDesc(){return this.get("ResultsDesc")}get VariablesDesc(){return this.get("VariablesDesc")}get TimersDesc(){return this.get("TimersDesc")}get DebugValuesDesc(){return this.get("DebugValuesDesc")}get ApplicationValuesDesc(){return this.get("ApplicationValuesDesc")}get WorkflowsDesc(){return this.get("WorkflowsDesc")}get ServiceNames(){return this.get("ServiceNames")}get CompileCost(){return this.get("CompileCost")}get ExecuteCost(){return this.get("ExecuteCost")}get FileAccessCost(){return this.get("FileAccessCost")}get NoAccess(){return this.get("NoAccess")}get ECLWUProcessList(){return this.get("ECLWUProcessList")}get CostSavingPotential(){return this.get("CostSavingPotential")}static create(e){let t=new n(e);return t.connection.WUCreate().then(s=>(Us.set(t),t.set(s.Workunit),t))}static attach(e,t,s){let r=Us.get({BaseUrl:e.baseUrl,Wuid:t},()=>new n(e,t));return s&&r.set(s),r}static existsLocal(e,t){return Us.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,Ke.Action.Compile):i.submit(t))}static compile(e,t,s){return n.submit(e,t,s,!0)}static query(e,t){return new ie(e).WUQuery(t).then(r=>r.Workunits.ECLWorkunit.map(function(i){return n.attach(e,i.Wuid,i)}))}constructor(e,t){super(),this.connection=new ie(e),this.topologyConnection=new le(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=Ke.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===Ke.Action.Debug&&(t=Ke.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===Ke.Action.Compile;case 3:case 4:case 7:case 999:return!0;default:}return!1}isFailed(){switch(this.StateID){case 7:case 4:return!0;default:}return!1}isDeleted(){return this.StateID===999}isDebugging(){switch(this.StateID){case 14:case 15:return!0;default:}return this._debugMode}isRunning(){switch(this.StateID){case 1:case 2:case 6:case 8:case 14:case 15:return!0;default:}return!1}setToFailed(){return this.WUAction(me.ECLWUActions.SetToFailed)}pause(){return this.WUAction(me.ECLWUActions.Pause)}pauseNow(){return this.WUAction(me.ECLWUActions.PauseNow)}resume(){return this.WUAction(me.ECLWUActions.Resume)}abort(){return this.WUAction(me.ECLWUActions.Abort)}protect(){return this.WUAction(me.ECLWUActions.Protect)}unprotect(){return this.WUAction(me.ECLWUActions.Unprotect)}delete(){return this.WUAction(me.ECLWUActions.Delete)}restore(){return this.WUAction(me.ECLWUActions.Restore)}deschedule(){return this.WUAction(me.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(me.ECLWUActions.Reschedule)}resubmit(){return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!1}).then(()=>(this.clearState(this.Wuid),this.refresh().then(()=>(this._monitor(),this))))}clone(){return this.WUResubmit({CloneWorkunit:!0,ResetWorkflow:!1}).then(e=>n.attach(this.connection.opts(),e.WUs.WU[0].WUID).refresh())}async refreshState(){return await this.WUQuery(),this.StateID===1&&!this.ActionEx&&!this._submitAction&&await this.refreshInfo(),this}async refreshInfo(e){return await this.WUInfo(e),this}async refreshDebug(){return await this.debugStatus(),this}async refresh(e=!1,t){return e?await Promise.all([this.refreshInfo(t),this.refreshDebug()]):await this.refreshState(),this}eclExceptions(){return this.Exceptions.ECLException}fetchArchive(){return this.connection.WUFileEx({Wuid:this.Wuid,Type:"ArchiveQuery"})}fetchECLExceptions(){return this.WUInfo({IncludeExceptions:!0}).then(()=>this.eclExceptions())}fetchResults(){return this.WUInfo({IncludeResults:!0}).then(()=>this.CResults)}fetchGraphs(){return this.WUInfo({IncludeGraphs:!0}).then(()=>this.CGraphs)}fetchQuery(){return this.WUInfo({IncludeECL:!0,TruncateEclTo64k:!1}).then(()=>this.Query)}fetchHelpers(){return this.WUInfo({IncludeHelpers:!0}).then(()=>this.Helpers?.ECLHelpFile||[])}fetchAllowedClusters(){return this.WUInfo({IncludeAllowedClusters:!0}).then(()=>this.AllowedClusters?.AllowedCluster||[])}fetchTotalClusterTime(){return this.WUInfo({IncludeTotalClusterTime:!0}).then(()=>this.TotalClusterTime)}fetchServiceNames(){return this.WUInfo({IncludeServiceNames:!0}).then(()=>this.ServiceNames?.Item)}fetchDetailsMeta(e={}){return this.WUDetailsMeta(e)}fetchDetailsRaw(e={}){return this.WUDetails(e).then(t=>t.Scopes.Scope)}normalizeDetails(e,t){let s={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},r=new Map;for(let o of e.Activities?.Activity??[])r.set(o.Kind,o.Name);let i=new Array(t.length);for(let o=0;o<t.length;o++){let c=t[o],g={},W={};if(c.Properties?.Property)for(let V of c.Properties.Property){let N=V.Measure,q=V.Name,G=V.RawValue;if(N==="ns"&&(V.Measure="s"),q==="Kind"){let P=parseInt(G,10);V.Formatted=r.get(P)??G}switch(s[q]={Name:V.Name,Measure:V.Measure,Creator:V.Creator,CreatorType:V.CreatorType},V.Measure){case"bool":g[q]=!!+G;break;case"sz":g[q]=+G;break;case"s":g[q]=+G/1e9;break;case"ns":g[q]=+G;break;case"ts":g[q]=new Date(+G/1e3).toISOString();break;case"cnt":g[q]=+G;break;case"cost":g[q]=+G/1e6;break;case"node":g[q]=+G;break;case"skw":g[q]=+G;break;default:g[q]=G}W[q]=Bo(V.Formatted??g[q])}let l={id:c.Id,name:c.ScopeName,type:c.ScopeType,Kind:c.Kind,Label:c.Label,__formattedProps:W,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...g},y=l[Er];if(y)try{let V=JSON.parse(y.split("\\").join("\\\\")),N=[];for(let q=0;q<V.length;q++){let G=V[q].match(Qo);G&&N.push({filePath:(G[1]??"")+G[2]+G[3],line:parseInt(G[5],10),col:parseInt(G[6],10)})}l[Er]=N}catch{bs.error(`Unexpected "DefinitionList": ${y}`)}let R={},M=0,Q="";for(let V in l)if(!V.startsWith("__")){let N=Ho(l,V,R);N&&(l.__groupedProps[N.Key]=N,!isNaN(N.StdDevs)&&N.StdDevs>M&&(M=N.StdDevs,Q=N.Key))}l.__StdDevs=M,l.__StdDevsSource=Q,i[o]=l}return{meta:e,columns:s,data:i}}fetchDetailsNormalized(e={}){return Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(t=>this.normalizeDetails(t[0],t[1]))}fetchInfo(e={}){return this.WUInfo(e)}fetchDetails(e={}){return this.WUDetails(e).then(t=>t.Scopes.Scope.map(s=>new At(this,s)))}fetchDetailsHierarchy(e={}){return this.WUDetails(e).then(t=>{let s=[],r={};t.Scopes.Scope.forEach(i=>{if(r[i.ScopeName])return r[i.ScopeName].update(i),null;{let o=new At(this,i);return r[o.ScopeName]=o,o}});for(let i in r)if(r.hasOwnProperty(i)){let o=r[i],c=o.parentScope();c&&r[c]?r[c].children().push(o):s.push(o)}return s})}fetchGraphDetails(e=[],t){return this.fetchDetails({ScopeFilter:{MaxDepth:999999,Ids:e,ScopeTypes:t},NestedFilter:{Depth:999999,ScopeTypes:["graph","subgraph","activity","edge","function"]},PropertiesToReturn:{AllStatistics:!0,AllAttributes:!0,AllHints:!0,AllProperties:!0,AllScopes:!0},ScopeOptions:{IncludeId:!0,IncludeScope:!0,IncludeScopeType:!0},PropertyOptions:{IncludeName:!0,IncludeRawValue:!0,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}})}fetchScopeGraphs(e=[]){return this.fetchGraphDetails(e,["graph"]).then(t=>ps(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=wo(i.start);o.setMilliseconds(o.getMilliseconds()+i.elapsed/1e6),i.finish=To(o),s.push(i)}}return s.sort((r,i)=>r.start<i.start?-1:r.start>i.start?1:0),s})}_monitor(){if(this.isComplete()){this._monitorTickCount=0;return}super._monitor()}_monitorTimeoutDuration(){let e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?1e3:this._monitorTickCount<=3?3e3:this._monitorTickCount<=5?5e3:this._monitorTickCount<=7?1e4:e}on(e,t,s){if(this.isCallback(t))switch(e){case"completed":super.on("propChanged","StateID",r=>{this.isComplete()&&t([r])});break;case"changed":super.on(e,t);break;default:}else e==="changed"&&super.on(e,t,s);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,s)=>{let r=this.watch(i=>{e&&e(i),this.isComplete()&&(r.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,s)=>{let r=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(r.release(),t(this))})})}WUQuery(e={}){return this.connection.WUQuery({...e,Wuid:this.Wuid}).then(t=>(t.Workunits.ECLWorkunit.length===0?(this.clearState(this.Wuid),this.set("StateID",999)):this.set(t.Workunits.ECLWorkunit[0]),t)).catch(t=>{if(!t.Exception.some(r=>r.Code===20081?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw bs.warning(`Unexpected ESP exception: ${t.message}`),t;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),Us.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 bs.warning(`Unexpected ESP exception: ${s.message}`),s;return{}})}WUResubmit(e){return this.connection.WUResubmit(tn({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails(tn({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=>tn({Scopes:{Scope:[]}},t))}WUAction(e){return this.connection.WUAction({Wuids:{Item:[this.Wuid]},WUActionType:e}).then(t=>this.refresh().then(()=>(this._monitor(),t)))}publish(e){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:e||this.Jobname,AllowForeignFiles:!0,Activate:me.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){let t=new as({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 sn(e)}).catch(s=>(bs.error(s),Promise.resolve(new sn(e)))):Promise.resolve(new sn(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=Wr(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(t=>_o(t,e))}debugPrint(e,t=0,s=10){return this.debug("print",{edgeID:e,startRow:t,numRows:s}).then(r=>r.children().map(i=>{let o={};return i.children().forEach(c=>{o[c.name]=c.content}),o}))}},rn="definition";function jo(n){return n._[rn]!==void 0}function Oo(n){let e=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(n._[rn]);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._[rn]}`)}function _o(n,e){let t=[];for(let s of n.vertices)if(jo(s)){let r=Oo(s);(r&&!e||e===r.file)&&t.push(r)}return t.sort((s,r)=>s.line-r.line)}var Fs,Pr=class n extends Xo{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 Fs||(Fs=new n(e)),t&&Fs.set(t),Fs}constructor(e){super(),e instanceof St?this.connection=e:this.connection=new St(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(t=>e===""||t.ClusterName===e).map(t=>ot.attach(this.connection.connectionOptions(),t.Wuid,t))}setBanner(e){return this.connection.SetBanner({...e}).then(t=>(this.set(t),this))}lazyRefresh=Yo(async()=>{let e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}};import{Cache as qo,scopedLogger as zo,StateObject as Jo}from"@hpcc-js/util";var Ko=zo("logicalFile.ts"),on=class extends qo{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}},Zo=new on,Mr=class n extends Jo{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=Zo.get({BaseUrl:e.baseUrl,Cluster:t,Name:s},()=>new n(e,t,s));return r&&i.set(r),i}constructor(e,t,s){super(),e instanceof Dt?this.connection=e:this.connection=new Dt(e),this.clear({Cluster:t,Name:s})}filePartsOnCluster(){return[...this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[]]}fileParts(){let e=[];for(let t of this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[])for(let s of t?.DFUFileParts?.DFUPart||[]){let r={...t,...s};delete r.DFUFileParts,e.push(r)}return e}update(e){return this.connection.DFUInfo({...e,Cluster:this.Cluster,Name:this.Name}).then(t=>(this.set({Cluster:this.Cluster,...t.FileDetail}),t))}fetchInfo(){return this.connection.DFUInfo({Cluster:this.Cluster,Name:this.Name}).then(e=>(this.set({Cluster:this.Cluster,...e.FileDetail,ProtectList:e?.FileDetail?.ProtectList??{DFUFileProtect:[]}}),e.FileDetail)).catch(e=>{if(!e.Exception.some(s=>s.Code===20038?(this.set("Name",this.Name+" (Deleted)"),this.set("StateID",999),!0):!1))throw Ko.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||[])}};import{Cache as $o,StateObject as ea}from"@hpcc-js/util";var an=class extends $o{constructor(){super(e=>e.Address)}},ta=new an,Is=class n extends ea{connection;get Address(){return this.get("Address")}get ConfigAddress(){return this.get("ConfigAddress")}get Name(){return this.get("Name")}get ProcessType(){return this.get("ProcessType")}get DisplayType(){return this.get("DisplayType")}get Description(){return this.get("Description")}get AgentVersion(){return this.get("AgentVersion")}get Contact(){return this.get("Contact")}get Location(){return this.get("Location")}get UpTime(){return this.get("UpTime")}get ComponentName(){return this.get("ComponentName")}get ComponentPath(){return this.get("ComponentPath")}get RoxieState(){return this.get("RoxieState")}get RoxieStateDetails(){return this.get("RoxieStateDetails")}get OS(){return this.get("OS")}get ProcessNumber(){return this.get("ProcessNumber")}get Channels(){return this.get("Channels")}get Processors(){return this.get("Processors")}get Storage(){return this.get("Storage")}get Running(){return this.get("Running")}get PhysicalMemory(){return this.get("PhysicalMemory")}get VirtualMemory(){return this.get("VirtualMemory")}get ComponentInfo(){return this.get("ComponentInfo")}get Exception(){return this.get("Exception")}static attach(e,t,s){let r=ta.get({Address:t},()=>new n(e));return s&&r.set(s),r}constructor(e){super(),e instanceof ke?this.connection=e:this.connection=new ke(e)}};var Br=mt(Ys(),1);import{Cache as wr,StateObject as ga,scopedLogger as pa}from"@hpcc-js/util";import{Cache as ia,exists as Tr,StateObject as oa}from"@hpcc-js/util";import{Cache as sa,StateObject as na}from"@hpcc-js/util";var un=class extends sa{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}},ra=new un,at=class n extends na{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=>Is.attach(this.machineConnection,e.Address,e))}static attach(e,t,s){let r=ra.get({BaseUrl:e.baseUrl,Name:t},()=>new n(e,t));return s&&r.set(s),r}constructor(e,t){super(),e instanceof le?(this.connection=e,this.machineConnection=new ke(e.connectionOptions())):(this.connection=new le(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 sg(n){let e;return n instanceof le?e=n:e=new le(n),e.TpListTargetClusters({}).then(t=>t.TargetClusters.TpClusterNameType.map(s=>at.attach(n,s.Name,s)))}var cn={};function ng(n){if(!cn[n.baseUrl]){let e;n instanceof le?e=n:e=new le(n),cn[n.baseUrl]=e.TpListTargetClusters({}).then(t=>{let s,r,i;t.TargetClusters.TpClusterNameType.forEach(c=>{s||(s=c),!r&&c.IsDefault===!0&&(r=c),!i&&c.Type==="hthor"&&(i=c)});let o=r||i||s;return at.attach(n,o.Name,o)})}return cn[n.baseUrl]}var ln=class extends ia{constructor(){super(e=>e.BaseUrl)}},aa=new ln,Ps=class n extends oa{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=>at.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,t){let s=aa.get({BaseUrl:e.baseUrl},()=>new n(e));return t&&s.set(t),s}constructor(e){super(),e instanceof le?this.connection=e:this.connection=new le(e)}GetESPServiceBaseURL(e=""){return this.connection.TpServiceQuery({}).then(t=>{let s=this.connection.protocol(),r=this.connection.ip(),i=s==="https:"?"18002":"8002";if(Tr("ServiceList.TpEspServers.TpEspServer",t)){for(let o of t.ServiceList.TpEspServers.TpEspServer)if(Tr("TpBindings.TpBinding",o))for(let c of o.TpBindings.TpBinding)c.Service===e&&c.Protocol+":"===s&&(i=c.Port)}return`${s}//${r}:${i}/`})}fetchTargetClusters(){return this.connection.TpTargetClusterQuery({Type:"ROOT"}).then(e=>(this.set({TargetClusters:e.TpTargetClusters?.TpTargetCluster??[]}),this.CTargetClusters))}fetchLogicalClusters(e={}){return this.connection.TpLogicalClusterQuery(e).then(t=>(this.set({LogicalClusters:t.TpLogicalClusters.TpLogicalCluster}),this.LogicalClusters))}fetchServices(e={}){return this.connection.TpServiceQuery(e).then(t=>(this.set({Services:t.ServiceList}),this.Services))}_prevRefresh;refresh(e=!1){return(!this._prevRefresh||e)&&(this._prevRefresh=Promise.all([this.fetchTargetClusters(),this.fetchLogicalClusters(),this.fetchServices()]).then(()=>this)),this._prevRefresh}on(e,t,s){return this.isCallback(t)?e==="changed"&&super.on(e,t):e==="changed"&&super.on(e,t,s),this._monitor(),this}};function ve(n,e,t){e==="__proto__"||e==="constructor"||e==="prototype"||(n[e]=t)}function yt(n){return n=""+n,n.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"&#10;").replace(/\r/g,"&#13;")}function ca(n){if(n){if(!isNaN(+n))return parseFloat(n)}else return 0;let t=/(?:(?:(\d+).days.)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+\.\d+|\d+)s))|(?:(\d+\.\d+|\d+)ms|(\d+\.\d+|\d+)us|(\d+\.\d+|\d+)ns)/.exec(n);if(!t)return 0;let s=+t[1]||0,r=+t[2]||0,i=+t[3]||0,o=+t[4]||0,c=+t[5]||0,g=+t[6]||0,W=+t[7]||0;return s*24*60*60+r*60*60+i*60+o+c/1e3+g/1e6+W/1e9}function Ve(n,e){let t=n.indexOf(e);return t!==-1?parseFloat(n.substring(0,t)):-1}function ua(n){if(n){if(!isNaN(+n))return parseFloat(n)}else return 0;let e=Ve(n,"Kb");return e>=0?e*1024:(e=Ve(n,"Mb"),e>=0?e*Math.pow(1024,2):(e=Ve(n,"Gb"),e>=0?e*Math.pow(1024,3):(e=Ve(n,"Tb"),e>=0?e*Math.pow(1024,4):(e=Ve(n,"Pb"),e>=0?e*Math.pow(1024,5):(e=Ve(n,"Eb"),e>=0?e*Math.pow(1024,6):(e=Ve(n,"Zb"),e>=0?e*Math.pow(1024,7):(e=Ve(n,"b"),e>=0?e:0)))))))}function la(n){return n?parseFloat(n):0}var gn=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+'="'+yt(i[o])+'"':r+='<att name="'+o+'" value="'+yt(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+'="'+yt(r[i])+'"':s+='<att name="'+i+'" value="'+yt(r[i])+'"/>';return"<edge"+t+">"+s+"</edge>"}getAncestors(e,t){let s=e.__hpcc_parent;for(;s;)t.push(s),s=s.__hpcc_parent}getCommonAncestorV(e,t){let s=[],r=[];this.getAncestors(e,s),this.getAncestors(t,r);let i=s.length-1,o=r.length-1,c=null;for(;i>=0&&o>=0&&s[i]===r[o];)c=s[i],--i,--o;return c}getCommonAncestor(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())}calcAncestorVisibility(e){let t=[];this.getAncestors(e,t),t.forEach((s,r)=>{this.m_visibleSubgraphs[s.__hpcc_id]=s})}calcVisibility2(){for(let e in this.m_visibleVertices){let t=this.m_visibleVertices[e];t.getInEdges().forEach((s,r)=>{this.m_visibleEdges[s.__hpcc_id]=s}),t.getOutEdges().forEach((s,r)=>{this.m_visibleEdges[s.__hpcc_id]=s}),this.calcAncestorVisibility(t)}this.calcSemiVisibleVertices()}addSemiVisibleEdge(e){e&&!this.m_visibleEdges[e.__hpcc_id]&&(this.m_visibleEdges[e.__hpcc_id]=e)}addSemiVisibleVertex(e){this.m_visibleVertices[e.__hpcc_id]||(this.m_semiVisibleVertices[e.__hpcc_id]=e,this.calcAncestorVisibility(e))}calcSemiVisibleVertices(){for(let e in this.m_visibleEdges){let t=this.m_visibleEdges[e],s=t.getSource();for(this.addSemiVisibleVertex(s);this.noSpills&&s.isSpill();){let i=s.getInEdges();if(i.length)this.addSemiVisibleEdge(i[0]),s=i[0].getSource(),this.addSemiVisibleVertex(s);else break}let r=t.getTarget();for(this.addSemiVisibleVertex(r);this.noSpills&&r.isSpill();){let i=r.getOutEdges();if(i.length)this.addSemiVisibleEdge(i[0]),r=i[0].getTarget(),this.addSemiVisibleVertex(r);else break}}}writeXgmml(){this.subgraphVisited(this.graph.subgraphs[0],!0),this.graph.edges.forEach((e,t)=>{this.edgeVisited(e)})}subgraphVisited(e,t=!1){if(this.m_visibleSubgraphs[e.__hpcc_id]){let s="";this.m_xgmml+=t?"":'<node id="'+e.__hpcc_id+'"><att><graph>';let r=this.m_xgmml.length;if(e.walkSubgraphs(this),e.walkVertices(this),r===this.m_xgmml.length){let o=e.__hpcc_vertices[0];o&&(this.m_xgmml+=this.buildVertexString(o,!0))}let i=e.getProperties();for(let o in i)s+='<att name="'+o+'" value="'+yt(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))}},xt=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}},He=class extends xt{_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)})}},$e=class extends xt{_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)}},et=class extends xt{_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]}},Ms=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 He}isVertex(e){return e instanceof $e}isEdge(e){return e instanceof et}getGlobalType(e){return e instanceof $e?3:e instanceof et?4:e instanceof He?2:e instanceof n?1:0}getGlobalTypeString(e){return e instanceof $e?"Vertex":e instanceof et?"Edge":e instanceof He?"Cluster":e instanceof n?"Graph":"Unknown"}getItem(e,t){if(!this.idx[t])switch(e.tagName){case"graph":let r=new He(this,t);this.subgraphs.push(r),this.idx[t]=r;break;case"node":let i=new $e(this,t);this.vertices.push(i),this.idx[t]=i;break;case"edge":let o=new et(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=>{ve(s,r.name,r.value)}),s}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof He?this.subgraphs=this.subgraphs.filter(t=>e!==t):e instanceof $e?this.vertices=this.vertices.filter(t=>e!==t):e instanceof et&&(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 y=this.getChildByTagName(o,"graph");if(y){i=!0;let R=this.walkDocument(y,r.getAttribute("id"));s.addSubgraph(R)}}if(!i){let y=this.walkDocument(r,r.getAttribute("id"));s.addVertex(y)}break;case"att":let c=r.getAttribute("name"),g="_"+c,W=r.getAttribute("value");c.indexOf("Time")===0?(ve(s,g,W),ve(s,c,""+ca(W))):c.indexOf("Size")===0?(ve(s,g,W),ve(s,c,""+ua(W))):c.indexOf("Skew")===0?(ve(s,g,W),ve(s,c,""+la(W))):ve(s,c,W);break;case"edge":let l=this.walkDocument(r,r.getAttribute("id"));if(l.NumRowsProcessed!==void 0?l._eclwatchCount=l.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):l.Count!==void 0?l._eclwatchCount=l.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):l.count!==void 0&&(l._eclwatchCount=l.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),l.inputProgress&&(l._eclwatchInputProgress="["+l.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),l.SkewMaxRowsProcessed&&l.SkewMinRowsProcessed&&(l._eclwatchSkew="+"+l.SkewMaxRowsProcessed+", "+l.SkewMinRowsProcessed),!l._dependsOn){if(!l._childGraph){if(l._sourceActivity||l._targetActivity){l._isSpill=!0;let y=l.getSource();y&&(y._isSpill=!0);let R=l.getTarget();R&&(R._isSpill=!0)}}}s.addEdge(l);break;default:break}break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:break;default:break}}),s}removeSubgraphs(){[...this.subgraphs].forEach(t=>{t.__hpcc_parent instanceof He&&t.remove()})}removeSpillVertices(){[...this.vertices].forEach(t=>{t.isSpill()&&t.remove()})}getLocalisedXGMML(e,t,s,r){let i=new gn(this);return i.calcVisibility(e,t,s,r),i.writeXgmml(),"<graph>"+i.m_xgmml+"</graph>"}};var Ts=pa("@hpcc-js/comms/ecl/query.ts"),da=(0,Br.format)("~s");function ma(n){return!isNaN(parseFloat(n))&&!isNaN(n-0)}var pn=class extends wr{constructor(){super(e=>wr.hash([e.QueryId,e.QuerySet]))}},ha=new pn,Nr=class n extends ga{wsWorkunitsService;get BaseUrl(){return this.wsWorkunitsService.baseUrl}topology;_requestSchema;_responseSchema;get properties(){return this.get()}get Exceptions(){return this.get("Exceptions")}get QueryId(){return this.get("QueryId")}get QuerySet(){return this.get("QuerySet")}get QueryName(){return this.get("QueryName")}get Wuid(){return this.get("Wuid")}get Dll(){return this.get("Dll")}get Suspended(){return this.get("Suspended")}get Activated(){return this.get("Activated")}get SuspendedBy(){return this.get("SuspendedBy")}get Clusters(){return this.get("Clusters")}get PublishedBy(){return this.get("PublishedBy")}get Comment(){return this.get("Comment")}get LogicalFiles(){return this.get("LogicalFiles")}get SuperFiles(){return this.get("SuperFiles")}get IsLibrary(){return this.get("IsLibrary")}get Priority(){return this.get("Priority")}get WUSnapShot(){return this.get("WUSnapShot")}get CompileTime(){return this.get("CompileTime")}get LibrariesUsed(){return this.get("LibrariesUsed")}get CountGraphs(){return this.get("CountGraphs")}get ResourceURLCount(){return this.get("ResourceURLCount")}get WsEclAddresses(){return this.get("WsEclAddresses")}get WUGraphs(){return this.get("WUGraphs")}get WUTimers(){return this.get("WUTimers")}get PriorityID(){return this.get("PriorityID")}constructor(e,t,s,r){super(),e instanceof ie?this.wsWorkunitsService=e:this.wsWorkunitsService=new ie(e),this.topology=Ps.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:t,QueryId:s,...r})}static attach(e,t,s,r){let i=ha.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 Xt({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){Ts.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){Ts.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 Ms,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=ot.attach(this.wsWorkunitsService,this.Wuid);return t?Promise.all([this.fetchGraph(),t.fetchDetailsMeta(),t.fetchDetailsRaw(e)]).then(s=>{let r=s[0],i=s[1],c=s[2].map(g=>{let W=g.Id[0];if(W==="a"||W==="e"){let l=r.idx[g.Id.substring(1)];if(!l)return Ts.debug(`Missing graph data for metric ID: ${g.Id}`),g;let y=new Set(g.Properties.Property.map(M=>M.Name)),R=[];for(let M in l){let Q=M.charAt(0);if(Q!=="_"&&Q===Q.toUpperCase()&&!y.has(M)){let V=l[M],N=typeof V;if(N==="string"||N==="number"||N==="boolean"){let G=ma(V)?parseFloat(V):V,P=V;M.indexOf("Time")>=0&&(G=G/1e9,P=da(G)+"s"),R.push({Name:M,RawValue:G,Formatted:P})}}}R.length>0&&g.Properties.Property.push(...R)}return g});return t.normalizeDetails(i,c)}):Promise.resolve({meta:void 0,columns:void 0,data:void 0})}async submit(e){let t=await this.wsEclService();try{return t?.submit(this.QuerySet,this.QueryId,e).then(s=>{for(let r in s)s[r]=s[r].Row;return s})??[]}catch(s){return Ts.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]:[]}};import{Cache as fa,Dispatch as Da,Message as Sa}from"@hpcc-js/util";var dn=class extends fa{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}},Ca=new dn,tt=class extends Sa{constructor(t,s,r){super();this.key=t;this.value=s;this.oldValue=r}key;value;oldValue;get canConflate(){return!0}conflate(t){return this.key===t.key?(this.value=t.value,!0):!1}void(){return this.value===this.oldValue}},Qr=class n{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new Da;static attach(e,t="HPCCApps",s,r=!0){return Ca.get({BaseUrl:e.baseUrl,Name:t,UserSpecific:r,Namespace:s},()=>new n(e,t,s,r))}constructor(e,t,s,r){e instanceof Ct?this.connection=e:this.connection=new Ct(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)}};import{Cache as Ra,scopedLogger as Aa,StateObject as ya}from"@hpcc-js/util";var xa=Aa("@hpcc-js/comms/dfuWorkunit.ts");var mn=class extends Ra{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}},Lr=new mn,Gr=class n extends ya{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=>(Lr.set(s),s.set(r.result),s))}static attach(e,t,s){let r=Lr.get({BaseUrl:e.baseUrl,ID:t},()=>new n(e,t));return s&&r.set(s),r}static sprayFixed(e,t){let s=new Je(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 Je(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 Je(e);return s.DesprayEx({...t}).then(r=>{let i=r.wuid;return s.GetDFUWorkunit({wuid:i}).then(o=>n.attach(e,i,o.result))})}update(e){return this.connection.UpdateDFUWorkunitEx({wu:{JobName:e?.wu?.JobName??this.JobName,isProtected:e?.wu?.isProtected??this.isProtected,ID:this.ID,State:this.State},ClusterOrig:this.ClusterName,JobNameOrig:this.JobName,isProtectedOrig:this.isProtected,StateOrig:this.State})}isComplete(){switch(this.State){case 6:case 5:case 4:case 999:return!0;default:}return!1}isFailed(){return!!(this.isComplete()&&this.State!==6)}isDeleted(){return this.State===999}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(ft.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===ft.DFUWUActions.Delete?t:this.refresh().then(()=>(this._monitor(),t)))}on(e,t,s){if(this.isCallback(t))switch(e){case"finished":super.on("propChanged","State",r=>{this.isComplete()&&t([r])});break;case"changed":super.on(e,t);break;default:}else e==="changed"&&super.on(e,t,s);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,s)=>{let r=this.watch(i=>{e&&e(i),this.isComplete()&&(r.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,s)=>{let r=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(r.release(),t(this))})})}constructor(e,t){super(),this.connection=new Je(e),this.topologyConnection=new le(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 xa.warning(`Unexpected ESP exception: ${t.message}`),t;return{}})}};import*as zr from"node:child_process";import*as Jr from"node:crypto";import*as ge from"node:fs";import*as Te from"node:os";import*as he from"node:path";import{exists as wa,scopedLogger as Na,xml2json as Ba}from"@hpcc-js/util";import*as st from"node:fs";import*as $ from"node:path";import{Dictionary as vr,DictionaryNoCase as kr,find as Wa,SAXStackParser as ba,scopedLogger as Ua,XMLNode as Ea}from"@hpcc-js/util";var Fa=Ua("clienttools/eclmeta"),Ia=!1;function ct(n,e,t){if(Ia){for(let s in n){let r=`${e}.${s}`;s!=="$"&&t[s]===void 0&&t[s.toLowerCase()+"s"]===void 0&&Fa.debug(r)}n.$&&ct(n.$,e+".$",t)}}var fn=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}},ut=class{get scope(){return this}name;type;sourcePath;line;start;body;end;definitions;constructor(e,t,s,r,i=1,o=0,c=0,g=Number.MAX_VALUE){this.name=e,this.type=t,this.sourcePath=$.normalize(s),this.line=+i-1,this.start=+o,this.body=+c,this.end=+g,this.definitions=this.parseDefinitions(r)}parseDefinitions(e=[]){return e.map(t=>{let s=new Sn(this.sourcePath,t);return ct(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=Wa(e,o=>typeof o.name=="string"&&typeof r=="string"&&o.name.toLowerCase()===r.toLowerCase());return i&&i.definitions.length&&s.length?this._resolve(i.definitions,s.join(".")):i}resolve(e){return this._resolve(this.definitions,e)}suggestions(){return this.definitions.map(e=>({name:e.name,type:this.type}))}},Sn=class extends ut{__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 fn(t);return ct(t,"attr",s),s})}parseFields(e=[]){return e.map(t=>{let s=new Dn(this,t);return ct(t,"field",s),s})}suggestions(){return super.suggestions().concat(this.fields.map(e=>({name:e.name,type:e.type})))}},ws=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}},Cn=class extends ut{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 Ea("");s.appendAttribute("name","$"),s.appendAttribute("ref",t.join(".")),this.imports=[new ws(s),...this.parseImports(e.children("Import"))]}parseImports(e=[]){return e.map(t=>{let s=new ws(t);return ct(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}},Pa=n=>$.basename(n).indexOf(".")===0,Vr=n=>st.lstatSync(n).isDirectory()&&!Pa(n),Ma=n=>[".ecl",".ecllib"].indexOf($.extname(n).toLowerCase())>=0,Hr=n=>st.readdirSync(n).map(e=>$.join(n,e)).filter(e=>Vr(e)||Ma(e)),Rn=class extends ut{constructor(e,t){super(e,"file",t,[])}suggestions(){return[]}},An=class extends ut{constructor(e,t){super(e,"folder",t,[])}suggestions(){return Hr(this.sourcePath).map(e=>({name:$.basename(e,".ecl"),type:"folder"}))}},yn=class{_workspacePath;_eclccPath;_clientTools;_sourceByID=new kr;_sourceByPath=new vr;_test=new kr;constructor(e,t){this._workspacePath=e,this._eclccPath=t}refresh(){this.primeWorkspace(),this.primeClientTools()}primeClientTools(){return jr(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]&&st.existsSync(e[t])&&this.walkChildFolders(e[t],e[t]);return this})}primeWorkspace(){st.existsSync(this._workspacePath)&&this.visitFolder(this._workspacePath,this._workspacePath)}walkChildFolders(e,t,s=!1){for(let r of Hr(e))Vr(r)?this.visitFolder(r,t,s):this.visitFile(r,t,s)}visitFile(e,t,s=!1){let r=$.parse(e),i=$.join(r.dir,r.name),o=$.relative(t,i).split($.sep).join(".");(s||!this._test.has(o))&&this._test.set(o,new Rn("",e))}visitFolder(e,t,s=!1){let r=$.relative(t,e).split($.sep).join(".");(s||!this._test.has(r))&&(this._test.set(r,new An(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 Cn(t);if(ct(t,"source",s),this._sourceByID.set(s.name,s),this._sourceByPath.set(s.sourcePath,s),s.name){let i=s.name.split(".").length;if(i>1){let o=s.sourcePath;for(;i>1;)o=$.dirname(o),--i;this.visitFolder(o,$.dirname(o))}}this.walkSource(s)}}parseMetaXML(e){let t=new xn;return t.parse(e),this.parseSources(t.sources),t.sources.map(s=>$.normalize(s.$.sourcePath))}resolveQualifiedID(e,t,s){let r;if(!r&&this._test.has(t)&&(r=this._test.get(t).scope),!r&&this._sourceByPath.has(e)){let i=this._sourceByPath.get(e),o=t.split(".");for(let g of i.imports)if(g.name.toLowerCase()===o[0].toLowerCase()){g.ref?o[0]=g.ref:o.shift();break}let c=o.join(".");!r&&this._test.has(c)&&(r=this._test.get(c).scope),r||(c=[...i.name.split("."),...o].join("."),this._test.has(c)&&(r=this._test.get(c).scope))}return r}resolvePartialID(e,t,s){t=t.toLowerCase();let r=t.split(".");r.pop();let i=r.length===1?r[0]:r.join(".");return this.resolveQualifiedID(e,i,s)}},hn=new vr;function nt(n,e){let t=$.normalize(n);if(!hn.has(t)){let s=new yn(t,e);hn.set(t,s),s.refresh()}return hn.get(t)}function Ta(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 Ep(n,e,t){for(;Ta(n,e,t);)e+=t?-1:1;return e+(t?1:-1)}var xn=class extends ba{sources=[];endXMLNode(e){e.name==="Source"&&this.sources.push(e),super.endXMLNode(e)}};var lt=Na("clienttools/eclcc"),Wn=Te.type()==="Windows_NT"?".exe":"";function Or(n){return n.split(`\r
916
916
  `).join(`
917
917
  `).split("\r").join(`
918
- `)}var Ut=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}`}},_r="error",Yr="warning",Bs=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===_r)}hasError(){return this.errors().length>0}warnings(){return this.errWarn.filter(e=>e.severity===Yr)}hasWarning(){return this.warnings().length>0}info(){return this.errWarn.filter(e=>[_r,Yr].indexOf(e.severity)<0)}hasOther(){return this.info().length>0}unknown(){return this.errOther}hasUnknown(){return this.unknown().length>0}},Qs=class extends Bs{constructor(e,t){if(super(t),e&&e.length)for(let s of e.split(Te.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,p,A,l]=r,x=+o,S=+u,M=A+": "+l;this.errWarn.push({filePath:i,line:x,col:S,msg:M,severity:p});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&&(lt.warning(`parseECLErrors: Unable to parse "${s}"`),this.errOther.push(s))}this._checked=t}},Un=class extends Bs{_lines;constructor(e,t,s){super(s);let r=pe.readFileSync(e,"utf8");if(r=r.replace(/\r\n/g,`
918
+ `)}var bt=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}`}},_r="error",Yr="warning",Bs=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===_r)}hasError(){return this.errors().length>0}warnings(){return this.errWarn.filter(e=>e.severity===Yr)}hasWarning(){return this.warnings().length>0}info(){return this.errWarn.filter(e=>[_r,Yr].indexOf(e.severity)<0)}hasOther(){return this.info().length>0}unknown(){return this.errOther}hasUnknown(){return this.unknown().length>0}},Qs=class extends Bs{constructor(e,t){if(super(t),e&&e.length)for(let s of e.split(Te.EOL)){let r=/([a-zA-Z]:\\(?:[- \w\.\d]+\\)*(?:[- \w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\) ?: ?(error|warning|info) C(\d*) ?: ?(.*)/.exec(s);if(r){let[,i,o,c,g,W,l]=r,y=+o,R=+c,M=W+": "+l;this.errWarn.push({filePath:i,line:y,col:R,msg:M,severity:g});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&&(lt.warning(`parseECLErrors: Unable to parse "${s}"`),this.errOther.push(s))}this._checked=t}},bn=class extends Bs{_lines;constructor(e,t,s){super(s);let r=ge.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(Te.EOL)){let o=/(Warning|Error) : Path\=(\S*?)(\[\S*\])? Message\=(.*)/.exec(i);if(o){let[,u,p,A,l]=o,x=`${p} ${A||""}: ${l}`,[S,M]=this.locate(p);this.errWarn.push({filePath:e,line:S,col:M,msg:x,severity:u});continue}o||(lt.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 En(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=>{En(i,e,t)}):typeof r=="object"&&En(r,e,t)}t.pop()}var Fn=class{jsonWU;constructor(e){this.jsonWU=e}bpGetValidLocations(e){let t=[];if(wa("W_LOCAL.Graphs",this.jsonWU)){let s="";En(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[,p,A,l]=u,x=+A,S=+l;e===p&&t.push({file:p,line:x,col:S,id:s})}}})}return t}},Et=class n{eclccPath;envchkPath;eclBundlePath;binPath;cwd;includeFolders;_legacyMode;_args;_version;constructor(e,t,s=[],r=!1,i=[],o){this.eclccPath=e,this.binPath=fe.dirname(this.eclccPath),this.envchkPath=fe.join(this.binPath,"envchk"+An),this.eclBundlePath=fe.join(this.binPath,"ecl-bundle"+An),this.cwd=fe.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 pe.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"+fe.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 Ut(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=pe.readFileSync(e,"ascii"),o=Ba(i);t&&pe.unlink(e,u=>{}),s(o)})}createWU(e){let t=fe.join(Te.tmpdir(),`eclcc-wu-tmp-${Jr.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=fe.normalize(t+".xml");return(this.exists(i)?this.loadXMLDoc(i,!0):Promise.resolve({})).then(u=>new Fn(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 Qs(s.stderr,[])}))}attachWorkspace(){return nt(this.cwd)}fetchMeta(e){return Promise.all([nt(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){lt.error(`fetchMeta: Error parsing XML - ${r?.message??"unknown"}`)}return t})}syntaxCheck(e,t=["-syntax"]){return Promise.all([nt(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){lt.error(`syntaxCheck: Error parsing XML - ${o?.message??"unknown"}`)}return new Qs(r?r.stderr:"",i)})}envCheck(e,t=[]){return Promise.all([nt(this.cwd),this.execFile(this.envchkPath,this.cwd,this.args([...t,e]),"envchk",`Cannot find ${this.envchkPath}`)]).then(([s,r])=>new Un(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=>Or(t.stdout).split(`
920
+ `),t&&t.length)for(let i of t.split(Te.EOL)){let o=/(Warning|Error) : Path\=(\S*?)(\[\S*\])? Message\=(.*)/.exec(i);if(o){let[,c,g,W,l]=o,y=`${g} ${W||""}: ${l}`,[R,M]=this.locate(g);this.errWarn.push({filePath:e,line:R,col:M,msg:y,severity:c});continue}o||(lt.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(wa("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 c=/([a-z,A-Z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(i.value);if(c){let[,g,W,l]=c,y=+W,R=+l;e===g&&t.push({file:g,line:y,col:R,id:s})}}})}return t}},Ut=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"+Wn),this.eclBundlePath=he.join(this.binPath,"ecl-bundle"+Wn),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 ge.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 bt(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=ge.readFileSync(e,"ascii"),o=Ba(i);t&&ge.unlink(e,c=>{}),s(o)})}createWU(e){let t=he.join(Te.tmpdir(),`eclcc-wu-tmp-${Jr.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(c=>new En(c))})}createArchive(e){let t=["-E"].concat([e]);return this.execFile(this.eclccPath,this.cwd,this.args(t),"eclcc",`Cannot find ${this.eclccPath}`).then(s=>({content:s.stdout,err:new Qs(s.stderr,[])}))}attachWorkspace(){return nt(this.cwd)}fetchMeta(e){return Promise.all([nt(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){lt.error(`fetchMeta: Error parsing XML - ${r?.message??"unknown"}`)}return t})}syntaxCheck(e,t=["-syntax"]){return Promise.all([nt(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){lt.error(`syntaxCheck: Error parsing XML - ${o?.message??"unknown"}`)}return new Qs(r?r.stderr:"",i)})}envCheck(e,t=[]){return Promise.all([nt(this.cwd),this.execFile(this.envchkPath,this.cwd,this.args([...t,e]),"envchk",`Cannot find ${this.envchkPath}`)]).then(([s,r])=>new bn(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=>Or(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=>Or(i.stdout).split(`
922
- `)).then(i=>{let o={};i.forEach(u=>{let p=u.split(":");o[p.shift().trim()]=p.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([nt(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([nt(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)=>{lt.debug(`${e} ${s.join(" ")}`);let p=zr.spawn(e,s,{cwd:t}),A="",l="";p.stdout.on("data",x=>{A+=x.toString()}),p.stderr.on("data",x=>{l+=x.toString()}),p.on("close",(x,S)=>{o({code:x,stdout:A.trim(),stderr:l.trim()})})})}};function Ns(n,e){if(n){let t=fe.join(n,"HPCCSystems");if(pe.existsSync(t)&&pe.statSync(t).isDirectory()){if(Te.type()!=="Windows_NT"){let s=fe.join(t,"bin","eclcc");pe.existsSync(s)&&e.push(new Et(s))}pe.readdirSync(t).forEach(s=>{let r=fe.join(t,s,"clienttools","bin","eclcc"+An);if(pe.existsSync(r)){let i=fe.basename(s);new Ut(i).exists()&&e.push(new Et(r))}})}}}var At;function wg(){At=void 0}function Qa(){if(At)return At;let n=[];switch(Te.type()){case"Windows_NT":let e=process.env["ProgramFiles(x86)"]||"";e&&Ns(e,n);let t=process.env.ProgramFiles||"";t&&Ns(t,n),!e&&!t&&Ns("c:\\Program Files (x86)",n);break;case"Linux":case"Darwin":Ns("/opt",n);break;default:break}return At=Promise.all(n.map(e=>e.version())).then(()=>(n.sort((e,t)=>t.versionSync().compare(e.versionSync())),n)),At}var Xr="";function qr(n){let e=`Using eclccPath setting: ${n}`;Xr!==e&&(lt.info(e),Xr=e)}function jr(n="",e="",t=".",s=[],r=!1,i=[]){return n&&pe.existsSync(n)?(qr(n),Promise.resolve(new Et(n,t,s,r,i))):Qa().then(o=>{if(!o.length)throw new Error("Unable to locate ECL Client Tools.");let u=new Ut(e),p,A;for(let x of o){let S=x.versionSync();if(S.exists()&&(p||(p=x),!A&&u.major===S.major&&(A=x),u.major===S.major&&u.minor===S.minor))return x.clone(t,s,r,i)}let l=A||p;return qr(l.eclccPath),l.clone(t,s,r,i)})}Ft.DOMParser=La;if(Ft.fetch===void 0)throw new Error("@hpcc-js/comms requires Node.js >= 18.0.0 for native fetch support");Ft.__hpcc_undiciFetch=Ga;Ft.__hpcc_rejectUnauthorizedAgent=new ka({connect:{rejectUnauthorized:!1}});var pt="";ye.globalAgent.options.ca!==void 0&&(Array.isArray(ye.globalAgent.options.ca)&&ye.globalAgent.options.ca.length?typeof ye.globalAgent.options.ca[0]=="string"?pt=ye.globalAgent.options.ca.join(`
923
- `):ye.globalAgent.options.ca[0]instanceof Kr&&(pt=ye.globalAgent.options.ca.map(n=>n.toString()).join(`
924
- `)):typeof ye.globalAgent.options.ca=="string"?pt=ye.globalAgent.options.ca:ye.globalAgent.options.ca instanceof Kr&&(pt=ye.globalAgent.options.ca.toString()),pt+=`
925
- `);Ft.__hpcc_trustwaveAgent=new ye.Agent({ca:pt+Qn});export{vn as AccessService,Vn as AccountService,Ir as Activity,hn as Attr,Ze as Attribute,Oa as BUILD_VERSION,en as BaseScope,Et as ClientTools,Hn as CloudService,jn as CodesignService,vs as Connection,Qu as DFUArrayActions,Gu as DFUChangeProtection,ku as DFUChangeRestriction,Lu as DFUDefFileFormat,Dt as DFUService,$i as DFUWUTypes,Gr as DFUWorkunit,mn as DFUWorkunitCache,_n as DFUXRefService,On as DaliService,Cn as Definition,cs as ECLGraph,ct as ECLScope,Vs as ESPConnection,ze as ESPExceptions,Xt as EclService,Qs as EclccErrors,Xn as ElkService,Un as EnvchkErrors,Bs as Errors,Dn as Field,Sn as File,ht as FileSpray,Je as FileSprayService,Zi as FileSprayStates,yn as Folder,$s as GlobalResultCache,ls as GraphCache,ws as Import,Fn as LocalWorkunit,ao as LogType,zn as LogaccessService,Mr as LogicalFile,on as LogicalFileCache,Ps as Machine,an as MachineCache,ke as MachineService,Ha as PKG_NAME,ja as PKG_VERSION,$n as PackageProcessService,Lo as PropertyType,Nr as Query,Ms as QueryGraph,Go as RelatedProperty,ds as Resource,er as ResourcesService,Ss as Result,ys as ResultCache,Ct as SMCService,sr as SashaService,yt as Scope,Cr as ScopeEdge,ps as ScopeGraph,hr as ScopeSubgraph,Dr as ScopeVertex,v as Service,Rn as Source,xs as SourceFile,Qr as Store,dn as StoreCache,Rt as StoreService,uo as TargetAudience,at as TargetCluster,cn as TargetClusterCache,Ws as Timer,Is as Topology,ln as TopologyCache,le as TopologyService,tt as ValueChangedMessage,Ut as Version,_s as WUStateID,Ke as WUUpdate,xn as Workspace,ot as Workunit,nn as WorkunitCache,ie as WorkunitsService,as as WorkunitsServiceEx,kn as WsAccess,Hs as WsCodesign,it as WsDfu,te as WsLogaccess,or as WsSMC,tr as WsSasha,ur as WsTopology,me as WsWorkunits,fr as XGMMLEdge,qs as XGMMLGraph,dr as XGMMLSubgraph,mr as XGMMLVertex,ms as XSDNode,Ds as XSDSchema,hs as XSDSimpleType,fs as XSDXMLNode,nt as attachWorkspace,wg as clearAllClientToolsCache,Lt as createConnection,gs as createGraph,Ar as createXGMMLGraph,np as defaultTargetCluster,Oi as deserializeResponse,qi as get,za as hookSend,qa as instanceOfIConnection,Xa as instanceOfIOptions,Ji as isArray,lr as isECLResult,nu as isExceptions,Vc as isWUInfoWorkunit,vc as isWUQueryECLWorkunit,_i as jsonp,Qa as locateAllClientTools,jr as locateClientTools,Js as parseXSD,Kc as parseXSD2,Xi as post,Fg as qualifiedIDBoundary,zi as send,qe as serializeRequest,Ja as setTransportFactory,Vo as splitMetric,sp as targetClusters,En as walkXmlJson};
922
+ `)).then(i=>{let o={};i.forEach(c=>{let g=c.split(":");o[g.shift().trim()]=g.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([nt(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([nt(this.cwd),this.execFile(this.eclBundlePath,this.cwd,this.args(["uninstall",e]),"ecl-bundle",`Cannot find ${this.eclBundlePath}`)]).then(([t,s])=>s)}execFile(e,t,s,r,i){return new Promise((o,c)=>{lt.debug(`${e} ${s.join(" ")}`);let g=zr.spawn(e,s,{cwd:t}),W="",l="";g.stdout.on("data",y=>{W+=y.toString()}),g.stderr.on("data",y=>{l+=y.toString()}),g.on("close",(y,R)=>{o({code:y,stdout:W.trim(),stderr:l.trim()})})})}};function Ns(n,e){if(n){let t=he.join(n,"HPCCSystems");if(ge.existsSync(t)&&ge.statSync(t).isDirectory()){if(Te.type()!=="Windows_NT"){let s=he.join(t,"bin","eclcc");ge.existsSync(s)&&e.push(new Ut(s))}ge.readdirSync(t).forEach(s=>{let r=he.join(t,s,"clienttools","bin","eclcc"+Wn);if(ge.existsSync(r)){let i=he.basename(s);new bt(i).exists()&&e.push(new Ut(r))}})}}}var Wt;function wp(){Wt=void 0}function Qa(){if(Wt)return Wt;let n=[];switch(Te.type()){case"Windows_NT":let e=process.env["ProgramFiles(x86)"]||"";e&&Ns(e,n);let t=process.env.ProgramFiles||"";t&&Ns(t,n),!e&&!t&&Ns("c:\\Program Files (x86)",n);break;case"Linux":case"Darwin":Ns("/opt",n);break;default:break}return Wt=Promise.all(n.map(e=>e.version())).then(()=>(n.sort((e,t)=>t.versionSync().compare(e.versionSync())),n)),Wt}var Xr="";function qr(n){let e=`Using eclccPath setting: ${n}`;Xr!==e&&(lt.info(e),Xr=e)}function jr(n="",e="",t=".",s=[],r=!1,i=[]){return n&&ge.existsSync(n)?(qr(n),Promise.resolve(new Ut(n,t,s,r,i))):Qa().then(o=>{if(!o.length)throw new Error("Unable to locate ECL Client Tools.");let c=new bt(e),g,W;for(let y of o){let R=y.versionSync();if(R.exists()&&(g||(g=y),!W&&c.major===R.major&&(W=y),c.major===R.major&&c.minor===R.minor))return y.clone(t,s,r,i)}let l=W||g;return qr(l.eclccPath),l.clone(t,s,r,i)})}Et.DOMParser=La;if(Et.fetch===void 0)throw new Error("@hpcc-js/comms requires Node.js >= 18.0.0 for native fetch support");Et.__hpcc_undiciFetch=Ga;Et.__hpcc_rejectUnauthorizedAgent=new ka({connect:{rejectUnauthorized:!1}});var gt="";Ae.globalAgent.options.ca!==void 0&&(Array.isArray(Ae.globalAgent.options.ca)&&Ae.globalAgent.options.ca.length?typeof Ae.globalAgent.options.ca[0]=="string"?gt=Ae.globalAgent.options.ca.join(`
923
+ `):Ae.globalAgent.options.ca[0]instanceof Kr&&(gt=Ae.globalAgent.options.ca.map(n=>n.toString()).join(`
924
+ `)):typeof Ae.globalAgent.options.ca=="string"?gt=Ae.globalAgent.options.ca:Ae.globalAgent.options.ca instanceof Kr&&(gt=Ae.globalAgent.options.ca.toString()),gt+=`
925
+ `);Et.__hpcc_trustwaveAgent=new Ae.Agent({ca:gt+Qn});export{vn as AccessService,Vn as AccountService,Pr as Activity,fn as Attr,Ze as Attribute,Oa as BUILD_VERSION,en as BaseScope,Ut as ClientTools,Hn as CloudService,jn as CodesignService,vs as Connection,Qc as DFUArrayActions,Gc as DFUChangeProtection,kc as DFUChangeRestriction,Lc as DFUDefFileFormat,Dt as DFUService,$i as DFUWUTypes,Gr as DFUWorkunit,mn as DFUWorkunitCache,_n as DFUXRefService,On as DaliService,Sn as Definition,us as ECLGraph,ut as ECLScope,Vs as ESPConnection,ze as ESPExceptions,Xt as EclService,Qs as EclccErrors,Xn as ElkService,bn as EnvchkErrors,Bs as Errors,Dn as Field,Rn as File,ft as FileSpray,Je as FileSprayService,Zi as FileSprayStates,An as Folder,$s as GlobalResultCache,ls as GraphCache,ws as Import,En as LocalWorkunit,ao as LogType,zn as LogaccessService,Mr as LogicalFile,on as LogicalFileCache,Is as Machine,an as MachineCache,ke as MachineService,Ha as PKG_NAME,ja as PKG_VERSION,$n as PackageProcessService,Lo as PropertyType,Nr as Query,Ms as QueryGraph,Go as RelatedProperty,ds as Resource,er as ResourcesService,Rs as Result,As as ResultCache,St as SMCService,sr as SashaService,At as Scope,Sr as ScopeEdge,gs as ScopeGraph,fr as ScopeSubgraph,Dr as ScopeVertex,v as Service,Cn as Source,ys as SourceFile,Qr as Store,dn as StoreCache,Ct as StoreService,co as TargetAudience,at as TargetCluster,un as TargetClusterCache,xs as Timer,Ps as Topology,ln as TopologyCache,le as TopologyService,tt as ValueChangedMessage,bt as Version,_s as WUStateID,Ke as WUUpdate,yn as Workspace,ot as Workunit,nn as WorkunitCache,ie as WorkunitsService,as as WorkunitsServiceEx,kn as WsAccess,Hs as WsCodesign,it as WsDfu,te as WsLogaccess,or as WsSMC,tr as WsSasha,cr as WsTopology,me as WsWorkunits,hr as XGMMLEdge,qs as XGMMLGraph,dr as XGMMLSubgraph,mr as XGMMLVertex,ms as XSDNode,Ds as XSDSchema,fs as XSDSimpleType,hs as XSDXMLNode,nt as attachWorkspace,wp as clearAllClientToolsCache,Lt as createConnection,ps as createGraph,Wr as createXGMMLGraph,ng as defaultTargetCluster,Oi as deserializeResponse,qi as get,za as hookSend,qa as instanceOfIConnection,Xa as instanceOfIOptions,Ji as isArray,lr as isECLResult,nc as isExceptions,Vu as isWUInfoWorkunit,vu as isWUQueryECLWorkunit,_i as jsonp,Qa as locateAllClientTools,jr as locateClientTools,Js as parseXSD,Ku as parseXSD2,Xi as post,Ep as qualifiedIDBoundary,zi as send,qe as serializeRequest,Ja as setTransportFactory,Vo as splitMetric,sg as targetClusters,Un as walkXmlJson};
926
926
  //# sourceMappingURL=index.js.map