@hpcc-js/comms 3.17.6 → 3.17.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@hpcc-js/util")):typeof define==`function`&&define.amd?define([`exports`,`@hpcc-js/util`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`@hpcc-js/comms`]={},e[`@hpcc-js/util`]))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var n=Object.defineProperty,__name=(e,t)=>n(e,`name`,{value:t,configurable:!0}),r=`@hpcc-js/comms`,i=`3.17.6`,a=`3.29.1`,o=(0,t.scopedLogger)(`comms/connection.ts`);function instanceOfIOptions(e){return`baseUrl`in e}var s={type:`post`,baseUrl:``,userID:``,password:``,rejectUnauthorized:!0,timeoutSecs:60};function instanceOfIConnection(e){return typeof e.opts==`function`&&typeof e.send==`function`&&typeof e.clone==`function`}function encode(e,t){return t===void 0||t===!0?encodeURIComponent(e):``+e}function serializeRequest(e,t=!0,n=``){if(n&&(n+=`.`),typeof e!=`object`)return encode(e,t);let r=[];for(let i in e)if(e.hasOwnProperty(i))if(e[i]instanceof Array){let a=!1;e[i].forEach((e,o)=>{typeof e==`object`?(a=!0,r.push(serializeRequest(e,t,n+encode(`${i}.${o}`,t)))):r.push(n+encode(`${i}_i${o}`,t)+`=`+serializeRequest(e,t))}),a&&r.push(n+encode(`${i}.itemcount`,t)+`=`+e[i].length)}else typeof e[i]==`object`?e[i]&&e[i].Item instanceof Array?(r.push(serializeRequest(e[i].Item,t,n+encode(i,t))),r.push(n+encode(`${i}.itemcount`,t)+`=`+e[i].Item.length)):r.push(serializeRequest(e[i],t,n+encode(i,t))):e[i]===void 0?r.push(n+encode(i,t)):r.push(n+encode(i,t)+`=`+encode(e[i],t));return r.join(`&`)}function deserializeResponse(e){return JSON.parse(e)}function jsonp(e,n,r={},i=`json`,a){return a&&console.warn(`Header attributes ignored for JSONP connections`),new Promise((a,s)=>{let c=e.timeoutSecs*1e3,l=5e3,u=`jsonp_callback_`+Math.round(Math.random()*999999);window[u]=function(e){c=0,doCallback(),a(i===`json`&&typeof e==`string`?deserializeResponse(e):e)};let d=document.createElement(`script`),f=(0,t.join)(e.baseUrl,n);f+=f.indexOf(`?`)>=0?`&`:`?`,d.src=f+`jsonp=`+u+`&`+serializeRequest(r,e.encodeRequest),document.body.appendChild(d);let p=setInterval(function(){c<=0?clearInterval(p):(c-=l,c<=0?(clearInterval(p),o.error(`Request timeout: `+d.src),doCallback(),s(Error(`Request timeout: `+d.src))):o.debug(`Request pending (`+c/1e3+` sec): `+d.src))},l);function doCallback(){delete window[u],document.body.removeChild(d)}})}function authHeader(e){return e.userID?{Authorization:`Basic ${(0,t.utf8ToBase64)(`${e.userID}:${e.password}`)}`}:{}}var c={};function doFetch(e,n,r,i,a){i={...authHeader(e),...i},r={credentials:c[e.baseUrl]?`omit`:`include`,...r,headers:i},e.baseUrl.indexOf(`https:`)===0&&(e.rejectUnauthorized===!1&&t.root.__hpcc_rejectUnauthorizedAgent?r.dispatcher=t.root.__hpcc_rejectUnauthorizedAgent:t.root.__hpcc_trustwaveAgent&&(r.agent=t.root.__hpcc_trustwaveAgent));function handleResponse(e){if(e.ok)return a===`json`?e.json():e.text();throw Error(e.statusText)}let o=t.root.__hpcc_undiciFetch??fetch;return(0,t.promiseTimeout)(e.timeoutSecs*1e3,o((0,t.join)(e.baseUrl,n),r).then(handleResponse).catch(i=>(r.credentials=c[e.baseUrl]?`include`:`omit`,o((0,t.join)(e.baseUrl,n),r).then(handleResponse).then(t=>(c[e.baseUrl]=!c[e.baseUrl],t)))))}function post(e,t,n,r=`json`,i){n.upload_&&(delete n.upload_,t+=`?upload_`);let a;return n.abortSignal_&&(a=n.abortSignal_,delete n.abortSignal_),doFetch(e,t,{method:`post`,body:serializeRequest(n,e.encodeRequest),signal:a},{"Content-Type":`application/x-www-form-urlencoded`,...i},r)}function get(e,t,n,r=`json`,i){let a;return n.abortSignal_&&(a=n.abortSignal_,delete n.abortSignal_),doFetch(e,`${t}?${serializeRequest(n,e.encodeRequest)}`,{method:`get`,signal:a},{...i},r)}function send(e,t,n,r=`json`,i){let a;switch(e.type){case`jsonp`:a=jsonp(e,t,n,r,i);break;case`get`:a=get(e,t,n,r,i);break;default:a=post(e,t,n,r,i);break}return a}var l=send;function hookSend(e){let t=l;return e&&(l=e),t}var u=class Connection{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return arguments.length===0?this._opts:(this._opts={...s,...e},this)}send(e,t,n=`json`,r){return this._opts.hookSend?this._opts.hookSend(this._opts,e,t,n,l,r):l(this._opts,e,t,n,r)}clone(){return new Connection(this.opts())}},createConnection=function(e){return new u(e)};function setTransportFactory(e){let t=createConnection;return createConnection=e,t}function isArray(e){return Object.prototype.toString.call(e)===`[object Array]`}var ESPExceptions=class extends Error{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 isExceptions(e){return e instanceof ESPExceptions||e.isESPExceptions&&Array.isArray(e.Exception)}function isConnection(e){return e.send!==void 0}var d=class ESPConnection{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,t,n){this._connection=isConnection(e)?e:createConnection(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(isArray(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,n={},r=`json`,i=!1,a,o){let s={...n,ver_:this._version};i&&(s.upload_=!0),a&&(s.abortSignal_=a);let c,l=`json`;switch(r){case`text`:c=(0,t.join)(this._service,e),l=`text`;break;case`xsd`:c=(0,t.join)(this._service,e+`.xsd`),l=`text`;break;case`json2`:c=(0,t.join)(this._service,e+`/json`),r=`json`,e=e.split(`/`).pop();break;default:c=(0,t.join)(this._service,e+`.json`)}return this._connection.send(c,s,l).then(t=>{if(r===`json`){let n;if(t&&t.Exceptions)throw new ESPExceptions(e,s,t.Exceptions);if(t&&(n=t[o||e+`Response`]),!n)throw new ESPExceptions(e,s,{Source:`ESPConnection.send`,Exception:[{Code:0,Message:`Missing Response`}]});return n}return t})}clone(){return new ESPConnection(this._connection.clone(),this._service,this._version)}},Service=class{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,t,n){this._connection=new d(e,t,n)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}},f;(function(e){e.DFUWUActions=function(e){return e.Delete=`Delete`,e.Protect=`Protect`,e.Unprotect=`Unprotect`,e.Restore=`Restore`,e.SetToFailed=`SetToFailed`,e.Archive=`Archive`,e}({}),e.DFUCommand=function(e){return e.copy=`copy`,e.remove=`remove`,e.move=`move`,e.rename=`rename`,e.replicate=`replicate`,e.import=`import`,e.export=`export`,e.monitor=`monitor`,e.copymerge=`copymerge`,e.supercopy=`supercopy`,e.publish=`publish`,e}({})})(f||={});var FileSprayServiceBase=class extends Service{constructor(e){super(e,`FileSpray`,`1.29`)}AbortDFUWorkunit(e,t){return this._connection.send(`AbortDFUWorkunit`,e,`json`,!1,t,`AbortDFUWorkunitResponse`)}Copy(e,t){return this._connection.send(`Copy`,e,`json`,!1,t,`CopyResponse`)}CreateDFUPublisherWorkunit(e,t){return this._connection.send(`CreateDFUPublisherWorkunit`,e,`json`,!1,t,`CreateDFUPublisherWorkunitResponse`)}CreateDFUWorkunit(e,t){return this._connection.send(`CreateDFUWorkunit`,e,`json`,!1,t,`CreateDFUWorkunitResponse`)}DFUWUFile(e,t){return this._connection.send(`DFUWUFile`,e,`json`,!1,t,`DFUWUFileResponse`)}DFUWUSearch(e,t){return this._connection.send(`DFUWUSearch`,e,`json`,!1,t,`DFUWUSearchResponse`)}DFUWorkunitsAction(e,t){return this._connection.send(`DFUWorkunitsAction`,e,`json`,!1,t,`DFUWorkunitsActionResponse`)}DeleteDFUWorkunit(e,t){return this._connection.send(`DeleteDFUWorkunit`,e,`json`,!1,t,`DeleteDFUWorkunitResponse`)}DeleteDFUWorkunits(e,t){return this._connection.send(`DeleteDFUWorkunits`,e,`json`,!1,t,`DeleteDFUWorkunitsResponse`)}DeleteDropZoneFiles(e,t){return this._connection.send(`DeleteDropZoneFiles`,e,`json`,!1,t,`DFUWorkunitsActionResponse`)}Despray(e,t){return this._connection.send(`Despray`,e,`json`,!1,t,`DesprayResponse`)}DfuMonitor(e,t){return this._connection.send(`DfuMonitor`,e,`json`,!1,t,`DfuMonitorResponse`)}DropZoneFileSearch(e,t){return this._connection.send(`DropZoneFileSearch`,e,`json`,!1,t,`DropZoneFileSearchResponse`)}DropZoneFiles(e,t){return this._connection.send(`DropZoneFiles`,e,`json`,!1,t,`DropZoneFilesResponse`)}EchoDateTime(e,t){return this._connection.send(`EchoDateTime`,e,`json`,!1,t,`EchoDateTimeResponse`)}FileList(e,t){return this._connection.send(`FileList`,e,`json`,!1,t,`FileListResponse`)}GetDFUExceptions(e,t){return this._connection.send(`GetDFUExceptions`,e,`json`,!1,t,`GetDFUExceptionsResponse`)}GetDFUProgress(e,t){return this._connection.send(`GetDFUProgress`,e,`json`,!1,t,`ProgressResponse`)}GetDFUServerQueues(e,t){return this._connection.send(`GetDFUServerQueues`,e,`json`,!1,t,`GetDFUServerQueuesResponse`)}GetDFUWorkunit(e,t){return this._connection.send(`GetDFUWorkunit`,e,`json`,!1,t,`GetDFUWorkunitResponse`)}GetDFUWorkunits(e,t){return this._connection.send(`GetDFUWorkunits`,e,`json`,!1,t,`GetDFUWorkunitsResponse`)}GetRemoteTargets(e,t){return this._connection.send(`GetRemoteTargets`,e,`json`,!1,t,`GetRemoteTargetsResponse`)}GetSprayTargets(e,t){return this._connection.send(`GetSprayTargets`,e,`json`,!1,t,`GetSprayTargetsResponse`)}OpenSave(e,t){return this._connection.send(`OpenSave`,e,`json`,!1,t,`OpenSaveResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`FileSprayPingResponse`)}Rename(e,t){return this._connection.send(`Rename`,e,`json`,!1,t,`RenameResponse`)}Replicate(e,t){return this._connection.send(`Replicate`,e,`json`,!1,t,`ReplicateResponse`)}ShowResult(e,t){return this._connection.send(`ShowResult`,e,`json`,!1,t,`ShowResultResponse`)}SprayFixed(e,t){return this._connection.send(`SprayFixed`,e,`json`,!1,t,`SprayFixedResponse`)}SprayVariable(e,t){return this._connection.send(`SprayVariable`,e,`json`,!1,t,`SprayResponse`)}SubmitDFUWorkunit(e,t){return this._connection.send(`SubmitDFUWorkunit`,e,`json`,!1,t,`SubmitDFUWorkunitResponse`)}UpdateDFUWorkunit(e,t){return this._connection.send(`UpdateDFUWorkunit`,e,`json`,!1,t,`UpdateDFUWorkunitResponse`)}},p=function(e){return e[e.unknown=0]=`unknown`,e[e.scheduled=1]=`scheduled`,e[e.queued=2]=`queued`,e[e.started=3]=`started`,e[e.aborted=4]=`aborted`,e[e.failed=5]=`failed`,e[e.finished=6]=`finished`,e[e.monitoring=7]=`monitoring`,e[e.aborting=8]=`aborting`,e[e.notfound=999]=`notfound`,e}({}),FileSprayService=class extends FileSprayServiceBase{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`)}},m;(function(e){e.ViewMemberType=function(e){return e.User=`User`,e.Group=`Group`,e}({}),e.UserSortBy=function(e){return e.username=`username`,e.fullname=`fullname`,e.passwordexpiration=`passwordexpiration`,e.employeeID=`employeeID`,e.employeeNumber=`employeeNumber`,e}({}),e.GroupSortBy=function(e){return e.Name=`Name`,e.ManagedBy=`ManagedBy`,e}({}),e.AccountTypeReq=function(e){return e.Any=`Any`,e.User=`User`,e.Group=`Group`,e}({}),e.ResourcePermissionSortBy=function(e){return e.Name=`Name`,e.Type=`Type`,e}({}),e.ResourceSortBy=function(e){return e.Name=`Name`,e}({})})(m||={});var AccessServiceBase=class extends Service{constructor(e){super(e,`ws_access`,`1.17`)}AccountPermissions(e,t){return this._connection.send(`AccountPermissions`,e,`json`,!1,t,`AccountPermissionsResponse`)}AccountPermissionsV2(e,t){return this._connection.send(`AccountPermissionsV2`,e,`json`,!1,t,`AccountPermissionsV2Response`)}AddUser(e,t){return this._connection.send(`AddUser`,e,`json`,!1,t,`AddUserResponse`)}AddView(e,t){return this._connection.send(`AddView`,e,`json`,!1,t,`AddViewResponse`)}AddViewColumn(e,t){return this._connection.send(`AddViewColumn`,e,`json`,!1,t,`AddViewColumnResponse`)}AddViewMember(e,t){return this._connection.send(`AddViewMember`,e,`json`,!1,t,`AddViewMemberResponse`)}ClearPermissionsCache(e,t){return this._connection.send(`ClearPermissionsCache`,e,`json`,!1,t,`ClearPermissionsCacheResponse`)}DeleteView(e,t){return this._connection.send(`DeleteView`,e,`json`,!1,t,`DeleteViewResponse`)}DeleteViewColumn(e,t){return this._connection.send(`DeleteViewColumn`,e,`json`,!1,t,`DeleteViewColumnResponse`)}DeleteViewMember(e,t){return this._connection.send(`DeleteViewMember`,e,`json`,!1,t,`DeleteViewMemberResponse`)}DisableScopeScans(e,t){return this._connection.send(`DisableScopeScans`,e,`json`,!1,t,`DisableScopeScansResponse`)}EnableScopeScans(e,t){return this._connection.send(`EnableScopeScans`,e,`json`,!1,t,`EnableScopeScansResponse`)}FilePermission(e,t){return this._connection.send(`FilePermission`,e,`json`,!1,t,`FilePermissionResponse`)}GroupAction(e,t){return this._connection.send(`GroupAction`,e,`json`,!1,t,`GroupActionResponse`)}GroupAdd(e,t){return this._connection.send(`GroupAdd`,e,`json`,!1,t,`GroupAddResponse`)}GroupEdit(e,t){return this._connection.send(`GroupEdit`,e,`json`,!1,t,`GroupEditResponse`)}GroupMemberEdit(e,t){return this._connection.send(`GroupMemberEdit`,e,`json`,!1,t,`GroupMemberEditResponse`)}GroupMemberEditInput(e,t){return this._connection.send(`GroupMemberEditInput`,e,`json`,!1,t,`GroupMemberEditInputResponse`)}GroupMemberQuery(e,t){return this._connection.send(`GroupMemberQuery`,e,`json`,!1,t,`GroupMemberQueryResponse`)}GroupQuery(e,t){return this._connection.send(`GroupQuery`,e,`json`,!1,t,`GroupQueryResponse`)}Groups(e,t){return this._connection.send(`Groups`,e,`json`,!1,t,`GroupResponse`)}PermissionAction(e,t){return this._connection.send(`PermissionAction`,e,`json`,!1,t,`PermissionActionResponse`)}Permissions(e,t){return this._connection.send(`Permissions`,e,`json`,!1,t,`BasednsResponse`)}PermissionsReset(e,t){return this._connection.send(`PermissionsReset`,e,`json`,!1,t,`PermissionsResetResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`ws_accessPingResponse`)}QueryScopeScansEnabled(e,t){return this._connection.send(`QueryScopeScansEnabled`,e,`json`,!1,t,`QueryScopeScansEnabledResponse`)}QueryUserViewColumns(e,t){return this._connection.send(`QueryUserViewColumns`,e,`json`,!1,t,`QueryUserViewColumnsResponse`)}QueryViewColumns(e,t){return this._connection.send(`QueryViewColumns`,e,`json`,!1,t,`QueryViewColumnsResponse`)}QueryViewMembers(e,t){return this._connection.send(`QueryViewMembers`,e,`json`,!1,t,`QueryViewMembersResponse`)}QueryViews(e,t){return this._connection.send(`QueryViews`,e,`json`,!1,t,`QueryViewsResponse`)}ResourceAdd(e,t){return this._connection.send(`ResourceAdd`,e,`json`,!1,t,`ResourceAddResponse`)}ResourceDelete(e,t){return this._connection.send(`ResourceDelete`,e,`json`,!1,t,`ResourceDeleteResponse`)}ResourcePermissionQuery(e,t){return this._connection.send(`ResourcePermissionQuery`,e,`json`,!1,t,`ResourcePermissionQueryResponse`)}ResourcePermissions(e,t){return this._connection.send(`ResourcePermissions`,e,`json`,!1,t,`ResourcePermissionsResponse`)}ResourceQuery(e,t){return this._connection.send(`ResourceQuery`,e,`json`,!1,t,`ResourceQueryResponse`)}Resources(e,t){return this._connection.send(`Resources`,e,`json`,!1,t,`ResourcesResponse`)}UserAccountExport(e,t){return this._connection.send(`UserAccountExport`,e,`json`,!1,t,`UserAccountExportResponse`)}UserAction(e,t){return this._connection.send(`UserAction`,e,`json`,!1,t,`UserActionResponse`)}UserEdit(e,t){return this._connection.send(`UserEdit`,e,`json`,!1,t,`UserEditResponse`)}UserGroupEdit(e,t){return this._connection.send(`UserGroupEdit`,e,`json`,!1,t,`UserGroupEditResponse`)}UserGroupEditInput(e,t){return this._connection.send(`UserGroupEditInput`,e,`json`,!1,t,`UserGroupEditInputResponse`)}UserInfoEdit(e,t){return this._connection.send(`UserInfoEdit`,e,`json`,!1,t,`UserInfoEditResponse`)}UserInfoEditInput(e,t){return this._connection.send(`UserInfoEditInput`,e,`json`,!1,t,`UserInfoEditInputResponse`)}UserPosix(e,t){return this._connection.send(`UserPosix`,e,`json`,!1,t,`UserPosixResponse`)}UserPosixInput(e,t){return this._connection.send(`UserPosixInput`,e,`json`,!1,t,`UserPosixInputResponse`)}UserQuery(e,t){return this._connection.send(`UserQuery`,e,`json`,!1,t,`UserQueryResponse`)}UserResetPass(e,t){return this._connection.send(`UserResetPass`,e,`json`,!1,t,`UserResetPassResponse`)}UserResetPassInput(e,t){return this._connection.send(`UserResetPassInput`,e,`json`,!1,t,`UserResetPassInputResponse`)}UserSudoers(e,t){return this._connection.send(`UserSudoers`,e,`json`,!1,t,`UserSudoersResponse`)}UserSudoersInput(e,t){return this._connection.send(`UserSudoersInput`,e,`json`,!1,t,`UserSudoersInputResponse`)}Users(e,t){return this._connection.send(`Users`,e,`json`,!1,t,`UserResponse`)}},AccessService=class extends AccessServiceBase{},AccountServiceBase=class extends Service{constructor(e){super(e,`ws_account`,`1.07`)}MyAccount(e,t){return this._connection.send(`MyAccount`,e,`json`,!1,t,`MyAccountResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`ws_accountPingResponse`)}UpdateUser(e,t){return this._connection.send(`UpdateUser`,e,`json`,!1,t,`UpdateUserResponse`)}UpdateUserInput(e,t){return this._connection.send(`UpdateUserInput`,e,`json`,!1,t,`UpdateUserInputResponse`)}VerifyUser(e,t){return this._connection.send(`VerifyUser`,e,`json`,!1,t,`VerifyUserResponse`)}},AccountService=class extends AccountServiceBase{VerifyUser(e){return this._connection.send(`VerifyUser`,e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>e.Code===20043))return{retcode:20043,Exceptions:{Source:`wsAccount`,Exception:e.Exception}};throw e})}},CloudServiceBase=class extends Service{constructor(e){super(e,`WsCloud`,`1.02`)}GetPODs(e,t){return this._connection.send(`GetPODs`,e,`json`,!1,t,`GetPODsResponse`)}GetServices(e,t){return this._connection.send(`GetServices`,e,`json`,!1,t,`GetServicesResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`WsCloudPingResponse`)}},h=(0,t.scopedLogger)(`@hpcc-js/comms/services/wsCloud.ts`);function isGetPODsResponse_v1_02(e){return e?.Pods!==void 0}function mapPorts(e){return e.spec?.containers?.reduce((e,t)=>(t.ports?.forEach(t=>{e.push({ContainerPort:t.containerPort,Name:t.name,Protocol:t.protocol})}),e),[])??[]}function mapPods(e){return e.filter(e=>{let t=e?.metadata?.labels??{};return t.hasOwnProperty(`app.kubernetes.io/part-of`)&&t[`app.kubernetes.io/part-of`]===`HPCC-Platform`}).map(e=>{let t=new Date(e.metadata?.creationTimestamp);return{Name:e.metadata.name,Status:e.status?.phase,CreationTimestamp:t.toISOString(),ContainerName:e.status?.containerStatuses?.reduce((e,t)=>(t.name&&e.push(t.name),e),[]).join(`, `)??``,ContainerCount:e.spec?.containers?.length??0,ContainerReadyCount:e.status?.containerStatuses?.reduce((e,t)=>e+ +!!t.ready,0),ContainerRestartCount:e.status?.containerStatuses?.reduce((e,t)=>e+t.restartCount,0),Ports:{Port:mapPorts(e)}}})}var CloudService=class extends CloudServiceBase{getPODs(){return super.GetPODs({}).then(e=>{if(isGetPODsResponse_v1_02(e))return e.Pods?.Pod??[];try{return mapPods((typeof e.Result==`string`?JSON.parse(e.Result):e.Result)?.items??[])}catch(e){return h.error(`Error parsing V1Pods json '${e instanceof Error?e.message:String(e)}'`),[]}})}},g;(function(e){e.SigningMethodType=function(e){return e.gpg=`gpg`,e}({})})(g||={});var CodesignServiceBase=class extends Service{constructor(e){super(e,`ws_codesign`,`1.1`)}ListUserIDs(e,t){return this._connection.send(`ListUserIDs`,e,`json`,!1,t,`ListUserIDsResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`ws_codesignPingResponse`)}Sign(e,t){return this._connection.send(`Sign`,e,`json`,!1,t,`SignResponse`)}Verify(e,t){return this._connection.send(`Verify`,e,`json`,!1,t,`VerifyResponse`)}},CodesignService=class extends CodesignServiceBase{ListUserIDsEx(e){return super.ListUserIDs(e).then(e=>e.UserIDs.Item).catch(e=>[])}Sign(e){return super.Sign({SigningMethod:g.SigningMethodType.gpg,...e})}},DaliServiceBase=class extends Service{constructor(e){super(e,`WSDali`,`1.07`)}Add(e,t){return this._connection.send(`Add`,e,`json`,!1,t,`ResultResponse`)}ClearTraceTransactions(e,t){return this._connection.send(`ClearTraceTransactions`,e,`json`,!1,t,`ResultResponse`)}Count(e,t){return this._connection.send(`Count`,e,`json`,!1,t,`CountResponse`)}DFSCheck(e,t){return this._connection.send(`DFSCheck`,e,`json`,!1,t,`ResultResponse`)}DFSExists(e,t){return this._connection.send(`DFSExists`,e,`json`,!1,t,`BooleanResponse`)}DFSLS(e,t){return this._connection.send(`DFSLS`,e,`json`,!1,t,`ResultResponse`)}Delete(e,t){return this._connection.send(`Delete`,e,`json`,!1,t,`ResultResponse`)}DisconnectClientConnection(e,t){return this._connection.send(`DisconnectClientConnection`,e,`json`,!1,t,`ResultResponse`)}GetClients(e,t){return this._connection.send(`GetClients`,e,`json`,!1,t,`ResultResponse`)}GetConnections(e,t){return this._connection.send(`GetConnections`,e,`json`,!1,t,`ResultResponse`)}GetDFSCSV(e,t){return this._connection.send(`GetDFSCSV`,e,`json`,!1,t,`ResultResponse`)}GetDFSMap(e,t){return this._connection.send(`GetDFSMap`,e,`json`,!1,t,`ResultResponse`)}GetDFSParents(e,t){return this._connection.send(`GetDFSParents`,e,`json`,!1,t,`ResultResponse`)}GetLogicalFile(e,t){return this._connection.send(`GetLogicalFile`,e,`json`,!1,t,`ResultResponse`)}GetLogicalFilePart(e,t){return this._connection.send(`GetLogicalFilePart`,e,`json`,!1,t,`ResultResponse`)}GetProtectedList(e,t){return this._connection.send(`GetProtectedList`,e,`json`,!1,t,`ResultResponse`)}GetSDSStats(e,t){return this._connection.send(`GetSDSStats`,e,`json`,!1,t,`ResultResponse`)}GetSDSSubscribers(e,t){return this._connection.send(`GetSDSSubscribers`,e,`json`,!1,t,`ResultResponse`)}GetValue(e,t){return this._connection.send(`GetValue`,e,`json`,!1,t,`ResultResponse`)}Import(e,t){return this._connection.send(`Import`,e,`json`,!1,t,`ResultResponse`)}ListSDSLocks(e,t){return this._connection.send(`ListSDSLocks`,e,`json`,!1,t,`ResultResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`WSDaliPingResponse`)}SaveSDSStore(e,t){return this._connection.send(`SaveSDSStore`,e,`json`,!1,t,`ResultResponse`)}SetLogicalFilePartAttr(e,t){return this._connection.send(`SetLogicalFilePartAttr`,e,`json`,!1,t,`ResultResponse`)}SetProtected(e,t){return this._connection.send(`SetProtected`,e,`json`,!1,t,`ResultResponse`)}SetTraceSlowTransactions(e,t){return this._connection.send(`SetTraceSlowTransactions`,e,`json`,!1,t,`ResultResponse`)}SetTraceTransactions(e,t){return this._connection.send(`SetTraceTransactions`,e,`json`,!1,t,`ResultResponse`)}SetUnprotected(e,t){return this._connection.send(`SetUnprotected`,e,`json`,!1,t,`ResultResponse`)}SetValue(e,t){return this._connection.send(`SetValue`,e,`json`,!1,t,`ResultResponse`)}UnlockSDSLock(e,t){return this._connection.send(`UnlockSDSLock`,e,`json`,!1,t,`ResultResponse`)}},DaliService=class extends DaliServiceBase{},_;(function(e){e.DFUArrayActions=function(e){return e.Delete=`Delete`,e.AddToSuperfile=`Add To Superfile`,e.ChangeProtection=`Change Protection`,e.ChangeRestriction=`Change Restriction`,e}({}),e.DFUChangeProtection=function(e){return e[e.NoChange=0]=`NoChange`,e[e.Protect=1]=`Protect`,e[e.Unprotect=2]=`Unprotect`,e[e.UnprotectAll=3]=`UnprotectAll`,e}({}),e.DFUChangeRestriction=function(e){return e[e.NoChange=0]=`NoChange`,e[e.Restrict=1]=`Restrict`,e[e.Unrestricted=2]=`Unrestricted`,e}({}),e.DFUDefFileFormat=function(e){return e.xml=`xml`,e.def=`def`,e}({}),e.FileAccessRole=function(e){return e.Token=`Token`,e.Engine=`Engine`,e.External=`External`,e}({}),e.SecAccessType=function(e){return e.None=`None`,e.Access=`Access`,e.Read=`Read`,e.Write=`Write`,e.Full=`Full`,e}({}),e.DFUFileType=function(e){return e.Flat=`Flat`,e.Index=`Index`,e.Xml=`Xml`,e.Csv=`Csv`,e.Json=`Json`,e.IndexLocal=`IndexLocal`,e.IndexPartitioned=`IndexPartitioned`,e.Unset=`Unset`,e}({})})(_||={});var DfuServiceBase=class extends Service{constructor(e){super(e,`WsDfu`,`1.67`)}Add(e){return this._connection.send(`Add`,e,`json`,!1,void 0,`AddResponse`)}AddRemote(e){return this._connection.send(`AddRemote`,e,`json`,!1,void 0,`AddRemoteResponse`)}AddtoSuperfile(e){return this._connection.send(`AddtoSuperfile`,e,`json`,!1,void 0,`AddtoSuperfileResponse`)}DFUArrayAction(e){return this._connection.send(`DFUArrayAction`,e,`json`,!1,void 0,`DFUArrayActionResponse`)}DFUBrowseData(e){return this._connection.send(`DFUBrowseData`,e,`json`,!1,void 0,`DFUBrowseDataResponse`)}DFUDefFile(e){return this._connection.send(`DFUDefFile`,e,`json`,!1,void 0,`DFUDefFileResponse`)}DFUFileAccess(e){return this._connection.send(`DFUFileAccess`,e,`json`,!1,void 0,`DFUFileAccessResponse`)}DFUFileAccessV2(e){return this._connection.send(`DFUFileAccessV2`,e,`json`,!1,void 0,`DFUFileAccessResponse`)}DFUFileCreate(e){return this._connection.send(`DFUFileCreate`,e,`json`,!1,void 0,`DFUFileCreateResponse`)}DFUFileCreateV2(e){return this._connection.send(`DFUFileCreateV2`,e,`json`,!1,void 0,`DFUFileCreateResponse`)}DFUFilePublish(e){return this._connection.send(`DFUFilePublish`,e,`json`,!1,void 0,`DFUFilePublishResponse`)}DFUFileView(e){return this._connection.send(`DFUFileView`,e,`json`,!1,void 0,`DFUFileViewResponse`)}DFUGetDataColumns(e){return this._connection.send(`DFUGetDataColumns`,e,`json`,!1,void 0,`DFUGetDataColumnsResponse`)}DFUGetFileMetaData(e){return this._connection.send(`DFUGetFileMetaData`,e,`json`,!1,void 0,`DFUGetFileMetaDataResponse`)}DFUGetMetaInquiry(e){return this._connection.send(`DFUGetMetaInquiry`,e,`json`,!1,void 0,`DFUMetaInquiryResponse`)}DFUInfo(e){return this._connection.send(`DFUInfo`,e,`json`,!1,void 0,`DFUInfoResponse`)}DFUQuery(e){return this._connection.send(`DFUQuery`,e,`json`,!1,void 0,`DFUQueryResponse`)}DFURecordTypeInfo(e){return this._connection.send(`DFURecordTypeInfo`,e,`json`,!1,void 0,`DFURecordTypeInfoResponse`)}DFUSearch(e){return this._connection.send(`DFUSearch`,e,`json`,!1,void 0,`DFUSearchResponse`)}DFUSearchData(e){return this._connection.send(`DFUSearchData`,e,`json`,!1,void 0,`DFUSearchDataResponse`)}DFUSpace(e){return this._connection.send(`DFUSpace`,e,`json`,!1,void 0,`DFUSpaceResponse`)}EclRecordTypeInfo(e){return this._connection.send(`EclRecordTypeInfo`,e,`json`,!1,void 0,`EclRecordTypeInfoResponse`)}EraseHistory(e){return this._connection.send(`EraseHistory`,e,`json`,!1,void 0,`EraseHistoryResponse`)}ListHistory(e){return this._connection.send(`ListHistory`,e,`json`,!1,void 0,`ListHistoryResponse`)}Ping(e){return this._connection.send(`Ping`,e,`json`,!1,void 0,`WsDfuPingResponse`)}Savexml(e){return this._connection.send(`Savexml`,e,`json`,!1,void 0,`SavexmlResponse`)}SuperfileAction(e){return this._connection.send(`SuperfileAction`,e,`json`,!1,void 0,`SuperfileActionResponse`)}SuperfileList(e){return this._connection.send(`SuperfileList`,e,`json`,!1,void 0,`SuperfileListResponse`)}},v=_.DFUArrayActions,y=_.DFUDefFileFormat,b=_.DFUChangeProtection,x=_.DFUChangeRestriction,DFUService=class extends DfuServiceBase{DFUFile(e){return this._connection.send(`DFUDefFile`,e,`text`)}async recursiveFetchLogicalFiles(e){let t=[],n=[];return await Promise.all(e.map(e=>this.DFUInfo({Cluster:e.NodeGroup,Name:e.Name,IncludeJsonTypeInfo:!1,IncludeBinTypeInfo:!1,ForceIndexInfo:!1}).then(e=>{for(let n of e?.FileDetail?.Superfiles?.DFULogicalFile??[])t.push(n);for(let t of e?.FileDetail?.subfiles?.Item??[])n.push(t)}))),n.concat(t.length?await this.recursiveFetchLogicalFiles(t):[])}},DFUXRefServiceBase=class extends Service{constructor(e){super(e,`WsDFUXRef`,`1.04`)}DFUXRefArrayAction(e,t){return this._connection.send(`DFUXRefArrayAction`,e,`json`,!1,t,`DFUXRefArrayActionResponse`)}DFUXRefBuild(e,t){return this._connection.send(`DFUXRefBuild`,e,`json`,!1,t,`DFUXRefBuildResponse`)}DFUXRefBuildCancel(e,t){return this._connection.send(`DFUXRefBuildCancel`,e,`json`,!1,t,`DFUXRefBuildCancelResponse`)}DFUXRefCleanDirectories(e,t){return this._connection.send(`DFUXRefCleanDirectories`,e,`json`,!1,t,`DFUXRefCleanDirectoriesResponse`)}DFUXRefDirectories(e,t){return this._connection.send(`DFUXRefDirectories`,e,`json`,!1,t,`DFUXRefDirectoriesQueryResponse`)}DFUXRefFoundFiles(e,t){return this._connection.send(`DFUXRefFoundFiles`,e,`json`,!1,t,`DFUXRefFoundFilesQueryResponse`)}DFUXRefList(e,t){return this._connection.send(`DFUXRefList`,e,`json`,!1,t,`DFUXRefListResponse`)}DFUXRefLostFiles(e,t){return this._connection.send(`DFUXRefLostFiles`,e,`json`,!1,t,`DFUXRefLostFilesQueryResponse`)}DFUXRefMessages(e,t){return this._connection.send(`DFUXRefMessages`,e,`json`,!1,t,`DFUXRefMessagesQueryResponse`)}DFUXRefOrphanFiles(e,t){return this._connection.send(`DFUXRefOrphanFiles`,e,`json`,!1,t,`DFUXRefOrphanFilesQueryResponse`)}DFUXRefUnusedFiles(e,t){return this._connection.send(`DFUXRefUnusedFiles`,e,`json`,!1,t,`DFUXRefUnusedFilesResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`WsDFUXRefPingResponse`)}},DFUXRefService=class extends DFUXRefServiceBase{DFUXRefDirectoriesEx(e){return this._connection.send(`DFUXRefDirectories`,e,`json`,!1,void 0,`DFUXRefDirectoriesQueryResponse`)}DFUXRefListEx(e){return this._connection.send(`DFUXRefList`,e,`json`,!1,void 0,`DFUXRefListResponse`)}};function jsonToIField(e,t){let n=typeof t;switch(n){case`boolean`:case`number`:case`string`:return{id:e,type:n};case`object`:if(t.Row instanceof Array&&(t=t.Row),t instanceof Array)return{id:e,type:`dataset`,children:jsonToIFieldArr(t[0])};if(t instanceof Object){if(t.Item&&t.Item instanceof Array&&t.Item.length===1){let n=typeof t.Item[0];if(n===`string`||n===`number`)return{id:e,type:`set`,fieldType:n};throw Error(`Unknown field type`)}return{id:e,type:`object`,fields:jsonToIFieldObj(t)}}default:throw Error(`Unknown field type`)}}function jsonToIFieldArr(e){e.Row&&e.Row instanceof Array&&(e=e.Row[0]);let t=[];for(let n in e)t.push(jsonToIField(n,e[n]));return t}function jsonToIFieldObj(e){let t={};for(let n in e)t[n]=jsonToIField(n,e[n]);return t}var EclService=class extends Service{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(e=>{let t=JSON.parse(e);for(let e in t)return t[e];return{}}).then(jsonToIFieldArr)}responseJson(e,t){return this._connection.send(`example/response/query/${e}/${t}/json`,{},`text`).then(e=>{let t=JSON.parse(e);for(let e in t)return t[e].Results;return{}}).then(e=>{let t={};for(let n in e)t[n]=jsonToIFieldArr(e[n]);return t})}submit(e,t,n){let r=`submit/query/${e}/${t}`;return this._connection.send(r,n,`json2`).then(e=>{if(e.Results&&e.Results.Exception)throw new ESPExceptions(r,n,{Source:`wsEcl.submit`,Exception:e.Results.Exception});return e.Results})}},ElkServiceBase=class extends Service{constructor(e){super(e,`ws_elk`,`1`)}GetConfigDetails(e,t){return this._connection.send(`GetConfigDetails`,e,`json`,!1,t,`GetConfigDetailsResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`ws_elkPingResponse`)}},ElkService=class extends ElkServiceBase{},S;(function(e){e.LogColumnType=function(e){return e.global=`global`,e.workunits=`workunits`,e.components=`components`,e.audience=`audience`,e.class=`class`,e.instance=`instance`,e.node=`node`,e.message=`message`,e.logid=`logid`,e.processid=`processid`,e.threadid=`threadid`,e.timestamp=`timestamp`,e.pod=`pod`,e.traceid=`traceid`,e.spanid=`spanid`,e}({}),e.LogColumnValueType=function(e){return e.string=`string`,e.numeric=`numeric`,e.datetime=`datetime`,e.enum=`enum`,e.epoch=`epoch`,e}({}),e.LogAccessType=function(e){return e[e.All=0]=`All`,e[e.ByJobID=1]=`ByJobID`,e[e.ByComponent=2]=`ByComponent`,e[e.ByLogType=3]=`ByLogType`,e[e.ByTargetAudience=4]=`ByTargetAudience`,e[e.BySourceInstance=5]=`BySourceInstance`,e[e.BySourceNode=6]=`BySourceNode`,e[e.ByFieldName=7]=`ByFieldName`,e[e.ByPod=8]=`ByPod`,e[e.ByTraceID=9]=`ByTraceID`,e[e.BySpanID=10]=`BySpanID`,e}({}),e.LogAccessStatusCode=function(e){return e[e.Success=0]=`Success`,e[e.Warning=1]=`Warning`,e[e.Fail=2]=`Fail`,e}({}),e.LogAccessFilterOperator=function(e){return e[e.NONE=0]=`NONE`,e[e.AND=1]=`AND`,e[e.OR=2]=`OR`,e}({}),e.LogSelectColumnMode=function(e){return e[e.MIN=0]=`MIN`,e[e.DEFAULT=1]=`DEFAULT`,e[e.ALL=2]=`ALL`,e[e.CUSTOM=3]=`CUSTOM`,e}({}),e.SortColumType=function(e){return e[e.ByDate=0]=`ByDate`,e[e.ByJobID=1]=`ByJobID`,e[e.ByComponent=2]=`ByComponent`,e[e.ByLogType=3]=`ByLogType`,e[e.ByTargetAudience=4]=`ByTargetAudience`,e[e.BySourceInstance=5]=`BySourceInstance`,e[e.BySourceNode=6]=`BySourceNode`,e[e.ByFieldName=7]=`ByFieldName`,e[e.ByPod=8]=`ByPod`,e[e.ByTraceID=9]=`ByTraceID`,e[e.BySpanID=10]=`BySpanID`,e}({}),e.SortDirection=function(e){return e[e.ASC=0]=`ASC`,e[e.DSC=1]=`DSC`,e}({})})(S||={});var LogaccessServiceBase=class extends Service{constructor(e){super(e,`ws_logaccess`,`1.08`)}GetHealthReport(e){return this._connection.send(`GetHealthReport`,e,`json`,!1,void 0,`GetHealthReportResponse`)}GetLogAccessInfo(e){return this._connection.send(`GetLogAccessInfo`,e,`json`,!1,void 0,`GetLogAccessInfoResponse`)}GetLogs(e){return this._connection.send(`GetLogs`,e,`json`,!1,void 0,`GetLogsResponse`)}Ping(e){return this._connection.send(`Ping`,e,`json`,!1,void 0,`ws_logaccessPingResponse`)}},C=(0,t.scopedLogger)(`@hpcc-js/comms/services/wsLogaccess.ts`),w=function(e){return e.Disaster=`DIS`,e.Error=`ERR`,e.Warning=`WRN`,e.Information=`INF`,e.Progress=`PRO`,e.Metric=`MET`,e}({}),T=function(e){return e.Operator=`OPR`,e.User=`USR`,e.Programmer=`PRO`,e.Audit=`ADT`,e}({}),E=new Set([`azureloganalyticscurl`,`elasticstack`,`grafanacurl`]),ee=new Set(Object.values(S.LogColumnType));function getLogCategory(e){switch(e){case S.LogColumnType.workunits:case`hpcc.log.jobid`:return S.LogAccessType.ByJobID;case S.LogColumnType.audience:case`hpcc.log.audience`:return S.LogAccessType.ByTargetAudience;case S.LogColumnType.class:case`hpcc.log.class`:return S.LogAccessType.ByLogType;case S.LogColumnType.components:case`kubernetes.container.name`:return S.LogAccessType.ByComponent;default:return S.LogAccessType.ByFieldName}}var te=[`audience`,`class`,`workunits`,`message`,`processid`,`logid`,`threadid`,`timestamp`,`components`,`instance`];function buildFilters(e,t){let n=[];for(let r of te){let i=e[r];if(i==null||i===``||Array.isArray(i)&&i.length===0||!(r in t))continue;let a=ee.has(r)?r:t[r],o=getLogCategory(a);o===S.LogAccessType.ByFieldName&&(a=t[r]);let s=o===S.LogAccessType.ByComponent,c=Array.isArray(i)?i:[i];for(let e of c)n.push({LogCategory:o,SearchField:a,SearchByValue:s?e+`*`:e})}return n}function buildOrGroup(e){let t={leftFilter:e[0]},n=t;for(let t=1;t<e.length;t++)n.Operator=S.LogAccessFilterOperator.OR,t===e.length-1?n.rightFilter=e[t]:(n.rightBinaryFilter={BinaryLogFilter:[{leftFilter:e[t]}]},n=n.rightBinaryFilter.BinaryLogFilter[0]);return t}function buildAndChain(e){let[t,...n]=e,r={};if(t.length===1?r.leftFilter=t[0]:r.leftBinaryFilter={BinaryLogFilter:[buildOrGroup(t)]},n.length===0)return r;if(r.Operator=S.LogAccessFilterOperator.AND,n.length===1){let[e]=n;e.length===1?r.rightFilter=e[0]:r.rightBinaryFilter={BinaryLogFilter:[buildOrGroup(e)]}}else r.rightBinaryFilter={BinaryLogFilter:[buildAndChain(n)]};return r}function buildFilterTree(e){let t=new Map;for(let n of e){let e=t.get(n.SearchField);e?e.push(n):t.set(n.SearchField,[n])}let n=[...t.values()];if(n.length===0)return{leftFilter:{LogCategory:S.LogAccessType.All}};let[r,...i]=n,a={};if(r.length===1?a.leftFilter=r[0]:a.leftBinaryFilter={BinaryLogFilter:[buildOrGroup(r)]},i.length===0)return a;if(a.Operator=S.LogAccessFilterOperator.AND,i.length===1){let[e]=i;e.length===1?a.rightFilter=e[0]:a.rightBinaryFilter={BinaryLogFilter:[buildOrGroup(e)]}}else a.rightBinaryFilter={BinaryLogFilter:[buildAndChain(i)]};return a}var LogaccessService=class extends LogaccessServiceBase{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||=super.GetLogAccessInfo(e),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}convertLogLine(e,t){let n={},r=t?.fields?Object.assign({},...t.fields):null;for(let t in e)n[t]=r?r[e[t]]??``:``;return n}async GetLogsEx(e){let t=await this.GetLogAccessInfo(),n={};t.Columns.Column.forEach(e=>n[e.LogType]=e.Name);let r=buildFilters(e,n),i={StartDate:e.StartDate instanceof Date?e.StartDate.toISOString():new Date(0).toISOString()};e.EndDate instanceof Date&&(i.EndDate=e.EndDate.toISOString());let a={Filter:buildFilterTree(r),Range:i,LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:S.LogSelectColumnMode.DEFAULT,Format:`JSON`,SortBy:{SortCondition:[{BySortType:S.SortColumType.ByDate,ColumnName:``,Direction:0}]}};return this.GetLogs(a).then(e=>{try{let r=JSON.parse(e.LogLines);return{lines:E.has(t.RemoteLogManagerType)?r.lines?.map(e=>this.convertLogLine(n,e))??[]:(C.warning(`Unknown RemoteLogManagerType: ${t.RemoteLogManagerType}`),[]),total:e.TotalLogLinesAvailable??1e4}}catch(e){C.error(e.message??e)}return{lines:[],total:0}})}};function ascending_default(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}__name(ascending_default,`default`);function bisector_default(e){return e.length===1&&(e=ascendingComparator(e)),{left:function(t,n,r,i){for(r??=0,i??=t.length;r<i;){var a=r+i>>>1;e(t[a],n)<0?r=a+1:i=a}return r},right:function(t,n,r,i){for(r??=0,i??=t.length;r<i;){var a=r+i>>>1;e(t[a],n)>0?i=a:r=a+1}return r}}}__name(bisector_default,`default`);function ascendingComparator(e){return function(t,n){return ascending_default(e(t),n)}}var ne=bisector_default(ascending_default);ne.right,ne.left;function number_default(e){return e===null?NaN:+e}__name(number_default,`default`);var re=Array.prototype;re.slice,re.map;function max_default(e,t){var n=e.length,r=-1,i,a;if(t==null){for(;++r<n;)if((i=e[r])!=null&&i>=i)for(a=i;++r<n;)(i=e[r])!=null&&i>a&&(a=i)}else for(;++r<n;)if((i=t(e[r],r,e))!=null&&i>=i)for(a=i;++r<n;)(i=t(e[r],r,e))!=null&&i>a&&(a=i);return a}__name(max_default,`default`);function mean_default(e,t){var n=e.length,r=n,i=-1,a,o=0;if(t==null)for(;++i<n;)isNaN(a=number_default(e[i]))?--r:o+=a;else for(;++i<n;)isNaN(a=number_default(t(e[i],i,e)))?--r:o+=a;if(r)return o/r}__name(mean_default,`default`);var ie;(function(e){e.ThresholdType=function(e){return e[e.THRESHOLD_PERCENTAGE=0]=`THRESHOLD_PERCENTAGE`,e[e.THRESHOLD_MB=1]=`THRESHOLD_MB`,e}({}),e.TpMachineType=function(e){return e.ALLNODES=`ALLNODES`,e.THORMACHINES=`THORMACHINES`,e.HOLEMACHINES=`HOLEMACHINES`,e.ROXIEMACHINES=`ROXIEMACHINES`,e.MACHINES=`MACHINES`,e.AVAILABLEMACHINES=`AVAILABLEMACHINES`,e.DROPZONE=`DROPZONE`,e.STANDBYNNODE=`STANDBYNNODE`,e.THORSPARENODES=`THORSPARENODES`,e.HOLESTANDBYNODES=`HOLESTANDBYNODES`,e}({})})(ie||={});var MachineServiceBase=class extends Service{constructor(e){super(e,`ws_machine`,`1.19`)}GetComponentStatus(e,t){return this._connection.send(`GetComponentStatus`,e,`json`,!1,t,`GetComponentStatusResponse`)}GetComponentUsage(e,t){return this._connection.send(`GetComponentUsage`,e,`json`,!1,t,`GetComponentUsageResponse`)}GetMachineInfo(e,t){return this._connection.send(`GetMachineInfo`,e,`json`,!1,t,`GetMachineInfoResponse`)}GetMachineInfoEx(e,t){return this._connection.send(`GetMachineInfoEx`,e,`json`,!1,t,`GetMachineInfoResponseEx`)}GetMetrics(e,t){return this._connection.send(`GetMetrics`,e,`json`,!1,t,`MetricsResponse`)}GetNodeGroupUsage(e,t){return this._connection.send(`GetNodeGroupUsage`,e,`json`,!1,t,`GetNodeGroupUsageResponse`)}GetTargetClusterInfo(e,t){return this._connection.send(`GetTargetClusterInfo`,e,`json`,!1,t,`GetTargetClusterInfoResponse`)}GetTargetClusterUsage(e,t){return this._connection.send(`GetTargetClusterUsage`,e,`json`,!1,t,`GetTargetClusterUsageResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`ws_machinePingResponse`)}UpdateComponentStatus(e,t){return this._connection.send(`UpdateComponentStatus`,e,`json`,!1,t,`UpdateComponentStatusResponse`)}},MachineService=class extends MachineServiceBase{GetTargetClusterUsageEx(e,n=!1){return this._connection.send(`GetTargetClusterUsage`,{TargetClusters:e?{Item:e}:{},BypassCachedResult:n}).then(e=>(0,t.exists)(`TargetClusterUsages.TargetClusterUsage`,e)?e.TargetClusterUsages.TargetClusterUsage:[]).then(e=>e.filter(e=>!!e.ComponentUsages).map(e=>{let t=e.ComponentUsages.ComponentUsage.map(e=>{let t=(e.MachineUsages&&e.MachineUsages.MachineUsage?e.MachineUsages.MachineUsage:[]).map(e=>{let t=e.DiskUsages&&e.DiskUsages.DiskUsage?e.DiskUsages.DiskUsage.map(e=>({...e,InUse:e.InUse*1024,Total:(e.InUse+e.Available)*1024,PercentUsed:100-e.PercentAvailable})):[];return{Name:e.Name,NetAddress:e.NetAddress,Description:e.Description,DiskUsages:t,mean:mean_default(t.filter(e=>!isNaN(e.PercentUsed)),e=>e.PercentUsed),max:max_default(t.filter(e=>!isNaN(e.PercentUsed)),e=>e.PercentUsed)}});return{Type:e.Type,Name:e.Name,Description:e.Description,MachineUsages:t,MachineUsagesDescription:t.reduce((e,t)=>e+(t.Description||``),``),mean:mean_default(t.filter(e=>!isNaN(e.mean)),e=>e.mean),max:max_default(t.filter(e=>!isNaN(e.max)),e=>e.max)}});return{Name:e.Name,Description:e.Description,ComponentUsages:t,ComponentUsagesDescription:t.reduce((e,t)=>e+(t.MachineUsagesDescription||``),``),mean:mean_default(t.filter(e=>!isNaN(e.mean)),e=>e.mean),max:max_default(t.filter(e=>!isNaN(e.max)),e=>e.max)}}))}},PackageProcessServiceBase=class extends Service{constructor(e){super(e,`WsPackageProcess`,`1.08`)}ActivatePackage(e,t){return this._connection.send(`ActivatePackage`,e,`json`,!1,t,`ActivatePackageResponse`)}AddPackage(e,t){return this._connection.send(`AddPackage`,e,`json`,!1,t,`AddPackageResponse`)}AddPartToPackageMap(e,t){return this._connection.send(`AddPartToPackageMap`,e,`json`,!1,t,`AddPartToPackageMapResponse`)}CopyPackageMap(e,t){return this._connection.send(`CopyPackageMap`,e,`json`,!1,t,`CopyPackageMapResponse`)}DeActivatePackage(e,t){return this._connection.send(`DeActivatePackage`,e,`json`,!1,t,`DeActivatePackageResponse`)}DeletePackage(e,t){return this._connection.send(`DeletePackage`,e,`json`,!1,t,`DeletePackageResponse`)}Echo(e,t){return this._connection.send(`Echo`,e,`json`,!1,t,`EchoResponse`)}GetPackage(e,t){return this._connection.send(`GetPackage`,e,`json`,!1,t,`GetPackageResponse`)}GetPackageMapById(e,t){return this._connection.send(`GetPackageMapById`,e,`json`,!1,t,`GetPackageMapByIdResponse`)}GetPackageMapSelectOptions(e,t){return this._connection.send(`GetPackageMapSelectOptions`,e,`json`,!1,t,`GetPackageMapSelectOptionsResponse`)}GetPartFromPackageMap(e,t){return this._connection.send(`GetPartFromPackageMap`,e,`json`,!1,t,`GetPartFromPackageMapResponse`)}GetQueryFileMapping(e,t){return this._connection.send(`GetQueryFileMapping`,e,`json`,!1,t,`GetQueryFileMappingResponse`)}ListPackage(e,t){return this._connection.send(`ListPackage`,e,`json`,!1,t,`ListPackageResponse`)}ListPackages(e,t){return this._connection.send(`ListPackages`,e,`json`,!1,t,`ListPackagesResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`WsPackageProcessPingResponse`)}RemovePartFromPackageMap(e,t){return this._connection.send(`RemovePartFromPackageMap`,e,`json`,!1,t,`RemovePartFromPackageMapResponse`)}ValidatePackage(e,t){return this._connection.send(`ValidatePackage`,e,`json`,!1,t,`ValidatePackageResponse`)}},PackageProcessService=class extends PackageProcessServiceBase{},ResourcesServiceBase=class extends Service{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)}},ResourcesService=class extends ResourcesServiceBase{},ae;(function(e){e.WUTypes=function(e){return e.ECL=`ECL`,e.DFU=`DFU`,e}({})})(ae||={});var SashaServiceBase=class extends Service{constructor(e){super(e,`WSSasha`,`1.01`)}ArchiveWU(e,t){return this._connection.send(`ArchiveWU`,e,`json`,!1,t,`ResultResponse`)}GetVersion(e,t){return this._connection.send(`GetVersion`,e,`json`,!1,t,`ResultResponse`)}ListWU(e,t){return this._connection.send(`ListWU`,e,`json`,!1,t,`ResultResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`WSSashaPingResponse`)}RestoreWU(e,t){return this._connection.send(`RestoreWU`,e,`json`,!1,t,`ResultResponse`)}},SashaService=class extends SashaServiceBase{},oe=new Date,D=new Date;function newInterval(e,t,n,r){function interval(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return interval.floor=function(t){return e(t=new Date(+t)),t},interval.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},interval.round=function(e){var t=interval(e),n=interval.ceil(e);return e-t<n-e?t:n},interval.offset=function(e,n){return t(e=new Date(+e),n==null?1:Math.floor(n)),e},interval.range=function(n,r,i){var a=[],o;if(n=interval.ceil(n),i=i==null?1:Math.floor(i),!(n<r)||!(i>0))return a;do a.push(o=new Date(+n)),t(n,i),e(n);while(o<n&&n<r);return a},interval.filter=function(n){return newInterval(function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););})},n&&(interval.count=function(t,r){return oe.setTime(+t),D.setTime(+r),e(oe),e(D),Math.floor(n(oe,D))},interval.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?interval.filter(r?function(t){return r(t)%e===0}:function(t){return interval.count(0,t)%e===0}):interval}),interval}var se=6e4,ce=864e5,le=6048e5,O=newInterval(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*se)/ce},function(e){return e.getDate()-1});O.range;function weekday(e){return newInterval(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t*7)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*se)/le})}var ue=weekday(0),k=weekday(1),de=weekday(2),fe=weekday(3),A=weekday(4),pe=weekday(5),me=weekday(6);ue.range,k.range,de.range,fe.range,A.range,pe.range,me.range;var j=newInterval(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});j.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:newInterval(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)})},j.range;var M=newInterval(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/ce},function(e){return e.getUTCDate()-1});M.range;function utcWeekday(e){return newInterval(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t*7)},function(e,t){return(t-e)/le})}var he=utcWeekday(0),N=utcWeekday(1),ge=utcWeekday(2),_e=utcWeekday(3),P=utcWeekday(4),ve=utcWeekday(5),ye=utcWeekday(6);he.range,N.range,ge.range,_e.range,P.range,ve.range,ye.range;var F=newInterval(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});F.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:newInterval(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})},F.range;function localDate(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function utcDate(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function newDate(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function formatLocale(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=formatRe(i),u=formatLookup(i),d=formatRe(a),f=formatLookup(a),p=formatRe(o),m=formatLookup(o),h=formatRe(s),g=formatLookup(s),_=formatRe(c),v=formatLookup(c),y={a:formatShortWeekday,A:formatWeekday,b:formatShortMonth,B:formatMonth,c:null,d:formatDayOfMonth,e:formatDayOfMonth,f:formatMicroseconds,g:formatYearISO,G:formatFullYearISO,H:formatHour24,I:formatHour12,j:formatDayOfYear,L:formatMilliseconds,m:formatMonthNumber,M:formatMinutes,p:formatPeriod,q:formatQuarter,Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatSeconds,u:formatWeekdayNumberMonday,U:formatWeekNumberSunday,V:formatWeekNumberISO,w:formatWeekdayNumberSunday,W:formatWeekNumberMonday,x:null,X:null,y:formatYear,Y:formatFullYear,Z:formatZone,"%":formatLiteralPercent},b={a:formatUTCShortWeekday,A:formatUTCWeekday,b:formatUTCShortMonth,B:formatUTCMonth,c:null,d:formatUTCDayOfMonth,e:formatUTCDayOfMonth,f:formatUTCMicroseconds,g:formatUTCYearISO,G:formatUTCFullYearISO,H:formatUTCHour24,I:formatUTCHour12,j:formatUTCDayOfYear,L:formatUTCMilliseconds,m:formatUTCMonthNumber,M:formatUTCMinutes,p:formatUTCPeriod,q:formatUTCQuarter,Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatUTCSeconds,u:formatUTCWeekdayNumberMonday,U:formatUTCWeekNumberSunday,V:formatUTCWeekNumberISO,w:formatUTCWeekdayNumberSunday,W:formatUTCWeekNumberMonday,x:null,X:null,y:formatUTCYear,Y:formatUTCFullYear,Z:formatUTCZone,"%":formatLiteralPercent},x={a:parseShortWeekday,A:parseWeekday,b:parseShortMonth,B:parseMonth,c:parseLocaleDateTime,d:parseDayOfMonth,e:parseDayOfMonth,f:parseMicroseconds,g:parseYear,G:parseFullYear,H:parseHour24,I:parseHour24,j:parseDayOfYear,L:parseMilliseconds,m:parseMonthNumber,M:parseMinutes,p:parsePeriod,q:parseQuarter,Q:parseUnixTimestamp,s:parseUnixTimestampSeconds,S:parseSeconds,u:parseWeekdayNumberMonday,U:parseWeekNumberSunday,V:parseWeekNumberISO,w:parseWeekdayNumberSunday,W:parseWeekNumberMonday,x:parseLocaleDate,X:parseLocaleTime,y:parseYear,Y:parseFullYear,Z:parseZone,"%":parseLiteralPercent};y.x=newFormat(n,y),y.X=newFormat(r,y),y.c=newFormat(t,y),b.x=newFormat(n,b),b.X=newFormat(r,b),b.c=newFormat(t,b);function newFormat(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=be[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function newParse(e,t){return function(n){var r=newDate(1900,void 0,1),i=parseSpecifier(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=utcDate(newDate(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?N.ceil(a):N(a),a=M.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=localDate(newDate(r.y,0,1)),o=a.getDay(),a=o>4||o===0?k.ceil(a):k(a),a=O.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?utcDate(newDate(r.y,0,1)).getUTCDay():localDate(newDate(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,utcDate(r)):localDate(r)}}function parseSpecifier(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in be?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function parsePeriod(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u[r[0].toLowerCase()],n+r[0].length):-1}function parseShortWeekday(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m[r[0].toLowerCase()],n+r[0].length):-1}function parseWeekday(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f[r[0].toLowerCase()],n+r[0].length):-1}function parseShortMonth(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v[r[0].toLowerCase()],n+r[0].length):-1}function parseMonth(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g[r[0].toLowerCase()],n+r[0].length):-1}function parseLocaleDateTime(e,n,r){return parseSpecifier(e,t,n,r)}function parseLocaleDate(e,t,r){return parseSpecifier(e,n,t,r)}function parseLocaleTime(e,t,n){return parseSpecifier(e,r,t,n)}function formatShortWeekday(e){return o[e.getDay()]}function formatWeekday(e){return a[e.getDay()]}function formatShortMonth(e){return c[e.getMonth()]}function formatMonth(e){return s[e.getMonth()]}function formatPeriod(e){return i[+(e.getHours()>=12)]}function formatQuarter(e){return 1+~~(e.getMonth()/3)}function formatUTCShortWeekday(e){return o[e.getUTCDay()]}function formatUTCWeekday(e){return a[e.getUTCDay()]}function formatUTCShortMonth(e){return c[e.getUTCMonth()]}function formatUTCMonth(e){return s[e.getUTCMonth()]}function formatUTCPeriod(e){return i[+(e.getUTCHours()>=12)]}function formatUTCQuarter(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=newFormat(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=newParse(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=newFormat(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=newParse(e+=``,!0);return t.toString=function(){return e},t}}}var be={"-":``,_:` `,0:`0`},I=/^\s*\d+/,xe=/^%/,Se=/[\\^$*+?|[\]().{}]/g;function pad(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function requote(e){return e.replace(Se,`\\$&`)}function formatRe(e){return RegExp(`^(?:`+e.map(requote).join(`|`)+`)`,`i`)}function formatLookup(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function parseWeekdayNumberSunday(e,t,n){var r=I.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function parseWeekdayNumberMonday(e,t,n){var r=I.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function parseWeekNumberSunday(e,t,n){var r=I.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function parseWeekNumberISO(e,t,n){var r=I.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function parseWeekNumberMonday(e,t,n){var r=I.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function parseFullYear(e,t,n){var r=I.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function parseYear(e,t,n){var r=I.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function parseZone(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function parseQuarter(e,t,n){var r=I.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function parseMonthNumber(e,t,n){var r=I.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function parseDayOfMonth(e,t,n){var r=I.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function parseDayOfYear(e,t,n){var r=I.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function parseHour24(e,t,n){var r=I.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function parseMinutes(e,t,n){var r=I.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function parseSeconds(e,t,n){var r=I.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function parseMilliseconds(e,t,n){var r=I.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function parseMicroseconds(e,t,n){var r=I.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function parseLiteralPercent(e,t,n){var r=xe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function parseUnixTimestamp(e,t,n){var r=I.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function parseUnixTimestampSeconds(e,t,n){var r=I.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function formatDayOfMonth(e,t){return pad(e.getDate(),t,2)}function formatHour24(e,t){return pad(e.getHours(),t,2)}function formatHour12(e,t){return pad(e.getHours()%12||12,t,2)}function formatDayOfYear(e,t){return pad(1+O.count(j(e),e),t,3)}function formatMilliseconds(e,t){return pad(e.getMilliseconds(),t,3)}function formatMicroseconds(e,t){return formatMilliseconds(e,t)+`000`}function formatMonthNumber(e,t){return pad(e.getMonth()+1,t,2)}function formatMinutes(e,t){return pad(e.getMinutes(),t,2)}function formatSeconds(e,t){return pad(e.getSeconds(),t,2)}function formatWeekdayNumberMonday(e){var t=e.getDay();return t===0?7:t}function formatWeekNumberSunday(e,t){return pad(ue.count(j(e)-1,e),t,2)}function dISO(e){var t=e.getDay();return t>=4||t===0?A(e):A.ceil(e)}function formatWeekNumberISO(e,t){return e=dISO(e),pad(A.count(j(e),e)+(j(e).getDay()===4),t,2)}function formatWeekdayNumberSunday(e){return e.getDay()}function formatWeekNumberMonday(e,t){return pad(k.count(j(e)-1,e),t,2)}function formatYear(e,t){return pad(e.getFullYear()%100,t,2)}function formatYearISO(e,t){return e=dISO(e),pad(e.getFullYear()%100,t,2)}function formatFullYear(e,t){return pad(e.getFullYear()%1e4,t,4)}function formatFullYearISO(e,t){var n=e.getDay();return e=n>=4||n===0?A(e):A.ceil(e),pad(e.getFullYear()%1e4,t,4)}function formatZone(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+pad(t/60|0,`0`,2)+pad(t%60,`0`,2)}function formatUTCDayOfMonth(e,t){return pad(e.getUTCDate(),t,2)}function formatUTCHour24(e,t){return pad(e.getUTCHours(),t,2)}function formatUTCHour12(e,t){return pad(e.getUTCHours()%12||12,t,2)}function formatUTCDayOfYear(e,t){return pad(1+M.count(F(e),e),t,3)}function formatUTCMilliseconds(e,t){return pad(e.getUTCMilliseconds(),t,3)}function formatUTCMicroseconds(e,t){return formatUTCMilliseconds(e,t)+`000`}function formatUTCMonthNumber(e,t){return pad(e.getUTCMonth()+1,t,2)}function formatUTCMinutes(e,t){return pad(e.getUTCMinutes(),t,2)}function formatUTCSeconds(e,t){return pad(e.getUTCSeconds(),t,2)}function formatUTCWeekdayNumberMonday(e){var t=e.getUTCDay();return t===0?7:t}function formatUTCWeekNumberSunday(e,t){return pad(he.count(F(e)-1,e),t,2)}function UTCdISO(e){var t=e.getUTCDay();return t>=4||t===0?P(e):P.ceil(e)}function formatUTCWeekNumberISO(e,t){return e=UTCdISO(e),pad(P.count(F(e),e)+(F(e).getUTCDay()===4),t,2)}function formatUTCWeekdayNumberSunday(e){return e.getUTCDay()}function formatUTCWeekNumberMonday(e,t){return pad(N.count(F(e)-1,e),t,2)}function formatUTCYear(e,t){return pad(e.getUTCFullYear()%100,t,2)}function formatUTCYearISO(e,t){return e=UTCdISO(e),pad(e.getUTCFullYear()%100,t,2)}function formatUTCFullYear(e,t){return pad(e.getUTCFullYear()%1e4,t,4)}function formatUTCFullYearISO(e,t){var n=e.getUTCDay();return e=n>=4||n===0?P(e):P.ceil(e),pad(e.getUTCFullYear()%1e4,t,4)}function formatUTCZone(){return`+0000`}function formatLiteralPercent(){return`%`}function formatUnixTimestamp(e){return+e}function formatUnixTimestampSeconds(e){return Math.floor(e/1e3)}var L,Ce,we,Te;defaultLocale$1({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 defaultLocale$1(e){return L=formatLocale(e),L.format,Ce=L.parse,we=L.utcFormat,Te=L.utcParse,L}__name(defaultLocale$1,`defaultLocale`);var Ee;(function(e){e.LockModes=function(e){return e.ALL=`ALL`,e.READ=`READ`,e.WRITE=`WRITE`,e.HOLD=`HOLD`,e.SUB=`SUB`,e}({}),e.RoxieControlCmdType=function(e){return e.Attach=`Attach`,e.Detach=`Detach`,e.State=`State`,e.Reload=`Reload`,e.ReloadRetry=`ReloadRetry`,e.MemLock=`MemLock`,e.MemUnlock=`MemUnlock`,e.GetMemLocked=`GetMemLocked`,e}({})})(Ee||={});var SMCServiceBase=class extends Service{constructor(e){super(e,`WsSMC`,`1.29`)}Activity(e){return this._connection.send(`Activity`,e,`json`,!1,void 0,`ActivityResponse`)}BrowseResources(e){return this._connection.send(`BrowseResources`,e,`json`,!1,void 0,`BrowseResourcesResponse`)}ClearQueue(e){return this._connection.send(`ClearQueue`,e,`json`,!1,void 0,`SMCQueueResponse`)}GetBuildInfo(e){return this._connection.send(`GetBuildInfo`,e,`json`,!1,void 0,`GetBuildInfoResponse`)}GetGlobalMetrics(e){return this._connection.send(`GetGlobalMetrics`,e,`json`,!1,void 0,`GetGlobalMetricsResponse`)}GetStatusServerInfo(e){return this._connection.send(`GetStatusServerInfo`,e,`json`,!1,void 0,`GetStatusServerInfoResponse`)}GetThorQueueAvailability(e){return this._connection.send(`GetThorQueueAvailability`,e,`json`,!1,void 0,`GetThorQueueAvailabilityResponse`)}Index(e){return this._connection.send(`Index`,e,`json`,!1,void 0,`SMCIndexResponse`)}LockQuery(e){return this._connection.send(`LockQuery`,e,`json`,!1,void 0,`LockQueryResponse`)}MoveJobBack(e){return this._connection.send(`MoveJobBack`,e,`json`,!1,void 0,`SMCJobResponse`)}MoveJobDown(e){return this._connection.send(`MoveJobDown`,e,`json`,!1,void 0,`SMCJobResponse`)}MoveJobFront(e){return this._connection.send(`MoveJobFront`,e,`json`,!1,void 0,`SMCJobResponse`)}MoveJobUp(e){return this._connection.send(`MoveJobUp`,e,`json`,!1,void 0,`SMCJobResponse`)}NotInCommunityEdition(e){return this._connection.send(`NotInCommunityEdition`,e,`json`,!1,void 0,`NotInCommunityEditionResponse`)}PauseQueue(e){return this._connection.send(`PauseQueue`,e,`json`,!1,void 0,`SMCQueueResponse`)}Ping(e){return this._connection.send(`Ping`,e,`json`,!1,void 0,`WsSMCPingResponse`)}RecordGlobalMetrics(e){return this._connection.send(`RecordGlobalMetrics`,e,`json`,!1,void 0,`RecordGlobalMetricsResponse`)}RemoveJob(e){return this._connection.send(`RemoveJob`,e,`json`,!1,void 0,`SMCJobResponse`)}ResumeQueue(e){return this._connection.send(`ResumeQueue`,e,`json`,!1,void 0,`SMCQueueResponse`)}RoxieControlCmd(e){return this._connection.send(`RoxieControlCmd`,e,`json`,!1,void 0,`RoxieControlCmdResponse`)}RoxieXrefCmd(e){return this._connection.send(`RoxieXrefCmd`,e,`json`,!1,void 0,`RoxieXrefCmdResponse`)}SetBanner(e){return this._connection.send(`SetBanner`,e,`json`,!1,void 0,`SetBannerResponse`)}SetJobPriority(e){return this._connection.send(`SetJobPriority`,e,`json`,!1,void 0,`SMCPriorityResponse`)}StopQueue(e){return this._connection.send(`StopQueue`,e,`json`,!1,void 0,`SMCQueueResponse`)}},De=Ce(`%Y%m%d%H`);function isNumeric(e){return typeof e==`number`||typeof e==`string`&&e.trim()!==``&&!isNaN(+e)}var SMCService=class extends SMCServiceBase{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(e=>({Running:{ActiveWorkunit:[]},...e}))}parseGlobalMetric(e,t){return e.startsWith(`Cost`)?t/1e6:e.startsWith(`Date`)?De(t):e.startsWith(`Num`)?+t:e.startsWith(`Time`)?t/1e9:e.startsWith(`When`)?new Date(t/1e3).toISOString():isNumeric(t)?+t:t}GetNormalisedGlobalMetrics(e){return super.GetGlobalMetrics(e).then(e=>{let t=[];for(let n of e?.GlobalMetrics?.GlobalMetric||[]){let e={Category:n.Category,Start:this.parseGlobalMetric(`Date`,n.DateTimeRange?.Start),End:this.parseGlobalMetric(`Date`,n.DateTimeRange?.End),dimensions:{},stats:{}};for(let t of n.Dimensions?.Dimension||[])e.dimensions[t.Name]=t.Value;for(let t of n.Stats?.Stat||[])e.stats[t.Name]=this.parseGlobalMetric(t.Name,t.Value);t.push(e)}return t})}},storeServiceBase=class extends Service{constructor(e){super(e,`wsstore`,`1.02`)}CreateStore(e,t){return this._connection.send(`CreateStore`,e,`json`,!1,t,`CreateStoreResponse`)}Delete(e,t){return this._connection.send(`Delete`,e,`json`,!1,t,`DeleteResponse`)}DeleteNamespace(e,t){return this._connection.send(`DeleteNamespace`,e,`json`,!1,t,`DeleteNamespaceResponse`)}Fetch(e,t){return this._connection.send(`Fetch`,e,`json`,!1,t,`FetchResponse`)}FetchAll(e,t){return this._connection.send(`FetchAll`,e,`json`,!1,t,`FetchAllResponse`)}FetchKeyMetadata(e,t){return this._connection.send(`FetchKeyMetadata`,e,`json`,!1,t,`FetchKeyMDResponse`)}ListKeys(e,t){return this._connection.send(`ListKeys`,e,`json`,!1,t,`ListKeysResponse`)}ListNamespaces(e,t){return this._connection.send(`ListNamespaces`,e,`json`,!1,t,`ListNamespacesResponse`)}ListStores(e,t){return this._connection.send(`ListStores`,e,`json`,!1,t,`ListStoresResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`wsstorePingResponse`)}Set(e,t){return this._connection.send(`Set`,e,`json`,!1,t,`SetResponse`)}},StoreService=class extends storeServiceBase{Delete(e){return super.Delete(e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>e.Code===-1))return{Exceptions:void 0,Success:!0};throw e})}Fetch(e){return super.Fetch(e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>e.Code===-1))return{Exceptions:void 0,Value:void 0};throw e})}},Oe;(function(e){e.TpConfigResponseFormat=function(e){return e.XML=`XML`,e.YAML=`YAML`,e}({}),e.RoxieQueueFilter=function(e){return e.All=`All`,e.QueriesOnly=`QueriesOnly`,e.WorkunitsOnly=`WorkunitsOnly`,e}({}),e.TpMachineType=function(e){return e.ALLNODES=`ALLNODES`,e.THORMACHINES=`THORMACHINES`,e.HOLEMACHINES=`HOLEMACHINES`,e.ROXIEMACHINES=`ROXIEMACHINES`,e.MACHINES=`MACHINES`,e.AVAILABLEMACHINES=`AVAILABLEMACHINES`,e.DROPZONE=`DROPZONE`,e.STANDBYNNODE=`STANDBYNNODE`,e.THORSPARENODES=`THORSPARENODES`,e.HOLESTANDBYNODES=`HOLESTANDBYNODES`,e}({})})(Oe||={});var TopologyServiceBase=class extends Service{constructor(e){super(e,`WsTopology`,`1.33`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`WsTopologyPingResponse`)}SystemLog(e,t){return this._connection.send(`SystemLog`,e,`json`,!1,t,`SystemLogResponse`)}TpClusterInfo(e,t){return this._connection.send(`TpClusterInfo`,e,`json`,!1,t,`TpClusterInfoResponse`)}TpClusterQuery(e,t){return this._connection.send(`TpClusterQuery`,e,`json`,!1,t,`TpClusterQueryResponse`)}TpComponentConfiguration(e,t){return this._connection.send(`TpComponentConfiguration`,e,`json`,!1,t,`TpComponentConfigurationResponse`)}TpConfiguredComponents(e,t){return this._connection.send(`TpConfiguredComponents`,e,`json`,!1,t,`TpConfiguredComponentsResponse`)}TpDropZoneQuery(e,t){return this._connection.send(`TpDropZoneQuery`,e,`json`,!1,t,`TpDropZoneQueryResponse`)}TpGetComponentFile(e,t){return this._connection.send(`TpGetComponentFile`,e,`json`,!1,t,`TpGetComponentFileResponse`)}TpGetServicePlugins(e,t){return this._connection.send(`TpGetServicePlugins`,e,`json`,!1,t,`TpGetServicePluginsResponse`)}TpGroupQuery(e,t){return this._connection.send(`TpGroupQuery`,e,`json`,!1,t,`TpGroupQueryResponse`)}TpListLogFiles(e,t){return this._connection.send(`TpListLogFiles`,e,`json`,!1,t,`TpListLogFilesResponse`)}TpListTargetClusters(e,t){return this._connection.send(`TpListTargetClusters`,e,`json`,!1,t,`TpListTargetClustersResponse`)}TpLogFile(e,t){return this._connection.send(`TpLogFile`,e,`json`,!1,t,`TpLogFileResponse`)}TpLogFileDisplay(e,t){return this._connection.send(`TpLogFileDisplay`,e,`json`,!1,t,`TpLogFileResponse`)}TpLogicalClusterQuery(e,t){return this._connection.send(`TpLogicalClusterQuery`,e,`json`,!1,t,`TpLogicalClusterQueryResponse`)}TpMachineInfo(e,t){return this._connection.send(`TpMachineInfo`,e,`json`,!1,t,`TpMachineInfoResponse`)}TpMachineQuery(e,t){return this._connection.send(`TpMachineQuery`,e,`json`,!1,t,`TpMachineQueryResponse`)}TpServiceQuery(e,t){return this._connection.send(`TpServiceQuery`,e,`json`,!1,t,`TpServiceQueryResponse`)}TpSetMachineStatus(e,t){return this._connection.send(`TpSetMachineStatus`,e,`json`,!1,t,`TpSetMachineStatusResponse`)}TpSwapNode(e,t){return this._connection.send(`TpSwapNode`,e,`json`,!1,t,`TpSwapNodeResponse`)}TpTargetClusterQuery(e,t){return this._connection.send(`TpTargetClusterQuery`,e,`json`,!1,t,`TpTargetClusterQueryResponse`)}TpThorStatus(e,t){return this._connection.send(`TpThorStatus`,e,`json`,!1,t,`TpThorStatusResponse`)}TpXMLFile(e,t){return this._connection.send(`TpXMLFile`,e,`json`,!1,t,`TpXMLFileResponse`)}},TopologyService=class extends TopologyServiceBase{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(e=>{if(e.default)return e.default;let t,n;return e.TpLogicalClusters.TpLogicalCluster.some((e,r)=>(r===0&&(n=e),e.Type===`hthor`?(t=e,!0):!1)),t||n})}},R;(function(e){e.ECLWUActions=function(e){return e.Abort=`Abort`,e.Delete=`Delete`,e.Deschedule=`Deschedule`,e.Reschedule=`Reschedule`,e.Pause=`Pause`,e.PauseNow=`PauseNow`,e.Protect=`Protect`,e.Unprotect=`Unprotect`,e.Restore=`Restore`,e.Resume=`Resume`,e.SetToFailed=`SetToFailed`,e.Archive=`Archive`,e}({}),e.LogSelectColumnMode=function(e){return e[e.MIN=0]=`MIN`,e[e.DEFAULT=1]=`DEFAULT`,e[e.ALL=2]=`ALL`,e[e.CUSTOM=3]=`CUSTOM`,e}({}),e.SortDirection=function(e){return e[e.ASC=0]=`ASC`,e[e.DSC=1]=`DSC`,e}({}),e.LogEventClass=function(e){return e.ALL=`ALL`,e.DIS=`DIS`,e.ERR=`ERR`,e.WRN=`WRN`,e.INF=`INF`,e.PRO=`PRO`,e.MET=`MET`,e.EVT=`EVT`,e}({}),e.WUDetailsAttrValueType=function(e){return e.Single=`Single`,e.List=`List`,e.Multi=`Multi`,e}({}),e.EclDefinitionActions=function(e){return e.SyntaxCheck=`SyntaxCheck`,e.Deploy=`Deploy`,e.Publish=`Publish`,e}({}),e.ErrorMessageFormat=function(e){return e.xml=`xml`,e.json=`json`,e.text=`text`,e}({}),e.LogAccessLogFormat=function(e){return e[e.XML=0]=`XML`,e[e.JSON=1]=`JSON`,e[e.CSV=2]=`CSV`,e}({}),e.WUExceptionSeverity=function(e){return e.info=`info`,e.warning=`warning`,e.error=`error`,e.alert=`alert`,e}({}),e.WUFileDownloadOption=function(e){return e[e.OriginalText=0]=`OriginalText`,e[e.Attachment=1]=`Attachment`,e[e.ZIP=2]=`ZIP`,e[e.GZIP=3]=`GZIP`,e}({}),e.WUFileType=function(e){return e.XML=`XML`,e.cpp=`cpp`,e.dll=`dll`,e.res=`res`,e.log=`log`,e.WUECL=`WUECL`,e.ThorLog=`ThorLog`,e.ThorSlaveLog=`ThorSlaveLog`,e.EclAgentLog=`EclAgentLog`,e.ArchiveQuery=`ArchiveQuery`,e.ComponentLog=`ComponentLog`,e.PostMortem=`PostMortem`,e}({}),e.WUQueryFilterSuspendedType=function(e){return e.Allqueries=`All queries`,e.Notsuspended=`Not suspended`,e.Suspended=`Suspended`,e.Suspendedbyuser=`Suspended by user`,e.Suspendedbyfirstnode=`Suspended by first node`,e.Suspendedbyanynode=`Suspended by any node`,e}({}),e.WUQuerySetFilterType=function(e){return e.All=`All`,e.Id=`Id`,e.Name=`Name`,e.Alias=`Alias`,e.Status=`Status`,e}({}),e.WUProtectFilter=function(e){return e.All=`All`,e.Protected=`Protected`,e.NotProtected=`NotProtected`,e}({}),e.QuerySetAliasActionTypes=function(e){return e.Deactivate=`Deactivate`,e}({}),e.QuerysetImportActivation=function(e){return e.None=`None`,e.ActivateImportedActive=`ActivateImportedActive`,e}({}),e.QuerySetQueryActionTypes=function(e){return e.Suspend=`Suspend`,e.Unsuspend=`Unsuspend`,e.ToggleSuspend=`ToggleSuspend`,e.Activate=`Activate`,e.Delete=`Delete`,e.DeleteQueriesAndWUs=`DeleteQueriesAndWUs`,e.RemoveAllAliases=`RemoveAllAliases`,e.ResetQueryStats=`ResetQueryStats`,e}({}),e.WUQueryActivationMode=function(e){return e[e.DoNotActivateQuery=0]=`DoNotActivateQuery`,e[e.ActivateQuery=1]=`ActivateQuery`,e[e.ActivateQuerySuspendPrevious=2]=`ActivateQuerySuspendPrevious`,e[e.ActivateQueryDeletePrevious=3]=`ActivateQueryDeletePrevious`,e}({})})(R||={});var WorkunitsServiceBase=class extends Service{constructor(e){super(e,`WsWorkunits`,`2.10`)}GVCAjaxGraph(e,t){return this._connection.send(`GVCAjaxGraph`,e,`json`,!1,t,`GVCAjaxGraphResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`WsWorkunitsPingResponse`)}WUAbort(e,t){return this._connection.send(`WUAbort`,e,`json`,!1,t,`WUAbortResponse`)}WUAction(e,t){return this._connection.send(`WUAction`,e,`json`,!1,t,`WUActionResponse`)}WUAddLocalFileToWorkunit(e,t){return this._connection.send(`WUAddLocalFileToWorkunit`,e,`json`,!1,t,`WUAddLocalFileToWorkunitResponse`)}WUAnalyseHotspot(e,t){return this._connection.send(`WUAnalyseHotspot`,e,`json`,!1,t,`WUAnalyseHotspotResponse`)}WUCDebug(e,t){return this._connection.send(`WUCDebug`,e,`json`,!1,t,`WUDebugResponse`)}WUCheckFeatures(e,t){return this._connection.send(`WUCheckFeatures`,e,`json`,!1,t,`WUCheckFeaturesResponse`)}WUClusterJobQueueLOG(e,t){return this._connection.send(`WUClusterJobQueueLOG`,e,`json`,!1,t,`WUClusterJobQueueLOGResponse`)}WUClusterJobQueueXLS(e,t){return this._connection.send(`WUClusterJobQueueXLS`,e,`json`,!1,t,`WUClusterJobQueueXLSResponse`)}WUClusterJobSummaryXLS(e,t){return this._connection.send(`WUClusterJobSummaryXLS`,e,`json`,!1,t,`WUClusterJobSummaryXLSResponse`)}WUClusterJobXLS(e,t){return this._connection.send(`WUClusterJobXLS`,e,`json`,!1,t,`WUClusterJobXLSResponse`)}WUCompileECL(e,t){return this._connection.send(`WUCompileECL`,e,`json`,!1,t,`WUCompileECLResponse`)}WUCopyLogicalFiles(e,t){return this._connection.send(`WUCopyLogicalFiles`,e,`json`,!1,t,`WUCopyLogicalFilesResponse`)}WUCopyQuerySet(e,t){return this._connection.send(`WUCopyQuerySet`,e,`json`,!1,t,`WUCopyQuerySetResponse`)}WUCreate(e,t){return this._connection.send(`WUCreate`,e,`json`,!1,t,`WUCreateResponse`)}WUCreateAndUpdate(e,t){return this._connection.send(`WUCreateAndUpdate`,e,`json`,!1,t,`WUUpdateResponse`)}WUCreateZAPInfo(e,t){return this._connection.send(`WUCreateZAPInfo`,e,`json`,!1,t,`WUCreateZAPInfoResponse`)}WUDelete(e,t){return this._connection.send(`WUDelete`,e,`json`,!1,t,`WUDeleteResponse`)}WUDeployWorkunit(e,t){return this._connection.send(`WUDeployWorkunit`,e,`json`,!1,t,`WUDeployWorkunitResponse`)}WUDetails(e,t){return this._connection.send(`WUDetails`,e,`json`,!1,t,`WUDetailsResponse`)}WUDetailsMeta(e,t){return this._connection.send(`WUDetailsMeta`,e,`json`,!1,t,`WUDetailsMetaResponse`)}WUEclDefinitionAction(e,t){return this._connection.send(`WUEclDefinitionAction`,e,`json`,!1,t,`WUEclDefinitionActionResponse`)}WUExport(e,t){return this._connection.send(`WUExport`,e,`json`,!1,t,`WUExportResponse`)}WUFile(e,t){return this._connection.send(`WUFile`,e,`json`,!1,t,`WULogFileResponse`)}WUFullResult(e,t){return this._connection.send(`WUFullResult`,e,`json`,!1,t,`WUFullResultResponse`)}WUGVCGraphInfo(e,t){return this._connection.send(`WUGVCGraphInfo`,e,`json`,!1,t,`WUGVCGraphInfoResponse`)}WUGetArchiveFile(e,t){return this._connection.send(`WUGetArchiveFile`,e,`json`,!1,t,`WUGetArchiveFileResponse`)}WUGetDependancyTrees(e,t){return this._connection.send(`WUGetDependancyTrees`,e,`json`,!1,t,`WUGetDependancyTreesResponse`)}WUGetGraph(e,t){return this._connection.send(`WUGetGraph`,e,`json`,!1,t,`WUGetGraphResponse`)}WUGetGraphNameAndTypes(e,t){return this._connection.send(`WUGetGraphNameAndTypes`,e,`json`,!1,t,`WUGetGraphNameAndTypesResponse`)}WUGetNumFileToCopy(e,t){return this._connection.send(`WUGetNumFileToCopy`,e,`json`,!1,t,`WUGetNumFileToCopyResponse`)}WUGetPlugins(e,t){return this._connection.send(`WUGetPlugins`,e,`json`,!1,t,`WUGetPluginsResponse`)}WUGetStats(e,t){return this._connection.send(`WUGetStats`,e,`json`,!1,t,`WUGetStatsResponse`)}WUGetThorJobList(e,t){return this._connection.send(`WUGetThorJobList`,e,`json`,!1,t,`WUGetThorJobListResponse`)}WUGetThorJobQueue(e,t){return this._connection.send(`WUGetThorJobQueue`,e,`json`,!1,t,`WUGetThorJobQueueResponse`)}WUGetZAPInfo(e,t){return this._connection.send(`WUGetZAPInfo`,e,`json`,!1,t,`WUGetZAPInfoResponse`)}WUGraphInfo(e,t){return this._connection.send(`WUGraphInfo`,e,`json`,!1,t,`WUGraphInfoResponse`)}WUGraphTiming(e,t){return this._connection.send(`WUGraphTiming`,e,`json`,!1,t,`WUGraphTimingResponse`)}WUHelperFileArchive(e,t){return this._connection.send(`WUHelperFileArchive`,e,`json`,!1,t,`WUHelperFileArchiveResponse`)}WUInfo(e,t){return this._connection.send(`WUInfo`,e,`json`,!1,t,`WUInfoResponse`)}WUInfoDetails(e,t){return this._connection.send(`WUInfoDetails`,e,`json`,!1,t,`WUInfoResponse`)}WUJobList(e,t){return this._connection.send(`WUJobList`,e,`json`,!1,t,`WUJobListResponse`)}WULightWeightQuery(e,t){return this._connection.send(`WULightWeightQuery`,e,`json`,!1,t,`WULightWeightQueryResponse`)}WUListArchiveFiles(e,t){return this._connection.send(`WUListArchiveFiles`,e,`json`,!1,t,`WUListArchiveFilesResponse`)}WUListLocalFileRequired(e,t){return this._connection.send(`WUListLocalFileRequired`,e,`json`,!1,t,`WUListLocalFileRequiredResponse`)}WUListQueries(e,t){return this._connection.send(`WUListQueries`,e,`json`,!1,t,`WUListQueriesResponse`)}WUListQueriesUsingFile(e,t){return this._connection.send(`WUListQueriesUsingFile`,e,`json`,!1,t,`WUListQueriesUsingFileResponse`)}WUMultiQuerysetDetails(e,t){return this._connection.send(`WUMultiQuerysetDetails`,e,`json`,!1,t,`WUMultiQuerySetDetailsResponse`)}WUProcessGraph(e,t){return this._connection.send(`WUProcessGraph`,e,`json`,!1,t,`WUProcessGraphResponse`)}WUProtect(e,t){return this._connection.send(`WUProtect`,e,`json`,!1,t,`WUProtectResponse`)}WUPublishWorkunit(e,t){return this._connection.send(`WUPublishWorkunit`,e,`json`,!1,t,`WUPublishWorkunitResponse`)}WUPushEvent(e,t){return this._connection.send(`WUPushEvent`,e,`json`,!1,t,`WUPushEventResponse`)}WUQuery(e,t){return this._connection.send(`WUQuery`,e,`json`,!1,t,`WUQueryResponse`)}WUQueryConfig(e,t){return this._connection.send(`WUQueryConfig`,e,`json`,!1,t,`WUQueryConfigResponse`)}WUQueryDetails(e,t){return this._connection.send(`WUQueryDetails`,e,`json`,!1,t,`WUQueryDetailsResponse`)}WUQueryDetailsLightWeight(e,t){return this._connection.send(`WUQueryDetailsLightWeight`,e,`json`,!1,t,`WUQueryDetailsResponse`)}WUQueryFiles(e,t){return this._connection.send(`WUQueryFiles`,e,`json`,!1,t,`WUQueryFilesResponse`)}WUQueryGetGraph(e,t){return this._connection.send(`WUQueryGetGraph`,e,`json`,!1,t,`WUQueryGetGraphResponse`)}WUQueryGetSummaryStats(e,t){return this._connection.send(`WUQueryGetSummaryStats`,e,`json`,!1,t,`WUQueryGetSummaryStatsResponse`)}WUQuerysetAliasAction(e,t){return this._connection.send(`WUQuerysetAliasAction`,e,`json`,!1,t,`WUQuerySetAliasActionResponse`)}WUQuerysetCopyQuery(e,t){return this._connection.send(`WUQuerysetCopyQuery`,e,`json`,!1,t,`WUQuerySetCopyQueryResponse`)}WUQuerysetDetails(e,t){return this._connection.send(`WUQuerysetDetails`,e,`json`,!1,t,`WUQuerySetDetailsResponse`)}WUQuerysetExport(e,t){return this._connection.send(`WUQuerysetExport`,e,`json`,!1,t,`WUQuerysetExportResponse`)}WUQuerysetImport(e,t){return this._connection.send(`WUQuerysetImport`,e,`json`,!1,t,`WUQuerysetImportResponse`)}WUQuerysetQueryAction(e,t){return this._connection.send(`WUQuerysetQueryAction`,e,`json`,!1,t,`WUQuerySetQueryActionResponse`)}WUQuerysets(e,t){return this._connection.send(`WUQuerysets`,e,`json`,!1,t,`WUQuerysetsResponse`)}WURecreateQuery(e,t){return this._connection.send(`WURecreateQuery`,e,`json`,!1,t,`WURecreateQueryResponse`)}WUResubmit(e,t){return this._connection.send(`WUResubmit`,e,`json`,!1,t,`WUResubmitResponse`)}WUResult(e,t){return this._connection.send(`WUResult`,e,`json`,!1,t,`WUResultResponse`)}WUResultBin(e,t){return this._connection.send(`WUResultBin`,e,`json`,!1,t,`WUResultBinResponse`)}WUResultSummary(e,t){return this._connection.send(`WUResultSummary`,e,`json`,!1,t,`WUResultSummaryResponse`)}WUResultView(e,t){return this._connection.send(`WUResultView`,e,`json`,!1,t,`WUResultViewResponse`)}WURun(e,t){return this._connection.send(`WURun`,e,`json`,!1,t,`WURunResponse`)}WUSchedule(e,t){return this._connection.send(`WUSchedule`,e,`json`,!1,t,`WUScheduleResponse`)}WUShowScheduled(e,t){return this._connection.send(`WUShowScheduled`,e,`json`,!1,t,`WUShowScheduledResponse`)}WUSubmit(e,t){return this._connection.send(`WUSubmit`,e,`json`,!1,t,`WUSubmitResponse`)}WUSyntaxCheckECL(e,t){return this._connection.send(`WUSyntaxCheckECL`,e,`json`,!1,t,`WUSyntaxCheckResponse`)}WUUpdate(e,t){return this._connection.send(`WUUpdate`,e,`json`,!1,t,`WUUpdateResponse`)}WUUpdateQueryEntry(e,t){return this._connection.send(`WUUpdateQueryEntry`,e,`json`,!1,t,`WUUpdateQueryEntryResponse`)}WUWaitCompiled(e,t){return this._connection.send(`WUWaitCompiled`,e,`json`,!1,t,`WUWaitResponse`)}WUWaitComplete(e,t){return this._connection.send(`WUWaitComplete`,e,`json`,!1,t,`WUWaitResponse`)}},z=function(e){return e[e.Unknown=0]=`Unknown`,e[e.Compiled=1]=`Compiled`,e[e.Running=2]=`Running`,e[e.Completed=3]=`Completed`,e[e.Failed=4]=`Failed`,e[e.Archived=5]=`Archived`,e[e.Aborting=6]=`Aborting`,e[e.Aborted=7]=`Aborted`,e[e.Blocked=8]=`Blocked`,e[e.Submitted=9]=`Submitted`,e[e.Scheduled=10]=`Scheduled`,e[e.Compiling=11]=`Compiling`,e[e.Wait=12]=`Wait`,e[e.UploadingFiled=13]=`UploadingFiled`,e[e.DebugPaused=14]=`DebugPaused`,e[e.DebugRunning=15]=`DebugRunning`,e[e.Paused=16]=`Paused`,e[e.LAST=17]=`LAST`,e[e.NotFound=999]=`NotFound`,e}({}),B;(function(e){e.Action=function(e){return e[e.Unknown=0]=`Unknown`,e[e.Compile=1]=`Compile`,e[e.Check=2]=`Check`,e[e.Run=3]=`Run`,e[e.ExecuteExisting=4]=`ExecuteExisting`,e[e.Pause=5]=`Pause`,e[e.PauseNow=6]=`PauseNow`,e[e.Resume=7]=`Resume`,e[e.Debug=8]=`Debug`,e[e.__size=9]=`__size`,e}({})})(B||={});function isECLResult(e){return typeof e.Name==`string`}function isWUQueryECLWorkunit(e){return e.TotalClusterTime!==void 0}function isWUInfoWorkunit(e){return e.StateEx!==void 0}var WorkunitsService=class extends WorkunitsServiceBase{constructor(e){super(e)}Ping(){return this._connection.send(`Ping`,{},`json`,!1,void 0,`WsWorkunitsPingResponse`).then(()=>({result:!0}))}WUQuery(e={},n){return this._connection.send(`WUQuery`,e,`json`,!1,n).then(e=>(0,t.deepMixin)({Workunits:{ECLWorkunit:[]}},e))}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||=super.WUDetailsMeta(e),this._WUDetailsMetaPromise}WUCDebugEx(e){return this._connection.send(`WUCDebug`,e,void 0,void 0,void 0,`WUDebug`).then(e=>{let n=(0,t.xml2json)(e.Result).children();return n.length?n[0]:null})}},WorkunitsServiceEx=class extends WorkunitsServiceBase{WUPublishWorkunitEx(e){return this._connection.send(`WUPublishWorkunit`,e)}};function formatDecimal_default(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}__name(formatDecimal_default,`default`);function formatDecimalParts(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function exponent_default(e){return e=formatDecimalParts(Math.abs(e)),e?e[1]:NaN}__name(exponent_default,`default`);function formatGroup_default(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}__name(formatGroup_default,`default`);function formatNumerals_default(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}__name(formatNumerals_default,`default`);var ke=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(e){if(!(t=ke.exec(e)))throw Error(`invalid format: `+e);var t;return new FormatSpecifier({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}formatSpecifier.prototype=FormatSpecifier.prototype;function FormatSpecifier(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}FormatSpecifier.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 formatTrim_default(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}__name(formatTrim_default,`default`);var Ae;function formatPrefixAuto_default(e,t){var n=formatDecimalParts(e,t);if(!n)return e+``;var r=n[0],i=n[1],a=i-(Ae=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+formatDecimalParts(e,Math.max(0,t+a-1))[0]}__name(formatPrefixAuto_default,`default`);function formatRounded_default(e,t){var n=formatDecimalParts(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}__name(formatRounded_default,`default`);var je={"%":function(e,t){return(e*100).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+``},d:formatDecimal_default,e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return formatRounded_default(e*100,t)},r:formatRounded_default,s:formatPrefixAuto_default,X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function identity_default(e){return e}__name(identity_default,`default`);var Me=Array.prototype.map,Ne=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function locale_default(e){var t=e.grouping===void 0||e.thousands===void 0?identity_default:formatGroup_default(Me.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?identity_default:formatNumerals_default(Me.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`-`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function newFormat(e){e=formatSpecifier(e);var l=e.fill,u=e.align,d=e.sign,f=e.symbol,p=e.zero,m=e.width,h=e.comma,g=e.precision,_=e.trim,v=e.type;v===`n`?(h=!0,v=`g`):je[v]||(g===void 0&&(g=12),_=!0,v=`g`),(p||l===`0`&&u===`=`)&&(p=!0,l=`0`,u=`=`);var y=f===`$`?n:f===`#`&&/[boxX]/.test(v)?`0`+v.toLowerCase():``,b=f===`$`?r:/[%p]/.test(v)?o:``,x=je[v],S=/[defgprs%]/.test(v);g=g===void 0?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g));function format(e){var n=y,r=b,o,f,C;if(v===`c`)r=x(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:x(Math.abs(e),g),_&&(e=formatTrim_default(e)),w&&+e==0&&d!==`+`&&(w=!1),n=(w?d===`(`?d:s:d===`-`||d===`(`?``:d)+n,r=(v===`s`?Ne[8+Ae/3]:``)+r+(w&&d===`(`?`)`:``),S){for(o=-1,f=e.length;++o<f;)if(C=e.charCodeAt(o),48>C||C>57){r=(C===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}h&&!p&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<m?Array(m-T+1).join(l):``;switch(h&&p&&(e=t(E+e,E.length?m-r.length:1/0),E=``),u){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r;break}return a(e)}return format.toString=function(){return e+``},format}function formatPrefix(e,t){var n=newFormat((e=formatSpecifier(e),e.type=`f`,e)),r=Math.max(-8,Math.min(8,Math.floor(exponent_default(t)/3)))*3,i=10**-r,a=Ne[8+r/3];return function(e){return n(i*e)+a}}return{format:newFormat,formatPrefix}}__name(locale_default,`default`);var V,H;defaultLocale({decimal:`.`,thousands:`,`,grouping:[3],currency:[`$`,``],minus:`-`});function defaultLocale(e){return V=locale_default(e),H=V.format,V.formatPrefix,V}var ECLGraph=class extends t.StateObject{wu;get properties(){return this.get()}get Name(){return this.get(`Name`)}get Label(){return this.get(`Label`)}get Type(){return this.get(`Type`)}get Complete(){return this.get(`Complete`)}get WhenStarted(){return this.get(`WhenStarted`)}get WhenFinished(){return this.get(`WhenFinished`)}get Time(){return this.get(`Time`)}get Running(){return this.get(`Running`)}get RunningId(){return this.get(`RunningId`)}get Failed(){return this.get(`Failed`)}constructor(e,t,n){super(),this.wu=e;let r=0;for(let e of n)if(e.GraphName===t.Name&&!e.HasSubGraphId){r=Math.round(e.Seconds*1e3)/1e3;break}this.set({Time:r,...t})}fetchScopeGraph(e){return e?this.wu.fetchGraphDetails([e],[`subgraph`]).then(e=>createGraph(e)):this.wu.fetchGraphDetails([this.Name],[`graph`]).then(e=>createGraph(e))}},GraphCache=class extends t.Cache{constructor(){super(e=>t.Cache.hash([e.Name]))}};function walkXmlJson(e,t,n){n||=[],n.push(e),t(e.name,e.$,e.children(),n),e.children().forEach(e=>{walkXmlJson(e,t,n)}),n.pop()}function flattenAtt(e){let t={};return e.forEach(e=>{e.name===`att`&&(t[e.$.name]=e.$.value)}),t}var XGMMLGraph=class extends t.Graph{},XGMMLSubgraph=class extends t.Subgraph{},XGMMLVertex=class extends t.Vertex{},XGMMLEdge=class extends t.Edge{};function createXGMMLGraph(e,t){let n={},r={},i={},a=new XGMMLGraph(e=>e._.id),o=[a.root];return walkXmlJson(t,(e,t,a,s)=>{let c=o[o.length-1];switch(e){case`graph`:break;case`node`:if(a.length&&a[0].children().length&&a[0].children()[0].name===`graph`){let e=c.createSubgraph(flattenAtt(a));o.push(e),n[t.id]=e}let e=c.createVertex(flattenAtt(a));r[t.id]=e;break;case`edge`:let s=c.createEdge(r[t.source],r[t.target],flattenAtt(a));i[t.id]=s;break;default:}}),a}var ScopeGraph=class extends t.Graph{},ScopeSubgraph=class extends t.Subgraph{},ScopeVertex=class extends t.Vertex{},ScopeEdge=class extends t.Edge{};function createGraph(e){let t={},n={},r={},i;for(let a of e)switch(a.ScopeType){case`graph`:i=new ScopeGraph(e=>e._.Id,a),t[a.ScopeName]=i.root;break;case`subgraph`:i||(i=new ScopeGraph(e=>e._.Id,a),t[a.ScopeName]=i.root);let e=a.parentScope().split(`:`),o=t[a.parentScope()];for(;e.length&&!o;)o=t[e.join(`:`)],e.pop();if(!o)console.warn(`Missing SG:Parent (${a.Id}): ${a.parentScope()}`);else{let e=o;t[a.ScopeName]=e.createSubgraph(a)}break;case`activity`:let s=t[a.parentScope()];s?r[a.ScopeName]=s.createVertex(a):console.warn(`Missing A:Parent (${a.Id}): ${a.parentScope()}`);break;case`edge`:n[a.ScopeName]=a;break;case`function`:let c=r[a.parentScope()];c?c._.children().push(a):console.warn(`Missing F:Parent (${a.Id}): ${a.parentScope()}`);break}for(let e in n){let r=n[e],a=t[r.parentScope()];if(!a)console.warn(`Missing E:Parent (${r.Id}): ${r.parentScope()}`);else{let t=a;try{let e=i.vertex(r.attr(`IdSource`).RawValue),n=i.vertex(r.attr(`IdTarget`).RawValue);t.createEdge(e,n,r)}catch{console.warn(`Invalid Edge: ${e}`)}}}return i}var Resource=class extends t.StateObject{wu;get properties(){return this.get()}get URL(){return this.get(`URL`)}get DisplayName(){return this.get(`DisplayName`)}get DisplayPath(){return this.get(`DisplayPath`)}constructor(e,t){super(),this.wu=e;let n=t.split(`\\`).join(`/`),r=n.split(`/`),i=`res/`+this.wu.Wuid+`/`,a=``,o=``;n.indexOf(i)===0&&(a=n.substr(i.length),o=r[r.length-1]),this.set({URL:t,DisplayName:o,DisplayPath:a})}},XSDNode=class{e;constructor(e){this.e=e}fix(){delete this.e}},XSDXMLNode=class extends XSDNode{name;type;isSet=!1;attrs={};_children=[];constructor(e){super(e)}append(e){this._children.push(e),this.type||=`hpcc:childDataset`}fix(){this.name=this.e.$.name,this.type=this.e.$.type;for(let e=this._children.length-1;e>=0;--e){let t=this._children[e];t.name===`Row`&&t.type===void 0&&(this._children.push(...t._children),this._children.splice(e,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=this.type.lastIndexOf(`_`),n=t>0?t:this.type.length,r=n-1;for(;r>=0&&`0123456789`.indexOf(this.type.charAt(r))!==-1;--r);r+1<n&&(e=parseInt(this.type.substring(r+1,n),10)),this.type.indexOf(`data`)===0&&(e*=2);break}return e<this.name.length&&(e=this.name.length),e}},XSDSimpleType=class extends XSDNode{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()}},XSDSchema=class{root;simpleTypes={};fields(){return this.root.children()}},XSDParser=class extends t.SAXStackParser{schema=new XSDSchema;simpleType;simpleTypes={};xsdStack=new t.Stack;startXMLNode(e){switch(super.startXMLNode(e),e.name){case`xs:element`:let t=new XSDXMLNode(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 XSDSimpleType(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 t=this.xsdStack.top();for(let n in e.$)t.attrs[n]=e.$[n];break;default:this.simpleType&&this.simpleType.append(e)}super.endXMLNode(e)}};function parseXSD(e){let t=new XSDParser;return t.parse(e),t.schema}var XSDParser2=class extends XSDParser{_rootName;schema=new XSDSchema;simpleTypes={};xsdStack=new t.Stack;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case`xsd:element`:let t=new XSDXMLNode(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 XSDSimpleType(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 parseXSD2(e,t){let n=new XSDParser2(t);return n.parse(e),n.schema}var GlobalResultCache=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}},U=new GlobalResultCache,Pe=class Result extends t.StateObject{connection;_bypassCache=!1;get BaseUrl(){return this.connection.baseUrl}xsdSchema;get properties(){return this.get()}get Wuid(){return this.get(`Wuid`)}get ResultName(){return this.get(`ResultName`)}get ResultSequence(){return this.get(`ResultSequence`)}get LogicalFileName(){return this.get(`LogicalFileName`)}get Name(){return this.get(`Name`)}get Sequence(){return this.get(`Sequence`)}get Value(){return this.get(`Value`)}get Link(){return this.get(`Link`)}get FileName(){return this.get(`FileName`)}get IsSupplied(){return this.get(`IsSupplied`)}get ShowFileContent(){return this.get(`ShowFileContent`)}get Total(){return this.get(`Total`)}get ECLSchemas(){return this.get(`ECLSchemas`)}get NodeGroup(){return this.get(`NodeGroup`)}get ResultViews(){return this.get(`ResultViews`)}get XmlSchema(){return this.get(`XmlSchema`)}static attach(e,t,n,r){let i;return Array.isArray(r)?(i=U.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n.Name},()=>new Result(e,t,n,r)),i.set(n)):r===void 0&&(typeof n==`number`?i=U.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:`Sequence_`+n},()=>new Result(e,t,n)):typeof n==`string`&&(i=U.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n},()=>new Result(e,t,n)))),i}static attachLogicalFile(e,t,n){return U.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n},()=>new Result(e,t,n,!0))}constructor(e,t,n,r){super(),e instanceof WorkunitsService?this.connection=e:this.connection=new WorkunitsService(e),typeof r==`boolean`&&r===!0?this.set({NodeGroup:t,LogicalFileName:n}):isECLResult(n)&&Array.isArray(r)?this.set({...n,Wuid:t,ResultName:n.Name,ResultViews:r}):r===void 0?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}bypassCache(e){return e===void 0?this._bypassCache:(this._bypassCache=e,this)}_fetchXMLSchemaPromise;fetchXMLSchema(e=!1){return(!this._fetchXMLSchemaPromise||e)&&(this._fetchXMLSchemaPromise=this.WUResult().then(e=>e.Result?.XmlSchema?.xml?(this.xsdSchema=parseXSD(e.Result.XmlSchema.xml),this.xsdSchema):null)),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(e=0,n=-1,r=!1,i={},a,o){let s=o??this._bypassCache;return this.WUResult(e,n,!r,i,a,s).then(e=>{let n=e.Result;return delete e.Result,this.set({...e}),(0,t.exists)(`XmlSchema.xml`,n)&&(this.xsdSchema=parseXSD(n.XmlSchema.xml)),(0,t.exists)(`Row`,n)?n.Row:this.ResultName&&(0,t.exists)(this.ResultName,n)?n[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,a=!1){let o={NamedValue:{itemcount:0}};for(let e in r)o.NamedValue[o.NamedValue.itemcount++]={Name:e,Value:r[e]};let s={FilterBy:o};return this.Wuid&&this.ResultName!==void 0?(s.Wuid=this.Wuid,s.ResultName=this.ResultName):this.Wuid&&this.ResultSequence!==void 0?(s.Wuid=this.Wuid,s.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(s.LogicalName=this.LogicalFileName,s.Cluster=this.NodeGroup):this.LogicalFileName&&(s.LogicalName=this.LogicalFileName),s.Start=e,s.Count=t,s.SuppressXmlSchema=n,s.BypassCachedResult=a,this.connection.WUResult(s,i).then(e=>e)}},ResultCache=class extends t.Cache{constructor(){super(e=>t.Cache.hash([e.Sequence,e.Name,e.Value,e.FileName]))}},Attribute=class extends t.StateObject{scope;get properties(){return this.get()}get Name(){return this.get(`Name`)}get RawValue(){return this.get(`RawValue`)}get Formatted(){return this.get(`Formatted`)}get FormattedEnd(){return this.get(`FormattedEnd`)}get Measure(){return this.get(`Measure`)}get Creator(){return this.get(`Creator`)}get CreatorType(){return this.get(`CreatorType`)}constructor(e,t){super(),this.scope=e,this.set(t)}},BaseScope=class extends t.StateObject{_attributeMap={};_children=[];get properties(){return this.get()}get ScopeName(){return this.get(`ScopeName`)}get Id(){return this.get(`Id`)}get ScopeType(){return this.get(`ScopeType`)}get Properties(){return this.get(`Properties`,{Property:[]})}get Notes(){return this.get(`Notes`,{Note:[]})}get SinkActivity(){return this.get(`SinkActivity`)}get CAttributes(){let e=[],t={start:null,end:null};return this.Properties.Property.forEach(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 Attribute(this,n))}),t.start&&t.end?(t.start.FormattedEnd=t.end.Formatted,e.push(new Attribute(this,t.start))):t.start?e.push(new Attribute(this,t.start)):t.end&&e.push(new Attribute(this,t.end)),e}constructor(e){super(),this.update(e)}update(e){this.set(e),this.CAttributes.forEach(e=>{this._attributeMap[e.Name]=e}),this.Properties.Property=[];for(let e in this._attributeMap)this._attributeMap.hasOwnProperty(e)&&this.Properties.Property.push(this._attributeMap[e].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 Attribute(this,{Creator:``,CreatorType:``,Formatted:``,Measure:``,Name:``,RawValue:``})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let t=this.Id,n=[];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 e in r)e===`Label`?t=r[e]:n.push(`<tr><td class="key">${e}</td><td class="value">${r[e]}</td></tr>`);return`<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@hpcc-js/util")):typeof define==`function`&&define.amd?define([`exports`,`@hpcc-js/util`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`@hpcc-js/comms`]={},e[`@hpcc-js/util`]))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var n=Object.defineProperty,__name=(e,t)=>n(e,`name`,{value:t,configurable:!0}),r=`@hpcc-js/comms`,i=`3.17.7`,a=`3.31.1`,o=(0,t.scopedLogger)(`comms/connection.ts`);function instanceOfIOptions(e){return`baseUrl`in e}var s={type:`post`,baseUrl:``,userID:``,password:``,rejectUnauthorized:!0,timeoutSecs:60};function instanceOfIConnection(e){return typeof e.opts==`function`&&typeof e.send==`function`&&typeof e.clone==`function`}function encode(e,t){return t===void 0||t===!0?encodeURIComponent(e):``+e}function serializeRequest(e,t=!0,n=``){if(n&&(n+=`.`),typeof e!=`object`)return encode(e,t);let r=[];for(let i in e)if(e.hasOwnProperty(i))if(e[i]instanceof Array){let a=!1;e[i].forEach((e,o)=>{typeof e==`object`?(a=!0,r.push(serializeRequest(e,t,n+encode(`${i}.${o}`,t)))):r.push(n+encode(`${i}_i${o}`,t)+`=`+serializeRequest(e,t))}),a&&r.push(n+encode(`${i}.itemcount`,t)+`=`+e[i].length)}else typeof e[i]==`object`?e[i]&&e[i].Item instanceof Array?(r.push(serializeRequest(e[i].Item,t,n+encode(i,t))),r.push(n+encode(`${i}.itemcount`,t)+`=`+e[i].Item.length)):r.push(serializeRequest(e[i],t,n+encode(i,t))):e[i]===void 0?r.push(n+encode(i,t)):r.push(n+encode(i,t)+`=`+encode(e[i],t));return r.join(`&`)}function deserializeResponse(e){return JSON.parse(e)}function jsonp(e,n,r={},i=`json`,a){return a&&console.warn(`Header attributes ignored for JSONP connections`),new Promise((a,s)=>{let c=e.timeoutSecs*1e3,l=5e3,u=`jsonp_callback_`+Math.round(Math.random()*999999);window[u]=function(e){c=0,doCallback(),a(i===`json`&&typeof e==`string`?deserializeResponse(e):e)};let d=document.createElement(`script`),f=(0,t.join)(e.baseUrl,n);f+=f.indexOf(`?`)>=0?`&`:`?`,d.src=f+`jsonp=`+u+`&`+serializeRequest(r,e.encodeRequest),document.body.appendChild(d);let p=setInterval(function(){c<=0?clearInterval(p):(c-=l,c<=0?(clearInterval(p),o.error(`Request timeout: `+d.src),doCallback(),s(Error(`Request timeout: `+d.src))):o.debug(`Request pending (`+c/1e3+` sec): `+d.src))},l);function doCallback(){delete window[u],document.body.removeChild(d)}})}function authHeader(e){return e.userID?{Authorization:`Basic ${(0,t.utf8ToBase64)(`${e.userID}:${e.password}`)}`}:{}}var c={};function doFetch(e,n,r,i,a){i={...authHeader(e),...i},r={credentials:c[e.baseUrl]?`omit`:`include`,...r,headers:i},e.baseUrl.indexOf(`https:`)===0&&(e.rejectUnauthorized===!1&&t.root.__hpcc_rejectUnauthorizedAgent?r.dispatcher=t.root.__hpcc_rejectUnauthorizedAgent:t.root.__hpcc_trustwaveAgent&&(r.agent=t.root.__hpcc_trustwaveAgent));function handleResponse(e){if(e.ok)return a===`json`?e.json():e.text();throw Error(e.statusText)}let o=t.root.__hpcc_undiciFetch??fetch;return(0,t.promiseTimeout)(e.timeoutSecs*1e3,o((0,t.join)(e.baseUrl,n),r).then(handleResponse).catch(i=>(r.credentials=c[e.baseUrl]?`include`:`omit`,o((0,t.join)(e.baseUrl,n),r).then(handleResponse).then(t=>(c[e.baseUrl]=!c[e.baseUrl],t)))))}function post(e,t,n,r=`json`,i){n.upload_&&(delete n.upload_,t+=`?upload_`);let a;return n.abortSignal_&&(a=n.abortSignal_,delete n.abortSignal_),doFetch(e,t,{method:`post`,body:serializeRequest(n,e.encodeRequest),signal:a},{"Content-Type":`application/x-www-form-urlencoded`,...i},r)}function get(e,t,n,r=`json`,i){let a;return n.abortSignal_&&(a=n.abortSignal_,delete n.abortSignal_),doFetch(e,`${t}?${serializeRequest(n,e.encodeRequest)}`,{method:`get`,signal:a},{...i},r)}function send(e,t,n,r=`json`,i){let a;switch(e.type){case`jsonp`:a=jsonp(e,t,n,r,i);break;case`get`:a=get(e,t,n,r,i);break;default:a=post(e,t,n,r,i)}return a}var l=send;function hookSend(e){let t=l;return e&&(l=e),t}var u=class Connection{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return arguments.length===0?this._opts:(this._opts={...s,...e},this)}send(e,t,n=`json`,r){return this._opts.hookSend?this._opts.hookSend(this._opts,e,t,n,l,r):l(this._opts,e,t,n,r)}clone(){return new Connection(this.opts())}},createConnection=function(e){return new u(e)};function setTransportFactory(e){let t=createConnection;return createConnection=e,t}function isArray(e){return Object.prototype.toString.call(e)===`[object Array]`}var ESPExceptions=class extends Error{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,this.message=n.Exception.length?`${n.Exception[0].Code}: ${n.Exception[0].Message}`:``}};function isExceptions(e){return e instanceof ESPExceptions||e.isESPExceptions&&Array.isArray(e.Exception)}function isConnection(e){return e.send!==void 0}var d=class ESPConnection{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,t,n){this._connection=isConnection(e)?e:createConnection(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(isArray(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,n={},r=`json`,i=!1,a,o){let s={...n,ver_:this._version};i&&(s.upload_=!0),a&&(s.abortSignal_=a);let c,l=`json`;switch(r){case`text`:c=(0,t.join)(this._service,e),l=`text`;break;case`xsd`:c=(0,t.join)(this._service,e+`.xsd`),l=`text`;break;case`json2`:c=(0,t.join)(this._service,e+`/json`),r=`json`,e=e.split(`/`).pop();break;default:c=(0,t.join)(this._service,e+`.json`)}return this._connection.send(c,s,l).then(t=>{if(r===`json`){let n;if(t&&t.Exceptions)throw new ESPExceptions(e,s,t.Exceptions);if(t&&(n=t[o||e+`Response`]),!n)throw new ESPExceptions(e,s,{Source:`ESPConnection.send`,Exception:[{Code:0,Message:`Missing Response`}]});return n}return t})}clone(){return new ESPConnection(this._connection.clone(),this._service,this._version)}},Service=class{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,t,n){this._connection=new d(e,t,n)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}},f;(function(e){e.DFUWUActions=function(e){return e.Delete=`Delete`,e.Protect=`Protect`,e.Unprotect=`Unprotect`,e.Restore=`Restore`,e.SetToFailed=`SetToFailed`,e.Archive=`Archive`,e}({}),e.DFUCommand=function(e){return e.copy=`copy`,e.remove=`remove`,e.move=`move`,e.rename=`rename`,e.replicate=`replicate`,e.import=`import`,e.export=`export`,e.monitor=`monitor`,e.copymerge=`copymerge`,e.supercopy=`supercopy`,e.publish=`publish`,e}({})})(f||={});var FileSprayServiceBase=class extends Service{constructor(e){super(e,`FileSpray`,`1.29`)}AbortDFUWorkunit(e,t){return this._connection.send(`AbortDFUWorkunit`,e,`json`,!1,t,`AbortDFUWorkunitResponse`)}Copy(e,t){return this._connection.send(`Copy`,e,`json`,!1,t,`CopyResponse`)}CreateDFUPublisherWorkunit(e,t){return this._connection.send(`CreateDFUPublisherWorkunit`,e,`json`,!1,t,`CreateDFUPublisherWorkunitResponse`)}CreateDFUWorkunit(e,t){return this._connection.send(`CreateDFUWorkunit`,e,`json`,!1,t,`CreateDFUWorkunitResponse`)}DFUWUFile(e,t){return this._connection.send(`DFUWUFile`,e,`json`,!1,t,`DFUWUFileResponse`)}DFUWUSearch(e,t){return this._connection.send(`DFUWUSearch`,e,`json`,!1,t,`DFUWUSearchResponse`)}DFUWorkunitsAction(e,t){return this._connection.send(`DFUWorkunitsAction`,e,`json`,!1,t,`DFUWorkunitsActionResponse`)}DeleteDFUWorkunit(e,t){return this._connection.send(`DeleteDFUWorkunit`,e,`json`,!1,t,`DeleteDFUWorkunitResponse`)}DeleteDFUWorkunits(e,t){return this._connection.send(`DeleteDFUWorkunits`,e,`json`,!1,t,`DeleteDFUWorkunitsResponse`)}DeleteDropZoneFiles(e,t){return this._connection.send(`DeleteDropZoneFiles`,e,`json`,!1,t,`DFUWorkunitsActionResponse`)}Despray(e,t){return this._connection.send(`Despray`,e,`json`,!1,t,`DesprayResponse`)}DfuMonitor(e,t){return this._connection.send(`DfuMonitor`,e,`json`,!1,t,`DfuMonitorResponse`)}DropZoneFileSearch(e,t){return this._connection.send(`DropZoneFileSearch`,e,`json`,!1,t,`DropZoneFileSearchResponse`)}DropZoneFiles(e,t){return this._connection.send(`DropZoneFiles`,e,`json`,!1,t,`DropZoneFilesResponse`)}EchoDateTime(e,t){return this._connection.send(`EchoDateTime`,e,`json`,!1,t,`EchoDateTimeResponse`)}FileList(e,t){return this._connection.send(`FileList`,e,`json`,!1,t,`FileListResponse`)}GetDFUExceptions(e,t){return this._connection.send(`GetDFUExceptions`,e,`json`,!1,t,`GetDFUExceptionsResponse`)}GetDFUProgress(e,t){return this._connection.send(`GetDFUProgress`,e,`json`,!1,t,`ProgressResponse`)}GetDFUServerQueues(e,t){return this._connection.send(`GetDFUServerQueues`,e,`json`,!1,t,`GetDFUServerQueuesResponse`)}GetDFUWorkunit(e,t){return this._connection.send(`GetDFUWorkunit`,e,`json`,!1,t,`GetDFUWorkunitResponse`)}GetDFUWorkunits(e,t){return this._connection.send(`GetDFUWorkunits`,e,`json`,!1,t,`GetDFUWorkunitsResponse`)}GetRemoteTargets(e,t){return this._connection.send(`GetRemoteTargets`,e,`json`,!1,t,`GetRemoteTargetsResponse`)}GetSprayTargets(e,t){return this._connection.send(`GetSprayTargets`,e,`json`,!1,t,`GetSprayTargetsResponse`)}OpenSave(e,t){return this._connection.send(`OpenSave`,e,`json`,!1,t,`OpenSaveResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`FileSprayPingResponse`)}Rename(e,t){return this._connection.send(`Rename`,e,`json`,!1,t,`RenameResponse`)}Replicate(e,t){return this._connection.send(`Replicate`,e,`json`,!1,t,`ReplicateResponse`)}ShowResult(e,t){return this._connection.send(`ShowResult`,e,`json`,!1,t,`ShowResultResponse`)}SprayFixed(e,t){return this._connection.send(`SprayFixed`,e,`json`,!1,t,`SprayFixedResponse`)}SprayVariable(e,t){return this._connection.send(`SprayVariable`,e,`json`,!1,t,`SprayResponse`)}SubmitDFUWorkunit(e,t){return this._connection.send(`SubmitDFUWorkunit`,e,`json`,!1,t,`SubmitDFUWorkunitResponse`)}UpdateDFUWorkunit(e,t){return this._connection.send(`UpdateDFUWorkunit`,e,`json`,!1,t,`UpdateDFUWorkunitResponse`)}},p=function(e){return e[e.unknown=0]=`unknown`,e[e.scheduled=1]=`scheduled`,e[e.queued=2]=`queued`,e[e.started=3]=`started`,e[e.aborted=4]=`aborted`,e[e.failed=5]=`failed`,e[e.finished=6]=`finished`,e[e.monitoring=7]=`monitoring`,e[e.aborting=8]=`aborting`,e[e.notfound=999]=`notfound`,e}({}),FileSprayService=class extends FileSprayServiceBase{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`)}},m;(function(e){e.ViewMemberType=function(e){return e.User=`User`,e.Group=`Group`,e}({}),e.UserSortBy=function(e){return e.username=`username`,e.fullname=`fullname`,e.passwordexpiration=`passwordexpiration`,e.employeeID=`employeeID`,e.employeeNumber=`employeeNumber`,e}({}),e.GroupSortBy=function(e){return e.Name=`Name`,e.ManagedBy=`ManagedBy`,e}({}),e.AccountTypeReq=function(e){return e.Any=`Any`,e.User=`User`,e.Group=`Group`,e}({}),e.ResourcePermissionSortBy=function(e){return e.Name=`Name`,e.Type=`Type`,e}({}),e.ResourceSortBy=function(e){return e.Name=`Name`,e}({})})(m||={});var AccessServiceBase=class extends Service{constructor(e){super(e,`ws_access`,`1.17`)}AccountPermissions(e,t){return this._connection.send(`AccountPermissions`,e,`json`,!1,t,`AccountPermissionsResponse`)}AccountPermissionsV2(e,t){return this._connection.send(`AccountPermissionsV2`,e,`json`,!1,t,`AccountPermissionsV2Response`)}AddUser(e,t){return this._connection.send(`AddUser`,e,`json`,!1,t,`AddUserResponse`)}AddView(e,t){return this._connection.send(`AddView`,e,`json`,!1,t,`AddViewResponse`)}AddViewColumn(e,t){return this._connection.send(`AddViewColumn`,e,`json`,!1,t,`AddViewColumnResponse`)}AddViewMember(e,t){return this._connection.send(`AddViewMember`,e,`json`,!1,t,`AddViewMemberResponse`)}ClearPermissionsCache(e,t){return this._connection.send(`ClearPermissionsCache`,e,`json`,!1,t,`ClearPermissionsCacheResponse`)}DeleteView(e,t){return this._connection.send(`DeleteView`,e,`json`,!1,t,`DeleteViewResponse`)}DeleteViewColumn(e,t){return this._connection.send(`DeleteViewColumn`,e,`json`,!1,t,`DeleteViewColumnResponse`)}DeleteViewMember(e,t){return this._connection.send(`DeleteViewMember`,e,`json`,!1,t,`DeleteViewMemberResponse`)}DisableScopeScans(e,t){return this._connection.send(`DisableScopeScans`,e,`json`,!1,t,`DisableScopeScansResponse`)}EnableScopeScans(e,t){return this._connection.send(`EnableScopeScans`,e,`json`,!1,t,`EnableScopeScansResponse`)}FilePermission(e,t){return this._connection.send(`FilePermission`,e,`json`,!1,t,`FilePermissionResponse`)}GroupAction(e,t){return this._connection.send(`GroupAction`,e,`json`,!1,t,`GroupActionResponse`)}GroupAdd(e,t){return this._connection.send(`GroupAdd`,e,`json`,!1,t,`GroupAddResponse`)}GroupEdit(e,t){return this._connection.send(`GroupEdit`,e,`json`,!1,t,`GroupEditResponse`)}GroupMemberEdit(e,t){return this._connection.send(`GroupMemberEdit`,e,`json`,!1,t,`GroupMemberEditResponse`)}GroupMemberEditInput(e,t){return this._connection.send(`GroupMemberEditInput`,e,`json`,!1,t,`GroupMemberEditInputResponse`)}GroupMemberQuery(e,t){return this._connection.send(`GroupMemberQuery`,e,`json`,!1,t,`GroupMemberQueryResponse`)}GroupQuery(e,t){return this._connection.send(`GroupQuery`,e,`json`,!1,t,`GroupQueryResponse`)}Groups(e,t){return this._connection.send(`Groups`,e,`json`,!1,t,`GroupResponse`)}PermissionAction(e,t){return this._connection.send(`PermissionAction`,e,`json`,!1,t,`PermissionActionResponse`)}Permissions(e,t){return this._connection.send(`Permissions`,e,`json`,!1,t,`BasednsResponse`)}PermissionsReset(e,t){return this._connection.send(`PermissionsReset`,e,`json`,!1,t,`PermissionsResetResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`ws_accessPingResponse`)}QueryScopeScansEnabled(e,t){return this._connection.send(`QueryScopeScansEnabled`,e,`json`,!1,t,`QueryScopeScansEnabledResponse`)}QueryUserViewColumns(e,t){return this._connection.send(`QueryUserViewColumns`,e,`json`,!1,t,`QueryUserViewColumnsResponse`)}QueryViewColumns(e,t){return this._connection.send(`QueryViewColumns`,e,`json`,!1,t,`QueryViewColumnsResponse`)}QueryViewMembers(e,t){return this._connection.send(`QueryViewMembers`,e,`json`,!1,t,`QueryViewMembersResponse`)}QueryViews(e,t){return this._connection.send(`QueryViews`,e,`json`,!1,t,`QueryViewsResponse`)}ResourceAdd(e,t){return this._connection.send(`ResourceAdd`,e,`json`,!1,t,`ResourceAddResponse`)}ResourceDelete(e,t){return this._connection.send(`ResourceDelete`,e,`json`,!1,t,`ResourceDeleteResponse`)}ResourcePermissionQuery(e,t){return this._connection.send(`ResourcePermissionQuery`,e,`json`,!1,t,`ResourcePermissionQueryResponse`)}ResourcePermissions(e,t){return this._connection.send(`ResourcePermissions`,e,`json`,!1,t,`ResourcePermissionsResponse`)}ResourceQuery(e,t){return this._connection.send(`ResourceQuery`,e,`json`,!1,t,`ResourceQueryResponse`)}Resources(e,t){return this._connection.send(`Resources`,e,`json`,!1,t,`ResourcesResponse`)}UserAccountExport(e,t){return this._connection.send(`UserAccountExport`,e,`json`,!1,t,`UserAccountExportResponse`)}UserAction(e,t){return this._connection.send(`UserAction`,e,`json`,!1,t,`UserActionResponse`)}UserEdit(e,t){return this._connection.send(`UserEdit`,e,`json`,!1,t,`UserEditResponse`)}UserGroupEdit(e,t){return this._connection.send(`UserGroupEdit`,e,`json`,!1,t,`UserGroupEditResponse`)}UserGroupEditInput(e,t){return this._connection.send(`UserGroupEditInput`,e,`json`,!1,t,`UserGroupEditInputResponse`)}UserInfoEdit(e,t){return this._connection.send(`UserInfoEdit`,e,`json`,!1,t,`UserInfoEditResponse`)}UserInfoEditInput(e,t){return this._connection.send(`UserInfoEditInput`,e,`json`,!1,t,`UserInfoEditInputResponse`)}UserPosix(e,t){return this._connection.send(`UserPosix`,e,`json`,!1,t,`UserPosixResponse`)}UserPosixInput(e,t){return this._connection.send(`UserPosixInput`,e,`json`,!1,t,`UserPosixInputResponse`)}UserQuery(e,t){return this._connection.send(`UserQuery`,e,`json`,!1,t,`UserQueryResponse`)}UserResetPass(e,t){return this._connection.send(`UserResetPass`,e,`json`,!1,t,`UserResetPassResponse`)}UserResetPassInput(e,t){return this._connection.send(`UserResetPassInput`,e,`json`,!1,t,`UserResetPassInputResponse`)}UserSudoers(e,t){return this._connection.send(`UserSudoers`,e,`json`,!1,t,`UserSudoersResponse`)}UserSudoersInput(e,t){return this._connection.send(`UserSudoersInput`,e,`json`,!1,t,`UserSudoersInputResponse`)}Users(e,t){return this._connection.send(`Users`,e,`json`,!1,t,`UserResponse`)}},AccessService=class extends AccessServiceBase{},AccountServiceBase=class extends Service{constructor(e){super(e,`ws_account`,`1.07`)}MyAccount(e,t){return this._connection.send(`MyAccount`,e,`json`,!1,t,`MyAccountResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`ws_accountPingResponse`)}UpdateUser(e,t){return this._connection.send(`UpdateUser`,e,`json`,!1,t,`UpdateUserResponse`)}UpdateUserInput(e,t){return this._connection.send(`UpdateUserInput`,e,`json`,!1,t,`UpdateUserInputResponse`)}VerifyUser(e,t){return this._connection.send(`VerifyUser`,e,`json`,!1,t,`VerifyUserResponse`)}},AccountService=class extends AccountServiceBase{VerifyUser(e){return this._connection.send(`VerifyUser`,e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>e.Code===20043))return{retcode:20043,Exceptions:{Source:`wsAccount`,Exception:e.Exception}};throw e})}},CloudServiceBase=class extends Service{constructor(e){super(e,`WsCloud`,`1.02`)}GetPODs(e,t){return this._connection.send(`GetPODs`,e,`json`,!1,t,`GetPODsResponse`)}GetServices(e,t){return this._connection.send(`GetServices`,e,`json`,!1,t,`GetServicesResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`WsCloudPingResponse`)}},h=(0,t.scopedLogger)(`@hpcc-js/comms/services/wsCloud.ts`);function isGetPODsResponse_v1_02(e){return e?.Pods!==void 0}function mapPorts(e){return e.spec?.containers?.reduce((e,t)=>(t.ports?.forEach(t=>{e.push({ContainerPort:t.containerPort,Name:t.name,Protocol:t.protocol})}),e),[])??[]}function mapPods(e){return e.filter(e=>{let t=e?.metadata?.labels??{};return t.hasOwnProperty(`app.kubernetes.io/part-of`)&&t[`app.kubernetes.io/part-of`]===`HPCC-Platform`}).map(e=>{let t=new Date(e.metadata?.creationTimestamp);return{Name:e.metadata.name,Status:e.status?.phase,CreationTimestamp:t.toISOString(),ContainerName:e.status?.containerStatuses?.reduce((e,t)=>(t.name&&e.push(t.name),e),[]).join(`, `)??``,ContainerCount:e.spec?.containers?.length??0,ContainerReadyCount:e.status?.containerStatuses?.reduce((e,t)=>e+ +!!t.ready,0),ContainerRestartCount:e.status?.containerStatuses?.reduce((e,t)=>e+t.restartCount,0),Ports:{Port:mapPorts(e)}}})}var CloudService=class extends CloudServiceBase{getPODs(){return super.GetPODs({}).then(e=>{if(isGetPODsResponse_v1_02(e))return e.Pods?.Pod??[];try{return mapPods((typeof e.Result==`string`?JSON.parse(e.Result):e.Result)?.items??[])}catch(e){return h.error(`Error parsing V1Pods json '${e instanceof Error?e.message:String(e)}'`),[]}})}},g;(function(e){e.SigningMethodType=function(e){return e.gpg=`gpg`,e}({})})(g||={});var CodesignServiceBase=class extends Service{constructor(e){super(e,`ws_codesign`,`1.1`)}ListUserIDs(e,t){return this._connection.send(`ListUserIDs`,e,`json`,!1,t,`ListUserIDsResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`ws_codesignPingResponse`)}Sign(e,t){return this._connection.send(`Sign`,e,`json`,!1,t,`SignResponse`)}Verify(e,t){return this._connection.send(`Verify`,e,`json`,!1,t,`VerifyResponse`)}},CodesignService=class extends CodesignServiceBase{ListUserIDsEx(e){return super.ListUserIDs(e).then(e=>e.UserIDs.Item).catch(e=>[])}Sign(e){return super.Sign({SigningMethod:g.SigningMethodType.gpg,...e})}},DaliServiceBase=class extends Service{constructor(e){super(e,`WSDali`,`1.07`)}Add(e,t){return this._connection.send(`Add`,e,`json`,!1,t,`ResultResponse`)}ClearTraceTransactions(e,t){return this._connection.send(`ClearTraceTransactions`,e,`json`,!1,t,`ResultResponse`)}Count(e,t){return this._connection.send(`Count`,e,`json`,!1,t,`CountResponse`)}DFSCheck(e,t){return this._connection.send(`DFSCheck`,e,`json`,!1,t,`ResultResponse`)}DFSExists(e,t){return this._connection.send(`DFSExists`,e,`json`,!1,t,`BooleanResponse`)}DFSLS(e,t){return this._connection.send(`DFSLS`,e,`json`,!1,t,`ResultResponse`)}Delete(e,t){return this._connection.send(`Delete`,e,`json`,!1,t,`ResultResponse`)}DisconnectClientConnection(e,t){return this._connection.send(`DisconnectClientConnection`,e,`json`,!1,t,`ResultResponse`)}GetClients(e,t){return this._connection.send(`GetClients`,e,`json`,!1,t,`ResultResponse`)}GetConnections(e,t){return this._connection.send(`GetConnections`,e,`json`,!1,t,`ResultResponse`)}GetDFSCSV(e,t){return this._connection.send(`GetDFSCSV`,e,`json`,!1,t,`ResultResponse`)}GetDFSMap(e,t){return this._connection.send(`GetDFSMap`,e,`json`,!1,t,`ResultResponse`)}GetDFSParents(e,t){return this._connection.send(`GetDFSParents`,e,`json`,!1,t,`ResultResponse`)}GetLogicalFile(e,t){return this._connection.send(`GetLogicalFile`,e,`json`,!1,t,`ResultResponse`)}GetLogicalFilePart(e,t){return this._connection.send(`GetLogicalFilePart`,e,`json`,!1,t,`ResultResponse`)}GetProtectedList(e,t){return this._connection.send(`GetProtectedList`,e,`json`,!1,t,`ResultResponse`)}GetSDSStats(e,t){return this._connection.send(`GetSDSStats`,e,`json`,!1,t,`ResultResponse`)}GetSDSSubscribers(e,t){return this._connection.send(`GetSDSSubscribers`,e,`json`,!1,t,`ResultResponse`)}GetValue(e,t){return this._connection.send(`GetValue`,e,`json`,!1,t,`ResultResponse`)}Import(e,t){return this._connection.send(`Import`,e,`json`,!1,t,`ResultResponse`)}ListSDSLocks(e,t){return this._connection.send(`ListSDSLocks`,e,`json`,!1,t,`ResultResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`WSDaliPingResponse`)}SaveSDSStore(e,t){return this._connection.send(`SaveSDSStore`,e,`json`,!1,t,`ResultResponse`)}SetLogicalFilePartAttr(e,t){return this._connection.send(`SetLogicalFilePartAttr`,e,`json`,!1,t,`ResultResponse`)}SetProtected(e,t){return this._connection.send(`SetProtected`,e,`json`,!1,t,`ResultResponse`)}SetTraceSlowTransactions(e,t){return this._connection.send(`SetTraceSlowTransactions`,e,`json`,!1,t,`ResultResponse`)}SetTraceTransactions(e,t){return this._connection.send(`SetTraceTransactions`,e,`json`,!1,t,`ResultResponse`)}SetUnprotected(e,t){return this._connection.send(`SetUnprotected`,e,`json`,!1,t,`ResultResponse`)}SetValue(e,t){return this._connection.send(`SetValue`,e,`json`,!1,t,`ResultResponse`)}UnlockSDSLock(e,t){return this._connection.send(`UnlockSDSLock`,e,`json`,!1,t,`ResultResponse`)}},DaliService=class extends DaliServiceBase{},_;(function(e){e.DFUArrayActions=function(e){return e.Delete=`Delete`,e.AddToSuperfile=`Add To Superfile`,e.ChangeProtection=`Change Protection`,e.ChangeRestriction=`Change Restriction`,e}({}),e.DFUChangeProtection=function(e){return e[e.NoChange=0]=`NoChange`,e[e.Protect=1]=`Protect`,e[e.Unprotect=2]=`Unprotect`,e[e.UnprotectAll=3]=`UnprotectAll`,e}({}),e.DFUChangeRestriction=function(e){return e[e.NoChange=0]=`NoChange`,e[e.Restrict=1]=`Restrict`,e[e.Unrestricted=2]=`Unrestricted`,e}({}),e.DFUDefFileFormat=function(e){return e.xml=`xml`,e.def=`def`,e}({}),e.FileAccessRole=function(e){return e.Token=`Token`,e.Engine=`Engine`,e.External=`External`,e}({}),e.SecAccessType=function(e){return e.None=`None`,e.Access=`Access`,e.Read=`Read`,e.Write=`Write`,e.Full=`Full`,e}({}),e.DFUFileType=function(e){return e.Flat=`Flat`,e.Index=`Index`,e.Xml=`Xml`,e.Csv=`Csv`,e.Json=`Json`,e.IndexLocal=`IndexLocal`,e.IndexPartitioned=`IndexPartitioned`,e.Unset=`Unset`,e}({})})(_||={});var DfuServiceBase=class extends Service{constructor(e){super(e,`WsDfu`,`1.67`)}Add(e){return this._connection.send(`Add`,e,`json`,!1,void 0,`AddResponse`)}AddRemote(e){return this._connection.send(`AddRemote`,e,`json`,!1,void 0,`AddRemoteResponse`)}AddtoSuperfile(e){return this._connection.send(`AddtoSuperfile`,e,`json`,!1,void 0,`AddtoSuperfileResponse`)}DFUArrayAction(e){return this._connection.send(`DFUArrayAction`,e,`json`,!1,void 0,`DFUArrayActionResponse`)}DFUBrowseData(e){return this._connection.send(`DFUBrowseData`,e,`json`,!1,void 0,`DFUBrowseDataResponse`)}DFUDefFile(e){return this._connection.send(`DFUDefFile`,e,`json`,!1,void 0,`DFUDefFileResponse`)}DFUFileAccess(e){return this._connection.send(`DFUFileAccess`,e,`json`,!1,void 0,`DFUFileAccessResponse`)}DFUFileAccessV2(e){return this._connection.send(`DFUFileAccessV2`,e,`json`,!1,void 0,`DFUFileAccessResponse`)}DFUFileCreate(e){return this._connection.send(`DFUFileCreate`,e,`json`,!1,void 0,`DFUFileCreateResponse`)}DFUFileCreateV2(e){return this._connection.send(`DFUFileCreateV2`,e,`json`,!1,void 0,`DFUFileCreateResponse`)}DFUFilePublish(e){return this._connection.send(`DFUFilePublish`,e,`json`,!1,void 0,`DFUFilePublishResponse`)}DFUFileView(e){return this._connection.send(`DFUFileView`,e,`json`,!1,void 0,`DFUFileViewResponse`)}DFUGetDataColumns(e){return this._connection.send(`DFUGetDataColumns`,e,`json`,!1,void 0,`DFUGetDataColumnsResponse`)}DFUGetFileMetaData(e){return this._connection.send(`DFUGetFileMetaData`,e,`json`,!1,void 0,`DFUGetFileMetaDataResponse`)}DFUGetMetaInquiry(e){return this._connection.send(`DFUGetMetaInquiry`,e,`json`,!1,void 0,`DFUMetaInquiryResponse`)}DFUInfo(e){return this._connection.send(`DFUInfo`,e,`json`,!1,void 0,`DFUInfoResponse`)}DFUQuery(e){return this._connection.send(`DFUQuery`,e,`json`,!1,void 0,`DFUQueryResponse`)}DFURecordTypeInfo(e){return this._connection.send(`DFURecordTypeInfo`,e,`json`,!1,void 0,`DFURecordTypeInfoResponse`)}DFUSearch(e){return this._connection.send(`DFUSearch`,e,`json`,!1,void 0,`DFUSearchResponse`)}DFUSearchData(e){return this._connection.send(`DFUSearchData`,e,`json`,!1,void 0,`DFUSearchDataResponse`)}DFUSpace(e){return this._connection.send(`DFUSpace`,e,`json`,!1,void 0,`DFUSpaceResponse`)}EclRecordTypeInfo(e){return this._connection.send(`EclRecordTypeInfo`,e,`json`,!1,void 0,`EclRecordTypeInfoResponse`)}EraseHistory(e){return this._connection.send(`EraseHistory`,e,`json`,!1,void 0,`EraseHistoryResponse`)}ListHistory(e){return this._connection.send(`ListHistory`,e,`json`,!1,void 0,`ListHistoryResponse`)}Ping(e){return this._connection.send(`Ping`,e,`json`,!1,void 0,`WsDfuPingResponse`)}Savexml(e){return this._connection.send(`Savexml`,e,`json`,!1,void 0,`SavexmlResponse`)}SuperfileAction(e){return this._connection.send(`SuperfileAction`,e,`json`,!1,void 0,`SuperfileActionResponse`)}SuperfileList(e){return this._connection.send(`SuperfileList`,e,`json`,!1,void 0,`SuperfileListResponse`)}},v=_.DFUArrayActions,y=_.DFUDefFileFormat,b=_.DFUChangeProtection,x=_.DFUChangeRestriction,DFUService=class extends DfuServiceBase{DFUFile(e){return this._connection.send(`DFUDefFile`,e,`text`)}async recursiveFetchLogicalFiles(e){let t=[],n=[];return await Promise.all(e.map(e=>this.DFUInfo({Cluster:e.NodeGroup,Name:e.Name,IncludeJsonTypeInfo:!1,IncludeBinTypeInfo:!1,ForceIndexInfo:!1}).then(e=>{for(let n of e?.FileDetail?.Superfiles?.DFULogicalFile??[])t.push(n);for(let t of e?.FileDetail?.subfiles?.Item??[])n.push(t)}))),n.concat(t.length?await this.recursiveFetchLogicalFiles(t):[])}},DFUXRefServiceBase=class extends Service{constructor(e){super(e,`WsDFUXRef`,`1.04`)}DFUXRefArrayAction(e,t){return this._connection.send(`DFUXRefArrayAction`,e,`json`,!1,t,`DFUXRefArrayActionResponse`)}DFUXRefBuild(e,t){return this._connection.send(`DFUXRefBuild`,e,`json`,!1,t,`DFUXRefBuildResponse`)}DFUXRefBuildCancel(e,t){return this._connection.send(`DFUXRefBuildCancel`,e,`json`,!1,t,`DFUXRefBuildCancelResponse`)}DFUXRefCleanDirectories(e,t){return this._connection.send(`DFUXRefCleanDirectories`,e,`json`,!1,t,`DFUXRefCleanDirectoriesResponse`)}DFUXRefDirectories(e,t){return this._connection.send(`DFUXRefDirectories`,e,`json`,!1,t,`DFUXRefDirectoriesQueryResponse`)}DFUXRefFoundFiles(e,t){return this._connection.send(`DFUXRefFoundFiles`,e,`json`,!1,t,`DFUXRefFoundFilesQueryResponse`)}DFUXRefList(e,t){return this._connection.send(`DFUXRefList`,e,`json`,!1,t,`DFUXRefListResponse`)}DFUXRefLostFiles(e,t){return this._connection.send(`DFUXRefLostFiles`,e,`json`,!1,t,`DFUXRefLostFilesQueryResponse`)}DFUXRefMessages(e,t){return this._connection.send(`DFUXRefMessages`,e,`json`,!1,t,`DFUXRefMessagesQueryResponse`)}DFUXRefOrphanFiles(e,t){return this._connection.send(`DFUXRefOrphanFiles`,e,`json`,!1,t,`DFUXRefOrphanFilesQueryResponse`)}DFUXRefUnusedFiles(e,t){return this._connection.send(`DFUXRefUnusedFiles`,e,`json`,!1,t,`DFUXRefUnusedFilesResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`WsDFUXRefPingResponse`)}},DFUXRefService=class extends DFUXRefServiceBase{DFUXRefDirectoriesEx(e){return this._connection.send(`DFUXRefDirectories`,e,`json`,!1,void 0,`DFUXRefDirectoriesQueryResponse`)}DFUXRefListEx(e){return this._connection.send(`DFUXRefList`,e,`json`,!1,void 0,`DFUXRefListResponse`)}};function jsonToIField(e,t){let n=typeof t;switch(n){case`boolean`:case`number`:case`string`:return{id:e,type:n};case`object`:if(t.Row instanceof Array&&(t=t.Row),t instanceof Array)return{id:e,type:`dataset`,children:jsonToIFieldArr(t[0])};if(t instanceof Object){if(t.Item&&t.Item instanceof Array&&t.Item.length===1){let n=typeof t.Item[0];if(n===`string`||n===`number`)return{id:e,type:`set`,fieldType:n};throw Error(`Unknown field type`)}return{id:e,type:`object`,fields:jsonToIFieldObj(t)}}default:throw Error(`Unknown field type`)}}function jsonToIFieldArr(e){e.Row&&e.Row instanceof Array&&(e=e.Row[0]);let t=[];for(let n in e)t.push(jsonToIField(n,e[n]));return t}function jsonToIFieldObj(e){let t={};for(let n in e)t[n]=jsonToIField(n,e[n]);return t}var EclService=class extends Service{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(e=>{let t=JSON.parse(e);for(let e in t)return t[e];return{}}).then(jsonToIFieldArr)}responseJson(e,t){return this._connection.send(`example/response/query/${e}/${t}/json`,{},`text`).then(e=>{let t=JSON.parse(e);for(let e in t)return t[e].Results;return{}}).then(e=>{let t={};for(let n in e)t[n]=jsonToIFieldArr(e[n]);return t})}submit(e,t,n){let r=`submit/query/${e}/${t}`;return this._connection.send(r,n,`json2`).then(e=>{if(e.Results&&e.Results.Exception)throw new ESPExceptions(r,n,{Source:`wsEcl.submit`,Exception:e.Results.Exception});return e.Results})}},ElkServiceBase=class extends Service{constructor(e){super(e,`ws_elk`,`1`)}GetConfigDetails(e,t){return this._connection.send(`GetConfigDetails`,e,`json`,!1,t,`GetConfigDetailsResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`ws_elkPingResponse`)}},ElkService=class extends ElkServiceBase{},S;(function(e){e.LogColumnType=function(e){return e.global=`global`,e.workunits=`workunits`,e.components=`components`,e.audience=`audience`,e.class=`class`,e.instance=`instance`,e.node=`node`,e.message=`message`,e.logid=`logid`,e.processid=`processid`,e.threadid=`threadid`,e.timestamp=`timestamp`,e.pod=`pod`,e.traceid=`traceid`,e.spanid=`spanid`,e}({}),e.LogColumnValueType=function(e){return e.string=`string`,e.numeric=`numeric`,e.datetime=`datetime`,e.enum=`enum`,e.epoch=`epoch`,e}({}),e.LogAccessType=function(e){return e[e.All=0]=`All`,e[e.ByJobID=1]=`ByJobID`,e[e.ByComponent=2]=`ByComponent`,e[e.ByLogType=3]=`ByLogType`,e[e.ByTargetAudience=4]=`ByTargetAudience`,e[e.BySourceInstance=5]=`BySourceInstance`,e[e.BySourceNode=6]=`BySourceNode`,e[e.ByFieldName=7]=`ByFieldName`,e[e.ByPod=8]=`ByPod`,e[e.ByTraceID=9]=`ByTraceID`,e[e.BySpanID=10]=`BySpanID`,e}({}),e.LogAccessStatusCode=function(e){return e[e.Success=0]=`Success`,e[e.Warning=1]=`Warning`,e[e.Fail=2]=`Fail`,e}({}),e.LogAccessFilterOperator=function(e){return e[e.NONE=0]=`NONE`,e[e.AND=1]=`AND`,e[e.OR=2]=`OR`,e}({}),e.LogSelectColumnMode=function(e){return e[e.MIN=0]=`MIN`,e[e.DEFAULT=1]=`DEFAULT`,e[e.ALL=2]=`ALL`,e[e.CUSTOM=3]=`CUSTOM`,e}({}),e.SortColumType=function(e){return e[e.ByDate=0]=`ByDate`,e[e.ByJobID=1]=`ByJobID`,e[e.ByComponent=2]=`ByComponent`,e[e.ByLogType=3]=`ByLogType`,e[e.ByTargetAudience=4]=`ByTargetAudience`,e[e.BySourceInstance=5]=`BySourceInstance`,e[e.BySourceNode=6]=`BySourceNode`,e[e.ByFieldName=7]=`ByFieldName`,e[e.ByPod=8]=`ByPod`,e[e.ByTraceID=9]=`ByTraceID`,e[e.BySpanID=10]=`BySpanID`,e}({}),e.SortDirection=function(e){return e[e.ASC=0]=`ASC`,e[e.DSC=1]=`DSC`,e}({})})(S||={});var LogaccessServiceBase=class extends Service{constructor(e){super(e,`ws_logaccess`,`1.08`)}GetHealthReport(e){return this._connection.send(`GetHealthReport`,e,`json`,!1,void 0,`GetHealthReportResponse`)}GetLogAccessInfo(e){return this._connection.send(`GetLogAccessInfo`,e,`json`,!1,void 0,`GetLogAccessInfoResponse`)}GetLogs(e){return this._connection.send(`GetLogs`,e,`json`,!1,void 0,`GetLogsResponse`)}Ping(e){return this._connection.send(`Ping`,e,`json`,!1,void 0,`ws_logaccessPingResponse`)}},C=(0,t.scopedLogger)(`@hpcc-js/comms/services/wsLogaccess.ts`),w=function(e){return e.Disaster=`DIS`,e.Error=`ERR`,e.Warning=`WRN`,e.Information=`INF`,e.Progress=`PRO`,e.Metric=`MET`,e}({}),T=function(e){return e.Operator=`OPR`,e.User=`USR`,e.Programmer=`PRO`,e.Audit=`ADT`,e}({}),E=new Set([`azureloganalyticscurl`,`elasticstack`,`grafanacurl`]),ee=new Set(Object.values(S.LogColumnType));function getLogCategory(e){switch(e){case S.LogColumnType.workunits:case`hpcc.log.jobid`:return S.LogAccessType.ByJobID;case S.LogColumnType.audience:case`hpcc.log.audience`:return S.LogAccessType.ByTargetAudience;case S.LogColumnType.class:case`hpcc.log.class`:return S.LogAccessType.ByLogType;case S.LogColumnType.components:case`kubernetes.container.name`:return S.LogAccessType.ByComponent;default:return S.LogAccessType.ByFieldName}}var te=[`audience`,`class`,`workunits`,`message`,`processid`,`logid`,`threadid`,`timestamp`,`components`,`instance`];function buildFilters(e,t){let n=[];for(let r of te){let i=e[r];if(i==null||i===``||Array.isArray(i)&&i.length===0||!(r in t))continue;let a=ee.has(r)?r:t[r],o=getLogCategory(a);o===S.LogAccessType.ByFieldName&&(a=t[r]);let s=o===S.LogAccessType.ByComponent,c=Array.isArray(i)?i:[i];for(let e of c)n.push({LogCategory:o,SearchField:a,SearchByValue:s?e+`*`:e})}return n}function buildOrGroup(e){let t={leftFilter:e[0]},n=t;for(let t=1;t<e.length;t++)n.Operator=S.LogAccessFilterOperator.OR,t===e.length-1?n.rightFilter=e[t]:(n.rightBinaryFilter={BinaryLogFilter:[{leftFilter:e[t]}]},n=n.rightBinaryFilter.BinaryLogFilter[0]);return t}function buildAndChain(e){let[t,...n]=e,r={};if(t.length===1?r.leftFilter=t[0]:r.leftBinaryFilter={BinaryLogFilter:[buildOrGroup(t)]},n.length===0)return r;if(r.Operator=S.LogAccessFilterOperator.AND,n.length===1){let[e]=n;e.length===1?r.rightFilter=e[0]:r.rightBinaryFilter={BinaryLogFilter:[buildOrGroup(e)]}}else r.rightBinaryFilter={BinaryLogFilter:[buildAndChain(n)]};return r}function buildFilterTree(e){let t=new Map;for(let n of e){let e=t.get(n.SearchField);e?e.push(n):t.set(n.SearchField,[n])}let n=[...t.values()];if(n.length===0)return{leftFilter:{LogCategory:S.LogAccessType.All}};let[r,...i]=n,a={};if(r.length===1?a.leftFilter=r[0]:a.leftBinaryFilter={BinaryLogFilter:[buildOrGroup(r)]},i.length===0)return a;if(a.Operator=S.LogAccessFilterOperator.AND,i.length===1){let[e]=i;e.length===1?a.rightFilter=e[0]:a.rightBinaryFilter={BinaryLogFilter:[buildOrGroup(e)]}}else a.rightBinaryFilter={BinaryLogFilter:[buildAndChain(i)]};return a}var LogaccessService=class extends LogaccessServiceBase{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||=super.GetLogAccessInfo(e),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}convertLogLine(e,t){let n={},r=t?.fields?Object.assign({},...t.fields):null;for(let t in e)n[t]=r?r[e[t]]??``:``;return n}async GetLogsEx(e){let t=await this.GetLogAccessInfo(),n={};t.Columns.Column.forEach(e=>n[e.LogType]=e.Name);let r=buildFilters(e,n),i={StartDate:e.StartDate instanceof Date?e.StartDate.toISOString():new Date(0).toISOString()};e.EndDate instanceof Date&&(i.EndDate=e.EndDate.toISOString());let a={Filter:buildFilterTree(r),Range:i,LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:S.LogSelectColumnMode.DEFAULT,Format:`JSON`,SortBy:{SortCondition:[{BySortType:S.SortColumType.ByDate,ColumnName:``,Direction:0}]}};return this.GetLogs(a).then(e=>{try{let r=JSON.parse(e.LogLines);return{lines:E.has(t.RemoteLogManagerType)?r.lines?.map(e=>this.convertLogLine(n,e))??[]:(C.warning(`Unknown RemoteLogManagerType: ${t.RemoteLogManagerType}`),[]),total:e.TotalLogLinesAvailable??1e4}}catch(e){C.error(e.message??e)}return{lines:[],total:0}})}};function ascending_default(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}__name(ascending_default,`default`);function bisector_default(e){return e.length===1&&(e=ascendingComparator(e)),{left:function(t,n,r,i){for(r??=0,i??=t.length;r<i;){var a=r+i>>>1;e(t[a],n)<0?r=a+1:i=a}return r},right:function(t,n,r,i){for(r??=0,i??=t.length;r<i;){var a=r+i>>>1;e(t[a],n)>0?i=a:r=a+1}return r}}}__name(bisector_default,`default`);function ascendingComparator(e){return function(t,n){return ascending_default(e(t),n)}}var ne=bisector_default(ascending_default);ne.right,ne.left;function number_default(e){return e===null?NaN:+e}__name(number_default,`default`);var re=Array.prototype;re.slice,re.map;function max_default(e,t){var n=e.length,r=-1,i,a;if(t==null){for(;++r<n;)if((i=e[r])!=null&&i>=i)for(a=i;++r<n;)(i=e[r])!=null&&i>a&&(a=i)}else for(;++r<n;)if((i=t(e[r],r,e))!=null&&i>=i)for(a=i;++r<n;)(i=t(e[r],r,e))!=null&&i>a&&(a=i);return a}__name(max_default,`default`);function mean_default(e,t){var n=e.length,r=n,i=-1,a,o=0;if(t==null)for(;++i<n;)isNaN(a=number_default(e[i]))?--r:o+=a;else for(;++i<n;)isNaN(a=number_default(t(e[i],i,e)))?--r:o+=a;if(r)return o/r}__name(mean_default,`default`);var ie;(function(e){e.ThresholdType=function(e){return e[e.THRESHOLD_PERCENTAGE=0]=`THRESHOLD_PERCENTAGE`,e[e.THRESHOLD_MB=1]=`THRESHOLD_MB`,e}({}),e.TpMachineType=function(e){return e.ALLNODES=`ALLNODES`,e.THORMACHINES=`THORMACHINES`,e.HOLEMACHINES=`HOLEMACHINES`,e.ROXIEMACHINES=`ROXIEMACHINES`,e.MACHINES=`MACHINES`,e.AVAILABLEMACHINES=`AVAILABLEMACHINES`,e.DROPZONE=`DROPZONE`,e.STANDBYNNODE=`STANDBYNNODE`,e.THORSPARENODES=`THORSPARENODES`,e.HOLESTANDBYNODES=`HOLESTANDBYNODES`,e}({})})(ie||={});var MachineServiceBase=class extends Service{constructor(e){super(e,`ws_machine`,`1.19`)}GetComponentStatus(e,t){return this._connection.send(`GetComponentStatus`,e,`json`,!1,t,`GetComponentStatusResponse`)}GetComponentUsage(e,t){return this._connection.send(`GetComponentUsage`,e,`json`,!1,t,`GetComponentUsageResponse`)}GetMachineInfo(e,t){return this._connection.send(`GetMachineInfo`,e,`json`,!1,t,`GetMachineInfoResponse`)}GetMachineInfoEx(e,t){return this._connection.send(`GetMachineInfoEx`,e,`json`,!1,t,`GetMachineInfoResponseEx`)}GetMetrics(e,t){return this._connection.send(`GetMetrics`,e,`json`,!1,t,`MetricsResponse`)}GetNodeGroupUsage(e,t){return this._connection.send(`GetNodeGroupUsage`,e,`json`,!1,t,`GetNodeGroupUsageResponse`)}GetTargetClusterInfo(e,t){return this._connection.send(`GetTargetClusterInfo`,e,`json`,!1,t,`GetTargetClusterInfoResponse`)}GetTargetClusterUsage(e,t){return this._connection.send(`GetTargetClusterUsage`,e,`json`,!1,t,`GetTargetClusterUsageResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`ws_machinePingResponse`)}UpdateComponentStatus(e,t){return this._connection.send(`UpdateComponentStatus`,e,`json`,!1,t,`UpdateComponentStatusResponse`)}},MachineService=class extends MachineServiceBase{GetTargetClusterUsageEx(e,n=!1){return this._connection.send(`GetTargetClusterUsage`,{TargetClusters:e?{Item:e}:{},BypassCachedResult:n}).then(e=>(0,t.exists)(`TargetClusterUsages.TargetClusterUsage`,e)?e.TargetClusterUsages.TargetClusterUsage:[]).then(e=>e.filter(e=>!!e.ComponentUsages).map(e=>{let t=e.ComponentUsages.ComponentUsage.map(e=>{let t=(e.MachineUsages&&e.MachineUsages.MachineUsage?e.MachineUsages.MachineUsage:[]).map(e=>{let t=e.DiskUsages&&e.DiskUsages.DiskUsage?e.DiskUsages.DiskUsage.map(e=>({...e,InUse:e.InUse*1024,Total:(e.InUse+e.Available)*1024,PercentUsed:100-e.PercentAvailable})):[];return{Name:e.Name,NetAddress:e.NetAddress,Description:e.Description,DiskUsages:t,mean:mean_default(t.filter(e=>!isNaN(e.PercentUsed)),e=>e.PercentUsed),max:max_default(t.filter(e=>!isNaN(e.PercentUsed)),e=>e.PercentUsed)}});return{Type:e.Type,Name:e.Name,Description:e.Description,MachineUsages:t,MachineUsagesDescription:t.reduce((e,t)=>e+(t.Description||``),``),mean:mean_default(t.filter(e=>!isNaN(e.mean)),e=>e.mean),max:max_default(t.filter(e=>!isNaN(e.max)),e=>e.max)}});return{Name:e.Name,Description:e.Description,ComponentUsages:t,ComponentUsagesDescription:t.reduce((e,t)=>e+(t.MachineUsagesDescription||``),``),mean:mean_default(t.filter(e=>!isNaN(e.mean)),e=>e.mean),max:max_default(t.filter(e=>!isNaN(e.max)),e=>e.max)}}))}},PackageProcessServiceBase=class extends Service{constructor(e){super(e,`WsPackageProcess`,`1.08`)}ActivatePackage(e,t){return this._connection.send(`ActivatePackage`,e,`json`,!1,t,`ActivatePackageResponse`)}AddPackage(e,t){return this._connection.send(`AddPackage`,e,`json`,!1,t,`AddPackageResponse`)}AddPartToPackageMap(e,t){return this._connection.send(`AddPartToPackageMap`,e,`json`,!1,t,`AddPartToPackageMapResponse`)}CopyPackageMap(e,t){return this._connection.send(`CopyPackageMap`,e,`json`,!1,t,`CopyPackageMapResponse`)}DeActivatePackage(e,t){return this._connection.send(`DeActivatePackage`,e,`json`,!1,t,`DeActivatePackageResponse`)}DeletePackage(e,t){return this._connection.send(`DeletePackage`,e,`json`,!1,t,`DeletePackageResponse`)}Echo(e,t){return this._connection.send(`Echo`,e,`json`,!1,t,`EchoResponse`)}GetPackage(e,t){return this._connection.send(`GetPackage`,e,`json`,!1,t,`GetPackageResponse`)}GetPackageMapById(e,t){return this._connection.send(`GetPackageMapById`,e,`json`,!1,t,`GetPackageMapByIdResponse`)}GetPackageMapSelectOptions(e,t){return this._connection.send(`GetPackageMapSelectOptions`,e,`json`,!1,t,`GetPackageMapSelectOptionsResponse`)}GetPartFromPackageMap(e,t){return this._connection.send(`GetPartFromPackageMap`,e,`json`,!1,t,`GetPartFromPackageMapResponse`)}GetQueryFileMapping(e,t){return this._connection.send(`GetQueryFileMapping`,e,`json`,!1,t,`GetQueryFileMappingResponse`)}ListPackage(e,t){return this._connection.send(`ListPackage`,e,`json`,!1,t,`ListPackageResponse`)}ListPackages(e,t){return this._connection.send(`ListPackages`,e,`json`,!1,t,`ListPackagesResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`WsPackageProcessPingResponse`)}RemovePartFromPackageMap(e,t){return this._connection.send(`RemovePartFromPackageMap`,e,`json`,!1,t,`RemovePartFromPackageMapResponse`)}ValidatePackage(e,t){return this._connection.send(`ValidatePackage`,e,`json`,!1,t,`ValidatePackageResponse`)}},PackageProcessService=class extends PackageProcessServiceBase{},ResourcesServiceBase=class extends Service{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)}},ResourcesService=class extends ResourcesServiceBase{},ae;(function(e){e.WUTypes=function(e){return e.ECL=`ECL`,e.DFU=`DFU`,e}({})})(ae||={});var SashaServiceBase=class extends Service{constructor(e){super(e,`WSSasha`,`1.01`)}ArchiveWU(e,t){return this._connection.send(`ArchiveWU`,e,`json`,!1,t,`ResultResponse`)}GetVersion(e,t){return this._connection.send(`GetVersion`,e,`json`,!1,t,`ResultResponse`)}ListWU(e,t){return this._connection.send(`ListWU`,e,`json`,!1,t,`ResultResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`WSSashaPingResponse`)}RestoreWU(e,t){return this._connection.send(`RestoreWU`,e,`json`,!1,t,`ResultResponse`)}},SashaService=class extends SashaServiceBase{},oe=new Date,D=new Date;function newInterval(e,t,n,r){function interval(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return interval.floor=function(t){return e(t=new Date(+t)),t},interval.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},interval.round=function(e){var t=interval(e),n=interval.ceil(e);return e-t<n-e?t:n},interval.offset=function(e,n){return t(e=new Date(+e),n==null?1:Math.floor(n)),e},interval.range=function(n,r,i){var a=[],o;if(n=interval.ceil(n),i=i==null?1:Math.floor(i),!(n<r)||!(i>0))return a;do a.push(o=new Date(+n)),t(n,i),e(n);while(o<n&&n<r);return a},interval.filter=function(n){return newInterval(function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););})},n&&(interval.count=function(t,r){return oe.setTime(+t),D.setTime(+r),e(oe),e(D),Math.floor(n(oe,D))},interval.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?interval.filter(r?function(t){return r(t)%e===0}:function(t){return interval.count(0,t)%e===0}):interval}),interval}var se=6e4,ce=864e5,le=6048e5,O=newInterval(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*se)/ce},function(e){return e.getDate()-1});O.range;function weekday(e){return newInterval(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t*7)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*se)/le})}var ue=weekday(0),k=weekday(1),de=weekday(2),fe=weekday(3),A=weekday(4),pe=weekday(5),me=weekday(6);ue.range,k.range,de.range,fe.range,A.range,pe.range,me.range;var j=newInterval(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});j.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:newInterval(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)})},j.range;var M=newInterval(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/ce},function(e){return e.getUTCDate()-1});M.range;function utcWeekday(e){return newInterval(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t*7)},function(e,t){return(t-e)/le})}var he=utcWeekday(0),N=utcWeekday(1),ge=utcWeekday(2),_e=utcWeekday(3),P=utcWeekday(4),ve=utcWeekday(5),ye=utcWeekday(6);he.range,N.range,ge.range,_e.range,P.range,ve.range,ye.range;var F=newInterval(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});F.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:newInterval(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})},F.range;function localDate(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function utcDate(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function newDate(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function formatLocale(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=formatRe(i),u=formatLookup(i),d=formatRe(a),f=formatLookup(a),p=formatRe(o),m=formatLookup(o),h=formatRe(s),g=formatLookup(s),_=formatRe(c),v=formatLookup(c),y={a:formatShortWeekday,A:formatWeekday,b:formatShortMonth,B:formatMonth,c:null,d:formatDayOfMonth,e:formatDayOfMonth,f:formatMicroseconds,g:formatYearISO,G:formatFullYearISO,H:formatHour24,I:formatHour12,j:formatDayOfYear,L:formatMilliseconds,m:formatMonthNumber,M:formatMinutes,p:formatPeriod,q:formatQuarter,Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatSeconds,u:formatWeekdayNumberMonday,U:formatWeekNumberSunday,V:formatWeekNumberISO,w:formatWeekdayNumberSunday,W:formatWeekNumberMonday,x:null,X:null,y:formatYear,Y:formatFullYear,Z:formatZone,"%":formatLiteralPercent},b={a:formatUTCShortWeekday,A:formatUTCWeekday,b:formatUTCShortMonth,B:formatUTCMonth,c:null,d:formatUTCDayOfMonth,e:formatUTCDayOfMonth,f:formatUTCMicroseconds,g:formatUTCYearISO,G:formatUTCFullYearISO,H:formatUTCHour24,I:formatUTCHour12,j:formatUTCDayOfYear,L:formatUTCMilliseconds,m:formatUTCMonthNumber,M:formatUTCMinutes,p:formatUTCPeriod,q:formatUTCQuarter,Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatUTCSeconds,u:formatUTCWeekdayNumberMonday,U:formatUTCWeekNumberSunday,V:formatUTCWeekNumberISO,w:formatUTCWeekdayNumberSunday,W:formatUTCWeekNumberMonday,x:null,X:null,y:formatUTCYear,Y:formatUTCFullYear,Z:formatUTCZone,"%":formatLiteralPercent},x={a:parseShortWeekday,A:parseWeekday,b:parseShortMonth,B:parseMonth,c:parseLocaleDateTime,d:parseDayOfMonth,e:parseDayOfMonth,f:parseMicroseconds,g:parseYear,G:parseFullYear,H:parseHour24,I:parseHour24,j:parseDayOfYear,L:parseMilliseconds,m:parseMonthNumber,M:parseMinutes,p:parsePeriod,q:parseQuarter,Q:parseUnixTimestamp,s:parseUnixTimestampSeconds,S:parseSeconds,u:parseWeekdayNumberMonday,U:parseWeekNumberSunday,V:parseWeekNumberISO,w:parseWeekdayNumberSunday,W:parseWeekNumberMonday,x:parseLocaleDate,X:parseLocaleTime,y:parseYear,Y:parseFullYear,Z:parseZone,"%":parseLiteralPercent};y.x=newFormat(n,y),y.X=newFormat(r,y),y.c=newFormat(t,y),b.x=newFormat(n,b),b.X=newFormat(r,b),b.c=newFormat(t,b);function newFormat(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=be[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function newParse(e,t){return function(n){var r=newDate(1900,void 0,1),i=parseSpecifier(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=utcDate(newDate(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?N.ceil(a):N(a),a=M.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=localDate(newDate(r.y,0,1)),o=a.getDay(),a=o>4||o===0?k.ceil(a):k(a),a=O.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?utcDate(newDate(r.y,0,1)).getUTCDay():localDate(newDate(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,utcDate(r)):localDate(r)}}function parseSpecifier(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in be?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function parsePeriod(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u[r[0].toLowerCase()],n+r[0].length):-1}function parseShortWeekday(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m[r[0].toLowerCase()],n+r[0].length):-1}function parseWeekday(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f[r[0].toLowerCase()],n+r[0].length):-1}function parseShortMonth(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v[r[0].toLowerCase()],n+r[0].length):-1}function parseMonth(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g[r[0].toLowerCase()],n+r[0].length):-1}function parseLocaleDateTime(e,n,r){return parseSpecifier(e,t,n,r)}function parseLocaleDate(e,t,r){return parseSpecifier(e,n,t,r)}function parseLocaleTime(e,t,n){return parseSpecifier(e,r,t,n)}function formatShortWeekday(e){return o[e.getDay()]}function formatWeekday(e){return a[e.getDay()]}function formatShortMonth(e){return c[e.getMonth()]}function formatMonth(e){return s[e.getMonth()]}function formatPeriod(e){return i[+(e.getHours()>=12)]}function formatQuarter(e){return 1+~~(e.getMonth()/3)}function formatUTCShortWeekday(e){return o[e.getUTCDay()]}function formatUTCWeekday(e){return a[e.getUTCDay()]}function formatUTCShortMonth(e){return c[e.getUTCMonth()]}function formatUTCMonth(e){return s[e.getUTCMonth()]}function formatUTCPeriod(e){return i[+(e.getUTCHours()>=12)]}function formatUTCQuarter(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=newFormat(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=newParse(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=newFormat(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=newParse(e+=``,!0);return t.toString=function(){return e},t}}}var be={"-":``,_:` `,0:`0`},I=/^\s*\d+/,xe=/^%/,Se=/[\\^$*+?|[\]().{}]/g;function pad(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function requote(e){return e.replace(Se,`\\$&`)}function formatRe(e){return RegExp(`^(?:`+e.map(requote).join(`|`)+`)`,`i`)}function formatLookup(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function parseWeekdayNumberSunday(e,t,n){var r=I.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function parseWeekdayNumberMonday(e,t,n){var r=I.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function parseWeekNumberSunday(e,t,n){var r=I.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function parseWeekNumberISO(e,t,n){var r=I.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function parseWeekNumberMonday(e,t,n){var r=I.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function parseFullYear(e,t,n){var r=I.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function parseYear(e,t,n){var r=I.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function parseZone(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function parseQuarter(e,t,n){var r=I.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function parseMonthNumber(e,t,n){var r=I.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function parseDayOfMonth(e,t,n){var r=I.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function parseDayOfYear(e,t,n){var r=I.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function parseHour24(e,t,n){var r=I.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function parseMinutes(e,t,n){var r=I.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function parseSeconds(e,t,n){var r=I.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function parseMilliseconds(e,t,n){var r=I.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function parseMicroseconds(e,t,n){var r=I.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function parseLiteralPercent(e,t,n){var r=xe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function parseUnixTimestamp(e,t,n){var r=I.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function parseUnixTimestampSeconds(e,t,n){var r=I.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function formatDayOfMonth(e,t){return pad(e.getDate(),t,2)}function formatHour24(e,t){return pad(e.getHours(),t,2)}function formatHour12(e,t){return pad(e.getHours()%12||12,t,2)}function formatDayOfYear(e,t){return pad(1+O.count(j(e),e),t,3)}function formatMilliseconds(e,t){return pad(e.getMilliseconds(),t,3)}function formatMicroseconds(e,t){return formatMilliseconds(e,t)+`000`}function formatMonthNumber(e,t){return pad(e.getMonth()+1,t,2)}function formatMinutes(e,t){return pad(e.getMinutes(),t,2)}function formatSeconds(e,t){return pad(e.getSeconds(),t,2)}function formatWeekdayNumberMonday(e){var t=e.getDay();return t===0?7:t}function formatWeekNumberSunday(e,t){return pad(ue.count(j(e)-1,e),t,2)}function dISO(e){var t=e.getDay();return t>=4||t===0?A(e):A.ceil(e)}function formatWeekNumberISO(e,t){return e=dISO(e),pad(A.count(j(e),e)+(j(e).getDay()===4),t,2)}function formatWeekdayNumberSunday(e){return e.getDay()}function formatWeekNumberMonday(e,t){return pad(k.count(j(e)-1,e),t,2)}function formatYear(e,t){return pad(e.getFullYear()%100,t,2)}function formatYearISO(e,t){return e=dISO(e),pad(e.getFullYear()%100,t,2)}function formatFullYear(e,t){return pad(e.getFullYear()%1e4,t,4)}function formatFullYearISO(e,t){var n=e.getDay();return e=n>=4||n===0?A(e):A.ceil(e),pad(e.getFullYear()%1e4,t,4)}function formatZone(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+pad(t/60|0,`0`,2)+pad(t%60,`0`,2)}function formatUTCDayOfMonth(e,t){return pad(e.getUTCDate(),t,2)}function formatUTCHour24(e,t){return pad(e.getUTCHours(),t,2)}function formatUTCHour12(e,t){return pad(e.getUTCHours()%12||12,t,2)}function formatUTCDayOfYear(e,t){return pad(1+M.count(F(e),e),t,3)}function formatUTCMilliseconds(e,t){return pad(e.getUTCMilliseconds(),t,3)}function formatUTCMicroseconds(e,t){return formatUTCMilliseconds(e,t)+`000`}function formatUTCMonthNumber(e,t){return pad(e.getUTCMonth()+1,t,2)}function formatUTCMinutes(e,t){return pad(e.getUTCMinutes(),t,2)}function formatUTCSeconds(e,t){return pad(e.getUTCSeconds(),t,2)}function formatUTCWeekdayNumberMonday(e){var t=e.getUTCDay();return t===0?7:t}function formatUTCWeekNumberSunday(e,t){return pad(he.count(F(e)-1,e),t,2)}function UTCdISO(e){var t=e.getUTCDay();return t>=4||t===0?P(e):P.ceil(e)}function formatUTCWeekNumberISO(e,t){return e=UTCdISO(e),pad(P.count(F(e),e)+(F(e).getUTCDay()===4),t,2)}function formatUTCWeekdayNumberSunday(e){return e.getUTCDay()}function formatUTCWeekNumberMonday(e,t){return pad(N.count(F(e)-1,e),t,2)}function formatUTCYear(e,t){return pad(e.getUTCFullYear()%100,t,2)}function formatUTCYearISO(e,t){return e=UTCdISO(e),pad(e.getUTCFullYear()%100,t,2)}function formatUTCFullYear(e,t){return pad(e.getUTCFullYear()%1e4,t,4)}function formatUTCFullYearISO(e,t){var n=e.getUTCDay();return e=n>=4||n===0?P(e):P.ceil(e),pad(e.getUTCFullYear()%1e4,t,4)}function formatUTCZone(){return`+0000`}function formatLiteralPercent(){return`%`}function formatUnixTimestamp(e){return+e}function formatUnixTimestampSeconds(e){return Math.floor(e/1e3)}var L,Ce,we,Te;defaultLocale$1({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 defaultLocale$1(e){return L=formatLocale(e),L.format,Ce=L.parse,we=L.utcFormat,Te=L.utcParse,L}__name(defaultLocale$1,`defaultLocale`);var Ee;(function(e){e.LockModes=function(e){return e.ALL=`ALL`,e.READ=`READ`,e.WRITE=`WRITE`,e.HOLD=`HOLD`,e.SUB=`SUB`,e}({}),e.RoxieControlCmdType=function(e){return e.Attach=`Attach`,e.Detach=`Detach`,e.State=`State`,e.Reload=`Reload`,e.ReloadRetry=`ReloadRetry`,e.MemLock=`MemLock`,e.MemUnlock=`MemUnlock`,e.GetMemLocked=`GetMemLocked`,e}({})})(Ee||={});var SMCServiceBase=class extends Service{constructor(e){super(e,`WsSMC`,`1.29`)}Activity(e){return this._connection.send(`Activity`,e,`json`,!1,void 0,`ActivityResponse`)}BrowseResources(e){return this._connection.send(`BrowseResources`,e,`json`,!1,void 0,`BrowseResourcesResponse`)}ClearQueue(e){return this._connection.send(`ClearQueue`,e,`json`,!1,void 0,`SMCQueueResponse`)}GetBuildInfo(e){return this._connection.send(`GetBuildInfo`,e,`json`,!1,void 0,`GetBuildInfoResponse`)}GetGlobalMetrics(e){return this._connection.send(`GetGlobalMetrics`,e,`json`,!1,void 0,`GetGlobalMetricsResponse`)}GetStatusServerInfo(e){return this._connection.send(`GetStatusServerInfo`,e,`json`,!1,void 0,`GetStatusServerInfoResponse`)}GetThorQueueAvailability(e){return this._connection.send(`GetThorQueueAvailability`,e,`json`,!1,void 0,`GetThorQueueAvailabilityResponse`)}Index(e){return this._connection.send(`Index`,e,`json`,!1,void 0,`SMCIndexResponse`)}LockQuery(e){return this._connection.send(`LockQuery`,e,`json`,!1,void 0,`LockQueryResponse`)}MoveJobBack(e){return this._connection.send(`MoveJobBack`,e,`json`,!1,void 0,`SMCJobResponse`)}MoveJobDown(e){return this._connection.send(`MoveJobDown`,e,`json`,!1,void 0,`SMCJobResponse`)}MoveJobFront(e){return this._connection.send(`MoveJobFront`,e,`json`,!1,void 0,`SMCJobResponse`)}MoveJobUp(e){return this._connection.send(`MoveJobUp`,e,`json`,!1,void 0,`SMCJobResponse`)}NotInCommunityEdition(e){return this._connection.send(`NotInCommunityEdition`,e,`json`,!1,void 0,`NotInCommunityEditionResponse`)}PauseQueue(e){return this._connection.send(`PauseQueue`,e,`json`,!1,void 0,`SMCQueueResponse`)}Ping(e){return this._connection.send(`Ping`,e,`json`,!1,void 0,`WsSMCPingResponse`)}RecordGlobalMetrics(e){return this._connection.send(`RecordGlobalMetrics`,e,`json`,!1,void 0,`RecordGlobalMetricsResponse`)}RemoveJob(e){return this._connection.send(`RemoveJob`,e,`json`,!1,void 0,`SMCJobResponse`)}ResumeQueue(e){return this._connection.send(`ResumeQueue`,e,`json`,!1,void 0,`SMCQueueResponse`)}RoxieControlCmd(e){return this._connection.send(`RoxieControlCmd`,e,`json`,!1,void 0,`RoxieControlCmdResponse`)}RoxieXrefCmd(e){return this._connection.send(`RoxieXrefCmd`,e,`json`,!1,void 0,`RoxieXrefCmdResponse`)}SetBanner(e){return this._connection.send(`SetBanner`,e,`json`,!1,void 0,`SetBannerResponse`)}SetJobPriority(e){return this._connection.send(`SetJobPriority`,e,`json`,!1,void 0,`SMCPriorityResponse`)}StopQueue(e){return this._connection.send(`StopQueue`,e,`json`,!1,void 0,`SMCQueueResponse`)}},De=Ce(`%Y%m%d%H`);function isNumeric(e){return typeof e==`number`||typeof e==`string`&&e.trim()!==``&&!isNaN(+e)}var SMCService=class extends SMCServiceBase{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(e=>({Running:{ActiveWorkunit:[]},...e}))}parseGlobalMetric(e,t){return e.startsWith(`Cost`)?t/1e6:e.startsWith(`Date`)?De(t):e.startsWith(`Num`)?+t:e.startsWith(`Time`)?t/1e9:e.startsWith(`When`)?new Date(t/1e3).toISOString():isNumeric(t)?+t:t}GetNormalisedGlobalMetrics(e){return super.GetGlobalMetrics(e).then(e=>{let t=[];for(let n of e?.GlobalMetrics?.GlobalMetric||[]){let e={Category:n.Category,Start:this.parseGlobalMetric(`Date`,n.DateTimeRange?.Start),End:this.parseGlobalMetric(`Date`,n.DateTimeRange?.End),dimensions:{},stats:{}};for(let t of n.Dimensions?.Dimension||[])e.dimensions[t.Name]=t.Value;for(let t of n.Stats?.Stat||[])e.stats[t.Name]=this.parseGlobalMetric(t.Name,t.Value);t.push(e)}return t})}},storeServiceBase=class extends Service{constructor(e){super(e,`wsstore`,`1.02`)}CreateStore(e,t){return this._connection.send(`CreateStore`,e,`json`,!1,t,`CreateStoreResponse`)}Delete(e,t){return this._connection.send(`Delete`,e,`json`,!1,t,`DeleteResponse`)}DeleteNamespace(e,t){return this._connection.send(`DeleteNamespace`,e,`json`,!1,t,`DeleteNamespaceResponse`)}Fetch(e,t){return this._connection.send(`Fetch`,e,`json`,!1,t,`FetchResponse`)}FetchAll(e,t){return this._connection.send(`FetchAll`,e,`json`,!1,t,`FetchAllResponse`)}FetchKeyMetadata(e,t){return this._connection.send(`FetchKeyMetadata`,e,`json`,!1,t,`FetchKeyMDResponse`)}ListKeys(e,t){return this._connection.send(`ListKeys`,e,`json`,!1,t,`ListKeysResponse`)}ListNamespaces(e,t){return this._connection.send(`ListNamespaces`,e,`json`,!1,t,`ListNamespacesResponse`)}ListStores(e,t){return this._connection.send(`ListStores`,e,`json`,!1,t,`ListStoresResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`wsstorePingResponse`)}Set(e,t){return this._connection.send(`Set`,e,`json`,!1,t,`SetResponse`)}},StoreService=class extends storeServiceBase{Delete(e){return super.Delete(e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>e.Code===-1))return{Exceptions:void 0,Success:!0};throw e})}Fetch(e){return super.Fetch(e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>e.Code===-1))return{Exceptions:void 0,Value:void 0};throw e})}},Oe;(function(e){e.TpConfigResponseFormat=function(e){return e.XML=`XML`,e.YAML=`YAML`,e}({}),e.RoxieQueueFilter=function(e){return e.All=`All`,e.QueriesOnly=`QueriesOnly`,e.WorkunitsOnly=`WorkunitsOnly`,e}({}),e.TpMachineType=function(e){return e.ALLNODES=`ALLNODES`,e.THORMACHINES=`THORMACHINES`,e.HOLEMACHINES=`HOLEMACHINES`,e.ROXIEMACHINES=`ROXIEMACHINES`,e.MACHINES=`MACHINES`,e.AVAILABLEMACHINES=`AVAILABLEMACHINES`,e.DROPZONE=`DROPZONE`,e.STANDBYNNODE=`STANDBYNNODE`,e.THORSPARENODES=`THORSPARENODES`,e.HOLESTANDBYNODES=`HOLESTANDBYNODES`,e}({})})(Oe||={});var TopologyServiceBase=class extends Service{constructor(e){super(e,`WsTopology`,`1.33`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`WsTopologyPingResponse`)}SystemLog(e,t){return this._connection.send(`SystemLog`,e,`json`,!1,t,`SystemLogResponse`)}TpClusterInfo(e,t){return this._connection.send(`TpClusterInfo`,e,`json`,!1,t,`TpClusterInfoResponse`)}TpClusterQuery(e,t){return this._connection.send(`TpClusterQuery`,e,`json`,!1,t,`TpClusterQueryResponse`)}TpComponentConfiguration(e,t){return this._connection.send(`TpComponentConfiguration`,e,`json`,!1,t,`TpComponentConfigurationResponse`)}TpConfiguredComponents(e,t){return this._connection.send(`TpConfiguredComponents`,e,`json`,!1,t,`TpConfiguredComponentsResponse`)}TpDropZoneQuery(e,t){return this._connection.send(`TpDropZoneQuery`,e,`json`,!1,t,`TpDropZoneQueryResponse`)}TpGetComponentFile(e,t){return this._connection.send(`TpGetComponentFile`,e,`json`,!1,t,`TpGetComponentFileResponse`)}TpGetServicePlugins(e,t){return this._connection.send(`TpGetServicePlugins`,e,`json`,!1,t,`TpGetServicePluginsResponse`)}TpGroupQuery(e,t){return this._connection.send(`TpGroupQuery`,e,`json`,!1,t,`TpGroupQueryResponse`)}TpListLogFiles(e,t){return this._connection.send(`TpListLogFiles`,e,`json`,!1,t,`TpListLogFilesResponse`)}TpListTargetClusters(e,t){return this._connection.send(`TpListTargetClusters`,e,`json`,!1,t,`TpListTargetClustersResponse`)}TpLogFile(e,t){return this._connection.send(`TpLogFile`,e,`json`,!1,t,`TpLogFileResponse`)}TpLogFileDisplay(e,t){return this._connection.send(`TpLogFileDisplay`,e,`json`,!1,t,`TpLogFileResponse`)}TpLogicalClusterQuery(e,t){return this._connection.send(`TpLogicalClusterQuery`,e,`json`,!1,t,`TpLogicalClusterQueryResponse`)}TpMachineInfo(e,t){return this._connection.send(`TpMachineInfo`,e,`json`,!1,t,`TpMachineInfoResponse`)}TpMachineQuery(e,t){return this._connection.send(`TpMachineQuery`,e,`json`,!1,t,`TpMachineQueryResponse`)}TpServiceQuery(e,t){return this._connection.send(`TpServiceQuery`,e,`json`,!1,t,`TpServiceQueryResponse`)}TpSetMachineStatus(e,t){return this._connection.send(`TpSetMachineStatus`,e,`json`,!1,t,`TpSetMachineStatusResponse`)}TpSwapNode(e,t){return this._connection.send(`TpSwapNode`,e,`json`,!1,t,`TpSwapNodeResponse`)}TpTargetClusterQuery(e,t){return this._connection.send(`TpTargetClusterQuery`,e,`json`,!1,t,`TpTargetClusterQueryResponse`)}TpThorStatus(e,t){return this._connection.send(`TpThorStatus`,e,`json`,!1,t,`TpThorStatusResponse`)}TpXMLFile(e,t){return this._connection.send(`TpXMLFile`,e,`json`,!1,t,`TpXMLFileResponse`)}},TopologyService=class extends TopologyServiceBase{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(e=>{if(e.default)return e.default;let t,n;return e.TpLogicalClusters.TpLogicalCluster.some((e,r)=>(r===0&&(n=e),e.Type===`hthor`&&(t=e,!0))),t||n})}},R;(function(e){e.ECLWUActions=function(e){return e.Abort=`Abort`,e.Delete=`Delete`,e.Deschedule=`Deschedule`,e.Reschedule=`Reschedule`,e.Pause=`Pause`,e.PauseNow=`PauseNow`,e.Protect=`Protect`,e.Unprotect=`Unprotect`,e.Restore=`Restore`,e.Resume=`Resume`,e.SetToFailed=`SetToFailed`,e.Archive=`Archive`,e}({}),e.LogSelectColumnMode=function(e){return e[e.MIN=0]=`MIN`,e[e.DEFAULT=1]=`DEFAULT`,e[e.ALL=2]=`ALL`,e[e.CUSTOM=3]=`CUSTOM`,e}({}),e.SortDirection=function(e){return e[e.ASC=0]=`ASC`,e[e.DSC=1]=`DSC`,e}({}),e.LogEventClass=function(e){return e.ALL=`ALL`,e.DIS=`DIS`,e.ERR=`ERR`,e.WRN=`WRN`,e.INF=`INF`,e.PRO=`PRO`,e.MET=`MET`,e.EVT=`EVT`,e}({}),e.WUDetailsAttrValueType=function(e){return e.Single=`Single`,e.List=`List`,e.Multi=`Multi`,e}({}),e.EclDefinitionActions=function(e){return e.SyntaxCheck=`SyntaxCheck`,e.Deploy=`Deploy`,e.Publish=`Publish`,e}({}),e.ErrorMessageFormat=function(e){return e.xml=`xml`,e.json=`json`,e.text=`text`,e}({}),e.LogAccessLogFormat=function(e){return e[e.XML=0]=`XML`,e[e.JSON=1]=`JSON`,e[e.CSV=2]=`CSV`,e}({}),e.WUExceptionSeverity=function(e){return e.info=`info`,e.warning=`warning`,e.error=`error`,e.alert=`alert`,e}({}),e.WUFileDownloadOption=function(e){return e[e.OriginalText=0]=`OriginalText`,e[e.Attachment=1]=`Attachment`,e[e.ZIP=2]=`ZIP`,e[e.GZIP=3]=`GZIP`,e}({}),e.WUFileType=function(e){return e.XML=`XML`,e.cpp=`cpp`,e.dll=`dll`,e.res=`res`,e.log=`log`,e.WUECL=`WUECL`,e.ThorLog=`ThorLog`,e.ThorSlaveLog=`ThorSlaveLog`,e.EclAgentLog=`EclAgentLog`,e.ArchiveQuery=`ArchiveQuery`,e.ComponentLog=`ComponentLog`,e.PostMortem=`PostMortem`,e}({}),e.WUQueryFilterSuspendedType=function(e){return e.Allqueries=`All queries`,e.Notsuspended=`Not suspended`,e.Suspended=`Suspended`,e.Suspendedbyuser=`Suspended by user`,e.Suspendedbyfirstnode=`Suspended by first node`,e.Suspendedbyanynode=`Suspended by any node`,e}({}),e.WUQuerySetFilterType=function(e){return e.All=`All`,e.Id=`Id`,e.Name=`Name`,e.Alias=`Alias`,e.Status=`Status`,e}({}),e.WUProtectFilter=function(e){return e.All=`All`,e.Protected=`Protected`,e.NotProtected=`NotProtected`,e}({}),e.QuerySetAliasActionTypes=function(e){return e.Deactivate=`Deactivate`,e}({}),e.QuerysetImportActivation=function(e){return e.None=`None`,e.ActivateImportedActive=`ActivateImportedActive`,e}({}),e.QuerySetQueryActionTypes=function(e){return e.Suspend=`Suspend`,e.Unsuspend=`Unsuspend`,e.ToggleSuspend=`ToggleSuspend`,e.Activate=`Activate`,e.Delete=`Delete`,e.DeleteQueriesAndWUs=`DeleteQueriesAndWUs`,e.RemoveAllAliases=`RemoveAllAliases`,e.ResetQueryStats=`ResetQueryStats`,e}({}),e.WUQueryActivationMode=function(e){return e[e.DoNotActivateQuery=0]=`DoNotActivateQuery`,e[e.ActivateQuery=1]=`ActivateQuery`,e[e.ActivateQuerySuspendPrevious=2]=`ActivateQuerySuspendPrevious`,e[e.ActivateQueryDeletePrevious=3]=`ActivateQueryDeletePrevious`,e}({})})(R||={});var WorkunitsServiceBase=class extends Service{constructor(e){super(e,`WsWorkunits`,`2.10`)}GVCAjaxGraph(e,t){return this._connection.send(`GVCAjaxGraph`,e,`json`,!1,t,`GVCAjaxGraphResponse`)}Ping(e,t){return this._connection.send(`Ping`,e,`json`,!1,t,`WsWorkunitsPingResponse`)}WUAbort(e,t){return this._connection.send(`WUAbort`,e,`json`,!1,t,`WUAbortResponse`)}WUAction(e,t){return this._connection.send(`WUAction`,e,`json`,!1,t,`WUActionResponse`)}WUAddLocalFileToWorkunit(e,t){return this._connection.send(`WUAddLocalFileToWorkunit`,e,`json`,!1,t,`WUAddLocalFileToWorkunitResponse`)}WUAnalyseHotspot(e,t){return this._connection.send(`WUAnalyseHotspot`,e,`json`,!1,t,`WUAnalyseHotspotResponse`)}WUCDebug(e,t){return this._connection.send(`WUCDebug`,e,`json`,!1,t,`WUDebugResponse`)}WUCheckFeatures(e,t){return this._connection.send(`WUCheckFeatures`,e,`json`,!1,t,`WUCheckFeaturesResponse`)}WUClusterJobQueueLOG(e,t){return this._connection.send(`WUClusterJobQueueLOG`,e,`json`,!1,t,`WUClusterJobQueueLOGResponse`)}WUClusterJobQueueXLS(e,t){return this._connection.send(`WUClusterJobQueueXLS`,e,`json`,!1,t,`WUClusterJobQueueXLSResponse`)}WUClusterJobSummaryXLS(e,t){return this._connection.send(`WUClusterJobSummaryXLS`,e,`json`,!1,t,`WUClusterJobSummaryXLSResponse`)}WUClusterJobXLS(e,t){return this._connection.send(`WUClusterJobXLS`,e,`json`,!1,t,`WUClusterJobXLSResponse`)}WUCompileECL(e,t){return this._connection.send(`WUCompileECL`,e,`json`,!1,t,`WUCompileECLResponse`)}WUCopyLogicalFiles(e,t){return this._connection.send(`WUCopyLogicalFiles`,e,`json`,!1,t,`WUCopyLogicalFilesResponse`)}WUCopyQuerySet(e,t){return this._connection.send(`WUCopyQuerySet`,e,`json`,!1,t,`WUCopyQuerySetResponse`)}WUCreate(e,t){return this._connection.send(`WUCreate`,e,`json`,!1,t,`WUCreateResponse`)}WUCreateAndUpdate(e,t){return this._connection.send(`WUCreateAndUpdate`,e,`json`,!1,t,`WUUpdateResponse`)}WUCreateZAPInfo(e,t){return this._connection.send(`WUCreateZAPInfo`,e,`json`,!1,t,`WUCreateZAPInfoResponse`)}WUDelete(e,t){return this._connection.send(`WUDelete`,e,`json`,!1,t,`WUDeleteResponse`)}WUDeployWorkunit(e,t){return this._connection.send(`WUDeployWorkunit`,e,`json`,!1,t,`WUDeployWorkunitResponse`)}WUDetails(e,t){return this._connection.send(`WUDetails`,e,`json`,!1,t,`WUDetailsResponse`)}WUDetailsMeta(e,t){return this._connection.send(`WUDetailsMeta`,e,`json`,!1,t,`WUDetailsMetaResponse`)}WUEclDefinitionAction(e,t){return this._connection.send(`WUEclDefinitionAction`,e,`json`,!1,t,`WUEclDefinitionActionResponse`)}WUExport(e,t){return this._connection.send(`WUExport`,e,`json`,!1,t,`WUExportResponse`)}WUFile(e,t){return this._connection.send(`WUFile`,e,`json`,!1,t,`WULogFileResponse`)}WUFullResult(e,t){return this._connection.send(`WUFullResult`,e,`json`,!1,t,`WUFullResultResponse`)}WUGVCGraphInfo(e,t){return this._connection.send(`WUGVCGraphInfo`,e,`json`,!1,t,`WUGVCGraphInfoResponse`)}WUGetArchiveFile(e,t){return this._connection.send(`WUGetArchiveFile`,e,`json`,!1,t,`WUGetArchiveFileResponse`)}WUGetDependancyTrees(e,t){return this._connection.send(`WUGetDependancyTrees`,e,`json`,!1,t,`WUGetDependancyTreesResponse`)}WUGetGraph(e,t){return this._connection.send(`WUGetGraph`,e,`json`,!1,t,`WUGetGraphResponse`)}WUGetGraphNameAndTypes(e,t){return this._connection.send(`WUGetGraphNameAndTypes`,e,`json`,!1,t,`WUGetGraphNameAndTypesResponse`)}WUGetNumFileToCopy(e,t){return this._connection.send(`WUGetNumFileToCopy`,e,`json`,!1,t,`WUGetNumFileToCopyResponse`)}WUGetPlugins(e,t){return this._connection.send(`WUGetPlugins`,e,`json`,!1,t,`WUGetPluginsResponse`)}WUGetStats(e,t){return this._connection.send(`WUGetStats`,e,`json`,!1,t,`WUGetStatsResponse`)}WUGetThorJobList(e,t){return this._connection.send(`WUGetThorJobList`,e,`json`,!1,t,`WUGetThorJobListResponse`)}WUGetThorJobQueue(e,t){return this._connection.send(`WUGetThorJobQueue`,e,`json`,!1,t,`WUGetThorJobQueueResponse`)}WUGetZAPInfo(e,t){return this._connection.send(`WUGetZAPInfo`,e,`json`,!1,t,`WUGetZAPInfoResponse`)}WUGraphInfo(e,t){return this._connection.send(`WUGraphInfo`,e,`json`,!1,t,`WUGraphInfoResponse`)}WUGraphTiming(e,t){return this._connection.send(`WUGraphTiming`,e,`json`,!1,t,`WUGraphTimingResponse`)}WUHelperFileArchive(e,t){return this._connection.send(`WUHelperFileArchive`,e,`json`,!1,t,`WUHelperFileArchiveResponse`)}WUInfo(e,t){return this._connection.send(`WUInfo`,e,`json`,!1,t,`WUInfoResponse`)}WUInfoDetails(e,t){return this._connection.send(`WUInfoDetails`,e,`json`,!1,t,`WUInfoResponse`)}WUJobList(e,t){return this._connection.send(`WUJobList`,e,`json`,!1,t,`WUJobListResponse`)}WULightWeightQuery(e,t){return this._connection.send(`WULightWeightQuery`,e,`json`,!1,t,`WULightWeightQueryResponse`)}WUListArchiveFiles(e,t){return this._connection.send(`WUListArchiveFiles`,e,`json`,!1,t,`WUListArchiveFilesResponse`)}WUListLocalFileRequired(e,t){return this._connection.send(`WUListLocalFileRequired`,e,`json`,!1,t,`WUListLocalFileRequiredResponse`)}WUListQueries(e,t){return this._connection.send(`WUListQueries`,e,`json`,!1,t,`WUListQueriesResponse`)}WUListQueriesUsingFile(e,t){return this._connection.send(`WUListQueriesUsingFile`,e,`json`,!1,t,`WUListQueriesUsingFileResponse`)}WUMultiQuerysetDetails(e,t){return this._connection.send(`WUMultiQuerysetDetails`,e,`json`,!1,t,`WUMultiQuerySetDetailsResponse`)}WUProcessGraph(e,t){return this._connection.send(`WUProcessGraph`,e,`json`,!1,t,`WUProcessGraphResponse`)}WUProtect(e,t){return this._connection.send(`WUProtect`,e,`json`,!1,t,`WUProtectResponse`)}WUPublishWorkunit(e,t){return this._connection.send(`WUPublishWorkunit`,e,`json`,!1,t,`WUPublishWorkunitResponse`)}WUPushEvent(e,t){return this._connection.send(`WUPushEvent`,e,`json`,!1,t,`WUPushEventResponse`)}WUQuery(e,t){return this._connection.send(`WUQuery`,e,`json`,!1,t,`WUQueryResponse`)}WUQueryConfig(e,t){return this._connection.send(`WUQueryConfig`,e,`json`,!1,t,`WUQueryConfigResponse`)}WUQueryDetails(e,t){return this._connection.send(`WUQueryDetails`,e,`json`,!1,t,`WUQueryDetailsResponse`)}WUQueryDetailsLightWeight(e,t){return this._connection.send(`WUQueryDetailsLightWeight`,e,`json`,!1,t,`WUQueryDetailsResponse`)}WUQueryFiles(e,t){return this._connection.send(`WUQueryFiles`,e,`json`,!1,t,`WUQueryFilesResponse`)}WUQueryGetGraph(e,t){return this._connection.send(`WUQueryGetGraph`,e,`json`,!1,t,`WUQueryGetGraphResponse`)}WUQueryGetSummaryStats(e,t){return this._connection.send(`WUQueryGetSummaryStats`,e,`json`,!1,t,`WUQueryGetSummaryStatsResponse`)}WUQuerysetAliasAction(e,t){return this._connection.send(`WUQuerysetAliasAction`,e,`json`,!1,t,`WUQuerySetAliasActionResponse`)}WUQuerysetCopyQuery(e,t){return this._connection.send(`WUQuerysetCopyQuery`,e,`json`,!1,t,`WUQuerySetCopyQueryResponse`)}WUQuerysetDetails(e,t){return this._connection.send(`WUQuerysetDetails`,e,`json`,!1,t,`WUQuerySetDetailsResponse`)}WUQuerysetExport(e,t){return this._connection.send(`WUQuerysetExport`,e,`json`,!1,t,`WUQuerysetExportResponse`)}WUQuerysetImport(e,t){return this._connection.send(`WUQuerysetImport`,e,`json`,!1,t,`WUQuerysetImportResponse`)}WUQuerysetQueryAction(e,t){return this._connection.send(`WUQuerysetQueryAction`,e,`json`,!1,t,`WUQuerySetQueryActionResponse`)}WUQuerysets(e,t){return this._connection.send(`WUQuerysets`,e,`json`,!1,t,`WUQuerysetsResponse`)}WURecreateQuery(e,t){return this._connection.send(`WURecreateQuery`,e,`json`,!1,t,`WURecreateQueryResponse`)}WUResubmit(e,t){return this._connection.send(`WUResubmit`,e,`json`,!1,t,`WUResubmitResponse`)}WUResult(e,t){return this._connection.send(`WUResult`,e,`json`,!1,t,`WUResultResponse`)}WUResultBin(e,t){return this._connection.send(`WUResultBin`,e,`json`,!1,t,`WUResultBinResponse`)}WUResultSummary(e,t){return this._connection.send(`WUResultSummary`,e,`json`,!1,t,`WUResultSummaryResponse`)}WUResultView(e,t){return this._connection.send(`WUResultView`,e,`json`,!1,t,`WUResultViewResponse`)}WURun(e,t){return this._connection.send(`WURun`,e,`json`,!1,t,`WURunResponse`)}WUSchedule(e,t){return this._connection.send(`WUSchedule`,e,`json`,!1,t,`WUScheduleResponse`)}WUShowScheduled(e,t){return this._connection.send(`WUShowScheduled`,e,`json`,!1,t,`WUShowScheduledResponse`)}WUSubmit(e,t){return this._connection.send(`WUSubmit`,e,`json`,!1,t,`WUSubmitResponse`)}WUSyntaxCheckECL(e,t){return this._connection.send(`WUSyntaxCheckECL`,e,`json`,!1,t,`WUSyntaxCheckResponse`)}WUUpdate(e,t){return this._connection.send(`WUUpdate`,e,`json`,!1,t,`WUUpdateResponse`)}WUUpdateQueryEntry(e,t){return this._connection.send(`WUUpdateQueryEntry`,e,`json`,!1,t,`WUUpdateQueryEntryResponse`)}WUWaitCompiled(e,t){return this._connection.send(`WUWaitCompiled`,e,`json`,!1,t,`WUWaitResponse`)}WUWaitComplete(e,t){return this._connection.send(`WUWaitComplete`,e,`json`,!1,t,`WUWaitResponse`)}},z=function(e){return e[e.Unknown=0]=`Unknown`,e[e.Compiled=1]=`Compiled`,e[e.Running=2]=`Running`,e[e.Completed=3]=`Completed`,e[e.Failed=4]=`Failed`,e[e.Archived=5]=`Archived`,e[e.Aborting=6]=`Aborting`,e[e.Aborted=7]=`Aborted`,e[e.Blocked=8]=`Blocked`,e[e.Submitted=9]=`Submitted`,e[e.Scheduled=10]=`Scheduled`,e[e.Compiling=11]=`Compiling`,e[e.Wait=12]=`Wait`,e[e.UploadingFiled=13]=`UploadingFiled`,e[e.DebugPaused=14]=`DebugPaused`,e[e.DebugRunning=15]=`DebugRunning`,e[e.Paused=16]=`Paused`,e[e.LAST=17]=`LAST`,e[e.NotFound=999]=`NotFound`,e}({}),B;(function(e){e.Action=function(e){return e[e.Unknown=0]=`Unknown`,e[e.Compile=1]=`Compile`,e[e.Check=2]=`Check`,e[e.Run=3]=`Run`,e[e.ExecuteExisting=4]=`ExecuteExisting`,e[e.Pause=5]=`Pause`,e[e.PauseNow=6]=`PauseNow`,e[e.Resume=7]=`Resume`,e[e.Debug=8]=`Debug`,e[e.__size=9]=`__size`,e}({})})(B||={});function isECLResult(e){return typeof e.Name==`string`}function isWUQueryECLWorkunit(e){return e.TotalClusterTime!==void 0}function isWUInfoWorkunit(e){return e.StateEx!==void 0}var WorkunitsService=class extends WorkunitsServiceBase{constructor(e){super(e)}Ping(){return this._connection.send(`Ping`,{},`json`,!1,void 0,`WsWorkunitsPingResponse`).then(()=>({result:!0}))}WUQuery(e={},n){return this._connection.send(`WUQuery`,e,`json`,!1,n).then(e=>(0,t.deepMixin)({Workunits:{ECLWorkunit:[]}},e))}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||=super.WUDetailsMeta(e),this._WUDetailsMetaPromise}WUCDebugEx(e){return this._connection.send(`WUCDebug`,e,void 0,void 0,void 0,`WUDebug`).then(e=>{let n=(0,t.xml2json)(e.Result).children();return n.length?n[0]:null})}},WorkunitsServiceEx=class extends WorkunitsServiceBase{WUPublishWorkunitEx(e){return this._connection.send(`WUPublishWorkunit`,e)}};function formatDecimal_default(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}__name(formatDecimal_default,`default`);function formatDecimalParts(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function exponent_default(e){return e=formatDecimalParts(Math.abs(e)),e?e[1]:NaN}__name(exponent_default,`default`);function formatGroup_default(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}__name(formatGroup_default,`default`);function formatNumerals_default(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}__name(formatNumerals_default,`default`);var ke=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(e){if(!(t=ke.exec(e)))throw Error(`invalid format: `+e);var t;return new FormatSpecifier({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}formatSpecifier.prototype=FormatSpecifier.prototype;function FormatSpecifier(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}FormatSpecifier.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 formatTrim_default(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}__name(formatTrim_default,`default`);var Ae;function formatPrefixAuto_default(e,t){var n=formatDecimalParts(e,t);if(!n)return e+``;var r=n[0],i=n[1],a=i-(Ae=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+formatDecimalParts(e,Math.max(0,t+a-1))[0]}__name(formatPrefixAuto_default,`default`);function formatRounded_default(e,t){var n=formatDecimalParts(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}__name(formatRounded_default,`default`);var je={"%":function(e,t){return(e*100).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+``},d:formatDecimal_default,e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return formatRounded_default(e*100,t)},r:formatRounded_default,s:formatPrefixAuto_default,X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function identity_default(e){return e}__name(identity_default,`default`);var Me=Array.prototype.map,Ne=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function locale_default(e){var t=e.grouping===void 0||e.thousands===void 0?identity_default:formatGroup_default(Me.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?identity_default:formatNumerals_default(Me.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`-`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function newFormat(e){e=formatSpecifier(e);var l=e.fill,u=e.align,d=e.sign,f=e.symbol,p=e.zero,m=e.width,h=e.comma,g=e.precision,_=e.trim,v=e.type;v===`n`?(h=!0,v=`g`):je[v]||(g===void 0&&(g=12),_=!0,v=`g`),(p||l===`0`&&u===`=`)&&(p=!0,l=`0`,u=`=`);var y=f===`$`?n:f===`#`&&/[boxX]/.test(v)?`0`+v.toLowerCase():``,b=f===`$`?r:/[%p]/.test(v)?o:``,x=je[v],S=/[defgprs%]/.test(v);g=g===void 0?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g));function format(e){var n=y,r=b,o,f,C;if(v===`c`)r=x(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:x(Math.abs(e),g),_&&(e=formatTrim_default(e)),w&&+e==0&&d!==`+`&&(w=!1),n=(w?d===`(`?d:s:d===`-`||d===`(`?``:d)+n,r=(v===`s`?Ne[8+Ae/3]:``)+r+(w&&d===`(`?`)`:``),S){for(o=-1,f=e.length;++o<f;)if(C=e.charCodeAt(o),48>C||C>57){r=(C===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}h&&!p&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<m?Array(m-T+1).join(l):``;switch(h&&p&&(e=t(E+e,E.length?m-r.length:1/0),E=``),u){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r}return a(e)}return format.toString=function(){return e+``},format}function formatPrefix(e,t){var n=newFormat((e=formatSpecifier(e),e.type=`f`,e)),r=Math.max(-8,Math.min(8,Math.floor(exponent_default(t)/3)))*3,i=10**-r,a=Ne[8+r/3];return function(e){return n(i*e)+a}}return{format:newFormat,formatPrefix}}__name(locale_default,`default`);var V,H;defaultLocale({decimal:`.`,thousands:`,`,grouping:[3],currency:[`$`,``],minus:`-`});function defaultLocale(e){return V=locale_default(e),H=V.format,V.formatPrefix,V}var ECLGraph=class extends t.StateObject{wu;get properties(){return this.get()}get Name(){return this.get(`Name`)}get Label(){return this.get(`Label`)}get Type(){return this.get(`Type`)}get Complete(){return this.get(`Complete`)}get WhenStarted(){return this.get(`WhenStarted`)}get WhenFinished(){return this.get(`WhenFinished`)}get Time(){return this.get(`Time`)}get Running(){return this.get(`Running`)}get RunningId(){return this.get(`RunningId`)}get Failed(){return this.get(`Failed`)}constructor(e,t,n){super(),this.wu=e;let r=0;for(let e of n)if(e.GraphName===t.Name&&!e.HasSubGraphId){r=Math.round(e.Seconds*1e3)/1e3;break}this.set({Time:r,...t})}fetchScopeGraph(e){return e?this.wu.fetchGraphDetails([e],[`subgraph`]).then(e=>createGraph(e)):this.wu.fetchGraphDetails([this.Name],[`graph`]).then(e=>createGraph(e))}},GraphCache=class extends t.Cache{constructor(){super(e=>t.Cache.hash([e.Name]))}};function walkXmlJson(e,t,n){n||=[],n.push(e),t(e.name,e.$,e.children(),n),e.children().forEach(e=>{walkXmlJson(e,t,n)}),n.pop()}function flattenAtt(e){let t={};return e.forEach(e=>{e.name===`att`&&(t[e.$.name]=e.$.value)}),t}var XGMMLGraph=class extends t.Graph{},XGMMLSubgraph=class extends t.Subgraph{},XGMMLVertex=class extends t.Vertex{},XGMMLEdge=class extends t.Edge{};function createXGMMLGraph(e,t){let n={},r={},i={},a=new XGMMLGraph(e=>e._.id),o=[a.root];return walkXmlJson(t,(e,t,a,s)=>{let c=o[o.length-1];switch(e){case`graph`:break;case`node`:if(a.length&&a[0].children().length&&a[0].children()[0].name===`graph`){let e=c.createSubgraph(flattenAtt(a));o.push(e),n[t.id]=e}let e=c.createVertex(flattenAtt(a));r[t.id]=e;break;case`edge`:let s=c.createEdge(r[t.source],r[t.target],flattenAtt(a));i[t.id]=s}}),a}var ScopeGraph=class extends t.Graph{},ScopeSubgraph=class extends t.Subgraph{},ScopeVertex=class extends t.Vertex{},ScopeEdge=class extends t.Edge{};function createGraph(e){let t={},n={},r={},i;for(let a of e)switch(a.ScopeType){case`graph`:i=new ScopeGraph(e=>e._.Id,a),t[a.ScopeName]=i.root;break;case`subgraph`:i||(i=new ScopeGraph(e=>e._.Id,a),t[a.ScopeName]=i.root);let e=a.parentScope().split(`:`),o=t[a.parentScope()];for(;e.length&&!o;)o=t[e.join(`:`)],e.pop();if(!o)console.warn(`Missing SG:Parent (${a.Id}): ${a.parentScope()}`);else{let e=o;t[a.ScopeName]=e.createSubgraph(a)}break;case`activity`:let s=t[a.parentScope()];s?r[a.ScopeName]=s.createVertex(a):console.warn(`Missing A:Parent (${a.Id}): ${a.parentScope()}`);break;case`edge`:n[a.ScopeName]=a;break;case`function`:let c=r[a.parentScope()];c?c._.children().push(a):console.warn(`Missing F:Parent (${a.Id}): ${a.parentScope()}`)}for(let e in n){let r=n[e],a=t[r.parentScope()];if(!a)console.warn(`Missing E:Parent (${r.Id}): ${r.parentScope()}`);else{let t=a;try{let e=i.vertex(r.attr(`IdSource`).RawValue),n=i.vertex(r.attr(`IdTarget`).RawValue);t.createEdge(e,n,r)}catch{console.warn(`Invalid Edge: ${e}`)}}}return i}var Resource=class extends t.StateObject{wu;get properties(){return this.get()}get URL(){return this.get(`URL`)}get DisplayName(){return this.get(`DisplayName`)}get DisplayPath(){return this.get(`DisplayPath`)}constructor(e,t){super(),this.wu=e;let n=t.split(`\\`).join(`/`),r=n.split(`/`),i=`res/`+this.wu.Wuid+`/`,a=``,o=``;n.indexOf(i)===0&&(a=n.substr(i.length),o=r[r.length-1]),this.set({URL:t,DisplayName:o,DisplayPath:a})}},XSDNode=class{e;constructor(e){this.e=e}fix(){delete this.e}},XSDXMLNode=class extends XSDNode{name;type;isSet=!1;attrs={};_children=[];constructor(e){super(e)}append(e){this._children.push(e),this.type||=`hpcc:childDataset`}fix(){this.name=this.e.$.name,this.type=this.e.$.type;for(let e=this._children.length-1;e>=0;--e){let t=this._children[e];t.name===`Row`&&t.type===void 0&&(this._children.push(...t._children),this._children.splice(e,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=this.type.lastIndexOf(`_`),n=t>0?t:this.type.length,r=n-1;for(;r>=0&&`0123456789`.indexOf(this.type.charAt(r))!==-1;--r);r+1<n&&(e=parseInt(this.type.substring(r+1,n),10)),this.type.indexOf(`data`)===0&&(e*=2)}return e<this.name.length&&(e=this.name.length),e}},XSDSimpleType=class extends XSDNode{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}}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()}},XSDSchema=class{root;simpleTypes={};fields(){return this.root.children()}},XSDParser=class extends t.SAXStackParser{schema=new XSDSchema;simpleType;simpleTypes={};xsdStack=new t.Stack;startXMLNode(e){switch(super.startXMLNode(e),e.name){case`xs:element`:let t=new XSDXMLNode(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 XSDSimpleType(e)}}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 t=this.xsdStack.top();for(let n in e.$)t.attrs[n]=e.$[n];break;default:this.simpleType&&this.simpleType.append(e)}super.endXMLNode(e)}};function parseXSD(e){let t=new XSDParser;return t.parse(e),t.schema}var XSDParser2=class extends XSDParser{_rootName;schema=new XSDSchema;simpleTypes={};xsdStack=new t.Stack;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case`xsd:element`:let t=new XSDXMLNode(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 XSDSimpleType(e)}}endXMLNode(e){e.name===`xsd:element`&&this.xsdStack.pop().fix(),super.endXMLNode(e)}};function parseXSD2(e,t){let n=new XSDParser2(t);return n.parse(e),n.schema}var GlobalResultCache=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}},U=new GlobalResultCache,Pe=class Result extends t.StateObject{connection;_bypassCache=!1;get BaseUrl(){return this.connection.baseUrl}xsdSchema;get properties(){return this.get()}get Wuid(){return this.get(`Wuid`)}get ResultName(){return this.get(`ResultName`)}get ResultSequence(){return this.get(`ResultSequence`)}get LogicalFileName(){return this.get(`LogicalFileName`)}get Name(){return this.get(`Name`)}get Sequence(){return this.get(`Sequence`)}get Value(){return this.get(`Value`)}get Link(){return this.get(`Link`)}get FileName(){return this.get(`FileName`)}get IsSupplied(){return this.get(`IsSupplied`)}get ShowFileContent(){return this.get(`ShowFileContent`)}get Total(){return this.get(`Total`)}get ECLSchemas(){return this.get(`ECLSchemas`)}get NodeGroup(){return this.get(`NodeGroup`)}get ResultViews(){return this.get(`ResultViews`)}get XmlSchema(){return this.get(`XmlSchema`)}static attach(e,t,n,r){let i;return Array.isArray(r)?(i=U.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n.Name},()=>new Result(e,t,n,r)),i.set(n)):r===void 0&&(typeof n==`number`?i=U.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:`Sequence_`+n},()=>new Result(e,t,n)):typeof n==`string`&&(i=U.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n},()=>new Result(e,t,n)))),i}static attachLogicalFile(e,t,n){return U.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n},()=>new Result(e,t,n,!0))}constructor(e,t,n,r){super(),this.connection=e instanceof WorkunitsService?e:new WorkunitsService(e),typeof r==`boolean`&&r===!0?this.set({NodeGroup:t,LogicalFileName:n}):isECLResult(n)&&Array.isArray(r)?this.set({...n,Wuid:t,ResultName:n.Name,ResultViews:r}):r===void 0?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}bypassCache(e){return e===void 0?this._bypassCache:(this._bypassCache=e,this)}_fetchXMLSchemaPromise;fetchXMLSchema(e=!1){return(!this._fetchXMLSchemaPromise||e)&&(this._fetchXMLSchemaPromise=this.WUResult().then(e=>e.Result?.XmlSchema?.xml?(this.xsdSchema=parseXSD(e.Result.XmlSchema.xml),this.xsdSchema):null)),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(e=0,n=-1,r=!1,i={},a,o){let s=o??this._bypassCache;return this.WUResult(e,n,!r,i,a,s).then(e=>{let n=e.Result;return delete e.Result,this.set({...e}),(0,t.exists)(`XmlSchema.xml`,n)&&(this.xsdSchema=parseXSD(n.XmlSchema.xml)),(0,t.exists)(`Row`,n)?n.Row:this.ResultName&&(0,t.exists)(this.ResultName,n)?n[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,a=!1){let o={NamedValue:{itemcount:0}};for(let e in r)o.NamedValue[o.NamedValue.itemcount++]={Name:e,Value:r[e]};let s={FilterBy:o};return this.Wuid&&this.ResultName!==void 0?(s.Wuid=this.Wuid,s.ResultName=this.ResultName):this.Wuid&&this.ResultSequence!==void 0?(s.Wuid=this.Wuid,s.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(s.LogicalName=this.LogicalFileName,s.Cluster=this.NodeGroup):this.LogicalFileName&&(s.LogicalName=this.LogicalFileName),s.Start=e,s.Count=t,s.SuppressXmlSchema=n,s.BypassCachedResult=a,this.connection.WUResult(s,i).then(e=>e)}},ResultCache=class extends t.Cache{constructor(){super(e=>t.Cache.hash([e.Sequence,e.Name,e.Value,e.FileName]))}},Attribute=class extends t.StateObject{scope;get properties(){return this.get()}get Name(){return this.get(`Name`)}get RawValue(){return this.get(`RawValue`)}get Formatted(){return this.get(`Formatted`)}get FormattedEnd(){return this.get(`FormattedEnd`)}get Measure(){return this.get(`Measure`)}get Creator(){return this.get(`Creator`)}get CreatorType(){return this.get(`CreatorType`)}constructor(e,t){super(),this.scope=e,this.set(t)}},BaseScope=class extends t.StateObject{_attributeMap={};_children=[];get properties(){return this.get()}get ScopeName(){return this.get(`ScopeName`)}get Id(){return this.get(`Id`)}get ScopeType(){return this.get(`ScopeType`)}get Properties(){return this.get(`Properties`,{Property:[]})}get Notes(){return this.get(`Notes`,{Note:[]})}get SinkActivity(){return this.get(`SinkActivity`)}get CAttributes(){let e=[],t={start:null,end:null};return this.Properties.Property.forEach(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 Attribute(this,n))}),t.start&&t.end?(t.start.FormattedEnd=t.end.Formatted,e.push(new Attribute(this,t.start))):t.start?e.push(new Attribute(this,t.start)):t.end&&e.push(new Attribute(this,t.end)),e}constructor(e){super(),this.update(e)}update(e){this.set(e),this.CAttributes.forEach(e=>{this._attributeMap[e.Name]=e}),this.Properties.Property=[];for(let e in this._attributeMap)this._attributeMap.hasOwnProperty(e)&&this.Properties.Property.push(this._attributeMap[e].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 Attribute(this,{Creator:``,CreatorType:``,Formatted:``,Measure:``,Name:``,RawValue:``})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let t=this.Id,n=[];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 e in r)e===`Label`?t=r[e]:n.push(`<tr><td class="key">${e}</td><td class="value">${r[e]}</td></tr>`);return`<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">
|
|
2
2
|
<h4 align="center">${t}</h4>
|
|
3
3
|
<table>
|
|
4
4
|
${n.join(``)}
|
|
5
5
|
</table>
|
|
6
|
-
</div>`}},Scope=class extends BaseScope{wu;constructor(e,t){super(t),this.wu=e}},SourceFile=class extends t.StateObject{connection;get properties(){return this.get()}get Wuid(){return this.get(`Wuid`)}get FileCluster(){return this.get(`FileCluster`)}get Name(){return this.get(`Name`)}get IsSuperFile(){return this.get(`IsSuperFile`)}get Subs(){return this.get(`Subs`)}get Count(){return this.get(`Count`)}get ECLSourceFiles(){return this.get(`ECLSourceFiles`)}constructor(e,t,n){super(),e instanceof WorkunitsService?this.connection=e:this.connection=new WorkunitsService(e),this.set({Wuid:t,...n})}},Timer=class extends t.StateObject{connection;get properties(){return this.get()}get Wuid(){return this.get(`Wuid`)}get Name(){return this.get(`Name`)}get Value(){return this.get(`Value`)}get Seconds(){return this.get(`Seconds`)}get GraphName(){return this.get(`GraphName`)}get SubGraphId(){return this.get(`SubGraphId`)}get HasSubGraphId(){return this.get(`HasSubGraphId`)}get count(){return this.get(`count`)}get Timestamp(){return this.get(`Timestamp`)}get When(){return this.get(`When`)}constructor(e,n,r){super(),e instanceof WorkunitsService?this.connection=e:this.connection=new WorkunitsService(e);let i=(0,t.espTime2Seconds)(r.Value);this.set({Wuid:n,Seconds:Math.round(i*1e3)/1e3,HasSubGraphId:r.SubGraphId!==void 0,...r})}},Fe=we(`%Y-%m-%dT%H:%M:%S.%LZ`),Ie=Te(`%Y-%m-%dT%H:%M:%S.%LZ`),Le=H(`,`);function formatNum(e){return e&&!isNaN(+e)?Le(+e):e}var Re=`DefinitionList`,ze=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,Be=[`Avg`,`Min`,`Max`,`Delta`,`StdDev`],Ve=[`SkewMin`,`SkewMax`,`NodeMin`,`NodeMax`],He=/[A-Z][a-z]*/g;function _splitMetric(e){for(let t of Ve){let n=e.indexOf(t);if(n===0)return{measure:``,ext:t,label:e.slice(n+t.length)}}let t=e.match(He);if(t?.length){let e=t.shift(),n=t.join(``);for(let t of Be){let r=n.indexOf(t);if(r===0)return n=n.slice(r+t.length),{measure:e,ext:t,label:n}}return{measure:e,ext:``,label:n}}return{measure:``,ext:``,label:e}}var Ue={};function splitMetric(e){let t=Ue[e];return t||(t=_splitMetric(e),Ue[e]=t),t}function formatValue(e,t){return e.__formattedProps?.[t]??e[t]}function safeParseFloat(e){if(e===void 0)return;let t=parseFloat(e);return isNaN(t)?void 0:t}function formatValues(e,t,n){let r=splitMetric(t);if(!n[r.measure]){n[r.label]=!0;let t=safeParseFloat(e[`${r.measure}Avg${r.label}`]),i=safeParseFloat(e[`${r.measure}Min${r.label}`]),a=safeParseFloat(e[`${r.measure}Max${r.label}`]),o=safeParseFloat(e[`${r.measure}StdDev${r.label}`]),s=Math.max((t-i)/o,(a-t)/o);return{Key:`${r.measure}${r.label}`,Value:formatValue(e,`${r.measure}${r.label}`),Avg:formatValue(e,`${r.measure}Avg${r.label}`),Min:formatValue(e,`${r.measure}Min${r.label}`),Max:formatValue(e,`${r.measure}Max${r.label}`),Delta:formatValue(e,`${r.measure}Delta${r.label}`),StdDev:formatValue(e,`${r.measure}StdDev${r.label}`),StdDevs:isNaN(s)?void 0:s,SkewMin:formatValue(e,`SkewMin${r.label}`),SkewMax:formatValue(e,`SkewMax${r.label}`),NodeMin:formatValue(e,`NodeMin${r.label}`),NodeMax:formatValue(e,`NodeMax${r.label}`)}}return null}var W=(0,t.scopedLogger)(`workunit.ts`),WorkunitCache=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}},G=new WorkunitCache,K=class Workunit extends t.StateObject{connection;topologyConnection;get BaseUrl(){return this.connection.baseUrl}_debugMode=!1;_debugAllGraph;_submitAction;get properties(){return this.get()}get Wuid(){return this.get(`Wuid`)}get Owner(){return this.get(`Owner`,``)}get Cluster(){return this.get(`Cluster`,``)}get Jobname(){return this.get(`Jobname`,``)}get Description(){return this.get(`Description`,``)}get ActionEx(){return this.get(`ActionEx`,``)}get StateID(){return this.get(`StateID`,z.Unknown)}get State(){return this.get(`State`)||z[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 ResultCache;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,()=>Pe.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 Timer(this.connection,this.Wuid,e))}_graphCache=new GraphCache;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 ECLGraph(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 Resource(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 SourceFile(this.connection,this.Wuid,e))}get VariableCount(){return this.get(`VariableCount`,0)}get Variables(){return this.get(`Variables`,{ECLResult:[]})}get TimerCount(){return this.get(`TimerCount`,0)}get HasDebugValue(){return this.get(`HasDebugValue`)}get ApplicationValueCount(){return this.get(`ApplicationValueCount`,0)}get XmlParams(){return this.get(`XmlParams`)}get AccessFlag(){return this.get(`AccessFlag`)}get ClusterFlag(){return this.get(`ClusterFlag`)}get ResultViewCount(){return this.get(`ResultViewCount`,0)}get DebugValueCount(){return this.get(`DebugValueCount`,0)}get WorkflowCount(){return this.get(`WorkflowCount`,0)}get Archived(){return this.get(`Archived`)}get RoxieCluster(){return this.get(`RoxieCluster`)}get DebugState(){return this.get(`DebugState`,{})}get Queue(){return this.get(`Queue`)}get Active(){return this.get(`Active`)}get Action(){return this.get(`Action`)}get Scope(){return this.get(`Scope`)}get AbortBy(){return this.get(`AbortBy`)}get AbortTime(){return this.get(`AbortTime`)}get AbortReason(){return this.get(`AbortReason`)}get Workflows(){return this.get(`Workflows`)}get TimingData(){return this.get(`TimingData`)}get HelpersDesc(){return this.get(`HelpersDesc`)}get GraphsDesc(){return this.get(`GraphsDesc`)}get SourceFilesDesc(){return this.get(`SourceFilesDesc`)}get ResultsDesc(){return this.get(`ResultsDesc`)}get VariablesDesc(){return this.get(`VariablesDesc`)}get TimersDesc(){return this.get(`TimersDesc`)}get DebugValuesDesc(){return this.get(`DebugValuesDesc`)}get ApplicationValuesDesc(){return this.get(`ApplicationValuesDesc`)}get WorkflowsDesc(){return this.get(`WorkflowsDesc`)}get ServiceNames(){return this.get(`ServiceNames`)}get CompileCost(){return this.get(`CompileCost`)}get ExecuteCost(){return this.get(`ExecuteCost`)}get FileAccessCost(){return this.get(`FileAccessCost`)}get NoAccess(){return this.get(`NoAccess`)}get ECLWUProcessList(){return this.get(`ECLWUProcessList`)}get CostSavingPotential(){return this.get(`CostSavingPotential`)}get FailureDesc(){return this.get(`FailureDesc`)}get FileSummaries(){return this.get(`FileSummaries`)}static create(e){let t=new Workunit(e);return t.connection.WUCreate().then(e=>(G.set(t),t.set(e.Workunit),t))}static attach(e,t,n){let r=G.get({BaseUrl:e.baseUrl,Wuid:t},()=>new Workunit(e,t));return n&&r.set(n),r}static existsLocal(e,t){return G.has({BaseUrl:e,Wuid:t})}static submit(e,t,n,r=!1){return Workunit.create(e).then(e=>e.update({QueryText:n})).then(e=>r?e.submit(t,B.Action.Compile):e.submit(t))}static compile(e,t,n){return Workunit.submit(e,t,n,!0)}static query(e,t){return new WorkunitsService(e).WUQuery(t).then(t=>t.Workunits.ECLWorkunit.map(function(t){return Workunit.attach(e,t.Wuid,t)}))}constructor(e,t){super(),this.connection=new WorkunitsService(e),this.topologyConnection=new TopologyService(e),this.clearState(t)}clearState(e){this.clear({Wuid:e,StateID:z.Unknown})}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(e=>(this.set(e.Workunit),this))}submit(e,t=B.Action.Run,n){let r;return r=e===void 0?this.topologyConnection.DefaultTpLogicalClusterQuery().then(e=>e.Name):Promise.resolve(e),this._debugMode=!1,t===B.Action.Debug&&(t=B.Action.Run,this._debugMode=!0),r.then(e=>this.connection.WUUpdate({Wuid:this.Wuid,Action:t,ResultLimit:n,DebugValues:{DebugValue:[{Name:`Debug`,Value:this._debugMode?`1`:``}]}}).then(n=>(this.set(n.Workunit),this._submitAction=t,this.connection.WUSubmit({Wuid:this.Wuid,Cluster:e})))).then(()=>this)}isComplete(){switch(this.StateID){case z.Compiled:return this.ActionEx===`compile`||this._submitAction===B.Action.Compile;case z.Completed:case z.Failed:case z.Aborted:case z.NotFound:return!0;default:}return!1}isFailed(){switch(this.StateID){case z.Aborted:case z.Failed:return!0;default:}return!1}isDeleted(){switch(this.StateID){case z.NotFound:return!0;default:}return!1}isDebugging(){switch(this.StateID){case z.DebugPaused:case z.DebugRunning:return!0;default:}return this._debugMode}isRunning(){switch(this.StateID){case z.Compiled:case z.Running:case z.Aborting:case z.Blocked:case z.DebugPaused:case z.DebugRunning:return!0;default:}return!1}setToFailed(){return this.WUAction(R.ECLWUActions.SetToFailed)}pause(){return this.WUAction(R.ECLWUActions.Pause)}pauseNow(){return this.WUAction(R.ECLWUActions.PauseNow)}resume(){return this.WUAction(R.ECLWUActions.Resume)}abort(){return this.WUAction(R.ECLWUActions.Abort)}protect(){return this.WUAction(R.ECLWUActions.Protect)}unprotect(){return this.WUAction(R.ECLWUActions.Unprotect)}delete(){return this.WUAction(R.ECLWUActions.Delete)}restore(){return this.WUAction(R.ECLWUActions.Restore)}deschedule(){return this.WUAction(R.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(R.ECLWUActions.Reschedule)}recover(){return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!1}).then(()=>(this.clearState(this.Wuid),this.refresh().then(()=>(this._monitor(),this))))}resubmit(){return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!0}).then(()=>(this.clearState(this.Wuid),this.refresh().then(()=>(this._monitor(),this))))}clone(){return this.WUResubmit({CloneWorkunit:!0,ResetWorkflow:!1}).then(e=>Workunit.attach(this.connection.opts(),e.WUs.WU[0].WUID).refresh())}async refreshState(){return await this.WUQuery(),this.StateID===z.Compiled&&!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(e=>e.Scopes.Scope)}normalizeDetails(e,t){let n={id:{Measure:`label`},name:{Measure:`label`},type:{Measure:`label`}},r=new Map;for(let t of e.Activities?.Activity??[])r.set(t.Kind,t.Name);let i=Array(t.length);for(let e=0;e<t.length;e++){let a=t[e],o={},s={};if(a.Properties?.Property)for(let e of a.Properties.Property){let t=e.Measure,i=e.Name,a=e.RawValue;if(t===`ns`&&(e.Measure=`s`),i===`Kind`){let t=parseInt(a,10);e.Formatted=r.get(t)??a}switch(n[i]={Name:e.Name,Measure:e.Measure,Creator:e.Creator,CreatorType:e.CreatorType},e.Measure){case`bool`:o[i]=!!+a;break;case`sz`:o[i]=+a;break;case`s`:o[i]=a/1e9;break;case`ns`:o[i]=+a;break;case`ts`:o[i]=new Date(a/1e3).toISOString();break;case`cnt`:o[i]=+a;break;case`cost`:o[i]=a/1e6;break;case`node`:o[i]=+a;break;case`skw`:o[i]=+a;break;default:o[i]=a}s[i]=formatNum(e.Formatted??o[i])}let c={id:a.Id,name:a.ScopeName,type:a.ScopeType,Kind:a.Kind,Label:a.Label,__formattedProps:s,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:``,...o},l=c[Re];if(l)try{let e=JSON.parse(l.split(`\\`).join(`\\\\`)),t=[];for(let n=0;n<e.length;n++){let r=e[n].match(ze);r&&t.push({filePath:(r[1]??``)+r[2]+r[3],line:parseInt(r[5],10),col:parseInt(r[6],10)})}c[Re]=t}catch{W.error(`Unexpected "DefinitionList": ${l}`)}let u={},d=0,f=``;for(let e in c)if(!e.startsWith(`__`)){let t=formatValues(c,e,u);t&&(c.__groupedProps[t.Key]=t,!isNaN(t.StdDevs)&&t.StdDevs>d&&(d=t.StdDevs,f=t.Key))}c.__StdDevs=d,c.__StdDevsSource=f,i[e]=c}return{meta:e,columns:n,data:i}}fetchDetailsNormalized(e={}){return Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(e=>this.normalizeDetails(e[0],e[1]))}fetchInfo(e={}){return this.WUInfo(e)}fetchDetails(e={}){return this.WUDetails(e).then(e=>e.Scopes.Scope.map(e=>new Scope(this,e)))}fetchDetailsHierarchy(e={}){return this.WUDetails(e).then(e=>{let t=[],n={};e.Scopes.Scope.forEach(e=>{if(n[e.ScopeName])return n[e.ScopeName].update(e),null;{let t=new Scope(this,e);return n[t.ScopeName]=t,t}});for(let e in n)if(n.hasOwnProperty(e)){let r=n[e],i=r.parentScope();i&&n[i]?n[i].children().push(r):t.push(r)}return t})}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(e=>createGraph(e))}fetchTimeElapsed(){return this.fetchDetails({ScopeFilter:{PropertyFilters:{PropertyFilter:[{Name:`TimeElapsed`}]}}}).then(e=>{let t={};e.forEach(e=>{t[e.ScopeName]=t[e.ScopeName]||{scope:e.ScopeName,start:null,elapsed:null,finish:null},e.CAttributes.forEach(n=>{n.Name===`TimeElapsed`?t[e.ScopeName].elapsed=+n.RawValue:n.Measure===`ts`&&n.Name.indexOf(`Started`)>=0&&(t[e.ScopeName].start=n.Formatted)})});let n=[];for(let e in t){let r=t[e];if(r.start&&r.elapsed){let e=Ie(r.start);e.setMilliseconds(e.getMilliseconds()+r.elapsed/1e6),r.finish=Fe(e),n.push(r)}}return n.sort((e,t)=>e.start<t.start?-1:+(e.start>t.start)),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`,e=>{this.isComplete()&&t([e])});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(n=>{e&&e(n),this.isComplete()&&(r.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,n)=>{let r=this.watch(n=>{e&&e(n),(this.isComplete()||this.isRunning())&&(r.release(),t(this))})})}WUQuery(e={}){return this.connection.WUQuery({...e,Wuid:this.Wuid}).then(e=>(e.Workunits.ECLWorkunit.length===0?(this.clearState(this.Wuid),this.set(`StateID`,z.NotFound)):this.set(e.Workunits.ECLWorkunit[0]),e)).catch(e=>{if(!e.Exception.some(e=>e.Code===20081?(this.clearState(this.Wuid),this.set(`StateID`,z.NotFound),!0):!1))throw W.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),G.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(e=>(this.set(e.Workunit),t&&this.set({ResultViews:e.ResultViews}),e)).catch(e=>{if(!e.Exception.some(e=>e.Code===20080?(this.clearState(this.Wuid),this.set(`StateID`,z.NotFound),!0):!1))throw W.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}WUResubmit(e){return this.connection.WUResubmit((0,t.deepMixinT)({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails((0,t.deepMixinT)({ScopeFilter:{MaxDepth:9999},ScopeOptions:{IncludeMatchedScopesInResults:!0,IncludeScope:!0,IncludeId:!1,IncludeScopeType:!1},PropertyOptions:{IncludeName:!0,IncludeRawValue:!1,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}},e,{WUID:this.Wuid})).then(e=>(0,t.deepMixinT)({Scopes:{Scope:[]}},e))}WUAction(e){return this.connection.WUAction({Wuids:{Item:[this.Wuid]},WUActionType:e}).then(e=>this.refresh().then(()=>(this._monitor(),e)))}publish(e){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:e||this.Jobname,AllowForeignFiles:!0,Activate:R.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){let t=new WorkunitsServiceEx({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 e in t)t.hasOwnProperty(e)&&(n+=` ${e}='${t[e]}'`);return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:`<debug:${e} uid='${this.Wuid}'${n}/>`}).then(e=>e)}debug(e,n){return this.isDebugging()?this.WUCDebug(e,n).then(n=>{let r=n.children(e);return r.length?r[0]:new t.XMLNode(e)}).catch(n=>(W.error(n),Promise.resolve(new t.XMLNode(e)))):Promise.resolve(new t.XMLNode(e))}debugStatus(){return this.isDebugging()?this.debug(`status`).then(e=>{let t={...this.DebugState,...e.$};return this.set({DebugState:t}),e}):Promise.resolve({DebugState:{state:`unknown`}})}debugContinue(e=``){return this.debug(`continue`,{mode:e})}debugStep(e){return this.debug(`step`,{mode:e})}debugPause(){return this.debug(`interrupt`)}debugQuit(){return this.debug(`quit`)}debugDeleteAllBreakpoints(){return this.debug(`delete`,{idx:0})}debugBreakpointResponseParser(e){return e.children().map(e=>{if(e.name===`break`)return e.$})}debugBreakpointAdd(e,t,n){return this.debug(`breakpoint`,{id:e,mode:t,action:n}).then(e=>this.debugBreakpointResponseParser(e))}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=createXGMMLGraph(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(t=>breakpointLocations(t,e))}debugPrint(e,t=0,n=10){return this.debug(`print`,{edgeID:e,startRow:t,numRows:n}).then(e=>e.children().map(e=>{let t={};return e.children().forEach(e=>{t[e.name]=e.content}),t}))}},q=`definition`;function hasECLDefinition(e){return e._[q]!==void 0}function getECLDefinition(e){let t=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(e._[q]);if(t){let[,n,r,i]=t;return n.replace(/\/\.\//g,`/`),{id:e._.id,file:n,line:+r,column:+i}}throw Error(`Bad definition: ${e._[q]}`)}function breakpointLocations(e,t){let n=[];for(let r of e.vertices)if(hasECLDefinition(r)){let e=getECLDefinition(r);(e&&!t||t===e.file)&&n.push(e)}return n.sort((e,t)=>e.line-t.line)}var J,We=class Activity extends t.StateObject{connection;get properties(){return this.get()}get Exceptions(){return this.get(`Exceptions`)}get Build(){return this.get(`Build`)}get ThorClusterList(){return this.get(`ThorClusterList`)}get RoxieClusterList(){return this.get(`RoxieClusterList`)}get HThorClusterList(){return this.get(`HThorClusterList`)}get DFUJobs(){return this.get(`DFUJobs`)}get Running(){return this.get(`Running`,{ActiveWorkunit:[]})}get BannerContent(){return this.get(`BannerContent`)}get BannerColor(){return this.get(`BannerColor`)}get BannerSize(){return this.get(`BannerSize`)}get BannerScroll(){return this.get(`BannerScroll`)}get ChatURL(){return this.get(`ChatURL`)}get ShowBanner(){return this.get(`ShowBanner`)}get ShowChatURL(){return this.get(`ShowChatURL`)}get SortBy(){return this.get(`SortBy`)}get Descending(){return this.get(`Descending`)}get SuperUser(){return this.get(`SuperUser`)}get AccessRight(){return this.get(`AccessRight`)}get ServerJobQueues(){return this.get(`ServerJobQueues`)}get ActivityTime(){return this.get(`ActivityTime`)}get DaliDetached(){return this.get(`DaliDetached`)}static attach(e,t){return J||=new Activity(e),t&&J.set(t),J}constructor(e){super(),e instanceof SMCService?this.connection=e:this.connection=new SMCService(e),this.clear({})}runningWorkunits(e=``){return this.Running.ActiveWorkunit.filter(t=>e===``||t.ClusterName===e).map(e=>K.attach(this.connection.connectionOptions(),e.Wuid,e))}setBanner(e){return this.connection.SetBanner({...e}).then(e=>(this.set(e),this))}lazyRefresh=(0,t.debounce)(async()=>{let e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}},Ge=(0,t.scopedLogger)(`logicalFile.ts`),LogicalFileCache=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}},Ke=new LogicalFileCache,qe=class LogicalFile extends t.StateObject{connection;get BaseUrl(){return this.connection.baseUrl}get Cluster(){return this.get(`Cluster`)}get Name(){return this.get(`Name`)}get Filename(){return this.get(`Filename`)}get Prefix(){return this.get(`Prefix`)}get NodeGroup(){return this.get(`NodeGroup`)}get NumParts(){return this.get(`NumParts`)}get Description(){return this.get(`Description`)}get Dir(){return this.get(`Dir`)}get PathMask(){return this.get(`PathMask`)}get Filesize(){return this.get(`Filesize`)}get FileSizeInt64(){return this.get(`FileSizeInt64`)}get RecordSize(){return this.get(`RecordSize`)}get RecordCount(){return this.get(`RecordCount`)}get RecordSizeInt64(){return this.get(`RecordSizeInt64`)}get RecordCountInt64(){return this.get(`RecordCountInt64`)}get Wuid(){return this.get(`Wuid`)}get Owner(){return this.get(`Owner`)}get JobName(){return this.get(`JobName`)}get Persistent(){return this.get(`Persistent`)}get Format(){return this.get(`Format`)}get MaxRecordSize(){return this.get(`MaxRecordSize`)}get CsvSeparate(){return this.get(`CsvSeparate`)}get CsvQuote(){return this.get(`CsvQuote`)}get CsvTerminate(){return this.get(`CsvTerminate`)}get CsvEscape(){return this.get(`CsvEscape`)}get Modified(){return this.get(`Modified`)}get Ecl(){return this.get(`Ecl`)}get Stat(){return this.get(`Stat`)}get DFUFilePartsOnClusters(){return this.get(`DFUFilePartsOnClusters`)}get isSuperfile(){return this.get(`isSuperfile`)}get ShowFileContent(){return this.get(`ShowFileContent`)}get subfiles(){return this.get(`subfiles`)}get Superfiles(){return this.get(`Superfiles`)}get ProtectList(){return this.get(`ProtectList`)}get FromRoxieCluster(){return this.get(`FromRoxieCluster`)}get Graphs(){return this.get(`Graphs`)}get UserPermission(){return this.get(`UserPermission`)}get ContentType(){return this.get(`ContentType`)}get CompressedFileSize(){return this.get(`CompressedFileSize`)}get PercentCompressed(){return this.get(`PercentCompressed`)}get IsCompressed(){return this.get(`IsCompressed`)}get BrowseData(){return this.get(`BrowseData`)}get jsonInfo(){return this.get(`jsonInfo`)}get binInfo(){return this.get(`binInfo`)}get PackageID(){return this.get(`PackageID`)}get Partition(){return this.get(`Partition`)}get Blooms(){return this.get(`Blooms`)}get ExpireDays(){return this.get(`ExpireDays`)}get KeyType(){return this.get(`KeyType`)}get IsRestricted(){return this.get(`IsRestricted`)}get AtRestCost(){return this.get(`AtRestCost`)}get AccessCost(){return this.get(`AccessCost`)}get StateID(){return this.get(`StateID`)}get ExpirationDate(){return this.get(`ExpirationDate`)}get ExtendedIndexInfo(){return this.get(`ExtendedIndexInfo`)}get CompressionType(){return this.get(`CompressionType`)}get properties(){return this.get()}static attach(e,t,n,r){let i=Ke.get({BaseUrl:e.baseUrl,Cluster:t,Name:n},()=>new LogicalFile(e,t,n));return r&&i.set(r),i}constructor(e,t,n){super(),e instanceof DFUService?this.connection=e:this.connection=new DFUService(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(e=>(this.set({Cluster:this.Cluster,...e.FileDetail}),e))}fetchInfo(){return this.connection.DFUInfo({Cluster:this.Cluster,Name:this.Name}).then(e=>(this.set({Cluster:this.Cluster,...e.FileDetail,ProtectList:e?.FileDetail?.ProtectList??{DFUFileProtect:[]}}),e.FileDetail)).catch(e=>{if(!e.Exception.some(e=>e.Code===20038?(this.set(`Name`,this.Name+` (Deleted)`),this.set(`StateID`,999),!0):!1))throw Ge.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}fetchDefFile(e){return this.connection.DFUFile({Name:this.Name,Format:e})}fetchAllLogicalFiles(){return this.connection.recursiveFetchLogicalFiles([this])}fetchListHistory(){return this.connection.ListHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}eraseHistory(){return this.connection.EraseHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}},MachineCache=class extends t.Cache{constructor(){super(e=>e.Address)}},Je=new MachineCache,Ye=class Machine extends t.StateObject{connection;get Address(){return this.get(`Address`)}get ConfigAddress(){return this.get(`ConfigAddress`)}get Name(){return this.get(`Name`)}get ProcessType(){return this.get(`ProcessType`)}get DisplayType(){return this.get(`DisplayType`)}get Description(){return this.get(`Description`)}get AgentVersion(){return this.get(`AgentVersion`)}get Contact(){return this.get(`Contact`)}get Location(){return this.get(`Location`)}get UpTime(){return this.get(`UpTime`)}get ComponentName(){return this.get(`ComponentName`)}get ComponentPath(){return this.get(`ComponentPath`)}get RoxieState(){return this.get(`RoxieState`)}get RoxieStateDetails(){return this.get(`RoxieStateDetails`)}get OS(){return this.get(`OS`)}get ProcessNumber(){return this.get(`ProcessNumber`)}get Channels(){return this.get(`Channels`)}get Processors(){return this.get(`Processors`)}get Storage(){return this.get(`Storage`)}get Running(){return this.get(`Running`)}get PhysicalMemory(){return this.get(`PhysicalMemory`)}get VirtualMemory(){return this.get(`VirtualMemory`)}get ComponentInfo(){return this.get(`ComponentInfo`)}get Exception(){return this.get(`Exception`)}static attach(e,t,n){let r=Je.get({Address:t},()=>new Machine(e));return n&&r.set(n),r}constructor(e){super(),e instanceof MachineService?this.connection=e:this.connection=new MachineService(e)}},TargetClusterCache=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}},Xe=new TargetClusterCache,Y=class TargetCluster extends t.StateObject{connection;machineConnection;get BaseUrl(){return this.connection.baseUrl}get Name(){return this.get(`Name`)}get Prefix(){return this.get(`Prefix`)}get Type(){return this.get(`Type`)}get IsDefault(){return this.get(`IsDefault`)}get TpClusters(){return this.get(`TpClusters`)}get TpEclCCServers(){return this.get(`TpEclCCServers`)}get TpEclServers(){return this.get(`TpEclServers`)}get TpEclAgents(){return this.get(`TpEclAgents`)}get TpEclSchedulers(){return this.get(`TpEclSchedulers`)}get MachineInfoEx(){return this.get(`MachineInfoEx`,[])}get CMachineInfoEx(){return this.MachineInfoEx.map(e=>Ye.attach(this.machineConnection,e.Address,e))}static attach(e,t,n){let r=Xe.get({BaseUrl:e.baseUrl,Name:t},()=>new TargetCluster(e,t));return n&&r.set(n),r}constructor(e,t){super(),e instanceof TopologyService?(this.connection=e,this.machineConnection=new MachineService(e.connectionOptions())):(this.connection=new TopologyService(e),this.machineConnection=new MachineService(e)),this.clear({Name:t})}fetchMachines(e={}){return this.machineConnection.GetTargetClusterInfo({TargetClusters:{Item:[`${this.Type}:${this.Name}`]},...e}).then(e=>{let t=[];for(let n of e.TargetClusterInfoList.TargetClusterInfo)for(let e of n.Processes.MachineInfoEx)t.push(e);return this.set(`MachineInfoEx`,t),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 r=1-i.Available/i.Total;r>e&&(e=r)}return{maxDisk:e,meanDisk:1-(n?t/n:1)}}fetchUsage(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])}};function targetClusters(e){let t;return t=e instanceof TopologyService?e:new TopologyService(e),t.TpListTargetClusters({}).then(t=>t.TargetClusters.TpClusterNameType.map(t=>Y.attach(e,t.Name,t)))}var Ze={};function defaultTargetCluster(e){if(!Ze[e.baseUrl]){let t;t=e instanceof TopologyService?e:new TopologyService(e),Ze[e.baseUrl]=t.TpListTargetClusters({}).then(t=>{let n,r,i;t.TargetClusters.TpClusterNameType.forEach(e=>{n||=e,!r&&e.IsDefault===!0&&(r=e),!i&&e.Type===`hthor`&&(i=e)});let a=r||i||n;return Y.attach(e,a.Name,a)})}return Ze[e.baseUrl]}var TopologyCache=class extends t.Cache{constructor(){super(e=>e.BaseUrl)}},Qe=new TopologyCache,$e=class Topology extends t.StateObject{connection;get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get TargetClusters(){return this.get(`TargetClusters`)}get CTargetClusters(){return this.TargetClusters.map(e=>Y.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get(`LogicalClusters`)}get Services(){return this.get(`Services`)}static attach(e,t){let n=Qe.get({BaseUrl:e.baseUrl},()=>new Topology(e));return t&&n.set(t),n}constructor(e){super(),e instanceof TopologyService?this.connection=e:this.connection=new TopologyService(e)}GetESPServiceBaseURL(e=``){return this.connection.TpServiceQuery({}).then(n=>{let r=this.connection.protocol(),i=this.connection.ip(),a=r===`https:`?`18002`:`8002`;if((0,t.exists)(`ServiceList.TpEspServers.TpEspServer`,n)){for(let i of n.ServiceList.TpEspServers.TpEspServer)if((0,t.exists)(`TpBindings.TpBinding`,i))for(let t of i.TpBindings.TpBinding)t.Service===e&&t.Protocol+`:`===r&&(a=t.Port)}return`${r}//${i}:${a}/`})}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(e=>(this.set({LogicalClusters:e.TpLogicalClusters.TpLogicalCluster}),this.LogicalClusters))}fetchServices(e={}){return this.connection.TpServiceQuery(e).then(e=>(this.set({Services:e.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 safeAssign(e,t,n){t===`__proto__`||t===`constructor`||t===`prototype`||(e[t]=n)}function xmlEncode(e){return e=``+e,e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`).replace(/\n/g,` `).replace(/\r/g,` `)}function espTime2Seconds(e){if(!e)return 0;if(!isNaN(+e))return parseFloat(e);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(e);if(!t)return 0;let n=+t[1]||0,r=+t[2]||0,i=+t[3]||0,a=+t[4]||0,o=+t[5]||0,s=+t[6]||0,c=+t[7]||0;return n*24*60*60+r*60*60+i*60+a+o/1e3+s/1e6+c/1e9}function unitTest(e,t){let n=e.indexOf(t);return n===-1?-1:parseFloat(e.substring(0,n))}function espSize2Bytes(e){if(!e)return 0;if(!isNaN(+e))return parseFloat(e);let t=unitTest(e,`Kb`);return t>=0?t*1024:(t=unitTest(e,`Mb`),t>=0?t*1024**2:(t=unitTest(e,`Gb`),t>=0?t*1024**3:(t=unitTest(e,`Tb`),t>=0?t*1024**4:(t=unitTest(e,`Pb`),t>=0?t*1024**5:(t=unitTest(e,`Eb`),t>=0?t*1024**6:(t=unitTest(e,`Zb`),t>=0?t*1024**7:(t=unitTest(e,`b`),t>=0?t:0)))))))}function espSkew2Number(e){return e?parseFloat(e):0}var X=function(e){return e[e.UNKNOWN=0]=`UNKNOWN`,e[e.GRAPH=1]=`GRAPH`,e[e.SUBGRAPH=2]=`SUBGRAPH`,e[e.VERTEX=3]=`VERTEX`,e[e.EDGE=4]=`EDGE`,e[e.LAST=5]=`LAST`,e}(X||{}),Z=function(e){return e.UNKNOWN=`Unknown`,e.GRAPH=`Graph`,e.SUBGRAPH=`Cluster`,e.VERTEX=`Vertex`,e.EDGE=`Edge`,e.LAST=`Last`,e}(Z||{}),LocalisedXGMMLWriter=class{graph;m_xgmml;m_visibleSubgraphs;m_visibleVertices;m_semiVisibleVertices;m_visibleEdges;noSpills;constructor(e){this.graph=e,this.m_xgmml=``,this.m_visibleSubgraphs={},this.m_visibleVertices={},this.m_semiVisibleVertices={},this.m_visibleEdges={}}calcVisibility(e,t,n,r){this.noSpills=r,e.forEach(e=>{this.graph.isVertex(e)?(this.calcInVertexVisibility(e,n),this.calcOutVertexVisibility(e,n)):this.graph.isEdge(e)?(this.calcInVertexVisibility(e.getSource(),n-1),this.calcOutVertexVisibility(e.getTarget(),n-1)):this.graph.isSubgraph(e)&&(this.m_visibleSubgraphs[e.__hpcc_id]=e,this.calcSubgraphVisibility(e,t-1))}),this.calcVisibility2()}calcInVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getInEdges().forEach(e=>{this.calcInVertexVisibility(e.getSource(),t-1)})}calcOutVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getOutEdges().forEach(e=>{this.calcOutVertexVisibility(e.getTarget(),t-1)})}calcSubgraphVisibility(e,t){if(t<0)return;t>0&&e.__hpcc_subgraphs.forEach((e,n)=>{this.calcSubgraphVisibility(e,t-1)}),e.__hpcc_subgraphs.forEach((e,t)=>{this.m_visibleSubgraphs[e.__hpcc_id]=e}),e.__hpcc_vertices.forEach((e,t)=>{this.m_visibleVertices[e.__hpcc_id]=e});let n={};this.graph.edges.forEach((t,r)=>{t.getSource().__hpcc_parent!==t.getTarget().__hpcc_parent&&e===this.getCommonAncestor(t)&&(n[t.getSource().__hpcc_parent.__hpcc_id+`::`+t.getTarget().__hpcc_parent.__hpcc_id]||(n[t.getSource().__hpcc_parent.__hpcc_id+`::`+t.getTarget().__hpcc_parent.__hpcc_id]=!0,this.m_visibleEdges[t.__hpcc_id]=t))})}buildVertexString(e,t){let n=``,r=``,i=e.getProperties();for(let e in i)t&&e.indexOf(`_kind`)>=0?r+=`<att name="_kind" value="point"/>`:e===`id`||e===`label`?n+=` `+e+`="`+xmlEncode(i[e])+`"`:r+=`<att name="`+e+`" value="`+xmlEncode(i[e])+`"/>`;return`<node`+n+`>`+r+`</node>`}buildEdgeString(e){let t=``,n=``,r=e.getProperties();for(let e in r)e.toLowerCase()===`id`||e.toLowerCase()===`label`||e.toLowerCase()===`source`||e.toLowerCase()===`target`?t+=` `+e+`="`+xmlEncode(r[e])+`"`:n+=`<att name="`+e+`" value="`+xmlEncode(r[e])+`"/>`;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,o=null;for(;i>=0&&a>=0&&n[i]===r[a];)o=n[i],--i,--a;return o}getCommonAncestor(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())}calcAncestorVisibility(e){let t=[];this.getAncestors(e,t),t.forEach((e,t)=>{this.m_visibleSubgraphs[e.__hpcc_id]=e})}calcVisibility2(){for(let e in this.m_visibleVertices){let t=this.m_visibleVertices[e];t.getInEdges().forEach((e,t)=>{this.m_visibleEdges[e.__hpcc_id]=e}),t.getOutEdges().forEach((e,t)=>{this.m_visibleEdges[e.__hpcc_id]=e}),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 e=n.getInEdges();if(e.length)this.addSemiVisibleEdge(e[0]),n=e[0].getSource(),this.addSemiVisibleVertex(n);else break}let r=t.getTarget();for(this.addSemiVisibleVertex(r);this.noSpills&&r.isSpill();){let e=r.getOutEdges();if(e.length)this.addSemiVisibleEdge(e[0]),r=e[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 t=e.__hpcc_vertices[0];t&&(this.m_xgmml+=this.buildVertexString(t,!0))}let i=e.getProperties();for(let e in i)n+=`<att name="`+e+`" value="`+xmlEncode(i[e])+`"/>`;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))}},GraphItem=class{__hpcc_graph;__hpcc_parent;__widget;__hpcc_id;_globalID;constructor(e,t){this.__hpcc_graph=e,this.__hpcc_id=t,this._globalID=t}getProperties(){let e={};for(let t in this)t.indexOf(`__`)!==0&&this.hasOwnProperty(t)&&(e[t]=this[t]);return e}},Subgraph=class extends GraphItem{_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)})}},Vertex=class extends GraphItem{_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(e=>{e.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)}},Edge=class extends GraphItem{_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&&=e.__hpcc_id,this.__widget&&this.__widget.setSource(this.getSource().__widget)}getTarget(){return this.__hpcc_graph.idx[this._targetActivity||this.target]}},et=class 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 t=new DOMParser().parseFromString(e,`text/xml`);this.walkDocument(t.documentElement,`0`)}isSubgraph(e){return e instanceof Subgraph}isVertex(e){return e instanceof Vertex}isEdge(e){return e instanceof Edge}getGlobalType(e){return e instanceof Vertex?X.VERTEX:e instanceof Edge?X.EDGE:e instanceof Subgraph?X.SUBGRAPH:e instanceof QueryGraph?X.GRAPH:X.UNKNOWN}getGlobalTypeString(e){return e instanceof Vertex?Z.VERTEX:e instanceof Edge?Z.EDGE:e instanceof Subgraph?Z.SUBGRAPH:e instanceof QueryGraph?Z.GRAPH:Z.UNKNOWN}getItem(e,t){if(!this.idx[t])switch(e.tagName){case`graph`:let e=new Subgraph(this,t);this.subgraphs.push(e),this.idx[t]=e;break;case`node`:let n=new Vertex(this,t);this.vertices.push(n),this.idx[t]=n;break;case`edge`:let r=new Edge(this,t);this.edges.push(r),this.idx[t]=r;break;default:console.warn(`Graph.getItem - Unknown Node Type!`);break}let n=this.idx[t];return Array.from(e.attributes).forEach(e=>{safeAssign(n,e.name,e.value)}),n}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof Subgraph?this.subgraphs=this.subgraphs.filter(t=>e!==t):e instanceof Vertex?this.vertices=this.vertices.filter(t=>e!==t):e instanceof Edge&&(this.edges=this.edges.filter(t=>e!==t))}getChildByTagName(e,t){let n=null;return Array.from(e.childNodes).some(e=>{if(e.tagName===t)return n=e,!0}),n}walkDocument(e,t){let n=this.getItem(e,t);return e.childNodes.forEach(e=>{switch(e.nodeType){case 1:switch(e.tagName){case`graph`:break;case`node`:let t=!1,r=this.getChildByTagName(e,`att`);if(r){let i=this.getChildByTagName(r,`graph`);if(i){t=!0;let r=this.walkDocument(i,e.getAttribute(`id`));n.addSubgraph(r)}}if(!t){let t=this.walkDocument(e,e.getAttribute(`id`));n.addVertex(t)}break;case`att`:let i=e.getAttribute(`name`),a=`_`+i,o=e.getAttribute(`value`);i.indexOf(`Time`)===0?(safeAssign(n,a,o),safeAssign(n,i,``+espTime2Seconds(o))):i.indexOf(`Size`)===0?(safeAssign(n,a,o),safeAssign(n,i,``+espSize2Bytes(o))):i.indexOf(`Skew`)===0?(safeAssign(n,a,o),safeAssign(n,i,``+espSkew2Number(o))):safeAssign(n,i,o);break;case`edge`:let s=this.walkDocument(e,e.getAttribute(`id`));if(s.NumRowsProcessed===void 0?s.Count===void 0?s.count!==void 0&&(s._eclwatchCount=s.count.replace(/\B(?=(\d{3})+(?!\d))/g,`,`)):s._eclwatchCount=s.Count.replace(/\B(?=(\d{3})+(?!\d))/g,`,`):s._eclwatchCount=s.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,`,`),s.inputProgress&&(s._eclwatchInputProgress=`[`+s.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,`,`)+`]`),s.SkewMaxRowsProcessed&&s.SkewMinRowsProcessed&&(s._eclwatchSkew=`+`+s.SkewMaxRowsProcessed+`, `+s.SkewMinRowsProcessed),!s._dependsOn&&!s._childGraph&&(s._sourceActivity||s._targetActivity)){s._isSpill=!0;let e=s.getSource();e&&(e._isSpill=!0);let t=s.getTarget();t&&(t._isSpill=!0)}n.addEdge(s);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(e=>{e.__hpcc_parent instanceof Subgraph&&e.remove()})}removeSpillVertices(){[...this.vertices].forEach(e=>{e.isSpill()&&e.remove()})}getLocalisedXGMML(e,t,n,r){let i=new LocalisedXGMMLWriter(this);return i.calcVisibility(e,t,n,r),i.writeXgmml(),`<graph>`+i.m_xgmml+`</graph>`}},Q=(0,t.scopedLogger)(`@hpcc-js/comms/ecl/query.ts`),tt=H(`~s`);function isNumber(e){return!isNaN(parseFloat(e))&&!isNaN(e-0)}var QueryCache=class extends t.Cache{constructor(){super(e=>t.Cache.hash([e.QueryId,e.QuerySet]))}},nt=new QueryCache,rt=class Query extends t.StateObject{wsWorkunitsService;get BaseUrl(){return this.wsWorkunitsService.baseUrl}topology;_requestSchema;_responseSchema;get properties(){return this.get()}get Exceptions(){return this.get(`Exceptions`)}get QueryId(){return this.get(`QueryId`)}get QuerySet(){return this.get(`QuerySet`)}get QueryName(){return this.get(`QueryName`)}get Wuid(){return this.get(`Wuid`)}get Dll(){return this.get(`Dll`)}get Suspended(){return this.get(`Suspended`)}get Activated(){return this.get(`Activated`)}get SuspendedBy(){return this.get(`SuspendedBy`)}get Clusters(){return this.get(`Clusters`)}get PublishedBy(){return this.get(`PublishedBy`)}get Comment(){return this.get(`Comment`)}get LogicalFiles(){return this.get(`LogicalFiles`)}get SuperFiles(){return this.get(`SuperFiles`)}get IsLibrary(){return this.get(`IsLibrary`)}get Priority(){return this.get(`Priority`)}get WUSnapShot(){return this.get(`WUSnapShot`)}get CompileTime(){return this.get(`CompileTime`)}get LibrariesUsed(){return this.get(`LibrariesUsed`)}get CountGraphs(){return this.get(`CountGraphs`)}get ResourceURLCount(){return this.get(`ResourceURLCount`)}get WsEclAddresses(){return this.get(`WsEclAddresses`)}get WUGraphs(){return this.get(`WUGraphs`)}get WUTimers(){return this.get(`WUTimers`)}get PriorityID(){return this.get(`PriorityID`)}constructor(e,t,n,r){super(),e instanceof WorkunitsService?this.wsWorkunitsService=e:this.wsWorkunitsService=new WorkunitsService(e),this.topology=$e.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:t,QueryId:n,...r})}static attach(e,t,n,r){let i=nt.get({BaseUrl:e.baseUrl,QuerySet:t,QueryId:n},()=>new Query(e,t,n));return r&&i.set(r),i}_eclService;async wsEclService(){return this._eclService||=this.topology.fetchServices({}).then(e=>{for(let t of e?.TpEspServers?.TpEspServer??[])for(let e of t?.TpBindings?.TpBinding??[])if(e?.Service===`ws_ecl`)return new EclService({baseUrl:`${e.Protocol}://${globalThis.location.hostname}:${e.Port}`})}),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(e){Q.debug(e.message??e),this._requestSchema=[]}}async fetchResponseSchema(){let e=await this.wsEclService();try{this._responseSchema=await e?.responseJson(this.QuerySet,this.QueryId)??{}}catch(e){Q.debug(e.message??e),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(e=>{let t=new et,n=!0;for(let r of e?.Graphs?.ECLGraphEx||[])n?(t.load(r.Graph),n=!1):t.merge(r.Graph);return t})}fetchDetailsNormalized(e={}){let t=K.attach(this.wsWorkunitsService,this.Wuid);return t?Promise.all([this.fetchGraph(),t.fetchDetailsMeta(),t.fetchDetailsRaw(e)]).then(e=>{let n=e[0],r=e[1],i=e[2].map(e=>{let t=e.Id[0];if(t===`a`||t===`e`){let t=n.idx[e.Id.substring(1)];if(!t)return Q.debug(`Missing graph data for metric ID: ${e.Id}`),e;let r=new Set(e.Properties.Property.map(e=>e.Name)),i=[];for(let e in t){let n=e.charAt(0);if(n!==`_`&&n===n.toUpperCase()&&!r.has(e)){let n=t[e],r=typeof n;if(r===`string`||r===`number`||r===`boolean`){let t=isNumber(n)?parseFloat(n):n,r=n;e.indexOf(`Time`)>=0&&(t/=1e9,r=tt(t)+`s`),i.push({Name:e,RawValue:t,Formatted:r})}}}i.length>0&&e.Properties.Property.push(...i)}return e});return t.normalizeDetails(r,i)}):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(e=>{for(let t in e)e[t]=e[t].Row;return e})??[]}catch(e){return Q.debug(e.message??e),[]}}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]:[]}},StoreCache=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}},it=new StoreCache,ValueChangedMessage=class extends t.Message{key;value;oldValue;constructor(e,t,n){super(),this.key=e,this.value=t,this.oldValue=n}get canConflate(){return!0}conflate(e){return this.key===e.key?(this.value=e.value,!0):!1}void(){return this.value===this.oldValue}},at=class Store{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new t.Dispatch;static attach(e,t=`HPCCApps`,n,r=!0){return it.get({BaseUrl:e.baseUrl,Name:t,UserSpecific:r,Namespace:n},()=>new Store(e,t,n,r))}constructor(e,t,n,r){e instanceof StoreService?this.connection=e:this.connection=new StoreService(e),this.Name=t,this.UserSpecific=r,this.Namespace=n}_knownValues={};create(){this.connection.CreateStore({Name:this.Name,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 ValueChangedMessage(e,t,i))}).catch(n=>{console.error(`Store.set("${e}", "${t}") failed:`,n)})}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 ValueChangedMessage(e,n.Value,r)),n.Value}).catch(t=>{console.error(`Store.get(${e}) failed:`,t)})}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(t=>{let i=this._knownValues[t.Key];this._knownValues[t.Key]=t.Value,delete r[t.Key],n[t.Key]=t.Value,e&&this._dispatch.post(new ValueChangedMessage(t.Key,t.Value,i))}),e)for(let e in r)this._dispatch.post(new ValueChangedMessage(e,void 0,r[e]));return n}).catch(e=>(console.error(`Store.getAll failed:`,e),{}))}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 ValueChangedMessage(e,void 0,r))}).catch(t=>{console.error(`Store.delete(${e}) failed:`,t)})}monitor(e){return this._dispatch.attach(e)}},ot=(0,t.scopedLogger)(`@hpcc-js/comms/dfuWorkunit.ts`),$=function(e){return e[e.Unknown=0]=`Unknown`,e[e.Scheduled=1]=`Scheduled`,e[e.Queued=2]=`Queued`,e[e.Started=3]=`Started`,e[e.Aborted=4]=`Aborted`,e[e.Failed=5]=`Failed`,e[e.Finished=6]=`Finished`,e[e.Monitoring=7]=`Monitoring`,e[e.Aborting=8]=`Aborting`,e[e.NotFound=999]=`NotFound`,e}($||{}),DFUWorkunitCache=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}},st=new DFUWorkunitCache,ct=class DFUWorkunit extends t.StateObject{connection;topologyConnection;get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get ID(){return this.get(`ID`)}get DFUServerName(){return this.get(`DFUServerName`)}get ClusterName(){return this.get(`ClusterName`)}get JobName(){return this.get(`JobName`)}get Queue(){return this.get(`Queue`)}get User(){return this.get(`User`)}get isProtected(){return this.get(`isProtected`)}get Command(){return this.get(`Command`)}get CommandMessage(){return this.get(`CommandMessage`)}get PercentDone(){return this.get(`PercentDone`)}get SecsLeft(){return this.get(`SecsLeft`)}get ProgressMessage(){return this.get(`ProgressMessage`)}get SummaryMessage(){return this.get(`SummaryMessage`)}get State(){return this.get(`State`,$.Unknown)}get SourceLogicalName(){return this.get(`SourceLogicalName`)}get SourceIP(){return this.get(`SourceIP`)}get SourceFilePath(){return this.get(`SourceFilePath`)}get SourceDali(){return this.get(`SourceDali`)}get SourceRecordSize(){return this.get(`SourceRecordSize`)}get SourceFormat(){return this.get(`SourceFormat`)}get RowTag(){return this.get(`RowTag`)}get SourceNumParts(){return this.get(`SourceNumParts`)}get SourceDirectory(){return this.get(`SourceDirectory`)}get DestLogicalName(){return this.get(`DestLogicalName`)}get DestGroupName(){return this.get(`DestGroupName`)}get DestDirectory(){return this.get(`DestDirectory`)}get DestIP(){return this.get(`DestIP`)}get DestFilePath(){return this.get(`DestFilePath`)}get DestFormat(){return this.get(`DestFormat`)}get DestNumParts(){return this.get(`DestNumParts`)}get DestRecordSize(){return this.get(`DestRecordSize`)}get Replicate(){return this.get(`Replicate`)}get Overwrite(){return this.get(`Overwrite`)}get Compress(){return this.get(`Compress`)}get SourceCsvSeparate(){return this.get(`SourceCsvSeparate`)}get SourceCsvQuote(){return this.get(`SourceCsvQuote`)}get SourceCsvTerminate(){return this.get(`SourceCsvTerminate`)}get SourceCsvEscape(){return this.get(`SourceCsvEscape`)}get TimeStarted(){return this.get(`TimeStarted`)}get TimeStopped(){return this.get(`TimeStopped`)}get StateMessage(){return this.get(`StateMessage`)}get StateReason(){return this.get(`StateReason`)}get MonitorEventName(){return this.get(`MonitorEventName`)}get MonitorSub(){return this.get(`MonitorSub`)}get MonitorShotLimit(){return this.get(`MonitorShotLimit`)}get SourceDiffKeyName(){return this.get(`SourceDiffKeyName`)}get DestDiffKeyName(){return this.get(`DestDiffKeyName`)}get Archived(){return this.get(`Archived`)}get encrypt(){return this.get(`encrypt`)}get decrypt(){return this.get(`decrypt`)}get failIfNoSourceFile(){return this.get(`failIfNoSourceFile`)}get recordStructurePresent(){return this.get(`recordStructurePresent`)}get quotedTerminator(){return this.get(`quotedTerminator`)}get preserveCompression(){return this.get(`preserveCompression`)}get expireDays(){return this.get(`expireDays`)}get PreserveFileParts(){return this.get(`PreserveFileParts`)}get FileAccessCost(){return this.get(`FileAccessCost`)}get KbPerSecAve(){return this.get(`KbPerSecAve`)}get KbPerSec(){return this.get(`KbPerSec`)}static create(e,t){let n=new DFUWorkunit(e);return n.connection.CreateDFUWorkunit({DFUServerQueue:t}).then(e=>(st.set(n),n.set(e.result),n))}static attach(e,t,n){let r=st.get({BaseUrl:e.baseUrl,ID:t},()=>new DFUWorkunit(e,t));return n&&r.set(n),r}static sprayFixed(e,t){let n=new FileSprayService(e);return n.SprayFixedEx({...t}).then(t=>{let r=t.wuid;return n.GetDFUWorkunit({wuid:r}).then(t=>DFUWorkunit.attach(e,r,t.result))})}static sprayVariable(e,t){let n=new FileSprayService(e);return n.SprayVariableEx({...t}).then(t=>{let r=t.wuid;return n.GetDFUWorkunit({wuid:r}).then(t=>DFUWorkunit.attach(e,r,t.result))})}static despray(e,t){let n=new FileSprayService(e);return n.DesprayEx({...t}).then(t=>{let r=t.wuid;return n.GetDFUWorkunit({wuid:r}).then(t=>DFUWorkunit.attach(e,r,t.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 $.Finished:case $.Failed:case $.Aborted:case $.NotFound:return!0;default:}return!1}isFailed(){return!!(this.isComplete()&&this.State!==$.Finished)}isDeleted(){switch(this.State){case $.NotFound:return!0;default:}return!1}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(f.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(e=>e).catch(e=>``)}DFUWUAction(e){return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:e}).then(t=>e===f.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`,e=>{this.isComplete()&&t([e])});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(n=>{e&&e(n),this.isComplete()&&(r.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,n)=>{let r=this.watch(n=>{e&&e(n),(this.isComplete()||this.isRunning())&&(r.release(),t(this))})})}constructor(e,t){super(),this.connection=new FileSprayService(e),this.topologyConnection=new TopologyService(e),this.clearState(t)}clearState(e){this.clear({ID:e,State:$.Unknown})}GetDFUWorkunit(e={}){return this.connection.GetDFUWorkunit({...e,wuid:this.ID}).then(e=>(this.set(e.result),e)).catch(e=>{if(!e.Exception.some(e=>e.Code===20080||e.Code===20081?(this.clearState(this.ID),this.set(`State`,$.NotFound),!0):!1))throw ot.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}};e.AccessService=AccessService,e.AccountService=AccountService,e.Activity=We,e.Attribute=Attribute,e.BUILD_VERSION=a,e.BaseScope=BaseScope,e.CloudService=CloudService,e.CodesignService=CodesignService,e.Connection=u,e.DFUArrayActions=v,e.DFUChangeProtection=b,e.DFUChangeRestriction=x,e.DFUDefFileFormat=y,e.DFUService=DFUService,e.DFUWorkunit=ct,e.DFUWorkunitCache=DFUWorkunitCache,e.DFUXRefService=DFUXRefService,e.DaliService=DaliService,e.ECLGraph=ECLGraph,e.ESPConnection=d,e.ESPExceptions=ESPExceptions,e.EclService=EclService,e.ElkService=ElkService,Object.defineProperty(e,"FileSpray",{enumerable:!0,get:function(){return f}}),e.FileSprayService=FileSprayService,e.FileSprayStates=p,e.GlobalResultCache=GlobalResultCache,e.GraphCache=GraphCache,e.LogType=w,e.LogaccessService=LogaccessService,e.LogicalFile=qe,e.LogicalFileCache=LogicalFileCache,e.Machine=Ye,e.MachineCache=MachineCache,e.MachineService=MachineService,e.PKG_NAME=r,e.PKG_VERSION=i,e.PackageProcessService=PackageProcessService,e.PropertyType=Be,e.Query=rt,e.QueryGraph=et,e.RelatedProperty=Ve,e.Resource=Resource,e.ResourcesService=ResourcesService,e.Result=Pe,e.ResultCache=ResultCache,e.SMCService=SMCService,e.SashaService=SashaService,e.Scope=Scope,e.ScopeEdge=ScopeEdge,e.ScopeGraph=ScopeGraph,e.ScopeSubgraph=ScopeSubgraph,e.ScopeVertex=ScopeVertex,e.Service=Service,e.SourceFile=SourceFile,e.Store=at,e.StoreCache=StoreCache,e.StoreService=StoreService,e.TargetAudience=T,e.TargetCluster=Y,e.TargetClusterCache=TargetClusterCache,e.Timer=Timer,e.Topology=$e,e.TopologyCache=TopologyCache,e.TopologyService=TopologyService,e.ValueChangedMessage=ValueChangedMessage,e.WUStateID=z,Object.defineProperty(e,"WUUpdate",{enumerable:!0,get:function(){return B}}),e.Workunit=K,e.WorkunitCache=WorkunitCache,e.WorkunitsService=WorkunitsService,e.WorkunitsServiceEx=WorkunitsServiceEx,Object.defineProperty(e,"WsAccess",{enumerable:!0,get:function(){return m}}),Object.defineProperty(e,"WsCodesign",{enumerable:!0,get:function(){return g}}),Object.defineProperty(e,"WsDfu",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"WsLogaccess",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"WsSMC",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(e,"WsSasha",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(e,"WsTopology",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(e,"WsWorkunits",{enumerable:!0,get:function(){return R}}),e.XGMMLEdge=XGMMLEdge,e.XGMMLGraph=XGMMLGraph,e.XGMMLSubgraph=XGMMLSubgraph,e.XGMMLVertex=XGMMLVertex,e.XSDNode=XSDNode,e.XSDSchema=XSDSchema,e.XSDSimpleType=XSDSimpleType,e.XSDXMLNode=XSDXMLNode,Object.defineProperty(e,"createConnection",{enumerable:!0,get:function(){return createConnection}}),e.createGraph=createGraph,e.createXGMMLGraph=createXGMMLGraph,e.defaultTargetCluster=defaultTargetCluster,e.deserializeResponse=deserializeResponse,e.get=get,e.hookSend=hookSend,e.instanceOfIConnection=instanceOfIConnection,e.instanceOfIOptions=instanceOfIOptions,e.isArray=isArray,e.isECLResult=isECLResult,e.isExceptions=isExceptions,e.isWUInfoWorkunit=isWUInfoWorkunit,e.isWUQueryECLWorkunit=isWUQueryECLWorkunit,e.jsonp=jsonp,e.parseXSD=parseXSD,e.parseXSD2=parseXSD2,e.post=post,e.send=send,e.serializeRequest=serializeRequest,e.setTransportFactory=setTransportFactory,e.splitMetric=splitMetric,e.targetClusters=targetClusters});
|
|
6
|
+
</div>`}},Scope=class extends BaseScope{wu;constructor(e,t){super(t),this.wu=e}},SourceFile=class extends t.StateObject{connection;get properties(){return this.get()}get Wuid(){return this.get(`Wuid`)}get FileCluster(){return this.get(`FileCluster`)}get Name(){return this.get(`Name`)}get IsSuperFile(){return this.get(`IsSuperFile`)}get Subs(){return this.get(`Subs`)}get Count(){return this.get(`Count`)}get ECLSourceFiles(){return this.get(`ECLSourceFiles`)}constructor(e,t,n){super(),this.connection=e instanceof WorkunitsService?e:new WorkunitsService(e),this.set({Wuid:t,...n})}},Timer=class extends t.StateObject{connection;get properties(){return this.get()}get Wuid(){return this.get(`Wuid`)}get Name(){return this.get(`Name`)}get Value(){return this.get(`Value`)}get Seconds(){return this.get(`Seconds`)}get GraphName(){return this.get(`GraphName`)}get SubGraphId(){return this.get(`SubGraphId`)}get HasSubGraphId(){return this.get(`HasSubGraphId`)}get count(){return this.get(`count`)}get Timestamp(){return this.get(`Timestamp`)}get When(){return this.get(`When`)}constructor(e,n,r){super(),this.connection=e instanceof WorkunitsService?e:new WorkunitsService(e);let i=(0,t.espTime2Seconds)(r.Value);this.set({Wuid:n,Seconds:Math.round(i*1e3)/1e3,HasSubGraphId:r.SubGraphId!==void 0,...r})}},Fe=we(`%Y-%m-%dT%H:%M:%S.%LZ`),Ie=Te(`%Y-%m-%dT%H:%M:%S.%LZ`),Le=H(`,`);function formatNum(e){return e&&!isNaN(+e)?Le(+e):e}var Re=`DefinitionList`,ze=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,Be=[`Avg`,`Min`,`Max`,`Delta`,`StdDev`],Ve=[`SkewMin`,`SkewMax`,`NodeMin`,`NodeMax`],He=/[A-Z][a-z]*/g;function _splitMetric(e){for(let t of Ve){let n=e.indexOf(t);if(n===0)return{measure:``,ext:t,label:e.slice(n+t.length)}}let t=e.match(He);if(t?.length){let e=t.shift(),n=t.join(``);for(let t of Be){let r=n.indexOf(t);if(r===0)return n=n.slice(r+t.length),{measure:e,ext:t,label:n}}return{measure:e,ext:``,label:n}}return{measure:``,ext:``,label:e}}var Ue={};function splitMetric(e){let t=Ue[e];return t||(t=_splitMetric(e),Ue[e]=t),t}function formatValue(e,t){return e.__formattedProps?.[t]??e[t]}function safeParseFloat(e){if(e===void 0)return;let t=parseFloat(e);return isNaN(t)?void 0:t}function formatValues(e,t,n){let r=splitMetric(t);if(!n[r.measure]){n[r.label]=!0;let t=safeParseFloat(e[`${r.measure}Avg${r.label}`]),i=safeParseFloat(e[`${r.measure}Min${r.label}`]),a=safeParseFloat(e[`${r.measure}Max${r.label}`]),o=safeParseFloat(e[`${r.measure}StdDev${r.label}`]),s=Math.max((t-i)/o,(a-t)/o);return{Key:`${r.measure}${r.label}`,Value:formatValue(e,`${r.measure}${r.label}`),Avg:formatValue(e,`${r.measure}Avg${r.label}`),Min:formatValue(e,`${r.measure}Min${r.label}`),Max:formatValue(e,`${r.measure}Max${r.label}`),Delta:formatValue(e,`${r.measure}Delta${r.label}`),StdDev:formatValue(e,`${r.measure}StdDev${r.label}`),StdDevs:isNaN(s)?void 0:s,SkewMin:formatValue(e,`SkewMin${r.label}`),SkewMax:formatValue(e,`SkewMax${r.label}`),NodeMin:formatValue(e,`NodeMin${r.label}`),NodeMax:formatValue(e,`NodeMax${r.label}`)}}return null}var W=(0,t.scopedLogger)(`workunit.ts`),WorkunitCache=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}},G=new WorkunitCache,K=class Workunit extends t.StateObject{connection;topologyConnection;get BaseUrl(){return this.connection.baseUrl}_debugMode=!1;_debugAllGraph;_submitAction;get properties(){return this.get()}get Wuid(){return this.get(`Wuid`)}get Owner(){return this.get(`Owner`,``)}get Cluster(){return this.get(`Cluster`,``)}get Jobname(){return this.get(`Jobname`,``)}get Description(){return this.get(`Description`,``)}get ActionEx(){return this.get(`ActionEx`,``)}get StateID(){return this.get(`StateID`,z.Unknown)}get State(){return this.get(`State`)||z[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 ResultCache;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,()=>Pe.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 Timer(this.connection,this.Wuid,e))}_graphCache=new GraphCache;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 ECLGraph(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 Resource(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 SourceFile(this.connection,this.Wuid,e))}get VariableCount(){return this.get(`VariableCount`,0)}get Variables(){return this.get(`Variables`,{ECLResult:[]})}get TimerCount(){return this.get(`TimerCount`,0)}get HasDebugValue(){return this.get(`HasDebugValue`)}get ApplicationValueCount(){return this.get(`ApplicationValueCount`,0)}get XmlParams(){return this.get(`XmlParams`)}get AccessFlag(){return this.get(`AccessFlag`)}get ClusterFlag(){return this.get(`ClusterFlag`)}get ResultViewCount(){return this.get(`ResultViewCount`,0)}get DebugValueCount(){return this.get(`DebugValueCount`,0)}get WorkflowCount(){return this.get(`WorkflowCount`,0)}get Archived(){return this.get(`Archived`)}get RoxieCluster(){return this.get(`RoxieCluster`)}get DebugState(){return this.get(`DebugState`,{})}get Queue(){return this.get(`Queue`)}get Active(){return this.get(`Active`)}get Action(){return this.get(`Action`)}get Scope(){return this.get(`Scope`)}get AbortBy(){return this.get(`AbortBy`)}get AbortTime(){return this.get(`AbortTime`)}get AbortReason(){return this.get(`AbortReason`)}get Workflows(){return this.get(`Workflows`)}get TimingData(){return this.get(`TimingData`)}get HelpersDesc(){return this.get(`HelpersDesc`)}get GraphsDesc(){return this.get(`GraphsDesc`)}get SourceFilesDesc(){return this.get(`SourceFilesDesc`)}get ResultsDesc(){return this.get(`ResultsDesc`)}get VariablesDesc(){return this.get(`VariablesDesc`)}get TimersDesc(){return this.get(`TimersDesc`)}get DebugValuesDesc(){return this.get(`DebugValuesDesc`)}get ApplicationValuesDesc(){return this.get(`ApplicationValuesDesc`)}get WorkflowsDesc(){return this.get(`WorkflowsDesc`)}get ServiceNames(){return this.get(`ServiceNames`)}get CompileCost(){return this.get(`CompileCost`)}get ExecuteCost(){return this.get(`ExecuteCost`)}get FileAccessCost(){return this.get(`FileAccessCost`)}get NoAccess(){return this.get(`NoAccess`)}get ECLWUProcessList(){return this.get(`ECLWUProcessList`)}get CostSavingPotential(){return this.get(`CostSavingPotential`)}get FailureDesc(){return this.get(`FailureDesc`)}get FileSummaries(){return this.get(`FileSummaries`)}static create(e){let t=new Workunit(e);return t.connection.WUCreate().then(e=>(G.set(t),t.set(e.Workunit),t))}static attach(e,t,n){let r=G.get({BaseUrl:e.baseUrl,Wuid:t},()=>new Workunit(e,t));return n&&r.set(n),r}static existsLocal(e,t){return G.has({BaseUrl:e,Wuid:t})}static submit(e,t,n,r=!1){return Workunit.create(e).then(e=>e.update({QueryText:n})).then(e=>r?e.submit(t,B.Action.Compile):e.submit(t))}static compile(e,t,n){return Workunit.submit(e,t,n,!0)}static query(e,t){return new WorkunitsService(e).WUQuery(t).then(t=>t.Workunits.ECLWorkunit.map(function(t){return Workunit.attach(e,t.Wuid,t)}))}constructor(e,t){super(),this.connection=new WorkunitsService(e),this.topologyConnection=new TopologyService(e),this.clearState(t)}clearState(e){this.clear({Wuid:e,StateID:z.Unknown})}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(e=>(this.set(e.Workunit),this))}submit(e,t=B.Action.Run,n){let r;return r=e===void 0?this.topologyConnection.DefaultTpLogicalClusterQuery().then(e=>e.Name):Promise.resolve(e),this._debugMode=!1,t===B.Action.Debug&&(t=B.Action.Run,this._debugMode=!0),r.then(e=>this.connection.WUUpdate({Wuid:this.Wuid,Action:t,ResultLimit:n,DebugValues:{DebugValue:[{Name:`Debug`,Value:this._debugMode?`1`:``}]}}).then(n=>(this.set(n.Workunit),this._submitAction=t,this.connection.WUSubmit({Wuid:this.Wuid,Cluster:e})))).then(()=>this)}isComplete(){switch(this.StateID){case z.Compiled:return this.ActionEx===`compile`||this._submitAction===B.Action.Compile;case z.Completed:case z.Failed:case z.Aborted:case z.NotFound:return!0}return!1}isFailed(){switch(this.StateID){case z.Aborted:case z.Failed:return!0}return!1}isDeleted(){switch(this.StateID){case z.NotFound:return!0}return!1}isDebugging(){switch(this.StateID){case z.DebugPaused:case z.DebugRunning:return!0}return this._debugMode}isRunning(){switch(this.StateID){case z.Compiled:case z.Running:case z.Aborting:case z.Blocked:case z.DebugPaused:case z.DebugRunning:return!0}return!1}setToFailed(){return this.WUAction(R.ECLWUActions.SetToFailed)}pause(){return this.WUAction(R.ECLWUActions.Pause)}pauseNow(){return this.WUAction(R.ECLWUActions.PauseNow)}resume(){return this.WUAction(R.ECLWUActions.Resume)}abort(){return this.WUAction(R.ECLWUActions.Abort)}protect(){return this.WUAction(R.ECLWUActions.Protect)}unprotect(){return this.WUAction(R.ECLWUActions.Unprotect)}delete(){return this.WUAction(R.ECLWUActions.Delete)}restore(){return this.WUAction(R.ECLWUActions.Restore)}deschedule(){return this.WUAction(R.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(R.ECLWUActions.Reschedule)}recover(){return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!1}).then(()=>(this.clearState(this.Wuid),this.refresh().then(()=>(this._monitor(),this))))}resubmit(){return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!0}).then(()=>(this.clearState(this.Wuid),this.refresh().then(()=>(this._monitor(),this))))}clone(){return this.WUResubmit({CloneWorkunit:!0,ResetWorkflow:!1}).then(e=>Workunit.attach(this.connection.opts(),e.WUs.WU[0].WUID).refresh())}async refreshState(){return await this.WUQuery(),this.StateID===z.Compiled&&!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(e=>e.Scopes.Scope)}normalizeDetails(e,t){let n={id:{Measure:`label`},name:{Measure:`label`},type:{Measure:`label`}},r=new Map;for(let t of e.Activities?.Activity??[])r.set(t.Kind,t.Name);let i=Array(t.length);for(let e=0;e<t.length;e++){let a=t[e],o={},s={};if(a.Properties?.Property)for(let e of a.Properties.Property){let t=e.Measure,i=e.Name,a=e.RawValue;if(t===`ns`&&(e.Measure=`s`),i===`Kind`){let t=parseInt(a,10);e.Formatted=r.get(t)??a}switch(n[i]={Name:e.Name,Measure:e.Measure,Creator:e.Creator,CreatorType:e.CreatorType},e.Measure){case`bool`:o[i]=!!+a;break;case`sz`:o[i]=+a;break;case`s`:o[i]=a/1e9;break;case`ns`:o[i]=+a;break;case`ts`:o[i]=new Date(a/1e3).toISOString();break;case`cnt`:o[i]=+a;break;case`cost`:o[i]=a/1e6;break;case`node`:o[i]=+a;break;case`skw`:o[i]=+a;break;default:o[i]=a}s[i]=formatNum(e.Formatted??o[i])}let c={id:a.Id,name:a.ScopeName,type:a.ScopeType,Kind:a.Kind,Label:a.Label,__formattedProps:s,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:``,...o},l=c[Re];if(l)try{let e=JSON.parse(l.split(`\\`).join(`\\\\`)),t=[];for(let n=0;n<e.length;n++){let r=e[n].match(ze);r&&t.push({filePath:(r[1]??``)+r[2]+r[3],line:parseInt(r[5],10),col:parseInt(r[6],10)})}c[Re]=t}catch{W.error(`Unexpected "DefinitionList": ${l}`)}let u={},d=0,f=``;for(let e in c)if(!e.startsWith(`__`)){let t=formatValues(c,e,u);t&&(c.__groupedProps[t.Key]=t,!isNaN(t.StdDevs)&&t.StdDevs>d&&(d=t.StdDevs,f=t.Key))}c.__StdDevs=d,c.__StdDevsSource=f,i[e]=c}return{meta:e,columns:n,data:i}}fetchDetailsNormalized(e={}){return Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(e=>this.normalizeDetails(e[0],e[1]))}fetchInfo(e={}){return this.WUInfo(e)}fetchDetails(e={}){return this.WUDetails(e).then(e=>e.Scopes.Scope.map(e=>new Scope(this,e)))}fetchDetailsHierarchy(e={}){return this.WUDetails(e).then(e=>{let t=[],n={};e.Scopes.Scope.forEach(e=>{if(n[e.ScopeName])return n[e.ScopeName].update(e),null;{let t=new Scope(this,e);return n[t.ScopeName]=t,t}});for(let e in n)if(n.hasOwnProperty(e)){let r=n[e],i=r.parentScope();i&&n[i]?n[i].children().push(r):t.push(r)}return t})}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(e=>createGraph(e))}fetchTimeElapsed(){return this.fetchDetails({ScopeFilter:{PropertyFilters:{PropertyFilter:[{Name:`TimeElapsed`}]}}}).then(e=>{let t={};e.forEach(e=>{t[e.ScopeName]=t[e.ScopeName]||{scope:e.ScopeName,start:null,elapsed:null,finish:null},e.CAttributes.forEach(n=>{n.Name===`TimeElapsed`?t[e.ScopeName].elapsed=+n.RawValue:n.Measure===`ts`&&n.Name.indexOf(`Started`)>=0&&(t[e.ScopeName].start=n.Formatted)})});let n=[];for(let e in t){let r=t[e];if(r.start&&r.elapsed){let e=Ie(r.start);e.setMilliseconds(e.getMilliseconds()+r.elapsed/1e6),r.finish=Fe(e),n.push(r)}}return n.sort((e,t)=>e.start<t.start?-1:+(e.start>t.start)),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`,e=>{this.isComplete()&&t([e])});break;case`changed`:super.on(e,t)}else switch(e){case`changed`:super.on(e,t,n)}return this._monitor(),this}watchUntilComplete(e){return new Promise((t,n)=>{let r=this.watch(n=>{e&&e(n),this.isComplete()&&(r.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,n)=>{let r=this.watch(n=>{e&&e(n),(this.isComplete()||this.isRunning())&&(r.release(),t(this))})})}WUQuery(e={}){return this.connection.WUQuery({...e,Wuid:this.Wuid}).then(e=>(e.Workunits.ECLWorkunit.length===0?(this.clearState(this.Wuid),this.set(`StateID`,z.NotFound)):this.set(e.Workunits.ECLWorkunit[0]),e)).catch(e=>{if(!e.Exception.some(e=>e.Code===20081&&(this.clearState(this.Wuid),this.set(`StateID`,z.NotFound),!0)))throw W.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),G.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(e=>(this.set(e.Workunit),t&&this.set({ResultViews:e.ResultViews}),e)).catch(e=>{if(!e.Exception.some(e=>e.Code===20080&&(this.clearState(this.Wuid),this.set(`StateID`,z.NotFound),!0)))throw W.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}WUResubmit(e){return this.connection.WUResubmit((0,t.deepMixinT)({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails((0,t.deepMixinT)({ScopeFilter:{MaxDepth:9999},ScopeOptions:{IncludeMatchedScopesInResults:!0,IncludeScope:!0,IncludeId:!1,IncludeScopeType:!1},PropertyOptions:{IncludeName:!0,IncludeRawValue:!1,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}},e,{WUID:this.Wuid})).then(e=>(0,t.deepMixinT)({Scopes:{Scope:[]}},e))}WUAction(e){return this.connection.WUAction({Wuids:{Item:[this.Wuid]},WUActionType:e}).then(e=>this.refresh().then(()=>(this._monitor(),e)))}publish(e){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:e||this.Jobname,AllowForeignFiles:!0,Activate:R.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){let t=new WorkunitsServiceEx({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 e in t)t.hasOwnProperty(e)&&(n+=` ${e}='${t[e]}'`);return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:`<debug:${e} uid='${this.Wuid}'${n}/>`}).then(e=>e)}debug(e,n){return this.isDebugging()?this.WUCDebug(e,n).then(n=>{let r=n.children(e);return r.length?r[0]:new t.XMLNode(e)}).catch(n=>(W.error(n),Promise.resolve(new t.XMLNode(e)))):Promise.resolve(new t.XMLNode(e))}debugStatus(){return this.isDebugging()?this.debug(`status`).then(e=>{let t={...this.DebugState,...e.$};return this.set({DebugState:t}),e}):Promise.resolve({DebugState:{state:`unknown`}})}debugContinue(e=``){return this.debug(`continue`,{mode:e})}debugStep(e){return this.debug(`step`,{mode:e})}debugPause(){return this.debug(`interrupt`)}debugQuit(){return this.debug(`quit`)}debugDeleteAllBreakpoints(){return this.debug(`delete`,{idx:0})}debugBreakpointResponseParser(e){return e.children().map(e=>{if(e.name===`break`)return e.$})}debugBreakpointAdd(e,t,n){return this.debug(`breakpoint`,{id:e,mode:t,action:n}).then(e=>this.debugBreakpointResponseParser(e))}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=createXGMMLGraph(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(t=>breakpointLocations(t,e))}debugPrint(e,t=0,n=10){return this.debug(`print`,{edgeID:e,startRow:t,numRows:n}).then(e=>e.children().map(e=>{let t={};return e.children().forEach(e=>{t[e.name]=e.content}),t}))}},q=`definition`;function hasECLDefinition(e){return e._[q]!==void 0}function getECLDefinition(e){let t=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(e._[q]);if(t){let[,n,r,i]=t;return n.replace(/\/\.\//g,`/`),{id:e._.id,file:n,line:+r,column:+i}}throw Error(`Bad definition: ${e._[q]}`)}function breakpointLocations(e,t){let n=[];for(let r of e.vertices)if(hasECLDefinition(r)){let e=getECLDefinition(r);(e&&!t||t===e.file)&&n.push(e)}return n.sort((e,t)=>e.line-t.line)}var J,We=class Activity extends t.StateObject{connection;get properties(){return this.get()}get Exceptions(){return this.get(`Exceptions`)}get Build(){return this.get(`Build`)}get ThorClusterList(){return this.get(`ThorClusterList`)}get RoxieClusterList(){return this.get(`RoxieClusterList`)}get HThorClusterList(){return this.get(`HThorClusterList`)}get DFUJobs(){return this.get(`DFUJobs`)}get Running(){return this.get(`Running`,{ActiveWorkunit:[]})}get BannerContent(){return this.get(`BannerContent`)}get BannerColor(){return this.get(`BannerColor`)}get BannerSize(){return this.get(`BannerSize`)}get BannerScroll(){return this.get(`BannerScroll`)}get ChatURL(){return this.get(`ChatURL`)}get ShowBanner(){return this.get(`ShowBanner`)}get ShowChatURL(){return this.get(`ShowChatURL`)}get SortBy(){return this.get(`SortBy`)}get Descending(){return this.get(`Descending`)}get SuperUser(){return this.get(`SuperUser`)}get AccessRight(){return this.get(`AccessRight`)}get ServerJobQueues(){return this.get(`ServerJobQueues`)}get ActivityTime(){return this.get(`ActivityTime`)}get DaliDetached(){return this.get(`DaliDetached`)}static attach(e,t){return J||=new Activity(e),t&&J.set(t),J}constructor(e){super(),this.connection=e instanceof SMCService?e:new SMCService(e),this.clear({})}runningWorkunits(e=``){return this.Running.ActiveWorkunit.filter(t=>e===``||t.ClusterName===e).map(e=>K.attach(this.connection.connectionOptions(),e.Wuid,e))}setBanner(e){return this.connection.SetBanner({...e}).then(e=>(this.set(e),this))}lazyRefresh=(0,t.debounce)(async()=>{let e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}},Ge=(0,t.scopedLogger)(`logicalFile.ts`),LogicalFileCache=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}},Ke=new LogicalFileCache,qe=class LogicalFile extends t.StateObject{connection;get BaseUrl(){return this.connection.baseUrl}get Cluster(){return this.get(`Cluster`)}get Name(){return this.get(`Name`)}get Filename(){return this.get(`Filename`)}get Prefix(){return this.get(`Prefix`)}get NodeGroup(){return this.get(`NodeGroup`)}get NumParts(){return this.get(`NumParts`)}get Description(){return this.get(`Description`)}get Dir(){return this.get(`Dir`)}get PathMask(){return this.get(`PathMask`)}get Filesize(){return this.get(`Filesize`)}get FileSizeInt64(){return this.get(`FileSizeInt64`)}get RecordSize(){return this.get(`RecordSize`)}get RecordCount(){return this.get(`RecordCount`)}get RecordSizeInt64(){return this.get(`RecordSizeInt64`)}get RecordCountInt64(){return this.get(`RecordCountInt64`)}get Wuid(){return this.get(`Wuid`)}get Owner(){return this.get(`Owner`)}get JobName(){return this.get(`JobName`)}get Persistent(){return this.get(`Persistent`)}get Format(){return this.get(`Format`)}get MaxRecordSize(){return this.get(`MaxRecordSize`)}get CsvSeparate(){return this.get(`CsvSeparate`)}get CsvQuote(){return this.get(`CsvQuote`)}get CsvTerminate(){return this.get(`CsvTerminate`)}get CsvEscape(){return this.get(`CsvEscape`)}get Modified(){return this.get(`Modified`)}get Ecl(){return this.get(`Ecl`)}get Stat(){return this.get(`Stat`)}get DFUFilePartsOnClusters(){return this.get(`DFUFilePartsOnClusters`)}get isSuperfile(){return this.get(`isSuperfile`)}get ShowFileContent(){return this.get(`ShowFileContent`)}get subfiles(){return this.get(`subfiles`)}get Superfiles(){return this.get(`Superfiles`)}get ProtectList(){return this.get(`ProtectList`)}get FromRoxieCluster(){return this.get(`FromRoxieCluster`)}get Graphs(){return this.get(`Graphs`)}get UserPermission(){return this.get(`UserPermission`)}get ContentType(){return this.get(`ContentType`)}get CompressedFileSize(){return this.get(`CompressedFileSize`)}get PercentCompressed(){return this.get(`PercentCompressed`)}get IsCompressed(){return this.get(`IsCompressed`)}get BrowseData(){return this.get(`BrowseData`)}get jsonInfo(){return this.get(`jsonInfo`)}get binInfo(){return this.get(`binInfo`)}get PackageID(){return this.get(`PackageID`)}get Partition(){return this.get(`Partition`)}get Blooms(){return this.get(`Blooms`)}get ExpireDays(){return this.get(`ExpireDays`)}get KeyType(){return this.get(`KeyType`)}get IsRestricted(){return this.get(`IsRestricted`)}get AtRestCost(){return this.get(`AtRestCost`)}get AccessCost(){return this.get(`AccessCost`)}get StateID(){return this.get(`StateID`)}get ExpirationDate(){return this.get(`ExpirationDate`)}get ExtendedIndexInfo(){return this.get(`ExtendedIndexInfo`)}get CompressionType(){return this.get(`CompressionType`)}get properties(){return this.get()}static attach(e,t,n,r){let i=Ke.get({BaseUrl:e.baseUrl,Cluster:t,Name:n},()=>new LogicalFile(e,t,n));return r&&i.set(r),i}constructor(e,t,n){super(),this.connection=e instanceof DFUService?e:new DFUService(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(e=>(this.set({Cluster:this.Cluster,...e.FileDetail}),e))}fetchInfo(){return this.connection.DFUInfo({Cluster:this.Cluster,Name:this.Name}).then(e=>(this.set({Cluster:this.Cluster,...e.FileDetail,ProtectList:e?.FileDetail?.ProtectList??{DFUFileProtect:[]}}),e.FileDetail)).catch(e=>{if(!e.Exception.some(e=>e.Code===20038&&(this.set(`Name`,this.Name+` (Deleted)`),this.set(`StateID`,999),!0)))throw Ge.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}fetchDefFile(e){return this.connection.DFUFile({Name:this.Name,Format:e})}fetchAllLogicalFiles(){return this.connection.recursiveFetchLogicalFiles([this])}fetchListHistory(){return this.connection.ListHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}eraseHistory(){return this.connection.EraseHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}},MachineCache=class extends t.Cache{constructor(){super(e=>e.Address)}},Je=new MachineCache,Ye=class Machine extends t.StateObject{connection;get Address(){return this.get(`Address`)}get ConfigAddress(){return this.get(`ConfigAddress`)}get Name(){return this.get(`Name`)}get ProcessType(){return this.get(`ProcessType`)}get DisplayType(){return this.get(`DisplayType`)}get Description(){return this.get(`Description`)}get AgentVersion(){return this.get(`AgentVersion`)}get Contact(){return this.get(`Contact`)}get Location(){return this.get(`Location`)}get UpTime(){return this.get(`UpTime`)}get ComponentName(){return this.get(`ComponentName`)}get ComponentPath(){return this.get(`ComponentPath`)}get RoxieState(){return this.get(`RoxieState`)}get RoxieStateDetails(){return this.get(`RoxieStateDetails`)}get OS(){return this.get(`OS`)}get ProcessNumber(){return this.get(`ProcessNumber`)}get Channels(){return this.get(`Channels`)}get Processors(){return this.get(`Processors`)}get Storage(){return this.get(`Storage`)}get Running(){return this.get(`Running`)}get PhysicalMemory(){return this.get(`PhysicalMemory`)}get VirtualMemory(){return this.get(`VirtualMemory`)}get ComponentInfo(){return this.get(`ComponentInfo`)}get Exception(){return this.get(`Exception`)}static attach(e,t,n){let r=Je.get({Address:t},()=>new Machine(e));return n&&r.set(n),r}constructor(e){super(),this.connection=e instanceof MachineService?e:new MachineService(e)}},TargetClusterCache=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}},Xe=new TargetClusterCache,Y=class TargetCluster extends t.StateObject{connection;machineConnection;get BaseUrl(){return this.connection.baseUrl}get Name(){return this.get(`Name`)}get Prefix(){return this.get(`Prefix`)}get Type(){return this.get(`Type`)}get IsDefault(){return this.get(`IsDefault`)}get TpClusters(){return this.get(`TpClusters`)}get TpEclCCServers(){return this.get(`TpEclCCServers`)}get TpEclServers(){return this.get(`TpEclServers`)}get TpEclAgents(){return this.get(`TpEclAgents`)}get TpEclSchedulers(){return this.get(`TpEclSchedulers`)}get MachineInfoEx(){return this.get(`MachineInfoEx`,[])}get CMachineInfoEx(){return this.MachineInfoEx.map(e=>Ye.attach(this.machineConnection,e.Address,e))}static attach(e,t,n){let r=Xe.get({BaseUrl:e.baseUrl,Name:t},()=>new TargetCluster(e,t));return n&&r.set(n),r}constructor(e,t){super(),e instanceof TopologyService?(this.connection=e,this.machineConnection=new MachineService(e.connectionOptions())):(this.connection=new TopologyService(e),this.machineConnection=new MachineService(e)),this.clear({Name:t})}fetchMachines(e={}){return this.machineConnection.GetTargetClusterInfo({TargetClusters:{Item:[`${this.Type}:${this.Name}`]},...e}).then(e=>{let t=[];for(let n of e.TargetClusterInfoList.TargetClusterInfo)for(let e of n.Processes.MachineInfoEx)t.push(e);return this.set(`MachineInfoEx`,t),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 r=1-i.Available/i.Total;r>e&&(e=r)}return{maxDisk:e,meanDisk:1-(n?t/n:1)}}fetchUsage(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])}};function targetClusters(e){let t;return t=e instanceof TopologyService?e:new TopologyService(e),t.TpListTargetClusters({}).then(t=>t.TargetClusters.TpClusterNameType.map(t=>Y.attach(e,t.Name,t)))}var Ze={};function defaultTargetCluster(e){if(!Ze[e.baseUrl]){let t;t=e instanceof TopologyService?e:new TopologyService(e),Ze[e.baseUrl]=t.TpListTargetClusters({}).then(t=>{let n,r,i;t.TargetClusters.TpClusterNameType.forEach(e=>{n||=e,!r&&e.IsDefault===!0&&(r=e),!i&&e.Type===`hthor`&&(i=e)});let a=r||i||n;return Y.attach(e,a.Name,a)})}return Ze[e.baseUrl]}var TopologyCache=class extends t.Cache{constructor(){super(e=>e.BaseUrl)}},Qe=new TopologyCache,$e=class Topology extends t.StateObject{connection;get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get TargetClusters(){return this.get(`TargetClusters`)}get CTargetClusters(){return this.TargetClusters.map(e=>Y.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get(`LogicalClusters`)}get Services(){return this.get(`Services`)}static attach(e,t){let n=Qe.get({BaseUrl:e.baseUrl},()=>new Topology(e));return t&&n.set(t),n}constructor(e){super(),this.connection=e instanceof TopologyService?e:new TopologyService(e)}GetESPServiceBaseURL(e=``){return this.connection.TpServiceQuery({}).then(n=>{let r=this.connection.protocol(),i=this.connection.ip(),a=r===`https:`?`18002`:`8002`;if((0,t.exists)(`ServiceList.TpEspServers.TpEspServer`,n)){for(let i of n.ServiceList.TpEspServers.TpEspServer)if((0,t.exists)(`TpBindings.TpBinding`,i))for(let t of i.TpBindings.TpBinding)t.Service===e&&t.Protocol+`:`===r&&(a=t.Port)}return`${r}//${i}:${a}/`})}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(e=>(this.set({LogicalClusters:e.TpLogicalClusters.TpLogicalCluster}),this.LogicalClusters))}fetchServices(e={}){return this.connection.TpServiceQuery(e).then(e=>(this.set({Services:e.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)}else switch(e){case`changed`:super.on(e,t,n)}return this._monitor(),this}};function safeAssign(e,t,n){t!==`__proto__`&&t!==`constructor`&&t!==`prototype`&&(e[t]=n)}function xmlEncode(e){return e=``+e,e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`).replace(/\n/g,` `).replace(/\r/g,` `)}function espTime2Seconds(e){if(!e)return 0;if(!isNaN(+e))return parseFloat(e);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(e);if(!t)return 0;let n=+t[1]||0,r=+t[2]||0,i=+t[3]||0,a=+t[4]||0,o=+t[5]||0,s=+t[6]||0,c=+t[7]||0;return n*24*60*60+r*60*60+i*60+a+o/1e3+s/1e6+c/1e9}function unitTest(e,t){let n=e.indexOf(t);return n===-1?-1:parseFloat(e.substring(0,n))}function espSize2Bytes(e){if(!e)return 0;if(!isNaN(+e))return parseFloat(e);let t=unitTest(e,`Kb`);return t>=0?t*1024:(t=unitTest(e,`Mb`),t>=0?t*1024**2:(t=unitTest(e,`Gb`),t>=0?t*1024**3:(t=unitTest(e,`Tb`),t>=0?t*1024**4:(t=unitTest(e,`Pb`),t>=0?t*1024**5:(t=unitTest(e,`Eb`),t>=0?t*1024**6:(t=unitTest(e,`Zb`),t>=0?t*1024**7:(t=unitTest(e,`b`),t>=0?t:0)))))))}function espSkew2Number(e){return e?parseFloat(e):0}var X=function(e){return e[e.UNKNOWN=0]=`UNKNOWN`,e[e.GRAPH=1]=`GRAPH`,e[e.SUBGRAPH=2]=`SUBGRAPH`,e[e.VERTEX=3]=`VERTEX`,e[e.EDGE=4]=`EDGE`,e[e.LAST=5]=`LAST`,e}(X||{}),Z=function(e){return e.UNKNOWN=`Unknown`,e.GRAPH=`Graph`,e.SUBGRAPH=`Cluster`,e.VERTEX=`Vertex`,e.EDGE=`Edge`,e.LAST=`Last`,e}(Z||{}),LocalisedXGMMLWriter=class{graph;m_xgmml;m_visibleSubgraphs;m_visibleVertices;m_semiVisibleVertices;m_visibleEdges;noSpills;constructor(e){this.graph=e,this.m_xgmml=``,this.m_visibleSubgraphs={},this.m_visibleVertices={},this.m_semiVisibleVertices={},this.m_visibleEdges={}}calcVisibility(e,t,n,r){this.noSpills=r,e.forEach(e=>{this.graph.isVertex(e)?(this.calcInVertexVisibility(e,n),this.calcOutVertexVisibility(e,n)):this.graph.isEdge(e)?(this.calcInVertexVisibility(e.getSource(),n-1),this.calcOutVertexVisibility(e.getTarget(),n-1)):this.graph.isSubgraph(e)&&(this.m_visibleSubgraphs[e.__hpcc_id]=e,this.calcSubgraphVisibility(e,t-1))}),this.calcVisibility2()}calcInVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getInEdges().forEach(e=>{this.calcInVertexVisibility(e.getSource(),t-1)})}calcOutVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getOutEdges().forEach(e=>{this.calcOutVertexVisibility(e.getTarget(),t-1)})}calcSubgraphVisibility(e,t){if(t<0)return;t>0&&e.__hpcc_subgraphs.forEach((e,n)=>{this.calcSubgraphVisibility(e,t-1)}),e.__hpcc_subgraphs.forEach((e,t)=>{this.m_visibleSubgraphs[e.__hpcc_id]=e}),e.__hpcc_vertices.forEach((e,t)=>{this.m_visibleVertices[e.__hpcc_id]=e});let n={};this.graph.edges.forEach((t,r)=>{t.getSource().__hpcc_parent!==t.getTarget().__hpcc_parent&&e===this.getCommonAncestor(t)&&(n[t.getSource().__hpcc_parent.__hpcc_id+`::`+t.getTarget().__hpcc_parent.__hpcc_id]||(n[t.getSource().__hpcc_parent.__hpcc_id+`::`+t.getTarget().__hpcc_parent.__hpcc_id]=!0,this.m_visibleEdges[t.__hpcc_id]=t))})}buildVertexString(e,t){let n=``,r=``,i=e.getProperties();for(let e in i)t&&e.indexOf(`_kind`)>=0?r+=`<att name="_kind" value="point"/>`:e===`id`||e===`label`?n+=` `+e+`="`+xmlEncode(i[e])+`"`:r+=`<att name="`+e+`" value="`+xmlEncode(i[e])+`"/>`;return`<node`+n+`>`+r+`</node>`}buildEdgeString(e){let t=``,n=``,r=e.getProperties();for(let e in r)e.toLowerCase()===`id`||e.toLowerCase()===`label`||e.toLowerCase()===`source`||e.toLowerCase()===`target`?t+=` `+e+`="`+xmlEncode(r[e])+`"`:n+=`<att name="`+e+`" value="`+xmlEncode(r[e])+`"/>`;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,o=null;for(;i>=0&&a>=0&&n[i]===r[a];)o=n[i],--i,--a;return o}getCommonAncestor(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())}calcAncestorVisibility(e){let t=[];this.getAncestors(e,t),t.forEach((e,t)=>{this.m_visibleSubgraphs[e.__hpcc_id]=e})}calcVisibility2(){for(let e in this.m_visibleVertices){let t=this.m_visibleVertices[e];t.getInEdges().forEach((e,t)=>{this.m_visibleEdges[e.__hpcc_id]=e}),t.getOutEdges().forEach((e,t)=>{this.m_visibleEdges[e.__hpcc_id]=e}),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 e=n.getInEdges();if(e.length)this.addSemiVisibleEdge(e[0]),n=e[0].getSource(),this.addSemiVisibleVertex(n);else break}let r=t.getTarget();for(this.addSemiVisibleVertex(r);this.noSpills&&r.isSpill();){let e=r.getOutEdges();if(e.length)this.addSemiVisibleEdge(e[0]),r=e[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 t=e.__hpcc_vertices[0];t&&(this.m_xgmml+=this.buildVertexString(t,!0))}let i=e.getProperties();for(let e in i)n+=`<att name="`+e+`" value="`+xmlEncode(i[e])+`"/>`;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))}},GraphItem=class{__hpcc_graph;__hpcc_parent;__widget;__hpcc_id;_globalID;constructor(e,t){this.__hpcc_graph=e,this.__hpcc_id=t,this._globalID=t}getProperties(){let e={};for(let t in this)t.indexOf(`__`)!==0&&this.hasOwnProperty(t)&&(e[t]=this[t]);return e}},Subgraph=class extends GraphItem{_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)})}},Vertex=class extends GraphItem{_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(e=>{e.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)}},Edge=class extends GraphItem{_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&&=e.__hpcc_id,this.__widget&&this.__widget.setSource(this.getSource().__widget)}getTarget(){return this.__hpcc_graph.idx[this._targetActivity||this.target]}},et=class 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 t=new DOMParser().parseFromString(e,`text/xml`);this.walkDocument(t.documentElement,`0`)}isSubgraph(e){return e instanceof Subgraph}isVertex(e){return e instanceof Vertex}isEdge(e){return e instanceof Edge}getGlobalType(e){return e instanceof Vertex?X.VERTEX:e instanceof Edge?X.EDGE:e instanceof Subgraph?X.SUBGRAPH:e instanceof QueryGraph?X.GRAPH:X.UNKNOWN}getGlobalTypeString(e){return e instanceof Vertex?Z.VERTEX:e instanceof Edge?Z.EDGE:e instanceof Subgraph?Z.SUBGRAPH:e instanceof QueryGraph?Z.GRAPH:Z.UNKNOWN}getItem(e,t){if(!this.idx[t])switch(e.tagName){case`graph`:let e=new Subgraph(this,t);this.subgraphs.push(e),this.idx[t]=e;break;case`node`:let n=new Vertex(this,t);this.vertices.push(n),this.idx[t]=n;break;case`edge`:let r=new Edge(this,t);this.edges.push(r),this.idx[t]=r;break;default:console.warn(`Graph.getItem - Unknown Node Type!`)}let n=this.idx[t];return Array.from(e.attributes).forEach(e=>{safeAssign(n,e.name,e.value)}),n}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof Subgraph?this.subgraphs=this.subgraphs.filter(t=>e!==t):e instanceof Vertex?this.vertices=this.vertices.filter(t=>e!==t):e instanceof Edge&&(this.edges=this.edges.filter(t=>e!==t))}getChildByTagName(e,t){let n=null;return Array.from(e.childNodes).some(e=>{if(e.tagName===t)return n=e,!0}),n}walkDocument(e,t){let n=this.getItem(e,t);return e.childNodes.forEach(e=>{if(e.nodeType===1)switch(e.tagName){case`graph`:break;case`node`:let t=!1,r=this.getChildByTagName(e,`att`);if(r){let i=this.getChildByTagName(r,`graph`);if(i){t=!0;let r=this.walkDocument(i,e.getAttribute(`id`));n.addSubgraph(r)}}if(!t){let t=this.walkDocument(e,e.getAttribute(`id`));n.addVertex(t)}break;case`att`:let i=e.getAttribute(`name`),a=`_`+i,o=e.getAttribute(`value`);i.indexOf(`Time`)===0?(safeAssign(n,a,o),safeAssign(n,i,``+espTime2Seconds(o))):i.indexOf(`Size`)===0?(safeAssign(n,a,o),safeAssign(n,i,``+espSize2Bytes(o))):i.indexOf(`Skew`)===0?(safeAssign(n,a,o),safeAssign(n,i,``+espSkew2Number(o))):safeAssign(n,i,o);break;case`edge`:let s=this.walkDocument(e,e.getAttribute(`id`));if(s.NumRowsProcessed===void 0?s.Count===void 0?s.count!==void 0&&(s._eclwatchCount=s.count.replace(/\B(?=(\d{3})+(?!\d))/g,`,`)):s._eclwatchCount=s.Count.replace(/\B(?=(\d{3})+(?!\d))/g,`,`):s._eclwatchCount=s.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,`,`),s.inputProgress&&(s._eclwatchInputProgress=`[`+s.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,`,`)+`]`),s.SkewMaxRowsProcessed&&s.SkewMinRowsProcessed&&(s._eclwatchSkew=`+`+s.SkewMaxRowsProcessed+`, `+s.SkewMinRowsProcessed),!s._dependsOn&&!s._childGraph&&(s._sourceActivity||s._targetActivity)){s._isSpill=!0;let e=s.getSource();e&&(e._isSpill=!0);let t=s.getTarget();t&&(t._isSpill=!0)}n.addEdge(s)}}),n}removeSubgraphs(){[...this.subgraphs].forEach(e=>{e.__hpcc_parent instanceof Subgraph&&e.remove()})}removeSpillVertices(){[...this.vertices].forEach(e=>{e.isSpill()&&e.remove()})}getLocalisedXGMML(e,t,n,r){let i=new LocalisedXGMMLWriter(this);return i.calcVisibility(e,t,n,r),i.writeXgmml(),`<graph>`+i.m_xgmml+`</graph>`}},Q=(0,t.scopedLogger)(`@hpcc-js/comms/ecl/query.ts`),tt=H(`~s`);function isNumber(e){return!isNaN(parseFloat(e))&&!isNaN(e-0)}var QueryCache=class extends t.Cache{constructor(){super(e=>t.Cache.hash([e.QueryId,e.QuerySet]))}},nt=new QueryCache,rt=class Query extends t.StateObject{wsWorkunitsService;get BaseUrl(){return this.wsWorkunitsService.baseUrl}topology;_requestSchema;_responseSchema;get properties(){return this.get()}get Exceptions(){return this.get(`Exceptions`)}get QueryId(){return this.get(`QueryId`)}get QuerySet(){return this.get(`QuerySet`)}get QueryName(){return this.get(`QueryName`)}get Wuid(){return this.get(`Wuid`)}get Dll(){return this.get(`Dll`)}get Suspended(){return this.get(`Suspended`)}get Activated(){return this.get(`Activated`)}get SuspendedBy(){return this.get(`SuspendedBy`)}get Clusters(){return this.get(`Clusters`)}get PublishedBy(){return this.get(`PublishedBy`)}get Comment(){return this.get(`Comment`)}get LogicalFiles(){return this.get(`LogicalFiles`)}get SuperFiles(){return this.get(`SuperFiles`)}get IsLibrary(){return this.get(`IsLibrary`)}get Priority(){return this.get(`Priority`)}get WUSnapShot(){return this.get(`WUSnapShot`)}get CompileTime(){return this.get(`CompileTime`)}get LibrariesUsed(){return this.get(`LibrariesUsed`)}get CountGraphs(){return this.get(`CountGraphs`)}get ResourceURLCount(){return this.get(`ResourceURLCount`)}get WsEclAddresses(){return this.get(`WsEclAddresses`)}get WUGraphs(){return this.get(`WUGraphs`)}get WUTimers(){return this.get(`WUTimers`)}get PriorityID(){return this.get(`PriorityID`)}constructor(e,t,n,r){super(),this.wsWorkunitsService=e instanceof WorkunitsService?e:new WorkunitsService(e),this.topology=$e.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:t,QueryId:n,...r})}static attach(e,t,n,r){let i=nt.get({BaseUrl:e.baseUrl,QuerySet:t,QueryId:n},()=>new Query(e,t,n));return r&&i.set(r),i}_eclService;async wsEclService(){return this._eclService||=this.topology.fetchServices({}).then(e=>{for(let t of e?.TpEspServers?.TpEspServer??[])for(let e of t?.TpBindings?.TpBinding??[])if(e?.Service===`ws_ecl`)return new EclService({baseUrl:`${e.Protocol}://${globalThis.location.hostname}:${e.Port}`})}),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(e){Q.debug(e.message??e),this._requestSchema=[]}}async fetchResponseSchema(){let e=await this.wsEclService();try{this._responseSchema=await e?.responseJson(this.QuerySet,this.QueryId)??{}}catch(e){Q.debug(e.message??e),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(e=>{let t=new et,n=!0;for(let r of e?.Graphs?.ECLGraphEx||[])n?(t.load(r.Graph),n=!1):t.merge(r.Graph);return t})}fetchDetailsNormalized(e={}){let t=K.attach(this.wsWorkunitsService,this.Wuid);return t?Promise.all([this.fetchGraph(),t.fetchDetailsMeta(),t.fetchDetailsRaw(e)]).then(e=>{let n=e[0],r=e[1],i=e[2].map(e=>{let t=e.Id[0];if(t===`a`||t===`e`){let t=n.idx[e.Id.substring(1)];if(!t)return Q.debug(`Missing graph data for metric ID: ${e.Id}`),e;let r=new Set(e.Properties.Property.map(e=>e.Name)),i=[];for(let e in t){let n=e.charAt(0);if(n!==`_`&&n===n.toUpperCase()&&!r.has(e)){let n=t[e],r=typeof n;if(r===`string`||r===`number`||r===`boolean`){let t=isNumber(n)?parseFloat(n):n,r=n;e.indexOf(`Time`)>=0&&(t/=1e9,r=tt(t)+`s`),i.push({Name:e,RawValue:t,Formatted:r})}}}i.length>0&&e.Properties.Property.push(...i)}return e});return t.normalizeDetails(r,i)}):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(e=>{for(let t in e)e[t]=e[t].Row;return e})??[]}catch(e){return Q.debug(e.message??e),[]}}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]:[]}},StoreCache=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}},it=new StoreCache,ValueChangedMessage=class extends t.Message{key;value;oldValue;constructor(e,t,n){super(),this.key=e,this.value=t,this.oldValue=n}get canConflate(){return!0}conflate(e){return this.key===e.key&&(this.value=e.value,!0)}void(){return this.value===this.oldValue}},at=class Store{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new t.Dispatch;static attach(e,t=`HPCCApps`,n,r=!0){return it.get({BaseUrl:e.baseUrl,Name:t,UserSpecific:r,Namespace:n},()=>new Store(e,t,n,r))}constructor(e,t,n,r){this.connection=e instanceof StoreService?e:new StoreService(e),this.Name=t,this.UserSpecific=r,this.Namespace=n}_knownValues={};create(){this.connection.CreateStore({Name:this.Name,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 ValueChangedMessage(e,t,i))}).catch(n=>{console.error(`Store.set("${e}", "${t}") failed:`,n)})}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 ValueChangedMessage(e,n.Value,r)),n.Value}).catch(t=>{console.error(`Store.get(${e}) failed:`,t)})}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(t=>{let i=this._knownValues[t.Key];this._knownValues[t.Key]=t.Value,delete r[t.Key],n[t.Key]=t.Value,e&&this._dispatch.post(new ValueChangedMessage(t.Key,t.Value,i))}),e)for(let e in r)this._dispatch.post(new ValueChangedMessage(e,void 0,r[e]));return n}).catch(e=>(console.error(`Store.getAll failed:`,e),{}))}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 ValueChangedMessage(e,void 0,r))}).catch(t=>{console.error(`Store.delete(${e}) failed:`,t)})}monitor(e){return this._dispatch.attach(e)}},ot=(0,t.scopedLogger)(`@hpcc-js/comms/dfuWorkunit.ts`),$=function(e){return e[e.Unknown=0]=`Unknown`,e[e.Scheduled=1]=`Scheduled`,e[e.Queued=2]=`Queued`,e[e.Started=3]=`Started`,e[e.Aborted=4]=`Aborted`,e[e.Failed=5]=`Failed`,e[e.Finished=6]=`Finished`,e[e.Monitoring=7]=`Monitoring`,e[e.Aborting=8]=`Aborting`,e[e.NotFound=999]=`NotFound`,e}($||{}),DFUWorkunitCache=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}},st=new DFUWorkunitCache,ct=class DFUWorkunit extends t.StateObject{connection;topologyConnection;get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get ID(){return this.get(`ID`)}get DFUServerName(){return this.get(`DFUServerName`)}get ClusterName(){return this.get(`ClusterName`)}get JobName(){return this.get(`JobName`)}get Queue(){return this.get(`Queue`)}get User(){return this.get(`User`)}get isProtected(){return this.get(`isProtected`)}get Command(){return this.get(`Command`)}get CommandMessage(){return this.get(`CommandMessage`)}get PercentDone(){return this.get(`PercentDone`)}get SecsLeft(){return this.get(`SecsLeft`)}get ProgressMessage(){return this.get(`ProgressMessage`)}get SummaryMessage(){return this.get(`SummaryMessage`)}get State(){return this.get(`State`,$.Unknown)}get SourceLogicalName(){return this.get(`SourceLogicalName`)}get SourceIP(){return this.get(`SourceIP`)}get SourceFilePath(){return this.get(`SourceFilePath`)}get SourceDali(){return this.get(`SourceDali`)}get SourceRecordSize(){return this.get(`SourceRecordSize`)}get SourceFormat(){return this.get(`SourceFormat`)}get RowTag(){return this.get(`RowTag`)}get SourceNumParts(){return this.get(`SourceNumParts`)}get SourceDirectory(){return this.get(`SourceDirectory`)}get DestLogicalName(){return this.get(`DestLogicalName`)}get DestGroupName(){return this.get(`DestGroupName`)}get DestDirectory(){return this.get(`DestDirectory`)}get DestIP(){return this.get(`DestIP`)}get DestFilePath(){return this.get(`DestFilePath`)}get DestFormat(){return this.get(`DestFormat`)}get DestNumParts(){return this.get(`DestNumParts`)}get DestRecordSize(){return this.get(`DestRecordSize`)}get Replicate(){return this.get(`Replicate`)}get Overwrite(){return this.get(`Overwrite`)}get Compress(){return this.get(`Compress`)}get SourceCsvSeparate(){return this.get(`SourceCsvSeparate`)}get SourceCsvQuote(){return this.get(`SourceCsvQuote`)}get SourceCsvTerminate(){return this.get(`SourceCsvTerminate`)}get SourceCsvEscape(){return this.get(`SourceCsvEscape`)}get TimeStarted(){return this.get(`TimeStarted`)}get TimeStopped(){return this.get(`TimeStopped`)}get StateMessage(){return this.get(`StateMessage`)}get StateReason(){return this.get(`StateReason`)}get MonitorEventName(){return this.get(`MonitorEventName`)}get MonitorSub(){return this.get(`MonitorSub`)}get MonitorShotLimit(){return this.get(`MonitorShotLimit`)}get SourceDiffKeyName(){return this.get(`SourceDiffKeyName`)}get DestDiffKeyName(){return this.get(`DestDiffKeyName`)}get Archived(){return this.get(`Archived`)}get encrypt(){return this.get(`encrypt`)}get decrypt(){return this.get(`decrypt`)}get failIfNoSourceFile(){return this.get(`failIfNoSourceFile`)}get recordStructurePresent(){return this.get(`recordStructurePresent`)}get quotedTerminator(){return this.get(`quotedTerminator`)}get preserveCompression(){return this.get(`preserveCompression`)}get expireDays(){return this.get(`expireDays`)}get PreserveFileParts(){return this.get(`PreserveFileParts`)}get FileAccessCost(){return this.get(`FileAccessCost`)}get KbPerSecAve(){return this.get(`KbPerSecAve`)}get KbPerSec(){return this.get(`KbPerSec`)}static create(e,t){let n=new DFUWorkunit(e);return n.connection.CreateDFUWorkunit({DFUServerQueue:t}).then(e=>(st.set(n),n.set(e.result),n))}static attach(e,t,n){let r=st.get({BaseUrl:e.baseUrl,ID:t},()=>new DFUWorkunit(e,t));return n&&r.set(n),r}static sprayFixed(e,t){let n=new FileSprayService(e);return n.SprayFixedEx({...t}).then(t=>{let r=t.wuid;return n.GetDFUWorkunit({wuid:r}).then(t=>DFUWorkunit.attach(e,r,t.result))})}static sprayVariable(e,t){let n=new FileSprayService(e);return n.SprayVariableEx({...t}).then(t=>{let r=t.wuid;return n.GetDFUWorkunit({wuid:r}).then(t=>DFUWorkunit.attach(e,r,t.result))})}static despray(e,t){let n=new FileSprayService(e);return n.DesprayEx({...t}).then(t=>{let r=t.wuid;return n.GetDFUWorkunit({wuid:r}).then(t=>DFUWorkunit.attach(e,r,t.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 $.Finished:case $.Failed:case $.Aborted:case $.NotFound:return!0}return!1}isFailed(){return!!(this.isComplete()&&this.State!==$.Finished)}isDeleted(){switch(this.State){case $.NotFound:return!0}return!1}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(f.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(e=>e).catch(e=>``)}DFUWUAction(e){return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:e}).then(t=>e===f.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`,e=>{this.isComplete()&&t([e])});break;case`changed`:super.on(e,t)}else switch(e){case`changed`:super.on(e,t,n)}return this._monitor(),this}watchUntilComplete(e){return new Promise((t,n)=>{let r=this.watch(n=>{e&&e(n),this.isComplete()&&(r.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,n)=>{let r=this.watch(n=>{e&&e(n),(this.isComplete()||this.isRunning())&&(r.release(),t(this))})})}constructor(e,t){super(),this.connection=new FileSprayService(e),this.topologyConnection=new TopologyService(e),this.clearState(t)}clearState(e){this.clear({ID:e,State:$.Unknown})}GetDFUWorkunit(e={}){return this.connection.GetDFUWorkunit({...e,wuid:this.ID}).then(e=>(this.set(e.result),e)).catch(e=>{if(!e.Exception.some(e=>e.Code===20080||e.Code===20081?(this.clearState(this.ID),this.set(`State`,$.NotFound),!0):!1))throw ot.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}};e.AccessService=AccessService,e.AccountService=AccountService,e.Activity=We,e.Attribute=Attribute,e.BUILD_VERSION=a,e.BaseScope=BaseScope,e.CloudService=CloudService,e.CodesignService=CodesignService,e.Connection=u,e.DFUArrayActions=v,e.DFUChangeProtection=b,e.DFUChangeRestriction=x,e.DFUDefFileFormat=y,e.DFUService=DFUService,e.DFUWorkunit=ct,e.DFUWorkunitCache=DFUWorkunitCache,e.DFUXRefService=DFUXRefService,e.DaliService=DaliService,e.ECLGraph=ECLGraph,e.ESPConnection=d,e.ESPExceptions=ESPExceptions,e.EclService=EclService,e.ElkService=ElkService,Object.defineProperty(e,"FileSpray",{enumerable:!0,get:function(){return f}}),e.FileSprayService=FileSprayService,e.FileSprayStates=p,e.GlobalResultCache=GlobalResultCache,e.GraphCache=GraphCache,e.LogType=w,e.LogaccessService=LogaccessService,e.LogicalFile=qe,e.LogicalFileCache=LogicalFileCache,e.Machine=Ye,e.MachineCache=MachineCache,e.MachineService=MachineService,e.PKG_NAME=r,e.PKG_VERSION=i,e.PackageProcessService=PackageProcessService,e.PropertyType=Be,e.Query=rt,e.QueryGraph=et,e.RelatedProperty=Ve,e.Resource=Resource,e.ResourcesService=ResourcesService,e.Result=Pe,e.ResultCache=ResultCache,e.SMCService=SMCService,e.SashaService=SashaService,e.Scope=Scope,e.ScopeEdge=ScopeEdge,e.ScopeGraph=ScopeGraph,e.ScopeSubgraph=ScopeSubgraph,e.ScopeVertex=ScopeVertex,e.Service=Service,e.SourceFile=SourceFile,e.Store=at,e.StoreCache=StoreCache,e.StoreService=StoreService,e.TargetAudience=T,e.TargetCluster=Y,e.TargetClusterCache=TargetClusterCache,e.Timer=Timer,e.Topology=$e,e.TopologyCache=TopologyCache,e.TopologyService=TopologyService,e.ValueChangedMessage=ValueChangedMessage,e.WUStateID=z,Object.defineProperty(e,"WUUpdate",{enumerable:!0,get:function(){return B}}),e.Workunit=K,e.WorkunitCache=WorkunitCache,e.WorkunitsService=WorkunitsService,e.WorkunitsServiceEx=WorkunitsServiceEx,Object.defineProperty(e,"WsAccess",{enumerable:!0,get:function(){return m}}),Object.defineProperty(e,"WsCodesign",{enumerable:!0,get:function(){return g}}),Object.defineProperty(e,"WsDfu",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"WsLogaccess",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"WsSMC",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(e,"WsSasha",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(e,"WsTopology",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(e,"WsWorkunits",{enumerable:!0,get:function(){return R}}),e.XGMMLEdge=XGMMLEdge,e.XGMMLGraph=XGMMLGraph,e.XGMMLSubgraph=XGMMLSubgraph,e.XGMMLVertex=XGMMLVertex,e.XSDNode=XSDNode,e.XSDSchema=XSDSchema,e.XSDSimpleType=XSDSimpleType,e.XSDXMLNode=XSDXMLNode,Object.defineProperty(e,"createConnection",{enumerable:!0,get:function(){return createConnection}}),e.createGraph=createGraph,e.createXGMMLGraph=createXGMMLGraph,e.defaultTargetCluster=defaultTargetCluster,e.deserializeResponse=deserializeResponse,e.get=get,e.hookSend=hookSend,e.instanceOfIConnection=instanceOfIConnection,e.instanceOfIOptions=instanceOfIOptions,e.isArray=isArray,e.isECLResult=isECLResult,e.isExceptions=isExceptions,e.isWUInfoWorkunit=isWUInfoWorkunit,e.isWUQueryECLWorkunit=isWUQueryECLWorkunit,e.jsonp=jsonp,e.parseXSD=parseXSD,e.parseXSD2=parseXSD2,e.post=post,e.send=send,e.serializeRequest=serializeRequest,e.setTransportFactory=setTransportFactory,e.splitMetric=splitMetric,e.targetClusters=targetClusters});
|
|
7
7
|
//# sourceMappingURL=index.umd.cjs.map
|