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IAAI,2BACNO,KAAKuC,sB,MAEX/C,QAAQC,IAAI,4BAA6BgB,EAE3C,CAEA,oBAAMqF,CAAerB,GACpBjF,QAAQC,IAAI,UAAWgF,GACvB,IAAIsB,EAAa,IACjB,GAAqB,iBAAVtB,EACVsB,EAAM,8BAA8BtB,UAC9B,CAKN,GAJKA,EAAOuB,OAAQvB,EAAOuB,KAAO,IAC9BvB,EAAOwB,SACVxB,EAAOuB,KAAKE,QAAQzB,EAAOwB,SAEF,GAAtBxB,EAAOuB,KAAKG,OAAe,OAE/BJ,EAAMtB,EAAOuB,KAAKI,KAAK,K,OAGlBpG,KAAK2B,MAAM0E,QAASrG,KAAK0B,KAAKkD,GAAG,YAAamB,GAAK1B,YAC1D,GAjIY9C,E,mUAAmB,EAD/B,EAAApB,W,kIAW4B,KAA2B,IAAyB,EAAAmG,KAAqB,IAAkC,IAAmC,EAAAC,gBAA6C,IAAyC,OAVpPhF,E","sources":["webpack://client-app/./src/app/administration/classifications/classifications-list.scss","webpack://client-app/./src/app/administration/classifications/view-classification.scss","webpack://client-app/./src/app/administration/browse-ao/browse-ao.html","webpack://client-app/./src/app/administration/classifications/classifications-list.html","webpack://client-app/./src/app/administration/classifications/view-classification.html","webpack://client-app/./config/environment.json","webpack://client-app/./src/app-settings.json","webpack://client-app/./src/app/administration/browse-ao/browse-ao.ts","webpack://client-app/./src/app/administration/classifications/view-classification.ts","webpack://client-app/./src/app/administration/classifications/classifications-list.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, `.classifications-list .headers{grid-template-columns:1fr}.classifications-list .main .element{grid-template-columns:1fr}.classifications-list .cell-wrapper{display:grid;grid-template-columns:1fr}.classifications-list .cell-wrapper div .space_trash{margin-right:20px !important}`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/app/administration/classifications/classifications-list.scss\"],\"names\":[],\"mappings\":\"AAWC,+BACC,yBAPsB,CAUtB,qCACC,yBAXqB,CAetB,oCACC,YAAA,CACA,yBAjBqB,CAmBpB,qDACC,4BAAA\",\"sourcesContent\":[\"@import \\\"src/resources/customized-styles/variables\\\";\\r\\n\\r\\n//$grid-template-columns: minmax(400px, 1fr) auto;\\r\\n//$grid-template-columns--header: calc(16px + #{$gutter} * 2) $grid-template-columns;\\r\\n//$grid-template-columns--element: calc(16px + #{$gutter} * 2) minmax(200px, 1fr);\\r\\n$grid-template-columns: 1fr;\\r\\n$grid-template-columns--header: $grid-template-columns;\\r\\n$grid-template-columns--element: $grid-template-columns;\\r\\n$grid-template-columns--element-values: $grid-template-columns;\\r\\n\\r\\n.classifications-list {\\t\\r\\n\\t.headers {\\r\\n\\t\\tgrid-template-columns: $grid-template-columns--header;\\r\\n\\t}\\r\\n\\t.main {\\r\\n\\t\\t.element {\\r\\n\\t\\t\\tgrid-template-columns: $grid-template-columns--element;\\r\\n\\t\\t}\\r\\n\\t}\\t\\r\\n\\t.cell {\\r\\n\\t\\t&-wrapper {\\r\\n\\t\\t\\tdisplay: grid;\\r\\n\\t\\t\\tgrid-template-columns: $grid-template-columns--element-values;\\r\\n\\t\\t\\tdiv {\\r\\n\\t\\t\\t\\t.space_trash {\\r\\n\\t\\t\\t\\t\\tmargin-right: 20px !important;\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\\r\\n\\r\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// 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, `ux-dialog.view-classification{height:90vh;padding:15px 15px 0px 15px}ux-dialog.view-classification ux-dialog-body{min-height:0px}ux-dialog.view-classification ux-dialog-body div.scroll-list{overflow-y:scroll;padding-left:15px;padding-right:15px}ux-dialog.view-classification ux-dialog-footer{padding-left:0px !important;padding-right:0px !important}ux-dialog.view-classification .dialog-header-content{padding-right:0px !important;padding-bottom:10px}`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/app/administration/classifications/view-classification.scss\"],\"names\":[],\"mappings\":\"AACA,8BACI,WAAA,CASH,0BAAA,CARA,6CACC,cAAA,CACA,6DAAA,iBAAA,CACC,iBAAA,CACA,kBAAA,CAMF,+CACC,2BAAA,CACA,4BAAA,CAED,qDACC,4BAAA,CACA,mBAAA\",\"sourcesContent\":[\"\\r\\nux-dialog.view-classification { // NB: ux-dialog er flex(column), men det rører jeg ikke direkte ved, jeg PÅVIRKER det bare med min-height på dialog-body!\\r\\n height: 90vh;\\r\\n\\tux-dialog-body {\\t\\t\\r\\n\\t\\tmin-height: 0px; //flex-grow: 1; //flex-shrink: 1; //flex-basis: 0;\\r\\n\\t\\tdiv.scroll-list { overflow-y: scroll; \\r\\n\\t\\t\\tpadding-left: 15px;\\r\\n\\t\\t\\tpadding-right: 15px;\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tpadding: 15px 15px 0px 15px; \\r\\n\\r\\n\\tux-dialog-footer { // JG: I shouldn't do that, I'm fighting bootstrap here.\\r\\n\\t\\tpadding-left: 0px !important;\\r\\n\\t\\tpadding-right: 0px !important;\\r\\n\\t}\\r\\n\\t.dialog-header-content { // JG: I shouldn't do that, I'm fighting bootstrap here.\\r\\n\\t\\tpadding-right: 0px !important;\\r\\n\\t\\tpadding-bottom: 10px;\\r\\n\\t}\\t\\r\\n}\\r\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","module.exports = \"\\r\\n\";","module.exports = \"\\r\\n\";","module.exports = \"\\r\\n\";","module.exports = {\"debug\":false,\"testing\":false,\"env_src\":\"prod_env\",\"bimviewerUrl\":\"https://bimviewer-prod.azurewebsites.net\",\"azureWebJobsUrl\":\"https://bg-worker-wa.azurewebsites.net\",\"azureWebJobsUrl2\":\"https://bg-worker-wa.azurewebsites.net\",\"azureFunctionsUrl\":\"https://prod-my-function-app-name.azurewebsites.net\",\"azureFunctionsUrl2\":\" https://my-function-app-name.azurewebsites.net/api/HttpTrigger1?code=IcCm7U7iTllCxPfGo7TxBJ_nupiL79sO3zPaKqUk1bmTAzFub7R9YQ==\",\"azureFunctionsUrl3\":\" https://my-function-app-name.azurewebsites.net\",\"not\":\"https://localhost:5300\"}","module.exports = {\"devApiUrl\":\"http://localhost:5000\",\"ajour\":{\"phone\":\"+45 7020 0409\",\"email\":\"mail@ajoursystem.dk\",\"website\":\"https://ajoursystem.com\",\"logoWhiteUrl\":\"/images/ajour_white.png\"},\"eg\":{\"phone\":\"+45 72602060\",\"email\":\"mail@ajoursystem.dk\",\"website\":\"https://eg.dk/it/eg-collab/\",\"logoWhiteUrl\":\"/images/EG-Collab-White.svg\"},\"language\":\"en\",\"externalUrls\":{\"signUp\":\"https://signup.ajourobjects.com/Users/Signup\",\"imageServer\":\"https://signup.ajourobjects.com/manu2\"},\"manufacturerOrgId\":\"00000000-feed-dada-1ced-c0ffee000000\",\"version\":\"1.0.0.58\"}","import { ObjectListBuilder, ObjectListSourceStrategy } from 'app/services/object-list/object-list-builder';\r\nimport { ObjectListManager } from 'app/services/object-list/object-list-manager';\r\nimport { autoinject } from 'aurelia-framework';\r\nimport { AppContextService } from '../../services/app-context-service';\r\n\r\n@autoinject\r\nexport class BrowseAO {\r\n public searchActivated: boolean = true;\r\n public objects: ObjectListManager | undefined;\r\n //public filters:Object[];\r\n\r\n constructor(\r\n\t objListBuilder: ObjectListBuilder,\r\n\t private appContext: AppContextService\r\n ) {\r\n\t console.log('BrowseAO-ctor');\r\n\t let orgId: string =\r\n\t\t (appContext.currentUser ? appContext.currentUser.organization.id : 'no-user-logged-in in browse-ao');\r\n\t if (!appContext.currentUser) { console.warn('browse-ao, no user logged in', appContext); }\r\n\r\n\t let strategy: ObjectListSourceStrategy | undefined = objListBuilder.ForAjourObjects_OLB(orgId);\r\n if (strategy) {\r\n this.objects = strategy.BuildServerSide(); \r\n }\r\n }\r\n\r\n\r\n /*\r\n Hvad var det nu, alt det her nedenfor har forsøgt at gøre, hvis det var aktivt..?\r\n\r\n async activate(params): Promise {\r\n if (Boolean(params) && Boolean(params.typeName) && Boolean(params.typeId)) { \r\n this.activateSearch(); \r\n this.objects.initialize(); \r\n let typeFilter = this.objects.columns.static.find(x => x.targetType === ObjectValues.targetTypes.type);\r\n if(!Boolean(typeFilter)) return;\r\n typeFilter.value = params.typeName;\r\n typeFilter.value = params.typeId;\r\n typeFilter.selectedComparisonOption = ObjectValues.comparisonMethods.hasRelation;\r\n typeFilter.selectedSortingOption = ObjectValues.sortingMethods.ascending;\r\n typeFilter.isLocked = true;\r\n typeFilter.hide = true;\r\n await this.objects.columns.setMainSearchFilter(typeFilter);\r\n await this.objects.showAsDeck();\r\n if (this.objects.shownItems.length != 1){ \r\n //This depends on a single result from the id based typeFilter\r\n // console.log(\"Error: result from id based type filter was not 1 when presenting object sharelink\");\r\n } \r\n let row = this.objects.shownItems[0]; \r\n if(Boolean(row)) { \r\n row.value[\"typeName\"] = params.typeName;\r\n row.value[\"typeId\"] = params.typeId;\r\n \t\t console.log('browse-ao presents row:', row);\r\n this.modal.OpenModal(ObjectPresentation, { type: row.value, filters: this.objects.columns.applied });\r\n }\r\n }\r\n }\r\n\r\n // again, WHY are we doing all this?\r\n private getFamilyFilters(objectType: ObjectDetails, filters: ObjectFilter[]): ObjectFilter[]{\r\n let familyFilters = [...filters];\r\n let familyFilter = filters.find(x => x.targetType == ObjectValues.targetTypes.family);\r\n let manufacturerFilter = filters.find(x => x.targetType == ObjectValues.targetTypes.manufacturer);\r\n if(!Boolean(familyFilter)){\r\n familyFilter = ObjectValues.staticFiltersAll.find(x => x.targetType == ObjectValues.targetTypes.family);\r\n }\r\n if(!Boolean(manufacturerFilter)){\r\n manufacturerFilter = ObjectValues.staticFiltersAll.find(x => x.targetType == ObjectValues.targetTypes.manufacturer);\r\n }\r\n this.replaceFilter(familyFilter, objectType.familyId, familyFilters);\r\n this.replaceFilter(manufacturerFilter, objectType.manufacturerId, familyFilters);\r\n return familyFilters;\r\n }\r\n\r\n // this is a helper for getFamilyFilters: (what does 'replaceFilter' do?)\r\n private replaceFilter(filter: ObjectFilter, targetId: string, familyFilters: ObjectFilter[]){\r\n let copy = Object.assign({}, filter);\r\n copy.selectedComparisonOption = ObjectValues.comparisonMethods.hasRelation;\r\n copy.value = targetId;\r\n if (!Boolean(copy.selectedSortingOption)){\r\n copy.selectedSortingOption = ObjectValues.sortingMethods.ascending;\r\n }\r\n let index = familyFilters.indexOf(filter);\r\n if(index < 0)\r\n familyFilters.unshift(copy);\r\n else\r\n familyFilters.splice(index, 1, copy);\r\n }\r\n \r\n public activateSearch() {\r\n this.searchActivated = !this.searchActivated;\r\n } \r\n */ \r\n}\r\n","import { autoinject } from 'aurelia-framework';\r\nimport { DialogController } from 'aurelia-dialog';\r\nimport { ApiClient } from 'app/services/api-client';\r\nimport { ClassificationModel, NodeModel } from 'app/components/object/object-grid/cell/tree-node';\r\nimport { ClassificationDto } from 'app/models/project-dto';\r\n\r\nimport { PLATFORM } from 'aurelia-pal';\r\nimport { useView } from 'aurelia-framework';\r\nimport { AppContextService } from 'app/services/app-context-service';\r\n\r\n@useView(PLATFORM.moduleName('app/administration/classifications/view-classification.html'))\r\n@autoinject\r\nexport class ViewClassification {\r\n\tmodel:ClassificationDto | undefined;\r\n\tclassification:ClassificationModel | undefined;\r\n\tnodes : NodeModel[] = [];\r\n\r\n\tconstructor(private api: ApiClient, protected dialog: DialogController, private appContext: AppContextService) { console.log('ViewClassification.ctor'); }\r\n\tasync activate(model:ClassificationDto) { \r\n\t\tconsole.log('ViewClassification.activate, model:', model); \r\n\t\tthis.model = model; \r\n\t\tawait this.getClassificationFromServer();\r\n\t} \r\n\r\n\tasync getClassificationFromServer() {\r\n\t\tlet clId = this.model?.id;\t\t\r\n\t\tconst currentUser_OrgId = this.appContext.currentUserOrgId(); // this.api.appContext.currentUser?.organization.id;\r\n\t\tlet cm:ClassificationModel = await this.api.orgByToken(currentUser_OrgId).get(`Classification/GetClassificationNodes/${clId}`).jsonResult(); \r\n\t\t\r\n\t\tthis.classification = ClassificationModel.BuildFromServer(cm);\r\n\t\tthis.nodes = this.classification.nodes;\r\n\t}\r\n\r\n}\r\n","import { json } from 'aurelia-fetch-client';\r\nimport { ListService, SortResult } from '../../services/list-service';\r\nimport { ApiClient } from 'app/services/api-client';\r\nimport { Router } from 'aurelia-router';\r\nimport { autoinject } from \"aurelia-framework\";\r\nimport {ClassificationDto, ClassificationList} from \"app/models/project-dto\";\r\nimport { EventAggregator, Subscription } from 'aurelia-event-aggregator';\r\nimport { ContextMenuService } from 'app/services/context-menu-service';\r\nimport {ModalService} from \"../../services/modal-service\";\r\nimport {ClassificationUpload} from \"../../components/file-upload/specific-uploads/classification-upload\";\r\nimport {ImportClassificationModel} from \"../../models/viewmodels/import-classification-model\";\r\nimport {I18N} from \"aurelia-i18n\";\r\nimport {AppContextService} from \"../../services/app-context-service\";\r\nimport { DialogCancellableOpenResult, DialogCloseResult } from 'aurelia-dialog';\r\nimport { ViewClassification } from './view-classification';\r\n\r\n@autoinject\r\nexport class ClassificationsList {\r\n\tpublic classifications: ClassificationList[] = [];\r\n\tpublic selectedClassifications: ClassificationList[] = [];\r\n\tpublic allSelected: boolean = false;\r\n\tpublic column: string = \"name\";\r\n\tpublic displayState: { icon: string, direction: string } | undefined;\r\n\tpublic searchTerm: string = \"\";\r\n\tpublic viewContext: string;\r\n\tpublic isSuperAdmin: boolean = false;\r\n\tprivate subscriptions: Subscription[] = [];\r\n\tconstructor(private router: Router, private apiClient: ApiClient, private i18n: I18N, private modal: ModalService, private appContext: AppContextService, private events: EventAggregator, private contextMenuService: ContextMenuService, private listService: ListService) {\r\n\t\tthis.viewContext = \"TopBar\";\r\n\t}\r\n\tasync activate() {\r\n\t\tawait this.fetchClassifications();\r\n\t\tthis.displayState = { icon: \"fa-sort-up\", direction: \"ascending\" };\r\n\r\n\t\tconst searchHandler = (data: any) => this.handleSearchEvent(data);\r\n\t\tthis.subscriptions = [\r\n\t\t\tthis.events.subscribe(this.viewContext + \":SearchTermChanged\", searchHandler),\r\n\t\t\tthis.events.subscribe(\"global:org-changed\", async () => this.reloadPage())\r\n\r\n\t\t];\r\n\t\tthis.isSuperAdmin = this.appContext?.currentUser?.roles.includes(\"AOC_SuperAdmin\") ? this.appContext?.currentUser?.roles.includes(\"AOC_SuperAdmin\") : false;\r\n\t\t\r\n\t}\r\n\tasync reloadPage(): Promise {\r\n\t\tawait this.fetchClassifications();\r\n\t}\r\n\t\r\n\tdetached() { this.subscriptions.forEach(subscription => ( subscription.dispose() )); }\r\n\tprivate async fetchClassifications(){\r\n\t\tconst currentUser_OrgId = this.appContext.currentUserOrgId(); // this.apiClient.appContext.currentUser?.organization.id;\r\n\t\tthis.classifications = await this.apiClient.orgByToken(currentUser_OrgId).get('Classification/GetClassifications').jsonResult();\r\n\t}\r\n\tprivate handleSearchEvent(data: string) { this.searchTerm = data; } \r\n\tpublic async sortBy(columnName: string) {\r\n\t\t/*\r\n\t\tawait this.listService.sortBy(columnName).then( (result:SortResult) => {\r\n\t\t\tthis.column = result.column;\r\n\t\t\tthis.displayState = result.displayState;\t\t\t \r\n\t\t});\r\n\t\t*/\r\n\t\tlet result:SortResult = await this.listService.sortBy(columnName);\r\n\t\tthis.column = result.column;\r\n\t\tthis.displayState = result.displayState;\r\n\t}\r\n\tpublic async toggleClassification() {\r\n\t\tlet result = await this.listService.toggleElement(this.classifications);\t\t\r\n\t\tthis.selectedClassifications = result.selected;\r\n\t\tthis.allSelected = result.allSelected;\r\n\t}\r\n\tpublic async toggleAll() {\r\n\t\tlet result = await this.listService.toggleAll(this.classifications);\r\n\t\tif (result) {\r\n\t\t\tthis.classifications = result.selected;\r\n\t\t\tthis.allSelected = result.allSelected;\r\n\t\t}\r\n\t}\r\n\r\n\tasync classificationClicked(c:ClassificationList) { this.viewClassification1(c); }\r\n\tasync viewClassification1(c:ClassificationDto) { this.modal.OpenModal(ViewClassification, c); }\r\n\r\n\tasync deleteClassificationClicked(c:ClassificationList):Promise {\r\n\t\tlet s = `Are you sure you want to delete classification ${c.name} ? (${c.id})`;\r\n\t\tlet dlg = await this.modal.OpenConfirm('Confirm Deletion',s).whenClosed();\r\n\t\tif (!dlg.wasCancelled) { await this.implDeleteClassification(c); }\r\n\t\treturn false; // true would propagate.\r\n\t}\r\n\r\n\tasync implDeleteClassification(c:ClassificationList) {\r\n\t\tlet path = `Classification/DeleteClassification/${c.id}`;\r\n\t\tconst currentUser_OrgId = this.appContext.currentUserOrgId(); // this.apiClient.appContext.currentUser?.organization.id;\r\n\r\n\t\tlet status = await this.apiClient.orgByToken(currentUser_OrgId).postJson(path, {}) \r\n\t\t .handleErrorUsingReason(this.i18n.tr('Error_Title_Generic'))\r\n\t\t .jsonResult(); \r\n\t\tconsole.log('delete status :', status);\r\n\t\t//await this.reportAnyError(status);//implDeleteClassification\r\n\t\t// we must update UI to not show the deleted item:\r\n\t\tthis.removeDeletedItemFromList(c);\r\n\t}\r\n\tremoveDeletedItemFromList(c: ClassificationList) {\r\n\t\tlet ix = this.classifications.indexOf(c);\r\n\t\tif (ix < 0) {return;} // give up.\r\n\t\tthis.classifications.splice(ix);\r\n\t}\r\n\r\n\tasync openImportModal() {\r\n\t\tlet x:DialogCloseResult = await this.modal.OpenModal(ClassificationUpload).whenClosed();\r\n\t\tif (!x.wasCancelled) { await this.doUpload(x.output); }\r\n\t}\r\n\r\n\tpublic async doUpload(model: ImportClassificationModel) {\r\n\t\tlet formData = new FormData();\r\n\t\tif (model.version != undefined && model.classificationType != undefined && model.files) {\r\n\t\t\tformData.append(\"Version\", model.version);\r\n\t\t\tformData.append(\"ClassificationType\", model.classificationType.toString());\r\n\t\t\tformData.append(\"File\", model.files[0]);\r\n\r\n\t\t\tconst currentUser_OrgId = this.appContext.currentUserOrgId(); // this.apiClient.appContext.currentUser?.organization.id;\r\n\t\t\tlet status:ImportStatus = await this.apiClient.orgByToken(currentUser_OrgId).postForm(\"Classification/UploadClassification\", formData)\r\n\t\t\t.handleErrorUsingReason(this.i18n.tr('Error_Title_Generic'))\r\n\t\t\t.jsonResult(); \r\n\t\t\tawait this.reportAnyError(status);//doUpload\r\n\r\n\t\t\tconsole.log('(reload classifs)');\r\n\t\t\tawait this.fetchClassifications();\r\n\t\t} else {\r\n\t\t\tconsole.log('doUpload, err, model was:', model);\r\n\t\t}\r\n\t}\r\n\r\n\tasync reportAnyError(status:ImportStatus) {\t\r\n\t\tconsole.log('status:', status);\r\n\t\tlet msg:string = '?';\r\n\t\tif (typeof status != 'object') { // JG: this is not a sufficient test, but it will do.\r\n\t\t\tmsg = `(not even an ImportStatus. ${status}) `;\r\n\t\t} else {\r\n\t\t\tif (!status.errs) { status.errs = []; }\r\n\t\t\tif (status.Message) { // In case of exception\r\n\t\t\t\tstatus.errs.unshift(status.Message); \r\n\t\t\t}\r\n\t\t\tif (status.errs.length == 0) { return; }\r\n\r\n\t\t\tmsg = status.errs.join(\"\\n\");\r\n\t\t}\r\n\r\n\t\tawait this.modal.OpenLog( this.i18n.tr('Warnings'), msg).whenClosed();\t\r\n\t}\r\n}\r\n\r\nexport interface ImportStatus {\r\n\terrs:string[]; // should have length 0 on success.\r\n\tMessage: string; // in case of exception.\r\n}\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","exports","BrowseAO","constructor","objListBuilder","appContext","searchActivated","console","log","orgId","currentUser","organization","warn","strategy","ForAjourObjects_OLB","this","objects","BuildServerSide","autoinject","ViewClassification","api","dialog","nodes","activate","model","getClassificationFromServer","clId","currentUser_OrgId","currentUserOrgId","cm","orgByToken","get","jsonResult","classification","ClassificationModel","BuildFromServer","useView","DialogController","ClassificationsList","router","apiClient","i18n","modal","events","contextMenuService","listService","classifications","selectedClassifications","allSelected","column","searchTerm","isSuperAdmin","subscriptions","viewContext","fetchClassifications","displayState","icon","direction","subscribe","data","handleSearchEvent","async","reloadPage","roles","includes","detached","forEach","subscription","dispose","sortBy","columnName","result","toggleClassification","toggleElement","selected","toggleAll","classificationClicked","c","viewClassification1","OpenModal","deleteClassificationClicked","s","name","OpenConfirm","whenClosed","wasCancelled","implDeleteClassification","path","status","postJson","handleErrorUsingReason","tr","removeDeletedItemFromList","ix","indexOf","splice","openImportModal","x","doUpload","output","formData","FormData","undefined","version","classificationType","files","append","toString","postForm","reportAnyError","msg","errs","Message","unshift","length","join","OpenLog","I18N","EventAggregator"],"sourceRoot":""}