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AAmjC,gBAAA9iC,EAAuB,GAGlD9J,mBA1FIA,MALA,YAAAyJ,EAAAg4B,aAAA32B,UAKA9K,CALoC,SAAAyJ,EAAAg4B,aAAAj9B,OAKpCxE,CAJ8B,aAAAyJ,EAAAg4B,aAAA/2B,WAI9B1K,CAHsC,aAAAyJ,EAAAg4B,aAAA52B,WAGtC7K,CAFsC,YAAAyJ,EAAAg4B,aAAA92B,UAEtC3K,CADoC,YAAAyJ,EAAAg4B,aAAA72B,WAWpB5K,MAAA,GAEAA,MAFA,uBAEAA,CAFwB,qBAExBA,CADsB,kBAc7BA,MAAA,GAAAA,MAAA,QAAAyJ,EAAAu3B,iBAGoDhhC,cAAA,OAAAyJ,EAAAu3B,iBAGpBhhC,cAAA,OAAAyJ,EAAAo4B,SAoCN7hC,cAAA,WAe3BA,MAAA,GACAA,MADA,kBAAAyJ,EAAAy4B,gBACAliC,CADmC,eAAAyJ,EAAAygC,w7DErClClK,CAAkB,ODnCxB,IAAMoR,GAAoB,MAA3B,MAAOA,oDAAoB,mCAApBA,GAAoB,uCAJnBC,KAAaC,SAASzR,IACtBwR,OAAY,SAGbD,CAAoB,iCES1B,IAAMG,GAAY,MAAnB,MAAOA,oDAAY,mCAAZA,GAAY,wCAHV,CAAC/uC,EAAqBgvC,MAAiBjU,QAAA,CAP9CkU,KACAL,GACAM,KACAvU,GACAwU,MACAC,OAAgB,SAKXL,CAAY","names":["ReportService","constructor","_http","this","getReports","get","window","location","host","updateReportBookmark","data","post","getModules","i0","i1","factory","ɵfac","providedIn","TruncateToCharsPipe","transform","value","len","length","slice","pure","ctx_r1","getRouterModuleName","routerModule","anchor_r3","nativeElement","getAttribute","innerText","item_r5","_r4","$implicit","selectItem","_c1","selected","name","count","ReportMenuComponent_ng_container_21_div_1_Template","modules","ReportMenuComponent_ng_template_26_i_0_Template","ReportMenuComponent_ng_template_26_i_1_Template","dataItem_r6","bookmarked","getReportModuleIcon","dataItem_r7","moduleName","record_r8","description","ReportMenuComponent_ng_template_31_div_0_Template","_c2","ReportMenuComponent","_reportService","route","router","selectedModule","doneLoadingModules","pageSizes","previousNext","pageSize","skip","sort","preservedSort","type","pageable","info","sortable","mode","allowUnsort","ngOnInit","locked","dir","field","search","loadData","determineIfLocked","order","subscribe","md","modulesArray","JSON","parse","stringify","module","indexOf","a","b","concat","d","allData","filter","x","selectedModuleData","params","p","setModuleFromRoute","updateGrid","getItemTotals","orderBy","sText","toLowerCase","includes","item","currentSelectedItem","findIndex","i","moduleItem","find","m","returnName","gridView","total","forEach","e","isLocked","css","clickBookmark","reportKey","moduleKey","pageChange","take","sortChange","sortItemList","oldSortList","map","obj","newSortList","sortItem","oldPreserved","push","Object","assign","itm","oldSort","itemToRemove","ite","showTooltip","element","target","nodeName","offsetWidth","scrollWidth","className","tooltipDir","toggle","hide","getQueryparams","dataItem","queryParams","navFromUrl","url","optionalparams","urlSegment","paramName","milestoneKey","routerPath","cellClickHandler","event","column","navigate","i2","selectors","viewQuery","rf","ctx","TooltipDirective","ReportMenuComponent_page_headline_0_Template","ReportMenuComponent_page_headline_1_Template","ReportMenuComponent_ng_template_2_Template","$event","_r1","ReportMenuComponent_ng_container_21_Template","ReportMenuComponent_ng_template_26_Template","ReportMenuComponent_ng_template_28_Template","ReportMenuComponent_ng_template_31_Template","ReportMenuComponent_ng_template_32_Template","template_r9","_c0","PageTitleParameters","pageHeadlines","moduleId","moduleIcon","pageTitle","linkArray","moduleLink","linkTitle","showLink","isHome","hideIf","schedule_r5","ctx_r2","selectExisting","userScheduleReportKey","scheduleName","_r2","selectedSchedule","ScheduleReportBuilderComponent_div_1_mat_option_7_Template","report","reportName","existingSchedules","option_r6","option_r8","_r7","scheduleValues","day","ScheduleReportBuilderComponent_tr_15_mat_option_7_Template","scheduleOptions","option_r10","_r9","monthly","ScheduleReportBuilderComponent_tr_16_mat_option_5_Template","option_r11","hour","ScheduleReportBuilderComponent_p_25_span_4_Template","ScheduleReportBuilderComponent_p_25_span_5_Template","ScheduleReportBuilderComponent_p_25_span_6_Template","when","ScheduleReportBuilderComponent","reusableFunctions","scheduledReportService","dialogRef","toastService","view","utcOffset","getOptions","hFilterJSON","routerParams","hFilter","title","setUtcOffset","create","reportId","frequency","dayOfWeek","dayOfMonth","filters","optionalSummaryList","createScheduledReport","res","success","close","error","warning","getExisting","getScheduledByReport","utcOffsetMinutes","Date","getTimezoneOffset","schedule","applyDisplayOptions","applyNewFilters","MAT_DIALOG_DATA","i3","i4","decls","vars","consts","template","ScheduleReportBuilderComponent_div_1_Template","ScheduleReportBuilderComponent_ng_template_2_Template","ScheduleReportBuilderComponent_mat_option_14_Template","ScheduleReportBuilderComponent_tr_15_Template","ScheduleReportBuilderComponent_tr_16_Template","ScheduleReportBuilderComponent_mat_option_24_Template","ScheduleReportBuilderComponent_p_25_Template","noExistingSchedules_r12","deepCloneNode","node","clone","cloneNode","descendantsWithId","querySelectorAll","removeAttribute","transferCanvasData","transferInputData","transferData","selector","callback","descendantElements","cloneElements","cloneUniqueId","source","context","getContext","drawImage","getMutableClientRect","rect","getBoundingClientRect","top","right","bottom","left","width","height","y","isInsideClientRect","clientRect","adjustDomRect","domRect","isPointerNearDomRect","threshold","pointerX","pointerY","xThreshold","yThreshold","ParentPositionTracker","_document","positions","Map","clear","cache","elements","set","scrollPosition","getViewportScrollPosition","scrollTop","scrollLeft","handleScroll","_getEventTarget","cachedPosition","newTop","newLeft","viewportScrollPosition","topDifference","leftDifference","position","contains","scrollY","scrollX","getRootNode","viewRef","rootNodes","nodeType","ELEMENT_NODE","wrapper","createElement","appendChild","extendStyles","dest","importantProperties","key","hasOwnProperty","setProperty","has","removeProperty","toggleNativeDragInteractions","enable","userSelect","style","toggleVisibility","opacity","combineTransforms","initialTransform","matchElementSize","sourceRect","getTransform","Math","round","parseCssTimeUnitsToMs","multiplier","parseFloat","parseCssPropertyValue","computedStyle","getPropertyValue","split","part","trim","Set","PreviewRef","_preview","_rootElement","_direction","_initialDomRect","_previewTemplate","_previewClass","_pickupPositionOnPage","_initialTransform","_zIndex","attach","parent","_createPreview","supportsPopover","showPopover","destroy","remove","_previewEmbeddedView","setTransform","addClass","classList","add","getTransitionDuration","getTransformTransitionDurationInMs","getComputedStyle","transitionedProperties","property","prop","propertyIndex","rawDurations","rawDelays","addEventListener","handler","removeEventListener","previewConfig","previewClass","previewTemplate","preview","rootRect","matchSize","viewContainer","createEmbeddedView","detectChanges","margin","setAttribute","Array","isArray","passiveEventListenerOptions","normalizePassiveListenerOptions","passive","activeEventListenerOptions","activeCapturingEventOptions$1","capture","dragImportantProperties","DragRef","disabled","_disabled","_dropContainer","_toggleNativeDragInteractions","_handles","handle","_config","_ngZone","_viewportRuler","_dragDropRegistry","_passiveTransform","_activeTransform","_hasStartedDragging","signal","_moveEvents","Subject","_pointerMoveSubscription","Subscription","EMPTY","_pointerUpSubscription","_scrollSubscription","_resizeSubscription","_boundaryElement","_nativeInteractionsEnabled","_disabledHandles","dragStartDelay","scale","beforeStarted","started","released","ended","entered","exited","dropped","moved","_pointerDown","next","targetHandle","_getTargetHandle","_initializeDragSequence","_pointerMove","pointerPosition","_getPointerPositionOnPage","abs","dragStartThreshold","isDelayElapsed","now","_dragStartTime","_getDragStartDelay","container","_endDragSequence","isDragging","isReceiving","cancelable","preventDefault","run","_startDragSequence","constrainedPointerPosition","_getConstrainedPointerPosition","_hasMoved","_lastKnownPointerPosition","_updatePointerDirectionDelta","_updateActiveDropContainer","offset","constrainPosition","activeTransform","_applyRootElementTransform","observers","distance","_getDragDistance","delta","_pointerDirectionDelta","_pointerUp","_nativeDragStart","withRootElement","withParent","parentDragRef","_parentPositions","registerDragItem","getPlaceholderElement","_placeholder","getRootElement","getVisibleElement","withHandles","handles","coerceElement","disabledHandles","withPreviewTemplate","withPlaceholderTemplate","_placeholderTemplate","rootElement","_removeRootElementListeners","runOutsideAngular","undefined","SVGElement","_ownerSVGElement","ownerSVGElement","withBoundaryElement","boundaryElement","unsubscribe","change","_containInsideBoundaryOnResize","_parentDragRef","dispose","_anchor","_destroyPreview","_destroyPlaceholder","removeDragItem","_removeListeners","complete","reset","disableHandle","enableHandle","delete","withDirection","direction","_withDropContainer","getFreeDragPosition","setFreeDragPosition","withPreviewContainer","_previewContainer","_sortFromLastPointerPosition","_getShadowRoot","shadowDomSelectStart","_placeholderRef","stopDragging","webkitTapHighlightColor","_rootElementTapHighlight","_stopScrolling","_animatePreviewToPlaceholder","then","_cleanupDragArtifacts","_cleanupCachedDimensions","dropPoint","isTouchEvent","_lastTouchEventTime","shadowRoot","dropContainer","parentNode","placeholder","_createPlaceholderElement","anchor","createComment","insertBefore","zIndex","_getPreviewInsertionPoint","body","replaceChild","start","_initialContainer","_initialIndex","getItemIndex","getScrollableParents","referenceElement","stopPropagation","isTouchSequence","isAuxiliaryMouseButton","button","isSyntheticEvent","isFakeEvent","isFakeTouchstartFromScreenReader","isFakeMousedownFromScreenReader","draggable","rootStyles","pointerMove","pointerUp","scrolled","scrollEvent","_updateOnScroll","_boundaryRect","_pickupPositionInElement","_getPointerPositionInElement","_pointerPositionAtLastDirectionChange","startDragging","_previewRect","currentIndex","isPointerOverContainer","_isOverContainer","previousIndex","previousContainer","drop","rawX","rawY","newContainer","_getSiblingContainerFromPosition","exit","enter","sortingDisabled","_startScrollingIfNecessary","_sortItem","_applyPreviewTransform","Promise","resolve","placeholderRect","duration","propertyName","clearTimeout","timeout","setTimeout","placeholderConfig","placeholderTemplate","pointerEvents","elementRect","handleElement","referenceRect","point","targetTouches","_getViewportScrollPosition","pageX","pageY","touches","changedTouches","svgMatrix","getScreenCTM","svgPoint","createSVGPoint","matrixTransform","inverse","dropContainerLock","lockAxis","pickupX","pickupY","boundaryRect","previewWidth","previewHeight","_getPreviewRect","minY","maxY","clamp$1","pointerPositionOnPage","positionSinceLastChange","changeX","changeY","pointerDirectionChangeThreshold","shouldEnable","styles","currentPosition","pickupPosition","leftOverflow","rightOverflow","topOverflow","bottomOverflow","touch","mouse","scrollDifference","_cachedShadowRoot","initialParent","previewContainer","documentRef","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement","min","max","moveItemInArray","array","fromIndex","toIndex","from","clamp","to","SingleAxisSortStrategy","_itemPositions","orientation","_previousSwap","drag","overlaps","items","withItems","pointerDelta","siblings","newIndex","_getItemIndexFromPointerPosition","isHorizontal","currentItem","siblingAtNewPosition","newPosition","itemOffset","_getItemOffsetPx","siblingOffset","_getSiblingOffsetPx","oldOrder","sibling","index","isDraggedItem","elementToOffset","transformAmount","activeDraggables","_activeDraggables","newPositionReference","_shouldEnterAsFirstChild","splice","parentElement","_element","_cacheItemPositions","withSortPredicate","predicate","_sortPredicate","getActiveItemsSnapshot","reverse","updateOnScroll","withElementContainer","elementToMeasure","immediateSibling","end","itemPositions","lastItemRect","firstItemRect","floor","MixedSortStrategy","deltaX","deltaY","_relatedNodes","childNodes","nextSibling","previousSwap","_activeItems","toSwapWith","current","overlapElement","after","before","newOverlapElement","_getRootNode","elementFromPoint","enterIndex","_getClosestItemIndexToPointer","targetItem","root","_rootNode","elementAtPoint","minDistance","Infinity","minIndex","hypot","AutoScrollVerticalDirection","NONE","UP","DOWN","AutoScrollHorizontalDirection","LEFT","RIGHT","DropListRef","autoScrollDisabled","autoScrollStep","enterPredicate","sortPredicate","sorted","receivingStarted","receivingStopped","_isDragging","_draggables","_siblings","_activeSiblings","_viewportScrollSubscription","_verticalScrollDirection","_horizontalScrollDirection","_stopScrollTimers","_scrollableElements","_startScrollInterval","interval","animationFrameScheduler","pipe","takeUntil","_scrollNode","scrollStep","scrollBy","coercedElement","withOrientation","registerDropContainer","removeDropContainer","_draggingStarted","_notifyReceivingSiblings","_sortStrategy","_cacheParentPositions","_reset","previousItems","every","connectedTo","strategy","_container","withScrollableParents","oldContainerIndex","newContainerIndex","unshift","size","_domRect","result","scrollNode","verticalScrollDirection","horizontalScrollDirection","getElementScrollDirections","computedVertical","getVerticalScrollDirection","computedHorizontal","getHorizontalScrollDirection","scrollHeight","clientHeight","clientWidth","getViewportSize","_initialScrollSnap","msScrollSnapType","scrollSnapType","_listenToScrollEvents","_stopReceiving","_canReceive","_startReceiving","activeSiblings","initiator","receiver","draggedItems","activeCapturingEventOptions","activeApps","_ResetsLoader","t","ɵcmp","hostAttrs","standalone","features","encapsulation","changeDetection","DragDropRegistry","_appRef","inject","ApplicationRef","_environmentInjector","EnvironmentInjector","_dropInstances","_dragInstances","_activeDragInstances","_globalListeners","_draggingPredicate","scroll","_preventDefaultWhileDragging","_persistentTouchmoveListener","some","_loadResets","update","instances","startsWith","options","config","_clearGlobalListeners","streams","Observable","observer","eventOptions","merge","ngOnDestroy","instance","componentRef","createComponent","environmentInjector","onDestroy","DOCUMENT","ɵprov","token","DEFAULT_CONFIG","DragDrop","createDrag","createDropList","CDK_DRAG_PARENT","InjectionToken","CDK_DRAG_HANDLE","CDK_DRAG_CONFIG","CDK_DROP_LIST","CdkDrag","_dragRef","_viewContainerRef","_dir","dragDrop","_changeDetectorRef","_selfHandle","_parentDrag","_destroyed","BehaviorSubject","EventEmitter","subscription","movedEvent","_injector","Injector","_assignDefaults","_dropListRef","addItem","_syncInputs","_handleEvents","ngAfterViewInit","afterNextRender","_updateRootElement","_setupHandlesListener","freeDragPosition","injector","ngOnChanges","changes","rootSelectorChange","rootElementSelector","positionChange","firstChange","removeItem","_addHandle","getValue","_removeHandle","_setPreviewTemplate","_resetPreviewTemplate","_setPlaceholderTemplate","_resetPlaceholderTemplate","closest","_getBoundaryElement","boundary","ref","templateRef","coerceNumberProperty","startEvent","emit","markForCheck","releaseEvent","endEvent","enterEvent","exitEvent","dropEvent","draggingDisabled","tap","handleElements","switchMap","_stateChanges","startWith","handleInstance","dragRef","i1$1","ɵdir","hostVars","hostBindings","inputs","booleanAttribute","numberAttribute","outputs","exportAs","provide","useExisting","CDK_DROP_LIST_GROUP","_uniqueIdCounter","CdkDropList","_dropLists","_group","_scrollDispatcher","id","_unsortedItems","_setupInputSyncSubscription","_items","_syncItemsWithRef","getSortedItems","compareDocumentPosition","Node","DOCUMENT_POSITION_FOLLOWING","coerceArray","list","_scrollableParentsResolved","scrollableParents","getAncestorScrollContainers","scrollable","getElementRef","elementContainerSelector","querySelector","listAutoScrollDisabled","listOrientation","useValue","DragDropModule","ɵmod","ɵinj","providers","imports","CdkScrollableModule","item_r2","fieldName","item_r3","ReportEditDialogComponent","columnData","columnsProperties","nonSelectedColumns","col","isSelected","selectedColumns","fieldOrder","applyChanges","deSelectedColumns","transferArrayItem","currentArray","targetArray","targetIndex","ReportEditDialogComponent_div_11_Template","ReportEditDialogComponent_div_17_Template","selectedColumnsList_r5","columnsList_r4","showDisplayOptionsEditButton","fromRouteDisplayOptionParameters","displayOptionsToReset","hardDateRange","_r3","exportToExcel","exportToPdf","openScheduleBuilder","openEditReportDialog","downloadingExcel","hideExcelExport","hidePdfExport","testClick","ReportingComponent_button_11_div_4_Template","downloadingTestExport","routes","path","component","ReportingComponent","_router","_activatedRoute","_reportingService","_reusableFunctions","_listOfLoansService","_bookmarkService","_displayOptionsService","_userAccessService","_dialog","_reportExportService","_toastService","searchedValue","reportUrl","previousUrl","downloadingExcel_1","finAAGModalPage","clientShortName","currentUserName","downloadFinished","requiredProperties","action","NoDataActionType","pageStart","gridData","pageHeadline","isFirstDataRequest","redisId","getGuid","hasData","hasDisplayOptChange","checkForLoanDetailsDialogChange","loadPageProperties","initializeCustomTable","customTableInfo","tableId","tableHeight","isDataReady","columnInfoList","dataSet","searchTerm","bandColorList","dataHandleInUiSide","showSummary","paginationOptions","totalRecords","pageSizeOptions","isInitialLoading","calculateAggregation","calculateAggregationAws","columnsPropertiesOriginal","getUrlSegments","getRouterParameters","dateRange","getDataProperties","ownerPosition","staffingId","pageProperties","getPageHeadLine","titleSuffix","showDisplayoptionsEditButton","bandColors","setPageProperties","setColumnProperties","checkAccessThenGetData","err","hasAccessToPage","setRequiredDataPropertiesThenGeData","lock","dataParameters","topLimit","sortByList","dynamicColumnList","dynamicColumnInfoList","parameters","bucketId","loginEmail","activeColumnList","columnNameList","hasDownloadRequested","refreshCustomMatTable","ymcIndex","filterKey","loanAccountIndex","para","isNotDataProp","parameter","bookmarkColumnInfo","getBookmarksJson","allBookmarks","bookMarkInf","getReportData","snapshot","displayOptions","dataProperties","hFilterParam","getFromHierarchyFilters","getHierarchyFilters","getCurrentDisplayOptions","sParam","getFromRoute","getFromComponent","displayOptionItem","optionKey","isMultiSelection","displayOptionsSpecialHandling","selectedOptionsFriendly","selectedOptions","prm","setDisplayOptionsDatePeriod","setCustomDateRangeParameters","dateDisplayOptionItem","isUsedForGetDateRange","mainDaterangeParam","startDateParam","endDateParam","dateRangeArray","startDate","dateValueFrom","endDate","dateValueTo","dateRangeType","selectedperiodParamName","selectedPeriodInRouterParams","dataParms","dateDispOpt","toBeSetValue","monthParam","yearParam","sprocParam","displayoptionItem","isBooleanType","selectedOptionList","optionName","friendlyName","colInf","fieldId","dynamicColumnInfo","dynamicColumns","columnName","columnDisplayName","colWidth","isDynamicColumn","totalRows","setDataFormatting","getInitialSorting","urlSegments","reportTitle","titleInfo","link","replace","linkToHide","innerItem","dataFormat","decimalPlaces","toString","headerClass","setAggregation","toGetArregateColumnList","aggregationType","resetSummaryLine","getAggregationData","footerObject","footerSummary","colP","columnsToHide","formatDates","updateGridView","getDisplayOptionsSummaryData","tempOptionalSummaryList","exportHeaderSummaryData","displayoptionAreaSummaryItems","optItem","getValueFrom","getDateRanges","getValueFromParam","dateList","valueFromKeys","date","tag","dateFullDescription","formatDate","updateExportSummaryList","addExport","exportToExcelDirectApi","dateTime","getCurrentDateTimeStamp","toastId","getTime","reportExportTo","baseApiUrl","headers","byteArray","TextEncoder","encode","file","Blob","saveAs","removeIfExists","searchRows","timeOutHolder","isSortable","defaultSorting","dataType","sortChangeEvent","sortEvent","columnInf","active","pageChangeEvent","pageIndex","contentChanged","cellClickedEvent","columnInfo","cellData","cellClickEventType","hyperLinkHandler","keys","hasLoanNumber","loanNumberKey","oldBookmark","bookmark","changeLoanBookmarkStatus","getIndicatoricon","resetPage","fieldInfo","modalName","openLoanDetailsModal","oldUrl","replaceUrl","employeeIdentifier","hyperLinkTo_FieldId","csBranch","payDate","commType","payType","isHierarchyEntity","identifier","isEmployee","param","clickedLoanInfoRow","rowData","rowInfo","loanNumbers","loanNumber","loan","changeListOfLoans","bookmarkValue","isLoanDetails","outlets","modal","dataLine","queryParamMap","fieldid","open","maxWidth","getTestReportExport","console","log","onExcelExport","minWidth","minHeight","afterClosed","selectedCol","columnOrder","updateSelectedColumns","numOfRowsSaved","i5","i6","i7","i8","i9","i10","ReportingComponent_display_options_8_Template","ReportingComponent_div_9_Template","ReportingComponent_div_10_Template","ReportingComponent_button_11_Template","ReportsRoutingModule","RouterModule","forChild","ReportModule","ReportingService","CommonModule","SharedModule","GridModule","ThirdPartyModule"],"ignoreList":[],"sourceRoot":"webpack:///","sources":["./src/app/modules/reports/services/report-menu.service.ts","./src/app/modules/shared/pipes/truncate-to-chars.pipe.ts","./src/app/modules/reports/components/report-menu/report-menu.component.html","./src/app/modules/reports/components/report-menu/report-menu.component.ts","./src/app/modules/shared/classes/page-title-parameters.ts","./src/app/modules/shared/components/schedule-report-builder/schedule-report-builder.component.html","./src/app/modules/shared/components/schedule-report-builder/schedule-report-builder.component.ts","./node_modules/@angular/cdk/fesm2022/drag-drop.mjs","./src/app/modules/reports/components/report-edit-dialog/report-edit-dialog.component.html","./src/app/modules/reports/components/report-edit-dialog/report-edit-dialog.component.ts","./src/app/modules/reports/components/reporting/reporting.component.html","./src/app/modules/reports/reports.routing.module.ts","./src/app/modules/reports/components/reporting/reporting.component.ts","./src/app/modules/reports/reports.module.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n ReportMenuData,\n ReportMenuBookmarkForm,\n ReportMenuModuleItems,\n} from '../interfaces/report-menu-data';\nimport { HttpClient } from '@angular/common/http';\nimport { Observable } from 'rxjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ReportService {\n constructor(private _http: HttpClient) {}\n\n getReports(): Observable {\n return this._http.get(\n 'https://' + window.location.host + '/api/v0.5/reportmenu/getreports/'\n );\n }\n\n updateReportBookmark(data: ReportMenuBookmarkForm): Observable<{}> {\n return this._http.post(\n `https://${window.location.host}/api/v0.5/reportmenu/bookmark/`,\n data\n );\n }\n\n getModules(): Observable {\n return this._http.get(\n 'https://' + window.location.host + '/api/v0.5/reportmenu/getmodules/'\n );\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'truncateToChars',\n})\nexport class TruncateToCharsPipe implements PipeTransform {\n transform(value: string, len?: any): any {\n if (len) {\n return value.length > len ? value.slice(0, len - 3) + '...' : value;\n } else {\n return value.length > 50 ? value.slice(0, 47) + '...' : value;\n }\n }\n}\n","\n\n\n\n\n\n\n \n {{ anchor.nativeElement.getAttribute('full-text') || anchor.nativeElement.innerText }}\n \n\n
\n
\n \n Search Reports\n \n search\n \n
\n
\n\n
\n
\n
\n
\n Module\n #\n
\n \n \n {{ item.name }}\n {{ item.count }}\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n\n \n \n \n  \n {{ dataItem.moduleName }}\n \n \n\n \n \n\n \n \n \n {{ record.description | truncateToChars: 170 }}\n
\n \n \n\n \n \n \n \n \n \n \n \n \n \n\n","import { Component, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';\nimport { GridDataResult, PageChangeEvent } from '@progress/kendo-angular-grid';\nimport { SortDescriptor, orderBy } from '@progress/kendo-data-query';\nimport { Router, ActivatedRoute } from '@angular/router';\nimport { ReportService } from '../../services/report-menu.service';\nimport {\n ReportMenuModule,\n ReportMenuData,\n ReportMenuModuleItems,\n ReportMenuBookmarkForm,\n} from '../../interfaces/report-menu-data';\nimport { TooltipDirective } from '@progress/kendo-angular-tooltip';\n\n@Component({\n selector: 'app-reports',\n encapsulation: ViewEncapsulation.None, // Remove the restriction on the parent component's ability to style child components (For Kendo Grid styling)\n templateUrl: './report-menu.component.html',\n styleUrls: ['./report-menu.component.scss'],\n})\nexport class ReportMenuComponent implements OnInit {\n selectedModule: ReportMenuModule = null;\n allData: ReportMenuData[];\n selectedModuleData: ReportMenuData[];\n modules: ReportMenuModuleItems[];\n routerModule: string;\n doneLoadingModules = false;\n\n // Grid Options\n pageSizes = true;\n previousNext = true;\n pageSize = 10;\n skip = 0;\n sort: SortDescriptor[] = [];\n preservedSort: SortDescriptor[] = [];\n search: string;\n gridView: GridDataResult;\n\n //info = true;\n type: 'numeric' | 'input' = 'input';\n\n pageable = {\n info: true,\n type: this.type,\n pageSizes: true,\n previousNext: 'previousNext',\n //buttonCount: 2,\n };\n\n sortable = {\n mode: 'single',\n allowUnsort: true,\n };\n\n @ViewChild(TooltipDirective) tooltipDir: TooltipDirective;\n\n constructor(\n private _reportService: ReportService,\n private route: ActivatedRoute,\n private router: Router\n ) {}\n\n ngOnInit() {\n // Data for left-hand menu. Count is updated by getItemTotals()\n this.modules = [\n { name: 'All Reports', selected: true, count: 0, locked: false },\n { name: 'Bookmarked', selected: false, count: 0, locked: false },\n ];\n\n this.sort = [{ dir: 'asc', field: 'moduleName' }];\n\n this.preservedSort = [{ dir: 'desc', field: 'bookmarked' }];\n\n this.search = null;\n this.loadData();\n this.determineIfLocked();\n }\n\n // Calls service and pulls all report data w/ boolean for whether user has bookmarked\n // Calls service and returns modules\n loadData() {\n const order = [\n 'Directory',\n 'My Vision',\n 'Leads & Partners',\n 'Pipeline',\n 'Production',\n 'Performance',\n 'Historical Trends',\n 'Financials',\n ];\n\n this._reportService.getModules().subscribe((md) => {\n const modulesArray = JSON.parse(JSON.stringify(md));\n for (let module of modulesArray) {\n module.order = order.indexOf(module.name);\n }\n modulesArray.sort((a, b) => a.order - b.order);\n this.modules = this.modules.concat(modulesArray);\n\n this._reportService.getReports().subscribe((d) => {\n this.allData = d.filter((x) => x.locked == false);\n\n this.selectedModuleData = this.allData;\n\n let routerModule = this.route.params.subscribe((p) => {\n if (p && p['module']) {\n this.routerModule = p['module'];\n this.setModuleFromRoute(p['module']);\n }\n });\n\n this.updateGrid();\n this.getItemTotals();\n });\n });\n }\n\n // Filters current selected module data if search text exists.\n // Handles sorting.\n get data() {\n this.selectedModuleData = orderBy(this.selectedModuleData, this.sort);\n\n if (this.search !== null && this.search.length > 1) {\n let sText = this.search.toLowerCase();\n this.skip = 0;\n\n return this.selectedModuleData.filter(\n (d) =>\n d.name.toLowerCase().includes(sText) ||\n d.description.toLowerCase().includes(sText) ||\n d.moduleName.toLowerCase().includes(sText)\n );\n } else {\n return this.selectedModuleData;\n }\n }\n\n // Filters all report data to limit based on selected module on left-hand menu\n selectItem(item: ReportMenuModuleItems) {\n let currentSelectedItem = this.modules.findIndex((i) => i.selected == true);\n this.modules[currentSelectedItem].selected = false;\n\n item.selected = true;\n\n if (item.name.toLowerCase() == 'all reports') {\n this.selectedModuleData = this.allData;\n } else if (item.name.toLowerCase() == 'bookmarked') {\n this.selectedModuleData = this.allData.filter((d) => d.bookmarked == true);\n } else {\n this.selectedModuleData = this.allData.filter(\n (d) => d.moduleName.toLowerCase() == item.name.toLowerCase()\n );\n }\n\n this.updateGrid();\n }\n\n // Filters all report data to limit based on module selected in router\n setModuleFromRoute(module: string) {\n let moduleItem: ReportMenuModuleItems;\n\n switch (module.toLowerCase()) {\n case 'pipeline':\n moduleItem = this.modules.find((m) => m.name == 'Pipeline');\n break;\n case 'production':\n moduleItem = this.modules.find((m) => m.name == 'Production');\n break;\n case 'performance':\n moduleItem = this.modules.find((m) => m.name == 'Performance');\n break;\n case 'historical-trends':\n moduleItem = this.modules.find((m) => m.name == 'Historical Trends');\n break;\n case 'financials':\n moduleItem = this.modules.find((m) => m.name == 'Financials');\n break;\n case 'leads-partners':\n moduleItem = this.modules.find((m) => m.name == 'Leads & Partners');\n break;\n case 'bookmarked':\n moduleItem = this.modules.find((m) => m.name == 'Bookmarked');\n break;\n case 'directory':\n moduleItem = this.modules.find((m) => m.name == 'Directory');\n break;\n default:\n moduleItem = this.modules.find((m) => m.name == 'All Reports');\n break;\n }\n\n this.selectItem(moduleItem);\n }\n\n // Returns friendly router name for selected module (if passed through router)\n getRouterModuleName() {\n let returnName;\n switch (this.routerModule.toLowerCase()) {\n case 'historical-trends':\n returnName = 'historical trends';\n break;\n case 'leads-partners':\n returnName = 'leads & partners';\n break;\n default:\n returnName = this.routerModule;\n break;\n }\n return returnName + ' Home';\n }\n\n // Update values shown in grid\n updateGrid() {\n this.gridView = {\n data: this.data.slice(this.skip, this.skip + this.pageSize),\n total: this.data.length,\n };\n }\n\n // Counts total reports in each module for left-hand menu\n getItemTotals() {\n this.modules.forEach((e) => {\n let name = e.name.toLowerCase();\n if (name !== 'all reports' && name !== 'bookmarked') {\n e.count = this.allData.filter(\n (d) => d.moduleName.toLowerCase() == e.name.toLowerCase()\n ).length;\n } else if (name == 'all reports') {\n e.count = this.allData.length;\n } else if (name == 'bookmarked') {\n e.count = this.allData.filter((d) => d.bookmarked == true).length;\n }\n });\n\n this.modules = this.modules.filter(\n (x) => x.count != 0 || x.name == 'All Reports' || x.name == 'Bookmarked'\n );\n this.doneLoadingModules = true;\n }\n\n determineIfLocked() {}\n\n isLocked(m: ReportMenuModuleItems) {\n return m.locked == true;\n }\n\n // Sets CSS icon for module data on each report item in grid\n getReportModuleIcon(item: ReportMenuData) {\n let css;\n switch (item.moduleName.toLowerCase()) {\n case 'leads & partners':\n css = 'fas fa-handshake leads-partners';\n break;\n case 'pipeline':\n css = 'fas fa-bolt pipeline';\n break;\n case 'production':\n css = 'fas fa-rocket production';\n break;\n case 'historical trends':\n css = 'fas fa-chart-line';\n break;\n case 'financials':\n css = 'fas fa-dollar-sign financials';\n break;\n case 'performance':\n css = 'fas fa-heartbeat performance';\n break;\n case 'directory':\n css = 'fas fa-address-book';\n break;\n default:\n css = '';\n break;\n }\n\n return css;\n }\n\n // Handle click event for bookmark icon.\n // Saves or deletes ReportUserBookmark record for user.\n // Updates item totals on left-menu.\n clickBookmark(item: ReportMenuData) {\n let currentStatus = item.bookmarked;\n item.bookmarked = !currentStatus;\n\n let data: ReportMenuBookmarkForm = {\n reportKey: item.reportKey,\n moduleKey: item.moduleKey,\n bookmarked: item.bookmarked,\n };\n\n this._reportService.updateReportBookmark(data).subscribe();\n this.getItemTotals();\n }\n\n pageChange(e: PageChangeEvent): void {\n this.skip = e.skip;\n this.pageSize = e.take;\n this.updateGrid();\n }\n\n sortChange(sortItemList: SortDescriptor[]): void {\n let oldSortList: SortDescriptor[] = this.sort.map((obj) => ({\n ...obj,\n }));\n\n let newSortList: SortDescriptor[] = [];\n this.sort = [];\n\n this.preservedSort.forEach((sortItem) => {\n let oldPreserved = sortItemList.find((item) => item.field === sortItem.field);\n\n if (oldPreserved) {\n newSortList.push(Object.assign({}, oldPreserved));\n }\n\n oldSortList = oldSortList.filter((itm) => itm.field != sortItem.field);\n sortItemList = sortItemList.filter((itm) => itm.field != sortItem.field);\n });\n\n oldSortList.forEach((oldSort) => {\n let itemToRemove = sortItemList.find(\n (ite) => ite.field === oldSort.field && ite.dir === oldSort.dir\n );\n\n if (itemToRemove) {\n sortItemList = sortItemList.filter((i) => i.field != itemToRemove.field);\n }\n });\n\n sortItemList.forEach((sort) => {\n newSortList.push(sort);\n });\n\n this.sort = newSortList.map((obj) => ({ ...obj }));\n this.updateGrid();\n }\n\n showTooltip(e: MouseEvent): void {\n const element = e.target as HTMLElement;\n\n if (\n ((element.nodeName === 'TD' || element.nodeName === 'TH' || element.nodeName === 'A') &&\n element.offsetWidth < element.scrollWidth) ||\n element.className === 'truncate'\n ) {\n this.tooltipDir.toggle(element);\n } else {\n this.tooltipDir.hide();\n }\n }\n\n getQueryparams(dataItem: ReportMenuData) {\n let queryParams = { navFromUrl: this.router.url };\n // NOTE: Add url spesific query params here\n let optionalparams = [\n {\n urlSegment: 'historical-trends',\n paramName: 'milestonekey',\n value: dataItem.milestoneKey,\n },\n {\n urlSegment: 'purchases',\n paramName: 'purpose',\n value: 'purchase',\n },\n {\n urlSegment: 'government',\n paramName: 'loanType',\n value: 'govt',\n },\n ];\n\n optionalparams.forEach((item) => {\n if (dataItem.routerPath.toLowerCase().search(item.urlSegment) > -1) {\n queryParams[item.paramName] = item.value;\n }\n });\n return queryParams;\n }\n\n cellClickHandler(event) {\n //this._routerExtra.setReferingFromUrl(this.router.url);\n if (event && event.dataItem) {\n if (event.column.field === 'bookmarked') {\n this.clickBookmark(event.dataItem);\n } else if (event.dataItem.routerPath) {\n this.router.navigate([event.dataItem.routerPath], {\n queryParams: this.getQueryparams(event.dataItem),\n });\n } else {\n let module = '';\n switch (event.dataItem.moduleName.toLowerCase()) {\n case 'leads & partners':\n module = 'leads-partners';\n break;\n case 'historical trends':\n module = 'historical-trends';\n break;\n default:\n module = event.dataItem.moduleName.toLowerCase();\n break;\n }\n\n this.router.navigate([module + '/upgrade']);\n }\n }\n }\n}\n","import { Injectable } from '@angular/core';\n\nexport interface INavigatePageInfo {\n navigateFrom: string;\n module: string;\n moduleIcon: string;\n pageTitle: string;\n linkArray: ILinkInfo[];\n}\n\nexport interface ILinkInfo {\n moduleLink: string;\n linkTitle: string;\n showLink: boolean;\n isHome?: boolean;\n hideIf?: string[];\n}\n\nexport interface IPageHeadline {\n module: string;\n moduleIcon: string;\n pageTitle: string;\n linkTitle?: string;\n moduleLink?: string;\n linkArray?: ILinkInfo[];\n}\n\nexport interface IPageHeadlineDetails {\n module: string;\n moduleIcon: string;\n moduleId: string;\n pageTitle: string;\n linkArray: ILinkInfo[];\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PageTitleParameters {\n constructor() {}\n\n pageHeadlines: IPageHeadlineDetails[] = [\n {\n module: 'report-menu',\n moduleId: 'leads-partners',\n moduleIcon: 'fa-table',\n pageTitle: '',\n linkArray: [\n {\n moduleLink: 'leads-partners',\n linkTitle: 'Leads & Partners Home',\n showLink: true,\n isHome: true,\n },\n {\n moduleLink: 'leads-partners/at-a-glance',\n linkTitle: 'Leads & Partners At a Glance',\n hideIf: ['report-menu/leads-partners'],\n showLink: true,\n },\n {\n moduleLink: 'report-menu/leads-partners',\n linkTitle: 'Leads & Partners Reports',\n showLink: false,\n },\n ],\n },\n {\n module: 'report-menu',\n moduleIcon: 'fa-table',\n moduleId: 'report-menu',\n pageTitle: '',\n linkArray: [\n {\n moduleLink: 'report-menu',\n linkTitle: 'Reports Home',\n showLink: true,\n isHome: true,\n },\n ],\n },\n {\n module: 'report-menu',\n moduleIcon: 'fa-table',\n moduleId: 'financials',\n pageTitle: '',\n linkArray: [\n {\n moduleLink: 'financials',\n linkTitle: 'Financials Home',\n showLink: true,\n isHome: true,\n },\n {\n moduleLink: 'financials/at-a-glance',\n linkTitle: 'Financials At a Glance',\n hideIf: [\n 'report-menu/financials',\n 'financials/insights/incentives',\n 'financials/insights/profitability',\n ],\n showLink: true,\n },\n {\n moduleLink: 'report-menu/financials',\n linkTitle: 'Financials Reports',\n showLink: false,\n },\n {\n moduleLink: 'financials/insights/profitability',\n linkTitle: 'Loan Profitability',\n hideIf: ['report-menu/financials', 'financials/at-a-glance'],\n showLink: false,\n },\n {\n moduleLink: 'financials/insights/incentives',\n linkTitle: 'Incentives',\n hideIf: ['report-menu/financials', 'financials/at-a-glance'],\n showLink: false,\n },\n {\n moduleLink: 'financials/insights/revenue-trends',\n linkTitle: 'Loan Profitability',\n hideIf: ['report-menu/financials', 'financials/at-a-glance'],\n showLink: false,\n },\n ],\n },\n {\n module: 'report-menu',\n moduleIcon: 'fa-table',\n moduleId: 'historical-trends',\n pageTitle: '',\n linkArray: [\n {\n moduleLink: 'historical-trends',\n linkTitle: 'Historical Trends Home',\n showLink: true,\n isHome: true,\n },\n {\n moduleLink: 'historical-trends/at-a-glance',\n linkTitle: 'Historical Trends At a Glance',\n hideIf: [\n 'report-menu/historical-trends',\n 'historical-trends/insights/headcount-trends',\n ],\n showLink: true,\n },\n {\n moduleLink: 'historical-trends/insights/headcount-trends',\n linkTitle: 'Headcount Trends',\n hideIf: ['report-menu/historical-trends', 'historical-trends/at-a-glance'],\n showLink: false,\n },\n {\n moduleLink: 'report-menu/historical-trends',\n linkTitle: 'Historical Trends Reports',\n showLink: false,\n },\n ],\n },\n {\n module: 'report-menu',\n moduleIcon: 'fa-table',\n moduleId: 'production',\n pageTitle: '',\n linkArray: [\n {\n moduleLink: 'production',\n linkTitle: 'Production Home',\n showLink: true,\n isHome: true,\n },\n {\n moduleLink: 'production/at-a-glance',\n linkTitle: 'Production At a Glance',\n hideIf: [\n 'report-menu/production',\n 'production/insights/funded-product-distribution',\n 'production/insights/production-turn-times',\n 'production/insights/funded-loan-characteristics',\n 'production/insights/funded-borrower-characteristics',\n 'production/insights/milestone-utilization',\n 'production/insights/eclose-roi-trends',\n 'production/insights/eclose-adoption-trends',\n 'production/insights/production-loan-category-distribution',\n ],\n showLink: true,\n },\n {\n moduleLink: 'production/insights/funded-product-distribution',\n linkTitle: 'Funded Loan Product Distribution',\n hideIf: [\n 'report-menu/production',\n 'production/at-a-glance',\n 'production/insights/production-turn-times',\n ],\n showLink: false,\n },\n {\n moduleLink: 'production/insights/production-turn-times',\n linkTitle: 'Production Turn Times',\n hideIf: [\n 'report-menu/production',\n 'production/at-a-glance',\n 'production/insights/funded-product-distribution',\n ],\n showLink: false,\n },\n {\n moduleLink: 'report-menu/production',\n linkTitle: 'Production Reports',\n showLink: false,\n },\n {\n moduleLink: 'production/insights/funded-loan-characteristics',\n linkTitle: 'Funded Loan Characteristics',\n hideIf: ['report-menu/production', 'production/at-a-glance'],\n showLink: false,\n },\n {\n moduleLink: 'production/insights/funded-borrower-characteristics',\n linkTitle: 'Funded Borrower Characteristics',\n hideIf: ['report-menu/production', 'production/at-a-glance'],\n showLink: false,\n },\n {\n moduleLink: 'production/insights/milestone-utilization',\n linkTitle: 'Milestone Utilization',\n hideIf: ['report-menu/production', 'production/at-a-glance'],\n showLink: false,\n },\n {\n moduleLink: 'production/insights/eclose-roi-trends',\n linkTitle: 'eClose ROI Trends',\n hideIf: ['report-menu/production', 'production/at-a-glance'],\n showLink: false,\n },\n {\n moduleLink: 'production/insights/eclose-adoption-trends',\n linkTitle: 'eClose Adoption Trends',\n hideIf: ['report-menu/production', 'production/at-a-glance'],\n showLink: false,\n },\n {\n moduleLink: 'production/insights/production-loan-category-distribution',\n linkTitle: 'Funded Loan Category Distribution',\n hideIf: ['report-menu/production', 'production/at-a-glance'],\n showLink: false,\n },\n ],\n },\n {\n module: 'report-menu',\n moduleIcon: 'fa-table',\n moduleId: 'pipeline',\n pageTitle: '',\n linkArray: [\n {\n moduleLink: 'pipeline',\n linkTitle: 'Pipeline Home',\n showLink: true,\n isHome: true,\n },\n {\n moduleLink: 'pipeline/at-a-glance',\n linkTitle: 'Pipeline At a Glance',\n hideIf: [\n 'report-menu/pipeline',\n 'pipeline/activity-tracker',\n 'pipeline/insights/milestone-status',\n 'pipeline/insights/sales-funnel',\n 'pipeline/insights/pipeline-with-position-assigned',\n 'pipeline/insights/loan-characteristics',\n 'pipeline/insights/borrower-characteristics',\n 'pipeline/insights/operations-assignments',\n 'pipeline/insights/operations-pipeline',\n 'pipeline/insights/pipeline-trends',\n 'pipeline/insights/loan-category-distribution',\n 'pipeline/insights/product-distribution',\n ],\n showLink: true,\n },\n {\n moduleLink: 'pipeline/activity-tracker',\n linkTitle: 'Pipeline Activity',\n hideIf: [\n 'report-menu/pipeline',\n 'pipeline/at-a-glance',\n 'pipeline/insights/milestone-status',\n ],\n showLink: false,\n },\n {\n moduleLink: 'pipeline/insights/milestone-status',\n linkTitle: 'Loan Pipeline Lock Status Insights',\n hideIf: [\n 'report-menu/pipeline',\n 'pipeline/at-a-glance',\n 'pipeline/activity-tracker',\n ],\n showLink: false,\n },\n {\n moduleLink: 'report-menu/pipeline',\n linkTitle: 'Pipeline Reports',\n showLink: false,\n },\n {\n moduleLink: 'pipeline/insights/sales-funnel',\n linkTitle: 'Sales Pipeline Funnel',\n hideIf: [\n 'report-menu/pipeline',\n 'pipeline/at-a-glance',\n 'pipeline/activity-tracker',\n ],\n showLink: false,\n },\n {\n moduleLink: 'pipeline/insights/pipeline-with-position-assigned',\n linkTitle: 'Upcoming Closings',\n hideIf: [\n 'report-menu/pipeline',\n 'pipeline/at-a-glance',\n 'pipeline/activity-tracker',\n ],\n showLink: false,\n },\n {\n moduleLink: 'pipeline/insights/pipeline-trends',\n linkTitle: 'Pipeline Trends',\n hideIf: [\n 'report-menu/pipeline',\n 'pipeline/at-a-glance',\n 'pipeline/activity-tracker',\n ],\n showLink: false,\n },\n {\n moduleLink: 'pipeline/insights/loan-characteristics',\n linkTitle: 'Pipeline Loan Characteristics',\n hideIf: ['report-menu/pipeline', 'pipeline/at-a-glance'],\n showLink: false,\n },\n {\n moduleLink: 'pipeline/insights/borrower-characteristics',\n linkTitle: 'Pipeline Borrower Characteristics',\n hideIf: ['report-menu/pipeline', 'pipeline/at-a-glance'],\n showLink: false,\n },\n {\n moduleLink: 'pipeline/insights/operations-assignments',\n linkTitle: 'Operations Assignments',\n hideIf: ['report-menu/pipeline', 'pipeline/at-a-glance'],\n showLink: false,\n },\n {\n moduleLink: 'pipeline/insights/operations-pipeline',\n linkTitle: 'Operations Pipeline',\n hideIf: ['report-menu/pipeline', 'pipeline/at-a-glance'],\n showLink: false,\n },\n // {\n // moduleLink: 'pipeline/insights/pipeline-trends',\n // linkTitle: 'Pipeline Trends',\n // hideIf: ['report-menu/pipeline', 'pipeline/at-a-glance'],\n // showLink: false,\n // },\n {\n moduleLink: 'pipeline/insights/loan-category-distribution',\n linkTitle: 'Active Pipeline Loan Category Distribution',\n hideIf: ['report-menu/pipeline', 'pipeline/at-a-glance'],\n showLink: false,\n },\n {\n moduleLink: 'pipeline/insights/product-distribution',\n linkTitle: 'Active Pipeline Product Distribution',\n hideIf: ['report-menu/pipeline', 'pipeline/at-a-glance'],\n showLink: false,\n },\n ],\n },\n {\n module: 'report-menu',\n moduleIcon: 'fa-table',\n moduleId: 'performance',\n pageTitle: '',\n linkArray: [\n {\n moduleLink: 'performance',\n linkTitle: 'Performance Home',\n showLink: true,\n isHome: true,\n },\n {\n moduleLink: 'performance/at-a-glance',\n linkTitle: 'Performance At a Glance',\n hideIf: ['report-menu/performance'],\n showLink: true,\n },\n {\n moduleLink: 'report-menu/performance',\n linkTitle: 'Performance Reports',\n showLink: false,\n },\n ],\n },\n {\n module: 'report-menu',\n moduleIcon: 'fa-table',\n moduleId: 'directory',\n pageTitle: '',\n linkArray: [\n {\n moduleLink: 'directory',\n linkTitle: 'Directory',\n showLink: true,\n isHome: true,\n },\n ],\n },\n {\n module: 'report-menu',\n moduleIcon: 'fa-table',\n moduleId: 'my-vision',\n pageTitle: '',\n linkArray: [\n {\n moduleLink: 'my-vision',\n linkTitle: 'My Vision Home',\n showLink: true,\n isHome: true,\n },\n {\n moduleLink: 'my-vision/corporate-dashboard',\n linkTitle: 'Corporate Dashboard',\n hideIf: ['my-vision/my-dashboard'],\n showLink: true,\n },\n {\n moduleLink: 'my-vision/my-dashboard',\n linkTitle: 'My Dashboard',\n hideIf: ['my-vision/corporate-dashboard'],\n showLink: true,\n },\n ],\n },\n ];\n}\n","\n\n\n \n

New Schedule: {{ report.reportName }}

\n\n \n Saved Schedules\n \n \n {{ schedule.scheduleName }}\n \n \n \n \n\n \n

{{ report.reportName }}

\n
\n\n \n\n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n
Frequency\n \n \n \n {{ option.name }}\n \n \n \n
Day\n \n \n \n {{ option.name }}\n \n \n \n
\n \n \n \n {{ option.name }}\n \n \n \n
Time\n \n \n \n {{ option.name }}\n \n \n \n
\n\n

\n   Report will be created \n daily at {{ scheduleOptions.hour[scheduleValues.hour].name }}.\n \n weekly on {{ scheduleOptions.day[scheduleValues.day].name }} at\n {{ scheduleOptions.hour[scheduleValues.hour].name }}.\n \n \n on the {{ scheduleValues.monthly }} day each month at\n {{ scheduleOptions.hour[scheduleValues.hour].name }}.\n \n

\n
\n\n\n \n \n\n","import { Component, Inject, OnInit } from '@angular/core';\nimport { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport { ReusableFunctions } from '../../classes/reusable-functions';\nimport { IDisplayOptionToReset, IOptionalSummaryList } from '../../interfaces/display-options';\nimport { ScheduledReportsService } from '../../services/scheduled-reports.service';\nimport { ToastService } from '../../services/toast.service';\n\n@Component({\n selector: 'app-schedule-report-builder',\n templateUrl: './schedule-report-builder.component.html',\n styleUrls: ['./schedule-report-builder.component.css'],\n})\nexport class ScheduleReportBuilderComponent implements OnInit {\n report: any;\n\n existingSchedules: any[];\n selectedSchedule: any;\n\n view: string = 'new';\n\n scheduleOptions: any;\n\n hFilterJson: string;\n\n scheduleValues = {\n when: 2,\n day: 0,\n monthly: 'first',\n hour: 12,\n scheduleName: '',\n utcOffset: 0,\n };\n\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: any,\n private reusableFunctions: ReusableFunctions,\n private scheduledReportService: ScheduledReportsService,\n private dialogRef: MatDialogRef,\n private toastService: ToastService\n ) {}\n\n ngOnInit(): void {\n //console.log(this.data);\n\n this.scheduleOptions = this.scheduledReportService.getOptions();\n\n if (this.data) {\n this.report = this.data;\n\n this.data.hFilterJSON = [];\n\n if (this.data.routerParams) {\n let hFilter = this.data.routerParams.find((x) => x.title === 'hFilterJSON');\n if (hFilter) {\n this.data.hFilterJSON = hFilter.value;\n }\n }\n }\n\n //this.getExisting();\n this.setUtcOffset();\n }\n\n create() {\n let data = {\n reportId: this.data.reportId,\n scheduleName: this.scheduleValues.scheduleName,\n frequency: this.scheduleValues.when,\n dayOfWeek: this.scheduleValues.day,\n dayOfMonth: this.scheduleValues.monthly,\n hour: this.scheduleValues.hour,\n filters: JSON.stringify(this.data.filters),\n utcOffset: this.scheduleValues.utcOffset,\n reportName: this.data.reportName,\n optionalSummaryList: JSON.stringify(this.data.optionalSummaryList),\n routerParams: JSON.stringify(this.data.routerParams),\n module: this.data.module,\n hFilterJSON: this.data.hFilterJSON,\n };\n\n this.scheduledReportService.createScheduledReport(data).subscribe(\n (res) => {\n //console.log(res);\n this.toastService.success('Your scheduled report has been created');\n this.dialogRef.close();\n },\n (error) => {\n this.toastService.warning('Something went wrong creating your scheduled report');\n this.dialogRef.close();\n //console.log(error);\n }\n );\n }\n\n getExisting() {\n this.scheduledReportService.getScheduledByReport(this.data.reportId).subscribe((res) => {\n //console.log('Existing scheduled: ', res);\n\n if (res) {\n this.existingSchedules = res;\n }\n });\n }\n\n setUtcOffset() {\n let utcOffsetMinutes = new Date().getTimezoneOffset();\n let utcOffset = 0;\n\n if (utcOffsetMinutes !== 0) {\n utcOffset = -(utcOffsetMinutes / 60);\n }\n\n this.scheduleValues.utcOffset = utcOffset;\n }\n\n selectExisting(schedule) {\n if (schedule) {\n this.scheduleValues = {\n when: schedule.when,\n day: schedule.day,\n monthly: schedule.monthly,\n hour: schedule.hour,\n scheduleName: schedule.scheduleName,\n utcOffset: 0,\n };\n\n this.setUtcOffset();\n\n this.report.optionalSummaryList = JSON.parse(schedule.optionalSummaryList);\n this.report.routerParams = JSON.parse(schedule.routerParams);\n //console.log(this.report);\n this.view = 'edit';\n }\n }\n\n applyDisplayOptions(e) {}\n applyNewFilters() {}\n}\n","import * as i0 from '@angular/core';\nimport { signal, Component, ViewEncapsulation, ChangeDetectionStrategy, inject, ApplicationRef, EnvironmentInjector, createComponent, Injectable, Inject, InjectionToken, booleanAttribute, Directive, Optional, SkipSelf, Input, EventEmitter, Injector, afterNextRender, numberAttribute, Self, Output, NgModule } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport * as i1 from '@angular/cdk/scrolling';\nimport { CdkScrollableModule } from '@angular/cdk/scrolling';\nimport { isFakeTouchstartFromScreenReader, isFakeMousedownFromScreenReader } from '@angular/cdk/a11y';\nimport { coerceElement, coerceNumberProperty, coerceArray } from '@angular/cdk/coercion';\nimport { _getEventTarget, normalizePassiveListenerOptions, _getShadowRoot } from '@angular/cdk/platform';\nimport { Subject, Subscription, interval, animationFrameScheduler, Observable, merge, BehaviorSubject } from 'rxjs';\nimport { takeUntil, map, take, tap, switchMap, startWith } from 'rxjs/operators';\nimport * as i1$1 from '@angular/cdk/bidi';\n\n/** Creates a deep clone of an element. */\nfunction deepCloneNode(node) {\n const clone = node.cloneNode(true);\n const descendantsWithId = clone.querySelectorAll('[id]');\n const nodeName = node.nodeName.toLowerCase();\n // Remove the `id` to avoid having multiple elements with the same id on the page.\n clone.removeAttribute('id');\n for (let i = 0; i < descendantsWithId.length; i++) {\n descendantsWithId[i].removeAttribute('id');\n }\n if (nodeName === 'canvas') {\n transferCanvasData(node, clone);\n }\n else if (nodeName === 'input' || nodeName === 'select' || nodeName === 'textarea') {\n transferInputData(node, clone);\n }\n transferData('canvas', node, clone, transferCanvasData);\n transferData('input, textarea, select', node, clone, transferInputData);\n return clone;\n}\n/** Matches elements between an element and its clone and allows for their data to be cloned. */\nfunction transferData(selector, node, clone, callback) {\n const descendantElements = node.querySelectorAll(selector);\n if (descendantElements.length) {\n const cloneElements = clone.querySelectorAll(selector);\n for (let i = 0; i < descendantElements.length; i++) {\n callback(descendantElements[i], cloneElements[i]);\n }\n }\n}\n// Counter for unique cloned radio button names.\nlet cloneUniqueId = 0;\n/** Transfers the data of one input element to another. */\nfunction transferInputData(source, clone) {\n // Browsers throw an error when assigning the value of a file input programmatically.\n if (clone.type !== 'file') {\n clone.value = source.value;\n }\n // Radio button `name` attributes must be unique for radio button groups\n // otherwise original radio buttons can lose their checked state\n // once the clone is inserted in the DOM.\n if (clone.type === 'radio' && clone.name) {\n clone.name = `mat-clone-${clone.name}-${cloneUniqueId++}`;\n }\n}\n/** Transfers the data of one canvas element to another. */\nfunction transferCanvasData(source, clone) {\n const context = clone.getContext('2d');\n if (context) {\n // In some cases `drawImage` can throw (e.g. if the canvas size is 0x0).\n // We can't do much about it so just ignore the error.\n try {\n context.drawImage(source, 0, 0);\n }\n catch { }\n }\n}\n\n/** Gets a mutable version of an element's bounding `DOMRect`. */\nfunction getMutableClientRect(element) {\n const rect = element.getBoundingClientRect();\n // We need to clone the `clientRect` here, because all the values on it are readonly\n // and we need to be able to update them. Also we can't use a spread here, because\n // the values on a `DOMRect` aren't own properties. See:\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#Notes\n return {\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n left: rect.left,\n width: rect.width,\n height: rect.height,\n x: rect.x,\n y: rect.y,\n };\n}\n/**\n * Checks whether some coordinates are within a `DOMRect`.\n * @param clientRect DOMRect that is being checked.\n * @param x Coordinates along the X axis.\n * @param y Coordinates along the Y axis.\n */\nfunction isInsideClientRect(clientRect, x, y) {\n const { top, bottom, left, right } = clientRect;\n return y >= top && y <= bottom && x >= left && x <= right;\n}\n/**\n * Updates the top/left positions of a `DOMRect`, as well as their bottom/right counterparts.\n * @param domRect `DOMRect` that should be updated.\n * @param top Amount to add to the `top` position.\n * @param left Amount to add to the `left` position.\n */\nfunction adjustDomRect(domRect, top, left) {\n domRect.top += top;\n domRect.bottom = domRect.top + domRect.height;\n domRect.left += left;\n domRect.right = domRect.left + domRect.width;\n}\n/**\n * Checks whether the pointer coordinates are close to a DOMRect.\n * @param rect DOMRect to check against.\n * @param threshold Threshold around the DOMRect.\n * @param pointerX Coordinates along the X axis.\n * @param pointerY Coordinates along the Y axis.\n */\nfunction isPointerNearDomRect(rect, threshold, pointerX, pointerY) {\n const { top, right, bottom, left, width, height } = rect;\n const xThreshold = width * threshold;\n const yThreshold = height * threshold;\n return (pointerY > top - yThreshold &&\n pointerY < bottom + yThreshold &&\n pointerX > left - xThreshold &&\n pointerX < right + xThreshold);\n}\n\n/** Keeps track of the scroll position and dimensions of the parents of an element. */\nclass ParentPositionTracker {\n constructor(_document) {\n this._document = _document;\n /** Cached positions of the scrollable parent elements. */\n this.positions = new Map();\n }\n /** Clears the cached positions. */\n clear() {\n this.positions.clear();\n }\n /** Caches the positions. Should be called at the beginning of a drag sequence. */\n cache(elements) {\n this.clear();\n this.positions.set(this._document, {\n scrollPosition: this.getViewportScrollPosition(),\n });\n elements.forEach(element => {\n this.positions.set(element, {\n scrollPosition: { top: element.scrollTop, left: element.scrollLeft },\n clientRect: getMutableClientRect(element),\n });\n });\n }\n /** Handles scrolling while a drag is taking place. */\n handleScroll(event) {\n const target = _getEventTarget(event);\n const cachedPosition = this.positions.get(target);\n if (!cachedPosition) {\n return null;\n }\n const scrollPosition = cachedPosition.scrollPosition;\n let newTop;\n let newLeft;\n if (target === this._document) {\n const viewportScrollPosition = this.getViewportScrollPosition();\n newTop = viewportScrollPosition.top;\n newLeft = viewportScrollPosition.left;\n }\n else {\n newTop = target.scrollTop;\n newLeft = target.scrollLeft;\n }\n const topDifference = scrollPosition.top - newTop;\n const leftDifference = scrollPosition.left - newLeft;\n // Go through and update the cached positions of the scroll\n // parents that are inside the element that was scrolled.\n this.positions.forEach((position, node) => {\n if (position.clientRect && target !== node && target.contains(node)) {\n adjustDomRect(position.clientRect, topDifference, leftDifference);\n }\n });\n scrollPosition.top = newTop;\n scrollPosition.left = newLeft;\n return { top: topDifference, left: leftDifference };\n }\n /**\n * Gets the scroll position of the viewport. Note that we use the scrollX and scrollY directly,\n * instead of going through the `ViewportRuler`, because the first value the ruler looks at is\n * the top/left offset of the `document.documentElement` which works for most cases, but breaks\n * if the element is offset by something like the `BlockScrollStrategy`.\n */\n getViewportScrollPosition() {\n return { top: window.scrollY, left: window.scrollX };\n }\n}\n\n/**\n * Gets the root HTML element of an embedded view.\n * If the root is not an HTML element it gets wrapped in one.\n */\nfunction getRootNode(viewRef, _document) {\n const rootNodes = viewRef.rootNodes;\n if (rootNodes.length === 1 && rootNodes[0].nodeType === _document.ELEMENT_NODE) {\n return rootNodes[0];\n }\n const wrapper = _document.createElement('div');\n rootNodes.forEach(node => wrapper.appendChild(node));\n return wrapper;\n}\n\n/**\n * Shallow-extends a stylesheet object with another stylesheet-like object.\n * Note that the keys in `source` have to be dash-cased.\n * @docs-private\n */\nfunction extendStyles(dest, source, importantProperties) {\n for (let key in source) {\n if (source.hasOwnProperty(key)) {\n const value = source[key];\n if (value) {\n dest.setProperty(key, value, importantProperties?.has(key) ? 'important' : '');\n }\n else {\n dest.removeProperty(key);\n }\n }\n }\n return dest;\n}\n/**\n * Toggles whether the native drag interactions should be enabled for an element.\n * @param element Element on which to toggle the drag interactions.\n * @param enable Whether the drag interactions should be enabled.\n * @docs-private\n */\nfunction toggleNativeDragInteractions(element, enable) {\n const userSelect = enable ? '' : 'none';\n extendStyles(element.style, {\n 'touch-action': enable ? '' : 'none',\n '-webkit-user-drag': enable ? '' : 'none',\n '-webkit-tap-highlight-color': enable ? '' : 'transparent',\n 'user-select': userSelect,\n '-ms-user-select': userSelect,\n '-webkit-user-select': userSelect,\n '-moz-user-select': userSelect,\n });\n}\n/**\n * Toggles whether an element is visible while preserving its dimensions.\n * @param element Element whose visibility to toggle\n * @param enable Whether the element should be visible.\n * @param importantProperties Properties to be set as `!important`.\n * @docs-private\n */\nfunction toggleVisibility(element, enable, importantProperties) {\n extendStyles(element.style, {\n position: enable ? '' : 'fixed',\n top: enable ? '' : '0',\n opacity: enable ? '' : '0',\n left: enable ? '' : '-999em',\n }, importantProperties);\n}\n/**\n * Combines a transform string with an optional other transform\n * that exited before the base transform was applied.\n */\nfunction combineTransforms(transform, initialTransform) {\n return initialTransform && initialTransform != 'none'\n ? transform + ' ' + initialTransform\n : transform;\n}\n/**\n * Matches the target element's size to the source's size.\n * @param target Element that needs to be resized.\n * @param sourceRect Dimensions of the source element.\n */\nfunction matchElementSize(target, sourceRect) {\n target.style.width = `${sourceRect.width}px`;\n target.style.height = `${sourceRect.height}px`;\n target.style.transform = getTransform(sourceRect.left, sourceRect.top);\n}\n/**\n * Gets a 3d `transform` that can be applied to an element.\n * @param x Desired position of the element along the X axis.\n * @param y Desired position of the element along the Y axis.\n */\nfunction getTransform(x, y) {\n // Round the transforms since some browsers will\n // blur the elements for sub-pixel transforms.\n return `translate3d(${Math.round(x)}px, ${Math.round(y)}px, 0)`;\n}\n\n/** Parses a CSS time value to milliseconds. */\nfunction parseCssTimeUnitsToMs(value) {\n // Some browsers will return it in seconds, whereas others will return milliseconds.\n const multiplier = value.toLowerCase().indexOf('ms') > -1 ? 1 : 1000;\n return parseFloat(value) * multiplier;\n}\n/** Gets the transform transition duration, including the delay, of an element in milliseconds. */\nfunction getTransformTransitionDurationInMs(element) {\n const computedStyle = getComputedStyle(element);\n const transitionedProperties = parseCssPropertyValue(computedStyle, 'transition-property');\n const property = transitionedProperties.find(prop => prop === 'transform' || prop === 'all');\n // If there's no transition for `all` or `transform`, we shouldn't do anything.\n if (!property) {\n return 0;\n }\n // Get the index of the property that we're interested in and match\n // it up to the same index in `transition-delay` and `transition-duration`.\n const propertyIndex = transitionedProperties.indexOf(property);\n const rawDurations = parseCssPropertyValue(computedStyle, 'transition-duration');\n const rawDelays = parseCssPropertyValue(computedStyle, 'transition-delay');\n return (parseCssTimeUnitsToMs(rawDurations[propertyIndex]) +\n parseCssTimeUnitsToMs(rawDelays[propertyIndex]));\n}\n/** Parses out multiple values from a computed style into an array. */\nfunction parseCssPropertyValue(computedStyle, name) {\n const value = computedStyle.getPropertyValue(name);\n return value.split(',').map(part => part.trim());\n}\n\n/** Inline styles to be set as `!important` while dragging. */\nconst importantProperties = new Set([\n // Needs to be important, because some `mat-table` sets `position: sticky !important`. See #22781.\n 'position',\n]);\nclass PreviewRef {\n get element() {\n return this._preview;\n }\n constructor(_document, _rootElement, _direction, _initialDomRect, _previewTemplate, _previewClass, _pickupPositionOnPage, _initialTransform, _zIndex) {\n this._document = _document;\n this._rootElement = _rootElement;\n this._direction = _direction;\n this._initialDomRect = _initialDomRect;\n this._previewTemplate = _previewTemplate;\n this._previewClass = _previewClass;\n this._pickupPositionOnPage = _pickupPositionOnPage;\n this._initialTransform = _initialTransform;\n this._zIndex = _zIndex;\n }\n attach(parent) {\n this._preview = this._createPreview();\n parent.appendChild(this._preview);\n // The null check is necessary for browsers that don't support the popover API.\n // Note that we use a string access for compatibility with Closure.\n if (supportsPopover(this._preview)) {\n this._preview['showPopover']();\n }\n }\n destroy() {\n this._preview.remove();\n this._previewEmbeddedView?.destroy();\n this._preview = this._previewEmbeddedView = null;\n }\n setTransform(value) {\n this._preview.style.transform = value;\n }\n getBoundingClientRect() {\n return this._preview.getBoundingClientRect();\n }\n addClass(className) {\n this._preview.classList.add(className);\n }\n getTransitionDuration() {\n return getTransformTransitionDurationInMs(this._preview);\n }\n addEventListener(name, handler) {\n this._preview.addEventListener(name, handler);\n }\n removeEventListener(name, handler) {\n this._preview.removeEventListener(name, handler);\n }\n _createPreview() {\n const previewConfig = this._previewTemplate;\n const previewClass = this._previewClass;\n const previewTemplate = previewConfig ? previewConfig.template : null;\n let preview;\n if (previewTemplate && previewConfig) {\n // Measure the element before we've inserted the preview\n // since the insertion could throw off the measurement.\n const rootRect = previewConfig.matchSize ? this._initialDomRect : null;\n const viewRef = previewConfig.viewContainer.createEmbeddedView(previewTemplate, previewConfig.context);\n viewRef.detectChanges();\n preview = getRootNode(viewRef, this._document);\n this._previewEmbeddedView = viewRef;\n if (previewConfig.matchSize) {\n matchElementSize(preview, rootRect);\n }\n else {\n preview.style.transform = getTransform(this._pickupPositionOnPage.x, this._pickupPositionOnPage.y);\n }\n }\n else {\n preview = deepCloneNode(this._rootElement);\n matchElementSize(preview, this._initialDomRect);\n if (this._initialTransform) {\n preview.style.transform = this._initialTransform;\n }\n }\n extendStyles(preview.style, {\n // It's important that we disable the pointer events on the preview, because\n // it can throw off the `document.elementFromPoint` calls in the `CdkDropList`.\n 'pointer-events': 'none',\n // If the preview has a margin, it can throw off our positioning so we reset it. The reset\n // value for `margin-right` needs to be `auto` when opened as a popover, because our\n // positioning is always top/left based, but native popover seems to position itself\n // to the top/right if `` or `` have `dir=\"rtl\"` (see #29604). Setting it\n // to `auto` pushed it to the top/left corner in RTL and is a noop in LTR.\n 'margin': supportsPopover(preview) ? '0 auto 0 0' : '0',\n 'position': 'fixed',\n 'top': '0',\n 'left': '0',\n 'z-index': this._zIndex + '',\n }, importantProperties);\n toggleNativeDragInteractions(preview, false);\n preview.classList.add('cdk-drag-preview');\n preview.setAttribute('popover', 'manual');\n preview.setAttribute('dir', this._direction);\n if (previewClass) {\n if (Array.isArray(previewClass)) {\n previewClass.forEach(className => preview.classList.add(className));\n }\n else {\n preview.classList.add(previewClass);\n }\n }\n return preview;\n }\n}\n/** Checks whether a specific element supports the popover API. */\nfunction supportsPopover(element) {\n return 'showPopover' in element;\n}\n\n/** Options that can be used to bind a passive event listener. */\nconst passiveEventListenerOptions = normalizePassiveListenerOptions({ passive: true });\n/** Options that can be used to bind an active event listener. */\nconst activeEventListenerOptions = normalizePassiveListenerOptions({ passive: false });\n/** Event options that can be used to bind an active, capturing event. */\nconst activeCapturingEventOptions$1 = normalizePassiveListenerOptions({\n passive: false,\n capture: true,\n});\n/**\n * Time in milliseconds for which to ignore mouse events, after\n * receiving a touch event. Used to avoid doing double work for\n * touch devices where the browser fires fake mouse events, in\n * addition to touch events.\n */\nconst MOUSE_EVENT_IGNORE_TIME = 800;\n/** Inline styles to be set as `!important` while dragging. */\nconst dragImportantProperties = new Set([\n // Needs to be important, because some `mat-table` sets `position: sticky !important`. See #22781.\n 'position',\n]);\n/**\n * Reference to a draggable item. Used to manipulate or dispose of the item.\n */\nclass DragRef {\n /** Whether starting to drag this element is disabled. */\n get disabled() {\n return this._disabled || !!(this._dropContainer && this._dropContainer.disabled);\n }\n set disabled(value) {\n if (value !== this._disabled) {\n this._disabled = value;\n this._toggleNativeDragInteractions();\n this._handles.forEach(handle => toggleNativeDragInteractions(handle, value));\n }\n }\n constructor(element, _config, _document, _ngZone, _viewportRuler, _dragDropRegistry) {\n this._config = _config;\n this._document = _document;\n this._ngZone = _ngZone;\n this._viewportRuler = _viewportRuler;\n this._dragDropRegistry = _dragDropRegistry;\n /**\n * CSS `transform` applied to the element when it isn't being dragged. We need a\n * passive transform in order for the dragged element to retain its new position\n * after the user has stopped dragging and because we need to know the relative\n * position in case they start dragging again. This corresponds to `element.style.transform`.\n */\n this._passiveTransform = { x: 0, y: 0 };\n /** CSS `transform` that is applied to the element while it's being dragged. */\n this._activeTransform = { x: 0, y: 0 };\n /**\n * Whether the dragging sequence has been started. Doesn't\n * necessarily mean that the element has been moved.\n */\n this._hasStartedDragging = signal(false);\n /** Emits when the item is being moved. */\n this._moveEvents = new Subject();\n /** Subscription to pointer movement events. */\n this._pointerMoveSubscription = Subscription.EMPTY;\n /** Subscription to the event that is dispatched when the user lifts their pointer. */\n this._pointerUpSubscription = Subscription.EMPTY;\n /** Subscription to the viewport being scrolled. */\n this._scrollSubscription = Subscription.EMPTY;\n /** Subscription to the viewport being resized. */\n this._resizeSubscription = Subscription.EMPTY;\n /** Cached reference to the boundary element. */\n this._boundaryElement = null;\n /** Whether the native dragging interactions have been enabled on the root element. */\n this._nativeInteractionsEnabled = true;\n /** Elements that can be used to drag the draggable item. */\n this._handles = [];\n /** Registered handles that are currently disabled. */\n this._disabledHandles = new Set();\n /** Layout direction of the item. */\n this._direction = 'ltr';\n /**\n * Amount of milliseconds to wait after the user has put their\n * pointer down before starting to drag the element.\n */\n this.dragStartDelay = 0;\n /**\n * If the parent of the dragged element has a `scale` transform, it can throw off the\n * positioning when the user starts dragging. Use this input to notify the CDK of the scale.\n */\n this.scale = 1;\n this._disabled = false;\n /** Emits as the drag sequence is being prepared. */\n this.beforeStarted = new Subject();\n /** Emits when the user starts dragging the item. */\n this.started = new Subject();\n /** Emits when the user has released a drag item, before any animations have started. */\n this.released = new Subject();\n /** Emits when the user stops dragging an item in the container. */\n this.ended = new Subject();\n /** Emits when the user has moved the item into a new container. */\n this.entered = new Subject();\n /** Emits when the user removes the item its container by dragging it into another container. */\n this.exited = new Subject();\n /** Emits when the user drops the item inside a container. */\n this.dropped = new Subject();\n /**\n * Emits as the user is dragging the item. Use with caution,\n * because this event will fire for every pixel that the user has dragged.\n */\n this.moved = this._moveEvents;\n /** Handler for the `mousedown`/`touchstart` events. */\n this._pointerDown = (event) => {\n this.beforeStarted.next();\n // Delegate the event based on whether it started from a handle or the element itself.\n if (this._handles.length) {\n const targetHandle = this._getTargetHandle(event);\n if (targetHandle && !this._disabledHandles.has(targetHandle) && !this.disabled) {\n this._initializeDragSequence(targetHandle, event);\n }\n }\n else if (!this.disabled) {\n this._initializeDragSequence(this._rootElement, event);\n }\n };\n /** Handler that is invoked when the user moves their pointer after they've initiated a drag. */\n this._pointerMove = (event) => {\n const pointerPosition = this._getPointerPositionOnPage(event);\n if (!this._hasStartedDragging()) {\n const distanceX = Math.abs(pointerPosition.x - this._pickupPositionOnPage.x);\n const distanceY = Math.abs(pointerPosition.y - this._pickupPositionOnPage.y);\n const isOverThreshold = distanceX + distanceY >= this._config.dragStartThreshold;\n // Only start dragging after the user has moved more than the minimum distance in either\n // direction. Note that this is preferable over doing something like `skip(minimumDistance)`\n // in the `pointerMove` subscription, because we're not guaranteed to have one move event\n // per pixel of movement (e.g. if the user moves their pointer quickly).\n if (isOverThreshold) {\n const isDelayElapsed = Date.now() >= this._dragStartTime + this._getDragStartDelay(event);\n const container = this._dropContainer;\n if (!isDelayElapsed) {\n this._endDragSequence(event);\n return;\n }\n // Prevent other drag sequences from starting while something in the container is still\n // being dragged. This can happen while we're waiting for the drop animation to finish\n // and can cause errors, because some elements might still be moving around.\n if (!container || (!container.isDragging() && !container.isReceiving())) {\n // Prevent the default action as soon as the dragging sequence is considered as\n // \"started\" since waiting for the next event can allow the device to begin scrolling.\n if (event.cancelable) {\n event.preventDefault();\n }\n this._hasStartedDragging.set(true);\n this._ngZone.run(() => this._startDragSequence(event));\n }\n }\n return;\n }\n // We prevent the default action down here so that we know that dragging has started. This is\n // important for touch devices where doing this too early can unnecessarily block scrolling,\n // if there's a dragging delay.\n if (event.cancelable) {\n event.preventDefault();\n }\n const constrainedPointerPosition = this._getConstrainedPointerPosition(pointerPosition);\n this._hasMoved = true;\n this._lastKnownPointerPosition = pointerPosition;\n this._updatePointerDirectionDelta(constrainedPointerPosition);\n if (this._dropContainer) {\n this._updateActiveDropContainer(constrainedPointerPosition, pointerPosition);\n }\n else {\n // If there's a position constraint function, we want the element's top/left to be at the\n // specific position on the page. Use the initial position as a reference if that's the case.\n const offset = this.constrainPosition ? this._initialDomRect : this._pickupPositionOnPage;\n const activeTransform = this._activeTransform;\n activeTransform.x = constrainedPointerPosition.x - offset.x + this._passiveTransform.x;\n activeTransform.y = constrainedPointerPosition.y - offset.y + this._passiveTransform.y;\n this._applyRootElementTransform(activeTransform.x, activeTransform.y);\n }\n // Since this event gets fired for every pixel while dragging, we only\n // want to fire it if the consumer opted into it. Also we have to\n // re-enter the zone because we run all of the events on the outside.\n if (this._moveEvents.observers.length) {\n this._ngZone.run(() => {\n this._moveEvents.next({\n source: this,\n pointerPosition: constrainedPointerPosition,\n event,\n distance: this._getDragDistance(constrainedPointerPosition),\n delta: this._pointerDirectionDelta,\n });\n });\n }\n };\n /** Handler that is invoked when the user lifts their pointer up, after initiating a drag. */\n this._pointerUp = (event) => {\n this._endDragSequence(event);\n };\n /** Handles a native `dragstart` event. */\n this._nativeDragStart = (event) => {\n if (this._handles.length) {\n const targetHandle = this._getTargetHandle(event);\n if (targetHandle && !this._disabledHandles.has(targetHandle) && !this.disabled) {\n event.preventDefault();\n }\n }\n else if (!this.disabled) {\n // Usually this isn't necessary since the we prevent the default action in `pointerDown`,\n // but some cases like dragging of links can slip through (see #24403).\n event.preventDefault();\n }\n };\n this.withRootElement(element).withParent(_config.parentDragRef || null);\n this._parentPositions = new ParentPositionTracker(_document);\n _dragDropRegistry.registerDragItem(this);\n }\n /**\n * Returns the element that is being used as a placeholder\n * while the current element is being dragged.\n */\n getPlaceholderElement() {\n return this._placeholder;\n }\n /** Returns the root draggable element. */\n getRootElement() {\n return this._rootElement;\n }\n /**\n * Gets the currently-visible element that represents the drag item.\n * While dragging this is the placeholder, otherwise it's the root element.\n */\n getVisibleElement() {\n return this.isDragging() ? this.getPlaceholderElement() : this.getRootElement();\n }\n /** Registers the handles that can be used to drag the element. */\n withHandles(handles) {\n this._handles = handles.map(handle => coerceElement(handle));\n this._handles.forEach(handle => toggleNativeDragInteractions(handle, this.disabled));\n this._toggleNativeDragInteractions();\n // Delete any lingering disabled handles that may have been destroyed. Note that we re-create\n // the set, rather than iterate over it and filter out the destroyed handles, because while\n // the ES spec allows for sets to be modified while they're being iterated over, some polyfills\n // use an array internally which may throw an error.\n const disabledHandles = new Set();\n this._disabledHandles.forEach(handle => {\n if (this._handles.indexOf(handle) > -1) {\n disabledHandles.add(handle);\n }\n });\n this._disabledHandles = disabledHandles;\n return this;\n }\n /**\n * Registers the template that should be used for the drag preview.\n * @param template Template that from which to stamp out the preview.\n */\n withPreviewTemplate(template) {\n this._previewTemplate = template;\n return this;\n }\n /**\n * Registers the template that should be used for the drag placeholder.\n * @param template Template that from which to stamp out the placeholder.\n */\n withPlaceholderTemplate(template) {\n this._placeholderTemplate = template;\n return this;\n }\n /**\n * Sets an alternate drag root element. The root element is the element that will be moved as\n * the user is dragging. Passing an alternate root element is useful when trying to enable\n * dragging on an element that you might not have access to.\n */\n withRootElement(rootElement) {\n const element = coerceElement(rootElement);\n if (element !== this._rootElement) {\n if (this._rootElement) {\n this._removeRootElementListeners(this._rootElement);\n }\n this._ngZone.runOutsideAngular(() => {\n element.addEventListener('mousedown', this._pointerDown, activeEventListenerOptions);\n element.addEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);\n element.addEventListener('dragstart', this._nativeDragStart, activeEventListenerOptions);\n });\n this._initialTransform = undefined;\n this._rootElement = element;\n }\n if (typeof SVGElement !== 'undefined' && this._rootElement instanceof SVGElement) {\n this._ownerSVGElement = this._rootElement.ownerSVGElement;\n }\n return this;\n }\n /**\n * Element to which the draggable's position will be constrained.\n */\n withBoundaryElement(boundaryElement) {\n this._boundaryElement = boundaryElement ? coerceElement(boundaryElement) : null;\n this._resizeSubscription.unsubscribe();\n if (boundaryElement) {\n this._resizeSubscription = this._viewportRuler\n .change(10)\n .subscribe(() => this._containInsideBoundaryOnResize());\n }\n return this;\n }\n /** Sets the parent ref that the ref is nested in. */\n withParent(parent) {\n this._parentDragRef = parent;\n return this;\n }\n /** Removes the dragging functionality from the DOM element. */\n dispose() {\n this._removeRootElementListeners(this._rootElement);\n // Do this check before removing from the registry since it'll\n // stop being considered as dragged once it is removed.\n if (this.isDragging()) {\n // Since we move out the element to the end of the body while it's being\n // dragged, we have to make sure that it's removed if it gets destroyed.\n this._rootElement?.remove();\n }\n this._anchor?.remove();\n this._destroyPreview();\n this._destroyPlaceholder();\n this._dragDropRegistry.removeDragItem(this);\n this._removeListeners();\n this.beforeStarted.complete();\n this.started.complete();\n this.released.complete();\n this.ended.complete();\n this.entered.complete();\n this.exited.complete();\n this.dropped.complete();\n this._moveEvents.complete();\n this._handles = [];\n this._disabledHandles.clear();\n this._dropContainer = undefined;\n this._resizeSubscription.unsubscribe();\n this._parentPositions.clear();\n this._boundaryElement =\n this._rootElement =\n this._ownerSVGElement =\n this._placeholderTemplate =\n this._previewTemplate =\n this._anchor =\n this._parentDragRef =\n null;\n }\n /** Checks whether the element is currently being dragged. */\n isDragging() {\n return this._hasStartedDragging() && this._dragDropRegistry.isDragging(this);\n }\n /** Resets a standalone drag item to its initial position. */\n reset() {\n this._rootElement.style.transform = this._initialTransform || '';\n this._activeTransform = { x: 0, y: 0 };\n this._passiveTransform = { x: 0, y: 0 };\n }\n /**\n * Sets a handle as disabled. While a handle is disabled, it'll capture and interrupt dragging.\n * @param handle Handle element that should be disabled.\n */\n disableHandle(handle) {\n if (!this._disabledHandles.has(handle) && this._handles.indexOf(handle) > -1) {\n this._disabledHandles.add(handle);\n toggleNativeDragInteractions(handle, true);\n }\n }\n /**\n * Enables a handle, if it has been disabled.\n * @param handle Handle element to be enabled.\n */\n enableHandle(handle) {\n if (this._disabledHandles.has(handle)) {\n this._disabledHandles.delete(handle);\n toggleNativeDragInteractions(handle, this.disabled);\n }\n }\n /** Sets the layout direction of the draggable item. */\n withDirection(direction) {\n this._direction = direction;\n return this;\n }\n /** Sets the container that the item is part of. */\n _withDropContainer(container) {\n this._dropContainer = container;\n }\n /**\n * Gets the current position in pixels the draggable outside of a drop container.\n */\n getFreeDragPosition() {\n const position = this.isDragging() ? this._activeTransform : this._passiveTransform;\n return { x: position.x, y: position.y };\n }\n /**\n * Sets the current position in pixels the draggable outside of a drop container.\n * @param value New position to be set.\n */\n setFreeDragPosition(value) {\n this._activeTransform = { x: 0, y: 0 };\n this._passiveTransform.x = value.x;\n this._passiveTransform.y = value.y;\n if (!this._dropContainer) {\n this._applyRootElementTransform(value.x, value.y);\n }\n return this;\n }\n /**\n * Sets the container into which to insert the preview element.\n * @param value Container into which to insert the preview.\n */\n withPreviewContainer(value) {\n this._previewContainer = value;\n return this;\n }\n /** Updates the item's sort order based on the last-known pointer position. */\n _sortFromLastPointerPosition() {\n const position = this._lastKnownPointerPosition;\n if (position && this._dropContainer) {\n this._updateActiveDropContainer(this._getConstrainedPointerPosition(position), position);\n }\n }\n /** Unsubscribes from the global subscriptions. */\n _removeListeners() {\n this._pointerMoveSubscription.unsubscribe();\n this._pointerUpSubscription.unsubscribe();\n this._scrollSubscription.unsubscribe();\n this._getShadowRoot()?.removeEventListener('selectstart', shadowDomSelectStart, activeCapturingEventOptions$1);\n }\n /** Destroys the preview element and its ViewRef. */\n _destroyPreview() {\n this._preview?.destroy();\n this._preview = null;\n }\n /** Destroys the placeholder element and its ViewRef. */\n _destroyPlaceholder() {\n this._placeholder?.remove();\n this._placeholderRef?.destroy();\n this._placeholder = this._placeholderRef = null;\n }\n /**\n * Clears subscriptions and stops the dragging sequence.\n * @param event Browser event object that ended the sequence.\n */\n _endDragSequence(event) {\n // Note that here we use `isDragging` from the service, rather than from `this`.\n // The difference is that the one from the service reflects whether a dragging sequence\n // has been initiated, whereas the one on `this` includes whether the user has passed\n // the minimum dragging threshold.\n if (!this._dragDropRegistry.isDragging(this)) {\n return;\n }\n this._removeListeners();\n this._dragDropRegistry.stopDragging(this);\n this._toggleNativeDragInteractions();\n if (this._handles) {\n this._rootElement.style.webkitTapHighlightColor =\n this._rootElementTapHighlight;\n }\n if (!this._hasStartedDragging()) {\n return;\n }\n this.released.next({ source: this, event });\n if (this._dropContainer) {\n // Stop scrolling immediately, instead of waiting for the animation to finish.\n this._dropContainer._stopScrolling();\n this._animatePreviewToPlaceholder().then(() => {\n this._cleanupDragArtifacts(event);\n this._cleanupCachedDimensions();\n this._dragDropRegistry.stopDragging(this);\n });\n }\n else {\n // Convert the active transform into a passive one. This means that next time\n // the user starts dragging the item, its position will be calculated relatively\n // to the new passive transform.\n this._passiveTransform.x = this._activeTransform.x;\n const pointerPosition = this._getPointerPositionOnPage(event);\n this._passiveTransform.y = this._activeTransform.y;\n this._ngZone.run(() => {\n this.ended.next({\n source: this,\n distance: this._getDragDistance(pointerPosition),\n dropPoint: pointerPosition,\n event,\n });\n });\n this._cleanupCachedDimensions();\n this._dragDropRegistry.stopDragging(this);\n }\n }\n /** Starts the dragging sequence. */\n _startDragSequence(event) {\n if (isTouchEvent(event)) {\n this._lastTouchEventTime = Date.now();\n }\n this._toggleNativeDragInteractions();\n // Needs to happen before the root element is moved.\n const shadowRoot = this._getShadowRoot();\n const dropContainer = this._dropContainer;\n if (shadowRoot) {\n // In some browsers the global `selectstart` that we maintain in the `DragDropRegistry`\n // doesn't cross the shadow boundary so we have to prevent it at the shadow root (see #28792).\n this._ngZone.runOutsideAngular(() => {\n shadowRoot.addEventListener('selectstart', shadowDomSelectStart, activeCapturingEventOptions$1);\n });\n }\n if (dropContainer) {\n const element = this._rootElement;\n const parent = element.parentNode;\n const placeholder = (this._placeholder = this._createPlaceholderElement());\n const anchor = (this._anchor =\n this._anchor ||\n this._document.createComment(typeof ngDevMode === 'undefined' || ngDevMode ? 'cdk-drag-anchor' : ''));\n // Insert an anchor node so that we can restore the element's position in the DOM.\n parent.insertBefore(anchor, element);\n // There's no risk of transforms stacking when inside a drop container so\n // we can keep the initial transform up to date any time dragging starts.\n this._initialTransform = element.style.transform || '';\n // Create the preview after the initial transform has\n // been cached, because it can be affected by the transform.\n this._preview = new PreviewRef(this._document, this._rootElement, this._direction, this._initialDomRect, this._previewTemplate || null, this.previewClass || null, this._pickupPositionOnPage, this._initialTransform, this._config.zIndex || 1000);\n this._preview.attach(this._getPreviewInsertionPoint(parent, shadowRoot));\n // We move the element out at the end of the body and we make it hidden, because keeping it in\n // place will throw off the consumer's `:last-child` selectors. We can't remove the element\n // from the DOM completely, because iOS will stop firing all subsequent events in the chain.\n toggleVisibility(element, false, dragImportantProperties);\n this._document.body.appendChild(parent.replaceChild(placeholder, element));\n this.started.next({ source: this, event }); // Emit before notifying the container.\n dropContainer.start();\n this._initialContainer = dropContainer;\n this._initialIndex = dropContainer.getItemIndex(this);\n }\n else {\n this.started.next({ source: this, event });\n this._initialContainer = this._initialIndex = undefined;\n }\n // Important to run after we've called `start` on the parent container\n // so that it has had time to resolve its scrollable parents.\n this._parentPositions.cache(dropContainer ? dropContainer.getScrollableParents() : []);\n }\n /**\n * Sets up the different variables and subscriptions\n * that will be necessary for the dragging sequence.\n * @param referenceElement Element that started the drag sequence.\n * @param event Browser event object that started the sequence.\n */\n _initializeDragSequence(referenceElement, event) {\n // Stop propagation if the item is inside another\n // draggable so we don't start multiple drag sequences.\n if (this._parentDragRef) {\n event.stopPropagation();\n }\n const isDragging = this.isDragging();\n const isTouchSequence = isTouchEvent(event);\n const isAuxiliaryMouseButton = !isTouchSequence && event.button !== 0;\n const rootElement = this._rootElement;\n const target = _getEventTarget(event);\n const isSyntheticEvent = !isTouchSequence &&\n this._lastTouchEventTime &&\n this._lastTouchEventTime + MOUSE_EVENT_IGNORE_TIME > Date.now();\n const isFakeEvent = isTouchSequence\n ? isFakeTouchstartFromScreenReader(event)\n : isFakeMousedownFromScreenReader(event);\n // If the event started from an element with the native HTML drag&drop, it'll interfere\n // with our own dragging (e.g. `img` tags do it by default). Prevent the default action\n // to stop it from happening. Note that preventing on `dragstart` also seems to work, but\n // it's flaky and it fails if the user drags it away quickly. Also note that we only want\n // to do this for `mousedown` since doing the same for `touchstart` will stop any `click`\n // events from firing on touch devices.\n if (target && target.draggable && event.type === 'mousedown') {\n event.preventDefault();\n }\n // Abort if the user is already dragging or is using a mouse button other than the primary one.\n if (isDragging || isAuxiliaryMouseButton || isSyntheticEvent || isFakeEvent) {\n return;\n }\n // If we've got handles, we need to disable the tap highlight on the entire root element,\n // otherwise iOS will still add it, even though all the drag interactions on the handle\n // are disabled.\n if (this._handles.length) {\n const rootStyles = rootElement.style;\n this._rootElementTapHighlight = rootStyles.webkitTapHighlightColor || '';\n rootStyles.webkitTapHighlightColor = 'transparent';\n }\n this._hasMoved = false;\n this._hasStartedDragging.set(this._hasMoved);\n // Avoid multiple subscriptions and memory leaks when multi touch\n // (isDragging check above isn't enough because of possible temporal and/or dimensional delays)\n this._removeListeners();\n this._initialDomRect = this._rootElement.getBoundingClientRect();\n this._pointerMoveSubscription = this._dragDropRegistry.pointerMove.subscribe(this._pointerMove);\n this._pointerUpSubscription = this._dragDropRegistry.pointerUp.subscribe(this._pointerUp);\n this._scrollSubscription = this._dragDropRegistry\n .scrolled(this._getShadowRoot())\n .subscribe(scrollEvent => this._updateOnScroll(scrollEvent));\n if (this._boundaryElement) {\n this._boundaryRect = getMutableClientRect(this._boundaryElement);\n }\n // If we have a custom preview we can't know ahead of time how large it'll be so we position\n // it next to the cursor. The exception is when the consumer has opted into making the preview\n // the same size as the root element, in which case we do know the size.\n const previewTemplate = this._previewTemplate;\n this._pickupPositionInElement =\n previewTemplate && previewTemplate.template && !previewTemplate.matchSize\n ? { x: 0, y: 0 }\n : this._getPointerPositionInElement(this._initialDomRect, referenceElement, event);\n const pointerPosition = (this._pickupPositionOnPage =\n this._lastKnownPointerPosition =\n this._getPointerPositionOnPage(event));\n this._pointerDirectionDelta = { x: 0, y: 0 };\n this._pointerPositionAtLastDirectionChange = { x: pointerPosition.x, y: pointerPosition.y };\n this._dragStartTime = Date.now();\n this._dragDropRegistry.startDragging(this, event);\n }\n /** Cleans up the DOM artifacts that were added to facilitate the element being dragged. */\n _cleanupDragArtifacts(event) {\n // Restore the element's visibility and insert it at its old position in the DOM.\n // It's important that we maintain the position, because moving the element around in the DOM\n // can throw off `NgFor` which does smart diffing and re-creates elements only when necessary,\n // while moving the existing elements in all other cases.\n toggleVisibility(this._rootElement, true, dragImportantProperties);\n this._anchor.parentNode.replaceChild(this._rootElement, this._anchor);\n this._destroyPreview();\n this._destroyPlaceholder();\n this._initialDomRect =\n this._boundaryRect =\n this._previewRect =\n this._initialTransform =\n undefined;\n // Re-enter the NgZone since we bound `document` events on the outside.\n this._ngZone.run(() => {\n const container = this._dropContainer;\n const currentIndex = container.getItemIndex(this);\n const pointerPosition = this._getPointerPositionOnPage(event);\n const distance = this._getDragDistance(pointerPosition);\n const isPointerOverContainer = container._isOverContainer(pointerPosition.x, pointerPosition.y);\n this.ended.next({ source: this, distance, dropPoint: pointerPosition, event });\n this.dropped.next({\n item: this,\n currentIndex,\n previousIndex: this._initialIndex,\n container: container,\n previousContainer: this._initialContainer,\n isPointerOverContainer,\n distance,\n dropPoint: pointerPosition,\n event,\n });\n container.drop(this, currentIndex, this._initialIndex, this._initialContainer, isPointerOverContainer, distance, pointerPosition, event);\n this._dropContainer = this._initialContainer;\n });\n }\n /**\n * Updates the item's position in its drop container, or moves it\n * into a new one, depending on its current drag position.\n */\n _updateActiveDropContainer({ x, y }, { x: rawX, y: rawY }) {\n // Drop container that draggable has been moved into.\n let newContainer = this._initialContainer._getSiblingContainerFromPosition(this, x, y);\n // If we couldn't find a new container to move the item into, and the item has left its\n // initial container, check whether the it's over the initial container. This handles the\n // case where two containers are connected one way and the user tries to undo dragging an\n // item into a new container.\n if (!newContainer &&\n this._dropContainer !== this._initialContainer &&\n this._initialContainer._isOverContainer(x, y)) {\n newContainer = this._initialContainer;\n }\n if (newContainer && newContainer !== this._dropContainer) {\n this._ngZone.run(() => {\n // Notify the old container that the item has left.\n this.exited.next({ item: this, container: this._dropContainer });\n this._dropContainer.exit(this);\n // Notify the new container that the item has entered.\n this._dropContainer = newContainer;\n this._dropContainer.enter(this, x, y, newContainer === this._initialContainer &&\n // If we're re-entering the initial container and sorting is disabled,\n // put item the into its starting index to begin with.\n newContainer.sortingDisabled\n ? this._initialIndex\n : undefined);\n this.entered.next({\n item: this,\n container: newContainer,\n currentIndex: newContainer.getItemIndex(this),\n });\n });\n }\n // Dragging may have been interrupted as a result of the events above.\n if (this.isDragging()) {\n this._dropContainer._startScrollingIfNecessary(rawX, rawY);\n this._dropContainer._sortItem(this, x, y, this._pointerDirectionDelta);\n if (this.constrainPosition) {\n this._applyPreviewTransform(x, y);\n }\n else {\n this._applyPreviewTransform(x - this._pickupPositionInElement.x, y - this._pickupPositionInElement.y);\n }\n }\n }\n /**\n * Animates the preview element from its current position to the location of the drop placeholder.\n * @returns Promise that resolves when the animation completes.\n */\n _animatePreviewToPlaceholder() {\n // If the user hasn't moved yet, the transitionend event won't fire.\n if (!this._hasMoved) {\n return Promise.resolve();\n }\n const placeholderRect = this._placeholder.getBoundingClientRect();\n // Apply the class that adds a transition to the preview.\n this._preview.addClass('cdk-drag-animating');\n // Move the preview to the placeholder position.\n this._applyPreviewTransform(placeholderRect.left, placeholderRect.top);\n // If the element doesn't have a `transition`, the `transitionend` event won't fire. Since\n // we need to trigger a style recalculation in order for the `cdk-drag-animating` class to\n // apply its style, we take advantage of the available info to figure out whether we need to\n // bind the event in the first place.\n const duration = this._preview.getTransitionDuration();\n if (duration === 0) {\n return Promise.resolve();\n }\n return this._ngZone.runOutsideAngular(() => {\n return new Promise(resolve => {\n const handler = ((event) => {\n if (!event ||\n (this._preview &&\n _getEventTarget(event) === this._preview.element &&\n event.propertyName === 'transform')) {\n this._preview?.removeEventListener('transitionend', handler);\n resolve();\n clearTimeout(timeout);\n }\n });\n // If a transition is short enough, the browser might not fire the `transitionend` event.\n // Since we know how long it's supposed to take, add a timeout with a 50% buffer that'll\n // fire if the transition hasn't completed when it was supposed to.\n const timeout = setTimeout(handler, duration * 1.5);\n this._preview.addEventListener('transitionend', handler);\n });\n });\n }\n /** Creates an element that will be shown instead of the current element while dragging. */\n _createPlaceholderElement() {\n const placeholderConfig = this._placeholderTemplate;\n const placeholderTemplate = placeholderConfig ? placeholderConfig.template : null;\n let placeholder;\n if (placeholderTemplate) {\n this._placeholderRef = placeholderConfig.viewContainer.createEmbeddedView(placeholderTemplate, placeholderConfig.context);\n this._placeholderRef.detectChanges();\n placeholder = getRootNode(this._placeholderRef, this._document);\n }\n else {\n placeholder = deepCloneNode(this._rootElement);\n }\n // Stop pointer events on the preview so the user can't\n // interact with it while the preview is animating.\n placeholder.style.pointerEvents = 'none';\n placeholder.classList.add('cdk-drag-placeholder');\n return placeholder;\n }\n /**\n * Figures out the coordinates at which an element was picked up.\n * @param referenceElement Element that initiated the dragging.\n * @param event Event that initiated the dragging.\n */\n _getPointerPositionInElement(elementRect, referenceElement, event) {\n const handleElement = referenceElement === this._rootElement ? null : referenceElement;\n const referenceRect = handleElement ? handleElement.getBoundingClientRect() : elementRect;\n const point = isTouchEvent(event) ? event.targetTouches[0] : event;\n const scrollPosition = this._getViewportScrollPosition();\n const x = point.pageX - referenceRect.left - scrollPosition.left;\n const y = point.pageY - referenceRect.top - scrollPosition.top;\n return {\n x: referenceRect.left - elementRect.left + x,\n y: referenceRect.top - elementRect.top + y,\n };\n }\n /** Determines the point of the page that was touched by the user. */\n _getPointerPositionOnPage(event) {\n const scrollPosition = this._getViewportScrollPosition();\n const point = isTouchEvent(event)\n ? // `touches` will be empty for start/end events so we have to fall back to `changedTouches`.\n // Also note that on real devices we're guaranteed for either `touches` or `changedTouches`\n // to have a value, but Firefox in device emulation mode has a bug where both can be empty\n // for `touchstart` and `touchend` so we fall back to a dummy object in order to avoid\n // throwing an error. The value returned here will be incorrect, but since this only\n // breaks inside a developer tool and the value is only used for secondary information,\n // we can get away with it. See https://bugzilla.mozilla.org/show_bug.cgi?id=1615824.\n event.touches[0] || event.changedTouches[0] || { pageX: 0, pageY: 0 }\n : event;\n const x = point.pageX - scrollPosition.left;\n const y = point.pageY - scrollPosition.top;\n // if dragging SVG element, try to convert from the screen coordinate system to the SVG\n // coordinate system\n if (this._ownerSVGElement) {\n const svgMatrix = this._ownerSVGElement.getScreenCTM();\n if (svgMatrix) {\n const svgPoint = this._ownerSVGElement.createSVGPoint();\n svgPoint.x = x;\n svgPoint.y = y;\n return svgPoint.matrixTransform(svgMatrix.inverse());\n }\n }\n return { x, y };\n }\n /** Gets the pointer position on the page, accounting for any position constraints. */\n _getConstrainedPointerPosition(point) {\n const dropContainerLock = this._dropContainer ? this._dropContainer.lockAxis : null;\n let { x, y } = this.constrainPosition\n ? this.constrainPosition(point, this, this._initialDomRect, this._pickupPositionInElement)\n : point;\n if (this.lockAxis === 'x' || dropContainerLock === 'x') {\n y =\n this._pickupPositionOnPage.y -\n (this.constrainPosition ? this._pickupPositionInElement.y : 0);\n }\n else if (this.lockAxis === 'y' || dropContainerLock === 'y') {\n x =\n this._pickupPositionOnPage.x -\n (this.constrainPosition ? this._pickupPositionInElement.x : 0);\n }\n if (this._boundaryRect) {\n // If not using a custom constrain we need to account for the pickup position in the element\n // otherwise we do not need to do this, as it has already been accounted for\n const { x: pickupX, y: pickupY } = !this.constrainPosition\n ? this._pickupPositionInElement\n : { x: 0, y: 0 };\n const boundaryRect = this._boundaryRect;\n const { width: previewWidth, height: previewHeight } = this._getPreviewRect();\n const minY = boundaryRect.top + pickupY;\n const maxY = boundaryRect.bottom - (previewHeight - pickupY);\n const minX = boundaryRect.left + pickupX;\n const maxX = boundaryRect.right - (previewWidth - pickupX);\n x = clamp$1(x, minX, maxX);\n y = clamp$1(y, minY, maxY);\n }\n return { x, y };\n }\n /** Updates the current drag delta, based on the user's current pointer position on the page. */\n _updatePointerDirectionDelta(pointerPositionOnPage) {\n const { x, y } = pointerPositionOnPage;\n const delta = this._pointerDirectionDelta;\n const positionSinceLastChange = this._pointerPositionAtLastDirectionChange;\n // Amount of pixels the user has dragged since the last time the direction changed.\n const changeX = Math.abs(x - positionSinceLastChange.x);\n const changeY = Math.abs(y - positionSinceLastChange.y);\n // Because we handle pointer events on a per-pixel basis, we don't want the delta\n // to change for every pixel, otherwise anything that depends on it can look erratic.\n // To make the delta more consistent, we track how much the user has moved since the last\n // delta change and we only update it after it has reached a certain threshold.\n if (changeX > this._config.pointerDirectionChangeThreshold) {\n delta.x = x > positionSinceLastChange.x ? 1 : -1;\n positionSinceLastChange.x = x;\n }\n if (changeY > this._config.pointerDirectionChangeThreshold) {\n delta.y = y > positionSinceLastChange.y ? 1 : -1;\n positionSinceLastChange.y = y;\n }\n return delta;\n }\n /** Toggles the native drag interactions, based on how many handles are registered. */\n _toggleNativeDragInteractions() {\n if (!this._rootElement || !this._handles) {\n return;\n }\n const shouldEnable = this._handles.length > 0 || !this.isDragging();\n if (shouldEnable !== this._nativeInteractionsEnabled) {\n this._nativeInteractionsEnabled = shouldEnable;\n toggleNativeDragInteractions(this._rootElement, shouldEnable);\n }\n }\n /** Removes the manually-added event listeners from the root element. */\n _removeRootElementListeners(element) {\n element.removeEventListener('mousedown', this._pointerDown, activeEventListenerOptions);\n element.removeEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);\n element.removeEventListener('dragstart', this._nativeDragStart, activeEventListenerOptions);\n }\n /**\n * Applies a `transform` to the root element, taking into account any existing transforms on it.\n * @param x New transform value along the X axis.\n * @param y New transform value along the Y axis.\n */\n _applyRootElementTransform(x, y) {\n const scale = 1 / this.scale;\n const transform = getTransform(x * scale, y * scale);\n const styles = this._rootElement.style;\n // Cache the previous transform amount only after the first drag sequence, because\n // we don't want our own transforms to stack on top of each other.\n // Should be excluded none because none + translate3d(x, y, x) is invalid css\n if (this._initialTransform == null) {\n this._initialTransform =\n styles.transform && styles.transform != 'none' ? styles.transform : '';\n }\n // Preserve the previous `transform` value, if there was one. Note that we apply our own\n // transform before the user's, because things like rotation can affect which direction\n // the element will be translated towards.\n styles.transform = combineTransforms(transform, this._initialTransform);\n }\n /**\n * Applies a `transform` to the preview, taking into account any existing transforms on it.\n * @param x New transform value along the X axis.\n * @param y New transform value along the Y axis.\n */\n _applyPreviewTransform(x, y) {\n // Only apply the initial transform if the preview is a clone of the original element, otherwise\n // it could be completely different and the transform might not make sense anymore.\n const initialTransform = this._previewTemplate?.template ? undefined : this._initialTransform;\n const transform = getTransform(x, y);\n this._preview.setTransform(combineTransforms(transform, initialTransform));\n }\n /**\n * Gets the distance that the user has dragged during the current drag sequence.\n * @param currentPosition Current position of the user's pointer.\n */\n _getDragDistance(currentPosition) {\n const pickupPosition = this._pickupPositionOnPage;\n if (pickupPosition) {\n return { x: currentPosition.x - pickupPosition.x, y: currentPosition.y - pickupPosition.y };\n }\n return { x: 0, y: 0 };\n }\n /** Cleans up any cached element dimensions that we don't need after dragging has stopped. */\n _cleanupCachedDimensions() {\n this._boundaryRect = this._previewRect = undefined;\n this._parentPositions.clear();\n }\n /**\n * Checks whether the element is still inside its boundary after the viewport has been resized.\n * If not, the position is adjusted so that the element fits again.\n */\n _containInsideBoundaryOnResize() {\n let { x, y } = this._passiveTransform;\n if ((x === 0 && y === 0) || this.isDragging() || !this._boundaryElement) {\n return;\n }\n // Note: don't use `_clientRectAtStart` here, because we want the latest position.\n const elementRect = this._rootElement.getBoundingClientRect();\n const boundaryRect = this._boundaryElement.getBoundingClientRect();\n // It's possible that the element got hidden away after dragging (e.g. by switching to a\n // different tab). Don't do anything in this case so we don't clear the user's position.\n if ((boundaryRect.width === 0 && boundaryRect.height === 0) ||\n (elementRect.width === 0 && elementRect.height === 0)) {\n return;\n }\n const leftOverflow = boundaryRect.left - elementRect.left;\n const rightOverflow = elementRect.right - boundaryRect.right;\n const topOverflow = boundaryRect.top - elementRect.top;\n const bottomOverflow = elementRect.bottom - boundaryRect.bottom;\n // If the element has become wider than the boundary, we can't\n // do much to make it fit so we just anchor it to the left.\n if (boundaryRect.width > elementRect.width) {\n if (leftOverflow > 0) {\n x += leftOverflow;\n }\n if (rightOverflow > 0) {\n x -= rightOverflow;\n }\n }\n else {\n x = 0;\n }\n // If the element has become taller than the boundary, we can't\n // do much to make it fit so we just anchor it to the top.\n if (boundaryRect.height > elementRect.height) {\n if (topOverflow > 0) {\n y += topOverflow;\n }\n if (bottomOverflow > 0) {\n y -= bottomOverflow;\n }\n }\n else {\n y = 0;\n }\n if (x !== this._passiveTransform.x || y !== this._passiveTransform.y) {\n this.setFreeDragPosition({ y, x });\n }\n }\n /** Gets the drag start delay, based on the event type. */\n _getDragStartDelay(event) {\n const value = this.dragStartDelay;\n if (typeof value === 'number') {\n return value;\n }\n else if (isTouchEvent(event)) {\n return value.touch;\n }\n return value ? value.mouse : 0;\n }\n /** Updates the internal state of the draggable element when scrolling has occurred. */\n _updateOnScroll(event) {\n const scrollDifference = this._parentPositions.handleScroll(event);\n if (scrollDifference) {\n const target = _getEventTarget(event);\n // DOMRect dimensions are based on the scroll position of the page and its parent\n // node so we have to update the cached boundary DOMRect if the user has scrolled.\n if (this._boundaryRect &&\n target !== this._boundaryElement &&\n target.contains(this._boundaryElement)) {\n adjustDomRect(this._boundaryRect, scrollDifference.top, scrollDifference.left);\n }\n this._pickupPositionOnPage.x += scrollDifference.left;\n this._pickupPositionOnPage.y += scrollDifference.top;\n // If we're in free drag mode, we have to update the active transform, because\n // it isn't relative to the viewport like the preview inside a drop list.\n if (!this._dropContainer) {\n this._activeTransform.x -= scrollDifference.left;\n this._activeTransform.y -= scrollDifference.top;\n this._applyRootElementTransform(this._activeTransform.x, this._activeTransform.y);\n }\n }\n }\n /** Gets the scroll position of the viewport. */\n _getViewportScrollPosition() {\n return (this._parentPositions.positions.get(this._document)?.scrollPosition ||\n this._parentPositions.getViewportScrollPosition());\n }\n /**\n * Lazily resolves and returns the shadow root of the element. We do this in a function, rather\n * than saving it in property directly on init, because we want to resolve it as late as possible\n * in order to ensure that the element has been moved into the shadow DOM. Doing it inside the\n * constructor might be too early if the element is inside of something like `ngFor` or `ngIf`.\n */\n _getShadowRoot() {\n if (this._cachedShadowRoot === undefined) {\n this._cachedShadowRoot = _getShadowRoot(this._rootElement);\n }\n return this._cachedShadowRoot;\n }\n /** Gets the element into which the drag preview should be inserted. */\n _getPreviewInsertionPoint(initialParent, shadowRoot) {\n const previewContainer = this._previewContainer || 'global';\n if (previewContainer === 'parent') {\n return initialParent;\n }\n if (previewContainer === 'global') {\n const documentRef = this._document;\n // We can't use the body if the user is in fullscreen mode,\n // because the preview will render under the fullscreen element.\n // TODO(crisbeto): dedupe this with the `FullscreenOverlayContainer` eventually.\n return (shadowRoot ||\n documentRef.fullscreenElement ||\n documentRef.webkitFullscreenElement ||\n documentRef.mozFullScreenElement ||\n documentRef.msFullscreenElement ||\n documentRef.body);\n }\n return coerceElement(previewContainer);\n }\n /** Lazily resolves and returns the dimensions of the preview. */\n _getPreviewRect() {\n // Cache the preview element rect if we haven't cached it already or if\n // we cached it too early before the element dimensions were computed.\n if (!this._previewRect || (!this._previewRect.width && !this._previewRect.height)) {\n this._previewRect = this._preview\n ? this._preview.getBoundingClientRect()\n : this._initialDomRect;\n }\n return this._previewRect;\n }\n /** Gets a handle that is the target of an event. */\n _getTargetHandle(event) {\n return this._handles.find(handle => {\n return event.target && (event.target === handle || handle.contains(event.target));\n });\n }\n}\n/** Clamps a value between a minimum and a maximum. */\nfunction clamp$1(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\n/** Determines whether an event is a touch event. */\nfunction isTouchEvent(event) {\n // This function is called for every pixel that the user has dragged so we need it to be\n // as fast as possible. Since we only bind mouse events and touch events, we can assume\n // that if the event's name starts with `t`, it's a touch event.\n return event.type[0] === 't';\n}\n/** Callback invoked for `selectstart` events inside the shadow DOM. */\nfunction shadowDomSelectStart(event) {\n event.preventDefault();\n}\n\n/**\n * Moves an item one index in an array to another.\n * @param array Array in which to move the item.\n * @param fromIndex Starting index of the item.\n * @param toIndex Index to which the item should be moved.\n */\nfunction moveItemInArray(array, fromIndex, toIndex) {\n const from = clamp(fromIndex, array.length - 1);\n const to = clamp(toIndex, array.length - 1);\n if (from === to) {\n return;\n }\n const target = array[from];\n const delta = to < from ? -1 : 1;\n for (let i = from; i !== to; i += delta) {\n array[i] = array[i + delta];\n }\n array[to] = target;\n}\n/**\n * Moves an item from one array to another.\n * @param currentArray Array from which to transfer the item.\n * @param targetArray Array into which to put the item.\n * @param currentIndex Index of the item in its current array.\n * @param targetIndex Index at which to insert the item.\n */\nfunction transferArrayItem(currentArray, targetArray, currentIndex, targetIndex) {\n const from = clamp(currentIndex, currentArray.length - 1);\n const to = clamp(targetIndex, targetArray.length);\n if (currentArray.length) {\n targetArray.splice(to, 0, currentArray.splice(from, 1)[0]);\n }\n}\n/**\n * Copies an item from one array to another, leaving it in its\n * original position in current array.\n * @param currentArray Array from which to copy the item.\n * @param targetArray Array into which is copy the item.\n * @param currentIndex Index of the item in its current array.\n * @param targetIndex Index at which to insert the item.\n *\n */\nfunction copyArrayItem(currentArray, targetArray, currentIndex, targetIndex) {\n const to = clamp(targetIndex, targetArray.length);\n if (currentArray.length) {\n targetArray.splice(to, 0, currentArray[currentIndex]);\n }\n}\n/** Clamps a number between zero and a maximum. */\nfunction clamp(value, max) {\n return Math.max(0, Math.min(max, value));\n}\n\n/**\n * Strategy that only supports sorting along a single axis.\n * Items are reordered using CSS transforms which allows for sorting to be animated.\n * @docs-private\n */\nclass SingleAxisSortStrategy {\n constructor(_dragDropRegistry) {\n this._dragDropRegistry = _dragDropRegistry;\n /** Cache of the dimensions of all the items inside the container. */\n this._itemPositions = [];\n /** Direction in which the list is oriented. */\n this.orientation = 'vertical';\n /**\n * Keeps track of the item that was last swapped with the dragged item, as well as what direction\n * the pointer was moving in when the swap occurred and whether the user's pointer continued to\n * overlap with the swapped item after the swapping occurred.\n */\n this._previousSwap = {\n drag: null,\n delta: 0,\n overlaps: false,\n };\n }\n /**\n * To be called when the drag sequence starts.\n * @param items Items that are currently in the list.\n */\n start(items) {\n this.withItems(items);\n }\n /**\n * To be called when an item is being sorted.\n * @param item Item to be sorted.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param pointerDelta Direction in which the pointer is moving along each axis.\n */\n sort(item, pointerX, pointerY, pointerDelta) {\n const siblings = this._itemPositions;\n const newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY, pointerDelta);\n if (newIndex === -1 && siblings.length > 0) {\n return null;\n }\n const isHorizontal = this.orientation === 'horizontal';\n const currentIndex = siblings.findIndex(currentItem => currentItem.drag === item);\n const siblingAtNewPosition = siblings[newIndex];\n const currentPosition = siblings[currentIndex].clientRect;\n const newPosition = siblingAtNewPosition.clientRect;\n const delta = currentIndex > newIndex ? 1 : -1;\n // How many pixels the item's placeholder should be offset.\n const itemOffset = this._getItemOffsetPx(currentPosition, newPosition, delta);\n // How many pixels all the other items should be offset.\n const siblingOffset = this._getSiblingOffsetPx(currentIndex, siblings, delta);\n // Save the previous order of the items before moving the item to its new index.\n // We use this to check whether an item has been moved as a result of the sorting.\n const oldOrder = siblings.slice();\n // Shuffle the array in place.\n moveItemInArray(siblings, currentIndex, newIndex);\n siblings.forEach((sibling, index) => {\n // Don't do anything if the position hasn't changed.\n if (oldOrder[index] === sibling) {\n return;\n }\n const isDraggedItem = sibling.drag === item;\n const offset = isDraggedItem ? itemOffset : siblingOffset;\n const elementToOffset = isDraggedItem\n ? item.getPlaceholderElement()\n : sibling.drag.getRootElement();\n // Update the offset to reflect the new position.\n sibling.offset += offset;\n const transformAmount = Math.round(sibling.offset * (1 / sibling.drag.scale));\n // Since we're moving the items with a `transform`, we need to adjust their cached\n // client rects to reflect their new position, as well as swap their positions in the cache.\n // Note that we shouldn't use `getBoundingClientRect` here to update the cache, because the\n // elements may be mid-animation which will give us a wrong result.\n if (isHorizontal) {\n // Round the transforms since some browsers will\n // blur the elements, for sub-pixel transforms.\n elementToOffset.style.transform = combineTransforms(`translate3d(${transformAmount}px, 0, 0)`, sibling.initialTransform);\n adjustDomRect(sibling.clientRect, 0, offset);\n }\n else {\n elementToOffset.style.transform = combineTransforms(`translate3d(0, ${transformAmount}px, 0)`, sibling.initialTransform);\n adjustDomRect(sibling.clientRect, offset, 0);\n }\n });\n // Note that it's important that we do this after the client rects have been adjusted.\n this._previousSwap.overlaps = isInsideClientRect(newPosition, pointerX, pointerY);\n this._previousSwap.drag = siblingAtNewPosition.drag;\n this._previousSwap.delta = isHorizontal ? pointerDelta.x : pointerDelta.y;\n return { previousIndex: currentIndex, currentIndex: newIndex };\n }\n /**\n * Called when an item is being moved into the container.\n * @param item Item that was moved into the container.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param index Index at which the item entered. If omitted, the container will try to figure it\n * out automatically.\n */\n enter(item, pointerX, pointerY, index) {\n const newIndex = index == null || index < 0\n ? // We use the coordinates of where the item entered the drop\n // zone to figure out at which index it should be inserted.\n this._getItemIndexFromPointerPosition(item, pointerX, pointerY)\n : index;\n const activeDraggables = this._activeDraggables;\n const currentIndex = activeDraggables.indexOf(item);\n const placeholder = item.getPlaceholderElement();\n let newPositionReference = activeDraggables[newIndex];\n // If the item at the new position is the same as the item that is being dragged,\n // it means that we're trying to restore the item to its initial position. In this\n // case we should use the next item from the list as the reference.\n if (newPositionReference === item) {\n newPositionReference = activeDraggables[newIndex + 1];\n }\n // If we didn't find a new position reference, it means that either the item didn't start off\n // in this container, or that the item requested to be inserted at the end of the list.\n if (!newPositionReference &&\n (newIndex == null || newIndex === -1 || newIndex < activeDraggables.length - 1) &&\n this._shouldEnterAsFirstChild(pointerX, pointerY)) {\n newPositionReference = activeDraggables[0];\n }\n // Since the item may be in the `activeDraggables` already (e.g. if the user dragged it\n // into another container and back again), we have to ensure that it isn't duplicated.\n if (currentIndex > -1) {\n activeDraggables.splice(currentIndex, 1);\n }\n // Don't use items that are being dragged as a reference, because\n // their element has been moved down to the bottom of the body.\n if (newPositionReference && !this._dragDropRegistry.isDragging(newPositionReference)) {\n const element = newPositionReference.getRootElement();\n element.parentElement.insertBefore(placeholder, element);\n activeDraggables.splice(newIndex, 0, item);\n }\n else {\n this._element.appendChild(placeholder);\n activeDraggables.push(item);\n }\n // The transform needs to be cleared so it doesn't throw off the measurements.\n placeholder.style.transform = '';\n // Note that usually `start` is called together with `enter` when an item goes into a new\n // container. This will cache item positions, but we need to refresh them since the amount\n // of items has changed.\n this._cacheItemPositions();\n }\n /** Sets the items that are currently part of the list. */\n withItems(items) {\n this._activeDraggables = items.slice();\n this._cacheItemPositions();\n }\n /** Assigns a sort predicate to the strategy. */\n withSortPredicate(predicate) {\n this._sortPredicate = predicate;\n }\n /** Resets the strategy to its initial state before dragging was started. */\n reset() {\n // TODO(crisbeto): may have to wait for the animations to finish.\n this._activeDraggables?.forEach(item => {\n const rootElement = item.getRootElement();\n if (rootElement) {\n const initialTransform = this._itemPositions.find(p => p.drag === item)?.initialTransform;\n rootElement.style.transform = initialTransform || '';\n }\n });\n this._itemPositions = [];\n this._activeDraggables = [];\n this._previousSwap.drag = null;\n this._previousSwap.delta = 0;\n this._previousSwap.overlaps = false;\n }\n /**\n * Gets a snapshot of items currently in the list.\n * Can include items that we dragged in from another list.\n */\n getActiveItemsSnapshot() {\n return this._activeDraggables;\n }\n /** Gets the index of a specific item. */\n getItemIndex(item) {\n // Items are sorted always by top/left in the cache, however they flow differently in RTL.\n // The rest of the logic still stands no matter what orientation we're in, however\n // we need to invert the array when determining the index.\n const items = this.orientation === 'horizontal' && this.direction === 'rtl'\n ? this._itemPositions.slice().reverse()\n : this._itemPositions;\n return items.findIndex(currentItem => currentItem.drag === item);\n }\n /** Used to notify the strategy that the scroll position has changed. */\n updateOnScroll(topDifference, leftDifference) {\n // Since we know the amount that the user has scrolled we can shift all of the\n // client rectangles ourselves. This is cheaper than re-measuring everything and\n // we can avoid inconsistent behavior where we might be measuring the element before\n // its position has changed.\n this._itemPositions.forEach(({ clientRect }) => {\n adjustDomRect(clientRect, topDifference, leftDifference);\n });\n // We need two loops for this, because we want all of the cached\n // positions to be up-to-date before we re-sort the item.\n this._itemPositions.forEach(({ drag }) => {\n if (this._dragDropRegistry.isDragging(drag)) {\n // We need to re-sort the item manually, because the pointer move\n // events won't be dispatched while the user is scrolling.\n drag._sortFromLastPointerPosition();\n }\n });\n }\n withElementContainer(container) {\n this._element = container;\n }\n /** Refreshes the position cache of the items and sibling containers. */\n _cacheItemPositions() {\n const isHorizontal = this.orientation === 'horizontal';\n this._itemPositions = this._activeDraggables\n .map(drag => {\n const elementToMeasure = drag.getVisibleElement();\n return {\n drag,\n offset: 0,\n initialTransform: elementToMeasure.style.transform || '',\n clientRect: getMutableClientRect(elementToMeasure),\n };\n })\n .sort((a, b) => {\n return isHorizontal\n ? a.clientRect.left - b.clientRect.left\n : a.clientRect.top - b.clientRect.top;\n });\n }\n /**\n * Gets the offset in pixels by which the item that is being dragged should be moved.\n * @param currentPosition Current position of the item.\n * @param newPosition Position of the item where the current item should be moved.\n * @param delta Direction in which the user is moving.\n */\n _getItemOffsetPx(currentPosition, newPosition, delta) {\n const isHorizontal = this.orientation === 'horizontal';\n let itemOffset = isHorizontal\n ? newPosition.left - currentPosition.left\n : newPosition.top - currentPosition.top;\n // Account for differences in the item width/height.\n if (delta === -1) {\n itemOffset += isHorizontal\n ? newPosition.width - currentPosition.width\n : newPosition.height - currentPosition.height;\n }\n return itemOffset;\n }\n /**\n * Gets the offset in pixels by which the items that aren't being dragged should be moved.\n * @param currentIndex Index of the item currently being dragged.\n * @param siblings All of the items in the list.\n * @param delta Direction in which the user is moving.\n */\n _getSiblingOffsetPx(currentIndex, siblings, delta) {\n const isHorizontal = this.orientation === 'horizontal';\n const currentPosition = siblings[currentIndex].clientRect;\n const immediateSibling = siblings[currentIndex + delta * -1];\n let siblingOffset = currentPosition[isHorizontal ? 'width' : 'height'] * delta;\n if (immediateSibling) {\n const start = isHorizontal ? 'left' : 'top';\n const end = isHorizontal ? 'right' : 'bottom';\n // Get the spacing between the start of the current item and the end of the one immediately\n // after it in the direction in which the user is dragging, or vice versa. We add it to the\n // offset in order to push the element to where it will be when it's inline and is influenced\n // by the `margin` of its siblings.\n if (delta === -1) {\n siblingOffset -= immediateSibling.clientRect[start] - currentPosition[end];\n }\n else {\n siblingOffset += currentPosition[start] - immediateSibling.clientRect[end];\n }\n }\n return siblingOffset;\n }\n /**\n * Checks if pointer is entering in the first position\n * @param pointerX Position of the user's pointer along the X axis.\n * @param pointerY Position of the user's pointer along the Y axis.\n */\n _shouldEnterAsFirstChild(pointerX, pointerY) {\n if (!this._activeDraggables.length) {\n return false;\n }\n const itemPositions = this._itemPositions;\n const isHorizontal = this.orientation === 'horizontal';\n // `itemPositions` are sorted by position while `activeDraggables` are sorted by child index\n // check if container is using some sort of \"reverse\" ordering (eg: flex-direction: row-reverse)\n const reversed = itemPositions[0].drag !== this._activeDraggables[0];\n if (reversed) {\n const lastItemRect = itemPositions[itemPositions.length - 1].clientRect;\n return isHorizontal ? pointerX >= lastItemRect.right : pointerY >= lastItemRect.bottom;\n }\n else {\n const firstItemRect = itemPositions[0].clientRect;\n return isHorizontal ? pointerX <= firstItemRect.left : pointerY <= firstItemRect.top;\n }\n }\n /**\n * Gets the index of an item in the drop container, based on the position of the user's pointer.\n * @param item Item that is being sorted.\n * @param pointerX Position of the user's pointer along the X axis.\n * @param pointerY Position of the user's pointer along the Y axis.\n * @param delta Direction in which the user is moving their pointer.\n */\n _getItemIndexFromPointerPosition(item, pointerX, pointerY, delta) {\n const isHorizontal = this.orientation === 'horizontal';\n const index = this._itemPositions.findIndex(({ drag, clientRect }) => {\n // Skip the item itself.\n if (drag === item) {\n return false;\n }\n if (delta) {\n const direction = isHorizontal ? delta.x : delta.y;\n // If the user is still hovering over the same item as last time, their cursor hasn't left\n // the item after we made the swap, and they didn't change the direction in which they're\n // dragging, we don't consider it a direction swap.\n if (drag === this._previousSwap.drag &&\n this._previousSwap.overlaps &&\n direction === this._previousSwap.delta) {\n return false;\n }\n }\n return isHorizontal\n ? // Round these down since most browsers report client rects with\n // sub-pixel precision, whereas the pointer coordinates are rounded to pixels.\n pointerX >= Math.floor(clientRect.left) && pointerX < Math.floor(clientRect.right)\n : pointerY >= Math.floor(clientRect.top) && pointerY < Math.floor(clientRect.bottom);\n });\n return index === -1 || !this._sortPredicate(index, item) ? -1 : index;\n }\n}\n\n/**\n * Strategy that only supports sorting on a list that might wrap.\n * Items are reordered by moving their DOM nodes around.\n * @docs-private\n */\nclass MixedSortStrategy {\n constructor(_document, _dragDropRegistry) {\n this._document = _document;\n this._dragDropRegistry = _dragDropRegistry;\n /**\n * Keeps track of the item that was last swapped with the dragged item, as well as what direction\n * the pointer was moving in when the swap occurred and whether the user's pointer continued to\n * overlap with the swapped item after the swapping occurred.\n */\n this._previousSwap = {\n drag: null,\n deltaX: 0,\n deltaY: 0,\n overlaps: false,\n };\n /**\n * Keeps track of the relationship between a node and its next sibling. This information\n * is used to restore the DOM to the order it was in before dragging started.\n */\n this._relatedNodes = [];\n }\n /**\n * To be called when the drag sequence starts.\n * @param items Items that are currently in the list.\n */\n start(items) {\n const childNodes = this._element.childNodes;\n this._relatedNodes = [];\n for (let i = 0; i < childNodes.length; i++) {\n const node = childNodes[i];\n this._relatedNodes.push([node, node.nextSibling]);\n }\n this.withItems(items);\n }\n /**\n * To be called when an item is being sorted.\n * @param item Item to be sorted.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param pointerDelta Direction in which the pointer is moving along each axis.\n */\n sort(item, pointerX, pointerY, pointerDelta) {\n const newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY);\n const previousSwap = this._previousSwap;\n if (newIndex === -1 || this._activeItems[newIndex] === item) {\n return null;\n }\n const toSwapWith = this._activeItems[newIndex];\n // Prevent too many swaps over the same item.\n if (previousSwap.drag === toSwapWith &&\n previousSwap.overlaps &&\n previousSwap.deltaX === pointerDelta.x &&\n previousSwap.deltaY === pointerDelta.y) {\n return null;\n }\n const previousIndex = this.getItemIndex(item);\n const current = item.getPlaceholderElement();\n const overlapElement = toSwapWith.getRootElement();\n if (newIndex > previousIndex) {\n overlapElement.after(current);\n }\n else {\n overlapElement.before(current);\n }\n moveItemInArray(this._activeItems, previousIndex, newIndex);\n const newOverlapElement = this._getRootNode().elementFromPoint(pointerX, pointerY);\n // Note: it's tempting to save the entire `pointerDelta` object here, however that'll\n // break this functionality, because the same object is passed for all `sort` calls.\n previousSwap.deltaX = pointerDelta.x;\n previousSwap.deltaY = pointerDelta.y;\n previousSwap.drag = toSwapWith;\n previousSwap.overlaps =\n overlapElement === newOverlapElement || overlapElement.contains(newOverlapElement);\n return {\n previousIndex,\n currentIndex: newIndex,\n };\n }\n /**\n * Called when an item is being moved into the container.\n * @param item Item that was moved into the container.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param index Index at which the item entered. If omitted, the container will try to figure it\n * out automatically.\n */\n enter(item, pointerX, pointerY, index) {\n let enterIndex = index == null || index < 0\n ? this._getItemIndexFromPointerPosition(item, pointerX, pointerY)\n : index;\n // In some cases (e.g. when the container has padding) we might not be able to figure\n // out which item to insert the dragged item next to, because the pointer didn't overlap\n // with anything. In that case we find the item that's closest to the pointer.\n if (enterIndex === -1) {\n enterIndex = this._getClosestItemIndexToPointer(item, pointerX, pointerY);\n }\n const targetItem = this._activeItems[enterIndex];\n const currentIndex = this._activeItems.indexOf(item);\n if (currentIndex > -1) {\n this._activeItems.splice(currentIndex, 1);\n }\n if (targetItem && !this._dragDropRegistry.isDragging(targetItem)) {\n this._activeItems.splice(enterIndex, 0, item);\n targetItem.getRootElement().before(item.getPlaceholderElement());\n }\n else {\n this._activeItems.push(item);\n this._element.appendChild(item.getPlaceholderElement());\n }\n }\n /** Sets the items that are currently part of the list. */\n withItems(items) {\n this._activeItems = items.slice();\n }\n /** Assigns a sort predicate to the strategy. */\n withSortPredicate(predicate) {\n this._sortPredicate = predicate;\n }\n /** Resets the strategy to its initial state before dragging was started. */\n reset() {\n const root = this._element;\n const previousSwap = this._previousSwap;\n // Moving elements around in the DOM can break things like the `@for` loop, because it\n // uses comment nodes to know where to insert elements. To avoid such issues, we restore\n // the DOM nodes in the list to their original order when the list is reset.\n // Note that this could be simpler if we just saved all the nodes, cleared the root\n // and then appended them in the original order. We don't do it, because it can break\n // down depending on when the snapshot was taken. E.g. we may end up snapshotting the\n // placeholder element which is removed after dragging.\n for (let i = this._relatedNodes.length - 1; i > -1; i--) {\n const [node, nextSibling] = this._relatedNodes[i];\n if (node.parentNode === root && node.nextSibling !== nextSibling) {\n if (nextSibling === null) {\n root.appendChild(node);\n }\n else if (nextSibling.parentNode === root) {\n root.insertBefore(node, nextSibling);\n }\n }\n }\n this._relatedNodes = [];\n this._activeItems = [];\n previousSwap.drag = null;\n previousSwap.deltaX = previousSwap.deltaY = 0;\n previousSwap.overlaps = false;\n }\n /**\n * Gets a snapshot of items currently in the list.\n * Can include items that we dragged in from another list.\n */\n getActiveItemsSnapshot() {\n return this._activeItems;\n }\n /** Gets the index of a specific item. */\n getItemIndex(item) {\n return this._activeItems.indexOf(item);\n }\n /** Used to notify the strategy that the scroll position has changed. */\n updateOnScroll() {\n this._activeItems.forEach(item => {\n if (this._dragDropRegistry.isDragging(item)) {\n // We need to re-sort the item manually, because the pointer move\n // events won't be dispatched while the user is scrolling.\n item._sortFromLastPointerPosition();\n }\n });\n }\n withElementContainer(container) {\n if (container !== this._element) {\n this._element = container;\n this._rootNode = undefined;\n }\n }\n /**\n * Gets the index of an item in the drop container, based on the position of the user's pointer.\n * @param item Item that is being sorted.\n * @param pointerX Position of the user's pointer along the X axis.\n * @param pointerY Position of the user's pointer along the Y axis.\n * @param delta Direction in which the user is moving their pointer.\n */\n _getItemIndexFromPointerPosition(item, pointerX, pointerY) {\n const elementAtPoint = this._getRootNode().elementFromPoint(Math.floor(pointerX), Math.floor(pointerY));\n const index = elementAtPoint\n ? this._activeItems.findIndex(item => {\n const root = item.getRootElement();\n return elementAtPoint === root || root.contains(elementAtPoint);\n })\n : -1;\n return index === -1 || !this._sortPredicate(index, item) ? -1 : index;\n }\n /** Lazily resolves the list's root node. */\n _getRootNode() {\n // Resolve the root node lazily to ensure that the drop list is in its final place in the DOM.\n if (!this._rootNode) {\n this._rootNode = _getShadowRoot(this._element) || this._document;\n }\n return this._rootNode;\n }\n /**\n * Finds the index of the item that's closest to the item being dragged.\n * @param item Item being dragged.\n * @param pointerX Position of the user's pointer along the X axis.\n * @param pointerY Position of the user's pointer along the Y axis.\n */\n _getClosestItemIndexToPointer(item, pointerX, pointerY) {\n if (this._activeItems.length === 0) {\n return -1;\n }\n if (this._activeItems.length === 1) {\n return 0;\n }\n let minDistance = Infinity;\n let minIndex = -1;\n // Find the Euclidean distance (https://en.wikipedia.org/wiki/Euclidean_distance) between each\n // item and the pointer, and return the smallest one. Note that this is a bit flawed in that DOM\n // nodes are rectangles, not points, so we use the top/left coordinates. It should be enough\n // for our purposes.\n for (let i = 0; i < this._activeItems.length; i++) {\n const current = this._activeItems[i];\n if (current !== item) {\n const { x, y } = current.getRootElement().getBoundingClientRect();\n const distance = Math.hypot(pointerX - x, pointerY - y);\n if (distance < minDistance) {\n minDistance = distance;\n minIndex = i;\n }\n }\n }\n return minIndex;\n }\n}\n\n/**\n * Proximity, as a ratio to width/height, at which a\n * dragged item will affect the drop container.\n */\nconst DROP_PROXIMITY_THRESHOLD = 0.05;\n/**\n * Proximity, as a ratio to width/height at which to start auto-scrolling the drop list or the\n * viewport. The value comes from trying it out manually until it feels right.\n */\nconst SCROLL_PROXIMITY_THRESHOLD = 0.05;\n/** Vertical direction in which we can auto-scroll. */\nvar AutoScrollVerticalDirection;\n(function (AutoScrollVerticalDirection) {\n AutoScrollVerticalDirection[AutoScrollVerticalDirection[\"NONE\"] = 0] = \"NONE\";\n AutoScrollVerticalDirection[AutoScrollVerticalDirection[\"UP\"] = 1] = \"UP\";\n AutoScrollVerticalDirection[AutoScrollVerticalDirection[\"DOWN\"] = 2] = \"DOWN\";\n})(AutoScrollVerticalDirection || (AutoScrollVerticalDirection = {}));\n/** Horizontal direction in which we can auto-scroll. */\nvar AutoScrollHorizontalDirection;\n(function (AutoScrollHorizontalDirection) {\n AutoScrollHorizontalDirection[AutoScrollHorizontalDirection[\"NONE\"] = 0] = \"NONE\";\n AutoScrollHorizontalDirection[AutoScrollHorizontalDirection[\"LEFT\"] = 1] = \"LEFT\";\n AutoScrollHorizontalDirection[AutoScrollHorizontalDirection[\"RIGHT\"] = 2] = \"RIGHT\";\n})(AutoScrollHorizontalDirection || (AutoScrollHorizontalDirection = {}));\n/**\n * Reference to a drop list. Used to manipulate or dispose of the container.\n */\nclass DropListRef {\n constructor(element, _dragDropRegistry, _document, _ngZone, _viewportRuler) {\n this._dragDropRegistry = _dragDropRegistry;\n this._ngZone = _ngZone;\n this._viewportRuler = _viewportRuler;\n /** Whether starting a dragging sequence from this container is disabled. */\n this.disabled = false;\n /** Whether sorting items within the list is disabled. */\n this.sortingDisabled = false;\n /**\n * Whether auto-scrolling the view when the user\n * moves their pointer close to the edges is disabled.\n */\n this.autoScrollDisabled = false;\n /** Number of pixels to scroll for each frame when auto-scrolling an element. */\n this.autoScrollStep = 2;\n /**\n * Function that is used to determine whether an item\n * is allowed to be moved into a drop container.\n */\n this.enterPredicate = () => true;\n /** Function that is used to determine whether an item can be sorted into a particular index. */\n this.sortPredicate = () => true;\n /** Emits right before dragging has started. */\n this.beforeStarted = new Subject();\n /**\n * Emits when the user has moved a new drag item into this container.\n */\n this.entered = new Subject();\n /**\n * Emits when the user removes an item from the container\n * by dragging it into another container.\n */\n this.exited = new Subject();\n /** Emits when the user drops an item inside the container. */\n this.dropped = new Subject();\n /** Emits as the user is swapping items while actively dragging. */\n this.sorted = new Subject();\n /** Emits when a dragging sequence is started in a list connected to the current one. */\n this.receivingStarted = new Subject();\n /** Emits when a dragging sequence is stopped from a list connected to the current one. */\n this.receivingStopped = new Subject();\n /** Whether an item in the list is being dragged. */\n this._isDragging = false;\n /** Draggable items in the container. */\n this._draggables = [];\n /** Drop lists that are connected to the current one. */\n this._siblings = [];\n /** Connected siblings that currently have a dragged item. */\n this._activeSiblings = new Set();\n /** Subscription to the window being scrolled. */\n this._viewportScrollSubscription = Subscription.EMPTY;\n /** Vertical direction in which the list is currently scrolling. */\n this._verticalScrollDirection = AutoScrollVerticalDirection.NONE;\n /** Horizontal direction in which the list is currently scrolling. */\n this._horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;\n /** Used to signal to the current auto-scroll sequence when to stop. */\n this._stopScrollTimers = new Subject();\n /** Shadow root of the current element. Necessary for `elementFromPoint` to resolve correctly. */\n this._cachedShadowRoot = null;\n /** Elements that can be scrolled while the user is dragging. */\n this._scrollableElements = [];\n /** Direction of the list's layout. */\n this._direction = 'ltr';\n /** Starts the interval that'll auto-scroll the element. */\n this._startScrollInterval = () => {\n this._stopScrolling();\n interval(0, animationFrameScheduler)\n .pipe(takeUntil(this._stopScrollTimers))\n .subscribe(() => {\n const node = this._scrollNode;\n const scrollStep = this.autoScrollStep;\n if (this._verticalScrollDirection === AutoScrollVerticalDirection.UP) {\n node.scrollBy(0, -scrollStep);\n }\n else if (this._verticalScrollDirection === AutoScrollVerticalDirection.DOWN) {\n node.scrollBy(0, scrollStep);\n }\n if (this._horizontalScrollDirection === AutoScrollHorizontalDirection.LEFT) {\n node.scrollBy(-scrollStep, 0);\n }\n else if (this._horizontalScrollDirection === AutoScrollHorizontalDirection.RIGHT) {\n node.scrollBy(scrollStep, 0);\n }\n });\n };\n const coercedElement = (this.element = coerceElement(element));\n this._document = _document;\n this.withOrientation('vertical').withElementContainer(coercedElement);\n _dragDropRegistry.registerDropContainer(this);\n this._parentPositions = new ParentPositionTracker(_document);\n }\n /** Removes the drop list functionality from the DOM element. */\n dispose() {\n this._stopScrolling();\n this._stopScrollTimers.complete();\n this._viewportScrollSubscription.unsubscribe();\n this.beforeStarted.complete();\n this.entered.complete();\n this.exited.complete();\n this.dropped.complete();\n this.sorted.complete();\n this.receivingStarted.complete();\n this.receivingStopped.complete();\n this._activeSiblings.clear();\n this._scrollNode = null;\n this._parentPositions.clear();\n this._dragDropRegistry.removeDropContainer(this);\n }\n /** Whether an item from this list is currently being dragged. */\n isDragging() {\n return this._isDragging;\n }\n /** Starts dragging an item. */\n start() {\n this._draggingStarted();\n this._notifyReceivingSiblings();\n }\n /**\n * Attempts to move an item into the container.\n * @param item Item that was moved into the container.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param index Index at which the item entered. If omitted, the container will try to figure it\n * out automatically.\n */\n enter(item, pointerX, pointerY, index) {\n this._draggingStarted();\n // If sorting is disabled, we want the item to return to its starting\n // position if the user is returning it to its initial container.\n if (index == null && this.sortingDisabled) {\n index = this._draggables.indexOf(item);\n }\n this._sortStrategy.enter(item, pointerX, pointerY, index);\n // Note that this usually happens inside `_draggingStarted` as well, but the dimensions\n // can change when the sort strategy moves the item around inside `enter`.\n this._cacheParentPositions();\n // Notify siblings at the end so that the item has been inserted into the `activeDraggables`.\n this._notifyReceivingSiblings();\n this.entered.next({ item, container: this, currentIndex: this.getItemIndex(item) });\n }\n /**\n * Removes an item from the container after it was dragged into another container by the user.\n * @param item Item that was dragged out.\n */\n exit(item) {\n this._reset();\n this.exited.next({ item, container: this });\n }\n /**\n * Drops an item into this container.\n * @param item Item being dropped into the container.\n * @param currentIndex Index at which the item should be inserted.\n * @param previousIndex Index of the item when dragging started.\n * @param previousContainer Container from which the item got dragged in.\n * @param isPointerOverContainer Whether the user's pointer was over the\n * container when the item was dropped.\n * @param distance Distance the user has dragged since the start of the dragging sequence.\n * @param event Event that triggered the dropping sequence.\n *\n * @breaking-change 15.0.0 `previousIndex` and `event` parameters to become required.\n */\n drop(item, currentIndex, previousIndex, previousContainer, isPointerOverContainer, distance, dropPoint, event = {}) {\n this._reset();\n this.dropped.next({\n item,\n currentIndex,\n previousIndex,\n container: this,\n previousContainer,\n isPointerOverContainer,\n distance,\n dropPoint,\n event,\n });\n }\n /**\n * Sets the draggable items that are a part of this list.\n * @param items Items that are a part of this list.\n */\n withItems(items) {\n const previousItems = this._draggables;\n this._draggables = items;\n items.forEach(item => item._withDropContainer(this));\n if (this.isDragging()) {\n const draggedItems = previousItems.filter(item => item.isDragging());\n // If all of the items being dragged were removed\n // from the list, abort the current drag sequence.\n if (draggedItems.every(item => items.indexOf(item) === -1)) {\n this._reset();\n }\n else {\n this._sortStrategy.withItems(this._draggables);\n }\n }\n return this;\n }\n /** Sets the layout direction of the drop list. */\n withDirection(direction) {\n this._direction = direction;\n if (this._sortStrategy instanceof SingleAxisSortStrategy) {\n this._sortStrategy.direction = direction;\n }\n return this;\n }\n /**\n * Sets the containers that are connected to this one. When two or more containers are\n * connected, the user will be allowed to transfer items between them.\n * @param connectedTo Other containers that the current containers should be connected to.\n */\n connectedTo(connectedTo) {\n this._siblings = connectedTo.slice();\n return this;\n }\n /**\n * Sets the orientation of the container.\n * @param orientation New orientation for the container.\n */\n withOrientation(orientation) {\n if (orientation === 'mixed') {\n this._sortStrategy = new MixedSortStrategy(this._document, this._dragDropRegistry);\n }\n else {\n const strategy = new SingleAxisSortStrategy(this._dragDropRegistry);\n strategy.direction = this._direction;\n strategy.orientation = orientation;\n this._sortStrategy = strategy;\n }\n this._sortStrategy.withElementContainer(this._container);\n this._sortStrategy.withSortPredicate((index, item) => this.sortPredicate(index, item, this));\n return this;\n }\n /**\n * Sets which parent elements are can be scrolled while the user is dragging.\n * @param elements Elements that can be scrolled.\n */\n withScrollableParents(elements) {\n const element = this._container;\n // We always allow the current element to be scrollable\n // so we need to ensure that it's in the array.\n this._scrollableElements =\n elements.indexOf(element) === -1 ? [element, ...elements] : elements.slice();\n return this;\n }\n /**\n * Configures the drop list so that a different element is used as the container for the\n * dragged items. This is useful for the cases when one might not have control over the\n * full DOM that sets up the dragging.\n * Note that the alternate container needs to be a descendant of the drop list.\n * @param container New element container to be assigned.\n */\n withElementContainer(container) {\n if (container === this._container) {\n return this;\n }\n const element = coerceElement(this.element);\n if ((typeof ngDevMode === 'undefined' || ngDevMode) &&\n container !== element &&\n !element.contains(container)) {\n throw new Error('Invalid DOM structure for drop list. Alternate container element must be a descendant of the drop list.');\n }\n const oldContainerIndex = this._scrollableElements.indexOf(this._container);\n const newContainerIndex = this._scrollableElements.indexOf(container);\n if (oldContainerIndex > -1) {\n this._scrollableElements.splice(oldContainerIndex, 1);\n }\n if (newContainerIndex > -1) {\n this._scrollableElements.splice(newContainerIndex, 1);\n }\n if (this._sortStrategy) {\n this._sortStrategy.withElementContainer(container);\n }\n this._cachedShadowRoot = null;\n this._scrollableElements.unshift(container);\n this._container = container;\n return this;\n }\n /** Gets the scrollable parents that are registered with this drop container. */\n getScrollableParents() {\n return this._scrollableElements;\n }\n /**\n * Figures out the index of an item in the container.\n * @param item Item whose index should be determined.\n */\n getItemIndex(item) {\n return this._isDragging\n ? this._sortStrategy.getItemIndex(item)\n : this._draggables.indexOf(item);\n }\n /**\n * Whether the list is able to receive the item that\n * is currently being dragged inside a connected drop list.\n */\n isReceiving() {\n return this._activeSiblings.size > 0;\n }\n /**\n * Sorts an item inside the container based on its position.\n * @param item Item to be sorted.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param pointerDelta Direction in which the pointer is moving along each axis.\n */\n _sortItem(item, pointerX, pointerY, pointerDelta) {\n // Don't sort the item if sorting is disabled or it's out of range.\n if (this.sortingDisabled ||\n !this._domRect ||\n !isPointerNearDomRect(this._domRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)) {\n return;\n }\n const result = this._sortStrategy.sort(item, pointerX, pointerY, pointerDelta);\n if (result) {\n this.sorted.next({\n previousIndex: result.previousIndex,\n currentIndex: result.currentIndex,\n container: this,\n item,\n });\n }\n }\n /**\n * Checks whether the user's pointer is close to the edges of either the\n * viewport or the drop list and starts the auto-scroll sequence.\n * @param pointerX User's pointer position along the x axis.\n * @param pointerY User's pointer position along the y axis.\n */\n _startScrollingIfNecessary(pointerX, pointerY) {\n if (this.autoScrollDisabled) {\n return;\n }\n let scrollNode;\n let verticalScrollDirection = AutoScrollVerticalDirection.NONE;\n let horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;\n // Check whether we should start scrolling any of the parent containers.\n this._parentPositions.positions.forEach((position, element) => {\n // We have special handling for the `document` below. Also this would be\n // nicer with a for...of loop, but it requires changing a compiler flag.\n if (element === this._document || !position.clientRect || scrollNode) {\n return;\n }\n if (isPointerNearDomRect(position.clientRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)) {\n [verticalScrollDirection, horizontalScrollDirection] = getElementScrollDirections(element, position.clientRect, this._direction, pointerX, pointerY);\n if (verticalScrollDirection || horizontalScrollDirection) {\n scrollNode = element;\n }\n }\n });\n // Otherwise check if we can start scrolling the viewport.\n if (!verticalScrollDirection && !horizontalScrollDirection) {\n const { width, height } = this._viewportRuler.getViewportSize();\n const domRect = {\n width,\n height,\n top: 0,\n right: width,\n bottom: height,\n left: 0,\n };\n verticalScrollDirection = getVerticalScrollDirection(domRect, pointerY);\n horizontalScrollDirection = getHorizontalScrollDirection(domRect, pointerX);\n scrollNode = window;\n }\n if (scrollNode &&\n (verticalScrollDirection !== this._verticalScrollDirection ||\n horizontalScrollDirection !== this._horizontalScrollDirection ||\n scrollNode !== this._scrollNode)) {\n this._verticalScrollDirection = verticalScrollDirection;\n this._horizontalScrollDirection = horizontalScrollDirection;\n this._scrollNode = scrollNode;\n if ((verticalScrollDirection || horizontalScrollDirection) && scrollNode) {\n this._ngZone.runOutsideAngular(this._startScrollInterval);\n }\n else {\n this._stopScrolling();\n }\n }\n }\n /** Stops any currently-running auto-scroll sequences. */\n _stopScrolling() {\n this._stopScrollTimers.next();\n }\n /** Starts the dragging sequence within the list. */\n _draggingStarted() {\n const styles = this._container.style;\n this.beforeStarted.next();\n this._isDragging = true;\n if ((typeof ngDevMode === 'undefined' || ngDevMode) &&\n // Prevent the check from running on apps not using an alternate container. Ideally we\n // would always run it, but introducing it at this stage would be a breaking change.\n this._container !== coerceElement(this.element)) {\n for (const drag of this._draggables) {\n if (!drag.isDragging() && drag.getVisibleElement().parentNode !== this._container) {\n throw new Error('Invalid DOM structure for drop list. All items must be placed directly inside of the element container.');\n }\n }\n }\n // We need to disable scroll snapping while the user is dragging, because it breaks automatic\n // scrolling. The browser seems to round the value based on the snapping points which means\n // that we can't increment/decrement the scroll position.\n this._initialScrollSnap = styles.msScrollSnapType || styles.scrollSnapType || '';\n styles.scrollSnapType = styles.msScrollSnapType = 'none';\n this._sortStrategy.start(this._draggables);\n this._cacheParentPositions();\n this._viewportScrollSubscription.unsubscribe();\n this._listenToScrollEvents();\n }\n /** Caches the positions of the configured scrollable parents. */\n _cacheParentPositions() {\n this._parentPositions.cache(this._scrollableElements);\n // The list element is always in the `scrollableElements`\n // so we can take advantage of the cached `DOMRect`.\n this._domRect = this._parentPositions.positions.get(this._container).clientRect;\n }\n /** Resets the container to its initial state. */\n _reset() {\n this._isDragging = false;\n const styles = this._container.style;\n styles.scrollSnapType = styles.msScrollSnapType = this._initialScrollSnap;\n this._siblings.forEach(sibling => sibling._stopReceiving(this));\n this._sortStrategy.reset();\n this._stopScrolling();\n this._viewportScrollSubscription.unsubscribe();\n this._parentPositions.clear();\n }\n /**\n * Checks whether the user's pointer is positioned over the container.\n * @param x Pointer position along the X axis.\n * @param y Pointer position along the Y axis.\n */\n _isOverContainer(x, y) {\n return this._domRect != null && isInsideClientRect(this._domRect, x, y);\n }\n /**\n * Figures out whether an item should be moved into a sibling\n * drop container, based on its current position.\n * @param item Drag item that is being moved.\n * @param x Position of the item along the X axis.\n * @param y Position of the item along the Y axis.\n */\n _getSiblingContainerFromPosition(item, x, y) {\n return this._siblings.find(sibling => sibling._canReceive(item, x, y));\n }\n /**\n * Checks whether the drop list can receive the passed-in item.\n * @param item Item that is being dragged into the list.\n * @param x Position of the item along the X axis.\n * @param y Position of the item along the Y axis.\n */\n _canReceive(item, x, y) {\n if (!this._domRect ||\n !isInsideClientRect(this._domRect, x, y) ||\n !this.enterPredicate(item, this)) {\n return false;\n }\n const elementFromPoint = this._getShadowRoot().elementFromPoint(x, y);\n // If there's no element at the pointer position, then\n // the client rect is probably scrolled out of the view.\n if (!elementFromPoint) {\n return false;\n }\n // The `DOMRect`, that we're using to find the container over which the user is\n // hovering, doesn't give us any information on whether the element has been scrolled\n // out of the view or whether it's overlapping with other containers. This means that\n // we could end up transferring the item into a container that's invisible or is positioned\n // below another one. We use the result from `elementFromPoint` to get the top-most element\n // at the pointer position and to find whether it's one of the intersecting drop containers.\n return elementFromPoint === this._container || this._container.contains(elementFromPoint);\n }\n /**\n * Called by one of the connected drop lists when a dragging sequence has started.\n * @param sibling Sibling in which dragging has started.\n */\n _startReceiving(sibling, items) {\n const activeSiblings = this._activeSiblings;\n if (!activeSiblings.has(sibling) &&\n items.every(item => {\n // Note that we have to add an exception to the `enterPredicate` for items that started off\n // in this drop list. The drag ref has logic that allows an item to return to its initial\n // container, if it has left the initial container and none of the connected containers\n // allow it to enter. See `DragRef._updateActiveDropContainer` for more context.\n return this.enterPredicate(item, this) || this._draggables.indexOf(item) > -1;\n })) {\n activeSiblings.add(sibling);\n this._cacheParentPositions();\n this._listenToScrollEvents();\n this.receivingStarted.next({\n initiator: sibling,\n receiver: this,\n items,\n });\n }\n }\n /**\n * Called by a connected drop list when dragging has stopped.\n * @param sibling Sibling whose dragging has stopped.\n */\n _stopReceiving(sibling) {\n this._activeSiblings.delete(sibling);\n this._viewportScrollSubscription.unsubscribe();\n this.receivingStopped.next({ initiator: sibling, receiver: this });\n }\n /**\n * Starts listening to scroll events on the viewport.\n * Used for updating the internal state of the list.\n */\n _listenToScrollEvents() {\n this._viewportScrollSubscription = this._dragDropRegistry\n .scrolled(this._getShadowRoot())\n .subscribe(event => {\n if (this.isDragging()) {\n const scrollDifference = this._parentPositions.handleScroll(event);\n if (scrollDifference) {\n this._sortStrategy.updateOnScroll(scrollDifference.top, scrollDifference.left);\n }\n }\n else if (this.isReceiving()) {\n this._cacheParentPositions();\n }\n });\n }\n /**\n * Lazily resolves and returns the shadow root of the element. We do this in a function, rather\n * than saving it in property directly on init, because we want to resolve it as late as possible\n * in order to ensure that the element has been moved into the shadow DOM. Doing it inside the\n * constructor might be too early if the element is inside of something like `ngFor` or `ngIf`.\n */\n _getShadowRoot() {\n if (!this._cachedShadowRoot) {\n const shadowRoot = _getShadowRoot(this._container);\n this._cachedShadowRoot = shadowRoot || this._document;\n }\n return this._cachedShadowRoot;\n }\n /** Notifies any siblings that may potentially receive the item. */\n _notifyReceivingSiblings() {\n const draggedItems = this._sortStrategy\n .getActiveItemsSnapshot()\n .filter(item => item.isDragging());\n this._siblings.forEach(sibling => sibling._startReceiving(this, draggedItems));\n }\n}\n/**\n * Gets whether the vertical auto-scroll direction of a node.\n * @param clientRect Dimensions of the node.\n * @param pointerY Position of the user's pointer along the y axis.\n */\nfunction getVerticalScrollDirection(clientRect, pointerY) {\n const { top, bottom, height } = clientRect;\n const yThreshold = height * SCROLL_PROXIMITY_THRESHOLD;\n if (pointerY >= top - yThreshold && pointerY <= top + yThreshold) {\n return AutoScrollVerticalDirection.UP;\n }\n else if (pointerY >= bottom - yThreshold && pointerY <= bottom + yThreshold) {\n return AutoScrollVerticalDirection.DOWN;\n }\n return AutoScrollVerticalDirection.NONE;\n}\n/**\n * Gets whether the horizontal auto-scroll direction of a node.\n * @param clientRect Dimensions of the node.\n * @param pointerX Position of the user's pointer along the x axis.\n */\nfunction getHorizontalScrollDirection(clientRect, pointerX) {\n const { left, right, width } = clientRect;\n const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;\n if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) {\n return AutoScrollHorizontalDirection.LEFT;\n }\n else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) {\n return AutoScrollHorizontalDirection.RIGHT;\n }\n return AutoScrollHorizontalDirection.NONE;\n}\n/**\n * Gets the directions in which an element node should be scrolled,\n * assuming that the user's pointer is already within it scrollable region.\n * @param element Element for which we should calculate the scroll direction.\n * @param clientRect Bounding client rectangle of the element.\n * @param direction Layout direction of the drop list.\n * @param pointerX Position of the user's pointer along the x axis.\n * @param pointerY Position of the user's pointer along the y axis.\n */\nfunction getElementScrollDirections(element, clientRect, direction, pointerX, pointerY) {\n const computedVertical = getVerticalScrollDirection(clientRect, pointerY);\n const computedHorizontal = getHorizontalScrollDirection(clientRect, pointerX);\n let verticalScrollDirection = AutoScrollVerticalDirection.NONE;\n let horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;\n // Note that we here we do some extra checks for whether the element is actually scrollable in\n // a certain direction and we only assign the scroll direction if it is. We do this so that we\n // can allow other elements to be scrolled, if the current element can't be scrolled anymore.\n // This allows us to handle cases where the scroll regions of two scrollable elements overlap.\n if (computedVertical) {\n const scrollTop = element.scrollTop;\n if (computedVertical === AutoScrollVerticalDirection.UP) {\n if (scrollTop > 0) {\n verticalScrollDirection = AutoScrollVerticalDirection.UP;\n }\n }\n else if (element.scrollHeight - scrollTop > element.clientHeight) {\n verticalScrollDirection = AutoScrollVerticalDirection.DOWN;\n }\n }\n if (computedHorizontal) {\n const scrollLeft = element.scrollLeft;\n if (direction === 'rtl') {\n if (computedHorizontal === AutoScrollHorizontalDirection.RIGHT) {\n // In RTL `scrollLeft` will be negative when scrolled.\n if (scrollLeft < 0) {\n horizontalScrollDirection = AutoScrollHorizontalDirection.RIGHT;\n }\n }\n else if (element.scrollWidth + scrollLeft > element.clientWidth) {\n horizontalScrollDirection = AutoScrollHorizontalDirection.LEFT;\n }\n }\n else {\n if (computedHorizontal === AutoScrollHorizontalDirection.LEFT) {\n if (scrollLeft > 0) {\n horizontalScrollDirection = AutoScrollHorizontalDirection.LEFT;\n }\n }\n else if (element.scrollWidth - scrollLeft > element.clientWidth) {\n horizontalScrollDirection = AutoScrollHorizontalDirection.RIGHT;\n }\n }\n }\n return [verticalScrollDirection, horizontalScrollDirection];\n}\n\n/** Event options that can be used to bind an active, capturing event. */\nconst activeCapturingEventOptions = normalizePassiveListenerOptions({\n passive: false,\n capture: true,\n});\n/** Keeps track of the apps currently containing drag items. */\nconst activeApps = new Set();\n/**\n * Component used to load the drag&drop reset styles.\n * @docs-private\n */\nclass _ResetsLoader {\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: _ResetsLoader, deps: [], target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"18.2.0-next.2\", type: _ResetsLoader, isStandalone: true, selector: \"ng-component\", host: { attributes: { \"cdk-drag-resets-container\": \"\" } }, ngImport: i0, template: '', isInline: true, styles: [\"@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit;inset:auto}}.cdk-drag-placeholder *,.cdk-drag-preview *{pointer-events:none !important}\"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: _ResetsLoader, decorators: [{\n type: Component,\n args: [{ standalone: true, encapsulation: ViewEncapsulation.None, template: '', changeDetection: ChangeDetectionStrategy.OnPush, host: { 'cdk-drag-resets-container': '' }, styles: [\"@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit;inset:auto}}.cdk-drag-placeholder *,.cdk-drag-preview *{pointer-events:none !important}\"] }]\n }] });\n// TODO(crisbeto): remove generics when making breaking changes.\n/**\n * Service that keeps track of all the drag item and drop container\n * instances, and manages global event listeners on the `document`.\n * @docs-private\n */\nclass DragDropRegistry {\n constructor(_ngZone, _document) {\n this._ngZone = _ngZone;\n this._appRef = inject(ApplicationRef);\n this._environmentInjector = inject(EnvironmentInjector);\n /** Registered drop container instances. */\n this._dropInstances = new Set();\n /** Registered drag item instances. */\n this._dragInstances = new Set();\n /** Drag item instances that are currently being dragged. */\n this._activeDragInstances = signal([]);\n /** Keeps track of the event listeners that we've bound to the `document`. */\n this._globalListeners = new Map();\n /**\n * Predicate function to check if an item is being dragged. Moved out into a property,\n * because it'll be called a lot and we don't want to create a new function every time.\n */\n this._draggingPredicate = (item) => item.isDragging();\n /**\n * Emits the `touchmove` or `mousemove` events that are dispatched\n * while the user is dragging a drag item instance.\n */\n this.pointerMove = new Subject();\n /**\n * Emits the `touchend` or `mouseup` events that are dispatched\n * while the user is dragging a drag item instance.\n */\n this.pointerUp = new Subject();\n /**\n * Emits when the viewport has been scrolled while the user is dragging an item.\n * @deprecated To be turned into a private member. Use the `scrolled` method instead.\n * @breaking-change 13.0.0\n */\n this.scroll = new Subject();\n /**\n * Event listener that will prevent the default browser action while the user is dragging.\n * @param event Event whose default action should be prevented.\n */\n this._preventDefaultWhileDragging = (event) => {\n if (this._activeDragInstances().length > 0) {\n event.preventDefault();\n }\n };\n /** Event listener for `touchmove` that is bound even if no dragging is happening. */\n this._persistentTouchmoveListener = (event) => {\n if (this._activeDragInstances().length > 0) {\n // Note that we only want to prevent the default action after dragging has actually started.\n // Usually this is the same time at which the item is added to the `_activeDragInstances`,\n // but it could be pushed back if the user has set up a drag delay or threshold.\n if (this._activeDragInstances().some(this._draggingPredicate)) {\n event.preventDefault();\n }\n this.pointerMove.next(event);\n }\n };\n this._document = _document;\n }\n /** Adds a drop container to the registry. */\n registerDropContainer(drop) {\n if (!this._dropInstances.has(drop)) {\n this._dropInstances.add(drop);\n }\n }\n /** Adds a drag item instance to the registry. */\n registerDragItem(drag) {\n this._dragInstances.add(drag);\n // The `touchmove` event gets bound once, ahead of time, because WebKit\n // won't preventDefault on a dynamically-added `touchmove` listener.\n // See https://bugs.webkit.org/show_bug.cgi?id=184250.\n if (this._dragInstances.size === 1) {\n this._ngZone.runOutsideAngular(() => {\n // The event handler has to be explicitly active,\n // because newer browsers make it passive by default.\n this._document.addEventListener('touchmove', this._persistentTouchmoveListener, activeCapturingEventOptions);\n });\n }\n }\n /** Removes a drop container from the registry. */\n removeDropContainer(drop) {\n this._dropInstances.delete(drop);\n }\n /** Removes a drag item instance from the registry. */\n removeDragItem(drag) {\n this._dragInstances.delete(drag);\n this.stopDragging(drag);\n if (this._dragInstances.size === 0) {\n this._document.removeEventListener('touchmove', this._persistentTouchmoveListener, activeCapturingEventOptions);\n }\n }\n /**\n * Starts the dragging sequence for a drag instance.\n * @param drag Drag instance which is being dragged.\n * @param event Event that initiated the dragging.\n */\n startDragging(drag, event) {\n // Do not process the same drag twice to avoid memory leaks and redundant listeners\n if (this._activeDragInstances().indexOf(drag) > -1) {\n return;\n }\n this._loadResets();\n this._activeDragInstances.update(instances => [...instances, drag]);\n if (this._activeDragInstances().length === 1) {\n const isTouchEvent = event.type.startsWith('touch');\n // We explicitly bind __active__ listeners here, because newer browsers will default to\n // passive ones for `mousemove` and `touchmove`. The events need to be active, because we\n // use `preventDefault` to prevent the page from scrolling while the user is dragging.\n this._globalListeners\n .set(isTouchEvent ? 'touchend' : 'mouseup', {\n handler: (e) => this.pointerUp.next(e),\n options: true,\n })\n .set('scroll', {\n handler: (e) => this.scroll.next(e),\n // Use capturing so that we pick up scroll changes in any scrollable nodes that aren't\n // the document. See https://github.com/angular/components/issues/17144.\n options: true,\n })\n // Preventing the default action on `mousemove` isn't enough to disable text selection\n // on Safari so we need to prevent the selection event as well. Alternatively this can\n // be done by setting `user-select: none` on the `body`, however it has causes a style\n // recalculation which can be expensive on pages with a lot of elements.\n .set('selectstart', {\n handler: this._preventDefaultWhileDragging,\n options: activeCapturingEventOptions,\n });\n // We don't have to bind a move event for touch drag sequences, because\n // we already have a persistent global one bound from `registerDragItem`.\n if (!isTouchEvent) {\n this._globalListeners.set('mousemove', {\n handler: (e) => this.pointerMove.next(e),\n options: activeCapturingEventOptions,\n });\n }\n this._ngZone.runOutsideAngular(() => {\n this._globalListeners.forEach((config, name) => {\n this._document.addEventListener(name, config.handler, config.options);\n });\n });\n }\n }\n /** Stops dragging a drag item instance. */\n stopDragging(drag) {\n this._activeDragInstances.update(instances => {\n const index = instances.indexOf(drag);\n if (index > -1) {\n instances.splice(index, 1);\n return [...instances];\n }\n return instances;\n });\n if (this._activeDragInstances().length === 0) {\n this._clearGlobalListeners();\n }\n }\n /** Gets whether a drag item instance is currently being dragged. */\n isDragging(drag) {\n return this._activeDragInstances().indexOf(drag) > -1;\n }\n /**\n * Gets a stream that will emit when any element on the page is scrolled while an item is being\n * dragged.\n * @param shadowRoot Optional shadow root that the current dragging sequence started from.\n * Top-level listeners won't pick up events coming from the shadow DOM so this parameter can\n * be used to include an additional top-level listener at the shadow root level.\n */\n scrolled(shadowRoot) {\n const streams = [this.scroll];\n if (shadowRoot && shadowRoot !== this._document) {\n // Note that this is basically the same as `fromEvent` from rxjs, but we do it ourselves,\n // because we want to guarantee that the event is bound outside of the `NgZone`. With\n // `fromEvent` it'll only happen if the subscription is outside the `NgZone`.\n streams.push(new Observable((observer) => {\n return this._ngZone.runOutsideAngular(() => {\n const eventOptions = true;\n const callback = (event) => {\n if (this._activeDragInstances().length) {\n observer.next(event);\n }\n };\n shadowRoot.addEventListener('scroll', callback, eventOptions);\n return () => {\n shadowRoot.removeEventListener('scroll', callback, eventOptions);\n };\n });\n }));\n }\n return merge(...streams);\n }\n ngOnDestroy() {\n this._dragInstances.forEach(instance => this.removeDragItem(instance));\n this._dropInstances.forEach(instance => this.removeDropContainer(instance));\n this._clearGlobalListeners();\n this.pointerMove.complete();\n this.pointerUp.complete();\n }\n /** Clears out the global event listeners from the `document`. */\n _clearGlobalListeners() {\n this._globalListeners.forEach((config, name) => {\n this._document.removeEventListener(name, config.handler, config.options);\n });\n this._globalListeners.clear();\n }\n // TODO(crisbeto): abstract this away into something reusable.\n /** Loads the CSS resets needed for the module to work correctly. */\n _loadResets() {\n if (!activeApps.has(this._appRef)) {\n activeApps.add(this._appRef);\n const componentRef = createComponent(_ResetsLoader, {\n environmentInjector: this._environmentInjector,\n });\n this._appRef.onDestroy(() => {\n activeApps.delete(this._appRef);\n if (activeApps.size === 0) {\n componentRef.destroy();\n }\n });\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: DragDropRegistry, deps: [{ token: i0.NgZone }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: DragDropRegistry, providedIn: 'root' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: DragDropRegistry, decorators: [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], ctorParameters: () => [{ type: i0.NgZone }, { type: undefined, decorators: [{\n type: Inject,\n args: [DOCUMENT]\n }] }] });\n\n/** Default configuration to be used when creating a `DragRef`. */\nconst DEFAULT_CONFIG = {\n dragStartThreshold: 5,\n pointerDirectionChangeThreshold: 5,\n};\n/**\n * Service that allows for drag-and-drop functionality to be attached to DOM elements.\n */\nclass DragDrop {\n constructor(_document, _ngZone, _viewportRuler, _dragDropRegistry) {\n this._document = _document;\n this._ngZone = _ngZone;\n this._viewportRuler = _viewportRuler;\n this._dragDropRegistry = _dragDropRegistry;\n }\n /**\n * Turns an element into a draggable item.\n * @param element Element to which to attach the dragging functionality.\n * @param config Object used to configure the dragging behavior.\n */\n createDrag(element, config = DEFAULT_CONFIG) {\n return new DragRef(element, config, this._document, this._ngZone, this._viewportRuler, this._dragDropRegistry);\n }\n /**\n * Turns an element into a drop list.\n * @param element Element to which to attach the drop list functionality.\n */\n createDropList(element) {\n return new DropListRef(element, this._dragDropRegistry, this._document, this._ngZone, this._viewportRuler);\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: DragDrop, deps: [{ token: DOCUMENT }, { token: i0.NgZone }, { token: i1.ViewportRuler }, { token: DragDropRegistry }], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: DragDrop, providedIn: 'root' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: DragDrop, decorators: [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], ctorParameters: () => [{ type: undefined, decorators: [{\n type: Inject,\n args: [DOCUMENT]\n }] }, { type: i0.NgZone }, { type: i1.ViewportRuler }, { type: DragDropRegistry }] });\n\n/**\n * Injection token that can be used for a `CdkDrag` to provide itself as a parent to the\n * drag-specific child directive (`CdkDragHandle`, `CdkDragPreview` etc.). Used primarily\n * to avoid circular imports.\n * @docs-private\n */\nconst CDK_DRAG_PARENT = new InjectionToken('CDK_DRAG_PARENT');\n\n/**\n * Asserts that a particular node is an element.\n * @param node Node to be checked.\n * @param name Name to attach to the error message.\n */\nfunction assertElementNode(node, name) {\n if (node.nodeType !== 1) {\n throw Error(`${name} must be attached to an element node. ` + `Currently attached to \"${node.nodeName}\".`);\n }\n}\n\n/**\n * Injection token that can be used to reference instances of `CdkDragHandle`. It serves as\n * alternative token to the actual `CdkDragHandle` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\nconst CDK_DRAG_HANDLE = new InjectionToken('CdkDragHandle');\n/** Handle that can be used to drag a CdkDrag instance. */\nclass CdkDragHandle {\n /** Whether starting to drag through this handle is disabled. */\n get disabled() {\n return this._disabled;\n }\n set disabled(value) {\n this._disabled = value;\n this._stateChanges.next(this);\n }\n constructor(element, _parentDrag) {\n this.element = element;\n this._parentDrag = _parentDrag;\n /** Emits when the state of the handle has changed. */\n this._stateChanges = new Subject();\n this._disabled = false;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n assertElementNode(element.nativeElement, 'cdkDragHandle');\n }\n _parentDrag?._addHandle(this);\n }\n ngOnDestroy() {\n this._parentDrag?._removeHandle(this);\n this._stateChanges.complete();\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: CdkDragHandle, deps: [{ token: i0.ElementRef }, { token: CDK_DRAG_PARENT, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"16.1.0\", version: \"18.2.0-next.2\", type: CdkDragHandle, isStandalone: true, selector: \"[cdkDragHandle]\", inputs: { disabled: [\"cdkDragHandleDisabled\", \"disabled\", booleanAttribute] }, host: { classAttribute: \"cdk-drag-handle\" }, providers: [{ provide: CDK_DRAG_HANDLE, useExisting: CdkDragHandle }], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: CdkDragHandle, decorators: [{\n type: Directive,\n args: [{\n selector: '[cdkDragHandle]',\n standalone: true,\n host: {\n 'class': 'cdk-drag-handle',\n },\n providers: [{ provide: CDK_DRAG_HANDLE, useExisting: CdkDragHandle }],\n }]\n }], ctorParameters: () => [{ type: i0.ElementRef }, { type: undefined, decorators: [{\n type: Inject,\n args: [CDK_DRAG_PARENT]\n }, {\n type: Optional\n }, {\n type: SkipSelf\n }] }], propDecorators: { disabled: [{\n type: Input,\n args: [{ alias: 'cdkDragHandleDisabled', transform: booleanAttribute }]\n }] } });\n\n/**\n * Injection token that can be used to configure the\n * behavior of the drag&drop-related components.\n */\nconst CDK_DRAG_CONFIG = new InjectionToken('CDK_DRAG_CONFIG');\n\nconst DRAG_HOST_CLASS = 'cdk-drag';\n/**\n * Injection token that can be used to reference instances of `CdkDropList`. It serves as\n * alternative token to the actual `CdkDropList` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\nconst CDK_DROP_LIST = new InjectionToken('CdkDropList');\n/** Element that can be moved inside a CdkDropList container. */\nclass CdkDrag {\n static { this._dragInstances = []; }\n /** Whether starting to drag this element is disabled. */\n get disabled() {\n return this._disabled || (this.dropContainer && this.dropContainer.disabled);\n }\n set disabled(value) {\n this._disabled = value;\n this._dragRef.disabled = this._disabled;\n }\n constructor(\n /** Element that the draggable is attached to. */\n element, \n /** Droppable container that the draggable is a part of. */\n dropContainer, \n /**\n * @deprecated `_document` parameter no longer being used and will be removed.\n * @breaking-change 12.0.0\n */\n _document, _ngZone, _viewContainerRef, config, _dir, dragDrop, _changeDetectorRef, _selfHandle, _parentDrag) {\n this.element = element;\n this.dropContainer = dropContainer;\n this._ngZone = _ngZone;\n this._viewContainerRef = _viewContainerRef;\n this._dir = _dir;\n this._changeDetectorRef = _changeDetectorRef;\n this._selfHandle = _selfHandle;\n this._parentDrag = _parentDrag;\n this._destroyed = new Subject();\n this._handles = new BehaviorSubject([]);\n /**\n * If the parent of the dragged element has a `scale` transform, it can throw off the\n * positioning when the user starts dragging. Use this input to notify the CDK of the scale.\n */\n this.scale = 1;\n /** Emits when the user starts dragging the item. */\n this.started = new EventEmitter();\n /** Emits when the user has released a drag item, before any animations have started. */\n this.released = new EventEmitter();\n /** Emits when the user stops dragging an item in the container. */\n this.ended = new EventEmitter();\n /** Emits when the user has moved the item into a new container. */\n this.entered = new EventEmitter();\n /** Emits when the user removes the item its container by dragging it into another container. */\n this.exited = new EventEmitter();\n /** Emits when the user drops the item inside a container. */\n this.dropped = new EventEmitter();\n /**\n * Emits as the user is dragging the item. Use with caution,\n * because this event will fire for every pixel that the user has dragged.\n */\n this.moved = new Observable((observer) => {\n const subscription = this._dragRef.moved\n .pipe(map(movedEvent => ({\n source: this,\n pointerPosition: movedEvent.pointerPosition,\n event: movedEvent.event,\n delta: movedEvent.delta,\n distance: movedEvent.distance,\n })))\n .subscribe(observer);\n return () => {\n subscription.unsubscribe();\n };\n });\n this._injector = inject(Injector);\n this._dragRef = dragDrop.createDrag(element, {\n dragStartThreshold: config && config.dragStartThreshold != null ? config.dragStartThreshold : 5,\n pointerDirectionChangeThreshold: config && config.pointerDirectionChangeThreshold != null\n ? config.pointerDirectionChangeThreshold\n : 5,\n zIndex: config?.zIndex,\n });\n this._dragRef.data = this;\n // We have to keep track of the drag instances in order to be able to match an element to\n // a drag instance. We can't go through the global registry of `DragRef`, because the root\n // element could be different.\n CdkDrag._dragInstances.push(this);\n if (config) {\n this._assignDefaults(config);\n }\n // Note that usually the container is assigned when the drop list is picks up the item, but in\n // some cases (mainly transplanted views with OnPush, see #18341) we may end up in a situation\n // where there are no items on the first change detection pass, but the items get picked up as\n // soon as the user triggers another pass by dragging. This is a problem, because the item would\n // have to switch from standalone mode to drag mode in the middle of the dragging sequence which\n // is too late since the two modes save different kinds of information. We work around it by\n // assigning the drop container both from here and the list.\n if (dropContainer) {\n this._dragRef._withDropContainer(dropContainer._dropListRef);\n dropContainer.addItem(this);\n // The drop container reads this so we need to sync it here.\n dropContainer._dropListRef.beforeStarted.pipe(takeUntil(this._destroyed)).subscribe(() => {\n this._dragRef.scale = this.scale;\n });\n }\n this._syncInputs(this._dragRef);\n this._handleEvents(this._dragRef);\n }\n /**\n * Returns the element that is being used as a placeholder\n * while the current element is being dragged.\n */\n getPlaceholderElement() {\n return this._dragRef.getPlaceholderElement();\n }\n /** Returns the root draggable element. */\n getRootElement() {\n return this._dragRef.getRootElement();\n }\n /** Resets a standalone drag item to its initial position. */\n reset() {\n this._dragRef.reset();\n }\n /**\n * Gets the pixel coordinates of the draggable outside of a drop container.\n */\n getFreeDragPosition() {\n return this._dragRef.getFreeDragPosition();\n }\n /**\n * Sets the current position in pixels the draggable outside of a drop container.\n * @param value New position to be set.\n */\n setFreeDragPosition(value) {\n this._dragRef.setFreeDragPosition(value);\n }\n ngAfterViewInit() {\n // We need to wait until after render, in order for the reference\n // element to be in the proper place in the DOM. This is mostly relevant\n // for draggable elements inside portals since they get stamped out in\n // their original DOM position, and then they get transferred to the portal.\n afterNextRender(() => {\n this._updateRootElement();\n this._setupHandlesListener();\n this._dragRef.scale = this.scale;\n if (this.freeDragPosition) {\n this._dragRef.setFreeDragPosition(this.freeDragPosition);\n }\n }, { injector: this._injector });\n }\n ngOnChanges(changes) {\n const rootSelectorChange = changes['rootElementSelector'];\n const positionChange = changes['freeDragPosition'];\n // We don't have to react to the first change since it's being\n // handled in the `afterNextRender` queued up in the constructor.\n if (rootSelectorChange && !rootSelectorChange.firstChange) {\n this._updateRootElement();\n }\n // Scale affects the free drag position so we need to sync it up here.\n this._dragRef.scale = this.scale;\n // Skip the first change since it's being handled in the `afterNextRender` queued up in the\n // constructor.\n if (positionChange && !positionChange.firstChange && this.freeDragPosition) {\n this._dragRef.setFreeDragPosition(this.freeDragPosition);\n }\n }\n ngOnDestroy() {\n if (this.dropContainer) {\n this.dropContainer.removeItem(this);\n }\n const index = CdkDrag._dragInstances.indexOf(this);\n if (index > -1) {\n CdkDrag._dragInstances.splice(index, 1);\n }\n // Unnecessary in most cases, but used to avoid extra change detections with `zone-paths-rxjs`.\n this._ngZone.runOutsideAngular(() => {\n this._handles.complete();\n this._destroyed.next();\n this._destroyed.complete();\n this._dragRef.dispose();\n });\n }\n _addHandle(handle) {\n const handles = this._handles.getValue();\n handles.push(handle);\n this._handles.next(handles);\n }\n _removeHandle(handle) {\n const handles = this._handles.getValue();\n const index = handles.indexOf(handle);\n if (index > -1) {\n handles.splice(index, 1);\n this._handles.next(handles);\n }\n }\n _setPreviewTemplate(preview) {\n this._previewTemplate = preview;\n }\n _resetPreviewTemplate(preview) {\n if (preview === this._previewTemplate) {\n this._previewTemplate = null;\n }\n }\n _setPlaceholderTemplate(placeholder) {\n this._placeholderTemplate = placeholder;\n }\n _resetPlaceholderTemplate(placeholder) {\n if (placeholder === this._placeholderTemplate) {\n this._placeholderTemplate = null;\n }\n }\n /** Syncs the root element with the `DragRef`. */\n _updateRootElement() {\n const element = this.element.nativeElement;\n let rootElement = element;\n if (this.rootElementSelector) {\n rootElement =\n element.closest !== undefined\n ? element.closest(this.rootElementSelector)\n : // Comment tag doesn't have closest method, so use parent's one.\n element.parentElement?.closest(this.rootElementSelector);\n }\n if (rootElement && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n assertElementNode(rootElement, 'cdkDrag');\n }\n this._dragRef.withRootElement(rootElement || element);\n }\n /** Gets the boundary element, based on the `boundaryElement` value. */\n _getBoundaryElement() {\n const boundary = this.boundaryElement;\n if (!boundary) {\n return null;\n }\n if (typeof boundary === 'string') {\n return this.element.nativeElement.closest(boundary);\n }\n return coerceElement(boundary);\n }\n /** Syncs the inputs of the CdkDrag with the options of the underlying DragRef. */\n _syncInputs(ref) {\n ref.beforeStarted.subscribe(() => {\n if (!ref.isDragging()) {\n const dir = this._dir;\n const dragStartDelay = this.dragStartDelay;\n const placeholder = this._placeholderTemplate\n ? {\n template: this._placeholderTemplate.templateRef,\n context: this._placeholderTemplate.data,\n viewContainer: this._viewContainerRef,\n }\n : null;\n const preview = this._previewTemplate\n ? {\n template: this._previewTemplate.templateRef,\n context: this._previewTemplate.data,\n matchSize: this._previewTemplate.matchSize,\n viewContainer: this._viewContainerRef,\n }\n : null;\n ref.disabled = this.disabled;\n ref.lockAxis = this.lockAxis;\n ref.scale = this.scale;\n ref.dragStartDelay =\n typeof dragStartDelay === 'object' && dragStartDelay\n ? dragStartDelay\n : coerceNumberProperty(dragStartDelay);\n ref.constrainPosition = this.constrainPosition;\n ref.previewClass = this.previewClass;\n ref\n .withBoundaryElement(this._getBoundaryElement())\n .withPlaceholderTemplate(placeholder)\n .withPreviewTemplate(preview)\n .withPreviewContainer(this.previewContainer || 'global');\n if (dir) {\n ref.withDirection(dir.value);\n }\n }\n });\n // This only needs to be resolved once.\n ref.beforeStarted.pipe(take(1)).subscribe(() => {\n // If we managed to resolve a parent through DI, use it.\n if (this._parentDrag) {\n ref.withParent(this._parentDrag._dragRef);\n return;\n }\n // Otherwise fall back to resolving the parent by looking up the DOM. This can happen if\n // the item was projected into another item by something like `ngTemplateOutlet`.\n let parent = this.element.nativeElement.parentElement;\n while (parent) {\n if (parent.classList.contains(DRAG_HOST_CLASS)) {\n ref.withParent(CdkDrag._dragInstances.find(drag => {\n return drag.element.nativeElement === parent;\n })?._dragRef || null);\n break;\n }\n parent = parent.parentElement;\n }\n });\n }\n /** Handles the events from the underlying `DragRef`. */\n _handleEvents(ref) {\n ref.started.subscribe(startEvent => {\n this.started.emit({ source: this, event: startEvent.event });\n // Since all of these events run outside of change detection,\n // we need to ensure that everything is marked correctly.\n this._changeDetectorRef.markForCheck();\n });\n ref.released.subscribe(releaseEvent => {\n this.released.emit({ source: this, event: releaseEvent.event });\n });\n ref.ended.subscribe(endEvent => {\n this.ended.emit({\n source: this,\n distance: endEvent.distance,\n dropPoint: endEvent.dropPoint,\n event: endEvent.event,\n });\n // Since all of these events run outside of change detection,\n // we need to ensure that everything is marked correctly.\n this._changeDetectorRef.markForCheck();\n });\n ref.entered.subscribe(enterEvent => {\n this.entered.emit({\n container: enterEvent.container.data,\n item: this,\n currentIndex: enterEvent.currentIndex,\n });\n });\n ref.exited.subscribe(exitEvent => {\n this.exited.emit({\n container: exitEvent.container.data,\n item: this,\n });\n });\n ref.dropped.subscribe(dropEvent => {\n this.dropped.emit({\n previousIndex: dropEvent.previousIndex,\n currentIndex: dropEvent.currentIndex,\n previousContainer: dropEvent.previousContainer.data,\n container: dropEvent.container.data,\n isPointerOverContainer: dropEvent.isPointerOverContainer,\n item: this,\n distance: dropEvent.distance,\n dropPoint: dropEvent.dropPoint,\n event: dropEvent.event,\n });\n });\n }\n /** Assigns the default input values based on a provided config object. */\n _assignDefaults(config) {\n const { lockAxis, dragStartDelay, constrainPosition, previewClass, boundaryElement, draggingDisabled, rootElementSelector, previewContainer, } = config;\n this.disabled = draggingDisabled == null ? false : draggingDisabled;\n this.dragStartDelay = dragStartDelay || 0;\n if (lockAxis) {\n this.lockAxis = lockAxis;\n }\n if (constrainPosition) {\n this.constrainPosition = constrainPosition;\n }\n if (previewClass) {\n this.previewClass = previewClass;\n }\n if (boundaryElement) {\n this.boundaryElement = boundaryElement;\n }\n if (rootElementSelector) {\n this.rootElementSelector = rootElementSelector;\n }\n if (previewContainer) {\n this.previewContainer = previewContainer;\n }\n }\n /** Sets up the listener that syncs the handles with the drag ref. */\n _setupHandlesListener() {\n // Listen for any newly-added handles.\n this._handles\n .pipe(\n // Sync the new handles with the DragRef.\n tap(handles => {\n const handleElements = handles.map(handle => handle.element);\n // Usually handles are only allowed to be a descendant of the drag element, but if\n // the consumer defined a different drag root, we should allow the drag element\n // itself to be a handle too.\n if (this._selfHandle && this.rootElementSelector) {\n handleElements.push(this.element);\n }\n this._dragRef.withHandles(handleElements);\n }), \n // Listen if the state of any of the handles changes.\n switchMap((handles) => {\n return merge(...handles.map(item => item._stateChanges.pipe(startWith(item))));\n }), takeUntil(this._destroyed))\n .subscribe(handleInstance => {\n // Enabled/disable the handle that changed in the DragRef.\n const dragRef = this._dragRef;\n const handle = handleInstance.element.nativeElement;\n handleInstance.disabled ? dragRef.disableHandle(handle) : dragRef.enableHandle(handle);\n });\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: CdkDrag, deps: [{ token: i0.ElementRef }, { token: CDK_DROP_LIST, optional: true, skipSelf: true }, { token: DOCUMENT }, { token: i0.NgZone }, { token: i0.ViewContainerRef }, { token: CDK_DRAG_CONFIG, optional: true }, { token: i1$1.Directionality, optional: true }, { token: DragDrop }, { token: i0.ChangeDetectorRef }, { token: CDK_DRAG_HANDLE, optional: true, self: true }, { token: CDK_DRAG_PARENT, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"16.1.0\", version: \"18.2.0-next.2\", type: CdkDrag, isStandalone: true, selector: \"[cdkDrag]\", inputs: { data: [\"cdkDragData\", \"data\"], lockAxis: [\"cdkDragLockAxis\", \"lockAxis\"], rootElementSelector: [\"cdkDragRootElement\", \"rootElementSelector\"], boundaryElement: [\"cdkDragBoundary\", \"boundaryElement\"], dragStartDelay: [\"cdkDragStartDelay\", \"dragStartDelay\"], freeDragPosition: [\"cdkDragFreeDragPosition\", \"freeDragPosition\"], disabled: [\"cdkDragDisabled\", \"disabled\", booleanAttribute], constrainPosition: [\"cdkDragConstrainPosition\", \"constrainPosition\"], previewClass: [\"cdkDragPreviewClass\", \"previewClass\"], previewContainer: [\"cdkDragPreviewContainer\", \"previewContainer\"], scale: [\"cdkDragScale\", \"scale\", numberAttribute] }, outputs: { started: \"cdkDragStarted\", released: \"cdkDragReleased\", ended: \"cdkDragEnded\", entered: \"cdkDragEntered\", exited: \"cdkDragExited\", dropped: \"cdkDragDropped\", moved: \"cdkDragMoved\" }, host: { properties: { \"class.cdk-drag-disabled\": \"disabled\", \"class.cdk-drag-dragging\": \"_dragRef.isDragging()\" }, classAttribute: \"cdk-drag\" }, providers: [{ provide: CDK_DRAG_PARENT, useExisting: CdkDrag }], exportAs: [\"cdkDrag\"], usesOnChanges: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: CdkDrag, decorators: [{\n type: Directive,\n args: [{\n selector: '[cdkDrag]',\n exportAs: 'cdkDrag',\n standalone: true,\n host: {\n 'class': DRAG_HOST_CLASS,\n '[class.cdk-drag-disabled]': 'disabled',\n '[class.cdk-drag-dragging]': '_dragRef.isDragging()',\n },\n providers: [{ provide: CDK_DRAG_PARENT, useExisting: CdkDrag }],\n }]\n }], ctorParameters: () => [{ type: i0.ElementRef }, { type: undefined, decorators: [{\n type: Inject,\n args: [CDK_DROP_LIST]\n }, {\n type: Optional\n }, {\n type: SkipSelf\n }] }, { type: undefined, decorators: [{\n type: Inject,\n args: [DOCUMENT]\n }] }, { type: i0.NgZone }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [CDK_DRAG_CONFIG]\n }] }, { type: i1$1.Directionality, decorators: [{\n type: Optional\n }] }, { type: DragDrop }, { type: i0.ChangeDetectorRef }, { type: CdkDragHandle, decorators: [{\n type: Optional\n }, {\n type: Self\n }, {\n type: Inject,\n args: [CDK_DRAG_HANDLE]\n }] }, { type: CdkDrag, decorators: [{\n type: Optional\n }, {\n type: SkipSelf\n }, {\n type: Inject,\n args: [CDK_DRAG_PARENT]\n }] }], propDecorators: { data: [{\n type: Input,\n args: ['cdkDragData']\n }], lockAxis: [{\n type: Input,\n args: ['cdkDragLockAxis']\n }], rootElementSelector: [{\n type: Input,\n args: ['cdkDragRootElement']\n }], boundaryElement: [{\n type: Input,\n args: ['cdkDragBoundary']\n }], dragStartDelay: [{\n type: Input,\n args: ['cdkDragStartDelay']\n }], freeDragPosition: [{\n type: Input,\n args: ['cdkDragFreeDragPosition']\n }], disabled: [{\n type: Input,\n args: [{ alias: 'cdkDragDisabled', transform: booleanAttribute }]\n }], constrainPosition: [{\n type: Input,\n args: ['cdkDragConstrainPosition']\n }], previewClass: [{\n type: Input,\n args: ['cdkDragPreviewClass']\n }], previewContainer: [{\n type: Input,\n args: ['cdkDragPreviewContainer']\n }], scale: [{\n type: Input,\n args: [{ alias: 'cdkDragScale', transform: numberAttribute }]\n }], started: [{\n type: Output,\n args: ['cdkDragStarted']\n }], released: [{\n type: Output,\n args: ['cdkDragReleased']\n }], ended: [{\n type: Output,\n args: ['cdkDragEnded']\n }], entered: [{\n type: Output,\n args: ['cdkDragEntered']\n }], exited: [{\n type: Output,\n args: ['cdkDragExited']\n }], dropped: [{\n type: Output,\n args: ['cdkDragDropped']\n }], moved: [{\n type: Output,\n args: ['cdkDragMoved']\n }] } });\n\n/**\n * Injection token that can be used to reference instances of `CdkDropListGroup`. It serves as\n * alternative token to the actual `CdkDropListGroup` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\nconst CDK_DROP_LIST_GROUP = new InjectionToken('CdkDropListGroup');\n/**\n * Declaratively connects sibling `cdkDropList` instances together. All of the `cdkDropList`\n * elements that are placed inside a `cdkDropListGroup` will be connected to each other\n * automatically. Can be used as an alternative to the `cdkDropListConnectedTo` input\n * from `cdkDropList`.\n */\nclass CdkDropListGroup {\n constructor() {\n /** Drop lists registered inside the group. */\n this._items = new Set();\n /** Whether starting a dragging sequence from inside this group is disabled. */\n this.disabled = false;\n }\n ngOnDestroy() {\n this._items.clear();\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: CdkDropListGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"16.1.0\", version: \"18.2.0-next.2\", type: CdkDropListGroup, isStandalone: true, selector: \"[cdkDropListGroup]\", inputs: { disabled: [\"cdkDropListGroupDisabled\", \"disabled\", booleanAttribute] }, providers: [{ provide: CDK_DROP_LIST_GROUP, useExisting: CdkDropListGroup }], exportAs: [\"cdkDropListGroup\"], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: CdkDropListGroup, decorators: [{\n type: Directive,\n args: [{\n selector: '[cdkDropListGroup]',\n exportAs: 'cdkDropListGroup',\n standalone: true,\n providers: [{ provide: CDK_DROP_LIST_GROUP, useExisting: CdkDropListGroup }],\n }]\n }], propDecorators: { disabled: [{\n type: Input,\n args: [{ alias: 'cdkDropListGroupDisabled', transform: booleanAttribute }]\n }] } });\n\n/** Counter used to generate unique ids for drop zones. */\nlet _uniqueIdCounter = 0;\n/** Container that wraps a set of draggable items. */\nclass CdkDropList {\n /** Keeps track of the drop lists that are currently on the page. */\n static { this._dropLists = []; }\n /** Whether starting a dragging sequence from this container is disabled. */\n get disabled() {\n return this._disabled || (!!this._group && this._group.disabled);\n }\n set disabled(value) {\n // Usually we sync the directive and ref state right before dragging starts, in order to have\n // a single point of failure and to avoid having to use setters for everything. `disabled` is\n // a special case, because it can prevent the `beforeStarted` event from firing, which can lock\n // the user in a disabled state, so we also need to sync it as it's being set.\n this._dropListRef.disabled = this._disabled = value;\n }\n constructor(\n /** Element that the drop list is attached to. */\n element, dragDrop, _changeDetectorRef, _scrollDispatcher, _dir, _group, config) {\n this.element = element;\n this._changeDetectorRef = _changeDetectorRef;\n this._scrollDispatcher = _scrollDispatcher;\n this._dir = _dir;\n this._group = _group;\n /** Emits when the list has been destroyed. */\n this._destroyed = new Subject();\n /**\n * Other draggable containers that this container is connected to and into which the\n * container's items can be transferred. Can either be references to other drop containers,\n * or their unique IDs.\n */\n this.connectedTo = [];\n /**\n * Unique ID for the drop zone. Can be used as a reference\n * in the `connectedTo` of another `CdkDropList`.\n */\n this.id = `cdk-drop-list-${_uniqueIdCounter++}`;\n /**\n * Function that is used to determine whether an item\n * is allowed to be moved into a drop container.\n */\n this.enterPredicate = () => true;\n /** Functions that is used to determine whether an item can be sorted into a particular index. */\n this.sortPredicate = () => true;\n /** Emits when the user drops an item inside the container. */\n this.dropped = new EventEmitter();\n /**\n * Emits when the user has moved a new drag item into this container.\n */\n this.entered = new EventEmitter();\n /**\n * Emits when the user removes an item from the container\n * by dragging it into another container.\n */\n this.exited = new EventEmitter();\n /** Emits as the user is swapping items while actively dragging. */\n this.sorted = new EventEmitter();\n /**\n * Keeps track of the items that are registered with this container. Historically we used to\n * do this with a `ContentChildren` query, however queries don't handle transplanted views very\n * well which means that we can't handle cases like dragging the headers of a `mat-table`\n * correctly. What we do instead is to have the items register themselves with the container\n * and then we sort them based on their position in the DOM.\n */\n this._unsortedItems = new Set();\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n assertElementNode(element.nativeElement, 'cdkDropList');\n }\n this._dropListRef = dragDrop.createDropList(element);\n this._dropListRef.data = this;\n if (config) {\n this._assignDefaults(config);\n }\n this._dropListRef.enterPredicate = (drag, drop) => {\n return this.enterPredicate(drag.data, drop.data);\n };\n this._dropListRef.sortPredicate = (index, drag, drop) => {\n return this.sortPredicate(index, drag.data, drop.data);\n };\n this._setupInputSyncSubscription(this._dropListRef);\n this._handleEvents(this._dropListRef);\n CdkDropList._dropLists.push(this);\n if (_group) {\n _group._items.add(this);\n }\n }\n /** Registers an items with the drop list. */\n addItem(item) {\n this._unsortedItems.add(item);\n if (this._dropListRef.isDragging()) {\n this._syncItemsWithRef();\n }\n }\n /** Removes an item from the drop list. */\n removeItem(item) {\n this._unsortedItems.delete(item);\n if (this._dropListRef.isDragging()) {\n this._syncItemsWithRef();\n }\n }\n /** Gets the registered items in the list, sorted by their position in the DOM. */\n getSortedItems() {\n return Array.from(this._unsortedItems).sort((a, b) => {\n const documentPosition = a._dragRef\n .getVisibleElement()\n .compareDocumentPosition(b._dragRef.getVisibleElement());\n // `compareDocumentPosition` returns a bitmask so we have to use a bitwise operator.\n // https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition\n // tslint:disable-next-line:no-bitwise\n return documentPosition & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;\n });\n }\n ngOnDestroy() {\n const index = CdkDropList._dropLists.indexOf(this);\n if (index > -1) {\n CdkDropList._dropLists.splice(index, 1);\n }\n if (this._group) {\n this._group._items.delete(this);\n }\n this._unsortedItems.clear();\n this._dropListRef.dispose();\n this._destroyed.next();\n this._destroyed.complete();\n }\n /** Syncs the inputs of the CdkDropList with the options of the underlying DropListRef. */\n _setupInputSyncSubscription(ref) {\n if (this._dir) {\n this._dir.change\n .pipe(startWith(this._dir.value), takeUntil(this._destroyed))\n .subscribe(value => ref.withDirection(value));\n }\n ref.beforeStarted.subscribe(() => {\n const siblings = coerceArray(this.connectedTo).map(drop => {\n if (typeof drop === 'string') {\n const correspondingDropList = CdkDropList._dropLists.find(list => list.id === drop);\n if (!correspondingDropList && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n console.warn(`CdkDropList could not find connected drop list with id \"${drop}\"`);\n }\n return correspondingDropList;\n }\n return drop;\n });\n if (this._group) {\n this._group._items.forEach(drop => {\n if (siblings.indexOf(drop) === -1) {\n siblings.push(drop);\n }\n });\n }\n // Note that we resolve the scrollable parents here so that we delay the resolution\n // as long as possible, ensuring that the element is in its final place in the DOM.\n if (!this._scrollableParentsResolved) {\n const scrollableParents = this._scrollDispatcher\n .getAncestorScrollContainers(this.element)\n .map(scrollable => scrollable.getElementRef().nativeElement);\n this._dropListRef.withScrollableParents(scrollableParents);\n // Only do this once since it involves traversing the DOM and the parents\n // shouldn't be able to change without the drop list being destroyed.\n this._scrollableParentsResolved = true;\n }\n if (this.elementContainerSelector) {\n const container = this.element.nativeElement.querySelector(this.elementContainerSelector);\n if (!container && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw new Error(`CdkDropList could not find an element container matching the selector \"${this.elementContainerSelector}\"`);\n }\n ref.withElementContainer(container);\n }\n ref.disabled = this.disabled;\n ref.lockAxis = this.lockAxis;\n ref.sortingDisabled = this.sortingDisabled;\n ref.autoScrollDisabled = this.autoScrollDisabled;\n ref.autoScrollStep = coerceNumberProperty(this.autoScrollStep, 2);\n ref\n .connectedTo(siblings.filter(drop => drop && drop !== this).map(list => list._dropListRef))\n .withOrientation(this.orientation);\n });\n }\n /** Handles events from the underlying DropListRef. */\n _handleEvents(ref) {\n ref.beforeStarted.subscribe(() => {\n this._syncItemsWithRef();\n this._changeDetectorRef.markForCheck();\n });\n ref.entered.subscribe(event => {\n this.entered.emit({\n container: this,\n item: event.item.data,\n currentIndex: event.currentIndex,\n });\n });\n ref.exited.subscribe(event => {\n this.exited.emit({\n container: this,\n item: event.item.data,\n });\n this._changeDetectorRef.markForCheck();\n });\n ref.sorted.subscribe(event => {\n this.sorted.emit({\n previousIndex: event.previousIndex,\n currentIndex: event.currentIndex,\n container: this,\n item: event.item.data,\n });\n });\n ref.dropped.subscribe(dropEvent => {\n this.dropped.emit({\n previousIndex: dropEvent.previousIndex,\n currentIndex: dropEvent.currentIndex,\n previousContainer: dropEvent.previousContainer.data,\n container: dropEvent.container.data,\n item: dropEvent.item.data,\n isPointerOverContainer: dropEvent.isPointerOverContainer,\n distance: dropEvent.distance,\n dropPoint: dropEvent.dropPoint,\n event: dropEvent.event,\n });\n // Mark for check since all of these events run outside of change\n // detection and we're not guaranteed for something else to have triggered it.\n this._changeDetectorRef.markForCheck();\n });\n merge(ref.receivingStarted, ref.receivingStopped).subscribe(() => this._changeDetectorRef.markForCheck());\n }\n /** Assigns the default input values based on a provided config object. */\n _assignDefaults(config) {\n const { lockAxis, draggingDisabled, sortingDisabled, listAutoScrollDisabled, listOrientation } = config;\n this.disabled = draggingDisabled == null ? false : draggingDisabled;\n this.sortingDisabled = sortingDisabled == null ? false : sortingDisabled;\n this.autoScrollDisabled = listAutoScrollDisabled == null ? false : listAutoScrollDisabled;\n this.orientation = listOrientation || 'vertical';\n if (lockAxis) {\n this.lockAxis = lockAxis;\n }\n }\n /** Syncs up the registered drag items with underlying drop list ref. */\n _syncItemsWithRef() {\n this._dropListRef.withItems(this.getSortedItems().map(item => item._dragRef));\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: CdkDropList, deps: [{ token: i0.ElementRef }, { token: DragDrop }, { token: i0.ChangeDetectorRef }, { token: i1.ScrollDispatcher }, { token: i1$1.Directionality, optional: true }, { token: CDK_DROP_LIST_GROUP, optional: true, skipSelf: true }, { token: CDK_DRAG_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"16.1.0\", version: \"18.2.0-next.2\", type: CdkDropList, isStandalone: true, selector: \"[cdkDropList], cdk-drop-list\", inputs: { connectedTo: [\"cdkDropListConnectedTo\", \"connectedTo\"], data: [\"cdkDropListData\", \"data\"], orientation: [\"cdkDropListOrientation\", \"orientation\"], id: \"id\", lockAxis: [\"cdkDropListLockAxis\", \"lockAxis\"], disabled: [\"cdkDropListDisabled\", \"disabled\", booleanAttribute], sortingDisabled: [\"cdkDropListSortingDisabled\", \"sortingDisabled\", booleanAttribute], enterPredicate: [\"cdkDropListEnterPredicate\", \"enterPredicate\"], sortPredicate: [\"cdkDropListSortPredicate\", \"sortPredicate\"], autoScrollDisabled: [\"cdkDropListAutoScrollDisabled\", \"autoScrollDisabled\", booleanAttribute], autoScrollStep: [\"cdkDropListAutoScrollStep\", \"autoScrollStep\"], elementContainerSelector: [\"cdkDropListElementContainer\", \"elementContainerSelector\"] }, outputs: { dropped: \"cdkDropListDropped\", entered: \"cdkDropListEntered\", exited: \"cdkDropListExited\", sorted: \"cdkDropListSorted\" }, host: { properties: { \"attr.id\": \"id\", \"class.cdk-drop-list-disabled\": \"disabled\", \"class.cdk-drop-list-dragging\": \"_dropListRef.isDragging()\", \"class.cdk-drop-list-receiving\": \"_dropListRef.isReceiving()\" }, classAttribute: \"cdk-drop-list\" }, providers: [\n // Prevent child drop lists from picking up the same group as their parent.\n { provide: CDK_DROP_LIST_GROUP, useValue: undefined },\n { provide: CDK_DROP_LIST, useExisting: CdkDropList },\n ], exportAs: [\"cdkDropList\"], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: CdkDropList, decorators: [{\n type: Directive,\n args: [{\n selector: '[cdkDropList], cdk-drop-list',\n exportAs: 'cdkDropList',\n standalone: true,\n providers: [\n // Prevent child drop lists from picking up the same group as their parent.\n { provide: CDK_DROP_LIST_GROUP, useValue: undefined },\n { provide: CDK_DROP_LIST, useExisting: CdkDropList },\n ],\n host: {\n 'class': 'cdk-drop-list',\n '[attr.id]': 'id',\n '[class.cdk-drop-list-disabled]': 'disabled',\n '[class.cdk-drop-list-dragging]': '_dropListRef.isDragging()',\n '[class.cdk-drop-list-receiving]': '_dropListRef.isReceiving()',\n },\n }]\n }], ctorParameters: () => [{ type: i0.ElementRef }, { type: DragDrop }, { type: i0.ChangeDetectorRef }, { type: i1.ScrollDispatcher }, { type: i1$1.Directionality, decorators: [{\n type: Optional\n }] }, { type: CdkDropListGroup, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [CDK_DROP_LIST_GROUP]\n }, {\n type: SkipSelf\n }] }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [CDK_DRAG_CONFIG]\n }] }], propDecorators: { connectedTo: [{\n type: Input,\n args: ['cdkDropListConnectedTo']\n }], data: [{\n type: Input,\n args: ['cdkDropListData']\n }], orientation: [{\n type: Input,\n args: ['cdkDropListOrientation']\n }], id: [{\n type: Input\n }], lockAxis: [{\n type: Input,\n args: ['cdkDropListLockAxis']\n }], disabled: [{\n type: Input,\n args: [{ alias: 'cdkDropListDisabled', transform: booleanAttribute }]\n }], sortingDisabled: [{\n type: Input,\n args: [{ alias: 'cdkDropListSortingDisabled', transform: booleanAttribute }]\n }], enterPredicate: [{\n type: Input,\n args: ['cdkDropListEnterPredicate']\n }], sortPredicate: [{\n type: Input,\n args: ['cdkDropListSortPredicate']\n }], autoScrollDisabled: [{\n type: Input,\n args: [{ alias: 'cdkDropListAutoScrollDisabled', transform: booleanAttribute }]\n }], autoScrollStep: [{\n type: Input,\n args: ['cdkDropListAutoScrollStep']\n }], elementContainerSelector: [{\n type: Input,\n args: ['cdkDropListElementContainer']\n }], dropped: [{\n type: Output,\n args: ['cdkDropListDropped']\n }], entered: [{\n type: Output,\n args: ['cdkDropListEntered']\n }], exited: [{\n type: Output,\n args: ['cdkDropListExited']\n }], sorted: [{\n type: Output,\n args: ['cdkDropListSorted']\n }] } });\n\n/**\n * Injection token that can be used to reference instances of `CdkDragPreview`. It serves as\n * alternative token to the actual `CdkDragPreview` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\nconst CDK_DRAG_PREVIEW = new InjectionToken('CdkDragPreview');\n/**\n * Element that will be used as a template for the preview\n * of a CdkDrag when it is being dragged.\n */\nclass CdkDragPreview {\n constructor(templateRef) {\n this.templateRef = templateRef;\n this._drag = inject(CDK_DRAG_PARENT, { optional: true });\n /** Whether the preview should preserve the same size as the item that is being dragged. */\n this.matchSize = false;\n this._drag?._setPreviewTemplate(this);\n }\n ngOnDestroy() {\n this._drag?._resetPreviewTemplate(this);\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: CdkDragPreview, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"16.1.0\", version: \"18.2.0-next.2\", type: CdkDragPreview, isStandalone: true, selector: \"ng-template[cdkDragPreview]\", inputs: { data: \"data\", matchSize: [\"matchSize\", \"matchSize\", booleanAttribute] }, providers: [{ provide: CDK_DRAG_PREVIEW, useExisting: CdkDragPreview }], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: CdkDragPreview, decorators: [{\n type: Directive,\n args: [{\n selector: 'ng-template[cdkDragPreview]',\n standalone: true,\n providers: [{ provide: CDK_DRAG_PREVIEW, useExisting: CdkDragPreview }],\n }]\n }], ctorParameters: () => [{ type: i0.TemplateRef }], propDecorators: { data: [{\n type: Input\n }], matchSize: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }] } });\n\n/**\n * Injection token that can be used to reference instances of `CdkDragPlaceholder`. It serves as\n * alternative token to the actual `CdkDragPlaceholder` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\nconst CDK_DRAG_PLACEHOLDER = new InjectionToken('CdkDragPlaceholder');\n/**\n * Element that will be used as a template for the placeholder of a CdkDrag when\n * it is being dragged. The placeholder is displayed in place of the element being dragged.\n */\nclass CdkDragPlaceholder {\n constructor(templateRef) {\n this.templateRef = templateRef;\n this._drag = inject(CDK_DRAG_PARENT, { optional: true });\n this._drag?._setPlaceholderTemplate(this);\n }\n ngOnDestroy() {\n this._drag?._resetPlaceholderTemplate(this);\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: CdkDragPlaceholder, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"18.2.0-next.2\", type: CdkDragPlaceholder, isStandalone: true, selector: \"ng-template[cdkDragPlaceholder]\", inputs: { data: \"data\" }, providers: [{ provide: CDK_DRAG_PLACEHOLDER, useExisting: CdkDragPlaceholder }], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: CdkDragPlaceholder, decorators: [{\n type: Directive,\n args: [{\n selector: 'ng-template[cdkDragPlaceholder]',\n standalone: true,\n providers: [{ provide: CDK_DRAG_PLACEHOLDER, useExisting: CdkDragPlaceholder }],\n }]\n }], ctorParameters: () => [{ type: i0.TemplateRef }], propDecorators: { data: [{\n type: Input\n }] } });\n\nconst DRAG_DROP_DIRECTIVES = [\n CdkDropList,\n CdkDropListGroup,\n CdkDrag,\n CdkDragHandle,\n CdkDragPreview,\n CdkDragPlaceholder,\n];\nclass DragDropModule {\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: DragDropModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }\n static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: DragDropModule, imports: [CdkDropList,\n CdkDropListGroup,\n CdkDrag,\n CdkDragHandle,\n CdkDragPreview,\n CdkDragPlaceholder], exports: [CdkScrollableModule, CdkDropList,\n CdkDropListGroup,\n CdkDrag,\n CdkDragHandle,\n CdkDragPreview,\n CdkDragPlaceholder] }); }\n static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: DragDropModule, providers: [DragDrop], imports: [CdkScrollableModule] }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"18.2.0-next.2\", ngImport: i0, type: DragDropModule, decorators: [{\n type: NgModule,\n args: [{\n imports: DRAG_DROP_DIRECTIVES,\n exports: [CdkScrollableModule, ...DRAG_DROP_DIRECTIVES],\n providers: [DragDrop],\n }]\n }] });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { CDK_DRAG_CONFIG, CDK_DRAG_HANDLE, CDK_DRAG_PARENT, CDK_DRAG_PLACEHOLDER, CDK_DRAG_PREVIEW, CDK_DROP_LIST, CDK_DROP_LIST_GROUP, CdkDrag, CdkDragHandle, CdkDragPlaceholder, CdkDragPreview, CdkDropList, CdkDropListGroup, DragDrop, DragDropModule, DragDropRegistry, DragRef, DropListRef, copyArrayItem, moveItemInArray, transferArrayItem };\n","\n
Edit Columns
\n
\n Drag and drop to edit and rearrange column titles\n
\n
\n
\n
Columns
\n \n
{{item.fieldName}}
\n
\n
\n\n
\n
Selected Columns
\n \n
{{item.fieldName}}
\n
\n \n \n\n \n
\n\n \n \n","import {Component, Inject, OnInit} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from \"@angular/material/dialog\";\nimport {IColoumnSelectionInfo, IReportEditData, ITableColumns} from \"app/modules/reports/interfaces/reporting-data\";\nimport {\n CdkDragDrop,\n moveItemInArray,\n transferArrayItem,\n CdkDrag,\n CdkDropList,\n} from '@angular/cdk/drag-drop';\n\n@Component({\n selector: 'app-report-edit-dialog',\n templateUrl: './report-edit-dialog.component.html',\n styleUrls: ['./report-edit-dialog.component.scss']\n})\nexport class ReportEditDialogComponent implements OnInit {\n\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: IReportEditData,\n private dialogRef: MatDialogRef\n ) {\n }\n\n nonSelectedColumns: ITableColumns[];\n selectedColumns: ITableColumns[];\n ngOnInit() {\n let columnData = this.data.columnsProperties.map((obj) => ({ ...obj })); \n this.nonSelectedColumns = columnData.filter((col) => !col.isSelected); \n this.selectedColumns = columnData.filter((col) => col.isSelected);\n this.selectedColumns.sort((a, b) => a.fieldOrder - b.fieldOrder);\n }\n\n applyChanges() {\n let updatedColoumnInfo: IColoumnSelectionInfo = {\n selectedColumns: this.selectedColumns,\n deSelectedColumns: this.nonSelectedColumns,\n };\n this.dialogRef.close(updatedColoumnInfo);\n }\n\n drop(event: CdkDragDrop) {\n if (event.previousContainer === event.container) {\n moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);\n } else {\n transferArrayItem(\n event.previousContainer.data,\n event.container.data,\n event.previousIndex,\n event.currentIndex,\n );\n }\n }\n}\n","\n\n
\n
\n
\n \n
\n \n \n
\n
\n
\n
\n \n \n
\n Date Range: {{ hardDateRange }}\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n
\n\n
\n \n
\n\n","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { ReportMenuComponent } from './components/report-menu/report-menu.component';\nimport { ReportingComponent } from './components/reporting/reporting.component';\n\nconst routes: Routes = [\n { path: '', component: ReportMenuComponent },\n { path: ':module', component: ReportMenuComponent },\n { path: ':urlSegment/:urlSegment', component: ReportingComponent },\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n providers: [],\n})\nexport class ReportsRoutingModule {}\n","import { Component, OnDestroy, OnInit } from '@angular/core';\nimport {\n IColorBandObject,\n IColoumnSelectionInfo,\n IDataParameters,\n IDataParametersOnlyRequired,\n IDataPropertiesOnlyRequired,\n IDynamicColumnsMapping,\n IReportEditData,\n IReportPageProperties,\n ISelectedColumns,\n ISortDescriptorCustom,\n ITableColumns,\n} from '../../interfaces/reporting-data';\nimport { IPageHeadline, PageTitleParameters } from '../../../shared/classes/page-title-parameters';\nimport { ReusableFunctions } from '../../../shared/classes/reusable-functions';\nimport {\n DisplayOptions,\n IDisplayOptionToReset,\n IOptionalSummaryList,\n ISummaryAreaInfo,\n} from '../../../shared/interfaces/display-options';\nimport { ActivatedRoute, Params, Router } from '@angular/router';\nimport { ReportingService } from '../../services/reporting.service';\nimport { IReportingCommon } from '../../interfaces/reporting-common-for-allcomponent';\nimport { LoanDetailsListOfLoansService } from '../../../shared/loan-details-modal/loan-details-list-of-loans.service';\nimport { NoDataActionType } from '../../../shared/interfaces/no-data';\nimport { BookmarkService } from '../../../shared/services/bookmark.service';\nimport { formatDate } from '@angular/common';\nimport { UserAccessService } from '../../../shared/services/user-access.service';\nimport { saveAs } from 'file-saver';\nimport { DisplayOptionsService } from '../../../shared/services/display-options.service';\nimport { MatDialog } from '@angular/material/dialog';\nimport { ScheduleReportBuilderComponent } from '../../../shared/components/schedule-report-builder/schedule-report-builder.component';\nimport { ReportExportService } from '../../../shared/services/report-export.service';\nimport { ReportEditDialogComponent } from 'app/modules/reports/components/report-edit-dialog/report-edit-dialog.component';\nimport { ToastService } from 'app/modules/shared/services/toast.service';\nimport { HttpHeaders } from '@angular/common/http';\nimport {\n ICellClickEventInfo,\n ICustomTableInfoExtend,\n IFooterObject,\n} from 'app/modules/shared/components/custom-mat-table/custom-mat-table.component';\nimport { PageEvent } from '@angular/material/paginator';\nimport { Sort } from '@angular/material/sort';\n\n@Component({\n selector: 'app-reporting',\n templateUrl: './reporting.component.html',\n styleUrls: ['./reporting.component.scss'],\n})\nexport class ReportingComponent implements OnInit, OnDestroy {\n constructor(\n private _router: Router,\n private _activatedRoute: ActivatedRoute,\n private _reportingService: ReportingService,\n private _reusableFunctions: ReusableFunctions,\n private _listOfLoansService: LoanDetailsListOfLoansService,\n private _bookmarkService: BookmarkService,\n private _displayOptionsService: DisplayOptionsService,\n private _userAccessService: UserAccessService,\n private _dialog: MatDialog,\n private _reportExportService: ReportExportService,\n private _toastService: ToastService\n ) {\n this._reportExportService.downloadFinished.subscribe((id) => {\n if (id && this.requiredProperties) {\n if (id == this.requiredProperties.reportId) {\n this.downloadingExcel = false;\n }\n }\n });\n }\n\n urlSegment: string;\n pageHeadline?: IPageHeadline;\n columnsProperties: ITableColumns[];\n columnsPropertiesOriginal: ITableColumns[];\n pageProperties: IReportPageProperties;\n moduleName: string;\n reportName: string;\n searchedValue: string = '';\n pageSize: number = 10;\n skip = 0;\n height = 680;\n exportFileName: string;\n exportPdfFileName: string;\n gridData: IReportingCommon[];\n sort: ISortDescriptorCustom[];\n showSummary: boolean;\n showDisplayOptionsEditButton: boolean;\n optionalSummaryList: IOptionalSummaryList[];\n reportUrl: string = '';\n previousUrl: string = '';\n fromRouteDisplayOptionParameters: IOptionalSummaryList[];\n bookmarkColumnInfo: ITableColumns;\n clickedLoanInfoRow: { rowData: IReportingCommon; rowInfo: ITableColumns };\n exportHeaderSummaryData: ISummaryAreaInfo[];\n bandColorList: IColorBandObject[];\n hasData: boolean;\n totalRows: number;\n hasDisplayOptChange: boolean;\n displayOptionsToReset: IDisplayOptionToReset[];\n requiredProperties: IDataPropertiesOnlyRequired;\n dynamicColumnInfoList: IDynamicColumnsMapping[];\n isInitialLoading: boolean;\n calculateAggregationAws: boolean;\n calculateAggregation: boolean;\n hideExcelExport = false;\n hidePdfExport = true;\n downloadingExcel = false;\n downloadingExcel_1 = false;\n downloadingTestExport = false;\n finAAGModalPage = false;\n hardDateRange: string;\n clientShortName = '';\n currentUserName = '';\n headers: HttpHeaders;\n baseApiUrl: string;\n columnNameList: string[];\n isFirstDataRequest: '0' | '1' | '-1';\n redisId: string;\n customTableInfo: ICustomTableInfoExtend;\n footerObject: IFooterObject;\n action: NoDataActionType;\n timeOutHolder: any;\n\n ngOnInit() {\n scroll(0, 0);\n this.action = NoDataActionType.pageStart;\n this.gridData = [];\n this.pageHeadline = {\n pageTitle: '',\n linkArray: [],\n linkTitle: '',\n module: '',\n moduleIcon: '',\n moduleLink: '',\n };\n this.isFirstDataRequest = '1';\n this.redisId = this._reusableFunctions.getGuid();\n this.hasData = false;\n this.optionalSummaryList = [];\n this.fromRouteDisplayOptionParameters = [];\n this.showDisplayOptionsEditButton = false;\n this.hasDisplayOptChange = false;\n this.checkForLoanDetailsDialogChange();\n this.loadPageProperties();\n }\n\n initializeCustomTable() {\n this.customTableInfo = {\n tableId: 'reporting-module-table',\n tableHeight: 630,\n hasData: false,\n isDataReady: false,\n columnInfoList: this.columnsProperties,\n dataSet: [],\n searchTerm: this.searchedValue,\n action: this.action,\n title: this.pageHeadline.pageTitle,\n bandColorList: [],\n dataHandleInUiSide: false,\n showSummary: true,\n paginationOptions: {\n totalRecords: 0,\n pageSizeOptions: [10, 20, 50, 100, 150],\n pageSize: 0,\n },\n };\n }\n\n loadPageProperties() {\n this.isInitialLoading = true;\n this.calculateAggregation = true;\n this.calculateAggregationAws = true;\n this.skip = 0;\n this.showSummary = false;\n this.columnsProperties = [];\n this.columnsPropertiesOriginal = [];\n this.initializeCustomTable();\n this.getUrlSegments();\n let routerParams = this.getRouterParameters();\n this.hardDateRange = routerParams.dateRange ? routerParams.dateRange : '';\n // todo: make dynamic/generic way to get routerParams['staffingId']\n this._reportingService\n .getDataProperties(\n this.moduleName,\n this.reportName,\n routerParams['ownerPosition'],\n routerParams['staffingId']\n )\n .subscribe({\n next: (pageProperties) => {\n if (pageProperties) {\n this.pageProperties = pageProperties;\n this.columnsPropertiesOriginal = this.pageProperties.columnsProperties;\n this.previousUrl = routerParams['navFromUrl'];\n this.getPageHeadLine(routerParams['titleSuffix']);\n this.showDisplayOptionsEditButton =\n this.pageProperties.showDisplayoptionsEditButton;\n this.bandColorList = this.pageProperties.bandColors;\n this.setPageProperties();\n this.setColumnProperties();\n this.checkAccessThenGetData();\n if (this.finAAGModalPage) this.showDisplayOptionsEditButton = false;\n } else {\n this.gridData = [];\n }\n },\n error: (err) => {\n this.action = NoDataActionType.error;\n },\n });\n }\n\n checkAccessThenGetData() {\n if (this._userAccessService.hasAccessToPage(this.reportUrl)) {\n this.setRequiredDataPropertiesThenGeData();\n } else {\n this.action = NoDataActionType.lock;\n }\n }\n\n // setClientShortName() {\n // let currentUserInfo = this._reportingService.getCurrentUserInfo();\n // this.clientShortName = currentUserInfo.clientShortName;\n // this.currentUserName = currentUserInfo.currentUserName;\n // }\n\n setRequiredDataPropertiesThenGeData() {\n if (this.pageProperties && this.pageProperties.dataParameters) {\n // let columnsInfoToDisplayDynamicaly = this.columnsProperties.filter(\n // (col) => col.hideColumnIfAllDataNull === true\n // );\n\n // TODO: Check for impersonate client??\n\n this.requiredProperties = {\n moduleId: this.moduleName,\n reportId: this.reportName,\n searchTerm: this.searchedValue,\n pageSize: this.pageSize,\n topLimit: this.skip,\n sortByList: this.sort,\n dynamicColumnList: this.dynamicColumnInfoList,\n parameters: [],\n clientShortName: this.clientShortName,\n isFirstDataRequest: this.isFirstDataRequest,\n bucketId: this.redisId,\n loginEmail: this.currentUserName,\n activeColumnList: this.columnNameList,\n hasDownloadRequested: false,\n };\n\n this.customTableInfo.dataSet = [];\n this.customTableInfo.paginationOptions.totalRecords = 0;\n this.customTableInfo = this._reportingService.refreshCustomMatTable(\n this.customTableInfo,\n false,\n false,\n this.action,\n this.searchedValue\n );\n\n if (this.finAAGModalPage) {\n const ymcIndex = this.pageProperties.dataParameters.findIndex(\n (e) => e.filterKey === 'ymc'\n );\n const loanAccountIndex = this.pageProperties.dataParameters.findIndex(\n (e) => e.filterKey === 'loanAccount'\n );\n\n if (ymcIndex > 0 && !this.pageProperties.dataParameters[ymcIndex]?.value) {\n this.pageProperties.dataParameters.splice(ymcIndex, 1);\n }\n if (\n loanAccountIndex > 0 &&\n this.pageProperties.dataParameters[loanAccountIndex]?.value === '2'\n ) {\n this.pageProperties.dataParameters.splice(loanAccountIndex, 1);\n }\n }\n this.pageProperties.dataParameters.forEach((para) => {\n if (!para.isNotDataProp) {\n this.requiredProperties.parameters.push({\n parameter: para.parameter,\n value: para.value ? para.value : '',\n });\n }\n });\n\n if (this.bookmarkColumnInfo) {\n this._bookmarkService.getBookmarksJson().subscribe((allBookmarks: string) => {\n let parameter = this.pageProperties.dataParameters.find(\n (item) => item.filterKey === 'bookmark'\n );\n\n if (parameter) {\n let bookMarkInf: IDataParametersOnlyRequired =\n this.requiredProperties.parameters.find(\n (item) => item.parameter === parameter.parameter\n );\n if (bookMarkInf) {\n bookMarkInf.value = allBookmarks;\n }\n }\n //this.getReportDataThroughDirectApi();\n this.getReportData();\n });\n } else {\n //this.getReportDataThroughDirectApi();\n this.getReportData();\n }\n }\n }\n\n getRouterParameters() {\n return Object.assign({}, this._activatedRoute.snapshot.queryParams);\n }\n\n setPageProperties(displayOptions?: DisplayOptions[]) {\n this.fromRouteDisplayOptionParameters = [];\n if (this.pageProperties) {\n // NOTE: Url parameters that can be passed to DD component:\n // navFromUrl: the url refering from\n // titleSuffix: the string to append the DD page title\n // showOnlyPreviusDateRange: show only the previous period date range and hide other date ranges\n let routerParams = this.getRouterParameters();\n let dataProperties = this.pageProperties.dataParameters;\n if (dataProperties) {\n let hFilterParam = dataProperties.find(\n (item) => item.getFromHierarchyFilters === true\n );\n if (hFilterParam) {\n let hFilterJSON = this._reusableFunctions.getHierarchyFilters();\n hFilterParam.value = hFilterJSON;\n }\n\n if (!displayOptions) {\n displayOptions = this._reusableFunctions.getCurrentDisplayOptions(\n this.reportUrl\n );\n }\n\n if (displayOptions.length > 0) {\n for (let sParam of dataProperties) {\n if (sParam.filterKey && !sParam.getFromRoute && !sParam.getFromComponent) {\n let displayOptionItem = displayOptions.find(\n (x) => x.optionKey == sParam.filterKey\n );\n if (displayOptionItem) {\n if (displayOptionItem.isMultiSelection) {\n this.displayOptionsSpecialHandling(sParam, displayOptionItem);\n } else {\n if (sParam.filterKey === 'yearsDdl') {\n sParam.value = displayOptionItem.selectedOptionsFriendly;\n } else {\n sParam.value = displayOptionItem.selectedOptions;\n }\n }\n }\n }\n }\n }\n\n this.pageProperties.dataParameters.forEach((prm) => {\n let routerParamsValue = routerParams[prm.filterKey];\n if (prm.getFromRoute) {\n prm.value = routerParamsValue\n ? routerParamsValue\n : prm.value\n ? prm.value\n : '';\n }\n });\n this.setDisplayOptionsDatePeriod(displayOptions, routerParams);\n this.setCustomDateRangeParameters(displayOptions);\n }\n }\n }\n\n setCustomDateRangeParameters(displayOptions: DisplayOptions[]) {\n // Note: This logic assumes only one date-range option is available for the page\n let dataProperties = this.pageProperties.dataParameters;\n let dateDisplayOptionItem = displayOptions.find((x) => x.isUsedForGetDateRange === true);\n\n let mainDaterangeParam = dataProperties.find(\n (itm) => itm.filterKey === dateDisplayOptionItem?.optionKey\n );\n let startDateParam = dataProperties.find(\n (itm) => itm.parameter.toLowerCase() === 'startdate'\n );\n let endDateParam = dataProperties.find((itm) => itm.parameter.toLowerCase() === 'enddate');\n\n if (\n dateDisplayOptionItem &&\n dateDisplayOptionItem.dateRange &&\n dateDisplayOptionItem.dateRange.length > 0\n ) {\n let dateRangeArray = dateDisplayOptionItem.dateRange;\n let startDate = dateRangeArray[0].dateValueFrom;\n let endDate = dateRangeArray[0].dateValueTo;\n\n if (dateDisplayOptionItem.dateRangeType === 'custom') {\n if (mainDaterangeParam) {\n mainDaterangeParam.value = 'Custom';\n if (!startDateParam) {\n startDateParam = Object.assign({}, mainDaterangeParam);\n startDateParam.parameter = 'StartDate';\n dataProperties.push(startDateParam);\n }\n\n if (!endDateParam) {\n endDateParam = Object.assign({}, mainDaterangeParam);\n endDateParam.parameter = 'EndDate';\n dataProperties.push(endDateParam);\n }\n }\n } else if (dateDisplayOptionItem.dateRangeType === 'standard') {\n startDate = '';\n endDate = '';\n }\n\n if (startDateParam) {\n startDateParam.value = startDate;\n }\n\n if (endDateParam) {\n endDateParam.value = endDate;\n }\n }\n }\n\n setDisplayOptionsDatePeriod(displayOptions: DisplayOptions[], routerParams: Params) {\n // TODO: Find a better way to move 'selectedperiod' and 'periodgroup' database.\n // Until then, these two values should be same for all the reports that use these values.\n let selectedperiodParamName = 'selectedPeriod';\n let selectedPeriodInRouterParams = routerParams[selectedperiodParamName];\n let dataParms = this.pageProperties.dataParameters;\n let selectedPeriodInDataParams = dataParms.find(\n (item) =>\n item.filterKey &&\n item.filterKey.toLowerCase() === selectedperiodParamName.toLowerCase()\n );\n\n if (!selectedPeriodInDataParams && selectedPeriodInRouterParams) {\n dataParms.push({\n parameter: selectedperiodParamName,\n filterKey: selectedperiodParamName,\n value: selectedPeriodInRouterParams,\n isNotDataProp: true,\n });\n }\n\n dataParms.forEach((prm) => {\n if (prm && prm.filterKey) {\n if (\n this.hasDisplayOptChange &&\n prm.filterKey.toLowerCase() === selectedperiodParamName.toLowerCase()\n ) {\n // NOTE: Purpose of this area is to reset the displayoption items that get from router\n // when displayoption menu is changed from the drildown report page.\n let dateDispOpt = displayOptions.find((item) => item.isUsedForGetDateRange);\n if (dateDispOpt) {\n this.displayOptionsToReset = [\n {\n optionKey: dateDispOpt.optionKey,\n toBeSetValue: dateDispOpt.selectedOptions,\n },\n ];\n }\n // TODO: remove selectedPeriod from this.pageProperties.dataParameters\n // AND/OR update router parameters accordingly\n prm.value = '';\n\n // TODO remove this check after adding 'selectedperiod' and\n // removing month and year from incentives drilldown sprocs\n if (this.moduleName === 'financials') {\n let monthParam = dataParms.find(\n (item) => item.filterKey && item.filterKey.toLowerCase() === 'month'\n );\n let yearParam = dataParms.find(\n (item) => item.filterKey && item.filterKey.toLowerCase() === 'year'\n );\n if (monthParam) {\n monthParam.value = '';\n }\n if (yearParam) {\n yearParam.value = '';\n }\n }\n this.hasDisplayOptChange = false;\n }\n\n this.fromRouteDisplayOptionParameters.push({\n value: prm.value,\n title: prm.filterKey,\n });\n\n if (\n prm.filterKey.toLowerCase() === 'periodgroup' &&\n prm.value.toLowerCase() === 'c'\n ) {\n this.fromRouteDisplayOptionParameters.push({\n value: 'true',\n title: 'showOnlyPreviousDateRange',\n });\n }\n }\n });\n }\n\n displayOptionsSpecialHandling(sprocParam: IDataParameters, displayoptionItem: DisplayOptions) {\n if (displayoptionItem) {\n sprocParam.value = sprocParam.isBooleanType ? '0' : displayoptionItem.selectedOptions;\n if (displayoptionItem.selectedOptionList) {\n for (let item of displayoptionItem.selectedOptionList) {\n if (item.optionName === sprocParam.parameter) {\n sprocParam.value = sprocParam.isBooleanType ? '1' : item.friendlyName;\n }\n }\n }\n }\n }\n\n setColumnProperties() {\n this.dynamicColumnInfoList = [];\n this.columnNameList = [];\n this.columnsProperties = this.columnsPropertiesOriginal.filter((col) => col.isSelected);\n\n if (this.columnsProperties) {\n this.customTableInfo.columnInfoList = this.columnsProperties;\n this.customTableInfo.bandColorList = this.pageProperties.bandColors;\n this.customTableInfo = this._reportingService.refreshCustomMatTable(\n this.customTableInfo,\n false,\n false,\n this.action,\n this.searchedValue\n );\n\n this.columnsProperties.forEach((colInf) => {\n this.columnNameList.push(colInf.fieldId);\n if (\n this.pageProperties.dynamicColumnInfo &&\n this.pageProperties.dynamicColumnInfo.length > 0\n ) {\n let dynamicColumns = this.pageProperties.dynamicColumnInfo.find(\n (item) => item.columnName.toLowerCase() === colInf.fieldId.toLowerCase()\n );\n\n if (dynamicColumns) {\n colInf.fieldName = dynamicColumns.columnDisplayName;\n let colWidth = colInf.fieldName.length * 9;\n colInf.width = colWidth < 100 ? 100 : colWidth;\n\n this.dynamicColumnInfoList.push({\n fieldId: colInf.fieldId,\n fieldName: dynamicColumns.columnDisplayName,\n });\n } else if (colInf.isDynamicColumn) {\n this.columnsProperties = this.columnsProperties.filter(\n (item) => item.fieldId != colInf.fieldId\n );\n }\n }\n });\n\n this.bookmarkColumnInfo = this.columnsProperties.find(\n (item) => item.fieldId === 'bookmark'\n );\n\n if (this.columnsProperties.length === 0) {\n this.gridData = [];\n this.totalRows = 0;\n }\n this.columnsProperties.sort((a, b) => a.fieldOrder - b.fieldOrder);\n this.setDataFormatting();\n }\n this.getInitialSorting();\n }\n\n getUrlSegments() {\n this.reportUrl = this._router.url.split('?')[0];\n this.finAAGModalPage =\n this.reportUrl.includes('revenue-expenses') ||\n this.reportUrl.includes('financials/volume-funded');\n let urlSegments = this.reportUrl.split('/');\n this.moduleName = '';\n this.reportName = '';\n\n // TODO: Make this section more robust....\n // TODO: Add logic to capture reports coming from custom dashbords\n if (urlSegments[1] === 'reporting' && urlSegments.length >= 4) {\n this.moduleName = urlSegments[2];\n\n // Remove modal detail from the reportName segment of route\n if (urlSegments[3].includes('modal')) {\n urlSegments[3] = urlSegments[3].split('(')[0];\n\n this.reportUrl = this.reportUrl.split('(')[0];\n }\n\n this.reportName = urlSegments[3];\n }\n }\n\n getPageHeadLine(titleSuffix: string) {\n let moduleName = this.moduleName;\n let pageTitle = this.pageProperties.reportTitle + (titleSuffix ? titleSuffix + ' ' : '');\n let titleInfo = new PageTitleParameters();\n // TODO: Check this logic back and reduce the confusion with page-title-parameters.ts\n // TODO: Add a logic to prevent/minimize adding navFromUrl patameter in router url\n\n if (this.previousUrl) {\n if (this.previousUrl === '/report-menu') {\n moduleName = 'report-menu';\n pageTitle = this.pageProperties.moduleName + ': ' + pageTitle;\n } else if (this.previousUrl.includes('my-vision')) {\n moduleName = 'my-vision';\n }\n } else {\n this.previousUrl = '';\n }\n this.pageHeadline = titleInfo.pageHeadlines.find((item) => item.moduleId === moduleName);\n this.pageHeadline.pageTitle = pageTitle;\n\n this.pageHeadline.linkArray.map((link) => {\n if (!link.isHome) {\n if (link.moduleLink.replace(/\\//g, '') === this.previousUrl.replace(/\\//g, '')) {\n link.showLink = true;\n let linkToHide = this.pageHeadline.linkArray.find((item) =>\n item.hideIf\n ? item.hideIf.find((innerItem) => innerItem === link.moduleLink)\n : false\n );\n if (linkToHide) {\n linkToHide.showLink = false;\n }\n }\n }\n });\n }\n\n setDataFormatting() {\n this.columnsProperties.forEach((column) => {\n column.dataFormat =\n '1.' + column.decimalPlaces.toString() + '-' + column.decimalPlaces.toString();\n column.headerClass =\n column.fieldId === 'bookmark'\n ? 'table-header-styles-bookmark'\n : 'table-header-styles';\n });\n }\n\n // setAggregationAws() {\n // let toGetArregateColumnList = this.columnsProperties.filter(\n // (item) => item.aggregationType != null\n // );\n // this.aggregate = {};\n // this.showSummary = false;\n // if (toGetArregateColumnList.length > 0) {\n // this.showSummary = true;\n // //this.requiredProperties.isFirstDataRequest = '0';\n // //console.log(this.baseApiUrl);\n // //this.requiredProperties.bucketId = this.redisId;\n //\n // this.requiredProperties.bucketId = this.redisId;\n //\n // if (this.calculateAggregationAws) {\n // this._reportingService\n // .getAggregationDataFromDirectApi(\n // this.requiredProperties,\n // this.baseApiUrl,\n // this.headers\n // )\n // .subscribe((result) => {\n // this.applyAggregation(result);\n // // result.forEach(\n // // (agg) => {\n // // let aggObject = {};\n // // aggObject[agg.aggregationType] = agg.value;\n // // this.aggregate[agg.fieldId] = aggObject;\n // //\n // // // TODO: Create seperate db table for Aggregatetype to handle the following logic\n // // let aggFiled = this.columnsProperties.find(\n // // (item) => item.fieldId === agg.fieldId\n // // );\n // //\n // // if (aggFiled) {\n // // aggFiled.aggregationType = agg.aggregationType;\n // // }\n // // },\n // // (error) => {\n // // throw error;\n // // }\n // // );\n // this.calculateAggregationAws = true;\n // });\n // }\n // }\n // }\n\n // applyAggregation(aggregation: IAggregation[]) {\n // aggregation.forEach(\n // (agg) => {\n // let aggObject = {};\n // aggObject[agg.aggregationType] = agg.value;\n // this.aggregate[agg.fieldId] = aggObject;\n //\n // // TODO: Create seperate db table for Aggregatetype to handle the following logic\n // let aggFiled = this.columnsProperties.find((item) => item.fieldId === agg.fieldId);\n //\n // if (aggFiled) {\n // aggFiled.aggregationType = agg.aggregationType;\n // }\n // },\n // (error) => {\n // throw error;\n // }\n // );\n // }\n\n setAggregation() {\n let toGetArregateColumnList = this.columnsProperties.filter(\n (item) => item.aggregationType != null\n );\n //this.aggregate = {};\n this.showSummary = false;\n if (toGetArregateColumnList.length > 0) {\n this.showSummary = true;\n this.resetSummaryLine();\n this._reportingService\n .getAggregationData(this.requiredProperties)\n .subscribe((result) => {\n this.footerObject = Object.assign({}, { footerSummary: result });\n\n // result.forEach(\n // (agg) => {\n // let aggObject = {};\n // aggObject[agg.aggregationType] = agg.value;\n // this.aggregate[agg.fieldId] = aggObject;\n //\n // // TODO: Create seperate db table for Aggregatetype to handle the following logic\n // let aggFiled = this.columnsProperties.find(\n // (item) => item.fieldId === agg.fieldId\n // );\n //\n // if (aggFiled) {\n // aggFiled.aggregationType = agg.aggregationType;\n // }\n //\n // // ////-------\n // //\n // // this.footerSummary.push({\n // // fieldId: agg.fieldId,\n // // aggValue: agg.value.toString(),\n // // });\n // // ////-----\n // },\n // (error) => {\n // throw error;\n // }\n // );\n\n // this.customTableInfo.footerSummary = this.footerSummary;\n // this.customTableInfo = this._reportingService.refreshCustomMatTable(\n // this.customTableInfo,\n // true,\n // true,\n // NoDataActionType.pageStart,\n // this.searchedValue\n // );\n\n this.calculateAggregation = true;\n });\n }\n }\n\n // getReportDataThroughDirectApi() {\n // this.isPageLoaded = false;\n // this.downloadingExcel_1 = false;\n // this.headers = this._reportingService.setHeaders();\n // this._reportingService.getApiGatewayUrl().subscribe(\n // (baseUrl) => {\n // this.baseApiUrl = baseUrl;\n // //this.requiredProperties.isFirstDataRequest = '1';\n //\n // //this.baseApiUrl = \"https://38v5o2ud23.execute-api.us-east-2.amazonaws.com/Prod\";\n // this._reportingService\n // .getReportDataDirectApi(this.requiredProperties, this.baseApiUrl, this.headers)\n // .subscribe(\n // (result) => {\n // //this.requiredProperties.bucketId = result.bucketId;\n // //this.redisId = result?.bucketId ?? '';\n // if (result.data && result.data.length > 0) {\n // this.gridData = result.data;\n // this.totalRows = result.total;\n // this.columnsProperties = this.columnsProperties.filter(\n // (colP, i) => {\n // if (\n // result.columnsToHide &&\n // result.columnsToHide.length > 0\n // ) {\n // let colToHide = result.columnsToHide.find(\n // (item) =>\n // item.toLowerCase() ===\n // colP.fieldId.toLowerCase()\n // );\n // return colToHide ? false : true;\n // }\n // return true;\n // }\n // );\n //\n // this.formatDates();\n // this.setGridView();\n // this.getDisplayOptionsSummaryData();\n // this.hasData = true;\n // this.isInitialLoading = false;\n //\n // if (this.calculateAggregationAws) {\n // // if (\n // // result?.aggregationCalculated &&\n // // result?.aggregation &&\n // // result?.aggregation.length > 0\n // // ) {\n // // this.applyAggregation(result.aggregation);\n // // } else {\n // // this.setAggregationAws();\n // // }\n // this.setAggregationAws();\n // }\n // this.calculateAggregationAws = true;\n // } else {\n // this.gridData = [];\n // this.totalRows = 0;\n // this.setGridView();\n // this.hasData = false;\n // this.isPageLoaded = true;\n // }\n // },\n // (error) => {\n // this.hasData = false;\n // this.isPageLoaded = true;\n // //this.noDataType.action = NoDataActionType.error;\n // }\n // );\n // },\n // (error) => {\n // this.hasData = false;\n // this.isPageLoaded = true;\n // //this.noDataType.action = NoDataActionType.error;\n // }\n // );\n // }\n\n getReportData() {\n this.downloadingExcel = false;\n this._reportingService.getReportData(this.requiredProperties).subscribe(\n (result) => {\n if (result.data && result.data.length > 0) {\n this.gridData = result.data;\n this.totalRows = result.total;\n this.columnsProperties = this.columnsProperties.filter((colP, i) => {\n if (result.columnsToHide && result.columnsToHide.length > 0) {\n let colToHide = result.columnsToHide.find(\n (item) => item.toLowerCase() === colP.fieldId.toLowerCase()\n );\n return colToHide ? false : true;\n }\n return true;\n });\n\n this.formatDates();\n this.updateGridView(\n this.gridData,\n this.totalRows,\n this.pageSize,\n true,\n true,\n this.action\n );\n this.getDisplayOptionsSummaryData();\n this.hasData = true;\n this.isInitialLoading = false;\n\n if (this.calculateAggregation) {\n this.footerObject = Object.assign({}, { footerSummary: [] });\n this.setAggregation();\n }\n this.calculateAggregation = true;\n } else {\n this.updateGridView([], 0, 0, false, true, this.action);\n }\n },\n () => {\n this.hasData = false;\n this.customTableInfo.dataSet = [];\n this.customTableInfo.paginationOptions.totalRecords = 0;\n this.customTableInfo = this._reportingService.refreshCustomMatTable(\n this.customTableInfo,\n false,\n true,\n NoDataActionType.error,\n this.searchedValue\n );\n }\n );\n }\n\n // ToDo: Check the purpose of this function\n getDisplayOptionsSummaryData() {\n let tempOptionalSummaryList = [];\n this.exportHeaderSummaryData = [];\n // NOTE: /reporting/pipeline/loans-on-lo-desk summary is temp disabled. Remove the dashes to re-add\n //if (this.reportUrl === '-----/reporting/pipeline/loans-on-lo-desk-----') {\n // // TODO: if these calculations are used in other DDL reports, make this section reusable, by passing as page parameters\n // // TODO: Veryfy the calculations\n // let unassignedLoans = this.filteredData.filter(\n // (item) =>\n // (item.employee == null || item.employee == '') &&\n // (item.loanNumber != null || item.loanNumber != '')\n // );\n // let assignedLoans = this.filteredData.filter(\n // (item) =>\n // (item.employee != null || item.employee != '') &&\n // (item.loanNumber != null || item.loanNumber != '')\n // );\n // let originatorsCount = this._reusableFunctions.getUniqueItemList(\n // assignedLoans,\n // 'employee'\n // ).length;\n // let totalLoans = assignedLoans.length + unassignedLoans.length;\n\n // tempOptionalSummaryList.push(\n // {\n // title: 'Processors:',\n // value: originatorsCount.toString(),\n // },\n // {\n // title: 'Loans Unassigned:',\n // value: unassignedLoans.length.toString(),\n // },\n // {\n // title: 'Avg Loans / Processor:',\n // value: ((totalLoans * 1.0) / originatorsCount).toFixed(2),\n // },\n // {\n // title: 'Loans With Processor Assignment:',\n // value: assignedLoans.length.toString(),\n // }\n // );\n // this.optionalSummaryList = tempOptionalSummaryList;\n //}\n\n if (this.pageProperties.displayoptionAreaSummaryItems) {\n for (let optItem of this.pageProperties.displayoptionAreaSummaryItems) {\n if (optItem.getValueFrom === 'dateRange') {\n this._displayOptionsService\n .getDateRanges(\n this.moduleName,\n optItem.getValueFromParam,\n 'Previous Period',\n ''\n )\n .subscribe(\n (dateList) => {\n let value = '';\n let valueFromKeys = optItem.valueFromKeys.split(',');\n valueFromKeys.forEach((key, index) => {\n let date = Object.assign(\n {},\n dateList.find((item) => item.tag === key.trim())\n );\n if (date && date.dateFullDescription) {\n value +=\n (index > 0 ? ' - ' : '') +\n formatDate(\n date.dateFullDescription,\n 'MM/dd/yyyy',\n 'en-US',\n 'UTC'\n );\n }\n });\n tempOptionalSummaryList.push({\n title: optItem.title,\n value: value,\n });\n this.optionalSummaryList = tempOptionalSummaryList;\n },\n (error) => {\n throw error;\n }\n );\n }\n }\n }\n this.exportHeaderSummaryData = this._displayOptionsService.updateExportSummaryList(\n this.reportUrl,\n this.optionalSummaryList\n );\n }\n\n exportToPdf() {\n this._reportExportService.addExport(\n this.requiredProperties,\n this.pageHeadline.pageTitle,\n 'pdf'\n );\n }\n\n exportToExcel() {\n if (!this.downloadingExcel) {\n this._reportExportService.addExport(\n this.requiredProperties,\n this.pageHeadline.pageTitle,\n 'excel'\n );\n this.downloadingExcel = true;\n }\n //this.exportToExcelDirectApi();\n }\n\n exportToExcelDirectApi() {\n let dateTime = this._reusableFunctions.getCurrentDateTimeStamp();\n let reportName = this.requiredProperties.reportId + '_' + dateTime + '__.xlsx';\n let toastId = new Date().getTime();\n this._toastService.info(\n `${reportName} export is being prepared now. When it's ready, a message will appear and the file will be automatically downloaded.`,\n {\n timeout: 10000,\n },\n toastId\n );\n this.downloadingExcel_1 = true;\n this._reportingService\n .reportExportTo(this.requiredProperties, this.baseApiUrl, this.headers)\n .subscribe({\n next: (res) => {\n if (res) {\n let type =\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';\n\n let encoder = new TextEncoder();\n let byteArray = encoder.encode(res);\n\n let file = new Blob([byteArray], { type: type });\n saveAs(file, reportName);\n //saveAs(res, reportName);\n\n //let file = JSON.parse(res);\n //console.log(file);\n //let encoder = new TextEncoder();\n //let byteArray = encoder.encode(file['FileContents']);\n //saveAs(new Blob([byteArray], {type: type}), reportName);\n\n if (reportName) {\n this._toastService.removeIfExists(toastId);\n }\n this.downloadingExcel_1 = false;\n this._toastService.success(`${reportName} export has finished downloading`);\n } else {\n }\n },\n error: (error) => {\n this.downloadingExcel_1 = false;\n this._toastService.warning(`Something went wrong downloading ${reportName}`);\n },\n });\n }\n\n // exportToCsv() {\n // this._reportExportService.addExport(\n // this.requiredProperties,\n // this.pageHeadline.pageTitle,\n // 'excel'\n // );\n // }\n\n searchRows(event) {\n if (this.timeOutHolder) {\n clearTimeout(this.timeOutHolder);\n }\n this.resetSummaryLine();\n this.timeOutHolder = setTimeout(() => {\n this.skip = 0;\n this.searchedValue = event;\n this.isFirstDataRequest = '0';\n this.action = NoDataActionType.search;\n this.checkAccessThenGetData();\n }, 1000);\n }\n\n resetSummaryLine() {\n this.footerObject = Object.assign({}, { footerSummary: [] });\n }\n\n getInitialSorting() {\n this.sort = [];\n this.columnsProperties.forEach((item) => {\n if (item.isSortable && item.defaultSorting) {\n if (item.fieldId === 'bookmark') {\n this.sort.splice(0, 0, {\n field: item.fieldId,\n dir: item.defaultSorting,\n dataType: item.dataType,\n });\n } else {\n this.sort.push({\n field: item.fieldId,\n dir: item.defaultSorting,\n dataType: item.dataType,\n });\n }\n }\n });\n }\n\n updateGridView(\n gridData: IReportingCommon[],\n totalRows: number,\n pageSize: number,\n hasData: boolean,\n isDataReady: boolean,\n action: NoDataActionType\n ) {\n this.customTableInfo.dataSet = gridData;\n this.customTableInfo.paginationOptions.totalRecords = totalRows;\n this.customTableInfo.paginationOptions.pageSize = pageSize;\n this.customTableInfo.title = this.pageHeadline.pageTitle;\n this.customTableInfo = this._reportingService.refreshCustomMatTable(\n this.customTableInfo,\n hasData,\n isDataReady,\n action,\n this.searchedValue\n );\n }\n\n sortChangeEvent(sortEvent: Sort[]) {\n this.calculateAggregation = false;\n this.calculateAggregationAws = false;\n this.sort = [];\n if (this.gridData.length > 0) {\n sortEvent.forEach((item) => {\n let columnInf = this.columnsProperties.find((col) => col.fieldId === item.active);\n this.sort.push({\n field: item.active,\n dir: item.direction,\n dataType: columnInf.dataType,\n });\n });\n this.isFirstDataRequest = '0';\n this.checkAccessThenGetData();\n }\n }\n\n pageChangeEvent(event: PageEvent) {\n this.calculateAggregation = false;\n this.calculateAggregationAws = false;\n this.pageSize = event.pageSize;\n // TODO: reset skip if the page size is changed.\n this.skip = event.pageIndex * event.pageSize;\n this.isFirstDataRequest = '0';\n this.checkAccessThenGetData();\n }\n\n contentChanged(event: IReportingCommon[]) {}\n\n cellClickedEvent(event: ICellClickEventInfo) {\n if (event && event.columnInfo) {\n let columnInfo = event.columnInfo;\n let cellData = event.cellData as IReportingCommon;\n\n if (columnInfo.cellClickEventType === 'bookmark') {\n this.clickBookmark(cellData);\n } else if (columnInfo.cellClickEventType === 'hyperlink') {\n this.hyperLinkHandler(columnInfo, cellData);\n }\n }\n }\n\n clickBookmark(dataItem: IReportingCommon) {\n let keys = Object.keys(dataItem);\n let hasLoanNumber = false;\n let loanNumberKey = 'loanNumber';\n // TODO: look for better solution to find diffrent loanNumber key\n if (keys.find((item) => item === loanNumberKey)) {\n hasLoanNumber = true;\n } else if (keys.find((item) => item === 'loan')) {\n loanNumberKey = 'loan';\n hasLoanNumber = true;\n }\n let oldBookmark = dataItem.bookmark;\n dataItem.bookmark = !dataItem.bookmark;\n\n if (hasLoanNumber) {\n this._bookmarkService\n .changeLoanBookmarkStatus(dataItem[loanNumberKey], null, dataItem.bookmark)\n .subscribe(\n (result) => {\n if (result < 1) {\n dataItem.bookmark = oldBookmark;\n }\n },\n (error) => {\n throw error;\n }\n );\n }\n }\n\n getIndicatoricon(value) {\n let icon =\n value > 0 ? 'fas fa-caret-up' : value < 0 ? 'fas fa-caret-down' : 'fas fa-caret-right';\n return icon;\n }\n\n applyDisplayOptions(event: DisplayOptions[]) {\n this.action = NoDataActionType.filter;\n this.hasDisplayOptChange = true;\n if (this.finAAGModalPage) this.getPageHeadLine(this.getRouterParameters()['titleSuffix']);\n this.setPageProperties(event);\n this.resetPage();\n }\n\n applyNewFilters() {\n this.action = NoDataActionType.filter;\n this.setPageProperties();\n this.resetPage();\n }\n\n resetPage() {\n this.redisId = this._reusableFunctions.getGuid();\n this.gridData = [];\n this.resetSummaryLine();\n this.updateGridView(this.gridData, 0, 0, false, false, NoDataActionType.filter);\n this.isFirstDataRequest = '1';\n this.checkAccessThenGetData();\n }\n\n hyperLinkHandler(fieldInfo: ITableColumns, dataItem: IReportingCommon) {\n if (fieldInfo.modalName === 'loanDetails') {\n this.openLoanDetailsModal(dataItem, fieldInfo);\n } else if (fieldInfo.modalName === 'subReport') {\n let oldUrl = this._router.url;\n this._router.navigate([''], { replaceUrl: true }).then(() => {\n // TODO: make this section more dynamic\n this._router.navigate(['/reporting/financials/compensation_subReport'], {\n queryParams: {\n employeeIdentifier: dataItem[fieldInfo.hyperLinkTo_FieldId],\n csBranch: dataItem.csBranch,\n payDate: dataItem.payDate,\n commType: dataItem.payType,\n navFromUrl: oldUrl,\n },\n replaceUrl: true,\n });\n });\n } else if (fieldInfo.isHierarchyEntity) {\n this._router.navigate(['directory/record/'], {\n queryParams: { identifier: dataItem[fieldInfo.hyperLinkTo_FieldId] },\n });\n } else if (fieldInfo.isEmployee) {\n this._router.navigate(['settings/employees/'], {\n queryParams: { id: dataItem[fieldInfo.hyperLinkTo_FieldId] },\n });\n }\n }\n\n private openLoanDetailsModal(dataItem: IReportingCommon, fieldInfo: ITableColumns) {\n let param = dataItem[fieldInfo.fieldId];\n let modalName = fieldInfo.modalName;\n this.clickedLoanInfoRow = { rowData: dataItem, rowInfo: fieldInfo };\n\n let loanNumbers = this.gridData.map((x) => (x.loanNumber ? x.loanNumber : x.loan));\n\n let index = loanNumbers.findIndex((loanNumber) => loanNumber === param);\n this._listOfLoansService.changeListOfLoans({\n loanNumbers: loanNumbers,\n index: index,\n });\n let routerParams = this.getRouterParameters();\n delete routerParams['bookmarkValue'];\n delete routerParams['isLoanDetails'];\n this._router.navigate([{ outlets: { modal: modalName + '/' + param } }], {\n queryParams: routerParams,\n });\n }\n\n formatDates() {\n this.columnsProperties.forEach((column) => {\n if (column.dataType === 'date') {\n this.gridData.map((dataLine) => {\n dataLine[column.fieldId] = dataLine[column.fieldId]\n ? formatDate(dataLine[column.fieldId], 'MM/dd/yyyy', 'en-US', 'UTC')\n : dataLine[column.fieldId];\n });\n }\n });\n }\n\n checkForLoanDetailsDialogChange() {\n this._activatedRoute.queryParamMap.subscribe(\n (params) => {\n let bookmarkValue = params.get('bookmarkValue');\n if (\n this.clickedLoanInfoRow &&\n params.get('isLoanDetails') === 'true' &&\n bookmarkValue\n ) {\n let rowData = this.clickedLoanInfoRow.rowData;\n let fieldid = this.clickedLoanInfoRow.rowInfo.fieldId;\n rowData.bookmark =\n bookmarkValue === 'true'\n ? true\n : bookmarkValue === 'false'\n ? false\n : rowData.bookmark;\n // TODO: check this code functionality with new changes\n //let selectValue = this.filteredData.find(\n // (item) => item[fieldid] === rowData[fieldid]\n //);\n let selectValue = this.gridData.find(\n (item) => item[fieldid] === rowData[fieldid]\n );\n selectValue.bookmark = rowData.bookmark;\n this.updateGridView(\n this.gridData,\n this.totalRows,\n this.pageSize,\n true,\n true,\n NoDataActionType.pageStart\n );\n }\n },\n (error) => {\n throw error;\n }\n );\n }\n\n openScheduleBuilder() {\n let scheduleData = {\n reportName: this.pageHeadline.pageTitle,\n reportId: this.reportName,\n routerParams: this.fromRouteDisplayOptionParameters,\n optionalSummaryList: this.optionalSummaryList,\n displayOptionsToReset: this.displayOptionsToReset,\n filters: this.requiredProperties,\n module: this.moduleName,\n };\n\n let dialogRef = this._dialog.open(ScheduleReportBuilderComponent, {\n data: scheduleData,\n maxWidth: '800px',\n width: '800px',\n });\n }\n\n testClick() {\n this.downloadingTestExport = true;\n this._reportingService\n .getTestReportExport(this.requiredProperties, 'excel')\n .subscribe((res) => {\n let dateTime = this._reusableFunctions.getCurrentDateTimeStamp();\n let reportName =\n this.requiredProperties.reportId + '_test' + '_' + dateTime + '_.xlsx';\n saveAs(res, reportName);\n console.log(res);\n this.downloadingTestExport = false;\n });\n }\n\n onExcelExport(event) {}\n\n openEditReportDialog() {\n let data: IReportEditData = {\n columnsProperties: this.columnsPropertiesOriginal,\n };\n let dialogRef = this._dialog.open(ReportEditDialogComponent, {\n data: data,\n minWidth: '400px',\n minHeight: '300px',\n });\n\n dialogRef.afterClosed().subscribe(\n (res: IColoumnSelectionInfo) => {\n if (res) {\n let selectedColumns: ISelectedColumns[] = [];\n res.selectedColumns?.map((col, index) => {\n col.fieldOrder = index;\n });\n this.columnsPropertiesOriginal.map((obj) => {\n let selectedCol = res.selectedColumns?.find(\n (col) => col.fieldId === obj.fieldId\n );\n if (selectedCol) {\n obj.isSelected = true;\n obj.fieldOrder = selectedCol.fieldOrder;\n\n selectedColumns.push({\n reportId: this.reportName,\n fieldId: selectedCol.fieldId,\n columnOrder: selectedCol.fieldOrder,\n });\n } else {\n obj.isSelected = false;\n }\n });\n\n this._reportingService\n .updateSelectedColumns(selectedColumns)\n .subscribe((numOfRowsSaved) => {\n if (numOfRowsSaved > 0) {\n this._toastService.success('Columns updated!');\n this.setColumnProperties();\n } else {\n this._toastService.warning('No record is updated. Please check.');\n }\n });\n }\n },\n (error) => {}\n );\n }\n\n ngOnDestroy() {\n /*\n this.requiredProperties.isFirstDataRequest = '-1';\n this.requiredProperties.hasDownloadRequested = this.downloadingExcel_1;\n\n this._reportingService\n .removeCachedData(this.requiredProperties, this.baseApiUrl, this.headers)\n .subscribe();\n */\n //let timeOut = 0;\n //if (this.downloadingExcel_1) {\n // timeOut = 30000;\n // }\n //setTimeout(() => {\n // this._reportingService\n // .removeCachedData(this.requiredProperties, this.baseApiUrl, this.headers)\n // .subscribe();\n // }, timeOut);\n }\n}\n","import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReportsRoutingModule } from './reports.routing.module';\nimport { SharedModule } from '../shared/shared.module';\nimport { ThirdPartyModule } from '../third-party/third-party.module';\nimport { ReportMenuComponent } from './components/report-menu/report-menu.component';\nimport { ReportingComponent } from './components/reporting/reporting.component';\nimport { ReportEditDialogComponent } from './components/report-edit-dialog/report-edit-dialog.component';\nimport { DragDropModule } from '@angular/cdk/drag-drop';\nimport { GridModule } from '@progress/kendo-angular-grid';\nimport { ReportingService } from './services/reporting.service';\n\n@NgModule({\n declarations: [ReportMenuComponent, ReportingComponent, ReportEditDialogComponent],\n imports: [\n CommonModule,\n ReportsRoutingModule,\n SharedModule,\n DragDropModule,\n GridModule,\n ThirdPartyModule,\n ],\n providers: [ReportMenuComponent, ReportingService],\n schemas: [NO_ERRORS_SCHEMA],\n})\nexport class ReportModule {}\n"],"x_google_ignoreList":[7]}