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://client-app/./node_modules/openbim-components/src/ifc/IfcPropertiesManager/src/pset-actions.js","webpack://client-app/./node_modules/openbim-components/src/ifc/IfcPropertiesManager/src/prop-actions.js","webpack://client-app/./node_modules/openbim-components/src/ifc/IfcPropertiesManager/index.js"],"sourcesContent":["import { SimpleUIComponent, TextInput, Button } from \"../../../ui\";\r\nimport { Modal } from \"../../../ui/Modal\";\r\nimport { Event } from \"../../../base-types\";\r\nexport class EntityActionsUI extends SimpleUIComponent {\r\n constructor(components) {\r\n super(components, `
`);\r\n this.onNewPset = new Event();\r\n this.data = {};\r\n this.addPsetBtn = new Button(this._components, {\r\n materialIconName: \"add\",\r\n });\r\n this.addPsetBtn.onClick.add(async () => {\r\n this._nameInput.value = \"\";\r\n this._descriptionInput.value = \"\";\r\n this.modal.visible = true;\r\n });\r\n this.addChild(this.addPsetBtn);\r\n this.modal = new Modal(components, \"New Property Set\");\r\n this._components.ui.add(this.modal);\r\n this.modal.visible = false;\r\n this.modal.onHidden.add(() => this.removeFromParent());\r\n const addPsetUI = new SimpleUIComponent(this._components, `
`);\r\n this.modal.setSlot(\"content\", addPsetUI);\r\n this._nameInput = new TextInput(this._components);\r\n this._nameInput.label = \"Name\";\r\n this._descriptionInput = new TextInput(this._components);\r\n this._descriptionInput.label = \"Description\";\r\n this.modal.onAccept.add(() => {\r\n const name = this._nameInput.value;\r\n const description = this._descriptionInput.value;\r\n this.modal.visible = false;\r\n const { model, elementIDs } = this.data;\r\n if (!model || name === \"\")\r\n return;\r\n this.onNewPset.trigger({ model, elementIDs, name, description });\r\n });\r\n this.modal.onCancel.add(() => (this.modal.visible = false));\r\n addPsetUI.addChild(this._nameInput, this._descriptionInput);\r\n }\r\n async dispose(onlyChildren = false) {\r\n await super.dispose(onlyChildren);\r\n this.data = {};\r\n this.onNewPset.reset();\r\n await this.addPsetBtn.dispose();\r\n await this.modal.dispose();\r\n await this._nameInput.dispose();\r\n await this._descriptionInput.dispose();\r\n }\r\n}\r\n//# sourceMappingURL=entity-actions.js.map","import { SimpleUIComponent, TextInput, Dropdown, Button } from \"../../../ui\";\r\nimport { Event } from \"../../../base-types\";\r\nimport { Modal } from \"../../../ui/Modal\";\r\nexport class PsetActionsUI extends SimpleUIComponent {\r\n constructor(components) {\r\n super(components, `
`);\r\n this.modalVisible = false;\r\n this.onEditPset = new Event();\r\n this.onRemovePset = new Event();\r\n this.onNewProp = new Event();\r\n this.data = {};\r\n this._modal = new Modal(components, \"New Property Set\");\r\n this._components.ui.add(this._modal);\r\n this._modal.visible = false;\r\n this._modal.onHidden.add(() => this.removeFromParent());\r\n this._modal.onCancel.add(() => {\r\n this._modal.visible = false;\r\n this._modal.slots.content.dispose(true);\r\n });\r\n this.editPsetBtn = new Button(this._components);\r\n this.editPsetBtn.materialIcon = \"edit\";\r\n this.editPsetBtn.onClick.add(() => this.setEditUI());\r\n this.removePsetBtn = new Button(this._components);\r\n this.removePsetBtn.materialIcon = \"delete\";\r\n this.removePsetBtn.onClick.add(() => this.setRemoveUI());\r\n this.addPropBtn = new Button(this._components);\r\n this.addPropBtn.materialIcon = \"add\";\r\n this.addPropBtn.onClick.add(() => this.setAddPropUI());\r\n this.addChild(this.addPropBtn, this.editPsetBtn, this.removePsetBtn);\r\n }\r\n async dispose(onlyChildren = false) {\r\n await super.dispose(onlyChildren);\r\n await this.editPsetBtn.dispose();\r\n await this.removePsetBtn.dispose();\r\n await this.addPropBtn.dispose();\r\n await this._modal.dispose();\r\n this.onEditPset.reset();\r\n this.onRemovePset.reset();\r\n this.onNewProp.reset();\r\n this.data = {};\r\n }\r\n async setEditUI() {\r\n const { model, psetID } = this.data;\r\n if (!model || !psetID || !model.hasProperties)\r\n return;\r\n const entity = await model.getProperties(psetID);\r\n if (!entity)\r\n return;\r\n this._modal.onAccept.reset();\r\n this._modal.title = \"Edit Property Set\";\r\n const editUI = new SimpleUIComponent(this._components, `
`);\r\n const nameInput = new TextInput(this._components);\r\n nameInput.label = \"Name\";\r\n const descriptionInput = new TextInput(this._components);\r\n descriptionInput.label = \"Description\";\r\n this._modal.onAccept.add(async () => {\r\n this._modal.visible = false;\r\n await this.onEditPset.trigger({\r\n model,\r\n psetID,\r\n name: nameInput.value,\r\n description: descriptionInput.value,\r\n });\r\n });\r\n editUI.addChild(nameInput, descriptionInput);\r\n nameInput.value = entity.Name?.value ?? \"\";\r\n descriptionInput.value = entity.Description?.value ?? \"\";\r\n this._modal.setSlot(\"content\", editUI);\r\n this._modal.visible = true;\r\n }\r\n setRemoveUI() {\r\n const { model, psetID } = this.data;\r\n if (!model || !psetID)\r\n return;\r\n this._modal.onAccept.reset();\r\n this._modal.title = \"Remove Property Set\";\r\n const removeUI = new SimpleUIComponent(this._components, `
`);\r\n const warningText = document.createElement(\"div\");\r\n warningText.className = \"text-base text-center\";\r\n warningText.textContent =\r\n \"Are you sure to delete this property set? This action can't be undone.\";\r\n removeUI.get().append(warningText);\r\n this._modal.onAccept.add(async () => {\r\n this._modal.visible = false;\r\n this.removeFromParent(); // As the psetUI is going to be disposed, then we need to first remove the action buttons so they do not become disposed as well.\r\n await this.onRemovePset.trigger({ model, psetID });\r\n });\r\n this._modal.setSlot(\"content\", removeUI);\r\n this._modal.visible = true;\r\n }\r\n setAddPropUI() {\r\n const { model, psetID } = this.data;\r\n if (!model || !psetID)\r\n return;\r\n this._modal.onAccept.reset();\r\n this._modal.title = \"New Property\";\r\n const addPropUI = new SimpleUIComponent(this._components, `
`);\r\n const nameInput = new TextInput(this._components);\r\n nameInput.label = \"Name\";\r\n const typeInput = new Dropdown(this._components);\r\n typeInput.label = \"Type\";\r\n typeInput.addOption(\"IfcText\", \"IfcLabel\", \"IfcIdentifier\");\r\n typeInput.value = \"IfcText\";\r\n const valueInput = new TextInput(this._components);\r\n valueInput.label = \"Value\";\r\n this._modal.onAccept.add(async () => {\r\n this._modal.visible = false;\r\n const name = nameInput.value;\r\n const type = typeInput.value;\r\n if (name === \"\" || !type)\r\n return;\r\n await this.onNewProp.trigger({\r\n model,\r\n psetID,\r\n name,\r\n type,\r\n value: valueInput.value,\r\n });\r\n });\r\n addPropUI.addChild(nameInput, typeInput, valueInput);\r\n this._modal.setSlot(\"content\", addPropUI);\r\n this._modal.visible = true;\r\n }\r\n}\r\n//# sourceMappingURL=pset-actions.js.map","import { SimpleUIComponent, TextInput, Button } from \"../../../ui\";\r\nimport { Event } from \"../../../base-types\";\r\nimport { IfcPropertiesUtils } from \"../../IfcPropertiesUtils\";\r\nimport { Modal } from \"../../../ui/Modal\";\r\nexport class PropActionsUI extends SimpleUIComponent {\r\n constructor(components) {\r\n const div = document.createElement(\"div\");\r\n div.className = \"flex\";\r\n super(components, `
`);\r\n this.modalVisible = false;\r\n this.onEditProp = new Event();\r\n this.onRemoveProp = new Event();\r\n this.data = {};\r\n this._modal = new Modal(components, \"New Property Set\");\r\n this._components.ui.add(this._modal);\r\n this._modal.visible = false;\r\n this._modal.onHidden.add(() => this.removeFromParent());\r\n this._modal.onCancel.add(() => {\r\n this._modal.visible = false;\r\n this._modal.slots.content.dispose(true);\r\n });\r\n this.editPropBtn = new Button(this._components);\r\n this.editPropBtn.materialIcon = \"edit\";\r\n this.editPropBtn.onClick.add(() => this.setEditUI());\r\n this.removePropBtn = new Button(this._components);\r\n this.removePropBtn.materialIcon = \"delete\";\r\n this.removePropBtn.onClick.add(() => this.setRemoveUI());\r\n this.addChild(this.editPropBtn, this.removePropBtn);\r\n }\r\n async dispose(onlyChildren = false) {\r\n await super.dispose(onlyChildren);\r\n this.onRemoveProp.reset();\r\n await this.editPropBtn.dispose();\r\n await this.removePropBtn.dispose();\r\n await this._modal.dispose();\r\n this.data = {};\r\n }\r\n async setEditUI() {\r\n const { model, expressID } = this.data;\r\n if (!model || !expressID || !model.hasProperties)\r\n return;\r\n const prop = await model.getProperties(expressID);\r\n if (!prop)\r\n return;\r\n this._modal.onAccept.reset();\r\n this._modal.title = \"Edit Property\";\r\n const editUI = new SimpleUIComponent(this._components, `
`);\r\n const nameInput = new TextInput(this._components);\r\n nameInput.label = \"Name\";\r\n const valueInput = new TextInput(this._components);\r\n valueInput.label = \"Value\";\r\n this._modal.onAccept.add(async () => {\r\n this._modal.visible = false;\r\n await this.onEditProp.trigger({\r\n model,\r\n expressID,\r\n name: nameInput.value,\r\n value: valueInput.value,\r\n });\r\n });\r\n editUI.addChild(nameInput, valueInput);\r\n const { key: nameKey } = await IfcPropertiesUtils.getEntityName(model, expressID);\r\n if (nameKey) {\r\n nameInput.value = prop[nameKey]?.value ?? \"\";\r\n }\r\n else {\r\n nameInput.value = prop.Name?.value ?? \"\";\r\n }\r\n const { key: valueKey } = await IfcPropertiesUtils.getQuantityValue(model, expressID);\r\n if (valueKey) {\r\n valueInput.value = prop[valueKey]?.value ?? \"\";\r\n }\r\n else {\r\n valueInput.value = prop.NominalValue?.value ?? \"\";\r\n }\r\n this._modal.setSlot(\"content\", editUI);\r\n this._modal.visible = true;\r\n }\r\n setRemoveUI() {\r\n const { model, expressID, setID } = this.data;\r\n if (!model || !expressID || !setID)\r\n return;\r\n const removeUI = new SimpleUIComponent(this._components, `
`);\r\n const warningText = document.createElement(\"div\");\r\n warningText.className = \"text-base text-center\";\r\n warningText.textContent =\r\n \"Are you sure to delete this property? This action can't be undone.\";\r\n removeUI.get().append(warningText);\r\n this._modal.onAccept.add(async () => {\r\n this._modal.visible = false;\r\n this.removeFromParent(); // As the psetUI is going to be disposed, then we need to first remove the action buttons so they do not become disposed as well.\r\n await this.onRemoveProp.trigger({ model, expressID, setID });\r\n });\r\n this._modal.setSlot(\"content\", removeUI);\r\n this._modal.visible = true;\r\n }\r\n}\r\n//# sourceMappingURL=prop-actions.js.map","import * as WEBIFC from \"web-ifc\";\r\nimport { Component, Event, UIElement } from \"../../base-types\";\r\nimport { ToolComponent } from \"../../core\";\r\nimport { generateIfcGUID } from \"../../utils\";\r\nimport { IfcPropertiesUtils } from \"../IfcPropertiesUtils\";\r\nimport { EntityActionsUI } from \"./src/entity-actions\";\r\nimport { PsetActionsUI } from \"./src/pset-actions\";\r\nimport { PropActionsUI } from \"./src/prop-actions\";\r\nimport { Button } from \"../../ui\";\r\nimport { FragmentIfcLoader } from \"../../fragments/FragmentIfcLoader\";\r\nexport class IfcPropertiesManager extends Component {\r\n constructor(components) {\r\n super(components);\r\n /** {@link Disposable.onDisposed} */\r\n this.onDisposed = new Event();\r\n this.onRequestFile = new Event();\r\n this.ifcToExport = null;\r\n this.onElementToPset = new Event();\r\n this.onPropToPset = new Event();\r\n this.onPsetRemoved = new Event();\r\n this.onDataChanged = new Event();\r\n this.wasm = {\r\n path: \"/\",\r\n absolute: false,\r\n };\r\n this.enabled = true;\r\n this.attributeListeners = {};\r\n this.uiElement = new UIElement();\r\n this._changeMap = {};\r\n this.components.tools.add(IfcPropertiesManager.uuid, this);\r\n // TODO: Save original IFC file so that opening it again is not necessary\r\n if (components.uiEnabled) {\r\n this.setUI(components);\r\n this.setUIEvents();\r\n }\r\n }\r\n get() {\r\n return this._changeMap;\r\n }\r\n async dispose() {\r\n this.selectedModel = undefined;\r\n this.attributeListeners = {};\r\n this._changeMap = {};\r\n this.onElementToPset.reset();\r\n this.onPropToPset.reset();\r\n this.onPsetRemoved.reset();\r\n this.onDataChanged.reset();\r\n await this.uiElement.dispose();\r\n await this.onDisposed.trigger(IfcPropertiesManager.uuid);\r\n this.onDisposed.reset();\r\n }\r\n setUI(components) {\r\n const exportButton = new Button(components);\r\n exportButton.tooltip = \"Export IFC\";\r\n exportButton.materialIcon = \"exit_to_app\";\r\n exportButton.onClick.add(async () => {\r\n await this.onRequestFile.trigger();\r\n if (!this.ifcToExport || !this.selectedModel)\r\n return;\r\n const fileData = new Uint8Array(this.ifcToExport);\r\n const name = this.selectedModel.name;\r\n const resultBuffer = await this.saveToIfc(this.selectedModel, fileData);\r\n const resultFile = new File([new Blob([resultBuffer])], name);\r\n const link = document.createElement(\"a\");\r\n link.download = name;\r\n link.href = URL.createObjectURL(resultFile);\r\n link.click();\r\n link.remove();\r\n });\r\n this.uiElement.set({\r\n exportButton,\r\n entityActions: new EntityActionsUI(components),\r\n psetActions: new PsetActionsUI(components),\r\n propActions: new PropActionsUI(components),\r\n });\r\n }\r\n setUIEvents() {\r\n const entityActions = this.uiElement.get(\"entityActions\");\r\n const propActions = this.uiElement.get(\"propActions\");\r\n const psetActions = this.uiElement.get(\"psetActions\");\r\n entityActions.onNewPset.add(async ({ model, elementIDs, name, description }) => {\r\n const { pset } = await this.newPset(model, name, description === \"\" ? undefined : description);\r\n for (const expressID of elementIDs ?? []) {\r\n await this.addElementToPset(model, pset.expressID, expressID);\r\n }\r\n entityActions.cleanData();\r\n });\r\n propActions.onEditProp.add(async ({ model, expressID, name, value }) => {\r\n const prop = await model.getProperties(expressID);\r\n if (!prop)\r\n return;\r\n const { key: valueKey } = await IfcPropertiesUtils.getQuantityValue(model, expressID);\r\n const { key: nameKey } = await IfcPropertiesUtils.getEntityName(model, expressID);\r\n if (name !== \"\" && nameKey) {\r\n if (prop[nameKey]?.value) {\r\n prop[nameKey].value = name;\r\n }\r\n else {\r\n prop.Name = { type: 1, value: name };\r\n }\r\n }\r\n if (value !== \"\" && valueKey) {\r\n if (prop[valueKey]?.value) {\r\n prop[valueKey].value = value;\r\n }\r\n else {\r\n prop.NominalValue = { type: 1, value }; // Need to change type based on property 1:STRING, 2: LABEL, 3: ENUM, 4: REAL\r\n }\r\n }\r\n await this.registerChange(model, expressID);\r\n propActions.cleanData();\r\n });\r\n propActions.onRemoveProp.add(async ({ model, expressID, setID }) => {\r\n await this.removePsetProp(model, setID, expressID);\r\n propActions.cleanData();\r\n });\r\n psetActions.onEditPset.add(async ({ model, psetID, name, description }) => {\r\n const pset = await model.getProperties(psetID);\r\n if (!pset)\r\n return;\r\n if (name !== \"\") {\r\n if (pset.Name?.value) {\r\n pset.Name.value = name;\r\n }\r\n else {\r\n pset.Name = { type: 1, value: name };\r\n }\r\n }\r\n if (description !== \"\") {\r\n if (pset.Description?.value) {\r\n pset.Description.value = description;\r\n }\r\n else {\r\n pset.Description = { type: 1, value: description };\r\n }\r\n }\r\n await this.registerChange(model, psetID);\r\n });\r\n psetActions.onRemovePset.add(async ({ model, psetID }) => {\r\n await this.removePset(model, psetID);\r\n });\r\n psetActions.onNewProp.add(async ({ model, psetID, name, type, value }) => {\r\n const prop = await this.newSingleStringProperty(model, type, name, value);\r\n await this.addPropToPset(model, psetID, prop.expressID);\r\n });\r\n }\r\n increaseMaxID(model) {\r\n model.ifcMetadata.maxExpressID++;\r\n return model.ifcMetadata.maxExpressID;\r\n }\r\n static getIFCSchema(model) {\r\n const schema = model.ifcMetadata.schema;\r\n if (!schema) {\r\n throw new Error(\"IFC Schema not found\");\r\n }\r\n return schema;\r\n }\r\n newGUID(model) {\r\n const schema = IfcPropertiesManager.getIFCSchema(model);\r\n return new WEBIFC[schema].IfcGloballyUniqueId(generateIfcGUID());\r\n }\r\n async getOwnerHistory(model) {\r\n const ownerHistories = await model.getAllPropertiesOfType(WEBIFC.IFCOWNERHISTORY);\r\n if (!ownerHistories) {\r\n throw new Error(\"No OwnerHistory was found.\");\r\n }\r\n const keys = Object.keys(ownerHistories).map((key) => parseInt(key, 10));\r\n const ownerHistory = ownerHistories[keys[0]];\r\n const ownerHistoryHandle = new WEBIFC.Handle(ownerHistory.expressID);\r\n return { ownerHistory, ownerHistoryHandle };\r\n }\r\n async registerChange(model, ...expressID) {\r\n if (!this._changeMap[model.uuid]) {\r\n this._changeMap[model.uuid] = new Set();\r\n }\r\n for (const id of expressID) {\r\n this._changeMap[model.uuid].add(id);\r\n await this.onDataChanged.trigger({ model, expressID: id });\r\n }\r\n }\r\n async setData(model, ...dataToSave) {\r\n for (const data of dataToSave) {\r\n const expressID = data.expressID;\r\n if (!expressID)\r\n continue;\r\n await model.setProperties(expressID, data);\r\n await this.registerChange(model, expressID);\r\n }\r\n }\r\n async newPset(model, name, description) {\r\n const schema = IfcPropertiesManager.getIFCSchema(model);\r\n const { ownerHistoryHandle } = await this.getOwnerHistory(model);\r\n // Create the Pset\r\n const psetGlobalId = this.newGUID(model);\r\n const psetName = new WEBIFC[schema].IfcLabel(name);\r\n const psetDescription = description\r\n ? new WEBIFC[schema].IfcText(description)\r\n : null;\r\n const pset = new WEBIFC[schema].IfcPropertySet(psetGlobalId, ownerHistoryHandle, psetName, psetDescription, []);\r\n pset.expressID = this.increaseMaxID(model);\r\n // Create the Pset relation\r\n const relGlobalId = this.newGUID(model);\r\n const rel = new WEBIFC[schema].IfcRelDefinesByProperties(relGlobalId, ownerHistoryHandle, null, null, [], new WEBIFC.Handle(pset.expressID));\r\n rel.expressID = this.increaseMaxID(model);\r\n await this.setData(model, pset, rel);\r\n return { pset, rel };\r\n }\r\n async removePset(model, ...psetID) {\r\n for (const expressID of psetID) {\r\n const pset = await model.getProperties(expressID);\r\n if (pset?.type !== WEBIFC.IFCPROPERTYSET)\r\n continue;\r\n const relID = await IfcPropertiesUtils.getPsetRel(model, expressID);\r\n if (relID) {\r\n await model.setProperties(relID, null);\r\n await this.registerChange(model, relID);\r\n }\r\n if (pset) {\r\n for (const propHandle of pset.HasProperties) {\r\n await model.setProperties(propHandle.value, null);\r\n }\r\n await model.setProperties(expressID, null);\r\n await this.onPsetRemoved.trigger({ model, psetID: expressID });\r\n await this.registerChange(model, expressID);\r\n }\r\n }\r\n }\r\n async newSingleProperty(model, type, name, value) {\r\n const schema = IfcPropertiesManager.getIFCSchema(model);\r\n const propName = new WEBIFC[schema].IfcIdentifier(name);\r\n // @ts-ignore\r\n const propValue = new WEBIFC[schema][type](value);\r\n const prop = new WEBIFC[schema].IfcPropertySingleValue(propName, null, propValue, null);\r\n prop.expressID = this.increaseMaxID(model);\r\n await this.setData(model, prop);\r\n return prop;\r\n }\r\n newSingleStringProperty(model, type, name, value) {\r\n return this.newSingleProperty(model, type, name, value);\r\n }\r\n newSingleNumericProperty(model, type, name, value) {\r\n return this.newSingleProperty(model, type, name, value);\r\n }\r\n newSingleBooleanProperty(model, type, name, value) {\r\n return this.newSingleProperty(model, type, name, value);\r\n }\r\n async removePsetProp(model, psetID, propID) {\r\n const pset = await model.getProperties(psetID);\r\n const prop = await model.getProperties(propID);\r\n if (!pset || !prop)\r\n return;\r\n if (!(pset.type === WEBIFC.IFCPROPERTYSET && prop))\r\n return;\r\n pset.HasProperties = pset.HasProperties.filter((handle) => {\r\n return handle.value !== propID;\r\n });\r\n await model.setProperties(propID, null);\r\n await this.registerChange(model, psetID, propID);\r\n }\r\n async addElementToPset(model, psetID, ...elementID) {\r\n const relID = await IfcPropertiesUtils.getPsetRel(model, psetID);\r\n if (!relID)\r\n return;\r\n const rel = await model.getProperties(relID);\r\n if (!rel)\r\n return;\r\n for (const expressID of elementID) {\r\n const elementHandle = new WEBIFC.Handle(expressID);\r\n rel.RelatedObjects.push(elementHandle);\r\n await this.onElementToPset.trigger({\r\n model,\r\n psetID,\r\n elementID: expressID,\r\n });\r\n }\r\n await this.registerChange(model, psetID);\r\n }\r\n async addPropToPset(model, psetID, ...propID) {\r\n const pset = await model.getProperties(psetID);\r\n if (!pset)\r\n return;\r\n for (const expressID of propID) {\r\n if (pset.HasProperties.includes(expressID)) {\r\n continue;\r\n }\r\n const elementHandle = new WEBIFC.Handle(expressID);\r\n pset.HasProperties.push(elementHandle);\r\n await this.onPropToPset.trigger({ model, psetID, propID: expressID });\r\n }\r\n await this.registerChange(model, psetID);\r\n }\r\n async saveToIfc(model, ifcToSaveOn) {\r\n const ifcLoader = this.components.tools.get(FragmentIfcLoader);\r\n const ifcApi = ifcLoader.get();\r\n const modelID = await ifcLoader.readIfcFile(ifcToSaveOn);\r\n const changes = this._changeMap[model.uuid] ?? [];\r\n for (const expressID of changes) {\r\n const data = (await model.getProperties(expressID));\r\n if (!data) {\r\n try {\r\n ifcApi.DeleteLine(modelID, expressID);\r\n }\r\n catch (err) {\r\n // Nothing here...\r\n }\r\n }\r\n else {\r\n try {\r\n ifcApi.WriteLine(modelID, data);\r\n }\r\n catch (err) {\r\n // Nothing here...\r\n }\r\n }\r\n }\r\n const modifiedIFC = ifcApi.SaveModel(modelID);\r\n ifcLoader.get().CloseModel(modelID);\r\n ifcLoader.cleanUp();\r\n return modifiedIFC;\r\n }\r\n async setAttributeListener(model, expressID, attributeName) {\r\n if (!this.attributeListeners[model.uuid])\r\n this.attributeListeners[model.uuid] = {};\r\n const existingListener = this.attributeListeners[model.uuid][expressID]\r\n ? this.attributeListeners[model.uuid][expressID][attributeName]\r\n : null;\r\n if (existingListener)\r\n return existingListener;\r\n const entity = await model.getProperties(expressID);\r\n if (!entity) {\r\n throw new Error(`Entity with expressID ${expressID} doesn't exists.`);\r\n }\r\n const attribute = entity[attributeName];\r\n if (Array.isArray(attribute) || !attribute) {\r\n throw new Error(`Attribute ${attributeName} is array or null, and it can't have a listener.`);\r\n }\r\n const value = attribute.value;\r\n if (value === undefined || value == null) {\r\n throw new Error(`Attribute ${attributeName} has a badly defined handle.`);\r\n }\r\n // TODO: Is it good to set all the above as errors? Or better return null?\r\n // TODO: Do we need an async-await in the following set function?\r\n const event = new Event();\r\n Object.defineProperty(entity[attributeName], \"value\", {\r\n get() {\r\n return this._value;\r\n },\r\n async set(value) {\r\n this._value = value;\r\n await event.trigger(value);\r\n },\r\n });\r\n entity[attributeName].value = value;\r\n if (!this.attributeListeners[model.uuid][expressID])\r\n this.attributeListeners[model.uuid][expressID] = {};\r\n this.attributeListeners[model.uuid][expressID][attributeName] = event;\r\n return event;\r\n }\r\n}\r\nIfcPropertiesManager.uuid = \"58c2d9f0-183c-48d6-a402-dfcf5b9a34df\";\r\nToolComponent.libraryUUIDs.add(IfcPropertiesManager.uuid);\r\n//# sourceMappingURL=index.js.map"],"names":["EntityActionsUI","constructor","components","super","this","onNewPset","data","addPsetBtn","_components","materialIconName","onClick","add","async","_nameInput","value","_descriptionInput","modal","visible","addChild","Modal","ui","onHidden","removeFromParent","addPsetUI","setSlot","label","onAccept","name","description","model","elementIDs","trigger","onCancel","dispose","onlyChildren","reset","PsetActionsUI","modalVisible","onEditPset","onRemovePset","onNewProp","_modal","slots","content","editPsetBtn","materialIcon","setEditUI","removePsetBtn","setRemoveUI","addPropBtn","setAddPropUI","psetID","hasProperties","entity","getProperties","title","editUI","nameInput","descriptionInput","Name","Description","removeUI","warningText","document","createElement","className","textContent","get","append","addPropUI","typeInput","addOption","valueInput","type","PropActionsUI","onEditProp","onRemoveProp","editPropBtn","removePropBtn","expressID","prop","key","nameKey","IfcPropertiesUtils","getEntityName","valueKey","getQuantityValue","NominalValue","setID","IfcPropertiesManager","onDisposed","onRequestFile","ifcToExport","onElementToPset","onPropToPset","onPsetRemoved","onDataChanged","wasm","path","absolute","enabled","attributeListeners","uiElement","_changeMap","tools","uuid","uiEnabled","setUI","setUIEvents","selectedModel","undefined","exportButton","tooltip","fileData","Uint8Array","resultBuffer","saveToIfc","resultFile","File","Blob","link","download","href","URL","createObjectURL","click","remove","set","entityActions","psetActions","propActions","pset","newPset","addElementToPset","cleanData","registerChange","removePsetProp","removePset","newSingleStringProperty","addPropToPset","increaseMaxID","ifcMetadata","maxExpressID","getIFCSchema","schema","Error","newGUID","IfcGloballyUniqueId","getOwnerHistory","ownerHistories","getAllPropertiesOfType","ownerHistory","Object","keys","map","parseInt","ownerHistoryHandle","Set","id","setData","dataToSave","setProperties","psetGlobalId","psetName","IfcLabel","psetDescription","IfcText","IfcPropertySet","relGlobalId","rel","IfcRelDefinesByProperties","relID","getPsetRel","propHandle","HasProperties","newSingleProperty","propName","IfcIdentifier","propValue","IfcPropertySingleValue","newSingleNumericProperty","newSingleBooleanProperty","propID","filter","handle","elementID","elementHandle","RelatedObjects","push","includes","ifcToSaveOn","ifcLoader","FragmentIfcLoader","ifcApi","modelID","readIfcFile","changes","WriteLine","err","DeleteLine","modifiedIFC","SaveModel","CloseModel","cleanUp","setAttributeListener","attributeName","existingListener","attribute","Array","isArray","event","defineProperty","_value","libraryUUIDs"],"sourceRoot":""}