diff --git a/examples/AngleMeasurement/index.html b/examples/AngleMeasurement/index.html index 66368a7e3..68dc031c8 100644 --- a/examples/AngleMeasurement/index.html +++ b/examples/AngleMeasurement/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/AreaMeasurement/index.html b/examples/AreaMeasurement/index.html index c1febedc3..189572a64 100644 --- a/examples/AreaMeasurement/index.html +++ b/examples/AreaMeasurement/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/BCFTopics/index.html b/examples/BCFTopics/index.html index e9ac34907..131955170 100644 --- a/examples/BCFTopics/index.html +++ b/examples/BCFTopics/index.html @@ -40,11 +40,10 @@ } - - - - - + + + + diff --git a/examples/BoundingBoxer/index.html b/examples/BoundingBoxer/index.html index 4ab3e0f87..80fa24ab0 100644 --- a/examples/BoundingBoxer/index.html +++ b/examples/BoundingBoxer/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/Civil3DNavigator/index.html b/examples/Civil3DNavigator/index.html index 568d4958b..cffe59d9e 100644 --- a/examples/Civil3DNavigator/index.html +++ b/examples/Civil3DNavigator/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/CivilCrossSectionNavigator/index.html b/examples/CivilCrossSectionNavigator/index.html index 6a69834c7..66104f2fe 100644 --- a/examples/CivilCrossSectionNavigator/index.html +++ b/examples/CivilCrossSectionNavigator/index.html @@ -76,13 +76,12 @@ - - - - - - - + + + + + + diff --git a/examples/CivilElevationNavigator/index.html b/examples/CivilElevationNavigator/index.html index 5424a8a31..8ae315365 100644 --- a/examples/CivilElevationNavigator/index.html +++ b/examples/CivilElevationNavigator/index.html @@ -77,13 +77,12 @@ - - - - - - - + + + + + + diff --git a/examples/CivilPlanNavigator/index.html b/examples/CivilPlanNavigator/index.html index 3a75ef028..061ab6d08 100644 --- a/examples/CivilPlanNavigator/index.html +++ b/examples/CivilPlanNavigator/index.html @@ -66,13 +66,12 @@ - - - - - - - + + + + + + diff --git a/examples/Classifier/index.html b/examples/Classifier/index.html index 4f1b4f37a..15220835a 100644 --- a/examples/Classifier/index.html +++ b/examples/Classifier/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/ClipEdges/index.html b/examples/ClipEdges/index.html index 028fba07d..b9c68bfa5 100644 --- a/examples/ClipEdges/index.html +++ b/examples/ClipEdges/index.html @@ -58,12 +58,11 @@ - - - - - - + + + + + diff --git a/examples/Clipper/index.html b/examples/Clipper/index.html index f4a9d4dbe..0307d8e34 100644 --- a/examples/Clipper/index.html +++ b/examples/Clipper/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/Cullers/index.html b/examples/Cullers/index.html index decb4eeaf..3f76d11e8 100644 --- a/examples/Cullers/index.html +++ b/examples/Cullers/index.html @@ -58,10 +58,9 @@ - - - - + + + diff --git a/examples/EdgeMeasurement/index.html b/examples/EdgeMeasurement/index.html index b04ec9363..48fea66e9 100644 --- a/examples/EdgeMeasurement/index.html +++ b/examples/EdgeMeasurement/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/Exploder/index.html b/examples/Exploder/index.html index 78129c22f..c3108ffbf 100644 --- a/examples/Exploder/index.html +++ b/examples/Exploder/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/FaceMeasurement/index.html b/examples/FaceMeasurement/index.html index 44d95b078..26720988d 100644 --- a/examples/FaceMeasurement/index.html +++ b/examples/FaceMeasurement/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/FragmentsManager/index.html b/examples/FragmentsManager/index.html index 8fc781f3f..b1f3118e6 100644 --- a/examples/FragmentsManager/index.html +++ b/examples/FragmentsManager/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/Grids/index.html b/examples/Grids/index.html index 8462fccee..a7bc119d5 100644 --- a/examples/Grids/index.html +++ b/examples/Grids/index.html @@ -64,8 +64,10 @@ - - + + + + diff --git a/examples/Hider/index.html b/examples/Hider/index.html index f36ece94b..d74e1c197 100644 --- a/examples/Hider/index.html +++ b/examples/Hider/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/Highlighter/index.html b/examples/Highlighter/index.html index c71e0ba13..bc2fff01f 100644 --- a/examples/Highlighter/index.html +++ b/examples/Highlighter/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/IDSSpecifications/index.html b/examples/IDSSpecifications/index.html new file mode 100644 index 000000000..32c165f07 --- /dev/null +++ b/examples/IDSSpecifications/index.html @@ -0,0 +1,51 @@ + + + + + + + IDS Specifications + + + + + + + + + + + \ No newline at end of file diff --git a/examples/IfcFinder/index.html b/examples/IfcFinder/index.html new file mode 100644 index 000000000..208e61ad9 --- /dev/null +++ b/examples/IfcFinder/index.html @@ -0,0 +1,71 @@ + + + + + + + + + + + IfcFinder + + + + + + + + + +
+ + + \ No newline at end of file diff --git a/examples/IfcGeometryTiler/index.html b/examples/IfcGeometryTiler/index.html index 8376c54f0..81a046a8d 100644 --- a/examples/IfcGeometryTiler/index.html +++ b/examples/IfcGeometryTiler/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/IfcJsonExporter/index.html b/examples/IfcJsonExporter/index.html index 7f9f66853..b7e8d91c2 100644 --- a/examples/IfcJsonExporter/index.html +++ b/examples/IfcJsonExporter/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/IfcLoader/index.html b/examples/IfcLoader/index.html index bc2690d2d..b1b6f58f2 100644 --- a/examples/IfcLoader/index.html +++ b/examples/IfcLoader/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/IfcPropertiesManager/index.html b/examples/IfcPropertiesManager/index.html index 38b5d3acb..e7c0ade6e 100644 --- a/examples/IfcPropertiesManager/index.html +++ b/examples/IfcPropertiesManager/index.html @@ -6,9 +6,8 @@ Ifc Properties Manager - - - + + diff --git a/examples/IfcPropertiesTiler/index.html b/examples/IfcPropertiesTiler/index.html index 72fa24d67..3074f025c 100644 --- a/examples/IfcPropertiesTiler/index.html +++ b/examples/IfcPropertiesTiler/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/IfcRelationsIndexer/index.html b/examples/IfcRelationsIndexer/index.html index 94677deec..5d6c0e27e 100644 --- a/examples/IfcRelationsIndexer/index.html +++ b/examples/IfcRelationsIndexer/index.html @@ -58,12 +58,11 @@ - - - - - - + + + + + diff --git a/examples/IfcStreamer/index.html b/examples/IfcStreamer/index.html index 399ef183d..bd3e4af11 100644 --- a/examples/IfcStreamer/index.html +++ b/examples/IfcStreamer/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/LengthMeasurement/index.html b/examples/LengthMeasurement/index.html index b836f7d3c..aa061be1c 100644 --- a/examples/LengthMeasurement/index.html +++ b/examples/LengthMeasurement/index.html @@ -58,12 +58,11 @@ - - - - - - + + + + + diff --git a/examples/Marker/index.html b/examples/Marker/index.html index cb1b0cbec..a5abc4899 100644 --- a/examples/Marker/index.html +++ b/examples/Marker/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/MeasurementUtils/index.html b/examples/MeasurementUtils/index.html index 526dceeda..0d80b9b17 100644 --- a/examples/MeasurementUtils/index.html +++ b/examples/MeasurementUtils/index.html @@ -58,10 +58,9 @@ - - - - + + + diff --git a/examples/MiniMap/index.html b/examples/MiniMap/index.html index af925142f..9f9f52731 100644 --- a/examples/MiniMap/index.html +++ b/examples/MiniMap/index.html @@ -64,11 +64,10 @@ - - - - - + + + + diff --git a/examples/OrthoPerspectiveCamera/index.html b/examples/OrthoPerspectiveCamera/index.html index 9ad422359..8c9567b9c 100644 --- a/examples/OrthoPerspectiveCamera/index.html +++ b/examples/OrthoPerspectiveCamera/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/Plans/index.html b/examples/Plans/index.html index d9e1d4c17..d30d6a820 100644 --- a/examples/Plans/index.html +++ b/examples/Plans/index.html @@ -58,12 +58,11 @@ - - - - - - + + + + + diff --git a/examples/PostproductionRenderer/index.html b/examples/PostproductionRenderer/index.html index f1b791af0..1f44cae16 100644 --- a/examples/PostproductionRenderer/index.html +++ b/examples/PostproductionRenderer/index.html @@ -58,12 +58,11 @@ - - - - - - + + + + + diff --git a/examples/Raycasters/index.html b/examples/Raycasters/index.html index 86cd2f1dd..2703c02a8 100644 --- a/examples/Raycasters/index.html +++ b/examples/Raycasters/index.html @@ -58,10 +58,9 @@ - - - - + + + diff --git a/examples/Sections/index.html b/examples/Sections/index.html index d46577b18..b07954cdb 100644 --- a/examples/Sections/index.html +++ b/examples/Sections/index.html @@ -58,12 +58,11 @@ - - - - - - + + + + + diff --git a/examples/ShadowDropper/index.html b/examples/ShadowDropper/index.html index e46c5e89c..69f986441 100644 --- a/examples/ShadowDropper/index.html +++ b/examples/ShadowDropper/index.html @@ -58,12 +58,11 @@ - - - - - - + + + + + diff --git a/examples/ShadowedScene/index.html b/examples/ShadowedScene/index.html index 73201da6b..2aeaf55a4 100644 --- a/examples/ShadowedScene/index.html +++ b/examples/ShadowedScene/index.html @@ -64,10 +64,9 @@ - - - - + + + diff --git a/examples/VolumeMeasurement/index.html b/examples/VolumeMeasurement/index.html index b3e45a1ba..8ab3440b1 100644 --- a/examples/VolumeMeasurement/index.html +++ b/examples/VolumeMeasurement/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/Worlds/index.html b/examples/Worlds/index.html index 2f14e00d7..7810a56aa 100644 --- a/examples/Worlds/index.html +++ b/examples/Worlds/index.html @@ -58,11 +58,10 @@ - - - - - + + + + diff --git a/examples/assets/_commonjsHelpers-Cpj98o6Y.js b/examples/assets/_commonjsHelpers-Cpj98o6Y.js deleted file mode 100644 index b285ce543..000000000 --- a/examples/assets/_commonjsHelpers-Cpj98o6Y.js +++ /dev/null @@ -1 +0,0 @@ -var o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}export{o as c,l as g}; diff --git a/examples/assets/angleMeasurement.js b/examples/assets/angleMeasurement.js index 3ccb56577..88f2e0a02 100644 --- a/examples/assets/angleMeasurement.js +++ b/examples/assets/angleMeasurement.js @@ -1 +1 @@ -import{B as c,M as d,a as l}from"./web-ifc-api-JuXSH2nk.js";import{o as m,a as i,M as w,N as p,h as u}from"./index-DtdmE_hK.js";import{$ as b,a as f}from"./index-Cm7YlCft.js";import{S as g}from"./stats.min-GTpOrGrX.js";import"./_commonjsHelpers-Cpj98o6Y.js";const r=document.getElementById("container"),o=new m,h=o.get(i),e=h.create();e.scene=new w(o);e.renderer=new b(o,r);e.camera=new p(o);o.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const y=o.get(u);y.create(e);e.scene.three.background=null;const M=new c(3,3,3),k=new d({color:"#6528D7"}),a=new l(M,k);a.position.set(0,1.5,0);e.scene.three.add(a);e.meshes.add(a);const t=o.get(f);t.world=e;t.enabled=!0;r.ondblclick=()=>t.create();window.onkeydown=s=>{(s.code==="Delete"||s.code==="Backspace")&&t.deleteAll()};const n=new g;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); +import{B as c,M as d,a as l}from"./web-ifc-api-Dlf_dxms.js";import{p as m,A as i,e as p,v as w,O as u}from"./index-6e07lNWw.js";import{P as b,a as f}from"./index-DDq_E_eW.js";import{S as g}from"./stats.min-bmkVNhZk.js";const r=document.getElementById("container"),n=new m,y=n.get(i),e=y.create();e.scene=new p(n);e.renderer=new b(n,r);e.camera=new w(n);n.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const h=n.get(u);h.create(e);e.scene.three.background=null;const k=new c(3,3,3),A=new d({color:"#6528D7"}),s=new l(k,A);s.position.set(0,1.5,0);e.scene.three.add(s);e.meshes.add(s);const o=n.get(f);o.world=e;o.enabled=!0;r.ondblclick=()=>o.create();window.onkeydown=a=>{(a.code==="Delete"||a.code==="Backspace")&&o.deleteAll()};const t=new g;t.showPanel(2);document.body.append(t.dom);t.dom.style.left="0px";t.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>t.begin());e.renderer.onAfterUpdate.add(()=>t.end()); diff --git a/examples/assets/areaMeasurement.js b/examples/assets/areaMeasurement.js index 66a8936f5..ce49c5d72 100644 --- a/examples/assets/areaMeasurement.js +++ b/examples/assets/areaMeasurement.js @@ -1 +1 @@ -import{B as c,M as d,a as m}from"./web-ifc-api-JuXSH2nk.js";import{S as l}from"./stats.min-GTpOrGrX.js";import{o as i,a as w,M as p,N as u,h as b}from"./index-DtdmE_hK.js";import{$ as f,J as h}from"./index-Cm7YlCft.js";import"./_commonjsHelpers-Cpj98o6Y.js";const a=document.getElementById("container"),n=new i,g=n.get(w),e=g.create();e.scene=new p(n);e.renderer=new f(n,a);e.camera=new u(n);n.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const y=n.get(b);y.create(e);e.scene.three.background=null;const M=new c(3,3,3),k=new d({color:"#6528D7"}),s=new m(M,k);s.position.set(0,1.5,0);e.scene.three.add(s);e.meshes.add(s);const t=n.get(h);t.world=e;t.enabled=!0;a.ondblclick=()=>t.create();a.oncontextmenu=()=>t.endCreation();window.onkeydown=r=>{(r.code==="Delete"||r.code==="Backspace")&&t.deleteAll()};const o=new l;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); +import{B as c,M as d,a as m}from"./web-ifc-api-Dlf_dxms.js";import{S as l}from"./stats.min-bmkVNhZk.js";import{p as i,A as p,e as w,v as u,O as b}from"./index-6e07lNWw.js";import{P as f,o as g}from"./index-DDq_E_eW.js";const s=document.getElementById("container"),n=new i,y=n.get(p),e=y.create();e.scene=new w(n);e.renderer=new f(n,s);e.camera=new u(n);n.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const h=n.get(b);h.create(e);e.scene.three.background=null;const k=new c(3,3,3),A=new d({color:"#6528D7"}),a=new m(k,A);a.position.set(0,1.5,0);e.scene.three.add(a);e.meshes.add(a);const t=n.get(g);t.world=e;t.enabled=!0;s.ondblclick=()=>t.create();s.oncontextmenu=()=>t.endCreation();window.onkeydown=r=>{(r.code==="Delete"||r.code==="Backspace")&&t.deleteAll()};const o=new l;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); diff --git a/examples/assets/bCFTopics.js b/examples/assets/bCFTopics.js index c21b28412..88f10384d 100644 --- a/examples/assets/bCFTopics.js +++ b/examples/assets/bCFTopics.js @@ -1,4 +1,4 @@ -import{bb as I}from"./web-ifc-api-JuXSH2nk.js";import{d as S,R as f,m as w}from"./index-CqPyogbW.js";import{C as F,W as B,S as D,I as P,a as x,F as A,B as E,V as L}from"./index-BICSFNrK.js";import{S as M,a as R,G as T}from"./index-M03DNf7F.js";import"./_commonjsHelpers-Cpj98o6Y.js";S.init();const e=new F,j=e.get(B),n=j.create(),u=new M(e);u.setup();n.scene=u;n.scene.three.add(new I(10));const s=document.createElement("bim-viewport"),b=new R(e,s);n.renderer=b;const g=new D(e);n.camera=g;s.addEventListener("resize",()=>{b.resize(),g.updateAspect()});const l=document.createElement("bim-grid");l.floating=!0;s.append(l);const G=e.get(T);G.create(n);e.init();const y=e.get(P);await y.setup();const V=e.get(x),k=e.get(A);k.onFragmentsLoaded.add(async t=>{n.scene.three.add(t),t.hasProperties&&await V.process(t);for(const o of t.items)n.meshes.add(o.mesh)});const W=async t=>{const o=[];for(const i of t){const r=await(await fetch(i)).arrayBuffer(),c=new Uint8Array(r),m=await y.load(c);o.push(m)}return o},z=await W(["https://thatopen.github.io/engine_components/resources/small.ifc"]),H=z[0],a=e.get(E);a.setup({types:new Set([...a.config.types,"Information","Coordination"]),statuses:new Set(["Active","In Progress","Done","In Review","Closed"]),users:new Set(["juan.hoyos4@gmail.com"])});const U=e.get(L);l.layouts={main:{template:` +import{bk as I}from"./web-ifc-api-Dlf_dxms.js";import{T as S,z as f,m as w}from"./index-DtbylpTq.js";import{C as F,W as B,S as D,I as P,d as T,F as x,B as A,V as E}from"./index-Cs1SYVzD.js";import{S as L,a as M,G as j}from"./index-DDyOrdLb.js";S.init();const e=new F,k=e.get(B),n=k.create(),u=new L(e);u.setup();n.scene=u;n.scene.three.add(new I(10));const s=document.createElement("bim-viewport"),b=new M(e,s);n.renderer=b;const g=new D(e);n.camera=g;s.addEventListener("resize",()=>{b.resize(),g.updateAspect()});const l=document.createElement("bim-grid");l.floating=!0;s.append(l);const z=e.get(j);z.create(n);e.init();const y=e.get(P);await y.setup();const G=e.get(T),V=e.get(x);V.onFragmentsLoaded.add(async t=>{n.scene.three.add(t),t.hasProperties&&await G.process(t);for(const o of t.items)n.meshes.add(o.mesh)});const R=async t=>{const o=[];for(const i of t){const r=await(await fetch(i)).arrayBuffer(),c=new Uint8Array(r),m=await y.load(c);o.push(m)}return o},W=await R(["https://thatopen.github.io/engine_components/resources/small.ifc"]),H=W[0],a=e.get(A);a.setup({types:new Set([...a.config.types,"Information","Coordination"]),statuses:new Set(["Active","In Progress","Done","In Review","Closed"]),users:new Set(["juan.hoyos4@gmail.com"])});const U=e.get(E);l.layouts={main:{template:` "empty topicPanel" 1fr /1fr 22rem `,elements:{}}};const $=async t=>{const o={viewpoints:[],topics:[]};for(const i of t){const r=await(await fetch(i)).arrayBuffer(),{viewpoints:c,topics:m}=await a.load(new Uint8Array(r),n);o.viewpoints.push(...c),o.topics.push(...m)}return o};await $([]);const p=a.create({title:"Missing information",description:"It seems these elements are badly defined.",dueDate:new Date("08-01-2020"),type:"Clash",priority:"Major",stage:"Design",labels:new Set(["Architecture","Cost Estimation"]),assignedTo:"juan.hoyos4@gmail.com"}),d=U.create(n,{title:"Custom Viewpoint"});d.addComponentsFromMap(H.getFragmentMap([186]));p.viewpoints.add(d.guid);const h=p.createComment("What if we talk about this next meeting?");h.author="juan.hoyos4@gmail.com";p.createComment("Hi there! I agree.");h.viewpoint=d;const N=f.create(()=>w` diff --git a/examples/assets/boundingBoxer.js b/examples/assets/boundingBoxer.js index edb948db0..400800ac5 100644 --- a/examples/assets/boundingBoxer.js +++ b/examples/assets/boundingBoxer.js @@ -1,16 +1,16 @@ -import"./web-ifc-api-JuXSH2nk.js";import{S as c}from"./stats.min-GTpOrGrX.js";import{d as l,R as a,m as r}from"./index-CqPyogbW.js";import{o as d,a as m,M as p,v as b,N as u,h as g,_ as f,m as h}from"./index-DtdmE_hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const w=document.getElementById("container"),t=new d,y=t.get(m),e=y.create();e.scene=new p(t);e.renderer=new b(t,w);e.camera=new u(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const v=t.get(g);v.create(e);e.scene.three.background=null;const B=t.get(f),x=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),k=await x.arrayBuffer(),L=new Uint8Array(k),i=B.load(L);e.scene.three.add(i);const s=t.get(h);s.add(i);const M=s.getMesh();s.reset();const n=new c;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end());l.init();const o=a.create(()=>r` +import"./web-ifc-api-Dlf_dxms.js";import{S as i}from"./stats.min-bmkVNhZk.js";import{T as l,z as a,m as r}from"./index-DtbylpTq.js";import{p as d,A as m,e as p,m as b,v as u,O as g,T as f,w}from"./index-6e07lNWw.js";const h=document.getElementById("container"),t=new d,y=t.get(m),e=y.create();e.scene=new p(t);e.renderer=new b(t,h);e.camera=new u(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const v=t.get(g);v.create(e);e.scene.three.background=null;const B=t.get(f),T=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),x=await T.arrayBuffer(),A=new Uint8Array(x),c=B.load(A);e.scene.three.add(c);const s=t.get(w);s.add(c);const k=s.getMesh();s.reset();const n=new i;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end());l.init();const o=a.create(()=>r` + @click="${()=>{e.camera.controls.fitToSphere(k,!0)}}"> - `);document.body.append(o);const A=a.create(()=>r` + `);document.body.append(o);const L=a.create(()=>r` - `);document.body.append(A); + `);document.body.append(L); diff --git a/examples/assets/civil3DNavigator.js b/examples/assets/civil3DNavigator.js index 077e2abdd..e92cd7698 100644 --- a/examples/assets/civil3DNavigator.js +++ b/examples/assets/civil3DNavigator.js @@ -1 +1 @@ -import{r as i,S as p}from"./web-ifc-api-JuXSH2nk.js";import{o as l,a as m,M as h,N as f,h as g,_ as u,c as w}from"./index-DtdmE_hK.js";import{S as y}from"./stats.min-GTpOrGrX.js";import{X as b,q as S}from"./index-Cm7YlCft.js";import"./_commonjsHelpers-Cpj98o6Y.js";const d=document.getElementById("container"),t=new l,U=t.get(m),e=U.create();e.scene=new h(t);e.renderer=new b(t,d);e.camera=new f(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);d.appendChild(e.renderer.three2D.domElement);const _=t.get(g);_.create(e);e.scene.three.background=null;const v=t.get(u),A=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),B=await A.arrayBuffer(),E=new Uint8Array(B),r=await v.load(E);e.scene.three.add(r);const I=await fetch("https://thatopen.github.io/engine_components/resources/road.json");r.setLocalProperties(await I.json());const a=t.get(S);a.world=e;a.draw(r);const L=t.get(w),s=L.create(e);s.threshold=10;for(const o of r.children)o instanceof i&&s.add(o);s.needsUpdate=!0;e.camera.controls.addEventListener("sleep",()=>{s.needsUpdate=!0});const c=new p(void 0,20);a.onHighlight.add(({point:o})=>{c.center.copy(o),e.camera.controls.fitToSphere(c,!0)});const n=new y;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); +import{s as i,S as p}from"./web-ifc-api-Dlf_dxms.js";import{p as l,A as m,e as h,v as f,O as g,T as u,F as w}from"./index-6e07lNWw.js";import{S as y}from"./stats.min-bmkVNhZk.js";import{n as b,i as v}from"./index-DDq_E_eW.js";const d=document.getElementById("container"),t=new l,A=t.get(m),e=A.create();e.scene=new h(t);e.renderer=new b(t,d);e.camera=new f(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);d.appendChild(e.renderer.three2D.domElement);const S=t.get(g);S.create(e);e.scene.three.background=null;const U=t.get(u),B=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),E=await B.arrayBuffer(),I=new Uint8Array(E),r=await U.load(I);e.scene.three.add(r);const L=await fetch("https://thatopen.github.io/engine_components/resources/road.json");r.setLocalProperties(await L.json());const a=t.get(v);a.world=e;a.draw(r);const T=t.get(w),s=T.create(e);s.threshold=10;for(const o of r.children)o instanceof i&&s.add(o);s.needsUpdate=!0;e.camera.controls.addEventListener("sleep",()=>{s.needsUpdate=!0});const c=new p(void 0,20);a.onHighlight.add(({point:o})=>{c.center.copy(o),e.camera.controls.fitToSphere(c,!0)});const n=new y;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); diff --git a/examples/assets/civilCrossSectionNavigator.js b/examples/assets/civilCrossSectionNavigator.js index 20c6bfd52..3e088ebaf 100644 --- a/examples/assets/civilCrossSectionNavigator.js +++ b/examples/assets/civilCrossSectionNavigator.js @@ -1 +1 @@ -import{C as M,L as B}from"./web-ifc-api-JuXSH2nk.js";import{o as E,a as S,M as k,n as D,h as v,_ as x,b as I}from"./index-DtdmE_hK.js";import{d as L}from"./index-CqPyogbW.js";import{Z as A}from"./index-Cb0EycFm.js";import{S as C}from"./stats.min-GTpOrGrX.js";import{X as Z,Z as _,q as P,Q as U,K as j}from"./index-Cm7YlCft.js";import"./_commonjsHelpers-Cpj98o6Y.js";L.init();A.init();const y=document.getElementById("container"),e=new E,q=e.get(S),t=q.create();t.scene=new k(e);t.renderer=new Z(e,y);t.camera=new D(e);e.init();t.scene.setup();t.camera.controls.setLookAt(5,5,5,0,0,0);y.appendChild(t.renderer.three2D.domElement);const H=e.get(v);H.create(t);t.scene.three.background=null;const b=e.get(x),K=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),N=await K.arrayBuffer(),Q=new Uint8Array(N),i=b.load(Q);t.scene.three.add(i);const W=await fetch("https://thatopen.github.io/engine_components/resources/road.json");i.setLocalProperties(await W.json());const f=document.getElementById("scene-2d-left");f.components=e;if(!f.world)throw new Error("World not found!");const c=e.get(_);c.world=f.world;await c.draw(i);const l=e.get(P);l.world=t;l.draw(i);const g=document.getElementById("scene-2d-right");g.components=e;if(!g.world)throw new Error("World not found!");const h=e.get(U);h.world=g.world;h.world3D=t;c.onMarkerChange.add(({alignment:o,percentage:n,type:r,curve:s})=>{if(l.setMarker(o,n,r),r==="select"){const d=s.alignment.absolute[s.index].mesh,m=o.getPointAt(n,"absolute");h.set(d,m)}});c.onHighlight.add(({mesh:o})=>{l.highlighter.select(o);const n=o.curve.index,r=o.curve.alignment.absolute[n];r.mesh.geometry.computeBoundingSphere();const s=r.mesh.geometry.boundingSphere;s&&t.camera.controls.fitToSphere(s,!0)});c.onMarkerHidden.add(({type:o})=>{l.hideMarker(o)});const p=e.get(I);p.byEntity(i);const X=p.list,w=e.get(j),u=w.styles.list;for(const o in X.entities){const n=p.find({entities:[o]}),r=new M(Math.random(),Math.random(),Math.random()),s=new B({color:r});w.styles.create(o,new Set,g.world,s);for(const d in n){const m=b.list.get(d);m&&(u[o].fragments[d]=new Set(n[d]),u[o].meshes.add(m.mesh))}}w.update(!0);const a=new C;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>a.begin());t.renderer.onAfterUpdate.add(()=>a.end()); +import{C as M,L as v}from"./web-ifc-api-Dlf_dxms.js";import{p as B,A as E,e as S,_ as k,O as A,T as D,U as x}from"./index-6e07lNWw.js";import{T as I}from"./index-DtbylpTq.js";import{v as L}from"./index-CO3KVvRB.js";import{S as T}from"./stats.min-bmkVNhZk.js";import{n as U,s as C,i as O,r as _,O as P}from"./index-DDq_E_eW.js";I.init();L.init();const y=document.getElementById("container"),e=new B,j=e.get(E),t=j.create();t.scene=new S(e);t.renderer=new U(e,y);t.camera=new k(e);e.init();t.scene.setup();t.camera.controls.setLookAt(5,5,5,0,0,0);y.appendChild(t.renderer.three2D.domElement);const H=e.get(A);H.create(t);t.scene.three.background=null;const b=e.get(D),N=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),W=await N.arrayBuffer(),z=new Uint8Array(W),d=b.load(z);t.scene.three.add(d);const F=await fetch("https://thatopen.github.io/engine_components/resources/road.json");d.setLocalProperties(await F.json());const f=document.getElementById("scene-2d-left");f.components=e;if(!f.world)throw new Error("World not found!");const c=e.get(C);c.world=f.world;await c.draw(d);const l=e.get(O);l.world=t;l.draw(d);const g=document.getElementById("scene-2d-right");g.components=e;if(!g.world)throw new Error("World not found!");const h=e.get(_);h.world=g.world;h.world3D=t;c.onMarkerChange.add(({alignment:o,percentage:n,type:r,curve:s})=>{if(l.setMarker(o,n,r),r==="select"){const i=s.alignment.absolute[s.index].mesh,m=o.getPointAt(n,"absolute");h.set(i,m)}});c.onHighlight.add(({mesh:o})=>{l.highlighter.select(o);const n=o.curve.index,r=o.curve.alignment.absolute[n];r.mesh.geometry.computeBoundingSphere();const s=r.mesh.geometry.boundingSphere;s&&t.camera.controls.fitToSphere(s,!0)});c.onMarkerHidden.add(({type:o})=>{l.hideMarker(o)});const p=e.get(x);p.byEntity(d);const R=p.list,w=e.get(P),u=w.styles.list;for(const o in R.entities){const n=p.find({entities:[o]}),r=new M(Math.random(),Math.random(),Math.random()),s=new v({color:r});w.styles.create(o,new Set,g.world,s);for(const i in n){const m=b.list.get(i);m&&(u[o].fragments[i]=new Set(n[i]),u[o].meshes.add(m.mesh))}}w.update(!0);const a=new T;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>a.begin());t.renderer.onAfterUpdate.add(()=>a.end()); diff --git a/examples/assets/civilElevationNavigator.js b/examples/assets/civilElevationNavigator.js index 370c4c72d..86009918d 100644 --- a/examples/assets/civilElevationNavigator.js +++ b/examples/assets/civilElevationNavigator.js @@ -1 +1 @@ -import"./web-ifc-api-JuXSH2nk.js";import{o as y,a as S,M as b,n as B,h as k,_ as E}from"./index-DtdmE_hK.js";import{X as M,q as A,Z as I,d as Z}from"./index-Cm7YlCft.js";import{d as x}from"./index-CqPyogbW.js";import{Z as C}from"./index-Cb0EycFm.js";import{S as D}from"./stats.min-GTpOrGrX.js";import"./_commonjsHelpers-Cpj98o6Y.js";x.init();C.init();const f=document.getElementById("container"),t=new y,U=t.get(S),e=U.create();e.scene=new b(t);e.renderer=new M(t,f);e.camera=new B(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);f.appendChild(e.renderer.three2D.domElement);const X=t.get(k);X.create(e);e.scene.three.background=null;const _=t.get(E),q=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),z=await q.arrayBuffer(),L=new Uint8Array(z),c=_.load(L);e.scene.three.add(c);const i=t.get(A);i.world=e;i.draw(c);const g=document.getElementById("scene-2d-left");g.components=t;if(!g.world)throw new Error("World not found!");const l=new I(t);l.world=g.world;l.draw(c);const a=document.getElementById("scene-2d-right");a.components=t;if(!a.world)throw new Error("World not found!");const s=t.get(Z);s.world=a.world;s.draw(c);l.onMarkerChange.add(({alignment:r,percentage:d})=>{s.setMarker(r,d,"hover"),i.setMarker(r,d,"hover")});l.onHighlight.add(({mesh:r,point:d})=>{const{index:v,alignment:h}=r.curve,m=h.getPercentageAt(d,"horizontal");if(m===null)return;const{curve:n}=h.getCurveAt(m,"vertical");if(s.highlighter.select(n.mesh),s.setMarker(n.alignment,m,"select"),a.world){n.mesh.geometry.boundingSphere||n.mesh.geometry.computeBoundingSphere();const w=n.mesh.geometry.boundingSphere.clone();w.radius*=1.5,a.world.camera.controls.fitToSphere(w,!0)}i.highlighter.select(r);const p=r.curve.alignment.absolute[v];p.mesh.geometry.computeBoundingSphere();const u=p.mesh.geometry.boundingSphere;u&&e.camera.controls.fitToSphere(u,!0)});const o=new D;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); +import"./web-ifc-api-Dlf_dxms.js";import{p as y,A as S,e as b,_ as A,O as B,T as k}from"./index-6e07lNWw.js";import{n as E,i as T,s as I,j as M}from"./index-DDq_E_eW.js";import{T as x}from"./index-DtbylpTq.js";import{v as C}from"./index-CO3KVvRB.js";import{S as D}from"./stats.min-bmkVNhZk.js";x.init();C.init();const f=document.getElementById("container"),t=new y,U=t.get(S),e=U.create();e.scene=new b(t);e.renderer=new E(t,f);e.camera=new A(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);f.appendChild(e.renderer.three2D.domElement);const _=t.get(B);_.create(e);e.scene.three.background=null;const z=t.get(k),L=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),N=await L.arrayBuffer(),O=new Uint8Array(N),c=z.load(O);e.scene.three.add(c);const i=t.get(T);i.world=e;i.draw(c);const g=document.getElementById("scene-2d-left");g.components=t;if(!g.world)throw new Error("World not found!");const l=new I(t);l.world=g.world;l.draw(c);const s=document.getElementById("scene-2d-right");s.components=t;if(!s.world)throw new Error("World not found!");const a=t.get(M);a.world=s.world;a.draw(c);l.onMarkerChange.add(({alignment:r,percentage:d})=>{a.setMarker(r,d,"hover"),i.setMarker(r,d,"hover")});l.onHighlight.add(({mesh:r,point:d})=>{const{index:v,alignment:h}=r.curve,m=h.getPercentageAt(d,"horizontal");if(m===null)return;const{curve:n}=h.getCurveAt(m,"vertical");if(a.highlighter.select(n.mesh),a.setMarker(n.alignment,m,"select"),s.world){n.mesh.geometry.boundingSphere||n.mesh.geometry.computeBoundingSphere();const w=n.mesh.geometry.boundingSphere.clone();w.radius*=1.5,s.world.camera.controls.fitToSphere(w,!0)}i.highlighter.select(r);const p=r.curve.alignment.absolute[v];p.mesh.geometry.computeBoundingSphere();const u=p.mesh.geometry.boundingSphere;u&&e.camera.controls.fitToSphere(u,!0)});const o=new D;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); diff --git a/examples/assets/civilPlanNavigator.js b/examples/assets/civilPlanNavigator.js index 83b5fdf77..d0f522cf5 100644 --- a/examples/assets/civilPlanNavigator.js +++ b/examples/assets/civilPlanNavigator.js @@ -1 +1 @@ -import"./web-ifc-api-JuXSH2nk.js";import{o as p,a as g,M as h,n as u,h as f,_ as w}from"./index-DtdmE_hK.js";import{X as y,q as b,Z as v}from"./index-Cm7YlCft.js";import{d as B}from"./index-CqPyogbW.js";import{Z as S}from"./index-Cb0EycFm.js";import{S as x}from"./stats.min-GTpOrGrX.js";import"./_commonjsHelpers-Cpj98o6Y.js";B.init();S.init();const i=document.getElementById("container"),t=new p,Z=t.get(g),e=Z.create();e.scene=new h(t);e.renderer=new y(t,i);e.camera=new u(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);i.appendChild(e.renderer.three2D.domElement);const A=t.get(f);A.create(e);e.scene.three.background=null;const E=t.get(w),I=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),U=await I.arrayBuffer(),_=new Uint8Array(U),r=E.load(_);e.scene.three.add(r);const a=t.get(b);a.world=e;a.draw(r);const m=document.getElementById("scene-2d"),s=t.get(v);m.components=t;s.world=m.world;await s.draw(r);s.onHighlight.add(({mesh:o})=>{a.highlighter.select(o);const l=o.curve.index,d=o.curve.alignment.absolute[l];d.mesh.geometry.computeBoundingSphere();const c=d.mesh.geometry.boundingSphere;c&&e.camera.controls.fitToSphere(c,!0)});const n=new x;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); +import"./web-ifc-api-Dlf_dxms.js";import{p,A as g,e as f,_ as h,O as u,T as w}from"./index-6e07lNWw.js";import{n as y,i as b,s as v}from"./index-DDq_E_eW.js";import{T as A}from"./index-DtbylpTq.js";import{v as B}from"./index-CO3KVvRB.js";import{S}from"./stats.min-bmkVNhZk.js";A.init();B.init();const i=document.getElementById("container"),t=new p,T=t.get(g),e=T.create();e.scene=new f(t);e.renderer=new y(t,i);e.camera=new h(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);i.appendChild(e.renderer.three2D.domElement);const x=t.get(u);x.create(e);e.scene.three.background=null;const E=t.get(w),I=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),U=await I.arrayBuffer(),_=new Uint8Array(U),r=E.load(_);e.scene.three.add(r);const a=t.get(b);a.world=e;a.draw(r);const m=document.getElementById("scene-2d"),s=t.get(v);m.components=t;s.world=m.world;await s.draw(r);s.onHighlight.add(({mesh:o})=>{a.highlighter.select(o);const l=o.curve.index,d=o.curve.alignment.absolute[l];d.mesh.geometry.computeBoundingSphere();const c=d.mesh.geometry.boundingSphere;c&&e.camera.controls.fitToSphere(c,!0)});const n=new S;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); diff --git a/examples/assets/classifier.js b/examples/assets/classifier.js index abfbd40a8..32d73833e 100644 --- a/examples/assets/classifier.js +++ b/examples/assets/classifier.js @@ -1,10 +1,10 @@ -import{a3 as d,C as m}from"./web-ifc-api-JuXSH2nk.js";import{S as u}from"./stats.min-GTpOrGrX.js";import{d as b,R as a,m as c}from"./index-CqPyogbW.js";import{o as p,a as f,M as C,v as w,N as I,h as g,_ as y,b as A}from"./index-DtdmE_hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const E=document.getElementById("container"),s=new p,L=s.get(f),t=L.create();t.scene=new C(s);t.renderer=new w(s,E);t.camera=new I(s);s.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const R=s.get(g);R.create(t);t.scene.three.background=null;const h=new y(s),F=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),N=await F.arrayBuffer(),S=new Uint8Array(N),l=h.load(S);t.scene.three.add(l);const o=s.get(A);o.byEntity(l);o.byIfcRel(l,d,"storeys");o.byModel(l.uuid,l);const T=o.find({entities:["IFCWALLSTANDARDCASE"]}),v=o.find({entities:["IFCSLAB"]}),$=o.find({entities:["IFCMEMBER","IFCPLATE"]}),M=o.find({entities:["IFCFURNISHINGELEMENT"]}),U=o.find({entities:["IFCDOOR"]}),B=o.find({models:[l.uuid]}),i=new u;i.showPanel(2);document.body.append(i.dom);i.dom.style.left="0px";i.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>i.begin());t.renderer.onAfterUpdate.add(()=>i.end());b.init();const e=new m,r=a.create(()=>c` +import{ac as m,C as u}from"./web-ifc-api-Dlf_dxms.js";import{S as d}from"./stats.min-bmkVNhZk.js";import{T as b,z as a,m as c}from"./index-DtbylpTq.js";import{p,A as f,e as C,m as w,v as I,O as g,T as A,U as y}from"./index-6e07lNWw.js";const E=document.getElementById("container"),s=new p,T=s.get(f),t=T.create();t.scene=new C(s);t.renderer=new w(s,E);t.camera=new I(s);s.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const L=s.get(g);L.create(t);t.scene.three.background=null;const h=new A(s),F=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),R=await F.arrayBuffer(),S=new Uint8Array(R),l=h.load(S);t.scene.three.add(l);const o=s.get(y);o.byEntity(l);o.byIfcRel(l,m,"storeys");o.byModel(l.uuid,l);const U=o.find({entities:["IFCWALLSTANDARDCASE"]}),v=o.find({entities:["IFCSLAB"]}),N=o.find({entities:["IFCMEMBER","IFCPLATE"]}),$=o.find({entities:["IFCFURNISHINGELEMENT"]}),B=o.find({entities:["IFCDOOR"]}),D=o.find({models:[l.uuid]}),i=new d;i.showPanel(2);document.body.append(i.dom);i.dom.style.left="0px";i.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>i.begin());t.renderer.onAfterUpdate.add(()=>i.end());b.init();const e=new u,r=a.create(()=>c` + @input="${({target:n})=>{e.set(n.color),o.setColor(U,e)}}"> + @input="${({target:n})=>{e.set(n.color),o.setColor(N,e)}}"> + @input="${({target:n})=>{e.set(n.color),o.setColor($,e)}}"> + @input="${({target:n})=>{e.set(n.color),o.setColor(B,e)}}"> + @click="${()=>{o.resetColor(D)}}"> - `);document.body.append(r);const D=a.create(()=>c` + `);document.body.append(r);const O=a.create(()=>c` - `);document.body.append(D); + `);document.body.append(O); diff --git a/examples/assets/clipEdges.js b/examples/assets/clipEdges.js index 145721eff..eb1884b28 100644 --- a/examples/assets/clipEdges.js +++ b/examples/assets/clipEdges.js @@ -1,4 +1,4 @@ -import{B as w,M as y,a as d,b as c,L as b}from"./web-ifc-api-JuXSH2nk.js";import{S as f}from"./stats.min-GTpOrGrX.js";import{d as k,R as m,m as p}from"./index-CqPyogbW.js";import{o as x,a as v,M as P,N as $,h as B,t as I,l as L}from"./index-DtdmE_hK.js";import{$ as C,K as D,c as z}from"./index-Cm7YlCft.js";import"./_commonjsHelpers-Cpj98o6Y.js";const u=document.getElementById("container"),o=new x,E=o.get(v),e=E.create();e.scene=new P(o);e.renderer=new C(o,u);e.camera=new $(o);e.renderer.postproduction.enabled=!0;e.renderer.postproduction.customEffects.outlineEnabled=!0;o.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const h=o.get(B);h.config.color.setHex(6710886);const S=h.create(e);e.renderer.postproduction.customEffects.excludedMeshes.push(S.three);e.scene.three.background=null;const M=new w(3,3,3),g=new y({color:"#6528D7"}),a=new d(M,g);a.position.set(-2,1.5,0);e.scene.three.add(a);e.meshes.add(a);const l=new d(M,g);l.position.set(2,1.5,0);e.scene.three.add(l);e.meshes.add(l);const R=o.get(I);R.get(e);const n=o.get(L);n.enabled=!0;const r=o.get(D);n.Type=z;const A=new c({color:"lightblue",side:2}),O=new b({color:"blue"}),F=new c({color:"blue",opacity:.5,side:2,transparent:!0});r.styles.create("Red lines",new Set([a]),e,O,A,F);const G=new c({color:"salmon",side:2}),K=new b({color:"red"}),N=new c({color:"red",opacity:.5,side:2,transparent:!0});r.styles.create("Blue lines",new Set([l]),e,K,G,N);u.ondblclick=()=>{n.enabled&&n.create(e)};window.onkeydown=t=>{(t.code==="Delete"||t.code==="Backspace")&&n.enabled&&n.delete(e)};const s=new f;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end());k.init();const i=m.create(()=>p` +import{B as M,M as y,a as d,b as c,L as b}from"./web-ifc-api-Dlf_dxms.js";import{S as f}from"./stats.min-bmkVNhZk.js";import{T as k,z as m,m as p}from"./index-DtbylpTq.js";import{p as v,A as x,e as P,v as B,O as I,o as L,S as $}from"./index-6e07lNWw.js";import{P as z,O,g as S}from"./index-DDq_E_eW.js";const u=document.getElementById("container"),o=new v,C=o.get(x),e=C.create();e.scene=new P(o);e.renderer=new z(o,u);e.camera=new B(o);e.renderer.postproduction.enabled=!0;e.renderer.postproduction.customEffects.outlineEnabled=!0;o.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const h=o.get(I);h.config.color.setHex(6710886);const D=h.create(e);e.renderer.postproduction.customEffects.excludedMeshes.push(D.three);e.scene.three.background=null;const g=new M(3,3,3),w=new y({color:"#6528D7"}),a=new d(g,w);a.position.set(-2,1.5,0);e.scene.three.add(a);e.meshes.add(a);const l=new d(g,w);l.position.set(2,1.5,0);e.scene.three.add(l);e.meshes.add(l);const A=o.get(L);A.get(e);const n=o.get($);n.enabled=!0;const r=o.get(O);n.Type=S;const E=new c({color:"lightblue",side:2}),T=new b({color:"blue"}),F=new c({color:"blue",opacity:.5,side:2,transparent:!0});r.styles.create("Red lines",new Set([a]),e,T,E,F);const G=new c({color:"salmon",side:2}),R=new b({color:"red"}),U=new c({color:"red",opacity:.5,side:2,transparent:!0});r.styles.create("Blue lines",new Set([l]),e,R,G,U);u.ondblclick=()=>{n.enabled&&n.create(e)};window.onkeydown=t=>{(t.code==="Delete"||t.code==="Backspace")&&n.enabled&&n.delete(e)};const s=new f;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end());k.init();const i=m.create(()=>p` @@ -45,8 +45,8 @@ import{B as w,M as y,a as d,b as c,L as b}from"./web-ifc-api-JuXSH2nk.js";import - `);document.body.append(i);const T=m.create(()=>p` + `);document.body.append(i);const W=m.create(()=>p` - `);document.body.append(T); + `);document.body.append(W); diff --git a/examples/assets/clipper.js b/examples/assets/clipper.js index 5cf04ec75..126ea9a81 100644 --- a/examples/assets/clipper.js +++ b/examples/assets/clipper.js @@ -1,4 +1,4 @@ -import{B as r,M as m,a as d}from"./web-ifc-api-JuXSH2nk.js";import{S as p}from"./stats.min-GTpOrGrX.js";import{d as u,R as s,m as c}from"./index-CqPyogbW.js";import{o as h,a as g,M as k,v as w,N as v,t as y,l as M}from"./index-DtdmE_hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const b=document.getElementById("container"),a=new h,f=a.get(g),e=f.create();e.scene=new k(a);e.renderer=new w(a,b);e.camera=new v(a);a.init();e.camera.controls.setLookAt(10,10,10,0,0,0);e.scene.setup();e.scene.three.background=null;const x=new r(3,3,3),$=new m({color:"#6528D7"}),o=new d(x,$);o.position.set(0,1.5,0);e.scene.three.add(o);e.meshes.add(o);const P=a.get(y);P.get(e);const t=a.get(M);t.enabled=!0;b.ondblclick=()=>{t.enabled&&t.create(e)};window.onkeydown=n=>{(n.code==="Delete"||n.code==="Backspace")&&t.enabled&&t.delete(e)};const l=new p;l.showPanel(2);document.body.append(l.dom);l.dom.style.left="0px";l.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>l.begin());e.renderer.onAfterUpdate.add(()=>l.end());u.init();const i=s.create(()=>c` +import{B as r,M as m,a as d,C as p}from"./web-ifc-api-Dlf_dxms.js";import{S as u}from"./stats.min-bmkVNhZk.js";import{T as h,z as s,m as c}from"./index-DtbylpTq.js";import{p as g,A as f,e as k,m as w,v,o as y,S as M}from"./index-6e07lNWw.js";const b=document.getElementById("container"),t=new g,x=t.get(f),e=x.create();e.scene=new k(t);e.renderer=new w(t,b);e.camera=new v(t);t.init();e.camera.controls.setLookAt(10,10,10,0,0,0);e.scene.setup();e.scene.three.background=null;const C=new r(3,3,3),$=new m({color:"#6528D7"}),a=new d(C,$);a.position.set(0,1.5,0);e.scene.three.add(a);e.meshes.add(a);const P=t.get(y);P.get(e);const o=t.get(M);o.enabled=!0;b.ondblclick=()=>{o.enabled&&o.create(e)};window.onkeydown=n=>{(n.code==="Delete"||n.code==="Backspace")&&o.enabled&&o.delete(e)};const l=new u;l.showPanel(2);document.body.append(l.dom);l.dom.style.left="0px";l.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>l.begin());e.renderer.onAfterUpdate.add(()=>l.end());h.init();const i=s.create(()=>c` @@ -10,43 +10,43 @@ import{B as r,M as m,a as d}from"./web-ifc-api-JuXSH2nk.js";import{S as p}from". + @change="${({target:n})=>{o.config.enabled=n.value}}"> + @change="${({target:n})=>{o.config.visible=n.value}}"> + @input="${({target:n})=>{o.config.color=new p(n.color)}}"> + @change="${({target:n})=>{o.config.opacity=n.value}}"> + @change="${({target:n})=>{o.config.size=n.value}}"> + @click="${()=>{o.deleteAll()}}"> + @click="${()=>{a.rotation.x=2*Math.PI*Math.random(),a.rotation.y=2*Math.PI*Math.random(),a.rotation.z=2*Math.PI*Math.random()}}"> - `);document.body.append(i);const C=s.create(()=>c` + `);document.body.append(i);const z=s.create(()=>c` - `);document.body.append(C); + `);document.body.append(z); diff --git a/examples/assets/cullers.js b/examples/assets/cullers.js index e50826661..7316b3f29 100644 --- a/examples/assets/cullers.js +++ b/examples/assets/cullers.js @@ -1 +1 @@ -import{B as c,ad as l,a as i}from"./web-ifc-api-JuXSH2nk.js";import{S as m}from"./stats.min-GTpOrGrX.js";import{o as p,a as u,M as y,v as b,N as g,h as f,c as h}from"./index-DtdmE_hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const w=document.getElementById("container"),t=new p,M=t.get(u),e=M.create();e.scene=new y(t);e.renderer=new b(t,w);e.camera=new g(t);t.init();e.camera.controls.setLookAt(13,13,13,0,0,0);e.scene.setup();const x=t.get(f);x.create(e);e.scene.three.background=null;const v=t.get(h),o=v.create(e);o.threshold=200;o.renderDebugFrame=!0;const s=o.renderer.domElement;document.body.appendChild(s);s.style.position="fixed";s.style.left="0";s.style.bottom="0";s.style.visibility="collapse";const B=new c(2,2,2),U=new l({color:"#6528D7"});function d(a){return Math.random()*a}function E(){for(let a=0;a<300;a++){const n=new i(B,U);n.position.x=d(10),n.position.y=d(10),n.position.z=d(10),n.updateMatrix(),e.scene.three.add(n),o.add(n)}}E();o.needsUpdate=!0;e.camera.controls.addEventListener("controlend",()=>{o.needsUpdate=!0});const r=new m;r.showPanel(2);document.body.append(r.dom);r.dom.style.left="0px";r.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>r.begin());e.renderer.onAfterUpdate.add(()=>r.end()); +import{B as c,Z as i,a as l}from"./web-ifc-api-Dlf_dxms.js";import{S as m}from"./stats.min-bmkVNhZk.js";import{p,A as u,e as g,m as y,v as b,O as f,F as w}from"./index-6e07lNWw.js";const h=document.getElementById("container"),t=new p,x=t.get(u),e=x.create();e.scene=new g(t);e.renderer=new y(t,h);e.camera=new b(t);t.init();e.camera.controls.setLookAt(13,13,13,0,0,0);e.scene.setup();const M=t.get(f);M.create(e);e.scene.three.background=null;const v=t.get(w),o=v.create(e);o.threshold=200;o.config.renderDebugFrame=!0;const s=o.renderer.domElement;document.body.appendChild(s);s.style.position="fixed";s.style.left="0";s.style.bottom="0";s.style.visibility="collapse";const A=new c(2,2,2),B=new i({color:"#6528D7"});function d(a){return Math.random()*a}function F(){for(let a=0;a<300;a++){const n=new l(A,B);n.position.x=d(10),n.position.y=d(10),n.position.z=d(10),n.updateMatrix(),e.scene.three.add(n),o.add(n)}}F();o.needsUpdate=!0;e.camera.controls.addEventListener("controlend",()=>{o.needsUpdate=!0});const r=new m;r.showPanel(2);document.body.append(r.dom);r.dom.style.left="0px";r.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>r.begin());e.renderer.onAfterUpdate.add(()=>r.end()); diff --git a/examples/assets/edgeMeasurement.js b/examples/assets/edgeMeasurement.js index 282b86a28..46e1657ab 100644 --- a/examples/assets/edgeMeasurement.js +++ b/examples/assets/edgeMeasurement.js @@ -1 +1 @@ -import{a as c}from"./web-ifc-api-JuXSH2nk.js";import{S as i}from"./stats.min-GTpOrGrX.js";import{o as l,a as m,M as f,N as w,h as p,_ as h}from"./index-DtdmE_hK.js";import{$ as g,n as u}from"./index-Cm7YlCft.js";import"./_commonjsHelpers-Cpj98o6Y.js";const r=document.getElementById("container"),t=new l,y=t.get(m),e=y.create();e.scene=new f(t);e.renderer=new g(t,r);e.camera=new w(t);t.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const b=t.get(p);b.create(e);e.scene.three.background=null;const k=new h(t),A=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),B=await A.arrayBuffer(),K=new Uint8Array(B),d=k.load(K);e.scene.three.add(d);for(const o of d.children)o instanceof c&&e.meshes.add(o);const n=t.get(u);n.world=e;n.enabled=!0;r.ondblclick=()=>n.create();let a;window.addEventListener("keydown",o=>{o.code==="KeyO"?n.delete():o.code==="KeyS"?(a=n.get(),n.deleteAll()):o.code==="KeyL"&&a&&n.set(a)});const s=new i;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end()); +import{a as c}from"./web-ifc-api-Dlf_dxms.js";import{S as i}from"./stats.min-bmkVNhZk.js";import{p as l,A as f,e as m,v as p,O as w,T as h}from"./index-6e07lNWw.js";import{P as g,h as u}from"./index-DDq_E_eW.js";const r=document.getElementById("container"),t=new l,y=t.get(f),e=y.create();e.scene=new m(t);e.renderer=new g(t,r);e.camera=new p(t);t.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const b=t.get(w);b.create(e);e.scene.three.background=null;const A=new h(t),k=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),B=await k.arrayBuffer(),K=new Uint8Array(B),d=A.load(K);e.scene.three.add(d);for(const o of d.children)o instanceof c&&e.meshes.add(o);const n=t.get(u);n.world=e;n.enabled=!0;r.ondblclick=()=>n.create();let a;window.addEventListener("keydown",o=>{o.code==="KeyO"?n.delete():o.code==="KeyS"?(a=n.get(),n.deleteAll()):o.code==="KeyL"&&a&&n.set(a)});const s=new i;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end()); diff --git a/examples/assets/exploder.js b/examples/assets/exploder.js index 4b5b597ce..29f0171fd 100644 --- a/examples/assets/exploder.js +++ b/examples/assets/exploder.js @@ -1,15 +1,15 @@ -import{av as l}from"./web-ifc-api-JuXSH2nk.js";import{S as d}from"./stats.min-GTpOrGrX.js";import{d as m,R as a,m as i}from"./index-CqPyogbW.js";import{o as p,a as b,M as u,v as g,N as h,h as w,_ as f,x,w as v,b as y}from"./index-DtdmE_hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const S=document.getElementById("container"),e=new p,L=e.get(b),t=L.create();t.scene=new u(e);t.renderer=new g(e,S);t.camera=new h(e);e.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const k=e.get(w);k.create(t);t.scene.three.background=null;const I=new f(e),R=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),_=await R.arrayBuffer(),B=new Uint8Array(_),s=I.load(B);t.scene.three.add(s);const E=await fetch("https://thatopen.github.io/engine_components/resources/small.json");s.setLocalProperties(await E.json());const r=e.get(x),M=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),N=r.getRelationsMapFromJSON(await M.text());r.setRelationMap(s,N);const U=e.get(v),j=e.get(y);await j.bySpatialStructure(s,{isolate:new Set([l])});const n=new d;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>n.begin());t.renderer.onAfterUpdate.add(()=>n.end());m.init();const o=a.create(()=>i` +import{aA as l}from"./web-ifc-api-Dlf_dxms.js";import{S as m}from"./stats.min-bmkVNhZk.js";import{T as p,z as a,m as i}from"./index-DtbylpTq.js";import{p as d,A as b,e as u,m as g,v as h,O as f,T as w,k as x,z as y,U as v}from"./index-6e07lNWw.js";const k=document.getElementById("container"),e=new d,S=e.get(b),t=S.create();t.scene=new u(e);t.renderer=new g(e,k);t.camera=new h(e);e.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const A=e.get(f);A.create(t);t.scene.three.background=null;const L=new w(e),T=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),U=await T.arrayBuffer(),z=new Uint8Array(U),s=L.load(z);t.scene.three.add(s);const I=await fetch("https://thatopen.github.io/engine_components/resources/small.json");s.setLocalProperties(await I.json());const r=e.get(x),B=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),E=r.getRelationsMapFromJSON(await B.text());r.setRelationMap(s,E);const O=e.get(y),j=e.get(v);await j.bySpatialStructure(s,{isolate:new Set([l])});const n=new m;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>n.begin());t.renderer.onAfterUpdate.add(()=>n.end());p.init();const o=a.create(()=>i` + @change="${({target:c})=>{O.set(c.value)}}"> - `);document.body.append(o);const A=a.create(()=>i` + `);document.body.append(o);const F=a.create(()=>i` - `);document.body.append(A); + `);document.body.append(F); diff --git a/examples/assets/faceMeasurement.js b/examples/assets/faceMeasurement.js index a12e697ff..ba39f55aa 100644 --- a/examples/assets/faceMeasurement.js +++ b/examples/assets/faceMeasurement.js @@ -1 +1 @@ -import{a as c}from"./web-ifc-api-JuXSH2nk.js";import{S as i}from"./stats.min-GTpOrGrX.js";import{o as l,a as m,M as f,N as w,h as p,_ as h}from"./index-DtdmE_hK.js";import{$ as g,t as u}from"./index-Cm7YlCft.js";import"./_commonjsHelpers-Cpj98o6Y.js";const r=document.getElementById("container"),t=new l,y=t.get(m),e=y.create();e.scene=new f(t);e.renderer=new g(t,r);e.camera=new w(t);t.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const b=t.get(p);b.create(e);e.scene.three.background=null;const k=new h(t),A=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),B=await A.arrayBuffer(),K=new Uint8Array(B),d=k.load(K);e.scene.three.add(d);for(const o of d.children)o instanceof c&&e.meshes.add(o);const n=t.get(u);n.world=e;n.enabled=!0;r.ondblclick=()=>n.create();let a;window.addEventListener("keydown",o=>{o.code==="KeyO"?n.delete():o.code==="KeyS"?(a=n.get(),n.deleteAll()):o.code==="KeyL"&&a&&n.set(a)});const s=new i;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end()); +import{a as c}from"./web-ifc-api-Dlf_dxms.js";import{S as i}from"./stats.min-bmkVNhZk.js";import{p as l,A as f,e as m,v as p,O as w,T as g}from"./index-6e07lNWw.js";import{P as h,c as u}from"./index-DDq_E_eW.js";const r=document.getElementById("container"),t=new l,y=t.get(f),e=y.create();e.scene=new m(t);e.renderer=new h(t,r);e.camera=new p(t);t.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const b=t.get(w);b.create(e);e.scene.three.background=null;const A=new g(t),k=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),B=await k.arrayBuffer(),K=new Uint8Array(B),d=A.load(K);e.scene.three.add(d);for(const o of d.children)o instanceof c&&e.meshes.add(o);const n=t.get(u);n.world=e;n.enabled=!0;r.ondblclick=()=>n.create();let a;window.addEventListener("keydown",o=>{o.code==="KeyO"?n.delete():o.code==="KeyS"?(a=n.get(),n.deleteAll()):o.code==="KeyL"&&a&&n.set(a)});const s=new i;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end()); diff --git a/examples/assets/fragmentsManager.js b/examples/assets/fragmentsManager.js index 1ffe5ea0a..13039e6a4 100644 --- a/examples/assets/fragmentsManager.js +++ b/examples/assets/fragmentsManager.js @@ -1,26 +1,26 @@ -import"./web-ifc-api-JuXSH2nk.js";import{S as u}from"./stats.min-GTpOrGrX.js";import{o as p,a as b,M as g,v as f,N as w,h,_ as y}from"./index-DtdmE_hK.js";import{d as k,R as l,m as d}from"./index-CqPyogbW.js";import"./_commonjsHelpers-Cpj98o6Y.js";const v=document.getElementById("container"),n=new p,L=n.get(b),e=L.create();e.scene=new g(n);e.renderer=new f(n,v);e.camera=new w(n);n.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const x=n.get(h);x.create(e);e.scene.three.background=null;const s=n.get(y);let m="";async function F(){if(s.groups.size)return;const t=await(await fetch("https://thatopen.github.io/engine_components/resources/small.frag")).arrayBuffer(),c=new Uint8Array(t),r=s.load(c);e.scene.three.add(r),m=r.uuid}function U(o){const t=document.createElement("a");t.href=URL.createObjectURL(o),t.download=o.name,document.body.appendChild(t),t.click(),t.remove()}function B(){if(!s.groups.size)return;const o=s.groups.get(m);if(!o)return;const t=s.export(o),c=new Blob([t]),r=new File([c],"small.frag");U(r)}function R(){s.dispose()}const a=new u;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>a.begin());e.renderer.onAfterUpdate.add(()=>a.end());k.init();const i=l.create(()=>d` +import"./web-ifc-api-Dlf_dxms.js";import{S as u}from"./stats.min-bmkVNhZk.js";import{p,A as b,e as g,m as f,v as w,O as h,T as y}from"./index-6e07lNWw.js";import{T as k,z as l,m}from"./index-DtbylpTq.js";const v=document.getElementById("container"),n=new p,L=n.get(b),e=L.create();e.scene=new g(n);e.renderer=new f(n,v);e.camera=new w(n);n.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const x=n.get(h);x.create(e);e.scene.three.background=null;const s=n.get(y);let d="";async function z(){if(s.groups.size)return;const t=await(await fetch("https://thatopen.github.io/engine_components/resources/small.frag")).arrayBuffer(),c=new Uint8Array(t),r=s.load(c);e.scene.three.add(r),d=r.uuid}function A(o){const t=document.createElement("a");t.href=URL.createObjectURL(o),t.download=o.name,document.body.appendChild(t),t.click(),t.remove()}function F(){if(!s.groups.size)return;const o=s.groups.get(d);if(!o)return;const t=s.export(o),c=new Blob([t]),r=new File([c],"small.frag");A(r)}function T(){s.dispose()}const a=new u;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>a.begin());e.renderer.onAfterUpdate.add(()=>a.end());k.init();const i=l.create(()=>m` + @click="${()=>{z()}}"> + @click="${()=>{T()}}"> + @click="${()=>{F()}}"> - `);document.body.append(i);const $=l.create(()=>d` + `);document.body.append(i);const U=l.create(()=>m` - `);document.body.append($); + `);document.body.append(U); diff --git a/examples/assets/grids.js b/examples/assets/grids.js index 737f490db..e5cc0a066 100644 --- a/examples/assets/grids.js +++ b/examples/assets/grids.js @@ -1 +1,31 @@ -import{a as t,B as s}from"./web-ifc-api-JuXSH2nk.js";import{o as r,a,M as d,v as c,N as m,h as l}from"./index-DtdmE_hK.js";const w=document.getElementById("container"),n=new r,i=n.get(a),e=i.create();e.scene=new d(n);e.renderer=new c(n,w);e.camera=new m(n);n.init();const g=new t(new s);e.scene.three.add(g);e.scene.three.background=null;const p=n.get(l),h=p.create(e);console.log(h);const o=new Stats;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); +import{a as c,B as l,b as m,C as b}from"./web-ifc-api-Dlf_dxms.js";import{S as d}from"./stats.min-bmkVNhZk.js";import{p,A as u,e as g,m as h,v,O as f}from"./index-6e07lNWw.js";import{T as w,z as a,m as r}from"./index-DtbylpTq.js";const y=document.getElementById("container"),o=new p,x=o.get(u),e=x.create();e.scene=new g(o);e.renderer=new h(o,y);e.camera=new v(o);o.init();const z=new c(new l,new m({color:"red"}));e.scene.three.add(z);e.scene.three.background=null;const G=o.get(f),i=G.create(e);console.log(i);w.init();const t=a.create(()=>r` + + + + + + + + + + + + + + + + + + + `);document.body.append(t);const k=a.create(()=>r` + + + `);document.body.append(k);const s=new d;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end()); diff --git a/examples/assets/hider.js b/examples/assets/hider.js index 5e78a22bf..b8aa47173 100644 --- a/examples/assets/hider.js +++ b/examples/assets/hider.js @@ -1,4 +1,4 @@ -import{av as S}from"./web-ifc-api-JuXSH2nk.js";import{S as k}from"./stats.min-GTpOrGrX.js";import{d as x,R as r,m as l}from"./index-CqPyogbW.js";import{o as v,a as I,M as F,v as C,N as L,h as M,_ as N,x as _,I as j,b as R}from"./index-DtdmE_hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const $=document.getElementById("container"),e=new v,B=e.get(I),t=B.create();t.scene=new F(e);t.renderer=new C(e,$);t.camera=new L(e);e.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const E=e.get(M);E.create(t);t.scene.three.background=null;const b=e.get(N),O=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),U=await O.arrayBuffer(),A=new Uint8Array(U),i=b.load(A);t.scene.three.add(i);const q=await fetch("https://thatopen.github.io/engine_components/resources/small.json");i.setLocalProperties(await q.json());const d=e.get(_),D=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),P=d.getRelationsMapFromJSON(await D.text());d.setRelationMap(i,P);const f=e.get(j),s=e.get(R);s.byEntity(i);await s.bySpatialStructure(i,{isolate:new Set([S])});const a=new k;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>a.begin());t.renderer.onAfterUpdate.add(()=>a.end());x.init();const g={},T=Object.keys(s.list.spatialStructures);for(const n of T)g[n]=!0;const h={},z=Object.keys(s.list.entities);for(const n of z)h[n]=!0;const o=r.create(()=>l` +import{aA as k}from"./web-ifc-api-Dlf_dxms.js";import{S}from"./stats.min-bmkVNhZk.js";import{T as v,z as r,m as l}from"./index-DtbylpTq.js";import{p as x,A as F,e as A,m as C,v as I,O as L,T as O,k as T,a as U,U as j}from"./index-6e07lNWw.js";const M=document.getElementById("container"),e=new x,$=e.get(F),t=$.create();t.scene=new A(e);t.renderer=new C(e,M);t.camera=new I(e);e.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const B=e.get(L);B.create(t);t.scene.three.background=null;const b=e.get(O),E=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),N=await E.arrayBuffer(),_=new Uint8Array(N),i=b.load(_);t.scene.three.add(i);const z=await fetch("https://thatopen.github.io/engine_components/resources/small.json");i.setLocalProperties(await z.json());const d=e.get(T),R=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),q=d.getRelationsMapFromJSON(await R.text());d.setRelationMap(i,q);const f=e.get(U),o=e.get(j);o.byEntity(i);await o.bySpatialStructure(i,{isolate:new Set([k])});const a=new S;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>a.begin());t.renderer.onAfterUpdate.add(()=>a.end());v.init();const g={},D=Object.keys(o.list.spatialStructures);for(const n of D)g[n]=!0;const h={},P=Object.keys(o.list.entities);for(const n of P)h[n]=!0;const s=r.create(()=>l` @@ -9,16 +9,16 @@ import{av as S}from"./web-ifc-api-JuXSH2nk.js";import{S as k}from"./stats.min-GT - `);document.body.append(o);const G=o.querySelector("bim-panel-section[name='Floors']"),H=o.querySelector("bim-panel-section[name='Categories']");for(const n in g){const m=r.create(()=>l` + `);document.body.append(s);const G=s.querySelector("bim-panel-section[name='Floors']"),H=s.querySelector("bim-panel-section[name='Categories']");for(const n in g){const m=r.create(()=>l` + @change="${({target:p})=>{const c=o.list.spatialStructures[n];if(c&&c.id!==null)for(const[Y,u]of b.groups){const w=d.getEntityChildren(u,c.id),y=u.getFragmentMap(w);f.set(p.value,y)}}}"> `);G.append(m)}for(const n in h){const m=r.create(()=>l` + @change="${({target:p})=>{const c=o.find({entities:[n]});f.set(p.value,c)}}"> `);H.append(m)}const J=r.create(()=>l` + @click="${()=>{s.classList.contains("options-menu-visible")?s.classList.remove("options-menu-visible"):s.classList.add("options-menu-visible")}}"> `);document.body.append(J); diff --git a/examples/assets/highlighter.js b/examples/assets/highlighter.js index a0284e5e6..e78ae6fb7 100644 --- a/examples/assets/highlighter.js +++ b/examples/assets/highlighter.js @@ -1 +1 @@ -import{b as s}from"./web-ifc-api-JuXSH2nk.js";import{o as c,a as d,M as l,N as i,h as m,_ as p}from"./index-DtdmE_hK.js";import{$ as u,r as h,W as g}from"./index-Cm7YlCft.js";import{S as f}from"./stats.min-GTpOrGrX.js";import"./_commonjsHelpers-Cpj98o6Y.js";const w=document.getElementById("container"),t=new c,b=t.get(d),e=b.create();e.scene=new l(t);e.renderer=new u(t,w);e.camera=new i(t);t.init();e.renderer.postproduction.enabled=!0;e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const x=t.get(m),y=x.create(e);e.renderer.postproduction.customEffects.excludedMeshes.push(y.three);e.scene.three.background=null;const M=new p(t),B=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),A=await B.arrayBuffer(),S=new Uint8Array(A),U=M.load(S);e.scene.three.add(U);const r=t.get(h);r.setup({world:e});r.zoomToSelection=!0;const n=t.get(g);n.world=e;n.enabled=!0;n.create("example",new s({color:12382500,transparent:!0,opacity:.5}));r.events.select.onHighlight.add(a=>{n.clear("example"),n.add("example",a)});r.events.select.onClear.add(()=>{n.clear("example")});const o=new f;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); +import{b as a}from"./web-ifc-api-Dlf_dxms.js";import{p as c,A as d,e as l,v as i,O as p,T as m}from"./index-6e07lNWw.js";import{P as u,u as f,$ as g}from"./index-DDq_E_eW.js";import{S as h}from"./stats.min-bmkVNhZk.js";const w=document.getElementById("container"),t=new c,b=t.get(d),e=b.create();e.scene=new l(t);e.renderer=new u(t,w);e.camera=new i(t);t.init();e.renderer.postproduction.enabled=!0;e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const x=t.get(p),y=x.create(e);e.renderer.postproduction.customEffects.excludedMeshes.push(y.three);e.scene.three.background=null;const A=new m(t),v=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),B=await v.arrayBuffer(),M=new Uint8Array(B),P=A.load(M);e.scene.three.add(P);const o=t.get(f);o.setup({world:e});o.zoomToSelection=!0;const n=t.get(g);n.world=e;n.enabled=!0;n.create("example",new a({color:12382500,transparent:!0,opacity:.5}));o.events.select.onHighlight.add(s=>{n.clear("example"),n.add("example",s)});o.events.select.onClear.add(()=>{n.clear("example")});const r=new h;r.showPanel(2);document.body.append(r.dom);r.dom.style.left="0px";r.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>r.begin());e.renderer.onAfterUpdate.add(()=>r.end()); diff --git a/examples/assets/iDSSpecifications.js b/examples/assets/iDSSpecifications.js new file mode 100644 index 000000000..dd6a3c706 --- /dev/null +++ b/examples/assets/iDSSpecifications.js @@ -0,0 +1 @@ +import"./web-ifc-api-Dlf_dxms.js";import{C as o,I as r,a as c,b as p,c as m}from"./index-Cs1SYVzD.js";const e=new o,l=e.get(r);await l.setup();const s=e.get(c),t=s.create("My First IDS!",["IFC4X3_ADD2"]);t.description="Description";t.instructions="Instructions";const d=new p(e,{type:"enumeration",parameter:["IFCSLAB","IFCWALL"]});t.applicability.add(d);const a=new m(e,{type:"simple",parameter:"Pset_SlabCommon"},{type:"simple",parameter:"IsExternal"});a.value={type:"simple",parameter:!1};t.requirements.add(a);const I="My Custom IDS",y=s.export({title:I}),i=new File([y],"idsTitle.ids"),n=document.createElement("a");n.href=URL.createObjectURL(i);n.download=i.name; diff --git a/examples/assets/ifcFinder.js b/examples/assets/ifcFinder.js new file mode 100644 index 000000000..de69a2461 --- /dev/null +++ b/examples/assets/ifcFinder.js @@ -0,0 +1,24 @@ +import"./web-ifc-api-Dlf_dxms.js";import{T as w,z as r,m as i}from"./index-DtbylpTq.js";import{S as h}from"./stats.min-bmkVNhZk.js";import{p as v,A as x,e as R,m as F,v as k,O as I,T as $,k as A,G as T,d as B,R as C,a as L}from"./index-6e07lNWw.js";const O=document.getElementById("container"),e=new v,S=e.get(x),t=S.create();t.scene=new R(e);t.renderer=new F(e,O);t.camera=new k(e);e.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const U=e.get(I);U.create(t);t.scene.three.background=null;const z=new $(e),E=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),G=await E.arrayBuffer(),M=new Uint8Array(G),c=z.load(M);t.scene.three.add(c);const m=e.get(A),_=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),j=m.getRelationsMapFromJSON(await _.text());m.setRelationMap(c,j);const N=e.get(T),n=N.create(),P=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),b=new File([await P.arrayBuffer()],"example"),u=new B(e,{name:"category",inclusive:!1,rules:[]});n.add(u);const p={type:"category",value:/IfcWallStandardCase/};u.rules.push(p);const d={type:"property",name:/.*/,value:/yeso/},g=new C(e,{name:"property",inclusive:!1,rules:[d]});n.add(g);await n.update(c.uuid,b);const Q=n.items,o=e.get(L);o.set(!1);o.set(!0,Q);const s=new h;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>s.begin());t.renderer.onAfterUpdate.add(()=>s.end());w.init();const f=r.create(()=>i` + + `),y=r.create(()=>i` + + `),q=async()=>{u.clear(),g.clear(),p.value=new RegExp(f.value),d.value=new RegExp(y.value),await n.update(c.uuid,b);const l=n.items;if(console.log(l),Object.keys(l).length===0){alert("No items found!");return}o.set(!1),o.set(!0,l)},a=r.create(()=>i` + + + + + ${f} + ${y} + + + + + + + + `);document.body.append(a);const J=r.create(()=>i` + + + `);document.body.append(J); diff --git a/examples/assets/ifcGeometryTiler.js b/examples/assets/ifcGeometryTiler.js index 164503314..adb90e475 100644 --- a/examples/assets/ifcGeometryTiler.js +++ b/examples/assets/ifcGeometryTiler.js @@ -1,16 +1,16 @@ -import"./web-ifc-api-JuXSH2nk.js";import{S as w}from"./stats.min-GTpOrGrX.js";import{d as h,R as b,m as g}from"./index-CqPyogbW.js";import{o as y,a as F,M as L,v,N as B,h as I,_ as S,F as U}from"./index-DtdmE_hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const k=document.getElementById("container"),a=new y,A=a.get(F),t=A.create();t.scene=new L(a);t.renderer=new v(a,k);t.camera=new B(a);a.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const D=a.get(I);D.create(t);t.scene.three.background=null;const R=new S(a),N=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),_=await N.arrayBuffer(),j=new Uint8Array(_),x=R.load(j);t.scene.three.add(x);const i=a.get(U),z={path:"https://unpkg.com/web-ifc@0.0.57/",absolute:!0};i.settings.wasm=z;i.settings.minGeometrySize=20;i.settings.minAssetsSize=1e3;let l=[],f={},u=1;i.onGeometryStreamed.add(e=>{const{buffer:s,data:n}=e,o=`small.ifc-processed-geometries-${u}`;for(const c in n){const p=n[c];p.geometryFile=o,f[c]=p}l.push({name:o,bits:[s]}),u++});let d=[];i.onAssetStreamed.add(e=>{d=[...d,...e]});i.onIfcLoaded.add(e=>{l.push({name:"small.ifc-processed-global",bits:[e]})});function C(e,...s){const n=new File(s,e),o=document.createElement("a"),c=URL.createObjectURL(n);o.href=c,o.download=n.name,o.click(),URL.revokeObjectURL(c)}async function G(e){for(const{name:s,bits:n}of e)C(s,...n),await new Promise(o=>{setTimeout(o,100)})}i.onProgress.add(e=>{e===1&&setTimeout(async()=>{const s={geometries:f,assets:d,globalDataFileId:"small.ifc-processed-global"};l.push({name:"small.ifc-processed.json",bits:[JSON.stringify(s)]}),await G(l),d=[],f={},l=[],u=1})});async function O(){const s=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),n=new Uint8Array(s);await i.streamFromBuffer(n)}const r=new w;r.showPanel(2);document.body.append(r.dom);r.dom.style.left="0px";r.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>r.begin());t.renderer.onAfterUpdate.add(()=>r.end());h.init();const m=b.create(()=>g` +import"./web-ifc-api-Dlf_dxms.js";import{S as w}from"./stats.min-bmkVNhZk.js";import{T as h,z as b,m as g}from"./index-DtbylpTq.js";import{p as y,A as F,e as L,m as v,v as A,O as k,T as B,g as I}from"./index-6e07lNWw.js";const S=document.getElementById("container"),a=new y,U=a.get(F),t=U.create();t.scene=new L(a);t.renderer=new v(a,S);t.camera=new A(a);a.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const T=a.get(k);T.create(t);t.scene.three.background=null;const D=new B(a),z=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),O=await z.arrayBuffer(),R=new Uint8Array(O),j=D.load(R);t.scene.three.add(j);const i=a.get(I),x={path:"https://unpkg.com/web-ifc@0.0.57/",absolute:!0};i.settings.wasm=x;i.settings.minGeometrySize=20;i.settings.minAssetsSize=1e3;let l=[],f={},u=1;i.onGeometryStreamed.add(e=>{const{buffer:s,data:n}=e,o=`small.ifc-processed-geometries-${u}`;for(const c in n){const p=n[c];p.geometryFile=o,f[c]=p}l.push({name:o,bits:[s]}),u++});let d=[];i.onAssetStreamed.add(e=>{d=[...d,...e]});i.onIfcLoaded.add(e=>{l.push({name:"small.ifc-processed-global",bits:[e]})});function C(e,...s){const n=new File(s,e),o=document.createElement("a"),c=URL.createObjectURL(n);o.href=c,o.download=n.name,o.click(),URL.revokeObjectURL(c)}async function G(e){for(const{name:s,bits:n}of e)C(s,...n),await new Promise(o=>{setTimeout(o,100)})}i.onProgress.add(e=>{e===1&&setTimeout(async()=>{const s={geometries:f,assets:d,globalDataFileId:"small.ifc-processed-global"};l.push({name:"small.ifc-processed.json",bits:[JSON.stringify(s)]}),await G(l),d=[],f={},l=[],u=1})});async function P(){const s=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),n=new Uint8Array(s);await i.streamFromBuffer(n)}const r=new w;r.showPanel(2);document.body.append(r.dom);r.dom.style.left="0px";r.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>r.begin());t.renderer.onAfterUpdate.add(()=>r.end());h.init();const m=b.create(()=>g` + @click="${()=>{P()}}"> - `);document.body.append(m);const P=b.create(()=>g` + `);document.body.append(m);const $=b.create(()=>g` - `);document.body.append(P); + `);document.body.append($); diff --git a/examples/assets/ifcJsonExporter.js b/examples/assets/ifcJsonExporter.js index 18d31cb78..751e7afc5 100644 --- a/examples/assets/ifcJsonExporter.js +++ b/examples/assets/ifcJsonExporter.js @@ -1,10 +1,10 @@ -import{ac as m}from"./web-ifc-api-JuXSH2nk.js";import{S as b}from"./stats.min-GTpOrGrX.js";import{d as f,R as c,m as i}from"./index-CqPyogbW.js";import{o as u,a as g,M as w,v as h,N as y,h as v,_ as k,g as x}from"./index-DtdmE_hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const I=document.getElementById("container"),t=new u,L=t.get(g),e=L.create();e.scene=new w(t);e.renderer=new h(t,I);e.camera=new y(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const U=t.get(v);U.create(e);e.scene.three.background=null;const B=new k(t),O=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),R=await O.arrayBuffer(),S=new Uint8Array(R),A=B.load(S);e.scene.three.add(A);const N=t.get(x),a=new m;a.SetWasmPath("https://unpkg.com/web-ifc@0.0.57/",!0);await a.Init();const j=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),E=await j.arrayBuffer(),F=new Uint8Array(E),_=a.OpenModel(F),n=new b;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end());f.init();const s=c.create(()=>i` +import{Y as d}from"./web-ifc-api-Dlf_dxms.js";import{S as b}from"./stats.min-bmkVNhZk.js";import{T as f,z as c,m as i}from"./index-DtbylpTq.js";import{p as u,A as w,e as g,m as h,v as y,O as v,T as O,c as k}from"./index-6e07lNWw.js";const x=document.getElementById("container"),t=new u,I=t.get(w),e=I.create();e.scene=new g(t);e.renderer=new h(t,x);e.camera=new y(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const L=t.get(v);L.create(e);e.scene.three.background=null;const U=new O(t),A=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),B=await A.arrayBuffer(),S=new Uint8Array(B),T=U.load(S);e.scene.three.add(T);const j=t.get(k),a=new d;a.SetWasmPath("https://unpkg.com/web-ifc@0.0.57/",!0);await a.Init();const z=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),E=await z.arrayBuffer(),F=new Uint8Array(E),R=a.OpenModel(F),n=new b;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end());f.init();const s=c.create(()=>i` + @click="${async()=>{const l=await j.export(a,R),p=JSON.stringify(l),m=new File([new Blob([p])],"properties.json"),r=URL.createObjectURL(m),o=document.createElement("a");o.download="properties.json",o.href=r,o.click(),URL.revokeObjectURL(r),o.remove()}}"> diff --git a/examples/assets/ifcLoader.js b/examples/assets/ifcLoader.js index e7f35d814..5e72b48dd 100644 --- a/examples/assets/ifcLoader.js +++ b/examples/assets/ifcLoader.js @@ -1,25 +1,25 @@ -import{bf as b,bg as u,bh as f}from"./web-ifc-api-JuXSH2nk.js";import{d as g,R as m,m as p}from"./index-CqPyogbW.js";import{S as w}from"./stats.min-GTpOrGrX.js";import{o as I,a as y,M as h,v as C,N,h as F,_ as L,e as R}from"./index-DtdmE_hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const E=document.getElementById("container"),o=new I,O=o.get(y),t=O.create();t.scene=new h(o);t.renderer=new C(o,E);t.camera=new N(o);o.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const v=o.get(F);v.create(t);t.scene.three.background=null;const a=o.get(L),c=o.get(R);await c.setup();const x=[b,u,f];for(const e of x)c.settings.excludedCategories.add(e);c.settings.webIfc.COORDINATE_TO_ORIGIN=!0;async function k(){const n=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),i=new Uint8Array(n),l=await c.load(i);l.name="example",t.scene.three.add(l)}a.onFragmentsLoaded.add(e=>{console.log(e)});function d(e){const n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=e.name,document.body.appendChild(n),n.click(),n.remove()}async function A(){if(!a.groups.size)return;const e=Array.from(a.groups.values())[0],n=a.export(e);d(new File([new Blob([n])],"small.frag"));const i=e.getLocalProperties();i&&d(new File([JSON.stringify(i)],"small.json"))}function B(){a.dispose()}const s=new w;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>s.begin());t.renderer.onAfterUpdate.add(()=>s.end());g.init();const r=m.create(()=>p` +import{bp as b,bq as u,br as f}from"./web-ifc-api-Dlf_dxms.js";import{T as g,z as m,m as p}from"./index-DtbylpTq.js";import{S as w}from"./stats.min-bmkVNhZk.js";import{p as I,A as y,e as C,m as N,v as F,O as L,T as O,N as h}from"./index-6e07lNWw.js";const E=document.getElementById("container"),o=new I,R=o.get(y),t=R.create();t.scene=new C(o);t.renderer=new N(o,E);t.camera=new F(o);o.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const v=o.get(L);v.create(t);t.scene.three.background=null;const a=o.get(O),i=o.get(h);await i.setup();const x=[b,u,f];for(const e of x)i.settings.excludedCategories.add(e);i.settings.webIfc.COORDINATE_TO_ORIGIN=!0;async function A(){const n=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),r=new Uint8Array(n),l=await i.load(r);l.name="example",t.scene.three.add(l)}a.onFragmentsLoaded.add(e=>{console.log(e)});function d(e){const n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=e.name,document.body.appendChild(n),n.click(),n.remove()}async function T(){if(!a.groups.size)return;const e=Array.from(a.groups.values())[0],n=a.export(e);d(new File([new Blob([n])],"small.frag"));const r=e.getLocalProperties();r&&d(new File([JSON.stringify(r)],"small.json"))}function k(){a.dispose()}const s=new w;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>s.begin());t.renderer.onAfterUpdate.add(()=>s.end());g.init();const c=m.create(()=>p` + @click="${()=>{A()}}"> + @click="${()=>{T()}}"> + @click="${()=>{k()}}"> - `);document.body.append(r);const T=m.create(()=>p` + `);document.body.append(c);const B=m.create(()=>p` + @click="${()=>{c.classList.contains("options-menu-visible")?c.classList.remove("options-menu-visible"):c.classList.add("options-menu-visible")}}"> - `);document.body.append(T); + `);document.body.append(B); diff --git a/examples/assets/ifcPropertiesManager.js b/examples/assets/ifcPropertiesManager.js index 0c9c5fc24..8b4059906 100644 --- a/examples/assets/ifcPropertiesManager.js +++ b/examples/assets/ifcPropertiesManager.js @@ -1 +1 @@ -import{bc as a}from"./web-ifc-api-JuXSH2nk.js";import{C as f,I as u,c as w,U as m}from"./index-BICSFNrK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const s=new f,l=s.get(u);await l.setup();const p=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),i=await p.arrayBuffer(),e=await l.load(new Uint8Array(i)),t=s.get(w),{pset:r}=await t.newPset(e,"CalculatedQuantities"),d=await t.newSingleNumericProperty(e,"IfcReal","Volume",12.25);await t.addPropToPset(e,r.expressID,d.expressID);await t.addElementToPset(e,r.expressID,186);const n=await e.getProperties(186);n&&(n.Name.value="New Wall Name",await t.setData(e,n));const I=new a.IfcTask(new a.IfcGloballyUniqueId(m.create()),null,null,null,null,null,null,null,null,new a.IfcBoolean(!1),null,null,null);await t.setData(e,I);const U=await t.saveToIfc(e,new Uint8Array(i)),c=new File([U],"small-modified.ifc"),o=document.createElement("a");o.href=URL.createObjectURL(c);o.download=c.name;URL.revokeObjectURL(o.href); +import{bl as t}from"./web-ifc-api-Dlf_dxms.js";import{C as f,I as u,f as w,U as m}from"./index-Cs1SYVzD.js";const l=new f,s=l.get(u);await s.setup();const p=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),i=await p.arrayBuffer(),e=await s.load(new Uint8Array(i)),a=l.get(w),{pset:r}=await a.newPset(e,"CalculatedQuantities"),d=await a.newSingleNumericProperty(e,"IfcReal","Volume",12.25);await a.addPropToPset(e,r.expressID,d.expressID);await a.addElementToPset(e,r.expressID,186);const n=await e.getProperties(186);n&&(n.Name.value="New Wall Name",await a.setData(e,n));const I=new t.IfcTask(new t.IfcGloballyUniqueId(m.create()),null,null,null,null,null,null,null,null,new t.IfcBoolean(!1),null,null,null);await a.setData(e,I);const U=await a.saveToIfc(e,new Uint8Array(i)),c=new File([U],"small-modified.ifc"),o=document.createElement("a");o.href=URL.createObjectURL(c);o.download=c.name;URL.revokeObjectURL(o.href); diff --git a/examples/assets/ifcPropertiesTiler.js b/examples/assets/ifcPropertiesTiler.js index 6bb8074ce..13f6d73db 100644 --- a/examples/assets/ifcPropertiesTiler.js +++ b/examples/assets/ifcPropertiesTiler.js @@ -1,18 +1,18 @@ -import"./web-ifc-api-JuXSH2nk.js";import{S as b}from"./stats.min-GTpOrGrX.js";import{d as w,R as f,m as u}from"./index-CqPyogbW.js";import{o as y,a as g,M as h,v as B,N as F,h as L,_ as v,i as x,x as R}from"./index-DtdmE_hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const S=document.getElementById("container"),n=new y,U=n.get(g),s=U.create();s.scene=new h(n);s.renderer=new B(n,S);s.camera=new F(n);n.init();s.camera.controls.setLookAt(12,6,8,0,0,-10);s.scene.setup();const k=n.get(L);k.create(s);s.scene.three.background=null;const I=new v(n),A=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),N=await A.arrayBuffer(),P=new Uint8Array(N),j=I.load(P);s.scene.three.add(j);function O(e,o){const t=new File([o],e),a=document.createElement("a"),p=URL.createObjectURL(t);a.href=p,a.download=t.name,a.click(),URL.revokeObjectURL(p)}async function _(e){for(const{name:o,bits:t}of e)O(o,t),await new Promise(a=>{setTimeout(a,100)})}const c=n.get(x);c.settings.wasm={path:"https://unpkg.com/web-ifc@0.0.57/",absolute:!0};const r={types:{},ids:{},indexesFile:"small.ifc-processed-properties-indexes"};let l=0;const d=[];c.onPropertiesStreamed.add(async e=>{r.types[e.type]||(r.types[e.type]=[]),r.types[e.type].push(l);for(const a in e.data)r.ids[a]=l;const o=`small.ifc-processed-properties-${l}`,t=new Blob([JSON.stringify(e.data)]);d.push({bits:t,name:o}),l++});c.onProgress.add(async e=>{console.log(e)});c.onIndicesStreamed.add(async e=>{d.push({name:"small.ifc-processed-properties.json",bits:new Blob([JSON.stringify(r)])});const t=n.get(R).serializeRelations(e);d.push({name:"small.ifc-processed-properties-indexes",bits:new Blob([t])}),await _(d)});async function z(){const o=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),t=new Uint8Array(o);await c.streamFromBuffer(t)}const i=new b;i.showPanel(2);document.body.append(i.dom);i.dom.style.left="0px";i.dom.style.zIndex="unset";s.renderer.onBeforeUpdate.add(()=>i.begin());s.renderer.onAfterUpdate.add(()=>i.end());w.init();const m=f.create(()=>u` +import"./web-ifc-api-Dlf_dxms.js";import{S as b}from"./stats.min-bmkVNhZk.js";import{T as w,z as f,m as u}from"./index-DtbylpTq.js";import{p as y,A as g,e as h,m as B,v as k,O as F,T as L,f as v,k as S}from"./index-6e07lNWw.js";const U=document.getElementById("container"),n=new y,A=n.get(g),s=A.create();s.scene=new h(n);s.renderer=new B(n,U);s.camera=new k(n);n.init();s.camera.controls.setLookAt(12,6,8,0,0,-10);s.scene.setup();const T=n.get(F);T.create(s);s.scene.three.background=null;const x=new L(n),I=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),O=await I.arrayBuffer(),R=new Uint8Array(O),z=x.load(R);s.scene.three.add(z);function P(e,o){const t=new File([o],e),a=document.createElement("a"),p=URL.createObjectURL(t);a.href=p,a.download=t.name,a.click(),URL.revokeObjectURL(p)}async function j(e){for(const{name:o,bits:t}of e)P(o,t),await new Promise(a=>{setTimeout(a,100)})}const r=n.get(v);r.settings.wasm={path:"https://unpkg.com/web-ifc@0.0.57/",absolute:!0};const c={types:{},ids:{},indexesFile:"small.ifc-processed-properties-indexes"};let l=0;const d=[];r.onPropertiesStreamed.add(async e=>{c.types[e.type]||(c.types[e.type]=[]),c.types[e.type].push(l);for(const a in e.data)c.ids[a]=l;const o=`small.ifc-processed-properties-${l}`,t=new Blob([JSON.stringify(e.data)]);d.push({bits:t,name:o}),l++});r.onProgress.add(async e=>{console.log(e)});r.onIndicesStreamed.add(async e=>{d.push({name:"small.ifc-processed-properties.json",bits:new Blob([JSON.stringify(c)])});const t=n.get(S).serializeRelations(e);d.push({name:"small.ifc-processed-properties-indexes",bits:new Blob([t])}),await j(d)});async function $(){const o=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),t=new Uint8Array(o);await r.streamFromBuffer(t)}const i=new b;i.showPanel(2);document.body.append(i.dom);i.dom.style.left="0px";i.dom.style.zIndex="unset";s.renderer.onBeforeUpdate.add(()=>i.begin());s.renderer.onAfterUpdate.add(()=>i.end());w.init();const m=f.create(()=>u` + @click="${()=>{$()}}"> - `);document.body.append(m);const T=f.create(()=>u` + `);document.body.append(m);const C=f.create(()=>u` - `);document.body.append(T); + `);document.body.append(C); diff --git a/examples/assets/ifcRelationsIndexer.js b/examples/assets/ifcRelationsIndexer.js index 85631771a..dbff05c75 100644 --- a/examples/assets/ifcRelationsIndexer.js +++ b/examples/assets/ifcRelationsIndexer.js @@ -1,4 +1,4 @@ -import{ak as D,bc as r,aj as L,bd as P,a0 as I}from"./web-ifc-api-JuXSH2nk.js";import{S as x}from"./stats.min-GTpOrGrX.js";import{d as U,R as w,m as g}from"./index-CqPyogbW.js";import{C,W as O,S as v,I as F,a as k,b as A,c as y,U as j}from"./index-BICSFNrK.js";import{S as B,a as M,G as N}from"./index-M03DNf7F.js";import"./_commonjsHelpers-Cpj98o6Y.js";const W=document.getElementById("container"),s=new C,T=s.get(O),a=T.create();a.scene=new B(s);a.renderer=new M(s,W);a.camera=new v(s);s.init();a.camera.controls.setLookAt(12,6,8,0,0,-10);a.scene.setup();const $=s.get(N);$.create(a);a.scene.three.background=null;const R=s.get(F);await R.setup();const z=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),G=await z.arrayBuffer(),S=new Uint8Array(G),e=await R.load(S);a.scene.three.add(e);const t=s.get(k);await t.process(e);const u=t.getEntityRelations(e,6518,"IsDefinedBy");if(u)for(const n of u){const i=await e.getProperties(n);console.log(i),await A.getPsetProps(e,n,async l=>{const o=await e.getProperties(l);console.log(o)})}const H=(n,i)=>{const l=new File([n],i),o=document.createElement("a");o.href=URL.createObjectURL(l),o.download=l.name,o.click(),URL.revokeObjectURL(o.href)},J=t.serializeModelRelations(e);console.log(J);const V=t.serializeAllRelations();delete t.relationMaps[e.uuid];const Y=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),_=t.getRelationsMapFromJSON(await Y.text());t.setRelationMap(e,_);const p=t.getEntityRelations(e,6518,"ContainedInStructure");if(p&&p[0]){const n=await e.getProperties(p[0]);console.log(n)}const q=t.getEntitiesWithRelation(e,"ContainedInStructure",138);console.log(`IfcBuildingStorey 138 has the following IfcElement: ${[...q]}`);const X=t.getEntitiesWithRelation(e,"ContainsElements",186);console.log(`IfcElement 186 is located inside IfcBuildingStorey ${[...X][0]}`);const K=t.getEntitiesWithRelation(e,"IsDefinedBy",303);console.log(`${[...K]} are defined by IfcPropertySet 303`);const m=s.get(y),b=await m.getEntityRef(e,D),h=new r.IfcPropertySingleValue(new r.IfcIdentifier("Property Name"),null,new r.IfcLabel("Property Value"),null);await m.setData(e,h);const f=new r.IfcPropertySet(new r.IfcGloballyUniqueId(j.create()),b?b[0]:null,new r.IfcLabel("My New Pset!"),null,[new L(h.expressID)]);await m.setData(e,f);const E=await e.getAllPropertiesOfType(P),Q=Object.values(E).map(n=>n.expressID);t.addEntitiesRelation(e,f.expressID,{type:I,inv:"DefinesOcurrence"},...Q);for(const n in E)t.addEntitiesRelation(e,Number(n),{type:I,inv:"IsDefinedBy"},f.expressID);const c=new x;c.showPanel(2);document.body.append(c.dom);c.dom.style.left="0px";c.dom.style.zIndex="unset";a.renderer.onBeforeUpdate.add(()=>c.begin());a.renderer.onAfterUpdate.add(()=>c.end());U.init();const d=w.create(()=>g` +import{a5 as D,bl as r,a3 as L,bm as P,a4 as I}from"./web-ifc-api-Dlf_dxms.js";import{S as x}from"./stats.min-bmkVNhZk.js";import{T as U,z as w,m as g}from"./index-DtbylpTq.js";import{C,W as O,S as v,I as F,d as A,e as k,f as y,U as B}from"./index-Cs1SYVzD.js";import{S as M,a as N,G as j}from"./index-DDyOrdLb.js";const T=document.getElementById("container"),s=new C,W=s.get(O),a=W.create();a.scene=new M(s);a.renderer=new N(s,T);a.camera=new v(s);s.init();a.camera.controls.setLookAt(12,6,8,0,0,-10);a.scene.setup();const $=s.get(j);$.create(a);a.scene.three.background=null;const R=s.get(F);await R.setup();const z=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),G=await z.arrayBuffer(),S=new Uint8Array(G),e=await R.load(S);a.scene.three.add(e);const t=s.get(A);await t.process(e);const u=t.getEntityRelations(e,6518,"IsDefinedBy");if(u)for(const n of u){const i=await e.getProperties(n);console.log(i),await k.getPsetProps(e,n,async l=>{const o=await e.getProperties(l);console.log(o)})}const H=(n,i)=>{const l=new File([n],i),o=document.createElement("a");o.href=URL.createObjectURL(l),o.download=l.name,o.click(),URL.revokeObjectURL(o.href)},J=t.serializeModelRelations(e);console.log(J);const V=t.serializeAllRelations();delete t.relationMaps[e.uuid];const Y=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),_=t.getRelationsMapFromJSON(await Y.text());t.setRelationMap(e,_);const p=t.getEntityRelations(e,6518,"ContainedInStructure");if(p&&p[0]){const n=await e.getProperties(p[0]);console.log(n)}const q=t.getEntitiesWithRelation(e,"ContainedInStructure",138);console.log(`IfcBuildingStorey 138 has the following IfcElement: ${[...q]}`);const X=t.getEntitiesWithRelation(e,"ContainsElements",186);console.log(`IfcElement 186 is located inside IfcBuildingStorey ${[...X][0]}`);const K=t.getEntitiesWithRelation(e,"IsDefinedBy",303);console.log(`${[...K]} are defined by IfcPropertySet 303`);const m=s.get(y),b=await m.getEntityRef(e,D),h=new r.IfcPropertySingleValue(new r.IfcIdentifier("Property Name"),null,new r.IfcLabel("Property Value"),null);await m.setData(e,h);const f=new r.IfcPropertySet(new r.IfcGloballyUniqueId(B.create()),b?b[0]:null,new r.IfcLabel("My New Pset!"),null,[new L(h.expressID)]);await m.setData(e,f);const E=await e.getAllPropertiesOfType(P),Q=Object.values(E).map(n=>n.expressID);t.addEntitiesRelation(e,f.expressID,{type:I,inv:"DefinesOcurrence"},...Q);for(const n in E)t.addEntitiesRelation(e,Number(n),{type:I,inv:"IsDefinedBy"},f.expressID);const c=new x;c.showPanel(2);document.body.append(c.dom);c.dom.style.left="0px";c.dom.style.zIndex="unset";a.renderer.onBeforeUpdate.add(()=>c.begin());a.renderer.onAfterUpdate.add(()=>c.end());U.init();const d=w.create(()=>g` diff --git a/examples/assets/ifcStreamer.js b/examples/assets/ifcStreamer.js index c6fa68839..e8bac4e06 100644 --- a/examples/assets/ifcStreamer.js +++ b/examples/assets/ifcStreamer.js @@ -1 +1 @@ -import"./web-ifc-api-JuXSH2nk.js";import{S as i}from"./stats.min-GTpOrGrX.js";import{o as l,a as m,M as p,v as u,N as h,h as w}from"./index-DtdmE_hK.js";import{s as g}from"./index-Cm7YlCft.js";import"./_commonjsHelpers-Cpj98o6Y.js";const f=document.getElementById("container"),o=new l,b=o.get(m),e=b.create();e.scene=new p(o);e.renderer=new u(o,f);e.camera=new h(o);o.init();e.scene.setup();e.camera.controls.setLookAt(12,6,8,0,0,-10);const y=o.get(w);y.create(e);e.scene.three.background=null;const t=o.get(g);t.world=e;t.dbCleaner.enabled=!0;t.url="https://thatopen.github.io/engine_components/resources/streaming/";async function D(s,r){const c=await(await fetch(s)).json();let a;a=await(await fetch(r)).json();const d=await t.load(c,!0,a);console.log(d)}await D("https://thatopen.github.io/engine_components/resources/streaming/small.ifc-processed.json","https://thatopen.github.io/engine_components/resources/streaming/small.ifc-processed-properties.json");e.camera.controls.addEventListener("sleep",()=>{t.culler.needsUpdate=!0});t.useCache=!0;t.culler.threshold=10;t.culler.maxHiddenTime=1e3;t.culler.maxLostTime=3e3;const n=new i;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); +import"./web-ifc-api-Dlf_dxms.js";import{S as i}from"./stats.min-bmkVNhZk.js";import{p as l,A as m,e as p,m as u,v as w,O as g}from"./index-6e07lNWw.js";import{d as h}from"./index-DDq_E_eW.js";const f=document.getElementById("container"),o=new l,y=o.get(m),e=y.create();e.scene=new p(o);e.renderer=new u(o,f);e.camera=new w(o);o.init();e.scene.setup();e.camera.controls.setLookAt(12,6,8,0,0,-10);const b=o.get(g);b.create(e);e.scene.three.background=null;const t=o.get(h);t.world=e;t.url="https://thatopen.github.io/engine_components/resources/streaming/";async function D(a,r){const c=await(await fetch(a)).json();let s;s=await(await fetch(r)).json();const d=await t.load(c,!0,s);console.log(d)}await D("https://thatopen.github.io/engine_components/resources/streaming/small.ifc-processed.json","https://thatopen.github.io/engine_components/resources/streaming/small.ifc-processed-properties.json");e.camera.controls.addEventListener("sleep",()=>{t.culler.needsUpdate=!0});t.useCache=!0;t.culler.threshold=10;t.culler.maxHiddenTime=1e3;t.culler.maxLostTime=3e3;const n=new i;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); diff --git a/examples/assets/index-6e07lNWw.js b/examples/assets/index-6e07lNWw.js new file mode 100644 index 000000000..21447eed9 --- /dev/null +++ b/examples/assets/index-6e07lNWw.js @@ -0,0 +1,306 @@ +import{t as it,V as x,h as He,w as Is,T as os,S as Li,x as we,a as se,C as ve,E as Pi,D as co,A as _a,W as xs,v as Gt,P as Pn,aB as wa,z as va,aC as st,c as Ee,aD as Ma,y as _n,ap as wn,Y as hs,J as Da,e as Bs,as as Si,aZ as ar,a_ as ba,b0 as Ua,bs as xa,aw as ho,N as _i,b as us,Q as Gs,s as Vt,X as Bt,Z as lr,_ as uo,$ as vn,a0 as zt,a1 as Ba,d as Ys,a2 as Ke,a3 as pt,i as ls,a4 as zs,a5 as Ya,a6 as wi,a7 as Mn,a8 as Dn,a9 as bn,aa as Un,ab as xn,ac as vi,ad as Bn,ae as Yn,af as Vn,ag as Gn,ah as zn,ai as kn,aj as Hn,ak as Io,B as De,al as Va,am as Ga,an as Ai,ao as za,I as Wn,aO as Xn,aP as jn,aA as Zn,aE as Bi,K as xe,O as Oi,j as Ci,aI as ka,L as Eo,aJ as Ha,aK as Wa,aL as Xa,aM as ja,aN as Za,av as $a,k as It,aQ as Ht,aR as qa,aS as Qa,aT as cr,aU as hr,b9 as ur,ba as Ka,H as dr,aF as Ws,ay as At,aG as Ja,aH as Ts,r as el,bb as tl,bc as sl,bd as il,be as nl,ax as rl,bj as ol}from"./web-ifc-api-Dlf_dxms.js";var al=Object.defineProperty,ll=(l,e,t)=>e in l?al(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t,p=(l,e,t)=>(ll(l,typeof e!="symbol"?e+"":e,t),t);const fo=0,cl=1,hl=2,Ir=2,Yi=1.25,Er=1,Ti=6*4+4+4,Mi=65535,ul=Math.pow(2,-24),Vi=Symbol("SKIP_GENERATION");function dl(l){return l.index?l.index.count:l.attributes.position.count}function Es(l){return dl(l)/3}function Il(l,e=ArrayBuffer){return l>65535?new Uint32Array(new e(4*l)):new Uint16Array(new e(2*l))}function El(l,e){if(!l.index){const t=l.attributes.position.count,s=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,i=Il(t,s);l.setIndex(new Ys(i,1));for(let n=0;no-a);for(let o=0;on.offset-r.offset),s=t[t.length-1];s.count=Math.min(e-s.offset,s.count);let i=0;return t.forEach(({count:n})=>i+=n),e!==i}function Oe(l,e,t){return t.min.x=e[l],t.min.y=e[l+1],t.min.z=e[l+2],t.max.x=e[l+3],t.max.y=e[l+4],t.max.z=e[l+5],t}function pl(l){l[0]=l[1]=l[2]=1/0,l[3]=l[4]=l[5]=-1/0}function fr(l){let e=-1,t=-1/0;for(let s=0;s<3;s++){const i=l[s+3]-l[s];i>t&&(t=i,e=s)}return e}function pr(l,e){e.set(l)}function Cr(l,e,t){let s,i;for(let n=0;n<3;n++){const r=n+3;s=l[n],i=e[n],t[n]=si?s:i}}function Xs(l,e,t){for(let s=0;s<3;s++){const i=e[l+2*s],n=e[l+2*s+1],r=i-n,o=i+n;rt[s+3]&&(t[s+3]=o)}}function ms(l){const e=l[3]-l[0],t=l[4]-l[1],s=l[5]-l[2];return 2*(e*t+t*s+s*e)}function Gi(l,e,t,s,i=null){let n=1/0,r=1/0,o=1/0,a=-1/0,c=-1/0,h=-1/0,d=1/0,I=1/0,u=1/0,f=-1/0,E=-1/0,C=-1/0;const T=i!==null;for(let m=e*6,A=(e+t)*6;ma&&(a=y),T&&Rf&&(f=R);const w=l[m+2],P=l[m+3],M=w-P,B=w+P;Mc&&(c=B),T&&wE&&(E=w);const O=l[m+4],v=l[m+5],g=O-v,b=O+v;gh&&(h=b),T&&OC&&(C=O)}s[0]=n,s[1]=r,s[2]=o,s[3]=a,s[4]=c,s[5]=h,T&&(i[0]=d,i[1]=I,i[2]=u,i[3]=f,i[4]=E,i[5]=C)}function Cl(l,e,t,s){let i=1/0,n=1/0,r=1/0,o=-1/0,a=-1/0,c=-1/0;for(let h=e*6,d=(e+t)*6;ho&&(o=I);const u=l[h+2];ua&&(a=u);const f=l[h+4];fc&&(c=f)}s[0]=i,s[1]=n,s[2]=r,s[3]=o,s[4]=a,s[5]=c}function Tl(l,e){pl(e);const t=l.attributes.position,s=l.index?l.index.array:null,i=Es(l),n=new Float32Array(i*6),r=t.normalized,o=t.array,a=t.offset||0;let c=3;t.isInterleavedBufferAttribute&&(c=t.data.stride);const h=["getX","getY","getZ"];for(let d=0;dL&&(L=A),R>L&&(L=R);const y=(L-S)/2,w=T*2;n[u+w+0]=S+y,n[u+w+1]=y+(Math.abs(S)+y)*ul,Se[T+3]&&(e[T+3]=L)}}return n}const Et=32,ml=(l,e)=>l.candidate-e.candidate,Ot=new Array(Et).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),js=new Float32Array(6);function Rl(l,e,t,s,i,n){let r=-1,o=0;if(n===fo)r=fr(e),r!==-1&&(o=(e[r]+e[r+3])/2);else if(n===cl)r=fr(l),r!==-1&&(o=gl(t,s,i,r));else if(n===hl){const a=ms(l);let c=Yi*i;const h=s*6,d=(s+i)*6;for(let I=0;I<3;I++){const u=e[I],f=(e[I+3]-u)/Et;if(i=S.candidate?Xs(m,t,S.rightCacheBounds):(Xs(m,t,S.leftCacheBounds),S.count++)}}for(let m=0;m=Et&&(m=Et-1);const A=Ot[m];A.count++,Xs(T,t,A.bounds)}const E=Ot[Et-1];pr(E.bounds,E.rightCacheBounds);for(let T=Et-2;T>=0;T--){const m=Ot[T],A=Ot[T+1];Cr(m.bounds,A.rightCacheBounds,m.rightCacheBounds)}let C=0;for(let T=0;T=a;)o--;if(r=a;)o--;if(r2**16,i=s?4:2,n=e?new SharedArrayBuffer(t*i):new ArrayBuffer(t*i),r=s?new Uint32Array(n):new Uint16Array(n);for(let o=0,a=r.length;o=i&&(d=!0,n&&(console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`),console.warn(t))),L<=r||w>=i)return m(S+L),R.offset=S,R.count=L,R;const P=Rl(R.boundingData,y,f,S,L,o);if(P.axis===-1)return m(S+L),R.offset=S,R.count=L,R;const M=E(h,s,f,S,L,P);if(M===S||M===S+L)m(S+L),R.offset=S,R.count=L;else{R.splitAxis=P.axis;const B=new Zs,O=S,v=M-S;R.left=B,B.boundingData=new Float32Array(6),Gi(f,O,v,B.boundingData,u),A(B,O,v,u,w+1);const g=new Zs,b=M,Z=L-v;R.right=g,g.boundingData=new Float32Array(6),Gi(f,b,Z,g.boundingData,u),A(g,b,Z,u,w+1)}return R}}function Nl(l,e){const t=l.geometry;e.indirect&&(l._indirectBuffer=Al(t,e.useSharedArrayBuffer),fl(t)&&!e.verbose&&console.warn('MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.')),l._indirectBuffer||El(t,e);const s=Ol(l,e);let i,n,r;const o=[],a=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let d=0;dMath.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return n[u+6]=R/4,R=h(R,m),n[u+7]=A,R}}}class Ft{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let s=1/0,i=-1/0;for(let n=0,r=e.length;ni?o:i}this.min=s,this.max=i}setFromPoints(e,t){let s=1/0,i=-1/0;for(let n=0,r=t.length;ni?a:i}this.min=s,this.max=i}isSeparated(e){return this.min>e.max||e.min>this.max}}Ft.prototype.setFromBox=function(){const l=new x;return function(e,t){const s=t.min,i=t.max;let n=1/0,r=-1/0;for(let o=0;o<=1;o++)for(let a=0;a<=1;a++)for(let c=0;c<=1;c++){l.x=s.x*o+i.x*(1-o),l.y=s.y*a+i.y*(1-a),l.z=s.z*c+i.z*(1-c);const h=e.dot(l);n=Math.min(h,n),r=Math.max(h,r)}this.min=n,this.max=r}}();const yl=function(){const l=new x,e=new x,t=new x;return function(s,i,n){const r=s.start,o=l,a=i.start,c=e;t.subVectors(r,a),l.subVectors(s.end,s.start),e.subVectors(i.end,i.start);const h=t.dot(c),d=c.dot(o),I=c.dot(c),u=t.dot(o),f=o.dot(o)*I-d*d;let E,C;f!==0?E=(h*d-u*I)/f:E=0,C=(h+E*d)/I,n.x=E,n.y=C}}(),$n=function(){const l=new He,e=new x,t=new x;return function(s,i,n,r){yl(s,i,l);let o=l.x,a=l.y;if(o>=0&&o<=1&&a>=0&&a<=1){s.at(o,n),i.at(a,r);return}else if(o>=0&&o<=1){a<0?i.at(0,r):i.at(1,r),s.closestPointToPoint(r,!0,n);return}else if(a>=0&&a<=1){o<0?s.at(0,n):s.at(1,n),i.closestPointToPoint(n,!0,r);return}else{let c;o<0?c=s.start:c=s.end;let h;a<0?h=i.start:h=i.end;const d=e,I=t;if(s.closestPointToPoint(h,!0,e),i.closestPointToPoint(c,!0,t),d.distanceToSquared(h)<=I.distanceToSquared(c)){n.copy(d),r.copy(h);return}else{n.copy(c),r.copy(I);return}}}}(),Ll=function(){const l=new x,e=new x,t=new Is,s=new it;return function(i,n){const{radius:r,center:o}=i,{a,b:c,c:h}=n;if(s.start=a,s.end=c,s.closestPointToPoint(o,!0,l).distanceTo(o)<=r||(s.start=a,s.end=h,s.closestPointToPoint(o,!0,l).distanceTo(o)<=r)||(s.start=c,s.end=h,s.closestPointToPoint(o,!0,l).distanceTo(o)<=r))return!0;const d=n.getPlane(t);if(Math.abs(d.distanceToPoint(o))<=r){const I=d.projectPoint(o,e);if(n.containsPoint(I))return!0}return!1}}(),Pl=1e-15;function zi(l){return Math.abs(l)new x),this.satBounds=new Array(4).fill().map(()=>new Ft),this.points=[this.a,this.b,this.c],this.sphere=new Li,this.plane=new Is,this.needsUpdate=!0}intersectsSphere(e){return Ll(e,this)}update(){const e=this.a,t=this.b,s=this.c,i=this.points,n=this.satAxes,r=this.satBounds,o=n[0],a=r[0];this.getNormal(o),a.setFromPoints(o,i);const c=n[1],h=r[1];c.subVectors(e,t),h.setFromPoints(c,i);const d=n[2],I=r[2];d.subVectors(t,s),I.setFromPoints(d,i);const u=n[3],f=r[3];u.subVectors(s,e),f.setFromPoints(u,i),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(o,e),this.needsUpdate=!1}}nt.prototype.closestPointToSegment=function(){const l=new x,e=new x,t=new it;return function(s,i=null,n=null){const{start:r,end:o}=s,a=this.points;let c,h=1/0;for(let d=0;d<3;d++){const I=(d+1)%3;t.start.copy(a[d]),t.end.copy(a[I]),$n(t,s,l,e),c=l.distanceToSquared(e),c=2){(R===1?T.start:T.end).copy(u),A=2;break}if(A++,A===2&&R===-1)break}}return A}return function(E,C=null,T=!1){this.needsUpdate&&this.update(),E.isExtendedTriangle?E.needsUpdate&&E.update():(l.copy(E),l.update(),E=l);const m=this.plane,A=E.plane;if(Math.abs(m.normal.dot(A.normal))>1-1e-10){const R=this.satBounds,S=this.satAxes;t[0]=E.a,t[1]=E.b,t[2]=E.c;for(let w=0;w<4;w++){const P=R[w],M=S[w];if(s.setFromPoints(M,t),P.isSeparated(s))return!1}const L=E.satBounds,y=E.satAxes;e[0]=this.a,e[1]=this.b,e[2]=this.c;for(let w=0;w<4;w++){const P=L[w],M=y[w];if(s.setFromPoints(M,e),P.isSeparated(s))return!1}for(let w=0;w<4;w++){const P=S[w];for(let M=0;M<4;M++){const B=y[M];if(n.crossVectors(P,B),s.setFromPoints(n,e),i.setFromPoints(n,t),s.isSeparated(i))return!1}}return C&&(T||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),C.start.set(0,0,0),C.end.set(0,0,0)),!0}else{const R=f(this,A,d);if(R===1&&E.containsPoint(d.end))return C&&(C.start.copy(d.end),C.end.copy(d.end)),!0;if(R!==2)return!1;const S=f(E,m,I);if(S===1&&this.containsPoint(I.end))return C&&(C.start.copy(I.end),C.end.copy(I.end)),!0;if(S!==2)return!1;if(d.delta(o),I.delta(a),o.dot(a)<0){let O=I.start;I.start=I.end,I.end=O}const L=d.start.dot(o),y=d.end.dot(o),w=I.start.dot(o),P=I.end.dot(o),M=y0?C.start.copy(d.start):C.start.copy(I.start),c.subVectors(d.end,I.end),c.dot(o)<0?C.end.copy(d.end):C.end.copy(I.end)),!0)}}}();nt.prototype.distanceToPoint=function(){const l=new x;return function(e){return this.closestPointToPoint(e,l),e.distanceTo(l)}}();nt.prototype.distanceToTriangle=function(){const l=new x,e=new x,t=["a","b","c"],s=new it,i=new it;return function(n,r=null,o=null){const a=r||o?s:null;if(this.intersectsTriangle(n,a))return(r||o)&&(r&&a.getCenter(r),o&&a.getCenter(o)),0;let c=1/0;for(let h=0;h<3;h++){let d;const I=t[h],u=n[I];this.closestPointToPoint(u,l),d=u.distanceToSquared(l),dnew x),this.satAxes=new Array(3).fill().map(()=>new x),this.satBounds=new Array(3).fill().map(()=>new Ft),this.alignedSatBounds=new Array(3).fill().map(()=>new Ft),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),s&&this.matrix.copy(s)}set(e,t,s){this.min.copy(e),this.max.copy(t),this.matrix.copy(s),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}}Ve.prototype.update=function(){return function(){const l=this.matrix,e=this.min,t=this.max,s=this.points;for(let a=0;a<=1;a++)for(let c=0;c<=1;c++)for(let h=0;h<=1;h++){const d=1*a|2*c|4*h,I=s[d];I.x=a?t.x:e.x,I.y=c?t.y:e.y,I.z=h?t.z:e.z,I.applyMatrix4(l)}const i=this.satBounds,n=this.satAxes,r=s[0];for(let a=0;a<3;a++){const c=n[a],h=i[a],d=1<new it),t=new Array(12).fill().map(()=>new it),s=new x,i=new x;return function(n,r=0,o=null,a=null){if(this.needsUpdate&&this.update(),this.intersectsBox(n))return(o||a)&&(n.getCenter(i),this.closestPointToPoint(i,s),n.closestPointToPoint(s,i),o&&o.copy(s),a&&a.copy(i)),0;const c=r*r,h=n.min,d=n.max,I=this.points;let u=1/0;for(let E=0;E<8;E++){const C=I[E];i.copy(C).clamp(h,d);const T=C.distanceToSquared(i);if(Tnew nt)}}const Ze=new _l;function ze(l,e){return e[l+15]===65535}function ke(l,e){return e[l+6]}function $e(l,e){return e[l+14]}function qe(l){return l+8}function Qe(l,e){return e[l+6]}function To(l,e){return e[l+7]}class wl{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const e=[];let t=null;this.setBuffer=s=>{t&&e.push(t),t=s,this.float32Array=new Float32Array(s),this.uint16Array=new Uint16Array(s),this.uint32Array=new Uint32Array(s)},this.clearBuffer=()=>{t=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,e.length!==0&&this.setBuffer(e.pop())}}}const ge=new wl;let _t,as;const Wt=[],$s=new qn(()=>new we);function vl(l,e,t,s,i,n){_t=$s.getPrimitive(),as=$s.getPrimitive(),Wt.push(_t,as),ge.setBuffer(l._roots[e]);const r=an(0,l.geometry,t,s,i,n);ge.clearBuffer(),$s.releasePrimitive(_t),$s.releasePrimitive(as),Wt.pop(),Wt.pop();const o=Wt.length;return o>0&&(as=Wt[o-1],_t=Wt[o-2]),r}function an(l,e,t,s,i=null,n=0,r=0){const{float32Array:o,uint16Array:a,uint32Array:c}=ge;let h=l*2;if(ze(h,a)){const d=ke(l,c),I=$e(h,a);return Oe(l,o,_t),s(d,I,!1,r,n+l,_t)}else{let d=function(B){const{uint16Array:O,uint32Array:v}=ge;let g=B*2;for(;!ze(g,O);)B=qe(B),g=B*2;return ke(B,v)},I=function(B){const{uint16Array:O,uint32Array:v}=ge;let g=B*2;for(;!ze(g,O);)B=Qe(B,v),g=B*2;return ke(B,v)+$e(g,O)};const u=qe(l),f=Qe(l,c);let E=u,C=f,T,m,A,R;if(i&&(A=_t,R=as,Oe(E,o,A),Oe(C,o,R),T=i(A),m=i(R),m(Rs.copy(e).clamp(h.min,h.max),Rs.distanceToSquared(e)),intersectsBounds:(h,d,I)=>I{h.closestPointToPoint(e,Rs);const I=e.distanceToSquared(Rs);return I0&&c.normal.multiplyScalar(-1));const h={a:n,b:r,c:o,normal:new x,materialIndex:0};os.getNormal(Xt,jt,Zt,h.normal),c.face=h,c.faceIndex=n}return c}function Di(l,e,t,s,i){const n=s*3;let r=n+0,o=n+1,a=n+2;const c=l.index;l.index&&(r=c.getX(r),o=c.getX(o),a=c.getX(a));const{position:h,normal:d,uv:I,uv1:u}=l.attributes,f=bl(t,h,d,I,u,r,o,a,e);return f?(f.faceIndex=s,i&&i.push(f),f):null}function Pe(l,e,t,s){const i=l.a,n=l.b,r=l.c;let o=e,a=e+1,c=e+2;t&&(o=t.getX(o),a=t.getX(a),c=t.getX(c)),i.x=s.getX(o),i.y=s.getY(o),i.z=s.getZ(o),n.x=s.getX(a),n.y=s.getY(a),n.z=s.getZ(a),r.x=s.getX(c),r.y=s.getY(c),r.z=s.getZ(c)}function Ul(l,e,t,s,i,n){const{geometry:r,_indirectBuffer:o}=l;for(let a=s,c=s+i;aS&&(S=B),OL&&(L=O),vy&&(y=v)}return a[I+0]!==m||a[I+1]!==A||a[I+2]!==R||a[I+3]!==S||a[I+4]!==L||a[I+5]!==y?(a[I+0]=m,a[I+1]=A,a[I+2]=R,a[I+3]=S,a[I+4]=L,a[I+5]=y,!0):!1}else{const C=I+8,T=r[I+6],m=C+u,A=T+u;let R=f,S=!1,L=!1;e?R||(S=e.has(m),L=e.has(A),R=!S&&!L):(S=!0,L=!0);const y=R||S,w=R||L;let P=!1;y&&(P=d(C,u,R));let M=!1;w&&(M=d(T,u,R));const B=P||M;if(B)for(let O=0;O<3;O++){const v=C+O,g=T+O,b=a[v],Z=a[v+3],z=a[g],J=a[g+3];a[I+O]=bJ?Z:J}return B}}}const gr=new we;function wt(l,e,t,s){return Oe(l,e,gr),t.intersectBox(gr,s)}function Vl(l,e,t,s,i,n){const{geometry:r,_indirectBuffer:o}=l;for(let a=s,c=s+i;a=0;let d,I;h?(d=qe(l),I=Qe(l,r)):(d=Qe(l,r),I=qe(l));const u=wt(d,i,s,Sr)?cn(d,e,t,s):null;if(u){const E=u.point[c];if(h?E<=i[I+a]:E>=i[I+a+3])return u}const f=wt(I,i,s,Sr)?cn(I,e,t,s):null;return u&&f?u.distance<=f.distance?u:f:u||f||null}}const ei=new we,$t=new nt,qt=new nt,gs=new Ee,Ar=new Ve,ti=new Ve;function Xl(l,e,t,s){ge.setBuffer(l._roots[e]);const i=hn(0,l,t,s);return ge.clearBuffer(),i}function hn(l,e,t,s,i=null){const{float32Array:n,uint16Array:r,uint32Array:o}=ge;let a=l*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),Ar.set(t.boundingBox.min,t.boundingBox.max,s),i=Ar),ze(a,r)){const c=e.geometry,h=c.index,d=c.attributes.position,I=t.index,u=t.attributes.position,f=ke(l,o),E=$e(a,r);if(gs.copy(s).invert(),t.boundsTree)return Oe(l,n,ti),ti.matrix.copy(gs),ti.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:C=>ti.intersectsBox(C),intersectsTriangle:C=>{C.a.applyMatrix4(s),C.b.applyMatrix4(s),C.c.applyMatrix4(s),C.needsUpdate=!0;for(let T=f*3,m=(E+f)*3;THi.distanceToBox(S),intersectsBounds:(S,L,y)=>y{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:y=>Fs.distanceToBox(y),intersectsBounds:(y,w,P)=>P{for(let P=y,M=y+w;PS&&(S=v),gL&&(L=g),by&&(y=b)}}return a[I+0]!==m||a[I+1]!==A||a[I+2]!==R||a[I+3]!==S||a[I+4]!==L||a[I+5]!==y?(a[I+0]=m,a[I+1]=A,a[I+2]=R,a[I+3]=S,a[I+4]=L,a[I+5]=y,!0):!1}else{const C=I+8,T=r[I+6],m=C+u,A=T+u;let R=f,S=!1,L=!1;e?R||(S=e.has(m),L=e.has(A),R=!S&&!L):(S=!0,L=!0);const y=R||S,w=R||L;let P=!1;y&&(P=d(C,u,R));let M=!1;w&&(M=d(T,u,R));const B=P||M;if(B)for(let O=0;O<3;O++){const v=C+O,g=T+O,b=a[v],Z=a[v+3],z=a[g],J=a[g+3];a[I+O]=bJ?Z:J}return B}}}const Or=new x;function Jl(l,e,t,s,i){ge.setBuffer(l._roots[e]),un(0,l,t,s,i),ge.clearBuffer()}function un(l,e,t,s,i){const{float32Array:n,uint16Array:r,uint32Array:o}=ge,a=l*2;if(ze(a,r)){const c=ke(l,o),h=$e(a,r);Vl(e,t,s,c,h,i)}else{const c=qe(l);wt(c,n,s,Or)&&un(c,e,t,s,i);const h=Qe(l,o);wt(h,n,s,Or)&&un(h,e,t,s,i)}}const Nr=new x,ec=["x","y","z"];function tc(l,e,t,s){ge.setBuffer(l._roots[e]);const i=dn(0,l,t,s);return ge.clearBuffer(),i}function dn(l,e,t,s){const{float32Array:i,uint16Array:n,uint32Array:r}=ge;let o=l*2;if(ze(o,n)){const a=ke(l,r),c=$e(o,n);return Gl(e,t,s,a,c)}else{const a=To(l,r),c=ec[a],h=s.direction[c]>=0;let d,I;h?(d=qe(l),I=Qe(l,r)):(d=Qe(l,r),I=qe(l));const u=wt(d,i,s,Nr)?dn(d,e,t,s):null;if(u){const E=u.point[c];if(h?E<=i[I+a]:E>=i[I+a+3])return u}const f=wt(I,i,s,Nr)?dn(I,e,t,s):null;return u&&f?u.distance<=f.distance?u:f:u||f||null}}const ii=new we,Qt=new nt,Kt=new nt,Ss=new Ee,yr=new Ve,ni=new Ve;function sc(l,e,t,s){ge.setBuffer(l._roots[e]);const i=In(0,l,t,s);return ge.clearBuffer(),i}function In(l,e,t,s,i=null){const{float32Array:n,uint16Array:r,uint32Array:o}=ge;let a=l*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),yr.set(t.boundingBox.min,t.boundingBox.max,s),i=yr),ze(a,r)){const c=e.geometry,h=c.index,d=c.attributes.position,I=t.index,u=t.attributes.position,f=ke(l,o),E=$e(a,r);if(Ss.copy(s).invert(),t.boundsTree)return Oe(l,n,ni),ni.matrix.copy(Ss),ni.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:C=>ni.intersectsBox(C),intersectsTriangle:C=>{C.a.applyMatrix4(s),C.b.applyMatrix4(s),C.c.applyMatrix4(s),C.needsUpdate=!0;for(let T=f,m=E+f;TWi.distanceToBox(S),intersectsBounds:(S,L,y)=>y{if(e.boundsTree){const y=e.boundsTree;return y.shapecast({boundsTraverseOrder:w=>As.distanceToBox(w),intersectsBounds:(w,P,M)=>M{for(let M=w,B=w+P;Mnew we),Jt=new we,es=new we,Xi=new we,ji=new we;let Zi=!1;function cc(l,e,t,s){if(Zi)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");Zi=!0;const i=l._roots,n=e._roots;let r,o=0,a=0;const c=new Ee().copy(t).invert();for(let h=0,d=i.length;ha.slice()),index:r.array.slice(),indirectBuffer:n?n.slice():null}:o={roots:i,index:r.array,indirectBuffer:n},o}static deserialize(e,t,s={}){s={setIndex:!0,indirect:!!e.indirectBuffer,...s};const{index:i,roots:n,indirectBuffer:r}=e,o=new Qn(t,{...s,[Vi]:!0});if(o._roots=n,o._indirectBuffer=r||null,s.setIndex){const a=t.getIndex();if(a===null){const c=new Ys(e.index,1,!1);t.setIndex(c)}else a.array!==i&&(a.array.set(i),a.needsUpdate=!0)}return o}get indirect(){return!!this._indirectBuffer}constructor(e,t={}){if(e.isBufferGeometry){if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(t=Object.assign({strategy:fo,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[Vi]:!1},t),t.useSharedArrayBuffer&&!lc())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=e,this._roots=null,this._indirectBuffer=null,t[Vi]||(Nl(this,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new we)));const{_indirectBuffer:s}=this;this.resolveTriangleIndex=t.indirect?i=>s[i]:i=>i}refit(e=null){return(this.indirect?Kl:Yl)(this,e)}traverse(e,t=0){const s=this._roots[t],i=new Uint32Array(s),n=new Uint16Array(s);r(0);function r(o,a=0){const c=o*2,h=n[c+15]===Mi;if(h){const d=i[o+6],I=n[c+14];e(a,h,new Float32Array(s,o*4,6),d,I)}else{const d=o+Ti/4,I=i[o+6],u=i[o+7];e(a,h,new Float32Array(s,o*4,6),u)||(r(d,a+1),r(I,a+1))}}}raycast(e,t=ur){const s=this._roots,i=this.geometry,n=[],r=t.isMaterial,o=Array.isArray(t),a=i.groups,c=r?t.side:t,h=this.indirect?Jl:kl;for(let d=0,I=s.length;dd(I,u,f,E,C)?!0:s(I,u,this,o,f,E,t)}else r||(o?r=(d,I,u,f)=>s(d,I,this,o,u,f,t):r=(d,I,u)=>u);let a=!1,c=0;const h=this._roots;for(let d=0,I=h.length;d{const E=this.resolveTriangleIndex(f);Pe(r,E*3,o,a)}:f=>{Pe(r,f*3,o,a)},h=Ze.getPrimitive(),d=e.geometry.index,I=e.geometry.attributes.position,u=e.indirect?f=>{const E=e.resolveTriangleIndex(f);Pe(h,E*3,d,I)}:f=>{Pe(h,f*3,d,I)};if(n){const f=(E,C,T,m,A,R,S,L)=>{for(let y=T,w=T+m;yoi.intersectsBox(s),intersectsTriangle:s=>oi.intersectsTriangle(s)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,s={},i={},n=0,r=1/0){return(this.indirect?ac:Ql)(this,e,t,s,i,n,r)}closestPointToPoint(e,t={},s=0,i=1/0){return Ml(this,e,t,s,i)}getBoundingBox(e){return e.makeEmpty(),this._roots.forEach(t=>{Oe(0,new Float32Array(t),Lr),e.union(Lr)}),e}}function Pr(l,e,t){return l===null||(l.point.applyMatrix4(e.matrixWorld),l.distance=l.point.distanceTo(t.ray.origin),l.object=e,l.distancet.far)?null:l}const $i=new Ka,_r=new Ee,hc=se.prototype.raycast;function uc(l,e){if(this.geometry.boundsTree){if(this.material===void 0)return;_r.copy(this.matrixWorld).invert(),$i.copy(l.ray).applyMatrix4(_r);const t=this.geometry.boundsTree;if(l.firstHitOnly===!0){const s=Pr(t.raycastFirst($i,this.material),this,l);s&&e.push(s)}else{const s=t.raycast($i,this.material);for(let i=0,n=s.length;i{const t=this.handlers.slice(0);for(const s of t)s(e)}),p(this,"handlers",[])}add(e){this.handlers.push(e)}remove(e){this.handlers=this.handlers.filter(t=>t!==e)}reset(){this.handlers.length=0}}class mi{constructor(){p(this,"trigger",async e=>{const t=this.handlers.slice(0);for(const s of t)await s(e)}),p(this,"handlers",[])}add(e){this.handlers.push(e)}remove(e){this.handlers=this.handlers.filter(t=>t!==e)}reset(){this.handlers.length=0}}class Kn{constructor(e){p(this,"isDisposeable",()=>"dispose"in this&&"onDisposed"in this),p(this,"isResizeable",()=>"resize"in this&&"getSize"in this),p(this,"isUpdateable",()=>"onAfterUpdate"in this&&"onBeforeUpdate"in this&&"update"in this),p(this,"isHideable",()=>"visible"in this),p(this,"isConfigurable",()=>"setup"in this&&"config"in this&&"onSetup"in this),this.components=e}}class Ae extends Kn{}class Jn extends Kn{constructor(e){super(e),p(this,"worlds",new Map),p(this,"onWorldChanged",new $),p(this,"currentWorld",null),this.onWorldChanged.add(({world:t,action:s})=>{s==="removed"&&this.worlds.delete(t.uuid)})}}class Ec extends Jn{constructor(){super(...arguments),p(this,"hasCameraControls",()=>"controls"in this)}}class fc extends Jn{constructor(){super(...arguments),p(this,"onAfterUpdate",new $),p(this,"onBeforeUpdate",new $),p(this,"onDisposed",new $),p(this,"onResize",new $),p(this,"onClippingPlanesUpdated",new $),p(this,"clippingPlanes",[])}updateClippingPlanes(){this.onClippingPlanesUpdated.trigger()}setPlane(e,t,s){t.isLocal=s;const i=this.clippingPlanes.indexOf(t);e&&i===-1?this.clippingPlanes.push(t):!e&&i>-1&&this.clippingPlanes.splice(i,1),this.three.clippingPlanes=this.clippingPlanes.filter(n=>!n.isLocal)}}const mo=class En extends Ae{constructor(e){super(e),p(this,"_disposedComponents",new Set),p(this,"enabled",!0),e.add(En.uuid,this)}get(){return this._disposedComponents}destroy(e,t=!0,s=!0){e.removeFromParent();const i=e;i.dispose&&i.dispose(),this.disposeGeometryAndMaterials(e,t),s&&i.children&&i.children.length&&this.disposeChildren(i),e.children.length=0}disposeGeometry(e){e.boundsTree&&e.disposeBoundsTree&&e.disposeBoundsTree(),e.dispose()}disposeGeometryAndMaterials(e,t){const s=e;s.geometry&&this.disposeGeometry(s.geometry),t&&s.material&&En.disposeMaterial(s),s.material=[],s.geometry=null}disposeChildren(e){for(const t of e.children)this.destroy(t)}static disposeMaterial(e){if(e.material)if(Array.isArray(e.material))for(const t of e.material)t.dispose();else e.material.dispose()}};p(mo,"uuid","76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");let ds=mo;class pc extends Jn{constructor(e){super(e),p(this,"onDisposed",new $),p(this,"directionalLights",new Map),p(this,"ambientLights",new Map)}dispose(){const e=this.components.get(ds);for(const t of this.three.children){const s=t;s.geometry&&e.destroy(s)}this.deleteAllLights(),this.three.children=[],this.onDisposed.trigger(),this.onDisposed.reset()}deleteAllLights(){for(const[,e]of this.directionalLights)e.removeFromParent(),e.target.removeFromParent(),e.dispose();this.directionalLights.clear();for(const[,e]of this.ambientLights)e.removeFromParent(),e.dispose();this.ambientLights.clear()}}class Tt extends Set{constructor(e){super(e),p(this,"onItemAdded",new $),p(this,"onItemDeleted",new $),p(this,"onCleared",new $),p(this,"guard",()=>!0)}clear(){super.clear(),this.onCleared.trigger()}add(...e){for(const t of e)this.has(t)||!this.guard(t)||(super.add(t),this.onItemAdded||(this.onItemAdded=new $),this.onItemAdded.trigger(t));return this}delete(e){const t=super.delete(e);return t&&this.onItemDeleted.trigger(),t}dispose(){this.clear(),this.onItemAdded.reset(),this.onItemDeleted.reset(),this.onCleared.reset()}}class St extends Map{constructor(e){super(e),p(this,"onItemSet",new $),p(this,"onItemUpdated",new $),p(this,"onItemDeleted",new $),p(this,"onCleared",new $),p(this,"guard",()=>!0)}clear(){super.clear(),this.onCleared.trigger()}set(e,t){const s=this.has(e);if(!(this.guard??(()=>!0))(e,t))return this;const i=super.set(e,t);return s?(this.onItemUpdated||(this.onItemUpdated=new $),this.onItemUpdated.trigger({key:e,value:t})):(this.onItemSet||(this.onItemSet=new $),this.onItemSet.trigger({key:e,value:t})),i}delete(e){const t=super.delete(e);return t&&this.onItemDeleted.trigger(e),t}dispose(){this.clear(),this.onItemSet.reset(),this.onItemDeleted.reset(),this.onCleared.reset()}}const Ri=0,Cc=1,Tc=new x,wr=new it,qi=new Is,vr=new x,ai=new os;class mc{constructor(){this.tolerance=-1,this.faces=[],this.newFaces=[],this.assigned=new Mr,this.unassigned=new Mr,this.vertices=[]}setFromPoints(e){if(e.length>=4){this.makeEmpty();for(let t=0,s=e.length;tthis.tolerance)return!1;return!0}intersectRay(e,t){const s=this.faces;let i=-1/0,n=1/0;for(let r=0,o=s.length;r0&&h>=0)return null;const d=h!==0?-c/h:0;if(!(d<=0)&&(h>0?n=Math.min(d,n):i=Math.max(d,i),i>n))return null}return i!==-1/0?e.at(i,t):e.at(n,t),t}intersectsRay(e){return this.intersectRay(e,Tc)!==null}makeEmpty(){return this.faces=[],this.vertices=[],this}addVertexToFace(e,t){return e.face=t,t.outside===null?this.assigned.append(e):this.assigned.insertBefore(t.outside,e),t.outside=e,this}removeVertexFromFace(e,t){return e===t.outside&&(e.next!==null&&e.next.face===t?t.outside=e.next:t.outside=null),this.assigned.remove(e),this}removeAllVerticesFromFace(e){if(e.outside!==null){const t=e.outside;let s=e.outside;for(;s.next!==null&&s.next.face===e;)s=s.next;return this.assigned.removeSubList(t,s),t.prev=s.next=null,e.outside=null,t}}deleteFaceVertices(e,t){const s=this.removeAllVerticesFromFace(e);if(s!==void 0)if(t===void 0)this.unassigned.appendChain(s);else{let i=s;do{const n=i.next;t.distanceToPoint(i.point)>this.tolerance?this.addVertexToFace(i,t):this.unassigned.append(i),i=n}while(i!==null)}return this}resolveUnassignedPoints(e){if(this.unassigned.isEmpty()===!1){let t=this.unassigned.first();do{const s=t.next;let i=this.tolerance,n=null;for(let r=0;ri&&(i=a,n=o),i>1e3*this.tolerance)break}}n!==null&&this.addVertexToFace(t,n),t=s}while(t!==null)}return this}computeExtremes(){const e=new x,t=new x,s=[],i=[];for(let n=0;n<3;n++)s[n]=i[n]=this.vertices[0];e.copy(this.vertices[0].point),t.copy(this.vertices[0].point);for(let n=0,r=this.vertices.length;nt.getComponent(c)&&(t.setComponent(c,a.getComponent(c)),i[c]=o)}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(e.x),Math.abs(t.x))+Math.max(Math.abs(e.y),Math.abs(t.y))+Math.max(Math.abs(e.z),Math.abs(t.z))),{min:s,max:i}}computeInitialHull(){const e=this.vertices,t=this.computeExtremes(),s=t.min,i=t.max;let n=0,r=0;for(let I=0;I<3;I++){const u=i[I].point.getComponent(I)-s[I].point.getComponent(I);u>n&&(n=u,r=I)}const o=s[r],a=i[r];let c,h;n=0,wr.set(o.point,a.point);for(let I=0,u=this.vertices.length;In&&(n=E,c=f)}}n=-1,qi.setFromCoplanarPoints(o.point,a.point,c.point);for(let I=0,u=this.vertices.length;In&&(n=E,h=f)}}const d=[];if(qi.distanceToPoint(h.point)<0){d.push(tt.create(o,a,c),tt.create(h,a,o),tt.create(h,c,a),tt.create(h,o,c));for(let I=0;I<3;I++){const u=(I+1)%3;d[I+1].getEdge(2).setTwin(d[0].getEdge(u)),d[I+1].getEdge(1).setTwin(d[u+1].getEdge(0))}}else{d.push(tt.create(o,c,a),tt.create(h,o,a),tt.create(h,a,c),tt.create(h,c,o));for(let I=0;I<3;I++){const u=(I+1)%3;d[I+1].getEdge(2).setTwin(d[0].getEdge((3-I)%3)),d[I+1].getEdge(0).setTwin(d[u+1].getEdge(1))}}for(let I=0;I<4;I++)this.faces.push(d[I]);for(let I=0,u=e.length;In&&(n=T,E=this.faces[C])}E!==null&&this.addVertexToFace(f,E)}}return this}reindexFaces(){const e=[];for(let t=0;tt&&(t=n,e=i),i=i.next}while(i!==null&&i.face===s);return e}}computeHorizon(e,t,s,i){this.deleteFaceVertices(s),s.mark=Cc;let n;t===null?n=t=s.getEdge(0):n=t.next;do{const r=n.twin,o=r.face;o.mark===Ri&&(o.distanceToPoint(e)>this.tolerance?this.computeHorizon(e,r,o,i):i.push(n)),n=n.next}while(n!==t);return this}addAdjoiningFace(e,t){const s=tt.create(e,t.tail(),t.head());return this.faces.push(s),s.getEdge(-1).setTwin(t.twin),s.getEdge(0)}addNewFaces(e,t){this.newFaces=[];let s=null,i=null;for(let n=0;n0;)t=t.next,e--;for(;e<0;)t=t.prev,e++;return t}compute(){const e=this.edge.tail(),t=this.edge.head(),s=this.edge.next.head();return ai.set(e.point,t.point,s.point),ai.getNormal(this.normal),ai.getMidpoint(this.midpoint),this.area=ai.getArea(),this.constant=this.normal.dot(this.midpoint),this}distanceToPoint(e){return this.normal.dot(e)-this.constant}}class Qi{constructor(e,t){this.vertex=e,this.prev=null,this.next=null,this.twin=null,this.face=t}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){const e=this.head(),t=this.tail();return t!==null?t.point.distanceTo(e.point):-1}lengthSquared(){const e=this.head(),t=this.tail();return t!==null?t.point.distanceToSquared(e.point):-1}setTwin(e){return this.twin=e,e.twin=this,this}}class Rc{constructor(e){this.point=e,this.prev=null,this.next=null,this.face=null}}class Mr{constructor(){this.head=null,this.tail=null}first(){return this.head}last(){return this.tail}clear(){return this.head=this.tail=null,this}insertBefore(e,t){return t.prev=e.prev,t.next=e,t.prev===null?this.head=t:t.prev.next=t,e.prev=t,this}insertAfter(e,t){return t.prev=e,t.next=e.next,t.next===null?this.tail=t:t.next.prev=t,e.next=t,this}append(e){return this.head===null?this.head=e:this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e,this}appendChain(e){for(this.head===null?this.head=e:this.tail.next=e,e.prev=this.tail;e.next!==null;)e=e.next;return this.tail=e,this}remove(e){return e.prev===null?this.head=e.next:e.prev.next=e.next,e.next===null?this.tail=e.prev:e.next.prev=e.prev,this}removeSubList(e,t){return e.prev===null?this.head=t.next:e.prev.next=t.next,t.next===null?this.tail=e.prev:t.next.prev=e.prev,this}isEmpty(){return this.head===null}}const fn=[2,2,1],pn=[1,0,0];function ht(l,e){return l*3+e}function gc(l){const e=l.elements;let t=0;for(let s=0;s<9;s++)t+=e[s]*e[s];return Math.sqrt(t)}function Fc(l){const e=l.elements;let t=0;for(let s=0;s<3;s++){const i=e[ht(fn[s],pn[s])];t+=2*i*i}return Math.sqrt(t)}function Sc(l,e){let t=0,s=1;const i=l.elements;for(let c=0;c<3;c++){const h=Math.abs(i[ht(fn[c],pn[c])]);h>t&&(t=h,s=c)}let n=1,r=0;const o=pn[s],a=fn[s];if(Math.abs(i[ht(a,o)])>Number.EPSILON){const c=i[ht(a,a)],h=i[ht(o,o)],d=i[ht(a,o)],I=(c-h)/2/d;let u;I<0?u=-1/(-I+Math.sqrt(1+I*I)):u=1/(I+Math.sqrt(1+I*I)),n=1/Math.sqrt(1+u*u),r=u*n}return e.identity(),e.elements[ht(o,o)]=n,e.elements[ht(a,a)]=n,e.elements[ht(a,o)]=r,e.elements[ht(o,a)]=-r,e}function Ac(l,e){let t=0,s=0;const i=10;e.unitary.identity(),e.diagonal.copy(l);const n=e.unitary,r=e.diagonal,o=new Bt,a=new Bt,c=Number.EPSILON*gc(r);for(;sc;)Sc(r,o),a.copy(o).transpose(),r.multiply(o),r.premultiply(a),n.multiply(o),++t>2&&(s++,t=0);return e}function Oc(l){const e=[];for(let re=0;re>8&255]+_e._lut[e>>16&255]+_e._lut[e>>24&255]}-${_e._lut[t&255]}${_e._lut[t>>8&255]}-${_e._lut[t>>16&15|64]}${_e._lut[t>>24&255]}-${_e._lut[s&63|128]}${_e._lut[s>>8&255]}-${_e._lut[s>>16&255]}${_e._lut[s>>24&255]}${_e._lut[i&255]}${_e._lut[i>>8&255]}${_e._lut[i>>16&255]}${_e._lut[i>>24&255]}`.toLowerCase()}static validate(e){if(!_e._pattern.test(e))throw new Error(`${e} is not a valid UUID v4. + +- If you're the tool creator, you can take one from https://www.uuidgenerator.net/. + +- If you're using a platform tool, verify the uuid isn't misspelled or contact the tool creator.`)}};p(Cn,"_pattern",/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/),p(Cn,"_lut",["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"]);let vt=Cn;const Ro=class go{constructor(){p(this,"onDisposed",new $),p(this,"list",new Map),p(this,"enabled",!1),p(this,"_clock"),p(this,"update",()=>{if(!this.enabled)return;const e=this._clock.getDelta();for(const[t,s]of this.list)s.enabled&&s.isUpdateable()&&s.update(e);requestAnimationFrame(this.update)}),this._clock=new Da,go.setupBVH()}add(e,t){if(this.list.has(e))throw new Error("You're trying to add a component that already exists in the components instance. Use Components.get() instead.");vt.validate(e),this.list.set(e,t)}get(e){const t=e.uuid;if(!this.list.has(t)){const s=new e(this);return this.list.has(t)||this.add(t,s),s}return this.list.get(t)}init(){this.enabled=!0,this._clock.start(),this.update()}dispose(){this.enabled=!1;for(const[e,t]of this.list)t.enabled=!1,t.isDisposeable()&&t.dispose();this._clock.stop(),this.onDisposed.trigger(),this.onDisposed.reset()}static setupBVH(){Bs.prototype.computeBoundsTree=dc,Bs.prototype.disposeBoundsTree=Ic,se.prototype.raycast=uc}};p(Ro,"release","2.3.0-alpha.1");let Fo=Ro;class Nc extends Kn{constructor(){super(...arguments),p(this,"meshes",new Set),p(this,"onAfterUpdate",new $),p(this,"onBeforeUpdate",new $),p(this,"onDisposed",new $),p(this,"isDisposing",!1),p(this,"enabled",!0),p(this,"uuid",vt.create()),p(this,"name"),p(this,"_scene"),p(this,"_camera"),p(this,"_renderer",null)}get scene(){if(!this._scene)throw new Error("No scene initialized!");return this._scene}set scene(e){this._scene=e,e.worlds.set(this.uuid,this),e.currentWorld=this,e.onWorldChanged.trigger({world:this,action:"added"})}get camera(){if(!this._camera)throw new Error("No camera initialized!");return this._camera}set camera(e){this._camera=e,e.worlds.set(this.uuid,this),e.currentWorld=this,e.onWorldChanged.trigger({world:this,action:"added"})}get renderer(){return this._renderer}set renderer(e){this._renderer=e,e&&(e.worlds.set(this.uuid,this),e.currentWorld=this,e.onWorldChanged.trigger({world:this,action:"added"}))}update(e){this.enabled&&(!this._scene||!this._camera||(this.scene.currentWorld=this,this.camera.currentWorld=this,this.renderer&&(this.renderer.currentWorld=this),this.onBeforeUpdate.trigger(),this.scene.isUpdateable()&&this.scene.update(e),this.camera.isUpdateable()&&this.camera.update(e),this.renderer&&this.renderer.update(e),this.onAfterUpdate.trigger()))}dispose(e=!0){if(this.enabled=!1,this.isDisposing=!0,this.scene.onWorldChanged.trigger({world:this,action:"removed"}),this.camera.onWorldChanged.trigger({world:this,action:"removed"}),this.renderer&&this.renderer.onWorldChanged.trigger({world:this,action:"removed"}),e){const t=this.components.get(ds);this.scene.dispose(),this.camera.isDisposeable()&&this.camera.dispose(),this.renderer&&this.renderer.dispose();for(const s of this.meshes)t.destroy(s);this.meshes.clear()}this._scene=null,this._camera=null,this._renderer=null,this.onDisposed.trigger()}}class kt{constructor(e,t,s){p(this,"_component"),p(this,"name"),this._component=e,this.name=s,t.get(ut).list.add(this)}get controls(){const e={};for(const t in this._config){const s=this._config[t];e[t]=this.copyEntry(s)}return e}copyEntry(e){if(e.type==="Boolean"){const t=e;return{type:t.type,value:t.value}}if(e.type==="Color"){const t=e;return{type:t.type,value:t.value.clone()}}if(e.type==="Text"){const t=e;return{type:t.type,value:t.value}}if(e.type==="Number"){const t=e;return{type:t.type,value:t.value,min:t.min,max:t.max,interpolable:t.interpolable}}if(e.type==="Select"){const t=e;return{type:t.type,value:t.value,multiple:t.multiple,options:new Set(t.options)}}if(e.type==="Vector3"){const t=e;return{type:t.type,value:t.value.clone()}}if(e.type==="TextSet"){const t=e;return{type:t.type,value:new Set(t.value)}}if(e.type==="None"){const t=e;return{type:t.type,value:t.value}}throw new Error("Invalid entry!")}}const So=class Ao extends Ae{constructor(e){super(e),p(this,"list",new Tt),p(this,"enabled",!0),e.add(Ao.uuid,this)}};p(So,"uuid","b8c764e0-6b24-4e77-9a32-35fa728ee5b4");let ut=So;class yc{constructor(e,t){p(this,"_list"),p(this,"_scene"),this._list=e,this._scene=t}get color(){return this._list.directionalLight.color.value}set color(e){this._list.directionalLight.color.value=e;for(const[,t]of this._scene.directionalLights)t.color.copy(e)}get intensity(){return this._list.directionalLight.intensity.value}set intensity(e){this._list.directionalLight.intensity.value=e;for(const[,t]of this._scene.directionalLights)t.intensity=e}get position(){return this._list.directionalLight.position.value.clone()}set position(e){this._list.directionalLight.position.value=e;for(const[,t]of this._scene.directionalLights)t.position.copy(e)}}class Lc{constructor(e,t){p(this,"_list"),p(this,"_scene"),this._list=e,this._scene=t}get color(){return this._list.ambientLight.color.value}set color(e){this._list.ambientLight.color.value=e;for(const[,t]of this._scene.ambientLights)t.color.copy(e)}get intensity(){return this._list.ambientLight.intensity.value}set intensity(e){this._list.ambientLight.intensity.value=e;for(const[,t]of this._scene.ambientLights)t.intensity=e}}class Pc extends kt{constructor(){super(...arguments),p(this,"_config",{backgroundColor:{value:new ve,type:"Color"},ambientLight:{color:{type:"Color",value:new ve},intensity:{type:"Number",interpolable:!0,min:0,max:10,value:2}},directionalLight:{color:{type:"Color",value:new ve},intensity:{type:"Number",interpolable:!0,min:0,max:10,value:2},position:{type:"Vector3",value:new x}}}),p(this,"ambientLight",new Lc(this._config,this._component)),p(this,"directionalLight",new yc(this._config,this._component))}get backgroundColor(){return this._config.backgroundColor.value}set backgroundColor(e){this._config.backgroundColor.value=e,this._component.three.background=e}}class _c extends pc{constructor(e){super(e),p(this,"onSetup",new $),p(this,"isSetup",!1),p(this,"three"),p(this,"config",new Pc(this,this.components,"Scene")),p(this,"_defaultConfig",{backgroundColor:new ve(2107698),directionalLight:{color:new ve("white"),intensity:1.5,position:new x(5,10,3)},ambientLight:{color:new ve("white"),intensity:1}}),this.three=new Pi,this.three.background=new ve(2107698),this.components.get(ut).list.add(this.config)}setup(e){const t={...this._defaultConfig,...e};this.config.backgroundColor=t.backgroundColor;const s=t.ambientLight;this.config.ambientLight.color=s.color,this.config.ambientLight.intensity=s.intensity;const i=t.directionalLight;this.config.directionalLight.color=i.color,this.config.directionalLight.intensity=i.intensity,this.config.directionalLight.position=i.position,this.deleteAllLights();const{color:n,intensity:r}=this.config.directionalLight,o=new co(n,r);o.position.copy(i.position);const{color:a,intensity:c}=this.config.directionalLight,h=new _a(a,c);this.three.add(o,h),this.directionalLights.set(o.uuid,o),this.ambientLights.set(h.uuid,h),this.isSetup=!0,this.onSetup.trigger()}dispose(){super.dispose(),this.components.get(ut).list.delete(this.config)}}class qu extends fc{constructor(e,t,s){super(e),p(this,"enabled",!0),p(this,"container"),p(this,"three"),p(this,"_canvas"),p(this,"_parameters"),p(this,"_resizeObserver",null),p(this,"onContainerUpdated",new $),p(this,"_resizing",!1),p(this,"resize",r=>{if(this._resizing)return;this._resizing=!0,this.onContainerUpdated.trigger();const o=r?r.x:this.container.clientWidth,a=r?r.y:this.container.clientHeight;this.three.setSize(o,a),this.onResize.trigger(new He(o,a)),this._resizing=!1}),p(this,"resizeEvent",()=>{this.resize()}),p(this,"onContextLost",r=>{r.preventDefault(),this.enabled=!1}),p(this,"onContextBack",()=>{this.three.setRenderTarget(null),this.three.dispose(),this.three=new xs({canvas:this._canvas,antialias:!0,alpha:!0,...this._parameters}),this.enabled=!0}),this.container=t,this._parameters=s,this.three=new xs({antialias:!0,alpha:!0,...s}),this.three.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.setupRenderer(),this.setupEvents(!0),this.resize(),this._canvas=this.three.domElement;const i=this.three.getContext(),{canvas:n}=i;n.addEventListener("webglcontextlost",this.onContextLost,!1),n.addEventListener("webglcontextrestored",this.onContextBack,!1)}update(){if(!this.enabled||!this.currentWorld)return;this.onBeforeUpdate.trigger(this);const e=this.currentWorld.scene.three,t=this.currentWorld.camera.three;this.three.render(e,t),this.onAfterUpdate.trigger(this)}dispose(){this.enabled=!1,this.setupEvents(!1),this.three.domElement.remove(),this.three.forceContextLoss(),this.three.dispose(),this.onResize.reset(),this.onAfterUpdate.reset(),this.onBeforeUpdate.reset(),this.onDisposed.trigger(),this.onDisposed.reset()}getSize(){return new He(this.three.domElement.clientWidth,this.three.domElement.clientHeight)}setupEvents(e){const t=this.three.domElement.parentElement;if(!t)throw new Error("This renderer needs to have an HTML container!");this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),window.removeEventListener("resize",this.resizeEvent),e&&(this._resizeObserver=new ResizeObserver(this.resizeEvent),this._resizeObserver.observe(t),window.addEventListener("resize",this.resizeEvent))}setupRenderer(){this.three.localClippingEnabled=!0,this.container&&this.container.appendChild(this.three.domElement),this.onContainerUpdated.trigger()}}/*! + * camera-controls + * https://github.com/yomotsu/camera-controls + * (c) 2017 @yomotsu + * Released under the MIT License. + */const le={LEFT:1,RIGHT:2,MIDDLE:4},k=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,OFFSET:4,DOLLY:8,ZOOM:16,TOUCH_ROTATE:32,TOUCH_TRUCK:64,TOUCH_OFFSET:128,TOUCH_DOLLY:256,TOUCH_ZOOM:512,TOUCH_DOLLY_TRUCK:1024,TOUCH_DOLLY_OFFSET:2048,TOUCH_DOLLY_ROTATE:4096,TOUCH_ZOOM_TRUCK:8192,TOUCH_ZOOM_OFFSET:16384,TOUCH_ZOOM_ROTATE:32768}),ts={NONE:0,IN:1,OUT:-1};function Dt(l){return l.isPerspectiveCamera}function yt(l){return l.isOrthographicCamera}const ss=Math.PI*2,br=Math.PI/2,Oo=1e-5,Os=Math.PI/180;function et(l,e,t){return Math.max(e,Math.min(t,l))}function me(l,e=Oo){return Math.abs(l)0==u>h&&(u=h,t.value=(u-h)/n),u}function xr(l,e,t,s,i=1/0,n,r){s=Math.max(1e-4,s);const o=2/s,a=o*n,c=1/(1+a+.48*a*a+.235*a*a*a);let h=e.x,d=e.y,I=e.z,u=l.x-h,f=l.y-d,E=l.z-I;const C=h,T=d,m=I,A=i*s,R=A*A,S=u*u+f*f+E*E;if(S>R){const b=Math.sqrt(S);u=u/b*A,f=f/b*A,E=E/b*A}h=l.x-u,d=l.y-f,I=l.z-E;const L=(t.x+o*u)*n,y=(t.y+o*f)*n,w=(t.z+o*E)*n;t.x=(t.x-o*L)*c,t.y=(t.y-o*y)*c,t.z=(t.z-o*w)*c,r.x=h+(u+L)*c,r.y=d+(f+y)*c,r.z=I+(E+w)*c;const P=C-l.x,M=T-l.y,B=m-l.z,O=r.x-C,v=r.y-T,g=r.z-m;return P*O+M*v+B*g>0&&(r.x=C,r.y=T,r.z=m,t.x=(r.x-C)/n,t.y=(r.y-T)/n,t.z=(r.z-m)/n),r}function Ki(l,e){e.set(0,0),l.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=l.length,e.y/=l.length}function Ji(l,e){return yt(l)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}class wc{constructor(){this._listeners={}}addEventListener(e,t){const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(t)===-1&&s[e].push(t)}hasEventListener(e,t){const s=this._listeners;return s[e]!==void 0&&s[e].indexOf(t)!==-1}removeEventListener(e,t){const s=this._listeners[e];if(s!==void 0){const i=s.indexOf(t);i!==-1&&s.splice(i,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const t=this._listeners[e.type];if(t!==void 0){e.target=this;const s=t.slice(0);for(let i=0,n=s.length;i{},this._enabled=!0,this._state=k.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=ts.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new ae.Vector3,this._focalOffsetVelocity=new ae.Vector3,this._zoomVelocity={value:0},this._truckInternal=(R,S,L)=>{let y,w;if(Dt(this._camera)){const P=ce.copy(this._camera.position).sub(this._target),M=this._camera.getEffectiveFOV()*Os,B=P.length()*Math.tan(M*.5);y=this.truckSpeed*R*B/this._elementRect.height,w=this.truckSpeed*S*B/this._elementRect.height}else if(yt(this._camera)){const P=this._camera;y=R*(P.right-P.left)/P.zoom/this._elementRect.width,w=S*(P.top-P.bottom)/P.zoom/this._elementRect.height}else return;this.verticalDragToForward?(L?this.setFocalOffset(this._focalOffsetEnd.x+y,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(y,0,!0),this.forward(-w,!0)):L?this.setFocalOffset(this._focalOffsetEnd.x+y,this._focalOffsetEnd.y+w,this._focalOffsetEnd.z,!0):this.truck(y,w,!0)},this._rotateInternal=(R,S)=>{const L=ss*this.azimuthRotateSpeed*R/this._elementRect.height,y=ss*this.polarRotateSpeed*S/this._elementRect.height;this.rotate(L,y,!0)},this._dollyInternal=(R,S,L)=>{const y=Math.pow(.95,-R*this.dollySpeed),w=this._sphericalEnd.radius,P=this._sphericalEnd.radius*y,M=et(P,this.minDistance,this.maxDistance),B=M-P;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(P,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(B,!0),this._dollyToNoClamp(M,!0)):this._dollyToNoClamp(M,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?P:M)-w,this._dollyControlCoord.set(S,L)),this._lastDollyDirection=Math.sign(-R)},this._zoomInternal=(R,S,L)=>{const y=Math.pow(.95,R*this.dollySpeed),w=this._zoom,P=this._zoom*y;this.zoomTo(P,!0),this.dollyToCursor&&(this._changedZoom+=P-w,this._dollyControlCoord.set(S,L))},typeof ae>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new ae.Quaternion().setFromUnitVectors(this._camera.up,hi),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=k.NONE,this._target=new ae.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new ae.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new ae.Spherical().setFromVector3(ce.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new ae.Vector3,new ae.Vector3,new ae.Vector3,new ae.Vector3],this._updateNearPlaneCorners(),this._boundary=new ae.Box3(new ae.Vector3(-1/0,-1/0,-1/0),new ae.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new ae.Vector2,this.mouseButtons={left:k.ROTATE,middle:k.DOLLY,right:k.TRUCK,wheel:Dt(this._camera)?k.DOLLY:yt(this._camera)?k.ZOOM:k.NONE},this.touches={one:k.TOUCH_ROTATE,two:Dt(this._camera)?k.TOUCH_DOLLY_TRUCK:yt(this._camera)?k.TOUCH_ZOOM_TRUCK:k.NONE,three:k.TOUCH_TRUCK};const s=new ae.Vector2,i=new ae.Vector2,n=new ae.Vector2,r=R=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const y=this._domElement.getBoundingClientRect(),w=R.clientX/y.width,P=R.clientY/y.height;if(wthis._interactiveArea.right||Pthis._interactiveArea.bottom)return}const S=R.pointerType!=="mouse"?null:(R.buttons&le.LEFT)===le.LEFT?le.LEFT:(R.buttons&le.MIDDLE)===le.MIDDLE?le.MIDDLE:(R.buttons&le.RIGHT)===le.RIGHT?le.RIGHT:null;if(S!==null){const y=this._findPointerByMouseButton(S);y&&this._disposePointer(y)}if((R.buttons&le.LEFT)===le.LEFT&&this._lockedPointer)return;const L={pointerId:R.pointerId,clientX:R.clientX,clientY:R.clientY,deltaX:0,deltaY:0,mouseButton:S};this._activePointers.push(L),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",h),this._isDragging=!0,E(R)},o=R=>{if(!this._enabled||!this._domElement||this._lockedPointer)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const y=this._domElement.getBoundingClientRect(),w=R.clientX/y.width,P=R.clientY/y.height;if(wthis._interactiveArea.right||Pthis._interactiveArea.bottom)return}const S=(R.buttons&le.LEFT)===le.LEFT?le.LEFT:(R.buttons&le.MIDDLE)===le.MIDDLE?le.MIDDLE:(R.buttons&le.RIGHT)===le.RIGHT?le.RIGHT:null;if(S!==null){const y=this._findPointerByMouseButton(S);y&&this._disposePointer(y)}const L={pointerId:1,clientX:R.clientX,clientY:R.clientY,deltaX:0,deltaY:0,mouseButton:(R.buttons&le.LEFT)===le.LEFT?le.LEFT:(R.buttons&le.MIDDLE)===le.LEFT?le.MIDDLE:(R.buttons&le.RIGHT)===le.LEFT?le.RIGHT:null};this._activePointers.push(L),this._domElement.ownerDocument.removeEventListener("mousemove",c),this._domElement.ownerDocument.removeEventListener("mouseup",d),this._domElement.ownerDocument.addEventListener("mousemove",c),this._domElement.ownerDocument.addEventListener("mouseup",d),this._isDragging=!0,E(R)},a=R=>{R.cancelable&&R.preventDefault();const S=R.pointerId,L=this._lockedPointer||this._findPointerById(S);if(L){if(L.clientX=R.clientX,L.clientY=R.clientY,L.deltaX=R.movementX,L.deltaY=R.movementY,this._state=0,R.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(R.buttons&le.LEFT)===le.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(R.buttons&le.MIDDLE)===le.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(R.buttons&le.RIGHT)===le.RIGHT&&(this._state=this._state|this.mouseButtons.right);C()}},c=R=>{const S=this._lockedPointer||this._findPointerById(1);S&&(S.clientX=R.clientX,S.clientY=R.clientY,S.deltaX=R.movementX,S.deltaY=R.movementY,this._state=0,(this._lockedPointer||(R.buttons&le.LEFT)===le.LEFT)&&(this._state=this._state|this.mouseButtons.left),(R.buttons&le.MIDDLE)===le.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(R.buttons&le.RIGHT)===le.RIGHT&&(this._state=this._state|this.mouseButtons.right),C())},h=R=>{const S=this._findPointerById(R.pointerId);if(!(S&&S===this._lockedPointer)){if(S&&this._disposePointer(S),R.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=k.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=k.NONE;T()}},d=()=>{const R=this._findPointerById(1);R&&R===this._lockedPointer||(R&&this._disposePointer(R),this._state=k.NONE,T())};let I=-1;const u=R=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===k.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const P=this._domElement.getBoundingClientRect(),M=R.clientX/P.width,B=R.clientY/P.height;if(Mthis._interactiveArea.right||Bthis._interactiveArea.bottom)return}if(R.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===k.ROTATE||this.mouseButtons.wheel===k.TRUCK){const P=performance.now();I-P<1e3&&this._getClientRect(this._elementRect),I=P}const S=Mc?-1:-3,L=R.deltaMode===1?R.deltaY/S:R.deltaY/(S*10),y=this.dollyToCursor?(R.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,w=this.dollyToCursor?(R.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case k.ROTATE:{this._rotateInternal(R.deltaX,R.deltaY),this._isUserControllingRotate=!0;break}case k.TRUCK:{this._truckInternal(R.deltaX,R.deltaY,!1),this._isUserControllingTruck=!0;break}case k.OFFSET:{this._truckInternal(R.deltaX,R.deltaY,!0),this._isUserControllingOffset=!0;break}case k.DOLLY:{this._dollyInternal(-L,y,w),this._isUserControllingDolly=!0;break}case k.ZOOM:{this._zoomInternal(-L,y,w),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},f=R=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===Ue.ACTION.NONE){const S=R instanceof PointerEvent?R.pointerId:0,L=this._findPointerById(S);L&&this._disposePointer(L),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.removeEventListener("mousemove",c),this._domElement.ownerDocument.removeEventListener("mouseup",d);return}R.preventDefault()}},E=R=>{if(this._enabled){if(Ki(this._activePointers,Ge),this._getClientRect(this._elementRect),s.copy(Ge),i.copy(Ge),this._activePointers.length>=2){const S=Ge.x-this._activePointers[1].clientX,L=Ge.y-this._activePointers[1].clientY,y=Math.sqrt(S*S+L*L);n.set(0,y);const w=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,P=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;i.set(w,P)}if(this._state=0,!R)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in R&&R.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(R.buttons&le.LEFT)===le.LEFT&&(this._state=this._state|this.mouseButtons.left),(R.buttons&le.MIDDLE)===le.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(R.buttons&le.RIGHT)===le.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&k.ROTATE)===k.ROTATE||(this._state&k.TOUCH_ROTATE)===k.TOUCH_ROTATE||(this._state&k.TOUCH_DOLLY_ROTATE)===k.TOUCH_DOLLY_ROTATE||(this._state&k.TOUCH_ZOOM_ROTATE)===k.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&k.TRUCK)===k.TRUCK||(this._state&k.TOUCH_TRUCK)===k.TOUCH_TRUCK||(this._state&k.TOUCH_DOLLY_TRUCK)===k.TOUCH_DOLLY_TRUCK||(this._state&k.TOUCH_ZOOM_TRUCK)===k.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&k.DOLLY)===k.DOLLY||(this._state&k.TOUCH_DOLLY)===k.TOUCH_DOLLY||(this._state&k.TOUCH_DOLLY_TRUCK)===k.TOUCH_DOLLY_TRUCK||(this._state&k.TOUCH_DOLLY_OFFSET)===k.TOUCH_DOLLY_OFFSET||(this._state&k.TOUCH_DOLLY_ROTATE)===k.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&k.ZOOM)===k.ZOOM||(this._state&k.TOUCH_ZOOM)===k.TOUCH_ZOOM||(this._state&k.TOUCH_ZOOM_TRUCK)===k.TOUCH_ZOOM_TRUCK||(this._state&k.TOUCH_ZOOM_OFFSET)===k.TOUCH_ZOOM_OFFSET||(this._state&k.TOUCH_ZOOM_ROTATE)===k.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&k.OFFSET)===k.OFFSET||(this._state&k.TOUCH_OFFSET)===k.TOUCH_OFFSET||(this._state&k.TOUCH_DOLLY_OFFSET)===k.TOUCH_DOLLY_OFFSET||(this._state&k.TOUCH_ZOOM_OFFSET)===k.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})}},C=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,Ki(this._activePointers,Ge);const R=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,S=R?-R.deltaX:i.x-Ge.x,L=R?-R.deltaY:i.y-Ge.y;if(i.copy(Ge),((this._state&k.ROTATE)===k.ROTATE||(this._state&k.TOUCH_ROTATE)===k.TOUCH_ROTATE||(this._state&k.TOUCH_DOLLY_ROTATE)===k.TOUCH_DOLLY_ROTATE||(this._state&k.TOUCH_ZOOM_ROTATE)===k.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(S,L),this._isUserControllingRotate=!0),(this._state&k.DOLLY)===k.DOLLY||(this._state&k.ZOOM)===k.ZOOM){const y=this.dollyToCursor?(s.x-this._elementRect.x)/this._elementRect.width*2-1:0,w=this.dollyToCursor?(s.y-this._elementRect.y)/this._elementRect.height*-2+1:0,P=this.dollyDragInverted?-1:1;(this._state&k.DOLLY)===k.DOLLY?(this._dollyInternal(P*L*ci,y,w),this._isUserControllingDolly=!0):(this._zoomInternal(P*L*ci,y,w),this._isUserControllingZoom=!0)}if((this._state&k.TOUCH_DOLLY)===k.TOUCH_DOLLY||(this._state&k.TOUCH_ZOOM)===k.TOUCH_ZOOM||(this._state&k.TOUCH_DOLLY_TRUCK)===k.TOUCH_DOLLY_TRUCK||(this._state&k.TOUCH_ZOOM_TRUCK)===k.TOUCH_ZOOM_TRUCK||(this._state&k.TOUCH_DOLLY_OFFSET)===k.TOUCH_DOLLY_OFFSET||(this._state&k.TOUCH_ZOOM_OFFSET)===k.TOUCH_ZOOM_OFFSET||(this._state&k.TOUCH_DOLLY_ROTATE)===k.TOUCH_DOLLY_ROTATE||(this._state&k.TOUCH_ZOOM_ROTATE)===k.TOUCH_ZOOM_ROTATE){const y=Ge.x-this._activePointers[1].clientX,w=Ge.y-this._activePointers[1].clientY,P=Math.sqrt(y*y+w*w),M=n.y-P;n.set(0,P);const B=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,O=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&k.TOUCH_DOLLY)===k.TOUCH_DOLLY||(this._state&k.TOUCH_DOLLY_ROTATE)===k.TOUCH_DOLLY_ROTATE||(this._state&k.TOUCH_DOLLY_TRUCK)===k.TOUCH_DOLLY_TRUCK||(this._state&k.TOUCH_DOLLY_OFFSET)===k.TOUCH_DOLLY_OFFSET?(this._dollyInternal(M*ci,B,O),this._isUserControllingDolly=!0):(this._zoomInternal(M*ci,B,O),this._isUserControllingZoom=!0)}((this._state&k.TRUCK)===k.TRUCK||(this._state&k.TOUCH_TRUCK)===k.TOUCH_TRUCK||(this._state&k.TOUCH_DOLLY_TRUCK)===k.TOUCH_DOLLY_TRUCK||(this._state&k.TOUCH_ZOOM_TRUCK)===k.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(S,L,!1),this._isUserControllingTruck=!0),((this._state&k.OFFSET)===k.OFFSET||(this._state&k.TOUCH_OFFSET)===k.TOUCH_OFFSET||(this._state&k.TOUCH_DOLLY_OFFSET)===k.TOUCH_DOLLY_OFFSET||(this._state&k.TOUCH_ZOOM_OFFSET)===k.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(S,L,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},T=()=>{Ki(this._activePointers,Ge),i.copy(Ge),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",c),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.removeEventListener("mouseup",d),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",m),this._domElement.ownerDocument.addEventListener("pointerlockerror",A),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",h),E())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",m),this._domElement.ownerDocument.removeEventListener("pointerlockerror",A))};const m=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},A=()=>{this.unlockPointer()};this._addAllEventListeners=R=>{this._domElement=R,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",r),Dc&&this._domElement.addEventListener("mousedown",o),this._domElement.addEventListener("pointercancel",h),this._domElement.addEventListener("wheel",u,{passive:!1}),this._domElement.addEventListener("contextmenu",f)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",r),this._domElement.removeEventListener("mousedown",o),this._domElement.removeEventListener("pointercancel",h),this._domElement.removeEventListener("wheel",u,{passive:!1}),this._domElement.removeEventListener("contextmenu",f),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",c),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.removeEventListener("mouseup",d),this._domElement.ownerDocument.removeEventListener("pointerlockchange",m),this._domElement.ownerDocument.removeEventListener("pointerlockerror",A))},this.cancel=()=>{this._state!==k.NONE&&(this._state=k.NONE,this._activePointers.length=0,T())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=et(e.width,0,1),this._interactiveArea.height=et(e.height,0,1),this._interactiveArea.x=et(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=et(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,s=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,s)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,s=!1){this._isUserControllingRotate=!1;const i=et(e,this.minAzimuthAngle,this.maxAzimuthAngle),n=et(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=i,this._sphericalEnd.phi=n,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,s||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const r=!s||fe(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&fe(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(r)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=ts.NONE,this._changedDolly=0,this._dollyToNoClamp(et(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){const s=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const n=this._collisionTest(),r=fe(n,this._spherical.radius);if(!(s>e)&&r)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,n)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const i=!t||fe(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(i)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(Ls).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const s=!t||fe(this._target.x,this._targetEnd.x,this.restThreshold)&&fe(this._target.y,this._targetEnd.y,this.restThreshold)&&fe(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=et(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const s=!t||fe(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(s)}pan(e,t,s=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,s)}truck(e,t,s=!1){this._camera.updateMatrix(),at.setFromMatrixColumn(this._camera.matrix,0),lt.setFromMatrixColumn(this._camera.matrix,1),at.multiplyScalar(e),lt.multiplyScalar(-t);const i=ce.copy(at).add(lt),n=Ie.copy(this._targetEnd).add(i);return this.moveTo(n.x,n.y,n.z,s)}forward(e,t=!1){ce.setFromMatrixColumn(this._camera.matrix,0),ce.crossVectors(this._camera.up,ce),ce.multiplyScalar(e);const s=Ie.copy(this._targetEnd).add(ce);return this.moveTo(s.x,s.y,s.z,t)}elevate(e,t=!1){return ce.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+ce.x,this._targetEnd.y+ce.y,this._targetEnd.z+ce.z,t)}moveTo(e,t,s,i=!1){this._isUserControllingTruck=!1;const n=ce.set(e,t,s).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,n,this.boundaryFriction),this._needsUpdate=!0,i||this._target.copy(this._targetEnd);const r=!i||fe(this._target.x,this._targetEnd.x,this.restThreshold)&&fe(this._target.y,this._targetEnd.y,this.restThreshold)&&fe(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(r)}lookInDirectionOf(e,t,s,i=!1){const n=ce.set(e,t,s).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(n.x,n.y,n.z,i)}fitToBox(e,t,{cover:s=!1,paddingLeft:i=0,paddingRight:n=0,paddingBottom:r=0,paddingTop:o=0}={}){const a=[],c=e.isBox3?ns.copy(e):ns.setFromObject(e);c.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const h=Ur(this._sphericalEnd.theta,br),d=Ur(this._sphericalEnd.phi,br);a.push(this.rotateTo(h,d,t));const I=ce.setFromSpherical(this._sphericalEnd).normalize(),u=zr.setFromUnitVectors(I,en),f=fe(Math.abs(I.y),1);f&&u.multiply(sn.setFromAxisAngle(hi,h)),u.multiply(this._yAxisUpSpaceInverse);const E=Gr.makeEmpty();Ie.copy(c.min).applyQuaternion(u),E.expandByPoint(Ie),Ie.copy(c.min).setX(c.max.x).applyQuaternion(u),E.expandByPoint(Ie),Ie.copy(c.min).setY(c.max.y).applyQuaternion(u),E.expandByPoint(Ie),Ie.copy(c.max).setZ(c.min.z).applyQuaternion(u),E.expandByPoint(Ie),Ie.copy(c.min).setZ(c.max.z).applyQuaternion(u),E.expandByPoint(Ie),Ie.copy(c.max).setY(c.min.y).applyQuaternion(u),E.expandByPoint(Ie),Ie.copy(c.max).setX(c.min.x).applyQuaternion(u),E.expandByPoint(Ie),Ie.copy(c.max).applyQuaternion(u),E.expandByPoint(Ie),E.min.x-=i,E.min.y-=r,E.max.x+=n,E.max.y+=o,u.setFromUnitVectors(en,I),f&&u.premultiply(sn.invert()),u.premultiply(this._yAxisUpSpace);const C=E.getSize(ce),T=E.getCenter(Ie).applyQuaternion(u);if(Dt(this._camera)){const m=this.getDistanceToFitBox(C.x,C.y,C.z,s);a.push(this.moveTo(T.x,T.y,T.z,t)),a.push(this.dollyTo(m,t)),a.push(this.setFocalOffset(0,0,0,t))}else if(yt(this._camera)){const m=this._camera,A=m.right-m.left,R=m.top-m.bottom,S=s?Math.max(A/C.x,R/C.y):Math.min(A/C.x,R/C.y);a.push(this.moveTo(T.x,T.y,T.z,t)),a.push(this.zoomTo(S,t)),a.push(this.setFocalOffset(0,0,0,t))}return Promise.all(a)}fitToSphere(e,t){const s=[],i=e instanceof ae.Sphere?tn.copy(e):Ue.createBoundingSphere(e,tn);if(s.push(this.moveTo(i.center.x,i.center.y,i.center.z,t)),Dt(this._camera)){const n=this.getDistanceToFitSphere(i.radius);s.push(this.dollyTo(n,t))}else if(yt(this._camera)){const n=this._camera.right-this._camera.left,r=this._camera.top-this._camera.bottom,o=2*i.radius,a=Math.min(n/o,r/o);s.push(this.zoomTo(a,t))}return s.push(this.setFocalOffset(0,0,0,t)),Promise.all(s)}setLookAt(e,t,s,i,n,r,o=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=ts.NONE,this._changedDolly=0;const a=Ie.set(i,n,r),c=ce.set(e,t,s);this._targetEnd.copy(a),this._sphericalEnd.setFromVector3(c.sub(a).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,o||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const h=!o||fe(this._target.x,this._targetEnd.x,this.restThreshold)&&fe(this._target.y,this._targetEnd.y,this.restThreshold)&&fe(this._target.z,this._targetEnd.z,this.restThreshold)&&fe(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&fe(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&fe(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(h)}lerpLookAt(e,t,s,i,n,r,o,a,c,h,d,I,u,f=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=ts.NONE,this._changedDolly=0;const E=ce.set(i,n,r),C=Ie.set(e,t,s);je.setFromVector3(C.sub(E).applyQuaternion(this._yAxisUpSpace));const T=is.set(h,d,I),m=Ie.set(o,a,c);Ps.setFromVector3(m.sub(T).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(E.lerp(T,u));const A=Ps.theta-je.theta,R=Ps.phi-je.phi,S=Ps.radius-je.radius;this._sphericalEnd.set(je.radius+S*u,je.phi+R*u,je.theta+A*u),this.normalizeRotations(),this._needsUpdate=!0,f||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const L=!f||fe(this._target.x,this._targetEnd.x,this.restThreshold)&&fe(this._target.y,this._targetEnd.y,this.restThreshold)&&fe(this._target.z,this._targetEnd.z,this.restThreshold)&&fe(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&fe(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&fe(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(L)}setPosition(e,t,s,i=!1){return this.setLookAt(e,t,s,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,i)}setTarget(e,t,s,i=!1){const n=this.getPosition(ce),r=this.setLookAt(n.x,n.y,n.z,e,t,s,i);return this._sphericalEnd.phi=et(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),r}setFocalOffset(e,t,s,i=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,s),this._needsUpdate=!0,i||this._focalOffset.copy(this._focalOffsetEnd);const n=!i||fe(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&fe(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&fe(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}setOrbitPoint(e,t,s){this._camera.updateMatrixWorld(),at.setFromMatrixColumn(this._camera.matrixWorldInverse,0),lt.setFromMatrixColumn(this._camera.matrixWorldInverse,1),bt.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const i=ce.set(e,t,s),n=i.distanceTo(this._camera.position),r=i.sub(this._camera.position);at.multiplyScalar(r.x),lt.multiplyScalar(r.y),bt.multiplyScalar(r.z),ce.copy(at).add(lt).add(bt),ce.z=ce.z+n,this.dollyTo(n,!1),this.setFocalOffset(-ce.x,ce.y,-ce.z,!1),this.moveTo(e,t,s,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,s,i){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new ae.Vector4,typeof e=="number"?this._viewport.set(e,t,s,i):this._viewport.copy(e)}getDistanceToFitBox(e,t,s,i=!1){if(Ji(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const n=e/t,r=this._camera.getEffectiveFOV()*Os,o=this._camera.aspect;return((i?n>o:nt.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,s){const i=t.lengthSq();if(i===0)return e;const n=Ie.copy(t).add(e),r=this._boundary.clampPoint(n,is).sub(n),o=r.lengthSq();if(o===0)return e.add(t);if(o===i)return e;if(s===0)return e.add(t).add(r);{const a=1+s*o/t.dot(r);return e.add(Ie.copy(t).multiplyScalar(a)).add(r.multiplyScalar(1-s))}}_updateNearPlaneCorners(){if(Dt(this._camera)){const e=this._camera,t=e.near,s=e.getEffectiveFOV()*Os,i=Math.tan(s*.5)*t,n=i*e.aspect;this._nearPlaneCorners[0].set(-n,-i,0),this._nearPlaneCorners[1].set(n,-i,0),this._nearPlaneCorners[2].set(n,i,0),this._nearPlaneCorners[3].set(-n,i,0)}else if(yt(this._camera)){const e=this._camera,t=1/e.zoom,s=e.left*t,i=e.right*t,n=e.top*t,r=e.bottom*t;this._nearPlaneCorners[0].set(s,n,0),this._nearPlaneCorners[1].set(i,n,0),this._nearPlaneCorners[2].set(i,r,0),this._nearPlaneCorners[3].set(s,r,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||Ji(this._camera,"_collisionTest"))return e;const t=this._getTargetDirection(Ls);nn.lookAt(Br,t,this._camera.up);for(let s=0;s<4;s++){const i=Ie.copy(this._nearPlaneCorners[s]);i.applyMatrix4(nn);const n=is.addVectors(this._target,i);ui.set(n,t),ui.far=this._spherical.radius+1;const r=ui.intersectObjects(this.colliderMeshes);r.length!==0&&r[0].distance{const s=()=>{this.removeEventListener("rest",s),t()};this.addEventListener("rest",s)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new ae.Sphere){const s=t,i=s.center;ns.makeEmpty(),e.traverseVisible(r=>{r.isMesh&&ns.expandByObject(r)}),ns.getCenter(i);let n=0;return e.traverseVisible(r=>{if(!r.isMesh)return;const o=r,a=o.geometry.clone();a.applyMatrix4(o.matrixWorld);const c=a.attributes.position;for(let h=0,d=c.count;h{var t;if(!(!this.currentWorld||!this.currentWorld.renderer)){if(this.three instanceof Gt){this.onAspectUpdated.trigger();return}if((t=this.currentWorld.renderer)!=null&&t.isResizeable()){const s=this.currentWorld.renderer.getSize();this.three.aspect=s.width/s.height,this.three.updateProjectionMatrix(),this.onAspectUpdated.trigger()}}}),this.three=this.setupCamera(),this.setupEvents(!0),this.onWorldChanged.add(({action:t,world:s})=>{if(t==="added"){const i=this.newCameraControls();this._allControls.set(s.uuid,i)}if(t==="removed"){const i=this._allControls.get(s.uuid);i&&(i.dispose(),this._allControls.delete(s.uuid))}})}get controls(){if(!this.currentWorld)throw new Error("This camera needs a world to work!");const e=this._allControls.get(this.currentWorld.uuid);if(!e)throw new Error("Controls not found!");return e}get enabled(){return this.currentWorld===null?!1:this.controls.enabled}set enabled(e){this.currentWorld!==null&&(this.controls.enabled=e)}dispose(){this.setupEvents(!1),this.onAspectUpdated.reset(),this.onBeforeUpdate.reset(),this.onAfterUpdate.reset(),this.three.removeFromParent(),this.onDisposed.trigger(),this.onDisposed.reset();for(const[e,t]of this._allControls)t.dispose()}update(e){this.enabled&&(this.onBeforeUpdate.trigger(this),this.controls.update(e),this.onAfterUpdate.trigger(this))}setupCamera(){const e=window.innerWidth/window.innerHeight,t=new Pn(60,e,1,1e3);return t.position.set(50,50,50),t.lookAt(new x(0,0,0)),t}newCameraControls(){if(!this.currentWorld)throw new Error("This camera needs a world to work!");if(!this.currentWorld.renderer)throw new Error("This camera needs a renderer to work!");Ue.install({THREE:Vs.getSubsetOfThree()});const{domElement:e}=this.currentWorld.renderer.three,t=new Ue(this.three,e);return t.smoothTime=.2,t.dollyToCursor=!0,t.infinityDolly=!0,t.minDistance=6,t}setupEvents(e){e?window.addEventListener("resize",this.updateAspect):window.removeEventListener("resize",this.updateAspect)}static getSubsetOfThree(){return{MOUSE:wa,Vector2:He,Vector3:x,Vector4:va,Quaternion:st,Matrix4:Ee,Spherical:Ma,Box3:we,Sphere:Li,Raycaster:_n,MathUtils:wn}}}const yo=class Lo extends Ae{constructor(e){super(e),p(this,"onAfterUpdate",new $),p(this,"onBeforeUpdate",new $),p(this,"onDisposed",new $),p(this,"onWorldCreated",new $),p(this,"onWorldDeleted",new $),p(this,"list",new Map),p(this,"enabled",!0),e.add(Lo.uuid,this)}create(){const e=new Nc(this.components),t=e.uuid;if(this.list.has(t))throw new Error("There is already a world with this name!");return this.list.set(t,e),this.onWorldCreated.trigger(e),e}delete(e){if(!this.list.has(e.uuid))throw new Error("The provided world is not found in the list!");const t=e.uuid;this.list.delete(e.uuid),e.dispose(),this.onWorldDeleted.trigger(t)}dispose(){this.enabled=!1;for(const[e,t]of this.list)t.dispose();this.list.clear(),this.onDisposed.trigger()}update(e){if(this.enabled)for(const[t,s]of this.list)s.update(e)}};p(yo,"uuid","fdb61dc4-2ec1-4966-b83d-54ea795fad4a");let bc=yo;function Uc(l,e,t,s){return new Promise((i,n)=>{function r(){const o=l.clientWaitSync(e,t,0);if(o===l.WAIT_FAILED){n();return}if(o===l.TIMEOUT_EXPIRED){setTimeout(r,s);return}i()}r()})}async function xc(l,e,t,s,i,n,r){const o=l.fenceSync(l.SYNC_GPU_COMMANDS_COMPLETE,0);l.flush(),await Uc(l,o,0,10),l.deleteSync(o),l.bindBuffer(e,t),l.getBufferSubData(e,s,i,n,r),l.bindBuffer(e,null)}async function Po(l,e,t,s,i,n,r,o){const a=l.createBuffer();return l.bindBuffer(l.PIXEL_PACK_BUFFER,a),l.bufferData(l.PIXEL_PACK_BUFFER,o.byteLength,l.STREAM_READ),l.readPixels(e,t,s,i,n,r,0),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),await xc(l,l.PIXEL_PACK_BUFFER,a,0,o),l.deleteBuffer(a),o}class Bc extends kt{constructor(){super(...arguments),p(this,"_config",{enabled:{value:!0,type:"Boolean"},width:{type:"Number",interpolable:!0,value:512,min:32,max:1024},height:{type:"Number",interpolable:!0,value:512,min:32,max:1024},autoUpdate:{value:!0,type:"Boolean"},renderDebugFrame:{value:!1,type:"Boolean"},updateInterval:{type:"Number",interpolable:!0,value:1,min:0,max:1},threshold:{type:"Number",interpolable:!0,value:100,min:1,max:512}}),p(this,"_interval",null)}get enabled(){return this._config.enabled.value}set enabled(e){this._config.enabled.value=e,this._component.enabled=e}get width(){return this._config.width.value}set width(e){this.setWidthHeight(e,this.height)}get height(){return this._config.height.value}set height(e){this.setWidthHeight(this.width,e)}get autoUpdate(){return this._config.autoUpdate.value}set autoUpdate(e){this.setAutoAndInterval(e,this.updateInterval)}get updateInterval(){return this._config.updateInterval.value}set updateInterval(e){this.setAutoAndInterval(this.autoUpdate,e)}get renderDebugFrame(){return this._config.renderDebugFrame.value}set renderDebugFrame(e){this._config.renderDebugFrame.value=e}get threshold(){return this._config.threshold.value}set threshold(e){this._config.threshold.value=e}setWidthHeight(e,t){if(e<=0||t<=0)throw new Error("The width and height of the culler renderer must be more than 0!");this._config.width.value=e,this._config.height.value=t,this.resetRenderTarget()}setAutoAndInterval(e,t){if(t<=0)throw new Error("The updateInterval of the culler renderer must be more than 0!");this._config.autoUpdate.value=e,this._config.updateInterval.value=t,this.resetInterval(e)}resetRenderTarget(){this._component.renderTarget.dispose(),this._component.renderTarget=new Si(this.width,this.height),this._component.bufferSize=this.width*this.height*4,this._component.buffer=new Uint8Array(this._component.bufferSize)}resetInterval(e){this._interval!==null&&window.clearInterval(this._interval),e&&(this._interval=window.setInterval(async()=>{this._component.preventUpdate||await this._component.updateVisibility()},this.updateInterval))}}class Yc{constructor(e,t){if(p(this,"onSetup",new $),p(this,"onDisposed",new $),p(this,"onViewUpdated",new mi),p(this,"enabled",!0),p(this,"needsUpdate",!1),p(this,"components"),p(this,"renderTarget",new Si),p(this,"bufferSize",1),p(this,"buffer",new Uint8Array),p(this,"preventUpdate",!1),p(this,"config"),p(this,"isSetup",!1),p(this,"world"),p(this,"renderer"),p(this,"_defaultConfig",{enabled:!0,height:512,width:512,updateInterval:1e3,autoUpdate:!0,renderDebugFrame:!1,threshold:100}),p(this,"worker"),p(this,"scene",new Pi),p(this,"_availableColor",1),p(this,"_isWorkerBusy",!1),p(this,"updateVisibility",async n=>{if(!this.enabled||!this.needsUpdate&&!n||this._isWorkerBusy)return;this._isWorkerBusy=!0;const r=this.world.camera.three;r.updateMatrix();const{width:o,height:a}=this.config;this.renderer.setSize(o,a),this.renderer.setRenderTarget(this.renderTarget),this.renderer.render(this.scene,r);const c=this.renderer.getContext();await Po(c,0,0,o,a,c.RGBA,c.UNSIGNED_BYTE,this.buffer),this.renderer.setRenderTarget(null),this.config.renderDebugFrame&&this.renderer.render(this.scene,r),this.worker.postMessage({buffer:this.buffer}),this.needsUpdate=!1}),!t.renderer)throw new Error("The given world must have a renderer!");this.components=e,this.config=new Bc(this,this.components,"Culler renderer"),this.components.get(ut).list.add(this.config),this.world=t,this.renderer=new xs,this.renderer.clippingPlanes=t.renderer.clippingPlanes;const s=` + addEventListener("message", (event) => { + const { buffer } = event.data; + const colors = new Map(); + for (let i = 0; i < buffer.length; i += 4) { + const r = buffer[i]; + const g = buffer[i + 1]; + const b = buffer[i + 2]; + const code = "" + r + "-" + g + "-" + b; + if(colors.has(code)) { + colors.set(code, colors.get(code) + 1); + } else { + colors.set(code, 1); + } + } + postMessage({ colors }); + }); + `,i=new Blob([s],{type:"application/javascript"});this.worker=new Worker(URL.createObjectURL(i)),this.setup()}dispose(){this.enabled=!1,this.config.autoUpdate=!1,this.components.get(ut).list.delete(this.config);for(const e of this.scene.children)e.removeFromParent();this.onViewUpdated.reset(),this.worker.terminate(),this.renderer.forceContextLoss(),this.renderer.dispose(),this.renderTarget.dispose(),this.buffer=null,this.onDisposed.reset()}setup(e){const t={...this._defaultConfig,...e},{width:s,height:i}=t;this.config.setWidthHeight(s,i);const{updateInterval:n,autoUpdate:r}=t;this.config.setAutoAndInterval(r,n),this.config.threshold=t.threshold,this.isSetup=!0,this.onSetup.trigger()}getAvailableColor(){let e=BigInt(this._availableColor.toString());const t=[];do t.unshift(Number(e%256n)),e/=256n;while(e);for(;t.length!==3;)t.unshift(0);const[s,i,n]=t,r=`${s}-${i}-${n}`;return{r:s,g:i,b:n,code:r}}increaseColor(){if(this._availableColor===256*256*256){console.warn("Color can't be increased over 256 x 256 x 256!");return}this._availableColor++}decreaseColor(){if(this._availableColor===1){console.warn("Color can't be decreased under 0!");return}this._availableColor--}}class Vc extends Yc{constructor(e,t){super(e,t),p(this,"onViewUpdated",new $),p(this,"colorMeshes",new Map),p(this,"_colorCodeMeshMap",new Map),p(this,"_meshIDColorCodeMap",new Map),p(this,"_currentVisibleMeshes",new Set),p(this,"_recentlyHiddenMeshes",new Set),p(this,"_transparentMat",new us({transparent:!0,opacity:0})),p(this,"handleWorkerMessage",async s=>{if(this.preventUpdate)return;const i=s.data.colors;this._recentlyHiddenMeshes=new Set(this._currentVisibleMeshes),this._currentVisibleMeshes.clear();for(const[n,r]of i){if(r{for(const n of s)n.visible=!0;for(const n of i)n.visible=!1})}get threshold(){return this.config.threshold}set threshold(e){this.config.threshold=e}dispose(){super.dispose(),this._currentVisibleMeshes.clear(),this._recentlyHiddenMeshes.clear(),this._meshIDColorCodeMap.clear(),this._transparentMat.dispose(),this._colorCodeMeshMap.clear();const e=this.components.get(ds);for(const t in this.colorMeshes){const s=this.colorMeshes.get(t);s&&e.destroy(s,!0)}this.colorMeshes.clear()}add(e){if(!this.enabled)return;if(this.preventUpdate){console.log("Culler processing not finished yet.");return}this.preventUpdate=!0;const t=e instanceof Vt,{geometry:s,material:i}=e,{colorMaterial:n,code:r}=this.getAvailableMaterial();let o;if(Array.isArray(i)){let h=!0;const d=[];for(const I of i)Dr.isTransparent(I)?d.push(this._transparentMat):(h=!1,d.push(n));if(h){n.dispose(),this.preventUpdate=!1;return}o=d}else if(Dr.isTransparent(i)){n.dispose(),this.preventUpdate=!1;return}else o=n;this._colorCodeMeshMap.set(r,e),this._meshIDColorCodeMap.set(e.uuid,r);const a=t?e.count:1,c=new Vt(s,o,a);t?c.instanceMatrix=e.instanceMatrix:c.setMatrixAt(0,new Ee),e.visible=!1,e.updateWorldMatrix(!0,!1),c.applyMatrix4(e.matrixWorld),c.updateMatrix(),this.scene.add(c),this.colorMeshes.set(e.uuid,c),this.increaseColor(),this.preventUpdate=!1}remove(e){if(this.preventUpdate){console.log("Culler processing not finished yet.");return}this.preventUpdate=!0;const t=this.components.get(ds);this._currentVisibleMeshes.delete(e),this._recentlyHiddenMeshes.delete(e);const s=this.colorMeshes.get(e.uuid),i=this._meshIDColorCodeMap.get(e.uuid);if(!s||!i){this.preventUpdate=!1;return}this._colorCodeMeshMap.delete(i),this._meshIDColorCodeMap.delete(e.uuid),this.colorMeshes.delete(e.uuid),s.geometry=void 0,s.material=[],t.destroy(s,!0),this._recentlyHiddenMeshes.delete(e),this._currentVisibleMeshes.delete(e),this.preventUpdate=!1}updateInstanced(e){for(const t of e){const s=this.colorMeshes.get(t.uuid);s&&(s.count=t.count)}}getAvailableMaterial(){const{r:e,g:t,b:s,code:i}=this.getAvailableColor(),n=Bi.enabled;Bi.enabled=!1;const r=new ve(`rgb(${e}, ${t}, ${s})`);if(!this.world.renderer)throw new Error("Renderer not found in the world!");const o=this.world.renderer.clippingPlanes,a=new us({color:r,clippingPlanes:o,side:Gs});return Bi.enabled=n,{colorMaterial:a,code:i}}}const _o=class Tn extends Ae{constructor(e){super(e),p(this,"onDisposed",new $),p(this,"_enabled",!0),p(this,"list",new Map),e.add(Tn.uuid,this)}get enabled(){return this._enabled}set enabled(e){this._enabled=e;for(const[t,s]of this.list)s.enabled=e}create(e){if(this.list.has(e.uuid))return this.list.get(e.uuid);const t=new Vc(this.components,e);return this.list.set(e.uuid,t),t}delete(e){const t=this.list.get(e.uuid);t&&t.dispose(),this.list.delete(e.uuid)}dispose(){this.enabled=!1,this.onDisposed.trigger(Tn.uuid),this.onDisposed.reset();for(const[e,t]of this.list)t.dispose();this.list.clear()}updateInstanced(e){for(const[,t]of this.list)t.updateInstanced(e)}};p(_o,"uuid","69f2a50d-c266-44fc-b1bd-fa4d34be89e6");let Gc=_o;class zc{constructor(e,t){if(p(this,"onDisposed",new $),p(this,"onDistanceComputed",new $),p(this,"excludedObjects",new Set),p(this,"enabled",!0),p(this,"renderDebugFrame",!1),p(this,"components"),p(this,"scene",new Pi),p(this,"camera",new Gt(-1,1,1,-1,0,1)),p(this,"depthMaterial"),p(this,"world"),p(this,"renderer"),p(this,"worker"),p(this,"_width",512),p(this,"_height",512),p(this,"_postQuad"),p(this,"tempRT"),p(this,"resultRT"),p(this,"bufferSize"),p(this,"_buffer"),p(this,"_isWorkerBusy",!1),p(this,"compute",async()=>{if(!this.enabled||this.world.isDisposing||this._isWorkerBusy)return;this._isWorkerBusy=!0,this.world.camera.three.updateMatrix(),this.renderer.setSize(this._width,this._height),this.renderer.setRenderTarget(this.tempRT);const o="visibilityBeforeDistanceCheck";for(const c of this.excludedObjects)c.userData[o]=c.visible,c.visible=!1;this.renderer.render(this.world.scene.three,this.world.camera.three);for(const c of this.excludedObjects)c.userData[o]!==void 0&&(c.visible=c.userData[o]);this.depthMaterial.uniforms.tDiffuse.value=this.tempRT.texture,this.depthMaterial.uniforms.tDepth.value=this.tempRT.depthTexture,this.renderer.setRenderTarget(this.resultRT),this.renderer.render(this.scene,this.camera);const a=this.renderer.getContext();try{await Po(a,0,0,this._width,this._height,a.RGBA,a.UNSIGNED_BYTE,this._buffer)}catch{this.renderer.setRenderTarget(null),this._isWorkerBusy=!1;return}this.renderer.setRenderTarget(null),this.renderDebugFrame&&this.renderer.render(this.scene,this.camera),this.worker.postMessage({buffer:this._buffer})}),p(this,"handleWorkerMessage",o=>{if(!this.enabled||this.world.isDisposing)return;const a=o.data.colors;let c=Number.MAX_VALUE;for(const u of a)u!==0&&u + +varying vec2 vUv; +uniform sampler2D tDiffuse; +uniform sampler2D tDepth; +uniform float cameraNear; +uniform float cameraFar; + + +float readDepth( sampler2D depthSampler, vec2 coord ) { + float fragCoordZ = texture2D( depthSampler, coord ).x; + float viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar ); + return viewZToOrthographicDepth( viewZ, cameraNear, cameraFar ); +} + +void main() { + //vec3 diffuse = texture2D( tDiffuse, vUv ).rgb; + float depth = readDepth( tDepth, vUv ); + + gl_FragColor.rgb = 1.0 - vec3( depth ); + gl_FragColor.a = 1.0; +} + `,uniforms:{cameraNear:{value:s.near},cameraFar:{value:s.far},tDiffuse:{value:null},tDepth:{value:null}}});const i=new _i(2,2);this._postQuad=new se(i,this.depthMaterial),this.scene.add(this._postQuad),this.renderer.clippingPlanes=t.renderer.clippingPlanes;const n=` + addEventListener("message", (event) => { + const { buffer } = event.data; + const colors = new Set(); + for (let i = 0; i < buffer.length; i += 4) { + const r = buffer[i]; + colors.add(r); + } + postMessage({ colors }); + }); + `,r=new Blob([n],{type:"application/javascript"});this.worker=new Worker(URL.createObjectURL(r)),this.worker.addEventListener("message",this.handleWorkerMessage)}dispose(){this.enabled=!1,this.onDistanceComputed.reset(),this.worker.terminate(),this.renderer.forceContextLoss(),this.renderer.dispose(),this.tempRT.dispose(),this.resultRT.dispose();const e=[...this.scene.children];this.excludedObjects.clear();for(const t of e)t.removeFromParent();this._postQuad.geometry.dispose(),this._postQuad.removeFromParent(),this._buffer=null,this.onDisposed.reset()}}class Qu extends _c{constructor(){super(...arguments),p(this,"_distanceRenderer"),p(this,"autoBias",!0),p(this,"_defaultShadowConfig",{cascade:1,resolution:512}),p(this,"_lightsWithShadow",new Map),p(this,"_isComputingShadows",!1),p(this,"_shadowsEnabled",!0),p(this,"_bias",0),p(this,"recomputeShadows",e=>{if(!this._shadowsEnabled)return;if(this.autoBias&&(this.bias=e/-1e5),e*=1.5,!this.currentWorld)throw new Error("A world needs to be assigned to the scene before computing shadows!");if(!this._lightsWithShadow.size)throw new Error("No shadows found!");const t=this.currentWorld.camera.three;if(!(t instanceof Pn)&&!(t instanceof Gt))throw new Error("Invalid camera type!");const s=new x;t.getWorldDirection(s);let i=e;const n=new x;n.copy(this.config.directionalLight.position),n.normalize();for(const[r,o]of this._lightsWithShadow){const a=this.directionalLights.get(o);if(!a)throw new Error("Light not found.");const c=new x;c.copy(s);const h=r===this._lightsWithShadow.size-1,d=h?i/2:i*2/3;c.multiplyScalar(d),c.add(t.position);const I=i-d,u=new x;u.copy(n),u.multiplyScalar(I),a.target.position.copy(c),a.position.copy(c),a.position.add(u),a.shadow.camera.right=I,a.shadow.camera.left=-I,a.shadow.camera.top=I,a.shadow.camera.bottom=-I,a.shadow.camera.far=I*2,a.shadow.camera.updateProjectionMatrix(),a.shadow.camera.updateMatrix(),h||(i/=3)}this._isComputingShadows=!1})}get bias(){return this._bias}set bias(e){this._bias=e;for(const[,t]of this._lightsWithShadow){const s=this.directionalLights.get(t);s&&(s.shadow.bias=e)}}get shadowsEnabled(){return this._shadowsEnabled}set shadowsEnabled(e){this._shadowsEnabled=e;for(const[,t]of this.directionalLights)t.castShadow=e}get distanceRenderer(){if(!this._distanceRenderer)throw new Error("You must set up this component before accessing the distance renderer!");return this._distanceRenderer}setup(e){super.setup(e);const t={...this._defaultConfig,...this._defaultShadowConfig,...e};if(t.cascade<=0)throw new Error("Config.shadows.cascade must be a natural number greater than 0!");if(t.cascade>1)throw new Error("Multiple shadows not supported yet!");if(!this.currentWorld)throw new Error("A world needs to be assigned to the scene before setting it up!");for(const[,s]of this.directionalLights)s.target.removeFromParent(),s.removeFromParent(),s.dispose();this.directionalLights.clear(),this._distanceRenderer||(this._distanceRenderer=new zc(this.components,this.currentWorld),this._distanceRenderer.onDistanceComputed.add(this.recomputeShadows)),this._lightsWithShadow.clear();for(let s=0;s{this._event=t}),this.dom=e,this.setupEvents(!0)}get position(){if(this._event){const e=this.dom.getBoundingClientRect();this._position.x=this.getPositionX(e,this._event),this._position.y=this.getPositionY(e,this._event)}return this._position}dispose(){this.setupEvents(!1),this.onDisposed.trigger(),this.onDisposed.reset()}getPositionY(e,t){return-((t.clientY-e.top)/(e.bottom-e.top))*2+1}getPositionX(e,t){return(t.clientX-e.left)/(e.right-e.left)*2-1}setupEvents(e){e?this.dom.addEventListener("pointermove",this.updateMouseInfo):this.dom.removeEventListener("pointermove",this.updateMouseInfo)}}class Hc{constructor(e,t){p(this,"enabled",!0),p(this,"components"),p(this,"onDisposed",new $),p(this,"mouse"),p(this,"three",new _n),p(this,"world");const s=t.renderer;if(!s)throw new Error("A renderer is needed for the raycaster to work!");this.world=t,this.mouse=new kc(s.three.domElement),this.components=e}dispose(){this.mouse.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}castRay(e=Array.from(this.world.meshes)){if(!this.world)throw new Error("A world is needed to cast rays!");const t=this.world.camera.three;return this.three.setFromCamera(this.mouse.position,t),this.intersect(e)}castRayFromVector(e,t,s=Array.from(this.world.meshes)){return this.three.set(e,t),this.intersect(s)}intersect(e=Array.from(this.world.meshes)){const t=this.three.intersectObjects(e),s=this.filterClippingPlanes(t);return s.length>0?s[0]:null}filterClippingPlanes(e){if(!this.world.renderer)throw new Error("Renderer not found!");const t=this.world.renderer.three;if(!t.clippingPlanes)return e;const s=t.clippingPlanes;return e.length<=0||!s||(s==null?void 0:s.length)<=0?e:e.filter(i=>s.every(n=>n.distanceToPoint(i.point)>0))}}const wo=class vo extends Ae{constructor(e){super(e),p(this,"enabled",!0),p(this,"list",new Map),p(this,"onDisposed",new $),e.add(vo.uuid,this)}get(e){if(this.list.has(e.uuid))return this.list.get(e.uuid);const t=new Hc(this.components,e);return this.list.set(e.uuid,t),e.onDisposed.add(()=>{this.delete(e)}),t}delete(e){const t=this.list.get(e.uuid);t&&t.dispose(),this.list.delete(e.uuid)}dispose(){for(const[e,t]of this.list)t.dispose();this.list.clear(),this.onDisposed.trigger()}};p(wo,"uuid","d5d8bdf0-db25-4952-b951-b643af207ace");let mn=wo;class Wc extends kt{constructor(){super(...arguments),p(this,"_config",{visible:{value:!0,type:"Boolean"},color:{value:new ve,type:"Color"},primarySize:{type:"Number",interpolable:!0,value:1,min:0,max:1e3},secondarySize:{type:"Number",interpolable:!0,value:10,min:0,max:1e3},distance:{type:"Number",interpolable:!0,value:500,min:0,max:500}})}get visible(){return this._config.visible.value}set visible(e){this._config.visible.value=e,this._component.visible=e}get color(){return this._config.color.value}set color(e){this._config.color.value=e,this._component.material.uniforms.uColor.value=e,this._component.material.uniformsNeedUpdate=!0}get primarySize(){return this._config.primarySize.value}set primarySize(e){this._config.primarySize.value=e,this._component.material.uniforms.uSize1.value=e,this._component.material.uniformsNeedUpdate=!0}get secondarySize(){return this._config.secondarySize.value}set secondarySize(e){this._config.secondarySize.value=e,this._component.material.uniforms.uSize2.value=e,this._component.material.uniformsNeedUpdate=!0}get distance(){return this._config.distance.value}set distance(e){this._config.distance.value=e,this._component.material.uniforms.uDistance.value=e,this._component.material.uniformsNeedUpdate=!0}}class Xc{constructor(e,t){p(this,"onDisposed",new $),p(this,"onSetup",new $),p(this,"isSetup",!1),p(this,"world"),p(this,"components"),p(this,"config"),p(this,"_defaultConfig",{visible:!0,color:new ve(12303291),primarySize:1,secondarySize:10,distance:500}),p(this,"three"),p(this,"_fade",3),p(this,"updateZoom",()=>{this.world.camera instanceof Vs&&(this.material.uniforms.uZoom.value=this.world.camera.three.zoom)}),this.world=t;const{color:s,primarySize:i,secondarySize:n,distance:r}=this._defaultConfig;this.components=e,this.config=new Wc(this,this.components,"Grid"),e.get(ut).list.add(this.config);const o=new _i(2,2,1,1),a=new ho({side:Gs,uniforms:{uSize1:{value:i},uSize2:{value:n},uColor:{value:s},uDistance:{value:r},uFade:{value:this._fade},uZoom:{value:1}},transparent:!0,vertexShader:` + + varying vec3 worldPosition; + + uniform float uDistance; + + void main() { + + vec3 pos = position.xzy * uDistance; + pos.xz += cameraPosition.xz; + + worldPosition = pos; + + gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0); + + } + `,fragmentShader:` + + varying vec3 worldPosition; + + uniform float uZoom; + uniform float uFade; + uniform float uSize1; + uniform float uSize2; + uniform vec3 uColor; + uniform float uDistance; + + + + float getGrid(float size) { + + vec2 r = worldPosition.xz / size; + + + vec2 grid = abs(fract(r - 0.5) - 0.5) / fwidth(r); + float line = min(grid.x, grid.y); + + + return 1.0 - min(line, 1.0); + } + + void main() { + + + float d = 1.0 - min(distance(cameraPosition.xz, worldPosition.xz) / uDistance, 1.0); + + float g1 = getGrid(uSize1); + float g2 = getGrid(uSize2); + + // Ortho camera fades the grid away when zooming out + float minZoom = step(0.2, uZoom); + float zoomFactor = pow(min(uZoom, 1.), 2.) * minZoom; + + gl_FragColor = vec4(uColor.rgb, mix(g2, g1, g1) * pow(d, uFade)); + gl_FragColor.a = mix(0.5 * gl_FragColor.a, gl_FragColor.a, g2) * zoomFactor; + + if ( gl_FragColor.a <= 0.0 ) discard; + + + } + + `,extensions:{derivatives:!0}});this.three=new se(o,a),this.three.frustumCulled=!1,t.scene.three.add(this.three),this.setupEvents(!0)}get visible(){return this.three.visible}set visible(e){e?this.world.scene.three.add(this.three):this.three.removeFromParent()}get material(){return this.three.material}get fade(){return this._fade===3}set fade(e){this._fade=e?3:0,this.material.uniforms.uFade.value=this._fade}setup(e){const t={...this._defaultConfig,...e};this.config.visible=!0,this.config.color=t.color,this.config.primarySize=t.primarySize,this.config.secondarySize=t.secondarySize,this.config.distance=t.distance,this.isSetup=!0,this.onSetup.trigger()}dispose(){this.setupEvents(!1),this.components.get(ut).list.delete(this.config),this.components.get(ds).destroy(this.three),this.onDisposed.trigger(),this.onDisposed.reset(),this.world=null,this.components=null}setupEvents(e){if(this.world.isDisposing||!(this.world.camera instanceof Vs))return;const t=this.world.camera.controls;e?t.addEventListener("update",this.updateZoom):t.removeEventListener("update",this.updateZoom)}}const Mo=class Do extends Ae{constructor(e){super(e),p(this,"list",new Map),p(this,"onDisposed",new $),p(this,"enabled",!0),e.add(Do.uuid,this)}create(e){if(this.list.has(e.uuid))throw new Error("This world already has a grid!");const t=new Xc(this.components,e);return this.list.set(e.uuid,t),e.onDisposed.add(()=>{this.delete(e)}),t}delete(e){const t=this.list.get(e.uuid);t&&t.dispose(),this.list.delete(e.uuid)}dispose(){for(const[e,t]of this.list)t.dispose();this.list.clear(),this.onDisposed.trigger(),this.onDisposed.reset()}};p(Mo,"uuid","d1e814d5-b81c-4452-87a2-f039375e0489");let Ku=Mo;const Ut=new _n,be=new x,Nt=new x,Se=new st,kr={X:new x(1,0,0),Y:new x(0,1,0),Z:new x(0,0,1)},rn={type:"change"},Hr={type:"mouseDown"},Wr={type:"mouseUp",mode:null},Xr={type:"objectChange"};class jc extends Oi{constructor(e,t){super(),t===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),t=document),this.isTransformControls=!0,this.visible=!1,this.domElement=t,this.domElement.style.touchAction="none";const s=new Jc;this._gizmo=s,this.add(s);const i=new eh;this._plane=i,this.add(i);const n=this;function r(m,A){let R=A;Object.defineProperty(n,m,{get:function(){return R!==void 0?R:A},set:function(S){R!==S&&(R=S,i[m]=S,s[m]=S,n.dispatchEvent({type:m+"-changed",value:S}),n.dispatchEvent(rn))}}),n[m]=A,i[m]=A,s[m]=A}r("camera",e),r("object",void 0),r("enabled",!0),r("axis",null),r("mode","translate"),r("translationSnap",null),r("rotationSnap",null),r("scaleSnap",null),r("space","world"),r("size",1),r("dragging",!1),r("showX",!0),r("showY",!0),r("showZ",!0);const o=new x,a=new x,c=new st,h=new st,d=new x,I=new st,u=new x,f=new x,E=new x,C=0,T=new x;r("worldPosition",o),r("worldPositionStart",a),r("worldQuaternion",c),r("worldQuaternionStart",h),r("cameraPosition",d),r("cameraQuaternion",I),r("pointStart",u),r("pointEnd",f),r("rotationAxis",E),r("rotationAngle",C),r("eye",T),this._offset=new x,this._startNorm=new x,this._endNorm=new x,this._cameraScale=new x,this._parentPosition=new x,this._parentQuaternion=new st,this._parentQuaternionInv=new st,this._parentScale=new x,this._worldScaleStart=new x,this._worldQuaternionInv=new st,this._worldScale=new x,this._positionStart=new x,this._quaternionStart=new st,this._scaleStart=new x,this._getPointer=Zc.bind(this),this._onPointerDown=qc.bind(this),this._onPointerHover=$c.bind(this),this._onPointerMove=Qc.bind(this),this._onPointerUp=Kc.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;Ut.setFromCamera(e,this.camera);const t=on(this._gizmo.picker[this.mode],Ut);t?this.axis=t.object.name:this.axis=null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e.button!==0)&&this.axis!==null){Ut.setFromCamera(e,this.camera);const t=on(this._plane,Ut,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,Hr.mode=this.mode,this.dispatchEvent(Hr)}}pointerMove(e){const t=this.axis,s=this.mode,i=this.object;let n=this.space;if(s==="scale"?n="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(n="world"),i===void 0||t===null||this.dragging===!1||e.button!==-1)return;Ut.setFromCamera(e,this.camera);const r=on(this._plane,Ut,!0);if(r){if(this.pointEnd.copy(r.point).sub(this.worldPositionStart),s==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),n==="local"&&t!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf("X")===-1&&(this._offset.x=0),t.indexOf("Y")===-1&&(this._offset.y=0),t.indexOf("Z")===-1&&(this._offset.z=0),n==="local"&&t!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),i.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(n==="local"&&(i.position.applyQuaternion(Se.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.position.applyQuaternion(this._quaternionStart)),n==="world"&&(i.parent&&i.position.add(be.setFromMatrixPosition(i.parent.matrixWorld)),t.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.parent&&i.position.sub(be.setFromMatrixPosition(i.parent.matrixWorld))));else if(s==="scale"){if(t.search("XYZ")!==-1){let o=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(o*=-1),Nt.set(o,o,o)}else be.copy(this.pointStart),Nt.copy(this.pointEnd),be.applyQuaternion(this._worldQuaternionInv),Nt.applyQuaternion(this._worldQuaternionInv),Nt.divide(be),t.search("X")===-1&&(Nt.x=1),t.search("Y")===-1&&(Nt.y=1),t.search("Z")===-1&&(Nt.z=1);i.scale.copy(this._scaleStart).multiply(Nt),this.scaleSnap&&(t.search("X")!==-1&&(i.scale.x=Math.round(i.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(i.scale.y=Math.round(i.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(i.scale.z=Math.round(i.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(s==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const o=20/this.worldPosition.distanceTo(be.setFromMatrixPosition(this.camera.matrixWorld));let a=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(be.copy(this.rotationAxis).cross(this.eye))*o):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(kr[t]),be.copy(kr[t]),n==="local"&&be.applyQuaternion(this.worldQuaternion),be.cross(this.eye),be.length()===0?a=!0:this.rotationAngle=this._offset.dot(be.normalize())*o),(t==="E"||a)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),n==="local"&&t!=="E"&&t!=="XYZE"?(i.quaternion.copy(this._quaternionStart),i.quaternion.multiply(Se.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),i.quaternion.copy(Se.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),i.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(rn),this.dispatchEvent(Xr)}}pointerUp(e){e.button===0&&(this.dragging&&this.axis!==null&&(Wr.mode=this.mode,this.dispatchEvent(Wr)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}attach(e){return this.object=e,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(rn),this.dispatchEvent(Xr),this.pointStart.copy(this.pointEnd))}getRaycaster(){return Ut}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}}function Zc(l){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:l.button};{const e=this.domElement.getBoundingClientRect();return{x:(l.clientX-e.left)/e.width*2-1,y:-(l.clientY-e.top)/e.height*2+1,button:l.button}}}function $c(l){if(this.enabled)switch(l.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(l));break}}function qc(l){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(l.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(l)),this.pointerDown(this._getPointer(l)))}function Qc(l){this.enabled&&this.pointerMove(this._getPointer(l))}function Kc(l){this.enabled&&(this.domElement.releasePointerCapture(l.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(l)))}function on(l,e,t){const s=e.intersectObject(l,!0);for(let i=0;i.9&&(n.visible=!1)),this.axis==="Y"&&(Se.setFromEuler(di.set(0,0,Math.PI/2)),n.quaternion.copy(t).multiply(Se),Math.abs(Ce.copy(xt).applyQuaternion(t).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Z"&&(Se.setFromEuler(di.set(0,Math.PI/2,0)),n.quaternion.copy(t).multiply(Se),Math.abs(Ce.copy(bs).applyQuaternion(t).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="XYZE"&&(Se.setFromEuler(di.set(0,Math.PI/2,0)),Ce.copy(this.rotationAxis),n.quaternion.setFromRotationMatrix(Zr.lookAt(jr,Ce,xt)),n.quaternion.multiply(Se),n.visible=this.dragging),this.axis==="E"&&(n.visible=!1)):n.name==="START"?(n.position.copy(this.worldPositionStart),n.visible=this.dragging):n.name==="END"?(n.position.copy(this.worldPosition),n.visible=this.dragging):n.name==="DELTA"?(n.position.copy(this.worldPositionStart),n.quaternion.copy(this.worldQuaternionStart),be.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),be.applyQuaternion(this.worldQuaternionStart.clone().invert()),n.scale.copy(be),n.visible=this.dragging):(n.quaternion.copy(t),this.dragging?n.position.copy(this.worldPositionStart):n.position.copy(this.worldPosition),this.axis&&(n.visible=this.axis.search(n.name)!==-1));continue}n.quaternion.copy(t),this.mode==="translate"||this.mode==="scale"?(n.name==="X"&&Math.abs(Ce.copy(Ds).applyQuaternion(t).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Y"&&Math.abs(Ce.copy(xt).applyQuaternion(t).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Z"&&Math.abs(Ce.copy(bs).applyQuaternion(t).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XY"&&Math.abs(Ce.copy(bs).applyQuaternion(t).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="YZ"&&Math.abs(Ce.copy(Ds).applyQuaternion(t).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XZ"&&Math.abs(Ce.copy(xt).applyQuaternion(t).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1)):this.mode==="rotate"&&(Ii.copy(t),Ce.copy(this.eye).applyQuaternion(Se.copy(t).invert()),n.name.search("E")!==-1&&n.quaternion.setFromRotationMatrix(Zr.lookAt(this.eye,jr,xt)),n.name==="X"&&(Se.setFromAxisAngle(Ds,Math.atan2(-Ce.y,Ce.z)),Se.multiplyQuaternions(Ii,Se),n.quaternion.copy(Se)),n.name==="Y"&&(Se.setFromAxisAngle(xt,Math.atan2(Ce.x,Ce.z)),Se.multiplyQuaternions(Ii,Se),n.quaternion.copy(Se)),n.name==="Z"&&(Se.setFromAxisAngle(bs,Math.atan2(Ce.y,Ce.x)),Se.multiplyQuaternions(Ii,Se),n.quaternion.copy(Se))),n.visible=n.visible&&(n.name.indexOf("X")===-1||this.showX),n.visible=n.visible&&(n.name.indexOf("Y")===-1||this.showY),n.visible=n.visible&&(n.name.indexOf("Z")===-1||this.showZ),n.visible=n.visible&&(n.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),n.material._color=n.material._color||n.material.color.clone(),n.material._opacity=n.material._opacity||n.material.opacity,n.material.color.copy(n.material._color),n.material.opacity=n.material._opacity,this.enabled&&this.axis&&(n.name===this.axis||this.axis.split("").some(function(o){return n.name===o}))&&(n.material.color.setHex(16776960),n.material.opacity=1)}super.updateMatrixWorld(e)}}class eh extends se{constructor(){super(new _i(1e5,1e5,2,2),new us({visible:!1,wireframe:!0,side:Gs,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(t="local"),Ei.copy(Ds).applyQuaternion(t==="local"?this.worldQuaternion:gi),_s.copy(xt).applyQuaternion(t==="local"?this.worldQuaternion:gi),ws.copy(bs).applyQuaternion(t==="local"?this.worldQuaternion:gi),Ce.copy(_s),this.mode){case"translate":case"scale":switch(this.axis){case"X":Ce.copy(this.eye).cross(Ei),ct.copy(Ei).cross(Ce);break;case"Y":Ce.copy(this.eye).cross(_s),ct.copy(_s).cross(Ce);break;case"Z":Ce.copy(this.eye).cross(ws),ct.copy(ws).cross(Ce);break;case"XY":ct.copy(ws);break;case"YZ":ct.copy(Ei);break;case"XZ":Ce.copy(ws),ct.copy(_s);break;case"XYZ":case"E":ct.set(0,0,0);break}break;case"rotate":default:ct.set(0,0,0)}ct.length()===0?this.quaternion.copy(this.cameraQuaternion):($r.lookAt(be.set(0,0,0),ct,Ce),this.quaternion.setFromRotationMatrix($r)),super.updateMatrixWorld(e)}}class er{constructor(e,t,s,i,n,r=5,o=!0){if(p(this,"onDraggingStarted",new $),p(this,"onDraggingEnded",new $),p(this,"onDisposed",new $),p(this,"normal"),p(this,"origin"),p(this,"three",new Is),p(this,"components"),p(this,"world"),p(this,"type","default"),p(this,"_helper"),p(this,"_visible",!0),p(this,"_enabled",!0),p(this,"_controlsActive",!1),p(this,"_arrowBoundBox",new se),p(this,"_planeMesh"),p(this,"_controls"),p(this,"_hiddenMaterial",new us({visible:!1})),p(this,"update",()=>{this._enabled&&this.three.setFromNormalAndCoplanarPoint(this.normal,this._helper.position)}),p(this,"changeDrag",a=>{this._visible=!a.value,this.preventCameraMovement(),this.notifyDraggingChanged(a)}),this.components=e,this.world=t,!t.renderer)throw new Error("The given world must have a renderer!");this.normal=i,this.origin=s,t.renderer.setPlane(!0,this.three),this._planeMesh=er.newPlaneMesh(r,n),this._helper=this.newHelper(),this._controls=this.newTransformControls(),this.three.setFromNormalAndCoplanarPoint(i,s),o&&this.toggleControls(!0)}get enabled(){return this._enabled}set enabled(e){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");this._enabled=e,this.world.renderer.setPlane(e,this.three)}get visible(){return this._visible}set visible(e){this._visible=e,this._controls.visible=e,this._helper.visible=e,this.toggleControls(e)}get meshes(){return[this._planeMesh,this._arrowBoundBox]}get planeMaterial(){return this._planeMesh.material}set planeMaterial(e){this._planeMesh.material=e}get size(){return this._planeMesh.scale.x}set size(e){this._planeMesh.scale.set(e,e,e)}get helper(){return this._helper}setFromNormalAndCoplanarPoint(e,t){this.reset(),this.normal.equals(e)||(this.normal.copy(e),this._helper.lookAt(e)),this.origin.copy(t),this._helper.position.copy(t),this._helper.updateMatrix(),this.update()}dispose(){this._enabled=!1,this.onDraggingStarted.reset(),this.onDraggingEnded.reset(),this._helper.removeFromParent(),this.world.renderer&&this.world.renderer.setPlane(!1,this.three),this._arrowBoundBox.removeFromParent(),this._arrowBoundBox.geometry.dispose(),this._planeMesh.geometry.dispose(),this._controls.removeFromParent(),this._controls.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}reset(){const e=new x(1,0,0),t=new x;this.normal.equals(e)||(this.normal.copy(e),this._helper.lookAt(e)),this.origin.copy(t),this._helper.position.copy(t),this._helper.updateMatrix()}toggleControls(e){if(e){if(this._controlsActive)return;this._controls.addEventListener("change",this.update),this._controls.addEventListener("dragging-changed",this.changeDrag)}else this._controls.removeEventListener("change",this.update),this._controls.removeEventListener("dragging-changed",this.changeDrag);this._controlsActive=e}newTransformControls(){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");const e=this.world.camera.three,t=this.world.renderer.three.domElement,s=new jc(e,t);return this.initializeControls(s),this.world.scene.three.add(s),s}initializeControls(e){e.attach(this._helper),e.showX=!1,e.showY=!1,e.setSpace("local"),this.createArrowBoundingBox(),e.children[0].children[0].add(this._arrowBoundBox)}createArrowBoundingBox(){this._arrowBoundBox.geometry=new xe(.18,.18,1.2),this._arrowBoundBox.material=this._hiddenMaterial,this._arrowBoundBox.rotateX(Math.PI/2),this._arrowBoundBox.updateMatrix(),this._arrowBoundBox.geometry.applyMatrix4(this._arrowBoundBox.matrix)}notifyDraggingChanged(e){e.value?this.onDraggingStarted.trigger():this.onDraggingEnded.trigger()}preventCameraMovement(){this.world.camera.enabled=this._visible}newHelper(){const e=new Oi;return e.lookAt(this.normal),e.position.copy(this.origin),this._planeMesh.position.z+=.01,e.add(this._planeMesh),this.world.scene.three.add(e),e}static newPlaneMesh(e,t){const s=new _i(1),i=new se(s,t);return i.scale.set(e,e,e),i}}class th extends kt{constructor(){super(...arguments),p(this,"_config",{enabled:{value:!0,type:"Boolean"},visible:{value:!0,type:"Boolean"},color:{value:new ve,type:"Color"},opacity:{type:"Number",interpolable:!0,value:1,min:0,max:1},size:{type:"Number",interpolable:!0,value:2,min:0,max:100}})}get enabled(){return this._config.enabled.value}set enabled(e){this._config.enabled.value=e,this._component.enabled=e}get visible(){return this._config.visible.value}set visible(e){this._config.visible.value=e,this._component.visible=e}get color(){return this._config.color.value}set color(e){this._config.color.value=e,this._component.material.color.copy(e)}get opacity(){return this._config.opacity.value}set opacity(e){this._config.opacity.value=e,this._component.material.opacity=e}get size(){return this._config.size.value}set size(e){this._config.size.value=e,this._component.size=e}}const bo=class Rn extends Ae{constructor(e){super(e),p(this,"onSetup",new $),p(this,"onBeforeDrag",new $),p(this,"onAfterDrag",new $),p(this,"onBeforeCreate",new $),p(this,"onBeforeCancel",new $),p(this,"onAfterCancel",new $),p(this,"onBeforeDelete",new $),p(this,"onAfterCreate",new $),p(this,"onAfterDelete",new $),p(this,"onDisposed",new $),p(this,"isSetup",!1),p(this,"orthogonalY",!1),p(this,"toleranceOrthogonalY",.7),p(this,"Type",er),p(this,"list",[]),p(this,"config",new th(this,this.components,"Clipper")),p(this,"_defaultConfig",{color:new ve(12255487),opacity:.2,size:2}),p(this,"_material",new us({color:12255487,side:Gs,transparent:!0,opacity:.2})),p(this,"_size",5),p(this,"_enabled",!1),p(this,"_visible",!0),p(this,"_onStartDragging",()=>{this.onBeforeDrag.trigger()}),p(this,"_onEndDragging",()=>{this.onAfterDrag.trigger()}),this.components.add(Rn.uuid,this),e.get(ut).list.add(this.config)}get enabled(){return this._enabled}set enabled(e){this._enabled=e;for(const t of this.list)t.enabled=e;this.updateMaterialsAndPlanes()}get visible(){return this._visible}set visible(e){this._visible=e;for(const t of this.list)t.visible=e}get material(){return this._material}set material(e){this._material=e;for(const t of this.list)t.planeMaterial=e}get size(){return this._size}set size(e){this._size=e;for(const t of this.list)t.size=e}dispose(){this._enabled=!1,this.components.get(ut).list.delete(this.config);for(const e of this.list)e.dispose();this.list.length=0,this._material.dispose(),this.onBeforeCreate.reset(),this.onBeforeCancel.reset(),this.onBeforeDelete.reset(),this.onBeforeDrag.reset(),this.onAfterCreate.reset(),this.onAfterCancel.reset(),this.onAfterDelete.reset(),this.onAfterDrag.reset(),this.onDisposed.trigger(Rn.uuid),this.onDisposed.reset()}create(e){const t=this.components.get(mn).get(e).castRay();return t?this.createPlaneFromIntersection(e,t):null}createFromNormalAndCoplanarPoint(e,t,s){const i=this.newPlane(e,s,t);return this.updateMaterialsAndPlanes(),i}delete(e,t){t||(t=this.pickPlane(e)),t&&this.deletePlane(t)}deleteAll(e){const t=[...this.list];for(const s of t)if(!e||e.has(s.type)){this.delete(s.world,s);const i=this.list.indexOf(s);i!==-1&&this.list.splice(i,1)}}setup(e){const t={...this._defaultConfig,...e};this.config.color=t.color,this.config.opacity=t.opacity,this.config.size=t.size,this.isSetup=!0,this.onSetup.trigger()}deletePlane(e){const t=this.list.indexOf(e);if(t!==-1){if(this.list.splice(t,1),!e.world.renderer)throw new Error("Renderer not found for this plane's world!");e.world.renderer.setPlane(!1,e.three),e.dispose(),this.updateMaterialsAndPlanes(),this.onAfterDelete.trigger(e)}}pickPlane(e){const t=this.components.get(mn).get(e),s=this.getAllPlaneMeshes(),i=t.castRay(s);if(i){const n=i.object;return this.list.find(r=>r.meshes.includes(n))}}getAllPlaneMeshes(){const e=[];for(const t of this.list)e.push(...t.meshes);return e}createPlaneFromIntersection(e,t){var s;if(!e.renderer)throw new Error("The given world must have a renderer!");const i=t.point.distanceTo(new x(0,0,0)),n=(s=t.face)==null?void 0:s.normal;if(!i||!n)return null;const r=this.getWorldNormal(t,n),o=this.newPlane(e,t.point,r.negate());return o.visible=this._visible,o.size=this._size,e.renderer.setPlane(!0,o.three),this.updateMaterialsAndPlanes(),o}getWorldNormal(e,t){const s=e.object;let i=e.object.matrixWorld.clone();if(s instanceof Vt&&e.instanceId!==void 0){const o=new Ee;s.getMatrixAt(e.instanceId,o),i=o.multiply(i)}const n=new Bt().getNormalMatrix(i),r=t.clone().applyMatrix3(n).normalize();return this.normalizePlaneDirectionY(r),r}normalizePlaneDirectionY(e){this.orthogonalY&&(e.y>this.toleranceOrthogonalY&&(e.x=0,e.y=1,e.z=0),e.y<-this.toleranceOrthogonalY&&(e.x=0,e.y=-1,e.z=0))}newPlane(e,t,s){const i=new this.Type(this.components,e,t,s,this._material);return i.onDraggingStarted.add(this._onStartDragging),i.onDraggingEnded.add(this._onEndDragging),this.list.push(i),this.onAfterCreate.trigger(i),i}updateMaterialsAndPlanes(){const e=this.components.get(bc);for(const[t,s]of e.list){if(!s.renderer)continue;s.renderer.updateClippingPlanes();const{clippingPlanes:i}=s.renderer;for(const n of s.meshes)if(n.material)if(Array.isArray(n.material))for(const r of n.material)r.clippingPlanes=i;else n.material.clippingPlanes=i}}};p(bo,"uuid","66290bc5-18c4-4cd1-9379-2e17a0617611");let sh=bo;class ih{constructor(e){p(this,"enabled",!1),p(this,"id","FirstPerson"),this.camera=e}set(e){if(this.enabled=e,e){if(this.camera.projection.current!=="Perspective"){this.camera.set("Orbit");return}this.setupFirstPersonCamera()}}setupFirstPersonCamera(){const e=this.camera.controls,t=new x;e.distance--,e.getPosition(t),e.minDistance=1,e.maxDistance=1,e.distance=1,e.moveTo(t.x,t.y,t.z),e.truckSpeed=50,e.mouseButtons.wheel=Ue.ACTION.DOLLY,e.touches.two=Ue.ACTION.TOUCH_ZOOM_TRUCK}}class nh{constructor(e){p(this,"enabled",!0),p(this,"id","Orbit"),this.camera=e,this.activateOrbitControls()}set(e){this.enabled=e,e&&this.activateOrbitControls()}activateOrbitControls(){const e=this.camera.controls;e.minDistance=1,e.maxDistance=300;const t=new x;e.getPosition(t);const s=t.length();e.distance=s,e.truckSpeed=2;const{rotation:i}=this.camera.three,n=new x(0,0,-1).applyEuler(i),r=t.addScaledVector(n,s);e.moveTo(r.x,r.y,r.z)}}class rh{constructor(e){p(this,"enabled",!1),p(this,"id","Plan"),p(this,"mouseAction1"),p(this,"mouseAction2"),p(this,"mouseInitialized",!1),p(this,"defaultAzimuthSpeed"),p(this,"defaultPolarSpeed"),this.camera=e,this.defaultAzimuthSpeed=e.controls.azimuthRotateSpeed,this.defaultPolarSpeed=e.controls.polarRotateSpeed}set(e){this.enabled=e;const t=this.camera.controls;t.azimuthRotateSpeed=e?0:this.defaultAzimuthSpeed,t.polarRotateSpeed=e?0:this.defaultPolarSpeed,this.mouseInitialized||(this.mouseAction1=t.touches.one,this.mouseAction2=t.touches.two,this.mouseInitialized=!0),e?(t.mouseButtons.left=Ue.ACTION.TRUCK,t.touches.one=Ue.ACTION.TOUCH_TRUCK,t.touches.two=Ue.ACTION.TOUCH_ZOOM):(t.mouseButtons.left=Ue.ACTION.ROTATE,t.touches.one=this.mouseAction1,t.touches.two=this.mouseAction2)}}class oh{constructor(e){p(this,"onChanged",new $),p(this,"current","Perspective"),p(this,"camera"),p(this,"matchOrthoDistanceEnabled",!1),p(this,"_component"),p(this,"_previousDistance",-1),this._component=e,this.camera=e.three}async set(e){this.current!==e&&(e==="Orthographic"?this.setOrthoCamera():await this.setPerspectiveCamera(),this.onChanged.trigger(this.camera))}async toggle(){const e=this.current==="Perspective"?"Orthographic":"Perspective";await this.set(e)}setOrthoCamera(){if(this._component.mode===null||this._component.mode.id==="FirstPerson")return;this._previousDistance=this._component.controls.distance,this._component.controls.distance=200;const e=this.getPerspectiveDims();if(!e)return;const{width:t,height:s}=e;this.setupOrthoCamera(s,t),this.camera=this._component.threeOrtho,this.current="Orthographic"}getPerspectiveDims(){const e=this._component.currentWorld;if(!e||!e.renderer)return null;const t=new x;this._component.threePersp.getWorldDirection(t);const s=new x;this._component.controls.getTarget(s);const i=s.clone().sub(this._component.threePersp.position).dot(t),n=e.renderer.getSize(),r=n.x/n.y,o=this._component.threePersp,a=i*2*Math.atan(o.fov*(Math.PI/180)/2);return{width:a*r,height:a}}setupOrthoCamera(e,t){this._component.controls.mouseButtons.wheel=Ue.ACTION.ZOOM,this._component.controls.mouseButtons.middle=Ue.ACTION.ZOOM;const s=this._component.threePersp,i=this._component.threeOrtho;i.zoom=1,i.left=t/-2,i.right=t/2,i.top=e/2,i.bottom=e/-2,i.updateProjectionMatrix(),i.position.copy(s.position),i.quaternion.copy(s.quaternion),this._component.controls.camera=i}getDistance(){const e=this._component.threePersp,t=this._component.threeOrtho;return(t.top-t.bottom)/t.zoom/(2*Math.atan(e.fov*(Math.PI/180)/2))}async setPerspectiveCamera(){this._component.controls.mouseButtons.wheel=Ue.ACTION.DOLLY,this._component.controls.mouseButtons.middle=Ue.ACTION.DOLLY;const e=this._component.threePersp,t=this._component.threeOrtho;e.position.copy(t.position),e.quaternion.copy(t.quaternion),this._component.controls.mouseButtons.wheel=Ue.ACTION.DOLLY,this.matchOrthoDistanceEnabled?this._component.controls.distance=this.getDistance():this._component.controls.distance=this._previousDistance,await this._component.controls.zoomTo(1),e.updateProjectionMatrix(),this._component.controls.camera=e,this.camera=e,this.current="Perspective"}}class ah extends Vs{constructor(e){super(e),p(this,"projection"),p(this,"threeOrtho"),p(this,"threePersp"),p(this,"_userInputButtons",{}),p(this,"_frustumSize",50),p(this,"_navigationModes",new Map),p(this,"_mode",null),p(this,"previousSize",null),this.threePersp=this.three,this.threeOrtho=this.newOrthoCamera(),this.projection=new oh(this),this.onAspectUpdated.add(()=>{this.setOrthoPerspCameraAspect()}),this.projection.onChanged.add(t=>{this.three=t,this.updateAspect()}),this.onWorldChanged.add(({action:t})=>{t==="added"&&(this._navigationModes.clear(),this._navigationModes.set("Orbit",new nh(this)),this._navigationModes.set("FirstPerson",new ih(this)),this._navigationModes.set("Plan",new rh(this)),this._mode=this._navigationModes.get("Orbit"),this.mode.set(!0,{preventTargetAdjustment:!0}),this.currentWorld&&this.currentWorld.renderer&&(this.previousSize=this.currentWorld.renderer.getSize().clone()))})}get mode(){if(!this._mode)throw new Error("Mode not found, camera not initialized");return this._mode}dispose(){super.dispose(),this.threeOrtho.removeFromParent()}set(e){if(this.mode!==null&&this.mode.id!==e){if(this.mode.set(!1),!this._navigationModes.has(e))throw new Error("The specified mode does not exist!");this._mode=this._navigationModes.get(e),this.mode.set(!0)}}async fit(e,t=1.5){if(!this.enabled)return;const s=Number.MAX_VALUE,i=Number.MIN_VALUE,n=new x(s,s,s),r=new x(i,i,i);for(const I of e){const u=new we().setFromObject(I);u.min.xr.x&&(r.x=u.max.x),u.max.y>r.y&&(r.y=u.max.y),u.max.z>r.z&&(r.z=u.max.z)}const o=new we(n,r),a=new x;o.getSize(a);const c=new x;o.getCenter(c);const h=Math.max(a.x,a.y,a.z)*t,d=new Li(c,h);await this.controls.fitToSphere(d,!0)}setUserInput(e){e?this.enableUserInput():this.disableUserInput()}disableUserInput(){this._userInputButtons.left=this.controls.mouseButtons.left,this._userInputButtons.right=this.controls.mouseButtons.right,this._userInputButtons.middle=this.controls.mouseButtons.middle,this._userInputButtons.wheel=this.controls.mouseButtons.wheel,this.controls.mouseButtons.left=0,this.controls.mouseButtons.right=0,this.controls.mouseButtons.middle=0,this.controls.mouseButtons.wheel=0}enableUserInput(){Object.keys(this._userInputButtons).length!==0&&(this.controls.mouseButtons.left=this._userInputButtons.left,this.controls.mouseButtons.right=this._userInputButtons.right,this.controls.mouseButtons.middle=this._userInputButtons.middle,this.controls.mouseButtons.wheel=this._userInputButtons.wheel)}newOrthoCamera(){const e=window.innerWidth/window.innerHeight;return new Gt(this._frustumSize*e/-2,this._frustumSize*e/2,this._frustumSize/2,this._frustumSize/-2,.1,1e3)}setOrthoPerspCameraAspect(){if(!this.currentWorld||!this.currentWorld.renderer||!this.previousSize)return;const e=this.currentWorld.renderer.getSize(),t=this.threeOrtho.top,s=this.threeOrtho.right,i=e.y/this.previousSize.y,n=e.x/this.previousSize.x,r=t*i,o=s*n;this.threeOrtho.left=-o,this.threeOrtho.right=o,this.threeOrtho.top=r,this.threeOrtho.bottom=-r,this.threeOrtho.updateProjectionMatrix(),this.previousSize.copy(e)}}const qr=new Map([[wi,{forRelated:"Decomposes",forRelating:"IsDecomposedBy"}],[Mn,{forRelated:"HasAssociations",forRelating:"AssociatedTo"}],[Dn,{forRelated:"HasAssociations",forRelating:"ClassificationForObjects"}],[bn,{forRelated:"HasAssignments",forRelating:"IsGroupedBy"}],[zs,{forRelated:"IsDefinedBy",forRelating:"DefinesOcurrence"}],[Un,{forRelated:"IsTypedBy",forRelating:"Types"}],[xn,{forRelated:"IsDefinedBy",forRelating:"Defines"}],[vi,{forRelated:"ContainedInStructure",forRelating:"ContainsElements"}],[Bn,{forRelated:"AssignedToFlowElement",forRelating:"HasControlElements"}],[Yn,{forRelated:"ConnectedFrom",forRelating:"ConnectedTo"}],[Vn,{forRelated:"HasAssignments",forRelating:"ReferencedBy"}],[Gn,{forRelated:"HasContext",forRelating:"Declares"}],[zn,{forRelated:"HasAssignments",forRelating:"Controls"}],[kn,{forRelated:"Nests",forRelating:"IsNestedBy"}],[Hn,{forRelated:"HasAssociations",forRelating:"DocumentRefForObjects"}]]),yi={950732822:"IFCURIREFERENCE",4075327185:"IFCTIME",1209108979:"IFCTEMPERATURERATEOFCHANGEMEASURE",3457685358:"IFCSOUNDPRESSURELEVELMEASURE",4157543285:"IFCSOUNDPOWERLEVELMEASURE",2798247006:"IFCPROPERTYSETDEFINITIONSET",1790229001:"IFCPOSITIVEINTEGER",525895558:"IFCNONNEGATIVELENGTHMEASURE",1774176899:"IFCLINEINDEX",1275358634:"IFCLANGUAGEID",2541165894:"IFCDURATION",3701338814:"IFCDAYINWEEKNUMBER",2195413836:"IFCDATETIME",937566702:"IFCDATE",1683019596:"IFCCARDINALPOINTREFERENCE",2314439260:"IFCBINARY",1500781891:"IFCAREADENSITYMEASURE",3683503648:"IFCARCINDEX",4065007721:"IFCYEARNUMBER",1718600412:"IFCWARPINGMOMENTMEASURE",51269191:"IFCWARPINGCONSTANTMEASURE",2593997549:"IFCVOLUMETRICFLOWRATEMEASURE",3458127941:"IFCVOLUMEMEASURE",3345633955:"IFCVAPORPERMEABILITYMEASURE",1278329552:"IFCTORQUEMEASURE",2591213694:"IFCTIMESTAMP",2726807636:"IFCTIMEMEASURE",743184107:"IFCTHERMODYNAMICTEMPERATUREMEASURE",2016195849:"IFCTHERMALTRANSMITTANCEMEASURE",857959152:"IFCTHERMALRESISTANCEMEASURE",2281867870:"IFCTHERMALEXPANSIONCOEFFICIENTMEASURE",2645777649:"IFCTHERMALCONDUCTIVITYMEASURE",232962298:"IFCTHERMALADMITTANCEMEASURE",296282323:"IFCTEXTTRANSFORMATION",603696268:"IFCTEXTFONTNAME",3490877962:"IFCTEXTDECORATION",1460886941:"IFCTEXTALIGNMENT",2801250643:"IFCTEXT",58845555:"IFCTEMPERATUREGRADIENTMEASURE",361837227:"IFCSPECULARROUGHNESS",2757832317:"IFCSPECULAREXPONENT",3477203348:"IFCSPECIFICHEATCAPACITYMEASURE",993287707:"IFCSOUNDPRESSUREMEASURE",846465480:"IFCSOUNDPOWERMEASURE",3471399674:"IFCSOLIDANGLEMEASURE",408310005:"IFCSHEARMODULUSMEASURE",2190458107:"IFCSECTIONALAREAINTEGRALMEASURE",3467162246:"IFCSECTIONMODULUSMEASURE",2766185779:"IFCSECONDINMINUTE",3211557302:"IFCROTATIONALSTIFFNESSMEASURE",1755127002:"IFCROTATIONALMASSMEASURE",2133746277:"IFCROTATIONALFREQUENCYMEASURE",200335297:"IFCREAL",96294661:"IFCRATIOMEASURE",3972513137:"IFCRADIOACTIVITYMEASURE",3665567075:"IFCPRESSUREMEASURE",2169031380:"IFCPRESENTABLETEXT",1364037233:"IFCPOWERMEASURE",1245737093:"IFCPOSITIVERATIOMEASURE",3054510233:"IFCPOSITIVEPLANEANGLEMEASURE",2815919920:"IFCPOSITIVELENGTHMEASURE",4042175685:"IFCPLANEANGLEMEASURE",2642773653:"IFCPLANARFORCEMEASURE",2260317790:"IFCPARAMETERVALUE",929793134:"IFCPHMEASURE",2395907400:"IFCNUMERICMEASURE",2095195183:"IFCNORMALISEDRATIOMEASURE",765770214:"IFCMONTHINYEARNUMBER",2615040989:"IFCMONETARYMEASURE",3114022597:"IFCMOMENTOFINERTIAMEASURE",1648970520:"IFCMOLECULARWEIGHTMEASURE",3177669450:"IFCMOISTUREDIFFUSIVITYMEASURE",1753493141:"IFCMODULUSOFSUBGRADEREACTIONMEASURE",1052454078:"IFCMODULUSOFROTATIONALSUBGRADEREACTIONMEASURE",2173214787:"IFCMODULUSOFLINEARSUBGRADEREACTIONMEASURE",3341486342:"IFCMODULUSOFELASTICITYMEASURE",102610177:"IFCMINUTEINHOUR",3531705166:"IFCMASSPERLENGTHMEASURE",3124614049:"IFCMASSMEASURE",4017473158:"IFCMASSFLOWRATEMEASURE",1477762836:"IFCMASSDENSITYMEASURE",2486716878:"IFCMAGNETICFLUXMEASURE",286949696:"IFCMAGNETICFLUXDENSITYMEASURE",151039812:"IFCLUMINOUSINTENSITYMEASURE",2755797622:"IFCLUMINOUSINTENSITYDISTRIBUTIONMEASURE",2095003142:"IFCLUMINOUSFLUXMEASURE",503418787:"IFCLOGICAL",3086160713:"IFCLINEARVELOCITYMEASURE",1307019551:"IFCLINEARSTIFFNESSMEASURE",2128979029:"IFCLINEARMOMENTMEASURE",191860431:"IFCLINEARFORCEMEASURE",1243674935:"IFCLENGTHMEASURE",3258342251:"IFCLABEL",2054016361:"IFCKINEMATICVISCOSITYMEASURE",3192672207:"IFCISOTHERMALMOISTURECAPACITYMEASURE",3686016028:"IFCIONCONCENTRATIONMEASURE",3809634241:"IFCINTEGERCOUNTRATEMEASURE",1939436016:"IFCINTEGER",2679005408:"IFCINDUCTANCEMEASURE",3358199106:"IFCILLUMINANCEMEASURE",983778844:"IFCIDENTIFIER",2589826445:"IFCHOURINDAY",1158859006:"IFCHEATINGVALUEMEASURE",3113092358:"IFCHEATFLUXDENSITYMEASURE",3064340077:"IFCGLOBALLYUNIQUEID",3044325142:"IFCFREQUENCYMEASURE",1361398929:"IFCFORCEMEASURE",2590844177:"IFCFONTWEIGHT",2715512545:"IFCFONTVARIANT",1102727119:"IFCFONTSTYLE",2078135608:"IFCENERGYMEASURE",2506197118:"IFCELECTRICVOLTAGEMEASURE",2951915441:"IFCELECTRICRESISTANCEMEASURE",3790457270:"IFCELECTRICCURRENTMEASURE",2093906313:"IFCELECTRICCONDUCTANCEMEASURE",3818826038:"IFCELECTRICCHARGEMEASURE",1827137117:"IFCELECTRICCAPACITANCEMEASURE",69416015:"IFCDYNAMICVISCOSITYMEASURE",524656162:"IFCDOSEEQUIVALENTMEASURE",4134073009:"IFCDIMENSIONCOUNT",1514641115:"IFCDESCRIPTIVEMEASURE",300323983:"IFCDAYLIGHTSAVINGHOUR",86635668:"IFCDAYINMONTHNUMBER",94842927:"IFCCURVATUREMEASURE",1778710042:"IFCCOUNTMEASURE",3238673880:"IFCCONTEXTDEPENDENTMEASURE",3812528620:"IFCCOMPOUNDPLANEANGLEMEASURE",2991860651:"IFCCOMPLEXNUMBER",1867003952:"IFCBOXALIGNMENT",2735952531:"IFCBOOLEAN",2650437152:"IFCAREAMEASURE",632304761:"IFCANGULARVELOCITYMEASURE",360377573:"IFCAMOUNTOFSUBSTANCEMEASURE",4182062534:"IFCACCELERATIONMEASURE",3699917729:"IFCABSORBEDDOSEMEASURE",1971632696:"IFCGEOSLICE",2680139844:"IFCGEOMODEL",24726584:"IFCELECTRICFLOWTREATMENTDEVICE",3693000487:"IFCDISTRIBUTIONBOARD",3460952963:"IFCCONVEYORSEGMENT",3999819293:"IFCCAISSONFOUNDATION",3314249567:"IFCBOREHOLE",4196446775:"IFCBEARING",325726236:"IFCALIGNMENT",3425753595:"IFCTRACKELEMENT",991950508:"IFCSIGNAL",3798194928:"IFCREINFORCEDSOIL",3290496277:"IFCRAIL",1383356374:"IFCPAVEMENT",2182337498:"IFCNAVIGATIONELEMENT",234836483:"IFCMOORINGDEVICE",2078563270:"IFCMOBILETELECOMMUNICATIONSAPPLIANCE",1638804497:"IFCLIQUIDTERMINAL",1154579445:"IFCLINEARPOSITIONINGELEMENT",2696325953:"IFCKERB",2713699986:"IFCGEOTECHNICALASSEMBLY",2142170206:"IFCELECTRICFLOWTREATMENTDEVICETYPE",3376911765:"IFCEARTHWORKSFILL",1077100507:"IFCEARTHWORKSELEMENT",3071239417:"IFCEARTHWORKSCUT",479945903:"IFCDISTRIBUTIONBOARDTYPE",3426335179:"IFCDEEPFOUNDATION",1502416096:"IFCCOURSE",2940368186:"IFCCONVEYORSEGMENTTYPE",3203706013:"IFCCAISSONFOUNDATIONTYPE",3862327254:"IFCBUILTSYSTEM",1876633798:"IFCBUILTELEMENT",963979645:"IFCBRIDGEPART",644574406:"IFCBRIDGE",3649138523:"IFCBEARINGTYPE",1662888072:"IFCALIGNMENTVERTICAL",317615605:"IFCALIGNMENTSEGMENT",1545765605:"IFCALIGNMENTHORIZONTAL",4266260250:"IFCALIGNMENTCANT",3956297820:"IFCVIBRATIONDAMPERTYPE",1530820697:"IFCVIBRATIONDAMPER",840318589:"IFCVEHICLE",1953115116:"IFCTRANSPORTATIONDEVICE",618700268:"IFCTRACKELEMENTTYPE",2281632017:"IFCTENDONCONDUITTYPE",3663046924:"IFCTENDONCONDUIT",42703149:"IFCSINESPIRAL",1894708472:"IFCSIGNALTYPE",3599934289:"IFCSIGNTYPE",33720170:"IFCSIGN",1027922057:"IFCSEVENTHORDERPOLYNOMIALSPIRAL",544395925:"IFCSEGMENTEDREFERENCECURVE",3649235739:"IFCSECONDORDERPOLYNOMIALSPIRAL",550521510:"IFCROADPART",146592293:"IFCROAD",3818125796:"IFCRELADHERESTOELEMENT",4021432810:"IFCREFERENT",1891881377:"IFCRAILWAYPART",3992365140:"IFCRAILWAY",1763565496:"IFCRAILTYPE",1946335990:"IFCPOSITIONINGELEMENT",514975943:"IFCPAVEMENTTYPE",506776471:"IFCNAVIGATIONELEMENTTYPE",710110818:"IFCMOORINGDEVICETYPE",1950438474:"IFCMOBILETELECOMMUNICATIONSAPPLIANCETYPE",976884017:"IFCMARINEPART",525669439:"IFCMARINEFACILITY",1770583370:"IFCLIQUIDTERMINALTYPE",2176059722:"IFCLINEARELEMENT",679976338:"IFCKERBTYPE",3948183225:"IFCIMPACTPROTECTIONDEVICETYPE",2568555532:"IFCIMPACTPROTECTIONDEVICE",2898700619:"IFCGRADIENTCURVE",1594536857:"IFCGEOTECHNICALSTRATUM",4230923436:"IFCGEOTECHNICALELEMENT",4228831410:"IFCFACILITYPARTCOMMON",1310830890:"IFCFACILITYPART",24185140:"IFCFACILITY",4234616927:"IFCDIRECTRIXDERIVEDREFERENCESWEPTAREASOLID",1306400036:"IFCDEEPFOUNDATIONTYPE",4189326743:"IFCCOURSETYPE",2000195564:"IFCCOSINESPIRAL",3497074424:"IFCCLOTHOID",1626504194:"IFCBUILTELEMENTTYPE",3651464721:"IFCVEHICLETYPE",1229763772:"IFCTRIANGULATEDIRREGULARNETWORK",3665877780:"IFCTRANSPORTATIONDEVICETYPE",782932809:"IFCTHIRDORDERPOLYNOMIALSPIRAL",2735484536:"IFCSPIRAL",1356537516:"IFCSECTIONEDSURFACE",1290935644:"IFCSECTIONEDSOLIDHORIZONTAL",1862484736:"IFCSECTIONEDSOLID",1441486842:"IFCRELPOSITIONS",1033248425:"IFCRELASSOCIATESPROFILEDEF",3381221214:"IFCPOLYNOMIALCURVE",2485787929:"IFCOFFSETCURVEBYDISTANCES",590820931:"IFCOFFSETCURVE",3465909080:"IFCINDEXEDPOLYGONALTEXTUREMAP",593015953:"IFCDIRECTRIXCURVESWEPTAREASOLID",4212018352:"IFCCURVESEGMENT",3425423356:"IFCAXIS2PLACEMENTLINEAR",823603102:"IFCSEGMENT",2165702409:"IFCPOINTBYDISTANCEEXPRESSION",182550632:"IFCOPENCROSSPROFILEDEF",388784114:"IFCLINEARPLACEMENT",536804194:"IFCALIGNMENTHORIZONTALSEGMENT",3752311538:"IFCALIGNMENTCANTSEGMENT",1010789467:"IFCTEXTURECOORDINATEINDICESWITHVOIDS",222769930:"IFCTEXTURECOORDINATEINDICES",2691318326:"IFCQUANTITYNUMBER",3633395639:"IFCALIGNMENTVERTICALSEGMENT",2879124712:"IFCALIGNMENTPARAMETERSEGMENT",25142252:"IFCCONTROLLER",3087945054:"IFCALARM",4288193352:"IFCACTUATOR",630975310:"IFCUNITARYCONTROLELEMENT",4086658281:"IFCSENSOR",2295281155:"IFCPROTECTIVEDEVICETRIPPINGUNIT",182646315:"IFCFLOWINSTRUMENT",1426591983:"IFCFIRESUPPRESSIONTERMINAL",819412036:"IFCFILTER",3415622556:"IFCFAN",1003880860:"IFCELECTRICTIMECONTROL",402227799:"IFCELECTRICMOTOR",264262732:"IFCELECTRICGENERATOR",3310460725:"IFCELECTRICFLOWSTORAGEDEVICE",862014818:"IFCELECTRICDISTRIBUTIONBOARD",1904799276:"IFCELECTRICAPPLIANCE",1360408905:"IFCDUCTSILENCER",3518393246:"IFCDUCTSEGMENT",342316401:"IFCDUCTFITTING",562808652:"IFCDISTRIBUTIONCIRCUIT",4074379575:"IFCDAMPER",3640358203:"IFCCOOLINGTOWER",4136498852:"IFCCOOLEDBEAM",2272882330:"IFCCONDENSER",3571504051:"IFCCOMPRESSOR",3221913625:"IFCCOMMUNICATIONSAPPLIANCE",639361253:"IFCCOIL",3902619387:"IFCCHILLER",4217484030:"IFCCABLESEGMENT",1051757585:"IFCCABLEFITTING",3758799889:"IFCCABLECARRIERSEGMENT",635142910:"IFCCABLECARRIERFITTING",2938176219:"IFCBURNER",32344328:"IFCBOILER",2906023776:"IFCBEAMSTANDARDCASE",277319702:"IFCAUDIOVISUALAPPLIANCE",2056796094:"IFCAIRTOAIRHEATRECOVERY",177149247:"IFCAIRTERMINALBOX",1634111441:"IFCAIRTERMINAL",486154966:"IFCWINDOWSTANDARDCASE",4237592921:"IFCWASTETERMINAL",4156078855:"IFCWALLELEMENTEDCASE",4207607924:"IFCVALVE",4292641817:"IFCUNITARYEQUIPMENT",3179687236:"IFCUNITARYCONTROLELEMENTTYPE",3026737570:"IFCTUBEBUNDLE",3825984169:"IFCTRANSFORMER",812556717:"IFCTANK",1162798199:"IFCSWITCHINGDEVICE",385403989:"IFCSTRUCTURALLOADCASE",1404847402:"IFCSTACKTERMINAL",1999602285:"IFCSPACEHEATER",3420628829:"IFCSOLARDEVICE",3027962421:"IFCSLABSTANDARDCASE",3127900445:"IFCSLABELEMENTEDCASE",1329646415:"IFCSHADINGDEVICE",3053780830:"IFCSANITARYTERMINAL",2572171363:"IFCREINFORCINGBARTYPE",1232101972:"IFCRATIONALBSPLINECURVEWITHKNOTS",90941305:"IFCPUMP",655969474:"IFCPROTECTIVEDEVICETRIPPINGUNITTYPE",738039164:"IFCPROTECTIVEDEVICE",1156407060:"IFCPLATESTANDARDCASE",3612865200:"IFCPIPESEGMENT",310824031:"IFCPIPEFITTING",3694346114:"IFCOUTLET",144952367:"IFCOUTERBOUNDARYCURVE",2474470126:"IFCMOTORCONNECTION",1911478936:"IFCMEMBERSTANDARDCASE",1437502449:"IFCMEDICALDEVICE",629592764:"IFCLIGHTFIXTURE",76236018:"IFCLAMP",2176052936:"IFCJUNCTIONBOX",4175244083:"IFCINTERCEPTOR",2068733104:"IFCHUMIDIFIER",3319311131:"IFCHEATEXCHANGER",2188021234:"IFCFLOWMETER",1209101575:"IFCEXTERNALSPATIALELEMENT",484807127:"IFCEVAPORATOR",3747195512:"IFCEVAPORATIVECOOLER",2814081492:"IFCENGINE",2417008758:"IFCELECTRICDISTRIBUTIONBOARDTYPE",3242481149:"IFCDOORSTANDARDCASE",3205830791:"IFCDISTRIBUTIONSYSTEM",400855858:"IFCCOMMUNICATIONSAPPLIANCETYPE",905975707:"IFCCOLUMNSTANDARDCASE",1677625105:"IFCCIVILELEMENT",3296154744:"IFCCHIMNEY",2674252688:"IFCCABLEFITTINGTYPE",2188180465:"IFCBURNERTYPE",1177604601:"IFCBUILDINGSYSTEM",39481116:"IFCBUILDINGELEMENTPARTTYPE",1136057603:"IFCBOUNDARYCURVE",2461110595:"IFCBSPLINECURVEWITHKNOTS",1532957894:"IFCAUDIOVISUALAPPLIANCETYPE",4088093105:"IFCWORKCALENDAR",4009809668:"IFCWINDOWTYPE",926996030:"IFCVOIDINGFEATURE",2391383451:"IFCVIBRATIONISOLATOR",2415094496:"IFCTENDONTYPE",3081323446:"IFCTENDONANCHORTYPE",413509423:"IFCSYSTEMFURNITUREELEMENT",3101698114:"IFCSURFACEFEATURE",3657597509:"IFCSTRUCTURALSURFACEACTION",2757150158:"IFCSTRUCTURALCURVEREACTION",1004757350:"IFCSTRUCTURALCURVEACTION",338393293:"IFCSTAIRTYPE",1072016465:"IFCSOLARDEVICETYPE",4074543187:"IFCSHADINGDEVICETYPE",2157484638:"IFCSEAMCURVE",2781568857:"IFCROOFTYPE",2310774935:"IFCREINFORCINGMESHTYPE",964333572:"IFCREINFORCINGELEMENTTYPE",683857671:"IFCRATIONALBSPLINESURFACEWITHKNOTS",1469900589:"IFCRAMPTYPE",2839578677:"IFCPOLYGONALFACESET",1158309216:"IFCPILETYPE",3079942009:"IFCOPENINGSTANDARDCASE",1114901282:"IFCMEDICALDEVICETYPE",3113134337:"IFCINTERSECTIONCURVE",3946677679:"IFCINTERCEPTORTYPE",2571569899:"IFCINDEXEDPOLYCURVE",3493046030:"IFCGEOGRAPHICELEMENT",1509553395:"IFCFURNITURE",1893162501:"IFCFOOTINGTYPE",2853485674:"IFCEXTERNALSPATIALSTRUCTUREELEMENT",4148101412:"IFCEVENT",132023988:"IFCENGINETYPE",2397081782:"IFCELEMENTASSEMBLYTYPE",2323601079:"IFCDOORTYPE",1213902940:"IFCCYLINDRICALSURFACE",1525564444:"IFCCONSTRUCTIONPRODUCTRESOURCETYPE",4105962743:"IFCCONSTRUCTIONMATERIALRESOURCETYPE",2185764099:"IFCCONSTRUCTIONEQUIPMENTRESOURCETYPE",15328376:"IFCCOMPOSITECURVEONSURFACE",3875453745:"IFCCOMPLEXPROPERTYTEMPLATE",3893394355:"IFCCIVILELEMENTTYPE",2197970202:"IFCCHIMNEYTYPE",167062518:"IFCBSPLINESURFACEWITHKNOTS",2887950389:"IFCBSPLINESURFACE",2603310189:"IFCADVANCEDBREPWITHVOIDS",1635779807:"IFCADVANCEDBREP",2916149573:"IFCTRIANGULATEDFACESET",1935646853:"IFCTOROIDALSURFACE",2387106220:"IFCTESSELLATEDFACESET",3206491090:"IFCTASKTYPE",699246055:"IFCSURFACECURVE",4095615324:"IFCSUBCONTRACTRESOURCETYPE",603775116:"IFCSTRUCTURALSURFACEREACTION",4015995234:"IFCSPHERICALSURFACE",2481509218:"IFCSPATIALZONETYPE",463610769:"IFCSPATIALZONE",710998568:"IFCSPATIALELEMENTTYPE",1412071761:"IFCSPATIALELEMENT",3663146110:"IFCSIMPLEPROPERTYTEMPLATE",3243963512:"IFCREVOLVEDAREASOLIDTAPERED",816062949:"IFCREPARAMETRISEDCOMPOSITECURVESEGMENT",1521410863:"IFCRELSPACEBOUNDARY2NDLEVEL",3523091289:"IFCRELSPACEBOUNDARY1STLEVEL",427948657:"IFCRELINTERFERESELEMENTS",307848117:"IFCRELDEFINESBYTEMPLATE",1462361463:"IFCRELDEFINESBYOBJECT",2565941209:"IFCRELDECLARES",1027710054:"IFCRELASSIGNSTOGROUPBYFACTOR",3521284610:"IFCPROPERTYTEMPLATE",492091185:"IFCPROPERTYSETTEMPLATE",653396225:"IFCPROJECTLIBRARY",569719735:"IFCPROCEDURETYPE",3967405729:"IFCPREDEFINEDPROPERTYSET",1682466193:"IFCPCURVE",428585644:"IFCLABORRESOURCETYPE",2294589976:"IFCINDEXEDPOLYGONALFACEWITHVOIDS",178912537:"IFCINDEXEDPOLYGONALFACE",4095422895:"IFCGEOGRAPHICELEMENTTYPE",2652556860:"IFCFIXEDREFERENCESWEPTAREASOLID",2804161546:"IFCEXTRUDEDAREASOLIDTAPERED",4024345920:"IFCEVENTTYPE",2629017746:"IFCCURVEBOUNDEDSURFACE",1815067380:"IFCCREWRESOURCETYPE",3419103109:"IFCCONTEXT",2574617495:"IFCCONSTRUCTIONRESOURCETYPE",2059837836:"IFCCARTESIANPOINTLIST3D",1675464909:"IFCCARTESIANPOINTLIST2D",574549367:"IFCCARTESIANPOINTLIST",3406155212:"IFCADVANCEDFACE",3698973494:"IFCTYPERESOURCE",3736923433:"IFCTYPEPROCESS",901063453:"IFCTESSELLATEDITEM",1096409881:"IFCSWEPTDISKSOLIDPOLYGONAL",1042787934:"IFCRESOURCETIME",1608871552:"IFCRESOURCECONSTRAINTRELATIONSHIP",2943643501:"IFCRESOURCEAPPROVALRELATIONSHIP",2090586900:"IFCQUANTITYSET",1482703590:"IFCPROPERTYTEMPLATEDEFINITION",3778827333:"IFCPREDEFINEDPROPERTIES",2998442950:"IFCMIRROREDPROFILEDEF",853536259:"IFCMATERIALRELATIONSHIP",3404854881:"IFCMATERIALPROFILESETUSAGETAPERING",3079605661:"IFCMATERIALPROFILESETUSAGE",2852063980:"IFCMATERIALCONSTITUENTSET",3708119e3:"IFCMATERIALCONSTITUENT",1585845231:"IFCLAGTIME",2133299955:"IFCINDEXEDTRIANGLETEXTUREMAP",1437953363:"IFCINDEXEDTEXTUREMAP",3570813810:"IFCINDEXEDCOLOURMAP",1437805879:"IFCEXTERNALREFERENCERELATIONSHIP",297599258:"IFCEXTENDEDPROPERTIES",211053100:"IFCEVENTTIME",2713554722:"IFCCONVERSIONBASEDUNITWITHOFFSET",3285139300:"IFCCOLOURRGBLIST",1236880293:"IFCWORKTIME",1199560280:"IFCTIMEPERIOD",3611470254:"IFCTEXTUREVERTEXLIST",2771591690:"IFCTASKTIMERECURRING",1549132990:"IFCTASKTIME",2043862942:"IFCTABLECOLUMN",2934153892:"IFCSURFACEREINFORCEMENTAREA",609421318:"IFCSTRUCTURALLOADORRESULT",3478079324:"IFCSTRUCTURALLOADCONFIGURATION",1054537805:"IFCSCHEDULINGTIME",2439245199:"IFCRESOURCELEVELRELATIONSHIP",2433181523:"IFCREFERENCE",3915482550:"IFCRECURRENCEPATTERN",986844984:"IFCPROPERTYABSTRACTION",3843373140:"IFCPROJECTEDCRS",677532197:"IFCPRESENTATIONITEM",1507914824:"IFCMATERIALUSAGEDEFINITION",552965576:"IFCMATERIALPROFILEWITHOFFSETS",164193824:"IFCMATERIALPROFILESET",2235152071:"IFCMATERIALPROFILE",1847252529:"IFCMATERIALLAYERWITHOFFSETS",760658860:"IFCMATERIALDEFINITION",3057273783:"IFCMAPCONVERSION",4294318154:"IFCEXTERNALINFORMATION",1466758467:"IFCCOORDINATEREFERENCESYSTEM",1785450214:"IFCCOORDINATEOPERATION",775493141:"IFCCONNECTIONVOLUMEGEOMETRY",979691226:"IFCREINFORCINGBAR",3700593921:"IFCELECTRICDISTRIBUTIONPOINT",1062813311:"IFCDISTRIBUTIONCONTROLELEMENT",1052013943:"IFCDISTRIBUTIONCHAMBERELEMENT",578613899:"IFCCONTROLLERTYPE",2454782716:"IFCCHAMFEREDGEFEATURE",753842376:"IFCBEAM",3001207471:"IFCALARMTYPE",2874132201:"IFCACTUATORTYPE",3304561284:"IFCWINDOW",3512223829:"IFCWALLSTANDARDCASE",2391406946:"IFCWALL",3313531582:"IFCVIBRATIONISOLATORTYPE",2347447852:"IFCTENDONANCHOR",3824725483:"IFCTENDON",2515109513:"IFCSTRUCTURALANALYSISMODEL",4252922144:"IFCSTAIRFLIGHT",331165859:"IFCSTAIR",1529196076:"IFCSLAB",1783015770:"IFCSENSORTYPE",1376911519:"IFCROUNDEDEDGEFEATURE",2016517767:"IFCROOF",2320036040:"IFCREINFORCINGMESH",3027567501:"IFCREINFORCINGELEMENT",3055160366:"IFCRATIONALBEZIERCURVE",3283111854:"IFCRAMPFLIGHT",3024970846:"IFCRAMP",2262370178:"IFCRAILING",3171933400:"IFCPLATE",1687234759:"IFCPILE",1073191201:"IFCMEMBER",900683007:"IFCFOOTING",3508470533:"IFCFLOWTREATMENTDEVICE",2223149337:"IFCFLOWTERMINAL",707683696:"IFCFLOWSTORAGEDEVICE",987401354:"IFCFLOWSEGMENT",3132237377:"IFCFLOWMOVINGDEVICE",4037862832:"IFCFLOWINSTRUMENTTYPE",4278956645:"IFCFLOWFITTING",2058353004:"IFCFLOWCONTROLLER",4222183408:"IFCFIRESUPPRESSIONTERMINALTYPE",1810631287:"IFCFILTERTYPE",346874300:"IFCFANTYPE",1658829314:"IFCENERGYCONVERSIONDEVICE",857184966:"IFCELECTRICALELEMENT",1634875225:"IFCELECTRICALCIRCUIT",712377611:"IFCELECTRICTIMECONTROLTYPE",1217240411:"IFCELECTRICMOTORTYPE",1365060375:"IFCELECTRICHEATERTYPE",1534661035:"IFCELECTRICGENERATORTYPE",3277789161:"IFCELECTRICFLOWSTORAGEDEVICETYPE",663422040:"IFCELECTRICAPPLIANCETYPE",855621170:"IFCEDGEFEATURE",2030761528:"IFCDUCTSILENCERTYPE",3760055223:"IFCDUCTSEGMENTTYPE",869906466:"IFCDUCTFITTINGTYPE",395920057:"IFCDOOR",3041715199:"IFCDISTRIBUTIONPORT",3040386961:"IFCDISTRIBUTIONFLOWELEMENT",1945004755:"IFCDISTRIBUTIONELEMENT",2063403501:"IFCDISTRIBUTIONCONTROLELEMENTTYPE",1599208980:"IFCDISTRIBUTIONCHAMBERELEMENTTYPE",2635815018:"IFCDISCRETEACCESSORYTYPE",1335981549:"IFCDISCRETEACCESSORY",4147604152:"IFCDIAMETERDIMENSION",3961806047:"IFCDAMPERTYPE",3495092785:"IFCCURTAINWALL",1973544240:"IFCCOVERING",2954562838:"IFCCOOLINGTOWERTYPE",335055490:"IFCCOOLEDBEAMTYPE",488727124:"IFCCONSTRUCTIONPRODUCTRESOURCE",1060000209:"IFCCONSTRUCTIONMATERIALRESOURCE",3898045240:"IFCCONSTRUCTIONEQUIPMENTRESOURCE",1163958913:"IFCCONDITIONCRITERION",2188551683:"IFCCONDITION",2816379211:"IFCCONDENSERTYPE",3850581409:"IFCCOMPRESSORTYPE",843113511:"IFCCOLUMN",2301859152:"IFCCOILTYPE",2611217952:"IFCCIRCLE",2951183804:"IFCCHILLERTYPE",1285652485:"IFCCABLESEGMENTTYPE",3293546465:"IFCCABLECARRIERSEGMENTTYPE",395041908:"IFCCABLECARRIERFITTINGTYPE",1909888760:"IFCBUILDINGELEMENTPROXYTYPE",1095909175:"IFCBUILDINGELEMENTPROXY",2979338954:"IFCBUILDINGELEMENTPART",52481810:"IFCBUILDINGELEMENTCOMPONENT",3299480353:"IFCBUILDINGELEMENT",231477066:"IFCBOILERTYPE",1916977116:"IFCBEZIERCURVE",819618141:"IFCBEAMTYPE",1967976161:"IFCBSPLINECURVE",3460190687:"IFCASSET",2470393545:"IFCANGULARDIMENSION",1871374353:"IFCAIRTOAIRHEATRECOVERYTYPE",3352864051:"IFCAIRTERMINALTYPE",1411407467:"IFCAIRTERMINALBOXTYPE",3821786052:"IFCACTIONREQUEST",1213861670:"IFC2DCOMPOSITECURVE",1033361043:"IFCZONE",3342526732:"IFCWORKSCHEDULE",4218914973:"IFCWORKPLAN",1028945134:"IFCWORKCONTROL",1133259667:"IFCWASTETERMINALTYPE",1898987631:"IFCWALLTYPE",2769231204:"IFCVIRTUALELEMENT",728799441:"IFCVALVETYPE",1911125066:"IFCUNITARYEQUIPMENTTYPE",1600972822:"IFCTUBEBUNDLETYPE",3593883385:"IFCTRIMMEDCURVE",1620046519:"IFCTRANSPORTELEMENT",1692211062:"IFCTRANSFORMERTYPE",1637806684:"IFCTIMESERIESSCHEDULE",5716631:"IFCTANKTYPE",2254336722:"IFCSYSTEM",2315554128:"IFCSWITCHINGDEVICETYPE",148013059:"IFCSUBCONTRACTRESOURCE",1975003073:"IFCSTRUCTURALSURFACECONNECTION",2986769608:"IFCSTRUCTURALRESULTGROUP",1235345126:"IFCSTRUCTURALPOINTREACTION",734778138:"IFCSTRUCTURALPOINTCONNECTION",2082059205:"IFCSTRUCTURALPOINTACTION",3987759626:"IFCSTRUCTURALPLANARACTIONVARYING",1621171031:"IFCSTRUCTURALPLANARACTION",1252848954:"IFCSTRUCTURALLOADGROUP",1721250024:"IFCSTRUCTURALLINEARACTIONVARYING",1807405624:"IFCSTRUCTURALLINEARACTION",2445595289:"IFCSTRUCTURALCURVEMEMBERVARYING",214636428:"IFCSTRUCTURALCURVEMEMBER",4243806635:"IFCSTRUCTURALCURVECONNECTION",1179482911:"IFCSTRUCTURALCONNECTION",682877961:"IFCSTRUCTURALACTION",1039846685:"IFCSTAIRFLIGHTTYPE",3112655638:"IFCSTACKTERMINALTYPE",3812236995:"IFCSPACETYPE",652456506:"IFCSPACEPROGRAM",1305183839:"IFCSPACEHEATERTYPE",3856911033:"IFCSPACE",2533589738:"IFCSLABTYPE",4097777520:"IFCSITE",4105383287:"IFCSERVICELIFE",3517283431:"IFCSCHEDULETIMECONTROL",1768891740:"IFCSANITARYTERMINALTYPE",2863920197:"IFCRELASSIGNSTASKS",160246688:"IFCRELAGGREGATES",2324767716:"IFCRAMPFLIGHTTYPE",2893384427:"IFCRAILINGTYPE",3248260540:"IFCRADIUSDIMENSION",2250791053:"IFCPUMPTYPE",1842657554:"IFCPROTECTIVEDEVICETYPE",3651124850:"IFCPROJECTIONELEMENT",3642467123:"IFCPROJECTORDERRECORD",2904328755:"IFCPROJECTORDER",2744685151:"IFCPROCEDURE",3740093272:"IFCPORT",3724593414:"IFCPOLYLINE",4017108033:"IFCPLATETYPE",4231323485:"IFCPIPESEGMENTTYPE",804291784:"IFCPIPEFITTINGTYPE",3327091369:"IFCPERMIT",2382730787:"IFCPERFORMANCEHISTORY",2837617999:"IFCOUTLETTYPE",3425660407:"IFCORDERACTION",3588315303:"IFCOPENINGELEMENT",4143007308:"IFCOCCUPANT",1916936684:"IFCMOVE",977012517:"IFCMOTORCONNECTIONTYPE",3181161470:"IFCMEMBERTYPE",2108223431:"IFCMECHANICALFASTENERTYPE",377706215:"IFCMECHANICALFASTENER",2506943328:"IFCLINEARDIMENSION",1161773419:"IFCLIGHTFIXTURETYPE",1051575348:"IFCLAMPTYPE",3827777499:"IFCLABORRESOURCE",4288270099:"IFCJUNCTIONBOXTYPE",2391368822:"IFCINVENTORY",1806887404:"IFCHUMIDIFIERTYPE",1251058090:"IFCHEATEXCHANGERTYPE",2706460486:"IFCGROUP",3009204131:"IFCGRID",200128114:"IFCGASTERMINALTYPE",814719939:"IFCFURNITURESTANDARD",263784265:"IFCFURNISHINGELEMENT",3009222698:"IFCFLOWTREATMENTDEVICETYPE",2297155007:"IFCFLOWTERMINALTYPE",1339347760:"IFCFLOWSTORAGEDEVICETYPE",1834744321:"IFCFLOWSEGMENTTYPE",1482959167:"IFCFLOWMOVINGDEVICETYPE",3815607619:"IFCFLOWMETERTYPE",3198132628:"IFCFLOWFITTINGTYPE",3907093117:"IFCFLOWCONTROLLERTYPE",1287392070:"IFCFEATUREELEMENTSUBTRACTION",2143335405:"IFCFEATUREELEMENTADDITION",2827207264:"IFCFEATUREELEMENT",2489546625:"IFCFASTENERTYPE",647756555:"IFCFASTENER",3737207727:"IFCFACETEDBREPWITHVOIDS",807026263:"IFCFACETEDBREP",3390157468:"IFCEVAPORATORTYPE",3174744832:"IFCEVAPORATIVECOOLERTYPE",3272907226:"IFCEQUIPMENTSTANDARD",1962604670:"IFCEQUIPMENTELEMENT",2107101300:"IFCENERGYCONVERSIONDEVICETYPE",1704287377:"IFCELLIPSE",2590856083:"IFCELEMENTCOMPONENTTYPE",1623761950:"IFCELEMENTCOMPONENT",4123344466:"IFCELEMENTASSEMBLY",1758889154:"IFCELEMENT",360485395:"IFCELECTRICALBASEPROPERTIES",3849074793:"IFCDISTRIBUTIONFLOWELEMENTTYPE",3256556792:"IFCDISTRIBUTIONELEMENTTYPE",681481545:"IFCDIMENSIONCURVEDIRECTEDCALLOUT",1457835157:"IFCCURTAINWALLTYPE",3295246426:"IFCCREWRESOURCE",1916426348:"IFCCOVERINGTYPE",1419761937:"IFCCOSTSCHEDULE",3895139033:"IFCCOSTITEM",3293443760:"IFCCONTROL",2559216714:"IFCCONSTRUCTIONRESOURCE",2510884976:"IFCCONIC",3732776249:"IFCCOMPOSITECURVE",300633059:"IFCCOLUMNTYPE",2937912522:"IFCCIRCLEHOLLOWPROFILEDEF",3124254112:"IFCBUILDINGSTOREY",1950629157:"IFCBUILDINGELEMENTTYPE",4031249490:"IFCBUILDING",1260505505:"IFCBOUNDEDCURVE",3649129432:"IFCBOOLEANCLIPPINGRESULT",1334484129:"IFCBLOCK",3207858831:"IFCASYMMETRICISHAPEPROFILEDEF",1674181508:"IFCANNOTATION",2296667514:"IFCACTOR",2097647324:"IFCTRANSPORTELEMENTTYPE",3473067441:"IFCTASK",1580310250:"IFCSYSTEMFURNITUREELEMENTTYPE",4124788165:"IFCSURFACEOFREVOLUTION",2809605785:"IFCSURFACEOFLINEAREXTRUSION",2028607225:"IFCSURFACECURVESWEPTAREASOLID",4070609034:"IFCSTRUCTUREDDIMENSIONCALLOUT",2218152070:"IFCSTRUCTURALSURFACEMEMBERVARYING",3979015343:"IFCSTRUCTURALSURFACEMEMBER",3689010777:"IFCSTRUCTURALREACTION",530289379:"IFCSTRUCTURALMEMBER",3136571912:"IFCSTRUCTURALITEM",3544373492:"IFCSTRUCTURALACTIVITY",451544542:"IFCSPHERE",3893378262:"IFCSPATIALSTRUCTUREELEMENTTYPE",2706606064:"IFCSPATIALSTRUCTUREELEMENT",3626867408:"IFCRIGHTCIRCULARCYLINDER",4158566097:"IFCRIGHTCIRCULARCONE",1856042241:"IFCREVOLVEDAREASOLID",2914609552:"IFCRESOURCE",1401173127:"IFCRELVOIDSELEMENT",3451746338:"IFCRELSPACEBOUNDARY",366585022:"IFCRELSERVICESBUILDINGS",4122056220:"IFCRELSEQUENCE",1058617721:"IFCRELSCHEDULESCOSTITEMS",1245217292:"IFCRELREFERENCEDINSPATIALSTRUCTURE",750771296:"IFCRELPROJECTSELEMENT",202636808:"IFCRELOVERRIDESPROPERTIES",2051452291:"IFCRELOCCUPIESSPACES",3268803585:"IFCRELNESTS",4189434867:"IFCRELINTERACTIONREQUIREMENTS",279856033:"IFCRELFLOWCONTROLELEMENTS",3940055652:"IFCRELFILLSELEMENT",781010003:"IFCRELDEFINESBYTYPE",4186316022:"IFCRELDEFINESBYPROPERTIES",693640335:"IFCRELDEFINES",2551354335:"IFCRELDECOMPOSES",2802773753:"IFCRELCOVERSSPACES",886880790:"IFCRELCOVERSBLDGELEMENTS",3242617779:"IFCRELCONTAINEDINSPATIALSTRUCTURE",3678494232:"IFCRELCONNECTSWITHREALIZINGELEMENTS",504942748:"IFCRELCONNECTSWITHECCENTRICITY",1638771189:"IFCRELCONNECTSSTRUCTURALMEMBER",3912681535:"IFCRELCONNECTSSTRUCTURALELEMENT",2127690289:"IFCRELCONNECTSSTRUCTURALACTIVITY",3190031847:"IFCRELCONNECTSPORTS",4201705270:"IFCRELCONNECTSPORTTOELEMENT",3945020480:"IFCRELCONNECTSPATHELEMENTS",1204542856:"IFCRELCONNECTSELEMENTS",826625072:"IFCRELCONNECTS",2851387026:"IFCRELASSOCIATESPROFILEPROPERTIES",2655215786:"IFCRELASSOCIATESMATERIAL",3840914261:"IFCRELASSOCIATESLIBRARY",982818633:"IFCRELASSOCIATESDOCUMENT",2728634034:"IFCRELASSOCIATESCONSTRAINT",919958153:"IFCRELASSOCIATESCLASSIFICATION",4095574036:"IFCRELASSOCIATESAPPROVAL",1327628568:"IFCRELASSOCIATESAPPLIEDVALUE",1865459582:"IFCRELASSOCIATES",205026976:"IFCRELASSIGNSTORESOURCE",3372526763:"IFCRELASSIGNSTOPROJECTORDER",2857406711:"IFCRELASSIGNSTOPRODUCT",4278684876:"IFCRELASSIGNSTOPROCESS",1307041759:"IFCRELASSIGNSTOGROUP",2495723537:"IFCRELASSIGNSTOCONTROL",1683148259:"IFCRELASSIGNSTOACTOR",3939117080:"IFCRELASSIGNS",3454111270:"IFCRECTANGULARTRIMMEDSURFACE",2798486643:"IFCRECTANGULARPYRAMID",2770003689:"IFCRECTANGLEHOLLOWPROFILEDEF",3219374653:"IFCPROXY",1451395588:"IFCPROPERTYSET",4194566429:"IFCPROJECTIONCURVE",103090709:"IFCPROJECT",4208778838:"IFCPRODUCT",2945172077:"IFCPROCESS",220341763:"IFCPLANE",603570806:"IFCPLANARBOX",3566463478:"IFCPERMEABLECOVERINGPROPERTIES",3505215534:"IFCOFFSETCURVE3D",3388369263:"IFCOFFSETCURVE2D",3888040117:"IFCOBJECT",1425443689:"IFCMANIFOLDSOLIDBREP",1281925730:"IFCLINE",572779678:"IFCLSHAPEPROFILEDEF",1484403080:"IFCISHAPEPROFILEDEF",987898635:"IFCGEOMETRICCURVESET",1268542332:"IFCFURNITURETYPE",4238390223:"IFCFURNISHINGELEMENTTYPE",3455213021:"IFCFLUIDFLOWPROPERTIES",315944413:"IFCFILLAREASTYLETILES",4203026998:"IFCFILLAREASTYLETILESYMBOLWITHSTYLE",374418227:"IFCFILLAREASTYLEHATCHING",2047409740:"IFCFACEBASEDSURFACEMODEL",477187591:"IFCEXTRUDEDAREASOLID",80994333:"IFCENERGYPROPERTIES",2835456948:"IFCELLIPSEPROFILEDEF",2777663545:"IFCELEMENTARYSURFACE",339256511:"IFCELEMENTTYPE",1883228015:"IFCELEMENTQUANTITY",1472233963:"IFCEDGELOOP",4006246654:"IFCDRAUGHTINGPREDEFINEDCURVEFONT",445594917:"IFCDRAUGHTINGPREDEFINEDCOLOUR",3073041342:"IFCDRAUGHTINGCALLOUT",526551008:"IFCDOORSTYLE",1714330368:"IFCDOORPANELPROPERTIES",2963535650:"IFCDOORLININGPROPERTIES",32440307:"IFCDIRECTION",4054601972:"IFCDIMENSIONCURVETERMINATOR",606661476:"IFCDIMENSIONCURVE",693772133:"IFCDEFINEDSYMBOL",2827736869:"IFCCURVEBOUNDEDPLANE",2601014836:"IFCCURVE",2147822146:"IFCCSGSOLID",2506170314:"IFCCSGPRIMITIVE3D",194851669:"IFCCRANERAILFSHAPEPROFILEDEF",4133800736:"IFCCRANERAILASHAPEPROFILEDEF",2485617015:"IFCCOMPOSITECURVESEGMENT",2205249479:"IFCCLOSEDSHELL",1383045692:"IFCCIRCLEPROFILEDEF",1416205885:"IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM",3331915920:"IFCCARTESIANTRANSFORMATIONOPERATOR3D",3486308946:"IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM",3749851601:"IFCCARTESIANTRANSFORMATIONOPERATOR2D",59481748:"IFCCARTESIANTRANSFORMATIONOPERATOR",1123145078:"IFCCARTESIANPOINT",2898889636:"IFCCSHAPEPROFILEDEF",2713105998:"IFCBOXEDHALFSPACE",2581212453:"IFCBOUNDINGBOX",4182860854:"IFCBOUNDEDSURFACE",2736907675:"IFCBOOLEANRESULT",2740243338:"IFCAXIS2PLACEMENT3D",3125803723:"IFCAXIS2PLACEMENT2D",4261334040:"IFCAXIS1PLACEMENT",1302238472:"IFCANNOTATIONSURFACE",2265737646:"IFCANNOTATIONFILLAREAOCCURRENCE",669184980:"IFCANNOTATIONFILLAREA",3288037868:"IFCANNOTATIONCURVEOCCURRENCE",2543172580:"IFCZSHAPEPROFILEDEF",1299126871:"IFCWINDOWSTYLE",512836454:"IFCWINDOWPANELPROPERTIES",336235671:"IFCWINDOWLININGPROPERTIES",2759199220:"IFCVERTEXLOOP",1417489154:"IFCVECTOR",427810014:"IFCUSHAPEPROFILEDEF",2347495698:"IFCTYPEPRODUCT",1628702193:"IFCTYPEOBJECT",1345879162:"IFCTWODIRECTIONREPEATFACTOR",2715220739:"IFCTRAPEZIUMPROFILEDEF",3124975700:"IFCTEXTLITERALWITHEXTENT",4282788508:"IFCTEXTLITERAL",3028897424:"IFCTERMINATORSYMBOL",3071757647:"IFCTSHAPEPROFILEDEF",230924584:"IFCSWEPTSURFACE",1260650574:"IFCSWEPTDISKSOLID",2247615214:"IFCSWEPTAREASOLID",1878645084:"IFCSURFACESTYLERENDERING",2513912981:"IFCSURFACE",2233826070:"IFCSUBEDGE",3653947884:"IFCSTRUCTURALSTEELPROFILEPROPERTIES",3843319758:"IFCSTRUCTURALPROFILEPROPERTIES",1190533807:"IFCSTRUCTURALLOADSINGLEFORCEWARPING",1597423693:"IFCSTRUCTURALLOADSINGLEFORCE",1973038258:"IFCSTRUCTURALLOADSINGLEDISPLACEMENTDISTORTION",2473145415:"IFCSTRUCTURALLOADSINGLEDISPLACEMENT",2668620305:"IFCSTRUCTURALLOADPLANARFORCE",1595516126:"IFCSTRUCTURALLOADLINEARFORCE",390701378:"IFCSPACETHERMALLOADPROPERTIES",1202362311:"IFCSOUNDVALUE",2485662743:"IFCSOUNDPROPERTIES",723233188:"IFCSOLIDMODEL",2609359061:"IFCSLIPPAGECONNECTIONCONDITION",4124623270:"IFCSHELLBASEDSURFACEMODEL",2411513650:"IFCSERVICELIFEFACTOR",1509187699:"IFCSECTIONEDSPINE",2778083089:"IFCROUNDEDRECTANGLEPROFILEDEF",478536968:"IFCRELATIONSHIP",3765753017:"IFCREINFORCEMENTDEFINITIONPROPERTIES",3413951693:"IFCREGULARTIMESERIES",3615266464:"IFCRECTANGLEPROFILEDEF",110355661:"IFCPROPERTYTABLEVALUE",3650150729:"IFCPROPERTYSINGLEVALUE",3357820518:"IFCPROPERTYSETDEFINITION",941946838:"IFCPROPERTYREFERENCEVALUE",2752243245:"IFCPROPERTYLISTVALUE",4166981789:"IFCPROPERTYENUMERATEDVALUE",1680319473:"IFCPROPERTYDEFINITION",871118103:"IFCPROPERTYBOUNDEDVALUE",673634403:"IFCPRODUCTDEFINITIONSHAPE",179317114:"IFCPREDEFINEDPOINTMARKERSYMBOL",433424934:"IFCPREDEFINEDDIMENSIONSYMBOL",2559016684:"IFCPREDEFINEDCURVEFONT",759155922:"IFCPREDEFINEDCOLOUR",2775532180:"IFCPOLYGONALBOUNDEDHALFSPACE",2924175390:"IFCPOLYLOOP",1423911732:"IFCPOINTONSURFACE",4022376103:"IFCPOINTONCURVE",2067069095:"IFCPOINT",1663979128:"IFCPLANAREXTENT",2004835150:"IFCPLACEMENT",597895409:"IFCPIXELTEXTURE",3021840470:"IFCPHYSICALCOMPLEXQUANTITY",2519244187:"IFCPATH",2529465313:"IFCPARAMETERIZEDPROFILEDEF",1029017970:"IFCORIENTEDEDGE",2665983363:"IFCOPENSHELL",2833995503:"IFCONEDIRECTIONREPEATFACTOR",219451334:"IFCOBJECTDEFINITION",1430189142:"IFCMECHANICALCONCRETEMATERIALPROPERTIES",2022407955:"IFCMATERIALDEFINITIONREPRESENTATION",2347385850:"IFCMAPPEDITEM",1008929658:"IFCLOOP",2624227202:"IFCLOCALPLACEMENT",3422422726:"IFCLIGHTSOURCESPOT",1520743889:"IFCLIGHTSOURCEPOSITIONAL",4266656042:"IFCLIGHTSOURCEGONIOMETRIC",2604431987:"IFCLIGHTSOURCEDIRECTIONAL",125510826:"IFCLIGHTSOURCEAMBIENT",1402838566:"IFCLIGHTSOURCE",3741457305:"IFCIRREGULARTIMESERIES",3905492369:"IFCIMAGETEXTURE",2445078500:"IFCHYGROSCOPICMATERIALPROPERTIES",812098782:"IFCHALFSPACESOLID",178086475:"IFCGRIDPLACEMENT",3590301190:"IFCGEOMETRICSET",4142052618:"IFCGEOMETRICREPRESENTATIONSUBCONTEXT",2453401579:"IFCGEOMETRICREPRESENTATIONITEM",3448662350:"IFCGEOMETRICREPRESENTATIONCONTEXT",1446786286:"IFCGENERALPROFILEPROPERTIES",803998398:"IFCGENERALMATERIALPROPERTIES",3857492461:"IFCFUELPROPERTIES",738692330:"IFCFILLAREASTYLE",4219587988:"IFCFAILURECONNECTIONCONDITION",3008276851:"IFCFACESURFACE",803316827:"IFCFACEOUTERBOUND",1809719519:"IFCFACEBOUND",2556980723:"IFCFACE",1860660968:"IFCEXTENDEDMATERIALPROPERTIES",476780140:"IFCEDGECURVE",3900360178:"IFCEDGE",4170525392:"IFCDRAUGHTINGPREDEFINEDTEXTFONT",3732053477:"IFCDOCUMENTREFERENCE",1694125774:"IFCDIMENSIONPAIR",2273265877:"IFCDIMENSIONCALLOUTRELATIONSHIP",3632507154:"IFCDERIVEDPROFILEDEF",3800577675:"IFCCURVESTYLE",2889183280:"IFCCONVERSIONBASEDUNIT",3050246964:"IFCCONTEXTDEPENDENTUNIT",45288368:"IFCCONNECTIONPOINTECCENTRICITY",1981873012:"IFCCONNECTIONCURVEGEOMETRY",370225590:"IFCCONNECTEDFACESET",1485152156:"IFCCOMPOSITEPROFILEDEF",2542286263:"IFCCOMPLEXPROPERTY",776857604:"IFCCOLOURRGB",647927063:"IFCCLASSIFICATIONREFERENCE",3150382593:"IFCCENTERLINEPROFILEDEF",616511568:"IFCBLOBTEXTURE",2705031697:"IFCARBITRARYPROFILEDEFWITHVOIDS",1310608509:"IFCARBITRARYOPENPROFILEDEF",3798115385:"IFCARBITRARYCLOSEDPROFILEDEF",2297822566:"IFCANNOTATIONTEXTOCCURRENCE",3612888222:"IFCANNOTATIONSYMBOLOCCURRENCE",962685235:"IFCANNOTATIONSURFACEOCCURRENCE",2442683028:"IFCANNOTATIONOCCURRENCE",1065908215:"IFCWATERPROPERTIES",891718957:"IFCVIRTUALGRIDINTERSECTION",1907098498:"IFCVERTEXPOINT",3304826586:"IFCVERTEXBASEDTEXTUREMAP",2799835756:"IFCVERTEX",180925521:"IFCUNITASSIGNMENT",1735638870:"IFCTOPOLOGYREPRESENTATION",1377556343:"IFCTOPOLOGICALREPRESENTATIONITEM",581633288:"IFCTIMESERIESVALUE",1718945513:"IFCTIMESERIESREFERENCERELATIONSHIP",3101149627:"IFCTIMESERIES",3317419933:"IFCTHERMALMATERIALPROPERTIES",1210645708:"IFCTEXTUREVERTEX",2552916305:"IFCTEXTUREMAP",1742049831:"IFCTEXTURECOORDINATEGENERATOR",280115917:"IFCTEXTURECOORDINATE",1484833681:"IFCTEXTSTYLEWITHBOXCHARACTERISTICS",1640371178:"IFCTEXTSTYLETEXTMODEL",2636378356:"IFCTEXTSTYLEFORDEFINEDFONT",1983826977:"IFCTEXTSTYLEFONTMODEL",1447204868:"IFCTEXTSTYLE",912023232:"IFCTELECOMADDRESS",531007025:"IFCTABLEROW",985171141:"IFCTABLE",1290481447:"IFCSYMBOLSTYLE",626085974:"IFCSURFACETEXTURE",1351298697:"IFCSURFACESTYLEWITHTEXTURES",846575682:"IFCSURFACESTYLESHADING",1607154358:"IFCSURFACESTYLEREFRACTION",3303107099:"IFCSURFACESTYLELIGHTING",1300840506:"IFCSURFACESTYLE",3049322572:"IFCSTYLEDREPRESENTATION",3958052878:"IFCSTYLEDITEM",2830218821:"IFCSTYLEMODEL",3408363356:"IFCSTRUCTURALLOADTEMPERATURE",2525727697:"IFCSTRUCTURALLOADSTATIC",2162789131:"IFCSTRUCTURALLOAD",2273995522:"IFCSTRUCTURALCONNECTIONCONDITION",3692461612:"IFCSIMPLEPROPERTY",4240577450:"IFCSHAPEREPRESENTATION",3982875396:"IFCSHAPEMODEL",867548509:"IFCSHAPEASPECT",4165799628:"IFCSECTIONREINFORCEMENTPROPERTIES",2042790032:"IFCSECTIONPROPERTIES",448429030:"IFCSIUNIT",2341007311:"IFCROOT",3679540991:"IFCRIBPLATEPROFILEPROPERTIES",1660063152:"IFCREPRESENTATIONMAP",3008791417:"IFCREPRESENTATIONITEM",3377609919:"IFCREPRESENTATIONCONTEXT",1076942058:"IFCREPRESENTATION",1222501353:"IFCRELAXATION",1580146022:"IFCREINFORCEMENTBARPROPERTIES",2692823254:"IFCREFERENCESVALUEDOCUMENT",825690147:"IFCQUANTITYWEIGHT",2405470396:"IFCQUANTITYVOLUME",3252649465:"IFCQUANTITYTIME",931644368:"IFCQUANTITYLENGTH",2093928680:"IFCQUANTITYCOUNT",2044713172:"IFCQUANTITYAREA",3710013099:"IFCPROPERTYENUMERATION",148025276:"IFCPROPERTYDEPENDENCYRELATIONSHIP",3896028662:"IFCPROPERTYCONSTRAINTRELATIONSHIP",2598011224:"IFCPROPERTY",2802850158:"IFCPROFILEPROPERTIES",3958567839:"IFCPROFILEDEF",2267347899:"IFCPRODUCTSOFCOMBUSTIONPROPERTIES",2095639259:"IFCPRODUCTREPRESENTATION",2417041796:"IFCPRESENTATIONSTYLEASSIGNMENT",3119450353:"IFCPRESENTATIONSTYLE",1304840413:"IFCPRESENTATIONLAYERWITHSTYLE",2022622350:"IFCPRESENTATIONLAYERASSIGNMENT",1775413392:"IFCPREDEFINEDTEXTFONT",3213052703:"IFCPREDEFINEDTERMINATORSYMBOL",990879717:"IFCPREDEFINEDSYMBOL",3727388367:"IFCPREDEFINEDITEM",3355820592:"IFCPOSTALADDRESS",2226359599:"IFCPHYSICALSIMPLEQUANTITY",2483315170:"IFCPHYSICALQUANTITY",101040310:"IFCPERSONANDORGANIZATION",2077209135:"IFCPERSON",1207048766:"IFCOWNERHISTORY",1411181986:"IFCORGANIZATIONRELATIONSHIP",4251960020:"IFCORGANIZATION",1227763645:"IFCOPTICALMATERIALPROPERTIES",2251480897:"IFCOBJECTIVE",3701648758:"IFCOBJECTPLACEMENT",1918398963:"IFCNAMEDUNIT",2706619895:"IFCMONETARYUNIT",3368373690:"IFCMETRIC",677618848:"IFCMECHANICALSTEELMATERIALPROPERTIES",4256014907:"IFCMECHANICALMATERIALPROPERTIES",2597039031:"IFCMEASUREWITHUNIT",3265635763:"IFCMATERIALPROPERTIES",2199411900:"IFCMATERIALLIST",1303795690:"IFCMATERIALLAYERSETUSAGE",3303938423:"IFCMATERIALLAYERSET",248100487:"IFCMATERIALLAYER",1847130766:"IFCMATERIALCLASSIFICATIONRELATIONSHIP",1838606355:"IFCMATERIAL",30780891:"IFCLOCALTIME",1566485204:"IFCLIGHTINTENSITYDISTRIBUTION",4162380809:"IFCLIGHTDISTRIBUTIONDATA",3452421091:"IFCLIBRARYREFERENCE",2655187982:"IFCLIBRARYINFORMATION",3020489413:"IFCIRREGULARTIMESERIESVALUE",852622518:"IFCGRIDAXIS",3548104201:"IFCEXTERNALLYDEFINEDTEXTFONT",3207319532:"IFCEXTERNALLYDEFINEDSYMBOL",1040185647:"IFCEXTERNALLYDEFINEDSURFACESTYLE",2242383968:"IFCEXTERNALLYDEFINEDHATCHSTYLE",3200245327:"IFCEXTERNALREFERENCE",1648886627:"IFCENVIRONMENTALIMPACTVALUE",3796139169:"IFCDRAUGHTINGCALLOUTRELATIONSHIP",770865208:"IFCDOCUMENTINFORMATIONRELATIONSHIP",1154170062:"IFCDOCUMENTINFORMATION",1376555844:"IFCDOCUMENTELECTRONICFORMAT",2949456006:"IFCDIMENSIONALEXPONENTS",1045800335:"IFCDERIVEDUNITELEMENT",1765591967:"IFCDERIVEDUNIT",1072939445:"IFCDATEANDTIME",3510044353:"IFCCURVESTYLEFONTPATTERN",2367409068:"IFCCURVESTYLEFONTANDSCALING",1105321065:"IFCCURVESTYLEFONT",539742890:"IFCCURRENCYRELATIONSHIP",602808272:"IFCCOSTVALUE",1065062679:"IFCCOORDINATEDUNIVERSALTIMEOFFSET",347226245:"IFCCONSTRAINTRELATIONSHIP",613356794:"IFCCONSTRAINTCLASSIFICATIONRELATIONSHIP",1658513725:"IFCCONSTRAINTAGGREGATIONRELATIONSHIP",1959218052:"IFCCONSTRAINT",2732653382:"IFCCONNECTIONSURFACEGEOMETRY",4257277454:"IFCCONNECTIONPORTGEOMETRY",2614616156:"IFCCONNECTIONPOINTGEOMETRY",2859738748:"IFCCONNECTIONGEOMETRY",3264961684:"IFCCOLOURSPECIFICATION",3639012971:"IFCCLASSIFICATIONNOTATIONFACET",938368621:"IFCCLASSIFICATIONNOTATION",1098599126:"IFCCLASSIFICATIONITEMRELATIONSHIP",1767535486:"IFCCLASSIFICATIONITEM",747523909:"IFCCLASSIFICATION",622194075:"IFCCALENDARDATE",2069777674:"IFCBOUNDARYNODECONDITIONWARPING",1387855156:"IFCBOUNDARYNODECONDITION",3367102660:"IFCBOUNDARYFACECONDITION",1560379544:"IFCBOUNDARYEDGECONDITION",4037036970:"IFCBOUNDARYCONDITION",3869604511:"IFCAPPROVALRELATIONSHIP",390851274:"IFCAPPROVALPROPERTYRELATIONSHIP",2080292479:"IFCAPPROVALACTORRELATIONSHIP",130549933:"IFCAPPROVAL",1110488051:"IFCAPPLIEDVALUERELATIONSHIP",411424972:"IFCAPPLIEDVALUE",639542469:"IFCAPPLICATION",618182010:"IFCADDRESS",3630933823:"IFCACTORROLE",599546466:"FILE_DESCRIPTION",1390159747:"FILE_NAME",1109904537:"FILE_SCHEMA"};class cs{static async getUnits(e){var t,s,i;const{IFCUNITASSIGNMENT:n}=Ke,r=await e.getAllPropertiesOfType(n);if(!r)return 1;const o=Object.keys(r),a=r[parseInt(o[0],10)];for(const c of a.Units){if(c.value===void 0||c.value===null)continue;const h=await e.getProperties(c.value);if(!h||!h.UnitType||!h.UnitType.value||h.UnitType.value!=="LENGTHUNIT")continue;let d=1,I=1;return h.Name.value==="METRE"&&(I=1),h.Name.value==="FOOT"&&(I=.3048),((t=h.Prefix)==null?void 0:t.value)==="MILLI"?d=.001:((s=h.Prefix)==null?void 0:s.value)==="CENTI"?d=.01:((i=h.Prefix)==null?void 0:i.value)==="DECI"&&(d=.1),I*d}return 1}static async findItemByGuid(e,t){var s;const i=e.getAllPropertiesIDs();for(const n of i){const r=await e.getProperties(n);if(r&&((s=r.GlobalId)==null?void 0:s.value)===t)return r}return null}static async getRelationMap(e,t,s){var i;const n=s??(async()=>{}),r={},o=e.getAllPropertiesIDs();for(const a of o){const c=await e.getProperties(a);if(!c)continue;const h=c.type===t,d=Object.keys(c).find(C=>C.startsWith("Relating")),I=Object.keys(c).find(C=>C.startsWith("Related"));if(!(h&&d&&I))continue;const u=await e.getProperties((i=c[d])==null?void 0:i.value),f=c[I];if(!u||!f||!(f&&Array.isArray(f)))continue;const E=f.map(C=>C.value);await n(u.expressID,E),r[u.expressID]=E}return r}static async getQsetQuantities(e,t,s){const i=s??(()=>{}),n=await e.getProperties(t);return!n||n.type!==Ci?null:(n.Quantities??[{}]).map(r=>(r.value&&i(r.value),r.value)).filter(r=>r!==null)}static async getPsetProps(e,t,s){const i=s??(()=>{}),n=await e.getProperties(t);return!n||n.type!==ls?null:(n.HasProperties??[{}]).map(r=>(r.value&&i(r.value),r.value)).filter(r=>r!==null)}static async getPsetRel(e,t){var s;if(!await e.getProperties(t))return null;const i=await e.getAllPropertiesOfType(zs);if(!i)return null;const n=Object.values(i);let r=null;for(const o of n)((s=o.RelatingPropertyDefinition)==null?void 0:s.value)===t&&(r=o.expressID);return r}static async getQsetRel(e,t){return cs.getPsetRel(e,t)}static async getEntityName(e,t){var s;const i=await e.getProperties(t);if(!i)return{key:null,name:null};const n=Object.keys(i).find(o=>o.endsWith("Name"))??null,r=n?(s=i[n])==null?void 0:s.value:null;return{key:n,name:r}}static async getQuantityValue(e,t){const s=await e.getProperties(t);if(!s)return{key:null,value:null};const i=Object.keys(s).find(r=>r.endsWith("Value"))??null;let n;return i===null||s[i]===void 0||s[i]===null?n=null:n=s[i].value,{key:i,value:n}}static isRel(e){return yi[e].startsWith("IFCREL")}static async attributeExists(e,t,s){const i=await e.getProperties(t);return i?Object.keys(i).includes(s):!1}static async groupEntitiesByType(e,t){var s;const i=new Map;for(const n of t){const r=await e.getProperties(n);if(!r)continue;const o=r.type;i.get(o)||i.set(o,new Set),(s=i.get(o))==null||s.add(n)}return i}}const lh={IFCURIREFERENCE:"IfcUriReference",IFCTIME:"IfcTime",IFCTEMPERATURERATEOFCHANGEMEASURE:"IfcTemperatureRateOfChangeMeasure",IFCSOUNDPRESSURELEVELMEASURE:"IfcSoundPressureLevelMeasure",IFCSOUNDPOWERLEVELMEASURE:"IfcSoundPowerLevelMeasure",IFCPROPERTYSETDEFINITIONSET:"IfcPropertySetDefinitionSet",IFCPOSITIVEINTEGER:"IfcPositiveInteger",IFCNONNEGATIVELENGTHMEASURE:"IfcNonNegativeLengthMeasure",IFCLINEINDEX:"IfcLineIndex",IFCLANGUAGEID:"IfcLanguageId",IFCDURATION:"IfcDuration",IFCDAYINWEEKNUMBER:"IfcDayInWeekNumber",IFCDATETIME:"IfcDateTime",IFCDATE:"IfcDate",IFCCARDINALPOINTREFERENCE:"IfcCardinalPointReference",IFCBINARY:"IfcBinary",IFCAREADENSITYMEASURE:"IfcAreaDensityMeasure",IFCARCINDEX:"IfcArcIndex",IFCYEARNUMBER:"IfcYearNumber",IFCWARPINGMOMENTMEASURE:"IfcWarpingMomentMeasure",IFCWARPINGCONSTANTMEASURE:"IfcWarpingConstantMeasure",IFCVOLUMETRICFLOWRATEMEASURE:"IfcVolumetricFlowRateMeasure",IFCVOLUMEMEASURE:"IfcVolumeMeasure",IFCVAPORPERMEABILITYMEASURE:"IfcVaporPermeabilityMeasure",IFCTORQUEMEASURE:"IfcTorqueMeasure",IFCTIMESTAMP:"IfcTimestamp",IFCTIMEMEASURE:"IfcTimeMeasure",IFCTHERMODYNAMICTEMPERATUREMEASURE:"IfcThermodynamicTemperatureMeasure",IFCTHERMALTRANSMITTANCEMEASURE:"IfcThermalTransmittanceMeasure",IFCTHERMALRESISTANCEMEASURE:"IfcThermalResistanceMeasure",IFCTHERMALEXPANSIONCOEFFICIENTMEASURE:"IfcThermalExpansionCoefficientMeasure",IFCTHERMALCONDUCTIVITYMEASURE:"IfcThermalConductivityMeasure",IFCTHERMALADMITTANCEMEASURE:"IfcThermalAdmittanceMeasure",IFCTEXTTRANSFORMATION:"IfcTextTransformation",IFCTEXTFONTNAME:"IfcTextFontName",IFCTEXTDECORATION:"IfcTextDecoration",IFCTEXTALIGNMENT:"IfcTextAlignment",IFCTEXT:"IfcText",IFCTEMPERATUREGRADIENTMEASURE:"IfcTemperatureGradientMeasure",IFCSPECULARROUGHNESS:"IfcSpecularRoughness",IFCSPECULAREXPONENT:"IfcSpecularExponent",IFCSPECIFICHEATCAPACITYMEASURE:"IfcSpecificHeatCapacityMeasure",IFCSOUNDPRESSUREMEASURE:"IfcSoundPressureMeasure",IFCSOUNDPOWERMEASURE:"IfcSoundPowerMeasure",IFCSOLIDANGLEMEASURE:"IfcSolidAngleMeasure",IFCSHEARMODULUSMEASURE:"IfcShearModulusMeasure",IFCSECTIONALAREAINTEGRALMEASURE:"IfcSectionalAreaIntegralMeasure",IFCSECTIONMODULUSMEASURE:"IfcSectionModulusMeasure",IFCSECONDINMINUTE:"IfcSecondInMinute",IFCROTATIONALSTIFFNESSMEASURE:"IfcRotationalStiffnessMeasure",IFCROTATIONALMASSMEASURE:"IfcRotationalMassMeasure",IFCROTATIONALFREQUENCYMEASURE:"IfcRotationalFrequencyMeasure",IFCREAL:"IfcReal",IFCRATIOMEASURE:"IfcRatioMeasure",IFCRADIOACTIVITYMEASURE:"IfcRadioactivityMeasure",IFCPRESSUREMEASURE:"IfcPressureMeasure",IFCPRESENTABLETEXT:"IfcPresentableText",IFCPOWERMEASURE:"IfcPowerMeasure",IFCPOSITIVERATIOMEASURE:"IfcPositiveRatioMeasure",IFCPOSITIVEPLANEANGLEMEASURE:"IfcPositivePlaneAngleMeasure",IFCPOSITIVELENGTHMEASURE:"IfcPositiveLengthMeasure",IFCPLANEANGLEMEASURE:"IfcPlaneAngleMeasure",IFCPLANARFORCEMEASURE:"IfcPlanarForceMeasure",IFCPARAMETERVALUE:"IfcParameterValue",IFCPHMEASURE:"IfcPhMeasure",IFCNUMERICMEASURE:"IfcNumericMeasure",IFCNORMALISEDRATIOMEASURE:"IfcNormalisedRatioMeasure",IFCMONTHINYEARNUMBER:"IfcMonthInYearNumber",IFCMONETARYMEASURE:"IfcMonetaryMeasure",IFCMOMENTOFINERTIAMEASURE:"IfcMomentOfInertiaMeasure",IFCMOLECULARWEIGHTMEASURE:"IfcMolecularWeightMeasure",IFCMOISTUREDIFFUSIVITYMEASURE:"IfcMoistureDiffusivityMeasure",IFCMODULUSOFSUBGRADEREACTIONMEASURE:"IfcModulusOfSubgradeReactionMeasure",IFCMODULUSOFROTATIONALSUBGRADEREACTIONMEASURE:"IfcModulusOfRotationalSubgradeReactionMeasure",IFCMODULUSOFLINEARSUBGRADEREACTIONMEASURE:"IfcModulusOfLinearSubgradeReactionMeasure",IFCMODULUSOFELASTICITYMEASURE:"IfcModulusOfElasticityMeasure",IFCMINUTEINHOUR:"IfcMinuteInHour",IFCMASSPERLENGTHMEASURE:"IfcMassPerLengthMeasure",IFCMASSMEASURE:"IfcMassMeasure",IFCMASSFLOWRATEMEASURE:"IfcMassFlowRateMeasure",IFCMASSDENSITYMEASURE:"IfcMassDensityMeasure",IFCMAGNETICFLUXMEASURE:"IfcMagneticFluxMeasure",IFCMAGNETICFLUXDENSITYMEASURE:"IfcMagneticFluxDensityMeasure",IFCLUMINOUSINTENSITYMEASURE:"IfcLuminousIntensityMeasure",IFCLUMINOUSINTENSITYDISTRIBUTIONMEASURE:"IfcLuminousIntensityDistributionMeasure",IFCLUMINOUSFLUXMEASURE:"IfcLuminousFluxMeasure",IFCLOGICAL:"IfcLogical",IFCLINEARVELOCITYMEASURE:"IfcLinearVelocityMeasure",IFCLINEARSTIFFNESSMEASURE:"IfcLinearStiffnessMeasure",IFCLINEARMOMENTMEASURE:"IfcLinearMomentMeasure",IFCLINEARFORCEMEASURE:"IfcLinearForceMeasure",IFCLENGTHMEASURE:"IfcLengthMeasure",IFCLABEL:"IfcLabel",IFCKINEMATICVISCOSITYMEASURE:"IfcKinematicViscosityMeasure",IFCISOTHERMALMOISTURECAPACITYMEASURE:"IfcIsothermalMoistureCapacityMeasure",IFCIONCONCENTRATIONMEASURE:"IfcIonConcentrationMeasure",IFCINTEGERCOUNTRATEMEASURE:"IfcIntegerCountRateMeasure",IFCINTEGER:"IfcInteger",IFCINDUCTANCEMEASURE:"IfcInductanceMeasure",IFCILLUMINANCEMEASURE:"IfcIlluminanceMeasure",IFCIDENTIFIER:"IfcIdentifier",IFCHOURINDAY:"IfcHourInDay",IFCHEATINGVALUEMEASURE:"IfcHeatingValueMeasure",IFCHEATFLUXDENSITYMEASURE:"IfcHeatFluxDensityMeasure",IFCGLOBALLYUNIQUEID:"IfcGloballyUniqueId",IFCFREQUENCYMEASURE:"IfcFrequencyMeasure",IFCFORCEMEASURE:"IfcForceMeasure",IFCFONTWEIGHT:"IfcFontWeight",IFCFONTVARIANT:"IfcFontVariant",IFCFONTSTYLE:"IfcFontStyle",IFCENERGYMEASURE:"IfcEnergyMeasure",IFCELECTRICVOLTAGEMEASURE:"IfcElectricVoltageMeasure",IFCELECTRICRESISTANCEMEASURE:"IfcElectricResistanceMeasure",IFCELECTRICCURRENTMEASURE:"IfcElectricCurrentMeasure",IFCELECTRICCONDUCTANCEMEASURE:"IfcElectricConductanceMeasure",IFCELECTRICCHARGEMEASURE:"IfcElectricChargeMeasure",IFCELECTRICCAPACITANCEMEASURE:"IfcElectricCapacitanceMeasure",IFCDYNAMICVISCOSITYMEASURE:"IfcDynamicViscosityMeasure",IFCDOSEEQUIVALENTMEASURE:"IfcDoseEquivalentMeasure",IFCDIMENSIONCOUNT:"IfcDimensionCount",IFCDESCRIPTIVEMEASURE:"IfcDescriptiveMeasure",IFCDAYLIGHTSAVINGHOUR:"IfcDaylightSavingHour",IFCDAYINMONTHNUMBER:"IfcDayInMonthNumber",IFCCURVATUREMEASURE:"IfcCurvatureMeasure",IFCCOUNTMEASURE:"IfcCountMeasure",IFCCONTEXTDEPENDENTMEASURE:"IfcContextDependentMeasure",IFCCOMPOUNDPLANEANGLEMEASURE:"IfcCompoundPlaneAngleMeasure",IFCCOMPLEXNUMBER:"IfcComplexNumber",IFCBOXALIGNMENT:"IfcBoxAlignment",IFCBOOLEAN:"IfcBoolean",IFCAREAMEASURE:"IfcAreaMeasure",IFCANGULARVELOCITYMEASURE:"IfcAngularVelocityMeasure",IFCAMOUNTOFSUBSTANCEMEASURE:"IfcAmountOfSubstanceMeasure",IFCACCELERATIONMEASURE:"IfcAccelerationMeasure",IFCABSORBEDDOSEMEASURE:"IfcAbsorbedDoseMeasure",IFCGEOSLICE:"IfcGeoSlice",IFCGEOMODEL:"IfcGeoModel",IFCELECTRICFLOWTREATMENTDEVICE:"IfcElectricFlowTreatmentDevice",IFCDISTRIBUTIONBOARD:"IfcDistributionBoard",IFCCONVEYORSEGMENT:"IfcConveyorSegment",IFCCAISSONFOUNDATION:"IfcCaissonFoundation",IFCBOREHOLE:"IfcBorehole",IFCBEARING:"IfcBearing",IFCALIGNMENT:"IfcAlignment",IFCTRACKELEMENT:"IfcTrackElement",IFCSIGNAL:"IfcSignal",IFCREINFORCEDSOIL:"IfcReinforcedSoil",IFCRAIL:"IfcRail",IFCPAVEMENT:"IfcPavement",IFCNAVIGATIONELEMENT:"IfcNavigationElement",IFCMOORINGDEVICE:"IfcMooringDevice",IFCMOBILETELECOMMUNICATIONSAPPLIANCE:"IfcMobileTelecommunicationsAppliance",IFCLIQUIDTERMINAL:"IfcLiquidTerminal",IFCLINEARPOSITIONINGELEMENT:"IfcLinearPositioningElement",IFCKERB:"IfcKerb",IFCGEOTECHNICALASSEMBLY:"IfcGeotechnicalAssembly",IFCELECTRICFLOWTREATMENTDEVICETYPE:"IfcElectricFlowTreatmentDeviceType",IFCEARTHWORKSFILL:"IfcEarthworksFill",IFCEARTHWORKSELEMENT:"IfcEarthworksElement",IFCEARTHWORKSCUT:"IfcEarthworksCut",IFCDISTRIBUTIONBOARDTYPE:"IfcDistributionBoardType",IFCDEEPFOUNDATION:"IfcDeepFoundation",IFCCOURSE:"IfcCourse",IFCCONVEYORSEGMENTTYPE:"IfcConveyorSegmentType",IFCCAISSONFOUNDATIONTYPE:"IfcCaissonFoundationType",IFCBUILTSYSTEM:"IfcBuiltSystem",IFCBUILTELEMENT:"IfcBuiltElement",IFCBRIDGEPART:"IfcBridgePart",IFCBRIDGE:"IfcBridge",IFCBEARINGTYPE:"IfcBearingType",IFCALIGNMENTVERTICAL:"IfcAlignmentVertical",IFCALIGNMENTSEGMENT:"IfcAlignmentSegment",IFCALIGNMENTHORIZONTAL:"IfcAlignmentHorizontal",IFCALIGNMENTCANT:"IfcAlignmentCant",IFCVIBRATIONDAMPERTYPE:"IfcVibrationDamperType",IFCVIBRATIONDAMPER:"IfcVibrationDamper",IFCVEHICLE:"IfcVehicle",IFCTRANSPORTATIONDEVICE:"IfcTransportationDevice",IFCTRACKELEMENTTYPE:"IfcTrackElementType",IFCTENDONCONDUITTYPE:"IfcTendonConduitType",IFCTENDONCONDUIT:"IfcTendonConduit",IFCSINESPIRAL:"IfcSineSpiral",IFCSIGNALTYPE:"IfcSignalType",IFCSIGNTYPE:"IfcSignType",IFCSIGN:"IfcSign",IFCSEVENTHORDERPOLYNOMIALSPIRAL:"IfcSeventhOrderPolynomialSpiral",IFCSEGMENTEDREFERENCECURVE:"IfcSegmentedReferenceCurve",IFCSECONDORDERPOLYNOMIALSPIRAL:"IfcSecondOrderPolynomialSpiral",IFCROADPART:"IfcRoadPart",IFCROAD:"IfcRoad",IFCRELADHERESTOELEMENT:"IfcRelAdheresToElement",IFCREFERENT:"IfcReferent",IFCRAILWAYPART:"IfcRailwayPart",IFCRAILWAY:"IfcRailway",IFCRAILTYPE:"IfcRailType",IFCPOSITIONINGELEMENT:"IfcPositioningElement",IFCPAVEMENTTYPE:"IfcPavementType",IFCNAVIGATIONELEMENTTYPE:"IfcNavigationElementType",IFCMOORINGDEVICETYPE:"IfcMooringDeviceType",IFCMOBILETELECOMMUNICATIONSAPPLIANCETYPE:"IfcMobileTelecommunicationsApplianceType",IFCMARINEPART:"IfcMarinePart",IFCMARINEFACILITY:"IfcMarineFacility",IFCLIQUIDTERMINALTYPE:"IfcLiquidTerminalType",IFCLINEARELEMENT:"IfcLinearElement",IFCKERBTYPE:"IfcKerbType",IFCIMPACTPROTECTIONDEVICETYPE:"IfcImpactProtectionDeviceType",IFCIMPACTPROTECTIONDEVICE:"IfcImpactProtectionDevice",IFCGRADIENTCURVE:"IfcGradientCurve",IFCGEOTECHNICALSTRATUM:"IfcGeotechnicalStratum",IFCGEOTECHNICALELEMENT:"IfcGeotechnicalElement",IFCFACILITYPARTCOMMON:"IfcFacilityPartCommon",IFCFACILITYPART:"IfcFacilityPart",IFCFACILITY:"IfcFacility",IFCDIRECTRIXDERIVEDREFERENCESWEPTAREASOLID:"IfcDirectrixDerivedReferenceSweptAreaSolid",IFCDEEPFOUNDATIONTYPE:"IfcDeepFoundationType",IFCCOURSETYPE:"IfcCourseType",IFCCOSINESPIRAL:"IfcCosineSpiral",IFCCLOTHOID:"IfcClothoid",IFCBUILTELEMENTTYPE:"IfcBuiltElementType",IFCVEHICLETYPE:"IfcVehicleType",IFCTRIANGULATEDIRREGULARNETWORK:"IfcTriangulatedIrregularNetwork",IFCTRANSPORTATIONDEVICETYPE:"IfcTransportationDeviceType",IFCTHIRDORDERPOLYNOMIALSPIRAL:"IfcThirdOrderPolynomialSpiral",IFCSPIRAL:"IfcSpiral",IFCSECTIONEDSURFACE:"IfcSectionedSurface",IFCSECTIONEDSOLIDHORIZONTAL:"IfcSectionedSolidHorizontal",IFCSECTIONEDSOLID:"IfcSectionedSolid",IFCRELPOSITIONS:"IfcRelPositions",IFCRELASSOCIATESPROFILEDEF:"IfcRelAssociatesProfileDef",IFCPOLYNOMIALCURVE:"IfcPolynomialCurve",IFCOFFSETCURVEBYDISTANCES:"IfcOffsetCurveByDistances",IFCOFFSETCURVE:"IfcOffsetCurve",IFCINDEXEDPOLYGONALTEXTUREMAP:"IfcIndexedPolygonalTextureMap",IFCDIRECTRIXCURVESWEPTAREASOLID:"IfcDirectrixCurveSweptAreaSolid",IFCCURVESEGMENT:"IfcCurveSegment",IFCAXIS2PLACEMENTLINEAR:"IfcAxis2PlacementLinear",IFCSEGMENT:"IfcSegment",IFCPOINTBYDISTANCEEXPRESSION:"IfcPointByDistanceExpression",IFCOPENCROSSPROFILEDEF:"IfcOpenCrossProfileDef",IFCLINEARPLACEMENT:"IfcLinearPlacement",IFCALIGNMENTHORIZONTALSEGMENT:"IfcAlignmentHorizontalSegment",IFCALIGNMENTCANTSEGMENT:"IfcAlignmentCantSegment",IFCTEXTURECOORDINATEINDICESWITHVOIDS:"IfcTextureCoordinateIndicesWithVoids",IFCTEXTURECOORDINATEINDICES:"IfcTextureCoordinateIndices",IFCQUANTITYNUMBER:"IfcQuantityNumber",IFCALIGNMENTVERTICALSEGMENT:"IfcAlignmentVerticalSegment",IFCALIGNMENTPARAMETERSEGMENT:"IfcAlignmentParameterSegment",IFCCONTROLLER:"IfcController",IFCALARM:"IfcAlarm",IFCACTUATOR:"IfcActuator",IFCUNITARYCONTROLELEMENT:"IfcUnitaryControlElement",IFCSENSOR:"IfcSensor",IFCPROTECTIVEDEVICETRIPPINGUNIT:"IfcProtectiveDeviceTrippingUnit",IFCFLOWINSTRUMENT:"IfcFlowInstrument",IFCFIRESUPPRESSIONTERMINAL:"IfcFireSuppressionTerminal",IFCFILTER:"IfcFilter",IFCFAN:"IfcFan",IFCELECTRICTIMECONTROL:"IfcElectricTimeControl",IFCELECTRICMOTOR:"IfcElectricMotor",IFCELECTRICGENERATOR:"IfcElectricGenerator",IFCELECTRICFLOWSTORAGEDEVICE:"IfcElectricFlowStorageDevice",IFCELECTRICDISTRIBUTIONBOARD:"IfcElectricDistributionBoard",IFCELECTRICAPPLIANCE:"IfcElectricAppliance",IFCDUCTSILENCER:"IfcDuctSilencer",IFCDUCTSEGMENT:"IfcDuctSegment",IFCDUCTFITTING:"IfcDuctFitting",IFCDISTRIBUTIONCIRCUIT:"IfcDistributionCircuit",IFCDAMPER:"IfcDamper",IFCCOOLINGTOWER:"IfcCoolingTower",IFCCOOLEDBEAM:"IfcCooledBeam",IFCCONDENSER:"IfcCondenser",IFCCOMPRESSOR:"IfcCompressor",IFCCOMMUNICATIONSAPPLIANCE:"IfcCommunicationsAppliance",IFCCOIL:"IfcCoil",IFCCHILLER:"IfcChiller",IFCCABLESEGMENT:"IfcCableSegment",IFCCABLEFITTING:"IfcCableFitting",IFCCABLECARRIERSEGMENT:"IfcCableCarrierSegment",IFCCABLECARRIERFITTING:"IfcCableCarrierFitting",IFCBURNER:"IfcBurner",IFCBOILER:"IfcBoiler",IFCBEAMSTANDARDCASE:"IfcBeamStandardCase",IFCAUDIOVISUALAPPLIANCE:"IfcAudioVisualAppliance",IFCAIRTOAIRHEATRECOVERY:"IfcAirToAirHeatRecovery",IFCAIRTERMINALBOX:"IfcAirTerminalBox",IFCAIRTERMINAL:"IfcAirTerminal",IFCWINDOWSTANDARDCASE:"IfcWindowStandardCase",IFCWASTETERMINAL:"IfcWasteTerminal",IFCWALLELEMENTEDCASE:"IfcWallElementedCase",IFCVALVE:"IfcValve",IFCUNITARYEQUIPMENT:"IfcUnitaryEquipment",IFCUNITARYCONTROLELEMENTTYPE:"IfcUnitaryControlElementType",IFCTUBEBUNDLE:"IfcTubeBundle",IFCTRANSFORMER:"IfcTransformer",IFCTANK:"IfcTank",IFCSWITCHINGDEVICE:"IfcSwitchingDevice",IFCSTRUCTURALLOADCASE:"IfcStructuralLoadCase",IFCSTACKTERMINAL:"IfcStackTerminal",IFCSPACEHEATER:"IfcSpaceHeater",IFCSOLARDEVICE:"IfcSolarDevice",IFCSLABSTANDARDCASE:"IfcSlabStandardCase",IFCSLABELEMENTEDCASE:"IfcSlabElementedCase",IFCSHADINGDEVICE:"IfcShadingDevice",IFCSANITARYTERMINAL:"IfcSanitaryTerminal",IFCREINFORCINGBARTYPE:"IfcReinforcingBarType",IFCRATIONALBSPLINECURVEWITHKNOTS:"IfcRationalBSplineCurveWithKnots",IFCPUMP:"IfcPump",IFCPROTECTIVEDEVICETRIPPINGUNITTYPE:"IfcProtectiveDeviceTrippingUnitType",IFCPROTECTIVEDEVICE:"IfcProtectiveDevice",IFCPLATESTANDARDCASE:"IfcPlateStandardCase",IFCPIPESEGMENT:"IfcPipeSegment",IFCPIPEFITTING:"IfcPipeFitting",IFCOUTLET:"IfcOutlet",IFCOUTERBOUNDARYCURVE:"IfcOuterBoundaryCurve",IFCMOTORCONNECTION:"IfcMotorConnection",IFCMEMBERSTANDARDCASE:"IfcMemberStandardCase",IFCMEDICALDEVICE:"IfcMedicalDevice",IFCLIGHTFIXTURE:"IfcLightFixture",IFCLAMP:"IfcLamp",IFCJUNCTIONBOX:"IfcJunctionBox",IFCINTERCEPTOR:"IfcInterceptor",IFCHUMIDIFIER:"IfcHumidifier",IFCHEATEXCHANGER:"IfcHeatExchanger",IFCFLOWMETER:"IfcFlowMeter",IFCEXTERNALSPATIALELEMENT:"IfcExternalSpatialElement",IFCEVAPORATOR:"IfcEvaporator",IFCEVAPORATIVECOOLER:"IfcEvaporativeCooler",IFCENGINE:"IfcEngine",IFCELECTRICDISTRIBUTIONBOARDTYPE:"IfcElectricDistributionBoardType",IFCDOORSTANDARDCASE:"IfcDoorStandardCase",IFCDISTRIBUTIONSYSTEM:"IfcDistributionSystem",IFCCOMMUNICATIONSAPPLIANCETYPE:"IfcCommunicationsApplianceType",IFCCOLUMNSTANDARDCASE:"IfcColumnStandardCase",IFCCIVILELEMENT:"IfcCivilElement",IFCCHIMNEY:"IfcChimney",IFCCABLEFITTINGTYPE:"IfcCableFittingType",IFCBURNERTYPE:"IfcBurnerType",IFCBUILDINGSYSTEM:"IfcBuildingSystem",IFCBUILDINGELEMENTPARTTYPE:"IfcBuildingElementPartType",IFCBOUNDARYCURVE:"IfcBoundaryCurve",IFCBSPLINECURVEWITHKNOTS:"IfcBSplineCurveWithKnots",IFCAUDIOVISUALAPPLIANCETYPE:"IfcAudioVisualApplianceType",IFCWORKCALENDAR:"IfcWorkCalendar",IFCWINDOWTYPE:"IfcWindowType",IFCVOIDINGFEATURE:"IfcVoidingFeature",IFCVIBRATIONISOLATOR:"IfcVibrationIsolator",IFCTENDONTYPE:"IfcTendonType",IFCTENDONANCHORTYPE:"IfcTendonAnchorType",IFCSYSTEMFURNITUREELEMENT:"IfcSystemFurnitureElement",IFCSURFACEFEATURE:"IfcSurfaceFeature",IFCSTRUCTURALSURFACEACTION:"IfcStructuralSurfaceAction",IFCSTRUCTURALCURVEREACTION:"IfcStructuralCurveReaction",IFCSTRUCTURALCURVEACTION:"IfcStructuralCurveAction",IFCSTAIRTYPE:"IfcStairType",IFCSOLARDEVICETYPE:"IfcSolarDeviceType",IFCSHADINGDEVICETYPE:"IfcShadingDeviceType",IFCSEAMCURVE:"IfcSeamCurve",IFCROOFTYPE:"IfcRoofType",IFCREINFORCINGMESHTYPE:"IfcReinforcingMeshType",IFCREINFORCINGELEMENTTYPE:"IfcReinforcingElementType",IFCRATIONALBSPLINESURFACEWITHKNOTS:"IfcRationalBSplineSurfaceWithKnots",IFCRAMPTYPE:"IfcRampType",IFCPOLYGONALFACESET:"IfcPolygonalFaceSet",IFCPILETYPE:"IfcPileType",IFCOPENINGSTANDARDCASE:"IfcOpeningStandardCase",IFCMEDICALDEVICETYPE:"IfcMedicalDeviceType",IFCINTERSECTIONCURVE:"IfcIntersectionCurve",IFCINTERCEPTORTYPE:"IfcInterceptorType",IFCINDEXEDPOLYCURVE:"IfcIndexedPolyCurve",IFCGEOGRAPHICELEMENT:"IfcGeographicElement",IFCFURNITURE:"IfcFurniture",IFCFOOTINGTYPE:"IfcFootingType",IFCEXTERNALSPATIALSTRUCTUREELEMENT:"IfcExternalSpatialStructureElement",IFCEVENT:"IfcEvent",IFCENGINETYPE:"IfcEngineType",IFCELEMENTASSEMBLYTYPE:"IfcElementAssemblyType",IFCDOORTYPE:"IfcDoorType",IFCCYLINDRICALSURFACE:"IfcCylindricalSurface",IFCCONSTRUCTIONPRODUCTRESOURCETYPE:"IfcConstructionProductResourceType",IFCCONSTRUCTIONMATERIALRESOURCETYPE:"IfcConstructionMaterialResourceType",IFCCONSTRUCTIONEQUIPMENTRESOURCETYPE:"IfcConstructionEquipmentResourceType",IFCCOMPOSITECURVEONSURFACE:"IfcCompositeCurveOnSurface",IFCCOMPLEXPROPERTYTEMPLATE:"IfcComplexPropertyTemplate",IFCCIVILELEMENTTYPE:"IfcCivilElementType",IFCCHIMNEYTYPE:"IfcChimneyType",IFCBSPLINESURFACEWITHKNOTS:"IfcBSplineSurfaceWithKnots",IFCBSPLINESURFACE:"IfcBSplineSurface",IFCADVANCEDBREPWITHVOIDS:"IfcAdvancedBrepWithVoids",IFCADVANCEDBREP:"IfcAdvancedBrep",IFCTRIANGULATEDFACESET:"IfcTriangulatedFaceSet",IFCTOROIDALSURFACE:"IfcToroidalSurface",IFCTESSELLATEDFACESET:"IfcTessellatedFaceSet",IFCTASKTYPE:"IfcTaskType",IFCSURFACECURVE:"IfcSurfaceCurve",IFCSUBCONTRACTRESOURCETYPE:"IfcSubContractResourceType",IFCSTRUCTURALSURFACEREACTION:"IfcStructuralSurfaceReaction",IFCSPHERICALSURFACE:"IfcSphericalSurface",IFCSPATIALZONETYPE:"IfcSpatialZoneType",IFCSPATIALZONE:"IfcSpatialZone",IFCSPATIALELEMENTTYPE:"IfcSpatialElementType",IFCSPATIALELEMENT:"IfcSpatialElement",IFCSIMPLEPROPERTYTEMPLATE:"IfcSimplePropertyTemplate",IFCREVOLVEDAREASOLIDTAPERED:"IfcRevolvedAreaSolidTapered",IFCREPARAMETRISEDCOMPOSITECURVESEGMENT:"IfcReparametrisedCompositeCurveSegment",IFCRELSPACEBOUNDARY2NDLEVEL:"IfcRelSpaceBoundary2ndLevel",IFCRELSPACEBOUNDARY1STLEVEL:"IfcRelSpaceBoundary1stLevel",IFCRELINTERFERESELEMENTS:"IfcRelInterferesElements",IFCRELDEFINESBYTEMPLATE:"IfcRelDefinesByTemplate",IFCRELDEFINESBYOBJECT:"IfcRelDefinesByObject",IFCRELDECLARES:"IfcRelDeclares",IFCRELASSIGNSTOGROUPBYFACTOR:"IfcRelAssignsToGroupByFactor",IFCPROPERTYTEMPLATE:"IfcPropertyTemplate",IFCPROPERTYSETTEMPLATE:"IfcPropertySetTemplate",IFCPROJECTLIBRARY:"IfcProjectLibrary",IFCPROCEDURETYPE:"IfcProcedureType",IFCPREDEFINEDPROPERTYSET:"IfcPredefinedPropertySet",IFCPCURVE:"IfcPCurve",IFCLABORRESOURCETYPE:"IfcLaborResourceType",IFCINDEXEDPOLYGONALFACEWITHVOIDS:"IfcIndexedPolygonalFaceWithVoids",IFCINDEXEDPOLYGONALFACE:"IfcIndexedPolygonalFace",IFCGEOGRAPHICELEMENTTYPE:"IfcGeographicElementType",IFCFIXEDREFERENCESWEPTAREASOLID:"IfcFixedReferenceSweptAreaSolid",IFCEXTRUDEDAREASOLIDTAPERED:"IfcExtrudedAreaSolidTapered",IFCEVENTTYPE:"IfcEventType",IFCCURVEBOUNDEDSURFACE:"IfcCurveBoundedSurface",IFCCREWRESOURCETYPE:"IfcCrewResourceType",IFCCONTEXT:"IfcContext",IFCCONSTRUCTIONRESOURCETYPE:"IfcConstructionResourceType",IFCCARTESIANPOINTLIST3D:"IfcCartesianPointList3D",IFCCARTESIANPOINTLIST2D:"IfcCartesianPointList2D",IFCCARTESIANPOINTLIST:"IfcCartesianPointList",IFCADVANCEDFACE:"IfcAdvancedFace",IFCTYPERESOURCE:"IfcTypeResource",IFCTYPEPROCESS:"IfcTypeProcess",IFCTESSELLATEDITEM:"IfcTessellatedItem",IFCSWEPTDISKSOLIDPOLYGONAL:"IfcSweptDiskSolidPolygonal",IFCRESOURCETIME:"IfcResourceTime",IFCRESOURCECONSTRAINTRELATIONSHIP:"IfcResourceConstraintRelationship",IFCRESOURCEAPPROVALRELATIONSHIP:"IfcResourceApprovalRelationship",IFCQUANTITYSET:"IfcQuantitySet",IFCPROPERTYTEMPLATEDEFINITION:"IfcPropertyTemplateDefinition",IFCPREDEFINEDPROPERTIES:"IfcPredefinedProperties",IFCMIRROREDPROFILEDEF:"IfcMirroredProfileDef",IFCMATERIALRELATIONSHIP:"IfcMaterialRelationship",IFCMATERIALPROFILESETUSAGETAPERING:"IfcMaterialProfileSetUsageTapering",IFCMATERIALPROFILESETUSAGE:"IfcMaterialProfileSetUsage",IFCMATERIALCONSTITUENTSET:"IfcMaterialConstituentSet",IFCMATERIALCONSTITUENT:"IfcMaterialConstituent",IFCLAGTIME:"IfcLagTime",IFCINDEXEDTRIANGLETEXTUREMAP:"IfcIndexedTriangleTextureMap",IFCINDEXEDTEXTUREMAP:"IfcIndexedTextureMap",IFCINDEXEDCOLOURMAP:"IfcIndexedColourMap",IFCEXTERNALREFERENCERELATIONSHIP:"IfcExternalReferenceRelationship",IFCEXTENDEDPROPERTIES:"IfcExtendedProperties",IFCEVENTTIME:"IfcEventTime",IFCCONVERSIONBASEDUNITWITHOFFSET:"IfcConversionBasedUnitWithOffset",IFCCOLOURRGBLIST:"IfcColourRgbList",IFCWORKTIME:"IfcWorkTime",IFCTIMEPERIOD:"IfcTimePeriod",IFCTEXTUREVERTEXLIST:"IfcTextureVertexList",IFCTASKTIMERECURRING:"IfcTaskTimeRecurring",IFCTASKTIME:"IfcTaskTime",IFCTABLECOLUMN:"IfcTableColumn",IFCSURFACEREINFORCEMENTAREA:"IfcSurfaceReinforcementArea",IFCSTRUCTURALLOADORRESULT:"IfcStructuralLoadOrResult",IFCSTRUCTURALLOADCONFIGURATION:"IfcStructuralLoadConfiguration",IFCSCHEDULINGTIME:"IfcSchedulingTime",IFCRESOURCELEVELRELATIONSHIP:"IfcResourceLevelRelationship",IFCREFERENCE:"IfcReference",IFCRECURRENCEPATTERN:"IfcRecurrencePattern",IFCPROPERTYABSTRACTION:"IfcPropertyAbstraction",IFCPROJECTEDCRS:"IfcProjectedCrs",IFCPRESENTATIONITEM:"IfcPresentationItem",IFCMATERIALUSAGEDEFINITION:"IfcMaterialUsageDefinition",IFCMATERIALPROFILEWITHOFFSETS:"IfcMaterialProfileWithOffsets",IFCMATERIALPROFILESET:"IfcMaterialProfileSet",IFCMATERIALPROFILE:"IfcMaterialProfile",IFCMATERIALLAYERWITHOFFSETS:"IfcMaterialLayerWithOffsets",IFCMATERIALDEFINITION:"IfcMaterialDefinition",IFCMAPCONVERSION:"IfcMapConversion",IFCEXTERNALINFORMATION:"IfcExternalInformation",IFCCOORDINATEREFERENCESYSTEM:"IfcCoordinateReferenceSystem",IFCCOORDINATEOPERATION:"IfcCoordinateOperation",IFCCONNECTIONVOLUMEGEOMETRY:"IfcConnectionVolumeGeometry",IFCREINFORCINGBAR:"IfcReinforcingBar",IFCELECTRICDISTRIBUTIONPOINT:"IfcElectricDistributionPoint",IFCDISTRIBUTIONCONTROLELEMENT:"IfcDistributionControlElement",IFCDISTRIBUTIONCHAMBERELEMENT:"IfcDistributionChamberElement",IFCCONTROLLERTYPE:"IfcControllerType",IFCCHAMFEREDGEFEATURE:"IfcChamferEdgeFeature",IFCBEAM:"IfcBeam",IFCALARMTYPE:"IfcAlarmType",IFCACTUATORTYPE:"IfcActuatorType",IFCWINDOW:"IfcWindow",IFCWALLSTANDARDCASE:"IfcWallStandardCase",IFCWALL:"IfcWall",IFCVIBRATIONISOLATORTYPE:"IfcVibrationIsolatorType",IFCTENDONANCHOR:"IfcTendonAnchor",IFCTENDON:"IfcTendon",IFCSTRUCTURALANALYSISMODEL:"IfcStructuralAnalysisModel",IFCSTAIRFLIGHT:"IfcStairFlight",IFCSTAIR:"IfcStair",IFCSLAB:"IfcSlab",IFCSENSORTYPE:"IfcSensorType",IFCROUNDEDEDGEFEATURE:"IfcRoundedEdgeFeature",IFCROOF:"IfcRoof",IFCREINFORCINGMESH:"IfcReinforcingMesh",IFCREINFORCINGELEMENT:"IfcReinforcingElement",IFCRATIONALBEZIERCURVE:"IfcRationalBezierCurve",IFCRAMPFLIGHT:"IfcRampFlight",IFCRAMP:"IfcRamp",IFCRAILING:"IfcRailing",IFCPLATE:"IfcPlate",IFCPILE:"IfcPile",IFCMEMBER:"IfcMember",IFCFOOTING:"IfcFooting",IFCFLOWTREATMENTDEVICE:"IfcFlowTreatmentDevice",IFCFLOWTERMINAL:"IfcFlowTerminal",IFCFLOWSTORAGEDEVICE:"IfcFlowStorageDevice",IFCFLOWSEGMENT:"IfcFlowSegment",IFCFLOWMOVINGDEVICE:"IfcFlowMovingDevice",IFCFLOWINSTRUMENTTYPE:"IfcFlowInstrumentType",IFCFLOWFITTING:"IfcFlowFitting",IFCFLOWCONTROLLER:"IfcFlowController",IFCFIRESUPPRESSIONTERMINALTYPE:"IfcFireSuppressionTerminalType",IFCFILTERTYPE:"IfcFilterType",IFCFANTYPE:"IfcFanType",IFCENERGYCONVERSIONDEVICE:"IfcEnergyConversionDevice",IFCELECTRICALELEMENT:"IfcElectricalElement",IFCELECTRICALCIRCUIT:"IfcElectricalCircuit",IFCELECTRICTIMECONTROLTYPE:"IfcElectricTimeControlType",IFCELECTRICMOTORTYPE:"IfcElectricMotorType",IFCELECTRICHEATERTYPE:"IfcElectricHeaterType",IFCELECTRICGENERATORTYPE:"IfcElectricGeneratorType",IFCELECTRICFLOWSTORAGEDEVICETYPE:"IfcElectricFlowStorageDeviceType",IFCELECTRICAPPLIANCETYPE:"IfcElectricApplianceType",IFCEDGEFEATURE:"IfcEdgeFeature",IFCDUCTSILENCERTYPE:"IfcDuctSilencerType",IFCDUCTSEGMENTTYPE:"IfcDuctSegmentType",IFCDUCTFITTINGTYPE:"IfcDuctFittingType",IFCDOOR:"IfcDoor",IFCDISTRIBUTIONPORT:"IfcDistributionPort",IFCDISTRIBUTIONFLOWELEMENT:"IfcDistributionFlowElement",IFCDISTRIBUTIONELEMENT:"IfcDistributionElement",IFCDISTRIBUTIONCONTROLELEMENTTYPE:"IfcDistributionControlElementType",IFCDISTRIBUTIONCHAMBERELEMENTTYPE:"IfcDistributionChamberElementType",IFCDISCRETEACCESSORYTYPE:"IfcDiscreteAccessoryType",IFCDISCRETEACCESSORY:"IfcDiscreteAccessory",IFCDIAMETERDIMENSION:"IfcDiameterDimension",IFCDAMPERTYPE:"IfcDamperType",IFCCURTAINWALL:"IfcCurtainWall",IFCCOVERING:"IfcCovering",IFCCOOLINGTOWERTYPE:"IfcCoolingTowerType",IFCCOOLEDBEAMTYPE:"IfcCooledBeamType",IFCCONSTRUCTIONPRODUCTRESOURCE:"IfcConstructionProductResource",IFCCONSTRUCTIONMATERIALRESOURCE:"IfcConstructionMaterialResource",IFCCONSTRUCTIONEQUIPMENTRESOURCE:"IfcConstructionEquipmentResource",IFCCONDITIONCRITERION:"IfcConditionCriterion",IFCCONDITION:"IfcCondition",IFCCONDENSERTYPE:"IfcCondenserType",IFCCOMPRESSORTYPE:"IfcCompressorType",IFCCOLUMN:"IfcColumn",IFCCOILTYPE:"IfcCoilType",IFCCIRCLE:"IfcCircle",IFCCHILLERTYPE:"IfcChillerType",IFCCABLESEGMENTTYPE:"IfcCableSegmentType",IFCCABLECARRIERSEGMENTTYPE:"IfcCableCarrierSegmentType",IFCCABLECARRIERFITTINGTYPE:"IfcCableCarrierFittingType",IFCBUILDINGELEMENTPROXYTYPE:"IfcBuildingElementProxyType",IFCBUILDINGELEMENTPROXY:"IfcBuildingElementProxy",IFCBUILDINGELEMENTPART:"IfcBuildingElementPart",IFCBUILDINGELEMENTCOMPONENT:"IfcBuildingElementComponent",IFCBUILDINGELEMENT:"IfcBuildingElement",IFCBOILERTYPE:"IfcBoilerType",IFCBEZIERCURVE:"IfcBezierCurve",IFCBEAMTYPE:"IfcBeamType",IFCBSPLINECURVE:"IfcBSplineCurve",IFCASSET:"IfcAsset",IFCANGULARDIMENSION:"IfcAngularDimension",IFCAIRTOAIRHEATRECOVERYTYPE:"IfcAirToAirHeatRecoveryType",IFCAIRTERMINALTYPE:"IfcAirTerminalType",IFCAIRTERMINALBOXTYPE:"IfcAirTerminalBoxType",IFCACTIONREQUEST:"IfcActionRequest",IFC2DCOMPOSITECURVE:"Ifc2DCompositeCurve",IFCZONE:"IfcZone",IFCWORKSCHEDULE:"IfcWorkSchedule",IFCWORKPLAN:"IfcWorkPlan",IFCWORKCONTROL:"IfcWorkControl",IFCWASTETERMINALTYPE:"IfcWasteTerminalType",IFCWALLTYPE:"IfcWallType",IFCVIRTUALELEMENT:"IfcVirtualElement",IFCVALVETYPE:"IfcValveType",IFCUNITARYEQUIPMENTTYPE:"IfcUnitaryEquipmentType",IFCTUBEBUNDLETYPE:"IfcTubeBundleType",IFCTRIMMEDCURVE:"IfcTrimmedCurve",IFCTRANSPORTELEMENT:"IfcTransportElement",IFCTRANSFORMERTYPE:"IfcTransformerType",IFCTIMESERIESSCHEDULE:"IfcTimeSeriesSchedule",IFCTANKTYPE:"IfcTankType",IFCSYSTEM:"IfcSystem",IFCSWITCHINGDEVICETYPE:"IfcSwitchingDeviceType",IFCSUBCONTRACTRESOURCE:"IfcSubContractResource",IFCSTRUCTURALSURFACECONNECTION:"IfcStructuralSurfaceConnection",IFCSTRUCTURALRESULTGROUP:"IfcStructuralResultGroup",IFCSTRUCTURALPOINTREACTION:"IfcStructuralPointReaction",IFCSTRUCTURALPOINTCONNECTION:"IfcStructuralPointConnection",IFCSTRUCTURALPOINTACTION:"IfcStructuralPointAction",IFCSTRUCTURALPLANARACTIONVARYING:"IfcStructuralPlanarActionVarying",IFCSTRUCTURALPLANARACTION:"IfcStructuralPlanarAction",IFCSTRUCTURALLOADGROUP:"IfcStructuralLoadGroup",IFCSTRUCTURALLINEARACTIONVARYING:"IfcStructuralLinearActionVarying",IFCSTRUCTURALLINEARACTION:"IfcStructuralLinearAction",IFCSTRUCTURALCURVEMEMBERVARYING:"IfcStructuralCurveMemberVarying",IFCSTRUCTURALCURVEMEMBER:"IfcStructuralCurveMember",IFCSTRUCTURALCURVECONNECTION:"IfcStructuralCurveConnection",IFCSTRUCTURALCONNECTION:"IfcStructuralConnection",IFCSTRUCTURALACTION:"IfcStructuralAction",IFCSTAIRFLIGHTTYPE:"IfcStairFlightType",IFCSTACKTERMINALTYPE:"IfcStackTerminalType",IFCSPACETYPE:"IfcSpaceType",IFCSPACEPROGRAM:"IfcSpaceProgram",IFCSPACEHEATERTYPE:"IfcSpaceHeaterType",IFCSPACE:"IfcSpace",IFCSLABTYPE:"IfcSlabType",IFCSITE:"IfcSite",IFCSERVICELIFE:"IfcServiceLife",IFCSCHEDULETIMECONTROL:"IfcScheduleTimeControl",IFCSANITARYTERMINALTYPE:"IfcSanitaryTerminalType",IFCRELASSIGNSTASKS:"IfcRelAssignsTasks",IFCRELAGGREGATES:"IfcRelAggregates",IFCRAMPFLIGHTTYPE:"IfcRampFlightType",IFCRAILINGTYPE:"IfcRailingType",IFCRADIUSDIMENSION:"IfcRadiusDimension",IFCPUMPTYPE:"IfcPumpType",IFCPROTECTIVEDEVICETYPE:"IfcProtectiveDeviceType",IFCPROJECTIONELEMENT:"IfcProjectionElement",IFCPROJECTORDERRECORD:"IfcProjectOrderRecord",IFCPROJECTORDER:"IfcProjectOrder",IFCPROCEDURE:"IfcProcedure",IFCPORT:"IfcPort",IFCPOLYLINE:"IfcPolyline",IFCPLATETYPE:"IfcPlateType",IFCPIPESEGMENTTYPE:"IfcPipeSegmentType",IFCPIPEFITTINGTYPE:"IfcPipeFittingType",IFCPERMIT:"IfcPermit",IFCPERFORMANCEHISTORY:"IfcPerformanceHistory",IFCOUTLETTYPE:"IfcOutletType",IFCORDERACTION:"IfcOrderAction",IFCOPENINGELEMENT:"IfcOpeningElement",IFCOCCUPANT:"IfcOccupant",IFCMOVE:"IfcMove",IFCMOTORCONNECTIONTYPE:"IfcMotorConnectionType",IFCMEMBERTYPE:"IfcMemberType",IFCMECHANICALFASTENERTYPE:"IfcMechanicalFastenerType",IFCMECHANICALFASTENER:"IfcMechanicalFastener",IFCLINEARDIMENSION:"IfcLinearDimension",IFCLIGHTFIXTURETYPE:"IfcLightFixtureType",IFCLAMPTYPE:"IfcLampType",IFCLABORRESOURCE:"IfcLaborResource",IFCJUNCTIONBOXTYPE:"IfcJunctionBoxType",IFCINVENTORY:"IfcInventory",IFCHUMIDIFIERTYPE:"IfcHumidifierType",IFCHEATEXCHANGERTYPE:"IfcHeatExchangerType",IFCGROUP:"IfcGroup",IFCGRID:"IfcGrid",IFCGASTERMINALTYPE:"IfcGasTerminalType",IFCFURNITURESTANDARD:"IfcFurnitureStandard",IFCFURNISHINGELEMENT:"IfcFurnishingElement",IFCFLOWTREATMENTDEVICETYPE:"IfcFlowTreatmentDeviceType",IFCFLOWTERMINALTYPE:"IfcFlowTerminalType",IFCFLOWSTORAGEDEVICETYPE:"IfcFlowStorageDeviceType",IFCFLOWSEGMENTTYPE:"IfcFlowSegmentType",IFCFLOWMOVINGDEVICETYPE:"IfcFlowMovingDeviceType",IFCFLOWMETERTYPE:"IfcFlowMeterType",IFCFLOWFITTINGTYPE:"IfcFlowFittingType",IFCFLOWCONTROLLERTYPE:"IfcFlowControllerType",IFCFEATUREELEMENTSUBTRACTION:"IfcFeatureElementSubtraction",IFCFEATUREELEMENTADDITION:"IfcFeatureElementAddition",IFCFEATUREELEMENT:"IfcFeatureElement",IFCFASTENERTYPE:"IfcFastenerType",IFCFASTENER:"IfcFastener",IFCFACETEDBREPWITHVOIDS:"IfcFacetedBrepWithVoids",IFCFACETEDBREP:"IfcFacetedBrep",IFCEVAPORATORTYPE:"IfcEvaporatorType",IFCEVAPORATIVECOOLERTYPE:"IfcEvaporativeCoolerType",IFCEQUIPMENTSTANDARD:"IfcEquipmentStandard",IFCEQUIPMENTELEMENT:"IfcEquipmentElement",IFCENERGYCONVERSIONDEVICETYPE:"IfcEnergyConversionDeviceType",IFCELLIPSE:"IfcEllipse",IFCELEMENTCOMPONENTTYPE:"IfcElementComponentType",IFCELEMENTCOMPONENT:"IfcElementComponent",IFCELEMENTASSEMBLY:"IfcElementAssembly",IFCELEMENT:"IfcElement",IFCELECTRICALBASEPROPERTIES:"IfcElectricalBaseProperties",IFCDISTRIBUTIONFLOWELEMENTTYPE:"IfcDistributionFlowElementType",IFCDISTRIBUTIONELEMENTTYPE:"IfcDistributionElementType",IFCDIMENSIONCURVEDIRECTEDCALLOUT:"IfcDimensionCurveDirectedCallout",IFCCURTAINWALLTYPE:"IfcCurtainWallType",IFCCREWRESOURCE:"IfcCrewResource",IFCCOVERINGTYPE:"IfcCoveringType",IFCCOSTSCHEDULE:"IfcCostSchedule",IFCCOSTITEM:"IfcCostItem",IFCCONTROL:"IfcControl",IFCCONSTRUCTIONRESOURCE:"IfcConstructionResource",IFCCONIC:"IfcConic",IFCCOMPOSITECURVE:"IfcCompositeCurve",IFCCOLUMNTYPE:"IfcColumnType",IFCCIRCLEHOLLOWPROFILEDEF:"IfcCircleHollowProfileDef",IFCBUILDINGSTOREY:"IfcBuildingStorey",IFCBUILDINGELEMENTTYPE:"IfcBuildingElementType",IFCBUILDING:"IfcBuilding",IFCBOUNDEDCURVE:"IfcBoundedCurve",IFCBOOLEANCLIPPINGRESULT:"IfcBooleanClippingResult",IFCBLOCK:"IfcBlock",IFCASYMMETRICISHAPEPROFILEDEF:"IfcAsymmetricIShapeProfileDef",IFCANNOTATION:"IfcAnnotation",IFCACTOR:"IfcActor",IFCTRANSPORTELEMENTTYPE:"IfcTransportElementType",IFCTASK:"IfcTask",IFCSYSTEMFURNITUREELEMENTTYPE:"IfcSystemFurnitureElementType",IFCSURFACEOFREVOLUTION:"IfcSurfaceOfRevolution",IFCSURFACEOFLINEAREXTRUSION:"IfcSurfaceOfLinearExtrusion",IFCSURFACECURVESWEPTAREASOLID:"IfcSurfaceCurveSweptAreaSolid",IFCSTRUCTUREDDIMENSIONCALLOUT:"IfcStructuredDimensionCallout",IFCSTRUCTURALSURFACEMEMBERVARYING:"IfcStructuralSurfaceMemberVarying",IFCSTRUCTURALSURFACEMEMBER:"IfcStructuralSurfaceMember",IFCSTRUCTURALREACTION:"IfcStructuralReaction",IFCSTRUCTURALMEMBER:"IfcStructuralMember",IFCSTRUCTURALITEM:"IfcStructuralItem",IFCSTRUCTURALACTIVITY:"IfcStructuralActivity",IFCSPHERE:"IfcSphere",IFCSPATIALSTRUCTUREELEMENTTYPE:"IfcSpatialStructureElementType",IFCSPATIALSTRUCTUREELEMENT:"IfcSpatialStructureElement",IFCRIGHTCIRCULARCYLINDER:"IfcRightCircularCylinder",IFCRIGHTCIRCULARCONE:"IfcRightCircularCone",IFCREVOLVEDAREASOLID:"IfcRevolvedAreaSolid",IFCRESOURCE:"IfcResource",IFCRELVOIDSELEMENT:"IfcRelVoidsElement",IFCRELSPACEBOUNDARY:"IfcRelSpaceBoundary",IFCRELSERVICESBUILDINGS:"IfcRelServicesBuildings",IFCRELSEQUENCE:"IfcRelSequence",IFCRELSCHEDULESCOSTITEMS:"IfcRelSchedulesCostItems",IFCRELREFERENCEDINSPATIALSTRUCTURE:"IfcRelReferencedInSpatialStructure",IFCRELPROJECTSELEMENT:"IfcRelProjectsElement",IFCRELOVERRIDESPROPERTIES:"IfcRelOverridesProperties",IFCRELOCCUPIESSPACES:"IfcRelOccupiesSpaces",IFCRELNESTS:"IfcRelNests",IFCRELINTERACTIONREQUIREMENTS:"IfcRelInteractionRequirements",IFCRELFLOWCONTROLELEMENTS:"IfcRelFlowControlElements",IFCRELFILLSELEMENT:"IfcRelFillsElement",IFCRELDEFINESBYTYPE:"IfcRelDefinesByType",IFCRELDEFINESBYPROPERTIES:"IfcRelDefinesByProperties",IFCRELDEFINES:"IfcRelDefines",IFCRELDECOMPOSES:"IfcRelDecomposes",IFCRELCOVERSSPACES:"IfcRelCoversSpaces",IFCRELCOVERSBLDGELEMENTS:"IfcRelCoversBldgElements",IFCRELCONTAINEDINSPATIALSTRUCTURE:"IfcRelContainedInSpatialStructure",IFCRELCONNECTSWITHREALIZINGELEMENTS:"IfcRelConnectsWithRealizingElements",IFCRELCONNECTSWITHECCENTRICITY:"IfcRelConnectsWithEccentricity",IFCRELCONNECTSSTRUCTURALMEMBER:"IfcRelConnectsStructuralMember",IFCRELCONNECTSSTRUCTURALELEMENT:"IfcRelConnectsStructuralElement",IFCRELCONNECTSSTRUCTURALACTIVITY:"IfcRelConnectsStructuralActivity",IFCRELCONNECTSPORTS:"IfcRelConnectsPorts",IFCRELCONNECTSPORTTOELEMENT:"IfcRelConnectsPortToElement",IFCRELCONNECTSPATHELEMENTS:"IfcRelConnectsPathElements",IFCRELCONNECTSELEMENTS:"IfcRelConnectsElements",IFCRELCONNECTS:"IfcRelConnects",IFCRELASSOCIATESPROFILEPROPERTIES:"IfcRelAssociatesProfileProperties",IFCRELASSOCIATESMATERIAL:"IfcRelAssociatesMaterial",IFCRELASSOCIATESLIBRARY:"IfcRelAssociatesLibrary",IFCRELASSOCIATESDOCUMENT:"IfcRelAssociatesDocument",IFCRELASSOCIATESCONSTRAINT:"IfcRelAssociatesConstraint",IFCRELASSOCIATESCLASSIFICATION:"IfcRelAssociatesClassification",IFCRELASSOCIATESAPPROVAL:"IfcRelAssociatesApproval",IFCRELASSOCIATESAPPLIEDVALUE:"IfcRelAssociatesAppliedValue",IFCRELASSOCIATES:"IfcRelAssociates",IFCRELASSIGNSTORESOURCE:"IfcRelAssignsToResource",IFCRELASSIGNSTOPROJECTORDER:"IfcRelAssignsToProjectOrder",IFCRELASSIGNSTOPRODUCT:"IfcRelAssignsToProduct",IFCRELASSIGNSTOPROCESS:"IfcRelAssignsToProcess",IFCRELASSIGNSTOGROUP:"IfcRelAssignsToGroup",IFCRELASSIGNSTOCONTROL:"IfcRelAssignsToControl",IFCRELASSIGNSTOACTOR:"IfcRelAssignsToActor",IFCRELASSIGNS:"IfcRelAssigns",IFCRECTANGULARTRIMMEDSURFACE:"IfcRectangularTrimmedSurface",IFCRECTANGULARPYRAMID:"IfcRectangularPyramid",IFCRECTANGLEHOLLOWPROFILEDEF:"IfcRectangleHollowProfileDef",IFCPROXY:"IfcProxy",IFCPROPERTYSET:"IfcPropertySet",IFCPROJECTIONCURVE:"IfcProjectionCurve",IFCPROJECT:"IfcProject",IFCPRODUCT:"IfcProduct",IFCPROCESS:"IfcProcess",IFCPLANE:"IfcPlane",IFCPLANARBOX:"IfcPlanarBox",IFCPERMEABLECOVERINGPROPERTIES:"IfcPermeableCoveringProperties",IFCOFFSETCURVE3D:"IfcOffsetCurve3D",IFCOFFSETCURVE2D:"IfcOffsetCurve2D",IFCOBJECT:"IfcObject",IFCMANIFOLDSOLIDBREP:"IfcManifoldSolidBrep",IFCLINE:"IfcLine",IFCLSHAPEPROFILEDEF:"IfcLShapeProfileDef",IFCISHAPEPROFILEDEF:"IfcIShapeProfileDef",IFCGEOMETRICCURVESET:"IfcGeometricCurveSet",IFCFURNITURETYPE:"IfcFurnitureType",IFCFURNISHINGELEMENTTYPE:"IfcFurnishingElementType",IFCFLUIDFLOWPROPERTIES:"IfcFluidFlowProperties",IFCFILLAREASTYLETILES:"IfcFillAreaStyleTiles",IFCFILLAREASTYLETILESYMBOLWITHSTYLE:"IfcFillAreaStyleTileSymbolWithStyle",IFCFILLAREASTYLEHATCHING:"IfcFillAreaStyleHatching",IFCFACEBASEDSURFACEMODEL:"IfcFaceBasedSurfaceModel",IFCEXTRUDEDAREASOLID:"IfcExtrudedAreaSolid",IFCENERGYPROPERTIES:"IfcEnergyProperties",IFCELLIPSEPROFILEDEF:"IfcEllipseProfileDef",IFCELEMENTARYSURFACE:"IfcElementarySurface",IFCELEMENTTYPE:"IfcElementType",IFCELEMENTQUANTITY:"IfcElementQuantity",IFCEDGELOOP:"IfcEdgeLoop",IFCDRAUGHTINGPREDEFINEDCURVEFONT:"IfcDraughtingPredefinedCurveFont",IFCDRAUGHTINGPREDEFINEDCOLOUR:"IfcDraughtingPredefinedColour",IFCDRAUGHTINGCALLOUT:"IfcDraughtingCallout",IFCDOORSTYLE:"IfcDoorStyle",IFCDOORPANELPROPERTIES:"IfcDoorPanelProperties",IFCDOORLININGPROPERTIES:"IfcDoorLiningProperties",IFCDIRECTION:"IfcDirection",IFCDIMENSIONCURVETERMINATOR:"IfcDimensionCurveTerminator",IFCDIMENSIONCURVE:"IfcDimensionCurve",IFCDEFINEDSYMBOL:"IfcDefinedSymbol",IFCCURVEBOUNDEDPLANE:"IfcCurveBoundedPlane",IFCCURVE:"IfcCurve",IFCCSGSOLID:"IfcCsgSolid",IFCCSGPRIMITIVE3D:"IfcCsgPrimitive3D",IFCCRANERAILFSHAPEPROFILEDEF:"IfcCraneRailFShapeProfileDef",IFCCRANERAILASHAPEPROFILEDEF:"IfcCraneRailAShapeProfileDef",IFCCOMPOSITECURVESEGMENT:"IfcCompositeCurveSegment",IFCCLOSEDSHELL:"IfcClosedShell",IFCCIRCLEPROFILEDEF:"IfcCircleProfileDef",IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM:"IfcCartesianTransformationOperator3DNonUniform",IFCCARTESIANTRANSFORMATIONOPERATOR3D:"IfcCartesianTransformationOperator3D",IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM:"IfcCartesianTransformationOperator2DNonUniform",IFCCARTESIANTRANSFORMATIONOPERATOR2D:"IfcCartesianTransformationOperator2D",IFCCARTESIANTRANSFORMATIONOPERATOR:"IfcCartesianTransformationOperator",IFCCARTESIANPOINT:"IfcCartesianPoint",IFCCSHAPEPROFILEDEF:"IfcCShapeProfileDef",IFCBOXEDHALFSPACE:"IfcBoxedHalfSpace",IFCBOUNDINGBOX:"IfcBoundingBox",IFCBOUNDEDSURFACE:"IfcBoundedSurface",IFCBOOLEANRESULT:"IfcBooleanResult",IFCAXIS2PLACEMENT3D:"IfcAxis2Placement3D",IFCAXIS2PLACEMENT2D:"IfcAxis2Placement2D",IFCAXIS1PLACEMENT:"IfcAxis1Placement",IFCANNOTATIONSURFACE:"IfcAnnotationSurface",IFCANNOTATIONFILLAREAOCCURRENCE:"IfcAnnotationFillAreaOccurrence",IFCANNOTATIONFILLAREA:"IfcAnnotationFillArea",IFCANNOTATIONCURVEOCCURRENCE:"IfcAnnotationCurveOccurrence",IFCZSHAPEPROFILEDEF:"IfcZShapeProfileDef",IFCWINDOWSTYLE:"IfcWindowStyle",IFCWINDOWPANELPROPERTIES:"IfcWindowPanelProperties",IFCWINDOWLININGPROPERTIES:"IfcWindowLiningProperties",IFCVERTEXLOOP:"IfcVertexLoop",IFCVECTOR:"IfcVector",IFCUSHAPEPROFILEDEF:"IfcUShapeProfileDef",IFCTYPEPRODUCT:"IfcTypeProduct",IFCTYPEOBJECT:"IfcTypeObject",IFCTWODIRECTIONREPEATFACTOR:"IfcTwoDirectionRepeatFactor",IFCTRAPEZIUMPROFILEDEF:"IfcTrapeziumProfileDef",IFCTEXTLITERALWITHEXTENT:"IfcTextLiteralWithExtent",IFCTEXTLITERAL:"IfcTextLiteral",IFCTERMINATORSYMBOL:"IfcTerminatorSymbol",IFCTSHAPEPROFILEDEF:"IfcTShapeProfileDef",IFCSWEPTSURFACE:"IfcSweptSurface",IFCSWEPTDISKSOLID:"IfcSweptDiskSolid",IFCSWEPTAREASOLID:"IfcSweptAreaSolid",IFCSURFACESTYLERENDERING:"IfcSurfaceStyleRendering",IFCSURFACE:"IfcSurface",IFCSUBEDGE:"IfcSubedge",IFCSTRUCTURALSTEELPROFILEPROPERTIES:"IfcStructuralSteelProfileProperties",IFCSTRUCTURALPROFILEPROPERTIES:"IfcStructuralProfileProperties",IFCSTRUCTURALLOADSINGLEFORCEWARPING:"IfcStructuralLoadSingleForceWarping",IFCSTRUCTURALLOADSINGLEFORCE:"IfcStructuralLoadSingleForce",IFCSTRUCTURALLOADSINGLEDISPLACEMENTDISTORTION:"IfcStructuralLoadSingleDisplacementDistortion",IFCSTRUCTURALLOADSINGLEDISPLACEMENT:"IfcStructuralLoadSingleDisplacement",IFCSTRUCTURALLOADPLANARFORCE:"IfcStructuralLoadPlanarForce",IFCSTRUCTURALLOADLINEARFORCE:"IfcStructuralLoadLinearForce",IFCSPACETHERMALLOADPROPERTIES:"IfcSpaceThermalLoadProperties",IFCSOUNDVALUE:"IfcSoundValue",IFCSOUNDPROPERTIES:"IfcSoundProperties",IFCSOLIDMODEL:"IfcSolidModel",IFCSLIPPAGECONNECTIONCONDITION:"IfcSlippageConnectionCondition",IFCSHELLBASEDSURFACEMODEL:"IfcShellBasedSurfaceModel",IFCSERVICELIFEFACTOR:"IfcServiceLifeFactor",IFCSECTIONEDSPINE:"IfcSectionedSpine",IFCROUNDEDRECTANGLEPROFILEDEF:"IfcRoundedRectangleProfileDef",IFCRELATIONSHIP:"IfcRelationship",IFCREINFORCEMENTDEFINITIONPROPERTIES:"IfcReinforcementDefinitionProperties",IFCREGULARTIMESERIES:"IfcRegularTimeSeries",IFCRECTANGLEPROFILEDEF:"IfcRectangleProfileDef",IFCPROPERTYTABLEVALUE:"IfcPropertyTableValue",IFCPROPERTYSINGLEVALUE:"IfcPropertySingleValue",IFCPROPERTYSETDEFINITION:"IfcPropertySetDefinition",IFCPROPERTYREFERENCEVALUE:"IfcPropertyReferenceValue",IFCPROPERTYLISTVALUE:"IfcPropertyListValue",IFCPROPERTYENUMERATEDVALUE:"IfcPropertyEnumeratedValue",IFCPROPERTYDEFINITION:"IfcPropertyDefinition",IFCPROPERTYBOUNDEDVALUE:"IfcPropertyBoundedValue",IFCPRODUCTDEFINITIONSHAPE:"IfcProductDefinitionShape",IFCPREDEFINEDPOINTMARKERSYMBOL:"IfcPredefinedPointMarkerSymbol",IFCPREDEFINEDDIMENSIONSYMBOL:"IfcPredefinedDimensionSymbol",IFCPREDEFINEDCURVEFONT:"IfcPredefinedCurveFont",IFCPREDEFINEDCOLOUR:"IfcPredefinedColour",IFCPOLYGONALBOUNDEDHALFSPACE:"IfcPolygonalBoundedHalfSpace",IFCPOLYLOOP:"IfcPolyLoop",IFCPOINTONSURFACE:"IfcPointOnSurface",IFCPOINTONCURVE:"IfcPointOnCurve",IFCPOINT:"IfcPoint",IFCPLANAREXTENT:"IfcPlanarExtent",IFCPLACEMENT:"IfcPlacement",IFCPIXELTEXTURE:"IfcPixelTexture",IFCPHYSICALCOMPLEXQUANTITY:"IfcPhysicalComplexQuantity",IFCPATH:"IfcPath",IFCPARAMETERIZEDPROFILEDEF:"IfcParameterizedProfileDef",IFCORIENTEDEDGE:"IfcOrientedEdge",IFCOPENSHELL:"IfcOpenShell",IFCONEDIRECTIONREPEATFACTOR:"IfcOneDirectionRepeatFactor",IFCOBJECTDEFINITION:"IfcObjectDefinition",IFCMECHANICALCONCRETEMATERIALPROPERTIES:"IfcMechanicalConcreteMaterialProperties",IFCMATERIALDEFINITIONREPRESENTATION:"IfcMaterialDefinitionRepresentation",IFCMAPPEDITEM:"IfcMappedItem",IFCLOOP:"IfcLoop",IFCLOCALPLACEMENT:"IfcLocalPlacement",IFCLIGHTSOURCESPOT:"IfcLightSourceSpot",IFCLIGHTSOURCEPOSITIONAL:"IfcLightSourcePositional",IFCLIGHTSOURCEGONIOMETRIC:"IfcLightSourceGoniometric",IFCLIGHTSOURCEDIRECTIONAL:"IfcLightSourceDirectional",IFCLIGHTSOURCEAMBIENT:"IfcLightSourceAmbient",IFCLIGHTSOURCE:"IfcLightSource",IFCIRREGULARTIMESERIES:"IfcIrregularTimeSeries",IFCIMAGETEXTURE:"IfcImageTexture",IFCHYGROSCOPICMATERIALPROPERTIES:"IfcHygroscopicMaterialProperties",IFCHALFSPACESOLID:"IfcHalfSpaceSolid",IFCGRIDPLACEMENT:"IfcGridPlacement",IFCGEOMETRICSET:"IfcGeometricSet",IFCGEOMETRICREPRESENTATIONSUBCONTEXT:"IfcGeometricRepresentationSubContext",IFCGEOMETRICREPRESENTATIONITEM:"IfcGeometricRepresentationItem",IFCGEOMETRICREPRESENTATIONCONTEXT:"IfcGeometricRepresentationContext",IFCGENERALPROFILEPROPERTIES:"IfcGeneralProfileProperties",IFCGENERALMATERIALPROPERTIES:"IfcGeneralMaterialProperties",IFCFUELPROPERTIES:"IfcFuelProperties",IFCFILLAREASTYLE:"IfcFillAreaStyle",IFCFAILURECONNECTIONCONDITION:"IfcFailureConnectionCondition",IFCFACESURFACE:"IfcFaceSurface",IFCFACEOUTERBOUND:"IfcFaceOuterBound",IFCFACEBOUND:"IfcFaceBound",IFCFACE:"IfcFace",IFCEXTENDEDMATERIALPROPERTIES:"IfcExtendedMaterialProperties",IFCEDGECURVE:"IfcEdgeCurve",IFCEDGE:"IfcEdge",IFCDRAUGHTINGPREDEFINEDTEXTFONT:"IfcDraughtingPredefinedTextFont",IFCDOCUMENTREFERENCE:"IfcDocumentReference",IFCDIMENSIONPAIR:"IfcDimensionPair",IFCDIMENSIONCALLOUTRELATIONSHIP:"IfcDimensionCalloutRelationship",IFCDERIVEDPROFILEDEF:"IfcDerivedProfileDef",IFCCURVESTYLE:"IfcCurveStyle",IFCCONVERSIONBASEDUNIT:"IfcConversionBasedUnit",IFCCONTEXTDEPENDENTUNIT:"IfcContextDependentUnit",IFCCONNECTIONPOINTECCENTRICITY:"IfcConnectionPointEccentricity",IFCCONNECTIONCURVEGEOMETRY:"IfcConnectionCurveGeometry",IFCCONNECTEDFACESET:"IfcConnectedFaceSet",IFCCOMPOSITEPROFILEDEF:"IfcCompositeProfileDef",IFCCOMPLEXPROPERTY:"IfcComplexProperty",IFCCOLOURRGB:"IfcColourRgb",IFCCLASSIFICATIONREFERENCE:"IfcClassificationReference",IFCCENTERLINEPROFILEDEF:"IfcCenterLineProfileDef",IFCBLOBTEXTURE:"IfcBlobTexture",IFCARBITRARYPROFILEDEFWITHVOIDS:"IfcArbitraryProfileDefWithVoids",IFCARBITRARYOPENPROFILEDEF:"IfcArbitraryOpenProfileDef",IFCARBITRARYCLOSEDPROFILEDEF:"IfcArbitraryClosedProfileDef",IFCANNOTATIONTEXTOCCURRENCE:"IfcAnnotationTextOccurrence",IFCANNOTATIONSYMBOLOCCURRENCE:"IfcAnnotationSymbolOccurrence",IFCANNOTATIONSURFACEOCCURRENCE:"IfcAnnotationSurfaceOccurrence",IFCANNOTATIONOCCURRENCE:"IfcAnnotationOccurrence",IFCWATERPROPERTIES:"IfcWaterProperties",IFCVIRTUALGRIDINTERSECTION:"IfcVirtualGridIntersection",IFCVERTEXPOINT:"IfcVertexPoint",IFCVERTEXBASEDTEXTUREMAP:"IfcVertexBasedTextureMap",IFCVERTEX:"IfcVertex",IFCUNITASSIGNMENT:"IfcUnitAssignment",IFCTOPOLOGYREPRESENTATION:"IfcTopologyRepresentation",IFCTOPOLOGICALREPRESENTATIONITEM:"IfcTopologicalRepresentationItem",IFCTIMESERIESVALUE:"IfcTimeSeriesValue",IFCTIMESERIESREFERENCERELATIONSHIP:"IfcTimeSeriesReferenceRelationship",IFCTIMESERIES:"IfcTimeSeries",IFCTHERMALMATERIALPROPERTIES:"IfcThermalMaterialProperties",IFCTEXTUREVERTEX:"IfcTextureVertex",IFCTEXTUREMAP:"IfcTextureMap",IFCTEXTURECOORDINATEGENERATOR:"IfcTextureCoordinateGenerator",IFCTEXTURECOORDINATE:"IfcTextureCoordinate",IFCTEXTSTYLEWITHBOXCHARACTERISTICS:"IfcTextStyleWithBoxCharacteristics",IFCTEXTSTYLETEXTMODEL:"IfcTextStyleTextModel",IFCTEXTSTYLEFORDEFINEDFONT:"IfcTextStyleForDefinedFont",IFCTEXTSTYLEFONTMODEL:"IfcTextStyleFontModel",IFCTEXTSTYLE:"IfcTextStyle",IFCTELECOMADDRESS:"IfcTelecomAddress",IFCTABLEROW:"IfcTableRow",IFCTABLE:"IfcTable",IFCSYMBOLSTYLE:"IfcSymbolStyle",IFCSURFACETEXTURE:"IfcSurfaceTexture",IFCSURFACESTYLEWITHTEXTURES:"IfcSurfaceStyleWithTextures",IFCSURFACESTYLESHADING:"IfcSurfaceStyleShading",IFCSURFACESTYLEREFRACTION:"IfcSurfaceStyleRefraction",IFCSURFACESTYLELIGHTING:"IfcSurfaceStyleLighting",IFCSURFACESTYLE:"IfcSurfaceStyle",IFCSTYLEDREPRESENTATION:"IfcStyledRepresentation",IFCSTYLEDITEM:"IfcStyledItem",IFCSTYLEMODEL:"IfcStyleModel",IFCSTRUCTURALLOADTEMPERATURE:"IfcStructuralLoadTemperature",IFCSTRUCTURALLOADSTATIC:"IfcStructuralLoadStatic",IFCSTRUCTURALLOAD:"IfcStructuralLoad",IFCSTRUCTURALCONNECTIONCONDITION:"IfcStructuralConnectionCondition",IFCSIMPLEPROPERTY:"IfcSimpleProperty",IFCSHAPEREPRESENTATION:"IfcShapeRepresentation",IFCSHAPEMODEL:"IfcShapeModel",IFCSHAPEASPECT:"IfcShapeAspect",IFCSECTIONREINFORCEMENTPROPERTIES:"IfcSectionReinforcementProperties",IFCSECTIONPROPERTIES:"IfcSectionProperties",IFCSIUNIT:"IfcSIUnit",IFCROOT:"IfcRoot",IFCRIBPLATEPROFILEPROPERTIES:"IfcRibPlateProfileProperties",IFCREPRESENTATIONMAP:"IfcRepresentationMap",IFCREPRESENTATIONITEM:"IfcRepresentationItem",IFCREPRESENTATIONCONTEXT:"IfcRepresentationContext",IFCREPRESENTATION:"IfcRepresentation",IFCRELAXATION:"IfcRelaxation",IFCREINFORCEMENTBARPROPERTIES:"IfcReinforcementBarProperties",IFCREFERENCESVALUEDOCUMENT:"IfcReferencesValueDocument",IFCQUANTITYWEIGHT:"IfcQuantityWeight",IFCQUANTITYVOLUME:"IfcQuantityVolume",IFCQUANTITYTIME:"IfcQuantityTime",IFCQUANTITYLENGTH:"IfcQuantityLength",IFCQUANTITYCOUNT:"IfcQuantityCount",IFCQUANTITYAREA:"IfcQuantityArea",IFCPROPERTYENUMERATION:"IfcPropertyEnumeration",IFCPROPERTYDEPENDENCYRELATIONSHIP:"IfcPropertyDependencyRelationship",IFCPROPERTYCONSTRAINTRELATIONSHIP:"IfcPropertyConstraintRelationship",IFCPROPERTY:"IfcProperty",IFCPROFILEPROPERTIES:"IfcProfileProperties",IFCPROFILEDEF:"IfcProfileDef",IFCPRODUCTSOFCOMBUSTIONPROPERTIES:"IfcProductsOfCombustionProperties",IFCPRODUCTREPRESENTATION:"IfcProductRepresentation",IFCPRESENTATIONSTYLEASSIGNMENT:"IfcPresentationStyleAssignment",IFCPRESENTATIONSTYLE:"IfcPresentationStyle",IFCPRESENTATIONLAYERWITHSTYLE:"IfcPresentationLayerWithStyle",IFCPRESENTATIONLAYERASSIGNMENT:"IfcPresentationLayerAssignment",IFCPREDEFINEDTEXTFONT:"IfcPredefinedTextFont",IFCPREDEFINEDTERMINATORSYMBOL:"IfcPredefinedTerminatorSymbol",IFCPREDEFINEDSYMBOL:"IfcPredefinedSymbol",IFCPREDEFINEDITEM:"IfcPredefinedItem",IFCPOSTALADDRESS:"IfcPostalAddress",IFCPHYSICALSIMPLEQUANTITY:"IfcPhysicalSimpleQuantity",IFCPHYSICALQUANTITY:"IfcPhysicalQuantity",IFCPERSONANDORGANIZATION:"IfcPersonAndOrganization",IFCPERSON:"IfcPerson",IFCOWNERHISTORY:"IfcOwnerHistory",IFCORGANIZATIONRELATIONSHIP:"IfcOrganizationRelationship",IFCORGANIZATION:"IfcOrganization",IFCOPTICALMATERIALPROPERTIES:"IfcOpticalMaterialProperties",IFCOBJECTIVE:"IfcObjective",IFCOBJECTPLACEMENT:"IfcObjectPlacement",IFCNAMEDUNIT:"IfcNamedUnit",IFCMONETARYUNIT:"IfcMonetaryUnit",IFCMETRIC:"IfcMetric",IFCMECHANICALSTEELMATERIALPROPERTIES:"IfcMechanicalSteelMaterialProperties",IFCMECHANICALMATERIALPROPERTIES:"IfcMechanicalMaterialProperties",IFCMEASUREWITHUNIT:"IfcMeasureWithUnit",IFCMATERIALPROPERTIES:"IfcMaterialProperties",IFCMATERIALLIST:"IfcMaterialList",IFCMATERIALLAYERSETUSAGE:"IfcMaterialLayerSetUsage",IFCMATERIALLAYERSET:"IfcMaterialLayerSet",IFCMATERIALLAYER:"IfcMaterialLayer",IFCMATERIALCLASSIFICATIONRELATIONSHIP:"IfcMaterialClassificationRelationship",IFCMATERIAL:"IfcMaterial",IFCLOCALTIME:"IfcLocalTime",IFCLIGHTINTENSITYDISTRIBUTION:"IfcLightIntensityDistribution",IFCLIGHTDISTRIBUTIONDATA:"IfcLightDistributionData",IFCLIBRARYREFERENCE:"IfcLibraryReference",IFCLIBRARYINFORMATION:"IfcLibraryInformation",IFCIRREGULARTIMESERIESVALUE:"IfcIrregularTimeSeriesValue",IFCGRIDAXIS:"IfcGridAxis",IFCEXTERNALLYDEFINEDTEXTFONT:"IfcExternallyDefinedTextFont",IFCEXTERNALLYDEFINEDSYMBOL:"IfcExternallyDefinedSymbol",IFCEXTERNALLYDEFINEDSURFACESTYLE:"IfcExternallyDefinedSurfaceStyle",IFCEXTERNALLYDEFINEDHATCHSTYLE:"IfcExternallyDefinedHatchStyle",IFCEXTERNALREFERENCE:"IfcExternalReference",IFCENVIRONMENTALIMPACTVALUE:"IfcEnvironmentalImpactValue",IFCDRAUGHTINGCALLOUTRELATIONSHIP:"IfcDraughtingCalloutRelationship",IFCDOCUMENTINFORMATIONRELATIONSHIP:"IfcDocumentInformationRelationship",IFCDOCUMENTINFORMATION:"IfcDocumentInformation",IFCDOCUMENTELECTRONICFORMAT:"IfcDocumentElectronicFormat",IFCDIMENSIONALEXPONENTS:"IfcDimensionalExponents",IFCDERIVEDUNITELEMENT:"IfcDerivedUnitElement",IFCDERIVEDUNIT:"IfcDerivedUnit",IFCDATEANDTIME:"IfcDateAndTime",IFCCURVESTYLEFONTPATTERN:"IfcCurveStyleFontPattern",IFCCURVESTYLEFONTANDSCALING:"IfcCurveStyleFontAndScaling",IFCCURVESTYLEFONT:"IfcCurveStyleFont",IFCCURRENCYRELATIONSHIP:"IfcCurrencyRelationship",IFCCOSTVALUE:"IfcCostValue",IFCCOORDINATEDUNIVERSALTIMEOFFSET:"IfcCoordinatedUniversalTimeOffset",IFCCONSTRAINTRELATIONSHIP:"IfcConstraintRelationship",IFCCONSTRAINTCLASSIFICATIONRELATIONSHIP:"IfcConstraintClassificationRelationship",IFCCONSTRAINTAGGREGATIONRELATIONSHIP:"IfcConstraintAggregationRelationship",IFCCONSTRAINT:"IfcConstraint",IFCCONNECTIONSURFACEGEOMETRY:"IfcConnectionSurfaceGeometry",IFCCONNECTIONPORTGEOMETRY:"IfcConnectionPortGeometry",IFCCONNECTIONPOINTGEOMETRY:"IfcConnectionPointGeometry",IFCCONNECTIONGEOMETRY:"IfcConnectionGeometry",IFCCOLOURSPECIFICATION:"IfcColourSpecification",IFCCLASSIFICATIONNOTATIONFACET:"IfcClassificationNotationFacet",IFCCLASSIFICATIONNOTATION:"IfcClassificationNotation",IFCCLASSIFICATIONITEMRELATIONSHIP:"IfcClassificationItemRelationship",IFCCLASSIFICATIONITEM:"IfcClassificationItem",IFCCLASSIFICATION:"IfcClassification",IFCCALENDARDATE:"IfcCalendarDate",IFCBOUNDARYNODECONDITIONWARPING:"IfcBoundaryNodeConditionWarping",IFCBOUNDARYNODECONDITION:"IfcBoundaryNodeCondition",IFCBOUNDARYFACECONDITION:"IfcBoundaryFaceCondition",IFCBOUNDARYEDGECONDITION:"IfcBoundaryEdgeCondition",IFCBOUNDARYCONDITION:"IfcBoundaryCondition",IFCAPPROVALRELATIONSHIP:"IfcApprovalRelationship",IFCAPPROVALPROPERTYRELATIONSHIP:"IfcApprovalPropertyRelationship",IFCAPPROVALACTORRELATIONSHIP:"IfcApprovalActorRelationship",IFCAPPROVAL:"IfcApproval",IFCAPPLIEDVALUERELATIONSHIP:"IfcAppliedValueRelationship",IFCAPPLIEDVALUE:"IfcAppliedValue",IFCAPPLICATION:"IfcApplication",IFCADDRESS:"IfcAddress",IFCACTORROLE:"IfcActorRole"};class ch{constructor(){p(this,"factor",1),p(this,"complement",1)}apply(e){const t=this.getScaleMatrix().multiply(e);e.copy(t)}setUp(e){var t,s,i;this.factor=1;const n=this.getLengthUnits(e);if(!n)return;const r=n==null,o=n.Name===void 0||n.Name===null;r||o||(n.Name.value==="FOOT"&&(this.factor=.3048),((t=n.Prefix)==null?void 0:t.value)==="MILLI"?this.complement=.001:((s=n.Prefix)==null?void 0:s.value)==="CENTI"?this.complement=.01:((i=n.Prefix)==null?void 0:i.value)==="DECI"&&(this.complement=.01))}getLengthUnits(e){try{const t=e.GetLineIDsWithType(0,el).get(0),s=e.GetLine(0,t);for(const i of s.Units){if(!i||i.value===null||i.value===void 0)continue;const n=e.GetLine(0,i.value);if(n.UnitType&&n.UnitType.value==="LENGTHUNIT")return n}return null}catch{return console.log("Could not get units"),null}}getScaleMatrix(){const e=this.factor;return new Ee().fromArray([e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1])}}class Uo{constructor(){p(this,"itemsByFloor",{}),p(this,"_units",new ch)}setUp(e){this._units.setUp(e),this.cleanUp();try{const t=e.GetLineIDsWithType(0,vi),s=new Set,i=e.GetLineIDsWithType(0,zt);for(let c=0;c0&&!r.has(n)||this.settings.excludedCategories.has(n))continue;const o=this.webIfc.GetLineIDsWithType(0,n),a=o.size();for(let c=0;c{this.getMesh(n,t)});for(const n of this._visitedFragments){const{index:r,fragment:o}=n[1];t.keyFragments.set(r,o.id)}for(const n of t.items){const r=this._fragmentInstances.get(n.id);if(!r)throw new Error("Fragment not found!");const o=[];for(const[a,c]of r)o.push(c);n.add(o)}const i=this.webIfc.GetCoordinationMatrix(0);return t.coordinationMatrix.fromArray(i),t.civilData=this._civil.read(this.webIfc),t}getMesh(e,t){const s=e.geometries.size(),i=e.expressID;for(let n=0;nr.value!==s),await e.setProperties(s,null),this.registerChange(e,t,s))}addElementToPset(e,t,...s){this.components.get(rt).addEntitiesRelation(e,t,{type:zs,inv:"IsDefinedBy"},...s)}async addPropToPset(e,t,...s){const i=await e.getProperties(t);if(i){for(const n of s){if(i.HasProperties.includes(n))continue;const r=new pt(n);i.HasProperties.push(r),this.onPropToPset.trigger({model:e,psetID:t,propID:n})}this.registerChange(e,t)}}async createIfcRel(e,t,s,i){const n=Ih[t];if(!n)throw new Error(`IfcPropertiesManager: ${n} is unsoported.`);const r=e.ifcMetadata.schema,o=dh[n],a=Ke[r][n];if(!(o&&a))throw new Error(`IfcPropertiesManager: ${n} is unsoported.`);const c=[new Ke[r].IfcGloballyUniqueId(vt.create())],{related:h,relating:d}=o,I=[...new Set(i)].map(E=>new pt(E)),u=(E,C)=>{for(let T=E;TparseInt(r,10)),i=t[s[0]],n=new pt(i.expressID);return{ownerHistory:i,ownerHistoryHandle:n}}registerChange(e,...t){this.changeMap[e.uuid]||(this.changeMap[e.uuid]=new Set);for(const s of t)this.changeMap[e.uuid].add(s),this.onDataChanged.trigger({model:e,expressID:s})}async newSingleProperty(e,t,s,i){const n=rs.getIFCSchema(e),r=new Ke[n].IfcIdentifier(s),o=new Ke[n][t](i),a=new Ke[n].IfcPropertySingleValue(r,null,o,null);return a.expressID=this.getNewExpressID(e),await this.setData(e,a),a}};p(Ho,"uuid","58c2d9f0-183c-48d6-a402-dfcf5b9a34df");let Eh=Ho;const Wo=class Fn extends Ae{constructor(e){super(e),p(this,"onDisposed",new $),p(this,"onRelationsIndexed",new $),p(this,"relationMaps",{}),p(this,"enabled",!0),p(this,"_relToAttributesMap",qr),p(this,"_inverseAttributes",["IsDecomposedBy","Decomposes","AssociatedTo","HasAssociations","ClassificationForObjects","IsGroupedBy","HasAssignments","IsDefinedBy","DefinesOcurrence","IsTypedBy","Types","Defines","ContainedInStructure","ContainsElements","HasControlElements","AssignedToFlowElement","ConnectedTo","ConnectedFrom","ReferencedBy","Declares","HasContext","Controls","IsNestedBy","Nests","DocumentRefForObjects"]),p(this,"_ifcRels",[wi,Mn,Dn,bn,zs,Un,xn,vi,Bn,Yn,Vn,Gn,zn,kn,Hn]),p(this,"onFragmentsDisposed",t=>{delete this.relationMaps[t.groupID]}),p(this,"_changeMap",{}),p(this,"onEntitiesRelated",new $),this.components.add(Fn.uuid,this),e.get(Re).onFragmentsDisposed.add(this.onFragmentsDisposed)}indexRelations(e,t,s,i){const n=Object.keys(t).find(h=>h.startsWith("Relating")),r=Object.keys(t).find(h=>h.startsWith("Related"));if(!(n&&r))return;const o=t[n].value,a=t[r].map(h=>h.value),c=this.getAttributeIndex(i);if(c!==null){let h=e.get(o);h||(h=new Map,e.set(o,h));let d=h.get(c);d||(d=[],h.set(c,d)),d.push(...a)}for(const h of a){const d=this.getAttributeIndex(s);if(d===null)continue;let I=e.get(h);I||(I=new Map,e.set(h,I));let u=I.get(d);u||(u=[],I.set(d,u)),u.push(o)}}getAttributeIndex(e){const t=this._inverseAttributes.indexOf(e);return t===-1?null:t}setRelationMap(e,t){this.relationMaps[e.uuid]=t,this.onRelationsIndexed.trigger({modelID:e.uuid,relationsMap:t})}async process(e){if(!e.hasProperties)throw new Error("FragmentsGroup properties not found");let t=this.relationMaps[e.uuid];if(t)return t;t=new Map;for(const s of this._ifcRels){const i=await e.getAllPropertiesOfType(s);if(!i)continue;const n=this._relToAttributesMap.get(s);if(!n)continue;const{forRelated:r,forRelating:o}=n;for(const a in i){const c=i[a];this.indexRelations(t,c,r,o)}}return this.setRelationMap(e,t),t}async processFromWebIfc(e,t){const s=new Map;for(const i of this._ifcRels){const n=this._relToAttributesMap.get(i);if(!n)continue;const{forRelated:r,forRelating:o}=n,a=e.GetLineIDsWithType(t,i);for(let c=0;cC.startsWith("Related")),E=u.find(C=>C.startsWith("Relating"));if(!(f&&E))continue;I[f]=[...h].map(C=>new pt(C)),I[E]=new pt(a),await t.setData(i,I)}else{const I=await t.createIfcRel(i,r,a,[...h]);if(!I)continue;c.relID=I.expressID}}}}addEntitiesRelation(e,t,s,...i){const{type:n,inv:r}=s,o=this.relationMaps[e.uuid];if(!o||!this._ifcRels.includes(n))return;const a=qr.get(n);if(!a)return;const{forRelated:c,forRelating:h}=a;if(!(c===r||h===r))return;let d=this._changeMap[e.uuid];d||(d=new St,this._changeMap[e.uuid]=d);const I=h===r?[t]:i,u=c===r?[t]:i;let f=d.get(n);f||(f=new St,f.onItemSet.add(()=>this.onEntitiesRelated.trigger({invAttribute:r,relType:n,relatingIDs:I,relatedIDs:u})),f.onItemUpdated.add(()=>this.onEntitiesRelated.trigger({invAttribute:r,relType:n,relatingIDs:I,relatedIDs:u})),d.set(n,f));for(const E of I){let C=f.get(E);C||(C={related:new Tt},f.set(E,C)),C.related.add(...u)}for(const E of I){let C=o.get(E);C||(C=new Map,o.set(E,C));const T=this.getAttributeIndex(h);if(T!==null){let m=C.get(T);m||(m=[],C.set(T,m)),m.push(...u)}}for(const E of u){let C=o.get(E);C||(C=new Map,o.set(E,C));const T=this.getAttributeIndex(c);if(T===null)continue;let m=C.get(T);m||(m=[],C.set(T,m)),m.push(...I)}}getEntityChildren(e,t,s=new Set){if(s.add(t),this.relationMaps[e.uuid]===void 0)throw new Error("The provided model has no indices. You have to generate them first.");const i=this.getEntityRelations(e,t,"IsDecomposedBy");if(i)for(const r of i)this.getEntityChildren(e,r,s);const n=this.getEntityRelations(e,t,"ContainsElements");if(n)for(const r of n)this.getEntityChildren(e,r,s);return s}};p(Wo,"uuid","23a889ab-83b3-44a4-8bee-ead83438370b");let rt=Wo;const Xo=class jo extends Ae{constructor(e){super(e),p(this,"onDisposed",new $),p(this,"onFragmentsLoaded",new $),p(this,"onFragmentsDisposed",new $),p(this,"list",new St),p(this,"groups",new St),p(this,"baseCoordinationModel",""),p(this,"baseCoordinationMatrix",new Ee),p(this,"enabled",!0),p(this,"_loader",new Io),this.components.add(jo.uuid,this)}get meshes(){const e=[];for(const[t,s]of this.list)e.push(s.mesh);return e}dispose(){for(const[e,t]of this.groups)t.dispose(!0);this.baseCoordinationModel="",this.groups.clear(),this.list.clear(),this.onFragmentsLoaded.reset(),this.onFragmentsDisposed.reset(),this.onDisposed.trigger(),this.onDisposed.reset()}disposeGroup(e){const{uuid:t}=e,s=[];for(const i of e.items)s.push(i.id),this.list.delete(i.id);e.dispose(!0),this.groups.delete(e.uuid),this.groups.size===0&&(this.baseCoordinationModel="",this.baseCoordinationMatrix=new Ee),this.onFragmentsDisposed.trigger({groupID:t,fragmentIDs:s})}load(e,t){const s={coordinate:!0,...t},{coordinate:i,name:n,properties:r,relationsMap:o}=s,a=this._loader.import(e);t&&(a.isStreamed=t.isStreamed||!1),n&&(a.name=n);for(const c of a.items)c.group=a,this.list.set(c.id,c);return i&&this.coordinate([a]),this.groups.set(a.uuid,a),r&&a.setLocalProperties(r),o&&this.components.get(rt).setRelationMap(a,o),this.onFragmentsLoaded.trigger(a),a}export(e){return this._loader.export(e)}getModelIdMap(e){const t={};for(const s in e){const i=this.list.get(s);if(!(i&&i.group))continue;const n=i.group;n.uuid in t||(t[n.uuid]=new Set);const r=e[s];for(const o of r)t[n.uuid].add(o)}return t}modelIdToFragmentIdMap(e){let t={};for(const s in e){const i=this.groups.get(s);if(!i)continue;const n=e[s],r=i.getFragmentMap(n);t={...t,...r}}return t}guidToFragmentIdMap(e){const t={};for(const[s,i]of this.groups){s in t||(t[s]=new Set);for(const n of e){const r=i.globalToExpressIDs.get(n);r&&t[s].add(r)}}return this.modelIdToFragmentIdMap(t)}fragmentIdMapToGuids(e){const t=[],s=this.getModelIdMap(e);for(const i in s){const n=this.groups.get(i);if(!n)continue;const r=s[i];for(const o of r)for(const[a,c]of n.globalToExpressIDs.entries())if(c===o){t.push(a);break}}return t}coordinate(e=Array.from(this.groups.values())){if(this.baseCoordinationModel.length===0){const t=e.pop();if(!t)return;this.baseCoordinationModel=t.uuid,this.baseCoordinationMatrix=t.coordinationMatrix.clone()}if(e.length)for(const t of e)t.coordinationMatrix.equals(this.baseCoordinationMatrix)||(t.position.set(0,0,0),t.rotation.set(0,0,0),t.scale.set(1,1,1),t.updateMatrix(),this.applyBaseCoordinateSystem(t,t.coordinationMatrix))}applyBaseCoordinateSystem(e,t){t&&e.applyMatrix4(t.clone().invert()),e.applyMatrix4(this.baseCoordinationMatrix)}clone(e,t){const s=e.cloneGroup(t);this.groups.set(s.uuid,s);for(const i of s.items)this.list.set(i.id,i);return s}};p(Xo,"uuid","fef46874-46a3-461b-8c44-2922ab77c806");let Re=Xo;var fi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fh(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}function pi(l){throw new Error('Could not dynamically require "'+l+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Zo={exports:{}};/*! + +JSZip v3.10.1 - A JavaScript class for generating and reading zip files + + +(c) 2009-2016 Stuart Knightley +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. + +JSZip uses the library pako released under the MIT license : +https://github.com/nodeca/pako/blob/main/LICENSE +*/(function(l,e){(function(t){l.exports=t()})(function(){return function t(s,i,n){function r(c,h){if(!i[c]){if(!s[c]){var d=typeof pi=="function"&πif(!h&&d)return d(c,!0);if(o)return o(c,!0);var I=new Error("Cannot find module '"+c+"'");throw I.code="MODULE_NOT_FOUND",I}var u=i[c]={exports:{}};s[c][0].call(u.exports,function(f){var E=s[c][1][f];return r(E||f)},u,u.exports,t,s,i,n)}return i[c].exports}for(var o=typeof pi=="function"&&pi,a=0;a>2,u=(3&c)<<4|h>>4,f=1>6:64,E=2>4,h=(15&I)<<4|(u=o.indexOf(a.charAt(E++)))>>2,d=(3&u)<<6|(f=o.indexOf(a.charAt(E++))),m[C++]=c,u!==64&&(m[C++]=h),f!==64&&(m[C++]=d);return m}},{"./support":30,"./utils":32}],2:[function(t,s,i){var n=t("./external"),r=t("./stream/DataWorker"),o=t("./stream/Crc32Probe"),a=t("./stream/DataLengthProbe");function c(h,d,I,u,f){this.compressedSize=h,this.uncompressedSize=d,this.crc32=I,this.compression=u,this.compressedContent=f}c.prototype={getContentWorker:function(){var h=new r(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),d=this;return h.on("end",function(){if(this.streamInfo.data_length!==d.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),h},getCompressedWorker:function(){return new r(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(h,d,I){return h.pipe(new o).pipe(new a("uncompressedSize")).pipe(d.compressWorker(I)).pipe(new a("compressedSize")).withStreamInfo("compression",d)},s.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,s,i){var n=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,s,i){var n=t("./utils"),r=function(){for(var o,a=[],c=0;c<256;c++){o=c;for(var h=0;h<8;h++)o=1&o?3988292384^o>>>1:o>>>1;a[c]=o}return a}();s.exports=function(o,a){return o!==void 0&&o.length?n.getTypeOf(o)!=="string"?function(c,h,d,I){var u=r,f=I+d;c^=-1;for(var E=I;E>>8^u[255&(c^h[E])];return-1^c}(0|a,o,o.length,0):function(c,h,d,I){var u=r,f=I+d;c^=-1;for(var E=I;E>>8^u[255&(c^h.charCodeAt(E))];return-1^c}(0|a,o,o.length,0):0}},{"./utils":32}],5:[function(t,s,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,s,i){var n=null;n=typeof Promise<"u"?Promise:t("lie"),s.exports={Promise:n}},{lie:37}],7:[function(t,s,i){var n=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",r=t("pako"),o=t("./utils"),a=t("./stream/GenericWorker"),c=n?"uint8array":"array";function h(d,I){a.call(this,"FlateWorker/"+d),this._pako=null,this._pakoAction=d,this._pakoOptions=I,this.meta={}}i.magic="\b\0",o.inherits(h,a),h.prototype.processChunk=function(d){this.meta=d.meta,this._pako===null&&this._createPako(),this._pako.push(o.transformTo(c,d.data),!1)},h.prototype.flush=function(){a.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var d=this;this._pako.onData=function(I){d.push({data:I,meta:d.meta})}},i.compressWorker=function(d){return new h("Deflate",d)},i.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,s,i){function n(u,f){var E,C="";for(E=0;E>>=8;return C}function r(u,f,E,C,T,m){var A,R,S=u.file,L=u.compression,y=m!==c.utf8encode,w=o.transformTo("string",m(S.name)),P=o.transformTo("string",c.utf8encode(S.name)),M=S.comment,B=o.transformTo("string",m(M)),O=o.transformTo("string",c.utf8encode(M)),v=P.length!==S.name.length,g=O.length!==M.length,b="",Z="",z="",J=S.dir,X=S.date,ne={crc32:0,compressedSize:0,uncompressedSize:0};f&&!E||(ne.crc32=u.crc32,ne.compressedSize=u.compressedSize,ne.uncompressedSize=u.uncompressedSize);var V=0;f&&(V|=8),y||!v&&!g||(V|=2048);var Y=0,ie=0;J&&(Y|=16),T==="UNIX"?(ie=798,Y|=function(K,Fe){var Ne=K;return K||(Ne=Fe?16893:33204),(65535&Ne)<<16}(S.unixPermissions,J)):(ie=20,Y|=function(K){return 63&(K||0)}(S.dosPermissions)),A=X.getUTCHours(),A<<=6,A|=X.getUTCMinutes(),A<<=5,A|=X.getUTCSeconds()/2,R=X.getUTCFullYear()-1980,R<<=4,R|=X.getUTCMonth()+1,R<<=5,R|=X.getUTCDate(),v&&(Z=n(1,1)+n(h(w),4)+P,b+="up"+n(Z.length,2)+Z),g&&(z=n(1,1)+n(h(B),4)+O,b+="uc"+n(z.length,2)+z);var ee="";return ee+=` +\0`,ee+=n(V,2),ee+=L.magic,ee+=n(A,2),ee+=n(R,2),ee+=n(ne.crc32,4),ee+=n(ne.compressedSize,4),ee+=n(ne.uncompressedSize,4),ee+=n(w.length,2),ee+=n(b.length,2),{fileRecord:d.LOCAL_FILE_HEADER+ee+w+b,dirRecord:d.CENTRAL_FILE_HEADER+n(ie,2)+ee+n(B.length,2)+"\0\0\0\0"+n(Y,4)+n(C,4)+w+b+B}}var o=t("../utils"),a=t("../stream/GenericWorker"),c=t("../utf8"),h=t("../crc32"),d=t("../signature");function I(u,f,E,C){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=f,this.zipPlatform=E,this.encodeFileName=C,this.streamFiles=u,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(I,a),I.prototype.push=function(u){var f=u.meta.percent||0,E=this.entriesCount,C=this._sources.length;this.accumulate?this.contentBuffer.push(u):(this.bytesWritten+=u.data.length,a.prototype.push.call(this,{data:u.data,meta:{currentFile:this.currentFile,percent:E?(f+100*(E-C-1))/E:100}}))},I.prototype.openedSource=function(u){this.currentSourceOffset=this.bytesWritten,this.currentFile=u.file.name;var f=this.streamFiles&&!u.file.dir;if(f){var E=r(u,f,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:E.fileRecord,meta:{percent:0}})}else this.accumulate=!0},I.prototype.closedSource=function(u){this.accumulate=!1;var f=this.streamFiles&&!u.file.dir,E=r(u,f,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(E.dirRecord),f)this.push({data:function(C){return d.DATA_DESCRIPTOR+n(C.crc32,4)+n(C.compressedSize,4)+n(C.uncompressedSize,4)}(u),meta:{percent:100}});else for(this.push({data:E.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},I.prototype.flush=function(){for(var u=this.bytesWritten,f=0;f=this.index;a--)c=(c<<8)+this.byteAt(a);return this.index+=o,c},readString:function(o){return n.transformTo("string",this.readData(o))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var o=this.readInt(4);return new Date(Date.UTC(1980+(o>>25&127),(o>>21&15)-1,o>>16&31,o>>11&31,o>>5&63,(31&o)<<1))}},s.exports=r},{"../utils":32}],19:[function(t,s,i){var n=t("./Uint8ArrayReader");function r(o){n.call(this,o)}t("../utils").inherits(r,n),r.prototype.readData=function(o){this.checkOffset(o);var a=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,a},s.exports=r},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,s,i){var n=t("./DataReader");function r(o){n.call(this,o)}t("../utils").inherits(r,n),r.prototype.byteAt=function(o){return this.data.charCodeAt(this.zero+o)},r.prototype.lastIndexOfSignature=function(o){return this.data.lastIndexOf(o)-this.zero},r.prototype.readAndCheckSignature=function(o){return o===this.readData(4)},r.prototype.readData=function(o){this.checkOffset(o);var a=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,a},s.exports=r},{"../utils":32,"./DataReader":18}],21:[function(t,s,i){var n=t("./ArrayReader");function r(o){n.call(this,o)}t("../utils").inherits(r,n),r.prototype.readData=function(o){if(this.checkOffset(o),o===0)return new Uint8Array(0);var a=this.data.subarray(this.zero+this.index,this.zero+this.index+o);return this.index+=o,a},s.exports=r},{"../utils":32,"./ArrayReader":17}],22:[function(t,s,i){var n=t("../utils"),r=t("../support"),o=t("./ArrayReader"),a=t("./StringReader"),c=t("./NodeBufferReader"),h=t("./Uint8ArrayReader");s.exports=function(d){var I=n.getTypeOf(d);return n.checkSupport(I),I!=="string"||r.uint8array?I==="nodebuffer"?new c(d):r.uint8array?new h(n.transformTo("uint8array",d)):new o(n.transformTo("array",d)):new a(d)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,s,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,s,i){var n=t("./GenericWorker"),r=t("../utils");function o(a){n.call(this,"ConvertWorker to "+a),this.destType=a}r.inherits(o,n),o.prototype.processChunk=function(a){this.push({data:r.transformTo(this.destType,a.data),meta:a.meta})},s.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(t,s,i){var n=t("./GenericWorker"),r=t("../crc32");function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(o,n),o.prototype.processChunk=function(a){this.streamInfo.crc32=r(a.data,this.streamInfo.crc32||0),this.push(a)},s.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,s,i){var n=t("../utils"),r=t("./GenericWorker");function o(a){r.call(this,"DataLengthProbe for "+a),this.propName=a,this.withStreamInfo(a,0)}n.inherits(o,r),o.prototype.processChunk=function(a){if(a){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+a.data.length}r.prototype.processChunk.call(this,a)},s.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(t,s,i){var n=t("../utils"),r=t("./GenericWorker");function o(a){r.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,a.then(function(h){c.dataIsReady=!0,c.data=h,c.max=h&&h.length||0,c.type=n.getTypeOf(h),c.isPaused||c._tickAndRepeat()},function(h){c.error(h)})}n.inherits(o,r),o.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var a=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":a=this.data.substring(this.index,c);break;case"uint8array":a=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":a=this.data.slice(this.index,c)}return this.index=c,this.push({data:a,meta:{percent:this.max?this.index/this.max*100:0}})},s.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(t,s,i){function n(r){this.name=r||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(r){this.emit("data",r)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(r){this.emit("error",r)}return!0},error:function(r){return!this.isFinished&&(this.isPaused?this.generatedError=r:(this.isFinished=!0,this.emit("error",r),this.previous&&this.previous.error(r),this.cleanUp()),!0)},on:function(r,o){return this._listeners[r].push(o),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(r,o){if(this._listeners[r])for(var a=0;a "+r:r}},s.exports=n},{}],29:[function(t,s,i){var n=t("../utils"),r=t("./ConvertWorker"),o=t("./GenericWorker"),a=t("../base64"),c=t("../support"),h=t("../external"),d=null;if(c.nodestream)try{d=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function I(f,E){return new h.Promise(function(C,T){var m=[],A=f._internalType,R=f._outputType,S=f._mimeType;f.on("data",function(L,y){m.push(L),E&&E(y)}).on("error",function(L){m=[],T(L)}).on("end",function(){try{var L=function(y,w,P){switch(y){case"blob":return n.newBlob(n.transformTo("arraybuffer",w),P);case"base64":return a.encode(w);default:return n.transformTo(y,w)}}(R,function(y,w){var P,M=0,B=null,O=0;for(P=0;P"u")i.blob=!1;else{var n=new ArrayBuffer(0);try{i.blob=new Blob([n],{type:"application/zip"}).size===0}catch{try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);r.append(n),i.blob=r.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!t("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(t,s,i){for(var n=t("./utils"),r=t("./support"),o=t("./nodejsUtils"),a=t("./stream/GenericWorker"),c=new Array(256),h=0;h<256;h++)c[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;c[254]=c[254]=1;function d(){a.call(this,"utf-8 decode"),this.leftOver=null}function I(){a.call(this,"utf-8 encode")}i.utf8encode=function(u){return r.nodebuffer?o.newBufferFrom(u,"utf-8"):function(f){var E,C,T,m,A,R=f.length,S=0;for(m=0;m>>6:(C<65536?E[A++]=224|C>>>12:(E[A++]=240|C>>>18,E[A++]=128|C>>>12&63),E[A++]=128|C>>>6&63),E[A++]=128|63&C);return E}(u)},i.utf8decode=function(u){return r.nodebuffer?n.transformTo("nodebuffer",u).toString("utf-8"):function(f){var E,C,T,m,A=f.length,R=new Array(2*A);for(E=C=0;E>10&1023,R[C++]=56320|1023&T)}return R.length!==C&&(R.subarray?R=R.subarray(0,C):R.length=C),n.applyFromCharCode(R)}(u=n.transformTo(r.uint8array?"uint8array":"array",u))},n.inherits(d,a),d.prototype.processChunk=function(u){var f=n.transformTo(r.uint8array?"uint8array":"array",u.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var E=f;(f=new Uint8Array(E.length+this.leftOver.length)).set(this.leftOver,0),f.set(E,this.leftOver.length)}else f=this.leftOver.concat(f);this.leftOver=null}var C=function(m,A){var R;for((A=A||m.length)>m.length&&(A=m.length),R=A-1;0<=R&&(192&m[R])==128;)R--;return R<0||R===0?A:R+c[m[R]]>A?R:A}(f),T=f;C!==f.length&&(r.uint8array?(T=f.subarray(0,C),this.leftOver=f.subarray(C,f.length)):(T=f.slice(0,C),this.leftOver=f.slice(C,f.length))),this.push({data:i.utf8decode(T),meta:u.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=d,n.inherits(I,a),I.prototype.processChunk=function(u){this.push({data:i.utf8encode(u.data),meta:u.meta})},i.Utf8EncodeWorker=I},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,s,i){var n=t("./support"),r=t("./base64"),o=t("./nodejsUtils"),a=t("./external");function c(E){return E}function h(E,C){for(var T=0;T>8;this.dir=!!(16&this.externalFileAttributes),u==0&&(this.dosPermissions=63&this.externalFileAttributes),u==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var u=n(this.extraFields[1].value);this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=u.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=u.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=u.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS&&(this.diskNumberStart=u.readInt(4))}},readExtraFields:function(u){var f,E,C,T=u.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});u.index+4>>6:(u<65536?I[C++]=224|u>>>12:(I[C++]=240|u>>>18,I[C++]=128|u>>>12&63),I[C++]=128|u>>>6&63),I[C++]=128|63&u);return I},i.buf2binstring=function(d){return h(d,d.length)},i.binstring2buf=function(d){for(var I=new n.Buf8(d.length),u=0,f=I.length;u>10&1023,m[f++]=56320|1023&E)}return h(m,f)},i.utf8border=function(d,I){var u;for((I=I||d.length)>d.length&&(I=d.length),u=I-1;0<=u&&(192&d[u])==128;)u--;return u<0||u===0?I:u+a[d[u]]>I?u:I}},{"./common":41}],43:[function(t,s,i){s.exports=function(n,r,o,a){for(var c=65535&n|0,h=n>>>16&65535|0,d=0;o!==0;){for(o-=d=2e3>>1:r>>>1;o[a]=r}return o}();s.exports=function(r,o,a,c){var h=n,d=c+a;r^=-1;for(var I=c;I>>8^h[255&(r^o[I])];return-1^r}},{}],46:[function(t,s,i){var n,r=t("../utils/common"),o=t("./trees"),a=t("./adler32"),c=t("./crc32"),h=t("./messages"),d=0,I=4,u=0,f=-2,E=-1,C=4,T=2,m=8,A=9,R=286,S=30,L=19,y=2*R+1,w=15,P=3,M=258,B=M+P+1,O=42,v=113,g=1,b=2,Z=3,z=4;function J(F,H){return F.msg=h[H],H}function X(F){return(F<<1)-(4F.avail_out&&(G=F.avail_out),G!==0&&(r.arraySet(F.output,H.pending_buf,H.pending_out,G,F.next_out),F.next_out+=G,H.pending_out+=G,F.total_out+=G,F.avail_out-=G,H.pending-=G,H.pending===0&&(H.pending_out=0))}function Y(F,H){o._tr_flush_block(F,0<=F.block_start?F.block_start:-1,F.strstart-F.block_start,H),F.block_start=F.strstart,V(F.strm)}function ie(F,H){F.pending_buf[F.pending++]=H}function ee(F,H){F.pending_buf[F.pending++]=H>>>8&255,F.pending_buf[F.pending++]=255&H}function K(F,H){var G,_,N=F.max_chain_length,D=F.strstart,W=F.prev_length,j=F.nice_match,U=F.strstart>F.w_size-B?F.strstart-(F.w_size-B):0,q=F.window,te=F.w_mask,Q=F.prev,oe=F.strstart+M,Te=q[D+W-1],de=q[D+W];F.prev_length>=F.good_match&&(N>>=2),j>F.lookahead&&(j=F.lookahead);do if(q[(G=H)+W]===de&&q[G+W-1]===Te&&q[G]===q[D]&&q[++G]===q[D+1]){D+=2,G++;do;while(q[++D]===q[++G]&&q[++D]===q[++G]&&q[++D]===q[++G]&&q[++D]===q[++G]&&q[++D]===q[++G]&&q[++D]===q[++G]&&q[++D]===q[++G]&&q[++D]===q[++G]&&DU&&--N!=0);return W<=F.lookahead?W:F.lookahead}function Fe(F){var H,G,_,N,D,W,j,U,q,te,Q=F.w_size;do{if(N=F.window_size-F.lookahead-F.strstart,F.strstart>=Q+(Q-B)){for(r.arraySet(F.window,F.window,Q,Q,0),F.match_start-=Q,F.strstart-=Q,F.block_start-=Q,H=G=F.hash_size;_=F.head[--H],F.head[H]=Q<=_?_-Q:0,--G;);for(H=G=Q;_=F.prev[--H],F.prev[H]=Q<=_?_-Q:0,--G;);N+=Q}if(F.strm.avail_in===0)break;if(W=F.strm,j=F.window,U=F.strstart+F.lookahead,q=N,te=void 0,te=W.avail_in,q=P)for(D=F.strstart-F.insert,F.ins_h=F.window[D],F.ins_h=(F.ins_h<=P&&(F.ins_h=(F.ins_h<=P)if(_=o._tr_tally(F,F.strstart-F.match_start,F.match_length-P),F.lookahead-=F.match_length,F.match_length<=F.max_lazy_match&&F.lookahead>=P){for(F.match_length--;F.strstart++,F.ins_h=(F.ins_h<=P&&(F.ins_h=(F.ins_h<=P&&F.match_length<=F.prev_length){for(N=F.strstart+F.lookahead-P,_=o._tr_tally(F,F.strstart-1-F.prev_match,F.prev_length-P),F.lookahead-=F.prev_length-1,F.prev_length-=2;++F.strstart<=N&&(F.ins_h=(F.ins_h<F.pending_buf_size-5&&(G=F.pending_buf_size-5);;){if(F.lookahead<=1){if(Fe(F),F.lookahead===0&&H===d)return g;if(F.lookahead===0)break}F.strstart+=F.lookahead,F.lookahead=0;var _=F.block_start+G;if((F.strstart===0||F.strstart>=_)&&(F.lookahead=F.strstart-_,F.strstart=_,Y(F,!1),F.strm.avail_out===0)||F.strstart-F.block_start>=F.w_size-B&&(Y(F,!1),F.strm.avail_out===0))return g}return F.insert=0,H===I?(Y(F,!0),F.strm.avail_out===0?Z:z):(F.strstart>F.block_start&&(Y(F,!1),F.strm.avail_out),g)}),new ue(4,4,8,4,Ne),new ue(4,5,16,8,Ne),new ue(4,6,32,32,Ne),new ue(4,4,16,16,re),new ue(8,16,32,32,re),new ue(8,16,128,128,re),new ue(8,32,128,256,re),new ue(32,128,258,1024,re),new ue(32,258,258,4096,re)],i.deflateInit=function(F,H){return Me(F,H,m,15,8,0)},i.deflateInit2=Me,i.deflateReset=We,i.deflateResetKeep=pe,i.deflateSetHeader=function(F,H){return F&&F.state?F.state.wrap!==2?f:(F.state.gzhead=H,u):f},i.deflate=function(F,H){var G,_,N,D;if(!F||!F.state||5>8&255),ie(_,_.gzhead.time>>16&255),ie(_,_.gzhead.time>>24&255),ie(_,_.level===9?2:2<=_.strategy||_.level<2?4:0),ie(_,255&_.gzhead.os),_.gzhead.extra&&_.gzhead.extra.length&&(ie(_,255&_.gzhead.extra.length),ie(_,_.gzhead.extra.length>>8&255)),_.gzhead.hcrc&&(F.adler=c(F.adler,_.pending_buf,_.pending,0)),_.gzindex=0,_.status=69):(ie(_,0),ie(_,0),ie(_,0),ie(_,0),ie(_,0),ie(_,_.level===9?2:2<=_.strategy||_.level<2?4:0),ie(_,3),_.status=v);else{var W=m+(_.w_bits-8<<4)<<8;W|=(2<=_.strategy||_.level<2?0:_.level<6?1:_.level===6?2:3)<<6,_.strstart!==0&&(W|=32),W+=31-W%31,_.status=v,ee(_,W),_.strstart!==0&&(ee(_,F.adler>>>16),ee(_,65535&F.adler)),F.adler=1}if(_.status===69)if(_.gzhead.extra){for(N=_.pending;_.gzindex<(65535&_.gzhead.extra.length)&&(_.pending!==_.pending_buf_size||(_.gzhead.hcrc&&_.pending>N&&(F.adler=c(F.adler,_.pending_buf,_.pending-N,N)),V(F),N=_.pending,_.pending!==_.pending_buf_size));)ie(_,255&_.gzhead.extra[_.gzindex]),_.gzindex++;_.gzhead.hcrc&&_.pending>N&&(F.adler=c(F.adler,_.pending_buf,_.pending-N,N)),_.gzindex===_.gzhead.extra.length&&(_.gzindex=0,_.status=73)}else _.status=73;if(_.status===73)if(_.gzhead.name){N=_.pending;do{if(_.pending===_.pending_buf_size&&(_.gzhead.hcrc&&_.pending>N&&(F.adler=c(F.adler,_.pending_buf,_.pending-N,N)),V(F),N=_.pending,_.pending===_.pending_buf_size)){D=1;break}D=_.gzindex<_.gzhead.name.length?255&_.gzhead.name.charCodeAt(_.gzindex++):0,ie(_,D)}while(D!==0);_.gzhead.hcrc&&_.pending>N&&(F.adler=c(F.adler,_.pending_buf,_.pending-N,N)),D===0&&(_.gzindex=0,_.status=91)}else _.status=91;if(_.status===91)if(_.gzhead.comment){N=_.pending;do{if(_.pending===_.pending_buf_size&&(_.gzhead.hcrc&&_.pending>N&&(F.adler=c(F.adler,_.pending_buf,_.pending-N,N)),V(F),N=_.pending,_.pending===_.pending_buf_size)){D=1;break}D=_.gzindex<_.gzhead.comment.length?255&_.gzhead.comment.charCodeAt(_.gzindex++):0,ie(_,D)}while(D!==0);_.gzhead.hcrc&&_.pending>N&&(F.adler=c(F.adler,_.pending_buf,_.pending-N,N)),D===0&&(_.status=103)}else _.status=103;if(_.status===103&&(_.gzhead.hcrc?(_.pending+2>_.pending_buf_size&&V(F),_.pending+2<=_.pending_buf_size&&(ie(_,255&F.adler),ie(_,F.adler>>8&255),F.adler=0,_.status=v)):_.status=v),_.pending!==0){if(V(F),F.avail_out===0)return _.last_flush=-1,u}else if(F.avail_in===0&&X(H)<=X(G)&&H!==I)return J(F,-5);if(_.status===666&&F.avail_in!==0)return J(F,-5);if(F.avail_in!==0||_.lookahead!==0||H!==d&&_.status!==666){var j=_.strategy===2?function(U,q){for(var te;;){if(U.lookahead===0&&(Fe(U),U.lookahead===0)){if(q===d)return g;break}if(U.match_length=0,te=o._tr_tally(U,0,U.window[U.strstart]),U.lookahead--,U.strstart++,te&&(Y(U,!1),U.strm.avail_out===0))return g}return U.insert=0,q===I?(Y(U,!0),U.strm.avail_out===0?Z:z):U.last_lit&&(Y(U,!1),U.strm.avail_out===0)?g:b}(_,H):_.strategy===3?function(U,q){for(var te,Q,oe,Te,de=U.window;;){if(U.lookahead<=M){if(Fe(U),U.lookahead<=M&&q===d)return g;if(U.lookahead===0)break}if(U.match_length=0,U.lookahead>=P&&0U.lookahead&&(U.match_length=U.lookahead)}if(U.match_length>=P?(te=o._tr_tally(U,1,U.match_length-P),U.lookahead-=U.match_length,U.strstart+=U.match_length,U.match_length=0):(te=o._tr_tally(U,0,U.window[U.strstart]),U.lookahead--,U.strstart++),te&&(Y(U,!1),U.strm.avail_out===0))return g}return U.insert=0,q===I?(Y(U,!0),U.strm.avail_out===0?Z:z):U.last_lit&&(Y(U,!1),U.strm.avail_out===0)?g:b}(_,H):n[_.level].func(_,H);if(j!==Z&&j!==z||(_.status=666),j===g||j===Z)return F.avail_out===0&&(_.last_flush=-1),u;if(j===b&&(H===1?o._tr_align(_):H!==5&&(o._tr_stored_block(_,0,0,!1),H===3&&(ne(_.head),_.lookahead===0&&(_.strstart=0,_.block_start=0,_.insert=0))),V(F),F.avail_out===0))return _.last_flush=-1,u}return H!==I?u:_.wrap<=0?1:(_.wrap===2?(ie(_,255&F.adler),ie(_,F.adler>>8&255),ie(_,F.adler>>16&255),ie(_,F.adler>>24&255),ie(_,255&F.total_in),ie(_,F.total_in>>8&255),ie(_,F.total_in>>16&255),ie(_,F.total_in>>24&255)):(ee(_,F.adler>>>16),ee(_,65535&F.adler)),V(F),0<_.wrap&&(_.wrap=-_.wrap),_.pending!==0?u:1)},i.deflateEnd=function(F){var H;return F&&F.state?(H=F.state.status)!==O&&H!==69&&H!==73&&H!==91&&H!==103&&H!==v&&H!==666?J(F,f):(F.state=null,H===v?J(F,-3):u):f},i.deflateSetDictionary=function(F,H){var G,_,N,D,W,j,U,q,te=H.length;if(!F||!F.state||(D=(G=F.state).wrap)===2||D===1&&G.status!==O||G.lookahead)return f;for(D===1&&(F.adler=a(F.adler,H,te,0)),G.wrap=0,te>=G.w_size&&(D===0&&(ne(G.head),G.strstart=0,G.block_start=0,G.insert=0),q=new r.Buf8(G.w_size),r.arraySet(q,H,te-G.w_size,G.w_size,0),H=q,te=G.w_size),W=F.avail_in,j=F.next_in,U=F.input,F.avail_in=te,F.next_in=0,F.input=H,Fe(G);G.lookahead>=P;){for(_=G.strstart,N=G.lookahead-(P-1);G.ins_h=(G.ins_h<>>=P=w>>>24,A-=P,(P=w>>>16&255)===0)b[h++]=65535&w;else{if(!(16&P)){if(!(64&P)){w=R[(65535&w)+(m&(1<>>=P,A-=P),A<15&&(m+=g[a++]<>>=P=w>>>24,A-=P,!(16&(P=w>>>16&255))){if(!(64&P)){w=S[(65535&w)+(m&(1<>>=P,A-=P,(P=h-d)>3,m&=(1<<(A-=M<<3))-1,n.next_in=a,n.next_out=h,n.avail_in=a>>24&255)+(O>>>8&65280)+((65280&O)<<8)+((255&O)<<24)}function m(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function A(O){var v;return O&&O.state?(v=O.state,O.total_in=O.total_out=v.total=0,O.msg="",v.wrap&&(O.adler=1&v.wrap),v.mode=f,v.last=0,v.havedict=0,v.dmax=32768,v.head=null,v.hold=0,v.bits=0,v.lencode=v.lendyn=new n.Buf32(E),v.distcode=v.distdyn=new n.Buf32(C),v.sane=1,v.back=-1,I):u}function R(O){var v;return O&&O.state?((v=O.state).wsize=0,v.whave=0,v.wnext=0,A(O)):u}function S(O,v){var g,b;return O&&O.state?(b=O.state,v<0?(g=0,v=-v):(g=1+(v>>4),v<48&&(v&=15)),v&&(v<8||15=z.wsize?(n.arraySet(z.window,v,g-z.wsize,z.wsize,0),z.wnext=0,z.whave=z.wsize):(b<(Z=z.wsize-z.wnext)&&(Z=b),n.arraySet(z.window,v,g-b,Z,z.wnext),(b-=Z)?(n.arraySet(z.window,v,g-b,b,0),z.wnext=b,z.whave=z.wsize):(z.wnext+=Z,z.wnext===z.wsize&&(z.wnext=0),z.whave>>8&255,g.check=o(g.check,D,2,0),Y=V=0,g.mode=2;break}if(g.flags=0,g.head&&(g.head.done=!1),!(1&g.wrap)||(((255&V)<<8)+(V>>8))%31){O.msg="incorrect header check",g.mode=30;break}if((15&V)!=8){O.msg="unknown compression method",g.mode=30;break}if(Y-=4,F=8+(15&(V>>>=4)),g.wbits===0)g.wbits=F;else if(F>g.wbits){O.msg="invalid window size",g.mode=30;break}g.dmax=1<>8&1),512&g.flags&&(D[0]=255&V,D[1]=V>>>8&255,g.check=o(g.check,D,2,0)),Y=V=0,g.mode=3;case 3:for(;Y<32;){if(X===0)break e;X--,V+=b[z++]<>>8&255,D[2]=V>>>16&255,D[3]=V>>>24&255,g.check=o(g.check,D,4,0)),Y=V=0,g.mode=4;case 4:for(;Y<16;){if(X===0)break e;X--,V+=b[z++]<>8),512&g.flags&&(D[0]=255&V,D[1]=V>>>8&255,g.check=o(g.check,D,2,0)),Y=V=0,g.mode=5;case 5:if(1024&g.flags){for(;Y<16;){if(X===0)break e;X--,V+=b[z++]<>>8&255,g.check=o(g.check,D,2,0)),Y=V=0}else g.head&&(g.head.extra=null);g.mode=6;case 6:if(1024&g.flags&&(X<(K=g.length)&&(K=X),K&&(g.head&&(F=g.head.extra_len-g.length,g.head.extra||(g.head.extra=new Array(g.head.extra_len)),n.arraySet(g.head.extra,b,z,K,F)),512&g.flags&&(g.check=o(g.check,b,K,z)),X-=K,z+=K,g.length-=K),g.length))break e;g.length=0,g.mode=7;case 7:if(2048&g.flags){if(X===0)break e;for(K=0;F=b[z+K++],g.head&&F&&g.length<65536&&(g.head.name+=String.fromCharCode(F)),F&&K>9&1,g.head.done=!0),O.adler=g.check=0,g.mode=12;break;case 10:for(;Y<32;){if(X===0)break e;X--,V+=b[z++]<>>=7&Y,Y-=7&Y,g.mode=27;break}for(;Y<3;){if(X===0)break e;X--,V+=b[z++]<>>=1)){case 0:g.mode=14;break;case 1:if(M(g),g.mode=20,v!==6)break;V>>>=2,Y-=2;break e;case 2:g.mode=17;break;case 3:O.msg="invalid block type",g.mode=30}V>>>=2,Y-=2;break;case 14:for(V>>>=7&Y,Y-=7&Y;Y<32;){if(X===0)break e;X--,V+=b[z++]<>>16^65535)){O.msg="invalid stored block lengths",g.mode=30;break}if(g.length=65535&V,Y=V=0,g.mode=15,v===6)break e;case 15:g.mode=16;case 16:if(K=g.length){if(X>>=5,Y-=5,g.ndist=1+(31&V),V>>>=5,Y-=5,g.ncode=4+(15&V),V>>>=4,Y-=4,286>>=3,Y-=3}for(;g.have<19;)g.lens[W[g.have++]]=0;if(g.lencode=g.lendyn,g.lenbits=7,G={bits:g.lenbits},H=c(0,g.lens,0,19,g.lencode,0,g.work,G),g.lenbits=G.bits,H){O.msg="invalid code lengths set",g.mode=30;break}g.have=0,g.mode=19;case 19:for(;g.have>>16&255,he=65535&N,!((re=N>>>24)<=Y);){if(X===0)break e;X--,V+=b[z++]<>>=re,Y-=re,g.lens[g.have++]=he;else{if(he===16){for(_=re+2;Y<_;){if(X===0)break e;X--,V+=b[z++]<>>=re,Y-=re,g.have===0){O.msg="invalid bit length repeat",g.mode=30;break}F=g.lens[g.have-1],K=3+(3&V),V>>>=2,Y-=2}else if(he===17){for(_=re+3;Y<_;){if(X===0)break e;X--,V+=b[z++]<>>=re)),V>>>=3,Y-=3}else{for(_=re+7;Y<_;){if(X===0)break e;X--,V+=b[z++]<>>=re)),V>>>=7,Y-=7}if(g.have+K>g.nlen+g.ndist){O.msg="invalid bit length repeat",g.mode=30;break}for(;K--;)g.lens[g.have++]=F}}if(g.mode===30)break;if(g.lens[256]===0){O.msg="invalid code -- missing end-of-block",g.mode=30;break}if(g.lenbits=9,G={bits:g.lenbits},H=c(h,g.lens,0,g.nlen,g.lencode,0,g.work,G),g.lenbits=G.bits,H){O.msg="invalid literal/lengths set",g.mode=30;break}if(g.distbits=6,g.distcode=g.distdyn,G={bits:g.distbits},H=c(d,g.lens,g.nlen,g.ndist,g.distcode,0,g.work,G),g.distbits=G.bits,H){O.msg="invalid distances set",g.mode=30;break}if(g.mode=20,v===6)break e;case 20:g.mode=21;case 21:if(6<=X&&258<=ne){O.next_out=J,O.avail_out=ne,O.next_in=z,O.avail_in=X,g.hold=V,g.bits=Y,a(O,ee),J=O.next_out,Z=O.output,ne=O.avail_out,z=O.next_in,b=O.input,X=O.avail_in,V=g.hold,Y=g.bits,g.mode===12&&(g.back=-1);break}for(g.back=0;ue=(N=g.lencode[V&(1<>>16&255,he=65535&N,!((re=N>>>24)<=Y);){if(X===0)break e;X--,V+=b[z++]<>pe)])>>>16&255,he=65535&N,!(pe+(re=N>>>24)<=Y);){if(X===0)break e;X--,V+=b[z++]<>>=pe,Y-=pe,g.back+=pe}if(V>>>=re,Y-=re,g.back+=re,g.length=he,ue===0){g.mode=26;break}if(32&ue){g.back=-1,g.mode=12;break}if(64&ue){O.msg="invalid literal/length code",g.mode=30;break}g.extra=15&ue,g.mode=22;case 22:if(g.extra){for(_=g.extra;Y<_;){if(X===0)break e;X--,V+=b[z++]<>>=g.extra,Y-=g.extra,g.back+=g.extra}g.was=g.length,g.mode=23;case 23:for(;ue=(N=g.distcode[V&(1<>>16&255,he=65535&N,!((re=N>>>24)<=Y);){if(X===0)break e;X--,V+=b[z++]<>pe)])>>>16&255,he=65535&N,!(pe+(re=N>>>24)<=Y);){if(X===0)break e;X--,V+=b[z++]<>>=pe,Y-=pe,g.back+=pe}if(V>>>=re,Y-=re,g.back+=re,64&ue){O.msg="invalid distance code",g.mode=30;break}g.offset=he,g.extra=15&ue,g.mode=24;case 24:if(g.extra){for(_=g.extra;Y<_;){if(X===0)break e;X--,V+=b[z++]<>>=g.extra,Y-=g.extra,g.back+=g.extra}if(g.offset>g.dmax){O.msg="invalid distance too far back",g.mode=30;break}g.mode=25;case 25:if(ne===0)break e;if(K=ee-ne,g.offset>K){if((K=g.offset-K)>g.whave&&g.sane){O.msg="invalid distance too far back",g.mode=30;break}Fe=K>g.wnext?(K-=g.wnext,g.wsize-K):g.wnext-K,K>g.length&&(K=g.length),Ne=g.window}else Ne=Z,Fe=J-g.offset,K=g.length;for(ney?(P=Fe[Ne+C[v]],Y[ie+C[v]]):(P=96,0),m=1<>J)+(A-=m)]=w<<24|P<<16|M|0,A!==0;);for(m=1<>=1;if(m!==0?(V&=m-1,V+=m):V=0,v++,--ee[O]==0){if(O===b)break;O=d[I+C[v]]}if(Z>>7)]}function ie(N,D){N.pending_buf[N.pending++]=255&D,N.pending_buf[N.pending++]=D>>>8&255}function ee(N,D,W){N.bi_valid>T-W?(N.bi_buf|=D<>T-N.bi_valid,N.bi_valid+=W-T):(N.bi_buf|=D<>>=1,W<<=1,0<--D;);return W>>>1}function Ne(N,D,W){var j,U,q=new Array(C+1),te=0;for(j=1;j<=C;j++)q[j]=te=te+W[j-1]<<1;for(U=0;U<=D;U++){var Q=N[2*U+1];Q!==0&&(N[2*U]=Fe(q[Q]++,Q))}}function re(N){var D;for(D=0;D>1;1<=W;W--)pe(N,q,W);for(U=oe;W=N.heap[1],N.heap[1]=N.heap[N.heap_len--],pe(N,q,1),j=N.heap[1],N.heap[--N.heap_max]=W,N.heap[--N.heap_max]=j,q[2*U]=q[2*W]+q[2*j],N.depth[U]=(N.depth[W]>=N.depth[j]?N.depth[W]:N.depth[j])+1,q[2*W+1]=q[2*j+1]=U,N.heap[1]=U++,pe(N,q,1),2<=N.heap_len;);N.heap[--N.heap_max]=N.heap[1],function(de,Xe){var fs,ot,ps,ye,ks,xi,dt=Xe.dyn_tree,rr=Xe.max_code,ya=Xe.stat_desc.static_tree,La=Xe.stat_desc.has_stree,Pa=Xe.stat_desc.extra_bits,or=Xe.stat_desc.extra_base,Cs=Xe.stat_desc.max_length,Hs=0;for(ye=0;ye<=C;ye++)de.bl_count[ye]=0;for(dt[2*de.heap[de.heap_max]+1]=0,fs=de.heap_max+1;fs>=7;U>>=1)if(1&Te&&Q.dyn_ltree[2*oe]!==0)return r;if(Q.dyn_ltree[18]!==0||Q.dyn_ltree[20]!==0||Q.dyn_ltree[26]!==0)return o;for(oe=32;oe>>3,(q=N.static_len+3+7>>>3)<=U&&(U=q)):U=q=W+5,W+4<=U&&D!==-1?_(N,D,W,j):N.strategy===4||q===U?(ee(N,2+(j?1:0),3),We(N,B,O)):(ee(N,4+(j?1:0),3),function(Q,oe,Te,de){var Xe;for(ee(Q,oe-257,5),ee(Q,Te-1,5),ee(Q,de-4,4),Xe=0;Xe>>8&255,N.pending_buf[N.d_buf+2*N.last_lit+1]=255&D,N.pending_buf[N.l_buf+N.last_lit]=255&W,N.last_lit++,D===0?N.dyn_ltree[2*W]++:(N.matches++,D--,N.dyn_ltree[2*(g[W]+d+1)]++,N.dyn_dtree[2*Y(D)]++),N.last_lit===N.lit_bufsize-1},i._tr_align=function(N){ee(N,2,3),K(N,A,B),function(D){D.bi_valid===16?(ie(D,D.bi_buf),D.bi_buf=0,D.bi_valid=0):8<=D.bi_valid&&(D.pending_buf[D.pending++]=255&D.bi_buf,D.bi_buf>>=8,D.bi_valid-=8)}(N)}},{"../utils/common":41}],53:[function(t,s,i){s.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,s,i){(function(n){(function(r,o){if(!r.setImmediate){var a,c,h,d,I=1,u={},f=!1,E=r.document,C=Object.getPrototypeOf&&Object.getPrototypeOf(r);C=C&&C.setTimeout?C:r,a={}.toString.call(r.process)==="[object process]"?function(R){process.nextTick(function(){m(R)})}:function(){if(r.postMessage&&!r.importScripts){var R=!0,S=r.onmessage;return r.onmessage=function(){R=!1},r.postMessage("","*"),r.onmessage=S,R}}()?(d="setImmediate$"+Math.random()+"$",r.addEventListener?r.addEventListener("message",A,!1):r.attachEvent("onmessage",A),function(R){r.postMessage(d+R,"*")}):r.MessageChannel?((h=new MessageChannel).port1.onmessage=function(R){m(R.data)},function(R){h.port2.postMessage(R)}):E&&"onreadystatechange"in E.createElement("script")?(c=E.documentElement,function(R){var S=E.createElement("script");S.onreadystatechange=function(){m(R),S.onreadystatechange=null,c.removeChild(S),S=null},c.appendChild(S)}):function(R){setTimeout(m,0,R)},C.setImmediate=function(R){typeof R!="function"&&(R=new Function(""+R));for(var S=new Array(arguments.length-1),L=0;L"u"?n===void 0?this:n:self)}).call(this,typeof fi<"u"?fi:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Zo);var ph=Zo.exports;const Qr=fh(ph);var sr={},bi={};(function(l){const e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",t=e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",s="["+e+"]["+t+"]*",i=new RegExp("^"+s+"$"),n=function(o,a){const c=[];let h=a.exec(o);for(;h;){const d=[];d.startIndex=a.lastIndex-h[0].length;const I=h.length;for(let u=0;u"u")};l.isExist=function(o){return typeof o<"u"},l.isEmptyObject=function(o){return Object.keys(o).length===0},l.merge=function(o,a,c){if(a){const h=Object.keys(a),d=h.length;for(let I=0;I"&&l[n]!==" "&&l[n]!==" "&&l[n]!==` +`&&l[n]!=="\r";n++)a+=l[n];if(a=a.trim(),a[a.length-1]==="/"&&(a=a.substring(0,a.length-1),n--),!Oh(a)){let d;return a.trim().length===0?d="Invalid space after '<'.":d="Tag '"+a+"' is an invalid name.",Le("InvalidTag",d,Be(l,n))}const c=Rh(l,n);if(c===!1)return Le("InvalidAttr","Attributes for '"+a+"' have open quote.",Be(l,n));let h=c.value;if(n=c.index,h[h.length-1]==="/"){const d=n-h.length;h=h.substring(0,h.length-1);const I=to(h,e);if(I===!0)s=!0;else return Le(I.err.code,I.err.msg,Be(l,d+I.err.line))}else if(o)if(c.tagClosed){if(h.trim().length>0)return Le("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",Be(l,r));if(t.length===0)return Le("InvalidTag","Closing tag '"+a+"' has not been opened.",Be(l,r));{const d=t.pop();if(a!==d.tagName){let I=Be(l,d.tagStartPos);return Le("InvalidTag","Expected closing tag '"+d.tagName+"' (opened in line "+I.line+", col "+I.col+") instead of closing tag '"+a+"'.",Be(l,r))}t.length==0&&(i=!0)}}else return Le("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",Be(l,n));else{const d=to(h,e);if(d!==!0)return Le(d.err.code,d.err.msg,Be(l,n-h.length+d.err.line));if(i===!0)return Le("InvalidXml","Multiple possible root nodes found.",Be(l,n));e.unpairedTags.indexOf(a)!==-1||t.push({tagName:a,tagStartPos:r}),s=!0}for(n++;n0)return Le("InvalidXml","Invalid '"+JSON.stringify(t.map(n=>n.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Le("InvalidXml","Start tag expected.",1);return!0};function Kr(l){return l===" "||l===" "||l===` +`||l==="\r"}function Jr(l,e){const t=e;for(;e5&&s==="xml")return Le("InvalidXml","XML declaration allowed only at the start of the document.",Be(l,e));if(l[e]=="?"&&l[e+1]==">"){e++;break}else continue}return e}function eo(l,e){if(l.length>e+5&&l[e+1]==="-"&&l[e+2]==="-"){for(e+=3;e"){e+=2;break}}else if(l.length>e+8&&l[e+1]==="D"&&l[e+2]==="O"&&l[e+3]==="C"&&l[e+4]==="T"&&l[e+5]==="Y"&&l[e+6]==="P"&&l[e+7]==="E"){let t=1;for(e+=8;e"&&(t--,t===0))break}else if(l.length>e+9&&l[e+1]==="["&&l[e+2]==="C"&&l[e+3]==="D"&&l[e+4]==="A"&&l[e+5]==="T"&&l[e+6]==="A"&&l[e+7]==="["){for(e+=8;e"){e+=2;break}}return e}const Th='"',mh="'";function Rh(l,e){let t="",s="",i=!1;for(;e"&&s===""){i=!0;break}t+=l[e]}return s!==""?!1:{value:t,index:e,tagClosed:i}}const gh=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function to(l,e){const t=ir.getAllMatches(l,gh),s={};for(let i=0;i!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(l,e,t){return l}},Nh=function(l){return Object.assign({},$o,l)};nr.buildOptions=Nh;nr.defaultOptions=$o;class yh{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}var Lh=yh;const Ph=bi;function _h(l,e){const t={};if(l[e+3]==="O"&&l[e+4]==="C"&&l[e+5]==="T"&&l[e+6]==="Y"&&l[e+7]==="P"&&l[e+8]==="E"){e=e+9;let s=1,i=!1,n=!1,r="";for(;e"){if(n?l[e-1]==="-"&&l[e-2]==="-"&&(n=!1,s--):s--,s===0)break}else l[e]==="["?i=!0:r+=l[e];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:t,i:e}}function wh(l,e){let t="";for(;e0&&i&&t[2]!=="."||!e.leadingZeros&&n.length>0&&!i&&t[1]!==".")return l;{const a=Number(t),c=""+a;return c.search(/[eE]/)!==-1||o?e.eNotation?a:l:t.indexOf(".")!==-1?c==="0"&&r===""||c===r||i&&c==="-"+r?a:l:n?r===c||i+r===c?a:l:t===c||t===i+c?a:l}}else return l}}function kh(l){return l&&l.indexOf(".")!==-1&&(l=l.replace(/0+$/,""),l==="."?l="0":l[0]==="."?l="0"+l:l[l.length-1]==="."&&(l=l.substr(0,l.length-1))),l}var Hh=zh;const qo=bi,Ms=Lh,Wh=Bh,Xh=Hh;let jh=class{constructor(l){this.options=l,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,16))}},this.addExternalEntities=Zh,this.parseXml=Jh,this.parseTextData=$h,this.resolveNameSpace=qh,this.buildAttributesMap=Kh,this.isItStopNode=iu,this.replaceEntitiesValue=tu,this.readStopNodeData=ru,this.saveTextToParentTag=su,this.addChild=eu}};function Zh(l){const e=Object.keys(l);for(let t=0;t0)){r||(l=this.replaceEntitiesValue(l));const o=this.options.tagValueProcessor(e,l,t,i,n);return o==null?l:typeof o!=typeof l||o!==l?o:this.options.trimValues?An(l,this.options.parseTagValue,this.options.numberParseOptions):l.trim()===l?An(l,this.options.parseTagValue,this.options.numberParseOptions):l}}function qh(l){if(this.options.removeNSPrefix){const e=l.split(":"),t=l.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(l=t+e[1])}return l}const Qh=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Kh(l,e,t){if(!this.options.ignoreAttributes&&typeof l=="string"){const s=qo.getAllMatches(l,Qh),i=s.length,n={};for(let r=0;r",n,"Closing Tag is not closed.");let o=l.substring(n+2,r).trim();if(this.options.removeNSPrefix){const h=o.indexOf(":");h!==-1&&(o=o.substr(h+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),t&&(s=this.saveTextToParentTag(s,t,i));const a=i.substring(i.lastIndexOf(".")+1);if(o&&this.options.unpairedTags.indexOf(o)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let c=0;a&&this.options.unpairedTags.indexOf(a)!==-1?(c=i.lastIndexOf(".",i.lastIndexOf(".")-1),this.tagsNodeStack.pop()):c=i.lastIndexOf("."),i=i.substring(0,c),t=this.tagsNodeStack.pop(),s="",n=r}else if(l[n+1]==="?"){let r=Sn(l,n,!1,"?>");if(!r)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,t,i),!(this.options.ignoreDeclaration&&r.tagName==="?xml"||this.options.ignorePiTags)){const o=new Ms(r.tagName);o.add(this.options.textNodeName,""),r.tagName!==r.tagExp&&r.attrExpPresent&&(o[":@"]=this.buildAttributesMap(r.tagExp,i,r.tagName)),this.addChild(t,o,i)}n=r.closeIndex+1}else if(l.substr(n+1,3)==="!--"){const r=Yt(l,"-->",n+4,"Comment is not closed.");if(this.options.commentPropName){const o=l.substring(n+4,r-2);s=this.saveTextToParentTag(s,t,i),t.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}n=r}else if(l.substr(n+1,2)==="!D"){const r=Wh(l,n);this.docTypeEntities=r.entities,n=r.i}else if(l.substr(n+1,2)==="!["){const r=Yt(l,"]]>",n,"CDATA is not closed.")-2,o=l.substring(n+9,r);s=this.saveTextToParentTag(s,t,i);let a=this.parseTextData(o,t.tagname,i,!0,!1,!0,!0);a==null&&(a=""),this.options.cdataPropName?t.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]):t.add(this.options.textNodeName,a),n=r+2}else{let r=Sn(l,n,this.options.removeNSPrefix),o=r.tagName;const a=r.rawTagName;let c=r.tagExp,h=r.attrExpPresent,d=r.closeIndex;this.options.transformTagName&&(o=this.options.transformTagName(o)),t&&s&&t.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,t,i,!1));const I=t;if(I&&this.options.unpairedTags.indexOf(I.tagname)!==-1&&(t=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf("."))),o!==e.tagname&&(i+=i?"."+o:o),this.isItStopNode(this.options.stopNodes,i,o)){let u="";if(c.length>0&&c.lastIndexOf("/")===c.length-1)o[o.length-1]==="/"?(o=o.substr(0,o.length-1),i=i.substr(0,i.length-1),c=o):c=c.substr(0,c.length-1),n=r.closeIndex;else if(this.options.unpairedTags.indexOf(o)!==-1)n=r.closeIndex;else{const E=this.readStopNodeData(l,a,d+1);if(!E)throw new Error(`Unexpected end of ${a}`);n=E.i,u=E.tagContent}const f=new Ms(o);o!==c&&h&&(f[":@"]=this.buildAttributesMap(c,i,o)),u&&(u=this.parseTextData(u,o,i,!0,h,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),f.add(this.options.textNodeName,u),this.addChild(t,f,i)}else{if(c.length>0&&c.lastIndexOf("/")===c.length-1){o[o.length-1]==="/"?(o=o.substr(0,o.length-1),i=i.substr(0,i.length-1),c=o):c=c.substr(0,c.length-1),this.options.transformTagName&&(o=this.options.transformTagName(o));const u=new Ms(o);o!==c&&h&&(u[":@"]=this.buildAttributesMap(c,i,o)),this.addChild(t,u,i),i=i.substr(0,i.lastIndexOf("."))}else{const u=new Ms(o);this.tagsNodeStack.push(t),o!==c&&h&&(u[":@"]=this.buildAttributesMap(c,i,o)),this.addChild(t,u,i),t=u}s="",n=d}}else s+=l[n];return e.child};function eu(l,e,t){const s=this.options.updateTag(e.tagname,t,e[":@"]);s===!1||(typeof s=="string"&&(e.tagname=s),l.addChild(e))}const tu=function(l){if(this.options.processEntities){for(let e in this.docTypeEntities){const t=this.docTypeEntities[e];l=l.replace(t.regx,t.val)}for(let e in this.lastEntities){const t=this.lastEntities[e];l=l.replace(t.regex,t.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const t=this.htmlEntities[e];l=l.replace(t.regex,t.val)}l=l.replace(this.ampEntity.regex,this.ampEntity.val)}return l};function su(l,e,t,s){return l&&(s===void 0&&(s=Object.keys(e.child).length===0),l=this.parseTextData(l,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,s),l!==void 0&&l!==""&&e.add(this.options.textNodeName,l),l=""),l}function iu(l,e,t){const s="*."+t;for(const i in l){const n=l[i];if(s===n||e===n)return!0}return!1}function nu(l,e,t=">"){let s,i="";for(let n=e;n",t,`${e} is not closed`);if(l.substring(t+2,n).trim()===e&&(i--,i===0))return{tagContent:l.substring(s,t),i:n};t=n}else if(l[t+1]==="?")t=Yt(l,"?>",t+1,"StopNode is not closed.");else if(l.substr(t+1,3)==="!--")t=Yt(l,"-->",t+3,"StopNode is not closed.");else if(l.substr(t+1,2)==="![")t=Yt(l,"]]>",t,"StopNode is not closed.")-2;else{const n=Sn(l,t,">");n&&((n&&n.tagName)===e&&n.tagExp[n.tagExp.length-1]!=="/"&&i++,t=n.closeIndex)}}function An(l,e,t){if(e&&typeof l=="string"){const s=l.trim();return s==="true"?!0:s==="false"?!1:Xh(l,t)}else return qo.isExist(l)?l:""}var ou=jh,Qo={};function au(l,e){return Ko(l,e)}function Ko(l,e,t){let s;const i={};for(let n=0;n0&&(i[e.textNodeName]=s):s!==void 0&&(i[e.textNodeName]=s),i}function lu(l){const e=Object.keys(l);for(let t=0;t0&&(t=Cu),Jo(l,e,"",t)}function Jo(l,e,t,s){let i="",n=!1;for(let r=0;r`,n=!1;continue}else if(a===e.commentPropName){i+=s+``,n=!0;continue}else if(a[0]==="?"){const f=so(o[":@"],e),E=a==="?xml"?"":s;let C=o[a][0][e.textNodeName];C=C.length!==0?" "+C:"",i+=E+`<${a}${C}${f}?>`,n=!0;continue}let h=s;h!==""&&(h+=e.indentBy);const d=so(o[":@"],e),I=s+`<${a}${d}`,u=Jo(o[a],e,c,h);e.unpairedTags.indexOf(a)!==-1?e.suppressUnpairedNode?i+=I+">":i+=I+"/>":(!u||u.length===0)&&e.suppressEmptyNode?i+=I+"/>":u&&u.endsWith(">")?i+=I+`>${u}${s}`:(i+=I+">",u&&s!==""&&(u.includes("/>")||u.includes("`),n=!0}return i}function mu(l){const e=Object.keys(l);for(let t=0;t0&&e.processEntities)for(let t=0;t","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Mt(l){this.options=Object.assign({},Su,l),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Nu),this.processTextOrObjNode=Au,this.options.format?(this.indentate=Ou,this.tagEndChar=`> +`,this.newLine=` +`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}Mt.prototype.build=function(l){return this.options.preserveOrder?Fu(l,this.options):(Array.isArray(l)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(l={[this.options.arrayNodeName]:l}),this.j2x(l,0).val)};Mt.prototype.j2x=function(l,e){let t="",s="";for(let i in l)if(Object.prototype.hasOwnProperty.call(l,i))if(typeof l[i]>"u")this.isAttribute(i)&&(s+="");else if(l[i]===null)this.isAttribute(i)?s+="":i[0]==="?"?s+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(l[i]instanceof Date)s+=this.buildTextValNode(l[i],i,"",e);else if(typeof l[i]!="object"){const n=this.isAttribute(i);if(n)t+=this.buildAttrPairStr(n,""+l[i]);else if(i===this.options.textNodeName){let r=this.options.tagValueProcessor(i,""+l[i]);s+=this.replaceEntitiesValue(r)}else s+=this.buildTextValNode(l[i],i,"",e)}else if(Array.isArray(l[i])){const n=l[i].length;let r="",o="";for(let a=0;a"u"))if(c===null)i[0]==="?"?s+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(typeof c=="object")if(this.options.oneListGroup){const h=this.j2x(c,e+1);r+=h.val,this.options.attributesGroupName&&c.hasOwnProperty(this.options.attributesGroupName)&&(o+=h.attrStr)}else r+=this.processTextOrObjNode(c,i,e);else if(this.options.oneListGroup){let h=this.options.tagValueProcessor(i,c);h=this.replaceEntitiesValue(h),r+=h}else r+=this.buildTextValNode(c,i,"",e)}this.options.oneListGroup&&(r=this.buildObjectNode(r,i,o,e)),s+=r}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const n=Object.keys(l[i]),r=n.length;for(let o=0;o"+l+i:this.options.commentPropName!==!1&&e===this.options.commentPropName&&n.length===0?this.indentate(s)+``+this.newLine:this.indentate(s)+"<"+e+t+n+this.tagEndChar+l+this.indentate(s)+i}};Mt.prototype.closeTag=function(l){let e="";return this.options.unpairedTags.indexOf(l)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(s)+``+this.newLine;if(e[0]==="?")return this.indentate(s)+"<"+e+t+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(e,l);return i=this.replaceEntitiesValue(i),i===""?this.indentate(s)+"<"+e+t+this.closeTag(e)+this.tagEndChar:this.indentate(s)+"<"+e+t+">"+i+"0&&this.options.processEntities)for(let e=0;e`);let t=null;this.modifiedDate&&(t=`${this.modifiedDate.toISOString()}`);let s=null;return this.modifiedAuthor&&(s=`${this.modifiedAuthor}`),` + + ${this.date.toISOString()} + ${this.author} + ${this.comment} + ${e??""} + ${s??""} + ${t??""} + + `}}const sa=class Lt{constructor(e){p(this,"guid",vt.create()),p(this,"title",Lt.default.title),p(this,"creationDate",new Date),p(this,"creationAuthor",""),p(this,"viewpoints",new Tt),p(this,"relatedTopics",new Tt),p(this,"comments",new St),p(this,"customData",{}),p(this,"description"),p(this,"serverAssignedId"),p(this,"dueDate"),p(this,"modifiedAuthor"),p(this,"modifiedDate"),p(this,"index"),p(this,"_type",Lt.default.type),p(this,"_status",Lt.default.status),p(this,"_priority",Lt.default.priority),p(this,"_stage",Lt.default.priority),p(this,"_assignedTo",Lt.default.assignedTo),p(this,"_labels",Lt.default.labels),p(this,"_components"),this._components=e;const t=e.get(Ye);this.creationAuthor=t.config.author,this.relatedTopics.guard=s=>s!==this.guid}set type(e){const t=this._components.get(Ye),{strict:s,types:i}=t.config;(!s||i.has(e))&&(this._type=e)}get type(){return this._type}set status(e){const t=this._components.get(Ye),{strict:s,statuses:i}=t.config;(!s||i.has(e))&&(this._status=e)}get status(){return this._status}set priority(e){const t=this._components.get(Ye);if(e){const{strict:s,priorities:i}=t.config;if(!(!s||i.has(e)))return;this._priority=e}else this._priority=e}get priority(){return this._priority}set stage(e){const t=this._components.get(Ye);if(e){const{strict:s,stages:i}=t.config;if(!(!s||i.has(e)))return;this._stage=e}else this._stage=e}get stage(){return this._stage}set assignedTo(e){const t=this._components.get(Ye);if(e){const{strict:s,users:i}=t.config;if(!(!s||i.has(e)))return;this._assignedTo=e}else this._assignedTo=e}get assignedTo(){return this._assignedTo}set labels(e){const t=this._components.get(Ye),{strict:s,labels:i}=t.config;if(s){const n=new Set;for(const r of e)(!s||i.has(r))&&n.add(r);this._labels=n}else this._labels=e}get labels(){return this._labels}get _managerVersion(){return this._components.get(Ye).config.version}set(e){const t=e,s=this;for(const i in e){if(i==="guid")continue;const n=t[i];i in this&&(s[i]=n)}return this._components.get(Ye).list.set(this.guid,this),this}createComment(e,t){const s=new On(this._components,e);return s.viewpoint=t,s.topic=this,this.comments.set(s.guid,s),s}createLabelTags(e=this._managerVersion){let t="Labels";e==="2.1"&&(t="Labels"),e==="3"&&(t="Label");let s=[...this.labels].map(i=>`<${t}>${i}`).join(` +`);for(const i in this.customData){const n=this.customData[i];typeof n=="string"&&(s+=` +<${t}>${n}`)}return e==="2.1"?s:e==="3"?s.length!==0?` +${s} +`:"":s}createCommentTags(e=this._managerVersion){const t=[...this.comments.values()].map(s=>s.serialize()).join(` +`);return e==="2.1"?t:e==="3"?t.length!==0?` +${t} +`:"":t}createViewpointTags(e=this._managerVersion){let t="Viewpoints";e==="2.1"&&(t="Viewpoints"),e==="3"&&(t="ViewPoint");const s=this._components.get(Ct),i=[...this.viewpoints].map(n=>s.list.get(n)).filter(n=>n).map(n=>`<${t} Guid="${n.guid}"> + ${n.guid}.bcfv + ${n.guid}.jpeg + + `).join(` +`);return e==="2.1"?i:e==="3"?i.length!==0?` +${i} +`:"":i}createRelatedTopicTags(e=this._managerVersion){const t=[...this.relatedTopics].map(s=>` + `).join(` +`);return e==="2.1"?t:e==="3"?t.length!==0?` +${t} +`:"":t}serialize(){const e=this._managerVersion;let t=null;this.serverAssignedId&&(t=`ServerAssignedId="${this.serverAssignedId}"`);let s=null;this.priority&&(s=`${this.priority}`);let i=null;this.index&&e==="2.1"&&(i=`${this.index}`);let n=null;this.modifiedDate&&(n=`${this.modifiedDate.toISOString()}`);let r=null;this.modifiedAuthor&&(r=`${this.modifiedAuthor}`);let o=null;this.dueDate&&(o=`${this.dueDate.toISOString()}`);let a=null;this.assignedTo&&(a=`${this.assignedTo}`);let c=null;this.description&&(c=`${this.description}`);let h=null;this.stage&&(h=`${this.stage}`);const d=this.createCommentTags(e),I=this.createViewpointTags(e),u=this.createLabelTags(e),f=this.createRelatedTopicTags(e);return` + + + + ${this.title} + ${this.creationDate.toISOString()} + ${this.creationAuthor} + ${s??""} + ${i??""} + ${n??""} + ${r??""} + ${o??""} + ${a??""} + ${c??""} + ${h??""} + ${u} + ${f} + ${e==="3"?d:""} + ${e==="3"?I:""} + + ${e==="2.1"?d:""} + ${e==="2.1"?I:""} + + `}};p(sa,"default",{title:"BCF Topic",type:"Issue",status:"Active",labels:new Set});let io=sa;const wu=(l,e)=>{if(e.trim()==="")return;const t=Ye.xmlParser.parse(e).Extensions;if(!t)return;const{Priorities:s,TopicStatuses:i,TopicTypes:n,Users:r}=t;if(s&&s.Priority){const o=Array.isArray(s.Priority)?s.Priority:[s.Priority];for(const a of o)l.config.priorities.add(a)}if(i&&i.TopicStatus){const o=Array.isArray(i.TopicStatus)?i.TopicStatus:[i.TopicStatus];for(const a of o)l.config.statuses.add(a)}if(n&&n.TopicType){const o=Array.isArray(n.TopicType)?n.TopicType:[n.TopicType];for(const a of o)l.config.types.add(a)}if(r&&r.User){const o=Array.isArray(r.User)?r.User:[r.User];for(const a of o)l.config.users.add(a)}};class vu extends kt{constructor(){super(...arguments),p(this,"_config",{version:{type:"Select",options:new Set,multiple:!1,value:""},author:{type:"Text",value:""},types:{type:"TextSet",value:new Set},statuses:{type:"TextSet",value:new Set},priorities:{type:"TextSet",value:new Set},labels:{type:"TextSet",value:new Set},stages:{type:"TextSet",value:new Set},users:{type:"TextSet",value:new Set},includeSelectionTag:{type:"Boolean",value:!1},updateExtensionsOnImport:{type:"Boolean",value:!1},strict:{type:"Boolean",value:!1},includeAllExtensionsOnExport:{type:"Boolean",value:!1},fallbackVersionOnImport:{type:"Select",multiple:!1,options:new Set,value:""},ignoreIncompleteTopicsOnImport:{type:"Boolean",value:!1}})}get version(){return this._config.version.value}set version(e){this._config.version.value=e}get author(){return this._config.author.value}set author(e){this._config.author.value=e}get types(){return this._config.types.value}set types(e){this._config.types.value=e}get statuses(){return this._config.statuses.value}set statuses(e){this._config.statuses.value=e}get priorities(){return this._config.priorities.value}set priorities(e){this._config.priorities.value=e}get labels(){return this._config.labels.value}set labels(e){this._config.labels.value=e}get stages(){return this._config.stages.value}set stages(e){this._config.stages.value=e}get users(){return this._config.users.value}set users(e){this._config.users.value=e}get includeSelectionTag(){return this._config.includeSelectionTag.value}set includeSelectionTag(e){this._config.includeSelectionTag.value=e}get updateExtensionsOnImport(){return this._config.updateExtensionsOnImport.value}set updateExtensionsOnImport(e){this._config.updateExtensionsOnImport.value=e}get strict(){return this._config.strict.value}set strict(e){this._config.strict.value=e}get includeAllExtensionsOnExport(){return this._config.includeAllExtensionsOnExport.value}set includeAllExtensionsOnExport(e){this._config.includeAllExtensionsOnExport.value=e}get fallbackVersionOnImport(){return this._config.fallbackVersionOnImport.value}set fallbackVersionOnImport(e){this._config.fallbackVersionOnImport.value=e}get ignoreIncompleteTopicsOnImport(){return this._config.ignoreIncompleteTopicsOnImport.value}set ignoreIncompleteTopicsOnImport(e){this._config.ignoreIncompleteTopicsOnImport.value=e}}const Nn=class Fi extends Ae{constructor(){super(...arguments),p(this,"enabled",!1),p(this,"_defaultConfig",{author:"jhon.doe@example.com",version:"2.1",types:new Set(["Clash","Failure","Fault","Inquiry","Issue","Remark","Request"]),statuses:new Set(["Active","In Progress","Done","In Review","Closed"]),priorities:new Set(["On hold","Minor","Normal","Major","Critical"]),labels:new Set,stages:new Set,users:new Set,includeSelectionTag:!1,updateExtensionsOnImport:!0,strict:!1,includeAllExtensionsOnExport:!0,fallbackVersionOnImport:"2.1",ignoreIncompleteTopicsOnImport:!1}),p(this,"config",new vu(this,this.components,"BCF Topics")),p(this,"list",new St),p(this,"onSetup",new $),p(this,"isSetup",!1),p(this,"onBCFImported",new $),p(this,"onDisposed",new $)}setup(e){if(this.isSetup)return;const t={...this._defaultConfig,...e};this.config.version=t.version,this.config.author=t.author,this.config.types=t.types,this.config.statuses=t.statuses,this.config.priorities=t.priorities,this.config.labels=t.labels,this.config.stages=t.stages,this.config.users=t.users,this.config.includeSelectionTag=t.includeSelectionTag,this.config.updateExtensionsOnImport=t.updateExtensionsOnImport,this.config.strict=t.strict,this.config.includeAllExtensionsOnExport=t.includeAllExtensionsOnExport,this.config.fallbackVersionOnImport=t.fallbackVersionOnImport||"",this.config.ignoreIncompleteTopicsOnImport=t.ignoreIncompleteTopicsOnImport,this.isSetup=!0,this.enabled=!0,this.onSetup.trigger()}create(e){const t=new io(this.components);return e&&(t.guid=e.guid??t.guid,t.set(e)),this.list.set(t.guid,t),t}dispose(){this.list.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}get usedTypes(){const e=[...this.list].map(([t,s])=>s.type);return new Set(e)}get usedStatuses(){const e=[...this.list].map(([t,s])=>s.status);return new Set(e)}get usedPriorities(){const e=[...this.list].map(([t,s])=>s.priority).filter(t=>t);return new Set(e)}get usedStages(){const e=[...this.list].map(([t,s])=>s.stage).filter(t=>t);return new Set(e)}get usedUsers(){const e=[];for(const[t,s]of this.list){e.push(s.creationAuthor),s.assignedTo&&e.push(s.assignedTo),s.modifiedAuthor&&e.push(s.modifiedAuthor);for(const[i,n]of s.comments)e.push(n.author),n.modifiedAuthor&&e.push(n.modifiedAuthor)}return new Set(e)}get usedLabels(){const e=[];for(const[t,s]of this.list)e.push(...s.labels);return new Set(e)}updateExtensions(){for(const[e,t]of this.list){for(const s of t.labels)this.config.labels.add(s);this.config.types.add(t.type),t.priority&&this.config.priorities.add(t.priority),t.stage&&this.config.stages.add(t.stage),this.config.statuses.add(t.status),this.config.users.add(t.creationAuthor),t.assignedTo&&this.config.users.add(t.assignedTo),t.modifiedAuthor&&this.config.users.add(t.modifiedAuthor);for(const[s,i]of t.comments)this.config.users.add(i.author),i.modifiedAuthor&&this.config.users.add(i.modifiedAuthor)}}updateViewpointReferences(){const e=this.components.get(Ct);for(const[t,s]of this.list)for(const i of s.viewpoints)e.list.has(i)||s.viewpoints.delete(i)}async export(e=this.list.values()){const t=new Qr;t.file("bcf.version",` + + `),t.file("bcf.extensions",this.serializeExtensions());const s=await(await fetch("https://thatopen.github.io/engine_components/resources/favicon.ico")).blob(),i=this.components.get(Ct);for(const n of e){const r=t.folder(n.guid);r.file("markup.bcf",n.serialize());for(const o of n.viewpoints){const a=i.list.get(o);a&&(r.file(`${o}.jpeg`,s,{binary:!0}),r.file(`${o}.bcfv`,await a.serialize()))}}return await t.generateAsync({type:"blob"})}serializeExtensions(){const e=[...this.config.types].map(o=>`${o}`).join(` +`),t=[...this.config.statuses].map(o=>`${o}`).join(` +`),s=[...this.config.priorities].map(o=>`${o}`).join(` +`),i=[...this.config.labels].map(o=>`${o}`).join(` +`),n=[...this.config.stages].map(o=>`${o}`).join(` +`),r=[...this.config.users].map(o=>`${o}`).join(` +`);return` + + + ${e.length!==0?` +${e} +`:""} + ${t.length!==0?` +${t} +`:""} + ${s.length!==0?` +${s} +`:""} + ${i.length!==0?` +${i} +`:""} + ${n.length!==0?` +${n} +`:""} + ${r.length!==0?` +${r} +`:""} + + `}processMarkupComment(e){const{Guid:t,Date:s,Author:i,Comment:n,Viewpoint:r}=e;if(!(t&&s&&i&&(On||r)))return null;const o=this.components.get(Ct),a=new On(this.components,n??"");return a.guid=t,a.date=new Date(s),a.author=i,a.viewpoint=r!=null&&r.Guid?o.list.get(r.Guid):void 0,a.modifiedAuthor=e.ModifiedAuthor,a.modifiedDate=e.ModifiedDate?new Date(e.ModifiedDate):void 0,a}getMarkupComments(e,t){var s;let i;if(t==="2.1"&&(i=e.Comment),t==="3"&&(i=(s=e.Topic.Comments)==null?void 0:s.Comment),!i)return[];i=Array.isArray(i)?i:[i];const n=i.map(r=>this.processMarkupComment(r)).filter(r=>r);return Array.isArray(n)?n:[n]}getMarkupLabels(e,t){var s;let i;return t==="2.1"&&(i=e.Topic.Labels),t==="3"&&(i=(s=e.Topic.Labels)==null?void 0:s.Label),i?Array.isArray(i)?i:[i]:[]}getMarkupViewpoints(e,t){var s;let i;return t==="2.1"&&(i=e.Viewpoints),t==="3"&&(i=(s=e.Topic.Viewpoints)==null?void 0:s.ViewPoint),i?(i=Array.isArray(i)?i:[i],i):[]}getMarkupRelatedTopics(e,t){var s;let i;return t==="2.1"&&(i=e.Topic.RelatedTopic),t==="3"&&(i=(s=e.Topic.RelatedTopics)==null?void 0:s.RelatedTopic),i?(Array.isArray(i)?i:[i]).map(n=>n.Guid):[]}async load(e,t){var s;const{fallbackVersionOnImport:i,ignoreIncompleteTopicsOnImport:n,updateExtensionsOnImport:r}=this.config,o=new Qr;await o.loadAsync(e);const a=Object.values(o.files);let c=i;const h=a.find(m=>m.name.endsWith(".version"));if(h){const m=await h.async("string"),A=Fi.xmlParser.parse(m).Version.VersionId;c=String(A)}if(!(c&&(c==="2.1"||c==="3")))throw new Error(`BCFTopics: ${c} is not supported.`);const d=a.find(m=>m.name.endsWith(".extensions"));if(r&&d){const m=await d.async("string");wu(this,m)}const I=[],u=this.components.get(Ct),f=a.filter(m=>m.name.endsWith(".bcfv"));for(const m of f){const A=await m.async("string"),R=Fi.xmlParser.parse(A).VisualizationInfo;if(!R){console.warn("Missing VisualizationInfo in Viewpoint");continue}const S={},{Guid:L,ClippingPlanes:y,Components:w,OrthogonalCamera:P,PerspectiveCamera:M}=R;if(L&&(S.guid=L),w){const{Selection:O,Visibility:v}=w;if(O&&O.Component){const b=Array.isArray(O.Component)?O.Component:[O.Component];S.selectionComponents=b.map(Z=>Z.IfcGuid).filter(Z=>Z)}if(v&&"DefaultVisibility"in v&&(S.defaultVisibility=v.DefaultVisibility),v&&v.Exceptions&&"Component"in v.Exceptions){const{Component:b}=v.Exceptions,Z=Array.isArray(b)?b:[b];S.exceptionComponents=Z.map(z=>z.IfcGuid).filter(z=>z)}let g;c==="2.1"&&(g=w.ViewSetupHints),c==="3"&&(g=(s=w.Visibility)==null?void 0:s.ViewSetupHints),g&&("OpeningsVisible"in g&&(S.openingsVisible=g.OpeningsVisible),"SpacesVisible"in g&&(S.spacesVisible=g.SpacesVisible),"SpaceBoundariesVisible"in g&&(S.spaceBoundariesVisible=g.SpaceBoundariesVisible))}if(P||M){const O=R.PerspectiveCamera??R.OrthogonalCamera,{CameraViewPoint:v,CameraDirection:g}=O,b=new x(Number(v.X),Number(v.Z),Number(-v.Y)),Z=new x(Number(g.X),Number(g.Z),Number(-g.Y)),z={position:{x:b.x,y:b.y,z:b.z},direction:{x:Z.x,y:Z.y,z:Z.z},aspectRatio:"AspectRatio"in O?O.AspectRatio:1};"ViewToWorldScale"in O&&(S.camera={...z,viewToWorldScale:O.ViewToWorldScale}),"FieldOfView"in O&&(S.camera={...z,fov:O.FieldOfView})}const B=new Ra(this.components,t,{data:S,setCamera:!1});if(w){const{Coloring:O}=w;if(O&&O.Color){const v=Array.isArray(O.Color)?O.Color:[O.Color];for(const g of v){const{Color:b,Component:Z}=g,z=(Array.isArray(Z)?Z:[Z]).map(J=>J.IfcGuid);B.componentColors.set(b,z)}}}if(I.push(B),y){const O=this.components.get(sh),v=Array.isArray(y.ClippingPlane)?y.ClippingPlane:[y.ClippingPlane];for(const g of v){const{Location:b,Direction:Z}=g;if(!(b&&Z))continue;const z=new x(b.X,b.Z,-b.Y),J=new x(Z.X,-Z.Z,Z.Y),X=O.createFromNormalAndCoplanarPoint(t,J,z);X.visible=!1,X.enabled=!1,B.clippingPlanes.add(X)}}}const E={},C=[],T=a.filter(m=>m.name.endsWith(".bcf"));for(const m of T){const A=await m.async("string"),R=Fi.xmlParser.parse(A).Markup,S=R.Topic,{Guid:L,TopicType:y,TopicStatus:w,Title:P,CreationDate:M,CreationAuthor:B}=S;if(n&&!(L&&y&&w&&P&&M&&B))continue;const O=new io(this.components);O.guid=L??O.guid;const v=this.getMarkupRelatedTopics(R,c);E[O.guid]=new Set(v),O.type=y??O.type,O.status=w??O.status,O.title=P??O.title,O.creationDate=M?new Date(M):O.creationDate,O.creationAuthor=B??O.creationAuthor,O.serverAssignedId=S.ServerAssignedId,O.priority=S.Priority,O.index=S.Index,O.modifiedDate=S.ModifiedDate?new Date(S.ModifiedDate):void 0,O.modifiedAuthor=S.ModifiedAuthor,O.dueDate=S.DueDate?new Date(S.DueDate):void 0,O.assignedTo=S.AssignedTo,O.description=S.Description,O.stage=S.Stage;const g=this.getMarkupLabels(R,c);for(const z of g)O.labels.add(z);const b=this.getMarkupComments(R,c);for(const z of b)O.comments.set(z.guid,z);const Z=this.getMarkupViewpoints(R,c);for(const z of Z){if(!(z&&z.Guid))continue;const J=u.list.get(z.Guid);J&&O.viewpoints.add(J.guid)}this.list.set(O.guid,O),C.push(O)}for(const m in E){const A=this.list.get(m);if(!A)continue;const R=E[m];for(const S of R)A.relatedTopics.add(S)}return this.onBCFImported.trigger(C),{viewpoints:I,topics:C}}};p(Nn,"uuid","de977976-e4f6-4e4f-a01a-204727839802"),p(Nn,"xmlParser",new ta.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",ignoreAttributes:!1,ignoreDeclaration:!0,ignorePiTags:!0,numberParseOptions:{leadingZeros:!0,hex:!0},parseAttributeValue:!0,preserveOrder:!1,processEntities:!1,removeNSPrefix:!0,trimValues:!0}));let Ye=Nn;const ia=class ft extends Ae{constructor(e){super(e),p(this,"enabled",!0),p(this,"onDisposed",new $),p(this,"_absoluteMin"),p(this,"_absoluteMax"),p(this,"_meshes",[]),this.components.add(ft.uuid,this),this._absoluteMin=ft.newBound(!0),this._absoluteMax=ft.newBound(!1)}static getDimensions(e){const{min:t,max:s}=e,i=Math.abs(s.x-t.x),n=Math.abs(s.y-t.y),r=Math.abs(s.z-t.z),o=new x;return o.subVectors(s,t).divideScalar(2).add(t),{width:i,height:n,depth:r,center:o}}static newBound(e){const t=e?1:-1;return new x(t*Number.MAX_VALUE,t*Number.MAX_VALUE,t*Number.MAX_VALUE)}static getBounds(e,t,s){const i=s||this.newBound(!1),n=t||this.newBound(!0);for(const r of e)r.xi.x&&(i.x=r.x),r.y>i.y&&(i.y=r.y),r.z>i.z&&(i.z=r.z);return new we(t,s)}dispose(){const e=this.components.get(ds);for(const t of this._meshes)e.destroy(t);this._meshes=[],this.onDisposed.trigger(ft.uuid),this.onDisposed.reset()}get(){const e=this._absoluteMin.clone(),t=this._absoluteMax.clone();return new we(e,t)}getSphere(){const e=this._absoluteMin.clone(),t=this._absoluteMax.clone(),s=Math.abs((t.x-e.x)/2),i=Math.abs((t.y-e.y)/2),n=Math.abs((t.z-e.z)/2),r=new x(e.x+s,e.y+i,e.z+n),o=r.distanceTo(e);return new Li(r,o)}getMesh(){const e=new we(this._absoluteMin,this._absoluteMax),t=ft.getDimensions(e),{width:s,height:i,depth:n,center:r}=t,o=new De(s,i,n),a=new se(o);return this._meshes.push(a),a.position.copy(r),a}reset(){this._absoluteMin=ft.newBound(!0),this._absoluteMax=ft.newBound(!1)}add(e){for(const t of e.items)this.addMesh(t.mesh)}addMesh(e,t){if(!e.geometry.index)return;const s=ft.getFragmentBounds(e);e.updateMatrixWorld();const i=e.matrixWorld,n=new Ee,r=e instanceof Vt,o=new Set;if(e instanceof Va){t||(t=e.fragment.ids);for(const a of t){const c=e.fragment.getInstancesIDs(a);if(c)for(const h of c)o.add(h)}}else o.add(0);for(const a of o){const c=s.min.clone(),h=s.max.clone();r&&(e.getMatrixAt(a,n),c.applyMatrix4(n),h.applyMatrix4(n)),c.applyMatrix4(i),h.applyMatrix4(i),c.xthis._absoluteMax.x&&(this._absoluteMax.x=c.x),c.y>this._absoluteMax.y&&(this._absoluteMax.y=c.y),c.z>this._absoluteMax.z&&(this._absoluteMax.z=c.z),h.x>this._absoluteMax.x&&(this._absoluteMax.x=h.x),h.y>this._absoluteMax.y&&(this._absoluteMax.y=h.y),h.z>this._absoluteMax.z&&(this._absoluteMax.z=h.z),h.xr.x&&(r.x=h),d>r.y&&(r.y=d),I>r.z&&(r.z=I)}return new we(n,r)}};p(ia,"uuid","d1444724-dba6-4cdd-a0c7-68ee1450d166");let Mu=ia;const na=class ra{constructor(e){p(this,"onProgress",new $),p(this,"inclusive",!1),p(this,"rules",[]),p(this,"ids",{}),p(this,"needsUpdate",new Map),p(this,"components"),this.components=e}static import(e,t){const s=ra.importers.get(t.type);return s?s(e,t):(console.warn("Invalid query data:.",t),null)}static importRules(e){const t=[];for(const s of e){const i={};for(const n in s){const r=s[n];r.regexp?i[n]=new RegExp(r.value):i[n]=r}t.push(i)}return t}static importIds(e){const t={};for(const s in e.ids)t[s]=new Set(e.ids[s]);return t}clear(e){if(e===void 0){this.ids={},this.needsUpdate.clear();return}delete this.ids[e],this.needsUpdate.delete(e)}addID(e,t){this.ids[e]||(this.ids[e]=new Set),this.ids[e].add(t)}getData(){const e={};for(const s in this.ids)e[s]=Array.from(this.ids[s]);const t=this.exportRules();return{name:this.name,inclusive:this.inclusive,type:"IfcFinderQuery",ids:e,rules:t}}exportRules(){const e=[];for(const t of this.rules){const s={};for(const i in t){const n=t[i];n instanceof RegExp?s[i]={regexp:!0,value:n.source}:s[i]=n}e.push(s)}return e}findInFile(e,t){return new Promise(s=>{const i=new FileReader,n=new TextDecoder("utf-8"),r=1e4*1024,o=1e3;let a=0;const c=/;/,h=()=>{if(a>=t.size){s();return}const d=Math.min(a+r+o,t.size),I=t.slice(a,d);i.readAsArrayBuffer(I)};i.onload=()=>{if(!(i.result instanceof ArrayBuffer))return;const d=new Uint8Array(i.result),I=n.decode(d).split(c);I.shift(),this.findInLines(e,I),this.onProgress.trigger(a/t.size),a+=r,h()},h()})}getIdFromLine(e){const t=e.slice(e.indexOf("#")+1,e.indexOf("="));return parseInt(t,10)}testRules(e){let t=null,s=null,i=null,n=!1;for(const r of this.rules){if(r.type==="category"){if(t===null&&(t=this.getCategoryFromLine(e),t===null)){if(this.inclusive)continue;break}if(!r.value.test(t)){if(this.inclusive)continue;n=!1;break}n=!0;continue}if(s===null&&(s=this.getAttributesFromLine(e),s===null)){if(this.inclusive)continue;n=!1;break}if(t===null&&(t=this.getCategoryFromLine(e),t===null)){if(this.inclusive)continue;n=!1;break}if(i===null&&(i=Object.keys(new Ga[t]),i=i.slice(2),i===null)){if(this.inclusive)continue;n=!1;break}if(r.type==="property"){const{name:o,value:a}=r;if(!a.test(e)){if(this.inclusive)continue;n=!1;break}let c=!1;for(let h=0;h"&&parseFloat(u)>a){h=!0;break}else if(c===">="&&parseFloat(u)>=a){h=!0;break}else if(c==="<="&&parseFloat(u)<=a){h=!0;break}}}if(h)n=!0;else if(!this.inclusive){n=!1;break}}}return n}getCategoryFromLine(e){const t=e.indexOf("=")+1,s=e.indexOf("("),i=e.slice(t,s).trim();return lh[i]||null}getAttributesFromLine(e){const t=/\((.*)\)/,s=e.match(t);if(!(s&&s[1]))return null;const i=/,(?![^()]*\))/g;return s[1].split(i).map(n=>n.trim())}};p(na,"importers",new Map);let mt=na;class no{constructor(e){p(this,"list",new Map),p(this,"id",wn.generateUUID()),p(this,"mode","intersect"),p(this,"_components"),this._components=e}get queries(){return new Set(this.list.values())}get items(){const e=[];for(const t of this.queries)e.push(t.items);return this.mode==="combine"?Ai.combine(e):Ai.intersect(e)}add(e){if(this.list.has(e.name))throw new Error(`This group already has a query with the name ${e.name}.`);this.list.set(e.name,e)}clear(e){for(const t of this.queries)t.clear(e)}import(e){this.mode=e.mode,this.id=e.id;for(const t in e.queries){const s=mt.import(this._components,e.queries[t]);s&&this.list.set(t,s)}}export(){const e={};for(const[t,s]of this.list)e[t]=s.export();return{mode:this.mode,id:this.id,queries:e}}async update(e,t){for(const s of this.queries){const i=s.needsUpdate.get(e);(i===void 0||i)&&await s.update(e,t)}}}const oa=class aa extends mt{constructor(e,t){super(e),p(this,"name"),this.name=t.name,this.rules=t.rules,this.inclusive=t.inclusive}get items(){const e=this.components.get(Re),t=[];for(const s in this.ids){const i=this.ids[s],n=e.groups.get(s);if(!n){console.warn(`Model ${s} not found!`);continue}const r=n.getFragmentMap(i);t.push(r)}return Ai.combine(t)}export(){const e=this.getData();return e.type=aa.type,e}async update(e,t){this.ids[e]=new Set,await this.findInFile(e,t),this.needsUpdate.set(e,!1)}findInLines(e,t){for(const s of t)if(this.testRules(s)){const i=this.getIdFromLine(s);this.addID(e,i)}}};p(oa,"type","IfcBasicQuery");let ro=oa;mt.importers.set(ro.type,(l,e)=>{const t=new ro(l,{name:e.name,rules:mt.importRules(e.rules),inclusive:e.inclusive});return t.ids=mt.importIds(e),t});const la=class ca extends mt{constructor(e,t){super(e),p(this,"name"),p(this,"psets",[]),this.name=t.name,this.rules=t.rules,this.inclusive=t.inclusive}get items(){const e=this.components.get(rt),t=this.components.get(Re),s=[];for(const i in this.ids){const n=t.groups.get(i);if(!n){console.log(`Model not found: ${i}.`);continue}const r=this.ids[i];for(const o of r){const a=e.getEntityRelations(i,o,"DefinesOcurrence");if(a){const c=n.getFragmentMap(a);s.push(c)}}}return Ai.combine(s)}export(){const e=this.getData();return e.type=ca.type,e}async update(e,t){await this.findInFile(e,t);const s=new Set;for(const i of this.psets){const n=this.getAttributesFromLine(i);if(n===null)continue;const r=n[4].replace("(","[").replace(")","]").replace(/#/g,""),o=JSON.parse(r);for(const a of o){const c=this.ids[e];if(c&&c.has(a)){const h=this.getIdFromLine(i);s.add(h);break}}}this.ids[e]=s,this.psets=[],this.needsUpdate.set(e,!1)}findInLines(e,t){for(const s of t){const i=this.getCategoryFromLine(s);if(i==="IfcPropertySet"){this.psets.push(s);continue}if(i==="IfcPropertySingleValue"&&this.testRules(s)){const n=this.getIdFromLine(s);this.addID(e,n)}}}};p(la,"type","IfcPropertyQuery");let oo=la;mt.importers.set(oo.type,(l,e)=>{const t=new oo(l,{name:e.name,inclusive:e.inclusive,rules:mt.importRules(e.rules)});return t.ids=mt.importIds(e),t});const ha=class ua extends Ae{constructor(e){super(e),p(this,"enabled",!0),p(this,"list",new Map),e.add(ua.uuid,this)}get queries(){const e=new Set;for(const[,t]of this.list)for(const s of t.queries)e.add(s);return e}import(e){for(const t in e){const s=new no(this.components);s.import(e[t]),this.list.set(t,s)}}export(){const e={};for(const[t,s]of this.list)e[t]=s.export();return e}create(){const e=new no(this.components);return this.list.set(e.id,e),e}delete(e){this.list.delete(e)}clear(){this.list.clear()}};p(ha,"uuid","0da7ad77-f734-42ca-942f-a074adfd1e3a");let Ju=ha;const da=class Ia extends Ae{constructor(e){super(e),p(this,"enabled",!0),p(this,"list",{}),p(this,"onDisposed",new $),p(this,"onFragmentsDisposed",t=>{const{groupID:s,fragmentIDs:i}=t;for(const n in this.list){const r=this.list[n],o=Object.keys(r);if(o.includes(s))delete r[s],Object.values(r).length===0&&delete this.list[n];else for(const a of o){const c=r[a];for(const h of i)delete c.map[h];Object.values(c).length===0&&delete r[a]}}}),e.add(Ia.uuid,this),e.get(Re).onFragmentsDisposed.add(this.onFragmentsDisposed)}dispose(){this.list={},this.components.get(Re).onFragmentsDisposed.remove(this.onFragmentsDisposed),this.onDisposed.trigger(),this.onDisposed.reset()}remove(e){for(const t in this.list){const s=this.list[t];for(const i in s){const n=s[i];delete n.map[e]}}}find(e){const t=this.components.get(Re);if(!e){const r={};for(const[o,a]of t.list)r[o]=new Set(a.ids);return r}const s=Object.keys(e).length,i={};for(const r in e){const o=e[r];if(!this.list[r]){console.warn(`Classification ${r} does not exist.`);continue}for(const a of o){const c=this.list[r][a];if(c)for(const h in c.map){i[h]||(i[h]=new Map);for(const d of c.map[h]){const I=i[h].get(d);I===void 0?i[h].set(d,1):i[h].set(d,I+1)}}}}const n={};for(const r in i){const o=i[r];for(const[a,c]of o){if(c===void 0)throw new Error("Malformed fragments map!");c===s&&(n[r]||(n[r]=new Set),n[r].add(a))}}return n}byModel(e,t){this.list.models||(this.list.models={});const s=this.list.models;s[e]||(s[e]={map:{},id:null,name:e});const i=s[e];for(const[n,r]of t.data){const o=r[0];for(const a of o){const c=t.keyFragments.get(a);c&&(i.map[c]||(i.map[c]=new Set),i.map[c].add(n))}}}async byPredefinedType(e){var t;this.list.predefinedTypes||(this.list.predefinedTypes={});const s=this.list.predefinedTypes,i=e.getAllPropertiesIDs();for(const n of i){const r=await e.getProperties(n);if(!r)continue;const o=String((t=r.PredefinedType)==null?void 0:t.value).toUpperCase();s[o]||(s[o]={map:{},id:null,name:o});const a=s[o];for(const[c,h]of e.data){const d=h[0];for(const I of d){const u=e.keyFragments.get(I);if(!u)throw new Error("Fragment ID not found!");a.map[u]||(a.map[u]=new Set),a.map[u].add(r.expressID)}}}}byEntity(e){this.list.entities||(this.list.entities={});for(const[t,s]of e.data){const i=s[1][1],n=yi[i];this.saveItem(e,"entities",n,t)}}async byIfcRel(e,t,s){cs.isRel(t)&&await cs.getRelationMap(e,t,async(i,n)=>{const{name:r}=await cs.getEntityName(e,i);for(const o of n)this.saveItem(e,s,r??"NO REL NAME",o)})}async bySpatialStructure(e,t={}){var s,i;const n=this.components.get(rt),r=n.relationMaps[e.uuid];if(!r)throw new Error(`Classifier: model relations of ${e.name||e.uuid} have to exists to group by spatial structure.`);const o="spatialStructures",a=t.useProperties===void 0||t.useProperties;for(const[c]of r){if(t.isolate){const u=e.data.get(c);if(!u)continue;const f=u[1][1];if(f===void 0||!t.isolate.has(f))continue}const h=n.getEntityRelations(e,c,"Decomposes");if(h)for(const u of h){let f=u.toString();if(a){const E=await e.getProperties(u);if(!E)continue;f=(s=E.Name)==null?void 0:s.value}this.saveItem(e,o,f,c,u)}const d=n.getEntityRelations(e,c,"ContainsElements");if(!d)continue;let I=c.toString();if(a){const u=await e.getProperties(c);if(!u)continue;I=(i=u.Name)==null?void 0:i.value}for(const u of d){this.saveItem(e,o,I,u,c);const f=n.getEntityRelations(e,Number(u),"IsDecomposedBy");if(f)for(const E of f)this.saveItem(e,o,I,E,c)}}}setColor(e,t,s=!1){const i=this.components.get(Re);for(const n in e){const r=i.list.get(n);if(!r)continue;const o=e[n];r.setColor(t,o,s)}}resetColor(e){const t=this.components.get(Re);for(const s in e){const i=t.list.get(s);if(!i)continue;const n=e[s];i.resetColor(n)}}saveItem(e,t,s,i,n=null){this.list[t]||(this.list[t]={});const r=e.data.get(i);if(r)for(const o of r[0]){const a=e.keyFragments.get(o);if(a){const c=this.list[t];c[s]||(c[s]={map:{},id:n,name:s}),c[s].map[a]||(c[s].map[a]=new Set),c[s].map[a].add(i)}}}};p(da,"uuid","e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");let yn=da;const Ea=class fa extends Ae{constructor(e){super(e),p(this,"onDisposed",new $),p(this,"enabled",!0),p(this,"height",10),p(this,"groupName","spatialStructures"),p(this,"list",new Set),e.add(fa.uuid,this)}dispose(){this.list.clear(),this.onDisposed.trigger(),this.onDisposed.reset()}set(e){if(!this.enabled)return;const t=this.components.get(yn),s=this.components.get(Re),i=e?1:-1;let n=0;const r=t.list[this.groupName],o=new Ee;for(const a in r){o.elements[13]=n*i*this.height;for(const c in r[a].map){const h=s.list.get(c),d=a+c,I=this.list.has(d);if(!h||e&&I||!e&&!I)continue;e?this.list.add(d):this.list.delete(d);const u=r[a].map[c];h.applyTransform(u,o),h.mesh.computeBoundingSphere(),h.mesh.computeBoundingBox()}n++}}};p(Ea,"uuid","d260618b-ce88-4c7d-826c-6debb91de3e2");let ed=Ea;const pa=class Ca extends Ae{constructor(e){super(e),p(this,"enabled",!0),this.components.add(Ca.uuid,this)}set(e,t){const s=this.components.get(Re);if(!t){for(const[i,n]of s.list)n&&(n.setVisibility(e),this.updateCulledVisibility(n));return}for(const i in t){const n=t[i],r=s.list.get(i);r&&(r.setVisibility(e,n),this.updateCulledVisibility(r))}}isolate(e){this.set(!1),this.set(!0,e)}updateCulledVisibility(e){const t=this.components.get(Gc);for(const[s,i]of t.list){const n=i.colorMeshes.get(e.id);n&&(n.count=e.mesh.count)}}};p(pa,"uuid","dd9ccf2d-8a21-4821-b7f6-2949add16a29");let Du=pa;class bu extends tr{constructor(){super(...arguments),p(this,"minGeometrySize",10),p(this,"minAssetsSize",1e3),p(this,"maxTriangles",null)}}const Ta=class ma extends Ae{constructor(e){super(e),p(this,"onGeometryStreamed",new $),p(this,"onAssetStreamed",new $),p(this,"onProgress",new $),p(this,"onIfcLoaded",new $),p(this,"onDisposed",new $),p(this,"settings",new bu),p(this,"enabled",!0),p(this,"webIfc",new hs),p(this,"_nextAvailableID",0),p(this,"_splittedGeometries",new Map),p(this,"_spatialTree",new Uo),p(this,"_metaData",new Bo),p(this,"_visitedGeometries",new Map),p(this,"_streamSerializer",new za),p(this,"_geometries",new Map),p(this,"_geometryCount",0),p(this,"_civil",new xo),p(this,"_groupSerializer",new Io),p(this,"_assets",[]),p(this,"_meshesWithHoles",new Set),this.components.add(ma.uuid,this),this.settings.excludedCategories.add(uo)}dispose(){this.onIfcLoaded.reset(),this.onGeometryStreamed.reset(),this.onAssetStreamed.reset(),this.webIfc=null,this.onDisposed.trigger(),this.onDisposed.reset()}async streamFromBuffer(e){await this.readIfcFile(e),await this.streamAllGeometries(),this.cleanUp()}async streamFromCallBack(e){await this.streamIfcFile(e),await this.streamAllGeometries(),this.cleanUp()}async readIfcFile(e){const{path:t,absolute:s,logLevel:i}=this.settings.wasm;this.webIfc.SetWasmPath(t,s),await this.webIfc.Init(),i&&this.webIfc.SetLogLevel(i),this.webIfc.OpenModel(e,this.settings.webIfc),this._nextAvailableID=this.webIfc.GetMaxExpressID(0)}async streamIfcFile(e){const{path:t,absolute:s,logLevel:i}=this.settings.wasm;this.webIfc.SetWasmPath(t,s),await this.webIfc.Init(),i&&this.webIfc.SetLogLevel(i),this.webIfc.OpenModelFromCallback(e,this.settings.webIfc)}async streamAllGeometries(){const{minGeometrySize:e,minAssetsSize:t}=this.settings;this._spatialTree.setUp(this.webIfc);const s=this.webIfc.GetIfcEntityList(0),i=[[]],n=new vn;n.ifcMetadata={name:"",description:"",...this._metaData.getNameInfo(this.webIfc),...this._metaData.getDescriptionInfo(this.webIfc),schema:this.webIfc.GetModelSchema(0)||"IFC2X3",maxExpressID:this.webIfc.GetMaxExpressID(0)};let r=0,o=0;for(const f of s){if(!this.webIfc.IsIfcElement(f)&&f!==zt||this.settings.excludedCategories.has(f))continue;const E=this.webIfc.GetLineIDsWithType(0,f),C=E.size();for(let T=0;Te&&(r=0,o++,i.push([]));const m=E.get(T);i[o].push(m);const A=this.webIfc.GetLine(0,m);if(A.GlobalId){const S=(A==null?void 0:A.GlobalId.value)||(A==null?void 0:A.GlobalId);n.globalToExpressIDs.set(S,m)}const R=this._spatialTree.itemsByFloor[m]||0;n.data.set(m,[[],[R,f]]),r++}}this._spatialTree.cleanUp();let a=.01,c=0;for(const f of i){c++,this.webIfc.StreamMeshes(0,f,C=>{this.getMesh(this.webIfc,C,n)}),this._assets.length>t&&await this.streamAssets();const E=c/i.length;E>a&&(a+=.01,a=Math.max(a,E),this.onProgress.trigger(Math.round(a*100)/100))}this._geometryCount&&await this.streamGeometries(),this._assets.length&&await this.streamAssets();const{opaque:h,transparent:d}=n.geometryIDs;for(const[f,{index:E,uuid:C}]of this._visitedGeometries)n.keyFragments.set(E,C),(f>1?h:d).set(f,E);Yo.get(n,this.webIfc);const I=this.webIfc.GetCoordinationMatrix(0);n.coordinationMatrix.fromArray(I),n.civilData=this._civil.read(this.webIfc);const u=this._groupSerializer.export(n);this.onIfcLoaded.trigger(u),n.dispose(!0)}cleanUp(){try{this.webIfc.Dispose()}catch{}this.webIfc=null,this.webIfc=new hs,this._visitedGeometries.clear(),this._geometries.clear(),this._assets=[],this._meshesWithHoles.clear()}getMesh(e,t,s){const i=t.geometries.size(),n=t.expressID,r={id:n,geometries:[]};for(let o=0;othis.settings.minGeometrySize&&this.streamGeometries()}i.delete()}async streamAssets(){await this.onAssetStreamed.trigger(this._assets),this._assets=null,this._assets=[]}streamGeometries(){let e=this._streamSerializer.export(this._geometries),t={};for(const[s,{boundingBox:i,hasHoles:n}]of this._geometries)t[s]={boundingBox:i,hasHoles:n};this.onGeometryStreamed.trigger({data:t,buffer:e}),t=null,e=null,this._geometries.clear(),this._geometryCount=0}registerGeometryData(e,t,s,i,n,r){const o=this._visitedGeometries.get(r);if(o===void 0)throw new Error("Error getting geometry data for streaming!");const a=e.data.get(t);if(!a)throw new Error("Data not found!");a[0].push(o.index);const{x:c,y:h,z:d,w:I}=s.color,u=[c,h,d,I],f=s.flatTransformation;i.geometries.push({color:u,geometryID:n,transformation:f})}};p(Ta,"uuid","d9999a00-e1f5-4d3f-8cfe-c56e08609764");let td=Ta;class Uu extends tr{constructor(){super(...arguments),p(this,"propertiesSize",100)}}class xu extends Ae{constructor(){super(...arguments),p(this,"onPropertiesStreamed",new mi),p(this,"onProgress",new mi),p(this,"onIndicesStreamed",new mi),p(this,"onDisposed",new $),p(this,"enabled",!0),p(this,"settings",new Uu),p(this,"webIfc",new hs)}async dispose(){this.onIndicesStreamed.reset(),this.onPropertiesStreamed.reset(),this.webIfc=null,this.onDisposed.reset()}async streamFromBuffer(e){await this.readIfcFile(e),await this.streamAllProperties(),this.cleanUp()}async streamFromCallBack(e){await this.streamIfcFile(e),await this.streamAllProperties(),this.cleanUp()}async readIfcFile(e){const{path:t,absolute:s,logLevel:i}=this.settings.wasm;this.webIfc.SetWasmPath(t,s),await this.webIfc.Init(),i&&this.webIfc.SetLogLevel(i),this.webIfc.OpenModel(e,this.settings.webIfc)}async streamIfcFile(e){const{path:t,absolute:s,logLevel:i}=this.settings.wasm;this.webIfc.SetWasmPath(t,s),await this.webIfc.Init(),i&&this.webIfc.SetLogLevel(i),this.webIfc.OpenModelFromCallback(e,this.settings.webIfc)}async streamAllProperties(){const{propertiesSize:e}=this.settings,t=new Set(this.webIfc.GetIfcEntityList(0)),s=new Set([Wn,Xn,jn,Zn,zt]);for(const o of s)t.add(o);let i=.01,n=0;for(const o of t){if(n++,Vo.has(o))continue;const a=s.has(o),c=this.webIfc.GetLineIDsWithType(0,o),h=c.size();let d=0;for(let I=0;Ii&&(i=Math.round(i*100)/100,await this.onProgress.trigger(i),i+=.01)}await this.onProgress.trigger(1);const r=await this.components.get(rt).processFromWebIfc(this.webIfc,0);await this.onIndicesStreamed.trigger(r)}cleanUp(){this.webIfc.Dispose(),this.webIfc=null,this.webIfc=new hs}}p(xu,"uuid","88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");class Ra{constructor(e,t,s){p(this,"title"),p(this,"guid",vt.create()),p(this,"clippingPlanes",new Tt),p(this,"camera",{aspectRatio:0,fov:0,direction:{x:0,y:0,z:80},position:{x:0,y:0,z:0}}),p(this,"exceptionComponents",new Tt),p(this,"selectionComponents",new Tt),p(this,"componentColors",new St),p(this,"spacesVisible",!1),p(this,"spaceBoundariesVisible",!1),p(this,"openingsVisible",!1),p(this,"defaultVisibility",!0),p(this,"_components"),p(this,"world");const i={setCamera:!0,...s},{data:n,setCamera:r}=i;this._components=e,this.world=t,n&&(this.guid=n.guid??this.guid,this.set(n)),r&&this.updateCamera()}get _selectionModelIdMap(){const e=this._components.get(Re),t={};for(const[s,i]of e.groups){s in t||(t[s]=new Set);for(const n of this.selectionComponents){const r=i.globalToExpressIDs.get(n);r&&t[s].add(r)}}return t}get _exceptionModelIdMap(){const e=this._components.get(Re),t={};for(const[s,i]of e.groups){s in t||(t[s]=new Set);for(const n of this.exceptionComponents){const r=i.globalToExpressIDs.get(n);r&&t[s].add(r)}}return t}get selection(){return this._components.get(Re).modelIdToFragmentIdMap(this._selectionModelIdMap)}get exception(){return this._components.get(Re).modelIdToFragmentIdMap(this._exceptionModelIdMap)}get projection(){return"fov"in this.camera?"Perspective":"Orthographic"}get position(){const e=this._components.get(Re),{position:t}=this.camera,{x:s,y:i,z:n}=t,r=new x(s,i,n);return e.applyBaseCoordinateSystem(r,new Ee),r}get direction(){const{direction:e}=this.camera,{x:t,y:s,z:i}=e;return new x(t,s,i)}get _managerVersion(){return this._components.get(Ye).config.version}get topics(){return[...this._components.get(Ye).list.values()].filter(e=>e.viewpoints.has(this.guid))}addComponentsFromMap(e){const t=this._components.get(Re).fragmentIdMapToGuids(e);this.selectionComponents.add(...t),this._components.get(Ct).list.set(this.guid,this)}set(e){const t=e,s=this;for(const i in e){if(i==="guid")continue;const n=t[i];if(i==="selectionComponents"){this.selectionComponents.clear(),this.selectionComponents.add(...n);continue}if(i==="exceptionComponents"){this.exceptionComponents.clear(),this.exceptionComponents.add(...n);continue}i in this&&(s[i]=n)}return this._components.get(Ct).list.set(this.guid,this),this}async go(e=!0){const{camera:t}=this.world;if(!t.hasCameraControls())throw new Error("Viewpoint: the world's camera need controls to set the viewpoint.");t instanceof ah&&t.projection.set(this.projection);const s=this.position,i=this.direction;let n={x:s.x+i.x*80,y:s.y+i.y*80,z:s.z+i.z*80};const r=this.selection;if(Object.keys(r).length===0){const a=this._components.get(mn).get(this.world).castRayFromVector(s,this.direction);a&&(n=a.point)}else{const a=this._components.get(Mu);a.reset(),a.addFragmentIdMap(r),n=a.getSphere().center,a.reset()}const o=this._components.get(Du);o.set(this.defaultVisibility),o.set(!this.defaultVisibility,this.exception),o.set(!0,r),await t.controls.setLookAt(s.x,s.y,s.z,n.x,n.y,n.z,e)}updateCamera(){const{camera:e,renderer:t}=this.world;if(!t)throw new Error("Viewpoint: the world needs to have a renderer!");if(!e.hasCameraControls())throw new Error("Viewpoint: world's camera need camera controls!");const s=new x;e.controls.getPosition(s);const i=e.three,n=new x(0,0,-1).applyEuler(i.rotation),{width:r,height:o}=t.getSize();let a=r/o;Number.isNaN(a)&&(a=1);const c=this._components.get(Re);s.applyMatrix4(c.baseCoordinationMatrix.clone().invert());const h={aspectRatio:a,position:{x:s.x,y:s.y,z:s.z},direction:{x:n.x,y:n.y,z:n.z}};i instanceof Pn?this.camera={...h,fov:i.fov}:i instanceof Gt&&(this.camera={...h,viewToWorldScale:i.top-i.bottom}),this._components.get(Ct).list.set(this.guid,this)}colorize(){const e=this._components.get(Ct),t=this._components.get(Re),s=this._components.get(yn);for(const[i,n]of this.componentColors){const r=t.guidToFragmentIdMap(n),o=new ve(`#${i}`);s.setColor(r,o,e.config.overwriteColors)}}resetColors(){const e=this._components.get(Re),t=this._components.get(yn);for(const[s,i]of this.componentColors){const n=e.guidToFragmentIdMap(i);t.resetColor(n)}}async createComponentTags(e){var t,s;const i=this._components.get(Re),n=this._components.get(Ye);let r="";if(n.config.includeSelectionTag){const o=e==="selection"?this._selectionModelIdMap:this._exceptionModelIdMap;for(const a in o){const c=i.groups.get(a);if(!c)continue;const h=o[a];for(const d of h){const I=await c.getProperties(d);if(!I)continue;const u=(t=I.GlobalId)==null?void 0:t.value;if(!u)continue;const f=(s=I.Tag)==null?void 0:s.value;let E=null;f&&(E=`AuthoringToolId="${f}"`),r+=` +`}}}else r=[...this.selectionComponents].map(o=>``).join(` +`);return r}async serialize(e=this._managerVersion){const t=this._components.get(Re),s=this.position;s.applyMatrix4(t.baseCoordinationMatrix.clone().invert());const i=this.direction;i.normalize();const n=new Ee().makeRotationX(Math.PI/2),r=i.clone().applyMatrix4(n);r.normalize();const o=` + ${s.x} + ${-s.z} + ${s.y} + `,a=` + ${i.x} + ${-i.z} + ${i.y} + `,c=` + ${r.x} + ${-r.z} + ${r.y} + `,h=`${this.camera.aspectRatio}`;let d="";"viewToWorld"in this.camera?d=` + ${o} + ${a} + ${c} + ${h} + ${this.camera.viewToWorld} + `:"fov"in this.camera&&(d=` + ${o} + ${a} + ${c} + ${h} + ${this.camera.fov} + `);const I=``,u=(await this.createComponentTags("selection")).trim(),f=(await this.createComponentTags("exception")).trim();return` + + + ${e==="2.1"?I:""} + ${u.length!==0?`${u}`:""} + + ${e==="3"?I:""} + ${f.length!==0?`${f}`:""} + + + ${d} + `}}class Bu extends kt{constructor(){super(...arguments),p(this,"_config",{overwriteColors:{value:!1,type:"Boolean"}})}get overwriteColors(){return this._config.overwriteColors.value}set overwriteColors(e){this._config.overwriteColors.value=e}}const ga=class Fa extends Ae{constructor(e){super(e),p(this,"enabled",!0),p(this,"list",new St),p(this,"isSetup",!1),p(this,"onSetup",new $),p(this,"config",new Bu(this,this.components,"Viewpoints")),p(this,"onDisposed",new $),e.add(Fa.uuid,this)}create(e,t){const s=new Ra(this.components,e,{data:t});return t||this.list.set(s.guid,s),s}setup(){}dispose(){this.list.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}};p(ga,"uuid","ee867824-a796-408d-8aa0-4e5962a83c66");let Ct=ga;class Yu extends kt{constructor(){super(...arguments),p(this,"_config",{visible:{value:!0,type:"Boolean"},lockRotation:{value:!0,type:"Boolean"},zoom:{type:"Number",interpolable:!0,value:.05,min:.001,max:5},frontOffset:{type:"Number",interpolable:!0,value:0,min:0,max:100},sizeX:{type:"Number",interpolable:!0,value:320,min:20,max:5e3},sizeY:{type:"Number",interpolable:!0,value:160,min:20,max:5e3},backgroundColor:{value:new ve,type:"Color"}})}get visible(){return this._config.visible.value}set visible(e){this._config.visible.value=e;const t=this._component.renderer.domElement.style;t.display=e?"block":"none"}get lockRotation(){return this._config.lockRotation.value}set lockRotation(e){this._config.lockRotation.value=e,this._component.lockRotation=e}get zoom(){return this._config.zoom.value}set zoom(e){this._config.zoom.value=e,this._component.zoom=e}get frontOffset(){return this._config.frontOffset.value}set frontOffset(e){this._config.frontOffset.value=e,this._component.frontOffset=e}get sizeX(){return this._config.sizeX.value}set sizeX(e){this._config.sizeX.value=e;const{sizeX:t,sizeY:s}=this._config,i=new He(t.value,s.value);this._component.resize(i)}get sizeY(){return this._config.sizeY.value}set sizeY(e){this._config.sizeY.value=e;const{sizeX:t,sizeY:s}=this._config,i=new He(t.value,s.value);this._component.resize(i)}get backgroundColor(){return this._config.backgroundColor.value}set backgroundColor(e){this._config.backgroundColor.value=e,this._component.backgroundColor=e}}class Vu{constructor(e,t){if(p(this,"onDisposed",new $),p(this,"onAfterUpdate",new $),p(this,"onBeforeUpdate",new $),p(this,"onResize",new $),p(this,"onSetup",new $),p(this,"frontOffset",0),p(this,"overrideMaterial",new $a),p(this,"backgroundColor",new ve(395274)),p(this,"renderer"),p(this,"enabled",!0),p(this,"world"),p(this,"config"),p(this,"isSetup",!1),p(this,"_defaultConfig",{visible:!0,lockRotation:!1,zoom:.05,frontOffset:0,sizeX:320,sizeY:160,backgroundColor:new ve(395274)}),p(this,"_lockRotation",!0),p(this,"_size",new He(320,160)),p(this,"_camera"),p(this,"_plane"),p(this,"_tempVector1",new x),p(this,"_tempVector2",new x),p(this,"_tempTarget",new x),p(this,"down",new x(0,-1,0)),p(this,"updatePlanes",()=>{if(!this.world.renderer)throw new Error("The given world must have a renderer!");const n=[],r=this.world.renderer.three;for(const o of r.clippingPlanes)n.push(o);n.push(this._plane),this.renderer.clippingPlanes=n}),this.world=e,!this.world.renderer)throw new Error("The given world must have a renderer!");this.renderer=new xs,this.renderer.setSize(this._size.x,this._size.y);const s=1,i=this._size.x/this._size.y;this._camera=new Gt(s*i/-2,s*i/2,s/2,s/-2),this.world.renderer.onClippingPlanesUpdated.add(this.updatePlanes),this._camera.position.set(0,200,0),this._camera.zoom=.1,this._camera.rotation.x=-Math.PI/2,this._plane=new Is(this.down,200),this.updatePlanes(),this.config=new Yu(this,t,"MiniMap"),t.get(ut).list.add(this.config)}get lockRotation(){return this._lockRotation}set lockRotation(e){this._lockRotation=e,e&&(this._camera.rotation.z=0)}get zoom(){return this._camera.zoom}set zoom(e){this._camera.zoom=e,this._camera.updateProjectionMatrix()}dispose(){this.enabled=!1,this.onBeforeUpdate.reset(),this.onAfterUpdate.reset(),this.onResize.reset(),this.overrideMaterial.dispose(),this.renderer.forceContextLoss(),this.renderer.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}get(){return this._camera}update(){if(!this.enabled)return;this.onBeforeUpdate.trigger();const e=this.world.scene.three,t=this.world.camera;if(!t.hasCameraControls())throw new Error("The given world must use camera controls!");if(!(e instanceof Pi))throw new Error("The given world must have a THREE.Scene as a root!");const s=t.controls;if(s.getPosition(this._tempVector1),this._camera.position.x=this._tempVector1.x,this._camera.position.z=this._tempVector1.z,this.frontOffset!==0&&(s.getTarget(this._tempVector2),this._tempVector2.sub(this._tempVector1),this._tempVector2.normalize().multiplyScalar(this.frontOffset),this._camera.position.x+=this._tempVector2.x,this._camera.position.z+=this._tempVector2.z),!this._lockRotation){s.getTarget(this._tempTarget);const n=Math.atan2(this._tempTarget.x-this._tempVector1.x,this._tempTarget.z-this._tempVector1.z);this._camera.rotation.z=n+Math.PI}this._plane.set(this.down,this._tempVector1.y);const i=e.background;e.background=this.backgroundColor,this.renderer.render(e,this._camera),e.background=i,this.onAfterUpdate.trigger()}getSize(){return this._size}resize(e=this._size){this._size.copy(e),this.renderer.setSize(e.x,e.y);const t=e.x/e.y,s=1;this._camera.left=s*t/-2,this._camera.right=s*t/2,this._camera.top=s/2,this._camera.bottom=-s/2,this._camera.updateProjectionMatrix(),this.onResize.trigger(e)}setup(e){const t={...this._defaultConfig,...e};this.config.visible=!0,this.config.lockRotation=t.lockRotation,this.config.zoom=t.zoom,this.config.frontOffset=t.frontOffset,this.config.sizeX=t.sizeX,this.config.sizeY=t.sizeY,this.config.backgroundColor=t.backgroundColor,this.isSetup=!0,this.onSetup.trigger()}}const Sa=class Aa extends Ae{constructor(e){super(e),p(this,"onAfterUpdate",new $),p(this,"onBeforeUpdate",new $),p(this,"onDisposed",new $),p(this,"onSetup",new $),p(this,"enabled",!0),p(this,"list",new Map),this.components.add(Aa.uuid,this)}create(e){if(this.list.has(e.uuid))throw new Error("This world already has a minimap!");const t=new Vu(e,this.components);return this.list.set(e.uuid,t),t}delete(e){const t=this.list.get(e);t&&t.dispose(),this.list.delete(e)}dispose(){for(const[e,t]of this.list)t.dispose();this.list.clear(),this.onDisposed.trigger()}update(){for(const[e,t]of this.list)t.update()}};p(Sa,"uuid","39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");let sd=Sa;const Oa=class Na extends Ae{constructor(e){super(e),p(this,"enabled",!0),e.add(Na.uuid,this)}static distanceFromPointToLine(e,t,s,i=!1){const n=new it,r=new x;return n.set(t,s),n.closestPointToPoint(e,i,r),r.distanceTo(e)}getFace(e,t,s){if(!e.geometry.index)throw new Error("Geometry must be indexed!");const i=new Map,n=e.geometry.index.array,{plane:r}=this.getFaceData(t,s,e),o=[];for(let d=0;dR.id);if(!u.size){const R=a++;for(const{id:S}of I)c.set(S,R);h.set(R,{edges:new Set(f),indices:new Set([d])});continue}let E=null;const C=new Set,T=new Set(f);for(const[R,S]of u){E===null?E=S:S!==E&&C.add(S),c.delete(R);const{edges:L}=h.get(S);L.delete(R),T.delete(R)}if(E===null)throw new Error("Error computing face!");const m=h.get(E),{indices:A}=m;A.add(d);for(const R of T){c.set(R,E);const{edges:S}=m;S.add(R)}for(const R of C){const S=h.get(R),{edges:L,indices:y}=S,w=h.get(E),{edges:P,indices:M}=w;for(const B of L)P.add(B),c.set(B,E);for(const B of y)M.add(B);h.delete(R)}}for(const[d,{indices:I,edges:u}]of h)if(I.has(t)){const f=[];for(const E of u){const C=i.get(E);f.push(C)}return{edges:f,indices:I}}return null}getVerticesAndNormal(e,t,s){if(!e.geometry.index)throw new Error("Geometry must be indexed!");const i=e.geometry.index.array,n=e.geometry.attributes.position.array,r=e.geometry.attributes.normal.array,o=i[t*3]*3,a=i[t*3+1]*3,c=i[t*3+2]*3,h=new x(n[o],n[o+1],n[o+2]),d=new x(n[a],n[a+1],n[a+2]),I=new x(n[c],n[c+1],n[c+2]),u=new x(r[o],r[o+1],r[o+2]),f=new x(r[a],r[a+1],r[a+2]),E=new x(r[c],r[c+1],r[c+2]),C=(u.x+f.x+E.x)/3,T=(u.y+f.y+E.y)/3,m=(u.z+f.z+E.z)/3,A=new x(C,T,m);if(s!==void 0&&e instanceof Vt){const R=new Ee;e.getMatrixAt(s,R);const S=new Ee;S.extractRotation(R),A.applyMatrix4(S),h.applyMatrix4(R),d.applyMatrix4(R),I.applyMatrix4(R)}return{p1:h,p2:d,p3:I,faceNormal:A}}round(e){e.x=Math.trunc(e.x*1e3)/1e3,e.y=Math.trunc(e.y*1e3)/1e3,e.z=Math.trunc(e.z*1e3)/1e3}getVolumeFromFragments(e){const t=this.components.get(Re),s=new Ee,i=[];for(const r in e){const o=t.list.get(r);if(!o)continue;const a=e[r];let c=0;for(const I of a){const u=o.getInstancesIDs(I);u&&(c+=u.size)}const h=new Vt(o.mesh.geometry,void 0,c);let d=0;for(const I of a){const u=o.getInstancesIDs(I);if(u)for(const f of u)o.mesh.getMatrixAt(f,s),h.setMatrixAt(d++,s)}i.push(h)}const n=this.getVolumeFromMeshes(i);for(const r of i)r.geometry=null,r.material=[],r.dispose();return n}getVolumeFromMeshes(e){let t=0;for(const s of e)t+=this.getVolumeOfMesh(s);return t}getFaceData(e,t,s){const i=this.getVerticesAndNormal(s,e,t),{p1:n,p2:r,p3:o,faceNormal:a}=i;this.round(n),this.round(r),this.round(o),this.round(a);const c=[{id:`${n.x}|${n.y}|${n.z}`,value:n},{id:`${r.x}|${r.y}|${r.z}`,value:r},{id:`${o.x}|${o.y}|${o.z}`,value:o}];c.sort((m,A)=>m.idA.id?1:0);const[{id:h,value:d},{id:I,value:u},{id:f,value:E}]=c,C=[{id:`${h}|${I}`,distance:d.distanceTo(u),points:[d,u]},{id:`${I}|${f}`,distance:u.distanceTo(E),points:[u,E]},{id:`${h}|${f}`,distance:d.distanceTo(E),points:[d,E]}],T=new Is;return T.setFromNormalAndCoplanarPoint(a,n),T.constant=Math.round(T.constant*10)/10,{plane:T,edges:C}}getVolumeOfMesh(e){let t=0;const s=new x,i=new x,n=new x,{index:r}=e.geometry,o=e.geometry.attributes.position.array;if(!r)return console.warn("Geometry must be indexed to compute its volume!"),0;const a=[];if(e instanceof Vt)for(let h=0;h{const r={parameter:i,currentValue:t,requiredValue:s.parameter,pass:!1};n&&this.addCheckResult(r,n);let o=!1;if(s.type==="simple"){const a=s.parameter;o=t===a}if(s.type==="enumeration"&&(o=s.parameter.includes(t)),s.type==="pattern"){const a=s.parameter;o=new RegExp(a).test(String(t))}if(s.type==="length"){const a=s.parameter,{min:c,length:h,max:d}=a;h!==void 0&&(o=String(t).length===h),c!==void 0&&(o=String(t).length>=c),d!==void 0&&(o=String(t).length<=d)}if(s.type==="bounds"&&typeof t=="number"){const{min:a,minInclusive:c,max:h,maxInclusive:d}=s.parameter;let I=!0,u=!0;a!==void 0&&(I=c?t<=a:t=h:t>h),o=I&&u}return this.cardinality==="prohibited"&&(o=!o),this.cardinality==="optional"&&(o=!0),r.pass=o,r.pass}),p(this,"testResult",[]),this.components=e}addCheckResult(e,t){const s=t.findIndex(({parameter:i})=>i===e.parameter);s!==-1?t[s]=e:t.push(e)}saveResult(e,t){const{GlobalId:s}=e;if(!s)return;const{value:i}=s,n={expressID:i,pass:t,checks:[],cardinality:this.cardinality};this.testResult.push(n)}}const Rt=(l,e)=>{let t="";return e?(e.type==="simple"&&(t=`${e.parameter}`),e.type==="enumeration"&&(t=` + ${e.parameter.map(s=>``).join(`\r +`)} + `),e.type==="pattern"&&(t=` + + `),` + ${t} + `):t};class Gu extends Ui{constructor(e,t){super(e),p(this,"name"),p(this,"value"),this.name=t}serialize(e){const t=Rt("Name",this.name),s=Rt("Value",this.value);let i="";return e==="requirement"&&(i+=`cardinality="${this.cardinality}"`,i+=this.instructions?`instructions="${this.instructions}"`:""),` + ${t} + ${s} +`}async getEntities(){return[]}async test(e){var t;this.testResult=[];for(const i in e){const n=Number(i),r=e[n],o=[],a={guid:(t=r.GlobalId)==null?void 0:t.value,expressID:n,pass:!1,checks:o,cardinality:this.cardinality};this.testResult.push(a);const c=Object.keys(r).filter(d=>{const I=this.evalRequirement(d,this.name,"Name"),u=r[d];return I&&u===null?this.cardinality==="optional"||this.cardinality==="prohibited":I&&(u==null?void 0:u.type)===3&&u.value===2||I&&Array.isArray(u)&&u.length===0||I&&(u==null?void 0:u.type)===1&&u.value.trim()===""?!1:I}),h=c.length>0;if(o.push({parameter:"Name",currentValue:h?c[0]:null,requiredValue:this.name.parameter,pass:this.cardinality==="prohibited"?!h:h}),this.value)if(c[0]){const d=r[c[0]];(d==null?void 0:d.type)===5?o.push({parameter:"Value",currentValue:null,requiredValue:this.value.parameter,pass:this.cardinality==="prohibited"}):this.evalRequirement(d?d.value:null,this.value,"Value",o)}else o.push({parameter:"Value",currentValue:null,requiredValue:this.value.parameter,pass:this.cardinality==="prohibited"});a.pass=o.every(({pass:d})=>d)}const s=[...this.testResult];return this.testResult=[],s}}class zu extends Ui{constructor(e,t){super(e),p(this,"system"),p(this,"value"),p(this,"uri"),this.system=t}serialize(e){const t=Rt("System",this.system),s=Rt("Value",this.value);let i="";return e==="requirement"&&(i+=`cardinality="${this.cardinality}"`,i+=this.uri?`uri=${this.uri}`:"",i+=this.instructions?`instructions="${this.instructions}"`:""),` + ${t} + ${s} +`}async getEntities(e,t={}){var s;const i=[],n=await e.getAllPropertiesOfType(It),r=await e.getAllPropertiesOfType(Ht),o={...n,...r},a=[];for(const h in o){const d=Number(h),I=await e.getProperties(d);if(!I)continue;const u=(s=I.ReferencedSource)==null?void 0:s.value;if(!u)continue;const f=await e.getProperties(u);!f||!this.evalSystem(f)||!this.evalValue(I)||!this.evalURI(I)||a.push(d)}const c=this.components.get(rt);for(const h of a){const d=c.getEntitiesWithRelation(e,"HasAssociations",h);for(const I of d){if(I in t)continue;const u=await e.getProperties(I);u&&(t[I]=u,i.push(I))}}return i}async test(e,t){var s;this.testResult=[];for(const n in e){const r=Number(n),o=e[r],a=[],c={guid:(s=o.GlobalId)==null?void 0:s.value,expressID:r,pass:!1,checks:a,cardinality:this.cardinality};this.testResult.push(c);let h=!0;const d=await this.getSystems(t,r),I=d.map(u=>this.getSystemName(u)).filter(u=>u);for(const u of d){if(!this.evalSystem(u,a))continue;if(h=!1,!(this.value&&this.system))break;if(u.type!==It)continue;const f=!this.value||this.evalValue(u,a),E=!this.uri||this.evalURI(u,a);if(f&&E)break}h&&this.addCheckResult({parameter:"System",currentValue:I,requiredValue:this.system,pass:this.cardinality==="optional"},a),c.pass=a.every(({pass:u})=>u)}const i=[...this.testResult];return this.testResult=[],i}async processReferencedSource(e,t){var s;const i=(s=t.ReferencedSource)==null?void 0:s.value;if(!i)return null;const n=await e.getProperties(i);return n?(n.type===It&&(n.ReferencedSource=await this.processReferencedSource(e,n)),n):null}async getSystems(e,t){var s;const i=[],n=this.components.get(rt),r=n.getEntityRelations(e,t,"HasAssociations");if(r)for(const d of r){const I=await e.getProperties(d);I&&(I.type===Ht&&i.push(I),I.type===It&&(I.ReferencedSource=await this.processReferencedSource(e,I),I.ReferencedSource&&i.push(I)))}const o=i.map(d=>{var I,u,f;return d.type===Ht?(I=d.Name)==null?void 0:I.value:d.type===It?(f=(u=d.ReferencedSource)==null?void 0:u.Name)==null?void 0:f.value:null}).filter(d=>d),a=n.getEntityRelations(e,t,"IsTypedBy");if(!(a&&a[0]))return i;const c=a[0],h=n.getEntityRelations(e,c,"HasAssociations");if(h)for(const d of h){const I=await e.getProperties(d);if(I){if(I.type===Ht){if(o.includes((s=I.Name)==null?void 0:s.value))continue;i.push(I)}I.type===It&&(I.ReferencedSource=await this.processReferencedSource(e,I),I.ReferencedSource&&i.push(I))}}return i}getSystemName(e){var t,s,i,n;if(e.type===Ht)return(t=e.Name)==null?void 0:t.value;if(e.type===It){if(((s=e.ReferencedSource)==null?void 0:s.type)===It)return this.getSystemName(e.ReferencedSource);if(((i=e.ReferencedSource)==null?void 0:i.type)===Ht)return(n=e.ReferencedSource.Name)==null?void 0:n.value}return null}getAllReferenceIdentifications(e){if(e.type!==It)return null;const t=[];if(e.Identification&&t.push(e.Identification.value),e.ReferencedSource){const s=this.getAllReferenceIdentifications(e.ReferencedSource);s&&t.push(...s)}return t}evalSystem(e,t){const s=this.getSystemName(e);return this.evalRequirement(s,this.system,"System",t)}evalValue(e,t){if(!this.value)return!0;const s=this.getAllReferenceIdentifications(e);if(!s)return!1;const i=s.find(n=>this.value?this.evalRequirement(n,this.value,"Value"):!1);return t&&this.addCheckResult({parameter:"Value",currentValue:i??null,requiredValue:this.value,pass:!!i},t),!!i}evalURI(e,t){var s;return this.uri?this.evalRequirement((s=e.Location)==null?void 0:s.value,{type:"simple",parameter:this.uri},"URI",t):!0}}class ku extends Ui{constructor(e,t){super(e),p(this,"name"),p(this,"predefinedType"),this.name=t}serialize(e){const t=Rt("Name",this.name),s=Rt("Name",this.predefinedType);let i="";return e==="requirement"&&(i+=`cardinality="${this.cardinality}"`,i+=this.instructions?`instructions="${this.instructions}"`:""),` + ${t} + ${s} +`}async getEntities(e,t={}){const s=Object.entries(yi),i=[];for(const[o]of s)await this.evalName({type:o})&&i.push(Number(o));let n={};for(const o of i){const a=await e.getAllPropertiesOfType(o);a&&(n={...n,...a})}if(!this.predefinedType){for(const o in n)o in t||(t[o]=n[o]);return Object.keys(n).map(Number)}const r=[];for(const o in n){const a=Number(o);if(a in t)continue;const c=n[a];await this.evalPredefinedType(e,c)&&(t[a]=c,r.push(a))}return r}async test(e,t){var s;this.testResult=[];for(const i in e){const n=Number(i),r=e[n],o=[],a={guid:(s=r.GlobalId)==null?void 0:s.value,expressID:n,pass:!1,checks:o,cardinality:this.cardinality};this.testResult.push(a),await this.evalName(r,o),await this.evalPredefinedType(t,r,o),a.pass=o.every(({pass:c})=>c)}return this.testResult}async evalName(e,t){const s=yi[e.type];return this.evalRequirement(s,this.name,"Name",t)}async evalPredefinedType(e,t,s){var i,n,r,o;if(!this.predefinedType)return null;const a=this.components.get(rt),c=typeof this.predefinedType.parameter=="string"&&this.predefinedType.parameter==="USERDEFINED";let h=(i=t.PredefinedType)==null?void 0:i.value;if(h==="USERDEFINED"&&!c){const d=Object.keys(t).find(I=>/^((?!Predefined).)*Type$/.test(I));h=d?(n=t[d])==null?void 0:n.value:"USERDEFINED"}if(!h){const d=a.getEntityRelations(e,t.expressID,"IsTypedBy");if(d&&d[0]){const I=await e.getProperties(d[0]);if(I&&(h=(r=I.PredefinedType)==null?void 0:r.value,h==="USERDEFINED"&&!c)){const u=Object.keys(I).find(f=>/^((?!Predefined).)*Type$/.test(f));h=u?(o=I[u])==null?void 0:o.value:"USERDEFINED"}}}return this.evalRequirement(h,this.predefinedType,"PredefinedType",s)}}class Hu extends Ui{constructor(e,t,s){super(e),p(this,"propertySet"),p(this,"baseName"),p(this,"value"),p(this,"dataType"),p(this,"uri"),p(this,"_unsupportedTypes",[qa,Qa]),this.propertySet=t,this.baseName=s}serialize(e){const t=Rt("PropertySet",this.propertySet),s=Rt("BaseName",this.baseName),i=Rt("Value",this.value),n=this.dataType?`dataType=${this.dataType}`:"";let r="";return e==="requirement"&&(r+=`cardinality="${this.cardinality}"`,r+=this.uri?`uri=${this.uri}`:"",r+=this.instructions?`instructions="${this.instructions}"`:""),` + ${t} + ${s} + ${i} +`}async getEntities(e,t={}){var s,i;let n={};const r=await e.getAllPropertiesOfType(ls);n={...n,...r};const o=await e.getAllPropertiesOfType(Ci);if(n={...n,...o},Object.keys(n).length===0)return[];const a=[];for(const h in n){const d=Number(h),I=await e.getProperties(d);if(!I||((s=I.Name)==null?void 0:s.value)!==this.propertySet.parameter)continue;let u;if(I.type===ls&&(u="HasProperties"),I.type===Ci&&(u="Quantities"),!!u)for(const f of I[u]){const E=await e.getProperties(f.value);if(!(!E||((i=E.Name)==null?void 0:i.value)!==this.baseName.parameter)){if(this.value){const C=Object.keys(E).find(T=>T.endsWith("Value"));if(!C||E[C].value!==this.value.parameter)continue}a.push(d)}}}const c=this.components.get(rt);for(const h of a){const d=c.getEntitiesWithRelation(e,"IsDefinedBy",h);for(const I of d){if(I in t)continue;const u=await e.getProperties(I);u&&(t[I]=u)}}return[]}async test(e,t){var s;this.testResult=[];for(const n in e){const r=Number(n),o=e[r],a=[],c={guid:(s=o.GlobalId)==null?void 0:s.value,expressID:r,pass:!1,checks:a,cardinality:this.cardinality};this.testResult.push(c);const h=(await this.getPsets(t,r)).filter(d=>{var I;return this.evalRequirement(((I=d.Name)==null?void 0:I.value)??null,this.propertySet,"PropertySet")?(a.push({currentValue:d.Name.value,parameter:"PropertySet",pass:!0,requiredValue:this.propertySet.parameter}),!0):!1});if(h.length===0){a.push({currentValue:null,parameter:"PropertySet",pass:!1,requiredValue:this.propertySet.parameter});continue}for(const d of h){const I=this.getItemsAttrName(d.type);if(!I){a.push({currentValue:null,parameter:"BaseName",pass:!1,requiredValue:this.baseName.parameter});continue}const u=d[I].filter(f=>{var E;return this._unsupportedTypes.includes(f.type)||!this.evalRequirement(((E=f.Name)==null?void 0:E.value)??null,this.baseName,"BaseName")?!1:(a.push({currentValue:f.Name.value,parameter:"BaseName",pass:!0,requiredValue:this.baseName.parameter}),!0)});if(u.length===0){a.push({currentValue:null,parameter:"BaseName",pass:!1,requiredValue:this.baseName.parameter});continue}for(const f of u)this.evalValue(f,a),this.evalDataType(f,a),this.evalURI()}c.pass=a.every(({pass:d})=>d)}const i=[...this.testResult];return this.testResult=[],i}getItemsAttrName(e){let t;return e===ls&&(t="HasProperties"),e===Ci&&(t="Quantities"),t}getValueKey(e){return Object.keys(e).find(t=>t.endsWith("Value")||t.endsWith("Values"))}async getPsets(e,t){const s=[],i=this.components.get(rt).getEntityRelations(e,t,"IsDefinedBy");if(!i)return s;for(const n of i){const r=await e.getProperties(n);if(!r)continue;const o=this.getItemsAttrName(r.type);if(!o)continue;const a=structuredClone(r),c=[];for(const{value:h}of a[o]){const d=await e.getProperties(h);d&&c.push(d)}a[o]=c,s.push(a)}return s}evalValue(e,t){const s=this.getValueKey(e);if(this.value){if(!s)return t==null||t.push({parameter:"Value",currentValue:null,pass:!1,requiredValue:this.value.parameter}),!1;const n=e[s],r=structuredClone(this.value);if(n.name==="IFCLABEL"&&r.type==="simple"&&(r.parameter=String(r.parameter)),(e.type===cr||e.type===hr)&&Array.isArray(n)){const o=n.map(c=>c.value),a=n.find(c=>r?this.evalRequirement(c.value,r,"Value"):!1);return t==null||t.push({currentValue:o,pass:!!a,parameter:"Value",requiredValue:r.parameter}),!!a}return this.evalRequirement(n.value,r,"Value",t)}if(!s)return!0;const i=e[s];return i.type===3&&i.value===2?(t==null||t.push({parameter:"Value",currentValue:null,pass:!1,requiredValue:null}),!1):i.type===1&&i.value.trim()===""?(t==null||t.push({parameter:"Value",currentValue:"",pass:!1,requiredValue:null}),!1):!0}evalDataType(e,t){if(!this.dataType)return!0;const s=this.getValueKey(e),i=e[s];if((e.type===cr||e.type===hr)&&Array.isArray(i)&&i[0]){const n=i[0].name;return this.evalRequirement(n,{type:"simple",parameter:this.dataType},"DataType",t)}return this.evalRequirement(i.name,{type:"simple",parameter:this.dataType},"DataType",t)}evalURI(){return!0}}class Wu{constructor(e,t,s){p(this,"name"),p(this,"ifcVersion",new Set),p(this,"identifier",vt.create()),p(this,"description"),p(this,"instructions"),p(this,"requirementsDescription"),p(this,"applicability",new Tt),p(this,"requirements",new Tt),p(this,"components"),this.components=e,this.name=t;for(const i of s)this.ifcVersion.add(i)}async test(e){let t=[];if(this.requirements.size===0)return t;const s={};for(const i of this.applicability)await i.getEntities(e,s);return t=await[...this.requirements][0].test(s,e),t}serialize(){const e=`name="${this.name}"`,t=this.identifier?`identifier="${this.identifier}"`:"",s=this.description?`description="${this.description}"`:"",i=this.instructions?`instructions="${this.instructions}"`:"";return` + + ${[...this.applicability].map(n=>n.serialize("applicability"))} + + + ${[...this.requirements].map(n=>n.serialize("requirement"))} + + `}}const gt=l=>{if(!l)return;const e={type:"simple"};if("simpleValue"in l&&(e.parameter=l.simpleValue),"restriction"in l){const t=l.restriction;if("pattern"in t&&(e.type="pattern",e.parameter=t.pattern.value),"enumeration"in t){e.type="enumeration";const s=t.enumeration.map(({value:i})=>i);e.parameter=s}}if(e.parameter!==void 0)return e},ao=(l,e)=>{const t=[];for(const s of e){const i=s.name,n=gt(i);if(!n)continue;const r=new ku(l,n);s.cardinality&&(r.cardinality=s.cardinality),r.predefinedType=gt(s.predefinedType),t.push(r)}return t},Xu=(l,e)=>{const t=[];for(const s of e){const i=s.name,n=gt(i);if(!n)continue;const r=new Gu(l,n);s.cardinality&&(r.cardinality=s.cardinality),r.value=gt(s.value),t.push(r)}return t},ju=(l,e)=>{const t=[];for(const s of e){const i=s.system,n=gt(i);if(!n)continue;const r=new zu(l,n);s.cardinality&&(r.cardinality=s.cardinality);const o=gt(s.value);(o==null?void 0:o.type)==="simple"&&(o.parameter=String(o.parameter)),(o==null?void 0:o.type)==="enumeration"&&Array.isArray(o.parameter)&&(o.parameter=o.parameter.map(String)),r.value=o,r.uri=s.uri,t.push(r)}return t},Zu=(l,e)=>{const t=[];for(const s of e){const i=s.propertySet,n=s.baseName,r=gt(i),o=gt(n);if(!(o&&r))continue;const a=new Hu(l,r,o);s.cardinality&&(a.cardinality=s.cardinality);const c=gt(s.value);(c==null?void 0:c.type)==="enumeration"&&Array.isArray(c.parameter)&&(c.parameter=c.parameter.map(String)),a.value=c,a.dataType=s.dataType,a.uri=s.uri,t.push(a)}return t},lo=class Ln extends Ae{constructor(e){super(e),p(this,"enabled",!0),p(this,"list",new St),e.add(Ln.uuid,this)}getFragmentIdMap(e,t){const s=t.filter(o=>o.pass).map(o=>o.expressID),i=e.getFragmentMap(s),n=t.filter(o=>!o.pass).map(o=>o.expressID),r=e.getFragmentMap(n);return{pass:i,fail:r}}create(e,t){const s=new Wu(this.components,e,t);return this.list.set(s.identifier,s),s}load(e){const t=[],s=Ln.xmlParser.parse(e).ids,{specifications:i}=s;if(i&&i.specification){const n=Array.isArray(i.specification)?i.specification:[i.specification];for(const r of n){const{name:o,ifcVersion:a}=r;if(!(o&&a))continue;const c=[],h=[],{applicability:d,requirements:I}=r;if(d){const{maxOccurs:u,...f}=d,E=Array.isArray(f)?f:[f];for(const C of E)for(const T in C){const m=Array.isArray(C[T])?C[T]:[C[T]];if(T==="entity"){const A=ao(this.components,m);c.push(...A)}}}if(I){const{maxOccurs:u,...f}=I,E=Array.isArray(f)?f:[f];for(const C of E)for(const T in C){const m=Array.isArray(C[T])?C[T]:[C[T]];if(T==="entity"){const A=ao(this.components,m);h.push(...A)}if(T==="attribute"){const A=Xu(this.components,m);h.push(...A)}if(T==="classification"){const A=ju(this.components,m);h.push(...A)}if(T==="property"){const A=Zu(this.components,m);h.push(...A)}}}if(c.length>0&&h.length>0){const u=this.create(o,a.split(/\s+/));u.applicability.add(...c),u.requirements.add(...h),t.push(u)}}}return t}export(e,t=this.list.values()){const s=t??this.list;return` + + + ${e.title} + ${e.copyright?`${e.copyright}`:""} + ${e.version?`${e.version}`:""} + ${e.description?`${e.description}`:""} + ${e.author?`${e.author}`:""} + ${e.date?`${e.date.toISOString().split("T")[0]}`:""} + ${e.purpose?`${e.purpose}`:""} + ${e.milestone?`${e.milestone}`:""} + + + ${[...s].map(i=>i.serialize()).join(` +`)} + +`}};p(lo,"uuid","9f0b9f78-9b2e-481a-b766-2fbfd01f342c"),p(lo,"xmlParser",new ta.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",ignoreAttributes:!1,ignoreDeclaration:!0,ignorePiTags:!0,numberParseOptions:{leadingZeros:!0,hex:!0},parseAttributeValue:!0,preserveOrder:!1,processEntities:!1,removeNSPrefix:!0,trimValues:!0}));export{bc as A,yi as C,Gc as F,Ju as G,sd as H,Ye as M,uh as N,Ku as O,Nc as Q,oo as R,sh as S,Re as T,yn as U,id as W,ah as _,Du as a,io as b,hh as c,ro as d,_c as e,xu as f,td as g,Qu as h,rt as k,qu as m,mn as o,Fo as p,Ct as s,Vs as v,Mu as w,Eh as y,ed as z}; diff --git a/examples/assets/index-BICSFNrK.js b/examples/assets/index-BICSFNrK.js deleted file mode 100644 index 498d79534..000000000 --- a/examples/assets/index-BICSFNrK.js +++ /dev/null @@ -1,162 +0,0 @@ -var io=Object.defineProperty;var no=(c,e,t)=>e in c?io(c,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[e]=t;var y=(c,e,t)=>(no(c,typeof e!="symbol"?e+"":e,t),t);import{d as Fs,V as W,h as _e,y as pn,s as ue,T as ms,S as gi,c as Ft,t as Nt,ba as ro,Q as Ti,a$ as Yn,a as st,b0 as oo,J as ao,e as Ss,x as En,P as Lr,aw as co,w as lo,ax as Jt,ay as ho,u as In,am as uo,z as fo,W as po,ap as Eo,b as $e,r as oi,az as Si,C as mn,O as ai,E as Io,L as Mr,K as xt,B as Lt,H as Vn,aA as Ms,au as pe,aB as mo,aC as es,N as vr,X as Co,Y as _i,Z as Cn,_ as gn,$ as Tn,a0 as Ns,a1 as _n,a2 as An,a3 as Ai,a4 as Rn,a5 as yn,a6 as On,a7 as Fn,a8 as Sn,a9 as wn,be as Nn,j as go,i as Zi,ai as jt,b1 as To,ag as bs,aF as _o,aG as Ao,aH as Ro,aI as yo,aJ as Oo,aK as Fo,I as xr,aD as Dr,aE as Ur,av as Br,b2 as So,b3 as wo,b4 as No,b5 as bo,ac as Gn,ad as Hn,ae as Po,af as Lo,ah as Mo,aj as he,ak as vo,aa as xo,ab as Do}from"./web-ifc-api-JuXSH2nk.js";import{c as vs,g as Uo}from"./_commonjsHelpers-Cpj98o6Y.js";const kr=0,Bo=1,ko=2,Wn=2,wi=1.25,Xn=1,ni=6*4+4+4,Ri=65535,zo=Math.pow(2,-24),Ni=Symbol("SKIP_GENERATION");function Yo(c){return c.index?c.index.count:c.attributes.position.count}function Ke(c){return Yo(c)/3}function Vo(c,e=ArrayBuffer){return c>65535?new Uint32Array(new e(4*c)):new Uint16Array(new e(2*c))}function Go(c,e){if(!c.index){const t=c.attributes.position.count,s=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,i=Vo(t,s);c.setIndex(new Fs(i,1));for(let n=0;no-a);for(let o=0;on.offset-r.offset),s=t[t.length-1];s.count=Math.min(e-s.offset,s.count);let i=0;return t.forEach(({count:n})=>i+=n),e!==i}function Tt(c,e,t){return t.min.x=e[c],t.min.y=e[c+1],t.min.z=e[c+2],t.max.x=e[c+3],t.max.y=e[c+4],t.max.z=e[c+5],t}function Wo(c){c[0]=c[1]=c[2]=1/0,c[3]=c[4]=c[5]=-1/0}function Zn(c){let e=-1,t=-1/0;for(let s=0;s<3;s++){const i=c[s+3]-c[s];i>t&&(t=i,e=s)}return e}function $n(c,e){e.set(c)}function jn(c,e,t){let s,i;for(let n=0;n<3;n++){const r=n+3;s=c[n],i=e[n],t[n]=si?s:i}}function xs(c,e,t){for(let s=0;s<3;s++){const i=e[c+2*s],n=e[c+2*s+1],r=i-n,o=i+n;rt[s+3]&&(t[s+3]=o)}}function ss(c){const e=c[3]-c[0],t=c[4]-c[1],s=c[5]-c[2];return 2*(e*t+t*s+s*e)}function bi(c,e,t,s,i=null){let n=1/0,r=1/0,o=1/0,a=-1/0,l=-1/0,h=-1/0,u=1/0,d=1/0,f=1/0,I=-1/0,p=-1/0,m=-1/0;const E=i!==null;for(let _=e*6,A=(e+t)*6;_a&&(a=w),E&&TI&&(I=T);const L=c[_+2],N=c[_+3],M=L-N,z=L+N;Ml&&(l=z),E&&Lp&&(p=L);const O=c[_+4],P=c[_+5],C=O-P,v=O+P;Ch&&(h=v),E&&Om&&(m=O)}s[0]=n,s[1]=r,s[2]=o,s[3]=a,s[4]=l,s[5]=h,E&&(i[0]=u,i[1]=d,i[2]=f,i[3]=I,i[4]=p,i[5]=m)}function Xo(c,e,t,s){let i=1/0,n=1/0,r=1/0,o=-1/0,a=-1/0,l=-1/0;for(let h=e*6,u=(e+t)*6;ho&&(o=d);const f=c[h+2];fa&&(a=f);const I=c[h+4];Il&&(l=I)}s[0]=i,s[1]=n,s[2]=r,s[3]=o,s[4]=a,s[5]=l}function Zo(c,e){Wo(e);const t=c.attributes.position,s=c.index?c.index.array:null,i=Ke(c),n=new Float32Array(i*6),r=t.normalized,o=t.array,a=t.offset||0;let l=3;t.isInterleavedBufferAttribute&&(l=t.data.stride);const h=["getX","getY","getZ"];for(let u=0;uF&&(F=A),T>F&&(F=T);const w=(F-R)/2,L=E*2;n[f+L+0]=R+w,n[f+L+1]=w+(Math.abs(R)+w)*zo,Re[E+3]&&(e[E+3]=F)}}return n}const le=32,$o=(c,e)=>c.candidate-e.candidate,Ee=new Array(le).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),Ds=new Float32Array(6);function jo(c,e,t,s,i,n){let r=-1,o=0;if(n===kr)r=Zn(e),r!==-1&&(o=(e[r]+e[r+3])/2);else if(n===Bo)r=Zn(c),r!==-1&&(o=Qo(t,s,i,r));else if(n===ko){const a=ss(c);let l=wi*i;const h=s*6,u=(s+i)*6;for(let d=0;d<3;d++){const f=e[d],m=(e[d+3]-f)/le;if(i=w.candidate?xs(T,t,w.rightCacheBounds):(xs(T,t,w.leftCacheBounds),w.count++)}}for(let T=0;T=le&&(F=le-1);const w=Ee[F];w.count++,xs(A,t,w.bounds)}const E=Ee[le-1];$n(E.bounds,E.rightCacheBounds);for(let A=le-2;A>=0;A--){const T=Ee[A],R=Ee[A+1];jn(T.bounds,R.rightCacheBounds,T.rightCacheBounds)}let _=0;for(let A=0;A=a;)o--;if(r=a;)o--;if(r2**16,i=s?4:2,n=e?new SharedArrayBuffer(t*i):new ArrayBuffer(t*i),r=s?new Uint32Array(n):new Uint16Array(n);for(let o=0,a=r.length;o=i&&(u=!0,n&&(console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`),console.warn(t))),F<=r||L>=i)return _(R+F),T.offset=R,T.count=F,T;const N=jo(T.boundingData,w,I,R,F,o);if(N.axis===-1)return _(R+F),T.offset=R,T.count=F,T;const M=p(h,s,I,R,F,N);if(M===R||M===R+F)_(R+F),T.offset=R,T.count=F;else{T.splitAxis=N.axis;const z=new Us,O=R,P=M-R;T.left=z,z.boundingData=new Float32Array(6),bi(I,O,P,z.boundingData,f),A(z,O,P,f,L+1);const C=new Us,v=M,$=F-P;T.right=C,C.boundingData=new Float32Array(6),bi(I,v,$,C.boundingData,f),A(C,v,$,f,L+1)}return T}}function ea(c,e){const t=c.geometry;e.indirect&&(c._indirectBuffer=Jo(t,e.useSharedArrayBuffer),Ho(t)&&!e.verbose&&console.warn('MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.')),c._indirectBuffer||Go(t,e);const s=ta(c,e);let i,n,r;const o=[],a=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let u=0;uMath.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return n[f+6]=T/4,T=h(T,_),n[f+7]=A,T}}}class de{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let s=1/0,i=-1/0;for(let n=0,r=e.length;ni?a:i}this.min=s,this.max=i}setFromPoints(e,t){let s=1/0,i=-1/0;for(let n=0,r=t.length;ni?a:i}this.min=s,this.max=i}isSeparated(e){return this.min>e.max||e.min>this.max}}de.prototype.setFromBox=function(){const c=new W;return function(t,s){const i=s.min,n=s.max;let r=1/0,o=-1/0;for(let a=0;a<=1;a++)for(let l=0;l<=1;l++)for(let h=0;h<=1;h++){c.x=i.x*a+n.x*(1-a),c.y=i.y*l+n.y*(1-l),c.z=i.z*h+n.z*(1-h);const u=t.dot(c);r=Math.min(u,r),o=Math.max(u,o)}this.min=r,this.max=o}}();const sa=function(){const c=new W,e=new W,t=new W;return function(i,n,r){const o=i.start,a=c,l=n.start,h=e;t.subVectors(o,l),c.subVectors(i.end,i.start),e.subVectors(n.end,n.start);const u=t.dot(h),d=h.dot(a),f=h.dot(h),I=t.dot(a),m=a.dot(a)*f-d*d;let E,_;m!==0?E=(u*d-I*f)/m:E=0,_=(u+E*d)/f,r.x=E,r.y=_}}(),bn=function(){const c=new _e,e=new W,t=new W;return function(i,n,r,o){sa(i,n,c);let a=c.x,l=c.y;if(a>=0&&a<=1&&l>=0&&l<=1){i.at(a,r),n.at(l,o);return}else if(a>=0&&a<=1){l<0?n.at(0,o):n.at(1,o),i.closestPointToPoint(o,!0,r);return}else if(l>=0&&l<=1){a<0?i.at(0,r):i.at(1,r),n.closestPointToPoint(r,!0,o);return}else{let h;a<0?h=i.start:h=i.end;let u;l<0?u=n.start:u=n.end;const d=e,f=t;if(i.closestPointToPoint(u,!0,e),n.closestPointToPoint(h,!0,t),d.distanceToSquared(u)<=f.distanceToSquared(h)){r.copy(d),o.copy(u);return}else{r.copy(h),o.copy(f);return}}}}(),ia=function(){const c=new W,e=new W,t=new pn,s=new ue;return function(n,r){const{radius:o,center:a}=n,{a:l,b:h,c:u}=r;if(s.start=l,s.end=h,s.closestPointToPoint(a,!0,c).distanceTo(a)<=o||(s.start=l,s.end=u,s.closestPointToPoint(a,!0,c).distanceTo(a)<=o)||(s.start=h,s.end=u,s.closestPointToPoint(a,!0,c).distanceTo(a)<=o))return!0;const p=r.getPlane(t);if(Math.abs(p.distanceToPoint(a))<=o){const E=p.projectPoint(a,e);if(r.containsPoint(E))return!0}return!1}}(),na=1e-15;function Pi(c){return Math.abs(c)new W),this.satBounds=new Array(4).fill().map(()=>new de),this.points=[this.a,this.b,this.c],this.sphere=new gi,this.plane=new pn,this.needsUpdate=!0}intersectsSphere(e){return ia(e,this)}update(){const e=this.a,t=this.b,s=this.c,i=this.points,n=this.satAxes,r=this.satBounds,o=n[0],a=r[0];this.getNormal(o),a.setFromPoints(o,i);const l=n[1],h=r[1];l.subVectors(e,t),h.setFromPoints(l,i);const u=n[2],d=r[2];u.subVectors(t,s),d.setFromPoints(u,i);const f=n[3],I=r[3];f.subVectors(s,e),I.setFromPoints(f,i),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(o,e),this.needsUpdate=!1}}ee.prototype.closestPointToSegment=function(){const c=new W,e=new W,t=new ue;return function(i,n=null,r=null){const{start:o,end:a}=i,l=this.points;let h,u=1/0;for(let d=0;d<3;d++){const f=(d+1)%3;t.start.copy(l[d]),t.end.copy(l[f]),bn(t,i,c,e),h=c.distanceToSquared(e),h=2){(T===1?E.start:E.end).copy(f),A=2;break}if(A++,A===2&&T===-1)break}}return A}return function(m,E=null,_=!1){this.needsUpdate&&this.update(),m.isExtendedTriangle?m.needsUpdate&&m.update():(c.copy(m),c.update(),m=c);const A=this.plane,T=m.plane;if(Math.abs(A.normal.dot(T.normal))>1-1e-10){const R=this.satBounds,F=this.satAxes;t[0]=m.a,t[1]=m.b,t[2]=m.c;for(let N=0;N<4;N++){const M=R[N],z=F[N];if(s.setFromPoints(z,t),M.isSeparated(s))return!1}const w=m.satBounds,L=m.satAxes;e[0]=this.a,e[1]=this.b,e[2]=this.c;for(let N=0;N<4;N++){const M=w[N],z=L[N];if(s.setFromPoints(z,e),M.isSeparated(s))return!1}for(let N=0;N<4;N++){const M=F[N];for(let z=0;z<4;z++){const O=L[z];if(n.crossVectors(M,O),s.setFromPoints(n,e),i.setFromPoints(n,t),s.isSeparated(i))return!1}}return E&&(_||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),E.start.set(0,0,0),E.end.set(0,0,0)),!0}else{const R=I(this,T,u);if(R===1&&m.containsPoint(u.end))return E&&(E.start.copy(u.end),E.end.copy(u.end)),!0;if(R!==2)return!1;const F=I(m,A,d);if(F===1&&this.containsPoint(d.end))return E&&(E.start.copy(d.end),E.end.copy(d.end)),!0;if(F!==2)return!1;if(u.delta(o),d.delta(a),o.dot(a)<0){let P=d.start;d.start=d.end,d.end=P}const w=u.start.dot(o),L=u.end.dot(o),N=d.start.dot(o),M=d.end.dot(o),z=L0?E.start.copy(u.start):E.start.copy(d.start),l.subVectors(u.end,d.end),l.dot(o)<0?E.end.copy(u.end):E.end.copy(d.end)),!0)}}}();ee.prototype.distanceToPoint=function(){const c=new W;return function(t){return this.closestPointToPoint(t,c),t.distanceTo(c)}}();ee.prototype.distanceToTriangle=function(){const c=new W,e=new W,t=["a","b","c"],s=new ue,i=new ue;return function(r,o=null,a=null){const l=o||a?s:null;if(this.intersectsTriangle(r,l))return(o||a)&&(o&&l.getCenter(o),a&&l.getCenter(a)),0;let h=1/0;for(let u=0;u<3;u++){let d;const f=t[u],I=r[f];this.closestPointToPoint(I,c),d=I.distanceToSquared(c),dnew W),this.satAxes=new Array(3).fill().map(()=>new W),this.satBounds=new Array(3).fill().map(()=>new de),this.alignedSatBounds=new Array(3).fill().map(()=>new de),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),s&&this.matrix.copy(s)}set(e,t,s){this.min.copy(e),this.max.copy(t),this.matrix.copy(s),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}}Ut.prototype.update=function(){return function(){const e=this.matrix,t=this.min,s=this.max,i=this.points;for(let l=0;l<=1;l++)for(let h=0;h<=1;h++)for(let u=0;u<=1;u++){const d=1*l|2*h|4*u,f=i[d];f.x=l?s.x:t.x,f.y=h?s.y:t.y,f.z=u?s.z:t.z,f.applyMatrix4(e)}const n=this.satBounds,r=this.satAxes,o=i[0];for(let l=0;l<3;l++){const h=r[l],u=n[l],d=1<new ue),t=new Array(12).fill().map(()=>new ue),s=new W,i=new W;return function(r,o=0,a=null,l=null){if(this.needsUpdate&&this.update(),this.intersectsBox(r))return(a||l)&&(r.getCenter(i),this.closestPointToPoint(i,s),r.closestPointToPoint(s,i),a&&a.copy(s),l&&l.copy(i)),0;const h=o*o,u=r.min,d=r.max,f=this.points;let I=1/0;for(let m=0;m<8;m++){const E=f[m];i.copy(E).clamp(u,d);const _=E.distanceToSquared(i);if(_new ee)}}const Ht=new ra;function zt(c,e){return e[c+15]===65535}function Yt(c,e){return e[c+6]}function Wt(c,e){return e[c+14]}function Xt(c){return c+8}function Zt(c,e){return e[c+6]}function Vr(c,e){return e[c+7]}class oa{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const e=[];let t=null;this.setBuffer=s=>{t&&e.push(t),t=s,this.float32Array=new Float32Array(s),this.uint16Array=new Uint16Array(s),this.uint32Array=new Uint32Array(s)},this.clearBuffer=()=>{t=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,e.length!==0&&this.setBuffer(e.pop())}}}const mt=new oa;let Te,We;const Pe=[],Bs=new Pn(()=>new Nt);function aa(c,e,t,s,i,n){Te=Bs.getPrimitive(),We=Bs.getPrimitive(),Pe.push(Te,We),mt.setBuffer(c._roots[e]);const r=$i(0,c.geometry,t,s,i,n);mt.clearBuffer(),Bs.releasePrimitive(Te),Bs.releasePrimitive(We),Pe.pop(),Pe.pop();const o=Pe.length;return o>0&&(We=Pe[o-1],Te=Pe[o-2]),r}function $i(c,e,t,s,i=null,n=0,r=0){const{float32Array:o,uint16Array:a,uint32Array:l}=mt;let h=c*2;if(zt(h,a)){const d=Yt(c,l),f=Wt(h,a);return Tt(c,o,Te),s(d,f,!1,r,n+c,Te)}else{let M=function(O){const{uint16Array:P,uint32Array:C}=mt;let v=O*2;for(;!zt(v,P);)O=Xt(O),v=O*2;return Yt(O,C)},z=function(O){const{uint16Array:P,uint32Array:C}=mt;let v=O*2;for(;!zt(v,P);)O=Zt(O,C),v=O*2;return Yt(O,C)+Wt(v,P)};const d=Xt(c),f=Zt(c,l);let I=d,p=f,m,E,_,A;if(i&&(_=Te,A=We,Tt(I,o,_),Tt(p,o,A),m=i(_),E=i(A),E(is.copy(e).clamp(h.min,h.max),is.distanceToSquared(e)),intersectsBounds:(h,u,d)=>d{h.closestPointToPoint(e,is);const d=e.distanceToSquared(is);return d0&&l.normal.multiplyScalar(-1));const h={a:n,b:r,c:o,normal:new W,materialIndex:0};ms.getNormal(Le,Me,ve,h.normal),l.face=h,l.faceIndex=n}return l}function yi(c,e,t,s,i){const n=s*3;let r=n+0,o=n+1,a=n+2;const l=c.index;c.index&&(r=l.getX(r),o=l.getX(o),a=l.getX(a));const{position:h,normal:u,uv:d,uv1:f}=c.attributes,I=ha(t,h,u,d,f,r,o,a,e);return I?(I.faceIndex=s,i&&i.push(I),I):null}function St(c,e,t,s){const i=c.a,n=c.b,r=c.c;let o=e,a=e+1,l=e+2;t&&(o=t.getX(o),a=t.getX(a),l=t.getX(l)),i.x=s.getX(o),i.y=s.getY(o),i.z=s.getZ(o),n.x=s.getX(a),n.y=s.getY(a),n.z=s.getZ(a),r.x=s.getX(l),r.y=s.getY(l),r.z=s.getZ(l)}function ua(c,e,t,s,i,n){const{geometry:r,_indirectBuffer:o}=c;for(let a=s,l=s+i;aF&&(F=O),Pw&&(w=P),CL&&(L=C)}return a[d+0]!==A||a[d+1]!==T||a[d+2]!==R||a[d+3]!==F||a[d+4]!==w||a[d+5]!==L?(a[d+0]=A,a[d+1]=T,a[d+2]=R,a[d+3]=F,a[d+4]=w,a[d+5]=L,!0):!1}else{const E=d+8,_=r[d+6],A=E+f,T=_+f;let R=I,F=!1,w=!1;e?R||(F=e.has(A),w=e.has(T),R=!F&&!w):(F=!0,w=!0);const L=R||F,N=R||w;let M=!1;L&&(M=u(E,f,R));let z=!1;N&&(z=u(_,f,R));const O=M||z;if(O)for(let P=0;P<3;P++){const C=E+P,v=_+P,$=a[C],Y=a[C+3],q=a[v],G=a[v+3];a[d+P]=$G?Y:G}return O}}}const Jn=new Nt;function Ae(c,e,t,s){return Tt(c,e,Jn),t.intersectBox(Jn,s)}function Ea(c,e,t,s,i,n){const{geometry:r,_indirectBuffer:o}=c;for(let a=s,l=s+i;a=0;let f,I;d?(f=Xt(c),I=Zt(c,r)):(f=Zt(c,r),I=Xt(c));const m=Ae(f,i,s,er)?Qi(f,e,t,s):null;if(m){const A=m.point[h];if(d?A<=i[I+l]:A>=i[I+l+3])return m}const _=Ae(I,i,s,er)?Qi(I,e,t,s):null;return m&&_?m.distance<=_.distance?m:_:m||_||null}}const Gs=new Nt,xe=new ee,De=new ee,ns=new Ft,sr=new Ut,Hs=new Ut;function _a(c,e,t,s){mt.setBuffer(c._roots[e]);const i=Ki(0,c,t,s);return mt.clearBuffer(),i}function Ki(c,e,t,s,i=null){const{float32Array:n,uint16Array:r,uint32Array:o}=mt;let a=c*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),sr.set(t.boundingBox.min,t.boundingBox.max,s),i=sr),zt(a,r)){const h=e.geometry,u=h.index,d=h.attributes.position,f=t.index,I=t.attributes.position,p=Yt(c,o),m=Wt(a,r);if(ns.copy(s).invert(),t.boundsTree)return Tt(c,n,Hs),Hs.matrix.copy(ns),Hs.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:_=>Hs.intersectsBox(_),intersectsTriangle:_=>{_.a.applyMatrix4(s),_.b.applyMatrix4(s),_.c.applyMatrix4(s),_.needsUpdate=!0;for(let A=p*3,T=(m+p)*3;AMi.distanceToBox(R),intersectsBounds:(R,F,w)=>w<_&&w{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:L=>rs.distanceToBox(L),intersectsBounds:(L,N,M)=>M<_&&M{for(let M=L,z=L+N;MF&&(F=C),vw&&(w=v),$L&&(L=$)}}return a[d+0]!==A||a[d+1]!==T||a[d+2]!==R||a[d+3]!==F||a[d+4]!==w||a[d+5]!==L?(a[d+0]=A,a[d+1]=T,a[d+2]=R,a[d+3]=F,a[d+4]=w,a[d+5]=L,!0):!1}else{const E=d+8,_=r[d+6],A=E+f,T=_+f;let R=I,F=!1,w=!1;e?R||(F=e.has(A),w=e.has(T),R=!F&&!w):(F=!0,w=!0);const L=R||F,N=R||w;let M=!1;L&&(M=u(E,f,R));let z=!1;N&&(z=u(_,f,R));const O=M||z;if(O)for(let P=0;P<3;P++){const C=E+P,v=_+P,$=a[C],Y=a[C+3],q=a[v],G=a[v+3];a[d+P]=$G?Y:G}return O}}}const ir=new W;function wa(c,e,t,s,i){mt.setBuffer(c._roots[e]),qi(0,c,t,s,i),mt.clearBuffer()}function qi(c,e,t,s,i){const{float32Array:n,uint16Array:r,uint32Array:o}=mt,a=c*2;if(zt(a,r)){const h=Yt(c,o),u=Wt(a,r);Ea(e,t,s,h,u,i)}else{const h=Xt(c);Ae(h,n,s,ir)&&qi(h,e,t,s,i);const u=Zt(c,o);Ae(u,n,s,ir)&&qi(u,e,t,s,i)}}const nr=new W,Na=["x","y","z"];function ba(c,e,t,s){mt.setBuffer(c._roots[e]);const i=Ji(0,c,t,s);return mt.clearBuffer(),i}function Ji(c,e,t,s){const{float32Array:i,uint16Array:n,uint32Array:r}=mt;let o=c*2;if(zt(o,n)){const l=Yt(c,r),h=Wt(o,n);return Ia(e,t,s,l,h)}else{const l=Vr(c,r),h=Na[l],d=s.direction[h]>=0;let f,I;d?(f=Xt(c),I=Zt(c,r)):(f=Zt(c,r),I=Xt(c));const m=Ae(f,i,s,nr)?Ji(f,e,t,s):null;if(m){const A=m.point[h];if(d?A<=i[I+l]:A>=i[I+l+3])return m}const _=Ae(I,i,s,nr)?Ji(I,e,t,s):null;return m&&_?m.distance<=_.distance?m:_:m||_||null}}const Xs=new Nt,Ue=new ee,Be=new ee,os=new Ft,rr=new Ut,Zs=new Ut;function Pa(c,e,t,s){mt.setBuffer(c._roots[e]);const i=tn(0,c,t,s);return mt.clearBuffer(),i}function tn(c,e,t,s,i=null){const{float32Array:n,uint16Array:r,uint32Array:o}=mt;let a=c*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),rr.set(t.boundingBox.min,t.boundingBox.max,s),i=rr),zt(a,r)){const h=e.geometry,u=h.index,d=h.attributes.position,f=t.index,I=t.attributes.position,p=Yt(c,o),m=Wt(a,r);if(os.copy(s).invert(),t.boundsTree)return Tt(c,n,Zs),Zs.matrix.copy(os),Zs.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:_=>Zs.intersectsBox(_),intersectsTriangle:_=>{_.a.applyMatrix4(s),_.b.applyMatrix4(s),_.c.applyMatrix4(s),_.needsUpdate=!0;for(let A=p,T=m+p;Avi.distanceToBox(R),intersectsBounds:(R,F,w)=>w<_&&w{if(e.boundsTree){const w=e.boundsTree;return w.shapecast({boundsTraverseOrder:L=>as.distanceToBox(L),intersectsBounds:(L,N,M)=>M<_&&M{for(let M=L,z=L+N;Mnew Nt),ke=new Nt,ze=new Nt,xi=new Nt,Di=new Nt;let Ui=!1;function Ba(c,e,t,s){if(Ui)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");Ui=!0;const i=c._roots,n=e._roots;let r,o=0,a=0;const l=new Ft().copy(t).invert();for(let h=0,u=i.length;ha.slice()),index:r.array.slice(),indirectBuffer:n?n.slice():null}:o={roots:i,index:r.array,indirectBuffer:n},o}static deserialize(e,t,s={}){s={setIndex:!0,indirect:!!e.indirectBuffer,...s};const{index:i,roots:n,indirectBuffer:r}=e,o=new Ln(t,{...s,[Ni]:!0});if(o._roots=n,o._indirectBuffer=r||null,s.setIndex){const a=t.getIndex();if(a===null){const l=new Fs(e.index,1,!1);t.setIndex(l)}else a.array!==i&&(a.array.set(i),a.needsUpdate=!0)}return o}get indirect(){return!!this._indirectBuffer}constructor(e,t={}){if(e.isBufferGeometry){if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(t=Object.assign({strategy:kr,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[Ni]:!1},t),t.useSharedArrayBuffer&&!Ua())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=e,this._roots=null,this._indirectBuffer=null,t[Ni]||(ea(this,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new Nt)));const{_indirectBuffer:s}=this;this.resolveTriangleIndex=t.indirect?i=>s[i]:i=>i}refit(e=null){return(this.indirect?Sa:pa)(this,e)}traverse(e,t=0){const s=this._roots[t],i=new Uint32Array(s),n=new Uint16Array(s);r(0);function r(o,a=0){const l=o*2,h=n[l+15]===Ri;if(h){const u=i[o+6],d=n[l+14];e(a,h,new Float32Array(s,o*4,6),u,d)}else{const u=o+ni/4,d=i[o+6],f=i[o+7];e(a,h,new Float32Array(s,o*4,6),f)||(r(u,a+1),r(d,a+1))}}}raycast(e,t=Yn){const s=this._roots,i=this.geometry,n=[],r=t.isMaterial,o=Array.isArray(t),a=i.groups,l=r?t.side:t,h=this.indirect?wa:Ca;for(let u=0,d=s.length;uu(d,f,I,p,m)?!0:s(d,f,this,o,I,p,t)}else r||(o?r=(u,d,f,I)=>s(u,d,this,o,f,I,t):r=(u,d,f)=>f);let a=!1,l=0;const h=this._roots;for(let u=0,d=h.length;u{const p=this.resolveTriangleIndex(I);St(r,p*3,o,a)}:I=>{St(r,I*3,o,a)},h=Ht.getPrimitive(),u=e.geometry.index,d=e.geometry.attributes.position,f=e.indirect?I=>{const p=e.resolveTriangleIndex(I);St(h,p*3,u,d)}:I=>{St(h,I*3,u,d)};if(n){const I=(p,m,E,_,A,T,R,F)=>{for(let w=E,L=E+_;wjs.intersectsBox(s),intersectsTriangle:s=>js.intersectsTriangle(s)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,s={},i={},n=0,r=1/0){return(this.indirect?Da:Fa)(this,e,t,s,i,n,r)}closestPointToPoint(e,t={},s=0,i=1/0){return ca(this,e,t,s,i)}getBoundingBox(e){return e.makeEmpty(),this._roots.forEach(s=>{Tt(0,new Float32Array(s),or),e.union(or)}),e}}function ar(c,e,t){return c===null||(c.point.applyMatrix4(e.matrixWorld),c.distance=c.point.distanceTo(t.ray.origin),c.object=e,c.distancet.far)?null:c}const Bi=new oo,cr=new Ft,ka=st.prototype.raycast;function za(c,e){if(this.geometry.boundsTree){if(this.material===void 0)return;cr.copy(this.matrixWorld).invert(),Bi.copy(c.ray).applyMatrix4(cr);const t=this.geometry.boundsTree;if(c.firstHitOnly===!0){const s=ar(t.raycastFirst(Bi,this.material),this,c);s&&e.push(s)}else{const s=t.raycast(Bi,this.material);for(let i=0,n=s.length;i{const t=this.handlers.slice(0);for(const s of t)s(e)});y(this,"handlers",[])}add(e){this.handlers.push(e)}remove(e){this.handlers=this.handlers.filter(t=>t!==e)}reset(){this.handlers.length=0}}class Ga{constructor(){y(this,"trigger",async e=>{const t=this.handlers.slice(0);for(const s of t)await s(e)});y(this,"handlers",[])}add(e){this.handlers.push(e)}remove(e){this.handlers=this.handlers.filter(t=>t!==e)}reset(){this.handlers.length=0}}class Mn{constructor(e){y(this,"isDisposeable",()=>"dispose"in this&&"onDisposed"in this);y(this,"isResizeable",()=>"resize"in this&&"getSize"in this);y(this,"isUpdateable",()=>"onAfterUpdate"in this&&"onBeforeUpdate"in this&&"update"in this);y(this,"isHideable",()=>"visible"in this);y(this,"isConfigurable",()=>"setup"in this&&"config"in this&&"onSetup"in this);this.components=e}}class Bt extends Mn{}class Ha extends Mn{constructor(t){super(t);y(this,"worlds",new Map);y(this,"onWorldChanged",new et);y(this,"currentWorld",null);this.onWorldChanged.add(({world:s,action:i})=>{i==="removed"&&this.worlds.delete(s.uuid)})}}class Wa extends Ha{constructor(){super(...arguments);y(this,"hasCameraControls",()=>"controls"in this)}}const _s=class _s extends Bt{constructor(t){super(t);y(this,"_disposedComponents",new Set);y(this,"enabled",!0);t.add(_s.uuid,this)}get(){return this._disposedComponents}destroy(t,s=!0,i=!0){t.removeFromParent();const n=t;n.dispose&&n.dispose(),this.disposeGeometryAndMaterials(t,s),i&&n.children&&n.children.length&&this.disposeChildren(n),t.children.length=0}disposeGeometry(t){t.boundsTree&&t.disposeBoundsTree&&t.disposeBoundsTree(),t.dispose()}disposeGeometryAndMaterials(t,s){const i=t;i.geometry&&this.disposeGeometry(i.geometry),s&&i.material&&_s.disposeMaterial(i),i.material=[],i.geometry=null}disposeChildren(t){for(const s of t.children)this.destroy(s)}static disposeMaterial(t){if(t.material)if(Array.isArray(t.material))for(const s of t.material)s.dispose();else t.material.dispose()}};y(_s,"uuid","76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");let je=_s;class Xe extends Set{constructor(t){super(t);y(this,"onItemAdded",new et);y(this,"onItemDeleted",new et);y(this,"onCleared",new et);y(this,"guard",()=>!0)}clear(){super.clear(),this.onCleared.trigger()}add(...t){for(const s of t)this.has(s)||!this.guard(s)||(super.add(s),this.onItemAdded||(this.onItemAdded=new et),this.onItemAdded.trigger(s));return this}delete(t){const s=super.delete(t);return s&&this.onItemDeleted.trigger(),s}dispose(){this.clear(),this.onItemAdded.reset(),this.onItemDeleted.reset(),this.onCleared.reset()}}class Re extends Map{constructor(t){super(t);y(this,"onItemSet",new et);y(this,"onItemUpdated",new et);y(this,"onItemDeleted",new et);y(this,"onCleared",new et);y(this,"guard",()=>!0)}clear(){super.clear(),this.onCleared.trigger()}set(t,s){const i=this.has(t);if(!(this.guard??(()=>!0))(t,s))return this;const o=super.set(t,s);return i?(this.onItemUpdated||(this.onItemUpdated=new et),this.onItemUpdated.trigger({key:t,value:s})):(this.onItemSet||(this.onItemSet=new et),this.onItemSet.trigger({key:t,value:s})),o}delete(t){const s=super.delete(t);return s&&this.onItemDeleted.trigger(t),s}dispose(){this.clear(),this.onItemSet.reset(),this.onItemDeleted.reset(),this.onCleared.reset()}}class lr{static isTransparent(e){return e.transparent&&e.opacity<1}}const yt=class yt{static create(){const e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,s=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return`${yt._lut[e&255]+yt._lut[e>>8&255]+yt._lut[e>>16&255]+yt._lut[e>>24&255]}-${yt._lut[t&255]}${yt._lut[t>>8&255]}-${yt._lut[t>>16&15|64]}${yt._lut[t>>24&255]}-${yt._lut[s&63|128]}${yt._lut[s>>8&255]}-${yt._lut[s>>16&255]}${yt._lut[s>>24&255]}${yt._lut[i&255]}${yt._lut[i>>8&255]}${yt._lut[i>>16&255]}${yt._lut[i>>24&255]}`.toLowerCase()}static validate(e){if(!yt._pattern.test(e))throw new Error(`${e} is not a valid UUID v4. - -- If you're the tool creator, you can take one from https://www.uuidgenerator.net/. - -- If you're using a platform tool, verify the uuid isn't misspelled or contact the tool creator.`)}};y(yt,"_pattern",/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/),y(yt,"_lut",["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"]);let fe=yt;const ui=class ui{constructor(){y(this,"onDisposed",new et);y(this,"list",new Map);y(this,"enabled",!1);y(this,"_clock");y(this,"update",()=>{if(!this.enabled)return;const e=this._clock.getDelta();for(const[t,s]of this.list)s.enabled&&s.isUpdateable()&&s.update(e);requestAnimationFrame(this.update)});this._clock=new ao,ui.setupBVH()}add(e,t){if(this.list.has(e))throw new Error("You're trying to add a component that already exists in the components instance. Use Components.get() instead.");fe.validate(e),this.list.set(e,t)}get(e){const t=e.uuid;if(!this.list.has(t)){const s=new e(this);return this.list.has(t)||this.add(t,s),s}return this.list.get(t)}init(){this.enabled=!0,this._clock.start(),this.update()}dispose(){this.enabled=!1;for(const[e,t]of this.list)t.enabled=!1,t.isDisposeable()&&t.dispose();this._clock.stop(),this.onDisposed.trigger(),this.onDisposed.reset()}static setupBVH(){Ss.prototype.computeBoundsTree=Ya,Ss.prototype.disposeBoundsTree=Va,st.prototype.raycast=za}};y(ui,"release","2.2.6");let en=ui;class Xa extends Mn{constructor(){super(...arguments);y(this,"meshes",new Set);y(this,"onAfterUpdate",new et);y(this,"onBeforeUpdate",new et);y(this,"onDisposed",new et);y(this,"isDisposing",!1);y(this,"enabled",!0);y(this,"uuid",fe.create());y(this,"name");y(this,"_scene");y(this,"_camera");y(this,"_renderer",null)}get scene(){if(!this._scene)throw new Error("No scene initialized!");return this._scene}set scene(t){this._scene=t,t.worlds.set(this.uuid,this),t.currentWorld=this,t.onWorldChanged.trigger({world:this,action:"added"})}get camera(){if(!this._camera)throw new Error("No camera initialized!");return this._camera}set camera(t){this._camera=t,t.worlds.set(this.uuid,this),t.currentWorld=this,t.onWorldChanged.trigger({world:this,action:"added"})}get renderer(){return this._renderer}set renderer(t){this._renderer=t,t&&(t.worlds.set(this.uuid,this),t.currentWorld=this,t.onWorldChanged.trigger({world:this,action:"added"}))}update(t){this.enabled&&(!this._scene||!this._camera||(this.scene.currentWorld=this,this.camera.currentWorld=this,this.renderer&&(this.renderer.currentWorld=this),this.onBeforeUpdate.trigger(),this.scene.isUpdateable()&&this.scene.update(t),this.camera.isUpdateable()&&this.camera.update(t),this.renderer&&this.renderer.update(t),this.onAfterUpdate.trigger()))}dispose(t=!0){if(this.enabled=!1,this.isDisposing=!0,this.scene.onWorldChanged.trigger({world:this,action:"removed"}),this.camera.onWorldChanged.trigger({world:this,action:"removed"}),this.renderer&&this.renderer.onWorldChanged.trigger({world:this,action:"removed"}),t){const s=this.components.get(je);this.scene.dispose(),this.camera.isDisposeable()&&this.camera.dispose(),this.renderer&&this.renderer.dispose();for(const i of this.meshes)s.destroy(i);this.meshes.clear()}this._scene=null,this._camera=null,this._renderer=null,this.onDisposed.trigger()}}/*! - * camera-controls - * https://github.com/yomotsu/camera-controls - * (c) 2017 @yomotsu - * Released under the MIT License. - */const at={LEFT:1,RIGHT:2,MIDDLE:4},V=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,OFFSET:4,DOLLY:8,ZOOM:16,TOUCH_ROTATE:32,TOUCH_TRUCK:64,TOUCH_OFFSET:128,TOUCH_DOLLY:256,TOUCH_ZOOM:512,TOUCH_DOLLY_TRUCK:1024,TOUCH_DOLLY_OFFSET:2048,TOUCH_DOLLY_ROTATE:4096,TOUCH_ZOOM_TRUCK:8192,TOUCH_ZOOM_OFFSET:16384,TOUCH_ZOOM_ROTATE:32768}),Ye={NONE:0,IN:1,OUT:-1};function Oe(c){return c.isPerspectiveCamera}function me(c){return c.isOrthographicCamera}const Ve=Math.PI*2,hr=Math.PI/2,Gr=1e-5,cs=Math.PI/180;function Kt(c,e,t){return Math.max(e,Math.min(t,c))}function It(c,e=Gr){return Math.abs(c)0==f>h&&(f=h,t.value=(f-h)/n),f}function dr(c,e,t,s,i=1/0,n,r){s=Math.max(1e-4,s);const o=2/s,a=o*n,l=1/(1+a+.48*a*a+.235*a*a*a);let h=e.x,u=e.y,d=e.z,f=c.x-h,I=c.y-u,p=c.z-d;const m=h,E=u,_=d,A=i*s,T=A*A,R=f*f+I*I+p*p;if(R>T){const v=Math.sqrt(R);f=f/v*A,I=I/v*A,p=p/v*A}h=c.x-f,u=c.y-I,d=c.z-p;const F=(t.x+o*f)*n,w=(t.y+o*I)*n,L=(t.z+o*p)*n;t.x=(t.x-o*F)*l,t.y=(t.y-o*w)*l,t.z=(t.z-o*L)*l,r.x=h+(f+F)*l,r.y=u+(I+w)*l,r.z=d+(p+L)*l;const N=m-c.x,M=E-c.y,z=_-c.z,O=r.x-m,P=r.y-E,C=r.z-_;return N*O+M*P+z*C>0&&(r.x=m,r.y=E,r.z=_,t.x=(r.x-m)/n,t.y=(r.y-E)/n,t.z=(r.z-_)/n),r}function ki(c,e){e.set(0,0),c.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=c.length,e.y/=c.length}function zi(c,e){return me(c)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}class Za{constructor(){this._listeners={}}addEventListener(e,t){const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(t)===-1&&s[e].push(t)}hasEventListener(e,t){const s=this._listeners;return s[e]!==void 0&&s[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners[e];if(i!==void 0){const n=i.indexOf(t);n!==-1&&i.splice(n,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const s=this._listeners[e.type];if(s!==void 0){e.target=this;const i=s.slice(0);for(let n=0,r=i.length;n{},this._enabled=!0,this._state=V.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=Ye.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new ot.Vector3,this._focalOffsetVelocity=new ot.Vector3,this._zoomVelocity={value:0},this._truckInternal=(T,R,F)=>{let w,L;if(Oe(this._camera)){const N=ct.copy(this._camera.position).sub(this._target),M=this._camera.getEffectiveFOV()*cs,z=N.length()*Math.tan(M*.5);w=this.truckSpeed*T*z/this._elementRect.height,L=this.truckSpeed*R*z/this._elementRect.height}else if(me(this._camera)){const N=this._camera;w=T*(N.right-N.left)/N.zoom/this._elementRect.width,L=R*(N.top-N.bottom)/N.zoom/this._elementRect.height}else return;this.verticalDragToForward?(F?this.setFocalOffset(this._focalOffsetEnd.x+w,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(w,0,!0),this.forward(-L,!0)):F?this.setFocalOffset(this._focalOffsetEnd.x+w,this._focalOffsetEnd.y+L,this._focalOffsetEnd.z,!0):this.truck(w,L,!0)},this._rotateInternal=(T,R)=>{const F=Ve*this.azimuthRotateSpeed*T/this._elementRect.height,w=Ve*this.polarRotateSpeed*R/this._elementRect.height;this.rotate(F,w,!0)},this._dollyInternal=(T,R,F)=>{const w=Math.pow(.95,-T*this.dollySpeed),L=this._sphericalEnd.radius,N=this._sphericalEnd.radius*w,M=Kt(N,this.minDistance,this.maxDistance),z=M-N;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(N,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(z,!0),this._dollyToNoClamp(M,!0)):this._dollyToNoClamp(M,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?N:M)-L,this._dollyControlCoord.set(R,F)),this._lastDollyDirection=Math.sign(-T)},this._zoomInternal=(T,R,F)=>{const w=Math.pow(.95,T*this.dollySpeed),L=this._zoom,N=this._zoom*w;this.zoomTo(N,!0),this.dollyToCursor&&(this._changedZoom+=N-L,this._dollyControlCoord.set(R,F))},typeof ot>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new ot.Quaternion().setFromUnitVectors(this._camera.up,qs),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=V.NONE,this._target=new ot.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new ot.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new ot.Spherical().setFromVector3(ct.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new ot.Vector3,new ot.Vector3,new ot.Vector3,new ot.Vector3],this._updateNearPlaneCorners(),this._boundary=new ot.Box3(new ot.Vector3(-1/0,-1/0,-1/0),new ot.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new ot.Vector2,this.mouseButtons={left:V.ROTATE,middle:V.DOLLY,right:V.TRUCK,wheel:Oe(this._camera)?V.DOLLY:me(this._camera)?V.ZOOM:V.NONE},this.touches={one:V.TOUCH_ROTATE,two:Oe(this._camera)?V.TOUCH_DOLLY_TRUCK:me(this._camera)?V.TOUCH_ZOOM_TRUCK:V.NONE,three:V.TOUCH_TRUCK};const s=new ot.Vector2,i=new ot.Vector2,n=new ot.Vector2,r=T=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const w=this._domElement.getBoundingClientRect(),L=T.clientX/w.width,N=T.clientY/w.height;if(Lthis._interactiveArea.right||Nthis._interactiveArea.bottom)return}const R=T.pointerType!=="mouse"?null:(T.buttons&at.LEFT)===at.LEFT?at.LEFT:(T.buttons&at.MIDDLE)===at.MIDDLE?at.MIDDLE:(T.buttons&at.RIGHT)===at.RIGHT?at.RIGHT:null;if(R!==null){const w=this._findPointerByMouseButton(R);w&&this._disposePointer(w)}if((T.buttons&at.LEFT)===at.LEFT&&this._lockedPointer)return;const F={pointerId:T.pointerId,clientX:T.clientX,clientY:T.clientY,deltaX:0,deltaY:0,mouseButton:R};this._activePointers.push(F),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",h),this._isDragging=!0,p(T)},o=T=>{if(!this._enabled||!this._domElement||this._lockedPointer)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const w=this._domElement.getBoundingClientRect(),L=T.clientX/w.width,N=T.clientY/w.height;if(Lthis._interactiveArea.right||Nthis._interactiveArea.bottom)return}const R=(T.buttons&at.LEFT)===at.LEFT?at.LEFT:(T.buttons&at.MIDDLE)===at.MIDDLE?at.MIDDLE:(T.buttons&at.RIGHT)===at.RIGHT?at.RIGHT:null;if(R!==null){const w=this._findPointerByMouseButton(R);w&&this._disposePointer(w)}const F={pointerId:1,clientX:T.clientX,clientY:T.clientY,deltaX:0,deltaY:0,mouseButton:(T.buttons&at.LEFT)===at.LEFT?at.LEFT:(T.buttons&at.MIDDLE)===at.LEFT?at.MIDDLE:(T.buttons&at.RIGHT)===at.LEFT?at.RIGHT:null};this._activePointers.push(F),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("mouseup",u),this._domElement.ownerDocument.addEventListener("mousemove",l),this._domElement.ownerDocument.addEventListener("mouseup",u),this._isDragging=!0,p(T)},a=T=>{T.cancelable&&T.preventDefault();const R=T.pointerId,F=this._lockedPointer||this._findPointerById(R);if(F){if(F.clientX=T.clientX,F.clientY=T.clientY,F.deltaX=T.movementX,F.deltaY=T.movementY,this._state=0,T.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(T.buttons&at.LEFT)===at.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(T.buttons&at.MIDDLE)===at.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(T.buttons&at.RIGHT)===at.RIGHT&&(this._state=this._state|this.mouseButtons.right);m()}},l=T=>{const R=this._lockedPointer||this._findPointerById(1);R&&(R.clientX=T.clientX,R.clientY=T.clientY,R.deltaX=T.movementX,R.deltaY=T.movementY,this._state=0,(this._lockedPointer||(T.buttons&at.LEFT)===at.LEFT)&&(this._state=this._state|this.mouseButtons.left),(T.buttons&at.MIDDLE)===at.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(T.buttons&at.RIGHT)===at.RIGHT&&(this._state=this._state|this.mouseButtons.right),m())},h=T=>{const R=this._findPointerById(T.pointerId);if(!(R&&R===this._lockedPointer)){if(R&&this._disposePointer(R),T.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=V.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=V.NONE;E()}},u=()=>{const T=this._findPointerById(1);T&&T===this._lockedPointer||(T&&this._disposePointer(T),this._state=V.NONE,E())};let d=-1;const f=T=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===V.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const N=this._domElement.getBoundingClientRect(),M=T.clientX/N.width,z=T.clientY/N.height;if(Mthis._interactiveArea.right||zthis._interactiveArea.bottom)return}if(T.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===V.ROTATE||this.mouseButtons.wheel===V.TRUCK){const N=performance.now();d-N<1e3&&this._getClientRect(this._elementRect),d=N}const R=ja?-1:-3,F=T.deltaMode===1?T.deltaY/R:T.deltaY/(R*10),w=this.dollyToCursor?(T.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,L=this.dollyToCursor?(T.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case V.ROTATE:{this._rotateInternal(T.deltaX,T.deltaY),this._isUserControllingRotate=!0;break}case V.TRUCK:{this._truckInternal(T.deltaX,T.deltaY,!1),this._isUserControllingTruck=!0;break}case V.OFFSET:{this._truckInternal(T.deltaX,T.deltaY,!0),this._isUserControllingOffset=!0;break}case V.DOLLY:{this._dollyInternal(-F,w,L),this._isUserControllingDolly=!0;break}case V.ZOOM:{this._zoomInternal(-F,w,L),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},I=T=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===vt.ACTION.NONE){const R=T instanceof PointerEvent?T.pointerId:(T instanceof MouseEvent,0),F=this._findPointerById(R);F&&this._disposePointer(F),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("mouseup",u);return}T.preventDefault()}},p=T=>{if(!this._enabled)return;if(ki(this._activePointers,kt),this._getClientRect(this._elementRect),s.copy(kt),i.copy(kt),this._activePointers.length>=2){const F=kt.x-this._activePointers[1].clientX,w=kt.y-this._activePointers[1].clientY,L=Math.sqrt(F*F+w*w);n.set(0,L);const N=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,M=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;i.set(N,M)}if(this._state=0,!T)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in T&&T.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(T.buttons&at.LEFT)===at.LEFT&&(this._state=this._state|this.mouseButtons.left),(T.buttons&at.MIDDLE)===at.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(T.buttons&at.RIGHT)===at.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&V.ROTATE)===V.ROTATE||(this._state&V.TOUCH_ROTATE)===V.TOUCH_ROTATE||(this._state&V.TOUCH_DOLLY_ROTATE)===V.TOUCH_DOLLY_ROTATE||(this._state&V.TOUCH_ZOOM_ROTATE)===V.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&V.TRUCK)===V.TRUCK||(this._state&V.TOUCH_TRUCK)===V.TOUCH_TRUCK||(this._state&V.TOUCH_DOLLY_TRUCK)===V.TOUCH_DOLLY_TRUCK||(this._state&V.TOUCH_ZOOM_TRUCK)===V.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&V.DOLLY)===V.DOLLY||(this._state&V.TOUCH_DOLLY)===V.TOUCH_DOLLY||(this._state&V.TOUCH_DOLLY_TRUCK)===V.TOUCH_DOLLY_TRUCK||(this._state&V.TOUCH_DOLLY_OFFSET)===V.TOUCH_DOLLY_OFFSET||(this._state&V.TOUCH_DOLLY_ROTATE)===V.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&V.ZOOM)===V.ZOOM||(this._state&V.TOUCH_ZOOM)===V.TOUCH_ZOOM||(this._state&V.TOUCH_ZOOM_TRUCK)===V.TOUCH_ZOOM_TRUCK||(this._state&V.TOUCH_ZOOM_OFFSET)===V.TOUCH_ZOOM_OFFSET||(this._state&V.TOUCH_ZOOM_ROTATE)===V.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&V.OFFSET)===V.OFFSET||(this._state&V.TOUCH_OFFSET)===V.TOUCH_OFFSET||(this._state&V.TOUCH_DOLLY_OFFSET)===V.TOUCH_DOLLY_OFFSET||(this._state&V.TOUCH_ZOOM_OFFSET)===V.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},m=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,ki(this._activePointers,kt);const R=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,F=R?-R.deltaX:i.x-kt.x,w=R?-R.deltaY:i.y-kt.y;if(i.copy(kt),((this._state&V.ROTATE)===V.ROTATE||(this._state&V.TOUCH_ROTATE)===V.TOUCH_ROTATE||(this._state&V.TOUCH_DOLLY_ROTATE)===V.TOUCH_DOLLY_ROTATE||(this._state&V.TOUCH_ZOOM_ROTATE)===V.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(F,w),this._isUserControllingRotate=!0),(this._state&V.DOLLY)===V.DOLLY||(this._state&V.ZOOM)===V.ZOOM){const L=this.dollyToCursor?(s.x-this._elementRect.x)/this._elementRect.width*2-1:0,N=this.dollyToCursor?(s.y-this._elementRect.y)/this._elementRect.height*-2+1:0,M=this.dollyDragInverted?-1:1;(this._state&V.DOLLY)===V.DOLLY?(this._dollyInternal(M*w*Ks,L,N),this._isUserControllingDolly=!0):(this._zoomInternal(M*w*Ks,L,N),this._isUserControllingZoom=!0)}if((this._state&V.TOUCH_DOLLY)===V.TOUCH_DOLLY||(this._state&V.TOUCH_ZOOM)===V.TOUCH_ZOOM||(this._state&V.TOUCH_DOLLY_TRUCK)===V.TOUCH_DOLLY_TRUCK||(this._state&V.TOUCH_ZOOM_TRUCK)===V.TOUCH_ZOOM_TRUCK||(this._state&V.TOUCH_DOLLY_OFFSET)===V.TOUCH_DOLLY_OFFSET||(this._state&V.TOUCH_ZOOM_OFFSET)===V.TOUCH_ZOOM_OFFSET||(this._state&V.TOUCH_DOLLY_ROTATE)===V.TOUCH_DOLLY_ROTATE||(this._state&V.TOUCH_ZOOM_ROTATE)===V.TOUCH_ZOOM_ROTATE){const L=kt.x-this._activePointers[1].clientX,N=kt.y-this._activePointers[1].clientY,M=Math.sqrt(L*L+N*N),z=n.y-M;n.set(0,M);const O=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,P=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&V.TOUCH_DOLLY)===V.TOUCH_DOLLY||(this._state&V.TOUCH_DOLLY_ROTATE)===V.TOUCH_DOLLY_ROTATE||(this._state&V.TOUCH_DOLLY_TRUCK)===V.TOUCH_DOLLY_TRUCK||(this._state&V.TOUCH_DOLLY_OFFSET)===V.TOUCH_DOLLY_OFFSET?(this._dollyInternal(z*Ks,O,P),this._isUserControllingDolly=!0):(this._zoomInternal(z*Ks,O,P),this._isUserControllingZoom=!0)}((this._state&V.TRUCK)===V.TRUCK||(this._state&V.TOUCH_TRUCK)===V.TOUCH_TRUCK||(this._state&V.TOUCH_DOLLY_TRUCK)===V.TOUCH_DOLLY_TRUCK||(this._state&V.TOUCH_ZOOM_TRUCK)===V.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(F,w,!1),this._isUserControllingTruck=!0),((this._state&V.OFFSET)===V.OFFSET||(this._state&V.TOUCH_OFFSET)===V.TOUCH_OFFSET||(this._state&V.TOUCH_DOLLY_OFFSET)===V.TOUCH_DOLLY_OFFSET||(this._state&V.TOUCH_ZOOM_OFFSET)===V.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(F,w,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},E=()=>{ki(this._activePointers,kt),i.copy(kt),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.removeEventListener("mouseup",u),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",_),this._domElement.ownerDocument.addEventListener("pointerlockerror",A),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",h),p())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",_),this._domElement.ownerDocument.removeEventListener("pointerlockerror",A))};const _=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},A=()=>{this.unlockPointer()};this._addAllEventListeners=T=>{this._domElement=T,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",r),Qa&&this._domElement.addEventListener("mousedown",o),this._domElement.addEventListener("pointercancel",h),this._domElement.addEventListener("wheel",f,{passive:!1}),this._domElement.addEventListener("contextmenu",I)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",r),this._domElement.removeEventListener("mousedown",o),this._domElement.removeEventListener("pointercancel",h),this._domElement.removeEventListener("wheel",f,{passive:!1}),this._domElement.removeEventListener("contextmenu",I),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.removeEventListener("mouseup",u),this._domElement.ownerDocument.removeEventListener("pointerlockchange",_),this._domElement.ownerDocument.removeEventListener("pointerlockerror",A))},this.cancel=()=>{this._state!==V.NONE&&(this._state=V.NONE,this._activePointers.length=0,E())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=Kt(e.width,0,1),this._interactiveArea.height=Kt(e.height,0,1),this._interactiveArea.x=Kt(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=Kt(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,s=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,s)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,s=!1){this._isUserControllingRotate=!1;const i=Kt(e,this.minAzimuthAngle,this.maxAzimuthAngle),n=Kt(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=i,this._sphericalEnd.phi=n,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,s||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const r=!s||ft(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&ft(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(r)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=Ye.NONE,this._changedDolly=0,this._dollyToNoClamp(Kt(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){const s=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const r=this._collisionTest(),o=ft(r,this._spherical.radius);if(!(s>e)&&o)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,r)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const n=!t||ft(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(n)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(us).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const s=!t||ft(this._target.x,this._targetEnd.x,this.restThreshold)&&ft(this._target.y,this._targetEnd.y,this.restThreshold)&&ft(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=Kt(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const s=!t||ft(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(s)}pan(e,t,s=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,s)}truck(e,t,s=!1){this._camera.updateMatrix(),ne.setFromMatrixColumn(this._camera.matrix,0),re.setFromMatrixColumn(this._camera.matrix,1),ne.multiplyScalar(e),re.multiplyScalar(-t);const i=ct.copy(ne).add(re),n=ut.copy(this._targetEnd).add(i);return this.moveTo(n.x,n.y,n.z,s)}forward(e,t=!1){ct.setFromMatrixColumn(this._camera.matrix,0),ct.crossVectors(this._camera.up,ct),ct.multiplyScalar(e);const s=ut.copy(this._targetEnd).add(ct);return this.moveTo(s.x,s.y,s.z,t)}elevate(e,t=!1){return ct.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+ct.x,this._targetEnd.y+ct.y,this._targetEnd.z+ct.z,t)}moveTo(e,t,s,i=!1){this._isUserControllingTruck=!1;const n=ct.set(e,t,s).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,n,this.boundaryFriction),this._needsUpdate=!0,i||this._target.copy(this._targetEnd);const r=!i||ft(this._target.x,this._targetEnd.x,this.restThreshold)&&ft(this._target.y,this._targetEnd.y,this.restThreshold)&&ft(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(r)}lookInDirectionOf(e,t,s,i=!1){const o=ct.set(e,t,s).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(o.x,o.y,o.z,i)}fitToBox(e,t,{cover:s=!1,paddingLeft:i=0,paddingRight:n=0,paddingBottom:r=0,paddingTop:o=0}={}){const a=[],l=e.isBox3?He.copy(e):He.setFromObject(e);l.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const h=ur(this._sphericalEnd.theta,hr),u=ur(this._sphericalEnd.phi,hr);a.push(this.rotateTo(h,u,t));const d=ct.setFromSpherical(this._sphericalEnd).normalize(),f=mr.setFromUnitVectors(d,Yi),I=ft(Math.abs(d.y),1);I&&f.multiply(Gi.setFromAxisAngle(qs,h)),f.multiply(this._yAxisUpSpaceInverse);const p=Ir.makeEmpty();ut.copy(l.min).applyQuaternion(f),p.expandByPoint(ut),ut.copy(l.min).setX(l.max.x).applyQuaternion(f),p.expandByPoint(ut),ut.copy(l.min).setY(l.max.y).applyQuaternion(f),p.expandByPoint(ut),ut.copy(l.max).setZ(l.min.z).applyQuaternion(f),p.expandByPoint(ut),ut.copy(l.min).setZ(l.max.z).applyQuaternion(f),p.expandByPoint(ut),ut.copy(l.max).setY(l.min.y).applyQuaternion(f),p.expandByPoint(ut),ut.copy(l.max).setX(l.min.x).applyQuaternion(f),p.expandByPoint(ut),ut.copy(l.max).applyQuaternion(f),p.expandByPoint(ut),p.min.x-=i,p.min.y-=r,p.max.x+=n,p.max.y+=o,f.setFromUnitVectors(Yi,d),I&&f.premultiply(Gi.invert()),f.premultiply(this._yAxisUpSpace);const m=p.getSize(ct),E=p.getCenter(ut).applyQuaternion(f);if(Oe(this._camera)){const _=this.getDistanceToFitBox(m.x,m.y,m.z,s);a.push(this.moveTo(E.x,E.y,E.z,t)),a.push(this.dollyTo(_,t)),a.push(this.setFocalOffset(0,0,0,t))}else if(me(this._camera)){const _=this._camera,A=_.right-_.left,T=_.top-_.bottom,R=s?Math.max(A/m.x,T/m.y):Math.min(A/m.x,T/m.y);a.push(this.moveTo(E.x,E.y,E.z,t)),a.push(this.zoomTo(R,t)),a.push(this.setFocalOffset(0,0,0,t))}return Promise.all(a)}fitToSphere(e,t){const s=[],n=e instanceof ot.Sphere?Vi.copy(e):vt.createBoundingSphere(e,Vi);if(s.push(this.moveTo(n.center.x,n.center.y,n.center.z,t)),Oe(this._camera)){const r=this.getDistanceToFitSphere(n.radius);s.push(this.dollyTo(r,t))}else if(me(this._camera)){const r=this._camera.right-this._camera.left,o=this._camera.top-this._camera.bottom,a=2*n.radius,l=Math.min(r/a,o/a);s.push(this.zoomTo(l,t))}return s.push(this.setFocalOffset(0,0,0,t)),Promise.all(s)}setLookAt(e,t,s,i,n,r,o=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Ye.NONE,this._changedDolly=0;const a=ut.set(i,n,r),l=ct.set(e,t,s);this._targetEnd.copy(a),this._sphericalEnd.setFromVector3(l.sub(a).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,o||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const h=!o||ft(this._target.x,this._targetEnd.x,this.restThreshold)&&ft(this._target.y,this._targetEnd.y,this.restThreshold)&&ft(this._target.z,this._targetEnd.z,this.restThreshold)&&ft(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&ft(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&ft(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(h)}lerpLookAt(e,t,s,i,n,r,o,a,l,h,u,d,f,I=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Ye.NONE,this._changedDolly=0;const p=ct.set(i,n,r),m=ut.set(e,t,s);Gt.setFromVector3(m.sub(p).applyQuaternion(this._yAxisUpSpace));const E=Ge.set(h,u,d),_=ut.set(o,a,l);ds.setFromVector3(_.sub(E).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(p.lerp(E,f));const A=ds.theta-Gt.theta,T=ds.phi-Gt.phi,R=ds.radius-Gt.radius;this._sphericalEnd.set(Gt.radius+R*f,Gt.phi+T*f,Gt.theta+A*f),this.normalizeRotations(),this._needsUpdate=!0,I||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const F=!I||ft(this._target.x,this._targetEnd.x,this.restThreshold)&&ft(this._target.y,this._targetEnd.y,this.restThreshold)&&ft(this._target.z,this._targetEnd.z,this.restThreshold)&&ft(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&ft(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&ft(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(F)}setPosition(e,t,s,i=!1){return this.setLookAt(e,t,s,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,i)}setTarget(e,t,s,i=!1){const n=this.getPosition(ct),r=this.setLookAt(n.x,n.y,n.z,e,t,s,i);return this._sphericalEnd.phi=Kt(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),r}setFocalOffset(e,t,s,i=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,s),this._needsUpdate=!0,i||this._focalOffset.copy(this._focalOffsetEnd);const n=!i||ft(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&ft(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&ft(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}setOrbitPoint(e,t,s){this._camera.updateMatrixWorld(),ne.setFromMatrixColumn(this._camera.matrixWorldInverse,0),re.setFromMatrixColumn(this._camera.matrixWorldInverse,1),Fe.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const i=ct.set(e,t,s),n=i.distanceTo(this._camera.position),r=i.sub(this._camera.position);ne.multiplyScalar(r.x),re.multiplyScalar(r.y),Fe.multiplyScalar(r.z),ct.copy(ne).add(re).add(Fe),ct.z=ct.z+n,this.dollyTo(n,!1),this.setFocalOffset(-ct.x,ct.y,-ct.z,!1),this.moveTo(e,t,s,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,s,i){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new ot.Vector4,typeof e=="number"?this._viewport.set(e,t,s,i):this._viewport.copy(e)}getDistanceToFitBox(e,t,s,i=!1){if(zi(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const n=e/t,r=this._camera.getEffectiveFOV()*cs,o=this._camera.aspect;return((i?n>o:nt.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,s){const i=t.lengthSq();if(i===0)return e;const n=ut.copy(t).add(e),o=this._boundary.clampPoint(n,Ge).sub(n),a=o.lengthSq();if(a===0)return e.add(t);if(a===i)return e;if(s===0)return e.add(t).add(o);{const l=1+s*a/t.dot(o);return e.add(ut.copy(t).multiplyScalar(l)).add(o.multiplyScalar(1-s))}}_updateNearPlaneCorners(){if(Oe(this._camera)){const e=this._camera,t=e.near,s=e.getEffectiveFOV()*cs,i=Math.tan(s*.5)*t,n=i*e.aspect;this._nearPlaneCorners[0].set(-n,-i,0),this._nearPlaneCorners[1].set(n,-i,0),this._nearPlaneCorners[2].set(n,i,0),this._nearPlaneCorners[3].set(-n,i,0)}else if(me(this._camera)){const e=this._camera,t=1/e.zoom,s=e.left*t,i=e.right*t,n=e.top*t,r=e.bottom*t;this._nearPlaneCorners[0].set(s,n,0),this._nearPlaneCorners[1].set(i,n,0),this._nearPlaneCorners[2].set(i,r,0),this._nearPlaneCorners[3].set(s,r,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||zi(this._camera,"_collisionTest"))return e;const s=this._getTargetDirection(us);Hi.lookAt(fr,s,this._camera.up);for(let i=0;i<4;i++){const n=ut.copy(this._nearPlaneCorners[i]);n.applyMatrix4(Hi);const r=Ge.addVectors(this._target,n);Js.set(r,s),Js.far=this._spherical.radius+1;const o=Js.intersectObjects(this.colliderMeshes);o.length!==0&&o[0].distance{const s=()=>{this.removeEventListener("rest",s),t()};this.addEventListener("rest",s)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new ot.Sphere){const s=t,i=s.center;He.makeEmpty(),e.traverseVisible(r=>{r.isMesh&&He.expandByObject(r)}),He.getCenter(i);let n=0;return e.traverseVisible(r=>{if(!r.isMesh)return;const o=r,a=o.geometry.clone();a.applyMatrix4(o.matrixWorld);const h=a.attributes.position;for(let u=0,d=h.count;u{var t;if(!(!this.currentWorld||!this.currentWorld.renderer)){if(this.three instanceof En){this.onAspectUpdated.trigger();return}if((t=this.currentWorld.renderer)!=null&&t.isResizeable()){const s=this.currentWorld.renderer.getSize();this.three.aspect=s.width/s.height,this.three.updateProjectionMatrix(),this.onAspectUpdated.trigger()}}});this.three=this.setupCamera(),this.setupEvents(!0),this.onWorldChanged.add(({action:s,world:i})=>{if(s==="added"){const n=this.newCameraControls();this._allControls.set(i.uuid,n)}if(s==="removed"){const n=this._allControls.get(i.uuid);n&&(n.dispose(),this._allControls.delete(i.uuid))}})}get controls(){if(!this.currentWorld)throw new Error("This camera needs a world to work!");const t=this._allControls.get(this.currentWorld.uuid);if(!t)throw new Error("Controls not found!");return t}get enabled(){return this.currentWorld===null?!1:this.controls.enabled}set enabled(t){this.currentWorld!==null&&(this.controls.enabled=t)}dispose(){this.setupEvents(!1),this.onAspectUpdated.reset(),this.onBeforeUpdate.reset(),this.onAfterUpdate.reset(),this.three.removeFromParent(),this.onDisposed.trigger(),this.onDisposed.reset();for(const[t,s]of this._allControls)s.dispose()}update(t){this.enabled&&(this.onBeforeUpdate.trigger(this),this.controls.update(t),this.onAfterUpdate.trigger(this))}setupCamera(){const t=window.innerWidth/window.innerHeight,s=new Lr(60,t,1,1e3);return s.position.set(50,50,50),s.lookAt(new W(0,0,0)),s}newCameraControls(){if(!this.currentWorld)throw new Error("This camera needs a world to work!");if(!this.currentWorld.renderer)throw new Error("This camera needs a renderer to work!");vt.install({THREE:vn.getSubsetOfThree()});const{domElement:t}=this.currentWorld.renderer.three,s=new vt(this.three,t);return s.smoothTime=.2,s.dollyToCursor=!0,s.infinityDolly=!0,s.minDistance=6,s}setupEvents(t){t?window.addEventListener("resize",this.updateAspect):window.removeEventListener("resize",this.updateAspect)}static getSubsetOfThree(){return{MOUSE:co,Vector2:_e,Vector3:W,Vector4:lo,Quaternion:Jt,Matrix4:Ft,Spherical:ho,Box3:Nt,Sphere:gi,Raycaster:In,MathUtils:uo}}}const di=class di extends Bt{constructor(t){super(t);y(this,"onAfterUpdate",new et);y(this,"onBeforeUpdate",new et);y(this,"onDisposed",new et);y(this,"onWorldCreated",new et);y(this,"onWorldDeleted",new et);y(this,"list",new Map);y(this,"enabled",!0);t.add(di.uuid,this)}create(){const t=new Xa(this.components),s=t.uuid;if(this.list.has(s))throw new Error("There is already a world with this name!");return this.list.set(s,t),this.onWorldCreated.trigger(t),t}delete(t){if(!this.list.has(t.uuid))throw new Error("The provided world is not found in the list!");const s=t.uuid;this.list.delete(t.uuid),t.dispose(),this.onWorldDeleted.trigger(s)}dispose(){this.enabled=!1;for(const[t,s]of this.list)s.dispose();this.list.clear(),this.onDisposed.trigger()}update(t){if(this.enabled)for(const[s,i]of this.list)i.update(t)}};y(di,"uuid","fdb61dc4-2ec1-4966-b83d-54ea795fad4a");let sn=di;function Ka(c,e,t,s){return new Promise((i,n)=>{function r(){const o=c.clientWaitSync(e,t,0);if(o===c.WAIT_FAILED){n();return}if(o===c.TIMEOUT_EXPIRED){setTimeout(r,s);return}i()}r()})}async function qa(c,e,t,s,i,n,r){const o=c.fenceSync(c.SYNC_GPU_COMMANDS_COMPLETE,0);c.flush(),await Ka(c,o,0,10),c.deleteSync(o),c.bindBuffer(e,t),c.getBufferSubData(e,s,i,n,r),c.bindBuffer(e,null)}async function Ja(c,e,t,s,i,n,r,o){const a=c.createBuffer();return c.bindBuffer(c.PIXEL_PACK_BUFFER,a),c.bufferData(c.PIXEL_PACK_BUFFER,o.byteLength,c.STREAM_READ),c.readPixels(e,t,s,i,n,r,0),c.bindBuffer(c.PIXEL_PACK_BUFFER,null),await qa(c,c.PIXEL_PACK_BUFFER,a,0,o),c.deleteBuffer(a),o}class tc{constructor(e,t,s){y(this,"onDisposed",new et);y(this,"onViewUpdated",new Ga);y(this,"enabled",!0);y(this,"needsUpdate",!1);y(this,"renderDebugFrame",!1);y(this,"components");y(this,"world");y(this,"renderer");y(this,"autoUpdate",!0);y(this,"updateInterval",1e3);y(this,"worker");y(this,"scene",new fo);y(this,"_width",512);y(this,"_height",512);y(this,"_availableColor",1);y(this,"renderTarget");y(this,"bufferSize");y(this,"_buffer");y(this,"_isWorkerBusy",!1);y(this,"updateVisibility",async e=>{if(!this.enabled||!this.needsUpdate&&!e||this._isWorkerBusy)return;this._isWorkerBusy=!0;const t=this.world.camera.three;t.updateMatrix(),this.renderer.setSize(this._width,this._height),this.renderer.setRenderTarget(this.renderTarget),this.renderer.render(this.scene,t);const s=this.renderer.getContext();await Ja(s,0,0,this._width,this._height,s.RGBA,s.UNSIGNED_BYTE,this._buffer),this.renderer.setRenderTarget(null),this.renderDebugFrame&&this.renderer.render(this.scene,t),this.worker.postMessage({buffer:this._buffer}),this.needsUpdate=!1});if(!t.renderer)throw new Error("The given world must have a renderer!");this.components=e,this.applySettings(s),this.world=t,this.renderer=new po,this.renderTarget=new Eo(this._width,this._height),this.bufferSize=this._width*this._height*4,this._buffer=new Uint8Array(this.bufferSize),this.renderer.clippingPlanes=t.renderer.clippingPlanes;const i=` - addEventListener("message", (event) => { - const { buffer } = event.data; - const colors = new Map(); - for (let i = 0; i < buffer.length; i += 4) { - const r = buffer[i]; - const g = buffer[i + 1]; - const b = buffer[i + 2]; - const code = "" + r + "-" + g + "-" + b; - if(colors.has(code)) { - colors.set(code, colors.get(code) + 1); - } else { - colors.set(code, 1); - } - } - postMessage({ colors }); - }); - `,n=new Blob([i],{type:"application/javascript"});this.worker=new Worker(URL.createObjectURL(n))}dispose(){this.enabled=!1;for(const e of this.scene.children)e.removeFromParent();this.onViewUpdated.reset(),this.worker.terminate(),this.renderer.forceContextLoss(),this.renderer.dispose(),this.renderTarget.dispose(),this._buffer=null,this.onDisposed.reset()}getAvailableColor(){let e=BigInt(this._availableColor.toString());const t=[];do t.unshift(Number(e%256n)),e/=256n;while(e);for(;t.length!==3;)t.unshift(0);const[s,i,n]=t,r=`${s}-${i}-${n}`;return{r:s,g:i,b:n,code:r}}increaseColor(){if(this._availableColor===256*256*256){console.warn("Color can't be increased over 256 x 256 x 256!");return}this._availableColor++}decreaseColor(){if(this._availableColor===1){console.warn("Color can't be decreased under 0!");return}this._availableColor--}applySettings(e){e&&(e.updateInterval!==void 0&&(this.updateInterval=e.updateInterval),e.height!==void 0&&(this._height=e.height),e.width!==void 0&&(this._width=e.width),e.autoUpdate!==void 0&&(this.autoUpdate=e.autoUpdate))}}class ec extends tc{constructor(t,s,i){super(t,s,i);y(this,"onViewUpdated",new et);y(this,"threshold",100);y(this,"colorMeshes",new Map);y(this,"isProcessing",!1);y(this,"_interval",null);y(this,"_colorCodeMeshMap",new Map);y(this,"_meshIDColorCodeMap",new Map);y(this,"_currentVisibleMeshes",new Set);y(this,"_recentlyHiddenMeshes",new Set);y(this,"_intervalID",null);y(this,"_transparentMat",new $e({transparent:!0,opacity:0}));y(this,"handleWorkerMessage",async t=>{if(this.isProcessing)return;const s=t.data.colors;this._recentlyHiddenMeshes=new Set(this._currentVisibleMeshes),this._currentVisibleMeshes.clear();for(const[i,n]of s){if(n{this.isProcessing||await this.updateVisibility()},this.updateInterval)),this.onViewUpdated.add(({seen:n,unseen:r})=>{for(const o of n)o.visible=!0;for(const o of r)o.visible=!1})}dispose(){super.dispose(),this._intervalID!==null&&(window.clearInterval(this._intervalID),this._intervalID=null),this._interval!==null&&(window.clearInterval(this._interval),this._intervalID=null),this._currentVisibleMeshes.clear(),this._recentlyHiddenMeshes.clear(),this._meshIDColorCodeMap.clear(),this._transparentMat.dispose(),this._colorCodeMeshMap.clear();const t=this.components.get(je);for(const s in this.colorMeshes){const i=this.colorMeshes.get(s);i&&t.destroy(i,!0)}this.colorMeshes.clear()}add(t){if(!this.enabled)return;if(this.isProcessing){console.log("Culler processing not finished yet.");return}this.isProcessing=!0;const s=t instanceof oi,{geometry:i,material:n}=t,{colorMaterial:r,code:o}=this.getAvailableMaterial();let a;if(Array.isArray(n)){let u=!0;const d=[];for(const f of n)lr.isTransparent(f)?d.push(this._transparentMat):(u=!1,d.push(r));if(u){r.dispose(),this.isProcessing=!1;return}a=d}else if(lr.isTransparent(n)){r.dispose(),this.isProcessing=!1;return}else a=r;this._colorCodeMeshMap.set(o,t),this._meshIDColorCodeMap.set(t.uuid,o);const l=s?t.count:1,h=new oi(i,a,l);s?h.instanceMatrix=t.instanceMatrix:h.setMatrixAt(0,new Ft),t.visible=!1,t.updateWorldMatrix(!0,!1),h.applyMatrix4(t.matrixWorld),h.updateMatrix(),this.scene.add(h),this.colorMeshes.set(t.uuid,h),this.increaseColor(),this.isProcessing=!1}remove(t){if(this.isProcessing){console.log("Culler processing not finished yet.");return}this.isProcessing=!0;const s=this.components.get(je);this._currentVisibleMeshes.delete(t),this._recentlyHiddenMeshes.delete(t);const i=this.colorMeshes.get(t.uuid),n=this._meshIDColorCodeMap.get(t.uuid);if(!i||!n){this.isProcessing=!1;return}this._colorCodeMeshMap.delete(n),this._meshIDColorCodeMap.delete(t.uuid),this.colorMeshes.delete(t.uuid),i.geometry=void 0,i.material=[],s.destroy(i,!0),this._recentlyHiddenMeshes.delete(t),this._currentVisibleMeshes.delete(t),this.isProcessing=!1}updateInstanced(t){for(const s of t){const i=this.colorMeshes.get(s.uuid);i&&(i.count=s.count)}}getAvailableMaterial(){const{r:t,g:s,b:i,code:n}=this.getAvailableColor(),r=Si.enabled;Si.enabled=!1;const o=new mn(`rgb(${t}, ${s}, ${i})`);if(!this.world.renderer)throw new Error("Renderer not found in the world!");const a=this.world.renderer.clippingPlanes,l=new $e({color:o,clippingPlanes:a,side:Ti});return Si.enabled=r,{colorMaterial:l,code:n}}}const As=class As extends Bt{constructor(t){super(t);y(this,"onDisposed",new et);y(this,"_enabled",!0);y(this,"list",new Map);t.add(As.uuid,this)}get enabled(){return this._enabled}set enabled(t){this._enabled=t;for(const[s,i]of this.list)i.enabled=t}create(t,s){if(this.list.has(t.uuid))return this.list.get(t.uuid);const i=new ec(this.components,t,s);return this.list.set(t.uuid,i),i}delete(t){const s=this.list.get(t.uuid);s&&s.dispose(),this.list.delete(t.uuid)}dispose(){this.enabled=!1,this.onDisposed.trigger(As.uuid),this.onDisposed.reset();for(const[t,s]of this.list)s.dispose();this.list.clear()}updateInstanced(t){for(const[,s]of this.list)s.updateInstanced(t)}};y(As,"uuid","69f2a50d-c266-44fc-b1bd-fa4d34be89e6");let nn=As;class sc{constructor(e){y(this,"_event");y(this,"_position",new _e);y(this,"onDisposed",new et);y(this,"updateMouseInfo",e=>{this._event=e});this.dom=e,this.setupEvents(!0)}get position(){if(this._event){const e=this.dom.getBoundingClientRect();this._position.x=this.getPositionX(e,this._event),this._position.y=this.getPositionY(e,this._event)}return this._position}dispose(){this.setupEvents(!1),this.onDisposed.trigger(),this.onDisposed.reset()}getPositionY(e,t){return-((t.clientY-e.top)/(e.bottom-e.top))*2+1}getPositionX(e,t){return(t.clientX-e.left)/(e.right-e.left)*2-1}setupEvents(e){e?this.dom.addEventListener("pointermove",this.updateMouseInfo):this.dom.removeEventListener("pointermove",this.updateMouseInfo)}}class ic{constructor(e,t){y(this,"enabled",!0);y(this,"components");y(this,"onDisposed",new et);y(this,"mouse");y(this,"three",new In);y(this,"world");const s=t.renderer;if(!s)throw new Error("A renderer is needed for the raycaster to work!");this.world=t,this.mouse=new sc(s.three.domElement),this.components=e}dispose(){this.mouse.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}castRay(e=Array.from(this.world.meshes)){if(!this.world)throw new Error("A world is needed to cast rays!");const t=this.world.camera.three;return this.three.setFromCamera(this.mouse.position,t),this.intersect(e)}castRayFromVector(e,t,s=Array.from(this.world.meshes)){return this.three.set(e,t),this.intersect(s)}intersect(e=Array.from(this.world.meshes)){const t=this.three.intersectObjects(e),s=this.filterClippingPlanes(t);return s.length>0?s[0]:null}filterClippingPlanes(e){if(!this.world.renderer)throw new Error("Renderer not found!");const t=this.world.renderer.three;if(!t.clippingPlanes)return e;const s=t.clippingPlanes;return e.length<=0||!s||(s==null?void 0:s.length)<=0?e:e.filter(i=>s.every(n=>n.distanceToPoint(i.point)>0))}}const fi=class fi extends Bt{constructor(t){super(t);y(this,"enabled",!0);y(this,"list",new Map);y(this,"onDisposed",new et);t.add(fi.uuid,this)}get(t){if(this.list.has(t.uuid))return this.list.get(t.uuid);const s=new ic(this.components,t);return this.list.set(t.uuid,s),t.onDisposed.add(()=>{this.delete(t)}),s}delete(t){const s=this.list.get(t.uuid);s&&s.dispose(),this.list.delete(t.uuid)}dispose(){for(const[t,s]of this.list)s.dispose();this.list.clear(),this.onDisposed.trigger()}};y(fi,"uuid","d5d8bdf0-db25-4952-b951-b643af207ace");let ws=fi;const Se=new In,Mt=new W,Ie=new W,Ct=new Jt,Cr={X:new W(1,0,0),Y:new W(0,1,0),Z:new W(0,0,1)},Wi={type:"change"},gr={type:"mouseDown"},Tr={type:"mouseUp",mode:null},_r={type:"objectChange"};class nc extends ai{constructor(e,t){super(),t===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),t=document),this.isTransformControls=!0,this.visible=!1,this.domElement=t,this.domElement.style.touchAction="none";const s=new hc;this._gizmo=s,this.add(s);const i=new uc;this._plane=i,this.add(i);const n=this;function r(_,A){let T=A;Object.defineProperty(n,_,{get:function(){return T!==void 0?T:A},set:function(R){T!==R&&(T=R,i[_]=R,s[_]=R,n.dispatchEvent({type:_+"-changed",value:R}),n.dispatchEvent(Wi))}}),n[_]=A,i[_]=A,s[_]=A}r("camera",e),r("object",void 0),r("enabled",!0),r("axis",null),r("mode","translate"),r("translationSnap",null),r("rotationSnap",null),r("scaleSnap",null),r("space","world"),r("size",1),r("dragging",!1),r("showX",!0),r("showY",!0),r("showZ",!0);const o=new W,a=new W,l=new Jt,h=new Jt,u=new W,d=new Jt,f=new W,I=new W,p=new W,m=0,E=new W;r("worldPosition",o),r("worldPositionStart",a),r("worldQuaternion",l),r("worldQuaternionStart",h),r("cameraPosition",u),r("cameraQuaternion",d),r("pointStart",f),r("pointEnd",I),r("rotationAxis",p),r("rotationAngle",m),r("eye",E),this._offset=new W,this._startNorm=new W,this._endNorm=new W,this._cameraScale=new W,this._parentPosition=new W,this._parentQuaternion=new Jt,this._parentQuaternionInv=new Jt,this._parentScale=new W,this._worldScaleStart=new W,this._worldQuaternionInv=new Jt,this._worldScale=new W,this._positionStart=new W,this._quaternionStart=new Jt,this._scaleStart=new W,this._getPointer=rc.bind(this),this._onPointerDown=ac.bind(this),this._onPointerHover=oc.bind(this),this._onPointerMove=cc.bind(this),this._onPointerUp=lc.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;Se.setFromCamera(e,this.camera);const t=Xi(this._gizmo.picker[this.mode],Se);t?this.axis=t.object.name:this.axis=null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e.button!==0)&&this.axis!==null){Se.setFromCamera(e,this.camera);const t=Xi(this._plane,Se,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,gr.mode=this.mode,this.dispatchEvent(gr)}}pointerMove(e){const t=this.axis,s=this.mode,i=this.object;let n=this.space;if(s==="scale"?n="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(n="world"),i===void 0||t===null||this.dragging===!1||e.button!==-1)return;Se.setFromCamera(e,this.camera);const r=Xi(this._plane,Se,!0);if(r){if(this.pointEnd.copy(r.point).sub(this.worldPositionStart),s==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),n==="local"&&t!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf("X")===-1&&(this._offset.x=0),t.indexOf("Y")===-1&&(this._offset.y=0),t.indexOf("Z")===-1&&(this._offset.z=0),n==="local"&&t!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),i.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(n==="local"&&(i.position.applyQuaternion(Ct.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.position.applyQuaternion(this._quaternionStart)),n==="world"&&(i.parent&&i.position.add(Mt.setFromMatrixPosition(i.parent.matrixWorld)),t.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.parent&&i.position.sub(Mt.setFromMatrixPosition(i.parent.matrixWorld))));else if(s==="scale"){if(t.search("XYZ")!==-1){let o=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(o*=-1),Ie.set(o,o,o)}else Mt.copy(this.pointStart),Ie.copy(this.pointEnd),Mt.applyQuaternion(this._worldQuaternionInv),Ie.applyQuaternion(this._worldQuaternionInv),Ie.divide(Mt),t.search("X")===-1&&(Ie.x=1),t.search("Y")===-1&&(Ie.y=1),t.search("Z")===-1&&(Ie.z=1);i.scale.copy(this._scaleStart).multiply(Ie),this.scaleSnap&&(t.search("X")!==-1&&(i.scale.x=Math.round(i.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(i.scale.y=Math.round(i.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(i.scale.z=Math.round(i.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(s==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const o=20/this.worldPosition.distanceTo(Mt.setFromMatrixPosition(this.camera.matrixWorld));let a=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(Mt.copy(this.rotationAxis).cross(this.eye))*o):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(Cr[t]),Mt.copy(Cr[t]),n==="local"&&Mt.applyQuaternion(this.worldQuaternion),Mt.cross(this.eye),Mt.length()===0?a=!0:this.rotationAngle=this._offset.dot(Mt.normalize())*o),(t==="E"||a)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),n==="local"&&t!=="E"&&t!=="XYZE"?(i.quaternion.copy(this._quaternionStart),i.quaternion.multiply(Ct.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),i.quaternion.copy(Ct.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),i.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Wi),this.dispatchEvent(_r)}}pointerUp(e){e.button===0&&(this.dragging&&this.axis!==null&&(Tr.mode=this.mode,this.dispatchEvent(Tr)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}attach(e){return this.object=e,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(Wi),this.dispatchEvent(_r),this.pointStart.copy(this.pointEnd))}getRaycaster(){return Se}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}}function rc(c){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:c.button};{const e=this.domElement.getBoundingClientRect();return{x:(c.clientX-e.left)/e.width*2-1,y:-(c.clientY-e.top)/e.height*2+1,button:c.button}}}function oc(c){if(this.enabled)switch(c.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(c));break}}function ac(c){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(c.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(c)),this.pointerDown(this._getPointer(c)))}function cc(c){this.enabled&&this.pointerMove(this._getPointer(c))}function lc(c){this.enabled&&(this.domElement.releasePointerCapture(c.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(c)))}function Xi(c,e,t){const s=e.intersectObject(c,!0);for(let i=0;i.9&&(r.visible=!1)),this.axis==="Y"&&(Ct.setFromEuler(ti.set(0,0,Math.PI/2)),r.quaternion.copy(s).multiply(Ct),Math.abs(pt.copy(we).applyQuaternion(s).dot(this.eye))>.9&&(r.visible=!1)),this.axis==="Z"&&(Ct.setFromEuler(ti.set(0,Math.PI/2,0)),r.quaternion.copy(s).multiply(Ct),Math.abs(pt.copy(gs).applyQuaternion(s).dot(this.eye))>.9&&(r.visible=!1)),this.axis==="XYZE"&&(Ct.setFromEuler(ti.set(0,Math.PI/2,0)),pt.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(Rr.lookAt(Ar,pt,we)),r.quaternion.multiply(Ct),r.visible=this.dragging),this.axis==="E"&&(r.visible=!1)):r.name==="START"?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):r.name==="END"?(r.position.copy(this.worldPosition),r.visible=this.dragging):r.name==="DELTA"?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),Mt.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Mt.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(Mt),r.visible=this.dragging):(r.quaternion.copy(s),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=this.axis.search(r.name)!==-1));continue}r.quaternion.copy(s),this.mode==="translate"||this.mode==="scale"?(r.name==="X"&&Math.abs(pt.copy(Cs).applyQuaternion(s).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="Y"&&Math.abs(pt.copy(we).applyQuaternion(s).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="Z"&&Math.abs(pt.copy(gs).applyQuaternion(s).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="XY"&&Math.abs(pt.copy(gs).applyQuaternion(s).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="YZ"&&Math.abs(pt.copy(Cs).applyQuaternion(s).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="XZ"&&Math.abs(pt.copy(we).applyQuaternion(s).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1)):this.mode==="rotate"&&(ei.copy(s),pt.copy(this.eye).applyQuaternion(Ct.copy(s).invert()),r.name.search("E")!==-1&&r.quaternion.setFromRotationMatrix(Rr.lookAt(this.eye,Ar,we)),r.name==="X"&&(Ct.setFromAxisAngle(Cs,Math.atan2(-pt.y,pt.z)),Ct.multiplyQuaternions(ei,Ct),r.quaternion.copy(Ct)),r.name==="Y"&&(Ct.setFromAxisAngle(we,Math.atan2(pt.x,pt.z)),Ct.multiplyQuaternions(ei,Ct),r.quaternion.copy(Ct)),r.name==="Z"&&(Ct.setFromAxisAngle(gs,Math.atan2(pt.y,pt.x)),Ct.multiplyQuaternions(ei,Ct),r.quaternion.copy(Ct))),r.visible=r.visible&&(r.name.indexOf("X")===-1||this.showX),r.visible=r.visible&&(r.name.indexOf("Y")===-1||this.showY),r.visible=r.visible&&(r.name.indexOf("Z")===-1||this.showZ),r.visible=r.visible&&(r.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),r.material._color=r.material._color||r.material.color.clone(),r.material._opacity=r.material._opacity||r.material.opacity,r.material.color.copy(r.material._color),r.material.opacity=r.material._opacity,this.enabled&&this.axis&&(r.name===this.axis||this.axis.split("").some(function(a){return r.name===a}))&&(r.material.color.setHex(16776960),r.material.opacity=1)}super.updateMatrixWorld(e)}}class uc extends st{constructor(){super(new vr(1e5,1e5,2,2),new $e({visible:!1,wireframe:!0,side:Ti,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(t="local"),si.copy(Cs).applyQuaternion(t==="local"?this.worldQuaternion:ri),fs.copy(we).applyQuaternion(t==="local"?this.worldQuaternion:ri),ps.copy(gs).applyQuaternion(t==="local"?this.worldQuaternion:ri),pt.copy(fs),this.mode){case"translate":case"scale":switch(this.axis){case"X":pt.copy(this.eye).cross(si),oe.copy(si).cross(pt);break;case"Y":pt.copy(this.eye).cross(fs),oe.copy(fs).cross(pt);break;case"Z":pt.copy(this.eye).cross(ps),oe.copy(ps).cross(pt);break;case"XY":oe.copy(ps);break;case"YZ":oe.copy(si);break;case"XZ":pt.copy(ps),oe.copy(fs);break;case"XYZ":case"E":oe.set(0,0,0);break}break;case"rotate":default:oe.set(0,0,0)}oe.length()===0?this.quaternion.copy(this.cameraQuaternion):(yr.lookAt(Mt.set(0,0,0),oe,pt),this.quaternion.setFromRotationMatrix(yr)),super.updateMatrixWorld(e)}}class xn{constructor(e,t,s,i,n,r=5,o=!0){y(this,"onDraggingStarted",new et);y(this,"onDraggingEnded",new et);y(this,"onDisposed",new et);y(this,"normal");y(this,"origin");y(this,"three",new pn);y(this,"components");y(this,"world");y(this,"type","default");y(this,"_helper");y(this,"_visible",!0);y(this,"_enabled",!0);y(this,"_controlsActive",!1);y(this,"_arrowBoundBox",new st);y(this,"_planeMesh");y(this,"_controls");y(this,"_hiddenMaterial",new $e({visible:!1}));y(this,"update",()=>{this._enabled&&this.three.setFromNormalAndCoplanarPoint(this.normal,this._helper.position)});y(this,"changeDrag",e=>{this._visible=!e.value,this.preventCameraMovement(),this.notifyDraggingChanged(e)});if(this.components=e,this.world=t,!t.renderer)throw new Error("The given world must have a renderer!");this.normal=i,this.origin=s,t.renderer.setPlane(!0,this.three),this._planeMesh=xn.newPlaneMesh(r,n),this._helper=this.newHelper(),this._controls=this.newTransformControls(),this.three.setFromNormalAndCoplanarPoint(i,s),o&&this.toggleControls(!0)}get enabled(){return this._enabled}set enabled(e){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");this._enabled=e,this.world.renderer.setPlane(e,this.three)}get visible(){return this._visible}set visible(e){this._visible=e,this._controls.visible=e,this._helper.visible=e,this.toggleControls(e)}get meshes(){return[this._planeMesh,this._arrowBoundBox]}get planeMaterial(){return this._planeMesh.material}set planeMaterial(e){this._planeMesh.material=e}get size(){return this._planeMesh.scale.x}set size(e){this._planeMesh.scale.set(e,e,e)}get helper(){return this._helper}setFromNormalAndCoplanarPoint(e,t){this.reset(),this.normal.equals(e)||(this.normal.copy(e),this._helper.lookAt(e)),this.origin.copy(t),this._helper.position.copy(t),this._helper.updateMatrix(),this.update()}dispose(){this._enabled=!1,this.onDraggingStarted.reset(),this.onDraggingEnded.reset(),this._helper.removeFromParent(),this.world.renderer&&this.world.renderer.setPlane(!1,this.three),this._arrowBoundBox.removeFromParent(),this._arrowBoundBox.geometry.dispose(),this._planeMesh.geometry.dispose(),this._controls.removeFromParent(),this._controls.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}reset(){const e=new W(1,0,0),t=new W;this.normal.equals(e)||(this.normal.copy(e),this._helper.lookAt(e)),this.origin.copy(t),this._helper.position.copy(t),this._helper.updateMatrix()}toggleControls(e){if(e){if(this._controlsActive)return;this._controls.addEventListener("change",this.update),this._controls.addEventListener("dragging-changed",this.changeDrag)}else this._controls.removeEventListener("change",this.update),this._controls.removeEventListener("dragging-changed",this.changeDrag);this._controlsActive=e}newTransformControls(){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");const e=this.world.camera.three,t=this.world.renderer.three.domElement,s=new nc(e,t);return this.initializeControls(s),this.world.scene.three.add(s),s}initializeControls(e){e.attach(this._helper),e.showX=!1,e.showY=!1,e.setSpace("local"),this.createArrowBoundingBox(),e.children[0].children[0].add(this._arrowBoundBox)}createArrowBoundingBox(){this._arrowBoundBox.geometry=new xt(.18,.18,1.2),this._arrowBoundBox.material=this._hiddenMaterial,this._arrowBoundBox.rotateX(Math.PI/2),this._arrowBoundBox.updateMatrix(),this._arrowBoundBox.geometry.applyMatrix4(this._arrowBoundBox.matrix)}notifyDraggingChanged(e){e.value?this.onDraggingStarted.trigger():this.onDraggingEnded.trigger()}preventCameraMovement(){this.world.camera.enabled=this._visible}newHelper(){const e=new ai;return e.lookAt(this.normal),e.position.copy(this.origin),this._planeMesh.position.z+=.01,e.add(this._planeMesh),this.world.scene.three.add(e),e}static newPlaneMesh(e,t){const s=new vr(1),i=new st(s,t);return i.scale.set(e,e,e),i}}const Rs=class Rs extends Bt{constructor(t){super(t);y(this,"onBeforeDrag",new et);y(this,"onAfterDrag",new et);y(this,"onBeforeCreate",new et);y(this,"onBeforeCancel",new et);y(this,"onAfterCancel",new et);y(this,"onBeforeDelete",new et);y(this,"onAfterCreate",new et);y(this,"onAfterDelete",new et);y(this,"onDisposed",new et);y(this,"orthogonalY",!1);y(this,"toleranceOrthogonalY",.7);y(this,"Type",xn);y(this,"list",[]);y(this,"_material",new $e({color:12255487,side:Ti,transparent:!0,opacity:.2}));y(this,"_size",5);y(this,"_enabled",!1);y(this,"_visible",!0);y(this,"_onStartDragging",()=>{this.onBeforeDrag.trigger()});y(this,"_onEndDragging",()=>{this.onAfterDrag.trigger()});this.components.add(Rs.uuid,this)}get enabled(){return this._enabled}set enabled(t){this._enabled=t;for(const s of this.list)s.enabled=t;this.updateMaterialsAndPlanes()}get visible(){return this._visible}set visible(t){this._visible=t;for(const s of this.list)s.visible=t}get material(){return this._material}set material(t){this._material=t;for(const s of this.list)s.planeMaterial=t}get size(){return this._size}set size(t){this._size=t;for(const s of this.list)s.size=t}dispose(){this._enabled=!1;for(const t of this.list)t.dispose();this.list.length=0,this._material.dispose(),this.onBeforeCreate.reset(),this.onBeforeCancel.reset(),this.onBeforeDelete.reset(),this.onBeforeDrag.reset(),this.onAfterCreate.reset(),this.onAfterCancel.reset(),this.onAfterDelete.reset(),this.onAfterDrag.reset(),this.onDisposed.trigger(Rs.uuid),this.onDisposed.reset()}create(t){const n=this.components.get(ws).get(t).castRay();return n?this.createPlaneFromIntersection(t,n):null}createFromNormalAndCoplanarPoint(t,s,i){const n=this.newPlane(t,i,s);return this.updateMaterialsAndPlanes(),n}delete(t,s){s||(s=this.pickPlane(t)),s&&this.deletePlane(s)}deleteAll(t){const s=[...this.list];for(const i of s)if(!t||t.has(i.type)){this.delete(i.world,i);const n=this.list.indexOf(i);n!==-1&&this.list.splice(n,1)}}deletePlane(t){const s=this.list.indexOf(t);if(s!==-1){if(this.list.splice(s,1),!t.world.renderer)throw new Error("Renderer not found for this plane's world!");t.world.renderer.setPlane(!1,t.three),t.dispose(),this.updateMaterialsAndPlanes(),this.onAfterDelete.trigger(t)}}pickPlane(t){const i=this.components.get(ws).get(t),n=this.getAllPlaneMeshes(),r=i.castRay(n);if(r){const o=r.object;return this.list.find(a=>a.meshes.includes(o))}}getAllPlaneMeshes(){const t=[];for(const s of this.list)t.push(...s.meshes);return t}createPlaneFromIntersection(t,s){var a;if(!t.renderer)throw new Error("The given world must have a renderer!");const i=s.point.distanceTo(new W(0,0,0)),n=(a=s.face)==null?void 0:a.normal;if(!i||!n)return null;const r=this.getWorldNormal(s,n),o=this.newPlane(t,s.point,r.negate());return o.visible=this._visible,o.size=this._size,t.renderer.setPlane(!0,o.three),this.updateMaterialsAndPlanes(),o}getWorldNormal(t,s){const i=t.object;let n=t.object.matrixWorld.clone();if(i instanceof oi&&t.instanceId!==void 0){const l=new Ft;i.getMatrixAt(t.instanceId,l),n=l.multiply(n)}const o=new Co().getNormalMatrix(n),a=s.clone().applyMatrix3(o).normalize();return this.normalizePlaneDirectionY(a),a}normalizePlaneDirectionY(t){this.orthogonalY&&(t.y>this.toleranceOrthogonalY&&(t.x=0,t.y=1,t.z=0),t.y<-this.toleranceOrthogonalY&&(t.x=0,t.y=-1,t.z=0))}newPlane(t,s,i){const n=new this.Type(this.components,t,s,i,this._material);return n.onDraggingStarted.add(this._onStartDragging),n.onDraggingEnded.add(this._onEndDragging),this.list.push(n),this.onAfterCreate.trigger(n),n}updateMaterialsAndPlanes(){const t=this.components.get(sn);for(const[s,i]of t.list){if(!i.renderer)continue;i.renderer.updateClippingPlanes();const{clippingPlanes:n}=i.renderer;for(const r of i.meshes)if(r.material)if(Array.isArray(r.material))for(const o of r.material)o.clippingPlanes=n;else r.material.clippingPlanes=n}}};y(Rs,"uuid","66290bc5-18c4-4cd1-9379-2e17a0617611");let rn=Rs;class dc{constructor(e){y(this,"enabled",!1);y(this,"id","FirstPerson");this.camera=e}set(e){if(this.enabled=e,e){if(this.camera.projection.current!=="Perspective"){this.camera.set("Orbit");return}this.setupFirstPersonCamera()}}setupFirstPersonCamera(){const e=this.camera.controls,t=new W;e.distance--,e.getPosition(t),e.minDistance=1,e.maxDistance=1,e.distance=1,e.moveTo(t.x,t.y,t.z),e.truckSpeed=50,e.mouseButtons.wheel=vt.ACTION.DOLLY,e.touches.two=vt.ACTION.TOUCH_ZOOM_TRUCK}}class fc{constructor(e){y(this,"enabled",!0);y(this,"id","Orbit");this.camera=e,this.activateOrbitControls()}set(e){this.enabled=e,e&&this.activateOrbitControls()}activateOrbitControls(){const e=this.camera.controls;e.minDistance=1,e.maxDistance=300;const t=new W;e.getPosition(t);const s=t.length();e.distance=s,e.truckSpeed=2;const{rotation:i}=this.camera.three,n=new W(0,0,-1).applyEuler(i),r=t.addScaledVector(n,s);e.moveTo(r.x,r.y,r.z)}}class pc{constructor(e){y(this,"enabled",!1);y(this,"id","Plan");y(this,"mouseAction1");y(this,"mouseAction2");y(this,"mouseInitialized",!1);y(this,"defaultAzimuthSpeed");y(this,"defaultPolarSpeed");this.camera=e,this.defaultAzimuthSpeed=e.controls.azimuthRotateSpeed,this.defaultPolarSpeed=e.controls.polarRotateSpeed}set(e){this.enabled=e;const t=this.camera.controls;t.azimuthRotateSpeed=e?0:this.defaultAzimuthSpeed,t.polarRotateSpeed=e?0:this.defaultPolarSpeed,this.mouseInitialized||(this.mouseAction1=t.touches.one,this.mouseAction2=t.touches.two,this.mouseInitialized=!0),e?(t.mouseButtons.left=vt.ACTION.TRUCK,t.touches.one=vt.ACTION.TOUCH_TRUCK,t.touches.two=vt.ACTION.TOUCH_ZOOM):(t.mouseButtons.left=vt.ACTION.ROTATE,t.touches.one=this.mouseAction1,t.touches.two=this.mouseAction2)}}class Ec{constructor(e){y(this,"onChanged",new et);y(this,"current","Perspective");y(this,"camera");y(this,"matchOrthoDistanceEnabled",!1);y(this,"_component");y(this,"_previousDistance",-1);this._component=e,this.camera=e.three}async set(e){this.current!==e&&(e==="Orthographic"?this.setOrthoCamera():await this.setPerspectiveCamera(),this.onChanged.trigger(this.camera))}async toggle(){const t=this.current==="Perspective"?"Orthographic":"Perspective";await this.set(t)}setOrthoCamera(){if(this._component.mode===null||this._component.mode.id==="FirstPerson")return;this._previousDistance=this._component.controls.distance,this._component.controls.distance=200;const e=this.getPerspectiveDims();if(!e)return;const{width:t,height:s}=e;this.setupOrthoCamera(s,t),this.camera=this._component.threeOrtho,this.current="Orthographic"}getPerspectiveDims(){const e=this._component.currentWorld;if(!e||!e.renderer)return null;const t=new W;this._component.threePersp.getWorldDirection(t);const s=new W;this._component.controls.getTarget(s);const n=s.clone().sub(this._component.threePersp.position).dot(t),r=e.renderer.getSize(),o=r.x/r.y,a=this._component.threePersp,l=n*2*Math.atan(a.fov*(Math.PI/180)/2);return{width:l*o,height:l}}setupOrthoCamera(e,t){this._component.controls.mouseButtons.wheel=vt.ACTION.ZOOM,this._component.controls.mouseButtons.middle=vt.ACTION.ZOOM;const s=this._component.threePersp,i=this._component.threeOrtho;i.zoom=1,i.left=t/-2,i.right=t/2,i.top=e/2,i.bottom=e/-2,i.updateProjectionMatrix(),i.position.copy(s.position),i.quaternion.copy(s.quaternion),this._component.controls.camera=i}getDistance(){const e=this._component.threePersp,t=this._component.threeOrtho;return(t.top-t.bottom)/t.zoom/(2*Math.atan(e.fov*(Math.PI/180)/2))}async setPerspectiveCamera(){this._component.controls.mouseButtons.wheel=vt.ACTION.DOLLY,this._component.controls.mouseButtons.middle=vt.ACTION.DOLLY;const e=this._component.threePersp,t=this._component.threeOrtho;e.position.copy(t.position),e.quaternion.copy(t.quaternion),this._component.controls.mouseButtons.wheel=vt.ACTION.DOLLY,this.matchOrthoDistanceEnabled?this._component.controls.distance=this.getDistance():this._component.controls.distance=this._previousDistance,await this._component.controls.zoomTo(1),e.updateProjectionMatrix(),this._component.controls.camera=e,this.camera=e,this.current="Perspective"}}class Ic extends vn{constructor(t){super(t);y(this,"projection");y(this,"threeOrtho");y(this,"threePersp");y(this,"_userInputButtons",{});y(this,"_frustumSize",50);y(this,"_navigationModes",new Map);y(this,"_mode",null);y(this,"previousSize",null);this.threePersp=this.three,this.threeOrtho=this.newOrthoCamera(),this.projection=new Ec(this),this.onAspectUpdated.add(()=>{this.setOrthoPerspCameraAspect()}),this.projection.onChanged.add(s=>{this.three=s,this.updateAspect()}),this.onWorldChanged.add(({action:s})=>{s==="added"&&(this._navigationModes.clear(),this._navigationModes.set("Orbit",new fc(this)),this._navigationModes.set("FirstPerson",new dc(this)),this._navigationModes.set("Plan",new pc(this)),this._mode=this._navigationModes.get("Orbit"),this.mode.set(!0,{preventTargetAdjustment:!0}),this.currentWorld&&this.currentWorld.renderer&&(this.previousSize=this.currentWorld.renderer.getSize().clone()))})}get mode(){if(!this._mode)throw new Error("Mode not found, camera not initialized");return this._mode}dispose(){super.dispose(),this.threeOrtho.removeFromParent()}set(t){if(this.mode!==null&&this.mode.id!==t){if(this.mode.set(!1),!this._navigationModes.has(t))throw new Error("The specified mode does not exist!");this._mode=this._navigationModes.get(t),this.mode.set(!0)}}async fit(t,s=1.5){if(!this.enabled)return;const i=Number.MAX_VALUE,n=Number.MIN_VALUE,r=new W(i,i,i),o=new W(n,n,n);for(const f of t){const I=new Nt().setFromObject(f);I.min.xo.x&&(o.x=I.max.x),I.max.y>o.y&&(o.y=I.max.y),I.max.z>o.z&&(o.z=I.max.z)}const a=new Nt(r,o),l=new W;a.getSize(l);const h=new W;a.getCenter(h);const u=Math.max(l.x,l.y,l.z)*s,d=new gi(h,u);await this.controls.fitToSphere(d,!0)}setUserInput(t){t?this.enableUserInput():this.disableUserInput()}disableUserInput(){this._userInputButtons.left=this.controls.mouseButtons.left,this._userInputButtons.right=this.controls.mouseButtons.right,this._userInputButtons.middle=this.controls.mouseButtons.middle,this._userInputButtons.wheel=this.controls.mouseButtons.wheel,this.controls.mouseButtons.left=0,this.controls.mouseButtons.right=0,this.controls.mouseButtons.middle=0,this.controls.mouseButtons.wheel=0}enableUserInput(){Object.keys(this._userInputButtons).length!==0&&(this.controls.mouseButtons.left=this._userInputButtons.left,this.controls.mouseButtons.right=this._userInputButtons.right,this.controls.mouseButtons.middle=this._userInputButtons.middle,this.controls.mouseButtons.wheel=this._userInputButtons.wheel)}newOrthoCamera(){const t=window.innerWidth/window.innerHeight;return new En(this._frustumSize*t/-2,this._frustumSize*t/2,this._frustumSize/2,this._frustumSize/-2,.1,1e3)}setOrthoPerspCameraAspect(){if(!this.currentWorld||!this.currentWorld.renderer||!this.previousSize)return;const t=this.currentWorld.renderer.getSize(),s=this.threeOrtho.top,i=this.threeOrtho.right,n=t.y/this.previousSize.y,r=t.x/this.previousSize.x,o=s*n,a=i*r;this.threeOrtho.left=-a,this.threeOrtho.right=a,this.threeOrtho.top=o,this.threeOrtho.bottom=-o,this.threeOrtho.updateProjectionMatrix(),this.previousSize.copy(t)}}const Or=new Map([[_i,{forRelated:"Decomposes",forRelating:"IsDecomposedBy"}],[Cn,{forRelated:"HasAssociations",forRelating:"AssociatedTo"}],[gn,{forRelated:"HasAssociations",forRelating:"ClassificationForObjects"}],[Tn,{forRelated:"HasAssignments",forRelating:"IsGroupedBy"}],[Ns,{forRelated:"IsDefinedBy",forRelating:"DefinesOcurrence"}],[_n,{forRelated:"IsTypedBy",forRelating:"Types"}],[An,{forRelated:"IsDefinedBy",forRelating:"Defines"}],[Ai,{forRelated:"ContainedInStructure",forRelating:"ContainsElements"}],[Rn,{forRelated:"AssignedToFlowElement",forRelating:"HasControlElements"}],[yn,{forRelated:"ConnectedFrom",forRelating:"ConnectedTo"}],[On,{forRelated:"HasAssignments",forRelating:"ReferencedBy"}],[Fn,{forRelated:"HasContext",forRelating:"Declares"}],[Sn,{forRelated:"HasAssignments",forRelating:"Controls"}],[wn,{forRelated:"Nests",forRelating:"IsNestedBy"}],[Nn,{forRelated:"HasAssociations",forRelating:"DocumentRefForObjects"}]]),Wr={950732822:"IFCURIREFERENCE",4075327185:"IFCTIME",1209108979:"IFCTEMPERATURERATEOFCHANGEMEASURE",3457685358:"IFCSOUNDPRESSURELEVELMEASURE",4157543285:"IFCSOUNDPOWERLEVELMEASURE",2798247006:"IFCPROPERTYSETDEFINITIONSET",1790229001:"IFCPOSITIVEINTEGER",525895558:"IFCNONNEGATIVELENGTHMEASURE",1774176899:"IFCLINEINDEX",1275358634:"IFCLANGUAGEID",2541165894:"IFCDURATION",3701338814:"IFCDAYINWEEKNUMBER",2195413836:"IFCDATETIME",937566702:"IFCDATE",1683019596:"IFCCARDINALPOINTREFERENCE",2314439260:"IFCBINARY",1500781891:"IFCAREADENSITYMEASURE",3683503648:"IFCARCINDEX",4065007721:"IFCYEARNUMBER",1718600412:"IFCWARPINGMOMENTMEASURE",51269191:"IFCWARPINGCONSTANTMEASURE",2593997549:"IFCVOLUMETRICFLOWRATEMEASURE",3458127941:"IFCVOLUMEMEASURE",3345633955:"IFCVAPORPERMEABILITYMEASURE",1278329552:"IFCTORQUEMEASURE",2591213694:"IFCTIMESTAMP",2726807636:"IFCTIMEMEASURE",743184107:"IFCTHERMODYNAMICTEMPERATUREMEASURE",2016195849:"IFCTHERMALTRANSMITTANCEMEASURE",857959152:"IFCTHERMALRESISTANCEMEASURE",2281867870:"IFCTHERMALEXPANSIONCOEFFICIENTMEASURE",2645777649:"IFCTHERMALCONDUCTIVITYMEASURE",232962298:"IFCTHERMALADMITTANCEMEASURE",296282323:"IFCTEXTTRANSFORMATION",603696268:"IFCTEXTFONTNAME",3490877962:"IFCTEXTDECORATION",1460886941:"IFCTEXTALIGNMENT",2801250643:"IFCTEXT",58845555:"IFCTEMPERATUREGRADIENTMEASURE",361837227:"IFCSPECULARROUGHNESS",2757832317:"IFCSPECULAREXPONENT",3477203348:"IFCSPECIFICHEATCAPACITYMEASURE",993287707:"IFCSOUNDPRESSUREMEASURE",846465480:"IFCSOUNDPOWERMEASURE",3471399674:"IFCSOLIDANGLEMEASURE",408310005:"IFCSHEARMODULUSMEASURE",2190458107:"IFCSECTIONALAREAINTEGRALMEASURE",3467162246:"IFCSECTIONMODULUSMEASURE",2766185779:"IFCSECONDINMINUTE",3211557302:"IFCROTATIONALSTIFFNESSMEASURE",1755127002:"IFCROTATIONALMASSMEASURE",2133746277:"IFCROTATIONALFREQUENCYMEASURE",200335297:"IFCREAL",96294661:"IFCRATIOMEASURE",3972513137:"IFCRADIOACTIVITYMEASURE",3665567075:"IFCPRESSUREMEASURE",2169031380:"IFCPRESENTABLETEXT",1364037233:"IFCPOWERMEASURE",1245737093:"IFCPOSITIVERATIOMEASURE",3054510233:"IFCPOSITIVEPLANEANGLEMEASURE",2815919920:"IFCPOSITIVELENGTHMEASURE",4042175685:"IFCPLANEANGLEMEASURE",2642773653:"IFCPLANARFORCEMEASURE",2260317790:"IFCPARAMETERVALUE",929793134:"IFCPHMEASURE",2395907400:"IFCNUMERICMEASURE",2095195183:"IFCNORMALISEDRATIOMEASURE",765770214:"IFCMONTHINYEARNUMBER",2615040989:"IFCMONETARYMEASURE",3114022597:"IFCMOMENTOFINERTIAMEASURE",1648970520:"IFCMOLECULARWEIGHTMEASURE",3177669450:"IFCMOISTUREDIFFUSIVITYMEASURE",1753493141:"IFCMODULUSOFSUBGRADEREACTIONMEASURE",1052454078:"IFCMODULUSOFROTATIONALSUBGRADEREACTIONMEASURE",2173214787:"IFCMODULUSOFLINEARSUBGRADEREACTIONMEASURE",3341486342:"IFCMODULUSOFELASTICITYMEASURE",102610177:"IFCMINUTEINHOUR",3531705166:"IFCMASSPERLENGTHMEASURE",3124614049:"IFCMASSMEASURE",4017473158:"IFCMASSFLOWRATEMEASURE",1477762836:"IFCMASSDENSITYMEASURE",2486716878:"IFCMAGNETICFLUXMEASURE",286949696:"IFCMAGNETICFLUXDENSITYMEASURE",151039812:"IFCLUMINOUSINTENSITYMEASURE",2755797622:"IFCLUMINOUSINTENSITYDISTRIBUTIONMEASURE",2095003142:"IFCLUMINOUSFLUXMEASURE",503418787:"IFCLOGICAL",3086160713:"IFCLINEARVELOCITYMEASURE",1307019551:"IFCLINEARSTIFFNESSMEASURE",2128979029:"IFCLINEARMOMENTMEASURE",191860431:"IFCLINEARFORCEMEASURE",1243674935:"IFCLENGTHMEASURE",3258342251:"IFCLABEL",2054016361:"IFCKINEMATICVISCOSITYMEASURE",3192672207:"IFCISOTHERMALMOISTURECAPACITYMEASURE",3686016028:"IFCIONCONCENTRATIONMEASURE",3809634241:"IFCINTEGERCOUNTRATEMEASURE",1939436016:"IFCINTEGER",2679005408:"IFCINDUCTANCEMEASURE",3358199106:"IFCILLUMINANCEMEASURE",983778844:"IFCIDENTIFIER",2589826445:"IFCHOURINDAY",1158859006:"IFCHEATINGVALUEMEASURE",3113092358:"IFCHEATFLUXDENSITYMEASURE",3064340077:"IFCGLOBALLYUNIQUEID",3044325142:"IFCFREQUENCYMEASURE",1361398929:"IFCFORCEMEASURE",2590844177:"IFCFONTWEIGHT",2715512545:"IFCFONTVARIANT",1102727119:"IFCFONTSTYLE",2078135608:"IFCENERGYMEASURE",2506197118:"IFCELECTRICVOLTAGEMEASURE",2951915441:"IFCELECTRICRESISTANCEMEASURE",3790457270:"IFCELECTRICCURRENTMEASURE",2093906313:"IFCELECTRICCONDUCTANCEMEASURE",3818826038:"IFCELECTRICCHARGEMEASURE",1827137117:"IFCELECTRICCAPACITANCEMEASURE",69416015:"IFCDYNAMICVISCOSITYMEASURE",524656162:"IFCDOSEEQUIVALENTMEASURE",4134073009:"IFCDIMENSIONCOUNT",1514641115:"IFCDESCRIPTIVEMEASURE",300323983:"IFCDAYLIGHTSAVINGHOUR",86635668:"IFCDAYINMONTHNUMBER",94842927:"IFCCURVATUREMEASURE",1778710042:"IFCCOUNTMEASURE",3238673880:"IFCCONTEXTDEPENDENTMEASURE",3812528620:"IFCCOMPOUNDPLANEANGLEMEASURE",2991860651:"IFCCOMPLEXNUMBER",1867003952:"IFCBOXALIGNMENT",2735952531:"IFCBOOLEAN",2650437152:"IFCAREAMEASURE",632304761:"IFCANGULARVELOCITYMEASURE",360377573:"IFCAMOUNTOFSUBSTANCEMEASURE",4182062534:"IFCACCELERATIONMEASURE",3699917729:"IFCABSORBEDDOSEMEASURE",1971632696:"IFCGEOSLICE",2680139844:"IFCGEOMODEL",24726584:"IFCELECTRICFLOWTREATMENTDEVICE",3693000487:"IFCDISTRIBUTIONBOARD",3460952963:"IFCCONVEYORSEGMENT",3999819293:"IFCCAISSONFOUNDATION",3314249567:"IFCBOREHOLE",4196446775:"IFCBEARING",325726236:"IFCALIGNMENT",3425753595:"IFCTRACKELEMENT",991950508:"IFCSIGNAL",3798194928:"IFCREINFORCEDSOIL",3290496277:"IFCRAIL",1383356374:"IFCPAVEMENT",2182337498:"IFCNAVIGATIONELEMENT",234836483:"IFCMOORINGDEVICE",2078563270:"IFCMOBILETELECOMMUNICATIONSAPPLIANCE",1638804497:"IFCLIQUIDTERMINAL",1154579445:"IFCLINEARPOSITIONINGELEMENT",2696325953:"IFCKERB",2713699986:"IFCGEOTECHNICALASSEMBLY",2142170206:"IFCELECTRICFLOWTREATMENTDEVICETYPE",3376911765:"IFCEARTHWORKSFILL",1077100507:"IFCEARTHWORKSELEMENT",3071239417:"IFCEARTHWORKSCUT",479945903:"IFCDISTRIBUTIONBOARDTYPE",3426335179:"IFCDEEPFOUNDATION",1502416096:"IFCCOURSE",2940368186:"IFCCONVEYORSEGMENTTYPE",3203706013:"IFCCAISSONFOUNDATIONTYPE",3862327254:"IFCBUILTSYSTEM",1876633798:"IFCBUILTELEMENT",963979645:"IFCBRIDGEPART",644574406:"IFCBRIDGE",3649138523:"IFCBEARINGTYPE",1662888072:"IFCALIGNMENTVERTICAL",317615605:"IFCALIGNMENTSEGMENT",1545765605:"IFCALIGNMENTHORIZONTAL",4266260250:"IFCALIGNMENTCANT",3956297820:"IFCVIBRATIONDAMPERTYPE",1530820697:"IFCVIBRATIONDAMPER",840318589:"IFCVEHICLE",1953115116:"IFCTRANSPORTATIONDEVICE",618700268:"IFCTRACKELEMENTTYPE",2281632017:"IFCTENDONCONDUITTYPE",3663046924:"IFCTENDONCONDUIT",42703149:"IFCSINESPIRAL",1894708472:"IFCSIGNALTYPE",3599934289:"IFCSIGNTYPE",33720170:"IFCSIGN",1027922057:"IFCSEVENTHORDERPOLYNOMIALSPIRAL",544395925:"IFCSEGMENTEDREFERENCECURVE",3649235739:"IFCSECONDORDERPOLYNOMIALSPIRAL",550521510:"IFCROADPART",146592293:"IFCROAD",3818125796:"IFCRELADHERESTOELEMENT",4021432810:"IFCREFERENT",1891881377:"IFCRAILWAYPART",3992365140:"IFCRAILWAY",1763565496:"IFCRAILTYPE",1946335990:"IFCPOSITIONINGELEMENT",514975943:"IFCPAVEMENTTYPE",506776471:"IFCNAVIGATIONELEMENTTYPE",710110818:"IFCMOORINGDEVICETYPE",1950438474:"IFCMOBILETELECOMMUNICATIONSAPPLIANCETYPE",976884017:"IFCMARINEPART",525669439:"IFCMARINEFACILITY",1770583370:"IFCLIQUIDTERMINALTYPE",2176059722:"IFCLINEARELEMENT",679976338:"IFCKERBTYPE",3948183225:"IFCIMPACTPROTECTIONDEVICETYPE",2568555532:"IFCIMPACTPROTECTIONDEVICE",2898700619:"IFCGRADIENTCURVE",1594536857:"IFCGEOTECHNICALSTRATUM",4230923436:"IFCGEOTECHNICALELEMENT",4228831410:"IFCFACILITYPARTCOMMON",1310830890:"IFCFACILITYPART",24185140:"IFCFACILITY",4234616927:"IFCDIRECTRIXDERIVEDREFERENCESWEPTAREASOLID",1306400036:"IFCDEEPFOUNDATIONTYPE",4189326743:"IFCCOURSETYPE",2000195564:"IFCCOSINESPIRAL",3497074424:"IFCCLOTHOID",1626504194:"IFCBUILTELEMENTTYPE",3651464721:"IFCVEHICLETYPE",1229763772:"IFCTRIANGULATEDIRREGULARNETWORK",3665877780:"IFCTRANSPORTATIONDEVICETYPE",782932809:"IFCTHIRDORDERPOLYNOMIALSPIRAL",2735484536:"IFCSPIRAL",1356537516:"IFCSECTIONEDSURFACE",1290935644:"IFCSECTIONEDSOLIDHORIZONTAL",1862484736:"IFCSECTIONEDSOLID",1441486842:"IFCRELPOSITIONS",1033248425:"IFCRELASSOCIATESPROFILEDEF",3381221214:"IFCPOLYNOMIALCURVE",2485787929:"IFCOFFSETCURVEBYDISTANCES",590820931:"IFCOFFSETCURVE",3465909080:"IFCINDEXEDPOLYGONALTEXTUREMAP",593015953:"IFCDIRECTRIXCURVESWEPTAREASOLID",4212018352:"IFCCURVESEGMENT",3425423356:"IFCAXIS2PLACEMENTLINEAR",823603102:"IFCSEGMENT",2165702409:"IFCPOINTBYDISTANCEEXPRESSION",182550632:"IFCOPENCROSSPROFILEDEF",388784114:"IFCLINEARPLACEMENT",536804194:"IFCALIGNMENTHORIZONTALSEGMENT",3752311538:"IFCALIGNMENTCANTSEGMENT",1010789467:"IFCTEXTURECOORDINATEINDICESWITHVOIDS",222769930:"IFCTEXTURECOORDINATEINDICES",2691318326:"IFCQUANTITYNUMBER",3633395639:"IFCALIGNMENTVERTICALSEGMENT",2879124712:"IFCALIGNMENTPARAMETERSEGMENT",25142252:"IFCCONTROLLER",3087945054:"IFCALARM",4288193352:"IFCACTUATOR",630975310:"IFCUNITARYCONTROLELEMENT",4086658281:"IFCSENSOR",2295281155:"IFCPROTECTIVEDEVICETRIPPINGUNIT",182646315:"IFCFLOWINSTRUMENT",1426591983:"IFCFIRESUPPRESSIONTERMINAL",819412036:"IFCFILTER",3415622556:"IFCFAN",1003880860:"IFCELECTRICTIMECONTROL",402227799:"IFCELECTRICMOTOR",264262732:"IFCELECTRICGENERATOR",3310460725:"IFCELECTRICFLOWSTORAGEDEVICE",862014818:"IFCELECTRICDISTRIBUTIONBOARD",1904799276:"IFCELECTRICAPPLIANCE",1360408905:"IFCDUCTSILENCER",3518393246:"IFCDUCTSEGMENT",342316401:"IFCDUCTFITTING",562808652:"IFCDISTRIBUTIONCIRCUIT",4074379575:"IFCDAMPER",3640358203:"IFCCOOLINGTOWER",4136498852:"IFCCOOLEDBEAM",2272882330:"IFCCONDENSER",3571504051:"IFCCOMPRESSOR",3221913625:"IFCCOMMUNICATIONSAPPLIANCE",639361253:"IFCCOIL",3902619387:"IFCCHILLER",4217484030:"IFCCABLESEGMENT",1051757585:"IFCCABLEFITTING",3758799889:"IFCCABLECARRIERSEGMENT",635142910:"IFCCABLECARRIERFITTING",2938176219:"IFCBURNER",32344328:"IFCBOILER",2906023776:"IFCBEAMSTANDARDCASE",277319702:"IFCAUDIOVISUALAPPLIANCE",2056796094:"IFCAIRTOAIRHEATRECOVERY",177149247:"IFCAIRTERMINALBOX",1634111441:"IFCAIRTERMINAL",486154966:"IFCWINDOWSTANDARDCASE",4237592921:"IFCWASTETERMINAL",4156078855:"IFCWALLELEMENTEDCASE",4207607924:"IFCVALVE",4292641817:"IFCUNITARYEQUIPMENT",3179687236:"IFCUNITARYCONTROLELEMENTTYPE",3026737570:"IFCTUBEBUNDLE",3825984169:"IFCTRANSFORMER",812556717:"IFCTANK",1162798199:"IFCSWITCHINGDEVICE",385403989:"IFCSTRUCTURALLOADCASE",1404847402:"IFCSTACKTERMINAL",1999602285:"IFCSPACEHEATER",3420628829:"IFCSOLARDEVICE",3027962421:"IFCSLABSTANDARDCASE",3127900445:"IFCSLABELEMENTEDCASE",1329646415:"IFCSHADINGDEVICE",3053780830:"IFCSANITARYTERMINAL",2572171363:"IFCREINFORCINGBARTYPE",1232101972:"IFCRATIONALBSPLINECURVEWITHKNOTS",90941305:"IFCPUMP",655969474:"IFCPROTECTIVEDEVICETRIPPINGUNITTYPE",738039164:"IFCPROTECTIVEDEVICE",1156407060:"IFCPLATESTANDARDCASE",3612865200:"IFCPIPESEGMENT",310824031:"IFCPIPEFITTING",3694346114:"IFCOUTLET",144952367:"IFCOUTERBOUNDARYCURVE",2474470126:"IFCMOTORCONNECTION",1911478936:"IFCMEMBERSTANDARDCASE",1437502449:"IFCMEDICALDEVICE",629592764:"IFCLIGHTFIXTURE",76236018:"IFCLAMP",2176052936:"IFCJUNCTIONBOX",4175244083:"IFCINTERCEPTOR",2068733104:"IFCHUMIDIFIER",3319311131:"IFCHEATEXCHANGER",2188021234:"IFCFLOWMETER",1209101575:"IFCEXTERNALSPATIALELEMENT",484807127:"IFCEVAPORATOR",3747195512:"IFCEVAPORATIVECOOLER",2814081492:"IFCENGINE",2417008758:"IFCELECTRICDISTRIBUTIONBOARDTYPE",3242481149:"IFCDOORSTANDARDCASE",3205830791:"IFCDISTRIBUTIONSYSTEM",400855858:"IFCCOMMUNICATIONSAPPLIANCETYPE",905975707:"IFCCOLUMNSTANDARDCASE",1677625105:"IFCCIVILELEMENT",3296154744:"IFCCHIMNEY",2674252688:"IFCCABLEFITTINGTYPE",2188180465:"IFCBURNERTYPE",1177604601:"IFCBUILDINGSYSTEM",39481116:"IFCBUILDINGELEMENTPARTTYPE",1136057603:"IFCBOUNDARYCURVE",2461110595:"IFCBSPLINECURVEWITHKNOTS",1532957894:"IFCAUDIOVISUALAPPLIANCETYPE",4088093105:"IFCWORKCALENDAR",4009809668:"IFCWINDOWTYPE",926996030:"IFCVOIDINGFEATURE",2391383451:"IFCVIBRATIONISOLATOR",2415094496:"IFCTENDONTYPE",3081323446:"IFCTENDONANCHORTYPE",413509423:"IFCSYSTEMFURNITUREELEMENT",3101698114:"IFCSURFACEFEATURE",3657597509:"IFCSTRUCTURALSURFACEACTION",2757150158:"IFCSTRUCTURALCURVEREACTION",1004757350:"IFCSTRUCTURALCURVEACTION",338393293:"IFCSTAIRTYPE",1072016465:"IFCSOLARDEVICETYPE",4074543187:"IFCSHADINGDEVICETYPE",2157484638:"IFCSEAMCURVE",2781568857:"IFCROOFTYPE",2310774935:"IFCREINFORCINGMESHTYPE",964333572:"IFCREINFORCINGELEMENTTYPE",683857671:"IFCRATIONALBSPLINESURFACEWITHKNOTS",1469900589:"IFCRAMPTYPE",2839578677:"IFCPOLYGONALFACESET",1158309216:"IFCPILETYPE",3079942009:"IFCOPENINGSTANDARDCASE",1114901282:"IFCMEDICALDEVICETYPE",3113134337:"IFCINTERSECTIONCURVE",3946677679:"IFCINTERCEPTORTYPE",2571569899:"IFCINDEXEDPOLYCURVE",3493046030:"IFCGEOGRAPHICELEMENT",1509553395:"IFCFURNITURE",1893162501:"IFCFOOTINGTYPE",2853485674:"IFCEXTERNALSPATIALSTRUCTUREELEMENT",4148101412:"IFCEVENT",132023988:"IFCENGINETYPE",2397081782:"IFCELEMENTASSEMBLYTYPE",2323601079:"IFCDOORTYPE",1213902940:"IFCCYLINDRICALSURFACE",1525564444:"IFCCONSTRUCTIONPRODUCTRESOURCETYPE",4105962743:"IFCCONSTRUCTIONMATERIALRESOURCETYPE",2185764099:"IFCCONSTRUCTIONEQUIPMENTRESOURCETYPE",15328376:"IFCCOMPOSITECURVEONSURFACE",3875453745:"IFCCOMPLEXPROPERTYTEMPLATE",3893394355:"IFCCIVILELEMENTTYPE",2197970202:"IFCCHIMNEYTYPE",167062518:"IFCBSPLINESURFACEWITHKNOTS",2887950389:"IFCBSPLINESURFACE",2603310189:"IFCADVANCEDBREPWITHVOIDS",1635779807:"IFCADVANCEDBREP",2916149573:"IFCTRIANGULATEDFACESET",1935646853:"IFCTOROIDALSURFACE",2387106220:"IFCTESSELLATEDFACESET",3206491090:"IFCTASKTYPE",699246055:"IFCSURFACECURVE",4095615324:"IFCSUBCONTRACTRESOURCETYPE",603775116:"IFCSTRUCTURALSURFACEREACTION",4015995234:"IFCSPHERICALSURFACE",2481509218:"IFCSPATIALZONETYPE",463610769:"IFCSPATIALZONE",710998568:"IFCSPATIALELEMENTTYPE",1412071761:"IFCSPATIALELEMENT",3663146110:"IFCSIMPLEPROPERTYTEMPLATE",3243963512:"IFCREVOLVEDAREASOLIDTAPERED",816062949:"IFCREPARAMETRISEDCOMPOSITECURVESEGMENT",1521410863:"IFCRELSPACEBOUNDARY2NDLEVEL",3523091289:"IFCRELSPACEBOUNDARY1STLEVEL",427948657:"IFCRELINTERFERESELEMENTS",307848117:"IFCRELDEFINESBYTEMPLATE",1462361463:"IFCRELDEFINESBYOBJECT",2565941209:"IFCRELDECLARES",1027710054:"IFCRELASSIGNSTOGROUPBYFACTOR",3521284610:"IFCPROPERTYTEMPLATE",492091185:"IFCPROPERTYSETTEMPLATE",653396225:"IFCPROJECTLIBRARY",569719735:"IFCPROCEDURETYPE",3967405729:"IFCPREDEFINEDPROPERTYSET",1682466193:"IFCPCURVE",428585644:"IFCLABORRESOURCETYPE",2294589976:"IFCINDEXEDPOLYGONALFACEWITHVOIDS",178912537:"IFCINDEXEDPOLYGONALFACE",4095422895:"IFCGEOGRAPHICELEMENTTYPE",2652556860:"IFCFIXEDREFERENCESWEPTAREASOLID",2804161546:"IFCEXTRUDEDAREASOLIDTAPERED",4024345920:"IFCEVENTTYPE",2629017746:"IFCCURVEBOUNDEDSURFACE",1815067380:"IFCCREWRESOURCETYPE",3419103109:"IFCCONTEXT",2574617495:"IFCCONSTRUCTIONRESOURCETYPE",2059837836:"IFCCARTESIANPOINTLIST3D",1675464909:"IFCCARTESIANPOINTLIST2D",574549367:"IFCCARTESIANPOINTLIST",3406155212:"IFCADVANCEDFACE",3698973494:"IFCTYPERESOURCE",3736923433:"IFCTYPEPROCESS",901063453:"IFCTESSELLATEDITEM",1096409881:"IFCSWEPTDISKSOLIDPOLYGONAL",1042787934:"IFCRESOURCETIME",1608871552:"IFCRESOURCECONSTRAINTRELATIONSHIP",2943643501:"IFCRESOURCEAPPROVALRELATIONSHIP",2090586900:"IFCQUANTITYSET",1482703590:"IFCPROPERTYTEMPLATEDEFINITION",3778827333:"IFCPREDEFINEDPROPERTIES",2998442950:"IFCMIRROREDPROFILEDEF",853536259:"IFCMATERIALRELATIONSHIP",3404854881:"IFCMATERIALPROFILESETUSAGETAPERING",3079605661:"IFCMATERIALPROFILESETUSAGE",2852063980:"IFCMATERIALCONSTITUENTSET",3708119e3:"IFCMATERIALCONSTITUENT",1585845231:"IFCLAGTIME",2133299955:"IFCINDEXEDTRIANGLETEXTUREMAP",1437953363:"IFCINDEXEDTEXTUREMAP",3570813810:"IFCINDEXEDCOLOURMAP",1437805879:"IFCEXTERNALREFERENCERELATIONSHIP",297599258:"IFCEXTENDEDPROPERTIES",211053100:"IFCEVENTTIME",2713554722:"IFCCONVERSIONBASEDUNITWITHOFFSET",3285139300:"IFCCOLOURRGBLIST",1236880293:"IFCWORKTIME",1199560280:"IFCTIMEPERIOD",3611470254:"IFCTEXTUREVERTEXLIST",2771591690:"IFCTASKTIMERECURRING",1549132990:"IFCTASKTIME",2043862942:"IFCTABLECOLUMN",2934153892:"IFCSURFACEREINFORCEMENTAREA",609421318:"IFCSTRUCTURALLOADORRESULT",3478079324:"IFCSTRUCTURALLOADCONFIGURATION",1054537805:"IFCSCHEDULINGTIME",2439245199:"IFCRESOURCELEVELRELATIONSHIP",2433181523:"IFCREFERENCE",3915482550:"IFCRECURRENCEPATTERN",986844984:"IFCPROPERTYABSTRACTION",3843373140:"IFCPROJECTEDCRS",677532197:"IFCPRESENTATIONITEM",1507914824:"IFCMATERIALUSAGEDEFINITION",552965576:"IFCMATERIALPROFILEWITHOFFSETS",164193824:"IFCMATERIALPROFILESET",2235152071:"IFCMATERIALPROFILE",1847252529:"IFCMATERIALLAYERWITHOFFSETS",760658860:"IFCMATERIALDEFINITION",3057273783:"IFCMAPCONVERSION",4294318154:"IFCEXTERNALINFORMATION",1466758467:"IFCCOORDINATEREFERENCESYSTEM",1785450214:"IFCCOORDINATEOPERATION",775493141:"IFCCONNECTIONVOLUMEGEOMETRY",979691226:"IFCREINFORCINGBAR",3700593921:"IFCELECTRICDISTRIBUTIONPOINT",1062813311:"IFCDISTRIBUTIONCONTROLELEMENT",1052013943:"IFCDISTRIBUTIONCHAMBERELEMENT",578613899:"IFCCONTROLLERTYPE",2454782716:"IFCCHAMFEREDGEFEATURE",753842376:"IFCBEAM",3001207471:"IFCALARMTYPE",2874132201:"IFCACTUATORTYPE",3304561284:"IFCWINDOW",3512223829:"IFCWALLSTANDARDCASE",2391406946:"IFCWALL",3313531582:"IFCVIBRATIONISOLATORTYPE",2347447852:"IFCTENDONANCHOR",3824725483:"IFCTENDON",2515109513:"IFCSTRUCTURALANALYSISMODEL",4252922144:"IFCSTAIRFLIGHT",331165859:"IFCSTAIR",1529196076:"IFCSLAB",1783015770:"IFCSENSORTYPE",1376911519:"IFCROUNDEDEDGEFEATURE",2016517767:"IFCROOF",2320036040:"IFCREINFORCINGMESH",3027567501:"IFCREINFORCINGELEMENT",3055160366:"IFCRATIONALBEZIERCURVE",3283111854:"IFCRAMPFLIGHT",3024970846:"IFCRAMP",2262370178:"IFCRAILING",3171933400:"IFCPLATE",1687234759:"IFCPILE",1073191201:"IFCMEMBER",900683007:"IFCFOOTING",3508470533:"IFCFLOWTREATMENTDEVICE",2223149337:"IFCFLOWTERMINAL",707683696:"IFCFLOWSTORAGEDEVICE",987401354:"IFCFLOWSEGMENT",3132237377:"IFCFLOWMOVINGDEVICE",4037862832:"IFCFLOWINSTRUMENTTYPE",4278956645:"IFCFLOWFITTING",2058353004:"IFCFLOWCONTROLLER",4222183408:"IFCFIRESUPPRESSIONTERMINALTYPE",1810631287:"IFCFILTERTYPE",346874300:"IFCFANTYPE",1658829314:"IFCENERGYCONVERSIONDEVICE",857184966:"IFCELECTRICALELEMENT",1634875225:"IFCELECTRICALCIRCUIT",712377611:"IFCELECTRICTIMECONTROLTYPE",1217240411:"IFCELECTRICMOTORTYPE",1365060375:"IFCELECTRICHEATERTYPE",1534661035:"IFCELECTRICGENERATORTYPE",3277789161:"IFCELECTRICFLOWSTORAGEDEVICETYPE",663422040:"IFCELECTRICAPPLIANCETYPE",855621170:"IFCEDGEFEATURE",2030761528:"IFCDUCTSILENCERTYPE",3760055223:"IFCDUCTSEGMENTTYPE",869906466:"IFCDUCTFITTINGTYPE",395920057:"IFCDOOR",3041715199:"IFCDISTRIBUTIONPORT",3040386961:"IFCDISTRIBUTIONFLOWELEMENT",1945004755:"IFCDISTRIBUTIONELEMENT",2063403501:"IFCDISTRIBUTIONCONTROLELEMENTTYPE",1599208980:"IFCDISTRIBUTIONCHAMBERELEMENTTYPE",2635815018:"IFCDISCRETEACCESSORYTYPE",1335981549:"IFCDISCRETEACCESSORY",4147604152:"IFCDIAMETERDIMENSION",3961806047:"IFCDAMPERTYPE",3495092785:"IFCCURTAINWALL",1973544240:"IFCCOVERING",2954562838:"IFCCOOLINGTOWERTYPE",335055490:"IFCCOOLEDBEAMTYPE",488727124:"IFCCONSTRUCTIONPRODUCTRESOURCE",1060000209:"IFCCONSTRUCTIONMATERIALRESOURCE",3898045240:"IFCCONSTRUCTIONEQUIPMENTRESOURCE",1163958913:"IFCCONDITIONCRITERION",2188551683:"IFCCONDITION",2816379211:"IFCCONDENSERTYPE",3850581409:"IFCCOMPRESSORTYPE",843113511:"IFCCOLUMN",2301859152:"IFCCOILTYPE",2611217952:"IFCCIRCLE",2951183804:"IFCCHILLERTYPE",1285652485:"IFCCABLESEGMENTTYPE",3293546465:"IFCCABLECARRIERSEGMENTTYPE",395041908:"IFCCABLECARRIERFITTINGTYPE",1909888760:"IFCBUILDINGELEMENTPROXYTYPE",1095909175:"IFCBUILDINGELEMENTPROXY",2979338954:"IFCBUILDINGELEMENTPART",52481810:"IFCBUILDINGELEMENTCOMPONENT",3299480353:"IFCBUILDINGELEMENT",231477066:"IFCBOILERTYPE",1916977116:"IFCBEZIERCURVE",819618141:"IFCBEAMTYPE",1967976161:"IFCBSPLINECURVE",3460190687:"IFCASSET",2470393545:"IFCANGULARDIMENSION",1871374353:"IFCAIRTOAIRHEATRECOVERYTYPE",3352864051:"IFCAIRTERMINALTYPE",1411407467:"IFCAIRTERMINALBOXTYPE",3821786052:"IFCACTIONREQUEST",1213861670:"IFC2DCOMPOSITECURVE",1033361043:"IFCZONE",3342526732:"IFCWORKSCHEDULE",4218914973:"IFCWORKPLAN",1028945134:"IFCWORKCONTROL",1133259667:"IFCWASTETERMINALTYPE",1898987631:"IFCWALLTYPE",2769231204:"IFCVIRTUALELEMENT",728799441:"IFCVALVETYPE",1911125066:"IFCUNITARYEQUIPMENTTYPE",1600972822:"IFCTUBEBUNDLETYPE",3593883385:"IFCTRIMMEDCURVE",1620046519:"IFCTRANSPORTELEMENT",1692211062:"IFCTRANSFORMERTYPE",1637806684:"IFCTIMESERIESSCHEDULE",5716631:"IFCTANKTYPE",2254336722:"IFCSYSTEM",2315554128:"IFCSWITCHINGDEVICETYPE",148013059:"IFCSUBCONTRACTRESOURCE",1975003073:"IFCSTRUCTURALSURFACECONNECTION",2986769608:"IFCSTRUCTURALRESULTGROUP",1235345126:"IFCSTRUCTURALPOINTREACTION",734778138:"IFCSTRUCTURALPOINTCONNECTION",2082059205:"IFCSTRUCTURALPOINTACTION",3987759626:"IFCSTRUCTURALPLANARACTIONVARYING",1621171031:"IFCSTRUCTURALPLANARACTION",1252848954:"IFCSTRUCTURALLOADGROUP",1721250024:"IFCSTRUCTURALLINEARACTIONVARYING",1807405624:"IFCSTRUCTURALLINEARACTION",2445595289:"IFCSTRUCTURALCURVEMEMBERVARYING",214636428:"IFCSTRUCTURALCURVEMEMBER",4243806635:"IFCSTRUCTURALCURVECONNECTION",1179482911:"IFCSTRUCTURALCONNECTION",682877961:"IFCSTRUCTURALACTION",1039846685:"IFCSTAIRFLIGHTTYPE",3112655638:"IFCSTACKTERMINALTYPE",3812236995:"IFCSPACETYPE",652456506:"IFCSPACEPROGRAM",1305183839:"IFCSPACEHEATERTYPE",3856911033:"IFCSPACE",2533589738:"IFCSLABTYPE",4097777520:"IFCSITE",4105383287:"IFCSERVICELIFE",3517283431:"IFCSCHEDULETIMECONTROL",1768891740:"IFCSANITARYTERMINALTYPE",2863920197:"IFCRELASSIGNSTASKS",160246688:"IFCRELAGGREGATES",2324767716:"IFCRAMPFLIGHTTYPE",2893384427:"IFCRAILINGTYPE",3248260540:"IFCRADIUSDIMENSION",2250791053:"IFCPUMPTYPE",1842657554:"IFCPROTECTIVEDEVICETYPE",3651124850:"IFCPROJECTIONELEMENT",3642467123:"IFCPROJECTORDERRECORD",2904328755:"IFCPROJECTORDER",2744685151:"IFCPROCEDURE",3740093272:"IFCPORT",3724593414:"IFCPOLYLINE",4017108033:"IFCPLATETYPE",4231323485:"IFCPIPESEGMENTTYPE",804291784:"IFCPIPEFITTINGTYPE",3327091369:"IFCPERMIT",2382730787:"IFCPERFORMANCEHISTORY",2837617999:"IFCOUTLETTYPE",3425660407:"IFCORDERACTION",3588315303:"IFCOPENINGELEMENT",4143007308:"IFCOCCUPANT",1916936684:"IFCMOVE",977012517:"IFCMOTORCONNECTIONTYPE",3181161470:"IFCMEMBERTYPE",2108223431:"IFCMECHANICALFASTENERTYPE",377706215:"IFCMECHANICALFASTENER",2506943328:"IFCLINEARDIMENSION",1161773419:"IFCLIGHTFIXTURETYPE",1051575348:"IFCLAMPTYPE",3827777499:"IFCLABORRESOURCE",4288270099:"IFCJUNCTIONBOXTYPE",2391368822:"IFCINVENTORY",1806887404:"IFCHUMIDIFIERTYPE",1251058090:"IFCHEATEXCHANGERTYPE",2706460486:"IFCGROUP",3009204131:"IFCGRID",200128114:"IFCGASTERMINALTYPE",814719939:"IFCFURNITURESTANDARD",263784265:"IFCFURNISHINGELEMENT",3009222698:"IFCFLOWTREATMENTDEVICETYPE",2297155007:"IFCFLOWTERMINALTYPE",1339347760:"IFCFLOWSTORAGEDEVICETYPE",1834744321:"IFCFLOWSEGMENTTYPE",1482959167:"IFCFLOWMOVINGDEVICETYPE",3815607619:"IFCFLOWMETERTYPE",3198132628:"IFCFLOWFITTINGTYPE",3907093117:"IFCFLOWCONTROLLERTYPE",1287392070:"IFCFEATUREELEMENTSUBTRACTION",2143335405:"IFCFEATUREELEMENTADDITION",2827207264:"IFCFEATUREELEMENT",2489546625:"IFCFASTENERTYPE",647756555:"IFCFASTENER",3737207727:"IFCFACETEDBREPWITHVOIDS",807026263:"IFCFACETEDBREP",3390157468:"IFCEVAPORATORTYPE",3174744832:"IFCEVAPORATIVECOOLERTYPE",3272907226:"IFCEQUIPMENTSTANDARD",1962604670:"IFCEQUIPMENTELEMENT",2107101300:"IFCENERGYCONVERSIONDEVICETYPE",1704287377:"IFCELLIPSE",2590856083:"IFCELEMENTCOMPONENTTYPE",1623761950:"IFCELEMENTCOMPONENT",4123344466:"IFCELEMENTASSEMBLY",1758889154:"IFCELEMENT",360485395:"IFCELECTRICALBASEPROPERTIES",3849074793:"IFCDISTRIBUTIONFLOWELEMENTTYPE",3256556792:"IFCDISTRIBUTIONELEMENTTYPE",681481545:"IFCDIMENSIONCURVEDIRECTEDCALLOUT",1457835157:"IFCCURTAINWALLTYPE",3295246426:"IFCCREWRESOURCE",1916426348:"IFCCOVERINGTYPE",1419761937:"IFCCOSTSCHEDULE",3895139033:"IFCCOSTITEM",3293443760:"IFCCONTROL",2559216714:"IFCCONSTRUCTIONRESOURCE",2510884976:"IFCCONIC",3732776249:"IFCCOMPOSITECURVE",300633059:"IFCCOLUMNTYPE",2937912522:"IFCCIRCLEHOLLOWPROFILEDEF",3124254112:"IFCBUILDINGSTOREY",1950629157:"IFCBUILDINGELEMENTTYPE",4031249490:"IFCBUILDING",1260505505:"IFCBOUNDEDCURVE",3649129432:"IFCBOOLEANCLIPPINGRESULT",1334484129:"IFCBLOCK",3207858831:"IFCASYMMETRICISHAPEPROFILEDEF",1674181508:"IFCANNOTATION",2296667514:"IFCACTOR",2097647324:"IFCTRANSPORTELEMENTTYPE",3473067441:"IFCTASK",1580310250:"IFCSYSTEMFURNITUREELEMENTTYPE",4124788165:"IFCSURFACEOFREVOLUTION",2809605785:"IFCSURFACEOFLINEAREXTRUSION",2028607225:"IFCSURFACECURVESWEPTAREASOLID",4070609034:"IFCSTRUCTUREDDIMENSIONCALLOUT",2218152070:"IFCSTRUCTURALSURFACEMEMBERVARYING",3979015343:"IFCSTRUCTURALSURFACEMEMBER",3689010777:"IFCSTRUCTURALREACTION",530289379:"IFCSTRUCTURALMEMBER",3136571912:"IFCSTRUCTURALITEM",3544373492:"IFCSTRUCTURALACTIVITY",451544542:"IFCSPHERE",3893378262:"IFCSPATIALSTRUCTUREELEMENTTYPE",2706606064:"IFCSPATIALSTRUCTUREELEMENT",3626867408:"IFCRIGHTCIRCULARCYLINDER",4158566097:"IFCRIGHTCIRCULARCONE",1856042241:"IFCREVOLVEDAREASOLID",2914609552:"IFCRESOURCE",1401173127:"IFCRELVOIDSELEMENT",3451746338:"IFCRELSPACEBOUNDARY",366585022:"IFCRELSERVICESBUILDINGS",4122056220:"IFCRELSEQUENCE",1058617721:"IFCRELSCHEDULESCOSTITEMS",1245217292:"IFCRELREFERENCEDINSPATIALSTRUCTURE",750771296:"IFCRELPROJECTSELEMENT",202636808:"IFCRELOVERRIDESPROPERTIES",2051452291:"IFCRELOCCUPIESSPACES",3268803585:"IFCRELNESTS",4189434867:"IFCRELINTERACTIONREQUIREMENTS",279856033:"IFCRELFLOWCONTROLELEMENTS",3940055652:"IFCRELFILLSELEMENT",781010003:"IFCRELDEFINESBYTYPE",4186316022:"IFCRELDEFINESBYPROPERTIES",693640335:"IFCRELDEFINES",2551354335:"IFCRELDECOMPOSES",2802773753:"IFCRELCOVERSSPACES",886880790:"IFCRELCOVERSBLDGELEMENTS",3242617779:"IFCRELCONTAINEDINSPATIALSTRUCTURE",3678494232:"IFCRELCONNECTSWITHREALIZINGELEMENTS",504942748:"IFCRELCONNECTSWITHECCENTRICITY",1638771189:"IFCRELCONNECTSSTRUCTURALMEMBER",3912681535:"IFCRELCONNECTSSTRUCTURALELEMENT",2127690289:"IFCRELCONNECTSSTRUCTURALACTIVITY",3190031847:"IFCRELCONNECTSPORTS",4201705270:"IFCRELCONNECTSPORTTOELEMENT",3945020480:"IFCRELCONNECTSPATHELEMENTS",1204542856:"IFCRELCONNECTSELEMENTS",826625072:"IFCRELCONNECTS",2851387026:"IFCRELASSOCIATESPROFILEPROPERTIES",2655215786:"IFCRELASSOCIATESMATERIAL",3840914261:"IFCRELASSOCIATESLIBRARY",982818633:"IFCRELASSOCIATESDOCUMENT",2728634034:"IFCRELASSOCIATESCONSTRAINT",919958153:"IFCRELASSOCIATESCLASSIFICATION",4095574036:"IFCRELASSOCIATESAPPROVAL",1327628568:"IFCRELASSOCIATESAPPLIEDVALUE",1865459582:"IFCRELASSOCIATES",205026976:"IFCRELASSIGNSTORESOURCE",3372526763:"IFCRELASSIGNSTOPROJECTORDER",2857406711:"IFCRELASSIGNSTOPRODUCT",4278684876:"IFCRELASSIGNSTOPROCESS",1307041759:"IFCRELASSIGNSTOGROUP",2495723537:"IFCRELASSIGNSTOCONTROL",1683148259:"IFCRELASSIGNSTOACTOR",3939117080:"IFCRELASSIGNS",3454111270:"IFCRECTANGULARTRIMMEDSURFACE",2798486643:"IFCRECTANGULARPYRAMID",2770003689:"IFCRECTANGLEHOLLOWPROFILEDEF",3219374653:"IFCPROXY",1451395588:"IFCPROPERTYSET",4194566429:"IFCPROJECTIONCURVE",103090709:"IFCPROJECT",4208778838:"IFCPRODUCT",2945172077:"IFCPROCESS",220341763:"IFCPLANE",603570806:"IFCPLANARBOX",3566463478:"IFCPERMEABLECOVERINGPROPERTIES",3505215534:"IFCOFFSETCURVE3D",3388369263:"IFCOFFSETCURVE2D",3888040117:"IFCOBJECT",1425443689:"IFCMANIFOLDSOLIDBREP",1281925730:"IFCLINE",572779678:"IFCLSHAPEPROFILEDEF",1484403080:"IFCISHAPEPROFILEDEF",987898635:"IFCGEOMETRICCURVESET",1268542332:"IFCFURNITURETYPE",4238390223:"IFCFURNISHINGELEMENTTYPE",3455213021:"IFCFLUIDFLOWPROPERTIES",315944413:"IFCFILLAREASTYLETILES",4203026998:"IFCFILLAREASTYLETILESYMBOLWITHSTYLE",374418227:"IFCFILLAREASTYLEHATCHING",2047409740:"IFCFACEBASEDSURFACEMODEL",477187591:"IFCEXTRUDEDAREASOLID",80994333:"IFCENERGYPROPERTIES",2835456948:"IFCELLIPSEPROFILEDEF",2777663545:"IFCELEMENTARYSURFACE",339256511:"IFCELEMENTTYPE",1883228015:"IFCELEMENTQUANTITY",1472233963:"IFCEDGELOOP",4006246654:"IFCDRAUGHTINGPREDEFINEDCURVEFONT",445594917:"IFCDRAUGHTINGPREDEFINEDCOLOUR",3073041342:"IFCDRAUGHTINGCALLOUT",526551008:"IFCDOORSTYLE",1714330368:"IFCDOORPANELPROPERTIES",2963535650:"IFCDOORLININGPROPERTIES",32440307:"IFCDIRECTION",4054601972:"IFCDIMENSIONCURVETERMINATOR",606661476:"IFCDIMENSIONCURVE",693772133:"IFCDEFINEDSYMBOL",2827736869:"IFCCURVEBOUNDEDPLANE",2601014836:"IFCCURVE",2147822146:"IFCCSGSOLID",2506170314:"IFCCSGPRIMITIVE3D",194851669:"IFCCRANERAILFSHAPEPROFILEDEF",4133800736:"IFCCRANERAILASHAPEPROFILEDEF",2485617015:"IFCCOMPOSITECURVESEGMENT",2205249479:"IFCCLOSEDSHELL",1383045692:"IFCCIRCLEPROFILEDEF",1416205885:"IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM",3331915920:"IFCCARTESIANTRANSFORMATIONOPERATOR3D",3486308946:"IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM",3749851601:"IFCCARTESIANTRANSFORMATIONOPERATOR2D",59481748:"IFCCARTESIANTRANSFORMATIONOPERATOR",1123145078:"IFCCARTESIANPOINT",2898889636:"IFCCSHAPEPROFILEDEF",2713105998:"IFCBOXEDHALFSPACE",2581212453:"IFCBOUNDINGBOX",4182860854:"IFCBOUNDEDSURFACE",2736907675:"IFCBOOLEANRESULT",2740243338:"IFCAXIS2PLACEMENT3D",3125803723:"IFCAXIS2PLACEMENT2D",4261334040:"IFCAXIS1PLACEMENT",1302238472:"IFCANNOTATIONSURFACE",2265737646:"IFCANNOTATIONFILLAREAOCCURRENCE",669184980:"IFCANNOTATIONFILLAREA",3288037868:"IFCANNOTATIONCURVEOCCURRENCE",2543172580:"IFCZSHAPEPROFILEDEF",1299126871:"IFCWINDOWSTYLE",512836454:"IFCWINDOWPANELPROPERTIES",336235671:"IFCWINDOWLININGPROPERTIES",2759199220:"IFCVERTEXLOOP",1417489154:"IFCVECTOR",427810014:"IFCUSHAPEPROFILEDEF",2347495698:"IFCTYPEPRODUCT",1628702193:"IFCTYPEOBJECT",1345879162:"IFCTWODIRECTIONREPEATFACTOR",2715220739:"IFCTRAPEZIUMPROFILEDEF",3124975700:"IFCTEXTLITERALWITHEXTENT",4282788508:"IFCTEXTLITERAL",3028897424:"IFCTERMINATORSYMBOL",3071757647:"IFCTSHAPEPROFILEDEF",230924584:"IFCSWEPTSURFACE",1260650574:"IFCSWEPTDISKSOLID",2247615214:"IFCSWEPTAREASOLID",1878645084:"IFCSURFACESTYLERENDERING",2513912981:"IFCSURFACE",2233826070:"IFCSUBEDGE",3653947884:"IFCSTRUCTURALSTEELPROFILEPROPERTIES",3843319758:"IFCSTRUCTURALPROFILEPROPERTIES",1190533807:"IFCSTRUCTURALLOADSINGLEFORCEWARPING",1597423693:"IFCSTRUCTURALLOADSINGLEFORCE",1973038258:"IFCSTRUCTURALLOADSINGLEDISPLACEMENTDISTORTION",2473145415:"IFCSTRUCTURALLOADSINGLEDISPLACEMENT",2668620305:"IFCSTRUCTURALLOADPLANARFORCE",1595516126:"IFCSTRUCTURALLOADLINEARFORCE",390701378:"IFCSPACETHERMALLOADPROPERTIES",1202362311:"IFCSOUNDVALUE",2485662743:"IFCSOUNDPROPERTIES",723233188:"IFCSOLIDMODEL",2609359061:"IFCSLIPPAGECONNECTIONCONDITION",4124623270:"IFCSHELLBASEDSURFACEMODEL",2411513650:"IFCSERVICELIFEFACTOR",1509187699:"IFCSECTIONEDSPINE",2778083089:"IFCROUNDEDRECTANGLEPROFILEDEF",478536968:"IFCRELATIONSHIP",3765753017:"IFCREINFORCEMENTDEFINITIONPROPERTIES",3413951693:"IFCREGULARTIMESERIES",3615266464:"IFCRECTANGLEPROFILEDEF",110355661:"IFCPROPERTYTABLEVALUE",3650150729:"IFCPROPERTYSINGLEVALUE",3357820518:"IFCPROPERTYSETDEFINITION",941946838:"IFCPROPERTYREFERENCEVALUE",2752243245:"IFCPROPERTYLISTVALUE",4166981789:"IFCPROPERTYENUMERATEDVALUE",1680319473:"IFCPROPERTYDEFINITION",871118103:"IFCPROPERTYBOUNDEDVALUE",673634403:"IFCPRODUCTDEFINITIONSHAPE",179317114:"IFCPREDEFINEDPOINTMARKERSYMBOL",433424934:"IFCPREDEFINEDDIMENSIONSYMBOL",2559016684:"IFCPREDEFINEDCURVEFONT",759155922:"IFCPREDEFINEDCOLOUR",2775532180:"IFCPOLYGONALBOUNDEDHALFSPACE",2924175390:"IFCPOLYLOOP",1423911732:"IFCPOINTONSURFACE",4022376103:"IFCPOINTONCURVE",2067069095:"IFCPOINT",1663979128:"IFCPLANAREXTENT",2004835150:"IFCPLACEMENT",597895409:"IFCPIXELTEXTURE",3021840470:"IFCPHYSICALCOMPLEXQUANTITY",2519244187:"IFCPATH",2529465313:"IFCPARAMETERIZEDPROFILEDEF",1029017970:"IFCORIENTEDEDGE",2665983363:"IFCOPENSHELL",2833995503:"IFCONEDIRECTIONREPEATFACTOR",219451334:"IFCOBJECTDEFINITION",1430189142:"IFCMECHANICALCONCRETEMATERIALPROPERTIES",2022407955:"IFCMATERIALDEFINITIONREPRESENTATION",2347385850:"IFCMAPPEDITEM",1008929658:"IFCLOOP",2624227202:"IFCLOCALPLACEMENT",3422422726:"IFCLIGHTSOURCESPOT",1520743889:"IFCLIGHTSOURCEPOSITIONAL",4266656042:"IFCLIGHTSOURCEGONIOMETRIC",2604431987:"IFCLIGHTSOURCEDIRECTIONAL",125510826:"IFCLIGHTSOURCEAMBIENT",1402838566:"IFCLIGHTSOURCE",3741457305:"IFCIRREGULARTIMESERIES",3905492369:"IFCIMAGETEXTURE",2445078500:"IFCHYGROSCOPICMATERIALPROPERTIES",812098782:"IFCHALFSPACESOLID",178086475:"IFCGRIDPLACEMENT",3590301190:"IFCGEOMETRICSET",4142052618:"IFCGEOMETRICREPRESENTATIONSUBCONTEXT",2453401579:"IFCGEOMETRICREPRESENTATIONITEM",3448662350:"IFCGEOMETRICREPRESENTATIONCONTEXT",1446786286:"IFCGENERALPROFILEPROPERTIES",803998398:"IFCGENERALMATERIALPROPERTIES",3857492461:"IFCFUELPROPERTIES",738692330:"IFCFILLAREASTYLE",4219587988:"IFCFAILURECONNECTIONCONDITION",3008276851:"IFCFACESURFACE",803316827:"IFCFACEOUTERBOUND",1809719519:"IFCFACEBOUND",2556980723:"IFCFACE",1860660968:"IFCEXTENDEDMATERIALPROPERTIES",476780140:"IFCEDGECURVE",3900360178:"IFCEDGE",4170525392:"IFCDRAUGHTINGPREDEFINEDTEXTFONT",3732053477:"IFCDOCUMENTREFERENCE",1694125774:"IFCDIMENSIONPAIR",2273265877:"IFCDIMENSIONCALLOUTRELATIONSHIP",3632507154:"IFCDERIVEDPROFILEDEF",3800577675:"IFCCURVESTYLE",2889183280:"IFCCONVERSIONBASEDUNIT",3050246964:"IFCCONTEXTDEPENDENTUNIT",45288368:"IFCCONNECTIONPOINTECCENTRICITY",1981873012:"IFCCONNECTIONCURVEGEOMETRY",370225590:"IFCCONNECTEDFACESET",1485152156:"IFCCOMPOSITEPROFILEDEF",2542286263:"IFCCOMPLEXPROPERTY",776857604:"IFCCOLOURRGB",647927063:"IFCCLASSIFICATIONREFERENCE",3150382593:"IFCCENTERLINEPROFILEDEF",616511568:"IFCBLOBTEXTURE",2705031697:"IFCARBITRARYPROFILEDEFWITHVOIDS",1310608509:"IFCARBITRARYOPENPROFILEDEF",3798115385:"IFCARBITRARYCLOSEDPROFILEDEF",2297822566:"IFCANNOTATIONTEXTOCCURRENCE",3612888222:"IFCANNOTATIONSYMBOLOCCURRENCE",962685235:"IFCANNOTATIONSURFACEOCCURRENCE",2442683028:"IFCANNOTATIONOCCURRENCE",1065908215:"IFCWATERPROPERTIES",891718957:"IFCVIRTUALGRIDINTERSECTION",1907098498:"IFCVERTEXPOINT",3304826586:"IFCVERTEXBASEDTEXTUREMAP",2799835756:"IFCVERTEX",180925521:"IFCUNITASSIGNMENT",1735638870:"IFCTOPOLOGYREPRESENTATION",1377556343:"IFCTOPOLOGICALREPRESENTATIONITEM",581633288:"IFCTIMESERIESVALUE",1718945513:"IFCTIMESERIESREFERENCERELATIONSHIP",3101149627:"IFCTIMESERIES",3317419933:"IFCTHERMALMATERIALPROPERTIES",1210645708:"IFCTEXTUREVERTEX",2552916305:"IFCTEXTUREMAP",1742049831:"IFCTEXTURECOORDINATEGENERATOR",280115917:"IFCTEXTURECOORDINATE",1484833681:"IFCTEXTSTYLEWITHBOXCHARACTERISTICS",1640371178:"IFCTEXTSTYLETEXTMODEL",2636378356:"IFCTEXTSTYLEFORDEFINEDFONT",1983826977:"IFCTEXTSTYLEFONTMODEL",1447204868:"IFCTEXTSTYLE",912023232:"IFCTELECOMADDRESS",531007025:"IFCTABLEROW",985171141:"IFCTABLE",1290481447:"IFCSYMBOLSTYLE",626085974:"IFCSURFACETEXTURE",1351298697:"IFCSURFACESTYLEWITHTEXTURES",846575682:"IFCSURFACESTYLESHADING",1607154358:"IFCSURFACESTYLEREFRACTION",3303107099:"IFCSURFACESTYLELIGHTING",1300840506:"IFCSURFACESTYLE",3049322572:"IFCSTYLEDREPRESENTATION",3958052878:"IFCSTYLEDITEM",2830218821:"IFCSTYLEMODEL",3408363356:"IFCSTRUCTURALLOADTEMPERATURE",2525727697:"IFCSTRUCTURALLOADSTATIC",2162789131:"IFCSTRUCTURALLOAD",2273995522:"IFCSTRUCTURALCONNECTIONCONDITION",3692461612:"IFCSIMPLEPROPERTY",4240577450:"IFCSHAPEREPRESENTATION",3982875396:"IFCSHAPEMODEL",867548509:"IFCSHAPEASPECT",4165799628:"IFCSECTIONREINFORCEMENTPROPERTIES",2042790032:"IFCSECTIONPROPERTIES",448429030:"IFCSIUNIT",2341007311:"IFCROOT",3679540991:"IFCRIBPLATEPROFILEPROPERTIES",1660063152:"IFCREPRESENTATIONMAP",3008791417:"IFCREPRESENTATIONITEM",3377609919:"IFCREPRESENTATIONCONTEXT",1076942058:"IFCREPRESENTATION",1222501353:"IFCRELAXATION",1580146022:"IFCREINFORCEMENTBARPROPERTIES",2692823254:"IFCREFERENCESVALUEDOCUMENT",825690147:"IFCQUANTITYWEIGHT",2405470396:"IFCQUANTITYVOLUME",3252649465:"IFCQUANTITYTIME",931644368:"IFCQUANTITYLENGTH",2093928680:"IFCQUANTITYCOUNT",2044713172:"IFCQUANTITYAREA",3710013099:"IFCPROPERTYENUMERATION",148025276:"IFCPROPERTYDEPENDENCYRELATIONSHIP",3896028662:"IFCPROPERTYCONSTRAINTRELATIONSHIP",2598011224:"IFCPROPERTY",2802850158:"IFCPROFILEPROPERTIES",3958567839:"IFCPROFILEDEF",2267347899:"IFCPRODUCTSOFCOMBUSTIONPROPERTIES",2095639259:"IFCPRODUCTREPRESENTATION",2417041796:"IFCPRESENTATIONSTYLEASSIGNMENT",3119450353:"IFCPRESENTATIONSTYLE",1304840413:"IFCPRESENTATIONLAYERWITHSTYLE",2022622350:"IFCPRESENTATIONLAYERASSIGNMENT",1775413392:"IFCPREDEFINEDTEXTFONT",3213052703:"IFCPREDEFINEDTERMINATORSYMBOL",990879717:"IFCPREDEFINEDSYMBOL",3727388367:"IFCPREDEFINEDITEM",3355820592:"IFCPOSTALADDRESS",2226359599:"IFCPHYSICALSIMPLEQUANTITY",2483315170:"IFCPHYSICALQUANTITY",101040310:"IFCPERSONANDORGANIZATION",2077209135:"IFCPERSON",1207048766:"IFCOWNERHISTORY",1411181986:"IFCORGANIZATIONRELATIONSHIP",4251960020:"IFCORGANIZATION",1227763645:"IFCOPTICALMATERIALPROPERTIES",2251480897:"IFCOBJECTIVE",3701648758:"IFCOBJECTPLACEMENT",1918398963:"IFCNAMEDUNIT",2706619895:"IFCMONETARYUNIT",3368373690:"IFCMETRIC",677618848:"IFCMECHANICALSTEELMATERIALPROPERTIES",4256014907:"IFCMECHANICALMATERIALPROPERTIES",2597039031:"IFCMEASUREWITHUNIT",3265635763:"IFCMATERIALPROPERTIES",2199411900:"IFCMATERIALLIST",1303795690:"IFCMATERIALLAYERSETUSAGE",3303938423:"IFCMATERIALLAYERSET",248100487:"IFCMATERIALLAYER",1847130766:"IFCMATERIALCLASSIFICATIONRELATIONSHIP",1838606355:"IFCMATERIAL",30780891:"IFCLOCALTIME",1566485204:"IFCLIGHTINTENSITYDISTRIBUTION",4162380809:"IFCLIGHTDISTRIBUTIONDATA",3452421091:"IFCLIBRARYREFERENCE",2655187982:"IFCLIBRARYINFORMATION",3020489413:"IFCIRREGULARTIMESERIESVALUE",852622518:"IFCGRIDAXIS",3548104201:"IFCEXTERNALLYDEFINEDTEXTFONT",3207319532:"IFCEXTERNALLYDEFINEDSYMBOL",1040185647:"IFCEXTERNALLYDEFINEDSURFACESTYLE",2242383968:"IFCEXTERNALLYDEFINEDHATCHSTYLE",3200245327:"IFCEXTERNALREFERENCE",1648886627:"IFCENVIRONMENTALIMPACTVALUE",3796139169:"IFCDRAUGHTINGCALLOUTRELATIONSHIP",770865208:"IFCDOCUMENTINFORMATIONRELATIONSHIP",1154170062:"IFCDOCUMENTINFORMATION",1376555844:"IFCDOCUMENTELECTRONICFORMAT",2949456006:"IFCDIMENSIONALEXPONENTS",1045800335:"IFCDERIVEDUNITELEMENT",1765591967:"IFCDERIVEDUNIT",1072939445:"IFCDATEANDTIME",3510044353:"IFCCURVESTYLEFONTPATTERN",2367409068:"IFCCURVESTYLEFONTANDSCALING",1105321065:"IFCCURVESTYLEFONT",539742890:"IFCCURRENCYRELATIONSHIP",602808272:"IFCCOSTVALUE",1065062679:"IFCCOORDINATEDUNIVERSALTIMEOFFSET",347226245:"IFCCONSTRAINTRELATIONSHIP",613356794:"IFCCONSTRAINTCLASSIFICATIONRELATIONSHIP",1658513725:"IFCCONSTRAINTAGGREGATIONRELATIONSHIP",1959218052:"IFCCONSTRAINT",2732653382:"IFCCONNECTIONSURFACEGEOMETRY",4257277454:"IFCCONNECTIONPORTGEOMETRY",2614616156:"IFCCONNECTIONPOINTGEOMETRY",2859738748:"IFCCONNECTIONGEOMETRY",3264961684:"IFCCOLOURSPECIFICATION",3639012971:"IFCCLASSIFICATIONNOTATIONFACET",938368621:"IFCCLASSIFICATIONNOTATION",1098599126:"IFCCLASSIFICATIONITEMRELATIONSHIP",1767535486:"IFCCLASSIFICATIONITEM",747523909:"IFCCLASSIFICATION",622194075:"IFCCALENDARDATE",2069777674:"IFCBOUNDARYNODECONDITIONWARPING",1387855156:"IFCBOUNDARYNODECONDITION",3367102660:"IFCBOUNDARYFACECONDITION",1560379544:"IFCBOUNDARYEDGECONDITION",4037036970:"IFCBOUNDARYCONDITION",3869604511:"IFCAPPROVALRELATIONSHIP",390851274:"IFCAPPROVALPROPERTYRELATIONSHIP",2080292479:"IFCAPPROVALACTORRELATIONSHIP",130549933:"IFCAPPROVAL",1110488051:"IFCAPPLIEDVALUERELATIONSHIP",411424972:"IFCAPPLIEDVALUE",639542469:"IFCAPPLICATION",618182010:"IFCADDRESS",3630933823:"IFCACTORROLE",599546466:"FILE_DESCRIPTION",1390159747:"FILE_NAME",1109904537:"FILE_SCHEMA"};class Ze{static async getUnits(e){var r,o,a;const{IFCUNITASSIGNMENT:t}=jt,s=await e.getAllPropertiesOfType(t);if(!s)return 1;const i=Object.keys(s),n=s[parseInt(i[0],10)];for(const l of n.Units){if(l.value===void 0||l.value===null)continue;const h=await e.getProperties(l.value);if(!h||!h.UnitType||!h.UnitType.value||h.UnitType.value!=="LENGTHUNIT")continue;let d=1,f=1;return h.Name.value==="METRE"&&(f=1),h.Name.value==="FOOT"&&(f=.3048),((r=h.Prefix)==null?void 0:r.value)==="MILLI"?d=.001:((o=h.Prefix)==null?void 0:o.value)==="CENTI"?d=.01:((a=h.Prefix)==null?void 0:a.value)==="DECI"&&(d=.1),f*d}return 1}static async findItemByGuid(e,t){var i;const s=e.getAllPropertiesIDs();for(const n of s){const r=await e.getProperties(n);if(r&&((i=r.GlobalId)==null?void 0:i.value)===t)return r}return null}static async getRelationMap(e,t,s){var a;const n=s??(async()=>{}),r={},o=e.getAllPropertiesIDs();for(const l of o){const h=await e.getProperties(l);if(!h)continue;const u=h.type===t,d=Object.keys(h).find(E=>E.startsWith("Relating")),f=Object.keys(h).find(E=>E.startsWith("Related"));if(!(u&&d&&f))continue;const I=await e.getProperties((a=h[d])==null?void 0:a.value),p=h[f];if(!I||!p||!(p&&Array.isArray(p)))continue;const m=p.map(E=>E.value);await n(I.expressID,m),r[I.expressID]=m}return r}static async getQsetQuantities(e,t,s){const n=s??(()=>{}),r=await e.getProperties(t);return!r||r.type!==go?null:(r.Quantities??[{}]).map(l=>(l.value&&n(l.value),l.value)).filter(l=>l!==null)}static async getPsetProps(e,t,s){const n=s??(()=>{}),r=await e.getProperties(t);return!r||r.type!==Zi?null:(r.HasProperties??[{}]).map(l=>(l.value&&n(l.value),l.value)).filter(l=>l!==null)}static async getPsetRel(e,t){var o;if(!await e.getProperties(t))return null;const i=await e.getAllPropertiesOfType(Ns);if(!i)return null;const n=Object.values(i);let r=null;for(const a of n)((o=a.RelatingPropertyDefinition)==null?void 0:o.value)===t&&(r=a.expressID);return r}static async getQsetRel(e,t){return Ze.getPsetRel(e,t)}static async getEntityName(e,t){var r;const s=await e.getProperties(t);if(!s)return{key:null,name:null};const i=Object.keys(s).find(o=>o.endsWith("Name"))??null,n=i?(r=s[i])==null?void 0:r.value:null;return{key:i,name:n}}static async getQuantityValue(e,t){const s=await e.getProperties(t);if(!s)return{key:null,value:null};const i=Object.keys(s).find(r=>r.endsWith("Value"))??null;let n;return i===null||s[i]===void 0||s[i]===null?n=null:n=s[i].value,{key:i,value:n}}static isRel(e){return Wr[e].startsWith("IFCREL")}static async attributeExists(e,t,s){const i=await e.getProperties(t);return i?Object.keys(i).includes(s):!1}static async groupEntitiesByType(e,t){var i;const s=new Map;for(const n of t){const r=await e.getProperties(n);if(!r)continue;const o=r.type;s.get(o)||s.set(o,new Set),(i=s.get(o))==null||i.add(n)}return s}}class mc{constructor(){y(this,"factor",1);y(this,"complement",1)}apply(e){const s=this.getScaleMatrix().multiply(e);e.copy(s)}setUp(e){var n,r,o;this.factor=1;const t=this.getLengthUnits(e);if(!t)return;const s=t==null,i=t.Name===void 0||t.Name===null;s||i||(t.Name.value==="FOOT"&&(this.factor=.3048),((n=t.Prefix)==null?void 0:n.value)==="MILLI"?this.complement=.001:((r=t.Prefix)==null?void 0:r.value)==="CENTI"?this.complement=.01:((o=t.Prefix)==null?void 0:o.value)==="DECI"&&(this.complement=.01))}getLengthUnits(e){try{const s=e.GetLineIDsWithType(0,To).get(0),i=e.GetLine(0,s);for(const n of i.Units){if(!n||n.value===null||n.value===void 0)continue;const r=e.GetLine(0,n.value);if(r.UnitType&&r.UnitType.value==="LENGTHUNIT")return r}return null}catch{return console.log("Could not get units"),null}}getScaleMatrix(){const e=this.factor;return new Ft().fromArray([e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1])}}class Cc{constructor(){y(this,"itemsByFloor",{});y(this,"_units",new mc)}setUp(e){this._units.setUp(e),this.cleanUp();try{const t=e.GetLineIDsWithType(0,Ai),s=new Set,i=e.GetLineIDsWithType(0,bs);for(let l=0;l0&&!o.has(r))continue;if(this.settings.excludedCategories.has(r))continue;const a=this.webIfc.GetLineIDsWithType(0,r),l=a.size();for(let h=0;h{this.getMesh(r,s)});for(const r of this._visitedFragments){const{index:o,fragment:a}=r[1];s.keyFragments.set(o,a.id)}for(const r of s.items){const o=this._fragmentInstances.get(r.id);if(!o)throw new Error("Fragment not found!");const a=[];for(const[l,h]of o)a.push(h);r.add(a)}const n=this.webIfc.GetCoordinationMatrix(0);return s.coordinationMatrix.fromArray(n),s.civilData=this._civil.read(this.webIfc),s}getMesh(t,s){const i=t.geometries.size(),n=t.expressID;for(let r=0;ro.value!==i),await t.setProperties(i,null),this.registerChange(t,s,i))}addElementToPset(t,s,...i){this.components.get(Qe).addEntitiesRelation(t,s,{type:Ns,inv:"IsDefinedBy"},...i)}async addPropToPset(t,s,...i){const n=await t.getProperties(s);if(n){for(const r of i){if(n.HasProperties.includes(r))continue;const o=new he(r);n.HasProperties.push(o),this.onPropToPset.trigger({model:t,psetID:s,propID:r})}this.registerChange(t,s)}}async createIfcRel(t,s,i,n){const r=Oc[s];if(!r)throw new Error(`IfcPropertiesManager: ${r} is unsoported.`);const o=t.ifcMetadata.schema,a=yc[r],l=jt[o][r];if(!(a&&l))throw new Error(`IfcPropertiesManager: ${r} is unsoported.`);const h=[new jt[o].IfcGloballyUniqueId(fe.create())],{related:u,relating:d}=a,I=[...new Set(n)].map(E=>new he(E)),p=(E,_)=>{for(let A=E;A<_-1;A++)h.push(null)};uparseInt(o,10)),n=s[i[0]],r=new he(n.expressID);return{ownerHistory:n,ownerHistoryHandle:r}}registerChange(t,...s){this.changeMap[t.uuid]||(this.changeMap[t.uuid]=new Set);for(const i of s)this.changeMap[t.uuid].add(i),this.onDataChanged.trigger({model:t,expressID:i})}async newSingleProperty(t,s,i,n){const r=ge.getIFCSchema(t),o=new jt[r].IfcIdentifier(i),a=new jt[r][s](n),l=new jt[r].IfcPropertySingleValue(o,null,a,null);return l.expressID=this.getNewExpressID(t),await this.setData(t,l),l}};y(ge,"uuid","58c2d9f0-183c-48d6-a402-dfcf5b9a34df");let cn=ge;const Os=class Os extends Bt{constructor(t){super(t);y(this,"onDisposed",new et);y(this,"onRelationsIndexed",new et);y(this,"relationMaps",{});y(this,"enabled",!0);y(this,"_relToAttributesMap",Or);y(this,"_inverseAttributes",["IsDecomposedBy","Decomposes","AssociatedTo","HasAssociations","ClassificationForObjects","IsGroupedBy","HasAssignments","IsDefinedBy","DefinesOcurrence","IsTypedBy","Types","Defines","ContainedInStructure","ContainsElements","HasControlElements","AssignedToFlowElement","ConnectedTo","ConnectedFrom","ReferencedBy","Declares","HasContext","Controls","IsNestedBy","Nests","DocumentRefForObjects"]);y(this,"_ifcRels",[_i,Cn,gn,Tn,Ns,_n,An,Ai,Rn,yn,On,Fn,Sn,wn,Nn]);y(this,"onFragmentsDisposed",t=>{delete this.relationMaps[t.groupID]});y(this,"_changeMap",{});y(this,"onEntitiesRelated",new et);this.components.add(Os.uuid,this),t.get(gt).onFragmentsDisposed.add(this.onFragmentsDisposed)}indexRelations(t,s,i,n){const r=Object.keys(s).find(u=>u.startsWith("Relating")),o=Object.keys(s).find(u=>u.startsWith("Related"));if(!(r&&o))return;const a=s[r].value,l=s[o].map(u=>u.value),h=this.getAttributeIndex(n);if(h!==null){let u=t.get(a);u||(u=new Map,t.set(a,u));let d=u.get(h);d||(d=[],u.set(h,d)),d.push(...l)}for(const u of l){const d=this.getAttributeIndex(i);if(d===null)continue;let f=t.get(u);f||(f=new Map,t.set(u,f));let I=f.get(d);I||(I=[],f.set(d,I)),I.push(a)}}getAttributeIndex(t){const s=this._inverseAttributes.indexOf(t);return s===-1?null:s}setRelationMap(t,s){this.relationMaps[t.uuid]=s,this.onRelationsIndexed.trigger({modelID:t.uuid,relationsMap:s})}async process(t){if(!t.hasProperties)throw new Error("FragmentsGroup properties not found");let s=this.relationMaps[t.uuid];if(s)return s;s=new Map;for(const i of this._ifcRels){const n=await t.getAllPropertiesOfType(i);if(!n)continue;const r=this._relToAttributesMap.get(i);if(!r)continue;const{forRelated:o,forRelating:a}=r;for(const l in n){const h=n[l];this.indexRelations(s,h,o,a)}}return this.setRelationMap(t,s),s}async processFromWebIfc(t,s){const i=new Map;for(const n of this._ifcRels){const r=this._relToAttributesMap.get(n);if(!r)continue;const{forRelated:o,forRelating:a}=r,l=t.GetLineIDsWithType(s,n);for(let h=0;hE.startsWith("Related")),m=I.find(E=>E.startsWith("Relating"));if(!(p&&m))continue;f[p]=[...u].map(E=>new he(E)),f[m]=new he(l),await s.setData(n,f)}else{const f=await s.createIfcRel(n,o,l,[...u]);if(!f)continue;h.relID=f.expressID}}}}addEntitiesRelation(t,s,i,...n){const{type:r,inv:o}=i,a=this.relationMaps[t.uuid];if(!a||!this._ifcRels.includes(r))return;const l=Or.get(r);if(!l)return;const{forRelated:h,forRelating:u}=l;if(!(h===o||u===o))return;let d=this._changeMap[t.uuid];d||(d=new Re,this._changeMap[t.uuid]=d);const f=u===o?[s]:n,I=h===o?[s]:n;let p=d.get(r);p||(p=new Re,p.onItemSet.add(()=>this.onEntitiesRelated.trigger({invAttribute:o,relType:r,relatingIDs:f,relatedIDs:I})),p.onItemUpdated.add(()=>this.onEntitiesRelated.trigger({invAttribute:o,relType:r,relatingIDs:f,relatedIDs:I})),d.set(r,p));for(const m of f){let E=p.get(m);E||(E={related:new Xe},p.set(m,E)),E.related.add(...I)}for(const m of f){let E=a.get(m);E||(E=new Map,a.set(m,E));const _=this.getAttributeIndex(u);if(_!==null){let A=E.get(_);A||(A=[],E.set(_,A)),A.push(...I)}}for(const m of I){let E=a.get(m);E||(E=new Map,a.set(m,E));const _=this.getAttributeIndex(h);if(_===null)continue;let A=E.get(_);A||(A=[],E.set(_,A)),A.push(...f)}}getEntityChildren(t,s,i=new Set){if(i.add(s),this.relationMaps[t.uuid]===void 0)throw new Error("The provided model has no indices. You have to generate them first.");const r=this.getEntityRelations(t,s,"IsDecomposedBy");if(r)for(const a of r)this.getEntityChildren(t,a,i);const o=this.getEntityRelations(t,s,"ContainsElements");if(o)for(const a of o)this.getEntityChildren(t,a,i);return i}};y(Os,"uuid","23a889ab-83b3-44a4-8bee-ead83438370b");let Qe=Os;const Ei=class Ei extends Bt{constructor(t){super(t);y(this,"onDisposed",new et);y(this,"onFragmentsLoaded",new et);y(this,"onFragmentsDisposed",new et);y(this,"list",new Re);y(this,"groups",new Re);y(this,"baseCoordinationModel","");y(this,"baseCoordinationMatrix",new Ft);y(this,"enabled",!0);y(this,"_loader",new xo);this.components.add(Ei.uuid,this)}get meshes(){const t=[];for(const[s,i]of this.list)t.push(i.mesh);return t}dispose(){for(const[t,s]of this.groups)s.dispose(!0);this.baseCoordinationModel="",this.groups.clear(),this.list.clear(),this.onFragmentsLoaded.reset(),this.onFragmentsDisposed.reset(),this.onDisposed.trigger(),this.onDisposed.reset()}disposeGroup(t){const{uuid:s}=t,i=[];for(const n of t.items)i.push(n.id),this.list.delete(n.id);t.dispose(!0),this.groups.delete(t.uuid),this.groups.size===0&&(this.baseCoordinationModel="",this.baseCoordinationMatrix=new Ft),this.onFragmentsDisposed.trigger({groupID:s,fragmentIDs:i})}load(t,s){const n={...{coordinate:!0},...s},{coordinate:r,name:o,properties:a,relationsMap:l}=n,h=this._loader.import(t);s&&(h.isStreamed=s.isStreamed||!1),o&&(h.name=o);for(const u of h.items)u.group=h,this.list.set(u.id,u);return r&&this.coordinate([h]),this.groups.set(h.uuid,h),a&&h.setLocalProperties(a),l&&this.components.get(Qe).setRelationMap(h,l),this.onFragmentsLoaded.trigger(h),h}export(t){return this._loader.export(t)}getModelIdMap(t){const s={};for(const i in t){const n=this.list.get(i);if(!(n&&n.group))continue;const r=n.group;r.uuid in s||(s[r.uuid]=new Set);const o=t[i];for(const a of o)s[r.uuid].add(a)}return s}modelIdToFragmentIdMap(t){let s={};for(const i in t){const n=this.groups.get(i);if(!n)continue;const r=t[i],o=n.getFragmentMap(r);s={...s,...o}}return s}guidToFragmentIdMap(t){const s={};for(const[n,r]of this.groups){n in s||(s[n]=new Set);for(const o of t){const a=r.globalToExpressIDs.get(o);a&&s[n].add(a)}}return this.modelIdToFragmentIdMap(s)}coordinate(t=Array.from(this.groups.values())){if(this.baseCoordinationModel.length===0){const i=t.pop();if(!i)return;this.baseCoordinationModel=i.uuid,this.baseCoordinationMatrix=i.coordinationMatrix.clone()}if(t.length)for(const i of t)i.coordinationMatrix.equals(this.baseCoordinationMatrix)||(i.position.set(0,0,0),i.rotation.set(0,0,0),i.scale.set(1,1,1),i.updateMatrix(),this.applyBaseCoordinateSystem(i,i.coordinationMatrix))}applyBaseCoordinateSystem(t,s){s&&t.applyMatrix4(s.clone().invert()),t.applyMatrix4(this.baseCoordinationMatrix)}clone(t,s){const i=t.cloneGroup(s);this.groups.set(i.uuid,i);for(const n of i.items)this.list.set(n.id,n);return i}};y(Ei,"uuid","fef46874-46a3-461b-8c44-2922ab77c806");let gt=Ei;function ii(c){throw new Error('Could not dynamically require "'+c+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Xr={exports:{}};/*! - -JSZip v3.10.1 - A JavaScript class for generating and reading zip files - - -(c) 2009-2016 Stuart Knightley -Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. - -JSZip uses the library pako released under the MIT license : -https://github.com/nodeca/pako/blob/main/LICENSE -*/(function(c,e){(function(t){c.exports=t()})(function(){return function t(s,i,n){function r(l,h){if(!i[l]){if(!s[l]){var u=typeof ii=="function"&ⅈif(!h&&u)return u(l,!0);if(o)return o(l,!0);var d=new Error("Cannot find module '"+l+"'");throw d.code="MODULE_NOT_FOUND",d}var f=i[l]={exports:{}};s[l][0].call(f.exports,function(I){var p=s[l][1][I];return r(p||I)},f,f.exports,t,s,i,n)}return i[l].exports}for(var o=typeof ii=="function"&&ii,a=0;a>2,f=(3&l)<<4|h>>4,I=1>6:64,p=2>4,h=(15&d)<<4|(f=o.indexOf(a.charAt(p++)))>>2,u=(3&f)<<6|(I=o.indexOf(a.charAt(p++))),_[m++]=l,f!==64&&(_[m++]=h),I!==64&&(_[m++]=u);return _}},{"./support":30,"./utils":32}],2:[function(t,s,i){var n=t("./external"),r=t("./stream/DataWorker"),o=t("./stream/Crc32Probe"),a=t("./stream/DataLengthProbe");function l(h,u,d,f,I){this.compressedSize=h,this.uncompressedSize=u,this.crc32=d,this.compression=f,this.compressedContent=I}l.prototype={getContentWorker:function(){var h=new r(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),u=this;return h.on("end",function(){if(this.streamInfo.data_length!==u.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),h},getCompressedWorker:function(){return new r(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},l.createWorkerFrom=function(h,u,d){return h.pipe(new o).pipe(new a("uncompressedSize")).pipe(u.compressWorker(d)).pipe(new a("compressedSize")).withStreamInfo("compression",u)},s.exports=l},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,s,i){var n=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,s,i){var n=t("./utils"),r=function(){for(var o,a=[],l=0;l<256;l++){o=l;for(var h=0;h<8;h++)o=1&o?3988292384^o>>>1:o>>>1;a[l]=o}return a}();s.exports=function(o,a){return o!==void 0&&o.length?n.getTypeOf(o)!=="string"?function(l,h,u,d){var f=r,I=d+u;l^=-1;for(var p=d;p>>8^f[255&(l^h[p])];return-1^l}(0|a,o,o.length,0):function(l,h,u,d){var f=r,I=d+u;l^=-1;for(var p=d;p>>8^f[255&(l^h.charCodeAt(p))];return-1^l}(0|a,o,o.length,0):0}},{"./utils":32}],5:[function(t,s,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,s,i){var n=null;n=typeof Promise<"u"?Promise:t("lie"),s.exports={Promise:n}},{lie:37}],7:[function(t,s,i){var n=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",r=t("pako"),o=t("./utils"),a=t("./stream/GenericWorker"),l=n?"uint8array":"array";function h(u,d){a.call(this,"FlateWorker/"+u),this._pako=null,this._pakoAction=u,this._pakoOptions=d,this.meta={}}i.magic="\b\0",o.inherits(h,a),h.prototype.processChunk=function(u){this.meta=u.meta,this._pako===null&&this._createPako(),this._pako.push(o.transformTo(l,u.data),!1)},h.prototype.flush=function(){a.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var u=this;this._pako.onData=function(d){u.push({data:d,meta:u.meta})}},i.compressWorker=function(u){return new h("Deflate",u)},i.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,s,i){function n(f,I){var p,m="";for(p=0;p>>=8;return m}function r(f,I,p,m,E,_){var A,T,R=f.file,F=f.compression,w=_!==l.utf8encode,L=o.transformTo("string",_(R.name)),N=o.transformTo("string",l.utf8encode(R.name)),M=R.comment,z=o.transformTo("string",_(M)),O=o.transformTo("string",l.utf8encode(M)),P=N.length!==R.name.length,C=O.length!==M.length,v="",$="",Y="",q=R.dir,G=R.date,it={crc32:0,compressedSize:0,uncompressedSize:0};I&&!p||(it.crc32=f.crc32,it.compressedSize=f.compressedSize,it.uncompressedSize=f.uncompressedSize);var B=0;I&&(B|=8),w||!P&&!C||(B|=2048);var U=0,nt=0;q&&(U|=16),E==="UNIX"?(nt=798,U|=function(K,_t){var Pt=K;return K||(Pt=_t?16893:33204),(65535&Pt)<<16}(R.unixPermissions,q)):(nt=20,U|=function(K){return 63&(K||0)}(R.dosPermissions)),A=G.getUTCHours(),A<<=6,A|=G.getUTCMinutes(),A<<=5,A|=G.getUTCSeconds()/2,T=G.getUTCFullYear()-1980,T<<=4,T|=G.getUTCMonth()+1,T<<=5,T|=G.getUTCDate(),P&&($=n(1,1)+n(h(L),4)+N,v+="up"+n($.length,2)+$),C&&(Y=n(1,1)+n(h(z),4)+O,v+="uc"+n(Y.length,2)+Y);var J="";return J+=` -\0`,J+=n(B,2),J+=F.magic,J+=n(A,2),J+=n(T,2),J+=n(it.crc32,4),J+=n(it.compressedSize,4),J+=n(it.uncompressedSize,4),J+=n(L.length,2),J+=n(v.length,2),{fileRecord:u.LOCAL_FILE_HEADER+J+L+v,dirRecord:u.CENTRAL_FILE_HEADER+n(nt,2)+J+n(z.length,2)+"\0\0\0\0"+n(U,4)+n(m,4)+L+v+z}}var o=t("../utils"),a=t("../stream/GenericWorker"),l=t("../utf8"),h=t("../crc32"),u=t("../signature");function d(f,I,p,m){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=I,this.zipPlatform=p,this.encodeFileName=m,this.streamFiles=f,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(d,a),d.prototype.push=function(f){var I=f.meta.percent||0,p=this.entriesCount,m=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,a.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:p?(I+100*(p-m-1))/p:100}}))},d.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var I=this.streamFiles&&!f.file.dir;if(I){var p=r(f,I,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:p.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(f){this.accumulate=!1;var I=this.streamFiles&&!f.file.dir,p=r(f,I,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(p.dirRecord),I)this.push({data:function(m){return u.DATA_DESCRIPTOR+n(m.crc32,4)+n(m.compressedSize,4)+n(m.uncompressedSize,4)}(f),meta:{percent:100}});else for(this.push({data:p.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var f=this.bytesWritten,I=0;I=this.index;a--)l=(l<<8)+this.byteAt(a);return this.index+=o,l},readString:function(o){return n.transformTo("string",this.readData(o))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var o=this.readInt(4);return new Date(Date.UTC(1980+(o>>25&127),(o>>21&15)-1,o>>16&31,o>>11&31,o>>5&63,(31&o)<<1))}},s.exports=r},{"../utils":32}],19:[function(t,s,i){var n=t("./Uint8ArrayReader");function r(o){n.call(this,o)}t("../utils").inherits(r,n),r.prototype.readData=function(o){this.checkOffset(o);var a=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,a},s.exports=r},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,s,i){var n=t("./DataReader");function r(o){n.call(this,o)}t("../utils").inherits(r,n),r.prototype.byteAt=function(o){return this.data.charCodeAt(this.zero+o)},r.prototype.lastIndexOfSignature=function(o){return this.data.lastIndexOf(o)-this.zero},r.prototype.readAndCheckSignature=function(o){return o===this.readData(4)},r.prototype.readData=function(o){this.checkOffset(o);var a=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,a},s.exports=r},{"../utils":32,"./DataReader":18}],21:[function(t,s,i){var n=t("./ArrayReader");function r(o){n.call(this,o)}t("../utils").inherits(r,n),r.prototype.readData=function(o){if(this.checkOffset(o),o===0)return new Uint8Array(0);var a=this.data.subarray(this.zero+this.index,this.zero+this.index+o);return this.index+=o,a},s.exports=r},{"../utils":32,"./ArrayReader":17}],22:[function(t,s,i){var n=t("../utils"),r=t("../support"),o=t("./ArrayReader"),a=t("./StringReader"),l=t("./NodeBufferReader"),h=t("./Uint8ArrayReader");s.exports=function(u){var d=n.getTypeOf(u);return n.checkSupport(d),d!=="string"||r.uint8array?d==="nodebuffer"?new l(u):r.uint8array?new h(n.transformTo("uint8array",u)):new o(n.transformTo("array",u)):new a(u)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,s,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,s,i){var n=t("./GenericWorker"),r=t("../utils");function o(a){n.call(this,"ConvertWorker to "+a),this.destType=a}r.inherits(o,n),o.prototype.processChunk=function(a){this.push({data:r.transformTo(this.destType,a.data),meta:a.meta})},s.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(t,s,i){var n=t("./GenericWorker"),r=t("../crc32");function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(o,n),o.prototype.processChunk=function(a){this.streamInfo.crc32=r(a.data,this.streamInfo.crc32||0),this.push(a)},s.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,s,i){var n=t("../utils"),r=t("./GenericWorker");function o(a){r.call(this,"DataLengthProbe for "+a),this.propName=a,this.withStreamInfo(a,0)}n.inherits(o,r),o.prototype.processChunk=function(a){if(a){var l=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=l+a.data.length}r.prototype.processChunk.call(this,a)},s.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(t,s,i){var n=t("../utils"),r=t("./GenericWorker");function o(a){r.call(this,"DataWorker");var l=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,a.then(function(h){l.dataIsReady=!0,l.data=h,l.max=h&&h.length||0,l.type=n.getTypeOf(h),l.isPaused||l._tickAndRepeat()},function(h){l.error(h)})}n.inherits(o,r),o.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var a=null,l=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":a=this.data.substring(this.index,l);break;case"uint8array":a=this.data.subarray(this.index,l);break;case"array":case"nodebuffer":a=this.data.slice(this.index,l)}return this.index=l,this.push({data:a,meta:{percent:this.max?this.index/this.max*100:0}})},s.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(t,s,i){function n(r){this.name=r||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(r){this.emit("data",r)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(r){this.emit("error",r)}return!0},error:function(r){return!this.isFinished&&(this.isPaused?this.generatedError=r:(this.isFinished=!0,this.emit("error",r),this.previous&&this.previous.error(r),this.cleanUp()),!0)},on:function(r,o){return this._listeners[r].push(o),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(r,o){if(this._listeners[r])for(var a=0;a "+r:r}},s.exports=n},{}],29:[function(t,s,i){var n=t("../utils"),r=t("./ConvertWorker"),o=t("./GenericWorker"),a=t("../base64"),l=t("../support"),h=t("../external"),u=null;if(l.nodestream)try{u=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function d(I,p){return new h.Promise(function(m,E){var _=[],A=I._internalType,T=I._outputType,R=I._mimeType;I.on("data",function(F,w){_.push(F),p&&p(w)}).on("error",function(F){_=[],E(F)}).on("end",function(){try{var F=function(w,L,N){switch(w){case"blob":return n.newBlob(n.transformTo("arraybuffer",L),N);case"base64":return a.encode(L);default:return n.transformTo(w,L)}}(T,function(w,L){var N,M=0,z=null,O=0;for(N=0;N"u")i.blob=!1;else{var n=new ArrayBuffer(0);try{i.blob=new Blob([n],{type:"application/zip"}).size===0}catch{try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);r.append(n),i.blob=r.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!t("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(t,s,i){for(var n=t("./utils"),r=t("./support"),o=t("./nodejsUtils"),a=t("./stream/GenericWorker"),l=new Array(256),h=0;h<256;h++)l[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;l[254]=l[254]=1;function u(){a.call(this,"utf-8 decode"),this.leftOver=null}function d(){a.call(this,"utf-8 encode")}i.utf8encode=function(f){return r.nodebuffer?o.newBufferFrom(f,"utf-8"):function(I){var p,m,E,_,A,T=I.length,R=0;for(_=0;_>>6:(m<65536?p[A++]=224|m>>>12:(p[A++]=240|m>>>18,p[A++]=128|m>>>12&63),p[A++]=128|m>>>6&63),p[A++]=128|63&m);return p}(f)},i.utf8decode=function(f){return r.nodebuffer?n.transformTo("nodebuffer",f).toString("utf-8"):function(I){var p,m,E,_,A=I.length,T=new Array(2*A);for(p=m=0;p>10&1023,T[m++]=56320|1023&E)}return T.length!==m&&(T.subarray?T=T.subarray(0,m):T.length=m),n.applyFromCharCode(T)}(f=n.transformTo(r.uint8array?"uint8array":"array",f))},n.inherits(u,a),u.prototype.processChunk=function(f){var I=n.transformTo(r.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var p=I;(I=new Uint8Array(p.length+this.leftOver.length)).set(this.leftOver,0),I.set(p,this.leftOver.length)}else I=this.leftOver.concat(I);this.leftOver=null}var m=function(_,A){var T;for((A=A||_.length)>_.length&&(A=_.length),T=A-1;0<=T&&(192&_[T])==128;)T--;return T<0||T===0?A:T+l[_[T]]>A?T:A}(I),E=I;m!==I.length&&(r.uint8array?(E=I.subarray(0,m),this.leftOver=I.subarray(m,I.length)):(E=I.slice(0,m),this.leftOver=I.slice(m,I.length))),this.push({data:i.utf8decode(E),meta:f.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=u,n.inherits(d,a),d.prototype.processChunk=function(f){this.push({data:i.utf8encode(f.data),meta:f.meta})},i.Utf8EncodeWorker=d},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,s,i){var n=t("./support"),r=t("./base64"),o=t("./nodejsUtils"),a=t("./external");function l(p){return p}function h(p,m){for(var E=0;E>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=n(this.extraFields[1].value);this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var I,p,m,E=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4>>6:(f<65536?d[m++]=224|f>>>12:(d[m++]=240|f>>>18,d[m++]=128|f>>>12&63),d[m++]=128|f>>>6&63),d[m++]=128|63&f);return d},i.buf2binstring=function(u){return h(u,u.length)},i.binstring2buf=function(u){for(var d=new n.Buf8(u.length),f=0,I=d.length;f>10&1023,_[I++]=56320|1023&p)}return h(_,I)},i.utf8border=function(u,d){var f;for((d=d||u.length)>u.length&&(d=u.length),f=d-1;0<=f&&(192&u[f])==128;)f--;return f<0||f===0?d:f+a[u[f]]>d?f:d}},{"./common":41}],43:[function(t,s,i){s.exports=function(n,r,o,a){for(var l=65535&n|0,h=n>>>16&65535|0,u=0;o!==0;){for(o-=u=2e3>>1:r>>>1;o[a]=r}return o}();s.exports=function(r,o,a,l){var h=n,u=l+a;r^=-1;for(var d=l;d>>8^h[255&(r^o[d])];return-1^r}},{}],46:[function(t,s,i){var n,r=t("../utils/common"),o=t("./trees"),a=t("./adler32"),l=t("./crc32"),h=t("./messages"),u=0,d=4,f=0,I=-2,p=-1,m=4,E=2,_=8,A=9,T=286,R=30,F=19,w=2*T+1,L=15,N=3,M=258,z=M+N+1,O=42,P=113,C=1,v=2,$=3,Y=4;function q(g,H){return g.msg=h[H],H}function G(g){return(g<<1)-(4g.avail_out&&(k=g.avail_out),k!==0&&(r.arraySet(g.output,H.pending_buf,H.pending_out,k,g.next_out),g.next_out+=k,H.pending_out+=k,g.total_out+=k,g.avail_out-=k,H.pending-=k,H.pending===0&&(H.pending_out=0))}function U(g,H){o._tr_flush_block(g,0<=g.block_start?g.block_start:-1,g.strstart-g.block_start,H),g.block_start=g.strstart,B(g.strm)}function nt(g,H){g.pending_buf[g.pending++]=H}function J(g,H){g.pending_buf[g.pending++]=H>>>8&255,g.pending_buf[g.pending++]=255&H}function K(g,H){var k,b,S=g.max_chain_length,x=g.strstart,X=g.prev_length,Z=g.nice_match,D=g.strstart>g.w_size-z?g.strstart-(g.w_size-z):0,j=g.window,tt=g.w_mask,Q=g.prev,rt=g.strstart+M,Et=j[x+X-1],ht=j[x+X];g.prev_length>=g.good_match&&(S>>=2),Z>g.lookahead&&(Z=g.lookahead);do if(j[(k=H)+X]===ht&&j[k+X-1]===Et&&j[k]===j[x]&&j[++k]===j[x+1]){x+=2,k++;do;while(j[++x]===j[++k]&&j[++x]===j[++k]&&j[++x]===j[++k]&&j[++x]===j[++k]&&j[++x]===j[++k]&&j[++x]===j[++k]&&j[++x]===j[++k]&&j[++x]===j[++k]&&xD&&--S!=0);return X<=g.lookahead?X:g.lookahead}function _t(g){var H,k,b,S,x,X,Z,D,j,tt,Q=g.w_size;do{if(S=g.window_size-g.lookahead-g.strstart,g.strstart>=Q+(Q-z)){for(r.arraySet(g.window,g.window,Q,Q,0),g.match_start-=Q,g.strstart-=Q,g.block_start-=Q,H=k=g.hash_size;b=g.head[--H],g.head[H]=Q<=b?b-Q:0,--k;);for(H=k=Q;b=g.prev[--H],g.prev[H]=Q<=b?b-Q:0,--k;);S+=Q}if(g.strm.avail_in===0)break;if(X=g.strm,Z=g.window,D=g.strstart+g.lookahead,j=S,tt=void 0,tt=X.avail_in,j=N)for(x=g.strstart-g.insert,g.ins_h=g.window[x],g.ins_h=(g.ins_h<=N&&(g.ins_h=(g.ins_h<=N)if(b=o._tr_tally(g,g.strstart-g.match_start,g.match_length-N),g.lookahead-=g.match_length,g.match_length<=g.max_lazy_match&&g.lookahead>=N){for(g.match_length--;g.strstart++,g.ins_h=(g.ins_h<=N&&(g.ins_h=(g.ins_h<=N&&g.match_length<=g.prev_length){for(S=g.strstart+g.lookahead-N,b=o._tr_tally(g,g.strstart-1-g.prev_match,g.prev_length-N),g.lookahead-=g.prev_length-1,g.prev_length-=2;++g.strstart<=S&&(g.ins_h=(g.ins_h<g.pending_buf_size-5&&(k=g.pending_buf_size-5);;){if(g.lookahead<=1){if(_t(g),g.lookahead===0&&H===u)return C;if(g.lookahead===0)break}g.strstart+=g.lookahead,g.lookahead=0;var b=g.block_start+k;if((g.strstart===0||g.strstart>=b)&&(g.lookahead=g.strstart-b,g.strstart=b,U(g,!1),g.strm.avail_out===0)||g.strstart-g.block_start>=g.w_size-z&&(U(g,!1),g.strm.avail_out===0))return C}return g.insert=0,H===d?(U(g,!0),g.strm.avail_out===0?$:Y):(g.strstart>g.block_start&&(U(g,!1),g.strm.avail_out),C)}),new dt(4,4,8,4,Pt),new dt(4,5,16,8,Pt),new dt(4,6,32,32,Pt),new dt(4,4,16,16,lt),new dt(8,16,32,32,lt),new dt(8,16,128,128,lt),new dt(8,32,128,256,lt),new dt(32,128,258,1024,lt),new dt(32,258,258,4096,lt)],i.deflateInit=function(g,H){return $t(g,H,_,15,8,0)},i.deflateInit2=$t,i.deflateReset=se,i.deflateResetKeep=At,i.deflateSetHeader=function(g,H){return g&&g.state?g.state.wrap!==2?I:(g.state.gzhead=H,f):I},i.deflate=function(g,H){var k,b,S,x;if(!g||!g.state||5>8&255),nt(b,b.gzhead.time>>16&255),nt(b,b.gzhead.time>>24&255),nt(b,b.level===9?2:2<=b.strategy||b.level<2?4:0),nt(b,255&b.gzhead.os),b.gzhead.extra&&b.gzhead.extra.length&&(nt(b,255&b.gzhead.extra.length),nt(b,b.gzhead.extra.length>>8&255)),b.gzhead.hcrc&&(g.adler=l(g.adler,b.pending_buf,b.pending,0)),b.gzindex=0,b.status=69):(nt(b,0),nt(b,0),nt(b,0),nt(b,0),nt(b,0),nt(b,b.level===9?2:2<=b.strategy||b.level<2?4:0),nt(b,3),b.status=P);else{var X=_+(b.w_bits-8<<4)<<8;X|=(2<=b.strategy||b.level<2?0:b.level<6?1:b.level===6?2:3)<<6,b.strstart!==0&&(X|=32),X+=31-X%31,b.status=P,J(b,X),b.strstart!==0&&(J(b,g.adler>>>16),J(b,65535&g.adler)),g.adler=1}if(b.status===69)if(b.gzhead.extra){for(S=b.pending;b.gzindex<(65535&b.gzhead.extra.length)&&(b.pending!==b.pending_buf_size||(b.gzhead.hcrc&&b.pending>S&&(g.adler=l(g.adler,b.pending_buf,b.pending-S,S)),B(g),S=b.pending,b.pending!==b.pending_buf_size));)nt(b,255&b.gzhead.extra[b.gzindex]),b.gzindex++;b.gzhead.hcrc&&b.pending>S&&(g.adler=l(g.adler,b.pending_buf,b.pending-S,S)),b.gzindex===b.gzhead.extra.length&&(b.gzindex=0,b.status=73)}else b.status=73;if(b.status===73)if(b.gzhead.name){S=b.pending;do{if(b.pending===b.pending_buf_size&&(b.gzhead.hcrc&&b.pending>S&&(g.adler=l(g.adler,b.pending_buf,b.pending-S,S)),B(g),S=b.pending,b.pending===b.pending_buf_size)){x=1;break}x=b.gzindexS&&(g.adler=l(g.adler,b.pending_buf,b.pending-S,S)),x===0&&(b.gzindex=0,b.status=91)}else b.status=91;if(b.status===91)if(b.gzhead.comment){S=b.pending;do{if(b.pending===b.pending_buf_size&&(b.gzhead.hcrc&&b.pending>S&&(g.adler=l(g.adler,b.pending_buf,b.pending-S,S)),B(g),S=b.pending,b.pending===b.pending_buf_size)){x=1;break}x=b.gzindexS&&(g.adler=l(g.adler,b.pending_buf,b.pending-S,S)),x===0&&(b.status=103)}else b.status=103;if(b.status===103&&(b.gzhead.hcrc?(b.pending+2>b.pending_buf_size&&B(g),b.pending+2<=b.pending_buf_size&&(nt(b,255&g.adler),nt(b,g.adler>>8&255),g.adler=0,b.status=P)):b.status=P),b.pending!==0){if(B(g),g.avail_out===0)return b.last_flush=-1,f}else if(g.avail_in===0&&G(H)<=G(k)&&H!==d)return q(g,-5);if(b.status===666&&g.avail_in!==0)return q(g,-5);if(g.avail_in!==0||b.lookahead!==0||H!==u&&b.status!==666){var Z=b.strategy===2?function(D,j){for(var tt;;){if(D.lookahead===0&&(_t(D),D.lookahead===0)){if(j===u)return C;break}if(D.match_length=0,tt=o._tr_tally(D,0,D.window[D.strstart]),D.lookahead--,D.strstart++,tt&&(U(D,!1),D.strm.avail_out===0))return C}return D.insert=0,j===d?(U(D,!0),D.strm.avail_out===0?$:Y):D.last_lit&&(U(D,!1),D.strm.avail_out===0)?C:v}(b,H):b.strategy===3?function(D,j){for(var tt,Q,rt,Et,ht=D.window;;){if(D.lookahead<=M){if(_t(D),D.lookahead<=M&&j===u)return C;if(D.lookahead===0)break}if(D.match_length=0,D.lookahead>=N&&0D.lookahead&&(D.match_length=D.lookahead)}if(D.match_length>=N?(tt=o._tr_tally(D,1,D.match_length-N),D.lookahead-=D.match_length,D.strstart+=D.match_length,D.match_length=0):(tt=o._tr_tally(D,0,D.window[D.strstart]),D.lookahead--,D.strstart++),tt&&(U(D,!1),D.strm.avail_out===0))return C}return D.insert=0,j===d?(U(D,!0),D.strm.avail_out===0?$:Y):D.last_lit&&(U(D,!1),D.strm.avail_out===0)?C:v}(b,H):n[b.level].func(b,H);if(Z!==$&&Z!==Y||(b.status=666),Z===C||Z===$)return g.avail_out===0&&(b.last_flush=-1),f;if(Z===v&&(H===1?o._tr_align(b):H!==5&&(o._tr_stored_block(b,0,0,!1),H===3&&(it(b.head),b.lookahead===0&&(b.strstart=0,b.block_start=0,b.insert=0))),B(g),g.avail_out===0))return b.last_flush=-1,f}return H!==d?f:b.wrap<=0?1:(b.wrap===2?(nt(b,255&g.adler),nt(b,g.adler>>8&255),nt(b,g.adler>>16&255),nt(b,g.adler>>24&255),nt(b,255&g.total_in),nt(b,g.total_in>>8&255),nt(b,g.total_in>>16&255),nt(b,g.total_in>>24&255)):(J(b,g.adler>>>16),J(b,65535&g.adler)),B(g),0=k.w_size&&(x===0&&(it(k.head),k.strstart=0,k.block_start=0,k.insert=0),j=new r.Buf8(k.w_size),r.arraySet(j,H,tt-k.w_size,k.w_size,0),H=j,tt=k.w_size),X=g.avail_in,Z=g.next_in,D=g.input,g.avail_in=tt,g.next_in=0,g.input=H,_t(k);k.lookahead>=N;){for(b=k.strstart,S=k.lookahead-(N-1);k.ins_h=(k.ins_h<>>=N=L>>>24,A-=N,(N=L>>>16&255)===0)v[h++]=65535&L;else{if(!(16&N)){if(!(64&N)){L=T[(65535&L)+(_&(1<>>=N,A-=N),A<15&&(_+=C[a++]<>>=N=L>>>24,A-=N,!(16&(N=L>>>16&255))){if(!(64&N)){L=R[(65535&L)+(_&(1<>>=N,A-=N,(N=h-u)>3,_&=(1<<(A-=M<<3))-1,n.next_in=a,n.next_out=h,n.avail_in=a>>24&255)+(O>>>8&65280)+((65280&O)<<8)+((255&O)<<24)}function _(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function A(O){var P;return O&&O.state?(P=O.state,O.total_in=O.total_out=P.total=0,O.msg="",P.wrap&&(O.adler=1&P.wrap),P.mode=I,P.last=0,P.havedict=0,P.dmax=32768,P.head=null,P.hold=0,P.bits=0,P.lencode=P.lendyn=new n.Buf32(p),P.distcode=P.distdyn=new n.Buf32(m),P.sane=1,P.back=-1,d):f}function T(O){var P;return O&&O.state?((P=O.state).wsize=0,P.whave=0,P.wnext=0,A(O)):f}function R(O,P){var C,v;return O&&O.state?(v=O.state,P<0?(C=0,P=-P):(C=1+(P>>4),P<48&&(P&=15)),P&&(P<8||15=Y.wsize?(n.arraySet(Y.window,P,C-Y.wsize,Y.wsize,0),Y.wnext=0,Y.whave=Y.wsize):(v<($=Y.wsize-Y.wnext)&&($=v),n.arraySet(Y.window,P,C-v,$,Y.wnext),(v-=$)?(n.arraySet(Y.window,P,C-v,v,0),Y.wnext=v,Y.whave=Y.wsize):(Y.wnext+=$,Y.wnext===Y.wsize&&(Y.wnext=0),Y.whave>>8&255,C.check=o(C.check,x,2,0),U=B=0,C.mode=2;break}if(C.flags=0,C.head&&(C.head.done=!1),!(1&C.wrap)||(((255&B)<<8)+(B>>8))%31){O.msg="incorrect header check",C.mode=30;break}if((15&B)!=8){O.msg="unknown compression method",C.mode=30;break}if(U-=4,g=8+(15&(B>>>=4)),C.wbits===0)C.wbits=g;else if(g>C.wbits){O.msg="invalid window size",C.mode=30;break}C.dmax=1<>8&1),512&C.flags&&(x[0]=255&B,x[1]=B>>>8&255,C.check=o(C.check,x,2,0)),U=B=0,C.mode=3;case 3:for(;U<32;){if(G===0)break t;G--,B+=v[Y++]<>>8&255,x[2]=B>>>16&255,x[3]=B>>>24&255,C.check=o(C.check,x,4,0)),U=B=0,C.mode=4;case 4:for(;U<16;){if(G===0)break t;G--,B+=v[Y++]<>8),512&C.flags&&(x[0]=255&B,x[1]=B>>>8&255,C.check=o(C.check,x,2,0)),U=B=0,C.mode=5;case 5:if(1024&C.flags){for(;U<16;){if(G===0)break t;G--,B+=v[Y++]<>>8&255,C.check=o(C.check,x,2,0)),U=B=0}else C.head&&(C.head.extra=null);C.mode=6;case 6:if(1024&C.flags&&(G<(K=C.length)&&(K=G),K&&(C.head&&(g=C.head.extra_len-C.length,C.head.extra||(C.head.extra=new Array(C.head.extra_len)),n.arraySet(C.head.extra,v,Y,K,g)),512&C.flags&&(C.check=o(C.check,v,K,Y)),G-=K,Y+=K,C.length-=K),C.length))break t;C.length=0,C.mode=7;case 7:if(2048&C.flags){if(G===0)break t;for(K=0;g=v[Y+K++],C.head&&g&&C.length<65536&&(C.head.name+=String.fromCharCode(g)),g&&K>9&1,C.head.done=!0),O.adler=C.check=0,C.mode=12;break;case 10:for(;U<32;){if(G===0)break t;G--,B+=v[Y++]<>>=7&U,U-=7&U,C.mode=27;break}for(;U<3;){if(G===0)break t;G--,B+=v[Y++]<>>=1)){case 0:C.mode=14;break;case 1:if(M(C),C.mode=20,P!==6)break;B>>>=2,U-=2;break t;case 2:C.mode=17;break;case 3:O.msg="invalid block type",C.mode=30}B>>>=2,U-=2;break;case 14:for(B>>>=7&U,U-=7&U;U<32;){if(G===0)break t;G--,B+=v[Y++]<>>16^65535)){O.msg="invalid stored block lengths",C.mode=30;break}if(C.length=65535&B,U=B=0,C.mode=15,P===6)break t;case 15:C.mode=16;case 16:if(K=C.length){if(G>>=5,U-=5,C.ndist=1+(31&B),B>>>=5,U-=5,C.ncode=4+(15&B),B>>>=4,U-=4,286>>=3,U-=3}for(;C.have<19;)C.lens[X[C.have++]]=0;if(C.lencode=C.lendyn,C.lenbits=7,k={bits:C.lenbits},H=l(0,C.lens,0,19,C.lencode,0,C.work,k),C.lenbits=k.bits,H){O.msg="invalid code lengths set",C.mode=30;break}C.have=0,C.mode=19;case 19:for(;C.have>>16&255,wt=65535&S,!((lt=S>>>24)<=U);){if(G===0)break t;G--,B+=v[Y++]<>>=lt,U-=lt,C.lens[C.have++]=wt;else{if(wt===16){for(b=lt+2;U>>=lt,U-=lt,C.have===0){O.msg="invalid bit length repeat",C.mode=30;break}g=C.lens[C.have-1],K=3+(3&B),B>>>=2,U-=2}else if(wt===17){for(b=lt+3;U>>=lt)),B>>>=3,U-=3}else{for(b=lt+7;U>>=lt)),B>>>=7,U-=7}if(C.have+K>C.nlen+C.ndist){O.msg="invalid bit length repeat",C.mode=30;break}for(;K--;)C.lens[C.have++]=g}}if(C.mode===30)break;if(C.lens[256]===0){O.msg="invalid code -- missing end-of-block",C.mode=30;break}if(C.lenbits=9,k={bits:C.lenbits},H=l(h,C.lens,0,C.nlen,C.lencode,0,C.work,k),C.lenbits=k.bits,H){O.msg="invalid literal/lengths set",C.mode=30;break}if(C.distbits=6,C.distcode=C.distdyn,k={bits:C.distbits},H=l(u,C.lens,C.nlen,C.ndist,C.distcode,0,C.work,k),C.distbits=k.bits,H){O.msg="invalid distances set",C.mode=30;break}if(C.mode=20,P===6)break t;case 20:C.mode=21;case 21:if(6<=G&&258<=it){O.next_out=q,O.avail_out=it,O.next_in=Y,O.avail_in=G,C.hold=B,C.bits=U,a(O,J),q=O.next_out,$=O.output,it=O.avail_out,Y=O.next_in,v=O.input,G=O.avail_in,B=C.hold,U=C.bits,C.mode===12&&(C.back=-1);break}for(C.back=0;dt=(S=C.lencode[B&(1<>>16&255,wt=65535&S,!((lt=S>>>24)<=U);){if(G===0)break t;G--,B+=v[Y++]<>At)])>>>16&255,wt=65535&S,!(At+(lt=S>>>24)<=U);){if(G===0)break t;G--,B+=v[Y++]<>>=At,U-=At,C.back+=At}if(B>>>=lt,U-=lt,C.back+=lt,C.length=wt,dt===0){C.mode=26;break}if(32&dt){C.back=-1,C.mode=12;break}if(64&dt){O.msg="invalid literal/length code",C.mode=30;break}C.extra=15&dt,C.mode=22;case 22:if(C.extra){for(b=C.extra;U>>=C.extra,U-=C.extra,C.back+=C.extra}C.was=C.length,C.mode=23;case 23:for(;dt=(S=C.distcode[B&(1<>>16&255,wt=65535&S,!((lt=S>>>24)<=U);){if(G===0)break t;G--,B+=v[Y++]<>At)])>>>16&255,wt=65535&S,!(At+(lt=S>>>24)<=U);){if(G===0)break t;G--,B+=v[Y++]<>>=At,U-=At,C.back+=At}if(B>>>=lt,U-=lt,C.back+=lt,64&dt){O.msg="invalid distance code",C.mode=30;break}C.offset=wt,C.extra=15&dt,C.mode=24;case 24:if(C.extra){for(b=C.extra;U>>=C.extra,U-=C.extra,C.back+=C.extra}if(C.offset>C.dmax){O.msg="invalid distance too far back",C.mode=30;break}C.mode=25;case 25:if(it===0)break t;if(K=J-it,C.offset>K){if((K=C.offset-K)>C.whave&&C.sane){O.msg="invalid distance too far back",C.mode=30;break}_t=K>C.wnext?(K-=C.wnext,C.wsize-K):C.wnext-K,K>C.length&&(K=C.length),Pt=C.window}else Pt=$,_t=q-C.offset,K=C.length;for(itw?(N=_t[Pt+m[P]],U[nt+m[P]]):(N=96,0),_=1<>q)+(A-=_)]=L<<24|N<<16|M|0,A!==0;);for(_=1<>=1;if(_!==0?(B&=_-1,B+=_):B=0,P++,--J[O]==0){if(O===v)break;O=u[d+m[P]]}if($>>7)]}function nt(S,x){S.pending_buf[S.pending++]=255&x,S.pending_buf[S.pending++]=x>>>8&255}function J(S,x,X){S.bi_valid>E-X?(S.bi_buf|=x<>E-S.bi_valid,S.bi_valid+=X-E):(S.bi_buf|=x<>>=1,X<<=1,0<--x;);return X>>>1}function Pt(S,x,X){var Z,D,j=new Array(m+1),tt=0;for(Z=1;Z<=m;Z++)j[Z]=tt=tt+X[Z-1]<<1;for(D=0;D<=x;D++){var Q=S[2*D+1];Q!==0&&(S[2*D]=_t(j[Q]++,Q))}}function lt(S){var x;for(x=0;x>1;1<=X;X--)At(S,j,X);for(D=rt;X=S.heap[1],S.heap[1]=S.heap[S.heap_len--],At(S,j,1),Z=S.heap[1],S.heap[--S.heap_max]=X,S.heap[--S.heap_max]=Z,j[2*D]=j[2*X]+j[2*Z],S.depth[D]=(S.depth[X]>=S.depth[Z]?S.depth[X]:S.depth[Z])+1,j[2*X+1]=j[2*Z+1]=D,S.heap[1]=D++,At(S,j,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],function(ht,Vt){var qe,ie,Je,Rt,Ps,Fi,ce=Vt.dyn_tree,kn=Vt.max_code,to=Vt.stat_desc.static_tree,eo=Vt.stat_desc.has_stree,so=Vt.stat_desc.extra_bits,zn=Vt.stat_desc.extra_base,ts=Vt.stat_desc.max_length,Ls=0;for(Rt=0;Rt<=m;Rt++)ht.bl_count[Rt]=0;for(ce[2*ht.heap[ht.heap_max]+1]=0,qe=ht.heap_max+1;qe>=7;D>>=1)if(1&Et&&Q.dyn_ltree[2*rt]!==0)return r;if(Q.dyn_ltree[18]!==0||Q.dyn_ltree[20]!==0||Q.dyn_ltree[26]!==0)return o;for(rt=32;rt>>3,(j=S.static_len+3+7>>>3)<=D&&(D=j)):D=j=X+5,X+4<=D&&x!==-1?b(S,x,X,Z):S.strategy===4||j===D?(J(S,2+(Z?1:0),3),se(S,z,O)):(J(S,4+(Z?1:0),3),function(Q,rt,Et,ht){var Vt;for(J(Q,rt-257,5),J(Q,Et-1,5),J(Q,ht-4,4),Vt=0;Vt>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&x,S.pending_buf[S.l_buf+S.last_lit]=255&X,S.last_lit++,x===0?S.dyn_ltree[2*X]++:(S.matches++,x--,S.dyn_ltree[2*(C[X]+u+1)]++,S.dyn_dtree[2*U(x)]++),S.last_lit===S.lit_bufsize-1},i._tr_align=function(S){J(S,2,3),K(S,A,z),function(x){x.bi_valid===16?(nt(x,x.bi_buf),x.bi_buf=0,x.bi_valid=0):8<=x.bi_valid&&(x.pending_buf[x.pending++]=255&x.bi_buf,x.bi_buf>>=8,x.bi_valid-=8)}(S)}},{"../utils/common":41}],53:[function(t,s,i){s.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,s,i){(function(n){(function(r,o){if(!r.setImmediate){var a,l,h,u,d=1,f={},I=!1,p=r.document,m=Object.getPrototypeOf&&Object.getPrototypeOf(r);m=m&&m.setTimeout?m:r,a={}.toString.call(r.process)==="[object process]"?function(T){process.nextTick(function(){_(T)})}:function(){if(r.postMessage&&!r.importScripts){var T=!0,R=r.onmessage;return r.onmessage=function(){T=!1},r.postMessage("","*"),r.onmessage=R,T}}()?(u="setImmediate$"+Math.random()+"$",r.addEventListener?r.addEventListener("message",A,!1):r.attachEvent("onmessage",A),function(T){r.postMessage(u+T,"*")}):r.MessageChannel?((h=new MessageChannel).port1.onmessage=function(T){_(T.data)},function(T){h.port2.postMessage(T)}):p&&"onreadystatechange"in p.createElement("script")?(l=p.documentElement,function(T){var R=p.createElement("script");R.onreadystatechange=function(){_(T),R.onreadystatechange=null,l.removeChild(R),R=null},l.appendChild(R)}):function(T){setTimeout(_,0,T)},m.setImmediate=function(T){typeof T!="function"&&(T=new Function(""+T));for(var R=new Array(arguments.length-1),F=0;F"u"?n===void 0?this:n:self)}).call(this,typeof vs<"u"?vs:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Xr);var Fc=Xr.exports;const Fr=Uo(Fc);var Dn={},Oi={};(function(c){const e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",t=e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",s="["+e+"]["+t+"]*",i=new RegExp("^"+s+"$"),n=function(o,a){const l=[];let h=a.exec(o);for(;h;){const u=[];u.startIndex=a.lastIndex-h[0].length;const d=h.length;for(let f=0;f"u")};c.isExist=function(o){return typeof o<"u"},c.isEmptyObject=function(o){return Object.keys(o).length===0},c.merge=function(o,a,l){if(a){const h=Object.keys(a),u=h.length;for(let d=0;d"&&c[n]!==" "&&c[n]!==" "&&c[n]!==` -`&&c[n]!=="\r";n++)a+=c[n];if(a=a.trim(),a[a.length-1]==="/"&&(a=a.substring(0,a.length-1),n--),!xc(a)){let u;return a.trim().length===0?u="Invalid space after '<'.":u="Tag '"+a+"' is an invalid name.",Ot("InvalidTag",u,Dt(c,n))}const l=bc(c,n);if(l===!1)return Ot("InvalidAttr","Attributes for '"+a+"' have open quote.",Dt(c,n));let h=l.value;if(n=l.index,h[h.length-1]==="/"){const u=n-h.length;h=h.substring(0,h.length-1);const d=br(h,e);if(d===!0)s=!0;else return Ot(d.err.code,d.err.msg,Dt(c,u+d.err.line))}else if(o)if(l.tagClosed){if(h.trim().length>0)return Ot("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",Dt(c,r));if(t.length===0)return Ot("InvalidTag","Closing tag '"+a+"' has not been opened.",Dt(c,r));{const u=t.pop();if(a!==u.tagName){let d=Dt(c,u.tagStartPos);return Ot("InvalidTag","Expected closing tag '"+u.tagName+"' (opened in line "+d.line+", col "+d.col+") instead of closing tag '"+a+"'.",Dt(c,r))}t.length==0&&(i=!0)}}else return Ot("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",Dt(c,n));else{const u=br(h,e);if(u!==!0)return Ot(u.err.code,u.err.msg,Dt(c,n-h.length+u.err.line));if(i===!0)return Ot("InvalidXml","Multiple possible root nodes found.",Dt(c,n));e.unpairedTags.indexOf(a)!==-1||t.push({tagName:a,tagStartPos:r}),s=!0}for(n++;n0)return Ot("InvalidXml","Invalid '"+JSON.stringify(t.map(n=>n.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Ot("InvalidXml","Start tag expected.",1);return!0};function Sr(c){return c===" "||c===" "||c===` -`||c==="\r"}function wr(c,e){const t=e;for(;e5&&s==="xml")return Ot("InvalidXml","XML declaration allowed only at the start of the document.",Dt(c,e));if(c[e]=="?"&&c[e+1]==">"){e++;break}else continue}return e}function Nr(c,e){if(c.length>e+5&&c[e+1]==="-"&&c[e+2]==="-"){for(e+=3;e"){e+=2;break}}else if(c.length>e+8&&c[e+1]==="D"&&c[e+2]==="O"&&c[e+3]==="C"&&c[e+4]==="T"&&c[e+5]==="Y"&&c[e+6]==="P"&&c[e+7]==="E"){let t=1;for(e+=8;e"&&(t--,t===0))break}else if(c.length>e+9&&c[e+1]==="["&&c[e+2]==="C"&&c[e+3]==="D"&&c[e+4]==="A"&&c[e+5]==="T"&&c[e+6]==="A"&&c[e+7]==="["){for(e+=8;e"){e+=2;break}}return e}const wc='"',Nc="'";function bc(c,e){let t="",s="",i=!1;for(;e"&&s===""){i=!0;break}t+=c[e]}return s!==""?!1:{value:t,index:e,tagClosed:i}}const Pc=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function br(c,e){const t=Un.getAllMatches(c,Pc),s={};for(let i=0;i!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(c,e,t){return c}},Dc=function(c){return Object.assign({},Zr,c)};Bn.buildOptions=Dc;Bn.defaultOptions=Zr;class Uc{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}var Bc=Uc;const kc=Oi;function zc(c,e){const t={};if(c[e+3]==="O"&&c[e+4]==="C"&&c[e+5]==="T"&&c[e+6]==="Y"&&c[e+7]==="P"&&c[e+8]==="E"){e=e+9;let s=1,i=!1,n=!1,r="";for(;e"){if(n?c[e-1]==="-"&&c[e-2]==="-"&&(n=!1,s--):s--,s===0)break}else c[e]==="["?i=!0:r+=c[e];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:t,i:e}}function Yc(c,e){let t="";for(;e0&&i&&t[2]!==".")return c;if(!e.leadingZeros&&n.length>0&&!i&&t[1]!==".")return c;{const a=Number(t),l=""+a;return l.search(/[eE]/)!==-1||o?e.eNotation?a:c:t.indexOf(".")!==-1?l==="0"&&r===""||l===r||i&&l==="-"+r?a:c:n?r===l||i+r===l?a:c:t===l||t===i+l?a:c}}else return c}}function Jc(c){return c&&c.indexOf(".")!==-1&&(c=c.replace(/0+$/,""),c==="."?c="0":c[0]==="."?c="0"+c:c[c.length-1]==="."&&(c=c.substr(0,c.length-1))),c}var tl=qc;const $r=Oi,Is=Bc,el=$c,sl=tl;let il=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,s)=>String.fromCharCode(Number.parseInt(s,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,s)=>String.fromCharCode(Number.parseInt(s,16))}},this.addExternalEntities=nl,this.parseXml=ll,this.parseTextData=rl,this.resolveNameSpace=ol,this.buildAttributesMap=cl,this.isItStopNode=fl,this.replaceEntitiesValue=ul,this.readStopNodeData=El,this.saveTextToParentTag=dl,this.addChild=hl}};function nl(c){const e=Object.keys(c);for(let t=0;t0)){r||(c=this.replaceEntitiesValue(c));const o=this.options.tagValueProcessor(e,c,t,i,n);return o==null?c:typeof o!=typeof c||o!==c?o:this.options.trimValues?hn(c,this.options.parseTagValue,this.options.numberParseOptions):c.trim()===c?hn(c,this.options.parseTagValue,this.options.numberParseOptions):c}}function ol(c){if(this.options.removeNSPrefix){const e=c.split(":"),t=c.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(c=t+e[1])}return c}const al=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function cl(c,e,t){if(!this.options.ignoreAttributes&&typeof c=="string"){const s=$r.getAllMatches(c,al),i=s.length,n={};for(let r=0;r",n,"Closing Tag is not closed.");let a=c.substring(n+2,o).trim();if(this.options.removeNSPrefix){const u=a.indexOf(":");u!==-1&&(a=a.substr(u+1))}this.options.transformTagName&&(a=this.options.transformTagName(a)),t&&(s=this.saveTextToParentTag(s,t,i));const l=i.substring(i.lastIndexOf(".")+1);if(a&&this.options.unpairedTags.indexOf(a)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let h=0;l&&this.options.unpairedTags.indexOf(l)!==-1?(h=i.lastIndexOf(".",i.lastIndexOf(".")-1),this.tagsNodeStack.pop()):h=i.lastIndexOf("."),i=i.substring(0,h),t=this.tagsNodeStack.pop(),s="",n=o}else if(c[n+1]==="?"){let o=ln(c,n,!1,"?>");if(!o)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,t,i),!(this.options.ignoreDeclaration&&o.tagName==="?xml"||this.options.ignorePiTags)){const a=new Is(o.tagName);a.add(this.options.textNodeName,""),o.tagName!==o.tagExp&&o.attrExpPresent&&(a[":@"]=this.buildAttributesMap(o.tagExp,i,o.tagName)),this.addChild(t,a,i)}n=o.closeIndex+1}else if(c.substr(n+1,3)==="!--"){const o=be(c,"-->",n+4,"Comment is not closed.");if(this.options.commentPropName){const a=c.substring(n+4,o-2);s=this.saveTextToParentTag(s,t,i),t.add(this.options.commentPropName,[{[this.options.textNodeName]:a}])}n=o}else if(c.substr(n+1,2)==="!D"){const o=el(c,n);this.docTypeEntities=o.entities,n=o.i}else if(c.substr(n+1,2)==="!["){const o=be(c,"]]>",n,"CDATA is not closed.")-2,a=c.substring(n+9,o);s=this.saveTextToParentTag(s,t,i);let l=this.parseTextData(a,t.tagname,i,!0,!1,!0,!0);l==null&&(l=""),this.options.cdataPropName?t.add(this.options.cdataPropName,[{[this.options.textNodeName]:a}]):t.add(this.options.textNodeName,l),n=o+2}else{let o=ln(c,n,this.options.removeNSPrefix),a=o.tagName;const l=o.rawTagName;let h=o.tagExp,u=o.attrExpPresent,d=o.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),t&&s&&t.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,t,i,!1));const f=t;if(f&&this.options.unpairedTags.indexOf(f.tagname)!==-1&&(t=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf("."))),a!==e.tagname&&(i+=i?"."+a:a),this.isItStopNode(this.options.stopNodes,i,a)){let I="";if(h.length>0&&h.lastIndexOf("/")===h.length-1)a[a.length-1]==="/"?(a=a.substr(0,a.length-1),i=i.substr(0,i.length-1),h=a):h=h.substr(0,h.length-1),n=o.closeIndex;else if(this.options.unpairedTags.indexOf(a)!==-1)n=o.closeIndex;else{const m=this.readStopNodeData(c,l,d+1);if(!m)throw new Error(`Unexpected end of ${l}`);n=m.i,I=m.tagContent}const p=new Is(a);a!==h&&u&&(p[":@"]=this.buildAttributesMap(h,i,a)),I&&(I=this.parseTextData(I,a,i,!0,u,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),p.add(this.options.textNodeName,I),this.addChild(t,p,i)}else{if(h.length>0&&h.lastIndexOf("/")===h.length-1){a[a.length-1]==="/"?(a=a.substr(0,a.length-1),i=i.substr(0,i.length-1),h=a):h=h.substr(0,h.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const I=new Is(a);a!==h&&u&&(I[":@"]=this.buildAttributesMap(h,i,a)),this.addChild(t,I,i),i=i.substr(0,i.lastIndexOf("."))}else{const I=new Is(a);this.tagsNodeStack.push(t),a!==h&&u&&(I[":@"]=this.buildAttributesMap(h,i,a)),this.addChild(t,I,i),t=I}s="",n=d}}else s+=c[n];return e.child};function hl(c,e,t){const s=this.options.updateTag(e.tagname,t,e[":@"]);s===!1||(typeof s=="string"&&(e.tagname=s),c.addChild(e))}const ul=function(c){if(this.options.processEntities){for(let e in this.docTypeEntities){const t=this.docTypeEntities[e];c=c.replace(t.regx,t.val)}for(let e in this.lastEntities){const t=this.lastEntities[e];c=c.replace(t.regex,t.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const t=this.htmlEntities[e];c=c.replace(t.regex,t.val)}c=c.replace(this.ampEntity.regex,this.ampEntity.val)}return c};function dl(c,e,t,s){return c&&(s===void 0&&(s=Object.keys(e.child).length===0),c=this.parseTextData(c,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,s),c!==void 0&&c!==""&&e.add(this.options.textNodeName,c),c=""),c}function fl(c,e,t){const s="*."+t;for(const i in c){const n=c[i];if(s===n||e===n)return!0}return!1}function pl(c,e,t=">"){let s,i="";for(let n=e;n",t,`${e} is not closed`);if(c.substring(t+2,n).trim()===e&&(i--,i===0))return{tagContent:c.substring(s,t),i:n};t=n}else if(c[t+1]==="?")t=be(c,"?>",t+1,"StopNode is not closed.");else if(c.substr(t+1,3)==="!--")t=be(c,"-->",t+3,"StopNode is not closed.");else if(c.substr(t+1,2)==="![")t=be(c,"]]>",t,"StopNode is not closed.")-2;else{const n=ln(c,t,">");n&&((n&&n.tagName)===e&&n.tagExp[n.tagExp.length-1]!=="/"&&i++,t=n.closeIndex)}}function hn(c,e,t){if(e&&typeof c=="string"){const s=c.trim();return s==="true"?!0:s==="false"?!1:sl(c,t)}else return $r.isExist(c)?c:""}var Il=il,jr={};function ml(c,e){return Qr(c,e)}function Qr(c,e,t){let s;const i={};for(let n=0;n0&&(i[e.textNodeName]=s):s!==void 0&&(i[e.textNodeName]=s),i}function Cl(c){const e=Object.keys(c);for(let t=0;t0&&(t=Sl),Kr(c,e,"",t)}function Kr(c,e,t,s){let i="",n=!1;for(let r=0;r`,n=!1;continue}else if(a===e.commentPropName){i+=s+``,n=!0;continue}else if(a[0]==="?"){const I=Pr(o[":@"],e),p=a==="?xml"?"":s;let m=o[a][0][e.textNodeName];m=m.length!==0?" "+m:"",i+=p+`<${a}${m}${I}?>`,n=!0;continue}let h=s;h!==""&&(h+=e.indentBy);const u=Pr(o[":@"],e),d=s+`<${a}${u}`,f=Kr(o[a],e,l,h);e.unpairedTags.indexOf(a)!==-1?e.suppressUnpairedNode?i+=d+">":i+=d+"/>":(!f||f.length===0)&&e.suppressEmptyNode?i+=d+"/>":f&&f.endsWith(">")?i+=d+`>${f}${s}`:(i+=d+">",f&&s!==""&&(f.includes("/>")||f.includes("`),n=!0}return i}function Nl(c){const e=Object.keys(c);for(let t=0;t0&&e.processEntities)for(let t=0;t","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function ye(c){this.options=Object.assign({},Ml,c),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Dl),this.processTextOrObjNode=vl,this.options.format?(this.indentate=xl,this.tagEndChar=`> -`,this.newLine=` -`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}ye.prototype.build=function(c){return this.options.preserveOrder?Ll(c,this.options):(Array.isArray(c)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(c={[this.options.arrayNodeName]:c}),this.j2x(c,0).val)};ye.prototype.j2x=function(c,e){let t="",s="";for(let i in c)if(Object.prototype.hasOwnProperty.call(c,i))if(typeof c[i]>"u")this.isAttribute(i)&&(s+="");else if(c[i]===null)this.isAttribute(i)?s+="":i[0]==="?"?s+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(c[i]instanceof Date)s+=this.buildTextValNode(c[i],i,"",e);else if(typeof c[i]!="object"){const n=this.isAttribute(i);if(n)t+=this.buildAttrPairStr(n,""+c[i]);else if(i===this.options.textNodeName){let r=this.options.tagValueProcessor(i,""+c[i]);s+=this.replaceEntitiesValue(r)}else s+=this.buildTextValNode(c[i],i,"",e)}else if(Array.isArray(c[i])){const n=c[i].length;let r="",o="";for(let a=0;a"u"))if(l===null)i[0]==="?"?s+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(typeof l=="object")if(this.options.oneListGroup){const h=this.j2x(l,e+1);r+=h.val,this.options.attributesGroupName&&l.hasOwnProperty(this.options.attributesGroupName)&&(o+=h.attrStr)}else r+=this.processTextOrObjNode(l,i,e);else if(this.options.oneListGroup){let h=this.options.tagValueProcessor(i,l);h=this.replaceEntitiesValue(h),r+=h}else r+=this.buildTextValNode(l,i,"",e)}this.options.oneListGroup&&(r=this.buildObjectNode(r,i,o,e)),s+=r}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const n=Object.keys(c[i]),r=n.length;for(let o=0;o"+c+i:this.options.commentPropName!==!1&&e===this.options.commentPropName&&n.length===0?this.indentate(s)+``+this.newLine:this.indentate(s)+"<"+e+t+n+this.tagEndChar+c+this.indentate(s)+i}};ye.prototype.closeTag=function(c){let e="";return this.options.unpairedTags.indexOf(c)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(s)+``+this.newLine;if(e[0]==="?")return this.indentate(s)+"<"+e+t+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(e,c);return i=this.replaceEntitiesValue(i),i===""?this.indentate(s)+"<"+e+t+this.closeTag(e)+this.tagEndChar:this.indentate(s)+"<"+e+t+">"+i+"0&&this.options.processEntities)for(let e=0;e`);let t=null;this.modifiedDate&&(t=`${this.modifiedDate.toISOString()}`);let s=null;return this.modifiedAuthor&&(s=`${this.modifiedAuthor}`),` - - ${this.date.toISOString()} - ${this.author} - ${this.comment} - ${e??""} - ${s??""} - ${t??""} - - `}}const ae=class ae{constructor(e){y(this,"guid",fe.create());y(this,"title",ae.default.title);y(this,"creationDate",new Date);y(this,"creationAuthor","");y(this,"viewpoints",new Xe);y(this,"relatedTopics",new Xe);y(this,"comments",new Re);y(this,"customData",{});y(this,"description");y(this,"serverAssignedId");y(this,"dueDate");y(this,"modifiedAuthor");y(this,"modifiedDate");y(this,"index");y(this,"_type",ae.default.type);y(this,"_status",ae.default.status);y(this,"_priority",ae.default.priority);y(this,"_stage",ae.default.priority);y(this,"_assignedTo",ae.default.assignedTo);y(this,"_labels",ae.default.labels);y(this,"_components");this._components=e;const t=e.get(bt);this.creationAuthor=t.config.author,this.relatedTopics.guard=s=>s!==this.guid}set type(e){const t=this._components.get(bt),{strict:s,types:i}=t.config;(!s||i.has(e))&&(this._type=e)}get type(){return this._type}set status(e){const t=this._components.get(bt),{strict:s,statuses:i}=t.config;(!s||i.has(e))&&(this._status=e)}get status(){return this._status}set priority(e){const t=this._components.get(bt);if(e){const{strict:s,priorities:i}=t.config;if(!(s?i.has(e):!0))return;this._priority=e}else this._priority=e}get priority(){return this._priority}set stage(e){const t=this._components.get(bt);if(e){const{strict:s,stages:i}=t.config;if(!(s?i.has(e):!0))return;this._stage=e}else this._stage=e}get stage(){return this._stage}set assignedTo(e){const t=this._components.get(bt);if(e){const{strict:s,users:i}=t.config;if(!(s?i.has(e):!0))return;this._assignedTo=e}else this._assignedTo=e}get assignedTo(){return this._assignedTo}set labels(e){const t=this._components.get(bt),{strict:s,labels:i}=t.config;if(s){const n=new Set;for(const r of e)(!s||i.has(r))&&n.add(r);this._labels=n}else this._labels=e}get labels(){return this._labels}get _managerVersion(){return this._components.get(bt).config.version}set(e){const t=e,s=this;for(const n in e){if(n==="guid")continue;const r=t[n];n in this&&(s[n]=r)}return this._components.get(bt).list.set(this.guid,this),this}createComment(e,t){const s=new un(this._components,e);return s.viewpoint=t,s.topic=this,this.comments.set(s.guid,s),s}createLabelTags(e=this._managerVersion){let t="Labels";e==="2.1"&&(t="Labels"),e==="3"&&(t="Label");let s=[...this.labels].map(i=>`<${t}>${i}`).join(` -`);for(const i in this.customData){const n=this.customData[i];typeof n=="string"&&(s+=` -<${t}>${n}`)}return e==="2.1"?s:e==="3"?s.length!==0?` -${s} -`:"":s}createCommentTags(e=this._managerVersion){const t=[...this.comments.values()].map(s=>s.serialize()).join(` -`);return e==="2.1"?t:e==="3"?t.length!==0?` -${t} -`:"":t}createViewpointTags(e=this._managerVersion){let t="Viewpoints";e==="2.1"&&(t="Viewpoints"),e==="3"&&(t="ViewPoint");const s=this._components.get(te),n=[...this.viewpoints].map(r=>s.list.get(r)).filter(r=>r).map(r=>`<${t} Guid="${r.guid}"> - ${r.guid}.bcfv - ${r.guid}.jpeg - - `).join(` -`);return e==="2.1"?n:e==="3"?n.length!==0?` -${n} -`:"":n}createRelatedTopicTags(e=this._managerVersion){const t=[...this.relatedTopics].map(s=>` - `).join(` -`);return e==="2.1"?t:e==="3"?t.length!==0?` -${t} -`:"":t}serialize(){const e=this._managerVersion;let t=null;this.serverAssignedId&&(t=`ServerAssignedId="${this.serverAssignedId}"`);let s=null;this.priority&&(s=`${this.priority}`);let i=null;this.index&&e==="2.1"&&(i=`${this.index}`);let n=null;this.modifiedDate&&(n=`${this.modifiedDate.toISOString()}`);let r=null;this.modifiedAuthor&&(r=`${this.modifiedAuthor}`);let o=null;this.dueDate&&(o=`${this.dueDate.toISOString()}`);let a=null;this.assignedTo&&(a=`${this.assignedTo}`);let l=null;this.description&&(l=`${this.description}`);let h=null;this.stage&&(h=`${this.stage}`);const u=this.createCommentTags(e),d=this.createViewpointTags(e),f=this.createLabelTags(e),I=this.createRelatedTopicTags(e);return` - - - - ${this.title} - ${this.creationDate.toISOString()} - ${this.creationAuthor} - ${s??""} - ${i??""} - ${n??""} - ${r??""} - ${o??""} - ${a??""} - ${l??""} - ${h??""} - ${f} - ${I} - ${e==="3"?u:""} - ${e==="3"?d:""} - - ${e==="2.1"?u:""} - ${e==="2.1"?d:""} - - `}};y(ae,"default",{title:"BCF Topic",type:"Issue",status:"Active",labels:new Set});let li=ae;const Vl=(c,e)=>{if(e.trim()==="")return;const t=bt.xmlParser.parse(e).Extensions;if(!t)return;const{Priorities:s,TopicStatuses:i,TopicTypes:n,Users:r}=t;if(s&&s.Priority){const o=Array.isArray(s.Priority)?s.Priority:[s.Priority];for(const a of o)c.config.priorities.add(a)}if(i&&i.TopicStatus){const o=Array.isArray(i.TopicStatus)?i.TopicStatus:[i.TopicStatus];for(const a of o)c.config.statuses.add(a)}if(n&&n.TopicType){const o=Array.isArray(n.TopicType)?n.TopicType:[n.TopicType];for(const a of o)c.config.types.add(a)}if(r&&r.User){const o=Array.isArray(r.User)?r.User:[r.User];for(const a of o)c.config.users.add(a)}},Ne=class Ne extends Bt{constructor(){super(...arguments);y(this,"enabled",!1);y(this,"config",{author:"jhon.doe@example.com",version:"2.1",types:new Set(["Clash","Failure","Fault","Inquiry","Issue","Remark","Request"]),statuses:new Set(["Active","In Progress","Done","In Review","Closed"]),priorities:new Set(["On hold","Minor","Normal","Major","Critical"]),labels:new Set,stages:new Set,users:new Set,includeSelectionTag:!1,updateExtensionsOnImport:!0,strict:!1,includeAllExtensionsOnExport:!0,fallbackVersionOnImport:"2.1",ignoreIncompleteTopicsOnImport:!1});y(this,"list",new Re);y(this,"onSetup",new et);y(this,"isSetup",!1);y(this,"onBCFImported",new et);y(this,"onDisposed",new et)}setup(t){this.isSetup||(this.config={...this.config,...t},this.isSetup=!0,this.enabled=!0,this.onSetup.trigger())}create(t){const s=new li(this.components);return t&&(s.guid=t.guid??s.guid,s.set(t)),this.list.set(s.guid,s),s}dispose(){this.list.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}get usedTypes(){const t=[...this.list].map(([s,i])=>i.type);return new Set(t)}get usedStatuses(){const t=[...this.list].map(([s,i])=>i.status);return new Set(t)}get usedPriorities(){const t=[...this.list].map(([s,i])=>i.priority).filter(s=>s);return new Set(t)}get usedStages(){const t=[...this.list].map(([s,i])=>i.stage).filter(s=>s);return new Set(t)}get usedUsers(){const t=[];for(const[s,i]of this.list){t.push(i.creationAuthor),i.assignedTo&&t.push(i.assignedTo),i.modifiedAuthor&&t.push(i.modifiedAuthor);for(const[n,r]of i.comments)t.push(r.author),r.modifiedAuthor&&t.push(r.modifiedAuthor)}return new Set(t)}get usedLabels(){const t=[];for(const[s,i]of this.list)t.push(...i.labels);return new Set(t)}updateExtensions(){for(const[t,s]of this.list){for(const i of s.labels)this.config.labels.add(i);this.config.types.add(s.type),s.priority&&this.config.priorities.add(s.priority),s.stage&&this.config.stages.add(s.stage),this.config.statuses.add(s.status),this.config.users.add(s.creationAuthor),s.assignedTo&&this.config.users.add(s.assignedTo),s.modifiedAuthor&&this.config.users.add(s.modifiedAuthor);for(const[i,n]of s.comments)this.config.users.add(n.author),n.modifiedAuthor&&this.config.users.add(n.modifiedAuthor)}}updateViewpointReferences(){const t=this.components.get(te);for(const[s,i]of this.list)for(const n of i.viewpoints)t.list.has(n)||i.viewpoints.delete(n)}async export(t=this.list.values()){const s=new Fr;s.file("bcf.version",` - - `),s.file("bcf.extensions",this.serializeExtensions());const n=await(await fetch("https://thatopen.github.io/engine_components/resources/favicon.ico")).blob(),r=this.components.get(te);for(const a of t){const l=s.folder(a.guid);l.file("markup.bcf",a.serialize());for(const h of a.viewpoints){const u=r.list.get(h);u&&(l.file(`${h}.jpeg`,n,{binary:!0}),l.file(`${h}.bcfv`,await u.serialize()))}}return await s.generateAsync({type:"blob"})}serializeExtensions(){const t=[...this.config.types].map(a=>`${a}`).join(` -`),s=[...this.config.statuses].map(a=>`${a}`).join(` -`),i=[...this.config.priorities].map(a=>`${a}`).join(` -`),n=[...this.config.labels].map(a=>`${a}`).join(` -`),r=[...this.config.stages].map(a=>`${a}`).join(` -`),o=[...this.config.users].map(a=>`${a}`).join(` -`);return` - - - ${t.length!==0?` -${t} -`:""} - ${s.length!==0?` -${s} -`:""} - ${i.length!==0?` -${i} -`:""} - ${n.length!==0?` -${n} -`:""} - ${r.length!==0?` -${r} -`:""} - ${o.length!==0?` -${o} -`:""} - - `}processMarkupComment(t){const{Guid:s,Date:i,Author:n,Comment:r,Viewpoint:o}=t;if(!(s&&i&&n&&(un||o)))return null;const a=this.components.get(te),l=new un(this.components,r??"");return l.guid=s,l.date=new Date(i),l.author=n,l.viewpoint=o!=null&&o.Guid?a.list.get(o.Guid):void 0,l.modifiedAuthor=t.ModifiedAuthor,l.modifiedDate=t.ModifiedDate?new Date(t.ModifiedDate):void 0,l}getMarkupComments(t,s){var o;let i;if(s==="2.1"&&(i=t.Comment),s==="3"&&(i=(o=t.Topic.Comments)==null?void 0:o.Comment),!i)return[];i=Array.isArray(i)?i:[i];const n=i.map(a=>this.processMarkupComment(a)).filter(a=>a);return Array.isArray(n)?n:[n]}getMarkupLabels(t,s){var r;let i;return s==="2.1"&&(i=t.Topic.Labels),s==="3"&&(i=(r=t.Topic.Labels)==null?void 0:r.Label),i?Array.isArray(i)?i:[i]:[]}getMarkupViewpoints(t,s){var n;let i;return s==="2.1"&&(i=t.Viewpoints),s==="3"&&(i=(n=t.Topic.Viewpoints)==null?void 0:n.ViewPoint),i?(i=Array.isArray(i)?i:[i],i):[]}getMarkupRelatedTopics(t,s){var r;let i;return s==="2.1"&&(i=t.Topic.RelatedTopic),s==="3"&&(i=(r=t.Topic.RelatedTopics)==null?void 0:r.RelatedTopic),i?(Array.isArray(i)?i:[i]).map(o=>o.Guid):[]}async load(t,s){var _;const{fallbackVersionOnImport:i,ignoreIncompleteTopicsOnImport:n,updateExtensionsOnImport:r}=this.config,o=new Fr;await o.loadAsync(t);const a=Object.values(o.files);let l=i;const h=a.find(A=>A.name.endsWith(".version"));if(h){const A=await h.async("string"),T=Ne.xmlParser.parse(A).Version.VersionId;l=String(T)}if(!(l&&(l==="2.1"||l==="3")))throw new Error(`BCFTopics: ${l} is not supported.`);const u=a.find(A=>A.name.endsWith(".extensions"));if(r&&u){const A=await u.async("string");Vl(this,A)}const d=[],f=this.components.get(te),I=a.filter(A=>A.name.endsWith(".bcfv"));for(const A of I){const T=await A.async("string"),R=Ne.xmlParser.parse(T).VisualizationInfo;if(!R){console.warn("Missing VisualizationInfo in Viewpoint");continue}const F={},{Guid:w,ClippingPlanes:L,Components:N,OrthogonalCamera:M,PerspectiveCamera:z}=R;if(w&&(F.guid=w),N){const{Selection:P,Visibility:C}=N;if(P&&P.Component){const $=Array.isArray(P.Component)?P.Component:[P.Component];F.selectionComponents=$.map(Y=>Y.IfcGuid).filter(Y=>Y)}if(C&&"DefaultVisibility"in C&&(F.defaultVisibility=C.DefaultVisibility),C&&C.Exceptions&&"Component"in C.Exceptions){const{Component:$}=C.Exceptions,Y=Array.isArray($)?$:[$];F.exceptionComponents=Y.map(q=>q.IfcGuid).filter(q=>q)}let v;l==="2.1"&&(v=N.ViewSetupHints),l==="3"&&(v=(_=N.Visibility)==null?void 0:_.ViewSetupHints),v&&("OpeningsVisible"in v&&(F.openingsVisible=v.OpeningsVisible),"SpacesVisible"in v&&(F.spacesVisible=v.SpacesVisible),"SpaceBoundariesVisible"in v&&(F.spaceBoundariesVisible=v.SpaceBoundariesVisible))}if(M||z){const P=R.PerspectiveCamera??R.OrthogonalCamera,{CameraViewPoint:C,CameraDirection:v}=P,$=new W(Number(C.X),Number(C.Z),Number(-C.Y)),Y=new W(Number(v.X),Number(v.Z),Number(-v.Y)),q={position:{x:$.x,y:$.y,z:$.z},direction:{x:Y.x,y:Y.y,z:Y.z},aspectRatio:"AspectRatio"in P?P.AspectRatio:1};"ViewToWorldScale"in P&&(F.camera={...q,viewToWorldScale:P.ViewToWorldScale}),"FieldOfView"in P&&(F.camera={...q,fov:P.FieldOfView})}const O=new Jr(this.components,s,{data:F,setCamera:!1});if(N){const{Coloring:P}=N;if(P&&P.Color){const C=Array.isArray(P.Color)?P.Color:[P.Color];for(const v of C){const{Color:$,Component:Y}=v,G=(Array.isArray(Y)?Y:[Y]).map(it=>it.IfcGuid);O.componentColors.set($,G)}}}if(d.push(O),L){const P=this.components.get(rn),C=Array.isArray(L.ClippingPlane)?L.ClippingPlane:[L.ClippingPlane];for(const v of C){const{Location:$,Direction:Y}=v;if(!($&&Y))continue;const q=new W($.X,$.Z,-$.Y),G=new W(Y.X,-Y.Z,Y.Y),it=P.createFromNormalAndCoplanarPoint(s,G,q);it.visible=!1,it.enabled=!1,O.clippingPlanes.add(it)}}}const p={},m=[],E=a.filter(A=>A.name.endsWith(".bcf"));for(const A of E){const T=await A.async("string"),R=Ne.xmlParser.parse(T).Markup,F=R.Topic,{Guid:w,TopicType:L,TopicStatus:N,Title:M,CreationDate:z,CreationAuthor:O}=F;if(n&&!(w&&L&&N&&M&&z&&O))continue;const P=new li(this.components);P.guid=w??P.guid;const C=this.getMarkupRelatedTopics(R,l);p[P.guid]=new Set(C),P.type=L??P.type,P.status=N??P.status,P.title=M??P.title,P.creationDate=z?new Date(z):P.creationDate,P.creationAuthor=O??P.creationAuthor,P.serverAssignedId=F.ServerAssignedId,P.priority=F.Priority,P.index=F.Index,P.modifiedDate=F.ModifiedDate?new Date(F.ModifiedDate):void 0,P.modifiedAuthor=F.ModifiedAuthor,P.dueDate=F.DueDate?new Date(F.DueDate):void 0,P.assignedTo=F.AssignedTo,P.description=F.Description,P.stage=F.Stage;const v=this.getMarkupLabels(R,l);for(const q of v)P.labels.add(q);const $=this.getMarkupComments(R,l);for(const q of $)P.comments.set(q.guid,q);const Y=this.getMarkupViewpoints(R,l);for(const q of Y){if(!(q&&q.Guid))continue;const G=f.list.get(q.Guid);G&&P.viewpoints.add(G.guid)}this.list.set(P.guid,P),m.push(P)}for(const A in p){const T=this.list.get(A);if(!T)continue;const R=p[A];for(const F of R)T.relatedTopics.add(F)}return this.onBCFImported.trigger(m),{viewpoints:d,topics:m}}};y(Ne,"uuid","de977976-e4f6-4e4f-a01a-204727839802"),y(Ne,"xmlParser",new Yl.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",ignoreAttributes:!1,ignoreDeclaration:!0,ignorePiTags:!0,numberParseOptions:{leadingZeros:!0,hex:!0},parseAttributeValue:!0,preserveOrder:!1,processEntities:!1,removeNSPrefix:!0,trimValues:!0}));let bt=Ne;const qt=class qt extends Bt{constructor(t){super(t);y(this,"enabled",!0);y(this,"onDisposed",new et);y(this,"_absoluteMin");y(this,"_absoluteMax");y(this,"_meshes",[]);this.components.add(qt.uuid,this),this._absoluteMin=qt.newBound(!0),this._absoluteMax=qt.newBound(!1)}static getDimensions(t){const{min:s,max:i}=t,n=Math.abs(i.x-s.x),r=Math.abs(i.y-s.y),o=Math.abs(i.z-s.z),a=new W;return a.subVectors(i,s).divideScalar(2).add(s),{width:n,height:r,depth:o,center:a}}static newBound(t){const s=t?1:-1;return new W(s*Number.MAX_VALUE,s*Number.MAX_VALUE,s*Number.MAX_VALUE)}static getBounds(t,s,i){const n=i||this.newBound(!1),r=s||this.newBound(!0);for(const o of t)o.xn.x&&(n.x=o.x),o.y>n.y&&(n.y=o.y),o.z>n.z&&(n.z=o.z);return new Nt(s,i)}dispose(){const t=this.components.get(je);for(const s of this._meshes)t.destroy(s);this._meshes=[],this.onDisposed.trigger(qt.uuid),this.onDisposed.reset()}get(){const t=this._absoluteMin.clone(),s=this._absoluteMax.clone();return new Nt(t,s)}getSphere(){const t=this._absoluteMin.clone(),s=this._absoluteMax.clone(),i=Math.abs((s.x-t.x)/2),n=Math.abs((s.y-t.y)/2),r=Math.abs((s.z-t.z)/2),o=new W(t.x+i,t.y+n,t.z+r),a=o.distanceTo(t);return new gi(o,a)}getMesh(){const t=new Nt(this._absoluteMin,this._absoluteMax),s=qt.getDimensions(t),{width:i,height:n,depth:r,center:o}=s,a=new Lt(i,n,r),l=new st(a);return this._meshes.push(l),l.position.copy(o),l}reset(){this._absoluteMin=qt.newBound(!0),this._absoluteMax=qt.newBound(!1)}add(t){for(const s of t.items)this.addMesh(s.mesh)}addMesh(t,s){if(!t.geometry.index)return;const i=qt.getFragmentBounds(t);t.updateMatrixWorld();const n=t.matrixWorld,r=new Ft,o=t instanceof oi,a=new Set;if(t instanceof Do){s||(s=t.fragment.ids);for(const l of s){const h=t.fragment.getInstancesIDs(l);if(h)for(const u of h)a.add(u)}}else a.add(0);for(const l of a){const h=i.min.clone(),u=i.max.clone();o&&(t.getMatrixAt(l,r),h.applyMatrix4(r),u.applyMatrix4(r)),h.applyMatrix4(n),u.applyMatrix4(n),h.xthis._absoluteMax.x&&(this._absoluteMax.x=h.x),h.y>this._absoluteMax.y&&(this._absoluteMax.y=h.y),h.z>this._absoluteMax.z&&(this._absoluteMax.z=h.z),u.x>this._absoluteMax.x&&(this._absoluteMax.x=u.x),u.y>this._absoluteMax.y&&(this._absoluteMax.y=u.y),u.z>this._absoluteMax.z&&(this._absoluteMax.z=u.z),u.xo.x&&(o.x=u),d>o.y&&(o.y=d),f>o.z&&(o.z=f)}return new Nt(r,o)}};y(qt,"uuid","d1444724-dba6-4cdd-a0c7-68ee1450d166");let dn=qt;const Ii=class Ii extends Bt{constructor(t){super(t);y(this,"enabled",!0);y(this,"list",{});y(this,"onDisposed",new et);y(this,"onFragmentsDisposed",t=>{const{groupID:s,fragmentIDs:i}=t;for(const n in this.list){const r=this.list[n],o=Object.keys(r);if(o.includes(s))delete r[s],Object.values(r).length===0&&delete this.list[n];else for(const a of o){const l=r[a];for(const h of i)delete l.map[h];Object.values(l).length===0&&delete r[a]}}});t.add(Ii.uuid,this),t.get(gt).onFragmentsDisposed.add(this.onFragmentsDisposed)}dispose(){this.list={},this.components.get(gt).onFragmentsDisposed.remove(this.onFragmentsDisposed),this.onDisposed.trigger(),this.onDisposed.reset()}remove(t){for(const s in this.list){const i=this.list[s];for(const n in i){const r=i[n];delete r.map[t]}}}find(t){const s=this.components.get(gt);if(!t){const o={};for(const[a,l]of s.list)o[a]=new Set(l.ids);return o}const i=Object.keys(t).length,n={};for(const o in t){const a=t[o];if(!this.list[o]){console.warn(`Classification ${o} does not exist.`);continue}for(const l of a){const h=this.list[o][l];if(h)for(const u in h.map){n[u]||(n[u]=new Map);for(const d of h.map[u]){const f=n[u].get(d);f===void 0?n[u].set(d,1):n[u].set(d,f+1)}}}}const r={};for(const o in n){const a=n[o];for(const[l,h]of a){if(h===void 0)throw new Error("Malformed fragments map!");h===i&&(r[o]||(r[o]=new Set),r[o].add(l))}}return r}byModel(t,s){this.list.models||(this.list.models={});const i=this.list.models;i[t]||(i[t]={map:{},id:null,name:t});const n=i[t];for(const[r,o]of s.data){const a=o[0];for(const l of a){const h=s.keyFragments.get(l);h&&(n.map[h]||(n.map[h]=new Set),n.map[h].add(r))}}}async byPredefinedType(t){var n;this.list.predefinedTypes||(this.list.predefinedTypes={});const s=this.list.predefinedTypes,i=t.getAllPropertiesIDs();for(const r of i){const o=await t.getProperties(r);if(!o)continue;const a=String((n=o.PredefinedType)==null?void 0:n.value).toUpperCase();s[a]||(s[a]={map:{},id:null,name:a});const l=s[a];for(const[h,u]of t.data){const d=u[0];for(const f of d){const I=t.keyFragments.get(f);if(!I)throw new Error("Fragment ID not found!");l.map[I]||(l.map[I]=new Set),l.map[I].add(o.expressID)}}}}byEntity(t){this.list.entities||(this.list.entities={});for(const[s,i]of t.data){const r=i[1][1],o=Wr[r];this.saveItem(t,"entities",o,s)}}async byIfcRel(t,s,i){Ze.isRel(s)&&await Ze.getRelationMap(t,s,async(n,r)=>{const{name:o}=await Ze.getEntityName(t,n);for(const a of r)this.saveItem(t,i,o??"NO REL NAME",a)})}async bySpatialStructure(t,s={}){var l,h;const i=this.components.get(Qe),n=i.relationMaps[t.uuid];if(!n)throw new Error(`Classifier: model relations of ${t.name||t.uuid} have to exists to group by spatial structure.`);const r="spatialStructures",a=s.useProperties===void 0||s.useProperties;for(const[u]of n){if(s.isolate){const p=t.data.get(u);if(!p)continue;const m=p[1][1];if(m===void 0||!s.isolate.has(m))continue}const d=i.getEntityRelations(t,u,"Decomposes");if(d)for(const p of d){let m=p.toString();if(a){const E=await t.getProperties(p);if(!E)continue;m=(l=E.Name)==null?void 0:l.value}this.saveItem(t,r,m,u,p)}const f=i.getEntityRelations(t,u,"ContainsElements");if(!f)continue;let I=u.toString();if(a){const p=await t.getProperties(u);if(!p)continue;I=(h=p.Name)==null?void 0:h.value}for(const p of f){this.saveItem(t,r,I,p,u);const m=i.getEntityRelations(t,Number(p),"IsDecomposedBy");if(m)for(const E of m)this.saveItem(t,r,I,E,u)}}}setColor(t,s,i=!1){const n=this.components.get(gt);for(const r in t){const o=n.list.get(r);if(!o)continue;const a=t[r];o.setColor(s,a,i)}}resetColor(t){const s=this.components.get(gt);for(const i in t){const n=s.list.get(i);if(!n)continue;const r=t[i];n.resetColor(r)}}saveItem(t,s,i,n,r=null){this.list[s]||(this.list[s]={});const o=t.data.get(n);if(o)for(const a of o[0]){const l=t.keyFragments.get(a);if(l){const h=this.list[s];h[i]||(h[i]={map:{},id:r,name:i}),h[i].map[l]||(h[i].map[l]=new Set),h[i].map[l].add(n)}}}};y(Ii,"uuid","e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");let hi=Ii;const mi=class mi extends Bt{constructor(t){super(t);y(this,"enabled",!0);this.components.add(mi.uuid,this)}set(t,s){const i=this.components.get(gt);if(!s){for(const[n,r]of i.list)r&&(r.setVisibility(t),this.updateCulledVisibility(r));return}for(const n in s){const r=s[n],o=i.list.get(n);o&&(o.setVisibility(t,r),this.updateCulledVisibility(o))}}isolate(t){this.set(!1),this.set(!0,t)}updateCulledVisibility(t){const s=this.components.get(nn);for(const[i,n]of s.list){const r=n.colorMeshes.get(t.id);r&&(r.count=t.mesh.count)}}};y(mi,"uuid","dd9ccf2d-8a21-4821-b7f6-2949add16a29");let fn=mi;class Jr{constructor(e,t,s){y(this,"title");y(this,"guid",fe.create());y(this,"clippingPlanes",new Xe);y(this,"camera",{aspectRatio:0,fov:0,direction:{x:0,y:0,z:80},position:{x:0,y:0,z:0}});y(this,"exceptionComponents",new Xe);y(this,"selectionComponents",new Xe);y(this,"componentColors",new Re);y(this,"spacesVisible",!1);y(this,"spaceBoundariesVisible",!1);y(this,"openingsVisible",!1);y(this,"defaultVisibility",!0);y(this,"_components");y(this,"world");const i={setCamera:!0,...s},{data:n,setCamera:r}=i;this._components=e,this.world=t,n&&(this.guid=n.guid??this.guid,this.set(n)),r&&this.updateCamera()}get _selectionModelIdMap(){const e=this._components.get(gt),t={};for(const[s,i]of e.groups){s in t||(t[s]=new Set);for(const n of this.selectionComponents){const r=i.globalToExpressIDs.get(n);r&&t[s].add(r)}}return t}get _exceptionModelIdMap(){const e=this._components.get(gt),t={};for(const[s,i]of e.groups){s in t||(t[s]=new Set);for(const n of this.exceptionComponents){const r=i.globalToExpressIDs.get(n);r&&t[s].add(r)}}return t}get selection(){return this._components.get(gt).modelIdToFragmentIdMap(this._selectionModelIdMap)}get exception(){return this._components.get(gt).modelIdToFragmentIdMap(this._exceptionModelIdMap)}get projection(){return"fov"in this.camera?"Perspective":"Orthographic"}get position(){const e=this._components.get(gt),{position:t}=this.camera,{x:s,y:i,z:n}=t,r=new W(s,i,n);return e.applyBaseCoordinateSystem(r,new Ft),r}get direction(){const{direction:e}=this.camera,{x:t,y:s,z:i}=e;return new W(t,s,i)}get _managerVersion(){return this._components.get(bt).config.version}get topics(){return[...this._components.get(bt).list.values()].filter(i=>i.viewpoints.has(this.guid))}async addComponentsFromMap(e){var i;const t=this._components.get(gt);for(const n in e){const r=t.list.get(n);if(!(r&&r.group))continue;const o=r.group,a=e[n];for(const l of a){const h=await o.getProperties(l);if(!h)continue;const u=(i=h.GlobalId)==null?void 0:i.value;u&&this.selectionComponents.add(u)}}this._components.get(te).list.set(this.guid,this)}set(e){const t=e,s=this;for(const n in e){if(n==="guid")continue;const r=t[n];n in this&&(s[n]=r)}return this._components.get(te).list.set(this.guid,this),this}async go(e=!0){const{camera:t}=this.world;if(!t.hasCameraControls())throw new Error("Viewpoint: the world's camera need controls to set the viewpoint.");t instanceof Ic&&t.projection.set(this.projection);const s=this.position,i=this.direction;let n={x:s.x+i.x*80,y:s.y+i.y*80,z:s.z+i.z*80};const r=this.selection;if(Object.keys(r).length===0){const h=this._components.get(ws).get(this.world).castRayFromVector(s,this.direction);h&&(n=h.point)}else{const a=this._components.get(dn);a.reset(),a.addFragmentIdMap(r),n=a.getSphere().center,a.reset()}const o=this._components.get(fn);o.set(this.defaultVisibility),o.set(!this.defaultVisibility,this.exception),o.set(!0,r),await t.controls.setLookAt(s.x,s.y,s.z,n.x,n.y,n.z,e)}updateCamera(){const{camera:e,renderer:t}=this.world;if(!t)throw new Error("Viewpoint: the world needs to have a renderer!");if(!e.hasCameraControls())throw new Error("Viewpoint: world's camera need camera controls!");const s=new W;e.controls.getPosition(s);const i=e.three,n=new W(0,0,-1).applyEuler(i.rotation),{width:r,height:o}=t.getSize();let a=r/o;Number.isNaN(a)&&(a=1);const l=this._components.get(gt);s.applyMatrix4(l.baseCoordinationMatrix.clone().invert());const h={aspectRatio:a,position:{x:s.x,y:s.y,z:s.z},direction:{x:n.x,y:n.y,z:n.z}};i instanceof Lr?this.camera={...h,fov:i.fov}:i instanceof En&&(this.camera={...h,viewToWorldScale:i.top-i.bottom}),this._components.get(te).list.set(this.guid,this)}colorize(){const e=this._components.get(te),t=this._components.get(gt),s=this._components.get(hi);for(const[i,n]of this.componentColors){const r=t.guidToFragmentIdMap(n),o=new mn(`#${i}`);s.setColor(r,o,e.config.overwriteColors)}}resetColors(){const e=this._components.get(gt),t=this._components.get(hi);for(const[s,i]of this.componentColors){const n=e.guidToFragmentIdMap(i);t.resetColor(n)}}async createComponentTags(e){var n,r;const t=this._components.get(gt),s=this._components.get(bt);let i="";if(s.config.includeSelectionTag){const o=e==="selection"?this._selectionModelIdMap:this._exceptionModelIdMap;for(const a in o){const l=t.groups.get(a);if(!l)continue;const h=o[a];for(const u of h){const d=await l.getProperties(u);if(!d)continue;const f=(n=d.GlobalId)==null?void 0:n.value;if(!f)continue;const I=(r=d.Tag)==null?void 0:r.value;let p=null;I&&(p=`AuthoringToolId="${I}"`),i+=` -`}}}else i=[...this.selectionComponents].map(o=>``).join(` -`);return i}async serialize(e=this._managerVersion){const t=this._components.get(gt),s=this.position;s.applyMatrix4(t.baseCoordinationMatrix.clone().invert());const i=this.direction;i.normalize();const n=new Ft().makeRotationX(Math.PI/2),r=i.clone().applyMatrix4(n);r.normalize();const o=` - ${s.x} - ${-s.z} - ${s.y} - `,a=` - ${i.x} - ${-i.z} - ${i.y} - `,l=` - ${r.x} - ${-r.z} - ${r.y} - `,h=`${this.camera.aspectRatio}`;let u="";"viewToWorld"in this.camera?u=` - ${o} - ${a} - ${l} - ${h} - ${this.camera.viewToWorld} - `:"fov"in this.camera&&(u=` - ${o} - ${a} - ${l} - ${h} - ${this.camera.fov} - `);const d=``,f=(await this.createComponentTags("selection")).trim(),I=(await this.createComponentTags("exception")).trim();return` - - - ${e==="2.1"?d:""} - ${f.length!==0?`${f}`:""} - - ${e==="3"?d:""} - ${I.length!==0?`${I}`:""} - - - ${u} - `}}const Ci=class Ci extends Bt{constructor(t){super(t);y(this,"enabled",!0);y(this,"list",new Re);y(this,"isSetup",!1);y(this,"onSetup",new et);y(this,"config",{overwriteColors:!1});y(this,"onDisposed",new et);t.add(Ci.uuid,this)}create(t,s){const i=new Jr(this.components,t,{data:s});return s||this.list.set(i.guid,i),i}setup(){}dispose(){this.list.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}};y(Ci,"uuid","ee867824-a796-408d-8aa0-4e5962a83c66");let te=Ci;export{bt as B,en as C,je as D,et as E,gt as F,an as I,vn as S,fe as U,te as V,sn as W,Qe as a,Ze as b,cn as c,Ha as d,Bt as e}; diff --git a/examples/assets/index-Cb0EycFm.js b/examples/assets/index-CO3KVvRB.js similarity index 52% rename from examples/assets/index-Cb0EycFm.js rename to examples/assets/index-CO3KVvRB.js index 974810ccd..722cb4647 100644 --- a/examples/assets/index-Cb0EycFm.js +++ b/examples/assets/index-CO3KVvRB.js @@ -1,46 +1,46 @@ -import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I as Uo,f as qr,u as Yr,z as di,h as Xr}from"./index-DtdmE_hK.js";import{V as vn,c as Si,G as zn,F as Jr,L as Qr,d as Fn,e as Zr,f as Kr,P as ti,g as ye,D as ta,A as ea,C as ze,O as ia,h as na,I as oa,R as sa,i as Vo,j as Wo,k as ra,l as Go,m as aa,n as la,o as qo,p as Yo,q as ca}from"./web-ifc-api-JuXSH2nk.js";import{X as da,r as ua,$ as L}from"./index-Cm7YlCft.js";var ha=Object.defineProperty,pa=(e,t,i)=>t in e?ha(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,It=(e,t,i)=>(pa(e,typeof t!="symbol"?t+"":t,i),i);const Jt=Math.min,ht=Math.max,ui=Math.round,$t=e=>({x:e,y:e}),ma={left:"right",right:"left",bottom:"top",top:"bottom"},ba={start:"end",end:"start"};function Hn(e,t,i){return ht(e,Jt(t,i))}function Fe(e,t){return typeof e=="function"?e(t):e}function mt(e){return e.split("-")[0]}function ki(e){return e.split("-")[1]}function Xo(e){return e==="x"?"y":"x"}function Jo(e){return e==="y"?"height":"width"}function Dt(e){return["top","bottom"].includes(mt(e))?"y":"x"}function Qo(e){return Xo(Dt(e))}function fa(e,t,i){i===void 0&&(i=!1);const n=ki(e),o=Qo(e),s=Jo(o);let r=o==="x"?n===(i?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=hi(r)),[r,hi(r)]}function ga(e){const t=hi(e);return[Ki(e),t,Ki(t)]}function Ki(e){return e.replace(/start|end/g,t=>ba[t])}function va(e,t,i){const n=["left","right"],o=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return i?t?o:n:t?n:o;case"left":case"right":return t?s:r;default:return[]}}function ya(e,t,i,n){const o=ki(e);let s=va(mt(e),i==="start",n);return o&&(s=s.map(r=>r+"-"+o),t&&(s=s.concat(s.map(Ki)))),s}function hi(e){return e.replace(/left|right|bottom|top/g,t=>ma[t])}function _a(e){return{top:0,right:0,bottom:0,left:0,...e}}function Zo(e){return typeof e!="number"?_a(e):{top:e,right:e,bottom:e,left:e}}function Qt(e){const{x:t,y:i,width:n,height:o}=e;return{width:n,height:o,top:i,left:t,right:t+n,bottom:i+o,x:t,y:i}}function Bn(e,t,i){let{reference:n,floating:o}=e;const s=Dt(t),r=Qo(t),a=Jo(r),l=mt(t),d=s==="y",u=n.x+n.width/2-o.width/2,c=n.y+n.height/2-o.height/2,h=n[a]/2-o[a]/2;let p;switch(l){case"top":p={x:u,y:n.y-o.height};break;case"bottom":p={x:u,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:c};break;case"left":p={x:n.x-o.width,y:c};break;default:p={x:n.x,y:n.y}}switch(ki(t)){case"start":p[r]-=h*(i&&d?-1:1);break;case"end":p[r]+=h*(i&&d?-1:1);break}return p}const xa=async(e,t,i)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=i,a=s.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let d=await r.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:c}=Bn(d,n,l),h=n,p={},g=0;for(let _=0;_j<=0)){var k,U;const j=(((k=s.flip)==null?void 0:k.index)||0)+1,ct=A[j];if(ct)return{data:{index:j,overflows:S},reset:{placement:ct}};let it=(U=S.filter(nt=>nt.overflows[0]<=0).sort((nt,q)=>nt.overflows[1]-q.overflows[1])[0])==null?void 0:U.placement;if(!it)switch(p){case"bestFit":{var vt;const nt=(vt=S.filter(q=>{if(C){const ot=Dt(q.placement);return ot===y||ot==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(ot=>ot>0).reduce((ot,ge)=>ot+ge,0)]).sort((q,ot)=>q[1]-ot[1])[0])==null?void 0:vt[0];nt&&(it=nt);break}case"initialPlacement":it=a;break}if(o!==it)return{reset:{placement:it}}}return{}}}};function ts(e){const t=Jt(...e.map(s=>s.left)),i=Jt(...e.map(s=>s.top)),n=ht(...e.map(s=>s.right)),o=ht(...e.map(s=>s.bottom));return{x:t,y:i,width:n-t,height:o-i}}function $a(e){const t=e.slice().sort((o,s)=>o.y-s.y),i=[];let n=null;for(let o=0;on.height/2?i.push([s]):i[i.length-1].push(s),n=s}return i.map(o=>Qt(ts(o)))}const Ca=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:i,elements:n,rects:o,platform:s,strategy:r}=t,{padding:a=2,x:l,y:d}=Fe(e,t),u=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(n.reference))||[]),c=$a(u),h=Qt(ts(u)),p=Zo(a);function g(){if(c.length===2&&c[0].left>c[1].right&&l!=null&&d!=null)return c.find(v=>l>v.left-p.left&&lv.top-p.top&&d=2){if(Dt(i)==="y"){const S=c[0],k=c[c.length-1],U=mt(i)==="top",vt=S.top,j=k.bottom,ct=U?S.left:k.left,it=U?S.right:k.right,nt=it-ct,q=j-vt;return{top:vt,bottom:j,left:ct,right:it,width:nt,height:q,x:ct,y:vt}}const v=mt(i)==="left",f=ht(...c.map(S=>S.right)),y=Jt(...c.map(S=>S.left)),x=c.filter(S=>v?S.left===y:S.right===f),w=x[0].top,E=x[x.length-1].bottom,C=y,A=f,N=A-C,$=E-w;return{top:w,bottom:E,left:C,right:A,width:N,height:$,x:C,y:w}}return h}const _=await s.getElementRects({reference:{getBoundingClientRect:g},floating:n.floating,strategy:r});return o.reference.x!==_.reference.x||o.reference.y!==_.reference.y||o.reference.width!==_.reference.width||o.reference.height!==_.reference.height?{reset:{rects:_}}:{}}}};async function Ea(e,t){const{placement:i,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),r=mt(i),a=ki(i),l=Dt(i)==="y",d=["left","top"].includes(r)?-1:1,u=s&&l?-1:1,c=Fe(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...c};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),l?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const es=function(e){return{name:"offset",options:e,async fn(t){var i,n;const{x:o,y:s,placement:r,middlewareData:a}=t,l=await Ea(t,e);return r===((i=a.offset)==null?void 0:i.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:r}}}}},Aa=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:r=!1,limiter:a={fn:v=>{let{x:f,y}=v;return{x:f,y}}},...l}=Fe(e,t),d={x:i,y:n},u=await Ko(t,l),c=Dt(mt(o)),h=Xo(c);let p=d[h],g=d[c];if(s){const v=h==="y"?"top":"left",f=h==="y"?"bottom":"right",y=p+u[v],x=p-u[f];p=Hn(y,p,x)}if(r){const v=c==="y"?"top":"left",f=c==="y"?"bottom":"right",y=g+u[v],x=g-u[f];g=Hn(y,g,x)}const _=a.fn({...t,[h]:p,[c]:g});return{..._,data:{x:_.x-i,y:_.y-n}}}}};function Ct(e){return is(e)?(e.nodeName||"").toLowerCase():"#document"}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function At(e){var t;return(t=(is(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function is(e){return e instanceof Node||e instanceof V(e).Node}function st(e){return e instanceof Element||e instanceof V(e).Element}function rt(e){return e instanceof HTMLElement||e instanceof V(e).HTMLElement}function Un(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}function He(e){const{overflow:t,overflowX:i,overflowY:n,display:o}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&!["inline","contents"].includes(o)}function Sa(e){return["table","td","th"].includes(Ct(e))}function ka(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function yn(e){const t=_n(),i=st(e)?X(e):e;return i.transform!=="none"||i.perspective!=="none"||(i.containerType?i.containerType!=="normal":!1)||!t&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!t&&(i.filter?i.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(i.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(i.contain||"").includes(n))}function Oa(e){let t=Zt(e);for(;rt(t)&&!Oi(t);){if(yn(t))return t;if(ka(t))return null;t=Zt(t)}return null}function _n(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Oi(e){return["html","body","#document"].includes(Ct(e))}function X(e){return V(e).getComputedStyle(e)}function Ti(e){return st(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Zt(e){if(Ct(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Un(e)&&e.host||At(e);return Un(t)?t.host:t}function ns(e){const t=Zt(e);return Oi(t)?e.ownerDocument?e.ownerDocument.body:e.body:rt(t)&&He(t)?t:ns(t)}function tn(e,t,i){var n;t===void 0&&(t=[]),i===void 0&&(i=!0);const o=ns(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),r=V(o);if(s){const a=Ta(r);return t.concat(r,r.visualViewport||[],He(o)?o:[],a&&i?tn(a):[])}return t.concat(o,tn(o,[],i))}function Ta(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function os(e){const t=X(e);let i=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=rt(e),s=o?e.offsetWidth:i,r=o?e.offsetHeight:n,a=ui(i)!==s||ui(n)!==r;return a&&(i=s,n=r),{width:i,height:n,$:a}}function ss(e){return st(e)?e:e.contextElement}function Yt(e){const t=ss(e);if(!rt(t))return $t(1);const i=t.getBoundingClientRect(),{width:n,height:o,$:s}=os(t);let r=(s?ui(i.width):i.width)/n,a=(s?ui(i.height):i.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const Ia=$t(0);function rs(e){const t=V(e);return!_n()||!t.visualViewport?Ia:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Na(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==V(e)?!1:t}function ke(e,t,i,n){t===void 0&&(t=!1),i===void 0&&(i=!1);const o=e.getBoundingClientRect(),s=ss(e);let r=$t(1);t&&(n?st(n)&&(r=Yt(n)):r=Yt(e));const a=Na(s,i,n)?rs(s):$t(0);let l=(o.left+a.x)/r.x,d=(o.top+a.y)/r.y,u=o.width/r.x,c=o.height/r.y;if(s){const h=V(s),p=n&&st(n)?V(n):n;let g=h,_=g.frameElement;for(;_&&n&&p!==g;){const v=Yt(_),f=_.getBoundingClientRect(),y=X(_),x=f.left+(_.clientLeft+parseFloat(y.paddingLeft))*v.x,w=f.top+(_.clientTop+parseFloat(y.paddingTop))*v.y;l*=v.x,d*=v.y,u*=v.x,c*=v.y,l+=x,d+=w,g=V(_),_=g.frameElement}}return Qt({width:u,height:c,x:l,y:d})}const Pa=[":popover-open",":modal"];function as(e){return Pa.some(t=>{try{return e.matches(t)}catch{return!1}})}function Ma(e){let{elements:t,rect:i,offsetParent:n,strategy:o}=e;const s=o==="fixed",r=At(n),a=t?as(t.floating):!1;if(n===r||a&&s)return i;let l={scrollLeft:0,scrollTop:0},d=$t(1);const u=$t(0),c=rt(n);if((c||!c&&!s)&&((Ct(n)!=="body"||He(r))&&(l=Ti(n)),rt(n))){const h=ke(n);d=Yt(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}return{width:i.width*d.x,height:i.height*d.y,x:i.x*d.x-l.scrollLeft*d.x+u.x,y:i.y*d.y-l.scrollTop*d.y+u.y}}function La(e){return Array.from(e.getClientRects())}function ls(e){return ke(At(e)).left+Ti(e).scrollLeft}function ja(e){const t=At(e),i=Ti(e),n=e.ownerDocument.body,o=ht(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=ht(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-i.scrollLeft+ls(e);const a=-i.scrollTop;return X(n).direction==="rtl"&&(r+=ht(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:r,y:a}}function Da(e,t){const i=V(e),n=At(e),o=i.visualViewport;let s=n.clientWidth,r=n.clientHeight,a=0,l=0;if(o){s=o.width,r=o.height;const d=_n();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:r,x:a,y:l}}function Ra(e,t){const i=ke(e,!0,t==="fixed"),n=i.top+e.clientTop,o=i.left+e.clientLeft,s=rt(e)?Yt(e):$t(1),r=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,d=n*s.y;return{width:r,height:a,x:l,y:d}}function Vn(e,t,i){let n;if(t==="viewport")n=Da(e,i);else if(t==="document")n=ja(At(e));else if(st(t))n=Ra(t,i);else{const o=rs(e);n={...t,x:t.x-o.x,y:t.y-o.y}}return Qt(n)}function cs(e,t){const i=Zt(e);return i===t||!st(i)||Oi(i)?!1:X(i).position==="fixed"||cs(i,t)}function za(e,t){const i=t.get(e);if(i)return i;let n=tn(e,[],!1).filter(a=>st(a)&&Ct(a)!=="body"),o=null;const s=X(e).position==="fixed";let r=s?Zt(e):e;for(;st(r)&&!Oi(r);){const a=X(r),l=yn(r);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&o&&["absolute","fixed"].includes(o.position)||He(r)&&!l&&cs(e,r))?n=n.filter(d=>d!==r):o=a,r=Zt(r)}return t.set(e,n),n}function Fa(e){let{element:t,boundary:i,rootBoundary:n,strategy:o}=e;const s=[...i==="clippingAncestors"?za(t,this._c):[].concat(i),n],r=s[0],a=s.reduce((l,d)=>{const u=Vn(t,d,o);return l.top=ht(u.top,l.top),l.right=Jt(u.right,l.right),l.bottom=Jt(u.bottom,l.bottom),l.left=ht(u.left,l.left),l},Vn(t,r,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Ha(e){const{width:t,height:i}=os(e);return{width:t,height:i}}function Ba(e,t,i){const n=rt(t),o=At(t),s=i==="fixed",r=ke(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=$t(0);if(n||!n&&!s)if((Ct(t)!=="body"||He(o))&&(a=Ti(t)),n){const c=ke(t,!0,s,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=ls(o));const d=r.left+a.scrollLeft-l.x,u=r.top+a.scrollTop-l.y;return{x:d,y:u,width:r.width,height:r.height}}function Wn(e,t){return!rt(e)||X(e).position==="fixed"?null:t?t(e):e.offsetParent}function ds(e,t){const i=V(e);if(!rt(e)||as(e))return i;let n=Wn(e,t);for(;n&&Sa(n)&&X(n).position==="static";)n=Wn(n,t);return n&&(Ct(n)==="html"||Ct(n)==="body"&&X(n).position==="static"&&!yn(n))?i:n||Oa(e)||i}const Ua=async function(e){const t=this.getOffsetParent||ds,i=this.getDimensions;return{reference:Ba(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await i(e.floating)}}};function Va(e){return X(e).direction==="rtl"}const Wa={convertOffsetParentRelativeRectToViewportRelativeRect:Ma,getDocumentElement:At,getClippingRect:Fa,getOffsetParent:ds,getElementRects:Ua,getClientRects:La,getDimensions:Ha,getScale:Yt,isElement:st,isRTL:Va},us=Aa,hs=wa,ps=Ca,ms=(e,t,i)=>{const n=new Map,o={platform:Wa,...i},s={...o.platform,_c:n};return xa(e,t,{...o,platform:s})};/** +import{M as Be,s as $n,A as Ni,e as Qo,_ as Ko,O as Zo,T as Bt,k as ct,N as ea,a as ts,y as ia,U as na,Q as oa,b as vt,C as pi}from"./index-6e07lNWw.js";import{V as Cn,c as Ii,C as ae,G as qn,F as sa,L as ra,d as Yn,e as aa,f as la,P as ni,g as _e,D as ca,A as da,O as ua,h as ha,I as pa,R as ma,i as es,j as is,k as ba,l as ns,m as fa,n as ga,o as os,p as ss,q as va,r as ya}from"./web-ifc-api-Dlf_dxms.js";import{n as _a,P as R,u as xa}from"./index-DDq_E_eW.js";var wa=Object.defineProperty,$a=(e,t,i)=>t in e?wa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Nt=(e,t,i)=>($a(e,typeof t!="symbol"?t+"":t,i),i);const Jt=Math.min,ht=Math.max,mi=Math.round,$t=e=>({x:e,y:e}),Ca={left:"right",right:"left",bottom:"top",top:"bottom"},Aa={start:"end",end:"start"};function Xn(e,t,i){return ht(e,Jt(t,i))}function Ue(e,t){return typeof e=="function"?e(t):e}function mt(e){return e.split("-")[0]}function Pi(e){return e.split("-")[1]}function rs(e){return e==="x"?"y":"x"}function as(e){return e==="y"?"height":"width"}function jt(e){return["top","bottom"].includes(mt(e))?"y":"x"}function ls(e){return rs(jt(e))}function Ea(e,t,i){i===void 0&&(i=!1);const n=Pi(e),o=ls(e),s=as(o);let r=o==="x"?n===(i?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=bi(r)),[r,bi(r)]}function Sa(e){const t=bi(e);return[rn(e),t,rn(t)]}function rn(e){return e.replace(/start|end/g,t=>Aa[t])}function ka(e,t,i){const n=["left","right"],o=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return i?t?o:n:t?n:o;case"left":case"right":return t?s:r;default:return[]}}function Ta(e,t,i,n){const o=Pi(e);let s=ka(mt(e),i==="start",n);return o&&(s=s.map(r=>r+"-"+o),t&&(s=s.concat(s.map(rn)))),s}function bi(e){return e.replace(/left|right|bottom|top/g,t=>Ca[t])}function Oa(e){return{top:0,right:0,bottom:0,left:0,...e}}function cs(e){return typeof e!="number"?Oa(e):{top:e,right:e,bottom:e,left:e}}function Qt(e){const{x:t,y:i,width:n,height:o}=e;return{width:n,height:o,top:i,left:t,right:t+n,bottom:i+o,x:t,y:i}}function Jn(e,t,i){let{reference:n,floating:o}=e;const s=jt(t),r=ls(t),a=as(r),l=mt(t),d=s==="y",u=n.x+n.width/2-o.width/2,c=n.y+n.height/2-o.height/2,h=n[a]/2-o[a]/2;let p;switch(l){case"top":p={x:u,y:n.y-o.height};break;case"bottom":p={x:u,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:c};break;case"left":p={x:n.x-o.width,y:c};break;default:p={x:n.x,y:n.y}}switch(Pi(t)){case"start":p[r]-=h*(i&&d?-1:1);break;case"end":p[r]+=h*(i&&d?-1:1);break}return p}const Na=async(e,t,i)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=i,a=s.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let d=await r.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:c}=Jn(d,n,l),h=n,p={},b=0;for(let v=0;v$<=0)){var B,E;const $=(((B=s.flip)==null?void 0:B.index)||0)+1,et=N[$];if(et)return{data:{index:$,overflows:S},reset:{placement:et}};let ot=(E=S.filter(st=>st.overflows[0]<=0).sort((st,X)=>st.overflows[1]-X.overflows[1])[0])==null?void 0:E.placement;if(!ot)switch(p){case"bestFit":{var M;const st=(M=S.filter(X=>{if(C){const rt=jt(X.placement);return rt===_||rt==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(rt=>rt>0).reduce((rt,ve)=>rt+ve,0)]).sort((X,rt)=>X[1]-rt[1])[0])==null?void 0:M[0];st&&(ot=st);break}case"initialPlacement":ot=a;break}if(o!==ot)return{reset:{placement:ot}}}return{}}}};function us(e){const t=Jt(...e.map(s=>s.left)),i=Jt(...e.map(s=>s.top)),n=ht(...e.map(s=>s.right)),o=ht(...e.map(s=>s.bottom));return{x:t,y:i,width:n-t,height:o-i}}function Pa(e){const t=e.slice().sort((o,s)=>o.y-s.y),i=[];let n=null;for(let o=0;on.height/2?i.push([s]):i[i.length-1].push(s),n=s}return i.map(o=>Qt(us(o)))}const Ma=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:i,elements:n,rects:o,platform:s,strategy:r}=t,{padding:a=2,x:l,y:d}=Ue(e,t),u=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(n.reference))||[]),c=Pa(u),h=Qt(us(u)),p=cs(a);function b(){if(c.length===2&&c[0].left>c[1].right&&l!=null&&d!=null)return c.find(y=>l>y.left-p.left&&ly.top-p.top&&d=2){if(jt(i)==="y"){const S=c[0],B=c[c.length-1],E=mt(i)==="top",M=S.top,$=B.bottom,et=E?S.left:B.left,ot=E?S.right:B.right,st=ot-et,X=$-M;return{top:M,bottom:$,left:et,right:ot,width:st,height:X,x:et,y:M}}const y=mt(i)==="left",g=ht(...c.map(S=>S.right)),_=Jt(...c.map(S=>S.left)),x=c.filter(S=>y?S.left===_:S.right===g),w=x[0].top,A=x[x.length-1].bottom,C=_,N=g,L=N-C,k=A-w;return{top:w,bottom:A,left:C,right:N,width:L,height:k,x:C,y:w}}return h}const v=await s.getElementRects({reference:{getBoundingClientRect:b},floating:n.floating,strategy:r});return o.reference.x!==v.reference.x||o.reference.y!==v.reference.y||o.reference.width!==v.reference.width||o.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}};async function La(e,t){const{placement:i,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),r=mt(i),a=Pi(i),l=jt(i)==="y",d=["left","top"].includes(r)?-1:1,u=s&&l?-1:1,c=Ue(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:b}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...c};return a&&typeof b=="number"&&(p=a==="end"?b*-1:b),l?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const hs=function(e){return{name:"offset",options:e,async fn(t){var i,n;const{x:o,y:s,placement:r,middlewareData:a}=t,l=await La(t,e);return r===((i=a.offset)==null?void 0:i.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:r}}}}},Ra=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:r=!1,limiter:a={fn:y=>{let{x:g,y:_}=y;return{x:g,y:_}}},...l}=Ue(e,t),d={x:i,y:n},u=await ds(t,l),c=jt(mt(o)),h=rs(c);let p=d[h],b=d[c];if(s){const y=h==="y"?"top":"left",g=h==="y"?"bottom":"right",_=p+u[y],x=p-u[g];p=Xn(_,p,x)}if(r){const y=c==="y"?"top":"left",g=c==="y"?"bottom":"right",_=b+u[y],x=b-u[g];b=Xn(_,b,x)}const v=a.fn({...t,[h]:p,[c]:b});return{...v,data:{x:v.x-i,y:v.y-n}}}}};function Ct(e){return ps(e)?(e.nodeName||"").toLowerCase():"#document"}function q(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Et(e){var t;return(t=(ps(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ps(e){return e instanceof Node||e instanceof q(e).Node}function at(e){return e instanceof Element||e instanceof q(e).Element}function lt(e){return e instanceof HTMLElement||e instanceof q(e).HTMLElement}function Qn(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof q(e).ShadowRoot}function Ve(e){const{overflow:t,overflowX:i,overflowY:n,display:o}=Q(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&!["inline","contents"].includes(o)}function Da(e){return["table","td","th"].includes(Ct(e))}function ja(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function An(e){const t=En(),i=at(e)?Q(e):e;return i.transform!=="none"||i.perspective!=="none"||(i.containerType?i.containerType!=="normal":!1)||!t&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!t&&(i.filter?i.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(i.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(i.contain||"").includes(n))}function za(e){let t=Kt(e);for(;lt(t)&&!Mi(t);){if(An(t))return t;if(ja(t))return null;t=Kt(t)}return null}function En(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Mi(e){return["html","body","#document"].includes(Ct(e))}function Q(e){return q(e).getComputedStyle(e)}function Li(e){return at(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Kt(e){if(Ct(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Qn(e)&&e.host||Et(e);return Qn(t)?t.host:t}function ms(e){const t=Kt(e);return Mi(t)?e.ownerDocument?e.ownerDocument.body:e.body:lt(t)&&Ve(t)?t:ms(t)}function an(e,t,i){var n;t===void 0&&(t=[]),i===void 0&&(i=!0);const o=ms(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),r=q(o);if(s){const a=Fa(r);return t.concat(r,r.visualViewport||[],Ve(o)?o:[],a&&i?an(a):[])}return t.concat(o,an(o,[],i))}function Fa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bs(e){const t=Q(e);let i=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=lt(e),s=o?e.offsetWidth:i,r=o?e.offsetHeight:n,a=mi(i)!==s||mi(n)!==r;return a&&(i=s,n=r),{width:i,height:n,$:a}}function fs(e){return at(e)?e:e.contextElement}function Xt(e){const t=fs(e);if(!lt(t))return $t(1);const i=t.getBoundingClientRect(),{width:n,height:o,$:s}=bs(t);let r=(s?mi(i.width):i.width)/n,a=(s?mi(i.height):i.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const Ha=$t(0);function gs(e){const t=q(e);return!En()||!t.visualViewport?Ha:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ba(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==q(e)?!1:t}function Ie(e,t,i,n){t===void 0&&(t=!1),i===void 0&&(i=!1);const o=e.getBoundingClientRect(),s=fs(e);let r=$t(1);t&&(n?at(n)&&(r=Xt(n)):r=Xt(e));const a=Ba(s,i,n)?gs(s):$t(0);let l=(o.left+a.x)/r.x,d=(o.top+a.y)/r.y,u=o.width/r.x,c=o.height/r.y;if(s){const h=q(s),p=n&&at(n)?q(n):n;let b=h,v=b.frameElement;for(;v&&n&&p!==b;){const y=Xt(v),g=v.getBoundingClientRect(),_=Q(v),x=g.left+(v.clientLeft+parseFloat(_.paddingLeft))*y.x,w=g.top+(v.clientTop+parseFloat(_.paddingTop))*y.y;l*=y.x,d*=y.y,u*=y.x,c*=y.y,l+=x,d+=w,b=q(v),v=b.frameElement}}return Qt({width:u,height:c,x:l,y:d})}const Ua=[":popover-open",":modal"];function vs(e){return Ua.some(t=>{try{return e.matches(t)}catch{return!1}})}function Va(e){let{elements:t,rect:i,offsetParent:n,strategy:o}=e;const s=o==="fixed",r=Et(n),a=t?vs(t.floating):!1;if(n===r||a&&s)return i;let l={scrollLeft:0,scrollTop:0},d=$t(1);const u=$t(0),c=lt(n);if((c||!c&&!s)&&((Ct(n)!=="body"||Ve(r))&&(l=Li(n)),lt(n))){const h=Ie(n);d=Xt(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}return{width:i.width*d.x,height:i.height*d.y,x:i.x*d.x-l.scrollLeft*d.x+u.x,y:i.y*d.y-l.scrollTop*d.y+u.y}}function Wa(e){return Array.from(e.getClientRects())}function ys(e){return Ie(Et(e)).left+Li(e).scrollLeft}function Ga(e){const t=Et(e),i=Li(e),n=e.ownerDocument.body,o=ht(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=ht(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-i.scrollLeft+ys(e);const a=-i.scrollTop;return Q(n).direction==="rtl"&&(r+=ht(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:r,y:a}}function qa(e,t){const i=q(e),n=Et(e),o=i.visualViewport;let s=n.clientWidth,r=n.clientHeight,a=0,l=0;if(o){s=o.width,r=o.height;const d=En();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:r,x:a,y:l}}function Ya(e,t){const i=Ie(e,!0,t==="fixed"),n=i.top+e.clientTop,o=i.left+e.clientLeft,s=lt(e)?Xt(e):$t(1),r=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,d=n*s.y;return{width:r,height:a,x:l,y:d}}function Kn(e,t,i){let n;if(t==="viewport")n=qa(e,i);else if(t==="document")n=Ga(Et(e));else if(at(t))n=Ya(t,i);else{const o=gs(e);n={...t,x:t.x-o.x,y:t.y-o.y}}return Qt(n)}function _s(e,t){const i=Kt(e);return i===t||!at(i)||Mi(i)?!1:Q(i).position==="fixed"||_s(i,t)}function Xa(e,t){const i=t.get(e);if(i)return i;let n=an(e,[],!1).filter(a=>at(a)&&Ct(a)!=="body"),o=null;const s=Q(e).position==="fixed";let r=s?Kt(e):e;for(;at(r)&&!Mi(r);){const a=Q(r),l=An(r);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&o&&["absolute","fixed"].includes(o.position)||Ve(r)&&!l&&_s(e,r))?n=n.filter(d=>d!==r):o=a,r=Kt(r)}return t.set(e,n),n}function Ja(e){let{element:t,boundary:i,rootBoundary:n,strategy:o}=e;const s=[...i==="clippingAncestors"?Xa(t,this._c):[].concat(i),n],r=s[0],a=s.reduce((l,d)=>{const u=Kn(t,d,o);return l.top=ht(u.top,l.top),l.right=Jt(u.right,l.right),l.bottom=Jt(u.bottom,l.bottom),l.left=ht(u.left,l.left),l},Kn(t,r,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Qa(e){const{width:t,height:i}=bs(e);return{width:t,height:i}}function Ka(e,t,i){const n=lt(t),o=Et(t),s=i==="fixed",r=Ie(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=$t(0);if(n||!n&&!s)if((Ct(t)!=="body"||Ve(o))&&(a=Li(t)),n){const c=Ie(t,!0,s,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=ys(o));const d=r.left+a.scrollLeft-l.x,u=r.top+a.scrollTop-l.y;return{x:d,y:u,width:r.width,height:r.height}}function Zn(e,t){return!lt(e)||Q(e).position==="fixed"?null:t?t(e):e.offsetParent}function xs(e,t){const i=q(e);if(!lt(e)||vs(e))return i;let n=Zn(e,t);for(;n&&Da(n)&&Q(n).position==="static";)n=Zn(n,t);return n&&(Ct(n)==="html"||Ct(n)==="body"&&Q(n).position==="static"&&!An(n))?i:n||za(e)||i}const Za=async function(e){const t=this.getOffsetParent||xs,i=this.getDimensions;return{reference:Ka(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await i(e.floating)}}};function tl(e){return Q(e).direction==="rtl"}const el={convertOffsetParentRelativeRectToViewportRelativeRect:Va,getDocumentElement:Et,getClippingRect:Ja,getOffsetParent:xs,getElementRects:Za,getClientRects:Wa,getDimensions:Qa,getScale:Xt,isElement:at,isRTL:tl},ws=Ra,$s=Ia,Cs=Ma,As=(e,t,i)=>{const n=new Map,o={platform:el,...i},s={...o.platform,_c:n};return Na(e,t,{...o,platform:s})};/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const oi=globalThis,xn=oi.ShadowRoot&&(oi.ShadyCSS===void 0||oi.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,wn=Symbol(),Gn=new WeakMap;let bs=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==wn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(xn&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=Gn.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Gn.set(t,e))}return e}toString(){return this.cssText}};const Ga=e=>new bs(typeof e=="string"?e:e+"",void 0,wn),I=(e,...t)=>{const i=e.length===1?e[0]:t.reduce((n,o,s)=>n+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+e[s+1],e[0]);return new bs(i,e,wn)},qa=(e,t)=>{if(xn)e.adoptedStyleSheets=t.map(i=>i instanceof CSSStyleSheet?i:i.styleSheet);else for(const i of t){const n=document.createElement("style"),o=oi.litNonce;o!==void 0&&n.setAttribute("nonce",o),n.textContent=i.cssText,e.appendChild(n)}},qn=xn?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let i="";for(const n of t.cssRules)i+=n.cssText;return Ga(i)})(e):e;/** + */const ai=globalThis,Sn=ai.ShadowRoot&&(ai.ShadyCSS===void 0||ai.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,kn=Symbol(),to=new WeakMap;let Es=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==kn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Sn&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=to.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&to.set(t,e))}return e}toString(){return this.cssText}};const il=e=>new Es(typeof e=="string"?e:e+"",void 0,kn),I=(e,...t)=>{const i=e.length===1?e[0]:t.reduce((n,o,s)=>n+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+e[s+1],e[0]);return new Es(i,e,kn)},nl=(e,t)=>{if(Sn)e.adoptedStyleSheets=t.map(i=>i instanceof CSSStyleSheet?i:i.styleSheet);else for(const i of t){const n=document.createElement("style"),o=ai.litNonce;o!==void 0&&n.setAttribute("nonce",o),n.textContent=i.cssText,e.appendChild(n)}},eo=Sn?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let i="";for(const n of t.cssRules)i+=n.cssText;return il(i)})(e):e;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const{is:Ya,defineProperty:Xa,getOwnPropertyDescriptor:Ja,getOwnPropertyNames:Qa,getOwnPropertySymbols:Za,getPrototypeOf:Ka}=Object,Kt=globalThis,Yn=Kt.trustedTypes,tl=Yn?Yn.emptyScript:"",Xn=Kt.reactiveElementPolyfillSupport,$e=(e,t)=>e,pi={toAttribute(e,t){switch(t){case Boolean:e=e?tl:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=e!==null;break;case Number:i=e===null?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch{i=null}}return i}},$n=(e,t)=>!Ya(e,t),Jn={attribute:!0,type:String,converter:pi,reflect:!1,hasChanged:$n};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Kt.litPropertyMetadata??(Kt.litPropertyMetadata=new WeakMap);class Gt extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,i=Jn){if(i.state&&(i.attribute=!1),this._$Ei(),this.elementProperties.set(t,i),!i.noAccessor){const n=Symbol(),o=this.getPropertyDescriptor(t,n,i);o!==void 0&&Xa(this.prototype,t,o)}}static getPropertyDescriptor(t,i,n){const{get:o,set:s}=Ja(this.prototype,t)??{get(){return this[i]},set(r){this[i]=r}};return{get(){return o==null?void 0:o.call(this)},set(r){const a=o==null?void 0:o.call(this);s.call(this,r),this.requestUpdate(t,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Jn}static _$Ei(){if(this.hasOwnProperty($e("elementProperties")))return;const t=Ka(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty($e("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty($e("properties"))){const i=this.properties,n=[...Qa(i),...Za(i)];for(const o of n)this.createProperty(o,i[o])}const t=this[Symbol.metadata];if(t!==null){const i=litPropertyMetadata.get(t);if(i!==void 0)for(const[n,o]of i)this.elementProperties.set(n,o)}this._$Eh=new Map;for(const[i,n]of this.elementProperties){const o=this._$Eu(i,n);o!==void 0&&this._$Eh.set(o,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const o of n)i.unshift(qn(o))}else t!==void 0&&i.push(qn(t));return i}static _$Eu(t,i){const n=i.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(i=>this.enableUpdating=i),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(i=>i(this))}addController(t){var i;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)==null||i.call(t))}removeController(t){var i;(i=this._$EO)==null||i.delete(t)}_$E_(){const t=new Map,i=this.constructor.elementProperties;for(const n of i.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return qa(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(i=>{var n;return(n=i.hostConnected)==null?void 0:n.call(i)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(i=>{var n;return(n=i.hostDisconnected)==null?void 0:n.call(i)})}attributeChangedCallback(t,i,n){this._$AK(t,n)}_$EC(t,i){var n;const o=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,o);if(s!==void 0&&o.reflect===!0){const r=(((n=o.converter)==null?void 0:n.toAttribute)!==void 0?o.converter:pi).toAttribute(i,o.type);this._$Em=t,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(t,i){var n;const o=this.constructor,s=o._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const r=o.getPropertyOptions(s),a=typeof r.converter=="function"?{fromAttribute:r.converter}:((n=r.converter)==null?void 0:n.fromAttribute)!==void 0?r.converter:pi;this._$Em=s,this[s]=a.fromAttribute(i,r.type),this._$Em=null}}requestUpdate(t,i,n){if(t!==void 0){if(n??(n=this.constructor.getPropertyOptions(t)),!(n.hasChanged??$n)(this[t],i))return;this.P(t,i,n)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,i,n){this._$AL.has(t)||this._$AL.set(t,i),n.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,r]of this._$Ep)this[s]=r;this._$Ep=void 0}const o=this.constructor.elementProperties;if(o.size>0)for(const[s,r]of o)r.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],r)}let i=!1;const n=this._$AL;try{i=this.shouldUpdate(n),i?(this.willUpdate(n),(t=this._$EO)==null||t.forEach(o=>{var s;return(s=o.hostUpdate)==null?void 0:s.call(o)}),this.update(n)):this._$EU()}catch(o){throw i=!1,this._$EU(),o}i&&this._$AE(n)}willUpdate(t){}_$AE(t){var i;(i=this._$EO)==null||i.forEach(n=>{var o;return(o=n.hostUpdated)==null?void 0:o.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(i=>this._$EC(i,this[i]))),this._$EU()}updated(t){}firstUpdated(t){}}Gt.elementStyles=[],Gt.shadowRootOptions={mode:"open"},Gt[$e("elementProperties")]=new Map,Gt[$e("finalized")]=new Map,Xn==null||Xn({ReactiveElement:Gt}),(Kt.reactiveElementVersions??(Kt.reactiveElementVersions=[])).push("2.0.4");/** + */const{is:ol,defineProperty:sl,getOwnPropertyDescriptor:rl,getOwnPropertyNames:al,getOwnPropertySymbols:ll,getPrototypeOf:cl}=Object,Zt=globalThis,io=Zt.trustedTypes,dl=io?io.emptyScript:"",no=Zt.reactiveElementPolyfillSupport,Ae=(e,t)=>e,fi={toAttribute(e,t){switch(t){case Boolean:e=e?dl:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=e!==null;break;case Number:i=e===null?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch{i=null}}return i}},Tn=(e,t)=>!ol(e,t),oo={attribute:!0,type:String,converter:fi,reflect:!1,hasChanged:Tn};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Zt.litPropertyMetadata??(Zt.litPropertyMetadata=new WeakMap);class qt extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,i=oo){if(i.state&&(i.attribute=!1),this._$Ei(),this.elementProperties.set(t,i),!i.noAccessor){const n=Symbol(),o=this.getPropertyDescriptor(t,n,i);o!==void 0&&sl(this.prototype,t,o)}}static getPropertyDescriptor(t,i,n){const{get:o,set:s}=rl(this.prototype,t)??{get(){return this[i]},set(r){this[i]=r}};return{get(){return o==null?void 0:o.call(this)},set(r){const a=o==null?void 0:o.call(this);s.call(this,r),this.requestUpdate(t,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??oo}static _$Ei(){if(this.hasOwnProperty(Ae("elementProperties")))return;const t=cl(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Ae("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ae("properties"))){const i=this.properties,n=[...al(i),...ll(i)];for(const o of n)this.createProperty(o,i[o])}const t=this[Symbol.metadata];if(t!==null){const i=litPropertyMetadata.get(t);if(i!==void 0)for(const[n,o]of i)this.elementProperties.set(n,o)}this._$Eh=new Map;for(const[i,n]of this.elementProperties){const o=this._$Eu(i,n);o!==void 0&&this._$Eh.set(o,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const o of n)i.unshift(eo(o))}else t!==void 0&&i.push(eo(t));return i}static _$Eu(t,i){const n=i.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(i=>this.enableUpdating=i),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(i=>i(this))}addController(t){var i;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)==null||i.call(t))}removeController(t){var i;(i=this._$EO)==null||i.delete(t)}_$E_(){const t=new Map,i=this.constructor.elementProperties;for(const n of i.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return nl(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(i=>{var n;return(n=i.hostConnected)==null?void 0:n.call(i)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(i=>{var n;return(n=i.hostDisconnected)==null?void 0:n.call(i)})}attributeChangedCallback(t,i,n){this._$AK(t,n)}_$EC(t,i){var n;const o=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,o);if(s!==void 0&&o.reflect===!0){const r=(((n=o.converter)==null?void 0:n.toAttribute)!==void 0?o.converter:fi).toAttribute(i,o.type);this._$Em=t,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(t,i){var n;const o=this.constructor,s=o._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const r=o.getPropertyOptions(s),a=typeof r.converter=="function"?{fromAttribute:r.converter}:((n=r.converter)==null?void 0:n.fromAttribute)!==void 0?r.converter:fi;this._$Em=s,this[s]=a.fromAttribute(i,r.type),this._$Em=null}}requestUpdate(t,i,n){if(t!==void 0){if(n??(n=this.constructor.getPropertyOptions(t)),!(n.hasChanged??Tn)(this[t],i))return;this.P(t,i,n)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,i,n){this._$AL.has(t)||this._$AL.set(t,i),n.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,r]of this._$Ep)this[s]=r;this._$Ep=void 0}const o=this.constructor.elementProperties;if(o.size>0)for(const[s,r]of o)r.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],r)}let i=!1;const n=this._$AL;try{i=this.shouldUpdate(n),i?(this.willUpdate(n),(t=this._$EO)==null||t.forEach(o=>{var s;return(s=o.hostUpdate)==null?void 0:s.call(o)}),this.update(n)):this._$EU()}catch(o){throw i=!1,this._$EU(),o}i&&this._$AE(n)}willUpdate(t){}_$AE(t){var i;(i=this._$EO)==null||i.forEach(n=>{var o;return(o=n.hostUpdated)==null?void 0:o.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(i=>this._$EC(i,this[i]))),this._$EU()}updated(t){}firstUpdated(t){}}qt.elementStyles=[],qt.shadowRootOptions={mode:"open"},qt[Ae("elementProperties")]=new Map,qt[Ae("finalized")]=new Map,no==null||no({ReactiveElement:qt}),(Zt.reactiveElementVersions??(Zt.reactiveElementVersions=[])).push("2.0.4");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const mi=globalThis,bi=mi.trustedTypes,Qn=bi?bi.createPolicy("lit-html",{createHTML:e=>e}):void 0,fs="$lit$",xt=`lit$${Math.random().toFixed(9).slice(2)}$`,gs="?"+xt,el=`<${gs}>`,Rt=document,Oe=()=>Rt.createComment(""),Te=e=>e===null||typeof e!="object"&&typeof e!="function",Cn=Array.isArray,il=e=>Cn(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",Ui=`[ -\f\r]`,_e=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Zn=/-->/g,Kn=/>/g,Nt=RegExp(`>|${Ui}(?:([^\\s"'>=/]+)(${Ui}*=${Ui}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),to=/'/g,eo=/"/g,vs=/^(?:script|style|textarea|title)$/i,nl=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),m=nl(1),zt=Symbol.for("lit-noChange"),M=Symbol.for("lit-nothing"),io=new WeakMap,Mt=Rt.createTreeWalker(Rt,129);function ys(e,t){if(!Cn(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Qn!==void 0?Qn.createHTML(t):t}const ol=(e,t)=>{const i=e.length-1,n=[];let o,s=t===2?"":t===3?"":"",r=_e;for(let a=0;a"?(r=o??_e,c=-1):u[1]===void 0?c=-2:(c=r.lastIndex-u[2].length,d=u[1],r=u[3]===void 0?Nt:u[3]==='"'?eo:to):r===eo||r===to?r=Nt:r===Zn||r===Kn?r=_e:(r=Nt,o=void 0);const p=r===Nt&&e[a+1].startsWith("/>")?" ":"";s+=r===_e?l+el:c>=0?(n.push(d),l.slice(0,c)+fs+l.slice(c)+xt+p):l+xt+(c===-2?a:p)}return[ys(e,s+(e[i]||"")+(t===2?"":t===3?"":"")),n]};class Ie{constructor({strings:t,_$litType$:i},n){let o;this.parts=[];let s=0,r=0;const a=t.length-1,l=this.parts,[d,u]=ol(t,i);if(this.el=Ie.createElement(d,n),Mt.currentNode=this.el.content,i===2||i===3){const c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(o=Mt.nextNode())!==null&&l.length0){o.textContent=bi?bi.emptyScript:"";for(let p=0;p2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=M}_$AI(t,i=this,n,o){const s=this.strings;let r=!1;if(s===void 0)t=te(this,t,i,0),r=!Te(t)||t!==this._$AH&&t!==zt,r&&(this._$AH=t);else{const a=t;let l,d;for(t=s[0],l=0;l{const n=(i==null?void 0:i.renderBefore)??t;let o=n._$litPart$;if(o===void 0){const s=(i==null?void 0:i.renderBefore)??null;n._$litPart$=o=new Be(t.insertBefore(Oe(),s),s,void 0,i??{})}return o._$AI(e),o};/** + */const gi=globalThis,vi=gi.trustedTypes,so=vi?vi.createPolicy("lit-html",{createHTML:e=>e}):void 0,Ss="$lit$",xt=`lit$${Math.random().toFixed(9).slice(2)}$`,ks="?"+xt,ul=`<${ks}>`,zt=document,Pe=()=>zt.createComment(""),Me=e=>e===null||typeof e!="object"&&typeof e!="function",On=Array.isArray,hl=e=>On(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",Yi=`[ +\f\r]`,xe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ro=/-->/g,ao=/>/g,It=RegExp(`>|${Yi}(?:([^\\s"'>=/]+)(${Yi}*=${Yi}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),lo=/'/g,co=/"/g,Ts=/^(?:script|style|textarea|title)$/i,pl=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),m=pl(1),Ft=Symbol.for("lit-noChange"),D=Symbol.for("lit-nothing"),uo=new WeakMap,Mt=zt.createTreeWalker(zt,129);function Os(e,t){if(!On(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return so!==void 0?so.createHTML(t):t}const ml=(e,t)=>{const i=e.length-1,n=[];let o,s=t===2?"":t===3?"":"",r=xe;for(let a=0;a"?(r=o??xe,c=-1):u[1]===void 0?c=-2:(c=r.lastIndex-u[2].length,d=u[1],r=u[3]===void 0?It:u[3]==='"'?co:lo):r===co||r===lo?r=It:r===ro||r===ao?r=xe:(r=It,o=void 0);const p=r===It&&e[a+1].startsWith("/>")?" ":"";s+=r===xe?l+ul:c>=0?(n.push(d),l.slice(0,c)+Ss+l.slice(c)+xt+p):l+xt+(c===-2?a:p)}return[Os(e,s+(e[i]||"")+(t===2?"":t===3?"":"")),n]};class Le{constructor({strings:t,_$litType$:i},n){let o;this.parts=[];let s=0,r=0;const a=t.length-1,l=this.parts,[d,u]=ml(t,i);if(this.el=Le.createElement(d,n),Mt.currentNode=this.el.content,i===2||i===3){const c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(o=Mt.nextNode())!==null&&l.length0){o.textContent=vi?vi.emptyScript:"";for(let p=0;p2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=D}_$AI(t,i=this,n,o){const s=this.strings;let r=!1;if(s===void 0)t=te(this,t,i,0),r=!Me(t)||t!==this._$AH&&t!==Ft,r&&(this._$AH=t);else{const a=t;let l,d;for(t=s[0],l=0;l{const n=(i==null?void 0:i.renderBefore)??t;let o=n._$litPart$;if(o===void 0){const s=(i==null?void 0:i.renderBefore)??null;n._$litPart$=o=new We(t.insertBefore(Pe(),s),s,void 0,i??{})}return o._$AI(e),o};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */let T=class extends Gt{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.o=ee(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this.o)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.o)==null||e.setConnected(!1)}render(){return zt}};var oo;T._$litElement$=!0,T.finalized=!0,(oo=globalThis.litElementHydrateSupport)==null||oo.call(globalThis,{LitElement:T});const so=globalThis.litElementPolyfillSupport;so==null||so({LitElement:T});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.0");/** + */let O=class extends qt{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.o=ee(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this.o)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.o)==null||e.setConnected(!1)}render(){return Ft}};var po;O._$litElement$=!0,O.finalized=!0,(po=globalThis.litElementHydrateSupport)==null||po.call(globalThis,{LitElement:O});const mo=globalThis.litElementPolyfillSupport;mo==null||mo({LitElement:O});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.0");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const dl={attribute:!0,type:String,converter:pi,reflect:!1,hasChanged:$n},ul=(e=dl,t,i)=>{const{kind:n,metadata:o}=i;let s=globalThis.litPropertyMetadata.get(o);if(s===void 0&&globalThis.litPropertyMetadata.set(o,s=new Map),s.set(i.name,e),n==="accessor"){const{name:r}=i;return{set(a){const l=t.get.call(this);t.set.call(this,a),this.requestUpdate(r,l,e)},init(a){return a!==void 0&&this.P(r,void 0,e),a}}}if(n==="setter"){const{name:r}=i;return function(a){const l=this[r];t.call(this,a),this.requestUpdate(r,l,e)}}throw Error("Unsupported decorator location: "+n)};function b(e){return(t,i)=>typeof i=="object"?ul(e,t,i):((n,o,s)=>{const r=o.hasOwnProperty(s);return o.constructor.createProperty(s,r?{...n,wrapped:!0}:n),r?Object.getOwnPropertyDescriptor(o,s):void 0})(e,t,i)}/** + */const _l={attribute:!0,type:String,converter:fi,reflect:!1,hasChanged:Tn},xl=(e=_l,t,i)=>{const{kind:n,metadata:o}=i;let s=globalThis.litPropertyMetadata.get(o);if(s===void 0&&globalThis.litPropertyMetadata.set(o,s=new Map),s.set(i.name,e),n==="accessor"){const{name:r}=i;return{set(a){const l=t.get.call(this);t.set.call(this,a),this.requestUpdate(r,l,e)},init(a){return a!==void 0&&this.P(r,void 0,e),a}}}if(n==="setter"){const{name:r}=i;return function(a){const l=this[r];t.call(this,a),this.requestUpdate(r,l,e)}}throw Error("Unsupported decorator location: "+n)};function f(e){return(t,i)=>typeof i=="object"?xl(e,t,i):((n,o,s)=>{const r=o.hasOwnProperty(s);return o.constructor.createProperty(s,r?{...n,wrapped:!0}:n),r?Object.getOwnPropertyDescriptor(o,s):void 0})(e,t,i)}/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */function ae(e){return b({...e,state:!0,attribute:!1})}/** + */function le(e){return f({...e,state:!0,attribute:!1})}/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const hl=e=>e.strings===void 0;/** + */const wl=e=>e.strings===void 0;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const _s={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},xs=e=>(...t)=>({_$litDirective$:e,values:t});class ws{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,n){this.t=t,this._$AM=i,this.i=n}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}/** + */const Ns={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Is=e=>(...t)=>({_$litDirective$:e,values:t});class Ps{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,n){this.t=t,this._$AM=i,this.i=n}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const Ce=(e,t)=>{var i;const n=e._$AN;if(n===void 0)return!1;for(const o of n)(i=o._$AO)==null||i.call(o,t,!1),Ce(o,t);return!0},fi=e=>{let t,i;do{if((t=e._$AM)===void 0)break;i=t._$AN,i.delete(e),e=t}while((i==null?void 0:i.size)===0)},$s=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(i===void 0)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),bl(t)}};function pl(e){this._$AN!==void 0?(fi(this),this._$AM=e,$s(this)):this._$AM=e}function ml(e,t=!1,i=0){const n=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(t)if(Array.isArray(n))for(let s=i;s{e.type==_s.CHILD&&(e._$AP??(e._$AP=ml),e._$AQ??(e._$AQ=pl))};class fl extends ws{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,i,n){super._$AT(t,i,n),$s(this),this.isConnected=t._$AU}_$AO(t,i=!0){var n,o;t!==this.isConnected&&(this.isConnected=t,t?(n=this.reconnected)==null||n.call(this):(o=this.disconnected)==null||o.call(this)),i&&(Ce(this,t),fi(this))}setValue(t){if(hl(this.t))this.t._$AI(t,this);else{const i=[...this.t._$AH];i[this.i]=t,this.t._$AI(i,this,0)}}disconnected(){}reconnected(){}}/** + */const Ee=(e,t)=>{var i;const n=e._$AN;if(n===void 0)return!1;for(const o of n)(i=o._$AO)==null||i.call(o,t,!1),Ee(o,t);return!0},yi=e=>{let t,i;do{if((t=e._$AM)===void 0)break;i=t._$AN,i.delete(e),e=t}while((i==null?void 0:i.size)===0)},Ms=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(i===void 0)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),Al(t)}};function $l(e){this._$AN!==void 0?(yi(this),this._$AM=e,Ms(this)):this._$AM=e}function Cl(e,t=!1,i=0){const n=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(t)if(Array.isArray(n))for(let s=i;s{e.type==Ns.CHILD&&(e._$AP??(e._$AP=Cl),e._$AQ??(e._$AQ=$l))};class El extends Ps{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,i,n){super._$AT(t,i,n),Ms(this),this.isConnected=t._$AU}_$AO(t,i=!0){var n,o;t!==this.isConnected&&(this.isConnected=t,t?(n=this.reconnected)==null||n.call(this):(o=this.disconnected)==null||o.call(this)),i&&(Ee(this,t),yi(this))}setValue(t){if(wl(this.t))this.t._$AI(t,this);else{const i=[...this.t._$AH];i[this.i]=t,this.t._$AI(i,this,0)}}disconnected(){}reconnected(){}}/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const ie=()=>new gl;class gl{}const Vi=new WeakMap,J=xs(class extends fl{render(e){return M}update(e,[t]){var i;const n=t!==this.Y;return n&&this.Y!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.Y=t,this.ht=(i=e.options)==null?void 0:i.host,this.rt(this.ct=e.element)),M}rt(e){if(this.isConnected||(e=void 0),typeof this.Y=="function"){const t=this.ht??globalThis;let i=Vi.get(t);i===void 0&&(i=new WeakMap,Vi.set(t,i)),i.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),i.set(this.Y,e),e!==void 0&&this.Y.call(this.ht,e)}else this.Y.value=e}get lt(){var e,t;return typeof this.Y=="function"?(e=Vi.get(this.ht??globalThis))==null?void 0:e.get(this.Y):(t=this.Y)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});/** + */const ie=()=>new Sl;class Sl{}const Xi=new WeakMap,W=Is(class extends El{render(e){return D}update(e,[t]){var i;const n=t!==this.Y;return n&&this.Y!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.Y=t,this.ht=(i=e.options)==null?void 0:i.host,this.rt(this.ct=e.element)),D}rt(e){if(this.isConnected||(e=void 0),typeof this.Y=="function"){const t=this.ht??globalThis;let i=Xi.get(t);i===void 0&&(i=new WeakMap,Xi.set(t,i)),i.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),i.set(this.Y,e),e!==void 0&&this.Y.call(this.ht,e)}else this.Y.value=e}get lt(){var e,t;return typeof this.Y=="function"?(e=Xi.get(this.ht??globalThis))==null?void 0:e.get(this.Y):(t=this.Y)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});/** * (c) Iconify * * For the full copyright and license information, please view the license.txt @@ -50,15 +50,176 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I * * @license MIT * @version 2.0.0 -*/const Cs=Object.freeze({left:0,top:0,width:16,height:16}),gi=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ue=Object.freeze({...Cs,...gi}),en=Object.freeze({...Ue,body:"",hidden:!1}),vl=Object.freeze({width:null,height:null}),Es=Object.freeze({...vl,...gi});function yl(e,t=0){const i=e.replace(/^-?[0-9.]*/,"");function n(o){for(;o<0;)o+=4;return o%4}if(i===""){const o=parseInt(e);return isNaN(o)?0:n(o)}else if(i!==e){let o=0;switch(i){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(e.slice(0,e.length-i.length));return isNaN(s)?0:(s=s/o,s%1===0?n(s):0)}}return t}const _l=/[\s,]+/;function xl(e,t){t.split(_l).forEach(i=>{switch(i.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const As={...Es,preserveAspectRatio:""};function ro(e){const t={...As},i=(n,o)=>e.getAttribute(n)||o;return t.width=i("width",null),t.height=i("height",null),t.rotate=yl(i("rotate","")),xl(t,i("flip","")),t.preserveAspectRatio=i("preserveAspectRatio",i("preserveaspectratio","")),t}function wl(e,t){for(const i in As)if(e[i]!==t[i])return!0;return!1}const Ee=/^[a-z0-9]+(-[a-z0-9]+)*$/,Ve=(e,t,i,n="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;n=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),l=o.pop(),d={provider:o.length>0?o[0]:n,prefix:l,name:a};return t&&!si(d)?null:d}const s=o[0],r=s.split("-");if(r.length>1){const a={provider:n,prefix:r.shift(),name:r.join("-")};return t&&!si(a)?null:a}if(i&&n===""){const a={provider:n,prefix:"",name:s};return t&&!si(a,i)?null:a}return null},si=(e,t)=>e?!!((e.provider===""||e.provider.match(Ee))&&(t&&e.prefix===""||e.prefix.match(Ee))&&e.name.match(Ee)):!1;function $l(e,t){const i={};!e.hFlip!=!t.hFlip&&(i.hFlip=!0),!e.vFlip!=!t.vFlip&&(i.vFlip=!0);const n=((e.rotate||0)+(t.rotate||0))%4;return n&&(i.rotate=n),i}function ao(e,t){const i=$l(e,t);for(const n in en)n in gi?n in e&&!(n in i)&&(i[n]=gi[n]):n in t?i[n]=t[n]:n in e&&(i[n]=e[n]);return i}function Cl(e,t){const i=e.icons,n=e.aliases||Object.create(null),o=Object.create(null);function s(r){if(i[r])return o[r]=[];if(!(r in o)){o[r]=null;const a=n[r]&&n[r].parent,l=a&&s(a);l&&(o[r]=[a].concat(l))}return o[r]}return Object.keys(i).concat(Object.keys(n)).forEach(s),o}function El(e,t,i){const n=e.icons,o=e.aliases||Object.create(null);let s={};function r(a){s=ao(n[a]||o[a],s)}return r(t),i.forEach(r),ao(e,s)}function Ss(e,t){const i=[];if(typeof e!="object"||typeof e.icons!="object")return i;e.not_found instanceof Array&&e.not_found.forEach(o=>{t(o,null),i.push(o)});const n=Cl(e);for(const o in n){const s=n[o];s&&(t(o,El(e,o,s)),i.push(o))}return i}const Al={provider:"",aliases:{},not_found:{},...Cs};function Wi(e,t){for(const i in t)if(i in e&&typeof e[i]!=typeof t[i])return!1;return!0}function ks(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Wi(e,Al))return null;const i=t.icons;for(const o in i){const s=i[o];if(!o.match(Ee)||typeof s.body!="string"||!Wi(s,en))return null}const n=t.aliases||Object.create(null);for(const o in n){const s=n[o],r=s.parent;if(!o.match(Ee)||typeof r!="string"||!i[r]&&!n[r]||!Wi(s,en))return null}return t}const vi=Object.create(null);function Sl(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Et(e,t){const i=vi[e]||(vi[e]=Object.create(null));return i[t]||(i[t]=Sl(e,t))}function En(e,t){return ks(t)?Ss(t,(i,n)=>{n?e.icons[i]=n:e.missing.add(i)}):[]}function kl(e,t,i){try{if(typeof i.body=="string")return e.icons[t]={...i},!0}catch{}return!1}function Ol(e,t){let i=[];return(typeof e=="string"?[e]:Object.keys(vi)).forEach(n=>{(typeof n=="string"&&typeof t=="string"?[t]:Object.keys(vi[n]||{})).forEach(o=>{const s=Et(n,o);i=i.concat(Object.keys(s.icons).map(r=>(n!==""?"@"+n+":":"")+o+":"+r))})}),i}let Ne=!1;function Os(e){return typeof e=="boolean"&&(Ne=e),Ne}function Pe(e){const t=typeof e=="string"?Ve(e,!0,Ne):e;if(t){const i=Et(t.provider,t.prefix),n=t.name;return i.icons[n]||(i.missing.has(n)?null:void 0)}}function Ts(e,t){const i=Ve(e,!0,Ne);if(!i)return!1;const n=Et(i.provider,i.prefix);return kl(n,i.name,t)}function lo(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),Ne&&!t&&!e.prefix){let o=!1;return ks(e)&&(e.prefix="",Ss(e,(s,r)=>{r&&Ts(s,r)&&(o=!0)})),o}const i=e.prefix;if(!si({provider:t,prefix:i,name:"a"}))return!1;const n=Et(t,i);return!!En(n,e)}function co(e){return!!Pe(e)}function Tl(e){const t=Pe(e);return t?{...Ue,...t}:null}function Il(e){const t={loaded:[],missing:[],pending:[]},i=Object.create(null);e.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let n={provider:"",prefix:"",name:""};return e.forEach(o=>{if(n.name===o.name&&n.prefix===o.prefix&&n.provider===o.provider)return;n=o;const s=o.provider,r=o.prefix,a=o.name,l=i[s]||(i[s]=Object.create(null)),d=l[r]||(l[r]=Et(s,r));let u;a in d.icons?u=t.loaded:r===""||d.missing.has(a)?u=t.missing:u=t.pending;const c={provider:s,prefix:r,name:a};u.push(c)}),t}function Is(e,t){e.forEach(i=>{const n=i.loaderCallbacks;n&&(i.loaderCallbacks=n.filter(o=>o.id!==t))})}function Nl(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let i=!1;const n=e.provider,o=e.prefix;t.forEach(s=>{const r=s.icons,a=r.pending.length;r.pending=r.pending.filter(l=>{if(l.prefix!==o)return!0;const d=l.name;if(e.icons[d])r.loaded.push({provider:n,prefix:o,name:d});else if(e.missing.has(d))r.missing.push({provider:n,prefix:o,name:d});else return i=!0,!0;return!1}),r.pending.length!==a&&(i||Is([e],s.id),s.callback(r.loaded.slice(0),r.missing.slice(0),r.pending.slice(0),s.abort))})}))}let Pl=0;function Ml(e,t,i){const n=Pl++,o=Is.bind(null,i,n);if(!t.pending.length)return o;const s={id:n,icons:t,callback:e,abort:o};return i.forEach(r=>{(r.loaderCallbacks||(r.loaderCallbacks=[])).push(s)}),o}const nn=Object.create(null);function uo(e,t){nn[e]=t}function on(e){return nn[e]||nn[""]}function Ll(e,t=!0,i=!1){const n=[];return e.forEach(o=>{const s=typeof o=="string"?Ve(o,t,i):o;s&&n.push(s)}),n}var jl={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Dl(e,t,i,n){const o=e.resources.length,s=e.random?Math.floor(Math.random()*o):e.index;let r;if(e.random){let C=e.resources.slice(0);for(r=[];C.length>1;){const A=Math.floor(Math.random()*C.length);r.push(C[A]),C=C.slice(0,A).concat(C.slice(A+1))}r=r.concat(C)}else r=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let l="pending",d=0,u,c=null,h=[],p=[];typeof n=="function"&&p.push(n);function g(){c&&(clearTimeout(c),c=null)}function _(){l==="pending"&&(l="aborted"),g(),h.forEach(C=>{C.status==="pending"&&(C.status="aborted")}),h=[]}function v(C,A){A&&(p=[]),typeof C=="function"&&p.push(C)}function f(){return{startTime:a,payload:t,status:l,queriesSent:d,queriesPending:h.length,subscribe:v,abort:_}}function y(){l="failed",p.forEach(C=>{C(void 0,u)})}function x(){h.forEach(C=>{C.status==="pending"&&(C.status="aborted")}),h=[]}function w(C,A,N){const $=A!=="success";switch(h=h.filter(S=>S!==C),l){case"pending":break;case"failed":if($||!e.dataAfterTimeout)return;break;default:return}if(A==="abort"){u=N,y();return}if($){u=N,h.length||(r.length?E():y());return}if(g(),x(),!e.random){const S=e.resources.indexOf(C.resource);S!==-1&&S!==e.index&&(e.index=S)}l="completed",p.forEach(S=>{S(N)})}function E(){if(l!=="pending")return;g();const C=r.shift();if(C===void 0){if(h.length){c=setTimeout(()=>{g(),l==="pending"&&(x(),y())},e.timeout);return}y();return}const A={status:"pending",resource:C,callback:(N,$)=>{w(A,N,$)}};h.push(A),d++,c=setTimeout(E,e.rotate),i(C,t,A.callback)}return setTimeout(E),f}function Ns(e){const t={...jl,...e};let i=[];function n(){i=i.filter(r=>r().status==="pending")}function o(r,a,l){const d=Dl(t,r,a,(u,c)=>{n(),l&&l(u,c)});return i.push(d),d}function s(r){return i.find(a=>r(a))||null}return{query:o,find:s,setIndex:r=>{t.index=r},getIndex:()=>t.index,cleanup:n}}function An(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const Ni=Object.create(null),ei=["https://api.simplesvg.com","https://api.unisvg.com"],sn=[];for(;ei.length>0;)ei.length===1||Math.random()>.5?sn.push(ei.shift()):sn.push(ei.pop());Ni[""]=An({resources:["https://api.iconify.design"].concat(sn)});function ho(e,t){const i=An(t);return i===null?!1:(Ni[e]=i,!0)}function Pi(e){return Ni[e]}function Rl(){return Object.keys(Ni)}function po(){}const Gi=Object.create(null);function zl(e){if(!Gi[e]){const t=Pi(e);if(!t)return;const i=Ns(t),n={config:t,redundancy:i};Gi[e]=n}return Gi[e]}function Ps(e,t,i){let n,o;if(typeof e=="string"){const s=on(e);if(!s)return i(void 0,424),po;o=s.send;const r=zl(e);r&&(n=r.redundancy)}else{const s=An(e);if(s){n=Ns(s);const r=e.resources?e.resources[0]:"",a=on(r);a&&(o=a.send)}}return!n||!o?(i(void 0,424),po):n.query(t,o,i)().abort}const mo="iconify2",Me="iconify",Ms=Me+"-count",bo=Me+"-version",Ls=36e5,Fl=168,Hl=50;function rn(e,t){try{return e.getItem(t)}catch{}}function Sn(e,t,i){try{return e.setItem(t,i),!0}catch{}}function fo(e,t){try{e.removeItem(t)}catch{}}function an(e,t){return Sn(e,Ms,t.toString())}function ln(e){return parseInt(rn(e,Ms))||0}const jt={local:!0,session:!0},js={local:new Set,session:new Set};let kn=!1;function Bl(e){kn=e}let ii=typeof window>"u"?{}:window;function Ds(e){const t=e+"Storage";try{if(ii&&ii[t]&&typeof ii[t].length=="number")return ii[t]}catch{}jt[e]=!1}function Rs(e,t){const i=Ds(e);if(!i)return;const n=rn(i,bo);if(n!==mo){if(n){const a=ln(i);for(let l=0;l{const l=Me+a.toString(),d=rn(i,l);if(typeof d=="string"){try{const u=JSON.parse(d);if(typeof u=="object"&&typeof u.cached=="number"&&u.cached>o&&typeof u.provider=="string"&&typeof u.data=="object"&&typeof u.data.prefix=="string"&&t(u,a))return!0}catch{}fo(i,l)}};let r=ln(i);for(let a=r-1;a>=0;a--)s(a)||(a===r-1?(r--,an(i,r)):js[e].add(a))}function zs(){if(!kn){Bl(!0);for(const e in jt)Rs(e,t=>{const i=t.data,n=t.provider,o=i.prefix,s=Et(n,o);if(!En(s,i).length)return!1;const r=i.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,r):r,!0})}}function Ul(e,t){const i=e.lastModifiedCached;if(i&&i>=t)return i===t;if(e.lastModifiedCached=t,i)for(const n in jt)Rs(n,o=>{const s=o.data;return o.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function Vl(e,t){kn||zs();function i(n){let o;if(!jt[n]||!(o=Ds(n)))return;const s=js[n];let r;if(s.size)s.delete(r=Array.from(s).shift());else if(r=ln(o),r>=Hl||!an(o,r+1))return;const a={cached:Math.floor(Date.now()/Ls),provider:e.provider,data:t};return Sn(o,Me+r.toString(),JSON.stringify(a))}t.lastModified&&!Ul(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),i("local")||i("session"))}function go(){}function Wl(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Nl(e)}))}function Gl(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:i,prefix:n}=e,o=e.iconsToLoad;delete e.iconsToLoad;let s;!o||!(s=on(i))||s.prepare(i,n,o).forEach(r=>{Ps(i,r,a=>{if(typeof a!="object")r.icons.forEach(l=>{e.missing.add(l)});else try{const l=En(e,a);if(!l.length)return;const d=e.pendingIcons;d&&l.forEach(u=>{d.delete(u)}),Vl(e,a)}catch(l){console.error(l)}Wl(e)})})}))}const On=(e,t)=>{const i=Ll(e,!0,Os()),n=Il(i);if(!n.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(n.loaded,n.missing,n.pending,go)}),()=>{l=!1}}const o=Object.create(null),s=[];let r,a;return n.pending.forEach(l=>{const{provider:d,prefix:u}=l;if(u===a&&d===r)return;r=d,a=u,s.push(Et(d,u));const c=o[d]||(o[d]=Object.create(null));c[u]||(c[u]=[])}),n.pending.forEach(l=>{const{provider:d,prefix:u,name:c}=l,h=Et(d,u),p=h.pendingIcons||(h.pendingIcons=new Set);p.has(c)||(p.add(c),o[d][u].push(c))}),s.forEach(l=>{const{provider:d,prefix:u}=l;o[d][u].length&&Gl(l,o[d][u])}),t?Ml(t,n,s):go},ql=e=>new Promise((t,i)=>{const n=typeof e=="string"?Ve(e,!0):e;if(!n){i(e);return}On([n||e],o=>{if(o.length&&n){const s=Pe(n);if(s){t({...Ue,...s});return}}i(e)})});function Yl(e){try{const t=typeof e=="string"?JSON.parse(e):e;if(typeof t.body=="string")return{...t}}catch{}}function Xl(e,t){const i=typeof e=="string"?Ve(e,!0,!0):null;if(!i){const s=Yl(e);return{value:e,data:s}}const n=Pe(i);if(n!==void 0||!i.prefix)return{value:e,name:i,data:n};const o=On([i],()=>t(e,i,Pe(i)));return{value:e,name:i,loading:o}}function qi(e){return e.hasAttribute("inline")}let Fs=!1;try{Fs=navigator.vendor.indexOf("Apple")===0}catch{}function Jl(e,t){switch(t){case"svg":case"bg":case"mask":return t}return t!=="style"&&(Fs||e.indexOf("=0;){const o=e.indexOf(">",n),s=e.indexOf("",s);if(r===-1)break;i+=e.slice(o+1,s).trim(),e=e.slice(0,n).trim()+e.slice(r+1)}return{defs:i,content:e}}function tc(e,t){return e?""+e+""+t:t}function ec(e,t,i){const n=Kl(e);return tc(n.defs,t+n.content+i)}const ic=e=>e==="unset"||e==="undefined"||e==="none";function Hs(e,t){const i={...Ue,...e},n={...Es,...t},o={left:i.left,top:i.top,width:i.width,height:i.height};let s=i.body;[i,n].forEach(_=>{const v=[],f=_.hFlip,y=_.vFlip;let x=_.rotate;f?y?x+=2:(v.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),v.push("scale(-1 1)"),o.top=o.left=0):y&&(v.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),v.push("scale(1 -1)"),o.top=o.left=0);let w;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:w=o.height/2+o.top,v.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:v.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:w=o.width/2+o.left,v.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}x%2===1&&(o.left!==o.top&&(w=o.left,o.left=o.top,o.top=w),o.width!==o.height&&(w=o.width,o.width=o.height,o.height=w)),v.length&&(s=ec(s,'',""))});const r=n.width,a=n.height,l=o.width,d=o.height;let u,c;r===null?(c=a===null?"1em":a==="auto"?d:a,u=cn(c,l/d)):(u=r==="auto"?l:r,c=a===null?cn(u,d/l):a==="auto"?d:a);const h={},p=(_,v)=>{ic(v)||(h[_]=v.toString())};p("width",u),p("height",c);const g=[o.left,o.top,l,d];return h.viewBox=g.join(" "),{attributes:h,viewBox:g,body:s}}function Tn(e,t){let i=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in t)i+=" "+n+'="'+t[n]+'"';return'"+e+""}function nc(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function oc(e){return"data:image/svg+xml,"+nc(e)}function Bs(e){return'url("'+oc(e)+'")'}const sc=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let yi=sc();function rc(e){yi=e}function ac(){return yi}function lc(e,t){const i=Pi(e);if(!i)return 0;let n;if(!i.maxURL)n=0;else{let o=0;i.resources.forEach(r=>{o=Math.max(o,r.length)});const s=t+".json?icons=";n=i.maxURL-o-i.path.length-s.length}return n}function cc(e){return e===404}const dc=(e,t,i)=>{const n=[],o=lc(e,t),s="icons";let r={type:s,provider:e,prefix:t,icons:[]},a=0;return i.forEach((l,d)=>{a+=l.length+1,a>=o&&d>0&&(n.push(r),r={type:s,provider:e,prefix:t,icons:[]},a=l.length),r.icons.push(l)}),n.push(r),n};function uc(e){if(typeof e=="string"){const t=Pi(e);if(t)return t.path}return"/"}const hc=(e,t,i)=>{if(!yi){i("abort",424);return}let n=uc(t.provider);switch(t.type){case"icons":{const s=t.prefix,r=t.icons.join(","),a=new URLSearchParams({icons:r});n+=s+".json?"+a.toString();break}case"custom":{const s=t.uri;n+=s.slice(0,1)==="/"?s.slice(1):s;break}default:i("abort",400);return}let o=503;yi(e+n).then(s=>{const r=s.status;if(r!==200){setTimeout(()=>{i(cc(r)?"abort":"next",r)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?i("abort",s):i("next",o)});return}setTimeout(()=>{i("success",s)})}).catch(()=>{i("next",o)})},pc={prepare:dc,send:hc};function vo(e,t){switch(e){case"local":case"session":jt[e]=t;break;case"all":for(const i in jt)jt[i]=t;break}}const Yi="data-style";let Us="";function mc(e){Us=e}function yo(e,t){let i=Array.from(e.childNodes).find(n=>n.hasAttribute&&n.hasAttribute(Yi));i||(i=document.createElement("style"),i.setAttribute(Yi,Yi),e.appendChild(i)),i.textContent=":host{display:inline-block;vertical-align:"+(t?"-0.125em":"0")+"}span,svg{display:block}"+Us}function Vs(){uo("",pc),Os(!0);let e;try{e=window}catch{}if(e){if(zs(),e.IconifyPreload!==void 0){const t=e.IconifyPreload,i="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(n=>{try{(typeof n!="object"||n===null||n instanceof Array||typeof n.icons!="object"||typeof n.prefix!="string"||!lo(n))&&console.error(i)}catch{console.error(i)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(const i in t){const n="IconifyProviders["+i+"] is invalid.";try{const o=t[i];if(typeof o!="object"||!o||o.resources===void 0)continue;ho(i,o)||console.error(n)}catch{console.error(n)}}}}return{enableCache:t=>vo(t,!0),disableCache:t=>vo(t,!1),iconLoaded:co,iconExists:co,getIcon:Tl,listIcons:Ol,addIcon:Ts,addCollection:lo,calculateSize:cn,buildIcon:Hs,iconToHTML:Tn,svgToURL:Bs,loadIcons:On,loadIcon:ql,addAPIProvider:ho,appendCustomStyle:mc,_api:{getAPIConfig:Pi,setAPIModule:uo,sendAPIQuery:Ps,setFetch:rc,getFetch:ac,listAPIProviders:Rl}}}const dn={"background-color":"currentColor"},Ws={"background-color":"transparent"},_o={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},xo={"-webkit-mask":dn,mask:dn,background:Ws};for(const e in xo){const t=xo[e];for(const i in _o)t[e+"-"+i]=_o[i]}function wo(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}function bc(e,t,i){const n=document.createElement("span");let o=e.body;o.indexOf("");const s=e.attributes,r=Tn(o,{...s,width:t.width+"",height:t.height+""}),a=Bs(r),l=n.style,d={"--svg":a,width:wo(s.width),height:wo(s.height),...i?dn:Ws};for(const u in d)l.setProperty(u,d[u]);return n}let Ae;function fc(){try{Ae=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Ae=null}}function gc(e){return Ae===void 0&&fc(),Ae?Ae.createHTML(e):e}function vc(e){const t=document.createElement("span"),i=e.attributes;let n="";i.width||(n="width: inherit;"),i.height||(n+="height: inherit;"),n&&(i.style=n);const o=Tn(e.body,i);return t.innerHTML=gc(o),t.firstChild}function un(e){return Array.from(e.childNodes).find(t=>{const i=t.tagName&&t.tagName.toUpperCase();return i==="SPAN"||i==="SVG"})}function $o(e,t){const i=t.icon.data,n=t.customisations,o=Hs(i,n);n.preserveAspectRatio&&(o.attributes.preserveAspectRatio=n.preserveAspectRatio);const s=t.renderedMode;let r;switch(s){case"svg":r=vc(o);break;default:r=bc(o,{...Ue,...i},s==="mask")}const a=un(e);a?r.tagName==="SPAN"&&a.tagName===r.tagName?a.setAttribute("style",r.getAttribute("style")):e.replaceChild(r,a):e.appendChild(r)}function Co(e,t,i){const n=i&&(i.rendered?i:i.lastRender);return{rendered:!1,inline:t,icon:e,lastRender:n}}function yc(e="iconify-icon"){let t,i;try{t=window.customElements,i=window.HTMLElement}catch{return}if(!t||!i)return;const n=t.get(e);if(n)return n;const o=["icon","mode","inline","observe","width","height","rotate","flip"],s=class extends i{constructor(){super(),It(this,"_shadowRoot"),It(this,"_initialised",!1),It(this,"_state"),It(this,"_checkQueued",!1),It(this,"_connected",!1),It(this,"_observer",null),It(this,"_visible",!0);const a=this._shadowRoot=this.attachShadow({mode:"open"}),l=qi(this);yo(a,l),this._state=Co({value:""},l),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return o.slice(0)}attributeChangedCallback(a){switch(a){case"inline":{const l=qi(this),d=this._state;l!==d.inline&&(d.inline=l,yo(this._shadowRoot,l));break}case"observer":{this.observer?this.startObserver():this.stopObserver();break}default:this._queueCheck()}}get icon(){const a=this.getAttribute("icon");if(a&&a.slice(0,1)==="{")try{return JSON.parse(a)}catch{}return a}set icon(a){typeof a=="object"&&(a=JSON.stringify(a)),this.setAttribute("icon",a)}get inline(){return qi(this)}set inline(a){a?this.setAttribute("inline","true"):this.removeAttribute("inline")}get observer(){return this.hasAttribute("observer")}set observer(a){a?this.setAttribute("observer","true"):this.removeAttribute("observer")}restartAnimation(){const a=this._state;if(a.rendered){const l=this._shadowRoot;if(a.renderedMode==="svg")try{l.lastChild.setCurrentTime(0);return}catch{}$o(l,a)}}get status(){const a=this._state;return a.rendered?"rendered":a.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const a=this._state,l=this.getAttribute("icon");if(l!==a.icon.value){this._iconChanged(l);return}if(!a.rendered||!this._visible)return;const d=this.getAttribute("mode"),u=ro(this);(a.attrMode!==d||wl(a.customisations,u)||!un(this._shadowRoot))&&this._renderIcon(a.icon,u,d)}_iconChanged(a){const l=Xl(a,(d,u,c)=>{const h=this._state;if(h.rendered||this.getAttribute("icon")!==d)return;const p={value:d,name:u,data:c};p.data?this._gotIconData(p):h.icon=p});l.data?this._gotIconData(l):this._state=Co(l,this._state.inline,this._state)}_forceRender(){if(!this._visible){const a=un(this._shadowRoot);a&&this._shadowRoot.removeChild(a);return}this._queueCheck()}_gotIconData(a){this._checkQueued=!1,this._renderIcon(a,ro(this),this.getAttribute("mode"))}_renderIcon(a,l,d){const u=Jl(a.data.body,d),c=this._state.inline;$o(this._shadowRoot,this._state={rendered:!0,icon:a,inline:c,customisations:l,attrMode:d,renderedMode:u})}startObserver(){if(!this._observer)try{this._observer=new IntersectionObserver(a=>{const l=a.some(d=>d.isIntersecting);l!==this._visible&&(this._visible=l,this._forceRender())}),this._observer.observe(this)}catch{if(this._observer){try{this._observer.disconnect()}catch{}this._observer=null}}}stopObserver(){this._observer&&(this._observer.disconnect(),this._observer=null,this._visible=!0,this._connected&&this._forceRender())}};o.forEach(a=>{a in s.prototype||Object.defineProperty(s.prototype,a,{get:function(){return this.getAttribute(a)},set:function(l){l!==null?this.setAttribute(a,l):this.removeAttribute(a)}})});const r=Vs();for(const a in r)s[a]=s.prototype[a]=r[a];return t.define(e,s),s}yc()||Vs();var _c=Object.defineProperty,xc=Object.getOwnPropertyDescriptor,tt=(e,t,i,n)=>{for(var o=n>1?void 0:n?xc(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&_c(t,i,o),o};const Gs=class extends T{constructor(){super(),this.labelHidden=!1,this.active=!1,this.disabled=!1,this.vertical=!1,this.tooltipVisible=!1,this._stateBeforeLoading={disabled:!1,icon:""},this._loading=!1,this._parent=ie(),this._tooltip=ie(),this._mouseLeave=!1,this.onClick=e=>{e.stopPropagation(),this.disabled||this.dispatchEvent(new Event("click"))},this.showContextMenu=()=>{const e=this._contextMenu;e&&(e.visible=!0)},this.mouseLeave=!0}set loading(e){if(this._loading=e,e)this._stateBeforeLoading={disabled:this.disabled,icon:this.icon},this.disabled=e,this.icon="eos-icons:loading";else{const{disabled:t,icon:i}=this._stateBeforeLoading;this.disabled=t,this.icon=i}}get loading(){return this._loading}set mouseLeave(e){this._mouseLeave=e,e&&(this.tooltipVisible=!1,clearTimeout(this.timeoutID))}get mouseLeave(){return this._mouseLeave}computeTooltipPosition(){const{value:e}=this._parent,{value:t}=this._tooltip;e&&t&&ms(e,t,{placement:"bottom",middleware:[es(10),ps(),hs(),us({padding:5})]}).then(i=>{const{x:n,y:o}=i;Object.assign(t.style,{left:`${n}px`,top:`${o}px`})})}onMouseEnter(){if(!(this.tooltipTitle||this.tooltipText))return;this.mouseLeave=!1;const e=this.tooltipTime??700;this.timeoutID=setTimeout(()=>{this.mouseLeave||(this.computeTooltipPosition(),this.tooltipVisible=!0)},e)}click(){this.disabled||super.click()}get _contextMenu(){return this.querySelector("bim-context-menu")}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.showContextMenu)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.showContextMenu)}render(){const e=m` -
+*/const Ls=Object.freeze({left:0,top:0,width:16,height:16}),_i=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ge=Object.freeze({...Ls,..._i}),ln=Object.freeze({...Ge,body:"",hidden:!1}),kl=Object.freeze({width:null,height:null}),Rs=Object.freeze({...kl,..._i});function Tl(e,t=0){const i=e.replace(/^-?[0-9.]*/,"");function n(o){for(;o<0;)o+=4;return o%4}if(i===""){const o=parseInt(e);return isNaN(o)?0:n(o)}else if(i!==e){let o=0;switch(i){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(e.slice(0,e.length-i.length));return isNaN(s)?0:(s=s/o,s%1===0?n(s):0)}}return t}const Ol=/[\s,]+/;function Nl(e,t){t.split(Ol).forEach(i=>{switch(i.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const Ds={...Rs,preserveAspectRatio:""};function bo(e){const t={...Ds},i=(n,o)=>e.getAttribute(n)||o;return t.width=i("width",null),t.height=i("height",null),t.rotate=Tl(i("rotate","")),Nl(t,i("flip","")),t.preserveAspectRatio=i("preserveAspectRatio",i("preserveaspectratio","")),t}function Il(e,t){for(const i in Ds)if(e[i]!==t[i])return!0;return!1}const Se=/^[a-z0-9]+(-[a-z0-9]+)*$/,qe=(e,t,i,n="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;n=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),l=o.pop(),d={provider:o.length>0?o[0]:n,prefix:l,name:a};return t&&!li(d)?null:d}const s=o[0],r=s.split("-");if(r.length>1){const a={provider:n,prefix:r.shift(),name:r.join("-")};return t&&!li(a)?null:a}if(i&&n===""){const a={provider:n,prefix:"",name:s};return t&&!li(a,i)?null:a}return null},li=(e,t)=>e?!!((e.provider===""||e.provider.match(Se))&&(t&&e.prefix===""||e.prefix.match(Se))&&e.name.match(Se)):!1;function Pl(e,t){const i={};!e.hFlip!=!t.hFlip&&(i.hFlip=!0),!e.vFlip!=!t.vFlip&&(i.vFlip=!0);const n=((e.rotate||0)+(t.rotate||0))%4;return n&&(i.rotate=n),i}function fo(e,t){const i=Pl(e,t);for(const n in ln)n in _i?n in e&&!(n in i)&&(i[n]=_i[n]):n in t?i[n]=t[n]:n in e&&(i[n]=e[n]);return i}function Ml(e,t){const i=e.icons,n=e.aliases||Object.create(null),o=Object.create(null);function s(r){if(i[r])return o[r]=[];if(!(r in o)){o[r]=null;const a=n[r]&&n[r].parent,l=a&&s(a);l&&(o[r]=[a].concat(l))}return o[r]}return Object.keys(i).concat(Object.keys(n)).forEach(s),o}function Ll(e,t,i){const n=e.icons,o=e.aliases||Object.create(null);let s={};function r(a){s=fo(n[a]||o[a],s)}return r(t),i.forEach(r),fo(e,s)}function js(e,t){const i=[];if(typeof e!="object"||typeof e.icons!="object")return i;e.not_found instanceof Array&&e.not_found.forEach(o=>{t(o,null),i.push(o)});const n=Ml(e);for(const o in n){const s=n[o];s&&(t(o,Ll(e,o,s)),i.push(o))}return i}const Rl={provider:"",aliases:{},not_found:{},...Ls};function Ji(e,t){for(const i in t)if(i in e&&typeof e[i]!=typeof t[i])return!1;return!0}function zs(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Ji(e,Rl))return null;const i=t.icons;for(const o in i){const s=i[o];if(!o.match(Se)||typeof s.body!="string"||!Ji(s,ln))return null}const n=t.aliases||Object.create(null);for(const o in n){const s=n[o],r=s.parent;if(!o.match(Se)||typeof r!="string"||!i[r]&&!n[r]||!Ji(s,ln))return null}return t}const xi=Object.create(null);function Dl(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function At(e,t){const i=xi[e]||(xi[e]=Object.create(null));return i[t]||(i[t]=Dl(e,t))}function Nn(e,t){return zs(t)?js(t,(i,n)=>{n?e.icons[i]=n:e.missing.add(i)}):[]}function jl(e,t,i){try{if(typeof i.body=="string")return e.icons[t]={...i},!0}catch{}return!1}function zl(e,t){let i=[];return(typeof e=="string"?[e]:Object.keys(xi)).forEach(n=>{(typeof n=="string"&&typeof t=="string"?[t]:Object.keys(xi[n]||{})).forEach(o=>{const s=At(n,o);i=i.concat(Object.keys(s.icons).map(r=>(n!==""?"@"+n+":":"")+o+":"+r))})}),i}let Re=!1;function Fs(e){return typeof e=="boolean"&&(Re=e),Re}function De(e){const t=typeof e=="string"?qe(e,!0,Re):e;if(t){const i=At(t.provider,t.prefix),n=t.name;return i.icons[n]||(i.missing.has(n)?null:void 0)}}function Hs(e,t){const i=qe(e,!0,Re);if(!i)return!1;const n=At(i.provider,i.prefix);return jl(n,i.name,t)}function go(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),Re&&!t&&!e.prefix){let o=!1;return zs(e)&&(e.prefix="",js(e,(s,r)=>{r&&Hs(s,r)&&(o=!0)})),o}const i=e.prefix;if(!li({provider:t,prefix:i,name:"a"}))return!1;const n=At(t,i);return!!Nn(n,e)}function vo(e){return!!De(e)}function Fl(e){const t=De(e);return t?{...Ge,...t}:null}function Hl(e){const t={loaded:[],missing:[],pending:[]},i=Object.create(null);e.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let n={provider:"",prefix:"",name:""};return e.forEach(o=>{if(n.name===o.name&&n.prefix===o.prefix&&n.provider===o.provider)return;n=o;const s=o.provider,r=o.prefix,a=o.name,l=i[s]||(i[s]=Object.create(null)),d=l[r]||(l[r]=At(s,r));let u;a in d.icons?u=t.loaded:r===""||d.missing.has(a)?u=t.missing:u=t.pending;const c={provider:s,prefix:r,name:a};u.push(c)}),t}function Bs(e,t){e.forEach(i=>{const n=i.loaderCallbacks;n&&(i.loaderCallbacks=n.filter(o=>o.id!==t))})}function Bl(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let i=!1;const n=e.provider,o=e.prefix;t.forEach(s=>{const r=s.icons,a=r.pending.length;r.pending=r.pending.filter(l=>{if(l.prefix!==o)return!0;const d=l.name;if(e.icons[d])r.loaded.push({provider:n,prefix:o,name:d});else if(e.missing.has(d))r.missing.push({provider:n,prefix:o,name:d});else return i=!0,!0;return!1}),r.pending.length!==a&&(i||Bs([e],s.id),s.callback(r.loaded.slice(0),r.missing.slice(0),r.pending.slice(0),s.abort))})}))}let Ul=0;function Vl(e,t,i){const n=Ul++,o=Bs.bind(null,i,n);if(!t.pending.length)return o;const s={id:n,icons:t,callback:e,abort:o};return i.forEach(r=>{(r.loaderCallbacks||(r.loaderCallbacks=[])).push(s)}),o}const cn=Object.create(null);function yo(e,t){cn[e]=t}function dn(e){return cn[e]||cn[""]}function Wl(e,t=!0,i=!1){const n=[];return e.forEach(o=>{const s=typeof o=="string"?qe(o,t,i):o;s&&n.push(s)}),n}var Gl={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function ql(e,t,i,n){const o=e.resources.length,s=e.random?Math.floor(Math.random()*o):e.index;let r;if(e.random){let C=e.resources.slice(0);for(r=[];C.length>1;){const N=Math.floor(Math.random()*C.length);r.push(C[N]),C=C.slice(0,N).concat(C.slice(N+1))}r=r.concat(C)}else r=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let l="pending",d=0,u,c=null,h=[],p=[];typeof n=="function"&&p.push(n);function b(){c&&(clearTimeout(c),c=null)}function v(){l==="pending"&&(l="aborted"),b(),h.forEach(C=>{C.status==="pending"&&(C.status="aborted")}),h=[]}function y(C,N){N&&(p=[]),typeof C=="function"&&p.push(C)}function g(){return{startTime:a,payload:t,status:l,queriesSent:d,queriesPending:h.length,subscribe:y,abort:v}}function _(){l="failed",p.forEach(C=>{C(void 0,u)})}function x(){h.forEach(C=>{C.status==="pending"&&(C.status="aborted")}),h=[]}function w(C,N,L){const k=N!=="success";switch(h=h.filter(S=>S!==C),l){case"pending":break;case"failed":if(k||!e.dataAfterTimeout)return;break;default:return}if(N==="abort"){u=L,_();return}if(k){u=L,h.length||(r.length?A():_());return}if(b(),x(),!e.random){const S=e.resources.indexOf(C.resource);S!==-1&&S!==e.index&&(e.index=S)}l="completed",p.forEach(S=>{S(L)})}function A(){if(l!=="pending")return;b();const C=r.shift();if(C===void 0){if(h.length){c=setTimeout(()=>{b(),l==="pending"&&(x(),_())},e.timeout);return}_();return}const N={status:"pending",resource:C,callback:(L,k)=>{w(N,L,k)}};h.push(N),d++,c=setTimeout(A,e.rotate),i(C,t,N.callback)}return setTimeout(A),g}function Us(e){const t={...Gl,...e};let i=[];function n(){i=i.filter(r=>r().status==="pending")}function o(r,a,l){const d=ql(t,r,a,(u,c)=>{n(),l&&l(u,c)});return i.push(d),d}function s(r){return i.find(a=>r(a))||null}return{query:o,find:s,setIndex:r=>{t.index=r},getIndex:()=>t.index,cleanup:n}}function In(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const Di=Object.create(null),oi=["https://api.simplesvg.com","https://api.unisvg.com"],un=[];for(;oi.length>0;)oi.length===1||Math.random()>.5?un.push(oi.shift()):un.push(oi.pop());Di[""]=In({resources:["https://api.iconify.design"].concat(un)});function _o(e,t){const i=In(t);return i===null?!1:(Di[e]=i,!0)}function ji(e){return Di[e]}function Yl(){return Object.keys(Di)}function xo(){}const Qi=Object.create(null);function Xl(e){if(!Qi[e]){const t=ji(e);if(!t)return;const i=Us(t),n={config:t,redundancy:i};Qi[e]=n}return Qi[e]}function Vs(e,t,i){let n,o;if(typeof e=="string"){const s=dn(e);if(!s)return i(void 0,424),xo;o=s.send;const r=Xl(e);r&&(n=r.redundancy)}else{const s=In(e);if(s){n=Us(s);const r=e.resources?e.resources[0]:"",a=dn(r);a&&(o=a.send)}}return!n||!o?(i(void 0,424),xo):n.query(t,o,i)().abort}const wo="iconify2",je="iconify",Ws=je+"-count",$o=je+"-version",Gs=36e5,Jl=168,Ql=50;function hn(e,t){try{return e.getItem(t)}catch{}}function Pn(e,t,i){try{return e.setItem(t,i),!0}catch{}}function Co(e,t){try{e.removeItem(t)}catch{}}function pn(e,t){return Pn(e,Ws,t.toString())}function mn(e){return parseInt(hn(e,Ws))||0}const Rt={local:!0,session:!0},qs={local:new Set,session:new Set};let Mn=!1;function Kl(e){Mn=e}let si=typeof window>"u"?{}:window;function Ys(e){const t=e+"Storage";try{if(si&&si[t]&&typeof si[t].length=="number")return si[t]}catch{}Rt[e]=!1}function Xs(e,t){const i=Ys(e);if(!i)return;const n=hn(i,$o);if(n!==wo){if(n){const a=mn(i);for(let l=0;l{const l=je+a.toString(),d=hn(i,l);if(typeof d=="string"){try{const u=JSON.parse(d);if(typeof u=="object"&&typeof u.cached=="number"&&u.cached>o&&typeof u.provider=="string"&&typeof u.data=="object"&&typeof u.data.prefix=="string"&&t(u,a))return!0}catch{}Co(i,l)}};let r=mn(i);for(let a=r-1;a>=0;a--)s(a)||(a===r-1?(r--,pn(i,r)):qs[e].add(a))}function Js(){if(!Mn){Kl(!0);for(const e in Rt)Xs(e,t=>{const i=t.data,n=t.provider,o=i.prefix,s=At(n,o);if(!Nn(s,i).length)return!1;const r=i.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,r):r,!0})}}function Zl(e,t){const i=e.lastModifiedCached;if(i&&i>=t)return i===t;if(e.lastModifiedCached=t,i)for(const n in Rt)Xs(n,o=>{const s=o.data;return o.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function tc(e,t){Mn||Js();function i(n){let o;if(!Rt[n]||!(o=Ys(n)))return;const s=qs[n];let r;if(s.size)s.delete(r=Array.from(s).shift());else if(r=mn(o),r>=Ql||!pn(o,r+1))return;const a={cached:Math.floor(Date.now()/Gs),provider:e.provider,data:t};return Pn(o,je+r.toString(),JSON.stringify(a))}t.lastModified&&!Zl(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),i("local")||i("session"))}function Ao(){}function ec(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Bl(e)}))}function ic(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:i,prefix:n}=e,o=e.iconsToLoad;delete e.iconsToLoad;let s;!o||!(s=dn(i))||s.prepare(i,n,o).forEach(r=>{Vs(i,r,a=>{if(typeof a!="object")r.icons.forEach(l=>{e.missing.add(l)});else try{const l=Nn(e,a);if(!l.length)return;const d=e.pendingIcons;d&&l.forEach(u=>{d.delete(u)}),tc(e,a)}catch(l){console.error(l)}ec(e)})})}))}const Ln=(e,t)=>{const i=Wl(e,!0,Fs()),n=Hl(i);if(!n.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(n.loaded,n.missing,n.pending,Ao)}),()=>{l=!1}}const o=Object.create(null),s=[];let r,a;return n.pending.forEach(l=>{const{provider:d,prefix:u}=l;if(u===a&&d===r)return;r=d,a=u,s.push(At(d,u));const c=o[d]||(o[d]=Object.create(null));c[u]||(c[u]=[])}),n.pending.forEach(l=>{const{provider:d,prefix:u,name:c}=l,h=At(d,u),p=h.pendingIcons||(h.pendingIcons=new Set);p.has(c)||(p.add(c),o[d][u].push(c))}),s.forEach(l=>{const{provider:d,prefix:u}=l;o[d][u].length&&ic(l,o[d][u])}),t?Vl(t,n,s):Ao},nc=e=>new Promise((t,i)=>{const n=typeof e=="string"?qe(e,!0):e;if(!n){i(e);return}Ln([n||e],o=>{if(o.length&&n){const s=De(n);if(s){t({...Ge,...s});return}}i(e)})});function oc(e){try{const t=typeof e=="string"?JSON.parse(e):e;if(typeof t.body=="string")return{...t}}catch{}}function sc(e,t){const i=typeof e=="string"?qe(e,!0,!0):null;if(!i){const s=oc(e);return{value:e,data:s}}const n=De(i);if(n!==void 0||!i.prefix)return{value:e,name:i,data:n};const o=Ln([i],()=>t(e,i,De(i)));return{value:e,name:i,loading:o}}function Ki(e){return e.hasAttribute("inline")}let Qs=!1;try{Qs=navigator.vendor.indexOf("Apple")===0}catch{}function rc(e,t){switch(t){case"svg":case"bg":case"mask":return t}return t!=="style"&&(Qs||e.indexOf("=0;){const o=e.indexOf(">",n),s=e.indexOf("",s);if(r===-1)break;i+=e.slice(o+1,s).trim(),e=e.slice(0,n).trim()+e.slice(r+1)}return{defs:i,content:e}}function dc(e,t){return e?""+e+""+t:t}function uc(e,t,i){const n=cc(e);return dc(n.defs,t+n.content+i)}const hc=e=>e==="unset"||e==="undefined"||e==="none";function Ks(e,t){const i={...Ge,...e},n={...Rs,...t},o={left:i.left,top:i.top,width:i.width,height:i.height};let s=i.body;[i,n].forEach(v=>{const y=[],g=v.hFlip,_=v.vFlip;let x=v.rotate;g?_?x+=2:(y.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),y.push("scale(-1 1)"),o.top=o.left=0):_&&(y.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),y.push("scale(1 -1)"),o.top=o.left=0);let w;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:w=o.height/2+o.top,y.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:y.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:w=o.width/2+o.left,y.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}x%2===1&&(o.left!==o.top&&(w=o.left,o.left=o.top,o.top=w),o.width!==o.height&&(w=o.width,o.width=o.height,o.height=w)),y.length&&(s=uc(s,'',""))});const r=n.width,a=n.height,l=o.width,d=o.height;let u,c;r===null?(c=a===null?"1em":a==="auto"?d:a,u=bn(c,l/d)):(u=r==="auto"?l:r,c=a===null?bn(u,d/l):a==="auto"?d:a);const h={},p=(v,y)=>{hc(y)||(h[v]=y.toString())};p("width",u),p("height",c);const b=[o.left,o.top,l,d];return h.viewBox=b.join(" "),{attributes:h,viewBox:b,body:s}}function Rn(e,t){let i=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in t)i+=" "+n+'="'+t[n]+'"';return'"+e+""}function pc(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function mc(e){return"data:image/svg+xml,"+pc(e)}function Zs(e){return'url("'+mc(e)+'")'}const bc=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let wi=bc();function fc(e){wi=e}function gc(){return wi}function vc(e,t){const i=ji(e);if(!i)return 0;let n;if(!i.maxURL)n=0;else{let o=0;i.resources.forEach(r=>{o=Math.max(o,r.length)});const s=t+".json?icons=";n=i.maxURL-o-i.path.length-s.length}return n}function yc(e){return e===404}const _c=(e,t,i)=>{const n=[],o=vc(e,t),s="icons";let r={type:s,provider:e,prefix:t,icons:[]},a=0;return i.forEach((l,d)=>{a+=l.length+1,a>=o&&d>0&&(n.push(r),r={type:s,provider:e,prefix:t,icons:[]},a=l.length),r.icons.push(l)}),n.push(r),n};function xc(e){if(typeof e=="string"){const t=ji(e);if(t)return t.path}return"/"}const wc=(e,t,i)=>{if(!wi){i("abort",424);return}let n=xc(t.provider);switch(t.type){case"icons":{const s=t.prefix,r=t.icons.join(","),a=new URLSearchParams({icons:r});n+=s+".json?"+a.toString();break}case"custom":{const s=t.uri;n+=s.slice(0,1)==="/"?s.slice(1):s;break}default:i("abort",400);return}let o=503;wi(e+n).then(s=>{const r=s.status;if(r!==200){setTimeout(()=>{i(yc(r)?"abort":"next",r)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?i("abort",s):i("next",o)});return}setTimeout(()=>{i("success",s)})}).catch(()=>{i("next",o)})},$c={prepare:_c,send:wc};function Eo(e,t){switch(e){case"local":case"session":Rt[e]=t;break;case"all":for(const i in Rt)Rt[i]=t;break}}const Zi="data-style";let tr="";function Cc(e){tr=e}function So(e,t){let i=Array.from(e.childNodes).find(n=>n.hasAttribute&&n.hasAttribute(Zi));i||(i=document.createElement("style"),i.setAttribute(Zi,Zi),e.appendChild(i)),i.textContent=":host{display:inline-block;vertical-align:"+(t?"-0.125em":"0")+"}span,svg{display:block}"+tr}function er(){yo("",$c),Fs(!0);let e;try{e=window}catch{}if(e){if(Js(),e.IconifyPreload!==void 0){const t=e.IconifyPreload,i="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(n=>{try{(typeof n!="object"||n===null||n instanceof Array||typeof n.icons!="object"||typeof n.prefix!="string"||!go(n))&&console.error(i)}catch{console.error(i)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(const i in t){const n="IconifyProviders["+i+"] is invalid.";try{const o=t[i];if(typeof o!="object"||!o||o.resources===void 0)continue;_o(i,o)||console.error(n)}catch{console.error(n)}}}}return{enableCache:t=>Eo(t,!0),disableCache:t=>Eo(t,!1),iconLoaded:vo,iconExists:vo,getIcon:Fl,listIcons:zl,addIcon:Hs,addCollection:go,calculateSize:bn,buildIcon:Ks,iconToHTML:Rn,svgToURL:Zs,loadIcons:Ln,loadIcon:nc,addAPIProvider:_o,appendCustomStyle:Cc,_api:{getAPIConfig:ji,setAPIModule:yo,sendAPIQuery:Vs,setFetch:fc,getFetch:gc,listAPIProviders:Yl}}}const fn={"background-color":"currentColor"},ir={"background-color":"transparent"},ko={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},To={"-webkit-mask":fn,mask:fn,background:ir};for(const e in To){const t=To[e];for(const i in ko)t[e+"-"+i]=ko[i]}function Oo(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}function Ac(e,t,i){const n=document.createElement("span");let o=e.body;o.indexOf("");const s=e.attributes,r=Rn(o,{...s,width:t.width+"",height:t.height+""}),a=Zs(r),l=n.style,d={"--svg":a,width:Oo(s.width),height:Oo(s.height),...i?fn:ir};for(const u in d)l.setProperty(u,d[u]);return n}let ke;function Ec(){try{ke=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{ke=null}}function Sc(e){return ke===void 0&&Ec(),ke?ke.createHTML(e):e}function kc(e){const t=document.createElement("span"),i=e.attributes;let n="";i.width||(n="width: inherit;"),i.height||(n+="height: inherit;"),n&&(i.style=n);const o=Rn(e.body,i);return t.innerHTML=Sc(o),t.firstChild}function gn(e){return Array.from(e.childNodes).find(t=>{const i=t.tagName&&t.tagName.toUpperCase();return i==="SPAN"||i==="SVG"})}function No(e,t){const i=t.icon.data,n=t.customisations,o=Ks(i,n);n.preserveAspectRatio&&(o.attributes.preserveAspectRatio=n.preserveAspectRatio);const s=t.renderedMode;let r;switch(s){case"svg":r=kc(o);break;default:r=Ac(o,{...Ge,...i},s==="mask")}const a=gn(e);a?r.tagName==="SPAN"&&a.tagName===r.tagName?a.setAttribute("style",r.getAttribute("style")):e.replaceChild(r,a):e.appendChild(r)}function Io(e,t,i){const n=i&&(i.rendered?i:i.lastRender);return{rendered:!1,inline:t,icon:e,lastRender:n}}function Tc(e="iconify-icon"){let t,i;try{t=window.customElements,i=window.HTMLElement}catch{return}if(!t||!i)return;const n=t.get(e);if(n)return n;const o=["icon","mode","inline","observe","width","height","rotate","flip"],s=class extends i{constructor(){super(),Nt(this,"_shadowRoot"),Nt(this,"_initialised",!1),Nt(this,"_state"),Nt(this,"_checkQueued",!1),Nt(this,"_connected",!1),Nt(this,"_observer",null),Nt(this,"_visible",!0);const a=this._shadowRoot=this.attachShadow({mode:"open"}),l=Ki(this);So(a,l),this._state=Io({value:""},l),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return o.slice(0)}attributeChangedCallback(a){switch(a){case"inline":{const l=Ki(this),d=this._state;l!==d.inline&&(d.inline=l,So(this._shadowRoot,l));break}case"observer":{this.observer?this.startObserver():this.stopObserver();break}default:this._queueCheck()}}get icon(){const a=this.getAttribute("icon");if(a&&a.slice(0,1)==="{")try{return JSON.parse(a)}catch{}return a}set icon(a){typeof a=="object"&&(a=JSON.stringify(a)),this.setAttribute("icon",a)}get inline(){return Ki(this)}set inline(a){a?this.setAttribute("inline","true"):this.removeAttribute("inline")}get observer(){return this.hasAttribute("observer")}set observer(a){a?this.setAttribute("observer","true"):this.removeAttribute("observer")}restartAnimation(){const a=this._state;if(a.rendered){const l=this._shadowRoot;if(a.renderedMode==="svg")try{l.lastChild.setCurrentTime(0);return}catch{}No(l,a)}}get status(){const a=this._state;return a.rendered?"rendered":a.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const a=this._state,l=this.getAttribute("icon");if(l!==a.icon.value){this._iconChanged(l);return}if(!a.rendered||!this._visible)return;const d=this.getAttribute("mode"),u=bo(this);(a.attrMode!==d||Il(a.customisations,u)||!gn(this._shadowRoot))&&this._renderIcon(a.icon,u,d)}_iconChanged(a){const l=sc(a,(d,u,c)=>{const h=this._state;if(h.rendered||this.getAttribute("icon")!==d)return;const p={value:d,name:u,data:c};p.data?this._gotIconData(p):h.icon=p});l.data?this._gotIconData(l):this._state=Io(l,this._state.inline,this._state)}_forceRender(){if(!this._visible){const a=gn(this._shadowRoot);a&&this._shadowRoot.removeChild(a);return}this._queueCheck()}_gotIconData(a){this._checkQueued=!1,this._renderIcon(a,bo(this),this.getAttribute("mode"))}_renderIcon(a,l,d){const u=rc(a.data.body,d),c=this._state.inline;No(this._shadowRoot,this._state={rendered:!0,icon:a,inline:c,customisations:l,attrMode:d,renderedMode:u})}startObserver(){if(!this._observer)try{this._observer=new IntersectionObserver(a=>{const l=a.some(d=>d.isIntersecting);l!==this._visible&&(this._visible=l,this._forceRender())}),this._observer.observe(this)}catch{if(this._observer){try{this._observer.disconnect()}catch{}this._observer=null}}}stopObserver(){this._observer&&(this._observer.disconnect(),this._observer=null,this._visible=!0,this._connected&&this._forceRender())}};o.forEach(a=>{a in s.prototype||Object.defineProperty(s.prototype,a,{get:function(){return this.getAttribute(a)},set:function(l){l!==null?this.setAttribute(a,l):this.removeAttribute(a)}})});const r=er();for(const a in r)s[a]=s.prototype[a]=r[a];return t.define(e,s),s}Tc()||er();const Oc=I` + ::-webkit-scrollbar { + width: 0.4rem; + height: 0.4rem; + overflow: hidden; + } + + ::-webkit-scrollbar-thumb { + border-radius: 0.25rem; + background-color: var( + --bim-scrollbar--c, + color-mix(in lab, var(--bim-ui_main-base), white 15%) + ); + } + + ::-webkit-scrollbar-track { + background-color: var(--bim-scrollbar--bgc, var(--bim-ui_bg-base)); + } +`,Nc=I` + :root { + /* Grayscale Colors */ + --bim-ui_gray-0: hsl(210 10% 5%); + --bim-ui_gray-1: hsl(210 10% 10%); + --bim-ui_gray-2: hsl(210 10% 20%); + --bim-ui_gray-3: hsl(210 10% 30%); + --bim-ui_gray-4: hsl(210 10% 40%); + --bim-ui_gray-6: hsl(210 10% 60%); + --bim-ui_gray-7: hsl(210 10% 70%); + --bim-ui_gray-8: hsl(210 10% 80%); + --bim-ui_gray-9: hsl(210 10% 90%); + --bim-ui_gray-10: hsl(210 10% 95%); + + /* Brand Colors */ + --bim-ui_main-base: #6528d7; + --bim-ui_accent-base: #bcf124; + + /* Brand Colors Contrasts */ + --bim-ui_main-contrast: var(--bim-ui_gray-10); + --bim-ui_accent-contrast: var(--bim-ui_gray-0); + + /* Sizes */ + --bim-ui_size-4xs: 0.375rem; + --bim-ui_size-3xs: 0.5rem; + --bim-ui_size-2xs: 0.625rem; + --bim-ui_size-xs: 0.75rem; + --bim-ui_size-sm: 0.875rem; + --bim-ui_size-base: 1rem; + --bim-ui_size-lg: 1.125rem; + --bim-ui_size-xl: 1.25rem; + --bim-ui_size-2xl: 1.375rem; + --bim-ui_size-3xl: 1.5rem; + --bim-ui_size-4xl: 1.625rem; + --bim-ui_size-5xl: 1.75rem; + --bim-ui_size-6xl: 1.875rem; + --bim-ui_size-7xl: 2rem; + --bim-ui_size-8xl: 2.125rem; + --bim-ui_size-9xl: 2.25rem; + } + + /* Background Colors */ + @media (prefers-color-scheme: dark) { + :root { + --bim-ui_bg-base: var(--bim-ui_gray-0); + --bim-ui_bg-contrast-10: var(--bim-ui_gray-1); + --bim-ui_bg-contrast-20: var(--bim-ui_gray-2); + --bim-ui_bg-contrast-30: var(--bim-ui_gray-3); + --bim-ui_bg-contrast-40: var(--bim-ui_gray-4); + --bim-ui_bg-contrast-60: var(--bim-ui_gray-6); + --bim-ui_bg-contrast-80: var(--bim-ui_gray-8); + --bim-ui_bg-contrast-100: var(--bim-ui_gray-10); + } + } + + @media (prefers-color-scheme: light) { + :root { + --bim-ui_bg-base: var(--bim-ui_gray-10); + --bim-ui_bg-contrast-10: var(--bim-ui_gray-9); + --bim-ui_bg-contrast-20: var(--bim-ui_gray-8); + --bim-ui_bg-contrast-30: var(--bim-ui_gray-7); + --bim-ui_bg-contrast-40: var(--bim-ui_gray-6); + --bim-ui_bg-contrast-60: var(--bim-ui_gray-4); + --bim-ui_bg-contrast-80: var(--bim-ui_gray-2); + --bim-ui_bg-contrast-100: var(--bim-ui_gray-0); + --bim-ui_accent-base: #6528d7; + } + } + + html.bim-ui-dark { + --bim-ui_bg-base: var(--bim-ui_gray-0); + --bim-ui_bg-contrast-10: var(--bim-ui_gray-1); + --bim-ui_bg-contrast-20: var(--bim-ui_gray-2); + --bim-ui_bg-contrast-30: var(--bim-ui_gray-3); + --bim-ui_bg-contrast-40: var(--bim-ui_gray-4); + --bim-ui_bg-contrast-60: var(--bim-ui_gray-6); + --bim-ui_bg-contrast-80: var(--bim-ui_gray-8); + --bim-ui_bg-contrast-100: var(--bim-ui_gray-10); + } + + html.bim-ui-light { + --bim-ui_bg-base: var(--bim-ui_gray-10); + --bim-ui_bg-contrast-10: var(--bim-ui_gray-9); + --bim-ui_bg-contrast-20: var(--bim-ui_gray-8); + --bim-ui_bg-contrast-30: var(--bim-ui_gray-7); + --bim-ui_bg-contrast-40: var(--bim-ui_gray-6); + --bim-ui_bg-contrast-60: var(--bim-ui_gray-4); + --bim-ui_bg-contrast-80: var(--bim-ui_gray-2); + --bim-ui_bg-contrast-100: var(--bim-ui_gray-0); + --bim-ui_accent-base: #6528d7; + } + + [data-context-dialog]::backdrop { + background-color: transparent; + } +`,St={scrollbar:Oc,globalStyles:Nc},nr=class T{static set config(t){this._config={...T._config,...t}}static get config(){return T._config}static addGlobalStyles(){let t=document.querySelector("style[id='bim-ui']");if(t)return;t=document.createElement("style"),t.id="bim-ui",t.textContent=St.globalStyles.cssText;const i=document.head.firstChild;i?document.head.insertBefore(t,i):document.head.append(t)}static defineCustomElement(t,i){customElements.get(t)||customElements.define(t,i)}static registerComponents(){T.init()}static init(){T.addGlobalStyles(),T.defineCustomElement("bim-button",Rc),T.defineCustomElement("bim-checkbox",ce),T.defineCustomElement("bim-color-input",Ut),T.defineCustomElement("bim-context-menu",vn),T.defineCustomElement("bim-dropdown",bt),T.defineCustomElement("bim-grid",jn),T.defineCustomElement("bim-icon",Wc),T.defineCustomElement("bim-input",Xe),T.defineCustomElement("bim-label",ue),T.defineCustomElement("bim-number-input",Y),T.defineCustomElement("bim-option",H),T.defineCustomElement("bim-panel",Vt),T.defineCustomElement("bim-panel-section",he),T.defineCustomElement("bim-selector",pe),T.defineCustomElement("bim-table",tt),T.defineCustomElement("bim-tabs",Gt),T.defineCustomElement("bim-tab",J),T.defineCustomElement("bim-table-cell",vr),T.defineCustomElement("bim-table-children",_r),T.defineCustomElement("bim-table-group",wr),T.defineCustomElement("bim-table-row",Wt),T.defineCustomElement("bim-text-input",dt),T.defineCustomElement("bim-toolbar",Vi),T.defineCustomElement("bim-toolbar-group",Bi),T.defineCustomElement("bim-toolbar-section",fe),T.defineCustomElement("bim-viewport",Pr)}static newRandomId(){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let i="";for(let n=0;n<10;n++){const o=Math.floor(Math.random()*t.length);i+=t.charAt(o)}return i}};nr._config={sectionLabelOnVerticalToolbar:!1};let Te=nr;class V extends O{constructor(){super(...arguments),this._lazyLoadObserver=null,this._visibleElements=[],this.ELEMENTS_BEFORE_OBSERVER=20,this.useObserver=!1,this.elements=new Set,this.observe=t=>{if(!this.useObserver)return;for(const n of t)this.elements.add(n);const i=t.slice(this.ELEMENTS_BEFORE_OBSERVER);for(const n of i)n.remove();this.observeLastElement()}}set visibleElements(t){this._visibleElements=this.useObserver?t:[],this.requestUpdate()}get visibleElements(){return this._visibleElements}getLazyObserver(){if(!this.useObserver)return null;if(this._lazyLoadObserver)return this._lazyLoadObserver;const t=new IntersectionObserver(i=>{const n=i[0];if(!n.isIntersecting)return;const o=n.target;t.unobserve(o);const s=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length,r=[...this.elements][s];r&&(this.visibleElements=[...this.visibleElements,r],t.observe(r))},{threshold:.5});return t}observeLastElement(){const t=this.getLazyObserver();if(!t)return;const i=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length-1,n=[...this.elements][i];n&&t.observe(n)}resetVisibleElements(){const t=this.getLazyObserver();if(t){for(const i of this.elements)t.unobserve(i);this.visibleElements=[],this.observeLastElement()}}static create(t,i){const n=document.createDocumentFragment();if(t.length===0)return ee(t(),n),n.firstElementChild;if(!i)throw new Error("UIComponent: Initial state is required for statefull components.");let o=i;const s=t,r=l=>(o={...o,...l},ee(s(o),n),o);r(i);const a=()=>o;return[n.firstElementChild,r,a]}}var Ic=Object.defineProperty,Pc=Object.getOwnPropertyDescriptor,or=(e,t,i,n)=>{for(var o=Pc(t,i),s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&Ic(t,i,o),o},F;const Dn=(F=class extends O{constructor(){super(...arguments),this._previousContainer=null,this._visible=!1}get placement(){return this._placement}set placement(e){this._placement=e,this.updatePosition()}static removeMenus(){for(const e of F.menus)e instanceof F&&(e.visible=!1);F.dialog.close(),F.dialog.remove()}get visible(){return this._visible}set visible(e){var t;this._visible=e,e?(F.dialog.parentElement||document.body.append(F.dialog),this._previousContainer=this.parentElement,F.dialog.style.top=`${window.scrollY||document.documentElement.scrollTop}px`,F.dialog.append(this),F.dialog.showModal(),this.updatePosition(),this.dispatchEvent(new Event("visible"))):((t=this._previousContainer)==null||t.append(this),this._previousContainer=null,this.dispatchEvent(new Event("hidden")))}async updatePosition(){if(!(this.visible&&this._previousContainer))return;const e=this.placement??"right",t=await As(this._previousContainer,this,{placement:e,middleware:[hs(10),Cs(),$s(),ws({padding:5})]}),{x:i,y:n}=t;this.style.left=`${i}px`,this.style.top=`${n}px`}connectedCallback(){super.connectedCallback(),F.menus.push(this)}render(){return m` `}},F.styles=[St.scrollbar,I` + :host { + pointer-events: auto; + position: absolute; + top: 0; + left: 0; + z-index: 999; + overflow: auto; + max-height: 20rem; + min-width: 3rem; + flex-direction: column; + box-shadow: 1px 2px 8px 2px rgba(0, 0, 0, 0.15); + padding: 0.5rem; + border-radius: var(--bim-ui_size-4xs); + display: flex; + background-color: var( + --bim-context-menu--bgc, + var(--bim-ui_bg-contrast-20) + ); + } + + :host(:not([visible])) { + display: none; + } + `],F.dialog=V.create(()=>m` {e.target===F.dialog&&F.removeMenus()}} + @cancel=${()=>F.removeMenus()} + data-context-dialog + style=" + width: 0; + height: 0; + position: relative; + padding: 0; + border: none; + outline: none; + margin: none; + overflow: visible; + background-color: transparent; + " + >`),F.menus=[],F);or([f({type:String,reflect:!0})],Dn.prototype,"placement");or([f({type:Boolean,reflect:!0})],Dn.prototype,"visible");let vn=Dn;var Mc=Object.defineProperty,Lc=Object.getOwnPropertyDescriptor,it=(e,t,i,n)=>{for(var o=n>1?void 0:n?Lc(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&Mc(t,i,o),o},we;const K=(we=class extends O{constructor(){super(),this.labelHidden=!1,this.active=!1,this.disabled=!1,this.vertical=!1,this.tooltipVisible=!1,this._stateBeforeLoading={disabled:!1,icon:""},this._loading=!1,this._parent=ie(),this._tooltip=ie(),this._mouseLeave=!1,this.onClick=e=>{e.stopPropagation(),this.disabled||this.dispatchEvent(new Event("click"))},this.showContextMenu=()=>{const e=this._contextMenu;if(e){const t=this.getAttribute("data-context-group");t&&e.setAttribute("data-context-group",t),this.closeNestedContexts();const i=Te.newRandomId();for(const n of e.children)n instanceof we&&n.setAttribute("data-context-group",i);e.visible=!0}},this.mouseLeave=!0}set loading(e){if(this._loading=e,e)this._stateBeforeLoading={disabled:this.disabled,icon:this.icon},this.disabled=e,this.icon="eos-icons:loading";else{const{disabled:t,icon:i}=this._stateBeforeLoading;this.disabled=t,this.icon=i}}get loading(){return this._loading}set mouseLeave(e){this._mouseLeave=e,e&&(this.tooltipVisible=!1,clearTimeout(this.timeoutID))}get mouseLeave(){return this._mouseLeave}computeTooltipPosition(){const{value:e}=this._parent,{value:t}=this._tooltip;e&&t&&As(e,t,{placement:"bottom",middleware:[hs(10),Cs(),$s(),ws({padding:5})]}).then(i=>{const{x:n,y:o}=i;Object.assign(t.style,{left:`${n}px`,top:`${o}px`})})}onMouseEnter(){if(!(this.tooltipTitle||this.tooltipText))return;this.mouseLeave=!1;const e=this.tooltipTime??700;this.timeoutID=setTimeout(()=>{this.mouseLeave||(this.computeTooltipPosition(),this.tooltipVisible=!0)},e)}closeNestedContexts(){const e=this.getAttribute("data-context-group");if(e)for(const t of vn.dialog.children){const i=t.getAttribute("data-context-group");if(t instanceof vn&&i===e){t.visible=!1,t.removeAttribute("data-context-group");for(const n of t.children)n instanceof we&&(n.closeNestedContexts(),n.removeAttribute("data-context-group"))}}}click(){this.disabled||super.click()}get _contextMenu(){return this.querySelector("bim-context-menu")}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.showContextMenu)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.showContextMenu)}render(){const e=m` +
${this.tooltipTitle?m`

${this.tooltipTitle}

`:null} ${this.tooltipText?m`

${this.tooltipText}

`:null}
- `;return m` -
+ `,t=m` + + + `;return m` +
${this.label||this.icon?m`
${this.label}${this.label}${this.label&&this._contextMenu?t:null}
`:null} ${this.tooltipTitle||this.tooltipText?e:null}
- `}};Gs.styles=I` + `}},we.styles=I` :host { --bim-label--c: var(--bim-ui_bg-contrast-100, white); display: block; @@ -153,8 +314,8 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I } :host([disabled]) { - --bim-label--c: var(--bim-ui_bg-contrast-80); - background-color: gray; + --bim-label--c: var(--bim-ui_bg-contrast-80) !important; + background-color: gray !important; } ::slotted(bim-button) { @@ -187,7 +348,7 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I :host(:not([tooltip-visible])) .tooltip { display: none; } - `;let Q=Gs;tt([b({type:String,reflect:!0})],Q.prototype,"label",2);tt([b({type:Boolean,attribute:"label-hidden",reflect:!0})],Q.prototype,"labelHidden",2);tt([b({type:Boolean,reflect:!0})],Q.prototype,"active",2);tt([b({type:Boolean,reflect:!0,attribute:"disabled"})],Q.prototype,"disabled",2);tt([b({type:String,reflect:!0})],Q.prototype,"icon",2);tt([b({type:Boolean,reflect:!0})],Q.prototype,"vertical",2);tt([b({type:Number,attribute:"tooltip-time",reflect:!0})],Q.prototype,"tooltipTime",2);tt([b({type:Boolean,attribute:"tooltip-visible",reflect:!0})],Q.prototype,"tooltipVisible",2);tt([b({type:String,attribute:"tooltip-title",reflect:!0})],Q.prototype,"tooltipTitle",2);tt([b({type:String,attribute:"tooltip-text",reflect:!0})],Q.prototype,"tooltipText",2);tt([b({type:Boolean,reflect:!0})],Q.prototype,"loading",1);var wc=Object.defineProperty,We=(e,t,i,n)=>{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&wc(t,i,o),o};const qs=class extends T{constructor(){super(...arguments),this.checked=!1,this.inverted=!1,this.onValueChange=new Event("change")}get value(){return this.checked}onChange(e){e.stopPropagation(),this.checked=e.target.checked,this.dispatchEvent(this.onValueChange)}render(){return m` + `,we);it([f({type:String,reflect:!0})],K.prototype,"label",2);it([f({type:Boolean,attribute:"label-hidden",reflect:!0})],K.prototype,"labelHidden",2);it([f({type:Boolean,reflect:!0})],K.prototype,"active",2);it([f({type:Boolean,reflect:!0,attribute:"disabled"})],K.prototype,"disabled",2);it([f({type:String,reflect:!0})],K.prototype,"icon",2);it([f({type:Boolean,reflect:!0})],K.prototype,"vertical",2);it([f({type:Number,attribute:"tooltip-time",reflect:!0})],K.prototype,"tooltipTime",2);it([f({type:Boolean,attribute:"tooltip-visible",reflect:!0})],K.prototype,"tooltipVisible",2);it([f({type:String,attribute:"tooltip-title",reflect:!0})],K.prototype,"tooltipTitle",2);it([f({type:String,attribute:"tooltip-text",reflect:!0})],K.prototype,"tooltipText",2);it([f({type:Boolean,reflect:!0})],K.prototype,"loading",1);let Rc=K;var Dc=Object.defineProperty,Ye=(e,t,i,n)=>{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&Dc(t,i,o),o};const sr=class extends O{constructor(){super(...arguments),this.checked=!1,this.inverted=!1,this.onValueChange=new Event("change")}get value(){return this.checked}onChange(e){e.stopPropagation(),this.checked=e.target.checked,this.dispatchEvent(this.onValueChange)}render(){return m`
${this.label?m`${this.label} `:null}
- `}};qs.styles=I` + `}};sr.styles=I` :host { display: block; } @@ -231,7 +392,7 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I outline: var(--bim-checkbox--olw, 2px) solid var(--bim-checkbox--olc, var(--bim-ui_accent-base)); } - `;let le=qs;We([b({type:String,reflect:!0})],le.prototype,"icon");We([b({type:String,reflect:!0})],le.prototype,"name");We([b({type:String,reflect:!0})],le.prototype,"label");We([b({type:Boolean,reflect:!0})],le.prototype,"checked");We([b({type:Boolean,reflect:!0})],le.prototype,"inverted");var $c=Object.defineProperty,ce=(e,t,i,n)=>{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&$c(t,i,o),o};const Ys=class extends T{constructor(){super(...arguments),this.vertical=!1,this.color="#bcf124",this._colorInput=ie(),this._textInput=ie(),this.onValueChange=new Event("input"),this.onOpacityInput=e=>{const t=e.target;this.opacity=t.value,this.dispatchEvent(this.onValueChange)}}set value(e){const{color:t,opacity:i}=e;this.color=t,i&&(this.opacity=i)}get value(){const e={color:this.color};return this.opacity&&(e.opacity=this.opacity),e}onColorInput(e){e.stopPropagation();const{value:t}=this._colorInput;t&&(this.color=t.value,this.dispatchEvent(this.onValueChange))}onTextInput(e){e.stopPropagation();const{value:t}=this._textInput;if(!t)return;const{value:i}=t;let n=i.replace(/[^a-fA-F0-9]/g,"");n.startsWith("#")||(n=`#${n}`),t.value=n.slice(0,7),t.value.length===7&&(this.color=t.value,this.dispatchEvent(this.onValueChange))}focus(){const{value:e}=this._colorInput;e&&e.click()}render(){return m` + `;let ce=sr;Ye([f({type:String,reflect:!0})],ce.prototype,"icon");Ye([f({type:String,reflect:!0})],ce.prototype,"name");Ye([f({type:String,reflect:!0})],ce.prototype,"label");Ye([f({type:Boolean,reflect:!0})],ce.prototype,"checked");Ye([f({type:Boolean,reflect:!0})],ce.prototype,"inverted");var jc=Object.defineProperty,de=(e,t,i,n)=>{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&jc(t,i,o),o};const rr=class extends O{constructor(){super(...arguments),this.vertical=!1,this.color="#bcf124",this._colorInput=ie(),this._textInput=ie(),this.onValueChange=new Event("input"),this.onOpacityInput=e=>{const t=e.target;this.opacity=t.value,this.dispatchEvent(this.onValueChange)}}set value(e){const{color:t,opacity:i}=e;this.color=t,i&&(this.opacity=i)}get value(){const e={color:this.color};return this.opacity&&(e.opacity=this.opacity),e}onColorInput(e){e.stopPropagation();const{value:t}=this._colorInput;t&&(this.color=t.value,this.dispatchEvent(this.onValueChange))}onTextInput(e){e.stopPropagation();const{value:t}=this._textInput;if(!t)return;const{value:i}=t;let n=i.replace(/[^a-fA-F0-9]/g,"");n.startsWith("#")||(n=`#${n}`),t.value=n.slice(0,7),t.value.length===7&&(this.color=t.value,this.dispatchEvent(this.onValueChange))}focus(){const{value:e}=this._colorInput;e&&e.click()}render(){return m`
- `}};Ys.styles=I` + `}};rr.styles=I` :host { --bim-input--bgc: var(--bim-ui_bg-contrast-20); flex: 1; @@ -333,159 +494,7 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I bim-number-input { flex-grow: 0; } - `;let Bt=Ys;ce([b({type:String,reflect:!0})],Bt.prototype,"name");ce([b({type:String,reflect:!0})],Bt.prototype,"label");ce([b({type:String,reflect:!0})],Bt.prototype,"icon");ce([b({type:Boolean,reflect:!0})],Bt.prototype,"vertical");ce([b({type:Number,reflect:!0})],Bt.prototype,"opacity");ce([b({type:String,reflect:!0})],Bt.prototype,"color");const Cc=I` - ::-webkit-scrollbar { - width: 0.4rem; - height: 0.4rem; - overflow: hidden; - } - - ::-webkit-scrollbar-thumb { - border-radius: 0.25rem; - background-color: var( - --bim-scrollbar--c, - color-mix(in lab, var(--bim-ui_main-base), white 15%) - ); - } - - ::-webkit-scrollbar-track { - background-color: var(--bim-scrollbar--bgc, var(--bim-ui_bg-base)); - } -`,Ec=I` - :root { - /* Grayscale Colors */ - --bim-ui_gray-0: hsl(210 10% 5%); - --bim-ui_gray-1: hsl(210 10% 10%); - --bim-ui_gray-2: hsl(210 10% 20%); - --bim-ui_gray-3: hsl(210 10% 30%); - --bim-ui_gray-4: hsl(210 10% 40%); - --bim-ui_gray-6: hsl(210 10% 60%); - --bim-ui_gray-7: hsl(210 10% 70%); - --bim-ui_gray-8: hsl(210 10% 80%); - --bim-ui_gray-9: hsl(210 10% 90%); - --bim-ui_gray-10: hsl(210 10% 95%); - - /* Brand Colors */ - --bim-ui_main-base: #6528d7; - --bim-ui_accent-base: #bcf124; - - /* Brand Colors Contrasts */ - --bim-ui_main-contrast: var(--bim-ui_gray-10); - --bim-ui_accent-contrast: var(--bim-ui_gray-0); - - /* Sizes */ - --bim-ui_size-4xs: 0.375rem; - --bim-ui_size-3xs: 0.5rem; - --bim-ui_size-2xs: 0.625rem; - --bim-ui_size-xs: 0.75rem; - --bim-ui_size-sm: 0.875rem; - --bim-ui_size-base: 1rem; - --bim-ui_size-lg: 1.125rem; - --bim-ui_size-xl: 1.25rem; - --bim-ui_size-2xl: 1.375rem; - --bim-ui_size-3xl: 1.5rem; - --bim-ui_size-4xl: 1.625rem; - --bim-ui_size-5xl: 1.75rem; - --bim-ui_size-6xl: 1.875rem; - --bim-ui_size-7xl: 2rem; - --bim-ui_size-8xl: 2.125rem; - --bim-ui_size-9xl: 2.25rem; - } - - /* Background Colors */ - @media (prefers-color-scheme: dark) { - :root { - --bim-ui_bg-base: var(--bim-ui_gray-0); - --bim-ui_bg-contrast-10: var(--bim-ui_gray-1); - --bim-ui_bg-contrast-20: var(--bim-ui_gray-2); - --bim-ui_bg-contrast-30: var(--bim-ui_gray-3); - --bim-ui_bg-contrast-40: var(--bim-ui_gray-4); - --bim-ui_bg-contrast-60: var(--bim-ui_gray-6); - --bim-ui_bg-contrast-80: var(--bim-ui_gray-8); - --bim-ui_bg-contrast-100: var(--bim-ui_gray-10); - } - } - - @media (prefers-color-scheme: light) { - :root { - --bim-ui_bg-base: var(--bim-ui_gray-10); - --bim-ui_bg-contrast-10: var(--bim-ui_gray-9); - --bim-ui_bg-contrast-20: var(--bim-ui_gray-8); - --bim-ui_bg-contrast-30: var(--bim-ui_gray-7); - --bim-ui_bg-contrast-40: var(--bim-ui_gray-6); - --bim-ui_bg-contrast-60: var(--bim-ui_gray-4); - --bim-ui_bg-contrast-80: var(--bim-ui_gray-2); - --bim-ui_bg-contrast-100: var(--bim-ui_gray-0); - --bim-ui_accent-base: #6528d7; - } - } - - html.bim-ui-dark { - --bim-ui_bg-base: var(--bim-ui_gray-0); - --bim-ui_bg-contrast-10: var(--bim-ui_gray-1); - --bim-ui_bg-contrast-20: var(--bim-ui_gray-2); - --bim-ui_bg-contrast-30: var(--bim-ui_gray-3); - --bim-ui_bg-contrast-40: var(--bim-ui_gray-4); - --bim-ui_bg-contrast-60: var(--bim-ui_gray-6); - --bim-ui_bg-contrast-80: var(--bim-ui_gray-8); - --bim-ui_bg-contrast-100: var(--bim-ui_gray-10); - } - - html.bim-ui-light { - --bim-ui_bg-base: var(--bim-ui_gray-10); - --bim-ui_bg-contrast-10: var(--bim-ui_gray-9); - --bim-ui_bg-contrast-20: var(--bim-ui_gray-8); - --bim-ui_bg-contrast-30: var(--bim-ui_gray-7); - --bim-ui_bg-contrast-40: var(--bim-ui_gray-6); - --bim-ui_bg-contrast-60: var(--bim-ui_gray-4); - --bim-ui_bg-contrast-80: var(--bim-ui_gray-2); - --bim-ui_bg-contrast-100: var(--bim-ui_gray-0); - --bim-ui_accent-base: #6528d7; - } - - [data-context-dialog]::backdrop { - background-color: transparent; - } -`,St={scrollbar:Cc,globalStyles:Ec},Xs=class O{static set config(t){this._config={...O._config,...t}}static get config(){return O._config}static addGlobalStyles(){let t=document.querySelector("style[id='bim-ui']");if(t)return;t=document.createElement("style"),t.id="bim-ui",t.textContent=St.globalStyles.cssText;const i=document.head.firstChild;i?document.head.insertBefore(t,i):document.head.append(t)}static defineCustomElement(t,i){customElements.get(t)||customElements.define(t,i)}static registerComponents(){O.init()}static init(){O.addGlobalStyles(),O.defineCustomElement("bim-button",Q),O.defineCustomElement("bim-checkbox",le),O.defineCustomElement("bim-color-input",Bt),O.defineCustomElement("bim-context-menu",kc),O.defineCustomElement("bim-dropdown",bt),O.defineCustomElement("bim-grid",Nn),O.defineCustomElement("bim-icon",Lc),O.defineCustomElement("bim-input",Ge),O.defineCustomElement("bim-label",de),O.defineCustomElement("bim-number-input",W),O.defineCustomElement("bim-option",F),O.defineCustomElement("bim-panel",Ut),O.defineCustomElement("bim-panel-section",ue),O.defineCustomElement("bim-selector",he),O.defineCustomElement("bim-table",K),O.defineCustomElement("bim-tabs",Wt),O.defineCustomElement("bim-tab",Y),O.defineCustomElement("bim-table-cell",lr),O.defineCustomElement("bim-table-children",dr),O.defineCustomElement("bim-table-group",hr),O.defineCustomElement("bim-table-row",Vt),O.defineCustomElement("bim-text-input",lt),O.defineCustomElement("bim-toolbar",zi),O.defineCustomElement("bim-toolbar-group",Di),O.defineCustomElement("bim-toolbar-section",be),O.defineCustomElement("bim-viewport",$r)}static newRandomId(){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let i="";for(let n=0;n<10;n++){const o=Math.floor(Math.random()*t.length);i+=t.charAt(o)}return i}};Xs._config={sectionLabelOnVerticalToolbar:!1};let hn=Xs;class B extends T{constructor(){super(...arguments),this._lazyLoadObserver=null,this._visibleElements=[],this.ELEMENTS_BEFORE_OBSERVER=20,this.useObserver=!1,this.elements=new Set,this.observe=t=>{if(!this.useObserver)return;for(const n of t)this.elements.add(n);const i=t.slice(this.ELEMENTS_BEFORE_OBSERVER);for(const n of i)n.remove();this.observeLastElement()}}set visibleElements(t){this._visibleElements=this.useObserver?t:[],this.requestUpdate()}get visibleElements(){return this._visibleElements}getLazyObserver(){if(!this.useObserver)return null;if(this._lazyLoadObserver)return this._lazyLoadObserver;const t=new IntersectionObserver(i=>{const n=i[0];if(!n.isIntersecting)return;const o=n.target;t.unobserve(o);const s=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length,r=[...this.elements][s];r&&(this.visibleElements=[...this.visibleElements,r],t.observe(r))},{threshold:.5});return t}observeLastElement(){const t=this.getLazyObserver();if(!t)return;const i=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length-1,n=[...this.elements][i];n&&t.observe(n)}resetVisibleElements(){const t=this.getLazyObserver();if(t){for(const i of this.elements)t.unobserve(i);this.visibleElements=[],this.observeLastElement()}}static create(t,i){const n=document.createDocumentFragment();if(t.length===0)return ee(t(),n),n.firstElementChild;if(!i)throw new Error("UIComponent: Initial state is required for statefull components.");let o=i;const s=t,r=l=>(o={...o,...l},ee(s(o),n),o);r(i);const a=()=>o;return[n.firstElementChild,r,a]}}var Ac=Object.defineProperty,Sc=Object.getOwnPropertyDescriptor,Js=(e,t,i,n)=>{for(var o=Sc(t,i),s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&Ac(t,i,o),o},R;const In=(R=class extends T{constructor(){super(...arguments),this._previousContainer=null,this._visible=!1}get placement(){return this._placement}set placement(e){this._placement=e,this.updatePosition()}static removeMenus(){for(const e of R.menus)e instanceof R&&(e.visible=!1);R.dialog.close(),R.dialog.remove()}get visible(){return this._visible}set visible(e){var t;this._visible=e,e?(R.dialog.parentElement||document.body.append(R.dialog),this._previousContainer=this.parentElement,R.dialog.style.top=`${window.scrollY||document.documentElement.scrollTop}px`,R.dialog.append(this),R.dialog.showModal(),this.updatePosition(),this.dispatchEvent(new Event("visible"))):((t=this._previousContainer)==null||t.append(this),this._previousContainer=null,this.dispatchEvent(new Event("hidden")))}async updatePosition(){if(!(this.visible&&this._previousContainer))return;const e=this.placement??"right",t=await ms(this._previousContainer,this,{placement:e,middleware:[es(10),ps(),hs(),us({padding:5})]}),{x:i,y:n}=t;this.style.left=`${i}px`,this.style.top=`${n}px`}connectedCallback(){super.connectedCallback(),R.menus.push(this)}render(){return m` `}},R.styles=[St.scrollbar,I` - :host { - pointer-events: auto; - position: absolute; - top: 0; - left: 0; - z-index: 999; - overflow: auto; - max-height: 20rem; - min-width: 3rem; - flex-direction: column; - box-shadow: 1px 2px 8px 2px rgba(0, 0, 0, 0.15); - padding: 0.5rem; - border-radius: var(--bim-ui_size-4xs); - display: flex; - background-color: var( - --bim-context-menu--bgc, - var(--bim-ui_bg-contrast-20) - ); - } - - :host(:not([visible])) { - display: none; - } - `],R.dialog=B.create(()=>m` {e.target===R.dialog&&R.removeMenus()}} - @cancel=${()=>R.removeMenus()} - data-context-dialog - style=" - width: 0; - height: 0; - position: relative; - padding: 0; - border: none; - outline: none; - margin: none; - overflow: visible; - background-color: transparent; - " - >`),R.menus=[],R);Js([b({type:String,reflect:!0})],In.prototype,"placement");Js([b({type:Boolean,reflect:!0})],In.prototype,"visible");let kc=In;const _i=(e,t={},i=!0)=>{let n={};for(const o of e.children){const s=o,r=s.getAttribute("name")||s.getAttribute("label"),a=t[r];if(r){if("value"in s&&typeof s.value<"u"&&s.value!==null){const l=s.value;if(typeof l=="object"&&!Array.isArray(l)&&Object.keys(l).length===0)continue;n[r]=a?a(s.value):s.value}else if(i){const l=_i(s,t);if(Object.keys(l).length===0)continue;n[r]=a?a(l):l}}else i&&(n={...n,..._i(s,t)})}return n},Mi=e=>e==="true"||e==="false"?e==="true":e&&!isNaN(Number(e))&&e.trim()!==""?Number(e):e,Oc=[">=","<=","=",">","<","?","/","#"];function Eo(e){const t=Oc.find(r=>e.split(r).length===2),i=e.split(t).map(r=>r.trim()),[n,o]=i,s=o.startsWith("'")&&o.endsWith("'")?o.replace(/'/g,""):Mi(o);return{key:n,condition:t,value:s}}const pn=e=>{try{const t=[],i=e.split(/&(?![^()]*\))/).map(n=>n.trim());for(const n of i){const o=!n.startsWith("(")&&!n.endsWith(")"),s=n.startsWith("(")&&n.endsWith(")");if(o){const r=Eo(n);t.push(r)}if(s){const r={operator:"&",queries:n.replace(/^(\()|(\))$/g,"").split("&").map(a=>a.trim()).map((a,l)=>{const d=Eo(a);return l>0&&(d.operator="&"),d})};t.push(r)}}return t}catch{return null}},Ao=(e,t,i)=>{let n=!1;switch(t){case"=":n=e===i;break;case"?":n=String(e).includes(String(i));break;case"<":(typeof e=="number"||typeof i=="number")&&(n=e":(typeof e=="number"||typeof i=="number")&&(n=e>i);break;case">=":(typeof e=="number"||typeof i=="number")&&(n=e>=i);break;case"/":n=String(e).startsWith(String(i));break}return n};var Tc=Object.defineProperty,Ic=Object.getOwnPropertyDescriptor,kt=(e,t,i,n)=>{for(var o=n>1?void 0:n?Ic(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&Tc(t,i,o),o};const Qs=class extends T{constructor(){super(...arguments),this.checked=!1,this.checkbox=!1,this.noMark=!1,this.vertical=!1}get value(){return this._value!==void 0?this._value:this.label?Mi(this.label):this.label}set value(e){this._value=e}render(){return m` + `;let Ut=rr;de([f({type:String,reflect:!0})],Ut.prototype,"name");de([f({type:String,reflect:!0})],Ut.prototype,"label");de([f({type:String,reflect:!0})],Ut.prototype,"icon");de([f({type:Boolean,reflect:!0})],Ut.prototype,"vertical");de([f({type:Number,reflect:!0})],Ut.prototype,"opacity");de([f({type:String,reflect:!0})],Ut.prototype,"color");const $i=(e,t={},i=!0)=>{let n={};for(const o of e.children){const s=o,r=s.getAttribute("name")||s.getAttribute("label"),a=t[r];if(r){if("value"in s&&typeof s.value<"u"&&s.value!==null){const l=s.value;if(typeof l=="object"&&!Array.isArray(l)&&Object.keys(l).length===0)continue;n[r]=a?a(s.value):s.value}else if(i){const l=$i(s,t);if(Object.keys(l).length===0)continue;n[r]=a?a(l):l}}else i&&(n={...n,...$i(s,t)})}return n},zi=e=>e==="true"||e==="false"?e==="true":e&&!isNaN(Number(e))&&e.trim()!==""?Number(e):e,zc=[">=","<=","=",">","<","?","/","#"];function Po(e){const t=zc.find(r=>e.split(r).length===2),i=e.split(t).map(r=>r.trim()),[n,o]=i,s=o.startsWith("'")&&o.endsWith("'")?o.replace(/'/g,""):zi(o);return{key:n,condition:t,value:s}}const yn=e=>{try{const t=[],i=e.split(/&(?![^()]*\))/).map(n=>n.trim());for(const n of i){const o=!n.startsWith("(")&&!n.endsWith(")"),s=n.startsWith("(")&&n.endsWith(")");if(o){const r=Po(n);t.push(r)}if(s){const r={operator:"&",queries:n.replace(/^(\()|(\))$/g,"").split("&").map(a=>a.trim()).map((a,l)=>{const d=Po(a);return l>0&&(d.operator="&"),d})};t.push(r)}}return t}catch{return null}},Mo=(e,t,i)=>{let n=!1;switch(t){case"=":n=e===i;break;case"?":n=String(e).includes(String(i));break;case"<":(typeof e=="number"||typeof i=="number")&&(n=e":(typeof e=="number"||typeof i=="number")&&(n=e>i);break;case">=":(typeof e=="number"||typeof i=="number")&&(n=e>=i);break;case"/":n=String(e).startsWith(String(i));break}return n};var Fc=Object.defineProperty,Hc=Object.getOwnPropertyDescriptor,kt=(e,t,i,n)=>{for(var o=n>1?void 0:n?Hc(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&Fc(t,i,o),o};const ar=class extends O{constructor(){super(...arguments),this.checked=!1,this.checkbox=!1,this.noMark=!1,this.vertical=!1}get value(){return this._value!==void 0?this._value:this.label?zi(this.label):this.label}set value(e){this._value=e}render(){return m`
${this.img||this.icon||this.label?m`
${this.checkbox&&!this.noMark?m``:null}
- `}};Qs.styles=I` + `}};ar.styles=I` :host { --bim-label--c: var(--bim-ui_bg-contrast-100); display: block; @@ -566,7 +575,7 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I bim-label { pointer-events: none; } - `;let F=Qs;kt([b({type:String,reflect:!0})],F.prototype,"img",2);kt([b({type:String,reflect:!0})],F.prototype,"label",2);kt([b({type:String,reflect:!0})],F.prototype,"icon",2);kt([b({type:Boolean,reflect:!0})],F.prototype,"checked",2);kt([b({type:Boolean,reflect:!0})],F.prototype,"checkbox",2);kt([b({type:Boolean,attribute:"no-mark",reflect:!0})],F.prototype,"noMark",2);kt([b({converter:{fromAttribute(e){return e&&Mi(e)}}})],F.prototype,"value",1);kt([b({type:Boolean,reflect:!0})],F.prototype,"vertical",2);var Nc=Object.defineProperty,Pc=Object.getOwnPropertyDescriptor,Ot=(e,t,i,n)=>{for(var o=n>1?void 0:n?Pc(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&Nc(t,i,o),o};const Zs=class extends B{constructor(){super(),this.multiple=!1,this.required=!1,this.vertical=!1,this._visible=!1,this._value=new Set,this.onValueChange=new Event("change"),this._contextMenu=ie(),this.onOptionClick=e=>{const t=e.target,i=this._value.has(t);if(!this.multiple&&!this.required&&!i)this._value=new Set([t]);else if(!this.multiple&&!this.required&&i)this._value=new Set([]);else if(!this.multiple&&this.required&&!i)this._value=new Set([t]);else if(this.multiple&&!this.required&&!i)this._value=new Set([...this._value,t]);else if(this.multiple&&!this.required&&i){const n=[...this._value].filter(o=>o!==t);this._value=new Set(n)}else if(this.multiple&&this.required&&!i)this._value=new Set([...this._value,t]);else if(this.multiple&&this.required&&i){const n=[...this._value].filter(s=>s!==t),o=new Set(n);o.size!==0&&(this._value=o)}this.updateOptionsState(),this.dispatchEvent(this.onValueChange)},this.useObserver=!0}set visible(e){if(e){const{value:t}=this._contextMenu;if(!t)return;for(const i of this.elements)t.append(i);this._visible=!0}else{for(const t of this.elements)this.append(t);this._visible=!1,this.resetVisibleElements()}}get visible(){return this._visible}set value(e){if(this.required&&Object.keys(e).length===0)return;const t=new Set;for(const i of e){const n=this.findOption(i);if(n&&(t.add(n),!this.multiple&&Object.keys(e).length===1))break}this._value=t,this.updateOptionsState(),this.dispatchEvent(this.onValueChange)}get value(){return[...this._value].filter(e=>e instanceof F&&e.checked).map(e=>e.value)}get _options(){const e=new Set([...this.elements]);for(const t of this.children)t instanceof F&&e.add(t);return[...e]}onSlotChange(e){const t=e.target.assignedElements();this.observe(t);const i=new Set;for(const n of this.elements){if(!(n instanceof F)){n.remove();continue}n.checked&&i.add(n),n.removeEventListener("click",this.onOptionClick),n.addEventListener("click",this.onOptionClick)}this._value=i}updateOptionsState(){for(const e of this._options)e instanceof F&&(e.checked=this._value.has(e))}findOption(e){return this._options.find(t=>t instanceof F?t.label===e||t.value===e:!1)}render(){let e,t,i;if(this._value.size===0)e="Select an option...";else if(this._value.size===1){const n=[...this._value][0];e=(n==null?void 0:n.label)||(n==null?void 0:n.value),t=n==null?void 0:n.img,i=n==null?void 0:n.icon}else e=`Multiple (${this._value.size})`;return m` + `;let H=ar;kt([f({type:String,reflect:!0})],H.prototype,"img",2);kt([f({type:String,reflect:!0})],H.prototype,"label",2);kt([f({type:String,reflect:!0})],H.prototype,"icon",2);kt([f({type:Boolean,reflect:!0})],H.prototype,"checked",2);kt([f({type:Boolean,reflect:!0})],H.prototype,"checkbox",2);kt([f({type:Boolean,attribute:"no-mark",reflect:!0})],H.prototype,"noMark",2);kt([f({converter:{fromAttribute(e){return e&&zi(e)}}})],H.prototype,"value",1);kt([f({type:Boolean,reflect:!0})],H.prototype,"vertical",2);var Bc=Object.defineProperty,Uc=Object.getOwnPropertyDescriptor,Tt=(e,t,i,n)=>{for(var o=n>1?void 0:n?Uc(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&Bc(t,i,o),o};const lr=class extends V{constructor(){super(),this.multiple=!1,this.required=!1,this.vertical=!1,this._visible=!1,this._value=new Set,this.onValueChange=new Event("change"),this._contextMenu=ie(),this.onOptionClick=e=>{const t=e.target,i=this._value.has(t);if(!this.multiple&&!this.required&&!i)this._value=new Set([t]);else if(!this.multiple&&!this.required&&i)this._value=new Set([]);else if(!this.multiple&&this.required&&!i)this._value=new Set([t]);else if(this.multiple&&!this.required&&!i)this._value=new Set([...this._value,t]);else if(this.multiple&&!this.required&&i){const n=[...this._value].filter(o=>o!==t);this._value=new Set(n)}else if(this.multiple&&this.required&&!i)this._value=new Set([...this._value,t]);else if(this.multiple&&this.required&&i){const n=[...this._value].filter(s=>s!==t),o=new Set(n);o.size!==0&&(this._value=o)}this.updateOptionsState(),this.dispatchEvent(this.onValueChange)},this.useObserver=!0}set visible(e){if(e){const{value:t}=this._contextMenu;if(!t)return;for(const i of this.elements)t.append(i);this._visible=!0}else{for(const t of this.elements)this.append(t);this._visible=!1,this.resetVisibleElements()}}get visible(){return this._visible}set value(e){if(this.required&&Object.keys(e).length===0)return;const t=new Set;for(const i of e){const n=this.findOption(i);if(n&&(t.add(n),!this.multiple&&Object.keys(e).length===1))break}this._value=t,this.updateOptionsState(),this.dispatchEvent(this.onValueChange)}get value(){return[...this._value].filter(e=>e instanceof H&&e.checked).map(e=>e.value)}get _options(){const e=new Set([...this.elements]);for(const t of this.children)t instanceof H&&e.add(t);return[...e]}onSlotChange(e){const t=e.target.assignedElements();this.observe(t);const i=new Set;for(const n of this.elements){if(!(n instanceof H)){n.remove();continue}n.checked&&i.add(n),n.removeEventListener("click",this.onOptionClick),n.addEventListener("click",this.onOptionClick)}this._value=i}updateOptionsState(){for(const e of this._options)e instanceof H&&(e.checked=this._value.has(e))}findOption(e){return this._options.find(t=>t instanceof H?t.label===e||t.value===e:!1)}render(){let e,t,i;if(this._value.size===0)e="Select an option...";else if(this._value.size===1){const n=[...this._value][0];e=(n==null?void 0:n.label)||(n==null?void 0:n.value),t=n==null?void 0:n.img,i=n==null?void 0:n.icon}else e=`Multiple (${this._value.size})`;return m` {this.visible&&(this.visible=!1)}} > @@ -600,7 +609,7 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I
- `}};Zs.styles=[St.scrollbar,I` + `}};lr.styles=[St.scrollbar,I` :host { --bim-input--bgc: var( --bim-dropdown--bgc, @@ -635,8 +644,8 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I bim-label { pointer-events: none; } - `];let bt=Zs;Ot([b({type:String,reflect:!0})],bt.prototype,"name",2);Ot([b({type:String,reflect:!0})],bt.prototype,"icon",2);Ot([b({type:String,reflect:!0})],bt.prototype,"label",2);Ot([b({type:Boolean,reflect:!0})],bt.prototype,"multiple",2);Ot([b({type:Boolean,reflect:!0})],bt.prototype,"required",2);Ot([b({type:Boolean,reflect:!0})],bt.prototype,"vertical",2);Ot([b({type:Boolean,reflect:!0})],bt.prototype,"visible",1);Ot([ae()],bt.prototype,"_value",2);var Mc=Object.defineProperty,Ks=(e,t,i,n)=>{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&Mc(t,i,o),o};const tr=class extends T{constructor(){super(...arguments),this.floating=!1,this.layouts={}}getUniqueAreasFromTemplate(e){const t=e.split(` -`).map(i=>i.trim()).map(i=>i.split('"')[1]).filter(i=>i!==void 0).flatMap(i=>i.split(/\s+/));return[...new Set(t)].filter(i=>i!=="")}firstUpdated(){this._onLayoutChange=new Event("layoutchange")}render(){if(this.layout){if(this.layouts[this.layout]){this.innerHTML="";const e=this.layouts[this.layout],t=this.getUniqueAreasFromTemplate(e.template).map(i=>{const n=e.elements[i];return n&&(n.style.gridArea=i),n}).filter(i=>!!i);this.style.gridTemplate=e.template,this._onLayoutChange&&this.dispatchEvent(this._onLayoutChange),this.append(...t)}}else this.innerHTML="",this.style.gridTemplate="",this._onLayoutChange&&this.dispatchEvent(this._onLayoutChange);return m``}};tr.styles=I` + `];let bt=lr;Tt([f({type:String,reflect:!0})],bt.prototype,"name",2);Tt([f({type:String,reflect:!0})],bt.prototype,"icon",2);Tt([f({type:String,reflect:!0})],bt.prototype,"label",2);Tt([f({type:Boolean,reflect:!0})],bt.prototype,"multiple",2);Tt([f({type:Boolean,reflect:!0})],bt.prototype,"required",2);Tt([f({type:Boolean,reflect:!0})],bt.prototype,"vertical",2);Tt([f({type:Boolean,reflect:!0})],bt.prototype,"visible",1);Tt([le()],bt.prototype,"_value",2);var Vc=Object.defineProperty,cr=(e,t,i,n)=>{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&Vc(t,i,o),o};const dr=class extends O{constructor(){super(...arguments),this.floating=!1,this.layouts={}}getUniqueAreasFromTemplate(e){const t=e.split(` +`).map(i=>i.trim()).map(i=>i.split('"')[1]).filter(i=>i!==void 0).flatMap(i=>i.split(/\s+/));return[...new Set(t)].filter(i=>i!=="")}firstUpdated(){this._onLayoutChange=new Event("layoutchange")}render(){if(this.layout){if(this.layouts[this.layout]){this.innerHTML="";const e=this.layouts[this.layout],t=this.getUniqueAreasFromTemplate(e.template).map(i=>{const n=e.elements[i];return n&&(n.style.gridArea=i),n}).filter(i=>!!i);this.style.gridTemplate=e.template,this._onLayoutChange&&this.dispatchEvent(this._onLayoutChange),this.append(...t)}}else this.innerHTML="",this.style.gridTemplate="",this._onLayoutChange&&this.dispatchEvent(this._onLayoutChange);return m``}};dr.styles=I` :host { display: grid; height: 100%; @@ -665,9 +674,9 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I background-color: var(--bim-ui_bg-contrast-20); gap: 1px; } - `;let Nn=tr;Ks([b({type:Boolean,reflect:!0})],Nn.prototype,"floating");Ks([b({type:String,reflect:!0})],Nn.prototype,"layout");const mn=class extends T{render(){return m` + `;let jn=dr;cr([f({type:Boolean,reflect:!0})],jn.prototype,"floating");cr([f({type:String,reflect:!0})],jn.prototype,"layout");const _n=class extends O{render(){return m` - `}};mn.styles=I` + `}};_n.styles=I` :host { height: var(--bim-icon--fz, var(--bim-ui_size-sm)); width: var(--bim-icon--fz, var(--bim-ui_size-sm)); @@ -679,14 +688,14 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I color: var(--bim-icon--c); transition: all 0.15s; } - `,mn.properties={icon:{type:String}};let Lc=mn;var jc=Object.defineProperty,Li=(e,t,i,n)=>{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&jc(t,i,o),o};const er=class extends T{constructor(){super(...arguments),this.vertical=!1,this.onValueChange=new Event("change")}get value(){const e={};for(const t of this.children){const i=t;"value"in i?e[i.name||i.label]=i.value:"checked"in i&&(e[i.name||i.label]=i.checked)}return e}set value(e){const t=[...this.children];for(const i in e){const n=t.find(r=>{const a=r;return a.name===i||a.label===i});if(!n)continue;const o=n,s=e[i];typeof s=="boolean"?o.checked=s:o.value=s}}render(){return m` + `,_n.properties={icon:{type:String}};let Wc=_n;var Gc=Object.defineProperty,Fi=(e,t,i,n)=>{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&Gc(t,i,o),o};const ur=class extends O{constructor(){super(...arguments),this.vertical=!1,this.onValueChange=new Event("change")}get value(){const e={};for(const t of this.children){const i=t;"value"in i?e[i.name||i.label]=i.value:"checked"in i&&(e[i.name||i.label]=i.checked)}return e}set value(e){const t=[...this.children];for(const i in e){const n=t.find(r=>{const a=r;return a.name===i||a.label===i});if(!n)continue;const o=n,s=e[i];typeof s=="boolean"?o.checked=s:o.value=s}}render(){return m`
${this.label||this.icon?m`${this.label}`:null}
- `}};er.styles=I` + `}};ur.styles=I` :host { flex: 1; display: block; @@ -734,13 +743,13 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I :host(:not([vertical])[label]) .input { max-width: fit-content; } - `;let Ge=er;Li([b({type:String,reflect:!0})],Ge.prototype,"name");Li([b({type:String,reflect:!0})],Ge.prototype,"label");Li([b({type:String,reflect:!0})],Ge.prototype,"icon");Li([b({type:Boolean,reflect:!0})],Ge.prototype,"vertical");var Dc=Object.defineProperty,qe=(e,t,i,n)=>{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&Dc(t,i,o),o};const ir=class extends T{constructor(){super(...arguments),this.labelHidden=!1,this.iconHidden=!1,this.vertical=!1}get value(){return this.textContent?Mi(this.textContent):this.textContent}render(){return m` + `;let Xe=ur;Fi([f({type:String,reflect:!0})],Xe.prototype,"name");Fi([f({type:String,reflect:!0})],Xe.prototype,"label");Fi([f({type:String,reflect:!0})],Xe.prototype,"icon");Fi([f({type:Boolean,reflect:!0})],Xe.prototype,"vertical");var qc=Object.defineProperty,Je=(e,t,i,n)=>{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&qc(t,i,o),o};const hr=class extends O{constructor(){super(...arguments),this.labelHidden=!1,this.iconHidden=!1,this.vertical=!1}get value(){return this.textContent?zi(this.textContent):this.textContent}render(){return m`
${this.img?m``:null} ${!this.iconHidden&&this.icon?m``:null}

- `}};ir.styles=I` + `}};hr.styles=I` :host { --bim-icon--c: var(--bim-label--c); color: var(--bim-label--c, var(--bim-ui_bg-contrast-60)); @@ -769,6 +778,9 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I margin: 0; text-overflow: ellipsis; overflow: hidden; + display: flex; + align-items: center; + gap: 0.125rem; } :host([label-hidden]) .parent p, @@ -796,7 +808,7 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I calc(var(--bim-label--fz, var(--bim-ui_size-xs)) * 4) ); } - `;let de=ir;qe([b({type:String,reflect:!0})],de.prototype,"img");qe([b({type:Boolean,attribute:"label-hidden",reflect:!0})],de.prototype,"labelHidden");qe([b({type:String,reflect:!0})],de.prototype,"icon");qe([b({type:Boolean,attribute:"icon-hidden",reflect:!0})],de.prototype,"iconHidden");qe([b({type:Boolean,reflect:!0})],de.prototype,"vertical");var Rc=Object.defineProperty,zc=Object.getOwnPropertyDescriptor,Z=(e,t,i,n)=>{for(var o=n>1?void 0:n?zc(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&Rc(t,i,o),o};const nr=class extends T{constructor(){super(...arguments),this._value=0,this.vertical=!1,this.slider=!1,this._input=ie(),this.onValueChange=new Event("change")}set value(e){this.setValue(e.toString())}get value(){return this._value}onChange(e){e.stopPropagation();const{value:t}=this._input;t&&this.setValue(t.value)}setValue(e){const{value:t}=this._input;let i=e;if(i=i.replace(/[^0-9.-]/g,""),i=i.replace(/(\..*)\./g,"$1"),i.endsWith(".")||(i.lastIndexOf("-")>0&&(i=i[0]+i.substring(1).replace(/-/g,"")),i==="-"||i==="-0"))return;let n=Number(i);Number.isNaN(n)||(n=this.min!==void 0?Math.max(n,this.min):n,n=this.max!==void 0?Math.min(n,this.max):n,this.value!==n&&(this._value=n,t&&(t.value=this.value.toString()),this.requestUpdate(),this.dispatchEvent(this.onValueChange)))}onBlur(){const{value:e}=this._input;e&&Number.isNaN(Number(e.value))&&(e.value=this.value.toString())}onSliderMouseDown(e){document.body.style.cursor="w-resize";const{clientX:t}=e,i=this.value;let n=!1;const o=a=>{var l;n=!0;const{clientX:d}=a,u=this.step??1,c=((l=u.toString().split(".")[1])==null?void 0:l.length)||0,h=1/(this.sensitivity??1),p=(d-t)/h;if(Math.floor(Math.abs(p))!==Math.abs(p))return;const g=i+p*u;this.setValue(g.toFixed(c))},s=()=>{this.slider=!0,this.removeEventListener("blur",s)},r=()=>{document.removeEventListener("mousemove",o),document.body.style.cursor="default",n?n=!1:(this.addEventListener("blur",s),this.slider=!1,requestAnimationFrame(()=>this.focus())),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)}onFocus(e){e.stopPropagation();const t=i=>{i.key==="Escape"&&(this.blur(),window.removeEventListener("keydown",t))};window.addEventListener("keydown",t)}connectedCallback(){super.connectedCallback(),this.min&&this.min>this.value&&(this._value=this.min),this.max&&this.max{for(var o=n>1?void 0:n?Xc(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&Yc(t,i,o),o};const pr=class extends O{constructor(){super(...arguments),this._value=0,this.vertical=!1,this.slider=!1,this._input=ie(),this.onValueChange=new Event("change")}set value(e){this.setValue(e.toString())}get value(){return this._value}onChange(e){e.stopPropagation();const{value:t}=this._input;t&&this.setValue(t.value)}setValue(e){const{value:t}=this._input;let i=e;if(i=i.replace(/[^0-9.-]/g,""),i=i.replace(/(\..*)\./g,"$1"),i.endsWith(".")||(i.lastIndexOf("-")>0&&(i=i[0]+i.substring(1).replace(/-/g,"")),i==="-"||i==="-0"))return;let n=Number(i);Number.isNaN(n)||(n=this.min!==void 0?Math.max(n,this.min):n,n=this.max!==void 0?Math.min(n,this.max):n,this.value!==n&&(this._value=n,t&&(t.value=this.value.toString()),this.requestUpdate(),this.dispatchEvent(this.onValueChange)))}onBlur(){const{value:e}=this._input;e&&Number.isNaN(Number(e.value))&&(e.value=this.value.toString())}onSliderMouseDown(e){document.body.style.cursor="w-resize";const{clientX:t}=e,i=this.value;let n=!1;const o=a=>{var l;n=!0;const{clientX:d}=a,u=this.step??1,c=((l=u.toString().split(".")[1])==null?void 0:l.length)||0,h=1/(this.sensitivity??1),p=(d-t)/h;if(Math.floor(Math.abs(p))!==Math.abs(p))return;const b=i+p*u;this.setValue(b.toFixed(c))},s=()=>{this.slider=!0,this.removeEventListener("blur",s)},r=()=>{document.removeEventListener("mousemove",o),document.body.style.cursor="default",n?n=!1:(this.addEventListener("blur",s),this.slider=!1,requestAnimationFrame(()=>this.focus())),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)}onFocus(e){e.stopPropagation();const t=i=>{i.key==="Escape"&&(this.blur(),window.removeEventListener("keydown",t))};window.addEventListener("keydown",t)}connectedCallback(){super.connectedCallback(),this.min&&this.min>this.value&&(this._value=this.min),this.max&&this.max${this.pref}`:null} ${this.slider?o:e} - `}};nr.styles=I` + `}};pr.styles=I` :host { --bim-input--bgc: var( --bim-number-input--bgc, @@ -933,14 +945,14 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I bim-label { pointer-events: none; } - `;let W=nr;Z([b({type:String,reflect:!0})],W.prototype,"name",2);Z([b({type:String,reflect:!0})],W.prototype,"icon",2);Z([b({type:String,reflect:!0})],W.prototype,"label",2);Z([b({type:String,reflect:!0})],W.prototype,"pref",2);Z([b({type:Number,reflect:!0})],W.prototype,"min",2);Z([b({type:Number,reflect:!0})],W.prototype,"value",1);Z([b({type:Number,reflect:!0})],W.prototype,"step",2);Z([b({type:Number,reflect:!0})],W.prototype,"sensitivity",2);Z([b({type:Number,reflect:!0})],W.prototype,"max",2);Z([b({type:String,reflect:!0})],W.prototype,"suffix",2);Z([b({type:Boolean,reflect:!0})],W.prototype,"vertical",2);Z([b({type:Boolean,reflect:!0})],W.prototype,"slider",2);var Fc=Object.defineProperty,Hc=Object.getOwnPropertyDescriptor,Ye=(e,t,i,n)=>{for(var o=n>1?void 0:n?Hc(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&Fc(t,i,o),o};const or=class extends T{constructor(){super(...arguments),this.onValueChange=new Event("change"),this._hidden=!1,this.headerHidden=!1,this.valueTransform={},this.activationButton=document.createElement("bim-button")}set hidden(e){this._hidden=e,this.activationButton.active=!e,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}get value(){return _i(this,this.valueTransform)}set value(e){const t=[...this.children];for(const i in e){const n=t.find(s=>{const r=s;return r.name===i||r.label===i});if(!n)continue;const o=n;o.value=e[i]}}connectedCallback(){super.connectedCallback(),this.activationButton.active=!this.hidden,this.activationButton.onclick=()=>this.hidden=!this.hidden}disconnectedCallback(){super.disconnectedCallback(),this.activationButton.remove()}collapseSections(){const e=this.querySelectorAll("bim-panel-section");for(const t of e)t.collapsed=!0}expandSections(){const e=this.querySelectorAll("bim-panel-section");for(const t of e)t.collapsed=!1}render(){return this.activationButton.icon=this.icon,this.activationButton.label=this.label||this.name,this.activationButton.tooltipTitle=this.label||this.name,m` + `;let Y=pr;Z([f({type:String,reflect:!0})],Y.prototype,"name",2);Z([f({type:String,reflect:!0})],Y.prototype,"icon",2);Z([f({type:String,reflect:!0})],Y.prototype,"label",2);Z([f({type:String,reflect:!0})],Y.prototype,"pref",2);Z([f({type:Number,reflect:!0})],Y.prototype,"min",2);Z([f({type:Number,reflect:!0})],Y.prototype,"value",1);Z([f({type:Number,reflect:!0})],Y.prototype,"step",2);Z([f({type:Number,reflect:!0})],Y.prototype,"sensitivity",2);Z([f({type:Number,reflect:!0})],Y.prototype,"max",2);Z([f({type:String,reflect:!0})],Y.prototype,"suffix",2);Z([f({type:Boolean,reflect:!0})],Y.prototype,"vertical",2);Z([f({type:Boolean,reflect:!0})],Y.prototype,"slider",2);var Jc=Object.defineProperty,Qc=Object.getOwnPropertyDescriptor,Qe=(e,t,i,n)=>{for(var o=n>1?void 0:n?Qc(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&Jc(t,i,o),o};const mr=class extends O{constructor(){super(...arguments),this.onValueChange=new Event("change"),this._hidden=!1,this.headerHidden=!1,this.valueTransform={},this.activationButton=document.createElement("bim-button")}set hidden(e){this._hidden=e,this.activationButton.active=!e,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}get value(){return $i(this,this.valueTransform)}set value(e){const t=[...this.children];for(const i in e){const n=t.find(s=>{const r=s;return r.name===i||r.label===i});if(!n)continue;const o=n;o.value=e[i]}}connectedCallback(){super.connectedCallback(),this.activationButton.active=!this.hidden,this.activationButton.onclick=()=>this.hidden=!this.hidden}disconnectedCallback(){super.disconnectedCallback(),this.activationButton.remove()}collapseSections(){const e=this.querySelectorAll("bim-panel-section");for(const t of e)t.collapsed=!0}expandSections(){const e=this.querySelectorAll("bim-panel-section");for(const t of e)t.collapsed=!1}render(){return this.activationButton.icon=this.icon,this.activationButton.label=this.label||this.name,this.activationButton.tooltipTitle=this.label||this.name,m`
${this.label||this.name||this.icon?m`${this.label}`:null}
- `}};or.styles=[St.scrollbar,I` + `}};mr.styles=[St.scrollbar,I` :host { display: flex; border-radius: var(--bim-ui_size-base); @@ -982,7 +994,7 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I ::slotted(bim-panel-section:not(:last-child)) { border-bottom: 1px solid var(--bim-ui_bg-contrast-20); } - `];let Ut=or;Ye([b({type:String,reflect:!0})],Ut.prototype,"icon",2);Ye([b({type:String,reflect:!0})],Ut.prototype,"name",2);Ye([b({type:String,reflect:!0})],Ut.prototype,"label",2);Ye([b({type:Boolean,reflect:!0})],Ut.prototype,"hidden",1);Ye([b({type:Boolean,attribute:"header-hidden",reflect:!0})],Ut.prototype,"headerHidden",2);var Bc=Object.defineProperty,Xe=(e,t,i,n)=>{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&Bc(t,i,o),o};const sr=class extends T{constructor(){super(...arguments),this.onValueChange=new Event("change"),this.valueTransform={}}get value(){const e=this.parentElement;let t;return e instanceof Ut&&(t=e.valueTransform),Object.values(this.valueTransform).length!==0&&(t=this.valueTransform),_i(this,t)}set value(e){const t=[...this.children];for(const i in e){const n=t.find(s=>{const r=s;return r.name===i||r.label===i});if(!n)continue;const o=n;o.value=e[i]}}onHeaderClick(){this.fixed||(this.collapsed=!this.collapsed)}render(){const e=this.label||this.icon||this.name||this.fixed,t=m`{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&Kc(t,i,o),o};const br=class extends O{constructor(){super(...arguments),this.onValueChange=new Event("change"),this.valueTransform={}}get value(){const e=this.parentElement;let t;return e instanceof Vt&&(t=e.valueTransform),Object.values(this.valueTransform).length!==0&&(t=this.valueTransform),$i(this,t)}set value(e){const t=[...this.children];for(const i in e){const n=t.find(s=>{const r=s;return r.name===i||r.label===i});if(!n)continue;const o=n;o.value=e[i]}}onHeaderClick(){this.fixed||(this.collapsed=!this.collapsed)}render(){const e=this.label||this.icon||this.name||this.fixed,t=m`
- `}};sr.styles=[St.scrollbar,I` + `}};br.styles=[St.scrollbar,I` :host { display: block; pointer-events: auto; @@ -1070,7 +1082,7 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I bim-label { pointer-events: none; } - `];let ue=sr;Xe([b({type:String,reflect:!0})],ue.prototype,"icon");Xe([b({type:String,reflect:!0})],ue.prototype,"label");Xe([b({type:String,reflect:!0})],ue.prototype,"name");Xe([b({type:Boolean,reflect:!0})],ue.prototype,"fixed");Xe([b({type:Boolean,reflect:!0})],ue.prototype,"collapsed");var Uc=Object.defineProperty,Je=(e,t,i,n)=>{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&Uc(t,i,o),o};const rr=class extends T{constructor(){super(...arguments),this.vertical=!1,this.onValueChange=new Event("change"),this._canEmitEvents=!1,this._value=document.createElement("bim-option"),this.onOptionClick=e=>{this._value=e.target,this.dispatchEvent(this.onValueChange);for(const t of this.children)t instanceof F&&(t.checked=t===e.target)}}get _options(){return[...this.querySelectorAll("bim-option")]}set value(e){const t=this.findOption(e);if(t){for(const i of this._options)i.checked=i===t;this._value=t,this._canEmitEvents&&this.dispatchEvent(this.onValueChange)}}get value(){return this._value.value}onSlotChange(e){const t=e.target.assignedElements();for(const i of t)i instanceof F&&(i.noMark=!0,i.removeEventListener("click",this.onOptionClick),i.addEventListener("click",this.onOptionClick))}findOption(e){return this._options.find(t=>t instanceof F?t.label===e||t.value===e:!1)}firstUpdated(){const e=[...this.children].find(t=>t instanceof F&&t.checked);e&&(this._value=e)}render(){return m` + `];let he=br;Ke([f({type:String,reflect:!0})],he.prototype,"icon");Ke([f({type:String,reflect:!0})],he.prototype,"label");Ke([f({type:String,reflect:!0})],he.prototype,"name");Ke([f({type:Boolean,reflect:!0})],he.prototype,"fixed");Ke([f({type:Boolean,reflect:!0})],he.prototype,"collapsed");var Zc=Object.defineProperty,Ze=(e,t,i,n)=>{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&Zc(t,i,o),o};const fr=class extends O{constructor(){super(...arguments),this.vertical=!1,this.onValueChange=new Event("change"),this._canEmitEvents=!1,this._value=document.createElement("bim-option"),this.onOptionClick=e=>{this._value=e.target,this.dispatchEvent(this.onValueChange);for(const t of this.children)t instanceof H&&(t.checked=t===e.target)}}get _options(){return[...this.querySelectorAll("bim-option")]}set value(e){const t=this.findOption(e);if(t){for(const i of this._options)i.checked=i===t;this._value=t,this._canEmitEvents&&this.dispatchEvent(this.onValueChange)}}get value(){return this._value.value}onSlotChange(e){const t=e.target.assignedElements();for(const i of t)i instanceof H&&(i.noMark=!0,i.removeEventListener("click",this.onOptionClick),i.addEventListener("click",this.onOptionClick))}findOption(e){return this._options.find(t=>t instanceof H?t.label===e||t.value===e:!1)}firstUpdated(){const e=[...this.children].find(t=>t instanceof H&&t.checked);e&&(this._value=e)}render(){return m` - `}};rr.styles=I` + `}};fr.styles=I` :host { --bim-input--bgc: var(--bim-ui_bg-contrast-20); --bim-input--g: 0; @@ -1095,7 +1107,7 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I --bim-label--c: var(--bim-ui_main-contrast); background-color: var(--bim-ui_main-base); } - `;let he=rr;Je([b({type:String,reflect:!0})],he.prototype,"name");Je([b({type:String,reflect:!0})],he.prototype,"icon");Je([b({type:String,reflect:!0})],he.prototype,"label");Je([b({type:Boolean,reflect:!0})],he.prototype,"vertical");Je([ae()],he.prototype,"_value");const Vc=()=>m` + `;let pe=fr;Ze([f({type:String,reflect:!0})],pe.prototype,"name");Ze([f({type:String,reflect:!0})],pe.prototype,"icon");Ze([f({type:String,reflect:!0})],pe.prototype,"label");Ze([f({type:Boolean,reflect:!0})],pe.prototype,"vertical");Ze([le()],pe.prototype,"_value");const td=()=>m` - `}};ar.styles=I` + `}};gr.styles=I` :host { padding: 0.375rem; display: flex; @@ -1238,7 +1250,7 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I justify-content: center; } - :host([data-column-index="0"]:not([data-no-indentation])) { + :host([data-column-index="0"]) { justify-content: normal; } @@ -1261,10 +1273,10 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I white-space: normal; text-align: center; } - `;let lr=ar;qc([b({type:String,reflect:!0})],lr.prototype,"column");var Yc=Object.defineProperty,Xc=(e,t,i,n)=>{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&Yc(t,i,o),o};const cr=class extends T{constructor(){super(...arguments),this._groups=[],this.data=[],this.table=this.closest("bim-table")}toggleGroups(e,t=!1){for(const i of this._groups)i.childrenHidden=typeof e>"u"?!i.childrenHidden:!e,t&&i.toggleChildren(e,t)}render(){return this._groups=[],m` + `;let vr=gr;nd([f({type:String,reflect:!0})],vr.prototype,"column");var od=Object.defineProperty,sd=(e,t,i,n)=>{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&od(t,i,o),o};const yr=class extends O{constructor(){super(...arguments),this._groups=[],this.data=[],this.table=this.closest("bim-table")}toggleGroups(e,t=!1){for(const i of this._groups)i.childrenHidden=typeof e>"u"?!i.childrenHidden:!e,t&&i.toggleChildren(e,t)}render(){return this._groups=[],m` ${this.data.map(e=>{const t=document.createElement("bim-table-group");return this._groups.push(t),t.table=this.table,t.data=e,t})} - `}};cr.styles=I` + `}};yr.styles=I` :host { --bim-button--bgc: transparent; position: relative; @@ -1279,7 +1291,7 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I top: 0; bottom: 1.125rem; } - `;let dr=cr;Xc([b({type:Array,attribute:!1})],dr.prototype,"data");var Jc=Object.defineProperty,Qc=(e,t,i,n)=>{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&Jc(t,i,o),o};const ur=class extends T{constructor(){super(...arguments),this.data={data:{}},this.childrenHidden=!0,this.table=this.closest("bim-table")}connectedCallback(){super.connectedCallback(),this.table&&this.table.expanded?this.childrenHidden=!1:this.childrenHidden=!0}toggleChildren(e,t=!1){this._children&&(this.childrenHidden=typeof e>"u"?!this.childrenHidden:!e,t&&this._children.toggleGroups(e,t))}render(){if(!this.table)throw new Error("TableGroup: parent table wasn't found!");const e=this.table.getGroupIndentation(this.data)??0,t=m` + `;let _r=yr;sd([f({type:Array,attribute:!1})],_r.prototype,"data");var rd=Object.defineProperty,ad=(e,t,i,n)=>{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&rd(t,i,o),o};const xr=class extends O{constructor(){super(...arguments),this.data={data:{}},this.childrenHidden=!0,this.table=this.closest("bim-table")}connectedCallback(){super.connectedCallback(),this.table&&this.table.expanded?this.childrenHidden=!1:this.childrenHidden=!0}toggleChildren(e,t=!1){this._children&&(this.childrenHidden=typeof e>"u"?!this.childrenHidden:!e,t&&this._children.toggleGroups(e,t))}render(){if(!this.table)throw new Error("TableGroup: parent table wasn't found!");const e=this.table.getGroupIndentation(this.data)??0,t=m` ${this.table.noIndentation?null:m` {n&&n(c)}} id="BBETO" icon="iconamoon:enter-duotone"> ${l} - `:l},Priority:l=>{if(typeof l!="string")return l;const d=((i==null?void 0:i.priorities)??ri.priorities)[l];return m` + `:l},Priority:l=>{if(typeof l!="string")return l;const d=((i==null?void 0:i.priorities)??ci.priorities)[l];return m` ${l} - `},Status:l=>{if(typeof l!="string")return l;const d=((i==null?void 0:i.statuses)??ri.statuses)[l];return m` + `},Status:l=>{if(typeof l!="string")return l;const d=((i==null?void 0:i.statuses)??ci.statuses)[l];return m` ${l} - `},Type:l=>{if(typeof l!="string")return l;const d=((i==null?void 0:i.types)??ri.types)[l];return m` + `},Type:l=>{if(typeof l!="string")return l;const d=((i==null?void 0:i.types)??ci.types)[l];return m` ${l} - `},Author:l=>typeof l!="string"?l:ko(l,i),Assignee:l=>typeof l!="string"?l:ko(l,i)},a.data=[...s].map(l=>{var d;return{data:{Guid:l.guid,Title:l.title,Status:l.status,Description:l.description??"",Author:l.creationAuthor,Assignee:l.assignedTo??"",Date:l.creationDate.toDateString(),DueDate:((d=l.dueDate)==null?void 0:d.toDateString())??"",Type:l.type,Priority:l.priority??""}}})})}> + `},Author:l=>typeof l!="string"?l:Ro(l,i),Assignee:l=>typeof l!="string"?l:Ro(l,i)},a.data=[...s].map(l=>{var d;return{data:{Guid:l.guid,Title:l.title,Status:l.status,Description:l.description??"",Author:l.creationAuthor,Assignee:l.assignedTo??"",Date:l.creationDate.toDateString(),DueDate:((d=l.dueDate)==null?void 0:d.toDateString())??"",Type:l.type,Priority:l.priority??""}}})})}> There are no topics to display - `},Er=(e,t=!0)=>{const i=B.create(yd,e);if(t){const{components:n,topics:o}=e,[,s]=i,r=n.get(Re);if(r.list.onItemUpdated.add(()=>s()),r.list.onItemDeleted.add(()=>s()),o)for(const a of o)a.relatedTopics.onItemAdded.add(()=>s()),a.relatedTopics.onItemDeleted.add(()=>s()),a.relatedTopics.onCleared.add(()=>s());else r.list.onItemSet.add(()=>s())}return i},_d=Object.freeze(Object.defineProperty({__proto__:null,topicsList:Er},Symbol.toStringTag,{value:"Module"})),xd=e=>{var t;const{components:i,topic:n,actions:o}=e,s={selectComponents:!0,colorizeComponent:!0,resetColors:!0,updateCamera:!0,delete:!0,unlink:!!n,...o},r=i.get(fn),a=((t=e.topic)==null?void 0:t.viewpoints)??r.list.keys(),l=[];for(const d of a){const u=r.list.get(d);u&&l.push(u)}return m` - {if(!d)return;const u=d;u.addEventListener("cellcreated",({detail:c})=>{const{cell:h}=c;h.style.padding="0.25rem"}),u.headersHidden=!0,u.hiddenColumns=["Guid"],u.columns=["Title",{name:"Actions",width:"auto"}],u.dataTransform={Actions:(c,h)=>{const{Guid:p}=h;if(!(p&&typeof p=="string"))return p;const g=r.list.get(p);return g?m` - g.go()}> + `},Lr=(e,t=!0)=>{const i=V.create(Td,e);if(t){const{components:n,topics:o}=e,[,s]=i,r=n.get(Be);if(r.list.onItemUpdated.add(()=>s()),r.list.onItemDeleted.add(()=>s()),o)for(const a of o)a.relatedTopics.onItemAdded.add(()=>s()),a.relatedTopics.onItemDeleted.add(()=>s()),a.relatedTopics.onCleared.add(()=>s());else r.list.onItemSet.add(()=>s())}return i},Od=Object.freeze(Object.defineProperty({__proto__:null,topicsList:Lr},Symbol.toStringTag,{value:"Module"})),Nd=e=>{var t;const{components:i,topic:n,actions:o}=e,s={selectComponents:!0,colorizeComponent:!0,resetColors:!0,updateCamera:!0,delete:!0,unlink:!!n,...o},r=i.get($n),a=((t=e.topic)==null?void 0:t.viewpoints)??r.list.keys(),l=[];for(const d of a){const u=r.list.get(d);u&&l.push(u)}return m` + {if(!d)return;const u=d;u.addEventListener("cellcreated",({detail:c})=>{const{cell:h}=c;h.style.padding="0.25rem"}),u.headersHidden=!0,u.hiddenColumns=["Guid"],u.columns=["Title",{name:"Actions",width:"auto"}],u.dataTransform={Actions:(c,h)=>{const{Guid:p}=h;if(!(p&&typeof p=="string"))return p;const b=r.list.get(p);return b?m` + b.go()}> ${Object.values(s).includes(!0)?m` - ${s.selectComponents?m`console.log(g.selection)}> `:null} - ${s.colorizeComponent?m`g.colorize()}> `:null} - ${s.resetColors?m`g.resetColors()}> `:null} - ${s.updateCamera?m`g.updateCamera()}> `:null} - ${s.unlink?m`n==null?void 0:n.viewpoints.delete(g.guid)}> `:null} - ${s.delete?m`r.list.delete(g.guid)}>`:null} + ${s.selectComponents?m`console.log(b.selection)}> `:null} + ${s.colorizeComponent?m`b.colorize()}> `:null} + ${s.resetColors?m`b.resetColors()}> `:null} + ${s.updateCamera?m`b.updateCamera()}> `:null} + ${s.unlink?m`n==null?void 0:n.viewpoints.delete(b.guid)}> `:null} + ${s.delete?m`r.list.delete(b.guid)}>`:null} `:null} `:p}},u.data=l.map((c,h)=>({data:{Guid:c.guid,Title:c.title??`Viewpoint ${e.topic?h+1:""}`,Actions:""}}))})}> No viewpoints to show - `},Mn=(e,t=!0)=>{const i=B.create(xd,e),{components:n,topic:o}=e;if(t){const[,s]=i,r=n.get(fn);r.list.onItemUpdated.add(()=>s()),r.list.onItemDeleted.add(()=>s()),r.list.onCleared.add(()=>s()),o?(o.viewpoints.onItemAdded.add(()=>s()),o.viewpoints.onItemDeleted.add(()=>s()),o.viewpoints.onCleared.add(()=>s())):r.list.onItemSet.add(()=>s())}return i},wd=Object.freeze(Object.defineProperty({__proto__:null,viewpointsList:Mn},Symbol.toStringTag,{value:"Module"})),$d={"jhon.doe@example.com":{name:"Jhon Doe",picture:"https://www.profilebakery.com/wp-content/uploads/2023/04/Profile-Image-AI.jpg"}},Cd=(e,t)=>{const i=(t??$d)[e],n=(i==null?void 0:i.name)??e,o=n.trim().split(/\s+/);let s,r;return o[0]&&o[0][0]&&(s=o[0][0].toUpperCase(),o[0][1]&&(r=o[0][1].toUpperCase())),o[1]&&o[1][0]&&(r=o[1][0].toUpperCase()),m` + `},Fn=(e,t=!0)=>{const i=V.create(Nd,e),{components:n,topic:o}=e;if(t){const[,s]=i,r=n.get($n);r.list.onItemUpdated.add(()=>s()),r.list.onItemDeleted.add(()=>s()),r.list.onCleared.add(()=>s()),o?(o.viewpoints.onItemAdded.add(()=>s()),o.viewpoints.onItemDeleted.add(()=>s()),o.viewpoints.onCleared.add(()=>s())):r.list.onItemSet.add(()=>s())}return i},Id=Object.freeze(Object.defineProperty({__proto__:null,viewpointsList:Fn},Symbol.toStringTag,{value:"Module"})),Pd={"jhon.doe@example.com":{name:"Jhon Doe",picture:"https://www.profilebakery.com/wp-content/uploads/2023/04/Profile-Image-AI.jpg"}},Md=(e,t)=>{const i=(t??Pd)[e],n=(i==null?void 0:i.name)??e,o=n.trim().split(/\s+/);let s,r;return o[0]&&o[0][0]&&(s=o[0][0].toUpperCase(),o[0][1]&&(r=o[0][1].toUpperCase())),o[1]&&o[1][0]&&(r=o[1][0].toUpperCase()),m`
${!(i!=null&&i.picture)&&(s||r)?m` ${n}
-`},Ed=e=>{const{topic:t,styles:i,viewpoint:n,actions:o}=e,s={delete:!0,...o};return m`{const{cell:a}=r;a.style.marginLeft="0"}} ${J(r=>{if(!r)return;const a=r;a.headersHidden=!0,a.hiddenColumns=["guid","author"],a.dataTransform={Comment:(d,u)=>{const{guid:c}=u;if(typeof c!="string")return d;const h=t.comments.get(c);if(!h)return d;const p=()=>{t.comments.delete(c)};return m` +`},Ld=e=>{const{topic:t,styles:i,viewpoint:n,actions:o}=e,s={delete:!0,...o};return m`{const{cell:a}=r;a.style.marginLeft="0"}} ${W(r=>{if(!r)return;const a=r;a.headersHidden=!0,a.hiddenColumns=["guid","author"],a.dataTransform={Comment:(d,u)=>{const{guid:c}=u;if(typeof c!="string")return d;const h=t.comments.get(c);if(!h)return d;const p=()=>{t.comments.delete(c)};return m`
- ${Cd(h.author,i)} + ${Md(h.author,i)} @ ${h.date.toDateString()}
@@ -1825,7 +1837,7 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I
${h.comment}
- `}};let l=t.comments.values();n&&(l=[...t.comments.values()].filter(d=>d.viewpoint===n)),a.data=[...l].map(d=>({data:{guid:d.guid,Comment:d.comment,author:(()=>{const u=i;if(!u)return d.author;const c=u[d.author];return(c==null?void 0:c.name)??d.author})()}}))})}>This topic has no comments`},Ar=(e,t=!0)=>{const i=B.create(Ed,e);if(t){const{topic:n}=e,[o,s]=i;n.comments.onItemSet.add(()=>s()),n.comments.onItemUpdated.add(()=>s()),n.comments.onItemDeleted.add(()=>s()),n.comments.onCleared.add(()=>s())}return i},Ad=Object.freeze(Object.defineProperty({__proto__:null,topicComments:Ar},Symbol.toStringTag,{value:"Module"})),ai={users:{"jhon.doe@example.com":{name:"Jhon Doe"}},priorities:{"On hold":{icon:"flowbite:circle-pause-outline",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#767676"}},Minor:{icon:"mingcute:arrows-down-fill",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#4CAF50"}},Normal:{icon:"fa6-solid:grip-lines",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#FB8C00"}},Major:{icon:"mingcute:arrows-up-fill",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#FF5252"}},Critical:{icon:"ph:warning",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#FB8C00"}}},statuses:{Active:{icon:"prime:circle-fill",style:{backgroundColor:"#2E2E2E"}},"In Progress":{icon:"prime:circle-fill",style:{backgroundColor:"#fa89004d","--bim-label--c":"#FB8C00","--bim-icon--c":"#FB8C00"}},"In Review":{icon:"prime:circle-fill",style:{backgroundColor:"#9c6bff4d","--bim-label--c":"#9D6BFF","--bim-icon--c":"#9D6BFF"}},Done:{icon:"prime:circle-fill",style:{backgroundColor:"#4CAF504D","--bim-label--c":"#4CAF50","--bim-icon--c":"#4CAF50"}},Closed:{icon:"prime:circle-fill",style:{backgroundColor:"#2E2E2E","--bim-label--c":"#727272","--bim-icon--c":"#727272"}}},types:{Clash:{icon:"gg:close-r",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#FB8C00"}},Issue:{icon:"mdi:bug-outline",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#FF5252"}},Failure:{icon:"mdi:bug-outline",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#FF5252"}},Inquiry:{icon:"majesticons:comment-line",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#FF5252"}},Fault:{icon:"ph:warning",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#FF5252"}},Remark:{icon:"ph:note-blank-bold",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#FB8C00"}},Request:{icon:"mynaui:edit-one",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#9D6BFF"}}}},Ji={padding:"0.25rem 0.5rem",borderRadius:"999px","--bim-label--c":"white"},Qi=(e,t)=>{const i=((t==null?void 0:t.users)??ai.users)[e],n=(i==null?void 0:i.name)??e,o=n.trim().split(/\s+/);let s,r;return o[0]&&o[0][0]&&(s=o[0][0].toUpperCase(),o[0][1]&&(r=o[0][1].toUpperCase())),o[1]&&o[1][0]&&(r=o[1][0].toUpperCase()),m` + `}};let l=t.comments.values();n&&(l=[...t.comments.values()].filter(d=>d.viewpoint===n)),a.data=[...l].map(d=>({data:{guid:d.guid,Comment:d.comment,author:(()=>{const u=i;if(!u)return d.author;const c=u[d.author];return(c==null?void 0:c.name)??d.author})()}}))})}>This topic has no comments`},Rr=(e,t=!0)=>{const i=V.create(Ld,e);if(t){const{topic:n}=e,[o,s]=i;n.comments.onItemSet.add(()=>s()),n.comments.onItemUpdated.add(()=>s()),n.comments.onItemDeleted.add(()=>s()),n.comments.onCleared.add(()=>s())}return i},Rd=Object.freeze(Object.defineProperty({__proto__:null,topicComments:Rr},Symbol.toStringTag,{value:"Module"})),di={users:{"jhon.doe@example.com":{name:"Jhon Doe"}},priorities:{"On hold":{icon:"flowbite:circle-pause-outline",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#767676"}},Minor:{icon:"mingcute:arrows-down-fill",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#4CAF50"}},Normal:{icon:"fa6-solid:grip-lines",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#FB8C00"}},Major:{icon:"mingcute:arrows-up-fill",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#FF5252"}},Critical:{icon:"ph:warning",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#FB8C00"}}},statuses:{Active:{icon:"prime:circle-fill",style:{backgroundColor:"#2E2E2E"}},"In Progress":{icon:"prime:circle-fill",style:{backgroundColor:"#fa89004d","--bim-label--c":"#FB8C00","--bim-icon--c":"#FB8C00"}},"In Review":{icon:"prime:circle-fill",style:{backgroundColor:"#9c6bff4d","--bim-label--c":"#9D6BFF","--bim-icon--c":"#9D6BFF"}},Done:{icon:"prime:circle-fill",style:{backgroundColor:"#4CAF504D","--bim-label--c":"#4CAF50","--bim-icon--c":"#4CAF50"}},Closed:{icon:"prime:circle-fill",style:{backgroundColor:"#2E2E2E","--bim-label--c":"#727272","--bim-icon--c":"#727272"}}},types:{Clash:{icon:"gg:close-r",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#FB8C00"}},Issue:{icon:"mdi:bug-outline",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#FF5252"}},Failure:{icon:"mdi:bug-outline",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#FF5252"}},Inquiry:{icon:"majesticons:comment-line",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#FF5252"}},Fault:{icon:"ph:warning",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#FF5252"}},Remark:{icon:"ph:note-blank-bold",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#FB8C00"}},Request:{icon:"mynaui:edit-one",style:{backgroundColor:"var(--bim-ui_bg-contrast-20)","--bim-icon--c":"#9D6BFF"}}}},en={padding:"0.25rem 0.5rem",borderRadius:"999px","--bim-label--c":"white"},nn=(e,t)=>{const i=((t==null?void 0:t.users)??di.users)[e],n=(i==null?void 0:i.name)??e,o=n.trim().split(/\s+/);let s,r;return o[0]&&o[0][0]&&(s=o[0][0].toUpperCase(),o[0][1]&&(r=o[0][1].toUpperCase())),o[1]&&o[1][0]&&(r=o[1][0].toUpperCase()),m`
${!(i!=null&&i.picture)&&(s||r)?m` ${n}
-`},[xi,Sd]=B.create(e=>{const{topic:t}=e,i=document.createElement("bim-text-input");i.type="area";const n=()=>{i.value="",xi.close(),xi.remove()};return m` +`},[Ci,Dd]=V.create(e=>{const{topic:t}=e,i=document.createElement("bim-text-input");i.type="area";const n=()=>{i.value="",Ci.close(),Ci.remove()};return m` ${t?m` @@ -1860,7 +1872,7 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I `:m`No topic refereced`} - `},{}),[wi,kd]=B.create(e=>{const{components:t,topic:i}=e;let n;t&&(n=Mn({components:t,actions:{delete:!1,updateCamera:!1,colorizeComponent:!1,resetColors:!1,selectComponents:!1}})[0],n.selectableRows=!0);const o=()=>{wi.close(),wi.remove(),n==null||n.remove()};return m` + `},{}),[Ai,jd]=V.create(e=>{const{components:t,topic:i}=e;let n;t&&(n=Fn({components:t,actions:{delete:!1,updateCamera:!1,colorizeComponent:!1,resetColors:!1,selectComponents:!1}})[0],n.selectableRows=!0);const o=()=>{Ai.close(),Ai.remove(),n==null||n.remove()};return m` ${i?m` @@ -1887,7 +1899,7 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I `:m`No topic refereced`} - `},{}),[$i,Od]=B.create(e=>{const{components:t,topic:i}=e;let n;if(t){const s=[...t.get(Re).list.values()].filter(r=>r!==i);n=Er({components:t,topics:s})[0],n.selectableRows=!0,n.hiddenColumns=["Guid","Author","Assignee","Date","DueDate"]}const o=()=>{$i.close(),$i.remove(),n==null||n.remove()};return m` + `},{}),[Ei,zd]=V.create(e=>{const{components:t,topic:i}=e;let n;if(t){const s=[...t.get(Be).list.values()].filter(r=>r!==i);n=Lr({components:t,topics:s})[0],n.selectableRows=!0,n.hiddenColumns=["Guid","Author","Assignee","Date","DueDate"]}const o=()=>{Ei.close(),Ei.remove(),n==null||n.remove()};return m` @@ -1912,7 +1924,7 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I - `},{}),Td=e=>{const{components:t,topic:i,styles:n,onUpdateInformation:o,actions:s,world:r}=e,a={update:!0,addComments:!0,linkViewpoints:!0,addViewpoints:!0,linkTopics:!0,...s},l=(n==null?void 0:n.priorities)??ai.priorities,d=(n==null?void 0:n.statuses)??ai.statuses,u=(n==null?void 0:n.types)??ai.types;let c;i!=null&&i.priority&&(c=l[i.priority]);let h;i!=null&&i.type&&(h=u[i.type]);let p;i!=null&&i.type&&(p=d[i.status]);let g,_,v;i&&(g=Ar({topic:i,styles:n==null?void 0:n.users})[0],_=Mn({components:t,topic:i})[0]);const f=()=>{if(!(i&&r))return;const E=t.get(fn).create(r);i.viewpoints.add(E.guid)},y=()=>{Sd({topic:i}),document.body.append(xi),xi.showModal()},x=()=>{kd({components:t,topic:i}),document.body.append(wi),wi.showModal()},w=()=>{Od({components:t,topic:i}),document.body.append($i),$i.showModal()};return m` + `},{}),Fd=e=>{const{components:t,topic:i,styles:n,onUpdateInformation:o,actions:s,world:r}=e,a={update:!0,addComments:!0,linkViewpoints:!0,addViewpoints:!0,linkTopics:!0,...s},l=(n==null?void 0:n.priorities)??di.priorities,d=(n==null?void 0:n.statuses)??di.statuses,u=(n==null?void 0:n.types)??di.types;let c;i!=null&&i.priority&&(c=l[i.priority]);let h;i!=null&&i.type&&(h=u[i.type]);let p;i!=null&&i.type&&(p=d[i.status]);let b,v,y;i&&(b=Rr({topic:i,styles:n==null?void 0:n.users})[0],v=Fn({components:t,topic:i})[0]);const g=()=>{if(!(i&&r))return;const A=t.get($n).create(r);i.viewpoints.add(A.guid)},_=()=>{Dd({topic:i}),document.body.append(Ci),Ci.showModal()},x=()=>{jd({components:t,topic:i}),document.body.append(Ai),Ai.showModal()},w=()=>{zd({components:t,topic:i}),document.body.append(Ei),Ei.showModal()};return m` ${i?m` @@ -1926,31 +1938,31 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I
Status - ${i.status}
Type - ${i.type}
${i.priority?m`
Priority - ${i.priority}
`:null}
Author - ${Qi(i.creationAuthor,n)} + ${nn(i.creationAuthor,n)}
${i.assignedTo?m`
Assignee - ${Qi(i.assignedTo,n)} + ${nn(i.assignedTo,n)}
`:null} ${i.dueDate?m`
@@ -1960,7 +1972,7 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I ${i.modifiedAuthor?m`
Modified By - ${Qi(i.modifiedAuthor,n)} + ${nn(i.modifiedAuthor,n)}
`:null} ${i.modifiedDate?m`
@@ -1977,70 +1989,80 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I `:null} - ${g} + ${b} ${a.addComments?m` - + `:null} - ${_} + ${v} ${a.linkViewpoints||a.addViewpoints?m`
- ${a.addViewpoints?m` `:null} + ${a.addViewpoints?m` `:null} ${a.linkViewpoints?m``:null}
`:null}
`:m`No topic selected!`} - `},Id=(e,t=!0)=>{const i=B.create(Td,e);if(t){const{components:n}=e,[o,s]=i;n.get(Re).list.onItemUpdated.add(({value:r})=>{const{topic:a}=s(),{guid:l}=r;l===(a==null?void 0:a.guid)&&s()})}return i},Nd=Object.freeze(Object.defineProperty({__proto__:null,topicData:Id},Symbol.toStringTag,{value:"Module"}));({...Nd});const Pd=e=>{const{components:t,actions:i,tags:n}=e,o=(i==null?void 0:i.dispose)??!0,s=(i==null?void 0:i.download)??!0,r=(i==null?void 0:i.visibility)??!0,a=(n==null?void 0:n.schema)??!0,l=(n==null?void 0:n.viewDefinition)??!0,d=t.get(Ht),u=document.createElement("bim-table");u.addEventListener("cellcreated",({detail:h})=>{const{cell:p}=h;p.style.padding="0.25rem 0"}),u.hiddenColumns=["modelID"],u.headersHidden=!0;const c=[];for(const[,h]of d.groups){if(!h)continue;const p={data:{Name:h.name||h.uuid,modelID:h.uuid}};c.push(p)}return u.dataTransform={Name:(h,p)=>{const{modelID:g}=p;if(typeof g!="string")return h;const _=d.groups.get(g);if(!_)return g;const v={};for(const A of _.items)v[A.id]=A.ids;let f;const{schema:y}=_.ifcMetadata;a&&y&&(f=m` - ${y} - `);let x;if(l&&"viewDefinition"in _.ifcMetadata){const A=_.ifcMetadata.viewDefinition;x=m` - ${A.split(",").map(N=>m`${N}`)} - `}let w;o&&(w=m`d.disposeGroup(_)} icon="mdi:delete">`);let E;r&&(E=m`{const N=t.get(Uo),$=A.target;N.set($.hasAttribute("data-model-hidden"),v),$.toggleAttribute("data-model-hidden"),$.icon=$.hasAttribute("data-model-hidden")?"mdi:eye-off":"mdi:eye"}} icon="mdi:eye">`);let C;return s&&(C=m`{const A=document.createElement("input");A.type="file",A.accept=".ifc",A.multiple=!1,A.addEventListener("change",async()=>{if(!(A.files&&A.files.length===1))return;const N=A.files[0],$=await N.arrayBuffer(),S=await t.get(Yr).saveToIfc(_,new Uint8Array($)),k=new File([S],N.name),U=document.createElement("a");U.href=URL.createObjectURL(k),U.download=k.name,U.click(),URL.revokeObjectURL(U.href)}),A.click()}} icon="flowbite:download-solid">`),m` -
-
-
- ${h} + `},Hd=(e,t=!0)=>{const i=V.create(Fd,e);if(t){const{components:n}=e,[o,s]=i;n.get(Be).list.onItemUpdated.add(({value:r})=>{const{topic:a}=s(),{guid:l}=r;l===(a==null?void 0:a.guid)&&s()})}return i},Bd=Object.freeze(Object.defineProperty({__proto__:null,topicData:Hd},Symbol.toStringTag,{value:"Module"}));({...Bd});const Ud=e=>{const{components:t,actions:i,tags:n}=e,o=(i==null?void 0:i.dispose)??!0,s=(i==null?void 0:i.download)??!0,r=(i==null?void 0:i.visibility)??!0,a=(n==null?void 0:n.schema)??!0,l=(n==null?void 0:n.viewDefinition)??!0,d=t.get(Bt),u=({detail:c})=>{const{cell:h}=c;h.style.padding="0.25rem 0"};return m` + {if(!c)return;const h=c;h.hiddenColumns=["modelID"];const p=[];for(const[,b]of d.groups){if(!b)continue;const v={data:{Name:b.name||b.uuid,modelID:b.uuid}};p.push(v)}h.dataTransform={Name:(b,v)=>{const{modelID:y}=v;if(typeof y!="string")return b;const g=d.groups.get(y);if(!g)return y;const _={};for(const k of g.items)_[k.id]=k.ids;let x;const{schema:w}=g.ifcMetadata;a&&w&&(x=m` + ${w} + `);let A;if(l&&"viewDefinition"in g.ifcMetadata){const k=g.ifcMetadata.viewDefinition;A=m` + ${k.split(",").map(S=>m`${S}`)} + `}let C;o&&(C=m`d.disposeGroup(g)} icon="mdi:delete">`);let N;r&&(N=m`{const S=t.get(ts),B=k.target;S.set(B.hasAttribute("data-model-hidden"),_),B.toggleAttribute("data-model-hidden"),B.icon=B.hasAttribute("data-model-hidden")?"mdi:eye-off":"mdi:eye"}} icon="mdi:eye">`);let L;return s&&(L=m`{const k=document.createElement("input");k.type="file",k.accept=".ifc",k.multiple=!1,k.addEventListener("change",async()=>{if(!(k.files&&k.files.length===1))return;const S=k.files[0],B=await S.arrayBuffer(),E=await t.get(ia).saveToIfc(g,new Uint8Array(B)),M=new File([E],S.name),$=document.createElement("a");$.href=URL.createObjectURL(M),$.download=M.name,$.click(),URL.revokeObjectURL($.href)}),k.click()}} icon="flowbite:download-solid">`),m` +
+
+
+ ${b} +
+
+ ${x} + ${A} +
-
- ${f} - ${x} +
+ ${L} + ${N} + ${C}
-
-
- ${C} - ${E} - ${w} -
-
- `}},u.data=c,m` -
- ${c.length===0?m`No models has been loaded yet`:u} -
- `},Md=(e,t=!0)=>{const i=B.create(Pd,e);if(t){const{components:n}=e,o=n.get(Ht),[,s]=i;o.onFragmentsLoaded.add(()=>setTimeout(()=>s())),o.onFragmentsDisposed.add(()=>s())}return i},Ld=Object.freeze(Object.defineProperty({__proto__:null,modelsList:Md},Symbol.toStringTag,{value:"Module"})),Sr=["Name","ContainedInStructure","ForLayerSet","LayerThickness","HasProperties","HasAssociations","HasAssignments","HasPropertySets","PredefinedType","Quantities","ReferencedSource","Identification",e=>e.includes("Value"),e=>e.startsWith("Material"),e=>e.startsWith("Relating"),e=>{const t=["IsGroupedBy","IsDecomposedBy"];return e.startsWith("Is")&&!t.includes(e)}];async function li(e,t,i,n=Sr,o=!1){const s=e.get(at),r=await t.getProperties(i);if(!r)return{data:{Entity:`${i} properties not found...`}};const a=s.relationMaps[t.uuid],l={data:{}};for(const d in r){const u=n.map(h=>typeof h=="string"?d===h:h(d)).includes(!0);if(!(d==="type"||u))continue;const c=r[d];if(c)if(c.type===5){l.children||(l.children=[]);const h=await li(e,t,c.value,n,o);l.children.push(h)}else if(typeof c=="object"&&!Array.isArray(c)){const{value:h,type:p}=c;if(o)p===1||p===2||p===3||(l.data[d]=h);else{const g=typeof h=="number"?Number(h.toFixed(3)):h;l.data[d]=g}}else if(Array.isArray(c))for(const h of c){if(h.type!==5)continue;l.children||(l.children=[]);const p=await li(e,t,h.value,n,o);l.children.push(p)}else if(d==="type"){const h=di[c];l.data.Entity=h}else l.data[d]=c}if(a&&a.get(r.expressID)){const d=a.get(r.expressID);for(const u of n){const c=[];if(typeof u=="string"){const h=s._inverseAttributes.indexOf(u);h!==-1&&c.push(h)}else{const h=s._inverseAttributes.filter(p=>u(p));for(const p of h){const g=s._inverseAttributes.indexOf(p);c.push(g)}}for(const h of c){const p=d.get(h);if(p)for(const g of p){const _=await li(e,t,g,n,o);l.children||(l.children=[]),l.children.push(_)}}}}return l}const jd=e=>{const{components:t,fragmentIdMap:i,attributesToInclude:n,editable:o,tableDefinition:s}=e,r=t.get(Ht);let a;return typeof n=="function"?a=n(Sr):a=n,m`{if(!l)return;const d=l,u=[],c=[];for(const h in i){const p=r.list.get(h);if(!(p&&p.group))continue;const g=p.group,_=c.find(v=>v.model===g);if(_)for(const v of i[h])_.expressIDs.add(v);else{const v={model:g,expressIDs:new Set(i[h])};c.push(v)}}for(const h of c){const{model:p,expressIDs:g}=h;for(const _ of g){const v=await li(t,p,_,a,o);u.push(v)}}d.dataTransform=s,d.data=u,d.columns=[{name:"Entity",width:"minmax(15rem, 1fr)"}]})}>`},Dd=e=>B.create(jd,e),Rd=Object.freeze(Object.defineProperty({__proto__:null,entityAttributes:Dd},Symbol.toStringTag,{value:"Module"}));let yt;const zd=e=>{const{components:t,classifications:i}=e,n=t.get(Gr),o=t.get(Uo);yt||(yt=document.createElement("bim-table"),yt.headersHidden=!0,yt.hiddenColumns=["system"],yt.columns=["Name",{name:"Actions",width:"auto"}],yt.dataTransform={Actions:(r,a)=>{const{system:l,Name:d}=a;if(!(typeof l=="string"&&typeof d=="string"))return r;const u=n.list[l];if(!(u&&u[d]))return r;const c=u[d],{map:h}=c;return m` +
+ `}},h.data=p})} @cellcreated=${u} headers-hidden no-indentation> + + No models has been loaded yet + + + `},Vd=(e,t=!0)=>{const i=V.create(Ud,e);if(t){const{components:n}=e,o=n.get(Bt),[,s]=i;o.onFragmentsLoaded.add(()=>setTimeout(()=>s())),o.onFragmentsDisposed.add(()=>s())}return i},Wd=Object.freeze(Object.defineProperty({__proto__:null,modelsList:Vd},Symbol.toStringTag,{value:"Module"})),Dr=["Name","ContainedInStructure","ForLayerSet","LayerThickness","HasProperties","HasAssociations","HasAssignments","HasPropertySets","PredefinedType","Quantities","ReferencedSource","Identification",e=>e.includes("Value"),e=>e.startsWith("Material"),e=>e.startsWith("Relating"),e=>{const t=["IsGroupedBy","IsDecomposedBy"];return e.startsWith("Is")&&!t.includes(e)}];async function ui(e,t,i,n=Dr,o=!1){const s=e.get(ct),r=await t.getProperties(i);if(!r)return{data:{Entity:`${i} properties not found...`}};const a=s.relationMaps[t.uuid],l={data:{}};for(const d in r){const u=n.map(h=>typeof h=="string"?d===h:h(d)).includes(!0);if(!(d==="type"||u))continue;const c=r[d];if(c)if(c.type===5){l.children||(l.children=[]);const h=await ui(e,t,c.value,n,o);l.children.push(h)}else if(typeof c=="object"&&!Array.isArray(c)){const{value:h,type:p}=c;if(o)p===1||p===2||p===3||(l.data[d]=h);else{const b=typeof h=="number"?Number(h.toFixed(3)):h;l.data[d]=b}}else if(Array.isArray(c))for(const h of c){if(h.type!==5)continue;l.children||(l.children=[]);const p=await ui(e,t,h.value,n,o);l.children.push(p)}else if(d==="type"){const h=pi[c];l.data.Entity=h}else l.data[d]=c}if(a&&a.get(r.expressID)){const d=a.get(r.expressID);for(const u of n){const c=[];if(typeof u=="string"){const h=s._inverseAttributes.indexOf(u);h!==-1&&c.push(h)}else{const h=s._inverseAttributes.filter(p=>u(p));for(const p of h){const b=s._inverseAttributes.indexOf(p);c.push(b)}}for(const h of c){const p=d.get(h);if(p)for(const b of p){const v=await ui(e,t,b,n,o);l.children||(l.children=[]),l.children.push(v)}}}}return l}const Gd=e=>{const{components:t,fragmentIdMap:i,attributesToInclude:n,editable:o,tableDefinition:s}=e,r=t.get(Bt);let a;return typeof n=="function"?a=n(Dr):a=n,m`{if(!l)return;const d=l,u=[],c=[];for(const h in i){const p=r.list.get(h);if(!(p&&p.group))continue;const b=p.group,v=c.find(y=>y.model===b);if(v)for(const y of i[h])v.expressIDs.add(y);else{const y={model:b,expressIDs:new Set(i[h])};c.push(y)}}for(const h of c){const{model:p,expressIDs:b}=h;for(const v of b){const y=await ui(t,p,v,a,o);u.push(y)}}d.dataTransform=s,d.data=u,d.columns=[{name:"Entity",width:"minmax(15rem, 1fr)"}]})}>`},qd=e=>V.create(Gd,e),Yd=Object.freeze(Object.defineProperty({__proto__:null,entityAttributes:qd},Symbol.toStringTag,{value:"Module"}));let yt;const Xd=e=>{const{components:t,classifications:i}=e,n=t.get(na),o=t.get(ts);yt||(yt=document.createElement("bim-table"),yt.headersHidden=!0,yt.hiddenColumns=["system"],yt.columns=["Name",{name:"Actions",width:"auto"}],yt.dataTransform={Actions:(r,a)=>{const{system:l,Name:d}=a;if(!(typeof l=="string"&&typeof d=="string"))return r;const u=n.list[l];if(!(u&&u[d]))return r;const c=u[d],{map:h}=c;return m`
- {const g=p.target;o.set(g.value,h)}}> + {const b=p.target;o.set(b.value,h)}}>
- `}});const s=[];for(const r of i){const a=typeof r=="string"?r:r.system,l=typeof r=="string"?r:r.label,d=n.list[a];d&&s.push({data:{Name:l,system:a},children:Object.keys(d).map(u=>({data:{Name:u,system:a,Actions:""}}))})}return yt.data=s,m`${yt}`},Fd=(e,t=!0)=>{const i=B.create(zd,e);if(t){const{components:n}=e,o=n.get(Ht),[,s]=i;o.onFragmentsDisposed.add(()=>s())}return i},Hd=Object.freeze(Object.defineProperty({__proto__:null,classificationTree:Fd},Symbol.toStringTag,{value:"Module"})),kr=async(e,t,i)=>{var n,o,s,r;const a=e.get(at),l={data:{Name:(n=i.Name)==null?void 0:n.value},children:[{data:{Name:"Identification",Value:(o=i.Identification)==null?void 0:o.value}},{data:{Name:"Name",Value:(s=i.Name)==null?void 0:s.value}},{data:{Name:"Description",Value:(r=i.Description)==null?void 0:r.value}}]},d=a.getEntityRelations(t,i.expressID,"IsNestedBy");if(!d)return l;l.children||(l.children=[]);const u=[];l.children.push({data:{Name:"Tasks"},children:u});for(const c of d){const h=await t.getProperties(c);if(!h)continue;const p=await kr(e,t,h);u.push(p)}return l},Bd=async(e,t,i)=>{const n=[];for(const o of i){const s=await kr(e,t,o);n.push(s)}return{data:{Name:"Tasks"},children:n}},Ud=async(e,t)=>{var i,n;const o={data:{Name:"Classifications"}};for(const s of t){const{value:r}=s.ReferencedSource,a=await e.getProperties(r);if(!a)continue;const l={data:{Name:a.Name.value},children:[{data:{Name:"Identification",Value:((i=s.Identification)==null?void 0:i.value)||((n=s.ItemReference)==null?void 0:n.value)}},{data:{Name:"Name",Value:s.Name.value}}]};o.children||(o.children=[]),o.children.push(l)}return o},Vd=async(e,t)=>{const i={data:{Name:"Materials"}};for(const n of t){if(n.type===Go){const o=n.ForLayerSet.value,s=await e.getProperties(o);if(!s)continue;for(const r of s.MaterialLayers){const{value:a}=r,l=await e.getProperties(a);if(!l)continue;const d=await e.getProperties(l.Material.value);if(!d)continue;const u={data:{Name:"Layer"},children:[{data:{Name:"Thickness",Value:l.LayerThickness.value}},{data:{Name:"Material",Value:d.Name.value}}]};i.children||(i.children=[]),i.children.push(u)}}if(n.type===Yo)for(const o of n.Materials){const{value:s}=o,r=await e.getProperties(s);if(!r)continue;const a={data:{Name:"Name",Value:r.Name.value}};i.children||(i.children=[]),i.children.push(a)}if(n.type===qo){const o={data:{Name:"Name",Value:n.Name.value}};i.children||(i.children=[]),i.children.push(o)}}return i},Wd=async(e,t)=>{const i={data:{Name:"PropertySets"}};for(const n of t){const o={data:{Name:n.Name.value}};if(n.type===Vo){for(const s of n.HasProperties){const{value:r}=s,a=await e.getProperties(r);if(!a)continue;const l=Object.keys(a).find(u=>u.includes("Value"));if(!(l&&a[l]))continue;const d={data:{Name:a.Name.value,Value:a[l].value}};o.children||(o.children=[]),o.children.push(d)}o.children&&(i.children||(i.children=[]),i.children.push(o))}}return i},Gd=async(e,t)=>{const i={data:{Name:"QuantitySets"}};for(const n of t){const o={data:{Name:n.Name.value}};if(n.type===Wo){for(const s of n.Quantities){const{value:r}=s,a=await e.getProperties(r);if(!a)continue;const l=Object.keys(a).find(u=>u.includes("Value"));if(!(l&&a[l]))continue;const d={data:{Name:a.Name.value,Value:a[l].value}};o.children||(o.children=[]),o.children.push(d)}o.children&&(i.children||(i.children=[]),i.children.push(o))}}return i},qd=["OwnerHistory","ObjectPlacement","CompositionType"],Or=async(e,t)=>{const i={groupName:"Attributes",includeClass:!1,...t},{groupName:n,includeClass:o}=i,s={data:{Name:n}};o&&(s.children||(s.children=[]),s.children.push({data:{Name:"Class",Value:di[e.type]}}));for(const r in e){if(qd.includes(r))continue;const a=e[r];if(a&&typeof a=="object"&&!Array.isArray(a)){if(a.type===sa)continue;const l={data:{Name:r,Value:a.value}};s.children||(s.children=[]),s.children.push(l)}}return s},ne=(e,...t)=>{e.children||(e.children=[]),e.children.push(...t)},Yd=async(e,t,i,n)=>{const o=e.get(at).getEntityRelations(t,i,"IsDefinedBy");if(o){const s=[],r=[];for(const l of o){const d=await t.getProperties(l);d&&(d.type===Vo&&s.push(d),d.type===Wo&&r.push(d))}const a=await Wd(t,s);a.children&&ne(n,a),(await Gd(t,r)).children&&ne(n,a)}},Xd=async(e,t,i,n)=>{const o=e.get(at).getEntityRelations(t,i,"HasAssociations");if(o){const s=[],r=[];for(const d of o){const u=await t.getProperties(d);u&&(u.type===ra&&s.push(u),(u.type===Go||u.type===aa||u.type===la||u.type===qo||u.type===Yo)&&r.push(u))}const a=await Ud(t,s);a.children&&ne(n,a);const l=await Vd(t,r);l.children&&ne(n,l)}},Jd=async(e,t,i,n)=>{const o=e.get(at).getEntityRelations(t,i,"HasAssignments");if(o){const s=[];for(const a of o){const l=await t.getProperties(a);l&&l.type===ca&&s.push(l)}const r=await Bd(e,t,s);r.children&&ne(n,r)}},Qd=async(e,t,i,n)=>{const o=e.get(at).getEntityRelations(t,i,"ContainedInStructure");if(o&&o[0]){const s=o[0],r=await t.getProperties(s);if(r){const a=await Or(r,{groupName:"SpatialContainer"});ne(n,a)}}};let ni={};const Zd=async(e,t)=>{var i;const n=e.get(at),o=e.get(Ht),s=o.getModelIdMap(t);Object.keys(t).length===0&&(ni={});const r=[];for(const a in s){const l=o.groups.get(a);if(!l)continue;const d=n.relationMaps[l.uuid];if(!d)continue;a in ni||(ni[a]=new Map);const u=ni[a],c=s[a];for(const h of c){let p=u.get(h);if(p){r.push(p);continue}const g=await l.getProperties(h);if(!g)continue;p={data:{Name:(i=g.Name)==null?void 0:i.value}},r.push(p),u.set(h,p);const _=await Or(g,{includeClass:!0});p.children||(p.children=[]),p.children.push(_),d.get(h)&&(await Yd(e,l,h,p),await Xd(e,l,h,p),await Jd(e,l,h,p),await Qd(e,l,h,p))}}return r},Kd=new Event("datacomputed");let dt;const tu=e=>{const t={emptySelectionWarning:!0,...e},{components:i,fragmentIdMap:n,emptySelectionWarning:o}=t;if(!dt&&(dt=document.createElement("bim-table"),dt.columns=[{name:"Name",width:"12rem"}],dt.headersHidden=!0,dt.addEventListener("cellcreated",({detail:s})=>{const{cell:r}=s;r.column==="Name"&&!("Value"in r.rowData)&&(r.style.gridColumn="1 / -1")}),o)){const s=document.createElement("bim-label");s.style.setProperty("--bim-icon--c","gold"),s.slot="missing-data",s.icon="ic:round-warning",s.textContent="Select some elements to display its properties",dt.append(s)}return Zd(i,n).then(s=>{dt.data=s,s.length!==0&&dt.dispatchEvent(Kd)}),m`${dt}`},eu=e=>B.create(tu,e),iu=Object.freeze(Object.defineProperty({__proto__:null,elementProperties:eu},Symbol.toStringTag,{value:"Module"})),bn=async(e,t,i,n)=>{var o;const s=[],r=e.get(at),a=await t.getProperties(i);if(!a)return s;const{type:l}=a,d={data:{Entity:di[l],Name:(o=a.Name)==null?void 0:o.value,modelID:t.uuid,expressID:i}};for(const u of n){const c=r.getEntityRelations(t,i,u);if(!c)continue;d.children||(d.children=[]),d.data.relations=JSON.stringify(c);const h={};for(const p of c){const g=await bn(e,t,p,n);for(const _ of g)if(_.data.relations)d.children.push(_);else{const v=t.data.get(p);if(!v){d.children.push(_);continue}const f=v[1][1],y=di[f];y in h||(h[y]=[]),_.data.Entity=_.data.Name,delete _.data.Name,h[y].push(_)}}for(const p in h){const g=h[p],_=g.map(f=>f.data.expressID),v={data:{Entity:p,modelID:t.uuid,relations:JSON.stringify(_)},children:g};d.children.push(v)}}return s.push(d),s},nu=async(e,t,i,n)=>{const o=e.get(at),s=[];for(const r of t){let a;if(n)a={data:{Entity:r.name!==""?r.name:r.uuid},children:await bn(e,r,n,i)};else{const l=o.relationMaps[r.uuid],d=await r.getAllPropertiesOfType(oa);if(!(l&&d))continue;const{expressID:u}=Object.values(d)[0];a={data:{Entity:r.name!==""?r.name:r.uuid},children:await bn(e,r,u,i)}}s.push(a)}return s};let ut;const ou=(e,t)=>{const i=e.get(Ht),{modelID:n,expressID:o,relations:s}=t.data;if(!n)return null;const r=i.groups.get(n);return r?r.getFragmentMap([o,...JSON.parse(s??"[]")]):null},su=e=>{const{components:t,models:i,expressID:n}=e,o=e.selectHighlighterName??"select",s=e.hoverHighlighterName??"hover";ut||(ut=document.createElement("bim-table"),ut.hiddenColumns=["modelID","expressID","relations"],ut.columns=["Entity","Name"],ut.headersHidden=!0,ut.addEventListener("cellcreated",({detail:a})=>{const{cell:l}=a;l.column==="Entity"&&!("Name"in l.rowData)&&(l.style.gridColumn="1 / -1")})),ut.addEventListener("rowcreated",a=>{a.stopImmediatePropagation();const{row:l}=a.detail,d=t.get(ua),u=ou(t,l);u&&Object.keys(u).length!==0&&(l.onmouseover=()=>{s&&(l.style.backgroundColor="var(--bim-ui_bg-contrast-20)",d.highlightByID(s,u,!0,!1,d.selection[o]??{}))},l.onmouseout=()=>{l.style.backgroundColor="",d.clear(s)},l.onclick=()=>{o&&d.highlightByID(o,u,!0,!0)})});const r=e.inverseAttributes??["IsDecomposedBy","ContainsElements"];return nu(t,i,r,n).then(a=>ut.data=a),m`${ut}`},ru=(e,t=!0)=>{const i=B.create(su,e);if(t){const[,n]=i,{components:o}=e,s=o.get(Ht),r=o.get(at),a=()=>n({models:s.groups.values()});r.onRelationsIndexed.add(a),s.onFragmentsDisposed.add(a)}return i},au=Object.freeze(Object.defineProperty({__proto__:null,relationsTree:ru},Symbol.toStringTag,{value:"Module"})),xe=(e,t)=>[...e.get(Xr).list.values()].find(i=>i.world===t),lu=(e,t)=>m` - {const n=i.target;e.color=new ze(n.color)}} color=${t}> - `,cu=(e,t)=>{const{postproduction:i}=e,n=i.n8ao.configuration;return m` - {const s=o.target;n.color=new ze(s.color)}} color=${t}> - `},du=(e,t)=>{const{color:i,opacity:n}=JSON.parse(t),{postproduction:o}=e,{customEffects:s}=o;return m` - {const{color:a,opacity:l}=r.target;s.lineColor=new ze(a).getHex(),l&&(s.opacity=l/100)}} color=${i} opacity=${n*100}> - `},uu=(e,t)=>m` - {const n=i.target,o=new ze(n.color);e.material.uniforms.uColor.value=o}} color=${t}> - `,hu=(e,t)=>{const{postproduction:i}=e;return m` + `}});const s=[];for(const r of i){const a=typeof r=="string"?r:r.system,l=typeof r=="string"?r:r.label,d=n.list[a];d&&s.push({data:{Name:l,system:a},children:Object.keys(d).map(u=>({data:{Name:u,system:a,Actions:""}}))})}return yt.data=s,m`${yt}`},Jd=(e,t=!0)=>{const i=V.create(Xd,e);if(t){const{components:n}=e,o=n.get(Bt),[,s]=i;o.onFragmentsDisposed.add(()=>s())}return i},Qd=Object.freeze(Object.defineProperty({__proto__:null,classificationTree:Jd},Symbol.toStringTag,{value:"Module"})),jr=async(e,t,i)=>{var n,o,s,r;const a=e.get(ct),l={data:{Name:(n=i.Name)==null?void 0:n.value},children:[{data:{Name:"Identification",Value:(o=i.Identification)==null?void 0:o.value}},{data:{Name:"Name",Value:(s=i.Name)==null?void 0:s.value}},{data:{Name:"Description",Value:(r=i.Description)==null?void 0:r.value}}]},d=a.getEntityRelations(t,i.expressID,"IsNestedBy");if(!d)return l;l.children||(l.children=[]);const u=[];l.children.push({data:{Name:"Tasks"},children:u});for(const c of d){const h=await t.getProperties(c);if(!h)continue;const p=await jr(e,t,h);u.push(p)}return l},Kd=async(e,t,i)=>{const n=[];for(const o of i){const s=await jr(e,t,o);n.push(s)}return{data:{Name:"Tasks"},children:n}},Zd=async(e,t)=>{var i,n;const o={data:{Name:"Classifications"}};for(const s of t){const{value:r}=s.ReferencedSource,a=await e.getProperties(r);if(!a)continue;const l={data:{Name:a.Name.value},children:[{data:{Name:"Identification",Value:((i=s.Identification)==null?void 0:i.value)||((n=s.ItemReference)==null?void 0:n.value)}},{data:{Name:"Name",Value:s.Name.value}}]};o.children||(o.children=[]),o.children.push(l)}return o},tu=async(e,t)=>{const i={data:{Name:"Materials"}};for(const n of t){if(n.type===ns){const o=n.ForLayerSet.value,s=await e.getProperties(o);if(!s)continue;for(const r of s.MaterialLayers){const{value:a}=r,l=await e.getProperties(a);if(!l)continue;const d=await e.getProperties(l.Material.value);if(!d)continue;const u={data:{Name:"Layer"},children:[{data:{Name:"Thickness",Value:l.LayerThickness.value}},{data:{Name:"Material",Value:d.Name.value}}]};i.children||(i.children=[]),i.children.push(u)}}if(n.type===ss)for(const o of n.Materials){const{value:s}=o,r=await e.getProperties(s);if(!r)continue;const a={data:{Name:"Name",Value:r.Name.value}};i.children||(i.children=[]),i.children.push(a)}if(n.type===os){const o={data:{Name:"Name",Value:n.Name.value}};i.children||(i.children=[]),i.children.push(o)}}return i},eu={IFCLENGTHMEASURE:"LENGTHUNIT",IFCAREAMEASURE:"AREAUNIT",IFCVOLUMEMEASURE:"VOLUMEUNIT",IFCPLANEANGLEMEASURE:"PLANEANGLEUNIT"},iu={MILLIMETRE:{symbol:"mm",digits:0},METRE:{symbol:"m",digits:2},KILOMETRE:{symbol:"km",digits:2},SQUARE_METRE:{symbol:"m²",digits:2},CUBIC_METRE:{symbol:"m³",digits:2},DEGREE:{symbol:"°",digits:2},RADIAN:{symbol:"rad",digits:2},GRAM:{symbol:"g",digits:0},KILOGRAM:{symbol:"kg",digits:2},MILLISECOND:{symbol:"ms",digits:0},SECOND:{symbol:"s",digits:0}},zr=async(e,t)=>{var i,n,o;const s=Object.values(await e.getAllPropertiesOfType(ya))[0];let r;for(const a of s.Units){const l=await e.getProperties(a.value);if(l&&((i=l.UnitType)==null?void 0:i.value)===eu[t]){r=`${((n=l.Prefix)==null?void 0:n.value)??""}${((o=l.Name)==null?void 0:o.value)??""}`;break}}return r?iu[r]:null},nu=async(e,t,i)=>{const{displayUnits:n}=i,o={data:{Name:"PropertySets"}};for(const s of t){const r={data:{Name:s.Name.value}};if(s.type===es){for(const a of s.HasProperties){const{value:l}=a,d=await e.getProperties(l);if(!d)continue;const u=Object.keys(d).find(b=>b.includes("Value"));if(!(u&&d[u]))continue;let c=d[u].value,h="";if(n){const{name:b}=d[u],v=await zr(e,b)??{};h=v.symbol,c=d[u].value,typeof c=="number"&&v.digits&&(c=c.toFixed(v.digits))}const p={data:{Name:d.Name.value,Value:`${c} ${h??""}`}};r.children||(r.children=[]),r.children.push(p)}r.children&&(o.children||(o.children=[]),o.children.push(r))}}return o},ou=async(e,t,i)=>{const{displayUnits:n}=i,o={data:{Name:"QuantitySets"}};for(const s of t){const r={data:{Name:s.Name.value}};if(s.type===is){for(const a of s.Quantities){const{value:l}=a,d=await e.getProperties(l);if(!d)continue;const u=Object.keys(d).find(b=>b.includes("Value"));if(!(u&&d[u]))continue;let c=d[u].value,h="";if(n){const{name:b}=d[u],v=await zr(e,b)??{};h=v.symbol,c=d[u].value,typeof c=="number"&&v.digits&&(c=c.toFixed(v.digits))}const p={data:{Name:d.Name.value,Value:`${c} ${h??""}`}};r.children||(r.children=[]),r.children.push(p)}r.children&&(o.children||(o.children=[]),o.children.push(r))}}return o},su=["OwnerHistory","ObjectPlacement","CompositionType"],Fr=async(e,t)=>{const i={groupName:"Attributes",includeClass:!1,...t},{groupName:n,includeClass:o}=i,s={data:{Name:n}};o&&(s.children||(s.children=[]),s.children.push({data:{Name:"Class",Value:pi[e.type]}}));for(const r in e){if(su.includes(r))continue;const a=e[r];if(a&&typeof a=="object"&&!Array.isArray(a)){if(a.type===ma)continue;const l={data:{Name:r,Value:a.value}};s.children||(s.children=[]),s.children.push(l)}}return s},ne=(e,...t)=>{e.children||(e.children=[]),e.children.push(...t)},ru=async(e,t,i,n,o)=>{const s=e.get(ct).getEntityRelations(t,i,"IsDefinedBy");if(s){const r=[],a=[];for(const u of s){const c=await t.getProperties(u);c&&(c.type===es&&r.push(c),c.type===is&&a.push(c))}const l=await nu(t,r,o);l.children&&ne(n,l);const d=await ou(t,a,o);d.children&&ne(n,d)}},au=async(e,t,i,n)=>{const o=e.get(ct).getEntityRelations(t,i,"HasAssociations");if(o){const s=[],r=[];for(const d of o){const u=await t.getProperties(d);u&&(u.type===ba&&s.push(u),(u.type===ns||u.type===fa||u.type===ga||u.type===os||u.type===ss)&&r.push(u))}const a=await Zd(t,s);a.children&&ne(n,a);const l=await tu(t,r);l.children&&ne(n,l)}},lu=async(e,t,i,n)=>{const o=e.get(ct).getEntityRelations(t,i,"HasAssignments");if(o){const s=[];for(const a of o){const l=await t.getProperties(a);l&&l.type===va&&s.push(l)}const r=await Kd(e,t,s);r.children&&ne(n,r)}},cu=async(e,t,i,n)=>{const o=e.get(ct).getEntityRelations(t,i,"ContainedInStructure");if(o&&o[0]){const s=o[0],r=await t.getProperties(s);if(r){const a=await Fr(r,{groupName:"SpatialContainer"});ne(n,a)}}};let ri={};const du=async(e,t,i)=>{var n;const o=e.get(ct),s=e.get(Bt),r=s.getModelIdMap(t);Object.keys(t).length===0&&(ri={});const a=[];for(const l in r){const d=s.groups.get(l);if(!d)continue;const u=o.relationMaps[d.uuid];if(!u)continue;l in ri||(ri[l]=new Map);const c=ri[l],h=r[l];for(const p of h){let b=c.get(p);if(b){a.push(b);continue}const v=await d.getProperties(p);if(!v)continue;b={data:{Name:(n=v.Name)==null?void 0:n.value}},a.push(b),c.set(p,b);const y=await Fr(v,{includeClass:!0});b.children||(b.children=[]),b.children.push(y),u.get(p)&&(await ru(e,d,p,b,i),await au(e,d,p,b),await lu(e,d,p,b),await cu(e,d,p,b))}}return a},uu=e=>{const t={emptySelectionWarning:!0,...e},{components:i,fragmentIdMap:n,emptySelectionWarning:o}=t;return m` + {const{cell:r}=s;r.column==="Name"&&!("Value"in r.rowData)&&(r.style.gridColumn="1 / -1")}} ${W(async s=>{if(!s)return;const r=s;r.columns=[{name:"Name",width:"12rem"}],r.headersHidden=!0,r.loadFunction=()=>du(i,n,e),await r.loadData(!0)&&r.dispatchEvent(new Event("datacomputed"))})}> + ${o?m` + + Select some elements to display its properties + + `:null} + + `},hu=e=>V.create(uu,e),pu=Object.freeze(Object.defineProperty({__proto__:null,elementProperties:hu},Symbol.toStringTag,{value:"Module"})),xn=async(e,t,i,n)=>{var o;const s=[],r=e.get(ct),a=await t.getProperties(i);if(!a)return s;const{type:l}=a,d={data:{Entity:pi[l],Name:(o=a.Name)==null?void 0:o.value,modelID:t.uuid,expressID:i}};for(const u of n){const c=r.getEntityRelations(t,i,u);if(!c)continue;d.children||(d.children=[]),d.data.relations=JSON.stringify(c);const h={};for(const p of c){const b=await xn(e,t,p,n);for(const v of b)if(v.data.relations)d.children.push(v);else{const y=t.data.get(p);if(!y){d.children.push(v);continue}const g=y[1][1],_=pi[g];_ in h||(h[_]=[]),v.data.Entity=v.data.Name,delete v.data.Name,h[_].push(v)}}for(const p in h){const b=h[p],v=b.map(g=>g.data.expressID),y={data:{Entity:p,modelID:t.uuid,relations:JSON.stringify(v)},children:b};d.children.push(y)}}return s.push(d),s},mu=async(e,t,i,n)=>{const o=e.get(ct),s=[];for(const r of t){let a;if(n)a={data:{Entity:r.name!==""?r.name:r.uuid},children:await xn(e,r,n,i)};else{const l=o.relationMaps[r.uuid],d=await r.getAllPropertiesOfType(pa);if(!(l&&d))continue;const{expressID:u}=Object.values(d)[0];a={data:{Entity:r.name!==""?r.name:r.uuid},children:await xn(e,r,u,i)}}s.push(a)}return s};let ut;const bu=(e,t)=>{const i=e.get(Bt),{modelID:n,expressID:o,relations:s}=t.data;if(!n)return null;const r=i.groups.get(n);return r?r.getFragmentMap([o,...JSON.parse(s??"[]")]):null},fu=e=>{const{components:t,models:i,expressID:n}=e,o=e.selectHighlighterName??"select",s=e.hoverHighlighterName??"hover";ut||(ut=document.createElement("bim-table"),ut.hiddenColumns=["modelID","expressID","relations"],ut.columns=["Entity","Name"],ut.headersHidden=!0,ut.addEventListener("cellcreated",({detail:a})=>{const{cell:l}=a;l.column==="Entity"&&!("Name"in l.rowData)&&(l.style.gridColumn="1 / -1")})),ut.addEventListener("rowcreated",a=>{a.stopImmediatePropagation();const{row:l}=a.detail,d=t.get(xa),u=bu(t,l);u&&Object.keys(u).length!==0&&(l.onmouseover=()=>{s&&(l.style.backgroundColor="var(--bim-ui_bg-contrast-20)",d.highlightByID(s,u,!0,!1,d.selection[o]??{}))},l.onmouseout=()=>{l.style.backgroundColor="",d.clear(s)},l.onclick=()=>{o&&d.highlightByID(o,u,!0,!0)})});const r=e.inverseAttributes??["IsDecomposedBy","ContainsElements"];return mu(t,i,r,n).then(a=>ut.data=a),m`${ut}`},gu=(e,t=!0)=>{const i=V.create(fu,e);if(t){const[,n]=i,{components:o}=e,s=o.get(Bt),r=o.get(ct),a=()=>n({models:s.groups.values()});r.onRelationsIndexed.add(a),s.onFragmentsDisposed.add(a)}return i},vu=Object.freeze(Object.defineProperty({__proto__:null,relationsTree:gu},Symbol.toStringTag,{value:"Module"})),$e=(e,t)=>[...e.get(Zo).list.values()].find(i=>i.world===t),yu=(e,t)=>m` + {const n=i.target;e.color=new ae(n.color)}} color=${t}> + `,_u=(e,t)=>{const{postproduction:i}=e,n=i.n8ao.configuration;return m` + {const s=o.target;n.color=new ae(s.color)}} color=${t}> + `},xu=(e,t)=>{const{color:i,opacity:n}=JSON.parse(t),{postproduction:o}=e,{customEffects:s}=o;return m` + {const{color:a,opacity:l}=r.target;s.lineColor=new ae(a).getHex(),l&&(s.opacity=l/100)}} color=${i} opacity=${n*100}> + `},wu=(e,t)=>m` + {const n=i.target,o=new ae(n.color);e.material.uniforms.uColor.value=o}} color=${t}> + `,$u=(e,t)=>{const{postproduction:i}=e;return m` {const o=n.target;i.setPasses({ao:o.checked})}} .checked=${t}> - `},pu=(e,t)=>{const{postproduction:i}=e;return m` + `},Cu=(e,t)=>{const{postproduction:i}=e;return m` {const o=n.target;i.setPasses({gamma:o.checked})}} .checked=${t}> - `},mu=(e,t)=>{const{postproduction:i}=e;return m` + `},Au=(e,t)=>{const{postproduction:i}=e;return m` {const o=n.target;i.setPasses({custom:o.checked})}} .checked=${t}> `},_t=(e,t,i,n=()=>{})=>m` @@ -2055,53 +2077,71 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I step=${l} @change="${h=>{const p=h.target.value;e[t]=p,c(p)}}" > - `},bu=e=>{const{components:t}=e,i=t.get(gn);return m`{var o,s,r,a,l;if(!n)return;const d=n;d.preserveStructureOnFilter=!0,d.dataTransform={Value:(c,h)=>{const p=h.World,g=i.list.get(p);if(!g)return c;const{scene:_,camera:v,renderer:f}=g,y=h.Name;if(y==="Grid"&&h.IsGridConfig&&typeof c=="boolean"){const x=xe(t,g);return x?_t(x,"visible",c):c}if(y==="Color"&&h.IsGridConfig&&typeof c=="string"){const x=xe(t,g);return x?uu(x,c):c}if(y==="Distance"&&h.IsGridConfig&&typeof c=="number"){const x=xe(t,g);return x?P(x.material.uniforms.uDistance,"value",c,{slider:!0,min:300,max:1e3}):c}if(y==="Size"&&h.IsGridConfig&&typeof c=="string"){const x=xe(t,g);if(!x)return c;const{x:w,y:E}=JSON.parse(c),C=P(x.material.uniforms.uSize1,"value",w,{slider:!0,suffix:"m",prefix:"A",min:1,max:20}),A=P(x.material.uniforms.uSize2,"value",E,{slider:!0,suffix:"m",prefix:"B",min:1,max:20});return m` -
${C}${A}
- `}if(y==="Near Frustum"&&v.three instanceof ti&&typeof c=="number"){const x=v.three;return P(v.three,"near",c,{slider:!0,min:.1,max:10,step:.1,onInputSet:()=>x.updateProjectionMatrix()})}if(y==="Far Frustum"&&v.three instanceof ti&&typeof c=="number"){const x=v.three;return P(v.three,"far",c,{slider:!0,min:300,max:2e3,step:10,onInputSet:()=>x.updateProjectionMatrix()})}if(y==="Field of View"&&v.three instanceof ti&&typeof c=="number"){const x=v.three;return P(v.three,"fov",c,{slider:!0,min:10,max:120,onInputSet:()=>x.updateProjectionMatrix()})}if(y==="Invert Drag"&&v.hasCameraControls()&&typeof c=="boolean")return _t(v.controls,"dollyDragInverted",c);if(y==="Dolly Speed"&&v.hasCameraControls()&&typeof c=="number")return P(v.controls,"dollySpeed",c,{slider:!0,min:.5,max:3,step:.1});if(y==="Truck Speed"&&v.hasCameraControls()&&typeof c=="number")return P(v.controls,"truckSpeed",c,{slider:!0,min:.5,max:6,step:.1});if(y==="Smooth Time"&&v.hasCameraControls()&&typeof c=="number")return P(v.controls,"smoothTime",c,{slider:!0,min:.01,max:2,step:.01});if(y==="Intensity"&&typeof c=="number"){if(h.Light&&typeof h.Light=="string"){const x=_.three.children.find(w=>w.uuid===h.Light);return x&&x instanceof ye?P(x,"intensity",c,{slider:!0,min:0,max:10,step:.1}):c}if(h.IsAOConfig&&f instanceof L)return P(f.postproduction.n8ao.configuration,"intensity",c,{slider:!0,max:16,step:.1})}if(y==="Color"&&typeof c=="string"){const x=h.Light,w=_.three.children.find(E=>E.uuid===x);if(w&&w instanceof ye)return lu(w,c);if(h.IsAOConfig&&f instanceof L)return cu(f,c)}if(y==="Ambient Oclussion"&&typeof c=="boolean"&&h.IsAOConfig&&f instanceof L)return hu(f,c);if(y==="Half Resolution"&&h.IsAOConfig&&f instanceof L&&typeof c=="boolean")return _t(f.postproduction.n8ao.configuration,"halfRes",c);if(y==="Screen Space Radius"&&h.IsAOConfig&&f instanceof L&&typeof c=="boolean")return _t(f.postproduction.n8ao.configuration,"screenSpaceRadius",c);if(y==="Radius"&&h.IsAOConfig&&f instanceof L&&typeof c=="number")return P(f.postproduction.n8ao.configuration,"aoRadius",c,{slider:!0,max:2,step:.1});if(y==="Denoise Samples"&&h.IsAOConfig&&f instanceof L&&typeof c=="number")return P(f.postproduction.n8ao.configuration,"denoiseSamples",c,{slider:!0,min:1,max:16});if(y==="Samples"&&h.IsAOConfig&&f instanceof L&&typeof c=="number")return P(f.postproduction.n8ao.configuration,"aoSamples",c,{slider:!0,min:1,max:16});if(y==="Denoise Radius"&&h.IsAOConfig&&f instanceof L&&typeof c=="number")return P(f.postproduction.n8ao.configuration,"denoiseRadius",c,{slider:!0,min:0,max:16,step:.1});if(y==="Distance Falloff"&&h.IsAOConfig&&f instanceof L&&typeof c=="number")return P(f.postproduction.n8ao.configuration,"distanceFalloff",c,{slider:!0,min:0,max:4,step:.1});if(y==="Directional Light"&&h.Light&&typeof h.Light=="string"&&typeof c=="boolean"){const x=_.three.children.find(w=>w.uuid===h.Light);return x&&x instanceof ye?_t(x,"visible",c):c}if(y==="Ambient Light"&&h.Light&&typeof h.Light=="string"&&typeof c=="boolean"){const x=_.three.children.find(w=>w.uuid===h.Light);return x&&x instanceof ye?_t(x,"visible",c):c}if(y==="Position"&&h.Light&&typeof h.Light=="string"&&typeof c=="string"){const x=_.three.children.find(S=>S.uuid===h.Light);if(!(x&&x instanceof ye))return c;const{x:w,y:E,z:C}=JSON.parse(c),A=P(x.position,"x",w,{slider:!0,prefix:"X",suffix:"m",min:-50,max:50}),N=P(x.position,"y",E,{slider:!0,prefix:"Y",suffix:"m",min:-50,max:50}),$=P(x.position,"z",C,{slider:!0,prefix:"Z",suffix:"m",min:-50,max:50});return m` -
${A}${N}${$}
- `}return y==="Custom Effects"&&h.IsCEConfig&&f instanceof L&&typeof c=="boolean"?mu(f,c):y==="Color"&&h.IsOutlineConfig&&f instanceof L&&typeof c=="string"?du(f,c):y==="Tolerance"&&h.IsOutlineConfig&&f instanceof L&&typeof c=="number"?P(f.postproduction.customEffects,"tolerance",c,{slider:!0,min:0,max:6,step:.01}):y==="Outline"&&h.IsOutlineConfig&&f instanceof L&&typeof c=="boolean"?_t(f.postproduction.customEffects,"outlineEnabled",c):y==="Gloss"&&h.IsGlossConfig&&f instanceof L&&typeof c=="boolean"?_t(f.postproduction.customEffects,"glossEnabled",c):y==="Min"&&h.IsGlossConfig&&f instanceof L&&typeof c=="number"?P(f.postproduction.customEffects,"minGloss",c,{slider:!0,min:-.5,max:.5,step:.01}):y==="Max"&&h.IsGlossConfig&&f instanceof L&&typeof c=="number"?P(f.postproduction.customEffects,"maxGloss",c,{slider:!0,min:-.5,max:.5,step:.01}):y==="Exponent"&&h.IsGlossConfig&&f instanceof L&&typeof c=="number"?P(f.postproduction.customEffects,"glossExponent",c,{slider:!0,min:0,max:5,step:.01}):y==="Gamma Correction"&&h.IsGammaConfig&&f instanceof L&&typeof c=="boolean"?pu(f,c):c}},d.addEventListener("cellcreated",({detail:c})=>{const h=c.cell.parentNode;if(!h)return;const p=h.querySelector("bim-table-cell[column='Name']"),g=h.querySelector("bim-table-cell[column='Value']");p&&!g&&(p.style.gridColumn="1 / -1")});const u=[];for(const[,c]of i.list){const{scene:h,camera:p,renderer:g}=c,_=xe(t,c),v={data:{Name:c instanceof qr&&c.name||c.uuid},children:[]};if(h){const f={data:{Name:"Scene"}};if(_){const w={data:{Name:"Grid",Value:_.three.visible,World:c.uuid,IsGridConfig:!0},children:[{data:{Name:"Color",get Value(){return`#${_.material.uniforms.uColor.value.getHexString()}`},World:c.uuid,IsGridConfig:!0}},{data:{Name:"Size",get Value(){const E=_.material.uniforms.uSize1.value,C=_.material.uniforms.uSize2.value;return JSON.stringify({x:E,y:C})},World:c.uuid,IsGridConfig:!0}},{data:{Name:"Distance",Value:_.material.uniforms.uDistance.value,World:c.uuid,IsGridConfig:!0}}]};f.children||(f.children=[]),f.children.push(w)}const y=h.three.children.filter(w=>w instanceof ta);for(const w of y){const E={data:{Name:"Directional Light",Value:w.visible,World:c.uuid,Light:w.uuid},children:[{data:{Name:"Position",Value:JSON.stringify(w.position),World:c.uuid,Light:w.uuid}},{data:{Name:"Intensity",Value:w.intensity,World:c.uuid,Light:w.uuid}},{data:{Name:"Color",Value:`#${w.color.getHexString()}`,World:c.uuid,Light:w.uuid}}]};f.children||(f.children=[]),f.children.push(E)}const x=h.three.children.filter(w=>w instanceof ea);for(const w of x){const E={data:{Name:"Ambient Light",Value:w.visible,World:c.uuid,Light:w.uuid},children:[{data:{Name:"Intensity",Value:w.intensity,World:c.uuid,Light:w.uuid}},{data:{Name:"Color",Value:`#${w.color.getHexString()}`,World:c.uuid,Light:w.uuid}}]};f.children||(f.children=[]),f.children.push(E)}f.children&&((o=f.children)==null?void 0:o.length)>0&&((s=v.children)==null||s.push(f))}if(p.three instanceof ti){const f={data:{Name:"Perspective Camera"},children:[{data:{Name:"Near Frustum",Value:p.three.near,World:c.uuid}},{data:{Name:"Far Frustum",Value:p.three.far,World:c.uuid}},{data:{Name:"Field of View",Value:p.three.fov,World:c.uuid}}]};if(p.hasCameraControls()){const{controls:y}=p,x={dollyDragInverted:"Invert Drag",dollySpeed:"Dolly Speed",truckSpeed:"Truck Speed",smoothTime:"Smooth Time"};for(const w in x){const E=y[w];E!=null&&((r=f.children)==null||r.push({data:{Name:x[w],Value:E,World:c.uuid}}))}}(a=v.children)==null||a.push(f)}if(g instanceof L){const{postproduction:f}=g,y=f.n8ao.configuration,x={data:{Name:"Renderer"},children:[{data:{Name:"Gamma Correction",Value:f.settings.gamma??!1,World:c.uuid,IsGammaConfig:!0}},{data:{Name:"Ambient Oclussion",Value:f.settings.ao??!1,World:c.uuid,IsAOConfig:!0},children:[{data:{Name:"Samples",Value:y.aoSamples,World:c.uuid,IsAOConfig:!0}},{data:{Name:"Color",Value:`#${y.color.getHexString()}`,World:c.uuid,IsAOConfig:!0}},{data:{Name:"Half Resolution",Value:y.halfRes,World:c.uuid,IsAOConfig:!0}},{data:{Name:"Screen Space Radius",Value:y.screenSpaceRadius,World:c.uuid,IsAOConfig:!0}},{data:{Name:"Radius",Value:y.aoRadius,World:c.uuid,IsAOConfig:!0}},{data:{Name:"Intensity",Value:y.intensity,World:c.uuid,IsAOConfig:!0}},{data:{Name:"Distance Falloff",Value:y.distanceFalloff,World:c.uuid,IsAOConfig:!0}},{data:{Name:"Denoise Samples",Value:y.denoiseSamples,World:c.uuid,IsAOConfig:!0}},{data:{Name:"Denoise Radius",Value:y.denoiseRadius,World:c.uuid,IsAOConfig:!0}}]},{data:{Name:"Custom Effects",Value:f.settings.custom??!1,World:c.uuid,IsCEConfig:!0},children:[{data:{Name:"Gloss",Value:f.customEffects.glossEnabled,World:c.uuid,IsGlossConfig:!0},children:[{data:{Name:"Min",Value:f.customEffects.minGloss,World:c.uuid,IsGlossConfig:!0}},{data:{Name:"Max",Value:f.customEffects.maxGloss,World:c.uuid,IsGlossConfig:!0}},{data:{Name:"Exponent",Value:f.customEffects.glossExponent,World:c.uuid,IsGlossConfig:!0}}]},{data:{Name:"Outline",Value:f.customEffects.outlineEnabled,World:c.uuid,IsOutlineConfig:!0},children:[{data:{Name:"Color",get Value(){const w=new ze(f.customEffects.lineColor),E=f.customEffects.opacity;return JSON.stringify({color:`#${w.getHexString()}`,opacity:E})},World:c.uuid,IsOutlineConfig:!0}},{data:{Name:"Tolerance",Value:f.customEffects.tolerance,World:c.uuid,IsOutlineConfig:!0}}]}]}]};(l=v.children)==null||l.push(x)}u.push(v)}d.columns=[{name:"Name",width:"11rem"}],d.hiddenColumns=["World","Light","IsAOConfig","IsCEConfig","IsGlossConfig","IsOutlineConfig","IsGammaConfig","IsGridConfig"],d.data=u})} headers-hidden expanded>
`},fu=(e,t=!0)=>{const i=B.create(bu,e);if(t){const[n]=i,o=()=>i[1](),{components:s}=e,r=s.get(gn);r.onDisposed.add(n.remove);for(const[,a]of r.list)a.onDisposed.add(o);n.addEventListener("disconnected",()=>{r.onDisposed.remove(n.remove);for(const[,a]of r.list)a.onDisposed.remove(o)})}return i},gu=Object.freeze(Object.defineProperty({__proto__:null,worldsConfiguration:fu},Symbol.toStringTag,{value:"Module"}));({...Ld,...Rd,...Hd,...iu,...au,...gu,..._d,...Ad,...wd});/** + `},Eu=e=>{const{components:t}=e,i=t.get(Ni);return m` + {const o=n.cell.parentNode;if(!o)return;const s=o.querySelector("bim-table-cell[column='Name']"),r=o.querySelector("bim-table-cell[column='Value']");s&&!r&&(s.style.gridColumn="1 / -1")}} ${W(async n=>{var o,s,r,a,l;if(!n)return;const d=n;d.preserveStructureOnFilter=!0,d.dataTransform={Value:(c,h)=>{const p=h.World,b=i.list.get(p);if(!b)return c;const{scene:v,camera:y,renderer:g}=b,_=h.Name;if(_==="Grid"&&h.IsGridConfig&&typeof c=="boolean"){const x=$e(t,b);return x?_t(x,"visible",c):c}if(_==="Color"&&h.IsGridConfig&&typeof c=="string"){const x=$e(t,b);return x?wu(x,c):c}if(_==="Distance"&&h.IsGridConfig&&typeof c=="number"){const x=$e(t,b);return x?P(x.material.uniforms.uDistance,"value",c,{slider:!0,min:300,max:1e3}):c}if(_==="Size"&&h.IsGridConfig&&typeof c=="string"){const x=$e(t,b);if(!x)return c;const{x:w,y:A}=JSON.parse(c),C=P(x.material.uniforms.uSize1,"value",w,{slider:!0,suffix:"m",prefix:"A",min:1,max:20}),N=P(x.material.uniforms.uSize2,"value",A,{slider:!0,suffix:"m",prefix:"B",min:1,max:20});return m` +
${C}${N}
+ `}if(_==="Near Frustum"&&y.three instanceof ni&&typeof c=="number"){const x=y.three;return P(y.three,"near",c,{slider:!0,min:.1,max:10,step:.1,onInputSet:()=>x.updateProjectionMatrix()})}if(_==="Far Frustum"&&y.three instanceof ni&&typeof c=="number"){const x=y.three;return P(y.three,"far",c,{slider:!0,min:300,max:2e3,step:10,onInputSet:()=>x.updateProjectionMatrix()})}if(_==="Field of View"&&y.three instanceof ni&&typeof c=="number"){const x=y.three;return P(y.three,"fov",c,{slider:!0,min:10,max:120,onInputSet:()=>x.updateProjectionMatrix()})}if(_==="Invert Drag"&&y.hasCameraControls()&&typeof c=="boolean")return _t(y.controls,"dollyDragInverted",c);if(_==="Dolly Speed"&&y.hasCameraControls()&&typeof c=="number")return P(y.controls,"dollySpeed",c,{slider:!0,min:.5,max:3,step:.1});if(_==="Truck Speed"&&y.hasCameraControls()&&typeof c=="number")return P(y.controls,"truckSpeed",c,{slider:!0,min:.5,max:6,step:.1});if(_==="Smooth Time"&&y.hasCameraControls()&&typeof c=="number")return P(y.controls,"smoothTime",c,{slider:!0,min:.01,max:2,step:.01});if(_==="Intensity"&&typeof c=="number"){if(h.Light&&typeof h.Light=="string"){const x=v.three.children.find(w=>w.uuid===h.Light);return x&&x instanceof _e?P(x,"intensity",c,{slider:!0,min:0,max:10,step:.1}):c}if(h.IsAOConfig&&g instanceof R)return P(g.postproduction.n8ao.configuration,"intensity",c,{slider:!0,max:16,step:.1})}if(_==="Color"&&typeof c=="string"){const x=h.Light,w=v.three.children.find(A=>A.uuid===x);if(w&&w instanceof _e)return yu(w,c);if(h.IsAOConfig&&g instanceof R)return _u(g,c)}if(_==="Ambient Oclussion"&&typeof c=="boolean"&&h.IsAOConfig&&g instanceof R)return $u(g,c);if(_==="Half Resolution"&&h.IsAOConfig&&g instanceof R&&typeof c=="boolean")return _t(g.postproduction.n8ao.configuration,"halfRes",c);if(_==="Screen Space Radius"&&h.IsAOConfig&&g instanceof R&&typeof c=="boolean")return _t(g.postproduction.n8ao.configuration,"screenSpaceRadius",c);if(_==="Radius"&&h.IsAOConfig&&g instanceof R&&typeof c=="number")return P(g.postproduction.n8ao.configuration,"aoRadius",c,{slider:!0,max:2,step:.1});if(_==="Denoise Samples"&&h.IsAOConfig&&g instanceof R&&typeof c=="number")return P(g.postproduction.n8ao.configuration,"denoiseSamples",c,{slider:!0,min:1,max:16});if(_==="Samples"&&h.IsAOConfig&&g instanceof R&&typeof c=="number")return P(g.postproduction.n8ao.configuration,"aoSamples",c,{slider:!0,min:1,max:16});if(_==="Denoise Radius"&&h.IsAOConfig&&g instanceof R&&typeof c=="number")return P(g.postproduction.n8ao.configuration,"denoiseRadius",c,{slider:!0,min:0,max:16,step:.1});if(_==="Distance Falloff"&&h.IsAOConfig&&g instanceof R&&typeof c=="number")return P(g.postproduction.n8ao.configuration,"distanceFalloff",c,{slider:!0,min:0,max:4,step:.1});if(_==="Directional Light"&&h.Light&&typeof h.Light=="string"&&typeof c=="boolean"){const x=v.three.children.find(w=>w.uuid===h.Light);return x&&x instanceof _e?_t(x,"visible",c):c}if(_==="Ambient Light"&&h.Light&&typeof h.Light=="string"&&typeof c=="boolean"){const x=v.three.children.find(w=>w.uuid===h.Light);return x&&x instanceof _e?_t(x,"visible",c):c}if(_==="Position"&&h.Light&&typeof h.Light=="string"&&typeof c=="string"){const x=v.three.children.find(S=>S.uuid===h.Light);if(!(x&&x instanceof _e))return c;const{x:w,y:A,z:C}=JSON.parse(c),N=P(x.position,"x",w,{slider:!0,prefix:"X",suffix:"m",min:-50,max:50}),L=P(x.position,"y",A,{slider:!0,prefix:"Y",suffix:"m",min:-50,max:50}),k=P(x.position,"z",C,{slider:!0,prefix:"Z",suffix:"m",min:-50,max:50});return m` +
${N}${L}${k}
+ `}return _==="Custom Effects"&&h.IsCEConfig&&g instanceof R&&typeof c=="boolean"?Au(g,c):_==="Color"&&h.IsOutlineConfig&&g instanceof R&&typeof c=="string"?xu(g,c):_==="Tolerance"&&h.IsOutlineConfig&&g instanceof R&&typeof c=="number"?P(g.postproduction.customEffects,"tolerance",c,{slider:!0,min:0,max:6,step:.01}):_==="Outline"&&h.IsOutlineConfig&&g instanceof R&&typeof c=="boolean"?_t(g.postproduction.customEffects,"outlineEnabled",c):_==="Gloss"&&h.IsGlossConfig&&g instanceof R&&typeof c=="boolean"?_t(g.postproduction.customEffects,"glossEnabled",c):_==="Min"&&h.IsGlossConfig&&g instanceof R&&typeof c=="number"?P(g.postproduction.customEffects,"minGloss",c,{slider:!0,min:-.5,max:.5,step:.01}):_==="Max"&&h.IsGlossConfig&&g instanceof R&&typeof c=="number"?P(g.postproduction.customEffects,"maxGloss",c,{slider:!0,min:-.5,max:.5,step:.01}):_==="Exponent"&&h.IsGlossConfig&&g instanceof R&&typeof c=="number"?P(g.postproduction.customEffects,"glossExponent",c,{slider:!0,min:0,max:5,step:.01}):_==="Gamma Correction"&&h.IsGammaConfig&&g instanceof R&&typeof c=="boolean"?Cu(g,c):c}};const u=[];for(const[,c]of i.list){const{scene:h,camera:p,renderer:b}=c,v=$e(t,c),y={data:{Name:c instanceof oa&&c.name||c.uuid},children:[]};if(h){const g={data:{Name:"Scene"}};if(v){const w=`#${v.material.uniforms.uColor.value.getHexString()}`,A=JSON.stringify({x:v.material.uniforms.uSize1.value,y:v.material.uniforms.uSize2.value}),C={data:{Name:"Grid",Value:v.three.visible,World:c.uuid,IsGridConfig:!0},children:[{data:{Name:"Color",Value:w,World:c.uuid,IsGridConfig:!0}},{data:{Name:"Size",Value:A,World:c.uuid,IsGridConfig:!0}},{data:{Name:"Distance",Value:v.material.uniforms.uDistance.value,World:c.uuid,IsGridConfig:!0}}]};g.children||(g.children=[]),g.children.push(C)}const _=h.three.children.filter(w=>w instanceof ca);for(const w of _){const A={data:{Name:"Directional Light",Value:w.visible,World:c.uuid,Light:w.uuid},children:[{data:{Name:"Position",Value:JSON.stringify(w.position),World:c.uuid,Light:w.uuid}},{data:{Name:"Intensity",Value:w.intensity,World:c.uuid,Light:w.uuid}},{data:{Name:"Color",Value:`#${w.color.getHexString()}`,World:c.uuid,Light:w.uuid}}]};g.children||(g.children=[]),g.children.push(A)}const x=h.three.children.filter(w=>w instanceof da);for(const w of x){const A={data:{Name:"Ambient Light",Value:w.visible,World:c.uuid,Light:w.uuid},children:[{data:{Name:"Intensity",Value:w.intensity,World:c.uuid,Light:w.uuid}},{data:{Name:"Color",Value:`#${w.color.getHexString()}`,World:c.uuid,Light:w.uuid}}]};g.children||(g.children=[]),g.children.push(A)}g.children&&((o=g.children)==null?void 0:o.length)>0&&((s=y.children)==null||s.push(g))}if(p.three instanceof ni){const g={data:{Name:"Perspective Camera"},children:[{data:{Name:"Near Frustum",Value:p.three.near,World:c.uuid}},{data:{Name:"Far Frustum",Value:p.three.far,World:c.uuid}},{data:{Name:"Field of View",Value:p.three.fov,World:c.uuid}}]};if(p.hasCameraControls()){const{controls:_}=p,x={dollyDragInverted:"Invert Drag",dollySpeed:"Dolly Speed",truckSpeed:"Truck Speed",smoothTime:"Smooth Time"};for(const w in x){const A=_[w];A!=null&&((r=g.children)==null||r.push({data:{Name:x[w],Value:A,World:c.uuid}}))}}(a=y.children)==null||a.push(g)}if(b instanceof R){const{postproduction:g}=b,_=g.n8ao.configuration,x={data:{Name:"Renderer"},children:[{data:{Name:"Gamma Correction",Value:g.settings.gamma??!1,World:c.uuid,IsGammaConfig:!0}},{data:{Name:"Ambient Oclussion",Value:g.settings.ao??!1,World:c.uuid,IsAOConfig:!0},children:[{data:{Name:"Samples",Value:_.aoSamples,World:c.uuid,IsAOConfig:!0}},{data:{Name:"Color",Value:`#${_.color.getHexString()}`,World:c.uuid,IsAOConfig:!0}},{data:{Name:"Half Resolution",Value:_.halfRes,World:c.uuid,IsAOConfig:!0}},{data:{Name:"Screen Space Radius",Value:_.screenSpaceRadius,World:c.uuid,IsAOConfig:!0}},{data:{Name:"Radius",Value:_.aoRadius,World:c.uuid,IsAOConfig:!0}},{data:{Name:"Intensity",Value:_.intensity,World:c.uuid,IsAOConfig:!0}},{data:{Name:"Distance Falloff",Value:_.distanceFalloff,World:c.uuid,IsAOConfig:!0}},{data:{Name:"Denoise Samples",Value:_.denoiseSamples,World:c.uuid,IsAOConfig:!0}},{data:{Name:"Denoise Radius",Value:_.denoiseRadius,World:c.uuid,IsAOConfig:!0}}]},{data:{Name:"Custom Effects",Value:g.settings.custom??!1,World:c.uuid,IsCEConfig:!0},children:[{data:{Name:"Gloss",Value:g.customEffects.glossEnabled,World:c.uuid,IsGlossConfig:!0},children:[{data:{Name:"Min",Value:g.customEffects.minGloss,World:c.uuid,IsGlossConfig:!0}},{data:{Name:"Max",Value:g.customEffects.maxGloss,World:c.uuid,IsGlossConfig:!0}},{data:{Name:"Exponent",Value:g.customEffects.glossExponent,World:c.uuid,IsGlossConfig:!0}}]},{data:{Name:"Outline",Value:g.customEffects.outlineEnabled,World:c.uuid,IsOutlineConfig:!0},children:[{data:{Name:"Color",get Value(){const w=new ae(g.customEffects.lineColor),A=g.customEffects.opacity;return JSON.stringify({color:`#${w.getHexString()}`,opacity:A})},World:c.uuid,IsOutlineConfig:!0}},{data:{Name:"Tolerance",Value:g.customEffects.tolerance,World:c.uuid,IsOutlineConfig:!0}}]}]}]};(l=y.children)==null||l.push(x)}u.push(y)}d.columns=[{name:"Name",width:"11rem"}],d.hiddenColumns=["World","Light","IsAOConfig","IsCEConfig","IsGlossConfig","IsOutlineConfig","IsGammaConfig","IsGridConfig"],d.data=u})} headers-hidden expanded> + + No worlds to configure + +
+ `},Su=(e,t=!0)=>{const i=V.create(Eu,e);if(t){const[,n]=i,{components:o}=e;o.get(Ni).list.onItemDeleted.add(()=>n())}return i},ku=Object.freeze(Object.defineProperty({__proto__:null,worldsConfiguration:Su},Symbol.toStringTag,{value:"Module"}));({...Wd,...Yd,...Qd,...pu,...vu,...ku,...Od,...Rd,...Id});/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Si=globalThis,ki=Si.trustedTypes,Do=ki?ki.createPolicy("lit-html",{createHTML:e=>e}):void 0,Hr="$lit$",wt=`lit$${Math.random().toFixed(9).slice(2)}$`,Br="?"+wt,Tu=`<${Br}>`,Ht=document,ze=()=>Ht.createComment(""),Fe=e=>e===null||typeof e!="object"&&typeof e!="function",Hn=Array.isArray,Ou=e=>Hn(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",on=`[ +\f\r]`,Ce=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,jo=/-->/g,zo=/>/g,Pt=RegExp(`>|${on}(?:([^\\s"'>=/]+)(${on}*=${on}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),Fo=/'/g,Ho=/"/g,Ur=/^(?:script|style|textarea|title)$/i,Nu=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),Bn=Nu(1),oe=Symbol.for("lit-noChange"),j=Symbol.for("lit-nothing"),Bo=new WeakMap,Lt=Ht.createTreeWalker(Ht,129);function Vr(e,t){if(!Hn(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Do!==void 0?Do.createHTML(t):t}const Iu=(e,t)=>{const i=e.length-1,n=[];let o,s=t===2?"":t===3?"":"",r=Ce;for(let a=0;a"?(r=o??Ce,c=-1):u[1]===void 0?c=-2:(c=r.lastIndex-u[2].length,d=u[1],r=u[3]===void 0?Pt:u[3]==='"'?Ho:Fo):r===Ho||r===Fo?r=Pt:r===jo||r===zo?r=Ce:(r=Pt,o=void 0);const p=r===Pt&&e[a+1].startsWith("/>")?" ":"";s+=r===Ce?l+Tu:c>=0?(n.push(d),l.slice(0,c)+Hr+l.slice(c)+wt+p):l+wt+(c===-2?a:p)}return[Vr(e,s+(e[i]||"")+(t===2?"":t===3?"":"")),n]};class He{constructor({strings:t,_$litType$:i},n){let o;this.parts=[];let s=0,r=0;const a=t.length-1,l=this.parts,[d,u]=Iu(t,i);if(this.el=He.createElement(d,n),Lt.currentNode=this.el.content,i===2||i===3){const c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(o=Lt.nextNode())!==null&&l.length0){o.textContent=ki?ki.emptyScript:"";for(let p=0;p2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=j}_$AI(t,i=this,n,o){const s=this.strings;let r=!1;if(s===void 0)t=se(this,t,i,0),r=!Fe(t)||t!==this._$AH&&t!==oe,r&&(this._$AH=t);else{const a=t;let l,d;for(t=s[0],l=0;l{const n=(i==null?void 0:i.renderBefore)??t;let o=n._$litPart$;if(o===void 0){const s=(i==null?void 0:i.renderBefore)??null;n._$litPart$=o=new ti(t.insertBefore(ze(),s),s,void 0,i??{})}return o._$AI(e),o};/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const zu=e=>e.strings===void 0;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Fu={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Hu=e=>(...t)=>({_$litDirective$:e,values:t});let Bu=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this.t=e,this._$AM=t,this.i=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const Ci=globalThis,Ei=Ci.trustedTypes,Oo=Ei?Ei.createPolicy("lit-html",{createHTML:e=>e}):void 0,Tr="$lit$",wt=`lit$${Math.random().toFixed(9).slice(2)}$`,Ir="?"+wt,vu=`<${Ir}>`,Ft=document,Le=()=>Ft.createComment(""),je=e=>e===null||typeof e!="object"&&typeof e!="function",Ln=Array.isArray,yu=e=>Ln(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",Zi=`[ -\f\r]`,we=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,To=/-->/g,Io=/>/g,Pt=RegExp(`>|${Zi}(?:([^\\s"'>=/]+)(${Zi}*=${Zi}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),No=/'/g,Po=/"/g,Nr=/^(?:script|style|textarea|title)$/i,_u=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),Pr=_u(1),oe=Symbol.for("lit-noChange"),z=Symbol.for("lit-nothing"),Mo=new WeakMap,Lt=Ft.createTreeWalker(Ft,129);function Mr(e,t){if(!Ln(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Oo!==void 0?Oo.createHTML(t):t}const xu=(e,t)=>{const i=e.length-1,n=[];let o,s=t===2?"":t===3?"":"",r=we;for(let a=0;a"?(r=o??we,c=-1):u[1]===void 0?c=-2:(c=r.lastIndex-u[2].length,d=u[1],r=u[3]===void 0?Pt:u[3]==='"'?Po:No):r===Po||r===No?r=Pt:r===To||r===Io?r=we:(r=Pt,o=void 0);const p=r===Pt&&e[a+1].startsWith("/>")?" ":"";s+=r===we?l+vu:c>=0?(n.push(d),l.slice(0,c)+Tr+l.slice(c)+wt+p):l+wt+(c===-2?a:p)}return[Mr(e,s+(e[i]||"")+(t===2?"":t===3?"":"")),n]};class De{constructor({strings:t,_$litType$:i},n){let o;this.parts=[];let s=0,r=0;const a=t.length-1,l=this.parts,[d,u]=xu(t,i);if(this.el=De.createElement(d,n),Lt.currentNode=this.el.content,i===2||i===3){const c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(o=Lt.nextNode())!==null&&l.length0){o.textContent=Ei?Ei.emptyScript:"";for(let p=0;p2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=z}_$AI(t,i=this,n,o){const s=this.strings;let r=!1;if(s===void 0)t=se(this,t,i,0),r=!je(t)||t!==this._$AH&&t!==oe,r&&(this._$AH=t);else{const a=t;let l,d;for(t=s[0],l=0;l{const n=(i==null?void 0:i.renderBefore)??t;let o=n._$litPart$;if(o===void 0){const s=(i==null?void 0:i.renderBefore)??null;n._$litPart$=o=new Qe(t.insertBefore(Le(),s),s,void 0,i??{})}return o._$AI(e),o};/** + */const Oe=(e,t)=>{var i;const n=e._$AN;if(n===void 0)return!1;for(const o of n)(i=o._$AO)==null||i.call(o,t,!1),Oe(o,t);return!0},Ti=e=>{let t,i;do{if((t=e._$AM)===void 0)break;i=t._$AN,i.delete(e),e=t}while((i==null?void 0:i.size)===0)},Wr=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(i===void 0)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),Wu(t)}};function Uu(e){this._$AN!==void 0?(Ti(this),this._$AM=e,Wr(this)):this._$AM=e}function Vu(e,t=!1,i=0){const n=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(t)if(Array.isArray(n))for(let s=i;s{e.type==Fu.CHILD&&(e._$AP??(e._$AP=Vu),e._$AQ??(e._$AQ=Uu))};class Gu extends Bu{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,i,n){super._$AT(t,i,n),Wr(this),this.isConnected=t._$AU}_$AO(t,i=!0){var n,o;t!==this.isConnected&&(this.isConnected=t,t?(n=this.reconnected)==null||n.call(this):(o=this.disconnected)==null||o.call(this)),i&&(Oe(this,t),Ti(this))}setValue(t){if(zu(this.t))this.t._$AI(t,this);else{const i=[...this.t._$AH];i[this.i]=t,this.t._$AI(i,this,0)}}disconnected(){}reconnected(){}}/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const ku=()=>new Ou;class Ou{}const Tu=e=>{const{components:t,topic:i,onCancel:n,onSubmit:o,styles:s}=e,r=o??(()=>{}),a=t.get(Re),l=(i==null?void 0:i.title)??null,d=(i==null?void 0:i.status)??null,u=(i==null?void 0:i.type)??null,c=(i==null?void 0:i.priority)??null,h=(i==null?void 0:i.assignedTo)??null,p=(i==null?void 0:i.labels)??null,g=(i==null?void 0:i.stage)??null,_=(i==null?void 0:i.description)??null,v=i!=null&&i.dueDate?i.dueDate.toISOString().split("T")[0]:null,f=new Set([...a.config.statuses]);d&&f.add(d);const y=new Set([...a.config.types]);u&&y.add(u);const x=new Set([...a.config.priorities]);c&&x.add(c);const w=new Set([...a.config.users]);h&&w.add(h);const E=new Set([...a.config.labels]);if(p)for(const $ of p)E.add($);const C=new Set([...a.config.stages]);g&&C.add(g);const A=ku(),N=async()=>{const{value:$}=A;if(!$)return;Object.values($.valueTransform).length===0&&($.valueTransform={dueDate:k=>{if(typeof k=="string"&&k.trim()!=="")return new Date(k)},status:k=>{if(Array.isArray(k)&&k.length!==0)return k[0]},type:k=>{if(Array.isArray(k)&&k.length!==0)return k[0]},priority:k=>{if(Array.isArray(k)&&k.length!==0)return k[0]},assignedTo:k=>{if(Array.isArray(k)&&k.length!==0)return k[0]}});const S=$.value;if(i)i.set(S),await r(i);else{const k=a.create(S);await r(k)}};return m` + */const wn=()=>new qu;class qu{}const sn=new WeakMap,Yu=Hu(class extends Gu{render(e){return j}update(e,[t]){var i;const n=t!==this.Y;return n&&this.Y!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.Y=t,this.ht=(i=e.options)==null?void 0:i.host,this.rt(this.ct=e.element)),j}rt(e){if(this.isConnected||(e=void 0),typeof this.Y=="function"){const t=this.ht??globalThis;let i=sn.get(t);i===void 0&&(i=new WeakMap,sn.set(t,i)),i.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),i.set(this.Y,e),e!==void 0&&this.Y.call(this.ht,e)}else this.Y.value=e}get lt(){var e,t;return typeof this.Y=="function"?(e=sn.get(this.ht??globalThis))==null?void 0:e.get(this.Y):(t=this.Y)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),Xu=e=>{const{components:t,topic:i,value:n,onCancel:o,onSubmit:s,styles:r}=e,a=s??(()=>{}),l=t.get(Be),d=(n==null?void 0:n.title)??(i==null?void 0:i.title)??vt.default.title,u=(n==null?void 0:n.status)??(i==null?void 0:i.status)??vt.default.status,c=(n==null?void 0:n.type)??(i==null?void 0:i.type)??vt.default.type,h=(n==null?void 0:n.priority)??(i==null?void 0:i.priority)??vt.default.priority,p=(n==null?void 0:n.assignedTo)??(i==null?void 0:i.assignedTo)??vt.default.assignedTo,b=(n==null?void 0:n.labels)??(i==null?void 0:i.labels)??vt.default.labels,v=(n==null?void 0:n.stage)??(i==null?void 0:i.stage)??vt.default.stage,y=(n==null?void 0:n.description)??(i==null?void 0:i.description)??vt.default.description,g=i!=null&&i.dueDate?i.dueDate.toISOString().split("T")[0]:null,_=new Set([...l.config.statuses]);u&&_.add(u);const x=new Set([...l.config.types]);c&&x.add(c);const w=new Set([...l.config.priorities]);h&&w.add(h);const A=new Set([...l.config.users]);p&&A.add(p);const C=new Set([...l.config.labels]);if(b)for(const E of b)C.add(E);const N=new Set([...l.config.stages]);v&&N.add(v);const L=wn(),k=async()=>{const{value:E}=L;if(!E)return;Object.values(E.valueTransform).length===0&&(E.valueTransform={dueDate:$=>{if(typeof $=="string"&&$.trim()!=="")return new Date($)},status:$=>{if(Array.isArray($)&&$.length!==0)return $[0]},type:$=>{if(Array.isArray($)&&$.length!==0)return $[0]},priority:$=>{if(Array.isArray($)&&$.length!==0)return $[0]},assignedTo:$=>{if(Array.isArray($)&&$.length!==0)return $[0]}});const M=E.value;if(i)i.set(M),await a(i);else{const $=l.create(M);await a($)}},S=wn(),B=E=>{const{value:M}=S;if(!M)return;const $=E.target;M.disabled=$.value.trim()===""};return m` - +
- + ${i?m` - ${[...f].map($=>m``)} + ${[..._].map(E=>m``)} `:m``}
- ${[...y].map($=>m``)} + ${[...x].map(E=>m``)} - ${[...x].map($=>m``)} + ${[...w].map(E=>m``)}
- ${[...E].map($=>m``)} + ${[...C].map(E=>m``)} - ${[...w].map($=>{const S=s!=null&&s.users?s.users[$]:null,k=S?S.name:$,U=S==null?void 0:S.picture;return m``})} + ${[...A].map(E=>{const M=r!=null&&r.users?r.users[E]:null,$=M?M.name:E,et=M==null?void 0:M.picture;return m``})}
- + - ${[...C].map($=>m``)} + ${[...N].map(E=>m``)}
- +
- - + +
- `},Iu=e=>B.create(Tu,e),Nu=Object.freeze(Object.defineProperty({__proto__:null,createTopic:Iu},Symbol.toStringTag,{value:"Module"}));({...Nu});/** + `},Ju=e=>V.create(Xu,e),Qu=Object.freeze(Object.defineProperty({__proto__:null,createTopic:Ju},Symbol.toStringTag,{value:"Module"}));({...Qu});/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const ci=globalThis,jn=ci.ShadowRoot&&(ci.ShadyCSS===void 0||ci.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Dn=Symbol(),jo=new WeakMap;let Lr=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Dn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(jn&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=jo.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&jo.set(t,e))}return e}toString(){return this.cssText}};const Pu=e=>new Lr(typeof e=="string"?e:e+"",void 0,Dn),jr=(e,...t)=>{const i=e.length===1?e[0]:t.reduce((n,o,s)=>n+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+e[s+1],e[0]);return new Lr(i,e,Dn)},Mu=(e,t)=>{if(jn)e.adoptedStyleSheets=t.map(i=>i instanceof CSSStyleSheet?i:i.styleSheet);else for(const i of t){const n=document.createElement("style"),o=ci.litNonce;o!==void 0&&n.setAttribute("nonce",o),n.textContent=i.cssText,e.appendChild(n)}},Do=jn?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let i="";for(const n of t.cssRules)i+=n.cssText;return Pu(i)})(e):e;/** + */const hi=globalThis,Un=hi.ShadowRoot&&(hi.ShadyCSS===void 0||hi.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Vn=Symbol(),Vo=new WeakMap;let Gr=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Vn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Un&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=Vo.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Vo.set(t,e))}return e}toString(){return this.cssText}};const Ku=e=>new Gr(typeof e=="string"?e:e+"",void 0,Vn),Wn=(e,...t)=>{const i=e.length===1?e[0]:t.reduce((n,o,s)=>n+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+e[s+1],e[0]);return new Gr(i,e,Vn)},Zu=(e,t)=>{if(Un)e.adoptedStyleSheets=t.map(i=>i instanceof CSSStyleSheet?i:i.styleSheet);else for(const i of t){const n=document.createElement("style"),o=hi.litNonce;o!==void 0&&n.setAttribute("nonce",o),n.textContent=i.cssText,e.appendChild(n)}},Wo=Un?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let i="";for(const n of t.cssRules)i+=n.cssText;return Ku(i)})(e):e;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const{is:Lu,defineProperty:ju,getOwnPropertyDescriptor:Du,getOwnPropertyNames:Ru,getOwnPropertySymbols:zu,getPrototypeOf:Fu}=Object,re=globalThis,Ro=re.trustedTypes,Hu=Ro?Ro.emptyScript:"",zo=re.reactiveElementPolyfillSupport,Se=(e,t)=>e,Ai={toAttribute(e,t){switch(t){case Boolean:e=e?Hu:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=e!==null;break;case Number:i=e===null?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch{i=null}}return i}},Rn=(e,t)=>!Lu(e,t),Fo={attribute:!0,type:String,converter:Ai,reflect:!1,hasChanged:Rn};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),re.litPropertyMetadata??(re.litPropertyMetadata=new WeakMap);class qt extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,i=Fo){if(i.state&&(i.attribute=!1),this._$Ei(),this.elementProperties.set(t,i),!i.noAccessor){const n=Symbol(),o=this.getPropertyDescriptor(t,n,i);o!==void 0&&ju(this.prototype,t,o)}}static getPropertyDescriptor(t,i,n){const{get:o,set:s}=Du(this.prototype,t)??{get(){return this[i]},set(r){this[i]=r}};return{get(){return o==null?void 0:o.call(this)},set(r){const a=o==null?void 0:o.call(this);s.call(this,r),this.requestUpdate(t,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Fo}static _$Ei(){if(this.hasOwnProperty(Se("elementProperties")))return;const t=Fu(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Se("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Se("properties"))){const i=this.properties,n=[...Ru(i),...zu(i)];for(const o of n)this.createProperty(o,i[o])}const t=this[Symbol.metadata];if(t!==null){const i=litPropertyMetadata.get(t);if(i!==void 0)for(const[n,o]of i)this.elementProperties.set(n,o)}this._$Eh=new Map;for(const[i,n]of this.elementProperties){const o=this._$Eu(i,n);o!==void 0&&this._$Eh.set(o,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const o of n)i.unshift(Do(o))}else t!==void 0&&i.push(Do(t));return i}static _$Eu(t,i){const n=i.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(i=>this.enableUpdating=i),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(i=>i(this))}addController(t){var i;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)==null||i.call(t))}removeController(t){var i;(i=this._$EO)==null||i.delete(t)}_$E_(){const t=new Map,i=this.constructor.elementProperties;for(const n of i.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Mu(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(i=>{var n;return(n=i.hostConnected)==null?void 0:n.call(i)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(i=>{var n;return(n=i.hostDisconnected)==null?void 0:n.call(i)})}attributeChangedCallback(t,i,n){this._$AK(t,n)}_$EC(t,i){var n;const o=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,o);if(s!==void 0&&o.reflect===!0){const r=(((n=o.converter)==null?void 0:n.toAttribute)!==void 0?o.converter:Ai).toAttribute(i,o.type);this._$Em=t,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(t,i){var n;const o=this.constructor,s=o._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const r=o.getPropertyOptions(s),a=typeof r.converter=="function"?{fromAttribute:r.converter}:((n=r.converter)==null?void 0:n.fromAttribute)!==void 0?r.converter:Ai;this._$Em=s,this[s]=a.fromAttribute(i,r.type),this._$Em=null}}requestUpdate(t,i,n){if(t!==void 0){if(n??(n=this.constructor.getPropertyOptions(t)),!(n.hasChanged??Rn)(this[t],i))return;this.P(t,i,n)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,i,n){this._$AL.has(t)||this._$AL.set(t,i),n.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,r]of this._$Ep)this[s]=r;this._$Ep=void 0}const o=this.constructor.elementProperties;if(o.size>0)for(const[s,r]of o)r.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],r)}let i=!1;const n=this._$AL;try{i=this.shouldUpdate(n),i?(this.willUpdate(n),(t=this._$EO)==null||t.forEach(o=>{var s;return(s=o.hostUpdate)==null?void 0:s.call(o)}),this.update(n)):this._$EU()}catch(o){throw i=!1,this._$EU(),o}i&&this._$AE(n)}willUpdate(t){}_$AE(t){var i;(i=this._$EO)==null||i.forEach(n=>{var o;return(o=n.hostUpdated)==null?void 0:o.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(i=>this._$EC(i,this[i]))),this._$EU()}updated(t){}firstUpdated(t){}}qt.elementStyles=[],qt.shadowRootOptions={mode:"open"},qt[Se("elementProperties")]=new Map,qt[Se("finalized")]=new Map,zo==null||zo({ReactiveElement:qt}),(re.reactiveElementVersions??(re.reactiveElementVersions=[])).push("2.0.4");/** + */const{is:th,defineProperty:eh,getOwnPropertyDescriptor:ih,getOwnPropertyNames:nh,getOwnPropertySymbols:oh,getPrototypeOf:sh}=Object,re=globalThis,Go=re.trustedTypes,rh=Go?Go.emptyScript:"",qo=re.reactiveElementPolyfillSupport,Ne=(e,t)=>e,Oi={toAttribute(e,t){switch(t){case Boolean:e=e?rh:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=e!==null;break;case Number:i=e===null?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch{i=null}}return i}},Gn=(e,t)=>!th(e,t),Yo={attribute:!0,type:String,converter:Oi,reflect:!1,hasChanged:Gn};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),re.litPropertyMetadata??(re.litPropertyMetadata=new WeakMap);class Yt extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,i=Yo){if(i.state&&(i.attribute=!1),this._$Ei(),this.elementProperties.set(t,i),!i.noAccessor){const n=Symbol(),o=this.getPropertyDescriptor(t,n,i);o!==void 0&&eh(this.prototype,t,o)}}static getPropertyDescriptor(t,i,n){const{get:o,set:s}=ih(this.prototype,t)??{get(){return this[i]},set(r){this[i]=r}};return{get(){return o==null?void 0:o.call(this)},set(r){const a=o==null?void 0:o.call(this);s.call(this,r),this.requestUpdate(t,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Yo}static _$Ei(){if(this.hasOwnProperty(Ne("elementProperties")))return;const t=sh(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Ne("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ne("properties"))){const i=this.properties,n=[...nh(i),...oh(i)];for(const o of n)this.createProperty(o,i[o])}const t=this[Symbol.metadata];if(t!==null){const i=litPropertyMetadata.get(t);if(i!==void 0)for(const[n,o]of i)this.elementProperties.set(n,o)}this._$Eh=new Map;for(const[i,n]of this.elementProperties){const o=this._$Eu(i,n);o!==void 0&&this._$Eh.set(o,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const o of n)i.unshift(Wo(o))}else t!==void 0&&i.push(Wo(t));return i}static _$Eu(t,i){const n=i.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(i=>this.enableUpdating=i),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(i=>i(this))}addController(t){var i;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)==null||i.call(t))}removeController(t){var i;(i=this._$EO)==null||i.delete(t)}_$E_(){const t=new Map,i=this.constructor.elementProperties;for(const n of i.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Zu(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(i=>{var n;return(n=i.hostConnected)==null?void 0:n.call(i)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(i=>{var n;return(n=i.hostDisconnected)==null?void 0:n.call(i)})}attributeChangedCallback(t,i,n){this._$AK(t,n)}_$EC(t,i){var n;const o=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,o);if(s!==void 0&&o.reflect===!0){const r=(((n=o.converter)==null?void 0:n.toAttribute)!==void 0?o.converter:Oi).toAttribute(i,o.type);this._$Em=t,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(t,i){var n;const o=this.constructor,s=o._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const r=o.getPropertyOptions(s),a=typeof r.converter=="function"?{fromAttribute:r.converter}:((n=r.converter)==null?void 0:n.fromAttribute)!==void 0?r.converter:Oi;this._$Em=s,this[s]=a.fromAttribute(i,r.type),this._$Em=null}}requestUpdate(t,i,n){if(t!==void 0){if(n??(n=this.constructor.getPropertyOptions(t)),!(n.hasChanged??Gn)(this[t],i))return;this.P(t,i,n)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,i,n){this._$AL.has(t)||this._$AL.set(t,i),n.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,r]of this._$Ep)this[s]=r;this._$Ep=void 0}const o=this.constructor.elementProperties;if(o.size>0)for(const[s,r]of o)r.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],r)}let i=!1;const n=this._$AL;try{i=this.shouldUpdate(n),i?(this.willUpdate(n),(t=this._$EO)==null||t.forEach(o=>{var s;return(s=o.hostUpdate)==null?void 0:s.call(o)}),this.update(n)):this._$EU()}catch(o){throw i=!1,this._$EU(),o}i&&this._$AE(n)}willUpdate(t){}_$AE(t){var i;(i=this._$EO)==null||i.forEach(n=>{var o;return(o=n.hostUpdated)==null?void 0:o.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(i=>this._$EC(i,this[i]))),this._$EU()}updated(t){}firstUpdated(t){}}Yt.elementStyles=[],Yt.shadowRootOptions={mode:"open"},Yt[Ne("elementProperties")]=new Map,Yt[Ne("finalized")]=new Map,qo==null||qo({ReactiveElement:Yt}),(re.reactiveElementVersions??(re.reactiveElementVersions=[])).push("2.0.4");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */class Xt extends qt{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var t;const i=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=i.firstChild),i}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=Su(i,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this.o)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.o)==null||t.setConnected(!1)}render(){return oe}}var Ho;Xt._$litElement$=!0,Xt.finalized=!0,(Ho=globalThis.litElementHydrateSupport)==null||Ho.call(globalThis,{LitElement:Xt});const Bo=globalThis.litElementPolyfillSupport;Bo==null||Bo({LitElement:Xt});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.0");/** + */class Dt extends Yt{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var t;const i=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=i.firstChild),i}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=ju(i,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this.o)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.o)==null||t.setConnected(!1)}render(){return oe}}var Xo;Dt._$litElement$=!0,Dt.finalized=!0,(Xo=globalThis.litElementHydrateSupport)==null||Xo.call(globalThis,{LitElement:Dt});const Jo=globalThis.litElementPolyfillSupport;Jo==null||Jo({LitElement:Dt});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.0");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const Bu={attribute:!0,type:String,converter:Ai,reflect:!1,hasChanged:Rn},Uu=(e=Bu,t,i)=>{const{kind:n,metadata:o}=i;let s=globalThis.litPropertyMetadata.get(o);if(s===void 0&&globalThis.litPropertyMetadata.set(o,s=new Map),s.set(i.name,e),n==="accessor"){const{name:r}=i;return{set(a){const l=t.get.call(this);t.set.call(this,a),this.requestUpdate(r,l,e)},init(a){return a!==void 0&&this.P(r,void 0,e),a}}}if(n==="setter"){const{name:r}=i;return function(a){const l=this[r];t.call(this,a),this.requestUpdate(r,l,e)}}throw Error("Unsupported decorator location: "+n)};function G(e){return(t,i)=>typeof i=="object"?Uu(e,t,i):((n,o,s)=>{const r=o.hasOwnProperty(s);return o.constructor.createProperty(s,r?{...n,wrapped:!0}:n),r?Object.getOwnPropertyDescriptor(o,s):void 0})(e,t,i)}/** + */const ah={attribute:!0,type:String,converter:Oi,reflect:!1,hasChanged:Gn},lh=(e=ah,t,i)=>{const{kind:n,metadata:o}=i;let s=globalThis.litPropertyMetadata.get(o);if(s===void 0&&globalThis.litPropertyMetadata.set(o,s=new Map),s.set(i.name,e),n==="accessor"){const{name:r}=i;return{set(a){const l=t.get.call(this);t.set.call(this,a),this.requestUpdate(r,l,e)},init(a){return a!==void 0&&this.P(r,void 0,e),a}}}if(n==="setter"){const{name:r}=i;return function(a){const l=this[r];t.call(this,a),this.requestUpdate(r,l,e)}}throw Error("Unsupported decorator location: "+n)};function G(e){return(t,i)=>typeof i=="object"?lh(e,t,i):((n,o,s)=>{const r=o.hasOwnProperty(s);return o.constructor.createProperty(s,r?{...n,wrapped:!0}:n),r?Object.getOwnPropertyDescriptor(o,s):void 0})(e,t,i)}/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */function Vu(e){return G({...e,state:!0,attribute:!1})}class Wu extends ia{constructor(t=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=t,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new na(.5,.5),this.addEventListener("removed",function(){this.traverse(function(i){i.element instanceof Element&&i.element.parentNode!==null&&i.element.parentNode.removeChild(i.element)})})}copy(t,i){return super.copy(t,i),this.element=t.element.cloneNode(!0),this.center=t.center,this}}new vn;new Si;new Si;new vn;new vn;class Gu{constructor(t,i){this._group=new zn,this._frustum=new Jr,this._frustumMat=new Si,this._regenerateDelay=200,this._regenerateCounter=0,this.material=new Qr({color:"#2e3338"}),this.numbers=new zn,this.maxRegenerateRetrys=4,this.gridsFactor=5,this._scaleX=1,this._scaleY=1,this._offsetX=0,this._offsetY=0,this._camera=t,this._container=i;const n=this.newGrid(-1),o=this.newGrid(-2);this.grids={main:n,secondary:o},this._group.add(o,n,this.numbers)}set scaleX(t){this._scaleX=t,this.regenerate()}get scaleX(){return this._scaleX}set scaleY(t){this._scaleY=t,this.regenerate()}get scaleY(){return this._scaleY}set offsetX(t){this._offsetX=t,this.regenerate()}get offsetX(){return this._offsetX}set offsetY(t){this._offsetY=t,this.regenerate()}get offsetY(){return this._offsetY}get(){return this._group}dispose(){const{main:t,secondary:i}=this.grids;t.removeFromParent(),i.removeFromParent(),t.geometry.dispose(),t.material.dispose(),i.geometry.dispose(),i.material.dispose()}regenerate(){if(!this.isGridReady()){if(this._regenerateCounter++,this._regenerateCounter>this.maxRegenerateRetrys)throw new Error("Grid could not be regenerated");setTimeout(()=>this.regenerate,this._regenerateDelay);return}this._regenerateCounter=0,this._camera.updateMatrix(),this._camera.updateMatrixWorld();const t=this._frustumMat.multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse);this._frustum.setFromProjectionMatrix(t);const{planes:i}=this._frustum,n=i[0].constant*-i[0].normal.x,o=i[1].constant*-i[1].normal.x,s=i[2].constant*-i[2].normal.y,r=i[3].constant*-i[3].normal.y,a=Math.abs(n-o),l=Math.abs(r-s),{clientWidth:d,clientHeight:u}=this._container,c=Math.max(d,u),h=Math.max(a,l)/c,p=Math.ceil(Math.log10(a/this.scaleX)),g=Math.ceil(Math.log10(l/this.scaleY)),_=10**(p-2)*this.scaleX,v=10**(g-2)*this.scaleY,f=_*this.gridsFactor,y=v*this.gridsFactor,x=Math.ceil(l/y),w=Math.ceil(a/f),E=Math.ceil(l/v),C=Math.ceil(a/_),A=_*Math.ceil(o/_),N=v*Math.ceil(s/v),$=f*Math.ceil(o/f),S=y*Math.ceil(s/y),k=[...this.numbers.children];for(const H of k)H.removeFromParent();this.numbers.children=[];const U=[],vt=9*h,j=1e4,ct=$+this._offsetX,it=Math.round(Math.abs(ct/this.scaleX)*j)/j,nt=(w-1)*f,q=Math.round(Math.abs((ct+nt)/this.scaleX)*j)/j,ot=Math.max(it,q).toString().length*vt;let ge=Math.ceil(ot/f)*f;for(let H=0;H.01)continue;const Ke=this.newNumber((D+this._offsetX)/this.scaleX),Bi=12*h;Ke.position.set(D,s+Bi,0)}for(let H=0;H{for(var o=Yu(t,i),s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&qu(t,i,o),o};const Dr=class extends Xt{constructor(){super(...arguments),this._grid=null,this._world=null,this.resize=()=>{this._world&&this._grid&&this._grid.regenerate()}}set gridColor(t){if(this._gridColor=t,!(t&&this._grid))return;const i=Number(t.replace("#","0x"));Number.isNaN(i)||this._grid.material.color.setHex(i)}get gridColor(){return this._gridColor}set gridScaleX(t){this._gridScaleX=t,t&&this._grid&&(this._grid.scaleX=t)}get gridScaleX(){return this._gridScaleX}set gridScaleY(t){this._gridScaleY=t,t&&this._grid&&(this._grid.scaleY=t)}get gridScaleY(){return this._gridScaleY}get gridOffsetX(){var t;return((t=this._grid)==null?void 0:t.offsetX)||0}set gridOffsetX(t){this._grid&&(this._grid.offsetX=t)}get gridOffsetY(){var t;return((t=this._grid)==null?void 0:t.offsetY)||0}set gridOffsetY(t){this._grid&&(this._grid.offsetY=t)}set components(t){this.dispose();const i=t.get(gn).create();this._world=i,i.scene=new Ur(t),i.scene.setup(),i.renderer=new da(t,this);const n=new Vr(t);i.camera=n;const o=new Gu(n.threeOrtho,this);this._grid=o,i.scene.three.add(o.get()),n.controls.addEventListener("update",()=>o.regenerate()),setTimeout(async()=>{i.camera.updateAspect(),n.set("Plan"),await n.controls.setLookAt(0,0,100,0,0,0),await n.projection.set("Orthographic"),n.controls.dollySpeed=3,n.controls.draggingSmoothTime=.085,n.controls.maxZoom=1e3,n.controls.zoom(4)})}get world(){return this._world}dispose(){var t;(t=this.world)==null||t.dispose(),this._world=null,this._grid=null}connectedCallback(){super.connectedCallback(),new ResizeObserver(this.resize).observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.dispose()}render(){return Pr``}};Dr.styles=jr` + */function ch(e){return G({...e,state:!0,attribute:!1})}class dh extends ua{constructor(t=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=t,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new ha(.5,.5),this.addEventListener("removed",function(){this.traverse(function(i){i.element instanceof Element&&i.element.parentNode!==null&&i.element.parentNode.removeChild(i.element)})})}copy(t,i){return super.copy(t,i),this.element=t.element.cloneNode(!0),this.center=t.center,this}}new Cn;new Ii;new Ii;new Cn;new Cn;class uh{constructor(t,i){this._group=new qn,this._frustum=new sa,this._frustumMat=new Ii,this._regenerateDelay=200,this._regenerateCounter=0,this.material=new ra({color:"#2e3338"}),this.numbers=new qn,this.maxRegenerateRetrys=4,this.gridsFactor=5,this._scaleX=1,this._scaleY=1,this._offsetX=0,this._offsetY=0,this._camera=t,this._container=i;const n=this.newGrid(-1),o=this.newGrid(-2);this.grids={main:n,secondary:o},this._group.add(o,n,this.numbers)}set scaleX(t){this._scaleX=t,this.regenerate()}get scaleX(){return this._scaleX}set scaleY(t){this._scaleY=t,this.regenerate()}get scaleY(){return this._scaleY}set offsetX(t){this._offsetX=t,this.regenerate()}get offsetX(){return this._offsetX}set offsetY(t){this._offsetY=t,this.regenerate()}get offsetY(){return this._offsetY}get(){return this._group}dispose(){const{main:t,secondary:i}=this.grids;t.removeFromParent(),i.removeFromParent(),t.geometry.dispose(),t.material.dispose(),i.geometry.dispose(),i.material.dispose()}regenerate(){if(!this.isGridReady()){if(this._regenerateCounter++,this._regenerateCounter>this.maxRegenerateRetrys)throw new Error("Grid could not be regenerated");setTimeout(()=>this.regenerate,this._regenerateDelay);return}this._regenerateCounter=0,this._camera.updateMatrix(),this._camera.updateMatrixWorld();const t=this._frustumMat.multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse);this._frustum.setFromProjectionMatrix(t);const{planes:i}=this._frustum,n=i[0].constant*-i[0].normal.x,o=i[1].constant*-i[1].normal.x,s=i[2].constant*-i[2].normal.y,r=i[3].constant*-i[3].normal.y,a=Math.abs(n-o),l=Math.abs(r-s),{clientWidth:d,clientHeight:u}=this._container,c=Math.max(d,u),h=Math.max(a,l)/c,p=Math.ceil(Math.log10(a/this.scaleX)),b=Math.ceil(Math.log10(l/this.scaleY)),v=10**(p-2)*this.scaleX,y=10**(b-2)*this.scaleY,g=v*this.gridsFactor,_=y*this.gridsFactor,x=Math.ceil(l/_),w=Math.ceil(a/g),A=Math.ceil(l/y),C=Math.ceil(a/v),N=v*Math.ceil(o/v),L=y*Math.ceil(s/y),k=g*Math.ceil(o/g),S=_*Math.ceil(s/_),B=[...this.numbers.children];for(const U of B)U.removeFromParent();this.numbers.children=[];const E=[],M=9*h,$=1e4,et=k+this._offsetX,ot=Math.round(Math.abs(et/this.scaleX)*$)/$,st=(w-1)*g,X=Math.round(Math.abs((et+st)/this.scaleX)*$)/$,rt=Math.max(ot,X).toString().length*M;let ve=Math.ceil(rt/g)*g;for(let U=0;U.01)continue;const ii=this.newNumber((z+this._offsetX)/this.scaleX),qi=12*h;ii.position.set(z,s+qi,0)}for(let U=0;U{for(var o=ph(t,i),s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&hh(t,i,o),o};const qr=class extends Dt{constructor(){super(...arguments),this._grid=null,this._world=null,this.resize=()=>{this._world&&this._grid&&this._grid.regenerate()}}set gridColor(t){if(this._gridColor=t,!(t&&this._grid))return;const i=Number(t.replace("#","0x"));Number.isNaN(i)||this._grid.material.color.setHex(i)}get gridColor(){return this._gridColor}set gridScaleX(t){this._gridScaleX=t,t&&this._grid&&(this._grid.scaleX=t)}get gridScaleX(){return this._gridScaleX}set gridScaleY(t){this._gridScaleY=t,t&&this._grid&&(this._grid.scaleY=t)}get gridScaleY(){return this._gridScaleY}get gridOffsetX(){var t;return((t=this._grid)==null?void 0:t.offsetX)||0}set gridOffsetX(t){this._grid&&(this._grid.offsetX=t)}get gridOffsetY(){var t;return((t=this._grid)==null?void 0:t.offsetY)||0}set gridOffsetY(t){this._grid&&(this._grid.offsetY=t)}set components(t){this.dispose();const i=t.get(Ni).create();this._world=i,i.scene=new Qo(t),i.scene.setup(),i.renderer=new _a(t,this);const n=new Ko(t);i.camera=n;const o=new uh(n.threeOrtho,this);this._grid=o,i.scene.three.add(o.get()),n.controls.addEventListener("update",()=>o.regenerate()),setTimeout(async()=>{i.camera.updateAspect(),n.set("Plan"),await n.controls.setLookAt(0,0,100,0,0,0),await n.projection.set("Orthographic"),n.controls.dollySpeed=3,n.controls.draggingSmoothTime=.085,n.controls.maxZoom=1e3,n.controls.zoom(4)})}get world(){return this._world}dispose(){var t;(t=this.world)==null||t.dispose(),this._world=null,this._grid=null}connectedCallback(){super.connectedCallback(),new ResizeObserver(this.resize).observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.dispose()}render(){return Bn``}};qr.styles=Wn` :host { position: relative; display: flex; @@ -2149,7 +2189,7 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I height: 100%; background-color: var(--bim-ui_bg-base); } - `;let fe=Dr;Ze([G({type:String,attribute:"grid-color",reflect:!0})],fe.prototype,"gridColor");Ze([G({type:Number,attribute:"grid-scale-x",reflect:!0})],fe.prototype,"gridScaleX");Ze([G({type:Number,attribute:"grid-scale-y",reflect:!0})],fe.prototype,"gridScaleY");Ze([G({type:Number,attribute:"grid-offset-x",reflect:!0})],fe.prototype,"gridOffsetX");Ze([G({type:Number,attribute:"grid-offset-y",reflect:!0})],fe.prototype,"gridOffsetY");var Xu=Object.defineProperty,Tt=(e,t,i,n)=>{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&Xu(t,i,o),o};const Rr=class extends Xt{constructor(){super(...arguments),this._defaults={size:60},this._cssMatrix3D="",this._matrix=new Si,this._onRightClick=new Event("rightclick"),this._onLeftClick=new Event("leftclick"),this._onTopClick=new Event("topclick"),this._onBottomClick=new Event("bottomclick"),this._onFrontClick=new Event("frontclick"),this._onBackClick=new Event("backclick"),this._camera=null,this._epsilon=t=>Math.abs(t)<1e-10?0:t}set camera(t){this._camera=t,this.updateOrientation()}get camera(){return this._camera}updateOrientation(){if(!this.camera)return;this._matrix.extractRotation(this.camera.matrixWorldInverse);const{elements:t}=this._matrix;this._cssMatrix3D=`matrix3d( + `;let ge=qr;ei([G({type:String,attribute:"grid-color",reflect:!0})],ge.prototype,"gridColor");ei([G({type:Number,attribute:"grid-scale-x",reflect:!0})],ge.prototype,"gridScaleX");ei([G({type:Number,attribute:"grid-scale-y",reflect:!0})],ge.prototype,"gridScaleY");ei([G({type:Number,attribute:"grid-offset-x",reflect:!0})],ge.prototype,"gridOffsetX");ei([G({type:Number,attribute:"grid-offset-y",reflect:!0})],ge.prototype,"gridOffsetY");var mh=Object.defineProperty,Ot=(e,t,i,n)=>{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&mh(t,i,o),o};const Yr=class extends Dt{constructor(){super(...arguments),this._defaults={size:60},this._cssMatrix3D="",this._matrix=new Ii,this._onRightClick=new Event("rightclick"),this._onLeftClick=new Event("leftclick"),this._onTopClick=new Event("topclick"),this._onBottomClick=new Event("bottomclick"),this._onFrontClick=new Event("frontclick"),this._onBackClick=new Event("backclick"),this._camera=null,this._epsilon=t=>Math.abs(t)<1e-10?0:t}set camera(t){this._camera=t,this.updateOrientation()}get camera(){return this._camera}updateOrientation(){if(!this.camera)return;this._matrix.extractRotation(this.camera.matrixWorldInverse);const{elements:t}=this._matrix;this._cssMatrix3D=`matrix3d( ${this._epsilon(t[0])}, ${this._epsilon(-t[1])}, ${this._epsilon(t[2])}, @@ -2166,7 +2206,7 @@ import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I ${this._epsilon(-t[13])}, ${this._epsilon(t[14])}, ${this._epsilon(t[15])}) - `}render(){const t=this.size??this._defaults.size;return Pr` + `}render(){const t=this.size??this._defaults.size;return Bn` - `}};gr.styles=E` + `}};_o.styles=E` :host { padding: 0.375rem; display: flex; @@ -1238,7 +1250,7 @@ var Mr=Object.defineProperty,Rr=(i,t,e)=>t in i?Mr(i,t,{enumerable:!0,configurab justify-content: center; } - :host([data-column-index="0"]:not([data-no-indentation])) { + :host([data-column-index="0"]) { justify-content: normal; } @@ -1261,10 +1273,10 @@ var Mr=Object.defineProperty,Rr=(i,t,e)=>t in i?Mr(i,t,{enumerable:!0,configurab white-space: normal; text-align: center; } - `;let vr=gr;xl([h({type:String,reflect:!0})],vr.prototype,"column");var wl=Object.defineProperty,$l=(i,t,e,r)=>{for(var n=void 0,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=s(t,e,n)||n);return n&&wl(t,e,n),n};const yr=class extends w{constructor(){super(...arguments),this._groups=[],this.data=[],this.table=this.closest("bim-table")}toggleGroups(t,e=!1){for(const r of this._groups)r.childrenHidden=typeof t>"u"?!r.childrenHidden:!t,e&&r.toggleChildren(t,e)}render(){return this._groups=[],f` + `;let xo=_o;wl([h({type:String,reflect:!0})],xo.prototype,"column");var $l=Object.defineProperty,El=(i,t,e,o)=>{for(var n=void 0,r=i.length-1,s;r>=0;r--)(s=i[r])&&(n=s(t,e,n)||n);return n&&$l(t,e,n),n};const wo=class extends w{constructor(){super(...arguments),this._groups=[],this.data=[],this.table=this.closest("bim-table")}toggleGroups(t,e=!1){for(const o of this._groups)o.childrenHidden=typeof t>"u"?!o.childrenHidden:!t,e&&o.toggleChildren(t,e)}render(){return this._groups=[],f` ${this.data.map(t=>{const e=document.createElement("bim-table-group");return this._groups.push(e),e.table=this.table,e.data=t,e})} - `}};yr.styles=E` + `}};wo.styles=E` :host { --bim-button--bgc: transparent; position: relative; @@ -1279,7 +1291,7 @@ var Mr=Object.defineProperty,Rr=(i,t,e)=>t in i?Mr(i,t,{enumerable:!0,configurab top: 0; bottom: 1.125rem; } - `;let _r=yr;$l([h({type:Array,attribute:!1})],_r.prototype,"data");var El=Object.defineProperty,Cl=(i,t,e,r)=>{for(var n=void 0,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=s(t,e,n)||n);return n&&El(t,e,n),n};const xr=class extends w{constructor(){super(...arguments),this.data={data:{}},this.childrenHidden=!0,this.table=this.closest("bim-table")}connectedCallback(){super.connectedCallback(),this.table&&this.table.expanded?this.childrenHidden=!1:this.childrenHidden=!0}toggleChildren(t,e=!1){this._children&&(this.childrenHidden=typeof t>"u"?!this.childrenHidden:!t,e&&this._children.toggleGroups(t,e))}render(){if(!this.table)throw new Error("TableGroup: parent table wasn't found!");const t=this.table.getGroupIndentation(this.data)??0,e=f` + `;let $o=wo;El([h({type:Array,attribute:!1})],$o.prototype,"data");var Cl=Object.defineProperty,kl=(i,t,e,o)=>{for(var n=void 0,r=i.length-1,s;r>=0;r--)(s=i[r])&&(n=s(t,e,n)||n);return n&&Cl(t,e,n),n};const Eo=class extends w{constructor(){super(...arguments),this.data={data:{}},this.childrenHidden=!0,this.table=this.closest("bim-table")}connectedCallback(){super.connectedCallback(),this.table&&this.table.expanded?this.childrenHidden=!1:this.childrenHidden=!0}toggleChildren(t,e=!1){this._children&&(this.childrenHidden=typeof t>"u"?!this.childrenHidden:!t,e&&this._children.toggleGroups(t,e))}render(){if(!this.table)throw new Error("TableGroup: parent table wasn't found!");const t=this.table.getGroupIndentation(this.data)??0,e=f` ${this.table.noIndentation?null:f`
`} - `,r=document.createDocumentFragment();zt(e,r);let n=null;this.table.noIndentation||(n=document.createElement("div"),n.classList.add("branch","branch-horizontal"),n.style.left=`${t-1+(this.table.selectableRows?2.05:.5625)}rem`);let o=null;if(!this.table.noIndentation){const a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("height","9.5"),a.setAttribute("width","7.5"),a.setAttribute("viewBox","0 0 4.6666672 7.3333333");const c=document.createElementNS("http://www.w3.org/2000/svg","path");c.setAttribute("d","m 1.7470835,6.9583848 2.5899999,-2.59 c 0.39,-0.39 0.39,-1.02 0,-1.41 L 1.7470835,0.36838483 c -0.63,-0.62000003 -1.71000005,-0.18 -1.71000005,0.70999997 v 5.17 c 0,0.9 1.08000005,1.34 1.71000005,0.71 z"),a.append(c);const d=document.createElementNS("http://www.w3.org/2000/svg","svg");d.setAttribute("height","6.5"),d.setAttribute("width","9.5"),d.setAttribute("viewBox","0 0 5.9111118 5.0175439");const u=document.createElementNS("http://www.w3.org/2000/svg","path");u.setAttribute("d","M -0.33616196,1.922522 2.253838,4.5125219 c 0.39,0.39 1.02,0.39 1.41,0 L 6.2538379,1.922522 c 0.6200001,-0.63 0.18,-1.71000007 -0.7099999,-1.71000007 H 0.37383804 c -0.89999997,0 -1.33999997,1.08000007 -0.71,1.71000007 z"),d.append(u),o=document.createElement("div"),o.addEventListener("click",p=>{p.stopPropagation(),this.toggleChildren()}),o.classList.add("caret"),o.style.left=`${(this.table.selectableRows?1.5:.125)+t}rem`,this.childrenHidden?o.append(a):o.append(d)}const s=document.createElement("bim-table-row");this.data.children&&!this.childrenHidden&&s.append(r),s.table=this.table,s.data=this.data.data,this.table.dispatchEvent(new CustomEvent("rowcreated",{detail:{row:s}})),o&&this.data.children&&s.append(o),t!==0&&(!this.data.children||this.childrenHidden)&&n&&s.append(n);let l;if(this.data.children){l=document.createElement("bim-table-children"),this._children=l,l.table=this.table,l.data=this.data.children;const a=document.createDocumentFragment();zt(e,a),l.append(a)}return f` + `,o=document.createDocumentFragment();zt(e,o);let n=null;this.table.noIndentation||(n=document.createElement("div"),n.classList.add("branch","branch-horizontal"),n.style.left=`${t-1+(this.table.selectableRows?2.05:.5625)}rem`);let r=null;if(!this.table.noIndentation){const a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("height","9.5"),a.setAttribute("width","7.5"),a.setAttribute("viewBox","0 0 4.6666672 7.3333333");const c=document.createElementNS("http://www.w3.org/2000/svg","path");c.setAttribute("d","m 1.7470835,6.9583848 2.5899999,-2.59 c 0.39,-0.39 0.39,-1.02 0,-1.41 L 1.7470835,0.36838483 c -0.63,-0.62000003 -1.71000005,-0.18 -1.71000005,0.70999997 v 5.17 c 0,0.9 1.08000005,1.34 1.71000005,0.71 z"),a.append(c);const d=document.createElementNS("http://www.w3.org/2000/svg","svg");d.setAttribute("height","6.5"),d.setAttribute("width","9.5"),d.setAttribute("viewBox","0 0 5.9111118 5.0175439");const u=document.createElementNS("http://www.w3.org/2000/svg","path");u.setAttribute("d","M -0.33616196,1.922522 2.253838,4.5125219 c 0.39,0.39 1.02,0.39 1.41,0 L 6.2538379,1.922522 c 0.6200001,-0.63 0.18,-1.71000007 -0.7099999,-1.71000007 H 0.37383804 c -0.89999997,0 -1.33999997,1.08000007 -0.71,1.71000007 z"),d.append(u),r=document.createElement("div"),r.addEventListener("click",p=>{p.stopPropagation(),this.toggleChildren()}),r.classList.add("caret"),r.style.left=`${(this.table.selectableRows?1.5:.125)+t}rem`,this.childrenHidden?r.append(a):r.append(d)}const s=document.createElement("bim-table-row");this.data.children&&!this.childrenHidden&&s.append(o),s.table=this.table,s.data=this.data.data,this.table.dispatchEvent(new CustomEvent("rowcreated",{detail:{row:s}})),r&&this.data.children&&s.append(r),t!==0&&(!this.data.children||this.childrenHidden)&&n&&s.append(n);let l;if(this.data.children){l=document.createElement("bim-table-children"),this._children=l,l.table=this.table,l.data=this.data.children;const a=document.createDocumentFragment();zt(e,a),l.append(a)}return f`
${s} ${this.childrenHidden?null:l}
- `}};xr.styles=E` + `}};Eo.styles=E` :host { position: relative; } @@ -1331,15 +1343,15 @@ var Mr=Object.defineProperty,Rr=(i,t,e)=>t in i?Mr(i,t,{enumerable:!0,configurab .caret svg { fill: var(--bim-ui_bg-contrast-60); } - `;let wr=xr;Cl([h({type:Boolean,attribute:"children-hidden",reflect:!0})],wr.prototype,"childrenHidden");var kl=Object.defineProperty,It=(i,t,e,r)=>{for(var n=void 0,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=s(t,e,n)||n);return n&&kl(t,e,n),n};const $r=class extends w{constructor(){super(...arguments),this.selected=!1,this.columns=[],this.hiddenColumns=[],this.data={},this.isHeader=!1,this.table=this.closest("bim-table"),this.onTableColumnsChange=()=>{this.table&&(this.columns=this.table.columns)},this.onTableColumnsHidden=()=>{this.table&&(this.hiddenColumns=this.table.hiddenColumns)},this._observer=new IntersectionObserver(t=>{this._intersecting=t[0].isIntersecting},{rootMargin:"36px"})}get _columnNames(){return this.columns.filter(t=>!this.hiddenColumns.includes(t.name)).map(t=>t.name)}get _columnWidths(){return this.columns.filter(t=>!this.hiddenColumns.includes(t.name)).map(t=>t.width)}get _isSelected(){var t;return(t=this.table)==null?void 0:t.selection.has(this.data)}onSelectionChange(t){if(!this.table)return;const e=t.target;this.selected=e.value,e.value?(this.table.selection.add(this.data),this.table.dispatchEvent(new CustomEvent("rowselected",{detail:{data:this.data}}))):(this.table.selection.delete(this.data),this.table.dispatchEvent(new CustomEvent("rowdeselected",{detail:{data:this.data}})))}connectedCallback(){super.connectedCallback(),this._observer.observe(this),this.table&&(this.columns=this.table.columns,this.hiddenColumns=this.table.hiddenColumns,this.table.addEventListener("columnschange",this.onTableColumnsChange),this.table.addEventListener("columnshidden",this.onTableColumnsHidden),this.toggleAttribute("selected",this._isSelected))}disconnectedCallback(){super.disconnectedCallback(),this._observer.unobserve(this),this.table&&(this.columns=[],this.hiddenColumns=[],this.table.removeEventListener("columnschange",this.onTableColumnsChange),this.table.removeEventListener("columnshidden",this.onTableColumnsHidden),this.toggleAttribute("selected",!1))}compute(){if(!this.table)throw new Error("TableRow: parent table wasn't found!");const t=this.table.getRowIndentation(this.data)??0,e=this.isHeader?this.data:this.table.applyDataTransform(this.data)??this.data,r=[];for(const n in e){if(this.hiddenColumns.includes(n))continue;const o=e[n];let s;if(typeof o=="string"||typeof o=="boolean"||typeof o=="number"?(s=document.createElement("bim-label"),s.textContent=String(o)):o instanceof HTMLElement?s=o:(s=document.createDocumentFragment(),zt(o,s)),!s)continue;const l=document.createElement("bim-table-cell");l.append(s),l.column=n,this._columnNames.indexOf(n)===0&&!this.isHeader&&(l.style.marginLeft=`${(this.table.noIndentation?0:t)+.75}rem`);const a=this._columnNames.indexOf(n);l.setAttribute("data-column-index",String(a)),l.toggleAttribute("data-no-indentation",a===0&&this.table.noIndentation),l.toggleAttribute("data-cell-header",this.isHeader),l.rowData=this.data,this.table.dispatchEvent(new CustomEvent("cellcreated",{detail:{cell:l}})),r.push(l)}return this.style.gridTemplateAreas=`"${this.table.selectableRows?"Selection":""} ${this._columnNames.join(" ")}"`,this.style.gridTemplateColumns=`${this.table.selectableRows?"1.6rem":""} ${this._columnWidths.join(" ")}`,f` + `;let Co=Eo;kl([h({type:Boolean,attribute:"children-hidden",reflect:!0})],Co.prototype,"childrenHidden");var Sl=Object.defineProperty,Nt=(i,t,e,o)=>{for(var n=void 0,r=i.length-1,s;r>=0;r--)(s=i[r])&&(n=s(t,e,n)||n);return n&&Sl(t,e,n),n};const ko=class extends w{constructor(){super(...arguments),this.selected=!1,this.columns=[],this.hiddenColumns=[],this.data={},this.isHeader=!1,this.table=this.closest("bim-table"),this.onTableColumnsChange=()=>{this.table&&(this.columns=this.table.columns)},this.onTableColumnsHidden=()=>{this.table&&(this.hiddenColumns=this.table.hiddenColumns)},this._observer=new IntersectionObserver(t=>{this._intersecting=t[0].isIntersecting},{rootMargin:"36px"})}get _columnNames(){return this.columns.filter(t=>!this.hiddenColumns.includes(t.name)).map(t=>t.name)}get _columnWidths(){return this.columns.filter(t=>!this.hiddenColumns.includes(t.name)).map(t=>t.width)}get _isSelected(){var t;return(t=this.table)==null?void 0:t.selection.has(this.data)}onSelectionChange(t){if(!this.table)return;const e=t.target;this.selected=e.value,e.value?(this.table.selection.add(this.data),this.table.dispatchEvent(new CustomEvent("rowselected",{detail:{data:this.data}}))):(this.table.selection.delete(this.data),this.table.dispatchEvent(new CustomEvent("rowdeselected",{detail:{data:this.data}})))}connectedCallback(){super.connectedCallback(),this._observer.observe(this),this.table&&(this.columns=this.table.columns,this.hiddenColumns=this.table.hiddenColumns,this.table.addEventListener("columnschange",this.onTableColumnsChange),this.table.addEventListener("columnshidden",this.onTableColumnsHidden),this.toggleAttribute("selected",this._isSelected))}disconnectedCallback(){super.disconnectedCallback(),this._observer.unobserve(this),this.table&&(this.columns=[],this.hiddenColumns=[],this.table.removeEventListener("columnschange",this.onTableColumnsChange),this.table.removeEventListener("columnshidden",this.onTableColumnsHidden),this.toggleAttribute("selected",!1))}compute(){if(!this.table)throw new Error("TableRow: parent table wasn't found!");const t=this.table.getRowIndentation(this.data)??0,e=this.isHeader?this.data:this.table.applyDataTransform(this.data)??this.data,o=[];for(const n in e){if(this.hiddenColumns.includes(n))continue;const r=e[n];let s;if(typeof r=="string"||typeof r=="boolean"||typeof r=="number"?(s=document.createElement("bim-label"),s.textContent=String(r)):r instanceof HTMLElement?s=r:(s=document.createDocumentFragment(),zt(r,s)),!s)continue;const l=document.createElement("bim-table-cell");l.append(s),l.column=n,this._columnNames.indexOf(n)===0&&(l.style.marginLeft=`${this.table.noIndentation?0:t+.75}rem`);const a=this._columnNames.indexOf(n);l.setAttribute("data-column-index",String(a)),l.toggleAttribute("data-no-indentation",a===0&&this.table.noIndentation),l.toggleAttribute("data-cell-header",this.isHeader),l.rowData=this.data,this.table.dispatchEvent(new CustomEvent("cellcreated",{detail:{cell:l}})),o.push(l)}return this.style.gridTemplateAreas=`"${this.table.selectableRows?"Selection":""} ${this._columnNames.join(" ")}"`,this.style.gridTemplateColumns=`${this.table.selectableRows?"1.6rem":""} ${this._columnWidths.join(" ")}`,f` ${!this.isHeader&&this.table.selectableRows?f``:null} - ${r} + ${o} - `}render(){return f`${this._intersecting?this.compute():f``}`}};$r.styles=E` + `}render(){return f`${this._intersecting?this.compute():f``}`}};ko.styles=E` :host { position: relative; grid-area: Data; @@ -1360,14 +1372,14 @@ var Mr=Object.defineProperty,Rr=(i,t,e)=>t in i?Mr(i,t,{enumerable:!0,configurab var(--bim-ui_main-base) 10% ); } - `;let vt=$r;It([h({type:Boolean,reflect:!0})],vt.prototype,"selected");It([h({attribute:!1})],vt.prototype,"columns");It([h({attribute:!1})],vt.prototype,"hiddenColumns");It([h({attribute:!1})],vt.prototype,"data");It([h({type:Boolean,attribute:"is-header",reflect:!0})],vt.prototype,"isHeader");It([Lt()],vt.prototype,"_intersecting");var Sl=Object.defineProperty,Al=Object.getOwnPropertyDescriptor,U=(i,t,e,r)=>{for(var n=r>1?void 0:r?Al(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&Sl(t,e,n),n};const Er=class extends w{constructor(){super(...arguments),this._columnsChange=new Event("columnschange"),this._filteredData=[],this.headersHidden=!1,this.minColWidth="4rem",this._columns=[],this._textDelimiters={comma:",",tab:" "},this._queryString=null,this._data=[],this.expanded=!1,this.preserveStructureOnFilter=!1,this.indentationInText=!1,this.dataTransform={},this.selectableRows=!1,this.selection=new Set,this.noIndentation=!1,this.loading=!1,this._errorLoading=!1,this._onColumnsHidden=new Event("columnshidden"),this._hiddenColumns=[],this.loadingErrorElement=null,this._stringFilterFunction=(t,e)=>Object.values(e.data).some(r=>String(r).toLowerCase().includes(t.toLowerCase())),this._queryFilterFunction=(t,e)=>{let r=!1;const n=ni(t)??[];for(const o of n){if("queries"in o){r=!1;break}const{condition:s,value:l}=o;let{key:a}=o;if(a.startsWith("[")&&a.endsWith("]")){const c=a.replace("[","").replace("]","");a=c,r=Object.keys(e.data).filter(d=>d.includes(c)).map(d=>on(e.data[d],s,l)).some(d=>d)}else r=on(e.data[a],s,l);if(!r)break}return r}}set columns(t){const e=[];for(const r of t){const n=typeof r=="string"?{name:r,width:`minmax(${this.minColWidth}, 1fr)`}:r;e.push(n)}this._columns=e,this.computeMissingColumns(this.data),this.dispatchEvent(this._columnsChange)}get columns(){return this._columns}get _headerRowData(){const t={};for(const e of this.columns)if(typeof e=="string")t[e]=e;else{const{name:r}=e;t[r]=r}return t}get value(){return this._filteredData}set queryString(t){this.toggleAttribute("data-processing",!0),this._queryString=t&&t.trim()!==""?t.trim():null,this.updateFilteredData(),this.toggleAttribute("data-processing",!1)}get queryString(){return this._queryString}set data(t){this._data=t,this.updateFilteredData(),this.computeMissingColumns(t)&&(this.columns=this._columns)}get data(){return this._data}get dataAsync(){return new Promise(t=>{setTimeout(()=>{t(this.data)})})}set hiddenColumns(t){this._hiddenColumns=t,setTimeout(()=>{this.dispatchEvent(this._onColumnsHidden)})}get hiddenColumns(){return this._hiddenColumns}updateFilteredData(){this.queryString?(ni(this.queryString)?(this.filterFunction=this._queryFilterFunction,this._filteredData=this.filter(this.queryString)):(this.filterFunction=this._stringFilterFunction,this._filteredData=this.filter(this.queryString)),this.preserveStructureOnFilter&&(this._expandedBeforeFilter===void 0&&(this._expandedBeforeFilter=this.expanded),this.expanded=!0)):(this.preserveStructureOnFilter&&this._expandedBeforeFilter!==void 0&&(this.expanded=this._expandedBeforeFilter,this._expandedBeforeFilter=void 0),this._filteredData=this.data)}computeMissingColumns(t){let e=!1;for(const r of t){const{children:n,data:o}=r;for(const s in o)this._columns.map(l=>typeof l=="string"?l:l.name).includes(s)||(this._columns.push({name:s,width:`minmax(${this.minColWidth}, 1fr)`}),e=!0);if(n){const s=this.computeMissingColumns(n);s&&!e&&(e=s)}}return e}generateText(t="comma",e=this.value,r="",n=!0){const o=this._textDelimiters[t];let s="";const l=this.columns.map(a=>a.name);if(n){this.indentationInText&&(s+=`Indentation${o}`);const a=`${l.join(o)} -`;s+=a}for(const[a,c]of e.entries()){const{data:d,children:u}=c,p=this.indentationInText?`${r}${a+1}${o}`:"",b=l.map(v=>d[v]??""),m=`${p}${b.join(o)} -`;s+=m,u&&(s+=this.generateText(t,c.children,`${r}${a+1}.`,!1))}return s}get csv(){return this.generateText("comma")}get tsv(){return this.generateText("tab")}applyDataTransform(t){const e={};for(const r of Object.keys(this.dataTransform)){const n=this.columns.find(o=>o.name===r);n&&n.forceDataTransform&&(r in t||(t[r]=""))}for(const r in t){const n=this.dataTransform[r];n?e[r]=n(t[r],t):e[r]=t[r]}return e}downloadData(t="BIM Table Data",e="json"){let r=null;if(e==="json"&&(r=new File([JSON.stringify(this.value,void 0,2)],`${t}.json`)),e==="csv"&&(r=new File([this.csv],`${t}.csv`)),e==="tsv"&&(r=new File([this.tsv],`${t}.tsv`)),!r)return;const n=document.createElement("a");n.href=URL.createObjectURL(r),n.download=r.name,n.click(),URL.revokeObjectURL(n.href)}getRowIndentation(t,e=this.value,r=0){for(const n of e){if(n.data===t)return r;if(n.children){const o=this.getRowIndentation(t,n.children,r+1);if(o!==null)return o}}return null}getGroupIndentation(t,e=this.value,r=0){for(const n of e){if(n===t)return r;if(n.children){const o=this.getGroupIndentation(t,n.children,r+1);if(o!==null)return o}}return null}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new Event("connected"))}disconnectedCallback(){super.disconnectedCallback(),this.dispatchEvent(new Event("disconnected"))}async loadData(t=!1){if(this._filteredData.length!==0&&!t||!this.loadFunction)return!1;this.loading=!0;try{const e=await this.loadFunction();return this.data=e,this.loading=!1,this._errorLoading=!1,!0}catch(e){return this.loading=!1,this._filteredData.length!==0||(e instanceof Error&&this.loadingErrorElement&&e.message.trim()!==""&&(this.loadingErrorElement.textContent=e.message),this._errorLoading=!0),!1}}filter(t,e=this.filterFunction??this._stringFilterFunction,r=this.data){const n=[];for(const o of r)if(e(t,o)){if(this.preserveStructureOnFilter){const s={data:o.data};if(o.children){const l=this.filter(t,e,o.children);l.length&&(s.children=l)}n.push(s)}else if(n.push({data:o.data}),o.children){const s=this.filter(t,e,o.children);n.push(...s)}}else if(o.children){const s=this.filter(t,e,o.children);this.preserveStructureOnFilter&&s.length?n.push({data:o.data,children:s}):n.push(...s)}return n}get _missingDataElement(){return this.querySelector("[slot='missing-data']")}render(){if(this.loading)return vl();if(this._errorLoading)return f``;if(this._filteredData.length===0&&this._missingDataElement)return f``;const t=document.createElement("bim-table-row");t.table=this,t.isHeader=!0,t.data=this._headerRowData,t.style.gridArea="Header",t.style.position="sticky",t.style.top="0",t.style.zIndex="5";const e=document.createElement("bim-table-children");return e.table=this,e.data=this.value,e.style.gridArea="Body",e.style.backgroundColor="transparent",f` + `;let vt=ko;Nt([h({type:Boolean,reflect:!0})],vt.prototype,"selected");Nt([h({attribute:!1})],vt.prototype,"columns");Nt([h({attribute:!1})],vt.prototype,"hiddenColumns");Nt([h({attribute:!1})],vt.prototype,"data");Nt([h({type:Boolean,attribute:"is-header",reflect:!0})],vt.prototype,"isHeader");Nt([Lt()],vt.prototype,"_intersecting");var Al=Object.defineProperty,Ol=Object.getOwnPropertyDescriptor,U=(i,t,e,o)=>{for(var n=o>1?void 0:o?Ol(t,e):t,r=i.length-1,s;r>=0;r--)(s=i[r])&&(n=(o?s(t,e,n):s(n))||n);return o&&n&&Al(t,e,n),n};const So=class extends w{constructor(){super(...arguments),this._columnsChange=new Event("columnschange"),this._filteredData=[],this.headersHidden=!1,this.minColWidth="4rem",this._columns=[],this._textDelimiters={comma:",",tab:" "},this._queryString=null,this._data=[],this.expanded=!1,this.preserveStructureOnFilter=!1,this.indentationInText=!1,this.dataTransform={},this.selectableRows=!1,this.selection=new Set,this.noIndentation=!1,this.loading=!1,this._errorLoading=!1,this._onColumnsHidden=new Event("columnshidden"),this._hiddenColumns=[],this.loadingErrorElement=null,this._stringFilterFunction=(t,e)=>Object.values(e.data).some(o=>String(o).toLowerCase().includes(t.toLowerCase())),this._queryFilterFunction=(t,e)=>{let o=!1;const n=ri(t)??[];for(const r of n){if("queries"in r){o=!1;break}const{condition:s,value:l}=r;let{key:a}=r;if(a.startsWith("[")&&a.endsWith("]")){const c=a.replace("[","").replace("]","");a=c,o=Object.keys(e.data).filter(d=>d.includes(c)).map(d=>ln(e.data[d],s,l)).some(d=>d)}else o=ln(e.data[a],s,l);if(!o)break}return o}}set columns(t){const e=[];for(const o of t){const n=typeof o=="string"?{name:o,width:`minmax(${this.minColWidth}, 1fr)`}:o;e.push(n)}this._columns=e,this.computeMissingColumns(this.data),this.dispatchEvent(this._columnsChange)}get columns(){return this._columns}get _headerRowData(){const t={};for(const e of this.columns)if(typeof e=="string")t[e]=e;else{const{name:o}=e;t[o]=o}return t}get value(){return this._filteredData}set queryString(t){this.toggleAttribute("data-processing",!0),this._queryString=t&&t.trim()!==""?t.trim():null,this.updateFilteredData(),this.toggleAttribute("data-processing",!1)}get queryString(){return this._queryString}set data(t){this._data=t,this.updateFilteredData(),this.computeMissingColumns(t)&&(this.columns=this._columns)}get data(){return this._data}get dataAsync(){return new Promise(t=>{setTimeout(()=>{t(this.data)})})}set hiddenColumns(t){this._hiddenColumns=t,setTimeout(()=>{this.dispatchEvent(this._onColumnsHidden)})}get hiddenColumns(){return this._hiddenColumns}updateFilteredData(){this.queryString?(ri(this.queryString)?(this.filterFunction=this._queryFilterFunction,this._filteredData=this.filter(this.queryString)):(this.filterFunction=this._stringFilterFunction,this._filteredData=this.filter(this.queryString)),this.preserveStructureOnFilter&&(this._expandedBeforeFilter===void 0&&(this._expandedBeforeFilter=this.expanded),this.expanded=!0)):(this.preserveStructureOnFilter&&this._expandedBeforeFilter!==void 0&&(this.expanded=this._expandedBeforeFilter,this._expandedBeforeFilter=void 0),this._filteredData=this.data)}computeMissingColumns(t){let e=!1;for(const o of t){const{children:n,data:r}=o;for(const s in r)this._columns.map(l=>typeof l=="string"?l:l.name).includes(s)||(this._columns.push({name:s,width:`minmax(${this.minColWidth}, 1fr)`}),e=!0);if(n){const s=this.computeMissingColumns(n);s&&!e&&(e=s)}}return e}generateText(t="comma",e=this.value,o="",n=!0){const r=this._textDelimiters[t];let s="";const l=this.columns.map(a=>a.name);if(n){this.indentationInText&&(s+=`Indentation${r}`);const a=`${l.join(r)} +`;s+=a}for(const[a,c]of e.entries()){const{data:d,children:u}=c,p=this.indentationInText?`${o}${a+1}${r}`:"",b=l.map(v=>d[v]??""),m=`${p}${b.join(r)} +`;s+=m,u&&(s+=this.generateText(t,c.children,`${o}${a+1}.`,!1))}return s}get csv(){return this.generateText("comma")}get tsv(){return this.generateText("tab")}applyDataTransform(t){const e={};for(const o of Object.keys(this.dataTransform)){const n=this.columns.find(r=>r.name===o);n&&n.forceDataTransform&&(o in t||(t[o]=""))}for(const o in t){const n=this.dataTransform[o];n?e[o]=n(t[o],t):e[o]=t[o]}return e}downloadData(t="BIM Table Data",e="json"){let o=null;if(e==="json"&&(o=new File([JSON.stringify(this.value,void 0,2)],`${t}.json`)),e==="csv"&&(o=new File([this.csv],`${t}.csv`)),e==="tsv"&&(o=new File([this.tsv],`${t}.tsv`)),!o)return;const n=document.createElement("a");n.href=URL.createObjectURL(o),n.download=o.name,n.click(),URL.revokeObjectURL(n.href)}getRowIndentation(t,e=this.value,o=0){for(const n of e){if(n.data===t)return o;if(n.children){const r=this.getRowIndentation(t,n.children,o+1);if(r!==null)return r}}return null}getGroupIndentation(t,e=this.value,o=0){for(const n of e){if(n===t)return o;if(n.children){const r=this.getGroupIndentation(t,n.children,o+1);if(r!==null)return r}}return null}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new Event("connected"))}disconnectedCallback(){super.disconnectedCallback(),this.dispatchEvent(new Event("disconnected"))}async loadData(t=!1){if(this._filteredData.length!==0&&!t||!this.loadFunction)return!1;this.loading=!0;try{const e=await this.loadFunction();return this.data=e,this.loading=!1,this._errorLoading=!1,!0}catch(e){return this.loading=!1,this._filteredData.length!==0||(e instanceof Error&&this.loadingErrorElement&&e.message.trim()!==""&&(this.loadingErrorElement.textContent=e.message),this._errorLoading=!0),!1}}filter(t,e=this.filterFunction??this._stringFilterFunction,o=this.data){const n=[];for(const r of o)if(e(t,r)){if(this.preserveStructureOnFilter){const s={data:r.data};if(r.children){const l=this.filter(t,e,r.children);l.length&&(s.children=l)}n.push(s)}else if(n.push({data:r.data}),r.children){const s=this.filter(t,e,r.children);n.push(...s)}}else if(r.children){const s=this.filter(t,e,r.children);this.preserveStructureOnFilter&&s.length?n.push({data:r.data,children:s}):n.push(...s)}return n}get _missingDataElement(){return this.querySelector("[slot='missing-data']")}render(){if(this.loading)return yl();if(this._errorLoading)return f``;if(this._filteredData.length===0&&this._missingDataElement)return f``;const t=document.createElement("bim-table-row");t.table=this,t.isHeader=!0,t.data=this._headerRowData,t.style.gridArea="Header",t.style.position="sticky",t.style.top="0",t.style.zIndex="5";const e=document.createElement("bim-table-children");return e.table=this,e.data=this.value,e.style.gridArea="Body",e.style.backgroundColor="transparent",f`
- ${this.headersHidden?null:t} ${yl()} + ${this.headersHidden?null:t} ${_l()}
${e}
- `}};Er.styles=[lt.scrollbar,E` + `}};So.styles=[lt.scrollbar,E` :host { position: relative; overflow: auto; @@ -1404,7 +1416,7 @@ var Mr=Object.defineProperty,Rr=(i,t,e)=>t in i?Mr(i,t,{enumerable:!0,configurab flex-wrap: wrap; margin-bottom: 0.5rem; } - `];let N=Er;U([Lt()],N.prototype,"_filteredData",2);U([h({type:Boolean,attribute:"headers-hidden",reflect:!0})],N.prototype,"headersHidden",2);U([h({type:String,attribute:"min-col-width",reflect:!0})],N.prototype,"minColWidth",2);U([h({type:Array,attribute:!1})],N.prototype,"columns",1);U([h({type:Array,attribute:!1})],N.prototype,"data",1);U([h({type:Boolean,reflect:!0})],N.prototype,"expanded",2);U([h({type:Boolean,reflect:!0,attribute:"selectable-rows"})],N.prototype,"selectableRows",2);U([h({attribute:!1})],N.prototype,"selection",2);U([h({type:Boolean,attribute:"no-indentation",reflect:!0})],N.prototype,"noIndentation",2);U([h({type:Boolean,reflect:!0})],N.prototype,"loading",2);U([Lt()],N.prototype,"_errorLoading",2);var Ol=Object.defineProperty,Tl=Object.getOwnPropertyDescriptor,Me=(i,t,e,r)=>{for(var n=r>1?void 0:r?Tl(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&Ol(t,e,n),n};const Cr=class extends w{constructor(){super(...arguments),this._defaultName="__unnamed__",this.name=this._defaultName,this._hidden=!1}set hidden(t){this._hidden=t,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}connectedCallback(){super.connectedCallback();const{parentElement:t}=this;if(t&&this.name===this._defaultName){const e=[...t.children].indexOf(this);this.name=`${this._defaultName}${e}`}}render(){return f` `}};Cr.styles=E` + `];let I=So;U([Lt()],I.prototype,"_filteredData",2);U([h({type:Boolean,attribute:"headers-hidden",reflect:!0})],I.prototype,"headersHidden",2);U([h({type:String,attribute:"min-col-width",reflect:!0})],I.prototype,"minColWidth",2);U([h({type:Array,attribute:!1})],I.prototype,"columns",1);U([h({type:Array,attribute:!1})],I.prototype,"data",1);U([h({type:Boolean,reflect:!0})],I.prototype,"expanded",2);U([h({type:Boolean,reflect:!0,attribute:"selectable-rows"})],I.prototype,"selectableRows",2);U([h({attribute:!1})],I.prototype,"selection",2);U([h({type:Boolean,attribute:"no-indentation",reflect:!0})],I.prototype,"noIndentation",2);U([h({type:Boolean,reflect:!0})],I.prototype,"loading",2);U([Lt()],I.prototype,"_errorLoading",2);var Tl=Object.defineProperty,zl=Object.getOwnPropertyDescriptor,Re=(i,t,e,o)=>{for(var n=o>1?void 0:o?zl(t,e):t,r=i.length-1,s;r>=0;r--)(s=i[r])&&(n=(o?s(t,e,n):s(n))||n);return o&&n&&Tl(t,e,n),n};const Ao=class extends w{constructor(){super(...arguments),this._defaultName="__unnamed__",this.name=this._defaultName,this._hidden=!1}set hidden(t){this._hidden=t,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}connectedCallback(){super.connectedCallback();const{parentElement:t}=this;if(t&&this.name===this._defaultName){const e=[...t.children].indexOf(this);this.name=`${this._defaultName}${e}`}}render(){return f` `}};Ao.styles=E` :host { display: block; height: 100%; @@ -1413,14 +1425,14 @@ var Mr=Object.defineProperty,Rr=(i,t,e)=>t in i?Mr(i,t,{enumerable:!0,configurab :host([hidden]) { display: none; } - `;let M=Cr;Me([h({type:String,reflect:!0})],M.prototype,"name",2);Me([h({type:String,reflect:!0})],M.prototype,"label",2);Me([h({type:String,reflect:!0})],M.prototype,"icon",2);Me([h({type:Boolean,reflect:!0})],M.prototype,"hidden",1);var zl=Object.defineProperty,Pl=Object.getOwnPropertyDescriptor,Ft=(i,t,e,r)=>{for(var n=r>1?void 0:r?Pl(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&zl(t,e,n),n};const kr=class extends w{constructor(){super(...arguments),this._switchers=[],this.bottom=!1,this.switchersHidden=!1,this.floating=!1,this.switchersFull=!1,this.onTabHiddenChange=t=>{const e=t.target;e instanceof M&&!e.hidden&&(e.removeEventListener("hiddenchange",this.onTabHiddenChange),this.tab=e.name,e.addEventListener("hiddenchange",this.onTabHiddenChange))}}set tab(t){this._tab=t;const e=[...this.children],r=e.find(n=>n instanceof M&&n.name===t);for(const n of e){if(!(n instanceof M))continue;n.hidden=r!==n;const o=this.getTabSwitcher(n.name);o&&o.toggleAttribute("data-active",!n.hidden)}}get tab(){return this._tab}getTabSwitcher(t){return this._switchers.find(e=>e.getAttribute("data-name")===t)}createSwitchers(){this._switchers=[];for(const t of this.children){if(!(t instanceof M))continue;const e=document.createElement("div");e.addEventListener("click",()=>{this.tab===t.name?this.toggleAttribute("tab",!1):this.tab=t.name}),e.setAttribute("data-name",t.name),e.className="switcher";const r=document.createElement("bim-label");r.textContent=t.label??"",r.icon=t.icon,e.append(r),this._switchers.push(e)}}onSlotChange(t){this.createSwitchers();const e=t.target.assignedElements(),r=e.find(n=>n instanceof M?this.tab?n.name===this.tab:!n.hidden:!1);r&&r instanceof M&&(this.tab=r.name);for(const n of e){if(!(n instanceof M)){n.remove();continue}n.removeEventListener("hiddenchange",this.onTabHiddenChange),r!==n&&(n.hidden=!0),n.addEventListener("hiddenchange",this.onTabHiddenChange)}}render(){return f` + `;let M=Ao;Re([h({type:String,reflect:!0})],M.prototype,"name",2);Re([h({type:String,reflect:!0})],M.prototype,"label",2);Re([h({type:String,reflect:!0})],M.prototype,"icon",2);Re([h({type:Boolean,reflect:!0})],M.prototype,"hidden",1);var jl=Object.defineProperty,Pl=Object.getOwnPropertyDescriptor,Ft=(i,t,e,o)=>{for(var n=o>1?void 0:o?Pl(t,e):t,r=i.length-1,s;r>=0;r--)(s=i[r])&&(n=(o?s(t,e,n):s(n))||n);return o&&n&&jl(t,e,n),n};const Oo=class extends w{constructor(){super(...arguments),this._switchers=[],this.bottom=!1,this.switchersHidden=!1,this.floating=!1,this.switchersFull=!1,this.onTabHiddenChange=t=>{const e=t.target;e instanceof M&&!e.hidden&&(e.removeEventListener("hiddenchange",this.onTabHiddenChange),this.tab=e.name,e.addEventListener("hiddenchange",this.onTabHiddenChange))}}set tab(t){this._tab=t;const e=[...this.children],o=e.find(n=>n instanceof M&&n.name===t);for(const n of e){if(!(n instanceof M))continue;n.hidden=o!==n;const r=this.getTabSwitcher(n.name);r&&r.toggleAttribute("data-active",!n.hidden)}}get tab(){return this._tab}getTabSwitcher(t){return this._switchers.find(e=>e.getAttribute("data-name")===t)}createSwitchers(){this._switchers=[];for(const t of this.children){if(!(t instanceof M))continue;const e=document.createElement("div");e.addEventListener("click",()=>{this.tab===t.name?this.toggleAttribute("tab",!1):this.tab=t.name}),e.setAttribute("data-name",t.name),e.className="switcher";const o=document.createElement("bim-label");o.textContent=t.label??"",o.icon=t.icon,e.append(o),this._switchers.push(e)}}onSlotChange(t){this.createSwitchers();const e=t.target.assignedElements(),o=e.find(n=>n instanceof M?this.tab?n.name===this.tab:!n.hidden:!1);o&&o instanceof M&&(this.tab=o.name);for(const n of e){if(!(n instanceof M)){n.remove();continue}n.removeEventListener("hiddenchange",this.onTabHiddenChange),o!==n&&(n.hidden=!0),n.addEventListener("hiddenchange",this.onTabHiddenChange)}}render(){return f`
${this._switchers}
- `}};kr.styles=[lt.scrollbar,E` + `}};Oo.styles=[lt.scrollbar,E` * { box-sizing: border-box; } @@ -1531,11 +1543,11 @@ var Mr=Object.defineProperty,Rr=(i,t,e)=>t in i?Mr(i,t,{enumerable:!0,configurab border-radius: var(--bim-ui_size-2xs); background-color: var(--bim-ui_bg-base); } - `];let yt=kr;Ft([Lt()],yt.prototype,"_switchers",2);Ft([h({type:Boolean,reflect:!0})],yt.prototype,"bottom",2);Ft([h({type:Boolean,attribute:"switchers-hidden",reflect:!0})],yt.prototype,"switchersHidden",2);Ft([h({type:Boolean,reflect:!0})],yt.prototype,"floating",2);Ft([h({type:String,reflect:!0})],yt.prototype,"tab",1);Ft([h({type:Boolean,attribute:"switchers-full",reflect:!0})],yt.prototype,"switchersFull",2);/** + `];let yt=Oo;Ft([Lt()],yt.prototype,"_switchers",2);Ft([h({type:Boolean,reflect:!0})],yt.prototype,"bottom",2);Ft([h({type:Boolean,attribute:"switchers-hidden",reflect:!0})],yt.prototype,"switchersHidden",2);Ft([h({type:Boolean,reflect:!0})],yt.prototype,"floating",2);Ft([h({type:String,reflect:!0})],yt.prototype,"tab",1);Ft([h({type:Boolean,attribute:"switchers-full",reflect:!0})],yt.prototype,"switchersFull",2);/** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const sn=i=>i??A;var jl=Object.defineProperty,Ll=Object.getOwnPropertyDescriptor,K=(i,t,e,r)=>{for(var n=r>1?void 0:r?Ll(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&jl(t,e,n),n};const Sr=class extends w{constructor(){super(...arguments),this._inputTypes=["date","datetime-local","email","month","password","search","tel","text","time","url","week","area"],this.value="",this.vertical=!1,this._type="text",this.onValueChange=new Event("input")}set type(t){this._inputTypes.includes(t)&&(this._type=t)}get type(){return this._type}get query(){return ni(this.value)}onInputChange(t){t.stopPropagation();const e=t.target;clearTimeout(this._debounceTimeoutID),this._debounceTimeoutID=setTimeout(()=>{this.value=e.value,this.dispatchEvent(this.onValueChange)},this.debounce)}focus(){setTimeout(()=>{var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("input");e==null||e.focus()})}render(){return f` + */const an=i=>i??A;var Ll=Object.defineProperty,Ml=Object.getOwnPropertyDescriptor,K=(i,t,e,o)=>{for(var n=o>1?void 0:o?Ml(t,e):t,r=i.length-1,s;r>=0;r--)(s=i[r])&&(n=(o?s(t,e,n):s(n))||n);return o&&n&&Ll(t,e,n),n};const To=class extends w{constructor(){super(...arguments),this._inputTypes=["date","datetime-local","email","month","password","search","tel","text","time","url","week","area"],this.value="",this.vertical=!1,this._type="text",this.onValueChange=new Event("input")}set type(t){this._inputTypes.includes(t)&&(this._type=t)}get type(){return this._type}get query(){return ri(this.value)}onInputChange(t){t.stopPropagation();const e=t.target;clearTimeout(this._debounceTimeoutID),this._debounceTimeoutID=setTimeout(()=>{this.value=e.value,this.dispatchEvent(this.onValueChange)},this.debounce)}focus(){setTimeout(()=>{var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("input");e==null||e.focus()})}render(){return f` t in i?Mr(i,t,{enumerable:!0,configurab aria-label=${this.label||this.name||"Text Input"} .value=${this.value} .rows=${this.rows??5} - placeholder=${sn(this.placeholder)} + placeholder=${an(this.placeholder)} @input=${this.onInputChange} >`:f` `} - `}};Sr.styles=[lt.scrollbar,E` + `}};To.styles=[lt.scrollbar,E` :host { --bim-input--bgc: var(--bim-ui_bg-contrast-20); flex: 1; @@ -1592,7 +1604,7 @@ var Mr=Object.defineProperty,Rr=(i,t,e)=>t in i?Mr(i,t,{enumerable:!0,configurab /* :host([disabled]) { --bim-input--bgc: var(--bim-ui_bg-contrast-20); } */ - `];let Q=Sr;K([h({type:String,reflect:!0})],Q.prototype,"icon",2);K([h({type:String,reflect:!0})],Q.prototype,"label",2);K([h({type:String,reflect:!0})],Q.prototype,"name",2);K([h({type:String,reflect:!0})],Q.prototype,"placeholder",2);K([h({type:String,reflect:!0})],Q.prototype,"value",2);K([h({type:Boolean,reflect:!0})],Q.prototype,"vertical",2);K([h({type:Number,reflect:!0})],Q.prototype,"debounce",2);K([h({type:Number,reflect:!0})],Q.prototype,"rows",2);K([h({type:String,reflect:!0})],Q.prototype,"type",1);var Ml=Object.defineProperty,Rl=Object.getOwnPropertyDescriptor,Ar=(i,t,e,r)=>{for(var n=r>1?void 0:r?Rl(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&Ml(t,e,n),n};const Or=class extends w{constructor(){super(...arguments),this.rows=2,this._vertical=!1}set vertical(t){this._vertical=t,this.updateChildren()}get vertical(){return this._vertical}updateChildren(){const t=this.children;for(const e of t)this.vertical?e.setAttribute("label-hidden",""):e.removeAttribute("label-hidden")}render(){return f` + `];let G=To;K([h({type:String,reflect:!0})],G.prototype,"icon",2);K([h({type:String,reflect:!0})],G.prototype,"label",2);K([h({type:String,reflect:!0})],G.prototype,"name",2);K([h({type:String,reflect:!0})],G.prototype,"placeholder",2);K([h({type:String,reflect:!0})],G.prototype,"value",2);K([h({type:Boolean,reflect:!0})],G.prototype,"vertical",2);K([h({type:Number,reflect:!0})],G.prototype,"debounce",2);K([h({type:Number,reflect:!0})],G.prototype,"rows",2);K([h({type:String,reflect:!0})],G.prototype,"type",1);var Rl=Object.defineProperty,Bl=Object.getOwnPropertyDescriptor,zo=(i,t,e,o)=>{for(var n=o>1?void 0:o?Bl(t,e):t,r=i.length-1,s;r>=0;r--)(s=i[r])&&(n=(o?s(t,e,n):s(n))||n);return o&&n&&Rl(t,e,n),n};const jo=class extends w{constructor(){super(...arguments),this.rows=2,this._vertical=!1}set vertical(t){this._vertical=t,this.updateChildren()}get vertical(){return this._vertical}updateChildren(){const t=this.children;for(const e of t)this.vertical?e.setAttribute("label-hidden",""):e.removeAttribute("label-hidden")}render(){return f` + + + +
+ + + + \ No newline at end of file diff --git a/packages/core/src/ifc/IfcFinder/example.ts b/packages/core/src/ifc/IfcFinder/example.ts new file mode 100644 index 000000000..d7a2bd295 --- /dev/null +++ b/packages/core/src/ifc/IfcFinder/example.ts @@ -0,0 +1,268 @@ +/* MD +### 🏢 Loading IFC files +--- + +IFC is complex, and sometimes we want to look for items using complex filters. For instance, imagine we want to target all items in a file that have a property called "FireProtection". This is due to the indirection present in most IFC files. Luckily for you, we have a component to easily perform complex queries on any IFC: the IfcFinder. In this tutorial, you'll learn how to use it. + +:::tip What does the finder do? + +The finder is a powerful text scanner that can make complex queries in one or multiple IFC files. You can use regular expressions, operators like ">", "<", combine multiple filters, etc. + +::: + +In this tutorial, we will import: + +- `@thatopen/ui` to add some simple and cool UI menus. +- `@thatopen/components` to set up the barebone of our app. +- `Stats.js` (optional) to measure the performance of our app. +*/ + +import * as BUI from "@thatopen/ui"; +import Stats from "stats.js"; +import * as OBC from "@thatopen/components"; + +/* MD + ### 🌎 Setting up a simple scene + --- + + We will start by creating a simple scene with a camera and a renderer. If you don't know how to set up a scene, you can check the Worlds tutorial. +*/ + +const container = document.getElementById("container")!; + +const components = new OBC.Components(); + +const worlds = components.get(OBC.Worlds); + +const world = worlds.create< + OBC.SimpleScene, + OBC.SimpleCamera, + OBC.SimpleRenderer +>(); + +world.scene = new OBC.SimpleScene(components); +world.renderer = new OBC.SimpleRenderer(components, container); +world.camera = new OBC.SimpleCamera(components); + +components.init(); + +world.camera.controls.setLookAt(12, 6, 8, 0, 0, -10); + +world.scene.setup(); + +const grids = components.get(OBC.Grids); +grids.create(world); + +/* MD + + We'll make the background of the scene transparent so that it looks good in our docs page, but you don't have to do that in your app! + +*/ + +world.scene.three.background = null; + +/* MD + ### 🧳 Loading a BIM model + --- + + We'll start by adding a BIM model to our scene. That model is already converted to fragments, so it will load much faster than if we loaded the IFC fileResponse. + + :::tip Fragments? + + If you are not familiar with fragments, check out the IfcLoader tutorial! + + ::: +*/ + +const fragments = new OBC.FragmentsManager(components); +const fragFile = await fetch( + "https://thatopen.github.io/engine_components/resources/small.frag", +); +const data = await fragFile.arrayBuffer(); +const buffer = new Uint8Array(data); +const model = fragments.load(buffer); +world.scene.three.add(model); + +const indexer = components.get(OBC.IfcRelationsIndexer); +const relationsFile = await fetch( + "https://thatopen.github.io/engine_components/resources/small-relations.json", +); +const relations = indexer.getRelationsMapFromJSON(await relationsFile.text()); +indexer.setRelationMap(model, relations); + +/* MD + ### 🔎 Setting up the finder + --- + + Now, let's get the finder component and create a new queryGroup. A query group is a set of "questions" we can apply to one or many models. +*/ + +const finder = components.get(OBC.IfcFinder); +const queryGroup = finder.create(); + +/* MD + Now we need an IFC file to feed to the finder. The finder operates on IFC files directly, so it can perform high-performance text queries. +*/ + +const fileResponse = await fetch( + "https://thatopen.github.io/engine_components/resources/small.ifc", +); +const ifcFile = new File([await fileResponse.arrayBuffer()], "example"); + +/* MD + Great! Now, let's create our first query. There are different types of queries. You'll have to pick one or another depending on the type of data you are looking for. In this case we want to check the direct attributes of elements, so we will use an IfcBasicQuery. +*/ + +const basicQuery = new OBC.IfcBasicQuery(components, { + name: "category", + inclusive: false, + rules: [], +}); + +queryGroup.add(basicQuery); + +/* MD + Great job! Now we have a query, but it's empty. Queries are made of rules. There are rules of different types for different purposes. In this case we want to filter the walls, so let's a +*/ + +const categoryRule: OBC.IfcCategoryRule = { + type: "category", + value: /IfcWallStandardCase/, +}; + +basicQuery.rules.push(categoryRule); + +/* MD + Awesome! Now, our library has better ways to filter by category, so what's the point of the finder? Well, let's make something a bit more complex. Imagine we want to look for any object that has any property (in a pset) with the word "yeso" (plaster in spanish). We can do this easily with the finder using another type of query: a property query. +*/ + +const propertyRule: OBC.IfcPropertyRule = { + type: "property", + name: /.*/, + value: /yeso/, +}; + +const propertyQuery = new OBC.IfcPropertyQuery(components, { + name: "property", + inclusive: false, + rules: [propertyRule], +}); + +queryGroup.add(propertyQuery); + +/* MD + Great! Now, to perform the query we just need to update the group, and we can then get the items resulting from all the queries of the query group. To illustrate this, we'll isolate the found items in the scene: +*/ + +await queryGroup.update(model.uuid, ifcFile); +const items = queryGroup.items; + +const hider = components.get(OBC.Hider); +hider.set(false); +hider.set(true, items); + +/* MD + ### ⏱️ Measuring the performance (optional) + --- + + We'll use the [Stats.js](https://github.com/mrdoob/stats.js) to measure the performance of our app. We will add it to the top left corner of the viewport. This way, we'll make sure that the memory consumption and the FPS of our app are under control. +*/ + +const stats = new Stats(); +stats.showPanel(2); +document.body.append(stats.dom); +stats.dom.style.left = "0px"; +stats.dom.style.zIndex = "unset"; +world.renderer.onBeforeUpdate.add(() => stats.begin()); +world.renderer.onAfterUpdate.add(() => stats.end()); + +/* MD + ### 🧩 Adding some UI + --- + + We will use the `@thatopen/ui` library to add some simple and cool UI elements to our app. First, we need to call the `init` method of the `BUI.Manager` class to initialize the library: +*/ + +BUI.Manager.init(); + +/* MD +Now we will add some UI to play around with the Finder, isolating the items that it finds in the scene. For more information about the UI library, you can check the specific documentation for it! +*/ + +const categoryInput = BUI.Component.create(() => { + return BUI.html` + + `; +}); + +const propertyInput = BUI.Component.create(() => { + return BUI.html` + + `; +}); + +const updateFinder = async () => { + basicQuery.clear(); + propertyQuery.clear(); + categoryRule.value = new RegExp(categoryInput.value); + propertyRule.value = new RegExp(propertyInput.value); + await queryGroup.update(model.uuid, ifcFile); + const items = queryGroup.items; + console.log(items); + if (Object.keys(items).length === 0) { + alert("No items found!"); + return; + } + hider.set(false); + hider.set(true, items); +}; + +const panel = BUI.Component.create(() => { + return BUI.html` + + + + + ${categoryInput} + ${propertyInput} + + + + + + + + `; +}); + +document.body.append(panel); + +/* MD + And we will make some logic that adds a button to the screen when the user is visiting our app from their phone, allowing to show or hide the menu. Otherwise, the menu would make the app unusable. +*/ + +const button = BUI.Component.create(() => { + return BUI.html` + + + `; +}); + +document.body.append(button); + +/* MD + ### 🎉 Wrap up + --- + + That's it! You have created an app that can make complex text queries in an IFC. Congratulations! +*/ diff --git a/packages/core/src/ifc/IfcFinder/index.ts b/packages/core/src/ifc/IfcFinder/index.ts new file mode 100644 index 000000000..1a787ed20 --- /dev/null +++ b/packages/core/src/ifc/IfcFinder/index.ts @@ -0,0 +1,89 @@ +import { Component, Components } from "../../core"; +import { IfcQueryGroup } from "./src/ifc-query-group"; +import { IfcFinderQuery } from "./src"; + +export * from "./src"; + +/** + * Component to make text queries in the IFC. + */ +export class IfcFinder extends Component { + /** + * A unique identifier for the component. + * This UUID is used to register the component within the Components system. + */ + static readonly uuid = "0da7ad77-f734-42ca-942f-a074adfd1e3a" as const; + + /** {@link Component.enabled} */ + enabled = true; + + /** + * List of all created {@link IfcQueryGroup} instances. + */ + list = new Map(); + + /** + * List of all queries from all created {@link IfcQueryGroup} instances. + */ + get queries() { + // return list of all queries traversing all groups + const queries = new Set(); + for (const [, group] of this.list) { + for (const query of group.queries) { + queries.add(query); + } + } + return queries; + } + + constructor(components: Components) { + super(components); + components.add(IfcFinder.uuid, this); + } + + /** + * Imports all the query groups provided in the given data. You can generate this data to save the result of queries and persist it over time. + * @param data The data containing the serialized query groups to import. + */ + import(data: { [groupID: string]: any }) { + for (const id in data) { + const group = new IfcQueryGroup(this.components); + group.import(data[id]); + this.list.set(id, group); + } + } + + /** + * Exports all the query groups created. You can then import this data back using the import method. + */ + export() { + const result: { [groupID: string]: any } = {}; + for (const [id, group] of this.list) { + result[id] = group.export(); + } + return result; + } + + /** + * Creates a new {@link IfcQueryGroup}. + */ + create() { + const group = new IfcQueryGroup(this.components); + this.list.set(group.id, group); + return group; + } + + /** + * Creates the {@link IfcQueryGroup} with the given ID. + */ + delete(id: string) { + this.list.delete(id); + } + + /** + * Deletes all {@link IfcQueryGroup} instances. + */ + clear() { + this.list.clear(); + } +} diff --git a/packages/core/src/ifc/IfcFinder/src/ifc-basic-query.ts b/packages/core/src/ifc/IfcFinder/src/ifc-basic-query.ts new file mode 100644 index 000000000..38be52535 --- /dev/null +++ b/packages/core/src/ifc/IfcFinder/src/ifc-basic-query.ts @@ -0,0 +1,94 @@ +import * as FRAGS from "@thatopen/fragments"; +import { IfcFinderRule, SerializedQuery } from "./types"; +import { IfcFinderQuery } from "./ifc-finder-query"; +import { Components } from "../../../core"; +import { FragmentsManager } from "../../../fragments"; + +/** + * A query that checks the direct attributes of IFC items. + */ +export class IfcBasicQuery extends IfcFinderQuery { + /** + * {@link IfcFinderQuery.name} + */ + name: string; + + /** + * The type of this query. + */ + static type = "IfcBasicQuery" as const; + + /** + * {@link IfcFinderQuery.items} + */ + get items() { + const fragments = this.components.get(FragmentsManager); + const maps: FRAGS.FragmentIdMap[] = []; + for (const modelID in this.ids) { + const ids = this.ids[modelID]; + const found = fragments.groups.get(modelID); + if (!found) { + console.warn(`Model ${modelID} not found!`); + continue; + } + const map = found.getFragmentMap(ids); + maps.push(map); + } + return FRAGS.FragmentUtils.combine(maps); + } + + constructor( + components: Components, + data: { + name: string; + rules: IfcFinderRule[]; + inclusive: boolean; + }, + ) { + super(components); + this.name = data.name; + this.rules = data.rules; + this.inclusive = data.inclusive; + } + + /** + * {@link IfcFinderQuery.export} + */ + export() { + const data = this.getData(); + data.type = IfcBasicQuery.type; + return data; + } + + /** + * {@link IfcFinderQuery.update} + */ + async update(modelID: string, file: File) { + this.ids[modelID] = new Set(); + await this.findInFile(modelID, file); + this.needsUpdate.set(modelID, false); + } + + protected findInLines(modelID: string, lines: string[]) { + for (const line of lines) { + const filtersPass = this.testRules(line); + if (filtersPass) { + const id = this.getIdFromLine(line); + this.addID(modelID, id); + } + } + } +} + +IfcFinderQuery.importers.set( + IfcBasicQuery.type, + (components: Components, data: SerializedQuery) => { + const query = new IfcBasicQuery(components, { + name: data.name, + rules: IfcFinderQuery.importRules(data.rules), + inclusive: data.inclusive, + }); + query.ids = IfcFinderQuery.importIds(data); + return query; + }, +); diff --git a/packages/core/src/ifc/IfcFinder/src/ifc-finder-query.ts b/packages/core/src/ifc/IfcFinder/src/ifc-finder-query.ts new file mode 100644 index 000000000..11c8a35cc --- /dev/null +++ b/packages/core/src/ifc/IfcFinder/src/ifc-finder-query.ts @@ -0,0 +1,416 @@ +import * as FRAGS from "@thatopen/fragments"; +import * as WEBIFC from "web-ifc"; +import { ifcCategoryCase } from "../../Utils"; +import { IfcFinderRule, SerializedQuery } from "./types"; +import { Components, Event } from "../../../core"; + +/** + * The base class for all queries used by the {@link IfcFinder}. + */ +export abstract class IfcFinderQuery { + /** + * The list of functions to import the queries. If you create your own custom query, you should add its importer here. See the other queries provided by the library for reference. + */ + static importers = new Map< + string, + (components: Components, data: any) => IfcFinderQuery + >(); + + /** + * Event used to notify the progress when performing a query on an IFC file. + */ + readonly onProgress = new Event(); + + /** + * A name given to the instance of the query to identify it. + */ + abstract name: string; + + /** + * The list of IFC items that this query found across all models. + */ + abstract items: FRAGS.FragmentIdMap; + + /** + * If false, ALL rules of the query must comply to make a match. If true, ANY rule will be enough to make a match. + */ + inclusive = false; + + /** + * The list of rules to be applied by this query. + */ + rules: IfcFinderRule[] = []; + + /** + * The IDs of the match items per model. + */ + ids: { [modelID: string]: Set } = {}; + + /** + * Whether this query is up to date or not per file. If not, when updating the group where it belongs, it will re-process the given file. + */ + needsUpdate = new Map(); + + /** + * Export the current data of this query in a serializable object to persist it over time. + */ + abstract export(): { [key: string]: any }; + + /** + * Perform the search in the given file and save the result. + */ + abstract update(modelID: string, file: File): Promise; + + protected components: Components; + + protected abstract findInLines(modelID: string, lines: string[]): void; + + protected constructor(components: Components) { + this.components = components; + } + + /** + * Imports a query given its data. This data can be generating using its {@link IfcFinderQuery.export} method. + * + * @param components the instance of {@link Components} used by this app. + * @param data the data of the query to import as a serializable object. + */ + static import(components: Components, data: { [id: string]: any }) { + const newQuery = IfcFinderQuery.importers.get(data.type); + if (!newQuery) { + console.warn(`Invalid query data:.`, data); + return null; + } + return newQuery(components, data); + } + + /** + * Imports the given serialized rules. Only use this when writing your own custom query. See the other queries provided by the library for reference. + * + * @param serializedRules the rules to be parsed. + */ + static importRules(serializedRules: { [key: string]: any }[]) { + const rules: IfcFinderRule[] = []; + for (const serializedRule of serializedRules) { + const rule: Partial = {}; + for (const id in serializedRule) { + const item = serializedRule[id]; + if (item.regexp) { + rule[id as keyof IfcFinderRule] = new RegExp(item.value) as any; + } else { + rule[id as keyof IfcFinderRule] = item; + } + } + rules.push(rule as IfcFinderRule); + } + return rules; + } + + /** + * Imports the given IDs. Only use this when writing your own custom query. See the other queries provided by the library for reference. + * + * @param data the serialized object representing the query whose IDs to parse. + */ + static importIds(data: SerializedQuery) { + const ids: { [modelID: string]: Set } = {}; + for (const modelID in data.ids) { + ids[modelID] = new Set(data.ids[modelID]); + } + return ids; + } + + /** + * Clears the data of the given model. If not specified, clears all the data. + * + * @param modelID ID of the model whose data to clear. + */ + clear(modelID?: string) { + if (modelID === undefined) { + this.ids = {}; + this.needsUpdate.clear(); + return; + } + delete this.ids[modelID]; + this.needsUpdate.delete(modelID); + } + + protected addID(modelID: string, id: number) { + if (!this.ids[modelID]) { + this.ids[modelID] = new Set(); + } + this.ids[modelID].add(id); + } + + protected getData() { + const ids: { [modelID: string]: number[] } = {}; + for (const modelID in this.ids) { + ids[modelID] = Array.from(this.ids[modelID]); + } + + const rules = this.exportRules(); + + return { + name: this.name, + inclusive: this.inclusive, + type: "IfcFinderQuery", + ids, + rules, + } as SerializedQuery; + } + + protected exportRules(): { [key: string]: any }[] { + const rules: { [key: string]: any }[] = []; + for (const rule of this.rules) { + const serializedRule: { [key: string]: any } = {}; + for (const id in rule) { + const item = rule[id as keyof IfcFinderRule]; + if (item instanceof RegExp) { + serializedRule[id] = { regexp: true, value: item.source }; + } else { + serializedRule[id] = item; + } + } + rules.push(serializedRule); + } + return rules; + } + + protected findInFile(modelID: string, file: File) { + return new Promise((resolve) => { + const reader = new FileReader(); + const decoder = new TextDecoder("utf-8"); + + // src: https://joji.me/en-us/blog/processing-huge-files-using-filereader-readasarraybuffer-in-web-browser/ + const chunkSize = 10000 * 1024; // 10mb + const offset = 1000; // To avoid IFC lines that are split + let start = 0; + + const endLineToken = /;/; + + const readTextPart = () => { + if (start >= file.size) { + resolve(); + return; + } + const end = Math.min(start + chunkSize + offset, file.size); + const slice = file.slice(start, end); + reader.readAsArrayBuffer(slice); + }; + + reader.onload = () => { + if (!(reader.result instanceof ArrayBuffer)) { + return; + } + + const buffer = new Uint8Array(reader.result); + + const snippet = decoder.decode(buffer); + + // Get individual IFC lines + const lines = snippet.split(endLineToken); + // Remove first line, which is cut + lines.shift(); + + this.findInLines(modelID, lines); + + this.onProgress.trigger(start / file.size); + + start += chunkSize; + readTextPart(); + }; + + readTextPart(); + }); + } + + protected getIdFromLine(line: string) { + const idString = line.slice(line.indexOf("#") + 1, line.indexOf("=")); + return parseInt(idString, 10); + } + + protected testRules(line: string) { + let category: string | null = null; + let attrValues: string[] | null = null; + let attrNames: string[] | null = null; + + let filtersPass = false; + + for (const rule of this.rules) { + // Test categories + if (rule.type === "category") { + if (category === null) { + category = this.getCategoryFromLine(line); + if (category === null) { + if (!this.inclusive) { + break; + } else { + continue; + } + } + } + + if (!rule.value.test(category)) { + if (!this.inclusive) { + filtersPass = false; + break; + } else { + continue; + } + } + + filtersPass = true; + continue; + } + + if (attrValues === null) { + attrValues = this.getAttributesFromLine(line); + if (attrValues === null) { + if (!this.inclusive) { + filtersPass = false; + break; + } else { + continue; + } + } + } + + if (category === null) { + category = this.getCategoryFromLine(line); + if (category === null) { + if (!this.inclusive) { + filtersPass = false; + break; + } else { + continue; + } + } + } + + if (attrNames === null) { + // @ts-ignore + attrNames = Object.keys(new WEBIFC.IFC4[category]()); + // Remove attributes expressID and type, given by web-ifc + attrNames = attrNames.slice(2); + + if (attrNames === null) { + if (!this.inclusive) { + filtersPass = false; + break; + } else { + continue; + } + } + } + + // Test properties + if (rule.type === "property") { + const { name, value } = rule; + + // Quick test to see if this line contains what we are looking for + if (!value.test(line)) { + if (!this.inclusive) { + filtersPass = false; + break; + } else { + continue; + } + } + + // Slow test to detect if + + let someNameValueMatch = false; + for (let i = 0; i < attrValues.length; i++) { + const attrValue = attrValues[i]; + const attrName = attrNames[i]; + // Check that both name and value match + if (value.test(attrValue) && name.test(attrName)) { + someNameValueMatch = true; + break; + } + } + + if (!someNameValueMatch) { + if (!this.inclusive) { + filtersPass = false; + break; + } + } else { + filtersPass = true; + } + } + + // Test operators + if (rule.type === "operator") { + const { name, value, operator } = rule; + + let someNameValueMatch = false; + for (let i = 0; i < attrValues.length; i++) { + const attrName = attrNames[i]; + const attrValue = attrValues[i].replace( + /IFCLENGTHMEASURE\(|IFCVOLUMEMEASURE\(|\)/g, + "", + ); + // Check that name matches and operator applies + if (name.test(attrName)) { + if (operator === "=" && parseFloat(attrValue) === value) { + someNameValueMatch = true; + break; + } else if (operator === "<" && parseFloat(attrValue) < value) { + someNameValueMatch = true; + break; + } else if (operator === ">" && parseFloat(attrValue) > value) { + someNameValueMatch = true; + break; + } else if (operator === ">=" && parseFloat(attrValue) >= value) { + someNameValueMatch = true; + break; + } else if (operator === "<=" && parseFloat(attrValue) <= value) { + someNameValueMatch = true; + break; + } + } + } + + if (!someNameValueMatch) { + if (!this.inclusive) { + filtersPass = false; + break; + } + } else { + filtersPass = true; + } + } + } + + return filtersPass; + } + + protected getCategoryFromLine(line: string) { + const start = line.indexOf("=") + 1; + const end = line.indexOf("("); + const category = line.slice(start, end).trim(); + const name = ifcCategoryCase[category]; + if (!name) { + return null; + } + return name; + } + + protected getAttributesFromLine(line: string) { + const matchRegex = /\((.*)\)/; + const match = line.match(matchRegex); + if (!(match && match[1])) { + return null; + } + const splitRegex = /,(?![^()]*\))/g; + const attrs = match[1].split(splitRegex).map((part) => part.trim()); + // console.log(attrs); + // const validAttrs = attrs.map((attr) => { + // if (attr.startsWith("(") && attr.endsWith(")")) return "$"; + // if (attr.startsWith("'") && attr.endsWith("'")) return attr.slice(1, -1); + // return attr; + // }); + // return validAttrs; + return attrs; + } +} diff --git a/packages/core/src/ifc/IfcFinder/src/ifc-property-query.ts b/packages/core/src/ifc/IfcFinder/src/ifc-property-query.ts new file mode 100644 index 000000000..92f96e504 --- /dev/null +++ b/packages/core/src/ifc/IfcFinder/src/ifc-property-query.ts @@ -0,0 +1,154 @@ +import * as FRAGS from "@thatopen/fragments"; +import { IfcFinderQuery } from "./ifc-finder-query"; +import { IfcOperatorRule, IfcPropertyRule, SerializedQuery } from "./types"; +import { Components } from "../../../core"; +import { IfcRelationsIndexer } from "../../IfcRelationsIndexer"; +import { FragmentsManager } from "../../../fragments"; + +/** + * A query that checks the properties in the property sets assigned to IFC items. + */ +export class IfcPropertyQuery extends IfcFinderQuery { + /** + * {@link IfcFinderQuery.name} + */ + name: string; + + /** + * The type of this query. + */ + static type = "IfcPropertyQuery" as const; + + private psets: string[] = []; + + /** + * {@link IfcFinderQuery.items} + */ + get items() { + // Use the indexer to get all items related to the found psets + const indexer = this.components.get(IfcRelationsIndexer); + const fragments = this.components.get(FragmentsManager); + const maps: FRAGS.FragmentIdMap[] = []; + for (const modelID in this.ids) { + const model = fragments.groups.get(modelID); + if (!model) { + console.log(`Model not found: ${modelID}.`); + continue; + } + const ids = this.ids[modelID]; + for (const id of ids) { + const elements = indexer.getEntityRelations( + modelID, + id, + "DefinesOcurrence", + ); + if (elements) { + const map = model.getFragmentMap(elements); + maps.push(map); + } + } + } + return FRAGS.FragmentUtils.combine(maps); + } + + constructor( + components: Components, + data: { + name: string; + inclusive: boolean; + rules: (IfcPropertyRule | IfcOperatorRule)[]; + }, + ) { + super(components); + this.name = data.name; + this.rules = data.rules; + this.inclusive = data.inclusive; + } + + /** + * {@link IfcFinderQuery.export} + */ + export() { + const data = this.getData(); + data.type = IfcPropertyQuery.type; + return data; + } + + /** + * {@link IfcFinderQuery.update} + */ + async update(modelID: string, file: File) { + // 1. Gather all propertysinglevalues that match the filters + // also gather all ifcpropertysets and save them in this.psets + await this.findInFile(modelID, file); + + // Now, let's see which psets contain the found ifcpropertysinglevalues + const psetIDs = new Set(); + for (const pset of this.psets) { + const attrs = this.getAttributesFromLine(pset); + if (attrs === null) { + continue; + } + + const idsString = attrs[4] + .replace("(", "[") + .replace(")", "]") + .replace(/#/g, ""); + + const containedPropertySingleValues = JSON.parse(idsString) as number[]; + + for (const id of containedPropertySingleValues) { + const ids = this.ids[modelID]; + if (ids && ids.has(id)) { + const psetID = this.getIdFromLine(pset); + psetIDs.add(psetID); + break; + } + } + } + + this.ids[modelID] = psetIDs; + this.psets = []; + + this.needsUpdate.set(modelID, false); + } + + protected findInLines(modelID: string, lines: string[]) { + for (const line of lines) { + const category = this.getCategoryFromLine(line); + + // If it's pset, gather it + if (category === "IfcPropertySet") { + this.psets.push(line); + continue; + } + + // Otherwise, only process property single values + if (category !== "IfcPropertySingleValue") { + continue; + } + + // Check if property filters apply + const filtersPass = this.testRules(line); + + if (filtersPass) { + const id = this.getIdFromLine(line); + this.addID(modelID, id); + } + } + } +} + +IfcFinderQuery.importers.set( + IfcPropertyQuery.type, + (components: Components, data: SerializedQuery) => { + type PropRules = (IfcPropertyRule | IfcOperatorRule)[]; + const query = new IfcPropertyQuery(components, { + name: data.name, + inclusive: data.inclusive, + rules: IfcFinderQuery.importRules(data.rules) as PropRules, + }); + query.ids = IfcFinderQuery.importIds(data); + return query; + }, +); diff --git a/packages/core/src/ifc/IfcFinder/src/ifc-query-group.ts b/packages/core/src/ifc/IfcFinder/src/ifc-query-group.ts new file mode 100644 index 000000000..eaad288f7 --- /dev/null +++ b/packages/core/src/ifc/IfcFinder/src/ifc-query-group.ts @@ -0,0 +1,125 @@ +import * as FRAGS from "@thatopen/fragments"; +import * as THREE from "three"; +import { IfcFinderQuery } from "./ifc-finder-query"; +import { Components } from "../../../core"; + +/** + * A group of queries to perform searches in one or many IFC files. + */ +export class IfcQueryGroup { + /** + * The list of queries contained in this group. + */ + list = new Map(); + + /** + * A unique string to identify this group instance. + */ + id = THREE.MathUtils.generateUUID(); + + /** + * The way this group works when retrieving items. + * - Combine: returns the sum of all items of all queries. + * - Intersect: returns only the common elements of all queries. + */ + mode: "combine" | "intersect" = "intersect"; + + private _components: Components; + + /** + * The list of unique queries contained in this group. + */ + get queries() { + return new Set(this.list.values()); + } + + /** + * The items of all the queries contained in this group. The returned data depends on {@link IfcQueryGroup.mode}. + */ + get items(): FRAGS.FragmentIdMap { + // Returns intersection of getElements of all queries + const maps: FRAGS.FragmentIdMap[] = []; + for (const query of this.queries) { + maps.push(query.items); + } + if (this.mode === "combine") { + return FRAGS.FragmentUtils.combine(maps); + } + return FRAGS.FragmentUtils.intersect(maps); + } + + constructor(components: Components) { + this._components = components; + } + + /** + * Adds a new query to this group. + * @param query the query to add. + */ + add(query: IfcFinderQuery) { + if (this.list.has(query.name)) { + throw new Error( + `This group already has a query with the name ${query.name}.`, + ); + } + this.list.set(query.name, query); + } + + /** + * Clears the data of the given modelID of all queries contained in this group. If no modelID is provided, clears all data. + * @param modelID the model whose data to remove. + */ + clear(modelID?: string) { + for (const query of this.queries) { + query.clear(modelID); + } + } + + /** + * Imports data that has been previously exported through {@link IfcQueryGroup.export}. + * @param data the serializable object used to persist a group's data. + */ + import(data: { + mode: "combine" | "intersect"; + id: string; + queries: { [guid: string]: any }; + }) { + this.mode = data.mode; + this.id = data.id; + for (const id in data.queries) { + const query = IfcFinderQuery.import(this._components, data.queries[id]); + if (query) { + this.list.set(id, query); + } + } + } + + /** + * Exports all the data of this group, so that it can be persisted and imported later using {@link IfcQueryGroup.import}. + */ + export() { + const queries: { [guid: string]: any } = {}; + for (const [id, query] of this.list) { + queries[id] = query.export(); + } + return { + mode: this.mode, + id: this.id, + queries, + }; + } + + /** + * Updates all the queries contained in this group that need an update for the given file. It will skip those where {@link IfcFinderQuery.needsUpdate} is false. + * @param modelID the identifier used to refer to the given file. + * @param file the file to process. + */ + async update(modelID: string, file: File) { + for (const query of this.queries) { + const needsUpdate = query.needsUpdate.get(modelID); + if (needsUpdate === undefined || needsUpdate) { + await query.update(modelID, file); + } + } + } +} diff --git a/packages/core/src/ifc/IfcFinder/src/index.ts b/packages/core/src/ifc/IfcFinder/src/index.ts new file mode 100644 index 000000000..487b9ea4a --- /dev/null +++ b/packages/core/src/ifc/IfcFinder/src/index.ts @@ -0,0 +1,4 @@ +export * from "./types"; +export * from "./ifc-finder-query"; +export * from "./ifc-basic-query"; +export * from "./ifc-property-query.ts"; diff --git a/packages/core/src/ifc/IfcFinder/src/types.ts b/packages/core/src/ifc/IfcFinder/src/types.ts new file mode 100644 index 000000000..5d63122ff --- /dev/null +++ b/packages/core/src/ifc/IfcFinder/src/types.ts @@ -0,0 +1,93 @@ +/** + * A rule for the {@link IfcFinder} to search items based on their category. + */ +export interface IfcCategoryRule { + /** + * The type of this rule. All rules have a fixed type. + */ + type: "category"; + + /** + * The category value. It's a regular expression, so you can make complex queries and use ".*" to match all categories. + */ + value: RegExp; +} + +/** + * A rule for the {@link IfcFinder} to search items based on the properties defined in their property sets. + */ +export interface IfcPropertyRule { + /** + * The type of this rule. All rules have a fixed type. + */ + type: "property"; + + /** + * The name of the property. It's a regular expression, so you can make complex queries and use ".*" to match all names. + */ + name: RegExp; + + /** + * The value of the property. It's a regular expression, so you can make complex queries and use ".*" to match all values. + */ + value: RegExp; +} + +/** + * A rule for the {@link IfcFinder} to search items based on the value of a numeric property defined in their property sets. + */ +export interface IfcOperatorRule { + /** + * The type of this rule. All rules have a fixed type. + */ + type: "operator"; + + /** + * The name of the property. It's a regular expression, so you can make complex queries and use ".*" to match all names. + */ + name: RegExp; + + /** + * The value of the property. + */ + value: number; + + /** + * The operator to apply to the numeric value. + */ + operator: "<" | ">" | "=" | "<=" | ">="; +} + +/** + * The type of rules that can be used in the queries of the {@link IfcFinder}. + */ +export type IfcFinderRule = IfcCategoryRule | IfcPropertyRule | IfcOperatorRule; + +/** + * The data type used when the queries of the {@link IfcFinder} export or import query data to persist it. + */ +export type SerializedQuery = { + /** + * {@link IfcFinderQuery.name} + */ + name: string; + /** + * {@link IfcFinderQuery.inclusive} + */ + inclusive: boolean; + + /** + * The type of query. + */ + type: string; + + /** + * {@link IfcFinderQuery.ids} + */ + ids: { [modelID: string]: number[] }; + + /** + * {@link IfcFinderQuery.rules} + */ + rules: { [key: string]: any }[]; +}; diff --git a/packages/core/src/ifc/IfcJsonExporter/index.ts b/packages/core/src/ifc/IfcJsonExporter/index.ts index 1453f6382..349446bc4 100644 --- a/packages/core/src/ifc/IfcJsonExporter/index.ts +++ b/packages/core/src/ifc/IfcJsonExporter/index.ts @@ -68,8 +68,14 @@ export class IfcJsonExporter extends Component { // const allIDs = this._webIfc.GetAllLines(0); for (const id of ids) { - const property = webIfc.GetLine(0, id, recursive, indirect); - properties[property.expressID] = property; + try { + const property = webIfc.GetLine(0, id, recursive, indirect); + properties[property.expressID] = property; + } catch (e) { + console.log( + `Could not get property ${id}, with recursive ${recursive} and indirect ${indirect}.`, + ); + } } } diff --git a/packages/core/src/ifc/IfcRelationsIndexer/index.ts b/packages/core/src/ifc/IfcRelationsIndexer/index.ts index 339ef7dda..709f61c38 100644 --- a/packages/core/src/ifc/IfcRelationsIndexer/index.ts +++ b/packages/core/src/ifc/IfcRelationsIndexer/index.ts @@ -175,7 +175,7 @@ export class IfcRelationsIndexer extends Component implements Disposable { } } - private getAttributeIndex(inverseAttribute: InverseAttribute) { + getAttributeIndex(inverseAttribute: InverseAttribute) { const index = this._inverseAttributes.indexOf(inverseAttribute); if (index === -1) return null; return index; @@ -287,21 +287,22 @@ export class IfcRelationsIndexer extends Component implements Disposable { * This method searches the indexed relation maps for the specified model and entity, * returning the IDs of related entities if a match is found. * - * @param model The `FragmentsGroup` model containing the entity. + * @param model The `FragmentsGroup` model containing the entity, or its UUID. * @param expressID The unique identifier of the entity within the model. * @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements"). * @returns An array of express IDs representing the related entities, or `null` if no relations are found * or the specified relation name is not indexed. */ getEntityRelations( - model: FragmentsGroup, + model: FragmentsGroup | string, expressID: number, relationName: InverseAttribute, ) { - const indexMap = this.relationMaps[model.uuid]; + const id = model instanceof FragmentsGroup ? model.uuid : model; + const indexMap = this.relationMaps[id]; if (!indexMap) { throw new Error( - `IfcRelationsIndexer: model ${model.uuid} has no relations indexed.`, + `IfcRelationsIndexer: model ${id} has no relations indexed.`, ); } const entityRelations = indexMap.get(expressID); diff --git a/packages/core/src/ifc/Utils/ifc-category-case.ts b/packages/core/src/ifc/Utils/ifc-category-case.ts new file mode 100644 index 000000000..bfef09b3a --- /dev/null +++ b/packages/core/src/ifc/Utils/ifc-category-case.ts @@ -0,0 +1,1152 @@ +export const ifcCategoryCase: { [upperCase: string]: string } = { + IFCURIREFERENCE: "IfcUriReference", + IFCTIME: "IfcTime", + IFCTEMPERATURERATEOFCHANGEMEASURE: "IfcTemperatureRateOfChangeMeasure", + IFCSOUNDPRESSURELEVELMEASURE: "IfcSoundPressureLevelMeasure", + IFCSOUNDPOWERLEVELMEASURE: "IfcSoundPowerLevelMeasure", + IFCPROPERTYSETDEFINITIONSET: "IfcPropertySetDefinitionSet", + IFCPOSITIVEINTEGER: "IfcPositiveInteger", + IFCNONNEGATIVELENGTHMEASURE: "IfcNonNegativeLengthMeasure", + IFCLINEINDEX: "IfcLineIndex", + IFCLANGUAGEID: "IfcLanguageId", + IFCDURATION: "IfcDuration", + IFCDAYINWEEKNUMBER: "IfcDayInWeekNumber", + IFCDATETIME: "IfcDateTime", + IFCDATE: "IfcDate", + IFCCARDINALPOINTREFERENCE: "IfcCardinalPointReference", + IFCBINARY: "IfcBinary", + IFCAREADENSITYMEASURE: "IfcAreaDensityMeasure", + IFCARCINDEX: "IfcArcIndex", + IFCYEARNUMBER: "IfcYearNumber", + IFCWARPINGMOMENTMEASURE: "IfcWarpingMomentMeasure", + IFCWARPINGCONSTANTMEASURE: "IfcWarpingConstantMeasure", + IFCVOLUMETRICFLOWRATEMEASURE: "IfcVolumetricFlowRateMeasure", + IFCVOLUMEMEASURE: "IfcVolumeMeasure", + IFCVAPORPERMEABILITYMEASURE: "IfcVaporPermeabilityMeasure", + IFCTORQUEMEASURE: "IfcTorqueMeasure", + IFCTIMESTAMP: "IfcTimestamp", + IFCTIMEMEASURE: "IfcTimeMeasure", + IFCTHERMODYNAMICTEMPERATUREMEASURE: "IfcThermodynamicTemperatureMeasure", + IFCTHERMALTRANSMITTANCEMEASURE: "IfcThermalTransmittanceMeasure", + IFCTHERMALRESISTANCEMEASURE: "IfcThermalResistanceMeasure", + IFCTHERMALEXPANSIONCOEFFICIENTMEASURE: + "IfcThermalExpansionCoefficientMeasure", + IFCTHERMALCONDUCTIVITYMEASURE: "IfcThermalConductivityMeasure", + IFCTHERMALADMITTANCEMEASURE: "IfcThermalAdmittanceMeasure", + IFCTEXTTRANSFORMATION: "IfcTextTransformation", + IFCTEXTFONTNAME: "IfcTextFontName", + IFCTEXTDECORATION: "IfcTextDecoration", + IFCTEXTALIGNMENT: "IfcTextAlignment", + IFCTEXT: "IfcText", + IFCTEMPERATUREGRADIENTMEASURE: "IfcTemperatureGradientMeasure", + IFCSPECULARROUGHNESS: "IfcSpecularRoughness", + IFCSPECULAREXPONENT: "IfcSpecularExponent", + IFCSPECIFICHEATCAPACITYMEASURE: "IfcSpecificHeatCapacityMeasure", + IFCSOUNDPRESSUREMEASURE: "IfcSoundPressureMeasure", + IFCSOUNDPOWERMEASURE: "IfcSoundPowerMeasure", + IFCSOLIDANGLEMEASURE: "IfcSolidAngleMeasure", + IFCSHEARMODULUSMEASURE: "IfcShearModulusMeasure", + IFCSECTIONALAREAINTEGRALMEASURE: "IfcSectionalAreaIntegralMeasure", + IFCSECTIONMODULUSMEASURE: "IfcSectionModulusMeasure", + IFCSECONDINMINUTE: "IfcSecondInMinute", + IFCROTATIONALSTIFFNESSMEASURE: "IfcRotationalStiffnessMeasure", + IFCROTATIONALMASSMEASURE: "IfcRotationalMassMeasure", + IFCROTATIONALFREQUENCYMEASURE: "IfcRotationalFrequencyMeasure", + IFCREAL: "IfcReal", + IFCRATIOMEASURE: "IfcRatioMeasure", + IFCRADIOACTIVITYMEASURE: "IfcRadioactivityMeasure", + IFCPRESSUREMEASURE: "IfcPressureMeasure", + IFCPRESENTABLETEXT: "IfcPresentableText", + IFCPOWERMEASURE: "IfcPowerMeasure", + IFCPOSITIVERATIOMEASURE: "IfcPositiveRatioMeasure", + IFCPOSITIVEPLANEANGLEMEASURE: "IfcPositivePlaneAngleMeasure", + IFCPOSITIVELENGTHMEASURE: "IfcPositiveLengthMeasure", + IFCPLANEANGLEMEASURE: "IfcPlaneAngleMeasure", + IFCPLANARFORCEMEASURE: "IfcPlanarForceMeasure", + IFCPARAMETERVALUE: "IfcParameterValue", + IFCPHMEASURE: "IfcPhMeasure", + IFCNUMERICMEASURE: "IfcNumericMeasure", + IFCNORMALISEDRATIOMEASURE: "IfcNormalisedRatioMeasure", + IFCMONTHINYEARNUMBER: "IfcMonthInYearNumber", + IFCMONETARYMEASURE: "IfcMonetaryMeasure", + IFCMOMENTOFINERTIAMEASURE: "IfcMomentOfInertiaMeasure", + IFCMOLECULARWEIGHTMEASURE: "IfcMolecularWeightMeasure", + IFCMOISTUREDIFFUSIVITYMEASURE: "IfcMoistureDiffusivityMeasure", + IFCMODULUSOFSUBGRADEREACTIONMEASURE: "IfcModulusOfSubgradeReactionMeasure", + IFCMODULUSOFROTATIONALSUBGRADEREACTIONMEASURE: + "IfcModulusOfRotationalSubgradeReactionMeasure", + IFCMODULUSOFLINEARSUBGRADEREACTIONMEASURE: + "IfcModulusOfLinearSubgradeReactionMeasure", + IFCMODULUSOFELASTICITYMEASURE: "IfcModulusOfElasticityMeasure", + IFCMINUTEINHOUR: "IfcMinuteInHour", + IFCMASSPERLENGTHMEASURE: "IfcMassPerLengthMeasure", + IFCMASSMEASURE: "IfcMassMeasure", + IFCMASSFLOWRATEMEASURE: "IfcMassFlowRateMeasure", + IFCMASSDENSITYMEASURE: "IfcMassDensityMeasure", + IFCMAGNETICFLUXMEASURE: "IfcMagneticFluxMeasure", + IFCMAGNETICFLUXDENSITYMEASURE: "IfcMagneticFluxDensityMeasure", + IFCLUMINOUSINTENSITYMEASURE: "IfcLuminousIntensityMeasure", + IFCLUMINOUSINTENSITYDISTRIBUTIONMEASURE: + "IfcLuminousIntensityDistributionMeasure", + IFCLUMINOUSFLUXMEASURE: "IfcLuminousFluxMeasure", + IFCLOGICAL: "IfcLogical", + IFCLINEARVELOCITYMEASURE: "IfcLinearVelocityMeasure", + IFCLINEARSTIFFNESSMEASURE: "IfcLinearStiffnessMeasure", + IFCLINEARMOMENTMEASURE: "IfcLinearMomentMeasure", + IFCLINEARFORCEMEASURE: "IfcLinearForceMeasure", + IFCLENGTHMEASURE: "IfcLengthMeasure", + IFCLABEL: "IfcLabel", + IFCKINEMATICVISCOSITYMEASURE: "IfcKinematicViscosityMeasure", + IFCISOTHERMALMOISTURECAPACITYMEASURE: "IfcIsothermalMoistureCapacityMeasure", + IFCIONCONCENTRATIONMEASURE: "IfcIonConcentrationMeasure", + IFCINTEGERCOUNTRATEMEASURE: "IfcIntegerCountRateMeasure", + IFCINTEGER: "IfcInteger", + IFCINDUCTANCEMEASURE: "IfcInductanceMeasure", + IFCILLUMINANCEMEASURE: "IfcIlluminanceMeasure", + IFCIDENTIFIER: "IfcIdentifier", + IFCHOURINDAY: "IfcHourInDay", + IFCHEATINGVALUEMEASURE: "IfcHeatingValueMeasure", + IFCHEATFLUXDENSITYMEASURE: "IfcHeatFluxDensityMeasure", + IFCGLOBALLYUNIQUEID: "IfcGloballyUniqueId", + IFCFREQUENCYMEASURE: "IfcFrequencyMeasure", + IFCFORCEMEASURE: "IfcForceMeasure", + IFCFONTWEIGHT: "IfcFontWeight", + IFCFONTVARIANT: "IfcFontVariant", + IFCFONTSTYLE: "IfcFontStyle", + IFCENERGYMEASURE: "IfcEnergyMeasure", + IFCELECTRICVOLTAGEMEASURE: "IfcElectricVoltageMeasure", + IFCELECTRICRESISTANCEMEASURE: "IfcElectricResistanceMeasure", + IFCELECTRICCURRENTMEASURE: "IfcElectricCurrentMeasure", + IFCELECTRICCONDUCTANCEMEASURE: "IfcElectricConductanceMeasure", + IFCELECTRICCHARGEMEASURE: "IfcElectricChargeMeasure", + IFCELECTRICCAPACITANCEMEASURE: "IfcElectricCapacitanceMeasure", + IFCDYNAMICVISCOSITYMEASURE: "IfcDynamicViscosityMeasure", + IFCDOSEEQUIVALENTMEASURE: "IfcDoseEquivalentMeasure", + IFCDIMENSIONCOUNT: "IfcDimensionCount", + IFCDESCRIPTIVEMEASURE: "IfcDescriptiveMeasure", + IFCDAYLIGHTSAVINGHOUR: "IfcDaylightSavingHour", + IFCDAYINMONTHNUMBER: "IfcDayInMonthNumber", + IFCCURVATUREMEASURE: "IfcCurvatureMeasure", + IFCCOUNTMEASURE: "IfcCountMeasure", + IFCCONTEXTDEPENDENTMEASURE: "IfcContextDependentMeasure", + IFCCOMPOUNDPLANEANGLEMEASURE: "IfcCompoundPlaneAngleMeasure", + IFCCOMPLEXNUMBER: "IfcComplexNumber", + IFCBOXALIGNMENT: "IfcBoxAlignment", + IFCBOOLEAN: "IfcBoolean", + IFCAREAMEASURE: "IfcAreaMeasure", + IFCANGULARVELOCITYMEASURE: "IfcAngularVelocityMeasure", + IFCAMOUNTOFSUBSTANCEMEASURE: "IfcAmountOfSubstanceMeasure", + IFCACCELERATIONMEASURE: "IfcAccelerationMeasure", + IFCABSORBEDDOSEMEASURE: "IfcAbsorbedDoseMeasure", + IFCGEOSLICE: "IfcGeoSlice", + IFCGEOMODEL: "IfcGeoModel", + IFCELECTRICFLOWTREATMENTDEVICE: "IfcElectricFlowTreatmentDevice", + IFCDISTRIBUTIONBOARD: "IfcDistributionBoard", + IFCCONVEYORSEGMENT: "IfcConveyorSegment", + IFCCAISSONFOUNDATION: "IfcCaissonFoundation", + IFCBOREHOLE: "IfcBorehole", + IFCBEARING: "IfcBearing", + IFCALIGNMENT: "IfcAlignment", + IFCTRACKELEMENT: "IfcTrackElement", + IFCSIGNAL: "IfcSignal", + IFCREINFORCEDSOIL: "IfcReinforcedSoil", + IFCRAIL: "IfcRail", + IFCPAVEMENT: "IfcPavement", + IFCNAVIGATIONELEMENT: "IfcNavigationElement", + IFCMOORINGDEVICE: "IfcMooringDevice", + IFCMOBILETELECOMMUNICATIONSAPPLIANCE: "IfcMobileTelecommunicationsAppliance", + IFCLIQUIDTERMINAL: "IfcLiquidTerminal", + IFCLINEARPOSITIONINGELEMENT: "IfcLinearPositioningElement", + IFCKERB: "IfcKerb", + IFCGEOTECHNICALASSEMBLY: "IfcGeotechnicalAssembly", + IFCELECTRICFLOWTREATMENTDEVICETYPE: "IfcElectricFlowTreatmentDeviceType", + IFCEARTHWORKSFILL: "IfcEarthworksFill", + IFCEARTHWORKSELEMENT: "IfcEarthworksElement", + IFCEARTHWORKSCUT: "IfcEarthworksCut", + IFCDISTRIBUTIONBOARDTYPE: "IfcDistributionBoardType", + IFCDEEPFOUNDATION: "IfcDeepFoundation", + IFCCOURSE: "IfcCourse", + IFCCONVEYORSEGMENTTYPE: "IfcConveyorSegmentType", + IFCCAISSONFOUNDATIONTYPE: "IfcCaissonFoundationType", + IFCBUILTSYSTEM: "IfcBuiltSystem", + IFCBUILTELEMENT: "IfcBuiltElement", + IFCBRIDGEPART: "IfcBridgePart", + IFCBRIDGE: "IfcBridge", + IFCBEARINGTYPE: "IfcBearingType", + IFCALIGNMENTVERTICAL: "IfcAlignmentVertical", + IFCALIGNMENTSEGMENT: "IfcAlignmentSegment", + IFCALIGNMENTHORIZONTAL: "IfcAlignmentHorizontal", + IFCALIGNMENTCANT: "IfcAlignmentCant", + IFCVIBRATIONDAMPERTYPE: "IfcVibrationDamperType", + IFCVIBRATIONDAMPER: "IfcVibrationDamper", + IFCVEHICLE: "IfcVehicle", + IFCTRANSPORTATIONDEVICE: "IfcTransportationDevice", + IFCTRACKELEMENTTYPE: "IfcTrackElementType", + IFCTENDONCONDUITTYPE: "IfcTendonConduitType", + IFCTENDONCONDUIT: "IfcTendonConduit", + IFCSINESPIRAL: "IfcSineSpiral", + IFCSIGNALTYPE: "IfcSignalType", + IFCSIGNTYPE: "IfcSignType", + IFCSIGN: "IfcSign", + IFCSEVENTHORDERPOLYNOMIALSPIRAL: "IfcSeventhOrderPolynomialSpiral", + IFCSEGMENTEDREFERENCECURVE: "IfcSegmentedReferenceCurve", + IFCSECONDORDERPOLYNOMIALSPIRAL: "IfcSecondOrderPolynomialSpiral", + IFCROADPART: "IfcRoadPart", + IFCROAD: "IfcRoad", + IFCRELADHERESTOELEMENT: "IfcRelAdheresToElement", + IFCREFERENT: "IfcReferent", + IFCRAILWAYPART: "IfcRailwayPart", + IFCRAILWAY: "IfcRailway", + IFCRAILTYPE: "IfcRailType", + IFCPOSITIONINGELEMENT: "IfcPositioningElement", + IFCPAVEMENTTYPE: "IfcPavementType", + IFCNAVIGATIONELEMENTTYPE: "IfcNavigationElementType", + IFCMOORINGDEVICETYPE: "IfcMooringDeviceType", + IFCMOBILETELECOMMUNICATIONSAPPLIANCETYPE: + "IfcMobileTelecommunicationsApplianceType", + IFCMARINEPART: "IfcMarinePart", + IFCMARINEFACILITY: "IfcMarineFacility", + IFCLIQUIDTERMINALTYPE: "IfcLiquidTerminalType", + IFCLINEARELEMENT: "IfcLinearElement", + IFCKERBTYPE: "IfcKerbType", + IFCIMPACTPROTECTIONDEVICETYPE: "IfcImpactProtectionDeviceType", + IFCIMPACTPROTECTIONDEVICE: "IfcImpactProtectionDevice", + IFCGRADIENTCURVE: "IfcGradientCurve", + IFCGEOTECHNICALSTRATUM: "IfcGeotechnicalStratum", + IFCGEOTECHNICALELEMENT: "IfcGeotechnicalElement", + IFCFACILITYPARTCOMMON: "IfcFacilityPartCommon", + IFCFACILITYPART: "IfcFacilityPart", + IFCFACILITY: "IfcFacility", + IFCDIRECTRIXDERIVEDREFERENCESWEPTAREASOLID: + "IfcDirectrixDerivedReferenceSweptAreaSolid", + IFCDEEPFOUNDATIONTYPE: "IfcDeepFoundationType", + IFCCOURSETYPE: "IfcCourseType", + IFCCOSINESPIRAL: "IfcCosineSpiral", + IFCCLOTHOID: "IfcClothoid", + IFCBUILTELEMENTTYPE: "IfcBuiltElementType", + IFCVEHICLETYPE: "IfcVehicleType", + IFCTRIANGULATEDIRREGULARNETWORK: "IfcTriangulatedIrregularNetwork", + IFCTRANSPORTATIONDEVICETYPE: "IfcTransportationDeviceType", + IFCTHIRDORDERPOLYNOMIALSPIRAL: "IfcThirdOrderPolynomialSpiral", + IFCSPIRAL: "IfcSpiral", + IFCSECTIONEDSURFACE: "IfcSectionedSurface", + IFCSECTIONEDSOLIDHORIZONTAL: "IfcSectionedSolidHorizontal", + IFCSECTIONEDSOLID: "IfcSectionedSolid", + IFCRELPOSITIONS: "IfcRelPositions", + IFCRELASSOCIATESPROFILEDEF: "IfcRelAssociatesProfileDef", + IFCPOLYNOMIALCURVE: "IfcPolynomialCurve", + IFCOFFSETCURVEBYDISTANCES: "IfcOffsetCurveByDistances", + IFCOFFSETCURVE: "IfcOffsetCurve", + IFCINDEXEDPOLYGONALTEXTUREMAP: "IfcIndexedPolygonalTextureMap", + IFCDIRECTRIXCURVESWEPTAREASOLID: "IfcDirectrixCurveSweptAreaSolid", + IFCCURVESEGMENT: "IfcCurveSegment", + IFCAXIS2PLACEMENTLINEAR: "IfcAxis2PlacementLinear", + IFCSEGMENT: "IfcSegment", + IFCPOINTBYDISTANCEEXPRESSION: "IfcPointByDistanceExpression", + IFCOPENCROSSPROFILEDEF: "IfcOpenCrossProfileDef", + IFCLINEARPLACEMENT: "IfcLinearPlacement", + IFCALIGNMENTHORIZONTALSEGMENT: "IfcAlignmentHorizontalSegment", + IFCALIGNMENTCANTSEGMENT: "IfcAlignmentCantSegment", + IFCTEXTURECOORDINATEINDICESWITHVOIDS: "IfcTextureCoordinateIndicesWithVoids", + IFCTEXTURECOORDINATEINDICES: "IfcTextureCoordinateIndices", + IFCQUANTITYNUMBER: "IfcQuantityNumber", + IFCALIGNMENTVERTICALSEGMENT: "IfcAlignmentVerticalSegment", + IFCALIGNMENTPARAMETERSEGMENT: "IfcAlignmentParameterSegment", + IFCCONTROLLER: "IfcController", + IFCALARM: "IfcAlarm", + IFCACTUATOR: "IfcActuator", + IFCUNITARYCONTROLELEMENT: "IfcUnitaryControlElement", + IFCSENSOR: "IfcSensor", + IFCPROTECTIVEDEVICETRIPPINGUNIT: "IfcProtectiveDeviceTrippingUnit", + IFCFLOWINSTRUMENT: "IfcFlowInstrument", + IFCFIRESUPPRESSIONTERMINAL: "IfcFireSuppressionTerminal", + IFCFILTER: "IfcFilter", + IFCFAN: "IfcFan", + IFCELECTRICTIMECONTROL: "IfcElectricTimeControl", + IFCELECTRICMOTOR: "IfcElectricMotor", + IFCELECTRICGENERATOR: "IfcElectricGenerator", + IFCELECTRICFLOWSTORAGEDEVICE: "IfcElectricFlowStorageDevice", + IFCELECTRICDISTRIBUTIONBOARD: "IfcElectricDistributionBoard", + IFCELECTRICAPPLIANCE: "IfcElectricAppliance", + IFCDUCTSILENCER: "IfcDuctSilencer", + IFCDUCTSEGMENT: "IfcDuctSegment", + IFCDUCTFITTING: "IfcDuctFitting", + IFCDISTRIBUTIONCIRCUIT: "IfcDistributionCircuit", + IFCDAMPER: "IfcDamper", + IFCCOOLINGTOWER: "IfcCoolingTower", + IFCCOOLEDBEAM: "IfcCooledBeam", + IFCCONDENSER: "IfcCondenser", + IFCCOMPRESSOR: "IfcCompressor", + IFCCOMMUNICATIONSAPPLIANCE: "IfcCommunicationsAppliance", + IFCCOIL: "IfcCoil", + IFCCHILLER: "IfcChiller", + IFCCABLESEGMENT: "IfcCableSegment", + IFCCABLEFITTING: "IfcCableFitting", + IFCCABLECARRIERSEGMENT: "IfcCableCarrierSegment", + IFCCABLECARRIERFITTING: "IfcCableCarrierFitting", + IFCBURNER: "IfcBurner", + IFCBOILER: "IfcBoiler", + IFCBEAMSTANDARDCASE: "IfcBeamStandardCase", + IFCAUDIOVISUALAPPLIANCE: "IfcAudioVisualAppliance", + IFCAIRTOAIRHEATRECOVERY: "IfcAirToAirHeatRecovery", + IFCAIRTERMINALBOX: "IfcAirTerminalBox", + IFCAIRTERMINAL: "IfcAirTerminal", + IFCWINDOWSTANDARDCASE: "IfcWindowStandardCase", + IFCWASTETERMINAL: "IfcWasteTerminal", + IFCWALLELEMENTEDCASE: "IfcWallElementedCase", + IFCVALVE: "IfcValve", + IFCUNITARYEQUIPMENT: "IfcUnitaryEquipment", + IFCUNITARYCONTROLELEMENTTYPE: "IfcUnitaryControlElementType", + IFCTUBEBUNDLE: "IfcTubeBundle", + IFCTRANSFORMER: "IfcTransformer", + IFCTANK: "IfcTank", + IFCSWITCHINGDEVICE: "IfcSwitchingDevice", + IFCSTRUCTURALLOADCASE: "IfcStructuralLoadCase", + IFCSTACKTERMINAL: "IfcStackTerminal", + IFCSPACEHEATER: "IfcSpaceHeater", + IFCSOLARDEVICE: "IfcSolarDevice", + IFCSLABSTANDARDCASE: "IfcSlabStandardCase", + IFCSLABELEMENTEDCASE: "IfcSlabElementedCase", + IFCSHADINGDEVICE: "IfcShadingDevice", + IFCSANITARYTERMINAL: "IfcSanitaryTerminal", + IFCREINFORCINGBARTYPE: "IfcReinforcingBarType", + IFCRATIONALBSPLINECURVEWITHKNOTS: "IfcRationalBSplineCurveWithKnots", + IFCPUMP: "IfcPump", + IFCPROTECTIVEDEVICETRIPPINGUNITTYPE: "IfcProtectiveDeviceTrippingUnitType", + IFCPROTECTIVEDEVICE: "IfcProtectiveDevice", + IFCPLATESTANDARDCASE: "IfcPlateStandardCase", + IFCPIPESEGMENT: "IfcPipeSegment", + IFCPIPEFITTING: "IfcPipeFitting", + IFCOUTLET: "IfcOutlet", + IFCOUTERBOUNDARYCURVE: "IfcOuterBoundaryCurve", + IFCMOTORCONNECTION: "IfcMotorConnection", + IFCMEMBERSTANDARDCASE: "IfcMemberStandardCase", + IFCMEDICALDEVICE: "IfcMedicalDevice", + IFCLIGHTFIXTURE: "IfcLightFixture", + IFCLAMP: "IfcLamp", + IFCJUNCTIONBOX: "IfcJunctionBox", + IFCINTERCEPTOR: "IfcInterceptor", + IFCHUMIDIFIER: "IfcHumidifier", + IFCHEATEXCHANGER: "IfcHeatExchanger", + IFCFLOWMETER: "IfcFlowMeter", + IFCEXTERNALSPATIALELEMENT: "IfcExternalSpatialElement", + IFCEVAPORATOR: "IfcEvaporator", + IFCEVAPORATIVECOOLER: "IfcEvaporativeCooler", + IFCENGINE: "IfcEngine", + IFCELECTRICDISTRIBUTIONBOARDTYPE: "IfcElectricDistributionBoardType", + IFCDOORSTANDARDCASE: "IfcDoorStandardCase", + IFCDISTRIBUTIONSYSTEM: "IfcDistributionSystem", + IFCCOMMUNICATIONSAPPLIANCETYPE: "IfcCommunicationsApplianceType", + IFCCOLUMNSTANDARDCASE: "IfcColumnStandardCase", + IFCCIVILELEMENT: "IfcCivilElement", + IFCCHIMNEY: "IfcChimney", + IFCCABLEFITTINGTYPE: "IfcCableFittingType", + IFCBURNERTYPE: "IfcBurnerType", + IFCBUILDINGSYSTEM: "IfcBuildingSystem", + IFCBUILDINGELEMENTPARTTYPE: "IfcBuildingElementPartType", + IFCBOUNDARYCURVE: "IfcBoundaryCurve", + IFCBSPLINECURVEWITHKNOTS: "IfcBSplineCurveWithKnots", + IFCAUDIOVISUALAPPLIANCETYPE: "IfcAudioVisualApplianceType", + IFCWORKCALENDAR: "IfcWorkCalendar", + IFCWINDOWTYPE: "IfcWindowType", + IFCVOIDINGFEATURE: "IfcVoidingFeature", + IFCVIBRATIONISOLATOR: "IfcVibrationIsolator", + IFCTENDONTYPE: "IfcTendonType", + IFCTENDONANCHORTYPE: "IfcTendonAnchorType", + IFCSYSTEMFURNITUREELEMENT: "IfcSystemFurnitureElement", + IFCSURFACEFEATURE: "IfcSurfaceFeature", + IFCSTRUCTURALSURFACEACTION: "IfcStructuralSurfaceAction", + IFCSTRUCTURALCURVEREACTION: "IfcStructuralCurveReaction", + IFCSTRUCTURALCURVEACTION: "IfcStructuralCurveAction", + IFCSTAIRTYPE: "IfcStairType", + IFCSOLARDEVICETYPE: "IfcSolarDeviceType", + IFCSHADINGDEVICETYPE: "IfcShadingDeviceType", + IFCSEAMCURVE: "IfcSeamCurve", + IFCROOFTYPE: "IfcRoofType", + IFCREINFORCINGMESHTYPE: "IfcReinforcingMeshType", + IFCREINFORCINGELEMENTTYPE: "IfcReinforcingElementType", + IFCRATIONALBSPLINESURFACEWITHKNOTS: "IfcRationalBSplineSurfaceWithKnots", + IFCRAMPTYPE: "IfcRampType", + IFCPOLYGONALFACESET: "IfcPolygonalFaceSet", + IFCPILETYPE: "IfcPileType", + IFCOPENINGSTANDARDCASE: "IfcOpeningStandardCase", + IFCMEDICALDEVICETYPE: "IfcMedicalDeviceType", + IFCINTERSECTIONCURVE: "IfcIntersectionCurve", + IFCINTERCEPTORTYPE: "IfcInterceptorType", + IFCINDEXEDPOLYCURVE: "IfcIndexedPolyCurve", + IFCGEOGRAPHICELEMENT: "IfcGeographicElement", + IFCFURNITURE: "IfcFurniture", + IFCFOOTINGTYPE: "IfcFootingType", + IFCEXTERNALSPATIALSTRUCTUREELEMENT: "IfcExternalSpatialStructureElement", + IFCEVENT: "IfcEvent", + IFCENGINETYPE: "IfcEngineType", + IFCELEMENTASSEMBLYTYPE: "IfcElementAssemblyType", + IFCDOORTYPE: "IfcDoorType", + IFCCYLINDRICALSURFACE: "IfcCylindricalSurface", + IFCCONSTRUCTIONPRODUCTRESOURCETYPE: "IfcConstructionProductResourceType", + IFCCONSTRUCTIONMATERIALRESOURCETYPE: "IfcConstructionMaterialResourceType", + IFCCONSTRUCTIONEQUIPMENTRESOURCETYPE: "IfcConstructionEquipmentResourceType", + IFCCOMPOSITECURVEONSURFACE: "IfcCompositeCurveOnSurface", + IFCCOMPLEXPROPERTYTEMPLATE: "IfcComplexPropertyTemplate", + IFCCIVILELEMENTTYPE: "IfcCivilElementType", + IFCCHIMNEYTYPE: "IfcChimneyType", + IFCBSPLINESURFACEWITHKNOTS: "IfcBSplineSurfaceWithKnots", + IFCBSPLINESURFACE: "IfcBSplineSurface", + IFCADVANCEDBREPWITHVOIDS: "IfcAdvancedBrepWithVoids", + IFCADVANCEDBREP: "IfcAdvancedBrep", + IFCTRIANGULATEDFACESET: "IfcTriangulatedFaceSet", + IFCTOROIDALSURFACE: "IfcToroidalSurface", + IFCTESSELLATEDFACESET: "IfcTessellatedFaceSet", + IFCTASKTYPE: "IfcTaskType", + IFCSURFACECURVE: "IfcSurfaceCurve", + IFCSUBCONTRACTRESOURCETYPE: "IfcSubContractResourceType", + IFCSTRUCTURALSURFACEREACTION: "IfcStructuralSurfaceReaction", + IFCSPHERICALSURFACE: "IfcSphericalSurface", + IFCSPATIALZONETYPE: "IfcSpatialZoneType", + IFCSPATIALZONE: "IfcSpatialZone", + IFCSPATIALELEMENTTYPE: "IfcSpatialElementType", + IFCSPATIALELEMENT: "IfcSpatialElement", + IFCSIMPLEPROPERTYTEMPLATE: "IfcSimplePropertyTemplate", + IFCREVOLVEDAREASOLIDTAPERED: "IfcRevolvedAreaSolidTapered", + IFCREPARAMETRISEDCOMPOSITECURVESEGMENT: + "IfcReparametrisedCompositeCurveSegment", + IFCRELSPACEBOUNDARY2NDLEVEL: "IfcRelSpaceBoundary2ndLevel", + IFCRELSPACEBOUNDARY1STLEVEL: "IfcRelSpaceBoundary1stLevel", + IFCRELINTERFERESELEMENTS: "IfcRelInterferesElements", + IFCRELDEFINESBYTEMPLATE: "IfcRelDefinesByTemplate", + IFCRELDEFINESBYOBJECT: "IfcRelDefinesByObject", + IFCRELDECLARES: "IfcRelDeclares", + IFCRELASSIGNSTOGROUPBYFACTOR: "IfcRelAssignsToGroupByFactor", + IFCPROPERTYTEMPLATE: "IfcPropertyTemplate", + IFCPROPERTYSETTEMPLATE: "IfcPropertySetTemplate", + IFCPROJECTLIBRARY: "IfcProjectLibrary", + IFCPROCEDURETYPE: "IfcProcedureType", + IFCPREDEFINEDPROPERTYSET: "IfcPredefinedPropertySet", + IFCPCURVE: "IfcPCurve", + IFCLABORRESOURCETYPE: "IfcLaborResourceType", + IFCINDEXEDPOLYGONALFACEWITHVOIDS: "IfcIndexedPolygonalFaceWithVoids", + IFCINDEXEDPOLYGONALFACE: "IfcIndexedPolygonalFace", + IFCGEOGRAPHICELEMENTTYPE: "IfcGeographicElementType", + IFCFIXEDREFERENCESWEPTAREASOLID: "IfcFixedReferenceSweptAreaSolid", + IFCEXTRUDEDAREASOLIDTAPERED: "IfcExtrudedAreaSolidTapered", + IFCEVENTTYPE: "IfcEventType", + IFCCURVEBOUNDEDSURFACE: "IfcCurveBoundedSurface", + IFCCREWRESOURCETYPE: "IfcCrewResourceType", + IFCCONTEXT: "IfcContext", + IFCCONSTRUCTIONRESOURCETYPE: "IfcConstructionResourceType", + IFCCARTESIANPOINTLIST3D: "IfcCartesianPointList3D", + IFCCARTESIANPOINTLIST2D: "IfcCartesianPointList2D", + IFCCARTESIANPOINTLIST: "IfcCartesianPointList", + IFCADVANCEDFACE: "IfcAdvancedFace", + IFCTYPERESOURCE: "IfcTypeResource", + IFCTYPEPROCESS: "IfcTypeProcess", + IFCTESSELLATEDITEM: "IfcTessellatedItem", + IFCSWEPTDISKSOLIDPOLYGONAL: "IfcSweptDiskSolidPolygonal", + IFCRESOURCETIME: "IfcResourceTime", + IFCRESOURCECONSTRAINTRELATIONSHIP: "IfcResourceConstraintRelationship", + IFCRESOURCEAPPROVALRELATIONSHIP: "IfcResourceApprovalRelationship", + IFCQUANTITYSET: "IfcQuantitySet", + IFCPROPERTYTEMPLATEDEFINITION: "IfcPropertyTemplateDefinition", + IFCPREDEFINEDPROPERTIES: "IfcPredefinedProperties", + IFCMIRROREDPROFILEDEF: "IfcMirroredProfileDef", + IFCMATERIALRELATIONSHIP: "IfcMaterialRelationship", + IFCMATERIALPROFILESETUSAGETAPERING: "IfcMaterialProfileSetUsageTapering", + IFCMATERIALPROFILESETUSAGE: "IfcMaterialProfileSetUsage", + IFCMATERIALCONSTITUENTSET: "IfcMaterialConstituentSet", + IFCMATERIALCONSTITUENT: "IfcMaterialConstituent", + IFCLAGTIME: "IfcLagTime", + IFCINDEXEDTRIANGLETEXTUREMAP: "IfcIndexedTriangleTextureMap", + IFCINDEXEDTEXTUREMAP: "IfcIndexedTextureMap", + IFCINDEXEDCOLOURMAP: "IfcIndexedColourMap", + IFCEXTERNALREFERENCERELATIONSHIP: "IfcExternalReferenceRelationship", + IFCEXTENDEDPROPERTIES: "IfcExtendedProperties", + IFCEVENTTIME: "IfcEventTime", + IFCCONVERSIONBASEDUNITWITHOFFSET: "IfcConversionBasedUnitWithOffset", + IFCCOLOURRGBLIST: "IfcColourRgbList", + IFCWORKTIME: "IfcWorkTime", + IFCTIMEPERIOD: "IfcTimePeriod", + IFCTEXTUREVERTEXLIST: "IfcTextureVertexList", + IFCTASKTIMERECURRING: "IfcTaskTimeRecurring", + IFCTASKTIME: "IfcTaskTime", + IFCTABLECOLUMN: "IfcTableColumn", + IFCSURFACEREINFORCEMENTAREA: "IfcSurfaceReinforcementArea", + IFCSTRUCTURALLOADORRESULT: "IfcStructuralLoadOrResult", + IFCSTRUCTURALLOADCONFIGURATION: "IfcStructuralLoadConfiguration", + IFCSCHEDULINGTIME: "IfcSchedulingTime", + IFCRESOURCELEVELRELATIONSHIP: "IfcResourceLevelRelationship", + IFCREFERENCE: "IfcReference", + IFCRECURRENCEPATTERN: "IfcRecurrencePattern", + IFCPROPERTYABSTRACTION: "IfcPropertyAbstraction", + IFCPROJECTEDCRS: "IfcProjectedCrs", + IFCPRESENTATIONITEM: "IfcPresentationItem", + IFCMATERIALUSAGEDEFINITION: "IfcMaterialUsageDefinition", + IFCMATERIALPROFILEWITHOFFSETS: "IfcMaterialProfileWithOffsets", + IFCMATERIALPROFILESET: "IfcMaterialProfileSet", + IFCMATERIALPROFILE: "IfcMaterialProfile", + IFCMATERIALLAYERWITHOFFSETS: "IfcMaterialLayerWithOffsets", + IFCMATERIALDEFINITION: "IfcMaterialDefinition", + IFCMAPCONVERSION: "IfcMapConversion", + IFCEXTERNALINFORMATION: "IfcExternalInformation", + IFCCOORDINATEREFERENCESYSTEM: "IfcCoordinateReferenceSystem", + IFCCOORDINATEOPERATION: "IfcCoordinateOperation", + IFCCONNECTIONVOLUMEGEOMETRY: "IfcConnectionVolumeGeometry", + IFCREINFORCINGBAR: "IfcReinforcingBar", + IFCELECTRICDISTRIBUTIONPOINT: "IfcElectricDistributionPoint", + IFCDISTRIBUTIONCONTROLELEMENT: "IfcDistributionControlElement", + IFCDISTRIBUTIONCHAMBERELEMENT: "IfcDistributionChamberElement", + IFCCONTROLLERTYPE: "IfcControllerType", + IFCCHAMFEREDGEFEATURE: "IfcChamferEdgeFeature", + IFCBEAM: "IfcBeam", + IFCALARMTYPE: "IfcAlarmType", + IFCACTUATORTYPE: "IfcActuatorType", + IFCWINDOW: "IfcWindow", + IFCWALLSTANDARDCASE: "IfcWallStandardCase", + IFCWALL: "IfcWall", + IFCVIBRATIONISOLATORTYPE: "IfcVibrationIsolatorType", + IFCTENDONANCHOR: "IfcTendonAnchor", + IFCTENDON: "IfcTendon", + IFCSTRUCTURALANALYSISMODEL: "IfcStructuralAnalysisModel", + IFCSTAIRFLIGHT: "IfcStairFlight", + IFCSTAIR: "IfcStair", + IFCSLAB: "IfcSlab", + IFCSENSORTYPE: "IfcSensorType", + IFCROUNDEDEDGEFEATURE: "IfcRoundedEdgeFeature", + IFCROOF: "IfcRoof", + IFCREINFORCINGMESH: "IfcReinforcingMesh", + IFCREINFORCINGELEMENT: "IfcReinforcingElement", + IFCRATIONALBEZIERCURVE: "IfcRationalBezierCurve", + IFCRAMPFLIGHT: "IfcRampFlight", + IFCRAMP: "IfcRamp", + IFCRAILING: "IfcRailing", + IFCPLATE: "IfcPlate", + IFCPILE: "IfcPile", + IFCMEMBER: "IfcMember", + IFCFOOTING: "IfcFooting", + IFCFLOWTREATMENTDEVICE: "IfcFlowTreatmentDevice", + IFCFLOWTERMINAL: "IfcFlowTerminal", + IFCFLOWSTORAGEDEVICE: "IfcFlowStorageDevice", + IFCFLOWSEGMENT: "IfcFlowSegment", + IFCFLOWMOVINGDEVICE: "IfcFlowMovingDevice", + IFCFLOWINSTRUMENTTYPE: "IfcFlowInstrumentType", + IFCFLOWFITTING: "IfcFlowFitting", + IFCFLOWCONTROLLER: "IfcFlowController", + IFCFIRESUPPRESSIONTERMINALTYPE: "IfcFireSuppressionTerminalType", + IFCFILTERTYPE: "IfcFilterType", + IFCFANTYPE: "IfcFanType", + IFCENERGYCONVERSIONDEVICE: "IfcEnergyConversionDevice", + IFCELECTRICALELEMENT: "IfcElectricalElement", + IFCELECTRICALCIRCUIT: "IfcElectricalCircuit", + IFCELECTRICTIMECONTROLTYPE: "IfcElectricTimeControlType", + IFCELECTRICMOTORTYPE: "IfcElectricMotorType", + IFCELECTRICHEATERTYPE: "IfcElectricHeaterType", + IFCELECTRICGENERATORTYPE: "IfcElectricGeneratorType", + IFCELECTRICFLOWSTORAGEDEVICETYPE: "IfcElectricFlowStorageDeviceType", + IFCELECTRICAPPLIANCETYPE: "IfcElectricApplianceType", + IFCEDGEFEATURE: "IfcEdgeFeature", + IFCDUCTSILENCERTYPE: "IfcDuctSilencerType", + IFCDUCTSEGMENTTYPE: "IfcDuctSegmentType", + IFCDUCTFITTINGTYPE: "IfcDuctFittingType", + IFCDOOR: "IfcDoor", + IFCDISTRIBUTIONPORT: "IfcDistributionPort", + IFCDISTRIBUTIONFLOWELEMENT: "IfcDistributionFlowElement", + IFCDISTRIBUTIONELEMENT: "IfcDistributionElement", + IFCDISTRIBUTIONCONTROLELEMENTTYPE: "IfcDistributionControlElementType", + IFCDISTRIBUTIONCHAMBERELEMENTTYPE: "IfcDistributionChamberElementType", + IFCDISCRETEACCESSORYTYPE: "IfcDiscreteAccessoryType", + IFCDISCRETEACCESSORY: "IfcDiscreteAccessory", + IFCDIAMETERDIMENSION: "IfcDiameterDimension", + IFCDAMPERTYPE: "IfcDamperType", + IFCCURTAINWALL: "IfcCurtainWall", + IFCCOVERING: "IfcCovering", + IFCCOOLINGTOWERTYPE: "IfcCoolingTowerType", + IFCCOOLEDBEAMTYPE: "IfcCooledBeamType", + IFCCONSTRUCTIONPRODUCTRESOURCE: "IfcConstructionProductResource", + IFCCONSTRUCTIONMATERIALRESOURCE: "IfcConstructionMaterialResource", + IFCCONSTRUCTIONEQUIPMENTRESOURCE: "IfcConstructionEquipmentResource", + IFCCONDITIONCRITERION: "IfcConditionCriterion", + IFCCONDITION: "IfcCondition", + IFCCONDENSERTYPE: "IfcCondenserType", + IFCCOMPRESSORTYPE: "IfcCompressorType", + IFCCOLUMN: "IfcColumn", + IFCCOILTYPE: "IfcCoilType", + IFCCIRCLE: "IfcCircle", + IFCCHILLERTYPE: "IfcChillerType", + IFCCABLESEGMENTTYPE: "IfcCableSegmentType", + IFCCABLECARRIERSEGMENTTYPE: "IfcCableCarrierSegmentType", + IFCCABLECARRIERFITTINGTYPE: "IfcCableCarrierFittingType", + IFCBUILDINGELEMENTPROXYTYPE: "IfcBuildingElementProxyType", + IFCBUILDINGELEMENTPROXY: "IfcBuildingElementProxy", + IFCBUILDINGELEMENTPART: "IfcBuildingElementPart", + IFCBUILDINGELEMENTCOMPONENT: "IfcBuildingElementComponent", + IFCBUILDINGELEMENT: "IfcBuildingElement", + IFCBOILERTYPE: "IfcBoilerType", + IFCBEZIERCURVE: "IfcBezierCurve", + IFCBEAMTYPE: "IfcBeamType", + IFCBSPLINECURVE: "IfcBSplineCurve", + IFCASSET: "IfcAsset", + IFCANGULARDIMENSION: "IfcAngularDimension", + IFCAIRTOAIRHEATRECOVERYTYPE: "IfcAirToAirHeatRecoveryType", + IFCAIRTERMINALTYPE: "IfcAirTerminalType", + IFCAIRTERMINALBOXTYPE: "IfcAirTerminalBoxType", + IFCACTIONREQUEST: "IfcActionRequest", + IFC2DCOMPOSITECURVE: "Ifc2DCompositeCurve", + IFCZONE: "IfcZone", + IFCWORKSCHEDULE: "IfcWorkSchedule", + IFCWORKPLAN: "IfcWorkPlan", + IFCWORKCONTROL: "IfcWorkControl", + IFCWASTETERMINALTYPE: "IfcWasteTerminalType", + IFCWALLTYPE: "IfcWallType", + IFCVIRTUALELEMENT: "IfcVirtualElement", + IFCVALVETYPE: "IfcValveType", + IFCUNITARYEQUIPMENTTYPE: "IfcUnitaryEquipmentType", + IFCTUBEBUNDLETYPE: "IfcTubeBundleType", + IFCTRIMMEDCURVE: "IfcTrimmedCurve", + IFCTRANSPORTELEMENT: "IfcTransportElement", + IFCTRANSFORMERTYPE: "IfcTransformerType", + IFCTIMESERIESSCHEDULE: "IfcTimeSeriesSchedule", + IFCTANKTYPE: "IfcTankType", + IFCSYSTEM: "IfcSystem", + IFCSWITCHINGDEVICETYPE: "IfcSwitchingDeviceType", + IFCSUBCONTRACTRESOURCE: "IfcSubContractResource", + IFCSTRUCTURALSURFACECONNECTION: "IfcStructuralSurfaceConnection", + IFCSTRUCTURALRESULTGROUP: "IfcStructuralResultGroup", + IFCSTRUCTURALPOINTREACTION: "IfcStructuralPointReaction", + IFCSTRUCTURALPOINTCONNECTION: "IfcStructuralPointConnection", + IFCSTRUCTURALPOINTACTION: "IfcStructuralPointAction", + IFCSTRUCTURALPLANARACTIONVARYING: "IfcStructuralPlanarActionVarying", + IFCSTRUCTURALPLANARACTION: "IfcStructuralPlanarAction", + IFCSTRUCTURALLOADGROUP: "IfcStructuralLoadGroup", + IFCSTRUCTURALLINEARACTIONVARYING: "IfcStructuralLinearActionVarying", + IFCSTRUCTURALLINEARACTION: "IfcStructuralLinearAction", + IFCSTRUCTURALCURVEMEMBERVARYING: "IfcStructuralCurveMemberVarying", + IFCSTRUCTURALCURVEMEMBER: "IfcStructuralCurveMember", + IFCSTRUCTURALCURVECONNECTION: "IfcStructuralCurveConnection", + IFCSTRUCTURALCONNECTION: "IfcStructuralConnection", + IFCSTRUCTURALACTION: "IfcStructuralAction", + IFCSTAIRFLIGHTTYPE: "IfcStairFlightType", + IFCSTACKTERMINALTYPE: "IfcStackTerminalType", + IFCSPACETYPE: "IfcSpaceType", + IFCSPACEPROGRAM: "IfcSpaceProgram", + IFCSPACEHEATERTYPE: "IfcSpaceHeaterType", + IFCSPACE: "IfcSpace", + IFCSLABTYPE: "IfcSlabType", + IFCSITE: "IfcSite", + IFCSERVICELIFE: "IfcServiceLife", + IFCSCHEDULETIMECONTROL: "IfcScheduleTimeControl", + IFCSANITARYTERMINALTYPE: "IfcSanitaryTerminalType", + IFCRELASSIGNSTASKS: "IfcRelAssignsTasks", + IFCRELAGGREGATES: "IfcRelAggregates", + IFCRAMPFLIGHTTYPE: "IfcRampFlightType", + IFCRAILINGTYPE: "IfcRailingType", + IFCRADIUSDIMENSION: "IfcRadiusDimension", + IFCPUMPTYPE: "IfcPumpType", + IFCPROTECTIVEDEVICETYPE: "IfcProtectiveDeviceType", + IFCPROJECTIONELEMENT: "IfcProjectionElement", + IFCPROJECTORDERRECORD: "IfcProjectOrderRecord", + IFCPROJECTORDER: "IfcProjectOrder", + IFCPROCEDURE: "IfcProcedure", + IFCPORT: "IfcPort", + IFCPOLYLINE: "IfcPolyline", + IFCPLATETYPE: "IfcPlateType", + IFCPIPESEGMENTTYPE: "IfcPipeSegmentType", + IFCPIPEFITTINGTYPE: "IfcPipeFittingType", + IFCPERMIT: "IfcPermit", + IFCPERFORMANCEHISTORY: "IfcPerformanceHistory", + IFCOUTLETTYPE: "IfcOutletType", + IFCORDERACTION: "IfcOrderAction", + IFCOPENINGELEMENT: "IfcOpeningElement", + IFCOCCUPANT: "IfcOccupant", + IFCMOVE: "IfcMove", + IFCMOTORCONNECTIONTYPE: "IfcMotorConnectionType", + IFCMEMBERTYPE: "IfcMemberType", + IFCMECHANICALFASTENERTYPE: "IfcMechanicalFastenerType", + IFCMECHANICALFASTENER: "IfcMechanicalFastener", + IFCLINEARDIMENSION: "IfcLinearDimension", + IFCLIGHTFIXTURETYPE: "IfcLightFixtureType", + IFCLAMPTYPE: "IfcLampType", + IFCLABORRESOURCE: "IfcLaborResource", + IFCJUNCTIONBOXTYPE: "IfcJunctionBoxType", + IFCINVENTORY: "IfcInventory", + IFCHUMIDIFIERTYPE: "IfcHumidifierType", + IFCHEATEXCHANGERTYPE: "IfcHeatExchangerType", + IFCGROUP: "IfcGroup", + IFCGRID: "IfcGrid", + IFCGASTERMINALTYPE: "IfcGasTerminalType", + IFCFURNITURESTANDARD: "IfcFurnitureStandard", + IFCFURNISHINGELEMENT: "IfcFurnishingElement", + IFCFLOWTREATMENTDEVICETYPE: "IfcFlowTreatmentDeviceType", + IFCFLOWTERMINALTYPE: "IfcFlowTerminalType", + IFCFLOWSTORAGEDEVICETYPE: "IfcFlowStorageDeviceType", + IFCFLOWSEGMENTTYPE: "IfcFlowSegmentType", + IFCFLOWMOVINGDEVICETYPE: "IfcFlowMovingDeviceType", + IFCFLOWMETERTYPE: "IfcFlowMeterType", + IFCFLOWFITTINGTYPE: "IfcFlowFittingType", + IFCFLOWCONTROLLERTYPE: "IfcFlowControllerType", + IFCFEATUREELEMENTSUBTRACTION: "IfcFeatureElementSubtraction", + IFCFEATUREELEMENTADDITION: "IfcFeatureElementAddition", + IFCFEATUREELEMENT: "IfcFeatureElement", + IFCFASTENERTYPE: "IfcFastenerType", + IFCFASTENER: "IfcFastener", + IFCFACETEDBREPWITHVOIDS: "IfcFacetedBrepWithVoids", + IFCFACETEDBREP: "IfcFacetedBrep", + IFCEVAPORATORTYPE: "IfcEvaporatorType", + IFCEVAPORATIVECOOLERTYPE: "IfcEvaporativeCoolerType", + IFCEQUIPMENTSTANDARD: "IfcEquipmentStandard", + IFCEQUIPMENTELEMENT: "IfcEquipmentElement", + IFCENERGYCONVERSIONDEVICETYPE: "IfcEnergyConversionDeviceType", + IFCELLIPSE: "IfcEllipse", + IFCELEMENTCOMPONENTTYPE: "IfcElementComponentType", + IFCELEMENTCOMPONENT: "IfcElementComponent", + IFCELEMENTASSEMBLY: "IfcElementAssembly", + IFCELEMENT: "IfcElement", + IFCELECTRICALBASEPROPERTIES: "IfcElectricalBaseProperties", + IFCDISTRIBUTIONFLOWELEMENTTYPE: "IfcDistributionFlowElementType", + IFCDISTRIBUTIONELEMENTTYPE: "IfcDistributionElementType", + IFCDIMENSIONCURVEDIRECTEDCALLOUT: "IfcDimensionCurveDirectedCallout", + IFCCURTAINWALLTYPE: "IfcCurtainWallType", + IFCCREWRESOURCE: "IfcCrewResource", + IFCCOVERINGTYPE: "IfcCoveringType", + IFCCOSTSCHEDULE: "IfcCostSchedule", + IFCCOSTITEM: "IfcCostItem", + IFCCONTROL: "IfcControl", + IFCCONSTRUCTIONRESOURCE: "IfcConstructionResource", + IFCCONIC: "IfcConic", + IFCCOMPOSITECURVE: "IfcCompositeCurve", + IFCCOLUMNTYPE: "IfcColumnType", + IFCCIRCLEHOLLOWPROFILEDEF: "IfcCircleHollowProfileDef", + IFCBUILDINGSTOREY: "IfcBuildingStorey", + IFCBUILDINGELEMENTTYPE: "IfcBuildingElementType", + IFCBUILDING: "IfcBuilding", + IFCBOUNDEDCURVE: "IfcBoundedCurve", + IFCBOOLEANCLIPPINGRESULT: "IfcBooleanClippingResult", + IFCBLOCK: "IfcBlock", + IFCASYMMETRICISHAPEPROFILEDEF: "IfcAsymmetricIShapeProfileDef", + IFCANNOTATION: "IfcAnnotation", + IFCACTOR: "IfcActor", + IFCTRANSPORTELEMENTTYPE: "IfcTransportElementType", + IFCTASK: "IfcTask", + IFCSYSTEMFURNITUREELEMENTTYPE: "IfcSystemFurnitureElementType", + IFCSURFACEOFREVOLUTION: "IfcSurfaceOfRevolution", + IFCSURFACEOFLINEAREXTRUSION: "IfcSurfaceOfLinearExtrusion", + IFCSURFACECURVESWEPTAREASOLID: "IfcSurfaceCurveSweptAreaSolid", + IFCSTRUCTUREDDIMENSIONCALLOUT: "IfcStructuredDimensionCallout", + IFCSTRUCTURALSURFACEMEMBERVARYING: "IfcStructuralSurfaceMemberVarying", + IFCSTRUCTURALSURFACEMEMBER: "IfcStructuralSurfaceMember", + IFCSTRUCTURALREACTION: "IfcStructuralReaction", + IFCSTRUCTURALMEMBER: "IfcStructuralMember", + IFCSTRUCTURALITEM: "IfcStructuralItem", + IFCSTRUCTURALACTIVITY: "IfcStructuralActivity", + IFCSPHERE: "IfcSphere", + IFCSPATIALSTRUCTUREELEMENTTYPE: "IfcSpatialStructureElementType", + IFCSPATIALSTRUCTUREELEMENT: "IfcSpatialStructureElement", + IFCRIGHTCIRCULARCYLINDER: "IfcRightCircularCylinder", + IFCRIGHTCIRCULARCONE: "IfcRightCircularCone", + IFCREVOLVEDAREASOLID: "IfcRevolvedAreaSolid", + IFCRESOURCE: "IfcResource", + IFCRELVOIDSELEMENT: "IfcRelVoidsElement", + IFCRELSPACEBOUNDARY: "IfcRelSpaceBoundary", + IFCRELSERVICESBUILDINGS: "IfcRelServicesBuildings", + IFCRELSEQUENCE: "IfcRelSequence", + IFCRELSCHEDULESCOSTITEMS: "IfcRelSchedulesCostItems", + IFCRELREFERENCEDINSPATIALSTRUCTURE: "IfcRelReferencedInSpatialStructure", + IFCRELPROJECTSELEMENT: "IfcRelProjectsElement", + IFCRELOVERRIDESPROPERTIES: "IfcRelOverridesProperties", + IFCRELOCCUPIESSPACES: "IfcRelOccupiesSpaces", + IFCRELNESTS: "IfcRelNests", + IFCRELINTERACTIONREQUIREMENTS: "IfcRelInteractionRequirements", + IFCRELFLOWCONTROLELEMENTS: "IfcRelFlowControlElements", + IFCRELFILLSELEMENT: "IfcRelFillsElement", + IFCRELDEFINESBYTYPE: "IfcRelDefinesByType", + IFCRELDEFINESBYPROPERTIES: "IfcRelDefinesByProperties", + IFCRELDEFINES: "IfcRelDefines", + IFCRELDECOMPOSES: "IfcRelDecomposes", + IFCRELCOVERSSPACES: "IfcRelCoversSpaces", + IFCRELCOVERSBLDGELEMENTS: "IfcRelCoversBldgElements", + IFCRELCONTAINEDINSPATIALSTRUCTURE: "IfcRelContainedInSpatialStructure", + IFCRELCONNECTSWITHREALIZINGELEMENTS: "IfcRelConnectsWithRealizingElements", + IFCRELCONNECTSWITHECCENTRICITY: "IfcRelConnectsWithEccentricity", + IFCRELCONNECTSSTRUCTURALMEMBER: "IfcRelConnectsStructuralMember", + IFCRELCONNECTSSTRUCTURALELEMENT: "IfcRelConnectsStructuralElement", + IFCRELCONNECTSSTRUCTURALACTIVITY: "IfcRelConnectsStructuralActivity", + IFCRELCONNECTSPORTS: "IfcRelConnectsPorts", + IFCRELCONNECTSPORTTOELEMENT: "IfcRelConnectsPortToElement", + IFCRELCONNECTSPATHELEMENTS: "IfcRelConnectsPathElements", + IFCRELCONNECTSELEMENTS: "IfcRelConnectsElements", + IFCRELCONNECTS: "IfcRelConnects", + IFCRELASSOCIATESPROFILEPROPERTIES: "IfcRelAssociatesProfileProperties", + IFCRELASSOCIATESMATERIAL: "IfcRelAssociatesMaterial", + IFCRELASSOCIATESLIBRARY: "IfcRelAssociatesLibrary", + IFCRELASSOCIATESDOCUMENT: "IfcRelAssociatesDocument", + IFCRELASSOCIATESCONSTRAINT: "IfcRelAssociatesConstraint", + IFCRELASSOCIATESCLASSIFICATION: "IfcRelAssociatesClassification", + IFCRELASSOCIATESAPPROVAL: "IfcRelAssociatesApproval", + IFCRELASSOCIATESAPPLIEDVALUE: "IfcRelAssociatesAppliedValue", + IFCRELASSOCIATES: "IfcRelAssociates", + IFCRELASSIGNSTORESOURCE: "IfcRelAssignsToResource", + IFCRELASSIGNSTOPROJECTORDER: "IfcRelAssignsToProjectOrder", + IFCRELASSIGNSTOPRODUCT: "IfcRelAssignsToProduct", + IFCRELASSIGNSTOPROCESS: "IfcRelAssignsToProcess", + IFCRELASSIGNSTOGROUP: "IfcRelAssignsToGroup", + IFCRELASSIGNSTOCONTROL: "IfcRelAssignsToControl", + IFCRELASSIGNSTOACTOR: "IfcRelAssignsToActor", + IFCRELASSIGNS: "IfcRelAssigns", + IFCRECTANGULARTRIMMEDSURFACE: "IfcRectangularTrimmedSurface", + IFCRECTANGULARPYRAMID: "IfcRectangularPyramid", + IFCRECTANGLEHOLLOWPROFILEDEF: "IfcRectangleHollowProfileDef", + IFCPROXY: "IfcProxy", + IFCPROPERTYSET: "IfcPropertySet", + IFCPROJECTIONCURVE: "IfcProjectionCurve", + IFCPROJECT: "IfcProject", + IFCPRODUCT: "IfcProduct", + IFCPROCESS: "IfcProcess", + IFCPLANE: "IfcPlane", + IFCPLANARBOX: "IfcPlanarBox", + IFCPERMEABLECOVERINGPROPERTIES: "IfcPermeableCoveringProperties", + IFCOFFSETCURVE3D: "IfcOffsetCurve3D", + IFCOFFSETCURVE2D: "IfcOffsetCurve2D", + IFCOBJECT: "IfcObject", + IFCMANIFOLDSOLIDBREP: "IfcManifoldSolidBrep", + IFCLINE: "IfcLine", + IFCLSHAPEPROFILEDEF: "IfcLShapeProfileDef", + IFCISHAPEPROFILEDEF: "IfcIShapeProfileDef", + IFCGEOMETRICCURVESET: "IfcGeometricCurveSet", + IFCFURNITURETYPE: "IfcFurnitureType", + IFCFURNISHINGELEMENTTYPE: "IfcFurnishingElementType", + IFCFLUIDFLOWPROPERTIES: "IfcFluidFlowProperties", + IFCFILLAREASTYLETILES: "IfcFillAreaStyleTiles", + IFCFILLAREASTYLETILESYMBOLWITHSTYLE: "IfcFillAreaStyleTileSymbolWithStyle", + IFCFILLAREASTYLEHATCHING: "IfcFillAreaStyleHatching", + IFCFACEBASEDSURFACEMODEL: "IfcFaceBasedSurfaceModel", + IFCEXTRUDEDAREASOLID: "IfcExtrudedAreaSolid", + IFCENERGYPROPERTIES: "IfcEnergyProperties", + IFCELLIPSEPROFILEDEF: "IfcEllipseProfileDef", + IFCELEMENTARYSURFACE: "IfcElementarySurface", + IFCELEMENTTYPE: "IfcElementType", + IFCELEMENTQUANTITY: "IfcElementQuantity", + IFCEDGELOOP: "IfcEdgeLoop", + IFCDRAUGHTINGPREDEFINEDCURVEFONT: "IfcDraughtingPredefinedCurveFont", + IFCDRAUGHTINGPREDEFINEDCOLOUR: "IfcDraughtingPredefinedColour", + IFCDRAUGHTINGCALLOUT: "IfcDraughtingCallout", + IFCDOORSTYLE: "IfcDoorStyle", + IFCDOORPANELPROPERTIES: "IfcDoorPanelProperties", + IFCDOORLININGPROPERTIES: "IfcDoorLiningProperties", + IFCDIRECTION: "IfcDirection", + IFCDIMENSIONCURVETERMINATOR: "IfcDimensionCurveTerminator", + IFCDIMENSIONCURVE: "IfcDimensionCurve", + IFCDEFINEDSYMBOL: "IfcDefinedSymbol", + IFCCURVEBOUNDEDPLANE: "IfcCurveBoundedPlane", + IFCCURVE: "IfcCurve", + IFCCSGSOLID: "IfcCsgSolid", + IFCCSGPRIMITIVE3D: "IfcCsgPrimitive3D", + IFCCRANERAILFSHAPEPROFILEDEF: "IfcCraneRailFShapeProfileDef", + IFCCRANERAILASHAPEPROFILEDEF: "IfcCraneRailAShapeProfileDef", + IFCCOMPOSITECURVESEGMENT: "IfcCompositeCurveSegment", + IFCCLOSEDSHELL: "IfcClosedShell", + IFCCIRCLEPROFILEDEF: "IfcCircleProfileDef", + IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM: + "IfcCartesianTransformationOperator3DNonUniform", + IFCCARTESIANTRANSFORMATIONOPERATOR3D: "IfcCartesianTransformationOperator3D", + IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM: + "IfcCartesianTransformationOperator2DNonUniform", + IFCCARTESIANTRANSFORMATIONOPERATOR2D: "IfcCartesianTransformationOperator2D", + IFCCARTESIANTRANSFORMATIONOPERATOR: "IfcCartesianTransformationOperator", + IFCCARTESIANPOINT: "IfcCartesianPoint", + IFCCSHAPEPROFILEDEF: "IfcCShapeProfileDef", + IFCBOXEDHALFSPACE: "IfcBoxedHalfSpace", + IFCBOUNDINGBOX: "IfcBoundingBox", + IFCBOUNDEDSURFACE: "IfcBoundedSurface", + IFCBOOLEANRESULT: "IfcBooleanResult", + IFCAXIS2PLACEMENT3D: "IfcAxis2Placement3D", + IFCAXIS2PLACEMENT2D: "IfcAxis2Placement2D", + IFCAXIS1PLACEMENT: "IfcAxis1Placement", + IFCANNOTATIONSURFACE: "IfcAnnotationSurface", + IFCANNOTATIONFILLAREAOCCURRENCE: "IfcAnnotationFillAreaOccurrence", + IFCANNOTATIONFILLAREA: "IfcAnnotationFillArea", + IFCANNOTATIONCURVEOCCURRENCE: "IfcAnnotationCurveOccurrence", + IFCZSHAPEPROFILEDEF: "IfcZShapeProfileDef", + IFCWINDOWSTYLE: "IfcWindowStyle", + IFCWINDOWPANELPROPERTIES: "IfcWindowPanelProperties", + IFCWINDOWLININGPROPERTIES: "IfcWindowLiningProperties", + IFCVERTEXLOOP: "IfcVertexLoop", + IFCVECTOR: "IfcVector", + IFCUSHAPEPROFILEDEF: "IfcUShapeProfileDef", + IFCTYPEPRODUCT: "IfcTypeProduct", + IFCTYPEOBJECT: "IfcTypeObject", + IFCTWODIRECTIONREPEATFACTOR: "IfcTwoDirectionRepeatFactor", + IFCTRAPEZIUMPROFILEDEF: "IfcTrapeziumProfileDef", + IFCTEXTLITERALWITHEXTENT: "IfcTextLiteralWithExtent", + IFCTEXTLITERAL: "IfcTextLiteral", + IFCTERMINATORSYMBOL: "IfcTerminatorSymbol", + IFCTSHAPEPROFILEDEF: "IfcTShapeProfileDef", + IFCSWEPTSURFACE: "IfcSweptSurface", + IFCSWEPTDISKSOLID: "IfcSweptDiskSolid", + IFCSWEPTAREASOLID: "IfcSweptAreaSolid", + IFCSURFACESTYLERENDERING: "IfcSurfaceStyleRendering", + IFCSURFACE: "IfcSurface", + IFCSUBEDGE: "IfcSubedge", + IFCSTRUCTURALSTEELPROFILEPROPERTIES: "IfcStructuralSteelProfileProperties", + IFCSTRUCTURALPROFILEPROPERTIES: "IfcStructuralProfileProperties", + IFCSTRUCTURALLOADSINGLEFORCEWARPING: "IfcStructuralLoadSingleForceWarping", + IFCSTRUCTURALLOADSINGLEFORCE: "IfcStructuralLoadSingleForce", + IFCSTRUCTURALLOADSINGLEDISPLACEMENTDISTORTION: + "IfcStructuralLoadSingleDisplacementDistortion", + IFCSTRUCTURALLOADSINGLEDISPLACEMENT: "IfcStructuralLoadSingleDisplacement", + IFCSTRUCTURALLOADPLANARFORCE: "IfcStructuralLoadPlanarForce", + IFCSTRUCTURALLOADLINEARFORCE: "IfcStructuralLoadLinearForce", + IFCSPACETHERMALLOADPROPERTIES: "IfcSpaceThermalLoadProperties", + IFCSOUNDVALUE: "IfcSoundValue", + IFCSOUNDPROPERTIES: "IfcSoundProperties", + IFCSOLIDMODEL: "IfcSolidModel", + IFCSLIPPAGECONNECTIONCONDITION: "IfcSlippageConnectionCondition", + IFCSHELLBASEDSURFACEMODEL: "IfcShellBasedSurfaceModel", + IFCSERVICELIFEFACTOR: "IfcServiceLifeFactor", + IFCSECTIONEDSPINE: "IfcSectionedSpine", + IFCROUNDEDRECTANGLEPROFILEDEF: "IfcRoundedRectangleProfileDef", + IFCRELATIONSHIP: "IfcRelationship", + IFCREINFORCEMENTDEFINITIONPROPERTIES: "IfcReinforcementDefinitionProperties", + IFCREGULARTIMESERIES: "IfcRegularTimeSeries", + IFCRECTANGLEPROFILEDEF: "IfcRectangleProfileDef", + IFCPROPERTYTABLEVALUE: "IfcPropertyTableValue", + IFCPROPERTYSINGLEVALUE: "IfcPropertySingleValue", + IFCPROPERTYSETDEFINITION: "IfcPropertySetDefinition", + IFCPROPERTYREFERENCEVALUE: "IfcPropertyReferenceValue", + IFCPROPERTYLISTVALUE: "IfcPropertyListValue", + IFCPROPERTYENUMERATEDVALUE: "IfcPropertyEnumeratedValue", + IFCPROPERTYDEFINITION: "IfcPropertyDefinition", + IFCPROPERTYBOUNDEDVALUE: "IfcPropertyBoundedValue", + IFCPRODUCTDEFINITIONSHAPE: "IfcProductDefinitionShape", + IFCPREDEFINEDPOINTMARKERSYMBOL: "IfcPredefinedPointMarkerSymbol", + IFCPREDEFINEDDIMENSIONSYMBOL: "IfcPredefinedDimensionSymbol", + IFCPREDEFINEDCURVEFONT: "IfcPredefinedCurveFont", + IFCPREDEFINEDCOLOUR: "IfcPredefinedColour", + IFCPOLYGONALBOUNDEDHALFSPACE: "IfcPolygonalBoundedHalfSpace", + IFCPOLYLOOP: "IfcPolyLoop", + IFCPOINTONSURFACE: "IfcPointOnSurface", + IFCPOINTONCURVE: "IfcPointOnCurve", + IFCPOINT: "IfcPoint", + IFCPLANAREXTENT: "IfcPlanarExtent", + IFCPLACEMENT: "IfcPlacement", + IFCPIXELTEXTURE: "IfcPixelTexture", + IFCPHYSICALCOMPLEXQUANTITY: "IfcPhysicalComplexQuantity", + IFCPATH: "IfcPath", + IFCPARAMETERIZEDPROFILEDEF: "IfcParameterizedProfileDef", + IFCORIENTEDEDGE: "IfcOrientedEdge", + IFCOPENSHELL: "IfcOpenShell", + IFCONEDIRECTIONREPEATFACTOR: "IfcOneDirectionRepeatFactor", + IFCOBJECTDEFINITION: "IfcObjectDefinition", + IFCMECHANICALCONCRETEMATERIALPROPERTIES: + "IfcMechanicalConcreteMaterialProperties", + IFCMATERIALDEFINITIONREPRESENTATION: "IfcMaterialDefinitionRepresentation", + IFCMAPPEDITEM: "IfcMappedItem", + IFCLOOP: "IfcLoop", + IFCLOCALPLACEMENT: "IfcLocalPlacement", + IFCLIGHTSOURCESPOT: "IfcLightSourceSpot", + IFCLIGHTSOURCEPOSITIONAL: "IfcLightSourcePositional", + IFCLIGHTSOURCEGONIOMETRIC: "IfcLightSourceGoniometric", + IFCLIGHTSOURCEDIRECTIONAL: "IfcLightSourceDirectional", + IFCLIGHTSOURCEAMBIENT: "IfcLightSourceAmbient", + IFCLIGHTSOURCE: "IfcLightSource", + IFCIRREGULARTIMESERIES: "IfcIrregularTimeSeries", + IFCIMAGETEXTURE: "IfcImageTexture", + IFCHYGROSCOPICMATERIALPROPERTIES: "IfcHygroscopicMaterialProperties", + IFCHALFSPACESOLID: "IfcHalfSpaceSolid", + IFCGRIDPLACEMENT: "IfcGridPlacement", + IFCGEOMETRICSET: "IfcGeometricSet", + IFCGEOMETRICREPRESENTATIONSUBCONTEXT: "IfcGeometricRepresentationSubContext", + IFCGEOMETRICREPRESENTATIONITEM: "IfcGeometricRepresentationItem", + IFCGEOMETRICREPRESENTATIONCONTEXT: "IfcGeometricRepresentationContext", + IFCGENERALPROFILEPROPERTIES: "IfcGeneralProfileProperties", + IFCGENERALMATERIALPROPERTIES: "IfcGeneralMaterialProperties", + IFCFUELPROPERTIES: "IfcFuelProperties", + IFCFILLAREASTYLE: "IfcFillAreaStyle", + IFCFAILURECONNECTIONCONDITION: "IfcFailureConnectionCondition", + IFCFACESURFACE: "IfcFaceSurface", + IFCFACEOUTERBOUND: "IfcFaceOuterBound", + IFCFACEBOUND: "IfcFaceBound", + IFCFACE: "IfcFace", + IFCEXTENDEDMATERIALPROPERTIES: "IfcExtendedMaterialProperties", + IFCEDGECURVE: "IfcEdgeCurve", + IFCEDGE: "IfcEdge", + IFCDRAUGHTINGPREDEFINEDTEXTFONT: "IfcDraughtingPredefinedTextFont", + IFCDOCUMENTREFERENCE: "IfcDocumentReference", + IFCDIMENSIONPAIR: "IfcDimensionPair", + IFCDIMENSIONCALLOUTRELATIONSHIP: "IfcDimensionCalloutRelationship", + IFCDERIVEDPROFILEDEF: "IfcDerivedProfileDef", + IFCCURVESTYLE: "IfcCurveStyle", + IFCCONVERSIONBASEDUNIT: "IfcConversionBasedUnit", + IFCCONTEXTDEPENDENTUNIT: "IfcContextDependentUnit", + IFCCONNECTIONPOINTECCENTRICITY: "IfcConnectionPointEccentricity", + IFCCONNECTIONCURVEGEOMETRY: "IfcConnectionCurveGeometry", + IFCCONNECTEDFACESET: "IfcConnectedFaceSet", + IFCCOMPOSITEPROFILEDEF: "IfcCompositeProfileDef", + IFCCOMPLEXPROPERTY: "IfcComplexProperty", + IFCCOLOURRGB: "IfcColourRgb", + IFCCLASSIFICATIONREFERENCE: "IfcClassificationReference", + IFCCENTERLINEPROFILEDEF: "IfcCenterLineProfileDef", + IFCBLOBTEXTURE: "IfcBlobTexture", + IFCARBITRARYPROFILEDEFWITHVOIDS: "IfcArbitraryProfileDefWithVoids", + IFCARBITRARYOPENPROFILEDEF: "IfcArbitraryOpenProfileDef", + IFCARBITRARYCLOSEDPROFILEDEF: "IfcArbitraryClosedProfileDef", + IFCANNOTATIONTEXTOCCURRENCE: "IfcAnnotationTextOccurrence", + IFCANNOTATIONSYMBOLOCCURRENCE: "IfcAnnotationSymbolOccurrence", + IFCANNOTATIONSURFACEOCCURRENCE: "IfcAnnotationSurfaceOccurrence", + IFCANNOTATIONOCCURRENCE: "IfcAnnotationOccurrence", + IFCWATERPROPERTIES: "IfcWaterProperties", + IFCVIRTUALGRIDINTERSECTION: "IfcVirtualGridIntersection", + IFCVERTEXPOINT: "IfcVertexPoint", + IFCVERTEXBASEDTEXTUREMAP: "IfcVertexBasedTextureMap", + IFCVERTEX: "IfcVertex", + IFCUNITASSIGNMENT: "IfcUnitAssignment", + IFCTOPOLOGYREPRESENTATION: "IfcTopologyRepresentation", + IFCTOPOLOGICALREPRESENTATIONITEM: "IfcTopologicalRepresentationItem", + IFCTIMESERIESVALUE: "IfcTimeSeriesValue", + IFCTIMESERIESREFERENCERELATIONSHIP: "IfcTimeSeriesReferenceRelationship", + IFCTIMESERIES: "IfcTimeSeries", + IFCTHERMALMATERIALPROPERTIES: "IfcThermalMaterialProperties", + IFCTEXTUREVERTEX: "IfcTextureVertex", + IFCTEXTUREMAP: "IfcTextureMap", + IFCTEXTURECOORDINATEGENERATOR: "IfcTextureCoordinateGenerator", + IFCTEXTURECOORDINATE: "IfcTextureCoordinate", + IFCTEXTSTYLEWITHBOXCHARACTERISTICS: "IfcTextStyleWithBoxCharacteristics", + IFCTEXTSTYLETEXTMODEL: "IfcTextStyleTextModel", + IFCTEXTSTYLEFORDEFINEDFONT: "IfcTextStyleForDefinedFont", + IFCTEXTSTYLEFONTMODEL: "IfcTextStyleFontModel", + IFCTEXTSTYLE: "IfcTextStyle", + IFCTELECOMADDRESS: "IfcTelecomAddress", + IFCTABLEROW: "IfcTableRow", + IFCTABLE: "IfcTable", + IFCSYMBOLSTYLE: "IfcSymbolStyle", + IFCSURFACETEXTURE: "IfcSurfaceTexture", + IFCSURFACESTYLEWITHTEXTURES: "IfcSurfaceStyleWithTextures", + IFCSURFACESTYLESHADING: "IfcSurfaceStyleShading", + IFCSURFACESTYLEREFRACTION: "IfcSurfaceStyleRefraction", + IFCSURFACESTYLELIGHTING: "IfcSurfaceStyleLighting", + IFCSURFACESTYLE: "IfcSurfaceStyle", + IFCSTYLEDREPRESENTATION: "IfcStyledRepresentation", + IFCSTYLEDITEM: "IfcStyledItem", + IFCSTYLEMODEL: "IfcStyleModel", + IFCSTRUCTURALLOADTEMPERATURE: "IfcStructuralLoadTemperature", + IFCSTRUCTURALLOADSTATIC: "IfcStructuralLoadStatic", + IFCSTRUCTURALLOAD: "IfcStructuralLoad", + IFCSTRUCTURALCONNECTIONCONDITION: "IfcStructuralConnectionCondition", + IFCSIMPLEPROPERTY: "IfcSimpleProperty", + IFCSHAPEREPRESENTATION: "IfcShapeRepresentation", + IFCSHAPEMODEL: "IfcShapeModel", + IFCSHAPEASPECT: "IfcShapeAspect", + IFCSECTIONREINFORCEMENTPROPERTIES: "IfcSectionReinforcementProperties", + IFCSECTIONPROPERTIES: "IfcSectionProperties", + IFCSIUNIT: "IfcSIUnit", + IFCROOT: "IfcRoot", + IFCRIBPLATEPROFILEPROPERTIES: "IfcRibPlateProfileProperties", + IFCREPRESENTATIONMAP: "IfcRepresentationMap", + IFCREPRESENTATIONITEM: "IfcRepresentationItem", + IFCREPRESENTATIONCONTEXT: "IfcRepresentationContext", + IFCREPRESENTATION: "IfcRepresentation", + IFCRELAXATION: "IfcRelaxation", + IFCREINFORCEMENTBARPROPERTIES: "IfcReinforcementBarProperties", + IFCREFERENCESVALUEDOCUMENT: "IfcReferencesValueDocument", + IFCQUANTITYWEIGHT: "IfcQuantityWeight", + IFCQUANTITYVOLUME: "IfcQuantityVolume", + IFCQUANTITYTIME: "IfcQuantityTime", + IFCQUANTITYLENGTH: "IfcQuantityLength", + IFCQUANTITYCOUNT: "IfcQuantityCount", + IFCQUANTITYAREA: "IfcQuantityArea", + IFCPROPERTYENUMERATION: "IfcPropertyEnumeration", + IFCPROPERTYDEPENDENCYRELATIONSHIP: "IfcPropertyDependencyRelationship", + IFCPROPERTYCONSTRAINTRELATIONSHIP: "IfcPropertyConstraintRelationship", + IFCPROPERTY: "IfcProperty", + IFCPROFILEPROPERTIES: "IfcProfileProperties", + IFCPROFILEDEF: "IfcProfileDef", + IFCPRODUCTSOFCOMBUSTIONPROPERTIES: "IfcProductsOfCombustionProperties", + IFCPRODUCTREPRESENTATION: "IfcProductRepresentation", + IFCPRESENTATIONSTYLEASSIGNMENT: "IfcPresentationStyleAssignment", + IFCPRESENTATIONSTYLE: "IfcPresentationStyle", + IFCPRESENTATIONLAYERWITHSTYLE: "IfcPresentationLayerWithStyle", + IFCPRESENTATIONLAYERASSIGNMENT: "IfcPresentationLayerAssignment", + IFCPREDEFINEDTEXTFONT: "IfcPredefinedTextFont", + IFCPREDEFINEDTERMINATORSYMBOL: "IfcPredefinedTerminatorSymbol", + IFCPREDEFINEDSYMBOL: "IfcPredefinedSymbol", + IFCPREDEFINEDITEM: "IfcPredefinedItem", + IFCPOSTALADDRESS: "IfcPostalAddress", + IFCPHYSICALSIMPLEQUANTITY: "IfcPhysicalSimpleQuantity", + IFCPHYSICALQUANTITY: "IfcPhysicalQuantity", + IFCPERSONANDORGANIZATION: "IfcPersonAndOrganization", + IFCPERSON: "IfcPerson", + IFCOWNERHISTORY: "IfcOwnerHistory", + IFCORGANIZATIONRELATIONSHIP: "IfcOrganizationRelationship", + IFCORGANIZATION: "IfcOrganization", + IFCOPTICALMATERIALPROPERTIES: "IfcOpticalMaterialProperties", + IFCOBJECTIVE: "IfcObjective", + IFCOBJECTPLACEMENT: "IfcObjectPlacement", + IFCNAMEDUNIT: "IfcNamedUnit", + IFCMONETARYUNIT: "IfcMonetaryUnit", + IFCMETRIC: "IfcMetric", + IFCMECHANICALSTEELMATERIALPROPERTIES: "IfcMechanicalSteelMaterialProperties", + IFCMECHANICALMATERIALPROPERTIES: "IfcMechanicalMaterialProperties", + IFCMEASUREWITHUNIT: "IfcMeasureWithUnit", + IFCMATERIALPROPERTIES: "IfcMaterialProperties", + IFCMATERIALLIST: "IfcMaterialList", + IFCMATERIALLAYERSETUSAGE: "IfcMaterialLayerSetUsage", + IFCMATERIALLAYERSET: "IfcMaterialLayerSet", + IFCMATERIALLAYER: "IfcMaterialLayer", + IFCMATERIALCLASSIFICATIONRELATIONSHIP: + "IfcMaterialClassificationRelationship", + IFCMATERIAL: "IfcMaterial", + IFCLOCALTIME: "IfcLocalTime", + IFCLIGHTINTENSITYDISTRIBUTION: "IfcLightIntensityDistribution", + IFCLIGHTDISTRIBUTIONDATA: "IfcLightDistributionData", + IFCLIBRARYREFERENCE: "IfcLibraryReference", + IFCLIBRARYINFORMATION: "IfcLibraryInformation", + IFCIRREGULARTIMESERIESVALUE: "IfcIrregularTimeSeriesValue", + IFCGRIDAXIS: "IfcGridAxis", + IFCEXTERNALLYDEFINEDTEXTFONT: "IfcExternallyDefinedTextFont", + IFCEXTERNALLYDEFINEDSYMBOL: "IfcExternallyDefinedSymbol", + IFCEXTERNALLYDEFINEDSURFACESTYLE: "IfcExternallyDefinedSurfaceStyle", + IFCEXTERNALLYDEFINEDHATCHSTYLE: "IfcExternallyDefinedHatchStyle", + IFCEXTERNALREFERENCE: "IfcExternalReference", + IFCENVIRONMENTALIMPACTVALUE: "IfcEnvironmentalImpactValue", + IFCDRAUGHTINGCALLOUTRELATIONSHIP: "IfcDraughtingCalloutRelationship", + IFCDOCUMENTINFORMATIONRELATIONSHIP: "IfcDocumentInformationRelationship", + IFCDOCUMENTINFORMATION: "IfcDocumentInformation", + IFCDOCUMENTELECTRONICFORMAT: "IfcDocumentElectronicFormat", + IFCDIMENSIONALEXPONENTS: "IfcDimensionalExponents", + IFCDERIVEDUNITELEMENT: "IfcDerivedUnitElement", + IFCDERIVEDUNIT: "IfcDerivedUnit", + IFCDATEANDTIME: "IfcDateAndTime", + IFCCURVESTYLEFONTPATTERN: "IfcCurveStyleFontPattern", + IFCCURVESTYLEFONTANDSCALING: "IfcCurveStyleFontAndScaling", + IFCCURVESTYLEFONT: "IfcCurveStyleFont", + IFCCURRENCYRELATIONSHIP: "IfcCurrencyRelationship", + IFCCOSTVALUE: "IfcCostValue", + IFCCOORDINATEDUNIVERSALTIMEOFFSET: "IfcCoordinatedUniversalTimeOffset", + IFCCONSTRAINTRELATIONSHIP: "IfcConstraintRelationship", + IFCCONSTRAINTCLASSIFICATIONRELATIONSHIP: + "IfcConstraintClassificationRelationship", + IFCCONSTRAINTAGGREGATIONRELATIONSHIP: "IfcConstraintAggregationRelationship", + IFCCONSTRAINT: "IfcConstraint", + IFCCONNECTIONSURFACEGEOMETRY: "IfcConnectionSurfaceGeometry", + IFCCONNECTIONPORTGEOMETRY: "IfcConnectionPortGeometry", + IFCCONNECTIONPOINTGEOMETRY: "IfcConnectionPointGeometry", + IFCCONNECTIONGEOMETRY: "IfcConnectionGeometry", + IFCCOLOURSPECIFICATION: "IfcColourSpecification", + IFCCLASSIFICATIONNOTATIONFACET: "IfcClassificationNotationFacet", + IFCCLASSIFICATIONNOTATION: "IfcClassificationNotation", + IFCCLASSIFICATIONITEMRELATIONSHIP: "IfcClassificationItemRelationship", + IFCCLASSIFICATIONITEM: "IfcClassificationItem", + IFCCLASSIFICATION: "IfcClassification", + IFCCALENDARDATE: "IfcCalendarDate", + IFCBOUNDARYNODECONDITIONWARPING: "IfcBoundaryNodeConditionWarping", + IFCBOUNDARYNODECONDITION: "IfcBoundaryNodeCondition", + IFCBOUNDARYFACECONDITION: "IfcBoundaryFaceCondition", + IFCBOUNDARYEDGECONDITION: "IfcBoundaryEdgeCondition", + IFCBOUNDARYCONDITION: "IfcBoundaryCondition", + IFCAPPROVALRELATIONSHIP: "IfcApprovalRelationship", + IFCAPPROVALPROPERTYRELATIONSHIP: "IfcApprovalPropertyRelationship", + IFCAPPROVALACTORRELATIONSHIP: "IfcApprovalActorRelationship", + IFCAPPROVAL: "IfcApproval", + IFCAPPLIEDVALUERELATIONSHIP: "IfcAppliedValueRelationship", + IFCAPPLIEDVALUE: "IfcAppliedValue", + IFCAPPLICATION: "IfcApplication", + IFCADDRESS: "IfcAddress", + IFCACTORROLE: "IfcActorRole", +}; diff --git a/packages/core/src/ifc/Utils/index.ts b/packages/core/src/ifc/Utils/index.ts index f4fa1cb17..6e15fe061 100644 --- a/packages/core/src/ifc/Utils/index.ts +++ b/packages/core/src/ifc/Utils/index.ts @@ -2,3 +2,4 @@ export * from "./ifc-categories"; export * from "./ifc-elements-map"; export * from "./ifc-category-map"; export * from "./properties-utils"; +export * from "./ifc-category-case"; diff --git a/packages/core/src/ifc/index.ts b/packages/core/src/ifc/index.ts index 38cc45ff0..7199ff08c 100644 --- a/packages/core/src/ifc/index.ts +++ b/packages/core/src/ifc/index.ts @@ -2,3 +2,4 @@ export * from "./IfcJsonExporter"; export * from "./IfcRelationsIndexer"; export * from "./IfcPropertiesManager"; export * from "./Utils"; +export * from "./IfcFinder"; diff --git a/packages/core/src/openbim/BCFTopics/index.ts b/packages/core/src/openbim/BCFTopics/index.ts index c6509e803..03cdf879e 100644 --- a/packages/core/src/openbim/BCFTopics/index.ts +++ b/packages/core/src/openbim/BCFTopics/index.ts @@ -8,21 +8,25 @@ import { Event, World, DataMap, -} from "../../core/Types"; +} from "../../core"; + import { BCFTopic, - BCFTopicsConfig, BCFVersion, Topic, extensionsImporter, + BCFTopicsConfigManager, + BCFTopicsConfig, + Comment, } from "./src"; + import { BCFViewpoint, Viewpoint, ViewpointCamera, Viewpoints, } from "../../core/Viewpoints"; -import { Comment } from "./src/Comment"; + import { Clipper } from "../../core/Clipper"; // TODO: Extract import/export logic in its own class for better maintenance. @@ -33,7 +37,7 @@ import { Clipper } from "../../core/Clipper"; */ export class BCFTopics extends Component - implements Disposable, Configurable + implements Disposable, Configurable { static uuid = "de977976-e4f6-4e4f-a01a-204727839802" as const; enabled = false; @@ -52,7 +56,7 @@ export class BCFTopics trimValues: true, }); - config: Required = { + protected _defaultConfig: Required = { author: "jhon.doe@example.com", version: "2.1", types: new Set([ @@ -77,13 +81,37 @@ export class BCFTopics ignoreIncompleteTopicsOnImport: false, }; + config = new BCFTopicsConfigManager(this, this.components, "BCF Topics"); + readonly list = new DataMap(); readonly onSetup = new Event(); isSetup = false; setup(config?: Partial) { if (this.isSetup) return; - this.config = { ...this.config, ...config }; + + const fullConfig = { ...this._defaultConfig, ...config }; + + this.config.version = fullConfig.version; + this.config.author = fullConfig.author; + this.config.types = fullConfig.types; + this.config.statuses = fullConfig.statuses; + this.config.priorities = fullConfig.priorities; + this.config.labels = fullConfig.labels; + this.config.stages = fullConfig.stages; + this.config.users = fullConfig.users; + this.config.includeSelectionTag = fullConfig.includeSelectionTag; + this.config.updateExtensionsOnImport = fullConfig.updateExtensionsOnImport; + this.config.strict = fullConfig.strict; + this.config.includeAllExtensionsOnExport = + fullConfig.includeAllExtensionsOnExport; + + this.config.fallbackVersionOnImport = + fullConfig.fallbackVersionOnImport || ""; + + this.config.ignoreIncompleteTopicsOnImport = + fullConfig.ignoreIncompleteTopicsOnImport; + this.isSetup = true; this.enabled = true; this.onSetup.trigger(); diff --git a/packages/core/src/openbim/BCFTopics/src/bcf-topics-config.ts b/packages/core/src/openbim/BCFTopics/src/bcf-topics-config.ts new file mode 100644 index 000000000..e42e2511d --- /dev/null +++ b/packages/core/src/openbim/BCFTopics/src/bcf-topics-config.ts @@ -0,0 +1,290 @@ +import { BCFTopics, BCFVersion } from "../index"; +import { + BooleanSettingsControl, + Configurator, + SelectSettingControl, + TextSetSettingControl, + TextSettingsControl, +} from "../../../core"; + +/** + * Configuration settings for managing BCF topics. + * This interface defines the properties and their meanings used to control the behavior of exporting and importing BCF topics. + */ +export interface BCFTopicsConfig { + /** + * The BCF version used during export. + */ + version: BCFVersion; + + /** + * The email of the user creating topics using this component. + */ + author: string; + + /** + * The set of allowed topic types. This is exported inside the + * [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure). + */ + types: Set; + + /** + * The set of allowed topic statuses. This is exported inside the + * [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure). + */ + statuses: Set; + + /** + * The set of allowed topic priorities. This is exported inside the + * [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure). + */ + priorities: Set; + + /** + * The set of allowed topic labels. This is exported inside the + * [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure). + */ + labels: Set; + + /** + * The set of allowed topic stages. This is exported inside the + * [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure). + */ + stages: Set; + + /** + * The set of allowed topic users. This is exported inside the + * [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure). + */ + users: Set; + + /** + * Whether or not to include the AuthoringSoftwareId in the viewpoint components during export. + */ + includeSelectionTag: boolean; + + /** + * Updates the types, statuses, users, etc., after importing an external BCF. + */ + updateExtensionsOnImport: boolean; + + /** + * Only allow to use the extensions (types, statuses, etc.) defined in the config when setting the corresponding data in a topic. + */ + strict: boolean; + + /** + * If true, export the extensions (types, status, etc.) based on topics data. This doesn't update the extensions in the config. + * If false, only export the extensions defined in each collection of possibilities set in the config. + * In all cases, all the values from each collection of extensions defined in the config are going to be exported. + */ + includeAllExtensionsOnExport: boolean; + + /** + * Version to be used when importing if no bcf.version file is present in the incoming data. + * When null, the importer will throw an error if the version is missing or is not supported. + */ + fallbackVersionOnImport: BCFVersion | null; + + /** + * If true, do not import a topic with missing information (guid, type, status, title, creationDate or creationAuthor). + * If false, use default values for missing data. + */ + ignoreIncompleteTopicsOnImport: boolean; +} + +type BCFTopicsConfigType = { + version: SelectSettingControl; + author: TextSettingsControl; + types: TextSetSettingControl; + statuses: TextSetSettingControl; + priorities: TextSetSettingControl; + labels: TextSetSettingControl; + stages: TextSetSettingControl; + users: TextSetSettingControl; + includeSelectionTag: BooleanSettingsControl; + updateExtensionsOnImport: BooleanSettingsControl; + strict: BooleanSettingsControl; + includeAllExtensionsOnExport: BooleanSettingsControl; + fallbackVersionOnImport: SelectSettingControl; + ignoreIncompleteTopicsOnImport: BooleanSettingsControl; +}; + +export class BCFTopicsConfigManager extends Configurator< + BCFTopics, + BCFTopicsConfigType +> { + protected _config: BCFTopicsConfigType = { + version: { + type: "Select" as const, + options: new Set(), + multiple: false, + value: "", + }, + author: { + type: "Text" as const, + value: "", + }, + types: { + type: "TextSet" as const, + value: new Set(), + }, + statuses: { + type: "TextSet" as const, + value: new Set(), + }, + priorities: { + type: "TextSet" as const, + value: new Set(), + }, + labels: { + type: "TextSet" as const, + value: new Set(), + }, + stages: { + type: "TextSet" as const, + value: new Set(), + }, + users: { + type: "TextSet" as const, + value: new Set(), + }, + includeSelectionTag: { + type: "Boolean" as const, + value: false, + }, + updateExtensionsOnImport: { + type: "Boolean" as const, + value: false, + }, + strict: { + type: "Boolean" as const, + value: false, + }, + includeAllExtensionsOnExport: { + type: "Boolean" as const, + value: false, + }, + fallbackVersionOnImport: { + type: "Select" as const, + multiple: false, + options: new Set(), + value: "", + }, + ignoreIncompleteTopicsOnImport: { + type: "Boolean" as const, + value: false, + }, + }; + + get version() { + return this._config.version.value; + } + set version(value) { + this._config.version.value = value; + } + + get author() { + return this._config.author.value; + } + + set author(value) { + this._config.author.value = value; + } + + get types() { + return this._config.types.value; + } + + set types(value) { + this._config.types.value = value; + } + + get statuses() { + return this._config.statuses.value; + } + + set statuses(value) { + this._config.statuses.value = value; + } + + get priorities() { + return this._config.priorities.value; + } + + set priorities(value) { + this._config.priorities.value = value; + } + + get labels() { + return this._config.labels.value; + } + + set labels(value) { + this._config.labels.value = value; + } + + get stages() { + return this._config.stages.value; + } + + set stages(value) { + this._config.stages.value = value; + } + + get users() { + return this._config.users.value; + } + + set users(value) { + this._config.users.value = value; + } + + get includeSelectionTag() { + return this._config.includeSelectionTag.value; + } + + set includeSelectionTag(value) { + this._config.includeSelectionTag.value = value; + } + + get updateExtensionsOnImport() { + return this._config.updateExtensionsOnImport.value; + } + + set updateExtensionsOnImport(value) { + this._config.updateExtensionsOnImport.value = value; + } + + get strict() { + return this._config.strict.value; + } + + set strict(value) { + this._config.strict.value = value; + } + + get includeAllExtensionsOnExport() { + return this._config.includeAllExtensionsOnExport.value; + } + + set includeAllExtensionsOnExport(value) { + this._config.includeAllExtensionsOnExport.value = value; + } + + get fallbackVersionOnImport() { + return this._config.fallbackVersionOnImport.value; + } + + set fallbackVersionOnImport(value) { + this._config.fallbackVersionOnImport.value = value; + } + + get ignoreIncompleteTopicsOnImport() { + return this._config.ignoreIncompleteTopicsOnImport.value; + } + + set ignoreIncompleteTopicsOnImport(value) { + this._config.ignoreIncompleteTopicsOnImport.value = value; + } +} diff --git a/packages/core/src/openbim/BCFTopics/src/index.ts b/packages/core/src/openbim/BCFTopics/src/index.ts index 973b81240..aff86fc5d 100644 --- a/packages/core/src/openbim/BCFTopics/src/index.ts +++ b/packages/core/src/openbim/BCFTopics/src/index.ts @@ -2,3 +2,4 @@ export * from "./Topic"; export * from "./types"; export * from "./Comment"; export * from "./importers"; +export * from "./bcf-topics-config"; diff --git a/packages/core/src/openbim/BCFTopics/src/types.ts b/packages/core/src/openbim/BCFTopics/src/types.ts index 33f930cb9..b87c5bbd9 100644 --- a/packages/core/src/openbim/BCFTopics/src/types.ts +++ b/packages/core/src/openbim/BCFTopics/src/types.ts @@ -18,89 +18,3 @@ export interface BCFTopic { description?: string; stage?: string; } - -/** - * Configuration settings for managing BCF topics. - * This interface defines the properties and their meanings used to control the behavior of exporting and importing BCF topics. - */ -export interface BCFTopicsConfig { - /** - * The BCF version used during export. - */ - version: BCFVersion; - - /** - * The email of the user creating topics using this component. - */ - author: string; - - /** - * The set of allowed topic types. This is exported inside the - * [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure). - */ - types: Set; - - /** - * The set of allowed topic statuses. This is exported inside the - * [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure). - */ - statuses: Set; - - /** - * The set of allowed topic priorities. This is exported inside the - * [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure). - */ - priorities: Set; - - /** - * The set of allowed topic labels. This is exported inside the - * [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure). - */ - labels: Set; - - /** - * The set of allowed topic stages. This is exported inside the - * [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure). - */ - stages: Set; - - /** - * The set of allowed topic users. This is exported inside the - * [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure). - */ - users: Set; - - /** - * Whether or not to include the AuthoringSoftwareId in the viewpoint components during export. - */ - includeSelectionTag: boolean; - - /** - * Updates the types, statuses, users, etc., after importing an external BCF. - */ - updateExtensionsOnImport: boolean; - - /** - * Only allow to use the extensions (types, statuses, etc.) defined in the config when setting the corresponding data in a topic. - */ - strict: boolean; - - /** - * If true, export the extensions (types, status, etc.) based on topics data. This doesn't update the extensions in the config. - * If false, only export the extensions defined in each collection of possibilities set in the config. - * In all cases, all the values from each collection of extensions defined in the config are going to be exported. - */ - includeAllExtensionsOnExport: boolean; - - /** - * Version to be used when importing if no bcf.version file is present in the incoming data. - * When null, the importer will throw an error if the version is missing or is not supported. - */ - fallbackVersionOnImport: BCFVersion | null; - - /** - * If true, do not import a topic with missing information (guid, type, status, title, creationDate or creationAuthor). - * If false, use default values for missing data. - */ - ignoreIncompleteTopicsOnImport: boolean; -} diff --git a/packages/core/src/openbim/IDSSpecifications/example.html b/packages/core/src/openbim/IDSSpecifications/example.html new file mode 100644 index 000000000..0eb1ffb2f --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/example.html @@ -0,0 +1,49 @@ + + + + + + + IDS Specifications + + + + + + + + + \ No newline at end of file diff --git a/packages/core/src/openbim/IDSSpecifications/example.ts b/packages/core/src/openbim/IDSSpecifications/example.ts new file mode 100644 index 000000000..2bae2787a --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/example.ts @@ -0,0 +1,214 @@ +// import * as FRAGS from "@thatopen/fragments"; +import * as OBC from "../.."; + +const components = new OBC.Components(); +const ifcLoader = components.get(OBC.IfcLoader); +await ifcLoader.setup(); +// const file = await fetch("/resources/structure.ifc"); +// const file = await fetch( +// "https://raw.githubusercontent.com/buildingSMART/IDS/development/Documentation/ImplementersDocumentation/TestCases/attribute/fail-a_prohibited_facet_returns_the_opposite_of_a_required_facet.ifc", +// ); +// const data = await file.arrayBuffer(); +// const buffer = new Uint8Array(data); +// const model = await ifcLoader.load(buffer); + +// const indexer = components.get(OBC.IfcRelationsIndexer); +// await indexer.process(model); + +const ids = components.get(OBC.IDSSpecifications); +const specification = ids.create("My First IDS!", ["IFC4X3_ADD2"]); +specification.description = "Description"; +specification.instructions = "Instructions"; + +// Define some facets to be used in specifications +const entityFacet = new OBC.IDSEntity(components, { + type: "enumeration", + parameter: ["IFCSLAB", "IFCWALL"], +}); + +specification.applicability.add(entityFacet); + +const propertyFacet = new OBC.IDSProperty( + components, + { type: "simple", parameter: "Pset_SlabCommon" }, + { type: "simple", parameter: "IsExternal" }, +); + +propertyFacet.value = { type: "simple", parameter: false }; + +specification.requirements.add(propertyFacet); + +const idsTitle = "My Custom IDS"; +const idsExport = ids.export({ title: idsTitle }); +const file = new File([idsExport], "idsTitle.ids"); +const a = document.createElement("a"); +a.href = URL.createObjectURL(file); +a.download = file.name; +// a.click(); +// URL.revokeObjectURL(a.href); + +// const classificationFacet = new OBC.IDSClassification(components, { +// type: "simple", +// parameter: "Uniformat", +// }); + +// const partOfFacet = new OBC.IDSPartOf(components, { +// name: { type: "simple", parameter: "IFCBUILDINGSTOREY" }, +// }); + +// partOfFacet.relation = WEBIFC.IFCRELCONTAINEDINSPATIALSTRUCTURE; + +// // IfcSlab entities must have a Pset_SlabCommon with an IsExternal property set to false +// const entitiesA: FRAGS.IfcProperties = {}; +// await entityFacet.getEntities(model, entitiesA); +// const resultA = await propertyFacet.test(entitiesA, model); +// logResult(resultA); + +// // Entities with a Pset_SlabCommon including an IsExternal property set to false, must be IfcSlab +// const entitiesB: FRAGS.IfcProperties = {}; +// await propertyFacet.getEntities(model, entitiesB); +// const resultB = await entityFacet.test(entitiesB); +// logResult(resultB); + +// // Entities with Uniformat IfcClassification must be IfcSlab +// const entitiesC: FRAGS.IfcProperties = {}; +// await classificationFacet.getEntities(model, entitiesC); +// const resultC = await entityFacet.test(entitiesC); +// logResult(resultC); + +// // IfcSlab entities must have IfcClassification as Uniformat +// const entitiesD: FRAGS.IfcProperties = {}; +// await entityFacet.getEntities(model, entitiesD); +// const resultD = await classificationFacet.test(entitiesD, model); +// logResult(resultD); + +// // IfcSlab entities must be related with IfcBuildingStorey +// const entitiesE: FRAGS.IfcProperties = {}; +// await entityFacet.getEntities(model, entitiesE); +// const resultE = await partOfFacet.test(entitiesE, model); +// logResult(resultE); + +// // Entities related with any IfcBuildingStorey must have a Pset_SlabCommon with an IsExternal property set to false +// const entitiesF: FRAGS.IfcProperties = {}; +// await partOfFacet.getEntities(model, entitiesF); +// const resultF = await propertyFacet.test(entitiesF, model); +// logResult(resultF); + +// Importing +// const idsFile = await fetch( +// "https://raw.githubusercontent.com/buildingSMART/IDS/development/Documentation/ImplementersDocumentation/TestCases/attribute/fail-a_prohibited_facet_returns_the_opposite_of_a_required_facet.ids", +// ); +// const idsFile = await fetch("/resources/ids.ids"); + +// const idsData = await idsFile.text(); +// const imports = ids.load(idsData); +// for (const spec of imports) { +// const app = [...spec.applicability][0]; +// const req = [...spec.requirements][0]; +// const entities: FRAGS.IfcProperties = {}; +// await app.getEntities(model, entities); +// const result = await req.test(entities, model); +// logResult(result); +// } + +// Load test cases from GitHub +// Define the URL for fetching the files list +// const apiURL = +// "https://api.github.com/repos/buildingSMART/IDS/contents/Documentation/ImplementersDocumentation/TestCases/property?ref=development"; + +// Function to process each pair of IFC and IDS files +// async function processPair(ifcUrl: string, idsUrl: string) { +// try { +// const routes = ifcUrl.split("/"); +// const name = routes[routes.length - 1]; +// const pieces = name.split("-"); +// const bsResult = pieces[0] === "pass"; + +// // Fetch the IFC and IDS content +// const ifcResponse = await fetch(ifcUrl); +// const idsResponse = await fetch(idsUrl); + +// if (!ifcResponse.ok || !idsResponse.ok) { +// throw new Error("Error fetching IFC or IDS file"); +// } + +// const ifcContent = await ifcResponse.arrayBuffer(); +// const idsContent = await idsResponse.text(); + +// const model = await ifcLoader.load(new Uint8Array(ifcContent)); +// await indexer.process(model); + +// const imports = ids.load(idsContent); +// for (const spec of imports) { +// const app = [...spec.applicability][0]; +// const req = [...spec.requirements][0]; +// const entities: FRAGS.IfcProperties = {}; +// await app.getEntities(model, entities); +// const result = await req.test(entities, model); +// const passes = result.filter(({ pass }) => pass); +// const fails = result.filter(({ pass }) => !pass); +// console.log(bsResult, passes, fails, ifcUrl, idsUrl); +// } + +// // Use your custom loaders for IFC and IDS +// // customIfcLoader(ifcContent); +// // customIdsLoader(idsContent); + +// // console.log(`Successfully processed pair: ${ifcUrl}, ${idsUrl}`); +// } catch (error) { +// // console.error(`Error processing pair: ${ifcUrl}, ${idsUrl}`, error); +// } +// } + +// Function to fetch the list of files and group them by pairs (IFC + IDS) +// async function fetchFileListAndProcessPairs() { +// try { +// const response = await fetch(apiURL); + +// if (!response.ok) { +// throw new Error(`Error fetching files list: ${response.statusText}`); +// } + +// const files = await response.json(); +// const filePairs: { [key: string]: { ifc?: string; ids?: string } } = {}; + +// // Group files by their base names +// for (const file of files) { +// const fileName = file.name; + +// // Extract the base name (everything before the file extension) +// const baseName = fileName.split(".").slice(0, -1).join("."); + +// // Check if the file is an .ifc or .ids and group them +// if (fileName.endsWith(".ifc")) { +// if (!filePairs[baseName]) filePairs[baseName] = {}; +// filePairs[baseName].ifc = file.download_url; +// } else if (fileName.endsWith(".ids")) { +// if (!filePairs[baseName]) filePairs[baseName] = {}; +// filePairs[baseName].ids = file.download_url; +// } +// } + +// // Now process each pair using the custom loaders +// for (const baseName in filePairs) { +// const { ifc, ids } = filePairs[baseName]; + +// if (ifc && ids) { +// // console.log(`Processing pair: ${baseName}`); +// await processPair(ifc, ids); +// } else { +// // console.warn(`Pair incomplete for ${baseName}`); +// } +// } +// } catch (error) { +// console.error(error); +// } +// } + +// Call the function to fetch and process file pairs +// fetchFileListAndProcessPairs(); + +// const baseURL = +// "https://raw.githubusercontent.com/buildingSMART/IDS/development/Documentation/ImplementersDocumentation/TestCases"; +// const url = `${baseURL}/property/pass-a_number_specified_as_a_string_is_treated_as_a_string`; +// processPair(`${url}.ifc`, `${url}.ids`); diff --git a/packages/core/src/openbim/IDSSpecifications/index.ts b/packages/core/src/openbim/IDSSpecifications/index.ts new file mode 100644 index 000000000..778c05051 --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/index.ts @@ -0,0 +1,210 @@ +import * as FRAGS from "@thatopen/fragments"; +import { XMLParser } from "fast-xml-parser"; +import { Component, DataMap } from "../../core/Types"; +import { + IDSCheckResult, + IDSFacet, + IDSInfo, + IDSSpecification, + IfcVersion, +} from "./src"; +import { Components } from "../../core"; +import { + createEntityFacets, + createAttributeFacets, + createClassificationFacets, +} from "./src/importers"; +import { createPropertyFacets } from "./src/importers/property"; + +/** + * Component that manages Information Delivery Specification (IDS) data. + * It provides functionality for importing, exporting, and manipulating IDS data. + */ +export class IDSSpecifications extends Component { + static uuid = "9f0b9f78-9b2e-481a-b766-2fbfd01f342c" as const; + enabled = true; + static xmlParser = new XMLParser({ + allowBooleanAttributes: true, + attributeNamePrefix: "", + ignoreAttributes: false, + ignoreDeclaration: true, + ignorePiTags: true, + numberParseOptions: { leadingZeros: true, hex: true }, + parseAttributeValue: true, + preserveOrder: false, + processEntities: false, + removeNSPrefix: true, + trimValues: true, + }); + + constructor(components: Components) { + super(components); + components.add(IDSSpecifications.uuid, this); + } + + readonly list = new DataMap(); + + /** + * Retrieves a FragmentIdMap based on the given IDSCheckResult array. + * The map separates the IDs into two categories: pass and fail. + * + * @param model - The FragmentsGroup model from which to retrieve the fragment map. + * @param result - An array of IDSCheckResult objects, each representing a check result. + * + * @returns An object containing two properties: + * - `pass`: A FragmentIdMap that passed the checks. + * - `fail`: A FragmentIdMap that failed the checks. + */ + getFragmentIdMap(model: FRAGS.FragmentsGroup, result: IDSCheckResult[]) { + const passResults = result.filter((check) => check.pass); + const passIDs = passResults.map((check) => check.expressID); + const pass = model.getFragmentMap(passIDs); + + const failResults = result.filter((check) => !check.pass); + const failIDs = failResults.map((check) => check.expressID); + const fail = model.getFragmentMap(failIDs); + + return { pass, fail }; + } + + /** + * Creates a new IDSSpecification instance and adds it to the list. + * + * @param name - The name of the IDSSpecification. + * @param ifcVersion - An array of IfcVersion values that the specification supports. + * + * @returns The newly created IDSSpecification instance. + */ + create(name: string, ifcVersion: IfcVersion[]) { + const specification = new IDSSpecification( + this.components, + name, + ifcVersion, + ); + + this.list.set(specification.identifier, specification); + + return specification; + } + + /** + * Parses and processes an XML string containing Information Delivery Specification (IDS) data. + * It creates IDSSpecification instances based on the parsed data and returns them in an array. + * Also, the instances are added to the list array. + * + * @param data - The XML string to parse. + * + * @returns An array of IDSSpecification instances created from the parsed data. + */ + load(data: string) { + const result: IDSSpecification[] = []; + const ids = IDSSpecifications.xmlParser.parse(data).ids; + const { specifications } = ids; + if (specifications && specifications.specification) { + const specs = Array.isArray(specifications.specification) + ? specifications.specification + : [specifications.specification]; + + for (const spec of specs) { + const { name, ifcVersion } = spec; + if (!(name && ifcVersion)) continue; + + const applicabilities: IDSFacet[] = []; + const reqs: IDSFacet[] = []; + + const { applicability, requirements } = spec; + + if (applicability) { + const { maxOccurs, ...rest } = applicability; + const facets = Array.isArray(rest) ? rest : [rest]; + for (const facet of facets) { + for (const facetName in facet) { + const elements = Array.isArray(facet[facetName]) + ? facet[facetName] + : [facet[facetName]]; + if (facetName === "entity") { + const facets = createEntityFacets(this.components, elements); + applicabilities.push(...facets); + } + } + } + } + + if (requirements) { + const { maxOccurs, ...rest } = requirements; + const facets = Array.isArray(rest) ? rest : [rest]; + for (const facet of facets) { + for (const facetName in facet) { + const elements = Array.isArray(facet[facetName]) + ? facet[facetName] + : [facet[facetName]]; + if (facetName === "entity") { + const facets = createEntityFacets(this.components, elements); + reqs.push(...facets); + } + if (facetName === "attribute") { + const facets = createAttributeFacets(this.components, elements); + reqs.push(...facets); + } + if (facetName === "classification") { + const facets = createClassificationFacets( + this.components, + elements, + ); + reqs.push(...facets); + } + if (facetName === "property") { + const facets = createPropertyFacets(this.components, elements); + reqs.push(...facets); + } + } + } + } + + if (applicabilities.length > 0 && reqs.length > 0) { + const specification = this.create(name, ifcVersion.split(/\s+/)); + specification.applicability.add(...applicabilities); + specification.requirements.add(...reqs); + result.push(specification); + } + } + } + return result; + } + + /** + * Exports the IDSSpecifications data into an XML string. + * + * @param info - The metadata information for the exported XML. + * @param specifications - An optional iterable of IDSSpecification instances to export. + * If not provided, all specifications in the list will be exported. + * + * @returns A string containing the exported IDSSpecifications data in XML format. + */ + export( + info: IDSInfo, + specifications: Iterable = this.list.values(), + ) { + const _specifications = specifications ?? this.list; + const xml = ` + + + ${info.title} + ${info.copyright ? `${info.copyright}` : ""} + ${info.version ? `${info.version}` : ""} + ${info.description ? `${info.description}` : ""} + ${info.author ? `${info.author}` : ""} + ${info.date ? `${info.date.toISOString().split("T")[0]}` : ""} + ${info.purpose ? `${info.purpose}` : ""} + ${info.milestone ? `${info.milestone}` : ""} + + + ${[..._specifications].map((spec) => spec.serialize()).join("\n")} + +`; + + return xml; + } +} + +export * from "./src"; diff --git a/packages/core/src/openbim/IDSSpecifications/src/Specification.ts b/packages/core/src/openbim/IDSSpecifications/src/Specification.ts new file mode 100644 index 000000000..c5e11b784 --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/src/Specification.ts @@ -0,0 +1,112 @@ +import * as FRAGS from "@thatopen/fragments"; +import { Components } from "../../../core/Components"; +import { DataSet } from "../../../core/Types"; +import { IDSCheckResult, IfcVersion } from "./types"; +import { UUID } from "../../../utils"; +import { IDSFacet } from "./facets"; + +/** + * Represents a single specification from the Information Delivery Specification (IDS) standard. + * + * @remarks This class provides methods for testing a model against the specification, + * as well as serializing the specification into XML format. + */ +export class IDSSpecification { + name: string; + ifcVersion = new Set(); + identifier = UUID.create(); + description?: string; + instructions?: string; + requirementsDescription?: string; + applicability = new DataSet(); + requirements = new DataSet(); + + protected components: Components; + + constructor(components: Components, name: string, ifcVersion: IfcVersion[]) { + this.components = components; + this.name = name; + for (const version of ifcVersion) { + this.ifcVersion.add(version); + } + } + + /** + * Tests the model to test against the specification's requirements. + * + * @param model - The model to be tested. + * @returns An array representing the test results. + * If no requirements are defined for the specification, an empty array is returned. + */ + async test(model: FRAGS.FragmentsGroup) { + let result: IDSCheckResult[] = []; + + if (this.requirements.size === 0) return result; + + // Get applicable elements + const entities: FRAGS.IfcProperties = {}; + for (const facet of this.applicability) { + await facet.getEntities(model, entities); + } + + // Test applicable elements against requirements + const requirement = [...this.requirements][0]; + result = await requirement.test(entities, model); + return result; + // const requirementsResult: { [expressId: string]: boolean } = {}; + // for (const expressID in entities) { + // requirementsResult[expressID] = true; + // } + + // for (const requirement of this.requirements) { + // const arrayEntities = Object.values(entities); + // const checkingElements = arrayEntities.filter( + // (entity) => requirementsResult[entity.expressID], + // ); + // const test = await requirement.test(checkingElements, model); + // for (const expressID in test.fail) { + // requirementsResult[expressID] = false; + // } + // } + + // for (const expressID in requirementsResult) { + // const entity = entities[expressID]; + // if (!entity) continue; + // if (requirementsResult[expressID]) { + // result.pass[expressID] = entity; + // } else { + // result.fail[expressID] = entity; + // } + // } + } + + /** + * Serializes the IDSSpecification instance into XML format. + * + * @remarks This method is not meant to be used directly. It is used by the IDSSpecifications component. + * + * @returns The XML representation of the IDSSpecification. + */ + serialize() { + const name = `name="${this.name}"`; + const identifier = this.identifier ? `identifier="${this.identifier}"` : ""; + + const description = this.description + ? `description="${this.description}"` + : ""; + + const instructions = this.instructions + ? `instructions="${this.instructions}"` + : ""; + + const xml = ` + + ${[...this.applicability].map((facet) => facet.serialize("applicability"))} + + + ${[...this.requirements].map((facet) => facet.serialize("requirement"))} + + `; + return xml; + } +} diff --git a/packages/core/src/openbim/IDSSpecifications/src/exporters/parameter.ts b/packages/core/src/openbim/IDSSpecifications/src/exporters/parameter.ts new file mode 100644 index 000000000..02c357d03 --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/src/exporters/parameter.ts @@ -0,0 +1,37 @@ +import { + IDSFacetParameterName, + IDSFacetParameter, + IDSEnumerationParameter, + IDSPatternParameter, +} from "../types"; + +export const getParameterXML = ( + name: IDSFacetParameterName, + parameter?: IDSFacetParameter, +) => { + let parameterXML = ""; + if (!parameter) return parameterXML; + if (parameter.type === "simple") { + parameterXML = `${parameter.parameter}`; + } + + if (parameter.type === "enumeration") { + const value = parameter.parameter as IDSEnumerationParameter; + parameterXML = ` + ${value.map((v) => ``).join("\r\n")} + `; + } + + if (parameter.type === "pattern") { + const value = parameter.parameter as IDSPatternParameter; + parameterXML = ` + + `; + } + + const xml = ` + ${parameterXML} + `; + + return xml; +}; diff --git a/packages/core/src/openbim/IDSSpecifications/src/facets/Attribute.ts b/packages/core/src/openbim/IDSSpecifications/src/facets/Attribute.ts new file mode 100644 index 000000000..10965a711 --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/src/facets/Attribute.ts @@ -0,0 +1,174 @@ +import * as FRAGS from "@thatopen/fragments"; +import { IDSCheck, IDSCheckResult, IDSFacetParameter } from "../types"; +import { Components } from "../../../../core/Components"; +import { IDSFacet } from "./Facet"; +import { getParameterXML } from "../exporters/parameter"; + +// https://github.com/buildingSMART/IDS/blob/development/Documentation/UserManual/attribute-facet.md + +export class IDSAttribute extends IDSFacet { + name: IDSFacetParameter; + value?: IDSFacetParameter; + + constructor(components: Components, name: IDSFacetParameter) { + super(components); + this.name = name; + } + + serialize(type: "applicability" | "requirement") { + const nameXML = getParameterXML("Name", this.name); + const valueXML = getParameterXML("Value", this.value); + let attributes = ""; + if (type === "requirement") { + attributes += `cardinality="${this.cardinality}"`; + attributes += this.instructions + ? `instructions="${this.instructions}"` + : ""; + } + return ` + ${nameXML} + ${valueXML} +`; + } + + // This can be very ineficcient as we do not have an easy way to get an entity based on an attribute + // Right now, all entities must be iterated. + // When the new IfcEntitiesFinder comes, this can become easier. + // This may be greatly increase in performance if the applicability has any of the other facets and this is applied the latest + async getEntities() { + return []; + } + // async getEntities( + // model: FRAGS.FragmentsGroup, + // collector: FRAGS.IfcProperties = {}, + // ) { + // return []; + // // for (const expressID in model) { + // // if (collector[expressID]) continue; + // // const entity = model[expressID]; + // // // Check if the attribute exists + // // const attribute = entity[this.name]; + // // const attributeExists = !!attribute; + // // // Check if the attribute value matches + // // let valueMatches = true; + // // if (attributeExists && this.value && this.value.value) { + // // if (this.value.type === "simpleValue") { + // // valueMatches = attribute.value === this.value.value; + // // } + // // if (this.value.type === "restriction") { + // // const regex = new RegExp(this.value.value); + // // valueMatches = regex.test(attribute.value); + // // } + // // } + // // if (attributeExists && valueMatches) { + // // collector[entity.expressID] = entity; + // // } + // // } + // } + + // https://github.com/buildingSMART/IDS/tree/development/Documentation/ImplementersDocumentation/TestCases/attribute + // Test cases from buildingSMART repo have been tested and they all match with the expected result + // All invalid cases have been treated as failures + // FragmentsGroup do not hold some of the entities used in the tests + async test(entities: FRAGS.IfcProperties) { + this.testResult = []; + for (const _expressID in entities) { + const expressID = Number(_expressID); + const attrs = entities[expressID]; + + const checks: IDSCheck[] = []; + const result: IDSCheckResult = { + guid: attrs.GlobalId?.value, + expressID, + pass: false, + checks, + cardinality: this.cardinality, + }; + + this.testResult.push(result); + + // Check if the attribute exists + const attrNames = Object.keys(attrs); + const matchingAttributes = attrNames.filter((name) => { + const nameMatches = this.evalRequirement(name, this.name, "Name"); + const attrValue = attrs[name]; + // IDSDocs: Attributes with null values always fail + if (nameMatches && attrValue === null) { + if ( + this.cardinality === "optional" || + this.cardinality === "prohibited" + ) { + return true; + } + return false; + } + // IDSDocs: Attributes with a logical unknown always fail + if (nameMatches && attrValue?.type === 3 && attrValue.value === 2) { + return false; + } + // IDSDocs: Attributes with an empty list always fail + if (nameMatches && Array.isArray(attrValue) && attrValue.length === 0) { + return false; + } + // IDSDocs: Attributes with empty strings always fail + if ( + nameMatches && + attrValue?.type === 1 && + attrValue.value.trim() === "" + ) { + return false; + } + return nameMatches; + }); + + const attributeMatches = matchingAttributes.length > 0; + + checks.push({ + parameter: "Name", + currentValue: attributeMatches ? matchingAttributes[0] : null, + requiredValue: this.name.parameter, + pass: + this.cardinality === "prohibited" + ? !attributeMatches + : attributeMatches, + }); + + // Check if the attribute value matches + if (this.value) { + if (matchingAttributes[0]) { + const attribute = attrs[matchingAttributes[0]]; + // Value checks always fail for objects + const isRef = attribute?.type === 5; + if (isRef) { + checks.push({ + parameter: "Value", + currentValue: null, + requiredValue: this.value.parameter, + pass: this.cardinality === "prohibited", + }); + } else { + this.evalRequirement( + attribute ? attribute.value : null, + this.value, + "Value", + checks, + ); + } + } else { + checks.push({ + parameter: "Value", + currentValue: null, + requiredValue: this.value.parameter, + pass: this.cardinality === "prohibited", + }); + } + } + + result.pass = checks.every(({ pass }) => pass); + } + + const result = [...this.testResult]; + this.testResult = []; + return result; + } +} diff --git a/packages/core/src/openbim/IDSSpecifications/src/facets/Classification.ts b/packages/core/src/openbim/IDSSpecifications/src/facets/Classification.ts new file mode 100644 index 000000000..b2ef5fc6c --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/src/facets/Classification.ts @@ -0,0 +1,318 @@ +import * as FRAGS from "@thatopen/fragments"; +import * as WEBIFC from "web-ifc"; +import { Components } from "../../../../core/Components"; +import { IDSCheck, IDSCheckResult, IDSFacetParameter } from "../types"; +import { IfcRelationsIndexer } from "../../../../ifc/IfcRelationsIndexer"; +import { IDSFacet } from "./Facet"; +import { getParameterXML } from "../exporters/parameter"; + +// https://github.com/buildingSMART/IDS/blob/development/Documentation/UserManual/classification-facet.md + +export class IDSClassification extends IDSFacet { + system: IDSFacetParameter; + value?: IDSFacetParameter; + uri?: string; + + constructor(components: Components, system: IDSFacetParameter) { + super(components); + this.system = system; + } + + serialize(type: "applicability" | "requirement") { + const systemXML = getParameterXML("System", this.system); + const valueXML = getParameterXML("Value", this.value); + let attributes = ""; + if (type === "requirement") { + attributes += `cardinality="${this.cardinality}"`; + attributes += this.uri ? `uri=${this.uri}` : ""; + attributes += this.instructions + ? `instructions="${this.instructions}"` + : ""; + } + return ` + ${systemXML} + ${valueXML} +`; + } + + async getEntities( + model: FRAGS.FragmentsGroup, + collector: FRAGS.IfcProperties = {}, + ) { + const result: number[] = []; + + const references = await model.getAllPropertiesOfType( + WEBIFC.IFCCLASSIFICATIONREFERENCE, + ); + + const classifications = await model.getAllPropertiesOfType( + WEBIFC.IFCCLASSIFICATION, + ); + + const systems = { ...references, ...classifications }; + + const matchingClassifications: number[] = []; + + for (const id in systems) { + const classificationID = Number(id); + const attrs = await model.getProperties(classificationID); + if (!attrs) continue; + + const referencedSourceID = attrs.ReferencedSource?.value; + if (!referencedSourceID) continue; + + const classificationAttrs = await model.getProperties(referencedSourceID); + if (!classificationAttrs) continue; + + const systemMatches = this.evalSystem(classificationAttrs); + if (!systemMatches) continue; + + const valueMatches = this.evalValue(attrs); + if (!valueMatches) continue; + + const uriMatches = this.evalURI(attrs); + if (!uriMatches) continue; + + matchingClassifications.push(classificationID); + } + + const indexer = this.components.get(IfcRelationsIndexer); + + for (const classificationID of matchingClassifications) { + const expressIDs = indexer.getEntitiesWithRelation( + model, + "HasAssociations", + classificationID, + ); + + for (const expressID of expressIDs) { + if (expressID in collector) continue; + const attrs = await model.getProperties(expressID); + if (!attrs) continue; + collector[expressID] = attrs; + result.push(expressID); + } + } + + return result; + } + + async test(entities: FRAGS.IfcProperties, model: FRAGS.FragmentsGroup) { + this.testResult = []; + for (const _expressID in entities) { + const expressID = Number(_expressID); + const attrs = entities[expressID]; + + const checks: IDSCheck[] = []; + const result: IDSCheckResult = { + guid: attrs.GlobalId?.value, + expressID, + pass: false, + checks, + cardinality: this.cardinality, + }; + + this.testResult.push(result); + + let missingClassification = true; + const elementClassifications = await this.getSystems(model, expressID); + + const allSystemNames = elementClassifications + .map((classification) => this.getSystemName(classification)) + .filter((system) => system) as string[]; + + for (const classificationAttrs of elementClassifications) { + const systemMatches = this.evalSystem(classificationAttrs, checks); + if (!systemMatches) continue; + missingClassification = false; + + if (!(this.value && this.system)) break; + + if (classificationAttrs.type !== WEBIFC.IFCCLASSIFICATIONREFERENCE) { + continue; + } + + const valueMatches = + !this.value || this.evalValue(classificationAttrs, checks); + + const uriMatches = + !this.uri || this.evalURI(classificationAttrs, checks); + + if (valueMatches && uriMatches) break; + } + + if (missingClassification) { + this.addCheckResult( + { + parameter: "System", + currentValue: allSystemNames as any, + requiredValue: this.system, + pass: this.cardinality === "optional", + }, + checks, + ); + } + + result.pass = checks.every(({ pass }) => pass); + } + + const result = [...this.testResult]; + this.testResult = []; + return result; + } + + private async processReferencedSource( + model: FRAGS.FragmentsGroup, + attrs: Record, + ) { + const sourceID = attrs.ReferencedSource?.value; + if (!sourceID) return null; + const sourceAttrs = await model.getProperties(sourceID); + if (!sourceAttrs) return null; + if (sourceAttrs.type === WEBIFC.IFCCLASSIFICATIONREFERENCE) { + sourceAttrs.ReferencedSource = await this.processReferencedSource( + model, + sourceAttrs, + ); + } + return sourceAttrs; + } + + private async getSystems(model: FRAGS.FragmentsGroup, expressID: number) { + const result: Record[] = []; + const indexer = this.components.get(IfcRelationsIndexer); + const ocurrenceAssociations = indexer.getEntityRelations( + model, + expressID, + "HasAssociations", + ); + if (ocurrenceAssociations) { + for (const id of ocurrenceAssociations) { + const attrs = await model.getProperties(id); + if (!attrs) continue; + if (attrs.type === WEBIFC.IFCCLASSIFICATION) { + result.push(attrs); + } + if (attrs.type === WEBIFC.IFCCLASSIFICATIONREFERENCE) { + attrs.ReferencedSource = await this.processReferencedSource( + model, + attrs, + ); + if (attrs.ReferencedSource) result.push(attrs); + } + } + } + + // As occurence classifications prevail over type clasifications + // the classification systems used by the occurrence are get + // so type classifications are not included + const occurrenceSystems = result + .map((attrs) => { + if (attrs.type === WEBIFC.IFCCLASSIFICATION) { + return attrs.Name?.value; + } + if (attrs.type === WEBIFC.IFCCLASSIFICATIONREFERENCE) { + return attrs.ReferencedSource?.Name?.value; + } + return null; + }) + .filter((name) => name); + + const types = indexer.getEntityRelations(model, expressID, "IsTypedBy"); + if (!(types && types[0])) return result; + const type = types[0]; + const typeAssociations = indexer.getEntityRelations( + model, + type, + "HasAssociations", + ); + if (typeAssociations) { + for (const id of typeAssociations) { + const attrs = await model.getProperties(id); + if (!attrs) continue; + if (attrs.type === WEBIFC.IFCCLASSIFICATION) { + if (occurrenceSystems.includes(attrs.Name?.value)) continue; + result.push(attrs); + } + if (attrs.type === WEBIFC.IFCCLASSIFICATIONREFERENCE) { + attrs.ReferencedSource = await this.processReferencedSource( + model, + attrs, + ); + if (attrs.ReferencedSource) result.push(attrs); + } + } + } + + return result; + } + + private getSystemName(attrs: Record): string | null { + if (attrs.type === WEBIFC.IFCCLASSIFICATION) { + return attrs.Name?.value; + } + if (attrs.type === WEBIFC.IFCCLASSIFICATIONREFERENCE) { + if (attrs.ReferencedSource?.type === WEBIFC.IFCCLASSIFICATIONREFERENCE) { + return this.getSystemName(attrs.ReferencedSource); + } + if (attrs.ReferencedSource?.type === WEBIFC.IFCCLASSIFICATION) { + return attrs.ReferencedSource.Name?.value; + } + } + return null; + } + + private getAllReferenceIdentifications(attrs: Record) { + if (attrs.type !== WEBIFC.IFCCLASSIFICATIONREFERENCE) return null; + const identifications: string[] = []; + if (attrs.Identification) identifications.push(attrs.Identification.value); + if (attrs.ReferencedSource) { + const identification = this.getAllReferenceIdentifications( + attrs.ReferencedSource, + ); + if (identification) identifications.push(...identification); + } + return identifications; + } + + private evalSystem(attrs: Record, checks?: IDSCheck[]) { + const name = this.getSystemName(attrs); + return this.evalRequirement(name, this.system, "System", checks); + } + + private evalValue(attrs: any, checks?: IDSCheck[]) { + if (!this.value) return true; + const identifications = this.getAllReferenceIdentifications(attrs); + if (!identifications) return false; + const identifier = identifications.find((id) => { + if (!this.value) return false; + return this.evalRequirement(id, this.value, "Value"); + }); + if (checks) { + this.addCheckResult( + { + parameter: "Value", + currentValue: identifier ?? null, + requiredValue: this.value, + pass: !!identifier, + }, + checks, + ); + } + return !!identifier; + } + + private evalURI(attrs: any, checks?: IDSCheck[]) { + if (!this.uri) return true; + const result = this.evalRequirement( + attrs.Location?.value, + { + type: "simple", + parameter: this.uri, + }, + "URI", + checks, + ); + return result; + } +} diff --git a/packages/core/src/openbim/IDSSpecifications/src/facets/Entity.ts b/packages/core/src/openbim/IDSSpecifications/src/facets/Entity.ts new file mode 100644 index 000000000..675de0a83 --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/src/facets/Entity.ts @@ -0,0 +1,160 @@ +import * as FRAGS from "@thatopen/fragments"; +import { Components } from "../../../../core/Components"; +import { IDSFacet } from "./Facet"; +import { IDSCheck, IDSCheckResult, IDSFacetParameter } from "../types"; +import { IfcCategoryMap, IfcRelationsIndexer } from "../../../../ifc"; +import { getParameterXML } from "../exporters/parameter"; + +// https://github.com/buildingSMART/IDS/blob/development/Documentation/UserManual/entity-facet.md + +export class IDSEntity extends IDSFacet { + name: IDSFacetParameter; + predefinedType?: IDSFacetParameter; + + constructor(components: Components, name: IDSFacetParameter) { + super(components); + this.name = name; + } + + serialize(type: "applicability" | "requirement") { + const nameXML = getParameterXML("Name", this.name); + const predefinedTypeXML = getParameterXML("Name", this.predefinedType); + let attributes = ""; + if (type === "requirement") { + attributes += `cardinality="${this.cardinality}"`; + attributes += this.instructions + ? `instructions="${this.instructions}"` + : ""; + } + return ` + ${nameXML} + ${predefinedTypeXML} +`; + } + + // IFCSURFACESTYLEREFRACTION is not present in the FragmentsGroup + // IFCSURFACESTYLERENDERING is not present in the FragmentsGroup + async getEntities( + model: FRAGS.FragmentsGroup, + collector: FRAGS.IfcProperties = {}, + ) { + const types = Object.entries(IfcCategoryMap); + const typeIDs: number[] = []; + for (const [type] of types) { + const validName = await this.evalName({ type }); + if (!validName) continue; + typeIDs.push(Number(type)); + } + + let entities: FRAGS.IfcProperties = {}; + for (const id of typeIDs) { + const elements = await model.getAllPropertiesOfType(id); + if (elements) entities = { ...entities, ...elements }; + } + + if (!this.predefinedType) { + for (const expressID in entities) { + if (expressID in collector) continue; + collector[expressID] = entities[expressID]; + } + return Object.keys(entities).map(Number); + } + + const result: number[] = []; + for (const _expressID in entities) { + const expressID = Number(_expressID); + if (expressID in collector) continue; + const attrs = entities[expressID]; + const validPredefinedType = await this.evalPredefinedType(model, attrs); + if (validPredefinedType) { + collector[expressID] = attrs; + result.push(expressID); + } + } + + return result; + } + + async test(entities: FRAGS.IfcProperties, model: FRAGS.FragmentsGroup) { + this.testResult = []; + for (const _expressID in entities) { + const expressID = Number(_expressID); + const attrs = entities[expressID]; + + const checks: IDSCheck[] = []; + const result: IDSCheckResult = { + guid: attrs.GlobalId?.value, + expressID, + pass: false, + checks, + cardinality: this.cardinality, + }; + + this.testResult.push(result); + + await this.evalName(attrs, checks); + await this.evalPredefinedType(model, attrs, checks); + + result.pass = checks.every(({ pass }) => pass); + } + + return this.testResult; + } + + protected async evalName(attrs: any, checks?: IDSCheck[]) { + const entityName = IfcCategoryMap[attrs.type]; + const result = this.evalRequirement(entityName, this.name, "Name", checks); + return result; + } + + protected async evalPredefinedType( + model: FRAGS.FragmentsGroup, + attrs: any, + checks?: IDSCheck[], + ) { + if (!this.predefinedType) return null; + const indexer = this.components.get(IfcRelationsIndexer); + const isRequirementUserDefined = + typeof this.predefinedType.parameter === "string" && + this.predefinedType.parameter === "USERDEFINED"; + let value = attrs.PredefinedType?.value; + + if (value === "USERDEFINED" && !isRequirementUserDefined) { + const attrNames = Object.keys(attrs); + const result = attrNames.find((str) => + /^((?!Predefined).)*Type$/.test(str), + ); + value = result ? attrs[result]?.value : "USERDEFINED"; + } + + if (!value) { + const types = indexer.getEntityRelations( + model, + attrs.expressID, + "IsTypedBy", + ); + if (types && types[0]) { + const typeAttrs = await model.getProperties(types[0]); + if (typeAttrs) { + value = typeAttrs.PredefinedType?.value; + if (value === "USERDEFINED" && !isRequirementUserDefined) { + const attrNames = Object.keys(typeAttrs); + const result = attrNames.find((str) => + /^((?!Predefined).)*Type$/.test(str), + ); + value = result ? typeAttrs[result]?.value : "USERDEFINED"; + } + } + } + } + + const result = this.evalRequirement( + value, + this.predefinedType, + "PredefinedType", + checks, + ); + + return result; + } +} diff --git a/packages/core/src/openbim/IDSSpecifications/src/facets/Facet.ts b/packages/core/src/openbim/IDSSpecifications/src/facets/Facet.ts new file mode 100644 index 000000000..01d2c0212 --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/src/facets/Facet.ts @@ -0,0 +1,145 @@ +import * as FRAGS from "@thatopen/fragments"; +import { Components } from "../../../../core/Components"; +import { + IDSFacetParameter, + IDSCheckResult, + IDSFacetParameterName, + IDSSimpleParameter, + IDSEnumerationParameter, + IDSPatternParameter, + IDSLengthParameter, + IDSBoundsParameter, + IDSCheck, + IDSConditionalCardinaltiy, + IDSSimpleCardinality, +} from "../types"; + +export abstract class IDSFacet { + // Used when the facet is a requirement + // On IDSEntity is always required + cardinality: IDSSimpleCardinality | IDSConditionalCardinaltiy = "required"; + + // When using this facet as a requirement, instructions can be given for the authors of the IFC. + instructions?: string; + + constructor(protected components: Components) {} + + protected addCheckResult(check: IDSCheck, checks: IDSCheck[]) { + const index = checks.findIndex( + ({ parameter }) => parameter === check.parameter, + ); + + if (index !== -1) { + checks[index] = check; + } else { + checks.push(check); + } + } + + protected evalRequirement = ( + value: string | number | boolean | null, + facetParameter: IDSFacetParameter, + parameter: IDSFacetParameterName, + checks?: IDSCheck[], + ) => { + const checkLog: IDSCheck = { + parameter, + currentValue: value, + requiredValue: facetParameter.parameter, + pass: false, + }; + + if (checks) this.addCheckResult(checkLog, checks); + + let pass = false; + + if (facetParameter.type === "simple") { + const parameter = facetParameter.parameter as IDSSimpleParameter; + pass = value === parameter; + } + + if (facetParameter.type === "enumeration") { + const parameter = facetParameter.parameter as IDSEnumerationParameter; + pass = parameter.includes(value as never); + } + + if (facetParameter.type === "pattern") { + const parameter = facetParameter.parameter as IDSPatternParameter; + const regex = new RegExp(parameter); + pass = regex.test(String(value)); + } + + if (facetParameter.type === "length") { + const parameter = facetParameter.parameter as IDSLengthParameter; + const { min, length, max } = parameter; + if (length !== undefined) { + pass = String(value).length === length; + } + if (min !== undefined) { + pass = String(value).length >= min; + } + if (max !== undefined) { + pass = String(value).length <= max; + } + } + + if (facetParameter.type === "bounds" && typeof value === "number") { + const { min, minInclusive, max, maxInclusive } = + facetParameter.parameter as IDSBoundsParameter; + + let minPass = true; + let maxPass = true; + + if (min !== undefined) { + minPass = minInclusive ? value <= min : value < min; + } + + if (max !== undefined) { + maxPass = maxInclusive ? value >= max : value > max; + } + + pass = minPass && maxPass; + } + + if (this.cardinality === "prohibited") pass = !pass; + if (this.cardinality === "optional") pass = true; + + checkLog.pass = pass; + return checkLog.pass; + }; + + protected testResult: IDSCheckResult[] = []; + protected saveResult(attrs: any, pass: boolean) { + const { GlobalId } = attrs; + if (!GlobalId) return; + const { value: guid } = GlobalId; + const result: IDSCheckResult = { + expressID: guid, + pass, + checks: [], + cardinality: this.cardinality, + }; + this.testResult.push(result); + } + + /** + * Returns the list of expressIDs that pass the criteria of this facet. + * @param model - The IFC model to retrieve entities from. + * @param collector - An optional object to collect the retrieved entities. + * @remarks + * If the collector already includes the entity, it won't get processed any further. + * + * @returns An array of express IDs of the retrieved entities. + */ + abstract getEntities( + model: FRAGS.FragmentsGroup, + collector: FRAGS.IfcProperties, + ): Promise; + + abstract test( + entities: FRAGS.IfcProperties, + model?: FRAGS.FragmentsGroup, + ): Promise; + + abstract serialize(type: "applicability" | "requirement"): string; +} diff --git a/packages/core/src/openbim/IDSSpecifications/src/facets/Material.ts b/packages/core/src/openbim/IDSSpecifications/src/facets/Material.ts new file mode 100644 index 000000000..4248d2853 --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/src/facets/Material.ts @@ -0,0 +1,36 @@ +import { getParameterXML } from "../exporters/parameter"; +import { IDSFacetParameter } from "../types"; +import { IDSFacet } from "./Facet"; + +// https://github.com/buildingSMART/IDS/blob/development/Documentation/UserManual/material-facet.md + +export class IdsMaterialFacet extends IDSFacet { + value?: IDSFacetParameter; + uri?: string; + + serialize(type: "applicability" | "requirement") { + if (!(this.value && this.uri)) return ""; + const valueXML = getParameterXML("Value", this.value); + let attributes = ""; + if (type === "requirement") { + attributes += `cardinality="${this.cardinality}"`; + attributes += this.uri ? `uri=${this.uri}` : ""; + attributes += this.instructions + ? `instructions="${this.instructions}"` + : ""; + } + return ` + ${valueXML} +`; + } + + async getEntities() { + const result: number[] = []; + return result; + } + + async test() { + this.testResult = []; + return this.testResult; + } +} diff --git a/packages/core/src/openbim/IDSSpecifications/src/facets/PartOf.ts b/packages/core/src/openbim/IDSSpecifications/src/facets/PartOf.ts new file mode 100644 index 000000000..f27c74db4 --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/src/facets/PartOf.ts @@ -0,0 +1,156 @@ +import * as FRAGS from "@thatopen/fragments"; +import { Components } from "../../../../core/Components"; +import { + IfcRelation, + IfcRelationsIndexer, + relToAttributesMap, +} from "../../../../ifc"; +import { IDSFacet } from "./Facet"; +import { IDSFacetParameter, IDSSimpleCardinality } from "../types"; +import { IDSEntity } from "./Entity"; + +// https://github.com/buildingSMART/IDS/blob/development/Documentation/UserManual/partof-facet.md + +export class IDSPartOf extends IDSFacet { + private _entityFacet: IDSEntity; + + private _entity: { + name: IDSFacetParameter; + predefinedType?: IDSFacetParameter; + }; + + set entity(value: { + name: IDSFacetParameter; + predefinedType?: IDSFacetParameter; + }) { + this._entity = value; + const { name, predefinedType } = value; + this._entityFacet = new IDSEntity(this.components, name); + this._entityFacet.predefinedType = predefinedType; + } + + get entity() { + return this._entity; + } + + // Performance is better when provided + relation?: number; + + cardinality: IDSSimpleCardinality = "required"; + + constructor( + components: Components, + entity: { name: IDSFacetParameter; predefinedType?: IDSFacetParameter }, + ) { + super(components); + this._entity = entity; + this._entityFacet = new IDSEntity(components, entity.name); + this._entityFacet.predefinedType = entity.predefinedType; + } + + serialize() { + return ""; + } + + async getEntities( + model: FRAGS.FragmentsGroup, + collector: FRAGS.IfcProperties = {}, + ) { + const result: number[] = []; + const entities: FRAGS.IfcProperties = {}; + await this._entityFacet.getEntities(model, entities); + + const indexer = this.components.get(IfcRelationsIndexer); + + const modelRelations = indexer.relationMaps[model.uuid]; + if (!modelRelations) return result; + + if (this.relation) { + const invAttrs = relToAttributesMap.get(this.relation as IfcRelation); + if (!invAttrs) return result; + for (const _expressID in entities) { + const expressID = Number(_expressID); + const { forRelated } = invAttrs; + const relations = indexer.getEntitiesWithRelation( + model, + forRelated, + expressID, + ); + for (const relID of relations) { + if (relID in collector) continue; + const relAttrs = await model.getProperties(relID); + if (!relAttrs) continue; + collector[relID] = relAttrs; + result.push(relID); + } + } + } else { + for (const _expressID in entities) { + const expressID = Number(_expressID); + for (const [entityID, rels] of modelRelations) { + if (entityID in collector) continue; + const relAttrs = await model.getProperties(entityID); + if (!relAttrs) continue; + // Check if any of the relations with the entity includes this.entity + for (const [_, relIDs] of rels) { + if (!relIDs.includes(expressID)) continue; + collector[entityID] = relAttrs; + result.push(entityID); + } + } + } + } + + return result; + } + + async test(entities: FRAGS.IfcProperties, model: FRAGS.FragmentsGroup) { + this.testResult = []; + const indexer = this.components.get(IfcRelationsIndexer); + for (const _expressID in entities) { + const expressID = Number(_expressID); + const attrs = entities[expressID]; + if (!attrs.GlobalId?.value) continue; + + let matches = false; + + const modelRelations = indexer.relationMaps[model.uuid]; + if (!modelRelations) { + this.saveResult(attrs, matches); + continue; + } + + const entityRelations = modelRelations.get(expressID); + if (!entityRelations) { + this.saveResult(attrs, matches); + continue; + } + + for (const [invAttrIndex, relIDs] of entityRelations) { + if (this.relation) { + const invAttrs = relToAttributesMap.get(this.relation as IfcRelation); + if (!invAttrs) continue; + const forRelatedIndex = indexer.getAttributeIndex( + invAttrs.forRelated, + ); + if (forRelatedIndex !== invAttrIndex) continue; + } + + for (const relID of relIDs) { + const relAttrs = await model.getProperties(relID); + if (!relAttrs) continue; + const entityMatches = relAttrs.type === this.entity; + if (!entityMatches) continue; + matches = true; + break; + } + + if (matches) break; + } + + this.saveResult(attrs, matches); + } + + return this.testResult; + } +} diff --git a/packages/core/src/openbim/IDSSpecifications/src/facets/Property.ts b/packages/core/src/openbim/IDSSpecifications/src/facets/Property.ts new file mode 100644 index 000000000..fb6494e97 --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/src/facets/Property.ts @@ -0,0 +1,436 @@ +import * as FRAGS from "@thatopen/fragments"; +import * as WEBIFC from "web-ifc"; +import { IDSCheck, IDSCheckResult, IDSFacetParameter } from "../types"; +import { Components } from "../../../../core/Components"; +import { IfcRelationsIndexer } from "../../../../ifc"; +import { IDSFacet } from "./Facet"; +import { getParameterXML } from "../exporters/parameter"; + +// https://github.com/buildingSMART/IDS/blob/development/Documentation/UserManual/property-facet.md + +export class IDSProperty extends IDSFacet { + propertySet: IDSFacetParameter; + baseName: IDSFacetParameter; + value?: IDSFacetParameter; + dataType?: string; + uri?: string; + + private _unsupportedTypes = [ + WEBIFC.IFCCOMPLEXPROPERTY, + WEBIFC.IFCPHYSICALCOMPLEXQUANTITY, + ]; + + constructor( + components: Components, + propertySet: IDSFacetParameter, + baseName: IDSFacetParameter, + ) { + super(components); + this.propertySet = propertySet; + this.baseName = baseName; + } + + serialize(type: "applicability" | "requirement") { + const propertySetXML = getParameterXML("PropertySet", this.propertySet); + const baseNameXML = getParameterXML("BaseName", this.baseName); + const valueXML = getParameterXML("Value", this.value); + const dataTypeXML = this.dataType ? `dataType=${this.dataType}` : ""; + let attributes = ""; + if (type === "requirement") { + attributes += `cardinality="${this.cardinality}"`; + attributes += this.uri ? `uri=${this.uri}` : ""; + attributes += this.instructions + ? `instructions="${this.instructions}"` + : ""; + } + return ` + ${propertySetXML} + ${baseNameXML} + ${valueXML} +`; + } + + async getEntities( + model: FRAGS.FragmentsGroup, + collector: FRAGS.IfcProperties = {}, + ) { + let sets: FRAGS.IfcProperties = {}; + const psets = await model.getAllPropertiesOfType(WEBIFC.IFCPROPERTYSET); + sets = { ...sets, ...psets }; + const qsets = await model.getAllPropertiesOfType(WEBIFC.IFCELEMENTQUANTITY); + sets = { ...sets, ...qsets }; + if (Object.keys(sets).length === 0) return []; + + const matchingSets: number[] = []; + + for (const _setID in sets) { + const setID = Number(_setID); + const attrs = await model.getProperties(setID); + if (!attrs) continue; + + const nameMatches = attrs.Name?.value === this.propertySet.parameter; + if (!nameMatches) continue; + + let propsListName: string | undefined; + if (attrs.type === WEBIFC.IFCPROPERTYSET) propsListName = "HasProperties"; + if (attrs.type === WEBIFC.IFCELEMENTQUANTITY) + propsListName = "Quantities"; + if (!propsListName) continue; + + for (const handle of attrs[propsListName]) { + const propAttrs = await model.getProperties(handle.value); + if (!propAttrs) continue; + + const propNameMatches = + propAttrs.Name?.value === this.baseName.parameter; + if (!propNameMatches) continue; + + if (this.value) { + const valueKey = Object.keys(propAttrs).find((name) => + name.endsWith("Value"), + ); + if (!valueKey) continue; + const valueMatches = + propAttrs[valueKey].value === this.value.parameter; + if (!valueMatches) continue; + } + + matchingSets.push(setID); + } + } + + const result: number[] = []; + const indexer = this.components.get(IfcRelationsIndexer); + + for (const setID of matchingSets) { + const expressIDs = indexer.getEntitiesWithRelation( + model, + "IsDefinedBy", + setID, + ); + + for (const expressID of expressIDs) { + if (expressID in collector) continue; + const attrs = await model.getProperties(expressID); + if (!attrs) continue; + collector[expressID] = attrs; + result.push(expressID); + } + } + + return []; + } + + async test(entities: FRAGS.IfcProperties, model: FRAGS.FragmentsGroup) { + this.testResult = []; + for (const _expressID in entities) { + const expressID = Number(_expressID); + const attrs = entities[expressID]; + + const checks: IDSCheck[] = []; + const result: IDSCheckResult = { + guid: attrs.GlobalId?.value, + expressID, + pass: false, + checks, + cardinality: this.cardinality, + }; + + this.testResult.push(result); + + const sets = await this.getPsets(model, expressID); + const matchingSets = sets.filter((set) => { + const result = this.evalRequirement( + set.Name?.value ?? null, + this.propertySet, + "PropertySet", + ); + if (!result) return false; + checks.push({ + currentValue: set.Name.value, + parameter: "PropertySet", + pass: true, + requiredValue: this.propertySet.parameter, + }); + return true; + }); + + if (matchingSets.length === 0) { + checks.push({ + currentValue: null, + parameter: "PropertySet", + pass: false, + requiredValue: this.propertySet.parameter, + }); + continue; + } + + for (const set of matchingSets) { + const itemsAttrName = this.getItemsAttrName(set.type); + if (!itemsAttrName) { + checks.push({ + currentValue: null, + parameter: "BaseName", + pass: false, + requiredValue: this.baseName.parameter, + }); + continue; + } + + const items = set[itemsAttrName]; + const matchingItems = items.filter((item: any) => { + if (this._unsupportedTypes.includes(item.type)) { + return false; + } + const result = this.evalRequirement( + item.Name?.value ?? null, + this.baseName, + "BaseName", + ); + if (!result) return false; + checks.push({ + currentValue: item.Name.value, + parameter: "BaseName", + pass: true, + requiredValue: this.baseName.parameter, + }); + return true; + }); + + if (matchingItems.length === 0) { + checks.push({ + currentValue: null, + parameter: "BaseName", + pass: false, + requiredValue: this.baseName.parameter, + }); + continue; + } + + for (const item of matchingItems) { + this.evalValue(item, checks); + this.evalDataType(item, checks); + this.evalURI(); + } + } + + // for (const definitionID of definitions) { + // const definitionAttrs = await model.getProperties(definitionID); + // if (!definitionAttrs) continue; + + // const psetNameMatches = this.evalRequirement( + // definitionAttrs.Name?.value ?? null, + // this.propertySet, + // "Property Set", + // ); + // if (!psetNameMatches) continue; + + // checks.push({ + // currentValue: definitionAttrs.Name.value, + // parameter: "Property Set", + // pass: true, + // requiredValue: this.propertySet.parameter, + // }); + + // let propsListName: string | undefined; + // if (definitionAttrs.type === WEBIFC.IFCPROPERTYSET) + // propsListName = "HasProperties"; + // if (definitionAttrs.type === WEBIFC.IFCELEMENTQUANTITY) + // propsListName = "Quantities"; + // if (!propsListName) continue; + + // for (const handle of definitionAttrs[propsListName]) { + // const propAttrs = await model.getProperties(handle.value); + // if (!propAttrs) continue; + + // const baseNameMatches = this.evalRequirement( + // propAttrs.Name?.value ?? null, + // this.baseName, + // "Base Name", + // ); + + // if (!baseNameMatches) continue; + + // checks.push({ + // currentValue: propAttrs.Name.value, + // parameter: "Base Name", + // pass: true, + // requiredValue: this.baseName.parameter, + // }); + + // this.evalValue(propAttrs, checks); + // } + // } + + result.pass = checks.every(({ pass }) => pass); + } + + const result = [...this.testResult]; + this.testResult = []; + return result; + } + + private getItemsAttrName(type: number) { + let propsListName: string | undefined; + if (type === WEBIFC.IFCPROPERTYSET) propsListName = "HasProperties"; + if (type === WEBIFC.IFCELEMENTQUANTITY) propsListName = "Quantities"; + return propsListName; + } + + private getValueKey(attrs: Record) { + return Object.keys(attrs).find( + (name) => name.endsWith("Value") || name.endsWith("Values"), + ); + } + + // IFCPROPERTYSET from type must be get as well + private async getPsets(model: FRAGS.FragmentsGroup, expressID: number) { + const sets: Record[] = []; + + const indexer = this.components.get(IfcRelationsIndexer); + const definitions = indexer.getEntityRelations( + model, + expressID, + "IsDefinedBy", + ); + if (!definitions) return sets; + + for (const definitionID of definitions) { + const attrs = await model.getProperties(definitionID); + if (!attrs) continue; + + const propsListName = this.getItemsAttrName(attrs.type); + if (!propsListName) continue; + + const attrsClone = structuredClone(attrs); + const props: Record[] = []; + for (const { value } of attrsClone[propsListName]) { + const propAttrs = await model.getProperties(value); + if (propAttrs) props.push(propAttrs); + } + attrsClone[propsListName] = props; + + sets.push(attrsClone); + } + + return sets; + } + + // IFCPROPERTYBOUNDEDVALUE are not supported yet + // IFCPROPERTYTABLEVALUE are not supported yet + // Work must to be done to convert numerical value units to IDS-nominated standard units https://github.com/buildingSMART/IDS/blob/development/Documentation/UserManual/units.md + private evalValue(attrs: Record, checks?: IDSCheck[]) { + const valueKey = this.getValueKey(attrs); + if (this.value) { + if (!valueKey) { + checks?.push({ + parameter: "Value", + currentValue: null, + pass: false, + requiredValue: this.value.parameter, + }); + return false; + } + + const valueAttr = attrs[valueKey]; + const facetValue = structuredClone(this.value); + if (valueAttr.name === "IFCLABEL" && facetValue.type === "simple") { + facetValue.parameter = String(facetValue.parameter); + } + + if ( + (attrs.type === WEBIFC.IFCPROPERTYLISTVALUE || + attrs.type === WEBIFC.IFCPROPERTYENUMERATEDVALUE) && + Array.isArray(valueAttr) + ) { + const values = valueAttr.map((value) => value.value); + const matchingValue = valueAttr.find((value) => { + if (!facetValue) return false; + return this.evalRequirement(value.value, facetValue, "Value"); + }); + checks?.push({ + currentValue: values as any, + pass: !!matchingValue, + parameter: "Value", + requiredValue: facetValue.parameter, + }); + return !!matchingValue; + } + + const result = this.evalRequirement( + valueAttr.value, + facetValue, + "Value", + checks, + ); + return result; + } + + if (!valueKey) return true; + const value = attrs[valueKey]; + + // IDSDocs: Values with a logical unknown always fail + if (value.type === 3 && value.value === 2) { + checks?.push({ + parameter: "Value", + currentValue: null, + pass: false, + requiredValue: null, + }); + return false; + } + + // IDSDocs: An empty string is considered false + if (value.type === 1 && value.value.trim() === "") { + checks?.push({ + parameter: "Value", + currentValue: "", + pass: false, + requiredValue: null, + }); + return false; + } + + return true; + } + + private evalDataType(attrs: Record, checks?: IDSCheck[]) { + if (!this.dataType) return true; + const valueKey = this.getValueKey(attrs); + const valueAttr = attrs[valueKey as any]; + + if ( + (attrs.type === WEBIFC.IFCPROPERTYLISTVALUE || + attrs.type === WEBIFC.IFCPROPERTYENUMERATEDVALUE) && + Array.isArray(valueAttr) && + valueAttr[0] + ) { + const valueType = valueAttr[0].name; + const result = this.evalRequirement( + valueType, + { + type: "simple", + parameter: this.dataType, + }, + "DataType", + checks, + ); + return result; + } + + const result = this.evalRequirement( + valueAttr.name, + { + type: "simple", + parameter: this.dataType, + }, + "DataType", + checks, + ); + return result; + } + + private evalURI() { + return true; + } +} diff --git a/packages/core/src/openbim/IDSSpecifications/src/facets/index.ts b/packages/core/src/openbim/IDSSpecifications/src/facets/index.ts new file mode 100644 index 000000000..d47ee316c --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/src/facets/index.ts @@ -0,0 +1,7 @@ +export * from "./Attribute"; +export * from "./Classification"; +export * from "./Entity"; +export * from "./Property"; +export * from "./Facet"; +// export * from "./Material"; +// export * from "./PartOf"; diff --git a/packages/core/src/openbim/IDSSpecifications/src/importers/attribute.ts b/packages/core/src/openbim/IDSSpecifications/src/importers/attribute.ts new file mode 100644 index 000000000..8c0ac4865 --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/src/importers/attribute.ts @@ -0,0 +1,20 @@ +import { Components } from "../../../../core/Components"; +import { IDSAttribute, IDSFacet } from "../facets"; +import { getParameterValue } from "./parameter"; + +export const createAttributeFacets = ( + components: Components, + elements: any, +) => { + const facets: IDSFacet[] = []; + for (const element of elements) { + const nameParameter = element.name; + const name = getParameterValue(nameParameter); + if (!name) continue; + const facet = new IDSAttribute(components, name); + if (element.cardinality) facet.cardinality = element.cardinality; + facet.value = getParameterValue(element.value); + facets.push(facet); + } + return facets; +}; diff --git a/packages/core/src/openbim/IDSSpecifications/src/importers/classification.ts b/packages/core/src/openbim/IDSSpecifications/src/importers/classification.ts new file mode 100644 index 000000000..6d04214ab --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/src/importers/classification.ts @@ -0,0 +1,28 @@ +import { Components } from "../../../../core/Components"; +import { IDSClassification, IDSFacet } from "../facets"; +import { getParameterValue } from "./parameter"; + +export const createClassificationFacets = ( + components: Components, + elements: any, +) => { + const facets: IDSFacet[] = []; + for (const element of elements) { + const systemParameter = element.system; + const system = getParameterValue(systemParameter); + if (!system) continue; + const facet = new IDSClassification(components, system); + if (element.cardinality) facet.cardinality = element.cardinality; + const value = getParameterValue(element.value); + if (value?.type === "simple") { + value.parameter = String(value.parameter); + } + if (value?.type === "enumeration" && Array.isArray(value.parameter)) { + value.parameter = value.parameter.map(String); + } + facet.value = value; + facet.uri = element.uri; + facets.push(facet); + } + return facets; +}; diff --git a/packages/core/src/openbim/IDSSpecifications/src/importers/entity.ts b/packages/core/src/openbim/IDSSpecifications/src/importers/entity.ts new file mode 100644 index 000000000..1e98ecb64 --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/src/importers/entity.ts @@ -0,0 +1,17 @@ +import { Components } from "../../../../core/Components"; +import { IDSEntity, IDSFacet } from "../facets"; +import { getParameterValue } from "./parameter"; + +export const createEntityFacets = (components: Components, elements: any) => { + const facets: IDSFacet[] = []; + for (const element of elements) { + const nameParameter = element.name; + const name = getParameterValue(nameParameter); + if (!name) continue; + const facet = new IDSEntity(components, name); + if (element.cardinality) facet.cardinality = element.cardinality; + facet.predefinedType = getParameterValue(element.predefinedType); + facets.push(facet); + } + return facets; +}; diff --git a/packages/core/src/openbim/IDSSpecifications/src/importers/index.ts b/packages/core/src/openbim/IDSSpecifications/src/importers/index.ts new file mode 100644 index 000000000..dc545f893 --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/src/importers/index.ts @@ -0,0 +1,3 @@ +export * from "./entity"; +export * from "./attribute"; +export * from "./classification"; diff --git a/packages/core/src/openbim/IDSSpecifications/src/importers/parameter.ts b/packages/core/src/openbim/IDSSpecifications/src/importers/parameter.ts new file mode 100644 index 000000000..83ff27e37 --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/src/importers/parameter.ts @@ -0,0 +1,39 @@ +import { IDSFacetParameter } from "../types"; + +export const getParameterValue = (property: any) => { + if (!property) return undefined; + const result: Partial = { type: "simple" }; + if ("simpleValue" in property) { + result.parameter = property.simpleValue; + } + if ("restriction" in property) { + const restriction = property.restriction; + if ("pattern" in restriction) { + result.type = "pattern"; + result.parameter = restriction.pattern.value; + } + if ("enumeration" in restriction) { + result.type = "enumeration"; + const enumeration = restriction.enumeration.map( + ({ value }: { value: string }) => value, + ); + result.parameter = enumeration; + } + if ("bounds" in restriction) { + // result.type = "bounds"; + // const bounds = restriction.bounds.map( + // ({ value }: { value: string }) => value, + // ); + // result.parameter = bounds; + } + if ("length" in restriction) { + // result.type = "length"; + // const length = restriction.length.map( + // ({ value }: { value: string }) => value, + // ); + // result.parameter = length; + } + } + if (result.parameter === undefined) return undefined; + return result as IDSFacetParameter; +}; diff --git a/packages/core/src/openbim/IDSSpecifications/src/importers/property.ts b/packages/core/src/openbim/IDSSpecifications/src/importers/property.ts new file mode 100644 index 000000000..a7c29d8c1 --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/src/importers/property.ts @@ -0,0 +1,32 @@ +import { Components } from "../../../../core/Components"; +import { IDSFacet, IDSProperty } from "../facets"; +import { getParameterValue } from "./parameter"; + +export const createPropertyFacets = (components: Components, elements: any) => { + const facets: IDSFacet[] = []; + for (const element of elements) { + const psetParameter = element.propertySet; + const baseNameParameter = element.baseName; + const pset = getParameterValue(psetParameter); + const baseName = getParameterValue(baseNameParameter); + if (!(baseName && pset)) continue; + const facet = new IDSProperty(components, pset, baseName); + if (element.cardinality) facet.cardinality = element.cardinality; + + // Value + const value = getParameterValue(element.value); + if (value?.type === "enumeration" && Array.isArray(value.parameter)) { + value.parameter = value.parameter.map(String); + } + facet.value = value; + + // DataType + facet.dataType = element.dataType; + + // URI + facet.uri = element.uri; + + facets.push(facet); + } + return facets; +}; diff --git a/packages/core/src/openbim/IDSSpecifications/src/index.ts b/packages/core/src/openbim/IDSSpecifications/src/index.ts new file mode 100644 index 000000000..6bfd49cf5 --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/src/index.ts @@ -0,0 +1,3 @@ +export * from "./types"; +export * from "./facets"; +export * from "./Specification"; diff --git a/packages/core/src/openbim/IDSSpecifications/src/types.ts b/packages/core/src/openbim/IDSSpecifications/src/types.ts new file mode 100644 index 000000000..8857f5397 --- /dev/null +++ b/packages/core/src/openbim/IDSSpecifications/src/types.ts @@ -0,0 +1,83 @@ +export type IfcVersion = "IFC2X3" | "IFC4" | "IFC4X3_ADD2"; + +export type IDSFacetParameterName = + | "Name" + | "PredefinedType" + | "Value" + | "System" + | "URI" + | "PropertySet" + | "BaseName" + | "DataType" + | "Value" + | "Entity" + | "Relation"; + +// required must match +// prohibited mustn't match +// optional passes for matches and nulls +export type IDSSimpleCardinality = "required" | "prohibited"; +export type IDSConditionalCardinaltiy = IDSSimpleCardinality | "optional"; + +export type IDSSimpleParameter = string | number | boolean; +export type IDSEnumerationParameter = string[] | number[] | boolean[]; +export type IDSPatternParameter = string; +export type IDSBoundsParameter = { + min?: number; + minInclusive?: boolean; + max?: number; + maxInclusive?: boolean; +}; +export type IDSLengthParameter = { + min?: number; + length?: number; + max?: number; +}; + +export interface IDSRestrictionParameter {} + +export type IDSFacetParameterType = + | "simple" + | "enumeration" + | "pattern" + | "bounds" + | "length"; + +export interface IDSFacetParameter { + type: IDSFacetParameterType; + parameter: + | IDSSimpleParameter + | IDSEnumerationParameter + | IDSPatternParameter + | IDSBoundsParameter + | IDSLengthParameter; +} + +export interface IDSCheck { + parameter: IDSFacetParameterName; + currentValue: string | number | boolean | null; + requiredValue: any; + pass: boolean; +} + +/** + * Represents the result of a check performed by an IDSFacet test. + */ +export interface IDSCheckResult { + guid?: string; + expressID: number; + pass: boolean; + checks: IDSCheck[]; + cardinality: IDSConditionalCardinaltiy; +} + +export interface IDSInfo { + title: string; + description?: string; + copyright?: string; + version?: string; + author?: string; + date?: Date; + purpose?: string; + milestone?: string; +} diff --git a/packages/core/src/openbim/index.ts b/packages/core/src/openbim/index.ts index 2c7d2bbf5..282f4a817 100644 --- a/packages/core/src/openbim/index.ts +++ b/packages/core/src/openbim/index.ts @@ -1 +1,2 @@ export * from "./BCFTopics"; +export * from "./IDSSpecifications"; diff --git a/packages/core/vite.config.ts.timestamp-1724501893414-c367789247f8.mjs b/packages/core/vite.config.ts.timestamp-1724501893414-c367789247f8.mjs new file mode 100644 index 000000000..22ea4b15a --- /dev/null +++ b/packages/core/vite.config.ts.timestamp-1724501893414-c367789247f8.mjs @@ -0,0 +1,68 @@ +// vite.config.ts +import dts from "file:///C:/Users/anton/Desktop/code/engine_components/node_modules/vite-plugin-dts/dist/index.mjs"; +import { defineConfig } from "file:///C:/Users/anton/Desktop/code/engine_components/node_modules/vite/dist/node/index.js"; +import * as path from "path"; +import * as fs from "fs"; + +// package.json +var peerDependencies = { + "@thatopen/fragments": "~2.2.0", + three: "^0.160.1", + "web-ifc": "0.0.57" +}; + +// vite.config.ts +var __vite_injected_original_dirname = "C:\\Users\\anton\\Desktop\\code\\engine_components\\packages\\core"; +var generateTSNamespace = (dts2) => { + if (!fs.existsSync("./dist")) + return; + console.log("Generating namespace!"); + let types = ""; + dts2.forEach((declaration) => { + const cleanedType = declaration.replace(/export\s+\*?\s+from\s+"[^"]+";/g, "").replace(/^\s*[\r\n]/gm, "").replace(/`/g, "'"); + types += cleanedType; + }); + fs.writeFileSync( + "./dist/namespace.d.ts", + `declare namespace OBC { +${types} +}` + ); +}; +var vite_config_default = defineConfig({ + build: { + outDir: "./dist", + lib: { + entry: path.resolve(__vite_injected_original_dirname, "./src/index.ts"), + formats: ["es", "cjs"], + fileName: (format) => { + const map = { + cjs: "cjs", + es: "mjs" + }; + return `index.${map[format]}`; + } + }, + rollupOptions: { + external: Object.keys(peerDependencies), + output: { + globals: { + three: "THREE", + "@thatopen/fragments": "FRAGS", + "web-ifc": "WEB-IFC" + } + } + } + }, + plugins: [ + dts({ + include: ["./src"], + exclude: ["./src/**/example.ts", "./src/**/*.test.ts"], + afterBuild: generateTSNamespace + }) + ] +}); +export { + vite_config_default as default +}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiLCAicGFja2FnZS5qc29uIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyJjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZGlybmFtZSA9IFwiQzpcXFxcVXNlcnNcXFxcYW50b25cXFxcRGVza3RvcFxcXFxjb2RlXFxcXGVuZ2luZV9jb21wb25lbnRzXFxcXHBhY2thZ2VzXFxcXGNvcmVcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZmlsZW5hbWUgPSBcIkM6XFxcXFVzZXJzXFxcXGFudG9uXFxcXERlc2t0b3BcXFxcY29kZVxcXFxlbmdpbmVfY29tcG9uZW50c1xcXFxwYWNrYWdlc1xcXFxjb3JlXFxcXHZpdGUuY29uZmlnLnRzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ltcG9ydF9tZXRhX3VybCA9IFwiZmlsZTovLy9DOi9Vc2Vycy9hbnRvbi9EZXNrdG9wL2NvZGUvZW5naW5lX2NvbXBvbmVudHMvcGFja2FnZXMvY29yZS92aXRlLmNvbmZpZy50c1wiOy8qIGVzbGludC1kaXNhYmxlIGltcG9ydC9uby1leHRyYW5lb3VzLWRlcGVuZGVuY2llcyAqL1xyXG5pbXBvcnQgZHRzIGZyb20gXCJ2aXRlLXBsdWdpbi1kdHNcIjtcclxuaW1wb3J0IHsgZGVmaW5lQ29uZmlnIH0gZnJvbSBcInZpdGVcIjtcclxuaW1wb3J0ICogYXMgcGF0aCBmcm9tIFwicGF0aFwiO1xyXG5pbXBvcnQgKiBhcyBmcyBmcm9tIFwiZnNcIjtcclxuaW1wb3J0ICogYXMgcGFja2FnZUpzb24gZnJvbSBcIi4vcGFja2FnZS5qc29uXCI7XHJcblxyXG5jb25zdCBnZW5lcmF0ZVRTTmFtZXNwYWNlID0gKGR0czogTWFwPHN0cmluZywgc3RyaW5nPikgPT4ge1xyXG4gIGlmICghZnMuZXhpc3RzU3luYyhcIi4vZGlzdFwiKSkgcmV0dXJuO1xyXG4gIGNvbnNvbGUubG9nKFwiR2VuZXJhdGluZyBuYW1lc3BhY2UhXCIpO1xyXG4gIGxldCB0eXBlcyA9IFwiXCI7XHJcbiAgZHRzLmZvckVhY2goKGRlY2xhcmF0aW9uKSA9PiB7XHJcbiAgICBjb25zdCBjbGVhbmVkVHlwZSA9IGRlY2xhcmF0aW9uXHJcbiAgICAgIC5yZXBsYWNlKC9leHBvcnRcXHMrXFwqP1xccytmcm9tXFxzK1wiW15cIl0rXCI7L2csIFwiXCIpXHJcbiAgICAgIC5yZXBsYWNlKC9eXFxzKltcXHJcXG5dL2dtLCBcIlwiKVxyXG4gICAgICAucmVwbGFjZSgvYC9nLCBcIidcIik7XHJcbiAgICB0eXBlcyArPSBjbGVhbmVkVHlwZTtcclxuICB9KTtcclxuICBmcy53cml0ZUZpbGVTeW5jKFxyXG4gICAgXCIuL2Rpc3QvbmFtZXNwYWNlLmQudHNcIixcclxuICAgIGBkZWNsYXJlIG5hbWVzcGFjZSBPQkMge1xcbiR7dHlwZXN9XFxufWAsXHJcbiAgKTtcclxufTtcclxuXHJcbmV4cG9ydCBkZWZhdWx0IGRlZmluZUNvbmZpZyh7XHJcbiAgYnVpbGQ6IHtcclxuICAgIG91dERpcjogXCIuL2Rpc3RcIixcclxuICAgIGxpYjoge1xyXG4gICAgICBlbnRyeTogcGF0aC5yZXNvbHZlKF9fZGlybmFtZSwgXCIuL3NyYy9pbmRleC50c1wiKSxcclxuICAgICAgZm9ybWF0czogW1wiZXNcIiwgXCJjanNcIl0sXHJcbiAgICAgIGZpbGVOYW1lOiAoZm9ybWF0KSA9PiB7XHJcbiAgICAgICAgY29uc3QgbWFwID0ge1xyXG4gICAgICAgICAgY2pzOiBcImNqc1wiLFxyXG4gICAgICAgICAgZXM6IFwibWpzXCIsXHJcbiAgICAgICAgfTtcclxuICAgICAgICByZXR1cm4gYGluZGV4LiR7bWFwW2Zvcm1hdF19YDtcclxuICAgICAgfSxcclxuICAgIH0sXHJcbiAgICByb2xsdXBPcHRpb25zOiB7XHJcbiAgICAgIGV4dGVybmFsOiBPYmplY3Qua2V5cyhwYWNrYWdlSnNvbi5wZWVyRGVwZW5kZW5jaWVzKSxcclxuICAgICAgb3V0cHV0OiB7XHJcbiAgICAgICAgZ2xvYmFsczoge1xyXG4gICAgICAgICAgdGhyZWU6IFwiVEhSRUVcIixcclxuICAgICAgICAgIFwiQHRoYXRvcGVuL2ZyYWdtZW50c1wiOiBcIkZSQUdTXCIsXHJcbiAgICAgICAgICBcIndlYi1pZmNcIjogXCJXRUItSUZDXCIsXHJcbiAgICAgICAgfSxcclxuICAgICAgfSxcclxuICAgIH0sXHJcbiAgfSxcclxuICBwbHVnaW5zOiBbXHJcbiAgICBkdHMoe1xyXG4gICAgICBpbmNsdWRlOiBbXCIuL3NyY1wiXSxcclxuICAgICAgZXhjbHVkZTogW1wiLi9zcmMvKiovZXhhbXBsZS50c1wiLCBcIi4vc3JjLyoqLyoudGVzdC50c1wiXSxcclxuICAgICAgYWZ0ZXJCdWlsZDogZ2VuZXJhdGVUU05hbWVzcGFjZSxcclxuICAgIH0pLFxyXG4gIF0sXHJcbn0pO1xyXG4iLCAie1xyXG4gIFwibmFtZVwiOiBcIkB0aGF0b3Blbi9jb21wb25lbnRzXCIsXHJcbiAgXCJkZXNjcmlwdGlvblwiOiBcIkNvbGxlY3Rpb24gb2YgY29yZSBmdW5jdGlvbmFsaXRpZXMgdG8gYXV0aG9yIEJJTSBhcHBzLlwiLFxyXG4gIFwidmVyc2lvblwiOiBcIjIuMy4wLWFscGhhLjFcIixcclxuICBcImF1dGhvclwiOiBcIlRoYXQgT3BlbiBDb21wYW55XCIsXHJcbiAgXCJjb250cmlidXRvcnNcIjogW1xyXG4gICAgXCJBbnRvbmlvIEdvbnphbGV6IFZpZWdhcyAoaHR0cHM6Ly9naXRodWIuY29tL2FndmllZ2FzKVwiLFxyXG4gICAgXCJKdWFuIEhveW9zIChodHRwczovL2dpdGh1Yi5jb20vSG95b3NKdWFuKVwiLFxyXG4gICAgXCJIYXJyeSBDb2xsaW4gKGh0dHBzOi8vZ2l0aHViLmNvbS9oYXJyeWNvbGxpbilcIlxyXG4gIF0sXHJcbiAgXCJsaWNlbnNlXCI6IFwiTUlUXCIsXHJcbiAgXCJob21lcGFnZVwiOiBcImh0dHBzOi8vZ2l0aHViLmNvbS9UaGF0T3Blbi9lbmdpbmVfY29tcG9uZW50cy90cmVlL21haW4vcGFja2FnZXMvY29tcG9uZW50cyNyZWFkbWVcIixcclxuICBcImJ1Z3NcIjoge1xyXG4gICAgXCJ1cmxcIjogXCJodHRwczovL2dpdGh1Yi5jb20vVGhhdE9wZW4vZW5naW5lX2NvbXBvbmVudHMvaXNzdWVzXCJcclxuICB9LFxyXG4gIFwidHlwZVwiOiBcIm1vZHVsZVwiLFxyXG4gIFwibWFpblwiOiBcImRpc3QvaW5kZXguY2pzXCIsXHJcbiAgXCJtb2R1bGVcIjogXCJkaXN0L2luZGV4Lm1qc1wiLFxyXG4gIFwidHlwZXNcIjogXCJkaXN0L2luZGV4LmQudHNcIixcclxuICBcImZpbGVzXCI6IFtcclxuICAgIFwiZGlzdFwiXHJcbiAgXSxcclxuICBcInJlcG9zaXRvcnlcIjoge1xyXG4gICAgXCJ0eXBlXCI6IFwiZ2l0XCIsXHJcbiAgICBcInVybFwiOiBcImdpdCtodHRwczovL2dpdGh1Yi5jb20vVGhhdE9wZW4vZW5naW5lX2NvbXBvbmVudHMvdHJlZS9tYWluL3BhY2thZ2VzL2NvbXBvbmVudHMuZ2l0XCJcclxuICB9LFxyXG4gIFwicGFja2FnZU1hbmFnZXJcIjogXCJ5YXJuQDMuMi4xXCIsXHJcbiAgXCJzY3JpcHRzXCI6IHtcclxuICAgIFwiZGV2XCI6IFwidml0ZSAtLWhvc3RcIixcclxuICAgIFwidGVzdFwiOiBcImplc3RcIixcclxuICAgIFwiYnVpbGRcIjogXCJ0c2MgLS1wIC4vdHNjb25maWctYnVpbGQuanNvbiAmJiB2aXRlIGJ1aWxkXCIsXHJcbiAgICBcInByZXB1Ymxpc2hPbmx5XCI6IFwibm9kZSAuL3Jlc291cmNlcy91cGRhdGVDb21wb25lbnRzVmVyc2lvbi5tanMgJiYgeWFybiBidWlsZFwiLFxyXG4gICAgXCJwdWJsaXNoLXJlcG9cIjogXCJucG0gcHVibGlzaFwiLFxyXG4gICAgXCJwdWJsaXNoLWFscGhhXCI6IFwibnBtIHB1Ymxpc2ggLS10YWcgYWxwaGFcIlxyXG4gIH0sXHJcbiAgXCJwdWJsaXNoQ29uZmlnXCI6IHtcclxuICAgIFwiYWNjZXNzXCI6IFwicHVibGljXCJcclxuICB9LFxyXG4gIFwiZGV2RGVwZW5kZW5jaWVzXCI6IHtcclxuICAgIFwiQHRoYXRvcGVuL2ZyYWdtZW50c1wiOiBcIn4yLjIuMFwiLFxyXG4gICAgXCJAdGhhdG9wZW4vdWlcIjogXCJ+Mi4yLjBcIixcclxuICAgIFwiQHR5cGVzL3RocmVlXCI6IFwiMC4xNjAuMFwiLFxyXG4gICAgXCJzdGF0cy5qc1wiOiBcIl4wLjE3LjBcIixcclxuICAgIFwidGhyZWVcIjogXCJeMC4xNjAuMVwiLFxyXG4gICAgXCJ3ZWItaWZjXCI6IFwiMC4wLjU3XCJcclxuICB9LFxyXG4gIFwiZGVwZW5kZW5jaWVzXCI6IHtcclxuICAgIFwiY2FtZXJhLWNvbnRyb2xzXCI6IFwiMi43LjNcIixcclxuICAgIFwiZmFzdC14bWwtcGFyc2VyXCI6IFwiNC40LjFcIixcclxuICAgIFwianN6aXBcIjogXCIzLjEwLjFcIixcclxuICAgIFwidGhyZWUtbWVzaC1idmhcIjogXCIwLjcuMFwiXHJcbiAgfSxcclxuICBcInBlZXJEZXBlbmRlbmNpZXNcIjoge1xyXG4gICAgXCJAdGhhdG9wZW4vZnJhZ21lbnRzXCI6IFwifjIuMi4wXCIsXHJcbiAgICBcInRocmVlXCI6IFwiXjAuMTYwLjFcIixcclxuICAgIFwid2ViLWlmY1wiOiBcIjAuMC41N1wiXHJcbiAgfVxyXG59Il0sCiAgIm1hcHBpbmdzIjogIjtBQUNBLE9BQU8sU0FBUztBQUNoQixTQUFTLG9CQUFvQjtBQUM3QixZQUFZLFVBQVU7QUFDdEIsWUFBWSxRQUFROzs7QUNnRGxCLHVCQUFvQjtBQUFBLEVBQ2xCLHVCQUF1QjtBQUFBLEVBQ3ZCLE9BQVM7QUFBQSxFQUNULFdBQVc7QUFDYjs7O0FEeERGLElBQU0sbUNBQW1DO0FBT3pDLElBQU0sc0JBQXNCLENBQUNBLFNBQTZCO0FBQ3hELE1BQUksQ0FBSSxjQUFXLFFBQVE7QUFBRztBQUM5QixVQUFRLElBQUksdUJBQXVCO0FBQ25DLE1BQUksUUFBUTtBQUNaLEVBQUFBLEtBQUksUUFBUSxDQUFDLGdCQUFnQjtBQUMzQixVQUFNLGNBQWMsWUFDakIsUUFBUSxtQ0FBbUMsRUFBRSxFQUM3QyxRQUFRLGdCQUFnQixFQUFFLEVBQzFCLFFBQVEsTUFBTSxHQUFHO0FBQ3BCLGFBQVM7QUFBQSxFQUNYLENBQUM7QUFDRCxFQUFHO0FBQUEsSUFDRDtBQUFBLElBQ0E7QUFBQSxFQUE0QixLQUFLO0FBQUE7QUFBQSxFQUNuQztBQUNGO0FBRUEsSUFBTyxzQkFBUSxhQUFhO0FBQUEsRUFDMUIsT0FBTztBQUFBLElBQ0wsUUFBUTtBQUFBLElBQ1IsS0FBSztBQUFBLE1BQ0gsT0FBWSxhQUFRLGtDQUFXLGdCQUFnQjtBQUFBLE1BQy9DLFNBQVMsQ0FBQyxNQUFNLEtBQUs7QUFBQSxNQUNyQixVQUFVLENBQUMsV0FBVztBQUNwQixjQUFNLE1BQU07QUFBQSxVQUNWLEtBQUs7QUFBQSxVQUNMLElBQUk7QUFBQSxRQUNOO0FBQ0EsZUFBTyxTQUFTLElBQUksTUFBTSxDQUFDO0FBQUEsTUFDN0I7QUFBQSxJQUNGO0FBQUEsSUFDQSxlQUFlO0FBQUEsTUFDYixVQUFVLE9BQU8sS0FBaUIsZ0JBQWdCO0FBQUEsTUFDbEQsUUFBUTtBQUFBLFFBQ04sU0FBUztBQUFBLFVBQ1AsT0FBTztBQUFBLFVBQ1AsdUJBQXVCO0FBQUEsVUFDdkIsV0FBVztBQUFBLFFBQ2I7QUFBQSxNQUNGO0FBQUEsSUFDRjtBQUFBLEVBQ0Y7QUFBQSxFQUNBLFNBQVM7QUFBQSxJQUNQLElBQUk7QUFBQSxNQUNGLFNBQVMsQ0FBQyxPQUFPO0FBQUEsTUFDakIsU0FBUyxDQUFDLHVCQUF1QixvQkFBb0I7QUFBQSxNQUNyRCxZQUFZO0FBQUEsSUFDZCxDQUFDO0FBQUEsRUFDSDtBQUNGLENBQUM7IiwKICAibmFtZXMiOiBbImR0cyJdCn0K diff --git a/packages/front/package.json b/packages/front/package.json index 8f1752ebc..429c8e5cb 100644 --- a/packages/front/package.json +++ b/packages/front/package.json @@ -1,7 +1,7 @@ { "name": "@thatopen/components-front", "description": "Collection of frontend tools to author BIM apps.", - "version": "2.2.2", + "version": "2.3.0", "author": "That Open Company", "contributors": [ "Antonio Gonzalez Viegas (https://github.com/agviegas)", @@ -33,12 +33,12 @@ "publish-alpha": "npm publish --tag alpha" }, "peerDependencies": { - "@thatopen/fragments": "~2.2.0", + "@thatopen/fragments": ">=2.3.0-alpha", "three": "^0.160.1", "web-ifc": "0.0.57" }, "devDependencies": { - "@thatopen/fragments": "~2.2.0", + "@thatopen/fragments": "~2.3.0", "@thatopen/ui": "~2.2.0", "@thatopen/ui-obc": "~2.2.0", "@types/earcut": "^2.1.4", @@ -47,7 +47,7 @@ "web-ifc": "0.0.57" }, "dependencies": { - "@thatopen/components": "~2.2.0", + "@thatopen/components": ">=2.3.0-alpha.5", "camera-controls": "2.7.3", "dexie": "^4.0.4", "earcut": "^2.2.4", diff --git a/packages/front/src/fragments/Highlighter/index.ts b/packages/front/src/fragments/Highlighter/index.ts index cf838b702..d55691925 100644 --- a/packages/front/src/fragments/Highlighter/index.ts +++ b/packages/front/src/fragments/Highlighter/index.ts @@ -44,10 +44,7 @@ export interface HighlighterConfig { /** * This component allows highlighting and selecting fragments in a 3D scene. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Front/Highlighter). 📘 [API](https://docs.thatopen.com/api/@thatopen/components-front/classes/Highlighter). */ -export class Highlighter - extends OBC.Component - implements OBC.Disposable, OBC.Configurable -{ +export class Highlighter extends OBC.Component implements OBC.Disposable { /** * A unique identifier for the component. * This UUID is used to register the component within the Components system. diff --git a/packages/front/src/fragments/IfcStreamer/example.ts b/packages/front/src/fragments/IfcStreamer/example.ts index d781d53ff..108e50986 100644 --- a/packages/front/src/fragments/IfcStreamer/example.ts +++ b/packages/front/src/fragments/IfcStreamer/example.ts @@ -71,7 +71,6 @@ world.scene.three.background = null; const loader = components.get(OBCF.IfcStreamer); loader.world = world; -loader.dbCleaner.enabled = true; /* MD Now, we need to set the base URL where the streamer needs to look for the tiles. In our case, we'll use the tiles we have prepared in our repository, but this should also work with your own backend. diff --git a/packages/front/src/fragments/IfcStreamer/index.ts b/packages/front/src/fragments/IfcStreamer/index.ts index bf3528aef..e3cd54b36 100644 --- a/packages/front/src/fragments/IfcStreamer/index.ts +++ b/packages/front/src/fragments/IfcStreamer/index.ts @@ -3,12 +3,12 @@ import * as FRAG from "@thatopen/fragments"; import * as OBC from "@thatopen/components"; import { GeometryCullerRenderer, - StreamFileDatabase, + // StreamFileDatabase, StreamPropertiesSettings, StreamedInstances, StreamedInstance, StreamLoaderSettings, - StreamerDbCleaner, + // StreamerDbCleaner, } from "./src"; export * from "./src"; @@ -64,12 +64,29 @@ export class IfcStreamer extends OBC.Component implements OBC.Disposable { */ useCache = true; - dbCleaner: StreamerDbCleaner; + /** + * Flag to cancel the files that are being currently loaded. + */ + cancel = false; + + /** + * The URL of the data source for the streaming service. + * It should be set before using the streaming service. Alternatively, you can use a custom fetch function. + */ + url: string = ""; - fetch = async (url: string) => { - return fetch(url); + /** + * Function used to retrieve tiles. Can be overriden to work with specific backends. + */ + fetch = async (fileName: string): Promise => { + return fetch(this.url + fileName); }; + /** + * Cache system that uses the File System API. + */ + fileDB = new FRAG.StreamerFileDb("that-open-company-streaming"); + private _culler: GeometryCullerRenderer | null = null; private _world: OBC.World | null = null; @@ -79,10 +96,6 @@ export class IfcStreamer extends OBC.Component implements OBC.Disposable { { data: FRAG.StreamedGeometries; time: number } >(); - private _fileCache = new StreamFileDatabase(); - - private _url: string | null = null; - private _isDisposing = false; private _geometryInstances: { @@ -105,26 +118,6 @@ export class IfcStreamer extends OBC.Component implements OBC.Disposable { opacity: 0.5, }); - /** - * The URL of the data source for the streaming service. - * It must be set before using the streaming service. - * If not set, an error will be thrown when trying to access the URL. - */ - get url() { - if (!this._url) { - throw new Error("url must be set before using the streaming service!"); - } - return this._url; - } - - /** - * Sets the URL of the data source for the streaming service. - * @param value - The new URL to be set. - */ - set url(value: string) { - this._url = value; - } - /** * The world in which the fragments will be displayed. * It must be set before using the streaming service. @@ -170,13 +163,11 @@ export class IfcStreamer extends OBC.Component implements OBC.Disposable { constructor(components: OBC.Components) { super(components); this.components.add(IfcStreamer.uuid, this); - this.dbCleaner = new StreamerDbCleaner(this._fileCache); const fragments = this.components.get(OBC.FragmentsManager); fragments.onFragmentsDisposed.add(this.disposeStreamedGroup); - // const hardlyGeometry = new THREE.BoxGeometry(); - // this._hardlySeenGeometries = new THREE.InstancedMesh(); + FRAG.FragmentsGroup.setPropertiesDB(true); } /** {@link OBC.Disposable.dispose} */ @@ -204,6 +195,8 @@ export class IfcStreamer extends OBC.Component implements OBC.Disposable { this.onDisposed.trigger(IfcStreamer.uuid); this.onDisposed.reset(); this._isDisposing = false; + + FRAG.FragmentsGroup.setPropertiesDB(false); } /** @@ -221,8 +214,7 @@ export class IfcStreamer extends OBC.Component implements OBC.Disposable { ) { const { assets, geometries, globalDataFileId } = settings; - const groupUrl = this.url + globalDataFileId; - const groupData = await this.fetch(groupUrl); + const groupData = await this.fetch(globalDataFileId); const groupArrayBuffer = await groupData.arrayBuffer(); const groupBuffer = new Uint8Array(groupArrayBuffer); const fragments = this.components.get(OBC.FragmentsManager); @@ -290,16 +282,16 @@ export class IfcStreamer extends OBC.Component implements OBC.Disposable { "-properties", ); + FRAG.FragmentsGroup.url = this.url; + group.streamSettings = { - baseUrl: this.url, baseFileName: propertiesFileID, ids, types, }; const { indexesFile } = properties; - const indexURL = this.url + indexesFile; - const fetched = await this.fetch(indexURL); + const fetched = await this.fetch(indexesFile); const rels = await fetched.text(); const indexer = this.components.get(OBC.IfcRelationsIndexer); indexer.setRelationMap(group, indexer.getRelationsMapFromJSON(rels)); @@ -393,7 +385,7 @@ export class IfcStreamer extends OBC.Component implements OBC.Disposable { * @returns A Promise that resolves when the cache is cleared. */ async clearCache() { - await this._fileCache.delete(); + await this.fileDB.clear(); } /** @@ -444,8 +436,28 @@ export class IfcStreamer extends OBC.Component implements OBC.Disposable { }, visible = true, ) { + this.cancel = false; + + const cancelled: { [modelID: string]: Set } = {}; + for (const modelID in seen) { + const idsOfModel = new Set(); + for (const [, ids] of seen[modelID]) { + for (const id of ids) { + idsOfModel.add(id); + } + } + cancelled[modelID] = idsOfModel; + } + for (const modelID in seen) { - if (this._isDisposing) return; + if (this._isDisposing) { + return; + } + + if (this.cancel) { + this.cancelLoading(cancelled); + return; + } const fragments = this.components.get(OBC.FragmentsManager); const group = fragments.groups.get(modelID); @@ -463,6 +475,11 @@ export class IfcStreamer extends OBC.Component implements OBC.Disposable { for (const [priority, ids] of seen[modelID]) { for (const id of ids) { + if (this.cancel) { + this.cancelLoading(cancelled); + return; + } + allIDs.add(id); const geometry = geometries[id]; if (!geometry) { @@ -471,6 +488,7 @@ export class IfcStreamer extends OBC.Component implements OBC.Disposable { if (geometry.geometryFile) { const file = geometry.geometryFile; const value = files.get(file) || 0; + // This adds up the pixels of all fragments in a file to determine its priority files.set(file, value + priority); } } @@ -478,41 +496,38 @@ export class IfcStreamer extends OBC.Component implements OBC.Disposable { const sortedFiles = Array.from(files).sort((a, b) => b[1] - a[1]); - for (const [file] of sortedFiles) { - const url = this.url + file; - + for (const [fileName] of sortedFiles) { // If this file is still in the ram, get it - if (!this._ramCache.has(url)) { + if (!this._ramCache.has(fileName)) { let bytes = new Uint8Array(); // If this file is in the local cache, get it if (this.useCache) { // Add or update this file to clean it up from indexedDB automatically later - this.dbCleaner.update(url); - const found = await this._fileCache.files.get(url); + const found = await this.fileDB.get(fileName); if (found) { - bytes = found.file; + const arrayBuffer = await found.arrayBuffer(); + bytes = new Uint8Array(arrayBuffer); } else { - const fetched = await this.fetch(url); + const fetched = await this.fetch(fileName); const buffer = await fetched.arrayBuffer(); bytes = new Uint8Array(buffer); - // await this._fileCache.files.delete(url); - this._fileCache.files.add({ file: bytes, id: url }); + await this.fileDB.add(fileName, bytes); } } else { - const fetched = await this.fetch(url); + const fetched = await this.fetch(fileName); const buffer = await fetched.arrayBuffer(); bytes = new Uint8Array(buffer); } const data = this.serializer.import(bytes); - this._ramCache.set(url, { data, time: performance.now() }); + this._ramCache.set(fileName, { data, time: performance.now() }); } - const result = this._ramCache.get(url); + const result = this._ramCache.get(fileName); if (!result) { continue; } @@ -523,7 +538,17 @@ export class IfcStreamer extends OBC.Component implements OBC.Disposable { if (result) { for (const [geometryID, { position, index, normal }] of result.data) { - if (this._isDisposing) return; + if (this._isDisposing) { + return; + } + + if (this.cancel) { + this.cancelLoading(cancelled); + return; + } + + // This fragment can be cancelled, it will be loaded + cancelled[modelID].delete(geometryID); if (!allIDs.has(geometryID)) continue; @@ -785,4 +810,9 @@ export class IfcStreamer extends OBC.Component implements OBC.Disposable { this._isDisposing = false; }; + + private cancelLoading(items: { [modelID: string]: Set }) { + this.cancel = false; + this.culler.cancel(items); + } } diff --git a/packages/front/src/fragments/IfcStreamer/src/geometry-culler-renderer.ts b/packages/front/src/fragments/IfcStreamer/src/geometry-culler-renderer.ts index 0a1d53a3d..ff2aa0029 100644 --- a/packages/front/src/fragments/IfcStreamer/src/geometry-culler-renderer.ts +++ b/packages/front/src/fragments/IfcStreamer/src/geometry-culler-renderer.ts @@ -57,14 +57,10 @@ export class GeometryCullerRenderer extends OBC.CullerRenderer { private codes = new Map>(); - constructor( - components: OBC.Components, - world: OBC.World, - settings?: OBC.CullerRendererSettings, - ) { - super(components, world, settings); + constructor(components: OBC.Components, world: OBC.World) { + super(components, world); - this.updateInterval = 500; + this.config.updateInterval = 500; this._geometry = new THREE.BoxGeometry(1, 1, 1); this._geometry.groups = []; @@ -76,12 +72,6 @@ export class GeometryCullerRenderer extends OBC.CullerRenderer { this._geometry.attributes.position.needsUpdate = true; this.worker.addEventListener("message", this.handleWorkerMessage); - if (this.autoUpdate) { - this._intervalID = window.setInterval( - this.updateVisibility, - this.updateInterval, - ); - } } dispose() { @@ -516,6 +506,31 @@ export class GeometryCullerRenderer extends OBC.CullerRenderer { } } + cancel(items: { [modelID: string]: Set }) { + for (const modelID in items) { + const modelIndex = this._modelIDIndex.get(modelID); + if (modelIndex === undefined) { + throw new Error("Model not found."); + } + const map = this.codes.get(modelIndex); + if (map === undefined) { + throw new Error("Codes not found."); + } + for (const id of items[modelID]) { + const colorCode = map.get(id); + if (colorCode === undefined) { + throw new Error("Color code not found."); + } + this._geometriesInMemory.delete(colorCode); + const found = this._geometries.get(colorCode); + if (!found) { + throw new Error("Geometry not found."); + } + found.exists = false; + } + } + } + private setGeometryVisibility( geometry: CullerBoundingBox, visible: boolean, @@ -545,7 +560,6 @@ export class GeometryCullerRenderer extends OBC.CullerRenderer { const colors = event.data.colors as Map; const toLoad: { [modelID: string]: Map> } = {}; - const toRemove: { [modelID: string]: Set } = {}; const toHide: { [modelID: string]: Set } = {}; const toShow: { [modelID: string]: Set } = {}; diff --git a/packages/front/src/fragments/IfcStreamer/src/index.ts b/packages/front/src/fragments/IfcStreamer/src/index.ts index 63db33d11..408843307 100644 --- a/packages/front/src/fragments/IfcStreamer/src/index.ts +++ b/packages/front/src/fragments/IfcStreamer/src/index.ts @@ -1,4 +1,2 @@ export * from "./geometry-culler-renderer"; -export * from "./streamer-db"; export * from "./types"; -export * from "./streamer-db-cleaner"; diff --git a/packages/front/src/fragments/IfcStreamer/src/streamer-db-cleaner.ts b/packages/front/src/fragments/IfcStreamer/src/streamer-db-cleaner.ts deleted file mode 100644 index 42cdd4c08..000000000 --- a/packages/front/src/fragments/IfcStreamer/src/streamer-db-cleaner.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { StreamFileDatabase } from "./streamer-db"; - -export class StreamerDbCleaner { - interval = 10000; - - maxTime = 60000; - - list = new Map(); - - private _enabled = false; - private _intervalId: number | null = null; - private _fileCache: StreamFileDatabase; - - constructor(fileCache: StreamFileDatabase) { - this._fileCache = fileCache; - } - - get enabled() { - return this._enabled; - } - - set enabled(value: boolean) { - if (this._enabled === value) return; - this._enabled = value; - if (!value) { - if (this._intervalId !== null) { - clearInterval(this._intervalId); - } - this._intervalId = null; - return; - } - this._intervalId = window.setInterval(() => { - const now = new Date().getTime(); - for (const [id, time] of this.list) { - const age = now - time; - if (age > this.maxTime) { - this.clean(id); - } - } - }, this.interval); - } - - update(id: string) { - if (!this.enabled) return; - // console.log(`Added to indexedDB: ${id}`); - this.list.set(id, new Date().getTime()); - } - - async clear() { - for (const [id] of this.list) { - this.clean(id); - } - } - - private clean(id: string) { - try { - this._fileCache.files.delete(id); - // console.log(`Deleted from indexedDB: ${id}`); - } catch (e) { - console.log(`File not found in indexedDB: ${id}`); - } - this.list.delete(id); - } -} diff --git a/packages/front/src/fragments/IfcStreamer/src/streamer-db.ts b/packages/front/src/fragments/IfcStreamer/src/streamer-db.ts deleted file mode 100644 index a39a7940a..000000000 --- a/packages/front/src/fragments/IfcStreamer/src/streamer-db.ts +++ /dev/null @@ -1,35 +0,0 @@ -import Dexie from "dexie"; - -/** - * Interface representing a streamed file. - */ -interface IStreamedFile { - /** - * Unique identifier for the file. - */ - id: string; - - /** - * The file content as a Uint8Array. - */ - file: Uint8Array; -} - -/** - * A class representing a database for storing streamed files. It extends Dexie, a minimalistic wrapper for IndexedDB. - */ -export class StreamFileDatabase extends Dexie { - /** - * Declare implicit table properties. - * (Just to inform Typescript. Instantiated by Dexie in stores() method) - * @type {Dexie.Table} - */ - files!: Dexie.Table; // number = type of the primkey - - constructor() { - super("MyAppDatabase"); - this.version(1).stores({ - files: "id, file", - }); - } -} diff --git a/packages/front/tsconfig.json b/packages/front/tsconfig.json index e118a51f1..207f1065c 100644 --- a/packages/front/tsconfig.json +++ b/packages/front/tsconfig.json @@ -34,4 +34,5 @@ "excludeProtected": true, "excludeReferences": true }, -} \ No newline at end of file +} + diff --git a/packages/front/vite.config.ts.timestamp-1724860843505-44070dd64b1a1.mjs b/packages/front/vite.config.ts.timestamp-1724860843505-44070dd64b1a1.mjs new file mode 100644 index 000000000..e0583eb7e --- /dev/null +++ b/packages/front/vite.config.ts.timestamp-1724860843505-44070dd64b1a1.mjs @@ -0,0 +1,74 @@ +// vite.config.ts +import dts from "file:///C:/Users/anton/Desktop/code/engine_components/node_modules/vite-plugin-dts/dist/index.mjs"; +import { defineConfig } from "file:///C:/Users/anton/Desktop/code/engine_components/node_modules/vite/dist/node/index.js"; +import * as path from "path"; +import * as fs from "fs"; + +// package.json +var peerDependencies = { + "@thatopen/fragments": "2.3.0-alpha.1", + three: "^0.160.1", + "web-ifc": "0.0.57" +}; + +// vite.config.ts +var __vite_injected_original_dirname = "C:\\Users\\anton\\Desktop\\code\\engine_components\\packages\\front"; +var clonePackageJSON = () => { + return { + name: "copy-package-json", + async writeBundle() { + if (!fs.existsSync("./dist")) + return; + console.log("Cloning package.json!"); + const packageBuffer = fs.readFileSync("./package.json"); + fs.writeFileSync("./dist/package.json", packageBuffer); + } + }; +}; +var generateTSNamespace = (dts2) => { + if (!fs.existsSync("./dist")) + return; + console.log("Generating namespace!"); + let types = ""; + dts2.forEach((declaration) => { + const cleanedType = declaration.replace(/export\s+\*?\s+from\s+"[^"]+";/g, "").replace(/^\s*[\r\n]/gm, "").replace(/`/g, "'"); + types += cleanedType; + }); + fs.writeFileSync( + "./dist/namespace.d.ts", + `declare namespace OBC { +${types} +}` + ); +}; +var vite_config_default = defineConfig({ + build: { + lib: { + entry: path.resolve(__vite_injected_original_dirname, "./src/index.ts"), + formats: ["es"], + fileName: "index" + }, + rollupOptions: { + external: Object.keys(peerDependencies), + output: { + globals: { + three: "THREE", + "@thatopen/fragments": "FRAGS", + "web-ifc": "WEB-IFC" + } + } + } + }, + plugins: [ + clonePackageJSON(), + dts({ + include: ["./src"], + exclude: ["./src/**/example.ts", "./src/**/*.test.ts"], + afterBuild: generateTSNamespace + }) + ] +}); +export { + vite_config_default as default +}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiLCAicGFja2FnZS5qc29uIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyJjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZGlybmFtZSA9IFwiQzpcXFxcVXNlcnNcXFxcYW50b25cXFxcRGVza3RvcFxcXFxjb2RlXFxcXGVuZ2luZV9jb21wb25lbnRzXFxcXHBhY2thZ2VzXFxcXGZyb250XCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ZpbGVuYW1lID0gXCJDOlxcXFxVc2Vyc1xcXFxhbnRvblxcXFxEZXNrdG9wXFxcXGNvZGVcXFxcZW5naW5lX2NvbXBvbmVudHNcXFxccGFja2FnZXNcXFxcZnJvbnRcXFxcdml0ZS5jb25maWcudHNcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfaW1wb3J0X21ldGFfdXJsID0gXCJmaWxlOi8vL0M6L1VzZXJzL2FudG9uL0Rlc2t0b3AvY29kZS9lbmdpbmVfY29tcG9uZW50cy9wYWNrYWdlcy9mcm9udC92aXRlLmNvbmZpZy50c1wiOy8qIGVzbGludC1kaXNhYmxlIGltcG9ydC9uby1leHRyYW5lb3VzLWRlcGVuZGVuY2llcyAqL1xyXG5pbXBvcnQgZHRzIGZyb20gXCJ2aXRlLXBsdWdpbi1kdHNcIjtcclxuaW1wb3J0IHsgZGVmaW5lQ29uZmlnIH0gZnJvbSBcInZpdGVcIjtcclxuaW1wb3J0ICogYXMgcGF0aCBmcm9tIFwicGF0aFwiO1xyXG5pbXBvcnQgKiBhcyBmcyBmcm9tIFwiZnNcIjtcclxuaW1wb3J0ICogYXMgcGFja2FnZUpzb24gZnJvbSBcIi4vcGFja2FnZS5qc29uXCI7XHJcblxyXG5jb25zdCBjbG9uZVBhY2thZ2VKU09OID0gKCkgPT4ge1xyXG4gIHJldHVybiB7XHJcbiAgICBuYW1lOiBcImNvcHktcGFja2FnZS1qc29uXCIsXHJcbiAgICBhc3luYyB3cml0ZUJ1bmRsZSgpIHtcclxuICAgICAgaWYgKCFmcy5leGlzdHNTeW5jKFwiLi9kaXN0XCIpKSByZXR1cm47XHJcbiAgICAgIGNvbnNvbGUubG9nKFwiQ2xvbmluZyBwYWNrYWdlLmpzb24hXCIpO1xyXG4gICAgICBjb25zdCBwYWNrYWdlQnVmZmVyID0gZnMucmVhZEZpbGVTeW5jKFwiLi9wYWNrYWdlLmpzb25cIik7XHJcbiAgICAgIGZzLndyaXRlRmlsZVN5bmMoXCIuL2Rpc3QvcGFja2FnZS5qc29uXCIsIHBhY2thZ2VCdWZmZXIpO1xyXG4gICAgfSxcclxuICB9O1xyXG59O1xyXG5cclxuY29uc3QgZ2VuZXJhdGVUU05hbWVzcGFjZSA9IChkdHM6IE1hcDxzdHJpbmcsIHN0cmluZz4pID0+IHtcclxuICBpZiAoIWZzLmV4aXN0c1N5bmMoXCIuL2Rpc3RcIikpIHJldHVybjtcclxuICBjb25zb2xlLmxvZyhcIkdlbmVyYXRpbmcgbmFtZXNwYWNlIVwiKTtcclxuICBsZXQgdHlwZXMgPSBcIlwiO1xyXG4gIGR0cy5mb3JFYWNoKChkZWNsYXJhdGlvbikgPT4ge1xyXG4gICAgY29uc3QgY2xlYW5lZFR5cGUgPSBkZWNsYXJhdGlvblxyXG4gICAgICAucmVwbGFjZSgvZXhwb3J0XFxzK1xcKj9cXHMrZnJvbVxccytcIlteXCJdK1wiOy9nLCBcIlwiKVxyXG4gICAgICAucmVwbGFjZSgvXlxccypbXFxyXFxuXS9nbSwgXCJcIilcclxuICAgICAgLnJlcGxhY2UoL2AvZywgXCInXCIpO1xyXG4gICAgdHlwZXMgKz0gY2xlYW5lZFR5cGU7XHJcbiAgfSk7XHJcbiAgZnMud3JpdGVGaWxlU3luYyhcclxuICAgIFwiLi9kaXN0L25hbWVzcGFjZS5kLnRzXCIsXHJcbiAgICBgZGVjbGFyZSBuYW1lc3BhY2UgT0JDIHtcXG4ke3R5cGVzfVxcbn1gLFxyXG4gICk7XHJcbn07XHJcblxyXG5leHBvcnQgZGVmYXVsdCBkZWZpbmVDb25maWcoe1xyXG4gIGJ1aWxkOiB7XHJcbiAgICBsaWI6IHtcclxuICAgICAgZW50cnk6IHBhdGgucmVzb2x2ZShfX2Rpcm5hbWUsIFwiLi9zcmMvaW5kZXgudHNcIiksXHJcbiAgICAgIGZvcm1hdHM6IFtcImVzXCJdLFxyXG4gICAgICBmaWxlTmFtZTogXCJpbmRleFwiLFxyXG4gICAgfSxcclxuICAgIHJvbGx1cE9wdGlvbnM6IHtcclxuICAgICAgZXh0ZXJuYWw6IE9iamVjdC5rZXlzKHBhY2thZ2VKc29uLnBlZXJEZXBlbmRlbmNpZXMpLFxyXG4gICAgICBvdXRwdXQ6IHtcclxuICAgICAgICBnbG9iYWxzOiB7XHJcbiAgICAgICAgICB0aHJlZTogXCJUSFJFRVwiLFxyXG4gICAgICAgICAgXCJAdGhhdG9wZW4vZnJhZ21lbnRzXCI6IFwiRlJBR1NcIixcclxuICAgICAgICAgIFwid2ViLWlmY1wiOiBcIldFQi1JRkNcIixcclxuICAgICAgICB9LFxyXG4gICAgICB9LFxyXG4gICAgfSxcclxuICB9LFxyXG4gIHBsdWdpbnM6IFtcclxuICAgIGNsb25lUGFja2FnZUpTT04oKSxcclxuICAgIGR0cyh7XHJcbiAgICAgIGluY2x1ZGU6IFtcIi4vc3JjXCJdLFxyXG4gICAgICBleGNsdWRlOiBbXCIuL3NyYy8qKi9leGFtcGxlLnRzXCIsIFwiLi9zcmMvKiovKi50ZXN0LnRzXCJdLFxyXG4gICAgICBhZnRlckJ1aWxkOiBnZW5lcmF0ZVRTTmFtZXNwYWNlLFxyXG4gICAgfSksXHJcbiAgXSxcclxufSk7XHJcbiIsICJ7XHJcbiAgXCJuYW1lXCI6IFwiQHRoYXRvcGVuL2NvbXBvbmVudHMtZnJvbnRcIixcclxuICBcImRlc2NyaXB0aW9uXCI6IFwiQ29sbGVjdGlvbiBvZiBmcm9udGVuZCB0b29scyB0byBhdXRob3IgQklNIGFwcHMuXCIsXHJcbiAgXCJ2ZXJzaW9uXCI6IFwiMi4zLjAtYWxwaGEuNlwiLFxyXG4gIFwiYXV0aG9yXCI6IFwiVGhhdCBPcGVuIENvbXBhbnlcIixcclxuICBcImNvbnRyaWJ1dG9yc1wiOiBbXHJcbiAgICBcIkFudG9uaW8gR29uemFsZXogVmllZ2FzIChodHRwczovL2dpdGh1Yi5jb20vYWd2aWVnYXMpXCIsXHJcbiAgICBcIkp1YW4gSG95b3MgKGh0dHBzOi8vZ2l0aHViLmNvbS9Ib3lvc0p1YW4pXCIsXHJcbiAgICBcIkhhcnJ5IENvbGxpbiAoaHR0cHM6Ly9naXRodWIuY29tL2hhcnJ5Y29sbGluKVwiXHJcbiAgXSxcclxuICBcImxpY2Vuc2VcIjogXCJNSVRcIixcclxuICBcImhvbWVwYWdlXCI6IFwiaHR0cHM6Ly9naXRodWIuY29tL1RoYXRPcGVuL2VuZ2luZV9jb21wb25lbnRzL3RyZWUvbWFpbi9wYWNrYWdlcy9jb21wb25lbnRzLWZyb250I3JlYWRtZVwiLFxyXG4gIFwiYnVnc1wiOiB7XHJcbiAgICBcInVybFwiOiBcImh0dHBzOi8vZ2l0aHViLmNvbS9UaGF0T3Blbi9lbmdpbmVfY29tcG9uZW50cy9pc3N1ZXNcIlxyXG4gIH0sXHJcbiAgXCJ0eXBlXCI6IFwibW9kdWxlXCIsXHJcbiAgXCJtYWluXCI6IFwiZGlzdC9pbmRleC5qc1wiLFxyXG4gIFwidHlwZXNcIjogXCJkaXN0L2luZGV4LmQudHNcIixcclxuICBcImZpbGVzXCI6IFtcclxuICAgIFwiZGlzdFwiXHJcbiAgXSxcclxuICBcInJlcG9zaXRvcnlcIjoge1xyXG4gICAgXCJ0eXBlXCI6IFwiZ2l0XCIsXHJcbiAgICBcInVybFwiOiBcImdpdCtodHRwczovL2dpdGh1Yi5jb20vVGhhdE9wZW4vZW5naW5lX2NvbXBvbmVudHMvdHJlZS9tYWluL3BhY2thZ2VzL2NvbXBvbmVudHMtZnJvbnQuZ2l0XCJcclxuICB9LFxyXG4gIFwicGFja2FnZU1hbmFnZXJcIjogXCJ5YXJuQDMuMi4xXCIsXHJcbiAgXCJzY3JpcHRzXCI6IHtcclxuICAgIFwiZGV2XCI6IFwidml0ZSAtLWhvc3RcIixcclxuICAgIFwidGVzdFwiOiBcImplc3RcIixcclxuICAgIFwiYnVpbGRcIjogXCJ0c2MgLS1wIC4vdHNjb25maWctYnVpbGQuanNvbiAmJiB2aXRlIGJ1aWxkXCIsXHJcbiAgICBcInByZXB1Ymxpc2hPbmx5XCI6IFwieWFybiBidWlsZFwiLFxyXG4gICAgXCJwdWJsaXNoLXJlcG9cIjogXCJucG0gcHVibGlzaFwiLFxyXG4gICAgXCJwdWJsaXNoLWFscGhhXCI6IFwibnBtIHB1Ymxpc2ggLS10YWcgYWxwaGFcIlxyXG4gIH0sXHJcbiAgXCJwZWVyRGVwZW5kZW5jaWVzXCI6IHtcclxuICAgIFwiQHRoYXRvcGVuL2ZyYWdtZW50c1wiOiBcIjIuMy4wLWFscGhhLjFcIixcclxuICAgIFwidGhyZWVcIjogXCJeMC4xNjAuMVwiLFxyXG4gICAgXCJ3ZWItaWZjXCI6IFwiMC4wLjU3XCJcclxuICB9LFxyXG4gIFwiZGV2RGVwZW5kZW5jaWVzXCI6IHtcclxuICAgIFwiQHRoYXRvcGVuL2ZyYWdtZW50c1wiOiBcIj49Mi4zLjAtYWxwaGFcIixcclxuICAgIFwiQHRoYXRvcGVuL3VpXCI6IFwifjIuMi4wXCIsXHJcbiAgICBcIkB0aGF0b3Blbi91aS1vYmNcIjogXCJ+Mi4yLjBcIixcclxuICAgIFwiQHR5cGVzL2VhcmN1dFwiOiBcIl4yLjEuNFwiLFxyXG4gICAgXCJAdHlwZXMvdGhyZWVcIjogXCJeMC4xNjAuMFwiLFxyXG4gICAgXCJ0aHJlZVwiOiBcIl4wLjE2MC4xXCIsXHJcbiAgICBcIndlYi1pZmNcIjogXCIwLjAuNTdcIlxyXG4gIH0sXHJcbiAgXCJkZXBlbmRlbmNpZXNcIjoge1xyXG4gICAgXCJAdGhhdG9wZW4vY29tcG9uZW50c1wiOiBcIj49Mi4zLjAtYWxwaGFcIixcclxuICAgIFwiY2FtZXJhLWNvbnRyb2xzXCI6IFwiMi43LjNcIixcclxuICAgIFwiZGV4aWVcIjogXCJeNC4wLjRcIixcclxuICAgIFwiZWFyY3V0XCI6IFwiXjIuMi40XCIsXHJcbiAgICBcIm44YW9cIjogXCIxLjUuMVwiLFxyXG4gICAgXCJwb3N0cHJvY2Vzc2luZ1wiOiBcIjYuMzQuMlwiXHJcbiAgfVxyXG59XHJcbiJdLAogICJtYXBwaW5ncyI6ICI7QUFDQSxPQUFPLFNBQVM7QUFDaEIsU0FBUyxvQkFBb0I7QUFDN0IsWUFBWSxVQUFVO0FBQ3RCLFlBQVksUUFBUTs7O0FDOEJsQix1QkFBb0I7QUFBQSxFQUNsQix1QkFBdUI7QUFBQSxFQUN2QixPQUFTO0FBQUEsRUFDVCxXQUFXO0FBQ2I7OztBRHRDRixJQUFNLG1DQUFtQztBQU96QyxJQUFNLG1CQUFtQixNQUFNO0FBQzdCLFNBQU87QUFBQSxJQUNMLE1BQU07QUFBQSxJQUNOLE1BQU0sY0FBYztBQUNsQixVQUFJLENBQUksY0FBVyxRQUFRO0FBQUc7QUFDOUIsY0FBUSxJQUFJLHVCQUF1QjtBQUNuQyxZQUFNLGdCQUFtQixnQkFBYSxnQkFBZ0I7QUFDdEQsTUFBRyxpQkFBYyx1QkFBdUIsYUFBYTtBQUFBLElBQ3ZEO0FBQUEsRUFDRjtBQUNGO0FBRUEsSUFBTSxzQkFBc0IsQ0FBQ0EsU0FBNkI7QUFDeEQsTUFBSSxDQUFJLGNBQVcsUUFBUTtBQUFHO0FBQzlCLFVBQVEsSUFBSSx1QkFBdUI7QUFDbkMsTUFBSSxRQUFRO0FBQ1osRUFBQUEsS0FBSSxRQUFRLENBQUMsZ0JBQWdCO0FBQzNCLFVBQU0sY0FBYyxZQUNqQixRQUFRLG1DQUFtQyxFQUFFLEVBQzdDLFFBQVEsZ0JBQWdCLEVBQUUsRUFDMUIsUUFBUSxNQUFNLEdBQUc7QUFDcEIsYUFBUztBQUFBLEVBQ1gsQ0FBQztBQUNELEVBQUc7QUFBQSxJQUNEO0FBQUEsSUFDQTtBQUFBLEVBQTRCLEtBQUs7QUFBQTtBQUFBLEVBQ25DO0FBQ0Y7QUFFQSxJQUFPLHNCQUFRLGFBQWE7QUFBQSxFQUMxQixPQUFPO0FBQUEsSUFDTCxLQUFLO0FBQUEsTUFDSCxPQUFZLGFBQVEsa0NBQVcsZ0JBQWdCO0FBQUEsTUFDL0MsU0FBUyxDQUFDLElBQUk7QUFBQSxNQUNkLFVBQVU7QUFBQSxJQUNaO0FBQUEsSUFDQSxlQUFlO0FBQUEsTUFDYixVQUFVLE9BQU8sS0FBaUIsZ0JBQWdCO0FBQUEsTUFDbEQsUUFBUTtBQUFBLFFBQ04sU0FBUztBQUFBLFVBQ1AsT0FBTztBQUFBLFVBQ1AsdUJBQXVCO0FBQUEsVUFDdkIsV0FBVztBQUFBLFFBQ2I7QUFBQSxNQUNGO0FBQUEsSUFDRjtBQUFBLEVBQ0Y7QUFBQSxFQUNBLFNBQVM7QUFBQSxJQUNQLGlCQUFpQjtBQUFBLElBQ2pCLElBQUk7QUFBQSxNQUNGLFNBQVMsQ0FBQyxPQUFPO0FBQUEsTUFDakIsU0FBUyxDQUFDLHVCQUF1QixvQkFBb0I7QUFBQSxNQUNyRCxZQUFZO0FBQUEsSUFDZCxDQUFDO0FBQUEsRUFDSDtBQUNGLENBQUM7IiwKICAibmFtZXMiOiBbImR0cyJdCn0K diff --git a/yarn.lock b/yarn.lock index f7e082f6b..2ce9cc6eb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,39 +5,39 @@ __metadata: version: 6 cacheKey: 8 -"@babel/helper-string-parser@npm:^7.24.8": - version: 7.24.8 - resolution: "@babel/helper-string-parser@npm:7.24.8" - checksum: 39b03c5119216883878655b149148dc4d2e284791e969b19467a9411fccaa33f7a713add98f4db5ed519535f70ad273cdadfd2eb54d47ebbdeac5083351328ce +"@babel/helper-string-parser@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-string-parser@npm:7.25.7" + checksum: 0835fda5efe02cdcb5144a939b639acc017ba4aa1cc80524b44032ddb714080d3e40e8f0d3240832b7bd86f5513f0b63d4fe77d8fc52d8c8720ae674182c0753 languageName: node linkType: hard -"@babel/helper-validator-identifier@npm:^7.24.7": - version: 7.24.7 - resolution: "@babel/helper-validator-identifier@npm:7.24.7" - checksum: 6799ab117cefc0ecd35cd0b40ead320c621a298ecac88686a14cffceaac89d80cdb3c178f969861bf5fa5e4f766648f9161ea0752ecfe080d8e89e3147270257 +"@babel/helper-validator-identifier@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-validator-identifier@npm:7.25.7" + checksum: 062f55208deead4876eb474dc6fd55155c9eada8d0a505434de3b9aa06c34195562e0f3142b22a08793a38d740238efa2fe00ff42956cdcb8ac03f0b6c542247 languageName: node linkType: hard -"@babel/parser@npm:^7.24.7": - version: 7.25.3 - resolution: "@babel/parser@npm:7.25.3" +"@babel/parser@npm:^7.25.3": + version: 7.25.7 + resolution: "@babel/parser@npm:7.25.7" dependencies: - "@babel/types": ^7.25.2 + "@babel/types": ^7.25.7 bin: parser: ./bin/babel-parser.js - checksum: b55aba64214fa1d66ccd0d29f476d2e55a48586920d280f88c546f81cbbececc0e01c9d05a78d6bf206e8438b9c426caa344942c1a581eecc4d365beaab8a20e + checksum: 7c40c2881e92415f5f2a88ac1078a8fea7f2b10097e76116ce40bfe01443d3a842c704bdb64d7b54c9e9dbbf49a60a0e1cf79ff35bcd02c52ff424179acd4259 languageName: node linkType: hard -"@babel/types@npm:^7.25.2": - version: 7.25.2 - resolution: "@babel/types@npm:7.25.2" +"@babel/types@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/types@npm:7.25.7" dependencies: - "@babel/helper-string-parser": ^7.24.8 - "@babel/helper-validator-identifier": ^7.24.7 + "@babel/helper-string-parser": ^7.25.7 + "@babel/helper-validator-identifier": ^7.25.7 to-fast-properties: ^2.0.0 - checksum: f73f66ba903c6f7e38f519a33d53a67d49c07e208e59ea65250362691dc546c6da7ab90ec66ee79651ef697329872f6f97eb19a6dfcacc026fd05e76a563c5d2 + checksum: a63a3ecdac5eb2fa10a75d50ec23d1560beed6c4037ccf478a430cc221ba9b8b3a55cfbaaefb6e997051728f3c02b44dcddb06de9a0132f164a0a597dd825731 languageName: node linkType: hard @@ -214,9 +214,9 @@ __metadata: linkType: hard "@eslint-community/regexpp@npm:^4.5.1, @eslint-community/regexpp@npm:^4.6.1": - version: 4.11.0 - resolution: "@eslint-community/regexpp@npm:4.11.0" - checksum: 97d2fe46690b69417a551bd19a3dc53b6d9590d2295c43cc4c4e44e64131af541e2f4a44d5c12e87de990403654d3dae9d33600081f3a2f0386b368abc9111ec + version: 4.11.1 + resolution: "@eslint-community/regexpp@npm:4.11.1" + checksum: 6986685529d30e33c2640973c3d8e7ddd31bef3cc8cb10ad54ddc1dea12680779a2c23a45562aa1462c488137a3570e672d122fac7da22d82294382d915cec70 languageName: node linkType: hard @@ -245,11 +245,11 @@ __metadata: linkType: hard "@floating-ui/core@npm:^1.0.0": - version: 1.6.7 - resolution: "@floating-ui/core@npm:1.6.7" + version: 1.6.8 + resolution: "@floating-ui/core@npm:1.6.8" dependencies: - "@floating-ui/utils": ^0.2.7 - checksum: ff940c228f7c4f95138c4979ba1c1122d804cac55e514c889cbdb9f76d5bebbd0f7a02ae1d468b66a9e728343d5a79430845781230e012560b4719fdde458461 + "@floating-ui/utils": ^0.2.8 + checksum: 82faa6ea9d57e466779324e51308d6d49c098fb9d184a08d9bb7f4fad83f08cc070fc491f8d56f0cad44a16215fb43f9f829524288413e6c33afcb17303698de languageName: node linkType: hard @@ -263,10 +263,10 @@ __metadata: languageName: node linkType: hard -"@floating-ui/utils@npm:^0.2.0, @floating-ui/utils@npm:^0.2.7": - version: 0.2.7 - resolution: "@floating-ui/utils@npm:0.2.7" - checksum: 7e6707c4c6d496f86377a97aac0232926953a2da9c2058ed79d8b44031038ef8fcf9743dac7b38c1da7148460194da987814d78af801ec5c278abf9b303adb22 +"@floating-ui/utils@npm:^0.2.0, @floating-ui/utils@npm:^0.2.8": + version: 0.2.8 + resolution: "@floating-ui/utils@npm:0.2.8" + checksum: deb98bba017c4e073c7ad5740d4dec33a4d3e0942d412e677ac0504f3dade15a68fc6fd164d43c93c0bb0bcc5dc5015c1f4080dfb1a6161140fe660624f7c875 languageName: node linkType: hard @@ -448,8 +448,8 @@ __metadata: linkType: hard "@rollup/pluginutils@npm:^5.1.0": - version: 5.1.0 - resolution: "@rollup/pluginutils@npm:5.1.0" + version: 5.1.2 + resolution: "@rollup/pluginutils@npm:5.1.2" dependencies: "@types/estree": ^1.0.0 estree-walker: ^2.0.2 @@ -459,118 +459,118 @@ __metadata: peerDependenciesMeta: rollup: optional: true - checksum: 3cc5a6d91452a6eabbfd1ae79b4dd1f1e809d2eecda6e175deb784e75b0911f47e9ecce73f8dd315d6a8b3f362582c91d3c0f66908b6ced69345b3cbe28f8ce8 + checksum: 16c8c154fef9a32c513b52bd79c92ac427edccd05a8dc3994f10c296063940c57bf809d05903b473d9d408aa5977d75b98c701f481dd1856d5ffc37187ac0060 languageName: node linkType: hard -"@rollup/rollup-android-arm-eabi@npm:4.20.0": - version: 4.20.0 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.20.0" +"@rollup/rollup-android-arm-eabi@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.24.0" conditions: os=android & cpu=arm languageName: node linkType: hard -"@rollup/rollup-android-arm64@npm:4.20.0": - version: 4.20.0 - resolution: "@rollup/rollup-android-arm64@npm:4.20.0" +"@rollup/rollup-android-arm64@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-android-arm64@npm:4.24.0" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-arm64@npm:4.20.0": - version: 4.20.0 - resolution: "@rollup/rollup-darwin-arm64@npm:4.20.0" +"@rollup/rollup-darwin-arm64@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-darwin-arm64@npm:4.24.0" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-x64@npm:4.20.0": - version: 4.20.0 - resolution: "@rollup/rollup-darwin-x64@npm:4.20.0" +"@rollup/rollup-darwin-x64@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-darwin-x64@npm:4.24.0" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@rollup/rollup-linux-arm-gnueabihf@npm:4.20.0": - version: 4.20.0 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.20.0" +"@rollup/rollup-linux-arm-gnueabihf@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.24.0" conditions: os=linux & cpu=arm & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm-musleabihf@npm:4.20.0": - version: 4.20.0 - resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.20.0" +"@rollup/rollup-linux-arm-musleabihf@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.24.0" conditions: os=linux & cpu=arm & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-arm64-gnu@npm:4.20.0": - version: 4.20.0 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.20.0" +"@rollup/rollup-linux-arm64-gnu@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.24.0" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm64-musl@npm:4.20.0": - version: 4.20.0 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.20.0" +"@rollup/rollup-linux-arm64-musl@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.24.0" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-powerpc64le-gnu@npm:4.20.0": - version: 4.20.0 - resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.20.0" +"@rollup/rollup-linux-powerpc64le-gnu@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.24.0" conditions: os=linux & cpu=ppc64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-gnu@npm:4.20.0": - version: 4.20.0 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.20.0" +"@rollup/rollup-linux-riscv64-gnu@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.24.0" conditions: os=linux & cpu=riscv64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-s390x-gnu@npm:4.20.0": - version: 4.20.0 - resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.20.0" +"@rollup/rollup-linux-s390x-gnu@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.24.0" conditions: os=linux & cpu=s390x & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-gnu@npm:4.20.0": - version: 4.20.0 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.20.0" +"@rollup/rollup-linux-x64-gnu@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.24.0" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-musl@npm:4.20.0": - version: 4.20.0 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.20.0" +"@rollup/rollup-linux-x64-musl@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.24.0" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-win32-arm64-msvc@npm:4.20.0": - version: 4.20.0 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.20.0" +"@rollup/rollup-win32-arm64-msvc@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.24.0" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-win32-ia32-msvc@npm:4.20.0": - version: 4.20.0 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.20.0" +"@rollup/rollup-win32-ia32-msvc@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.24.0" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@rollup/rollup-win32-x64-msvc@npm:4.20.0": - version: 4.20.0 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.20.0" +"@rollup/rollup-win32-x64-msvc@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.24.0" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -621,8 +621,8 @@ __metadata: version: 0.0.0-use.local resolution: "@thatopen/components-front@workspace:packages/front" dependencies: - "@thatopen/components": ~2.2.0 - "@thatopen/fragments": ~2.2.0 + "@thatopen/components": ">=2.3.0-alpha.5" + "@thatopen/fragments": ~2.3.0 "@thatopen/ui": ~2.2.0 "@thatopen/ui-obc": ~2.2.0 "@types/earcut": ^2.1.4 @@ -635,17 +635,17 @@ __metadata: three: ^0.160.1 web-ifc: 0.0.57 peerDependencies: - "@thatopen/fragments": ~2.2.0 + "@thatopen/fragments": ">=2.3.0-alpha" three: ^0.160.1 web-ifc: 0.0.57 languageName: unknown linkType: soft -"@thatopen/components@workspace:packages/core, @thatopen/components@~2.2.0": +"@thatopen/components@>=2.3.0-alpha.5, @thatopen/components@workspace:packages/core": version: 0.0.0-use.local resolution: "@thatopen/components@workspace:packages/core" dependencies: - "@thatopen/fragments": ~2.2.0 + "@thatopen/fragments": ~2.3.0 "@thatopen/ui": ~2.2.0 "@types/three": 0.160.0 camera-controls: 2.7.3 @@ -656,27 +656,27 @@ __metadata: three-mesh-bvh: 0.7.0 web-ifc: 0.0.57 peerDependencies: - "@thatopen/fragments": ~2.2.0 + "@thatopen/fragments": ~2.3.0 three: ^0.160.1 web-ifc: 0.0.57 languageName: unknown linkType: soft -"@thatopen/fragments@npm:~2.2.0": - version: 2.2.0 - resolution: "@thatopen/fragments@npm:2.2.0" +"@thatopen/fragments@npm:~2.3.0": + version: 2.3.0 + resolution: "@thatopen/fragments@npm:2.3.0" dependencies: flatbuffers: 23.3.3 three-mesh-bvh: 0.7.0 peerDependencies: three: ^0.160.1 - checksum: 06447122b22c460bda4b598be8b2c933ca894e400c9da568b2f1d9adc25907825743fa646f69030ce8c19a043432b75ce619d88557488a18a5eb4dbf5a498922 + checksum: b2e64a08dbc5ffa458fd76b6724f7afb86b7a6a338a520cbc4f539f1d2868ab1c3129c1321625b3ab49829762d4712fd4f96662630a3defdd79c2d34b6f6994b languageName: node linkType: hard "@thatopen/ui-obc@npm:~2.2.0": - version: 2.2.0 - resolution: "@thatopen/ui-obc@npm:2.2.0" + version: 2.2.5 + resolution: "@thatopen/ui-obc@npm:2.2.5" dependencies: "@thatopen/ui": ~2.2.0 lit: 3.1.2 @@ -685,18 +685,18 @@ __metadata: "@thatopen/components-front": ~2.2.0 three: 0.160.1 web-ifc: 0.0.57 - checksum: 0f76dafc8377f2568412da765c2f14658b9cbe397d6fbf8b9ec702bbe3e7fa9dcec4b82f3f221a61076b302aafe226e36b59391337bf2c9cdf0840e6352f3f7c + checksum: ee0ef22f671c7e802e12771063de8b9f8d68094fb53862cc98a7688ed227604d2cadfc8121245e77d293f8e4773782e22cd0562aed42e7b7898eddc83a5c8072 languageName: node linkType: hard "@thatopen/ui@npm:~2.2.0": - version: 2.2.0 - resolution: "@thatopen/ui@npm:2.2.0" + version: 2.2.2 + resolution: "@thatopen/ui@npm:2.2.2" dependencies: "@floating-ui/dom": 1.6.3 iconify-icon: 2.0.0 lit: 3.1.2 - checksum: 29a81792166bc75e2db8a285f9767e2fc8af98eadb1c422e9c5d1877391443860a970a2487f96491f1f0e9a1dfe55dac65423de7997e541541f6d775b8847774 + checksum: 72bbf5ecad9f33272656b79d0338c753a4c03a63c1d2c07676476206d14de39be9c747af20d6fce9483061d8afcd39f61b584daaf001a19db286b05a70d552b6 languageName: node linkType: hard @@ -714,10 +714,10 @@ __metadata: languageName: node linkType: hard -"@types/estree@npm:1.0.5, @types/estree@npm:^1.0.0": - version: 1.0.5 - resolution: "@types/estree@npm:1.0.5" - checksum: dd8b5bed28e6213b7acd0fb665a84e693554d850b0df423ac8076cc3ad5823a6bc26b0251d080bdc545af83179ede51dd3f6fa78cad2c46ed1f29624ddf3e41a +"@types/estree@npm:1.0.6, @types/estree@npm:^1.0.0": + version: 1.0.6 + resolution: "@types/estree@npm:1.0.6" + checksum: 8825d6e729e16445d9a1dd2fb1db2edc5ed400799064cd4d028150701031af012ba30d6d03fe9df40f4d7a437d0de6d2b256020152b7b09bde9f2e420afdffd9 languageName: node linkType: hard @@ -736,11 +736,11 @@ __metadata: linkType: hard "@types/node@npm:latest": - version: 22.3.0 - resolution: "@types/node@npm:22.3.0" + version: 22.7.4 + resolution: "@types/node@npm:22.7.4" dependencies: - undici-types: ~6.18.2 - checksum: a86a552e9d3e135da4c975aa73bb1a655ae94f4d8de1547f6f95ad6b244ae2156347548fd35b6a5dd2c65688694198ae8b0923d9c32264dbc3dbfb2f688bd147 + undici-types: ~6.19.2 + checksum: a3f4154147639369aed08fe6f8d62eff637cf87b187bb252d7bbccdc82884626007af424b08a653c53f2182adfa0340001b4888cb7cbb942cef351210fc742a5 languageName: node linkType: hard @@ -778,9 +778,9 @@ __metadata: linkType: hard "@types/webxr@npm:*": - version: 0.5.19 - resolution: "@types/webxr@npm:0.5.19" - checksum: aed3e799d66084923ab7238129ad9e1876d4c9b1f26d3f4351fb82733107842f0e53a29b5d43d8460228bf51ef75daa578922a64ef6c15265ba3fc43e23972cb + version: 0.5.20 + resolution: "@types/webxr@npm:0.5.20" + checksum: 8085c291ca8a8adfe03245725384234e62d61cc0f5f7b9985c2a0ba2b2a794cac538861c4904d8fcd28e3e381f0a4ecc5d4514d143dbf3fc0cf3193dc1cc7a54 languageName: node linkType: hard @@ -942,26 +942,26 @@ __metadata: languageName: node linkType: hard -"@vue/compiler-core@npm:3.4.38": - version: 3.4.38 - resolution: "@vue/compiler-core@npm:3.4.38" +"@vue/compiler-core@npm:3.5.11": + version: 3.5.11 + resolution: "@vue/compiler-core@npm:3.5.11" dependencies: - "@babel/parser": ^7.24.7 - "@vue/shared": 3.4.38 + "@babel/parser": ^7.25.3 + "@vue/shared": 3.5.11 entities: ^4.5.0 estree-walker: ^2.0.2 source-map-js: ^1.2.0 - checksum: dbfda932e03743aa4575a61c28b40bfeddbc89d665e99f148a6b356d4a5f41a174c421e25193dc3483baa3060afbbd46f78bf82abb3e0eea99373f33258814fc + checksum: 5b5cec0bacdefbccd7852970bfb517da10e3880f8377df150ddc71c9a146f830e10e35b97cbab958a32c930cb984c4682f9d36eeed965b4cb05e753dbcfbc7e5 languageName: node linkType: hard "@vue/compiler-dom@npm:^3.3.0": - version: 3.4.38 - resolution: "@vue/compiler-dom@npm:3.4.38" + version: 3.5.11 + resolution: "@vue/compiler-dom@npm:3.5.11" dependencies: - "@vue/compiler-core": 3.4.38 - "@vue/shared": 3.4.38 - checksum: eef48039b05727c545d2d13436ea529b239aa2151ba383b6938cb53204a6e867fd7f40f8fa69d1d27c86a51ca09f9ca15fc2e4bdb785e2702ee3a0b93a81d2fb + "@vue/compiler-core": 3.5.11 + "@vue/shared": 3.5.11 + checksum: 4e757cd1c023d73f9f33ae07a442bc9710e9aeb64dd4953a9f128232798d157c70b0cfb5d0a7d3af08ade0677545fe7376bb83839a7a0cca2f11b32d04f620d3 languageName: node linkType: hard @@ -987,10 +987,10 @@ __metadata: languageName: node linkType: hard -"@vue/shared@npm:3.4.38, @vue/shared@npm:^3.3.0": - version: 3.4.38 - resolution: "@vue/shared@npm:3.4.38" - checksum: 598d36eb2e4793d3c0b01594683fb37fd257ddfac7d02013c9d2d1f5e2ab5df41b2d9b1d1bf9384aa0cca69a4a2b09d43931c73c2e372dfe1e11bb6cbe16f5b0 +"@vue/shared@npm:3.5.11, @vue/shared@npm:^3.3.0": + version: 3.5.11 + resolution: "@vue/shared@npm:3.5.11" + checksum: cc754649b3ca364c2dc5bb4105cb1e836707733efb1d8b70acd50a46d50835ad07082a25f23b22c88c4f6fa0770c61e684abea9c92693091da80fdc86c8b22cf languageName: node linkType: hard @@ -1058,9 +1058,9 @@ __metadata: linkType: hard "ansi-regex@npm:^6.0.1": - version: 6.0.1 - resolution: "ansi-regex@npm:6.0.1" - checksum: 1ff8b7667cded1de4fa2c9ae283e979fc87036864317da86a2e546725f96406746411d0d85e87a2d12fa5abd715d90006de7fa4fa0477c92321ad3b4c7d4e169 + version: 6.1.0 + resolution: "ansi-regex@npm:6.1.0" + checksum: 495834a53b0856c02acd40446f7130cb0f8284f4a39afdab20d5dc42b2e198b1196119fe887beed8f9055c4ff2055e3b2f6d4641d0be018cdfb64fedf6fc1aac languageName: node linkType: hard @@ -1408,14 +1408,14 @@ __metadata: linkType: hard "debug@npm:4, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.4": - version: 4.3.6 - resolution: "debug@npm:4.3.6" + version: 4.3.7 + resolution: "debug@npm:4.3.7" dependencies: - ms: 2.1.2 + ms: ^2.1.3 peerDependenciesMeta: supports-color: optional: true - checksum: 1630b748dea3c581295e02137a9f5cbe2c1d85fea35c1e6597a65ca2b16a6fce68cec61b299d480787ef310ba927dc8c92d3061faba0ad06c6a724672f66be7f + checksum: 822d74e209cd910ef0802d261b150314bbcf36c582ccdbb3e70f0894823c17e49a50d3e66d96b633524263975ca16b6a833f3e3b7e030c157169a5fabac63160 languageName: node linkType: hard @@ -1784,14 +1784,14 @@ __metadata: linkType: hard "eslint-module-utils@npm:^2.8.0": - version: 2.8.1 - resolution: "eslint-module-utils@npm:2.8.1" + version: 2.12.0 + resolution: "eslint-module-utils@npm:2.12.0" dependencies: debug: ^3.2.7 peerDependenciesMeta: eslint: optional: true - checksum: 3cecd99b6baf45ffc269167da0f95dcb75e5aa67b93d73a3bab63e2a7eedd9cdd6f188eed048e2f57c1b77db82c9cbf2adac20b512fa70e597d863dd3720170d + checksum: be3ac52e0971c6f46daeb1a7e760e45c7c45f820c8cc211799f85f10f04ccbf7afc17039165d56cb2da7f7ca9cec2b3a777013cddf0b976784b37eb9efa24180 languageName: node linkType: hard @@ -2558,11 +2558,11 @@ __metadata: linkType: hard "is-core-module@npm:^2.1.0, is-core-module@npm:^2.13.0, is-core-module@npm:^2.13.1": - version: 2.15.0 - resolution: "is-core-module@npm:2.15.0" + version: 2.15.1 + resolution: "is-core-module@npm:2.15.1" dependencies: hasown: ^2.0.2 - checksum: a9f7a52707c9b59d7164094d183bda892514fc3ba3139f245219c7abe7f6e8d3e2cdcf861f52a891a467f785f1dfa5d549f73b0ee715f4ba56e8882d335ea585 + checksum: df134c168115690724b62018c37b2f5bba0d5745fa16960b329c5a00883a8bea6a5632fdb1e3efcce237c201826ba09f93197b7cd95577ea56b0df335be23633 languageName: node linkType: hard @@ -2741,15 +2741,11 @@ __metadata: linkType: hard "jackspeak@npm:^4.0.1": - version: 4.0.1 - resolution: "jackspeak@npm:4.0.1" + version: 4.0.2 + resolution: "jackspeak@npm:4.0.2" dependencies: "@isaacs/cliui": ^8.0.2 - "@pkgjs/parseargs": ^0.11.0 - dependenciesMeta: - "@pkgjs/parseargs": - optional: true - checksum: 7989d19eddeff0631ef653df413e26290db77dc3791438bd12b56bed1c0b24d5d535fdfec13cf35775cd5b47f8ee57d36fd0bceaf2df672b1f523533fd4184cc + checksum: 210030029edfa1658328799ad88c3d0fc057c4cb8a069fc4137cc8d2cc4b65c9721c6e749e890f9ca77a954bb54f200f715b8896e50d330e5f3e902e72b40974 languageName: node linkType: hard @@ -2945,9 +2941,9 @@ __metadata: linkType: hard "lru-cache@npm:^11.0.0": - version: 11.0.0 - resolution: "lru-cache@npm:11.0.0" - checksum: c29385f9369b1a566e1db9eda9a4b12f6507de906e5720ca12844dd775b7139c42b8e5837e7d5162bcc292ce4d3eecfa74ec2856c6afcc0caa2e3c9ea3a17f27 + version: 11.0.1 + resolution: "lru-cache@npm:11.0.1" + checksum: 6056230a99fb399234e82368b99586bd4740079e80649102f681b19337b7d8c6bc8dd7f8b8c59377c31d26deb89f548b717ae932e139b4b795879d920fccf820 languageName: node linkType: hard @@ -2995,12 +2991,12 @@ __metadata: linkType: hard "micromatch@npm:^4.0.4": - version: 4.0.7 - resolution: "micromatch@npm:4.0.7" + version: 4.0.8 + resolution: "micromatch@npm:4.0.8" dependencies: braces: ^3.0.3 picomatch: ^2.3.1 - checksum: 3cde047d70ad80cf60c787b77198d680db3b8c25b23feb01de5e2652205d9c19f43bd81882f69a0fd1f0cde6a7a122d774998aad3271ddb1b8accf8a0f480cf7 + checksum: 79920eb634e6f400b464a954fcfa589c4e7c7143209488e44baf627f9affc8b1e306f41f4f0deedde97e69cb725920879462d3e750ab3bd3c1aed675bb3a8966 languageName: node linkType: hard @@ -3140,14 +3136,7 @@ __metadata: languageName: node linkType: hard -"ms@npm:2.1.2": - version: 2.1.2 - resolution: "ms@npm:2.1.2" - checksum: 673cdb2c3133eb050c745908d8ce632ed2c02d85640e2edb3ace856a2266a813b30c613569bf3354fdf4ea7d1a1494add3bfa95e2713baa27d0c2c71fc44f58f - languageName: node - linkType: hard - -"ms@npm:^2.1.1": +"ms@npm:^2.1.1, ms@npm:^2.1.3": version: 2.1.3 resolution: "ms@npm:2.1.3" checksum: aa92de608021b242401676e35cfa5aa42dd70cbdc082b916da7fb925c542173e36bce97ea3e804923fe92c0ad991434e4a38327e15a1b5b5f945d66df615ae6d @@ -3347,9 +3336,9 @@ __metadata: linkType: hard "package-json-from-dist@npm:^1.0.0": - version: 1.0.0 - resolution: "package-json-from-dist@npm:1.0.0" - checksum: ac706ec856a5a03f5261e4e48fa974f24feb044d51f84f8332e2af0af04fbdbdd5bbbfb9cbbe354190409bc8307c83a9e38c6672c3c8855f709afb0006a009ea + version: 1.0.1 + resolution: "package-json-from-dist@npm:1.0.1" + checksum: 58ee9538f2f762988433da00e26acc788036914d57c71c246bf0be1b60cdbd77dd60b6a3e1a30465f0b248aeb80079e0b34cb6050b1dfa18c06953bb1cbc7602 languageName: node linkType: hard @@ -3431,10 +3420,10 @@ __metadata: languageName: node linkType: hard -"picocolors@npm:^1.0.1": - version: 1.0.1 - resolution: "picocolors@npm:1.0.1" - checksum: fa68166d1f56009fc02a34cdfd112b0dd3cf1ef57667ac57281f714065558c01828cdf4f18600ad6851cbe0093952ed0660b1e0156bddf2184b6aaf5817553a5 +"picocolors@npm:^1.1.0": + version: 1.1.0 + resolution: "picocolors@npm:1.1.0" + checksum: a64d653d3a188119ff45781dfcdaeedd7625583f45280aea33fcb032c7a0d3959f2368f9b192ad5e8aade75b74dbd954ffe3106c158509a45e4c18ab379a2acd languageName: node linkType: hard @@ -3453,13 +3442,13 @@ __metadata: linkType: hard "postcss@npm:^8.4.35": - version: 8.4.41 - resolution: "postcss@npm:8.4.41" + version: 8.4.47 + resolution: "postcss@npm:8.4.47" dependencies: nanoid: ^3.3.7 - picocolors: ^1.0.1 - source-map-js: ^1.2.0 - checksum: f865894929eb0f7fc2263811cc853c13b1c75103028b3f4f26df777e27b201f1abe21cb4aa4c2e901c80a04f6fb325ee22979688fe55a70e2ea82b0a517d3b6f + picocolors: ^1.1.0 + source-map-js: ^1.2.1 + checksum: f78440a9d8f97431dd2ab1ab8e1de64f12f3eff38a3d8d4a33919b96c381046a314658d2de213a5fa5eb296b656de76a3ec269fdea27f16d5ab465b916a0f52c languageName: node linkType: hard @@ -3551,14 +3540,14 @@ __metadata: linkType: hard "regexp.prototype.flags@npm:^1.5.2": - version: 1.5.2 - resolution: "regexp.prototype.flags@npm:1.5.2" + version: 1.5.3 + resolution: "regexp.prototype.flags@npm:1.5.3" dependencies: - call-bind: ^1.0.6 + call-bind: ^1.0.7 define-properties: ^1.2.1 es-errors: ^1.3.0 - set-function-name: ^2.0.1 - checksum: d7f333667d5c564e2d7a97c56c3075d64c722c9bb51b2b4df6822b2e8096d623a5e63088fb4c83df919b6951ef8113841de8b47de7224872fa6838bc5d8a7d64 + set-function-name: ^2.0.2 + checksum: 83ff0705b837f7cb6d664010a11642250f36d3f642263dd0f3bdfe8f150261aa7b26b50ee97f21c1da30ef82a580bb5afedbef5f45639d69edaafbeac9bbb0ed languageName: node linkType: hard @@ -3641,26 +3630,26 @@ __metadata: linkType: hard "rollup@npm:^4.2.0": - version: 4.20.0 - resolution: "rollup@npm:4.20.0" - dependencies: - "@rollup/rollup-android-arm-eabi": 4.20.0 - "@rollup/rollup-android-arm64": 4.20.0 - "@rollup/rollup-darwin-arm64": 4.20.0 - "@rollup/rollup-darwin-x64": 4.20.0 - "@rollup/rollup-linux-arm-gnueabihf": 4.20.0 - "@rollup/rollup-linux-arm-musleabihf": 4.20.0 - "@rollup/rollup-linux-arm64-gnu": 4.20.0 - "@rollup/rollup-linux-arm64-musl": 4.20.0 - "@rollup/rollup-linux-powerpc64le-gnu": 4.20.0 - "@rollup/rollup-linux-riscv64-gnu": 4.20.0 - "@rollup/rollup-linux-s390x-gnu": 4.20.0 - "@rollup/rollup-linux-x64-gnu": 4.20.0 - "@rollup/rollup-linux-x64-musl": 4.20.0 - "@rollup/rollup-win32-arm64-msvc": 4.20.0 - "@rollup/rollup-win32-ia32-msvc": 4.20.0 - "@rollup/rollup-win32-x64-msvc": 4.20.0 - "@types/estree": 1.0.5 + version: 4.24.0 + resolution: "rollup@npm:4.24.0" + dependencies: + "@rollup/rollup-android-arm-eabi": 4.24.0 + "@rollup/rollup-android-arm64": 4.24.0 + "@rollup/rollup-darwin-arm64": 4.24.0 + "@rollup/rollup-darwin-x64": 4.24.0 + "@rollup/rollup-linux-arm-gnueabihf": 4.24.0 + "@rollup/rollup-linux-arm-musleabihf": 4.24.0 + "@rollup/rollup-linux-arm64-gnu": 4.24.0 + "@rollup/rollup-linux-arm64-musl": 4.24.0 + "@rollup/rollup-linux-powerpc64le-gnu": 4.24.0 + "@rollup/rollup-linux-riscv64-gnu": 4.24.0 + "@rollup/rollup-linux-s390x-gnu": 4.24.0 + "@rollup/rollup-linux-x64-gnu": 4.24.0 + "@rollup/rollup-linux-x64-musl": 4.24.0 + "@rollup/rollup-win32-arm64-msvc": 4.24.0 + "@rollup/rollup-win32-ia32-msvc": 4.24.0 + "@rollup/rollup-win32-x64-msvc": 4.24.0 + "@types/estree": 1.0.6 fsevents: ~2.3.2 dependenciesMeta: "@rollup/rollup-android-arm-eabi": @@ -3699,7 +3688,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: 92c6c68a93d7726345df2627fd5b0a88d1481fbe76e6c8ad84a8eae6835c03fc36ed4cb3271350b5290397b26eb97a97297496ca972289b2299a24e81649bca0 + checksum: b7e915b0cc43749c2c71255ff58858496460b1a75148db2abecc8e9496af83f488517768593826715f610e20e480a5ae7f1132a1408eb1d364830d6b239325cf languageName: node linkType: hard @@ -3812,7 +3801,7 @@ __metadata: languageName: node linkType: hard -"set-function-name@npm:^2.0.1": +"set-function-name@npm:^2.0.2": version: 2.0.2 resolution: "set-function-name@npm:2.0.2" dependencies: @@ -3901,10 +3890,10 @@ __metadata: languageName: node linkType: hard -"source-map-js@npm:^1.2.0": - version: 1.2.0 - resolution: "source-map-js@npm:1.2.0" - checksum: 791a43306d9223792e84293b00458bf102a8946e7188f3db0e4e22d8d530b5f80a4ce468eb5ec0bf585443ad55ebbd630bf379c98db0b1f317fd902500217f97 +"source-map-js@npm:^1.2.0, source-map-js@npm:^1.2.1": + version: 1.2.1 + resolution: "source-map-js@npm:1.2.1" + checksum: 4eb0cd997cdf228bc253bcaff9340afeb706176e64868ecd20efbe6efea931465f43955612346d6b7318789e5265bdc419bc7669c1cebe3db0eb255f57efa76b languageName: node linkType: hard @@ -4157,9 +4146,9 @@ __metadata: linkType: hard "tslib@npm:^2.6.2": - version: 2.6.3 - resolution: "tslib@npm:2.6.3" - checksum: 74fce0e100f1ebd95b8995fbbd0e6c91bdd8f4c35c00d4da62e285a3363aaa534de40a80db30ecfd388ed7c313c42d930ee0eaf108e8114214b180eec3dbe6f5 + version: 2.7.0 + resolution: "tslib@npm:2.7.0" + checksum: 1606d5c89f88d466889def78653f3aab0f88692e80bb2066d090ca6112ae250ec1cfa9dbfaab0d17b60da15a4186e8ec4d893801c67896b277c17374e36e1d28 languageName: node linkType: hard @@ -4283,10 +4272,10 @@ __metadata: languageName: node linkType: hard -"undici-types@npm:~6.18.2": - version: 6.18.2 - resolution: "undici-types@npm:6.18.2" - checksum: 5cd9b1c0fc612603c7ba0f0c6a19d04f00d21b98c5a9da06dc3bf92f1f9d3ec3946322e9806ec0f2fbfbad3f248cde1988410fc30ffacee39693ac24078992ca +"undici-types@npm:~6.19.2": + version: 6.19.8 + resolution: "undici-types@npm:6.19.8" + checksum: de51f1b447d22571cf155dfe14ff6d12c5bdaec237c765085b439c38ca8518fc360e88c70f99469162bf2e14188a7b0bcb06e1ed2dc031042b984b0bb9544017 languageName: node linkType: hard