Javascript : Area of ​a 2d room [closed]

In this javascript project, I’m trying to make sure that when you click on “edit Floorplan” the area of ​​the room is displayed in the middle of it. The air must appear regardless of the number of walls or their lengths.
Unfortunately, I’m a beginner and I don’t see how I can do this. Thank you for your help.
Anyone have an idea how to do it ?

Here is the link of my project.
https://mega.nz/file/QDAj1K5D#E2gdlIiEBrkX2I5ymEpYRoHs7GtN2LvwePLPF2W9ID4