@knoflows/engine 0.1.0-alpha.4 → 0.1.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/engine.js +14 -13
  2. package/package.json +1 -1
  3. package/static/assets/i18n/en.json +8 -7
  4. package/static/assets/i18n/es.json +8 -7
  5. package/static/{chunk-D6KYmz2w.js → chunk--huWzdqj.js} +1 -1
  6. package/static/chunk-164-t-LC.js +1 -0
  7. package/static/chunk-B2oijRKi.js +1 -0
  8. package/static/{chunk-CWRAmEOi.js → chunk-BMOj-ctp.js} +1 -1
  9. package/static/{chunk-Ca9rxJZS.js → chunk-B_0vwfJH.js} +1 -1
  10. package/static/chunk-Ba2Pk3ZV.js +1 -0
  11. package/static/{chunk-BJ_zTxjo.js → chunk-BgxH8sDB.js} +1 -1
  12. package/static/chunk-BiwCj5Ed.js +1 -0
  13. package/static/{chunk-CECejZs9.js → chunk-C9TOy_jn.js} +1 -1
  14. package/static/{chunk-BaL0hYvK.js → chunk-CIADdbUP.js} +1 -1
  15. package/static/{chunk-VW6e_Kls.js → chunk-CfZWJKlu.js} +1 -1
  16. package/static/chunk-Cg4mENZa.js +1 -0
  17. package/static/chunk-Cv5pNW9n.js +1 -0
  18. package/static/{chunk-BqWiMcNp.js → chunk-CxrhCycA.js} +1 -1
  19. package/static/{chunk-BvGpCrD9.js → chunk-CzSFfhcS.js} +1 -1
  20. package/static/{chunk-CbG3rfKf.js → chunk-D5kutWaL.js} +6 -6
  21. package/static/chunk-D7ecsHWV.js +1 -0
  22. package/static/{chunk-Cdhqfnmn.js → chunk-DZV_xppV.js} +1 -1
  23. package/static/{chunk-DZ8K8fY1.js → chunk-DaPHlPte.js} +1 -1
  24. package/static/{chunk-DrMwVUpq.js → chunk-DeFJOu7x.js} +1 -1
  25. package/static/{chunk-B4PXIvtd.js → chunk-DjcxfmKB.js} +1 -1
  26. package/static/{chunk-jDfyi4_G.js → chunk-DkKxPJBS.js} +1 -1
  27. package/static/{chunk-smuNKEab.js → chunk-DnSW_i5C.js} +3 -3
  28. package/static/{chunk-C5kOvUkS.js → chunk-Dnos4vY0.js} +1 -1
  29. package/static/{chunk-BnjE7sDc.js → chunk-E9Klh0DL.js} +1 -1
  30. package/static/{chunk-DS5k0b_s.js → chunk-GrrV0ukn.js} +1 -1
  31. package/static/chunk-M0pfvgRb.js +1 -0
  32. package/static/{chunk-3tEYpnqu.js → chunk-PG4bRDhM.js} +1 -1
  33. package/static/chunk-dMfVmcfD.js +1 -0
  34. package/static/index.html +1 -1
  35. package/static/{main-5C7K2447.js → main-6LDEPJ3H.js} +1 -1
  36. package/static/chunk--cAlvNjP.js +0 -1
  37. package/static/chunk-4TrlkpZx.js +0 -1
  38. package/static/chunk-99HzEG7y.js +0 -1
  39. package/static/chunk-BEPCHPAV.js +0 -1
  40. package/static/chunk-Byfh9OPw.js +0 -1
  41. package/static/chunk-C67ITweo.js +0 -1
  42. package/static/chunk-Cgq1n6kP.js +0 -1
  43. package/static/chunk-CpxvtoPc.js +0 -1
  44. package/static/chunk-DGw7ID-A.js +0 -1
  45. package/static/chunk-qdbp1qcP.js +0 -1
