verben-workflow-ui 0.7.6 → 0.7.8

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 (50) hide show
  1. package/esm2022/src/lib/components/designer/components/label-editor.component.mjs +9 -4
  2. package/esm2022/src/lib/components/designer/components/swimlane-label.component.mjs +1 -1
  3. package/esm2022/src/lib/components/designer/components/wf-canvas.component.mjs +2 -2
  4. package/esm2022/src/lib/components/designer/models/types.mjs +1 -1
  5. package/esm2022/src/lib/components/designer/services/connection.service.mjs +2 -1
  6. package/esm2022/src/lib/components/designer/services/wf-mapper.service.mjs +4 -1
  7. package/esm2022/src/lib/components/my-queue/tasks.form.component.mjs +29 -7
  8. package/esm2022/src/lib/components/task-history/task-history.component.mjs +37 -8
  9. package/esm2022/src/lib/components/tasks/tasks.form.component.mjs +13 -3
  10. package/esm2022/src/lib/components/workflow-designer/action-dialog/action-dialog.component.mjs +13 -3
  11. package/esm2022/src/lib/components/workflow-designer/designer-canvas/designer-canvas.component.mjs +4 -3
  12. package/esm2022/src/lib/components/workflow-designer/services/transformer.service.mjs +3 -1
  13. package/esm2022/src/lib/components/workflow-designer/workflow-data.service.mjs +67 -2
  14. package/esm2022/src/lib/components/workflow-designer/workflow-designer.component.mjs +2 -1
  15. package/esm2022/src/lib/components/workflow-designer/workflow-designer.state.mjs +3 -1
  16. package/esm2022/src/lib/components/workflow-designer/workflow-designer.types.mjs +1 -1
  17. package/esm2022/src/lib/components/workflow-stage/workflow-stage.component.mjs +75 -14
  18. package/esm2022/src/lib/models/MessageMedium.mjs +3 -1
  19. package/esm2022/src/lib/models/WorkflowAction.mjs +1 -1
  20. package/esm2022/src/lib/services/public-api.mjs +2 -1
  21. package/esm2022/src/lib/services/workflow-form.helper.mjs +58 -0
  22. package/fesm2022/verben-workflow-ui-src-lib-components-designer.mjs +14 -5
  23. package/fesm2022/verben-workflow-ui-src-lib-components-designer.mjs.map +1 -1
  24. package/fesm2022/verben-workflow-ui-src-lib-components-my-queue.mjs +28 -6
  25. package/fesm2022/verben-workflow-ui-src-lib-components-my-queue.mjs.map +1 -1
  26. package/fesm2022/verben-workflow-ui-src-lib-components-task-history.mjs +37 -8
  27. package/fesm2022/verben-workflow-ui-src-lib-components-task-history.mjs.map +1 -1
  28. package/fesm2022/verben-workflow-ui-src-lib-components-tasks.mjs +12 -2
  29. package/fesm2022/verben-workflow-ui-src-lib-components-tasks.mjs.map +1 -1
  30. package/fesm2022/verben-workflow-ui-src-lib-components-workflow-designer.mjs +86 -5
  31. package/fesm2022/verben-workflow-ui-src-lib-components-workflow-designer.mjs.map +1 -1
  32. package/fesm2022/verben-workflow-ui-src-lib-components-workflow-stage.mjs +74 -13
  33. package/fesm2022/verben-workflow-ui-src-lib-components-workflow-stage.mjs.map +1 -1
  34. package/fesm2022/verben-workflow-ui-src-lib-models.mjs +2 -0
  35. package/fesm2022/verben-workflow-ui-src-lib-models.mjs.map +1 -1
  36. package/fesm2022/verben-workflow-ui-src-lib-services.mjs +59 -1
  37. package/fesm2022/verben-workflow-ui-src-lib-services.mjs.map +1 -1
  38. package/package.json +63 -63
  39. package/src/lib/components/designer/components/label-editor.component.d.ts +2 -1
  40. package/src/lib/components/designer/models/types.d.ts +1 -0
  41. package/src/lib/components/my-queue/tasks.form.component.d.ts +3 -1
  42. package/src/lib/components/task-history/task-history.component.d.ts +3 -1
  43. package/src/lib/components/workflow-designer/action-dialog/action-dialog.component.d.ts +4 -2
  44. package/src/lib/components/workflow-designer/workflow-data.service.d.ts +7 -0
  45. package/src/lib/components/workflow-designer/workflow-designer.types.d.ts +1 -0
  46. package/src/lib/components/workflow-stage/workflow-stage.component.d.ts +4 -1
  47. package/src/lib/models/MessageMedium.d.ts +3 -1
  48. package/src/lib/models/WorkflowAction.d.ts +1 -0
  49. package/src/lib/services/public-api.d.ts +1 -0
  50. package/src/lib/services/workflow-form.helper.d.ts +17 -0
@@ -6,6 +6,7 @@ import * as i6 from 'verben-reporting-ui';
6
6
  import { EditorMode, EditorModule } from 'verben-reporting-ui';
7
7
  import { ObjectState, ErrorResponse, SortDirection } from 'verben-workflow-ui/src/lib/models';
8
8
  import * as i1 from 'verben-workflow-ui/src/lib/services';
9
+ import { resolveFormForAction, resolveHistoryForm } from 'verben-workflow-ui/src/lib/services';
9
10
  import * as i2 from '@angular/platform-browser';
10
11
  import * as i3 from '@angular/common';
11
12
  import { CommonModule } from '@angular/common';
@@ -42,6 +43,8 @@ class WorkflowStageComponent /* implements DoCheck */ {
42
43
  };
43
44
  isFormViewerVisible = false;
44
45
  activeForm = null;
46
+ suppressFormDrawer = false;
47
+ workflowActionsCache = new Map();
45
48
  hoveredStage = null;
46
49
  stageTooltipPos = {
47
50
  top: 0,
@@ -265,6 +268,7 @@ class WorkflowStageComponent /* implements DoCheck */ {
265
268
  }
266
269
  resetTransientState() {
267
270
  this.selectedAction = null;
271
+ this.suppressFormDrawer = false;
268
272
  this.commentText = '';
269
273
  this.pickComment = '';
270
274
  this.selectedRecipient = null;
@@ -422,18 +426,44 @@ class WorkflowStageComponent /* implements DoCheck */ {
422
426
  if (this.task) {
423
427
  this.task.Comment = this.commentText;
424
428
  }
425
- this.onActionCompleted.emit({
426
- action: action,
427
- comment: this.commentText,
428
- recipient: this.selectedRecipient || '',
429
- });
429
+ const availableForms = Array.isArray(this.forms) && this.forms.length > 0
430
+ ? this.forms
431
+ : this.task?.TaskForms || [];
432
+ const resolvedForm = resolveFormForAction(action, this.localNextActions, availableForms);
433
+ if (resolvedForm) {
434
+ this.suppressFormDrawer = false;
435
+ const idx = availableForms.indexOf(resolvedForm);
436
+ this.active = idx >= 0 ? idx : 0;
437
+ this.onActionCompleted.emit({
438
+ action: action,
439
+ comment: this.commentText,
440
+ recipient: this.selectedRecipient || '',
441
+ });
442
+ }
443
+ else {
444
+ this.suppressFormDrawer = true;
445
+ const taskRef = this.task;
446
+ const originalTaskForms = taskRef?.TaskForms;
447
+ if (taskRef && originalTaskForms && originalTaskForms.length > 0) {
448
+ taskRef.TaskForms = [];
449
+ setTimeout(() => {
450
+ taskRef.TaskForms = originalTaskForms;
451
+ }, 0);
452
+ }
453
+ this.onActionCompleted.emit({
454
+ action: action,
455
+ comment: this.commentText,
456
+ recipient: this.selectedRecipient || '',
457
+ });
458
+ }
430
459
  this.closePopUp2();
431
460
  }
432
461
  onModalOpen(event) {
433
462
  this.onOpen.emit(event);
434
463
  }
435
464
  onModalClose(event) {
436
- this.onClose.emit(event);
465
+ this.suppressFormDrawer = false;
466
+ this.onClose.emit(false);
437
467
  }
438
468
  disableNotActor() {
439
469
  const userEmail = this.user;
@@ -562,7 +592,7 @@ class WorkflowStageComponent /* implements DoCheck */ {
562
592
  }
563
593
  });
564
594
  }
