{"version":3,"sources":["webpack:///./src/views/pages/EntrancePlantDetail/EntrancePlantSettings/EntrancePlantStructure/DialogAddEditBuilding/DialogAddEditBuilding.scss?22c3","webpack:///./src/views/pages/EntrancePlantDetail/EntrancePlantSettings/EntrancePlantStructure/DialogAddEditBuilding/DialogAddEditBuilding.vue?6c8e","webpack:///./src/views/pages/EntrancePlantDetail/EntrancePlantSettings/EntrancePlantStructure/DialogAddEditBuilding/DialogAddEditBuilding.ts","webpack:///./src/views/pages/EntrancePlantDetail/EntrancePlantSettings/EntrancePlantStructure/DialogAddEditBuilding/DialogAddEditBuilding.vue"],"names":["_hoisted_1","class","_hoisted_2","_hoisted_3","_hoisted_4","style","_hoisted_5","_hoisted_6","for","_hoisted_7","_hoisted_8","key","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","render","_ctx","_cache","$props","$setup","$data","$options","_component_InputText","_component_ElScrollbar","_component_NumberButtons","_component_Dropdown","_component_Button","_component_Dialog","visible","isDialogVisible","$event","onHide","doHideDialog","modal","showHeader","closable","default","dialogTitle","brfaStep","inputLabel","id","type","isValidName","modelValue","building","name","verifyValidityOfName","invalidNameReason","isEdit","$t","validApartmentNumber","min","max","availableApartments","apartmentsCount","checkValidApartmentNumber","invalidNumberReason","_","risersCount","minValue","onIncrement","addRiser","onDecrement","removeRiser","rfaConfig","risers","riser","index","riserName","riserIndex","floorsCount","addFloor","removeFloor","floors","floor","floorIndex","floorName","isLast","floorLabel","options","apartmentCountValues","numberOfApartments","label","secondaryButtonLabel","onClick","handleSecondaryButtonAction","buttonSubmitLabel","disabled","saveButtonDisabled","handleButtonSubmitAction","isBrfa","newRisersNumber","this","isVisible","currentEntrancePlant","addressingType","BuildingRiserFloorApartment","buildingToEdit","buildingId","apartments","length","i","newName","buildings","$emit","disabledForNameCheck","trim","disabledForApartments","totalPlantApartments","reduce","acc","Array","keys","map","denominationRisers","denominationFloors","push","splice","pop","undefined","nameToCheck","listToCheck","filter","editing","exist","some","existing","toLowerCase","maxApartments","updateApartmentCountValues","lastStepFunction","handleHideDialog","$store","dispatch","saveBuilding","structure","buildingsCreate","forEach","epBuilding","editingIndex","findIndex","desktopId","editStructure","retrieveEditedStructure","entranceplantGET","lastModify","entrPlant","rfaStructure","newBuild","find","build","plantConfigStructure","$toast","add","severity","summary","life","console","log","setTimeout","props","Boolean","required","Object","computed","watch","newValue","initBuilding","components","NumberButtons","emits","__exports__"],"mappings":"gMAAA,W,iGCEMA,EAAa,CAAEC,MAAO,8BACtBC,EAAa,CAAED,MAAO,wBACtBE,EAAa,CAAEF,MAAO,sCACtBG,EAAa,CAAEC,MAAO,CAAC,MAAQ,QAAQ,OAAS,UAChDC,EAAa,CAAEL,MAAO,WACtBM,EAAa,CACjBN,MAAO,gBACPO,IAAK,gBAEDC,EAAa,CACjBD,IAAK,eACLP,MAAO,qBAEHS,EAAa,CACjBC,IAAK,EACLV,MAAO,WAEHW,EAAa,CACjBX,MAAO,gBACPO,IAAK,mBAEDK,EAAc,CAClBL,IAAK,kBACLP,MAAO,qBAEHa,EAAc,CAAEb,MAAO,gBACvBc,EAAc,CAAEd,MAAO,4BACvBe,EAAc,CAAEf,MAAO,iBACvBgB,EAAc,CAAEhB,MAAO,gBACvBiB,EAAc,CAAEjB,MAAO,4BACvBkB,EAAc,CAAElB,MAAO,iBACvBmB,EAAc,CAClBT,IAAK,EACLV,MAAO,WAEHoB,EAAc,CAAEpB,MAAO,WACvBqB,EAAc,CAAErB,MAAO,4BACvBsB,EAAc,CAClBlB,MAAO,CAAC,MAAQ,OAChBJ,MAAO,8BAEHuB,EAAc,CAAEvB,MAAO,WACvBwB,EAAc,CAClBd,IAAK,EACLV,MAAO,WAEHyB,EAAc,CAAEzB,MAAO,yBAEvB,SAAU0B,EAAOC,EAAUC,EAAYC,EAAYC,EAAYC,EAAWC,GAC9E,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,CACdC,SAAU,QACVC,QAAS,QACTxH,UAAU,EACVyH,KAAM,QAEP,MA5CP,0DA9SF,8DAAmD,QAA9B,EAAqB,gBAtCzC,eAAQ,CACP/G,KAAM,wBACNmH,MAAO,CACLnE,UAAW,CACTpD,KAAMwH,QACNC,UAAU,GAEZjE,eAAgB,CACdxD,KAAM0H,OACND,UAAU,IAGdE,SAAU,kBACL,eAAS,CAAC,0BAEfC,MAAO,CACLxE,UAAW,SAAUyE,GACnB1E,KAAK/D,gBAAkByI,EACnB1E,KAAK/D,kBACP+D,KAAK7C,kBAAoB,GACzB6C,KAAKlD,aAAc,EACnBkD,KAAKtD,SAAW,EAChBsD,KAAK5B,UAAUC,OAAS,GACxB2B,KAAK2E,iBAGT,2BAA4B,WAC1B3E,KAAKrC,6BAEP,gBAAiB,WACXqC,KAAKhD,UACPgD,KAAK9C,yBAIX0H,WAAY,CAAEC,gBAAA,MACdC,MAAO,CAAC,cAAe,kBAEJ,W,iCClDrB,MAAMC,EAA2B,IAAgB,EAAQ,CAAC,CAAC,SAAS5J,KAErD","file":"js/page-entranceplant-settings~page-entranceplant-structure~page-entranceplant-structure-building.ddad5420.js","sourcesContent":["export * from \"-!../../../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!./DialogAddEditBuilding.scss?vue&type=style&index=0&lang=scss\"","import { toDisplayString as _toDisplayString, createVNode as _createVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, withCtx as _withCtx, renderList as _renderList, Fragment as _Fragment } from \"vue\"\n\nconst _hoisted_1 = { class: \"dialog-custom__header mb-4\" }\nconst _hoisted_2 = { class: \"dialog-custom__title\" }\nconst _hoisted_3 = { class: \"dialog-custom__content form-custom\" }\nconst _hoisted_4 = { style: {\"width\":\"450px\",\"height\":\"355px\"} }\nconst _hoisted_5 = { class: \"p-field\" }\nconst _hoisted_6 = {\n class: \"p-field-label\",\n for: \"buildingname\"\n}\nconst _hoisted_7 = {\n for: \"buildingname\",\n class: \"fs-13 label-error\"\n}\nconst _hoisted_8 = {\n key: 0,\n class: \"p-field\"\n}\nconst _hoisted_9 = {\n class: \"p-field-label\",\n for: \"apartmentnumber\"\n}\nconst _hoisted_10 = {\n for: \"apartmentnumber\",\n class: \"fs-13 label-error\"\n}\nconst _hoisted_11 = { class: \"p-field mb-4\" }\nconst _hoisted_12 = { class: \"d-flex align-items-start\" }\nconst _hoisted_13 = { class: \"p-field-label\" }\nconst _hoisted_14 = { class: \"p-field mb-4\" }\nconst _hoisted_15 = { class: \"d-flex align-items-start\" }\nconst _hoisted_16 = { class: \"p-field-label\" }\nconst _hoisted_17 = {\n key: 0,\n class: \"hr my-4\"\n}\nconst _hoisted_18 = { class: \"p-field\" }\nconst _hoisted_19 = { class: \"d-flex align-items-start\" }\nconst _hoisted_20 = {\n style: {\"width\":\"30%\"},\n class: \"p-field-label pl-2 ml-auto\"\n}\nconst _hoisted_21 = { class: \"p-field\" }\nconst _hoisted_22 = {\n key: 0,\n class: \"hr my-4\"\n}\nconst _hoisted_23 = { class: \"dialog-custom__footer\" }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_InputText = _resolveComponent(\"InputText\")\n const _component_ElScrollbar = _resolveComponent(\"ElScrollbar\")\n const _component_NumberButtons = _resolveComponent(\"NumberButtons\")\n const _component_Dropdown = _resolveComponent(\"Dropdown\")\n const _component_Button = _resolveComponent(\"Button\")\n const _component_Dialog = _resolveComponent(\"Dialog\")\n\n return (_openBlock(), _createBlock(_component_Dialog, {\n visible: _ctx.isDialogVisible,\n \"onUpdate:visible\": _cache[3] || (_cache[3] = ($event: any) => (_ctx.isDialogVisible = $event)),\n onHide: _ctx.doHideDialog,\n modal: true,\n showHeader: false,\n closable: false,\n class: \"dialog-custom\"\n }, {\n default: _withCtx(() => [\n _createVNode(\"header\", _hoisted_1, [\n _createVNode(\"h1\", _hoisted_2, _toDisplayString(_ctx.dialogTitle), 1)\n ]),\n _createVNode(\"div\", _hoisted_3, [\n _createVNode(\"div\", _hoisted_4, [\n (_ctx.brfaStep === 0)\n ? (_openBlock(), _createBlock(_component_ElScrollbar, {\n key: 0,\n class: \"dialog-scroll\"\n }, {\n default: _withCtx(() => [\n _createVNode(\"div\", _hoisted_5, [\n _createVNode(\"label\", _hoisted_6, _toDisplayString(_ctx.inputLabel), 1),\n _createVNode(_component_InputText, {\n id: \"buildingname\",\n type: \"text\",\n class: [\"w-100\", { 'input-error': !_ctx.isValidName }],\n modelValue: _ctx.building.name,\n \"onUpdate:modelValue\": [\n _cache[1] || (_cache[1] = ($event: any) => (_ctx.building.name = $event)),\n _ctx.verifyValidityOfName\n ]\n }, null, 8, [\"modelValue\", \"class\", \"onUpdate:modelValue\"]),\n _createVNode(\"label\", _hoisted_7, _toDisplayString(_ctx.invalidNameReason), 1)\n ]),\n (!_ctx.isEdit)\n ? (_openBlock(), _createBlock(\"div\", _hoisted_8, [\n _createVNode(\"label\", _hoisted_9, _toDisplayString(_ctx.$t(\"AppResourceEP.Apartments\")), 1),\n _createVNode(_component_InputText, {\n id: \"apartmentnumber\",\n type: \"number\",\n class: [\"w-50\", { 'input-error': !_ctx.validApartmentNumber }],\n min: \"1\",\n max: _ctx.availableApartments,\n modelValue: _ctx.building.apartmentsCount,\n \"onUpdate:modelValue\": [\n _cache[2] || (_cache[2] = ($event: any) => (_ctx.building.apartmentsCount = $event)),\n _ctx.checkValidApartmentNumber\n ]\n }, null, 8, [\"max\", \"modelValue\", \"class\", \"onUpdate:modelValue\"]),\n _createVNode(\"label\", _hoisted_10, _toDisplayString(_ctx.invalidNumberReason), 1)\n ]))\n : _createCommentVNode(\"\", true)\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (_ctx.brfaStep === 1)\n ? (_openBlock(), _createBlock(_Fragment, { key: 1 }, [\n _createVNode(\"div\", _hoisted_11, [\n _createVNode(\"span\", _hoisted_12, [\n _createVNode(\"label\", null, _toDisplayString(`${_ctx.$t(\"AppResourceEP.Risers\")} ${\n _ctx.building.name\n }`), 1),\n _createVNode(_component_NumberButtons, {\n class: \"ml-auto\",\n modelValue: _ctx.risersCount,\n minValue: 1,\n onIncrement: _ctx.addRiser,\n onDecrement: _ctx.removeRiser\n }, null, 8, [\"modelValue\", \"onIncrement\", \"onDecrement\"])\n ])\n ]),\n _createVNode(_component_ElScrollbar, {\n class: \"dialog-scroll\",\n style: {\"height\":\"90%\"}\n }, {\n default: _withCtx(() => [\n (_openBlock(true), _createBlock(_Fragment, null, _renderList(_ctx.rfaConfig.risers, (riser, index) => {\n return (_openBlock(), _createBlock(\"div\", {\n key: index,\n class: \"p-field\"\n }, [\n _createVNode(\"label\", _hoisted_13, _toDisplayString(_ctx.riserName(index + 1)), 1),\n _createVNode(_component_InputText, {\n type: \"text\",\n class: \"w-50\",\n modelValue: riser.name,\n \"onUpdate:modelValue\": ($event: any) => (riser.name = $event)\n }, null, 8, [\"modelValue\", \"onUpdate:modelValue\"])\n ]))\n }), 128))\n ]),\n _: 1\n })\n ], 64))\n : _createCommentVNode(\"\", true),\n (_ctx.brfaStep === 2)\n ? (_openBlock(), _createBlock(_component_ElScrollbar, {\n key: 2,\n class: \"dialog-scroll\"\n }, {\n default: _withCtx(() => [\n (_openBlock(true), _createBlock(_Fragment, null, _renderList(_ctx.rfaConfig.risers, (riser, riserIndex) => {\n return (_openBlock(), _createBlock(_Fragment, { key: riserIndex }, [\n _createVNode(\"div\", _hoisted_14, [\n _createVNode(\"span\", _hoisted_15, [\n _createVNode(\"label\", null, _toDisplayString(`${_ctx.$t(\"AppResourceEP.Floors\")} ${\n riser.name\n }`), 1),\n _createVNode(_component_NumberButtons, {\n class: \"ml-auto\",\n modelValue: _ctx.floorsCount(riser),\n minValue: 1,\n onIncrement: ($event: any) => (_ctx.addFloor(riser)),\n onDecrement: ($event: any) => (_ctx.removeFloor(riser))\n }, null, 8, [\"modelValue\", \"onIncrement\", \"onDecrement\"])\n ])\n ]),\n _createVNode(\"div\", null, [\n (_openBlock(true), _createBlock(_Fragment, null, _renderList(riser.floors, (floor, floorIndex) => {\n return (_openBlock(), _createBlock(\"div\", {\n key: floorIndex,\n class: \"p-field mt-3\"\n }, [\n _createVNode(\"label\", _hoisted_16, _toDisplayString(_ctx.floorName(floorIndex + 1)), 1),\n _createVNode(_component_InputText, {\n type: \"text\",\n class: \"w-50\",\n modelValue: floor.name,\n \"onUpdate:modelValue\": ($event: any) => (floor.name = $event)\n }, null, 8, [\"modelValue\", \"onUpdate:modelValue\"])\n ]))\n }), 128))\n ]),\n (_ctx.isLast(riserIndex))\n ? (_openBlock(), _createBlock(\"hr\", _hoisted_17))\n : _createCommentVNode(\"\", true)\n ], 64))\n }), 128))\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (_ctx.brfaStep === 3)\n ? (_openBlock(), _createBlock(_component_ElScrollbar, {\n key: 3,\n class: \"dialog-scroll\"\n }, {\n default: _withCtx(() => [\n (_openBlock(true), _createBlock(_Fragment, null, _renderList(_ctx.rfaConfig.risers, (riser, riserIndex) => {\n return (_openBlock(), _createBlock(_Fragment, { key: riserIndex }, [\n _createVNode(\"div\", _hoisted_18, [\n _createVNode(\"h6\", null, _toDisplayString(riser.name), 1),\n _createVNode(\"span\", _hoisted_19, [\n _createVNode(\"label\", _hoisted_20, _toDisplayString(_ctx.$t(\"AppResourceEP.Apartments\")), 1)\n ])\n ]),\n _createVNode(\"div\", null, [\n (_openBlock(true), _createBlock(_Fragment, null, _renderList(riser.floors, (floor, floorIndex) => {\n return (_openBlock(), _createBlock(\"span\", {\n key: floorIndex,\n class: \"d-flex align-items-center\"\n }, [\n _createVNode(\"div\", _hoisted_21, [\n _createVNode(\"label\", null, _toDisplayString(_ctx.floorLabel(\n floor,\n floorIndex + 1\n )), 1)\n ]),\n _createVNode(_component_Dropdown, {\n style: {\"width\":\"30%\"},\n class: \"apartment__count ml-auto\",\n options: _ctx.apartmentCountValues,\n modelValue: floor.numberOfApartments,\n \"onUpdate:modelValue\": ($event: any) => (floor.numberOfApartments = $event)\n }, null, 8, [\"options\", \"modelValue\", \"onUpdate:modelValue\"])\n ]))\n }), 128))\n ]),\n (_ctx.isLast(riserIndex))\n ? (_openBlock(), _createBlock(\"hr\", _hoisted_22))\n : _createCommentVNode(\"\", true)\n ], 64))\n }), 128))\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true)\n ])\n ]),\n _createVNode(\"footer\", _hoisted_23, [\n _createVNode(_component_Button, {\n class: \"p-button-text mr-2\",\n label: _ctx.secondaryButtonLabel,\n onClick: _ctx.handleSecondaryButtonAction\n }, null, 8, [\"label\", \"onClick\"]),\n _createVNode(_component_Button, {\n class: \"p-button-rounded p-button-raised p-button--m\",\n label: _ctx.buttonSubmitLabel,\n disabled: _ctx.saveButtonDisabled,\n onClick: _ctx.handleButtonSubmitAction\n }, null, 8, [\"label\", \"disabled\", \"onClick\"])\n ])\n ]),\n _: 1\n }, 8, [\"visible\", \"onHide\"]))\n}","import {\n AddressingType,\n BuildingCreateDTO,\n BuildingDTO,\n EntrancePlantDetailDTO,\n EntrancePlantStructureCreateDTO,\n FloorConfigDTO,\n RFAConfigDTO,\n RiserConfigDTO,\n} from '@/../client-generator/generated-clients/plants';\nimport plantsClient from '@/core/services/plants';\nimport { SET_APP_LOADING } from '@/core/store/action-types';\nimport { toLabel } from '@/core/utils/EntrancePlant/denomination-helper';\nimport { distributeApartmentsToRaisersAndFloors } from '@/core/utils/EntrancePlant/entrance-plant.utils';\nimport NumberButtons from '@/views/components/NumberButtons/NumberButtons.vue';\nimport { PropType } from 'vue';\nimport { Options, Vue } from 'vue-class-component';\nimport { mapState } from 'vuex';\n\n@Options({\n name: 'DialogAddEditBuilding',\n props: {\n isVisible: {\n type: Boolean,\n required: true,\n },\n buildingToEdit: {\n type: Object as PropType,\n required: false,\n },\n },\n computed: {\n ...mapState(['currentEntrancePlant']),\n },\n watch: {\n isVisible: function (newValue) {\n this.isDialogVisible = newValue;\n if (this.isDialogVisible) {\n this.invalidNameReason = '';\n this.isValidName = true;\n this.brfaStep = 0;\n this.rfaConfig.risers = [];\n this.initBuilding();\n }\n },\n \"building.apartmentsCount\": function () {\n this.checkValidApartmentNumber();\n },\n 'building.name': function () {\n if (this.building) {\n this.verifyValidityOfName();\n }\n },\n },\n components: { NumberButtons },\n emits: ['hide-dialog', 'update-list'],\n})\nexport default class DialogAddEditBuilding extends Vue {\n currentEntrancePlant!: EntrancePlantDetailDTO;\n isVisible!: boolean;\n buildingToEdit!: BuildingDTO;\n isDialogVisible = false;\n\n isEdit = false;\n building!: BuildingCreateDTO;\n\n // Naming validation props\n isValidName = true;\n invalidNameReason: string = '';\n\n isBrfa = false;\n brfaStep = 0;\n newRisersNumber = 1;\n rfaConfig: RFAConfigDTO = new RFAConfigDTO();\n apartmentCountValues: number[] = [1];\n validApartmentNumber = true;\n invalidNumberReason = '';\n\n mounted() {\n this.isDialogVisible = this.isVisible;\n this.isBrfa =\n this.currentEntrancePlant.addressingType ===\n AddressingType.BuildingRiserFloorApartment;\n }\n\n async initBuilding() {\n this.building = new BuildingCreateDTO();\n if (this.buildingToEdit) {\n this.isEdit = true;\n this.building.buildingId = this.buildingToEdit.buildingId;\n this.building.apartmentsCount = this.buildingToEdit.apartments?.length;\n this.building.name = this.buildingToEdit.name;\n } else {\n this.isEdit = false;\n let i = 0;\n do {\n i++;\n const newName = `${this.$t('AppResourceEP.Building')} ${\n this.currentEntrancePlant.buildings!.length + i\n }`;\n this.building.name = newName;\n this.verifyValidityOfName();\n } while (!this.isValidName);\n this.building.apartmentsCount = 1;\n }\n }\n\n handleHideDialog() {\n this.isDialogVisible = false;\n }\n\n doHideDialog() {\n this.$emit('hide-dialog');\n }\n\n get dialogTitle() {\n if (this.isEdit) return this.$t('AppResourceEP.RenameBuilding');\n return this.$t('AppResourceEP.AddNewBuilding');\n }\n\n get inputLabel() {\n return `${this.$t('AppResource.NameUpper')} ${this.$t(\n 'AppResourceEP.Building'\n )}`;\n }\n\n get buttonSubmitLabel() {\n if (!this.isBrfa || this.isEdit) return this.$t('AppResource.Save');\n\n if (this.brfaStep < 3) {\n return this.$t('AppResource.Continue');\n } else {\n return this.$t('AppResource.Save');\n }\n }\n\n get secondaryButtonLabel() {\n if (this.brfaStep > 0) {\n return this.$t('AppResource.Back');\n } else {\n return this.$t('AppResource.Cancel');\n }\n }\n\n get saveButtonDisabled() {\n const disabledForNameCheck =\n !this.isValidName || !this.building?.name?.trim();\n const disabledForApartments =\n !this.building?.apartmentsCount || !this.validApartmentNumber;\n return disabledForNameCheck || disabledForApartments;\n }\n\n get availableApartments() {\n const totalPlantApartments = this.currentEntrancePlant.buildings?.reduce(\n (acc, building) => acc + building.apartments?.length!,\n 0\n ) || 0;\n return 3999 - totalPlantApartments;\n }\n\n get risersCount() {\n if (!this.rfaConfig || !this.rfaConfig.risers) return 0;\n return this.rfaConfig.risers.length;\n }\n\n updateApartmentCountValues() {\n if (this.isBrfa)\n this.apartmentCountValues = [\n ...Array(this.building.apartmentsCount).keys(),\n ].map((i) => i + 1);\n }\n\n riserName(index: number) {\n return `${this.$t('AppResourceEP.Name')} ${this.$t(\n 'AppResourceEP.Riser'\n )} ${toLabel(index, this.currentEntrancePlant.denominationRisers)}`;\n }\n\n floorsCount(riser: RiserConfigDTO) {\n if (!riser.floors) return 0;\n return riser.floors.length;\n }\n\n floorName(index: number) {\n return `${this.$t('AppResourceEP.Name')} ${this.$t(\n 'AppResourceEP.Floor'\n )} ${toLabel(index, this.currentEntrancePlant.denominationFloors)}`;\n }\n\n floorLabel(floor: FloorConfigDTO, index: number) {\n let label = `${this.$t('AppResourceEP.Floor')} ${toLabel(\n index,\n this.currentEntrancePlant.denominationFloors\n )}`;\n\n if (floor.name !== label) {\n label += ` - ${floor.name}`;\n }\n\n return label;\n }\n\n addRiser() {\n if (!this.rfaConfig) return;\n if (!this.rfaConfig.risers) this.rfaConfig.risers = [];\n\n const riserName = `${this.$t('AppResourceEP.Riser')} ${toLabel(\n this.risersCount + 1,\n this.currentEntrancePlant.denominationRisers\n )}`;\n\n const riser = new RiserConfigDTO({\n index: this.risersCount + 1,\n name: riserName,\n });\n\n this.addFloor(riser);\n this.rfaConfig.risers.push(riser);\n distributeApartmentsToRaisersAndFloors(this.rfaConfig);\n }\n\n removeRiser() {\n if (!this.rfaConfig || !this.rfaConfig.risers) return;\n this.rfaConfig.risers.splice(this.rfaConfig.risers.length - 1, 1);\n }\n\n isLast(riserIndex: number) {\n if (!this.rfaConfig || !this.rfaConfig.risers) return false;\n return riserIndex + 1 !== this.rfaConfig.risers.length;\n }\n\n addFloor(riser: RiserConfigDTO) {\n if (!riser.floors) riser.floors = [];\n\n const floorIndex = riser.floors.length + 1;\n const floorName = `${this.$t('AppResourceEP.Floor')} ${toLabel(\n floorIndex,\n this.currentEntrancePlant.denominationFloors\n )}`;\n\n riser.floors.push(\n new FloorConfigDTO({\n index: floorIndex,\n name: floorName,\n numberOfApartments: 1,\n })\n );\n\n if (!this.rfaConfig || this.rfaConfig.risers?.length === 0) return;\n distributeApartmentsToRaisersAndFloors(this.rfaConfig);\n }\n\n removeFloor(riser: RiserConfigDTO) {\n if (!riser.floors) return;\n riser.floors.pop();\n distributeApartmentsToRaisersAndFloors(this.rfaConfig);\n }\n\n verifyValidityOfName() {\n if (this.building?.name === undefined) return;\n\n const nameToCheck = this.building.name.trim();\n let listToCheck = this.currentEntrancePlant.buildings || [];\n\n if (this.isEdit) {\n listToCheck = listToCheck.filter(\n (editing) => editing.buildingId !== this.buildingToEdit.buildingId\n );\n }\n\n const exist = listToCheck.some(\n (existing) =>\n existing.name?.toLowerCase().trim() == nameToCheck.toLowerCase().trim()\n );\n this.isValidName = !exist;\n this.invalidNameReason = this.isValidName\n ? ''\n : this.$t('general.alreadyExisting');\n }\n\n checkValidApartmentNumber() {\n this.validApartmentNumber = this.building.apartmentsCount! <= this.availableApartments\n this.invalidNumberReason = this.validApartmentNumber ? '' : this.$t('entrancePlant.apartmentLimitReached', { maxApartments: 3999 });\n this.updateApartmentCountValues();\n }\n\n handleButtonSubmitAction() {\n if (!this.isBrfa || this.isEdit) return this.lastStepFunction();\n\n switch (this.brfaStep) {\n case 0:\n this.rfaConfig.numberOfApartments = this.building.apartmentsCount;\n this.addRiser();\n this.brfaStep++;\n break;\n\n case 1:\n case 2:\n this.brfaStep++;\n break;\n\n case 3:\n this.lastStepFunction();\n break;\n }\n }\n\n handleSecondaryButtonAction() {\n switch (this.brfaStep) {\n case 0:\n this.handleHideDialog();\n break;\n\n case 1:\n this.rfaConfig.risers = [];\n this.brfaStep--;\n break;\n\n default:\n this.brfaStep--;\n break;\n }\n }\n\n async lastStepFunction() {\n this.isDialogVisible = false;\n this.$store.dispatch(SET_APP_LOADING, true);\n\n await this.saveBuilding();\n\n this.$store.dispatch(SET_APP_LOADING, false);\n\n this.$emit('update-list');\n }\n\n retrieveEditedStructure() {\n const structure = new EntrancePlantStructureCreateDTO();\n structure.buildingsCreate = [];\n this.currentEntrancePlant.buildings?.forEach((epBuilding) =>\n structure.buildingsCreate?.push(\n new BuildingCreateDTO({\n buildingId: epBuilding.buildingId,\n name: epBuilding.name,\n apartmentsCount: epBuilding.apartments?.length,\n })\n )\n );\n\n if (this.isEdit) {\n const editingIndex = structure.buildingsCreate.findIndex(\n (editing) => editing.buildingId === this.building.buildingId\n );\n structure.buildingsCreate.splice(editingIndex, 1, this.building);\n } else {\n structure.buildingsCreate.push(this.building);\n }\n return structure;\n }\n\n async saveBuilding() {\n if (this.currentEntrancePlant.desktopId === undefined) return;\n try {\n const editStructure = this.retrieveEditedStructure();\n await plantsClient.structure(\n this.currentEntrancePlant.desktopId,\n editStructure\n );\n if (this.isBrfa) {\n const entrPlant = await plantsClient.entranceplantGET(\n this.currentEntrancePlant.desktopId!,\n this.currentEntrancePlant.lastModify\n );\n const rfaStructure: { [key: string]: RFAConfigDTO } = {};\n const newBuild = entrPlant.buildings?.find(\n (build) => build.name === this.building.name\n );\n rfaStructure[newBuild!.buildingId!] = this.rfaConfig;\n\n const structure = new EntrancePlantStructureCreateDTO({\n plantConfigStructure: rfaStructure,\n });\n\n await plantsClient.structure(\n this.currentEntrancePlant.desktopId!,\n structure\n );\n }\n \n this.$toast.add({\n severity: 'success',\n summary: this.$t('entrancePlant.buildingBannerCreated'),\n closable: false,\n life: 3000,\n });\n } catch (error) {\n console.log(error);\n setTimeout(() => {\n this.$toast.add({\n severity: 'error',\n summary: 'Error',\n closable: false,\n life: 3000,\n });\n }, 1500);\n }\n }\n}\n","import { render } from \"./DialogAddEditBuilding.vue?vue&type=template&id=c5eeb3a8&ts=true\"\nimport script from \"./DialogAddEditBuilding.ts?vue&type=script&lang=ts\"\nexport * from \"./DialogAddEditBuilding.ts?vue&type=script&lang=ts\"\n\nimport \"./DialogAddEditBuilding.scss?vue&type=style&index=0&lang=scss\"\n\nimport exportComponent from \"/home/vsts/work/1/s/Frontend/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__"],"sourceRoot":""}