@hpcc-js/comms 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -4
- package/dist/index.js.map +4 -4
- package/dist/index.node.js +2 -2
- package/dist/index.node.js.map +3 -3
- package/package.json +8 -8
- package/src/__package__.ts +2 -2
- package/src/ecl/activity.ts +1 -3
- package/src/ecl/logicalFile.ts +4 -1
- package/src/ecl/query.ts +4 -1
- package/src/ecl/targetCluster.ts +1 -3
- package/src/ecl/topology.ts +4 -1
- package/src/espConnection.ts +8 -0
- package/src/services/wsEcl.ts +1 -1
- package/src/services/wsWorkunits.ts +0 -8
- package/types/__package__.d.ts +2 -2
- package/types/ecl/logicalFile.d.ts +1 -1
- package/types/ecl/query.d.ts +1 -1
- package/types/ecl/topology.d.ts +1 -1
- package/types/espConnection.d.ts +2 -0
- package/types/services/wsEcl.d.ts +1 -1
- package/types/services/wsWorkunits.d.ts +0 -3
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var fa="@hpcc-js/comms",ha="3.1.0",ma="2.107.0";function wn(t,e){for(;t.length<e;)t="0"+t;return t}function le(t,e){if(e.length===0)return t;for(let s=0;s<e.length;++s){let r=e.charCodeAt(s);t=(t<<5)-t+r,t|=0}return t<0?t*-2:t}function Gn(t,e,s){return typeof e.hashSum=="function"?e.hashSum():Object.keys(e).sort().reduce((r,n)=>$s(r,e[n],n,s),t)}function $s(t,e,s,r){let n=le(le(le(t,s),Qn(e)),typeof e);return e===null?le(n,"null"):e===void 0?le(n,"undefined"):typeof e=="object"?r.indexOf(e)!==-1?le(n,"[Circular]"+s):(r.push(e),Gn(n,e,r)):le(n,e.toString())}function Qn(t){return Object.prototype.toString.call(t)}function zs(t){return wn($s(0,t,"",[]).toString(16),8)}var T=class{_cache={};_calcID;static hash(...t){return zs({...t})}constructor(t){this._calcID=t}has(t){return this._calcID(t)in this._cache}set(t){return this._cache[this._calcID(t)]=t,t}get(t,e){return this._cache[this._calcID(t)]||(e?this.set(e()):null)}};function Zs(t,e){let s={};return(...r)=>{let n=zs(r);return s[n]||(s[n]={clockStart:Date.now(),promise:t(...r).then(i=>(e===void 0?s[n]=null:setTimeout(()=>{s[n]=null},Math.max(e-(Date.now()-s[n].clockStart),0)),i)).catch(i=>{throw s[n]=null,i})}),s[n].promise}}function Ys(t,e){let s,r=new Promise((n,i)=>{s=setTimeout(()=>{clearTimeout(s),i("Timed out in "+t+"ms.")},t)});return Promise.race([e,r]).then(n=>(clearTimeout(s),n)).catch(n=>{throw clearTimeout(s),n})}function er(t){if(t){if(!isNaN(Number(t)))return Number(t)}else return 0;let e=t.indexOf("ns");if(e!==-1)return parseFloat(t.substr(0,e))/1e9;let s=t.indexOf("ms");if(s!==-1)return parseFloat(t.substr(0,s))/1e3;let r=t.indexOf("s");if(r!==-1&&t.indexOf("days")===-1)return parseFloat(t.substr(0,r));let n=t.split(" days "),i=n.length>1?parseFloat(n[0]):0,o=n.length>1?n[1]:n[0],a=0,c=o.split(":").reverse();for(let p=0;p<c.length;++p)a+=parseFloat(c[p])*Math.pow(60,p);return i*24*60*60+a}var is=class{_graph;parent;props={};constructor(t,e){this._graph=t,this.parent=e}},Fe=class tr extends is{subgraphs=[];vertices=[];edges=[];_;constructor(e,s,r){super(e,s),s&&s._addSubgraph(this),this._=r}remove(e=!0){this._graph.removeSubgraph(this,e)}createSubgraph(e){return this._graph.createSubgraph(this,e)}_addSubgraph(e){if(this.subgraphs.indexOf(e)>=0)throw new Error("Subgraph already exists");this.subgraphs.push(e)}_removeSubgraph(e){let s=this.subgraphs.indexOf(e);if(s<0)throw new Error("Subgraph does not exist");this.subgraphs.splice(s,1)}removeAllSubgraphs(){for(let e=this.subgraphs.length-1;e>=0;--e)this._graph.removeSubgraph(this.subgraphs[e],!0)}createVertex(e){return this._graph.createVertex(this,e)}_addVertex(e){if(this.vertices.indexOf(e)>=0)throw new Error("Vertex already exists");this.vertices.push(e)}_removeVertex(e){let s=this.vertices.indexOf(e);if(s<0)throw new Error("Vertex does not exist");this.vertices.splice(s,1)}removeAllVertices(){for(let e=this.vertices.length-1;e>=0;--e)this._graph.removeVertex(this.vertices[e],!0)}createEdge(e,s,r){return this._graph.createEdge(this,e,s,r)}_addEdge(e){if(this.edges.indexOf(e)>=0)throw new Error("Edge already exists");this.edges.push(e)}_removeEdge(e){let s=this.edges.indexOf(e);if(s<0)throw new Error("Edge does not exist");this.edges.splice(s,1)}_add(e){e instanceof tr?this._addSubgraph(e):e instanceof Ee?this._addVertex(e):this._addEdge(e)}},Ee=class extends is{inEdges=[];outEdges=[];get edges(){return[...this.inEdges,...this.outEdges]}_;constructor(t,e,s){super(t,e),e._addVertex(this),this._=s}remove(t=!0,e){return this._graph.removeVertex(this,t,e)}addInEdge(t){this.inEdges.push(t)}removeInEdge(t){let e=this.inEdges.indexOf(t);if(e<0)throw new Error("In edge does not exist");this.inEdges.splice(e,1)}addOutEdge(t){this.outEdges.push(t)}removeOutEdge(t){let e=this.outEdges.indexOf(t);if(e<0)throw new Error("Out edge does not exist");this.outEdges.splice(e,1)}},Le=class extends is{source;target;_;constructor(t,e,s,r,n){if(super(t,e),!s)throw new Error("Missing source vertex");if(!r)throw new Error("Missing target vertex");e._addEdge(this),this.source=s,this.source.addOutEdge(this),this.target=r,this.target.addInEdge(this),this._=n}remove(){this._graph.removeEdge(this)}},os=class{root;_allSubgraphs=[];_allSubgraphsMap={};_allVertices=[];_allVerticesMap={};_allEdges=[];_allEdgesMap={};idOf;constructor(t=s=>""+s._,e){this.root=new Fe(this,null,e),this.idOf=t}createSubgraph(t,e){let s=new Fe(this,t||this.root,e);return this._allSubgraphs.push(s),this._allSubgraphsMap[this.idOf(s)]=s,s}removeSubgraph(t,e=!0){let s=this._allSubgraphs.indexOf(t);if(s<0)throw new Error("Subgraph does not exist");this._allSubgraphs.splice(s,1),delete this._allSubgraphsMap[this.idOf(t)],t.parent&&t.parent._removeSubgraph(t),t.edges.forEach(r=>e?this.removeEdge(r):t.parent._addEdge(r)),t.vertices.forEach(r=>e?this.removeVertex(r,e):t.parent._addVertex(r)),t.subgraphs.forEach(r=>e?this.removeSubgraph(r,e):t.parent._addSubgraph(r))}get subgraphs(){return this._allSubgraphs}subgraph(t){return this._allSubgraphsMap[t]}createVertex(t,e){let s=new Ee(this,t,e);return this._allVertices.push(s),this._allVerticesMap[this.idOf(s)]=s,s}removeVertex(t,e=!0,s){let r=this._allVertices.indexOf(t);if(r<0)throw new Error("Vertex does not exist");this._allVertices.splice(r,1),delete this._allVerticesMap[this.idOf(t)],t.parent&&t.parent._removeVertex(t),e||t.inEdges.forEach(n=>{t.outEdges.forEach(i=>{this.createEdge(this.root,n.source,i.target,s?s(n.source._,i.target._):void 0)})}),t.inEdges.forEach(n=>this.removeEdge(n)),t.outEdges.forEach(n=>this.removeEdge(n))}get vertices(){return this._allVertices}vertex(t){return this._allVerticesMap[t]}createEdge(t,e,s,r){let n=new Le(this,t,e,s,r);return this._allEdges.push(n),this._allEdgesMap[this.idOf(n)]=n,n}removeEdge(t){let e=this._allEdges.indexOf(t);if(e<0)throw new Error("Edge does not exist");this._allEdges.splice(e,1),delete this._allEdgesMap[this.idOf(t)],t.parent&&t.parent._removeEdge(t),t.source.removeOutEdge(t),t.target.removeInEdge(t)}get edges(){return this._allEdges}edge(t){return this._allEdgesMap[t]}_walk(t,e){for(let s of t.subgraphs)switch(e(s)){case"abort":return!0;case"stepover":break;default:if(this._walk(s,e))return!0}for(let s of t.vertices)if(e(s)==="abort")return!0}walk(t){this._walk(this.root,t);for(let e of this._allEdges)if(t(e)==="abort")return!0}clone(){let t=this.constructor,e=new t(this.idOf,this.root._),s=Vn();return s.put(this.root,e.root),this.walk(r=>{let n=s.get(r.parent);if(r instanceof Fe)s.put(r,n.createSubgraph(r._));else if(r instanceof Ee)s.put(r,n.createVertex(r._));else if(r instanceof Le){let i=s.get(r.source),o=s.get(r.target);n.createEdge(i,o,r._)}}),e}};function Vn(){let t=[],e=[];return{put(s,r){let n=t.indexOf(s);n===-1?(t.push(s),e.push(r)):e[n]=r},get(s){return e[t.indexOf(s)]}}}var Ks=Array.isArray,Hs=Object.keys,On=Object.prototype.hasOwnProperty;function rs(t,e,s=!1){if(t===e)return!0;if(t&&e){if(typeof t=="object"&&typeof e=="object"){let r=Ks(t),n=Ks(e),i,o,a;if(r&&n){if(o=t.length,o!==e.length)return!1;for(i=o;i--!==0;)if(!rs(t[i],e[i],s))return!1;return!0}if(r!==n)return!1;let c=t instanceof Date,p=e instanceof Date;if(c!==p)return!1;if(c&&p)return t.getTime()===e.getTime();let u=t instanceof RegExp,l=e instanceof RegExp;if(u!==l)return!1;if(u&&l)return t.toString()===e.toString();let d=Hs(t);if(o=d.length,o!==Hs(e).length)return!1;for(i=o;i--!==0;)if(!On.call(e,d[i]))return!1;for(i=o;i--!==0;)if(a=d[i],!rs(t[a],e[a],s))return!1;return!0}else if(!s&&typeof t=="function"&&typeof e=="function")return t.toString()===e.toString()}return t!==t&&e!==e}var Js=typeof globalThis<"u"?globalThis:window;var sr=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Sa=sr&&process.env!=null&&(process.env.TRAVIS!=null||process.env.GITHUB_ACTIONS!=null);var Ae=class{stack=[];push(t){return this.stack.push(t),t}pop(){return this.stack.pop()}top(){return this.stack.length?this.stack[this.stack.length-1]:void 0}depth(){return this.stack.length}},it=(t=>(t[t.debug=0]="debug",t[t.info=1]="info",t[t.notice=2]="notice",t[t.warning=3]="warning",t[t.error=4]="error",t[t.critical=5]="critical",t[t.alert=6]="alert",t[t.emergency=7]="emergency",t))(it||{}),qn={debug:"cyan",info:"green",notice:"grey",warning:"blue",error:"red",critical:"magenta",alert:"magenta",emergency:"magenta"},Bn=class{write(t,e,s,r){sr?console.log(`[${t}] ${it[e].toUpperCase()} ${s}: ${r}`):console.log(`[${t}] %c${it[e].toUpperCase()}%c ${s}: ${r}`,`color:${qn[it[e]]}`,"")}},jn=class{static _instance;_levelStack=new Ae;_level=1;_filter="";_writer=new Bn;static Instance(){return this._instance||(this._instance=new this)}constructor(){}stringify(t){let e=[];return JSON.stringify(t,function(s,r){if(typeof r=="object"&&r!==null){if(e.indexOf(r)!==-1)return;e.push(r)}return r},2)}writer(t){return t===void 0?this._writer:(this._writer=t,this)}log(t,e,s){if(t<this._level||this._filter&&this._filter!==e)return;let r=new Date().toISOString();this._writer.rawWrite?this._writer.rawWrite(r,t,e,s):(typeof s!="string"&&(s=this.stringify(s)),this._writer.write&&this._writer.write(r,t,e,s))}debug(t,e){this.log(0,t,e)}info(t,e){this.log(1,t,e)}notice(t,e){this.log(2,t,e)}warning(t,e){this.log(3,t,e)}error(t,e){this.log(4,t,e)}critical(t,e){this.log(5,t,e)}alert(t,e){this.log(6,t,e)}emergency(t,e){this.log(7,t,e)}level(t){return t===void 0?this._level:(this._level=t,this)}pushLevel(t){return this._levelStack.push(this._level),this._level=t,this}popLevel(){return this._level=this._levelStack.pop(),this}filter(t){return t===void 0?this._filter:(this._filter=t,this)}},X=jn.Instance(),Xn=class{_scopeID;constructor(t){this._scopeID=t}debug(t){X.debug(this._scopeID,t)}info(t){X.info(this._scopeID,t)}notice(t){X.notice(this._scopeID,t)}warning(t){X.warning(this._scopeID,t)}error(t){X.error(this._scopeID,t)}critical(t){X.critical(this._scopeID,t)}alert(t){X.alert(this._scopeID,t)}emergency(t){X.emergency(this._scopeID,t)}pushLevel(t){return X.pushLevel(t),this}popLevel(){return X.popLevel(),this}};function O(t,e=!1){return e&&X.filter(t),new Xn(t)}function Kn(t,e){if(!(t===void 0||e===void 0)){for(let s of t.split(".")){if(!e.hasOwnProperty(s))return;e=e[s]}return e}}function $(t,e){return Kn(t,e)!==void 0}function Hn(t,e){let s={};for(let r in e){if(!e.hasOwnProperty(r)||r==="__proto__"||r==="constructor")continue;let n=e[r];n instanceof Array||typeof n=="object"&&(n=ot(t[r],n)),(!(r in t)||t[r]!==n&&(!(r in s)||s[r]!==n))&&(t[r]=n)}return t}function ot(t={},...e){if(typeof t!="object")throw new Error(`Destination "${t}" must be an object.`);for(let s of e)Hn(t,s);return t}function at(t={},...e){return ot(t,...e)}var ns;(function(){if(Js.requestAnimationFrame)ns=Js.requestAnimationFrame;else{let t=0;ns=function(e){let s=new Date().getTime(),r=Math.max(0,16-(s-t)),n=setTimeout(()=>e(s+r),r);return t=s+r,n}}})();var as=class{get canConflate(){return!1}conflate(t){return!1}void(){return!1}},us=class{_observerID=0;_observers=[];_messageBuffer=[];constructor(){}observers(){return this._observers}messages(){let t=[];return this._messageBuffer.forEach(e=>{t.some(s=>s.canConflate&&s.conflate(e))||t.push(e)}),t}dispatchAll(){this.dispatch(this.messages()),this.flush()}dispatch(t){t.length!==0&&this.observers().forEach(e=>{let s=t.filter(r=>!r.void()&&(e.type===void 0||r instanceof e.type));s.length&&e.callback(s)})}hasObserver(){return this._observers.length>0}flush(){this._messageBuffer=[]}send(t){this.dispatch([t])}post(t){this._messageBuffer.push(t),ns(()=>this.dispatchAll())}attach(t,e){let s=this,r=++this._observerID;return this._observers.push({id:r,type:e,callback:t}),{release(){s._observers=s._observers.filter(n=>n.id!==r)},unwatch(){this.release()}}}},we=class{name="";$={};_children=[];content="";constructor(t){this.name=t}appendAttribute(t,e){this.$[t]=e}appendContent(t){this.content+=t}appendChild(t){this._children.push(t)}children(t){return t===void 0?this._children:this._children.filter(e=>e.name===t)}},cs=class{root;stack=new Ae;constructor(){}walkDoc(t){let e=this._startXMLNode(t);if(t.attributes)for(let s=0;s<t.attributes.length;++s){let r=t.attributes.item(s);this.attributes(r.nodeName,r.nodeValue)}if(this.startXMLNode(e),t.childNodes)for(let s=0;s<t.childNodes.length;++s){let r=t.childNodes.item(s);r.nodeType===r.TEXT_NODE?this.characters(r.nodeValue):this.walkDoc(r)}this.endXMLNode(this.stack.pop())}_startXMLNode(t){let e=new we(t.nodeName);return this.stack.depth()?this.stack.top().appendChild(e):this.root=e,this.stack.push(e)}parse(t){let e=new DOMParser().parseFromString(t,"application/xml");this.startDocument(),this.walkDoc(e),this.endDocument()}startDocument(){}endDocument(){}startXMLNode(t){}endXMLNode(t){}attributes(t,e){this.stack.top().appendAttribute(t,e)}characters(t){this.stack.top().appendContent(t)}},Jn=class extends cs{startXMLNode(t){switch(super.startXMLNode(t),t.name){case"xs:element":break;case"xs:simpleType":break;default:break}}endXMLNode(t){switch(t.name){case"xs:element":break;case"xs:simpleType":break;default:break}super.endXMLNode(t)}};function rr(t){let e=new Jn;return e.parse(t),e.root}var $n=class extends as{constructor(t,e,s){super(),this.property=t,this.newValue=e,this.oldValue=s}get canConflate(){return!0}conflate(t){return this.property===t.property?(this.newValue=t.newValue,!0):!1}void(){return rs(this.newValue,this.oldValue)}},P=class{_espState={};_dispatch=new us;_monitorHandle;_monitorTickCount=0;clear(t){this._espState={},t!==void 0&&this.set(t),this._monitorTickCount=0}get(t,e){return t===void 0?this._espState:this.has(t)?this._espState[t]:e}set(t,e){if(typeof t=="string")return this.setSingle(t,e);this.setAll(t)}setSingle(t,e){let s=this._espState[t];this._espState[t]=e,this._dispatch.post(new $n(t,e,s))}setAll(t){for(let e in t)t.hasOwnProperty(e)&&this.setSingle(e,t[e])}has(t){return this._espState[t]!==void 0}addObserver(t,e,s){if(this.isCallback(e)){if(t!=="changed")throw new Error("Invalid eventID: "+t);return this._dispatch.attach(r=>{e(r.map(n=>({id:n.property,oldValue:n.oldValue,newValue:n.newValue})))})}else{if(t!=="propChanged")throw new Error("Invalid eventID: "+t);return this._dispatch.attach(r=>{let n=r.filter(i=>i.property===e);if(n.length){n.length>1&&console.warn("Should only be 1 message?");let i=n[n.length-1];s({id:i.property,oldValue:i.oldValue,newValue:i.newValue})}})}}on(t,e,s){return this.addObserver(t,e,s),this}isCallback(t){return typeof t=="function"}hasEventListener(){return this._dispatch.hasObserver()}async refresh(t=!1){return await Promise.resolve(),this}_monitor(){if(this._monitorHandle){this._monitorTickCount=0;return}this._monitorHandle=setTimeout(()=>{(this.hasEventListener()?this.refresh():Promise.resolve()).then(()=>{this._monitor()}),delete this._monitorHandle},this._monitorTimeoutDuration())}_monitorTimeoutDuration(){return++this._monitorTickCount,this._monitorTickCount<=1?0:3e4}watch(t,e=!0){if(typeof t!="function")throw new Error("Invalid Callback");e&&setTimeout(()=>{let r=this.get(),n=[];for(let i in r)r.hasOwnProperty(r)&&n.push({id:i,newValue:r[i],oldValue:void 0});t(n)},0);let s=this.addObserver("changed",t);return this._monitor(),s}};function z(...t){let e=t.reduce((r,n)=>(r.length>0&&(n=n.replace(/^\//,"")),n=n.replace(/\/$/,""),[...r,...n.split("/")]),[]),s=[];for(let r of e)if(r!=="."){if(r===".."){s.pop();continue}s.push(r)}return s.join("/")}var nr=O("comms/connection.ts");function Aa(t){return"baseUrl"in t}var zn={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function wa(t){return typeof t.opts=="function"&&typeof t.send=="function"&&typeof t.clone=="function"}function K(t,e){return e===void 0||e===!0?encodeURIComponent(t):""+t}function pe(t,e=!0,s=""){if(s&&(s+="."),typeof t!="object")return K(t,e);let r=[];for(let n in t)if(t.hasOwnProperty(n))if(t[n]instanceof Array){let i=!1;t[n].forEach((o,a)=>{typeof o=="object"?(i=!0,r.push(pe(o,e,s+K(`${n}.${a}`,e)))):r.push(s+K(`${n}_i${a}`,e)+"="+pe(o,e))}),i&&r.push(s+K(`${n}.itemcount`,e)+"="+t[n].length)}else typeof t[n]=="object"?t[n]&&t[n].Item instanceof Array?(r.push(pe(t[n].Item,e,s+K(n,e))),r.push(s+K(`${n}.itemcount`,e)+"="+t[n].Item.length)):r.push(pe(t[n],e,s+K(n,e))):t[n]!==void 0?r.push(s+K(n,e)+"="+K(t[n],e)):r.push(s+K(n,e));return r.join("&")}function Zn(t){return JSON.parse(t)}function Yn(t,e,s={},r="json",n){return n&&console.warn("Header attributes ignored for JSONP connections"),new Promise((i,o)=>{let a=t.timeoutSecs*1e3,c=5e3,p="jsonp_callback_"+Math.round(Math.random()*999999);window[p]=function(I){a=0,U(),i(r==="json"&&typeof I=="string"?Zn(I):I)};let u=document.createElement("script"),l=z(t.baseUrl,e);l+=l.indexOf("?")>=0?"&":"?",u.src=l+"jsonp="+p+"&"+pe(s,t.encodeRequest),document.body.appendChild(u);let d=setInterval(function(){a<=0?clearInterval(d):(a-=c,a<=0?(clearInterval(d),nr.error("Request timeout: "+u.src),U(),o(Error("Request timeout: "+u.src))):nr.debug("Request pending ("+a/1e3+" sec): "+u.src))},c);function U(){delete window[p],document.body.removeChild(u)}})}function ei(t){return t.userID?{Authorization:`Basic ${btoa(`${t.userID}:${t.password}`)}`}:{}}var ut={};function ir(t,e,s,r,n){r={...ei(t),...r},s={credentials:ut[t.baseUrl]?"omit":"include",...s,headers:r},fetch.__setGlobalDispatcher&&fetch.__setGlobalDispatcher(fetch.__defaultAgent),t.baseUrl.indexOf("https:")===0&&(t.rejectUnauthorized===!1&&fetch.__rejectUnauthorizedAgent?fetch.__setGlobalDispatcher?fetch.__setGlobalDispatcher(fetch.__rejectUnauthorizedAgent):s.agent=fetch.__rejectUnauthorizedAgent:fetch.__trustwaveAgent&&(s.agent=fetch.__trustwaveAgent));function i(o){if(o.ok)return n==="json"?o.json():o.text();throw new Error(o.statusText)}return Ys(t.timeoutSecs*1e3,fetch(z(t.baseUrl,e),s).then(i).catch(o=>(s.credentials=ut[t.baseUrl]?"include":"omit",fetch(z(t.baseUrl,e),s).then(i).then(a=>(ut[t.baseUrl]=!ut[t.baseUrl],a)))))}function ti(t,e,s,r="json",n){s.upload_&&(delete s.upload_,e+="?upload_");let i;return s.abortSignal_&&(i=s.abortSignal_,delete s.abortSignal_),ir(t,e,{method:"post",body:pe(s,t.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...n},r)}function si(t,e,s,r="json",n){let i;return s.abortSignal_&&(i=s.abortSignal_,delete s.abortSignal_),ir(t,`${e}?${pe(s,t.encodeRequest)}`,{method:"get",signal:i},{...n},r)}function ri(t,e,s,r="json",n){let i;switch(t.type){case"jsonp":i=Yn(t,e,s,r,n);break;case"get":i=si(t,e,s,r,n);break;case"post":default:i=ti(t,e,s,r,n);break}return i}var ct=ri;function Ga(t){let e=ct;return t&&(ct=t),e}var ls=class t{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return arguments.length===0?this._opts:(this._opts={...zn,...e},this)}send(e,s,r="json",n){return this._opts.hookSend?this._opts.hookSend(this._opts,e,s,r,ct,n):ct(this._opts,e,s,r,n)}clone(){return new t(this.opts())}},lt=function(t){return new ls(t)};function Qa(t){let e=lt;return lt=t,e}function ni(t){return Object.prototype.toString.call(t)==="[object Array]"}var Y=class extends Error{isESPExceptions=!0;action;request;Source;Exception;constructor(e,s,r){super("ESPException: "+r.Source),this.action=e,this.request=s,this.Source=r.Source,this.Exception=r.Exception,r.Exception.length?this.message=`${r.Exception[0].Code}: ${r.Exception[0].Message}`:this.message=""}};function Ka(t){return t instanceof Y||t.isESPExceptions&&Array.isArray(t.Exception)}function ii(t){return t.send!==void 0}var Ge=class t{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,s,r){this._connection=ii(e)?e:lt(e),this._service=s,this._version=r}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,s){if(ni(e[s])){for(let r=0;r<e[s].length;++r)e[s+"_i"+r]=e[s][r];delete e[s]}return e}opts(e){return e===void 0?this._connection.opts():(this._connection.opts(e),this)}send(e,s={},r="json",n=!1,i,o){let a={...s,ver_:this._version};n&&(a.upload_=!0),i&&(a.abortSignal_=i);let c,p="json";switch(r){case"text":c=z(this._service,e),p="text";break;case"xsd":c=z(this._service,e+".xsd"),p="text";break;case"json2":c=z(this._service,e+"/json"),r="json",e=e.split("/").pop();break;default:c=z(this._service,e+".json")}return this._connection.send(c,a,p).then(u=>{if(r==="json"){let l;if(u&&u.Exceptions)throw new Y(e,a,u.Exceptions);if(u&&(l=u[o||e+"Response"]),!l)throw new Y(e,a,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return l}return u}).catch(u=>{throw u.isESPExceptions?u:new Y(e,a,{Source:"ESPConnection.send",Exception:[{Code:0,Message:u.message}]})})}clone(){return new t(this._connection.clone(),this._service,this._version)}},S=class{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,s,r){this._connection=new Ge(e,s,r)}};var Qe;(e=>{let t;(c=>(c.Delete="Delete",c.Protect="Protect",c.Unprotect="Unprotect",c.Restore="Restore",c.SetToFailed="SetToFailed",c.Archive="Archive"))(t=e.DFUWUActions||={})})(Qe||={});var pt=class extends S{constructor(e){super(e,"FileSpray","1.26")}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 oi=(u=>(u[u.unknown=0]="unknown",u[u.scheduled=1]="scheduled",u[u.queued=2]="queued",u[u.started=3]="started",u[u.aborted=4]="aborted",u[u.failed=5]="failed",u[u.finished=6]="finished",u[u.monitoring=7]="monitoring",u[u.aborting=8]="aborting",u[u.notfound=999]="notfound",u))(oi||{}),ge=class extends pt{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 or;(o=>{let t;(p=>(p.User="User",p.Group="Group"))(t=o.ViewMemberType||={});let e;(d=>(d.username="username",d.fullname="fullname",d.passwordexpiration="passwordexpiration",d.employeeID="employeeID",d.employeeNumber="employeeNumber"))(e=o.UserSortBy||={});let s;(p=>(p.Name="Name",p.ManagedBy="ManagedBy"))(s=o.GroupSortBy||={});let r;(u=>(u.Any="Any",u.User="User",u.Group="Group"))(r=o.AccountTypeReq||={});let n;(p=>(p.Name="Name",p.Type="Type"))(n=o.ResourcePermissionSortBy||={});let i;(c=>c.Name="Name")(i=o.ResourceSortBy||={})})(or||={});var gt=class extends S{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 ar=class extends gt{};var dt=class extends S{constructor(e){super(e,"ws_account","1.06")}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 ur=class extends dt{VerifyUser(e){return this._connection.send("VerifyUser",e).catch(s=>{if(s.isESPExceptions&&s.Exception.some(r=>r.Code===20043))return{retcode:20043,Exceptions:{Source:"wsAccount",Exception:s.Exception}};throw s})}};var ft=class extends S{constructor(e){super(e,"WsCloud","1")}GetPODs(e){return this._connection.send("GetPODs",e)}Ping(e){return this._connection.send("Ping",e)}};var cr=class extends ft{getPODs(){return super.GetPODs({}).then(e=>{try{return(typeof e.Result=="string"?JSON.parse(e.Result):e.Result)?.items??[]}catch{return[]}})}};var lr=class{_connection;constructor(e){this._connection=new Ge(e,"ws_codesign","1.1")}connectionOptions(){return this._connection.opts()}ListUserIDs(e){return this._connection.send("ListUserIDs",e).then(s=>s.UserIDs.Item).catch(s=>[])}Sign(e){return this._connection.send("Sign",{SigningMethod:"gpg",...e})}Verify(e){return this._connection.send("Verify",e)}};var ht=class extends S{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 pr=class extends ht{};var Te;(a=>{let t;(d=>(d.Delete="Delete",d.AddToSuperfile="Add To Superfile",d.ChangeProtection="Change Protection",d.ChangeRestriction="Change Restriction"))(t=a.DFUArrayActions||={});let e;(d=>(d[d.NoChange=0]="NoChange",d[d.Protect=1]="Protect",d[d.Unprotect=2]="Unprotect",d[d.UnprotectAll=3]="UnprotectAll"))(e=a.DFUChangeProtection||={});let s;(l=>(l[l.NoChange=0]="NoChange",l[l.Restrict=1]="Restrict",l[l.Unrestricted=2]="Unrestricted"))(s=a.DFUChangeRestriction||={});let r;(u=>(u.xml="xml",u.def="def"))(r=a.DFUDefFileFormat||={});let n;(l=>(l.Token="Token",l.Engine="Engine",l.External="External"))(n=a.FileAccessRole||={});let i;(U=>(U.None="None",U.Access="Access",U.Read="Read",U.Write="Write",U.Full="Full"))(i=a.SecAccessType||={});let o;(y=>(y.Flat="Flat",y.Index="Index",y.Xml="Xml",y.Csv="Csv",y.Json="Json",y.IndexLocal="IndexLocal",y.IndexPartitioned="IndexPartitioned",y.Unset="Unset"))(o=a.DFUFileType||={})})(Te||={});var mt=class extends S{constructor(e){super(e,"WsDfu","1.65")}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")}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 Cu=Te.DFUArrayActions,bu=Te.DFUDefFileFormat,Uu=Te.DFUChangeProtection,Pu=Te.DFUChangeRestriction,Ve=class extends mt{DFUFile(e){return this._connection.send("DFUDefFile",e,"text")}};var gr=class extends S{constructor(e){super(e,"WsDFUXRef","1.01")}DFUXRefArrayAction(e){return this._connection.send("DFUXRefArrayAction",e)}DFUXRefBuild(e){return this._connection.send("DFUXRefBuild",e)}DFUXRefBuildCancel(e){return this._connection.send("DFUXRefBuildCancel",e)}DFUXRefCleanDirectories(e){return this._connection.send("DFUXRefCleanDirectories",e)}DFUXRefDirectories(e){return this._connection.send("DFUXRefDirectories",e,void 0,void 0,void 0,"DFUXRefDirectoriesQueryResponse")}DFUXRefFoundFiles(e){return this._connection.send("DFUXRefFoundFiles",e,void 0,void 0,void 0,"DFUXRefFoundFilesQueryResponse")}DFUXRefList(e={}){return this._connection.send("DFUXRefList",e)}DFUXRefLostFiles(e){return this._connection.send("DFUXRefLostFiles",e,void 0,void 0,void 0,"DFUXRefLostFilesQueryResponse")}DFUXRefMessages(e){return this._connection.send("DFUXRefMessages",e,void 0,void 0,void 0,"DFUXRefMessagesQueryResponse")}DFUXRefOrphanFiles(e){return this._connection.send("DFUXRefOrphanFiles",e,void 0,void 0,void 0,"DFUXRefOrphanFilesQueryResponse")}DFUXRefUnusedFiles(e){return this._connection.send("DFUXRefUnusedFiles",e)}};function dr(t,e){let s=typeof e;switch(s){case"boolean":case"number":case"string":return{id:t,type:s};case"object":if(e.Row instanceof Array&&(e=e.Row),e instanceof Array)return{id:t,type:"dataset",children:ps(e[0])};if(e instanceof Object){if(e.Item&&e.Item instanceof Array&&e.Item.length===1){let r=typeof e.Item[0];if(r==="string"||r==="number")return{id:t,type:"set",fieldType:r};throw new Error("Unknown field type")}return{id:t,type:"object",fields:ai(e)}}default:throw new Error("Unknown field type")}}function ps(t){t.Row&&t.Row instanceof Array&&(t=t.Row[0]);let e=[];for(let s in t)e.push(dr(s,t[s]));return e}function ai(t){let e={};for(let s in t)e[s]=dr(s,t[s]);return e}var xt=class extends S{constructor(e){super(e,"WsEcl","0")}opts(){return this._connection.opts()}requestJson(e,s){return this._connection.send(`example/request/query/${e}/${s}/json`,{},"text").then(r=>{let n=JSON.parse(r);for(let i in n)return n[i];return{}}).then(ps)}responseJson(e,s){return this._connection.send(`example/response/query/${e}/${s}/json`,{},"text").then(r=>{let n=JSON.parse(r);for(let i in n)return n[i].Results;return{}}).then(r=>{let n={};for(let i in r)n[i]=ps(r[i]);return n})}submit(e,s,r){let n=`submit/query/${e}/${s}`;return this._connection.send(n,r,"json2").then(i=>{if(i.Results&&i.Results.Exception)throw new Y(n,r,{Source:"wsEcl.submit",Exception:i.Results.Exception});return i.Results})}};var St=class extends S{constructor(e){super(e,"ws_elk","1")}GetConfigDetails(e){return this._connection.send("GetConfigDetails",e)}Ping(e){return this._connection.send("Ping",e)}};var fr=class extends St{};var k;(a=>{let t;(m=>(m.global="global",m.workunits="workunits",m.components="components",m.audience="audience",m.class="class",m.instance="instance",m.node="node",m.message="message",m.logid="logid",m.processid="processid",m.threadid="threadid",m.timestamp="timestamp",m.pod="pod"))(t=a.LogColumnType||={});let e;(d=>(d.string="string",d.numeric="numeric",d.datetime="datetime",d.enum="enum"))(e=a.LogColumnValueType||={});let s;(x=>(x[x.All=0]="All",x[x.ByJobID=1]="ByJobID",x[x.ByComponent=2]="ByComponent",x[x.ByLogType=3]="ByLogType",x[x.ByTargetAudience=4]="ByTargetAudience",x[x.BySourceInstance=5]="BySourceInstance",x[x.BySourceNode=6]="BySourceNode",x[x.ByFieldName=7]="ByFieldName",x[x.ByPod=8]="ByPod"))(s=a.LogAccessType||={});let r;(l=>(l[l.NONE=0]="NONE",l[l.AND=1]="AND",l[l.OR=2]="OR"))(r=a.LogAccessFilterOperator||={});let n;(d=>(d[d.MIN=0]="MIN",d[d.DEFAULT=1]="DEFAULT",d[d.ALL=2]="ALL",d[d.CUSTOM=3]="CUSTOM"))(n=a.LogSelectColumnMode||={});let i;(x=>(x[x.ByDate=0]="ByDate",x[x.ByJobID=1]="ByJobID",x[x.ByComponent=2]="ByComponent",x[x.ByLogType=3]="ByLogType",x[x.ByTargetAudience=4]="ByTargetAudience",x[x.BySourceInstance=5]="BySourceInstance",x[x.BySourceNode=6]="BySourceNode",x[x.ByFieldName=7]="ByFieldName",x[x.ByPod=8]="ByPod"))(i=a.SortColumType||={});let o;(u=>(u[u.ASC=0]="ASC",u[u.DSC=1]="DSC"))(o=a.SortDirection||={})})(k||={});var yt=class extends S{constructor(e){super(e,"ws_logaccess","1.05")}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 hr=O("@hpcc-js/comms/services/wsLogaccess.ts");var ui=(o=>(o.Disaster="DIS",o.Error="ERR",o.Warning="WRN",o.Information="INF",o.Progress="PRO",o.Metric="MET",o))(ui||{}),ci=(n=>(n.Operator="OPR",n.User="USR",n.Programmer="PRO",n.Audit="ADT",n))(ci||{}),mr=class extends yt{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}async GetLogsEx(e){let s=await this.GetLogAccessInfo(),r={};s.Columns.Column.forEach(a=>r[a.LogType]=a.Name);let n=a=>{let c={};for(let p in r)a?.fields?c[p]=Object.assign({},...a.fields)[r[p]]??"":c[p]="";return c},i={Filter:{leftBinaryFilter:{BinaryLogFilter:[{leftFilter:{LogCategory:k.LogAccessType.All}}]}},Range:{StartDate:new Date(0).toISOString()},LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:k.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:k.SortColumType.ByDate,ColumnName:"",Direction:0}]}},o=[];for(let a in e){let c;a in r&&(Object.values(k.LogColumnType).includes(a)?c=a:c=r[a]);let p;if(c){switch(c){case k.LogColumnType.workunits:case"hpcc.log.jobid":p=k.LogAccessType.ByJobID;break;case k.LogColumnType.audience:case"hpcc.log.audience":p=k.LogAccessType.ByTargetAudience;break;case k.LogColumnType.class:case"hpcc.log.class":p=k.LogAccessType.ByLogType;break;case k.LogColumnType.components:case"kubernetes.container.name":p=k.LogAccessType.ByComponent;break;default:p=k.LogAccessType.ByFieldName,c=r[a]}if(Array.isArray(e[a]))e[a].forEach(u=>{p===k.LogAccessType.ByComponent&&(u+="*"),o.push({LogCategory:p,SearchField:c,SearchByValue:u})});else{let u=e[a];p===k.LogAccessType.ByComponent&&(u+="*"),o.push({LogCategory:p,SearchField:c,SearchByValue:u})}}}if(o.length>2){let a=i.Filter.leftBinaryFilter.BinaryLogFilter[0];o.forEach((c,p)=>{let u=k.LogAccessFilterOperator.AND;p>0?(o[p-1].SearchField===c.SearchField&&(u=k.LogAccessFilterOperator.OR),p===o.length-1?(a.Operator=u,a.rightFilter=c):(a.Operator=u,a.rightBinaryFilter={BinaryLogFilter:[{leftFilter:c}]},a=a.rightBinaryFilter.BinaryLogFilter[0])):a.leftFilter=c})}else delete i.Filter.leftBinaryFilter,i.Filter.leftFilter={LogCategory:k.LogAccessType.All},o[0]?.SearchField&&(i.Filter.leftFilter={LogCategory:o[0]?.LogCategory,SearchField:o[0]?.SearchField,SearchByValue:o[0]?.SearchByValue}),o[1]?.SearchField&&(i.Filter.Operator=k.LogAccessFilterOperator.AND,o[0].SearchField===o[1].SearchField&&(i.Filter.Operator=k.LogAccessFilterOperator.OR),i.Filter.rightFilter={LogCategory:o[1]?.LogCategory,SearchField:o[1]?.SearchField,SearchByValue:o[1]?.SearchByValue});return e.StartDate&&(i.Range.StartDate=e.StartDate.toISOString()),e.EndDate&&(i.Range.EndDate=e.EndDate.toISOString()),this.GetLogs(i).then(a=>{try{let c=JSON.parse(a.LogLines),p=[];switch(s.RemoteLogManagerType){case"azureloganalyticscurl":case"elasticstack":case"grafanacurl":p=c.lines?.map(n)??[];break;default:hr.warning(`Unknown RemoteLogManagerType: ${s.RemoteLogManagerType}`),p=[]}return{lines:p,total:a.TotalLogLinesAvailable??1e4}}catch(c){hr.error(c.message??c)}return{lines:[],total:0}})}};function ee(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function gs(t){return t.length===1&&(t=li(t)),{left:function(e,s,r,n){for(r==null&&(r=0),n==null&&(n=e.length);r<n;){var i=r+n>>>1;t(e[i],s)<0?r=i+1:n=i}return r},right:function(e,s,r,n){for(r==null&&(r=0),n==null&&(n=e.length);r<n;){var i=r+n>>>1;t(e[i],s)>0?n=i:r=i+1}return r}}}function li(t){return function(e,s){return ee(t(e),s)}}var xr=gs(ee),pi=xr.right,gi=xr.left;function de(t){return t===null?NaN:+t}var Sr=Array.prototype,fi=Sr.slice,hi=Sr.map;var cc=Math.sqrt(50),lc=Math.sqrt(10),pc=Math.sqrt(2);function Oe(t,e){var s=t.length,r=-1,n,i;if(e==null){for(;++r<s;)if((n=t[r])!=null&&n>=n)for(i=n;++r<s;)(n=t[r])!=null&&n>i&&(i=n)}else for(;++r<s;)if((n=e(t[r],r,t))!=null&&n>=n)for(i=n;++r<s;)(n=e(t[r],r,t))!=null&&n>i&&(i=n);return i}function qe(t,e){var s=t.length,r=s,n=-1,i,o=0;if(e==null)for(;++n<s;)isNaN(i=de(t[n]))?--r:o+=i;else for(;++n<s;)isNaN(i=de(e(t[n],n,t)))?--r:o+=i;if(r)return o/r}var Wt=class extends S{constructor(e){super(e,"ws_machine","1.17")}GetComponentStatus(e){return this._connection.send("GetComponentStatus",e)}GetComponentUsage(e){return this._connection.send("GetComponentUsage",e)}GetMachineInfo(e){return this._connection.send("GetMachineInfo",e)}GetMachineInfoEx(e){return this._connection.send("GetMachineInfoEx",e)}GetMetrics(e){return this._connection.send("GetMetrics",e)}GetNodeGroupUsage(e){return this._connection.send("GetNodeGroupUsage",e)}GetTargetClusterInfo(e){return this._connection.send("GetTargetClusterInfo",e)}GetTargetClusterUsage(e){return this._connection.send("GetTargetClusterUsage",e)}Ping(e){return this._connection.send("Ping",e)}UpdateComponentStatus(e){return this._connection.send("UpdateComponentStatus",e)}};var te=class extends Wt{GetTargetClusterUsageEx(e,s=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:s}).then(r=>$("TargetClusterUsages.TargetClusterUsage",r)?r.TargetClusterUsages.TargetClusterUsage:[]).then(r=>r.filter(n=>!!n.ComponentUsages).map(n=>{let i=n.ComponentUsages.ComponentUsage.map(o=>{let a=(o.MachineUsages&&o.MachineUsages.MachineUsage?o.MachineUsages.MachineUsage:[]).map(c=>{let p=c.DiskUsages&&c.DiskUsages.DiskUsage?c.DiskUsages.DiskUsage.map(u=>({...u,InUse:u.InUse*1024,Total:(u.InUse+u.Available)*1024,PercentUsed:100-u.PercentAvailable})):[];return{Name:c.Name,NetAddress:c.NetAddress,Description:c.Description,DiskUsages:p,mean:qe(p.filter(u=>!isNaN(u.PercentUsed)),u=>u.PercentUsed),max:Oe(p.filter(u=>!isNaN(u.PercentUsed)),u=>u.PercentUsed)}});return{Type:o.Type,Name:o.Name,Description:o.Description,MachineUsages:a,MachineUsagesDescription:a.reduce((c,p)=>c+(p.Description||""),""),mean:qe(a.filter(c=>!isNaN(c.mean)),c=>c.mean),max:Oe(a.filter(c=>!isNaN(c.max)),c=>c.max)}});return{Name:n.Name,Description:n.Description,ComponentUsages:i,ComponentUsagesDescription:i.reduce((o,a)=>o+(a.MachineUsagesDescription||""),""),mean:qe(i.filter(o=>!isNaN(o.mean)),o=>o.mean),max:Oe(i.filter(o=>!isNaN(o.max)),o=>o.max)}}))}};var Dt=class extends S{constructor(e){super(e,"WsPackageProcess","1.04")}ActivatePackage(e){return this._connection.send("ActivatePackage",e)}AddPackage(e){return this._connection.send("AddPackage",e)}AddPartToPackageMap(e){return this._connection.send("AddPartToPackageMap",e)}CopyPackageMap(e){return this._connection.send("CopyPackageMap",e)}DeActivatePackage(e){return this._connection.send("DeActivatePackage",e)}DeletePackage(e){return this._connection.send("DeletePackage",e)}Echo(e){return this._connection.send("Echo",e)}GetPackage(e){return this._connection.send("GetPackage",e)}GetPackageMapById(e){return this._connection.send("GetPackageMapById",e)}GetPackageMapSelectOptions(e){return this._connection.send("GetPackageMapSelectOptions",e)}GetPartFromPackageMap(e){return this._connection.send("GetPartFromPackageMap",e)}GetQueryFileMapping(e){return this._connection.send("GetQueryFileMapping",e)}ListPackage(e){return this._connection.send("ListPackage",e)}ListPackages(e){return this._connection.send("ListPackages",e)}Ping(e){return this._connection.send("Ping",e)}RemovePartFromPackageMap(e){return this._connection.send("RemovePartFromPackageMap",e)}ValidatePackage(e){return this._connection.send("ValidatePackage",e)}};var Wr=class extends Dt{};var Rt=class extends S{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 Dr=class extends Rt{};var Rr;(e=>{let t;(n=>(n.ECL="ECL",n.DFU="DFU"))(t=e.WUTypes||={})})(Rr||={});var Ct=class extends S{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 Cr=class extends Ct{};var br;(s=>{let t;(c=>(c.ALL="ALL",c.READ="READ",c.WRITE="WRITE",c.HOLD="HOLD",c.SUB="SUB"))(t=s.LockModes||={});let e;(l=>(l.Attach="Attach",l.Detach="Detach",l.State="State",l.Reload="Reload",l.ReloadRetry="ReloadRetry",l.MemLock="MemLock",l.MemUnlock="MemUnlock",l.GetMemLocked="GetMemLocked"))(e=s.RoxieControlCmdType||={})})(br||={});var bt=class extends S{constructor(e){super(e,"WsSMC","1.27")}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")}GetStatusServerInfo(e){return this._connection.send("GetStatusServerInfo",e,"json",!1,void 0,"GetStatusServerInfoResponse")}GetThorQueueAvailability(e){return this._connection.send("GetThorQueueAvailability",e,"json",!1,void 0,"GetThorQueueAvailabilityResponse")}Index(e){return this._connection.send("Index",e,"json",!1,void 0,"SMCIndexResponse")}LockQuery(e){return this._connection.send("LockQuery",e,"json",!1,void 0,"LockQueryResponse")}MoveJobBack(e){return this._connection.send("MoveJobBack",e,"json",!1,void 0,"SMCJobResponse")}MoveJobDown(e){return this._connection.send("MoveJobDown",e,"json",!1,void 0,"SMCJobResponse")}MoveJobFront(e){return this._connection.send("MoveJobFront",e,"json",!1,void 0,"SMCJobResponse")}MoveJobUp(e){return this._connection.send("MoveJobUp",e,"json",!1,void 0,"SMCJobResponse")}NotInCommunityEdition(e){return this._connection.send("NotInCommunityEdition",e,"json",!1,void 0,"NotInCommunityEditionResponse")}PauseQueue(e){return this._connection.send("PauseQueue",e,"json",!1,void 0,"SMCQueueResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsSMCPingResponse")}RemoveJob(e){return this._connection.send("RemoveJob",e,"json",!1,void 0,"SMCJobResponse")}ResumeQueue(e){return this._connection.send("ResumeQueue",e,"json",!1,void 0,"SMCQueueResponse")}RoxieControlCmd(e){return this._connection.send("RoxieControlCmd",e,"json",!1,void 0,"RoxieControlCmdResponse")}RoxieXrefCmd(e){return this._connection.send("RoxieXrefCmd",e,"json",!1,void 0,"RoxieXrefCmdResponse")}SetBanner(e){return this._connection.send("SetBanner",e,"json",!1,void 0,"SetBannerResponse")}SetJobPriority(e){return this._connection.send("SetJobPriority",e,"json",!1,void 0,"SMCPriorityResponse")}StopQueue(e){return this._connection.send("StopQueue",e,"json",!1,void 0,"SMCQueueResponse")}};var Be=class extends bt{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(s=>({Running:{ActiveWorkunit:[]},...s}))}};var je=class extends S{constructor(e){super(e,"WsStore","1")}CreateStore(e){return this._connection.send("Fetch",e)}Delete(e){return this._connection.send("Delete",e).catch(s=>{if(s.isESPExceptions&&s.Exception.some(r=>r.Code===-1))return{Exceptions:void 0,Success:!0};throw s})}DeleteNamespace(e){return this._connection.send("DeleteNamespace",e)}Fetch(e){return this._connection.send("Fetch",e).catch(s=>{if(s.isESPExceptions&&s.Exception.some(r=>r.Code===-1))return{Exceptions:void 0,Value:void 0};throw s})}FetchAll(e){return this._connection.send("FetchAll",e)}FetchKeyMD(e){return this._connection.send("FetchKeyMD",e)}ListKeys(e){return this._connection.send("ListKeys",e)}ListNamespaces(e){return this._connection.send("ListNamespaces",e)}Set(e){return this._connection.send("Set",e)}};var Ur;(e=>{let t;(i=>(i.All="All",i.QueriesOnly="QueriesOnly",i.WorkunitsOnly="WorkunitsOnly"))(t=e.RoxieQueueFilter||={})})(Ur||={});var Ut=class extends S{constructor(e){super(e,"WsTopology","1.32")}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")}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 L=class extends Ut{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(s=>{if(s.default)return s.default;let r,n;return s.TpLogicalClusters.TpLogicalCluster.some((i,o)=>(o===0&&(n=i),i.Type==="hthor"?(r=i,!0):!1)),r||n})}};var w;(y=>{let t;(F=>(F.Abort="Abort",F.Delete="Delete",F.Deschedule="Deschedule",F.Reschedule="Reschedule",F.Pause="Pause",F.PauseNow="PauseNow",F.Protect="Protect",F.Unprotect="Unprotect",F.Restore="Restore",F.Resume="Resume",F.SetToFailed="SetToFailed",F.Archive="Archive"))(t=y.ECLWUActions||={});let e;(m=>(m[m.MIN=0]="MIN",m[m.DEFAULT=1]="DEFAULT",m[m.ALL=2]="ALL",m[m.CUSTOM=3]="CUSTOM"))(e=y.LogSelectColumnMode||={});let s;(f=>(f[f.ASC=0]="ASC",f[f.DSC=1]="DSC"))(s=y.SortDirection||={});let r;(_=>(_.ALL="ALL",_.DIS="DIS",_.ERR="ERR",_.WRN="WRN",_.INF="INF",_.PRO="PRO",_.MET="MET",_.EVT="EVT"))(r=y.LogEventClass||={});let n;(R=>(R.Single="Single",R.List="List",R.Multi="Multi"))(n=y.WUDetailsAttrValueType||={});let i;(R=>(R.SyntaxCheck="SyntaxCheck",R.Deploy="Deploy",R.Publish="Publish"))(i=y.EclDefinitionActions||={});let o;(R=>(R.xml="xml",R.json="json",R.text="text"))(o=y.ErrorMessageFormat||={});let a;(R=>(R[R.XML=0]="XML",R[R.JSON=1]="JSON",R[R.CSV=2]="CSV"))(a=y.LogAccessLogFormat||={});let c;(m=>(m.info="info",m.warning="warning",m.error="error",m.alert="alert"))(c=y.WUExceptionSeverity||={});let p;(B=>(B.Allqueries="All queries",B.Notsuspended="Not suspended",B.Suspended="Suspended",B.Suspendedbyuser="Suspended by user",B.Suspendedbyfirstnode="Suspended by first node",B.Suspendedbyanynode="Suspended by any node"))(p=y.WUQueryFilterSuspendedType||={});let u;(M=>(M.All="All",M.Id="Id",M.Name="Name",M.Alias="Alias",M.Status="Status"))(u=y.WUQuerySetFilterType||={});let l;(R=>(R.All="All",R.Protected="Protected",R.NotProtected="NotProtected"))(l=y.WUProtectFilter||={});let d;(ae=>ae.Deactivate="Deactivate")(d=y.QuerySetAliasActionTypes||={});let U;(f=>(f.None="None",f.ActivateImportedActive="ActivateImportedActive"))(U=y.QuerysetImportActivation||={});let I;(_=>(_.Suspend="Suspend",_.Unsuspend="Unsuspend",_.ToggleSuspend="ToggleSuspend",_.Activate="Activate",_.Delete="Delete",_.DeleteQueriesAndWUs="DeleteQueriesAndWUs",_.RemoveAllAliases="RemoveAllAliases",_.ResetQueryStats="ResetQueryStats"))(I=y.QuerySetQueryActionTypes||={});let q;(m=>(m[m.DoNotActivateQuery=0]="DoNotActivateQuery",m[m.ActivateQuery=1]="ActivateQuery",m[m.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",m[m.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious"))(q=y.WUQueryActivationMode||={})})(w||={});var Xe=class extends S{constructor(e){super(e,"WsWorkunits","2")}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 ds=(f=>(f[f.Unknown=0]="Unknown",f[f.Compiled=1]="Compiled",f[f.Running=2]="Running",f[f.Completed=3]="Completed",f[f.Failed=4]="Failed",f[f.Archived=5]="Archived",f[f.Aborting=6]="Aborting",f[f.Aborted=7]="Aborted",f[f.Blocked=8]="Blocked",f[f.Submitted=9]="Submitted",f[f.Scheduled=10]="Scheduled",f[f.Compiling=11]="Compiling",f[f.Wait=12]="Wait",f[f.UploadingFiled=13]="UploadingFiled",f[f.DebugPaused=14]="DebugPaused",f[f.DebugRunning=15]="DebugRunning",f[f.Paused=16]="Paused",f[f.LAST=17]="LAST",f[f.NotFound=999]="NotFound",f))(ds||{}),fe;(e=>{let t;(d=>(d[d.Unknown=0]="Unknown",d[d.Compile=1]="Compile",d[d.Check=2]="Check",d[d.Run=3]="Run",d[d.ExecuteExisting=4]="ExecuteExisting",d[d.Pause=5]="Pause",d[d.PauseNow=6]="PauseNow",d[d.Resume=7]="Resume",d[d.Debug=8]="Debug",d[d.__size=9]="__size"))(t=e.Action||={})})(fe||={});function Fr(t){return typeof t.Name=="string"}function Rp(t){return t.TotalClusterTime!==void 0}function Cp(t){return t.StateEx!==void 0}var N=class extends Xe{constructor(e){super(e)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}Ping(){return this._connection.send("Ping",{},"json",!1,void 0,"WsWorkunitsPingResponse").then(e=>({result:!0})).catch(e=>({result:!1,error:e}))}WUQuery(e={},s){return this._connection.send("WUQuery",e,"json",!1,s).then(r=>ot({Workunits:{ECLWorkunit:[]}},r))}WUInfo(e){let s={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(s)}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,s){return this._connection.send("WUResult",e,"json",!1,s)}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(s=>{let n=rr(s.Result).children();return n.length?n[0]:null})}},Pt=class extends Xe{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};function Er(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function he(t,e){if((s=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var s,r=t.slice(0,s);return[r.length>1?r[0]+r.slice(2):r,+t.slice(s+1)]}function Tr(t){return t=he(Math.abs(t)),t?t[1]:NaN}function Ir(t,e){return function(s,r){for(var n=s.length,i=[],o=0,a=t[0],c=0;n>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),i.push(s.substring(n-=a,n+a)),!((c+=a+1)>r));)a=t[o=(o+1)%t.length];return i.reverse().join(e)}}function kr(t){return function(e){return e.replace(/[0-9]/g,function(s){return t[+s]})}}var bi=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ke(t){if(!(e=bi.exec(t)))throw new Error("invalid format: "+t);var e;return new fs({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Ke.prototype=fs.prototype;function fs(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}fs.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function _r(t){e:for(var e=t.length,s=1,r=-1,n;s<e;++s)switch(t[s]){case".":r=n=s;break;case"0":r===0&&(r=s),n=s;break;default:if(!+t[s])break e;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(n+1):t}var hs;function vr(t,e){var s=he(t,e);if(!s)return t+"";var r=s[0],n=s[1],i=n-(hs=Math.max(-8,Math.min(8,Math.floor(n/3)))*3)+1,o=r.length;return i===o?r:i>o?r+new Array(i-o+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+he(t,Math.max(0,e+i-1))[0]}function ms(t,e){var s=he(t,e);if(!s)return t+"";var r=s[0],n=s[1];return n<0?"0."+new Array(-n).join("0")+r:r.length>n+1?r.slice(0,n+1)+"."+r.slice(n+1):r+new Array(n-r.length+2).join("0")}var xs={"%":function(t,e){return(t*100).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:Er,e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return ms(t*100,e)},r:ms,s:vr,X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function Ss(t){return t}var Nr=Array.prototype.map,Mr=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function Lr(t){var e=t.grouping===void 0||t.thousands===void 0?Ss:Ir(Nr.call(t.grouping,Number),t.thousands+""),s=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",n=t.decimal===void 0?".":t.decimal+"",i=t.numerals===void 0?Ss:kr(Nr.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"-":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function p(l){l=Ke(l);var d=l.fill,U=l.align,I=l.sign,q=l.symbol,y=l.zero,x=l.width,ae=l.comma,f=l.precision,R=l.trim,m=l.type;m==="n"?(ae=!0,m="g"):xs[m]||(f===void 0&&(f=12),R=!0,m="g"),(y||d==="0"&&U==="=")&&(y=!0,d="0",U="=");var M=q==="$"?s:q==="#"&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",B=q==="$"?r:/[%p]/.test(m)?o:"",ue=xs[m],_=/[defgprs%]/.test(m);f=f===void 0?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,f)):Math.max(0,Math.min(20,f));function rt(D){var J=M,F=B,Z,nt,be;if(m==="c")F=ue(D)+F,D="";else{D=+D;var Ue=D<0||1/D<0;if(D=isNaN(D)?c:ue(Math.abs(D),f),R&&(D=_r(D)),Ue&&+D==0&&I!=="+"&&(Ue=!1),J=(Ue?I==="("?I:a:I==="-"||I==="("?"":I)+J,F=(m==="s"?Mr[8+hs/3]:"")+F+(Ue&&I==="("?")":""),_){for(Z=-1,nt=D.length;++Z<nt;)if(be=D.charCodeAt(Z),48>be||be>57){F=(be===46?n+D.slice(Z+1):D.slice(Z))+F,D=D.slice(0,Z);break}}}ae&&!y&&(D=e(D,1/0));var Pe=J.length+D.length+F.length,j=Pe<x?new Array(x-Pe+1).join(d):"";switch(ae&&y&&(D=e(j+D,j.length?x-F.length:1/0),j=""),U){case"<":D=J+D+F+j;break;case"=":D=J+j+D+F;break;case"^":D=j.slice(0,Pe=j.length>>1)+J+D+F+j.slice(Pe);break;default:D=j+J+D+F;break}return i(D)}return rt.toString=function(){return l+""},rt}function u(l,d){var U=p((l=Ke(l),l.type="f",l)),I=Math.max(-8,Math.min(8,Math.floor(Tr(d)/3)))*3,q=Math.pow(10,-I),y=Mr[8+I/3];return function(x){return U(q*x)+y}}return{format:p,formatPrefix:u}}var Ft,Ie,Ar;ys({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function ys(t){return Ft=Lr(t),Ie=Ft.format,Ar=Ft.formatPrefix,Ft}var Ws=new Date,Ds=new Date;function A(t,e,s,r){function n(i){return t(i=arguments.length===0?new Date:new Date(+i)),i}return n.floor=function(i){return t(i=new Date(+i)),i},n.ceil=function(i){return t(i=new Date(i-1)),e(i,1),t(i),i},n.round=function(i){var o=n(i),a=n.ceil(i);return i-o<a-i?o:a},n.offset=function(i,o){return e(i=new Date(+i),o==null?1:Math.floor(o)),i},n.range=function(i,o,a){var c=[],p;if(i=n.ceil(i),a=a==null?1:Math.floor(a),!(i<o)||!(a>0))return c;do c.push(p=new Date(+i)),e(i,a),t(i);while(p<i&&i<o);return c},n.filter=function(i){return A(function(o){if(o>=o)for(;t(o),!i(o);)o.setTime(o-1)},function(o,a){if(o>=o)if(a<0)for(;++a<=0;)for(;e(o,-1),!i(o););else for(;--a>=0;)for(;e(o,1),!i(o););})},s&&(n.count=function(i,o){return Ws.setTime(+i),Ds.setTime(+o),t(Ws),t(Ds),Math.floor(s(Ws,Ds))},n.every=function(i){return i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?n.filter(r?function(o){return r(o)%i===0}:function(o){return n.count(0,o)%i===0}):n}),n}var Et=6e4;var Tt=864e5,It=6048e5;var wr=A(function(t){t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Et)/Tt},function(t){return t.getDate()-1}),kt=wr,Ui=wr.range;function me(t){return A(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(e,s){e.setDate(e.getDate()+s*7)},function(e,s){return(s-e-(s.getTimezoneOffset()-e.getTimezoneOffset())*Et)/It})}var He=me(0),ke=me(1),Gr=me(2),Qr=me(3),se=me(4),Vr=me(5),Or=me(6),qr=He.range,Pi=ke.range,Fi=Gr.range,Ei=Qr.range,Ti=se.range,Ii=Vr.range,ki=Or.range;var Rs=A(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});Rs.every=function(t){return!isFinite(t=Math.floor(t))||!(t>0)?null:A(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,s){e.setFullYear(e.getFullYear()+s*t)})};var xe=Rs,_i=Rs.range;var Br=A(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/Tt},function(t){return t.getUTCDate()-1}),_t=Br,vi=Br.range;function Se(t){return A(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},function(e,s){e.setUTCDate(e.getUTCDate()+s*7)},function(e,s){return(s-e)/It})}var Je=Se(0),_e=Se(1),jr=Se(2),Xr=Se(3),re=Se(4),Kr=Se(5),Hr=Se(6),Jr=Je.range,Ni=_e.range,Mi=jr.range,Li=Xr.range,Ai=re.range,wi=Kr.range,Gi=Hr.range;var Cs=A(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});Cs.every=function(t){return!isFinite(t=Math.floor(t))||!(t>0)?null:A(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,s){e.setUTCFullYear(e.getUTCFullYear()+s*t)})};var ye=Cs,Qi=Cs.range;function bs(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Us(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function $e(t,e,s){return{y:t,m:e,d:s,H:0,M:0,S:0,L:0}}function Ps(t){var e=t.dateTime,s=t.date,r=t.time,n=t.periods,i=t.days,o=t.shortDays,a=t.months,c=t.shortMonths,p=ze(n),u=Ze(n),l=ze(i),d=Ze(i),U=ze(o),I=Ze(o),q=ze(a),y=Ze(a),x=ze(c),ae=Ze(c),f={a:Ue,A:Pe,b:j,B:Tn,c:null,d:tn,e:tn,f:co,g:Wo,G:Ro,H:oo,I:ao,j:uo,L:an,m:lo,M:po,p:In,q:kn,Q:nn,s:on,S:go,u:fo,U:ho,V:mo,w:xo,W:So,x:null,X:null,y:yo,Y:Do,Z:Co,"%":rn},R={a:_n,A:vn,b:Nn,B:Mn,c:null,d:sn,e:sn,f:Fo,g:Ao,G:Go,H:bo,I:Uo,j:Po,L:cn,m:Eo,M:To,p:Ln,q:An,Q:nn,s:on,S:Io,u:ko,U:_o,V:vo,w:No,W:Mo,x:null,X:null,y:Lo,Y:wo,Z:Qo,"%":rn},m={a:rt,A:D,b:J,B:F,c:Z,d:Yr,e:Yr,f:so,g:Zr,G:zr,H:en,I:en,j:Zi,L:to,m:zi,M:Yi,p:_,q:$i,Q:no,s:io,S:eo,u:ji,U:Xi,V:Ki,w:Bi,W:Hi,x:nt,X:be,y:Zr,Y:zr,Z:Ji,"%":ro};f.x=M(s,f),f.X=M(r,f),f.c=M(e,f),R.x=M(s,R),R.X=M(r,R),R.c=M(e,R);function M(h,W){return function(C){var g=[],G=-1,E=0,Q=h.length,V,ce,Xs;for(C instanceof Date||(C=new Date(+C));++G<Q;)h.charCodeAt(G)===37&&(g.push(h.slice(E,G)),(ce=$r[V=h.charAt(++G)])!=null?V=h.charAt(++G):ce=V==="e"?" ":"0",(Xs=W[V])&&(V=Xs(C,ce)),g.push(V),E=G+1);return g.push(h.slice(E,G)),g.join("")}}function B(h,W){return function(C){var g=$e(1900,void 0,1),G=ue(g,h,C+="",0),E,Q;if(G!=C.length)return null;if("Q"in g)return new Date(g.Q);if("s"in g)return new Date(g.s*1e3+("L"in g?g.L:0));if(W&&!("Z"in g)&&(g.Z=0),"p"in g&&(g.H=g.H%12+g.p*12),g.m===void 0&&(g.m="q"in g?g.q:0),"V"in g){if(g.V<1||g.V>53)return null;"w"in g||(g.w=1),"Z"in g?(E=Us($e(g.y,0,1)),Q=E.getUTCDay(),E=Q>4||Q===0?_e.ceil(E):_e(E),E=_t.offset(E,(g.V-1)*7),g.y=E.getUTCFullYear(),g.m=E.getUTCMonth(),g.d=E.getUTCDate()+(g.w+6)%7):(E=bs($e(g.y,0,1)),Q=E.getDay(),E=Q>4||Q===0?ke.ceil(E):ke(E),E=kt.offset(E,(g.V-1)*7),g.y=E.getFullYear(),g.m=E.getMonth(),g.d=E.getDate()+(g.w+6)%7)}else("W"in g||"U"in g)&&("w"in g||(g.w="u"in g?g.u%7:"W"in g?1:0),Q="Z"in g?Us($e(g.y,0,1)).getUTCDay():bs($e(g.y,0,1)).getDay(),g.m=0,g.d="W"in g?(g.w+6)%7+g.W*7-(Q+5)%7:g.w+g.U*7-(Q+6)%7);return"Z"in g?(g.H+=g.Z/100|0,g.M+=g.Z%100,Us(g)):bs(g)}}function ue(h,W,C,g){for(var G=0,E=W.length,Q=C.length,V,ce;G<E;){if(g>=Q)return-1;if(V=W.charCodeAt(G++),V===37){if(V=W.charAt(G++),ce=m[V in $r?W.charAt(G++):V],!ce||(g=ce(h,C,g))<0)return-1}else if(V!=C.charCodeAt(g++))return-1}return g}function _(h,W,C){var g=p.exec(W.slice(C));return g?(h.p=u[g[0].toLowerCase()],C+g[0].length):-1}function rt(h,W,C){var g=U.exec(W.slice(C));return g?(h.w=I[g[0].toLowerCase()],C+g[0].length):-1}function D(h,W,C){var g=l.exec(W.slice(C));return g?(h.w=d[g[0].toLowerCase()],C+g[0].length):-1}function J(h,W,C){var g=x.exec(W.slice(C));return g?(h.m=ae[g[0].toLowerCase()],C+g[0].length):-1}function F(h,W,C){var g=q.exec(W.slice(C));return g?(h.m=y[g[0].toLowerCase()],C+g[0].length):-1}function Z(h,W,C){return ue(h,e,W,C)}function nt(h,W,C){return ue(h,s,W,C)}function be(h,W,C){return ue(h,r,W,C)}function Ue(h){return o[h.getDay()]}function Pe(h){return i[h.getDay()]}function j(h){return c[h.getMonth()]}function Tn(h){return a[h.getMonth()]}function In(h){return n[+(h.getHours()>=12)]}function kn(h){return 1+~~(h.getMonth()/3)}function _n(h){return o[h.getUTCDay()]}function vn(h){return i[h.getUTCDay()]}function Nn(h){return c[h.getUTCMonth()]}function Mn(h){return a[h.getUTCMonth()]}function Ln(h){return n[+(h.getUTCHours()>=12)]}function An(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var W=M(h+="",f);return W.toString=function(){return h},W},parse:function(h){var W=B(h+="",!1);return W.toString=function(){return h},W},utcFormat:function(h){var W=M(h+="",R);return W.toString=function(){return h},W},utcParse:function(h){var W=B(h+="",!0);return W.toString=function(){return h},W}}}var $r={"-":"",_:" ",0:"0"},v=/^\s*\d+/,Vi=/^%/,Oi=/[\\^$*+?|[\]().{}]/g;function b(t,e,s){var r=t<0?"-":"",n=(r?-t:t)+"",i=n.length;return r+(i<s?new Array(s-i+1).join(e)+n:n)}function qi(t){return t.replace(Oi,"\\$&")}function ze(t){return new RegExp("^(?:"+t.map(qi).join("|")+")","i")}function Ze(t){for(var e={},s=-1,r=t.length;++s<r;)e[t[s].toLowerCase()]=s;return e}function Bi(t,e,s){var r=v.exec(e.slice(s,s+1));return r?(t.w=+r[0],s+r[0].length):-1}function ji(t,e,s){var r=v.exec(e.slice(s,s+1));return r?(t.u=+r[0],s+r[0].length):-1}function Xi(t,e,s){var r=v.exec(e.slice(s,s+2));return r?(t.U=+r[0],s+r[0].length):-1}function Ki(t,e,s){var r=v.exec(e.slice(s,s+2));return r?(t.V=+r[0],s+r[0].length):-1}function Hi(t,e,s){var r=v.exec(e.slice(s,s+2));return r?(t.W=+r[0],s+r[0].length):-1}function zr(t,e,s){var r=v.exec(e.slice(s,s+4));return r?(t.y=+r[0],s+r[0].length):-1}function Zr(t,e,s){var r=v.exec(e.slice(s,s+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),s+r[0].length):-1}function Ji(t,e,s){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(s,s+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),s+r[0].length):-1}function $i(t,e,s){var r=v.exec(e.slice(s,s+1));return r?(t.q=r[0]*3-3,s+r[0].length):-1}function zi(t,e,s){var r=v.exec(e.slice(s,s+2));return r?(t.m=r[0]-1,s+r[0].length):-1}function Yr(t,e,s){var r=v.exec(e.slice(s,s+2));return r?(t.d=+r[0],s+r[0].length):-1}function Zi(t,e,s){var r=v.exec(e.slice(s,s+3));return r?(t.m=0,t.d=+r[0],s+r[0].length):-1}function en(t,e,s){var r=v.exec(e.slice(s,s+2));return r?(t.H=+r[0],s+r[0].length):-1}function Yi(t,e,s){var r=v.exec(e.slice(s,s+2));return r?(t.M=+r[0],s+r[0].length):-1}function eo(t,e,s){var r=v.exec(e.slice(s,s+2));return r?(t.S=+r[0],s+r[0].length):-1}function to(t,e,s){var r=v.exec(e.slice(s,s+3));return r?(t.L=+r[0],s+r[0].length):-1}function so(t,e,s){var r=v.exec(e.slice(s,s+6));return r?(t.L=Math.floor(r[0]/1e3),s+r[0].length):-1}function ro(t,e,s){var r=Vi.exec(e.slice(s,s+1));return r?s+r[0].length:-1}function no(t,e,s){var r=v.exec(e.slice(s));return r?(t.Q=+r[0],s+r[0].length):-1}function io(t,e,s){var r=v.exec(e.slice(s));return r?(t.s=+r[0],s+r[0].length):-1}function tn(t,e){return b(t.getDate(),e,2)}function oo(t,e){return b(t.getHours(),e,2)}function ao(t,e){return b(t.getHours()%12||12,e,2)}function uo(t,e){return b(1+kt.count(xe(t),t),e,3)}function an(t,e){return b(t.getMilliseconds(),e,3)}function co(t,e){return an(t,e)+"000"}function lo(t,e){return b(t.getMonth()+1,e,2)}function po(t,e){return b(t.getMinutes(),e,2)}function go(t,e){return b(t.getSeconds(),e,2)}function fo(t){var e=t.getDay();return e===0?7:e}function ho(t,e){return b(He.count(xe(t)-1,t),e,2)}function un(t){var e=t.getDay();return e>=4||e===0?se(t):se.ceil(t)}function mo(t,e){return t=un(t),b(se.count(xe(t),t)+(xe(t).getDay()===4),e,2)}function xo(t){return t.getDay()}function So(t,e){return b(ke.count(xe(t)-1,t),e,2)}function yo(t,e){return b(t.getFullYear()%100,e,2)}function Wo(t,e){return t=un(t),b(t.getFullYear()%100,e,2)}function Do(t,e){return b(t.getFullYear()%1e4,e,4)}function Ro(t,e){var s=t.getDay();return t=s>=4||s===0?se(t):se.ceil(t),b(t.getFullYear()%1e4,e,4)}function Co(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+b(e/60|0,"0",2)+b(e%60,"0",2)}function sn(t,e){return b(t.getUTCDate(),e,2)}function bo(t,e){return b(t.getUTCHours(),e,2)}function Uo(t,e){return b(t.getUTCHours()%12||12,e,2)}function Po(t,e){return b(1+_t.count(ye(t),t),e,3)}function cn(t,e){return b(t.getUTCMilliseconds(),e,3)}function Fo(t,e){return cn(t,e)+"000"}function Eo(t,e){return b(t.getUTCMonth()+1,e,2)}function To(t,e){return b(t.getUTCMinutes(),e,2)}function Io(t,e){return b(t.getUTCSeconds(),e,2)}function ko(t){var e=t.getUTCDay();return e===0?7:e}function _o(t,e){return b(Je.count(ye(t)-1,t),e,2)}function ln(t){var e=t.getUTCDay();return e>=4||e===0?re(t):re.ceil(t)}function vo(t,e){return t=ln(t),b(re.count(ye(t),t)+(ye(t).getUTCDay()===4),e,2)}function No(t){return t.getUTCDay()}function Mo(t,e){return b(_e.count(ye(t)-1,t),e,2)}function Lo(t,e){return b(t.getUTCFullYear()%100,e,2)}function Ao(t,e){return t=ln(t),b(t.getUTCFullYear()%100,e,2)}function wo(t,e){return b(t.getUTCFullYear()%1e4,e,4)}function Go(t,e){var s=t.getUTCDay();return t=s>=4||s===0?re(t):re.ceil(t),b(t.getUTCFullYear()%1e4,e,4)}function Qo(){return"+0000"}function rn(){return"%"}function nn(t){return+t}function on(t){return Math.floor(+t/1e3)}var ve,pn,gn,vt,Nt;Fs({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 Fs(t){return ve=Ps(t),pn=ve.format,gn=ve.parse,vt=ve.utcFormat,Nt=ve.utcParse,ve}var Mt=class extends P{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,s,r){super(),this.wu=e;let n=0;for(let i of r)if(i.GraphName===s.Name&&!i.HasSubGraphId){n=Math.round(i.Seconds*1e3)/1e3;break}this.set({Time:n,...s})}fetchScopeGraph(e){return e?this.wu.fetchGraphDetails([e],["subgraph"]).then(s=>wt(s)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(s=>wt(s))}},Lt=class extends T{constructor(){super(e=>T.hash([e.Name]))}};function yn(t,e,s){s=s||[],s.push(t),e(t.name,t.$,t.children(),s),t.children().forEach(r=>{yn(r,e,s)}),s.pop()}function Es(t){let e={};return t.forEach(s=>{s.name==="att"&&(e[s.$.name]=s.$.value)}),e}var Ts=class extends os{},dn=class extends Fe{},fn=class extends Ee{},hn=class extends Le{};function Wn(t,e){let s={},r={},n={},i=new Ts(a=>a._.id),o=[i.root];return yn(e,(a,c,p,u)=>{let l=o[o.length-1];switch(a){case"graph":break;case"node":if(p.length&&p[0].children().length&&p[0].children()[0].name==="graph"){let I=l.createSubgraph(Es(p));o.push(I),s[c.id]=I}let d=l.createVertex(Es(p));r[c.id]=d;break;case"edge":let U=l.createEdge(r[c.source],r[c.target],Es(p));n[c.id]=U;break;default:}}),i}var At=class extends os{},mn=class extends Fe{},xn=class extends Ee{},Sn=class extends Le{};function wt(t){let e={},s={},r={},n;for(let i of t)switch(i.ScopeType){case"graph":n=new At(u=>u._.Id,i),e[i.ScopeName]=n.root;break;case"subgraph":n||(n=new At(u=>u._.Id,i),e[i.ScopeName]=n.root);let o=i.parentScope().split(":"),a=e[i.parentScope()];for(;o.length&&!a;)a=e[o.join(":")],o.pop();if(!a)console.warn(`Missing SG:Parent (${i.Id}): ${i.parentScope()}`);else{let u=a;e[i.ScopeName]=u.createSubgraph(i)}break;case"activity":let c=e[i.parentScope()];c?r[i.ScopeName]=c.createVertex(i):console.warn(`Missing A:Parent (${i.Id}): ${i.parentScope()}`);break;case"edge":s[i.ScopeName]=i;break;case"function":let p=r[i.parentScope()];p?p._.children().push(i):console.warn(`Missing F:Parent (${i.Id}): ${i.parentScope()}`);break}for(let i in s){let o=s[i],a=e[o.parentScope()];if(!a)console.warn(`Missing E:Parent (${o.Id}): ${o.parentScope()}`);else{let c=a;try{let p=n.vertex(o.attr("IdSource").RawValue),u=n.vertex(o.attr("IdTarget").RawValue);c.createEdge(p,u,o)}catch{console.warn(`Invalid Edge: ${i}`)}}}return n}var Gt=class extends P{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,s){super(),this.wu=e;let r=s.split("\\").join("/"),n=r.split("/"),i="res/"+this.wu.Wuid+"/",o="",a="";r.indexOf(i)===0&&(o=r.substr(i.length),a=n[n.length-1]),this.set({URL:s,DisplayName:a,DisplayPath:o})}};var Qt=class{e;constructor(e){this.e=e}fix(){delete this.e}},Vt=class extends Qt{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 s=this._children.length-1;s>=0;--s){let r=this._children[s];r.name==="Row"&&r.type===void 0&&(this._children.push(...r._children),this._children.splice(s,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 s="0123456789",r=this.type.lastIndexOf("_"),n=r>0?r:this.type.length,i=n-1;for(;i>=0&&s.indexOf(this.type.charAt(i))!==-1;--i);i+1<n&&(e=parseInt(this.type.substring(i+1,n),10)),this.type.indexOf("data")===0&&(e*=2);break}return e<this.name.length&&(e=this.name.length),e}},Ot=class extends Qt{name;type;maxLength;_restricition;_maxLength;constructor(e){super(e)}append(e){switch(e.name){case"xs:restriction":this._restricition=e;break;case"xs:maxLength":this._maxLength=e;break;default:}}fix(){this.name=this.e.$.name,this.type=this._restricition.$.base,this.maxLength=this._maxLength?+this._maxLength.$.value:void 0,delete this._restricition,delete this._maxLength,super.fix()}},qt=class{root;simpleTypes={};fields(){return this.root.children()}},Bt=class extends cs{schema=new qt;simpleType;simpleTypes={};xsdStack=new Ae;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":let s=new Vt(e);this.schema.root?this.xsdStack.depth()&&this.xsdStack.top().append(s):this.schema.root=s,this.xsdStack.push(s);break;case"xs:simpleType":this.simpleType=new Ot(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 r=this.xsdStack.top();for(let n in e.$)r.attrs[n]=e.$[n];break;default:this.simpleType&&this.simpleType.append(e)}super.endXMLNode(e)}};function ks(t){let e=new Bt;return e.parse(t),e.schema}var Is=class extends Bt{_rootName;schema=new qt;simpleTypes={};xsdStack=new Ae;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":let s=new Vt(e);!this.schema.root&&this._rootName===e.$.name&&(this.schema.root=s),this.xsdStack.depth()&&this.xsdStack.top().append(s),this.xsdStack.push(s);break;case"xsd:simpleType":this.simpleType=new Ot(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 Gg(t,e){let s=new Is(e);return s.parse(t),s.schema}var _s=class extends T{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}},jt=new _s,Xt=class t extends P{connection;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,s,r,n){let i;return Array.isArray(n)?(i=jt.get({BaseUrl:e.baseUrl,Wuid:s,ResultName:r.Name},()=>new t(e,s,r,n)),i.set(r)):typeof n>"u"&&(typeof r=="number"?i=jt.get({BaseUrl:e.baseUrl,Wuid:s,ResultName:"Sequence_"+r},()=>new t(e,s,r)):typeof r=="string"&&(i=jt.get({BaseUrl:e.baseUrl,Wuid:s,ResultName:r},()=>new t(e,s,r)))),i}static attachLogicalFile(e,s,r){return jt.get({BaseUrl:e.baseUrl,Wuid:s,ResultName:r},()=>new t(e,s,r,!0))}constructor(e,s,r,n){super(),e instanceof N?this.connection=e:this.connection=new N(e),typeof n=="boolean"&&n===!0?this.set({NodeGroup:s,LogicalFileName:r}):Fr(r)&&Array.isArray(n)?this.set({...r,Wuid:s,ResultName:r.Name,ResultViews:n}):typeof n>"u"?typeof r=="number"?this.set({Wuid:s,ResultSequence:r}):typeof r=="string"?this.set({Wuid:s,ResultName:r}):console.warn("Unknown Result.attach (1)"):console.warn("Unknown Result.attach (2)")}isComplete(){return this.Total!==-1}_fetchXMLSchemaPromise;fetchXMLSchema(e=!1){return(!this._fetchXMLSchemaPromise||e)&&(this._fetchXMLSchemaPromise=this.WUResult().then(s=>s.Result?.XmlSchema?.xml?(this.xsdSchema=ks(s.Result.XmlSchema.xml),this.xsdSchema):null)),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(e=0,s=-1,r=!1,n={},i){return this.WUResult(e,s,!r,n,i).then(o=>{let a=o.Result;return delete o.Result,this.set({...o}),$("XmlSchema.xml",a)&&(this.xsdSchema=ks(a.XmlSchema.xml)),$("Row",a)?a.Row:this.ResultName&&$(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,s=1,r=!1,n={},i){let o={NamedValue:{itemcount:0}};for(let c in n)o.NamedValue[o.NamedValue.itemcount++]={Name:c,Value:n[c]};let a={FilterBy:o};return this.Wuid&&this.ResultName!==void 0?(a.Wuid=this.Wuid,a.ResultName=this.ResultName):this.Wuid&&this.ResultSequence!==void 0?(a.Wuid=this.Wuid,a.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(a.LogicalName=this.LogicalFileName,a.Cluster=this.NodeGroup):this.LogicalFileName&&(a.LogicalName=this.LogicalFileName),a.Start=e,a.Count=s,a.SuppressXmlSchema=r,this.connection.WUResult(a,i).then(c=>c)}},Kt=class extends T{constructor(){super(e=>T.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};var We=class extends P{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,s){super(),this.scope=e,this.set(s)}},vs=class extends P{_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=[],s={start:null,end:null};return this.Properties.Property.forEach(r=>{r.Measure==="ts"&&r.Name.indexOf("Started")>=0?s.start=r:this.ScopeName&&r.Measure==="ts"&&r.Name.indexOf("Finished")>=0?s.end=r:e.push(new We(this,r))}),s.start&&s.end?(s.start.FormattedEnd=s.end.Formatted,e.push(new We(this,s.start))):s.start?e.push(new We(this,s.start)):s.end&&e.push(new We(this,s.end)),e}constructor(e){super(),this.update(e)}update(e){this.set(e),this.CAttributes.forEach(s=>{this._attributeMap[s.Name]=s}),this.Properties.Property=[];for(let s in this._attributeMap)this._attributeMap.hasOwnProperty(s)&&this.Properties.Property.push(this._attributeMap[s].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 s of this.children())if(s.walk(e))return!0;return e.end(this)}formattedAttrs(){let e={};for(let s in this._attributeMap)e[s]=this._attributeMap[s].Formatted||this._attributeMap[s].RawValue;return e}rawAttrs(){let e={};for(let s in this._attributeMap)e[s]=this._attributeMap[s].RawValue;return e}hasAttr(e){return this._attributeMap[e]!==void 0}attr(e){return this._attributeMap[e]||new We(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let s="",r=[];s=this.Id,r.push(`<tr><td class="key">ID:</td><td class="value">${this.Id}</td></tr>`),e&&r.push(`<tr><td class="key">Parent ID:</td><td class="value">${e.Id}</td></tr>`),r.push(`<tr><td class="key">Scope:</td><td class="value">${this.ScopeName}</td></tr>`);let n=this.formattedAttrs();for(let i in n)i==="Label"?s=n[i]:r.push(`<tr><td class="key">${i}</td><td class="value">${n[i]}</td></tr>`);return`<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">
|
|
2
|
-
<h4 align="center">${
|
|
1
|
+
var Rr=Object.defineProperty;var o=(s,e)=>Rr(s,"name",{value:e,configurable:!0});var Ra="@hpcc-js/comms",Da="3.2.0",Ca="3.2.0";import{join as $e}from"@hpcc-js/util";import{join as Kt,promiseTimeout as Dr,scopedLogger as Cr}from"@hpcc-js/util";var Gs=Cr("comms/connection.ts");function ba(s){return"baseUrl"in s}o(ba,"instanceOfIOptions");var Ur={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function Fa(s){return typeof s.opts=="function"&&typeof s.send=="function"&&typeof s.clone=="function"}o(Fa,"instanceOfIConnection");function B(s,e){return e===void 0||e===!0?encodeURIComponent(s):""+s}o(B,"encode");function oe(s,e=!0,t=""){if(t&&(t+="."),typeof s!="object")return B(s,e);let n=[];for(let r in s)if(s.hasOwnProperty(r))if(s[r]instanceof Array){let i=!1;s[r].forEach((a,u)=>{typeof a=="object"?(i=!0,n.push(oe(a,e,t+B(`${r}.${u}`,e)))):n.push(t+B(`${r}_i${u}`,e)+"="+oe(a,e))}),i&&n.push(t+B(`${r}.itemcount`,e)+"="+s[r].length)}else typeof s[r]=="object"?s[r]&&s[r].Item instanceof Array?(n.push(oe(s[r].Item,e,t+B(r,e))),n.push(t+B(`${r}.itemcount`,e)+"="+s[r].Item.length)):n.push(oe(s[r],e,t+B(r,e))):s[r]!==void 0?n.push(t+B(r,e)+"="+B(s[r],e)):n.push(t+B(r,e));return n.join("&")}o(oe,"serializeRequest");function Pr(s){return JSON.parse(s)}o(Pr,"deserializeResponse");function br(s,e,t={},n="json",r){return r&&console.warn("Header attributes ignored for JSONP connections"),new Promise((i,a)=>{let u=s.timeoutSecs*1e3,l=5e3,d="jsonp_callback_"+Math.round(Math.random()*999999);window[d]=function(E){u=0,b(),i(n==="json"&&typeof E=="string"?Pr(E):E)};let c=document.createElement("script"),p=Kt(s.baseUrl,e);p+=p.indexOf("?")>=0?"&":"?",c.src=p+"jsonp="+d+"&"+oe(t,s.encodeRequest),document.body.appendChild(c);let m=setInterval(function(){u<=0?clearInterval(m):(u-=l,u<=0?(clearInterval(m),Gs.error("Request timeout: "+c.src),b(),a(Error("Request timeout: "+c.src))):Gs.debug("Request pending ("+u/1e3+" sec): "+c.src))},l);function b(){delete window[d],document.body.removeChild(c)}o(b,"doCallback")})}o(br,"jsonp");function Fr(s){return s.userID?{Authorization:`Basic ${btoa(`${s.userID}:${s.password}`)}`}:{}}o(Fr,"authHeader");var He={};function Qs(s,e,t,n,r){n={...Fr(s),...n},t={credentials:He[s.baseUrl]?"omit":"include",...t,headers:n},fetch.__setGlobalDispatcher&&fetch.__setGlobalDispatcher(fetch.__defaultAgent),s.baseUrl.indexOf("https:")===0&&(s.rejectUnauthorized===!1&&fetch.__rejectUnauthorizedAgent?fetch.__setGlobalDispatcher?fetch.__setGlobalDispatcher(fetch.__rejectUnauthorizedAgent):t.agent=fetch.__rejectUnauthorizedAgent:fetch.__trustwaveAgent&&(t.agent=fetch.__trustwaveAgent));function i(a){if(a.ok)return r==="json"?a.json():a.text();throw new Error(a.statusText)}return o(i,"handleResponse"),Dr(s.timeoutSecs*1e3,fetch(Kt(s.baseUrl,e),t).then(i).catch(a=>(t.credentials=He[s.baseUrl]?"include":"omit",fetch(Kt(s.baseUrl,e),t).then(i).then(u=>(He[s.baseUrl]=!He[s.baseUrl],u)))))}o(Qs,"doFetch");function Tr(s,e,t,n="json",r){t.upload_&&(delete t.upload_,e+="?upload_");let i;return t.abortSignal_&&(i=t.abortSignal_,delete t.abortSignal_),Qs(s,e,{method:"post",body:oe(t,s.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...r},n)}o(Tr,"post");function Er(s,e,t,n="json",r){let i;return t.abortSignal_&&(i=t.abortSignal_,delete t.abortSignal_),Qs(s,`${e}?${oe(t,s.encodeRequest)}`,{method:"get",signal:i},{...r},n)}o(Er,"get");function Ir(s,e,t,n="json",r){let i;switch(s.type){case"jsonp":i=br(s,e,t,n,r);break;case"get":i=Er(s,e,t,n,r);break;case"post":default:i=Tr(s,e,t,n,r);break}return i}o(Ir,"send");var Je=Ir;function Ta(s){let e=Je;return s&&(Je=s),e}o(Ta,"hookSend");var Ht=class s{static{o(this,"Connection")}_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return arguments.length===0?this._opts:(this._opts={...Ur,...e},this)}send(e,t,n="json",r){return this._opts.hookSend?this._opts.hookSend(this._opts,e,t,n,Je,r):Je(this._opts,e,t,n,r)}clone(){return new s(this.opts())}},ze=o(function(s){return new Ht(s)},"createConnection");function Ea(s){let e=ze;return ze=s,e}o(Ea,"setTransportFactory");function kr(s){return Object.prototype.toString.call(s)==="[object Array]"}o(kr,"isArray");var J=class extends Error{static{o(this,"ESPExceptions")}isESPExceptions=!0;action;request;Source;Exception;constructor(e,t,n){super("ESPException: "+n.Source),this.action=e,this.request=t,this.Source=n.Source,this.Exception=n.Exception,n.Exception.length?this.message=`${n.Exception[0].Code}: ${n.Exception[0].Message}`:this.message=""}};function wa(s){return s instanceof J||s.isESPExceptions&&Array.isArray(s.Exception)}o(wa,"isExceptions");function Nr(s){return s.send!==void 0}o(Nr,"isConnection");var Ie=class s{static{o(this,"ESPConnection")}_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,t,n){this._connection=Nr(e)?e:ze(e),this._service=t,this._version=n}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(kr(e[t])){for(let n=0;n<e[t].length;++n)e[t+"_i"+n]=e[t][n];delete e[t]}return e}opts(e){return e===void 0?this._connection.opts():(this._connection.opts(e),this)}send(e,t={},n="json",r=!1,i,a){let u={...t,ver_:this._version};r&&(u.upload_=!0),i&&(u.abortSignal_=i);let l,d="json";switch(n){case"text":l=$e(this._service,e),d="text";break;case"xsd":l=$e(this._service,e+".xsd"),d="text";break;case"json2":l=$e(this._service,e+"/json"),n="json",e=e.split("/").pop();break;default:l=$e(this._service,e+".json")}return this._connection.send(l,u,d).then(c=>{if(n==="json"){let p;if(c&&c.Exceptions)throw new J(e,u,c.Exceptions);if(c&&(p=c[a||e+"Response"]),!p)throw new J(e,u,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return p}return c}).catch(c=>{throw c.isESPExceptions?c:new J(e,u,{Source:"ESPConnection.send",Exception:[{Code:0,Message:c.message}]})})}clone(){return new s(this._connection.clone(),this._service,this._version)}},y=class{static{o(this,"Service")}_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,t,n){this._connection=new Ie(e,t,n)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};var ke;(e=>{let s;(l=>(l.Delete="Delete",l.Protect="Protect",l.Unprotect="Unprotect",l.Restore="Restore",l.SetToFailed="SetToFailed",l.Archive="Archive"))(s=e.DFUWUActions||={})})(ke||={});var Ze=class extends y{static{o(this,"FileSprayServiceBase")}constructor(e){super(e,"FileSpray","1.26")}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 Lr=(c=>(c[c.unknown=0]="unknown",c[c.scheduled=1]="scheduled",c[c.queued=2]="queued",c[c.started=3]="started",c[c.aborted=4]="aborted",c[c.failed=5]="failed",c[c.finished=6]="finished",c[c.monitoring=7]="monitoring",c[c.aborting=8]="aborting",c[c.notfound=999]="notfound",c))(Lr||{}),ae=class extends Ze{static{o(this,"FileSprayService")}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 Vs;(a=>{let s;(d=>(d.User="User",d.Group="Group"))(s=a.ViewMemberType||={});let e;(m=>(m.username="username",m.fullname="fullname",m.passwordexpiration="passwordexpiration",m.employeeID="employeeID",m.employeeNumber="employeeNumber"))(e=a.UserSortBy||={});let t;(d=>(d.Name="Name",d.ManagedBy="ManagedBy"))(t=a.GroupSortBy||={});let n;(c=>(c.Any="Any",c.User="User",c.Group="Group"))(n=a.AccountTypeReq||={});let r;(d=>(d.Name="Name",d.Type="Type"))(r=a.ResourcePermissionSortBy||={});let i;(l=>l.Name="Name")(i=a.ResourceSortBy||={})})(Vs||={});var Ye=class extends y{static{o(this,"AccessServiceBase")}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 qs=class extends Ye{static{o(this,"AccessService")}};var et=class extends y{static{o(this,"AccountServiceBase")}constructor(e){super(e,"ws_account","1.06")}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 Os=class extends et{static{o(this,"AccountService")}VerifyUser(e){return this._connection.send("VerifyUser",e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(n=>n.Code===20043))return{retcode:20043,Exceptions:{Source:"wsAccount",Exception:t.Exception}};throw t})}};var tt=class extends y{static{o(this,"CloudServiceBase")}constructor(e){super(e,"WsCloud","1")}GetPODs(e){return this._connection.send("GetPODs",e)}Ping(e){return this._connection.send("Ping",e)}};var Bs=class extends tt{static{o(this,"CloudService")}getPODs(){return super.GetPODs({}).then(e=>{try{return(typeof e.Result=="string"?JSON.parse(e.Result):e.Result)?.items??[]}catch{return[]}})}};var js=class{static{o(this,"CodesignService")}_connection;constructor(e){this._connection=new Ie(e,"ws_codesign","1.1")}connectionOptions(){return this._connection.opts()}ListUserIDs(e){return this._connection.send("ListUserIDs",e).then(t=>t.UserIDs.Item).catch(t=>[])}Sign(e){return this._connection.send("Sign",{SigningMethod:"gpg",...e})}Verify(e){return this._connection.send("Verify",e)}};var st=class extends y{static{o(this,"DaliServiceBase")}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 Xs=class extends st{static{o(this,"DaliService")}};var Re;(u=>{let s;(m=>(m.Delete="Delete",m.AddToSuperfile="Add To Superfile",m.ChangeProtection="Change Protection",m.ChangeRestriction="Change Restriction"))(s=u.DFUArrayActions||={});let e;(m=>(m[m.NoChange=0]="NoChange",m[m.Protect=1]="Protect",m[m.Unprotect=2]="Unprotect",m[m.UnprotectAll=3]="UnprotectAll"))(e=u.DFUChangeProtection||={});let t;(p=>(p[p.NoChange=0]="NoChange",p[p.Restrict=1]="Restrict",p[p.Unrestricted=2]="Unrestricted"))(t=u.DFUChangeRestriction||={});let n;(c=>(c.xml="xml",c.def="def"))(n=u.DFUDefFileFormat||={});let r;(p=>(p.Token="Token",p.Engine="Engine",p.External="External"))(r=u.FileAccessRole||={});let i;(b=>(b.None="None",b.Access="Access",b.Read="Read",b.Write="Write",b.Full="Full"))(i=u.SecAccessType||={});let a;(W=>(W.Flat="Flat",W.Index="Index",W.Xml="Xml",W.Csv="Csv",W.Json="Json",W.IndexLocal="IndexLocal",W.IndexPartitioned="IndexPartitioned",W.Unset="Unset"))(a=u.DFUFileType||={})})(Re||={});var nt=class extends y{static{o(this,"DfuServiceBase")}constructor(e){super(e,"WsDfu","1.65")}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")}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 bu=Re.DFUArrayActions,Fu=Re.DFUDefFileFormat,Tu=Re.DFUChangeProtection,Eu=Re.DFUChangeRestriction,Ne=class extends nt{static{o(this,"DFUService")}DFUFile(e){return this._connection.send("DFUDefFile",e,"text")}};var Ks=class extends y{static{o(this,"DFUXRefService")}constructor(e){super(e,"WsDFUXRef","1.01")}DFUXRefArrayAction(e){return this._connection.send("DFUXRefArrayAction",e)}DFUXRefBuild(e){return this._connection.send("DFUXRefBuild",e)}DFUXRefBuildCancel(e){return this._connection.send("DFUXRefBuildCancel",e)}DFUXRefCleanDirectories(e){return this._connection.send("DFUXRefCleanDirectories",e)}DFUXRefDirectories(e){return this._connection.send("DFUXRefDirectories",e,void 0,void 0,void 0,"DFUXRefDirectoriesQueryResponse")}DFUXRefFoundFiles(e){return this._connection.send("DFUXRefFoundFiles",e,void 0,void 0,void 0,"DFUXRefFoundFilesQueryResponse")}DFUXRefList(e={}){return this._connection.send("DFUXRefList",e)}DFUXRefLostFiles(e){return this._connection.send("DFUXRefLostFiles",e,void 0,void 0,void 0,"DFUXRefLostFilesQueryResponse")}DFUXRefMessages(e){return this._connection.send("DFUXRefMessages",e,void 0,void 0,void 0,"DFUXRefMessagesQueryResponse")}DFUXRefOrphanFiles(e){return this._connection.send("DFUXRefOrphanFiles",e,void 0,void 0,void 0,"DFUXRefOrphanFilesQueryResponse")}DFUXRefUnusedFiles(e){return this._connection.send("DFUXRefUnusedFiles",e)}};function Hs(s,e){let t=typeof e;switch(t){case"boolean":case"number":case"string":return{id:s,type:t};case"object":if(e.Row instanceof Array&&(e=e.Row),e instanceof Array)return{id:s,type:"dataset",children:Jt(e[0])};if(e instanceof Object){if(e.Item&&e.Item instanceof Array&&e.Item.length===1){let n=typeof e.Item[0];if(n==="string"||n==="number")return{id:s,type:"set",fieldType:n};throw new Error("Unknown field type")}return{id:s,type:"object",fields:Ar(e)}}default:throw new Error("Unknown field type")}}o(Hs,"jsonToIField");function Jt(s){s.Row&&s.Row instanceof Array&&(s=s.Row[0]);let e=[];for(let t in s)e.push(Hs(t,s[t]));return e}o(Jt,"jsonToIFieldArr");function Ar(s){let e={};for(let t in s)e[t]=Hs(t,s[t]);return e}o(Ar,"jsonToIFieldObj");var rt=class extends y{static{o(this,"EclService")}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(n=>{let r=JSON.parse(n);for(let i in r)return r[i];return{}}).then(Jt)}responseJson(e,t){return this._connection.send(`example/response/query/${e}/${t}/json`,{},"text").then(n=>{let r=JSON.parse(n);for(let i in r)return r[i].Results;return{}}).then(n=>{let r={};for(let i in n)r[i]=Jt(n[i]);return r})}submit(e,t,n){let r=`submit/query/${e}/${t}`;return this._connection.send(r,n,"json2").then(i=>{if(i.Results&&i.Results.Exception)throw new J(r,n,{Source:"wsEcl.submit",Exception:i.Results.Exception});return i.Results})}};var it=class extends y{static{o(this,"ElkServiceBase")}constructor(e){super(e,"ws_elk","1")}GetConfigDetails(e){return this._connection.send("GetConfigDetails",e)}Ping(e){return this._connection.send("Ping",e)}};var Js=class extends it{static{o(this,"ElkService")}};import{scopedLogger as Mr}from"@hpcc-js/util";var I;(u=>{let s;(x=>(x.global="global",x.workunits="workunits",x.components="components",x.audience="audience",x.class="class",x.instance="instance",x.node="node",x.message="message",x.logid="logid",x.processid="processid",x.threadid="threadid",x.timestamp="timestamp",x.pod="pod"))(s=u.LogColumnType||={});let e;(m=>(m.string="string",m.numeric="numeric",m.datetime="datetime",m.enum="enum"))(e=u.LogColumnValueType||={});let t;(S=>(S[S.All=0]="All",S[S.ByJobID=1]="ByJobID",S[S.ByComponent=2]="ByComponent",S[S.ByLogType=3]="ByLogType",S[S.ByTargetAudience=4]="ByTargetAudience",S[S.BySourceInstance=5]="BySourceInstance",S[S.BySourceNode=6]="BySourceNode",S[S.ByFieldName=7]="ByFieldName",S[S.ByPod=8]="ByPod"))(t=u.LogAccessType||={});let n;(p=>(p[p.NONE=0]="NONE",p[p.AND=1]="AND",p[p.OR=2]="OR"))(n=u.LogAccessFilterOperator||={});let r;(m=>(m[m.MIN=0]="MIN",m[m.DEFAULT=1]="DEFAULT",m[m.ALL=2]="ALL",m[m.CUSTOM=3]="CUSTOM"))(r=u.LogSelectColumnMode||={});let i;(S=>(S[S.ByDate=0]="ByDate",S[S.ByJobID=1]="ByJobID",S[S.ByComponent=2]="ByComponent",S[S.ByLogType=3]="ByLogType",S[S.ByTargetAudience=4]="ByTargetAudience",S[S.BySourceInstance=5]="BySourceInstance",S[S.BySourceNode=6]="BySourceNode",S[S.ByFieldName=7]="ByFieldName",S[S.ByPod=8]="ByPod"))(i=u.SortColumType||={});let a;(c=>(c[c.ASC=0]="ASC",c[c.DSC=1]="DSC"))(a=u.SortDirection||={})})(I||={});var ot=class extends y{static{o(this,"LogaccessServiceBase")}constructor(e){super(e,"ws_logaccess","1.05")}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 zs=Mr("@hpcc-js/comms/services/wsLogaccess.ts");var vr=(a=>(a.Disaster="DIS",a.Error="ERR",a.Warning="WRN",a.Information="INF",a.Progress="PRO",a.Metric="MET",a))(vr||{}),wr=(r=>(r.Operator="OPR",r.User="USR",r.Programmer="PRO",r.Audit="ADT",r))(wr||{}),$s=class extends ot{static{o(this,"LogaccessService")}_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}async GetLogsEx(e){let t=await this.GetLogAccessInfo(),n={};t.Columns.Column.forEach(u=>n[u.LogType]=u.Name);let r=o(u=>{let l={};for(let d in n)u?.fields?l[d]=Object.assign({},...u.fields)[n[d]]??"":l[d]="";return l},"convertLogLine"),i={Filter:{leftBinaryFilter:{BinaryLogFilter:[{leftFilter:{LogCategory:I.LogAccessType.All}}]}},Range:{StartDate:new Date(0).toISOString()},LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:I.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:I.SortColumType.ByDate,ColumnName:"",Direction:0}]}},a=[];for(let u in e){let l;u in n&&(Object.values(I.LogColumnType).includes(u)?l=u:l=n[u]);let d;if(l){switch(l){case I.LogColumnType.workunits:case"hpcc.log.jobid":d=I.LogAccessType.ByJobID;break;case I.LogColumnType.audience:case"hpcc.log.audience":d=I.LogAccessType.ByTargetAudience;break;case I.LogColumnType.class:case"hpcc.log.class":d=I.LogAccessType.ByLogType;break;case I.LogColumnType.components:case"kubernetes.container.name":d=I.LogAccessType.ByComponent;break;default:d=I.LogAccessType.ByFieldName,l=n[u]}if(Array.isArray(e[u]))e[u].forEach(c=>{d===I.LogAccessType.ByComponent&&(c+="*"),a.push({LogCategory:d,SearchField:l,SearchByValue:c})});else{let c=e[u];d===I.LogAccessType.ByComponent&&(c+="*"),a.push({LogCategory:d,SearchField:l,SearchByValue:c})}}}if(a.length>2){let u=i.Filter.leftBinaryFilter.BinaryLogFilter[0];a.forEach((l,d)=>{let c=I.LogAccessFilterOperator.AND;d>0?(a[d-1].SearchField===l.SearchField&&(c=I.LogAccessFilterOperator.OR),d===a.length-1?(u.Operator=c,u.rightFilter=l):(u.Operator=c,u.rightBinaryFilter={BinaryLogFilter:[{leftFilter:l}]},u=u.rightBinaryFilter.BinaryLogFilter[0])):u.leftFilter=l})}else delete i.Filter.leftBinaryFilter,i.Filter.leftFilter={LogCategory:I.LogAccessType.All},a[0]?.SearchField&&(i.Filter.leftFilter={LogCategory:a[0]?.LogCategory,SearchField:a[0]?.SearchField,SearchByValue:a[0]?.SearchByValue}),a[1]?.SearchField&&(i.Filter.Operator=I.LogAccessFilterOperator.AND,a[0].SearchField===a[1].SearchField&&(i.Filter.Operator=I.LogAccessFilterOperator.OR),i.Filter.rightFilter={LogCategory:a[1]?.LogCategory,SearchField:a[1]?.SearchField,SearchByValue:a[1]?.SearchByValue});return e.StartDate&&(i.Range.StartDate=e.StartDate.toISOString()),e.EndDate&&(i.Range.EndDate=e.EndDate.toISOString()),this.GetLogs(i).then(u=>{try{let l=JSON.parse(u.LogLines),d=[];switch(t.RemoteLogManagerType){case"azureloganalyticscurl":case"elasticstack":case"grafanacurl":d=l.lines?.map(r)??[];break;default:zs.warning(`Unknown RemoteLogManagerType: ${t.RemoteLogManagerType}`),d=[]}return{lines:d,total:u.TotalLogLinesAvailable??1e4}}catch(l){zs.error(l.message??l)}return{lines:[],total:0}})}};import{exists as Zr}from"@hpcc-js/util";function K(s,e){return s<e?-1:s>e?1:s>=e?0:NaN}o(K,"default");function at(s){return s.length===1&&(s=_r(s)),{left:o(function(e,t,n,r){for(n==null&&(n=0),r==null&&(r=e.length);n<r;){var i=n+r>>>1;s(e[i],t)<0?n=i+1:r=i}return n},"left"),right:o(function(e,t,n,r){for(n==null&&(n=0),r==null&&(r=e.length);n<r;){var i=n+r>>>1;s(e[i],t)>0?r=i:n=i+1}return n},"right")}}o(at,"default");function _r(s){return function(e,t){return K(s(e),t)}}o(_r,"ascendingComparator");var Zs=at(K),Gr=Zs.right,Qr=Zs.left;function z(s){return s===null?NaN:+s}o(z,"default");var Ys=Array.prototype,qr=Ys.slice,Or=Ys.map;var kc=Math.sqrt(50),Nc=Math.sqrt(10),Lc=Math.sqrt(2);function De(s,e){var t=s.length,n=-1,r,i;if(e==null){for(;++n<t;)if((r=s[n])!=null&&r>=r)for(i=r;++n<t;)(r=s[n])!=null&&r>i&&(i=r)}else for(;++n<t;)if((r=e(s[n],n,s))!=null&&r>=r)for(i=r;++n<t;)(r=e(s[n],n,s))!=null&&r>i&&(i=r);return i}o(De,"default");function Ce(s,e){var t=s.length,n=t,r=-1,i,a=0;if(e==null)for(;++r<t;)isNaN(i=z(s[r]))?--n:a+=i;else for(;++r<t;)isNaN(i=z(e(s[r],r,s)))?--n:a+=i;if(n)return a/n}o(Ce,"default");var ut=class extends y{static{o(this,"MachineServiceBase")}constructor(e){super(e,"ws_machine","1.17")}GetComponentStatus(e){return this._connection.send("GetComponentStatus",e)}GetComponentUsage(e){return this._connection.send("GetComponentUsage",e)}GetMachineInfo(e){return this._connection.send("GetMachineInfo",e)}GetMachineInfoEx(e){return this._connection.send("GetMachineInfoEx",e)}GetMetrics(e){return this._connection.send("GetMetrics",e)}GetNodeGroupUsage(e){return this._connection.send("GetNodeGroupUsage",e)}GetTargetClusterInfo(e){return this._connection.send("GetTargetClusterInfo",e)}GetTargetClusterUsage(e){return this._connection.send("GetTargetClusterUsage",e)}Ping(e){return this._connection.send("Ping",e)}UpdateComponentStatus(e){return this._connection.send("UpdateComponentStatus",e)}};var $=class extends ut{static{o(this,"MachineService")}GetTargetClusterUsageEx(e,t=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:t}).then(n=>Zr("TargetClusterUsages.TargetClusterUsage",n)?n.TargetClusterUsages.TargetClusterUsage:[]).then(n=>n.filter(r=>!!r.ComponentUsages).map(r=>{let i=r.ComponentUsages.ComponentUsage.map(a=>{let u=(a.MachineUsages&&a.MachineUsages.MachineUsage?a.MachineUsages.MachineUsage:[]).map(l=>{let d=l.DiskUsages&&l.DiskUsages.DiskUsage?l.DiskUsages.DiskUsage.map(c=>({...c,InUse:c.InUse*1024,Total:(c.InUse+c.Available)*1024,PercentUsed:100-c.PercentAvailable})):[];return{Name:l.Name,NetAddress:l.NetAddress,Description:l.Description,DiskUsages:d,mean:Ce(d.filter(c=>!isNaN(c.PercentUsed)),c=>c.PercentUsed),max:De(d.filter(c=>!isNaN(c.PercentUsed)),c=>c.PercentUsed)}});return{Type:a.Type,Name:a.Name,Description:a.Description,MachineUsages:u,MachineUsagesDescription:u.reduce((l,d)=>l+(d.Description||""),""),mean:Ce(u.filter(l=>!isNaN(l.mean)),l=>l.mean),max:De(u.filter(l=>!isNaN(l.max)),l=>l.max)}});return{Name:r.Name,Description:r.Description,ComponentUsages:i,ComponentUsagesDescription:i.reduce((a,u)=>a+(u.MachineUsagesDescription||""),""),mean:Ce(i.filter(a=>!isNaN(a.mean)),a=>a.mean),max:De(i.filter(a=>!isNaN(a.max)),a=>a.max)}}))}};var ct=class extends y{static{o(this,"PackageProcessServiceBase")}constructor(e){super(e,"WsPackageProcess","1.04")}ActivatePackage(e){return this._connection.send("ActivatePackage",e)}AddPackage(e){return this._connection.send("AddPackage",e)}AddPartToPackageMap(e){return this._connection.send("AddPartToPackageMap",e)}CopyPackageMap(e){return this._connection.send("CopyPackageMap",e)}DeActivatePackage(e){return this._connection.send("DeActivatePackage",e)}DeletePackage(e){return this._connection.send("DeletePackage",e)}Echo(e){return this._connection.send("Echo",e)}GetPackage(e){return this._connection.send("GetPackage",e)}GetPackageMapById(e){return this._connection.send("GetPackageMapById",e)}GetPackageMapSelectOptions(e){return this._connection.send("GetPackageMapSelectOptions",e)}GetPartFromPackageMap(e){return this._connection.send("GetPartFromPackageMap",e)}GetQueryFileMapping(e){return this._connection.send("GetQueryFileMapping",e)}ListPackage(e){return this._connection.send("ListPackage",e)}ListPackages(e){return this._connection.send("ListPackages",e)}Ping(e){return this._connection.send("Ping",e)}RemovePartFromPackageMap(e){return this._connection.send("RemovePartFromPackageMap",e)}ValidatePackage(e){return this._connection.send("ValidatePackage",e)}};var tn=class extends ct{static{o(this,"PackageProcessService")}};var lt=class extends y{static{o(this,"ResourcesServiceBase")}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 sn=class extends lt{static{o(this,"ResourcesService")}};var nn;(e=>{let s;(r=>(r.ECL="ECL",r.DFU="DFU"))(s=e.WUTypes||={})})(nn||={});var pt=class extends y{static{o(this,"SashaServiceBase")}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 rn=class extends pt{static{o(this,"SashaService")}};var on;(t=>{let s;(l=>(l.ALL="ALL",l.READ="READ",l.WRITE="WRITE",l.HOLD="HOLD",l.SUB="SUB"))(s=t.LockModes||={});let e;(p=>(p.Attach="Attach",p.Detach="Detach",p.State="State",p.Reload="Reload",p.ReloadRetry="ReloadRetry",p.MemLock="MemLock",p.MemUnlock="MemUnlock",p.GetMemLocked="GetMemLocked"))(e=t.RoxieControlCmdType||={})})(on||={});var gt=class extends y{static{o(this,"SMCServiceBase")}constructor(e){super(e,"WsSMC","1.27")}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")}GetStatusServerInfo(e){return this._connection.send("GetStatusServerInfo",e,"json",!1,void 0,"GetStatusServerInfoResponse")}GetThorQueueAvailability(e){return this._connection.send("GetThorQueueAvailability",e,"json",!1,void 0,"GetThorQueueAvailabilityResponse")}Index(e){return this._connection.send("Index",e,"json",!1,void 0,"SMCIndexResponse")}LockQuery(e){return this._connection.send("LockQuery",e,"json",!1,void 0,"LockQueryResponse")}MoveJobBack(e){return this._connection.send("MoveJobBack",e,"json",!1,void 0,"SMCJobResponse")}MoveJobDown(e){return this._connection.send("MoveJobDown",e,"json",!1,void 0,"SMCJobResponse")}MoveJobFront(e){return this._connection.send("MoveJobFront",e,"json",!1,void 0,"SMCJobResponse")}MoveJobUp(e){return this._connection.send("MoveJobUp",e,"json",!1,void 0,"SMCJobResponse")}NotInCommunityEdition(e){return this._connection.send("NotInCommunityEdition",e,"json",!1,void 0,"NotInCommunityEditionResponse")}PauseQueue(e){return this._connection.send("PauseQueue",e,"json",!1,void 0,"SMCQueueResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsSMCPingResponse")}RemoveJob(e){return this._connection.send("RemoveJob",e,"json",!1,void 0,"SMCJobResponse")}ResumeQueue(e){return this._connection.send("ResumeQueue",e,"json",!1,void 0,"SMCQueueResponse")}RoxieControlCmd(e){return this._connection.send("RoxieControlCmd",e,"json",!1,void 0,"RoxieControlCmdResponse")}RoxieXrefCmd(e){return this._connection.send("RoxieXrefCmd",e,"json",!1,void 0,"RoxieXrefCmdResponse")}SetBanner(e){return this._connection.send("SetBanner",e,"json",!1,void 0,"SetBannerResponse")}SetJobPriority(e){return this._connection.send("SetJobPriority",e,"json",!1,void 0,"SMCPriorityResponse")}StopQueue(e){return this._connection.send("StopQueue",e,"json",!1,void 0,"SMCQueueResponse")}};var Le=class extends gt{static{o(this,"SMCService")}connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(t=>({Running:{ActiveWorkunit:[]},...t}))}};var Ae=class extends y{static{o(this,"StoreService")}constructor(e){super(e,"WsStore","1")}CreateStore(e){return this._connection.send("Fetch",e)}Delete(e){return this._connection.send("Delete",e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(n=>n.Code===-1))return{Exceptions:void 0,Success:!0};throw t})}DeleteNamespace(e){return this._connection.send("DeleteNamespace",e)}Fetch(e){return this._connection.send("Fetch",e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(n=>n.Code===-1))return{Exceptions:void 0,Value:void 0};throw t})}FetchAll(e){return this._connection.send("FetchAll",e)}FetchKeyMD(e){return this._connection.send("FetchKeyMD",e)}ListKeys(e){return this._connection.send("ListKeys",e)}ListNamespaces(e){return this._connection.send("ListNamespaces",e)}Set(e){return this._connection.send("Set",e)}};var an;(e=>{let s;(i=>(i.All="All",i.QueriesOnly="QueriesOnly",i.WorkunitsOnly="WorkunitsOnly"))(s=e.RoxieQueueFilter||={})})(an||={});var dt=class extends y{static{o(this,"TopologyServiceBase")}constructor(e){super(e,"WsTopology","1.32")}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")}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 M=class extends dt{static{o(this,"TopologyService")}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 n,r;return t.TpLogicalClusters.TpLogicalCluster.some((i,a)=>(a===0&&(r=i),i.Type==="hthor"?(n=i,!0):!1)),n||r})}};import{deepMixin as Yr,xml2json as ei}from"@hpcc-js/util";var w;(W=>{let s;(F=>(F.Abort="Abort",F.Delete="Delete",F.Deschedule="Deschedule",F.Reschedule="Reschedule",F.Pause="Pause",F.PauseNow="PauseNow",F.Protect="Protect",F.Unprotect="Unprotect",F.Restore="Restore",F.Resume="Resume",F.SetToFailed="SetToFailed",F.Archive="Archive"))(s=W.ECLWUActions||={});let e;(x=>(x[x.MIN=0]="MIN",x[x.DEFAULT=1]="DEFAULT",x[x.ALL=2]="ALL",x[x.CUSTOM=3]="CUSTOM"))(e=W.LogSelectColumnMode||={});let t;(f=>(f[f.ASC=0]="ASC",f[f.DSC=1]="DSC"))(t=W.SortDirection||={});let n;(k=>(k.ALL="ALL",k.DIS="DIS",k.ERR="ERR",k.WRN="WRN",k.INF="INF",k.PRO="PRO",k.MET="MET",k.EVT="EVT"))(n=W.LogEventClass||={});let r;(C=>(C.Single="Single",C.List="List",C.Multi="Multi"))(r=W.WUDetailsAttrValueType||={});let i;(C=>(C.SyntaxCheck="SyntaxCheck",C.Deploy="Deploy",C.Publish="Publish"))(i=W.EclDefinitionActions||={});let a;(C=>(C.xml="xml",C.json="json",C.text="text"))(a=W.ErrorMessageFormat||={});let u;(C=>(C[C.XML=0]="XML",C[C.JSON=1]="JSON",C[C.CSV=2]="CSV"))(u=W.LogAccessLogFormat||={});let l;(x=>(x.info="info",x.warning="warning",x.error="error",x.alert="alert"))(l=W.WUExceptionSeverity||={});let d;(q=>(q.Allqueries="All queries",q.Notsuspended="Not suspended",q.Suspended="Suspended",q.Suspendedbyuser="Suspended by user",q.Suspendedbyfirstnode="Suspended by first node",q.Suspendedbyanynode="Suspended by any node"))(d=W.WUQueryFilterSuspendedType||={});let c;(A=>(A.All="All",A.Id="Id",A.Name="Name",A.Alias="Alias",A.Status="Status"))(c=W.WUQuerySetFilterType||={});let p;(C=>(C.All="All",C.Protected="Protected",C.NotProtected="NotProtected"))(p=W.WUProtectFilter||={});let m;(ne=>ne.Deactivate="Deactivate")(m=W.QuerySetAliasActionTypes||={});let b;(f=>(f.None="None",f.ActivateImportedActive="ActivateImportedActive"))(b=W.QuerysetImportActivation||={});let E;(k=>(k.Suspend="Suspend",k.Unsuspend="Unsuspend",k.ToggleSuspend="ToggleSuspend",k.Activate="Activate",k.Delete="Delete",k.DeleteQueriesAndWUs="DeleteQueriesAndWUs",k.RemoveAllAliases="RemoveAllAliases",k.ResetQueryStats="ResetQueryStats"))(E=W.QuerySetQueryActionTypes||={});let V;(x=>(x[x.DoNotActivateQuery=0]="DoNotActivateQuery",x[x.ActivateQuery=1]="ActivateQuery",x[x.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",x[x.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious"))(V=W.WUQueryActivationMode||={})})(w||={});var Me=class extends y{static{o(this,"WorkunitsServiceBase")}constructor(e){super(e,"WsWorkunits","2")}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 zt=(f=>(f[f.Unknown=0]="Unknown",f[f.Compiled=1]="Compiled",f[f.Running=2]="Running",f[f.Completed=3]="Completed",f[f.Failed=4]="Failed",f[f.Archived=5]="Archived",f[f.Aborting=6]="Aborting",f[f.Aborted=7]="Aborted",f[f.Blocked=8]="Blocked",f[f.Submitted=9]="Submitted",f[f.Scheduled=10]="Scheduled",f[f.Compiling=11]="Compiling",f[f.Wait=12]="Wait",f[f.UploadingFiled=13]="UploadingFiled",f[f.DebugPaused=14]="DebugPaused",f[f.DebugRunning=15]="DebugRunning",f[f.Paused=16]="Paused",f[f.LAST=17]="LAST",f[f.NotFound=999]="NotFound",f))(zt||{}),ue;(e=>{let s;(m=>(m[m.Unknown=0]="Unknown",m[m.Compile=1]="Compile",m[m.Check=2]="Check",m[m.Run=3]="Run",m[m.ExecuteExisting=4]="ExecuteExisting",m[m.Pause=5]="Pause",m[m.PauseNow=6]="PauseNow",m[m.Resume=7]="Resume",m[m.Debug=8]="Debug",m[m.__size=9]="__size"))(s=e.Action||={})})(ue||={});function cn(s){return typeof s.Name=="string"}o(cn,"isECLResult");function Rg(s){return s.TotalClusterTime!==void 0}o(Rg,"isWUQueryECLWorkunit");function Dg(s){return s.StateEx!==void 0}o(Dg,"isWUInfoWorkunit");var L=class extends Me{static{o(this,"WorkunitsService")}constructor(e){super(e)}Ping(){return this._connection.send("Ping",{},"json",!1,void 0,"WsWorkunitsPingResponse").then(e=>({result:!0})).catch(e=>({result:!1,error:e}))}WUQuery(e={},t){return this._connection.send("WUQuery",e,"json",!1,t).then(n=>Yr({Workunits:{ECLWorkunit:[]}},n))}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=ei(t.Result).children();return r.length?r[0]:null})}},mt=class extends Me{static{o(this,"WorkunitsServiceEx")}WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};import{debounce as qo,StateObject as Oo}from"@hpcc-js/util";import{Cache as Po,deepMixinT as Us,scopedLogger as bo,StateObject as Fo,XMLNode as Ps}from"@hpcc-js/util";function $t(s){return Math.abs(s=Math.round(s))>=1e21?s.toLocaleString("en").replace(/,/g,""):s.toString(10)}o($t,"default");function ce(s,e){if((t=(s=e?s.toExponential(e-1):s.toExponential()).indexOf("e"))<0)return null;var t,n=s.slice(0,t);return[n.length>1?n[0]+n.slice(2):n,+s.slice(t+1)]}o(ce,"formatDecimalParts");function Zt(s){return s=ce(Math.abs(s)),s?s[1]:NaN}o(Zt,"default");function Yt(s,e){return function(t,n){for(var r=t.length,i=[],a=0,u=s[0],l=0;r>0&&u>0&&(l+u+1>n&&(u=Math.max(1,n-l)),i.push(t.substring(r-=u,r+u)),!((l+=u+1)>n));)u=s[a=(a+1)%s.length];return i.reverse().join(e)}}o(Yt,"default");function es(s){return function(e){return e.replace(/[0-9]/g,function(t){return s[+t]})}}o(es,"default");var ti=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ve(s){if(!(e=ti.exec(s)))throw new Error("invalid format: "+s);var e;return new ts({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}o(ve,"formatSpecifier");ve.prototype=ts.prototype;function ts(s){this.fill=s.fill===void 0?" ":s.fill+"",this.align=s.align===void 0?">":s.align+"",this.sign=s.sign===void 0?"-":s.sign+"",this.symbol=s.symbol===void 0?"":s.symbol+"",this.zero=!!s.zero,this.width=s.width===void 0?void 0:+s.width,this.comma=!!s.comma,this.precision=s.precision===void 0?void 0:+s.precision,this.trim=!!s.trim,this.type=s.type===void 0?"":s.type+""}o(ts,"FormatSpecifier");ts.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 ss(s){e:for(var e=s.length,t=1,n=-1,r;t<e;++t)switch(s[t]){case".":n=r=t;break;case"0":n===0&&(n=t),r=t;break;default:if(!+s[t])break e;n>0&&(n=0);break}return n>0?s.slice(0,n)+s.slice(r+1):s}o(ss,"default");var ns;function rs(s,e){var t=ce(s,e);if(!t)return s+"";var n=t[0],r=t[1],i=r-(ns=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,a=n.length;return i===a?n:i>a?n+new Array(i-a+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+ce(s,Math.max(0,e+i-1))[0]}o(rs,"default");function ft(s,e){var t=ce(s,e);if(!t)return s+"";var n=t[0],r=t[1];return r<0?"0."+new Array(-r).join("0")+n:n.length>r+1?n.slice(0,r+1)+"."+n.slice(r+1):n+new Array(r-n.length+2).join("0")}o(ft,"default");var is={"%":o(function(s,e){return(s*100).toFixed(e)},"%"),b:o(function(s){return Math.round(s).toString(2)},"b"),c:o(function(s){return s+""},"c"),d:$t,e:o(function(s,e){return s.toExponential(e)},"e"),f:o(function(s,e){return s.toFixed(e)},"f"),g:o(function(s,e){return s.toPrecision(e)},"g"),o:o(function(s){return Math.round(s).toString(8)},"o"),p:o(function(s,e){return ft(s*100,e)},"p"),r:ft,s:rs,X:o(function(s){return Math.round(s).toString(16).toUpperCase()},"X"),x:o(function(s){return Math.round(s).toString(16)},"x")};function ht(s){return s}o(ht,"default");var ln=Array.prototype.map,pn=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function os(s){var e=s.grouping===void 0||s.thousands===void 0?ht:Yt(ln.call(s.grouping,Number),s.thousands+""),t=s.currency===void 0?"":s.currency[0]+"",n=s.currency===void 0?"":s.currency[1]+"",r=s.decimal===void 0?".":s.decimal+"",i=s.numerals===void 0?ht:es(ln.call(s.numerals,String)),a=s.percent===void 0?"%":s.percent+"",u=s.minus===void 0?"-":s.minus+"",l=s.nan===void 0?"NaN":s.nan+"";function d(p){p=ve(p);var m=p.fill,b=p.align,E=p.sign,V=p.symbol,W=p.zero,S=p.width,ne=p.comma,f=p.precision,C=p.trim,x=p.type;x==="n"?(ne=!0,x="g"):is[x]||(f===void 0&&(f=12),C=!0,x="g"),(W||m==="0"&&b==="=")&&(W=!0,m="0",b="=");var A=V==="$"?t:V==="#"&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",q=V==="$"?n:/[%p]/.test(x)?a:"",re=is[x],k=/[defgprs%]/.test(x);f=f===void 0?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,f)):Math.max(0,Math.min(20,f));function Xe(D){var X=A,F=q,H,Ke,Se;if(x==="c")F=re(D)+F,D="";else{D=+D;var ye=D<0||1/D<0;if(D=isNaN(D)?l:re(Math.abs(D),f),C&&(D=ss(D)),ye&&+D==0&&E!=="+"&&(ye=!1),X=(ye?E==="("?E:u:E==="-"||E==="("?"":E)+X,F=(x==="s"?pn[8+ns/3]:"")+F+(ye&&E==="("?")":""),k){for(H=-1,Ke=D.length;++H<Ke;)if(Se=D.charCodeAt(H),48>Se||Se>57){F=(Se===46?r+D.slice(H+1):D.slice(H))+F,D=D.slice(0,H);break}}}ne&&!W&&(D=e(D,1/0));var We=X.length+D.length+F.length,O=We<S?new Array(S-We+1).join(m):"";switch(ne&&W&&(D=e(O+D,O.length?S-F.length:1/0),O=""),b){case"<":D=X+D+F+O;break;case"=":D=X+O+D+F;break;case"^":D=O.slice(0,We=O.length>>1)+X+D+F+O.slice(We);break;default:D=O+X+D+F;break}return i(D)}return o(Xe,"format"),Xe.toString=function(){return p+""},Xe}o(d,"newFormat");function c(p,m){var b=d((p=ve(p),p.type="f",p)),E=Math.max(-8,Math.min(8,Math.floor(Zt(m)/3)))*3,V=Math.pow(10,-E),W=pn[8+E/3];return function(S){return b(V*S)+W}}return o(c,"formatPrefix"),{format:d,formatPrefix:c}}o(os,"default");var xt,Ue,gn;as({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function as(s){return xt=os(s),Ue=xt.format,gn=xt.formatPrefix,xt}o(as,"defaultLocale");var us=new Date,cs=new Date;function v(s,e,t,n){function r(i){return s(i=arguments.length===0?new Date:new Date(+i)),i}return o(r,"interval"),r.floor=function(i){return s(i=new Date(+i)),i},r.ceil=function(i){return s(i=new Date(i-1)),e(i,1),s(i),i},r.round=function(i){var a=r(i),u=r.ceil(i);return i-a<u-i?a:u},r.offset=function(i,a){return e(i=new Date(+i),a==null?1:Math.floor(a)),i},r.range=function(i,a,u){var l=[],d;if(i=r.ceil(i),u=u==null?1:Math.floor(u),!(i<a)||!(u>0))return l;do l.push(d=new Date(+i)),e(i,u),s(i);while(d<i&&i<a);return l},r.filter=function(i){return v(function(a){if(a>=a)for(;s(a),!i(a);)a.setTime(a-1)},function(a,u){if(a>=a)if(u<0)for(;++u<=0;)for(;e(a,-1),!i(a););else for(;--u>=0;)for(;e(a,1),!i(a););})},t&&(r.count=function(i,a){return us.setTime(+i),cs.setTime(+a),s(us),s(cs),Math.floor(t(us,cs))},r.every=function(i){return i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?r.filter(n?function(a){return n(a)%i===0}:function(a){return r.count(0,a)%i===0}):r}),r}o(v,"newInterval");var St=6e4;var yt=864e5,Wt=6048e5;var dn=v(function(s){s.setHours(0,0,0,0)},function(s,e){s.setDate(s.getDate()+e)},function(s,e){return(e-s-(e.getTimezoneOffset()-s.getTimezoneOffset())*St)/yt},function(s){return s.getDate()-1}),Rt=dn,si=dn.range;function le(s){return v(function(e){e.setDate(e.getDate()-(e.getDay()+7-s)%7),e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t*7)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*St)/Wt})}o(le,"weekday");var we=le(0),Pe=le(1),mn=le(2),fn=le(3),Z=le(4),hn=le(5),xn=le(6),Sn=we.range,ni=Pe.range,ri=mn.range,ii=fn.range,oi=Z.range,ai=hn.range,ui=xn.range;var ls=v(function(s){s.setMonth(0,1),s.setHours(0,0,0,0)},function(s,e){s.setFullYear(s.getFullYear()+e)},function(s,e){return e.getFullYear()-s.getFullYear()},function(s){return s.getFullYear()});ls.every=function(s){return!isFinite(s=Math.floor(s))||!(s>0)?null:v(function(e){e.setFullYear(Math.floor(e.getFullYear()/s)*s),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t*s)})};var pe=ls,ci=ls.range;var yn=v(function(s){s.setUTCHours(0,0,0,0)},function(s,e){s.setUTCDate(s.getUTCDate()+e)},function(s,e){return(e-s)/yt},function(s){return s.getUTCDate()-1}),Dt=yn,li=yn.range;function ge(s){return v(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-s)%7),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t*7)},function(e,t){return(t-e)/Wt})}o(ge,"utcWeekday");var _e=ge(0),be=ge(1),Wn=ge(2),Rn=ge(3),Y=ge(4),Dn=ge(5),Cn=ge(6),Un=_e.range,pi=be.range,gi=Wn.range,di=Rn.range,mi=Y.range,fi=Dn.range,hi=Cn.range;var ps=v(function(s){s.setUTCMonth(0,1),s.setUTCHours(0,0,0,0)},function(s,e){s.setUTCFullYear(s.getUTCFullYear()+e)},function(s,e){return e.getUTCFullYear()-s.getUTCFullYear()},function(s){return s.getUTCFullYear()});ps.every=function(s){return!isFinite(s=Math.floor(s))||!(s>0)?null:v(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/s)*s),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t*s)})};var de=ps,xi=ps.range;function gs(s){if(0<=s.y&&s.y<100){var e=new Date(-1,s.m,s.d,s.H,s.M,s.S,s.L);return e.setFullYear(s.y),e}return new Date(s.y,s.m,s.d,s.H,s.M,s.S,s.L)}o(gs,"localDate");function ds(s){if(0<=s.y&&s.y<100){var e=new Date(Date.UTC(-1,s.m,s.d,s.H,s.M,s.S,s.L));return e.setUTCFullYear(s.y),e}return new Date(Date.UTC(s.y,s.m,s.d,s.H,s.M,s.S,s.L))}o(ds,"utcDate");function Ge(s,e,t){return{y:s,m:e,d:t,H:0,M:0,S:0,L:0}}o(Ge,"newDate");function ms(s){var e=s.dateTime,t=s.date,n=s.time,r=s.periods,i=s.days,a=s.shortDays,u=s.months,l=s.shortMonths,d=Qe(r),c=Ve(r),p=Qe(i),m=Ve(i),b=Qe(a),E=Ve(a),V=Qe(u),W=Ve(u),S=Qe(l),ne=Ve(l),f={a:ye,A:We,b:O,B:gr,c:null,d:In,e:In,f:Qi,g:zi,G:Zi,H:wi,I:_i,j:Gi,L:Mn,m:Vi,M:qi,p:dr,q:mr,Q:Ln,s:An,S:Oi,u:Bi,U:ji,V:Xi,w:Ki,W:Hi,x:null,X:null,y:Ji,Y:$i,Z:Yi,"%":Nn},C={a:fr,A:hr,b:xr,B:Sr,c:null,d:kn,e:kn,f:no,g:mo,G:ho,H:eo,I:to,j:so,L:wn,m:ro,M:io,p:yr,q:Wr,Q:Ln,s:An,S:oo,u:ao,U:uo,V:co,w:lo,W:po,x:null,X:null,y:go,Y:fo,Z:xo,"%":Nn},x={a:Xe,A:D,b:X,B:F,c:H,d:Tn,e:Tn,f:Li,g:Fn,G:bn,H:En,I:En,j:Ei,L:Ni,m:Ti,M:Ii,p:k,q:Fi,Q:Mi,s:vi,S:ki,u:Di,U:Ci,V:Ui,w:Ri,W:Pi,x:Ke,X:Se,y:Fn,Y:bn,Z:bi,"%":Ai};f.x=A(t,f),f.X=A(n,f),f.c=A(e,f),C.x=A(t,C),C.X=A(n,C),C.c=A(e,C);function A(h,R){return function(U){var g=[],_=-1,T=0,G=h.length,Q,ie,_s;for(U instanceof Date||(U=new Date(+U));++_<G;)h.charCodeAt(_)===37&&(g.push(h.slice(T,_)),(ie=Pn[Q=h.charAt(++_)])!=null?Q=h.charAt(++_):ie=Q==="e"?" ":"0",(_s=R[Q])&&(Q=_s(U,ie)),g.push(Q),T=_+1);return g.push(h.slice(T,_)),g.join("")}}o(A,"newFormat");function q(h,R){return function(U){var g=Ge(1900,void 0,1),_=re(g,h,U+="",0),T,G;if(_!=U.length)return null;if("Q"in g)return new Date(g.Q);if("s"in g)return new Date(g.s*1e3+("L"in g?g.L:0));if(R&&!("Z"in g)&&(g.Z=0),"p"in g&&(g.H=g.H%12+g.p*12),g.m===void 0&&(g.m="q"in g?g.q:0),"V"in g){if(g.V<1||g.V>53)return null;"w"in g||(g.w=1),"Z"in g?(T=ds(Ge(g.y,0,1)),G=T.getUTCDay(),T=G>4||G===0?be.ceil(T):be(T),T=Dt.offset(T,(g.V-1)*7),g.y=T.getUTCFullYear(),g.m=T.getUTCMonth(),g.d=T.getUTCDate()+(g.w+6)%7):(T=gs(Ge(g.y,0,1)),G=T.getDay(),T=G>4||G===0?Pe.ceil(T):Pe(T),T=Rt.offset(T,(g.V-1)*7),g.y=T.getFullYear(),g.m=T.getMonth(),g.d=T.getDate()+(g.w+6)%7)}else("W"in g||"U"in g)&&("w"in g||(g.w="u"in g?g.u%7:"W"in g?1:0),G="Z"in g?ds(Ge(g.y,0,1)).getUTCDay():gs(Ge(g.y,0,1)).getDay(),g.m=0,g.d="W"in g?(g.w+6)%7+g.W*7-(G+5)%7:g.w+g.U*7-(G+6)%7);return"Z"in g?(g.H+=g.Z/100|0,g.M+=g.Z%100,ds(g)):gs(g)}}o(q,"newParse");function re(h,R,U,g){for(var _=0,T=R.length,G=U.length,Q,ie;_<T;){if(g>=G)return-1;if(Q=R.charCodeAt(_++),Q===37){if(Q=R.charAt(_++),ie=x[Q in Pn?R.charAt(_++):Q],!ie||(g=ie(h,U,g))<0)return-1}else if(Q!=U.charCodeAt(g++))return-1}return g}o(re,"parseSpecifier");function k(h,R,U){var g=d.exec(R.slice(U));return g?(h.p=c[g[0].toLowerCase()],U+g[0].length):-1}o(k,"parsePeriod");function Xe(h,R,U){var g=b.exec(R.slice(U));return g?(h.w=E[g[0].toLowerCase()],U+g[0].length):-1}o(Xe,"parseShortWeekday");function D(h,R,U){var g=p.exec(R.slice(U));return g?(h.w=m[g[0].toLowerCase()],U+g[0].length):-1}o(D,"parseWeekday");function X(h,R,U){var g=S.exec(R.slice(U));return g?(h.m=ne[g[0].toLowerCase()],U+g[0].length):-1}o(X,"parseShortMonth");function F(h,R,U){var g=V.exec(R.slice(U));return g?(h.m=W[g[0].toLowerCase()],U+g[0].length):-1}o(F,"parseMonth");function H(h,R,U){return re(h,e,R,U)}o(H,"parseLocaleDateTime");function Ke(h,R,U){return re(h,t,R,U)}o(Ke,"parseLocaleDate");function Se(h,R,U){return re(h,n,R,U)}o(Se,"parseLocaleTime");function ye(h){return a[h.getDay()]}o(ye,"formatShortWeekday");function We(h){return i[h.getDay()]}o(We,"formatWeekday");function O(h){return l[h.getMonth()]}o(O,"formatShortMonth");function gr(h){return u[h.getMonth()]}o(gr,"formatMonth");function dr(h){return r[+(h.getHours()>=12)]}o(dr,"formatPeriod");function mr(h){return 1+~~(h.getMonth()/3)}o(mr,"formatQuarter");function fr(h){return a[h.getUTCDay()]}o(fr,"formatUTCShortWeekday");function hr(h){return i[h.getUTCDay()]}o(hr,"formatUTCWeekday");function xr(h){return l[h.getUTCMonth()]}o(xr,"formatUTCShortMonth");function Sr(h){return u[h.getUTCMonth()]}o(Sr,"formatUTCMonth");function yr(h){return r[+(h.getUTCHours()>=12)]}o(yr,"formatUTCPeriod");function Wr(h){return 1+~~(h.getUTCMonth()/3)}return o(Wr,"formatUTCQuarter"),{format:o(function(h){var R=A(h+="",f);return R.toString=function(){return h},R},"format"),parse:o(function(h){var R=q(h+="",!1);return R.toString=function(){return h},R},"parse"),utcFormat:o(function(h){var R=A(h+="",C);return R.toString=function(){return h},R},"utcFormat"),utcParse:o(function(h){var R=q(h+="",!0);return R.toString=function(){return h},R},"utcParse")}}o(ms,"formatLocale");var Pn={"-":"",_:" ",0:"0"},N=/^\s*\d+/,Si=/^%/,yi=/[\\^$*+?|[\]().{}]/g;function P(s,e,t){var n=s<0?"-":"",r=(n?-s:s)+"",i=r.length;return n+(i<t?new Array(t-i+1).join(e)+r:r)}o(P,"pad");function Wi(s){return s.replace(yi,"\\$&")}o(Wi,"requote");function Qe(s){return new RegExp("^(?:"+s.map(Wi).join("|")+")","i")}o(Qe,"formatRe");function Ve(s){for(var e={},t=-1,n=s.length;++t<n;)e[s[t].toLowerCase()]=t;return e}o(Ve,"formatLookup");function Ri(s,e,t){var n=N.exec(e.slice(t,t+1));return n?(s.w=+n[0],t+n[0].length):-1}o(Ri,"parseWeekdayNumberSunday");function Di(s,e,t){var n=N.exec(e.slice(t,t+1));return n?(s.u=+n[0],t+n[0].length):-1}o(Di,"parseWeekdayNumberMonday");function Ci(s,e,t){var n=N.exec(e.slice(t,t+2));return n?(s.U=+n[0],t+n[0].length):-1}o(Ci,"parseWeekNumberSunday");function Ui(s,e,t){var n=N.exec(e.slice(t,t+2));return n?(s.V=+n[0],t+n[0].length):-1}o(Ui,"parseWeekNumberISO");function Pi(s,e,t){var n=N.exec(e.slice(t,t+2));return n?(s.W=+n[0],t+n[0].length):-1}o(Pi,"parseWeekNumberMonday");function bn(s,e,t){var n=N.exec(e.slice(t,t+4));return n?(s.y=+n[0],t+n[0].length):-1}o(bn,"parseFullYear");function Fn(s,e,t){var n=N.exec(e.slice(t,t+2));return n?(s.y=+n[0]+(+n[0]>68?1900:2e3),t+n[0].length):-1}o(Fn,"parseYear");function bi(s,e,t){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(t,t+6));return n?(s.Z=n[1]?0:-(n[2]+(n[3]||"00")),t+n[0].length):-1}o(bi,"parseZone");function Fi(s,e,t){var n=N.exec(e.slice(t,t+1));return n?(s.q=n[0]*3-3,t+n[0].length):-1}o(Fi,"parseQuarter");function Ti(s,e,t){var n=N.exec(e.slice(t,t+2));return n?(s.m=n[0]-1,t+n[0].length):-1}o(Ti,"parseMonthNumber");function Tn(s,e,t){var n=N.exec(e.slice(t,t+2));return n?(s.d=+n[0],t+n[0].length):-1}o(Tn,"parseDayOfMonth");function Ei(s,e,t){var n=N.exec(e.slice(t,t+3));return n?(s.m=0,s.d=+n[0],t+n[0].length):-1}o(Ei,"parseDayOfYear");function En(s,e,t){var n=N.exec(e.slice(t,t+2));return n?(s.H=+n[0],t+n[0].length):-1}o(En,"parseHour24");function Ii(s,e,t){var n=N.exec(e.slice(t,t+2));return n?(s.M=+n[0],t+n[0].length):-1}o(Ii,"parseMinutes");function ki(s,e,t){var n=N.exec(e.slice(t,t+2));return n?(s.S=+n[0],t+n[0].length):-1}o(ki,"parseSeconds");function Ni(s,e,t){var n=N.exec(e.slice(t,t+3));return n?(s.L=+n[0],t+n[0].length):-1}o(Ni,"parseMilliseconds");function Li(s,e,t){var n=N.exec(e.slice(t,t+6));return n?(s.L=Math.floor(n[0]/1e3),t+n[0].length):-1}o(Li,"parseMicroseconds");function Ai(s,e,t){var n=Si.exec(e.slice(t,t+1));return n?t+n[0].length:-1}o(Ai,"parseLiteralPercent");function Mi(s,e,t){var n=N.exec(e.slice(t));return n?(s.Q=+n[0],t+n[0].length):-1}o(Mi,"parseUnixTimestamp");function vi(s,e,t){var n=N.exec(e.slice(t));return n?(s.s=+n[0],t+n[0].length):-1}o(vi,"parseUnixTimestampSeconds");function In(s,e){return P(s.getDate(),e,2)}o(In,"formatDayOfMonth");function wi(s,e){return P(s.getHours(),e,2)}o(wi,"formatHour24");function _i(s,e){return P(s.getHours()%12||12,e,2)}o(_i,"formatHour12");function Gi(s,e){return P(1+Rt.count(pe(s),s),e,3)}o(Gi,"formatDayOfYear");function Mn(s,e){return P(s.getMilliseconds(),e,3)}o(Mn,"formatMilliseconds");function Qi(s,e){return Mn(s,e)+"000"}o(Qi,"formatMicroseconds");function Vi(s,e){return P(s.getMonth()+1,e,2)}o(Vi,"formatMonthNumber");function qi(s,e){return P(s.getMinutes(),e,2)}o(qi,"formatMinutes");function Oi(s,e){return P(s.getSeconds(),e,2)}o(Oi,"formatSeconds");function Bi(s){var e=s.getDay();return e===0?7:e}o(Bi,"formatWeekdayNumberMonday");function ji(s,e){return P(we.count(pe(s)-1,s),e,2)}o(ji,"formatWeekNumberSunday");function vn(s){var e=s.getDay();return e>=4||e===0?Z(s):Z.ceil(s)}o(vn,"dISO");function Xi(s,e){return s=vn(s),P(Z.count(pe(s),s)+(pe(s).getDay()===4),e,2)}o(Xi,"formatWeekNumberISO");function Ki(s){return s.getDay()}o(Ki,"formatWeekdayNumberSunday");function Hi(s,e){return P(Pe.count(pe(s)-1,s),e,2)}o(Hi,"formatWeekNumberMonday");function Ji(s,e){return P(s.getFullYear()%100,e,2)}o(Ji,"formatYear");function zi(s,e){return s=vn(s),P(s.getFullYear()%100,e,2)}o(zi,"formatYearISO");function $i(s,e){return P(s.getFullYear()%1e4,e,4)}o($i,"formatFullYear");function Zi(s,e){var t=s.getDay();return s=t>=4||t===0?Z(s):Z.ceil(s),P(s.getFullYear()%1e4,e,4)}o(Zi,"formatFullYearISO");function Yi(s){var e=s.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+P(e/60|0,"0",2)+P(e%60,"0",2)}o(Yi,"formatZone");function kn(s,e){return P(s.getUTCDate(),e,2)}o(kn,"formatUTCDayOfMonth");function eo(s,e){return P(s.getUTCHours(),e,2)}o(eo,"formatUTCHour24");function to(s,e){return P(s.getUTCHours()%12||12,e,2)}o(to,"formatUTCHour12");function so(s,e){return P(1+Dt.count(de(s),s),e,3)}o(so,"formatUTCDayOfYear");function wn(s,e){return P(s.getUTCMilliseconds(),e,3)}o(wn,"formatUTCMilliseconds");function no(s,e){return wn(s,e)+"000"}o(no,"formatUTCMicroseconds");function ro(s,e){return P(s.getUTCMonth()+1,e,2)}o(ro,"formatUTCMonthNumber");function io(s,e){return P(s.getUTCMinutes(),e,2)}o(io,"formatUTCMinutes");function oo(s,e){return P(s.getUTCSeconds(),e,2)}o(oo,"formatUTCSeconds");function ao(s){var e=s.getUTCDay();return e===0?7:e}o(ao,"formatUTCWeekdayNumberMonday");function uo(s,e){return P(_e.count(de(s)-1,s),e,2)}o(uo,"formatUTCWeekNumberSunday");function _n(s){var e=s.getUTCDay();return e>=4||e===0?Y(s):Y.ceil(s)}o(_n,"UTCdISO");function co(s,e){return s=_n(s),P(Y.count(de(s),s)+(de(s).getUTCDay()===4),e,2)}o(co,"formatUTCWeekNumberISO");function lo(s){return s.getUTCDay()}o(lo,"formatUTCWeekdayNumberSunday");function po(s,e){return P(be.count(de(s)-1,s),e,2)}o(po,"formatUTCWeekNumberMonday");function go(s,e){return P(s.getUTCFullYear()%100,e,2)}o(go,"formatUTCYear");function mo(s,e){return s=_n(s),P(s.getUTCFullYear()%100,e,2)}o(mo,"formatUTCYearISO");function fo(s,e){return P(s.getUTCFullYear()%1e4,e,4)}o(fo,"formatUTCFullYear");function ho(s,e){var t=s.getUTCDay();return s=t>=4||t===0?Y(s):Y.ceil(s),P(s.getUTCFullYear()%1e4,e,4)}o(ho,"formatUTCFullYearISO");function xo(){return"+0000"}o(xo,"formatUTCZone");function Nn(){return"%"}o(Nn,"formatLiteralPercent");function Ln(s){return+s}o(Ln,"formatUnixTimestamp");function An(s){return Math.floor(+s/1e3)}o(An,"formatUnixTimestampSeconds");var Fe,Gn,Qn,Ct,Ut;fs({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 fs(s){return Fe=ms(s),Gn=Fe.format,Qn=Fe.parse,Ct=Fe.utcFormat,Ut=Fe.utcParse,Fe}o(fs,"defaultLocale");import{Cache as Vn,Edge as Hn,Graph as Jn,StateObject as So,Subgraph as zn,Vertex as $n}from"@hpcc-js/util";var Pt=class extends So{static{o(this,"ECLGraph")}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,n){super(),this.wu=e;let r=0;for(let i of n)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=>Tt(t)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(t=>Tt(t))}},bt=class extends Vn{static{o(this,"GraphCache")}constructor(){super(e=>Vn.hash([e.Name]))}};function Zn(s,e,t){t=t||[],t.push(s),e(s.name,s.$,s.children(),t),s.children().forEach(n=>{Zn(n,e,t)}),t.pop()}o(Zn,"walkXmlJson");function hs(s){let e={};return s.forEach(t=>{t.name==="att"&&(e[t.$.name]=t.$.value)}),e}o(hs,"flattenAtt");var xs=class extends Jn{static{o(this,"XGMMLGraph")}},qn=class extends zn{static{o(this,"XGMMLSubgraph")}},On=class extends $n{static{o(this,"XGMMLVertex")}},Bn=class extends Hn{static{o(this,"XGMMLEdge")}};function Yn(s,e){let t={},n={},r={},i=new xs(u=>u._.id),a=[i.root];return Zn(e,(u,l,d,c)=>{let p=a[a.length-1];switch(u){case"graph":break;case"node":if(d.length&&d[0].children().length&&d[0].children()[0].name==="graph"){let E=p.createSubgraph(hs(d));a.push(E),t[l.id]=E}let m=p.createVertex(hs(d));n[l.id]=m;break;case"edge":let b=p.createEdge(n[l.source],n[l.target],hs(d));r[l.id]=b;break;default:}}),i}o(Yn,"createXGMMLGraph");var Ft=class extends Jn{static{o(this,"ScopeGraph")}},jn=class extends zn{static{o(this,"ScopeSubgraph")}},Xn=class extends $n{static{o(this,"ScopeVertex")}},Kn=class extends Hn{static{o(this,"ScopeEdge")}};function Tt(s){let e={},t={},n={},r;for(let i of s)switch(i.ScopeType){case"graph":r=new Ft(c=>c._.Id,i),e[i.ScopeName]=r.root;break;case"subgraph":r||(r=new Ft(c=>c._.Id,i),e[i.ScopeName]=r.root);let a=i.parentScope().split(":"),u=e[i.parentScope()];for(;a.length&&!u;)u=e[a.join(":")],a.pop();if(!u)console.warn(`Missing SG:Parent (${i.Id}): ${i.parentScope()}`);else{let c=u;e[i.ScopeName]=c.createSubgraph(i)}break;case"activity":let l=e[i.parentScope()];l?n[i.ScopeName]=l.createVertex(i):console.warn(`Missing A:Parent (${i.Id}): ${i.parentScope()}`);break;case"edge":t[i.ScopeName]=i;break;case"function":let d=n[i.parentScope()];d?d._.children().push(i):console.warn(`Missing F:Parent (${i.Id}): ${i.parentScope()}`);break}for(let i in t){let a=t[i],u=e[a.parentScope()];if(!u)console.warn(`Missing E:Parent (${a.Id}): ${a.parentScope()}`);else{let l=u;try{let d=r.vertex(a.attr("IdSource").RawValue),c=r.vertex(a.attr("IdTarget").RawValue);l.createEdge(d,c,a)}catch{console.warn(`Invalid Edge: ${i}`)}}}return r}o(Tt,"createGraph");import{StateObject as yo}from"@hpcc-js/util";var Et=class extends yo{static{o(this,"Resource")}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 n=t.split("\\").join("/"),r=n.split("/"),i="res/"+this.wu.Wuid+"/",a="",u="";n.indexOf(i)===0&&(a=n.substr(i.length),u=r[r.length-1]),this.set({URL:t,DisplayName:u,DisplayPath:a})}};import{Cache as Rs,exists as Ws,StateObject as Ro}from"@hpcc-js/util";import{SAXStackParser as Wo,Stack as er}from"@hpcc-js/util";var It=class{static{o(this,"XSDNode")}e;constructor(e){this.e=e}fix(){delete this.e}},kt=class extends It{static{o(this,"XSDXMLNode")}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 n=this._children[t];n.name==="Row"&&n.type===void 0&&(this._children.push(...n._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",n=this.type.lastIndexOf("_"),r=n>0?n: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}},Nt=class extends It{static{o(this,"XSDSimpleType")}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()}},Lt=class{static{o(this,"XSDSchema")}root;simpleTypes={};fields(){return this.root.children()}},At=class extends Wo{static{o(this,"XSDParser")}schema=new Lt;simpleType;simpleTypes={};xsdStack=new er;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":let t=new kt(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 Nt(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 n=this.xsdStack.top();for(let r in e.$)n.attrs[r]=e.$[r];break;default:this.simpleType&&this.simpleType.append(e)}super.endXMLNode(e)}};function ys(s){let e=new At;return e.parse(s),e.schema}o(ys,"parseXSD");var Ss=class extends At{static{o(this,"XSDParser2")}_rootName;schema=new Lt;simpleTypes={};xsdStack=new er;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":let t=new kt(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 Nt(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 rm(s,e){let t=new Ss(e);return t.parse(s),t.schema}o(rm,"parseXSD2");var Ds=class extends Rs{static{o(this,"GlobalResultCache")}constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}},Mt=new Ds,vt=class s extends Ro{static{o(this,"Result")}connection;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,n,r){let i;return Array.isArray(r)?(i=Mt.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n.Name},()=>new s(e,t,n,r)),i.set(n)):typeof r>"u"&&(typeof n=="number"?i=Mt.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+n},()=>new s(e,t,n)):typeof n=="string"&&(i=Mt.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n},()=>new s(e,t,n)))),i}static attachLogicalFile(e,t,n){return Mt.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n},()=>new s(e,t,n,!0))}constructor(e,t,n,r){super(),e instanceof L?this.connection=e:this.connection=new L(e),typeof r=="boolean"&&r===!0?this.set({NodeGroup:t,LogicalFileName:n}):cn(n)&&Array.isArray(r)?this.set({...n,Wuid:t,ResultName:n.Name,ResultViews:r}):typeof r>"u"?typeof n=="number"?this.set({Wuid:t,ResultSequence:n}):typeof n=="string"?this.set({Wuid:t,ResultName:n}):console.warn("Unknown Result.attach (1)"):console.warn("Unknown Result.attach (2)")}isComplete(){return this.Total!==-1}_fetchXMLSchemaPromise;fetchXMLSchema(e=!1){return(!this._fetchXMLSchemaPromise||e)&&(this._fetchXMLSchemaPromise=this.WUResult().then(t=>t.Result?.XmlSchema?.xml?(this.xsdSchema=ys(t.Result.XmlSchema.xml),this.xsdSchema):null)),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(e=0,t=-1,n=!1,r={},i){return this.WUResult(e,t,!n,r,i).then(a=>{let u=a.Result;return delete a.Result,this.set({...a}),Ws("XmlSchema.xml",u)&&(this.xsdSchema=ys(u.XmlSchema.xml)),Ws("Row",u)?u.Row:this.ResultName&&Ws(this.ResultName,u)?u[this.ResultName].Row:[]})}rootField(){return this.xsdSchema?this.xsdSchema.root:null}fields(){return this.xsdSchema?this.xsdSchema.root.children():[]}WUResult(e=0,t=1,n=!1,r={},i){let a={NamedValue:{itemcount:0}};for(let l in r)a.NamedValue[a.NamedValue.itemcount++]={Name:l,Value:r[l]};let u={FilterBy:a};return this.Wuid&&this.ResultName!==void 0?(u.Wuid=this.Wuid,u.ResultName=this.ResultName):this.Wuid&&this.ResultSequence!==void 0?(u.Wuid=this.Wuid,u.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(u.LogicalName=this.LogicalFileName,u.Cluster=this.NodeGroup):this.LogicalFileName&&(u.LogicalName=this.LogicalFileName),u.Start=e,u.Count=t,u.SuppressXmlSchema=n,this.connection.WUResult(u,i).then(l=>l)}},wt=class extends Rs{static{o(this,"ResultCache")}constructor(){super(e=>Rs.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};import{StateObject as tr}from"@hpcc-js/util";var me=class extends tr{static{o(this,"Attribute")}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)}},Cs=class extends tr{static{o(this,"BaseScope")}_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(n=>{n.Measure==="ts"&&n.Name.indexOf("Started")>=0?t.start=n:this.ScopeName&&n.Measure==="ts"&&n.Name.indexOf("Finished")>=0?t.end=n:e.push(new me(this,n))}),t.start&&t.end?(t.start.FormattedEnd=t.end.Formatted,e.push(new me(this,t.start))):t.start?e.push(new me(this,t.start)):t.end&&e.push(new me(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 me(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let t="",n=[];t=this.Id,n.push(`<tr><td class="key">ID:</td><td class="value">${this.Id}</td></tr>`),e&&n.push(`<tr><td class="key">Parent ID:</td><td class="value">${e.Id}</td></tr>`),n.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]:n.push(`<tr><td class="key">${i}</td><td class="value">${r[i]}</td></tr>`);return`<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">
|
|
2
|
+
<h4 align="center">${t}</h4>
|
|
3
3
|
<table>
|
|
4
|
-
${
|
|
4
|
+
${n.join("")}
|
|
5
5
|
</table>
|
|
6
|
-
</div>`}},Ye=class extends vs{wu;constructor(e,s){super(s),this.wu=e}};var Ht=class extends P{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,s,r){super(),e instanceof N?this.connection=e:this.connection=new N(e),this.set({Wuid:s,...r})}};var Jt=class extends P{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,s,r){super(),e instanceof N?this.connection=e:this.connection=new N(e);let n=er(r.Value);this.set({Wuid:s,Seconds:Math.round(n*1e3)/1e3,HasSubGraphId:r.SubGraphId!==void 0,...r})}};var Vo=vt("%Y-%m-%dT%H:%M:%S.%LZ"),Oo=Nt("%Y-%m-%dT%H:%M:%S.%LZ"),qo=Ie(",");function Bo(t){return t&&!isNaN(+t)?qo(+t):t}function Dn(t,e,s){t[e]===void 0||t[e][s]===void 0||e==="__proto__"||e==="constructor"||e==="prototype"||delete t[e][s]}var et="DefinitionList",jo=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,Xo=["Avg","Min","Max","Delta","StdDev"],Ko=["SkewMin","SkewMax","NodeMin","NodeMax"],Ho=/[A-Z][a-z]*/g;function Jo(t){for(let s of Ko){let r=t.indexOf(s);if(r===0){let n="",i=t.slice(r+s.length);return{measure:n,ext:s,label:i}}}let e=t.match(Ho);if(e?.length){let s=e.shift(),r=e.join("");for(let n of Xo){let i=r.indexOf(n);if(i===0)return r=r.slice(i+n.length),{measure:s,ext:n,label:r}}return{measure:s,ext:"",label:r}}return{measure:"",ext:"",label:t}}var Rn={};function $o(t){let e=Rn[t];return e||(e=Jo(t),Rn[t]=e),e}function H(t,e){return t.__formattedProps?.[e]??t[e]}function $t(t){if(t===void 0)return;let e=parseFloat(t);return isNaN(e)?void 0:e}function zo(t,e,s){let r=$o(e);if(!s[r.measure]){s[r.label]=!0;let n=$t(t[`${r.measure}Avg${r.label}`]),i=$t(t[`${r.measure}Min${r.label}`]),o=$t(t[`${r.measure}Max${r.label}`]),a=$t(t[`${r.measure}StdDev${r.label}`]),c=Math.max((n-i)/a,(o-n)/a);return{Key:`${r.measure}${r.label}`,Value:H(t,`${r.measure}${r.label}`),Avg:H(t,`${r.measure}Avg${r.label}`),Min:H(t,`${r.measure}Min${r.label}`),Max:H(t,`${r.measure}Max${r.label}`),Delta:H(t,`${r.measure}Delta${r.label}`),StdDev:H(t,`${r.measure}StdDev${r.label}`),StdDevs:isNaN(c)?void 0:c,SkewMin:H(t,`SkewMin${r.label}`),SkewMax:H(t,`SkewMax${r.label}`),NodeMin:H(t,`NodeMin${r.label}`),NodeMax:H(t,`NodeMax${r.label}`)}}return null}var zt=O("workunit.ts"),Ns=class extends T{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}},Zt=new Ns,Ne=class t extends P{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")||ds[this.StateID]}get Protected(){return this.get("Protected",!1)}get Exceptions(){return this.get("Exceptions",{ECLException:[]})}get ResultViews(){return this.get("ResultViews",{View:[]})}_resultCache=new Kt;get ResultCount(){return this.get("ResultCount",0)}get Results(){return this.get("Results",{ECLResult:[]})}get CResults(){return this.Results.ECLResult.map(e=>this._resultCache.get(e,()=>Xt.attach(this.connection,this.Wuid,e,this.ResultViews.View)))}get SequenceResults(){let e={};return this.CResults.forEach(s=>{e[s.Sequence]=s}),e}get Timers(){return this.get("Timers",{ECLTimer:[]})}get CTimers(){return this.Timers.ECLTimer.map(e=>new Jt(this.connection,this.Wuid,e))}_graphCache=new Lt;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 Mt(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 Gt(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 Ht(this.connection,this.Wuid,e))}get VariableCount(){return this.get("VariableCount",0)}get Variables(){return this.get("Variables",{ECLResult:[]})}get TimerCount(){return this.get("TimerCount",0)}get HasDebugValue(){return this.get("HasDebugValue")}get ApplicationValueCount(){return this.get("ApplicationValueCount",0)}get XmlParams(){return this.get("XmlParams")}get AccessFlag(){return this.get("AccessFlag")}get ClusterFlag(){return this.get("ClusterFlag")}get ResultViewCount(){return this.get("ResultViewCount",0)}get DebugValueCount(){return this.get("DebugValueCount",0)}get WorkflowCount(){return this.get("WorkflowCount",0)}get Archived(){return this.get("Archived")}get RoxieCluster(){return this.get("RoxieCluster")}get DebugState(){return this.get("DebugState",{})}get Queue(){return this.get("Queue")}get Active(){return this.get("Active")}get Action(){return this.get("Action")}get Scope(){return this.get("Scope")}get AbortBy(){return this.get("AbortBy")}get AbortTime(){return this.get("AbortTime")}get Workflows(){return this.get("Workflows")}get TimingData(){return this.get("TimingData")}get HelpersDesc(){return this.get("HelpersDesc")}get GraphsDesc(){return this.get("GraphsDesc")}get SourceFilesDesc(){return this.get("SourceFilesDesc")}get ResultsDesc(){return this.get("ResultsDesc")}get VariablesDesc(){return this.get("VariablesDesc")}get TimersDesc(){return this.get("TimersDesc")}get DebugValuesDesc(){return this.get("DebugValuesDesc")}get ApplicationValuesDesc(){return this.get("ApplicationValuesDesc")}get WorkflowsDesc(){return this.get("WorkflowsDesc")}get ServiceNames(){return this.get("ServiceNames")}get CompileCost(){return this.get("CompileCost")}get ExecuteCost(){return this.get("ExecuteCost")}get FileAccessCost(){return this.get("FileAccessCost")}get NoAccess(){return this.get("NoAccess")}get ECLWUProcessList(){return this.get("ECLWUProcessList")}static create(e){let s=new t(e);return s.connection.WUCreate().then(r=>(Zt.set(s),s.set(r.Workunit),s))}static attach(e,s,r){let n=Zt.get({BaseUrl:e.baseUrl,Wuid:s},()=>new t(e,s));return r&&n.set(r),n}static existsLocal(e,s){return Zt.has({BaseUrl:e,Wuid:s})}static submit(e,s,r,n=!1){return t.create(e).then(i=>i.update({QueryText:r})).then(i=>n?i.submit(s,fe.Action.Compile):i.submit(s))}static compile(e,s,r){return t.submit(e,s,r,!0)}static query(e,s){return new N(e).WUQuery(s).then(n=>n.Workunits.ECLWorkunit.map(function(i){return t.attach(e,i.Wuid,i)}))}constructor(e,s){super(),this.connection=new N(e),this.topologyConnection=new L(e),this.clearState(s)}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(s=>(this.set(s.Workunit),this))}submit(e,s=fe.Action.Run,r){let n;return e!==void 0?n=Promise.resolve(e):n=this.topologyConnection.DefaultTpLogicalClusterQuery().then(i=>i.Name),this._debugMode=!1,s===fe.Action.Debug&&(s=fe.Action.Run,this._debugMode=!0),n.then(i=>this.connection.WUUpdate({Wuid:this.Wuid,Action:s,ResultLimit:r,DebugValues:{DebugValue:[{Name:"Debug",Value:this._debugMode?"1":""}]}}).then(o=>(this.set(o.Workunit),this._submitAction=s,this.connection.WUSubmit({Wuid:this.Wuid,Cluster:i})))).then(()=>this)}isComplete(){switch(this.StateID){case 1:return this.ActionEx==="compile"||this._submitAction===fe.Action.Compile;case 3:case 4:case 7:case 999:return!0;default:}return!1}isFailed(){switch(this.StateID){case 7:case 4:return!0;default:}return!1}isDeleted(){switch(this.StateID){case 999:return!0;default:}return!1}isDebugging(){switch(this.StateID){case 14:case 15:return!0;default:}return this._debugMode}isRunning(){switch(this.StateID){case 1:case 2:case 6:case 8:case 14:case 15:return!0;default:}return!1}setToFailed(){return this.WUAction(w.ECLWUActions.SetToFailed)}pause(){return this.WUAction(w.ECLWUActions.Pause)}pauseNow(){return this.WUAction(w.ECLWUActions.PauseNow)}resume(){return this.WUAction(w.ECLWUActions.Resume)}abort(){return this.WUAction(w.ECLWUActions.Abort)}protect(){return this.WUAction(w.ECLWUActions.Protect)}unprotect(){return this.WUAction(w.ECLWUActions.Unprotect)}delete(){return this.WUAction(w.ECLWUActions.Delete)}restore(){return this.WUAction(w.ECLWUActions.Restore)}deschedule(){return this.WUAction(w.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(w.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=>t.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,s){return e?await Promise.all([this.refreshInfo(s),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(s=>s.Scopes.Scope)}normalizeDetails(e,s){let r={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},n=[];for(let i of s){let o={},a={};if(i&&i.Id&&i.Properties&&i.Properties.Property)for(let u in i.Properties.Property){let l=i.Properties.Property[u];switch(l.Measure==="ns"&&(l.Measure="s"),r[l.Name]={...l},Dn(r,l.Name,"RawValue"),Dn(r,l.Name,"Formatted"),l.Measure){case"bool":o[l.Name]=!!+l.RawValue;break;case"sz":o[l.Name]=+l.RawValue;break;case"s":o[l.Name]=+l.RawValue/1e9;break;case"ns":o[l.Name]=+l.RawValue;break;case"ts":o[l.Name]=new Date(+l.RawValue/1e3).toISOString();break;case"cnt":o[l.Name]=+l.RawValue;break;case"cost":o[l.Name]=+l.RawValue/1e6;break;case"cpu":case"skw":case"node":case"ppm":case"ip":case"cy":case"en":case"txt":case"id":case"fname":default:o[l.Name]=l.RawValue}a[l.Name]=Bo(l.Formatted??o[l.Name])}let c={id:i.Id,name:i.ScopeName,type:i.ScopeType,Kind:i.Kind,Label:i.Label,__formattedProps:a,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...o};if(c[et])try{let u=JSON.parse(c[et].split("\\").join("\\\\"));c[et]=[],u.forEach((l,d)=>{let U=l.match(jo);if(U){let I=(U[1]??"")+U[2]+U[3],q=parseInt(U[5]),y=parseInt(U[6]);c[et].push({filePath:I,line:q,col:y})}})}catch{zt.error(`Unexpected "DefinitionList": ${c[et]}`)}let p={};for(let u in c)if(u.indexOf("__")!==0){let l=zo(c,u,p);l&&(c.__groupedProps[l.Key]=l,!isNaN(l.StdDevs)&&c.__StdDevs<l.StdDevs&&(c.__StdDevs=l.StdDevs,c.__StdDevsSource=l.Key))}n.push(c)}return{meta:e,columns:r,data:n}}fetchDetailsNormalized(e={}){return Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(s=>this.normalizeDetails(s[0],s[1]))}fetchInfo(e={}){return this.WUInfo(e)}fetchDetails(e={}){return this.WUDetails(e).then(s=>s.Scopes.Scope.map(r=>new Ye(this,r)))}fetchDetailsHierarchy(e={}){return this.WUDetails(e).then(s=>{let r=[],n={};s.Scopes.Scope.forEach(i=>{if(n[i.ScopeName])return n[i.ScopeName].update(i),null;{let o=new Ye(this,i);return n[o.ScopeName]=o,o}});for(let i in n)if(n.hasOwnProperty(i)){let o=n[i],a=o.parentScope();a&&n[a]?n[a].children().push(o):r.push(o)}return r})}fetchGraphDetails(e=[],s){return this.fetchDetails({ScopeFilter:{MaxDepth:999999,Ids:e,ScopeTypes:s},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(s=>wt(s))}fetchTimeElapsed(){return this.fetchDetails({ScopeFilter:{PropertyFilters:{PropertyFilter:[{Name:"TimeElapsed"}]}}}).then(e=>{let s={};e.forEach(n=>{s[n.ScopeName]=s[n.ScopeName]||{scope:n.ScopeName,start:null,elapsed:null,finish:null},n.CAttributes.forEach(i=>{i.Name==="TimeElapsed"?s[n.ScopeName].elapsed=+i.RawValue:i.Measure==="ts"&&i.Name.indexOf("Started")>=0&&(s[n.ScopeName].start=i.Formatted)})});let r=[];for(let n in s){let i=s[n];if(i.start&&i.elapsed){let o=Oo(i.start);o.setMilliseconds(o.getMilliseconds()+i.elapsed/1e6),i.finish=Vo(o),r.push(i)}}return r.sort((n,i)=>n.start<i.start?-1:n.start>i.start?1:0),r})}_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,s,r){if(this.isCallback(s))switch(e){case"completed":super.on("propChanged","StateID",n=>{this.isComplete()&&s([n])});break;case"changed":super.on(e,s);break;default:}else switch(e){case"changed":super.on(e,s,r);break;default:}return this._monitor(),this}watchUntilComplete(e){return new Promise((s,r)=>{let n=this.watch(i=>{e&&e(i),this.isComplete()&&(n.release(),s(this))})})}watchUntilRunning(e){return new Promise((s,r)=>{let n=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(n.release(),s(this))})})}WUQuery(e={}){return this.connection.WUQuery({...e,Wuid:this.Wuid}).then(s=>(this.set(s.Workunits.ECLWorkunit[0]),s)).catch(s=>{if(!s.Exception.some(n=>n.Code===20081?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw zt.warning("Unexpected exception: "),s;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),Zt.set(this),e))}WUInfo(e={}){let s=e.IncludeResults||e.IncludeResultsViewNames;return this.connection.WUInfo({...e,Wuid:this.Wuid,IncludeResults:s,IncludeResultsViewNames:s,SuppressResultSchemas:!1}).then(r=>(this.set(r.Workunit),s&&this.set({ResultViews:r.ResultViews}),r)).catch(r=>{if(!r.Exception.some(i=>i.Code===20080?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw zt.warning("Unexpected exception: "),r;return{}})}WUResubmit(e){return this.connection.WUResubmit(at({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails(at({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(s=>at({Scopes:{Scope:[]}},s))}WUAction(e){return this.connection.WUAction({Wuids:{Item:[this.Wuid]},WUActionType:e}).then(s=>this.refresh().then(()=>(this._monitor(),s)))}publish(e){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:e||this.Jobname,AllowForeignFiles:!0,Activate:w.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){let s=new Pt({baseUrl:""}),r={Wuid:this.Wuid,Cluster:this.Cluster,JobName:this.Jobname,AllowForeignFiles:!0,Activate:1,Wait:5e3,...e};return s.WUPublishWorkunitEx(r)}WUCDebug(e,s={}){let r="";for(let n in s)s.hasOwnProperty(n)&&(r+=` ${n}='${s[n]}'`);return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:`<debug:${e} uid='${this.Wuid}'${r}/>`}).then(n=>n)}debug(e,s){return this.isDebugging()?this.WUCDebug(e,s).then(r=>{let n=r.children(e);return n.length?n[0]:new we(e)}).catch(r=>(zt.error(r),Promise.resolve(new we(e)))):Promise.resolve(new we(e))}debugStatus(){return this.isDebugging()?this.debug("status").then(e=>{let s={...this.DebugState,...e.$};return this.set({DebugState:s}),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(s=>{if(s.name==="break")return s.$})}debugBreakpointAdd(e,s,r){return this.debug("breakpoint",{id:e,mode:s,action:r}).then(n=>this.debugBreakpointResponseParser(n))}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=Wn(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(s=>ea(s,e))}debugPrint(e,s=0,r=10){return this.debug("print",{edgeID:e,startRow:s,numRows:r}).then(n=>n.children().map(i=>{let o={};return i.children().forEach(a=>{o[a.name]=a.content}),o}))}},Ms="definition";function Zo(t){return t._[Ms]!==void 0}function Yo(t){let e=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(t._[Ms]);if(e){let[,s,r,n]=e;return s.replace(/\/\.\//g,"/"),{id:t._.id,file:s,line:+r,column:+n}}throw new Error(`Bad definition: ${t._[Ms]}`)}function ea(t,e){let s=[];for(let r of t.vertices)if(Zo(r)){let n=Yo(r);(n&&!e||e===n.file)&&s.push(n)}return s.sort((r,n)=>r.line-n.line)}var Yt,Cn=class t extends P{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,s){return Yt||(Yt=new t(e)),s&&Yt.set({...s}),Yt}constructor(e){super(),e instanceof Be?this.connection=e:this.connection=new Be(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(s=>e===""||s.ClusterName===e).map(s=>Ne.attach(this.connection.connectionOptions(),s.Wuid,s))}setBanner(e){return this.connection.SetBanner({...e}).then(s=>(this.set(s),this))}lazyRefresh=Zs(async()=>{let e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}};var ta=O("logicalFile.ts"),Ls=class extends T{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}},sa=new Ls,bn=class t extends P{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 properties(){return this.get()}static attach(e,s,r){return sa.get({BaseUrl:e.baseUrl,Cluster:s,Name:r},()=>new t(e,s,r))}constructor(e,s,r){super(),e instanceof Ve?this.connection=e:this.connection=new Ve(e),this.clear({Cluster:s,Name:r})}filePartsOnCluster(){return[...this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[]]}fileParts(){let e=[];for(let s of this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[])for(let r of s?.DFUFileParts?.DFUPart||[]){let n={...s,...r};delete n.DFUFileParts,e.push(n)}return e}update(e){return this.connection.DFUInfo({...e,Cluster:this.Cluster,Name:this.Name}).then(s=>(this.set({Cluster:this.Cluster,...s.FileDetail}),s))}fetchInfo(){return this.connection.DFUInfo({Cluster:this.Cluster,Name:this.Name}).then(e=>(this.set({Cluster:this.Cluster,...e.FileDetail}),e.FileDetail)).catch(e=>{if(!e.Exception.some(r=>r.Code===20038?(this.set("Name",this.Name+" (Deleted)"),this.set("StateID",999),!0):!1))throw ta.warning("Unexpected exception: "),e;return{}})}fetchDefFile(e){return this.connection.DFUFile({Name:this.Name,Format:e})}fetchListHistory(){return this.connection.ListHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}eraseHistory(){return this.connection.EraseHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}};var As=class extends T{constructor(){super(e=>e.Address)}},ra=new As,es=class t extends P{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,s,r){let n=ra.get({Address:s},()=>new t(e));return r&&n.set(r),n}constructor(e){super(),e instanceof te?this.connection=e:this.connection=new te(e)}};var Gs=class extends T{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}},na=new Gs,Me=class t extends P{connection;machineConnection;get BaseUrl(){return this.connection.baseUrl}get Name(){return this.get("Name")}get Prefix(){return this.get("Prefix")}get Type(){return this.get("Type")}get IsDefault(){return this.get("IsDefault")}get TpClusters(){return this.get("TpClusters")}get TpEclCCServers(){return this.get("TpEclCCServers")}get TpEclServers(){return this.get("TpEclServers")}get TpEclAgents(){return this.get("TpEclAgents")}get TpEclSchedulers(){return this.get("TpEclSchedulers")}get MachineInfoEx(){return this.get("MachineInfoEx",[])}get CMachineInfoEx(){return this.MachineInfoEx.map(e=>es.attach(this.machineConnection,e.Address,e))}static attach(e,s,r){let n=na.get({BaseUrl:e.baseUrl,Name:s},()=>new t(e,s));return r&&n.set({...r}),n}constructor(e,s){super(),e instanceof L?(this.connection=e,this.machineConnection=new te(e.connectionOptions())):(this.connection=new L(e),this.machineConnection=new te(e)),this.clear({Name:s})}fetchMachines(e={}){return this.machineConnection.GetTargetClusterInfo({TargetClusters:{Item:[`${this.Type}:${this.Name}`]},...e}).then(s=>{let r=[];for(let n of s.TargetClusterInfoList.TargetClusterInfo)for(let i of n.Processes.MachineInfoEx)r.push(i);return this.set("MachineInfoEx",r),this.CMachineInfoEx})}machineStats(){let e=0,s=0,r=0;for(let n of this.CMachineInfoEx)for(let i of n.Storage.StorageInfo){s+=i.Available,r+=i.Total;let o=1-i.Available/i.Total;o>e&&(e=o)}return{maxDisk:e,meanDisk:1-(r?s/r:1)}}fetchUsage(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])}};function Xd(t){let e;return t instanceof L?e=t:e=new L(t),e.TpListTargetClusters({}).then(s=>s.TargetClusters.TpClusterNameType.map(r=>Me.attach(t,r.Name,r)))}var ws={};function Kd(t){if(!ws[t.baseUrl]){let e;t instanceof L?e=t:e=new L(t),ws[t.baseUrl]=e.TpListTargetClusters({}).then(s=>{let r,n,i;s.TargetClusters.TpClusterNameType.forEach(a=>{r||(r=a),!n&&a.IsDefault===!0&&(n=a),!i&&a.Type==="hthor"&&(i=a)});let o=n||i||r;return Me.attach(t,o.Name,o)})}return ws[t.baseUrl]}var Qs=class extends T{constructor(){super(e=>e.BaseUrl)}},ia=new Qs,ts=class t extends P{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=>Me.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e){return ia.get({BaseUrl:e.baseUrl},()=>new t(e))}constructor(e){super(),e instanceof L?this.connection=e:this.connection=new L(e)}GetESPServiceBaseURL(e=""){return this.connection.TpServiceQuery({}).then(s=>{let r=this.connection.protocol(),n=this.connection.ip(),i=r==="https:"?"18002":"8002";if($("ServiceList.TpEspServers.TpEspServer",s)){for(let o of s.ServiceList.TpEspServers.TpEspServer)if($("TpBindings.TpBinding",o))for(let a of o.TpBindings.TpBinding)a.Service===e&&a.Protocol+":"===r&&(i=a.Port)}return`${r}//${n}:${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(s=>(this.set({LogicalClusters:s.TpLogicalClusters.TpLogicalCluster}),this.LogicalClusters))}fetchServices(e={}){return this.connection.TpServiceQuery(e).then(s=>(this.set({Services:s.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,s,r){if(this.isCallback(s))switch(e){case"changed":super.on(e,s);break;default:}else switch(e){case"changed":super.on(e,s,r);break;default:}return this._monitor(),this}};function ne(t,e,s){e==="__proto__"||e==="constructor"||e==="prototype"||(t[e]=s)}function tt(t){return t=""+t,t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g," ").replace(/\r/g," ")}function oa(t){if(t){if(!isNaN(+t))return parseFloat(t)}else return 0;let s=/(?:(?:(\d+).days.)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+\.\d+|\d+)s))|(?:(\d+\.\d+|\d+)ms|(\d+\.\d+|\d+)us|(\d+\.\d+|\d+)ns)/.exec(t);if(!s)return 0;let r=+s[1]||0,n=+s[2]||0,i=+s[3]||0,o=+s[4]||0,a=+s[5]||0,c=+s[6]||0,p=+s[7]||0;return r*24*60*60+n*60*60+i*60+o+a/1e3+c/1e6+p/1e9}function ie(t,e){let s=t.indexOf(e);return s!==-1?parseFloat(t.substring(0,s)):-1}function aa(t){if(t){if(!isNaN(+t))return parseFloat(t)}else return 0;let e=ie(t,"Kb");return e>=0?e*1024:(e=ie(t,"Mb"),e>=0?e*Math.pow(1024,2):(e=ie(t,"Gb"),e>=0?e*Math.pow(1024,3):(e=ie(t,"Tb"),e>=0?e*Math.pow(1024,4):(e=ie(t,"Pb"),e>=0?e*Math.pow(1024,5):(e=ie(t,"Eb"),e>=0?e*Math.pow(1024,6):(e=ie(t,"Zb"),e>=0?e*Math.pow(1024,7):(e=ie(t,"b"),e>=0?e:0)))))))}function ua(t){return t?parseFloat(t):0}var Vs=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,s,r,n){this.noSpills=n,e.forEach(i=>{this.graph.isVertex(i)?(this.calcInVertexVisibility(i,r),this.calcOutVertexVisibility(i,r)):this.graph.isEdge(i)?(this.calcInVertexVisibility(i.getSource(),r-1),this.calcOutVertexVisibility(i.getTarget(),r-1)):this.graph.isSubgraph(i)&&(this.m_visibleSubgraphs[i.__hpcc_id]=i,this.calcSubgraphVisibility(i,s-1))}),this.calcVisibility2()}calcInVertexVisibility(e,s){this.noSpills&&e.isSpill()&&s++,this.m_visibleVertices[e.__hpcc_id]=e,s>0&&e.getInEdges().forEach(r=>{this.calcInVertexVisibility(r.getSource(),s-1)})}calcOutVertexVisibility(e,s){this.noSpills&&e.isSpill()&&s++,this.m_visibleVertices[e.__hpcc_id]=e,s>0&&e.getOutEdges().forEach(r=>{this.calcOutVertexVisibility(r.getTarget(),s-1)})}calcSubgraphVisibility(e,s){if(s<0)return;s>0&&e.__hpcc_subgraphs.forEach((n,i)=>{this.calcSubgraphVisibility(n,s-1)}),e.__hpcc_subgraphs.forEach((n,i)=>{this.m_visibleSubgraphs[n.__hpcc_id]=n}),e.__hpcc_vertices.forEach((n,i)=>{this.m_visibleVertices[n.__hpcc_id]=n});let r={};this.graph.edges.forEach((n,i)=>{n.getSource().__hpcc_parent!==n.getTarget().__hpcc_parent&&e===this.getCommonAncestor(n)&&(r[n.getSource().__hpcc_parent.__hpcc_id+"::"+n.getTarget().__hpcc_parent.__hpcc_id]||(r[n.getSource().__hpcc_parent.__hpcc_id+"::"+n.getTarget().__hpcc_parent.__hpcc_id]=!0,this.m_visibleEdges[n.__hpcc_id]=n))})}buildVertexString(e,s){let r="",n="",i=e.getProperties();for(let o in i)s&&o.indexOf("_kind")>=0?n+='<att name="_kind" value="point"/>':o==="id"||o==="label"?r+=" "+o+'="'+tt(i[o])+'"':n+='<att name="'+o+'" value="'+tt(i[o])+'"/>';return"<node"+r+">"+n+"</node>"}buildEdgeString(e){let s="",r="",n=e.getProperties();for(let i in n)i.toLowerCase()==="id"||i.toLowerCase()==="label"||i.toLowerCase()==="source"||i.toLowerCase()==="target"?s+=" "+i+'="'+tt(n[i])+'"':r+='<att name="'+i+'" value="'+tt(n[i])+'"/>';return"<edge"+s+">"+r+"</edge>"}getAncestors(e,s){let r=e.__hpcc_parent;for(;r;)s.push(r),r=r.__hpcc_parent}getCommonAncestorV(e,s){let r=[],n=[];this.getAncestors(e,r),this.getAncestors(s,n);let i=r.length-1,o=n.length-1,a=null;for(;i>=0&&o>=0&&r[i]===n[o];)a=r[i],--i,--o;return a}getCommonAncestor(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())}calcAncestorVisibility(e){let s=[];this.getAncestors(e,s),s.forEach((r,n)=>{this.m_visibleSubgraphs[r.__hpcc_id]=r})}calcVisibility2(){for(let e in this.m_visibleVertices){let s=this.m_visibleVertices[e];s.getInEdges().forEach((r,n)=>{this.m_visibleEdges[r.__hpcc_id]=r}),s.getOutEdges().forEach((r,n)=>{this.m_visibleEdges[r.__hpcc_id]=r}),this.calcAncestorVisibility(s)}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 s=this.m_visibleEdges[e],r=s.getSource();for(this.addSemiVisibleVertex(r);this.noSpills&&r.isSpill();){let i=r.getInEdges();if(i.length)this.addSemiVisibleEdge(i[0]),r=i[0].getSource(),this.addSemiVisibleVertex(r);else break}let n=s.getTarget();for(this.addSemiVisibleVertex(n);this.noSpills&&n.isSpill();){let i=n.getOutEdges();if(i.length)this.addSemiVisibleEdge(i[0]),n=i[0].getTarget(),this.addSemiVisibleVertex(n);else break}}}writeXgmml(){this.subgraphVisited(this.graph.subgraphs[0],!0),this.graph.edges.forEach((e,s)=>{this.edgeVisited(e)})}subgraphVisited(e,s=!1){if(this.m_visibleSubgraphs[e.__hpcc_id]){let r="";this.m_xgmml+=s?"":'<node id="'+e.__hpcc_id+'"><att><graph>';let n=this.m_xgmml.length;if(e.walkSubgraphs(this),e.walkVertices(this),n===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)r+='<att name="'+o+'" value="'+tt(i[o])+'"/>';this.m_xgmml+=s?"":"</graph></att>"+r+"</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))}},st=class{__hpcc_graph;__hpcc_parent;__widget;__hpcc_id;_globalID;constructor(e,s){this.__hpcc_graph=e,this.__hpcc_id=s,this._globalID=s}getProperties(){let e={};for(let s in this)s.indexOf("__")!==0&&this.hasOwnProperty(s)&&(e[s]=this[s]);return e}},oe=class extends st{_globalType;__hpcc_subgraphs;__hpcc_vertices;__hpcc_edges;id;constructor(e,s){super(e,s),this._globalType=s==="0"?"Graph":"Cluster",this.__hpcc_subgraphs=[],this.__hpcc_vertices=[],this.__hpcc_edges=[],this.id=s}addSubgraph(e){e.__hpcc_parent=this,this.__hpcc_subgraphs.some(s=>e===s)||this.__hpcc_subgraphs.push(e)}addVertex(e){e.__hpcc_parent=this,this.__hpcc_vertices.some(s=>e===s)||this.__hpcc_vertices.push(e)}removeVertex(e){this.__hpcc_vertices=this.__hpcc_vertices.filter(s=>e!==s)}addEdge(e){e.__hpcc_parent=this,this.__hpcc_edges.some(s=>e===s)||this.__hpcc_edges.push(e)}removeEdge(e){this.__hpcc_edges=this.__hpcc_edges.filter(s=>e!==s)}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((s,r)=>{e.subgraphVisited(s)&&s.walkSubgraphs(e)})}walkVertices(e){this.__hpcc_vertices.forEach((s,r)=>{e.vertexVisited(s)})}},De=class extends st{_globalType="Vertex";_isSpill;constructor(e,s){super(e,s)}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(s=>{s.remove()}),this.getOutEdges().forEach(s=>{s.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)}},Re=class extends st{_globalType="Edge";_sourceActivity;source;_targetActivity;target;constructor(e,s){super(e,s),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]}},ss=class t{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 r=new DOMParser().parseFromString(e,"text/xml");this.walkDocument(r.documentElement,"0")}isSubgraph(e){return e instanceof oe}isVertex(e){return e instanceof De}isEdge(e){return e instanceof Re}getGlobalType(e){return e instanceof De?3:e instanceof Re?4:e instanceof oe?2:e instanceof t?1:0}getGlobalTypeString(e){return e instanceof De?"Vertex":e instanceof Re?"Edge":e instanceof oe?"Cluster":e instanceof t?"Graph":"Unknown"}getItem(e,s){if(!this.idx[s])switch(e.tagName){case"graph":let n=new oe(this,s);this.subgraphs.push(n),this.idx[s]=n;break;case"node":let i=new De(this,s);this.vertices.push(i),this.idx[s]=i;break;case"edge":let o=new Re(this,s);this.edges.push(o),this.idx[s]=o;break;default:console.warn("Graph.getItem - Unknown Node Type!");break}let r=this.idx[s];return Array.from(e.attributes).forEach(n=>{ne(r,n.name,n.value)}),r}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof oe?this.subgraphs=this.subgraphs.filter(s=>e!==s):e instanceof De?this.vertices=this.vertices.filter(s=>e!==s):e instanceof Re&&(this.edges=this.edges.filter(s=>e!==s))}getChildByTagName(e,s){let r=null;return Array.from(e.childNodes).some(n=>{if(n.tagName===s)return r=n,!0}),r}walkDocument(e,s){let r=this.getItem(e,s);return e.childNodes.forEach(n=>{switch(n.nodeType){case 1:switch(n.tagName){case"graph":break;case"node":let i=!1,o=this.getChildByTagName(n,"att");if(o){let l=this.getChildByTagName(o,"graph");if(l){i=!0;let d=this.walkDocument(l,n.getAttribute("id"));r.addSubgraph(d)}}if(!i){let l=this.walkDocument(n,n.getAttribute("id"));r.addVertex(l)}break;case"att":let a=n.getAttribute("name"),c="_"+a,p=n.getAttribute("value");a.indexOf("Time")===0?(ne(r,c,p),ne(r,a,""+oa(p))):a.indexOf("Size")===0?(ne(r,c,p),ne(r,a,""+aa(p))):a.indexOf("Skew")===0?(ne(r,c,p),ne(r,a,""+ua(p))):ne(r,a,p);break;case"edge":let u=this.walkDocument(n,n.getAttribute("id"));if(u.NumRowsProcessed!==void 0?u._eclwatchCount=u.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):u.Count!==void 0?u._eclwatchCount=u.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):u.count!==void 0&&(u._eclwatchCount=u.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),u.inputProgress&&(u._eclwatchInputProgress="["+u.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),u.SkewMaxRowsProcessed&&u.SkewMinRowsProcessed&&(u._eclwatchSkew="+"+u.SkewMaxRowsProcessed+", "+u.SkewMinRowsProcessed),!u._dependsOn){if(!u._childGraph){if(u._sourceActivity||u._targetActivity){u._isSpill=!0;let l=u.getSource();l._isSpill=!0;let d=u.getTarget();d._isSpill=!0}}}r.addEdge(u);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}}),r}removeSubgraphs(){[...this.subgraphs].forEach(s=>{s.__hpcc_parent instanceof oe&&s.remove()})}removeSpillVertices(){[...this.vertices].forEach(s=>{s.isSpill()&&s.remove()})}getLocalisedXGMML(e,s,r,n){let i=new Vs(this);return i.calcVisibility(e,s,r,n),i.writeXgmml(),"<graph>"+i.m_xgmml+"</graph>"}};var Os=O("@hpcc-js/comms/ecl/query.ts"),ca=Ie("~s");function la(t){return!isNaN(parseFloat(t))&&!isNaN(t-0)}var qs=class extends T{constructor(){super(e=>T.hash([e.QueryId,e.QuerySet]))}},pa=new qs,Un=class t extends P{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,s,r,n){super(),e instanceof N?this.wsWorkunitsService=e:this.wsWorkunitsService=new N(e),this.topology=ts.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:s,QueryId:r,...n})}static attach(e,s,r){return pa.get({BaseUrl:e.baseUrl,QuerySet:s,QueryId:r},()=>new t(e,s,r))}_eclService;async wsEclService(){return this._eclService||(this._eclService=this.topology.fetchServices({}).then(e=>{for(let s of e?.TpEspServers?.TpEspServer??[])for(let r of s?.TpBindings?.TpBinding??[])if(r?.Service==="ws_ecl"){let n=`${r.Protocol}://${globalThis.location.hostname}:${r.Port}`;return new xt({baseUrl:n})}})),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(s){Os.debug(s.message??s),this._requestSchema=[]}}async fetchResponseSchema(){let e=await this.wsEclService();try{this._responseSchema=await e?.responseJson(this.QuerySet,this.QueryId)??{}}catch(s){Os.debug(s.message??s),this._responseSchema={}}}async fetchSchema(){await Promise.all([this.fetchRequestSchema(),this.fetchResponseSchema()])}fetchSummaryStats(){return this.wsWorkunitsService.WUQueryGetSummaryStats({Target:this.QuerySet,QueryId:this.QueryId})}fetchGraph(e="",s=""){return this.wsWorkunitsService.WUQueryGetGraph({Target:this.QuerySet,QueryId:this.QueryId,GraphName:e,SubGraphId:s}).then(r=>{let n=new ss,i=!0;for(let o of r?.Graphs?.ECLGraphEx||[])i?(n.load(o.Graph),i=!1):n.merge(o.Graph);return n})}fetchDetailsNormalized(e={}){let s=Ne.attach(this.wsWorkunitsService,this.Wuid);return s?Promise.all([this.fetchGraph(),s.fetchDetailsMeta(),s.fetchDetailsRaw(e)]).then(r=>{let n=r[0],i=r[1],a=r[2].map(c=>{if(c.Id[0]==="a"||c.Id[0]==="e"){let p=n.idx[c.Id.substring(1)];for(let u in p)if(u.charAt(0)!=="_"&&u.charAt(0)===u.charAt(0).toUpperCase()&&(typeof p[u]=="string"||typeof p[u]=="number"||typeof p[u]=="boolean")&&!c.Properties.Property.some(l=>l.Name===u)){let d=la(p[u])?parseFloat(p[u]):p[u],U=p[u];u.indexOf("Time")>=0&&(d=d/1e9,U=ca(d)+"s"),c.Properties.Property.push({Name:u,RawValue:d,Formatted:U})}}return c});return s.normalizeDetails(i,a)}):Promise.resolve({meta:void 0,columns:void 0,data:void 0})}async submit(e){let s=await this.wsEclService();try{return s?.submit(this.QuerySet,this.QueryId,e).then(r=>{for(let n in r)r[n]=r[n].Row;return r})??[]}catch(r){return Os.debug(r.message??r),[]}}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 s in this.responseFields())e.push(s);return e}resultFields(e){return this._responseSchema[e]?this._responseSchema[e]:[]}};var Bs=class extends T{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}},ga=new Bs,Ce=class extends as{constructor(s,r,n){super();this.key=s;this.value=r;this.oldValue=n}get canConflate(){return!0}conflate(s){return this.key===s.key?(this.value=s.value,!0):!1}void(){return this.value===this.oldValue}},Pn=class t{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new us;static attach(e,s="HPCCApps",r,n=!0){return ga.get({BaseUrl:e.baseUrl,Name:s,UserSpecific:n,Namespace:r},()=>new t(e,s,r,n))}constructor(e,s,r,n){e instanceof je?this.connection=e:this.connection=new je(e),this.Name=s,this.UserSpecific=n,this.Namespace=r}_knownValues={};create(){this.connection.CreateStore({Name:this.Name,UserSpecific:this.UserSpecific,Type:"",Description:""})}set(e,s,r=!0){return this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e,Value:s}).then(n=>{let i=this._knownValues[e];this._knownValues[e]=s,r&&this._dispatch.post(new Ce(e,s,i))}).catch(n=>{console.error(`Store.set("${e}", "${s}") failed:`,n)})}get(e,s=!0){return this.connection.Fetch({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(r=>{let n=this._knownValues[e];return this._knownValues[e]=r.Value,s&&this._dispatch.post(new Ce(e,r.Value,n)),r.Value}).catch(r=>{console.error(`Store.get(${e}) failed:`,r)})}getAll(e=!0){return this.connection.FetchAll({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace}).then(s=>{let r={},n=this._knownValues;if(this._knownValues={},s.Pairs.Pair.forEach(i=>{let o=this._knownValues[i.Key];this._knownValues[i.Key]=i.Value,delete n[i.Key],r[i.Key]=i.Value,e&&this._dispatch.post(new Ce(i.Key,i.Value,o))}),e)for(let i in n)this._dispatch.post(new Ce(i,void 0,n[i]));return r}).catch(s=>(console.error("Store.getAll failed:",s),{}))}delete(e,s=!0){return this.connection.Delete({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(r=>{let n=this._knownValues[e];delete this._knownValues[e],s&&this._dispatch.post(new Ce(e,void 0,n))}).catch(r=>{console.error(`Store.delete(${e}) failed:`,r)})}monitor(e){return this._dispatch.attach(e)}};var da=O("@hpcc-js/comms/dfuWorkunit.ts");var js=class extends T{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}},Fn=new js,En=class t extends P{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,s){let r=new t(e);return r.connection.CreateDFUWorkunit({DFUServerQueue:s}).then(n=>(Fn.set(r),r.set(n.result),r))}static attach(e,s,r){let n=Fn.get({BaseUrl:e.baseUrl,ID:s},()=>new t(e,s));return r&&n.set(r),n}static sprayFixed(e,s){let r=new ge(e);return r.SprayFixedEx({...s}).then(n=>{let i=n.wuid;return r.GetDFUWorkunit({wuid:i}).then(o=>t.attach(e,i,o.result))})}static sprayVariable(e,s){let r=new ge(e);return r.SprayVariableEx({...s}).then(n=>{let i=n.wuid;return r.GetDFUWorkunit({wuid:i}).then(o=>t.attach(e,i,o.result))})}static despray(e,s){let r=new ge(e);return r.DesprayEx({...s}).then(n=>{let i=n.wuid;return r.GetDFUWorkunit({wuid:i}).then(o=>t.attach(e,i,o.result))})}update(e){return this.connection.UpdateDFUWorkunitEx({wu:{JobName:e?.wu?.JobName??this.JobName,isProtected:e?.wu?.isProtected??this.isProtected,ID:this.ID,State:this.State},ClusterOrig:this.ClusterName,JobNameOrig:this.JobName,isProtectedOrig:this.isProtected,StateOrig:this.State})}isComplete(){switch(this.State){case 6:case 5:case 4:case 999:return!0;default:}return!1}isFailed(){return!!(this.isComplete()&&this.State!==6)}isDeleted(){switch(this.State){case 999:return!0;default:}return!1}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(Qe.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(s=>s).catch(s=>"")}DFUWUAction(e){return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:e}).then(s=>e===Qe.DFUWUActions.Delete?s:this.refresh().then(()=>(this._monitor(),s)))}on(e,s,r){if(this.isCallback(s))switch(e){case"finished":super.on("propChanged","State",n=>{this.isComplete()&&s([n])});break;case"changed":super.on(e,s);break;default:}else switch(e){case"changed":super.on(e,s,r);break;default:}return this._monitor(),this}watchUntilComplete(e){return new Promise((s,r)=>{let n=this.watch(i=>{e&&e(i),this.isComplete()&&(n.release(),s(this))})})}watchUntilRunning(e){return new Promise((s,r)=>{let n=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(n.release(),s(this))})})}constructor(e,s){super(),this.connection=new ge(e),this.topologyConnection=new L(e),this.clearState(s)}clearState(e){this.clear({ID:e,State:0})}GetDFUWorkunit(e={}){return this.connection.GetDFUWorkunit({...e,wuid:this.ID}).then(s=>(this.set(s.result),s)).catch(s=>{if(!s.Exception.some(n=>n.Code===20080||n.Code===20081?(this.clearState(this.ID),this.set("State",999),!0):!1))throw da.warning("Unexpected exception: "),s;return{}})}};export{ar as AccessService,ur as AccountService,Cn as Activity,We as Attribute,ma as BUILD_VERSION,vs as BaseScope,cr as CloudService,lr as CodesignService,ls as Connection,Cu as DFUArrayActions,Uu as DFUChangeProtection,Pu as DFUChangeRestriction,bu as DFUDefFileFormat,Ve as DFUService,En as DFUWorkunit,js as DFUWorkunitCache,gr as DFUXRefService,pr as DaliService,Mt as ECLGraph,Ge as ESPConnection,Y as ESPExceptions,xt as EclService,fr as ElkService,Qe as FileSpray,ge as FileSprayService,oi as FileSprayStates,_s as GlobalResultCache,Lt as GraphCache,ui as LogType,mr as LogaccessService,bn as LogicalFile,Ls as LogicalFileCache,es as Machine,As as MachineCache,te as MachineService,fa as PKG_NAME,ha as PKG_VERSION,Wr as PackageProcessService,Xo as PropertyType,Un as Query,ss as QueryGraph,Ko as RelatedProperty,Gt as Resource,Dr as ResourcesService,Xt as Result,Kt as ResultCache,Be as SMCService,Cr as SashaService,Ye as Scope,Sn as ScopeEdge,At as ScopeGraph,mn as ScopeSubgraph,xn as ScopeVertex,S as Service,Ht as SourceFile,Pn as Store,Bs as StoreCache,je as StoreService,ci as TargetAudience,Me as TargetCluster,Gs as TargetClusterCache,Jt as Timer,ts as Topology,Qs as TopologyCache,L as TopologyService,Ce as ValueChangedMessage,ds as WUStateID,fe as WUUpdate,Ne as Workunit,Ns as WorkunitCache,N as WorkunitsService,Pt as WorkunitsServiceEx,or as WsAccess,Te as WsDfu,k as WsLogaccess,br as WsSMC,Rr as WsSasha,Ur as WsTopology,w as WsWorkunits,hn as XGMMLEdge,Ts as XGMMLGraph,dn as XGMMLSubgraph,fn as XGMMLVertex,Qt as XSDNode,qt as XSDSchema,Ot as XSDSimpleType,Vt as XSDXMLNode,lt as createConnection,wt as createGraph,Wn as createXGMMLGraph,Kd as defaultTargetCluster,Zn as deserializeResponse,si as get,Ga as hookSend,wa as instanceOfIConnection,Aa as instanceOfIOptions,ni as isArray,Fr as isECLResult,Ka as isExceptions,Cp as isWUInfoWorkunit,Rp as isWUQueryECLWorkunit,Yn as jsonp,ks as parseXSD,Gg as parseXSD2,ti as post,ri as send,pe as serializeRequest,Qa as setTransportFactory,$o as splitMetric,Xd as targetClusters};
|
|
6
|
+
</div>`}},qe=class extends Cs{static{o(this,"Scope")}wu;constructor(e,t){super(t),this.wu=e}};import{StateObject as Do}from"@hpcc-js/util";var _t=class extends Do{static{o(this,"SourceFile")}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,n){super(),e instanceof L?this.connection=e:this.connection=new L(e),this.set({Wuid:t,...n})}};import{espTime2Seconds as Co,StateObject as Uo}from"@hpcc-js/util";var Gt=class extends Uo{static{o(this,"Timer")}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,n){super(),e instanceof L?this.connection=e:this.connection=new L(e);let r=Co(n.Value);this.set({Wuid:t,Seconds:Math.round(r*1e3)/1e3,HasSubGraphId:n.SubGraphId!==void 0,...n})}};var To=Ct("%Y-%m-%dT%H:%M:%S.%LZ"),Eo=Ut("%Y-%m-%dT%H:%M:%S.%LZ"),Io=Ue(",");function ko(s){return s&&!isNaN(+s)?Io(+s):s}o(ko,"formatNum");function sr(s,e,t){s[e]===void 0||s[e][t]===void 0||e==="__proto__"||e==="constructor"||e==="prototype"||delete s[e][t]}o(sr,"safeDelete");var Oe="DefinitionList",No=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,Lo=["Avg","Min","Max","Delta","StdDev"],Ao=["SkewMin","SkewMax","NodeMin","NodeMax"],Mo=/[A-Z][a-z]*/g;function vo(s){for(let t of Ao){let n=s.indexOf(t);if(n===0){let r="",i=s.slice(n+t.length);return{measure:r,ext:t,label:i}}}let e=s.match(Mo);if(e?.length){let t=e.shift(),n=e.join("");for(let r of Lo){let i=n.indexOf(r);if(i===0)return n=n.slice(i+r.length),{measure:t,ext:r,label:n}}return{measure:t,ext:"",label:n}}return{measure:"",ext:"",label:s}}o(vo,"_splitMetric");var nr={};function wo(s){let e=nr[s];return e||(e=vo(s),nr[s]=e),e}o(wo,"splitMetric");function j(s,e){return s.__formattedProps?.[e]??s[e]}o(j,"formatValue");function Qt(s){if(s===void 0)return;let e=parseFloat(s);return isNaN(e)?void 0:e}o(Qt,"safeParseFloat");function _o(s,e,t){let n=wo(e);if(!t[n.measure]){t[n.label]=!0;let r=Qt(s[`${n.measure}Avg${n.label}`]),i=Qt(s[`${n.measure}Min${n.label}`]),a=Qt(s[`${n.measure}Max${n.label}`]),u=Qt(s[`${n.measure}StdDev${n.label}`]),l=Math.max((r-i)/u,(a-r)/u);return{Key:`${n.measure}${n.label}`,Value:j(s,`${n.measure}${n.label}`),Avg:j(s,`${n.measure}Avg${n.label}`),Min:j(s,`${n.measure}Min${n.label}`),Max:j(s,`${n.measure}Max${n.label}`),Delta:j(s,`${n.measure}Delta${n.label}`),StdDev:j(s,`${n.measure}StdDev${n.label}`),StdDevs:isNaN(l)?void 0:l,SkewMin:j(s,`SkewMin${n.label}`),SkewMax:j(s,`SkewMax${n.label}`),NodeMin:j(s,`NodeMin${n.label}`),NodeMax:j(s,`NodeMax${n.label}`)}}return null}o(_o,"formatValues");var Vt=bo("workunit.ts"),bs=class extends Po{static{o(this,"WorkunitCache")}constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}},qt=new bs,Te=class s extends Fo{static{o(this,"Workunit")}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")||zt[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 wt;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,()=>vt.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 Gt(this.connection,this.Wuid,e))}_graphCache=new bt;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 Pt(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 Et(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 _t(this.connection,this.Wuid,e))}get VariableCount(){return this.get("VariableCount",0)}get Variables(){return this.get("Variables",{ECLResult:[]})}get TimerCount(){return this.get("TimerCount",0)}get HasDebugValue(){return this.get("HasDebugValue")}get ApplicationValueCount(){return this.get("ApplicationValueCount",0)}get XmlParams(){return this.get("XmlParams")}get AccessFlag(){return this.get("AccessFlag")}get ClusterFlag(){return this.get("ClusterFlag")}get ResultViewCount(){return this.get("ResultViewCount",0)}get DebugValueCount(){return this.get("DebugValueCount",0)}get WorkflowCount(){return this.get("WorkflowCount",0)}get Archived(){return this.get("Archived")}get RoxieCluster(){return this.get("RoxieCluster")}get DebugState(){return this.get("DebugState",{})}get Queue(){return this.get("Queue")}get Active(){return this.get("Active")}get Action(){return this.get("Action")}get Scope(){return this.get("Scope")}get AbortBy(){return this.get("AbortBy")}get AbortTime(){return this.get("AbortTime")}get Workflows(){return this.get("Workflows")}get TimingData(){return this.get("TimingData")}get HelpersDesc(){return this.get("HelpersDesc")}get GraphsDesc(){return this.get("GraphsDesc")}get SourceFilesDesc(){return this.get("SourceFilesDesc")}get ResultsDesc(){return this.get("ResultsDesc")}get VariablesDesc(){return this.get("VariablesDesc")}get TimersDesc(){return this.get("TimersDesc")}get DebugValuesDesc(){return this.get("DebugValuesDesc")}get ApplicationValuesDesc(){return this.get("ApplicationValuesDesc")}get WorkflowsDesc(){return this.get("WorkflowsDesc")}get ServiceNames(){return this.get("ServiceNames")}get CompileCost(){return this.get("CompileCost")}get ExecuteCost(){return this.get("ExecuteCost")}get FileAccessCost(){return this.get("FileAccessCost")}get NoAccess(){return this.get("NoAccess")}get ECLWUProcessList(){return this.get("ECLWUProcessList")}static create(e){let t=new s(e);return t.connection.WUCreate().then(n=>(qt.set(t),t.set(n.Workunit),t))}static attach(e,t,n){let r=qt.get({BaseUrl:e.baseUrl,Wuid:t},()=>new s(e,t));return n&&r.set(n),r}static existsLocal(e,t){return qt.has({BaseUrl:e,Wuid:t})}static submit(e,t,n,r=!1){return s.create(e).then(i=>i.update({QueryText:n})).then(i=>r?i.submit(t,ue.Action.Compile):i.submit(t))}static compile(e,t,n){return s.submit(e,t,n,!0)}static query(e,t){return new L(e).WUQuery(t).then(r=>r.Workunits.ECLWorkunit.map(function(i){return s.attach(e,i.Wuid,i)}))}constructor(e,t){super(),this.connection=new L(e),this.topologyConnection=new M(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=ue.Action.Run,n){let r;return e!==void 0?r=Promise.resolve(e):r=this.topologyConnection.DefaultTpLogicalClusterQuery().then(i=>i.Name),this._debugMode=!1,t===ue.Action.Debug&&(t=ue.Action.Run,this._debugMode=!0),r.then(i=>this.connection.WUUpdate({Wuid:this.Wuid,Action:t,ResultLimit:n,DebugValues:{DebugValue:[{Name:"Debug",Value:this._debugMode?"1":""}]}}).then(a=>(this.set(a.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===ue.Action.Compile;case 3:case 4:case 7:case 999:return!0;default:}return!1}isFailed(){switch(this.StateID){case 7:case 4:return!0;default:}return!1}isDeleted(){switch(this.StateID){case 999:return!0;default:}return!1}isDebugging(){switch(this.StateID){case 14:case 15:return!0;default:}return this._debugMode}isRunning(){switch(this.StateID){case 1:case 2:case 6:case 8:case 14:case 15:return!0;default:}return!1}setToFailed(){return this.WUAction(w.ECLWUActions.SetToFailed)}pause(){return this.WUAction(w.ECLWUActions.Pause)}pauseNow(){return this.WUAction(w.ECLWUActions.PauseNow)}resume(){return this.WUAction(w.ECLWUActions.Resume)}abort(){return this.WUAction(w.ECLWUActions.Abort)}protect(){return this.WUAction(w.ECLWUActions.Protect)}unprotect(){return this.WUAction(w.ECLWUActions.Unprotect)}delete(){return this.WUAction(w.ECLWUActions.Delete)}restore(){return this.WUAction(w.ECLWUActions.Restore)}deschedule(){return this.WUAction(w.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(w.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=>s.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 n={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},r=[];for(let i of t){let a={},u={};if(i&&i.Id&&i.Properties&&i.Properties.Property)for(let c in i.Properties.Property){let p=i.Properties.Property[c];switch(p.Measure==="ns"&&(p.Measure="s"),n[p.Name]={...p},sr(n,p.Name,"RawValue"),sr(n,p.Name,"Formatted"),p.Measure){case"bool":a[p.Name]=!!+p.RawValue;break;case"sz":a[p.Name]=+p.RawValue;break;case"s":a[p.Name]=+p.RawValue/1e9;break;case"ns":a[p.Name]=+p.RawValue;break;case"ts":a[p.Name]=new Date(+p.RawValue/1e3).toISOString();break;case"cnt":a[p.Name]=+p.RawValue;break;case"cost":a[p.Name]=+p.RawValue/1e6;break;case"cpu":case"skw":case"node":case"ppm":case"ip":case"cy":case"en":case"txt":case"id":case"fname":default:a[p.Name]=p.RawValue}u[p.Name]=ko(p.Formatted??a[p.Name])}let l={id:i.Id,name:i.ScopeName,type:i.ScopeType,Kind:i.Kind,Label:i.Label,__formattedProps:u,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...a};if(l[Oe])try{let c=JSON.parse(l[Oe].split("\\").join("\\\\"));l[Oe]=[],c.forEach((p,m)=>{let b=p.match(No);if(b){let E=(b[1]??"")+b[2]+b[3],V=parseInt(b[5]),W=parseInt(b[6]);l[Oe].push({filePath:E,line:V,col:W})}})}catch{Vt.error(`Unexpected "DefinitionList": ${l[Oe]}`)}let d={};for(let c in l)if(c.indexOf("__")!==0){let p=_o(l,c,d);p&&(l.__groupedProps[p.Key]=p,!isNaN(p.StdDevs)&&l.__StdDevs<p.StdDevs&&(l.__StdDevs=p.StdDevs,l.__StdDevsSource=p.Key))}r.push(l)}return{meta:e,columns:n,data:r}}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(n=>new qe(this,n)))}fetchDetailsHierarchy(e={}){return this.WUDetails(e).then(t=>{let n=[],r={};t.Scopes.Scope.forEach(i=>{if(r[i.ScopeName])return r[i.ScopeName].update(i),null;{let a=new qe(this,i);return r[a.ScopeName]=a,a}});for(let i in r)if(r.hasOwnProperty(i)){let a=r[i],u=a.parentScope();u&&r[u]?r[u].children().push(a):n.push(a)}return n})}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=>Tt(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 n=[];for(let r in t){let i=t[r];if(i.start&&i.elapsed){let a=Eo(i.start);a.setMilliseconds(a.getMilliseconds()+i.elapsed/1e6),i.finish=To(a),n.push(i)}}return n.sort((r,i)=>r.start<i.start?-1:r.start>i.start?1:0),n})}_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,n){if(this.isCallback(t))switch(e){case"completed":super.on("propChanged","StateID",r=>{this.isComplete()&&t([r])});break;case"changed":super.on(e,t);break;default:}else switch(e){case"changed":super.on(e,t,n);break;default:}return this._monitor(),this}watchUntilComplete(e){return new Promise((t,n)=>{let r=this.watch(i=>{e&&e(i),this.isComplete()&&(r.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,n)=>{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=>(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 Vt.warning("Unexpected exception: "),t;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),qt.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(n=>(this.set(n.Workunit),t&&this.set({ResultViews:n.ResultViews}),n)).catch(n=>{if(!n.Exception.some(i=>i.Code===20080?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw Vt.warning("Unexpected exception: "),n;return{}})}WUResubmit(e){return this.connection.WUResubmit(Us({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails(Us({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=>Us({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:w.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){let t=new mt({baseUrl:""}),n={Wuid:this.Wuid,Cluster:this.Cluster,JobName:this.Jobname,AllowForeignFiles:!0,Activate:1,Wait:5e3,...e};return t.WUPublishWorkunitEx(n)}WUCDebug(e,t={}){let n="";for(let r in t)t.hasOwnProperty(r)&&(n+=` ${r}='${t[r]}'`);return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:`<debug:${e} uid='${this.Wuid}'${n}/>`}).then(r=>r)}debug(e,t){return this.isDebugging()?this.WUCDebug(e,t).then(n=>{let r=n.children(e);return r.length?r[0]:new Ps(e)}).catch(n=>(Vt.error(n),Promise.resolve(new Ps(e)))):Promise.resolve(new Ps(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,n){return this.debug("breakpoint",{id:e,mode:t,action:n}).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=Yn(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(t=>Vo(t,e))}debugPrint(e,t=0,n=10){return this.debug("print",{edgeID:e,startRow:t,numRows:n}).then(r=>r.children().map(i=>{let a={};return i.children().forEach(u=>{a[u.name]=u.content}),a}))}},Fs="definition";function Go(s){return s._[Fs]!==void 0}o(Go,"hasECLDefinition");function Qo(s){let e=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(s._[Fs]);if(e){let[,t,n,r]=e;return t.replace(/\/\.\//g,"/"),{id:s._.id,file:t,line:+n,column:+r}}throw new Error(`Bad definition: ${s._[Fs]}`)}o(Qo,"getECLDefinition");function Vo(s,e){let t=[];for(let n of s.vertices)if(Go(n)){let r=Qo(n);(r&&!e||e===r.file)&&t.push(r)}return t.sort((n,r)=>n.line-r.line)}o(Vo,"breakpointLocations");var Ot,rr=class s extends Oo{static{o(this,"Activity")}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 Ot||(Ot=new s(e)),t&&Ot.set(t),Ot}constructor(e){super(),e instanceof Le?this.connection=e:this.connection=new Le(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(t=>e===""||t.ClusterName===e).map(t=>Te.attach(this.connection.connectionOptions(),t.Wuid,t))}setBanner(e){return this.connection.SetBanner({...e}).then(t=>(this.set(t),this))}lazyRefresh=qo(async()=>{let e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}};import{Cache as Bo,scopedLogger as jo,StateObject as Xo}from"@hpcc-js/util";var Ko=jo("logicalFile.ts"),Ts=class extends Bo{static{o(this,"LogicalFileCache")}constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}},Ho=new Ts,ir=class s extends Xo{static{o(this,"LogicalFile")}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 properties(){return this.get()}static attach(e,t,n,r){let i=Ho.get({BaseUrl:e.baseUrl,Cluster:t,Name:n},()=>new s(e,t,n));return r&&i.set(r),i}constructor(e,t,n){super(),e instanceof Ne?this.connection=e:this.connection=new Ne(e),this.clear({Cluster:t,Name:n})}filePartsOnCluster(){return[...this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[]]}fileParts(){let e=[];for(let t of this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[])for(let n of t?.DFUFileParts?.DFUPart||[]){let r={...t,...n};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}),e.FileDetail)).catch(e=>{if(!e.Exception.some(n=>n.Code===20038?(this.set("Name",this.Name+" (Deleted)"),this.set("StateID",999),!0):!1))throw Ko.warning("Unexpected exception: "),e;return{}})}fetchDefFile(e){return this.connection.DFUFile({Name:this.Name,Format:e})}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 Jo,StateObject as zo}from"@hpcc-js/util";var Es=class extends Jo{static{o(this,"MachineCache")}constructor(){super(e=>e.Address)}},$o=new Es,Bt=class s extends zo{static{o(this,"Machine")}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,n){let r=$o.get({Address:t},()=>new s(e));return n&&r.set(n),r}constructor(e){super(),e instanceof $?this.connection=e:this.connection=new $(e)}};import{Cache as ar,StateObject as aa,scopedLogger as ua}from"@hpcc-js/util";import{Cache as ta,exists as or,StateObject as sa}from"@hpcc-js/util";import{Cache as Zo,StateObject as Yo}from"@hpcc-js/util";var ks=class extends Zo{static{o(this,"TargetClusterCache")}constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}},ea=new ks,Ee=class s extends Yo{static{o(this,"TargetCluster")}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=>Bt.attach(this.machineConnection,e.Address,e))}static attach(e,t,n){let r=ea.get({BaseUrl:e.baseUrl,Name:t},()=>new s(e,t));return n&&r.set(n),r}constructor(e,t){super(),e instanceof M?(this.connection=e,this.machineConnection=new $(e.connectionOptions())):(this.connection=new M(e),this.machineConnection=new $(e)),this.clear({Name:t})}fetchMachines(e={}){return this.machineConnection.GetTargetClusterInfo({TargetClusters:{Item:[`${this.Type}:${this.Name}`]},...e}).then(t=>{let n=[];for(let r of t.TargetClusterInfoList.TargetClusterInfo)for(let i of r.Processes.MachineInfoEx)n.push(i);return this.set("MachineInfoEx",n),this.CMachineInfoEx})}machineStats(){let e=0,t=0,n=0;for(let r of this.CMachineInfoEx)for(let i of r.Storage.StorageInfo){t+=i.Available,n+=i.Total;let a=1-i.Available/i.Total;a>e&&(e=a)}return{maxDisk:e,meanDisk:1-(n?t/n:1)}}fetchUsage(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])}};function Rf(s){let e;return s instanceof M?e=s:e=new M(s),e.TpListTargetClusters({}).then(t=>t.TargetClusters.TpClusterNameType.map(n=>Ee.attach(s,n.Name,n)))}o(Rf,"targetClusters");var Is={};function Df(s){if(!Is[s.baseUrl]){let e;s instanceof M?e=s:e=new M(s),Is[s.baseUrl]=e.TpListTargetClusters({}).then(t=>{let n,r,i;t.TargetClusters.TpClusterNameType.forEach(u=>{n||(n=u),!r&&u.IsDefault===!0&&(r=u),!i&&u.Type==="hthor"&&(i=u)});let a=r||i||n;return Ee.attach(s,a.Name,a)})}return Is[s.baseUrl]}o(Df,"defaultTargetCluster");var Ns=class extends ta{static{o(this,"TopologyCache")}constructor(){super(e=>e.BaseUrl)}},na=new Ns,jt=class s extends sa{static{o(this,"Topology")}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=>Ee.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,t){let n=na.get({BaseUrl:e.baseUrl},()=>new s(e));return t&&n.set(t),n}constructor(e){super(),e instanceof M?this.connection=e:this.connection=new M(e)}GetESPServiceBaseURL(e=""){return this.connection.TpServiceQuery({}).then(t=>{let n=this.connection.protocol(),r=this.connection.ip(),i=n==="https:"?"18002":"8002";if(or("ServiceList.TpEspServers.TpEspServer",t)){for(let a of t.ServiceList.TpEspServers.TpEspServer)if(or("TpBindings.TpBinding",a))for(let u of a.TpBindings.TpBinding)u.Service===e&&u.Protocol+":"===n&&(i=u.Port)}return`${n}//${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,n){if(this.isCallback(t))switch(e){case"changed":super.on(e,t);break;default:}else switch(e){case"changed":super.on(e,t,n);break;default:}return this._monitor(),this}};function ee(s,e,t){e==="__proto__"||e==="constructor"||e==="prototype"||(s[e]=t)}o(ee,"safeAssign");function Be(s){return s=""+s,s.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g," ").replace(/\r/g," ")}o(Be,"xmlEncode");function ra(s){if(s){if(!isNaN(+s))return parseFloat(s)}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(s);if(!t)return 0;let n=+t[1]||0,r=+t[2]||0,i=+t[3]||0,a=+t[4]||0,u=+t[5]||0,l=+t[6]||0,d=+t[7]||0;return n*24*60*60+r*60*60+i*60+a+u/1e3+l/1e6+d/1e9}o(ra,"espTime2Seconds");function te(s,e){let t=s.indexOf(e);return t!==-1?parseFloat(s.substring(0,t)):-1}o(te,"unitTest");function ia(s){if(s){if(!isNaN(+s))return parseFloat(s)}else return 0;let e=te(s,"Kb");return e>=0?e*1024:(e=te(s,"Mb"),e>=0?e*Math.pow(1024,2):(e=te(s,"Gb"),e>=0?e*Math.pow(1024,3):(e=te(s,"Tb"),e>=0?e*Math.pow(1024,4):(e=te(s,"Pb"),e>=0?e*Math.pow(1024,5):(e=te(s,"Eb"),e>=0?e*Math.pow(1024,6):(e=te(s,"Zb"),e>=0?e*Math.pow(1024,7):(e=te(s,"b"),e>=0?e:0)))))))}o(ia,"espSize2Bytes");function oa(s){return s?parseFloat(s):0}o(oa,"espSkew2Number");var Ls=class{static{o(this,"LocalisedXGMMLWriter")}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,n,r){this.noSpills=r,e.forEach(i=>{this.graph.isVertex(i)?(this.calcInVertexVisibility(i,n),this.calcOutVertexVisibility(i,n)):this.graph.isEdge(i)?(this.calcInVertexVisibility(i.getSource(),n-1),this.calcOutVertexVisibility(i.getTarget(),n-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(n=>{this.calcInVertexVisibility(n.getSource(),t-1)})}calcOutVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getOutEdges().forEach(n=>{this.calcOutVertexVisibility(n.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 n={};this.graph.edges.forEach((r,i)=>{r.getSource().__hpcc_parent!==r.getTarget().__hpcc_parent&&e===this.getCommonAncestor(r)&&(n[r.getSource().__hpcc_parent.__hpcc_id+"::"+r.getTarget().__hpcc_parent.__hpcc_id]||(n[r.getSource().__hpcc_parent.__hpcc_id+"::"+r.getTarget().__hpcc_parent.__hpcc_id]=!0,this.m_visibleEdges[r.__hpcc_id]=r))})}buildVertexString(e,t){let n="",r="",i=e.getProperties();for(let a in i)t&&a.indexOf("_kind")>=0?r+='<att name="_kind" value="point"/>':a==="id"||a==="label"?n+=" "+a+'="'+Be(i[a])+'"':r+='<att name="'+a+'" value="'+Be(i[a])+'"/>';return"<node"+n+">"+r+"</node>"}buildEdgeString(e){let t="",n="",r=e.getProperties();for(let i in r)i.toLowerCase()==="id"||i.toLowerCase()==="label"||i.toLowerCase()==="source"||i.toLowerCase()==="target"?t+=" "+i+'="'+Be(r[i])+'"':n+='<att name="'+i+'" value="'+Be(r[i])+'"/>';return"<edge"+t+">"+n+"</edge>"}getAncestors(e,t){let n=e.__hpcc_parent;for(;n;)t.push(n),n=n.__hpcc_parent}getCommonAncestorV(e,t){let n=[],r=[];this.getAncestors(e,n),this.getAncestors(t,r);let i=n.length-1,a=r.length-1,u=null;for(;i>=0&&a>=0&&n[i]===r[a];)u=n[i],--i,--a;return u}getCommonAncestor(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())}calcAncestorVisibility(e){let t=[];this.getAncestors(e,t),t.forEach((n,r)=>{this.m_visibleSubgraphs[n.__hpcc_id]=n})}calcVisibility2(){for(let e in this.m_visibleVertices){let t=this.m_visibleVertices[e];t.getInEdges().forEach((n,r)=>{this.m_visibleEdges[n.__hpcc_id]=n}),t.getOutEdges().forEach((n,r)=>{this.m_visibleEdges[n.__hpcc_id]=n}),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],n=t.getSource();for(this.addSemiVisibleVertex(n);this.noSpills&&n.isSpill();){let i=n.getInEdges();if(i.length)this.addSemiVisibleEdge(i[0]),n=i[0].getSource(),this.addSemiVisibleVertex(n);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 n="";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 a=e.__hpcc_vertices[0];a&&(this.m_xgmml+=this.buildVertexString(a,!0))}let i=e.getProperties();for(let a in i)n+='<att name="'+a+'" value="'+Be(i[a])+'"/>';this.m_xgmml+=t?"":"</graph></att>"+n+"</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))}},je=class{static{o(this,"GraphItem")}__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}},se=class extends je{static{o(this,"Subgraph")}_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,n)=>{e.subgraphVisited(t)&&t.walkSubgraphs(e)})}walkVertices(e){this.__hpcc_vertices.forEach((t,n)=>{e.vertexVisited(t)})}},fe=class extends je{static{o(this,"Vertex")}_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)}},he=class extends je{static{o(this,"Edge")}_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]}},Xt=class s{static{o(this,"QueryGraph")}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 n=new DOMParser().parseFromString(e,"text/xml");this.walkDocument(n.documentElement,"0")}isSubgraph(e){return e instanceof se}isVertex(e){return e instanceof fe}isEdge(e){return e instanceof he}getGlobalType(e){return e instanceof fe?3:e instanceof he?4:e instanceof se?2:e instanceof s?1:0}getGlobalTypeString(e){return e instanceof fe?"Vertex":e instanceof he?"Edge":e instanceof se?"Cluster":e instanceof s?"Graph":"Unknown"}getItem(e,t){if(!this.idx[t])switch(e.tagName){case"graph":let r=new se(this,t);this.subgraphs.push(r),this.idx[t]=r;break;case"node":let i=new fe(this,t);this.vertices.push(i),this.idx[t]=i;break;case"edge":let a=new he(this,t);this.edges.push(a),this.idx[t]=a;break;default:console.warn("Graph.getItem - Unknown Node Type!");break}let n=this.idx[t];return Array.from(e.attributes).forEach(r=>{ee(n,r.name,r.value)}),n}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof se?this.subgraphs=this.subgraphs.filter(t=>e!==t):e instanceof fe?this.vertices=this.vertices.filter(t=>e!==t):e instanceof he&&(this.edges=this.edges.filter(t=>e!==t))}getChildByTagName(e,t){let n=null;return Array.from(e.childNodes).some(r=>{if(r.tagName===t)return n=r,!0}),n}walkDocument(e,t){let n=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,a=this.getChildByTagName(r,"att");if(a){let p=this.getChildByTagName(a,"graph");if(p){i=!0;let m=this.walkDocument(p,r.getAttribute("id"));n.addSubgraph(m)}}if(!i){let p=this.walkDocument(r,r.getAttribute("id"));n.addVertex(p)}break;case"att":let u=r.getAttribute("name"),l="_"+u,d=r.getAttribute("value");u.indexOf("Time")===0?(ee(n,l,d),ee(n,u,""+ra(d))):u.indexOf("Size")===0?(ee(n,l,d),ee(n,u,""+ia(d))):u.indexOf("Skew")===0?(ee(n,l,d),ee(n,u,""+oa(d))):ee(n,u,d);break;case"edge":let c=this.walkDocument(r,r.getAttribute("id"));if(c.NumRowsProcessed!==void 0?c._eclwatchCount=c.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):c.Count!==void 0?c._eclwatchCount=c.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):c.count!==void 0&&(c._eclwatchCount=c.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),c.inputProgress&&(c._eclwatchInputProgress="["+c.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),c.SkewMaxRowsProcessed&&c.SkewMinRowsProcessed&&(c._eclwatchSkew="+"+c.SkewMaxRowsProcessed+", "+c.SkewMinRowsProcessed),!c._dependsOn){if(!c._childGraph){if(c._sourceActivity||c._targetActivity){c._isSpill=!0;let p=c.getSource();p._isSpill=!0;let m=c.getTarget();m._isSpill=!0}}}n.addEdge(c);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}}),n}removeSubgraphs(){[...this.subgraphs].forEach(t=>{t.__hpcc_parent instanceof se&&t.remove()})}removeSpillVertices(){[...this.vertices].forEach(t=>{t.isSpill()&&t.remove()})}getLocalisedXGMML(e,t,n,r){let i=new Ls(this);return i.calcVisibility(e,t,n,r),i.writeXgmml(),"<graph>"+i.m_xgmml+"</graph>"}};var As=ua("@hpcc-js/comms/ecl/query.ts"),ca=Ue("~s");function la(s){return!isNaN(parseFloat(s))&&!isNaN(s-0)}o(la,"isNumber");var Ms=class extends ar{static{o(this,"QueryCache")}constructor(){super(e=>ar.hash([e.QueryId,e.QuerySet]))}},pa=new Ms,ur=class s extends aa{static{o(this,"Query")}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,n,r){super(),e instanceof L?this.wsWorkunitsService=e:this.wsWorkunitsService=new L(e),this.topology=jt.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:t,QueryId:n,...r})}static attach(e,t,n,r){let i=pa.get({BaseUrl:e.baseUrl,QuerySet:t,QueryId:n},()=>new s(e,t,n));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 n of t?.TpBindings?.TpBinding??[])if(n?.Service==="ws_ecl"){let r=`${n.Protocol}://${globalThis.location.hostname}:${n.Port}`;return new rt({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){As.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){As.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(n=>{let r=new Xt,i=!0;for(let a of n?.Graphs?.ECLGraphEx||[])i?(r.load(a.Graph),i=!1):r.merge(a.Graph);return r})}fetchDetailsNormalized(e={}){let t=Te.attach(this.wsWorkunitsService,this.Wuid);return t?Promise.all([this.fetchGraph(),t.fetchDetailsMeta(),t.fetchDetailsRaw(e)]).then(n=>{let r=n[0],i=n[1],u=n[2].map(l=>{if(l.Id[0]==="a"||l.Id[0]==="e"){let d=r.idx[l.Id.substring(1)];for(let c in d)if(c.charAt(0)!=="_"&&c.charAt(0)===c.charAt(0).toUpperCase()&&(typeof d[c]=="string"||typeof d[c]=="number"||typeof d[c]=="boolean")&&!l.Properties.Property.some(p=>p.Name===c)){let m=la(d[c])?parseFloat(d[c]):d[c],b=d[c];c.indexOf("Time")>=0&&(m=m/1e9,b=ca(m)+"s"),l.Properties.Property.push({Name:c,RawValue:m,Formatted:b})}}return l});return t.normalizeDetails(i,u)}):Promise.resolve({meta:void 0,columns:void 0,data:void 0})}async submit(e){let t=await this.wsEclService();try{return t?.submit(this.QuerySet,this.QueryId,e).then(n=>{for(let r in n)n[r]=n[r].Row;return n})??[]}catch(n){return As.debug(n.message??n),[]}}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 ga,Dispatch as da,Message as ma}from"@hpcc-js/util";var vs=class extends ga{static{o(this,"StoreCache")}constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}},fa=new vs,xe=class extends ma{constructor(t,n,r){super();this.key=t;this.value=n;this.oldValue=r}static{o(this,"ValueChangedMessage")}get canConflate(){return!0}conflate(t){return this.key===t.key?(this.value=t.value,!0):!1}void(){return this.value===this.oldValue}},cr=class s{static{o(this,"Store")}connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new da;static attach(e,t="HPCCApps",n,r=!0){return fa.get({BaseUrl:e.baseUrl,Name:t,UserSpecific:r,Namespace:n},()=>new s(e,t,n,r))}constructor(e,t,n,r){e instanceof Ae?this.connection=e:this.connection=new Ae(e),this.Name=t,this.UserSpecific=r,this.Namespace=n}_knownValues={};create(){this.connection.CreateStore({Name:this.Name,UserSpecific:this.UserSpecific,Type:"",Description:""})}set(e,t,n=!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,n&&this._dispatch.post(new xe(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(n=>{let r=this._knownValues[e];return this._knownValues[e]=n.Value,t&&this._dispatch.post(new xe(e,n.Value,r)),n.Value}).catch(n=>{console.error(`Store.get(${e}) failed:`,n)})}getAll(e=!0){return this.connection.FetchAll({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace}).then(t=>{let n={},r=this._knownValues;if(this._knownValues={},t.Pairs.Pair.forEach(i=>{let a=this._knownValues[i.Key];this._knownValues[i.Key]=i.Value,delete r[i.Key],n[i.Key]=i.Value,e&&this._dispatch.post(new xe(i.Key,i.Value,a))}),e)for(let i in r)this._dispatch.post(new xe(i,void 0,r[i]));return n}).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(n=>{let r=this._knownValues[e];delete this._knownValues[e],t&&this._dispatch.post(new xe(e,void 0,r))}).catch(n=>{console.error(`Store.delete(${e}) failed:`,n)})}monitor(e){return this._dispatch.attach(e)}};import{Cache as ha,scopedLogger as xa,StateObject as Sa}from"@hpcc-js/util";var ya=xa("@hpcc-js/comms/dfuWorkunit.ts");var ws=class extends ha{static{o(this,"DFUWorkunitCache")}constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}},lr=new ws,pr=class s extends Sa{static{o(this,"DFUWorkunit")}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 n=new s(e);return n.connection.CreateDFUWorkunit({DFUServerQueue:t}).then(r=>(lr.set(n),n.set(r.result),n))}static attach(e,t,n){let r=lr.get({BaseUrl:e.baseUrl,ID:t},()=>new s(e,t));return n&&r.set(n),r}static sprayFixed(e,t){let n=new ae(e);return n.SprayFixedEx({...t}).then(r=>{let i=r.wuid;return n.GetDFUWorkunit({wuid:i}).then(a=>s.attach(e,i,a.result))})}static sprayVariable(e,t){let n=new ae(e);return n.SprayVariableEx({...t}).then(r=>{let i=r.wuid;return n.GetDFUWorkunit({wuid:i}).then(a=>s.attach(e,i,a.result))})}static despray(e,t){let n=new ae(e);return n.DesprayEx({...t}).then(r=>{let i=r.wuid;return n.GetDFUWorkunit({wuid:i}).then(a=>s.attach(e,i,a.result))})}update(e){return this.connection.UpdateDFUWorkunitEx({wu:{JobName:e?.wu?.JobName??this.JobName,isProtected:e?.wu?.isProtected??this.isProtected,ID:this.ID,State:this.State},ClusterOrig:this.ClusterName,JobNameOrig:this.JobName,isProtectedOrig:this.isProtected,StateOrig:this.State})}isComplete(){switch(this.State){case 6:case 5:case 4:case 999:return!0;default:}return!1}isFailed(){return!!(this.isComplete()&&this.State!==6)}isDeleted(){switch(this.State){case 999:return!0;default:}return!1}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(ke.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===ke.DFUWUActions.Delete?t:this.refresh().then(()=>(this._monitor(),t)))}on(e,t,n){if(this.isCallback(t))switch(e){case"finished":super.on("propChanged","State",r=>{this.isComplete()&&t([r])});break;case"changed":super.on(e,t);break;default:}else switch(e){case"changed":super.on(e,t,n);break;default:}return this._monitor(),this}watchUntilComplete(e){return new Promise((t,n)=>{let r=this.watch(i=>{e&&e(i),this.isComplete()&&(r.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,n)=>{let r=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(r.release(),t(this))})})}constructor(e,t){super(),this.connection=new ae(e),this.topologyConnection=new M(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 ya.warning("Unexpected exception: "),t;return{}})}};export{qs as AccessService,Os as AccountService,rr as Activity,me as Attribute,Ca as BUILD_VERSION,Cs as BaseScope,Bs as CloudService,js as CodesignService,Ht as Connection,bu as DFUArrayActions,Tu as DFUChangeProtection,Eu as DFUChangeRestriction,Fu as DFUDefFileFormat,Ne as DFUService,pr as DFUWorkunit,ws as DFUWorkunitCache,Ks as DFUXRefService,Xs as DaliService,Pt as ECLGraph,Ie as ESPConnection,J as ESPExceptions,rt as EclService,Js as ElkService,ke as FileSpray,ae as FileSprayService,Lr as FileSprayStates,Ds as GlobalResultCache,bt as GraphCache,vr as LogType,$s as LogaccessService,ir as LogicalFile,Ts as LogicalFileCache,Bt as Machine,Es as MachineCache,$ as MachineService,Ra as PKG_NAME,Da as PKG_VERSION,tn as PackageProcessService,Lo as PropertyType,ur as Query,Xt as QueryGraph,Ao as RelatedProperty,Et as Resource,sn as ResourcesService,vt as Result,wt as ResultCache,Le as SMCService,rn as SashaService,qe as Scope,Kn as ScopeEdge,Ft as ScopeGraph,jn as ScopeSubgraph,Xn as ScopeVertex,y as Service,_t as SourceFile,cr as Store,vs as StoreCache,Ae as StoreService,wr as TargetAudience,Ee as TargetCluster,ks as TargetClusterCache,Gt as Timer,jt as Topology,Ns as TopologyCache,M as TopologyService,xe as ValueChangedMessage,zt as WUStateID,ue as WUUpdate,Te as Workunit,bs as WorkunitCache,L as WorkunitsService,mt as WorkunitsServiceEx,Vs as WsAccess,Re as WsDfu,I as WsLogaccess,on as WsSMC,nn as WsSasha,an as WsTopology,w as WsWorkunits,Bn as XGMMLEdge,xs as XGMMLGraph,qn as XGMMLSubgraph,On as XGMMLVertex,It as XSDNode,Lt as XSDSchema,Nt as XSDSimpleType,kt as XSDXMLNode,ze as createConnection,Tt as createGraph,Yn as createXGMMLGraph,Df as defaultTargetCluster,Pr as deserializeResponse,Er as get,Ta as hookSend,Fa as instanceOfIConnection,ba as instanceOfIOptions,kr as isArray,cn as isECLResult,wa as isExceptions,Dg as isWUInfoWorkunit,Rg as isWUQueryECLWorkunit,br as jsonp,ys as parseXSD,rm as parseXSD2,Tr as post,Ir as send,oe as serializeRequest,Ea as setTransportFactory,wo as splitMetric,Rf as targetClusters};
|
|
7
7
|
//# sourceMappingURL=index.js.map
|