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AACC,kBAAmB,KAAQrF,KAAKsF,eAAe,KAClN,CAAER,QAAS,SAAUC,MAAO,CAAEC,QAAS,wBAAyBC,KAAK,0BAA2BC,WAAYN,EAAeO,UAAW,qBAAsBC,QAAS,CAACG,mBAAoB,KAAQvF,KAAKwF,cAAc,MAEzNxF,KAAKf,mBAAmBwG,KAAKjC,EAAMqB,EAAQ,aAC/C,CAEAhF,4BACIG,KAAKb,iBAAiBuG,eAC7B,CAEG7F,2BACIG,KAAKb,iBAAiBwG,oBAC7B,CAEG9F,yBACIG,KAAKN,oBAAsBM,KAAKN,kBACpC,CAEHG,wB,aAGuCG,KAAKjB,MAAMwE,YAAY,mBAC5D,wEACCV,cACSC,oBAEL9C,KAAKvB,IAAImH,QAAQ5F,KAAKtB,WAAWqB,WACrC8F,SAAS,sCAAgE,QAAzB,EAAA7F,KAAKhB,UAAUmD,kBAAU,eAAE9D,IAAI,IAC/EyH,YAAY,4BAA6B,8BACzCC,UACH,GArOYxH,E,mUAAe,EAD3B,EAAAyH,W,kIAa4B,KAA8B,IAAmC,IAChE,IAAiC,IACpC,IAAuC,IAAgC,IAC9D,IAAkC,EAAAC,KACpC,OAhBrB1H,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 .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,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 }\\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 \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n ${sMediator.selectedQF ? sMediator.selectedQF.name : 'Take-off'}\\r\\n \\r\\n \\r\\n Takeoff Filters\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n ${filter.name}\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n \\r\\n Menu\\r\\n \\r\\n \\r\\n Round numbers in Take-off\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\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\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 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) {}\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 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 setupSubscriptions(): 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 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","isViewerLoaded","isSettingsVisible","subscriptions","quantityFilters","isViewerModeLoaded","isViewerVisible","isPivotGridVisible","shouldRoundNumbers","sigmapub_class","async","params","projectId","this","setProject","curProject","getSelectedProject","currentUser","organization","sigma","setupSubscriptions","refreshQuantityFilters","isNewCreated","currentFilters","map","type","GetQuantityFilters","setSelectedQF","filter","includes","attached","setupMainSplitter","subscribe","objectIds","addTypesToFilter","openSourceDialog","reload","switchIsViewerMode","showInSearchMode","publish","resetSelectionAndFilter","forEach","subscription","dispose","console","log","length","undefined","selectedQF","OpenMessage","typesToAdd","GetTypesByEntityLabels","t","addSources","statusCode","result","OpenModal","selectedSources","whenClosed","wasCancelled","output","types","getSelectedTypes","instanceIds","GetInstancesByTypeId","resetColors","qf","isBasketAndOriginalDifferent","OpenConfirm","event","stopPropagation","document","getElementById","blur","DeleteQF","handleDeletedQF","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","project","postText","handleError","response","autoinject","I18N"],"sourceRoot":""}