565
- async loadFormIfExists(stage) {
595
+ async loadFormIfExists(stage, historyItem) {
566
596
  if (!this.task || !stage) {
567
597
  return;
568
598
  }
@@ -570,17 +600,48 @@ class WorkflowStageComponent /* implements DoCheck */ {
570
600
  const res = await this.server.get(`GetCurrentFormsForTask/${this.task.Code}/${stage}`);
571
601
  this.utilService.sendBI(false);
572
602
  if (res instanceof ErrorResponse) {
603
+ this.activeForm = null;
573
604
  this.utilService.showInfo('Could not load form for selected stage');
574
605
  return;
575
606
  }
576
- else {
577
- var result = res;
578
- if (result.length > 0) {
579
- this.activeForm = result[0];
607
+ const result = res || [];
608
+ if (result.length > 0) {
609
+ const workflowCode = historyItem?.Workflow ||
610
+ this.task?.WorkflowCode ||
611
+ this.localHistoryToDate?.[0]?.Workflow;
612
+ const workflowActions = await this.getWorkflowActions(workflowCode);
613
+ const resolvedForm = resolveHistoryForm(historyItem, stage, workflowActions, result);
614
+ if (resolvedForm) {
615
+ this.activeForm = resolvedForm;
580
616
  this.closePopUp3();
581
617
  this.isFormViewerVisible = true;
582
618
  }
619
+ else {
620
+ this.activeForm = null;
621
+ }
622
+ }
623
+ else {
624
+ this.activeForm = null;
625
+ }
626
+ this.cdr.markForCheck();
627
+ }
628
+ async getWorkflowActions(workflowCode) {
629
+ if (workflowCode) {
630
+ const cached = this.workflowActionsCache.get(workflowCode);
631
+ if (cached) {
632
+ return cached;
633
+ }
634
+ const res = await this.server.get(`GetWorkflowsWithParam/${workflowCode}/0/1/CreatedAt/Asc`);
635
+ if (!(res instanceof ErrorResponse)) {
636
+ const actions = res?.Result?.[0]?.Actions || [];
637
+ this.workflowActionsCache.set(workflowCode, actions);
638
+ return actions;
639
+ }
583
640
  }
641
+ return [
642
+ ...(this.task?.PreviousActions || []),
643
+ ...(this.task?.NextActions || []),
644
+ ];
584
645
  }
585
646
  onFormViewerOpen() { }
586
647
  onFormViewerClose() {
@@ -818,11 +879,11 @@ class WorkflowStageComponent /* implements DoCheck */ {
818
879
  }
819
880
  }
820
881
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WorkflowStageComponent /* implements DoCheck */, deps: [{ token: i1.UtilService }, { token: i1.HttpWebRequestService }, { token: i0.ChangeDetectorRef }, { token: i0.IterableDiffers }, { token: i2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
821
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: WorkflowStageComponent /* implements DoCheck */, selector: "app-workflow-stage", inputs: { pageSize: "pageSize", historyToDate: "historyToDate", taskCode: "taskCode", forms: "forms", isVisible: "isVisible", readOnly: "readOnly", currentActors: "currentActors", user: "user", userName: "userName", nextActions: "nextActions", task: "task" }, outputs: { onActionCompleted: "onActionCompleted", onPickCompleted: "onPickCompleted", onCommentCompleted: "onCommentCompleted", onFormCompleted: "onFormCompleted", onOpen: "onOpen", onClose: "onClose" }, host: { listeners: { "window:scroll": "onWindowScroll()", "document:keydown.escape": "onEscape()" } }, viewQueries: [{ propertyName: "popUps", predicate: ["popup"], descendants: true }, { propertyName: "popUp2s", predicate: ["popup2"], descendants: true }, { propertyName: "popUp3s", predicate: ["popup3"], descendants: true }, { propertyName: "popUp4s", predicate: ["popup4"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n (scroll)=\"onStageMouseLeave()\"\n class=\"flex overflow-x-auto items-start min-h-max overflow-y-clip pt-3 pb-3 px-1\"\n>\n <div\n *ngFor=\"\n let stage of localHistoryToDate;\n trackBy: trackByStage;\n let i = index\n \"\n >\n <div class=\"flex items-center\">\n <!-- Stage circle with hover actor tooltip and click stage options popup -->\n <ng-container\n *ngIf=\"taskCode || (this.task && this.task.Code); else plainStageCircle\"\n >\n <verben-pop-Up\n #popup3\n [customStyles]=\"{ 'z-index': '99' }\"\n [enableMouseLeave]=\"false\"\n [cdkPosition]=\"popupPositions\"\n >\n <div\n dropdown-trigger\n (click)=\"onStageClick()\"\n (mouseenter)=\"onStageMouseEnter(stage, $event)\"\n (mouseleave)=\"onStageMouseLeave()\"\n class=\"w-[30px] h-[30px] flex cursor-pointer justify-center items-center rounded-full bg-primary text-white shadow-xs hover:ring-2 hover:ring-primary/30 transition-all duration-150\"\n >\n <!-- Clean modern checkmark -->\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <polyline points=\"20 6 9 17 4 12\"></polyline>\n </svg>\n </div>\n\n <div\n class=\"pop-up-content flex flex-col py-1.5 min-w-[170px]\"\n dropdown-content\n >\n <div\n class=\"px-[18px] py-1.5 border-b border-gray-100 flex items-center gap-1.5\"\n >\n <span\n class=\"w-1.5 h-1.5 rounded-full bg-primary inline-block\"\n ></span>\n <span\n class=\"text-[11px] font-semibold text-gray-500 uppercase tracking-wider\"\n >\n {{ stage.ToStageName || stage.ActionName || \"Stage Options\" }}\n </span>\n </div>\n <ul class=\"flex flex-col py-1\">\n <li>\n <button\n type=\"button\"\n class=\"w-full text-left px-[18px] py-2 text-xs font-medium text-gray-700 hover:bg-gray-50 hover:text-primary transition-colors cursor-pointer flex items-center gap-2\"\n (click)=\"openViewComment(stage)\"\n >\n <svg\n width=\"13\"\n height=\"13\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path\n d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\"\n ></path>\n </svg>\n <span>View Comment</span>\n </button>\n </li>\n <li>\n <button\n type=\"button\"\n class=\"w-full text-left px-[18px] py-2 text-xs font-medium text-gray-700 hover:bg-gray-50 hover:text-primary transition-colors cursor-pointer flex items-center gap-2\"\n (click)=\"loadFormIfExists(stage.ToStage); closePopUp3()\"\n >\n <svg\n width=\"13\"\n height=\"13\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path\n d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"\n ></path>\n <polyline points=\"14 2 14 8 20 8\"></polyline>\n <line x1=\"16\" y1=\"13\" x2=\"8\" y2=\"13\"></line>\n <line x1=\"16\" y1=\"17\" x2=\"8\" y2=\"17\"></line>\n <polyline points=\"10 9 9 9 8 9\"></polyline>\n </svg>\n <span>Load Stage Form</span>\n </button>\n </li>\n </ul>\n </div>\n </verben-pop-Up>\n </ng-container>\n\n <!-- Plain checkmark when not in task mode -->\n <ng-template #plainStageCircle>\n <div\n (mouseenter)=\"onStageMouseEnter(stage, $event)\"\n (mouseleave)=\"onStageMouseLeave()\"\n class=\"w-[30px] h-[30px] flex justify-center items-center rounded-full bg-primary text-white shadow-xs\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <polyline points=\"20 6 9 17 4 12\"></polyline>\n </svg>\n </div>\n </ng-template>\n\n <ng-container\n *ngIf=\"\n localHistoryToDate[i + 1] ||\n (i === localHistoryToDate.length - 1 &&\n localNextActions.length > 0 &&\n !readOnly)\n \"\n >\n <div\n class=\"border-primary border-b-2 w-[50px] relative px-2 text-xs text-primary font-medium\"\n ></div>\n </ng-container>\n <div\n *ngIf=\"\n i === localHistoryToDate.length - 1 &&\n localNextActions.length > 0 &&\n !readOnly\n \"\n class=\"relative inline-flex\"\n >\n <verben-pop-Up\n #popup2\n [customStyles]=\"{ 'z-index': '99' }\"\n [enableMouseLeave]=\"false\"\n [cdkPosition]=\"passOnPositions\"\n >\n <div dropdown-trigger class=\"inline-flex\">\n <p\n (click)=\"\n openCommentFor(selectedAction || localNextActions[0], $event)\n \"\n [ngClass]=\"{\n 'cursor-not-allowed opacity-50 pointer-events-none':\n disableNotActor(),\n 'cursor-pointer': !disableNotActor(),\n }\"\n class=\"text-center min-w-max rounded-md h-[30px] text-[white] text-sm flex justify-center items-center py-1 max-w-fit px-2 bg-primary\"\n >\n {{\n selectedAction?.Name ||\n selectedAction?.ToStageName ||\n localNextActions[0]?.Name ||\n localNextActions[0]?.ToStageName\n }}\n </p>\n </div>\n\n <div class=\"pop-up-content flex flex-col\" dropdown-content>\n <div\n class=\"py-4 px-[18px] transition-all duration-200 max-h-[45vh] overflow-y-auto\"\n [style.width]=\"isRichEditor ? '580px' : '420px'\"\n >\n <!-- Coherent Header -->\n <div\n class=\"flex items-center justify-between pb-3 mb-3 border-b border-gray-200\"\n >\n <div class=\"flex items-center gap-2\">\n <span\n class=\"w-2 h-2 rounded-full bg-primary inline-block\"\n ></span>\n <h3\n class=\"text-sm font-semibold text-gray-800 tracking-tight\"\n >\n {{ getActionCaption(selectedAction) || \"Add Comment\" }}\n </h3>\n </div>\n <button\n type=\"button\"\n (click)=\"closePopUp2()\"\n class=\"text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-md hover:bg-gray-100 cursor-pointer\"\n title=\"Close\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n </button>\n </div>\n\n <div class=\"flex flex-col gap-3\">\n <!-- Send To -->\n <div\n class=\"flex flex-col gap-1.5\"\n *ngIf=\"nextActors.length > 0\"\n >\n <div class=\"flex items-center justify-between\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase\"\n >\n Send To\n </label>\n <span class=\"text-[11px] text-gray-400\">Optional</span>\n </div>\n <verben-drop-down\n width=\"100%\"\n label=\"Send to (optional)\"\n [options]=\"nextActors\"\n optionLabel=\"Name\"\n optionValue=\"Identifier\"\n [filter]=\"true\"\n [filterBy]=\"'Name'\"\n [(ngModel)]=\"selectedRecipient\"\n [showClear]=\"true\"\n ></verben-drop-down>\n </div>\n\n <!-- Copy -->\n <div class=\"flex flex-col gap-1.5\">\n <div class=\"flex items-center justify-between\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase\"\n >\n Copy\n </label>\n <span class=\"text-[11px] text-gray-400\">Notify actors</span>\n </div>\n <verben-drop-down\n selectKey=\"Code\"\n display=\"chip\"\n width=\"100%\"\n placeholder=\"Select Actors\"\n [showClear]=\"true\"\n [filter]=\"true\"\n (onChange)=\"onCopyChanged($event)\"\n [load]=\"this.loadMoreActors.bind(this)\"\n [search]=\"this.searchActors.bind(this)\"\n [(options)]=\"actors\"\n optionLabel=\"Name\"\n [multiselect]=\"true\"\n [(ngModel)]=\"copy\"\n [lazyLoad]=\"true\"\n [asyncLabel]=\"this.getAsyncLabel.bind(this)\"\n >\n </verben-drop-down>\n </div>\n\n <!-- Comment with Mode Switcher -->\n <div class=\"flex flex-col gap-1.5\">\n <div class=\"flex items-center justify-between mb-0.5\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase flex items-center gap-1\"\n >\n <span>Comment</span>\n <span class=\"text-red-500\">*</span>\n </label>\n\n <!-- Mode Switch Pill -->\n <div\n class=\"inline-flex items-center bg-gray-100 p-0.5 rounded-md border border-gray-200\"\n >\n <button\n type=\"button\"\n (click)=\"setEditorMode(false)\"\n [ngClass]=\"\n !isRichEditor\n ? 'bg-white text-gray-800 shadow-xs font-medium'\n : 'text-gray-500 hover:text-gray-700'\n \"\n class=\"px-2 py-0.5 text-xs rounded transition-all cursor-pointer flex items-center gap-1\"\n title=\"Simple textarea\"\n >\n <span>Simple</span>\n </button>\n <button\n type=\"button\"\n (click)=\"setEditorMode(true)\"\n [ngClass]=\"\n isRichEditor\n ? 'bg-white text-gray-800 shadow-xs font-medium'\n : 'text-gray-500 hover:text-gray-700'\n \"\n class=\"px-2 py-0.5 text-xs rounded transition-all cursor-pointer flex items-center gap-1\"\n title=\"Rich text editor with formatting & tables\"\n >\n <svg\n width=\"11\"\n height=\"11\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M4 7V4h16v3M9 20h6M12 4v16\" />\n </svg>\n <span>Rich / Tables</span>\n </button>\n </div>\n </div>\n\n <!-- Simple Textarea Mode -->\n <div *ngIf=\"!isRichEditor\" class=\"w-full\">\n <verbena-textarea\n [(ngModel)]=\"commentText\"\n [rows]=\"4\"\n width=\"100%\"\n border=\"1px solid #cbd5e1\"\n borderRadius=\"6px\"\n ></verbena-textarea>\n </div>\n\n <!-- Rich Reporting Editor Mode -->\n <div\n *ngIf=\"isRichEditor\"\n class=\"workflow-comment-editor w-full\"\n >\n <lib-editor\n [editorConfig]=\"editorConfig\"\n [editorMode]=\"editorMode\"\n [(ngModel)]=\"commentText\"\n ></lib-editor>\n </div>\n </div>\n </div>\n\n <!-- Action Buttons -->\n <div class=\"flex justify-end gap-3 mt-4 pt-2\">\n <verbena-button\n (click)=\"closePopUp2()\"\n text=\"Cancel\"\n ></verbena-button>\n <verbena-button\n class=\"verben-primary-button\"\n text=\"OK\"\n (click)=\"completeAction(selectedAction)\"\n [disable]=\"!isCommentValid()\"\n ></verbena-button>\n </div>\n </div>\n </div>\n </verben-pop-Up>\n\n <div *ngIf=\"canPick()\" class=\"absolute -top-2 -right-2 z-10\">\n <verben-pop-Up\n #popup4\n [customStyles]=\"{ 'z-index': '99' }\"\n [enableMouseLeave]=\"false\"\n [cdkPosition]=\"reassignPositions\"\n >\n <div\n dropdown-trigger\n (click)=\"openPickPopup($event)\"\n [title]=\"\n isReassign()\n ? 'Reassign task to yourself to act on this stage'\n : 'Pick task to act on this stage'\n \"\n class=\"w-[18px] h-[18px] rounded-full bg-[#FFE681] ring-2 ring-white shadow flex items-center justify-center cursor-pointer\"\n >\n <verben-svg\n icon=\"user\"\n fill=\"#404040\"\n [width]=\"12\"\n [height]=\"12\"\n ></verben-svg>\n </div>\n\n <div class=\"pop-up-content flex flex-col\" dropdown-content>\n <div\n class=\"py-4 px-[18px] transition-all duration-200\"\n [style.width]=\"isPickRichEditor ? '580px' : '420px'\"\n >\n <!-- Coherent Header -->\n <div\n class=\"flex items-center justify-between pb-3 mb-3 border-b border-gray-200\"\n >\n <div class=\"flex items-center gap-2\">\n <span\n class=\"w-2 h-2 rounded-full bg-primary inline-block\"\n ></span>\n <h3\n class=\"text-sm font-semibold text-gray-800 tracking-tight\"\n >\n {{ isReassign() ? \"Reassign Task\" : \"Pick Task\" }}\n </h3>\n </div>\n <button\n type=\"button\"\n (click)=\"closePopUp4()\"\n class=\"text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-md hover:bg-gray-100 cursor-pointer\"\n title=\"Close\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n </button>\n </div>\n\n <div class=\"flex flex-col gap-3\">\n <!-- Stage (if not reassign) -->\n <div class=\"flex flex-col gap-1.5\" *ngIf=\"!isReassign()\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase flex items-center gap-1\"\n >\n <span>Stage</span>\n <span class=\"text-red-500\">*</span>\n </label>\n <verben-drop-down\n width=\"100%\"\n label=\"Stage\"\n [options]=\"task?.FullStages || []\"\n optionLabel=\"Name\"\n optionValue=\"Code\"\n [(ngModel)]=\"selectedStageCode\"\n [showClear]=\"true\"\n ></verben-drop-down>\n </div>\n\n <!-- Assign To -->\n <div class=\"flex flex-col gap-1.5\">\n <div class=\"flex items-center justify-between\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase\"\n >\n Assign to\n </label>\n <span class=\"text-[11px] text-gray-400\"\n >Current Actor</span\n >\n </div>\n <verben-drop-down\n width=\"100%\"\n label=\"Assign to\"\n [options]=\"pickActors\"\n optionLabel=\"Name\"\n optionValue=\"Identifier\"\n [(ngModel)]=\"pickRecipient\"\n [disabled]=\"true\"\n ></verben-drop-down>\n </div>\n\n <!-- Comment with Mode Switcher -->\n <div class=\"flex flex-col gap-1.5\">\n <div class=\"flex items-center justify-between mb-0.5\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase flex items-center gap-1\"\n >\n <span>Comment</span>\n <span class=\"text-red-500\">*</span>\n </label>\n\n <!-- Mode Switch Pill -->\n <div\n class=\"inline-flex items-center bg-gray-100 p-0.5 rounded-md border border-gray-200\"\n >\n <button\n type=\"button\"\n (click)=\"setPickEditorMode(false)\"\n [ngClass]=\"\n !isPickRichEditor\n ? 'bg-white text-gray-800 shadow-xs font-medium'\n : 'text-gray-500 hover:text-gray-700'\n \"\n class=\"px-2 py-0.5 text-xs rounded transition-all cursor-pointer flex items-center gap-1\"\n title=\"Simple textarea\"\n >\n <span>Simple</span>\n </button>\n <button\n type=\"button\"\n (click)=\"setPickEditorMode(true)\"\n [ngClass]=\"\n isPickRichEditor\n ? 'bg-white text-gray-800 shadow-xs font-medium'\n : 'text-gray-500 hover:text-gray-700'\n \"\n class=\"px-2 py-0.5 text-xs rounded transition-all cursor-pointer flex items-center gap-1\"\n title=\"Rich text editor with formatting & tables\"\n >\n <svg\n width=\"11\"\n height=\"11\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M4 7V4h16v3M9 20h6M12 4v16\" />\n </svg>\n <span>Rich / Tables</span>\n </button>\n </div>\n </div>\n\n <!-- Simple Textarea Mode -->\n <div *ngIf=\"!isPickRichEditor\" class=\"w-full\">\n <verbena-textarea\n [(ngModel)]=\"pickComment\"\n [rows]=\"4\"\n width=\"100%\"\n border=\"1px solid #cbd5e1\"\n borderRadius=\"6px\"\n ></verbena-textarea>\n </div>\n\n <!-- Rich Reporting Editor Mode -->\n <div\n *ngIf=\"isPickRichEditor\"\n class=\"workflow-comment-editor w-full\"\n >\n <lib-editor\n [editorConfig]=\"editorConfig\"\n [editorMode]=\"editorMode\"\n [(ngModel)]=\"pickComment\"\n ></lib-editor>\n </div>\n </div>\n </div>\n\n <!-- Action Buttons -->\n <div class=\"flex justify-end gap-3 mt-4 pt-2\">\n <verbena-button\n (click)=\"closePopUp4()\"\n text=\"Cancel\"\n ></verbena-button>\n <verbena-button\n class=\"verben-primary-button\"\n text=\"OK\"\n (click)=\"submitPick()\"\n [disable]=\"\n !isPickCommentValid() ||\n !pickRecipient ||\n (!isReassign() && !selectedStageCode)\n \"\n ></verbena-button>\n </div>\n </div>\n </div>\n </verben-pop-Up>\n </div>\n </div>\n\n <ng-container>\n <div\n *ngIf=\"localHistoryToDate[i + 1]?.ActionName\"\n class=\"border-primary border-b-2 w-[50px] relative px-2 text-xs text-primary font-medium\"\n ></div>\n </ng-container>\n\n <ng-container\n *ngIf=\"\n i === localHistoryToDate.length - 1 &&\n localNextActions.length > 0 &&\n localNextActions.length !== 1 &&\n !readOnly\n \"\n >\n <div>\n <verben-pop-Up\n #popup\n [customStyles]=\"{ 'z-index': '99' }\"\n [enableMouseLeave]=\"false\"\n [cdkPosition]=\"popupPositions\"\n >\n <div dropdown-trigger class=\"flex items-center\">\n <div class=\"w-[20px] h-[2px] bg-[#D4A007]\"></div>\n <div class=\"mt-2\">\n <verben-svg\n class=\"cursor-pointer actions-icon\"\n stroke=\"#D4A007\"\n icon=\"chevron\"\n ></verben-svg>\n </div>\n </div>\n\n <div\n class=\"pop-up-content flex flex-col py-1.5 min-w-[170px]\"\n dropdown-content\n >\n <div\n class=\"px-[18px] py-1.5 border-b border-gray-100 flex items-center gap-1.5\"\n >\n <span\n class=\"w-1.5 h-1.5 rounded-full bg-primary inline-block\"\n ></span>\n <span\n class=\"text-[11px] font-semibold text-gray-500 uppercase tracking-wider\"\n >Actions</span\n >\n </div>\n <ul class=\"flex flex-col py-1\">\n <li\n *ngFor=\"\n let action of localNextActions;\n trackBy: trackByAction\n \"\n >\n <button\n [disabled]=\"disableNotActor()\"\n class=\"w-full text-left px-[18px] py-2 text-xs font-medium text-gray-700 hover:bg-gray-50 hover:text-primary transition-colors disabled:cursor-not-allowed disabled:opacity-40 cursor-pointer flex items-center justify-between\"\n (click)=\"openCommentFor(action, $event); closePopUp()\"\n >\n <span>{{\n action.Name || action.ToStageName || \"Unnamed\"\n }}</span>\n </button>\n </li>\n </ul>\n </div>\n </verben-pop-Up>\n </div>\n </ng-container>\n </div>\n <ng-container\n *ngIf=\"\n stage.ToStageName && stage.ToStageName.length > 20;\n else plainStageName\n \"\n >\n <verben-tooltip\n [top]=\"'0px'\"\n [textColor]=\"'#000'\"\n [backgroundColor]=\"'#D3D3D3'\"\n [left]=\"'0'\"\n [tooltipContent]=\"tooltipTemplate2\"\n #tooltip\n >\n <p\n class=\"text-xs min-w-max left-0 text-primary mt-1 font-semibold capitalize\"\n >\n {{ stage.ToStageName | slice: 0 : 20 }}...\n </p>\n </verben-tooltip>\n <ng-template #tooltipTemplate2>\n <div>\n <p class=\"text-xs\">{{ stage.ToStageName }}</p>\n </div>\n </ng-template>\n </ng-container>\n <ng-template #plainStageName>\n <p\n class=\"text-xs min-w-max left-0 text-primary mt-1 font-semibold capitalize\"\n >\n {{ stage.ToStageName || \"\" }}\n </p>\n </ng-template>\n </div>\n</div>\n<verben-dialogue\n [dismissOutsideClick]=\"true\"\n [closeOnEscape]=\"true\"\n [mode]=\"'drawer'\"\n [padding]=\"'0px'\"\n [drawerWidth]=\"'500px'\"\n position=\"right\"\n [disableFooter]=\"false\"\n [isVisible]=\"isVisible\"\n [modalData]=\"taskForms\"\n (openModal)=\"onModalOpen($event)\"\n (closeModal)=\"onModalClose($event)\"\n [headerTemplate]=\"headerTemplate\"\n [bodyTemplate]=\"bodyTemplate\"\n [showCloseIcon]=\"true\"\n>\n</verben-dialogue>\n\n<ng-template #headerTemplate>\n <div class=\"bg-[#FFE681] px-6 py-4 flex justify-between items-center\">\n <h1>{{ forms[0]?.Name }}</h1>\n </div>\n</ng-template>\n\n<ng-template #bodyTemplate>\n <div class=\"py-3 px-[18px]\">\n <div *ngIf=\"forms?.[active]?.Entities?.length; else emptyState\">\n <div\n *ngFor=\"let entity of forms[active]?.Entities; let j = index\"\n class=\"mb-6 pb-4\"\n >\n <form-control\n [formProperties]=\"entity?.Properties || []\"\n ></form-control>\n <div class=\"flex gap-3 justify-end mt-4\">\n <verbena-button\n class=\"verben-primary-button\"\n (click)=\"submitForm(active)\"\n [disable]=\"!areRequiredPropertiesFilled(entity?.Properties)\"\n text=\"Proceed\"\n ></verbena-button>\n </div>\n </div>\n </div>\n\n <ng-template #emptyState>\n <p class=\"mt-4 p-4 text-gray-600 text-center\">\n No entries available for the selected form group.\n </p>\n </ng-template>\n </div>\n</ng-template>\n\n<app-form-viewer\n [form]=\"activeForm\"\n [isVisible]=\"isFormViewerVisible\"\n (onOpen)=\"onFormViewerOpen()\"\n (onClose)=\"onFormViewerClose()\"\n></app-form-viewer>\n\n<!-- Floating Actor Tooltip with Edge Detection -->\n<div\n *ngIf=\"\n hoveredStage && (hoveredStage.Actor?.Identifier || hoveredStage.Actor?.Name)\n \"\n class=\"fixed z-[9999] pointer-events-none transition-opacity duration-150 ease-out\"\n [style.top.px]=\"stageTooltipPos.top\"\n [style.left.px]=\"stageTooltipPos.left\"\n [style.transform]=\"stageTooltipPos.transform\"\n>\n <div\n class=\"bg-gray-800 text-white text-xs rounded-md px-2.5 py-1 shadow-md whitespace-nowrap relative flex items-center gap-1.5\"\n >\n <verben-svg\n [width]=\"12\"\n [height]=\"12\"\n [icon]=\"'user'\"\n stroke=\"#cbd5e1\"\n ></verben-svg>\n <span class=\"font-medium text-[12px]\">{{\n hoveredStage.Actor?.Name || hoveredStage.Actor?.Identifier\n }}</span>\n <!-- <span\n *ngIf=\"\n hoveredStage.Actor?.Name &&\n hoveredStage.Actor?.Identifier &&\n hoveredStage.Actor.Name !== hoveredStage.Actor.Identifier\n \"\n class=\"text-gray-300 text-[11px]\"\n >\n ({{ hoveredStage.Actor.Identifier }})\n </span> -->\n\n <!-- Arrow pointing toward circle -->\n <div\n *ngIf=\"stageTooltipPos.showAbove\"\n class=\"absolute left-1/2 -bottom-[4px] -translate-x-1/2 w-0 h-0 border-x-4 border-x-transparent border-t-[4px] border-t-gray-800\"\n ></div>\n <div\n *ngIf=\"!stageTooltipPos.showAbove\"\n class=\"absolute left-1/2 -top-[4px] -translate-x-1/2 w-0 h-0 border-x-4 border-x-transparent border-b-[4px] border-b-gray-800\"\n ></div>\n </div>\n</div>\n\n<!-- View Stage Comment Dialogue -->\n<verben-dialogue\n [showCloseIcon]=\"false\"\n [dismissOutsideClick]=\"true\"\n [closeOnEscape]=\"true\"\n [size]=\"'medium'\"\n [dialogueWidth]=\"'580px'\"\n [mode]=\"'dialogue'\"\n [padding]=\"'16px 18px'\"\n [customClass]=\"'show-form max-w-[92vw]'\"\n [disableFooter]=\"true\"\n [isVisible]=\"isViewCommentModalOpen\"\n [bodyTemplate]=\"commentDialogBody\"\n (closeModal)=\"closeViewComment()\"\n>\n <ng-template #commentDialogBody>\n <div class=\"dialog-body flex flex-col gap-4\">\n <!-- Header with Title, Copy, Close X -->\n <div\n class=\"flex items-center justify-between pb-3 border-b border-gray-200\"\n >\n <div class=\"flex items-center gap-2\">\n <span class=\"w-2 h-2 rounded-full bg-primary inline-block\"></span>\n <h3 class=\"text-sm font-semibold text-gray-800 tracking-tight\">\n {{\n viewCommentStage?.ToStageName ||\n viewCommentStage?.ActionName ||\n \"Stage\"\n }}\n - Comment\n </h3>\n </div>\n <div class=\"flex items-center gap-2\">\n <!-- Copy Button -->\n <button\n *ngIf=\"viewCommentDecoded\"\n type=\"button\"\n (click)=\"copyViewCommentText()\"\n class=\"text-xs px-2.5 py-1 rounded bg-gray-100 hover:bg-gray-200 text-gray-700 transition-colors cursor-pointer flex items-center gap-1.5 border border-gray-200 select-none\"\n title=\"Copy comment to clipboard\"\n >\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\"></rect>\n <path\n d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"\n ></path>\n </svg>\n <span>{{ viewCommentCopyStatus }}</span>\n </button>\n\n <!-- Close button -->\n <button\n type=\"button\"\n (click)=\"closeViewComment()\"\n class=\"text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-md hover:bg-gray-100 cursor-pointer\"\n title=\"Close\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n </button>\n </div>\n </div>\n\n <!-- Scrollable Content: max-height similar to comment popup (45vh) -->\n <div class=\"max-h-[45vh] overflow-y-auto select-text pr-1\">\n <!-- Actor & Date Metadata -->\n <div\n *ngIf=\"viewCommentStage?.Actor?.Name || viewCommentStage?.CreatedAt\"\n class=\"flex items-center justify-between text-xs text-gray-500 mb-3 pb-2 border-b border-gray-100\"\n >\n <span\n *ngIf=\"viewCommentStage?.Actor?.Name\"\n class=\"font-medium text-gray-700\"\n >\n By: {{ viewCommentStage?.Actor?.Name }}\n </span>\n <span *ngIf=\"viewCommentStage?.CreatedAt\">\n {{ viewCommentStage?.CreatedAt | date: \"medium\" }}\n </span>\n </div>\n\n <!-- Comment body: HTML or plain text -->\n <div\n *ngIf=\"isViewCommentHtml; else plainViewComment\"\n class=\"comment-html-content w-full overflow-x-auto text-sm text-gray-800 leading-relaxed\"\n [innerHTML]=\"viewCommentFormatted\"\n ></div>\n\n <ng-template #plainViewComment>\n <p\n *ngIf=\"viewCommentDecoded; else emptyViewComment\"\n class=\"whitespace-pre-wrap break-words text-sm leading-relaxed text-gray-800\"\n >\n {{ viewCommentDecoded }}\n </p>\n <ng-template #emptyViewComment>\n <p class=\"text-xs italic text-gray-400 py-6 text-center\">\n No comment recorded for this stage.\n </p>\n </ng-template>\n </ng-template>\n </div>\n\n <!-- Footer button matching form-viewer -->\n <div\n class=\"dialog-button-container flex justify-end gap-2 pt-2 border-t border-gray-100\"\n >\n <verbena-button\n width=\"100%\"\n class=\"verben-primary-button\"\n [text]=\"'Close'\"\n (click)=\"closeViewComment()\"\n >\n </verbena-button>\n </div>\n </div>\n </ng-template>\n</verben-dialogue>\n", styles: [".workflow-container{position:relative}.dialog{position:absolute;top:100%;left:0;background:var(--vbn-color-surface);border:1px solid var(--vbn-color-border);padding:1rem}.completed{text-decoration:line-through;color:var(--vbn-color-text-muted)}.pop-up-content{border-radius:8px;background-color:var(--vbn-color-surface, #ffffff);border:1px solid #e2e8f0;box-shadow:0 10px 25px -5px #0000001a,0 8px 10px -6px #0000000d}.dialog-body{padding:0;height:100%}.pop-up-value{padding:10px 20px}.workflow-comment-editor{border:1px solid #cbd5e1;border-radius:6px;background-color:#fff;display:flex;flex-direction:column;height:250px;max-height:300px;overflow:visible!important;position:relative}::ng-deep .workflow-comment-editor lib-editor{display:flex!important;flex-direction:column!important;height:100%!important;width:100%!important;overflow:visible!important}::ng-deep .workflow-comment-editor lib-editor>div{gap:0!important;height:100%!important;display:flex!important;flex-direction:column!important;overflow:visible!important}::ng-deep .workflow-comment-editor .editor-menu{flex-shrink:0!important;padding:4px 6px;background-color:#f8fafc;border-bottom:1px solid #e2e8f0;gap:4px;overflow:visible!important;border-top-left-radius:5px;border-top-right-radius:5px;position:relative;z-index:50}::ng-deep .workflow-comment-editor .editor-menu-group{overflow:visible!important}::ng-deep .workflow-comment-editor .color-picker-popover{max-height:240px!important;overflow-y:auto!important;overflow-x:hidden!important;z-index:1050!important;box-shadow:0 10px 25px -5px #00000040,0 8px 10px -6px #00000026!important;border:1px solid #cbd5e1!important}::ng-deep .workflow-comment-editor .color-picker-popover::-webkit-scrollbar{width:5px!important}::ng-deep .workflow-comment-editor .color-picker-popover::-webkit-scrollbar-track{background:transparent!important}::ng-deep .workflow-comment-editor .color-picker-popover::-webkit-scrollbar-thumb{background:#cbd5e1!important;border-radius:3px!important}::ng-deep .workflow-comment-editor .color-picker-popover::-webkit-scrollbar-thumb:hover{background:#94a3b8!important}::ng-deep .workflow-comment-editor .color-picker-backdrop{z-index:1040!important}::ng-deep .workflow-comment-editor .font-family-popover,::ng-deep .workflow-comment-editor .font-size-popover{z-index:1050!important}::ng-deep .workflow-comment-editor .font-picker-backdrop{z-index:1040!important}::ng-deep .workflow-comment-editor .editor-menu-item{width:26px;height:26px;border-radius:4px;background:transparent;transition:background-color .15s ease}::ng-deep .workflow-comment-editor .editor-menu-item:hover{background-color:#e2e8f0}::ng-deep .workflow-comment-editor .font-family-trigger{height:26px;width:110px;font-size:11px}::ng-deep .workflow-comment-editor .font-size-group{height:26px}::ng-deep .workflow-comment-editor .font-size-step-btn{height:24px;width:18px}::ng-deep .workflow-comment-editor .font-size-combobox{height:24px}::ng-deep .workflow-comment-editor .font-size-input{font-size:11px}::ng-deep .workflow-comment-editor .editor-container{flex:1 1 0!important;min-height:0!important;height:100%!important;gap:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}::ng-deep .workflow-comment-editor lib-editor-designer{display:flex!important;flex-direction:column!important;flex:1 1 0!important;min-height:0!important;height:100%!important;overflow:hidden!important}::ng-deep .workflow-comment-editor .editable-div-wrapper{flex:1 1 0!important;min-height:0!important;height:100%!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;padding:0!important;background-color:#fff}::ng-deep .workflow-comment-editor .editable{flex:1 1 0!important;min-height:0!important;height:100%!important;overflow-y:auto!important;overflow-x:auto!important;padding:10px 12px 40px!important;outline:none;font-size:13px;line-height:1.5;box-sizing:border-box!important}::ng-deep .workflow-comment-editor [title=\"Code View\"]{display:none!important}::ng-deep .comment-html-content table{width:100%;border-collapse:collapse;margin:.75rem 0;font-size:.8125rem}::ng-deep .comment-html-content th,::ng-deep .comment-html-content td{border:1px solid #cbd5e1;padding:8px 12px;text-align:left}::ng-deep .comment-html-content th{background-color:#f8fafc;font-weight:600}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i5.SvgComponent, selector: "verben-svg", inputs: ["icon", "width", "height", "fill", "stroke", "type", "size"] }, { kind: "component", type: i5.VerbenPopUpComponent, selector: "verben-pop-Up", inputs: ["dropdownOpen", "dropdownWidth", "color", "customStyles", "popUpClass", "border", "borderRadius", "enableMouseLeave", "cdkPosition"], outputs: ["dropdownOpenChange", "close"] }, { kind: "component", type: i5.VerbenaButtonComponent, selector: "verbena-button", inputs: ["type", "text", "styleType", "size", "block", "disable", "disabled", "isLoading", "spinnerSize", "spinnerColor", "svg", "svgPosition", "svgWidth", "svgHeight", "svgSize", "svgColor", "icon", "useIcon", "iconPosition", "iconColor", "variant", "weight", "bgColor", "textColor", "border", "borderRadius", "pd", "width", "height", "fontSize", "fontWeight", "buttonClass", "buttonTextClass"] }, { kind: "component", type: i5.DropDownComponent, selector: "verben-drop-down", inputs: ["options", "width", "overlayWidth", "showHorizontalLine", "horizontalLineColor", "optionLabel", "optionSubLabel", "optionValue", "placeholder", "invalidMessage", "errorPosition", "loadMoreCaption", "display", "showClear", "lazyLoad", "selectKey", "styleClass", "group", "multiselect", "filter", "avoidDuplication", "filterBy", "debounceTime", "minChar", "refPageSize", "disabled", "required", "autoScrollToCurrentItem", "load", "asyncLabel", "search"], outputs: ["optionsChange", "onChange", "onClick", "onClear"] }, { kind: "component", type: i5.TooltipComponent, selector: "verben-tooltip", inputs: ["tooltipContent", "customClass", "backgroundColor", "textColor", "padding", "borderRadius", "zIndex", "border", "width", "top", "bottom", "left", "right"] }, { kind: "component", type: i5.VerbenDialogueComponent, selector: "verben-dialogue", inputs: ["dialogueWidth", "headerTemplate", "bodyTemplate", "footerTemplate", "showCloseIcon", "dismissOutsideClick", "closeOnEscape", "isVisible", "size", "backdropColor", "customClass", "disableFooter", "margin", "padding", "borderRadius", "dialogueBgColor", "width", "closeIconClass", "boxShadow", "enableTransition", "modalData", "mode", "position", "drawerWidth"], outputs: ["openModal", "closeModal"] }, { kind: "component", type: i5.VerbenaTextareaComponent, selector: "verbena-textarea", inputs: ["disabled", "label", "required", "rows", "cols", "bgColor", "textColor", "border", "borderRadius", "pd", "width", "height", "value", "errorMessageColor"], outputs: ["valueChange"] }, { kind: "component", type: i6.EditorComponent, selector: "lib-editor", inputs: ["themeColor", "disabled", "editorMode", "editorConfig", "content"], outputs: ["editorModeChange", "onImageEdit", "onSortEdit"] }, { kind: "component", type: i7.FormControlComponent, selector: "form-control", inputs: ["dataType", "value", "boolInputType", "formProperties", "disabled"] }, { kind: "component", type: i8.FormViewerComponent, selector: "app-form-viewer", inputs: ["form", "isVisible"], outputs: ["onOpen", "onClose"] }, { kind: "pipe", type: i3.SlicePipe, name: "slice" }, { kind: "pipe", type: i3.DatePipe, name: "date" }] });
882
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: WorkflowStageComponent /* implements DoCheck */, selector: "app-workflow-stage", inputs: { pageSize: "pageSize", historyToDate: "historyToDate", taskCode: "taskCode", forms: "forms", isVisible: "isVisible", readOnly: "readOnly", currentActors: "currentActors", user: "user", userName: "userName", nextActions: "nextActions", task: "task" }, outputs: { onActionCompleted: "onActionCompleted", onPickCompleted: "onPickCompleted", onCommentCompleted: "onCommentCompleted", onFormCompleted: "onFormCompleted", onOpen: "onOpen", onClose: "onClose" }, host: { listeners: { "window:scroll": "onWindowScroll()", "document:keydown.escape": "onEscape()" } }, viewQueries: [{ propertyName: "popUps", predicate: ["popup"], descendants: true }, { propertyName: "popUp2s", predicate: ["popup2"], descendants: true }, { propertyName: "popUp3s", predicate: ["popup3"], descendants: true }, { propertyName: "popUp4s", predicate: ["popup4"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n (scroll)=\"onStageMouseLeave()\"\n class=\"flex overflow-x-auto items-start min-h-max overflow-y-clip pt-3 pb-3 px-1\"\n>\n <div\n *ngFor=\"\n let stage of localHistoryToDate;\n trackBy: trackByStage;\n let i = index\n \"\n >\n <div class=\"flex items-center\">\n <!-- Stage circle with hover actor tooltip and click stage options popup -->\n <ng-container\n *ngIf=\"taskCode || (this.task && this.task.Code); else plainStageCircle\"\n >\n <verben-pop-Up\n #popup3\n [customStyles]=\"{ 'z-index': '99' }\"\n [enableMouseLeave]=\"false\"\n [cdkPosition]=\"popupPositions\"\n >\n <div\n dropdown-trigger\n (click)=\"onStageClick()\"\n (mouseenter)=\"onStageMouseEnter(stage, $event)\"\n (mouseleave)=\"onStageMouseLeave()\"\n class=\"w-[30px] h-[30px] flex cursor-pointer justify-center items-center rounded-full bg-primary text-white shadow-xs hover:ring-2 hover:ring-primary/30 transition-all duration-150\"\n >\n <!-- Clean modern checkmark -->\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <polyline points=\"20 6 9 17 4 12\"></polyline>\n </svg>\n </div>\n\n <div\n class=\"pop-up-content flex flex-col py-1.5 min-w-[170px]\"\n dropdown-content\n >\n <div\n class=\"px-[18px] py-1.5 border-b border-gray-100 flex items-center gap-1.5\"\n >\n <span\n class=\"w-1.5 h-1.5 rounded-full bg-primary inline-block\"\n ></span>\n <span\n class=\"text-[11px] font-semibold text-gray-500 uppercase tracking-wider\"\n >\n {{ stage.ToStageName || stage.ActionName || \"Stage Options\" }}\n </span>\n </div>\n <ul class=\"flex flex-col py-1\">\n <li>\n <button\n type=\"button\"\n class=\"w-full text-left px-[18px] py-2 text-xs font-medium text-gray-700 hover:bg-gray-50 hover:text-primary transition-colors cursor-pointer flex items-center gap-2\"\n (click)=\"openViewComment(stage)\"\n >\n <svg\n width=\"13\"\n height=\"13\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path\n d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\"\n ></path>\n </svg>\n <span>View Comment</span>\n </button>\n </li>\n <li>\n <button\n type=\"button\"\n class=\"w-full text-left px-[18px] py-2 text-xs font-medium text-gray-700 hover:bg-gray-50 hover:text-primary transition-colors cursor-pointer flex items-center gap-2\"\n (click)=\"loadFormIfExists(stage.ToStage, stage); closePopUp3()\"\n >\n <svg\n width=\"13\"\n height=\"13\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path\n d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"\n ></path>\n <polyline points=\"14 2 14 8 20 8\"></polyline>\n <line x1=\"16\" y1=\"13\" x2=\"8\" y2=\"13\"></line>\n <line x1=\"16\" y1=\"17\" x2=\"8\" y2=\"17\"></line>\n <polyline points=\"10 9 9 9 8 9\"></polyline>\n </svg>\n <span>Load Stage Form</span>\n </button>\n </li>\n </ul>\n </div>\n </verben-pop-Up>\n </ng-container>\n\n <!-- Plain checkmark when not in task mode -->\n <ng-template #plainStageCircle>\n <div\n (mouseenter)=\"onStageMouseEnter(stage, $event)\"\n (mouseleave)=\"onStageMouseLeave()\"\n class=\"w-[30px] h-[30px] flex justify-center items-center rounded-full bg-primary text-white shadow-xs\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <polyline points=\"20 6 9 17 4 12\"></polyline>\n </svg>\n </div>\n </ng-template>\n\n <ng-container\n *ngIf=\"\n localHistoryToDate[i + 1] ||\n (i === localHistoryToDate.length - 1 &&\n localNextActions.length > 0 &&\n !readOnly)\n \"\n >\n <div\n class=\"border-primary border-b-2 w-[50px] relative px-2 text-xs text-primary font-medium\"\n ></div>\n </ng-container>\n <div\n *ngIf=\"\n i === localHistoryToDate.length - 1 &&\n localNextActions.length > 0 &&\n !readOnly\n \"\n class=\"relative inline-flex\"\n >\n <verben-pop-Up\n #popup2\n [customStyles]=\"{ 'z-index': '99' }\"\n [enableMouseLeave]=\"false\"\n [cdkPosition]=\"passOnPositions\"\n >\n <div dropdown-trigger class=\"inline-flex\">\n <p\n (click)=\"\n openCommentFor(selectedAction || localNextActions[0], $event)\n \"\n [ngClass]=\"{\n 'cursor-not-allowed opacity-50 pointer-events-none':\n disableNotActor(),\n 'cursor-pointer': !disableNotActor(),\n }\"\n class=\"text-center min-w-max rounded-md h-[30px] text-[white] text-sm flex justify-center items-center py-1 max-w-fit px-2 bg-primary\"\n >\n {{\n selectedAction?.Name ||\n selectedAction?.ToStageName ||\n localNextActions[0]?.Name ||\n localNextActions[0]?.ToStageName\n }}\n </p>\n </div>\n\n <div class=\"pop-up-content flex flex-col\" dropdown-content>\n <div\n class=\"py-4 px-[18px] transition-all duration-200 max-h-[45vh] overflow-y-auto\"\n [style.width]=\"isRichEditor ? '580px' : '420px'\"\n >\n <!-- Coherent Header -->\n <div\n class=\"flex items-center justify-between pb-3 mb-3 border-b border-gray-200\"\n >\n <div class=\"flex items-center gap-2\">\n <span\n class=\"w-2 h-2 rounded-full bg-primary inline-block\"\n ></span>\n <h3\n class=\"text-sm font-semibold text-gray-800 tracking-tight\"\n >\n {{ getActionCaption(selectedAction) || \"Add Comment\" }}\n </h3>\n </div>\n <button\n type=\"button\"\n (click)=\"closePopUp2()\"\n class=\"text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-md hover:bg-gray-100 cursor-pointer\"\n title=\"Close\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n </button>\n </div>\n\n <div class=\"flex flex-col gap-3\">\n <!-- Send To -->\n <div\n class=\"flex flex-col gap-1.5\"\n *ngIf=\"nextActors.length > 0\"\n >\n <div class=\"flex items-center justify-between\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase\"\n >\n Send To\n </label>\n <span class=\"text-[11px] text-gray-400\">Optional</span>\n </div>\n <verben-drop-down\n width=\"100%\"\n label=\"Send to (optional)\"\n [options]=\"nextActors\"\n optionLabel=\"Name\"\n optionValue=\"Identifier\"\n [filter]=\"true\"\n [filterBy]=\"'Name'\"\n [(ngModel)]=\"selectedRecipient\"\n [showClear]=\"true\"\n ></verben-drop-down>\n </div>\n\n <!-- Copy -->\n <div class=\"flex flex-col gap-1.5\">\n <div class=\"flex items-center justify-between\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase\"\n >\n Copy\n </label>\n <span class=\"text-[11px] text-gray-400\">Notify actors</span>\n </div>\n <verben-drop-down\n selectKey=\"Code\"\n display=\"chip\"\n width=\"100%\"\n placeholder=\"Select Actors\"\n [showClear]=\"true\"\n [filter]=\"true\"\n (onChange)=\"onCopyChanged($event)\"\n [load]=\"this.loadMoreActors.bind(this)\"\n [search]=\"this.searchActors.bind(this)\"\n [(options)]=\"actors\"\n optionLabel=\"Name\"\n [multiselect]=\"true\"\n [(ngModel)]=\"copy\"\n [lazyLoad]=\"true\"\n [asyncLabel]=\"this.getAsyncLabel.bind(this)\"\n >\n </verben-drop-down>\n </div>\n\n <!-- Comment with Mode Switcher -->\n <div class=\"flex flex-col gap-1.5\">\n <div class=\"flex items-center justify-between mb-0.5\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase flex items-center gap-1\"\n >\n <span>Comment</span>\n <span class=\"text-red-500\">*</span>\n </label>\n\n <!-- Mode Switch Pill -->\n <div\n class=\"inline-flex items-center bg-gray-100 p-0.5 rounded-md border border-gray-200\"\n >\n <button\n type=\"button\"\n (click)=\"setEditorMode(false)\"\n [ngClass]=\"\n !isRichEditor\n ? 'bg-white text-gray-800 shadow-xs font-medium'\n : 'text-gray-500 hover:text-gray-700'\n \"\n class=\"px-2 py-0.5 text-xs rounded transition-all cursor-pointer flex items-center gap-1\"\n title=\"Simple textarea\"\n >\n <span>Simple</span>\n </button>\n <button\n type=\"button\"\n (click)=\"setEditorMode(true)\"\n [ngClass]=\"\n isRichEditor\n ? 'bg-white text-gray-800 shadow-xs font-medium'\n : 'text-gray-500 hover:text-gray-700'\n \"\n class=\"px-2 py-0.5 text-xs rounded transition-all cursor-pointer flex items-center gap-1\"\n title=\"Rich text editor with formatting & tables\"\n >\n <svg\n width=\"11\"\n height=\"11\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M4 7V4h16v3M9 20h6M12 4v16\" />\n </svg>\n <span>Rich / Tables</span>\n </button>\n </div>\n </div>\n\n <!-- Simple Textarea Mode -->\n <div *ngIf=\"!isRichEditor\" class=\"w-full\">\n <verbena-textarea\n [(ngModel)]=\"commentText\"\n [rows]=\"4\"\n width=\"100%\"\n border=\"1px solid #cbd5e1\"\n borderRadius=\"6px\"\n ></verbena-textarea>\n </div>\n\n <!-- Rich Reporting Editor Mode -->\n <div\n *ngIf=\"isRichEditor\"\n class=\"workflow-comment-editor w-full\"\n >\n <lib-editor\n [editorConfig]=\"editorConfig\"\n [editorMode]=\"editorMode\"\n [(ngModel)]=\"commentText\"\n ></lib-editor>\n </div>\n </div>\n </div>\n\n <!-- Action Buttons -->\n <div class=\"flex justify-end gap-3 mt-4 pt-2\">\n <verbena-button\n (click)=\"closePopUp2()\"\n text=\"Cancel\"\n ></verbena-button>\n <verbena-button\n class=\"verben-primary-button\"\n text=\"OK\"\n (click)=\"completeAction(selectedAction)\"\n [disable]=\"!isCommentValid()\"\n ></verbena-button>\n </div>\n </div>\n </div>\n </verben-pop-Up>\n\n <div *ngIf=\"canPick()\" class=\"absolute -top-2 -right-2 z-10\">\n <verben-pop-Up\n #popup4\n [customStyles]=\"{ 'z-index': '99' }\"\n [enableMouseLeave]=\"false\"\n [cdkPosition]=\"reassignPositions\"\n >\n <div\n dropdown-trigger\n (click)=\"openPickPopup($event)\"\n [title]=\"\n isReassign()\n ? 'Reassign task to yourself to act on this stage'\n : 'Pick task to act on this stage'\n \"\n class=\"w-[18px] h-[18px] rounded-full bg-[#FFE681] ring-2 ring-white shadow flex items-center justify-center cursor-pointer\"\n >\n <verben-svg\n icon=\"user\"\n fill=\"#404040\"\n [width]=\"12\"\n [height]=\"12\"\n ></verben-svg>\n </div>\n\n <div class=\"pop-up-content flex flex-col\" dropdown-content>\n <div\n class=\"py-4 px-[18px] transition-all duration-200\"\n [style.width]=\"isPickRichEditor ? '580px' : '420px'\"\n >\n <!-- Coherent Header -->\n <div\n class=\"flex items-center justify-between pb-3 mb-3 border-b border-gray-200\"\n >\n <div class=\"flex items-center gap-2\">\n <span\n class=\"w-2 h-2 rounded-full bg-primary inline-block\"\n ></span>\n <h3\n class=\"text-sm font-semibold text-gray-800 tracking-tight\"\n >\n {{ isReassign() ? \"Reassign Task\" : \"Pick Task\" }}\n </h3>\n </div>\n <button\n type=\"button\"\n (click)=\"closePopUp4()\"\n class=\"text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-md hover:bg-gray-100 cursor-pointer\"\n title=\"Close\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n </button>\n </div>\n\n <div class=\"flex flex-col gap-3\">\n <!-- Stage (if not reassign) -->\n <div class=\"flex flex-col gap-1.5\" *ngIf=\"!isReassign()\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase flex items-center gap-1\"\n >\n <span>Stage</span>\n <span class=\"text-red-500\">*</span>\n </label>\n <verben-drop-down\n width=\"100%\"\n label=\"Stage\"\n [options]=\"task?.FullStages || []\"\n optionLabel=\"Name\"\n optionValue=\"Code\"\n [(ngModel)]=\"selectedStageCode\"\n [showClear]=\"true\"\n ></verben-drop-down>\n </div>\n\n <!-- Assign To -->\n <div class=\"flex flex-col gap-1.5\">\n <div class=\"flex items-center justify-between\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase\"\n >\n Assign to\n </label>\n <span class=\"text-[11px] text-gray-400\"\n >Current Actor</span\n >\n </div>\n <verben-drop-down\n width=\"100%\"\n label=\"Assign to\"\n [options]=\"pickActors\"\n optionLabel=\"Name\"\n optionValue=\"Identifier\"\n [(ngModel)]=\"pickRecipient\"\n [disabled]=\"true\"\n ></verben-drop-down>\n </div>\n\n <!-- Comment with Mode Switcher -->\n <div class=\"flex flex-col gap-1.5\">\n <div class=\"flex items-center justify-between mb-0.5\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase flex items-center gap-1\"\n >\n <span>Comment</span>\n <span class=\"text-red-500\">*</span>\n </label>\n\n <!-- Mode Switch Pill -->\n <div\n class=\"inline-flex items-center bg-gray-100 p-0.5 rounded-md border border-gray-200\"\n >\n <button\n type=\"button\"\n (click)=\"setPickEditorMode(false)\"\n [ngClass]=\"\n !isPickRichEditor\n ? 'bg-white text-gray-800 shadow-xs font-medium'\n : 'text-gray-500 hover:text-gray-700'\n \"\n class=\"px-2 py-0.5 text-xs rounded transition-all cursor-pointer flex items-center gap-1\"\n title=\"Simple textarea\"\n >\n <span>Simple</span>\n </button>\n <button\n type=\"button\"\n (click)=\"setPickEditorMode(true)\"\n [ngClass]=\"\n isPickRichEditor\n ? 'bg-white text-gray-800 shadow-xs font-medium'\n : 'text-gray-500 hover:text-gray-700'\n \"\n class=\"px-2 py-0.5 text-xs rounded transition-all cursor-pointer flex items-center gap-1\"\n title=\"Rich text editor with formatting & tables\"\n >\n <svg\n width=\"11\"\n height=\"11\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M4 7V4h16v3M9 20h6M12 4v16\" />\n </svg>\n <span>Rich / Tables</span>\n </button>\n </div>\n </div>\n\n <!-- Simple Textarea Mode -->\n <div *ngIf=\"!isPickRichEditor\" class=\"w-full\">\n <verbena-textarea\n [(ngModel)]=\"pickComment\"\n [rows]=\"4\"\n width=\"100%\"\n border=\"1px solid #cbd5e1\"\n borderRadius=\"6px\"\n ></verbena-textarea>\n </div>\n\n <!-- Rich Reporting Editor Mode -->\n <div\n *ngIf=\"isPickRichEditor\"\n class=\"workflow-comment-editor w-full\"\n >\n <lib-editor\n [editorConfig]=\"editorConfig\"\n [editorMode]=\"editorMode\"\n [(ngModel)]=\"pickComment\"\n ></lib-editor>\n </div>\n </div>\n </div>\n\n <!-- Action Buttons -->\n <div class=\"flex justify-end gap-3 mt-4 pt-2\">\n <verbena-button\n (click)=\"closePopUp4()\"\n text=\"Cancel\"\n ></verbena-button>\n <verbena-button\n class=\"verben-primary-button\"\n text=\"OK\"\n (click)=\"submitPick()\"\n [disable]=\"\n !isPickCommentValid() ||\n !pickRecipient ||\n (!isReassign() && !selectedStageCode)\n \"\n ></verbena-button>\n </div>\n </div>\n </div>\n </verben-pop-Up>\n </div>\n </div>\n\n <ng-container>\n <div\n *ngIf=\"localHistoryToDate[i + 1]?.ActionName\"\n class=\"border-primary border-b-2 w-[50px] relative px-2 text-xs text-primary font-medium\"\n ></div>\n </ng-container>\n\n <ng-container\n *ngIf=\"\n i === localHistoryToDate.length - 1 &&\n localNextActions.length > 0 &&\n localNextActions.length !== 1 &&\n !readOnly\n \"\n >\n <div>\n <verben-pop-Up\n #popup\n [customStyles]=\"{ 'z-index': '99' }\"\n [enableMouseLeave]=\"false\"\n [cdkPosition]=\"popupPositions\"\n >\n <div dropdown-trigger class=\"flex items-center\">\n <div class=\"w-[20px] h-[2px] bg-[#D4A007]\"></div>\n <div class=\"mt-2\">\n <verben-svg\n class=\"cursor-pointer actions-icon\"\n stroke=\"#D4A007\"\n icon=\"chevron\"\n ></verben-svg>\n </div>\n </div>\n\n <div\n class=\"pop-up-content flex flex-col py-1.5 min-w-[170px]\"\n dropdown-content\n >\n <div\n class=\"px-[18px] py-1.5 border-b border-gray-100 flex items-center gap-1.5\"\n >\n <span\n class=\"w-1.5 h-1.5 rounded-full bg-primary inline-block\"\n ></span>\n <span\n class=\"text-[11px] font-semibold text-gray-500 uppercase tracking-wider\"\n >Actions</span\n >\n </div>\n <ul class=\"flex flex-col py-1\">\n <li\n *ngFor=\"\n let action of localNextActions;\n trackBy: trackByAction\n \"\n >\n <button\n [disabled]=\"disableNotActor()\"\n class=\"w-full text-left px-[18px] py-2 text-xs font-medium text-gray-700 hover:bg-gray-50 hover:text-primary transition-colors disabled:cursor-not-allowed disabled:opacity-40 cursor-pointer flex items-center justify-between\"\n (click)=\"openCommentFor(action, $event); closePopUp()\"\n >\n <span>{{\n action.Name || action.ToStageName || \"Unnamed\"\n }}</span>\n </button>\n </li>\n </ul>\n </div>\n </verben-pop-Up>\n </div>\n </ng-container>\n </div>\n <ng-container\n *ngIf=\"\n stage.ToStageName && stage.ToStageName.length > 20;\n else plainStageName\n \"\n >\n <verben-tooltip\n [top]=\"'0px'\"\n [textColor]=\"'#000'\"\n [backgroundColor]=\"'#D3D3D3'\"\n [left]=\"'0'\"\n [tooltipContent]=\"tooltipTemplate2\"\n #tooltip\n >\n <p\n class=\"text-xs min-w-max left-0 text-primary mt-1 font-semibold capitalize\"\n >\n {{ stage.ToStageName | slice: 0 : 20 }}...\n </p>\n </verben-tooltip>\n <ng-template #tooltipTemplate2>\n <div>\n <p class=\"text-xs\">{{ stage.ToStageName }}</p>\n </div>\n </ng-template>\n </ng-container>\n <ng-template #plainStageName>\n <p\n class=\"text-xs min-w-max left-0 text-primary mt-1 font-semibold capitalize\"\n >\n {{ stage.ToStageName || \"\" }}\n </p>\n </ng-template>\n </div>\n</div>\n<verben-dialogue\n [dismissOutsideClick]=\"true\"\n [closeOnEscape]=\"true\"\n [mode]=\"'drawer'\"\n [padding]=\"'0px'\"\n [drawerWidth]=\"'500px'\"\n position=\"right\"\n [disableFooter]=\"false\"\n [isVisible]=\"suppressFormDrawer ? false : isVisible\"\n [modalData]=\"taskForms\"\n (openModal)=\"onModalOpen($event)\"\n (closeModal)=\"onModalClose($event)\"\n [headerTemplate]=\"headerTemplate\"\n [bodyTemplate]=\"bodyTemplate\"\n [showCloseIcon]=\"true\"\n>\n</verben-dialogue>\n\n<ng-template #headerTemplate>\n <div class=\"bg-[#FFE681] px-6 py-4 flex justify-between items-center\">\n <h1>{{ forms?.[active]?.Name }}</h1>\n </div>\n</ng-template>\n\n<ng-template #bodyTemplate>\n <div class=\"py-3 px-[18px]\">\n <div *ngIf=\"forms?.[active]?.Entities?.length; else emptyState\">\n <div\n *ngFor=\"let entity of forms[active]?.Entities; let j = index\"\n class=\"mb-6 pb-4\"\n >\n <form-control\n [formProperties]=\"entity?.Properties || []\"\n ></form-control>\n <div class=\"flex gap-3 justify-end mt-4\">\n <verbena-button\n class=\"verben-primary-button\"\n (click)=\"submitForm(active)\"\n [disable]=\"!areRequiredPropertiesFilled(entity?.Properties)\"\n text=\"Proceed\"\n ></verbena-button>\n </div>\n </div>\n </div>\n\n <ng-template #emptyState>\n <p class=\"mt-4 p-4 text-gray-600 text-center\">\n No entries available for the selected form group.\n </p>\n </ng-template>\n </div>\n</ng-template>\n\n<app-form-viewer\n [form]=\"activeForm\"\n [isVisible]=\"isFormViewerVisible\"\n (onOpen)=\"onFormViewerOpen()\"\n (onClose)=\"onFormViewerClose()\"\n></app-form-viewer>\n\n<!-- Floating Actor Tooltip with Edge Detection -->\n<div\n *ngIf=\"\n hoveredStage && (hoveredStage.Actor?.Identifier || hoveredStage.Actor?.Name)\n \"\n class=\"fixed z-[9999] pointer-events-none transition-opacity duration-150 ease-out\"\n [style.top.px]=\"stageTooltipPos.top\"\n [style.left.px]=\"stageTooltipPos.left\"\n [style.transform]=\"stageTooltipPos.transform\"\n>\n <div\n class=\"bg-gray-800 text-white text-xs rounded-md px-2.5 py-1 shadow-md whitespace-nowrap relative flex items-center gap-1.5\"\n >\n <verben-svg\n [width]=\"12\"\n [height]=\"12\"\n [icon]=\"'user'\"\n stroke=\"#cbd5e1\"\n ></verben-svg>\n <span class=\"font-medium text-[12px]\">{{\n hoveredStage.Actor?.Name || hoveredStage.Actor?.Identifier\n }}</span>\n <!-- <span\n *ngIf=\"\n hoveredStage.Actor?.Name &&\n hoveredStage.Actor?.Identifier &&\n hoveredStage.Actor.Name !== hoveredStage.Actor.Identifier\n \"\n class=\"text-gray-300 text-[11px]\"\n >\n ({{ hoveredStage.Actor.Identifier }})\n </span> -->\n\n <!-- Arrow pointing toward circle -->\n <div\n *ngIf=\"stageTooltipPos.showAbove\"\n class=\"absolute left-1/2 -bottom-[4px] -translate-x-1/2 w-0 h-0 border-x-4 border-x-transparent border-t-[4px] border-t-gray-800\"\n ></div>\n <div\n *ngIf=\"!stageTooltipPos.showAbove\"\n class=\"absolute left-1/2 -top-[4px] -translate-x-1/2 w-0 h-0 border-x-4 border-x-transparent border-b-[4px] border-b-gray-800\"\n ></div>\n </div>\n</div>\n\n<!-- View Stage Comment Dialogue -->\n<verben-dialogue\n [showCloseIcon]=\"false\"\n [dismissOutsideClick]=\"true\"\n [closeOnEscape]=\"true\"\n [size]=\"'medium'\"\n [dialogueWidth]=\"'580px'\"\n [mode]=\"'dialogue'\"\n [padding]=\"'16px 18px'\"\n [customClass]=\"'show-form max-w-[92vw]'\"\n [disableFooter]=\"true\"\n [isVisible]=\"isViewCommentModalOpen\"\n [bodyTemplate]=\"commentDialogBody\"\n (closeModal)=\"closeViewComment()\"\n>\n <ng-template #commentDialogBody>\n <div class=\"dialog-body flex flex-col gap-4\">\n <!-- Header with Title, Copy, Close X -->\n <div\n class=\"flex items-center justify-between pb-3 border-b border-gray-200\"\n >\n <div class=\"flex items-center gap-2\">\n <span class=\"w-2 h-2 rounded-full bg-primary inline-block\"></span>\n <h3 class=\"text-sm font-semibold text-gray-800 tracking-tight\">\n {{\n viewCommentStage?.ToStageName ||\n viewCommentStage?.ActionName ||\n \"Stage\"\n }}\n - Comment\n </h3>\n </div>\n <div class=\"flex items-center gap-2\">\n <!-- Copy Button -->\n <button\n *ngIf=\"viewCommentDecoded\"\n type=\"button\"\n (click)=\"copyViewCommentText()\"\n class=\"text-xs px-2.5 py-1 rounded bg-gray-100 hover:bg-gray-200 text-gray-700 transition-colors cursor-pointer flex items-center gap-1.5 border border-gray-200 select-none\"\n title=\"Copy comment to clipboard\"\n >\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\"></rect>\n <path\n d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"\n ></path>\n </svg>\n <span>{{ viewCommentCopyStatus }}</span>\n </button>\n\n <!-- Close button -->\n <button\n type=\"button\"\n (click)=\"closeViewComment()\"\n class=\"text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-md hover:bg-gray-100 cursor-pointer\"\n title=\"Close\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n </button>\n </div>\n </div>\n\n <!-- Scrollable Content: max-height similar to comment popup (45vh) -->\n <div class=\"max-h-[45vh] overflow-y-auto select-text pr-1\">\n <!-- Actor & Date Metadata -->\n <div\n *ngIf=\"viewCommentStage?.Actor?.Name || viewCommentStage?.CreatedAt\"\n class=\"flex items-center justify-between text-xs text-gray-500 mb-3 pb-2 border-b border-gray-100\"\n >\n <span\n *ngIf=\"viewCommentStage?.Actor?.Name\"\n class=\"font-medium text-gray-700\"\n >\n By: {{ viewCommentStage?.Actor?.Name }}\n </span>\n <span *ngIf=\"viewCommentStage?.CreatedAt\">\n {{ viewCommentStage?.CreatedAt | date: \"medium\" }}\n </span>\n </div>\n\n <!-- Comment body: HTML or plain text -->\n <div\n *ngIf=\"isViewCommentHtml; else plainViewComment\"\n class=\"comment-html-content w-full overflow-x-auto text-sm text-gray-800 leading-relaxed\"\n [innerHTML]=\"viewCommentFormatted\"\n ></div>\n\n <ng-template #plainViewComment>\n <p\n *ngIf=\"viewCommentDecoded; else emptyViewComment\"\n class=\"whitespace-pre-wrap break-words text-sm leading-relaxed text-gray-800\"\n >\n {{ viewCommentDecoded }}\n </p>\n <ng-template #emptyViewComment>\n <p class=\"text-xs italic text-gray-400 py-6 text-center\">\n No comment recorded for this stage.\n </p>\n </ng-template>\n </ng-template>\n </div>\n\n <!-- Footer button matching form-viewer -->\n <div\n class=\"dialog-button-container flex justify-end gap-2 pt-2 border-t border-gray-100\"\n >\n <verbena-button\n width=\"100%\"\n class=\"verben-primary-button\"\n [text]=\"'Close'\"\n (click)=\"closeViewComment()\"\n >\n </verbena-button>\n </div>\n </div>\n </ng-template>\n</verben-dialogue>\n", styles: [".workflow-container{position:relative}.dialog{position:absolute;top:100%;left:0;background:var(--vbn-color-surface);border:1px solid var(--vbn-color-border);padding:1rem}.completed{text-decoration:line-through;color:var(--vbn-color-text-muted)}.pop-up-content{border-radius:8px;background-color:var(--vbn-color-surface, #ffffff);border:1px solid #e2e8f0;box-shadow:0 10px 25px -5px #0000001a,0 8px 10px -6px #0000000d}.dialog-body{padding:0;height:100%}.pop-up-value{padding:10px 20px}.workflow-comment-editor{border:1px solid #cbd5e1;border-radius:6px;background-color:#fff;display:flex;flex-direction:column;height:250px;max-height:300px;overflow:visible!important;position:relative}::ng-deep .workflow-comment-editor lib-editor{display:flex!important;flex-direction:column!important;height:100%!important;width:100%!important;overflow:visible!important}::ng-deep .workflow-comment-editor lib-editor>div{gap:0!important;height:100%!important;display:flex!important;flex-direction:column!important;overflow:visible!important}::ng-deep .workflow-comment-editor .editor-menu{flex-shrink:0!important;padding:4px 6px;background-color:#f8fafc;border-bottom:1px solid #e2e8f0;gap:4px;overflow:visible!important;border-top-left-radius:5px;border-top-right-radius:5px;position:relative;z-index:50}::ng-deep .workflow-comment-editor .editor-menu-group{overflow:visible!important}::ng-deep .workflow-comment-editor .color-picker-popover{max-height:240px!important;overflow-y:auto!important;overflow-x:hidden!important;z-index:1050!important;box-shadow:0 10px 25px -5px #00000040,0 8px 10px -6px #00000026!important;border:1px solid #cbd5e1!important}::ng-deep .workflow-comment-editor .color-picker-popover::-webkit-scrollbar{width:5px!important}::ng-deep .workflow-comment-editor .color-picker-popover::-webkit-scrollbar-track{background:transparent!important}::ng-deep .workflow-comment-editor .color-picker-popover::-webkit-scrollbar-thumb{background:#cbd5e1!important;border-radius:3px!important}::ng-deep .workflow-comment-editor .color-picker-popover::-webkit-scrollbar-thumb:hover{background:#94a3b8!important}::ng-deep .workflow-comment-editor .color-picker-backdrop{z-index:1040!important}::ng-deep .workflow-comment-editor .font-family-popover,::ng-deep .workflow-comment-editor .font-size-popover{z-index:1050!important}::ng-deep .workflow-comment-editor .font-picker-backdrop{z-index:1040!important}::ng-deep .workflow-comment-editor .editor-menu-item{width:26px;height:26px;border-radius:4px;background:transparent;transition:background-color .15s ease}::ng-deep .workflow-comment-editor .editor-menu-item:hover{background-color:#e2e8f0}::ng-deep .workflow-comment-editor .font-family-trigger{height:26px;width:110px;font-size:11px}::ng-deep .workflow-comment-editor .font-size-group{height:26px}::ng-deep .workflow-comment-editor .font-size-step-btn{height:24px;width:18px}::ng-deep .workflow-comment-editor .font-size-combobox{height:24px}::ng-deep .workflow-comment-editor .font-size-input{font-size:11px}::ng-deep .workflow-comment-editor .editor-container{flex:1 1 0!important;min-height:0!important;height:100%!important;gap:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}::ng-deep .workflow-comment-editor lib-editor-designer{display:flex!important;flex-direction:column!important;flex:1 1 0!important;min-height:0!important;height:100%!important;overflow:hidden!important}::ng-deep .workflow-comment-editor .editable-div-wrapper{flex:1 1 0!important;min-height:0!important;height:100%!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;padding:0!important;background-color:#fff}::ng-deep .workflow-comment-editor .editable{flex:1 1 0!important;min-height:0!important;height:100%!important;overflow-y:auto!important;overflow-x:auto!important;padding:10px 12px 40px!important;outline:none;font-size:13px;line-height:1.5;box-sizing:border-box!important}::ng-deep .workflow-comment-editor [title=\"Code View\"]{display:none!important}::ng-deep .comment-html-content table{width:100%;border-collapse:collapse;margin:.75rem 0;font-size:.8125rem}::ng-deep .comment-html-content th,::ng-deep .comment-html-content td{border:1px solid #cbd5e1;padding:8px 12px;text-align:left}::ng-deep .comment-html-content th{background-color:#f8fafc;font-weight:600}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i5.SvgComponent, selector: "verben-svg", inputs: ["icon", "width", "height", "fill", "stroke", "type", "size"] }, { kind: "component", type: i5.VerbenPopUpComponent, selector: "verben-pop-Up", inputs: ["dropdownOpen", "dropdownWidth", "color", "customStyles", "popUpClass", "border", "borderRadius", "enableMouseLeave", "cdkPosition"], outputs: ["dropdownOpenChange", "close"] }, { kind: "component", type: i5.VerbenaButtonComponent, selector: "verbena-button", inputs: ["type", "text", "styleType", "size", "block", "disable", "disabled", "isLoading", "spinnerSize", "spinnerColor", "svg", "svgPosition", "svgWidth", "svgHeight", "svgSize", "svgColor", "icon", "useIcon", "iconPosition", "iconColor", "variant", "weight", "bgColor", "textColor", "border", "borderRadius", "pd", "width", "height", "fontSize", "fontWeight", "buttonClass", "buttonTextClass"] }, { kind: "component", type: i5.DropDownComponent, selector: "verben-drop-down", inputs: ["options", "width", "overlayWidth", "showHorizontalLine", "horizontalLineColor", "optionLabel", "optionSubLabel", "optionValue", "placeholder", "invalidMessage", "errorPosition", "loadMoreCaption", "display", "showClear", "lazyLoad", "selectKey", "styleClass", "group", "multiselect", "filter", "avoidDuplication", "filterBy", "debounceTime", "minChar", "refPageSize", "disabled", "required", "autoScrollToCurrentItem", "load", "asyncLabel", "search"], outputs: ["optionsChange", "onChange", "onClick", "onClear"] }, { kind: "component", type: i5.TooltipComponent, selector: "verben-tooltip", inputs: ["tooltipContent", "customClass", "backgroundColor", "textColor", "padding", "borderRadius", "zIndex", "border", "width", "top", "bottom", "left", "right"] }, { kind: "component", type: i5.VerbenDialogueComponent, selector: "verben-dialogue", inputs: ["dialogueWidth", "headerTemplate", "bodyTemplate", "footerTemplate", "showCloseIcon", "dismissOutsideClick", "closeOnEscape", "isVisible", "size", "backdropColor", "customClass", "disableFooter", "margin", "padding", "borderRadius", "dialogueBgColor", "width", "closeIconClass", "boxShadow", "enableTransition", "modalData", "mode", "position", "drawerWidth"], outputs: ["openModal", "closeModal"] }, { kind: "component", type: i5.VerbenaTextareaComponent, selector: "verbena-textarea", inputs: ["disabled", "label", "required", "rows", "cols", "bgColor", "textColor", "border", "borderRadius", "pd", "width", "height", "value", "errorMessageColor"], outputs: ["valueChange"] }, { kind: "component", type: i6.EditorComponent, selector: "lib-editor", inputs: ["themeColor", "disabled", "editorMode", "editorConfig", "content"], outputs: ["editorModeChange", "onImageEdit", "onSortEdit"] }, { kind: "component", type: i7.FormControlComponent, selector: "form-control", inputs: ["dataType", "value", "boolInputType", "formProperties", "disabled"] }, { kind: "component", type: i8.FormViewerComponent, selector: "app-form-viewer", inputs: ["form", "isVisible"], outputs: ["onOpen", "onClose"] }, { kind: "pipe", type: i3.SlicePipe, name: "slice" }, { kind: "pipe", type: i3.DatePipe, name: "date" }] });
822
883
  }
823
884
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WorkflowStageComponent /* implements DoCheck */, decorators: [{
824
885
  type: Component,
825
- args: [{ selector: 'app-workflow-stage', template: "<div\n (scroll)=\"onStageMouseLeave()\"\n class=\"flex overflow-x-auto items-start min-h-max overflow-y-clip pt-3 pb-3 px-1\"\n>\n <div\n *ngFor=\"\n let stage of localHistoryToDate;\n trackBy: trackByStage;\n let i = index\n \"\n >\n <div class=\"flex items-center\">\n <!-- Stage circle with hover actor tooltip and click stage options popup -->\n <ng-container\n *ngIf=\"taskCode || (this.task && this.task.Code); else plainStageCircle\"\n >\n <verben-pop-Up\n #popup3\n [customStyles]=\"{ 'z-index': '99' }\"\n [enableMouseLeave]=\"false\"\n [cdkPosition]=\"popupPositions\"\n >\n <div\n dropdown-trigger\n (click)=\"onStageClick()\"\n (mouseenter)=\"onStageMouseEnter(stage, $event)\"\n (mouseleave)=\"onStageMouseLeave()\"\n class=\"w-[30px] h-[30px] flex cursor-pointer justify-center items-center rounded-full bg-primary text-white shadow-xs hover:ring-2 hover:ring-primary/30 transition-all duration-150\"\n >\n <!-- Clean modern checkmark -->\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <polyline points=\"20 6 9 17 4 12\"></polyline>\n </svg>\n </div>\n\n <div\n class=\"pop-up-content flex flex-col py-1.5 min-w-[170px]\"\n dropdown-content\n >\n <div\n class=\"px-[18px] py-1.5 border-b border-gray-100 flex items-center gap-1.5\"\n >\n <span\n class=\"w-1.5 h-1.5 rounded-full bg-primary inline-block\"\n ></span>\n <span\n class=\"text-[11px] font-semibold text-gray-500 uppercase tracking-wider\"\n >\n {{ stage.ToStageName || stage.ActionName || \"Stage Options\" }}\n </span>\n </div>\n <ul class=\"flex flex-col py-1\">\n <li>\n <button\n type=\"button\"\n class=\"w-full text-left px-[18px] py-2 text-xs font-medium text-gray-700 hover:bg-gray-50 hover:text-primary transition-colors cursor-pointer flex items-center gap-2\"\n (click)=\"openViewComment(stage)\"\n >\n <svg\n width=\"13\"\n height=\"13\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path\n d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\"\n ></path>\n </svg>\n <span>View Comment</span>\n </button>\n </li>\n <li>\n <button\n type=\"button\"\n class=\"w-full text-left px-[18px] py-2 text-xs font-medium text-gray-700 hover:bg-gray-50 hover:text-primary transition-colors cursor-pointer flex items-center gap-2\"\n (click)=\"loadFormIfExists(stage.ToStage); closePopUp3()\"\n >\n <svg\n width=\"13\"\n height=\"13\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path\n d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"\n ></path>\n <polyline points=\"14 2 14 8 20 8\"></polyline>\n <line x1=\"16\" y1=\"13\" x2=\"8\" y2=\"13\"></line>\n <line x1=\"16\" y1=\"17\" x2=\"8\" y2=\"17\"></line>\n <polyline points=\"10 9 9 9 8 9\"></polyline>\n </svg>\n <span>Load Stage Form</span>\n </button>\n </li>\n </ul>\n </div>\n </verben-pop-Up>\n </ng-container>\n\n <!-- Plain checkmark when not in task mode -->\n <ng-template #plainStageCircle>\n <div\n (mouseenter)=\"onStageMouseEnter(stage, $event)\"\n (mouseleave)=\"onStageMouseLeave()\"\n class=\"w-[30px] h-[30px] flex justify-center items-center rounded-full bg-primary text-white shadow-xs\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <polyline points=\"20 6 9 17 4 12\"></polyline>\n </svg>\n </div>\n </ng-template>\n\n <ng-container\n *ngIf=\"\n localHistoryToDate[i + 1] ||\n (i === localHistoryToDate.length - 1 &&\n localNextActions.length > 0 &&\n !readOnly)\n \"\n >\n <div\n class=\"border-primary border-b-2 w-[50px] relative px-2 text-xs text-primary font-medium\"\n ></div>\n </ng-container>\n <div\n *ngIf=\"\n i === localHistoryToDate.length - 1 &&\n localNextActions.length > 0 &&\n !readOnly\n \"\n class=\"relative inline-flex\"\n >\n <verben-pop-Up\n #popup2\n [customStyles]=\"{ 'z-index': '99' }\"\n [enableMouseLeave]=\"false\"\n [cdkPosition]=\"passOnPositions\"\n >\n <div dropdown-trigger class=\"inline-flex\">\n <p\n (click)=\"\n openCommentFor(selectedAction || localNextActions[0], $event)\n \"\n [ngClass]=\"{\n 'cursor-not-allowed opacity-50 pointer-events-none':\n disableNotActor(),\n 'cursor-pointer': !disableNotActor(),\n }\"\n class=\"text-center min-w-max rounded-md h-[30px] text-[white] text-sm flex justify-center items-center py-1 max-w-fit px-2 bg-primary\"\n >\n {{\n selectedAction?.Name ||\n selectedAction?.ToStageName ||\n localNextActions[0]?.Name ||\n localNextActions[0]?.ToStageName\n }}\n </p>\n </div>\n\n <div class=\"pop-up-content flex flex-col\" dropdown-content>\n <div\n class=\"py-4 px-[18px] transition-all duration-200 max-h-[45vh] overflow-y-auto\"\n [style.width]=\"isRichEditor ? '580px' : '420px'\"\n >\n <!-- Coherent Header -->\n <div\n class=\"flex items-center justify-between pb-3 mb-3 border-b border-gray-200\"\n >\n <div class=\"flex items-center gap-2\">\n <span\n class=\"w-2 h-2 rounded-full bg-primary inline-block\"\n ></span>\n <h3\n class=\"text-sm font-semibold text-gray-800 tracking-tight\"\n >\n {{ getActionCaption(selectedAction) || \"Add Comment\" }}\n </h3>\n </div>\n <button\n type=\"button\"\n (click)=\"closePopUp2()\"\n class=\"text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-md hover:bg-gray-100 cursor-pointer\"\n title=\"Close\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n </button>\n </div>\n\n <div class=\"flex flex-col gap-3\">\n <!-- Send To -->\n <div\n class=\"flex flex-col gap-1.5\"\n *ngIf=\"nextActors.length > 0\"\n >\n <div class=\"flex items-center justify-between\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase\"\n >\n Send To\n </label>\n <span class=\"text-[11px] text-gray-400\">Optional</span>\n </div>\n <verben-drop-down\n width=\"100%\"\n label=\"Send to (optional)\"\n [options]=\"nextActors\"\n optionLabel=\"Name\"\n optionValue=\"Identifier\"\n [filter]=\"true\"\n [filterBy]=\"'Name'\"\n [(ngModel)]=\"selectedRecipient\"\n [showClear]=\"true\"\n ></verben-drop-down>\n </div>\n\n <!-- Copy -->\n <div class=\"flex flex-col gap-1.5\">\n <div class=\"flex items-center justify-between\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase\"\n >\n Copy\n </label>\n <span class=\"text-[11px] text-gray-400\">Notify actors</span>\n </div>\n <verben-drop-down\n selectKey=\"Code\"\n display=\"chip\"\n width=\"100%\"\n placeholder=\"Select Actors\"\n [showClear]=\"true\"\n [filter]=\"true\"\n (onChange)=\"onCopyChanged($event)\"\n [load]=\"this.loadMoreActors.bind(this)\"\n [search]=\"this.searchActors.bind(this)\"\n [(options)]=\"actors\"\n optionLabel=\"Name\"\n [multiselect]=\"true\"\n [(ngModel)]=\"copy\"\n [lazyLoad]=\"true\"\n [asyncLabel]=\"this.getAsyncLabel.bind(this)\"\n >\n </verben-drop-down>\n </div>\n\n <!-- Comment with Mode Switcher -->\n <div class=\"flex flex-col gap-1.5\">\n <div class=\"flex items-center justify-between mb-0.5\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase flex items-center gap-1\"\n >\n <span>Comment</span>\n <span class=\"text-red-500\">*</span>\n </label>\n\n <!-- Mode Switch Pill -->\n <div\n class=\"inline-flex items-center bg-gray-100 p-0.5 rounded-md border border-gray-200\"\n >\n <button\n type=\"button\"\n (click)=\"setEditorMode(false)\"\n [ngClass]=\"\n !isRichEditor\n ? 'bg-white text-gray-800 shadow-xs font-medium'\n : 'text-gray-500 hover:text-gray-700'\n \"\n class=\"px-2 py-0.5 text-xs rounded transition-all cursor-pointer flex items-center gap-1\"\n title=\"Simple textarea\"\n >\n <span>Simple</span>\n </button>\n <button\n type=\"button\"\n (click)=\"setEditorMode(true)\"\n [ngClass]=\"\n isRichEditor\n ? 'bg-white text-gray-800 shadow-xs font-medium'\n : 'text-gray-500 hover:text-gray-700'\n \"\n class=\"px-2 py-0.5 text-xs rounded transition-all cursor-pointer flex items-center gap-1\"\n title=\"Rich text editor with formatting & tables\"\n >\n <svg\n width=\"11\"\n height=\"11\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M4 7V4h16v3M9 20h6M12 4v16\" />\n </svg>\n <span>Rich / Tables</span>\n </button>\n </div>\n </div>\n\n <!-- Simple Textarea Mode -->\n <div *ngIf=\"!isRichEditor\" class=\"w-full\">\n <verbena-textarea\n [(ngModel)]=\"commentText\"\n [rows]=\"4\"\n width=\"100%\"\n border=\"1px solid #cbd5e1\"\n borderRadius=\"6px\"\n ></verbena-textarea>\n </div>\n\n <!-- Rich Reporting Editor Mode -->\n <div\n *ngIf=\"isRichEditor\"\n class=\"workflow-comment-editor w-full\"\n >\n <lib-editor\n [editorConfig]=\"editorConfig\"\n [editorMode]=\"editorMode\"\n [(ngModel)]=\"commentText\"\n ></lib-editor>\n </div>\n </div>\n </div>\n\n <!-- Action Buttons -->\n <div class=\"flex justify-end gap-3 mt-4 pt-2\">\n <verbena-button\n (click)=\"closePopUp2()\"\n text=\"Cancel\"\n ></verbena-button>\n <verbena-button\n class=\"verben-primary-button\"\n text=\"OK\"\n (click)=\"completeAction(selectedAction)\"\n [disable]=\"!isCommentValid()\"\n ></verbena-button>\n </div>\n </div>\n </div>\n </verben-pop-Up>\n\n <div *ngIf=\"canPick()\" class=\"absolute -top-2 -right-2 z-10\">\n <verben-pop-Up\n #popup4\n [customStyles]=\"{ 'z-index': '99' }\"\n [enableMouseLeave]=\"false\"\n [cdkPosition]=\"reassignPositions\"\n >\n <div\n dropdown-trigger\n (click)=\"openPickPopup($event)\"\n [title]=\"\n isReassign()\n ? 'Reassign task to yourself to act on this stage'\n : 'Pick task to act on this stage'\n \"\n class=\"w-[18px] h-[18px] rounded-full bg-[#FFE681] ring-2 ring-white shadow flex items-center justify-center cursor-pointer\"\n >\n <verben-svg\n icon=\"user\"\n fill=\"#404040\"\n [width]=\"12\"\n [height]=\"12\"\n ></verben-svg>\n </div>\n\n <div class=\"pop-up-content flex flex-col\" dropdown-content>\n <div\n class=\"py-4 px-[18px] transition-all duration-200\"\n [style.width]=\"isPickRichEditor ? '580px' : '420px'\"\n >\n <!-- Coherent Header -->\n <div\n class=\"flex items-center justify-between pb-3 mb-3 border-b border-gray-200\"\n >\n <div class=\"flex items-center gap-2\">\n <span\n class=\"w-2 h-2 rounded-full bg-primary inline-block\"\n ></span>\n <h3\n class=\"text-sm font-semibold text-gray-800 tracking-tight\"\n >\n {{ isReassign() ? \"Reassign Task\" : \"Pick Task\" }}\n </h3>\n </div>\n <button\n type=\"button\"\n (click)=\"closePopUp4()\"\n class=\"text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-md hover:bg-gray-100 cursor-pointer\"\n title=\"Close\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n </button>\n </div>\n\n <div class=\"flex flex-col gap-3\">\n <!-- Stage (if not reassign) -->\n <div class=\"flex flex-col gap-1.5\" *ngIf=\"!isReassign()\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase flex items-center gap-1\"\n >\n <span>Stage</span>\n <span class=\"text-red-500\">*</span>\n </label>\n <verben-drop-down\n width=\"100%\"\n label=\"Stage\"\n [options]=\"task?.FullStages || []\"\n optionLabel=\"Name\"\n optionValue=\"Code\"\n [(ngModel)]=\"selectedStageCode\"\n [showClear]=\"true\"\n ></verben-drop-down>\n </div>\n\n <!-- Assign To -->\n <div class=\"flex flex-col gap-1.5\">\n <div class=\"flex items-center justify-between\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase\"\n >\n Assign to\n </label>\n <span class=\"text-[11px] text-gray-400\"\n >Current Actor</span\n >\n </div>\n <verben-drop-down\n width=\"100%\"\n label=\"Assign to\"\n [options]=\"pickActors\"\n optionLabel=\"Name\"\n optionValue=\"Identifier\"\n [(ngModel)]=\"pickRecipient\"\n [disabled]=\"true\"\n ></verben-drop-down>\n </div>\n\n <!-- Comment with Mode Switcher -->\n <div class=\"flex flex-col gap-1.5\">\n <div class=\"flex items-center justify-between mb-0.5\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase flex items-center gap-1\"\n >\n <span>Comment</span>\n <span class=\"text-red-500\">*</span>\n </label>\n\n <!-- Mode Switch Pill -->\n <div\n class=\"inline-flex items-center bg-gray-100 p-0.5 rounded-md border border-gray-200\"\n >\n <button\n type=\"button\"\n (click)=\"setPickEditorMode(false)\"\n [ngClass]=\"\n !isPickRichEditor\n ? 'bg-white text-gray-800 shadow-xs font-medium'\n : 'text-gray-500 hover:text-gray-700'\n \"\n class=\"px-2 py-0.5 text-xs rounded transition-all cursor-pointer flex items-center gap-1\"\n title=\"Simple textarea\"\n >\n <span>Simple</span>\n </button>\n <button\n type=\"button\"\n (click)=\"setPickEditorMode(true)\"\n [ngClass]=\"\n isPickRichEditor\n ? 'bg-white text-gray-800 shadow-xs font-medium'\n : 'text-gray-500 hover:text-gray-700'\n \"\n class=\"px-2 py-0.5 text-xs rounded transition-all cursor-pointer flex items-center gap-1\"\n title=\"Rich text editor with formatting & tables\"\n >\n <svg\n width=\"11\"\n height=\"11\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M4 7V4h16v3M9 20h6M12 4v16\" />\n </svg>\n <span>Rich / Tables</span>\n </button>\n </div>\n </div>\n\n <!-- Simple Textarea Mode -->\n <div *ngIf=\"!isPickRichEditor\" class=\"w-full\">\n <verbena-textarea\n [(ngModel)]=\"pickComment\"\n [rows]=\"4\"\n width=\"100%\"\n border=\"1px solid #cbd5e1\"\n borderRadius=\"6px\"\n ></verbena-textarea>\n </div>\n\n <!-- Rich Reporting Editor Mode -->\n <div\n *ngIf=\"isPickRichEditor\"\n class=\"workflow-comment-editor w-full\"\n >\n <lib-editor\n [editorConfig]=\"editorConfig\"\n [editorMode]=\"editorMode\"\n [(ngModel)]=\"pickComment\"\n ></lib-editor>\n </div>\n </div>\n </div>\n\n <!-- Action Buttons -->\n <div class=\"flex justify-end gap-3 mt-4 pt-2\">\n <verbena-button\n (click)=\"closePopUp4()\"\n text=\"Cancel\"\n ></verbena-button>\n <verbena-button\n class=\"verben-primary-button\"\n text=\"OK\"\n (click)=\"submitPick()\"\n [disable]=\"\n !isPickCommentValid() ||\n !pickRecipient ||\n (!isReassign() && !selectedStageCode)\n \"\n ></verbena-button>\n </div>\n </div>\n </div>\n </verben-pop-Up>\n </div>\n </div>\n\n <ng-container>\n <div\n *ngIf=\"localHistoryToDate[i + 1]?.ActionName\"\n class=\"border-primary border-b-2 w-[50px] relative px-2 text-xs text-primary font-medium\"\n ></div>\n </ng-container>\n\n <ng-container\n *ngIf=\"\n i === localHistoryToDate.length - 1 &&\n localNextActions.length > 0 &&\n localNextActions.length !== 1 &&\n !readOnly\n \"\n >\n <div>\n <verben-pop-Up\n #popup\n [customStyles]=\"{ 'z-index': '99' }\"\n [enableMouseLeave]=\"false\"\n [cdkPosition]=\"popupPositions\"\n >\n <div dropdown-trigger class=\"flex items-center\">\n <div class=\"w-[20px] h-[2px] bg-[#D4A007]\"></div>\n <div class=\"mt-2\">\n <verben-svg\n class=\"cursor-pointer actions-icon\"\n stroke=\"#D4A007\"\n icon=\"chevron\"\n ></verben-svg>\n </div>\n </div>\n\n <div\n class=\"pop-up-content flex flex-col py-1.5 min-w-[170px]\"\n dropdown-content\n >\n <div\n class=\"px-[18px] py-1.5 border-b border-gray-100 flex items-center gap-1.5\"\n >\n <span\n class=\"w-1.5 h-1.5 rounded-full bg-primary inline-block\"\n ></span>\n <span\n class=\"text-[11px] font-semibold text-gray-500 uppercase tracking-wider\"\n >Actions</span\n >\n </div>\n <ul class=\"flex flex-col py-1\">\n <li\n *ngFor=\"\n let action of localNextActions;\n trackBy: trackByAction\n \"\n >\n <button\n [disabled]=\"disableNotActor()\"\n class=\"w-full text-left px-[18px] py-2 text-xs font-medium text-gray-700 hover:bg-gray-50 hover:text-primary transition-colors disabled:cursor-not-allowed disabled:opacity-40 cursor-pointer flex items-center justify-between\"\n (click)=\"openCommentFor(action, $event); closePopUp()\"\n >\n <span>{{\n action.Name || action.ToStageName || \"Unnamed\"\n }}</span>\n </button>\n </li>\n </ul>\n </div>\n </verben-pop-Up>\n </div>\n </ng-container>\n </div>\n <ng-container\n *ngIf=\"\n stage.ToStageName && stage.ToStageName.length > 20;\n else plainStageName\n \"\n >\n <verben-tooltip\n [top]=\"'0px'\"\n [textColor]=\"'#000'\"\n [backgroundColor]=\"'#D3D3D3'\"\n [left]=\"'0'\"\n [tooltipContent]=\"tooltipTemplate2\"\n #tooltip\n >\n <p\n class=\"text-xs min-w-max left-0 text-primary mt-1 font-semibold capitalize\"\n >\n {{ stage.ToStageName | slice: 0 : 20 }}...\n </p>\n </verben-tooltip>\n <ng-template #tooltipTemplate2>\n <div>\n <p class=\"text-xs\">{{ stage.ToStageName }}</p>\n </div>\n </ng-template>\n </ng-container>\n <ng-template #plainStageName>\n <p\n class=\"text-xs min-w-max left-0 text-primary mt-1 font-semibold capitalize\"\n >\n {{ stage.ToStageName || \"\" }}\n </p>\n </ng-template>\n </div>\n</div>\n<verben-dialogue\n [dismissOutsideClick]=\"true\"\n [closeOnEscape]=\"true\"\n [mode]=\"'drawer'\"\n [padding]=\"'0px'\"\n [drawerWidth]=\"'500px'\"\n position=\"right\"\n [disableFooter]=\"false\"\n [isVisible]=\"isVisible\"\n [modalData]=\"taskForms\"\n (openModal)=\"onModalOpen($event)\"\n (closeModal)=\"onModalClose($event)\"\n [headerTemplate]=\"headerTemplate\"\n [bodyTemplate]=\"bodyTemplate\"\n [showCloseIcon]=\"true\"\n>\n</verben-dialogue>\n\n<ng-template #headerTemplate>\n <div class=\"bg-[#FFE681] px-6 py-4 flex justify-between items-center\">\n <h1>{{ forms[0]?.Name }}</h1>\n </div>\n</ng-template>\n\n<ng-template #bodyTemplate>\n <div class=\"py-3 px-[18px]\">\n <div *ngIf=\"forms?.[active]?.Entities?.length; else emptyState\">\n <div\n *ngFor=\"let entity of forms[active]?.Entities; let j = index\"\n class=\"mb-6 pb-4\"\n >\n <form-control\n [formProperties]=\"entity?.Properties || []\"\n ></form-control>\n <div class=\"flex gap-3 justify-end mt-4\">\n <verbena-button\n class=\"verben-primary-button\"\n (click)=\"submitForm(active)\"\n [disable]=\"!areRequiredPropertiesFilled(entity?.Properties)\"\n text=\"Proceed\"\n ></verbena-button>\n </div>\n </div>\n </div>\n\n <ng-template #emptyState>\n <p class=\"mt-4 p-4 text-gray-600 text-center\">\n No entries available for the selected form group.\n </p>\n </ng-template>\n </div>\n</ng-template>\n\n<app-form-viewer\n [form]=\"activeForm\"\n [isVisible]=\"isFormViewerVisible\"\n (onOpen)=\"onFormViewerOpen()\"\n (onClose)=\"onFormViewerClose()\"\n></app-form-viewer>\n\n<!-- Floating Actor Tooltip with Edge Detection -->\n<div\n *ngIf=\"\n hoveredStage && (hoveredStage.Actor?.Identifier || hoveredStage.Actor?.Name)\n \"\n class=\"fixed z-[9999] pointer-events-none transition-opacity duration-150 ease-out\"\n [style.top.px]=\"stageTooltipPos.top\"\n [style.left.px]=\"stageTooltipPos.left\"\n [style.transform]=\"stageTooltipPos.transform\"\n>\n <div\n class=\"bg-gray-800 text-white text-xs rounded-md px-2.5 py-1 shadow-md whitespace-nowrap relative flex items-center gap-1.5\"\n >\n <verben-svg\n [width]=\"12\"\n [height]=\"12\"\n [icon]=\"'user'\"\n stroke=\"#cbd5e1\"\n ></verben-svg>\n <span class=\"font-medium text-[12px]\">{{\n hoveredStage.Actor?.Name || hoveredStage.Actor?.Identifier\n }}</span>\n <!-- <span\n *ngIf=\"\n hoveredStage.Actor?.Name &&\n hoveredStage.Actor?.Identifier &&\n hoveredStage.Actor.Name !== hoveredStage.Actor.Identifier\n \"\n class=\"text-gray-300 text-[11px]\"\n >\n ({{ hoveredStage.Actor.Identifier }})\n </span> -->\n\n <!-- Arrow pointing toward circle -->\n <div\n *ngIf=\"stageTooltipPos.showAbove\"\n class=\"absolute left-1/2 -bottom-[4px] -translate-x-1/2 w-0 h-0 border-x-4 border-x-transparent border-t-[4px] border-t-gray-800\"\n ></div>\n <div\n *ngIf=\"!stageTooltipPos.showAbove\"\n class=\"absolute left-1/2 -top-[4px] -translate-x-1/2 w-0 h-0 border-x-4 border-x-transparent border-b-[4px] border-b-gray-800\"\n ></div>\n </div>\n</div>\n\n<!-- View Stage Comment Dialogue -->\n<verben-dialogue\n [showCloseIcon]=\"false\"\n [dismissOutsideClick]=\"true\"\n [closeOnEscape]=\"true\"\n [size]=\"'medium'\"\n [dialogueWidth]=\"'580px'\"\n [mode]=\"'dialogue'\"\n [padding]=\"'16px 18px'\"\n [customClass]=\"'show-form max-w-[92vw]'\"\n [disableFooter]=\"true\"\n [isVisible]=\"isViewCommentModalOpen\"\n [bodyTemplate]=\"commentDialogBody\"\n (closeModal)=\"closeViewComment()\"\n>\n <ng-template #commentDialogBody>\n <div class=\"dialog-body flex flex-col gap-4\">\n <!-- Header with Title, Copy, Close X -->\n <div\n class=\"flex items-center justify-between pb-3 border-b border-gray-200\"\n >\n <div class=\"flex items-center gap-2\">\n <span class=\"w-2 h-2 rounded-full bg-primary inline-block\"></span>\n <h3 class=\"text-sm font-semibold text-gray-800 tracking-tight\">\n {{\n viewCommentStage?.ToStageName ||\n viewCommentStage?.ActionName ||\n \"Stage\"\n }}\n - Comment\n </h3>\n </div>\n <div class=\"flex items-center gap-2\">\n <!-- Copy Button -->\n <button\n *ngIf=\"viewCommentDecoded\"\n type=\"button\"\n (click)=\"copyViewCommentText()\"\n class=\"text-xs px-2.5 py-1 rounded bg-gray-100 hover:bg-gray-200 text-gray-700 transition-colors cursor-pointer flex items-center gap-1.5 border border-gray-200 select-none\"\n title=\"Copy comment to clipboard\"\n >\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\"></rect>\n <path\n d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"\n ></path>\n </svg>\n <span>{{ viewCommentCopyStatus }}</span>\n </button>\n\n <!-- Close button -->\n <button\n type=\"button\"\n (click)=\"closeViewComment()\"\n class=\"text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-md hover:bg-gray-100 cursor-pointer\"\n title=\"Close\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n </button>\n </div>\n </div>\n\n <!-- Scrollable Content: max-height similar to comment popup (45vh) -->\n <div class=\"max-h-[45vh] overflow-y-auto select-text pr-1\">\n <!-- Actor & Date Metadata -->\n <div\n *ngIf=\"viewCommentStage?.Actor?.Name || viewCommentStage?.CreatedAt\"\n class=\"flex items-center justify-between text-xs text-gray-500 mb-3 pb-2 border-b border-gray-100\"\n >\n <span\n *ngIf=\"viewCommentStage?.Actor?.Name\"\n class=\"font-medium text-gray-700\"\n >\n By: {{ viewCommentStage?.Actor?.Name }}\n </span>\n <span *ngIf=\"viewCommentStage?.CreatedAt\">\n {{ viewCommentStage?.CreatedAt | date: \"medium\" }}\n </span>\n </div>\n\n <!-- Comment body: HTML or plain text -->\n <div\n *ngIf=\"isViewCommentHtml; else plainViewComment\"\n class=\"comment-html-content w-full overflow-x-auto text-sm text-gray-800 leading-relaxed\"\n [innerHTML]=\"viewCommentFormatted\"\n ></div>\n\n <ng-template #plainViewComment>\n <p\n *ngIf=\"viewCommentDecoded; else emptyViewComment\"\n class=\"whitespace-pre-wrap break-words text-sm leading-relaxed text-gray-800\"\n >\n {{ viewCommentDecoded }}\n </p>\n <ng-template #emptyViewComment>\n <p class=\"text-xs italic text-gray-400 py-6 text-center\">\n No comment recorded for this stage.\n </p>\n </ng-template>\n </ng-template>\n </div>\n\n <!-- Footer button matching form-viewer -->\n <div\n class=\"dialog-button-container flex justify-end gap-2 pt-2 border-t border-gray-100\"\n >\n <verbena-button\n width=\"100%\"\n class=\"verben-primary-button\"\n [text]=\"'Close'\"\n (click)=\"closeViewComment()\"\n >\n </verbena-button>\n </div>\n </div>\n </ng-template>\n</verben-dialogue>\n", styles: [".workflow-container{position:relative}.dialog{position:absolute;top:100%;left:0;background:var(--vbn-color-surface);border:1px solid var(--vbn-color-border);padding:1rem}.completed{text-decoration:line-through;color:var(--vbn-color-text-muted)}.pop-up-content{border-radius:8px;background-color:var(--vbn-color-surface, #ffffff);border:1px solid #e2e8f0;box-shadow:0 10px 25px -5px #0000001a,0 8px 10px -6px #0000000d}.dialog-body{padding:0;height:100%}.pop-up-value{padding:10px 20px}.workflow-comment-editor{border:1px solid #cbd5e1;border-radius:6px;background-color:#fff;display:flex;flex-direction:column;height:250px;max-height:300px;overflow:visible!important;position:relative}::ng-deep .workflow-comment-editor lib-editor{display:flex!important;flex-direction:column!important;height:100%!important;width:100%!important;overflow:visible!important}::ng-deep .workflow-comment-editor lib-editor>div{gap:0!important;height:100%!important;display:flex!important;flex-direction:column!important;overflow:visible!important}::ng-deep .workflow-comment-editor .editor-menu{flex-shrink:0!important;padding:4px 6px;background-color:#f8fafc;border-bottom:1px solid #e2e8f0;gap:4px;overflow:visible!important;border-top-left-radius:5px;border-top-right-radius:5px;position:relative;z-index:50}::ng-deep .workflow-comment-editor .editor-menu-group{overflow:visible!important}::ng-deep .workflow-comment-editor .color-picker-popover{max-height:240px!important;overflow-y:auto!important;overflow-x:hidden!important;z-index:1050!important;box-shadow:0 10px 25px -5px #00000040,0 8px 10px -6px #00000026!important;border:1px solid #cbd5e1!important}::ng-deep .workflow-comment-editor .color-picker-popover::-webkit-scrollbar{width:5px!important}::ng-deep .workflow-comment-editor .color-picker-popover::-webkit-scrollbar-track{background:transparent!important}::ng-deep .workflow-comment-editor .color-picker-popover::-webkit-scrollbar-thumb{background:#cbd5e1!important;border-radius:3px!important}::ng-deep .workflow-comment-editor .color-picker-popover::-webkit-scrollbar-thumb:hover{background:#94a3b8!important}::ng-deep .workflow-comment-editor .color-picker-backdrop{z-index:1040!important}::ng-deep .workflow-comment-editor .font-family-popover,::ng-deep .workflow-comment-editor .font-size-popover{z-index:1050!important}::ng-deep .workflow-comment-editor .font-picker-backdrop{z-index:1040!important}::ng-deep .workflow-comment-editor .editor-menu-item{width:26px;height:26px;border-radius:4px;background:transparent;transition:background-color .15s ease}::ng-deep .workflow-comment-editor .editor-menu-item:hover{background-color:#e2e8f0}::ng-deep .workflow-comment-editor .font-family-trigger{height:26px;width:110px;font-size:11px}::ng-deep .workflow-comment-editor .font-size-group{height:26px}::ng-deep .workflow-comment-editor .font-size-step-btn{height:24px;width:18px}::ng-deep .workflow-comment-editor .font-size-combobox{height:24px}::ng-deep .workflow-comment-editor .font-size-input{font-size:11px}::ng-deep .workflow-comment-editor .editor-container{flex:1 1 0!important;min-height:0!important;height:100%!important;gap:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}::ng-deep .workflow-comment-editor lib-editor-designer{display:flex!important;flex-direction:column!important;flex:1 1 0!important;min-height:0!important;height:100%!important;overflow:hidden!important}::ng-deep .workflow-comment-editor .editable-div-wrapper{flex:1 1 0!important;min-height:0!important;height:100%!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;padding:0!important;background-color:#fff}::ng-deep .workflow-comment-editor .editable{flex:1 1 0!important;min-height:0!important;height:100%!important;overflow-y:auto!important;overflow-x:auto!important;padding:10px 12px 40px!important;outline:none;font-size:13px;line-height:1.5;box-sizing:border-box!important}::ng-deep .workflow-comment-editor [title=\"Code View\"]{display:none!important}::ng-deep .comment-html-content table{width:100%;border-collapse:collapse;margin:.75rem 0;font-size:.8125rem}::ng-deep .comment-html-content th,::ng-deep .comment-html-content td{border:1px solid #cbd5e1;padding:8px 12px;text-align:left}::ng-deep .comment-html-content th{background-color:#f8fafc;font-weight:600}\n"] }]
886
+ args: [{ selector: 'app-workflow-stage', template: "<div\n (scroll)=\"onStageMouseLeave()\"\n class=\"flex overflow-x-auto items-start min-h-max overflow-y-clip pt-3 pb-3 px-1\"\n>\n <div\n *ngFor=\"\n let stage of localHistoryToDate;\n trackBy: trackByStage;\n let i = index\n \"\n >\n <div class=\"flex items-center\">\n <!-- Stage circle with hover actor tooltip and click stage options popup -->\n <ng-container\n *ngIf=\"taskCode || (this.task && this.task.Code); else plainStageCircle\"\n >\n <verben-pop-Up\n #popup3\n [customStyles]=\"{ 'z-index': '99' }\"\n [enableMouseLeave]=\"false\"\n [cdkPosition]=\"popupPositions\"\n >\n <div\n dropdown-trigger\n (click)=\"onStageClick()\"\n (mouseenter)=\"onStageMouseEnter(stage, $event)\"\n (mouseleave)=\"onStageMouseLeave()\"\n class=\"w-[30px] h-[30px] flex cursor-pointer justify-center items-center rounded-full bg-primary text-white shadow-xs hover:ring-2 hover:ring-primary/30 transition-all duration-150\"\n >\n <!-- Clean modern checkmark -->\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <polyline points=\"20 6 9 17 4 12\"></polyline>\n </svg>\n </div>\n\n <div\n class=\"pop-up-content flex flex-col py-1.5 min-w-[170px]\"\n dropdown-content\n >\n <div\n class=\"px-[18px] py-1.5 border-b border-gray-100 flex items-center gap-1.5\"\n >\n <span\n class=\"w-1.5 h-1.5 rounded-full bg-primary inline-block\"\n ></span>\n <span\n class=\"text-[11px] font-semibold text-gray-500 uppercase tracking-wider\"\n >\n {{ stage.ToStageName || stage.ActionName || \"Stage Options\" }}\n </span>\n </div>\n <ul class=\"flex flex-col py-1\">\n <li>\n <button\n type=\"button\"\n class=\"w-full text-left px-[18px] py-2 text-xs font-medium text-gray-700 hover:bg-gray-50 hover:text-primary transition-colors cursor-pointer flex items-center gap-2\"\n (click)=\"openViewComment(stage)\"\n >\n <svg\n width=\"13\"\n height=\"13\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path\n d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\"\n ></path>\n </svg>\n <span>View Comment</span>\n </button>\n </li>\n <li>\n <button\n type=\"button\"\n class=\"w-full text-left px-[18px] py-2 text-xs font-medium text-gray-700 hover:bg-gray-50 hover:text-primary transition-colors cursor-pointer flex items-center gap-2\"\n (click)=\"loadFormIfExists(stage.ToStage, stage); closePopUp3()\"\n >\n <svg\n width=\"13\"\n height=\"13\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path\n d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"\n ></path>\n <polyline points=\"14 2 14 8 20 8\"></polyline>\n <line x1=\"16\" y1=\"13\" x2=\"8\" y2=\"13\"></line>\n <line x1=\"16\" y1=\"17\" x2=\"8\" y2=\"17\"></line>\n <polyline points=\"10 9 9 9 8 9\"></polyline>\n </svg>\n <span>Load Stage Form</span>\n </button>\n </li>\n </ul>\n </div>\n </verben-pop-Up>\n </ng-container>\n\n <!-- Plain checkmark when not in task mode -->\n <ng-template #plainStageCircle>\n <div\n (mouseenter)=\"onStageMouseEnter(stage, $event)\"\n (mouseleave)=\"onStageMouseLeave()\"\n class=\"w-[30px] h-[30px] flex justify-center items-center rounded-full bg-primary text-white shadow-xs\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <polyline points=\"20 6 9 17 4 12\"></polyline>\n </svg>\n </div>\n </ng-template>\n\n <ng-container\n *ngIf=\"\n localHistoryToDate[i + 1] ||\n (i === localHistoryToDate.length - 1 &&\n localNextActions.length > 0 &&\n !readOnly)\n \"\n >\n <div\n class=\"border-primary border-b-2 w-[50px] relative px-2 text-xs text-primary font-medium\"\n ></div>\n </ng-container>\n <div\n *ngIf=\"\n i === localHistoryToDate.length - 1 &&\n localNextActions.length > 0 &&\n !readOnly\n \"\n class=\"relative inline-flex\"\n >\n <verben-pop-Up\n #popup2\n [customStyles]=\"{ 'z-index': '99' }\"\n [enableMouseLeave]=\"false\"\n [cdkPosition]=\"passOnPositions\"\n >\n <div dropdown-trigger class=\"inline-flex\">\n <p\n (click)=\"\n openCommentFor(selectedAction || localNextActions[0], $event)\n \"\n [ngClass]=\"{\n 'cursor-not-allowed opacity-50 pointer-events-none':\n disableNotActor(),\n 'cursor-pointer': !disableNotActor(),\n }\"\n class=\"text-center min-w-max rounded-md h-[30px] text-[white] text-sm flex justify-center items-center py-1 max-w-fit px-2 bg-primary\"\n >\n {{\n selectedAction?.Name ||\n selectedAction?.ToStageName ||\n localNextActions[0]?.Name ||\n localNextActions[0]?.ToStageName\n }}\n </p>\n </div>\n\n <div class=\"pop-up-content flex flex-col\" dropdown-content>\n <div\n class=\"py-4 px-[18px] transition-all duration-200 max-h-[45vh] overflow-y-auto\"\n [style.width]=\"isRichEditor ? '580px' : '420px'\"\n >\n <!-- Coherent Header -->\n <div\n class=\"flex items-center justify-between pb-3 mb-3 border-b border-gray-200\"\n >\n <div class=\"flex items-center gap-2\">\n <span\n class=\"w-2 h-2 rounded-full bg-primary inline-block\"\n ></span>\n <h3\n class=\"text-sm font-semibold text-gray-800 tracking-tight\"\n >\n {{ getActionCaption(selectedAction) || \"Add Comment\" }}\n </h3>\n </div>\n <button\n type=\"button\"\n (click)=\"closePopUp2()\"\n class=\"text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-md hover:bg-gray-100 cursor-pointer\"\n title=\"Close\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n </button>\n </div>\n\n <div class=\"flex flex-col gap-3\">\n <!-- Send To -->\n <div\n class=\"flex flex-col gap-1.5\"\n *ngIf=\"nextActors.length > 0\"\n >\n <div class=\"flex items-center justify-between\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase\"\n >\n Send To\n </label>\n <span class=\"text-[11px] text-gray-400\">Optional</span>\n </div>\n <verben-drop-down\n width=\"100%\"\n label=\"Send to (optional)\"\n [options]=\"nextActors\"\n optionLabel=\"Name\"\n optionValue=\"Identifier\"\n [filter]=\"true\"\n [filterBy]=\"'Name'\"\n [(ngModel)]=\"selectedRecipient\"\n [showClear]=\"true\"\n ></verben-drop-down>\n </div>\n\n <!-- Copy -->\n <div class=\"flex flex-col gap-1.5\">\n <div class=\"flex items-center justify-between\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase\"\n >\n Copy\n </label>\n <span class=\"text-[11px] text-gray-400\">Notify actors</span>\n </div>\n <verben-drop-down\n selectKey=\"Code\"\n display=\"chip\"\n width=\"100%\"\n placeholder=\"Select Actors\"\n [showClear]=\"true\"\n [filter]=\"true\"\n (onChange)=\"onCopyChanged($event)\"\n [load]=\"this.loadMoreActors.bind(this)\"\n [search]=\"this.searchActors.bind(this)\"\n [(options)]=\"actors\"\n optionLabel=\"Name\"\n [multiselect]=\"true\"\n [(ngModel)]=\"copy\"\n [lazyLoad]=\"true\"\n [asyncLabel]=\"this.getAsyncLabel.bind(this)\"\n >\n </verben-drop-down>\n </div>\n\n <!-- Comment with Mode Switcher -->\n <div class=\"flex flex-col gap-1.5\">\n <div class=\"flex items-center justify-between mb-0.5\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase flex items-center gap-1\"\n >\n <span>Comment</span>\n <span class=\"text-red-500\">*</span>\n </label>\n\n <!-- Mode Switch Pill -->\n <div\n class=\"inline-flex items-center bg-gray-100 p-0.5 rounded-md border border-gray-200\"\n >\n <button\n type=\"button\"\n (click)=\"setEditorMode(false)\"\n [ngClass]=\"\n !isRichEditor\n ? 'bg-white text-gray-800 shadow-xs font-medium'\n : 'text-gray-500 hover:text-gray-700'\n \"\n class=\"px-2 py-0.5 text-xs rounded transition-all cursor-pointer flex items-center gap-1\"\n title=\"Simple textarea\"\n >\n <span>Simple</span>\n </button>\n <button\n type=\"button\"\n (click)=\"setEditorMode(true)\"\n [ngClass]=\"\n isRichEditor\n ? 'bg-white text-gray-800 shadow-xs font-medium'\n : 'text-gray-500 hover:text-gray-700'\n \"\n class=\"px-2 py-0.5 text-xs rounded transition-all cursor-pointer flex items-center gap-1\"\n title=\"Rich text editor with formatting & tables\"\n >\n <svg\n width=\"11\"\n height=\"11\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M4 7V4h16v3M9 20h6M12 4v16\" />\n </svg>\n <span>Rich / Tables</span>\n </button>\n </div>\n </div>\n\n <!-- Simple Textarea Mode -->\n <div *ngIf=\"!isRichEditor\" class=\"w-full\">\n <verbena-textarea\n [(ngModel)]=\"commentText\"\n [rows]=\"4\"\n width=\"100%\"\n border=\"1px solid #cbd5e1\"\n borderRadius=\"6px\"\n ></verbena-textarea>\n </div>\n\n <!-- Rich Reporting Editor Mode -->\n <div\n *ngIf=\"isRichEditor\"\n class=\"workflow-comment-editor w-full\"\n >\n <lib-editor\n [editorConfig]=\"editorConfig\"\n [editorMode]=\"editorMode\"\n [(ngModel)]=\"commentText\"\n ></lib-editor>\n </div>\n </div>\n </div>\n\n <!-- Action Buttons -->\n <div class=\"flex justify-end gap-3 mt-4 pt-2\">\n <verbena-button\n (click)=\"closePopUp2()\"\n text=\"Cancel\"\n ></verbena-button>\n <verbena-button\n class=\"verben-primary-button\"\n text=\"OK\"\n (click)=\"completeAction(selectedAction)\"\n [disable]=\"!isCommentValid()\"\n ></verbena-button>\n </div>\n </div>\n </div>\n </verben-pop-Up>\n\n <div *ngIf=\"canPick()\" class=\"absolute -top-2 -right-2 z-10\">\n <verben-pop-Up\n #popup4\n [customStyles]=\"{ 'z-index': '99' }\"\n [enableMouseLeave]=\"false\"\n [cdkPosition]=\"reassignPositions\"\n >\n <div\n dropdown-trigger\n (click)=\"openPickPopup($event)\"\n [title]=\"\n isReassign()\n ? 'Reassign task to yourself to act on this stage'\n : 'Pick task to act on this stage'\n \"\n class=\"w-[18px] h-[18px] rounded-full bg-[#FFE681] ring-2 ring-white shadow flex items-center justify-center cursor-pointer\"\n >\n <verben-svg\n icon=\"user\"\n fill=\"#404040\"\n [width]=\"12\"\n [height]=\"12\"\n ></verben-svg>\n </div>\n\n <div class=\"pop-up-content flex flex-col\" dropdown-content>\n <div\n class=\"py-4 px-[18px] transition-all duration-200\"\n [style.width]=\"isPickRichEditor ? '580px' : '420px'\"\n >\n <!-- Coherent Header -->\n <div\n class=\"flex items-center justify-between pb-3 mb-3 border-b border-gray-200\"\n >\n <div class=\"flex items-center gap-2\">\n <span\n class=\"w-2 h-2 rounded-full bg-primary inline-block\"\n ></span>\n <h3\n class=\"text-sm font-semibold text-gray-800 tracking-tight\"\n >\n {{ isReassign() ? \"Reassign Task\" : \"Pick Task\" }}\n </h3>\n </div>\n <button\n type=\"button\"\n (click)=\"closePopUp4()\"\n class=\"text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-md hover:bg-gray-100 cursor-pointer\"\n title=\"Close\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n </button>\n </div>\n\n <div class=\"flex flex-col gap-3\">\n <!-- Stage (if not reassign) -->\n <div class=\"flex flex-col gap-1.5\" *ngIf=\"!isReassign()\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase flex items-center gap-1\"\n >\n <span>Stage</span>\n <span class=\"text-red-500\">*</span>\n </label>\n <verben-drop-down\n width=\"100%\"\n label=\"Stage\"\n [options]=\"task?.FullStages || []\"\n optionLabel=\"Name\"\n optionValue=\"Code\"\n [(ngModel)]=\"selectedStageCode\"\n [showClear]=\"true\"\n ></verben-drop-down>\n </div>\n\n <!-- Assign To -->\n <div class=\"flex flex-col gap-1.5\">\n <div class=\"flex items-center justify-between\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase\"\n >\n Assign to\n </label>\n <span class=\"text-[11px] text-gray-400\"\n >Current Actor</span\n >\n </div>\n <verben-drop-down\n width=\"100%\"\n label=\"Assign to\"\n [options]=\"pickActors\"\n optionLabel=\"Name\"\n optionValue=\"Identifier\"\n [(ngModel)]=\"pickRecipient\"\n [disabled]=\"true\"\n ></verben-drop-down>\n </div>\n\n <!-- Comment with Mode Switcher -->\n <div class=\"flex flex-col gap-1.5\">\n <div class=\"flex items-center justify-between mb-0.5\">\n <label\n class=\"text-xs font-semibold text-gray-700 tracking-wide uppercase flex items-center gap-1\"\n >\n <span>Comment</span>\n <span class=\"text-red-500\">*</span>\n </label>\n\n <!-- Mode Switch Pill -->\n <div\n class=\"inline-flex items-center bg-gray-100 p-0.5 rounded-md border border-gray-200\"\n >\n <button\n type=\"button\"\n (click)=\"setPickEditorMode(false)\"\n [ngClass]=\"\n !isPickRichEditor\n ? 'bg-white text-gray-800 shadow-xs font-medium'\n : 'text-gray-500 hover:text-gray-700'\n \"\n class=\"px-2 py-0.5 text-xs rounded transition-all cursor-pointer flex items-center gap-1\"\n title=\"Simple textarea\"\n >\n <span>Simple</span>\n </button>\n <button\n type=\"button\"\n (click)=\"setPickEditorMode(true)\"\n [ngClass]=\"\n isPickRichEditor\n ? 'bg-white text-gray-800 shadow-xs font-medium'\n : 'text-gray-500 hover:text-gray-700'\n \"\n class=\"px-2 py-0.5 text-xs rounded transition-all cursor-pointer flex items-center gap-1\"\n title=\"Rich text editor with formatting & tables\"\n >\n <svg\n width=\"11\"\n height=\"11\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M4 7V4h16v3M9 20h6M12 4v16\" />\n </svg>\n <span>Rich / Tables</span>\n </button>\n </div>\n </div>\n\n <!-- Simple Textarea Mode -->\n <div *ngIf=\"!isPickRichEditor\" class=\"w-full\">\n <verbena-textarea\n [(ngModel)]=\"pickComment\"\n [rows]=\"4\"\n width=\"100%\"\n border=\"1px solid #cbd5e1\"\n borderRadius=\"6px\"\n ></verbena-textarea>\n </div>\n\n <!-- Rich Reporting Editor Mode -->\n <div\n *ngIf=\"isPickRichEditor\"\n class=\"workflow-comment-editor w-full\"\n >\n <lib-editor\n [editorConfig]=\"editorConfig\"\n [editorMode]=\"editorMode\"\n [(ngModel)]=\"pickComment\"\n ></lib-editor>\n </div>\n </div>\n </div>\n\n <!-- Action Buttons -->\n <div class=\"flex justify-end gap-3 mt-4 pt-2\">\n <verbena-button\n (click)=\"closePopUp4()\"\n text=\"Cancel\"\n ></verbena-button>\n <verbena-button\n class=\"verben-primary-button\"\n text=\"OK\"\n (click)=\"submitPick()\"\n [disable]=\"\n !isPickCommentValid() ||\n !pickRecipient ||\n (!isReassign() && !selectedStageCode)\n \"\n ></verbena-button>\n </div>\n </div>\n </div>\n </verben-pop-Up>\n </div>\n </div>\n\n <ng-container>\n <div\n *ngIf=\"localHistoryToDate[i + 1]?.ActionName\"\n class=\"border-primary border-b-2 w-[50px] relative px-2 text-xs text-primary font-medium\"\n ></div>\n </ng-container>\n\n <ng-container\n *ngIf=\"\n i === localHistoryToDate.length - 1 &&\n localNextActions.length > 0 &&\n localNextActions.length !== 1 &&\n !readOnly\n \"\n >\n <div>\n <verben-pop-Up\n #popup\n [customStyles]=\"{ 'z-index': '99' }\"\n [enableMouseLeave]=\"false\"\n [cdkPosition]=\"popupPositions\"\n >\n <div dropdown-trigger class=\"flex items-center\">\n <div class=\"w-[20px] h-[2px] bg-[#D4A007]\"></div>\n <div class=\"mt-2\">\n <verben-svg\n class=\"cursor-pointer actions-icon\"\n stroke=\"#D4A007\"\n icon=\"chevron\"\n ></verben-svg>\n </div>\n </div>\n\n <div\n class=\"pop-up-content flex flex-col py-1.5 min-w-[170px]\"\n dropdown-content\n >\n <div\n class=\"px-[18px] py-1.5 border-b border-gray-100 flex items-center gap-1.5\"\n >\n <span\n class=\"w-1.5 h-1.5 rounded-full bg-primary inline-block\"\n ></span>\n <span\n class=\"text-[11px] font-semibold text-gray-500 uppercase tracking-wider\"\n >Actions</span\n >\n </div>\n <ul class=\"flex flex-col py-1\">\n <li\n *ngFor=\"\n let action of localNextActions;\n trackBy: trackByAction\n \"\n >\n <button\n [disabled]=\"disableNotActor()\"\n class=\"w-full text-left px-[18px] py-2 text-xs font-medium text-gray-700 hover:bg-gray-50 hover:text-primary transition-colors disabled:cursor-not-allowed disabled:opacity-40 cursor-pointer flex items-center justify-between\"\n (click)=\"openCommentFor(action, $event); closePopUp()\"\n >\n <span>{{\n action.Name || action.ToStageName || \"Unnamed\"\n }}</span>\n </button>\n </li>\n </ul>\n </div>\n </verben-pop-Up>\n </div>\n </ng-container>\n </div>\n <ng-container\n *ngIf=\"\n stage.ToStageName && stage.ToStageName.length > 20;\n else plainStageName\n \"\n >\n <verben-tooltip\n [top]=\"'0px'\"\n [textColor]=\"'#000'\"\n [backgroundColor]=\"'#D3D3D3'\"\n [left]=\"'0'\"\n [tooltipContent]=\"tooltipTemplate2\"\n #tooltip\n >\n <p\n class=\"text-xs min-w-max left-0 text-primary mt-1 font-semibold capitalize\"\n >\n {{ stage.ToStageName | slice: 0 : 20 }}...\n </p>\n </verben-tooltip>\n <ng-template #tooltipTemplate2>\n <div>\n <p class=\"text-xs\">{{ stage.ToStageName }}</p>\n </div>\n </ng-template>\n </ng-container>\n <ng-template #plainStageName>\n <p\n class=\"text-xs min-w-max left-0 text-primary mt-1 font-semibold capitalize\"\n >\n {{ stage.ToStageName || \"\" }}\n </p>\n </ng-template>\n </div>\n</div>\n<verben-dialogue\n [dismissOutsideClick]=\"true\"\n [closeOnEscape]=\"true\"\n [mode]=\"'drawer'\"\n [padding]=\"'0px'\"\n [drawerWidth]=\"'500px'\"\n position=\"right\"\n [disableFooter]=\"false\"\n [isVisible]=\"suppressFormDrawer ? false : isVisible\"\n [modalData]=\"taskForms\"\n (openModal)=\"onModalOpen($event)\"\n (closeModal)=\"onModalClose($event)\"\n [headerTemplate]=\"headerTemplate\"\n [bodyTemplate]=\"bodyTemplate\"\n [showCloseIcon]=\"true\"\n>\n</verben-dialogue>\n\n<ng-template #headerTemplate>\n <div class=\"bg-[#FFE681] px-6 py-4 flex justify-between items-center\">\n <h1>{{ forms?.[active]?.Name }}</h1>\n </div>\n</ng-template>\n\n<ng-template #bodyTemplate>\n <div class=\"py-3 px-[18px]\">\n <div *ngIf=\"forms?.[active]?.Entities?.length; else emptyState\">\n <div\n *ngFor=\"let entity of forms[active]?.Entities; let j = index\"\n class=\"mb-6 pb-4\"\n >\n <form-control\n [formProperties]=\"entity?.Properties || []\"\n ></form-control>\n <div class=\"flex gap-3 justify-end mt-4\">\n <verbena-button\n class=\"verben-primary-button\"\n (click)=\"submitForm(active)\"\n [disable]=\"!areRequiredPropertiesFilled(entity?.Properties)\"\n text=\"Proceed\"\n ></verbena-button>\n </div>\n </div>\n </div>\n\n <ng-template #emptyState>\n <p class=\"mt-4 p-4 text-gray-600 text-center\">\n No entries available for the selected form group.\n </p>\n </ng-template>\n </div>\n</ng-template>\n\n<app-form-viewer\n [form]=\"activeForm\"\n [isVisible]=\"isFormViewerVisible\"\n (onOpen)=\"onFormViewerOpen()\"\n (onClose)=\"onFormViewerClose()\"\n></app-form-viewer>\n\n<!-- Floating Actor Tooltip with Edge Detection -->\n<div\n *ngIf=\"\n hoveredStage && (hoveredStage.Actor?.Identifier || hoveredStage.Actor?.Name)\n \"\n class=\"fixed z-[9999] pointer-events-none transition-opacity duration-150 ease-out\"\n [style.top.px]=\"stageTooltipPos.top\"\n [style.left.px]=\"stageTooltipPos.left\"\n [style.transform]=\"stageTooltipPos.transform\"\n>\n <div\n class=\"bg-gray-800 text-white text-xs rounded-md px-2.5 py-1 shadow-md whitespace-nowrap relative flex items-center gap-1.5\"\n >\n <verben-svg\n [width]=\"12\"\n [height]=\"12\"\n [icon]=\"'user'\"\n stroke=\"#cbd5e1\"\n ></verben-svg>\n <span class=\"font-medium text-[12px]\">{{\n hoveredStage.Actor?.Name || hoveredStage.Actor?.Identifier\n }}</span>\n <!-- <span\n *ngIf=\"\n hoveredStage.Actor?.Name &&\n hoveredStage.Actor?.Identifier &&\n hoveredStage.Actor.Name !== hoveredStage.Actor.Identifier\n \"\n class=\"text-gray-300 text-[11px]\"\n >\n ({{ hoveredStage.Actor.Identifier }})\n </span> -->\n\n <!-- Arrow pointing toward circle -->\n <div\n *ngIf=\"stageTooltipPos.showAbove\"\n class=\"absolute left-1/2 -bottom-[4px] -translate-x-1/2 w-0 h-0 border-x-4 border-x-transparent border-t-[4px] border-t-gray-800\"\n ></div>\n <div\n *ngIf=\"!stageTooltipPos.showAbove\"\n class=\"absolute left-1/2 -top-[4px] -translate-x-1/2 w-0 h-0 border-x-4 border-x-transparent border-b-[4px] border-b-gray-800\"\n ></div>\n </div>\n</div>\n\n<!-- View Stage Comment Dialogue -->\n<verben-dialogue\n [showCloseIcon]=\"false\"\n [dismissOutsideClick]=\"true\"\n [closeOnEscape]=\"true\"\n [size]=\"'medium'\"\n [dialogueWidth]=\"'580px'\"\n [mode]=\"'dialogue'\"\n [padding]=\"'16px 18px'\"\n [customClass]=\"'show-form max-w-[92vw]'\"\n [disableFooter]=\"true\"\n [isVisible]=\"isViewCommentModalOpen\"\n [bodyTemplate]=\"commentDialogBody\"\n (closeModal)=\"closeViewComment()\"\n>\n <ng-template #commentDialogBody>\n <div class=\"dialog-body flex flex-col gap-4\">\n <!-- Header with Title, Copy, Close X -->\n <div\n class=\"flex items-center justify-between pb-3 border-b border-gray-200\"\n >\n <div class=\"flex items-center gap-2\">\n <span class=\"w-2 h-2 rounded-full bg-primary inline-block\"></span>\n <h3 class=\"text-sm font-semibold text-gray-800 tracking-tight\">\n {{\n viewCommentStage?.ToStageName ||\n viewCommentStage?.ActionName ||\n \"Stage\"\n }}\n - Comment\n </h3>\n </div>\n <div class=\"flex items-center gap-2\">\n <!-- Copy Button -->\n <button\n *ngIf=\"viewCommentDecoded\"\n type=\"button\"\n (click)=\"copyViewCommentText()\"\n class=\"text-xs px-2.5 py-1 rounded bg-gray-100 hover:bg-gray-200 text-gray-700 transition-colors cursor-pointer flex items-center gap-1.5 border border-gray-200 select-none\"\n title=\"Copy comment to clipboard\"\n >\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\"></rect>\n <path\n d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"\n ></path>\n </svg>\n <span>{{ viewCommentCopyStatus }}</span>\n </button>\n\n <!-- Close button -->\n <button\n type=\"button\"\n (click)=\"closeViewComment()\"\n class=\"text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-md hover:bg-gray-100 cursor-pointer\"\n title=\"Close\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n </button>\n </div>\n </div>\n\n <!-- Scrollable Content: max-height similar to comment popup (45vh) -->\n <div class=\"max-h-[45vh] overflow-y-auto select-text pr-1\">\n <!-- Actor & Date Metadata -->\n <div\n *ngIf=\"viewCommentStage?.Actor?.Name || viewCommentStage?.CreatedAt\"\n class=\"flex items-center justify-between text-xs text-gray-500 mb-3 pb-2 border-b border-gray-100\"\n >\n <span\n *ngIf=\"viewCommentStage?.Actor?.Name\"\n class=\"font-medium text-gray-700\"\n >\n By: {{ viewCommentStage?.Actor?.Name }}\n </span>\n <span *ngIf=\"viewCommentStage?.CreatedAt\">\n {{ viewCommentStage?.CreatedAt | date: \"medium\" }}\n </span>\n </div>\n\n <!-- Comment body: HTML or plain text -->\n <div\n *ngIf=\"isViewCommentHtml; else plainViewComment\"\n class=\"comment-html-content w-full overflow-x-auto text-sm text-gray-800 leading-relaxed\"\n [innerHTML]=\"viewCommentFormatted\"\n ></div>\n\n <ng-template #plainViewComment>\n <p\n *ngIf=\"viewCommentDecoded; else emptyViewComment\"\n class=\"whitespace-pre-wrap break-words text-sm leading-relaxed text-gray-800\"\n >\n {{ viewCommentDecoded }}\n </p>\n <ng-template #emptyViewComment>\n <p class=\"text-xs italic text-gray-400 py-6 text-center\">\n No comment recorded for this stage.\n </p>\n </ng-template>\n </ng-template>\n </div>\n\n <!-- Footer button matching form-viewer -->\n <div\n class=\"dialog-button-container flex justify-end gap-2 pt-2 border-t border-gray-100\"\n >\n <verbena-button\n width=\"100%\"\n class=\"verben-primary-button\"\n [text]=\"'Close'\"\n (click)=\"closeViewComment()\"\n >\n </verbena-button>\n </div>\n </div>\n </ng-template>\n</verben-dialogue>\n", styles: [".workflow-container{position:relative}.dialog{position:absolute;top:100%;left:0;background:var(--vbn-color-surface);border:1px solid var(--vbn-color-border);padding:1rem}.completed{text-decoration:line-through;color:var(--vbn-color-text-muted)}.pop-up-content{border-radius:8px;background-color:var(--vbn-color-surface, #ffffff);border:1px solid #e2e8f0;box-shadow:0 10px 25px -5px #0000001a,0 8px 10px -6px #0000000d}.dialog-body{padding:0;height:100%}.pop-up-value{padding:10px 20px}.workflow-comment-editor{border:1px solid #cbd5e1;border-radius:6px;background-color:#fff;display:flex;flex-direction:column;height:250px;max-height:300px;overflow:visible!important;position:relative}::ng-deep .workflow-comment-editor lib-editor{display:flex!important;flex-direction:column!important;height:100%!important;width:100%!important;overflow:visible!important}::ng-deep .workflow-comment-editor lib-editor>div{gap:0!important;height:100%!important;display:flex!important;flex-direction:column!important;overflow:visible!important}::ng-deep .workflow-comment-editor .editor-menu{flex-shrink:0!important;padding:4px 6px;background-color:#f8fafc;border-bottom:1px solid #e2e8f0;gap:4px;overflow:visible!important;border-top-left-radius:5px;border-top-right-radius:5px;position:relative;z-index:50}::ng-deep .workflow-comment-editor .editor-menu-group{overflow:visible!important}::ng-deep .workflow-comment-editor .color-picker-popover{max-height:240px!important;overflow-y:auto!important;overflow-x:hidden!important;z-index:1050!important;box-shadow:0 10px 25px -5px #00000040,0 8px 10px -6px #00000026!important;border:1px solid #cbd5e1!important}::ng-deep .workflow-comment-editor .color-picker-popover::-webkit-scrollbar{width:5px!important}::ng-deep .workflow-comment-editor .color-picker-popover::-webkit-scrollbar-track{background:transparent!important}::ng-deep .workflow-comment-editor .color-picker-popover::-webkit-scrollbar-thumb{background:#cbd5e1!important;border-radius:3px!important}::ng-deep .workflow-comment-editor .color-picker-popover::-webkit-scrollbar-thumb:hover{background:#94a3b8!important}::ng-deep .workflow-comment-editor .color-picker-backdrop{z-index:1040!important}::ng-deep .workflow-comment-editor .font-family-popover,::ng-deep .workflow-comment-editor .font-size-popover{z-index:1050!important}::ng-deep .workflow-comment-editor .font-picker-backdrop{z-index:1040!important}::ng-deep .workflow-comment-editor .editor-menu-item{width:26px;height:26px;border-radius:4px;background:transparent;transition:background-color .15s ease}::ng-deep .workflow-comment-editor .editor-menu-item:hover{background-color:#e2e8f0}::ng-deep .workflow-comment-editor .font-family-trigger{height:26px;width:110px;font-size:11px}::ng-deep .workflow-comment-editor .font-size-group{height:26px}::ng-deep .workflow-comment-editor .font-size-step-btn{height:24px;width:18px}::ng-deep .workflow-comment-editor .font-size-combobox{height:24px}::ng-deep .workflow-comment-editor .font-size-input{font-size:11px}::ng-deep .workflow-comment-editor .editor-container{flex:1 1 0!important;min-height:0!important;height:100%!important;gap:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}::ng-deep .workflow-comment-editor lib-editor-designer{display:flex!important;flex-direction:column!important;flex:1 1 0!important;min-height:0!important;height:100%!important;overflow:hidden!important}::ng-deep .workflow-comment-editor .editable-div-wrapper{flex:1 1 0!important;min-height:0!important;height:100%!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;padding:0!important;background-color:#fff}::ng-deep .workflow-comment-editor .editable{flex:1 1 0!important;min-height:0!important;height:100%!important;overflow-y:auto!important;overflow-x:auto!important;padding:10px 12px 40px!important;outline:none;font-size:13px;line-height:1.5;box-sizing:border-box!important}::ng-deep .workflow-comment-editor [title=\"Code View\"]{display:none!important}::ng-deep .comment-html-content table{width:100%;border-collapse:collapse;margin:.75rem 0;font-size:.8125rem}::ng-deep .comment-html-content th,::ng-deep .comment-html-content td{border:1px solid #cbd5e1;padding:8px 12px;text-align:left}::ng-deep .comment-html-content th{background-color:#f8fafc;font-weight:600}\n"] }]
826
887
  }], ctorParameters: () => [{ type: i1.UtilService }, { type: i1.HttpWebRequestService }, { type: i0.ChangeDetectorRef }, { type: i0.IterableDiffers }, { type: i2.DomSanitizer }], propDecorators: { pageSize: [{
827
888
  type: Input
828
889
  }], historyToDate: [{