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F,EACI3C,MAA7BxC,KAAKlB,UAAU2D,YACfzC,KAAKlB,UAAUiC,cAAcf,KAAKlB,UAAU2D,YAEhDzC,KAAKb,gBAAiB,EACtBa,KAAKR,iBAAkB,CAG3B,CAEA,QAAA8F,CAAStB,GACL,IAAIuB,EAAsD/C,MAA7BxC,KAAKlB,UAAU2D,WACxC+C,EAAiB,CACjB,CAAEC,QAAS,SAAUC,MAAO,CAAEC,QAAS,uBAAwBC,KAAK,yBAA0BC,WAAYN,EAAeO,UAAW,oBAAqBC,QAAS,CAACC,kBAAmB,KAAQhG,KAAKiG,eAAe,KAClN,CAAER,QAAS,SAAUC,MAAO,CAAEC,QAAS,wBAAyBC,KAAK,0BAA2BC,WAAYN,EAAeO,UAAW,qBAAsBC,QAAS,CAACG,mBAAoB,KAAQlG,KAAKmG,cAAc,MAEzNnG,KAAKjB,mBAAmBqH,KAAKpC,EAAMwB,EAAQ,aAC/C,CAEA,mBAAMS,SACFjG,KAAKf,iBAAiBoH,eAC7B,CAEG,kBAAMF,SACFnG,KAAKf,iBAAiBqH,oBAC7B,CAEG,sBAAMC,GACFvG,KAAKP,oBAAsBO,KAAKP,kBACpC,CAEH,qBAAM+G,G,aAGiCxG,KAAKnB,MAAMiF,YAAY,mBAC5D,wEACCX,cACSC,oBAELpD,KAAKzB,IAAIkI,QAAQzG,KAAKxB,WAAWuB,WACrC2G,SAAS,sCAAgE,QAAzB,EAAA1G,KAAKlB,UAAU2D,kBAAU,eAAEtE,IAAI,IAC/EwI,YAAY,4BAA6B,8BACzCC,UACH,GA5OYvI,E,mUAAe,EAD3B,EAAAwI,W,kIAc4B,IAA8B,IAAmC,EAAAC,gBAChE,IAAiC,IACpC,IAAuC,IAAgC,IAC9D,IAAkC,EAAAC,KACpC,IAA+C,OAjBpE1I,E","sources":["webpack://client-app/./src/app/project/quantity-takeoff/quantity-takeoff.scss","webpack://client-app/./src/app/project/quantity-takeoff/quantity-takeoff.html","webpack://client-app/./src/app/project/quantity-takeoff/quantity-takeoff.ts"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.quantity-takeoff-container .takeoff-top-bar{border-bottom:1px #d3d3d3 solid}.quantity-takeoff-container .body-content{height:calc(100vh - 4em - 10px);width:100%;white-space:nowrap;margin:5px;display:flex}.quantity-takeoff-container .body-content .hide_sigmapub{display:none}.quantity-takeoff-container .body-content--left{position:relative;display:inline-block;height:100%;width:50%;border-bottom-right-radius:10px;border-top-right-radius:10px;overflow:hidden;scrollbar-color:#d3d3d3 #fff}.quantity-takeoff-container .body-content--left--padding{width:100%;height:100%}.quantity-takeoff-container .body-content--left--padding .top-area{width:100%;min-width:350px;height:50px;padding:10px;margin-bottom:30px}.quantity-takeoff-container .body-content--left--padding .top-area .float-start{margin-right:10px}.quantity-takeoff-container .body-content--left--padding .top-area h3{margin:0}.quantity-takeoff-container .body-content--left--padding .top-area .quantity-filter-dropdown{margin-bottom:10px}.quantity-takeoff-container .body-content--left--padding .top-area .quantity-filter-dropdown .takeoff-filter-headline{border-bottom:1px solid #a9a9a9;padding:2px}.quantity-takeoff-container .body-content--left--padding .top-area .quantity-filter-dropdown .dropdown-qf{max-width:105px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-bottom-right-radius:0;border-top-right-radius:0}.quantity-takeoff-container .body-content--left--padding .top-area .quantity-filter-dropdown .takeoff-filter-item{padding-left:3px;cursor:pointer}.quantity-takeoff-container .body-content--left--padding .top-area .should-round-checkbox{position:absolute;top:50px;left:15px}.quantity-takeoff-container .body-content--left--padding .top-area .job-checkbox{position:relative;top:10px}.quantity-takeoff-container .body-content--left--padding .pivot-grid,.quantity-takeoff-container .body-content--left--padding .type-overview{display:block;width:100%;height:calc(100% - 90px);overflow:auto}.quantity-takeoff-container .body-content--left::-webkit-scrollbar-track{background-color:#fff}.quantity-takeoff-container .body-content .gutter.gutter-horizontal{cursor:col-resize}.quantity-takeoff-container .body-content .gutter.gutter-horizontal::before{position:relative;display:flex;justify-content:center;top:50%;transform:translateY(-50%);font-size:35px !important;content:\"|\";font:var(--fa-font-solid)}.quantity-takeoff-container .body-content--right{position:relative;display:inline-block;margin-right:5px;border-bottom-left-radius:10px;border-top-left-radius:10px;height:100%;width:50%;overflow:hidden}.quantity-takeoff-container .body-content--right .source-selector-container{height:100%;width:100%}.quantity-takeoff-container .body-content--right .ss-top-area{display:block;height:50%;width:100%;margin-bottom:15px}.quantity-takeoff-container .body-content--right .property-container{display:block;margin-top:15px;height:50%;min-width:300px}`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/app/project/quantity-takeoff/quantity-takeoff.scss\"],\"names\":[],\"mappings\":\"AAGI,6CACI,+BAAA,CAEJ,0CAGI,+BAAA,CACA,UAAA,CACA,kBAAA,CACA,UAAA,CACA,YAAA,CANN,yDAAA,YAAA,CAOM,gDACI,iBAAA,CACA,oBAAA,CACA,WAAA,CACA,SAAA,CACA,+BAAA,CACA,4BAAA,CACA,eAAA,CACA,4BAAA,CACA,yDACI,UAAA,CACA,WAAA,CAEA,mEACI,UAAA,CACA,eAAA,CACA,WAAA,CACA,YAAA,CACA,kBAAA,CACA,gFACI,iBAAA,CAGJ,sEACI,QAAA,CAGJ,6FAEI,kBAAA,CACA,sHACI,+BAAA,CACA,WAAA,CAEJ,0GACI,eAAA,CACA,eAAA,CAGA,sBAAA,CAEA,kBAAA,CACA,4BAAA,CACA,yBAAA,CAEJ,kHACI,gBAAA,CACA,cAAA,CAGR,0FACI,iBAAA,CACA,QAAA,CACA,SAAA,CAEJ,iFACI,iBAAA,CACA,QAAA,CAGR,6IACI,aAAA,CACA,UAAA,CACA,wBAAA,CACA,aAAA,CAKZ,yEACI,qBAAA,CAGJ,oEACI,iBAAA,CAGJ,4EACI,iBAAA,CACA,YAAA,CACA,sBAAA,CACA,OAAA,CACA,0BAAA,CACA,yBAAA,CACA,WAAA,CACA,yBAAA,CAGJ,iDACI,iBAAA,CACA,oBAAA,CACA,gBAAA,CACA,8BAAA,CACA,2BAAA,CACA,WAAA,CACA,SAAA,CACA,eAAA,CACA,4EACI,WAAA,CACA,UAAA,CAEJ,8DACI,aAAA,CACA,UAAA,CACA,UAAA,CACA,kBAAA,CAEJ,qEACI,aAAA,CACA,eAAA,CACA,UAAA,CACA,eAAA\",\"sourcesContent\":[\"@import \\\"src/resources/customized-styles/variables\\\";\\r\\n\\r\\n.quantity-takeoff-container {\\r\\n .takeoff-top-bar {\\r\\n border-bottom: 1px lightgray solid;\\r\\n }\\r\\n .body-content {\\r\\n\\t\\t.hide_sigmapub { display: none; }\\r\\n\\r\\n height: calc(100vh - $top-bar-height - 10px);\\r\\n width:100%;\\r\\n white-space: nowrap;\\r\\n margin: 5px;\\r\\n display: flex;\\r\\n &--left {\\r\\n position: relative;\\r\\n display: inline-block;\\r\\n height: 100%;\\r\\n width: 50%;\\r\\n border-bottom-right-radius: 10px;\\r\\n border-top-right-radius: 10px;\\r\\n overflow: hidden;\\r\\n scrollbar-color: lightgrey white; //Scrollbar background color: FireFox\\r\\n &--padding {\\r\\n width: 100%;\\r\\n height: 100%;\\r\\n\\r\\n .top-area {\\r\\n width: 100%;\\r\\n min-width: 350px;\\r\\n height: 50px;\\r\\n padding: 10px;\\r\\n margin-bottom: 30px;\\r\\n .float-start {\\r\\n margin-right: 10px;\\r\\n \\r\\n } \\r\\n h3 {\\r\\n margin: 0;\\r\\n }\\r\\n\\r\\n .quantity-filter-dropdown {\\r\\n\\r\\n margin-bottom: 10px;\\r\\n .takeoff-filter-headline {\\r\\n border-bottom: 1px solid darkgray;\\r\\n padding: 2px;\\r\\n }\\r\\n .dropdown-qf {\\r\\n max-width: 105px;\\r\\n overflow: hidden;\\r\\n\\r\\n //NOT-text-overflow: ellipsis;\\r\\n text-overflow:ellipsis;\\r\\n\\r\\n white-space: nowrap;\\r\\n border-bottom-right-radius: 0;\\r\\n border-top-right-radius: 0;\\r\\n }\\r\\n .takeoff-filter-item {\\r\\n padding-left:3px;\\r\\n cursor: pointer;\\r\\n }\\r\\n }\\r\\n .should-round-checkbox {\\r\\n position: absolute;\\r\\n top:50px;\\r\\n left:15px;\\r\\n }\\r\\n .job-checkbox {\\r\\n position: relative;\\r\\n top:10px;\\r\\n }\\r\\n }\\r\\n .pivot-grid, .type-overview {\\r\\n display: block;\\r\\n width: 100%;\\r\\n height: calc(100% - 90px);\\r\\n overflow: auto;\\r\\n }\\r\\n \\r\\n }\\r\\n }\\r\\n &--left::-webkit-scrollbar-track {\\r\\n background-color: white; //Scrollbar background color: Chrome, Edge, Safari\\r\\n }\\r\\n\\r\\n .gutter.gutter-horizontal {\\r\\n cursor: col-resize;\\r\\n }\\r\\n\\r\\n .gutter.gutter-horizontal::before {\\r\\n position: relative;\\r\\n display: flex;\\r\\n justify-content: center;\\r\\n top:50%;\\r\\n transform: translateY(-50%);\\r\\n font-size: 35px !important; //Needs to stay.\\r\\n content: \\\"\\\\7c\\\";\\r\\n font: var(--fa-font-solid); \\r\\n }\\r\\n\\r\\n &--right {\\r\\n position: relative;\\r\\n display: inline-block;\\r\\n margin-right:5px;\\r\\n border-bottom-left-radius: 10px;\\r\\n border-top-left-radius: 10px;\\r\\n height:100%;\\r\\n width:50%;\\r\\n overflow: hidden;\\r\\n .source-selector-container {\\r\\n height:100%;\\r\\n width: 100%;\\r\\n }\\r\\n .ss-top-area {\\r\\n display: block;\\r\\n height: 50%;\\r\\n width:100%;\\r\\n margin-bottom: 15px;\\r\\n }\\r\\n .property-container {\\r\\n display: block;\\r\\n margin-top: 15px;\\r\\n height: 50%;\\r\\n min-width: 300px;//Matches min width of source-selector. This is to have the scroll-x working properly, scroll y works separately for the two.\\r\\n }\\r\\n }\\r\\n }\\r\\n}\\r\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","module.exports = \"\\r\\n\";","import { ProjectDto } from \"app/models/project-dto\";\r\nimport { AppContextService } from \"app/services/app-context-service\";\r\nimport { autoinject } from 'aurelia-framework';\r\nimport { EventAggregator, Subscription } from \"aurelia-event-aggregator\";\r\nimport { TypeDto, TypeDtoWCategory } from \"app/components/quantity-filter-sources/quantity-filter-sources\";\r\nimport { ApiClient } from \"app/services/api-client\";\r\nimport { SplitHandler } from \"./split-handler\";\r\nimport { QuantitySourcesService } from \"app/services/quantity-sources-service\";\r\nimport { QuantityFilterDto } from \"../quantity-views/quantity-filters\";\r\nimport { QuantityTakeoffService } from \"app/services/quantity-takeoff-service\";\r\nimport { ModalService } from \"app/services/modal-service\";\r\nimport { QuantityFilterCreatePrompt } from \"../quantity-views/quantityfilter-create-prompt\";\r\nimport { SourceMediator } from \"./source-mediator\";\r\nimport { DialogCloseResult } from \"aurelia-dialog\";\r\nimport { QuantityFilterEditPrompt } from \"../quantity-views/quantityfilter-edit-prompt\";\r\nimport { DuplicateQuantityFilter } from \"app/components/duplicate-quantity-filter/duplicate-quantity-filter\";\r\nimport { ContextMenuService } from \"app/services/context-menu-service\";\r\nimport { I18N } from \"aurelia-i18n\";\r\nimport { QtoExportService } from \"app/services/qto-export-service\";\r\nimport { UpdateSourcesDialog } from \"./update-sources-dialog/update-sources-dialog\";\r\nimport {ProjectTokenService} from \"../../services/project-token-service\";\r\nimport {NavigationInstruction, Redirect, RouteConfig} from \"aurelia-router\";\r\nimport {verifyAccessOrRedirect} from \"../access-denied-page/access-redirecter\";\r\n\r\n\r\n@autoinject\r\nexport class QuantityTakeoff {\r\n curProject: ProjectDto | undefined;\r\n isViewerLoaded: boolean = false;\r\n isSettingsVisible: boolean = false;\r\n private subscriptions: Subscription[] = [];\r\n private quantityFilters: QuantityFilterDto[] = [];\r\n private isViewerModeLoaded: boolean = false;\r\n private isViewerVisible: boolean = false;\r\n private isPivotGridVisible: boolean = true;\r\n private shouldRoundNumbers: boolean = false;\r\n\tprivate useFunction: boolean = false;\r\n\tprivate sigmapub_class:string=''; // used to hide the sigma-publish feature, per customer.\r\n\r\n constructor(private api: ApiClient, public appContext: AppContextService, private events: EventAggregator,\r\n private splitHandler: SplitHandler, private qsService: QuantitySourcesService,\r\n private qtService: QuantityTakeoffService, private modal: ModalService, public sMediator: SourceMediator,\r\n private contextMenuService: ContextMenuService, private i18n: I18N,\r\n private qtoExportService: QtoExportService, private projectTokenService: ProjectTokenService) {}\r\n\r\n async activate(params: any): Promise {\r\n if (params.projectId) {\r\n this.appContext.setProject(params.projectId);//in-activate.\r\n\t\t\tawait this.projectTokenService.updatePrjTokenIfNeeded(params.projectId, this.api)\r\n this.curProject = this.appContext.getSelectedProject();//in-activate.\r\n }\r\n\t\tthis.sigmapub_class = (this.appContext.currentUser?.organization.sigma ? '' : 'hide_sigmapub' );\r\n this.setupSubscriptions();\r\n await this.refreshQuantityFilters();\r\n }\r\n async refreshQuantityFilters(isNewCreated?: boolean): Promise {\r\n let currentFilters = [...this.quantityFilters.map(type => type.id)];\r\n this.quantityFilters = [];\r\n\t\tthis.quantityFilters = await this.qtService.GetQuantityFilters();\r\n if (isNewCreated == true) {\r\n await this.setSelectedQF(this.quantityFilters.filter(type => !currentFilters.includes(type.id))[0])\r\n }\r\n\r\n }\r\n\r\n attached(): void {\r\n this.splitHandler.setupMainSplitter();\r\n }\r\n\r\n\tasync canActivate(params: any, routeConfig: RouteConfig, navigationInstruction: NavigationInstruction) {\r\n\t\treturn await verifyAccessOrRedirect(params, this.projectTokenService, this.api);\r\n\t}\r\n\r\n\tsetupSubscriptions(): void {\r\n this.subscriptions = [\r\n this.events.subscribe('ViewerMenu:ChangeIsSettingsVisible', () => {\r\n this.isSettingsVisible = false;\r\n }),\r\n this.events.subscribe('quantity-takeoff:add-found-types', (objectIds: number[]) => { this.addTypesToFilter(objectIds) }),\r\n this.events.subscribe('quantity-takeoff:open-source-dialog', (objectIds: number[]) => { this.openSourceDialog(objectIds) }),\r\n this.events.subscribe(\"project-selector:project-changed\", () => this.reload()),\r\n this.events.subscribe('takeoff-switch-right-view', () => { this.switchIsViewerMode()}),\r\n this.events.subscribe('takeoff-show-in-search', (objectIds: number[]) => { this.showInSearchMode(objectIds)}),\r\n ]\r\n }\r\n\r\n reload(): void {\r\n this.events.publish('viewer-settings:reload');\r\n this.curProject = this.appContext.getSelectedProject(); \r\n this.sMediator.resetSelectionAndFilter();\r\n this.isSettingsVisible = false;\r\n this.isPivotGridVisible = true;\r\n }\r\n\r\n async deactivate(): Promise {\r\n this.subscriptions.forEach((subscription: Subscription) => subscription.dispose());\r\n this.sMediator.resetSelectionAndFilter();\r\n }\r\n\r\n async switchSettingsVisibility(): Promise {\r\n this.isViewerLoaded = true;\r\n this.isSettingsVisible = !this.isSettingsVisible;\r\n }\r\n\r\n async addTypesToFilter(objectIds: number[]) { // UB: event quantity-takeoff:add-found-types\r\n\t\tconsole.log('QuantityTakeoff.addTypesToFilter', objectIds.length, objectIds);\r\n if (this.sMediator.selectedQF == undefined) {\r\n this.modal.OpenMessage('No filter selected','Please select a filter to update it.');\r\n } else {\r\n\t\t\tconsole.log('QuantityTakeoff.GetTypesByEntityLabels,B, with: (#) objectIds:', objectIds.length, objectIds);\r\n let typesToAdd: string[] = (await this.qtService.GetTypesByEntityLabels(objectIds)).map(t => t.id);\r\n console.log\r\n if (typesToAdd.length == 0 || typesToAdd == undefined) {\r\n return;\r\n }\r\n let response = await this.sMediator.qsService.addSources(this.sMediator.selectedQF.id, typesToAdd);\r\n if (response.statusCode == 200) {\r\n this.events.publish('pivot-grid-component:update-grid');\r\n this.events.publish('type-overview:update-grid');\r\n }\r\n }\r\n }\r\n\r\n async openSourceDialog(objectIds: number[]): Promise {\r\n let result: DialogCloseResult = await this.modal.OpenModal(UpdateSourcesDialog, {selectedSources: objectIds, selectedQF:this.sMediator.selectedQF}).whenClosed();\r\n if (result.wasCancelled == false) {\r\n if (result.output == this.sMediator.selectedQF) {\r\n this.events.publish('pivot-grid-component:update-grid');\r\n this.events.publish('type-overview:update-grid');\r\n }\r\n }\r\n }\r\n \r\n //currently not used, but could be a starting point for what the next version of the quantity-grid should be.\r\n async colorTypes(): Promise {\r\n if (this.sMediator.selectedQF?.id != undefined) {\r\n let types: TypeDto[] = await this.qsService.getSelectedTypes(this.sMediator.selectedQF?.id);\r\n let instanceIds: number[] = []\r\n for (let type of types) {\r\n instanceIds.push(...await this.qsService.GetInstancesByTypeId(type.id))\r\n }\r\n console.log(\"instanceIds \" , instanceIds);\r\n this.events.publish('3dViewer:colorInstancesOfTypes', instanceIds);\r\n }\r\n }\r\n \r\n resetColors(): void {\r\n this.events.publish('3dViewer:resetColors');\r\n }\r\n \r\n\r\n async setSelectedQF(qf: QuantityFilterDto): Promise {\r\n if (this.sMediator.selectedQF && this.sMediator.isBasketAndOriginalDifferent) {\r\n let result: DialogCloseResult = await this.modal.OpenConfirm(\"Unsaved Changes\", \r\n\t\t\t\t'You have unsaved changes on this filter. Are you sure you want to switch filter and loose the changes?'\r\n\t\t\t).whenClosed();\t\t\r\n if (result.wasCancelled) {\r\n return;\r\n }\r\n }\r\n this.sMediator.setSelectedQF(qf);\r\n }\r\n\r\n async deleteQF(event: Event, qf: QuantityFilterDto): Promise {\r\n event.stopPropagation();\r\n document.getElementById('delete-filter')?.blur();\r\n\t\tlet result:DialogCloseResult = await this.modal.OpenConfirm(\"Delete\", 'Please confirm that you want to delete the selected quantity filter.').whenClosed();\t\t\r\n\t\tif (result.wasCancelled) { return; }\r\n\r\n await this.qtService.DeleteQF(qf); \r\n this.refreshQuantityFilters();\r\n let selectedFilterDeleted: boolean = this.sMediator.handleDeletedQF(qf);\r\n if (selectedFilterDeleted) {\r\n this.isPivotGridVisible = true;\r\n }\r\n }\r\n\r\n async editQF(event: Event, qf: QuantityFilterDto): Promise {\r\n event.stopPropagation();\r\n\t\tlet result:DialogCloseResult = await this.modal.OpenModal(QuantityFilterEditPrompt, qf).whenClosed();\t\t\r\n\t\tif (result.wasCancelled) { return; }\r\n this.events.publish('pivot-grid-component:update-grid');\r\n this.refreshQuantityFilters();\r\n }\r\n\r\n async duplicateQF(event: Event, qf: QuantityFilterDto): Promise {\r\n event.stopPropagation();\r\n\t\tlet result:DialogCloseResult = await this.modal.OpenModal(DuplicateQuantityFilter, qf.id).whenClosed();\t\t\r\n\t\tif (result.wasCancelled) { return; }\r\n\r\n this.refreshQuantityFilters(true);\r\n }\r\n\r\n async addNewFilter(): Promise {\r\n await this.modal.OpenModal(QuantityFilterCreatePrompt).whenClosed(result => {\r\n if (result.wasCancelled != true) {\r\n this.refreshQuantityFilters(true);\r\n }\r\n });\r\n }\r\n\r\n\r\n async switchIsViewerMode(): Promise {\r\n this.isViewerLoaded = true;\r\n this.isViewerVisible = !this.isViewerVisible;\r\n if (this.isViewerVisible == false) {\r\n //Changes could have been made to the filter in viewer mode, so the filter is reloaded.\r\n await this.sMediator.setSelectedQF(this.sMediator.selectedQF);\r\n await this.sMediator.newSearchForTypes({typeInput: \"\", catInput: \"\", famInput: \"\"}, 0);\r\n await this.sMediator.scrollSearchForTypes({typeInput: \"\", catInput: \"\", famInput: \"\"}, 1);\r\n } else {\r\n setTimeout(() => { //Making sure viewers are not being in a 'wierd' state.\r\n window.dispatchEvent(new Event('resize'));\r\n }, 0);\r\n }\r\n }\r\n\r\n async showInSearchMode(objectIds: number[]): Promise {\r\n let typesToShow: TypeDtoWCategory[] = (await this.qtService.GetTypesWCategoriesByEntityLabels(objectIds));\r\n this.sMediator.loadedTypes = typesToShow;\r\n if (this.sMediator.selectedQF != undefined) {\r\n this.sMediator.setSelectedQF(this.sMediator.selectedQF);\r\n }\r\n this.isViewerLoaded = true;\r\n this.isViewerVisible = false; //Can only be clicked from viewer.\r\n\r\n\r\n }\r\n\r\n showMenu(event: Event): void {\r\n let isQFUndefined: boolean = this.sMediator.selectedQF == undefined;\r\n let actions: any[] = [\r\n { viewKey: \"button\", setup: { textKey: \"Export grid to excel\", icon:\"fa-solid fa-file-excel\", isDisabled: isQFUndefined, actionKey: \"exportGridToExcel\", service: {exportGridToExcel: () => { this.directToExcel(); }}}},\r\n { viewKey: \"button\", setup: { textKey: \"Export to Excel pivot\", icon:\"fa-solid fa-table-pivot\", isDisabled: isQFUndefined, actionKey: \"exportPivotToExcel\", service: {exportPivotToExcel: () => { this.toExcelPivot(); }}}},\r\n ];\r\n this.contextMenuService.open(event,actions,\"left-start\");\r\n }\r\n \r\n async directToExcel(): Promise {\r\n\t\tawait this.qtoExportService.exportToExcel();\r\n\t}\r\n\r\n async toExcelPivot(): Promise {\r\n\t\tawait this.qtoExportService.exportToExcelPivot();\r\n\t}\r\n\r\n async switchVisibility(): Promise {\r\n this.isPivotGridVisible = !this.isPivotGridVisible;\r\n }\r\n\t\r\n\tasync publishRevision(): Promise {\r\n\t\t// Could ask if the user wants to publish even though no data is present in the grid.\r\n\t\t\r\n\t\tlet result: DialogCloseResult = await this.modal.OpenConfirm(\"Publish Revision\", \r\n\t\t\t'Please confirm that you want to save the current data as a revision.'\r\n\t\t).whenClosed();\t\t\r\n\t\tif (result.wasCancelled) { return; }\r\n\t\t\r\n\t\tawait this.api.project(this.appContext.projectId)\r\n\t\t\t.postText('QuantityFilter/PublishNewRevision/' + this.sMediator.selectedQF?.id, '')\r\n\t\t\t.handleError(\"Error publishing revision\", \"Could not publish revision\")\r\n\t\t\t.response();\r\n\t}\r\n}\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","exports","QuantityTakeoff","constructor","api","appContext","events","splitHandler","qsService","qtService","modal","sMediator","contextMenuService","i18n","qtoExportService","projectTokenService","isViewerLoaded","isSettingsVisible","subscriptions","quantityFilters","isViewerModeLoaded","isViewerVisible","isPivotGridVisible","shouldRoundNumbers","useFunction","sigmapub_class","activate","params","projectId","this","setProject","updatePrjTokenIfNeeded","curProject","getSelectedProject","currentUser","organization","sigma","setupSubscriptions","refreshQuantityFilters","isNewCreated","currentFilters","map","type","GetQuantityFilters","setSelectedQF","filter","includes","attached","setupMainSplitter","canActivate","routeConfig","navigationInstruction","subscribe","objectIds","addTypesToFilter","openSourceDialog","reload","switchIsViewerMode","showInSearchMode","publish","resetSelectionAndFilter","deactivate","forEach","subscription","dispose","switchSettingsVisibility","console","log","length","undefined","selectedQF","OpenMessage","typesToAdd","GetTypesByEntityLabels","t","addSources","statusCode","result","OpenModal","selectedSources","whenClosed","wasCancelled","output","colorTypes","types","getSelectedTypes","instanceIds","GetInstancesByTypeId","resetColors","qf","isBasketAndOriginalDifferent","OpenConfirm","deleteQF","event","stopPropagation","document","getElementById","blur","DeleteQF","handleDeletedQF","editQF","duplicateQF","addNewFilter","newSearchForTypes","typeInput","catInput","famInput","scrollSearchForTypes","setTimeout","window","dispatchEvent","Event","typesToShow","GetTypesWCategoriesByEntityLabels","loadedTypes","showMenu","isQFUndefined","actions","viewKey","setup","textKey","icon","isDisabled","actionKey","service","exportGridToExcel","directToExcel","exportPivotToExcel","toExcelPivot","open","exportToExcel","exportToExcelPivot","switchVisibility","publishRevision","project","postText","handleError","response","autoinject","EventAggregator","I18N"],"sourceRoot":""}