toposync-ext-structural 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,13 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "com.toposync.structural",
4
+ "name": "Structural",
5
+ "version": "0.1.0",
6
+ "frontend": {
7
+ "kind": "module-federation",
8
+ "remote_entry": "remoteEntry.js",
9
+ "scope": "structural",
10
+ "module": "./activate"
11
+ }
12
+ }
13
+
@@ -0,0 +1,9 @@
1
+ from __future__ import annotations
2
+
3
+ from toposync.extensions import BaseExtension
4
+
5
+
6
+ class StructuralExtension(BaseExtension):
7
+ def __init__(self) -> None:
8
+ super().__init__(package="toposync_ext_structural")
9
+
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 12.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunk_toposync_extension_structural_ui=self.webpackChunk_toposync_extension_structural_ui||[]).push([[12],{12(e,t,o){o.r(t),o.d(t,{activate:()=>Ee});var n=o(870),r=o(496);function a(e,t){const o=function(e){const t=e.trim().replace(/^#/,"");return/^[0-9a-fA-F]{6}$/.test(t)?{r:Number.parseInt(t.slice(0,2),16),g:Number.parseInt(t.slice(2,4),16),b:Number.parseInt(t.slice(4,6),16)}:null}(e),n=Math.max(0,Math.min(1,t));return o?`rgba(${o.r},${o.g},${o.b},${n})`:`rgba(99,102,241,${n})`}const i="com.toposync.structural.wall",s="com.toposync.structural.area",l="com.toposync.structural.pool",c="#dcddda",u=.12,d="#dcddda",p="toposync.structural.area.fill.v1";function m(e,t){return"number"==typeof e&&Number.isFinite(e)?e:t}function h(e,t){return"string"==typeof e?e:t}function x(e){return/^#[0-9a-fA-F]{6}$/.test(e)}function f(e){try{if(!x(e))return;localStorage.setItem(p,e)}catch{}}function g(e,t){if(!e||"object"!=typeof e||Array.isArray(e))return t;const o=e;return{x:m(o.x,t.x),z:m(o.z,t.z)}}function w(e){return Array.isArray(e)?e.map(e=>g(e,{x:0,z:0})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.z)):[]}function y(e){const t=document.createElement("canvas");return t.width=e,t.height=e,t}function _(e,t){return e+Math.floor(Math.random()*(t-e+1))}function v(e,t,o,n){e.save(),e.globalAlpha=n;for(let n=0;n<o;n++){const o=Math.random()*t,n=Math.random()*t,r=1+2*Math.random(),a=1+2*Math.random(),i=_(0,255);e.fillStyle=`rgb(${i},${i},${i})`,e.fillRect(o,n,r,a)}e.restore()}function M(e){const t=y(e),o=t.getContext("2d");if(!o)return t;o.fillStyle="#6b7280",o.fillRect(0,0,e,e);const n=e/10,r=2.2*n,a=Math.max(1,Math.round(.01*e));for(let t=0;t<10;t++){const i=t*n;for(let s=-(t%2==0?0:r/2);s<e+r;s+=r){const e=Math.floor(s+a),t=Math.floor(i+a),l=Math.ceil(r-2*a),c=Math.ceil(n-2*a),u=_(86,140);o.fillStyle=`rgb(${u},${u},${u})`,o.fillRect(e,t,l,c)}}o.strokeStyle="#111827",o.lineWidth=a,o.globalAlpha=.85;for(let t=0;t<=10;t++){const r=t*n;o.beginPath(),o.moveTo(0,r+.5),o.lineTo(e,r+.5),o.stroke()}for(let t=0;t<10;t++){const a=t*n;for(let i=-(t%2==0?0:r/2);i<e+r;i+=r){const e=i;o.beginPath(),o.moveTo(e+.5,a),o.lineTo(e+.5,a+n),o.stroke()}}return v(o,e,Math.floor(e*e/10),.06),t}function b(e){const t=y(e),o=t.getContext("2d");if(!o)return t;o.fillStyle="#7c5d3a",o.fillRect(0,0,e,e),o.save(),o.globalAlpha=.35;for(let t=0;t<e;t+=1){const n=t/e,r=Math.sin(n*Math.PI*8+1.2*Math.sin(n*Math.PI*2)),a=Math.round(88+20*r+12*Math.random());o.fillStyle=`rgb(${a},${Math.round(.72*a)},${Math.round(.45*a)})`,o.fillRect(0,t,e,1)}o.restore(),o.save(),o.globalAlpha=.18,o.strokeStyle="#3f2f1f",o.lineWidth=1;for(let t=0;t<48;t++){const t=Math.random()*e,n=Math.random()*e,r=2+6*Math.random(),a=1+3*Math.random();o.beginPath(),o.ellipse(t,n,r,a,Math.random()*Math.PI,0,2*Math.PI),o.stroke()}return o.restore(),v(o,e,Math.floor(e*e/4),.06),t}function k(e){const t=y(e),o=t.getContext("2d");return o?(o.fillStyle="#9ca3af",o.fillRect(0,0,e,e),v(o,e,Math.floor(e*e/2),.08),v(o,e,Math.floor(e*e/3),.06),t):t}function S(e){const t=y(e),o=t.getContext("2d");if(!o)return t;o.fillStyle="#166534",o.fillRect(0,0,e,e),v(o,e,Math.floor(e*e/2),.1),o.save(),o.globalAlpha=.2,o.strokeStyle="#052e16",o.lineWidth=1;for(let t=0;t<360;t++){const t=Math.random()*e,n=Math.random()*e,r=4+10*Math.random(),a=-Math.PI/2+.8*(Math.random()-.5);o.beginPath(),o.moveTo(t,n),o.lineTo(t+Math.cos(a)*r,n+Math.sin(a)*r),o.stroke()}o.globalAlpha=.14,o.strokeStyle="#4ade80";for(let t=0;t<180;t++){const t=Math.random()*e,n=Math.random()*e,r=3+8*Math.random(),a=-Math.PI/2+.9*(Math.random()-.5);o.beginPath(),o.moveTo(t,n),o.lineTo(t+Math.cos(a)*r,n+Math.sin(a)*r),o.stroke()}return o.restore(),t}function z(e){const t=y(e),o=t.getContext("2d");if(!o)return t;o.fillStyle="#14532d",o.fillRect(0,0,e,e),v(o,e,Math.floor(e*e/2),.08),v(o,e,Math.floor(e*e/3),.06),o.save(),o.globalAlpha=.18,o.strokeStyle="#052e16",o.lineWidth=1;for(let t=0;t<900;t++){const t=Math.random()*e,n=Math.random()*e,r=4+12*Math.random(),a=-Math.PI/2+.9*(Math.random()-.5);o.beginPath(),o.moveTo(t,n),o.lineTo(t+Math.cos(a)*r,n+Math.sin(a)*r),o.stroke()}o.globalAlpha=.12,o.strokeStyle="#86efac";for(let t=0;t<520;t++){const t=Math.random()*e,n=Math.random()*e,r=3+10*Math.random(),a=-Math.PI/2+1*(Math.random()-.5);o.beginPath(),o.moveTo(t,n),o.lineTo(t+Math.cos(a)*r,n+Math.sin(a)*r),o.stroke()}return o.restore(),t}const N=new Map;function T(e,t,o,n){const r=N.get(t);if(r)return r;const a=o(n?.size??256),i=new e.CanvasTexture(a);return i.wrapS=e.RepeatWrapping,i.wrapT=e.RepeatWrapping,i.colorSpace=e.SRGBColorSpace,i.anisotropy=n?.anisotropy??4,N.set(t,i),i}function j(e,t){return"none"===e||"brick"===e||"concrete"===e?e:t}function P(e,t){return"none"===e||"grass"===e||"concrete"===e?e:t}function W(e,t){return"none"===e||"wood"===e||"concrete"===e||"glass"===e?e:t}function C(e,t){return"none"===t||"glass"===t?null:"wood"===t?T(e,"opening:wood",b,{size:256,anisotropy:4}):"concrete"===t?T(e,"opening:concrete",k,{size:256,anisotropy:4}):null}let D=null;function A(e){const t=Math.random(),o=Math.random(),n=Math.sqrt(t),r=1-n,a=o*n,i=1-r-a;return{x:e.ax*r+e.bx*a+e.cx*i,z:e.az*r+e.bz*a+e.cz*i}}function F(e){return{type:s,layerGroup:"areas",name:{key:"ext.structural.area.name",fallback:"Area"},description:{key:"ext.structural.area.desc",fallback:"Area (polygon) in 2D."},defaultProps:{fill:d,opacity:1,texture:"none",vertices:[{x:-1,z:-1},{x:1,z:-1},{x:1,z:1},{x:-1,z:1}]},create3D:({THREE:e,view:t},o)=>{const n=new e.Group,r=new e.MeshStandardMaterial({color:d,roughness:.95,metalness:0,side:e.DoubleSide,transparent:!1,opacity:1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1});r.stencilWrite=!0,r.stencilRef=1,r.stencilFunc=e.NotEqualStencilFunc,r.stencilFail=e.KeepStencilOp,r.stencilZFail=e.KeepStencilOp,r.stencilZPass=e.KeepStencilOp,r.stencilWriteMask=0,r.stencilFuncMask=255;let a=null,i="",s=null,l=null,c="";function u(t,o,r){if(s&&(n.remove(s),s.geometry.dispose(),s=null),!(o>0))return;const a=new e.PlaneGeometry(1,1,1,4);a.translate(0,.5,0);const i=a,c=new e.InstancedBufferAttribute(new Float32Array(o),1);i.setAttribute("instanceSeed",c);const u=function(){if(l)return l;const t=function(e){if(D)return D;const t=64,o=document.createElement("canvas");o.width=t,o.height=t;const n=o.getContext("2d");if(n){n.clearRect(0,0,t,t),n.fillStyle="black",n.fillRect(0,0,t,t);const e=n.createLinearGradient(0,t,0,0);e.addColorStop(0,"rgba(255,255,255,0)"),e.addColorStop(.18,"rgba(255,255,255,1)"),e.addColorStop(1,"rgba(255,255,255,1)"),n.fillStyle=e,n.beginPath(),n.moveTo(32,1.28),n.quadraticCurveTo(37.12,28.8,39.68,62.72),n.quadraticCurveTo(32,57.6,24.32,62.72),n.quadraticCurveTo(26.88,28.8,32,1.28),n.closePath(),n.fill(),n.globalCompositeOperation="destination-in";const o=n.createRadialGradient(32,51.2,0,32,51.2,35.2);o.addColorStop(0,"rgba(255,255,255,1)"),o.addColorStop(1,"rgba(255,255,255,0)"),n.fillStyle=o,n.fillRect(0,0,t,t)}const r=new e.CanvasTexture(o);return r.wrapS=e.ClampToEdgeWrapping,r.wrapT=e.ClampToEdgeWrapping,r.magFilter=e.LinearFilter,r.minFilter=e.LinearMipmapLinearFilter,r.colorSpace=e.NoColorSpace??e.LinearSRGBColorSpace,D=r,r}(e),o=new e.MeshStandardMaterial({color:1483594,roughness:.88,metalness:0,side:e.DoubleSide,alphaMap:t,alphaTest:.35});return o.stencilWrite=!0,o.stencilRef=1,o.stencilFunc=e.NotEqualStencilFunc,o.stencilFail=e.KeepStencilOp,o.stencilZFail=e.KeepStencilOp,o.stencilZPass=e.KeepStencilOp,o.stencilWriteMask=0,o.stencilFuncMask=255,o.onBeforeCompile=e=>{e.uniforms.uTime={value:0},e.vertexShader=e.vertexShader.replace("#include <common>","#include <common>\nuniform float uTime;\nattribute float instanceSeed;").replace("#include <begin_vertex>","#include <begin_vertex>\nfloat h01 = clamp(position.y, 0.0, 1.0);\nfloat wind = sin(uTime * 1.2 + instanceSeed + position.x * 2.4) * 0.12;\nfloat wind2 = cos(uTime * 0.9 + instanceSeed * 1.7) * 0.08;\ntransformed.x += (wind + wind2) * h01 * h01;\ntransformed.z += sin(uTime * 1.1 + instanceSeed * 0.7) * 0.06 * h01 * h01;"),o.userData.shader=e},l=o,o}();u.color.set(r);const d=new e.InstancedMesh(i,u,o);d.frustumCulled=!1,d.renderOrder=5;const p=function(e){const t=e.getAttribute("position"),o=e.getIndex(),n=[],r=[];let a=0;function i(e,o,i){const s=t.getX(e),l=t.getZ(e),c=t.getX(o),u=t.getZ(o),d=t.getX(i),p=t.getZ(i),m=.5*Math.abs((c-s)*(p-l)-(d-s)*(u-l));m>1e-9&&(a+=m,n.push({ax:s,az:l,bx:c,bz:u,cx:d,cz:p,area:m}),r.push(a))}if(o)for(let e=0;e<o.count;e+=3)i(o.getX(e),o.getX(e+1),o.getX(e+2));else for(let e=0;e<t.count;e+=3)i(e,e+1,e+2);return{triangles:n,cdf:r,totalArea:a}}(t);if(!(p.totalArea>1e-9)||0===p.triangles.length)return void i.dispose();const m=new e.Matrix4,h=new e.Quaternion,x=new e.Vector3,f=new e.Vector3,g=new e.Vector3(0,1,0);for(let e=0;e<o;e+=1){const t=Math.random()*p.totalArea;let o=0,n=p.cdf.length-1;for(;o<n;){const e=o+n>>1;t<=p.cdf[e]?n=e:o=e+1}const r=A(p.triangles[o]),a=Math.random()*Math.PI*2;h.setFromAxisAngle(g,a);const i=.1+.2*Math.random(),s=i*(.12+.1*Math.random());f.set(s,i,1),x.set(r.x,.012,r.z),m.compose(x,h,f),d.setMatrixAt(e,m),c.setX(e,1e3*Math.random())}d.instanceMatrix.needsUpdate=!0,c.needsUpdate=!0,s=d,n.add(d)}function p(o){const p=w(o.props.vertices),x=JSON.stringify(p.map(e=>({x:Math.round(1e3*(e.x-o.position.x))/1e3,z:Math.round(1e3*(e.z-o.position.z))/1e3})));if(x!==i){i=x;const t=function(t){const o=w(t.props.vertices);if(o.length<3)return null;const n=o.map(e=>({x:e.x-t.position.x,z:e.z-t.position.z})),r=new e.Shape;r.moveTo(n[0].x,-n[0].z);for(let e=1;e<n.length;e++)r.lineTo(n[e].x,-n[e].z);r.closePath();const a=new e.ShapeGeometry(r);a.rotateX(-Math.PI/2);const i=a.getAttribute("position"),s=new e.BufferAttribute(new Float32Array(2*i.count),2);for(let e=0;e<i.count;e++){const o=i.getX(e)+t.position.x,n=i.getZ(e)+t.position.z;s.setXY(e,o,n)}return a.setAttribute("uv",s),a}(o);t?a?(a.geometry.dispose(),a.geometry=t):(a=new e.Mesh(t,r),a.receiveShadow=!0,n.add(a)):a&&(n.remove(a),a.geometry.dispose(),a=null)}const f=h(o.props.fill,d),g=Math.max(0,Math.min(1,m(o.props.opacity,1)))<.001,y=g?0:1,_=P(o.props.texture,"none"),v=t.graphicsQuality??"simplified",M=function(e,t,o="simplified"){return"none"===t?null:"grass"===t?"detailed"===o?T(e,"floor:grass:detailed",z,{size:512,anisotropy:8}):T(e,"floor:grass:simplified",S,{size:256,anisotropy:4}):"concrete"===t?T(e,"floor:concrete",k,{size:256,anisotropy:4}):null}(e,_,v);if(r.color.set(f),r.map!==M&&(r.map=M,r.needsUpdate=!0),r.roughness="grass"===_?.98:.95,r.metalness=0,r.opacity=y,r.transparent=g,r.depthWrite=!g,a&&(a.visible=!g,a.position.y=.01),g||"grass"!==_||"detailed"!==v||!Boolean(a&&a.geometry))return void(s&&(s.visible=!1));s&&(s.visible=!0);const b=function(e){if(e.length<3)return 0;let t=0;for(let o=0;o<e.length;o+=1){const n=e[o],r=e[(o+1)%e.length];t+=n.x*r.z-r.x*n.z}return Math.abs(t)/2}(p),N=Math.max(240,Math.min(1800,Math.floor(35*b))),j=`${x}:${N}`;j!==c&&a?(c=j,u(a.geometry,N,f)):l&&l.color.set(f)}return p(o),{object:n,update:p,tick:()=>{if(!l)return;const e=l.userData.shader;e&&(e.uniforms.uTime.value=performance.now()/1e3)},dispose:()=>{a&&a.geometry.dispose(),r.dispose(),s&&s.geometry.dispose(),l?.dispose()}}},render2D:({ctx:e,element:t,viewport:o})=>{const n=w(t.props.vertices);if(n.length<3)return;const r=h(t.props.fill,d),i=m(t.props.opacity,1)<.001?0:1,s=n.map(e=>o.worldToScreen(e));e.save(),e.beginPath(),e.moveTo(s[0].x,s[0].y);for(let t=1;t<s.length;t++)e.lineTo(s[t].x,s[t].y);e.closePath(),e.fillStyle=a(r,i),e.fill(),e.strokeStyle=a("#e6e8f2",.22),e.lineWidth=2,e.stroke(),e.restore()},renderEditorModal:({element:t,update:o,remove:r,close:a})=>(0,n.jsx)(E,{element:t,update:o,remove:r,close:a,i18n:e})}}function E({element:e,update:t,remove:o,close:r,i18n:a}){const{t:i}=a.useI18n(),s=h(e.props.fill,d),l=m(e.props.opacity,1)<.001,c=P(e.props.texture,"none");return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"field",children:[(0,n.jsx)("div",{className:"label",children:i("ext.structural.editor.area_name")}),(0,n.jsx)("input",{className:"input",value:e.name,onChange:e=>t({name:e.target.value})})]}),(0,n.jsxs)("div",{className:"rowWrap",children:[(0,n.jsxs)("div",{className:"field",style:{flex:1,minWidth:160},children:[(0,n.jsx)("div",{className:"label",children:i("ext.structural.editor.area_color")}),(0,n.jsx)("input",{className:"input",type:"color",value:s,onChange:e=>{const o=e.target.value;f(o),t({props:{fill:o}})}})]}),(0,n.jsxs)("div",{className:"field",style:{flex:1,minWidth:160},children:[(0,n.jsx)("div",{className:"label",children:i("ext.structural.editor.floor_texture")}),(0,n.jsxs)("select",{className:"input",value:c,onChange:e=>{const o=P(e.target.value,c),n="grass"===o?"#16a34a":"concrete"===o?d:s;f(n),t({props:{texture:o,fill:n}})},children:[(0,n.jsx)("option",{value:"none",children:i("ext.structural.editor.texture.none")}),(0,n.jsx)("option",{value:"grass",children:i("ext.structural.editor.texture.grass")}),(0,n.jsx)("option",{value:"concrete",children:i("ext.structural.editor.texture.concrete")})]})]}),(0,n.jsxs)("label",{className:"chipButton",style:{display:"inline-flex",alignItems:"center",gap:10},children:[(0,n.jsx)("input",{type:"checkbox",checked:l,onChange:e=>t({props:{opacity:e.target.checked?0:1}})}),(0,n.jsx)("span",{children:i("ext.structural.editor.transparent")})]})]}),(0,n.jsx)("div",{className:"sectionDivider"}),(0,n.jsxs)("div",{className:"rowWrap",children:[(0,n.jsx)("button",{className:"dangerButton",type:"button",onClick:o,children:i("core.actions.delete")}),(0,n.jsx)("button",{className:"chipButton",type:"button",onClick:r,children:i("core.actions.close")})]})]})}let B=null,I=null;function R(e,t,o){return Math.max(t,Math.min(o,e))}function G(e){return{depth_m:R(m(e.depth_m,1.4),.1,20),vertices:w(e.vertices)}}function O(e){return{type:l,layerGroup:"areas",name:{key:"ext.structural.pool.name",fallback:"Pool"},description:{key:"ext.structural.pool.desc",fallback:"Swimming pool (hole) in 2D."},defaultProps:{depth_m:1.4,vertices:[{x:-1,z:-1},{x:1,z:-1},{x:1,z:1},{x:-1,z:1}]},create3D:({THREE:e,view:t},o)=>{const n=new e.Group,r=new e.BufferGeometry,a=new e.MeshBasicMaterial({color:0});a.colorWrite=!1,a.depthWrite=!1,a.depthTest=!1,a.stencilWrite=!0,a.stencilRef=1,a.stencilFunc=e.AlwaysStencilFunc,a.stencilZPass=e.ReplaceStencilOp;const i=function(e){if(B)return B;const t=function(e){const t=document.createElement("canvas");t.width=e,t.height=e;const o=t.getContext("2d");if(!o)return t;o.fillStyle="rgb(128,128,128)",o.fillRect(0,0,e,e),o.save(),o.globalAlpha=.14,o.fillStyle="rgb(150,150,150)";for(let t=0;t<220;t++){const t=Math.random()*e,n=Math.random()*e,r=6+26*Math.random();o.beginPath(),o.arc(t,n,r,0,2*Math.PI),o.fill()}o.globalAlpha=.1,o.fillStyle="rgb(100,100,100)";for(let t=0;t<160;t++){const t=Math.random()*e,n=Math.random()*e,r=4+20*Math.random();o.beginPath(),o.arc(t,n,r,0,2*Math.PI),o.fill()}return o.restore(),t}(256),o=new e.CanvasTexture(t);return o.wrapS=e.RepeatWrapping,o.wrapT=e.RepeatWrapping,o.repeat.set(2,2),o.anisotropy=4,o.colorSpace=e.NoColorSpace??e.LinearSRGBColorSpace,B=o,o}(e),s=function(e){if(I)return I;const t=function(e){const t=document.createElement("canvas");t.width=e,t.height=e;const o=t.getContext("2d");if(!o)return t;const n=o.createImageData(e,e),r=n.data,a=2*Math.PI,i=[{dirX:.92,dirY:.39,freq:3,amp:.7,phase:Math.random()*a},{dirX:-.16,dirY:.99,freq:5,amp:.5,phase:Math.random()*a},{dirX:.68,dirY:-.73,freq:8,amp:.35,phase:Math.random()*a},{dirX:-.91,dirY:-.41,freq:12,amp:.22,phase:Math.random()*a}];for(let t=0;t<e;t+=1){const o=t/e;for(let n=0;n<e;n+=1){const s=n/e;let l=0,c=0;for(const e of i){const t=a*(e.dirX*s+e.dirY*o)*e.freq+e.phase,n=Math.cos(t),r=e.amp*e.freq*a;l+=n*r*e.dirX,c+=n*r*e.dirY}let u=.085*-l,d=1,p=.085*-c;const m=1/Math.sqrt(u*u+d*d+p*p);u*=m,d*=m,p*=m;const h=4*(t*e+n);r[h+0]=Math.round(255*(.5*u+.5)),r[h+1]=Math.round(255*(.5*d+.5)),r[h+2]=Math.round(255*(.5*p+.5)),r[h+3]=255}}return o.putImageData(n,0,0),t}(256),o=new e.CanvasTexture(t);return o.wrapS=e.RepeatWrapping,o.wrapT=e.RepeatWrapping,o.repeat.set(2,2),o.anisotropy=8,o.colorSpace=e.NoColorSpace??e.LinearSRGBColorSpace,I=o,o}(e),l=new e.MeshStandardMaterial({color:959977,roughness:.18,metalness:.02,transparent:!0,opacity:.68,side:e.DoubleSide,depthWrite:!1,emissive:new e.Color(402490),emissiveIntensity:.1});l.bumpMap=i,l.bumpScale=0;const c=new e.MeshPhysicalMaterial({color:959977,roughness:.12,metalness:0,transmission:.92,thickness:.18,ior:1.33,transparent:!0,opacity:1,side:e.DoubleSide,depthWrite:!1,clearcoat:.62,clearcoatRoughness:.08});c.normalMap=s,c.normalScale=new e.Vector2(.55,.55),c.attenuationColor=new e.Color(402490),c.attenuationDistance=.8;const u=new e.MeshStandardMaterial({color:988970,roughness:.95,metalness:.02,side:e.DoubleSide}),d=new e.MeshStandardMaterial({color:728888,roughness:.98,metalness:0,side:e.DoubleSide}),p=new e.Mesh(r,a);p.renderOrder=-20;const m=new e.Mesh(r,l);m.renderOrder=10;const h=new e.Mesh(r,u),x=new e.Mesh(r,d);n.add(p),n.add(h),n.add(x),n.add(m);let f=null,g=null,w="";function y(o){const n=G(o.props),a="detailed"===(t.graphicsQuality??"simplified"),i=JSON.stringify({v:n.vertices.map(e=>({x:Math.round(1e3*(e.x-o.position.x))/1e3,z:Math.round(1e3*(e.z-o.position.z))/1e3})),d:Math.round(1e3*n.depth_m)/1e3});if(i!==w){w=i;const t=function(e,t,o){if(o.length<3)return null;const n=o.map(e=>({x:e.x-t.position.x,z:e.z-t.position.z})),r=new e.Shape;r.moveTo(n[0].x,-n[0].z);for(let e=1;e<n.length;e++)r.lineTo(n[e].x,-n[e].z);r.closePath();const a=new e.ShapeGeometry(r);return a.rotateX(-Math.PI/2),a}(e,o,n.vertices),a=function(e,t,o,n){if(o.length<2)return null;const r=o.map(e=>({x:e.x-t.position.x,z:e.z-t.position.z})),a=-Math.abs(n),i=r.length,s=new Float32Array(4*i*3),l=[];for(let e=0;e<i;e++){const t=r[e],o=r[(e+1)%i],n=4*e;s[3*(n+0)+0]=t.x,s[3*(n+0)+1]=0,s[3*(n+0)+2]=t.z,s[3*(n+1)+0]=o.x,s[3*(n+1)+1]=0,s[3*(n+1)+2]=o.z,s[3*(n+2)+0]=o.x,s[3*(n+2)+1]=a,s[3*(n+2)+2]=o.z,s[3*(n+3)+0]=t.x,s[3*(n+3)+1]=a,s[3*(n+3)+2]=t.z,l.push(n+0,n+1,n+2,n+0,n+2,n+3)}const c=new e.BufferGeometry;return c.setAttribute("position",new e.BufferAttribute(s,3)),c.setIndex(l),c.computeVertexNormals(),c}(e,o,n.vertices,n.depth_m);f&&f.dispose(),g&&g.dispose(),f=t,g=a,p.geometry=f??r,m.geometry=f??r,x.geometry=f??r,h.geometry=g??r}const s=Boolean(f&&g);if(p.visible=s,m.visible=s,x.visible=s,h.visible=s,!s)return;p.position.y=.01,h.position.y=0,x.position.y=0-n.depth_m;const u=Math.min(.06,Math.max(.02,.3*n.depth_m));m.position.y=0-u,m.material=a?c:l,a?(c.roughness=.1,c.transmission=.92,c.clearcoat=.65,c.clearcoatRoughness=.08,c.attenuationDistance=.8+.35*R(n.depth_m,.2,2.5)):(l.roughness=.22,l.opacity=.66,l.emissiveIntensity=.06,l.bumpScale=0)}return y(o),{object:n,update:y,tick:e=>{if("detailed"!==(t.graphicsQuality??"simplified"))return;const o=performance.now(),n=s.userData??={};o-("number"==typeof n.lastOffsetUpdateMs?n.lastOffsetUpdateMs:0)<4||(n.lastOffsetUpdateMs=o,s.offset.x=(s.offset.x+.022*e)%1,s.offset.y=(s.offset.y+.022*e*.7)%1)},dispose:()=>{f&&f.dispose(),g&&g.dispose(),r.dispose(),a.dispose(),u.dispose(),d.dispose(),l.dispose(),c.dispose()}}},render2D:({ctx:e,element:t,viewport:o})=>{const n=G(t.props);if(n.vertices.length<3)return;const r=n.vertices.map(e=>o.worldToScreen(e));e.save(),e.beginPath(),e.moveTo(r[0].x,r[0].y);for(let t=1;t<r.length;t++)e.lineTo(r[t].x,r[t].y);e.closePath(),e.fillStyle=a("#0ea5e9",.14),e.fill(),e.strokeStyle=a("#38bdf8",.65),e.lineWidth=2,e.stroke(),e.restore()},renderEditorModal:({element:t,update:o,remove:r,close:a})=>(0,n.jsx)(q,{element:t,update:o,remove:r,close:a,i18n:e})}}function q({element:e,update:t,remove:o,close:a,i18n:i}){const{t:s,locale:l}=i.useI18n(),c=G(e.props),u=(0,r.useMemo)(()=>new Intl.NumberFormat(l,{minimumFractionDigits:2,maximumFractionDigits:2}),[l]);return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"card",children:[(0,n.jsxs)("div",{className:"cardHeaderRow",children:[(0,n.jsx)("div",{className:"cardTitle",children:s("ext.structural.pool.name")}),(0,n.jsxs)("div",{className:"cardMeta",children:[u.format(c.depth_m)," m"]})]}),(0,n.jsx)("div",{className:"cardBody",children:s("ext.structural.pool.desc")})]}),(0,n.jsx)("div",{className:"sectionDivider"}),(0,n.jsxs)("div",{className:"field",children:[(0,n.jsx)("div",{className:"label",children:s("ext.structural.editor.pool_name")}),(0,n.jsx)("input",{className:"input",value:e.name,onChange:e=>t({name:e.target.value})})]}),(0,n.jsx)("div",{className:"rowWrap",children:(0,n.jsxs)("div",{className:"field",style:{flex:1,minWidth:160},children:[(0,n.jsx)("div",{className:"label",children:s("ext.structural.editor.pool_depth")}),(0,n.jsx)("input",{className:"input",type:"number",inputMode:"decimal",min:.1,max:20,step:.1,value:c.depth_m,onChange:e=>{const o=Number.parseFloat(e.target.value);Number.isFinite(o)&&t({props:{depth_m:R(o,.1,20)}})}})]})}),(0,n.jsx)("div",{className:"sectionDivider"}),(0,n.jsxs)("div",{className:"rowWrap",children:[(0,n.jsx)("button",{className:"dangerButton",type:"button",onClick:o,children:s("core.actions.delete")}),(0,n.jsx)("button",{className:"chipButton",type:"button",onClick:a,children:s("core.actions.close")})]})]})}function $(e,t){const o=e.x-t.x,n=e.z-t.z;return Math.hypot(o,n)}function K(e,t){return{x:e.x+t.x,z:e.z+t.z}}function X(e,t){return{x:e.x-t.x,z:e.z-t.z}}function L(e,t){return{x:e.x*t,z:e.z*t}}function U(e){const t=Math.hypot(e.x,e.z);return t<=1e-9?{x:1,z:0}:{x:e.x/t,z:e.z/t}}function Y(e){if(0===e.length)return{x:0,z:0};const t=e.reduce((e,t)=>({x:e.x+t.x,z:e.z+t.z}),{x:0,z:0});return{x:t.x/e.length,z:t.z/e.length}}const Z=.25,H=/^#[0-9a-fA-F]{6}$/;function V(e,t,o){return Math.max(t,Math.min(o,e))}function J(e,t){return"number"==typeof e&&Number.isFinite(e)?e:t}function Q(e){return"number"==typeof e&&Number.isFinite(e)?e:void 0}function ee(e){if("string"!=typeof e)return;const t=e.trim();return t.length>0?t:void 0}function te(e){return"door"===e?.9:"window"===e?1.2:1}function oe(e){return"door"===e?"#8f806a":"window"===e?"#b9d8f4":void 0}function ne(e){return"door"===e?"wood":"window"===e?"glass":"none"}function re(){const e=crypto;return e.randomUUID?.()??`opening-${Date.now()}-${Math.random().toString(16).slice(2)}`}function ae(e){if(!e||"object"!=typeof e||Array.isArray(e))return null;const t=e,o=function(e){return"opening"===e||"door"===e||"window"===e}(t.kind)?t.kind:"opening",n=Math.max(Z,J(t.width_m,te(o))),r=ee(t.color),a=ee(t.texture);return{id:ee(t.id)??re(),kind:o,center_m:J(t.center_m,0),width_m:n,y_min_m:Q(t.y_min_m),y_max_m:Q(t.y_max_m),color:r&&H.test(r)?r:void 0,texture:a}}function ie(e){if(!Array.isArray(e))return[];const t=[],o=new Set;for(const n of e){const e=ae(n);if(e){for(;o.has(e.id);)e.id=re();o.add(e.id),t.push(e)}}return t}function se(e,t){const o=Math.max(.15,t);if("opening"===e)return{yMin:0,yMax:o};if("door"===e)return{yMin:0,yMax:Math.min(o,2.1)};const n=Math.min(.9,Math.max(0,o-.3));return{yMin:n,yMax:Math.min(o,Math.max(n+.25,2))}}function le(e){const t=Math.max(Z,e.width_m);return{id:re(),kind:e.kind,center_m:e.center_m,width_m:t,color:oe(e.kind),texture:ne(e.kind)}}function ce(e,t,o){const n=Math.max(.001,t),r=Math.max(.15,o),a=[];for(const t of e){const e=Math.min(Z,n),o=V(Number.isFinite(t.width_m)?t.width_m:te(t.kind),e,n),i=V(Number.isFinite(t.center_m)?t.center_m:n/2,o/2,n-o/2),s=i-o/2,l=i+o/2;if(l-s<e-1e-6)continue;const c=se(t.kind,r);let u,d;if("opening"===t.kind?(u=0,d=r):(u=Number.isFinite(t.y_min_m??NaN)?t.y_min_m:c.yMin,d=Number.isFinite(t.y_max_m??NaN)?t.y_max_m:c.yMax),u=V(u,0,r),d=V(d,0,r),d<u){const e=d;d=u,u=e}d-u<.08||a.push({id:t.id,kind:t.kind,center_m:i,width_m:o,start_m:s,end_m:l,y_min_m:u,y_max_m:d,color:t.color,texture:t.texture})}return a.sort((e,t)=>e.start_m-t.start_m||e.id.localeCompare(t.id)),a}function ue(e){return e.map(e=>{const t={id:e.id,kind:e.kind,center_m:e.center_m,width_m:e.width_m};return"number"==typeof e.y_min_m&&Number.isFinite(e.y_min_m)&&(t.y_min_m=e.y_min_m),"number"==typeof e.y_max_m&&Number.isFinite(e.y_max_m)&&(t.y_max_m=e.y_max_m),e.color&&(t.color=e.color),e.texture&&(t.texture=e.texture),t})}function de(e,t,o){return Math.max(t,Math.min(o,e))}function pe(e){return Math.round(1e3*e)/1e3}function me(e,t){const o=function(e,t,o){const n=e.map(e=>({start:de(Math.min(e.start,e.end),0,o),end:de(Math.max(e.start,e.end),0,o)})).filter(e=>e.end-e.start>1e-6).sort((e,t)=>e.start-t.start),r=[];for(const e of n){const t=r[r.length-1];!t||e.start>t.end+1e-6?r.push(e):t.end=Math.max(t.end,e.end)}return r}(t,0,e),n=[];let r=0;for(const e of o)e.start>r+1e-6&&n.push({start:r,end:e.start}),r=Math.max(r,e.end);return r<e-1e-6&&n.push({start:r,end:e}),n}function he(e,t,o){return K(e,L(t,o))}function xe(e,t){if(Array.isArray(e))for(const o of e)t.has(o)||(t.add(o),o.dispose());else t.has(e)||(t.add(e),e.dispose())}function fe(e,t){const o=e.getAttribute("position"),n=e.getAttribute("normal"),r=e.getAttribute("uv");if(!o||!n||!r)return;const a=t.thicknessWorld/2;for(let e=0;e<r.count;e+=1){const i=n.getX(e),s=(n.getY(e),n.getZ(e)),l=o.getX(e),c=o.getY(e),u=o.getZ(e);let d=0,p=0;Math.abs(s)>=.5?(d=l+t.originX,p=c+t.originY):Math.abs(i)>=.5?(d=u+t.originZ+a,p=c+t.originY):(d=l+t.originX,p=u+t.originZ+a),r.setXY(e,d,p)}r.needsUpdate=!0}function ge(e,t){const o=new Set;for(const n of[...e.children]){const r=n;r.geometry&&"dispose"in r.geometry&&r.geometry.dispose(),t&&r.material&&xe(r.material,o),e.remove(n)}}function we(e){return"door"===e?{fill:"rgba(251,146,60,0.20)",stroke:"rgba(251,146,60,0.92)",dash:[7,4]}:"window"===e?{fill:"rgba(56,189,248,0.18)",stroke:"rgba(56,189,248,0.92)",dash:[5,4]}:{fill:"rgba(251,191,36,0.12)",stroke:"rgba(251,191,36,0.92)",dash:[9,5]}}function ye(e,t,o,n){const r=o.y_max_m-o.y_min_m;if(o.width_m<=.12||r<=.12)return;const a=de(.11*Math.min(o.width_m,r),.03,.09),i=.48*n,s=.34*n,l=C(e,W(o.texture,ne("door"))),c=new e.MeshStandardMaterial({color:"#5b5044",roughness:.82,metalness:.05,map:l}),u=new e.MeshStandardMaterial({color:o.color??oe("door")??"#8f806a",roughness:.74,metalness:.08,map:l}),d=new e.BoxGeometry(a,r,i),p=new e.BoxGeometry(a,r,i),m=new e.BoxGeometry(o.width_m,a,i),h=new e.Mesh(d,c),x=new e.Mesh(p,c),f=new e.Mesh(m,c);for(const e of[h,x,f])e.userData.__toposyncAllowPickWhenGhostWalls=!0;const g=0+o.y_min_m+r/2;h.position.set(o.start_m+a/2,g,0),x.position.set(o.end_m-a/2,g,0),f.position.set(o.center_m,0+o.y_max_m-a/2,0);const w=de(.02*a,.001,.004),y=o.width_m-2*a-2*w,_=r-a-w;if(y>.08&&_>.2){const n=new e.BoxGeometry(y,_,s),r=new e.Mesh(n,u);r.userData.__toposyncAllowPickWhenGhostWalls=!0,r.position.set(o.center_m,0+o.y_min_m+_/2,0),r.castShadow=!0,r.receiveShadow=!0,t.add(r)}else u.dispose();for(const e of[h,x,f])e.castShadow=!0,e.receiveShadow=!0,t.add(e)}function _e(e,t,o,n){const r=o.y_max_m-o.y_min_m;if(o.width_m<=.12||r<=.12)return;const a=de(.09*Math.min(o.width_m,r),.025,.07),i=.35*n,s=.14*n,l=W(o.texture,ne("window")),c=C(e,l),u=new e.MeshStandardMaterial({color:o.color??oe("window")??"#b9d8f4",roughness:.55,metalness:.18,map:c}),d=new e.BoxGeometry(o.width_m,a,i),p=new e.BoxGeometry(o.width_m,a,i),m=new e.BoxGeometry(a,r,i),h=new e.BoxGeometry(a,r,i),x=new e.Mesh(d,u),f=new e.Mesh(p,u),g=new e.Mesh(m,u),w=new e.Mesh(h,u);for(const e of[x,f,g,w])e.userData.__toposyncAllowPickWhenGhostWalls=!0;const y=0+o.y_min_m+r/2;x.position.set(o.center_m,0+o.y_max_m-a/2,0),f.position.set(o.center_m,0+o.y_min_m+a/2,0),g.position.set(o.start_m+a/2,y,0),w.position.set(o.end_m-a/2,y,0);for(const e of[x,f,g,w])e.castShadow=!0,e.receiveShadow=!0,t.add(e);const _=o.width_m-2.2*a,v=r-2.2*a;if(_<=.08||v<=.08)return;const M=new e.BoxGeometry(_,v,s);let b;b="glass"===l?new e.MeshPhysicalMaterial({color:o.color??oe("window")??"#b9d8f4",roughness:.1,metalness:0,transmission:.88,thickness:.05,transparent:!0,opacity:.55}):new e.MeshStandardMaterial({color:o.color??oe("window")??"#b9d8f4",roughness:.42,metalness:.12,map:c});const k=new e.Mesh(M,b);k.userData.__toposyncAllowPickWhenGhostWalls=!0,k.position.set(o.center_m,y,0),k.castShadow=!1,k.receiveShadow=!0,t.add(k)}function ve({element:e,update:t,remove:o,close:a,i18n:i}){const{t:s,locale:l}=i.useI18n(),u=h(e.props.color,c),d=j(e.props.texture,"none"),p=(0,r.useMemo)(()=>ie(e.props.openings),[e.props.openings]),m=(0,r.useMemo)(()=>new Intl.NumberFormat(l,{minimumFractionDigits:2,maximumFractionDigits:2}),[l]),x=(0,r.useMemo)(()=>$(g(e.props.a,{x:e.position.x,z:e.position.z}),g(e.props.b,{x:e.position.x+1,z:e.position.z})),[e]),f=(0,r.useMemo)(()=>[...p].sort((e,t)=>e.center_m-t.center_m||e.id.localeCompare(t.id)),[p]),w=(0,r.useMemo)(()=>{const e=ce(p,x,3.2),t=new Map;for(const o of e)t.set(o.id,o);return t},[p,x]);function y(e){t({props:{openings:ue(e)}})}function _(e,t){y(p.map(o=>o.id===e?{...o,...t}:o))}function v(e){const t="door"===e?.9:"window"===e?1.2:1,o=Math.max(0,x),n=de(t,Math.min(Z,o),o),r=le({kind:e,center_m:x/2,width_m:n});y([...p,r])}return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"card",children:[(0,n.jsxs)("div",{className:"cardHeaderRow",children:[(0,n.jsx)("div",{className:"cardTitle",children:s("ext.structural.wall.name")}),(0,n.jsxs)("div",{className:"cardMeta",children:[m.format(x)," m"]})]}),(0,n.jsxs)("div",{className:"cardBody",children:[s("ext.structural.editor.preview")," • ",f.length," ",s("ext.structural.editor.openings")]})]}),(0,n.jsx)("div",{className:"sectionDivider"}),(0,n.jsxs)("div",{className:"rowWrap",children:[(0,n.jsxs)("div",{className:"field",style:{flex:1,minWidth:160},children:[(0,n.jsx)("div",{className:"label",children:s("ext.structural.editor.wall_color")}),(0,n.jsx)("input",{className:"input",type:"color",value:u,onChange:e=>t({props:{color:e.target.value}})})]}),(0,n.jsxs)("div",{className:"field",style:{flex:1,minWidth:160},children:[(0,n.jsx)("div",{className:"label",children:s("ext.structural.editor.wall_texture")}),(0,n.jsxs)("select",{className:"input",value:d,onChange:e=>t({props:{texture:j(e.target.value,d)}}),children:[(0,n.jsx)("option",{value:"none",children:s("ext.structural.editor.texture.none")}),(0,n.jsx)("option",{value:"brick",children:s("ext.structural.editor.texture.brick")}),(0,n.jsx)("option",{value:"concrete",children:s("ext.structural.editor.texture.concrete")})]})]})]}),(0,n.jsx)("div",{className:"sectionDivider"}),(0,n.jsxs)("div",{className:"rowWrap",style:{alignItems:"center",justifyContent:"space-between"},children:[(0,n.jsx)("div",{className:"label",children:s("ext.structural.editor.openings")}),(0,n.jsxs)("div",{className:"rowWrap",style:{gap:8},children:[(0,n.jsxs)("button",{className:"chipButton",type:"button",onClick:()=>v("opening"),children:["+ ",s("ext.structural.tools.wall_opening")]}),(0,n.jsxs)("button",{className:"chipButton",type:"button",onClick:()=>v("door"),children:["+ ",s("ext.structural.tools.wall_door")]}),(0,n.jsxs)("button",{className:"chipButton",type:"button",onClick:()=>v("window"),children:["+ ",s("ext.structural.tools.wall_window")]})]})]}),0===f.length?(0,n.jsx)("div",{className:"cardBody",children:s("ext.structural.editor.openings_empty")}):null,f.map(e=>{const t=e.kind,o=W(e.texture,ne(t)),r=e.color??oe(t)??"#8f806a",a=w.get(e.id)??null,i="opening"===t?s("ext.structural.editor.opening_height_full"):a?s("ext.structural.editor.opening_height_range",{yMin:m.format(a.y_min_m),yMax:m.format(a.y_max_m)}):null,l=Math.max(0,x),c=Math.min(Z,l),u=de(e.width_m,c,Math.max(c,l)),d=u/2,h=Math.max(d,l-u/2),f=de(e.center_m,d,h);return(0,n.jsxs)("div",{className:"card",style:{marginTop:10},children:[(0,n.jsxs)("div",{className:"cardHeaderRow",children:[(0,n.jsx)("div",{className:"cardTitle",children:s(`ext.structural.editor.kind.${t}`)}),(0,n.jsxs)("div",{className:"cardMeta",children:[m.format(u)," m"]})]}),i?(0,n.jsx)("div",{className:"cardMeta",style:{marginTop:6},children:i}):null,(0,n.jsxs)("div",{className:"rowWrap",children:[(0,n.jsxs)("div",{className:"field",style:{flex:1,minWidth:120},children:[(0,n.jsx)("div",{className:"label",children:s("ext.structural.editor.opening_kind")}),(0,n.jsxs)("select",{className:"input",value:t,onChange:o=>{const n="opening"===(r=o.target.value)||"door"===r||"window"===r?r:t;var r;const a={kind:n};!e.color&&oe(n)&&(a.color=oe(n)),e.texture&&e.texture!==ne(t)||(a.texture=ne(n)),_(e.id,a)},children:[(0,n.jsx)("option",{value:"opening",children:s("ext.structural.editor.kind.opening")}),(0,n.jsx)("option",{value:"door",children:s("ext.structural.editor.kind.door")}),(0,n.jsx)("option",{value:"window",children:s("ext.structural.editor.kind.window")})]})]}),(0,n.jsxs)("div",{className:"field",style:{flex:1,minWidth:120},children:[(0,n.jsx)("div",{className:"label",children:s("ext.structural.editor.opening_center")}),(0,n.jsx)("input",{className:"input",type:"number",step:.05,value:f,onChange:t=>{const o=Number(t.target.value);Number.isFinite(o)&&_(e.id,{center_m:de(o,d,h)})}}),(0,n.jsx)("div",{className:"cardMeta",children:s("ext.structural.editor.opening_center_hint",{start:m.format(0),end:m.format(x)})})]}),(0,n.jsxs)("div",{className:"field",style:{flex:1,minWidth:120},children:[(0,n.jsx)("div",{className:"label",children:s("ext.structural.editor.opening_width")}),(0,n.jsx)("input",{className:"input",type:"number",step:.05,min:c,max:Math.max(c,l),value:u,onChange:t=>{const o=Number(t.target.value);if(!Number.isFinite(o))return;const n=de(o,c,Math.max(c,l)),r=n/2,a=Math.max(r,l-n/2);_(e.id,{width_m:n,center_m:de(e.center_m,r,a)})}})]})]}),"opening"!==t?(0,n.jsxs)("div",{className:"rowWrap",children:[(0,n.jsxs)("div",{className:"field",style:{flex:1,minWidth:120},children:[(0,n.jsx)("div",{className:"label",children:s("ext.structural.editor.opening_color")}),(0,n.jsx)("input",{className:"input",type:"color",value:r,onChange:t=>_(e.id,{color:t.target.value})})]}),(0,n.jsxs)("div",{className:"field",style:{flex:1,minWidth:120},children:[(0,n.jsx)("div",{className:"label",children:s("ext.structural.editor.opening_texture")}),(0,n.jsxs)("select",{className:"input",value:o,onChange:t=>_(e.id,{texture:W(t.target.value,o)}),children:[(0,n.jsx)("option",{value:"none",children:s("ext.structural.editor.texture.none")}),(0,n.jsx)("option",{value:"wood",children:s("ext.structural.editor.texture.wood")}),(0,n.jsx)("option",{value:"concrete",children:s("ext.structural.editor.texture.concrete")}),(0,n.jsx)("option",{value:"glass",children:s("ext.structural.editor.texture.glass")})]})]})]}):null,(0,n.jsx)("div",{className:"rowWrap",children:(0,n.jsx)("button",{className:"dangerButton",type:"button",onClick:()=>{return t=e.id,void y(p.filter(e=>e.id!==t));var t},children:s("core.actions.delete")})})]},e.id)}),(0,n.jsx)("div",{className:"sectionDivider"}),(0,n.jsxs)("div",{className:"rowWrap",children:[(0,n.jsx)("button",{className:"dangerButton",type:"button",onClick:o,children:s("core.actions.delete")}),(0,n.jsx)("button",{className:"chipButton",type:"button",onClick:a,children:s("core.actions.close")})]})]})}function Me(e,t,o){const n={x:(t.x+o.x)/2,z:(t.z+o.z)/2};return e.createElement(i,{name:"",position:{x:n.x,y:0,z:n.z},props:{a:t,b:o,color:c,width:u,openings:[]}})}function be(e,t){const o=Y(t),n=function(){try{const e=localStorage.getItem(p);if(e&&x(e))return e}catch{}return d}();return e.createElement(s,{name:"",position:{x:o.x,y:0,z:o.z},props:{vertices:t,fill:n,opacity:1}})}function ke(e,t){const o=Y(t);return e.createElement(l,{name:"",position:{x:o.x,y:0,z:o.z},props:{vertices:t,depth_m:1.4}})}function Se(e,t){const o=t.length;if(!(o<2))for(let n=0;n<o;n++)Me(e,t[n],t[(n+1)%o])}function ze(e,t,o){return Math.max(t,Math.min(o,e))}function Ne(e,t){return{x:e.x+t.x,z:e.z+t.z}}function Te(e,t){return{x:e.x*t,z:e.z*t}}function je(e,t,o,n){const r=function(e,t){return e.x*t.x+e.z*t.z}(function(e,t){return{x:e.x-t.x,z:e.z-t.z}}(e,t),o),a=Math.max(0,Math.min(n,r));return{point:Ne(t,Te(o,a)),scalar:a}}function Pe(e,t,o){const n=$(t,o);return $(e,n<=1e-6?t:je(e,t,{x:(o.x-t.x)/n,z:(o.z-t.z)/n},n).point)}function We(e,t){const o="door"===(n=t.kind)?{stroke:a("#fb923c",.92),fill:a("#fb923c",.22),dash:[8,6],labelKey:"ext.structural.tools.wall_door",fallback:"Door",descriptionKey:"ext.structural.tools.wall_door_desc",descriptionFallback:"Place a door cutout on a wall.",icon:"door-open"}:"window"===n?{stroke:a("#38bdf8",.92),fill:a("#38bdf8",.22),dash:[5,5],labelKey:"ext.structural.tools.wall_window",fallback:"Window",descriptionKey:"ext.structural.tools.wall_window_desc",descriptionFallback:"Place a window cutout on a wall.",icon:"window-maximize"}:{stroke:a("#fbbf24",.92),fill:a("#fbbf24",.22),dash:[9,4],labelKey:"ext.structural.tools.wall_opening",fallback:"Opening",descriptionKey:"ext.structural.tools.wall_opening_desc",descriptionFallback:"Hover a wall, click and drag to size. Click to place default width.",icon:"vectors"};var n;return{id:"door"===t.kind?"com.toposync.structural.tool.door":"window"===t.kind?"com.toposync.structural.tool.window":"com.toposync.structural.tool.opening",name:{key:o.labelKey,fallback:o.fallback},description:{key:o.descriptionKey,fallback:o.descriptionFallback},icon:o.icon,createSession:e=>{let n=null,r=null,a=null,s=null,l=null,c=!1;function d(){a=null,s=null,l=null,c=!1}function p(e,o,n,r){const a=Math.min(Math.max(Z,.2),e),i=Math.abs(n-o);let s=i,l=(o+n)/2;return r?(s=2*i,l=o):i<.04&&(s=Math.min(e,Math.max(a,function(e){return"door"===e?.9:"window"===e?1.2:1}(t.kind))),l=o),s=ze(s,a,e),l=ze(l,s/2,e-s/2),{start:l-s/2,end:l+s/2,center:l,width:s}}function h(t){if(a)return;const o=function(e){const t=[];for(const o of e.getElements()){if(o.type!==i)continue;const e=g(o.props.a,{x:o.position.x-.5,z:o.position.z}),n=g(o.props.b,{x:o.position.x+.5,z:o.position.z}),r=$(e,n);if(r<=1e-6)continue;const a={x:(n.x-e.x)/r,z:(n.z-e.z)/r},s={x:-a.z,z:a.x};t.push({id:o.id,a:e,b:n,dir:a,normal:s,length:r,width:Math.max(.04,m(o.props.width,u)),props:o.props})}return t}(e),s=function(e,t){let o=null,n=Number.POSITIVE_INFINITY;for(const r of e){const e=Pe(t,r.a,r.b);e>Math.max(.45,3.5*r.width)||e<n&&(n=e,o=r)}return o}(o,t);n=s,r=s?je(t,s.a,s.dir,s.length).scalar:null}function x(e,t,o){const n=t.worldToScreen(o.a),r=t.worldToScreen(o.b);e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(r.x,r.y),e.strokeStyle="rgba(255,255,255,0.55)",e.lineWidth=2.25,e.setLineDash([6,6]),e.stroke()}function f(e,t,n,r,a,i){const s=p(n.length,r,a,i),l=Ne(n.a,Te(n.dir,s.start)),c=Ne(n.a,Te(n.dir,s.end)),u=Math.max(.09,n.width/2),d=[Ne(l,Te(n.normal,u)),Ne(c,Te(n.normal,u)),Ne(c,Te(n.normal,-u)),Ne(l,Te(n.normal,-u))].map(e=>t.worldToScreen(e));e.beginPath(),e.moveTo(d[0].x,d[0].y);for(let t=1;t<d.length;t++)e.lineTo(d[t].x,d[t].y);e.closePath(),e.fillStyle=o.fill,e.fill(),e.strokeStyle=o.stroke,e.lineWidth=2,e.setLineDash(o.dash),e.stroke(),e.setLineDash([]);const m=t.worldToScreen(Ne(n.a,Te(n.dir,s.center))),h=`${s.width.toFixed(2)} m`;e.font="12px ui-sans-serif, system-ui";const x=e.measureText(h).width+16,f=m.x-x/2,g=m.y-Math.max(28,24+12/Math.max(1,t.scale));e.fillStyle="rgba(8,12,26,0.86)",e.fillRect(f,g,x,20),e.strokeStyle="rgba(255,255,255,0.18)",e.lineWidth=1,e.strokeRect(f+.5,g+.5,x-1,19),e.fillStyle="rgba(230,232,242,0.95)",e.textAlign="center",e.textBaseline="middle",e.fillText(h,m.x,g+10)}return{onPointerEvent:o=>{if("cancel"!==o.kind){if("move"===o.kind)return a?(c=o.shiftKey,void(l=je(o.world,a.a,a.dir,a.length).scalar)):void h(o.world);if("down"===o.kind){if(0!==o.button)return;return h(o.world),n&&null!=r?(a=n,s=r,l=r,void(c=o.shiftKey)):void d()}if("up"===o.kind){if(0!==o.button)return;if(!a||null==s)return;c=o.shiftKey,l=je(o.world,a.a,a.dir,a.length).scalar,function(){if(!a||null==s||null==l)return;const o=p(a.length,s,l,c),n=e.getElements().find(e=>e.id===a?.id),r=ie(n?.props.openings??a.props.openings),i=le({kind:t.kind,center_m:o.center,width_m:o.width});e.updateElement(a.id,{props:{openings:ue([...r,i])}}),e.openEditor(a.id)}(),d(),h(o.world)}}else d()},onKeyDown:e=>{"Escape"===e.key&&d()},renderOverlay2D:({ctx:e,viewport:t})=>{e.save(),a&&null!=s&&null!=l?(x(e,t,a),f(e,t,a,s,l,c)):n&&null!=r&&(x(e,t,n),f(e,t,n,r,r,!1)),e.restore()},getCursor:()=>n?"copy":"crosshair"}}}}function Ce(e,t){return{id:t.withWalls?"com.toposync.structural.tool.area_square_walls":"com.toposync.structural.tool.area_square",name:{key:t.withWalls?"ext.structural.tools.area_square_walls":"ext.structural.tools.area_square",fallback:t.withWalls?"Area + walls (rectangle)":"Area (rectangle)"},icon:t.withWalls?"draw-polygon":"square",createSession:e=>{let o=null,n=null;function r(){o=null,n=null}return{onPointerEvent:a=>{if("cancel"!==a.kind)if("move"!==a.kind){if("down"===a.kind&&0===a.button)return o?void function(n){if(!o)return;const a=function(e,t){const o=Math.min(e.x,t.x),n=Math.max(e.x,t.x),r=Math.min(e.z,t.z),a=Math.max(e.z,t.z);return[{x:o,z:r},{x:n,z:r},{x:n,z:a},{x:o,z:a}]}(o,n);if($(a[0],a[2])<.12)return void r();const i=be(e,a);t.withWalls&&Se(e,a),i&&e.openEditor(i),r()}(a.world):(o=a.world,void(n=a.world))}else o&&(n=a.world);else r()},onKeyDown:e=>{"Escape"===e.key&&r()},renderOverlay2D:({ctx:e,viewport:t})=>{if(!o||!n)return;const r=[o,{x:n.x,z:o.z},n,{x:o.x,z:n.z}].map(e=>t.worldToScreen(e));e.save(),e.beginPath(),e.moveTo(r[0].x,r[0].y);for(let t=1;t<r.length;t++)e.lineTo(r[t].x,r[t].y);e.closePath(),e.fillStyle=a("#fbbf24",.12),e.fill(),e.strokeStyle=a("#fbbf24",.8),e.lineWidth=2,e.setLineDash([6,6]),e.stroke(),e.restore()},getCursor:()=>"crosshair"}}}}function De(e){return{id:"com.toposync.structural.tool.pool_square",name:{key:"ext.structural.tools.pool_square",fallback:"Pool (rectangle)"},icon:"droplet",createSession:e=>{let t=null,o=null;function n(){t=null,o=null}return{onPointerEvent:r=>{if("cancel"!==r.kind)if("move"!==r.kind){if("down"===r.kind&&0===r.button)return t?void function(o){if(!t)return;const r=function(e,t){const o=Math.min(e.x,t.x),n=Math.max(e.x,t.x),r=Math.min(e.z,t.z),a=Math.max(e.z,t.z);return[{x:o,z:r},{x:n,z:r},{x:n,z:a},{x:o,z:a}]}(t,o);if($(r[0],r[2])<.12)return void n();const a=ke(e,r);a&&e.openEditor(a),n()}(r.world):(t=r.world,void(o=r.world))}else t&&(o=r.world);else n()},onKeyDown:e=>{"Escape"===e.key&&n()},renderOverlay2D:({ctx:e,viewport:n})=>{if(!t||!o)return;const r=[t,{x:o.x,z:t.z},o,{x:t.x,z:o.z}].map(e=>n.worldToScreen(e));e.save(),e.beginPath(),e.moveTo(r[0].x,r[0].y);for(let t=1;t<r.length;t++)e.lineTo(r[t].x,r[t].y);e.closePath(),e.fillStyle=a("#0ea5e9",.12),e.fill(),e.strokeStyle=a("#38bdf8",.8),e.lineWidth=2,e.setLineDash([6,6]),e.stroke(),e.restore()},getCursor:()=>"crosshair"}}}}function Ae(e,t){return{id:t.withWalls?"com.toposync.structural.tool.area_polygon_walls":"com.toposync.structural.tool.area_polygon",name:{key:t.withWalls?"ext.structural.tools.area_polygon_walls":"ext.structural.tools.area_polygon",fallback:t.withWalls?"Area + walls (polygon)":"Area (polygon)"},icon:"draw-polygon",createSession:e=>{const o=[];let n=null;function r(){o.splice(0,o.length),n=null}function i(){if(o.length<3)return void r();const n=be(e,[...o]);t.withWalls&&Se(e,o),n&&e.openEditor(n),r()}return{onPointerEvent:e=>{"cancel"!==e.kind?"move"!==e.kind?"dblclick"!==e.kind?"down"===e.kind&&0===e.button&&(function(e){if(o.length<3)return!1;const t=o[0];return $(e.world,t)<.22}(e)?i():(o.push(e.world),n=e.world)):i():n=e.world:r()},onKeyDown:e=>{"Escape"===e.key&&r(),"Enter"===e.key&&i(),("Backspace"===e.key||"Delete"===e.key)&&o.length>0&&o.pop()},renderOverlay2D:({ctx:e,viewport:t})=>{if(0===o.length)return;const r=o.map(e=>t.worldToScreen(e)),i=n?t.worldToScreen(n):null;if(e.save(),o.length>=2){e.beginPath(),e.moveTo(r[0].x,r[0].y);for(let t=1;t<r.length;t++)e.lineTo(r[t].x,r[t].y);i&&e.lineTo(i.x,i.y),e.strokeStyle=a("#fbbf24",.85),e.lineWidth=2,e.setLineDash([6,6]),e.stroke()}for(let t=0;t<r.length;t++){const n=r[t],i=0===t&&o.length>=3;e.beginPath(),e.arc(n.x,n.y,i?6:5,0,2*Math.PI),e.fillStyle=a(i?"#22c55e":"#fbbf24",.85),e.fill(),e.strokeStyle="rgba(0,0,0,0.35)",e.lineWidth=2,e.stroke()}e.restore()},getCursor:()=>"crosshair"}}}}const Fe={en:{"ext.structural.wall.name":"Wall","ext.structural.wall.desc":"Simple wall (line) in 2D.","ext.structural.area.name":"Area","ext.structural.area.desc":"Area (polygon) in 2D.","ext.structural.pool.name":"Pool","ext.structural.pool.desc":"Swimming pool (hole) in 2D.","ext.structural.tools.wall":"Wall","ext.structural.tools.wall_opening":"Opening","ext.structural.tools.wall_opening_desc":"Floor-to-ceiling wall cutout. Hover a wall, click and drag to size. Click to place default width. Hold Shift for symmetric sizing.","ext.structural.tools.wall_door":"Door","ext.structural.tools.wall_door_desc":"Place a door cutout on a wall.","ext.structural.tools.wall_window":"Window","ext.structural.tools.wall_window_desc":"Place a window cutout on a wall.","ext.structural.tools.area_square":"Area (rectangle)","ext.structural.tools.area_polygon":"Area (polygon)","ext.structural.tools.area_square_walls":"Area + walls (rectangle)","ext.structural.tools.area_polygon_walls":"Area + walls (polygon)","ext.structural.tools.pool_square":"Pool (rectangle)","ext.structural.tools.pool_polygon":"Pool (polygon)","ext.structural.editor.wall_color":"Wall color","ext.structural.editor.wall_texture":"Wall texture","ext.structural.editor.openings":"Openings","ext.structural.editor.openings_empty":"No openings yet. Use tools or add one here.","ext.structural.editor.opening_kind":"Type","ext.structural.editor.opening_center":"Position (m)","ext.structural.editor.opening_center_hint":"Along the wall: {{start}} m = start (1st point), {{end}} m = end (2nd point).","ext.structural.editor.opening_width":"Width (m)","ext.structural.editor.opening_height_full":"Height: floor to ceiling.","ext.structural.editor.opening_height_range":"Height: {{yMin}} - {{yMax}} m.","ext.structural.editor.opening_color":"Color","ext.structural.editor.opening_texture":"Texture","ext.structural.editor.kind.opening":"Opening","ext.structural.editor.kind.door":"Door","ext.structural.editor.kind.window":"Window","ext.structural.editor.area_name":"Area name (optional)","ext.structural.editor.area_color":"Area color","ext.structural.editor.floor_texture":"Floor texture","ext.structural.editor.transparent":"Transparent","ext.structural.editor.texture.none":"None","ext.structural.editor.texture.brick":"Brick","ext.structural.editor.texture.concrete":"Concrete","ext.structural.editor.texture.wood":"Wood","ext.structural.editor.texture.glass":"Glass","ext.structural.editor.texture.grass":"Grass","ext.structural.editor.pool_name":"Pool name (optional)","ext.structural.editor.pool_depth":"Depth (m)","ext.structural.editor.preview":"Preview"},"pt-BR":{"ext.structural.wall.name":"Parede","ext.structural.wall.desc":"Parede simples (linha) em 2D.","ext.structural.area.name":"Área","ext.structural.area.desc":"Área (polígono) em 2D.","ext.structural.pool.name":"Piscina","ext.structural.pool.desc":"Piscina (buraco) em 2D.","ext.structural.tools.wall":"Parede","ext.structural.tools.wall_opening":"Abertura","ext.structural.tools.wall_opening_desc":"Recorte do piso ao teto. Passe sobre a parede, clique e arraste para dimensionar. Clique para largura padrão. Segure Shift para simetria.","ext.structural.tools.wall_door":"Porta","ext.structural.tools.wall_door_desc":"Adiciona um recorte de porta na parede.","ext.structural.tools.wall_window":"Janela","ext.structural.tools.wall_window_desc":"Adiciona um recorte de janela na parede.","ext.structural.tools.area_square":"Área (retângulo)","ext.structural.tools.area_polygon":"Área (polígono)","ext.structural.tools.area_square_walls":"Área + paredes (retângulo)","ext.structural.tools.area_polygon_walls":"Área + paredes (polígono)","ext.structural.tools.pool_square":"Piscina (retângulo)","ext.structural.tools.pool_polygon":"Piscina (polígono)","ext.structural.editor.wall_color":"Cor da parede","ext.structural.editor.wall_texture":"Textura da parede","ext.structural.editor.openings":"Aberturas","ext.structural.editor.openings_empty":"Sem aberturas ainda. Use as ferramentas ou adicione aqui.","ext.structural.editor.opening_kind":"Tipo","ext.structural.editor.opening_center":"Posição (m)","ext.structural.editor.opening_center_hint":"Ao longo da parede: {{start}} m = início (1º ponto), {{end}} m = fim (2º ponto).","ext.structural.editor.opening_width":"Largura (m)","ext.structural.editor.opening_height_full":"Altura: piso ao teto.","ext.structural.editor.opening_height_range":"Altura: {{yMin}} - {{yMax}} m.","ext.structural.editor.opening_color":"Cor","ext.structural.editor.opening_texture":"Textura","ext.structural.editor.kind.opening":"Abertura","ext.structural.editor.kind.door":"Porta","ext.structural.editor.kind.window":"Janela","ext.structural.editor.area_name":"Nome da área (opcional)","ext.structural.editor.area_color":"Cor da área","ext.structural.editor.floor_texture":"Textura do chão","ext.structural.editor.transparent":"Transparente","ext.structural.editor.texture.none":"Nenhuma","ext.structural.editor.texture.brick":"Tijolo","ext.structural.editor.texture.concrete":"Concreto","ext.structural.editor.texture.wood":"Madeira","ext.structural.editor.texture.glass":"Vidro","ext.structural.editor.texture.grass":"Grama","ext.structural.editor.pool_name":"Nome da piscina (opcional)","ext.structural.editor.pool_depth":"Profundidade (m)","ext.structural.editor.preview":"Prévia"}};function Ee(e){var t;e.i18n.registerTranslations(Fe),e.registerElementType((t=e.i18n,{type:i,layerGroup:"walls",name:{key:"ext.structural.wall.name",fallback:"Wall"},description:{key:"ext.structural.wall.desc",fallback:"Simple wall (line) in 2D."},defaultProps:{color:c,texture:"none",width:u,a:{x:0,z:0},b:{x:1,z:0},openings:[]},create3D:({THREE:e,view:t},o)=>{const n=new e.Group,r=new e.Group,a=new e.Group,i=new e.Group,s=new e.Group;r.add(a),r.add(i),r.add(s),n.add(r);const l=new e.MeshStandardMaterial({color:c,roughness:.82,metalness:.05,flatShading:!0}),d=new e.MeshStandardMaterial({color:c,roughness:.86,metalness:.04,flatShading:!0}),p=new e.MeshBasicMaterial({color:"#000000",transparent:!0,opacity:0,depthWrite:!1});p.colorWrite=!1;let x="";function f(o){const n=g(o.props.a,{x:o.position.x-.5,z:o.position.z}),f=g(o.props.b,{x:o.position.x+.5,z:o.position.z}),w=U(X(f,n)),y=Math.max(.04,m(o.props.width,u)),_=Math.max(.15,t.wallHeight),v=Math.max(.001,$(n,f)),b=h(o.props.color,c),S=j(o.props.texture,"none"),z=function(e,t){if("none"===t)return null;if("brick"===t){const t=T(e,"wall:brick",M,{size:256,anisotropy:4});return t.repeat.set(1,1),t}if("concrete"===t){const t=T(e,"wall:concrete",k,{size:256,anisotropy:4});return t.repeat.set(.5,.5),t}return null}(e,S);r.position.set(n.x-o.position.x,0,n.z-o.position.z),r.rotation.set(0,Math.atan2(-w.z,w.x),0);const N=ce(ie(o.props.openings),v,_),P=JSON.stringify({length:pe(v),thickness:pe(y),height:pe(_),openings:N.map(e=>({id:e.id,kind:e.kind,start:pe(e.start_m),end:pe(e.end_m),y0:pe(e.y_min_m),y1:pe(e.y_max_m),color:e.color??"",texture:e.texture??""}))});if(P!==x){x=P,ge(a,!1),ge(i,!0),ge(s,!1);const t=function(e,t,o){const n=[0,t];for(const e of o)n.push(de(e.y_min_m,0,t)),n.push(de(e.y_max_m,0,t));n.sort((e,t)=>e-t);const r=[];for(const e of n)(0===r.length||Math.abs(e-r[r.length-1])>1e-6)&&r.push(e);const a=[];for(let t=0;t<r.length-1;t++){const n=r[t],i=r[t+1];if(i-n<=1e-6)continue;const s=[];for(const e of o)e.y_min_m>=i-1e-6||e.y_max_m<=n+1e-6||s.push({start:e.start_m,end:e.end_m});const l=me(e,s);for(const e of l)e.end-e.start<=1e-6||a.push({x0:e.start,x1:e.end,y0:n,y1:i})}return a}(v,_,N);for(const o of t){if(o.x1-o.x0<=1e-6||o.y1-o.y0<=1e-6)continue;const t=new e.BoxGeometry(o.x1-o.x0,o.y1-o.y0,y);fe(t,{originX:(o.x0+o.x1)/2,originY:0+(o.y0+o.y1)/2,originZ:0,thicknessWorld:y});const n=[d,d,d,d,l,l],r=new e.Mesh(t,n);r.castShadow=!0,r.receiveShadow=!0,r.position.set((o.x0+o.x1)/2,0+(o.y0+o.y1)/2,0),a.add(r)}for(const t of N)"door"!==t.kind?"window"===t.kind&&_e(e,i,t,y):ye(e,i,t,y);for(const t of N){const o=t.y_max_m-t.y_min_m;if(t.width_m<=.08||o<=.08)continue;const n=new e.BoxGeometry(t.width_m,o,1.06*y),r=new e.Mesh(n,p);r.userData.__toposyncAllowPickWhenGhostWalls=!0,r.position.set(t.center_m,0+t.y_min_m+o/2,0),r.castShadow=!1,r.receiveShadow=!1,s.add(r)}}l.color.set(b),d.color.set(b),l.map!==z&&(l.map=z,l.needsUpdate=!0),l.roughness="brick"===S?.9:.82,l.metalness="brick"===S?.02:.05}return f(o),{object:n,update:f,dispose:()=>{ge(a,!1),ge(i,!0),ge(s,!1),l.dispose(),d.dispose(),p.dispose()}}},render2D:({ctx:e,element:t,viewport:o})=>{const n=g(t.props.a,{x:t.position.x,z:t.position.z}),r=g(t.props.b,{x:t.position.x+1,z:t.position.z}),a=h(t.props.color,c),i=Math.max(.04,m(t.props.width,u)),s=Math.max(.001,$(n,r)),l=U(X(r,n)),d={x:-(w=l).z,z:w.x},p=ce(ie(t.props.openings),s,3.2),x=me(s,p.map(e=>({start:e.start_m,end:e.end_m}))),f=Math.max(2,i*o.scale);var w;e.save(),e.lineCap="round",e.lineJoin="round";for(const t of x){const r=o.worldToScreen(he(n,l,t.start)),i=o.worldToScreen(he(n,l,t.end));e.strokeStyle="rgba(0,0,0,0.35)",e.lineWidth=f+3,e.beginPath(),e.moveTo(r.x,r.y),e.lineTo(i.x,i.y),e.stroke(),e.strokeStyle=a,e.lineWidth=f,e.beginPath(),e.moveTo(r.x,r.y),e.lineTo(i.x,i.y),e.stroke()}const y=Math.max(i/2,.09);for(const t of p){const r=he(n,l,t.start_m),a=he(n,l,t.end_m),i=o.worldToScreen(K(r,L(d,y))),s=o.worldToScreen(K(a,L(d,y))),c=o.worldToScreen(K(a,L(d,-y))),u=o.worldToScreen(K(r,L(d,-y))),p=we(t.kind);e.beginPath(),e.moveTo(i.x,i.y),e.lineTo(s.x,s.y),e.lineTo(c.x,c.y),e.lineTo(u.x,u.y),e.closePath(),e.fillStyle=p.fill,e.fill(),e.strokeStyle=p.stroke,e.lineWidth=1.8,e.setLineDash(p.dash),e.stroke(),e.setLineDash([])}e.restore()},hitTest2D:({element:e,world:t,viewport:o})=>{const n=g(e.props.a,{x:e.position.x,z:e.position.z}),r=g(e.props.b,{x:e.position.x+1,z:e.position.z}),a=Math.max(.04,m(e.props.width,u)),i=Math.max(a/2,.09,10/Math.max(1,o.scale));return function(e,t,o){const n=X(o,t),r=X(e,t),a=n.x*n.x+n.z*n.z;return a<=1e-9?Math.hypot(r.x,r.z):$(e,K(t,L(n,de((r.x*n.x+r.z*n.z)/a,0,1))))}(t,n,r)<=i},renderEditorModal:({element:e,update:o,remove:r,close:a})=>(0,n.jsx)(ve,{element:e,update:o,remove:r,close:a,i18n:t})})),e.registerElementType(F(e.i18n)),e.registerElementType(O(e.i18n));for(const t of(e.i18n,[{id:"com.toposync.structural.tool.wall",name:{key:"ext.structural.tools.wall",fallback:"Wall"},icon:"ruler-combined",createSession:e=>{let t=null,o=null;function n(){t=null,o=null}return{onPointerEvent:r=>{var a;if("cancel"!==r.kind)if("move"!==r.kind){if("down"===r.kind&&0===r.button)return t?(a=r.world,void(t&&($(t,a)<.05||Me(e,t,a),n()))):(t=r.world,void(o=r.world))}else t&&(o=r.world);else n()},onKeyDown:e=>{"Escape"===e.key&&n()},renderOverlay2D:({ctx:e,viewport:n})=>{if(!t||!o)return;const r=n.worldToScreen(t),i=n.worldToScreen(o),s=Math.max(2,u*n.scale);e.save(),e.setLineDash([8,6]),e.lineCap="round",e.strokeStyle=a("#fbbf24",.85),e.lineWidth=s,e.beginPath(),e.moveTo(r.x,r.y),e.lineTo(i.x,i.y),e.stroke(),e.restore()},getCursor:()=>"crosshair"}}},We(0,{kind:"opening"}),We(0,{kind:"door"}),We(0,{kind:"window"}),Ce(0,{withWalls:!1}),Ae(0,{withWalls:!1}),De(),{id:"com.toposync.structural.tool.pool_polygon",name:{key:"ext.structural.tools.pool_polygon",fallback:"Pool (polygon)"},icon:"droplet",createSession:e=>{const t=[];let o=null;function n(){t.splice(0,t.length),o=null}function r(){if(t.length<3)return void n();const o=ke(e,[...t]);o&&e.openEditor(o),n()}return{onPointerEvent:e=>{"cancel"!==e.kind?"move"!==e.kind?"dblclick"!==e.kind?"down"===e.kind&&0===e.button&&(function(e){if(t.length<3)return!1;const o=t[0];return $(e.world,o)<.22}(e)?r():(t.push(e.world),o=e.world)):r():o=e.world:n()},onKeyDown:e=>{"Escape"===e.key&&n(),"Enter"===e.key&&r(),("Backspace"===e.key||"Delete"===e.key)&&t.length>0&&t.pop()},renderOverlay2D:({ctx:e,viewport:n})=>{if(0===t.length)return;const r=t.map(e=>n.worldToScreen(e)),i=o?n.worldToScreen(o):null;if(e.save(),t.length>=2){e.beginPath(),e.moveTo(r[0].x,r[0].y);for(let t=1;t<r.length;t++)e.lineTo(r[t].x,r[t].y);i&&e.lineTo(i.x,i.y),e.strokeStyle=a("#38bdf8",.85),e.lineWidth=2,e.setLineDash([6,6]),e.stroke()}for(let o=0;o<r.length;o++){const n=r[o],i=0===o&&t.length>=3;e.beginPath(),e.arc(n.x,n.y,i?6:5,0,2*Math.PI),e.fillStyle=a(i?"#22c55e":"#38bdf8",.85),e.fill(),e.strokeStyle="rgba(0,0,0,0.35)",e.lineWidth=2,e.stroke()}e.restore()},getCursor:()=>"crosshair"}}},Ce(0,{withWalls:!0}),Ae(0,{withWalls:!0})]))e.registerEditorTool(t)}},94(e,t,o){var n=o(496),r=Symbol.for("react.element"),a=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,o){var n,l={},c=null,u=null;for(n in void 0!==o&&(c=""+o),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,n)&&!s.hasOwnProperty(n)&&(l[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===l[n]&&(l[n]=t[n]);return{$$typeof:r,type:e,key:c,ref:u,props:l,_owner:i.current}}t.jsx=l,t.jsxs=l},870(e,t,o){e.exports=o(94)}}]);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 326.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunk_toposync_extension_structural_ui=self.webpackChunk_toposync_extension_structural_ui||[]).push([[326],{249(e,t){var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),i=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),y=Symbol.iterator,d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,h={};function b(e,t,r){this.props=e,this.context=t,this.refs=h,this.updater=r||d}function m(){}function v(e,t,r){this.props=e,this.context=t,this.refs=h,this.updater=r||d}b.prototype.isReactComponent={},b.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},b.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},m.prototype=b.prototype;var S=v.prototype=new m;S.constructor=v,_(S,b.prototype),S.isPureReactComponent=!0;var k=Array.isArray,w=Object.prototype.hasOwnProperty,E={current:null},$={key:!0,ref:!0,__self:!0,__source:!0};function R(e,t,n){var o,u={},c=null,a=null;if(null!=t)for(o in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(c=""+t.key),t)w.call(t,o)&&!$.hasOwnProperty(o)&&(u[o]=t[o]);var i=arguments.length-2;if(1===i)u.children=n;else if(1<i){for(var f=Array(i),s=0;s<i;s++)f[s]=arguments[s+2];u.children=f}if(e&&e.defaultProps)for(o in i=e.defaultProps)void 0===u[o]&&(u[o]=i[o]);return{$$typeof:r,type:e,key:c,ref:a,props:u,_owner:E.current}}function C(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}var g=/\/+/g;function j(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function x(e,t,o,u,c){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var i=!1;if(null===e)i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case r:case n:i=!0}}if(i)return c=c(i=e),e=""===u?"."+j(i,0):u,k(c)?(o="",null!=e&&(o=e.replace(g,"$&/")+"/"),x(c,t,o,"",function(e){return e})):null!=c&&(C(c)&&(c=function(e,t){return{$$typeof:r,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(c,o+(!c.key||i&&i.key===c.key?"":(""+c.key).replace(g,"$&/")+"/")+e)),t.push(c)),1;if(i=0,u=""===u?".":u+":",k(e))for(var f=0;f<e.length;f++){var s=u+j(a=e[f],f);i+=x(a,t,o,s,c)}else if(s=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=y&&e[y]||e["@@iterator"])?e:null}(e),"function"==typeof s)for(e=s.call(e),f=0;!(a=e.next()).done;)i+=x(a=a.value,t,o,s=u+j(a,f++),c);else if("object"===a)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function O(e,t,r){if(null==e)return e;var n=[],o=0;return x(e,n,"","",function(e){return t.call(r,e,o++)}),n}function P(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var I={current:null},T={transition:null},V={ReactCurrentDispatcher:I,ReactCurrentBatchConfig:T,ReactCurrentOwner:E};function A(){throw Error("act(...) is not supported in production builds of React.")}t.Children={map:O,forEach:function(e,t,r){O(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return O(e,function(){t++}),t},toArray:function(e){return O(e,function(e){return e})||[]},only:function(e){if(!C(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=b,t.Fragment=o,t.Profiler=c,t.PureComponent=v,t.StrictMode=u,t.Suspense=s,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V,t.act=A,t.cloneElement=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o=_({},e.props),u=e.key,c=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(c=t.ref,a=E.current),void 0!==t.key&&(u=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(f in t)w.call(t,f)&&!$.hasOwnProperty(f)&&(o[f]=void 0===t[f]&&void 0!==i?i[f]:t[f])}var f=arguments.length-2;if(1===f)o.children=n;else if(1<f){i=Array(f);for(var s=0;s<f;s++)i[s]=arguments[s+2];o.children=i}return{$$typeof:r,type:e.type,key:u,ref:c,props:o,_owner:a}},t.createContext=function(e){return(e={$$typeof:i,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},t.createElement=R,t.createFactory=function(e){var t=R.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:f,render:e}},t.isValidElement=C,t.lazy=function(e){return{$$typeof:p,_payload:{_status:-1,_result:e},_init:P}},t.memo=function(e,t){return{$$typeof:l,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=T.transition;T.transition={};try{e()}finally{T.transition=t}},t.unstable_act=A,t.useCallback=function(e,t){return I.current.useCallback(e,t)},t.useContext=function(e){return I.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return I.current.useDeferredValue(e)},t.useEffect=function(e,t){return I.current.useEffect(e,t)},t.useId=function(){return I.current.useId()},t.useImperativeHandle=function(e,t,r){return I.current.useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return I.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return I.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return I.current.useMemo(e,t)},t.useReducer=function(e,t,r){return I.current.useReducer(e,t,r)},t.useRef=function(e){return I.current.useRef(e)},t.useState=function(e){return I.current.useState(e)},t.useSyncExternalStore=function(e,t,r){return I.current.useSyncExternalStore(e,t,r)},t.useTransition=function(){return I.current.useTransition()},t.version="18.3.1"},326(e,t,r){e.exports=r(249)}}]);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var e,r,t={510(){}},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.m=t,n.c=o,n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+".js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="@toposync/extension-structural-ui:",n.l=(t,o,a,i)=>{if(e[t])e[t].push(o);else{var s,u;if(void 0!==a)for(var c=document.getElementsByTagName("script"),l=0;l<c.length;l++){var p=c[l];if(p.getAttribute("src")==t||p.getAttribute("data-webpack")==r+a){s=p;break}}s||(u=!0,(s=document.createElement("script")).charset="utf-8",n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",r+a),s.src=t),e[t]=[o];var d=(r,o)=>{s.onerror=s.onload=null,clearTimeout(f);var n=e[t];if(delete e[t],s.parentNode&&s.parentNode.removeChild(s),n&&n.forEach(e=>e(o)),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=d.bind(null,s.onerror),s.onload=d.bind(null,s.onload),u&&document.head.appendChild(s)}},(()=>{n.S={};var e={},r={};n.I=(t,o)=>{o||(o=[]);var a=r[t];if(a||(a=r[t]={}),!(o.indexOf(a)>=0)){if(o.push(a),e[t])return e[t];n.o(n.S,t)||(n.S[t]={});var i=n.S[t],s="@toposync/extension-structural-ui",u=[];return"default"===t&&((e,r,t,o)=>{var a=i[e]=i[e]||{},u=a[r];(!u||!u.loaded&&(1!=!u.eager?o:s>u.from))&&(a[r]={get:()=>n.e(326).then(()=>()=>n(326)),from:s,eager:!1})})("react","18.3.1"),e[t]=u.length?Promise.all(u).then(()=>e[t]=1):1}}})(),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var r=n.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var o=t.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=t[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={792:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>o=e[r]=[t,n]);t.push(o[2]=a);var i=n.p+n.u(r),s=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;s.message="Loading chunk "+r+" failed.\n("+a+": "+i+")",s.name="ChunkLoadError",s.type=a,s.request=i,o[1](s)}},"chunk-"+r,r)}};var r=(r,t)=>{var o,a,[i,s,u]=t,c=0;if(i.some(r=>0!==e[r])){for(o in s)n.o(s,o)&&(n.m[o]=s[o]);u&&u(n)}for(r&&r(t);c<i.length;c++)a=i[c],n.o(e,a)&&e[a]&&e[a][0](),e[a]=0},t=self.webpackChunk_toposync_extension_structural_ui=self.webpackChunk_toposync_extension_structural_ui||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),n(510)})();
@@ -0,0 +1 @@
1
+ var structural;(()=>{"use strict";var e,r,t,n,o,a,i,u,s,l,c,p,d,f,h,v={863(e,r,t){var n={"./activate":()=>t.e(12).then(()=>()=>t(12))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then(()=>{throw new Error('Module "'+e+'" does not exist in container.')}),t.R=void 0,r),a=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>a})}},g={};function m(e){var r=g[e];if(void 0!==r)return r.exports;var t=g[e]={exports:{}};return v[e](t,t.exports,m),t.exports}m.m=v,m.c=g,m.d=(e,r)=>{for(var t in r)m.o(r,t)&&!m.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},m.f={},m.e=e=>Promise.all(Object.keys(m.f).reduce((r,t)=>(m.f[t](e,r),r),[])),m.u=e=>e+".js",m.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),m.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="@toposync/extension-structural-ui:",m.l=(t,n,o,a)=>{if(e[t])e[t].push(n);else{var i,u;if(void 0!==o)for(var s=document.getElementsByTagName("script"),l=0;l<s.length;l++){var c=s[l];if(c.getAttribute("src")==t||c.getAttribute("data-webpack")==r+o){i=c;break}}i||(u=!0,(i=document.createElement("script")).charset="utf-8",m.nc&&i.setAttribute("nonce",m.nc),i.setAttribute("data-webpack",r+o),i.src=t),e[t]=[n];var p=(r,n)=>{i.onerror=i.onload=null,clearTimeout(d);var o=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(e=>e(n)),r)return r(n)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),u&&document.head.appendChild(i)}},m.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{m.S={};var e={},r={};m.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];m.o(m.S,t)||(m.S[t]={});var a=m.S[t],i="@toposync/extension-structural-ui",u=[];return"default"===t&&((e,r,t,n)=>{var o=a[e]=a[e]||{},u=o[r];(!u||!u.loaded&&(1!=!u.eager?n:i>u.from))&&(o[r]={get:()=>m.e(326).then(()=>()=>m(326)),from:i,eager:!1})})("react","18.3.1"),e[t]=u.length?Promise.all(u).then(()=>e[t]=1):1}}})(),(()=>{var e;m.g.importScripts&&(e=m.g.location+"");var r=m.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),m.p=e})(),t=e=>{var r=e=>e.split(".").map(e=>+e==e?+e:e),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},n=(e,r)=>{e=t(e),r=t(r);for(var n=0;;){if(n>=e.length)return n<r.length&&"u"!=(typeof r[n])[0];var o=e[n],a=(typeof o)[0];if(n>=r.length)return"u"==a;var i=r[n],u=(typeof i)[0];if(a!=u)return"o"==a&&"n"==u||"s"==u||"u"==a;if("o"!=a&&"u"!=a&&o!=i)return o<i;n++}},o=(e,r)=>e&&m.o(e,r),a=e=>(e.loaded=1,e.get()),i=e=>Object.keys(e).reduce((r,t)=>(e[t].eager&&(r[t]=e[t]),r),{}),u=(e,r,t)=>{var o=t?i(e[r]):e[r];return Object.keys(o).reduce((e,r)=>!e||!o[e].loaded&&n(e,r)?r:e,0)},s=e=>{throw new Error(e)},l=(e,r,t)=>t?t():((e,r)=>s("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),c=(e=>function(r,t,n,o,a){var i=m.I(r);return i&&i.then&&!n?i.then(e.bind(e,r,m.S[r],t,!1,o,a)):e(r,m.S[r],t,n,o)})((e,r,t,n,i)=>{if(!o(r,t))return l(e,t,i);var s=u(r,t,n);return a(r[t][s])}),p={},d={496:()=>c("default","react",!1,()=>m.e(326).then(()=>()=>m(326)))},f={12:[496]},h={},m.f.consumes=(e,r)=>{m.o(f,e)&&f[e].forEach(e=>{if(m.o(p,e))return r.push(p[e]);if(!h[e]){var t=r=>{p[e]=0,m.m[e]=t=>{delete m.c[e],t.exports=r()}};h[e]=!0;var n=r=>{delete p[e],m.m[e]=t=>{throw delete m.c[e],r}};try{var o=d[e]();o.then?r.push(p[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}})},(()=>{var e={870:0};m.f.j=(r,t)=>{var n=m.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise((t,o)=>n=e[r]=[t,o]);t.push(n[2]=o);var a=m.p+m.u(r),i=new Error;m.l(a,t=>{if(m.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}},"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[a,i,u]=t,s=0;if(a.some(r=>0!==e[r])){for(n in i)m.o(i,n)&&(m.m[n]=i[n]);u&&u(m)}for(r&&r(t);s<a.length;s++)o=a[s],m.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=self.webpackChunk_toposync_extension_structural_ui=self.webpackChunk_toposync_extension_structural_ui||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var b=m(863);structural=b})();
@@ -0,0 +1,20 @@
1
+ Metadata-Version: 2.4
2
+ Name: toposync-ext-structural
3
+ Version: 0.1.0
4
+ Summary: Toposync first-party extension: Structural drawing tools (2D walls/areas).
5
+ License-Expression: MIT
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.11
8
+ Requires-Dist: toposync-core>=0.3.0
9
+ Description-Content-Type: text/markdown
10
+
11
+ # Toposync Extension: Structural
12
+
13
+ Ferramentas e tipos de elemento estruturais (2D) para o editor de composição:
14
+
15
+ - Paredes (linhas)
16
+ - Áreas (quadrado/polígono)
17
+ - Variantes “área + paredes”
18
+
19
+ O frontend dessa extensão é distribuído como bundle prebuilt (`remoteEntry.js`) dentro do wheel.
20
+
@@ -0,0 +1,14 @@
1
+ toposync_ext_structural/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
2
+ toposync_ext_structural/extension.json,sha256=OoWAhJsgn6stbka80vLGeoWQ7IIkhjKWwjFNLEryNSA,254
3
+ toposync_ext_structural/plugin.py,sha256=xBn-kTzOpwroTaFT_SEhvIf-_aJygTYMxzGLycM9P18,219
4
+ toposync_ext_structural/static/12.js,sha256=lS6bUkFm7q0QbNyb7znTDDuHltxdQvw-gk2IE5oy5GU,57062
5
+ toposync_ext_structural/static/12.js.LICENSE.txt,sha256=eNJ8gc9n9IF8nW1d9sI9niuHstYzjNz5vqXx9UgWSPc,249
6
+ toposync_ext_structural/static/326.js,sha256=ANK_6JilC9OKGMv6Pvn7sOla8RKjSDXldnckk52zkq0,6615
7
+ toposync_ext_structural/static/326.js.LICENSE.txt,sha256=zRuL3pDqnup3swzPozXb5Paast12-f9ZdYwQCM42Ymk,237
8
+ toposync_ext_structural/static/main.js,sha256=iez5MnoQdJ9cJ0WaUAfmhKFZnsuYLxpdfAVCf2Vin9A,2932
9
+ toposync_ext_structural/static/remoteEntry.js,sha256=wRh3KsVKrifII2y8w-zXqwIE_qRh01UD4W4cxeBSxzQ,5065
10
+ toposync_ext_structural-0.1.0.dist-info/METADATA,sha256=wNzRaQ51OprX5NbJdrNjVqmSoxvTSlIfYPrfVV9fu74,598
11
+ toposync_ext_structural-0.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
12
+ toposync_ext_structural-0.1.0.dist-info/entry_points.txt,sha256=eiYVaZcY0nY5R3qxSSHdTFB6cm3aHRloERVjlpgCjWA,86
13
+ toposync_ext_structural-0.1.0.dist-info/licenses/LICENSE,sha256=C93tbOBlko9ANp_3JMhWo0QPKpoufn5OEk7hCdm2gSs,1069
14
+ toposync_ext_structural-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [toposync.extensions]
2
+ structural = toposync_ext_structural.plugin:StructuralExtension
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mateus Calza
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.