
static.chunk-JDQFJQYG.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yamcs-web Show documentation
Show all versions of yamcs-web Show documentation
Web UI for managing and monitoring Yamcs
import{b as Kn,d as Xn,e as Jn,f as Zn,g as ea,h as Xt,i as ta,j as ia,k as na}from"./chunk-5B27UED5.js";import"./chunk-QM2DDFCD.js";import{a as Hn}from"./chunk-TTKZFK6X.js";import{a as Un,b as qn}from"./chunk-AI76W7LZ.js";import{a as Qn}from"./chunk-CS6YXD3A.js";import{a as zn}from"./chunk-FH5UYMLA.js";import{f as tt}from"./chunk-RL3R2NWK.js";import{a as ke,c as be,d as Ei,e as Wn}from"./chunk-AD76HIUY.js";import{$e as We,A as Bi,Aa as d,Ac as Ge,Ae as gn,Ba as j,Be as Cn,Bg as et,C as Li,Ca as B,Cb as qe,Cc as te,Ce as At,D as Ct,Db as Ji,Dc as on,De as It,E as yt,Ea as F,Eb as Zi,Ec as G,Ef as le,Eg as zt,Fa as g,Fb as en,Fc as Dt,Fe as $t,Ff as ze,Ga as u,Gb as tn,Ge as yn,H as we,Ha as qi,Hb as bt,Hc as Ft,Hf as qt,I as Yi,Ia as Hi,Ib as xt,Ic as U,Ie as hn,Jb as ve,Jc as rn,Je as vn,Jg as Bn,Ka as ne,Kb as nn,Kc as Tt,Ke as Sn,Kf as Mn,Kg as Kt,L as x,La as ae,Lc as q,Le as Rt,Ma as oe,Mc as ln,Na as Wi,Nc as cn,Nf as Pn,O as Gi,Oa as Qi,Oc as sn,Of as Ke,Og as Ln,Pa as X,Pc as mn,Qa as l,Qc as pn,Qf as Ht,R as S,Ra as de,Rc as Mt,Re as Me,S as k,Sa as D,Se as Pe,Sf as Wt,Ta as xi,Tc as se,Te as jt,Uc as ge,Uf as Xe,Va as ht,Ve,Vf as Vn,Wa as E,Wc as He,We as Bt,Wf as Je,Xa as Ue,Xg as Yn,Ya as re,Yc as Pt,Ye as Oe,Yf as On,Z as Q,Zc as Vt,Ze as kn,Zg as Gn,_b as an,_c as Fe,a as K,ab as C,af as Lt,ba as bi,bb as y,bh as M,cb as Ye,cd as dn,cf as Ne,d as ki,da as rt,dd as Ot,df as Qe,ed as Nt,eg as Nn,f as N,fa as c,ff as bn,ga as _,gf as xn,gg as $e,hb as vt,hf as En,hg as Ze,hh as w,i as Ni,if as wn,ih as Re,ja as lt,jd as ct,je as un,jf as Dn,jg as An,jh as wi,k as Ai,ka as Ui,kb as St,kh as Di,l as Ii,lb as kt,lf as Ae,m as _t,na as f,ng as In,oe as H,of as Fn,og as $n,pa as p,pc as Et,pe as me,pf as Ie,qe as Te,ra as pe,rb as ee,re as W,rg as Qt,s as gt,sb as zi,sc as wt,se as ie,t as $i,te as J,tf as Yt,ua as h,uc as ce,ue as Z,uf as Gt,ug as Se,v as Ri,va as A,vf as O,vg as Rn,wa as I,wb as Ki,wc as L,x as ji,xa as $,xf as Ut,ya as o,yb as Xi,yc as V,ye as fn,yf as Tn,za as r,zc as Y,ze as _n,zf as Ce,zg as jn}from"./chunk-7FNOC45H.js";var Jt=class n{constructor(t,e){this.dialogRef=t;this.form=e.group({executionTime:["",[L.required]],tags:[[],[]]})}schedule(){this.dialogRef.close(this.form.value)}static{this.\u0275fac=function(e){return new(e||n)(_(H),_(se))}}static{this.\u0275cmp=x({type:n,selectors:[["app-schedule-script-dialog"]],standalone:!0,features:[E],decls:26,vars:4,consts:[["mat-dialog-title",""],[1,"hint"],[1,"ya-form",3,"formGroup"],[1,"label"],["formControlName","executionTime",3,"showMillis","showNow"],[1,"half-break"],["dialogTitle","Timeline Tags"],["formControlName","tags"],["align","end"],[2,"flex","1 1 auto"],["mat-dialog-close",""],["appearance","primary",3,"click","disabled"]],template:function(e,i){e&1&&(o(0,"h2",0),l(1,"Run later"),r(),o(2,"mat-dialog-content")(3,"div",1)(4,"p"),l(5,"This script will be submitted to the Yamcs Timeline, for execution at a later time."),r()(),o(6,"form",2)(7,"div",3),l(8," Execution time "),d(9,"br")(10,"ya-date-time-input",4),r(),d(11,"hr",5),o(12,"div",3),l(13," Timeline tags "),o(14,"span",1),l(15,"(optional)"),r(),o(16,"ya-help",6),l(17," Tags allow to categorise items per band. Bands only show items for which one of the tags is matching. "),r(),d(18,"br")(19,"ya-tag-select",7),r()()(),o(20,"mat-dialog-actions",8),d(21,"div",9),o(22,"ya-button",10),l(23,"CANCEL"),r(),o(24,"ya-button",11),g("click",function(){return i.schedule()}),l(25,"SCHEDULE"),r()()),e&2&&(c(6),p("formGroup",i.form),c(4),p("showMillis",!0)("showNow",!0),c(14),p("disabled",!i.form.valid))},dependencies:[w,G,V,Y,U,q,W,ie,Z,J,O,qt,Je,Qt],encapsulation:2,changeDetection:0})}};function pa(n,t){if(n&1){let e=F();l(0," \xA0 "),d(1,"ya-icon-action",9),o(2,"mat-menu",10,0)(4,"button",11),g("click",function(){S(e);let a=u();return k(a.runScript())}),l(5,"Run now"),r(),o(6,"button",11),g("click",function(){S(e);let a=u();return k(a.openScheduleScriptDialog())}),l(7,"Run later..."),r()()}if(n&2){let e=X(3),i=u();c(),p("matMenuTriggerFor",i.form.valid?e:null)("padding",!1)("disabled",!i.form.valid),c(),p("overlapTrigger",!1)}}var Zt=class n{constructor(t,e,i,a,s,m,v){this.yamcs=i;this.messageService=a;this.authService=s;this.router=m;this.dialog=v;this.scriptOptions$=new N([]);t.setTitle("Run a script"),this.form=e.group({script:["",[L.required]],args:[""]}),i.yamcsClient.getActivityScripts(this.yamcs.instance).then(b=>{for(let z of b.scripts||[])this.scriptOptions$.next([...this.scriptOptions$.value,{id:z,label:z}])}).catch(b=>a.showError(b))}runScript(){let t=this.createActivityDefinition();this.yamcs.yamcsClient.startActivity(this.yamcs.instance,t).then(e=>{this.authService.getUser().hasSystemPrivilege("ReadActivities")?this.router.navigateByUrl(`/activities/${e.id}?c=${this.yamcs.context}`):this.dialog.open(Vn,{width:"500px",data:{icon:"done",closeText:"OK",content:`
The procedure has started executing.
Note that you do not have sufficient privileges
to follow up on submitted procedures.
`}}).afterClosed().subscribe(()=>this.form.reset())}).catch(e=>this.messageService.showError(e))}showSchedule(){let t=this.yamcs.connectionInfo$.value?.instance?.capabilities||[];return t.indexOf("timeline")!==-1&&t.indexOf("activities")!==-1&&this.authService.getUser().hasSystemPrivilege("ControlTimeline")}openScheduleScriptDialog(){this.dialog.open(Jt,{width:"600px"}).afterClosed().subscribe(t=>{let e=this.form.value;if(t){let i={type:"ACTIVITY",duration:"0s",name:e.script,start:t.executionTime,tags:t.tags,activityDefinition:this.createActivityDefinition()};this.yamcs.yamcsClient.createTimelineItem(this.yamcs.instance,i).then(()=>{this.messageService.showInfo("Script scheduled"),this.router.navigateByUrl(`/activities?c=${this.yamcs.context}`)}).catch(a=>this.messageService.showError(a))}})}createActivityDefinition(){let t=this.form.value,e={type:"SCRIPT",args:{processor:this.yamcs.processor||null,script:t.script}};return t.args&&(e.args.args=t.args),e}static{this.\u0275fac=function(e){return new(e||n)(_(qe),_(se),_(M),_(Ae),_(Re),_(xt),_(Te))}}static{this.\u0275cmp=x({type:n,selectors:[["ng-component"]],standalone:!0,features:[E],decls:23,vars:6,consts:[["sendMenu","matMenu"],[1,"form-content","ya-form"],["novalidate","","autocomplete","off",3,"formGroup"],[1,"label"],[1,"hint"],["formControlName","script",3,"options"],["type","text","formControlName","args"],[2,"flex","1 1 auto"],["appearance","primary",3,"click","disabled"],["icon","arrow_drop_down",2,"line-height","12px",3,"matMenuTriggerFor","padding","disabled"],[1,"ya-menu",3,"overlapTrigger"],["mat-menu-item","",3,"click"]],template:function(e,i){e&1&&(o(0,"app-instance-page")(1,"app-instance-toolbar"),l(2,"Run a script"),r(),o(3,"div",1)(4,"form",2)(5,"div",3),l(6," Script "),o(7,"span",4),l(8,"(required)"),r(),d(9,"br")(10,"ya-select",5),C(11,"async"),r(),d(12,"br"),o(13,"div",3),l(14," Script arguments "),d(15,"input",6),r()(),o(16,"p"),l(17,"\xA0"),r(),o(18,"mat-toolbar"),d(19,"span",7),o(20,"ya-button",8),g("click",function(){return i.runScript()}),l(21,"Run"),r(),f(22,pa,8,4),r()()()),e&2&&(c(4),p("formGroup",i.form),c(6),p("options",y(11,4,i.scriptOptions$)),c(10),p("disabled",!i.form.valid),c(2),h(i.showSchedule()?22:-1))},dependencies:[be,ke,w,ee,G,ce,V,Y,U,q,Pt,He,Vt,Ot,O,ze,Ke],encapsulation:2,changeDetection:0})}};var ei=class n{constructor(t){this.dialogRef=t}confirmDiscard(){this.dialogRef.close(!0)}static{this.\u0275fac=function(e){return new(e||n)(_(H))}}static{this.\u0275cmp=x({type:n,selectors:[["app-stack-file-page-dirty-dialog"]],standalone:!0,features:[E],decls:10,vars:0,consts:[["align","end"],["mat-dialog-close",""],["appearance","primary",3,"click"]],template:function(e,i){e&1&&(o(0,"mat-dialog-content")(1,"h3"),l(2,"Close without saving?"),r(),o(3,"p"),l(4,"You have unsaved changes, close without saving?"),r()(),o(5,"mat-dialog-actions",0)(6,"ya-button",1),l(7,"CANCEL"),r(),o(8,"ya-button",2),g("click",function(){return i.confirmDiscard()}),l(9,"OK"),r()())},dependencies:[w,W,Z,J,O],encapsulation:2})}};var it=class{constructor(t){this.executing=!1;this.model=t}get comment(){return this.model.comment}clearOutputs(){this.executionNumber=void 0,this.err=void 0}hasOutputs(){return!!this.err}},fe=class n extends it{constructor(e){super(e);this.type="command"}get name(){return this.model.name}get namespace(){return this.model.namespace}get args(){return this.model.args}get extra(){return this.model.extra}get stream(){return this.model.stream}get advancement(){return this.model.advancement}clearOutputs(){super.clearOutputs(),this.id=void 0,this.record=void 0}hasOutputs(){return super.hasOutputs()||!!this.record}copy(){let e=new n({type:"command",name:this.name,namespace:this.namespace,args:K({},this.args),comment:this.comment,stream:this.stream});return e.command=this.command,this.extra&&(e.model.extra=K({},this.extra)),this.advancement&&(e.model.advancement=K({},this.advancement)),e}toString(){let e=this.name;if(this.args){e+=" [";let i=!0;for(let a in this.args)i?i=!1:e+=", ",e+=`${a}=${this.args[a]}`;e+="]"}return e}},xe=class n extends it{constructor(e){super(e);this.type="verify"}get condition(){return this.model.condition}get delay(){return this.model.delay}get timeout(){return this.model.timeout}clearOutputs(){super.clearOutputs(),this.pvals=void 0}hasOutputs(){return super.hasOutputs()||!!this.pvals}copy(){return new n({type:"verify",condition:this.condition.map(e=>K({},e)),comment:this.comment})}toString(){let e="",i=!0;for(let a of this.condition||[]){switch(i?i=!1:e+=" AND ",e+=a.parameter,a.operator){case"eq":e+=" = ";break;case"neq":e+=" != ";break;case"lt":e+=" < ";break;case"lte":e+=" <= ";break;case"gt":e+=" > ";break;case"gte":e+=" >= ";break}e+=a.value}return e}test(e){let i=[];for(let s of this.condition){let m=e;i.push({parameter:s.parameter,pval:m[s.parameter]||null,status:lt(null)})}this.pvals=i;let a=!0;for(let s=0;sNumber(b)?m.status.set("ok"):(a=!1,m.status.set("pending"));break;case"gte":isNaN(v)||isNaN(b)?(a=!1,m.status.set("pending")):Number(v)>=Number(b)?m.status.set("ok"):(a=!1,m.status.set("pending"));break}}else{a=!1,m.status.set("pending");continue}}return a}},De=class n extends it{constructor(e){super(e);this.type="check"}get parameters(){return this.model.parameters}clearOutputs(){super.clearOutputs(),this.pvals=void 0}hasOutputs(){return super.hasOutputs()||!!this.pvals}copy(){return new n({type:"check",parameters:this.parameters.map(e=>K({},e)),comment:this.comment})}},Ee=class n extends it{constructor(e){super(e);this.type="text";this.renderedText=lt("")}get text(){return this.model.text}copy(){return new n({type:"text",text:this.text})}};function ra(n,t){let i=new DOMParser().parseFromString(n,"text/xml");return da(i.documentElement,t)}function da(n,t){let e=[];for(let i=0;i{for(let e of t)if(e.hasOutputs()||e.executionNumber!==void 0)return!0;return!1}));this.logs$=new N([]);this.bucket=t.getStackBucket(),this.storageClient=e.createStorageClient()}markDirty(){this.dirty$.next(!0)}addLogEntry(t,e){this.logs$.next([...this.logs$.value,{executionNumber:t,text:e,time:this.yamcs.getMissionTime().toISOString()}])}async canActivate(t,e){this.entries=[],this.objectName=t.params.objectName;let i=le.getExtension(le.getFilename(this.objectName))?.toLowerCase();try{let a=await this.storageClient.getObject(this.bucket,this.objectName);if(a.ok){let s=await a.text();if(i==="xml"||i==="ycs")await this.processStack(s,i);else return!1}}catch(a){return this.messageService.showError(a),!1}return!0}async processStack(t,e){switch(this.entries=[],e){case"ycs":let m;[m,this.advancement]=ca(t,this.configService.getCommandOptions());for(let b of m)b.type==="check"?this.entries.push(new De(b)):b.type==="command"?this.entries.push(new fe(b)):b.type==="text"?this.entries.push(new Ee(b)):b.type==="verify"?this.entries.push(new xe(b)):console.error("Unexpected step",b);break;case"xml":let v=ra(t,this.configService.getCommandOptions());for(let b of v)this.entries.push(new fe(b));break}let i=this.entries.filter(m=>m instanceof fe),a=[],s=this.yamcs.instance;for(let m of i){let v=m.namespace??null,b=m.name;a.push(this.yamcs.yamcsClient.getCommandForNamespace(s,v,b).then(z=>{m.command=z}))}for(let m of a)try{await m}catch{}for(let m of i)if(m.command)for(let v in m.args){let b=this.getArgument(v,m.command);if(b?.type.engType==="enumeration"){let z=!1;for(let ye of b.type.enumValue||[])if(ye.label===m.args[v]){z=!0;break}if(!z){for(let ye of b.type.enumValue||[])if(String(ye.value)===String(m.args[v])){m.args[v]=ye.label,z=!0;break}}}}if(e==="xml"){for(let m of i)if(m.command)for(let v in m.args)this.isComplex(v,m.command)&&(m.args[v]=JSON.parse(m.args[v]))}}getArgument(t,e){for(let i of e.argument||[])if(i.name===t)return i;return e.baseCommand?this.getArgument(t,e.baseCommand):null}isComplex(t,e){for(let i of e.argument||[])if(i.name===t)return i.type.engType==="aggregate"||i.type.engType.endsWith("[]");return e.baseCommand?this.isComplex(t,e.baseCommand):!1}updateEntries(t){this.renumberHeadings(t),this.entries$.next(t)}renumberHeadings(t){let e=[0,0,0,0,0,0];for(let i of t)if(i instanceof Ee){let a=[];for(let s of i.text.split(`
`))if(s.startsWith("# ")){e[0]++,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0;let m=`# ${e[0]}. `+s.slice(2);a.push(m)}else if(s.startsWith("## ")){e[1]++,e[2]=0,e[3]=0,e[4]=0,e[5]=0;let m=`## ${e[0]}.${e[1]}. `+s.slice(3);a.push(m)}else if(s.startsWith("### ")){e[2]++,e[3]=0,e[4]=0,e[5]=0;let m=`### ${e[0]}.${e[1]}.${e[2]}. `+s.slice(4);a.push(m)}else if(s.startsWith("#### ")){e[3]++,e[4]=0,e[5]=0;let m=`#### ${e[0]}.${e[1]}.${e[2]}.${e[3]}. `+s.slice(5);a.push(m)}else if(s.startsWith("##### ")){e[4]++,e[5]=0;let m=`##### ${e[0]}.${e[1]}.${e[2]}.${e[3]}.${e[4]}. `+s.slice(6);a.push(m)}else if(s.startsWith("###### ")){e[5]++;let m=`###### ${e[0]}.${e[1]}.${e[2]}.${e[3]}.${e[4]}.${e[5]}. `+s.slice(7);a.push(m)}else a.push(s);i.renderedText.set(a.join(`
`))}}saveStack(){let t=le.getExtension(le.getFilename(this.objectName))?.toLowerCase(),e=this.entries$.value.map(m=>m.model),i;switch(t){case"ycs":i=new Ie(e,{advancement:this.advancement}).toJSON();break;case"xml":i=new Ie(e,{advancement:this.advancement}).toXML();break;default:console.error("Unexpected format");return}let a=t==="xml"?"application/xml":"application/json",s=new Blob([i],{type:a});return this.storageClient.uploadObject(this.bucket,this.objectName,s).then(()=>{this.dirty$.next(!1)})}static{this.\u0275fac=function(e){return new(e||n)(we(Ce),we(M),we(Ae))}}static{this.\u0275prov=yt({token:n,factory:n.\u0275fac})}};var sa=n=>Yi(mt).canDeactivate(n),mt=class n{constructor(t,e,i,a){this.dialog=t;this.authService=e;this.stackFileService=a;this.dialogOpen$=new N(!1);this.bucket=i.getStackBucket()}canDeactivate(t){return this.dialogOpen$.value?new ki(e=>{this.dialogRef.afterClosed().subscribe({next:i=>{e.next(i===!0),e.complete()},error:()=>{e.next(!1),e.complete()}})}):this.stackFileService.dirty$.value&&this.mayManageStacks()?new ki(e=>{this.dialogOpen$.next(!0),this.dialogRef=this.dialog.open(ei,{width:"400px"}),this.dialogRef.afterClosed().subscribe({next:i=>{this.dialogOpen$.next(!1),e.next(i===!0),e.complete()},error:()=>{this.dialogOpen$.next(!1),e.next(!1),e.complete()}})}):Ni(!0)}mayManageStacks(){let t=this.authService.getUser();return t.hasObjectPrivilege("ManageBucket",this.bucket)||t.hasSystemPrivilege("ManageAnyBucket")}static{this.\u0275fac=function(e){return new(e||n)(we(Te),we(Re),we(Ce),we(_e))}}static{this.\u0275prov=yt({token:n,factory:n.\u0275fac})}};var va=["*"],Sa=()=>({exact:!0}),Ti=n=>({c:n}),Be=class n{constructor(t){this.yamcs=t;this.objectName=Q.required()}static{this.\u0275fac=function(e){return new(e||n)(_(M))}}static{this.\u0275cmp=x({type:n,selectors:[["app-stack-file-page-tabs"]],inputs:{objectName:[1,"objectName"]},standalone:!0,features:[E],ngContentSelectors:va,decls:16,vars:19,consts:[["rla","routerLinkActive"],["rlb","routerLinkActive"],["rlc","routerLinkActive"],["tabPanel",""],["mat-tab-nav-bar","",1,"secondary",3,"mat-stretch-tabs","tabPanel"],["mat-tab-link","","routerLinkActive","",3,"routerLink","routerLinkActiveOptions","active","queryParams"],["mat-tab-link","","routerLinkActive","",3,"routerLink","active","queryParams"],[2,"flex","1 1 auto"],[2,"align-self","center"]],template:function(e,i){if(e&1&&(qi(),o(0,"nav",4)(1,"a",5,0),l(3," Steps "),r(),o(4,"a",6,1),l(6," Log "),r(),o(7,"a",6,2),l(9," Settings "),r(),d(10,"span",7),o(11,"div",8),Hi(12),r()(),o(13,"mat-tab-nav-panel",null,3),d(15,"router-outlet"),r()),e&2){let a=X(2),s=X(5),m=X(8),v=X(14);p("mat-stretch-tabs",!1)("tabPanel",v),c(),p("routerLink","/procedures/stacks/files/"+i.objectName())("routerLinkActiveOptions",Ue(12,Sa))("active",a.isActive)("queryParams",re(13,Ti,i.yamcs.context)),c(3),p("routerLink","/procedures/stacks/files/"+i.objectName()+"/-/log")("active",s.isActive)("queryParams",re(15,Ti,i.yamcs.context)),c(3),p("routerLink","/procedures/stacks/files/"+i.objectName()+"/-/settings")("active",m.isActive)("queryParams",re(17,Ti,i.yamcs.context))}},dependencies:[w,bt,ve,nn,En,Dn,wn],styles:[".mat-mdc-tab-link[_ngcontent-%COMP%]{height:36px;min-width:0;font-size:13px}"],changeDetection:0})}};var ka=n=>({c:n});function ba(n,t){if(n&1&&(o(0,"tr")(1,"td",6),l(2),r(),o(3,"td",7),l(4),C(5,"datetime"),r(),o(6,"td",8),l(7),r()()),n&2){let e=t.$implicit;c(2),D("[",e.executionNumber,"]"),c(2),D(" [",Ye(5,3,e.time,!1),"] "),c(3),de(e.text)}}var ii=class n{constructor(t,e){this.yamcs=t;this.stackFileService=e;this.objectName=Q.required();this.folderLink=St(()=>{let t=this.objectName(),e=t.lastIndexOf("/");return e===-1?"/procedures/stacks/browse/":"/procedures/stacks/browse/"+t.substring(0,e)})}static{this.\u0275fac=function(e){return new(e||n)(_(M),_(_e))}}static{this.\u0275cmp=x({type:n,selectors:[["app-stack-file-log"]],inputs:{objectName:[1,"objectName"]},standalone:!0,features:[E],decls:15,vars:13,consts:[["icon","arrow_back",3,"routerLink","queryParams"],["matTooltip","Save stack","icon","save",3,"clicked","disabled"],[1,"main-pane"],[3,"objectName"],[1,"tab-content"],[1,"mono",2,"width","100%"],["width","1",2,"text-align","right"],["width","1",1,"time",2,"white-space","nowrap"],[1,"message"]],template:function(e,i){e&1&&(o(0,"app-instance-page")(1,"app-instance-toolbar"),d(2,"ya-page-icon-button",0),l(3),C(4,"basename"),o(5,"ya-page-button",1),C(6,"async"),g("clicked",function(){return i.stackFileService.saveStack()}),l(7," Save "),r()(),o(8,"div",2),d(9,"app-stack-file-page-tabs",3),o(10,"div",4)(11,"table",5),I(12,ba,8,6,"tr",null,A),C(14,"async"),r()()()()),e&2&&(c(2),p("routerLink",i.folderLink())("queryParams",re(11,ka,i.yamcs.context)),c(),D(" ",y(4,5,i.objectName())," \xA0\xA0\xA0 "),c(2),p("disabled",!y(6,7,i.stackFileService.dirty$)),c(4),p("objectName",i.objectName()),c(3),$(y(14,9,i.stackFileService.logs$)))},dependencies:[ke,be,Be,w,ee,ve,Fe,$e,Ze,et,zt],styles:[".main-pane[_ngcontent-%COMP%]{position:absolute;inset:0;padding:24px}.tab-content[_ngcontent-%COMP%]{position:absolute;inset:60px 0 0;overflow:auto;padding:24px}table[_ngcontent-%COMP%]{line-height:12px}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{font-size:12px;color:#000000a7;vertical-align:top}table[_ngcontent-%COMP%] td.time[_ngcontent-%COMP%]{opacity:.8}table[_ngcontent-%COMP%] td.message[_ngcontent-%COMP%]{white-space:pre-wrap}"],changeDetection:0})}};var xa=n=>({c:n});function Ea(n,t){n&1&&d(0,"input",11)}var ni=class n{constructor(t,e){this.yamcs=t;this.stackFileService=e;this.objectName=Q.required();this.folderLink=St(()=>{let t=this.objectName(),e=t.lastIndexOf("/");return e===-1?"/procedures/stacks/browse/":"/procedures/stacks/browse/"+t.substring(0,e)});this.ackOptions=[{id:"Acknowledge_Queued",label:"Queued"},{id:"Acknowledge_Released",label:"Released"},{id:"Acknowledge_Sent",label:"Sent"},{id:"CommandComplete",label:"Completed"}];this.stackOptionsForm=new Ge({advancementAckDropDown:new te("",[]),advancementAckCustom:new te("",[]),advancementWait:new te("",[])}),this.extraAcknowledgments=t.getProcessor()?.acknowledgments??[];let i=!0;for(let v of this.extraAcknowledgments)this.ackOptions.push({id:v.name,label:v.name.replace("Acknowledge_",""),group:i}),i=!1;this.ackOptions.push({id:"custom",label:"Custom",group:!0});let{advancement:a}=this.stackFileService,s=this.ackOptions.find(v=>v.id===a.acknowledgment),m=s?s.id:"custom";this.stackOptionsForm.setValue({advancementAckDropDown:m,advancementAckCustom:m==="custom"?a.acknowledgment:"",advancementWait:a.wait}),this.stackOptionsForm.valueChanges.subscribe(v=>{this.stackFileService.advancement={acknowledgment:v.advancementAckDropDown!=="custom"?v.advancementAckDropDown:v.advancementAckCustom,wait:v.advancementWait??0},v.advancementAckDropDown!=="custom"&&this.stackOptionsForm.patchValue({advancementAckCustom:void 0},{emitEvent:!1}),this.stackFileService.markDirty()})}static{this.\u0275fac=function(e){return new(e||n)(_(M),_(_e))}}static{this.\u0275cmp=x({type:n,selectors:[["app-stack-file-settings"]],inputs:{objectName:[1,"objectName"]},standalone:!0,features:[E],decls:32,vars:15,consts:[["ackSelect",""],["icon","arrow_back",3,"routerLink","queryParams"],["matTooltip","Save stack","icon","save",3,"clicked","disabled"],[1,"main-pane"],[3,"objectName"],[1,"tab-content"],[1,"ya-form",3,"formGroup"],[1,"label"],[3,"extra"],[2,"display","flex","align-items","flex-start"],["icon","check_circle_outline","formControlName","advancementAckDropDown",3,"options"],["type","text","formControlName","advancementAckCustom",2,"width","200px","margin-left","-1px"],["dialogTitle","Wait time"],["type","number","formControlName","advancementWait","placeholder","0","step","1000","min","0",2,"width","120px"]],template:function(e,i){if(e&1){let a=F();o(0,"app-instance-page")(1,"app-instance-toolbar"),d(2,"ya-page-icon-button",1),l(3),C(4,"basename"),o(5,"ya-page-button",2),C(6,"async"),g("clicked",function(){return S(a),k(i.stackFileService.saveStack())}),l(7," Save "),r()(),o(8,"div",3),d(9,"app-stack-file-page-tabs",4),o(10,"div",5)(11,"form",6)(12,"h3"),l(13,"Commanding"),r(),o(14,"div",7),l(15," Advance when "),d(16,"app-advance-ack-help",8)(17,"br"),o(18,"div",9),d(19,"ya-select",10,0),f(21,Ea,1,0,"input",11),r()(),d(22,"br"),o(23,"div",7),l(24," Wait (ms) "),o(25,"ya-help",12)(26,"p"),l(27,"Wait time before advancing to the next command in the stack."),r(),o(28,"p"),l(29,"This triggers after successful acknowledgment."),r()(),d(30,"br")(31,"input",13),r()()()()()}if(e&2){let a;c(2),p("routerLink",i.folderLink())("queryParams",re(13,xa,i.yamcs.context)),c(),D(" ",y(4,9,i.objectName())," \xA0\xA0\xA0 "),c(2),p("disabled",!y(6,11,i.stackFileService.dirty$)),c(4),p("objectName",i.objectName()),c(2),p("formGroup",i.stackOptionsForm),c(5),p("extra",i.extraAcknowledgments),c(3),p("options",i.ackOptions),c(2),h(((a=i.stackOptionsForm.get("advancementAckDropDown"))==null?null:a.value)==="custom"?21:-1)}},dependencies:[Zn,ke,be,Be,w,ee,G,ce,Dt,V,Y,mn,U,q,ve,Fe,Je,$e,Ze,Ke,et],styles:[".main-pane[_ngcontent-%COMP%]{position:absolute;inset:0;padding:24px}.tab-content[_ngcontent-%COMP%]{position:absolute;inset:60px 0 0;overflow:auto;padding:24px}"],changeDetection:0})}};function wa(n,t){if(n&1&&(o(0,"mat-option",3),C(1,"memberPath"),l(2),C(3,"memberPath"),r()),n&2){let e=t.$implicit;p("value",y(1,2,e)),c(2),D(" ",y(3,4,e)," ")}}var at=class n{constructor(t){this.onChange=t=>{};this.formControl=new te("");this.filteredOptions=this.formControl.valueChanges.pipe(Li(e=>this.onChange(e)),$i(300),Bi(e=>e?t.yamcsClient.getParameters(t.instance,{q:e,limit:20,searchMembers:!0}):Promise.resolve({parameters:[]})),_t(e=>e.parameters||[]))}writeValue(t){this.formControl.setValue(t??null)}registerOnChange(t){this.onChange=t}registerOnTouched(t){}static{this.\u0275fac=function(e){return new(e||n)(_(M))}}static{this.\u0275cmp=x({type:n,selectors:[["app-parameter-input"]],standalone:!0,features:[ht([{provide:wt,useExisting:Ct(()=>n),multi:!0}]),E],decls:6,vars:4,consts:[["auto",""],["type","text","autocomplete","off",1,"ya-input",3,"formControl","matAutocomplete"],[1,"ya-autocomplete"],[3,"value"]],template:function(e,i){if(e&1&&(d(0,"input",1),o(1,"mat-autocomplete",2,0),I(3,wa,4,6,"mat-option",3,A),C(5,"async"),r()),e&2){let a=X(2);p("formControl",i.formControl)("matAutocomplete",a),c(3),$(y(5,2,i.filteredOptions))}},dependencies:[w,ee,ce,V,Ft,vn,an,Sn,Ln],encapsulation:2,changeDetection:0})}};function Da(n,t){if(n&1){let e=F();o(0,"tr")(1,"td",11),d(2,"app-parameter-input",12),r(),o(3,"td",13)(4,"ya-icon-action",14),g("click",function(){let a=S(e).$index,s=u();return k(s.moveParameterControlDown(a))}),r(),o(5,"ya-icon-action",15),g("click",function(){let a=S(e).$index,s=u();return k(s.moveParameterControlUp(a))}),r(),o(6,"ya-text-action",16),g("click",function(){let a=S(e).$index,s=u();return k(s.removeParameterControl(a))}),l(7," DELETE "),r()()()}if(n&2){let e=t.$index,i=t.$count;c(2),p("formControlName",e),c(2),p("disabled",e===i-1),c(),p("disabled",e===0)}}var pt=class n{constructor(t,e){this.dialogRef=t;this.data=e;if(this.form=new Ge({parameters:new Mt([]),comment:new te("")}),e.entry){let i=(e.entry.parameters||[]).map(a=>a.parameter);for(let a of i)this.addParameterControl();this.form.setValue({parameters:i||[],comment:e.entry.comment||""})}this.parameterFormArray.length||this.addParameterControl()}get parameterFormArray(){return this.form.controls.parameters}get parameterControls(){return this.parameterFormArray.controls}addParameterControl(){this.parameterFormArray.push(new te(""))}removeParameterControl(t){this.parameterFormArray.removeAt(t)}moveParameterControlDown(t){let e=this.parameterFormArray.controls[t];this.parameterFormArray.removeAt(t),this.parameterFormArray.insert(t+1,e)}moveParameterControlUp(t){let e=this.parameterFormArray.controls[t];this.parameterFormArray.removeAt(t),this.parameterFormArray.insert(t-1,e)}save(){let{value:t}=this.form,e={comment:t.comment,parameters:t.parameters.map(i=>({parameter:i}))};this.dialogRef.close(e)}static{this.\u0275fac=function(e){return new(e||n)(_(H),_(me))}}static{this.\u0275cmp=x({type:n,selectors:[["app-edit-check-entry-dialog"]],standalone:!0,features:[E],decls:24,vars:2,consts:[["mat-dialog-title",""],[1,"ya-form",3,"formGroup"],[1,"label"],["formArrayName","parameters",1,"parameter-table",2,"width","100%"],["colspan","1"],["icon","add_circle_outline",3,"click"],["formControlName","comment"],["align","end"],[2,"flex","1 1 auto"],["mat-dialog-close",""],["appearance","primary",3,"click"],[2,"width","100%"],[3,"formControlName"],[2,"white-space","nowrap"],["icon","keyboard_arrow_down",3,"click","disabled"],["icon","keyboard_arrow_up",3,"click","disabled"],["icon","delete",3,"click"]],template:function(e,i){e&1&&(o(0,"h2",0),l(1,"Step: List parameters"),r(),o(2,"mat-dialog-content")(3,"form",1)(4,"div",2),l(5," Parameters "),d(6,"br"),o(7,"table",3),I(8,Da,8,3,"tr",null,A),o(10,"tr")(11,"td",4)(12,"ya-button",5),g("click",function(){return i.addParameterControl()}),l(13," \xA0Add "),r()()()()(),d(14,"br"),o(15,"div",2),l(16," Comment "),d(17,"app-markdown-input",6),r()()(),o(18,"mat-dialog-actions",7),d(19,"div",8),o(20,"ya-button",9),l(21,"CANCEL"),r(),o(22,"ya-button",10),g("click",function(){return i.save()}),l(23),r()()),e&2&&(c(3),p("formGroup",i.form),c(5),$(i.parameterControls),c(15),D(" ",i.data.edit?"UPDATE":"ADD TO STACK"," "))},dependencies:[Xt,at,w,G,V,Y,U,q,Tt,W,ie,Z,J,O,ze,Xe],styles:[".parameter-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child{margin-left:0;padding-left:0}[_nghost-%COMP%] .parameter-table input{margin:0!important}"],changeDetection:0})}};var Ta=["top"],Ma=["searchFilter"];function Pa(n,t){if(n&1){let e=F();o(0,"ya-breadcrumb",10),g("click",function(){let a=S(e).$implicit,s=u(3);return k(s.changeSystem(a.system))}),r()}if(n&2){let e=t.$implicit;p("action",!0)("label",e.name)}}function Va(n,t){if(n&1){let e=F();o(0,"div",3)(1,"ya-breadcrumb-trail")(2,"ya-breadcrumb",8),g("click",function(){S(e);let a=u(2);return k(a.changeSystem(""))}),r(),I(3,Pa,1,2,"ya-breadcrumb",9,A),r()()}if(n&2){let e=u();c(2),p("action",!0),c(),$(e)}}function Oa(n,t){n&1&&f(0,Va,5,1,"div",3),n&2&&h(t.length?0:-1)}function Na(n,t){n&1&&(o(0,"th",24),l(1,"Name"),r())}function Aa(n,t){if(n&1){let e=F();o(0,"mat-icon",26),l(1,"folder"),r(),o(2,"a",27),g("click",function(){S(e);let a=u().$implicit,s=u(2);return k(s.selectRow(a))}),l(3),C(4,"filename"),r()}if(n&2){let e=u().$implicit;c(3),D("",y(4,1,e.name),"/")}}function Ia(n,t){if(n&1&&d(0,"ya-highlight",28),n&2){let e=u(2).$implicit,i=u(2);p("text",e.command.qualifiedName)("term",i.filterControl.value)}}function $a(n,t){if(n&1&&(d(0,"ya-highlight",28),C(1,"slice")),n&2){let e=u(2).$implicit,i=u(2);p("text",Ye(1,2,e.command.qualifiedName,i.system.length+1))("term",i.filterControl.value)}}function Ra(n,t){if(n&1){let e=F();o(0,"mat-icon",26),l(1,"rss_feed"),r(),o(2,"a",27),g("click",function(){S(e);let a=u().$implicit,s=u(2);return k(s.selectRow(a))}),f(3,Ia,1,2,"ya-highlight",28)(4,$a,2,5,"ya-highlight",28),r()}if(n&2){let e=u(3);c(3),h(e.system?-1:3),c(),h(e.system?4:-1)}}function ja(n,t){if(n&1&&(o(0,"td",25),f(1,Aa,5,3)(2,Ra,5,2),r()),n&2){let e=t.$implicit;c(),h(e.system?1:-1),c(),h(e.command?2:-1)}}function Ba(n,t){n&1&&(o(0,"th",24),l(1,"Description"),r())}function La(n,t){if(n&1&&l(0),n&2){let e=u().$implicit;D(" ",e.system.shortDescription||"-"," ")}}function Ya(n,t){if(n&1&&d(0,"ya-highlight",28),n&2){let e=u(4);p("text",t)("term",e.filterControl.value)}}function Ga(n,t){n&1&&l(0," - ")}function Ua(n,t){if(n&1&&f(0,Ya,1,2,"ya-highlight",28)(1,Ga,1,0),n&2){let e,i=u().$implicit;h((e=i.command.shortDescription)?0:1,e)}}function qa(n,t){if(n&1&&(o(0,"td",29),f(1,La,1,1)(2,Ua,2,1),r()),n&2){let e=t.$implicit;c(),h(e.system?1:-1),c(),h(e.command?2:-1)}}function Ha(n,t){n&1&&(o(0,"th",24),l(1,"Significance"),r())}function Wa(n,t){n&1&&d(0,"app-significance-level",31),n&2&&p("level",t.consequenceLevel)}function Qa(n,t){n&1&&l(0," - ")}function za(n,t){if(n&1&&(o(0,"td",30),f(1,Wa,1,1,"app-significance-level",31)(2,Qa,1,0),r()),n&2){let e,i=t.$implicit;c(),h((e=i.command==null?null:i.command.effectiveSignificance)?1:2,e)}}function Ka(n,t){if(n&1&&(o(0,"th",24),l(1),r()),n&2){let e=u().$implicit;c(),D(" ",e.label," ")}}function Xa(n,t){if(n&1&&d(0,"ya-highlight",28),n&2){let e=u(4);p("text",t)("term",e.filterControl.value)}}function Ja(n,t){n&1&&l(0," - ")}function Za(n,t){if(n&1&&(o(0,"td",30),f(1,Xa,1,2,"ya-highlight",28),C(2,"alias"),f(3,Ja,1,0),r()),n&2){let e,i=t.$implicit,a=u().$implicit;c(),h((e=Ye(2,1,i.command,a.id))?1:3,e)}}function eo(n,t){if(n&1&&(j(0,18),f(1,Ka,2,1,"th",32)(2,Za,4,4,"td",21),B()),n&2){let e=t.$implicit;p("matColumnDef",e.id)}}function to(n,t){n&1&&d(0,"th",33)}function io(n,t){n&1&&d(0,"td",30)}function no(n,t){n&1&&d(0,"tr",34)}function ao(n,t){if(n&1&&d(0,"tr",35),n&2){let e=t.$implicit,i=u(2);pe("selected",i.selection.isSelected(e))}}function oo(n,t){if(n&1&&(o(0,"table",6),j(1,11),f(2,Na,2,0,"th",12)(3,ja,3,2,"td",13),B(),j(4,14),f(5,Ba,2,0,"th",12)(6,qa,3,2,"td",15),B(),j(7,16),f(8,Ha,2,0,"th",12)(9,za,3,1,"td",17),B(),I(10,eo,3,1,"ng-container",18,A),C(12,"async"),j(13,19),f(14,to,1,0,"th",20)(15,io,1,0,"td",21),B(),f(16,no,1,0,"tr",22),C(17,"async"),f(18,ao,1,2,"tr",23),C(19,"async"),r()),n&2){let e=u(),i=X(8);p("dataSource",e.dataSource),c(10),$(y(12,3,e.aliasColumns$)),c(6),p("matHeaderRowDef",y(17,5,i.displayedColumns$)),c(2),p("matRowDefColumns",y(19,7,i.displayedColumns$))}}var ai=class n{constructor(t,e){this.yamcs=t;this.changeDetection=e;this.pageSize=100;this.system=null;this.breadcrumb$=new N([]);this.filterControl=new on;this.columns=[{id:"name",label:"Name",alwaysVisible:!0},{id:"significance",label:"Significance",visible:!0},{id:"shortDescription",label:"Description"},{id:"actions",label:"",alwaysVisible:!0}];this.aliasColumns$=new N([]);this.selection=new Et(!1);this.selectedCommand$=new N(null);this.onChange=t=>{};this.onTouched=()=>{};this.dataSource=new na(t),this.selectedCommand$.subscribe(async i=>{if(i&&i.command){let a=await this.yamcs.yamcsClient.getCommand(this.yamcs.instance,i.command.qualifiedName);return this.onChange(a)}else return this.onChange(null)})}ngAfterViewInit(){this.changeSystem(""),this.searchFilter.filter.nativeElement.focus(),this.filterControl.valueChanges.subscribe(()=>{this.paginator.pageIndex=0,this.updateDataSource()}),this.paginator.page.subscribe(()=>{this.updateDataSource(),this.top.nativeElement.scrollIntoView()})}changeSystem(t,e=0){this.system=t,this.updateBrowsePath(),this.paginator.pageIndex=e,this.updateDataSource()}updateDataSource(){let t={system:this.system||"/",noAbstract:!0,details:!0,pos:this.paginator.pageIndex*this.pageSize,limit:this.pageSize,fields:["name","qualifiedName","alias","effectiveSignificance","shortDescription"]},e=this.filterControl.value;e&&(t.q=e.toLowerCase()),this.dataSource.loadCommands(t).then(()=>{this.selection.clear(),this.updateBrowsePath();for(let a of this.aliasColumns$.value){let s=this.columns.indexOf(a);s!==-1&&this.columns.splice(s,1)}let i=[];for(let a of this.dataSource.getAliasNamespaces()){let s={id:a,label:a,alwaysVisible:!0};i.push(s)}this.columns.splice(1,0,...i),this.aliasColumns$.next(i),this.columnChooser.recalculate(this.columns)})}selectRow(t){return t.system?(this.selectedCommand$.next(null),this.changeSystem(t.name)):this.selectedCommand$.next(t),!1}updateBrowsePath(){let t=[],e="";if(this.system)for(let i of this.system.slice(1).split("/"))e+="/"+i,t.push({name:i,system:e});this.breadcrumb$.next(t)}selectNext(){let t=this.dataSource.items$.value,e=0;if(this.selection.hasValue()){let i=this.selection.selected[0];t.indexOf(i)!==-1&&(e=Math.min(t.indexOf(i)+1,t.length-1))}this.selection.select(t[e])}selectPrevious(){let t=this.dataSource.items$.value,e=0;if(this.selection.hasValue()){let i=this.selection.selected[0];t.indexOf(i)!==-1&&(e=Math.max(t.indexOf(i)-1,0))}this.selection.select(t[e])}applySelection(){if(this.selection.hasValue()){let t=this.selection.selected[0],e=this.dataSource.items$.value;t.command&&e.indexOf(t)!==-1&&this.selectRow(t)}}writeValue(t){this.path=t}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}static{this.\u0275fac=function(e){return new(e||n)(_(M),_(vt))}}static{this.\u0275cmp=x({type:n,selectors:[["app-command-selector"]],viewQuery:function(e,i){if(e&1&&(ne(Ta,7),ne(Rt,5),ne(Ut,5),ne(Ma,5)),e&2){let a;ae(a=oe())&&(i.top=a.first),ae(a=oe())&&(i.paginator=a.first),ae(a=oe())&&(i.columnChooser=a.first),ae(a=oe())&&(i.searchFilter=a.first)}},inputs:{path:"path"},standalone:!0,features:[ht([{provide:wt,useExisting:Ct(()=>n),multi:!0}]),E],decls:12,vars:12,consts:[["top",""],["searchFilter",""],["columnChooser",""],[1,"filter-bar"],["placeholder","Search by name","icon","search",3,"onArrowDown","onArrowUp","onEnter","formControl"],["preferenceKey","sendCommand",3,"columns"],["mat-table","",1,"ya-data-table","expand",3,"dataSource"],[3,"pageSize","hidePageSize","showFirstLastButtons","length"],["icon","account_tree",3,"click","action"],[3,"action","label"],[3,"click","action","label"],["cdkColumnDef","name"],["mat-header-cell","",4,"cdkHeaderCellDef"],["mat-cell","","class","primary-td",4,"cdkCellDef"],["cdkColumnDef","shortDescription"],["mat-cell","","class","wrap200",4,"cdkCellDef"],["cdkColumnDef","significance"],["mat-cell","",4,"cdkCellDef"],[3,"matColumnDef"],["matColumnDef","actions"],["mat-header-cell","","class","expand",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",3,"selected",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell","",1,"primary-td"],[1,"icon12",2,"vertical-align","middle"],["href","",3,"click"],[3,"text","term"],["mat-cell","",1,"wrap200"],["mat-cell",""],[3,"level"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-cell","",1,"expand"],["mat-header-row",""],["mat-row",""]],template:function(e,i){if(e&1){let a=F();d(0,"span",null,0),f(2,Oa,1,1),C(3,"async"),o(4,"div",3)(5,"ya-search-filter",4,1),g("onArrowDown",function(){return S(a),k(i.selectNext())})("onArrowUp",function(){return S(a),k(i.selectPrevious())})("onEnter",function(){return S(a),k(i.applySelection())}),r(),d(7,"ya-column-chooser",5,2),r(),f(9,oo,20,9,"table",6),d(10,"mat-paginator",7),C(11,"async")}if(e&2){let a;c(2),h((a=y(3,8,i.breadcrumb$))?2:-1,a),c(3),p("formControl",i.filterControl),c(2),p("columns",i.columns),c(2),h(i.dataSource?9:-1),c(),p("pageSize",i.pageSize)("hidePageSize",!0)("showFirstLastButtons",!0)("length",y(11,10,i.dataSource.totalSize$))}},dependencies:[Hn,w,ee,Xi,V,Ft,At,It,$t,ge,Rt,Me,jt,kn,Ve,Pe,We,Bt,Oe,Lt,Ne,Gt,Yt,Ut,On,An,jn,Kt],styles:[".pullRight[_ngcontent-%COMP%]{float:right}.primary-td[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{margin-right:7px}"],changeDetection:0})}};var ri=class{constructor(t){this.step=t}getAssignment(t){for(let e in this.step.args)if(e===t){let i=this.step.args[e];return le.toValue(i)}}getOption(t,e){for(let i in this.step.extra||{})if(i===t){let a=this.step.extra[i];switch(e){case"BOOLEAN":return this.getBooleanOption(a);case"NUMBER":return this.getNumberOption(a);case"STRING":return this.getStringOption(a);case"TIMESTAMP":return this.getStringOption(a)}}}getBooleanOption(t){if(t.type==="BOOLEAN")return t}getNumberOption(t){switch(t.type){case"SINT32":case"UINT32":case"SINT64":case"UINT64":return t}}getStringOption(t){if(t.type==="STRING")return t}getComment(){return this.step.comment}getStream(){return this.step.stream}getAdvancementParams(){return this.step.advancement}};var ro=["commandSelector"],lo=["commandForm"],co=()=>[];function so(n,t){if(n&1&&(o(0,"div",2)(1,"form",3)(2,"h2"),l(3,"Select command"),r(),o(4,"div",4),d(5,"app-command-selector",5,0),r()()(),o(7,"div",6)(8,"mat-toolbar")(9,"mat-toolbar-row")(10,"ya-button",7),l(11,"CANCEL"),r()()()()),n&2){let e=u();c(),p("formGroup",e.selectCommandForm)}}function mo(n,t){if(n&1){let e=F();o(0,"ya-text-action",13),g("click",function(){let a=S(e),s=u(2);return k(s.returnToList(a))}),l(1),r()}n&2&&(p("padding",!1),c(),D(" ",t," "))}function po(n,t){if(n&1&&(o(0,"div"),l(1),d(2,"br"),o(3,"h2"),l(4),r()()),n&2){let e=t.$implicit;c(),D(" ",e.namespace," "),c(3),de(e.name)}}function uo(n,t){if(n&1){let e=F();o(0,"div",2)(1,"div",8)(2,"div",9)(3,"div"),f(4,mo,2,2,"ya-text-action",10),C(5,"spaceSystemName"),o(6,"h2"),l(7),r()(),I(8,po,5,2,"div",null,A),r(),d(10,"app-command-form",11,1),r()(),o(12,"div",6)(13,"mat-toolbar")(14,"mat-toolbar-row")(15,"ya-button",7),l(16,"CANCEL"),r(),l(17," \xA0\xA0 "),o(18,"ya-button",12),g("click",function(){S(e);let a=u();return k(a.handleOK())}),l(19),r()()()()}if(n&2){let e,i=t,a=X(11),s=u();c(4),h((e=y(5,7,i.qualifiedName))?4:-1,e),c(3),de(i.name),c(),$(i.alias||Ue(9,co)),c(2),p("command",i)("templateProvider",s.templateProvider)("stackMode",!0),c(8),p("disabled",!a.form.valid),c(),D(" ",s.okLabel," ")}}var dt=class n{constructor(t,e,i,a,s){this.dialogRef=t;this.yamcs=e;this.changeDetection=a;this.data=s;this.okLabel="OK";this.commandFormValid$=new N(!1);this.selectedCommand$=new N(null);if(s?.entry){let m=s.entry;this.templateProvider=new ri(m.model),this.selectedCommand$.next(m.command??null)}s?.okLabel&&(this.okLabel=s?.okLabel),this.selectCommandForm=i.group({command:["",L.required]}),this.selectCommandForm.valueChanges.subscribe(()=>{let m=this.selectCommandForm.value.command;this.selectedCommand$.next(m||null)})}handleOK(){let t=this.commandForm.getResult(),e={command:this.selectedCommand$.value,args:t.args,extra:t.extra,comment:t.comment,stream:t.stream,advancement:t.advancement};this.dialogRef.close(e)}returnToList(t){this.templateProvider=null,this.selectedCommand$.next(null),this.changeDetection.detectChanges(),this.selectCommandForm.reset(),this.commandSelector.changeSystem(t==="/"?"":t)}static{this.\u0275fac=function(e){return new(e||n)(_(H),_(M),_(se),_(vt),_(me))}}static{this.\u0275cmp=x({type:n,selectors:[["ng-component"]],viewQuery:function(e,i){if(e&1&&(ne(ro,5),ne(lo,5)),e&2){let a;ae(a=oe())&&(i.commandSelector=a.first),ae(a=oe())&&(i.commandForm=a.first)}},standalone:!0,features:[E],decls:4,vars:6,consts:[["commandSelector",""],["commandForm",""],[1,"wrapper"],[1,"ya-form",3,"formGroup"],[1,"command-table-wrapper"],["formControlName","command"],[1,"footer"],["mat-dialog-close",""],[1,"command-detail"],[1,"names",2,"margin-bottom","0.5em"],[3,"padding"],[3,"command","templateProvider","stackMode"],["appearance","primary",3,"click","disabled"],[3,"click","padding"]],template:function(e,i){if(e&1&&(f(0,so,12,1),C(1,"async"),f(2,uo,20,10),C(3,"async")),e&2){let a;h(y(1,2,i.selectedCommand$)?-1:0),c(2),h((a=y(3,4,i.selectedCommand$))?2:-1,a)}},dependencies:[ta,ai,w,ee,G,V,Y,U,q,W,Ot,dn,O,Xe,Yn],styles:[".mat-mdc-dialog-container{border-radius:0;position:relative}.wrapper[_ngcontent-%COMP%]{position:relative;height:calc(100% - 48px);overflow:auto;font:400 12px/20px Roboto,sans-serif}.command-table-wrapper[_ngcontent-%COMP%]{position:absolute;overflow:auto;inset:56px 0 1em}.command-detail[_ngcontent-%COMP%]{max-width:600px}.footer[_ngcontent-%COMP%]{position:absolute;bottom:0;height:64px;left:0;right:0;border-top:1px solid #d3d3d3}.disabled[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{opacity:.6}div.names[_ngcontent-%COMP%]{display:flex}div.names[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{padding-right:25px}div.names[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:not(:first-child){padding-left:25px;border-left:1px solid rgba(0,0,0,.1)}div.names[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}div.names[_ngcontent-%COMP%] .text-action{line-height:0}"]})}};var fo=["textContainer"],ut=class n{constructor(t,e){this.dialogRef=t;this.data=e;this.textContainerRef=Ui.required("textContainer");this.text=lt("")}ngAfterViewInit(){this.text.set(this.data.entry?.text||"");let t=[un,ct.lineWrapping,ea(),ct.updateListener.of(i=>{if(i.docChanged){let a=i.state.doc.toString();this.text.set(a)}})],e=ct.theme({"&":{height:"100%",fontSize:"12px"},".cm-scroller":{overflow:"auto",fontFamily:"'Roboto Mono', monospace"},"&.cm-focused":{outline:"none"}},{dark:!1});t.push(e),this.editorView=new ct({doc:this.text(),extensions:t,parent:this.textContainerRef().nativeElement}),this.editorView.focus()}save(){let t=this.editorView?.state.doc.toString()||"";this.dialogRef.close(t)}gotoMarkdownDocs(){window.open("https://www.markdownguide.org/basic-syntax/","_blank","noreferrer")}ngOnDestroy(){this.editorView?.destroy()}static{this.\u0275fac=function(e){return new(e||n)(_(H),_(me))}}static{this.\u0275cmp=x({type:n,selectors:[["app-edit-text-entry-dialog"]],viewQuery:function(e,i){e&1&&Wi(i.textContainerRef,fo,5),e&2&&Qi()},standalone:!0,features:[E],decls:18,vars:3,consts:[["textContainer",""],["mat-dialog-title",""],["animationDuration","0ms",1,"small-tabs",3,"mat-stretch-tabs"],["label","Write"],[1,"text-container"],["label","Preview"],[1,"preview-container"],[3,"text"],["align","end"],["appearance","text","icon","open_in_new",3,"click"],[2,"flex","1 1 auto"],["mat-dialog-close",""],["appearance","primary",3,"click"]],template:function(e,i){if(e&1){let a=F();o(0,"h2",1),l(1,"Step: Display text"),r(),o(2,"mat-dialog-content")(3,"mat-tab-group",2)(4,"mat-tab",3),d(5,"div",4,0),r(),o(7,"mat-tab",5)(8,"div",6),d(9,"app-markdown",7),r()()()(),o(10,"mat-dialog-actions",8)(11,"ya-button",9),g("click",function(){return S(a),k(i.gotoMarkdownDocs())}),l(12," Markdown syntax "),r(),d(13,"div",10),o(14,"ya-button",11),l(15,"CANCEL"),r(),o(16,"ya-button",12),g("click",function(){return S(a),k(i.save())}),l(17),r()()}e&2&&(c(3),p("mat-stretch-tabs",!1),c(6),p("text",i.text()),c(8),D(" ",i.data.edit?"UPDATE":"ADD TO STACK"," "))},dependencies:[tt,w,W,ie,Z,J,bn,xn,O],styles:[".text-container[_ngcontent-%COMP%]{border:1px solid rgba(0,0,0,.1);margin-top:12px;height:300px}.preview-container[_ngcontent-%COMP%]{border:1px solid rgba(0,0,0,.1);background-color:#fafafa;margin-top:12px;height:300px}"]})}};function _o(n,t){if(n&1){let e=F();o(0,"tr",5)(1,"td",18),d(2,"app-parameter-input",19),r(),o(3,"td",20)(4,"ya-select",21),d(5,"ya-option",22)(6,"ya-option",23)(7,"ya-option",24)(8,"ya-option",25)(9,"ya-option",26)(10,"ya-option",27),r()(),o(11,"td",28),d(12,"input",29),r(),o(13,"td",20)(14,"ya-icon-action",30),g("click",function(){let a=S(e).$index,s=u();return k(s.moveComparisonGroupDown(a))}),r(),o(15,"ya-icon-action",31),g("click",function(){let a=S(e).$index,s=u();return k(s.moveComparisonGroupUp(a))}),r(),o(16,"ya-text-action",32),g("click",function(){let a=S(e).$index,s=u();return k(s.removeComparisonGroup(a))}),l(17," DELETE "),r()()()}if(n&2){let e=t.$index,i=t.$count;p("formGroupName",e),c(14),p("disabled",e===i-1),c(),p("disabled",e===0)}}var ft=class n{constructor(t,e){this.dialogRef=t;this.data=e;if(this.form=new Ge({condition:new Mt([]),delay:new te(0,[L.required]),timeout:new te(""),comment:new te("")}),e.entry){let i=e.entry.condition||[];for(let a of i)this.addComparisonGroup();this.form.setValue({condition:i,delay:e.entry.delay??0,timeout:e.entry.timeout||"",comment:e.entry.comment||""})}this.conditionFormArray.length||this.addComparisonGroup()}get conditionFormArray(){return this.form.controls.condition}get comparisonGroups(){return this.conditionFormArray.controls}addComparisonGroup(){this.conditionFormArray.push(new Ge({parameter:new te("",[L.required]),operator:new te("eq",[L.required]),value:new te("",[L.required])}))}removeComparisonGroup(t){this.conditionFormArray.removeAt(t)}moveComparisonGroupDown(t){let e=this.conditionFormArray.controls[t];this.conditionFormArray.removeAt(t),this.conditionFormArray.insert(t+1,e)}moveComparisonGroupUp(t){let e=this.conditionFormArray.controls[t];this.conditionFormArray.removeAt(t),this.conditionFormArray.insert(t-1,e)}save(){let{value:t}=this.form,e={condition:t.condition,delay:Math.max(t.delay,0),comment:t.comment};t.timeout!==""&&t.timeout!==null&&(e.timeout=Math.max(t.timeout,0)),this.dialogRef.close(e)}static{this.\u0275fac=function(e){return new(e||n)(_(H),_(me))}}static{this.\u0275cmp=x({type:n,selectors:[["app-edit-verify-entry-dialog"]],standalone:!0,features:[E],decls:34,vars:4,consts:[["mat-dialog-title",""],[1,"ya-form",3,"formGroup"],["label","Parameters",3,"expanded"],[1,"label"],["formArrayName","condition",1,"condition-table"],[3,"formGroupName"],["colspan","1"],["icon","add_circle_outline",3,"click"],["label","Timing"],["type","number","formControlName","delay"],[1,"hint"],["type","number","formControlName","timeout"],["label","Comment"],["formControlName","comment"],["align","end"],[2,"flex","1 1 auto"],["mat-dialog-close",""],["appearance","primary",3,"click","disabled"],[2,"width","70%"],["formControlName","parameter"],[2,"white-space","nowrap"],["formControlName","operator",1,"operator"],["id","eq","label","="],["id","neq","label","!="],["id","lt","label","<"],["id","lte","label","<="],["id","gt","label",">"],["id","gte","label",">="],[2,"width","30%"],["type","text","formControlName","value"],["icon","keyboard_arrow_down",3,"click","disabled"],["icon","keyboard_arrow_up",3,"click","disabled"],["icon","delete",3,"click"]],template:function(e,i){e&1&&(o(0,"h2",0),l(1,"Step: Verify parameters"),r(),o(2,"mat-dialog-content")(3,"form",1)(4,"ya-stepper")(5,"ya-stepper-step",2)(6,"div",3)(7,"table",4),I(8,_o,18,3,"tr",5,A),o(10,"tr")(11,"td",6)(12,"ya-button",7),g("click",function(){return i.addComparisonGroup()}),l(13," \xA0Add "),r()()()()()(),o(14,"ya-stepper-step",8)(15,"div",3),l(16," Delay (milliseconds) "),d(17,"input",9),o(18,"span",10),l(19,"Initial delay before verifying the condition"),r()(),d(20,"br"),o(21,"div",3),l(22," Timeout (milliseconds) "),d(23,"input",11),o(24,"span",10),l(25,"Maximum wait time before aborting the verification"),r()()(),o(26,"ya-stepper-step",12),d(27,"app-markdown-input",13),r()()()(),o(28,"mat-dialog-actions",14),d(29,"div",15),o(30,"ya-button",16),l(31,"CANCEL"),r(),o(32,"ya-button",17),g("click",function(){return i.save()}),l(33),r()()),e&2&&(c(3),p("formGroup",i.form),c(2),p("expanded",!0),c(3),$(i.comparisonGroups),c(24),p("disabled",!i.form.valid),c(),D(" ",i.data.edit?"UPDATE":"ADD TO STACK"," "))},dependencies:[Xt,at,$n,In,w,G,ce,Dt,V,Y,U,q,rn,Tt,W,ie,Z,J,O,ze,Pn,Ke,Xe],styles:[".condition-table[_ngcontent-%COMP%]{width:100%}.condition-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child{margin-left:0;padding-left:0}[_nghost-%COMP%] .condition-table input{margin:0!important}[_nghost-%COMP%] ya-select.operator ya-button{margin-top:0;width:100%}"],changeDetection:0})}};var li=class n{constructor(t,e){this.dialogRef=t;this.form=e.group({executionTime:["",[L.required]],tags:[[],[]]})}schedule(){this.dialogRef.close(this.form.value)}static{this.\u0275fac=function(e){return new(e||n)(_(H),_(se))}}static{this.\u0275cmp=x({type:n,selectors:[["app-schedule-stack-dialog"]],standalone:!0,features:[E],decls:26,vars:4,consts:[["mat-dialog-title",""],[1,"hint"],[1,"ya-form",3,"formGroup"],[1,"label"],["formControlName","executionTime",3,"showMillis","showNow"],[1,"half-break"],["dialogTitle","Timeline Tags"],["formControlName","tags"],["align","end"],[2,"flex","1 1 auto"],["mat-dialog-close",""],["appearance","primary",3,"click","disabled"]],template:function(e,i){e&1&&(o(0,"h2",0),l(1,"Run later"),r(),o(2,"mat-dialog-content")(3,"div",1)(4,"p"),l(5,"This stack will be submitted to the Yamcs Timeline, for execution at a later time."),r()(),o(6,"form",2)(7,"div",3),l(8," Execution time "),d(9,"br")(10,"ya-date-time-input",4),r(),d(11,"hr",5),o(12,"div",3),l(13," Timeline tags "),o(14,"span",1),l(15,"(optional)"),r(),o(16,"ya-help",6),l(17," Tags allow to categorise items per band. Bands only show items for which one of the tags is matching. "),r(),d(18,"br")(19,"ya-tag-select",7),r()()(),o(20,"mat-dialog-actions",8),d(21,"div",9),o(22,"ya-button",10),l(23,"CANCEL"),r(),o(24,"ya-button",11),g("click",function(){return i.schedule()}),l(25,"SCHEDULE"),r()()),e&2&&(c(6),p("formGroup",i.form),c(4),p("showMillis",!0)("showNow",!0),c(14),p("disabled",!i.form.valid))},dependencies:[w,G,V,Y,U,q,W,ie,Z,J,O,qt,Je,Qt],encapsulation:2,changeDetection:0})}};var Le=class n{constructor(){this.icon=Q.required();this.text=Q.required()}static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275cmp=x({type:n,selectors:[["app-entry-label"]],inputs:{icon:[1,"icon"],text:[1,"text"]},standalone:!0,features:[E],decls:4,vars:2,consts:[[1,"icon12"]],template:function(e,i){e&1&&(o(0,"mat-icon",0),l(1),r(),o(2,"span"),l(3),r()),e&2&&(c(),de(i.icon()),c(2),de(i.text()))},dependencies:[ge],styles:["[_nghost-%COMP%]{display:flex;align-items:center;background-color:inherit;font-size:12px;font-weight:400;font-family:Roboto Mono,monospace;line-height:12px;letter-spacing:.02em;color:#000000a7;padding:2px;margin-bottom:5px}span[_ngcontent-%COMP%]{margin-left:5px}"],changeDetection:0})}};function go(n,t){if(n&1&&(o(0,"td",9),l(1),r()),n&2){let e=t.$implicit;c(),D(" ",e.parameter," ")}}function Co(n,t){if(n&1&&d(0,"app-alarm-level",11),n&2){let e=u().$implicit;p("level",e.pval.monitoringResult)}}function yo(n,t){if(n&1&&(o(0,"td",10),f(1,Co,1,1,"app-alarm-level",11),r()),n&2){let e,i=t.$implicit;c(),h((e=i.pval==null?null:i.pval.engValue)?1:-1,e)}}function ho(n,t){n&1&&(o(0,"span"),l(1,"\u2193"),r())}function vo(n,t){n&1&&(o(0,"span"),l(1,"\u2191"),r())}function So(n,t){if(n&1&&(o(0,"ya-expirable",13),l(1),C(2,"value"),f(3,ho,2,0,"span")(4,vo,2,0,"span"),r()),n&2){let e=u().$implicit;p("pval",e.pval),c(),D(" ",y(2,4,e.pval.engValue)," "),c(2),h(e.pval.rangeCondition==="LOW"?3:-1),c(),h(e.pval.rangeCondition==="HIGH"?4:-1)}}function ko(n,t){n&1&&l(0," - ")}function bo(n,t){if(n&1&&(o(0,"td",12),f(1,So,5,6,"ya-expirable",13)(2,ko,1,0),r()),n&2){let e,i=t.$implicit;c(),h((e=i.pval==null?null:i.pval.engValue)?1:2,e)}}function xo(n,t){n&1&&d(0,"tr",14)}function Eo(n,t){if(n&1&&(o(0,"table",1),j(1,2),f(2,go,2,1,"td",3),B(),j(3,4),f(4,yo,2,1,"td",5),B(),j(5,6),f(6,bo,3,1,"td",7),B(),f(7,xo,1,0,"tr",8),r()),n&2){let e=u();p("dataSource",e.dataSource),c(7),p("matRowDefColumns",e.displayedColumns)}}var ci=class n{constructor(){this.entry=Q.required();this.pvals=Q.required();this.dataSource=new Qe;this.displayedColumns=["parameter","level","value"];kt(()=>{let t=this.pvals(),e=[];for(let i of this.entry().parameters){let a={parameter:i.parameter,pval:t[i.parameter]};e.push(a)}this.dataSource.data=e})}static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275cmp=x({type:n,selectors:[["app-stacked-check-entry"]],inputs:{entry:[1,"entry"],pvals:[1,"pvals"]},standalone:!0,features:[E],decls:2,vars:1,consts:[["icon","toll","text","Parameters:"],["mat-table","",1,"ya-data-table","no-frame",3,"dataSource"],["matColumnDef","parameter"],["mat-cell","","style","width: 400px",4,"matCellDef"],["matColumnDef","level"],["mat-cell","","style","width: 80px",4,"matCellDef"],["matColumnDef","value"],["mat-cell","",4,"matCellDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-cell","",2,"width","400px"],["mat-cell","",2,"width","80px"],[3,"level"],["mat-cell",""],[3,"pval"],["mat-row",""]],template:function(e,i){if(e&1&&(d(0,"app-entry-label",0),f(1,Eo,8,2,"table",1)),e&2){let a;c(),h((a=i.entry())?1:-1,a)}},dependencies:[zn,Le,w,Me,Ve,Pe,We,Oe,Ne,Wt,Se],styles:["[_nghost-%COMP%]{display:block;position:relative}table[_ngcontent-%COMP%]{padding-left:18px;padding-right:18px;background-color:#fafafa}[_nghost-%COMP%] tr.mat-mdc-row{background:#fafafa}[_nghost-%COMP%] td:first-child{padding-left:0!important}"],changeDetection:0})}};var si=class n{transform(t){return t?t==="CommandComplete"?"Completed":t.replace("Acknowledge_",""):null}static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275pipe=Gi({name:"acknowledgmentName",type:n,pure:!0,standalone:!0})}};function wo(n,t){if(n&1&&(o(0,"span"),l(1),C(2,"value"),r()),n&2){let e=t.$implicit;c(),xi("[",e.key,": ",y(2,2,e.value),"]")}}function Do(n,t){if(n&1&&(o(0,"tr")(1,"td",3),l(2),r(),o(3,"td",4),d(4,"ya-value",5),C(5,"tovalue"),r()()),n&2){let e=t.$implicit;c(2),D(" ",e.key," "),c(2),p("value",y(5,2,e.value))}}function Fo(n,t){if(n&1&&(o(0,"span"),l(1),C(2,"acknowledgmentName"),r()),n&2){let e=u(2);c(),xi(" Advance when ",y(2,2,e.advancement.acknowledgment)," ",e.advancement.wait!=null?"+ "+e.advancement.wait+" ms":null," ")}}function To(n,t){if(n&1&&(o(0,"span"),l(1),r()),n&2){let e=u(2);c(),D("Advance after ",e.advancement.wait," ms")}}function Mo(n,t){if(n&1&&(o(0,"div",2)(1,"mat-icon"),l(2,"reply"),r(),f(3,Fo,3,4,"span")(4,To,2,1,"span"),r()),n&2){let e=u();c(3),h(e.advancement.acknowledgment?3:e.advancement.wait!=null?4:-1)}}function Po(n,t){if(n&1&&(d(0,"app-entry-label",0),I(1,wo,3,4,"span",null,A),C(3,"keyvalue"),o(4,"table",1),I(5,Do,6,4,"tr",null,A),C(7,"keyvalue"),r(),f(8,Mo,5,1,"div",2)),n&2){let e=t,i=u();p("text","Command: "+e.name),c(),$(y(3,2,e.extra)),c(4),$(Ye(7,4,e.args,i.insertionOrder)),c(3),h(e.advancement?8:-1)}}var mi=class n{constructor(){this.entry=Q.required();this.insertionOrder=(t,e)=>0}static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275cmp=x({type:n,selectors:[["app-stacked-command-entry"]],inputs:{entry:[1,"entry"]},standalone:!0,features:[E],decls:1,vars:1,consts:[["icon","rss_feed",3,"text"],[1,"args"],[1,"advance-on"],["width","1",1,"key"],[1,"value"],[3,"value"]],template:function(e,i){if(e&1&&f(0,Po,9,7),e&2){let a;h((a=i.entry())?0:-1,a)}},dependencies:[si,Le,w,Ki,ge,Rn,Gn,Se],styles:["[_nghost-%COMP%]{display:block;position:relative}.advance-on[_ngcontent-%COMP%]{color:#000000a7;font-size:12px}.advance-on[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{vertical-align:middle}.advance-on[_ngcontent-%COMP%] > mat-icon[_ngcontent-%COMP%]{transform:rotate(180deg);font-size:12px;height:12px;width:12px}table.args[_ngcontent-%COMP%]{margin:0 0 0 18px;font-size:10px}table.args[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:0;border:0}table.args[_ngcontent-%COMP%] td.key[_ngcontent-%COMP%]{min-width:120px;white-space:nowrap}table.args[_ngcontent-%COMP%] td.value[_ngcontent-%COMP%]{color:gray;padding-left:10px}"],changeDetection:0})}};function Vo(n,t){n&1&&d(0,"app-markdown",0),n&2&&p("text",t.renderedText())}var pi=class n{constructor(){this.entry=Q.required()}static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275cmp=x({type:n,selectors:[["app-stacked-text-entry"]],inputs:{entry:[1,"entry"]},standalone:!0,features:[E],decls:1,vars:1,consts:[[3,"text"]],template:function(e,i){if(e&1&&f(0,Vo,1,1,"app-markdown",0),e&2){let a;h((a=i.entry())?0:-1,a)}},dependencies:[tt,w],styles:["[_nghost-%COMP%]{display:block;position:relative}"],changeDetection:0})}};function Oo(n,t){n&1&&l(0," = ")}function No(n,t){n&1&&l(0," != ")}function Ao(n,t){n&1&&l(0," < ")}function Io(n,t){n&1&&l(0," <= ")}function $o(n,t){n&1&&l(0," > ")}function Ro(n,t){n&1&&l(0," >= ")}function jo(n,t){if(n&1&&(o(0,"td",10),l(1),f(2,Oo,1,0)(3,No,1,0)(4,Ao,1,0)(5,Io,1,0)(6,$o,1,0)(7,Ro,1,0),l(8),r()),n&2){let e,i=t.$implicit;c(),D(" ",i.parameter," "),c(),h((e=i.operator)==="eq"?2:e==="neq"?3:e==="lt"?4:e==="lte"?5:e==="gt"?6:e==="gte"?7:-1),c(6),D(" ",i.value," ")}}function Bo(n,t){n&1&&(o(0,"span",12),l(1,"satisfied"),r())}function Lo(n,t){n&1&&(o(0,"span",13),l(1,"not satisfied"),r())}function Yo(n,t){if(n&1&&(o(0,"td",11),f(1,Bo,2,0,"span",12)(2,Lo,2,0,"span",13),d(3,"app-live-expression",14,0),r()),n&2){let e=t.$implicit,i=X(4);c(),h(i.result()===!0?1:2),c(2),p("expression",e.expression)}}function Go(n,t){n&1&&(o(0,"span"),l(1,"\u2193"),r())}function Uo(n,t){n&1&&(o(0,"span"),l(1,"\u2191"),r())}function qo(n,t){if(n&1&&(o(0,"ya-expirable",16),l(1),C(2,"value"),f(3,Go,2,0,"span")(4,Uo,2,0,"span"),r()),n&2){let e=u().$implicit;p("pval",e.pval),c(),D(" ",y(2,4,e.pval.engValue)," "),c(2),h(e.pval.rangeCondition==="LOW"?3:-1),c(),h(e.pval.rangeCondition==="HIGH"?4:-1)}}function Ho(n,t){n&1&&l(0," - ")}function Wo(n,t){if(n&1&&(o(0,"td",15),f(1,qo,5,6,"ya-expirable",16)(2,Ho,1,0),r()),n&2){let e,i=t.$implicit;c(),h((e=i.pval==null?null:i.pval.engValue)?1:2,e)}}function Qo(n,t){n&1&&d(0,"tr",17)}function zo(n,t){if(n&1&&(o(0,"table",2),j(1,3),f(2,jo,9,3,"td",4),B(),j(3,5),f(4,Yo,5,2,"td",6),B(),j(5,7),f(6,Wo,3,1,"td",8),B(),f(7,Qo,1,0,"tr",9),r()),n&2){let e=u();p("dataSource",e.dataSource)("trackBy",e.tableTrackerFn),c(7),p("matRowDefColumns",e.displayedColumns)}}var di=class n{constructor(){this.entry=Q.required();this.pvals=Q.required();this.dataSource=new Qe;this.displayedColumns=["expression","evaluation","value"];this.tableTrackerFn=(t,e)=>t;kt(()=>{let t=this.pvals(),e=[];for(let i of this.entry().condition){let a=`'${i.parameter}'`;switch(i.operator){case"eq":a+=" == ";break;case"neq":a+=" != ";break;case"lt":a+=" < ";break;case"lte":a+=" <= ";break;case"gt":a+=" > ";break;case"gte":a+=" >= ";break}typeof i.value=="string"?i.value==="true"?a+="true":i.value==="false"?a+="false":isNaN(i.value)?a+=`"${i.value}"`:a+=i.value:a+=`${i.value}`;let s={parameter:i.parameter,operator:i.operator,value:i.value,expression:a,pval:t[i.parameter]};e.push(s)}this.dataSource.data=e})}static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275cmp=x({type:n,selectors:[["app-stacked-verify-entry"]],inputs:{entry:[1,"entry"],pvals:[1,"pvals"]},standalone:!0,features:[E],decls:2,vars:1,consts:[["expr",""],["icon","checklist_rtl","text","Verify:"],["mat-table","",1,"ya-data-table","no-frame",3,"dataSource","trackBy"],["matColumnDef","expression"],["mat-cell","","style","width: 400px",4,"matCellDef"],["matColumnDef","evaluation"],["mat-cell","","style","width: 80px",4,"matCellDef"],["matColumnDef","value"],["mat-cell","",4,"matCellDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-cell","",2,"width","400px"],["mat-cell","",2,"width","80px"],[1,"evaluation","valid"],[1,"evaluation","invalid"],[2,"display","none",3,"expression"],["mat-cell",""],[3,"pval"],["mat-row",""]],template:function(e,i){if(e&1&&(d(0,"app-entry-label",1),f(1,zo,8,3,"table",2)),e&2){let a;c(),h((a=i.entry())?1:-1,a)}},dependencies:[Le,ia,w,Me,Ve,Pe,We,Oe,Ne,Wt,Se],styles:["[_nghost-%COMP%]{display:block;position:relative}table[_ngcontent-%COMP%]{padding-left:18px;padding-right:18px;background-color:#fafafa}[_nghost-%COMP%] tr.mat-mdc-row{background:#fafafa}[_nghost-%COMP%] td:first-child{padding-left:0!important}.evaluation[_ngcontent-%COMP%]{font-family:Roboto Mono,monospace;background-color:#ffeef0;color:red;padding-left:2px;padding-right:2px}.evaluation.valid[_ngcontent-%COMP%]{background-color:#e6ffed;color:#00c752}"],changeDetection:0})}};function Ko(n,t){n&1&&(o(0,"mat-icon",1),l(1,"check_circle_outline"),r())}function Xo(n,t){n&1&&(o(0,"mat-icon",2),l(1,"sync"),r())}function Jo(n,t){n&1&&(o(0,"mat-icon",3),l(1,"highlight_off"),r())}function Zo(n,t){n&1&&(o(0,"mat-icon",4),l(1,"block"),r())}function er(n,t){if(n&1&&f(0,Ko,2,0,"mat-icon",1)(1,Xo,2,0,"mat-icon",2)(2,Jo,2,0,"mat-icon",3)(3,Zo,2,0,"mat-icon",4),n&2){let e,i=u();h((e=i.comparison.status())==="ok"?0:e==="pending"?1:e==="nok"?2:e==="cancelled"?3:-1)}}function tr(n,t){n&1&&(o(0,"mat-icon",0),l(1,"lens"),r())}var ui=class n{static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275cmp=x({type:n,selectors:[["app-verify-icon"]],inputs:{comparison:"comparison"},standalone:!0,features:[E],decls:2,vars:1,consts:[["matTooltip","Unknown",1,"icon16","nvl"],["matTooltip","Condition satisfied",1,"icon16","ok"],["matTooltip","Verifying condition",1,"icon16","pending"],["matTooltip","Condition not satisfied",1,"icon16","failed"],["matTooltip","Verification cancelled",1,"icon16","cancelled"]],template:function(e,i){e&1&&f(0,er,4,1)(1,tr,2,0,"mat-icon",0),e&2&&h(i.comparison.status?0:1)},dependencies:[w,ge,Fe],styles:["[_nghost-%COMP%]{line-height:0;font-size:0}.ok[_ngcontent-%COMP%]{color:#00c752}.pending[_ngcontent-%COMP%]{color:gray;animation:_ngcontent-%COMP%_yspin 2s infinite linear}.cancelled[_ngcontent-%COMP%]{color:gray}.failed[_ngcontent-%COMP%]{color:var(--y-error-color)}.nvl[_ngcontent-%COMP%]{color:gray}@keyframes _ngcontent-%COMP%_yspin{0%{-webkit-transform:rotate(0deg) scaleX(-1);transform:rotate(0) scaleX(-1)}to{-webkit-transform:rotate(359deg) scaleX(-1);transform:rotate(359deg) scaleX(-1)}}"],changeDetection:0})}};function ir(n,t){if(n&1&&(o(0,"tr")(1,"td",0)(2,"div",1),d(3,"app-verify-icon",2),r()(),o(4,"td",3),l(5),r(),o(6,"td"),l(7),C(8,"value"),r()()),n&2){let e,i=t.$implicit;c(3),p("comparison",i),c(2),D(" ",i.parameter," "),c(2),de((e=y(8,3,i.pval==null?null:i.pval.engValue))!==null&&e!==void 0?e:"-")}}var fi=class n{static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275cmp=x({type:n,selectors:[["app-verify-table"]],inputs:{entry:"entry"},standalone:!0,features:[E],decls:3,vars:0,consts:[[2,"width","16px"],[2,"display","flex","align-items","center"],[3,"comparison"],[2,"padding-right","20px"]],template:function(e,i){e&1&&(o(0,"table"),I(1,ir,9,5,"tr",null,A),r()),e&2&&(c(),$(i.entry.pvals))},dependencies:[ui,w,Se],styles:["table[_ngcontent-%COMP%]{width:auto}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border:none;padding:0}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:not(:first-child){padding-left:10px}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{font-size:12px;line-height:16px}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#000000a7}"]})}};var ar=["entryParent"],or=n=>({c:n}),rr=()=>[];function lr(n,t){if(n&1){let e=F();o(0,"ya-page-button",27),g("clicked",function(){S(e);let a=u();return k(a.openScheduleStackDialog())}),l(1," Schedule "),r()}if(n&2){let e=u();p("disabled",!e.loaded||e.format!=="ycs"||!e.entries$.value.length)}}function cr(n,t){n&1&&d(0,"ya-dots")}function sr(n,t){n&1&&(o(0,"ya-empty-message")(1,"mat-icon",28),l(2,"link_off"),r(),l(3," Unsupported stack format "),r())}function mr(n,t){n&1&&(o(0,"ya-empty-message"),l(1," Empty stack "),d(2,"br"),l(3," Click "),o(4,"mat-icon",29),l(5,"add_circle_outline"),r(),l(6," to start adding steps "),r())}function pr(n,t){n&1&&l(0," [*]: ")}function dr(n,t){if(n&1&&l(0),n&2){let e=u().$implicit;D(" [",e.executionNumber,"]: ")}}function ur(n,t){n&1&&l(0," [ ]: ")}function fr(n,t){if(n&1&&(d(0,"app-stacked-check-entry",34),C(1,"async")),n&2){let e=u().$implicit,i=u();p("entry",e)("pvals",y(1,2,i.pvals$))}}function _r(n,t){if(n&1&&d(0,"app-stacked-command-entry",35),n&2){let e=u().$implicit;p("entry",e)}}function gr(n,t){if(n&1&&d(0,"app-stacked-text-entry",35),n&2){let e=u().$implicit;p("entry",e)}}function Cr(n,t){if(n&1&&(d(0,"app-stacked-verify-entry",34),C(1,"async")),n&2){let e=u().$implicit,i=u();p("entry",e)("pvals",y(1,2,i.pvals$))}}function yr(n,t){if(n&1&&(o(0,"div",36)(1,"div",38)(2,"mat-icon",39),l(3,"info"),r(),o(4,"span",40),l(5,"Info"),r()(),d(6,"app-markdown",41),r()),n&2){let e=u().$implicit;c(6),p("text",e.comment)}}function hr(n,t){if(n&1&&l(0),n&2){let e=u(2).$implicit;D(" ",e.err," ")}}function vr(n,t){if(n&1&&(o(0,"div",44),d(1,"app-extra-acknowledgments-table",43),r()),n&2){let e=u(3).$implicit;c(),p("command",e.record)("inline",!0)}}function Sr(n,t){if(n&1&&(d(0,"app-yamcs-acknowledgments-table",43),f(1,vr,2,2,"div",44)),n&2){let e=u(2).$implicit;p("command",e.record)("inline",!0),c(),h(((e.record==null?null:e.record.extra)||Ue(3,rr)).length?1:-1)}}function kr(n,t){if(n&1&&(o(0,"tr")(1,"td",45),l(2),r(),o(3,"td"),l(4),C(5,"value"),r()()),n&2){let e,i=t.$implicit;c(2),de(i.parameter),c(2),de((e=y(5,2,i.pval==null?null:i.pval.engValue))!==null&&e!==void 0?e:"-")}}function br(n,t){if(n&1&&(o(0,"table"),I(1,kr,6,4,"tr",null,A),r()),n&2){let e=u(2).$implicit;c(),$(e.pvals)}}function xr(n,t){if(n&1&&d(0,"app-verify-table",35),n&2){let e=u(2).$implicit;p("entry",e)}}function Er(n,t){if(n&1){let e=F();o(0,"div",37)(1,"div",42),g("click",function(){S(e);let a=u().$implicit,s=u();return k(s.selectEntry(a))}),r(),o(2,"div",33),f(3,hr,1,1)(4,Sr,2,4)(5,br,3,0,"table")(6,xr,1,1,"app-verify-table",35),r()()}if(n&2){let e=u().$implicit;c(2),pe("err",e.err),c(),h(e.err?3:e.type==="command"?4:e.type==="check"?5:e.type==="verify"?6:-1)}}function wr(n,t){if(n&1){let e=F();o(0,"div",30),C(1,"async"),g("click",function(){let a=S(e).$implicit,s=u();return k(s.selectEntry(a))})("dblclick",function(){let a=S(e).$implicit,s=u();return k(s.editEntry(a))}),o(2,"div",31)(3,"div",32),f(4,pr,1,0)(5,dr,1,1)(6,ur,1,0),r(),o(7,"div",33),f(8,fr,2,4,"app-stacked-check-entry",34)(9,_r,1,1,"app-stacked-command-entry",35)(10,gr,1,1,"app-stacked-text-entry",35)(11,Cr,2,4,"app-stacked-verify-entry",34)(12,yr,7,1,"div",36),r()(),f(13,Er,7,3,"div",37),r()}if(n&2){let e=t.$implicit,i=u();pe("display-text",e.type==="text")("selected",e===y(1,8,i.selectedEntry$)),c(4),h(e.executing?4:e.executionNumber===0||e.executionNumber?5:e.executionNumber!==0&&!e.executionNumber?6:-1),c(4),h(e.type==="check"?8:e.type==="command"?9:e.type==="text"?10:e.type==="verify"?11:-1),c(4),h(e.comment?12:-1),c(),h(e.hasOutputs()?13:-1)}}var _i=class n{constructor(t,e,i,a,s,m,v,b,z){this.dialog=t;this.yamcs=e;this.title=i;this.authService=a;this.configService=s;this.messageService=m;this.sanitizer=v;this.appearanceService=b;this.stackFileService=z;this.running$=new N(!1);this.runningStack=!1;this.stepScopedSubscriptions=[];this.selectedEntry$=new N(null);this.clipboardEntry$=new N(null);this.commandHistoryRecords=new Map;this.executionCounter=0;this.loaded=!1;this.nextEntryScheduled=!1;this.idMapping={};this.pvals$=new N({});this.bucket=s.getStackBucket(),this.entries$=z.entries$,this.hasState$=z.hasState$,this.parameterSubscription=e.yamcsClient.createParameterSubscription({instance:e.instance,processor:e.processor,action:"REPLACE",abortOnInvalid:!1,sendFromCache:!0,updateOnExpiration:!0,id:[]},ye=>{if(ye.mapping&&(this.idMapping=ye.mapping),ye.values){let ot=K({},this.pvals$.value);for(let Vi of ye.values){let Oi=this.idMapping[Vi.numericId];Oi&&(ot[Oi.name]=Vi)}this.pvals$.next(ot)}})}ngOnInit(){let t=this.objectName.lastIndexOf("/");if(t===-1)this.folderLink="/procedures/stacks/browse/",this.filename=this.objectName;else{let a=this.objectName.substring(0,t);this.folderLink="/procedures/stacks/browse/"+a,this.filename=this.objectName.substring(t+1)}this.title.setTitle(this.filename);let e=le.getExtension(le.getFilename(this.objectName))?.toLowerCase();if(e==="ycs"||e==="xml")this.format=e;else{this.loaded=!0;return}let i=this.stackFileService.entries;this.stackFileService.updateEntries(i),this.selectedEntry$.next(i.length?i[0]:null),this.updateParameterSubscription(),this.loaded=!0,this.commandSubscription=this.yamcs.yamcsClient.createCommandSubscription({instance:this.yamcs.instance,processor:this.yamcs.processor,ignorePastCommands:!0},a=>{let s=a.id,m=this.commandHistoryRecords.get(s);m?m=m.mergeEntry(a):m=new Fn(a),this.commandHistoryRecords.set(s,m);for(let b of this.stackFileService.entries$.value)if(b instanceof fe&&b.id===s){b.record=m;break}let v=this.selectedEntry$.value;v&&v instanceof fe&&this.checkAckContinueRunning(v,m)})}handleDrop(t){t.previousIndex!==t.currentIndex&&(fn(this.entries$.value,t.previousIndex,t.currentIndex),this.stackFileService.updateEntries([...this.entries$.value]),this.stackFileService.markDirty())}updateParameterSubscription(){let t=new Set;for(let i of this.stackFileService.entries$.value)if(i.type==="check")for(let a of i.parameters)t.add(a.parameter);else if(i.type==="verify")for(let a of i.condition)t.add(a.parameter);let e=[];t.forEach(i=>e.push({name:i})),this.parameterSubscription.addReplyListener(()=>{this.parameterSubscription.sendMessage({action:"REPLACE",instance:this.yamcs.instance,processor:this.yamcs.processor,abortOnInvalid:!1,sendFromCache:!0,updateOnExpiration:!0,id:e})})}selectEntry(t){this.selectedEntry$.next(t)}deleteSelectedCommands(){let t=this.selectedEntry$.value;if(t){let e=this.entries$.value.indexOf(t);e!==-1&&(this.entries$.value.splice(e,1),this.selectedEntry$.next(null),this.stackFileService.updateEntries([...this.entries$.value]),this.stackFileService.markDirty())}}clearOutputs(){for(let t of this.entries$.value)t.clearOutputs();this.executionCounter=0,this.stackFileService.logs$.next([]),this.stackFileService.updateEntries([...this.entries$.value]),this.entries$.value.length&&this.selectEntry(this.entries$.value[0])}async runSelection(){let t=this.selectedEntry$.value;t&&(this.running$.next(!0),this.runEntry(t))}async runEntry(t){let e=++this.executionCounter,{instance:i,processor:a}=this.yamcs;if(t.clearOutputs(),t instanceof fe){let s=t.namespace??null;return this.yamcs.yamcsClient.issueCommandForNamespace(i,a,s,t.name,{sequenceNumber:e,args:t.args,stream:t.stream,extra:t.extra}).then(m=>{t.executionNumber=e,t.executing=!0,t.id=m.id;let v=`Sending command ${t}`;this.stackFileService.addLogEntry(e,v);let b=this.commandHistoryRecords.get(t.id);b&&(t.record=b,this.checkAckContinueRunning(t,b))}).catch(m=>{t.executionNumber=e,t.executing=!1,t.err=m.message||m,this.stopRun()}).finally(()=>{this.stackFileService.updateEntries([...this.entries$.value])})}else if(t instanceof xe)t.executionNumber=e,t.executing=!0,await this.runVerifyEntry(t);else if(t instanceof De){let s=[];for(let m of t.parameters){let v=this.pvals$.value;s.push({parameter:m.parameter,pval:v[m.parameter]||null})}t.pvals=s,t.executionNumber=e,this.stackFileService.updateEntries([...this.entries$.value]),this.continueRunning(t)}else t instanceof Ee&&(t.executionNumber=e,this.stackFileService.updateEntries([...this.entries$.value]),this.continueRunning(t))}async runVerifyEntry(t){let e=`Verifying ${t}`;this.stackFileService.addLogEntry(t.executionNumber,e);let i=this.pvals$.pipe();if(t.delay&&t.delay>0&&(i=i.pipe(Ri(t.delay))),i=i.pipe(gt(s=>this.testVerifyEntry(t)),ji()),t.timeout&&t.timeout>0){let s=Math.max(0,t.delay||0);i=i.pipe(Ii(s+t.timeout))}let a=i.subscribe({next:()=>this.continueRunning(t),error:s=>{s instanceof Ai&&(t.executing=!1,t.err=s.message||String(s),this.stopRun())}});this.stepScopedSubscriptions.push(a)}testVerifyEntry(t){let e=t.test(this.pvals$.value);return this.stackFileService.updateEntries([...this.entries$.value]),e}runFromSelection(){let t=this.selectedEntry$.value;if(!t){this.stopRun();return}this.running$.next(!0),this.runningStack=!0,this.nextEntryScheduled=!1,this.runEntry(t)}checkAckContinueRunning(t,e){if(!this.running$.value||this.nextEntryScheduled)return;let{advancement:i}=this.stackFileService,a=t.advancement?.acknowledgment||i.acknowledgment,s=t.advancement?.wait??i.wait;if(t.id===e.id){let m=e.acksByName[a];m&&m.status&&(m.status==="OK"||m.status==="DISABLED"?this.continueRunning(t,s):(m.status==="NOK"||m.status==="CANCELLED")&&(t.executing=!1,this.stopRun()))}}continueRunning(t,e=0){this.nextEntryScheduled=this.runningStack,this.nextCommandDelayTimeout=window.setTimeout(()=>{t.executing=!1,this.running$.value&&(this.advanceSelection(t),this.runningStack?this.runFromSelection():this.stopRun())},Math.max(e,0))}stopRun(){this.clearStepScopedSubscriptions(),this.running$.next(!1),this.runningStack=!1;for(let t of this.stackFileService.entries$.value)if(t.executing=!1,t instanceof xe)for(let e of t.pvals||[])e?.status&&e.status()==="pending"&&e.status.set("cancelled");window.clearTimeout(this.nextCommandDelayTimeout),this.nextEntryScheduled=!1}clearStepScopedSubscriptions(){this.stepScopedSubscriptions.forEach(t=>t.unsubscribe()),this.stepScopedSubscriptions.length=0}advanceSelection(t){let e=this.stackFileService.entries$.value,i=e.indexOf(t);if(i=0)}addCheckEntry(){this.dialog.open(pt,{autoFocus:!1,width:"800px",data:{edit:!1}}).afterClosed().subscribe(t=>{if(t){let e=new De(K({type:"check"},t)),i=this.selectedEntry$.value;if(i){let a=this.entries$.value,s=a.indexOf(i);a.splice(s+1,0,e),this.stackFileService.updateEntries([...this.entries$.value])}else this.stackFileService.updateEntries([...this.entries$.value,e]);this.selectEntry(e),this.stackFileService.markDirty(),this.updateParameterSubscription()}})}addVerifyEntry(){this.dialog.open(ft,{autoFocus:!1,width:"800px",data:{edit:!1}}).afterClosed().subscribe(t=>{if(t){let e=new xe(K({type:"verify"},t)),i=this.selectedEntry$.value;if(i){let a=this.entries$.value,s=a.indexOf(i);a.splice(s+1,0,e),this.stackFileService.updateEntries([...this.entries$.value])}else this.stackFileService.updateEntries([...this.entries$.value,e]);this.selectEntry(e),this.stackFileService.markDirty(),this.updateParameterSubscription()}})}addCommandEntry(){this.dialog.open(dt,{width:"70%",height:"100%",autoFocus:!1,position:{right:"0"},panelClass:"dialog-full-size",data:{okLabel:"ADD TO STACK"}}).afterClosed().subscribe(e=>{if(e){let i={type:"command",name:e.command.qualifiedName,args:e.args,comment:e.comment,stream:e.stream,extra:e.extra};e.advancement&&(i.advancement=e.advancement);let a=this.configService.getConfig();if(a.preferredNamespace){for(let v of e.command.alias||[])if(v.namespace===a.preferredNamespace){i.name=v.name,i.namespace=v.namespace;break}}let s=new fe(i);s.command=e.command;let m=this.selectedEntry$.value;if(m){let v=this.entries$.value,b=v.indexOf(m);v.splice(b+1,0,s),this.stackFileService.updateEntries([...this.entries$.value])}else this.stackFileService.updateEntries([...this.entries$.value,s]);this.selectEntry(s),this.stackFileService.markDirty()}})}addTextEntry(){this.dialog.open(ut,{autoFocus:!1,width:"800px",data:{edit:!1}}).afterClosed().subscribe(t=>{if(t){let e=new Ee({type:"text",text:t}),i=this.selectedEntry$.value;if(i){let a=this.entries$.value,s=a.indexOf(i);a.splice(s+1,0,e),this.stackFileService.updateEntries([...this.entries$.value])}else this.stackFileService.updateEntries([...this.entries$.value,e]);this.selectEntry(e),this.stackFileService.markDirty()}})}editSelectedEntry(){let t=this.selectedEntry$.value;this.editEntry(t)}editEntry(t){return this.selectEntry(t),t instanceof fe?this.dialog.open(dt,{width:"70%",height:"100%",autoFocus:!1,position:{right:"0"},panelClass:"dialog-full-size",data:{okLabel:"UPDATE",entry:t}}).afterClosed().subscribe(e=>{if(e){let i={type:"command",name:e.command.qualifiedName,args:e.args,comment:e.comment,stream:e.stream,extra:e.extra,advancement:e.advancement},a=this.configService.getConfig();if(a.preferredNamespace){for(let b of e.command.alias||[])if(b.namespace===a.preferredNamespace){i.name=b.name,i.namespace=b.namespace;break}}let s=new fe(i);s.command=e.command;let m=this.entries$.value,v=m.indexOf(t);m.splice(v,1,s),this.stackFileService.updateEntries([...this.entries$.value]),this.selectEntry(s),this.stackFileService.markDirty()}}):t instanceof De?this.dialog.open(pt,{autoFocus:!1,width:"800px",data:{edit:!0,entry:t}}).afterClosed().subscribe(e=>{if(e){let i=new De(K({type:"check"},e)),a=this.entries$.value,s=a.indexOf(t);a.splice(s,1,i),this.stackFileService.updateEntries([...this.entries$.value]),this.selectEntry(i),this.stackFileService.markDirty(),this.updateParameterSubscription()}}):t instanceof Ee?this.dialog.open(ut,{autoFocus:!1,width:"800px",data:{edit:!0,entry:t}}).afterClosed().subscribe(e=>{if(e){let i=new Ee({type:"text",text:e}),a=this.entries$.value,s=a.indexOf(t);a.splice(s,1,i),this.stackFileService.updateEntries([...this.entries$.value]),this.selectEntry(i),this.stackFileService.markDirty()}}):t instanceof xe&&this.dialog.open(ft,{autoFocus:!1,width:"800px",data:{edit:!0,entry:t}}).afterClosed().subscribe(e=>{if(e){let i=new xe(K({type:"verify"},e)),a=this.entries$.value,s=a.indexOf(t);a.splice(s,1,i),this.stackFileService.updateEntries([...this.entries$.value]),this.selectEntry(i),this.stackFileService.markDirty(),this.updateParameterSubscription()}}),!1}cutSelectedEntry(){let t=this.selectedEntry$.value;this.advanceSelection(t),this.clipboardEntry$.next(t);let e=this.entries$.value,i=e.indexOf(t);e.splice(i,1),this.stackFileService.updateEntries([...this.entries$.value]),this.stackFileService.markDirty()}copySelectedEntry(){let t=this.selectedEntry$.value;this.clipboardEntry$.next(t)}pasteEntry(){let t=this.clipboardEntry$.value;if(t){let e=t.copy(),i=this.selectedEntry$.value;if(i){let a=this.entries$.value,s=a.indexOf(i);a.splice(s+1,0,e),this.stackFileService.updateEntries([...this.entries$.value])}else this.stackFileService.updateEntries([...this.entries$.value,e]);this.selectEntry(e),this.stackFileService.markDirty()}}showSchedule(){let t=this.yamcs.connectionInfo$.value?.instance?.capabilities||[];return t.indexOf("timeline")!==-1&&t.indexOf("activities")!==-1&&this.authService.getUser().hasSystemPrivilege("ControlTimeline")}openScheduleStackDialog(){this.dialog.open(li,{width:"600px"}).afterClosed().subscribe(t=>{if(t){let e={type:"ACTIVITY",duration:"0s",name:this.filename,start:t.executionTime,tags:t.tags,activityDefinition:{type:"COMMAND_STACK",args:{processor:this.yamcs.processor,bucket:this.bucket,stack:this.filename}}};this.yamcs.yamcsClient.createTimelineItem(this.yamcs.instance,e).then(()=>{this.messageService.showInfo("Stack scheduled")}).catch(i=>this.messageService.showError(i))}})}setExportURLs(){let t=this.entries$.value.map(s=>s.model),e=new Ie(t,{advancement:this.stackFileService.advancement}),i=new Blob([e.toJSON()],{type:"application/json"});this.jsonBlobUrl=this.sanitizer.sanitize(bi.URL,URL.createObjectURL(i));let a=new Blob([e.toXML()],{type:"application/xml"});this.xmlBlobUrl=this.sanitizer.sanitize(bi.URL,URL.createObjectURL(a))}ngOnDestroy(){this.clearStepScopedSubscriptions(),this.parameterSubscription?.cancel(),this.commandSubscription?.cancel()}static{this.\u0275fac=function(e){return new(e||n)(_(Te),_(M),_(qe),_(Re),_(Ce),_(Ae),_(Ji),_(Tn),_(_e))}}static{this.\u0275cmp=x({type:n,selectors:[["ng-component"]],viewQuery:function(e,i){if(e&1&&ne(ar,5),e&2){let a;ae(a=oe())&&(i.entryParent=a.first)}},inputs:{objectName:"objectName"},standalone:!0,features:[E],decls:88,vars:71,consts:[["addEntryMenu","matMenu"],["exportMenu","matMenu"],["entryParent",""],["icon","arrow_back",3,"routerLink","queryParams"],["matTooltip","Save stack","icon","save",3,"clicked","disabled"],["vertical","",2,"height","100%"],["matTooltip","Add a step below","icon","add_circle_outline","dropdown","true",3,"disabled","matMenuTriggerFor"],[1,"ya-menu"],["mat-menu-item","",3,"click"],["matTooltip","Edit the selected step","icon","edit",3,"clicked","disabled"],["matTooltip","Cut the selected step","icon","content_cut",3,"clicked","disabled"],["matTooltip","Copy the selected step","icon","content_copy",3,"clicked","disabled"],["matTooltip","Paste entry from the clipboard","icon","content_paste",3,"clicked","disabled"],["matTooltip","Run the selected step","icon","play_arrow",3,"clicked","disabled"],["matTooltip","Stop current execution","icon","stop",3,"clicked","disabled"],["matTooltip","Clear all outputs","icon","refresh",3,"clicked","disabled"],["matTooltip","Run all from selected step","icon","playlist_play",3,"clicked","disabled"],["matTooltip","Run stack at a later time","icon","schedule",3,"disabled"],["matTooltip","Export stack","icon","open_in_new",3,"clicked","matMenuTriggerFor","disabled"],["mat-menu-item","",3,"href","download"],[2,"vertical-align","middle"],[2,"color","#cc0000"],[1,"main-pane"],[3,"objectName"],["cdkDropList","",1,"tab-content",3,"cdkDropListDropped"],["id","drag-boundary"],["cdkDrag","","cdkDragBoundary","#drag-boundary",1,"entry",3,"display-text","selected"],["matTooltip","Run stack at a later time","icon","schedule",3,"clicked","disabled"],[2,"vertical-align","bottom","margin-right","10px"],["inline","",2,"vertical-align","bottom"],["cdkDrag","","cdkDragBoundary","#drag-boundary",1,"entry",3,"click","dblclick"],[1,"in"],["cdkDragHandle","",1,"seq"],[1,"body"],[3,"entry","pvals"],[3,"entry"],[1,"comment"],[1,"out"],[1,"title"],[1,"icon14"],[1,"text"],[3,"text"],[1,"seq",3,"click"],[3,"command","inline"],[1,"block"],[2,"padding-right","20px"]],template:function(e,i){if(e&1){let a=F();o(0,"app-instance-page")(1,"app-instance-toolbar"),d(2,"ya-page-icon-button",3),l(3),C(4,"basename"),o(5,"ya-page-button",4),C(6,"async"),g("clicked",function(){return S(a),k(i.stackFileService.saveStack())}),l(7," Save "),r(),d(8,"mat-divider",5),o(9,"ya-page-button",6),C(10,"async"),l(11," Add step "),r(),o(12,"mat-menu",7,0)(14,"a",8),g("click",function(){return S(a),k(i.addTextEntry())}),o(15,"mat-icon"),l(16,"notes"),r(),l(17," Display text "),r(),d(18,"mat-divider"),o(19,"a",8),g("click",function(){return S(a),k(i.addCheckEntry())}),o(20,"mat-icon"),l(21,"toll"),r(),l(22," List parameters "),r(),o(23,"a",8),g("click",function(){return S(a),k(i.addVerifyEntry())}),o(24,"mat-icon"),l(25,"checklist_rtl"),r(),l(26," Verify parameters "),r(),d(27,"mat-divider"),o(28,"a",8),g("click",function(){return S(a),k(i.addCommandEntry())}),o(29,"mat-icon"),l(30,"rss_feed"),r(),l(31," Send command "),r()(),o(32,"ya-page-icon-button",9),C(33,"async"),C(34,"async"),g("clicked",function(){return S(a),k(i.editSelectedEntry())}),r(),o(35,"ya-page-icon-button",10),C(36,"async"),C(37,"async"),g("clicked",function(){return S(a),k(i.cutSelectedEntry())}),r(),o(38,"ya-page-icon-button",11),C(39,"async"),C(40,"async"),g("clicked",function(){return S(a),k(i.copySelectedEntry())}),r(),o(41,"ya-page-icon-button",12),C(42,"async"),C(43,"async"),g("clicked",function(){return S(a),k(i.pasteEntry())}),r(),d(44,"mat-divider",5),o(45,"ya-page-icon-button",13),C(46,"async"),C(47,"async"),g("clicked",function(){return S(a),k(i.runSelection())}),r(),o(48,"ya-page-icon-button",14),C(49,"async"),g("clicked",function(){return S(a),k(i.stopRun())}),r(),o(50,"ya-page-icon-button",15),C(51,"async"),C(52,"async"),g("clicked",function(){return S(a),k(i.clearOutputs())}),r(),o(53,"ya-page-icon-button",16),C(54,"async"),C(55,"async"),g("clicked",function(){return S(a),k(i.runFromSelection())}),r(),d(56,"mat-divider",5),f(57,lr,2,1,"ya-page-button",17),d(58,"mat-divider",5),o(59,"ya-page-button",18),g("clicked",function(){return S(a),k(i.setExportURLs())}),l(60," Export "),r(),o(61,"mat-menu",7,1)(63,"a",19),C(64,"basename"),o(65,"mat-icon"),l(66,"data_object"),r(),l(67," YCS FILE "),r(),o(68,"a",19),C(69,"basename"),o(70,"mat-icon"),l(71,"code"),r(),o(72,"span",20),l(73," XML FILE "),o(74,"span",21),l(75,"(legacy)"),r()()()()(),o(76,"div",22)(77,"app-stack-file-page-tabs",23),f(78,cr,1,0,"ya-dots"),C(79,"async"),r(),f(80,sr,4,0,"ya-empty-message")(81,mr,7,0,"ya-empty-message"),o(82,"div",24,2),g("cdkDropListDropped",function(m){return S(a),k(i.handleDrop(m))}),o(84,"div",25),I(85,wr,14,10,"div",26,A),C(87,"async"),r()()()()}if(e&2){let a=X(13),s=X(62);c(2),p("routerLink",i.folderLink)("queryParams",re(69,or,i.yamcs.context)),c(),D(" ",y(4,25,i.filename)," \xA0\xA0\xA0 "),c(2),p("disabled",!y(6,27,i.stackFileService.dirty$)),c(4),p("disabled",!i.format||y(10,29,i.running$))("matMenuTriggerFor",a),c(23),p("disabled",!i.format||y(33,31,i.running$)||!y(34,33,i.selectedEntry$)),c(3),p("disabled",!i.format||y(36,35,i.running$)||!y(37,37,i.selectedEntry$)),c(3),p("disabled",!i.format||y(39,39,i.running$)||!y(40,41,i.selectedEntry$)),c(3),p("disabled",!i.format||y(42,43,i.running$)||!y(43,45,i.clipboardEntry$)),c(4),p("disabled",!i.format||y(46,47,i.running$)||!y(47,49,i.selectedEntry$)),c(3),p("disabled",!i.format||!y(49,51,i.running$)),c(2),p("disabled",!i.format||y(51,53,i.running$)||!y(52,55,i.hasState$)),c(3),p("disabled",!i.format||y(54,57,i.running$)||!y(55,59,i.selectedEntry$)),c(4),h(i.showSchedule()?57:-1),c(2),p("matMenuTriggerFor",s)("disabled",!i.format),c(4),p("href",i.jsonBlobUrl,rt)("download",y(64,61,i.filename)+".ycs"),c(5),p("href",i.xmlBlobUrl,rt)("download",y(69,63,i.filename)+".xml"),c(9),p("objectName",i.objectName),c(),h(y(79,65,i.running$)?78:-1),c(2),h(i.loaded&&!i.format?80:-1),c(),h(i.loaded&&i.format&&!i.entries$.value.length?81:-1),c(4),$(y(87,67,i.entries$))}},dependencies:[Kn,ke,be,tt,ci,mi,pi,di,Be,fi,w,ee,ve,Cn,gn,_n,ge,Nt,Pt,He,Vt,Fe,Mn,Ht,$e,Ze,et,Se,Xn],styles:["[_nghost-%COMP%] h1, [_nghost-%COMP%] h2, [_nghost-%COMP%] h3, [_nghost-%COMP%] h4, [_nghost-%COMP%] h5, [_nghost-%COMP%] h6{margin-top:0;line-height:1em}.main-pane[_ngcontent-%COMP%]{position:absolute;inset:0;padding:24px}.tab-content[_ngcontent-%COMP%]{position:absolute;inset:60px 0 0;overflow:auto;padding:24px}.ya-data-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{vertical-align:top}div.entry[_ngcontent-%COMP%]{font-size:12px;line-height:17px;color:#000000a7}div.entry[_ngcontent-%COMP%] div.in[_ngcontent-%COMP%], div.entry[_ngcontent-%COMP%] div.out[_ngcontent-%COMP%]{display:flex;border-left:8px solid transparent;margin-bottom:10px}div.entry.selected[_ngcontent-%COMP%] div.in[_ngcontent-%COMP%], div.entry.selected[_ngcontent-%COMP%] div.out[_ngcontent-%COMP%]{border-color:var(--y-accent)}div.entry[_ngcontent-%COMP%] .seq[_ngcontent-%COMP%]{width:64px;text-align:right;padding-top:0;padding-right:10px;user-select:none;-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;font-family:Roboto Mono,monospace;color:#bdbdbd}div.entry[_ngcontent-%COMP%] div.in[_ngcontent-%COMP%] .seq[_ngcontent-%COMP%]{cursor:move}div.entry.selected[_ngcontent-%COMP%] .seq[_ngcontent-%COMP%]{color:var(--y-accent)}div.entry[_ngcontent-%COMP%] .body[_ngcontent-%COMP%]{flex-grow:1;padding:5px}div.entry.display-text[_ngcontent-%COMP%] .body[_ngcontent-%COMP%]{padding:0}div.entry[_ngcontent-%COMP%] div.in[_ngcontent-%COMP%] .body[_ngcontent-%COMP%]{background-color:#fafafa;border:1px solid rgb(224,224,224);font-family:Roboto Mono,monospace}div.entry.display-text[_ngcontent-%COMP%] div.in[_ngcontent-%COMP%] .body[_ngcontent-%COMP%]{background-color:inherit;border-color:transparent}div.entry[_ngcontent-%COMP%] div.out[_ngcontent-%COMP%] .body.err[_ngcontent-%COMP%]{background-color:#fcc;color:var(--y-error-color)}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:.6}.comment[_ngcontent-%COMP%]{margin-top:1em;margin-left:5px;border-left:5px solid rgb(224,224,224);padding:1em}.comment[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;align-items:center;font-weight:500}.comment[_ngcontent-%COMP%] .title[_ngcontent-%COMP%] .display-text[_ngcontent-%COMP%]{margin-left:5px}"],changeDetection:0})}};var Dr=["filename"],gi=class n{constructor(t,e,i,a,s){this.dialogRef=t;this.data=s;this.bucket=a.getStackBucket(),this.storageClient=i.createStorageClient(),this.filenameForm=e.group({name:["",[L.required]],format:["ycs",[L.required]]})}save(){let t=this.filenameForm.get("format").value,e=this.filenameForm.get("name").value.trim()+"."+t,i=this.data.path;i.startsWith("/")&&(i=i.substring(1));let a=i?i+"/"+e:e,s=this.data.prefix+a,m=t==="xml"?new Ie([],{}).toXML():new Ie([],{}).toJSON(),v=t==="xml"?"application/xml":"application/json",b=new Blob([m],{type:v});this.storageClient.uploadObject(this.bucket,s,b).then(()=>{this.dialogRef.close(a)})}static{this.\u0275fac=function(e){return new(e||n)(_(H),_(se),_(M),_(Ce),_(me))}}static{this.\u0275cmp=x({type:n,selectors:[["app-create-stack-dialog"]],viewQuery:function(e,i){if(e&1&&ne(Dr,5),e&2){let a;ae(a=oe())&&(i.filenameInput=a.first)}},standalone:!0,features:[E],decls:21,vars:4,consts:[["filename",""],["mat-dialog-title",""],[1,"ya-form",3,"formGroup"],["type","text","formControlName","name"],["formControlName","format"],["value","ycs"],["value","xml"],["align","end"],["mat-dialog-close",""],["appearance","primary",3,"click","disabled"]],template:function(e,i){if(e&1){let a=F();o(0,"h2",1),l(1,"Create stack"),r(),o(2,"mat-dialog-content")(3,"form",2)(4,"label"),l(5," Name "),d(6,"input",3,0),r(),d(8,"br"),o(9,"label"),l(10," Format "),o(11,"select",4)(12,"option",5),l(13,"YCS"),r(),o(14,"option",6),l(15,"XML (deprecated)"),r()()()()(),o(16,"mat-dialog-actions",7)(17,"ya-button",8),l(18,"CANCEL"),r(),o(19,"ya-button",9),g("click",function(){return S(a),k(i.save())}),l(20,"SAVE"),r()()}if(e&2){let a;c(3),p("formGroup",i.filenameForm),c(),pe("invalid",(a=i.filenameForm.get("name"))==null?null:a.invalid),c(15),p("disabled",!i.filenameForm.valid)}},dependencies:[w,G,cn,sn,ce,ln,V,Y,U,q,W,ie,Z,J,O],encapsulation:2})}};var Ci=class n{constructor(t,e,i,a){this.dialogRef=t;this.data=a;this.storageClient=i.createStorageClient(),this.form=e.group({name:["",L.required]})}save(){let{path:t,bucket:e}=this.data;t.startsWith("/")&&(t=t.substring(1));let i=this.form.value.name,a=t?`${t}/${i}/`:`${i}/`;this.storageClient.uploadObject(e,a,new Blob).then(()=>this.dialogRef.close(!0))}static{this.\u0275fac=function(e){return new(e||n)(_(H),_(se),_(M),_(me))}}static{this.\u0275cmp=x({type:n,selectors:[["app-create-stack-folder-dialog"]],standalone:!0,features:[E],decls:12,vars:2,consts:[["mat-dialog-title",""],[1,"ya-form",3,"formGroup"],["type","text","formControlName","name","pattern","\\w[\\w\\s\\.\\-\\(\\)\\[\\]]*"],["align","end"],["mat-dialog-close",""],["appearance","primary",3,"click","disabled"]],template:function(e,i){e&1&&(o(0,"h2",0),l(1,"Create folder"),r(),o(2,"mat-dialog-content")(3,"form",1)(4,"label"),l(5," Folder name "),d(6,"input",2),r()()(),o(7,"mat-dialog-actions",3)(8,"ya-button",4),l(9,"CANCEL"),r(),o(10,"ya-button",5),g("click",function(){return i.save()}),l(11,"CREATE"),r()()),e&2&&(c(3),p("formGroup",i.form),c(7),p("disabled",!i.form.valid))},dependencies:[w,G,ce,V,Y,pn,U,q,W,ie,Z,J,O],encapsulation:2,changeDetection:0})}};var yi=class n{constructor(t,e,i,a,s){this.dialogRef=t;this.data=s;this.storageClient=i.createStorageClient(),this.bucket=a.getStackBucket();let m=le.getBasename(le.getFilename(this.data.name));this.filenameForm=e.group({name:[m,[L.required]]})}async rename(){let t,e=this.data.name.lastIndexOf("/");e!==-1&&(t=this.data.name.substring(0,e+1));let a=await(await this.storageClient.getObject(this.bucket,this.data.name)).blob(),s=le.getExtension(le.getFilename(this.data.name))?.toLowerCase(),m=(t||"")+this.filenameForm.get("name").value+(s?"."+s:"");m!==this.data.name&&(await this.storageClient.uploadObject(this.bucket,m,a),await this.storageClient.deleteObject(this.bucket,this.data.name)),this.dialogRef.close(m)}static{this.\u0275fac=function(e){return new(e||n)(_(H),_(se),_(M),_(Ce),_(me))}}static{this.\u0275cmp=x({type:n,selectors:[["app-rename-stack-dialog"]],standalone:!0,features:[E],decls:13,vars:4,consts:[["filename",""],["mat-dialog-title",""],[1,"ya-form",3,"formGroup"],["type","text","formControlName","name"],["align","end"],["mat-dialog-close",""],["appearance","primary",3,"click","disabled"]],template:function(e,i){if(e&1){let a=F();o(0,"h2",1),l(1,"Rename stack"),r(),o(2,"mat-dialog-content")(3,"form",2)(4,"label"),l(5," Name "),d(6,"input",3,0),r()()(),o(8,"mat-dialog-actions",4)(9,"ya-button",5),l(10,"CANCEL"),r(),o(11,"ya-button",6),g("click",function(){return S(a),k(i.rename())}),l(12," RENAME "),r()()}if(e&2){let a;c(3),p("formGroup",i.filenameForm),c(),pe("invalid",(a=i.filenameForm.get("name"))==null?null:a.invalid),c(7),p("disabled",!i.filenameForm.valid)}},dependencies:[w,G,ce,V,Y,U,q,W,ie,Z,J,O],encapsulation:2})}};var Fr=["droparea"],Tr=["uploader"],vi=n=>({c:n});function Mr(n,t){if(n&1){let e=F();o(0,"ya-page-button",10),g("clicked",function(){S(e);let a=u();return k(a.createStack())}),l(1," Create stack "),r()}}function Pr(n,t){if(n&1){let e=F();o(0,"ya-page-button",11),g("clicked",function(){S(e);let a=u();return k(a.openUploadDialog())}),l(1," Upload stack "),o(2,"input",12,1),g("change",function(){S(e);let a=u();return k(a.importStack())}),r()()}}function Vr(n,t){if(n&1){let e=F();o(0,"ya-page-button",13),g("clicked",function(){S(e);let a=u();return k(a.createFolder())}),l(1," Create folder "),r()}}function Or(n,t){if(n&1){let e=F();o(0,"ya-page-button",14),g("clicked",function(){S(e);let a=u();return k(a.deleteSelectedStacks())}),l(1," Delete "),r()}if(n&2){let e=u();p("disabled",!e.selection.hasValue())}}function Nr(n,t){if(n&1&&d(0,"ya-breadcrumb",16),n&2){let e=t.$implicit,i=u(3);p("link",e.route)("queryParams",re(3,vi,i.yamcs.context))("label",e.name)}}function Ar(n,t){if(n&1&&(o(0,"ya-breadcrumb-trail"),d(1,"ya-breadcrumb",15),I(2,Nr,1,5,"ya-breadcrumb",16,A),r()),n&2){let e=u(),i=u();c(),p("queryParams",re(1,vi,i.yamcs.context)),c(),$(e)}}function Ir(n,t){n&1&&f(0,Ar,4,3,"ya-breadcrumb-trail"),n&2&&h(t.length?0:-1)}function $r(n,t){if(n&1){let e=F();o(0,"input",34),g("change",function(a){S(e);let s=u(3);return k(a?s.masterToggle():null)}),r()}if(n&2){let e=u(3);p("checked",e.selection.hasValue()&&e.isAllSelected())}}function Rr(n,t){if(n&1&&(o(0,"th",32),f(1,$r,1,1,"input",33),r()),n&2){let e=u(2);c(),h(e.mayManageStacks()?1:-1)}}function jr(n,t){if(n&1){let e=F();o(0,"input",36),g("click",function(a){return S(e),k(a.stopPropagation())})("change",function(a){S(e);let s=u().$implicit,m=u(2);return k(a?m.selection.toggle(s):null)}),r()}if(n&2){let e=u().$implicit,i=u(2);p("checked",i.selection.isSelected(e))}}function Br(n,t){if(n&1&&(o(0,"td",35),f(1,jr,1,1,"input",33),r()),n&2){let e=u(2);c(),h(e.mayManageStacks()?1:-1)}}function Lr(n,t){n&1&&(o(0,"th",37),l(1,"Name"),r())}function Yr(n,t){if(n&1){let e=F();o(0,"mat-icon",39),l(1," folder "),r(),o(2,"a",40),g("click",function(a){return S(e),k(a.stopPropagation())}),l(3),C(4,"filename"),r()}if(n&2){let e=u().$implicit,i=u(2);c(2),p("routerLink","/procedures/stacks/browse/"+e.name)("queryParams",re(5,vi,i.yamcs.context)),c(),D(" ",y(4,3,e.name)," ")}}function Gr(n,t){if(n&1){let e=F();o(0,"mat-icon",39),l(1," description "),r(),o(2,"a",41),C(3,"filename"),g("click",function(a){return S(e),k(a.stopPropagation())}),l(4),C(5,"filename"),r()}if(n&2){let e=u().$implicit,i=u(2);c(2),p("routerLink","/procedures/stacks/files/"+e.name)("queryParams",re(8,vi,i.yamcs.context))("title",y(3,4,e.name)),c(2),D(" ",y(5,6,e.name)," ")}}function Ur(n,t){if(n&1&&(o(0,"td",38),f(1,Yr,5,7)(2,Gr,6,10),r()),n&2){let e=t.$implicit;c(),h(e.folder?1:2)}}function qr(n,t){n&1&&(o(0,"th",37),l(1,"Visibility"),r())}function Hr(n,t){n&1&&(o(0,"td",38),l(1,"Private"),r())}function Wr(n,t){n&1&&(o(0,"th",37),l(1,"Date modified"),r())}function Qr(n,t){if(n&1&&(o(0,"td",38),l(1),C(2,"datetime"),r()),n&2){let e=t.$implicit;c(),D(" ",y(2,1,e.modified)||"-"," ")}}function zr(n,t){n&1&&d(0,"th",42)}function Kr(n,t){if(n&1){let e=F();o(0,"ya-more")(1,"button",43),g("click",function(){S(e);let a=u().$implicit,s=u(2);return k(s.renameFile(a))}),l(2,"Rename"),r(),o(3,"a",44),l(4,"Download"),r(),d(5,"mat-divider"),o(6,"button",43),g("click",function(){S(e);let a=u().$implicit,s=u(2);return k(s.deleteFile(a))}),l(7,"Delete"),r()()}if(n&2){let e=u().$implicit;c(3),p("href",e.objectUrl,rt)}}function Xr(n,t){if(n&1&&(o(0,"td",38),f(1,Kr,8,1,"ya-more"),r()),n&2){let e=t.$implicit,i=u(2);c(),h(!e.folder&&i.mayManageStacks()?1:-1)}}function Jr(n,t){n&1&&d(0,"th",37)}function Zr(n,t){n&1&&d(0,"span")}function el(n,t){n&1&&d(0,"span")}function tl(n,t){if(n&1&&(o(0,"span"),l(1),C(2,"filename"),C(3,"extension"),r()),n&2){let e=u(2).$implicit;c(),D("Unsupported format '",y(3,3,y(2,1,e.name)),"'")}}function il(n,t){if(n&1&&(o(0,"span"),f(1,Zr,1,0,"span"),C(2,"filename"),C(3,"extension"),C(4,"lowercase"),f(5,el,1,0,"span")(6,tl,4,5,"span"),r()),n&2){let e,i=u().$implicit;c(),h((e=y(4,5,y(3,3,y(2,1,i.name))))==="xml"?1:e==="ycs"?5:6)}}function nl(n,t){if(n&1&&(o(0,"td",45),f(1,il,7,7,"span"),r()),n&2){let e=t.$implicit;c(),h(e.folder?-1:1)}}function al(n,t){n&1&&d(0,"tr",46)}function ol(n,t){if(n&1){let e=F();o(0,"tr",47),g("click",function(){let a=S(e).$implicit,s=u(2);return k(s.toggleOne(a))}),r()}if(n&2){let e=t.$implicit,i=u(2);pe("selected",i.selection.isSelected(e))}}function rl(n,t){if(n&1&&(o(0,"table",9),j(1,17),f(2,Rr,2,1,"th",18)(3,Br,2,1,"td",19),B(),j(4,20),f(5,Lr,2,0,"th",21)(6,Ur,3,1,"td",22),B(),j(7,23),f(8,qr,2,0,"th",21)(9,Hr,2,0,"td",22),B(),j(10,24),f(11,Wr,2,0,"th",21)(12,Qr,3,3,"td",22),B(),j(13,25),f(14,zr,1,0,"th",26)(15,Xr,2,1,"td",27),B(),j(16,28),f(17,Jr,1,0,"th",21)(18,nl,2,1,"td",29),B(),f(19,al,1,0,"tr",30)(20,ol,1,2,"tr",31),r()),n&2){let e=u();p("dataSource",e.dataSource),c(19),p("cdkHeaderRowDef",e.displayedColumns),c(),p("cdkRowDefColumns",e.displayedColumns)}}function ll(n,t){n&1&&(o(0,"ya-empty-message"),l(1,"Empty directory."),r())}function cl(n,t){if(n&1){let e=F();o(0,"p")(1,"ya-button",49),g("click",function(){S(e);let a=u(4);return k(a.createStack())}),l(2,"Create a stack"),r(),l(3," or "),o(4,"ya-button",50),g("click",function(){S(e);let a=u(4);return k(a.openUploadDialog())}),l(5,"Import a stack"),r()()}}function sl(n,t){if(n&1&&(o(0,"ya-empty-message",48)(1,"p"),l(2," Stacks are used to interactively execute a prepared set of steps. To start, either: "),r(),f(3,cl,6,0,"p"),r()),n&2){let e=u(3);c(3),h(e.mayManageStacks()?3:-1)}}function ml(n,t){if(n&1&&f(0,ll,2,0,"ya-empty-message")(1,sl,4,1,"ya-empty-message",48),n&2){let e=t,i=u(2);h(i.loaded&&e.length?0:-1),c(),h(i.loaded&&!e.length?1:-1)}}function pl(n,t){if(n&1&&(f(0,ml,2,2),C(1,"async")),n&2){let e,i=u();h((e=y(1,1,i.breadcrumb$))?0:-1,e)}}var hi=class n{constructor(t,e,i,a,s,m,v,b){this.dialog=t;this.yamcs=e;this.router=a;this.route=s;this.authService=m;this.messageService=v;this.configService=b;this.breadcrumb$=new N([]);this.dragActive$=new N(!1);this.displayedColumns=["select","name","modified","actions","formatWarning"];this.dataSource=new Qe([]);this.selection=new Et(!0,[]);this.loaded=!1;this.converting=!1;i.setTitle("Command stacks"),this.storageClient=e.createStorageClient(),this.bucket=b.getStackBucket(),this.loadCurrentFolder(),this.routerSubscription=a.events.pipe(gt(z=>z instanceof en)).subscribe(()=>{this.loadCurrentFolder()})}loadCurrentFolder(){let t={delimiter:"/"},e=this.route.snapshot.url;e.length&&(t.prefix=e.map(i=>i.path).join("/")+"/"),this.storageClient.listObjects(this.bucket,t).then(i=>{this.updateBrowsePath(),this.changedir(i),this.loaded=!0})}changedir(t){this.selection.clear();let e=[];for(let i of t.prefixes||[])e.push({folder:!0,name:i});for(let i of t.objects||[])i.name.endsWith("/")||e.push({folder:!1,name:i.name,modified:i.created,objectUrl:this.storageClient.getObjectURL(this.bucket,i.name)});this.dataSource.data=e}isAllSelected(){let t=this.selection.selected.length,e=this.dataSource.filteredData.length;return t===e&&e>0}masterToggle(){this.isAllSelected()?this.selection.clear():this.dataSource.filteredData.forEach(t=>this.selection.select(t))}toggleOne(t){(!this.selection.isSelected(t)||this.selection.selected.length>1)&&this.selection.clear(),this.selection.toggle(t)}createStack(){this.dialog.open(gi,{width:"400px",data:{path:this.getCurrentPath(),prefix:""}}).afterClosed().subscribe(e=>{e&&this.router.navigateByUrl(`/procedures/stacks/files/${e}?c=${this.yamcs.context}`)})}createFolder(){this.dialog.open(Ci,{width:"400px",data:{bucket:this.bucket,path:this.getCurrentPath()}}).afterClosed().subscribe({next:()=>this.loadCurrentFolder()})}openUploadDialog(){this.uploaderEl.nativeElement.click()}importStack(){let t=this.getCurrentPath();t.startsWith("/")&&(t=t.substring(1));let e=this.uploaderEl.nativeElement.files,i=[];for(let a in e)if(!isNaN(parseInt(a,10))){let s=e[a],b=""+(t?t+"/"+s.name:s.name),z=this.storageClient.uploadObject(this.bucket,b,s);i.push(z)}Promise.all(i).then(()=>this.loadCurrentFolder()).catch(a=>this.messageService.showError(a))}getCurrentPath(){let t="";for(let e of this.route.snapshot.url)t+="/"+e.path;return t||"/"}deleteSelectedStacks(){let t=[],e=[];for(let i of this.selection.selected)i.folder?e.push(this.storageClient.listObjects(this.bucket,{prefix:i.name}).then(a=>{let s=a.objects||[];t.push(...s.map(m=>m.name))})):t.push(i.name);Promise.all(e).then(()=>{if(confirm(`You are about to delete ${t.length} files. Are you sure you want to continue?`)){let i=[];for(let a of t)i.push(this.storageClient.deleteObject(this.bucket,a));Promise.all(i).then(()=>{this.loadCurrentFolder()})}})}renameFile(t){this.dialog.open(yi,{data:{name:t.name},width:"400px"}).afterClosed().subscribe(i=>{i&&this.loadCurrentFolder()})}deleteFile(t){confirm(`Are you sure you want to delete ${t.name}?`)&&this.storageClient.deleteObject(this.bucket,t.name).then(()=>{this.loadCurrentFolder()})}dragEnter(t){return this.dragActive$.next(!0),t.preventDefault(),t.stopPropagation(),!1}dragOver(t){return t.preventDefault(),t.stopPropagation(),!1}dragLeave(t){return this.dragActive$.next(!1),t.preventDefault(),t.stopPropagation(),!1}drop(t){let e=t.dataTransfer||{};if(e){let i=this.getCurrentPath().substring(1);i!==""&&(i+="/"),Qn(e).then(a=>{let s=[];for(let m of a){let v=i+m._fullPath,b=this.storageClient.uploadObject(this.bucket,v,m);s.push(b)}Promise.all(s).finally(()=>{this.loadCurrentFolder()})})}return this.dragActive$.next(!1),t.preventDefault(),t.stopPropagation(),!1}mayManageStacks(){let t=this.authService.getUser();return t.hasObjectPrivilege("ManageBucket",this.bucket)||t.hasSystemPrivilege("ManageAnyBucket")}updateBrowsePath(){let t=[],e="";for(let i of this.route.snapshot.url)e+="/"+i.path,t.push({name:i.path,route:"/procedures/stacks/browse"+e});return this.breadcrumb$.next(t),e||"/"}ngOnDestroy(){this.routerSubscription?.unsubscribe()}static{this.\u0275fac=function(e){return new(e||n)(_(Te),_(M),_(qe),_(xt),_(tn),_(Re),_(Ae),_(Ce))}}static{this.\u0275cmp=x({type:n,selectors:[["ng-component"]],viewQuery:function(e,i){if(e&1&&(ne(Fr,7),ne(Tr,5)),e&2){let a;ae(a=oe())&&(i.dropArea=a.first),ae(a=oe())&&(i.uploaderEl=a.first)}},standalone:!0,features:[E],decls:17,vars:16,consts:[["droparea",""],["uploader",""],["icon","add_circle_outline"],["icon","file_upload"],["icon","create_new_folder"],["icon","delete",3,"disabled"],[1,"droparea",3,"dragenter"],[1,"droparea-overlay",3,"dragover","dragleave","drop"],[1,"panel-content"],["mat-table","",1,"ya-data-table","expand",3,"dataSource"],["icon","add_circle_outline",3,"clicked"],["icon","file_upload",3,"clicked"],["type","file","hidden","","accept",".xml,.ycs","multiple","",3,"change"],["icon","create_new_folder",3,"clicked"],["icon","delete",3,"clicked","disabled"],["link","/procedures/stacks/browse","icon","account_tree",3,"queryParams"],[3,"link","queryParams","label"],["cdkColumnDef","select"],["mat-header-cell","","class","checkbox",4,"cdkHeaderCellDef"],["mat-cell","","class","checkbox",4,"cdkCellDef"],["cdkColumnDef","name"],["mat-header-cell","",4,"cdkHeaderCellDef"],["mat-cell","",4,"cdkCellDef"],["cdkColumnDef","visibility"],["cdkColumnDef","modified"],["matColumnDef","actions"],["mat-header-cell","","class","expand",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["cdkColumnDef","formatWarning"],["mat-cell","","style","text-align: right",4,"cdkCellDef"],["mat-header-row","",4,"cdkHeaderRowDef"],["mat-row","",3,"selected","click",4,"cdkRowDef","cdkRowDefColumns"],["mat-header-cell","",1,"checkbox"],["type","checkbox",3,"checked"],["type","checkbox",3,"change","checked"],["mat-cell","",1,"checkbox"],["type","checkbox",3,"click","change","checked"],["mat-header-cell",""],["mat-cell",""],[1,"icon12",2,"vertical-align","middle","margin-right","7px"],[3,"click","routerLink","queryParams"],[3,"click","routerLink","queryParams","title"],["mat-header-cell","",1,"expand"],["mat-menu-item","",3,"click"],["mat-menu-item","","download","",3,"href"],["mat-cell","",2,"text-align","right"],["mat-header-row",""],["mat-row","",3,"click"],["headerTitle","Stacks"],["appearance","primary",3,"click"],[3,"click"]],template:function(e,i){if(e&1){let a=F();o(0,"app-instance-page")(1,"app-instance-toolbar"),l(2," Stacks \xA0\xA0\xA0 "),f(3,Mr,2,0,"ya-page-button",2)(4,Pr,4,0,"ya-page-button",3)(5,Vr,2,0,"ya-page-button",4)(6,Or,2,1,"ya-page-button",5),r(),o(7,"div",6,0),C(9,"async"),g("dragenter",function(m){return S(a),k(i.dragEnter(m))}),o(10,"div",7),C(11,"async"),g("dragover",function(m){return S(a),k(i.dragOver(m))})("dragleave",function(m){return S(a),k(i.dragLeave(m))})("drop",function(m){return S(a),k(i.drop(m))}),r(),o(12,"div",8),f(13,Ir,1,1),C(14,"async"),f(15,rl,21,3,"table",9)(16,pl,2,3),r()()()}if(e&2){let a;c(3),h(i.mayManageStacks()?3:-1),c(),h(i.mayManageStacks()?4:-1),c(),h(i.mayManageStacks()?5:-1),c(),h(i.mayManageStacks()?6:-1),c(),pe("active",y(9,10,i.dragActive$)),c(3),pe("hide",!y(11,12,i.dragActive$)),c(3),h((a=y(14,14,i.breadcrumb$))?13:-1,a),c(2),h(i.dataSource&&i.dataSource.data.length?15:16)}},dependencies:[be,ke,w,ee,zi,ve,hn,At,It,$t,yn,ge,Nt,He,Me,jt,Ve,Pe,Bt,Oe,Lt,Ne,Gt,Yt,O,Ht,Nn,$e,zt,Bn,Kt],styles:[".droparea[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;overflow:auto}.droparea-overlay[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;box-sizing:border-box;background:#1b61b91a;border:1px solid rgba(27,97,185,1);z-index:10}table[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none}"],changeDetection:0})}};var Si=class n{static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275cmp=x({type:n,selectors:[["app-stacks-page"]],standalone:!0,features:[E],decls:1,vars:0,template:function(e,i){e&1&&d(0,"router-outlet")},dependencies:[bt],encapsulation:2,changeDetection:0})}};var dl=n=>{let t=n,e=n.findIndex(a=>a.path==="-");e!==-1&&(t=n.slice(0,e));let i=t.map(a=>a.path).join("/");return{consumed:t,posParams:{objectName:new Zi(i,{})}}},c0=[{path:"",canActivate:[wi,Ei],canActivateChild:[Di],runGuardsAndResolvers:"always",component:Wn,children:[{path:"stacks",pathMatch:"full",redirectTo:"stacks/browse"},{path:"stacks/browse",component:Si,children:[{path:"**",component:hi}]},{path:"stacks/files",children:[{matcher:dl,providers:[mt,_e],canActivate:[_e],canDeactivate:[sa],children:[{path:"",pathMatch:"full",component:_i},{path:"-/log",component:ii},{path:"-/settings",component:ni}]}]},{path:"script",pathMatch:"full",component:Zt},{path:"ext",canActivate:[wi,Ei],canActivateChild:[Di],runGuardsAndResolvers:"always",children:[{matcher:qn,component:Un}]}]}];export{c0 as ROUTES};
© 2015 - 2025 Weber Informatics LLC | Privacy Policy