@hpcc-js/comms 3.7.6 → 3.7.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.
- package/dist/browser/index.js +3673 -1568
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.umd.cjs +1 -6
- package/dist/browser/index.umd.cjs.map +1 -1
- package/dist/node/index.cjs +134 -49
- package/dist/node/index.cjs.map +4 -4
- package/dist/node/index.js +134 -49
- package/dist/node/index.js.map +4 -4
- package/package.json +7 -7
- package/src/__package__.ts +2 -2
- package/src/ecl/query.ts +23 -10
- package/src/ecl/workunit.ts +61 -42
- package/types/__package__.d.ts +2 -2
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
(function(global,factory){typeof exports=="object"&&typeof module<"u"?factory(exports,require("@hpcc-js/util")):typeof define=="function"&&define.amd?define(["exports","@hpcc-js/util"],factory):(global=typeof globalThis<"u"?globalThis:global||self,factory(global["@hpcc-js/comms"]={},global["@hpcc-js/util"]))})(this,function(exports2,util){"use strict";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);const PKG_NAME="@hpcc-js/comms",PKG_VERSION="3.7.5",BUILD_VERSION="3.8.5",logger$6=util.scopedLogger("comms/connection.ts");function instanceOfIOptions(object){return"baseUrl"in object}const DefaultOptions={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function instanceOfIConnection(object){return typeof object.opts=="function"&&typeof object.send=="function"&&typeof object.clone=="function"}function encode(uriComponent,encodeRequest){return encodeRequest===void 0||encodeRequest===!0?encodeURIComponent(uriComponent):""+uriComponent}function serializeRequest(obj,encodeRequest=!0,prefix=""){if(prefix&&(prefix+="."),typeof obj!="object")return encode(obj,encodeRequest);const str=[];for(const key in obj)if(obj.hasOwnProperty(key))if(obj[key]instanceof Array){let includeItemCount=!1;obj[key].forEach((row,i)=>{typeof row=="object"?(includeItemCount=!0,str.push(serializeRequest(row,encodeRequest,prefix+encode(`${key}.${i}`,encodeRequest)))):str.push(prefix+encode(`${key}_i${i}`,encodeRequest)+"="+serializeRequest(row,encodeRequest))}),includeItemCount&&str.push(prefix+encode(`${key}.itemcount`,encodeRequest)+"="+obj[key].length)}else typeof obj[key]=="object"?obj[key]&&obj[key].Item instanceof Array?(str.push(serializeRequest(obj[key].Item,encodeRequest,prefix+encode(key,encodeRequest))),str.push(prefix+encode(`${key}.itemcount`,encodeRequest)+"="+obj[key].Item.length)):str.push(serializeRequest(obj[key],encodeRequest,prefix+encode(key,encodeRequest))):obj[key]!==void 0?str.push(prefix+encode(key,encodeRequest)+"="+encode(obj[key],encodeRequest)):str.push(prefix+encode(key,encodeRequest));return str.join("&")}function deserializeResponse(body){return JSON.parse(body)}function jsonp(opts,action,request={},responseType="json",header){return header&&console.warn("Header attributes ignored for JSONP connections"),new Promise((resolve,reject)=>{let respondedTimeout=opts.timeoutSecs*1e3;const respondedTick=5e3,callbackName="jsonp_callback_"+Math.round(Math.random()*999999);window[callbackName]=function(response){respondedTimeout=0,doCallback(),resolve(responseType==="json"&&typeof response=="string"?deserializeResponse(response):response)};const script=document.createElement("script");let url=util.join(opts.baseUrl,action);url+=url.indexOf("?")>=0?"&":"?",script.src=url+"jsonp="+callbackName+"&"+serializeRequest(request,opts.encodeRequest),document.body.appendChild(script);const progress=setInterval(function(){respondedTimeout<=0?clearInterval(progress):(respondedTimeout-=respondedTick,respondedTimeout<=0?(clearInterval(progress),logger$6.error("Request timeout: "+script.src),doCallback(),reject(Error("Request timeout: "+script.src))):logger$6.debug("Request pending ("+respondedTimeout/1e3+" sec): "+script.src))},respondedTick);function doCallback(){delete window[callbackName],document.body.removeChild(script)}})}function authHeader(opts){return opts.userID?{Authorization:`Basic ${btoa(`${opts.userID}:${opts.password}`)}`}:{}}const _omitMap={};function doFetch(opts,action,requestInit,headersInit,responseType){headersInit={...authHeader(opts),...headersInit},requestInit={credentials:_omitMap[opts.baseUrl]?"omit":"include",...requestInit,headers:headersInit},fetch.__setGlobalDispatcher&&fetch.__setGlobalDispatcher(fetch.__defaultAgent),opts.baseUrl.indexOf("https:")===0&&(opts.rejectUnauthorized===!1&&fetch.__rejectUnauthorizedAgent?fetch.__setGlobalDispatcher?fetch.__setGlobalDispatcher(fetch.__rejectUnauthorizedAgent):requestInit.agent=fetch.__rejectUnauthorizedAgent:fetch.__trustwaveAgent&&(requestInit.agent=fetch.__trustwaveAgent));function handleResponse(response){if(response.ok)return responseType==="json"?response.json():response.text();throw new Error(response.statusText)}return util.promiseTimeout(opts.timeoutSecs*1e3,fetch(util.join(opts.baseUrl,action),requestInit).then(handleResponse).catch(e=>(requestInit.credentials=_omitMap[opts.baseUrl]?"include":"omit",fetch(util.join(opts.baseUrl,action),requestInit).then(handleResponse).then(responseBody=>(_omitMap[opts.baseUrl]=!_omitMap[opts.baseUrl],responseBody)))))}function post(opts,action,request,responseType="json",header){request.upload_&&(delete request.upload_,action+="?upload_");let abortSignal;return request.abortSignal_&&(abortSignal=request.abortSignal_,delete request.abortSignal_),doFetch(opts,action,{method:"post",body:serializeRequest(request,opts.encodeRequest),signal:abortSignal},{"Content-Type":"application/x-www-form-urlencoded",...header},responseType)}function get(opts,action,request,responseType="json",header){let abortSignal;return request.abortSignal_&&(abortSignal=request.abortSignal_,delete request.abortSignal_),doFetch(opts,`${action}?${serializeRequest(request,opts.encodeRequest)}`,{method:"get",signal:abortSignal},{...header},responseType)}function send(opts,action,request,responseType="json",header){let retVal;switch(opts.type){case"jsonp":retVal=jsonp(opts,action,request,responseType,header);break;case"get":retVal=get(opts,action,request,responseType,header);break;case"post":default:retVal=post(opts,action,request,responseType,header);break}return retVal}let hookedSend=send;function hookSend(newSend){const retVal=hookedSend;return newSend&&(hookedSend=newSend),retVal}class Connection{constructor(opts){__publicField(this,"_opts");this.opts(opts)}get baseUrl(){return this._opts.baseUrl}opts(_){return arguments.length===0?this._opts:(this._opts={...DefaultOptions,..._},this)}send(action,request,responseType="json",header){return this._opts.hookSend?this._opts.hookSend(this._opts,action,request,responseType,hookedSend,header):hookedSend(this._opts,action,request,responseType,header)}clone(){return new Connection(this.opts())}}exports2.createConnection=function(opts){return new Connection(opts)};function setTransportFactory(newFunc){const retVal=exports2.createConnection;return exports2.createConnection=newFunc,retVal}function isArray(arg){return Object.prototype.toString.call(arg)==="[object Array]"}class ESPExceptions extends Error{constructor(action,request,exceptions){super("ESPException: "+exceptions.Source);__publicField(this,"isESPExceptions",!0);__publicField(this,"action");__publicField(this,"request");__publicField(this,"Source");__publicField(this,"Exception");this.action=action,this.request=request,this.Source=exceptions.Source,this.Exception=exceptions.Exception,exceptions.Exception.length?this.message=`${exceptions.Exception[0].Code}: ${exceptions.Exception[0].Message}`:this.message=""}}function isExceptions(err){return err instanceof ESPExceptions||err.isESPExceptions&&Array.isArray(err.Exception)}function isConnection(optsConnection){return optsConnection.send!==void 0}class ESPConnection{constructor(optsConnection,service,version){__publicField(this,"_connection");__publicField(this,"_service");__publicField(this,"_version");this._connection=isConnection(optsConnection)?optsConnection:exports2.createConnection(optsConnection),this._service=service,this._version=version}get baseUrl(){return this._connection.opts().baseUrl}service(_){return _===void 0?this._service:(this._service=_,this)}version(_){return _===void 0?this._version:(this._version=_,this)}toESPStringArray(target,arrayName){if(isArray(target[arrayName])){for(let i=0;i<target[arrayName].length;++i)target[arrayName+"_i"+i]=target[arrayName][i];delete target[arrayName]}return target}opts(_){return _===void 0?this._connection.opts():(this._connection.opts(_),this)}send(action,_request={},espResponseType="json",largeUpload=!1,abortSignal,espResponseField){const request={..._request,ver_:this._version};largeUpload&&(request.upload_=!0),abortSignal&&(request.abortSignal_=abortSignal);let serviceAction,responseType="json";switch(espResponseType){case"text":serviceAction=util.join(this._service,action),responseType="text";break;case"xsd":serviceAction=util.join(this._service,action+".xsd"),responseType="text";break;case"json2":serviceAction=util.join(this._service,action+"/json"),espResponseType="json",action=action.split("/").pop();break;default:serviceAction=util.join(this._service,action+".json")}return this._connection.send(serviceAction,request,responseType).then(response=>{if(espResponseType==="json"){let retVal;if(response&&response.Exceptions)throw new ESPExceptions(action,request,response.Exceptions);if(response&&(retVal=response[espResponseField||action+"Response"]),!retVal)throw new ESPExceptions(action,request,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return retVal}return response})}clone(){return new ESPConnection(this._connection.clone(),this._service,this._version)}}class Service{constructor(optsConnection,service,version){__publicField(this,"_connection");this._connection=new ESPConnection(optsConnection,service,version)}get baseUrl(){return this._connection.opts().baseUrl}opts(){return this._connection.opts()}connection(){return this._connection.clone()}}exports2.FileSpray=void 0,(FileSpray2=>{(DFUWUActions2=>{DFUWUActions2.Delete="Delete",DFUWUActions2.Protect="Protect",DFUWUActions2.Unprotect="Unprotect",DFUWUActions2.Restore="Restore",DFUWUActions2.SetToFailed="SetToFailed",DFUWUActions2.Archive="Archive"})(FileSpray2.DFUWUActions||(FileSpray2.DFUWUActions={}))})(exports2.FileSpray||(exports2.FileSpray={}));class FileSprayServiceBase extends Service{constructor(optsConnection){super(optsConnection,"FileSpray","1.26")}AbortDFUWorkunit(request){return this._connection.send("AbortDFUWorkunit",request,"json",!1,void 0,"AbortDFUWorkunitResponse")}Copy(request){return this._connection.send("Copy",request,"json",!1,void 0,"CopyResponse")}CreateDFUPublisherWorkunit(request){return this._connection.send("CreateDFUPublisherWorkunit",request,"json",!1,void 0,"CreateDFUPublisherWorkunitResponse")}CreateDFUWorkunit(request){return this._connection.send("CreateDFUWorkunit",request,"json",!1,void 0,"CreateDFUWorkunitResponse")}DFUWUFile(request){return this._connection.send("DFUWUFile",request,"json",!1,void 0,"DFUWUFileResponse")}DFUWUSearch(request){return this._connection.send("DFUWUSearch",request,"json",!1,void 0,"DFUWUSearchResponse")}DFUWorkunitsAction(request){return this._connection.send("DFUWorkunitsAction",request,"json",!1,void 0,"DFUWorkunitsActionResponse")}DeleteDFUWorkunit(request){return this._connection.send("DeleteDFUWorkunit",request,"json",!1,void 0,"DeleteDFUWorkunitResponse")}DeleteDFUWorkunits(request){return this._connection.send("DeleteDFUWorkunits",request,"json",!1,void 0,"DeleteDFUWorkunitsResponse")}DeleteDropZoneFiles(request){return this._connection.send("DeleteDropZoneFiles",request,"json",!1,void 0,"DFUWorkunitsActionResponse")}Despray(request){return this._connection.send("Despray",request,"json",!1,void 0,"DesprayResponse")}DfuMonitor(request){return this._connection.send("DfuMonitor",request,"json",!1,void 0,"DfuMonitorResponse")}DropZoneFileSearch(request){return this._connection.send("DropZoneFileSearch",request,"json",!1,void 0,"DropZoneFileSearchResponse")}DropZoneFiles(request){return this._connection.send("DropZoneFiles",request,"json",!1,void 0,"DropZoneFilesResponse")}EchoDateTime(request){return this._connection.send("EchoDateTime",request,"json",!1,void 0,"EchoDateTimeResponse")}FileList(request){return this._connection.send("FileList",request,"json",!1,void 0,"FileListResponse")}GetDFUExceptions(request){return this._connection.send("GetDFUExceptions",request,"json",!1,void 0,"GetDFUExceptionsResponse")}GetDFUProgress(request){return this._connection.send("GetDFUProgress",request,"json",!1,void 0,"ProgressResponse")}GetDFUServerQueues(request){return this._connection.send("GetDFUServerQueues",request,"json",!1,void 0,"GetDFUServerQueuesResponse")}GetDFUWorkunit(request){return this._connection.send("GetDFUWorkunit",request,"json",!1,void 0,"GetDFUWorkunitResponse")}GetDFUWorkunits(request){return this._connection.send("GetDFUWorkunits",request,"json",!1,void 0,"GetDFUWorkunitsResponse")}GetRemoteTargets(request){return this._connection.send("GetRemoteTargets",request,"json",!1,void 0,"GetRemoteTargetsResponse")}GetSprayTargets(request){return this._connection.send("GetSprayTargets",request,"json",!1,void 0,"GetSprayTargetsResponse")}OpenSave(request){return this._connection.send("OpenSave",request,"json",!1,void 0,"OpenSaveResponse")}Ping(request){return this._connection.send("Ping",request,"json",!1,void 0,"FileSprayPingResponse")}Rename(request){return this._connection.send("Rename",request,"json",!1,void 0,"RenameResponse")}Replicate(request){return this._connection.send("Replicate",request,"json",!1,void 0,"ReplicateResponse")}ShowResult(request){return this._connection.send("ShowResult",request,"json",!1,void 0,"ShowResultResponse")}SprayFixed(request){return this._connection.send("SprayFixed",request,"json",!1,void 0,"SprayFixedResponse")}SprayVariable(request){return this._connection.send("SprayVariable",request,"json",!1,void 0,"SprayResponse")}SubmitDFUWorkunit(request){return this._connection.send("SubmitDFUWorkunit",request,"json",!1,void 0,"SubmitDFUWorkunitResponse")}UpdateDFUWorkunit(request){return this._connection.send("UpdateDFUWorkunit",request,"json",!1,void 0,"UpdateDFUWorkunitResponse")}}var FileSprayStates=(FileSprayStates2=>(FileSprayStates2[FileSprayStates2.unknown=0]="unknown",FileSprayStates2[FileSprayStates2.scheduled=1]="scheduled",FileSprayStates2[FileSprayStates2.queued=2]="queued",FileSprayStates2[FileSprayStates2.started=3]="started",FileSprayStates2[FileSprayStates2.aborted=4]="aborted",FileSprayStates2[FileSprayStates2.failed=5]="failed",FileSprayStates2[FileSprayStates2.finished=6]="finished",FileSprayStates2[FileSprayStates2.monitoring=7]="monitoring",FileSprayStates2[FileSprayStates2.aborting=8]="aborting",FileSprayStates2[FileSprayStates2.notfound=999]="notfound",FileSprayStates2))(FileSprayStates||{});class FileSprayService extends FileSprayServiceBase{DFUWUFileEx(request){return this._connection.send("DFUWUFile",request,"text")}SprayFixedEx(request){return this._connection.send("SprayFixed",request)}SprayVariableEx(request){return this._connection.send("SprayVariable",request,"json",!1,null,"SprayResponse")}DesprayEx(request){return this._connection.send("Despray",request)}UpdateDFUWorkunitEx(request){return this._connection.send("UpdateDFUWorkunit",request,"json",!1,void 0,"UpdateDFUWorkunitResponse")}}exports2.WsAccess=void 0,(WsAccess2=>{(ViewMemberType2=>{ViewMemberType2.User="User",ViewMemberType2.Group="Group"})(WsAccess2.ViewMemberType||(WsAccess2.ViewMemberType={})),(UserSortBy2=>{UserSortBy2.username="username",UserSortBy2.fullname="fullname",UserSortBy2.passwordexpiration="passwordexpiration",UserSortBy2.employeeID="employeeID",UserSortBy2.employeeNumber="employeeNumber"})(WsAccess2.UserSortBy||(WsAccess2.UserSortBy={})),(GroupSortBy2=>{GroupSortBy2.Name="Name",GroupSortBy2.ManagedBy="ManagedBy"})(WsAccess2.GroupSortBy||(WsAccess2.GroupSortBy={})),(AccountTypeReq2=>{AccountTypeReq2.Any="Any",AccountTypeReq2.User="User",AccountTypeReq2.Group="Group"})(WsAccess2.AccountTypeReq||(WsAccess2.AccountTypeReq={})),(ResourcePermissionSortBy2=>{ResourcePermissionSortBy2.Name="Name",ResourcePermissionSortBy2.Type="Type"})(WsAccess2.ResourcePermissionSortBy||(WsAccess2.ResourcePermissionSortBy={})),(ResourceSortBy2=>{ResourceSortBy2.Name="Name"})(WsAccess2.ResourceSortBy||(WsAccess2.ResourceSortBy={}))})(exports2.WsAccess||(exports2.WsAccess={}));class AccessServiceBase extends Service{constructor(optsConnection){super(optsConnection,"ws_access","1.17")}AccountPermissions(request){return this._connection.send("AccountPermissions",request,"json",!1,void 0,"AccountPermissionsResponse")}AccountPermissionsV2(request){return this._connection.send("AccountPermissionsV2",request,"json",!1,void 0,"AccountPermissionsV2Response")}AddUser(request){return this._connection.send("AddUser",request,"json",!1,void 0,"AddUserResponse")}AddView(request){return this._connection.send("AddView",request,"json",!1,void 0,"AddViewResponse")}AddViewColumn(request){return this._connection.send("AddViewColumn",request,"json",!1,void 0,"AddViewColumnResponse")}AddViewMember(request){return this._connection.send("AddViewMember",request,"json",!1,void 0,"AddViewMemberResponse")}ClearPermissionsCache(request){return this._connection.send("ClearPermissionsCache",request,"json",!1,void 0,"ClearPermissionsCacheResponse")}DeleteView(request){return this._connection.send("DeleteView",request,"json",!1,void 0,"DeleteViewResponse")}DeleteViewColumn(request){return this._connection.send("DeleteViewColumn",request,"json",!1,void 0,"DeleteViewColumnResponse")}DeleteViewMember(request){return this._connection.send("DeleteViewMember",request,"json",!1,void 0,"DeleteViewMemberResponse")}DisableScopeScans(request){return this._connection.send("DisableScopeScans",request,"json",!1,void 0,"DisableScopeScansResponse")}EnableScopeScans(request){return this._connection.send("EnableScopeScans",request,"json",!1,void 0,"EnableScopeScansResponse")}FilePermission(request){return this._connection.send("FilePermission",request,"json",!1,void 0,"FilePermissionResponse")}GroupAction(request){return this._connection.send("GroupAction",request,"json",!1,void 0,"GroupActionResponse")}GroupAdd(request){return this._connection.send("GroupAdd",request,"json",!1,void 0,"GroupAddResponse")}GroupEdit(request){return this._connection.send("GroupEdit",request,"json",!1,void 0,"GroupEditResponse")}GroupMemberEdit(request){return this._connection.send("GroupMemberEdit",request,"json",!1,void 0,"GroupMemberEditResponse")}GroupMemberEditInput(request){return this._connection.send("GroupMemberEditInput",request,"json",!1,void 0,"GroupMemberEditInputResponse")}GroupMemberQuery(request){return this._connection.send("GroupMemberQuery",request,"json",!1,void 0,"GroupMemberQueryResponse")}GroupQuery(request){return this._connection.send("GroupQuery",request,"json",!1,void 0,"GroupQueryResponse")}Groups(request){return this._connection.send("Groups",request,"json",!1,void 0,"GroupResponse")}PermissionAction(request){return this._connection.send("PermissionAction",request,"json",!1,void 0,"PermissionActionResponse")}Permissions(request){return this._connection.send("Permissions",request,"json",!1,void 0,"BasednsResponse")}PermissionsReset(request){return this._connection.send("PermissionsReset",request,"json",!1,void 0,"PermissionsResetResponse")}Ping(request){return this._connection.send("Ping",request,"json",!1,void 0,"ws_accessPingResponse")}QueryScopeScansEnabled(request){return this._connection.send("QueryScopeScansEnabled",request,"json",!1,void 0,"QueryScopeScansEnabledResponse")}QueryUserViewColumns(request){return this._connection.send("QueryUserViewColumns",request,"json",!1,void 0,"QueryUserViewColumnsResponse")}QueryViewColumns(request){return this._connection.send("QueryViewColumns",request,"json",!1,void 0,"QueryViewColumnsResponse")}QueryViewMembers(request){return this._connection.send("QueryViewMembers",request,"json",!1,void 0,"QueryViewMembersResponse")}QueryViews(request){return this._connection.send("QueryViews",request,"json",!1,void 0,"QueryViewsResponse")}ResourceAdd(request){return this._connection.send("ResourceAdd",request,"json",!1,void 0,"ResourceAddResponse")}ResourceDelete(request){return this._connection.send("ResourceDelete",request,"json",!1,void 0,"ResourceDeleteResponse")}ResourcePermissionQuery(request){return this._connection.send("ResourcePermissionQuery",request,"json",!1,void 0,"ResourcePermissionQueryResponse")}ResourcePermissions(request){return this._connection.send("ResourcePermissions",request,"json",!1,void 0,"ResourcePermissionsResponse")}ResourceQuery(request){return this._connection.send("ResourceQuery",request,"json",!1,void 0,"ResourceQueryResponse")}Resources(request){return this._connection.send("Resources",request,"json",!1,void 0,"ResourcesResponse")}UserAccountExport(request){return this._connection.send("UserAccountExport",request,"json",!1,void 0,"UserAccountExportResponse")}UserAction(request){return this._connection.send("UserAction",request,"json",!1,void 0,"UserActionResponse")}UserEdit(request){return this._connection.send("UserEdit",request,"json",!1,void 0,"UserEditResponse")}UserGroupEdit(request){return this._connection.send("UserGroupEdit",request,"json",!1,void 0,"UserGroupEditResponse")}UserGroupEditInput(request){return this._connection.send("UserGroupEditInput",request,"json",!1,void 0,"UserGroupEditInputResponse")}UserInfoEdit(request){return this._connection.send("UserInfoEdit",request,"json",!1,void 0,"UserInfoEditResponse")}UserInfoEditInput(request){return this._connection.send("UserInfoEditInput",request,"json",!1,void 0,"UserInfoEditInputResponse")}UserPosix(request){return this._connection.send("UserPosix",request,"json",!1,void 0,"UserPosixResponse")}UserPosixInput(request){return this._connection.send("UserPosixInput",request,"json",!1,void 0,"UserPosixInputResponse")}UserQuery(request){return this._connection.send("UserQuery",request,"json",!1,void 0,"UserQueryResponse")}UserResetPass(request){return this._connection.send("UserResetPass",request,"json",!1,void 0,"UserResetPassResponse")}UserResetPassInput(request){return this._connection.send("UserResetPassInput",request,"json",!1,void 0,"UserResetPassInputResponse")}UserSudoers(request){return this._connection.send("UserSudoers",request,"json",!1,void 0,"UserSudoersResponse")}UserSudoersInput(request){return this._connection.send("UserSudoersInput",request,"json",!1,void 0,"UserSudoersInputResponse")}Users(request){return this._connection.send("Users",request,"json",!1,void 0,"UserResponse")}}class AccessService extends AccessServiceBase{}class AccountServiceBase extends Service{constructor(optsConnection){super(optsConnection,"ws_account","1.07")}MyAccount(request){return this._connection.send("MyAccount",request,"json",!1,void 0,"MyAccountResponse")}Ping(request){return this._connection.send("Ping",request,"json",!1,void 0,"ws_accountPingResponse")}UpdateUser(request){return this._connection.send("UpdateUser",request,"json",!1,void 0,"UpdateUserResponse")}UpdateUserInput(request){return this._connection.send("UpdateUserInput",request,"json",!1,void 0,"UpdateUserInputResponse")}VerifyUser(request){return this._connection.send("VerifyUser",request,"json",!1,void 0,"VerifyUserResponse")}}class AccountService extends AccountServiceBase{VerifyUser(request){return this._connection.send("VerifyUser",request).catch(e=>{if(e.isESPExceptions&&e.Exception.some(exception=>exception.Code===20043))return{retcode:20043,Exceptions:{Source:"wsAccount",Exception:e.Exception}};throw e})}}class CloudServiceBase extends Service{constructor(optsConnection){super(optsConnection,"WsCloud","1.02")}GetPODs(request){return this._connection.send("GetPODs",request,"json",!1,void 0,"GetPODsResponse")}GetServices(request){return this._connection.send("GetServices",request,"json",!1,void 0,"GetServicesResponse")}Ping(request){return this._connection.send("Ping",request,"json",!1,void 0,"WsCloudPingResponse")}}const logger$5=util.scopedLogger("@hpcc-js/comms/services/wsCloud.ts");function isGetPODsResponse_v1_02(response){return(response==null?void 0:response.Pods)!==void 0}function mapPorts(pod){var _a,_b;return((_b=(_a=pod.spec)==null?void 0:_a.containers)==null?void 0:_b.reduce((prev,curr)=>{var _a2;return(_a2=curr.ports)==null||_a2.forEach(p=>{prev.push({ContainerPort:p.containerPort,Name:p.name,Protocol:p.protocol})}),prev},[]))??[]}function mapPods(pods){return pods.filter(pod=>{var _a;const labels=((_a=pod==null?void 0:pod.metadata)==null?void 0:_a.labels)??{};return labels.hasOwnProperty("app.kubernetes.io/part-of")&&labels["app.kubernetes.io/part-of"]==="HPCC-Platform"}).map(pod=>{var _a,_b,_c,_d,_e,_f,_g,_h,_i,_j;const started=new Date((_a=pod.metadata)==null?void 0:_a.creationTimestamp);return{Name:pod.metadata.name,Status:(_b=pod.status)==null?void 0:_b.phase,CreationTimestamp:started.toISOString(),ContainerName:((_d=(_c=pod.status)==null?void 0:_c.containerStatuses)==null?void 0:_d.reduce((prev,curr)=>(curr.name&&prev.push(curr.name),prev),[]).join(", "))??"",ContainerCount:((_f=(_e=pod.spec)==null?void 0:_e.containers)==null?void 0:_f.length)??0,ContainerReadyCount:(_h=(_g=pod.status)==null?void 0:_g.containerStatuses)==null?void 0:_h.reduce((prev,curr)=>prev+(curr.ready?1:0),0),ContainerRestartCount:(_j=(_i=pod.status)==null?void 0:_i.containerStatuses)==null?void 0:_j.reduce((prev,curr)=>prev+curr.restartCount,0),Ports:{Port:mapPorts(pod)}}})}class CloudService extends CloudServiceBase{getPODs(){return super.GetPODs({}).then(response=>{var _a;if(isGetPODsResponse_v1_02(response))return((_a=response.Pods)==null?void 0:_a.Pod)??[];try{const obj=typeof response.Result=="string"?JSON.parse(response.Result):response.Result;return mapPods((obj==null?void 0:obj.items)??[])}catch(error){return logger$5.error(`Error parsing V1Pods json '${error instanceof Error?error.message:String(error)}'`),[]}})}}class CodesignService{constructor(optsConnection){__publicField(this,"_connection");this._connection=new ESPConnection(optsConnection,"ws_codesign","1.1")}connectionOptions(){return this._connection.opts()}ListUserIDs(request){return this._connection.send("ListUserIDs",request).then(response=>response.UserIDs.Item).catch(e=>[])}Sign(request){return this._connection.send("Sign",{SigningMethod:"gpg",...request})}Verify(request){return this._connection.send("Verify",request)}}class DaliServiceBase extends Service{constructor(optsConnection){super(optsConnection,"WSDali","1.07")}Add(request){return this._connection.send("Add",request,"json",!1,void 0,"ResultResponse")}ClearTraceTransactions(request){return this._connection.send("ClearTraceTransactions",request,"json",!1,void 0,"ResultResponse")}Count(request){return this._connection.send("Count",request,"json",!1,void 0,"CountResponse")}DFSCheck(request){return this._connection.send("DFSCheck",request,"json",!1,void 0,"ResultResponse")}DFSExists(request){return this._connection.send("DFSExists",request,"json",!1,void 0,"BooleanResponse")}DFSLS(request){return this._connection.send("DFSLS",request,"json",!1,void 0,"ResultResponse")}Delete(request){return this._connection.send("Delete",request,"json",!1,void 0,"ResultResponse")}DisconnectClientConnection(request){return this._connection.send("DisconnectClientConnection",request,"json",!1,void 0,"ResultResponse")}GetClients(request){return this._connection.send("GetClients",request,"json",!1,void 0,"ResultResponse")}GetConnections(request){return this._connection.send("GetConnections",request,"json",!1,void 0,"ResultResponse")}GetDFSCSV(request){return this._connection.send("GetDFSCSV",request,"json",!1,void 0,"ResultResponse")}GetDFSMap(request){return this._connection.send("GetDFSMap",request,"json",!1,void 0,"ResultResponse")}GetDFSParents(request){return this._connection.send("GetDFSParents",request,"json",!1,void 0,"ResultResponse")}GetLogicalFile(request){return this._connection.send("GetLogicalFile",request,"json",!1,void 0,"ResultResponse")}GetLogicalFilePart(request){return this._connection.send("GetLogicalFilePart",request,"json",!1,void 0,"ResultResponse")}GetProtectedList(request){return this._connection.send("GetProtectedList",request,"json",!1,void 0,"ResultResponse")}GetSDSStats(request){return this._connection.send("GetSDSStats",request,"json",!1,void 0,"ResultResponse")}GetSDSSubscribers(request){return this._connection.send("GetSDSSubscribers",request,"json",!1,void 0,"ResultResponse")}GetValue(request){return this._connection.send("GetValue",request,"json",!1,void 0,"ResultResponse")}Import(request){return this._connection.send("Import",request,"json",!1,void 0,"ResultResponse")}ListSDSLocks(request){return this._connection.send("ListSDSLocks",request,"json",!1,void 0,"ResultResponse")}Ping(request){return this._connection.send("Ping",request,"json",!1,void 0,"WSDaliPingResponse")}SaveSDSStore(request){return this._connection.send("SaveSDSStore",request,"json",!1,void 0,"ResultResponse")}SetLogicalFilePartAttr(request){return this._connection.send("SetLogicalFilePartAttr",request,"json",!1,void 0,"ResultResponse")}SetProtected(request){return this._connection.send("SetProtected",request,"json",!1,void 0,"ResultResponse")}SetTraceSlowTransactions(request){return this._connection.send("SetTraceSlowTransactions",request,"json",!1,void 0,"ResultResponse")}SetTraceTransactions(request){return this._connection.send("SetTraceTransactions",request,"json",!1,void 0,"ResultResponse")}SetUnprotected(request){return this._connection.send("SetUnprotected",request,"json",!1,void 0,"ResultResponse")}SetValue(request){return this._connection.send("SetValue",request,"json",!1,void 0,"ResultResponse")}UnlockSDSLock(request){return this._connection.send("UnlockSDSLock",request,"json",!1,void 0,"ResultResponse")}}class DaliService extends DaliServiceBase{}exports2.WsDfu=void 0,(WsDfu2=>{(DFUArrayActions2=>{DFUArrayActions2.Delete="Delete",DFUArrayActions2.AddToSuperfile="Add To Superfile",DFUArrayActions2.ChangeProtection="Change Protection",DFUArrayActions2.ChangeRestriction="Change Restriction"})(WsDfu2.DFUArrayActions||(WsDfu2.DFUArrayActions={})),(DFUChangeProtection2=>{DFUChangeProtection2[DFUChangeProtection2.NoChange=0]="NoChange",DFUChangeProtection2[DFUChangeProtection2.Protect=1]="Protect",DFUChangeProtection2[DFUChangeProtection2.Unprotect=2]="Unprotect",DFUChangeProtection2[DFUChangeProtection2.UnprotectAll=3]="UnprotectAll"})(WsDfu2.DFUChangeProtection||(WsDfu2.DFUChangeProtection={})),(DFUChangeRestriction2=>{DFUChangeRestriction2[DFUChangeRestriction2.NoChange=0]="NoChange",DFUChangeRestriction2[DFUChangeRestriction2.Restrict=1]="Restrict",DFUChangeRestriction2[DFUChangeRestriction2.Unrestricted=2]="Unrestricted"})(WsDfu2.DFUChangeRestriction||(WsDfu2.DFUChangeRestriction={})),(DFUDefFileFormat2=>{DFUDefFileFormat2.xml="xml",DFUDefFileFormat2.def="def"})(WsDfu2.DFUDefFileFormat||(WsDfu2.DFUDefFileFormat={})),(FileAccessRole2=>{FileAccessRole2.Token="Token",FileAccessRole2.Engine="Engine",FileAccessRole2.External="External"})(WsDfu2.FileAccessRole||(WsDfu2.FileAccessRole={})),(SecAccessType2=>{SecAccessType2.None="None",SecAccessType2.Access="Access",SecAccessType2.Read="Read",SecAccessType2.Write="Write",SecAccessType2.Full="Full"})(WsDfu2.SecAccessType||(WsDfu2.SecAccessType={})),(DFUFileType2=>{DFUFileType2.Flat="Flat",DFUFileType2.Index="Index",DFUFileType2.Xml="Xml",DFUFileType2.Csv="Csv",DFUFileType2.Json="Json",DFUFileType2.IndexLocal="IndexLocal",DFUFileType2.IndexPartitioned="IndexPartitioned",DFUFileType2.Unset="Unset"})(WsDfu2.DFUFileType||(WsDfu2.DFUFileType={}))})(exports2.WsDfu||(exports2.WsDfu={}));class DfuServiceBase extends Service{constructor(optsConnection){super(optsConnection,"WsDfu","1.65")}Add(request){return this._connection.send("Add",request,"json",!1,void 0,"AddResponse")}AddRemote(request){return this._connection.send("AddRemote",request,"json",!1,void 0,"AddRemoteResponse")}AddtoSuperfile(request){return this._connection.send("AddtoSuperfile",request,"json",!1,void 0,"AddtoSuperfileResponse")}DFUArrayAction(request){return this._connection.send("DFUArrayAction",request,"json",!1,void 0,"DFUArrayActionResponse")}DFUBrowseData(request){return this._connection.send("DFUBrowseData",request,"json",!1,void 0,"DFUBrowseDataResponse")}DFUDefFile(request){return this._connection.send("DFUDefFile",request,"json",!1,void 0,"DFUDefFileResponse")}DFUFileAccess(request){return this._connection.send("DFUFileAccess",request,"json",!1,void 0,"DFUFileAccessResponse")}DFUFileAccessV2(request){return this._connection.send("DFUFileAccessV2",request,"json",!1,void 0,"DFUFileAccessResponse")}DFUFileCreate(request){return this._connection.send("DFUFileCreate",request,"json",!1,void 0,"DFUFileCreateResponse")}DFUFileCreateV2(request){return this._connection.send("DFUFileCreateV2",request,"json",!1,void 0,"DFUFileCreateResponse")}DFUFilePublish(request){return this._connection.send("DFUFilePublish",request,"json",!1,void 0,"DFUFilePublishResponse")}DFUFileView(request){return this._connection.send("DFUFileView",request,"json",!1,void 0,"DFUFileViewResponse")}DFUGetDataColumns(request){return this._connection.send("DFUGetDataColumns",request,"json",!1,void 0,"DFUGetDataColumnsResponse")}DFUGetFileMetaData(request){return this._connection.send("DFUGetFileMetaData",request,"json",!1,void 0,"DFUGetFileMetaDataResponse")}DFUInfo(request){return this._connection.send("DFUInfo",request,"json",!1,void 0,"DFUInfoResponse")}DFUQuery(request){return this._connection.send("DFUQuery",request,"json",!1,void 0,"DFUQueryResponse")}DFURecordTypeInfo(request){return this._connection.send("DFURecordTypeInfo",request,"json",!1,void 0,"DFURecordTypeInfoResponse")}DFUSearch(request){return this._connection.send("DFUSearch",request,"json",!1,void 0,"DFUSearchResponse")}DFUSearchData(request){return this._connection.send("DFUSearchData",request,"json",!1,void 0,"DFUSearchDataResponse")}DFUSpace(request){return this._connection.send("DFUSpace",request,"json",!1,void 0,"DFUSpaceResponse")}EclRecordTypeInfo(request){return this._connection.send("EclRecordTypeInfo",request,"json",!1,void 0,"EclRecordTypeInfoResponse")}EraseHistory(request){return this._connection.send("EraseHistory",request,"json",!1,void 0,"EraseHistoryResponse")}ListHistory(request){return this._connection.send("ListHistory",request,"json",!1,void 0,"ListHistoryResponse")}Ping(request){return this._connection.send("Ping",request,"json",!1,void 0,"WsDfuPingResponse")}Savexml(request){return this._connection.send("Savexml",request,"json",!1,void 0,"SavexmlResponse")}SuperfileAction(request){return this._connection.send("SuperfileAction",request,"json",!1,void 0,"SuperfileActionResponse")}SuperfileList(request){return this._connection.send("SuperfileList",request,"json",!1,void 0,"SuperfileListResponse")}}const DFUArrayActions=exports2.WsDfu.DFUArrayActions,DFUDefFileFormat=exports2.WsDfu.DFUDefFileFormat,DFUChangeProtection=exports2.WsDfu.DFUChangeProtection,DFUChangeRestriction=exports2.WsDfu.DFUChangeRestriction;class DFUService extends DfuServiceBase{DFUFile(request){return this._connection.send("DFUDefFile",request,"text")}async recursiveFetchLogicalFiles(superFiles){const childSuperFiles=[],logicalFiles=[];return await Promise.all(superFiles.map(superFile=>this.DFUInfo({Cluster:superFile.NodeGroup,Name:superFile.Name,IncludeJsonTypeInfo:!1,IncludeBinTypeInfo:!1,ForceIndexInfo:!1}).then(response=>{var _a,_b,_c,_d;for(const child of((_b=(_a=response==null?void 0:response.FileDetail)==null?void 0:_a.Superfiles)==null?void 0:_b.DFULogicalFile)??[])childSuperFiles.push(child);for(const child of((_d=(_c=response==null?void 0:response.FileDetail)==null?void 0:_c.subfiles)==null?void 0:_d.Item)??[])logicalFiles.push(child)}))),logicalFiles.concat(childSuperFiles.length?await this.recursiveFetchLogicalFiles(childSuperFiles):[])}}class DFUXRefService extends Service{constructor(optsConnection){super(optsConnection,"WsDFUXRef","1.01")}DFUXRefArrayAction(request){return this._connection.send("DFUXRefArrayAction",request)}DFUXRefBuild(request){return this._connection.send("DFUXRefBuild",request)}DFUXRefBuildCancel(request){return this._connection.send("DFUXRefBuildCancel",request)}DFUXRefCleanDirectories(request){return this._connection.send("DFUXRefCleanDirectories",request)}DFUXRefDirectories(request){return this._connection.send("DFUXRefDirectories",request,void 0,void 0,void 0,"DFUXRefDirectoriesQueryResponse")}DFUXRefFoundFiles(request){return this._connection.send("DFUXRefFoundFiles",request,void 0,void 0,void 0,"DFUXRefFoundFilesQueryResponse")}DFUXRefList(request={}){return this._connection.send("DFUXRefList",request)}DFUXRefLostFiles(request){return this._connection.send("DFUXRefLostFiles",request,void 0,void 0,void 0,"DFUXRefLostFilesQueryResponse")}DFUXRefMessages(request){return this._connection.send("DFUXRefMessages",request,void 0,void 0,void 0,"DFUXRefMessagesQueryResponse")}DFUXRefOrphanFiles(request){return this._connection.send("DFUXRefOrphanFiles",request,void 0,void 0,void 0,"DFUXRefOrphanFilesQueryResponse")}DFUXRefUnusedFiles(request){return this._connection.send("DFUXRefUnusedFiles",request)}}function jsonToIField(id,item){const type=typeof item;switch(type){case"boolean":case"number":case"string":return{id,type};case"object":if(item.Row instanceof Array&&(item=item.Row),item instanceof Array)return{id,type:"dataset",children:jsonToIFieldArr(item[0])};if(item instanceof Object){if(item.Item&&item.Item instanceof Array&&item.Item.length===1){const fieldType=typeof item.Item[0];if(fieldType==="string"||fieldType==="number")return{id,type:"set",fieldType};throw new Error("Unknown field type")}return{id,type:"object",fields:jsonToIFieldObj(item)}}default:throw new Error("Unknown field type")}}function jsonToIFieldArr(json){json.Row&&json.Row instanceof Array&&(json=json.Row[0]);const retVal=[];for(const key in json)retVal.push(jsonToIField(key,json[key]));return retVal}function jsonToIFieldObj(json){const fields={};for(const key in json)fields[key]=jsonToIField(key,json[key]);return fields}class EclService extends Service{constructor(optsConnection){super(optsConnection,"WsEcl","0")}opts(){return this._connection.opts()}requestJson(querySet,queryId){return this._connection.send(`example/request/query/${querySet}/${queryId}/json`,{},"text").then(response=>{const requestSchema=JSON.parse(response);for(const key in requestSchema)return requestSchema[key];return{}}).then(jsonToIFieldArr)}responseJson(querySet,queryId){return this._connection.send(`example/response/query/${querySet}/${queryId}/json`,{},"text").then(response=>{const responseSchema=JSON.parse(response);for(const key in responseSchema)return responseSchema[key].Results;return{}}).then(resultsJson=>{const retVal={};for(const key in resultsJson)retVal[key]=jsonToIFieldArr(resultsJson[key]);return retVal})}submit(querySet,queryId,request){const action=`submit/query/${querySet}/${queryId}`;return this._connection.send(action,request,"json2").then(response=>{if(response.Results&&response.Results.Exception)throw new ESPExceptions(action,request,{Source:"wsEcl.submit",Exception:response.Results.Exception});return response.Results})}}class ElkServiceBase extends Service{constructor(optsConnection){super(optsConnection,"ws_elk","1")}GetConfigDetails(request){return this._connection.send("GetConfigDetails",request)}Ping(request){return this._connection.send("Ping",request)}}class ElkService extends ElkServiceBase{}exports2.WsLogaccess=void 0,(WsLogaccess2=>{(LogColumnType2=>{LogColumnType2.global="global",LogColumnType2.workunits="workunits",LogColumnType2.components="components",LogColumnType2.audience="audience",LogColumnType2.class="class",LogColumnType2.instance="instance",LogColumnType2.node="node",LogColumnType2.message="message",LogColumnType2.logid="logid",LogColumnType2.processid="processid",LogColumnType2.threadid="threadid",LogColumnType2.timestamp="timestamp",LogColumnType2.pod="pod",LogColumnType2.traceid="traceid",LogColumnType2.spanid="spanid"})(WsLogaccess2.LogColumnType||(WsLogaccess2.LogColumnType={})),(LogColumnValueType2=>{LogColumnValueType2.string="string",LogColumnValueType2.numeric="numeric",LogColumnValueType2.datetime="datetime",LogColumnValueType2.enum="enum",LogColumnValueType2.epoch="epoch"})(WsLogaccess2.LogColumnValueType||(WsLogaccess2.LogColumnValueType={})),(LogAccessType2=>{LogAccessType2[LogAccessType2.All=0]="All",LogAccessType2[LogAccessType2.ByJobID=1]="ByJobID",LogAccessType2[LogAccessType2.ByComponent=2]="ByComponent",LogAccessType2[LogAccessType2.ByLogType=3]="ByLogType",LogAccessType2[LogAccessType2.ByTargetAudience=4]="ByTargetAudience",LogAccessType2[LogAccessType2.BySourceInstance=5]="BySourceInstance",LogAccessType2[LogAccessType2.BySourceNode=6]="BySourceNode",LogAccessType2[LogAccessType2.ByFieldName=7]="ByFieldName",LogAccessType2[LogAccessType2.ByPod=8]="ByPod",LogAccessType2[LogAccessType2.ByTraceID=9]="ByTraceID",LogAccessType2[LogAccessType2.BySpanID=10]="BySpanID"})(WsLogaccess2.LogAccessType||(WsLogaccess2.LogAccessType={})),(LogAccessStatusCode2=>{LogAccessStatusCode2[LogAccessStatusCode2.Success=0]="Success",LogAccessStatusCode2[LogAccessStatusCode2.Warning=1]="Warning",LogAccessStatusCode2[LogAccessStatusCode2.Fail=2]="Fail"})(WsLogaccess2.LogAccessStatusCode||(WsLogaccess2.LogAccessStatusCode={})),(LogAccessFilterOperator2=>{LogAccessFilterOperator2[LogAccessFilterOperator2.NONE=0]="NONE",LogAccessFilterOperator2[LogAccessFilterOperator2.AND=1]="AND",LogAccessFilterOperator2[LogAccessFilterOperator2.OR=2]="OR"})(WsLogaccess2.LogAccessFilterOperator||(WsLogaccess2.LogAccessFilterOperator={})),(LogSelectColumnMode2=>{LogSelectColumnMode2[LogSelectColumnMode2.MIN=0]="MIN",LogSelectColumnMode2[LogSelectColumnMode2.DEFAULT=1]="DEFAULT",LogSelectColumnMode2[LogSelectColumnMode2.ALL=2]="ALL",LogSelectColumnMode2[LogSelectColumnMode2.CUSTOM=3]="CUSTOM"})(WsLogaccess2.LogSelectColumnMode||(WsLogaccess2.LogSelectColumnMode={})),(SortColumType2=>{SortColumType2[SortColumType2.ByDate=0]="ByDate",SortColumType2[SortColumType2.ByJobID=1]="ByJobID",SortColumType2[SortColumType2.ByComponent=2]="ByComponent",SortColumType2[SortColumType2.ByLogType=3]="ByLogType",SortColumType2[SortColumType2.ByTargetAudience=4]="ByTargetAudience",SortColumType2[SortColumType2.BySourceInstance=5]="BySourceInstance",SortColumType2[SortColumType2.BySourceNode=6]="BySourceNode",SortColumType2[SortColumType2.ByFieldName=7]="ByFieldName",SortColumType2[SortColumType2.ByPod=8]="ByPod",SortColumType2[SortColumType2.ByTraceID=9]="ByTraceID",SortColumType2[SortColumType2.BySpanID=10]="BySpanID"})(WsLogaccess2.SortColumType||(WsLogaccess2.SortColumType={})),(SortDirection2=>{SortDirection2[SortDirection2.ASC=0]="ASC",SortDirection2[SortDirection2.DSC=1]="DSC"})(WsLogaccess2.SortDirection||(WsLogaccess2.SortDirection={}))})(exports2.WsLogaccess||(exports2.WsLogaccess={}));class LogaccessServiceBase extends Service{constructor(optsConnection){super(optsConnection,"ws_logaccess","1.08")}GetHealthReport(request){return this._connection.send("GetHealthReport",request,"json",!1,void 0,"GetHealthReportResponse")}GetLogAccessInfo(request){return this._connection.send("GetLogAccessInfo",request,"json",!1,void 0,"GetLogAccessInfoResponse")}GetLogs(request){return this._connection.send("GetLogs",request,"json",!1,void 0,"GetLogsResponse")}Ping(request){return this._connection.send("Ping",request,"json",!1,void 0,"ws_logaccessPingResponse")}}const logger$4=util.scopedLogger("@hpcc-js/comms/services/wsLogaccess.ts");var LogType=(LogType2=>(LogType2.Disaster="DIS",LogType2.Error="ERR",LogType2.Warning="WRN",LogType2.Information="INF",LogType2.Progress="PRO",LogType2.Metric="MET",LogType2))(LogType||{}),TargetAudience=(TargetAudience2=>(TargetAudience2.Operator="OPR",TargetAudience2.User="USR",TargetAudience2.Programmer="PRO",TargetAudience2.Audit="ADT",TargetAudience2))(TargetAudience||{});class LogaccessService extends LogaccessServiceBase{constructor(){super(...arguments);__publicField(this,"_logAccessInfo")}GetLogAccessInfo(request={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(request)),this._logAccessInfo}GetLogs(request){return super.GetLogs(request)}async GetLogsEx(request){var _a,_b,_c,_d,_e,_f,_g,_h;const logInfo=await this.GetLogAccessInfo(),columnMap={};logInfo.Columns.Column.forEach(column=>columnMap[column.LogType]=column.Name);const convertLogLine=line=>{const retVal={};for(const key in columnMap)line!=null&&line.fields?retVal[key]=Object.assign({},...line.fields)[columnMap[key]]??"":retVal[key]="";return retVal},getLogsRequest={Filter:{leftBinaryFilter:{BinaryLogFilter:[{leftFilter:{LogCategory:exports2.WsLogaccess.LogAccessType.All}}]}},Range:{StartDate:new Date(0).toISOString()},LogLineStartFrom:request.LogLineStartFrom??0,LogLineLimit:request.LogLineLimit??100,SelectColumnMode:exports2.WsLogaccess.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:exports2.WsLogaccess.SortColumType.ByDate,ColumnName:"",Direction:0}]}},filters=[];for(const key in request){let searchField;key in columnMap&&(Object.values(exports2.WsLogaccess.LogColumnType).includes(key)?searchField=key:searchField=columnMap[key]);let logCategory;if(searchField){switch(searchField){case exports2.WsLogaccess.LogColumnType.workunits:case"hpcc.log.jobid":logCategory=exports2.WsLogaccess.LogAccessType.ByJobID;break;case exports2.WsLogaccess.LogColumnType.audience:case"hpcc.log.audience":logCategory=exports2.WsLogaccess.LogAccessType.ByTargetAudience;break;case exports2.WsLogaccess.LogColumnType.class:case"hpcc.log.class":logCategory=exports2.WsLogaccess.LogAccessType.ByLogType;break;case exports2.WsLogaccess.LogColumnType.components:case"kubernetes.container.name":logCategory=exports2.WsLogaccess.LogAccessType.ByComponent;break;default:logCategory=exports2.WsLogaccess.LogAccessType.ByFieldName,searchField=columnMap[key]}if(Array.isArray(request[key]))request[key].forEach(value=>{logCategory===exports2.WsLogaccess.LogAccessType.ByComponent&&(value+="*"),filters.push({LogCategory:logCategory,SearchField:searchField,SearchByValue:value})});else{let value=request[key];logCategory===exports2.WsLogaccess.LogAccessType.ByComponent&&(value+="*"),filters.push({LogCategory:logCategory,SearchField:searchField,SearchByValue:value})}}}if(filters.length>2){let binaryLogFilter=getLogsRequest.Filter.leftBinaryFilter.BinaryLogFilter[0];filters.forEach((filter,i)=>{let operator=exports2.WsLogaccess.LogAccessFilterOperator.AND;i>0?(filters[i-1].SearchField===filter.SearchField&&(operator=exports2.WsLogaccess.LogAccessFilterOperator.OR),i===filters.length-1?(binaryLogFilter.Operator=operator,binaryLogFilter.rightFilter=filter):(binaryLogFilter.Operator=operator,binaryLogFilter.rightBinaryFilter={BinaryLogFilter:[{leftFilter:filter}]},binaryLogFilter=binaryLogFilter.rightBinaryFilter.BinaryLogFilter[0])):binaryLogFilter.leftFilter=filter})}else delete getLogsRequest.Filter.leftBinaryFilter,getLogsRequest.Filter.leftFilter={LogCategory:exports2.WsLogaccess.LogAccessType.All},(_a=filters[0])!=null&&_a.SearchField&&(getLogsRequest.Filter.leftFilter={LogCategory:(_b=filters[0])==null?void 0:_b.LogCategory,SearchField:(_c=filters[0])==null?void 0:_c.SearchField,SearchByValue:(_d=filters[0])==null?void 0:_d.SearchByValue}),(_e=filters[1])!=null&&_e.SearchField&&(getLogsRequest.Filter.Operator=exports2.WsLogaccess.LogAccessFilterOperator.AND,filters[0].SearchField===filters[1].SearchField&&(getLogsRequest.Filter.Operator=exports2.WsLogaccess.LogAccessFilterOperator.OR),getLogsRequest.Filter.rightFilter={LogCategory:(_f=filters[1])==null?void 0:_f.LogCategory,SearchField:(_g=filters[1])==null?void 0:_g.SearchField,SearchByValue:(_h=filters[1])==null?void 0:_h.SearchByValue});return request.StartDate&&(getLogsRequest.Range.StartDate=request.StartDate.toISOString()),request.EndDate&&(getLogsRequest.Range.EndDate=request.EndDate.toISOString()),this.GetLogs(getLogsRequest).then(response=>{var _a2;try{const logLines=JSON.parse(response.LogLines);let lines=[];switch(logInfo.RemoteLogManagerType){case"azureloganalyticscurl":case"elasticstack":case"grafanacurl":lines=((_a2=logLines.lines)==null?void 0:_a2.map(convertLogLine))??[];break;default:logger$4.warning(`Unknown RemoteLogManagerType: ${logInfo.RemoteLogManagerType}`),lines=[]}return{lines,total:response.TotalLogLinesAvailable??1e4}}catch(e){logger$4.error(e.message??e)}return{lines:[],total:0}})}}function ascending(a,b){return a<b?-1:a>b?1:a>=b?0:NaN}function bisector(compare){return compare.length===1&&(compare=ascendingComparator(compare)),{left:function(a,x,lo,hi){for(lo==null&&(lo=0),hi==null&&(hi=a.length);lo<hi;){var mid=lo+hi>>>1;compare(a[mid],x)<0?lo=mid+1:hi=mid}return lo},right:function(a,x,lo,hi){for(lo==null&&(lo=0),hi==null&&(hi=a.length);lo<hi;){var mid=lo+hi>>>1;compare(a[mid],x)>0?hi=mid:lo=mid+1}return lo}}}function ascendingComparator(f){return function(d,x){return ascending(f(d),x)}}bisector(ascending);function number(x){return x===null?NaN:+x}function d3Max(values,valueof){var n=values.length,i=-1,value,max;if(valueof==null){for(;++i<n;)if((value=values[i])!=null&&value>=value)for(max=value;++i<n;)(value=values[i])!=null&&value>max&&(max=value)}else for(;++i<n;)if((value=valueof(values[i],i,values))!=null&&value>=value)for(max=value;++i<n;)(value=valueof(values[i],i,values))!=null&&value>max&&(max=value);return max}function d3Mean(values,valueof){var n=values.length,m=n,i=-1,value,sum=0;if(valueof==null)for(;++i<n;)isNaN(value=number(values[i]))?--m:sum+=value;else for(;++i<n;)isNaN(value=number(valueof(values[i],i,values)))?--m:sum+=value;if(m)return sum/m}class MachineServiceBase extends Service{constructor(optsConnection){super(optsConnection,"ws_machine","1.17")}GetComponentStatus(request){return this._connection.send("GetComponentStatus",request)}GetComponentUsage(request){return this._connection.send("GetComponentUsage",request)}GetMachineInfo(request){return this._connection.send("GetMachineInfo",request)}GetMachineInfoEx(request){return this._connection.send("GetMachineInfoEx",request)}GetMetrics(request){return this._connection.send("GetMetrics",request)}GetNodeGroupUsage(request){return this._connection.send("GetNodeGroupUsage",request)}GetTargetClusterInfo(request){return this._connection.send("GetTargetClusterInfo",request)}GetTargetClusterUsage(request){return this._connection.send("GetTargetClusterUsage",request)}Ping(request){return this._connection.send("Ping",request)}UpdateComponentStatus(request){return this._connection.send("UpdateComponentStatus",request)}}class MachineService extends MachineServiceBase{GetTargetClusterUsageEx(targetClusters2,bypassCachedResult=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:targetClusters2?{Item:targetClusters2}:{},BypassCachedResult:bypassCachedResult}).then(response=>util.exists("TargetClusterUsages.TargetClusterUsage",response)?response.TargetClusterUsages.TargetClusterUsage:[]).then(response=>response.filter(tcu=>!!tcu.ComponentUsages).map(tcu=>{const ComponentUsages=tcu.ComponentUsages.ComponentUsage.map(cu=>{const MachineUsages=(cu.MachineUsages&&cu.MachineUsages.MachineUsage?cu.MachineUsages.MachineUsage:[]).map(mu=>{const DiskUsages=mu.DiskUsages&&mu.DiskUsages.DiskUsage?mu.DiskUsages.DiskUsage.map(du=>({...du,InUse:du.InUse*1024,Total:(du.InUse+du.Available)*1024,PercentUsed:100-du.PercentAvailable})):[];return{Name:mu.Name,NetAddress:mu.NetAddress,Description:mu.Description,DiskUsages,mean:d3Mean(DiskUsages.filter(du=>!isNaN(du.PercentUsed)),du=>du.PercentUsed),max:d3Max(DiskUsages.filter(du=>!isNaN(du.PercentUsed)),du=>du.PercentUsed)}});return{Type:cu.Type,Name:cu.Name,Description:cu.Description,MachineUsages,MachineUsagesDescription:MachineUsages.reduce((prev,mu)=>prev+(mu.Description||""),""),mean:d3Mean(MachineUsages.filter(mu=>!isNaN(mu.mean)),mu=>mu.mean),max:d3Max(MachineUsages.filter(mu=>!isNaN(mu.max)),mu=>mu.max)}});return{Name:tcu.Name,Description:tcu.Description,ComponentUsages,ComponentUsagesDescription:ComponentUsages.reduce((prev,cu)=>prev+(cu.MachineUsagesDescription||""),""),mean:d3Mean(ComponentUsages.filter(cu=>!isNaN(cu.mean)),cu=>cu.mean),max:d3Max(ComponentUsages.filter(cu=>!isNaN(cu.max)),cu=>cu.max)}}))}}class PackageProcessServiceBase extends Service{constructor(optsConnection){super(optsConnection,"WsPackageProcess","1.04")}ActivatePackage(request){return this._connection.send("ActivatePackage",request)}AddPackage(request){return this._connection.send("AddPackage",request)}AddPartToPackageMap(request){return this._connection.send("AddPartToPackageMap",request)}CopyPackageMap(request){return this._connection.send("CopyPackageMap",request)}DeActivatePackage(request){return this._connection.send("DeActivatePackage",request)}DeletePackage(request){return this._connection.send("DeletePackage",request)}Echo(request){return this._connection.send("Echo",request)}GetPackage(request){return this._connection.send("GetPackage",request)}GetPackageMapById(request){return this._connection.send("GetPackageMapById",request)}GetPackageMapSelectOptions(request){return this._connection.send("GetPackageMapSelectOptions",request)}GetPartFromPackageMap(request){return this._connection.send("GetPartFromPackageMap",request)}GetQueryFileMapping(request){return this._connection.send("GetQueryFileMapping",request)}ListPackage(request){return this._connection.send("ListPackage",request)}ListPackages(request){return this._connection.send("ListPackages",request)}Ping(request){return this._connection.send("Ping",request)}RemovePartFromPackageMap(request){return this._connection.send("RemovePartFromPackageMap",request)}ValidatePackage(request){return this._connection.send("ValidatePackage",request)}}class PackageProcessService extends PackageProcessServiceBase{}class ResourcesServiceBase extends Service{constructor(optsConnection){super(optsConnection,"WsResources","1.01")}Ping(request){return this._connection.send("Ping",request)}ServiceQuery(request){return this._connection.send("ServiceQuery",request)}WebLinksQuery(request){return this._connection.send("WebLinksQuery",request)}}class ResourcesService extends ResourcesServiceBase{}exports2.WsSasha=void 0,(WsSasha2=>{(WUTypes2=>{WUTypes2.ECL="ECL",WUTypes2.DFU="DFU"})(WsSasha2.WUTypes||(WsSasha2.WUTypes={}))})(exports2.WsSasha||(exports2.WsSasha={}));class SashaServiceBase extends Service{constructor(optsConnection){super(optsConnection,"WSSasha","1.01")}ArchiveWU(request){return this._connection.send("ArchiveWU",request,"json",!1,void 0,"ResultResponse")}GetVersion(request){return this._connection.send("GetVersion",request,"json",!1,void 0,"ResultResponse")}ListWU(request){return this._connection.send("ListWU",request,"json",!1,void 0,"ResultResponse")}Ping(request){return this._connection.send("Ping",request,"json",!1,void 0,"WSSashaPingResponse")}RestoreWU(request){return this._connection.send("RestoreWU",request,"json",!1,void 0,"ResultResponse")}}class SashaService extends SashaServiceBase{}exports2.WsSMC=void 0,(WsSMC2=>{(LockModes2=>{LockModes2.ALL="ALL",LockModes2.READ="READ",LockModes2.WRITE="WRITE",LockModes2.HOLD="HOLD",LockModes2.SUB="SUB"})(WsSMC2.LockModes||(WsSMC2.LockModes={})),(RoxieControlCmdType2=>{RoxieControlCmdType2.Attach="Attach",RoxieControlCmdType2.Detach="Detach",RoxieControlCmdType2.State="State",RoxieControlCmdType2.Reload="Reload",RoxieControlCmdType2.ReloadRetry="ReloadRetry",RoxieControlCmdType2.MemLock="MemLock",RoxieControlCmdType2.MemUnlock="MemUnlock",RoxieControlCmdType2.GetMemLocked="GetMemLocked"})(WsSMC2.RoxieControlCmdType||(WsSMC2.RoxieControlCmdType={}))})(exports2.WsSMC||(exports2.WsSMC={}));class SMCServiceBase extends Service{constructor(optsConnection){super(optsConnection,"WsSMC","1.27")}Activity(request){return this._connection.send("Activity",request,"json",!1,void 0,"ActivityResponse")}BrowseResources(request){return this._connection.send("BrowseResources",request,"json",!1,void 0,"BrowseResourcesResponse")}ClearQueue(request){return this._connection.send("ClearQueue",request,"json",!1,void 0,"SMCQueueResponse")}GetBuildInfo(request){return this._connection.send("GetBuildInfo",request,"json",!1,void 0,"GetBuildInfoResponse")}GetStatusServerInfo(request){return this._connection.send("GetStatusServerInfo",request,"json",!1,void 0,"GetStatusServerInfoResponse")}GetThorQueueAvailability(request){return this._connection.send("GetThorQueueAvailability",request,"json",!1,void 0,"GetThorQueueAvailabilityResponse")}Index(request){return this._connection.send("Index",request,"json",!1,void 0,"SMCIndexResponse")}LockQuery(request){return this._connection.send("LockQuery",request,"json",!1,void 0,"LockQueryResponse")}MoveJobBack(request){return this._connection.send("MoveJobBack",request,"json",!1,void 0,"SMCJobResponse")}MoveJobDown(request){return this._connection.send("MoveJobDown",request,"json",!1,void 0,"SMCJobResponse")}MoveJobFront(request){return this._connection.send("MoveJobFront",request,"json",!1,void 0,"SMCJobResponse")}MoveJobUp(request){return this._connection.send("MoveJobUp",request,"json",!1,void 0,"SMCJobResponse")}NotInCommunityEdition(request){return this._connection.send("NotInCommunityEdition",request,"json",!1,void 0,"NotInCommunityEditionResponse")}PauseQueue(request){return this._connection.send("PauseQueue",request,"json",!1,void 0,"SMCQueueResponse")}Ping(request){return this._connection.send("Ping",request,"json",!1,void 0,"WsSMCPingResponse")}RemoveJob(request){return this._connection.send("RemoveJob",request,"json",!1,void 0,"SMCJobResponse")}ResumeQueue(request){return this._connection.send("ResumeQueue",request,"json",!1,void 0,"SMCQueueResponse")}RoxieControlCmd(request){return this._connection.send("RoxieControlCmd",request,"json",!1,void 0,"RoxieControlCmdResponse")}RoxieXrefCmd(request){return this._connection.send("RoxieXrefCmd",request,"json",!1,void 0,"RoxieXrefCmdResponse")}SetBanner(request){return this._connection.send("SetBanner",request,"json",!1,void 0,"SetBannerResponse")}SetJobPriority(request){return this._connection.send("SetJobPriority",request,"json",!1,void 0,"SMCPriorityResponse")}StopQueue(request){return this._connection.send("StopQueue",request,"json",!1,void 0,"SMCQueueResponse")}}class SMCService extends SMCServiceBase{connectionOptions(){return this._connection.opts()}Activity(request){return super.Activity(request).then(response=>({Running:{ActiveWorkunit:[]},...response}))}}class StoreService extends Service{constructor(optsConnection){super(optsConnection,"WsStore","1")}CreateStore(request){return this._connection.send("Fetch",request)}Delete(request){return this._connection.send("Delete",request).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e2=>e2.Code===-1))return{Exceptions:void 0,Success:!0};throw e})}DeleteNamespace(request){return this._connection.send("DeleteNamespace",request)}Fetch(request){return this._connection.send("Fetch",request).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e2=>e2.Code===-1))return{Exceptions:void 0,Value:void 0};throw e})}FetchAll(request){return this._connection.send("FetchAll",request)}FetchKeyMD(request){return this._connection.send("FetchKeyMD",request)}ListKeys(request){return this._connection.send("ListKeys",request)}ListNamespaces(request){return this._connection.send("ListNamespaces",request)}Set(request){return this._connection.send("Set",request)}}exports2.WsTopology=void 0,(WsTopology2=>{(RoxieQueueFilter2=>{RoxieQueueFilter2.All="All",RoxieQueueFilter2.QueriesOnly="QueriesOnly",RoxieQueueFilter2.WorkunitsOnly="WorkunitsOnly"})(WsTopology2.RoxieQueueFilter||(WsTopology2.RoxieQueueFilter={}))})(exports2.WsTopology||(exports2.WsTopology={}));class TopologyServiceBase extends Service{constructor(optsConnection){super(optsConnection,"WsTopology","1.32")}Ping(request){return this._connection.send("Ping",request,"json",!1,void 0,"WsTopologyPingResponse")}SystemLog(request){return this._connection.send("SystemLog",request,"json",!1,void 0,"SystemLogResponse")}TpClusterInfo(request){return this._connection.send("TpClusterInfo",request,"json",!1,void 0,"TpClusterInfoResponse")}TpClusterQuery(request){return this._connection.send("TpClusterQuery",request,"json",!1,void 0,"TpClusterQueryResponse")}TpDropZoneQuery(request){return this._connection.send("TpDropZoneQuery",request,"json",!1,void 0,"TpDropZoneQueryResponse")}TpGetComponentFile(request){return this._connection.send("TpGetComponentFile",request,"json",!1,void 0,"TpGetComponentFileResponse")}TpGetServicePlugins(request){return this._connection.send("TpGetServicePlugins",request,"json",!1,void 0,"TpGetServicePluginsResponse")}TpGroupQuery(request){return this._connection.send("TpGroupQuery",request,"json",!1,void 0,"TpGroupQueryResponse")}TpListLogFiles(request){return this._connection.send("TpListLogFiles",request,"json",!1,void 0,"TpListLogFilesResponse")}TpListTargetClusters(request){return this._connection.send("TpListTargetClusters",request,"json",!1,void 0,"TpListTargetClustersResponse")}TpLogFile(request){return this._connection.send("TpLogFile",request,"json",!1,void 0,"TpLogFileResponse")}TpLogFileDisplay(request){return this._connection.send("TpLogFileDisplay",request,"json",!1,void 0,"TpLogFileResponse")}TpLogicalClusterQuery(request){return this._connection.send("TpLogicalClusterQuery",request,"json",!1,void 0,"TpLogicalClusterQueryResponse")}TpMachineInfo(request){return this._connection.send("TpMachineInfo",request,"json",!1,void 0,"TpMachineInfoResponse")}TpMachineQuery(request){return this._connection.send("TpMachineQuery",request,"json",!1,void 0,"TpMachineQueryResponse")}TpServiceQuery(request){return this._connection.send("TpServiceQuery",request,"json",!1,void 0,"TpServiceQueryResponse")}TpSetMachineStatus(request){return this._connection.send("TpSetMachineStatus",request,"json",!1,void 0,"TpSetMachineStatusResponse")}TpSwapNode(request){return this._connection.send("TpSwapNode",request,"json",!1,void 0,"TpSwapNodeResponse")}TpTargetClusterQuery(request){return this._connection.send("TpTargetClusterQuery",request,"json",!1,void 0,"TpTargetClusterQueryResponse")}TpThorStatus(request){return this._connection.send("TpThorStatus",request,"json",!1,void 0,"TpThorStatusResponse")}TpXMLFile(request){return this._connection.send("TpXMLFile",request,"json",!1,void 0,"TpXMLFileResponse")}}class TopologyService 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(request={}){return this.TpLogicalClusterQuery(request).then(response=>{if(response.default)return response.default;let firstHThor,first;return response.TpLogicalClusters.TpLogicalCluster.some((item,idx)=>(idx===0&&(first=item),item.Type==="hthor"?(firstHThor=item,!0):!1)),firstHThor||first})}}exports2.WsWorkunits=void 0,(WsWorkunits2=>{(ECLWUActions2=>{ECLWUActions2.Abort="Abort",ECLWUActions2.Delete="Delete",ECLWUActions2.Deschedule="Deschedule",ECLWUActions2.Reschedule="Reschedule",ECLWUActions2.Pause="Pause",ECLWUActions2.PauseNow="PauseNow",ECLWUActions2.Protect="Protect",ECLWUActions2.Unprotect="Unprotect",ECLWUActions2.Restore="Restore",ECLWUActions2.Resume="Resume",ECLWUActions2.SetToFailed="SetToFailed",ECLWUActions2.Archive="Archive"})(WsWorkunits2.ECLWUActions||(WsWorkunits2.ECLWUActions={})),(LogSelectColumnMode2=>{LogSelectColumnMode2[LogSelectColumnMode2.MIN=0]="MIN",LogSelectColumnMode2[LogSelectColumnMode2.DEFAULT=1]="DEFAULT",LogSelectColumnMode2[LogSelectColumnMode2.ALL=2]="ALL",LogSelectColumnMode2[LogSelectColumnMode2.CUSTOM=3]="CUSTOM"})(WsWorkunits2.LogSelectColumnMode||(WsWorkunits2.LogSelectColumnMode={})),(SortDirection2=>{SortDirection2[SortDirection2.ASC=0]="ASC",SortDirection2[SortDirection2.DSC=1]="DSC"})(WsWorkunits2.SortDirection||(WsWorkunits2.SortDirection={})),(LogEventClass2=>{LogEventClass2.ALL="ALL",LogEventClass2.DIS="DIS",LogEventClass2.ERR="ERR",LogEventClass2.WRN="WRN",LogEventClass2.INF="INF",LogEventClass2.PRO="PRO",LogEventClass2.MET="MET",LogEventClass2.EVT="EVT"})(WsWorkunits2.LogEventClass||(WsWorkunits2.LogEventClass={})),(WUDetailsAttrValueType2=>{WUDetailsAttrValueType2.Single="Single",WUDetailsAttrValueType2.List="List",WUDetailsAttrValueType2.Multi="Multi"})(WsWorkunits2.WUDetailsAttrValueType||(WsWorkunits2.WUDetailsAttrValueType={})),(EclDefinitionActions2=>{EclDefinitionActions2.SyntaxCheck="SyntaxCheck",EclDefinitionActions2.Deploy="Deploy",EclDefinitionActions2.Publish="Publish"})(WsWorkunits2.EclDefinitionActions||(WsWorkunits2.EclDefinitionActions={})),(ErrorMessageFormat2=>{ErrorMessageFormat2.xml="xml",ErrorMessageFormat2.json="json",ErrorMessageFormat2.text="text"})(WsWorkunits2.ErrorMessageFormat||(WsWorkunits2.ErrorMessageFormat={})),(LogAccessLogFormat2=>{LogAccessLogFormat2[LogAccessLogFormat2.XML=0]="XML",LogAccessLogFormat2[LogAccessLogFormat2.JSON=1]="JSON",LogAccessLogFormat2[LogAccessLogFormat2.CSV=2]="CSV"})(WsWorkunits2.LogAccessLogFormat||(WsWorkunits2.LogAccessLogFormat={})),(WUExceptionSeverity2=>{WUExceptionSeverity2.info="info",WUExceptionSeverity2.warning="warning",WUExceptionSeverity2.error="error",WUExceptionSeverity2.alert="alert"})(WsWorkunits2.WUExceptionSeverity||(WsWorkunits2.WUExceptionSeverity={})),(WUQueryFilterSuspendedType2=>{WUQueryFilterSuspendedType2.Allqueries="All queries",WUQueryFilterSuspendedType2.Notsuspended="Not suspended",WUQueryFilterSuspendedType2.Suspended="Suspended",WUQueryFilterSuspendedType2.Suspendedbyuser="Suspended by user",WUQueryFilterSuspendedType2.Suspendedbyfirstnode="Suspended by first node",WUQueryFilterSuspendedType2.Suspendedbyanynode="Suspended by any node"})(WsWorkunits2.WUQueryFilterSuspendedType||(WsWorkunits2.WUQueryFilterSuspendedType={})),(WUQuerySetFilterType2=>{WUQuerySetFilterType2.All="All",WUQuerySetFilterType2.Id="Id",WUQuerySetFilterType2.Name="Name",WUQuerySetFilterType2.Alias="Alias",WUQuerySetFilterType2.Status="Status"})(WsWorkunits2.WUQuerySetFilterType||(WsWorkunits2.WUQuerySetFilterType={})),(WUProtectFilter2=>{WUProtectFilter2.All="All",WUProtectFilter2.Protected="Protected",WUProtectFilter2.NotProtected="NotProtected"})(WsWorkunits2.WUProtectFilter||(WsWorkunits2.WUProtectFilter={})),(QuerySetAliasActionTypes2=>{QuerySetAliasActionTypes2.Deactivate="Deactivate"})(WsWorkunits2.QuerySetAliasActionTypes||(WsWorkunits2.QuerySetAliasActionTypes={})),(QuerysetImportActivation2=>{QuerysetImportActivation2.None="None",QuerysetImportActivation2.ActivateImportedActive="ActivateImportedActive"})(WsWorkunits2.QuerysetImportActivation||(WsWorkunits2.QuerysetImportActivation={})),(QuerySetQueryActionTypes2=>{QuerySetQueryActionTypes2.Suspend="Suspend",QuerySetQueryActionTypes2.Unsuspend="Unsuspend",QuerySetQueryActionTypes2.ToggleSuspend="ToggleSuspend",QuerySetQueryActionTypes2.Activate="Activate",QuerySetQueryActionTypes2.Delete="Delete",QuerySetQueryActionTypes2.DeleteQueriesAndWUs="DeleteQueriesAndWUs",QuerySetQueryActionTypes2.RemoveAllAliases="RemoveAllAliases",QuerySetQueryActionTypes2.ResetQueryStats="ResetQueryStats"})(WsWorkunits2.QuerySetQueryActionTypes||(WsWorkunits2.QuerySetQueryActionTypes={})),(WUQueryActivationMode2=>{WUQueryActivationMode2[WUQueryActivationMode2.DoNotActivateQuery=0]="DoNotActivateQuery",WUQueryActivationMode2[WUQueryActivationMode2.ActivateQuery=1]="ActivateQuery",WUQueryActivationMode2[WUQueryActivationMode2.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",WUQueryActivationMode2[WUQueryActivationMode2.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious"})(WsWorkunits2.WUQueryActivationMode||(WsWorkunits2.WUQueryActivationMode={}))})(exports2.WsWorkunits||(exports2.WsWorkunits={}));class WorkunitsServiceBase extends Service{constructor(optsConnection){super(optsConnection,"WsWorkunits","2.02")}GVCAjaxGraph(request){return this._connection.send("GVCAjaxGraph",request,"json",!1,void 0,"GVCAjaxGraphResponse")}Ping(request){return this._connection.send("Ping",request,"json",!1,void 0,"WsWorkunitsPingResponse")}WUAbort(request){return this._connection.send("WUAbort",request,"json",!1,void 0,"WUAbortResponse")}WUAction(request){return this._connection.send("WUAction",request,"json",!1,void 0,"WUActionResponse")}WUAddLocalFileToWorkunit(request){return this._connection.send("WUAddLocalFileToWorkunit",request,"json",!1,void 0,"WUAddLocalFileToWorkunitResponse")}WUAnalyseHotspot(request){return this._connection.send("WUAnalyseHotspot",request,"json",!1,void 0,"WUAnalyseHotspotResponse")}WUCDebug(request){return this._connection.send("WUCDebug",request,"json",!1,void 0,"WUDebugResponse")}WUCheckFeatures(request){return this._connection.send("WUCheckFeatures",request,"json",!1,void 0,"WUCheckFeaturesResponse")}WUClusterJobQueueLOG(request){return this._connection.send("WUClusterJobQueueLOG",request,"json",!1,void 0,"WUClusterJobQueueLOGResponse")}WUClusterJobQueueXLS(request){return this._connection.send("WUClusterJobQueueXLS",request,"json",!1,void 0,"WUClusterJobQueueXLSResponse")}WUClusterJobSummaryXLS(request){return this._connection.send("WUClusterJobSummaryXLS",request,"json",!1,void 0,"WUClusterJobSummaryXLSResponse")}WUClusterJobXLS(request){return this._connection.send("WUClusterJobXLS",request,"json",!1,void 0,"WUClusterJobXLSResponse")}WUCompileECL(request){return this._connection.send("WUCompileECL",request,"json",!1,void 0,"WUCompileECLResponse")}WUCopyLogicalFiles(request){return this._connection.send("WUCopyLogicalFiles",request,"json",!1,void 0,"WUCopyLogicalFilesResponse")}WUCopyQuerySet(request){return this._connection.send("WUCopyQuerySet",request,"json",!1,void 0,"WUCopyQuerySetResponse")}WUCreate(request){return this._connection.send("WUCreate",request,"json",!1,void 0,"WUCreateResponse")}WUCreateAndUpdate(request){return this._connection.send("WUCreateAndUpdate",request,"json",!1,void 0,"WUUpdateResponse")}WUCreateZAPInfo(request){return this._connection.send("WUCreateZAPInfo",request,"json",!1,void 0,"WUCreateZAPInfoResponse")}WUDelete(request){return this._connection.send("WUDelete",request,"json",!1,void 0,"WUDeleteResponse")}WUDeployWorkunit(request){return this._connection.send("WUDeployWorkunit",request,"json",!1,void 0,"WUDeployWorkunitResponse")}WUDetails(request){return this._connection.send("WUDetails",request,"json",!1,void 0,"WUDetailsResponse")}WUDetailsMeta(request){return this._connection.send("WUDetailsMeta",request,"json",!1,void 0,"WUDetailsMetaResponse")}WUEclDefinitionAction(request){return this._connection.send("WUEclDefinitionAction",request,"json",!1,void 0,"WUEclDefinitionActionResponse")}WUExport(request){return this._connection.send("WUExport",request,"json",!1,void 0,"WUExportResponse")}WUFile(request){return this._connection.send("WUFile",request,"json",!1,void 0,"WULogFileResponse")}WUFullResult(request){return this._connection.send("WUFullResult",request,"json",!1,void 0,"WUFullResultResponse")}WUGVCGraphInfo(request){return this._connection.send("WUGVCGraphInfo",request,"json",!1,void 0,"WUGVCGraphInfoResponse")}WUGetArchiveFile(request){return this._connection.send("WUGetArchiveFile",request,"json",!1,void 0,"WUGetArchiveFileResponse")}WUGetDependancyTrees(request){return this._connection.send("WUGetDependancyTrees",request,"json",!1,void 0,"WUGetDependancyTreesResponse")}WUGetGraph(request){return this._connection.send("WUGetGraph",request,"json",!1,void 0,"WUGetGraphResponse")}WUGetGraphNameAndTypes(request){return this._connection.send("WUGetGraphNameAndTypes",request,"json",!1,void 0,"WUGetGraphNameAndTypesResponse")}WUGetNumFileToCopy(request){return this._connection.send("WUGetNumFileToCopy",request,"json",!1,void 0,"WUGetNumFileToCopyResponse")}WUGetPlugins(request){return this._connection.send("WUGetPlugins",request,"json",!1,void 0,"WUGetPluginsResponse")}WUGetStats(request){return this._connection.send("WUGetStats",request,"json",!1,void 0,"WUGetStatsResponse")}WUGetThorJobList(request){return this._connection.send("WUGetThorJobList",request,"json",!1,void 0,"WUGetThorJobListResponse")}WUGetThorJobQueue(request){return this._connection.send("WUGetThorJobQueue",request,"json",!1,void 0,"WUGetThorJobQueueResponse")}WUGetZAPInfo(request){return this._connection.send("WUGetZAPInfo",request,"json",!1,void 0,"WUGetZAPInfoResponse")}WUGraphInfo(request){return this._connection.send("WUGraphInfo",request,"json",!1,void 0,"WUGraphInfoResponse")}WUGraphTiming(request){return this._connection.send("WUGraphTiming",request,"json",!1,void 0,"WUGraphTimingResponse")}WUInfo(request){return this._connection.send("WUInfo",request,"json",!1,void 0,"WUInfoResponse")}WUInfoDetails(request){return this._connection.send("WUInfoDetails",request,"json",!1,void 0,"WUInfoResponse")}WUJobList(request){return this._connection.send("WUJobList",request,"json",!1,void 0,"WUJobListResponse")}WULightWeightQuery(request){return this._connection.send("WULightWeightQuery",request,"json",!1,void 0,"WULightWeightQueryResponse")}WUListArchiveFiles(request){return this._connection.send("WUListArchiveFiles",request,"json",!1,void 0,"WUListArchiveFilesResponse")}WUListLocalFileRequired(request){return this._connection.send("WUListLocalFileRequired",request,"json",!1,void 0,"WUListLocalFileRequiredResponse")}WUListQueries(request){return this._connection.send("WUListQueries",request,"json",!1,void 0,"WUListQueriesResponse")}WUListQueriesUsingFile(request){return this._connection.send("WUListQueriesUsingFile",request,"json",!1,void 0,"WUListQueriesUsingFileResponse")}WUMultiQuerysetDetails(request){return this._connection.send("WUMultiQuerysetDetails",request,"json",!1,void 0,"WUMultiQuerySetDetailsResponse")}WUProcessGraph(request){return this._connection.send("WUProcessGraph",request,"json",!1,void 0,"WUProcessGraphResponse")}WUProtect(request){return this._connection.send("WUProtect",request,"json",!1,void 0,"WUProtectResponse")}WUPublishWorkunit(request){return this._connection.send("WUPublishWorkunit",request,"json",!1,void 0,"WUPublishWorkunitResponse")}WUPushEvent(request){return this._connection.send("WUPushEvent",request,"json",!1,void 0,"WUPushEventResponse")}WUQuery(request){return this._connection.send("WUQuery",request,"json",!1,void 0,"WUQueryResponse")}WUQueryConfig(request){return this._connection.send("WUQueryConfig",request,"json",!1,void 0,"WUQueryConfigResponse")}WUQueryDetails(request){return this._connection.send("WUQueryDetails",request,"json",!1,void 0,"WUQueryDetailsResponse")}WUQueryDetailsLightWeight(request){return this._connection.send("WUQueryDetailsLightWeight",request,"json",!1,void 0,"WUQueryDetailsResponse")}WUQueryFiles(request){return this._connection.send("WUQueryFiles",request,"json",!1,void 0,"WUQueryFilesResponse")}WUQueryGetGraph(request){return this._connection.send("WUQueryGetGraph",request,"json",!1,void 0,"WUQueryGetGraphResponse")}WUQueryGetSummaryStats(request){return this._connection.send("WUQueryGetSummaryStats",request,"json",!1,void 0,"WUQueryGetSummaryStatsResponse")}WUQuerysetAliasAction(request){return this._connection.send("WUQuerysetAliasAction",request,"json",!1,void 0,"WUQuerySetAliasActionResponse")}WUQuerysetCopyQuery(request){return this._connection.send("WUQuerysetCopyQuery",request,"json",!1,void 0,"WUQuerySetCopyQueryResponse")}WUQuerysetDetails(request){return this._connection.send("WUQuerysetDetails",request,"json",!1,void 0,"WUQuerySetDetailsResponse")}WUQuerysetExport(request){return this._connection.send("WUQuerysetExport",request,"json",!1,void 0,"WUQuerysetExportResponse")}WUQuerysetImport(request){return this._connection.send("WUQuerysetImport",request,"json",!1,void 0,"WUQuerysetImportResponse")}WUQuerysetQueryAction(request){return this._connection.send("WUQuerysetQueryAction",request,"json",!1,void 0,"WUQuerySetQueryActionResponse")}WUQuerysets(request){return this._connection.send("WUQuerysets",request,"json",!1,void 0,"WUQuerysetsResponse")}WURecreateQuery(request){return this._connection.send("WURecreateQuery",request,"json",!1,void 0,"WURecreateQueryResponse")}WUResubmit(request){return this._connection.send("WUResubmit",request,"json",!1,void 0,"WUResubmitResponse")}WUResult(request){return this._connection.send("WUResult",request,"json",!1,void 0,"WUResultResponse")}WUResultBin(request){return this._connection.send("WUResultBin",request,"json",!1,void 0,"WUResultBinResponse")}WUResultSummary(request){return this._connection.send("WUResultSummary",request,"json",!1,void 0,"WUResultSummaryResponse")}WUResultView(request){return this._connection.send("WUResultView",request,"json",!1,void 0,"WUResultViewResponse")}WURun(request){return this._connection.send("WURun",request,"json",!1,void 0,"WURunResponse")}WUSchedule(request){return this._connection.send("WUSchedule",request,"json",!1,void 0,"WUScheduleResponse")}WUShowScheduled(request){return this._connection.send("WUShowScheduled",request,"json",!1,void 0,"WUShowScheduledResponse")}WUSubmit(request){return this._connection.send("WUSubmit",request,"json",!1,void 0,"WUSubmitResponse")}WUSyntaxCheckECL(request){return this._connection.send("WUSyntaxCheckECL",request,"json",!1,void 0,"WUSyntaxCheckResponse")}WUUpdate(request){return this._connection.send("WUUpdate",request,"json",!1,void 0,"WUUpdateResponse")}WUUpdateQueryEntry(request){return this._connection.send("WUUpdateQueryEntry",request,"json",!1,void 0,"WUUpdateQueryEntryResponse")}WUWaitCompiled(request){return this._connection.send("WUWaitCompiled",request,"json",!1,void 0,"WUWaitResponse")}WUWaitComplete(request){return this._connection.send("WUWaitComplete",request,"json",!1,void 0,"WUWaitResponse")}}var WUStateID=(WUStateID2=>(WUStateID2[WUStateID2.Unknown=0]="Unknown",WUStateID2[WUStateID2.Compiled=1]="Compiled",WUStateID2[WUStateID2.Running=2]="Running",WUStateID2[WUStateID2.Completed=3]="Completed",WUStateID2[WUStateID2.Failed=4]="Failed",WUStateID2[WUStateID2.Archived=5]="Archived",WUStateID2[WUStateID2.Aborting=6]="Aborting",WUStateID2[WUStateID2.Aborted=7]="Aborted",WUStateID2[WUStateID2.Blocked=8]="Blocked",WUStateID2[WUStateID2.Submitted=9]="Submitted",WUStateID2[WUStateID2.Scheduled=10]="Scheduled",WUStateID2[WUStateID2.Compiling=11]="Compiling",WUStateID2[WUStateID2.Wait=12]="Wait",WUStateID2[WUStateID2.UploadingFiled=13]="UploadingFiled",WUStateID2[WUStateID2.DebugPaused=14]="DebugPaused",WUStateID2[WUStateID2.DebugRunning=15]="DebugRunning",WUStateID2[WUStateID2.Paused=16]="Paused",WUStateID2[WUStateID2.LAST=17]="LAST",WUStateID2[WUStateID2.NotFound=999]="NotFound",WUStateID2))(WUStateID||{});exports2.WUUpdate=void 0,(WUUpdate2=>{(Action2=>{Action2[Action2.Unknown=0]="Unknown",Action2[Action2.Compile=1]="Compile",Action2[Action2.Check=2]="Check",Action2[Action2.Run=3]="Run",Action2[Action2.ExecuteExisting=4]="ExecuteExisting",Action2[Action2.Pause=5]="Pause",Action2[Action2.PauseNow=6]="PauseNow",Action2[Action2.Resume=7]="Resume",Action2[Action2.Debug=8]="Debug",Action2[Action2.__size=9]="__size"})(WUUpdate2.Action||(WUUpdate2.Action={}))})(exports2.WUUpdate||(exports2.WUUpdate={}));function isECLResult(_){return typeof _.Name=="string"}function isWUQueryECLWorkunit(_){return _.TotalClusterTime!==void 0}function isWUInfoWorkunit(_){return _.StateEx!==void 0}class WorkunitsService extends WorkunitsServiceBase{constructor(optsConnection){super(optsConnection);__publicField(this,"_WUDetailsMetaPromise")}Ping(){return this._connection.send("Ping",{},"json",!1,void 0,"WsWorkunitsPingResponse").then(()=>({result:!0}))}WUQuery(request={},abortSignal){return this._connection.send("WUQuery",request,"json",!1,abortSignal).then(response=>util.deepMixin({Workunits:{ECLWorkunit:[]}},response))}WUInfo(_request){const request={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,..._request};return super.WUInfo(request)}WUCreate(){return super.WUCreate({})}WUUpdate(request){return this._connection.send("WUUpdate",request,"json",!0)}WUResubmit(request){return this._connection.toESPStringArray(request,"Wuids"),super.WUResubmit(request)}WUAction(request){return request.ActionType=request.WUActionType,super.WUAction(request)}WUResult(request,abortSignal){return this._connection.send("WUResult",request,"json",!1,abortSignal)}WUFileEx(request){return this._connection.send("WUFile",request,"text")}WUDetailsMeta(request){return this._WUDetailsMetaPromise||(this._WUDetailsMetaPromise=super.WUDetailsMeta(request)),this._WUDetailsMetaPromise}WUCDebugEx(request){return this._connection.send("WUCDebug",request,void 0,void 0,void 0,"WUDebug").then(response=>{const children=util.xml2json(response.Result).children();return children.length?children[0]:null})}}class WorkunitsServiceEx extends WorkunitsServiceBase{WUPublishWorkunitEx(request){return this._connection.send("WUPublishWorkunit",request)}}function formatDecimal(x){return Math.abs(x=Math.round(x))>=1e21?x.toLocaleString("en").replace(/,/g,""):x.toString(10)}function formatDecimalParts(x,p){if((i=(x=p?x.toExponential(p-1):x.toExponential()).indexOf("e"))<0)return null;var i,coefficient=x.slice(0,i);return[coefficient.length>1?coefficient[0]+coefficient.slice(2):coefficient,+x.slice(i+1)]}function exponent(x){return x=formatDecimalParts(Math.abs(x)),x?x[1]:NaN}function formatGroup(grouping,thousands){return function(value,width){for(var i=value.length,t=[],j=0,g=grouping[0],length=0;i>0&&g>0&&(length+g+1>width&&(g=Math.max(1,width-length)),t.push(value.substring(i-=g,i+g)),!((length+=g+1)>width));)g=grouping[j=(j+1)%grouping.length];return t.reverse().join(thousands)}}function formatNumerals(numerals){return function(value){return value.replace(/[0-9]/g,function(i){return numerals[+i]})}}var re=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(specifier){if(!(match=re.exec(specifier)))throw new Error("invalid format: "+specifier);var match;return new FormatSpecifier({fill:match[1],align:match[2],sign:match[3],symbol:match[4],zero:match[5],width:match[6],comma:match[7],precision:match[8]&&match[8].slice(1),trim:match[9],type:match[10]})}formatSpecifier.prototype=FormatSpecifier.prototype;function FormatSpecifier(specifier){this.fill=specifier.fill===void 0?" ":specifier.fill+"",this.align=specifier.align===void 0?">":specifier.align+"",this.sign=specifier.sign===void 0?"-":specifier.sign+"",this.symbol=specifier.symbol===void 0?"":specifier.symbol+"",this.zero=!!specifier.zero,this.width=specifier.width===void 0?void 0:+specifier.width,this.comma=!!specifier.comma,this.precision=specifier.precision===void 0?void 0:+specifier.precision,this.trim=!!specifier.trim,this.type=specifier.type===void 0?"":specifier.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(s){out:for(var n=s.length,i=1,i0=-1,i1;i<n;++i)switch(s[i]){case".":i0=i1=i;break;case"0":i0===0&&(i0=i),i1=i;break;default:if(!+s[i])break out;i0>0&&(i0=0);break}return i0>0?s.slice(0,i0)+s.slice(i1+1):s}var prefixExponent;function formatPrefixAuto(x,p){var d=formatDecimalParts(x,p);if(!d)return x+"";var coefficient=d[0],exponent2=d[1],i=exponent2-(prefixExponent=Math.max(-8,Math.min(8,Math.floor(exponent2/3)))*3)+1,n=coefficient.length;return i===n?coefficient:i>n?coefficient+new Array(i-n+1).join("0"):i>0?coefficient.slice(0,i)+"."+coefficient.slice(i):"0."+new Array(1-i).join("0")+formatDecimalParts(x,Math.max(0,p+i-1))[0]}function formatRounded(x,p){var d=formatDecimalParts(x,p);if(!d)return x+"";var coefficient=d[0],exponent2=d[1];return exponent2<0?"0."+new Array(-exponent2).join("0")+coefficient:coefficient.length>exponent2+1?coefficient.slice(0,exponent2+1)+"."+coefficient.slice(exponent2+1):coefficient+new Array(exponent2-coefficient.length+2).join("0")}const formatTypes={"%":function(x,p){return(x*100).toFixed(p)},b:function(x){return Math.round(x).toString(2)},c:function(x){return x+""},d:formatDecimal,e:function(x,p){return x.toExponential(p)},f:function(x,p){return x.toFixed(p)},g:function(x,p){return x.toPrecision(p)},o:function(x){return Math.round(x).toString(8)},p:function(x,p){return formatRounded(x*100,p)},r:formatRounded,s:formatPrefixAuto,X:function(x){return Math.round(x).toString(16).toUpperCase()},x:function(x){return Math.round(x).toString(16)}};function identity(x){return x}var map=Array.prototype.map,prefixes=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function formatLocale$1(locale2){var group=locale2.grouping===void 0||locale2.thousands===void 0?identity:formatGroup(map.call(locale2.grouping,Number),locale2.thousands+""),currencyPrefix=locale2.currency===void 0?"":locale2.currency[0]+"",currencySuffix=locale2.currency===void 0?"":locale2.currency[1]+"",decimal=locale2.decimal+"",numerals=locale2.numerals===void 0?identity:formatNumerals(map.call(locale2.numerals,String)),percent=locale2.percent===void 0?"%":locale2.percent+"",minus=locale2.minus+"",nan=locale2.nan===void 0?"NaN":locale2.nan+"";function newFormat(specifier){specifier=formatSpecifier(specifier);var fill=specifier.fill,align=specifier.align,sign=specifier.sign,symbol=specifier.symbol,zero=specifier.zero,width=specifier.width,comma=specifier.comma,precision=specifier.precision,trim=specifier.trim,type=specifier.type;type==="n"?(comma=!0,type="g"):formatTypes[type]||(precision===void 0&&(precision=12),trim=!0,type="g"),(zero||fill==="0"&&align==="=")&&(zero=!0,fill="0",align="=");var prefix=symbol==="$"?currencyPrefix:symbol==="#"&&/[boxX]/.test(type)?"0"+type.toLowerCase():"",suffix=symbol==="$"?currencySuffix:/[%p]/.test(type)?percent:"",formatType=formatTypes[type],maybeSuffix=/[defgprs%]/.test(type);precision=precision===void 0?6:/[gprs]/.test(type)?Math.max(1,Math.min(21,precision)):Math.max(0,Math.min(20,precision));function format2(value){var valuePrefix=prefix,valueSuffix=suffix,i,n,c;if(type==="c")valueSuffix=formatType(value)+valueSuffix,value="";else{value=+value;var valueNegative=value<0||1/value<0;if(value=isNaN(value)?nan:formatType(Math.abs(value),precision),trim&&(value=formatTrim(value)),valueNegative&&+value==0&&sign!=="+"&&(valueNegative=!1),valuePrefix=(valueNegative?sign==="("?sign:minus:sign==="-"||sign==="("?"":sign)+valuePrefix,valueSuffix=(type==="s"?prefixes[8+prefixExponent/3]:"")+valueSuffix+(valueNegative&&sign==="("?")":""),maybeSuffix){for(i=-1,n=value.length;++i<n;)if(c=value.charCodeAt(i),48>c||c>57){valueSuffix=(c===46?decimal+value.slice(i+1):value.slice(i))+valueSuffix,value=value.slice(0,i);break}}}comma&&!zero&&(value=group(value,1/0));var length=valuePrefix.length+value.length+valueSuffix.length,padding=length<width?new Array(width-length+1).join(fill):"";switch(comma&&zero&&(value=group(padding+value,padding.length?width-valueSuffix.length:1/0),padding=""),align){case"<":value=valuePrefix+value+valueSuffix+padding;break;case"=":value=valuePrefix+padding+value+valueSuffix;break;case"^":value=padding.slice(0,length=padding.length>>1)+valuePrefix+value+valueSuffix+padding.slice(length);break;default:value=padding+valuePrefix+value+valueSuffix;break}return numerals(value)}return format2.toString=function(){return specifier+""},format2}function formatPrefix(specifier,value){var f=newFormat((specifier=formatSpecifier(specifier),specifier.type="f",specifier)),e=Math.max(-8,Math.min(8,Math.floor(exponent(value)/3)))*3,k=Math.pow(10,-e),prefix=prefixes[8+e/3];return function(value2){return f(k*value2)+prefix}}return{format:newFormat,formatPrefix}}var locale$1,format;defaultLocale$1({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function defaultLocale$1(definition){return locale$1=formatLocale$1(definition),format=locale$1.format,locale$1.formatPrefix,locale$1}var t0=new Date,t1=new Date;function newInterval(floori,offseti,count,field){function interval(date){return floori(date=arguments.length===0?new Date:new Date(+date)),date}return interval.floor=function(date){return floori(date=new Date(+date)),date},interval.ceil=function(date){return floori(date=new Date(date-1)),offseti(date,1),floori(date),date},interval.round=function(date){var d0=interval(date),d1=interval.ceil(date);return date-d0<d1-date?d0:d1},interval.offset=function(date,step){return offseti(date=new Date(+date),step==null?1:Math.floor(step)),date},interval.range=function(start,stop,step){var range=[],previous;if(start=interval.ceil(start),step=step==null?1:Math.floor(step),!(start<stop)||!(step>0))return range;do range.push(previous=new Date(+start)),offseti(start,step),floori(start);while(previous<start&&start<stop);return range},interval.filter=function(test){return newInterval(function(date){if(date>=date)for(;floori(date),!test(date);)date.setTime(date-1)},function(date,step){if(date>=date)if(step<0)for(;++step<=0;)for(;offseti(date,-1),!test(date););else for(;--step>=0;)for(;offseti(date,1),!test(date););})},count&&(interval.count=function(start,end){return t0.setTime(+start),t1.setTime(+end),floori(t0),floori(t1),Math.floor(count(t0,t1))},interval.every=function(step){return step=Math.floor(step),!isFinite(step)||!(step>0)?null:step>1?interval.filter(field?function(d){return field(d)%step===0}:function(d){return interval.count(0,d)%step===0}):interval}),interval}var durationMinute=6e4,durationDay=864e5,durationWeek=6048e5,day=newInterval(function(date){date.setHours(0,0,0,0)},function(date,step){date.setDate(date.getDate()+step)},function(start,end){return(end-start-(end.getTimezoneOffset()-start.getTimezoneOffset())*durationMinute)/durationDay},function(date){return date.getDate()-1});day.range;function weekday(i){return newInterval(function(date){date.setDate(date.getDate()-(date.getDay()+7-i)%7),date.setHours(0,0,0,0)},function(date,step){date.setDate(date.getDate()+step*7)},function(start,end){return(end-start-(end.getTimezoneOffset()-start.getTimezoneOffset())*durationMinute)/durationWeek})}var sunday=weekday(0),monday=weekday(1),tuesday=weekday(2),wednesday=weekday(3),thursday=weekday(4),friday=weekday(5),saturday=weekday(6);sunday.range,monday.range,tuesday.range,wednesday.range,thursday.range,friday.range,saturday.range;var year=newInterval(function(date){date.setMonth(0,1),date.setHours(0,0,0,0)},function(date,step){date.setFullYear(date.getFullYear()+step)},function(start,end){return end.getFullYear()-start.getFullYear()},function(date){return date.getFullYear()});year.every=function(k){return!isFinite(k=Math.floor(k))||!(k>0)?null:newInterval(function(date){date.setFullYear(Math.floor(date.getFullYear()/k)*k),date.setMonth(0,1),date.setHours(0,0,0,0)},function(date,step){date.setFullYear(date.getFullYear()+step*k)})},year.range;var utcDay=newInterval(function(date){date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCDate(date.getUTCDate()+step)},function(start,end){return(end-start)/durationDay},function(date){return date.getUTCDate()-1});utcDay.range;function utcWeekday(i){return newInterval(function(date){date.setUTCDate(date.getUTCDate()-(date.getUTCDay()+7-i)%7),date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCDate(date.getUTCDate()+step*7)},function(start,end){return(end-start)/durationWeek})}var utcSunday=utcWeekday(0),utcMonday=utcWeekday(1),utcTuesday=utcWeekday(2),utcWednesday=utcWeekday(3),utcThursday=utcWeekday(4),utcFriday=utcWeekday(5),utcSaturday=utcWeekday(6);utcSunday.range,utcMonday.range,utcTuesday.range,utcWednesday.range,utcThursday.range,utcFriday.range,utcSaturday.range;var utcYear=newInterval(function(date){date.setUTCMonth(0,1),date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCFullYear(date.getUTCFullYear()+step)},function(start,end){return end.getUTCFullYear()-start.getUTCFullYear()},function(date){return date.getUTCFullYear()});utcYear.every=function(k){return!isFinite(k=Math.floor(k))||!(k>0)?null:newInterval(function(date){date.setUTCFullYear(Math.floor(date.getUTCFullYear()/k)*k),date.setUTCMonth(0,1),date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCFullYear(date.getUTCFullYear()+step*k)})},utcYear.range;function localDate(d){if(0<=d.y&&d.y<100){var date=new Date(-1,d.m,d.d,d.H,d.M,d.S,d.L);return date.setFullYear(d.y),date}return new Date(d.y,d.m,d.d,d.H,d.M,d.S,d.L)}function utcDate(d){if(0<=d.y&&d.y<100){var date=new Date(Date.UTC(-1,d.m,d.d,d.H,d.M,d.S,d.L));return date.setUTCFullYear(d.y),date}return new Date(Date.UTC(d.y,d.m,d.d,d.H,d.M,d.S,d.L))}function newDate(y,m,d){return{y,m,d,H:0,M:0,S:0,L:0}}function formatLocale(locale2){var locale_dateTime=locale2.dateTime,locale_date=locale2.date,locale_time=locale2.time,locale_periods=locale2.periods,locale_weekdays=locale2.days,locale_shortWeekdays=locale2.shortDays,locale_months=locale2.months,locale_shortMonths=locale2.shortMonths,periodRe=formatRe(locale_periods),periodLookup=formatLookup(locale_periods),weekdayRe=formatRe(locale_weekdays),weekdayLookup=formatLookup(locale_weekdays),shortWeekdayRe=formatRe(locale_shortWeekdays),shortWeekdayLookup=formatLookup(locale_shortWeekdays),monthRe=formatRe(locale_months),monthLookup=formatLookup(locale_months),shortMonthRe=formatRe(locale_shortMonths),shortMonthLookup=formatLookup(locale_shortMonths),formats={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},utcFormats={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},parses={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};formats.x=newFormat(locale_date,formats),formats.X=newFormat(locale_time,formats),formats.c=newFormat(locale_dateTime,formats),utcFormats.x=newFormat(locale_date,utcFormats),utcFormats.X=newFormat(locale_time,utcFormats),utcFormats.c=newFormat(locale_dateTime,utcFormats);function newFormat(specifier,formats2){return function(date){var string=[],i=-1,j=0,n=specifier.length,c,pad2,format2;for(date instanceof Date||(date=new Date(+date));++i<n;)specifier.charCodeAt(i)===37&&(string.push(specifier.slice(j,i)),(pad2=pads[c=specifier.charAt(++i)])!=null?c=specifier.charAt(++i):pad2=c==="e"?" ":"0",(format2=formats2[c])&&(c=format2(date,pad2)),string.push(c),j=i+1);return string.push(specifier.slice(j,i)),string.join("")}}function newParse(specifier,Z){return function(string){var d=newDate(1900,void 0,1),i=parseSpecifier(d,specifier,string+="",0),week,day$1;if(i!=string.length)return null;if("Q"in d)return new Date(d.Q);if("s"in d)return new Date(d.s*1e3+("L"in d?d.L:0));if(Z&&!("Z"in d)&&(d.Z=0),"p"in d&&(d.H=d.H%12+d.p*12),d.m===void 0&&(d.m="q"in d?d.q:0),"V"in d){if(d.V<1||d.V>53)return null;"w"in d||(d.w=1),"Z"in d?(week=utcDate(newDate(d.y,0,1)),day$1=week.getUTCDay(),week=day$1>4||day$1===0?utcMonday.ceil(week):utcMonday(week),week=utcDay.offset(week,(d.V-1)*7),d.y=week.getUTCFullYear(),d.m=week.getUTCMonth(),d.d=week.getUTCDate()+(d.w+6)%7):(week=localDate(newDate(d.y,0,1)),day$1=week.getDay(),week=day$1>4||day$1===0?monday.ceil(week):monday(week),week=day.offset(week,(d.V-1)*7),d.y=week.getFullYear(),d.m=week.getMonth(),d.d=week.getDate()+(d.w+6)%7)}else("W"in d||"U"in d)&&("w"in d||(d.w="u"in d?d.u%7:"W"in d?1:0),day$1="Z"in d?utcDate(newDate(d.y,0,1)).getUTCDay():localDate(newDate(d.y,0,1)).getDay(),d.m=0,d.d="W"in d?(d.w+6)%7+d.W*7-(day$1+5)%7:d.w+d.U*7-(day$1+6)%7);return"Z"in d?(d.H+=d.Z/100|0,d.M+=d.Z%100,utcDate(d)):localDate(d)}}function parseSpecifier(d,specifier,string,j){for(var i=0,n=specifier.length,m=string.length,c,parse;i<n;){if(j>=m)return-1;if(c=specifier.charCodeAt(i++),c===37){if(c=specifier.charAt(i++),parse=parses[c in pads?specifier.charAt(i++):c],!parse||(j=parse(d,string,j))<0)return-1}else if(c!=string.charCodeAt(j++))return-1}return j}function parsePeriod(d,string,i){var n=periodRe.exec(string.slice(i));return n?(d.p=periodLookup[n[0].toLowerCase()],i+n[0].length):-1}function parseShortWeekday(d,string,i){var n=shortWeekdayRe.exec(string.slice(i));return n?(d.w=shortWeekdayLookup[n[0].toLowerCase()],i+n[0].length):-1}function parseWeekday(d,string,i){var n=weekdayRe.exec(string.slice(i));return n?(d.w=weekdayLookup[n[0].toLowerCase()],i+n[0].length):-1}function parseShortMonth(d,string,i){var n=shortMonthRe.exec(string.slice(i));return n?(d.m=shortMonthLookup[n[0].toLowerCase()],i+n[0].length):-1}function parseMonth(d,string,i){var n=monthRe.exec(string.slice(i));return n?(d.m=monthLookup[n[0].toLowerCase()],i+n[0].length):-1}function parseLocaleDateTime(d,string,i){return parseSpecifier(d,locale_dateTime,string,i)}function parseLocaleDate(d,string,i){return parseSpecifier(d,locale_date,string,i)}function parseLocaleTime(d,string,i){return parseSpecifier(d,locale_time,string,i)}function formatShortWeekday(d){return locale_shortWeekdays[d.getDay()]}function formatWeekday(d){return locale_weekdays[d.getDay()]}function formatShortMonth(d){return locale_shortMonths[d.getMonth()]}function formatMonth(d){return locale_months[d.getMonth()]}function formatPeriod(d){return locale_periods[+(d.getHours()>=12)]}function formatQuarter(d){return 1+~~(d.getMonth()/3)}function formatUTCShortWeekday(d){return locale_shortWeekdays[d.getUTCDay()]}function formatUTCWeekday(d){return locale_weekdays[d.getUTCDay()]}function formatUTCShortMonth(d){return locale_shortMonths[d.getUTCMonth()]}function formatUTCMonth(d){return locale_months[d.getUTCMonth()]}function formatUTCPeriod(d){return locale_periods[+(d.getUTCHours()>=12)]}function formatUTCQuarter(d){return 1+~~(d.getUTCMonth()/3)}return{format:function(specifier){var f=newFormat(specifier+="",formats);return f.toString=function(){return specifier},f},parse:function(specifier){var p=newParse(specifier+="",!1);return p.toString=function(){return specifier},p},utcFormat:function(specifier){var f=newFormat(specifier+="",utcFormats);return f.toString=function(){return specifier},f},utcParse:function(specifier){var p=newParse(specifier+="",!0);return p.toString=function(){return specifier},p}}}var pads={"-":"",_:" ",0:"0"},numberRe=/^\s*\d+/,percentRe=/^%/,requoteRe=/[\\^$*+?|[\]().{}]/g;function pad(value,fill,width){var sign=value<0?"-":"",string=(sign?-value:value)+"",length=string.length;return sign+(length<width?new Array(width-length+1).join(fill)+string:string)}function requote(s){return s.replace(requoteRe,"\\$&")}function formatRe(names){return new RegExp("^(?:"+names.map(requote).join("|")+")","i")}function formatLookup(names){for(var map2={},i=-1,n=names.length;++i<n;)map2[names[i].toLowerCase()]=i;return map2}function parseWeekdayNumberSunday(d,string,i){var n=numberRe.exec(string.slice(i,i+1));return n?(d.w=+n[0],i+n[0].length):-1}function parseWeekdayNumberMonday(d,string,i){var n=numberRe.exec(string.slice(i,i+1));return n?(d.u=+n[0],i+n[0].length):-1}function parseWeekNumberSunday(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.U=+n[0],i+n[0].length):-1}function parseWeekNumberISO(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.V=+n[0],i+n[0].length):-1}function parseWeekNumberMonday(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.W=+n[0],i+n[0].length):-1}function parseFullYear(d,string,i){var n=numberRe.exec(string.slice(i,i+4));return n?(d.y=+n[0],i+n[0].length):-1}function parseYear(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.y=+n[0]+(+n[0]>68?1900:2e3),i+n[0].length):-1}function parseZone(d,string,i){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i,i+6));return n?(d.Z=n[1]?0:-(n[2]+(n[3]||"00")),i+n[0].length):-1}function parseQuarter(d,string,i){var n=numberRe.exec(string.slice(i,i+1));return n?(d.q=n[0]*3-3,i+n[0].length):-1}function parseMonthNumber(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.m=n[0]-1,i+n[0].length):-1}function parseDayOfMonth(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.d=+n[0],i+n[0].length):-1}function parseDayOfYear(d,string,i){var n=numberRe.exec(string.slice(i,i+3));return n?(d.m=0,d.d=+n[0],i+n[0].length):-1}function parseHour24(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.H=+n[0],i+n[0].length):-1}function parseMinutes(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.M=+n[0],i+n[0].length):-1}function parseSeconds(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.S=+n[0],i+n[0].length):-1}function parseMilliseconds(d,string,i){var n=numberRe.exec(string.slice(i,i+3));return n?(d.L=+n[0],i+n[0].length):-1}function parseMicroseconds(d,string,i){var n=numberRe.exec(string.slice(i,i+6));return n?(d.L=Math.floor(n[0]/1e3),i+n[0].length):-1}function parseLiteralPercent(d,string,i){var n=percentRe.exec(string.slice(i,i+1));return n?i+n[0].length:-1}function parseUnixTimestamp(d,string,i){var n=numberRe.exec(string.slice(i));return n?(d.Q=+n[0],i+n[0].length):-1}function parseUnixTimestampSeconds(d,string,i){var n=numberRe.exec(string.slice(i));return n?(d.s=+n[0],i+n[0].length):-1}function formatDayOfMonth(d,p){return pad(d.getDate(),p,2)}function formatHour24(d,p){return pad(d.getHours(),p,2)}function formatHour12(d,p){return pad(d.getHours()%12||12,p,2)}function formatDayOfYear(d,p){return pad(1+day.count(year(d),d),p,3)}function formatMilliseconds(d,p){return pad(d.getMilliseconds(),p,3)}function formatMicroseconds(d,p){return formatMilliseconds(d,p)+"000"}function formatMonthNumber(d,p){return pad(d.getMonth()+1,p,2)}function formatMinutes(d,p){return pad(d.getMinutes(),p,2)}function formatSeconds(d,p){return pad(d.getSeconds(),p,2)}function formatWeekdayNumberMonday(d){var day2=d.getDay();return day2===0?7:day2}function formatWeekNumberSunday(d,p){return pad(sunday.count(year(d)-1,d),p,2)}function dISO(d){var day2=d.getDay();return day2>=4||day2===0?thursday(d):thursday.ceil(d)}function formatWeekNumberISO(d,p){return d=dISO(d),pad(thursday.count(year(d),d)+(year(d).getDay()===4),p,2)}function formatWeekdayNumberSunday(d){return d.getDay()}function formatWeekNumberMonday(d,p){return pad(monday.count(year(d)-1,d),p,2)}function formatYear(d,p){return pad(d.getFullYear()%100,p,2)}function formatYearISO(d,p){return d=dISO(d),pad(d.getFullYear()%100,p,2)}function formatFullYear(d,p){return pad(d.getFullYear()%1e4,p,4)}function formatFullYearISO(d,p){var day2=d.getDay();return d=day2>=4||day2===0?thursday(d):thursday.ceil(d),pad(d.getFullYear()%1e4,p,4)}function formatZone(d){var z=d.getTimezoneOffset();return(z>0?"-":(z*=-1,"+"))+pad(z/60|0,"0",2)+pad(z%60,"0",2)}function formatUTCDayOfMonth(d,p){return pad(d.getUTCDate(),p,2)}function formatUTCHour24(d,p){return pad(d.getUTCHours(),p,2)}function formatUTCHour12(d,p){return pad(d.getUTCHours()%12||12,p,2)}function formatUTCDayOfYear(d,p){return pad(1+utcDay.count(utcYear(d),d),p,3)}function formatUTCMilliseconds(d,p){return pad(d.getUTCMilliseconds(),p,3)}function formatUTCMicroseconds(d,p){return formatUTCMilliseconds(d,p)+"000"}function formatUTCMonthNumber(d,p){return pad(d.getUTCMonth()+1,p,2)}function formatUTCMinutes(d,p){return pad(d.getUTCMinutes(),p,2)}function formatUTCSeconds(d,p){return pad(d.getUTCSeconds(),p,2)}function formatUTCWeekdayNumberMonday(d){var dow=d.getUTCDay();return dow===0?7:dow}function formatUTCWeekNumberSunday(d,p){return pad(utcSunday.count(utcYear(d)-1,d),p,2)}function UTCdISO(d){var day2=d.getUTCDay();return day2>=4||day2===0?utcThursday(d):utcThursday.ceil(d)}function formatUTCWeekNumberISO(d,p){return d=UTCdISO(d),pad(utcThursday.count(utcYear(d),d)+(utcYear(d).getUTCDay()===4),p,2)}function formatUTCWeekdayNumberSunday(d){return d.getUTCDay()}function formatUTCWeekNumberMonday(d,p){return pad(utcMonday.count(utcYear(d)-1,d),p,2)}function formatUTCYear(d,p){return pad(d.getUTCFullYear()%100,p,2)}function formatUTCYearISO(d,p){return d=UTCdISO(d),pad(d.getUTCFullYear()%100,p,2)}function formatUTCFullYear(d,p){return pad(d.getUTCFullYear()%1e4,p,4)}function formatUTCFullYearISO(d,p){var day2=d.getUTCDay();return d=day2>=4||day2===0?utcThursday(d):utcThursday.ceil(d),pad(d.getUTCFullYear()%1e4,p,4)}function formatUTCZone(){return"+0000"}function formatLiteralPercent(){return"%"}function formatUnixTimestamp(d){return+d}function formatUnixTimestampSeconds(d){return Math.floor(+d/1e3)}var locale,utcFormat,utcParse;defaultLocale({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(definition){return locale=formatLocale(definition),locale.format,locale.parse,utcFormat=locale.utcFormat,utcParse=locale.utcParse,locale}class ECLGraph extends util.StateObject{constructor(wu,eclGraph,eclTimers){super();__publicField(this,"wu");this.wu=wu;let duration=0;for(const eclTimer of eclTimers)if(eclTimer.GraphName===eclGraph.Name&&!eclTimer.HasSubGraphId){duration=Math.round(eclTimer.Seconds*1e3)/1e3;break}this.set({Time:duration,...eclGraph})}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")}fetchScopeGraph(subgraphID){return subgraphID?this.wu.fetchGraphDetails([subgraphID],["subgraph"]).then(scopes=>createGraph(scopes)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(scopes=>createGraph(scopes))}}class GraphCache extends util.Cache{constructor(){super(obj=>util.Cache.hash([obj.Name]))}}function walkXmlJson(node,callback,stack){stack=stack||[],stack.push(node),callback(node.name,node.$,node.children(),stack),node.children().forEach(childNode=>{walkXmlJson(childNode,callback,stack)}),stack.pop()}function flattenAtt(nodes){const retVal={};return nodes.forEach(node=>{node.name==="att"&&(retVal[node.$.name]=node.$.value)}),retVal}class XGMMLGraph extends util.Graph{}class XGMMLSubgraph extends util.Subgraph{}class XGMMLVertex extends util.Vertex{}class XGMMLEdge extends util.Edge{}function createXGMMLGraph(id,graphs){const subgraphs={},vertices={},edges={},graph=new XGMMLGraph(item=>item._.id),stack=[graph.root];return walkXmlJson(graphs,(tag,attributes,childNodes,_stack)=>{const top=stack[stack.length-1];switch(tag){case"graph":break;case"node":if(childNodes.length&&childNodes[0].children().length&&childNodes[0].children()[0].name==="graph"){const subgraph=top.createSubgraph(flattenAtt(childNodes));stack.push(subgraph),subgraphs[attributes.id]=subgraph}const vertex=top.createVertex(flattenAtt(childNodes));vertices[attributes.id]=vertex;break;case"edge":const edge=top.createEdge(vertices[attributes.source],vertices[attributes.target],flattenAtt(childNodes));edges[attributes.id]=edge;break}}),graph}class ScopeGraph extends util.Graph{}class ScopeSubgraph extends util.Subgraph{}class ScopeVertex extends util.Vertex{}class ScopeEdge extends util.Edge{}function createGraph(scopes){const subgraphs={},edges={},vertices={};let graph;for(const scope of scopes)switch(scope.ScopeType){case"graph":graph=new ScopeGraph(item=>item._.Id,scope),subgraphs[scope.ScopeName]=graph.root;break;case"subgraph":graph||(graph=new ScopeGraph(item=>item._.Id,scope),subgraphs[scope.ScopeName]=graph.root);const scopeStack=scope.parentScope().split(":");let scopeParent1=subgraphs[scope.parentScope()];for(;scopeStack.length&&!scopeParent1;)scopeParent1=subgraphs[scopeStack.join(":")],scopeStack.pop();if(!scopeParent1)console.warn(`Missing SG:Parent (${scope.Id}): ${scope.parentScope()}`);else{const parent1=scopeParent1;subgraphs[scope.ScopeName]=parent1.createSubgraph(scope)}break;case"activity":const scopeParent2=subgraphs[scope.parentScope()];scopeParent2?vertices[scope.ScopeName]=scopeParent2.createVertex(scope):console.warn(`Missing A:Parent (${scope.Id}): ${scope.parentScope()}`);break;case"edge":edges[scope.ScopeName]=scope;break;case"function":const scopeParent3=vertices[scope.parentScope()];scopeParent3?scopeParent3._.children().push(scope):console.warn(`Missing F:Parent (${scope.Id}): ${scope.parentScope()}`);break}for(const id in edges){const scope=edges[id],scopeParent3=subgraphs[scope.parentScope()];if(!scopeParent3)console.warn(`Missing E:Parent (${scope.Id}): ${scope.parentScope()}`);else{const parent3=scopeParent3;try{const source=graph.vertex(scope.attr("IdSource").RawValue),target=graph.vertex(scope.attr("IdTarget").RawValue);parent3.createEdge(source,target,scope)}catch{console.warn(`Invalid Edge: ${id}`)}}}return graph}class Resource extends util.StateObject{constructor(wu,url){super();__publicField(this,"wu");this.wu=wu;const cleanedURL=url.split("\\").join("/"),urlParts=cleanedURL.split("/"),matchStr="res/"+this.wu.Wuid+"/";let displayPath="",displayName="";cleanedURL.indexOf(matchStr)===0&&(displayPath=cleanedURL.substr(matchStr.length),displayName=urlParts[urlParts.length-1]),this.set({URL:url,DisplayName:displayName,DisplayPath:displayPath})}get properties(){return this.get()}get URL(){return this.get("URL")}get DisplayName(){return this.get("DisplayName")}get DisplayPath(){return this.get("DisplayPath")}}class XSDNode{constructor(e){__publicField(this,"e");this.e=e}fix(){delete this.e}}class XSDXMLNode extends XSDNode{constructor(e){super(e);__publicField(this,"name");__publicField(this,"type");__publicField(this,"isSet",!1);__publicField(this,"attrs",{});__publicField(this,"_children",[])}append(child){this._children.push(child),this.type||(this.type="hpcc:childDataset")}fix(){this.name=this.e.$.name,this.type=this.e.$.type;for(let i=this._children.length-1;i>=0;--i){const row=this._children[i];row.name==="Row"&&row.type===void 0&&(this._children.push(...row._children),this._children.splice(i,1))}const setOfType=this.setOfType();setOfType&&(this.type=setOfType,this.isSet=!0,this._children=[])}children(){return this._children}isAll(node){return node.name==="All"&&node.type===void 0}setOfType(){const children=this.children();if(this.type===void 0&&children.length===2){if(this.isAll(children[0]))return children[1].type;if(this.isAll(children[1]))return children[0].type}}charWidth(){let retVal=-1;switch(this.type){case"xs:boolean":retVal=5;break;case"xs:integer":retVal=8;break;case"xs:nonNegativeInteger":retVal=8;break;case"xs:double":retVal=8;break;case"xs:string":retVal=32;break;default:const numStr="0123456789",underbarPos=this.type.lastIndexOf("_"),length=underbarPos>0?underbarPos:this.type.length;let i=length-1;for(;i>=0&&numStr.indexOf(this.type.charAt(i))!==-1;--i);i+1<length&&(retVal=parseInt(this.type.substring(i+1,length),10)),this.type.indexOf("data")===0&&(retVal*=2);break}return retVal<this.name.length&&(retVal=this.name.length),retVal}}class XSDSimpleType extends XSDNode{constructor(e){super(e);__publicField(this,"name");__publicField(this,"type");__publicField(this,"maxLength");__publicField(this,"_restricition");__publicField(this,"_maxLength")}append(e){switch(e.name){case"xs:restriction":this._restricition=e;break;case"xs:maxLength":this._maxLength=e;break}}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()}}class XSDSchema{constructor(){__publicField(this,"root");__publicField(this,"simpleTypes",{})}fields(){return this.root.children()}}class XSDParser extends util.SAXStackParser{constructor(){super(...arguments);__publicField(this,"schema",new XSDSchema);__publicField(this,"simpleType");__publicField(this,"simpleTypes",{});__publicField(this,"xsdStack",new util.Stack)}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":const xsdXMLNode=new XSDXMLNode(e);this.schema.root?this.xsdStack.depth()&&this.xsdStack.top().append(xsdXMLNode):this.schema.root=xsdXMLNode,this.xsdStack.push(xsdXMLNode);break;case"xs:simpleType":this.simpleType=new XSDSimpleType(e);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":const xsdXMLNode2=this.xsdStack.top();for(const key in e.$)xsdXMLNode2.attrs[key]=e.$[key];break;default:this.simpleType&&this.simpleType.append(e)}super.endXMLNode(e)}}function parseXSD(xml){const saxParser=new XSDParser;return saxParser.parse(xml),saxParser.schema}class XSDParser2 extends XSDParser{constructor(rootName){super();__publicField(this,"_rootName");__publicField(this,"schema",new XSDSchema);__publicField(this,"simpleTypes",{});__publicField(this,"xsdStack",new util.Stack);this._rootName=rootName}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":const xsdXMLNode=new XSDXMLNode(e);!this.schema.root&&this._rootName===e.$.name&&(this.schema.root=xsdXMLNode),this.xsdStack.depth()&&this.xsdStack.top().append(xsdXMLNode),this.xsdStack.push(xsdXMLNode);break;case"xsd:simpleType":this.simpleType=new XSDSimpleType(e);break}}endXMLNode(e){switch(e.name){case"xsd:element":this.xsdStack.pop().fix();break}super.endXMLNode(e)}}function parseXSD2(xml,rootName){const saxParser=new XSDParser2(rootName);return saxParser.parse(xml),saxParser.schema}class GlobalResultCache extends util.Cache{constructor(){super(obj=>`${obj.BaseUrl}-${obj.Wuid}-${obj.ResultName}`)}}const _results=new GlobalResultCache;class Result extends util.StateObject{constructor(optsConnection,wuid_NodeGroup,name_sequence_eclResult_logicalFile,resultViews_isLogicalFile){super();__publicField(this,"connection");__publicField(this,"xsdSchema");__publicField(this,"_fetchXMLSchemaPromise");optsConnection instanceof WorkunitsService?this.connection=optsConnection:this.connection=new WorkunitsService(optsConnection),typeof resultViews_isLogicalFile=="boolean"&&resultViews_isLogicalFile===!0?this.set({NodeGroup:wuid_NodeGroup,LogicalFileName:name_sequence_eclResult_logicalFile}):isECLResult(name_sequence_eclResult_logicalFile)&&Array.isArray(resultViews_isLogicalFile)?this.set({...name_sequence_eclResult_logicalFile,Wuid:wuid_NodeGroup,ResultName:name_sequence_eclResult_logicalFile.Name,ResultViews:resultViews_isLogicalFile}):typeof resultViews_isLogicalFile>"u"?typeof name_sequence_eclResult_logicalFile=="number"?this.set({Wuid:wuid_NodeGroup,ResultSequence:name_sequence_eclResult_logicalFile}):typeof name_sequence_eclResult_logicalFile=="string"?this.set({Wuid:wuid_NodeGroup,ResultName:name_sequence_eclResult_logicalFile}):console.warn("Unknown Result.attach (1)"):console.warn("Unknown Result.attach (2)")}get BaseUrl(){return this.connection.baseUrl}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(optsConnection,wuid,name_sequence_eclResult,resultViews){let retVal;return Array.isArray(resultViews)?(retVal=_results.get({BaseUrl:optsConnection.baseUrl,Wuid:wuid,ResultName:name_sequence_eclResult.Name},()=>new Result(optsConnection,wuid,name_sequence_eclResult,resultViews)),retVal.set(name_sequence_eclResult)):typeof resultViews>"u"&&(typeof name_sequence_eclResult=="number"?retVal=_results.get({BaseUrl:optsConnection.baseUrl,Wuid:wuid,ResultName:"Sequence_"+name_sequence_eclResult},()=>new Result(optsConnection,wuid,name_sequence_eclResult)):typeof name_sequence_eclResult=="string"&&(retVal=_results.get({BaseUrl:optsConnection.baseUrl,Wuid:wuid,ResultName:name_sequence_eclResult},()=>new Result(optsConnection,wuid,name_sequence_eclResult)))),retVal}static attachLogicalFile(optsConnection,nodeGroup,logicalFile){return _results.get({BaseUrl:optsConnection.baseUrl,Wuid:nodeGroup,ResultName:logicalFile},()=>new Result(optsConnection,nodeGroup,logicalFile,!0))}isComplete(){return this.Total!==-1}fetchXMLSchema(refresh=!1){return(!this._fetchXMLSchemaPromise||refresh)&&(this._fetchXMLSchemaPromise=this.WUResult().then(response=>{var _a,_b;return(_b=(_a=response.Result)==null?void 0:_a.XmlSchema)!=null&&_b.xml?(this.xsdSchema=parseXSD(response.Result.XmlSchema.xml),this.xsdSchema):null})),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(from=0,count=-1,includeSchema=!1,filter={},abortSignal){return this.WUResult(from,count,!includeSchema,filter,abortSignal).then(response=>{const result=response.Result;return delete response.Result,this.set({...response}),util.exists("XmlSchema.xml",result)&&(this.xsdSchema=parseXSD(result.XmlSchema.xml)),util.exists("Row",result)?result.Row:this.ResultName&&util.exists(this.ResultName,result)?result[this.ResultName].Row:[]})}rootField(){return this.xsdSchema?this.xsdSchema.root:null}fields(){return this.xsdSchema?this.xsdSchema.root.children():[]}WUResult(start=0,count=1,suppressXmlSchema=!1,filter={},abortSignal){const FilterBy={NamedValue:{itemcount:0}};for(const key in filter)FilterBy.NamedValue[FilterBy.NamedValue.itemcount++]={Name:key,Value:filter[key]};const request={FilterBy};return this.Wuid&&this.ResultName!==void 0?(request.Wuid=this.Wuid,request.ResultName=this.ResultName):this.Wuid&&this.ResultSequence!==void 0?(request.Wuid=this.Wuid,request.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(request.LogicalName=this.LogicalFileName,request.Cluster=this.NodeGroup):this.LogicalFileName&&(request.LogicalName=this.LogicalFileName),request.Start=start,request.Count=count,request.SuppressXmlSchema=suppressXmlSchema,this.connection.WUResult(request,abortSignal).then(response=>response)}}class ResultCache extends util.Cache{constructor(){super(obj=>util.Cache.hash([obj.Sequence,obj.Name,obj.Value,obj.FileName]))}}class Attribute extends util.StateObject{constructor(scope,attribute){super();__publicField(this,"scope");this.scope=scope,this.set(attribute)}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")}}class BaseScope extends util.StateObject{constructor(scope){super();__publicField(this,"_attributeMap",{});__publicField(this,"_children",[]);this.update(scope)}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(){const retVal=[],timeElapsed={start:null,end:null};return this.Properties.Property.forEach(scopeAttr=>{scopeAttr.Measure==="ts"&&scopeAttr.Name.indexOf("Started")>=0?timeElapsed.start=scopeAttr:this.ScopeName&&scopeAttr.Measure==="ts"&&scopeAttr.Name.indexOf("Finished")>=0?timeElapsed.end=scopeAttr:retVal.push(new Attribute(this,scopeAttr))}),timeElapsed.start&&timeElapsed.end?(timeElapsed.start.FormattedEnd=timeElapsed.end.Formatted,retVal.push(new Attribute(this,timeElapsed.start))):timeElapsed.start?retVal.push(new Attribute(this,timeElapsed.start)):timeElapsed.end&&retVal.push(new Attribute(this,timeElapsed.end)),retVal}update(scope){this.set(scope),this.CAttributes.forEach(attr=>{this._attributeMap[attr.Name]=attr}),this.Properties.Property=[];for(const key in this._attributeMap)this._attributeMap.hasOwnProperty(key)&&this.Properties.Property.push(this._attributeMap[key].properties)}parentScope(){const scopeParts=this.ScopeName.split(":");return scopeParts.pop(),scopeParts.join(":")}children(_){return arguments.length?(this._children=_,this):this._children}walk(visitor){if(visitor.start(this))return!0;for(const scope of this.children())if(scope.walk(visitor))return!0;return visitor.end(this)}formattedAttrs(){const retVal={};for(const attr in this._attributeMap)retVal[attr]=this._attributeMap[attr].Formatted||this._attributeMap[attr].RawValue;return retVal}rawAttrs(){const retVal={};for(const attr in this._attributeMap)retVal[attr]=this._attributeMap[attr].RawValue;return retVal}hasAttr(name){return this._attributeMap[name]!==void 0}attr(name){return this._attributeMap[name]||new Attribute(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})}attrMeasure(name){return this._attributeMap[name].Measure}calcTooltip(parentScope){let label="";const rows=[];label=this.Id,rows.push(`<tr><td class="key">ID:</td><td class="value">${this.Id}</td></tr>`),parentScope&&rows.push(`<tr><td class="key">Parent ID:</td><td class="value">${parentScope.Id}</td></tr>`),rows.push(`<tr><td class="key">Scope:</td><td class="value">${this.ScopeName}</td></tr>`);const attrs=this.formattedAttrs();for(const key in attrs)key==="Label"?label=attrs[key]:rows.push(`<tr><td class="key">${key}</td><td class="value">${attrs[key]}</td></tr>`);return`<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">
|
|
2
|
-
<h4 align="center">${label}</h4>
|
|
3
|
-
<table>
|
|
4
|
-
${rows.join("")}
|
|
5
|
-
</table>
|
|
6
|
-
</div>`}}class Scope extends BaseScope{constructor(wu,scope){super(scope);__publicField(this,"wu");this.wu=wu}}class SourceFile extends util.StateObject{constructor(optsConnection,wuid,eclSourceFile){super();__publicField(this,"connection");optsConnection instanceof WorkunitsService?this.connection=optsConnection:this.connection=new WorkunitsService(optsConnection),this.set({Wuid:wuid,...eclSourceFile})}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")}}class Timer extends util.StateObject{constructor(optsConnection,wuid,eclTimer){super();__publicField(this,"connection");optsConnection instanceof WorkunitsService?this.connection=optsConnection:this.connection=new WorkunitsService(optsConnection);const secs=util.espTime2Seconds(eclTimer.Value);this.set({Wuid:wuid,Seconds:Math.round(secs*1e3)/1e3,HasSubGraphId:eclTimer.SubGraphId!==void 0,...eclTimer})}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")}}const formatter=utcFormat("%Y-%m-%dT%H:%M:%S.%LZ"),parser=utcParse("%Y-%m-%dT%H:%M:%S.%LZ"),d3FormatNum=format(",");function formatNum(num){return num&&!isNaN(+num)?d3FormatNum(+num):num}function safeDelete(obj,key,prop){obj[key]===void 0||obj[key][prop]===void 0||key==="__proto__"||key==="constructor"||key==="prototype"||delete obj[key][prop]}const DEFINITION_LIST="DefinitionList",definitionRegex=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,PropertyType=["Avg","Min","Max","Delta","StdDev"],RelatedProperty=["SkewMin","SkewMax","NodeMin","NodeMax"],metricKeyRegex=/[A-Z][a-z]*/g;function _splitMetric(fullLabel){for(const relProp of RelatedProperty){const index=fullLabel.indexOf(relProp);if(index===0){const measure="",label=fullLabel.slice(index+relProp.length);return{measure,ext:relProp,label}}}const labelParts=fullLabel.match(metricKeyRegex);if(labelParts!=null&&labelParts.length){const measure=labelParts.shift();let label=labelParts.join("");for(const ext of PropertyType){const index=label.indexOf(ext);if(index===0)return label=label.slice(index+ext.length),{measure,ext,label}}return{measure,ext:"",label}}return{measure:"",ext:"",label:fullLabel}}const splitLabelCache={};function splitMetric(key){let retVal=splitLabelCache[key];return retVal||(retVal=_splitMetric(key),splitLabelCache[key]=retVal),retVal}function formatValue(item,key){var _a;return((_a=item.__formattedProps)==null?void 0:_a[key])??item[key]}function safeParseFloat(val){if(val===void 0)return;const retVal=parseFloat(val);return isNaN(retVal)?void 0:retVal}function formatValues(item,key,dedup){const keyParts=splitMetric(key);if(!dedup[keyParts.measure]){dedup[keyParts.label]=!0;const avg=safeParseFloat(item[`${keyParts.measure}Avg${keyParts.label}`]),min=safeParseFloat(item[`${keyParts.measure}Min${keyParts.label}`]),max=safeParseFloat(item[`${keyParts.measure}Max${keyParts.label}`]),stdDev=safeParseFloat(item[`${keyParts.measure}StdDev${keyParts.label}`]),StdDevs=Math.max((avg-min)/stdDev,(max-avg)/stdDev);return{Key:`${keyParts.measure}${keyParts.label}`,Value:formatValue(item,`${keyParts.measure}${keyParts.label}`),Avg:formatValue(item,`${keyParts.measure}Avg${keyParts.label}`),Min:formatValue(item,`${keyParts.measure}Min${keyParts.label}`),Max:formatValue(item,`${keyParts.measure}Max${keyParts.label}`),Delta:formatValue(item,`${keyParts.measure}Delta${keyParts.label}`),StdDev:formatValue(item,`${keyParts.measure}StdDev${keyParts.label}`),StdDevs:isNaN(StdDevs)?void 0:StdDevs,SkewMin:formatValue(item,`SkewMin${keyParts.label}`),SkewMax:formatValue(item,`SkewMax${keyParts.label}`),NodeMin:formatValue(item,`NodeMin${keyParts.label}`),NodeMax:formatValue(item,`NodeMax${keyParts.label}`)}}return null}const logger$3=util.scopedLogger("workunit.ts");class WorkunitCache extends util.Cache{constructor(){super(obj=>`${obj.BaseUrl}-${obj.Wuid}`)}}const _workunits$1=new WorkunitCache;class Workunit extends util.StateObject{constructor(optsConnection,wuid){super();__publicField(this,"connection");__publicField(this,"topologyConnection");__publicField(this,"_debugMode",!1);__publicField(this,"_debugAllGraph");__publicField(this,"_submitAction");__publicField(this,"_resultCache",new ResultCache);__publicField(this,"_graphCache",new GraphCache);this.connection=new WorkunitsService(optsConnection),this.topologyConnection=new TopologyService(optsConnection),this.clearState(wuid)}get BaseUrl(){return this.connection.baseUrl}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",WUStateID.Unknown)}get State(){return this.get("State")||WUStateID[this.StateID]}get Protected(){return this.get("Protected",!1)}get Exceptions(){return this.get("Exceptions",{ECLException:[]})}get ResultViews(){return this.get("ResultViews",{View:[]})}get ResultCount(){return this.get("ResultCount",0)}get Results(){return this.get("Results",{ECLResult:[]})}get CResults(){return this.Results.ECLResult.map(eclResult=>this._resultCache.get(eclResult,()=>Result.attach(this.connection,this.Wuid,eclResult,this.ResultViews.View)))}get SequenceResults(){const retVal={};return this.CResults.forEach(result=>{retVal[result.Sequence]=result}),retVal}get Timers(){return this.get("Timers",{ECLTimer:[]})}get CTimers(){return this.Timers.ECLTimer.map(eclTimer=>new Timer(this.connection,this.Wuid,eclTimer))}get GraphCount(){return this.get("GraphCount",0)}get Graphs(){return this.get("Graphs",{ECLGraph:[]})}get CGraphs(){return this.Graphs.ECLGraph.map(eclGraph=>this._graphCache.get(eclGraph,()=>new ECLGraph(this,eclGraph,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(url=>new Resource(this,url))}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(eclSourceFile=>new SourceFile(this.connection,this.Wuid,eclSourceFile))}get VariableCount(){return this.get("VariableCount",0)}get Variables(){return this.get("Variables",{ECLResult:[]})}get TimerCount(){return this.get("TimerCount",0)}get HasDebugValue(){return this.get("HasDebugValue")}get ApplicationValueCount(){return this.get("ApplicationValueCount",0)}get XmlParams(){return this.get("XmlParams")}get AccessFlag(){return this.get("AccessFlag")}get ClusterFlag(){return this.get("ClusterFlag")}get ResultViewCount(){return this.get("ResultViewCount",0)}get DebugValueCount(){return this.get("DebugValueCount",0)}get WorkflowCount(){return this.get("WorkflowCount",0)}get Archived(){return this.get("Archived")}get RoxieCluster(){return this.get("RoxieCluster")}get DebugState(){return this.get("DebugState",{})}get Queue(){return this.get("Queue")}get Active(){return this.get("Active")}get Action(){return this.get("Action")}get Scope(){return this.get("Scope")}get AbortBy(){return this.get("AbortBy")}get AbortTime(){return this.get("AbortTime")}get Workflows(){return this.get("Workflows")}get TimingData(){return this.get("TimingData")}get HelpersDesc(){return this.get("HelpersDesc")}get GraphsDesc(){return this.get("GraphsDesc")}get SourceFilesDesc(){return this.get("SourceFilesDesc")}get ResultsDesc(){return this.get("ResultsDesc")}get VariablesDesc(){return this.get("VariablesDesc")}get TimersDesc(){return this.get("TimersDesc")}get DebugValuesDesc(){return this.get("DebugValuesDesc")}get ApplicationValuesDesc(){return this.get("ApplicationValuesDesc")}get WorkflowsDesc(){return this.get("WorkflowsDesc")}get ServiceNames(){return this.get("ServiceNames")}get CompileCost(){return this.get("CompileCost")}get ExecuteCost(){return this.get("ExecuteCost")}get FileAccessCost(){return this.get("FileAccessCost")}get NoAccess(){return this.get("NoAccess")}get ECLWUProcessList(){return this.get("ECLWUProcessList")}static create(optsConnection){const retVal=new Workunit(optsConnection);return retVal.connection.WUCreate().then(response=>(_workunits$1.set(retVal),retVal.set(response.Workunit),retVal))}static attach(optsConnection,wuid,state){const retVal=_workunits$1.get({BaseUrl:optsConnection.baseUrl,Wuid:wuid},()=>new Workunit(optsConnection,wuid));return state&&retVal.set(state),retVal}static existsLocal(baseUrl,wuid){return _workunits$1.has({BaseUrl:baseUrl,Wuid:wuid})}static submit(server,target,ecl,compileOnly=!1){return Workunit.create(server).then(wu=>wu.update({QueryText:ecl})).then(wu=>compileOnly?wu.submit(target,exports2.WUUpdate.Action.Compile):wu.submit(target))}static compile(server,target,ecl){return Workunit.submit(server,target,ecl,!0)}static query(server,opts){return new WorkunitsService(server).WUQuery(opts).then(response=>response.Workunits.ECLWorkunit.map(function(wu){return Workunit.attach(server,wu.Wuid,wu)}))}clearState(wuid){this.clear({Wuid:wuid,StateID:WUStateID.Unknown})}update(request){return this.connection.WUUpdate({...request,Wuid:this.Wuid,StateOrig:this.StateID,JobnameOrig:this.Jobname,DescriptionOrig:this.Description,ProtectedOrig:this.Protected,ClusterOrig:this.Cluster}).then(response=>(this.set(response.Workunit),this))}submit(_cluster,action=exports2.WUUpdate.Action.Run,resultLimit){let clusterPromise;return _cluster!==void 0?clusterPromise=Promise.resolve(_cluster):clusterPromise=this.topologyConnection.DefaultTpLogicalClusterQuery().then(response=>response.Name),this._debugMode=!1,action===exports2.WUUpdate.Action.Debug&&(action=exports2.WUUpdate.Action.Run,this._debugMode=!0),clusterPromise.then(cluster=>this.connection.WUUpdate({Wuid:this.Wuid,Action:action,ResultLimit:resultLimit,DebugValues:{DebugValue:[{Name:"Debug",Value:this._debugMode?"1":""}]}}).then(response=>(this.set(response.Workunit),this._submitAction=action,this.connection.WUSubmit({Wuid:this.Wuid,Cluster:cluster})))).then(()=>this)}isComplete(){switch(this.StateID){case WUStateID.Compiled:return this.ActionEx==="compile"||this._submitAction===exports2.WUUpdate.Action.Compile;case WUStateID.Completed:case WUStateID.Failed:case WUStateID.Aborted:case WUStateID.NotFound:return!0}return!1}isFailed(){switch(this.StateID){case WUStateID.Aborted:case WUStateID.Failed:return!0}return!1}isDeleted(){switch(this.StateID){case WUStateID.NotFound:return!0}return!1}isDebugging(){switch(this.StateID){case WUStateID.DebugPaused:case WUStateID.DebugRunning:return!0}return this._debugMode}isRunning(){switch(this.StateID){case WUStateID.Compiled:case WUStateID.Running:case WUStateID.Aborting:case WUStateID.Blocked:case WUStateID.DebugPaused:case WUStateID.DebugRunning:return!0}return!1}setToFailed(){return this.WUAction(exports2.WsWorkunits.ECLWUActions.SetToFailed)}pause(){return this.WUAction(exports2.WsWorkunits.ECLWUActions.Pause)}pauseNow(){return this.WUAction(exports2.WsWorkunits.ECLWUActions.PauseNow)}resume(){return this.WUAction(exports2.WsWorkunits.ECLWUActions.Resume)}abort(){return this.WUAction(exports2.WsWorkunits.ECLWUActions.Abort)}protect(){return this.WUAction(exports2.WsWorkunits.ECLWUActions.Protect)}unprotect(){return this.WUAction(exports2.WsWorkunits.ECLWUActions.Unprotect)}delete(){return this.WUAction(exports2.WsWorkunits.ECLWUActions.Delete)}restore(){return this.WUAction(exports2.WsWorkunits.ECLWUActions.Restore)}deschedule(){return this.WUAction(exports2.WsWorkunits.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(exports2.WsWorkunits.ECLWUActions.Reschedule)}resubmit(){return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!1}).then(()=>(this.clearState(this.Wuid),this.refresh().then(()=>(this._monitor(),this))))}clone(){return this.WUResubmit({CloneWorkunit:!0,ResetWorkflow:!1}).then(response=>Workunit.attach(this.connection.opts(),response.WUs.WU[0].WUID).refresh())}async refreshState(){return await this.WUQuery(),this.StateID===WUStateID.Compiled&&!this.ActionEx&&!this._submitAction&&await this.refreshInfo(),this}async refreshInfo(request){return await this.WUInfo(request),this}async refreshDebug(){return await this.debugStatus(),this}async refresh(full=!1,request){return full?await Promise.all([this.refreshInfo(request),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(()=>{var _a;return((_a=this.Helpers)==null?void 0:_a.ECLHelpFile)||[]})}fetchAllowedClusters(){return this.WUInfo({IncludeAllowedClusters:!0}).then(()=>{var _a;return((_a=this.AllowedClusters)==null?void 0:_a.AllowedCluster)||[]})}fetchTotalClusterTime(){return this.WUInfo({IncludeTotalClusterTime:!0}).then(()=>this.TotalClusterTime)}fetchServiceNames(){return this.WUInfo({IncludeServiceNames:!0}).then(()=>{var _a;return(_a=this.ServiceNames)==null?void 0:_a.Item})}fetchDetailsMeta(request={}){return this.WUDetailsMeta(request)}fetchDetailsRaw(request={}){return this.WUDetails(request).then(response=>response.Scopes.Scope)}normalizeDetails(meta,scopes){const columns={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},data=[];for(const scope of scopes){const props={},formattedProps={};if(scope&&scope.Id&&scope.Properties&&scope.Properties.Property)for(const key in scope.Properties.Property){const scopeProperty=scope.Properties.Property[key];if(scopeProperty.Measure==="ns"&&(scopeProperty.Measure="s"),scopeProperty.Name==="Kind"){const rawValue=parseInt(scopeProperty.RawValue,10);scopeProperty.Formatted=meta.Activities.Activity.filter(a=>a.Kind===rawValue)[0].Name??scopeProperty.RawValue}switch(columns[scopeProperty.Name]={...scopeProperty},safeDelete(columns,scopeProperty.Name,"RawValue"),safeDelete(columns,scopeProperty.Name,"Formatted"),scopeProperty.Measure){case"bool":props[scopeProperty.Name]=!!+scopeProperty.RawValue;break;case"sz":props[scopeProperty.Name]=+scopeProperty.RawValue;break;case"s":props[scopeProperty.Name]=+scopeProperty.RawValue/1e9;break;case"ns":props[scopeProperty.Name]=+scopeProperty.RawValue;break;case"ts":props[scopeProperty.Name]=new Date(+scopeProperty.RawValue/1e3).toISOString();break;case"cnt":props[scopeProperty.Name]=+scopeProperty.RawValue;break;case"cost":props[scopeProperty.Name]=+scopeProperty.RawValue/1e6;break;case"node":props[scopeProperty.Name]=+scopeProperty.RawValue;break;case"skw":props[scopeProperty.Name]=+scopeProperty.RawValue;break;case"cpu":case"ppm":case"ip":case"cy":case"en":case"txt":case"id":case"fname":default:props[scopeProperty.Name]=scopeProperty.RawValue}formattedProps[scopeProperty.Name]=formatNum(scopeProperty.Formatted??props[scopeProperty.Name])}const normalizedScope={id:scope.Id,name:scope.ScopeName,type:scope.ScopeType,Kind:scope.Kind,Label:scope.Label,__formattedProps:formattedProps,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...props};if(normalizedScope[DEFINITION_LIST])try{const definitionList=JSON.parse(normalizedScope[DEFINITION_LIST].split("\\").join("\\\\"));normalizedScope[DEFINITION_LIST]=[],definitionList.forEach((definition,idx)=>{const matches=definition.match(definitionRegex);if(matches){const filePath=(matches[1]??"")+matches[2]+matches[3],line=parseInt(matches[5]),col=parseInt(matches[6]);normalizedScope[DEFINITION_LIST].push({filePath,line,col})}})}catch{logger$3.error(`Unexpected "DefinitionList": ${normalizedScope[DEFINITION_LIST]}`)}const dedup={};for(const key in normalizedScope)if(key.indexOf("__")!==0){const row=formatValues(normalizedScope,key,dedup);row&&(normalizedScope.__groupedProps[row.Key]=row,!isNaN(row.StdDevs)&&normalizedScope.__StdDevs<row.StdDevs&&(normalizedScope.__StdDevs=row.StdDevs,normalizedScope.__StdDevsSource=row.Key))}data.push(normalizedScope)}return{meta,columns,data}}fetchDetailsNormalized(request={}){return Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(request)]).then(promises=>this.normalizeDetails(promises[0],promises[1]))}fetchInfo(request={}){return this.WUInfo(request)}fetchDetails(request={}){return this.WUDetails(request).then(response=>response.Scopes.Scope.map(rawScope=>new Scope(this,rawScope)))}fetchDetailsHierarchy(request={}){return this.WUDetails(request).then(response=>{const retVal=[],scopeMap={};response.Scopes.Scope.forEach(rawScope=>{if(scopeMap[rawScope.ScopeName])return scopeMap[rawScope.ScopeName].update(rawScope),null;{const scope=new Scope(this,rawScope);return scopeMap[scope.ScopeName]=scope,scope}});for(const key in scopeMap)if(scopeMap.hasOwnProperty(key)){const scope=scopeMap[key],parentScopeID=scope.parentScope();parentScopeID&&scopeMap[parentScopeID]?scopeMap[parentScopeID].children().push(scope):retVal.push(scope)}return retVal})}fetchGraphDetails(graphIDs=[],rootTypes){return this.fetchDetails({ScopeFilter:{MaxDepth:999999,Ids:graphIDs,ScopeTypes:rootTypes},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(graphIDs=[]){return this.fetchGraphDetails(graphIDs,["graph"]).then(scopes=>createGraph(scopes))}fetchTimeElapsed(){return this.fetchDetails({ScopeFilter:{PropertyFilters:{PropertyFilter:[{Name:"TimeElapsed"}]}}}).then(scopes=>{const scopeInfo={};scopes.forEach(scope=>{scopeInfo[scope.ScopeName]=scopeInfo[scope.ScopeName]||{scope:scope.ScopeName,start:null,elapsed:null,finish:null},scope.CAttributes.forEach(attr=>{attr.Name==="TimeElapsed"?scopeInfo[scope.ScopeName].elapsed=+attr.RawValue:attr.Measure==="ts"&&attr.Name.indexOf("Started")>=0&&(scopeInfo[scope.ScopeName].start=attr.Formatted)})});const retVal=[];for(const key in scopeInfo){const scope=scopeInfo[key];if(scope.start&&scope.elapsed){const endTime=parser(scope.start);endTime.setMilliseconds(endTime.getMilliseconds()+scope.elapsed/1e6),scope.finish=formatter(endTime),retVal.push(scope)}}return retVal.sort((l,r)=>l.start<r.start?-1:l.start>r.start?1:0),retVal})}_monitor(){if(this.isComplete()){this._monitorTickCount=0;return}super._monitor()}_monitorTimeoutDuration(){const retVal=super._monitorTimeoutDuration();return this._monitorTickCount<=1?1e3:this._monitorTickCount<=3?3e3:this._monitorTickCount<=5?5e3:this._monitorTickCount<=7?1e4:retVal}on(eventID,propIDorCallback,callback){if(this.isCallback(propIDorCallback))switch(eventID){case"completed":super.on("propChanged","StateID",changeInfo=>{this.isComplete()&&propIDorCallback([changeInfo])});break;case"changed":super.on(eventID,propIDorCallback);break}else switch(eventID){case"changed":super.on(eventID,propIDorCallback,callback);break}return this._monitor(),this}watchUntilComplete(callback){return new Promise((resolve,_)=>{const watchHandle=this.watch(changes=>{callback&&callback(changes),this.isComplete()&&(watchHandle.release(),resolve(this))})})}watchUntilRunning(callback){return new Promise((resolve,_)=>{const watchHandle=this.watch(changes=>{callback&&callback(changes),(this.isComplete()||this.isRunning())&&(watchHandle.release(),resolve(this))})})}WUQuery(_request={}){return this.connection.WUQuery({..._request,Wuid:this.Wuid}).then(response=>(response.Workunits.ECLWorkunit.length===0?(this.clearState(this.Wuid),this.set("StateID",WUStateID.NotFound)):this.set(response.Workunits.ECLWorkunit[0]),response)).catch(e=>{if(!e.Exception.some(exception=>exception.Code===20081?(this.clearState(this.Wuid),this.set("StateID",WUStateID.NotFound),!0):!1))throw logger$3.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}WUCreate(){return this.connection.WUCreate().then(response=>(this.set(response.Workunit),_workunits$1.set(this),response))}WUInfo(_request={}){const includeResults=_request.IncludeResults||_request.IncludeResultsViewNames;return this.connection.WUInfo({..._request,Wuid:this.Wuid,IncludeResults:includeResults,IncludeResultsViewNames:includeResults,SuppressResultSchemas:!1}).then(response=>(this.set(response.Workunit),includeResults&&this.set({ResultViews:response.ResultViews}),response)).catch(e=>{if(!e.Exception.some(exception=>exception.Code===20080?(this.clearState(this.Wuid),this.set("StateID",WUStateID.NotFound),!0):!1))throw logger$3.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}WUResubmit(request){return this.connection.WUResubmit(util.deepMixinT({},request,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(request){return this.connection.WUDetailsMeta(request)}WUDetails(request){return this.connection.WUDetails(util.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}},request,{WUID:this.Wuid})).then(response=>util.deepMixinT({Scopes:{Scope:[]}},response))}WUAction(actionType){return this.connection.WUAction({Wuids:{Item:[this.Wuid]},WUActionType:actionType}).then(response=>this.refresh().then(()=>(this._monitor(),response)))}publish(name){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:name||this.Jobname,AllowForeignFiles:!0,Activate:exports2.WsWorkunits.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(request){const service=new WorkunitsServiceEx({baseUrl:""}),publishRequest={Wuid:this.Wuid,Cluster:this.Cluster,JobName:this.Jobname,AllowForeignFiles:!0,Activate:1,Wait:5e3,...request};return service.WUPublishWorkunitEx(publishRequest)}WUCDebug(command,opts={}){let optsStr="";for(const key in opts)opts.hasOwnProperty(key)&&(optsStr+=` ${key}='${opts[key]}'`);return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:`<debug:${command} uid='${this.Wuid}'${optsStr}/>`}).then(response=>response)}debug(command,opts){return this.isDebugging()?this.WUCDebug(command,opts).then(response=>{const retVal=response.children(command);return retVal.length?retVal[0]:new util.XMLNode(command)}).catch(_=>(logger$3.error(_),Promise.resolve(new util.XMLNode(command)))):Promise.resolve(new util.XMLNode(command))}debugStatus(){return this.isDebugging()?this.debug("status").then(response=>{const debugState={...this.DebugState,...response.$};return this.set({DebugState:debugState}),response}):Promise.resolve({DebugState:{state:"unknown"}})}debugContinue(mode=""){return this.debug("continue",{mode})}debugStep(mode){return this.debug("step",{mode})}debugPause(){return this.debug("interrupt")}debugQuit(){return this.debug("quit")}debugDeleteAllBreakpoints(){return this.debug("delete",{idx:0})}debugBreakpointResponseParser(rootNode){return rootNode.children().map(childNode=>{if(childNode.name==="break")return childNode.$})}debugBreakpointAdd(id,mode,action){return this.debug("breakpoint",{id,mode,action}).then(rootNode=>this.debugBreakpointResponseParser(rootNode))}debugBreakpointList(){return this.debug("list").then(rootNode=>this.debugBreakpointResponseParser(rootNode))}debugGraph(){return this._debugAllGraph&&this.DebugState._prevGraphSequenceNum===this.DebugState.graphSequenceNum?Promise.resolve(this._debugAllGraph):this.debug("graph",{name:"all"}).then(response=>(this.DebugState._prevGraphSequenceNum=this.DebugState.graphSequenceNum,this._debugAllGraph=createXGMMLGraph(this.Wuid,response),this._debugAllGraph))}debugBreakpointValid(path){return this.debugGraph().then(graph=>breakpointLocations(graph,path))}debugPrint(edgeID,startRow=0,numRows=10){return this.debug("print",{edgeID,startRow,numRows}).then(response=>response.children().map(rowNode=>{const retVal={};return rowNode.children().forEach(cellNode=>{retVal[cellNode.name]=cellNode.content}),retVal}))}}const ATTR_DEFINITION="definition";function hasECLDefinition(vertex){return vertex._[ATTR_DEFINITION]!==void 0}function getECLDefinition(vertex){const match=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(vertex._[ATTR_DEFINITION]);if(match){const[,_file,_row,_col]=match;return _file.replace(/\/\.\//g,"/"),{id:vertex._.id,file:_file,line:+_row,column:+_col}}throw new Error(`Bad definition: ${vertex._[ATTR_DEFINITION]}`)}function breakpointLocations(graph,path){const retVal=[];for(const vertex of graph.vertices)if(hasECLDefinition(vertex)){const definition=getECLDefinition(vertex);(definition&&!path||path===definition.file)&&retVal.push(definition)}return retVal.sort((l,r)=>l.line-r.line)}let _activity;class Activity extends util.StateObject{constructor(optsConnection){super();__publicField(this,"connection");__publicField(this,"lazyRefresh",util.debounce(async()=>{const response=await this.connection.Activity({});return this.set(response),this}));optsConnection instanceof SMCService?this.connection=optsConnection:this.connection=new SMCService(optsConnection),this.clear({})}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(optsConnection,state){return _activity||(_activity=new Activity(optsConnection)),state&&_activity.set(state),_activity}runningWorkunits(clusterName=""){return this.Running.ActiveWorkunit.filter(awu=>clusterName===""||awu.ClusterName===clusterName).map(awu=>Workunit.attach(this.connection.connectionOptions(),awu.Wuid,awu))}setBanner(request){return this.connection.SetBanner({...request}).then(response=>(this.set(response),this))}async refresh(){return this.lazyRefresh()}}const logger$2=util.scopedLogger("logicalFile.ts");class LogicalFileCache extends util.Cache{constructor(){super(obj=>`${obj.BaseUrl}-${obj.Cluster}-${obj.Name}`)}}const _store$1=new LogicalFileCache;class LogicalFile extends util.StateObject{constructor(optsConnection,Cluster,Name){super();__publicField(this,"connection");optsConnection instanceof DFUService?this.connection=optsConnection:this.connection=new DFUService(optsConnection),this.clear({Cluster,Name})}get BaseUrl(){return this.connection.baseUrl}get Cluster(){return this.get("Cluster")}get Name(){return this.get("Name")}get Filename(){return this.get("Filename")}get Prefix(){return this.get("Prefix")}get NodeGroup(){return this.get("NodeGroup")}get NumParts(){return this.get("NumParts")}get Description(){return this.get("Description")}get Dir(){return this.get("Dir")}get PathMask(){return this.get("PathMask")}get Filesize(){return this.get("Filesize")}get FileSizeInt64(){return this.get("FileSizeInt64")}get RecordSize(){return this.get("RecordSize")}get RecordCount(){return this.get("RecordCount")}get RecordSizeInt64(){return this.get("RecordSizeInt64")}get RecordCountInt64(){return this.get("RecordCountInt64")}get Wuid(){return this.get("Wuid")}get Owner(){return this.get("Owner")}get JobName(){return this.get("JobName")}get Persistent(){return this.get("Persistent")}get Format(){return this.get("Format")}get MaxRecordSize(){return this.get("MaxRecordSize")}get CsvSeparate(){return this.get("CsvSeparate")}get CsvQuote(){return this.get("CsvQuote")}get CsvTerminate(){return this.get("CsvTerminate")}get CsvEscape(){return this.get("CsvEscape")}get Modified(){return this.get("Modified")}get Ecl(){return this.get("Ecl")}get Stat(){return this.get("Stat")}get DFUFilePartsOnClusters(){return this.get("DFUFilePartsOnClusters")}get isSuperfile(){return this.get("isSuperfile")}get ShowFileContent(){return this.get("ShowFileContent")}get subfiles(){return this.get("subfiles")}get Superfiles(){return this.get("Superfiles")}get ProtectList(){return this.get("ProtectList")}get FromRoxieCluster(){return this.get("FromRoxieCluster")}get Graphs(){return this.get("Graphs")}get UserPermission(){return this.get("UserPermission")}get ContentType(){return this.get("ContentType")}get CompressedFileSize(){return this.get("CompressedFileSize")}get PercentCompressed(){return this.get("PercentCompressed")}get IsCompressed(){return this.get("IsCompressed")}get BrowseData(){return this.get("BrowseData")}get jsonInfo(){return this.get("jsonInfo")}get binInfo(){return this.get("binInfo")}get PackageID(){return this.get("PackageID")}get Partition(){return this.get("Partition")}get Blooms(){return this.get("Blooms")}get ExpireDays(){return this.get("ExpireDays")}get KeyType(){return this.get("KeyType")}get IsRestricted(){return this.get("IsRestricted")}get AtRestCost(){return this.get("AtRestCost")}get AccessCost(){return this.get("AccessCost")}get StateID(){return this.get("StateID")}get ExpirationDate(){return this.get("ExpirationDate")}get ExtendedIndexInfo(){return this.get("ExtendedIndexInfo")}get properties(){return this.get()}static attach(optsConnection,Cluster,Name,state){const retVal=_store$1.get({BaseUrl:optsConnection.baseUrl,Cluster,Name},()=>new LogicalFile(optsConnection,Cluster,Name));return state&&retVal.set(state),retVal}filePartsOnCluster(){var _a;return[...((_a=this.DFUFilePartsOnClusters)==null?void 0:_a.DFUFilePartsOnCluster)||[]]}fileParts(){var _a,_b;const retVal=[];for(const poc of((_a=this.DFUFilePartsOnClusters)==null?void 0:_a.DFUFilePartsOnCluster)||[])for(const part of((_b=poc==null?void 0:poc.DFUFileParts)==null?void 0:_b.DFUPart)||[]){const row={...poc,...part};delete row.DFUFileParts,retVal.push(row)}return retVal}update(request){return this.connection.DFUInfo({...request,Cluster:this.Cluster,Name:this.Name}).then(response=>(this.set({Cluster:this.Cluster,...response.FileDetail}),response))}fetchInfo(){return this.connection.DFUInfo({Cluster:this.Cluster,Name:this.Name}).then(response=>{var _a;return this.set({Cluster:this.Cluster,...response.FileDetail,ProtectList:((_a=response==null?void 0:response.FileDetail)==null?void 0:_a.ProtectList)??{DFUFileProtect:[]}}),response.FileDetail}).catch(e=>{if(!e.Exception.some(exception=>exception.Code===20038?(this.set("Name",this.Name+" (Deleted)"),this.set("StateID",999),!0):!1))throw logger$2.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}fetchDefFile(format2){return this.connection.DFUFile({Name:this.Name,Format:format2})}fetchAllLogicalFiles(){return this.connection.recursiveFetchLogicalFiles([this])}fetchListHistory(){return this.connection.ListHistory({Name:this.Name}).then(response=>{var _a;return((_a=response==null?void 0:response.History)==null?void 0:_a.Origin)||[]})}eraseHistory(){return this.connection.EraseHistory({Name:this.Name}).then(response=>{var _a;return((_a=response==null?void 0:response.History)==null?void 0:_a.Origin)||[]})}}class MachineCache extends util.Cache{constructor(){super(obj=>obj.Address)}}const _machines=new MachineCache;class Machine extends util.StateObject{constructor(optsConnection){super();__publicField(this,"connection");optsConnection instanceof MachineService?this.connection=optsConnection:this.connection=new MachineService(optsConnection)}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(optsConnection,address,state){const retVal=_machines.get({Address:address},()=>new Machine(optsConnection));return state&&retVal.set(state),retVal}}class TargetClusterCache extends util.Cache{constructor(){super(obj=>`${obj.BaseUrl}-${obj.Name}`)}}const _targetCluster=new TargetClusterCache;class TargetCluster extends util.StateObject{constructor(optsConnection,name){super();__publicField(this,"connection");__publicField(this,"machineConnection");optsConnection instanceof TopologyService?(this.connection=optsConnection,this.machineConnection=new MachineService(optsConnection.connectionOptions())):(this.connection=new TopologyService(optsConnection),this.machineConnection=new MachineService(optsConnection)),this.clear({Name:name})}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(machineInfoEx=>Machine.attach(this.machineConnection,machineInfoEx.Address,machineInfoEx))}static attach(optsConnection,name,state){const retVal=_targetCluster.get({BaseUrl:optsConnection.baseUrl,Name:name},()=>new TargetCluster(optsConnection,name));return state&&retVal.set(state),retVal}fetchMachines(request={}){return this.machineConnection.GetTargetClusterInfo({TargetClusters:{Item:[`${this.Type}:${this.Name}`]},...request}).then(response=>{const retVal=[];for(const machineInfo of response.TargetClusterInfoList.TargetClusterInfo)for(const machineInfoEx of machineInfo.Processes.MachineInfoEx)retVal.push(machineInfoEx);return this.set("MachineInfoEx",retVal),this.CMachineInfoEx})}machineStats(){let maxDisk=0,totalFree=0,total=0;for(const machine of this.CMachineInfoEx)for(const storageInfo of machine.Storage.StorageInfo){totalFree+=storageInfo.Available,total+=storageInfo.Total;const usage=1-storageInfo.Available/storageInfo.Total;usage>maxDisk&&(maxDisk=usage)}return{maxDisk,meanDisk:1-(total?totalFree/total:1)}}fetchUsage(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])}}function targetClusters(optsConnection){let connection;return optsConnection instanceof TopologyService?connection=optsConnection:connection=new TopologyService(optsConnection),connection.TpListTargetClusters({}).then(response=>response.TargetClusters.TpClusterNameType.map(item=>TargetCluster.attach(optsConnection,item.Name,item)))}const _defaultTargetCluster={};function defaultTargetCluster(optsConnection){if(!_defaultTargetCluster[optsConnection.baseUrl]){let connection;optsConnection instanceof TopologyService?connection=optsConnection:connection=new TopologyService(optsConnection),_defaultTargetCluster[optsConnection.baseUrl]=connection.TpListTargetClusters({}).then(response=>{let firstItem,defaultItem,hthorItem;response.TargetClusters.TpClusterNameType.forEach(item=>{firstItem||(firstItem=item),!defaultItem&&item.IsDefault===!0&&(defaultItem=item),!hthorItem&&item.Type==="hthor"&&(hthorItem=item)});const defItem=defaultItem||hthorItem||firstItem;return TargetCluster.attach(optsConnection,defItem.Name,defItem)})}return _defaultTargetCluster[optsConnection.baseUrl]}class TopologyCache extends util.Cache{constructor(){super(obj=>obj.BaseUrl)}}const _topology=new TopologyCache;class Topology extends util.StateObject{constructor(optsConnection){super();__publicField(this,"connection");__publicField(this,"_prevRefresh");optsConnection instanceof TopologyService?this.connection=optsConnection:this.connection=new TopologyService(optsConnection)}get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get TargetClusters(){return this.get("TargetClusters")}get CTargetClusters(){return this.TargetClusters.map(tc=>TargetCluster.attach(this.connection,tc.Name,tc))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(optsConnection,state){const retVal=_topology.get({BaseUrl:optsConnection.baseUrl},()=>new Topology(optsConnection));return state&&retVal.set(state),retVal}GetESPServiceBaseURL(type=""){return this.connection.TpServiceQuery({}).then(response=>{const rootProtocol=this.connection.protocol(),ip=this.connection.ip();let port=rootProtocol==="https:"?"18002":"8002";if(util.exists("ServiceList.TpEspServers.TpEspServer",response)){for(const item of response.ServiceList.TpEspServers.TpEspServer)if(util.exists("TpBindings.TpBinding",item))for(const binding of item.TpBindings.TpBinding)binding.Service===type&&binding.Protocol+":"===rootProtocol&&(port=binding.Port)}return`${rootProtocol}//${ip}:${port}/`})}fetchTargetClusters(){return this.connection.TpTargetClusterQuery({Type:"ROOT"}).then(response=>{var _a;return this.set({TargetClusters:((_a=response.TpTargetClusters)==null?void 0:_a.TpTargetCluster)??[]}),this.CTargetClusters})}fetchLogicalClusters(request={}){return this.connection.TpLogicalClusterQuery(request).then(response=>(this.set({LogicalClusters:response.TpLogicalClusters.TpLogicalCluster}),this.LogicalClusters))}fetchServices(request={}){return this.connection.TpServiceQuery(request).then(response=>(this.set({Services:response.ServiceList}),this.Services))}refresh(force=!1){return(!this._prevRefresh||force)&&(this._prevRefresh=Promise.all([this.fetchTargetClusters(),this.fetchLogicalClusters(),this.fetchServices()]).then(()=>this)),this._prevRefresh}on(eventID,propIDorCallback,callback){if(this.isCallback(propIDorCallback))switch(eventID){case"changed":super.on(eventID,propIDorCallback);break}else switch(eventID){case"changed":super.on(eventID,propIDorCallback,callback);break}return this._monitor(),this}}function safeAssign(obj,key,value){key==="__proto__"||key==="constructor"||key==="prototype"||(obj[key]=value)}function xmlEncode(str){return str=""+str,str.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g," ").replace(/\r/g," ")}function espTime2Seconds(duration){if(duration){if(!isNaN(+duration))return parseFloat(duration)}else return 0;const match=/(?:(?:(\d+).days.)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+\.\d+|\d+)s))|(?:(\d+\.\d+|\d+)ms|(\d+\.\d+|\d+)us|(\d+\.\d+|\d+)ns)/.exec(duration);if(!match)return 0;const days=+match[1]||0,hours=+match[2]||0,mins=+match[3]||0,secs=+match[4]||0,ms=+match[5]||0,us=+match[6]||0,ns=+match[7]||0;return days*24*60*60+hours*60*60+mins*60+secs+ms/1e3+us/1e6+ns/1e9}function unitTest(size,unit){const nsIndex=size.indexOf(unit);return nsIndex!==-1?parseFloat(size.substring(0,nsIndex)):-1}function espSize2Bytes(size){if(size){if(!isNaN(+size))return parseFloat(size)}else return 0;let retVal=unitTest(size,"Kb");return retVal>=0?retVal*1024:(retVal=unitTest(size,"Mb"),retVal>=0?retVal*Math.pow(1024,2):(retVal=unitTest(size,"Gb"),retVal>=0?retVal*Math.pow(1024,3):(retVal=unitTest(size,"Tb"),retVal>=0?retVal*Math.pow(1024,4):(retVal=unitTest(size,"Pb"),retVal>=0?retVal*Math.pow(1024,5):(retVal=unitTest(size,"Eb"),retVal>=0?retVal*Math.pow(1024,6):(retVal=unitTest(size,"Zb"),retVal>=0?retVal*Math.pow(1024,7):(retVal=unitTest(size,"b"),retVal>=0?retVal:0)))))))}function espSkew2Number(skew){return skew?parseFloat(skew):0}class LocalisedXGMMLWriter{constructor(graph){__publicField(this,"graph");__publicField(this,"m_xgmml");__publicField(this,"m_visibleSubgraphs");__publicField(this,"m_visibleVertices");__publicField(this,"m_semiVisibleVertices");__publicField(this,"m_visibleEdges");__publicField(this,"noSpills");this.graph=graph,this.m_xgmml="",this.m_visibleSubgraphs={},this.m_visibleVertices={},this.m_semiVisibleVertices={},this.m_visibleEdges={}}calcVisibility(items,localisationDepth,localisationDistance,noSpills){this.noSpills=noSpills,items.forEach(item=>{this.graph.isVertex(item)?(this.calcInVertexVisibility(item,localisationDistance),this.calcOutVertexVisibility(item,localisationDistance)):this.graph.isEdge(item)?(this.calcInVertexVisibility(item.getSource(),localisationDistance-1),this.calcOutVertexVisibility(item.getTarget(),localisationDistance-1)):this.graph.isSubgraph(item)&&(this.m_visibleSubgraphs[item.__hpcc_id]=item,this.calcSubgraphVisibility(item,localisationDepth-1))}),this.calcVisibility2()}calcInVertexVisibility(vertex,localisationDistance){this.noSpills&&vertex.isSpill()&&localisationDistance++,this.m_visibleVertices[vertex.__hpcc_id]=vertex,localisationDistance>0&&vertex.getInEdges().forEach(edge=>{this.calcInVertexVisibility(edge.getSource(),localisationDistance-1)})}calcOutVertexVisibility(vertex,localisationDistance){this.noSpills&&vertex.isSpill()&&localisationDistance++,this.m_visibleVertices[vertex.__hpcc_id]=vertex,localisationDistance>0&&vertex.getOutEdges().forEach(edge=>{this.calcOutVertexVisibility(edge.getTarget(),localisationDistance-1)})}calcSubgraphVisibility(subgraph,localisationDepth){if(localisationDepth<0)return;localisationDepth>0&&subgraph.__hpcc_subgraphs.forEach((subgraph2,idx)=>{this.calcSubgraphVisibility(subgraph2,localisationDepth-1)}),subgraph.__hpcc_subgraphs.forEach((subgraph2,idx)=>{this.m_visibleSubgraphs[subgraph2.__hpcc_id]=subgraph2}),subgraph.__hpcc_vertices.forEach((vertex,idx)=>{this.m_visibleVertices[vertex.__hpcc_id]=vertex});const dedupEdges={};this.graph.edges.forEach((edge,idx)=>{edge.getSource().__hpcc_parent!==edge.getTarget().__hpcc_parent&&subgraph===this.getCommonAncestor(edge)&&(dedupEdges[edge.getSource().__hpcc_parent.__hpcc_id+"::"+edge.getTarget().__hpcc_parent.__hpcc_id]||(dedupEdges[edge.getSource().__hpcc_parent.__hpcc_id+"::"+edge.getTarget().__hpcc_parent.__hpcc_id]=!0,this.m_visibleEdges[edge.__hpcc_id]=edge))})}buildVertexString(vertex,isPoint){let attrStr="",propsStr="";const props=vertex.getProperties();for(const key in props)isPoint&&key.indexOf("_kind")>=0?propsStr+='<att name="_kind" value="point"/>':key==="id"||key==="label"?attrStr+=" "+key+'="'+xmlEncode(props[key])+'"':propsStr+='<att name="'+key+'" value="'+xmlEncode(props[key])+'"/>';return"<node"+attrStr+">"+propsStr+"</node>"}buildEdgeString(edge){let attrStr="",propsStr="";const props=edge.getProperties();for(const key in props)key.toLowerCase()==="id"||key.toLowerCase()==="label"||key.toLowerCase()==="source"||key.toLowerCase()==="target"?attrStr+=" "+key+'="'+xmlEncode(props[key])+'"':propsStr+='<att name="'+key+'" value="'+xmlEncode(props[key])+'"/>';return"<edge"+attrStr+">"+propsStr+"</edge>"}getAncestors(v,ancestors){let parent=v.__hpcc_parent;for(;parent;)ancestors.push(parent),parent=parent.__hpcc_parent}getCommonAncestorV(v1,v2){const v1_ancestors=[],v2_ancestors=[];this.getAncestors(v1,v1_ancestors),this.getAncestors(v2,v2_ancestors);let finger1=v1_ancestors.length-1,finger2=v2_ancestors.length-1,retVal=null;for(;finger1>=0&&finger2>=0&&v1_ancestors[finger1]===v2_ancestors[finger2];)retVal=v1_ancestors[finger1],--finger1,--finger2;return retVal}getCommonAncestor(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())}calcAncestorVisibility(vertex){const ancestors=[];this.getAncestors(vertex,ancestors),ancestors.forEach((item,idx)=>{this.m_visibleSubgraphs[item.__hpcc_id]=item})}calcVisibility2(){for(const key in this.m_visibleVertices){const vertex=this.m_visibleVertices[key];vertex.getInEdges().forEach((edge,idx)=>{this.m_visibleEdges[edge.__hpcc_id]=edge}),vertex.getOutEdges().forEach((edge,idx)=>{this.m_visibleEdges[edge.__hpcc_id]=edge}),this.calcAncestorVisibility(vertex)}this.calcSemiVisibleVertices()}addSemiVisibleEdge(edge){edge&&!this.m_visibleEdges[edge.__hpcc_id]&&(this.m_visibleEdges[edge.__hpcc_id]=edge)}addSemiVisibleVertex(vertex){this.m_visibleVertices[vertex.__hpcc_id]||(this.m_semiVisibleVertices[vertex.__hpcc_id]=vertex,this.calcAncestorVisibility(vertex))}calcSemiVisibleVertices(){for(const key in this.m_visibleEdges){const edge=this.m_visibleEdges[key];let source=edge.getSource();for(this.addSemiVisibleVertex(source);this.noSpills&&source.isSpill();){const inEdges=source.getInEdges();if(inEdges.length)this.addSemiVisibleEdge(inEdges[0]),source=inEdges[0].getSource(),this.addSemiVisibleVertex(source);else break}let target=edge.getTarget();for(this.addSemiVisibleVertex(target);this.noSpills&&target.isSpill();){const outEdges=target.getOutEdges();if(outEdges.length)this.addSemiVisibleEdge(outEdges[0]),target=outEdges[0].getTarget(),this.addSemiVisibleVertex(target);else break}}}writeXgmml(){this.subgraphVisited(this.graph.subgraphs[0],!0),this.graph.edges.forEach((edge,idx)=>{this.edgeVisited(edge)})}subgraphVisited(subgraph,root=!1){if(this.m_visibleSubgraphs[subgraph.__hpcc_id]){let propsStr="";this.m_xgmml+=root?"":'<node id="'+subgraph.__hpcc_id+'"><att><graph>';const xgmmlLen=this.m_xgmml.length;if(subgraph.walkSubgraphs(this),subgraph.walkVertices(this),xgmmlLen===this.m_xgmml.length){const vertex=subgraph.__hpcc_vertices[0];vertex&&(this.m_xgmml+=this.buildVertexString(vertex,!0))}const props=subgraph.getProperties();for(const key in props)propsStr+='<att name="'+key+'" value="'+xmlEncode(props[key])+'"/>';this.m_xgmml+=root?"":"</graph></att>"+propsStr+"</node>"}return!1}vertexVisited(vertex){this.m_visibleVertices[vertex.__hpcc_id]?this.m_xgmml+=this.buildVertexString(vertex,!1):this.m_semiVisibleVertices[vertex.__hpcc_id]&&(this.m_xgmml+=this.buildVertexString(vertex,!0))}edgeVisited(edge){this.m_visibleEdges[edge.__hpcc_id]&&(this.m_xgmml+=this.buildEdgeString(edge))}}class GraphItem{constructor(graph,id){__publicField(this,"__hpcc_graph");__publicField(this,"__hpcc_parent");__publicField(this,"__widget");__publicField(this,"__hpcc_id");__publicField(this,"_globalID");this.__hpcc_graph=graph,this.__hpcc_id=id,this._globalID=id}getProperties(){const retVal={};for(const key in this)key.indexOf("__")!==0&&this.hasOwnProperty(key)&&(retVal[key]=this[key]);return retVal}}class Subgraph extends GraphItem{constructor(graph,id){super(graph,id);__publicField(this,"_globalType");__publicField(this,"__hpcc_subgraphs");__publicField(this,"__hpcc_vertices");__publicField(this,"__hpcc_edges");__publicField(this,"id");this._globalType=id==="0"?"Graph":"Cluster",this.__hpcc_subgraphs=[],this.__hpcc_vertices=[],this.__hpcc_edges=[],this.id=id}addSubgraph(subgraph){subgraph.__hpcc_parent=this,this.__hpcc_subgraphs.some(subgraph2=>subgraph===subgraph2)||this.__hpcc_subgraphs.push(subgraph)}addVertex(vertex){vertex.__hpcc_parent=this,this.__hpcc_vertices.some(vertex2=>vertex===vertex2)||this.__hpcc_vertices.push(vertex)}removeVertex(vertex){this.__hpcc_vertices=this.__hpcc_vertices.filter(vertex2=>vertex!==vertex2)}addEdge(edge){edge.__hpcc_parent=this,this.__hpcc_edges.some(edge2=>edge===edge2)||this.__hpcc_edges.push(edge)}removeEdge(edge){this.__hpcc_edges=this.__hpcc_edges.filter(edge2=>edge!==edge2)}remove(){this.__hpcc_subgraphs.forEach(subgraph=>subgraph.__hpcc_parent=this.__hpcc_parent),this.__hpcc_vertices.forEach(vertex=>vertex.__hpcc_parent=this.__hpcc_parent),this.__hpcc_edges.forEach(edge=>edge.__hpcc_parent=this.__hpcc_parent),delete this.__hpcc_parent,this.__hpcc_graph.removeItem(this)}walkSubgraphs(visitor){this.__hpcc_subgraphs.forEach((subgraph,idx)=>{visitor.subgraphVisited(subgraph)&&subgraph.walkSubgraphs(visitor)})}walkVertices(visitor){this.__hpcc_vertices.forEach((vertex,idx)=>{visitor.vertexVisited(vertex)})}}class Vertex extends GraphItem{constructor(graph,id){super(graph,id);__publicField(this,"_globalType","Vertex");__publicField(this,"_isSpill")}isSpill(){return this._isSpill}remove(){var _a;const inVertices=this.getInVertices();inVertices.length<=1&&console.warn(this.__hpcc_id+": remove only supports single or zero inputs activities..."),this.getInEdges().forEach(edge=>{edge.remove()}),this.getOutEdges().forEach(edge=>{edge.setSource(inVertices[0])}),(_a=this.__hpcc_parent)==null||_a.removeVertex(this),this.__hpcc_graph.removeItem(this)}getInVertices(){return this.getInEdges().map(edge=>edge.getSource())}getInEdges(){return this.__hpcc_graph.edges.filter(edge=>edge.getTarget()===this)}getOutVertices(){return this.getOutEdges().map(edge=>edge.getTarget())}getOutEdges(){return this.__hpcc_graph.edges.filter(edge=>edge.getSource()===this)}}class Edge extends GraphItem{constructor(graph,id){super(graph,id);__publicField(this,"_globalType","Edge");__publicField(this,"_sourceActivity");__publicField(this,"source");__publicField(this,"_targetActivity");__publicField(this,"target");this._globalType="Edge"}remove(){this.__hpcc_graph.subgraphs.forEach(subgraph=>{subgraph.removeEdge(this)}),this.__hpcc_graph.removeItem(this)}getSource(){return this.__hpcc_graph.idx[this._sourceActivity||this.source]}setSource(source){this._sourceActivity?this._sourceActivity=source.__hpcc_id:this.source&&(this.source=source.__hpcc_id),this.__widget&&this.__widget.setSource(this.getSource().__widget)}getTarget(){return this.__hpcc_graph.idx[this._targetActivity||this.target]}}class QueryGraph{constructor(){__publicField(this,"idx",{});__publicField(this,"subgraphs",[]);__publicField(this,"vertices",[]);__publicField(this,"edges",[]);__publicField(this,"xgmml","");this.clear()}clear(){this.xgmml="",this.idx={},this.subgraphs=[],this.vertices=[],this.edges=[]}load(xgmml){this.clear(),this.merge(xgmml)}merge(xgmml){this.xgmml=xgmml;const dom=new DOMParser().parseFromString(xgmml,"text/xml");this.walkDocument(dom.documentElement,"0")}isSubgraph(item){return item instanceof Subgraph}isVertex(item){return item instanceof Vertex}isEdge(item){return item instanceof Edge}getGlobalType(item){return item instanceof Vertex?3:item instanceof Edge?4:item instanceof Subgraph?2:item instanceof QueryGraph?1:0}getGlobalTypeString(item){return item instanceof Vertex?"Vertex":item instanceof Edge?"Edge":item instanceof Subgraph?"Cluster":item instanceof QueryGraph?"Graph":"Unknown"}getItem(docNode,id){if(!this.idx[id])switch(docNode.tagName){case"graph":const subgraph=new Subgraph(this,id);this.subgraphs.push(subgraph),this.idx[id]=subgraph;break;case"node":const vertex=new Vertex(this,id);this.vertices.push(vertex),this.idx[id]=vertex;break;case"edge":const edge=new Edge(this,id);this.edges.push(edge),this.idx[id]=edge;break;default:console.warn("Graph.getItem - Unknown Node Type!");break}const retVal=this.idx[id];return Array.from(docNode.attributes).forEach(attr=>{safeAssign(retVal,attr.name,attr.value)}),retVal}removeItem(item){delete this.idx[item.__hpcc_id],item instanceof Subgraph?this.subgraphs=this.subgraphs.filter(subgraph=>item!==subgraph):item instanceof Vertex?this.vertices=this.vertices.filter(vertex=>item!==vertex):item instanceof Edge&&(this.edges=this.edges.filter(edge=>item!==edge))}getChildByTagName(docNode,tagName){let retVal=null;return Array.from(docNode.childNodes).some(childNode=>{if(childNode.tagName===tagName)return retVal=childNode,!0}),retVal}walkDocument(docNode,id){const retVal=this.getItem(docNode,id);return docNode.childNodes.forEach(childNode=>{switch(childNode.nodeType){case 1:switch(childNode.tagName){case"graph":break;case"node":let isSubgraph=!1;const attNode=this.getChildByTagName(childNode,"att");if(attNode){const graphNode=this.getChildByTagName(attNode,"graph");if(graphNode){isSubgraph=!0;const subgraph=this.walkDocument(graphNode,childNode.getAttribute("id"));retVal.addSubgraph(subgraph)}}if(!isSubgraph){const vertex=this.walkDocument(childNode,childNode.getAttribute("id"));retVal.addVertex(vertex)}break;case"att":const name=childNode.getAttribute("name"),uname="_"+name,value=childNode.getAttribute("value");name.indexOf("Time")===0?(safeAssign(retVal,uname,value),safeAssign(retVal,name,""+espTime2Seconds(value))):name.indexOf("Size")===0?(safeAssign(retVal,uname,value),safeAssign(retVal,name,""+espSize2Bytes(value))):name.indexOf("Skew")===0?(safeAssign(retVal,uname,value),safeAssign(retVal,name,""+espSkew2Number(value))):safeAssign(retVal,name,value);break;case"edge":const edge=this.walkDocument(childNode,childNode.getAttribute("id"));if(edge.NumRowsProcessed!==void 0?edge._eclwatchCount=edge.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):edge.Count!==void 0?edge._eclwatchCount=edge.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):edge.count!==void 0&&(edge._eclwatchCount=edge.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),edge.inputProgress&&(edge._eclwatchInputProgress="["+edge.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),edge.SkewMaxRowsProcessed&&edge.SkewMinRowsProcessed&&(edge._eclwatchSkew="+"+edge.SkewMaxRowsProcessed+", "+edge.SkewMinRowsProcessed),!edge._dependsOn){if(!edge._childGraph){if(edge._sourceActivity||edge._targetActivity){edge._isSpill=!0;const source=edge.getSource();source&&(source._isSpill=!0);const target=edge.getTarget();target&&(target._isSpill=!0)}}}retVal.addEdge(edge);break}break}}),retVal}removeSubgraphs(){[...this.subgraphs].forEach(subgraph=>{subgraph.__hpcc_parent instanceof Subgraph&&subgraph.remove()})}removeSpillVertices(){[...this.vertices].forEach(vertex=>{vertex.isSpill()&&vertex.remove()})}getLocalisedXGMML(items,localisationDepth,localisationDistance,noSpills){const xgmmlWriter=new LocalisedXGMMLWriter(this);return xgmmlWriter.calcVisibility(items,localisationDepth,localisationDistance,noSpills),xgmmlWriter.writeXgmml(),"<graph>"+xgmmlWriter.m_xgmml+"</graph>"}}const logger$1=util.scopedLogger("@hpcc-js/comms/ecl/query.ts"),siFormatter=format("~s");function isNumber(n){return!isNaN(parseFloat(n))&&!isNaN(n-0)}class QueryCache extends util.Cache{constructor(){super(obj=>util.Cache.hash([obj.QueryId,obj.QuerySet]))}}const _queries=new QueryCache;class Query extends util.StateObject{constructor(optsConnection,querySet,queryID,queryDetails){super();__publicField(this,"wsWorkunitsService");__publicField(this,"topology");__publicField(this,"_requestSchema");__publicField(this,"_responseSchema");__publicField(this,"_eclService");optsConnection instanceof WorkunitsService?this.wsWorkunitsService=optsConnection:this.wsWorkunitsService=new WorkunitsService(optsConnection),this.topology=Topology.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:querySet,QueryId:queryID,...queryDetails})}get BaseUrl(){return this.wsWorkunitsService.baseUrl}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")}static attach(optsConnection,querySet,queryId,state){const retVal=_queries.get({BaseUrl:optsConnection.baseUrl,QuerySet:querySet,QueryId:queryId},()=>new Query(optsConnection,querySet,queryId));return state&&retVal.set(state),retVal}async wsEclService(){return this._eclService||(this._eclService=this.topology.fetchServices({}).then(services=>{var _a,_b;for(const espServer of((_a=services==null?void 0:services.TpEspServers)==null?void 0:_a.TpEspServer)??[])for(const binding of((_b=espServer==null?void 0:espServer.TpBindings)==null?void 0:_b.TpBinding)??[])if((binding==null?void 0:binding.Service)==="ws_ecl"){const baseUrl=`${binding.Protocol}://${globalThis.location.hostname}:${binding.Port}`;return new EclService({baseUrl})}})),this._eclService}async fetchDetails(){const queryDetails=await this.wsWorkunitsService.WUQueryDetails({QuerySet:this.QuerySet,QueryId:this.QueryId,IncludeStateOnClusters:!0,IncludeSuperFiles:!0,IncludeWsEclAddresses:!0,CheckAllNodes:!1});this.set({...queryDetails})}async fetchRequestSchema(){const wsEclService=await this.wsEclService();try{this._requestSchema=await(wsEclService==null?void 0:wsEclService.requestJson(this.QuerySet,this.QueryId))??[]}catch(e){logger$1.debug(e.message??e),this._requestSchema=[]}}async fetchResponseSchema(){const wsEclService=await this.wsEclService();try{this._responseSchema=await(wsEclService==null?void 0:wsEclService.responseJson(this.QuerySet,this.QueryId))??{}}catch(e){logger$1.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(GraphName="",SubGraphId=""){return this.wsWorkunitsService.WUQueryGetGraph({Target:this.QuerySet,QueryId:this.QueryId,GraphName,SubGraphId}).then(response=>{var _a;const graph=new QueryGraph;let first=!0;for(const graphItem of((_a=response==null?void 0:response.Graphs)==null?void 0:_a.ECLGraphEx)||[])first?(graph.load(graphItem.Graph),first=!1):graph.merge(graphItem.Graph);return graph})}fetchDetailsNormalized(request={}){const wu=Workunit.attach(this.wsWorkunitsService,this.Wuid);return wu?Promise.all([this.fetchGraph(),wu.fetchDetailsMeta(),wu.fetchDetailsRaw(request)]).then(promises=>{const graph=promises[0],meta=promises[1],data=promises[2].map(metric=>{if(metric.Id[0]==="a"||metric.Id[0]==="e"){const item=graph.idx[metric.Id.substring(1)];for(const key in item)if(key.charAt(0)!=="_"&&key.charAt(0)===key.charAt(0).toUpperCase()&&(typeof item[key]=="string"||typeof item[key]=="number"||typeof item[key]=="boolean")&&!metric.Properties.Property.some(row=>row.Name===key)){let rawValue=isNumber(item[key])?parseFloat(item[key]):item[key],formatted=item[key];key.indexOf("Time")>=0&&(rawValue=rawValue/1e9,formatted=siFormatter(rawValue)+"s"),metric.Properties.Property.push({Name:key,RawValue:rawValue,Formatted:formatted})}}return metric});return wu.normalizeDetails(meta,data)}):Promise.resolve({meta:void 0,columns:void 0,data:void 0})}async submit(request){const wsEclService=await this.wsEclService();try{return(wsEclService==null?void 0:wsEclService.submit(this.QuerySet,this.QueryId,request).then(results=>{for(const key in results)results[key]=results[key].Row;return results}))??[]}catch(e){return logger$1.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(){const retVal=[];for(const key in this.responseFields())retVal.push(key);return retVal}resultFields(resultName){return this._responseSchema[resultName]?this._responseSchema[resultName]:[]}}class StoreCache extends util.Cache{constructor(){super(obj=>`${obj.BaseUrl}-${obj.Name}:${obj.UserSpecific}-${obj.Namespace}`)}}const _store=new StoreCache;class ValueChangedMessage extends util.Message{constructor(key,value,oldValue){super(),this.key=key,this.value=value,this.oldValue=oldValue}get canConflate(){return!0}conflate(other){return this.key===other.key?(this.value=other.value,!0):!1}void(){return this.value===this.oldValue}}class Store{constructor(optsConnection,Name,Namespace,UserSpecific){__publicField(this,"connection");__publicField(this,"Name");__publicField(this,"UserSpecific");__publicField(this,"Namespace");__publicField(this,"_dispatch",new util.Dispatch);__publicField(this,"_knownValues",{});optsConnection instanceof StoreService?this.connection=optsConnection:this.connection=new StoreService(optsConnection),this.Name=Name,this.UserSpecific=UserSpecific,this.Namespace=Namespace}get BaseUrl(){return this.connection.baseUrl}static attach(optsConnection,Name="HPCCApps",Namespace,UserSpecific=!0){return _store.get({BaseUrl:optsConnection.baseUrl,Name,UserSpecific,Namespace},()=>new Store(optsConnection,Name,Namespace,UserSpecific))}create(){this.connection.CreateStore({Name:this.Name,UserSpecific:this.UserSpecific,Type:"",Description:""})}set(key,value,broadcast=!0){return this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:key,Value:value}).then(response=>{const oldValue=this._knownValues[key];this._knownValues[key]=value,broadcast&&this._dispatch.post(new ValueChangedMessage(key,value,oldValue))}).catch(e=>{console.error(`Store.set("${key}", "${value}") failed:`,e)})}get(key,broadcast=!0){return this.connection.Fetch({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:key}).then(response=>{const oldValue=this._knownValues[key];return this._knownValues[key]=response.Value,broadcast&&this._dispatch.post(new ValueChangedMessage(key,response.Value,oldValue)),response.Value}).catch(e=>{console.error(`Store.get(${key}) failed:`,e)})}getAll(broadcast=!0){return this.connection.FetchAll({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace}).then(response=>{const retVal={},deletedValues=this._knownValues;if(this._knownValues={},response.Pairs.Pair.forEach(pair=>{const oldValue=this._knownValues[pair.Key];this._knownValues[pair.Key]=pair.Value,delete deletedValues[pair.Key],retVal[pair.Key]=pair.Value,broadcast&&this._dispatch.post(new ValueChangedMessage(pair.Key,pair.Value,oldValue))}),broadcast)for(const key in deletedValues)this._dispatch.post(new ValueChangedMessage(key,void 0,deletedValues[key]));return retVal}).catch(e=>(console.error("Store.getAll failed:",e),{}))}delete(key,broadcast=!0){return this.connection.Delete({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:key}).then(response=>{const oldValue=this._knownValues[key];delete this._knownValues[key],broadcast&&this._dispatch.post(new ValueChangedMessage(key,void 0,oldValue))}).catch(e=>{console.error(`Store.delete(${key}) failed:`,e)})}monitor(callback){return this._dispatch.attach(callback)}}const logger=util.scopedLogger("@hpcc-js/comms/dfuWorkunit.ts");class DFUWorkunitCache extends util.Cache{constructor(){super(obj=>`${obj.BaseUrl}-${obj.ID}`)}}const _workunits=new DFUWorkunitCache;class DFUWorkunit extends util.StateObject{constructor(optsConnection,wuid){super();__publicField(this,"connection");__publicField(this,"topologyConnection");this.connection=new FileSprayService(optsConnection),this.topologyConnection=new TopologyService(optsConnection),this.clearState(wuid)}get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get ID(){return this.get("ID")}get DFUServerName(){return this.get("DFUServerName")}get ClusterName(){return this.get("ClusterName")}get JobName(){return this.get("JobName")}get Queue(){return this.get("Queue")}get User(){return this.get("User")}get isProtected(){return this.get("isProtected")}get Command(){return this.get("Command")}get CommandMessage(){return this.get("CommandMessage")}get PercentDone(){return this.get("PercentDone")}get SecsLeft(){return this.get("SecsLeft")}get ProgressMessage(){return this.get("ProgressMessage")}get SummaryMessage(){return this.get("SummaryMessage")}get State(){return this.get("State",0)}get SourceLogicalName(){return this.get("SourceLogicalName")}get SourceIP(){return this.get("SourceIP")}get SourceFilePath(){return this.get("SourceFilePath")}get SourceDali(){return this.get("SourceDali")}get SourceRecordSize(){return this.get("SourceRecordSize")}get SourceFormat(){return this.get("SourceFormat")}get RowTag(){return this.get("RowTag")}get SourceNumParts(){return this.get("SourceNumParts")}get SourceDirectory(){return this.get("SourceDirectory")}get DestLogicalName(){return this.get("DestLogicalName")}get DestGroupName(){return this.get("DestGroupName")}get DestDirectory(){return this.get("DestDirectory")}get DestIP(){return this.get("DestIP")}get DestFilePath(){return this.get("DestFilePath")}get DestFormat(){return this.get("DestFormat")}get DestNumParts(){return this.get("DestNumParts")}get DestRecordSize(){return this.get("DestRecordSize")}get Replicate(){return this.get("Replicate")}get Overwrite(){return this.get("Overwrite")}get Compress(){return this.get("Compress")}get SourceCsvSeparate(){return this.get("SourceCsvSeparate")}get SourceCsvQuote(){return this.get("SourceCsvQuote")}get SourceCsvTerminate(){return this.get("SourceCsvTerminate")}get SourceCsvEscape(){return this.get("SourceCsvEscape")}get TimeStarted(){return this.get("TimeStarted")}get TimeStopped(){return this.get("TimeStopped")}get StateMessage(){return this.get("StateMessage")}get MonitorEventName(){return this.get("MonitorEventName")}get MonitorSub(){return this.get("MonitorSub")}get MonitorShotLimit(){return this.get("MonitorShotLimit")}get SourceDiffKeyName(){return this.get("SourceDiffKeyName")}get DestDiffKeyName(){return this.get("DestDiffKeyName")}get Archived(){return this.get("Archived")}get encrypt(){return this.get("encrypt")}get decrypt(){return this.get("decrypt")}get failIfNoSourceFile(){return this.get("failIfNoSourceFile")}get recordStructurePresent(){return this.get("recordStructurePresent")}get quotedTerminator(){return this.get("quotedTerminator")}get preserveCompression(){return this.get("preserveCompression")}get expireDays(){return this.get("expireDays")}get PreserveFileParts(){return this.get("PreserveFileParts")}get FileAccessCost(){return this.get("FileAccessCost")}get KbPerSecAve(){return this.get("KbPerSecAve")}get KbPerSec(){return this.get("KbPerSec")}static create(optsConnection,dfuServerQueue){const retVal=new DFUWorkunit(optsConnection);return retVal.connection.CreateDFUWorkunit({DFUServerQueue:dfuServerQueue}).then(response=>(_workunits.set(retVal),retVal.set(response.result),retVal))}static attach(optsConnection,wuid,state){const retVal=_workunits.get({BaseUrl:optsConnection.baseUrl,ID:wuid},()=>new DFUWorkunit(optsConnection,wuid));return state&&retVal.set(state),retVal}static sprayFixed(server,request){const service=new FileSprayService(server);return service.SprayFixedEx({...request}).then(response=>{const wuid=response.wuid;return service.GetDFUWorkunit({wuid}).then(response2=>DFUWorkunit.attach(server,wuid,response2.result))})}static sprayVariable(server,request){const service=new FileSprayService(server);return service.SprayVariableEx({...request}).then(response=>{const wuid=response.wuid;return service.GetDFUWorkunit({wuid}).then(response2=>DFUWorkunit.attach(server,wuid,response2.result))})}static despray(server,request){const service=new FileSprayService(server);return service.DesprayEx({...request}).then(response=>{const wuid=response.wuid;return service.GetDFUWorkunit({wuid}).then(response2=>DFUWorkunit.attach(server,wuid,response2.result))})}update(request){var _a,_b;return this.connection.UpdateDFUWorkunitEx({wu:{JobName:((_a=request==null?void 0:request.wu)==null?void 0:_a.JobName)??this.JobName,isProtected:((_b=request==null?void 0:request.wu)==null?void 0:_b.isProtected)??this.isProtected,ID:this.ID,State:this.State},ClusterOrig:this.ClusterName,JobNameOrig:this.JobName,isProtectedOrig:this.isProtected,StateOrig:this.State})}isComplete(){switch(this.State){case 6:case 5:case 4:case 999:return!0}return!1}isFailed(){return!!(this.isComplete()&&this.State!==6)}isDeleted(){switch(this.State){case 999:return!0}return!1}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(exports2.FileSpray.DFUWUActions.Delete).then(response=>this.refresh().then(()=>(this._monitor(),response)))}async refresh(full=!1){return await this.GetDFUWorkunit(),this}fetchXML(callback){return this.DFUWUFile()}_monitor(){if(this.isComplete()){this._monitorTickCount=0;return}super._monitor()}_monitorTimeoutDuration(){const retVal=super._monitorTimeoutDuration();return this._monitorTickCount<=1?3e3:this._monitorTickCount<=5?6e3:this._monitorTickCount<=7?12e3:retVal}DFUWUFile(_request={}){return this.connection.DFUWUFileEx({..._request,Wuid:this.ID}).then(response=>response).catch(e=>"")}DFUWUAction(actionType){return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:actionType}).then(response=>actionType===exports2.FileSpray.DFUWUActions.Delete?response:this.refresh().then(()=>(this._monitor(),response)))}on(eventID,propIDorCallback,callback){if(this.isCallback(propIDorCallback))switch(eventID){case"finished":super.on("propChanged","State",changeInfo=>{this.isComplete()&&propIDorCallback([changeInfo])});break;case"changed":super.on(eventID,propIDorCallback);break}else switch(eventID){case"changed":super.on(eventID,propIDorCallback,callback);break}return this._monitor(),this}watchUntilComplete(callback){return new Promise((resolve,_)=>{const watchHandle=this.watch(changes=>{callback&&callback(changes),this.isComplete()&&(watchHandle.release(),resolve(this))})})}watchUntilRunning(callback){return new Promise((resolve,_)=>{const watchHandle=this.watch(changes=>{callback&&callback(changes),(this.isComplete()||this.isRunning())&&(watchHandle.release(),resolve(this))})})}clearState(wuid){this.clear({ID:wuid,State:0})}GetDFUWorkunit(_request={}){return this.connection.GetDFUWorkunit({..._request,wuid:this.ID}).then(response=>(this.set(response.result),response)).catch(e=>{if(!e.Exception.some(exception=>exception.Code===20080||exception.Code===20081?(this.clearState(this.ID),this.set("State",999),!0):!1))throw logger.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}}exports2.AccessService=AccessService,exports2.AccountService=AccountService,exports2.Activity=Activity,exports2.Attribute=Attribute,exports2.BUILD_VERSION=BUILD_VERSION,exports2.BaseScope=BaseScope,exports2.CloudService=CloudService,exports2.CodesignService=CodesignService,exports2.Connection=Connection,exports2.DFUArrayActions=DFUArrayActions,exports2.DFUChangeProtection=DFUChangeProtection,exports2.DFUChangeRestriction=DFUChangeRestriction,exports2.DFUDefFileFormat=DFUDefFileFormat,exports2.DFUService=DFUService,exports2.DFUWorkunit=DFUWorkunit,exports2.DFUWorkunitCache=DFUWorkunitCache,exports2.DFUXRefService=DFUXRefService,exports2.DaliService=DaliService,exports2.ECLGraph=ECLGraph,exports2.ESPConnection=ESPConnection,exports2.ESPExceptions=ESPExceptions,exports2.EclService=EclService,exports2.ElkService=ElkService,exports2.FileSprayService=FileSprayService,exports2.FileSprayStates=FileSprayStates,exports2.GlobalResultCache=GlobalResultCache,exports2.GraphCache=GraphCache,exports2.LogType=LogType,exports2.LogaccessService=LogaccessService,exports2.LogicalFile=LogicalFile,exports2.LogicalFileCache=LogicalFileCache,exports2.Machine=Machine,exports2.MachineCache=MachineCache,exports2.MachineService=MachineService,exports2.PKG_NAME=PKG_NAME,exports2.PKG_VERSION=PKG_VERSION,exports2.PackageProcessService=PackageProcessService,exports2.PropertyType=PropertyType,exports2.Query=Query,exports2.QueryGraph=QueryGraph,exports2.RelatedProperty=RelatedProperty,exports2.Resource=Resource,exports2.ResourcesService=ResourcesService,exports2.Result=Result,exports2.ResultCache=ResultCache,exports2.SMCService=SMCService,exports2.SashaService=SashaService,exports2.Scope=Scope,exports2.ScopeEdge=ScopeEdge,exports2.ScopeGraph=ScopeGraph,exports2.ScopeSubgraph=ScopeSubgraph,exports2.ScopeVertex=ScopeVertex,exports2.Service=Service,exports2.SourceFile=SourceFile,exports2.Store=Store,exports2.StoreCache=StoreCache,exports2.StoreService=StoreService,exports2.TargetAudience=TargetAudience,exports2.TargetCluster=TargetCluster,exports2.TargetClusterCache=TargetClusterCache,exports2.Timer=Timer,exports2.Topology=Topology,exports2.TopologyCache=TopologyCache,exports2.TopologyService=TopologyService,exports2.ValueChangedMessage=ValueChangedMessage,exports2.WUStateID=WUStateID,exports2.Workunit=Workunit,exports2.WorkunitCache=WorkunitCache,exports2.WorkunitsService=WorkunitsService,exports2.WorkunitsServiceEx=WorkunitsServiceEx,exports2.XGMMLEdge=XGMMLEdge,exports2.XGMMLGraph=XGMMLGraph,exports2.XGMMLSubgraph=XGMMLSubgraph,exports2.XGMMLVertex=XGMMLVertex,exports2.XSDNode=XSDNode,exports2.XSDSchema=XSDSchema,exports2.XSDSimpleType=XSDSimpleType,exports2.XSDXMLNode=XSDXMLNode,exports2.createGraph=createGraph,exports2.createXGMMLGraph=createXGMMLGraph,exports2.defaultTargetCluster=defaultTargetCluster,exports2.deserializeResponse=deserializeResponse,exports2.get=get,exports2.hookSend=hookSend,exports2.instanceOfIConnection=instanceOfIConnection,exports2.instanceOfIOptions=instanceOfIOptions,exports2.isArray=isArray,exports2.isECLResult=isECLResult,exports2.isExceptions=isExceptions,exports2.isWUInfoWorkunit=isWUInfoWorkunit,exports2.isWUQueryECLWorkunit=isWUQueryECLWorkunit,exports2.jsonp=jsonp,exports2.parseXSD=parseXSD,exports2.parseXSD2=parseXSD2,exports2.post=post,exports2.send=send,exports2.serializeRequest=serializeRequest,exports2.setTransportFactory=setTransportFactory,exports2.splitMetric=splitMetric,exports2.targetClusters=targetClusters,Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hpcc-js/util")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/util"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@hpcc-js/comms"]={},e["@hpcc-js/util"])}(this,function(e,t){"use strict";var s=Object.defineProperty,n=(e,t)=>s(e,"name",{value:t,configurable:!0}),r=(e,t,n)=>((e,t,n)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);const i=t.scopedLogger("comms/connection.ts");function o(e){return"baseUrl"in e}n(o,"instanceOfIOptions");const c={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function u(e){return"function"==typeof e.opts&&"function"==typeof e.send&&"function"==typeof e.clone}function a(e,t){return void 0===t||!0===t?encodeURIComponent(e):""+e}function h(e,t=!0,s=""){if(s&&(s+="."),"object"!=typeof e)return a(e,t);const n=[];for(const r in e)if(e.hasOwnProperty(r))if(e[r]instanceof Array){let i=!1;e[r].forEach((e,o)=>{"object"==typeof e?(i=!0,n.push(h(e,t,s+a(`${r}.${o}`,t)))):n.push(s+a(`${r}_i${o}`,t)+"="+h(e,t))}),i&&n.push(s+a(`${r}.itemcount`,t)+"="+e[r].length)}else"object"==typeof e[r]?e[r]&&e[r].Item instanceof Array?(n.push(h(e[r].Item,t,s+a(r,t))),n.push(s+a(`${r}.itemcount`,t)+"="+e[r].Item.length)):n.push(h(e[r],t,s+a(r,t))):void 0!==e[r]?n.push(s+a(r,t)+"="+a(e[r],t)):n.push(s+a(r,t));return n.join("&")}function l(e){return JSON.parse(e)}function d(e,s,r={},o="json",c){return c&&console.warn("Header attributes ignored for JSONP connections"),new Promise((c,u)=>{let a=1e3*e.timeoutSecs;const d="jsonp_callback_"+Math.round(999999*Math.random());window[d]=function(e){a=0,S(),c("json"===o&&"string"==typeof e?l(e):e)};const p=document.createElement("script");let g=t.join(e.baseUrl,s);g+=g.indexOf("?")>=0?"&":"?",p.src=g+"jsonp="+d+"&"+h(r,e.encodeRequest),document.body.appendChild(p);const m=setInterval(function(){a<=0?clearInterval(m):(a-=5e3,a<=0?(clearInterval(m),i.error("Request timeout: "+p.src),S(),u(Error("Request timeout: "+p.src))):i.debug("Request pending ("+a/1e3+" sec): "+p.src))},5e3);function S(){delete window[d],document.body.removeChild(p)}n(S,"doCallback")})}function p(e){return e.userID?{Authorization:`Basic ${btoa(`${e.userID}:${e.password}`)}`}:{}}n(u,"instanceOfIConnection"),n(a,"encode"),n(h,"serializeRequest"),n(l,"deserializeResponse"),n(d,"jsonp"),n(p,"authHeader");const g={};function m(e,s,r,i,o){function c(e){if(e.ok)return"json"===o?e.json():e.text();throw new Error(e.statusText)}return i={...p(e),...i},r={credentials:g[e.baseUrl]?"omit":"include",...r,headers:i},fetch.__setGlobalDispatcher&&fetch.__setGlobalDispatcher(fetch.__defaultAgent),0===e.baseUrl.indexOf("https:")&&(!1===e.rejectUnauthorized&&fetch.__rejectUnauthorizedAgent?fetch.__setGlobalDispatcher?fetch.__setGlobalDispatcher(fetch.__rejectUnauthorizedAgent):r.agent=fetch.__rejectUnauthorizedAgent:fetch.__trustwaveAgent&&(r.agent=fetch.__trustwaveAgent)),n(c,"handleResponse"),t.promiseTimeout(1e3*e.timeoutSecs,fetch(t.join(e.baseUrl,s),r).then(c).catch(n=>(r.credentials=g[e.baseUrl]?"include":"omit",fetch(t.join(e.baseUrl,s),r).then(c).then(t=>(g[e.baseUrl]=!g[e.baseUrl],t)))))}function S(e,t,s,n="json",r){let i;return s.upload_&&(delete s.upload_,t+="?upload_"),s.abortSignal_&&(i=s.abortSignal_,delete s.abortSignal_),m(e,t,{method:"post",body:h(s,e.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...r},n)}function f(e,t,s,n="json",r){let i;return s.abortSignal_&&(i=s.abortSignal_,delete s.abortSignal_),m(e,`${t}?${h(s,e.encodeRequest)}`,{method:"get",signal:i},{...r},n)}function _(e,t,s,n="json",r){let i;switch(e.type){case"jsonp":i=d(e,t,s,n,r);break;case"get":i=f(e,t,s,n,r);break;default:i=S(e,t,s,n,r)}return i}n(m,"doFetch"),n(S,"post"),n(f,"get"),n(_,"send");let U=_;function v(e){const t=U;return e&&(U=e),t}n(v,"hookSend");const y=class _Connection{constructor(e){r(this,"_opts"),this.opts(e)}get baseUrl(){return this._opts.baseUrl}opts(e){return 0===arguments.length?this._opts:(this._opts={...c,...e},this)}send(e,t,s="json",n){return this._opts.hookSend?this._opts.hookSend(this._opts,e,t,s,U,n):U(this._opts,e,t,s,n)}clone(){return new _Connection(this.opts())}};n(y,"Connection");let C=y;function D(t){const s=e.createConnection;return e.createConnection=t,s}function R(e){return"[object Array]"===Object.prototype.toString.call(e)}e.createConnection=function(e){return new C(e)},n(D,"setTransportFactory"),n(R,"isArray");const W=class _ESPExceptions extends Error{constructor(e,t,s){super("ESPException: "+s.Source),r(this,"isESPExceptions",!0),r(this,"action"),r(this,"request"),r(this,"Source"),r(this,"Exception"),this.action=e,this.request=t,this.Source=s.Source,this.Exception=s.Exception,s.Exception.length?this.message=`${s.Exception[0].Code}: ${s.Exception[0].Message}`:this.message=""}};n(W,"ESPExceptions");let b=W;function F(e){return e instanceof b||e.isESPExceptions&&Array.isArray(e.Exception)}function T(e){return void 0!==e.send}n(F,"isExceptions"),n(T,"isConnection");const A=class _ESPConnection{constructor(t,s,n){r(this,"_connection"),r(this,"_service"),r(this,"_version"),this._connection=T(t)?t:e.createConnection(t),this._service=s,this._version=n}get baseUrl(){return this._connection.opts().baseUrl}service(e){return void 0===e?this._service:(this._service=e,this)}version(e){return void 0===e?this._version:(this._version=e,this)}toESPStringArray(e,t){if(R(e[t])){for(let s=0;s<e[t].length;++s)e[t+"_i"+s]=e[t][s];delete e[t]}return e}opts(e){return void 0===e?this._connection.opts():(this._connection.opts(e),this)}send(e,s={},n="json",r=!1,i,o){const c={...s,ver_:this._version};let u;r&&(c.upload_=!0),i&&(c.abortSignal_=i);let a="json";switch(n){case"text":u=t.join(this._service,e),a="text";break;case"xsd":u=t.join(this._service,e+".xsd"),a="text";break;case"json2":u=t.join(this._service,e+"/json"),n="json";const s=e.split("/");e=s.pop();break;default:u=t.join(this._service,e+".json")}return this._connection.send(u,c,a).then(t=>{if("json"===n){let s;if(t&&t.Exceptions)throw new b(e,c,t.Exceptions);if(t&&(s=t[o||e+"Response"]),!s)throw new b(e,c,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return s}return t})}clone(){return new _ESPConnection(this._connection.clone(),this._service,this._version)}};n(A,"ESPConnection");let w=A;const x=class _Service{constructor(e,t,s){r(this,"_connection"),this._connection=new w(e,t,s)}get baseUrl(){return this._connection.opts().baseUrl}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};n(x,"Service");let L=x;var P,M;e.FileSpray=void 0,P=e.FileSpray||(e.FileSpray={}),(M=P.DFUWUActions||(P.DFUWUActions={})).Delete="Delete",M.Protect="Protect",M.Unprotect="Unprotect",M.Restore="Restore",M.SetToFailed="SetToFailed",M.Archive="Archive";const E=class _FileSprayServiceBase extends L{constructor(e){super(e,"FileSpray","1.26")}AbortDFUWorkunit(e){return this._connection.send("AbortDFUWorkunit",e,"json",!1,void 0,"AbortDFUWorkunitResponse")}Copy(e){return this._connection.send("Copy",e,"json",!1,void 0,"CopyResponse")}CreateDFUPublisherWorkunit(e){return this._connection.send("CreateDFUPublisherWorkunit",e,"json",!1,void 0,"CreateDFUPublisherWorkunitResponse")}CreateDFUWorkunit(e){return this._connection.send("CreateDFUWorkunit",e,"json",!1,void 0,"CreateDFUWorkunitResponse")}DFUWUFile(e){return this._connection.send("DFUWUFile",e,"json",!1,void 0,"DFUWUFileResponse")}DFUWUSearch(e){return this._connection.send("DFUWUSearch",e,"json",!1,void 0,"DFUWUSearchResponse")}DFUWorkunitsAction(e){return this._connection.send("DFUWorkunitsAction",e,"json",!1,void 0,"DFUWorkunitsActionResponse")}DeleteDFUWorkunit(e){return this._connection.send("DeleteDFUWorkunit",e,"json",!1,void 0,"DeleteDFUWorkunitResponse")}DeleteDFUWorkunits(e){return this._connection.send("DeleteDFUWorkunits",e,"json",!1,void 0,"DeleteDFUWorkunitsResponse")}DeleteDropZoneFiles(e){return this._connection.send("DeleteDropZoneFiles",e,"json",!1,void 0,"DFUWorkunitsActionResponse")}Despray(e){return this._connection.send("Despray",e,"json",!1,void 0,"DesprayResponse")}DfuMonitor(e){return this._connection.send("DfuMonitor",e,"json",!1,void 0,"DfuMonitorResponse")}DropZoneFileSearch(e){return this._connection.send("DropZoneFileSearch",e,"json",!1,void 0,"DropZoneFileSearchResponse")}DropZoneFiles(e){return this._connection.send("DropZoneFiles",e,"json",!1,void 0,"DropZoneFilesResponse")}EchoDateTime(e){return this._connection.send("EchoDateTime",e,"json",!1,void 0,"EchoDateTimeResponse")}FileList(e){return this._connection.send("FileList",e,"json",!1,void 0,"FileListResponse")}GetDFUExceptions(e){return this._connection.send("GetDFUExceptions",e,"json",!1,void 0,"GetDFUExceptionsResponse")}GetDFUProgress(e){return this._connection.send("GetDFUProgress",e,"json",!1,void 0,"ProgressResponse")}GetDFUServerQueues(e){return this._connection.send("GetDFUServerQueues",e,"json",!1,void 0,"GetDFUServerQueuesResponse")}GetDFUWorkunit(e){return this._connection.send("GetDFUWorkunit",e,"json",!1,void 0,"GetDFUWorkunitResponse")}GetDFUWorkunits(e){return this._connection.send("GetDFUWorkunits",e,"json",!1,void 0,"GetDFUWorkunitsResponse")}GetRemoteTargets(e){return this._connection.send("GetRemoteTargets",e,"json",!1,void 0,"GetRemoteTargetsResponse")}GetSprayTargets(e){return this._connection.send("GetSprayTargets",e,"json",!1,void 0,"GetSprayTargetsResponse")}OpenSave(e){return this._connection.send("OpenSave",e,"json",!1,void 0,"OpenSaveResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"FileSprayPingResponse")}Rename(e){return this._connection.send("Rename",e,"json",!1,void 0,"RenameResponse")}Replicate(e){return this._connection.send("Replicate",e,"json",!1,void 0,"ReplicateResponse")}ShowResult(e){return this._connection.send("ShowResult",e,"json",!1,void 0,"ShowResultResponse")}SprayFixed(e){return this._connection.send("SprayFixed",e,"json",!1,void 0,"SprayFixedResponse")}SprayVariable(e){return this._connection.send("SprayVariable",e,"json",!1,void 0,"SprayResponse")}SubmitDFUWorkunit(e){return this._connection.send("SubmitDFUWorkunit",e,"json",!1,void 0,"SubmitDFUWorkunitResponse")}UpdateDFUWorkunit(e){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,void 0,"UpdateDFUWorkunitResponse")}};n(E,"FileSprayServiceBase");let I=E;var N=(e=>(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))(N||{});const k=class _FileSprayService extends I{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")}};n(k,"FileSprayService");let j=k;var G,V,Q,B,O,X;e.WsAccess=void 0,G=e.WsAccess||(e.WsAccess={}),(V=G.ViewMemberType||(G.ViewMemberType={})).User="User",V.Group="Group",(Q=G.UserSortBy||(G.UserSortBy={})).username="username",Q.fullname="fullname",Q.passwordexpiration="passwordexpiration",Q.employeeID="employeeID",Q.employeeNumber="employeeNumber",(B=G.GroupSortBy||(G.GroupSortBy={})).Name="Name",B.ManagedBy="ManagedBy",(O=G.AccountTypeReq||(G.AccountTypeReq={})).Any="Any",O.User="User",O.Group="Group",(X=G.ResourcePermissionSortBy||(G.ResourcePermissionSortBy={})).Name="Name",X.Type="Type",(G.ResourceSortBy||(G.ResourceSortBy={})).Name="Name";const $=class _AccessServiceBase extends L{constructor(e){super(e,"ws_access","1.17")}AccountPermissions(e){return this._connection.send("AccountPermissions",e,"json",!1,void 0,"AccountPermissionsResponse")}AccountPermissionsV2(e){return this._connection.send("AccountPermissionsV2",e,"json",!1,void 0,"AccountPermissionsV2Response")}AddUser(e){return this._connection.send("AddUser",e,"json",!1,void 0,"AddUserResponse")}AddView(e){return this._connection.send("AddView",e,"json",!1,void 0,"AddViewResponse")}AddViewColumn(e){return this._connection.send("AddViewColumn",e,"json",!1,void 0,"AddViewColumnResponse")}AddViewMember(e){return this._connection.send("AddViewMember",e,"json",!1,void 0,"AddViewMemberResponse")}ClearPermissionsCache(e){return this._connection.send("ClearPermissionsCache",e,"json",!1,void 0,"ClearPermissionsCacheResponse")}DeleteView(e){return this._connection.send("DeleteView",e,"json",!1,void 0,"DeleteViewResponse")}DeleteViewColumn(e){return this._connection.send("DeleteViewColumn",e,"json",!1,void 0,"DeleteViewColumnResponse")}DeleteViewMember(e){return this._connection.send("DeleteViewMember",e,"json",!1,void 0,"DeleteViewMemberResponse")}DisableScopeScans(e){return this._connection.send("DisableScopeScans",e,"json",!1,void 0,"DisableScopeScansResponse")}EnableScopeScans(e){return this._connection.send("EnableScopeScans",e,"json",!1,void 0,"EnableScopeScansResponse")}FilePermission(e){return this._connection.send("FilePermission",e,"json",!1,void 0,"FilePermissionResponse")}GroupAction(e){return this._connection.send("GroupAction",e,"json",!1,void 0,"GroupActionResponse")}GroupAdd(e){return this._connection.send("GroupAdd",e,"json",!1,void 0,"GroupAddResponse")}GroupEdit(e){return this._connection.send("GroupEdit",e,"json",!1,void 0,"GroupEditResponse")}GroupMemberEdit(e){return this._connection.send("GroupMemberEdit",e,"json",!1,void 0,"GroupMemberEditResponse")}GroupMemberEditInput(e){return this._connection.send("GroupMemberEditInput",e,"json",!1,void 0,"GroupMemberEditInputResponse")}GroupMemberQuery(e){return this._connection.send("GroupMemberQuery",e,"json",!1,void 0,"GroupMemberQueryResponse")}GroupQuery(e){return this._connection.send("GroupQuery",e,"json",!1,void 0,"GroupQueryResponse")}Groups(e){return this._connection.send("Groups",e,"json",!1,void 0,"GroupResponse")}PermissionAction(e){return this._connection.send("PermissionAction",e,"json",!1,void 0,"PermissionActionResponse")}Permissions(e){return this._connection.send("Permissions",e,"json",!1,void 0,"BasednsResponse")}PermissionsReset(e){return this._connection.send("PermissionsReset",e,"json",!1,void 0,"PermissionsResetResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_accessPingResponse")}QueryScopeScansEnabled(e){return this._connection.send("QueryScopeScansEnabled",e,"json",!1,void 0,"QueryScopeScansEnabledResponse")}QueryUserViewColumns(e){return this._connection.send("QueryUserViewColumns",e,"json",!1,void 0,"QueryUserViewColumnsResponse")}QueryViewColumns(e){return this._connection.send("QueryViewColumns",e,"json",!1,void 0,"QueryViewColumnsResponse")}QueryViewMembers(e){return this._connection.send("QueryViewMembers",e,"json",!1,void 0,"QueryViewMembersResponse")}QueryViews(e){return this._connection.send("QueryViews",e,"json",!1,void 0,"QueryViewsResponse")}ResourceAdd(e){return this._connection.send("ResourceAdd",e,"json",!1,void 0,"ResourceAddResponse")}ResourceDelete(e){return this._connection.send("ResourceDelete",e,"json",!1,void 0,"ResourceDeleteResponse")}ResourcePermissionQuery(e){return this._connection.send("ResourcePermissionQuery",e,"json",!1,void 0,"ResourcePermissionQueryResponse")}ResourcePermissions(e){return this._connection.send("ResourcePermissions",e,"json",!1,void 0,"ResourcePermissionsResponse")}ResourceQuery(e){return this._connection.send("ResourceQuery",e,"json",!1,void 0,"ResourceQueryResponse")}Resources(e){return this._connection.send("Resources",e,"json",!1,void 0,"ResourcesResponse")}UserAccountExport(e){return this._connection.send("UserAccountExport",e,"json",!1,void 0,"UserAccountExportResponse")}UserAction(e){return this._connection.send("UserAction",e,"json",!1,void 0,"UserActionResponse")}UserEdit(e){return this._connection.send("UserEdit",e,"json",!1,void 0,"UserEditResponse")}UserGroupEdit(e){return this._connection.send("UserGroupEdit",e,"json",!1,void 0,"UserGroupEditResponse")}UserGroupEditInput(e){return this._connection.send("UserGroupEditInput",e,"json",!1,void 0,"UserGroupEditInputResponse")}UserInfoEdit(e){return this._connection.send("UserInfoEdit",e,"json",!1,void 0,"UserInfoEditResponse")}UserInfoEditInput(e){return this._connection.send("UserInfoEditInput",e,"json",!1,void 0,"UserInfoEditInputResponse")}UserPosix(e){return this._connection.send("UserPosix",e,"json",!1,void 0,"UserPosixResponse")}UserPosixInput(e){return this._connection.send("UserPosixInput",e,"json",!1,void 0,"UserPosixInputResponse")}UserQuery(e){return this._connection.send("UserQuery",e,"json",!1,void 0,"UserQueryResponse")}UserResetPass(e){return this._connection.send("UserResetPass",e,"json",!1,void 0,"UserResetPassResponse")}UserResetPassInput(e){return this._connection.send("UserResetPassInput",e,"json",!1,void 0,"UserResetPassInputResponse")}UserSudoers(e){return this._connection.send("UserSudoers",e,"json",!1,void 0,"UserSudoersResponse")}UserSudoersInput(e){return this._connection.send("UserSudoersInput",e,"json",!1,void 0,"UserSudoersInputResponse")}Users(e){return this._connection.send("Users",e,"json",!1,void 0,"UserResponse")}};n($,"AccessServiceBase");let J=$;const H=class _AccessService extends J{};n(H,"AccessService");let q=H;const z=class _AccountServiceBase extends L{constructor(e){super(e,"ws_account","1.07")}MyAccount(e){return this._connection.send("MyAccount",e,"json",!1,void 0,"MyAccountResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_accountPingResponse")}UpdateUser(e){return this._connection.send("UpdateUser",e,"json",!1,void 0,"UpdateUserResponse")}UpdateUserInput(e){return this._connection.send("UpdateUserInput",e,"json",!1,void 0,"UpdateUserInputResponse")}VerifyUser(e){return this._connection.send("VerifyUser",e,"json",!1,void 0,"VerifyUserResponse")}};n(z,"AccountServiceBase");let Y=z;const Z=class _AccountService extends Y{VerifyUser(e){return this._connection.send("VerifyUser",e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>20043===e.Code))return{retcode:20043,Exceptions:{Source:"wsAccount",Exception:e.Exception}};throw e})}};n(Z,"AccountService");let K=Z;const ee=class _CloudServiceBase extends L{constructor(e){super(e,"WsCloud","1.02")}GetPODs(e){return this._connection.send("GetPODs",e,"json",!1,void 0,"GetPODsResponse")}GetServices(e){return this._connection.send("GetServices",e,"json",!1,void 0,"GetServicesResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsCloudPingResponse")}};n(ee,"CloudServiceBase");let te=ee;const se=t.scopedLogger("@hpcc-js/comms/services/wsCloud.ts");function ne(e){return void 0!==(null==e?void 0:e.Pods)}function re(e){var t,s;return(null==(s=null==(t=e.spec)?void 0:t.containers)?void 0:s.reduce((e,t)=>{var s;return null==(s=t.ports)||s.forEach(t=>{e.push({ContainerPort:t.containerPort,Name:t.name,Protocol:t.protocol})}),e},[]))??[]}function ie(e){return e.filter(e=>{var t;const s=(null==(t=null==e?void 0:e.metadata)?void 0:t.labels)??{};return s.hasOwnProperty("app.kubernetes.io/part-of")&&"HPCC-Platform"===s["app.kubernetes.io/part-of"]}).map(e=>{var t,s,n,r,i,o,c,u,a,h;const l=new Date(null==(t=e.metadata)?void 0:t.creationTimestamp);return{Name:e.metadata.name,Status:null==(s=e.status)?void 0:s.phase,CreationTimestamp:l.toISOString(),ContainerName:(null==(r=null==(n=e.status)?void 0:n.containerStatuses)?void 0:r.reduce((e,t)=>(t.name&&e.push(t.name),e),[]).join(", "))??"",ContainerCount:(null==(o=null==(i=e.spec)?void 0:i.containers)?void 0:o.length)??0,ContainerReadyCount:null==(u=null==(c=e.status)?void 0:c.containerStatuses)?void 0:u.reduce((e,t)=>e+(t.ready?1:0),0),ContainerRestartCount:null==(h=null==(a=e.status)?void 0:a.containerStatuses)?void 0:h.reduce((e,t)=>e+t.restartCount,0),Ports:{Port:re(e)}}})}n(ne,"isGetPODsResponse_v1_02"),n(re,"mapPorts"),n(ie,"mapPods");const oe=class _CloudService extends te{getPODs(){return super.GetPODs({}).then(e=>{var t;if(ne(e))return(null==(t=e.Pods)?void 0:t.Pod)??[];try{const t="string"==typeof e.Result?JSON.parse(e.Result):e.Result;return ie((null==t?void 0:t.items)??[])}catch(s){return se.error(`Error parsing V1Pods json '${s instanceof Error?s.message:String(s)}'`),[]}})}};n(oe,"CloudService");let ce=oe;const ue=class _CodesignService{constructor(e){r(this,"_connection"),this._connection=new w(e,"ws_codesign","1.1")}connectionOptions(){return this._connection.opts()}ListUserIDs(e){return this._connection.send("ListUserIDs",e).then(e=>e.UserIDs.Item).catch(e=>[])}Sign(e){return this._connection.send("Sign",{SigningMethod:"gpg",...e})}Verify(e){return this._connection.send("Verify",e)}};n(ue,"CodesignService");let ae=ue;const he=class _DaliServiceBase extends L{constructor(e){super(e,"WSDali","1.07")}Add(e){return this._connection.send("Add",e,"json",!1,void 0,"ResultResponse")}ClearTraceTransactions(e){return this._connection.send("ClearTraceTransactions",e,"json",!1,void 0,"ResultResponse")}Count(e){return this._connection.send("Count",e,"json",!1,void 0,"CountResponse")}DFSCheck(e){return this._connection.send("DFSCheck",e,"json",!1,void 0,"ResultResponse")}DFSExists(e){return this._connection.send("DFSExists",e,"json",!1,void 0,"BooleanResponse")}DFSLS(e){return this._connection.send("DFSLS",e,"json",!1,void 0,"ResultResponse")}Delete(e){return this._connection.send("Delete",e,"json",!1,void 0,"ResultResponse")}DisconnectClientConnection(e){return this._connection.send("DisconnectClientConnection",e,"json",!1,void 0,"ResultResponse")}GetClients(e){return this._connection.send("GetClients",e,"json",!1,void 0,"ResultResponse")}GetConnections(e){return this._connection.send("GetConnections",e,"json",!1,void 0,"ResultResponse")}GetDFSCSV(e){return this._connection.send("GetDFSCSV",e,"json",!1,void 0,"ResultResponse")}GetDFSMap(e){return this._connection.send("GetDFSMap",e,"json",!1,void 0,"ResultResponse")}GetDFSParents(e){return this._connection.send("GetDFSParents",e,"json",!1,void 0,"ResultResponse")}GetLogicalFile(e){return this._connection.send("GetLogicalFile",e,"json",!1,void 0,"ResultResponse")}GetLogicalFilePart(e){return this._connection.send("GetLogicalFilePart",e,"json",!1,void 0,"ResultResponse")}GetProtectedList(e){return this._connection.send("GetProtectedList",e,"json",!1,void 0,"ResultResponse")}GetSDSStats(e){return this._connection.send("GetSDSStats",e,"json",!1,void 0,"ResultResponse")}GetSDSSubscribers(e){return this._connection.send("GetSDSSubscribers",e,"json",!1,void 0,"ResultResponse")}GetValue(e){return this._connection.send("GetValue",e,"json",!1,void 0,"ResultResponse")}Import(e){return this._connection.send("Import",e,"json",!1,void 0,"ResultResponse")}ListSDSLocks(e){return this._connection.send("ListSDSLocks",e,"json",!1,void 0,"ResultResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WSDaliPingResponse")}SaveSDSStore(e){return this._connection.send("SaveSDSStore",e,"json",!1,void 0,"ResultResponse")}SetLogicalFilePartAttr(e){return this._connection.send("SetLogicalFilePartAttr",e,"json",!1,void 0,"ResultResponse")}SetProtected(e){return this._connection.send("SetProtected",e,"json",!1,void 0,"ResultResponse")}SetTraceSlowTransactions(e){return this._connection.send("SetTraceSlowTransactions",e,"json",!1,void 0,"ResultResponse")}SetTraceTransactions(e){return this._connection.send("SetTraceTransactions",e,"json",!1,void 0,"ResultResponse")}SetUnprotected(e){return this._connection.send("SetUnprotected",e,"json",!1,void 0,"ResultResponse")}SetValue(e){return this._connection.send("SetValue",e,"json",!1,void 0,"ResultResponse")}UnlockSDSLock(e){return this._connection.send("UnlockSDSLock",e,"json",!1,void 0,"ResultResponse")}};n(he,"DaliServiceBase");let le=he;const de=class _DaliService extends le{};n(de,"DaliService");let pe=de;var ge,me,Se,fe,_e,Ue,ve,ye;e.WsDfu=void 0,ge=e.WsDfu||(e.WsDfu={}),(me=ge.DFUArrayActions||(ge.DFUArrayActions={})).Delete="Delete",me.AddToSuperfile="Add To Superfile",me.ChangeProtection="Change Protection",me.ChangeRestriction="Change Restriction",(Se=ge.DFUChangeProtection||(ge.DFUChangeProtection={}))[Se.NoChange=0]="NoChange",Se[Se.Protect=1]="Protect",Se[Se.Unprotect=2]="Unprotect",Se[Se.UnprotectAll=3]="UnprotectAll",(fe=ge.DFUChangeRestriction||(ge.DFUChangeRestriction={}))[fe.NoChange=0]="NoChange",fe[fe.Restrict=1]="Restrict",fe[fe.Unrestricted=2]="Unrestricted",(_e=ge.DFUDefFileFormat||(ge.DFUDefFileFormat={})).xml="xml",_e.def="def",(Ue=ge.FileAccessRole||(ge.FileAccessRole={})).Token="Token",Ue.Engine="Engine",Ue.External="External",(ve=ge.SecAccessType||(ge.SecAccessType={})).None="None",ve.Access="Access",ve.Read="Read",ve.Write="Write",ve.Full="Full",(ye=ge.DFUFileType||(ge.DFUFileType={})).Flat="Flat",ye.Index="Index",ye.Xml="Xml",ye.Csv="Csv",ye.Json="Json",ye.IndexLocal="IndexLocal",ye.IndexPartitioned="IndexPartitioned",ye.Unset="Unset";const Ce=class _DfuServiceBase extends L{constructor(e){super(e,"WsDfu","1.65")}Add(e){return this._connection.send("Add",e,"json",!1,void 0,"AddResponse")}AddRemote(e){return this._connection.send("AddRemote",e,"json",!1,void 0,"AddRemoteResponse")}AddtoSuperfile(e){return this._connection.send("AddtoSuperfile",e,"json",!1,void 0,"AddtoSuperfileResponse")}DFUArrayAction(e){return this._connection.send("DFUArrayAction",e,"json",!1,void 0,"DFUArrayActionResponse")}DFUBrowseData(e){return this._connection.send("DFUBrowseData",e,"json",!1,void 0,"DFUBrowseDataResponse")}DFUDefFile(e){return this._connection.send("DFUDefFile",e,"json",!1,void 0,"DFUDefFileResponse")}DFUFileAccess(e){return this._connection.send("DFUFileAccess",e,"json",!1,void 0,"DFUFileAccessResponse")}DFUFileAccessV2(e){return this._connection.send("DFUFileAccessV2",e,"json",!1,void 0,"DFUFileAccessResponse")}DFUFileCreate(e){return this._connection.send("DFUFileCreate",e,"json",!1,void 0,"DFUFileCreateResponse")}DFUFileCreateV2(e){return this._connection.send("DFUFileCreateV2",e,"json",!1,void 0,"DFUFileCreateResponse")}DFUFilePublish(e){return this._connection.send("DFUFilePublish",e,"json",!1,void 0,"DFUFilePublishResponse")}DFUFileView(e){return this._connection.send("DFUFileView",e,"json",!1,void 0,"DFUFileViewResponse")}DFUGetDataColumns(e){return this._connection.send("DFUGetDataColumns",e,"json",!1,void 0,"DFUGetDataColumnsResponse")}DFUGetFileMetaData(e){return this._connection.send("DFUGetFileMetaData",e,"json",!1,void 0,"DFUGetFileMetaDataResponse")}DFUInfo(e){return this._connection.send("DFUInfo",e,"json",!1,void 0,"DFUInfoResponse")}DFUQuery(e){return this._connection.send("DFUQuery",e,"json",!1,void 0,"DFUQueryResponse")}DFURecordTypeInfo(e){return this._connection.send("DFURecordTypeInfo",e,"json",!1,void 0,"DFURecordTypeInfoResponse")}DFUSearch(e){return this._connection.send("DFUSearch",e,"json",!1,void 0,"DFUSearchResponse")}DFUSearchData(e){return this._connection.send("DFUSearchData",e,"json",!1,void 0,"DFUSearchDataResponse")}DFUSpace(e){return this._connection.send("DFUSpace",e,"json",!1,void 0,"DFUSpaceResponse")}EclRecordTypeInfo(e){return this._connection.send("EclRecordTypeInfo",e,"json",!1,void 0,"EclRecordTypeInfoResponse")}EraseHistory(e){return this._connection.send("EraseHistory",e,"json",!1,void 0,"EraseHistoryResponse")}ListHistory(e){return this._connection.send("ListHistory",e,"json",!1,void 0,"ListHistoryResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsDfuPingResponse")}Savexml(e){return this._connection.send("Savexml",e,"json",!1,void 0,"SavexmlResponse")}SuperfileAction(e){return this._connection.send("SuperfileAction",e,"json",!1,void 0,"SuperfileActionResponse")}SuperfileList(e){return this._connection.send("SuperfileList",e,"json",!1,void 0,"SuperfileListResponse")}};n(Ce,"DfuServiceBase");let De=Ce;const Re=e.WsDfu.DFUArrayActions,We=e.WsDfu.DFUDefFileFormat,be=e.WsDfu.DFUChangeProtection,Fe=e.WsDfu.DFUChangeRestriction,Te=class _DFUService extends De{DFUFile(e){return this._connection.send("DFUDefFile",e,"text")}async recursiveFetchLogicalFiles(e){const t=[],s=[];return await Promise.all(e.map(e=>this.DFUInfo({Cluster:e.NodeGroup,Name:e.Name,IncludeJsonTypeInfo:!1,IncludeBinTypeInfo:!1,ForceIndexInfo:!1}).then(e=>{var n,r,i,o;for(const s of(null==(r=null==(n=null==e?void 0:e.FileDetail)?void 0:n.Superfiles)?void 0:r.DFULogicalFile)??[])t.push(s);for(const t of(null==(o=null==(i=null==e?void 0:e.FileDetail)?void 0:i.subfiles)?void 0:o.Item)??[])s.push(t)}))),s.concat(t.length?await this.recursiveFetchLogicalFiles(t):[])}};n(Te,"DFUService");let Ae=Te;const we=class _DFUXRefService extends L{constructor(e){super(e,"WsDFUXRef","1.01")}DFUXRefArrayAction(e){return this._connection.send("DFUXRefArrayAction",e)}DFUXRefBuild(e){return this._connection.send("DFUXRefBuild",e)}DFUXRefBuildCancel(e){return this._connection.send("DFUXRefBuildCancel",e)}DFUXRefCleanDirectories(e){return this._connection.send("DFUXRefCleanDirectories",e)}DFUXRefDirectories(e){return this._connection.send("DFUXRefDirectories",e,void 0,void 0,void 0,"DFUXRefDirectoriesQueryResponse")}DFUXRefFoundFiles(e){return this._connection.send("DFUXRefFoundFiles",e,void 0,void 0,void 0,"DFUXRefFoundFilesQueryResponse")}DFUXRefList(e={}){return this._connection.send("DFUXRefList",e)}DFUXRefLostFiles(e){return this._connection.send("DFUXRefLostFiles",e,void 0,void 0,void 0,"DFUXRefLostFilesQueryResponse")}DFUXRefMessages(e){return this._connection.send("DFUXRefMessages",e,void 0,void 0,void 0,"DFUXRefMessagesQueryResponse")}DFUXRefOrphanFiles(e){return this._connection.send("DFUXRefOrphanFiles",e,void 0,void 0,void 0,"DFUXRefOrphanFilesQueryResponse")}DFUXRefUnusedFiles(e){return this._connection.send("DFUXRefUnusedFiles",e)}};n(we,"DFUXRefService");let xe=we;function Le(e,t){const s=typeof t;switch(s){case"boolean":case"number":case"string":return{id:e,type:s};case"object":if(t.Row instanceof Array&&(t=t.Row),t instanceof Array)return{id:e,type:"dataset",children:Pe(t[0])};if(t instanceof Object){if(t.Item&&t.Item instanceof Array&&1===t.Item.length){const s=typeof t.Item[0];if("string"===s||"number"===s)return{id:e,type:"set",fieldType:s};throw new Error("Unknown field type")}return{id:e,type:"object",fields:Me(t)}}default:throw new Error("Unknown field type")}}function Pe(e){e.Row&&e.Row instanceof Array&&(e=e.Row[0]);const t=[];for(const s in e)t.push(Le(s,e[s]));return t}function Me(e){const t={};for(const s in e)t[s]=Le(s,e[s]);return t}n(Le,"jsonToIField"),n(Pe,"jsonToIFieldArr"),n(Me,"jsonToIFieldObj");const Ee=class _EclService extends L{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=>{const t=JSON.parse(e);for(const s in t)return t[s];return{}}).then(Pe)}responseJson(e,t){return this._connection.send(`example/response/query/${e}/${t}/json`,{},"text").then(e=>{const t=JSON.parse(e);for(const s in t)return t[s].Results;return{}}).then(e=>{const t={};for(const s in e)t[s]=Pe(e[s]);return t})}submit(e,t,s){const n=`submit/query/${e}/${t}`;return this._connection.send(n,s,"json2").then(e=>{if(e.Results&&e.Results.Exception)throw new b(n,s,{Source:"wsEcl.submit",Exception:e.Results.Exception});return e.Results})}};n(Ee,"EclService");let Ie=Ee;const Ne=class _ElkServiceBase extends L{constructor(e){super(e,"ws_elk","1")}GetConfigDetails(e){return this._connection.send("GetConfigDetails",e)}Ping(e){return this._connection.send("Ping",e)}};n(Ne,"ElkServiceBase");let ke=Ne;const je=class _ElkService extends ke{};n(je,"ElkService");let Ge=je;var Ve,Qe,Be,Oe,Xe,$e,Je,He,qe;e.WsLogaccess=void 0,Ve=e.WsLogaccess||(e.WsLogaccess={}),(Qe=Ve.LogColumnType||(Ve.LogColumnType={})).global="global",Qe.workunits="workunits",Qe.components="components",Qe.audience="audience",Qe.class="class",Qe.instance="instance",Qe.node="node",Qe.message="message",Qe.logid="logid",Qe.processid="processid",Qe.threadid="threadid",Qe.timestamp="timestamp",Qe.pod="pod",Qe.traceid="traceid",Qe.spanid="spanid",(Be=Ve.LogColumnValueType||(Ve.LogColumnValueType={})).string="string",Be.numeric="numeric",Be.datetime="datetime",Be.enum="enum",Be.epoch="epoch",(Oe=Ve.LogAccessType||(Ve.LogAccessType={}))[Oe.All=0]="All",Oe[Oe.ByJobID=1]="ByJobID",Oe[Oe.ByComponent=2]="ByComponent",Oe[Oe.ByLogType=3]="ByLogType",Oe[Oe.ByTargetAudience=4]="ByTargetAudience",Oe[Oe.BySourceInstance=5]="BySourceInstance",Oe[Oe.BySourceNode=6]="BySourceNode",Oe[Oe.ByFieldName=7]="ByFieldName",Oe[Oe.ByPod=8]="ByPod",Oe[Oe.ByTraceID=9]="ByTraceID",Oe[Oe.BySpanID=10]="BySpanID",(Xe=Ve.LogAccessStatusCode||(Ve.LogAccessStatusCode={}))[Xe.Success=0]="Success",Xe[Xe.Warning=1]="Warning",Xe[Xe.Fail=2]="Fail",($e=Ve.LogAccessFilterOperator||(Ve.LogAccessFilterOperator={}))[$e.NONE=0]="NONE",$e[$e.AND=1]="AND",$e[$e.OR=2]="OR",(Je=Ve.LogSelectColumnMode||(Ve.LogSelectColumnMode={}))[Je.MIN=0]="MIN",Je[Je.DEFAULT=1]="DEFAULT",Je[Je.ALL=2]="ALL",Je[Je.CUSTOM=3]="CUSTOM",(He=Ve.SortColumType||(Ve.SortColumType={}))[He.ByDate=0]="ByDate",He[He.ByJobID=1]="ByJobID",He[He.ByComponent=2]="ByComponent",He[He.ByLogType=3]="ByLogType",He[He.ByTargetAudience=4]="ByTargetAudience",He[He.BySourceInstance=5]="BySourceInstance",He[He.BySourceNode=6]="BySourceNode",He[He.ByFieldName=7]="ByFieldName",He[He.ByPod=8]="ByPod",He[He.ByTraceID=9]="ByTraceID",He[He.BySpanID=10]="BySpanID",(qe=Ve.SortDirection||(Ve.SortDirection={}))[qe.ASC=0]="ASC",qe[qe.DSC=1]="DSC";const ze=class _LogaccessServiceBase extends L{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")}};n(ze,"LogaccessServiceBase");let Ye=ze;const Ze=t.scopedLogger("@hpcc-js/comms/services/wsLogaccess.ts");var Ke=(e=>(e.Disaster="DIS",e.Error="ERR",e.Warning="WRN",e.Information="INF",e.Progress="PRO",e.Metric="MET",e))(Ke||{}),et=(e=>(e.Operator="OPR",e.User="USR",e.Programmer="PRO",e.Audit="ADT",e))(et||{});const tt=class _LogaccessService extends Ye{constructor(){super(...arguments),r(this,"_logAccessInfo")}GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}async GetLogsEx(t){var s,r,i,o,c,u,a,h;const l=await this.GetLogAccessInfo(),d={};l.Columns.Column.forEach(e=>d[e.LogType]=e.Name);const p=n(e=>{const t={};for(const s in d)(null==e?void 0:e.fields)?t[s]=Object.assign({},...e.fields)[d[s]]??"":t[s]="";return t},"convertLogLine"),g={Filter:{leftBinaryFilter:{BinaryLogFilter:[{leftFilter:{LogCategory:e.WsLogaccess.LogAccessType.All}}]}},Range:{StartDate:new Date(0).toISOString()},LogLineStartFrom:t.LogLineStartFrom??0,LogLineLimit:t.LogLineLimit??100,SelectColumnMode:e.WsLogaccess.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:e.WsLogaccess.SortColumType.ByDate,ColumnName:"",Direction:0}]}},m=[];for(const n in t){let s,r;if(n in d&&(s=Object.values(e.WsLogaccess.LogColumnType).includes(n)?n:d[n]),s){switch(s){case e.WsLogaccess.LogColumnType.workunits:case"hpcc.log.jobid":r=e.WsLogaccess.LogAccessType.ByJobID;break;case e.WsLogaccess.LogColumnType.audience:case"hpcc.log.audience":r=e.WsLogaccess.LogAccessType.ByTargetAudience;break;case e.WsLogaccess.LogColumnType.class:case"hpcc.log.class":r=e.WsLogaccess.LogAccessType.ByLogType;break;case e.WsLogaccess.LogColumnType.components:case"kubernetes.container.name":r=e.WsLogaccess.LogAccessType.ByComponent;break;default:r=e.WsLogaccess.LogAccessType.ByFieldName,s=d[n]}if(Array.isArray(t[n]))t[n].forEach(t=>{r===e.WsLogaccess.LogAccessType.ByComponent&&(t+="*"),m.push({LogCategory:r,SearchField:s,SearchByValue:t})});else{let i=t[n];r===e.WsLogaccess.LogAccessType.ByComponent&&(i+="*"),m.push({LogCategory:r,SearchField:s,SearchByValue:i})}}}if(m.length>2){let t=g.Filter.leftBinaryFilter.BinaryLogFilter[0];m.forEach((s,n)=>{let r=e.WsLogaccess.LogAccessFilterOperator.AND;n>0?(m[n-1].SearchField===s.SearchField&&(r=e.WsLogaccess.LogAccessFilterOperator.OR),n===m.length-1?(t.Operator=r,t.rightFilter=s):(t.Operator=r,t.rightBinaryFilter={BinaryLogFilter:[{leftFilter:s}]},t=t.rightBinaryFilter.BinaryLogFilter[0])):t.leftFilter=s})}else delete g.Filter.leftBinaryFilter,g.Filter.leftFilter={LogCategory:e.WsLogaccess.LogAccessType.All},(null==(s=m[0])?void 0:s.SearchField)&&(g.Filter.leftFilter={LogCategory:null==(r=m[0])?void 0:r.LogCategory,SearchField:null==(i=m[0])?void 0:i.SearchField,SearchByValue:null==(o=m[0])?void 0:o.SearchByValue}),(null==(c=m[1])?void 0:c.SearchField)&&(g.Filter.Operator=e.WsLogaccess.LogAccessFilterOperator.AND,m[0].SearchField===m[1].SearchField&&(g.Filter.Operator=e.WsLogaccess.LogAccessFilterOperator.OR),g.Filter.rightFilter={LogCategory:null==(u=m[1])?void 0:u.LogCategory,SearchField:null==(a=m[1])?void 0:a.SearchField,SearchByValue:null==(h=m[1])?void 0:h.SearchByValue});return t.StartDate&&(g.Range.StartDate=t.StartDate.toISOString()),t.EndDate&&(g.Range.EndDate=t.EndDate.toISOString()),this.GetLogs(g).then(e=>{var t;try{const s=JSON.parse(e.LogLines);let n=[];switch(l.RemoteLogManagerType){case"azureloganalyticscurl":case"elasticstack":case"grafanacurl":n=(null==(t=s.lines)?void 0:t.map(p))??[];break;default:Ze.warning(`Unknown RemoteLogManagerType: ${l.RemoteLogManagerType}`),n=[]}return{lines:n,total:e.TotalLogLinesAvailable??1e4}}catch(s){Ze.error(s.message??s)}return{lines:[],total:0}})}};n(tt,"LogaccessService");let st=tt;function nt(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function rt(e){return 1===e.length&&(e=it(e)),{left:n(function(t,s,n,r){for(null==n&&(n=0),null==r&&(r=t.length);n<r;){var i=n+r>>>1;e(t[i],s)<0?n=i+1:r=i}return n},"left"),right:n(function(t,s,n,r){for(null==n&&(n=0),null==r&&(r=t.length);n<r;){var i=n+r>>>1;e(t[i],s)>0?r=i:n=i+1}return n},"right")}}function it(e){return function(t,s){return nt(e(t),s)}}function ot(e){return null===e?NaN:+e}function ct(e,t){var s,n,r=e.length,i=-1;if(null==t){for(;++i<r;)if(null!=(s=e[i])&&s>=s)for(n=s;++i<r;)null!=(s=e[i])&&s>n&&(n=s)}else for(;++i<r;)if(null!=(s=t(e[i],i,e))&&s>=s)for(n=s;++i<r;)null!=(s=t(e[i],i,e))&&s>n&&(n=s);return n}function ut(e,t){var s,n=e.length,r=n,i=-1,o=0;if(null==t)for(;++i<n;)isNaN(s=ot(e[i]))?--r:o+=s;else for(;++i<n;)isNaN(s=ot(t(e[i],i,e)))?--r:o+=s;if(r)return o/r}n(nt,"ascending"),n(rt,"bisector"),n(it,"ascendingComparator"),rt(nt),n(ot,"number"),n(ct,"d3Max"),n(ut,"d3Mean");const at=class _MachineServiceBase extends L{constructor(e){super(e,"ws_machine","1.17")}GetComponentStatus(e){return this._connection.send("GetComponentStatus",e)}GetComponentUsage(e){return this._connection.send("GetComponentUsage",e)}GetMachineInfo(e){return this._connection.send("GetMachineInfo",e)}GetMachineInfoEx(e){return this._connection.send("GetMachineInfoEx",e)}GetMetrics(e){return this._connection.send("GetMetrics",e)}GetNodeGroupUsage(e){return this._connection.send("GetNodeGroupUsage",e)}GetTargetClusterInfo(e){return this._connection.send("GetTargetClusterInfo",e)}GetTargetClusterUsage(e){return this._connection.send("GetTargetClusterUsage",e)}Ping(e){return this._connection.send("Ping",e)}UpdateComponentStatus(e){return this._connection.send("UpdateComponentStatus",e)}};n(at,"MachineServiceBase");let ht=at;const lt=class _MachineService extends ht{GetTargetClusterUsageEx(e,s=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:s}).then(e=>t.exists("TargetClusterUsages.TargetClusterUsage",e)?e.TargetClusterUsages.TargetClusterUsage:[]).then(e=>e.filter(e=>!!e.ComponentUsages).map(e=>{const t=e.ComponentUsages.ComponentUsage.map(e=>{const t=(e.MachineUsages&&e.MachineUsages.MachineUsage?e.MachineUsages.MachineUsage:[]).map(e=>{const t=e.DiskUsages&&e.DiskUsages.DiskUsage?e.DiskUsages.DiskUsage.map(e=>({...e,InUse:1024*e.InUse,Total:1024*(e.InUse+e.Available),PercentUsed:100-e.PercentAvailable})):[];return{Name:e.Name,NetAddress:e.NetAddress,Description:e.Description,DiskUsages:t,mean:ut(t.filter(e=>!isNaN(e.PercentUsed)),e=>e.PercentUsed),max:ct(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:ut(t.filter(e=>!isNaN(e.mean)),e=>e.mean),max:ct(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:ut(t.filter(e=>!isNaN(e.mean)),e=>e.mean),max:ct(t.filter(e=>!isNaN(e.max)),e=>e.max)}}))}};n(lt,"MachineService");let dt=lt;const pt=class _PackageProcessServiceBase extends L{constructor(e){super(e,"WsPackageProcess","1.04")}ActivatePackage(e){return this._connection.send("ActivatePackage",e)}AddPackage(e){return this._connection.send("AddPackage",e)}AddPartToPackageMap(e){return this._connection.send("AddPartToPackageMap",e)}CopyPackageMap(e){return this._connection.send("CopyPackageMap",e)}DeActivatePackage(e){return this._connection.send("DeActivatePackage",e)}DeletePackage(e){return this._connection.send("DeletePackage",e)}Echo(e){return this._connection.send("Echo",e)}GetPackage(e){return this._connection.send("GetPackage",e)}GetPackageMapById(e){return this._connection.send("GetPackageMapById",e)}GetPackageMapSelectOptions(e){return this._connection.send("GetPackageMapSelectOptions",e)}GetPartFromPackageMap(e){return this._connection.send("GetPartFromPackageMap",e)}GetQueryFileMapping(e){return this._connection.send("GetQueryFileMapping",e)}ListPackage(e){return this._connection.send("ListPackage",e)}ListPackages(e){return this._connection.send("ListPackages",e)}Ping(e){return this._connection.send("Ping",e)}RemovePartFromPackageMap(e){return this._connection.send("RemovePartFromPackageMap",e)}ValidatePackage(e){return this._connection.send("ValidatePackage",e)}};n(pt,"PackageProcessServiceBase");let gt=pt;const mt=class _PackageProcessService extends gt{};n(mt,"PackageProcessService");let St=mt;const ft=class _ResourcesServiceBase extends L{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)}};n(ft,"ResourcesServiceBase");let _t=ft;const Ut=class _ResourcesService extends _t{};n(Ut,"ResourcesService");let vt=Ut;var yt,Ct;e.WsSasha=void 0,yt=e.WsSasha||(e.WsSasha={}),(Ct=yt.WUTypes||(yt.WUTypes={})).ECL="ECL",Ct.DFU="DFU";const Dt=class _SashaServiceBase extends L{constructor(e){super(e,"WSSasha","1.01")}ArchiveWU(e){return this._connection.send("ArchiveWU",e,"json",!1,void 0,"ResultResponse")}GetVersion(e){return this._connection.send("GetVersion",e,"json",!1,void 0,"ResultResponse")}ListWU(e){return this._connection.send("ListWU",e,"json",!1,void 0,"ResultResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WSSashaPingResponse")}RestoreWU(e){return this._connection.send("RestoreWU",e,"json",!1,void 0,"ResultResponse")}};n(Dt,"SashaServiceBase");let Rt=Dt;const Wt=class _SashaService extends Rt{};n(Wt,"SashaService");let bt=Wt;var Ft,Tt,At;e.WsSMC=void 0,Ft=e.WsSMC||(e.WsSMC={}),(Tt=Ft.LockModes||(Ft.LockModes={})).ALL="ALL",Tt.READ="READ",Tt.WRITE="WRITE",Tt.HOLD="HOLD",Tt.SUB="SUB",(At=Ft.RoxieControlCmdType||(Ft.RoxieControlCmdType={})).Attach="Attach",At.Detach="Detach",At.State="State",At.Reload="Reload",At.ReloadRetry="ReloadRetry",At.MemLock="MemLock",At.MemUnlock="MemUnlock",At.GetMemLocked="GetMemLocked";const wt=class _SMCServiceBase extends L{constructor(e){super(e,"WsSMC","1.27")}Activity(e){return this._connection.send("Activity",e,"json",!1,void 0,"ActivityResponse")}BrowseResources(e){return this._connection.send("BrowseResources",e,"json",!1,void 0,"BrowseResourcesResponse")}ClearQueue(e){return this._connection.send("ClearQueue",e,"json",!1,void 0,"SMCQueueResponse")}GetBuildInfo(e){return this._connection.send("GetBuildInfo",e,"json",!1,void 0,"GetBuildInfoResponse")}GetStatusServerInfo(e){return this._connection.send("GetStatusServerInfo",e,"json",!1,void 0,"GetStatusServerInfoResponse")}GetThorQueueAvailability(e){return this._connection.send("GetThorQueueAvailability",e,"json",!1,void 0,"GetThorQueueAvailabilityResponse")}Index(e){return this._connection.send("Index",e,"json",!1,void 0,"SMCIndexResponse")}LockQuery(e){return this._connection.send("LockQuery",e,"json",!1,void 0,"LockQueryResponse")}MoveJobBack(e){return this._connection.send("MoveJobBack",e,"json",!1,void 0,"SMCJobResponse")}MoveJobDown(e){return this._connection.send("MoveJobDown",e,"json",!1,void 0,"SMCJobResponse")}MoveJobFront(e){return this._connection.send("MoveJobFront",e,"json",!1,void 0,"SMCJobResponse")}MoveJobUp(e){return this._connection.send("MoveJobUp",e,"json",!1,void 0,"SMCJobResponse")}NotInCommunityEdition(e){return this._connection.send("NotInCommunityEdition",e,"json",!1,void 0,"NotInCommunityEditionResponse")}PauseQueue(e){return this._connection.send("PauseQueue",e,"json",!1,void 0,"SMCQueueResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsSMCPingResponse")}RemoveJob(e){return this._connection.send("RemoveJob",e,"json",!1,void 0,"SMCJobResponse")}ResumeQueue(e){return this._connection.send("ResumeQueue",e,"json",!1,void 0,"SMCQueueResponse")}RoxieControlCmd(e){return this._connection.send("RoxieControlCmd",e,"json",!1,void 0,"RoxieControlCmdResponse")}RoxieXrefCmd(e){return this._connection.send("RoxieXrefCmd",e,"json",!1,void 0,"RoxieXrefCmdResponse")}SetBanner(e){return this._connection.send("SetBanner",e,"json",!1,void 0,"SetBannerResponse")}SetJobPriority(e){return this._connection.send("SetJobPriority",e,"json",!1,void 0,"SMCPriorityResponse")}StopQueue(e){return this._connection.send("StopQueue",e,"json",!1,void 0,"SMCQueueResponse")}};n(wt,"SMCServiceBase");let xt=wt;const Lt=class _SMCService extends xt{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(e=>({Running:{ActiveWorkunit:[]},...e}))}};n(Lt,"SMCService");let Pt=Lt;const Mt=class _StoreService extends L{constructor(e){super(e,"WsStore","1")}CreateStore(e){return this._connection.send("Fetch",e)}Delete(e){return this._connection.send("Delete",e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>-1===e.Code))return{Exceptions:void 0,Success:!0};throw e})}DeleteNamespace(e){return this._connection.send("DeleteNamespace",e)}Fetch(e){return this._connection.send("Fetch",e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>-1===e.Code))return{Exceptions:void 0,Value:void 0};throw e})}FetchAll(e){return this._connection.send("FetchAll",e)}FetchKeyMD(e){return this._connection.send("FetchKeyMD",e)}ListKeys(e){return this._connection.send("ListKeys",e)}ListNamespaces(e){return this._connection.send("ListNamespaces",e)}Set(e){return this._connection.send("Set",e)}};n(Mt,"StoreService");let Et=Mt;var It,Nt;e.WsTopology=void 0,It=e.WsTopology||(e.WsTopology={}),(Nt=It.RoxieQueueFilter||(It.RoxieQueueFilter={})).All="All",Nt.QueriesOnly="QueriesOnly",Nt.WorkunitsOnly="WorkunitsOnly";const kt=class _TopologyServiceBase extends L{constructor(e){super(e,"WsTopology","1.32")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsTopologyPingResponse")}SystemLog(e){return this._connection.send("SystemLog",e,"json",!1,void 0,"SystemLogResponse")}TpClusterInfo(e){return this._connection.send("TpClusterInfo",e,"json",!1,void 0,"TpClusterInfoResponse")}TpClusterQuery(e){return this._connection.send("TpClusterQuery",e,"json",!1,void 0,"TpClusterQueryResponse")}TpDropZoneQuery(e){return this._connection.send("TpDropZoneQuery",e,"json",!1,void 0,"TpDropZoneQueryResponse")}TpGetComponentFile(e){return this._connection.send("TpGetComponentFile",e,"json",!1,void 0,"TpGetComponentFileResponse")}TpGetServicePlugins(e){return this._connection.send("TpGetServicePlugins",e,"json",!1,void 0,"TpGetServicePluginsResponse")}TpGroupQuery(e){return this._connection.send("TpGroupQuery",e,"json",!1,void 0,"TpGroupQueryResponse")}TpListLogFiles(e){return this._connection.send("TpListLogFiles",e,"json",!1,void 0,"TpListLogFilesResponse")}TpListTargetClusters(e){return this._connection.send("TpListTargetClusters",e,"json",!1,void 0,"TpListTargetClustersResponse")}TpLogFile(e){return this._connection.send("TpLogFile",e,"json",!1,void 0,"TpLogFileResponse")}TpLogFileDisplay(e){return this._connection.send("TpLogFileDisplay",e,"json",!1,void 0,"TpLogFileResponse")}TpLogicalClusterQuery(e){return this._connection.send("TpLogicalClusterQuery",e,"json",!1,void 0,"TpLogicalClusterQueryResponse")}TpMachineInfo(e){return this._connection.send("TpMachineInfo",e,"json",!1,void 0,"TpMachineInfoResponse")}TpMachineQuery(e){return this._connection.send("TpMachineQuery",e,"json",!1,void 0,"TpMachineQueryResponse")}TpServiceQuery(e){return this._connection.send("TpServiceQuery",e,"json",!1,void 0,"TpServiceQueryResponse")}TpSetMachineStatus(e){return this._connection.send("TpSetMachineStatus",e,"json",!1,void 0,"TpSetMachineStatusResponse")}TpSwapNode(e){return this._connection.send("TpSwapNode",e,"json",!1,void 0,"TpSwapNodeResponse")}TpTargetClusterQuery(e){return this._connection.send("TpTargetClusterQuery",e,"json",!1,void 0,"TpTargetClusterQueryResponse")}TpThorStatus(e){return this._connection.send("TpThorStatus",e,"json",!1,void 0,"TpThorStatusResponse")}TpXMLFile(e){return this._connection.send("TpXMLFile",e,"json",!1,void 0,"TpXMLFileResponse")}};n(kt,"TopologyServiceBase");let jt=kt;const Gt=class _TopologyService extends jt{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,s;return e.TpLogicalClusters.TpLogicalCluster.some((e,n)=>(0===n&&(s=e),"hthor"===e.Type&&(t=e,!0))),t||s})}};n(Gt,"TopologyService");let Vt=Gt;var Qt,Bt,Ot,Xt,$t,Jt,Ht,qt,zt,Yt,Zt,Kt,es,ts;e.WsWorkunits=void 0,Qt=e.WsWorkunits||(e.WsWorkunits={}),(Bt=Qt.ECLWUActions||(Qt.ECLWUActions={})).Abort="Abort",Bt.Delete="Delete",Bt.Deschedule="Deschedule",Bt.Reschedule="Reschedule",Bt.Pause="Pause",Bt.PauseNow="PauseNow",Bt.Protect="Protect",Bt.Unprotect="Unprotect",Bt.Restore="Restore",Bt.Resume="Resume",Bt.SetToFailed="SetToFailed",Bt.Archive="Archive",(e=>{e[e.MIN=0]="MIN",e[e.DEFAULT=1]="DEFAULT",e[e.ALL=2]="ALL",e[e.CUSTOM=3]="CUSTOM"})(Qt.LogSelectColumnMode||(Qt.LogSelectColumnMode={})),(e=>{e[e.ASC=0]="ASC",e[e.DSC=1]="DSC"})(Qt.SortDirection||(Qt.SortDirection={})),(Ot=Qt.LogEventClass||(Qt.LogEventClass={})).ALL="ALL",Ot.DIS="DIS",Ot.ERR="ERR",Ot.WRN="WRN",Ot.INF="INF",Ot.PRO="PRO",Ot.MET="MET",Ot.EVT="EVT",(Xt=Qt.WUDetailsAttrValueType||(Qt.WUDetailsAttrValueType={})).Single="Single",Xt.List="List",Xt.Multi="Multi",($t=Qt.EclDefinitionActions||(Qt.EclDefinitionActions={})).SyntaxCheck="SyntaxCheck",$t.Deploy="Deploy",$t.Publish="Publish",(Jt=Qt.ErrorMessageFormat||(Qt.ErrorMessageFormat={})).xml="xml",Jt.json="json",Jt.text="text",(Ht=Qt.LogAccessLogFormat||(Qt.LogAccessLogFormat={}))[Ht.XML=0]="XML",Ht[Ht.JSON=1]="JSON",Ht[Ht.CSV=2]="CSV",(qt=Qt.WUExceptionSeverity||(Qt.WUExceptionSeverity={})).info="info",qt.warning="warning",qt.error="error",qt.alert="alert",(zt=Qt.WUQueryFilterSuspendedType||(Qt.WUQueryFilterSuspendedType={})).Allqueries="All queries",zt.Notsuspended="Not suspended",zt.Suspended="Suspended",zt.Suspendedbyuser="Suspended by user",zt.Suspendedbyfirstnode="Suspended by first node",zt.Suspendedbyanynode="Suspended by any node",(Yt=Qt.WUQuerySetFilterType||(Qt.WUQuerySetFilterType={})).All="All",Yt.Id="Id",Yt.Name="Name",Yt.Alias="Alias",Yt.Status="Status",(Zt=Qt.WUProtectFilter||(Qt.WUProtectFilter={})).All="All",Zt.Protected="Protected",Zt.NotProtected="NotProtected",(Qt.QuerySetAliasActionTypes||(Qt.QuerySetAliasActionTypes={})).Deactivate="Deactivate",(Kt=Qt.QuerysetImportActivation||(Qt.QuerysetImportActivation={})).None="None",Kt.ActivateImportedActive="ActivateImportedActive",(es=Qt.QuerySetQueryActionTypes||(Qt.QuerySetQueryActionTypes={})).Suspend="Suspend",es.Unsuspend="Unsuspend",es.ToggleSuspend="ToggleSuspend",es.Activate="Activate",es.Delete="Delete",es.DeleteQueriesAndWUs="DeleteQueriesAndWUs",es.RemoveAllAliases="RemoveAllAliases",es.ResetQueryStats="ResetQueryStats",(ts=Qt.WUQueryActivationMode||(Qt.WUQueryActivationMode={}))[ts.DoNotActivateQuery=0]="DoNotActivateQuery",ts[ts.ActivateQuery=1]="ActivateQuery",ts[ts.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",ts[ts.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious";const ss=class _WorkunitsServiceBase extends L{constructor(e){super(e,"WsWorkunits","2.02")}GVCAjaxGraph(e){return this._connection.send("GVCAjaxGraph",e,"json",!1,void 0,"GVCAjaxGraphResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsWorkunitsPingResponse")}WUAbort(e){return this._connection.send("WUAbort",e,"json",!1,void 0,"WUAbortResponse")}WUAction(e){return this._connection.send("WUAction",e,"json",!1,void 0,"WUActionResponse")}WUAddLocalFileToWorkunit(e){return this._connection.send("WUAddLocalFileToWorkunit",e,"json",!1,void 0,"WUAddLocalFileToWorkunitResponse")}WUAnalyseHotspot(e){return this._connection.send("WUAnalyseHotspot",e,"json",!1,void 0,"WUAnalyseHotspotResponse")}WUCDebug(e){return this._connection.send("WUCDebug",e,"json",!1,void 0,"WUDebugResponse")}WUCheckFeatures(e){return this._connection.send("WUCheckFeatures",e,"json",!1,void 0,"WUCheckFeaturesResponse")}WUClusterJobQueueLOG(e){return this._connection.send("WUClusterJobQueueLOG",e,"json",!1,void 0,"WUClusterJobQueueLOGResponse")}WUClusterJobQueueXLS(e){return this._connection.send("WUClusterJobQueueXLS",e,"json",!1,void 0,"WUClusterJobQueueXLSResponse")}WUClusterJobSummaryXLS(e){return this._connection.send("WUClusterJobSummaryXLS",e,"json",!1,void 0,"WUClusterJobSummaryXLSResponse")}WUClusterJobXLS(e){return this._connection.send("WUClusterJobXLS",e,"json",!1,void 0,"WUClusterJobXLSResponse")}WUCompileECL(e){return this._connection.send("WUCompileECL",e,"json",!1,void 0,"WUCompileECLResponse")}WUCopyLogicalFiles(e){return this._connection.send("WUCopyLogicalFiles",e,"json",!1,void 0,"WUCopyLogicalFilesResponse")}WUCopyQuerySet(e){return this._connection.send("WUCopyQuerySet",e,"json",!1,void 0,"WUCopyQuerySetResponse")}WUCreate(e){return this._connection.send("WUCreate",e,"json",!1,void 0,"WUCreateResponse")}WUCreateAndUpdate(e){return this._connection.send("WUCreateAndUpdate",e,"json",!1,void 0,"WUUpdateResponse")}WUCreateZAPInfo(e){return this._connection.send("WUCreateZAPInfo",e,"json",!1,void 0,"WUCreateZAPInfoResponse")}WUDelete(e){return this._connection.send("WUDelete",e,"json",!1,void 0,"WUDeleteResponse")}WUDeployWorkunit(e){return this._connection.send("WUDeployWorkunit",e,"json",!1,void 0,"WUDeployWorkunitResponse")}WUDetails(e){return this._connection.send("WUDetails",e,"json",!1,void 0,"WUDetailsResponse")}WUDetailsMeta(e){return this._connection.send("WUDetailsMeta",e,"json",!1,void 0,"WUDetailsMetaResponse")}WUEclDefinitionAction(e){return this._connection.send("WUEclDefinitionAction",e,"json",!1,void 0,"WUEclDefinitionActionResponse")}WUExport(e){return this._connection.send("WUExport",e,"json",!1,void 0,"WUExportResponse")}WUFile(e){return this._connection.send("WUFile",e,"json",!1,void 0,"WULogFileResponse")}WUFullResult(e){return this._connection.send("WUFullResult",e,"json",!1,void 0,"WUFullResultResponse")}WUGVCGraphInfo(e){return this._connection.send("WUGVCGraphInfo",e,"json",!1,void 0,"WUGVCGraphInfoResponse")}WUGetArchiveFile(e){return this._connection.send("WUGetArchiveFile",e,"json",!1,void 0,"WUGetArchiveFileResponse")}WUGetDependancyTrees(e){return this._connection.send("WUGetDependancyTrees",e,"json",!1,void 0,"WUGetDependancyTreesResponse")}WUGetGraph(e){return this._connection.send("WUGetGraph",e,"json",!1,void 0,"WUGetGraphResponse")}WUGetGraphNameAndTypes(e){return this._connection.send("WUGetGraphNameAndTypes",e,"json",!1,void 0,"WUGetGraphNameAndTypesResponse")}WUGetNumFileToCopy(e){return this._connection.send("WUGetNumFileToCopy",e,"json",!1,void 0,"WUGetNumFileToCopyResponse")}WUGetPlugins(e){return this._connection.send("WUGetPlugins",e,"json",!1,void 0,"WUGetPluginsResponse")}WUGetStats(e){return this._connection.send("WUGetStats",e,"json",!1,void 0,"WUGetStatsResponse")}WUGetThorJobList(e){return this._connection.send("WUGetThorJobList",e,"json",!1,void 0,"WUGetThorJobListResponse")}WUGetThorJobQueue(e){return this._connection.send("WUGetThorJobQueue",e,"json",!1,void 0,"WUGetThorJobQueueResponse")}WUGetZAPInfo(e){return this._connection.send("WUGetZAPInfo",e,"json",!1,void 0,"WUGetZAPInfoResponse")}WUGraphInfo(e){return this._connection.send("WUGraphInfo",e,"json",!1,void 0,"WUGraphInfoResponse")}WUGraphTiming(e){return this._connection.send("WUGraphTiming",e,"json",!1,void 0,"WUGraphTimingResponse")}WUInfo(e){return this._connection.send("WUInfo",e,"json",!1,void 0,"WUInfoResponse")}WUInfoDetails(e){return this._connection.send("WUInfoDetails",e,"json",!1,void 0,"WUInfoResponse")}WUJobList(e){return this._connection.send("WUJobList",e,"json",!1,void 0,"WUJobListResponse")}WULightWeightQuery(e){return this._connection.send("WULightWeightQuery",e,"json",!1,void 0,"WULightWeightQueryResponse")}WUListArchiveFiles(e){return this._connection.send("WUListArchiveFiles",e,"json",!1,void 0,"WUListArchiveFilesResponse")}WUListLocalFileRequired(e){return this._connection.send("WUListLocalFileRequired",e,"json",!1,void 0,"WUListLocalFileRequiredResponse")}WUListQueries(e){return this._connection.send("WUListQueries",e,"json",!1,void 0,"WUListQueriesResponse")}WUListQueriesUsingFile(e){return this._connection.send("WUListQueriesUsingFile",e,"json",!1,void 0,"WUListQueriesUsingFileResponse")}WUMultiQuerysetDetails(e){return this._connection.send("WUMultiQuerysetDetails",e,"json",!1,void 0,"WUMultiQuerySetDetailsResponse")}WUProcessGraph(e){return this._connection.send("WUProcessGraph",e,"json",!1,void 0,"WUProcessGraphResponse")}WUProtect(e){return this._connection.send("WUProtect",e,"json",!1,void 0,"WUProtectResponse")}WUPublishWorkunit(e){return this._connection.send("WUPublishWorkunit",e,"json",!1,void 0,"WUPublishWorkunitResponse")}WUPushEvent(e){return this._connection.send("WUPushEvent",e,"json",!1,void 0,"WUPushEventResponse")}WUQuery(e){return this._connection.send("WUQuery",e,"json",!1,void 0,"WUQueryResponse")}WUQueryConfig(e){return this._connection.send("WUQueryConfig",e,"json",!1,void 0,"WUQueryConfigResponse")}WUQueryDetails(e){return this._connection.send("WUQueryDetails",e,"json",!1,void 0,"WUQueryDetailsResponse")}WUQueryDetailsLightWeight(e){return this._connection.send("WUQueryDetailsLightWeight",e,"json",!1,void 0,"WUQueryDetailsResponse")}WUQueryFiles(e){return this._connection.send("WUQueryFiles",e,"json",!1,void 0,"WUQueryFilesResponse")}WUQueryGetGraph(e){return this._connection.send("WUQueryGetGraph",e,"json",!1,void 0,"WUQueryGetGraphResponse")}WUQueryGetSummaryStats(e){return this._connection.send("WUQueryGetSummaryStats",e,"json",!1,void 0,"WUQueryGetSummaryStatsResponse")}WUQuerysetAliasAction(e){return this._connection.send("WUQuerysetAliasAction",e,"json",!1,void 0,"WUQuerySetAliasActionResponse")}WUQuerysetCopyQuery(e){return this._connection.send("WUQuerysetCopyQuery",e,"json",!1,void 0,"WUQuerySetCopyQueryResponse")}WUQuerysetDetails(e){return this._connection.send("WUQuerysetDetails",e,"json",!1,void 0,"WUQuerySetDetailsResponse")}WUQuerysetExport(e){return this._connection.send("WUQuerysetExport",e,"json",!1,void 0,"WUQuerysetExportResponse")}WUQuerysetImport(e){return this._connection.send("WUQuerysetImport",e,"json",!1,void 0,"WUQuerysetImportResponse")}WUQuerysetQueryAction(e){return this._connection.send("WUQuerysetQueryAction",e,"json",!1,void 0,"WUQuerySetQueryActionResponse")}WUQuerysets(e){return this._connection.send("WUQuerysets",e,"json",!1,void 0,"WUQuerysetsResponse")}WURecreateQuery(e){return this._connection.send("WURecreateQuery",e,"json",!1,void 0,"WURecreateQueryResponse")}WUResubmit(e){return this._connection.send("WUResubmit",e,"json",!1,void 0,"WUResubmitResponse")}WUResult(e){return this._connection.send("WUResult",e,"json",!1,void 0,"WUResultResponse")}WUResultBin(e){return this._connection.send("WUResultBin",e,"json",!1,void 0,"WUResultBinResponse")}WUResultSummary(e){return this._connection.send("WUResultSummary",e,"json",!1,void 0,"WUResultSummaryResponse")}WUResultView(e){return this._connection.send("WUResultView",e,"json",!1,void 0,"WUResultViewResponse")}WURun(e){return this._connection.send("WURun",e,"json",!1,void 0,"WURunResponse")}WUSchedule(e){return this._connection.send("WUSchedule",e,"json",!1,void 0,"WUScheduleResponse")}WUShowScheduled(e){return this._connection.send("WUShowScheduled",e,"json",!1,void 0,"WUShowScheduledResponse")}WUSubmit(e){return this._connection.send("WUSubmit",e,"json",!1,void 0,"WUSubmitResponse")}WUSyntaxCheckECL(e){return this._connection.send("WUSyntaxCheckECL",e,"json",!1,void 0,"WUSyntaxCheckResponse")}WUUpdate(e){return this._connection.send("WUUpdate",e,"json",!1,void 0,"WUUpdateResponse")}WUUpdateQueryEntry(e){return this._connection.send("WUUpdateQueryEntry",e,"json",!1,void 0,"WUUpdateQueryEntryResponse")}WUWaitCompiled(e){return this._connection.send("WUWaitCompiled",e,"json",!1,void 0,"WUWaitResponse")}WUWaitComplete(e){return this._connection.send("WUWaitComplete",e,"json",!1,void 0,"WUWaitResponse")}};n(ss,"WorkunitsServiceBase");let ns=ss;var rs,is,os=(e=>(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))(os||{});function cs(e){return"string"==typeof e.Name}function us(e){return void 0!==e.TotalClusterTime}function as(e){return void 0!==e.StateEx}e.WUUpdate=void 0,rs=e.WUUpdate||(e.WUUpdate={}),(is=rs.Action||(rs.Action={}))[is.Unknown=0]="Unknown",is[is.Compile=1]="Compile",is[is.Check=2]="Check",is[is.Run=3]="Run",is[is.ExecuteExisting=4]="ExecuteExisting",is[is.Pause=5]="Pause",is[is.PauseNow=6]="PauseNow",is[is.Resume=7]="Resume",is[is.Debug=8]="Debug",is[is.__size=9]="__size",n(cs,"isECLResult"),n(us,"isWUQueryECLWorkunit"),n(as,"isWUInfoWorkunit");const hs=class _WorkunitsService extends ns{constructor(e){super(e),r(this,"_WUDetailsMetaPromise")}Ping(){return this._connection.send("Ping",{},"json",!1,void 0,"WsWorkunitsPingResponse").then(()=>({result:!0}))}WUQuery(e={},s){return this._connection.send("WUQuery",e,"json",!1,s).then(e=>t.deepMixin({Workunits:{ECLWorkunit:[]}},e))}WUInfo(e){const 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")}WUDetailsMeta(e){return this._WUDetailsMetaPromise||(this._WUDetailsMetaPromise=super.WUDetailsMeta(e)),this._WUDetailsMetaPromise}WUCDebugEx(e){return this._connection.send("WUCDebug",e,void 0,void 0,void 0,"WUDebug").then(e=>{const s=t.xml2json(e.Result).children();return s.length?s[0]:null})}};n(hs,"WorkunitsService");let ls=hs;const ds=class _WorkunitsServiceEx extends ns{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};n(ds,"WorkunitsServiceEx");let ps=ds;function gs(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ms(e,t){if((s=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var s,n=e.slice(0,s);return[n.length>1?n[0]+n.slice(2):n,+e.slice(s+1)]}function Ss(e){return(e=ms(Math.abs(e)))?e[1]:NaN}function fs(e,t){return function(s,n){for(var r=s.length,i=[],o=0,c=e[0],u=0;r>0&&c>0&&(u+c+1>n&&(c=Math.max(1,n-u)),i.push(s.substring(r-=c,r+c)),!((u+=c+1)>n));)c=e[o=(o+1)%e.length];return i.reverse().join(t)}}function _s(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}n(gs,"formatDecimal"),n(ms,"formatDecimalParts"),n(Ss,"exponent"),n(fs,"formatGroup"),n(_s,"formatNumerals");var Us,vs=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ys(e){if(!(t=vs.exec(e)))throw new Error("invalid format: "+e);var t;return new Cs({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]})}function Cs(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function Ds(e){e:for(var t,s=e.length,n=1,r=-1;n<s;++n)switch(e[n]){case".":r=t=n;break;case"0":0===r&&(r=n),t=n;break;default:if(!+e[n])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}function Rs(e,t){var s=ms(e,t);if(!s)return e+"";var n=s[0],r=s[1],i=r-(Us=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+ms(e,Math.max(0,t+i-1))[0]}function Ws(e,t){var s=ms(e,t);if(!s)return e+"";var n=s[0],r=s[1];return r<0?"0."+new Array(-r).join("0")+n:n.length>r+1?n.slice(0,r+1)+"."+n.slice(r+1):n+new Array(r-n.length+2).join("0")}n(ys,"formatSpecifier"),ys.prototype=Cs.prototype,n(Cs,"FormatSpecifier"),Cs.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type},n(Ds,"formatTrim"),n(Rs,"formatPrefixAuto"),n(Ws,"formatRounded");const bs={"%":n(function(e,t){return(100*e).toFixed(t)},"%"),b:n(function(e){return Math.round(e).toString(2)},"b"),c:n(function(e){return e+""},"c"),d:gs,e:n(function(e,t){return e.toExponential(t)},"e"),f:n(function(e,t){return e.toFixed(t)},"f"),g:n(function(e,t){return e.toPrecision(t)},"g"),o:n(function(e){return Math.round(e).toString(8)},"o"),p:n(function(e,t){return Ws(100*e,t)},"p"),r:Ws,s:Rs,X:n(function(e){return Math.round(e).toString(16).toUpperCase()},"X"),x:n(function(e){return Math.round(e).toString(16)},"x")};function Fs(e){return e}n(Fs,"identity");var Ts,As,ws=Array.prototype.map,xs=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ls(e){var t=void 0===e.grouping||void 0===e.thousands?Fs:fs(ws.call(e.grouping,Number),e.thousands+""),s=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",i=e.decimal+"",o=void 0===e.numerals?Fs:_s(ws.call(e.numerals,String)),c=void 0===e.percent?"%":e.percent+"",u=e.minus+"",a=void 0===e.nan?"NaN":e.nan+"";function h(e){var h=(e=ys(e)).fill,l=e.align,d=e.sign,p=e.symbol,g=e.zero,m=e.width,S=e.comma,f=e.precision,_=e.trim,U=e.type;"n"===U?(S=!0,U="g"):bs[U]||(void 0===f&&(f=12),_=!0,U="g"),(g||"0"===h&&"="===l)&&(g=!0,h="0",l="=");var v="$"===p?s:"#"===p&&/[boxX]/.test(U)?"0"+U.toLowerCase():"",y="$"===p?r:/[%p]/.test(U)?c:"",C=bs[U],D=/[defgprs%]/.test(U);function R(e){var s,n,r,c=v,p=y;if("c"===U)p=C(e)+p,e="";else{var R=(e=+e)<0||1/e<0;if(e=isNaN(e)?a:C(Math.abs(e),f),_&&(e=Ds(e)),R&&0===+e&&"+"!==d&&(R=!1),c=(R?"("===d?d:u:"-"===d||"("===d?"":d)+c,p=("s"===U?xs[8+Us/3]:"")+p+(R&&"("===d?")":""),D)for(s=-1,n=e.length;++s<n;)if(48>(r=e.charCodeAt(s))||r>57){p=(46===r?i+e.slice(s+1):e.slice(s))+p,e=e.slice(0,s);break}}S&&!g&&(e=t(e,1/0));var W=c.length+e.length+p.length,b=W<m?new Array(m-W+1).join(h):"";switch(S&&g&&(e=t(b+e,b.length?m-p.length:1/0),b=""),l){case"<":e=c+e+p+b;break;case"=":e=c+b+e+p;break;case"^":e=b.slice(0,W=b.length>>1)+c+e+p+b.slice(W);break;default:e=b+c+e+p}return o(e)}return f=void 0===f?6:/[gprs]/.test(U)?Math.max(1,Math.min(21,f)):Math.max(0,Math.min(20,f)),n(R,"format"),R.toString=function(){return e+""},R}function l(e,t){var s=h(((e=ys(e)).type="f",e)),n=3*Math.max(-8,Math.min(8,Math.floor(Ss(t)/3))),r=Math.pow(10,-n),i=xs[8+n/3];return function(e){return s(r*e)+i}}return n(h,"newFormat"),n(l,"formatPrefix"),{format:h,formatPrefix:l}}function Ps(e){return Ts=Ls(e),As=Ts.format,Ts.formatPrefix,Ts}n(Ls,"formatLocale$1"),Ps({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),n(Ps,"defaultLocale$1");var Ms=new Date,Es=new Date;function Is(e,t,s,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return n(i,"interval"),i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(s){return e(s=new Date(s-1)),t(s,1),e(s),s},i.round=function(e){var t=i(e),s=i.ceil(e);return e-t<s-e?t:s},i.offset=function(e,s){return t(e=new Date(+e),null==s?1:Math.floor(s)),e},i.range=function(s,n,r){var o,c=[];if(s=i.ceil(s),r=null==r?1:Math.floor(r),!(s<n&&r>0))return c;do{c.push(o=new Date(+s)),t(s,r),e(s)}while(o<s&&s<n);return c},i.filter=function(s){return Is(function(t){if(t>=t)for(;e(t),!s(t);)t.setTime(t-1)},function(e,n){if(e>=e)if(n<0)for(;++n<=0;)for(;t(e,-1),!s(e););else for(;--n>=0;)for(;t(e,1),!s(e););})},s&&(i.count=function(t,n){return Ms.setTime(+t),Es.setTime(+n),e(Ms),e(Es),Math.floor(s(Ms,Es))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e===0}:function(t){return i.count(0,t)%e===0}):i:null}),i}n(Is,"newInterval");var Ns=864e5,ks=6048e5,js=Is(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/Ns},function(e){return e.getDate()-1});function Gs(e){return Is(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+7*t)},function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/ks})}js.range,n(Gs,"weekday");var Vs=Gs(0),Qs=Gs(1),Bs=Gs(2),Os=Gs(3),Xs=Gs(4),$s=Gs(5),Js=Gs(6);Vs.range,Qs.range,Bs.range,Os.range,Xs.range,$s.range,Js.range;var Hs=Is(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()});Hs.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Is(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,s){t.setFullYear(t.getFullYear()+s*e)}):null},Hs.range;var qs=Is(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/Ns},function(e){return e.getUTCDate()-1});function zs(e){return Is(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+7*t)},function(e,t){return(t-e)/ks})}qs.range,n(zs,"utcWeekday");var Ys=zs(0),Zs=zs(1),Ks=zs(2),en=zs(3),tn=zs(4),sn=zs(5),nn=zs(6);Ys.range,Zs.range,Ks.range,en.range,tn.range,sn.range,nn.range;var rn=Is(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()});function on(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 cn(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 un(e,t,s){return{y:e,m:t,d:s,H:0,M:0,S:0,L:0}}function an(e){var t=e.dateTime,s=e.date,r=e.time,i=e.periods,o=e.days,c=e.shortDays,u=e.months,a=e.shortMonths,h=Un(i),l=vn(i),d=Un(o),p=vn(o),g=Un(c),m=vn(c),S=Un(u),f=vn(u),_=Un(a),U=vn(a),v={a:M,A:E,b:I,B:N,c:null,d:Vn,e:Vn,f:$n,g:nr,G:ir,H:Qn,I:Bn,j:On,L:Xn,m:Jn,M:Hn,p:k,q:j,Q:Tr,s:Ar,S:qn,u:zn,U:Yn,V:Kn,w:er,W:tr,x:null,X:null,y:sr,Y:rr,Z:or,"%":Fr},y={a:G,A:V,b:Q,B:B,c:null,d:cr,e:cr,f:dr,g:Dr,G:Wr,H:ur,I:ar,j:hr,L:lr,m:pr,M:gr,p:O,q:X,Q:Tr,s:Ar,S:mr,u:Sr,U:fr,V:Ur,w:vr,W:yr,x:null,X:null,y:Cr,Y:Rr,Z:br,"%":Fr},C={a:F,A:T,b:A,B:w,c:x,d:xn,e:xn,f:Nn,g:Fn,G:bn,H:Pn,I:Pn,j:Ln,L:In,m:wn,M:Mn,p:b,q:An,Q:jn,s:Gn,S:En,u:Cn,U:Dn,V:Rn,w:yn,W:Wn,x:L,X:P,y:Fn,Y:bn,Z:Tn,"%":kn};function D(e,t){return function(s){var n,r,i,o=[],c=-1,u=0,a=e.length;for(s instanceof Date||(s=new Date(+s));++c<a;)37===e.charCodeAt(c)&&(o.push(e.slice(u,c)),null!=(r=pn[n=e.charAt(++c)])?n=e.charAt(++c):r="e"===n?" ":"0",(i=t[n])&&(n=i(s,r)),o.push(n),u=c+1);return o.push(e.slice(u,c)),o.join("")}}function R(e,t){return function(s){var n,r,i=un(1900,void 0,1);if(W(i,e,s+="",0)!=s.length)return null;if("Q"in i)return new Date(i.Q);if("s"in i)return new Date(1e3*i.s+("L"in i?i.L:0));if(t&&!("Z"in i)&&(i.Z=0),"p"in i&&(i.H=i.H%12+12*i.p),void 0===i.m&&(i.m="q"in i?i.q:0),"V"in i){if(i.V<1||i.V>53)return null;"w"in i||(i.w=1),"Z"in i?(r=(n=cn(un(i.y,0,1))).getUTCDay(),n=r>4||0===r?Zs.ceil(n):Zs(n),n=qs.offset(n,7*(i.V-1)),i.y=n.getUTCFullYear(),i.m=n.getUTCMonth(),i.d=n.getUTCDate()+(i.w+6)%7):(r=(n=on(un(i.y,0,1))).getDay(),n=r>4||0===r?Qs.ceil(n):Qs(n),n=js.offset(n,7*(i.V-1)),i.y=n.getFullYear(),i.m=n.getMonth(),i.d=n.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),r="Z"in i?cn(un(i.y,0,1)).getUTCDay():on(un(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(r+5)%7:i.w+7*i.U-(r+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,cn(i)):on(i)}}function W(e,t,s,n){for(var r,i,o=0,c=t.length,u=s.length;o<c;){if(n>=u)return-1;if(37===(r=t.charCodeAt(o++))){if(r=t.charAt(o++),!(i=C[r in pn?t.charAt(o++):r])||(n=i(e,s,n))<0)return-1}else if(r!=s.charCodeAt(n++))return-1}return n}function b(e,t,s){var n=h.exec(t.slice(s));return n?(e.p=l[n[0].toLowerCase()],s+n[0].length):-1}function F(e,t,s){var n=g.exec(t.slice(s));return n?(e.w=m[n[0].toLowerCase()],s+n[0].length):-1}function T(e,t,s){var n=d.exec(t.slice(s));return n?(e.w=p[n[0].toLowerCase()],s+n[0].length):-1}function A(e,t,s){var n=_.exec(t.slice(s));return n?(e.m=U[n[0].toLowerCase()],s+n[0].length):-1}function w(e,t,s){var n=S.exec(t.slice(s));return n?(e.m=f[n[0].toLowerCase()],s+n[0].length):-1}function x(e,s,n){return W(e,t,s,n)}function L(e,t,n){return W(e,s,t,n)}function P(e,t,s){return W(e,r,t,s)}function M(e){return c[e.getDay()]}function E(e){return o[e.getDay()]}function I(e){return a[e.getMonth()]}function N(e){return u[e.getMonth()]}function k(e){return i[+(e.getHours()>=12)]}function j(e){return 1+~~(e.getMonth()/3)}function G(e){return c[e.getUTCDay()]}function V(e){return o[e.getUTCDay()]}function Q(e){return a[e.getUTCMonth()]}function B(e){return u[e.getUTCMonth()]}function O(e){return i[+(e.getUTCHours()>=12)]}function X(e){return 1+~~(e.getUTCMonth()/3)}return v.x=D(s,v),v.X=D(r,v),v.c=D(t,v),y.x=D(s,y),y.X=D(r,y),y.c=D(t,y),n(D,"newFormat"),n(R,"newParse"),n(W,"parseSpecifier"),n(b,"parsePeriod"),n(F,"parseShortWeekday"),n(T,"parseWeekday"),n(A,"parseShortMonth"),n(w,"parseMonth"),n(x,"parseLocaleDateTime"),n(L,"parseLocaleDate"),n(P,"parseLocaleTime"),n(M,"formatShortWeekday"),n(E,"formatWeekday"),n(I,"formatShortMonth"),n(N,"formatMonth"),n(k,"formatPeriod"),n(j,"formatQuarter"),n(G,"formatUTCShortWeekday"),n(V,"formatUTCWeekday"),n(Q,"formatUTCShortMonth"),n(B,"formatUTCMonth"),n(O,"formatUTCPeriod"),n(X,"formatUTCQuarter"),{format:n(function(e){var t=D(e+="",v);return t.toString=function(){return e},t},"format"),parse:n(function(e){var t=R(e+="",!1);return t.toString=function(){return e},t},"parse"),utcFormat:n(function(e){var t=D(e+="",y);return t.toString=function(){return e},t},"utcFormat"),utcParse:n(function(e){var t=R(e+="",!0);return t.toString=function(){return e},t},"utcParse")}}rn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Is(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,s){t.setUTCFullYear(t.getUTCFullYear()+s*e)}):null},rn.range,n(on,"localDate"),n(cn,"utcDate"),n(un,"newDate"),n(an,"formatLocale");var hn,ln,dn,pn={"-":"",_:" ",0:"0"},gn=/^\s*\d+/,mn=/^%/,Sn=/[\\^$*+?|[\]().{}]/g;function fn(e,t,s){var n=e<0?"-":"",r=(n?-e:e)+"",i=r.length;return n+(i<s?new Array(s-i+1).join(t)+r:r)}function _n(e){return e.replace(Sn,"\\$&")}function Un(e){return new RegExp("^(?:"+e.map(_n).join("|")+")","i")}function vn(e){for(var t={},s=-1,n=e.length;++s<n;)t[e[s].toLowerCase()]=s;return t}function yn(e,t,s){var n=gn.exec(t.slice(s,s+1));return n?(e.w=+n[0],s+n[0].length):-1}function Cn(e,t,s){var n=gn.exec(t.slice(s,s+1));return n?(e.u=+n[0],s+n[0].length):-1}function Dn(e,t,s){var n=gn.exec(t.slice(s,s+2));return n?(e.U=+n[0],s+n[0].length):-1}function Rn(e,t,s){var n=gn.exec(t.slice(s,s+2));return n?(e.V=+n[0],s+n[0].length):-1}function Wn(e,t,s){var n=gn.exec(t.slice(s,s+2));return n?(e.W=+n[0],s+n[0].length):-1}function bn(e,t,s){var n=gn.exec(t.slice(s,s+4));return n?(e.y=+n[0],s+n[0].length):-1}function Fn(e,t,s){var n=gn.exec(t.slice(s,s+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),s+n[0].length):-1}function Tn(e,t,s){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(s,s+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),s+n[0].length):-1}function An(e,t,s){var n=gn.exec(t.slice(s,s+1));return n?(e.q=3*n[0]-3,s+n[0].length):-1}function wn(e,t,s){var n=gn.exec(t.slice(s,s+2));return n?(e.m=n[0]-1,s+n[0].length):-1}function xn(e,t,s){var n=gn.exec(t.slice(s,s+2));return n?(e.d=+n[0],s+n[0].length):-1}function Ln(e,t,s){var n=gn.exec(t.slice(s,s+3));return n?(e.m=0,e.d=+n[0],s+n[0].length):-1}function Pn(e,t,s){var n=gn.exec(t.slice(s,s+2));return n?(e.H=+n[0],s+n[0].length):-1}function Mn(e,t,s){var n=gn.exec(t.slice(s,s+2));return n?(e.M=+n[0],s+n[0].length):-1}function En(e,t,s){var n=gn.exec(t.slice(s,s+2));return n?(e.S=+n[0],s+n[0].length):-1}function In(e,t,s){var n=gn.exec(t.slice(s,s+3));return n?(e.L=+n[0],s+n[0].length):-1}function Nn(e,t,s){var n=gn.exec(t.slice(s,s+6));return n?(e.L=Math.floor(n[0]/1e3),s+n[0].length):-1}function kn(e,t,s){var n=mn.exec(t.slice(s,s+1));return n?s+n[0].length:-1}function jn(e,t,s){var n=gn.exec(t.slice(s));return n?(e.Q=+n[0],s+n[0].length):-1}function Gn(e,t,s){var n=gn.exec(t.slice(s));return n?(e.s=+n[0],s+n[0].length):-1}function Vn(e,t){return fn(e.getDate(),t,2)}function Qn(e,t){return fn(e.getHours(),t,2)}function Bn(e,t){return fn(e.getHours()%12||12,t,2)}function On(e,t){return fn(1+js.count(Hs(e),e),t,3)}function Xn(e,t){return fn(e.getMilliseconds(),t,3)}function $n(e,t){return Xn(e,t)+"000"}function Jn(e,t){return fn(e.getMonth()+1,t,2)}function Hn(e,t){return fn(e.getMinutes(),t,2)}function qn(e,t){return fn(e.getSeconds(),t,2)}function zn(e){var t=e.getDay();return 0===t?7:t}function Yn(e,t){return fn(Vs.count(Hs(e)-1,e),t,2)}function Zn(e){var t=e.getDay();return t>=4||0===t?Xs(e):Xs.ceil(e)}function Kn(e,t){return e=Zn(e),fn(Xs.count(Hs(e),e)+(4===Hs(e).getDay()),t,2)}function er(e){return e.getDay()}function tr(e,t){return fn(Qs.count(Hs(e)-1,e),t,2)}function sr(e,t){return fn(e.getFullYear()%100,t,2)}function nr(e,t){return fn((e=Zn(e)).getFullYear()%100,t,2)}function rr(e,t){return fn(e.getFullYear()%1e4,t,4)}function ir(e,t){var s=e.getDay();return fn((e=s>=4||0===s?Xs(e):Xs.ceil(e)).getFullYear()%1e4,t,4)}function or(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+fn(t/60|0,"0",2)+fn(t%60,"0",2)}function cr(e,t){return fn(e.getUTCDate(),t,2)}function ur(e,t){return fn(e.getUTCHours(),t,2)}function ar(e,t){return fn(e.getUTCHours()%12||12,t,2)}function hr(e,t){return fn(1+qs.count(rn(e),e),t,3)}function lr(e,t){return fn(e.getUTCMilliseconds(),t,3)}function dr(e,t){return lr(e,t)+"000"}function pr(e,t){return fn(e.getUTCMonth()+1,t,2)}function gr(e,t){return fn(e.getUTCMinutes(),t,2)}function mr(e,t){return fn(e.getUTCSeconds(),t,2)}function Sr(e){var t=e.getUTCDay();return 0===t?7:t}function fr(e,t){return fn(Ys.count(rn(e)-1,e),t,2)}function _r(e){var t=e.getUTCDay();return t>=4||0===t?tn(e):tn.ceil(e)}function Ur(e,t){return e=_r(e),fn(tn.count(rn(e),e)+(4===rn(e).getUTCDay()),t,2)}function vr(e){return e.getUTCDay()}function yr(e,t){return fn(Zs.count(rn(e)-1,e),t,2)}function Cr(e,t){return fn(e.getUTCFullYear()%100,t,2)}function Dr(e,t){return fn((e=_r(e)).getUTCFullYear()%100,t,2)}function Rr(e,t){return fn(e.getUTCFullYear()%1e4,t,4)}function Wr(e,t){var s=e.getUTCDay();return fn((e=s>=4||0===s?tn(e):tn.ceil(e)).getUTCFullYear()%1e4,t,4)}function br(){return"+0000"}function Fr(){return"%"}function Tr(e){return+e}function Ar(e){return Math.floor(+e/1e3)}function wr(e){return(hn=an(e)).format,hn.parse,ln=hn.utcFormat,dn=hn.utcParse,hn}n(fn,"pad"),n(_n,"requote"),n(Un,"formatRe"),n(vn,"formatLookup"),n(yn,"parseWeekdayNumberSunday"),n(Cn,"parseWeekdayNumberMonday"),n(Dn,"parseWeekNumberSunday"),n(Rn,"parseWeekNumberISO"),n(Wn,"parseWeekNumberMonday"),n(bn,"parseFullYear"),n(Fn,"parseYear"),n(Tn,"parseZone"),n(An,"parseQuarter"),n(wn,"parseMonthNumber"),n(xn,"parseDayOfMonth"),n(Ln,"parseDayOfYear"),n(Pn,"parseHour24"),n(Mn,"parseMinutes"),n(En,"parseSeconds"),n(In,"parseMilliseconds"),n(Nn,"parseMicroseconds"),n(kn,"parseLiteralPercent"),n(jn,"parseUnixTimestamp"),n(Gn,"parseUnixTimestampSeconds"),n(Vn,"formatDayOfMonth"),n(Qn,"formatHour24"),n(Bn,"formatHour12"),n(On,"formatDayOfYear"),n(Xn,"formatMilliseconds"),n($n,"formatMicroseconds"),n(Jn,"formatMonthNumber"),n(Hn,"formatMinutes"),n(qn,"formatSeconds"),n(zn,"formatWeekdayNumberMonday"),n(Yn,"formatWeekNumberSunday"),n(Zn,"dISO"),n(Kn,"formatWeekNumberISO"),n(er,"formatWeekdayNumberSunday"),n(tr,"formatWeekNumberMonday"),n(sr,"formatYear"),n(nr,"formatYearISO"),n(rr,"formatFullYear"),n(ir,"formatFullYearISO"),n(or,"formatZone"),n(cr,"formatUTCDayOfMonth"),n(ur,"formatUTCHour24"),n(ar,"formatUTCHour12"),n(hr,"formatUTCDayOfYear"),n(lr,"formatUTCMilliseconds"),n(dr,"formatUTCMicroseconds"),n(pr,"formatUTCMonthNumber"),n(gr,"formatUTCMinutes"),n(mr,"formatUTCSeconds"),n(Sr,"formatUTCWeekdayNumberMonday"),n(fr,"formatUTCWeekNumberSunday"),n(_r,"UTCdISO"),n(Ur,"formatUTCWeekNumberISO"),n(vr,"formatUTCWeekdayNumberSunday"),n(yr,"formatUTCWeekNumberMonday"),n(Cr,"formatUTCYear"),n(Dr,"formatUTCYearISO"),n(Rr,"formatUTCFullYear"),n(Wr,"formatUTCFullYearISO"),n(br,"formatUTCZone"),n(Fr,"formatLiteralPercent"),n(Tr,"formatUnixTimestamp"),n(Ar,"formatUnixTimestampSeconds"),wr({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"]}),n(wr,"defaultLocale");const xr=class _ECLGraph extends t.StateObject{constructor(e,t,s){super(),r(this,"wu"),this.wu=e;let n=0;for(const r of s)if(r.GraphName===t.Name&&!r.HasSubGraphId){n=Math.round(1e3*r.Seconds)/1e3;break}this.set({Time:n,...t})}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")}fetchScopeGraph(e){return e?this.wu.fetchGraphDetails([e],["subgraph"]).then(e=>ei(e)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(e=>ei(e))}};n(xr,"ECLGraph");let Lr=xr;const Pr=class _GraphCache extends t.Cache{constructor(){super(e=>t.Cache.hash([e.Name]))}};n(Pr,"GraphCache");let Mr=Pr;function Er(e,t,s){(s=s||[]).push(e),t(e.name,e.$,e.children(),s),e.children().forEach(e=>{Er(e,t,s)}),s.pop()}function Ir(e){const t={};return e.forEach(e=>{"att"===e.name&&(t[e.$.name]=e.$.value)}),t}n(Er,"walkXmlJson"),n(Ir,"flattenAtt");const Nr=class _XGMMLGraph extends t.Graph{};n(Nr,"XGMMLGraph");let kr=Nr;const jr=class _XGMMLSubgraph extends t.Subgraph{};n(jr,"XGMMLSubgraph");let Gr=jr;const Vr=class _XGMMLVertex extends t.Vertex{};n(Vr,"XGMMLVertex");let Qr=Vr;const Br=class _XGMMLEdge extends t.Edge{};n(Br,"XGMMLEdge");let Or=Br;function Xr(e,t){const s={},n={},r={},i=new kr(e=>e._.id),o=[i.root];return Er(t,(e,t,i,c)=>{const u=o[o.length-1];switch(e){case"graph":break;case"node":if(i.length&&i[0].children().length&&"graph"===i[0].children()[0].name){const e=u.createSubgraph(Ir(i));o.push(e),s[t.id]=e}const e=u.createVertex(Ir(i));n[t.id]=e;break;case"edge":const c=u.createEdge(n[t.source],n[t.target],Ir(i));r[t.id]=c}}),i}n(Xr,"createXGMMLGraph");const $r=class _ScopeGraph extends t.Graph{};n($r,"ScopeGraph");let Jr=$r;const Hr=class _ScopeSubgraph extends t.Subgraph{};n(Hr,"ScopeSubgraph");let qr=Hr;const zr=class _ScopeVertex extends t.Vertex{};n(zr,"ScopeVertex");let Yr=zr;const Zr=class _ScopeEdge extends t.Edge{};n(Zr,"ScopeEdge");let Kr=Zr;function ei(e){const t={},s={},n={};let r;for(const o of e)switch(o.ScopeType){case"graph":r=new Jr(e=>e._.Id,o),t[o.ScopeName]=r.root;break;case"subgraph":r||(r=new Jr(e=>e._.Id,o),t[o.ScopeName]=r.root);const e=o.parentScope().split(":");let i=t[o.parentScope()];for(;e.length&&!i;)i=t[e.join(":")],e.pop();if(i){const e=i;t[o.ScopeName]=e.createSubgraph(o)}else console.warn(`Missing SG:Parent (${o.Id}): ${o.parentScope()}`);break;case"activity":const c=t[o.parentScope()];c?n[o.ScopeName]=c.createVertex(o):console.warn(`Missing A:Parent (${o.Id}): ${o.parentScope()}`);break;case"edge":s[o.ScopeName]=o;break;case"function":const u=n[o.parentScope()];u?u._.children().push(o):console.warn(`Missing F:Parent (${o.Id}): ${o.parentScope()}`)}for(const o in s){const e=s[o],n=t[e.parentScope()];if(n){const t=n;try{const s=r.vertex(e.attr("IdSource").RawValue),n=r.vertex(e.attr("IdTarget").RawValue);t.createEdge(s,n,e)}catch(i){console.warn(`Invalid Edge: ${o}`)}}else console.warn(`Missing E:Parent (${e.Id}): ${e.parentScope()}`)}return r}n(ei,"createGraph");const ti=class _Resource extends t.StateObject{constructor(e,t){super(),r(this,"wu"),this.wu=e;const s=t.split("\\").join("/"),n=s.split("/"),i="res/"+this.wu.Wuid+"/";let o="",c="";0===s.indexOf(i)&&(o=s.substr(i.length),c=n[n.length-1]),this.set({URL:t,DisplayName:c,DisplayPath:o})}get properties(){return this.get()}get URL(){return this.get("URL")}get DisplayName(){return this.get("DisplayName")}get DisplayPath(){return this.get("DisplayPath")}};n(ti,"Resource");let si=ti;const ni=class _XSDNode{constructor(e){r(this,"e"),this.e=e}fix(){delete this.e}};n(ni,"XSDNode");let ri=ni;const ii=class _XSDXMLNode extends ri{constructor(e){super(e),r(this,"name"),r(this,"type"),r(this,"isSet",!1),r(this,"attrs",{}),r(this,"_children",[])}append(e){this._children.push(e),this.type||(this.type="hpcc:childDataset")}fix(){this.name=this.e.$.name,this.type=this.e.$.type;for(let t=this._children.length-1;t>=0;--t){const e=this._children[t];"Row"===e.name&&void 0===e.type&&(this._children.push(...e._children),this._children.splice(t,1))}const e=this.setOfType();e&&(this.type=e,this.isSet=!0,this._children=[])}children(){return this._children}isAll(e){return"All"===e.name&&void 0===e.type}setOfType(){const e=this.children();if(void 0===this.type&&2===e.length){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":case"xs:nonNegativeInteger":case"xs:double":e=8;break;case"xs:string":e=32;break;default:const t="0123456789",s=this.type.lastIndexOf("_"),n=s>0?s:this.type.length;let r=n-1;for(;r>=0&&-1!==t.indexOf(this.type.charAt(r));--r);r+1<n&&(e=parseInt(this.type.substring(r+1,n),10)),0===this.type.indexOf("data")&&(e*=2)}return e<this.name.length&&(e=this.name.length),e}};n(ii,"XSDXMLNode");let oi=ii;const ci=class _XSDSimpleType extends ri{constructor(e){super(e),r(this,"name"),r(this,"type"),r(this,"maxLength"),r(this,"_restricition"),r(this,"_maxLength")}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()}};n(ci,"XSDSimpleType");let ui=ci;const ai=class _XSDSchema{constructor(){r(this,"root"),r(this,"simpleTypes",{})}fields(){return this.root.children()}};n(ai,"XSDSchema");let hi=ai;const li=class _XSDParser extends t.SAXStackParser{constructor(){super(...arguments),r(this,"schema",new hi),r(this,"simpleType"),r(this,"simpleTypes",{}),r(this,"xsdStack",new t.Stack)}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":const t=new oi(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 ui(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":const t=this.xsdStack.top();for(const s in e.$)t.attrs[s]=e.$[s];break;default:this.simpleType&&this.simpleType.append(e)}super.endXMLNode(e)}};n(li,"XSDParser");let di=li;function pi(e){const t=new di;return t.parse(e),t.schema}n(pi,"parseXSD");const gi=class _XSDParser2 extends di{constructor(e){super(),r(this,"_rootName"),r(this,"schema",new hi),r(this,"simpleTypes",{}),r(this,"xsdStack",new t.Stack),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":const t=new oi(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 ui(e)}}endXMLNode(e){if("xsd:element"===e.name){this.xsdStack.pop().fix()}super.endXMLNode(e)}};n(gi,"XSDParser2");let mi=gi;function Si(e,t){const s=new mi(t);return s.parse(e),s.schema}n(Si,"parseXSD2");const fi=class _GlobalResultCache extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}};n(fi,"GlobalResultCache");let _i=fi;const Ui=new _i,vi=class _Result extends t.StateObject{constructor(e,t,s,n){super(),r(this,"connection"),r(this,"xsdSchema"),r(this,"_fetchXMLSchemaPromise"),this.connection=e instanceof ls?e:new ls(e),"boolean"==typeof n&&!0===n?this.set({NodeGroup:t,LogicalFileName:s}):cs(s)&&Array.isArray(n)?this.set({...s,Wuid:t,ResultName:s.Name,ResultViews:n}):void 0===n?"number"==typeof s?this.set({Wuid:t,ResultSequence:s}):"string"==typeof s?this.set({Wuid:t,ResultName:s}):console.warn("Unknown Result.attach (1)"):console.warn("Unknown Result.attach (2)")}get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get ResultName(){return this.get("ResultName")}get ResultSequence(){return this.get("ResultSequence")}get LogicalFileName(){return this.get("LogicalFileName")}get Name(){return this.get("Name")}get Sequence(){return this.get("Sequence")}get Value(){return this.get("Value")}get Link(){return this.get("Link")}get FileName(){return this.get("FileName")}get IsSupplied(){return this.get("IsSupplied")}get ShowFileContent(){return this.get("ShowFileContent")}get Total(){return this.get("Total")}get ECLSchemas(){return this.get("ECLSchemas")}get NodeGroup(){return this.get("NodeGroup")}get ResultViews(){return this.get("ResultViews")}get XmlSchema(){return this.get("XmlSchema")}static attach(e,t,s,n){let r;return Array.isArray(n)?(r=Ui.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s.Name},()=>new _Result(e,t,s,n)),r.set(s)):void 0===n&&("number"==typeof s?r=Ui.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+s},()=>new _Result(e,t,s)):"string"==typeof s&&(r=Ui.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new _Result(e,t,s)))),r}static attachLogicalFile(e,t,s){return Ui.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new _Result(e,t,s,!0))}isComplete(){return-1!==this.Total}fetchXMLSchema(e=!1){return this._fetchXMLSchemaPromise&&!e||(this._fetchXMLSchemaPromise=this.WUResult().then(e=>{var t,s;return(null==(s=null==(t=e.Result)?void 0:t.XmlSchema)?void 0:s.xml)?(this.xsdSchema=pi(e.Result.XmlSchema.xml),this.xsdSchema):null})),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(e=0,s=-1,n=!1,r={},i){return this.WUResult(e,s,!n,r,i).then(e=>{const s=e.Result;return delete e.Result,this.set({...e}),t.exists("XmlSchema.xml",s)&&(this.xsdSchema=pi(s.XmlSchema.xml)),t.exists("Row",s)?s.Row:this.ResultName&&t.exists(this.ResultName,s)?s[this.ResultName].Row:[]})}rootField(){return this.xsdSchema?this.xsdSchema.root:null}fields(){return this.xsdSchema?this.xsdSchema.root.children():[]}WUResult(e=0,t=1,s=!1,n={},r){const i={NamedValue:{itemcount:0}};for(const c in n)i.NamedValue[i.NamedValue.itemcount++]={Name:c,Value:n[c]};const o={FilterBy:i};return this.Wuid&&void 0!==this.ResultName?(o.Wuid=this.Wuid,o.ResultName=this.ResultName):this.Wuid&&void 0!==this.ResultSequence?(o.Wuid=this.Wuid,o.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(o.LogicalName=this.LogicalFileName,o.Cluster=this.NodeGroup):this.LogicalFileName&&(o.LogicalName=this.LogicalFileName),o.Start=e,o.Count=t,o.SuppressXmlSchema=s,this.connection.WUResult(o,r).then(e=>e)}};n(vi,"Result");let yi=vi;const Ci=class _ResultCache extends t.Cache{constructor(){super(e=>t.Cache.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};n(Ci,"ResultCache");let Di=Ci;const Ri=class _Attribute extends t.StateObject{constructor(e,t){super(),r(this,"scope"),this.scope=e,this.set(t)}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")}};n(Ri,"Attribute");let Wi=Ri;const bi=class _BaseScope extends t.StateObject{constructor(e){super(),r(this,"_attributeMap",{}),r(this,"_children",[]),this.update(e)}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(){const e=[],t={start:null,end:null};return this.Properties.Property.forEach(s=>{"ts"===s.Measure&&s.Name.indexOf("Started")>=0?t.start=s:this.ScopeName&&"ts"===s.Measure&&s.Name.indexOf("Finished")>=0?t.end=s:e.push(new Wi(this,s))}),t.start&&t.end?(t.start.FormattedEnd=t.end.Formatted,e.push(new Wi(this,t.start))):t.start?e.push(new Wi(this,t.start)):t.end&&e.push(new Wi(this,t.end)),e}update(e){this.set(e),this.CAttributes.forEach(e=>{this._attributeMap[e.Name]=e}),this.Properties.Property=[];for(const t in this._attributeMap)this._attributeMap.hasOwnProperty(t)&&this.Properties.Property.push(this._attributeMap[t].properties)}parentScope(){const 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(const t of this.children())if(t.walk(e))return!0;return e.end(this)}formattedAttrs(){const e={};for(const t in this._attributeMap)e[t]=this._attributeMap[t].Formatted||this._attributeMap[t].RawValue;return e}rawAttrs(){const e={};for(const t in this._attributeMap)e[t]=this._attributeMap[t].RawValue;return e}hasAttr(e){return void 0!==this._attributeMap[e]}attr(e){return this._attributeMap[e]||new Wi(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let t="";const s=[];t=this.Id,s.push(`<tr><td class="key">ID:</td><td class="value">${this.Id}</td></tr>`),e&&s.push(`<tr><td class="key">Parent ID:</td><td class="value">${e.Id}</td></tr>`),s.push(`<tr><td class="key">Scope:</td><td class="value">${this.ScopeName}</td></tr>`);const n=this.formattedAttrs();for(const r in n)"Label"===r?t=n[r]:s.push(`<tr><td class="key">${r}</td><td class="value">${n[r]}</td></tr>`);return`<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">\n <h4 align="center">${t}</h4>\n <table>\n ${s.join("")}\n </table>\n </div>`}};n(bi,"BaseScope");let Fi=bi;const Ti=class _Scope extends Fi{constructor(e,t){super(t),r(this,"wu"),this.wu=e}};n(Ti,"Scope");let Ai=Ti;const wi=class _SourceFile extends t.StateObject{constructor(e,t,s){super(),r(this,"connection"),this.connection=e instanceof ls?e:new ls(e),this.set({Wuid:t,...s})}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")}};n(wi,"SourceFile");let xi=wi;const Li=class _Timer extends t.StateObject{constructor(e,s,n){super(),r(this,"connection"),this.connection=e instanceof ls?e:new ls(e);const i=t.espTime2Seconds(n.Value);this.set({Wuid:s,Seconds:Math.round(1e3*i)/1e3,HasSubGraphId:void 0!==n.SubGraphId,...n})}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")}};n(Li,"Timer");let Pi=Li;const Mi=ln("%Y-%m-%dT%H:%M:%S.%LZ"),Ei=dn("%Y-%m-%dT%H:%M:%S.%LZ"),Ii=As(",");function Ni(e){return e&&!isNaN(+e)?Ii(+e):e}n(Ni,"formatNum");const ki="DefinitionList",ji=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,Gi=["Avg","Min","Max","Delta","StdDev"],Vi=["SkewMin","SkewMax","NodeMin","NodeMax"],Qi=/[A-Z][a-z]*/g;function Bi(e){for(const s of Vi){const t=e.indexOf(s);if(0===t){return{measure:"",ext:s,label:e.slice(t+s.length)}}}const t=e.match(Qi);if(null==t?void 0:t.length){const e=t.shift();let s=t.join("");for(const t of Gi){const n=s.indexOf(t);if(0===n)return s=s.slice(n+t.length),{measure:e,ext:t,label:s}}return{measure:e,ext:"",label:s}}return{measure:"",ext:"",label:e}}n(Bi,"_splitMetric");const Oi={};function Xi(e){let t=Oi[e];return t||(t=Bi(e),Oi[e]=t),t}function $i(e,t){var s;return(null==(s=e.__formattedProps)?void 0:s[t])??e[t]}function Ji(e){if(void 0===e)return;const t=parseFloat(e);return isNaN(t)?void 0:t}function Hi(e,t,s){const n=Xi(t);if(!s[n.measure]){s[n.label]=!0;const t=Ji(e[`${n.measure}Avg${n.label}`]),r=Ji(e[`${n.measure}Min${n.label}`]),i=Ji(e[`${n.measure}Max${n.label}`]),o=Ji(e[`${n.measure}StdDev${n.label}`]),c=Math.max((t-r)/o,(i-t)/o);return{Key:`${n.measure}${n.label}`,Value:$i(e,`${n.measure}${n.label}`),Avg:$i(e,`${n.measure}Avg${n.label}`),Min:$i(e,`${n.measure}Min${n.label}`),Max:$i(e,`${n.measure}Max${n.label}`),Delta:$i(e,`${n.measure}Delta${n.label}`),StdDev:$i(e,`${n.measure}StdDev${n.label}`),StdDevs:isNaN(c)?void 0:c,SkewMin:$i(e,`SkewMin${n.label}`),SkewMax:$i(e,`SkewMax${n.label}`),NodeMin:$i(e,`NodeMin${n.label}`),NodeMax:$i(e,`NodeMax${n.label}`)}}return null}n(Xi,"splitMetric"),n($i,"formatValue"),n(Ji,"safeParseFloat"),n(Hi,"formatValues");const qi=t.scopedLogger("workunit.ts"),zi=class _WorkunitCache extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}};n(zi,"WorkunitCache");let Yi=zi;const Zi=new Yi,Ki=class _Workunit extends t.StateObject{constructor(e,t){super(),r(this,"connection"),r(this,"topologyConnection"),r(this,"_debugMode",!1),r(this,"_debugAllGraph"),r(this,"_submitAction"),r(this,"_resultCache",new Di),r(this,"_graphCache",new Mr),this.connection=new ls(e),this.topologyConnection=new Vt(e),this.clearState(t)}get BaseUrl(){return this.connection.baseUrl}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",os.Unknown)}get State(){return this.get("State")||os[this.StateID]}get Protected(){return this.get("Protected",!1)}get Exceptions(){return this.get("Exceptions",{ECLException:[]})}get ResultViews(){return this.get("ResultViews",{View:[]})}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,()=>yi.attach(this.connection,this.Wuid,e,this.ResultViews.View)))}get SequenceResults(){const 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 Pi(this.connection,this.Wuid,e))}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 Lr(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 si(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 xi(this.connection,this.Wuid,e))}get VariableCount(){return this.get("VariableCount",0)}get Variables(){return this.get("Variables",{ECLResult:[]})}get TimerCount(){return this.get("TimerCount",0)}get HasDebugValue(){return this.get("HasDebugValue")}get ApplicationValueCount(){return this.get("ApplicationValueCount",0)}get XmlParams(){return this.get("XmlParams")}get AccessFlag(){return this.get("AccessFlag")}get ClusterFlag(){return this.get("ClusterFlag")}get ResultViewCount(){return this.get("ResultViewCount",0)}get DebugValueCount(){return this.get("DebugValueCount",0)}get WorkflowCount(){return this.get("WorkflowCount",0)}get Archived(){return this.get("Archived")}get RoxieCluster(){return this.get("RoxieCluster")}get DebugState(){return this.get("DebugState",{})}get Queue(){return this.get("Queue")}get Active(){return this.get("Active")}get Action(){return this.get("Action")}get Scope(){return this.get("Scope")}get AbortBy(){return this.get("AbortBy")}get AbortTime(){return this.get("AbortTime")}get Workflows(){return this.get("Workflows")}get TimingData(){return this.get("TimingData")}get HelpersDesc(){return this.get("HelpersDesc")}get GraphsDesc(){return this.get("GraphsDesc")}get SourceFilesDesc(){return this.get("SourceFilesDesc")}get ResultsDesc(){return this.get("ResultsDesc")}get VariablesDesc(){return this.get("VariablesDesc")}get TimersDesc(){return this.get("TimersDesc")}get DebugValuesDesc(){return this.get("DebugValuesDesc")}get ApplicationValuesDesc(){return this.get("ApplicationValuesDesc")}get WorkflowsDesc(){return this.get("WorkflowsDesc")}get ServiceNames(){return this.get("ServiceNames")}get CompileCost(){return this.get("CompileCost")}get ExecuteCost(){return this.get("ExecuteCost")}get FileAccessCost(){return this.get("FileAccessCost")}get NoAccess(){return this.get("NoAccess")}get ECLWUProcessList(){return this.get("ECLWUProcessList")}static create(e){const t=new _Workunit(e);return t.connection.WUCreate().then(e=>(Zi.set(t),t.set(e.Workunit),t))}static attach(e,t,s){const n=Zi.get({BaseUrl:e.baseUrl,Wuid:t},()=>new _Workunit(e,t));return s&&n.set(s),n}static existsLocal(e,t){return Zi.has({BaseUrl:e,Wuid:t})}static submit(t,s,n,r=!1){return _Workunit.create(t).then(e=>e.update({QueryText:n})).then(t=>r?t.submit(s,e.WUUpdate.Action.Compile):t.submit(s))}static compile(e,t,s){return _Workunit.submit(e,t,s,!0)}static query(e,t){return new ls(e).WUQuery(t).then(t=>t.Workunits.ECLWorkunit.map(function(t){return _Workunit.attach(e,t.Wuid,t)}))}clearState(e){this.clear({Wuid:e,StateID:os.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(t,s=e.WUUpdate.Action.Run,n){let r;return r=void 0!==t?Promise.resolve(t):this.topologyConnection.DefaultTpLogicalClusterQuery().then(e=>e.Name),this._debugMode=!1,s===e.WUUpdate.Action.Debug&&(s=e.WUUpdate.Action.Run,this._debugMode=!0),r.then(e=>this.connection.WUUpdate({Wuid:this.Wuid,Action:s,ResultLimit:n,DebugValues:{DebugValue:[{Name:"Debug",Value:this._debugMode?"1":""}]}}).then(t=>(this.set(t.Workunit),this._submitAction=s,this.connection.WUSubmit({Wuid:this.Wuid,Cluster:e})))).then(()=>this)}isComplete(){switch(this.StateID){case os.Compiled:return"compile"===this.ActionEx||this._submitAction===e.WUUpdate.Action.Compile;case os.Completed:case os.Failed:case os.Aborted:case os.NotFound:return!0}return!1}isFailed(){switch(this.StateID){case os.Aborted:case os.Failed:return!0}return!1}isDeleted(){return this.StateID===os.NotFound}isDebugging(){switch(this.StateID){case os.DebugPaused:case os.DebugRunning:return!0}return this._debugMode}isRunning(){switch(this.StateID){case os.Compiled:case os.Running:case os.Aborting:case os.Blocked:case os.DebugPaused:case os.DebugRunning:return!0}return!1}setToFailed(){return this.WUAction(e.WsWorkunits.ECLWUActions.SetToFailed)}pause(){return this.WUAction(e.WsWorkunits.ECLWUActions.Pause)}pauseNow(){return this.WUAction(e.WsWorkunits.ECLWUActions.PauseNow)}resume(){return this.WUAction(e.WsWorkunits.ECLWUActions.Resume)}abort(){return this.WUAction(e.WsWorkunits.ECLWUActions.Abort)}protect(){return this.WUAction(e.WsWorkunits.ECLWUActions.Protect)}unprotect(){return this.WUAction(e.WsWorkunits.ECLWUActions.Unprotect)}delete(){return this.WUAction(e.WsWorkunits.ECLWUActions.Delete)}restore(){return this.WUAction(e.WsWorkunits.ECLWUActions.Restore)}deschedule(){return this.WUAction(e.WsWorkunits.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(e.WsWorkunits.ECLWUActions.Reschedule)}resubmit(){return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!1}).then(()=>(this.clearState(this.Wuid),this.refresh().then(()=>(this._monitor(),this))))}clone(){return this.WUResubmit({CloneWorkunit:!0,ResetWorkflow:!1}).then(e=>_Workunit.attach(this.connection.opts(),e.WUs.WU[0].WUID).refresh())}async refreshState(){return await this.WUQuery(),this.StateID!==os.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(()=>{var e;return(null==(e=this.Helpers)?void 0:e.ECLHelpFile)||[]})}fetchAllowedClusters(){return this.WUInfo({IncludeAllowedClusters:!0}).then(()=>{var e;return(null==(e=this.AllowedClusters)?void 0:e.AllowedCluster)||[]})}fetchTotalClusterTime(){return this.WUInfo({IncludeTotalClusterTime:!0}).then(()=>this.TotalClusterTime)}fetchServiceNames(){return this.WUInfo({IncludeServiceNames:!0}).then(()=>{var e;return null==(e=this.ServiceNames)?void 0:e.Item})}fetchDetailsMeta(e={}){return this.WUDetailsMeta(e)}fetchDetailsRaw(e={}){return this.WUDetails(e).then(e=>e.Scopes.Scope)}normalizeDetails(e,t){var s,n;const r={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},i=new Map;for(const u of(null==(s=e.Activities)?void 0:s.Activity)??[])i.set(u.Kind,u.Name);const o=new Array(t.length);for(let u=0;u<t.length;u++){const e=t[u],s={},a={};if(e.Id&&(null==(n=e.Properties)?void 0:n.Property))for(const t of e.Properties.Property){const e=t.Measure,n=t.Name,o=t.RawValue;if("ns"===e&&(t.Measure="s"),"Kind"===n){const e=parseInt(o,10);t.Formatted=i.get(e)??o}switch(r[n]={Name:t.Name,Measure:t.Measure,Creator:t.Creator,CreatorType:t.CreatorType},t.Measure){case"bool":s[n]=!!+o;break;case"sz":case"ns":case"cnt":case"node":case"skw":s[n]=+o;break;case"s":s[n]=+o/1e9;break;case"ts":s[n]=new Date(+o/1e3).toISOString();break;case"cost":s[n]=+o/1e6;break;default:s[n]=o}a[n]=Ni(t.Formatted??s[n])}const h={id:e.Id,name:e.ScopeName,type:e.ScopeType,Kind:e.Kind,Label:e.Label,__formattedProps:a,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...s},l=h[ki];if(l)try{const e=JSON.parse(l.split("\\").join("\\\\")),t=[];for(let s=0;s<e.length;s++){const n=e[s].match(ji);n&&t.push({filePath:(n[1]??"")+n[2]+n[3],line:parseInt(n[5],10),col:parseInt(n[6],10)})}h[ki]=t}catch(c){qi.error(`Unexpected "DefinitionList": ${l}`)}const d={};let p=0,g="";for(const t in h)if(!t.startsWith("__")){const e=Hi(h,t,d);e&&(h.__groupedProps[e.Key]=e,!isNaN(e.StdDevs)&&e.StdDevs>p&&(p=e.StdDevs,g=e.Key))}h.__StdDevs=p,h.__StdDevsSource=g,o[u]=h}return{meta:e,columns:r,data:o}}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 Ai(this,e)))}fetchDetailsHierarchy(e={}){return this.WUDetails(e).then(e=>{const t=[],s={};e.Scopes.Scope.forEach(e=>{if(s[e.ScopeName])return s[e.ScopeName].update(e),null;{const t=new Ai(this,e);return s[t.ScopeName]=t,t}});for(const n in s)if(s.hasOwnProperty(n)){const e=s[n],r=e.parentScope();r&&s[r]?s[r].children().push(e):t.push(e)}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=>ei(e))}fetchTimeElapsed(){return this.fetchDetails({ScopeFilter:{PropertyFilters:{PropertyFilter:[{Name:"TimeElapsed"}]}}}).then(e=>{const t={};e.forEach(e=>{t[e.ScopeName]=t[e.ScopeName]||{scope:e.ScopeName,start:null,elapsed:null,finish:null},e.CAttributes.forEach(s=>{"TimeElapsed"===s.Name?t[e.ScopeName].elapsed=+s.RawValue:"ts"===s.Measure&&s.Name.indexOf("Started")>=0&&(t[e.ScopeName].start=s.Formatted)})});const s=[];for(const n in t){const e=t[n];if(e.start&&e.elapsed){const t=Ei(e.start);t.setMilliseconds(t.getMilliseconds()+e.elapsed/1e6),e.finish=Mi(t),s.push(e)}}return s.sort((e,t)=>e.start<t.start?-1:e.start>t.start?1:0),s})}_monitor(){this.isComplete()?this._monitorTickCount=0:super._monitor()}_monitorTimeoutDuration(){const e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?1e3:this._monitorTickCount<=3?3e3:this._monitorTickCount<=5?5e3:this._monitorTickCount<=7?1e4:e}on(e,t,s){if(this.isCallback(t))switch(e){case"completed":super.on("propChanged","StateID",e=>{this.isComplete()&&t([e])});break;case"changed":super.on(e,t)}else if("changed"===e)super.on(e,t,s);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,s)=>{const n=this.watch(s=>{e&&e(s),this.isComplete()&&(n.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,s)=>{const n=this.watch(s=>{e&&e(s),(this.isComplete()||this.isRunning())&&(n.release(),t(this))})})}WUQuery(e={}){return this.connection.WUQuery({...e,Wuid:this.Wuid}).then(e=>(0===e.Workunits.ECLWorkunit.length?(this.clearState(this.Wuid),this.set("StateID",os.NotFound)):this.set(e.Workunits.ECLWorkunit[0]),e)).catch(e=>{if(!e.Exception.some(e=>20081===e.Code&&(this.clearState(this.Wuid),this.set("StateID",os.NotFound),!0)))throw qi.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),Zi.set(this),e))}WUInfo(e={}){const 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=>20080===e.Code&&(this.clearState(this.Wuid),this.set("StateID",os.NotFound),!0)))throw qi.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}WUResubmit(e){return this.connection.WUResubmit(t.deepMixinT({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails(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=>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(t){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:t||this.Jobname,AllowForeignFiles:!0,Activate:e.WsWorkunits.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){const t=new ps({baseUrl:""}),s={Wuid:this.Wuid,Cluster:this.Cluster,JobName:this.Jobname,AllowForeignFiles:!0,Activate:1,Wait:5e3,...e};return t.WUPublishWorkunitEx(s)}WUCDebug(e,t={}){let s="";for(const n in t)t.hasOwnProperty(n)&&(s+=` ${n}='${t[n]}'`);return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:`<debug:${e} uid='${this.Wuid}'${s}/>`}).then(e=>e)}debug(e,s){return this.isDebugging()?this.WUCDebug(e,s).then(s=>{const n=s.children(e);return n.length?n[0]:new t.XMLNode(e)}).catch(s=>(qi.error(s),Promise.resolve(new t.XMLNode(e)))):Promise.resolve(new t.XMLNode(e))}debugStatus(){return this.isDebugging()?this.debug("status").then(e=>{const 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("break"===e.name)return e.$})}debugBreakpointAdd(e,t,s){return this.debug("breakpoint",{id:e,mode:t,action:s}).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=Xr(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(t=>ro(t,e))}debugPrint(e,t=0,s=10){return this.debug("print",{edgeID:e,startRow:t,numRows:s}).then(e=>e.children().map(e=>{const t={};return e.children().forEach(e=>{t[e.name]=e.content}),t}))}};n(Ki,"Workunit");let eo=Ki;const to="definition";function so(e){return void 0!==e._[to]}function no(e){const t=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(e._[to]);if(t){const[,s,n,r]=t;return s.replace(/\/\.\//g,"/"),{id:e._.id,file:s,line:+n,column:+r}}throw new Error(`Bad definition: ${e._[to]}`)}function ro(e,t){const s=[];for(const n of e.vertices)if(so(n)){const e=no(n);(e&&!t||t===e.file)&&s.push(e)}return s.sort((e,t)=>e.line-t.line)}let io;n(so,"hasECLDefinition"),n(no,"getECLDefinition"),n(ro,"breakpointLocations");const oo=class _Activity extends t.StateObject{constructor(e){super(),r(this,"connection"),r(this,"lazyRefresh",t.debounce(async()=>{const e=await this.connection.Activity({});return this.set(e),this})),this.connection=e instanceof Pt?e:new Pt(e),this.clear({})}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 io||(io=new _Activity(e)),t&&io.set(t),io}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(t=>""===e||t.ClusterName===e).map(e=>eo.attach(this.connection.connectionOptions(),e.Wuid,e))}setBanner(e){return this.connection.SetBanner({...e}).then(e=>(this.set(e),this))}async refresh(){return this.lazyRefresh()}};n(oo,"Activity");let co=oo;const uo=t.scopedLogger("logicalFile.ts"),ao=class _LogicalFileCache extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}};n(ao,"LogicalFileCache");let ho=ao;const lo=new ho,po=class _LogicalFile extends t.StateObject{constructor(e,t,s){super(),r(this,"connection"),this.connection=e instanceof Ae?e:new Ae(e),this.clear({Cluster:t,Name:s})}get BaseUrl(){return this.connection.baseUrl}get Cluster(){return this.get("Cluster")}get Name(){return this.get("Name")}get Filename(){return this.get("Filename")}get Prefix(){return this.get("Prefix")}get NodeGroup(){return this.get("NodeGroup")}get NumParts(){return this.get("NumParts")}get Description(){return this.get("Description")}get Dir(){return this.get("Dir")}get PathMask(){return this.get("PathMask")}get Filesize(){return this.get("Filesize")}get FileSizeInt64(){return this.get("FileSizeInt64")}get RecordSize(){return this.get("RecordSize")}get RecordCount(){return this.get("RecordCount")}get RecordSizeInt64(){return this.get("RecordSizeInt64")}get RecordCountInt64(){return this.get("RecordCountInt64")}get Wuid(){return this.get("Wuid")}get Owner(){return this.get("Owner")}get JobName(){return this.get("JobName")}get Persistent(){return this.get("Persistent")}get Format(){return this.get("Format")}get MaxRecordSize(){return this.get("MaxRecordSize")}get CsvSeparate(){return this.get("CsvSeparate")}get CsvQuote(){return this.get("CsvQuote")}get CsvTerminate(){return this.get("CsvTerminate")}get CsvEscape(){return this.get("CsvEscape")}get Modified(){return this.get("Modified")}get Ecl(){return this.get("Ecl")}get Stat(){return this.get("Stat")}get DFUFilePartsOnClusters(){return this.get("DFUFilePartsOnClusters")}get isSuperfile(){return this.get("isSuperfile")}get ShowFileContent(){return this.get("ShowFileContent")}get subfiles(){return this.get("subfiles")}get Superfiles(){return this.get("Superfiles")}get ProtectList(){return this.get("ProtectList")}get FromRoxieCluster(){return this.get("FromRoxieCluster")}get Graphs(){return this.get("Graphs")}get UserPermission(){return this.get("UserPermission")}get ContentType(){return this.get("ContentType")}get CompressedFileSize(){return this.get("CompressedFileSize")}get PercentCompressed(){return this.get("PercentCompressed")}get IsCompressed(){return this.get("IsCompressed")}get BrowseData(){return this.get("BrowseData")}get jsonInfo(){return this.get("jsonInfo")}get binInfo(){return this.get("binInfo")}get PackageID(){return this.get("PackageID")}get Partition(){return this.get("Partition")}get Blooms(){return this.get("Blooms")}get ExpireDays(){return this.get("ExpireDays")}get KeyType(){return this.get("KeyType")}get IsRestricted(){return this.get("IsRestricted")}get AtRestCost(){return this.get("AtRestCost")}get AccessCost(){return this.get("AccessCost")}get StateID(){return this.get("StateID")}get ExpirationDate(){return this.get("ExpirationDate")}get ExtendedIndexInfo(){return this.get("ExtendedIndexInfo")}get properties(){return this.get()}static attach(e,t,s,n){const r=lo.get({BaseUrl:e.baseUrl,Cluster:t,Name:s},()=>new _LogicalFile(e,t,s));return n&&r.set(n),r}filePartsOnCluster(){var e;return[...(null==(e=this.DFUFilePartsOnClusters)?void 0:e.DFUFilePartsOnCluster)||[]]}fileParts(){var e,t;const s=[];for(const n of(null==(e=this.DFUFilePartsOnClusters)?void 0:e.DFUFilePartsOnCluster)||[])for(const e of(null==(t=null==n?void 0:n.DFUFileParts)?void 0:t.DFUPart)||[]){const t={...n,...e};delete t.DFUFileParts,s.push(t)}return s}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=>{var t;return this.set({Cluster:this.Cluster,...e.FileDetail,ProtectList:(null==(t=null==e?void 0:e.FileDetail)?void 0:t.ProtectList)??{DFUFileProtect:[]}}),e.FileDetail}).catch(e=>{if(!e.Exception.some(e=>20038===e.Code&&(this.set("Name",this.Name+" (Deleted)"),this.set("StateID",999),!0)))throw uo.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=>{var t;return(null==(t=null==e?void 0:e.History)?void 0:t.Origin)||[]})}eraseHistory(){return this.connection.EraseHistory({Name:this.Name}).then(e=>{var t;return(null==(t=null==e?void 0:e.History)?void 0:t.Origin)||[]})}};n(po,"LogicalFile");let go=po;const mo=class _MachineCache extends t.Cache{constructor(){super(e=>e.Address)}};n(mo,"MachineCache");let So=mo;const fo=new So,_o=class _Machine extends t.StateObject{constructor(e){super(),r(this,"connection"),this.connection=e instanceof dt?e:new dt(e)}get Address(){return this.get("Address")}get ConfigAddress(){return this.get("ConfigAddress")}get Name(){return this.get("Name")}get ProcessType(){return this.get("ProcessType")}get DisplayType(){return this.get("DisplayType")}get Description(){return this.get("Description")}get AgentVersion(){return this.get("AgentVersion")}get Contact(){return this.get("Contact")}get Location(){return this.get("Location")}get UpTime(){return this.get("UpTime")}get ComponentName(){return this.get("ComponentName")}get ComponentPath(){return this.get("ComponentPath")}get RoxieState(){return this.get("RoxieState")}get RoxieStateDetails(){return this.get("RoxieStateDetails")}get OS(){return this.get("OS")}get ProcessNumber(){return this.get("ProcessNumber")}get Channels(){return this.get("Channels")}get Processors(){return this.get("Processors")}get Storage(){return this.get("Storage")}get Running(){return this.get("Running")}get PhysicalMemory(){return this.get("PhysicalMemory")}get VirtualMemory(){return this.get("VirtualMemory")}get ComponentInfo(){return this.get("ComponentInfo")}get Exception(){return this.get("Exception")}static attach(e,t,s){const n=fo.get({Address:t},()=>new _Machine(e));return s&&n.set(s),n}};n(_o,"Machine");let Uo=_o;const vo=class _TargetClusterCache extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}};n(vo,"TargetClusterCache");let yo=vo;const Co=new yo,Do=class _TargetCluster extends t.StateObject{constructor(e,t){super(),r(this,"connection"),r(this,"machineConnection"),e instanceof Vt?(this.connection=e,this.machineConnection=new dt(e.connectionOptions())):(this.connection=new Vt(e),this.machineConnection=new dt(e)),this.clear({Name:t})}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=>Uo.attach(this.machineConnection,e.Address,e))}static attach(e,t,s){const n=Co.get({BaseUrl:e.baseUrl,Name:t},()=>new _TargetCluster(e,t));return s&&n.set(s),n}fetchMachines(e={}){return this.machineConnection.GetTargetClusterInfo({TargetClusters:{Item:[`${this.Type}:${this.Name}`]},...e}).then(e=>{const t=[];for(const s of e.TargetClusterInfoList.TargetClusterInfo)for(const e of s.Processes.MachineInfoEx)t.push(e);return this.set("MachineInfoEx",t),this.CMachineInfoEx})}machineStats(){let e=0,t=0,s=0;for(const n of this.CMachineInfoEx)for(const r of n.Storage.StorageInfo){t+=r.Available,s+=r.Total;const n=1-r.Available/r.Total;n>e&&(e=n)}return{maxDisk:e,meanDisk:1-(s?t/s:1)}}fetchUsage(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])}};n(Do,"TargetCluster");let Ro=Do;function Wo(e){let t;return t=e instanceof Vt?e:new Vt(e),t.TpListTargetClusters({}).then(t=>t.TargetClusters.TpClusterNameType.map(t=>Ro.attach(e,t.Name,t)))}n(Wo,"targetClusters");const bo={};function Fo(e){if(!bo[e.baseUrl]){let t;t=e instanceof Vt?e:new Vt(e),bo[e.baseUrl]=t.TpListTargetClusters({}).then(t=>{let s,n,r;t.TargetClusters.TpClusterNameType.forEach(e=>{s||(s=e),n||!0!==e.IsDefault||(n=e),r||"hthor"!==e.Type||(r=e)});const i=n||r||s;return Ro.attach(e,i.Name,i)})}return bo[e.baseUrl]}n(Fo,"defaultTargetCluster");const To=class _TopologyCache extends t.Cache{constructor(){super(e=>e.BaseUrl)}};n(To,"TopologyCache");let Ao=To;const wo=new Ao,xo=class _Topology extends t.StateObject{constructor(e){super(),r(this,"connection"),r(this,"_prevRefresh"),this.connection=e instanceof Vt?e:new Vt(e)}get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get TargetClusters(){return this.get("TargetClusters")}get CTargetClusters(){return this.TargetClusters.map(e=>Ro.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,t){const s=wo.get({BaseUrl:e.baseUrl},()=>new _Topology(e));return t&&s.set(t),s}GetESPServiceBaseURL(e=""){return this.connection.TpServiceQuery({}).then(s=>{const n=this.connection.protocol(),r=this.connection.ip();let i="https:"===n?"18002":"8002";if(t.exists("ServiceList.TpEspServers.TpEspServer",s))for(const o of s.ServiceList.TpEspServers.TpEspServer)if(t.exists("TpBindings.TpBinding",o))for(const t of o.TpBindings.TpBinding)t.Service===e&&t.Protocol+":"===n&&(i=t.Port);return`${n}//${r}:${i}/`})}fetchTargetClusters(){return this.connection.TpTargetClusterQuery({Type:"ROOT"}).then(e=>{var t;return this.set({TargetClusters:(null==(t=e.TpTargetClusters)?void 0:t.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))}refresh(e=!1){return this._prevRefresh&&!e||(this._prevRefresh=Promise.all([this.fetchTargetClusters(),this.fetchLogicalClusters(),this.fetchServices()]).then(()=>this)),this._prevRefresh}on(e,t,s){if(this.isCallback(t)){if("changed"===e)super.on(e,t)}else if("changed"===e)super.on(e,t,s);return this._monitor(),this}};n(xo,"Topology");let Lo=xo;function Po(e,t,s){"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&(e[t]=s)}function Mo(e){return(e=""+e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g," ").replace(/\r/g," ")}function Eo(e){if(!e)return 0;if(!isNaN(+e))return parseFloat(e);const 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;return 24*(+t[1]||0)*60*60+60*(+t[2]||0)*60+60*(+t[3]||0)+(+t[4]||0)+(+t[5]||0)/1e3+(+t[6]||0)/1e6+(+t[7]||0)/1e9}function Io(e,t){const s=e.indexOf(t);return-1!==s?parseFloat(e.substring(0,s)):-1}function No(e){if(!e)return 0;if(!isNaN(+e))return parseFloat(e);let t=Io(e,"Kb");return t>=0?1024*t:(t=Io(e,"Mb"),t>=0?t*Math.pow(1024,2):(t=Io(e,"Gb"),t>=0?t*Math.pow(1024,3):(t=Io(e,"Tb"),t>=0?t*Math.pow(1024,4):(t=Io(e,"Pb"),t>=0?t*Math.pow(1024,5):(t=Io(e,"Eb"),t>=0?t*Math.pow(1024,6):(t=Io(e,"Zb"),t>=0?t*Math.pow(1024,7):(t=Io(e,"b"),t>=0?t:0)))))))}function ko(e){return e?parseFloat(e):0}n(Po,"safeAssign"),n(Mo,"xmlEncode"),n(Eo,"espTime2Seconds"),n(Io,"unitTest"),n(No,"espSize2Bytes"),n(ko,"espSkew2Number");const jo=class _LocalisedXGMMLWriter{constructor(e){r(this,"graph"),r(this,"m_xgmml"),r(this,"m_visibleSubgraphs"),r(this,"m_visibleVertices"),r(this,"m_semiVisibleVertices"),r(this,"m_visibleEdges"),r(this,"noSpills"),this.graph=e,this.m_xgmml="",this.m_visibleSubgraphs={},this.m_visibleVertices={},this.m_semiVisibleVertices={},this.m_visibleEdges={}}calcVisibility(e,t,s,n){this.noSpills=n,e.forEach(e=>{this.graph.isVertex(e)?(this.calcInVertexVisibility(e,s),this.calcOutVertexVisibility(e,s)):this.graph.isEdge(e)?(this.calcInVertexVisibility(e.getSource(),s-1),this.calcOutVertexVisibility(e.getTarget(),s-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,s)=>{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});const s={};this.graph.edges.forEach((t,n)=>{t.getSource().__hpcc_parent!==t.getTarget().__hpcc_parent&&e===this.getCommonAncestor(t)&&(s[t.getSource().__hpcc_parent.__hpcc_id+"::"+t.getTarget().__hpcc_parent.__hpcc_id]||(s[t.getSource().__hpcc_parent.__hpcc_id+"::"+t.getTarget().__hpcc_parent.__hpcc_id]=!0,this.m_visibleEdges[t.__hpcc_id]=t))})}buildVertexString(e,t){let s="",n="";const r=e.getProperties();for(const i in r)t&&i.indexOf("_kind")>=0?n+='<att name="_kind" value="point"/>':"id"===i||"label"===i?s+=" "+i+'="'+Mo(r[i])+'"':n+='<att name="'+i+'" value="'+Mo(r[i])+'"/>';return"<node"+s+">"+n+"</node>"}buildEdgeString(e){let t="",s="";const n=e.getProperties();for(const r in n)"id"===r.toLowerCase()||"label"===r.toLowerCase()||"source"===r.toLowerCase()||"target"===r.toLowerCase()?t+=" "+r+'="'+Mo(n[r])+'"':s+='<att name="'+r+'" value="'+Mo(n[r])+'"/>';return"<edge"+t+">"+s+"</edge>"}getAncestors(e,t){let s=e.__hpcc_parent;for(;s;)t.push(s),s=s.__hpcc_parent}getCommonAncestorV(e,t){const s=[],n=[];this.getAncestors(e,s),this.getAncestors(t,n);let r=s.length-1,i=n.length-1,o=null;for(;r>=0&&i>=0&&s[r]===n[i];)o=s[r],--r,--i;return o}getCommonAncestor(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())}calcAncestorVisibility(e){const t=[];this.getAncestors(e,t),t.forEach((e,t)=>{this.m_visibleSubgraphs[e.__hpcc_id]=e})}calcVisibility2(){for(const e in this.m_visibleVertices){const 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(const e in this.m_visibleEdges){const t=this.m_visibleEdges[e];let s=t.getSource();for(this.addSemiVisibleVertex(s);this.noSpills&&s.isSpill();){const e=s.getInEdges();if(!e.length)break;this.addSemiVisibleEdge(e[0]),s=e[0].getSource(),this.addSemiVisibleVertex(s)}let n=t.getTarget();for(this.addSemiVisibleVertex(n);this.noSpills&&n.isSpill();){const e=n.getOutEdges();if(!e.length)break;this.addSemiVisibleEdge(e[0]),n=e[0].getTarget(),this.addSemiVisibleVertex(n)}}}writeXgmml(){this.subgraphVisited(this.graph.subgraphs[0],!0),this.graph.edges.forEach((e,t)=>{this.edgeVisited(e)})}subgraphVisited(e,t=!1){if(this.m_visibleSubgraphs[e.__hpcc_id]){let s="";this.m_xgmml+=t?"":'<node id="'+e.__hpcc_id+'"><att><graph>';const n=this.m_xgmml.length;if(e.walkSubgraphs(this),e.walkVertices(this),n===this.m_xgmml.length){const t=e.__hpcc_vertices[0];t&&(this.m_xgmml+=this.buildVertexString(t,!0))}const r=e.getProperties();for(const e in r)s+='<att name="'+e+'" value="'+Mo(r[e])+'"/>';this.m_xgmml+=t?"":"</graph></att>"+s+"</node>"}return!1}vertexVisited(e){this.m_visibleVertices[e.__hpcc_id]?this.m_xgmml+=this.buildVertexString(e,!1):this.m_semiVisibleVertices[e.__hpcc_id]&&(this.m_xgmml+=this.buildVertexString(e,!0))}edgeVisited(e){this.m_visibleEdges[e.__hpcc_id]&&(this.m_xgmml+=this.buildEdgeString(e))}};n(jo,"LocalisedXGMMLWriter");let Go=jo;const Vo=class _GraphItem{constructor(e,t){r(this,"__hpcc_graph"),r(this,"__hpcc_parent"),r(this,"__widget"),r(this,"__hpcc_id"),r(this,"_globalID"),this.__hpcc_graph=e,this.__hpcc_id=t,this._globalID=t}getProperties(){const e={};for(const t in this)0!==t.indexOf("__")&&this.hasOwnProperty(t)&&(e[t]=this[t]);return e}};n(Vo,"GraphItem");let Qo=Vo;const Bo=class _Subgraph extends Qo{constructor(e,t){super(e,t),r(this,"_globalType"),r(this,"__hpcc_subgraphs"),r(this,"__hpcc_vertices"),r(this,"__hpcc_edges"),r(this,"id"),this._globalType="0"===t?"Graph":"Cluster",this.__hpcc_subgraphs=[],this.__hpcc_vertices=[],this.__hpcc_edges=[],this.id=t}addSubgraph(e){e.__hpcc_parent=this,this.__hpcc_subgraphs.some(t=>e===t)||this.__hpcc_subgraphs.push(e)}addVertex(e){e.__hpcc_parent=this,this.__hpcc_vertices.some(t=>e===t)||this.__hpcc_vertices.push(e)}removeVertex(e){this.__hpcc_vertices=this.__hpcc_vertices.filter(t=>e!==t)}addEdge(e){e.__hpcc_parent=this,this.__hpcc_edges.some(t=>e===t)||this.__hpcc_edges.push(e)}removeEdge(e){this.__hpcc_edges=this.__hpcc_edges.filter(t=>e!==t)}remove(){this.__hpcc_subgraphs.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),this.__hpcc_vertices.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),this.__hpcc_edges.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),delete this.__hpcc_parent,this.__hpcc_graph.removeItem(this)}walkSubgraphs(e){this.__hpcc_subgraphs.forEach((t,s)=>{e.subgraphVisited(t)&&t.walkSubgraphs(e)})}walkVertices(e){this.__hpcc_vertices.forEach((t,s)=>{e.vertexVisited(t)})}};n(Bo,"Subgraph");let Oo=Bo;const Xo=class _Vertex extends Qo{constructor(e,t){super(e,t),r(this,"_globalType","Vertex"),r(this,"_isSpill")}isSpill(){return this._isSpill}remove(){var e;const t=this.getInVertices();t.length<=1&&console.warn(this.__hpcc_id+": remove only supports single or zero inputs activities..."),this.getInEdges().forEach(e=>{e.remove()}),this.getOutEdges().forEach(e=>{e.setSource(t[0])}),null==(e=this.__hpcc_parent)||e.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)}};n(Xo,"Vertex");let $o=Xo;const Jo=class _Edge extends Qo{constructor(e,t){super(e,t),r(this,"_globalType","Edge"),r(this,"_sourceActivity"),r(this,"source"),r(this,"_targetActivity"),r(this,"target"),this._globalType="Edge"}remove(){this.__hpcc_graph.subgraphs.forEach(e=>{e.removeEdge(this)}),this.__hpcc_graph.removeItem(this)}getSource(){return this.__hpcc_graph.idx[this._sourceActivity||this.source]}setSource(e){this._sourceActivity?this._sourceActivity=e.__hpcc_id:this.source&&(this.source=e.__hpcc_id),this.__widget&&this.__widget.setSource(this.getSource().__widget)}getTarget(){return this.__hpcc_graph.idx[this._targetActivity||this.target]}};n(Jo,"Edge");let Ho=Jo;const qo=class _QueryGraph{constructor(){r(this,"idx",{}),r(this,"subgraphs",[]),r(this,"vertices",[]),r(this,"edges",[]),r(this,"xgmml",""),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;const t=(new DOMParser).parseFromString(e,"text/xml");this.walkDocument(t.documentElement,"0")}isSubgraph(e){return e instanceof Oo}isVertex(e){return e instanceof $o}isEdge(e){return e instanceof Ho}getGlobalType(e){return e instanceof $o?3:e instanceof Ho?4:e instanceof Oo?2:e instanceof _QueryGraph?1:0}getGlobalTypeString(e){return e instanceof $o?"Vertex":e instanceof Ho?"Edge":e instanceof Oo?"Cluster":e instanceof _QueryGraph?"Graph":"Unknown"}getItem(e,t){if(!this.idx[t])switch(e.tagName){case"graph":const e=new Oo(this,t);this.subgraphs.push(e),this.idx[t]=e;break;case"node":const s=new $o(this,t);this.vertices.push(s),this.idx[t]=s;break;case"edge":const n=new Ho(this,t);this.edges.push(n),this.idx[t]=n;break;default:console.warn("Graph.getItem - Unknown Node Type!")}const s=this.idx[t];return Array.from(e.attributes).forEach(e=>{Po(s,e.name,e.value)}),s}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof Oo?this.subgraphs=this.subgraphs.filter(t=>e!==t):e instanceof $o?this.vertices=this.vertices.filter(t=>e!==t):e instanceof Ho&&(this.edges=this.edges.filter(t=>e!==t))}getChildByTagName(e,t){let s=null;return Array.from(e.childNodes).some(e=>{if(e.tagName===t)return s=e,!0}),s}walkDocument(e,t){const s=this.getItem(e,t);return e.childNodes.forEach(e=>{if(1===e.nodeType)switch(e.tagName){case"graph":break;case"node":let t=!1;const n=this.getChildByTagName(e,"att");if(n){const r=this.getChildByTagName(n,"graph");if(r){t=!0;const n=this.walkDocument(r,e.getAttribute("id"));s.addSubgraph(n)}}if(!t){const t=this.walkDocument(e,e.getAttribute("id"));s.addVertex(t)}break;case"att":const r=e.getAttribute("name"),i="_"+r,o=e.getAttribute("value");0===r.indexOf("Time")?(Po(s,i,o),Po(s,r,""+Eo(o))):0===r.indexOf("Size")?(Po(s,i,o),Po(s,r,""+No(o))):0===r.indexOf("Skew")?(Po(s,i,o),Po(s,r,""+ko(o))):Po(s,r,o);break;case"edge":const c=this.walkDocument(e,e.getAttribute("id"));if(void 0!==c.NumRowsProcessed?c._eclwatchCount=c.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):void 0!==c.Count?c._eclwatchCount=c.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):void 0!==c.count&&(c._eclwatchCount=c.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),c.inputProgress&&(c._eclwatchInputProgress="["+c.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),c.SkewMaxRowsProcessed&&c.SkewMinRowsProcessed&&(c._eclwatchSkew="+"+c.SkewMaxRowsProcessed+", "+c.SkewMinRowsProcessed),c._dependsOn);else if(c._childGraph);else if(c._sourceActivity||c._targetActivity){c._isSpill=!0;const e=c.getSource();e&&(e._isSpill=!0);const t=c.getTarget();t&&(t._isSpill=!0)}s.addEdge(c)}}),s}removeSubgraphs(){[...this.subgraphs].forEach(e=>{e.__hpcc_parent instanceof Oo&&e.remove()})}removeSpillVertices(){[...this.vertices].forEach(e=>{e.isSpill()&&e.remove()})}getLocalisedXGMML(e,t,s,n){const r=new Go(this);return r.calcVisibility(e,t,s,n),r.writeXgmml(),"<graph>"+r.m_xgmml+"</graph>"}};n(qo,"QueryGraph");let zo=qo;const Yo=t.scopedLogger("@hpcc-js/comms/ecl/query.ts"),Zo=As("~s");function Ko(e){return!isNaN(parseFloat(e))&&!isNaN(e-0)}n(Ko,"isNumber");const ec=class _QueryCache extends t.Cache{constructor(){super(e=>t.Cache.hash([e.QueryId,e.QuerySet]))}};n(ec,"QueryCache");const tc=new ec,sc=class _Query extends t.StateObject{constructor(e,t,s,n){super(),r(this,"wsWorkunitsService"),r(this,"topology"),r(this,"_requestSchema"),r(this,"_responseSchema"),r(this,"_eclService"),this.wsWorkunitsService=e instanceof ls?e:new ls(e),this.topology=Lo.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:t,QueryId:s,...n})}get BaseUrl(){return this.wsWorkunitsService.baseUrl}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")}static attach(e,t,s,n){const r=tc.get({BaseUrl:e.baseUrl,QuerySet:t,QueryId:s},()=>new _Query(e,t,s));return n&&r.set(n),r}async wsEclService(){return this._eclService||(this._eclService=this.topology.fetchServices({}).then(e=>{var t,s;for(const n of(null==(t=null==e?void 0:e.TpEspServers)?void 0:t.TpEspServer)??[])for(const e of(null==(s=null==n?void 0:n.TpBindings)?void 0:s.TpBinding)??[])if("ws_ecl"===(null==e?void 0:e.Service)){const t=`${e.Protocol}://${globalThis.location.hostname}:${e.Port}`;return new Ie({baseUrl:t})}})),this._eclService}async fetchDetails(){const e=await this.wsWorkunitsService.WUQueryDetails({QuerySet:this.QuerySet,QueryId:this.QueryId,IncludeStateOnClusters:!0,IncludeSuperFiles:!0,IncludeWsEclAddresses:!0,CheckAllNodes:!1});this.set({...e})}async fetchRequestSchema(){const e=await this.wsEclService();try{this._requestSchema=await(null==e?void 0:e.requestJson(this.QuerySet,this.QueryId))??[]}catch(t){Yo.debug(t.message??t),this._requestSchema=[]}}async fetchResponseSchema(){const e=await this.wsEclService();try{this._responseSchema=await(null==e?void 0:e.responseJson(this.QuerySet,this.QueryId))??{}}catch(t){Yo.debug(t.message??t),this._responseSchema={}}}async fetchSchema(){await Promise.all([this.fetchRequestSchema(),this.fetchResponseSchema()])}fetchSummaryStats(){return this.wsWorkunitsService.WUQueryGetSummaryStats({Target:this.QuerySet,QueryId:this.QueryId})}fetchGraph(e="",t=""){return this.wsWorkunitsService.WUQueryGetGraph({Target:this.QuerySet,QueryId:this.QueryId,GraphName:e,SubGraphId:t}).then(e=>{var t;const s=new zo;let n=!0;for(const r of(null==(t=null==e?void 0:e.Graphs)?void 0:t.ECLGraphEx)||[])n?(s.load(r.Graph),n=!1):s.merge(r.Graph);return s})}fetchDetailsNormalized(e={}){const t=eo.attach(this.wsWorkunitsService,this.Wuid);return t?Promise.all([this.fetchGraph(),t.fetchDetailsMeta(),t.fetchDetailsRaw(e)]).then(e=>{const s=e[0],n=e[1],r=e[2].map(e=>{const t=e.Id[0];if("a"===t||"e"===t){const t=s.idx[e.Id.substring(1)];if(!t)return Yo.debug(`Missing graph data for metric ID: ${e.Id}`),e;const n=new Set(e.Properties.Property.map(e=>e.Name)),r=[];for(const e in t){const s=e.charAt(0);if("_"!==s&&s===s.toUpperCase()&&!n.has(e)){const s=t[e],n=typeof s;if("string"===n||"number"===n||"boolean"===n){let t=Ko(s)?parseFloat(s):s,n=s;e.indexOf("Time")>=0&&(t/=1e9,n=Zo(t)+"s"),r.push({Name:e,RawValue:t,Formatted:n})}}}r.length>0&&e.Properties.Property.push(...r)}return e});return t.normalizeDetails(n,r)}):Promise.resolve({meta:void 0,columns:void 0,data:void 0})}async submit(e){const t=await this.wsEclService();try{return(null==t?void 0:t.submit(this.QuerySet,this.QueryId,e).then(e=>{for(const t in e)e[t]=e[t].Row;return e}))??[]}catch(s){return Yo.debug(s.message??s),[]}}async refresh(){return await Promise.all([this.fetchDetails(),this.fetchSchema()]),this}requestFields(){return this._requestSchema?this._requestSchema:[]}responseFields(){return this._responseSchema?this._responseSchema:{}}resultNames(){const e=[];for(const t in this.responseFields())e.push(t);return e}resultFields(e){return this._responseSchema[e]?this._responseSchema[e]:[]}};n(sc,"Query");let nc=sc;const rc=class _StoreCache extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}};n(rc,"StoreCache");let ic=rc;const oc=new ic,cc=class _ValueChangedMessage extends t.Message{constructor(e,t,s){super(),this.key=e,this.value=t,this.oldValue=s}get canConflate(){return!0}conflate(e){return this.key===e.key&&(this.value=e.value,!0)}void(){return this.value===this.oldValue}};n(cc,"ValueChangedMessage");let uc=cc;const ac=class _Store{constructor(e,s,n,i){r(this,"connection"),r(this,"Name"),r(this,"UserSpecific"),r(this,"Namespace"),r(this,"_dispatch",new t.Dispatch),r(this,"_knownValues",{}),this.connection=e instanceof Et?e:new Et(e),this.Name=s,this.UserSpecific=i,this.Namespace=n}get BaseUrl(){return this.connection.baseUrl}static attach(e,t="HPCCApps",s,n=!0){return oc.get({BaseUrl:e.baseUrl,Name:t,UserSpecific:n,Namespace:s},()=>new _Store(e,t,s,n))}create(){this.connection.CreateStore({Name:this.Name,UserSpecific:this.UserSpecific,Type:"",Description:""})}set(e,t,s=!0){return this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e,Value:t}).then(n=>{const r=this._knownValues[e];this._knownValues[e]=t,s&&this._dispatch.post(new uc(e,t,r))}).catch(s=>{console.error(`Store.set("${e}", "${t}") failed:`,s)})}get(e,t=!0){return this.connection.Fetch({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(s=>{const n=this._knownValues[e];return this._knownValues[e]=s.Value,t&&this._dispatch.post(new uc(e,s.Value,n)),s.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=>{const s={},n=this._knownValues;if(this._knownValues={},t.Pairs.Pair.forEach(t=>{const r=this._knownValues[t.Key];this._knownValues[t.Key]=t.Value,delete n[t.Key],s[t.Key]=t.Value,e&&this._dispatch.post(new uc(t.Key,t.Value,r))}),e)for(const e in n)this._dispatch.post(new uc(e,void 0,n[e]));return s}).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(s=>{const n=this._knownValues[e];delete this._knownValues[e],t&&this._dispatch.post(new uc(e,void 0,n))}).catch(t=>{console.error(`Store.delete(${e}) failed:`,t)})}monitor(e){return this._dispatch.attach(e)}};n(ac,"Store");let hc=ac;const lc=t.scopedLogger("@hpcc-js/comms/dfuWorkunit.ts"),dc=class _DFUWorkunitCache extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}};n(dc,"DFUWorkunitCache");let pc=dc;const gc=new pc,mc=class _DFUWorkunit extends t.StateObject{constructor(e,t){super(),r(this,"connection"),r(this,"topologyConnection"),this.connection=new j(e),this.topologyConnection=new Vt(e),this.clearState(t)}get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get ID(){return this.get("ID")}get DFUServerName(){return this.get("DFUServerName")}get ClusterName(){return this.get("ClusterName")}get JobName(){return this.get("JobName")}get Queue(){return this.get("Queue")}get User(){return this.get("User")}get isProtected(){return this.get("isProtected")}get Command(){return this.get("Command")}get CommandMessage(){return this.get("CommandMessage")}get PercentDone(){return this.get("PercentDone")}get SecsLeft(){return this.get("SecsLeft")}get ProgressMessage(){return this.get("ProgressMessage")}get SummaryMessage(){return this.get("SummaryMessage")}get State(){return this.get("State",0)}get SourceLogicalName(){return this.get("SourceLogicalName")}get SourceIP(){return this.get("SourceIP")}get SourceFilePath(){return this.get("SourceFilePath")}get SourceDali(){return this.get("SourceDali")}get SourceRecordSize(){return this.get("SourceRecordSize")}get SourceFormat(){return this.get("SourceFormat")}get RowTag(){return this.get("RowTag")}get SourceNumParts(){return this.get("SourceNumParts")}get SourceDirectory(){return this.get("SourceDirectory")}get DestLogicalName(){return this.get("DestLogicalName")}get DestGroupName(){return this.get("DestGroupName")}get DestDirectory(){return this.get("DestDirectory")}get DestIP(){return this.get("DestIP")}get DestFilePath(){return this.get("DestFilePath")}get DestFormat(){return this.get("DestFormat")}get DestNumParts(){return this.get("DestNumParts")}get DestRecordSize(){return this.get("DestRecordSize")}get Replicate(){return this.get("Replicate")}get Overwrite(){return this.get("Overwrite")}get Compress(){return this.get("Compress")}get SourceCsvSeparate(){return this.get("SourceCsvSeparate")}get SourceCsvQuote(){return this.get("SourceCsvQuote")}get SourceCsvTerminate(){return this.get("SourceCsvTerminate")}get SourceCsvEscape(){return this.get("SourceCsvEscape")}get TimeStarted(){return this.get("TimeStarted")}get TimeStopped(){return this.get("TimeStopped")}get StateMessage(){return this.get("StateMessage")}get MonitorEventName(){return this.get("MonitorEventName")}get MonitorSub(){return this.get("MonitorSub")}get MonitorShotLimit(){return this.get("MonitorShotLimit")}get SourceDiffKeyName(){return this.get("SourceDiffKeyName")}get DestDiffKeyName(){return this.get("DestDiffKeyName")}get Archived(){return this.get("Archived")}get encrypt(){return this.get("encrypt")}get decrypt(){return this.get("decrypt")}get failIfNoSourceFile(){return this.get("failIfNoSourceFile")}get recordStructurePresent(){return this.get("recordStructurePresent")}get quotedTerminator(){return this.get("quotedTerminator")}get preserveCompression(){return this.get("preserveCompression")}get expireDays(){return this.get("expireDays")}get PreserveFileParts(){return this.get("PreserveFileParts")}get FileAccessCost(){return this.get("FileAccessCost")}get KbPerSecAve(){return this.get("KbPerSecAve")}get KbPerSec(){return this.get("KbPerSec")}static create(e,t){const s=new _DFUWorkunit(e);return s.connection.CreateDFUWorkunit({DFUServerQueue:t}).then(e=>(gc.set(s),s.set(e.result),s))}static attach(e,t,s){const n=gc.get({BaseUrl:e.baseUrl,ID:t},()=>new _DFUWorkunit(e,t));return s&&n.set(s),n}static sprayFixed(e,t){const s=new j(e);return s.SprayFixedEx({...t}).then(t=>{const n=t.wuid;return s.GetDFUWorkunit({wuid:n}).then(t=>_DFUWorkunit.attach(e,n,t.result))})}static sprayVariable(e,t){const s=new j(e);return s.SprayVariableEx({...t}).then(t=>{const n=t.wuid;return s.GetDFUWorkunit({wuid:n}).then(t=>_DFUWorkunit.attach(e,n,t.result))})}static despray(e,t){const s=new j(e);return s.DesprayEx({...t}).then(t=>{const n=t.wuid;return s.GetDFUWorkunit({wuid:n}).then(t=>_DFUWorkunit.attach(e,n,t.result))})}update(e){var t,s;return this.connection.UpdateDFUWorkunitEx({wu:{JobName:(null==(t=null==e?void 0:e.wu)?void 0:t.JobName)??this.JobName,isProtected:(null==(s=null==e?void 0:e.wu)?void 0:s.isProtected)??this.isProtected,ID:this.ID,State:this.State},ClusterOrig:this.ClusterName,JobNameOrig:this.JobName,isProtectedOrig:this.isProtected,StateOrig:this.State})}isComplete(){switch(this.State){case 6:case 5:case 4:case 999:return!0}return!1}isFailed(){return!(!this.isComplete()||6===this.State)}isDeleted(){return 999===this.State}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(e.FileSpray.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(){this.isComplete()?this._monitorTickCount=0:super._monitor()}_monitorTimeoutDuration(){const 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(t){return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:t}).then(s=>t===e.FileSpray.DFUWUActions.Delete?s:this.refresh().then(()=>(this._monitor(),s)))}on(e,t,s){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 if("changed"===e)super.on(e,t,s);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,s)=>{const n=this.watch(s=>{e&&e(s),this.isComplete()&&(n.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,s)=>{const n=this.watch(s=>{e&&e(s),(this.isComplete()||this.isRunning())&&(n.release(),t(this))})})}clearState(e){this.clear({ID:e,State:0})}GetDFUWorkunit(e={}){return this.connection.GetDFUWorkunit({...e,wuid:this.ID}).then(e=>(this.set(e.result),e)).catch(e=>{if(!e.Exception.some(e=>(20080===e.Code||20081===e.Code)&&(this.clearState(this.ID),this.set("State",999),!0)))throw lc.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}};n(mc,"DFUWorkunit");let Sc=mc;e.AccessService=q,e.AccountService=K,e.Activity=co,e.Attribute=Wi,e.BUILD_VERSION="3.9.0",e.BaseScope=Fi,e.CloudService=ce,e.CodesignService=ae,e.Connection=C,e.DFUArrayActions=Re,e.DFUChangeProtection=be,e.DFUChangeRestriction=Fe,e.DFUDefFileFormat=We,e.DFUService=Ae,e.DFUWorkunit=Sc,e.DFUWorkunitCache=pc,e.DFUXRefService=xe,e.DaliService=pe,e.ECLGraph=Lr,e.ESPConnection=w,e.ESPExceptions=b,e.EclService=Ie,e.ElkService=Ge,e.FileSprayService=j,e.FileSprayStates=N,e.GlobalResultCache=_i,e.GraphCache=Mr,e.LogType=Ke,e.LogaccessService=st,e.LogicalFile=go,e.LogicalFileCache=ho,e.Machine=Uo,e.MachineCache=So,e.MachineService=dt,e.PKG_NAME="@hpcc-js/comms",e.PKG_VERSION="3.7.6",e.PackageProcessService=St,e.PropertyType=Gi,e.Query=nc,e.QueryGraph=zo,e.RelatedProperty=Vi,e.Resource=si,e.ResourcesService=vt,e.Result=yi,e.ResultCache=Di,e.SMCService=Pt,e.SashaService=bt,e.Scope=Ai,e.ScopeEdge=Kr,e.ScopeGraph=Jr,e.ScopeSubgraph=qr,e.ScopeVertex=Yr,e.Service=L,e.SourceFile=xi,e.Store=hc,e.StoreCache=ic,e.StoreService=Et,e.TargetAudience=et,e.TargetCluster=Ro,e.TargetClusterCache=yo,e.Timer=Pi,e.Topology=Lo,e.TopologyCache=Ao,e.TopologyService=Vt,e.ValueChangedMessage=uc,e.WUStateID=os,e.Workunit=eo,e.WorkunitCache=Yi,e.WorkunitsService=ls,e.WorkunitsServiceEx=ps,e.XGMMLEdge=Or,e.XGMMLGraph=kr,e.XGMMLSubgraph=Gr,e.XGMMLVertex=Qr,e.XSDNode=ri,e.XSDSchema=hi,e.XSDSimpleType=ui,e.XSDXMLNode=oi,e.createGraph=ei,e.createXGMMLGraph=Xr,e.defaultTargetCluster=Fo,e.deserializeResponse=l,e.get=f,e.hookSend=v,e.instanceOfIConnection=u,e.instanceOfIOptions=o,e.isArray=R,e.isECLResult=cs,e.isExceptions=F,e.isWUInfoWorkunit=as,e.isWUQueryECLWorkunit=us,e.jsonp=d,e.parseXSD=pi,e.parseXSD2=Si,e.post=S,e.send=_,e.serializeRequest=h,e.setTransportFactory=D,e.splitMetric=Xi,e.targetClusters=Wo,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
7
2
|
//# sourceMappingURL=index.umd.cjs.map
|