PageSourceSearch

https://reallifeenglish.com/1410.e9b63b834c885716.js

js reallifeenglish.com collected 2026-09-30 16:59:58 UTC 83,114 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkharbor_portal=self.webpackChunkharbor_portal||[]).push([[1410],{1556(U,k,c){c.d(k,{l:()=>R});var C=c(3794),D=c(5658),O=c(5964),T=c(6354),h=c(5802),_=c(5526);let R=(()=>{class p extends D.d{static{this.listSchedulesPath="/schedules"}static{this.getSchedulePausedPath="/schedules/{job_type}/paused"}constructor(P,g){super(P,g)}listSchedulesResponse(P){let g=this.newParams(),f=new C.Lr;null!=P.pageSize&&(g=g.set("page_size",P.pageSize.toString())),null!=P.page&&(g=g.set("page",P.page.toString())),null!=P.XRequestId&&(f=f.set("X-Request-Id",P.XRequestId.toString()));let e=new C.Kd("GET",this.rootUrl+"/schedules",null,{headers:f,params:g,responseType:"json"});return this.http.request(e).pipe((0,O.p)(r=>r instanceof C.cS),(0,T.T)(r=>r))}listSchedules(P){return this.listSchedulesResponse(P).pipe((0,T.T)(g=>g.body))}getSchedulePausedResponse(P){let g=this.newParams(),f=new C.Lr;null!=P.XRequestId&&(f=f.set("X-Request-Id",P.XRequestId.toString()));let e=new C.Kd("GET",this.rootUrl+`/schedules/${P.jobType}/paused`,null,{headers:f,params:g,responseType:"json"});return this.http.request(e).pipe((0,O.p)(r=>r instanceof C.cS),(0,T.T)(r=>r))}getSchedulePaused(P){return this.getSchedulePausedResponse(P).pipe((0,T.T)(g=>g.body))}static{this.\u0275fac=function(g){return new(g||p)(h.KVO(_.J),h.KVO(C.Qq))}}static{this.\u0275prov=h.jDH({token:p,factory:p.\u0275fac,providedIn:"root"})}}return p})()},1410(U,k,c){c.d(k,{P2pProviderModule:()=>Ct});var C=c(3049),D=c(2565),O=c(152),T=c(5558),h=c(980),_=c(727),R=c(6040),p=c(356),j=c(1413),P=c(7468),g=c(6799),f=c(6275),m=c(8597),e=c(5547),r=c(5802),S=c(8018),b=c(7702),v=c(3064),$=c(1720),E=c(9417),u=c(271),M=c(8062),x=c(1904),V=c(752),y=c(6334),B=c(2247),w=c(9769),J=c(2316);function ne(o,a){1&o&&(e.j41(0,"div",8),e.nrm(1,"span",40),e.j41(2,"span"),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&o&&(e.R7$(3),e.JRh(e.bMT(4,1,"REPLICATION.IN_PROGRESS")))}function oe(o,a){1&o&&(e.j41(0,"div",9),e.nrm(1,"clr-icon",41),e.j41(2,"span"),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&o&&(e.R7$(3),e.JRh(e.bMT(4,1,"REPLICATION.SUCCESS")))}function se(o,a){1&o&&(e.j41(0,"div",10),e.nrm(1,"clr-icon",42),e.j41(2,"span"),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&o&&(e.R7$(3),e.JRh(e.bMT(4,1,"REPLICATION.FAILURE")))}function re(o,a){1&o&&e.nrm(0,"clr-icon",43)}function le(o,a){if(1&o&&(e.j41(0,"clr-tooltip-content",46)(1,"span"),e.EFF(2),e.k0s()()),2&o){const t=e.XpG().$implicit;e.Y8G("clrPosition","left"),e.R7$(2),e.JRh(t.status_message)}}function ce(o,a){if(1&o&&(e.j41(0,"a",45),e.nrm(1,"clr-icon",47),e.k0s()),2&o){const t=e.XpG().$implicit,n=e.XpG();e.Y8G("href",n.viewLog(t.id),e.B4B)}}function ae(o,a){if(1&o&&(e.j41(0,"clr-dg-row",37)(1,"clr-dg-cell"),e.EFF(2),e.k0s(),e.j41(3,"clr-dg-cell"),e.EFF(4),e.k0s(),e.j41(5,"clr-dg-cell"),e.EFF(6),e.j41(7,"clr-tooltip"),e.nVh(8,re,1,0,"clr-icon",43),e.DNE(9,le,3,2,"clr-tooltip-content",44),e.k0s()(),e.j41(10,"clr-dg-cell")(11,"span"),e.EFF(12),e.k0s()(),e.j41(13,"clr-dg-cell")(14,"span"),e.EFF(15),e.k0s()(),e.j41(16,"clr-dg-cell")(17,"span"),e.EFF(18),e.k0s()(),e.j41(19,"clr-dg-cell"),e.EFF(20),e.nI1(21,"harborDatetime"),e.k0s(),e.j41(22,"clr-dg-cell"),e.EFF(23),e.k0s(),e.j41(24,"clr-dg-cell"),e.nVh(25,ce,2,1,"a",45),e.k0s()()),2&o){const t=a.$implicit,n=e.XpG();e.Y8G("clrDgItem",t),e.R7$(2),e.JRh(t.id),e.R7$(2),e.JRh(t.execution_id),e.R7$(2),e.SpI("",t.status," "),e.R7$(2),e.vxM(t.status_message?8:-1),e.R7$(4),e.JRh(null==t.extra_attrs?null:t.extra_attrs.artifact),e.R7$(3),e.JRh(null==t.extra_attrs?null:t.extra_attrs.digest),e.R7$(3),e.JRh(null==t.extra_attrs?null:t.extra_attrs.kind),e.R7$(2),e.JRh(e.i5U(21,11,t.start_time,"short")),e.R7$(3),e.JRh(n.getDuration(t)),e.R7$(2),e.vxM("Initialized"!==t.status?25:-1)}}function pe(o,a){if(1&o&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o){e.XpG();const t=e.sdS(126);e.R7$(),e.E5c("",t.firstItem+1," - ",t.lastItem+1," ",e.bMT(2,3,"REPLICATION.OF"))}}let de=(()=>{class o{constructor(t,n,i,s,d,l,I,G){this.translate=t,this.router=n,this.route=i,this.messageHandlerService=s,this.preheatService=d,this.p2pProviderService=l,this.userPermissionService=I,this.skipSessionRenewalService=G,this.clrPageSizeOptions=f.xp,this.inProgress=!1,this.currentPage=1,this.pageSize=(0,_.xM)(_.tZ.P2P_TASKS_COMPONENT),this.loading=!0,this.hasUpdatePermission=!1,this.btnState=g.nn.DEFAULT,this._searchSubject=ne
1w j.B,this.filterKey="id"}ngOnInit(){this.projectId=+this.route.snapshot.parent.parent.params.id;const t=this.route.snapshot.parent.parent.data;t&&(this.projectName=t.projectResolver.name),this.executionId=this.route.snapshot.params.executionId,this.preheatPolicyName=this.route.snapshot.params.preheatPolicyName,this.executionId&&this.preheatPolicyName&&this.projectName&&this.getExecutionDetail(!0),this.getPermissions(),this.subscribeSearch()}subscribeSearch(){this._searchSubscription||(this._searchSubscription=this._searchSubject.pipe((0,O.B)(500),(0,T.n)(t=>{let n;return this.loading=!0,this.searchString&&(n=encodeURIComponent(`${this.filterKey}=~${t}`)),this.preheatService.ListTasksResponse({projectName:this.projectName,preheatPolicyName:this.preheatPolicyName,executionId:+this.executionId,page:this.currentPage,pageSize:this.pageSize,q:n}).pipe((0,m.wk)(this.skipSessionRenewalService)).pipe((0,h.j)(()=>this.loading=!1))})).subscribe(t=>{if(t.headers){let n=t.headers.get("x-total-count");n&&(this.totalCount=parseInt(n,0))}this.tasks=t.body,this.setLoop()}))}ngOnDestroy(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.timeoutForTaskList&&(clearTimeout(this.timeoutForTaskList),this.timeoutForTaskList=null),this._searchSubscription&&(this._searchSubscription.unsubscribe(),this._searchSubscription=null)}getPermissions(){const t=[];t.push(this.userPermissionService.getPermission(this.projectId,R.DC.P2P_PROVIDER.KEY,R.DC.P2P_PROVIDER.VALUE.UPDATE)),this.btnState=g.nn.LOADING,(0,P.p)(...t).subscribe(n=>{[this.hasUpdatePermission]=n,this.btnState=g.nn.SUCCESS},n=>{this.messageHandlerService.error(n),this.btnState=g.nn.ERROR})}getExecutionDetail(t){t&&(this.inProgress=!0),this.executionId&&this.preheatService.GetExecution({projectName:this.projectName,preheatPolicyName:this.preheatPolicyName,executionId:+this.executionId}).pipe((0,m.wk)(this.skipSessionRenewalService)).pipe((0,h.j)(()=>this.inProgress=!1)).subscribe(n=>{this.execution=n,(!this.execution||this.p2pProviderService.willChangStatus(this.execution.status))&&(this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.timeout||(this.timeout=setTimeout(()=>{this.getExecutionDetail(!1)},p.rG)))},n=>{this.messageHandlerService.error(n)})}trigger(){return this.execution&&this.execution.trigger?this.execution.trigger:""}startTime(){return this.execution&&this.execution.start_time?this.execution.start_time:null}successNum(){return this.execution&&this.execution.metrics&&this.execution.metrics.success_task_count?this.execution.metrics.success_task_count:0}failedNum(){return this.execution&&this.execution.metrics&&this.execution.metrics.error_task_count?this.execution.metrics.error_task_count:0}progressNum(){return this.execution&&this.execution.metrics&&(this.execution.metrics.pending_task_count?this.execution.metrics.pending_task_count:0)+(this.execution.metrics.running_task_count?this.execution.metrics.running_task_count:0)+(this.execution.metrics.scheduled_task_count?this.execution.metrics.scheduled_task_count:0)||0}stoppedNum(){return this.execution&&this.execution.metrics&&this.execution.metrics.stopped_task_count?this.execution.metrics.stopped_task_count:0}stopJob(){this.stopOnGoing=!0;const t=(0,_.o8)(this.execution);t.status=p.GO.STOPPED,this.preheatService.StopExecution({projectName:this.projectName,preheatPolicyName:this.preheatPolicyName,executionId:+this.executionId,execution:t}).subscribe(n=>{this.stopOnGoing=!1,this.getExecutionDetail(!0),this.translate.get("REPLICATION.STOP_SUCCESS",{param:this.executionId}).subscribe(i=>{this.messageHandlerService.showSuccess(i)})},n=>{this.messageHandlerService.error(n)})}viewLog(t){return this.preheatService.rootUrl+`/projects/${this.projectName}/preheat/policies/${this.preheatPolicyName}/executions/${this.executionId}/tasks/${t}/logs`}clrLoadTasks(t,n){let i;t&&(this.loading=!0),n&&n.page&&(this.pageSize=n.page.size,(0,_.qq)(_.tZ.P2P_TASKS_COMPONENT,this.pageSize)),this.searchString&&(i=encodeURIComponent(`${this.filterKey}=~${this.searchString}`)),this.preheatService.ListTasksResponse({projectName:this.projectName,preheatPolicyName:this.preheatPolicyName,executionId:+this.executionId,page:this.currentPage,pageSize:this.pageSize,q:i}).pipe((0,m.wk)(this.skipSessionRenewalService)).pipe((0,h.j)(()=>{this.loading=!1})).subscribe(s=>{if(s.headers){let d=s.headers.get("x-total-count");d&&(this.totalCount=parseInt(d,0))}this.tasks=s.body,this.setLoop()},s=>{this.messageHandlerService.error(s)})}refreshTasks(){this.currentPage=1,this.totalCount=0,this.clrLoadTasks(!0)}getDuration(t){return this.p2pProviderService.getDuration(t.start_time,t.end_time)}isInProgress(){return this.execution&&this.p2pProviderService.willChangStatus(this.execution.status)}isSuccess(){return this.execution&&this.execution.status===p.GO.SUCCESS}isFailed(){return this.execution&&(this.execution.status===p.GO.ERROR||this.execution.status===p.GO.STOPPED)}canStop(){return this.execution&&this.p2pProviderService.willChangStatus(this.execution.status)}setLoop(){if(this.timeoutForTaskList&&(clearTimeout(this.timeoutForTaskList),this.timeoutForTaskList=null),this.tasks&&this.tasks.length)for(let t=0;t<this.tasks.length;t++)this.p2pProviderService.willChangStatus(this.tasks[t].status)&&(this.timeoutForTaskList||(this.timeoutForTaskList=setTimeout(()=>{this.clrLoadTasks(!1)},p.rG)))}selectFilterKey(t){this.filterKey=t.target.value}doFilter(t){this.searchString=t,t.trim()?this._searchSubject.next(t.trim()):this.clrLoadTasks(!0)}openFilter(t){this.isOpenFilterTag=t}static{this.\u0275fac=function(n){return new(n||o)(e.rXU(S.c$),e.rXU(b.Ix),e.rXU(b.nX),e.rXU(v.l),e.rXU($.J),e.rXU(p.RR),e.rXU(R.OE),e.rXU(m.BY))}}static{this.\u0275cmp=e.VBU({type:o,selectors:[["task-list"]],standalone:!1,decls:133,vars:110,consts:[["pagination",""],[1,"replication-tasks","mt-2"],[1,"overview-section"],[1,"title-wrapper"],[1,"title-block"],[1,"custom-h2","h2-style"],[1,"id-divider"],[1,"margin-top-16px"],[1,"status-progress"],[1,"status-success"],[1,"status-failed"],[1,"button-stop"],[1,"btn","btn-primary",3,"click","disabled"],[1,"spinner","spinner-inline",3,"hidden"],[1,"execution-block"],[1,"executions-detail"],[1,"flex-block"],[1,"execution-detail-label"],[1,"detail-row"],[1,"num-success","common-style"],[1,"detail-span"],[1,"execution-detail
1s"],[1,"num-failed","common-style"],[1,"num-progress","common-style"],[1,"num-stopped","common-style"],[1,"tasks-detail"],[1,"modal-title"],[3,"clrDgRefresh","clrDgLoading"],[1,"row","flex-end"],[1,"select","filter-tag","clr-select-wrapper",3,"hidden"],["id","selectKey",3,"change"],["value","id"],["value","execution_id"],["value","status"],["id","filter-executions",3,"filterEvt","openFlag","currentValue","withDivider","filterPlaceholder"],[1,"refresh-btn"],["shape","refresh",3,"click","hidden"],[3,"clrDgItem"],[3,"clrDgPageChange","clrDgPage","clrDgPageSize","clrDgTotalItems"],[3,"clrPageSizeOptions"],[1,"spinner","spinner-inline"],["size","18","shape","success-standard",1,"color-green"],["size","18","shape","error-standard",1,"color-red"],["clrTooltipTrigger","","shape","info-circle","size","20"],["clrSize","md",3,"clrPosition",4,"clrIfOpen"],["rel","noopener noreferrer","target","_blank",3,"href"],["clrSize","md",3,"clrPosition"],["shape","list"]],template:function(n,i){if(1&n){const s=e.RV6();e.j41(0,"div",1)(1,"section",2)(2,"div",3)(3,"div")(4,"div",4)(5,"div")(6,"h2",5),e.EFF(7),e.nI1(8,"translate"),e.k0s(),e.nrm(9,"span",6),e.j41(10,"h2",5),e.EFF(11),e.k0s()(),e.j41(12,"div",7),e.nVh(13,ne,5,3,"div",8),e.nVh(14,oe,5,3,"div",9),e.nVh(15,se,5,3,"div",10),e.k0s(),e.j41(16,"div",11)(17,"button",12),e.bIt("click",function(){return i.stopJob()}),e.EFF(18),e.nI1(19,"translate"),e.k0s(),e.nrm(20,"span",13),e.k0s()()()(),e.j41(21,"div",14)(22,"div",15)(23,"div")(24,"label"),e.EFF(25),e.nI1(26,"translate"),e.k0s(),e.j41(27,"span"),e.EFF(28),e.nI1(29,"translate"),e.k0s()(),e.j41(30,"div")(31,"label"),e.EFF(32),e.nI1(33,"translate"),e.k0s(),e.j41(34,"span"),e.EFF(35),e.nI1(36,"harborDatetime"),e.k0s()()(),e.j41(37,"div",16)(38,"section",17)(39,"section",18),e.nrm(40,"div",19),e.j41(41,"label",20),e.EFF(42),e.nI1(43,"translate"),e.k0s(),e.j41(44,"div",21),e.EFF(45),e.k0s()(),e.j41(46,"section",18),e.nrm(47,"div",22),e.j41(48,"label",20),e.EFF(49),e.nI1(50,"translate"),e.k0s(),e.j41(51,"div",21),e.EFF(52),e.k0s()(),e.j41(53,"section",18),e.nrm(54,"div",23),e.j41(55,"label",20),e.EFF(56),e.nI1(57,"translate"),e.k0s(),e.j41(58,"div",21),e.EFF(59),e.k0s()(),e.j41(60,"section",18),e.nrm(61,"div",24),e.j41(62,"label",20),e.EFF(63),e.nI1(64,"translate"),e.k0s(),e.j41(65,"div",21),e.EFF(66),e.k0s()()()()()(),e.j41(67,"div",25)(68,"h3",26),e.EFF(69),e.nI1(70,"translate"),e.k0s(),e.j41(71,"clr-datagrid",27),e.bIt("clrDgRefresh",function(l){return i.clrLoadTasks(!0,l)}),e.j41(72,"clr-dg-action-bar")(73,"div",28)(74,"div",29)(75,"select",30),e.bIt("change",function(l){return i.selectFilterKey(l)}),e.j41(76,"option",31),e.EFF(77),e.nI1(78,"translate"),e.nI1(79,"lowercase"),e.k0s(),e.j41(80,"option",32),e.EFF(81),e.nI1(82,"translate"),e.nI1(83,"lowercase"),e.k0s(),e.j41(84,"option",33),e.EFF(85),e.nI1(86,"translate"),e.nI1(87,"lowercase"),e.k0s()()(),e.j41(88,"hbr-filter",34),e.nI1(89,"translate"),e.bIt("filterEvt",function(l){return i.doFilter(l)})("openFlag",function(l){return i.openFilter(l)}),e.k0s(),e.j41(90,"span",35)(91,"clr-icon",36),e.bIt("click",function(){return i.refreshTasks()}),e.k0s()()()(),e.j41(92,"clr-dg-column"),e.EFF(93),e.nI1(94,"translate"),e.k0s(),e.j41(95,"clr-dg-column"),e.EFF(96),e.nI1(97,"translate"),e.k0s(),e.j41(98,"clr-dg-column"),e.EFF(99),e.nI1(100,"translate"),e.k0s(),e.j41(101,"clr-dg-column"),e.EFF(102),e.nI1(103,"translate"),e.k0s(),e.j41(104,"clr-dg-column"),e.EFF(105),e.nI1(106,"translate"),e.k0s(),e.j41(107,"clr-dg-column"),e.EFF(108),e.nI1(109,"translate"),e.k0s(),e.j41(110,"clr-dg-column"),e.EFF(111),e.nI1(112,"translate"),e.k0s(),e.j41(113,"clr-dg-column"),e.EFF(114),e.nI1(115,"translate"),e.k0s(),e.j41(116,"clr-dg-column"),e.EFF(117),e.nI1(118,"translate"),e.k0s(),e.j41(119,"clr-dg-placeholder"),e.EFF(120),e.nI1(121,"translate"),e.k0s(),e.Z7z(122,ae,26,14,"clr-dg-row",37,e.fX1),e.j41(124,"clr-dg-footer")(125,"clr-dg-pagination",38,0),e.mxI("clrDgPageChange",function(l){return r.eBV(s),e.DH7(i.currentPage,l)||(i.currentPage=l),r.Njj(l)}),e.j41(127,"clr-dg-page-size",39),e.EFF(128),e.nI1(129,"translate"),e.k0s(),e.nVh(130,pe,3,5,"span"),e.EFF(131),e.nI1(132,"translate"),e.k0s()()()()()}2&n&&(e.R7$(7),e.SpI(" ",e.bMT(8,49,"P2P_PROVIDER.EXECUTIONS")," "),e.R7$(4),e.JRh(i.executionId),e.R7$(2),e.vxM(i.execution&&i.isInProgress()?13:-1),e.R7$(),e.vxM(i.execution&&i.isSuccess()?14:-1),e.R7$(),e.vxM(i.execution&&i.isFailed()?15:-1),e.R7$(2),e.Y8G("disabled",!i.hasUpdatePermission||i.stopOnGoing||!i.canStop()),e.R7$(),e.SpI(" ",e.bMT(19,51,"REPLICATION.STOPJOB")," "),e.R7$(2),e.Y8G("hidden",!1===i.inProgress),e.R7$(5),e.SpI("",e.bMT(26,53,"REPLICATION.TRIGGER_MODE")," :"),e.R7$(3),e.JRh(e.bMT(29,55,i.trigger())),e.R7$(4),e.SpI("",e.bMT(33,57,"REPLICATION.CREATION_TIME")," :"),e.R7$(3),e.JRh(e.i5U(36,59,i.startTime(),"short")),e.R7$(7),e.JRh(e.bMT(43,62,"REPL
1ICATION.SUCCESS")),e.R7$(3),e.JRh(i.successNum()),e.R7$(4),e.JRh(e.bMT(50,64,"REPLICATION.FAILURE")),e.R7$(3),e.JRh(i.failedNum()),e.R7$(4),e.JRh(e.bMT(57,66,"REPLICATION.IN_PROGRESS")),e.R7$(3),e.JRh(i.progressNum()),e.R7$(4),e.JRh(e.bMT(64,68,"REPLICATION.STOPPED")),e.R7$(3),e.JRh(i.stoppedNum()),e.R7$(3),e.JRh(e.bMT(70,70,"P2P_PROVIDER.TASKS")),e.R7$(2),e.Y8G("clrDgLoading",i.loading),e.R7$(3),e.Y8G("hidden",!i.isOpenFilterTag),e.R7$(3),e.SpI(" ",e.bMT(79,74,e.bMT(78,72,"REPLICATION.TASK_ID"))," "),e.R7$(4),e.SpI(" ",e.bMT(83,78,e.bMT(82,76,"P2P_PROVIDER.ID"))," "),e.R7$(4),e.SpI(" ",e.bMT(87,82,e.bMT(86,80,"REPLICATION.STATUS"))," "),e.R7$(3),e.Y8G("filterPlaceholder",e.mNQ(e.bMT(89,84,"REPLICATION.FILTER_PLACEHOLDER")))("currentValue",i.searchString)("withDivider",!0),e.R7$(3),e.Y8G("hidden",i.loading),e.R7$(2),e.JRh(e.bMT(94,86,"REPLICATION.TASK_ID")),e.R7$(3),e.JRh(e.bMT(97,88,"P2P_PROVIDER.ID")),e.R7$(3),e.JRh(e.bMT(100,90,"REPLICATION.STATUS")),e.R7$(3),e.JRh(e.bMT(103,92,"P2P_PROVIDER.ARTIFACT")),e.R7$(3),e.JRh(e.bMT(106,94,"P2P_PROVIDER.DIGEST")),e.R7$(3),e.JRh(e.bMT(109,96,"P2P_PROVIDER.TYPE")),e.R7$(3),e.JRh(e.bMT(112,98,"REPLICATION.CREATION_TIME")),e.R7$(3),e.JRh(e.bMT(115,100,"REPLICATION.DURATION")),e.R7$(3),e.JRh(e.bMT(118,102,"REPLICATION.LOGS")),e.R7$(3),e.JRh(e.bMT(121,104,"P2P_PROVIDER.TASKS_PLACEHOLDER")),e.R7$(2),e.Dyx(i.tasks),e.R7$(3),e.R50("clrDgPage",i.currentPage),e.Y8G("clrDgPageSize",i.pageSize)("clrDgTotalItems",i.totalCount),e.R7$(2),e.Y8G("clrPageSizeOptions",i.clrPageSizeOptions),e.R7$(),e.JRh(e.bMT(129,106,"PAGINATION.PAGE_SIZE")),e.R7$(2),e.vxM(i.totalCount?130:-1),e.R7$(),e.Lme(" ",i.totalCount," ",e.bMT(132,108,"REPLICATION.ITEMS")," "))},dependencies:[E.xH,E.y7,u.gh,u.fQ,u.sl,u.sc,u.Lw,u.oi,u.o3,u.XT,u.E1,u.UW,u.lD,u.tH,u._Q,u.tW,u.eU,u.F$,M.xwV,M.U4n,x.Lh,V.vE,y.BT,y.bX,y.iM,B.i,S.D9,w.GH,J.E],styles:[".replication-tasks[_ngcontent-%COMP%]   .overview-section[_ngcontent-%COMP%]   .title-wrapper[_ngcontent-%COMP%]   .title-block[_ngcontent-%COMP%]{display:flex;align-items:center}.replication-tasks[_ngcontent-%COMP%]   .overview-section[_ngcontent-%COMP%]   .title-wrapper[_ngcontent-%COMP%]   .title-block[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:first-child{min-width:250px;margin-right:5px}.replication-tasks[_ngcontent-%COMP%]   .overview-section[_ngcontent-%COMP%]   .title-wrapper[_ngcontent-%COMP%]   .title-block[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:nth-child(2){width:140px}.replication-tasks[_ngcontent-%COMP%]   .overview-section[_ngcontent-%COMP%]   .title-wrapper[_ngcontent-%COMP%]   .title-block[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:nth-child(2)   span[_ngcontent-%COMP%]{color:#007cbb;font-size:12px;margin-left:10px}.replication-tasks[_ngcontent-%COMP%]   .overview-section[_ngcontent-%COMP%]   .title-wrapper[_ngcontent-%COMP%]   .title-block[_ngcontent-%COMP%]   .id-divider[_ngcontent-%COMP%]{display:inline-block;height:25px;width:2px;background-color:#ccc;margin:0 20px}.replication-tasks[_ngcontent-%COMP%]   .overview-section[_ngcontent-%COMP%]   .title-wrapper[_ngcontent-%COMP%]   .title-block[_ngcontent-%COMP%]   .h2-style[_ngcontent-%COMP%]{display:inline-block}.replication-tasks[_ngcontent-%COMP%]   .overview-section[_ngcontent-%COMP%]   .execution-block[_ngcontent-%COMP%]{margin-top:24px;display:flex;flex-wrap:wrap}.replication-tasks[_ngcontent-%COMP%]   .overview-section[_ngcontent-%COMP%]   .execution-block[_ngcontent-%COMP%]   .execution-detail-label[_ngcontent-%COMP%]{margin-right:10px;text-align:left}.replication-tasks[_ngcontent-%COMP%]   .overview-section[_ngcontent-%COMP%]   .execution-block[_ngcontent-%COMP%]   .execution-detail-label[_ngcontent-%COMP%]   .detail-row[_ngcontent-%COMP%]{display:flex;height:27px}.replication-tasks[_ngcontent-%COMP%]   .overview-section[_ngcontent-%COMP%]   .execution-block[_ngcontent-%COMP%]   .execution-detail-label[_ngcontent-%COMP%]   .detail-row[_ngcontent-%COMP%]   .common-style[_ngcontent-%COMP%]{width:12px;height:12px;margin-top:16px}.replication-tasks[_ngcontent-%COMP%]   .overview-section[_ngcontent-%COMP%]   .execution-block[_ngcontent-%COMP%]   .execution-detail-label[_ngcontent-%COMP%]   .detail-row[_ngcontent-%COMP%]   .num-success[_ngcontent-%COMP%]{background-color:#308700}.replication-tasks[_ngcontent-%COMP%]   .overview-section[_ngcontent-%COMP%]   .execution-block[_ngcontent-%COMP%]   .execution-detail-label[_ngcontent-%COMP%]   .detail-row[_ngcontent-%COMP%]   .num-failed[_ngcontent-%COMP%]{background-color:#c92101}.replication-tasks[_ngcontent-%COMP%]   .overview-section[_ngcontent-%COMP%]   .execution-block[_ngcontent-%COMP%]   .execution-detail-label[_ngcontent-%COMP%]   .detail-row[_ngcontent-%COMP%]   .num-progress[_ngcontent-%COMP%]{background-color:#1c5898}.replication-tasks[_ngcontent-%COMP%]   .overview-section[_ngcontent-%COMP%]   .execution-block[_ngcontent-%COMP%]   .execution-detail-label[_ngcontent-%COMP%]   .detail-row[_ngcontent-%COMP%]   .num-stopped[_ngcontent-%COMP%]{background-color:#a1a1a1}.replication-tasks[_ngcontent-%COMP%]   .overview-section[_ngcontent-%COMP%]   .execution-block[_ngcontent-%COMP%]   .execution-detail-label[_ngcontent-%COMP%]   .detail-row[_ngcontent-%COMP%]   .detail-span[_ngcontent-%COMP%]{flex:0 0 100px;margin:10px 0 0 10px}.replication-tasks[_ngcontent-%COMP%]   .overview-section[_ngcontent-%COMP%]   .execution-block[_ngcontent-%COMP%]   .execution-detail-label[_ngcontent-%COMP%]   .detail-row[_ngcontent-%COMP%]   .execution-detail
1s[_ngcontent-%COMP%]{width:200px;margin:8px 35px}.replication-tasks[_ngcontent-%COMP%]   .overview-section[_ngcontent-%COMP%]   .execution-block[_ngcontent-%COMP%]   .executions-detail[_ngcontent-%COMP%]{width:391px}.replication-tasks[_ngcontent-%COMP%]   .overview-section[_ngcontent-%COMP%]   .execution-block[_ngcontent-%COMP%]   .executions-detail[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:inline-block;width:120px}.replication-tasks[_ngcontent-%COMP%]   .overview-section[_ngcontent-%COMP%]   .execution-block[_ngcontent-%COMP%]   .executions-detail[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{margin-top:10px}.replication-tasks[_ngcontent-%COMP%]   .tasks-detail[_ngcontent-%COMP%]{margin-top:65px}.replication-tasks[_ngcontent-%COMP%]   .tasks-detail[_ngcontent-%COMP%]   .action-select[_ngcontent-%COMP%]{padding-right:18px;height:24px;display:flex;justify-content:flex-end}.replication-tasks[_ngcontent-%COMP%]   .tasks-detail[_ngcontent-%COMP%]   .action-select[_ngcontent-%COMP%]   .filter-tag[_ngcontent-%COMP%]{float:left;margin-top:8px}.replication-tasks[_ngcontent-%COMP%]   .tasks-detail[_ngcontent-%COMP%]   .action-select[_ngcontent-%COMP%]   .refresh-btn[_ngcontent-%COMP%]{cursor:pointer;margin-top:7px}.replication-tasks[_ngcontent-%COMP%]   .tasks-detail[_ngcontent-%COMP%]   .action-select[_ngcontent-%COMP%]   .refresh-btn[_ngcontent-%COMP%]:hover{color:#007cbb}.replication-tasks[_ngcontent-%COMP%]   .tasks-detail[_ngcontent-%COMP%]   clr-datagrid[_ngcontent-%COMP%]   .resource-width[_ngcontent-%COMP%]{width:150px}.margin-top-16px[_ngcontent-%COMP%]{margin-top:16px}.flex-end[_ngcontent-%COMP%]{align-items:center;display:flex;justify-content:flex-end;padding-right:1.5rem}.refresh-btn[_ngcontent-%COMP%]{margin-top:6px;cursor:pointer}.filter-tag[_ngcontent-%COMP%]{margin-top:7px}.button-stop[_ngcontent-%COMP%]{margin-top:16px;margin-left:-5px}"]})}}return o})();var he=c(3294),ge=c(5964),X=c(3351),Y=c(7705),ue=c(6838),_e=c(9371),z=c(6308),H=c(3717),K=c(8759),Pe=c(1981);const me=["policyForm"],Re=["cronScheduleComponent"];
1function Ee(o,a){1&o&&(e.j41(0,"h3",12),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"P2P_PROVIDER.EDIT_POLICY")," "))}function Ce(o,a){1&o&&(e.j41(0,"h3",12),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"P2P_PROVIDER.ADD_POLICY")," "))}function Ie(o,a){if(1&o&&(e.j41(0,"option",20),e.EFF(1),e.k0s()),2&o){const t=a.$implicit,n=e.XpG();e.Y8G("value",e.mNQ(t.id))("selected",n.policy.provider_id===t.id),e.R7$(),e.SpI(" ",t.provider," ")}}function fe(o,a){1&o&&(e.j41(0,"clr-control-error"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"P2P_PROVIDER.PROVIDER_REQUIRED")," "))}function Te(o,a){1&o&&(e.j41(0,"span",48),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.JRh(e.bMT(2,1,"P2P_PROVIDER.NO_PROVIDER")))}function Se(o,a){1&o&&(e.j41(0,"span",48),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.JRh(e.bMT(2,1,"P2P_PROVIDER.NEED_HELP")))}function be(o,a){1&o&&(e.j41(0,"a",49),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.JRh(e.bMT(2,1,"P2P_PROVIDER.PROVIDER")))}function ye(o,a){if(1&o&&(e.j41(0,"div",21),e.nrm(1,"label",43),e.j41(2,"div",46)(3,"div",47),e.nVh(4,Te,3,3,"span",48),e.nVh(5,Se,3,3,"span",48),e.nVh(6,be,3,3,"a",49),e.k0s()()()),2&o){const t=e.XpG();e.R7$(4),e.vxM(t.isSystemAdmin()?4:-1),e.R7$(),e.vxM(t.isSystemAdmin()?-1:5),e.R7$(),e.vxM(t.isSystemAdmin()?6:-1)}}function Oe(o,a){1&o&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.JRh(e.bMT(2,1,"SCANNER.NAME_EXISTS")))}function ve(o,a){1&o&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.JRh(e.bMT(2,1,"P2P_PROVIDER.NAME_TOOLTIP")))}function Me(o,a){if(1&o&&(e.j41(0,"clr-control-error"),e.nVh(1,Oe,3,3,"span"),e.nVh(2,ve,3,3,"span"),e.k0s()),2&o){const t=e.XpG(),n=e.sdS(27);e.R7$(),e.vxM((n.dirty||n.touched)&&n.invalid||!t.isNameExisting?-1:1),e.R7$(),e.vxM((n.dirty||n.touched)&&n.invalid?2:-1)}}function Fe(o,a){1&o&&(e.j41(0,"clr-control-error",35),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"P2P_PROVIDER.REPO_REQUIRED")," "))}function ke(o,a){1&o&&(e.j41(0,"clr-control-error",35),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"P2P_PROVIDER.TAG_REQUIRED")," "))}function De(o,a){1&o&&(e.j41(0,"clr-tooltip-content",56),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"P2P_PROVIDER.CRITERIA_EXPLAIN")," "))}function je(o,a){if(1&o){const t=e.RV6();e.j41(0,"div",36)(1,"label",43)(2,"span"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"clr-tooltip"),e.nrm(6,"clr-icon",50),e.DNE(7,De,3,3,"clr-tooltip-content",51),e.k0s()(),e.j41(8,"div",52)(9,"div",53)(10,"input",54),e.mxI("ngModelChange",function(i){r.eBV(t);const s=e.XpG();return e.DH7(s.onlySignedImages,i)||(s.onlySignedImages=i),r.Njj(i)}),e.k0s(),e.j41(11,"label",55),e.EFF(12),e.nI1(13,"translate"),e.k0s()()()()}if(2&o){const t=e.XpG();e.R7$(3),e.JRh(e.bMT(4,3,"P2P_PROVIDER.CRITERIA")),e.R7$(7),e.R50("ngModel",t.onlySignedImages),e.R7$(2),e.JRh(e.bMT(13,5,"P2P_PROVIDER.ONLY_SIGNED"))}}function xe(o,a){1&o&&(e.j41(0,"clr-tooltip-content",56),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"P2P_PROVIDER.CRITERIA_EXPLAIN")," "))}function Ne(o,a){1&o&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.j41(3,"clr-tooltip"),e.nrm(4,"clr-icon",61),e.DNE(5,xe,3,3,"clr-tooltip-content",51),e.k0s()),2&o&&(e.R7$(),e.JRh(e.bMT(2,1,"P2P_PROVIDER.CRITERIA")))}function Le(o,a){if(1&o&&(e.j41(0,"option",20),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o){const t=a.$implicit,n=e.XpG(2);e.Y8G("value",e.mNQ(t.severity))("selected",n.severity===t.severity),e.R7$(),e.SpI(" ",e.bMT(2,4,t.severityLevel)," ")}}function Ae(o,a){if(1&o){const t=e.RV6();e.j41(0,"div",41)(1,"label",31),e.nVh(2,Ne,6,3),e.k0s(),e.j41(3,"div",57)(4,"label",58),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.j41(7,"div",59)(8,"select",60,7),e.mxI("ngModelChange",function(i){r.eBV(t);const s=e.XpG();return e.DH7(s.severity,i)||(s.severity=i),r.Njj(i)}),e.j41(10,"option"),e.EFF(11,"--"),e.k0s(),e.Z7z(12,Le,3,6,"option",20,e.fX1),e.k0s()(),e.j41(14,"label",58),e.EFF(15),e.nI1(16,"translate"),e.k0s()()()}if(2&o){const t=e.XpG();e.R7$(2),e.vxM(t.enableContentTrust?-1:2),e.R7$(3),e.SpI("",e.bMT(6,4,"P2P_PROVIDER.START_TEXT"),"\xa0"),e.R7$(3),e.R50("ngModel",t.severity),e.R7$(4),e.Dyx(t.severityOptions),e.R7$(3),e.SpI("\xa0",e.bMT(16,6,"P2P_PROVIDER.EDN_TEXT"))}}function $e(o,a){if(1&o&&(e.j41(0,"option",20),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o){const t=a.$implicit,n=e.XpG();e.Y8G("value",e.mNQ(t))("selected",n.triggerType===t),e.R7$(),e.SpI(" ",e.bMT(2,4,n.getTriggerTypeI18n(t))," ")}}function Ve(o,a){1&o&&(e.j41(0,"clr-tooltip-content",64)(1,"div"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"div"),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.j41(7,"div"),e.EFF(8),e.nI1(9,"translate"),e.k0s(),e.j41(10,"div"),e.EFF(11),e.nI1(12,"translate"),e.k0s()()),2&o&&(e.R7$(2),e.SpI(" ",e.bMT(3,4,"P2P_PROVIDER.EVENT_BASED_EXPLAIN_LINE1")," "),e.R7$(3),e.SpI(" ",e.bMT(6,6,"P2P_PROVIDER.EVENT_BASED_EXPLAIN_LINE2")," "),e.R7$(3),e.SpI(" ",e.bMT(9,8,"P2P_PROVIDER.EVENT_BASED_EXPLAIN_LINE3")," "),e.R7$(3),e.SpI(" ",e.bMT(12,10,"P2P_PROVIDER.EVENT_BASED_EXPLAIN_LINE4")," "))}function we(o,a){1&o&&(e.j41(0,"clr-tooltip"),e.nrm(1,"clr-icon",62),e.DNE(2,Ve,13,12,"clr-tooltip-content",63),e.k0s())}function Ge(o,a){if(1&o){const t=e.RV6();e.j41(0,"div",36),e.nrm(1,"label",31),e.j41(2,"div",24)(3,"cron-selection",65,8),e.bIt("inputvalue",function(i){r.eBV(t);const s=e.XpG();
1return r.Njj(s.setCron(i))}),e.k0s()()()}if(2&o){const t=e.XpG();e.R7$(3),e.Y8G("isInlineModel",!0)("originCron",t.getCron())}}function Ue(o,a){if(1&o&&(e.j41(0,"option",20),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o){const t=a.$implicit,n=e.XpG(2);e.Y8G("value",e.mNQ(t))("selected",n.policy.scope===t),e.R7$(),e.SpI(" ",e.bMT(2,4,n.getScopeI18n(t))," ")}}function Be(o,a){if(1&o){const t=e.RV6();e.j41(0,"div")(1,"div",22)(2,"clr-select-container")(3,"label",43),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.j41(6,"select",66,9),e.mxI("ngModelChange",function(i){r.eBV(t);const s=e.XpG();return e.DH7(s.scope,i)||(s.scope=i),r.Njj(i)}),e.nrm(8,"option",19),e.Z7z(9,Ue,3,6,"option",20,e.fX1),e.k0s()()(),e.j41(11,"div",22)(12,"label",67),e.EFF(13),e.nI1(14,"translate"),e.k0s(),e.j41(15,"div",24)(16,"div",25)(17,"input",68,10),e.mxI("ngModelChange",function(i){r.eBV(t);const s=e.XpG();return e.DH7(s.clusterIDs,i)||(s.clusterIDs=i),r.Njj(i)}),e.k0s()(),e.j41(19,"clr-control-helper",69),e.EFF(20),e.nI1(21,"translate"),e.k0s()()()()}if(2&o){const t=e.XpG();e.R7$(4),e.SpI(" ",e.bMT(5,7,"P2P_PROVIDER.DRAGONFLY.SCOPE")," "),e.R7$(2),e.Y8G("disabled",t.loading),e.R50("ngModel",t.scope),e.R7$(3),e.Dyx(t.scopes),e.R7$(4),e.JRh(e.bMT(14,9,"P2P_PROVIDER.DRAGONFLY.CLUSTER_IDS")),e.R7$(4),e.Y8G("disabled",t.loading),e.R50("ngModel",t.clusterIDs),e.R7$(3),e.JRh(e.bMT(21,11,"P2P_PROVIDER.DRAGONFLY.CLUSTER_IDS_SEPARATOR"))}}function Je(o,a){if(1&o){const t=e.RV6();e.j41(0,"div",45)(1,"button",70),e.bIt("click",function(){r.eBV(t);const i=e.XpG();return r.Njj(i.onCancel())}),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"button",71),e.bIt("click",function(){r.eBV(t);const i=e.XpG();return r.Njj(i.addOrSave(!0))}),e.EFF(5),e.nI1(6,"translate"),e.k0s()()}if(2&o){const t=e.XpG();e.R7$(2),e.SpI(" ",e.bMT(3,4,"BUTTON.CANCEL")," "),e.R7$(2),e.Y8G("clrLoading",t.buttonStatus)("disabled",t.isNameExisting||t.checkNameOnGoing||t.loading||!t.valid()),e.R7$(),e.SpI(" ",e.bMT(6,6,"BUTTON.ADD")," ")}}function Xe(o,a){if(1&o){const t=e.RV6();e.j41(0,"div",45)(1,"button",72),e.bIt("click",function(){r.eBV(t);const i=e.XpG();return r.Njj(i.onCancel())}),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"button",73),e.bIt("click",function(){r.eBV(t);const i=e.XpG();return r.Njj(i.addOrSave(!1))}),e.EFF(5),e.nI1(6,"translate"),e.k0s()()}if(2&o){const t=e.XpG();e.R7$(2),e.SpI(" ",e.bMT(3,4,"BUTTON.CANCEL")," "),e.R7$(2),e.Y8G("clrLoading",t.buttonStatus)("disabled",t.isNameExisting||t.checkNameOnGoing||t.loading||!t.valid()||!t.hasChange()),e.R7$(),e.SpI(" ",e.bMT(6,6,"BUTTON.SAVE")," ")}}const Q="true";let W=(()=>{class o{constructor(t,n,i,s,d,l){this.preheatService=t,this.session=n,this.route=i,this.appConfigService=s,this.projectService=d,this.cdr=l,this.severityOptions=[{severity:5,severityLevel:"VULNERABILITY.SEVERITY.CRITICAL"},{severity:4,severityLevel:"VULNERABILITY.SEVERITY.HIGH"},{severity:3,severityLevel:"VULNERABILITY.SEVERITY.MEDIUM"},{severity:2,severityLevel:"VULNERABILITY.SEVERITY.LOW"},{severity:0,severityLevel:"VULNERABILITY.SEVERITY.NONE"}],this.isOpen=!1,this.closable=!1,this.staticBackdrop=!0,this.notify=new r.bkB,this.policy={},this.onlySignedImages=!1,this.triggerType=p.tr.MANUAL,this.scope=p.I$.SINGLE_SEED_PEER,this.loading=!1,this.buttonStatus=g.nn.DEFAULT,this.providers=[],this.preventVul=!1,this.triggers=[p.tr.MANUAL,p.tr.SCHEDULED,p.tr.EVENT_BASED],this.scopes=[p.I$.SINGLE_SEED_PEER,p.I$.ALL_SEED_PEERS,p.I$.ALL_PEERS],this.enableContentTrust=!1,this._nameSubject=new j.B,this.isNameExisting=!1,this.checkNameOnGoing=!1,this.hasInit=new r.bkB}ngOnInit(){const t=this.route.snapshot.parent.parent.data;if(t){const n=t.projectResolver;this.projectName=n.name,this.projectId=n.project_id,this.getProject()}this.subscribeName()}ngOnDestroy(){this._nameSubscription&&(this._nameSubscription.unsubscribe(),this._nameSubscription=null)}subscribeName(){this._nameSubscription||(this._nameSubscription=this._nameSubject.pipe((0,O.B)(500),(0,he.F)(),(0,ge.p)(t=>(!this.isEdit||!this.originPolicyForEdit||this.originPolicyForEdit.name!==t)&&t.length>0),(0,T.n)(t=>(this.isNameExisting=!1,this.checkNameOnGoing=!0,this.preheatService.ListPolicies({projectName:this.projectName,q:encodeURIComponent(`name=${t}`)}).pipe((0,h.j)(()=>this.checkNameOnGoing=!1))))).subscribe(t=>{t&&t.length>0&&(this.isNameExisting=!0),this.cdr.markForCheck()}))}inputName(){this._nameSubject.next(this.policy.name)}getProject(){this.projectService.getProject(this.projectId).subscribe(t=>{t&&t.metadata&&(this.preventVul=t.metadata.prevent_vul===Q,this.projectSeverity=t.metadata.severity,this.enableContentTrust=t.metadata.enable_content_trust_cosign===Q,this.severity=p.yI[this.projectSeverity]),this.hasInit.emit(!0),this.cdr.markForCheck()})}resetForAdd(){this.inlineAlert.close(),this.policy={},this.repos=null,this.tags=null,this.labels=null,this.cron=null,this.isNameExisting=!1,this.providers&&this.providers.length&&this.providers.forEac
1h(t=>{t.default&&(this.policy.provider_id=t.id)}),this.currentForm.reset({triggerType:"manual",scope:p.I$.SINGLE_SEED_PEER,severity:p.yI[this.projectSeverity],onlySignedImages:this.enableContentTrust,provider:this.policy.provider_id})}setCron(t){this.cron=t,this.cronScheduleComponent.resetSchedule()}getCron(){const t={type:"None",cron:""};return t.cron=this.cron,t.type=""===t.cron||null==t.cron?"None":"0 0 * * * *"===t.cron?"Hourly":"0 0 0 * * *"===t.cron?"Daily":"0 0 0 * * 0"===t.cron?"Weekly":"Custom",t}onCancel(){this.isOpen=!1}closeModal(){this.isOpen=!1}addOrSave(t){const n={};Object.assign(n,this.policy),n.provider_id=+n.provider_id;const i=[];this.repos&&(-1!==this.repos.indexOf(",")&&-1===this.repos.indexOf("{")&&-1===this.repos.indexOf("}")?i.push({type:p.a.REPOS,value:`{${this.repos}}`}):i.push({type:p.a.REPOS,value:this.repos})),this.tags&&(-1!==this.tags.indexOf(",")&&-1===this.tags.indexOf("{")&&-1===this.tags.indexOf("}")?i.push({type:p.a.TAG,value:`{${this.tags}}`}):i.push({type:p.a.TAG,value:this.tags})),this.labels&&(-1!==this.labels.indexOf(",")&&-1===this.labels.indexOf("{")&&-1===this.labels.indexOf("}")?i.push({type:p.a.LABEL,value:`{${this.labels}}`}):i.push({type:p.a.LABEL,value:this.labels})),n.filters=JSON.stringify(i),n.trigger=JSON.stringify({type:this.triggerType?this.triggerType:p.tr.MANUAL,trigger_setting:{cron:this.triggerType&&this.triggerType!==p.tr.MANUAL&&this.triggerType!==p.tr.EVENT_BASED?this.cron:""}}),this.loading=!0,this.buttonStatus=g.nn.LOADING;let d={};this.isDragonflyProvider(n.provider_id)&&(this.scope&&(d.scope=this.scope),this.clusterIDs&&(d.cluster_ids=this.clusterIDs.split(",").map(Number))),Object.keys(d).length&&(n.extra_attrs=JSON.stringify(d)),(0,_.mH)(n),t?(n.project_id=this.projectId,n.enabled=!0,this.preheatService.CreatePolicy({projectName:this.projectName,policy:n}).pipe((0,h.j)(()=>{this.loading=!1,this.cdr.markForCheck()})).subscribe(l=>{this.buttonStatus=g.nn.SUCCESS,this.closeModal(),this.notify.emit(t)},l=>{this.inlineAlert.showInlineError(l),this.buttonStatus=g.nn.ERROR})):(n.id=this.originPolicyForEdit.id,this.preheatService.UpdatePolicy({projectName:this.projectName,preheatPolicyName:this.originPolicyForEdit.name,policy:n}).pipe((0,h.j)(()=>{this.loading=!1,this.cdr.markForCheck()})).subscribe(l=>{this.buttonStatus=g.nn.SUCCESS,this.closeModal(),this.notify.emit(t)},l=>{this.inlineAlert.showInlineError(l),this.buttonStatus=g.nn.ERROR}))}valid(){return!(this.triggerType===p.tr.SCHEDULED&&!this.cron)&&this.currentForm.valid}compare(){return!!(this.projectSeverity&&this.preventVul&&p.yI[this.projectSeverity]>(this.severity?this.severity:0))}hasChange(){return!(this.policy.provider_id==this.originPolicyForEdit.provider_id&&this.policy.name==this.originPolicyForEdit.name&&(!this.policy.description&&!this.originPolicyForEdit.description||this.policy.description==this.originPolicyForEdit.description)&&this.originReposForEdit==this.repos&&this.originTagsForEdit==this.tags&&this.originOnlySignedImagesForEdit==this.onlySignedImages&&this.originLabelsForEdit==this.labels&&this.originSeverityForEdit==this.severity&&this.originTriggerTypeForEdit==this.triggerType&&this.originScopeForEdit==this.scope&&this.originClusterIDsForEdit==this.clusterIDs)||this.originCronForEdit!=this.cron}isSystemAdmin(){const t=this.session.getCurrentUser();return null!=t&&t.has_admin_role}getTriggerTypeI18n(t){return t?p.pQ[t]:""}getScopeI18n(t){return t?p.q8[t]:""}showCron(){return!!this.triggerType&&this.triggerType===p.tr.SCHEDULED}showExplainForEventBased(){return this.triggerType===p.tr.EVENT_BASED}isDragonflyProvider(t){return!(!this.providers||!this.providers.length)&&this.providers.some(n=>t==n.id&&n.provider.startsWith("dragonfly"))}static{this.\u0275fac=function(n){return new(n||o)(e.rXU($.J),e.rXU(ue.Q),e.rXU(b.nX),e.rXU(_e.R),e.rXU(R.TR),e.rXU(Y.gRc))}}static{this.\u0275cmp=e.VBU({type:o,selectors:[["add-p2p-policy"]],viewQuery:function(n,i){if(1&n&&e.GBs(X.r,5)(me,7)(Re,5),2&n){let s;e.mGM(s=e.lsd())&&(i.inlineAlert=s.first),e.mGM(s=e.lsd())&&(i.currentForm=s.first),e.mGM(s=e.lsd())&&(i.cronScheduleComponent=s.first)}},inputs:{providers:"providers"},outputs:{notify:"notify",hasInit:"hasInit"},standalone:!1,decls:94,vars:70,consts:[["policyForm","ngForm"],["provider","ngModel"],["name","ngModel"],["description","ngModel"],["repo","ngModel"],["tag","ngModel"],["ngTriggerType","ngModel"],["ngSeverity","ngModel"],["cronScheduleComponent",""],["ngScope","ngModel"],["ngClusterIDs","ngModel"],[3,"clrModalOpenChange","clrModalOpen","clrModalStaticBackdrop","clrModalClosable"],[1,"modal-title"],[1,"modal-body"],[1,"align-center"],[1,"clr-form","clr-form-horizontal"],[1,"form-block"],[1,"clr-control-label","required","width-6rem"],["clrSelect","","name","provider","id","provider","required","",1,"width-380",3,"ngModelChange","disabled","ngModel"],["value","",1,"display-none"],[3,"selected","value"],[1,"clr-form-control","mt-0"],[1,"clr-form-control"],["for","name",1,"clr-control-label","required","width-6rem"],[1,"clr-control-container"],[1,"clr-input-wrapper"],["pattern","^[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*$","autocomplete","off","type","text","id","name","size","30","name","name","required","",1,"clr-input","width-380",3,"ngModelChange","input","disabled","ngModel"],["shape","exclamation-circle",1,"clr-validate-icon"],[1,"spinner","spinner-inline",3,"hidden"],["for","description",1,"clr-control-label","width-6rem"],["autocomplete","off","type","text","id","description","name","description",1,"clr-textarea","width-380",3,"ngModelChange","disabled","ngModel"],["for","repo",1,"clr-control-label","width-6rem"],[1,"sub-label","required"],["placeholder","**","autocomplete","off","type","text","id","repo","size","30","name","repo","required","",1,"clr-input","width-290",3,"ngModelChange","disabled","ngModel"],[1,"margin-left-90px","opacity-08"],[1,"margin-left-90px"],[1,"clr-form-control","margin-top-06"],["for","repo",1,"width-6rem"],["placeholder","**","autocomplete","off","type","text","id","tag","size","30","name","tag","required","",1,"clr-input","width-290",3,"ngModelChange","disabled","ngModel"],[1,"sub-label"],["autocomplete","off","type","text","id","labels","size","30","name","label",1,"clr-input","width-290",3,"ngModelChange","disabled","ngModel"],[1,"clr-form-control","margin-top-06","mt-1"],[1,"flex","baseline"],[1,"clr-control-label","width-6rem"],["clrSelect","","name","triggerType","id","trigger-type",1,"width-380",3,"ngModelChange","disabled","ngModel"],[1,"mt-1","bottom-btn"],[1,"clr-control-container","width-380"],[1,"space-between"],[1,"alert-label"],["routerLink","/harbor/distribution/instances",1,"go-link"],["clrTooltipTrigger","","shape","info-circle","size","24",1,"cri-tooltip"],["clrPosition","top-left","clrSize","lg",4,"clrIfOpen"],[1,"clr-control-container","opacity-054"],[1,"clr-checkbox-wrapper"],["disabled","","type","checkbox","id","onlySignedImages","name","onlySignedImages",1,"clr-checkbox",3,"ngModelChange","ngModel"],["for","onlySignedImages",1,"font-size-12"],["clrPosition","top-left","clrSize","lg"],[1,"clr-control-container","flex"],[1,"sub-text","opacity-054"],[1,"clr-select-wrapper"],["disabled","","id","severity","name","severity",1,"clr-select",3,"ngModelChange","ngModel"],["clrTooltipTrigger","","shape","info-circle","size","24",1,"tooltip"],["clrTooltipTrigger","","shape","info-circle","size","24"],["clrPosition","top-right","clrSize","lg",4,"clrIfOpen"],["clrPosition","top-right","clrSize","lg"],[3,"inputvalue","isInlineModel","originCron"],["clrSelect","","name","scope","id","scope",1,"width-380",3,"ngModelChange","disabled","ngModel"],["for","clusterIDs",1,"clr-control-label","width-6rem"],["autocomplete","off","type","text","id","clusterIDs","size","30","name","clusterIDs",1,"clr-input","width-380",3,"ngModelChange","disabled","ngModel"],[1,"opacity-08"],["type","button","id","add-policy-cancel",1,"btn","btn-outline",3,"click"],["type","button","id","new-policy",1,"btn","btn-primary",3,"click","clrLoading","disabled"],["type","button","id","edit-policy-cancel",1,"btn","btn-outline",3,"click"],["type","button","id","edit-policy-save",1,"btn","btn-primary",3,"click","clrLoading","disabled"]],template:function(n,i){if
1(1&n){const s=e.RV6();e.j41(0,"clr-modal",11),e.mxI("clrModalOpenChange",function(l){return r.eBV(s),e.DH7(i.isOpen,l)||(i.isOpen=l),r.Njj(l)}),e.nVh(1,Ee,3,3,"h3",12),e.nVh(2,Ce,3,3,"h3",12),e.j41(3,"div",13)(4,"div",14),e.nrm(5,"inline-alert",12),e.j41(6,"form",15,0)(8,"section",16)(9,"clr-select-container")(10,"label",17),e.EFF(11),e.nI1(12,"translate"),e.k0s(),e.j41(13,"select",18,1),e.mxI("ngModelChange",function(l){return r.eBV(s),e.DH7(i.policy.provider_id,l)||(i.policy.provider_id=l),r.Njj(l)}),e.nrm(15,"option",19),e.Z7z(16,Ie,2,4,"option",20,e.fX1),e.k0s(),e.nVh(18,fe,3,3,"clr-control-error"),e.k0s(),e.nVh(19,ye,7,3,"div",21),e.j41(20,"div",22)(21,"label",23),e.EFF(22),e.nI1(23,"translate"),e.k0s(),e.j41(24,"div",24)(25,"div",25)(26,"input",26,2),e.mxI("ngModelChange",function(l){return r.eBV(s),e.DH7(i.policy.name,l)||(i.policy.name=l),r.Njj(l)}),e.bIt("input",function(){return i.inputName()}),e.k0s(),e.nrm(28,"clr-icon",27)(29,"span",28),e.k0s(),e.nVh(30,Me,3,2,"clr-control-error"),e.k0s()(),e.j41(31,"div",22)(32,"label",29),e.EFF(33),e.nI1(34,"translate"),e.k0s(),e.j41(35,"div",24)(36,"textarea",30,3),e.mxI("ngModelChange",function(l){return r.eBV(s),e.DH7(i.policy.description,l)||(i.policy.description=l),r.Njj(l)}),e.k0s()()(),e.j41(38,"div",22)(39,"label",31),e.EFF(40),e.nI1(41,"translate"),e.k0s(),e.j41(42,"div",24)(43,"div",25)(44,"label",32),e.EFF(45),e.nI1(46,"translate"),e.k0s(),e.j41(47,"input",33,4),e.mxI("ngModelChange",function(l){return r.eBV(s),e.DH7(i.repos,l)||(i.repos=l),r.Njj(l)}),e.k0s(),e.nrm(49,"clr-icon",27),e.k0s(),e.j41(50,"clr-control-helper",34),e.EFF(51),e.nI1(52,"translate"),e.k0s(),e.nVh(53,Fe,3,3,"clr-control-error",35),e.k0s()(),e.j41(54,"div",36),e.nrm(55,"label",37),e.j41(56,"div",24)(57,"div",25)(58,"label",32),e.EFF(59),e.nI1(60,"translate"),e.k0s(),e.j41(61,"input",38,5),e.mxI("ngModelChange",function(l){return r.eBV(s),e.DH7(i.tags,l)||(i.tags=l),r.Njj(l)}),e.k0s(),e.nrm(63,"clr-icon",27),e.k0s(),e.j41(64,"clr-control-helper",34),e.EFF(65),e.nI1(66,"translate"),e.k0s(),e.nVh(67,ke,3,3,"clr-control-error",35),e.k0s()(),e.j41(68,"div",36),e.nrm(69,"label",31),e.j41(70,"div",24)(71,"div",25)(72,"label",39),e.EFF(73),e.nI1(74,"translate"),e.k0s(),e.j41(75,"input",40),e.mxI("ngModelChange",function(l){return r.eBV(s),e.DH7(i.labels,l)||(i.labels=l),r.Njj(l)}),e.k0s(),e.nrm(76,"clr-icon",27),e.k0s()()(),e.nVh(77,je,14,7,"div",36),e.nVh(78,Ae,17,8,"div",41),e.j41(79,"div",42)(80,"clr-select-container")(81,"label",43),e.EFF(82),e.nI1(83,"translate"),e.k0s(),e.j41(84,"select",44,6),e.mxI("ngModelChange",function(l){return r.eBV(s),e.DH7(i.triggerType,l)||(i.triggerType=l),r.Njj(l)}),e.nrm(86,"option",19),e.Z7z(87,$e,3,6,"option",20,e.fX1),e.k0s()(),e.nVh(89,we,3,0,"clr-tooltip"),e.k0s(),e.nVh(90,Ge,5,2,"div",36),e.nVh(91,Be,22,13,"div"),e.k0s()(),e.nVh(92,Je,7,8,"div",45),e.nVh(93,Xe,7,8,"div",45),e.k0s()()()}if(2&n){const s=e.sdS(14),d=e.sdS(27),l=e.sdS(48),I=e.sdS(62);e.R50("clrModalOpen",i.isOpen),e.Y8G("clrModalStaticBackdrop",i.staticBackdrop)("clrModalClosable",i.closable),e.R7$(),e.vxM(i.isEdit?1:-1),e.R7$(),e.vxM(i.isEdit?-1:2),e.R7$(9),e.JRh(e.bMT(12,50,"P2P_PROVIDER.PROVIDER")),e.R7$(2),e.AVh("clr-error",s.errors&&s.errors.required&&(s.dirty||s.touched)),e.Y8G("disabled",i.loading),e.R50("ngModel",i.policy.provider_id),e.R7$(3),e.Dyx(i.providers),e.R7$(2),e.vxM(s.errors&&s.errors.required&&(s.dirty||s.touched)?18:-1),e.R7$(),e.vxM(i.providers&&i.providers.length?-1:19),e.R7$(3),e.JRh(e.bMT(23,52,"P2P_PROVIDER.NAME")),e.R7$(2),e.AVh("clr-error",(d.dirty||d.touched)&&d.invalid||i.isNameExisting),e.R7$(2),e.Y8G("disabled",i.loading),e.R50("ngModel",i.policy.name),e.R7$(3),e.Y8G("hidden",!i.checkNameOnGoing),e.R7$(),e.vxM((d.dirty||d.touched)&&d.invalid||i.isNameExisting?30:-1),e.R7$(3),e.JRh(e.bMT(34,54,"P2P_PROVIDER.DESCRIPTION")),e.R7$(3),e.Y8G("disabled",i.loading),e.R50("ngModel",i.policy.description),e.R7$(4),e.JRh(e.bMT(41,56,"P2P_PROVIDER.FILTERS")),e.R7$(2),e.AVh("clr-error",l.errors&&l.errors.required&&(l.dirty||l.touched)),e.R7$(3),e.JRh(e.bMT(46,58,"P2P_PROVIDER.REPOS")),e.R7$(2),e.Y8G("disabled",i.loading),e.R50("ngModel",i.repos),e.R7$(4),e.JRh(e.bMT(52,60,"TAG_RETENTION.REP_SEPARATOR")),e.R7$(2),e.vxM(l.errors&&l.errors.required&&(l.dirty||l.touched)?53:-1),e.R7$(3),e.AVh("clr-error",I.errors&&I.errors.required&&(I.dirty||I.touched)),e.R7$(3),e.JRh(e.bMT(60,62,"P2P_PROVIDER.TAGS")),e.R7$(2),e.Y8G("disabled",i.loading),e.R50("ngModel",i.tags),e.R7$(4),e.JRh(e.bMT(66,64,"P2P_PROVIDER.TAG_SEPARATOR")),e.R7$(2),e.vxM(I.errors&&I.errors.required&&(I.dirty||I.touched)?67:-1),e.R7$(6),e.JRh(e.bMT(74,66,"P2P_PROVIDER.LABELS")),e.R7$(2),e.Y8G("disabled",i.loading),e.R50("ngModel",i.labels),e.R7$(2),e.vxM(i.enableContentTrust?77:-1),e.R7$(),e.vxM(i.preventVul?78:-1),e.R7$(4),e.JRh(e.bMT(83,68,"P2P_PROVIDER.TRIGGER")),e.R7$(2),e.Y8G("disabled",i.loading),e.R50("ngModel",i.triggerType),e.R7$(3),e.Dyx(i.triggers),e.R7$(2),e.vxM(i.showExplainForEventBased()?89:-1),e.R7$(),e.vxM(i.showCron()?90:-1),e.R7$(),e.vxM(i.isDragonflyProvider(i.policy.provider_id)?91:-1),e.R7$(),e.vxM(i.isEdit?-1:92),e.R7$(),e.vxM(i.isEdit?93:-1)}},dependencies:[C.Wk,E.qT,E.xH,E.y7,E.me,E.Zm,E.wz,E.BC,E.cb,E.YS,E.R_,E.vS,E.cV,M.xwV,M.U4n,z.bZ,z.zN,g.ch,H.El,x.Lh,x.Hp,x.bn,K.Yf,K.hT,V.vE,y.BT,y.bX,y.iM,X.r,Pe.z,S.D9],styles:["[_nghost-%COMP%]  .modal-dialog{width:30rem}.display-none[_ngcontent-%COMP%]{display:none}.icon-tooltip[_ngcontent-%COMP%]{margin-top:4px}.padding-top-3[_ngcontent-%COMP%]{padding-top:3px}.bottom-btn[_ngcontent-%COMP%]{text-align:right}.width-380[_ngcontent-%COMP%]{width:380px}.width-290[_ngcontent-%COMP%]{width:290px}.width-6rem[_ngcontent-%COMP%]{width:6rem!important}.clr-control-label[_ngcontent-%COMP%]{width:8rem}.sub-label[_ngcontent-%COMP%]{display:inline-block;width:90px;font-size:.5417rem;font-weight:400}.sub-text[_ngcontent-%COMP%]{font-size:.5417rem;font-weight:400}.flex[_ngcontent-%COMP%]{display:flex}.margin-top-06[_ngcontent-%COMP%]{margin-top:.6rem}.margin-left-90px[_ngcontent-%COMP%]{margin-left:90px}.opacity-08[_ngcontent-%COMP%]{opacity:.8}.space-between[_ngcontent-%COMP%]{display:flex;font-size:12px;justify-content:space-between}.go-link[_ngcontent-%COMP%]{line-height:1rem;cursor:pointer}.alert-label[_ngcontent-%COMP%]{color:#f9392e}.warning[_ngcontent-%COMP%]{width:320px;line-height:.5rem;white-space:normal;height:auto}.cri-tooltip[_ngcontent-%COMP%]{margin-top:-2px}.cri-tooltip[_ngcontent-%COMP%]:focus{outline:none}.baseline[_ngcontent-%COMP%]{align-items:baseline}.opacity-054[_ngcontent-%COMP%]{opacity:.54}.font-size-12[_ngcontent-%COMP%]{font-size:12px}"],changeDetection:0})}}return o}
1)();var N=c(3154),L=c(5323),Ye=c(9404),ze=c(1556),A=c(1990),Z=c(8964),He=c(5077);const Ke=["confirmationDialogComponent"],q=o=>[o],ee=()=>[];function Qe(o,a){1&o&&(e.j41(0,"clr-tooltip-content",27),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"P2P_PROVIDER.PREHEAT_EXPLAIN")," "))}function We(o,a){1&o&&(e.j41(0,"span"),e.nrm(1,"clr-icon",37),e.j41(2,"span",38),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&o&&(e.R7$(3),e.JRh(e.bMT(4,1,"WEBHOOK.ENABLED_BUTTON")))}function Ze(o,a){1&o&&(e.j41(0,"span"),e.nrm(1,"clr-icon",39),e.j41(2,"span",38),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&o&&(e.R7$(3),e.JRh(e.bMT(4,1,"WEBHOOK.DISABLED_BUTTON")))}function qe(o,a){if(1&o){const t=e.RV6();e.j41(0,"clr-dropdown-menu")(1,"button",28),e.bIt("click",function(){r.eBV(t);const i=e.XpG();return r.Njj(i.executePolicy())}),e.j41(2,"span"),e.nrm(3,"clr-icon",29),e.j41(4,"span",30),e.EFF(5),e.nI1(6,"translate"),e.k0s()()(),e.j41(7,"button",28),e.bIt("click",function(){r.eBV(t);const i=e.XpG();return r.Njj(i.editPolicy())}),e.j41(8,"span"),e.nrm(9,"clr-icon",31),e.j41(10,"span",32),e.EFF(11),e.nI1(12,"translate"),e.k0s()()(),e.j41(13,"button",28),e.bIt("click",function(){r.eBV(t);const i=e.XpG();return r.Njj(i.switchStatus())}),e.j41(14,"span",33),e.nVh(15,We,5,3,"span"),e.nVh(16,Ze,5,3,"span"),e.k0s()(),e.nrm(17,"div",34),e.j41(18,"button",28),e.bIt("click",function(){r.eBV(t);const i=e.XpG();return r.Njj(i.deletePolicy())}),e.j41(19,"span"),e.nrm(20,"clr-icon",35),e.j41(21,"span",36),e.EFF(22),e.nI1(23,"translate"),e.k0s()()()()}if(2&o){const t=e.XpG();e.R7$(),e.Y8G("disabled",!(t.selectedRow&&t.selectedRow.enabled)||!t.hasUpdatePermission||t.executing),e.R7$(4),e.JRh(e.bMT(6,9,"P2P_PROVIDER.EXECUTE")),e.R7$(2),e.Y8G("disabled",!t.selectedRow||!t.hasUpdatePermission),e.R7$(4),e.JRh(e.bMT(12,11,"BUTTON.EDIT")),e.R7$(2),e.Y8G("disabled",!t.selectedRow||!t.hasUpdatePermission),e.R7$(2),e.vxM(t.selectedRow&&!t.selectedRow.enabled?15:-1),e.R7$(),e.vxM(t.selectedRow&&!t.selectedRow.enabled?-1:16),e.R7$(2),e.Y8G("disabled",!t.selectedRow||!t.hasDeletePermission),e.R7$(4),e.JRh(e.bMT(23,13,"BUTTON.DELETE"))}}function et(o,a){1&o&&(e.j41(0,"div",40),e.nrm(1,"clr-icon",44),e.j41(2,"span",38),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&o&&(e.R7$(3),e.JRh(e.bMT(4,1,"WEBHOOK.ENABLED")))}function tt(o,a){1&o&&(e.j41(0,"div",40),e.nrm(1,"clr-icon",45),e.j41(2,"span",38),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&o&&(e.R7$(3),e.JRh(e.bMT(4,1,"WEBHOOK.DISABLED")))}function it(o,a){if(1&o&&(e.j41(0,"span")(1,"span",46),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"span",47),e.EFF(5),e.k0s()()),2&o){const t=e.XpG().$implicit,n=e.XpG();e.R7$(2),e.JRh(e.bMT(3,2,"P2P_PROVIDER.REPOS")),e.R7$(3),e.SpI(": ",n.getValue(t.filters,"repository"))}}function nt(o,a){if(1&o&&(e.j41(0,"span",41)(1,"span",46),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"span",47),e.EFF(5),e.k0s()()),2&o){const t=e.XpG().$implicit,n=e.XpG();e.R7$(2),e.JRh(e.bMT(3,2,"P2P_PROVIDER.TAGS")),e.R7$(3),e.SpI(": ",n.getValue(t.filters,"tag"))}}function ot(o,a){if(1&o&&(e.j41(0,"span",41)(1,"span",46),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"span",47),e.EFF(5),e.k0s()()),2&o){const t=e.XpG().$implicit,n=e.XpG();e.R7$(2),e.JRh(e.bMT(3,2,"P2P_PROVIDER.LABELS")),e.R7$(3),e.SpI(": ",n.getValue(t.filters,"label"))}}function st(o,a){1&o&&(e.j41(0,"div",42)(1,"span",46),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&o&&(e.R7$(2),e.JRh(e.bMT(3,1,"P2P_PROVIDER.ONLY_SIGNED")))}function rt(o,a){if(1&o&&(e.j41(0,"div",42)(1,"span"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"span",47),e.EFF(5),e.k0s(),e.j41(6,"span"),e.EFF(7),e.nI1(8,"translate"),e.k0s()()),2&o){const t=e.XpG().$implicit,n=e.XpG();e.R7$(2),e.SpI("",e.bMT(3,3,"P2P_PROVIDER.START_TEXT"),"\xa0"),e.R7$(3),e.JRh(n.severity_map[n.getValue(t.filters,"vulnerability")]),e.R7$(2),e.SpI("\xa0",e.bMT(8,5,"P2P_PROVIDER.EDN_TEXT"))}}function lt(o,a){if(1&o&&(e.j41(0,"clr-signpost-content"),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2).$implicit,n=e.XpG();e.R7$(),e.SpI(" ",n.getScheduledCron(t.trigger)," ")}}function ct(o,a){1&o&&(e.j41(0,"clr-signpost"),e.DNE(1,lt,2,1,"clr-signpost-content",14),e.k0s())}function at(o,a){1&o&&(e.j41(0,"clr-signpost-content")(1,"div"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"div"),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.j41(7,"div"),e.EFF(8),e.nI1(9,"translate"),e.k0s(),e.j41(10,"div"),e.EFF(11),e.nI1(12,"translate"),e.k0s()()),2&o&&(e.R7$(2),e.SpI(" ",e.bMT(3,4,"P2P_PROVIDER.EVENT_BASED_EXPLAIN_LINE1")," "),e.R7$(3),e.SpI(" ",e.bMT(6,6,"P2P_PROVIDER.EVENT_BASED_EXPLAIN_LINE2")," "),e.R7$(3),e.SpI(" ",e.bMT(9,8,"P2P_PROVIDER.EVENT_BASED_EXPLAIN_LINE3")," "),e.R7$(3),e.SpI(" ",e.bMT(12,10,"P2P_PROVIDER.EVENT_BASED_EXPLAIN_LINE4")," "))}function pt(o,a){1&o&&(e.j41(0,"clr-signpost"),e.DNE(1,at,13,12,"clr-signpost-content",14),e.k0s())}function dt(o,a){if(1&o&&(e.j41(0,"clr-dg-row",21)(1,"clr-dg-cell"),e.EFF(2),e.k0s(),e.j41(3,"clr-dg-cell"),e.nV
1h(4,et,5,3,"div",40),e.nVh(5,tt,5,3,"div",40),e.k0s(),e.j41(6,"clr-dg-cell"),e.EFF(7),e.k0s(),e.j41(8,"clr-dg-cell")(9,"div"),e.nVh(10,it,6,4,"span"),e.nVh(11,nt,6,4,"span",41),e.nVh(12,ot,6,4,"span",41),e.k0s(),e.nVh(13,st,4,3,"div",42),e.nVh(14,rt,9,7,"div",42),e.k0s(),e.j41(15,"clr-dg-cell",43),e.EFF(16),e.nI1(17,"translate"),e.nVh(18,ct,2,0,"clr-signpost"),e.nVh(19,pt,2,0,"clr-signpost"),e.k0s(),e.j41(20,"clr-dg-cell"),e.EFF(21),e.nI1(22,"harborDatetime"),e.k0s(),e.j41(23,"clr-dg-cell"),e.EFF(24),e.k0s()()),2&o){const t=a.$implicit,n=e.XpG();e.Y8G("clrDgItem",t),e.R7$(2),e.JRh(t.name),e.R7$(2),e.vxM(t.enabled?4:-1),e.R7$(),e.vxM(t.enabled?-1:5),e.R7$(2),e.JRh(t.provider_name),e.R7$(3),e.vxM(n.getValue(t.filters,"repository")?10:-1),e.R7$(),e.vxM(n.getValue(t.filters,"tag")?11:-1),e.R7$(),e.vxM(n.getValue(t.filters,"label")?12:-1),e.R7$(),e.vxM(n.getValue(t.filters,"signature")?13:-1),e.R7$(),e.vxM(n.getValue(t.filters,"vulnerability")?14:-1),e.R7$(2),e.SpI(" ",e.bMT(17,15,n.getTriggerTypeI18n(t.trigger))," "),e.R7$(2),e.vxM(n.isScheduled(t.trigger)?18:-1),e.R7$(),e.vxM(n.isEventBased(t.trigger)?19:-1),e.R7$(2),e.JRh(e.i5U(22,17,t.creation_time,"short")),e.R7$(3),e.JRh(t.description)}}function ht(o,a){if(1&o&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o){e.XpG();const t=e.sdS(54);e.R7$(),e.E5c("",t.firstItem+1," - ",t.lastItem+1," ",e.bMT(2,3,"DESTINATION.OF"))}}function gt(o,a){1&o&&e.nrm(0,"clr-icon",59)}function ut(o,a){if(1&o&&(e.j41(0,"clr-tooltip-content",61)(1,"span"),e.EFF(2),e.k0s()()),2&o){const t=e.XpG().$implicit;e.Y8G("clrPosition","left"),e.R7$(2),e.JRh(t.status_message)}}function _t(o,a){if(1&o){const t=e.RV6();e.j41(0,"clr-dg-row",21)(1,"clr-dg-cell")(2,"a",58),e.bIt("click",function(){const i=r.eBV(t).$implicit,s=e.XpG(2);return r.Njj(s.goToLink(i.id))}),e.EFF(3),e.k0s()(),e.j41(4,"clr-dg-cell"),e.EFF(5),e.j41(6,"clr-tooltip"),e.nVh(7,gt,1,0,"clr-icon",59),e.DNE(8,ut,3,2,"clr-tooltip-content",60),e.k0s()(),e.j41(9,"clr-dg-cell"),e.EFF(10),e.nI1(11,"translate"),e.k0s(),e.j41(12,"clr-dg-cell"),e.EFF(13),e.nI1(14,"harborDatetime"),e.k0s(),e.j41(15,"clr-dg-cell"),e.EFF(16),e.k0s(),e.j41(17,"clr-dg-cell"),e.EFF(18),e.nI1(19,"percent"),e.k0s(),e.j41(20,"clr-dg-cell"),e.EFF(21),e.k0s()()}if(2&o){const t=a.$implicit,n=e.XpG(2);e.Y8G("clrDgItem",t),e.R7$(3),e.JRh(t.id),e.R7$(2),e.SpI(" ",t.status," "),e.R7$(2),e.vxM(t.status_message?7:-1),e.R7$(3),e.JRh(e.bMT(11,9,n.getTriggerTypeI18nForExecution(t.trigger))),e.R7$(3),e.JRh(e.i5U(14,11,t.start_time,"short")),e.R7$(3),e.JRh(n.getDuration(t)),e.R7$(2),e.JRh(e.bMT(19,14,n.getSuccessRate(t.metrics))),e.R7$(3),e.JRh(t.vendor_type)}}function Pt(o,a){if(1&o&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o){e.XpG();const t=e.sdS(54);e.R7$(),e.E5c("",t.firstItem+1," - ",t.lastItem+1," ",e.bMT(2,3,"REPLICATION.OF"))}}function mt(o,a){if(1&o){const t=e.RV6();e.j41(0,"div",24)(1,"h4",48),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"clr-datagrid",49),e.bIt("clrDgSelectedChange",function(i){r.eBV(t);const s=e.XpG();return r.Njj(s.selectedExecutionRow=null==i?null:i[0])})("clrDgRefresh",function(i){r.eBV(t);const s=e.XpG();return r.Njj(s.clrLoadJobs(null,!0,i))}),e.j41(5,"clr-dg-action-bar")(6,"div",7)(7,"div",8)(8,"button",50),e.bIt("click",function(){r.eBV(t);const i=e.XpG();return r.Njj(i.openStopExecutionsDialog())}),e.EFF(9),e.nI1(10,"translate"),e.k0s()(),e.j41(11,"div",51)(12,"div",52)(13,"select",53),e.bIt("change",function(i){r.eBV(t);const s=e.XpG();return r.Njj(s.selectFilterKey(i))}),e.j41(14,"option",54),e.EFF(15),e.nI1(16,"translate"),e.nI1(17,"lowercase"),e.k0s(),e.j41(18,"option",55),e.EFF(19),e.nI1(20,"translate"),e.nI1(21,"lowercase"),e.k0s()()(),e.j41(22,"hbr-filter",56),e.nI1(23,"translate"),e.bIt("filterEvt",function(i){r.eBV(t);const s=e.XpG();return r.Njj(s.doFilter(i))})("openFlag",function(i){r.eBV(t);const s=e.XpG();return r.Njj(s.openFilter(i))}),e.k0s(),e.j41(24,"span",17)(25,"clr-icon",18),e.bIt("click",function(){r.eBV(t);const i=e.XpG();return r.Njj(i.refreshJobs())}),e.k0s()()()()(),e.j41(26,"clr-dg-column"),e.EFF(27),e.nI1(28,"translate"),e.k0s(),e.j41(29,"clr-dg-column"),e.EFF(30),e.nI1(31,"translate"),e.k0s(),e.j41(32,"clr-dg-column"),e.EFF(33),e.nI1(34,"translate"),e.k0s(),e.j41(35,"clr-dg-column"),e.EFF(36),e.nI1(37,"translate"),e.k0s(),e.j41(38,"clr-dg-column"),e.EFF(39),e.nI1(40,"translate"),e.k0s(),e.j41(41,"clr-dg-column"),e.EFF(42),e.nI1(43,"translate"),e.k0s(),e.j41(44,"clr-dg-column"),e.EFF(45),e.nI1(46,"translate"),e.k0s(),e.j41(47,"clr-dg-placeholder"),e.EFF(48),e.nI1(49,"translate"),e.k0s(),e.Z7z(50,_t,22,16,"clr-dg-row",21,e.fX1),e.j41(52,"clr-dg-footer")(53,"clr-dg-pagination",57,0),e.mxI("clrDgPageChange",function(i){r.eBV(t);const s=e.XpG();return e.DH7(s.currentExecutionPage,i)||(s.currentExecutionPage=i),r.Njj(i)}
1),e.j41(55,"clr-dg-page-size",23),e.EFF(56),e.nI1(57,"translate"),e.k0s(),e.nVh(58,Pt,3,5,"span"),e.EFF(59),e.nI1(60,"translate"),e.k0s()()()()}if(2&o){const t=e.XpG();e.R7$(2),e.JRh(e.bMT(3,29,"P2P_PROVIDER.EXECUTIONS")),e.R7$(2),e.Y8G("clrDgSelected",t.selectedExecutionRow?e.eq3(63,q,t.selectedExecutionRow):e.lJ4(65,ee))("clrDgLoading",t.jobsLoading),e.R7$(4),e.Y8G("disabled",!t.hasUpdatePermission||!t.selectedExecutionRow||t.jobsLoading||t.stopLoading||!t.canStop()),e.R7$(),e.SpI(" ",e.bMT(10,31,"REPLICATION.STOPJOB")," "),e.R7$(3),e.Y8G("hidden",!t.isOpenFilterTag),e.R7$(3),e.SpI(" ",e.bMT(17,35,e.bMT(16,33,"P2P_PROVIDER.ID"))," "),e.R7$(4),e.SpI(" ",e.bMT(21,39,e.bMT(20,37,"REPLICATION.STATUS"))," "),e.R7$(3),e.Y8G("filterPlaceholder",e.mNQ(e.bMT(23,41,"REPLICATION.FILTER_EXECUTIONS_PLACEHOLDER")))("currentValue",t.searchString)("withDivider",!0),e.R7$(3),e.Y8G("hidden",t.jobsLoading),e.R7$(2),e.JRh(e.bMT(28,43,"REPLICATION.ID")),e.R7$(3),e.JRh(e.bMT(31,45,"REPLICATION.STATUS")),e.R7$(3),e.JRh(e.bMT(34,47,"P2P_PROVIDER.TRIGGER")),e.R7$(3),e.JRh(e.bMT(37,49,"REPLICATION.CREATION_TIME")),e.R7$(3),e.JRh(e.bMT(40,51,"REPLICATION.DURATION")),e.R7$(3),e.JRh(e.bMT(43,53,"REPLICATION.SUCCESS_RATE")),e.R7$(3),e.JRh(e.bMT(46,55,"P2P_PROVIDER.PROVIDER_TYPE")),e.R7$(3),e.JRh(e.bMT(49,57,"P2P_PROVIDER.JOB_PLACEHOLDER")),e.R7$(2),e.Dyx(t.executionList),e.R7$(3),e.R50("clrDgPage",t.currentExecutionPage),e.Y8G("clrDgPageSize",t.pageSize)("clrDgTotalItems",t.totalExecutionCount),e.R7$(2),e.Y8G("clrPageSizeOptions",t.clrPageSizeOptions),e.R7$(),e.JRh(e.bMT(57,59,"PAGINATION.PAGE_SIZE")),e.R7$(2),e.vxM(t.totalExecutionCount?58:-1),e.R7$(),e.Lme(" ",t.totalExecutionCount," ",e.bMT(60,61,"REPLICATION.ITEMS")," ")}}const te=/\/harbor\/projects\/(\d+)\/p2p-provider\/policies/;let Rt=(()=>{class o{constructor(t,n,i,s,d,l,I,G,It,ft,Tt){this.route=t,this.router=n,this.translate=i,this.p2pProviderService=s,this.messageHandlerService=d,this.userPermissionService=l,this.preheatService=I,this.event=G,this.scheduleService=It,this.skipSessionRenewalService=ft,this.cdr=Tt,this.clrPageSizeOptions=f.xp,this.policyList=[],this.providers=[],this.loading=!0,this.hasCreatPermission=!1,this.hasUpdatePermission=!1,this.hasDeletePermission=!1,this.addBtnState=g.nn.DEFAULT,this.executing=!1,this.isOpenFilterTag=!1,this.jobsLoading=!1,this.stopLoading=!1,this.executionList=[],this.currentExecutionPage=1,this.pageSize=(0,_.xM)(_.tZ.P2P_POLICY_COMPONENT_EXECUTIONS),this.totalExecutionCount=0,this.filterKey="id",this._searchSubject=new j.B,this.severity_map=p.wI,this.hasAddModalInit=!1,this.policyPageSize=(0,_.xM)(_.tZ.P2P_POLICY_COMPONENT,10),this.policyPage=1,this.totalPolicy=0,this.paused=!1}ngOnInit(){this.scheduleService.getSchedulePaused({jobType:Ye.Yx.ALL}).subscribe(n=>{this.paused=n?.paused,this.cdr.markForCheck()}),this.scrollSub||(this.scrollSub=this.event.subscribe(L.Z.SCROLL,n=>{n&&te.test(n.url)&&(this.scrollTop=n.scrollTop)})),this.routerSub||(this.routerSub=this.router.events.subscribe(n=>{n instanceof b.wF&&(n&&te.test(n.url)?this.event.publish(L.Z.SCROLL_TO_POSITION,this.scrollTop):this.event.publish(L.Z.SCROLL_TO_POSITION,0))})),this.subscribeSearch(),this.projectId=+this.route.snapshot.parent.parent.params.id;const t=this.route.snapshot.parent.parent.data;t&&(this.projectName=t.projectResolver.name),this.getPermissions()}ngOnDestroy(){this.routerSub&&(this.routerSub.unsubscribe(),this.routerSub=null),this.scrollSub&&(this.scrollSub.unsubscribe(),this.scrollSub=null),this._searchSubscription&&(this._searchSubscription.unsubscribe(),this._searchSubscription=null),this.clearLoop()}addModalInit(){this.hasAddModalInit=!0}getPermissions(){const t=[];t.push(this.userPermissionService.getPermission(this.projectId,R.DC.P2P_PROVIDER.KEY,R.DC.P2P_PROVIDER.VALUE.CREATE)),t.push(this.userPermissionService.getPermission(this.projectId,R.DC.P2P_PROVIDER.KEY,R.DC.P2P_PROVIDER.VALUE.UPDATE)),t.push(this.userPermissionService.getPermission(this.projectId,R.DC.P2P_PROVIDER.KEY,R.DC.P2P_PROVIDER.VALUE.DELETE)),this.addBtnState=g.nn.LOADING,(0,P.p)(...t).subscribe(n=>{[this.hasCreatPermission,this.hasUpdatePermission,this.hasDeletePermission]=n,this.addBtnState=g.nn.SUCCESS,this.cdr.markForCheck(),this.hasCreatPermission&&this.getProviders()},n=>{this.messageHandlerService.error(n),this.addBtnState=g.nn.ERROR,this.cdr.markForCheck()})}getProviders(){this.preheatService.ListProvidersUnderProject({projectName:this.projectName}).subscribe(t=>{t&&t.length&&(this.providers=t.filter(n=>n.enabled)),this.cdr.markForCheck()})}refresh(){this.selectedRow=null,this.policyPage=1,this.totalPolicy=0,this.getPolicies(this.state)}getPolicies(t){let n,i;t&&(this.state=t),t&&t.page&&(this.policyPageSize=t.page.size,(0,_.qq)(_.tZ.P2P_POLICY_COMPONENT,this.policyPageSize)),t&&t.filters&&t.filters.length&&(n=encodeURIComponent(`${t.filters[0].property}=~${t.filters[0].value}`)),i=t&&t.sort&&t.sort.by?(0,_.vF)(t):"-creation_time",this.loading=!0,this.preheatService.ListPoliciesResponse({projectName:this.projectName,sort:i,q:n,page:this.policyPage,pageSize:this.policyPageSize}).pipe((0,h.j)(()=>{this.loading=!1,this.cdr.markForCheck()})).subscribe(s=>{if(s.headers){let d=s.headers.get("X-Total-Count");d&&(this.totalPolicy=parseInt(d,0))}this.policyList=s.body||[]},s=>{this.messageHandlerService.handleError(s)})}switchStatus(){let t="";this.translate.get(this.selectedRow.enabled?"P2P_PROVIDER.DISABLED_POLICY_SUM
1MARY":"P2P_PROVIDER.ENABLED_POLICY_SUMMARY",{name:this.selectedRow.name}).subscribe(n=>{t=n;let i=new N.F(this.selectedRow.enabled?"P2P_PROVIDER.DISABLED_POLICY_TITLE":"P2P_PROVIDER.ENABLED_POLICY_TITLE",t,"",{},18,this.selectedRow.enabled?5:4);this.confirmationDialogComponent.open(i)})}confirmSwitch(t){if(t&&19===t.source&&1===t.state){this.stopLoading=!0;const n=(0,_.o8)(this.selectedExecutionRow);n.status=p.GO.STOPPED,this.preheatService.StopExecution({projectName:this.projectName,preheatPolicyName:this.selectedRow.name,executionId:this.selectedExecutionRow.id,execution:n}).pipe((0,h.j)(()=>{this.executing=!1,this.cdr.markForCheck()})).subscribe(i=>{this.messageHandlerService.showSuccess("P2P_PROVIDER.STOP_SUCCESSFULLY")},i=>{this.messageHandlerService.error(i)})}if(t&&20===t.source&&1===t.state&&(this.executing=!0,this.preheatService.ManualPreheat({projectName:this.projectName,preheatPolicyName:this.selectedRow.name,policy:this.selectedRow}).pipe((0,h.j)(()=>{this.executing=!1,this.cdr.markForCheck()})).subscribe(n=>{this.messageHandlerService.showSuccess("P2P_PROVIDER.EXECUTE_SUCCESSFULLY"),this.selectedRow&&this.refreshJobs()},n=>{this.messageHandlerService.error(n)})),t&&18===t.source&&1===t.state&&"{}"===JSON.stringify(t.data)&&this.preheatService.UpdatePolicy({projectName:this.projectName,preheatPolicyName:this.selectedRow.name,policy:Object.assign({},this.selectedRow,{enabled:!this.selectedRow.enabled})}).subscribe(n=>{this.messageHandlerService.showSuccess("P2P_PROVIDER.UPDATED_SUCCESSFULLY"),this.refresh()},n=>{this.messageHandlerService.handleError(n),this.cdr.markForCheck()}),t&&21===t.source&&1===t.state){const n=[];n.push(this.preheatService.DeletePolicy({projectName:this.projectName,preheatPolicyName:this.selectedRow.name})),(0,P.p)(...n).subscribe(i=>{this.messageHandlerService.showSuccess("P2P_PROVIDER.DELETE_SUCCESSFULLY"),this.refresh()},i=>{this.messageHandlerService.handleError(i),this.cdr.markForCheck()})}}newPolicy(){this.addP2pPolicyComponent.isOpen=!0,this.addP2pPolicyComponent.isEdit=!1,this.addP2pPolicyComponent.resetForAdd()}editPolicy(){if(this.selectedRow){this.addP2pPolicyComponent.repos=null,this.addP2pPolicyComponent.tags=null,this.addP2pPolicyComponent.labels=null,this.addP2pPolicyComponent.isOpen=!0,this.addP2pPolicyComponent.isEdit=!0,this.addP2pPolicyComponent.isNameExisting=!1,this.addP2pPolicyComponent.inlineAlert.close(),this.addP2pPolicyComponent.policy=(0,_.o8)(this.selectedRow);const t=JSON.parse(this.selectedRow.filters);t&&t.length&&t.forEach(i=>{if(i.type===p.a.REPOS&&i.value){let s=i.value;if(/^{\S+}$/.test(s))return s.slice(1,s.length-1);this.addP2pPolicyComponent.repos=s}if(i.type===p.a.TAG&&i.value){let s=i.value;if(/^{\S+}$/.test(s))return s.slice(1,s.length-1);this.addP2pPolicyComponent.tags=s}if(i.type===p.a.LABEL&&i.value){let s=i.value;if(/^{\S+}$/.test(s))return s.slice(1,s.length-1);this.addP2pPolicyComponent.labels=s}});const n=JSON.parse(this.selectedRow.trigger);if(n&&(this.addP2pPolicyComponent.triggerType=n.type,this.addP2pPolicyComponent.cron=n.trigger_setting.cron),this.addP2pPolicyComponent.policy.extra_attrs){const{scope:i="",cluster_ids:s=[]}=JSON.parse(this.addP2pPolicyComponent.policy.extra_attrs);this.addP2pPolicyComponent.scope=i,this.addP2pPolicyComponent.clusterIDs=s.join(",")}this.addP2pPolicyComponent.currentForm.reset({provider:this.addP2pPolicyComponent.policy.provider_id,name:this.addP2pPolicyComponent.policy.name,description:this.addP2pPolicyComponent.policy.description,repo:this.addP2pPolicyComponent.repos,tag:this.addP2pPolicyComponent.tags,onlySignedImages:this.addP2pPolicyComponent.enableContentTrust,severity:this.addP2pPolicyComponent.severity,label:this.addP2pPolicyComponent.labels,triggerType:this.addP2pPolicyComponent.triggerType,scope:this.addP2pPolicyComponent.scope,clusterIDs:this.addP2pPolicyComponent.clusterIDs}),this.addP2pPolicyComponent.originPolicyForEdit=(0,_.o8)(this.selectedRow),this.addP2pPolicyComponent.originReposForEdit=this.addP2pPolicyComponent.repos,this.addP2pPolicyComponent.originTagsForEdit=this.addP2pPolicyComponent.tags,this.addP2pPolicyComponent.originOnlySignedImagesForEdit=this.addP2pPolicyComponent.onlySignedImages,this.addP2pPolicyComponent.originSeverityForEdit=this.addP2pPolicyComponent.severity,this.addP2pPolicyComponent.originLabelsForEdit=this.addP2pPolicyComponent.labels,this.addP2pPolicyComponent.originTriggerTypeForEdit=this.addP2pPolicyComponent.triggerType,this.addP2pPolicyComponent.originCronForEdit=this.addP2pPolicyComponent.cron,this.addP2pPolicyComponent.originScopeForEdit=this.addP2pPolicyComponent.scope,this.addP2pPolicyComponent.originClusterIDsForEdit=this.addP2pPolicyComponent.clusterIDs}}deletePolicy(){const t=[];t.push(this.selectedRow.name);let n="";
1this.translate.get("P2P_PROVIDER.DELETE_POLICY_SUMMARY",{names:t.join(",")}).subscribe(s=>n=s);const i=new N.F("SCANNER.CONFIRM_DELETION",n,t.join(","),this.selectedRow,21,2);this.confirmationDialogComponent.open(i)}executePolicy(){if(this.selectedRow&&this.selectedRow.enabled){const t=new N.F("P2P_PROVIDER.EXECUTE_TITLE","P2P_PROVIDER.EXECUTE_SUMMARY",this.selectedRow.name,this.selectedRow,20,0);this.confirmationDialogComponent.open(t)}}success(t){let n;n=t?"P2P_PROVIDER.ADDED_SUCCESS":"P2P_PROVIDER.UPDATED_SUCCESS",this.messageHandlerService.showSuccess(n),this.refresh()}clrLoadJobs(t,n,i){if(this.selectedRow){let s;i&&i.page&&(this.pageSize=i.page.size,(0,_.qq)(_.tZ.P2P_POLICY_COMPONENT_EXECUTIONS,this.pageSize)),n&&setTimeout(()=>{this.jobsLoading=!0,this.cdr.markForCheck()}),this.searchString&&(s=encodeURIComponent(`${this.filterKey}=~${this.searchString}`)),this.preheatService.ListExecutionsResponse({projectName:this.projectName,preheatPolicyName:t?t.name:this.selectedRow.name,page:this.currentExecutionPage,pageSize:this.pageSize,q:s}).pipe((0,m.wk)(this.skipSessionRenewalService)).pipe((0,h.j)(()=>{this.jobsLoading=!1,this.cdr.markForCheck()})).subscribe(d=>{if(d.headers){let l=d.headers.get("X-Total-Count");l&&(this.totalExecutionCount=parseInt(l,0))}this.executionList=d.body,this.setLoop()},d=>{this.messageHandlerService.handleError(d)})}}refreshJobs(t){this.executionList=[],this.currentExecutionPage=1,this.totalExecutionCount=0,this.filterKey="id",this.searchString=null,this.cdr.markForCheck(),this.clrLoadJobs(t,!0)}openStopExecutionsDialog(){if(this.selectedExecutionRow){const t=new N.F("P2P_PROVIDER.STOP_TITLE","P2P_PROVIDER.STOP_SUMMARY",this.selectedExecutionRow.id+"",this.selectedExecutionRow,19,0);this.confirmationDialogComponent.open(t)}}goToLink(t){this.router.navigate(["harbor","projects",`${this.projectId}`,"p2p-provider",`${this.selectedRow.name}`,"executions",`${t}`,"tasks"])}getTriggerTypeI18n(t){return JSON.parse(t).type?this.paused&&JSON.parse(t).type===p.tr.SCHEDULED?p.pQ[p.tr.SCHEDULED_PAUSED]:p.pQ[JSON.parse(t).type]:p.pQ[p.tr.MANUAL]}getTriggerTypeI18nForExecution(t){return t&&p.pQ[t]?p.pQ[t]:t}isScheduled(t){return JSON.parse(t).type===p.tr.SCHEDULED}isEventBased(t){return JSON.parse(t).type===p.tr.EVENT_BASED}getScheduledCron(t){return JSON.parse(t).trigger_setting.cron}getDuration(t){return this.p2pProviderService.getDuration(t.start_time,t.end_time)}getValue(t,n){const i=JSON.parse(t);if(i&&i.length)for(let s=0;s<i.length;s++)if(i[s].type===n&&i[s].value){let d=i[s].value;return/^{\S+}$/.test(d)?d.slice(1,d.length-1):d}return""}getSuccessRate(t){return t&&t.task_count&&t.success_task_count?t.success_task_count/t.task_count:0}selectFilterKey(t){this.filterKey=t.target.value}openFilter(t){this.isOpenFilterTag=t}doFilter(t){this.searchString=t,t.trim()?this._searchSubject.next(t.trim()):this.clrLoadJobs(null,!0)}subscribeSearch(){this._searchSubscription||(this._searchSubscription=this._searchSubject.pipe((0,O.B)(500),(0,T.n)(t=>{let n;return this.jobsLoading=!0,this.searchString&&(n=encodeURIComponent(`${this.filterKey}=~${t}`)),this.preheatService.ListExecutionsResponse({projectName:this.projectName,preheatPolicyName:this.selectedRow.name,page:1,pageSize:this.pageSize,q:n}).pipe((0,h.j)(()=>this.jobsLoading=!1))})).subscribe(t=>{if(t.headers){let n=t.headers.get("x-total-count");n&&(this.totalExecutionCount=parseInt(n,0))}this.executionList=t.body,this.setLoop(),this.cdr.markForCheck()}))}canStop(){return this.selectedExecutionRow&&this.p2pProviderService.willChangStatus(this.selectedExecutionRow.status)}clearLoop(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}setLoop(){if(this.clearLoop(),this.executionList&&this.executionList.length)for(let t=0;t<this.executionList.length;t++)this.p2pProviderService.willChangStatus(this.executionList[t].status)&&(this.timeout||(this.timeout=setTimeout(()=>{this.clrLoadJobs(null,!1)},p.rG)))}static{this.\u0275fac=function(n){return new(n||o)(e.rXU(b.nX),e.rXU(b.Ix),e.rXU(S.c$),e.rXU(p.RR),e.rXU(v.l),e.rXU(R.OE),e.rXU($.J),e.rXU(L.U),e.rXU(ze.l),e.rXU(m.BY),e.rXU(Y.gRc))}}static{this.\u0275cmp=e.VBU({type:o,selectors:[["ng-component"]],viewQuery:function(n,i){if
1(1&n&&e.GBs(W,5)(Ke,5),2&n){let s;e.mGM(s=e.lsd())&&(i.addP2pPolicyComponent=s.first),e.mGM(s=e.lsd())&&(i.confirmationDialogComponent=s.first)}},standalone:!1,decls:65,vars:58,consts:[["pagination",""],["confirmationDialogComponent",""],[1,"row"],[1,"mt-1"],["clrTooltipTrigger","","shape","info-circle","size","24",1,"color-57"],["clrPosition","top-right","clrSize","lg",4,"clrIfOpen"],["clrDgSelectionType","single",3,"clrDgRefresh","clrDgSelectedChange","clrDgLoading","clrDgSelected"],[1,"clr-row"],[1,"clr-col-7"],["id","new-policy","type","button",1,"btn","btn-secondary",3,"click","disabled","clrLoading"],["shape","plus","size","16"],["clrDropdownTrigger","",1,"btn","btn-link",3,"clrCloseMenuOnItemClick"],["id","action-policy"],["shape","caret","direction","down",1,"clr-icon"],[4,"clrIfOpen"],[1,"clr-col-5"],[1,"action-head-pos"],[1,"refresh-btn"],["shape","refresh",3,"click","hidden"],[3,"clrDgField"],[3,"clrDgSortBy"],[3,"clrDgItem"],[3,"clrDgPageChange","clrDgPageSize","clrDgPage","clrDgTotalItems"],[3,"clrPageSizeOptions"],[1,"col-lg-12","col-md-12","col-sm-12","col-xs-12"],[3,"hasInit","notify","providers"],[3,"confirmAction"],["clrPosition","top-right","clrSize","lg"],["clrDropdownItem","",1,"btn","btn-secondary",3,"click","disabled"],["size","16","shape","play",1,"margin-top-0"],["id","execute-policy",1,"margin-left-5px"],["size","16","shape","pencil",1,"margin-top-0"],["id","edit-policy",1,"margin-left-5px"],["id","toggle-policy"],[1,"dropdown-divider"],["size","16","shape","times",1,"margin-top-0"],["id","delete-policy",1,"margin-left-5px"],["size","16","shape","success-standard",1,"margin-top-2"],[1,"margin-left-5px"],["size","16","shape","ban",1,"margin-top-2"],[1,"icon-wrap"],[1,"margin-left-10px"],[1,"margin-top-5px"],[1,"no-wrapper"],["shape","check-circle","size","20","status","success",1,"enabled-icon"],["shape","exclamation-triangle","size","20","status","warning"],[1,"filter-title"],[1,"opacity08"],[1,"mt-2"],["clrDgSelectionType","single",3,"clrDgSelectedChange","clrDgRefresh","clrDgSelected","clrDgLoading"],["type","button",1,"btn","btn-secondary",3,"click","disabled"],[1,"clr-col-5","flex-end"],[1,"select","filter-tag","clr-select-wrapper",3,"hidden"],["id","selectKey",3,"change"],["value","id"],["value","status"],["id","filter-executions",3,"filterEvt","openFlag","currentValue","withDivider","filterPlaceholder"],[3,"clrDgPageChange","clrDgPage","clrDgPageSize","clrDgTotalItems"],["href","javascript:void(0)",3,"click"],["clrTooltipTrigger","","shape","info-circle","size","20"],["clrSize","md",3,"clrPosition",4,"clrIfOpen"],["clrSize","md",3,"clrPosition"]],template:function(n,i){if(1&n){const s=e.RV6();e.j41(0,"div",2)(1,"h4",3)(2,"span"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"clr-tooltip"),e.nrm(6,"clr-icon",4),e.DNE(7,Qe,3,3,"clr-tooltip-content",5),e.k0s()(),e.j41(8,"clr-datagrid",6),e.bIt("clrDgRefresh",function(l){return i.getPolicies(l)})("clrDgSelectedChange",function(l){return r.eBV(s),i.selectedRow=null==l?null:l[0],r.Njj(i.refreshJobs(null==l?null:l[0]))}),e.j41(9,"clr-dg-action-bar")(10,"div",7)(11,"div",8)(12,"button",9),e.bIt("click",function(){return i.newPolicy()}),e.nrm(13,"clr-icon",10),e.EFF(14),e.nI1(15,"translate"),e.k0s(),e.j41(16,"clr-dropdown",11)(17,"span",12),e.EFF(18),e.nI1(19,"translate"),e.nrm(20,"clr-icon",13),e.k0s(),e.DNE(21,qe,24,15,"clr-dropdown-menu",14),e.k0s()(),e.j41(22,"div",15)(23,"div",16)(24,"span",17)(25,"clr-icon",18),e.bIt("click",function(){return i.refresh()}),e.k0s()()()()()(),e.j41(26,"clr-dg-column",19),e.EFF(27),e.nI1(28,"translate"),e.k0s(),e.j41(29,"clr-dg-column"),e.EFF(30),e.nI1(31,"translate"),e.k0s(),e.j41(32,"clr-dg-column"),e.EFF(33),e.nI1(34,"translate"),e.k0s(),e.j41(35,"clr-dg-column"),e.EFF(36),e.nI1(37,"translate"),e.k0s(),e.j41(38,"clr-dg-column"),e.EFF(39),e.nI1(40,"translate"),e.k0s(),e.j41(41,"clr-dg-column",20),e.EFF(42),e.nI1(43,"translate"),e.k0s(),e.j41(44,"clr-dg-column"),e.EFF(45),e.nI1(46,"translate"),e.k0s(),e.j41(47,"clr-dg-placeholder"),e.EFF(48),e.nI1(49,"translate"),e.k0s(),e.Z7z(50,dt,25,20,"clr-dg-row",21,e.fX1),e.j41(52,"clr-dg-footer")(53,"clr-dg-pagination",22,0),e.mxI("clrDgPageChange",function(l){return r.eBV(s),e.DH7(i.policyPage,l)||(i.policyPage=l),r.Njj(l)}
1),e.j41(55,"clr-dg-page-size",23),e.EFF(56),e.nI1(57,"translate"),e.k0s(),e.nVh(58,ht,3,5,"span"),e.EFF(59),e.nI1(60,"translate"),e.k0s()()()(),e.nVh(61,mt,61,66,"div",24),e.j41(62,"add-p2p-policy",25),e.bIt("hasInit",function(){return i.addModalInit()})("notify",function(l){return i.success(l)}),e.k0s(),e.j41(63,"confirmation-dialog",26,1),e.bIt("confirmAction",function(l){return i.confirmSwitch(l)}),e.k0s()}2&n&&(e.R7$(3),e.JRh(e.bMT(4,29,"P2P_PROVIDER.POLICIES")),e.R7$(5),e.Y8G("clrDgLoading",i.loading)("clrDgSelected",i.selectedRow?e.eq3(55,q,i.selectedRow):e.lJ4(57,ee)),e.R7$(4),e.Y8G("disabled",!i.hasCreatPermission||!i.hasAddModalInit)("clrLoading",i.addBtnState),e.R7$(2),e.SpI(" ",e.bMT(15,31,"P2P_PROVIDER.NEW_POLICY")," "),e.R7$(2),e.Y8G("clrCloseMenuOnItemClick",!0),e.R7$(2),e.SpI("",e.bMT(19,33,"MEMBER.ACTION")," "),e.R7$(7),e.Y8G("hidden",i.loading),e.R7$(),e.Y8G("clrDgField","name"),e.R7$(),e.JRh(e.bMT(28,35,"P2P_PROVIDER.NAME")),e.R7$(3),e.JRh(e.bMT(31,37,"P2P_PROVIDER.ENABLED")),e.R7$(3),e.JRh(e.bMT(34,39,"P2P_PROVIDER.PROVIDER")),e.R7$(3),e.JRh(e.bMT(37,41,"P2P_PROVIDER.FILTERS")),e.R7$(3),e.JRh(e.bMT(40,43,"P2P_PROVIDER.TRIGGER")),e.R7$(2),e.Y8G("clrDgSortBy","creation_time"),e.R7$(),e.JRh(e.bMT(43,45,"P2P_PROVIDER.CREATED")),e.R7$(3),e.JRh(e.bMT(46,47,"P2P_PROVIDER.DESCRIPTION")),e.R7$(3),e.SpI(" ",e.bMT(49,49,"P2P_PROVIDER.NO_POLICY")," "),e.R7$(2),e.Dyx(i.policyList),e.R7$(3),e.Y8G("clrDgPageSize",i.policyPageSize),e.R50("clrDgPage",i.policyPage),e.Y8G("clrDgTotalItems",i.totalPolicy),e.R7$(2),e.Y8G("clrPageSizeOptions",i.clrPageSizeOptions),e.R7$(),e.JRh(e.bMT(57,51,"PAGINATION.PAGE_SIZE")),e.R7$(2),e.vxM(i.totalPolicy?58:-1),e.R7$(),e.Lme(" ",i.totalPolicy," ",e.bMT(60,53,"DESTINATION.ITEMS")," "),e.R7$(2),e.vxM(i.selectedRow?61:-1),e.R7$(),e.Y8G("providers",i.providers))},dependencies:[E.xH,E.y7,u.gh,u.fQ,u.sl,u.sc,u.Lw,u.oi,u.o3,u.XT,u.E1,u.UW,u.lD,u.tH,u._Q,u.tW,u.eU,u.F$,M.xwV,M.U4n,g.ch,H.El,A.TZ,A.e3,A.jW,A.wI,V.vE,Z.TU,Z.iY,y.BT,y.bX,y.iM,B.i,He.D,W,S.D9,w.GH,w.m1,J.E],styles:[".action-head-pos[_ngcontent-%COMP%]{padding-right:18px;height:100%;display:flex;justify-content:flex-end;align-items:center}.icon-wrap[_ngcontent-%COMP%]{display:flex;align-items:center;height:20px}.cell[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;height:100%}.margin-left-5px[_ngcontent-%COMP%]{margin-left:5px}.margin-left-10px[_ngcontent-%COMP%]{margin-left:10px}.flex-end[_ngcontent-%COMP%]{align-items:center;display:flex;justify-content:flex-end;padding-right:1.5rem}.refresh-btn[_ngcontent-%COMP%]{margin-top:6px;cursor:pointer}.filter-tag[_ngcontent-%COMP%]{margin-top:7px}.filter-title[_ngcontent-%COMP%]{font-weight:400}.margin-top-5px[_ngcontent-%COMP%]{margin-top:5px}.opacity08[_ngcontent-%COMP%]{opacity:.8}.no-wrapper[_ngcontent-%COMP%]{white-space:nowrap}"],changeDetection:0})}}return o})();var ie=c(7142);const Et=[{path:"policies",component:Rt,data:{reuse:!0,routeConfigId:ie.P.P2P_POLICIES_PAGE}},{path:":preheatPolicyName/executions/:executionId/tasks",component:de,data:{routeConfigId:ie.P.P2P_TASKS_PAGE}},{path:"",redirectTo:"policies",pathMatch:"full"}];let Ct=(()=>{class o{static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275mod=e.$C({type:o})}static{this.\u0275inj=r.G2t({providers:[p.RR],imports:[C.iI.forChild(Et),D.G]})}}return o})()},2247(U,k,c){c.d(k,{i:()=>P});var C=c(5802),D=c(1413),O=c(152),T=c(7705),h=c(5547),_=c(9417),R=c(8062);const p=["inputElement"];function j(g,f){1&g&&h.nrm(0,"span",3)}let P=(()=>{class g{set filterPlaceholder(m){this.placeHolder=m}constructor(m){this.cd=m,this.placeHolder="",this.filterTerms=new D.B,this.isExpanded=!1,this.filterEvt=new C.bkB,this.openFlag=new C.bkB,this.readonly=null,this.expandMode=!1,this.withDivider=!1}ngOnInit(){this.filterTerms.pipe((0,O.B)(500)).subscribe(m=>{this.filterEvt.emit(m)})}valueChange(){this.filterTerms.next(this.currentValue&&this.currentValue.trim())}inputFocus(){this.openFlag.emit(this.isExpanded)}onClick(){this.expandMode||(this.isExpanded=!this.isExpanded,this.isExpanded&&(this.cd.detectChanges(),this.inputElement.nativeElement.focus()),this.openFlag.emit(this.isExpanded))}get isShowSearchBox(){return this.expandMode||!this.expandMode&&this.isExpanded}static{this.\u0275fac=function(e){return new(e||g)(h.rXU(T.gRc))}}static{this.\u0275cmp=h.VBU({type:g,selectors:[["hbr-filter"]],viewQuery:function(e,r){if(1&e&&h.GBs(p,5),2&e){let S;h.mGM(S=h.lsd())&&(r.inputElement=S.first)}},inputs:{readonly:"readonly",currentValue:"currentValue",filterPlaceholder:"filterPlaceholder",expandMode:"expandMode",withDivider:"withDivider",width:"width"},outputs:{filterEvt:"filterEvt",openFlag:"openFlag"},standalone:!1,decls:5,vars:10,consts:[["inputElement",""],["shape","search","size","20",1,"search-btn",3,"click"],["type","text","autofocus","",1,"filter-input","clr-input",3,"keyup","focus","ngModelChange","hidden","placeholder","ngModel"],[1,"filter-divider"]],template:function(e,r){if(1&e){const S=h.RV6();h.j41(0,"span")(1,"clr-icon",1),h.bIt("click",function(){return r.onClick()}),h.k0s(),h.j41(2,"input",2,0),h.bIt("keyup",function(){return r.valueChange()})("focus",function(){return r.inputFocus()}),h.mxI("ngModelChange",function(v){return C.eBV(S),h.DH7(r.currentValue,v)||(r.currentValue=v),C.Njj(v)}),h.k0s(),h.nVh(4,j,1,0,"span",3),h.k0s()}
12&e&&(h.R7$(),h.AVh("filter-icon",r.isShowSearchBox),h.R7$(),h.xc7("width",r.width,"px"),h.Y8G("placeholder",h.mNQ(r.placeHolder))("hidden",!r.isShowSearchBox),h.R50("ngModel",r.currentValue),h.BMQ("readOnly",r.readonly),h.R7$(2),h.vxM(r.withDivider?4:-1))},dependencies:[_.me,_.BC,_.vS,R.xwV,R.U4n],styles:[".filter-icon[_ngcontent-%COMP%]{position:relative;right:-20px}.filter-divider[_ngcontent-%COMP%]{display:inline-block;height:16px;width:1px;padding-top:12px;padding-bottom:12px;position:relative;top:9px;margin-right:6px;margin-left:6px}.search-btn[_ngcontent-%COMP%]{cursor:pointer}.search-btn[_ngcontent-%COMP%]:hover{color:#007cbb}.filter-input[_ngcontent-%COMP%]{padding-left:24px}"]})}}return g})()}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.