@@ -0,0 +1 @@
1
+ import {_ as _n,C as Cn}from'./chunk-CxrhCycA.js';import {U}from'./chunk-CfZWJKlu.js';import {W,I}from'./chunk-C9TOy_jn.js';import {d as dr,c as ca,r as rr,o as oa,s as sr,V as Vn,p as pa}from'./chunk-CIADdbUP.js';import'./chunk-B_0vwfJH.js';import'./chunk-GrrV0ukn.js';import {C,a as ar,b as at,q as qo,R as Rt,c as qe,Q as QE,F as Fn,n as n8,J as J6,k as k3,M as Mt,d as sd,z as zc,e as t7,$ as $b,V as V5,D as D5,f as ec,g as _i,v as vw,h as Rw,K as Kc,m as bD,p as gI,P as Ph,O as Ow,u as nl,A as _D,B as VD,L as LD,j as gh,N as ND,S as SD,o as oE,w as ch,x as sE,y as xD,l as lh,a5 as ah,a2 as Pw,a3 as xw,E as Pu,G as Lu}from'./main-6LDEPJ3H.js';var st=e=>({count:e}),dt=e=>["/workflows",e,"edit"],pt=(e,p)=>p.id;function ct(e,p){e&1&&(_i(0,"p",3),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function mt(e,p){if(e&1&&(_i(0,"p",4),vw(1),Kc()),e&2){let t=VD();gI(),Ph(t.loadError());}}function ft(e,p){if(e&1&&(lh(0,"nz-option",7),Rw(1,"transloco")),e&2){let t=p.$implicit,o=VD(2);ch("nzValue",t)("nzLabel",Ow(1,2,o.subjectHandlingFilterKey(t)));}}function wt(e,p){if(e&1&&(_i(0,"p",8),vw(1),Kc()),e&2){let t=VD(2);gI(),Ph(t.deleteError());}}function ut(e,p){e&1&&(_i(0,"section",9)(1,"p"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"a",11),vw(5),Rw(6,"transloco"),Kc()()),e&2&&(gI(2),Ph(Ow(3,2,"workflows.list.emptyState")),gI(3),nl(" ",Ow(6,4,"workflows.list.emptyCreateButton")," "));}function _t(e,p){if(e&1&&(_i(0,"span"),vw(1),Kc()),e&2){let t=VD().$implicit;ah("data-testid","description-"+t.id),gI(),Ph(t.description);}}function xt(e,p){if(e&1&&(_i(0,"span",13),vw(1),Rw(2,"transloco"),Kc()),e&2){let t=VD().$implicit;ah("data-testid","description-"+t.id),gI(),Ph(Ow(2,2,"workflows.list.noDescription"));}}function gt(e,p){if(e&1&&(_i(0,"nz-tag"),vw(1),Rw(2,"transloco"),Kc()),e&2){let t=p.$implicit,o=VD().$implicit,m=VD(3);ah("data-testid","applies-to-"+o.id),gI(),Ph(Ow(2,2,m.subjectTypeKey(t)));}}function Ct(e,p){if(e&1){let t=LD();_i(0,"tr")(1,"td")(2,"span"),vw(3),Kc()(),_i(4,"td",12),bD(5,_t,2,2,"span")(6,xt,3,4,"span",13),Kc(),_i(7,"td"),ND(8,gt,3,4,"nz-tag",null,SD),Kc(),_i(10,"td")(11,"nz-tag"),vw(12),Rw(13,"transloco"),Kc()(),_i(14,"td")(15,"span"),vw(16),Rw(17,"transloco"),Kc()(),_i(18,"td",14)(19,"a",15),vw(20),Rw(21,"transloco"),Kc(),_i(22,"button",16),Rw(23,"transloco"),Rw(24,"transloco"),Rw(25,"transloco"),gh("nzOnConfirm",function(){let m=Pu(t).$implicit,h=VD(3);return Lu(h.deleteWorkflow(m.id))}),vw(26),Rw(27,"transloco"),Kc()()();}if(e&2){let t=p.$implicit,o=VD(3);ah("data-testid","workflow-"+t.id),gI(2),ah("data-testid","name-"+t.id),gI(),Ph(t.name),gI(2),_D(t.description?.trim()?5:6),gI(3),xD(o.appliesToValues(t)),gI(3),ah("data-testid","subject-handling-"+t.id),gI(),Ph(Ow(13,16,o.subjectHandlingKey(t.subjectHandling))),gI(3),ah("data-testid","step-count-"+t.id),gI(),Ph(Pw(17,18,"workflows.list.stepCount",xw(31,st,t.steps.length))),gI(3),ch("routerLink",xw(33,dt,t.id)),ah("data-testid","edit-"+t.id),gI(),nl(" ",Ow(21,21,"workflows.list.edit")," "),gI(2),ch("nzPopconfirmTitle",Ow(23,23,"workflows.list.deleteConfirm"))("nzOkText",Ow(24,25,"workflows.list.delete"))("nzCancelText",Ow(25,27,"common.cancel")),ah("data-testid","delete-"+t.id),gI(4),nl(" ",Ow(27,29,"workflows.list.delete")," ");}}function kt(e,p){if(e&1&&(_i(0,"nz-table",10)(1,"thead")(2,"tr")(3,"th"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"th"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"th"),vw(10),Rw(11,"transloco"),Kc(),_i(12,"th"),vw(13),Rw(14,"transloco"),Kc(),_i(15,"th"),vw(16),Rw(17,"transloco"),Kc(),_i(18,"th"),vw(19),Rw(20,"transloco"),Kc()()(),_i(21,"tbody"),ND(22,Ct,28,35,"tr",null,pt),Kc()()),e&2){let t=VD(2);ch("nzData",t.workflows())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Ph(Ow(5,9,"workflows.list.column.name")),gI(3),Ph(Ow(8,11,"workflows.list.column.description")),gI(3),Ph(Ow(11,13,"workflow-editor.appliesTo")),gI(3),Ph(Ow(14,15,"workflow-editor.subjectHandling.label")),gI(3),Ph(Ow(17,17,"workflows.list.column.steps")),gI(3),Ph(Ow(20,19,"workflows.list.column.actions")),gI(3),xD(t.workflows());}}function bt(e,p){if(e&1){let t=LD();_i(0,"div",5)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",6),gh("ngModelChange",function(m){Pu(t);let h=VD();return Lu(h.setSubjectHandlingFilter(m))}),ND(5,ft,2,4,"nz-option",7,SD),Kc(),oE(),Kc(),bD(7,wt,2,1,"p",8),bD(8,ut,7,6,"section",9)(9,kt,24,21,"nz-table",10);}if(e&2){let t=VD();gI(2),Ph(Ow(3,4,"workflows.list.filterBySubjectHandling")),gI(2),ch("ngModel",t.subjectHandlingFilter()),sE(),gI(),xD(t.subjectHandlingOptions),gI(2),_D(t.deleteError()?7:-1),gI(),_D(t.workflows().length===0?8:9);}}var Kt=(()=>{class e{constructor(){this.workflowsApi=C(U),this.transloco=C(ar),this.destroyRef=C(at),this.workflows=qo([]),this.loading=qo(true),this.loadError=qo(null),this.deleteError=qo(null),this.subjectHandlingFilter=qo("all"),this.subjectHandlingOptions=["all","per-subject","collection"],this.load();}setSubjectHandlingFilter(t){this.subjectHandlingFilter.set(t),this.load();}appliesToValues(t){let o=t.appliesTo;return o==="none"?["none"]:Array.isArray(o)?o:[o]}subjectTypeKey(t){return `workflow-editor.subjectType.${t}`}subjectHandlingKey(t){return `workflow-editor.subjectHandling.${t}`}subjectHandlingFilterKey(t){return t==="all"?"workflows.list.filterAll":`workflow-editor.subjectHandling.${t}`}deleteWorkflow(t){this.deleteError.set(null),this.workflowsApi.delete(t).pipe(Rt(this.destroyRef)).subscribe({next:()=>{this.workflows.update(o=>o.filter(m=>m.id!==t));},error:o=>{this.deleteError.set(this.errorMessage(o,this.transloco.translate("workflows.list.deleteFailed")));}});}load(){let t=this.subjectHandlingFilter();this.loading.set(true),this.loadError.set(null),this.workflowsApi.list(t==="all"?void 0:{subjectHandling:t}).pipe(Rt(this.destroyRef)).subscribe({next:o=>{this.workflows.set(o),this.loading.set(false);},error:o=>{this.loading.set(false),this.loadError.set(this.errorMessage(o,this.transloco.translate("workflows.list.loadFailed")));}});}errorMessage(t,o){return t instanceof qe||t instanceof Error?t.message:o}static{this.\u0275fac=function(o){return new(o||e)};}static{this.\u0275cmp=QE({type:e,selectors:[["app-workflow-list"]],decls:11,vars:7,consts:[["data-testid","workflows-list",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","routerLink","/workflows/new","data-testid","create-workflow"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"field"],["data-testid","subject-handling-filter",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["data-testid","delete-error",1,"error"],["data-testid","empty-state",1,"empty"],["data-testid","workflow-items",3,"nzData","nzFrontPagination","nzShowPagination"],["nz-button","","nzType","primary","routerLink","/workflows/new","data-testid","empty-create"],[1,"description-cell"],[1,"muted"],[1,"actions"],["nz-button","","nzType","link",3,"routerLink"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(o,m){o&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"a",2),vw(6),Rw(7,"transloco"),Kc()(),bD(8,ct,3,3,"p",3)(9,mt,2,1,"p",4)(10,bt,10,6),Kc()),o&2&&(gI(3),Ph(Ow(4,3,"workflows.list.title")),gI(3),nl(" ",Ow(7,5,"workflows.list.createButton")," "),gI(2),_D(m.loading()?8:m.loadError()?9:10));},dependencies:[Fn,n8,J6,k3,Mt,sd,zc,t7,_n,Cn,$b,V5,D5,dr,ca,rr,oa,sr,Vn,pa,W,I,ec],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;max-width:16rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.muted[_ngcontent-%COMP%]{color:#a8a29e;font-style:italic}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}[_nghost-%COMP%] td.description-cell{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;text-overflow:unset;max-width:28rem;vertical-align:top}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return e})();export{Kt as WorkflowListComponent};
package/static/index.html CHANGED
@@ -10,5 +10,5 @@
10
10
  <style>body{font-family:Roboto,sans-serif}body,html{width:100%;height:100%}*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}body{margin:0;color:#000000d9;font-size:14px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-variant:tabular-nums;line-height:1.5715;background-color:#fff;font-feature-settings:"tnum"}html{--antd-wave-shadow-color:#1890ff;--scroll-bar:0}</style><link rel="stylesheet" href="styles-6MW3GE4V.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles-6MW3GE4V.css"></noscript></head>
11
11
  <body>
12
12
  <app-root></app-root>
13
- <script src="polyfills-YMBILSHJ.js" type="module"></script><script src="main-5C7K2447.js" type="module"></script></body>
13
+ <script src="polyfills-YMBILSHJ.js" type="module"></script><script src="main-6LDEPJ3H.js" type="module"></script></body>
14
14
  </html>
@@ -246,4 +246,4 @@ https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/CONTRIBUTING.md`),a||o||th
246
246
  .cdk-drag-preview * {
247
247
  pointer-events: none !important;
248
248
  }
249
- `],encapsulation:2})}return o})(),vt=(()=>{class o{_ngZone=C$3(oe$2);_document=C$3(Uo$2);_styleLoader=C$3(R1);_renderer=C$3(Dr$2).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new re;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=qo$1([]);_globalListeners;_draggingPredicate=e=>e.isDragging();_domNodesToDirectives=null;pointerMove=new re;pointerUp=new re;registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e);}registerDragItem(e){this._dragInstances.add(e),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,lt);});}removeDropContainer(e){this._dropInstances.delete(e);}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.();}startDragging(e,i){if(!(this._activeDragInstances().indexOf(e)>-1)&&(this._styleLoader.load(Mn),this._activeDragInstances.update(n=>[...n,e]),this._activeDragInstances().length===1)){let n=i.type.startsWith("touch"),r=a=>this.pointerUp.next(a),s=[["scroll",a=>this._scroll.next(a),le],["selectstart",this._preventDefaultWhileDragging,lt]];n?s.push(["touchend",r,le],["touchcancel",r,le]):s.push(["mouseup",r,le]),n||s.push(["mousemove",a=>this.pointerMove.next(a),lt]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=s.map(([a,l,d])=>this._renderer.listen(this._document,a,l,d));});}}stopDragging(e){this._activeDragInstances.update(i=>{let n=i.indexOf(e);return n>-1?(i.splice(n,1),[...i]):i}),this._activeDragInstances().length===0&&this._clearGlobalListeners();}isDragging(e){return this._activeDragInstances().indexOf(e)>-1}scrolled(e){let i=[this._scroll];return e&&e!==this._document&&i.push(new S(n=>this._ngZone.runOutsideAngular(()=>{let r=this._renderer.listen(e,"scroll",s=>{this._activeDragInstances().length&&n.next(s);},le);return ()=>{r();}}))),zg(...i)}registerDirectiveNode(e,i){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(e,i);}removeDirectiveNode(e){this._domNodesToDirectives?.delete(e);}getDragDirectiveForNode(e){return this._domNodesToDirectives?.get(e)||null}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete();}_preventDefaultWhileDragging=e=>{this._activeDragInstances().length>0&&e.preventDefault();};_persistentTouchmoveListener=e=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&e.preventDefault(),this.pointerMove.next(e));};_clearGlobalListeners(){this._globalListeners?.forEach(e=>e()),this._globalListeners=void 0;}static \u0275fac=function(i){return new(i||o)};static \u0275prov=br$2({token:o,factory:o.\u0275fac})}return o})();function Li(o){let t=o.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(o)*t}function Nn(o){let t=getComputedStyle(o),e=dt(t,"transition-property"),i=e.find(a=>a==="transform"||a==="all");if(!i)return 0;let n=e.indexOf(i),r=dt(t,"transition-duration"),s=dt(t,"transition-delay");return Li(r[n])+Li(s[n])}function dt(o,t){return o.getPropertyValue(t).split(",").map(i=>i.trim())}var An=new Set(["position"]),pt=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView=null;_preview;get element(){return this._preview}constructor(t,e,i,n,r,s,a,l,d,u){this._document=t,this._rootElement=e,this._direction=i,this._initialDomRect=n,this._previewTemplate=r,this._previewClass=s,this._pickupPositionOnPage=a,this._initialTransform=l,this._zIndex=d,this._renderer=u;}attach(t){this._preview=this._createPreview(),t.appendChild(this._preview),Fi(this._preview)&&this._preview.showPopover();}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null;}setTransform(t){this._preview.style.transform=t;}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(t){this._preview.classList.add(t);}getTransitionDuration(){return Nn(this._preview)}addEventListener(t,e){return this._renderer.listen(this._preview,t,e)}_createPreview(){let t=this._previewTemplate,e=this._previewClass,i=t?t.template:null,n;if(i&&t){let r=t.matchSize?this._initialDomRect:null,s=t.viewContainer.createEmbeddedView(i,t.context);s.detectChanges(),n=$i(s,this._document),this._previewEmbeddedView=s,t.matchSize?Ai(n,r):n.style.transform=he(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y);}else n=ct(this._rootElement),Ai(n,this._initialDomRect),this._initialTransform&&(n.style.transform=this._initialTransform);return ft(n.style,{"pointer-events":"none",margin:Fi(n)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},An),Q(n,false),n.classList.add("cdk-drag-preview"),n.setAttribute("popover","manual"),n.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(r=>n.classList.add(r)):n.classList.add(e)),n}};function Fi(o){return "showPopover"in o}var Ln={passive:true},Bi={passive:false},Fn={passive:false,capture:true},Bn=800,Vi="cdk-drag-placeholder",Hi=new Set(["position"]);function qi(o,t,e={dragStartThreshold:5,pointerDirectionChangeThreshold:5}){let i=o.get(XI,null,{optional:true})||o.get(Dr$2).createRenderer(null,null);return new ut(t,e,o.get(Uo$2),o.get(oe$2),o.get(qt),o.get(vt),i)}var ut=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview=null;_previewContainer;_placeholderRef=null;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=qo$1(false);_hasMoved=false;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new re;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement=null;_rootElementTapHighlight;_pointerMoveSubscription=H$1.EMPTY;_pointerUpSubscription=H$1.EMPTY;_scrollSubscription=H$1.EMPTY;_resizeSubscription=H$1.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=true;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set;_dropContainer;_direction="ltr";_parentDragRef=null;_cachedShadowRoot;lockAxis=null;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(t){t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions(),this._handles.forEach(e=>Q(e,t)));}_disabled=false;beforeStarted=new re;started=new re;released=new re;ended=new re;entered=new re;exited=new re;dropped=new re;moved=this._moveEvents;data;constrainPosition;constructor(t,e,i,n,r,s,a){this._config=e,this._document=i,this._ngZone=n,this._viewportRuler=r,this._dragDropRegistry=s,this._renderer=a,this.withRootElement(t).withParent(e.parentDragRef||null),this._parentPositions=new Ne(i),s.registerDragItem(this);}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(t){this._handles=t.map(i=>jt(i)),this._handles.forEach(i=>Q(i,this.disabled)),this._toggleNativeDragInteractions();let e=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&e.add(i);}),this._disabledHandles=e,this}withPreviewTemplate(t){return this._previewTemplate=t,this}withPlaceholderTemplate(t){return this._placeholderTemplate=t,this}withRootElement(t){let e=jt(t);if(e!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(e,"mousedown",this._pointerDown,Bi),i.listen(e,"touchstart",this._pointerDown,Ln),i.listen(e,"dragstart",this._nativeDragStart,Bi)]),this._initialTransform=void 0,this._rootElement=e;}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(t){return this._boundaryElement=t?jt(t):null,this._resizeSubscription.unsubscribe(),t&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(t){return this._parentDragRef=t,this}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null;}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0};}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&On(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let t=this._boundaryElement.getBoundingClientRect(),e=this._rootElement.getBoundingClientRect(),i=0,n=0;e.left<t.left?i=t.left-e.left:e.right>t.right&&(i=t.right-e.right),e.top<t.top?n=t.top-e.top:e.bottom>t.bottom&&(n=t.bottom-e.bottom);let r=this._activeTransform.x,s=this._activeTransform.y,a=r+i,l=s+n;this._rootElement.style.transform=he(a,l),this._activeTransform={x:a,y:l},this._passiveTransform={x:a,y:l};}}disableHandle(t){!this._disabledHandles.has(t)&&this._handles.indexOf(t)>-1&&(this._disabledHandles.add(t),Q(t,true));}enableHandle(t){this._disabledHandles.has(t)&&(this._disabledHandles.delete(t),Q(t,this.disabled));}withDirection(t){return this._direction=t,this}_withDropContainer(t){this._dropContainer=t;}getFreeDragPosition(){let t=this.isDragging()?this._activeTransform:this._passiveTransform;return {x:t.x,y:t.y}}setFreeDragPosition(t){return this._activeTransform={x:0,y:0},this._passiveTransform.x=t.x,this._passiveTransform.y=t.y,this._dropContainer||this._applyRootElementTransform(t.x,t.y),this}withPreviewContainer(t){return this._previewContainer=t,this}_sortFromLastPointerPosition(){let t=this._lastKnownPointerPosition;t&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(t),t);}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0;}_destroyPreview(){this._preview?.destroy(),this._preview=null;}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null;}_pointerDown=t=>{if(this.beforeStarted.next(),this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&this._initializeDragSequence(e,t);}else this.disabled||this._initializeDragSequence(this._rootElement,t);};_pointerMove=t=>{let e=this._getPointerPositionOnPage(t);if(!this._hasStartedDragging()){let n=Math.abs(e.x-this._pickupPositionOnPage.x),r=Math.abs(e.y-this._pickupPositionOnPage.y);if(n+r>=this._config.dragStartThreshold){let a=Date.now()>=this._dragStartTime+this._getDragStartDelay(t),l=this._dropContainer;if(!a){this._endDragSequence(t);return}(!l||!l.isDragging()&&!l.isReceiving())&&(t.cancelable&&t.preventDefault(),this._hasStartedDragging.set(true),this._ngZone.run(()=>this._startDragSequence(t)));}return}t.cancelable&&t.preventDefault();let i=this._getConstrainedPointerPosition(e);if(this._hasMoved=true,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,e);else {let n=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,r=this._activeTransform;r.x=i.x-n.x+this._passiveTransform.x,r.y=i.y-n.y+this._passiveTransform.y,this._applyRootElementTransform(r.x,r.y);}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:t,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta});});};_pointerUp=t=>{this._endDragSequence(t);};_endDragSequence(t){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:t}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(t),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this);});else {this._passiveTransform.x=this._activeTransform.x;let e=this._getPointerPositionOnPage(t);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:t});}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this);}}_startDragSequence(t){de(t)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let e=this._getShadowRoot(),i=this._dropContainer;if(e&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(e,"selectstart",Vn,Fn);}),i){let n=this._rootElement,r=n.parentNode,s=this._placeholder=this._createPlaceholderElement(),a=this._marker=this._marker||this._document.createComment("");r.insertBefore(a,n),this._initialTransform=n.style.transform||"",this._preview=new pt(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(r,e)),Ni(n,false,Hi),this._document.body.appendChild(r.replaceChild(s,n)),this.started.next({source:this,event:t}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this);}else this.started.next({source:this,event:t}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[]);}_initializeDragSequence(t,e){this._parentDragRef&&e.stopPropagation();let i=this.isDragging(),n=de(e),r=!n&&e.button!==0,s=this._rootElement,a=He(e),l=!n&&this._lastTouchEventTime&&this._lastTouchEventTime+Bn>Date.now(),d=n?Ui$1(e):ji$1(e);if(a&&a.draggable&&e.type==="mousedown"&&e.preventDefault(),i||r||l||d)return;if(this._handles.length){let R=s.style;this._rootElementTapHighlight=R.webkitTapHighlightColor||"",R.webkitTapHighlightColor="transparent";}this._hasMoved=false,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(R=>this._updateOnScroll(R)),this._boundaryElement&&(this._boundaryRect=_t(this._boundaryElement));let u=this._previewTemplate;this._pickupPositionInElement=u&&u.template&&!u.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,t,e);let D=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:D.x,y:D.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e);}_cleanupDragArtifacts(t){Ni(this._rootElement,true,Hi),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let e=this._dropContainer,i=e.getItemIndex(this),n=this._getPointerPositionOnPage(t),r=this._getDragDistance(n),s=e._isOverContainer(n.x,n.y);this.ended.next({source:this,distance:r,dropPoint:n,event:t}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:s,distance:r,dropPoint:n,event:t}),e.drop(this,i,this._initialIndex,this._initialContainer,s,r,n,t),this._dropContainer=this._initialContainer;});}_updateActiveDropContainer({x:t,y:e},{x:i,y:n}){let r=this._initialContainer._getSiblingContainerFromPosition(this,t,e);!r&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(t,e)&&(r=this._initialContainer),r&&r!==this._dropContainer&&this._ngZone.run(()=>{let s=this._dropContainer.getItemIndex(this),a=this._dropContainer.getItemAtIndex(s+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(r,this._dropContainer,a),this._dropContainer=r,this._dropContainer.enter(this,t,e,r===this._initialContainer&&r.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:r,currentIndex:r.getItemIndex(this)});}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,n),this._dropContainer._sortItem(this,t,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(t,e):this._applyPreviewTransform(t-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y));}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let t=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(t.left,t.top);let e=this._preview.getTransitionDuration();return e===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{let n=a=>{(!a||this._preview&&He(a)===this._preview.element&&a.propertyName==="transform")&&(s(),i(),clearTimeout(r));},r=setTimeout(n,e*1.5),s=this._preview.addEventListener("transitionend",n);}))}_createPlaceholderElement(){let t=this._placeholderTemplate,e=t?t.template:null,i;return e?(this._placeholderRef=t.viewContainer.createEmbeddedView(e,t.context),this._placeholderRef.detectChanges(),i=$i(this._placeholderRef,this._document)):i=ct(this._rootElement),i.style.pointerEvents="none",i.classList.add(Vi),i}_getPointerPositionInElement(t,e,i){let n=e===this._rootElement?null:e,r=n?n.getBoundingClientRect():t,s=de(i)?i.targetTouches[0]:i,a=this._getViewportScrollPosition(),l=s.pageX-r.left-a.left,d=s.pageY-r.top-a.top;return {x:r.left-t.left+l,y:r.top-t.top+d}}_getPointerPositionOnPage(t){let e=this._getViewportScrollPosition(),i=de(t)?t.touches[0]||t.changedTouches[0]||{pageX:0,pageY:0}:t,n=i.pageX-e.left,r=i.pageY-e.top;if(this._ownerSVGElement){let s=this._ownerSVGElement.getScreenCTM();if(s){let a=this._ownerSVGElement.createSVGPoint();return a.x=n,a.y=r,a.matrixTransform(s.inverse())}}return {x:n,y:r}}_getConstrainedPointerPosition(t){let e=this._dropContainer?this._dropContainer.lockAxis:null,{x:i,y:n}=this.constrainPosition?this.constrainPosition(t,this,this._initialDomRect,this._pickupPositionInElement):t;if(this.lockAxis==="x"||e==="x"?n=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||e==="y")&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:r,y:s}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,a=this._boundaryRect,{width:l,height:d}=this._getPreviewRect(),u=a.top+s,D=a.bottom-(d-s),R=a.left+r,Fe=a.right-(l-r);i=ji(i,R,Fe),n=ji(n,u,D);}return {x:i,y:n}}_updatePointerDirectionDelta(t){let{x:e,y:i}=t,n=this._pointerDirectionDelta,r=this._pointerPositionAtLastDirectionChange,s=Math.abs(e-r.x),a=Math.abs(i-r.y);return s>this._config.pointerDirectionChangeThreshold&&(n.x=e>r.x?1:-1,r.x=e),a>this._config.pointerDirectionChangeThreshold&&(n.y=i>r.y?1:-1,r.y=i),n}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let t=this._handles.length>0||!this.isDragging();t!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=t,Q(this._rootElement,t));}_removeRootElementListeners(){this._rootElementCleanups?.forEach(t=>t()),this._rootElementCleanups=void 0;}_applyRootElementTransform(t,e){let i=1/this.scale,n=he(t*i,e*i),r=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=r.transform&&r.transform!="none"?r.transform:""),r.transform=Ae(n,this._initialTransform);}_applyPreviewTransform(t,e){let i=this._previewTemplate?.template?void 0:this._initialTransform,n=he(t,e);this._preview.setTransform(Ae(n,i));}_getDragDistance(t){let e=this._pickupPositionOnPage;return e?{x:t.x-e.x,y:t.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear();}_containInsideBoundaryOnResize(){let{x:t,y:e}=this._passiveTransform;if(t===0&&e===0||this.isDragging()||!this._boundaryElement)return;let i=this._rootElement.getBoundingClientRect(),n=this._boundaryElement.getBoundingClientRect();if(n.width===0&&n.height===0||i.width===0&&i.height===0)return;let r=n.left-i.left,s=i.right-n.right,a=n.top-i.top,l=i.bottom-n.bottom;n.width>i.width?(r>0&&(t+=r),s>0&&(t-=s)):t=0,n.height>i.height?(a>0&&(e+=a),l>0&&(e-=l)):e=0,(t!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:t});}_getDragStartDelay(t){let e=this.dragStartDelay;return typeof e=="number"?e:de(t)?e.touch:e?e.mouse:0}_updateOnScroll(t){let e=this._parentPositions.handleScroll(t);if(e){let i=He(t);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&ce(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y));}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=D3(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(t,e){let i=this._previewContainer||"global";if(i==="parent")return t;if(i==="global"){let n=this._document;return e||n.fullscreenElement||n.webkitFullscreenElement||n.mozFullScreenElement||n.msFullscreenElement||n.body}return jt(i)}_getPreviewRect(){return (!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=t=>{if(this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&t.preventDefault();}else this.disabled||t.preventDefault();};_getTargetHandle(t){return this._handles.find(e=>t.target&&(t.target===e||e.contains(t.target)))}_conditionallyInsertAnchor(t,e,i){if(t===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(e===this._initialContainer&&e.hasAnchor){let n=this._anchor??=ct(this._placeholder);n.classList.remove(Vi),n.classList.add("cdk-drag-anchor"),n.style.transform="",i?i.before(n):jt(e.element).appendChild(n);}}};function ji(o,t,e){return Math.max(t,Math.min(e,o))}function de(o){return o.type[0]==="t"}function Vn(o){o.preventDefault();}function pe(o,t,e){let i=Gi(t,o.length-1),n=Gi(e,o.length-1);if(i===n)return;let r=o[i],s=n<i?-1:1;for(let a=i;a!==n;a+=s)o[a]=o[a+s];o[n]=r;}function Gi(o,t){return Math.max(0,Math.min(t,o))}var Le=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction="ltr";constructor(t){this._dragDropRegistry=t;}_previousSwap={drag:null,delta:0,overlaps:false};start(t){this.withItems(t);}sort(t,e,i,n){let r=this._itemPositions,s=this._getItemIndexFromPointerPosition(t,e,i,n);if(s===-1&&r.length>0)return null;let a=this.orientation==="horizontal",l=r.findIndex(y=>y.drag===t),d=r[s],u=r[l].clientRect,D=d.clientRect,R=l>s?1:-1,Fe=this._getItemOffsetPx(u,D,R),un=this._getSiblingOffsetPx(l,r,R),gn=r.slice();return pe(r,l,s),r.forEach((y,mn)=>{if(gn[mn]===y)return;let bt=y.drag===t,Be=bt?Fe:un,Ct=bt?t.getPlaceholderElement():y.drag.getRootElement();y.offset+=Be;let wt=Math.round(y.offset*(1/y.drag.scale));a?(Ct.style.transform=Ae(`translate3d(${wt}px, 0, 0)`,y.initialTransform),ce(y.clientRect,0,Be)):(Ct.style.transform=Ae(`translate3d(0, ${wt}px, 0)`,y.initialTransform),ce(y.clientRect,Be,0));}),this._previousSwap.overlaps=ht(D,e,i),this._previousSwap.drag=d.drag,this._previousSwap.delta=a?n.x:n.y,{previousIndex:l,currentIndex:s}}enter(t,e,i,n){let r=this._activeDraggables,s=r.indexOf(t),a=t.getPlaceholderElement();s>-1&&r.splice(s,1);let l=n==null||n<0?this._getItemIndexFromPointerPosition(t,e,i):n,d=r[l];if(d===t&&(d=r[l+1]),!d&&(l==null||l===-1||l<r.length-1)&&this._shouldEnterAsFirstChild(e,i)&&(d=r[0]),d&&!this._dragDropRegistry.isDragging(d)){let u=d.getRootElement();u.parentElement.insertBefore(a,u),r.splice(l,0,t);}else this._element.appendChild(a),r.push(t);a.style.transform="",this._cacheItemPositions();}withItems(t){this._activeDraggables=t.slice(),this._cacheItemPositions();}withSortPredicate(t){this._sortPredicate=t;}reset(){this._activeDraggables?.forEach(t=>{let e=t.getRootElement();if(e){let i=this._itemPositions.find(n=>n.drag===t)?.initialTransform;e.style.transform=i||"";}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=false;}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(t){return this._getVisualItemPositions().findIndex(e=>e.drag===t)}getItemAtIndex(t){return this._getVisualItemPositions()[t]?.drag||null}updateOnScroll(t,e){this._itemPositions.forEach(({clientRect:i})=>{ce(i,t,e);}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition();});}withElementContainer(t){this._element=t;}_cacheItemPositions(){let t=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(e=>{let i=e.getVisibleElement();return {drag:e,offset:0,initialTransform:i.style.transform||"",clientRect:_t(i)}}).sort((e,i)=>t?e.clientRect.left-i.clientRect.left:e.clientRect.top-i.clientRect.top);}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(t,e,i){let n=this.orientation==="horizontal",r=n?e.left-t.left:e.top-t.top;return i===-1&&(r+=n?e.width-t.width:e.height-t.height),r}_getSiblingOffsetPx(t,e,i){let n=this.orientation==="horizontal",r=e[t].clientRect,s=e[t+i*-1],a=r[n?"width":"height"]*i;if(s){let l=n?"left":"top",d=n?"right":"bottom";i===-1?a-=s.clientRect[l]-r[d]:a+=r[l]-s.clientRect[d];}return a}_shouldEnterAsFirstChild(t,e){if(!this._activeDraggables.length)return false;let i=this._itemPositions,n=this.orientation==="horizontal";if(i[0].drag!==this._activeDraggables[0]){let s=i[i.length-1].clientRect;return n?t>=s.right:e>=s.bottom}else {let s=i[0].clientRect;return n?t<=s.left:e<=s.top}}_getItemIndexFromPointerPosition(t,e,i,n){let r=this.orientation==="horizontal",s=this._itemPositions.findIndex(({drag:a,clientRect:l})=>{if(a===t)return false;if(n){let d=r?n.x:n.y;if(a===this._previousSwap.drag&&this._previousSwap.overlaps&&d===this._previousSwap.delta)return false}return r?e>=Math.floor(l.left)&&e<Math.floor(l.right):i>=Math.floor(l.top)&&i<Math.floor(l.bottom)});return s===-1||!this._sortPredicate(s,t)?-1:s}},gt=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:false};_relatedNodes=[];constructor(t,e){this._document=t,this._dragDropRegistry=e;}start(t){let e=this._element.childNodes;this._relatedNodes=[];for(let i=0;i<e.length;i++){let n=e[i];this._relatedNodes.push([n,n.nextSibling]);}this.withItems(t);}sort(t,e,i,n){let r=this._getItemIndexFromPointerPosition(t,e,i),s=this._previousSwap;if(r===-1||this._activeItems[r]===t)return null;let a=this._activeItems[r];if(s.drag===a&&s.overlaps&&s.deltaX===n.x&&s.deltaY===n.y)return null;let l=this.getItemIndex(t),d=t.getPlaceholderElement(),u=a.getRootElement();r>l?u.after(d):u.before(d),pe(this._activeItems,l,r);let D=this._getRootNode().elementFromPoint(e,i);return s.deltaX=n.x,s.deltaY=n.y,s.drag=a,s.overlaps=u===D||u.contains(D),{previousIndex:l,currentIndex:r}}enter(t,e,i,n){let r=this._activeItems.indexOf(t);r>-1&&this._activeItems.splice(r,1);let s=n==null||n<0?this._getItemIndexFromPointerPosition(t,e,i):n;s===-1&&(s=this._getClosestItemIndexToPointer(t,e,i));let a=this._activeItems[s];a&&!this._dragDropRegistry.isDragging(a)?(this._activeItems.splice(s,0,t),a.getRootElement().before(t.getPlaceholderElement())):(this._activeItems.push(t),this._element.appendChild(t.getPlaceholderElement()));}withItems(t){this._activeItems=t.slice();}withSortPredicate(t){this._sortPredicate=t;}reset(){let t=this._element,e=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){let[n,r]=this._relatedNodes[i];n.parentNode===t&&n.nextSibling!==r&&(r===null?t.appendChild(n):r.parentNode===t&&t.insertBefore(n,r));}this._relatedNodes=[],this._activeItems=[],e.drag=null,e.deltaX=e.deltaY=0,e.overlaps=false;}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(t){return this._activeItems.indexOf(t)}getItemAtIndex(t){return this._activeItems[t]||null}updateOnScroll(){this._activeItems.forEach(t=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition();});}withElementContainer(t){t!==this._element&&(this._element=t,this._rootNode=void 0);}_getItemIndexFromPointerPosition(t,e,i){let n=this._getRootNode().elementFromPoint(Math.floor(e),Math.floor(i)),r=n?this._activeItems.findIndex(s=>{let a=s.getRootElement();return n===a||a.contains(n)}):-1;return r===-1||!this._sortPredicate(r,t)?-1:r}_getRootNode(){return this._rootNode||(this._rootNode=D3(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(t,e,i){if(this._activeItems.length===0)return -1;if(this._activeItems.length===1)return 0;let n=1/0,r=-1;for(let s=0;s<this._activeItems.length;s++){let a=this._activeItems[s];if(a!==t){let{x:l,y:d}=a.getRootElement().getBoundingClientRect(),u=Math.hypot(e-l,i-d);u<n&&(n=u,r=s);}}return r}},Wi=.05,Ki=.05,E=(function(o){return o[o.NONE=0]="NONE",o[o.UP=1]="UP",o[o.DOWN=2]="DOWN",o})(E||{}),C=(function(o){return o[o.NONE=0]="NONE",o[o.LEFT=1]="LEFT",o[o.RIGHT=2]="RIGHT",o})(C||{});function Ji(o,t){return new mt(t,o.get(vt),o.get(Uo$2),o.get(oe$2),o.get(qt))}var mt=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=false;sortingDisabled=false;lockAxis=null;autoScrollDisabled=false;autoScrollStep=2;hasAnchor=false;enterPredicate=()=>true;sortPredicate=()=>true;beforeStarted=new re;entered=new re;exited=new re;dropped=new re;sorted=new re;receivingStarted=new re;receivingStopped=new re;data;_container;_isDragging=false;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=H$1.EMPTY;_verticalScrollDirection=E.NONE;_horizontalScrollDirection=C.NONE;_scrollNode;_stopScrollTimers=new re;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(t,e,i,n,r){this._dragDropRegistry=e,this._ngZone=n,this._viewportRuler=r;let s=this.element=jt(t);this._document=i,this.withOrientation("vertical").withElementContainer(s),e.registerDropContainer(this),this._parentPositions=new Ne(i);}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this);}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings();}enter(t,e,i,n){this._draggingStarted(),n==null&&this.sortingDisabled&&(n=this._draggables.indexOf(t)),this._sortStrategy.enter(t,e,i,n),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:t,container:this,currentIndex:this.getItemIndex(t)});}exit(t){this._reset(),this.exited.next({item:t,container:this});}drop(t,e,i,n,r,s,a,l){this._reset(),this.dropped.next({item:t,currentIndex:e,previousIndex:i,container:this,previousContainer:n,isPointerOverContainer:r,distance:s,dropPoint:a,event:l});}withItems(t){let e=this._draggables;return this._draggables=t,t.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(e.filter(n=>n.isDragging()).every(n=>t.indexOf(n)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(t){return this._direction=t,this._sortStrategy instanceof Le&&(this._sortStrategy.direction=t),this}connectedTo(t){return this._siblings=t.slice(),this}withOrientation(t){if(t==="mixed")this._sortStrategy=new gt(this._document,this._dragDropRegistry);else {let e=new Le(this._dragDropRegistry);e.direction=this._direction,e.orientation=t,this._sortStrategy=e;}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((e,i)=>this.sortPredicate(e,i,this)),this}withScrollableParents(t){let e=this._container;return this._scrollableElements=t.indexOf(e)===-1?[e,...t]:t.slice(),this}withElementContainer(t){if(t===this._container)return this;jt(this.element);let i=this._scrollableElements.indexOf(this._container),n=this._scrollableElements.indexOf(t);return i>-1&&this._scrollableElements.splice(i,1),n>-1&&this._scrollableElements.splice(n,1),this._sortStrategy&&this._sortStrategy.withElementContainer(t),this._cachedShadowRoot=null,this._scrollableElements.unshift(t),this._container=t,this}getScrollableParents(){return this._scrollableElements}getItemIndex(t){return this._isDragging?this._sortStrategy.getItemIndex(t):this._draggables.indexOf(t)}getItemAtIndex(t){return this._isDragging?this._sortStrategy.getItemAtIndex(t):this._draggables[t]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(t,e,i,n){if(this.sortingDisabled||!this._domRect||!Mi(this._domRect,Wi,e,i))return;let r=this._sortStrategy.sort(t,e,i,n);r&&this.sorted.next({previousIndex:r.previousIndex,currentIndex:r.currentIndex,container:this,item:t});}_startScrollingIfNecessary(t,e){if(this.autoScrollDisabled)return;let i,n=E.NONE,r=C.NONE;if(this._parentPositions.positions.forEach((s,a)=>{a===this._document||!s.clientRect||i||Mi(s.clientRect,Wi,t,e)&&([n,r]=Hn(a,s.clientRect,this._direction,t,e),(n||r)&&(i=a));}),!n&&!r){let{width:s,height:a}=this._viewportRuler.getViewportSize(),l={width:s,height:a,top:0,right:s,bottom:a,left:0};n=Yi(l,e),r=Xi(l,t),i=window;}i&&(n!==this._verticalScrollDirection||r!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=n,this._horizontalScrollDirection=r,this._scrollNode=i,(n||r)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling());}_stopScrolling(){this._stopScrollTimers.next();}_draggingStarted(){let t=this._container.style;this.beforeStarted.next(),this._isDragging=true,this._initialScrollSnap=t.msScrollSnapType||t.scrollSnapType||"",t.scrollSnapType=t.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents();}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect;}_reset(){this._isDragging=false;let t=this._container.style;t.scrollSnapType=t.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(e=>e._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear();}_startScrollInterval=()=>{this._stopScrolling(),Gg(0,Og).pipe(im(this._stopScrollTimers)).subscribe(()=>{let t=this._scrollNode,e=this.autoScrollStep;this._verticalScrollDirection===E.UP?t.scrollBy(0,-e):this._verticalScrollDirection===E.DOWN&&t.scrollBy(0,e),this._horizontalScrollDirection===C.LEFT?t.scrollBy(-e,0):this._horizontalScrollDirection===C.RIGHT&&t.scrollBy(e,0);});};_isOverContainer(t,e){return this._domRect!=null&&ht(this._domRect,t,e)}_getSiblingContainerFromPosition(t,e,i){return this._siblings.find(n=>n._canReceive(t,e,i))}_canReceive(t,e,i){if(!this._domRect||!ht(this._domRect,e,i)||!this.enterPredicate(t,this))return false;let n=this._getShadowRoot().elementFromPoint(e,i);return n?n===this._container||this._container.contains(n):false}_startReceiving(t,e){let i=this._activeSiblings;!i.has(t)&&e.every(n=>this.enterPredicate(n,this)||this._draggables.indexOf(n)>-1)&&(i.add(t),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:t,receiver:this,items:e}));}_stopReceiving(t){this._activeSiblings.delete(t),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:t,receiver:this});}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(t=>{if(this.isDragging()){let e=this._parentPositions.handleScroll(t);e&&this._sortStrategy.updateOnScroll(e.top,e.left);}else this.isReceiving()&&this._cacheParentPositions();});}_getShadowRoot(){if(!this._cachedShadowRoot){let t=D3(this._container);this._cachedShadowRoot=t||this._document;}return this._cachedShadowRoot}_notifyReceivingSiblings(){let t=this._sortStrategy.getActiveItemsSnapshot().filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,t));}};function Yi(o,t){let{top:e,bottom:i,height:n}=o,r=n*Ki;return t>=e-r&&t<=e+r?E.UP:t>=i-r&&t<=i+r?E.DOWN:E.NONE}function Xi(o,t){let{left:e,right:i,width:n}=o,r=n*Ki;return t>=e-r&&t<=e+r?C.LEFT:t>=i-r&&t<=i+r?C.RIGHT:C.NONE}function Hn(o,t,e,i,n){let r=Yi(t,n),s=Xi(t,i),a=E.NONE,l=C.NONE;if(r){let d=o.scrollTop;r===E.UP?d>0&&(a=E.UP):o.scrollHeight-d>o.clientHeight&&(a=E.DOWN);}if(s){let d=o.scrollLeft;e==="rtl"?s===C.RIGHT?d<0&&(l=C.RIGHT):o.scrollWidth+d>o.clientWidth&&(l=C.LEFT):s===C.LEFT?d>0&&(l=C.LEFT):o.scrollWidth-d>o.clientWidth&&(l=C.RIGHT);}return [a,l]}var jn=(()=>{class o{_injector=C$3(Ee$2);createDrag(e,i){return qi(this._injector,e,i)}createDropList(e){return Ji(this._injector,e)}static \u0275fac=function(i){return new(i||o)};static \u0275prov=br$2({token:o,factory:o.\u0275fac})}return o})(),Ui=new A$3("CDK_DRAG_PARENT");var Gn=new A$3("CdkDragHandle");var Qi=new A$3("CDK_DRAG_CONFIG"),en=new A$3("CdkDropList"),tn=(()=>{class o{element=C$3(_r$1);dropContainer=C$3(en,{optional:true,skipSelf:true});_ngZone=C$3(oe$2);_viewContainerRef=C$3(ji$3);_dir=C$3(Le$1,{optional:true});_changeDetectorRef=C$3(z0$1);_selfHandle=C$3(Gn,{optional:true,self:true});_parentDrag=C$3(Ui,{optional:true,skipSelf:true});_dragDropRegistry=C$3(vt);_destroyed=new re;_handles=new On$3([]);_previewTemplate=null;_placeholderTemplate=null;_dragRef;data;lockAxis=null;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled)}set disabled(e){this._disabled=e,this._dragRef.disabled=this._disabled;}_disabled=false;constrainPosition;previewClass;previewContainer;scale=1;started=new Le$3;released=new Le$3;ended=new Le$3;entered=new Le$3;exited=new Le$3;dropped=new Le$3;moved=new S(e=>{let i=this._dragRef.moved.pipe(Se$3(n=>({source:this,pointerPosition:n.pointerPosition,event:n.event,delta:n.delta,distance:n.distance}))).subscribe(e);return ()=>{i.unsubscribe();}});_injector=C$3(Ee$2);constructor(){let e=this.dropContainer,i=C$3(Qi,{optional:true});this._dragRef=qi(this._injector,this.element,{dragStartThreshold:i&&i.dragStartThreshold!=null?i.dragStartThreshold:5,pointerDirectionChangeThreshold:i&&i.pointerDirectionChangeThreshold!=null?i.pointerDirectionChangeThreshold:5,zIndex:i?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),i&&this._assignDefaults(i),e&&(e.addItem(this),e._dropListRef.beforeStarted.pipe(im(this._destroyed)).subscribe(()=>{this._dragRef.scale=this.scale;})),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef);}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset();}resetToBoundary(){this._dragRef.resetToBoundary();}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}setFreeDragPosition(e){this._dragRef.setFreeDragPosition(e);}ngAfterViewInit(){Kf(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition);},{injector:this._injector});}ngOnChanges(e){let i=e.rootElementSelector,n=e.freeDragPosition;i&&!i.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,n&&!n.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition);}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this),this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement),this._ngZone.runOutsideAngular(()=>{this._handles.complete(),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose();});}_addHandle(e){let i=this._handles.getValue();i.push(e),this._handles.next(i);}_removeHandle(e){let i=this._handles.getValue(),n=i.indexOf(e);n>-1&&(i.splice(n,1),this._handles.next(i));}_setPreviewTemplate(e){this._previewTemplate=e;}_resetPreviewTemplate(e){e===this._previewTemplate&&(this._previewTemplate=null);}_setPlaceholderTemplate(e){this._placeholderTemplate=e;}_resetPlaceholderTemplate(e){e===this._placeholderTemplate&&(this._placeholderTemplate=null);}_updateRootElement(){let e=this.element.nativeElement,i=e;this.rootElementSelector&&(i=e.closest!==void 0?e.closest(this.rootElementSelector):e.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(i||e);}_getBoundaryElement(){let e=this.boundaryElement;return e?typeof e=="string"?this.element.nativeElement.closest(e):jt(e):null}_syncInputs(e){e.beforeStarted.subscribe(()=>{if(!e.isDragging()){let i=this._dir,n=this.dragStartDelay,r=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,s=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.scale=this.scale,e.dragStartDelay=typeof n=="object"&&n?n:xt$1(n),e.constrainPosition=this.constrainPosition,e.previewClass=this.previewClass,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(r).withPreviewTemplate(s).withPreviewContainer(this.previewContainer||"global"),i&&e.withDirection(i.value);}}),e.beforeStarted.pipe(yt$2(1)).subscribe(()=>{if(this._parentDrag){e.withParent(this._parentDrag._dragRef);return}let i=this.element.nativeElement.parentElement;for(;i;){let n=this._dragDropRegistry.getDragDirectiveForNode(i);if(n){e.withParent(n._dragRef);break}i=i.parentElement;}});}_handleEvents(e){e.started.subscribe(i=>{this.started.emit({source:this,event:i.event}),this._changeDetectorRef.markForCheck();}),e.released.subscribe(i=>{this.released.emit({source:this,event:i.event});}),e.ended.subscribe(i=>{this.ended.emit({source:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck();}),e.entered.subscribe(i=>{this.entered.emit({container:i.container.data,item:this,currentIndex:i.currentIndex});}),e.exited.subscribe(i=>{this.exited.emit({container:i.container.data,item:this});}),e.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,isPointerOverContainer:i.isPointerOverContainer,item:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event});});}_assignDefaults(e){let{lockAxis:i,dragStartDelay:n,constrainPosition:r,previewClass:s,boundaryElement:a,draggingDisabled:l,rootElementSelector:d,previewContainer:u}=e;this.disabled=l??false,this.dragStartDelay=n||0,this.lockAxis=i||null,r&&(this.constrainPosition=r),s&&(this.previewClass=s),a&&(this.boundaryElement=a),d&&(this.rootElementSelector=d),u&&(this.previewContainer=u);}_setupHandlesListener(){this._handles.pipe(zl$1(e=>{let i=e.map(n=>n.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i);}),Gl$1(e=>zg(...e.map(i=>i._stateChanges.pipe(Wl$1(i))))),im(this._destroyed)).subscribe(e=>{let i=this._dragRef,n=e.element.nativeElement;e.disabled?i.disableHandle(n):i.enableHandle(n);});}static \u0275fac=function(i){return new(i||o)};static \u0275dir=XE({type:o,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(i,n){i&2&&Mh("cdk-drag-disabled",n.disabled)("cdk-drag-dragging",n._dragRef.isDragging());},inputs:{data:[0,"cdkDragData","data"],lockAxis:[0,"cdkDragLockAxis","lockAxis"],rootElementSelector:[0,"cdkDragRootElement","rootElementSelector"],boundaryElement:[0,"cdkDragBoundary","boundaryElement"],dragStartDelay:[0,"cdkDragStartDelay","dragStartDelay"],freeDragPosition:[0,"cdkDragFreeDragPosition","freeDragPosition"],disabled:[2,"cdkDragDisabled","disabled",Z0$1],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",Y0$1]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[Sw([{provide:Ui,useExisting:o}]),ly]})}return o})(),Zi=new A$3("CdkDropListGroup");var nn=(()=>{class o{element=C$3(_r$1);_changeDetectorRef=C$3(z0$1);_scrollDispatcher=C$3(U1);_dir=C$3(Le$1,{optional:true});_group=C$3(Zi,{optional:true,skipSelf:true});_latestSortedRefs;_destroyed=new re;_scrollableParentsResolved=false;static _dropLists=[];_dropListRef;connectedTo=[];data;orientation="vertical";id=C$3(K4).getId("cdk-drop-list-");lockAxis=null;get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(e){this._dropListRef.disabled=this._disabled=e;}_disabled=false;sortingDisabled=false;enterPredicate=()=>true;sortPredicate=()=>true;autoScrollDisabled=false;autoScrollStep;elementContainerSelector=null;hasAnchor=false;dropped=new Le$3;entered=new Le$3;exited=new Le$3;sorted=new Le$3;_unsortedItems=new Set;constructor(){let e=C$3(Qi,{optional:true}),i=C$3(Ee$2);this._dropListRef=Ji(i,this.element),this._dropListRef.data=this,e&&this._assignDefaults(e),this._dropListRef.enterPredicate=(n,r)=>this.enterPredicate(n.data,r.data),this._dropListRef.sortPredicate=(n,r,s)=>this.sortPredicate(n,r.data,s.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),o._dropLists.push(this),this._group&&this._group._items.add(this);}addItem(e){this._unsortedItems.add(e),e._dragRef._withDropContainer(this._dropListRef),this._dropListRef.isDragging()&&this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef));}removeItem(e){if(this._unsortedItems.delete(e),this._latestSortedRefs){let i=this._latestSortedRefs.indexOf(e._dragRef);i>-1&&(this._latestSortedRefs.splice(i,1),this._syncItemsWithRef(this._latestSortedRefs));}}getSortedItems(){return Array.from(this._unsortedItems).sort((e,i)=>e._dragRef.getVisibleElement().compareDocumentPosition(i._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){let e=o._dropLists.indexOf(this);e>-1&&o._dropLists.splice(e,1),this._group&&this._group._items.delete(this),this._latestSortedRefs=void 0,this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete();}_setupInputSyncSubscription(e){this._dir&&this._dir.change.pipe(Wl$1(this._dir.value),im(this._destroyed)).subscribe(i=>e.withDirection(i)),e.beforeStarted.subscribe(()=>{let i=u1(this.connectedTo).map(n=>{if(typeof n=="string"){let r=o._dropLists.find(s=>s.id===n);return r}return n});if(this._group&&this._group._items.forEach(n=>{i.indexOf(n)===-1&&i.push(n);}),!this._scrollableParentsResolved){let n=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(r=>r.getElementRef().nativeElement);this._dropListRef.withScrollableParents(n),this._scrollableParentsResolved=true;}if(this.elementContainerSelector){let n=this.element.nativeElement.querySelector(this.elementContainerSelector);e.withElementContainer(n);}e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.sortingDisabled=this.sortingDisabled,e.autoScrollDisabled=this.autoScrollDisabled,e.autoScrollStep=xt$1(this.autoScrollStep,2),e.hasAnchor=this.hasAnchor,e.connectedTo(i.filter(n=>n&&n!==this).map(n=>n._dropListRef)).withOrientation(this.orientation);});}_handleEvents(e){e.beforeStarted.subscribe(()=>{this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef)),this._changeDetectorRef.markForCheck();}),e.entered.subscribe(i=>{this.entered.emit({container:this,item:i.item.data,currentIndex:i.currentIndex});}),e.exited.subscribe(i=>{this.exited.emit({container:this,item:i.item.data}),this._changeDetectorRef.markForCheck();}),e.sorted.subscribe(i=>{this.sorted.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,container:this,item:i.item.data});}),e.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,item:i.item.data,isPointerOverContainer:i.isPointerOverContainer,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck();}),zg(e.receivingStarted,e.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck());}_assignDefaults(e){let{lockAxis:i,draggingDisabled:n,sortingDisabled:r,listAutoScrollDisabled:s,listOrientation:a}=e;this.disabled=n??false,this.sortingDisabled=r??false,this.autoScrollDisabled=s??false,this.orientation=a||"vertical",this.lockAxis=i||null;}_syncItemsWithRef(e){this._latestSortedRefs=e,this._dropListRef.withItems(e);}static \u0275fac=function(i){return new(i||o)};static \u0275dir=XE({type:o,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(i,n){i&2&&(ah("id",n.id),Mh("cdk-drop-list-disabled",n.disabled)("cdk-drop-list-dragging",n._dropListRef.isDragging())("cdk-drop-list-receiving",n._dropListRef.isReceiving()));},inputs:{connectedTo:[0,"cdkDropListConnectedTo","connectedTo"],data:[0,"cdkDropListData","data"],orientation:[0,"cdkDropListOrientation","orientation"],id:"id",lockAxis:[0,"cdkDropListLockAxis","lockAxis"],disabled:[2,"cdkDropListDisabled","disabled",Z0$1],sortingDisabled:[2,"cdkDropListSortingDisabled","sortingDisabled",Z0$1],enterPredicate:[0,"cdkDropListEnterPredicate","enterPredicate"],sortPredicate:[0,"cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:[2,"cdkDropListAutoScrollDisabled","autoScrollDisabled",Z0$1],autoScrollStep:[0,"cdkDropListAutoScrollStep","autoScrollStep"],elementContainerSelector:[0,"cdkDropListElementContainer","elementContainerSelector"],hasAnchor:[2,"cdkDropListHasAnchor","hasAnchor",Z0$1]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[Sw([{provide:Zi,useValue:void 0},{provide:en,useExisting:o}])]})}return o})();var on=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=YE({type:o});static \u0275inj=uu({providers:[jn],imports:[tn$1]})}return o})();var $n=o=>["/views",o],qn=(o,t)=>t.subjectType,rn=(o,t)=>t.id;function Kn(o,t){o&1&&(_i$3(0,"section",3)(1,"h2"),vw(2),Rw(3,"transloco"),Kc$1(),_i$3(4,"p"),vw(5),Rw(6,"transloco"),Kc$1(),_i$3(7,"a",4),vw(8),Rw(9,"transloco"),Kc$1()()),o&2&&(gI(2),Ph(Ow(3,3,"shell.empty.title")),gI(3),Ph(Ow(6,5,"shell.empty.body")),gI(3),nl$1(" ",Ow(9,7,"shell.empty.settingsLink")," "));}function Jn(o,t){if(o&1&&(_i$3(0,"p",5),vw(1),Kc$1()),o&2){let e=VD(2);gI(),Ph(e.reorderError());}}function Yn(o,t){if(o&1&&(_i$3(0,"li",10)(1,"a",11),vw(2),Kc$1()()),o&2){let e=t.$implicit;ah("data-testid","sidebar-view-"+e.id),gI(),ch("routerLink",xw(4,$n,e.id)),ah("data-testid","sidebar-link-"+e.id),gI(),nl$1(" ",e.name," ");}}function Xn(o,t){if(o&1){let e=LD();_i$3(0,"section",6)(1,"h2",8),vw(2),Rw(3,"transloco"),Kc$1(),_i$3(4,"ul",9),gh("cdkDropListDropped",function(n){let r=Pu(e).$implicit,s=VD(2);return Lu(s.drop(r,n))}),ND(5,Yn,3,6,"li",10,rn),Kc$1()();}if(o&2){let e=t.$implicit,i=VD(2);ah("data-testid","sidebar-group-"+e.subjectType),gI(2),Ph(Ow(3,5,e.labelKey)),gI(2),ch("cdkDropListData",e.views)("cdkDropListDisabled",i.reordering()),ah("data-testid","sidebar-drop-"+e.subjectType),gI(),xD(e.views);}}function Qn(o,t){if(o&1&&(_i$3(0,"li",10)(1,"a",13),vw(2),Kc$1()()),o&2){let e=t.$implicit;ah("data-testid","sidebar-shortcut-"+e.id),gI(),ah("data-testid","sidebar-shortcut-link-"+e.id),gI(),nl$1(" ",e.name," ");}}function eo(o,t){if(o&1){let e=LD();_i$3(0,"section",7)(1,"h2",8),vw(2),Rw(3,"transloco"),Kc$1(),_i$3(4,"ul",12),gh("cdkDropListDropped",function(n){Pu(e);let r=VD(2);return Lu(r.dropShortcut(n))}),ND(5,Qn,3,3,"li",10,rn),Kc$1()();}if(o&2){let e=VD(2);gI(2),Ph(Ow(3,3,"shell.shortcuts")),gI(2),ch("cdkDropListData",e.shortcuts())("cdkDropListDisabled",e.reordering()),gI(),xD(e.shortcuts());}}function to(o,t){if(o&1&&(bD(0,Jn,2,1,"p",5),ND(1,Xn,7,7,"section",6,qn),bD(3,eo,7,5,"section",7)),o&2){let e=VD();_D(e.reorderError()?0:-1),gI(),xD(e.groups()),gI(2),_D(e.shortcuts().length>0?3:-1);}}var sn=(()=>{class o{constructor(){this.viewsApi=C$3(U$1),this.shortcutsApi=C$3(u),this.destroyRef=C$3(at$3),this.groups=$0$1.required(),this.shortcuts=$0$1([]),this.empty=$0$1(false),this.viewsChanged=B0$1(),this.shortcutsChanged=B0$1(),this.reorderError=qo$1(null),this.reordering=qo$1(false);}drop(e,i){if(i.previousIndex===i.currentIndex)return;let n=[...e.views];pe(n,i.previousIndex,i.currentIndex),this.reorderError.set(null),this.reordering.set(true),this.viewsApi.reorder(n.map(r=>r.id)).pipe(Rt$2(this.destroyRef)).subscribe({next:()=>{this.reordering.set(false),this.viewsChanged.emit();},error:r=>{this.reordering.set(false),this.reorderError.set(r instanceof Error?r.message:"Failed to reorder views");}});}dropShortcut(e){if(e.previousIndex===e.currentIndex)return;let i=[...this.shortcuts()];pe(i,e.previousIndex,e.currentIndex),this.reorderError.set(null),this.reordering.set(true),this.shortcutsApi.reorder(i.map(n=>n.id)).pipe(Rt$2(this.destroyRef)).subscribe({next:()=>{this.reordering.set(false),this.shortcutsChanged.emit();},error:n=>{this.reordering.set(false),this.reorderError.set(n instanceof Error?n.message:"Failed to reorder shortcuts");}});}static{this.\u0275fac=function(i){return new(i||o)};}static{this.\u0275cmp=QE({type:o,selectors:[["app-sidebar"]],inputs:{groups:[1,"groups"],shortcuts:[1,"shortcuts"],empty:[1,"empty"]},outputs:{viewsChanged:"viewsChanged",shortcutsChanged:"shortcutsChanged"},decls:6,vars:1,consts:[["data-testid","app-sidebar",1,"sidebar"],["data-testid","app-brand",1,"brand"],[1,"sidebar-body"],["data-testid","sidebar-empty",1,"empty"],["nz-button","","nzType","primary","routerLink","/settings","data-testid","sidebar-empty-settings"],["data-testid","sidebar-reorder-error",1,"error"],[1,"group"],["data-testid","sidebar-group-shortcuts",1,"group"],[1,"group-title"],["cdkDropList","",1,"view-list",3,"cdkDropListDropped","cdkDropListData","cdkDropListDisabled"],["cdkDrag","",1,"view-item"],["routerLinkActive","active",3,"routerLink"],["cdkDropList","","data-testid","sidebar-drop-shortcuts",1,"view-list",3,"cdkDropListDropped","cdkDropListData","cdkDropListDisabled"],["routerLink","/shortcuts","routerLinkActive","active"]],template:function(i,n){i&1&&(_i$3(0,"aside",0)(1,"div",1),vw(2,"knoflows"),Kc$1(),_i$3(3,"div",2),bD(4,Kn,10,9,"section",3)(5,to,4,2),Kc$1()()),i&2&&(gI(4),_D(n.empty()?4:5));},dependencies:[Fn$3,on,nn,tn,Mt$1,wo$1,sd,zc,t7,ec$1],styles:[".sidebar[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:15rem;height:100vh;flex-shrink:0;border-right:1px solid #d6d3d1;background:#ffffffb8;overflow:hidden}.brand[_ngcontent-%COMP%]{flex-shrink:0;padding:.85rem 1rem;font-size:1.1rem;font-weight:700;letter-spacing:.02em;border-bottom:1px solid #d6d3d1}.sidebar-body[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;padding:1rem .75rem 1.5rem}.group[_ngcontent-%COMP%] + .group[_ngcontent-%COMP%]{margin-top:1.25rem}.group-title[_ngcontent-%COMP%]{margin:0 0 .5rem;padding:0 .35rem;font-size:.75rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#78716c}.view-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0}.view-item[_ngcontent-%COMP%]{margin:.15rem 0;border-radius:.35rem;cursor:grab}.view-item.cdk-drag-disabled[_ngcontent-%COMP%]{cursor:default}.view-item[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{display:block;padding:.45rem .5rem;color:#44403c;text-decoration:none;border-radius:.35rem}.view-item[_ngcontent-%COMP%] a.active[_ngcontent-%COMP%], .view-item[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{background:#f5f5f4;color:#0c0a09}.view-item[_ngcontent-%COMP%] a.active[_ngcontent-%COMP%]{font-weight:600}.empty[_ngcontent-%COMP%]{padding:.5rem .35rem}.empty[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e;font-size:.92rem;line-height:1.45}.error[_ngcontent-%COMP%]{margin:0 0 .75rem;padding:0 .35rem;color:#9f1239;font-size:.85rem}.cdk-drag-preview[_ngcontent-%COMP%]{box-shadow:0 4px 12px #0000001f;background:#fff;border-radius:.35rem}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}"]});}}return o})();var io=()=>({status:"waiting_for_human"});function no(o,t){if(o&1){let e=LD();_i$3(0,"div",2)(1,"app-sidebar",3),gh("viewsChanged",function(){Pu(e);let n=VD();return Lu(n.reloadViews())})("shortcutsChanged",function(){Pu(e);let n=VD();return Lu(n.reloadShortcuts())}),Kc$1(),_i$3(2,"div",4)(3,"header",5)(4,"div",6)(5,"a",7)(6,"nz-badge",8)(7,"span"),vw(8),Rw(9,"transloco"),Kc$1()()(),_i$3(10,"button",9),vw(11),Rw(12,"transloco"),Kc$1(),_i$3(13,"nz-dropdown-menu",null,0)(15,"ul",10)(16,"li",11)(17,"a",12),vw(18),Rw(19,"transloco"),Kc$1()(),_i$3(20,"li",13)(21,"a",14),vw(22),Rw(23,"transloco"),Kc$1()(),_i$3(24,"li",15)(25,"a",16),vw(26),Rw(27,"transloco"),Kc$1()()()(),_i$3(28,"a",17),vw(29),Rw(30,"transloco"),Kc$1(),_i$3(31,"label",18)(32,"span"),vw(33),Kc$1(),_i$3(34,"nz-select",19),gh("ngModelChange",function(n){Pu(e);let r=VD();return Lu(r.onLanguageChange(n))}),lh(35,"nz-option",20)(36,"nz-option",21),Kc$1(),oE(),Kc$1()()(),_i$3(37,"main",22),lh(38,"router-outlet"),Kc$1()()();}if(o&2){let e=t.$implicit,i=zD(14),n=VD();gI(),ch("groups",n.groups())("shortcuts",n.shortcuts())("empty",n.sidebarEmpty()),gI(4),ch("queryParams",Nw(27,io)),gI(),ch("nzCount",n.waitingJobsCount())("nzShowZero",false),gI(2),Ph(Ow(9,15,"shell.jobsWaiting")),gI(2),ch("nzDropdownMenu",i),gI(),nl$1(" ",Ow(12,17,"shell.manage")," "),gI(7),Ph(Ow(19,19,"nav.workflows")),gI(4),Ph(Ow(23,21,"nav.views")),gI(4),Ph(Ow(27,23,"nav.shortcuts")),gI(3),nl$1(" ",Ow(30,25,"nav.settings")," "),gI(4),Ph(e("nav.language")),gI(),ch("ngModel",n.language.currentLang()),sE();}}var oo=3e4,ro=500,an=(()=>{class o{constructor(){this.viewsApi=C$3(U$1),this.shortcutsApi=C$3(u),this.settingsApi=C$3(l),this.jobsApi=C$3(U),this.destroyRef=C$3(at$3),this.language=C$3(O),this.views=qo$1([]),this.shortcuts=qo$1([]),this.settings=qo$1(null),this.waitingJobsCount=qo$1(0),this.groups=Hw(()=>Ti(this.views(),this.settings())),this.sidebarEmpty=Hw(()=>this.views().length===0&&this.shortcuts().length===0),this.loadViews(),this.loadShortcuts(),this.loadSettings(),this.pollWaitingJobs();}onLanguageChange(e){this.language.setLanguage(e);}reloadViews(){this.loadViews();}reloadShortcuts(){this.loadShortcuts();}loadViews(){this.viewsApi.list().pipe(Rt$2(this.destroyRef)).subscribe({next:e=>this.views.set(e),error:()=>this.views.set([])});}loadShortcuts(){this.shortcutsApi.list().pipe(Rt$2(this.destroyRef)).subscribe({next:e=>this.shortcuts.set(e),error:()=>this.shortcuts.set([])});}loadSettings(){this.settingsApi.getSettings().pipe(Rt$2(this.destroyRef)).subscribe({next:e=>this.settings.set(e),error:()=>this.settings.set(null)});}pollWaitingJobs(){Gg(oo).pipe(Wl$1(0),Gl$1(()=>this.jobsApi.list({status:"waiting_for_human",topLevelOnly:false,limit:ro,offset:0})),Rt$2(this.destroyRef)).subscribe({next:e=>this.waitingJobsCount.set(e.length),error:()=>this.waitingJobsCount.set(0)});}static{this.\u0275fac=function(i){return new(i||o)};}static{this.\u0275cmp=QE({type:o,selectors:[["app-shell"]],decls:1,vars:0,consts:[["manageMenu","nzDropdownMenu"],["class","app-shell",4,"transloco"],[1,"app-shell"],[3,"viewsChanged","shortcutsChanged","groups","shortcuts","empty"],[1,"main"],["data-testid","app-top-bar",1,"top-bar"],[1,"top-actions"],["routerLink","/jobs","data-testid","jobs-waiting-badge",1,"jobs-badge",3,"queryParams"],[3,"nzCount","nzShowZero"],["nz-button","","nzType","default","nz-dropdown","","data-testid","manage-menu",3,"nzDropdownMenu"],["nz-menu",""],["nz-menu-item","","data-testid","manage-workflows"],["routerLink","/workflows"],["nz-menu-item","","data-testid","manage-views"],["routerLink","/views"],["nz-menu-item","","data-testid","manage-shortcuts"],["routerLink","/shortcuts"],["nz-button","","nzType","default","routerLink","/settings","routerLinkActive","active","data-testid","settings-link"],["data-testid","language-switcher",1,"lang"],["data-testid","language-select",2,"min-width","5.5rem",3,"ngModelChange","ngModel"],["nzValue","en","nzLabel","en"],["nzValue","es","nzLabel","es"],[1,"content"]],template:function(i,n){i&1&&nh(0,no,39,28,"div",1);},dependencies:[Fn$3,n8,J6,k3,cr$1,Mt$1,wo$1,Qu,Ri,at,sd,zc,t7,y7,Ci,xt,Rn$1,vi,bi,$n$1,$b,V5,D5,sn,ec$1],styles:[".app-shell[_ngcontent-%COMP%]{display:flex;min-height:100vh;background:linear-gradient(180deg,#fafaf9,#f5f5f4);color:#1c1917}.main[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column}.top-bar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:1rem;padding:.75rem 1.25rem;border-bottom:1px solid #d6d3d1;background:#ffffffd9}.top-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.65rem}.jobs-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:.35rem .5rem;color:#44403c;text-decoration:none;border-radius:.35rem}.jobs-badge[_ngcontent-%COMP%]:hover{background:#f5f5f4}.lang[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.9rem;color:#57534e}.content[_ngcontent-%COMP%]{flex:1;min-height:0}[_nghost-%COMP%] .top-actions a.active{font-weight:600}"]});}}return o})();var ln=(()=>{class o{static{this.\u0275fac=function(i){return new(i||o)};}static{this.\u0275cmp=QE({type:o,selectors:[["app-root"]],decls:1,vars:0,template:function(i,n){i&1&&lh(0,"app-shell");},dependencies:[an],encapsulation:2});}}return o})();var so="@",ao=(()=>{class o{doc;delegate;zone;animationType;moduleImpl;_rendererFactoryPromise=null;scheduler=null;injector=C$3(Ee$2);loadingSchedulerFn=C$3(lo,{optional:true});_engine;constructor(e,i,n,r,s){this.doc=e,this.delegate=i,this.zone=n,this.animationType=r,this.moduleImpl=s;}ngOnDestroy(){this._engine?.flush();}loadImpl(){let e=()=>this.moduleImpl??import('./chunk-3tEYpnqu.js').then(n=>n),i;return this.loadingSchedulerFn?i=this.loadingSchedulerFn(e):i=e(),i.catch(n=>{throw new _$3(5300,false)}).then(({\u0275createEngine:n,\u0275AnimationRendererFactory:r})=>{this._engine=n(this.animationType,this.doc);let s=new r(this.delegate,this._engine,this.zone);return this.delegate=s,s})}createRenderer(e,i){let n=this.delegate.createRenderer(e,i);if(n.\u0275type===0)return n;typeof n.throwOnSyntheticProps=="boolean"&&(n.throwOnSyntheticProps=false);let r=new Dt(n);return i?.data?.animation&&!this._rendererFactoryPromise&&(this._rendererFactoryPromise=this.loadImpl()),this._rendererFactoryPromise?.then(s=>{let a=s.createRenderer(e,i);r.use(a),this.scheduler??=this.injector.get(He$3,null,{optional:true}),this.scheduler?.notify(10);}).catch(s=>{r.use(n);}),r}begin(){this.delegate.begin?.();}end(){this.delegate.end?.();}whenRenderingDone(){return this.delegate.whenRenderingDone?.()??Promise.resolve()}componentReplaced(e){this._engine?.flush(),this.delegate.componentReplaced?.(e);}static \u0275fac=function(i){fE();};static \u0275prov=ie$1({token:o,factory:o.\u0275fac})}return o})(),Dt=class{delegate;replay=[];\u0275type=1;constructor(t){this.delegate=t;}use(t){if(this.delegate=t,this.replay!==null){for(let e of this.replay)e(t);this.replay=null;}}get data(){return this.delegate.data}destroy(){this.replay=null,this.delegate.destroy();}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}get destroyNode(){return this.delegate.destroyNode}appendChild(t,e){this.delegate.appendChild(t,e);}insertBefore(t,e,i,n){this.delegate.insertBefore(t,e,i,n);}removeChild(t,e,i,n){this.delegate.removeChild(t,e,i,n);}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,i,n){this.delegate.setAttribute(t,e,i,n);}removeAttribute(t,e,i){this.delegate.removeAttribute(t,e,i);}addClass(t,e){this.delegate.addClass(t,e);}removeClass(t,e){this.delegate.removeClass(t,e);}setStyle(t,e,i,n){this.delegate.setStyle(t,e,i,n);}removeStyle(t,e,i){this.delegate.removeStyle(t,e,i);}setProperty(t,e,i){this.shouldReplay(e)&&this.replay.push(n=>n.setProperty(t,e,i)),this.delegate.setProperty(t,e,i);}setValue(t,e){this.delegate.setValue(t,e);}listen(t,e,i,n){return this.shouldReplay(e)&&this.replay.push(r=>r.listen(t,e,i,n)),this.delegate.listen(t,e,i,n)}shouldReplay(t){return this.replay!==null&&t.startsWith(so)}},lo=new A$3("");function dn(o="animations"){return ce$2("NgAsyncAnimations"),Eu([{provide:Dr$2,useFactory:()=>new ao(C$3(Uo$2),C$3(St$2),C$3(oe$2),o)},{provide:Gm,useValue:o==="noop"?"NoopAnimations":"BrowserAnimations"}])}var cn=(()=>{class o{constructor(){this.http=C$3(Kn$3);}getTranslation(e){return this.http.get(`./assets/i18n/${e}.json`)}static{this.\u0275fac=function(i){return new(i||o)};}static{this.\u0275prov=ie$1({token:o,factory:o.\u0275fac,providedIn:"root"});}}return o})();var hn=[{path:"",pathMatch:"full",redirectTo:"jobs"},{path:"jobs",pathMatch:"full",loadComponent:()=>import('./chunk-CWRAmEOi.js').then(o=>o.JobListComponent)},{path:"jobs/new",loadComponent:()=>import('./chunk-DGw7ID-A.js').then(o=>o.JobRunnerComponent)},{path:"jobs/:id",loadComponent:()=>import('./chunk-BvGpCrD9.js').then(o=>o.JobDetailComponent)},{path:"batches/:id",loadComponent:()=>import('./chunk-DrMwVUpq.js').then(o=>o.BatchDetailComponent)},{path:"workflows",loadComponent:()=>import('./chunk-Byfh9OPw.js').then(o=>o.WorkflowListComponent)},{path:"workflows/new",loadComponent:()=>import('./chunk-Cdhqfnmn.js').then(o=>o.WorkflowEditorComponent)},{path:"workflows/:id/edit",loadComponent:()=>import('./chunk-Cdhqfnmn.js').then(o=>o.WorkflowEditorComponent)},{path:"views",loadComponent:()=>import('./chunk-CpxvtoPc.js').then(o=>o.ViewListComponent)},{path:"views/new",loadComponent:()=>import('./chunk-smuNKEab.js').then(o=>o.ViewEditorComponent)},{path:"views/:id/edit",loadComponent:()=>import('./chunk-smuNKEab.js').then(o=>o.ViewEditorComponent)},{path:"views/:id",loadComponent:()=>import('./chunk-BEPCHPAV.js').then(o=>o.ViewDetailComponent)},{path:"shortcuts",loadComponent:()=>import('./chunk-C67ITweo.js').then(o=>o.ShortcutListComponent)},{path:"shortcuts/new",loadComponent:()=>import('./chunk-Cgq1n6kP.js').then(o=>o.ShortcutEditorComponent)},{path:"shortcuts/:id/edit",loadComponent:()=>import('./chunk-Cgq1n6kP.js').then(o=>o.ShortcutEditorComponent)},{path:"settings",loadComponent:()=>import('./chunk-qdbp1qcP.js').then(o=>o.SettingsComponent)}];var pn={providers:[Ao$1(hn),di$2(),dn(),jy(Il),Dy(),tc$1({config:{availableLangs:["en","es"],defaultLang:"en",fallbackLang:"en",reRenderOnLangChange:true,prodMode:true},loader:cn})]};jr$1(ln,pn).catch(o=>console.error(o));export{$b as $,_D as A,VD as B,C$3 as C,D5 as D,Pu as E,Fn$3 as F,Lu as G,Hw as H,ue as I,J6 as J,Kc$1 as K,LD as L,Mt$1 as M,ND as N,Ow as O,Ph as P,QE as Q,Rt$2 as R,SD as S,Lh as T,U,V5 as V,W$1 as W,rd as X,Bw as Y,y7 as Z,_$3 as _,ar$2 as a,Le$3 as a$,$0$1 as a0,B0$1 as a1,Pw as a2,xw as a3,Mh as a4,ah as a5,Nw as a6,MD as a7,sc$1 as a8,Ng as a9,Kf as aA,f9 as aB,pt$2 as aC,Se$1 as aD,va as aE,vr$1 as aF,BD as aG,nh as aH,Lw as aI,Sw as aJ,h1 as aK,B1 as aL,wo$2 as aM,rD as aN,R4 as aO,cw as aP,Dh as aQ,GD as aR,Eh as aS,U0$1 as aT,zD as aU,Vh as aV,jh as aW,$D as aX,ww as aY,U$1 as aZ,XI as a_,rs$1 as aa,Dg as ab,O as ac,Zn$2 as ad,Se$3 as ae,S4 as af,$6 as ag,YE as ah,uu as ai,Y0$1 as aj,Z0$1 as ak,N1 as al,q0$1 as am,_r$1 as an,Ee$2 as ao,a3 as ap,Le$1 as aq,ga as ar,j3 as as,m1 as at,za as au,Uw as av,W0$1 as aw,D8 as ax,u9 as ay,a9 as az,at$3 as b,Ln$3 as b$,N7 as b0,B7 as b1,ly as b2,_h as b3,fr as b4,pr as b5,l as b6,Kn$3 as b7,lc$1 as b8,Xa$1 as b9,s0 as bA,Sy as bB,oi$2 as bC,ri$3 as bD,Bh as bE,sw as bF,ji$3 as bG,kt as bH,Wm as bI,jo$1 as bJ,Kg as bK,Yg as bL,kg as bM,kr$2 as bN,xy as bO,z0$1 as bP,r2 as bQ,a2 as bR,_e as bS,Ou as bT,vn$1 as bU,He as bV,Er$2 as bW,el$1 as bX,tl$1 as bY,i9 as bZ,wn$1 as b_,u as ba,pT as bb,hT as bc,XE as bd,eh as be,re as bf,Uo$2 as bg,k8 as bh,em as bi,on$3 as bj,Ul$1 as bk,fn$1 as bl,f1 as bm,gn as bn,Xa as bo,Ts as bp,Vs as bq,t4 as br,Tt as bs,Ie as bt,Wy as bu,Uy as bv,Ih as bw,qD as bx,WD as by,ut$1 as bz,qe as c,Cw as c$,On$3 as c0,Vt as c1,Fg as c2,d9 as c3,vh as c4,Wl$1 as c5,Gl$1 as c6,mt$5 as c7,zg as c8,Ie$1 as c9,ph as cA,Jc$1 as cB,uh as cC,Xc$1 as cD,A$3 as cE,w0 as cF,mh as cG,P1 as cH,l9 as cI,rh as cJ,Gm as cK,ec$2 as cL,bt as cM,gi$2 as cN,pn$1 as cO,Ga as cP,Vc as cQ,K1 as cR,s9 as cS,G5 as cT,p3 as cU,zl$1 as cV,$5 as cW,R0 as cX,tr as cY,Tw as cZ,vv as c_,Ri$1 as ca,xn$2 as cb,Sr$1 as cc,c9 as cd,Aw as ce,oe$2 as cf,St as cg,J as ch,rn$1 as ci,on$1 as cj,nn$1 as ck,an$1 as cl,W1 as cm,o9 as cn,Ci as co,xt as cp,Rn$1 as cq,bi as cr,vi as cs,jt as ct,S as cu,jl$1 as cv,om as cw,Yc$1 as cx,TD as cy,fh as cz,sd as d,u$1 as d0,v$1 as d1,ms as d2,Dr$2 as d3,Qg as d4,t7 as e,ec$1 as f,_i$3 as g,Rw as h,ie$1 as i,gh as j,k3 as k,lh as l,bD as m,n8 as n,oE as o,gI as p,qo$1 as q,r,s,t,nl$1 as u,vw as v,ch as w,sE as x,xD as y,zc as z};
249
+ `],encapsulation:2})}return o})(),vt=(()=>{class o{_ngZone=C$3(oe$2);_document=C$3(Uo$2);_styleLoader=C$3(R1);_renderer=C$3(Dr$2).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new re;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=qo$1([]);_globalListeners;_draggingPredicate=e=>e.isDragging();_domNodesToDirectives=null;pointerMove=new re;pointerUp=new re;registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e);}registerDragItem(e){this._dragInstances.add(e),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,lt);});}removeDropContainer(e){this._dropInstances.delete(e);}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.();}startDragging(e,i){if(!(this._activeDragInstances().indexOf(e)>-1)&&(this._styleLoader.load(Mn),this._activeDragInstances.update(n=>[...n,e]),this._activeDragInstances().length===1)){let n=i.type.startsWith("touch"),r=a=>this.pointerUp.next(a),s=[["scroll",a=>this._scroll.next(a),le],["selectstart",this._preventDefaultWhileDragging,lt]];n?s.push(["touchend",r,le],["touchcancel",r,le]):s.push(["mouseup",r,le]),n||s.push(["mousemove",a=>this.pointerMove.next(a),lt]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=s.map(([a,l,d])=>this._renderer.listen(this._document,a,l,d));});}}stopDragging(e){this._activeDragInstances.update(i=>{let n=i.indexOf(e);return n>-1?(i.splice(n,1),[...i]):i}),this._activeDragInstances().length===0&&this._clearGlobalListeners();}isDragging(e){return this._activeDragInstances().indexOf(e)>-1}scrolled(e){let i=[this._scroll];return e&&e!==this._document&&i.push(new S(n=>this._ngZone.runOutsideAngular(()=>{let r=this._renderer.listen(e,"scroll",s=>{this._activeDragInstances().length&&n.next(s);},le);return ()=>{r();}}))),zg(...i)}registerDirectiveNode(e,i){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(e,i);}removeDirectiveNode(e){this._domNodesToDirectives?.delete(e);}getDragDirectiveForNode(e){return this._domNodesToDirectives?.get(e)||null}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete();}_preventDefaultWhileDragging=e=>{this._activeDragInstances().length>0&&e.preventDefault();};_persistentTouchmoveListener=e=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&e.preventDefault(),this.pointerMove.next(e));};_clearGlobalListeners(){this._globalListeners?.forEach(e=>e()),this._globalListeners=void 0;}static \u0275fac=function(i){return new(i||o)};static \u0275prov=br$2({token:o,factory:o.\u0275fac})}return o})();function Li(o){let t=o.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(o)*t}function Nn(o){let t=getComputedStyle(o),e=dt(t,"transition-property"),i=e.find(a=>a==="transform"||a==="all");if(!i)return 0;let n=e.indexOf(i),r=dt(t,"transition-duration"),s=dt(t,"transition-delay");return Li(r[n])+Li(s[n])}function dt(o,t){return o.getPropertyValue(t).split(",").map(i=>i.trim())}var An=new Set(["position"]),pt=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView=null;_preview;get element(){return this._preview}constructor(t,e,i,n,r,s,a,l,d,u){this._document=t,this._rootElement=e,this._direction=i,this._initialDomRect=n,this._previewTemplate=r,this._previewClass=s,this._pickupPositionOnPage=a,this._initialTransform=l,this._zIndex=d,this._renderer=u;}attach(t){this._preview=this._createPreview(),t.appendChild(this._preview),Fi(this._preview)&&this._preview.showPopover();}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null;}setTransform(t){this._preview.style.transform=t;}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(t){this._preview.classList.add(t);}getTransitionDuration(){return Nn(this._preview)}addEventListener(t,e){return this._renderer.listen(this._preview,t,e)}_createPreview(){let t=this._previewTemplate,e=this._previewClass,i=t?t.template:null,n;if(i&&t){let r=t.matchSize?this._initialDomRect:null,s=t.viewContainer.createEmbeddedView(i,t.context);s.detectChanges(),n=$i(s,this._document),this._previewEmbeddedView=s,t.matchSize?Ai(n,r):n.style.transform=he(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y);}else n=ct(this._rootElement),Ai(n,this._initialDomRect),this._initialTransform&&(n.style.transform=this._initialTransform);return ft(n.style,{"pointer-events":"none",margin:Fi(n)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},An),Q(n,false),n.classList.add("cdk-drag-preview"),n.setAttribute("popover","manual"),n.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(r=>n.classList.add(r)):n.classList.add(e)),n}};function Fi(o){return "showPopover"in o}var Ln={passive:true},Bi={passive:false},Fn={passive:false,capture:true},Bn=800,Vi="cdk-drag-placeholder",Hi=new Set(["position"]);function qi(o,t,e={dragStartThreshold:5,pointerDirectionChangeThreshold:5}){let i=o.get(XI,null,{optional:true})||o.get(Dr$2).createRenderer(null,null);return new ut(t,e,o.get(Uo$2),o.get(oe$2),o.get(qt),o.get(vt),i)}var ut=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview=null;_previewContainer;_placeholderRef=null;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=qo$1(false);_hasMoved=false;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new re;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement=null;_rootElementTapHighlight;_pointerMoveSubscription=H$1.EMPTY;_pointerUpSubscription=H$1.EMPTY;_scrollSubscription=H$1.EMPTY;_resizeSubscription=H$1.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=true;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set;_dropContainer;_direction="ltr";_parentDragRef=null;_cachedShadowRoot;lockAxis=null;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(t){t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions(),this._handles.forEach(e=>Q(e,t)));}_disabled=false;beforeStarted=new re;started=new re;released=new re;ended=new re;entered=new re;exited=new re;dropped=new re;moved=this._moveEvents;data;constrainPosition;constructor(t,e,i,n,r,s,a){this._config=e,this._document=i,this._ngZone=n,this._viewportRuler=r,this._dragDropRegistry=s,this._renderer=a,this.withRootElement(t).withParent(e.parentDragRef||null),this._parentPositions=new Ne(i),s.registerDragItem(this);}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(t){this._handles=t.map(i=>jt(i)),this._handles.forEach(i=>Q(i,this.disabled)),this._toggleNativeDragInteractions();let e=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&e.add(i);}),this._disabledHandles=e,this}withPreviewTemplate(t){return this._previewTemplate=t,this}withPlaceholderTemplate(t){return this._placeholderTemplate=t,this}withRootElement(t){let e=jt(t);if(e!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(e,"mousedown",this._pointerDown,Bi),i.listen(e,"touchstart",this._pointerDown,Ln),i.listen(e,"dragstart",this._nativeDragStart,Bi)]),this._initialTransform=void 0,this._rootElement=e;}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(t){return this._boundaryElement=t?jt(t):null,this._resizeSubscription.unsubscribe(),t&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(t){return this._parentDragRef=t,this}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null;}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0};}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&On(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let t=this._boundaryElement.getBoundingClientRect(),e=this._rootElement.getBoundingClientRect(),i=0,n=0;e.left<t.left?i=t.left-e.left:e.right>t.right&&(i=t.right-e.right),e.top<t.top?n=t.top-e.top:e.bottom>t.bottom&&(n=t.bottom-e.bottom);let r=this._activeTransform.x,s=this._activeTransform.y,a=r+i,l=s+n;this._rootElement.style.transform=he(a,l),this._activeTransform={x:a,y:l},this._passiveTransform={x:a,y:l};}}disableHandle(t){!this._disabledHandles.has(t)&&this._handles.indexOf(t)>-1&&(this._disabledHandles.add(t),Q(t,true));}enableHandle(t){this._disabledHandles.has(t)&&(this._disabledHandles.delete(t),Q(t,this.disabled));}withDirection(t){return this._direction=t,this}_withDropContainer(t){this._dropContainer=t;}getFreeDragPosition(){let t=this.isDragging()?this._activeTransform:this._passiveTransform;return {x:t.x,y:t.y}}setFreeDragPosition(t){return this._activeTransform={x:0,y:0},this._passiveTransform.x=t.x,this._passiveTransform.y=t.y,this._dropContainer||this._applyRootElementTransform(t.x,t.y),this}withPreviewContainer(t){return this._previewContainer=t,this}_sortFromLastPointerPosition(){let t=this._lastKnownPointerPosition;t&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(t),t);}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0;}_destroyPreview(){this._preview?.destroy(),this._preview=null;}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null;}_pointerDown=t=>{if(this.beforeStarted.next(),this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&this._initializeDragSequence(e,t);}else this.disabled||this._initializeDragSequence(this._rootElement,t);};_pointerMove=t=>{let e=this._getPointerPositionOnPage(t);if(!this._hasStartedDragging()){let n=Math.abs(e.x-this._pickupPositionOnPage.x),r=Math.abs(e.y-this._pickupPositionOnPage.y);if(n+r>=this._config.dragStartThreshold){let a=Date.now()>=this._dragStartTime+this._getDragStartDelay(t),l=this._dropContainer;if(!a){this._endDragSequence(t);return}(!l||!l.isDragging()&&!l.isReceiving())&&(t.cancelable&&t.preventDefault(),this._hasStartedDragging.set(true),this._ngZone.run(()=>this._startDragSequence(t)));}return}t.cancelable&&t.preventDefault();let i=this._getConstrainedPointerPosition(e);if(this._hasMoved=true,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,e);else {let n=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,r=this._activeTransform;r.x=i.x-n.x+this._passiveTransform.x,r.y=i.y-n.y+this._passiveTransform.y,this._applyRootElementTransform(r.x,r.y);}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:t,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta});});};_pointerUp=t=>{this._endDragSequence(t);};_endDragSequence(t){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:t}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(t),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this);});else {this._passiveTransform.x=this._activeTransform.x;let e=this._getPointerPositionOnPage(t);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:t});}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this);}}_startDragSequence(t){de(t)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let e=this._getShadowRoot(),i=this._dropContainer;if(e&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(e,"selectstart",Vn,Fn);}),i){let n=this._rootElement,r=n.parentNode,s=this._placeholder=this._createPlaceholderElement(),a=this._marker=this._marker||this._document.createComment("");r.insertBefore(a,n),this._initialTransform=n.style.transform||"",this._preview=new pt(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(r,e)),Ni(n,false,Hi),this._document.body.appendChild(r.replaceChild(s,n)),this.started.next({source:this,event:t}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this);}else this.started.next({source:this,event:t}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[]);}_initializeDragSequence(t,e){this._parentDragRef&&e.stopPropagation();let i=this.isDragging(),n=de(e),r=!n&&e.button!==0,s=this._rootElement,a=He(e),l=!n&&this._lastTouchEventTime&&this._lastTouchEventTime+Bn>Date.now(),d=n?Ui$1(e):ji$1(e);if(a&&a.draggable&&e.type==="mousedown"&&e.preventDefault(),i||r||l||d)return;if(this._handles.length){let R=s.style;this._rootElementTapHighlight=R.webkitTapHighlightColor||"",R.webkitTapHighlightColor="transparent";}this._hasMoved=false,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(R=>this._updateOnScroll(R)),this._boundaryElement&&(this._boundaryRect=_t(this._boundaryElement));let u=this._previewTemplate;this._pickupPositionInElement=u&&u.template&&!u.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,t,e);let D=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:D.x,y:D.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e);}_cleanupDragArtifacts(t){Ni(this._rootElement,true,Hi),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let e=this._dropContainer,i=e.getItemIndex(this),n=this._getPointerPositionOnPage(t),r=this._getDragDistance(n),s=e._isOverContainer(n.x,n.y);this.ended.next({source:this,distance:r,dropPoint:n,event:t}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:s,distance:r,dropPoint:n,event:t}),e.drop(this,i,this._initialIndex,this._initialContainer,s,r,n,t),this._dropContainer=this._initialContainer;});}_updateActiveDropContainer({x:t,y:e},{x:i,y:n}){let r=this._initialContainer._getSiblingContainerFromPosition(this,t,e);!r&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(t,e)&&(r=this._initialContainer),r&&r!==this._dropContainer&&this._ngZone.run(()=>{let s=this._dropContainer.getItemIndex(this),a=this._dropContainer.getItemAtIndex(s+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(r,this._dropContainer,a),this._dropContainer=r,this._dropContainer.enter(this,t,e,r===this._initialContainer&&r.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:r,currentIndex:r.getItemIndex(this)});}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,n),this._dropContainer._sortItem(this,t,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(t,e):this._applyPreviewTransform(t-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y));}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let t=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(t.left,t.top);let e=this._preview.getTransitionDuration();return e===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{let n=a=>{(!a||this._preview&&He(a)===this._preview.element&&a.propertyName==="transform")&&(s(),i(),clearTimeout(r));},r=setTimeout(n,e*1.5),s=this._preview.addEventListener("transitionend",n);}))}_createPlaceholderElement(){let t=this._placeholderTemplate,e=t?t.template:null,i;return e?(this._placeholderRef=t.viewContainer.createEmbeddedView(e,t.context),this._placeholderRef.detectChanges(),i=$i(this._placeholderRef,this._document)):i=ct(this._rootElement),i.style.pointerEvents="none",i.classList.add(Vi),i}_getPointerPositionInElement(t,e,i){let n=e===this._rootElement?null:e,r=n?n.getBoundingClientRect():t,s=de(i)?i.targetTouches[0]:i,a=this._getViewportScrollPosition(),l=s.pageX-r.left-a.left,d=s.pageY-r.top-a.top;return {x:r.left-t.left+l,y:r.top-t.top+d}}_getPointerPositionOnPage(t){let e=this._getViewportScrollPosition(),i=de(t)?t.touches[0]||t.changedTouches[0]||{pageX:0,pageY:0}:t,n=i.pageX-e.left,r=i.pageY-e.top;if(this._ownerSVGElement){let s=this._ownerSVGElement.getScreenCTM();if(s){let a=this._ownerSVGElement.createSVGPoint();return a.x=n,a.y=r,a.matrixTransform(s.inverse())}}return {x:n,y:r}}_getConstrainedPointerPosition(t){let e=this._dropContainer?this._dropContainer.lockAxis:null,{x:i,y:n}=this.constrainPosition?this.constrainPosition(t,this,this._initialDomRect,this._pickupPositionInElement):t;if(this.lockAxis==="x"||e==="x"?n=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||e==="y")&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:r,y:s}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,a=this._boundaryRect,{width:l,height:d}=this._getPreviewRect(),u=a.top+s,D=a.bottom-(d-s),R=a.left+r,Fe=a.right-(l-r);i=ji(i,R,Fe),n=ji(n,u,D);}return {x:i,y:n}}_updatePointerDirectionDelta(t){let{x:e,y:i}=t,n=this._pointerDirectionDelta,r=this._pointerPositionAtLastDirectionChange,s=Math.abs(e-r.x),a=Math.abs(i-r.y);return s>this._config.pointerDirectionChangeThreshold&&(n.x=e>r.x?1:-1,r.x=e),a>this._config.pointerDirectionChangeThreshold&&(n.y=i>r.y?1:-1,r.y=i),n}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let t=this._handles.length>0||!this.isDragging();t!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=t,Q(this._rootElement,t));}_removeRootElementListeners(){this._rootElementCleanups?.forEach(t=>t()),this._rootElementCleanups=void 0;}_applyRootElementTransform(t,e){let i=1/this.scale,n=he(t*i,e*i),r=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=r.transform&&r.transform!="none"?r.transform:""),r.transform=Ae(n,this._initialTransform);}_applyPreviewTransform(t,e){let i=this._previewTemplate?.template?void 0:this._initialTransform,n=he(t,e);this._preview.setTransform(Ae(n,i));}_getDragDistance(t){let e=this._pickupPositionOnPage;return e?{x:t.x-e.x,y:t.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear();}_containInsideBoundaryOnResize(){let{x:t,y:e}=this._passiveTransform;if(t===0&&e===0||this.isDragging()||!this._boundaryElement)return;let i=this._rootElement.getBoundingClientRect(),n=this._boundaryElement.getBoundingClientRect();if(n.width===0&&n.height===0||i.width===0&&i.height===0)return;let r=n.left-i.left,s=i.right-n.right,a=n.top-i.top,l=i.bottom-n.bottom;n.width>i.width?(r>0&&(t+=r),s>0&&(t-=s)):t=0,n.height>i.height?(a>0&&(e+=a),l>0&&(e-=l)):e=0,(t!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:t});}_getDragStartDelay(t){let e=this.dragStartDelay;return typeof e=="number"?e:de(t)?e.touch:e?e.mouse:0}_updateOnScroll(t){let e=this._parentPositions.handleScroll(t);if(e){let i=He(t);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&ce(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y));}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=D3(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(t,e){let i=this._previewContainer||"global";if(i==="parent")return t;if(i==="global"){let n=this._document;return e||n.fullscreenElement||n.webkitFullscreenElement||n.mozFullScreenElement||n.msFullscreenElement||n.body}return jt(i)}_getPreviewRect(){return (!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=t=>{if(this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&t.preventDefault();}else this.disabled||t.preventDefault();};_getTargetHandle(t){return this._handles.find(e=>t.target&&(t.target===e||e.contains(t.target)))}_conditionallyInsertAnchor(t,e,i){if(t===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(e===this._initialContainer&&e.hasAnchor){let n=this._anchor??=ct(this._placeholder);n.classList.remove(Vi),n.classList.add("cdk-drag-anchor"),n.style.transform="",i?i.before(n):jt(e.element).appendChild(n);}}};function ji(o,t,e){return Math.max(t,Math.min(e,o))}function de(o){return o.type[0]==="t"}function Vn(o){o.preventDefault();}function pe(o,t,e){let i=Gi(t,o.length-1),n=Gi(e,o.length-1);if(i===n)return;let r=o[i],s=n<i?-1:1;for(let a=i;a!==n;a+=s)o[a]=o[a+s];o[n]=r;}function Gi(o,t){return Math.max(0,Math.min(t,o))}var Le=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction="ltr";constructor(t){this._dragDropRegistry=t;}_previousSwap={drag:null,delta:0,overlaps:false};start(t){this.withItems(t);}sort(t,e,i,n){let r=this._itemPositions,s=this._getItemIndexFromPointerPosition(t,e,i,n);if(s===-1&&r.length>0)return null;let a=this.orientation==="horizontal",l=r.findIndex(y=>y.drag===t),d=r[s],u=r[l].clientRect,D=d.clientRect,R=l>s?1:-1,Fe=this._getItemOffsetPx(u,D,R),un=this._getSiblingOffsetPx(l,r,R),gn=r.slice();return pe(r,l,s),r.forEach((y,mn)=>{if(gn[mn]===y)return;let bt=y.drag===t,Be=bt?Fe:un,Ct=bt?t.getPlaceholderElement():y.drag.getRootElement();y.offset+=Be;let wt=Math.round(y.offset*(1/y.drag.scale));a?(Ct.style.transform=Ae(`translate3d(${wt}px, 0, 0)`,y.initialTransform),ce(y.clientRect,0,Be)):(Ct.style.transform=Ae(`translate3d(0, ${wt}px, 0)`,y.initialTransform),ce(y.clientRect,Be,0));}),this._previousSwap.overlaps=ht(D,e,i),this._previousSwap.drag=d.drag,this._previousSwap.delta=a?n.x:n.y,{previousIndex:l,currentIndex:s}}enter(t,e,i,n){let r=this._activeDraggables,s=r.indexOf(t),a=t.getPlaceholderElement();s>-1&&r.splice(s,1);let l=n==null||n<0?this._getItemIndexFromPointerPosition(t,e,i):n,d=r[l];if(d===t&&(d=r[l+1]),!d&&(l==null||l===-1||l<r.length-1)&&this._shouldEnterAsFirstChild(e,i)&&(d=r[0]),d&&!this._dragDropRegistry.isDragging(d)){let u=d.getRootElement();u.parentElement.insertBefore(a,u),r.splice(l,0,t);}else this._element.appendChild(a),r.push(t);a.style.transform="",this._cacheItemPositions();}withItems(t){this._activeDraggables=t.slice(),this._cacheItemPositions();}withSortPredicate(t){this._sortPredicate=t;}reset(){this._activeDraggables?.forEach(t=>{let e=t.getRootElement();if(e){let i=this._itemPositions.find(n=>n.drag===t)?.initialTransform;e.style.transform=i||"";}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=false;}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(t){return this._getVisualItemPositions().findIndex(e=>e.drag===t)}getItemAtIndex(t){return this._getVisualItemPositions()[t]?.drag||null}updateOnScroll(t,e){this._itemPositions.forEach(({clientRect:i})=>{ce(i,t,e);}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition();});}withElementContainer(t){this._element=t;}_cacheItemPositions(){let t=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(e=>{let i=e.getVisibleElement();return {drag:e,offset:0,initialTransform:i.style.transform||"",clientRect:_t(i)}}).sort((e,i)=>t?e.clientRect.left-i.clientRect.left:e.clientRect.top-i.clientRect.top);}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(t,e,i){let n=this.orientation==="horizontal",r=n?e.left-t.left:e.top-t.top;return i===-1&&(r+=n?e.width-t.width:e.height-t.height),r}_getSiblingOffsetPx(t,e,i){let n=this.orientation==="horizontal",r=e[t].clientRect,s=e[t+i*-1],a=r[n?"width":"height"]*i;if(s){let l=n?"left":"top",d=n?"right":"bottom";i===-1?a-=s.clientRect[l]-r[d]:a+=r[l]-s.clientRect[d];}return a}_shouldEnterAsFirstChild(t,e){if(!this._activeDraggables.length)return false;let i=this._itemPositions,n=this.orientation==="horizontal";if(i[0].drag!==this._activeDraggables[0]){let s=i[i.length-1].clientRect;return n?t>=s.right:e>=s.bottom}else {let s=i[0].clientRect;return n?t<=s.left:e<=s.top}}_getItemIndexFromPointerPosition(t,e,i,n){let r=this.orientation==="horizontal",s=this._itemPositions.findIndex(({drag:a,clientRect:l})=>{if(a===t)return false;if(n){let d=r?n.x:n.y;if(a===this._previousSwap.drag&&this._previousSwap.overlaps&&d===this._previousSwap.delta)return false}return r?e>=Math.floor(l.left)&&e<Math.floor(l.right):i>=Math.floor(l.top)&&i<Math.floor(l.bottom)});return s===-1||!this._sortPredicate(s,t)?-1:s}},gt=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:false};_relatedNodes=[];constructor(t,e){this._document=t,this._dragDropRegistry=e;}start(t){let e=this._element.childNodes;this._relatedNodes=[];for(let i=0;i<e.length;i++){let n=e[i];this._relatedNodes.push([n,n.nextSibling]);}this.withItems(t);}sort(t,e,i,n){let r=this._getItemIndexFromPointerPosition(t,e,i),s=this._previousSwap;if(r===-1||this._activeItems[r]===t)return null;let a=this._activeItems[r];if(s.drag===a&&s.overlaps&&s.deltaX===n.x&&s.deltaY===n.y)return null;let l=this.getItemIndex(t),d=t.getPlaceholderElement(),u=a.getRootElement();r>l?u.after(d):u.before(d),pe(this._activeItems,l,r);let D=this._getRootNode().elementFromPoint(e,i);return s.deltaX=n.x,s.deltaY=n.y,s.drag=a,s.overlaps=u===D||u.contains(D),{previousIndex:l,currentIndex:r}}enter(t,e,i,n){let r=this._activeItems.indexOf(t);r>-1&&this._activeItems.splice(r,1);let s=n==null||n<0?this._getItemIndexFromPointerPosition(t,e,i):n;s===-1&&(s=this._getClosestItemIndexToPointer(t,e,i));let a=this._activeItems[s];a&&!this._dragDropRegistry.isDragging(a)?(this._activeItems.splice(s,0,t),a.getRootElement().before(t.getPlaceholderElement())):(this._activeItems.push(t),this._element.appendChild(t.getPlaceholderElement()));}withItems(t){this._activeItems=t.slice();}withSortPredicate(t){this._sortPredicate=t;}reset(){let t=this._element,e=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){let[n,r]=this._relatedNodes[i];n.parentNode===t&&n.nextSibling!==r&&(r===null?t.appendChild(n):r.parentNode===t&&t.insertBefore(n,r));}this._relatedNodes=[],this._activeItems=[],e.drag=null,e.deltaX=e.deltaY=0,e.overlaps=false;}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(t){return this._activeItems.indexOf(t)}getItemAtIndex(t){return this._activeItems[t]||null}updateOnScroll(){this._activeItems.forEach(t=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition();});}withElementContainer(t){t!==this._element&&(this._element=t,this._rootNode=void 0);}_getItemIndexFromPointerPosition(t,e,i){let n=this._getRootNode().elementFromPoint(Math.floor(e),Math.floor(i)),r=n?this._activeItems.findIndex(s=>{let a=s.getRootElement();return n===a||a.contains(n)}):-1;return r===-1||!this._sortPredicate(r,t)?-1:r}_getRootNode(){return this._rootNode||(this._rootNode=D3(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(t,e,i){if(this._activeItems.length===0)return -1;if(this._activeItems.length===1)return 0;let n=1/0,r=-1;for(let s=0;s<this._activeItems.length;s++){let a=this._activeItems[s];if(a!==t){let{x:l,y:d}=a.getRootElement().getBoundingClientRect(),u=Math.hypot(e-l,i-d);u<n&&(n=u,r=s);}}return r}},Wi=.05,Ki=.05,E=(function(o){return o[o.NONE=0]="NONE",o[o.UP=1]="UP",o[o.DOWN=2]="DOWN",o})(E||{}),C=(function(o){return o[o.NONE=0]="NONE",o[o.LEFT=1]="LEFT",o[o.RIGHT=2]="RIGHT",o})(C||{});function Ji(o,t){return new mt(t,o.get(vt),o.get(Uo$2),o.get(oe$2),o.get(qt))}var mt=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=false;sortingDisabled=false;lockAxis=null;autoScrollDisabled=false;autoScrollStep=2;hasAnchor=false;enterPredicate=()=>true;sortPredicate=()=>true;beforeStarted=new re;entered=new re;exited=new re;dropped=new re;sorted=new re;receivingStarted=new re;receivingStopped=new re;data;_container;_isDragging=false;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=H$1.EMPTY;_verticalScrollDirection=E.NONE;_horizontalScrollDirection=C.NONE;_scrollNode;_stopScrollTimers=new re;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(t,e,i,n,r){this._dragDropRegistry=e,this._ngZone=n,this._viewportRuler=r;let s=this.element=jt(t);this._document=i,this.withOrientation("vertical").withElementContainer(s),e.registerDropContainer(this),this._parentPositions=new Ne(i);}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this);}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings();}enter(t,e,i,n){this._draggingStarted(),n==null&&this.sortingDisabled&&(n=this._draggables.indexOf(t)),this._sortStrategy.enter(t,e,i,n),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:t,container:this,currentIndex:this.getItemIndex(t)});}exit(t){this._reset(),this.exited.next({item:t,container:this});}drop(t,e,i,n,r,s,a,l){this._reset(),this.dropped.next({item:t,currentIndex:e,previousIndex:i,container:this,previousContainer:n,isPointerOverContainer:r,distance:s,dropPoint:a,event:l});}withItems(t){let e=this._draggables;return this._draggables=t,t.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(e.filter(n=>n.isDragging()).every(n=>t.indexOf(n)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(t){return this._direction=t,this._sortStrategy instanceof Le&&(this._sortStrategy.direction=t),this}connectedTo(t){return this._siblings=t.slice(),this}withOrientation(t){if(t==="mixed")this._sortStrategy=new gt(this._document,this._dragDropRegistry);else {let e=new Le(this._dragDropRegistry);e.direction=this._direction,e.orientation=t,this._sortStrategy=e;}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((e,i)=>this.sortPredicate(e,i,this)),this}withScrollableParents(t){let e=this._container;return this._scrollableElements=t.indexOf(e)===-1?[e,...t]:t.slice(),this}withElementContainer(t){if(t===this._container)return this;jt(this.element);let i=this._scrollableElements.indexOf(this._container),n=this._scrollableElements.indexOf(t);return i>-1&&this._scrollableElements.splice(i,1),n>-1&&this._scrollableElements.splice(n,1),this._sortStrategy&&this._sortStrategy.withElementContainer(t),this._cachedShadowRoot=null,this._scrollableElements.unshift(t),this._container=t,this}getScrollableParents(){return this._scrollableElements}getItemIndex(t){return this._isDragging?this._sortStrategy.getItemIndex(t):this._draggables.indexOf(t)}getItemAtIndex(t){return this._isDragging?this._sortStrategy.getItemAtIndex(t):this._draggables[t]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(t,e,i,n){if(this.sortingDisabled||!this._domRect||!Mi(this._domRect,Wi,e,i))return;let r=this._sortStrategy.sort(t,e,i,n);r&&this.sorted.next({previousIndex:r.previousIndex,currentIndex:r.currentIndex,container:this,item:t});}_startScrollingIfNecessary(t,e){if(this.autoScrollDisabled)return;let i,n=E.NONE,r=C.NONE;if(this._parentPositions.positions.forEach((s,a)=>{a===this._document||!s.clientRect||i||Mi(s.clientRect,Wi,t,e)&&([n,r]=Hn(a,s.clientRect,this._direction,t,e),(n||r)&&(i=a));}),!n&&!r){let{width:s,height:a}=this._viewportRuler.getViewportSize(),l={width:s,height:a,top:0,right:s,bottom:a,left:0};n=Yi(l,e),r=Xi(l,t),i=window;}i&&(n!==this._verticalScrollDirection||r!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=n,this._horizontalScrollDirection=r,this._scrollNode=i,(n||r)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling());}_stopScrolling(){this._stopScrollTimers.next();}_draggingStarted(){let t=this._container.style;this.beforeStarted.next(),this._isDragging=true,this._initialScrollSnap=t.msScrollSnapType||t.scrollSnapType||"",t.scrollSnapType=t.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents();}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect;}_reset(){this._isDragging=false;let t=this._container.style;t.scrollSnapType=t.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(e=>e._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear();}_startScrollInterval=()=>{this._stopScrolling(),Gg(0,Og).pipe(im(this._stopScrollTimers)).subscribe(()=>{let t=this._scrollNode,e=this.autoScrollStep;this._verticalScrollDirection===E.UP?t.scrollBy(0,-e):this._verticalScrollDirection===E.DOWN&&t.scrollBy(0,e),this._horizontalScrollDirection===C.LEFT?t.scrollBy(-e,0):this._horizontalScrollDirection===C.RIGHT&&t.scrollBy(e,0);});};_isOverContainer(t,e){return this._domRect!=null&&ht(this._domRect,t,e)}_getSiblingContainerFromPosition(t,e,i){return this._siblings.find(n=>n._canReceive(t,e,i))}_canReceive(t,e,i){if(!this._domRect||!ht(this._domRect,e,i)||!this.enterPredicate(t,this))return false;let n=this._getShadowRoot().elementFromPoint(e,i);return n?n===this._container||this._container.contains(n):false}_startReceiving(t,e){let i=this._activeSiblings;!i.has(t)&&e.every(n=>this.enterPredicate(n,this)||this._draggables.indexOf(n)>-1)&&(i.add(t),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:t,receiver:this,items:e}));}_stopReceiving(t){this._activeSiblings.delete(t),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:t,receiver:this});}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(t=>{if(this.isDragging()){let e=this._parentPositions.handleScroll(t);e&&this._sortStrategy.updateOnScroll(e.top,e.left);}else this.isReceiving()&&this._cacheParentPositions();});}_getShadowRoot(){if(!this._cachedShadowRoot){let t=D3(this._container);this._cachedShadowRoot=t||this._document;}return this._cachedShadowRoot}_notifyReceivingSiblings(){let t=this._sortStrategy.getActiveItemsSnapshot().filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,t));}};function Yi(o,t){let{top:e,bottom:i,height:n}=o,r=n*Ki;return t>=e-r&&t<=e+r?E.UP:t>=i-r&&t<=i+r?E.DOWN:E.NONE}function Xi(o,t){let{left:e,right:i,width:n}=o,r=n*Ki;return t>=e-r&&t<=e+r?C.LEFT:t>=i-r&&t<=i+r?C.RIGHT:C.NONE}function Hn(o,t,e,i,n){let r=Yi(t,n),s=Xi(t,i),a=E.NONE,l=C.NONE;if(r){let d=o.scrollTop;r===E.UP?d>0&&(a=E.UP):o.scrollHeight-d>o.clientHeight&&(a=E.DOWN);}if(s){let d=o.scrollLeft;e==="rtl"?s===C.RIGHT?d<0&&(l=C.RIGHT):o.scrollWidth+d>o.clientWidth&&(l=C.LEFT):s===C.LEFT?d>0&&(l=C.LEFT):o.scrollWidth-d>o.clientWidth&&(l=C.RIGHT);}return [a,l]}var jn=(()=>{class o{_injector=C$3(Ee$2);createDrag(e,i){return qi(this._injector,e,i)}createDropList(e){return Ji(this._injector,e)}static \u0275fac=function(i){return new(i||o)};static \u0275prov=br$2({token:o,factory:o.\u0275fac})}return o})(),Ui=new A$3("CDK_DRAG_PARENT");var Gn=new A$3("CdkDragHandle");var Qi=new A$3("CDK_DRAG_CONFIG"),en=new A$3("CdkDropList"),tn=(()=>{class o{element=C$3(_r$1);dropContainer=C$3(en,{optional:true,skipSelf:true});_ngZone=C$3(oe$2);_viewContainerRef=C$3(ji$3);_dir=C$3(Le$1,{optional:true});_changeDetectorRef=C$3(z0$1);_selfHandle=C$3(Gn,{optional:true,self:true});_parentDrag=C$3(Ui,{optional:true,skipSelf:true});_dragDropRegistry=C$3(vt);_destroyed=new re;_handles=new On$3([]);_previewTemplate=null;_placeholderTemplate=null;_dragRef;data;lockAxis=null;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled)}set disabled(e){this._disabled=e,this._dragRef.disabled=this._disabled;}_disabled=false;constrainPosition;previewClass;previewContainer;scale=1;started=new Le$3;released=new Le$3;ended=new Le$3;entered=new Le$3;exited=new Le$3;dropped=new Le$3;moved=new S(e=>{let i=this._dragRef.moved.pipe(Se$3(n=>({source:this,pointerPosition:n.pointerPosition,event:n.event,delta:n.delta,distance:n.distance}))).subscribe(e);return ()=>{i.unsubscribe();}});_injector=C$3(Ee$2);constructor(){let e=this.dropContainer,i=C$3(Qi,{optional:true});this._dragRef=qi(this._injector,this.element,{dragStartThreshold:i&&i.dragStartThreshold!=null?i.dragStartThreshold:5,pointerDirectionChangeThreshold:i&&i.pointerDirectionChangeThreshold!=null?i.pointerDirectionChangeThreshold:5,zIndex:i?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),i&&this._assignDefaults(i),e&&(e.addItem(this),e._dropListRef.beforeStarted.pipe(im(this._destroyed)).subscribe(()=>{this._dragRef.scale=this.scale;})),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef);}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset();}resetToBoundary(){this._dragRef.resetToBoundary();}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}setFreeDragPosition(e){this._dragRef.setFreeDragPosition(e);}ngAfterViewInit(){Kf(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition);},{injector:this._injector});}ngOnChanges(e){let i=e.rootElementSelector,n=e.freeDragPosition;i&&!i.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,n&&!n.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition);}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this),this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement),this._ngZone.runOutsideAngular(()=>{this._handles.complete(),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose();});}_addHandle(e){let i=this._handles.getValue();i.push(e),this._handles.next(i);}_removeHandle(e){let i=this._handles.getValue(),n=i.indexOf(e);n>-1&&(i.splice(n,1),this._handles.next(i));}_setPreviewTemplate(e){this._previewTemplate=e;}_resetPreviewTemplate(e){e===this._previewTemplate&&(this._previewTemplate=null);}_setPlaceholderTemplate(e){this._placeholderTemplate=e;}_resetPlaceholderTemplate(e){e===this._placeholderTemplate&&(this._placeholderTemplate=null);}_updateRootElement(){let e=this.element.nativeElement,i=e;this.rootElementSelector&&(i=e.closest!==void 0?e.closest(this.rootElementSelector):e.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(i||e);}_getBoundaryElement(){let e=this.boundaryElement;return e?typeof e=="string"?this.element.nativeElement.closest(e):jt(e):null}_syncInputs(e){e.beforeStarted.subscribe(()=>{if(!e.isDragging()){let i=this._dir,n=this.dragStartDelay,r=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,s=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.scale=this.scale,e.dragStartDelay=typeof n=="object"&&n?n:xt$1(n),e.constrainPosition=this.constrainPosition,e.previewClass=this.previewClass,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(r).withPreviewTemplate(s).withPreviewContainer(this.previewContainer||"global"),i&&e.withDirection(i.value);}}),e.beforeStarted.pipe(yt$2(1)).subscribe(()=>{if(this._parentDrag){e.withParent(this._parentDrag._dragRef);return}let i=this.element.nativeElement.parentElement;for(;i;){let n=this._dragDropRegistry.getDragDirectiveForNode(i);if(n){e.withParent(n._dragRef);break}i=i.parentElement;}});}_handleEvents(e){e.started.subscribe(i=>{this.started.emit({source:this,event:i.event}),this._changeDetectorRef.markForCheck();}),e.released.subscribe(i=>{this.released.emit({source:this,event:i.event});}),e.ended.subscribe(i=>{this.ended.emit({source:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck();}),e.entered.subscribe(i=>{this.entered.emit({container:i.container.data,item:this,currentIndex:i.currentIndex});}),e.exited.subscribe(i=>{this.exited.emit({container:i.container.data,item:this});}),e.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,isPointerOverContainer:i.isPointerOverContainer,item:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event});});}_assignDefaults(e){let{lockAxis:i,dragStartDelay:n,constrainPosition:r,previewClass:s,boundaryElement:a,draggingDisabled:l,rootElementSelector:d,previewContainer:u}=e;this.disabled=l??false,this.dragStartDelay=n||0,this.lockAxis=i||null,r&&(this.constrainPosition=r),s&&(this.previewClass=s),a&&(this.boundaryElement=a),d&&(this.rootElementSelector=d),u&&(this.previewContainer=u);}_setupHandlesListener(){this._handles.pipe(zl$1(e=>{let i=e.map(n=>n.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i);}),Gl$1(e=>zg(...e.map(i=>i._stateChanges.pipe(Wl$1(i))))),im(this._destroyed)).subscribe(e=>{let i=this._dragRef,n=e.element.nativeElement;e.disabled?i.disableHandle(n):i.enableHandle(n);});}static \u0275fac=function(i){return new(i||o)};static \u0275dir=XE({type:o,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(i,n){i&2&&Mh("cdk-drag-disabled",n.disabled)("cdk-drag-dragging",n._dragRef.isDragging());},inputs:{data:[0,"cdkDragData","data"],lockAxis:[0,"cdkDragLockAxis","lockAxis"],rootElementSelector:[0,"cdkDragRootElement","rootElementSelector"],boundaryElement:[0,"cdkDragBoundary","boundaryElement"],dragStartDelay:[0,"cdkDragStartDelay","dragStartDelay"],freeDragPosition:[0,"cdkDragFreeDragPosition","freeDragPosition"],disabled:[2,"cdkDragDisabled","disabled",Z0$1],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",Y0$1]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[Sw([{provide:Ui,useExisting:o}]),ly]})}return o})(),Zi=new A$3("CdkDropListGroup");var nn=(()=>{class o{element=C$3(_r$1);_changeDetectorRef=C$3(z0$1);_scrollDispatcher=C$3(U1);_dir=C$3(Le$1,{optional:true});_group=C$3(Zi,{optional:true,skipSelf:true});_latestSortedRefs;_destroyed=new re;_scrollableParentsResolved=false;static _dropLists=[];_dropListRef;connectedTo=[];data;orientation="vertical";id=C$3(K4).getId("cdk-drop-list-");lockAxis=null;get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(e){this._dropListRef.disabled=this._disabled=e;}_disabled=false;sortingDisabled=false;enterPredicate=()=>true;sortPredicate=()=>true;autoScrollDisabled=false;autoScrollStep;elementContainerSelector=null;hasAnchor=false;dropped=new Le$3;entered=new Le$3;exited=new Le$3;sorted=new Le$3;_unsortedItems=new Set;constructor(){let e=C$3(Qi,{optional:true}),i=C$3(Ee$2);this._dropListRef=Ji(i,this.element),this._dropListRef.data=this,e&&this._assignDefaults(e),this._dropListRef.enterPredicate=(n,r)=>this.enterPredicate(n.data,r.data),this._dropListRef.sortPredicate=(n,r,s)=>this.sortPredicate(n,r.data,s.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),o._dropLists.push(this),this._group&&this._group._items.add(this);}addItem(e){this._unsortedItems.add(e),e._dragRef._withDropContainer(this._dropListRef),this._dropListRef.isDragging()&&this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef));}removeItem(e){if(this._unsortedItems.delete(e),this._latestSortedRefs){let i=this._latestSortedRefs.indexOf(e._dragRef);i>-1&&(this._latestSortedRefs.splice(i,1),this._syncItemsWithRef(this._latestSortedRefs));}}getSortedItems(){return Array.from(this._unsortedItems).sort((e,i)=>e._dragRef.getVisibleElement().compareDocumentPosition(i._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){let e=o._dropLists.indexOf(this);e>-1&&o._dropLists.splice(e,1),this._group&&this._group._items.delete(this),this._latestSortedRefs=void 0,this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete();}_setupInputSyncSubscription(e){this._dir&&this._dir.change.pipe(Wl$1(this._dir.value),im(this._destroyed)).subscribe(i=>e.withDirection(i)),e.beforeStarted.subscribe(()=>{let i=u1(this.connectedTo).map(n=>{if(typeof n=="string"){let r=o._dropLists.find(s=>s.id===n);return r}return n});if(this._group&&this._group._items.forEach(n=>{i.indexOf(n)===-1&&i.push(n);}),!this._scrollableParentsResolved){let n=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(r=>r.getElementRef().nativeElement);this._dropListRef.withScrollableParents(n),this._scrollableParentsResolved=true;}if(this.elementContainerSelector){let n=this.element.nativeElement.querySelector(this.elementContainerSelector);e.withElementContainer(n);}e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.sortingDisabled=this.sortingDisabled,e.autoScrollDisabled=this.autoScrollDisabled,e.autoScrollStep=xt$1(this.autoScrollStep,2),e.hasAnchor=this.hasAnchor,e.connectedTo(i.filter(n=>n&&n!==this).map(n=>n._dropListRef)).withOrientation(this.orientation);});}_handleEvents(e){e.beforeStarted.subscribe(()=>{this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef)),this._changeDetectorRef.markForCheck();}),e.entered.subscribe(i=>{this.entered.emit({container:this,item:i.item.data,currentIndex:i.currentIndex});}),e.exited.subscribe(i=>{this.exited.emit({container:this,item:i.item.data}),this._changeDetectorRef.markForCheck();}),e.sorted.subscribe(i=>{this.sorted.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,container:this,item:i.item.data});}),e.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,item:i.item.data,isPointerOverContainer:i.isPointerOverContainer,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck();}),zg(e.receivingStarted,e.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck());}_assignDefaults(e){let{lockAxis:i,draggingDisabled:n,sortingDisabled:r,listAutoScrollDisabled:s,listOrientation:a}=e;this.disabled=n??false,this.sortingDisabled=r??false,this.autoScrollDisabled=s??false,this.orientation=a||"vertical",this.lockAxis=i||null;}_syncItemsWithRef(e){this._latestSortedRefs=e,this._dropListRef.withItems(e);}static \u0275fac=function(i){return new(i||o)};static \u0275dir=XE({type:o,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(i,n){i&2&&(ah("id",n.id),Mh("cdk-drop-list-disabled",n.disabled)("cdk-drop-list-dragging",n._dropListRef.isDragging())("cdk-drop-list-receiving",n._dropListRef.isReceiving()));},inputs:{connectedTo:[0,"cdkDropListConnectedTo","connectedTo"],data:[0,"cdkDropListData","data"],orientation:[0,"cdkDropListOrientation","orientation"],id:"id",lockAxis:[0,"cdkDropListLockAxis","lockAxis"],disabled:[2,"cdkDropListDisabled","disabled",Z0$1],sortingDisabled:[2,"cdkDropListSortingDisabled","sortingDisabled",Z0$1],enterPredicate:[0,"cdkDropListEnterPredicate","enterPredicate"],sortPredicate:[0,"cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:[2,"cdkDropListAutoScrollDisabled","autoScrollDisabled",Z0$1],autoScrollStep:[0,"cdkDropListAutoScrollStep","autoScrollStep"],elementContainerSelector:[0,"cdkDropListElementContainer","elementContainerSelector"],hasAnchor:[2,"cdkDropListHasAnchor","hasAnchor",Z0$1]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[Sw([{provide:Zi,useValue:void 0},{provide:en,useExisting:o}])]})}return o})();var on=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=YE({type:o});static \u0275inj=uu({providers:[jn],imports:[tn$1]})}return o})();var $n=o=>["/views",o],qn=(o,t)=>t.subjectType,rn=(o,t)=>t.id;function Kn(o,t){o&1&&(_i$3(0,"section",3)(1,"h2"),vw(2),Rw(3,"transloco"),Kc$1(),_i$3(4,"p"),vw(5),Rw(6,"transloco"),Kc$1(),_i$3(7,"a",4),vw(8),Rw(9,"transloco"),Kc$1()()),o&2&&(gI(2),Ph(Ow(3,3,"shell.empty.title")),gI(3),Ph(Ow(6,5,"shell.empty.body")),gI(3),nl$1(" ",Ow(9,7,"shell.empty.settingsLink")," "));}function Jn(o,t){if(o&1&&(_i$3(0,"p",5),vw(1),Kc$1()),o&2){let e=VD(2);gI(),Ph(e.reorderError());}}function Yn(o,t){if(o&1&&(_i$3(0,"li",10)(1,"a",11),vw(2),Kc$1()()),o&2){let e=t.$implicit;ah("data-testid","sidebar-view-"+e.id),gI(),ch("routerLink",xw(4,$n,e.id)),ah("data-testid","sidebar-link-"+e.id),gI(),nl$1(" ",e.name," ");}}function Xn(o,t){if(o&1){let e=LD();_i$3(0,"section",6)(1,"h2",8),vw(2),Rw(3,"transloco"),Kc$1(),_i$3(4,"ul",9),gh("cdkDropListDropped",function(n){let r=Pu(e).$implicit,s=VD(2);return Lu(s.drop(r,n))}),ND(5,Yn,3,6,"li",10,rn),Kc$1()();}if(o&2){let e=t.$implicit,i=VD(2);ah("data-testid","sidebar-group-"+e.subjectType),gI(2),Ph(Ow(3,5,e.labelKey)),gI(2),ch("cdkDropListData",e.views)("cdkDropListDisabled",i.reordering()),ah("data-testid","sidebar-drop-"+e.subjectType),gI(),xD(e.views);}}function Qn(o,t){if(o&1&&(_i$3(0,"li",10)(1,"a",13),vw(2),Kc$1()()),o&2){let e=t.$implicit;ah("data-testid","sidebar-shortcut-"+e.id),gI(),ah("data-testid","sidebar-shortcut-link-"+e.id),gI(),nl$1(" ",e.name," ");}}function eo(o,t){if(o&1){let e=LD();_i$3(0,"section",7)(1,"h2",8),vw(2),Rw(3,"transloco"),Kc$1(),_i$3(4,"ul",12),gh("cdkDropListDropped",function(n){Pu(e);let r=VD(2);return Lu(r.dropShortcut(n))}),ND(5,Qn,3,3,"li",10,rn),Kc$1()();}if(o&2){let e=VD(2);gI(2),Ph(Ow(3,3,"shell.shortcuts")),gI(2),ch("cdkDropListData",e.shortcuts())("cdkDropListDisabled",e.reordering()),gI(),xD(e.shortcuts());}}function to(o,t){if(o&1&&(bD(0,Jn,2,1,"p",5),ND(1,Xn,7,7,"section",6,qn),bD(3,eo,7,5,"section",7)),o&2){let e=VD();_D(e.reorderError()?0:-1),gI(),xD(e.groups()),gI(2),_D(e.shortcuts().length>0?3:-1);}}var sn=(()=>{class o{constructor(){this.viewsApi=C$3(U$1),this.shortcutsApi=C$3(u),this.destroyRef=C$3(at$3),this.groups=$0$1.required(),this.shortcuts=$0$1([]),this.empty=$0$1(false),this.viewsChanged=B0$1(),this.shortcutsChanged=B0$1(),this.reorderError=qo$1(null),this.reordering=qo$1(false);}drop(e,i){if(i.previousIndex===i.currentIndex)return;let n=[...e.views];pe(n,i.previousIndex,i.currentIndex),this.reorderError.set(null),this.reordering.set(true),this.viewsApi.reorder(n.map(r=>r.id)).pipe(Rt$2(this.destroyRef)).subscribe({next:()=>{this.reordering.set(false),this.viewsChanged.emit();},error:r=>{this.reordering.set(false),this.reorderError.set(r instanceof Error?r.message:"Failed to reorder views");}});}dropShortcut(e){if(e.previousIndex===e.currentIndex)return;let i=[...this.shortcuts()];pe(i,e.previousIndex,e.currentIndex),this.reorderError.set(null),this.reordering.set(true),this.shortcutsApi.reorder(i.map(n=>n.id)).pipe(Rt$2(this.destroyRef)).subscribe({next:()=>{this.reordering.set(false),this.shortcutsChanged.emit();},error:n=>{this.reordering.set(false),this.reorderError.set(n instanceof Error?n.message:"Failed to reorder shortcuts");}});}static{this.\u0275fac=function(i){return new(i||o)};}static{this.\u0275cmp=QE({type:o,selectors:[["app-sidebar"]],inputs:{groups:[1,"groups"],shortcuts:[1,"shortcuts"],empty:[1,"empty"]},outputs:{viewsChanged:"viewsChanged",shortcutsChanged:"shortcutsChanged"},decls:6,vars:1,consts:[["data-testid","app-sidebar",1,"sidebar"],["data-testid","app-brand",1,"brand"],[1,"sidebar-body"],["data-testid","sidebar-empty",1,"empty"],["nz-button","","nzType","primary","routerLink","/settings","data-testid","sidebar-empty-settings"],["data-testid","sidebar-reorder-error",1,"error"],[1,"group"],["data-testid","sidebar-group-shortcuts",1,"group"],[1,"group-title"],["cdkDropList","",1,"view-list",3,"cdkDropListDropped","cdkDropListData","cdkDropListDisabled"],["cdkDrag","",1,"view-item"],["routerLinkActive","active",3,"routerLink"],["cdkDropList","","data-testid","sidebar-drop-shortcuts",1,"view-list",3,"cdkDropListDropped","cdkDropListData","cdkDropListDisabled"],["routerLink","/shortcuts","routerLinkActive","active"]],template:function(i,n){i&1&&(_i$3(0,"aside",0)(1,"div",1),vw(2,"knoflows"),Kc$1(),_i$3(3,"div",2),bD(4,Kn,10,9,"section",3)(5,to,4,2),Kc$1()()),i&2&&(gI(4),_D(n.empty()?4:5));},dependencies:[Fn$3,on,nn,tn,Mt$1,wo$1,sd,zc,t7,ec$1],styles:[".sidebar[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:15rem;height:100vh;flex-shrink:0;border-right:1px solid #d6d3d1;background:#ffffffb8;overflow:hidden}.brand[_ngcontent-%COMP%]{flex-shrink:0;padding:.85rem 1rem;font-size:1.1rem;font-weight:700;letter-spacing:.02em;border-bottom:1px solid #d6d3d1}.sidebar-body[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;padding:1rem .75rem 1.5rem}.group[_ngcontent-%COMP%] + .group[_ngcontent-%COMP%]{margin-top:1.25rem}.group-title[_ngcontent-%COMP%]{margin:0 0 .5rem;padding:0 .35rem;font-size:.75rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#78716c}.view-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0}.view-item[_ngcontent-%COMP%]{margin:.15rem 0;border-radius:.35rem;cursor:grab}.view-item.cdk-drag-disabled[_ngcontent-%COMP%]{cursor:default}.view-item[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{display:block;padding:.45rem .5rem;color:#44403c;text-decoration:none;border-radius:.35rem}.view-item[_ngcontent-%COMP%] a.active[_ngcontent-%COMP%], .view-item[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{background:#f5f5f4;color:#0c0a09}.view-item[_ngcontent-%COMP%] a.active[_ngcontent-%COMP%]{font-weight:600}.empty[_ngcontent-%COMP%]{padding:.5rem .35rem}.empty[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e;font-size:.92rem;line-height:1.45}.error[_ngcontent-%COMP%]{margin:0 0 .75rem;padding:0 .35rem;color:#9f1239;font-size:.85rem}.cdk-drag-preview[_ngcontent-%COMP%]{box-shadow:0 4px 12px #0000001f;background:#fff;border-radius:.35rem}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}"]});}}return o})();var io=()=>({status:"waiting_for_human"});function no(o,t){if(o&1){let e=LD();_i$3(0,"div",2)(1,"app-sidebar",3),gh("viewsChanged",function(){Pu(e);let n=VD();return Lu(n.reloadViews())})("shortcutsChanged",function(){Pu(e);let n=VD();return Lu(n.reloadShortcuts())}),Kc$1(),_i$3(2,"div",4)(3,"header",5)(4,"div",6)(5,"a",7)(6,"nz-badge",8)(7,"span"),vw(8),Rw(9,"transloco"),Kc$1()()(),_i$3(10,"button",9),vw(11),Rw(12,"transloco"),Kc$1(),_i$3(13,"nz-dropdown-menu",null,0)(15,"ul",10)(16,"li",11)(17,"a",12),vw(18),Rw(19,"transloco"),Kc$1()(),_i$3(20,"li",13)(21,"a",14),vw(22),Rw(23,"transloco"),Kc$1()(),_i$3(24,"li",15)(25,"a",16),vw(26),Rw(27,"transloco"),Kc$1()()()(),_i$3(28,"a",17),vw(29),Rw(30,"transloco"),Kc$1(),_i$3(31,"label",18)(32,"span"),vw(33),Kc$1(),_i$3(34,"nz-select",19),gh("ngModelChange",function(n){Pu(e);let r=VD();return Lu(r.onLanguageChange(n))}),lh(35,"nz-option",20)(36,"nz-option",21),Kc$1(),oE(),Kc$1()()(),_i$3(37,"main",22),lh(38,"router-outlet"),Kc$1()()();}if(o&2){let e=t.$implicit,i=zD(14),n=VD();gI(),ch("groups",n.groups())("shortcuts",n.shortcuts())("empty",n.sidebarEmpty()),gI(4),ch("queryParams",Nw(27,io)),gI(),ch("nzCount",n.waitingJobsCount())("nzShowZero",false),gI(2),Ph(Ow(9,15,"shell.jobsWaiting")),gI(2),ch("nzDropdownMenu",i),gI(),nl$1(" ",Ow(12,17,"shell.manage")," "),gI(7),Ph(Ow(19,19,"nav.workflows")),gI(4),Ph(Ow(23,21,"nav.views")),gI(4),Ph(Ow(27,23,"nav.shortcuts")),gI(3),nl$1(" ",Ow(30,25,"nav.settings")," "),gI(4),Ph(e("nav.language")),gI(),ch("ngModel",n.language.currentLang()),sE();}}var oo=3e4,ro=500,an=(()=>{class o{constructor(){this.viewsApi=C$3(U$1),this.shortcutsApi=C$3(u),this.settingsApi=C$3(l),this.jobsApi=C$3(U),this.destroyRef=C$3(at$3),this.language=C$3(O),this.views=qo$1([]),this.shortcuts=qo$1([]),this.settings=qo$1(null),this.waitingJobsCount=qo$1(0),this.groups=Hw(()=>Ti(this.views(),this.settings())),this.sidebarEmpty=Hw(()=>this.views().length===0&&this.shortcuts().length===0),this.loadViews(),this.loadShortcuts(),this.loadSettings(),this.pollWaitingJobs();}onLanguageChange(e){this.language.setLanguage(e);}reloadViews(){this.loadViews();}reloadShortcuts(){this.loadShortcuts();}loadViews(){this.viewsApi.list().pipe(Rt$2(this.destroyRef)).subscribe({next:e=>this.views.set(e),error:()=>this.views.set([])});}loadShortcuts(){this.shortcutsApi.list().pipe(Rt$2(this.destroyRef)).subscribe({next:e=>this.shortcuts.set(e),error:()=>this.shortcuts.set([])});}loadSettings(){this.settingsApi.getSettings().pipe(Rt$2(this.destroyRef)).subscribe({next:e=>this.settings.set(e),error:()=>this.settings.set(null)});}pollWaitingJobs(){Gg(oo).pipe(Wl$1(0),Gl$1(()=>this.jobsApi.list({status:"waiting_for_human",topLevelOnly:false,limit:ro,offset:0})),Rt$2(this.destroyRef)).subscribe({next:e=>this.waitingJobsCount.set(e.length),error:()=>this.waitingJobsCount.set(0)});}static{this.\u0275fac=function(i){return new(i||o)};}static{this.\u0275cmp=QE({type:o,selectors:[["app-shell"]],decls:1,vars:0,consts:[["manageMenu","nzDropdownMenu"],["class","app-shell",4,"transloco"],[1,"app-shell"],[3,"viewsChanged","shortcutsChanged","groups","shortcuts","empty"],[1,"main"],["data-testid","app-top-bar",1,"top-bar"],[1,"top-actions"],["routerLink","/jobs","data-testid","jobs-waiting-badge",1,"jobs-badge",3,"queryParams"],[3,"nzCount","nzShowZero"],["nz-button","","nzType","default","nz-dropdown","","data-testid","manage-menu",3,"nzDropdownMenu"],["nz-menu",""],["nz-menu-item","","data-testid","manage-workflows"],["routerLink","/workflows"],["nz-menu-item","","data-testid","manage-views"],["routerLink","/views"],["nz-menu-item","","data-testid","manage-shortcuts"],["routerLink","/shortcuts"],["nz-button","","nzType","default","routerLink","/settings","routerLinkActive","active","data-testid","settings-link"],["data-testid","language-switcher",1,"lang"],["data-testid","language-select",2,"min-width","5.5rem",3,"ngModelChange","ngModel"],["nzValue","en","nzLabel","en"],["nzValue","es","nzLabel","es"],[1,"content"]],template:function(i,n){i&1&&nh(0,no,39,28,"div",1);},dependencies:[Fn$3,n8,J6,k3,cr$1,Mt$1,wo$1,Qu,Ri,at,sd,zc,t7,y7,Ci,xt,Rn$1,vi,bi,$n$1,$b,V5,D5,sn,ec$1],styles:[".app-shell[_ngcontent-%COMP%]{display:flex;min-height:100vh;background:linear-gradient(180deg,#fafaf9,#f5f5f4);color:#1c1917}.main[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column}.top-bar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:1rem;padding:.75rem 1.25rem;border-bottom:1px solid #d6d3d1;background:#ffffffd9}.top-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.65rem}.jobs-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:.35rem .5rem;color:#44403c;text-decoration:none;border-radius:.35rem}.jobs-badge[_ngcontent-%COMP%]:hover{background:#f5f5f4}.lang[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.9rem;color:#57534e}.content[_ngcontent-%COMP%]{flex:1;min-height:0}[_nghost-%COMP%] .top-actions a.active{font-weight:600}"]});}}return o})();var ln=(()=>{class o{static{this.\u0275fac=function(i){return new(i||o)};}static{this.\u0275cmp=QE({type:o,selectors:[["app-root"]],decls:1,vars:0,template:function(i,n){i&1&&lh(0,"app-shell");},dependencies:[an],encapsulation:2});}}return o})();var so="@",ao=(()=>{class o{doc;delegate;zone;animationType;moduleImpl;_rendererFactoryPromise=null;scheduler=null;injector=C$3(Ee$2);loadingSchedulerFn=C$3(lo,{optional:true});_engine;constructor(e,i,n,r,s){this.doc=e,this.delegate=i,this.zone=n,this.animationType=r,this.moduleImpl=s;}ngOnDestroy(){this._engine?.flush();}loadImpl(){let e=()=>this.moduleImpl??import('./chunk-PG4bRDhM.js').then(n=>n),i;return this.loadingSchedulerFn?i=this.loadingSchedulerFn(e):i=e(),i.catch(n=>{throw new _$3(5300,false)}).then(({\u0275createEngine:n,\u0275AnimationRendererFactory:r})=>{this._engine=n(this.animationType,this.doc);let s=new r(this.delegate,this._engine,this.zone);return this.delegate=s,s})}createRenderer(e,i){let n=this.delegate.createRenderer(e,i);if(n.\u0275type===0)return n;typeof n.throwOnSyntheticProps=="boolean"&&(n.throwOnSyntheticProps=false);let r=new Dt(n);return i?.data?.animation&&!this._rendererFactoryPromise&&(this._rendererFactoryPromise=this.loadImpl()),this._rendererFactoryPromise?.then(s=>{let a=s.createRenderer(e,i);r.use(a),this.scheduler??=this.injector.get(He$3,null,{optional:true}),this.scheduler?.notify(10);}).catch(s=>{r.use(n);}),r}begin(){this.delegate.begin?.();}end(){this.delegate.end?.();}whenRenderingDone(){return this.delegate.whenRenderingDone?.()??Promise.resolve()}componentReplaced(e){this._engine?.flush(),this.delegate.componentReplaced?.(e);}static \u0275fac=function(i){fE();};static \u0275prov=ie$1({token:o,factory:o.\u0275fac})}return o})(),Dt=class{delegate;replay=[];\u0275type=1;constructor(t){this.delegate=t;}use(t){if(this.delegate=t,this.replay!==null){for(let e of this.replay)e(t);this.replay=null;}}get data(){return this.delegate.data}destroy(){this.replay=null,this.delegate.destroy();}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}get destroyNode(){return this.delegate.destroyNode}appendChild(t,e){this.delegate.appendChild(t,e);}insertBefore(t,e,i,n){this.delegate.insertBefore(t,e,i,n);}removeChild(t,e,i,n){this.delegate.removeChild(t,e,i,n);}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,i,n){this.delegate.setAttribute(t,e,i,n);}removeAttribute(t,e,i){this.delegate.removeAttribute(t,e,i);}addClass(t,e){this.delegate.addClass(t,e);}removeClass(t,e){this.delegate.removeClass(t,e);}setStyle(t,e,i,n){this.delegate.setStyle(t,e,i,n);}removeStyle(t,e,i){this.delegate.removeStyle(t,e,i);}setProperty(t,e,i){this.shouldReplay(e)&&this.replay.push(n=>n.setProperty(t,e,i)),this.delegate.setProperty(t,e,i);}setValue(t,e){this.delegate.setValue(t,e);}listen(t,e,i,n){return this.shouldReplay(e)&&this.replay.push(r=>r.listen(t,e,i,n)),this.delegate.listen(t,e,i,n)}shouldReplay(t){return this.replay!==null&&t.startsWith(so)}},lo=new A$3("");function dn(o="animations"){return ce$2("NgAsyncAnimations"),Eu([{provide:Dr$2,useFactory:()=>new ao(C$3(Uo$2),C$3(St$2),C$3(oe$2),o)},{provide:Gm,useValue:o==="noop"?"NoopAnimations":"BrowserAnimations"}])}var cn=(()=>{class o{constructor(){this.http=C$3(Kn$3);}getTranslation(e){return this.http.get(`./assets/i18n/${e}.json`)}static{this.\u0275fac=function(i){return new(i||o)};}static{this.\u0275prov=ie$1({token:o,factory:o.\u0275fac,providedIn:"root"});}}return o})();var hn=[{path:"",pathMatch:"full",redirectTo:"jobs"},{path:"jobs",pathMatch:"full",loadComponent:()=>import('./chunk-BMOj-ctp.js').then(o=>o.JobListComponent)},{path:"jobs/new",loadComponent:()=>import('./chunk-D7ecsHWV.js').then(o=>o.JobRunnerComponent)},{path:"jobs/:id",loadComponent:()=>import('./chunk-CzSFfhcS.js').then(o=>o.JobDetailComponent)},{path:"batches/:id",loadComponent:()=>import('./chunk-DeFJOu7x.js').then(o=>o.BatchDetailComponent)},{path:"workflows",loadComponent:()=>import('./chunk-dMfVmcfD.js').then(o=>o.WorkflowListComponent)},{path:"workflows/new",loadComponent:()=>import('./chunk-DZV_xppV.js').then(o=>o.WorkflowEditorComponent)},{path:"workflows/:id/edit",loadComponent:()=>import('./chunk-DZV_xppV.js').then(o=>o.WorkflowEditorComponent)},{path:"views",loadComponent:()=>import('./chunk-Cv5pNW9n.js').then(o=>o.ViewListComponent)},{path:"views/new",loadComponent:()=>import('./chunk-DnSW_i5C.js').then(o=>o.ViewEditorComponent)},{path:"views/:id/edit",loadComponent:()=>import('./chunk-DnSW_i5C.js').then(o=>o.ViewEditorComponent)},{path:"views/:id",loadComponent:()=>import('./chunk-Ba2Pk3ZV.js').then(o=>o.ViewDetailComponent)},{path:"shortcuts",loadComponent:()=>import('./chunk-B2oijRKi.js').then(o=>o.ShortcutListComponent)},{path:"shortcuts/new",loadComponent:()=>import('./chunk-Cg4mENZa.js').then(o=>o.ShortcutEditorComponent)},{path:"shortcuts/:id/edit",loadComponent:()=>import('./chunk-Cg4mENZa.js').then(o=>o.ShortcutEditorComponent)},{path:"settings",loadComponent:()=>import('./chunk-164-t-LC.js').then(o=>o.SettingsComponent)}];var pn={providers:[Ao$1(hn),di$2(),dn(),jy(Il),Dy(),tc$1({config:{availableLangs:["en","es"],defaultLang:"en",fallbackLang:"en",reRenderOnLangChange:true,prodMode:true},loader:cn})]};jr$1(ln,pn).catch(o=>console.error(o));export{$b as $,_D as A,VD as B,C$3 as C,D5 as D,Pu as E,Fn$3 as F,Lu as G,Hw as H,ue as I,J6 as J,Kc$1 as K,LD as L,Mt$1 as M,ND as N,Ow as O,Ph as P,QE as Q,Rt$2 as R,SD as S,Lh as T,U,V5 as V,W$1 as W,rd as X,Bw as Y,y7 as Z,_$3 as _,ar$2 as a,Le$3 as a$,$0$1 as a0,B0$1 as a1,Pw as a2,xw as a3,Mh as a4,ah as a5,Nw as a6,MD as a7,sc$1 as a8,Ng as a9,Kf as aA,f9 as aB,pt$2 as aC,Se$1 as aD,va as aE,vr$1 as aF,BD as aG,nh as aH,Lw as aI,Sw as aJ,h1 as aK,B1 as aL,wo$2 as aM,rD as aN,R4 as aO,cw as aP,Dh as aQ,GD as aR,Eh as aS,U0$1 as aT,zD as aU,Vh as aV,jh as aW,$D as aX,ww as aY,U$1 as aZ,XI as a_,rs$1 as aa,Dg as ab,O as ac,Zn$2 as ad,Se$3 as ae,S4 as af,$6 as ag,YE as ah,uu as ai,Y0$1 as aj,Z0$1 as ak,N1 as al,q0$1 as am,_r$1 as an,Ee$2 as ao,a3 as ap,Le$1 as aq,ga as ar,j3 as as,m1 as at,za as au,Uw as av,W0$1 as aw,D8 as ax,u9 as ay,a9 as az,at$3 as b,Ln$3 as b$,N7 as b0,B7 as b1,ly as b2,_h as b3,fr as b4,pr as b5,l as b6,Kn$3 as b7,lc$1 as b8,Xa$1 as b9,s0 as bA,Sy as bB,oi$2 as bC,ri$3 as bD,Bh as bE,sw as bF,ji$3 as bG,kt as bH,Wm as bI,jo$1 as bJ,Kg as bK,Yg as bL,kg as bM,kr$2 as bN,xy as bO,z0$1 as bP,r2 as bQ,a2 as bR,_e as bS,Ou as bT,vn$1 as bU,He as bV,Er$2 as bW,el$1 as bX,tl$1 as bY,i9 as bZ,wn$1 as b_,u as ba,pT as bb,hT as bc,XE as bd,eh as be,re as bf,Uo$2 as bg,k8 as bh,em as bi,on$3 as bj,Ul$1 as bk,fn$1 as bl,f1 as bm,gn as bn,Xa as bo,Ts as bp,Vs as bq,t4 as br,Tt as bs,Ie as bt,Wy as bu,Uy as bv,Ih as bw,qD as bx,WD as by,ut$1 as bz,qe as c,Cw as c$,On$3 as c0,Vt as c1,Fg as c2,d9 as c3,vh as c4,Wl$1 as c5,Gl$1 as c6,mt$5 as c7,zg as c8,Ie$1 as c9,ph as cA,Jc$1 as cB,uh as cC,Xc$1 as cD,A$3 as cE,w0 as cF,mh as cG,P1 as cH,l9 as cI,rh as cJ,Gm as cK,ec$2 as cL,bt as cM,gi$2 as cN,pn$1 as cO,Ga as cP,Vc as cQ,K1 as cR,s9 as cS,G5 as cT,p3 as cU,zl$1 as cV,$5 as cW,R0 as cX,tr as cY,Tw as cZ,vv as c_,Ri$1 as ca,xn$2 as cb,Sr$1 as cc,c9 as cd,Aw as ce,oe$2 as cf,St as cg,J as ch,rn$1 as ci,on$1 as cj,nn$1 as ck,an$1 as cl,W1 as cm,o9 as cn,Ci as co,xt as cp,Rn$1 as cq,bi as cr,vi as cs,jt as ct,S as cu,jl$1 as cv,om as cw,Yc$1 as cx,TD as cy,fh as cz,sd as d,u$1 as d0,v$1 as d1,ms as d2,Dr$2 as d3,Qg as d4,t7 as e,ec$1 as f,_i$3 as g,Rw as h,ie$1 as i,gh as j,k3 as k,lh as l,bD as m,n8 as n,oE as o,gI as p,qo$1 as q,r,s,t,nl$1 as u,vw as v,ch as w,sE as x,xD as y,zc as z};
@@ -1 +0,0 @@
1
- import {v as v$,g as g$}from'./chunk-CbG3rfKf.js';import {s,r,t}from'./main-5C7K2447.js';var y=["agent","interaction","shell","git","provider_action","sub_workflow","loop"];function I(){return {name:"",appliesTo:"none",cardinality:"single",inputSchema:[],steps:[],notificationPolicy:{triggers:[]}}}function d(){return crypto.randomUUID()}function g(t,e){return t.map(n=>{let r$1=s(r({},n),{_key:d(),_idAutoSync:e.idAutoSync});return n.type==="loop"?s(r({},r$1),{steps:g(n.steps,e)}):r$1})}function h(t,e){let n=e?.id??"",r$1=e?.name??"",i={_key:e?.key??d(),_idAutoSync:e?.idAutoSync??true};switch(t){case "agent":return r({type:t,id:n,name:r$1,objective:"",outputFormat:"free_text"},i);case "interaction":return r({type:t,id:n,name:r$1,interaction:"questionnaire"},i);case "shell":return r({type:t,id:n,name:r$1,command:""},i);case "git":return r({type:t,id:n,name:r$1,operation:"create_worktree",params:{}},i);case "provider_action":return r({type:t,id:n,name:r$1,action:"get_subject",params:{}},i);case "sub_workflow":return r({type:t,id:n,name:r$1,workflowId:"",forEach:"selection"},i);case "loop":return r({type:t,id:n,name:r$1,steps:[],until:{type:"field_empty",stepId:"",field:""},maxIterations:3,onMaxIterations:{action:"fail"}},i)}}function b(){return {name:"",label:"",type:"string",required:false}}function A(t){return t?Object.entries(t).map(([e,n])=>({key:e,value:n==null?"":String(n)})):[]}function T(t){let e={};for(let n of t){let r=n.key.trim();r&&(e[r]=n.value);}return e}function j(t){return t.issues.map(e=>`${e.path.length>0?e.path.map(String).join("."):"(root)"}: ${e.message}`)}function m(t$1){let i=t$1,{_key:e,_idAutoSync:n}=i,r$1=t(i,["_key","_idAutoSync"]);return r$1.type==="loop"?s(r({},r$1),{steps:r$1.steps.map(c=>m(c))}):r$1}function v(t$1,e={}){let n=t$1.steps.map(_=>{let u=m(_);if(!u.id){let p=u,{id:x}=p;return t(p,["id"])}return u}),c=t$1,{id:r$1}=c,i=t(c,["id"]);return e.omitWorkflowId||!r$1?s(r({},i),{steps:n}):s(r({},i),{id:r$1,steps:n})}function E(t,e,n){if(!t._idAutoSync)return s(r({},t),{name:e});let r$1=v$(n);t.id&&r$1.delete(t.id);let i=e.trim().length>0?g$(e,r$1):"";return s(r({},t),{name:e,id:i})}function P(t,e){return s(r({},t),{id:e,_idAutoSync:false})}export{A,E,I,P,T,b,g,h,j,v,y};
@@ -1 +0,0 @@
1
- function o(r){return r==="batch"||r==="aggregate"}function u(r){return JSON.stringify(r)}export{o,u};
@@ -1 +0,0 @@
1
- import {d as dr,c as ca,r as rr,o as oa,n as na,s as sr,V as Vn,p as pa,a as aa}from'./chunk-BaL0hYvK.js';import {a0 as $0,a1 as B0,q as qo,H as Hw,Q as QE,F as Fn,M as Mt,d as sd,z as zc,e as t7,Z as y7,f as ec,g as _i,m as bD,v as vw,h as Rw,K as Kc,N as ND,p as gI,A as _D,w as ch,P as Ph,O as Ow,y as xD,L as LD,j as gh,B as VD,u as nl,a2 as Pw,a3 as xw,a5 as ah,E as Pu,G as Lu}from'./main-5C7K2447.js';var Q=t=>({count:t}),U=t=>["/jobs",t],X=(t,c)=>c.id;function Y(t,c){if(t&1){let e=LD();_i(0,"div",1)(1,"button",4),gh("click",function(){Pu(e);let o=VD();return Lu(o.emitBulk())}),vw(2),Rw(3,"transloco"),Kc()();}if(t&2){let e=VD();gI(),ch("disabled",e.checkedCount()===0),gI(),nl(" ",Pw(3,2,"runnableTable.runSelected",xw(5,Q,e.checkedCount()))," ");}}function Z(t,c){if(t&1){let e=LD();_i(0,"th",5),gh("nzCheckedChange",function(o){Pu(e);let s=VD();return Lu(s.onAllChecked(o))}),Kc();}if(t&2){let e=VD();ch("nzChecked",e.allChecked())("nzIndeterminate",e.someChecked());}}function ee(t,c){if(t&1){let e=LD();_i(0,"td",13),gh("nzCheckedChange",function(o){Pu(e);let s=VD().$implicit,H=VD();return Lu(H.onItemChecked(s.id,o))}),Kc();}if(t&2){let e=VD().$implicit,n=VD();ch("nzChecked",n.checkedIds().has(e.id)),ah("data-testid","check-"+e.id);}}function te(t,c){if(t&1&&(_i(0,"span",9),vw(1),Kc()),t&2){let e=VD().$implicit;ah("data-testid","subtitle-"+e.id),gI(),Ph(e.subtitle);}}function ne(t,c){if(t&1&&(_i(0,"a",10),vw(1),Rw(2,"transloco"),Kc()),t&2){let e=c,n=VD().$implicit,o=VD();ch("routerLink",xw(5,U,e.id)),ah("data-testid","latest-"+n.id),gI(),nl(" ",Ow(2,3,o.statusKey(e.status))," ");}}function ie(t,c){if(t&1&&(_i(0,"span",11),vw(1),Rw(2,"transloco"),Kc()),t&2){let e=VD().$implicit;ah("data-testid","latest-"+e.id),gI(),Ph(Ow(2,2,"runnableTable.neverRun"));}}function oe(t,c){if(t&1){let e=LD();_i(0,"tr"),bD(1,ee,1,2,"td",6),_i(2,"td")(3,"div",7)(4,"span",8),vw(5),Kc(),bD(6,te,2,2,"span",9),Kc()(),_i(7,"td"),bD(8,ne,3,7,"a",10)(9,ie,3,4,"span",11),Kc(),_i(10,"td")(11,"button",12),gh("click",function(){let o=Pu(e).$implicit,s=VD();return Lu(s.emitRow(o.id))}),vw(12),Rw(13,"transloco"),Kc()()();}if(t&2){let e,n=c.$implicit,o=VD();ah("data-testid","row-"+n.id),gI(),_D(o.selectable()?1:-1),gI(3),ah("data-testid","label-"+n.id),gI(),Ph(n.primaryLabel),gI(),_D(n.subtitle?6:-1),gI(2),_D((e=n.latestJob)?8:9,e),gI(3),ah("data-testid","run-"+n.id),gI(),nl(" ",Ow(13,8,"runnableTable.run")," ");}}var he=(()=>{class t{constructor(){this.rows=$0([]),this.selectable=$0(false),this.rowAction=B0(),this.bulkAction=B0(),this.checkedIds=qo(new Set),this.checkedCount=Hw(()=>this.checkedIds().size),this.allChecked=Hw(()=>{let e=this.rows();return e.length>0&&e.every(n=>this.checkedIds().has(n.id))}),this.someChecked=Hw(()=>{let e=this.checkedCount();return e>0&&e<this.rows().length});}onItemChecked(e,n){this.checkedIds.update(o=>{let s=new Set(o);return n?s.add(e):s.delete(e),s});}onAllChecked(e){this.checkedIds.set(e?new Set(this.rows().map(n=>n.id)):new Set);}emitBulk(){this.bulkAction.emit([...this.checkedIds()]);}emitRow(e){this.rowAction.emit(e);}statusKey(e){return `jobs.status.${e}`}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-runnable-items-table"]],inputs:{rows:[1,"rows"],selectable:[1,"selectable"]},outputs:{rowAction:"rowAction",bulkAction:"bulkAction"},decls:18,vars:14,consts:[["data-testid","runnable-items-table",1,"runnable-table"],["data-testid","bulk-bar",1,"bulk-bar"],[3,"nzData","nzFrontPagination","nzShowPagination"],["data-testid","select-all",3,"nzChecked","nzIndeterminate"],["nz-button","","type","button","data-testid","run-selected",3,"click","disabled"],["data-testid","select-all",3,"nzCheckedChange","nzChecked","nzIndeterminate"],[3,"nzChecked"],[1,"item"],[1,"primary"],[1,"subtitle"],[3,"routerLink"],[1,"never"],["nz-button","","nzType","link","type","button",3,"click"],[3,"nzCheckedChange","nzChecked"]],template:function(n,o){n&1&&(_i(0,"div",0),bD(1,Y,4,7,"div",1),_i(2,"nz-table",2)(3,"thead")(4,"tr"),bD(5,Z,1,2,"th",3),_i(6,"th"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"th"),vw(10),Rw(11,"transloco"),Kc(),_i(12,"th"),vw(13),Rw(14,"transloco"),Kc()()(),_i(15,"tbody"),ND(16,oe,14,10,"tr",null,X),Kc()()()),n&2&&(gI(),_D(o.selectable()?1:-1),gI(),ch("nzData",o.rows())("nzFrontPagination",false)("nzShowPagination",false),gI(3),_D(o.selectable()?5:-1),gI(2),Ph(Ow(8,8,"runnableTable.column.item")),gI(3),Ph(Ow(11,10,"runnableTable.column.latestRun")),gI(3),Ph(Ow(14,12,"runnableTable.column.actions")),gI(3),xD(o.rows()));},dependencies:[Fn,Mt,sd,zc,t7,y7,dr,ca,rr,oa,na,sr,Vn,pa,aa,ec],styles:[".runnable-table[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.bulk-bar[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.item[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.15rem}.primary[_ngcontent-%COMP%]{font-weight:600}.subtitle[_ngcontent-%COMP%]{color:#78716c;font-size:.85rem}.never[_ngcontent-%COMP%]{color:#78716c}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return t})();export{he as h};
@@ -1 +0,0 @@
1
- import {o}from'./chunk-4TrlkpZx.js';import {h as he$1}from'./chunk-99HzEG7y.js';import'./chunk-CbG3rfKf.js';import {C,W,I as ue$1,aZ as U,U as U$3,a as ar,b as at,q as qo,H as Hw,R as Rt,r,a9 as Ng,ab as Dg,c as qe,Q as QE,F as Fn,M as Mt,d as sd,z as zc,e as t7,Z as y7,f as ec,g as _i,m as bD,K as Kc,p as gI,A as _D,v as vw,h as Rw,P as Ph,O as Ow,B as VD,L as LD,j as gh,w as ch,a3 as xw,u as nl,E as Pu,G as Lu,l as lh}from'./main-5C7K2447.js';import {J,K}from'./chunk-D6KYmz2w.js';import {G as Gn,u as un}from'./chunk-B4PXIvtd.js';import {U as U$1}from'./chunk-VW6e_Kls.js';import {U as U$2}from'./chunk-jDfyi4_G.js';import'./chunk-BaL0hYvK.js';import'./chunk-Ca9rxJZS.js';import'./chunk-DS5k0b_s.js';var ie=i=>["/views",i,"edit"],ne=i=>["/batches",i];function oe(i,c){i&1&&(_i(0,"p",1),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function ae(i,c){if(i&1&&(_i(0,"p",2),vw(1),Kc()),i&2){let e=VD();gI(),Ph(e.loadError());}}function le(i,c){i&1&&(_i(0,"span",8),vw(1),Kc()),i&2&&(gI(),Ph(c.name));}function re(i,c){i&1&&(_i(0,"a",16),vw(1),Rw(2,"transloco"),Kc()),i&2&&(ch("routerLink",xw(4,ne,c)),gI(),nl(" ",Ow(2,2,"views.detail.openBatch")," "));}function se(i,c){if(i&1&&(lh(0,"nz-alert",15),bD(1,re,3,6,"a",16)),i&2){let e,t=VD(2);ch("nzMessage",t.confirmation()),gI(),_D((e=t.confirmationBatchId())?1:-1,e);}}function ce(i,c){i&1&&(_i(0,"p",17),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),nl(" ",Ow(2,1,"views.detail.noBulkWorkflows")," "));}function de(i,c){if(i&1&&(_i(0,"p",20),vw(1),Kc()),i&2){let e=VD(4);gI(),Ph(e.launchError());}}function ue(i,c){if(i&1){let e=LD();_i(0,"p",18),vw(1),Kc(),_i(2,"app-workflow-input-form",19),gh("valuesChange",function(n){Pu(e);let l=VD(3);return Lu(l.setInputValues(n))}),Kc(),bD(3,de,2,1,"p",20),_i(4,"div",21)(5,"button",22),gh("click",function(){Pu(e);let n=VD(3);return Lu(n.launch())}),vw(6),Rw(7,"transloco"),Kc(),_i(8,"button",23),gh("click",function(){Pu(e);let n=VD(3);return Lu(n.cancelLaunch())}),vw(9),Rw(10,"transloco"),Kc()();}if(i&2){let e=c,t=VD(3);gI(),Ph(e.name),gI(),ch("fields",e.inputSchema)("values",t.inputValues()),gI(),_D(t.launchError()?3:-1),gI(2),ch("nzLoading",t.launching())("disabled",t.launching()),gI(),nl(" ",Ow(7,8,t.launching()?"views.detail.launching":"views.detail.launch")," "),gI(3),nl(" ",Ow(10,10,"views.detail.cancelLaunch")," ");}}function pe(i,c){if(i&1&&(_i(0,"section",12)(1,"h2"),vw(2),Rw(3,"transloco"),Kc(),bD(4,ce,3,3,"p",17)(5,ue,11,12),Kc()),i&2){let e,t=VD(2);gI(2),nl(" ",Ow(3,2,c==="view"?"views.detail.launchViewTitle":"views.detail.launchSelectedTitle")," "),gI(2),_D(t.canBulkLaunch()?(e=t.boundWorkflow())?5:-1:4,e);}}function me(i,c){i&1&&(_i(0,"p",13),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"views.detail.emptySubjects")));}function he(i,c){if(i&1){let e=LD();_i(0,"app-runnable-items-table",24),gh("rowAction",function(n){Pu(e);let l=VD(2);return Lu(l.onRowAction(n))})("bulkAction",function(n){Pu(e);let l=VD(2);return Lu(l.onBulkAction(n))}),Kc();}if(i&2){let e=VD(2);ch("rows",e.rows())("selectable",true);}}function _e(i,c){if(i&1){let e=LD();_i(0,"header",3)(1,"div")(2,"a",4),vw(3),Rw(4,"transloco"),Kc(),_i(5,"h1",5),vw(6),Kc(),_i(7,"p",6)(8,"span",7),vw(9),Rw(10,"transloco"),Kc(),bD(11,le,2,1,"span",8),Kc()(),_i(12,"a",9),vw(13),Rw(14,"transloco"),Kc()(),_i(15,"section",10)(16,"button",11),gh("click",function(){Pu(e);let n=VD();return Lu(n.beginLaunch("view"))}),vw(17),Rw(18,"transloco"),Kc()(),bD(19,se,2,2),bD(20,pe,6,4,"section",12),bD(21,me,3,3,"p",13)(22,he,1,2,"app-runnable-items-table",14);}if(i&2){let e,t,n=c,l=VD();gI(3),Ph(Ow(4,11,"views.detail.backToList")),gI(3),Ph(n.name),gI(3),Ph(Ow(10,13,l.subjectTypeKey(n.subjectType))),gI(2),_D((e=l.boundWorkflow())?11:-1,e),gI(),ch("routerLink",xw(19,ie,n.id)),gI(),nl(" ",Ow(14,15,"views.detail.edit")," "),gI(3),ch("disabled",!l.canBulkLaunch()),gI(),nl(" ",Ow(18,17,"views.detail.runOnAll")," "),gI(2),_D(l.confirmation()?19:-1),gI(),_D((t=l.launchMode())?20:-1,t),gI(),_D(l.subjects().length===0?21:22);}}var Pe=(()=>{class i{constructor(){this.route=C(W),this.router=C(ue$1),this.viewsApi=C(U),this.workflowsApi=C(U$1),this.batchesApi=C(U$2),this.jobsApi=C(U$3),this.transloco=C(ar),this.destroyRef=C(at),this.view=qo(null),this.subjects=qo([]),this.workflows=qo([]),this.latestBySubject=qo({}),this.loading=qo(true),this.loadError=qo(null),this.selectedIds=qo([]),this.launchMode=qo(null),this.inputValues=qo({}),this.launching=qo(false),this.launchError=qo(null),this.confirmation=qo(null),this.confirmationBatchId=qo(null),this.boundWorkflow=Hw(()=>{let e=this.view();return e?this.workflows().find(t=>t.id===e.workflowId)??null:null}),this.canBulkLaunch=Hw(()=>{let e=this.boundWorkflow();return e!=null&&o(e.cardinality)}),this.rows=Hw(()=>{let e=this.latestBySubject();return this.subjects().map(t=>({id:t.id,primaryLabel:t.title,subtitle:this.subjectDetails(t),latestJob:e[t.id]??null}))}),this.route.paramMap.pipe(Rt(this.destroyRef)).subscribe(e=>{let t=e.get("id");if(!t){this.loading.set(false),this.loadError.set(this.transloco.translate("views.detail.loadFailed"));return}this.load(t);});}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}subjectDetails(e){if(e.subjectType==="ticket")return [e.status,e.assignee].filter(Boolean).join(" \xB7 ");if(e.subjectType==="pull_request"){let t=`${e.sourceBranch} \u2192 ${e.targetBranch}`;return e.author?`${e.author} \xB7 ${t}`:t}return e.url??""}onBulkAction(e){this.selectedIds.set(e),this.beginLaunch("manual");}onRowAction(e){let t=this.view(),n=this.boundWorkflow();if(!(!t||!n)){if(n.cardinality==="single"){this.router.navigate(["/jobs/new"],{queryParams:{workflowId:t.workflowId,subjectId:e}});return}this.selectedIds.set([e]),this.beginLaunch("manual");}}beginLaunch(e){e==="manual"&&this.selectedIds().length===0||(this.launchError.set(null),this.confirmation.set(null),this.confirmationBatchId.set(null),this.launchMode.set(e),this.inputValues.set(J(this.boundWorkflow()?.inputSchema??[])));}cancelLaunch(){this.launchMode.set(null),this.launchError.set(null);}setInputValues(e){this.inputValues.set(e);}launch(){let e=this.view(),t=this.boundWorkflow(),n=this.launchMode();if(!e||!t||!n)return;let l=n==="view"?{mode:"view",viewId:e.id}:{mode:"manual",subjectType:e.subjectType,subjectIds:[...this.selectedIds()]};this.launching.set(true),this.launchError.set(null),this.batchesApi.launch({workflowId:t.id,selection:l,triggeredBy:n==="view"?"view_bulk":"multiselect",inputValues:r({},this.inputValues())}).pipe(Rt(this.destroyRef)).subscribe({next:C=>{this.launching.set(false),this.confirmation.set(this.confirmationMessage(C)),this.confirmationBatchId.set(C.kind==="batch"?C.batch.id:null),this.launchMode.set(null),this.refreshLatest(e.workflowId,this.subjects().map(te=>te.id));},error:C=>{this.launching.set(false),this.launchError.set(this.errorMessage(C,this.transloco.translate("views.detail.launchFailed")));}});}confirmationMessage(e){return e.kind==="batch"?this.transloco.translate("views.detail.confirmation.batch",{id:e.batch.id,count:e.batch.jobIds.length}):this.transloco.translate("views.detail.confirmation.job",{id:e.job.id})}load(e){this.loading.set(true),this.loadError.set(null),this.selectedIds.set([]),this.launchMode.set(null),this.confirmation.set(null),this.confirmationBatchId.set(null),Ng({view:this.viewsApi.get(e),subjects:this.viewsApi.getSubjects(e),workflows:this.workflowsApi.list()}).pipe(Rt(this.destroyRef)).subscribe({next:({view:t,subjects:n,workflows:l})=>{this.view.set(t),this.subjects.set(n),this.workflows.set(l),this.loading.set(false),this.refreshLatest(t.workflowId,n.map(C=>C.id));},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,this.transloco.translate("views.detail.loadFailed")));}});}refreshLatest(e,t){(t.length===0?Dg({}):this.jobsApi.latestBySubject(e,t)).pipe(Rt(this.destroyRef)).subscribe({next:l=>this.latestBySubject.set(l),error:()=>this.latestBySubject.set({})});}errorMessage(e,t){return e instanceof qe||e instanceof Error?e.message:t}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-view-detail"]],decls:4,vars:1,consts:[["data-testid","view-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["routerLink","/views"],["data-testid","view-name"],[1,"meta"],["data-testid","view-subject-type"],["data-testid","bound-workflow"],["nz-button","","data-testid","edit-view",3,"routerLink"],[1,"toolbar"],["nz-button","","nzType","primary","type","button","data-testid","run-on-all",3,"click","disabled"],["data-testid","launch-panel",1,"launch-panel"],["data-testid","empty-subjects",1,"muted"],[3,"rows","selectable"],["data-testid","launch-confirmation","nzType","success",3,"nzMessage"],["nz-button","","nzType","link","data-testid","open-batch",3,"routerLink"],["data-testid","no-bulk-workflows",1,"muted"],["data-testid","launch-workflow",1,"muted"],[3,"valuesChange","fields","values"],["data-testid","launch-error",1,"error"],[1,"launch-actions"],["nz-button","","nzType","primary","type","button","data-testid","launch-submit",3,"click","nzLoading","disabled"],["nz-button","","type","button","data-testid","launch-cancel",3,"click"],[3,"rowAction","bulkAction","rows","selectable"]],template:function(t,n){if(t&1&&(_i(0,"main",0),bD(1,oe,3,3,"p",1)(2,ae,2,1,"p",2)(3,_e,23,21),Kc()),t&2){let l;gI(),_D(n.loading()?1:n.loadError()?2:(l=n.view())?3:-1,l);}},dependencies:[Fn,Mt,Gn,un,sd,zc,t7,y7,K,he$1,ec],styles:[".detail-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:.25rem 0 0}.meta[_ngcontent-%COMP%]{margin:.25rem 0 0;color:#57534e}.toolbar[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.75rem;align-items:flex-end}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;min-width:14rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.launch-panel[_ngcontent-%COMP%]{padding:1rem;border:1px solid #d6d3d1;background:#ffffffb3}.launch-panel[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem}.launch-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;margin-top:.5rem}.muted[_ngcontent-%COMP%]{color:#78716c}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return i})();export{Pe as ViewDetailComponent};
@@ -1 +0,0 @@
1
- import {_ as _n,C as Cn}from'./chunk-BqWiMcNp.js';import {U}from'./chunk-VW6e_Kls.js';import {W,I}from'./chunk-CECejZs9.js';import {d as dr,c as ca,r as rr,o as oa,s as sr,V as Vn,p as pa}from'./chunk-BaL0hYvK.js';import'./chunk-Ca9rxJZS.js';import'./chunk-DS5k0b_s.js';import {C,a as ar,b as at,q as qo,R as Rt$1,c as qe,Q as QE,F as Fn,n as n8,J as J6,k as k3,M as Mt,d as sd,z as zc,e as t7,$ as $b,V as V5,D as D5,f as ec,g as _i,v as vw,h as Rw,K as Kc,m as bD,p as gI,P as Ph,O as Ow,u as nl,A as _D,B as VD,L as LD,j as gh,N as ND,S as SD,o as oE,w as ch,x as sE,y as xD,l as lh,a5 as ah,a2 as Pw,a3 as xw,E as Pu,G as Lu}from'./main-5C7K2447.js';var dt=e=>({count:e}),st=e=>["/workflows",e,"edit"],pt=(e,p)=>p.id;function ct(e,p){e&1&&(_i(0,"p",3),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function mt(e,p){if(e&1&&(_i(0,"p",4),vw(1),Kc()),e&2){let t=VD();gI(),Ph(t.loadError());}}function ft(e,p){if(e&1&&(lh(0,"nz-option",7),Rw(1,"transloco")),e&2){let t=p.$implicit,o=VD(2);ch("nzValue",t)("nzLabel",Ow(1,2,o.cardinalityFilterKey(t)));}}function wt(e,p){if(e&1&&(_i(0,"p",8),vw(1),Kc()),e&2){let t=VD(2);gI(),Ph(t.deleteError());}}function _t(e,p){e&1&&(_i(0,"section",9)(1,"p"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"a",11),vw(5),Rw(6,"transloco"),Kc()()),e&2&&(gI(2),Ph(Ow(3,2,"workflows.list.emptyState")),gI(3),nl(" ",Ow(6,4,"workflows.list.emptyCreateButton")," "));}function ut(e,p){if(e&1&&(_i(0,"span"),vw(1),Kc()),e&2){let t=VD().$implicit;ah("data-testid","description-"+t.id),gI(),Ph(t.description);}}function xt(e,p){if(e&1&&(_i(0,"span",13),vw(1),Rw(2,"transloco"),Kc()),e&2){let t=VD().$implicit;ah("data-testid","description-"+t.id),gI(),Ph(Ow(2,2,"workflows.list.noDescription"));}}function Ct(e,p){if(e&1&&(_i(0,"nz-tag"),vw(1),Rw(2,"transloco"),Kc()),e&2){let t=p.$implicit,o=VD().$implicit,m=VD(3);ah("data-testid","applies-to-"+o.id),gI(),Ph(Ow(2,2,m.subjectTypeKey(t)));}}function gt(e,p){if(e&1){let t=LD();_i(0,"tr")(1,"td")(2,"span"),vw(3),Kc()(),_i(4,"td",12),bD(5,ut,2,2,"span")(6,xt,3,4,"span",13),Kc(),_i(7,"td"),ND(8,Ct,3,4,"nz-tag",null,SD),Kc(),_i(10,"td")(11,"nz-tag"),vw(12),Rw(13,"transloco"),Kc()(),_i(14,"td")(15,"span"),vw(16),Rw(17,"transloco"),Kc()(),_i(18,"td",14)(19,"a",15),vw(20),Rw(21,"transloco"),Kc(),_i(22,"button",16),Rw(23,"transloco"),Rw(24,"transloco"),Rw(25,"transloco"),gh("nzOnConfirm",function(){let m=Pu(t).$implicit,h=VD(3);return Lu(h.deleteWorkflow(m.id))}),vw(26),Rw(27,"transloco"),Kc()()();}if(e&2){let t=p.$implicit,o=VD(3);ah("data-testid","workflow-"+t.id),gI(2),ah("data-testid","name-"+t.id),gI(),Ph(t.name),gI(2),_D(t.description?.trim()?5:6),gI(3),xD(o.appliesToValues(t)),gI(3),ah("data-testid","cardinality-"+t.id),gI(),Ph(Ow(13,16,o.cardinalityKey(t.cardinality))),gI(3),ah("data-testid","step-count-"+t.id),gI(),Ph(Pw(17,18,"workflows.list.stepCount",xw(31,dt,t.steps.length))),gI(3),ch("routerLink",xw(33,st,t.id)),ah("data-testid","edit-"+t.id),gI(),nl(" ",Ow(21,21,"workflows.list.edit")," "),gI(2),ch("nzPopconfirmTitle",Ow(23,23,"workflows.list.deleteConfirm"))("nzOkText",Ow(24,25,"workflows.list.delete"))("nzCancelText",Ow(25,27,"common.cancel")),ah("data-testid","delete-"+t.id),gI(4),nl(" ",Ow(27,29,"workflows.list.delete")," ");}}function kt(e,p){if(e&1&&(_i(0,"nz-table",10)(1,"thead")(2,"tr")(3,"th"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"th"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"th"),vw(10),Rw(11,"transloco"),Kc(),_i(12,"th"),vw(13),Rw(14,"transloco"),Kc(),_i(15,"th"),vw(16),Rw(17,"transloco"),Kc(),_i(18,"th"),vw(19),Rw(20,"transloco"),Kc()()(),_i(21,"tbody"),ND(22,gt,28,35,"tr",null,pt),Kc()()),e&2){let t=VD(2);ch("nzData",t.workflows())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Ph(Ow(5,9,"workflows.list.column.name")),gI(3),Ph(Ow(8,11,"workflows.list.column.description")),gI(3),Ph(Ow(11,13,"workflow-editor.appliesTo")),gI(3),Ph(Ow(14,15,"workflow-editor.cardinality.label")),gI(3),Ph(Ow(17,17,"workflows.list.column.steps")),gI(3),Ph(Ow(20,19,"workflows.list.column.actions")),gI(3),xD(t.workflows());}}function yt(e,p){if(e&1){let t=LD();_i(0,"div",5)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",6),gh("ngModelChange",function(m){Pu(t);let h=VD();return Lu(h.setCardinalityFilter(m))}),ND(5,ft,2,4,"nz-option",7,SD),Kc(),oE(),Kc(),bD(7,wt,2,1,"p",8),bD(8,_t,7,6,"section",9)(9,kt,24,21,"nz-table",10);}if(e&2){let t=VD();gI(2),Ph(Ow(3,4,"workflows.list.filterByLaunchMode")),gI(2),ch("ngModel",t.cardinalityFilter()),sE(),gI(),xD(t.cardinalityOptions),gI(2),_D(t.deleteError()?7:-1),gI(),_D(t.workflows().length===0?8:9);}}var Rt=(()=>{class e{constructor(){this.workflowsApi=C(U),this.transloco=C(ar),this.destroyRef=C(at),this.workflows=qo([]),this.loading=qo(true),this.loadError=qo(null),this.deleteError=qo(null),this.cardinalityFilter=qo("all"),this.cardinalityOptions=["all","single","batch","aggregate"],this.load();}setCardinalityFilter(t){this.cardinalityFilter.set(t),this.load();}appliesToValues(t){let o=t.appliesTo;return o==="none"?["none"]:Array.isArray(o)?o:[o]}subjectTypeKey(t){return `workflow-editor.subjectType.${t}`}cardinalityKey(t){return `workflow-editor.cardinality.${t}`}cardinalityFilterKey(t){return t==="all"?"workflows.list.filterAll":`workflow-editor.cardinality.${t}`}deleteWorkflow(t){this.deleteError.set(null),this.workflowsApi.delete(t).pipe(Rt$1(this.destroyRef)).subscribe({next:()=>{this.workflows.update(o=>o.filter(m=>m.id!==t));},error:o=>{this.deleteError.set(this.errorMessage(o,this.transloco.translate("workflows.list.deleteFailed")));}});}load(){let t=this.cardinalityFilter();this.loading.set(true),this.loadError.set(null),this.workflowsApi.list(t==="all"?void 0:{cardinality:t}).pipe(Rt$1(this.destroyRef)).subscribe({next:o=>{this.workflows.set(o),this.loading.set(false);},error:o=>{this.loading.set(false),this.loadError.set(this.errorMessage(o,this.transloco.translate("workflows.list.loadFailed")));}});}errorMessage(t,o){return t instanceof qe||t instanceof Error?t.message:o}static{this.\u0275fac=function(o){return new(o||e)};}static{this.\u0275cmp=QE({type:e,selectors:[["app-workflow-list"]],decls:11,vars:7,consts:[["data-testid","workflows-list",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","routerLink","/workflows/new","data-testid","create-workflow"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"field"],["data-testid","cardinality-filter",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["data-testid","delete-error",1,"error"],["data-testid","empty-state",1,"empty"],["data-testid","workflow-items",3,"nzData","nzFrontPagination","nzShowPagination"],["nz-button","","nzType","primary","routerLink","/workflows/new","data-testid","empty-create"],[1,"description-cell"],[1,"muted"],[1,"actions"],["nz-button","","nzType","link",3,"routerLink"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(o,m){o&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"a",2),vw(6),Rw(7,"transloco"),Kc()(),bD(8,ct,3,3,"p",3)(9,mt,2,1,"p",4)(10,yt,10,6),Kc()),o&2&&(gI(3),Ph(Ow(4,3,"workflows.list.title")),gI(3),nl(" ",Ow(7,5,"workflows.list.createButton")," "),gI(2),_D(m.loading()?8:m.loadError()?9:10));},dependencies:[Fn,n8,J6,k3,Mt,sd,zc,t7,_n,Cn,$b,V5,D5,dr,ca,rr,oa,sr,Vn,pa,W,I,ec],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;max-width:16rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.muted[_ngcontent-%COMP%]{color:#a8a29e;font-style:italic}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}[_nghost-%COMP%] td.description-cell{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;text-overflow:unset;max-width:28rem;vertical-align:top}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return e})();export{Rt as WorkflowListComponent};
@@ -1 +0,0 @@
1
- import {_ as _n}from'./chunk-BqWiMcNp.js';import {h as he}from'./chunk-99HzEG7y.js';import {C,ba as u,U as U$1,I as ue,a as ar,b as at,q as qo,H as Hw,R as Rt,a9 as Ng,c as qe,Q as QE,F as Fn,M as Mt,d as sd,z as zc,e as t7,f as ec,g as _i,v as vw,h as Rw,K as Kc,m as bD,p as gI,P as Ph,O as Ow,u as nl,A as _D,B as VD,L as LD,j as gh,w as ch,E as Pu,G as Lu}from'./main-5C7K2447.js';import {U}from'./chunk-VW6e_Kls.js';import'./chunk-BaL0hYvK.js';import'./chunk-Ca9rxJZS.js';import'./chunk-DS5k0b_s.js';function q(i,b){i&1&&(_i(0,"p",3),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function G(i,b){if(i&1&&(_i(0,"p",4),vw(1),Kc()),i&2){let t=VD();gI(),Ph(t.loadError());}}function H(i,b){if(i&1&&(_i(0,"p",5),vw(1),Kc()),i&2){let t=VD(2);gI(),Ph(t.actionError());}}function K(i,b){i&1&&(_i(0,"section",6)(1,"p"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"a",8),vw(5),Rw(6,"transloco"),Kc()()),i&2&&(gI(2),Ph(Ow(3,2,"shortcuts.list.emptyState")),gI(3),nl(" ",Ow(6,4,"shortcuts.list.emptyCreateButton")," "));}function Q(i,b){if(i&1){let t=LD();_i(0,"app-runnable-items-table",9),gh("rowAction",function(e){Pu(t);let c=VD(2);return Lu(c.onRowAction(e))}),Kc();}if(i&2){let t=VD(2);ch("rows",t.rows())("selectable",false);}}function X(i,b){if(i&1&&(bD(0,H,2,1,"p",5),bD(1,K,7,6,"section",6)(2,Q,1,2,"app-runnable-items-table",7)),i&2){let t=VD();_D(t.actionError()?0:-1),gI(),_D(t.shortcuts().length===0?1:2);}}var ht=(()=>{class i{constructor(){this.shortcutsApi=C(u),this.workflowsApi=C(U),this.jobsApi=C(U$1),this.router=C(ue),this.transloco=C(ar),this.destroyRef=C(at),this.shortcuts=qo([]),this.workflows=qo([]),this.jobsById=qo({}),this.loading=qo(true),this.loadError=qo(null),this.actionError=qo(null),this.rows=Hw(()=>{let t=this.jobsById(),o=this.workflows();return this.shortcuts().map(e=>({id:e.id,primaryLabel:e.name,subtitle:o.find(c=>c.id===e.workflowId)?.name,latestJob:e.lastJobId?t[e.lastJobId]??null:null}))}),this.load();}onRowAction(t){let o=this.shortcuts().find(e=>e.id===t);o&&(this.actionError.set(null),this.jobsApi.start({workflowId:o.workflowId,inputValues:o.inputValues}).pipe(Rt(this.destroyRef)).subscribe({next:e=>{this.shortcutsApi.update(o.id,{lastJobId:e.id}).pipe(Rt(this.destroyRef)).subscribe({next:c=>{this.shortcuts.update(W=>W.map(C=>C.id===c.id?c:C)),this.router.navigate(["/jobs",e.id]);},error:()=>{this.router.navigate(["/jobs",e.id]);}});},error:e=>{this.actionError.set(this.errorMessage(e,this.transloco.translate("shortcuts.list.runFailed")));}}));}deleteShortcut(t){this.actionError.set(null),this.shortcutsApi.delete(t).pipe(Rt(this.destroyRef)).subscribe({next:()=>{this.shortcuts.update(o=>o.filter(e=>e.id!==t));},error:o=>{this.actionError.set(this.errorMessage(o,this.transloco.translate("shortcuts.list.deleteFailed")));}});}load(){this.loading.set(true),this.loadError.set(null),Ng({shortcuts:this.shortcutsApi.list(),workflows:this.workflowsApi.list()}).pipe(Rt(this.destroyRef)).subscribe({next:({shortcuts:t,workflows:o})=>{this.shortcuts.set(t),this.workflows.set(o),this.loading.set(false),this.loadLatestJobs(t);},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,this.transloco.translate("shortcuts.list.loadFailed")));}});}loadLatestJobs(t){let o=t.map(e=>e.lastJobId).filter(e=>e!=null);if(o.length===0){this.jobsById.set({});return}Ng(Object.fromEntries(o.map(e=>[e,this.jobsApi.get(e)]))).pipe(Rt(this.destroyRef)).subscribe({next:e=>this.jobsById.set(e),error:()=>this.jobsById.set({})});}errorMessage(t,o){return t instanceof qe||t instanceof Error?t.message:o}static{this.\u0275fac=function(o){return new(o||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-shortcut-list"]],decls:11,vars:7,consts:[["data-testid","shortcuts-list",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","routerLink","/shortcuts/new","data-testid","create-shortcut"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","action-error",1,"error"],["data-testid","empty-state",1,"empty"],[3,"rows","selectable"],["nz-button","","nzType","primary","routerLink","/shortcuts/new","data-testid","empty-create"],[3,"rowAction","rows","selectable"]],template:function(o,e){o&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"a",2),vw(6),Rw(7,"transloco"),Kc()(),bD(8,q,3,3,"p",3)(9,G,2,1,"p",4)(10,X,3,2),Kc()),o&2&&(gI(3),Ph(Ow(4,3,"shortcuts.list.title")),gI(3),nl(" ",Ow(7,5,"shortcuts.list.createButton")," "),gI(2),_D(e.loading()?8:e.loadError()?9:10));},dependencies:[Fn,Mt,sd,zc,t7,_n,he,ec],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();export{ht as ShortcutListComponent};
@@ -1 +0,0 @@
1
- import {j}from'./chunk--cAlvNjP.js';import {f as fr,K as Ki,x}from'./chunk-C5kOvUkS.js';import {w as w$}from'./chunk-CbG3rfKf.js';import {C,W,I as ue$1,ba as u,b as at,a as ar,ac as O,ad as Zn,ae as Se,q as qo,H as Hw,R as Rt,r,c as qe,Q as QE,F as Fn,n as n8,af as S4,J as J6,k as k3,M as Mt,d as sd,z as zc,e as t7,Z as y7,$ as $b,V as V5,D as D5,f as ec,g as _i,v as vw,K as Kc,h as Rw,j as gh,m as bD,p as gI,P as Ph,O as Ow,w as ch,u as nl,A as _D,B as VD,L as LD,o as oE,N as ND,x as sE,y as xD,S as SD,l as lh,E as Pu,G as Lu}from'./main-5C7K2447.js';import {J,K}from'./chunk-D6KYmz2w.js';import {U}from'./chunk-VW6e_Kls.js';import'./chunk-DS5k0b_s.js';var me=(t,s)=>s.id;function ue(t,s){t&1&&(_i(0,"p",5),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function he(t,s){if(t&1&&(_i(0,"p",6),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function fe(t,s){if(t&1&&(_i(0,"li"),vw(1),Kc()),t&2){let e=s.$implicit;gI(),Ph(e);}}function ge(t,s){if(t&1&&(_i(0,"section",7)(1,"h2"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"ul"),ND(5,fe,2,1,"li",null,SD),Kc()()),t&2){let e=VD(2);gI(2),Ph(Ow(3,1,"shortcuts.editor.validation")),gI(3),xD(e.validationErrors());}}function _e(t,s){if(t&1&&lh(0,"nz-option",11),t&2){let e=s.$implicit;ch("nzValue",e.id)("nzLabel",e.name);}}function we(t,s){if(t&1){let e=LD();_i(0,"app-workflow-input-form",13),gh("valuesChange",function(i){Pu(e);let u=VD(2);return Lu(u.setInputValues(i))}),Kc();}if(t&2){let e=VD(2);ch("fields",s.inputSchema)("values",e.inputValues());}}function ve(t,s){if(t&1){let e=LD();bD(0,ge,7,3,"section",7),_i(1,"label",8)(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"input",9),gh("ngModelChange",function(i){Pu(e);let u=VD();return Lu(u.name.set(i))}),Kc(),oE(),Kc(),_i(6,"div",8)(7,"span"),vw(8),Rw(9,"transloco"),Kc(),_i(10,"nz-select",10),gh("ngModelChange",function(i){Pu(e);let u=VD();return Lu(u.onWorkflowChange(i))}),ND(11,_e,1,2,"nz-option",11,me),Kc(),oE(),Kc(),bD(13,we,1,2,"app-workflow-input-form",12);}if(t&2){let e,o=VD();_D(o.validationErrors().length>0?0:-1),gI(3),Ph(Ow(4,6,"shortcuts.editor.name")),gI(2),ch("ngModel",o.name()),sE(),gI(3),Ph(Ow(9,8,"shortcuts.editor.workflow")),gI(2),ch("ngModel",o.workflowId()),sE(),gI(),xD(o.eligibleWorkflows()),gI(2),_D((e=o.selectedWorkflow())?13:-1,e);}}function Ce(t){let s=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),e=crypto.randomUUID().slice(0,8);return s.length>0?`sc-${s}-${e}`:`sc-${e}`}var Ze=(()=>{class t{constructor(){this.route=C(W),this.router=C(ue$1),this.shortcutsApi=C(u),this.workflowsApi=C(U),this.message=C(fr),this.destroyRef=C(at),this.transloco=C(ar),this.language=C(O),this.routeId=Zn(this.route.paramMap.pipe(Se(e=>e.get("id"))),{initialValue:this.route.snapshot.paramMap.get("id")}),this.name=qo(""),this.workflowId=qo(""),this.workflows=qo([]),this.inputValues=qo({}),this.lastJobId=qo(void 0),this.loadError=qo(null),this.validationErrors=qo([]),this.saving=qo(false),this.loading=qo(true),this.isNew=Hw(()=>!this.routeId()),this.pageTitle=Hw(()=>(this.language.currentLang(),this.isNew()?this.transloco.translate("shortcuts.editor.titleNew"):this.transloco.translate("shortcuts.editor.titleEdit",{id:this.routeId()}))),this.eligibleWorkflows=Hw(()=>this.workflows().filter(e=>e.appliesTo==="none"&&e.cardinality==="single")),this.selectedWorkflow=Hw(()=>this.eligibleWorkflows().find(e=>e.id===this.workflowId())??null),this.workflowsApi.list().pipe(Rt(this.destroyRef)).subscribe({next:e=>this.workflows.set(e),error:e=>{this.workflows.set([]),this.message.error(this.errorMessage(e,this.transloco.translate("shortcuts.editor.loadFailed")));}}),this.route.paramMap.pipe(Rt(this.destroyRef)).subscribe(e=>{let o=e.get("id");if(this.validationErrors.set([]),this.loadError.set(null),!o){this.name.set(""),this.workflowId.set(""),this.inputValues.set({}),this.lastJobId.set(void 0),this.loading.set(false);return}this.loading.set(true),this.shortcutsApi.get(o).subscribe({next:i=>{this.name.set(i.name),this.workflowId.set(i.workflowId),this.inputValues.set(i.inputValues),this.lastJobId.set(i.lastJobId),this.loading.set(false);},error:i=>{this.loading.set(false),this.loadError.set(this.errorMessage(i,this.transloco.translate("shortcuts.editor.loadFailed")));}});});}onWorkflowChange(e){this.workflowId.set(e);let o=this.eligibleWorkflows().find(i=>i.id===e);this.inputValues.set(J(o?.inputSchema??[]));}setInputValues(e){this.inputValues.set(e);}save(){let e=this.routeId(),o=r({id:e??Ce(this.name()),name:this.name().trim(),workflowId:this.workflowId(),inputValues:this.inputValues()},this.lastJobId()?{lastJobId:this.lastJobId()}:{}),i=w$.safeParse(o);if(!i.success){this.validationErrors.set(j(i.error));return}this.validationErrors.set([]),this.saving.set(true),(this.isNew()||!e?this.shortcutsApi.create(i.data):this.shortcutsApi.update(e,i.data)).subscribe({next:b=>{this.saving.set(false),this.message.success(this.transloco.translate(this.isNew()?"shortcuts.editor.created":"shortcuts.editor.saved")),this.isNew()&&this.router.navigate(["/shortcuts",b.id,"edit"]);},error:b=>{this.saving.set(false),this.message.error(this.errorMessage(b,this.transloco.translate("shortcuts.editor.saveFailed")));}});}errorMessage(e,o){return e instanceof qe||e instanceof Error?e.message:o}static{this.\u0275fac=function(o){return new(o||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-shortcut-editor"]],decls:15,vars:10,consts:[["data-testid","shortcut-editor",1,"editor"],[1,"header"],[1,"header-actions"],["routerLink","/shortcuts"],["nz-button","","nzType","primary","type","button","data-testid","save-button",3,"click","nzLoading","disabled"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","validation-errors",1,"errors"],[1,"field"],["nz-input","","data-testid","shortcut-name",3,"ngModelChange","ngModel"],["data-testid","shortcut-workflow",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],[3,"fields","values"],[3,"valuesChange","fields","values"]],template:function(o,i){o&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),vw(4),Kc()(),_i(5,"div",2)(6,"a",3),vw(7),Rw(8,"transloco"),Kc(),_i(9,"button",4),gh("click",function(){return i.save()}),vw(10),Rw(11,"transloco"),Kc()()(),bD(12,ue,3,3,"p",5)(13,he,2,1,"p",6)(14,ve,14,10),Kc()),o&2&&(gI(4),Ph(i.pageTitle()),gI(3),Ph(Ow(8,6,"shortcuts.editor.backToList")),gI(2),ch("nzLoading",i.saving())("disabled",i.loading()||!!i.loadError()),gI(),nl(" ",Ow(11,8,"common.save")," "),gI(2),_D(i.loading()?12:i.loadError()?13:14));},dependencies:[Fn,n8,S4,J6,k3,Mt,sd,zc,t7,y7,Ki,x,$b,V5,D5,K,ec],styles:[".editor[_ngcontent-%COMP%]{max-width:40rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.errors[_ngcontent-%COMP%]{border:1px solid #fecdd3;background:#fff1f2;padding:.75rem 1rem}.errors[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .35rem;font-size:1rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return t})();export{Ze as ShortcutEditorComponent};
@@ -1 +0,0 @@
1
- import {u}from'./chunk-4TrlkpZx.js';import {_ as _n,C as Cn}from'./chunk-BqWiMcNp.js';import'./chunk-CbG3rfKf.js';import {C,aZ as U,a as ar,b as at,q as qo,R as Rt,a9 as Ng,c as qe,Q as QE,F as Fn,M as Mt,d as sd,z as zc,e as t7,f as ec,g as _i,v as vw,h as Rw,K as Kc,m as bD,p as gI,P as Ph,O as Ow,u as nl,A as _D,B as VD,N as ND,w as ch,y as xD,L as LD,j as gh,a5 as ah,a3 as xw,E as Pu,G as Lu}from'./main-5C7K2447.js';import {U as U$1}from'./chunk-VW6e_Kls.js';import {W,I}from'./chunk-CECejZs9.js';import {d as dr,c as ca,r as rr,o as oa,s as sr,V as Vn,p as pa}from'./chunk-BaL0hYvK.js';import'./chunk-Ca9rxJZS.js';import'./chunk-DS5k0b_s.js';var ee=t=>["/views",t],te=t=>["/views",t,"edit"],ie=(t,p)=>p.id;function ne(t,p){t&1&&(_i(0,"p",3),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function oe(t,p){if(t&1&&(_i(0,"p",4),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function re(t,p){if(t&1&&(_i(0,"p",5),vw(1),Kc()),t&2){let e=VD(2);gI(),Ph(e.deleteError());}}function ae(t,p){t&1&&(_i(0,"section",6)(1,"p"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"a",8),vw(5),Rw(6,"transloco"),Kc()()),t&2&&(gI(2),Ph(Ow(3,2,"views.list.emptyState")),gI(3),nl(" ",Ow(6,4,"views.list.emptyCreateButton")," "));}function le(t,p){if(t&1){let e=LD();_i(0,"tr")(1,"td")(2,"a",9),vw(3),Kc()(),_i(4,"td")(5,"nz-tag"),vw(6),Rw(7,"transloco"),Kc()(),_i(8,"td")(9,"nz-tag"),vw(10),Kc()(),_i(11,"td",10)(12,"code"),vw(13),Kc()(),_i(14,"td",11)(15,"a",12),vw(16),Rw(17,"transloco"),Kc(),_i(18,"button",13),Rw(19,"transloco"),Rw(20,"transloco"),Rw(21,"transloco"),gh("nzOnConfirm",function(){let u=Pu(e).$implicit,Z=VD(3);return Lu(Z.deleteView(u.id))}),vw(22),Rw(23,"transloco"),Kc()()();}if(t&2){let e=p.$implicit,r=VD(3);ah("data-testid","view-"+e.id),gI(2),ch("routerLink",xw(30,ee,e.id)),ah("data-testid","name-"+e.id),gI(),nl(" ",e.name," "),gI(2),ah("data-testid","subject-type-"+e.id),gI(),Ph(Ow(7,18,r.subjectTypeKey(e.subjectType))),gI(3),ah("data-testid","workflow-"+e.id),gI(),Ph(r.workflowName(e)),gI(2),ah("data-testid","query-"+e.id),gI(),Ph(r.queryText(e)),gI(2),ch("routerLink",xw(32,te,e.id)),ah("data-testid","edit-"+e.id),gI(),nl(" ",Ow(17,20,"views.list.edit")," "),gI(2),ch("nzPopconfirmTitle",Ow(19,22,"views.list.deleteConfirm"))("nzOkText",Ow(20,24,"views.list.delete"))("nzCancelText",Ow(21,26,"common.cancel")),ah("data-testid","delete-"+e.id),gI(4),nl(" ",Ow(23,28,"views.list.delete")," ");}}function se(t,p){if(t&1&&(_i(0,"nz-table",7)(1,"thead")(2,"tr")(3,"th"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"th"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"th"),vw(10),Rw(11,"transloco"),Kc(),_i(12,"th"),vw(13),Rw(14,"transloco"),Kc(),_i(15,"th"),vw(16),Rw(17,"transloco"),Kc()()(),_i(18,"tbody"),ND(19,le,24,34,"tr",null,ie),Kc()()),t&2){let e=VD(2);ch("nzData",e.views())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Ph(Ow(5,8,"views.list.column.name")),gI(3),Ph(Ow(8,10,"views.list.column.subjectType")),gI(3),Ph(Ow(11,12,"views.list.column.workflow")),gI(3),Ph(Ow(14,14,"views.list.column.query")),gI(3),Ph(Ow(17,16,"views.list.column.actions")),gI(3),xD(e.views());}}function de(t,p){if(t&1&&(bD(0,re,2,1,"p",5),bD(1,ae,7,6,"section",6)(2,se,21,18,"nz-table",7)),t&2){let e=VD();_D(e.deleteError()?0:-1),gI(),_D(e.views().length===0?1:2);}}var Be=(()=>{class t{constructor(){this.viewsApi=C(U),this.workflowsApi=C(U$1),this.transloco=C(ar),this.destroyRef=C(at),this.views=qo([]),this.workflows=qo([]),this.loading=qo(true),this.loadError=qo(null),this.deleteError=qo(null),this.load();}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}workflowName(e){return this.workflows().find(r=>r.id===e.workflowId)?.name??e.workflowId}queryText(e){return u(e.query)}deleteView(e){this.deleteError.set(null),this.viewsApi.delete(e).pipe(Rt(this.destroyRef)).subscribe({next:()=>{this.views.update(r=>r.filter(u=>u.id!==e));},error:r=>{this.deleteError.set(this.errorMessage(r,this.transloco.translate("views.list.deleteFailed")));}});}load(){this.loading.set(true),this.loadError.set(null),Ng({views:this.viewsApi.list(),workflows:this.workflowsApi.list()}).pipe(Rt(this.destroyRef)).subscribe({next:({views:e,workflows:r})=>{this.views.set(e),this.workflows.set(r),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("views.list.loadFailed")));}});}errorMessage(e,r){return e instanceof qe||e instanceof Error?e.message:r}static{this.\u0275fac=function(r){return new(r||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-view-list"]],decls:11,vars:7,consts:[["data-testid","views-list",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","routerLink","/views/new","data-testid","create-view"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","delete-error",1,"error"],["data-testid","empty-state",1,"empty"],["data-testid","view-items",3,"nzData","nzFrontPagination","nzShowPagination"],["nz-button","","nzType","primary","routerLink","/views/new","data-testid","empty-create"],[3,"routerLink"],[1,"query-cell"],[1,"actions"],["nz-button","","nzType","link",3,"routerLink"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(r,u){r&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"a",2),vw(6),Rw(7,"transloco"),Kc()(),bD(8,ne,3,3,"p",3)(9,oe,2,1,"p",4)(10,de,3,2),Kc()),r&2&&(gI(3),Ph(Ow(4,3,"views.list.title")),gI(3),nl(" ",Ow(7,5,"views.list.createButton")," "),gI(2),_D(u.loading()?8:u.loadError()?9:10));},dependencies:[Fn,Mt,sd,zc,t7,_n,Cn,dr,ca,rr,oa,sr,Vn,pa,W,I,ec],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}[_nghost-%COMP%] td.query-cell{overflow-wrap:anywhere;word-break:break-word;max-width:28rem;vertical-align:top}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}code[_ngcontent-%COMP%]{font-family:ui-monospace,Consolas,monospace;font-size:.85rem}"]});}}return t})();export{Be as ViewListComponent};
@@ -1 +0,0 @@
1
- import {J,K as K$1}from'./chunk-D6KYmz2w.js';import {U}from'./chunk-VW6e_Kls.js';import {C,U as U$1,I as ue,a as ar,W,q as qo,H as Hw,s,r,c as qe,Q as QE,F as Fn,M as Mt,f as ec,g as _i,v as vw,h as Rw,K as Kc,m as bD,j as gh,N as ND,p as gI,P as Ph,O as Ow,A as _D,u as nl,w as ch,y as xD,B as VD,T as Lh,L as LD,E as Pu,G as Lu}from'./main-5C7K2447.js';var L=(t,p)=>p.id;function $(t,p){if(t&1&&(_i(0,"p",3),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function z(t,p){if(t&1&&(_i(0,"option",6),vw(1),Kc()),t&2){let e=p.$implicit;ch("value",e.id),gI(),Lh("",e.name," (",e.id,")");}}function G(t,p){if(t&1){let e=LD();_i(0,"label"),vw(1),Rw(2,"transloco"),_i(3,"input",10),Rw(4,"transloco"),gh("input",function(o){Pu(e);let s=VD(2);return Lu(s.setSubjectId(o))}),Kc()();}if(t&2){let e=VD(2);gI(),nl(" ",Ow(2,3,"jobs.start.subjectId")," "),gI(2),ch("value",e.subjectId())("placeholder",Ow(4,5,"jobs.start.subjectIdPlaceholder"));}}function H(t,p){if(t&1){let e=LD();bD(0,G,5,7,"label"),_i(1,"app-workflow-input-form",9),gh("valuesChange",function(o){Pu(e);let s=VD();return Lu(s.inputValues.set(o))}),Kc();}if(t&2){let e=VD();_D(e.needsSubjectId()?0:-1),gI(),ch("fields",p.inputSchema)("values",e.inputValues());}}function K(t,p){if(t&1&&(_i(0,"p",8),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.actionError());}}var re=(()=>{class t{constructor(){this.workflowsApi=C(U),this.jobsApi=C(U$1),this.router=C(ue),this.transloco=C(ar),this.route=C(W),this.workflows=qo([]),this.selectedWorkflowId=qo(""),this.subjectId=qo(""),this.inputValues=qo({}),this.loadError=qo(null),this.actionError=qo(null),this.starting=qo(false),this.selectedWorkflow=Hw(()=>this.workflows().find(e=>e.id===this.selectedWorkflowId())??null),this.needsSubjectId=Hw(()=>{let e=this.selectedWorkflow();return e!=null&&e.appliesTo!=="none"}),this.workflowsApi.list({cardinality:"single"}).subscribe({next:e=>{this.workflows.set(e);let n=this.route.snapshot.queryParamMap.get("workflowId"),o=n&&e.some(C=>C.id===n)?n:e[0]?.id;o&&this.selectWorkflow(o);let s=this.route.snapshot.queryParamMap.get("subjectId");s&&this.subjectId.set(s);},error:e=>{this.loadError.set(this.errorMessage(e,this.transloco.translate("jobs.errors.loadWorkflows")));}});}selectWorkflow(e){this.selectedWorkflowId.set(e);let n=this.workflows().find(o=>o.id===e);this.inputValues.set(J(n?.inputSchema??[])),this.actionError.set(null);}onWorkflowChange(e){let n=e.target.value;this.selectWorkflow(n);}setSubjectId(e){this.subjectId.set(e.target.value);}start(){let e=this.selectedWorkflow();if(e){if(this.needsSubjectId()&&!this.subjectId().trim()){this.actionError.set(this.transloco.translate("jobs.errors.subjectIdRequired"));return}this.actionError.set(null),this.starting.set(true),this.jobsApi.start(s(r({workflowId:e.id},this.needsSubjectId()?{subjectId:this.subjectId().trim()}:{}),{inputValues:r({},this.inputValues())})).subscribe({next:n=>{this.starting.set(false),this.router.navigate(["/jobs",n.id]);},error:n=>{this.starting.set(false),this.actionError.set(this.errorMessage(n,this.transloco.translate("jobs.errors.startFailed")));}});}}errorMessage(e,n){return e instanceof qe||e instanceof Error?e.message:n}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-job-runner"]],decls:26,vars:23,consts:[[1,"runner"],["routerLink","/jobs"],[1,"lede"],["data-testid","load-error",1,"error"],["data-testid","start-form",1,"panel"],["data-testid","workflow-select",3,"change","value"],[3,"value"],["data-testid","start-button","type","button",3,"click","disabled"],["data-testid","action-error",1,"error"],[3,"valuesChange","fields","values"],["data-testid","subject-id","type","text",3,"input","value","placeholder"]],template:function(n,o){if(n&1&&(_i(0,"main",0)(1,"a",1),vw(2),Rw(3,"transloco"),Kc(),_i(4,"h1"),vw(5),Rw(6,"transloco"),Kc(),_i(7,"p",2),vw(8),Rw(9,"transloco"),Kc(),bD(10,$,2,1,"p",3),_i(11,"section",4)(12,"h2"),vw(13),Rw(14,"transloco"),Kc(),_i(15,"label"),vw(16),Rw(17,"transloco"),_i(18,"select",5),gh("change",function(C){return o.onWorkflowChange(C)}),ND(19,z,2,3,"option",6,L),Kc()(),bD(21,H,2,3),_i(22,"button",7),gh("click",function(){return o.start()}),vw(23),Rw(24,"transloco"),Kc()(),bD(25,K,2,1,"p",8),Kc()),n&2){let s;gI(2),Ph(Ow(3,11,"jobs.detail.backToStart")),gI(3),Ph(Ow(6,13,"jobs.title")),gI(3),Ph(Ow(9,15,"jobs.lede")),gI(2),_D(o.loadError()?10:-1),gI(3),Ph(Ow(14,17,"jobs.start.heading")),gI(3),nl(" ",Ow(17,19,"jobs.start.workflow")," "),gI(2),ch("value",o.selectedWorkflowId()),gI(),xD(o.workflows()),gI(2),_D((s=o.selectedWorkflow())?21:-1,s),gI(),ch("disabled",o.starting()),gI(),nl(" ",Ow(24,21,o.starting()?"jobs.start.starting":"jobs.start.button")," "),gI(2),_D(o.actionError()?25:-1);}},dependencies:[Fn,Mt,K$1,ec],styles:[".runner[_ngcontent-%COMP%]{max-width:52rem;margin:0 auto;padding:1.5rem;color:#1c1917;line-height:1.45}.lede[_ngcontent-%COMP%]{color:#57534e}.panel[_ngcontent-%COMP%]{margin-top:1.25rem;padding:1rem 0;border-top:1px solid #d6d3d1}label[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.75rem 0;font-size:.95rem}input[type=text][_ngcontent-%COMP%], select[_ngcontent-%COMP%]{font:inherit;padding:.4rem .5rem;border:1px solid #a8a29e;background:#fff}button[_ngcontent-%COMP%]{font:inherit;margin-top:.5rem;padding:.45rem .9rem;border:1px solid #44403c;background:#f5f5f4;cursor:pointer}button[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return t})();export{re as JobRunnerComponent};