Files
houseplan-card/dist/houseplan-assets/iso-scene-render-9PxxIEfq.js
T
Matysh d11f95bc40
Проверка (CI) / Классификация изменённых файлов (push) Successful in 1m0s
Проверка (CI) / Предполётные проверки: документация, провенанс, процесс (push) Failing after 1m12s
Проверка (CI) / HACS: валидация репозитория (push) Failing after 42s
Проверка (CI) / Hassfest: манифест интеграции (push) Failing after 42s
Проверка (CI) / Переиспользование: это дерево уже проверено (push) Successful in 1m5s
Проверка (CI) / Мутанты по диффу (1/3): затронутые свидетели краснеют (push) Failing after 4m21s
Проверка (CI) / Мутанты по диффу (2/3): затронутые свидетели краснеют (push) Failing after 4m0s
Проверка (CI) / Мутанты по диффу (3/3): затронутые свидетели краснеют (push) Failing after 4m1s
Проверка (CI) / Фронтенд: типы, юниты, мутанты, синхрон бандла (push) Failing after 7m16s
Проверка (CI) / Смоки в браузере (шард 1 из 3) (push) Skipped
Проверка (CI) / Смоки в браузере (шард 2 из 3) (push) Skipped
Проверка (CI) / Смоки в браузере (шард 3 из 3) (push) Skipped
Проверка (CI) / Смоки: все шарды зелёные (push) Skipped
Проверка (CI) / Golden-кадры против принятых эталонов (push) Skipped
Проверка (CI) / Перф-смок: бюджет времени кадра (push) Skipped
Проверка (CI) / Бэкенд: pytest в Home Assistant (push) Failing after 5m20s
Release v1.73.0 candidate
Promote the eight published v1.73.0 betas without new product behavior. Synchronize version fields and generated bundles; aggregate public release notes from v1.72.0. Main-only workflow mirrors were merged with an identical beta.8 product tree.

Issue: #505
User-Visible: no
Release: v1.73.0
2026-09-09 12:05:08 +03:00

74 lines
38 KiB
JavaScript

globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="807c2621b5e1c592548244ff5adb94281d1799a1481ada113e6938b375396c5c";import{dC as e,dD as t,b3 as n,dE as o,dF as i,m as a,dG as r,dH as s,dI as l,dJ as c,a4 as d,dK as u,aj as h,bW as f,bV as p,dL as m,ak as g,P as w,dM as y,cS as v,dN as x,A as M,w as b,dO as S,dP as $,dQ as k,dR as z,dS as P}from"./houseplan-card-mOz0zLlc.js";import{i as I}from"./guard-Cxp8QKxn.js";const C=e=>`${Number(e[0].toFixed(4))} ${Number(e[1].toFixed(4))}`;function j(e){let t=0;for(let n=0;n<e.length;n++){const o=e[n],i=e[(n+1)%e.length];t+=o[0]*i[1]-i[0]*o[1]}return t/2}function N(e,t){const n=function(e){const t=(Array.isArray(e)?e:[]).filter(e=>Array.isArray(e)&&Number.isFinite(e[0])&&Number.isFinite(e[1])).map(e=>[Number(e[0]),Number(e[1])]),n=t[t.length-1];return t.length>1&&t[0][0]===n[0]&&t[0][1]===n[1]&&t.pop(),t}(e);if(n.length<3)return[];const o=!t;return j(n)>0===o?n:[...n].reverse()}function O(e,t,o){return e.length?`M ${e.map(e=>C(n(e,o,t))).join(" L ")} Z`:""}function A(e,t,n){const o=t[1]-e[1],i=-(t[0]-e[0]),a=n.rotDeg*Math.PI/180;return o*Math.sin(a)+i*Math.cos(a)}function B(t,o,i=e){if(!Number.isFinite(o)||o<0)throw new Error("invalid floor edge height");const a=(t||[]).map(e=>(e||[]).map((e,t)=>function(e,t){const n=N(e,t);if(!n.length)return n;let o=0;for(let e=1;e<n.length;e++)(n[e][0]<n[o][0]||n[e][0]===n[o][0]&&n[e][1]<n[o][1])&&(o=e);return[...n.slice(o),...n.slice(0,o)]}(e,t>0)).filter(e=>e.length>=3&&Math.abs(j(e))>=1e-9)).filter(e=>e.length&&j(e[0])>0);a.sort((e,t)=>{const n=e[0][0],o=t[0][0];return n[0]-o[0]||n[1]-o[1]||Math.abs(j(t[0]))-Math.abs(j(e[0]))});const r=[],s=[];let l=0;for(let e=0;e<a.length;e++){const t=a[e];for(const e of t)r.push(O(e,i,0));const c=t[0];l+=c.length;for(let t=0;t<c.length;t++){const a=c[t],r=c[(t+1)%c.length];if(A(a,r,i)<=1e-9)continue;const l=n(a,0,i),d=n(r,0,i),u=n(r,-o,i),h=n(a,-o,i);s.push({d:`M ${C(l)} L ${C(d)} L ${C(u)} L ${C(h)} Z`,depth:Math.max(h[1],u[1]),component:e,edge:t,planEdge:[a,r]})}}return s.sort((e,t)=>e.depth-t.depth||e.component-t.component||e.edge-t.edge),{footprintPath:r.join(" "),sides:s,componentCount:a.length,edgeCount:l}}function R(e,t){return e^=Math.round(64*(Number.isFinite(t)?t:0)),Math.imul(e,16777619)>>>0}const H=Object.freeze({revision:1,leafThicknessRatio:.04,frameThicknessRatio:.055,gateTurnDeg:10,gateTopRatio:.88,windowBottomRatio:.27,windowTopRatio:.78,doorTopRatio:.92});H.leafThicknessRatio,H.frameThicknessRatio;const F=e=>e.every(Number.isFinite);function T(e,t){return Object.freeze([Object.is(e,-0)?0:e,Object.is(t,-0)?0:t])}function L(e,t){return[e[0]+t[0],e[1]+t[1]]}function V(e,t){return[e[0]-t[0],e[1]-t[1]]}function G(e,t){return[e[0]*t,e[1]*t]}function W(e,t,n,o){const i=e[0]*n,a=e[1]*o,r=t*Math.PI/180;return[i*Math.cos(r)-a*Math.sin(r),i*Math.sin(r)+a*Math.cos(r)]}function E(e,t,n,i,a,r,s){const l=e.flipH?-1:1,c="gate"===e.type?1:e.flipV?-1:1,d=o(e.type,e.flipV,e.angle,e.face);return{leaf:t,hinge:L([e.x+d.ox,e.y+d.oy],W(n,e.angle,l,c)),closedVector:W(i,e.angle,l,c),quarterVector:W([-i[1],i[0]],e.angle,l,c),turnDeg:a,bottom:r,top:s}}const q=e=>`${Number(e[0].toFixed(4))} ${Number(e[1].toFixed(4))}`;function D(e,t,o,i,a={}){const r=o.map(e=>n(e.point,e.z,i));return Object.freeze({kind:e,material:t,d:`M ${r.map(q).join(" L ")} Z`,depth:Math.max(...r.map(e=>e[1])),...a})}function _(e,t,n,o,i,a,r,s={}){return D(e,t,[{point:n,z:i},{point:o,z:i},{point:o,z:a},{point:n,z:a}],r,s)}function U(t,o,i=e){const a=Math.max(0,Math.min(1,Number.isFinite(o)?o:0));return t.leaves.map(e=>{const o=function(e,t){const n=e.turnDeg*t*Math.PI/180;return[e.hinge[0]+e.closedVector[0]*Math.cos(n)+e.quarterVector[0]*Math.sin(n),e.hinge[1]+e.closedVector[1]*Math.cos(n)+e.quarterVector[1]*Math.sin(n)]}(e,a),r=n(e.hinge,e.bottom,i),s=n(o,e.bottom,i),l=n(o,e.top,i),c=n(e.hinge,e.top,i),d="window"===t.type?"light-window":"matte-leaf",u="window"===t.type?Object.freeze([_("window-insert","light-window",e.hinge,o,e.bottom,e.top,i)]):function(e,t,n,o){const i=V(t,e.hinge),a=Math.hypot(i[0],i[1]);if(!(a>1e-9&&n>0))return Object.freeze([]);const r=T(-i[1]*n/(2*a),i[0]*n/(2*a)),s=L(e.hinge,r),l=L(t,r),c=V(e.hinge,r),d=V(t,r),u=[_("leaf-back","matte-leaf",d,c,e.bottom,e.top,o),_("leaf-front","matte-leaf",s,l,e.bottom,e.top,o),_("leaf-edge","matte-leaf",c,s,e.bottom,e.top,o,{edge:"hinge"}),_("leaf-edge","matte-leaf",l,d,e.bottom,e.top,o,{edge:"tip"}),D("leaf-top","matte-leaf",[{point:s,z:e.top},{point:c,z:e.top},{point:d,z:e.top},{point:l,z:e.top}],o)];return Object.freeze(u.sort((e,t)=>e.depth-t.depth||e.kind.localeCompare(t.kind)||String(e.edge||"").localeCompare(String(t.edge||""))))}(e,o,t.leafThickness,i);return Object.freeze({id:t.id,sourceIndex:t.sourceIndex,type:t.type,leaf:e.leaf,d:`M ${q(r)} L ${q(s)} L ${q(l)} L ${q(c)} Z`,shadowD:`M ${q(n(e.hinge,0,i))} L ${q(n(o,0,i))}`,depth:Math.max(r[1],s[1]),material:d,thickness:"window"===t.type?0:t.leafThickness,surfaces:u})})}const K=1e-9,Z=e=>e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1]);function J(e){let t=0;for(let n=0;n<e.length;n++){const o=e[n],i=e[(n+1)%e.length];t+=o[0]*i[1]-i[0]*o[1]}return t/2}function Q(e){return e.length>=3&&e.every(Z)&&Math.abs(J(e))>K}function X(e,t,n){const o=n[0]-t[0],i=n[1]-t[1],a=o*o+i*i,r=a?Math.max(0,Math.min(1,((e[0]-t[0])*o+(e[1]-t[1])*i)/a)):0;return Math.hypot(e[0]-t[0]-r*o,e[1]-t[1]-r*i)}function Y(e,t,n=1e-7){for(let o=0;o<t.length;o++)if(X(e,t[o],t[(o+1)%t.length])<=n)return!0;return!1}function ee(e,t){let n=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const a=t[o],r=t[i];a[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-a[0])*(e[1]-a[1])/(r[1]-a[1])+a[0]&&(n=!n)}return n}function te(e){return Math.max(0,Math.abs(J(e.outer))-(e.holes||[]).reduce((e,t)=>e+Math.abs(J(t)),0))}function ne(e){return!!e.id&&Q(e.outer)&&(e.holes||[]).every(Q)&&te(e)>K}function oe(e,t){if(!ne(t)||Y(e,t.outer)||!ee(e,t.outer))return!1;for(const n of t.holes||[])if(Y(e,n)||ee(e,n))return!1;return!0}function ie(e){if(!ne(e))return null;if(e.safePoint&&oe(e.safePoint,e))return[e.safePoint[0],e.safePoint[1]];const t=e.outer.map(e=>e[0]),n=e.outer.map(e=>e[1]),o=Math.min(...t),i=Math.max(...t),a=Math.min(...n),r=Math.max(...n),s=[[(o+i)/2,(a+r)/2],[t.reduce((e,t)=>e+t,0)/t.length,n.reduce((e,t)=>e+t,0)/n.length]];for(let t=0;t<e.outer.length;t++){const n=e.outer[(t+e.outer.length-1)%e.outer.length],o=e.outer[t],i=e.outer[(t+1)%e.outer.length];s.push([(n[0]+o[0]+i[0])/3,(n[1]+o[1]+i[1])/3])}let l=null,c=-1/0;const d=t=>{if(!oe(t,e))return;const n=function(e,t){let n=1/0;for(const o of[t.outer,...t.holes||[]])for(let t=0;t<o.length;t++)n=Math.min(n,X(e,o[t],o[(t+1)%o.length]));return n}(t,e);n>c+K&&(l=t,c=n)};s.forEach(d);for(let e=1;e<16;e++)for(let t=1;t<16;t++)d([o+(i-o)*e/16,a+(r-a)*t/16]);return l}function ae(e){if(!Z(e.floorAnchor))return null;const t=e.roomsValidated?e.rooms:e.rooms.filter(ne),n=e.preferredRoomId&&t.find(t=>t.id===e.preferredRoomId)||null;let o=null;return"device"===e.kind?(n&&oe(e.floorAnchor,n)&&(o=n),o||(o=t.filter(t=>oe(e.floorAnchor,t)).sort((e,t)=>te(e)-te(t)||((e,t)=>e<t?-1:e>t?1:0)(e.id,t.id))[0]||null)):o=n,o?{id:o.id,area:te(o),safePoint:e.roomsValidated&&o.safePoint?[o.safePoint[0],o.safePoint[1]]:ie(o)}:null}function re(t,o,i,a=e,r=[0,0]){if(!Z(t)||!Z(o)||o[0]<0||o[1]<0||!Number.isFinite(i)||!Z(r))throw new Error("invalid isometric overlay footprint");return[[t[0]-o[0],t[1]-o[1]],[t[0]+o[0],t[1]-o[1]],[t[0]+o[0],t[1]+o[1]],[t[0]-o[0],t[1]+o[1]]].map(e=>{const t=n(e,i,a);return[t[0]+r[0],t[1]+r[1]]})}function se(e,t,n){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}function le(e,t,n,o){const i=se(e,t,n),a=se(e,t,o),r=se(n,o,e),s=se(n,o,t);return(i>K&&a<-K||i<-K&&a>K)&&(r>K&&s<-K||r<-K&&s>K)||(Math.abs(i)<=K&&X(n,e,t)<=K||Math.abs(a)<=K&&X(o,e,t)<=K||Math.abs(r)<=K&&X(e,n,o)<=K||Math.abs(s)<=K&&X(t,n,o)<=K)}function ce(e,t,n,o){return le(e,t,n,o)?0:Math.min(X(e,n,o),X(t,n,o),X(n,e,t),X(o,e,t))}const de=new WeakMap;function ue(e){if(!e.length)return null;let t=1/0,n=1/0,o=-1/0,i=-1/0;for(const a of e){if(!Z(a))return null;t=Math.min(t,a[0]),n=Math.min(n,a[1]),o=Math.max(o,a[0]),i=Math.max(i,a[1])}return[t,n,o,i]}function he(e,t){if(!t)return ue(e.outer);if(de.has(e))return de.get(e)??null;const n=ue(e.outer);return de.set(e,n),n}function fe(e,t,n){return e[0]<=t[2]+n&&e[2]>=t[0]-n&&e[1]<=t[3]+n&&e[3]>=t[1]-n}function pe(e,t,n,o){return Math.min(t[0],n[0])<=e[2]+o&&Math.max(t[0],n[0])>=e[0]-o&&Math.min(t[1],n[1])<=e[3]+o&&Math.max(t[1],n[1])>=e[1]-o}function me(e,t,n,o,i){const a=he(n,i);if(!a||!fe(t,a,o))return!1;if(e.some(e=>function(e,t){return!!ee(e,t.outer)&&!(t.holes||[]).some(t=>ee(e,t))}(e,n)))return!0;if(n.outer.some(n=>n[0]>=t[0]&&n[0]<=t[2]&&n[1]>=t[1]&&n[1]<=t[3]&&ee(n,e)))return!0;for(const i of[n.outer,...n.holes||[]])for(let n=0;n<e.length;n++){const a=(n+1)%e.length;for(let r=0;r<i.length;r++){const s=(r+1)%i.length;if(pe(t,i[r],i[s],o)&&ce(e[n],e[a],i[r],i[s])<=o+K)return!0}}return!1}function ge(e){return Q(e.outer)&&(e.holes||[]).every(Q)}function we(e,t,n){if(!oe(e,n)||!oe(t,n))return!1;for(const o of[n.outer,...n.holes||[]])for(let n=0;n<o.length;n++)if(le(e,t,o[n],o[(n+1)%o.length]))return!1;return!0}function ye(e,t,n){const o=t[0]-e[0],i=t[1]-e[1];return{from:e,to:t,visible:n,length:Math.hypot(o,i),angleDeg:180*Math.atan2(i,o)/Math.PI}}const ve="807c2621b5e1c592548244ff5adb94281d1799a1481ada113e6938b375396c5c",xe=e=>"wall-side"===e.layer?0:"wall-top"===e.layer?1:2,Me=e=>{if("wall-side"===e.layer)return`${e.face.polygon}:${e.face.ring}:${e.face.edge}`;if("wall-top"===e.layer)return String(e.face.component);const t=e.surface;return`${t.sourceIndex}:${t.leaf??-1}:${t.kind}:${t.jamb??-1}:${t.edge??""}:${t.id}:${t.material}`};function be(e,t){const n=[...e.sides.map(e=>({layer:"wall-side",depth:e.depth,face:e})),...e.topFaces.map(e=>({layer:"wall-top",depth:e.depth,face:e})),...t.map(e=>({layer:"opening",depth:e.depth,surface:e}))];return n.sort((e,t)=>e.depth-t.depth||xe(e)-xe(t)||Me(e).localeCompare(Me(t))),Object.freeze(n)}const Se=Object.freeze({textLatinAdvance:.72,textWideAsciiAdvance:1,textWideAdvance:1.1,textSpaceAdvance:.4,textWidthSafety:1.08,deviceShellInset:.134375,deviceShellGap:.1,deviceSectionGap:.08,deviceBadgeMinWidth:.7875,deviceBadgeHeight:.7875,deviceBadgeInlinePadding:.28,deviceValueInlinePadding:.32,deviceAuxiliaryExtent:.7,deviceLqiFontSize:.38,deviceLqiTop:.734375,deviceLqiBelowBottomBadgeTop:1.571875,devicePadding:.08,roomNameLineHeight:1.25,roomAreaLinkWidth:1.1,roomMetricsTopGap:.15,roomMetricFontSize:.75,roomMetricLineHeight:1.25,roomMetricIconWidth:1.05,roomMetricInnerGap:.12,roomMetricRowGap:.55,roomMetricMinWidth:11,roomPadding:.4,openingLockHalfSize:.62,roomMetricTextCharacters:Object.freeze({temperature:10,humidity:8,lqi:6,light:24})});function $e(e){return[...String(e)].reduce((e,t)=>/\s/.test(t)?e+Se.textSpaceAdvance:/[MW@#%&]/.test(t)?e+Se.textWideAsciiAdvance:e+(t.codePointAt(0)>255?Se.textWideAdvance:Se.textLatinAdvance),0)*Se.textWidthSafety}function ke(e,t){return $e(e)*z(t||e)}function ze(e,t){return[Math.max(Math.abs(e.left),Math.abs(e.right))+t,Math.max(Math.abs(e.top),Math.abs(e.bottom))+t]}function Pe(e){if("opening-lock"===e.kind){const t=(Number.isFinite(e.size)&&e.size>0?e.size:0)*Se.openingLockHalfSize;return[t,t]}if("room-label"===e.kind){const t=Number.isFinite(e.font)&&e.font>0?e.font:0,n=v(e.room.settings?.name_scale),o=v(e.room.settings?.label_scale),i=($e(e.room.name||"")+(e.room.area?Se.roomAreaLinkWidth:0))*n,a=Se.roomNameLineHeight*n,r=[e.display.labelTemp?Se.roomMetricTextCharacters.temperature:0,e.display.labelHum?Se.roomMetricTextCharacters.humidity:0,e.display.labelLqi&&e.room.area?Se.roomMetricTextCharacters.lqi:0,e.display.labelLight?Se.roomMetricTextCharacters.light:0].filter(e=>e>0),s=Se.roomMetricFontSize*o,l=r.length?Math.max(Se.roomMetricMinWidth,r.reduce((e,t)=>e+Se.roomMetricIconWidth+Se.roomMetricInnerGap+t*Se.textLatinAdvance*Se.textWidthSafety,0)+(r.length-1)*Se.roomMetricRowGap)*s:0,c=r.length?s*Se.roomMetricLineHeight:0,d=ze({left:-Math.max(i,l)/2,right:Math.max(i,l)/2,top:-a/2,bottom:r.length?a/2+Se.roomMetricsTopGap+c:a/2},Se.roomPadding);return[d[0]*t,d[1]*t]}const t=Number.isFinite(e.core)&&e.core>0?e.core:0,n=e.presentation,o=null==n.valueText?1:Math.max(1,ke(n.valueText,n.valueFullText||n.valueText)+Se.deviceValueInlinePadding),i=[];n.valueBadge&&i.push(Math.max(Se.deviceBadgeMinWidth,ke(n.valueBadge.text,n.valueBadge.fullText||n.valueBadge.text)+Se.deviceBadgeInlinePadding));for(const e of x(n)){const t=e.text+e.suffix;i.push(Math.max(Se.deviceBadgeMinWidth,ke(t,t)+Se.deviceBadgeInlinePadding))}const a=n.valueBadge?.position||"right";let r;if(!i.length||"left"!==a&&"right"!==a)if(i.length){const e=i.reduce((e,t)=>e+t,0)+(i.length-1)*Se.deviceSectionGap,t=Math.max(o,e),n=1+Se.deviceShellGap+Se.deviceBadgeHeight;r="bottom"===a?{left:-t/2-Se.deviceShellInset,right:t/2+Se.deviceShellInset,top:-.5-Se.deviceShellInset,bottom:-.5+n+Se.deviceShellInset}:{left:-t/2-Se.deviceShellInset,right:t/2+Se.deviceShellInset,top:.5-n-Se.deviceShellInset,bottom:.5+Se.deviceShellInset}}else r={left:-.5-Se.deviceShellInset,right:-.5+o+Se.deviceShellInset,top:-.5-Se.deviceShellInset,bottom:.5+Se.deviceShellInset};else{const e=Math.max(...i),t=i.length*Se.deviceBadgeHeight+(i.length-1)*Se.deviceSectionGap,n=o+Se.deviceShellGap+e,s=Math.max(1,t);r="right"===a?{left:-.5-Se.deviceShellInset,right:-.5+n+Se.deviceShellInset,top:-s/2-Se.deviceShellInset,bottom:s/2+Se.deviceShellInset}:{left:.5-n-Se.deviceShellInset,right:.5+Se.deviceShellInset,top:-s/2-Se.deviceShellInset,bottom:s/2+Se.deviceShellInset}}const s=Se.deviceAuxiliaryExtent;if(r.left=Math.min(r.left,-s),r.right=Math.max(r.right,s),r.top=Math.min(r.top,-s),r.bottom=Math.max(r.bottom,s),n.pulse.animated){const e=Math.max(1,n.pulse.diameterScale)/2;r.left=Math.min(r.left,-e),r.right=Math.max(r.right,e),r.top=Math.min(r.top,-e),r.bottom=Math.max(r.bottom,e)}if(null!=n.lqiText){const e="bottom"===n.valueBadge?.position?Se.deviceLqiBelowBottomBadgeTop:Se.deviceLqiTop,t=$e(n.lqiText)*Se.deviceLqiFontSize/2;r.left=Math.min(r.left,-t),r.right=Math.max(r.right,t),r.bottom=Math.max(r.bottom,e+Se.deviceLqiFontSize)}const l=ze(r,Se.devicePadding);return[l[0]*t,l[1]*t]}function Ie(e,t){return e.flatMap((e,n)=>e.orphanReason?[]:[{id:String(e.id||n),sourceIndex:n,type:e.type,x:e.rx,y:e.ry,angle:Number(e.angle)||0,length:e.rlen>0?e.rlen:.9*t,flipH:!!e.flip_h,flipV:!!e.flip_v}])}function Ce(e){return{id:e.id,x:e.x,y:e.y,w:e.w,h:e.h,poly:e.poly,wall_ids:e.wall_ids}}function je(e,t){const n=e?.partitionHost;if(!n)return null;const o="gate"===t.type?!t.flipV:t.flipV;return{sourceIndex:t.sourceIndex,hostId:n.host.id,t:n.t,depth:n.depth,face:p(n,o)}}function Ne(n,o=H){const i=Ie(n.openings,n.coordinateScale),r=i.map(e=>je(n.openings[e.sourceIndex],e)),p=a(t,n.cellCm),m=a(s,n.cellCm),g=a(l,n.cellCm);return{key:`${n.space.id}|${function(e){let t=2166136261;const n=e=>{if("number"!=typeof e)if("string"!=typeof e)if("boolean"!=typeof e)if(Array.isArray(e)){t=R(t,e.length);for(const t of e)n(t)}else{if(e&&"object"==typeof e){const t=e;for(const e of Object.keys(t).sort())n(e),n(t[e]);return}t=R(t,-1)}else t=R(t,e?1:0);else for(const n of e)t=R(t,n.codePointAt(0)||0);else t=R(t,e)};return n(e),t.toString(36)}({rooms:n.space.rooms.map(Ce),walls:n.walls,openCuts:n.openCuts,openings:i,openingHosts:r,openingGeometryPolicy:o,partitions:n.space.partitions,columns:n.space.wall_columns,cellCm:n.cellCm,gridPitch:n.gridPitch,wallKeyPitch:n.wallKeyPitch,camera:e,wallHeight:p,raisedHeight:g,floorEdgeHeight:m,algorithm:4})}`,build:()=>{n.onBuild();const a=c(n.space,n.cellCm,n.gridPitch,2e-4*n.gridPitch,n.partitionCuts()).all,s=n.roomOpenings(),l=n.walls.length||a.length?d(n.space.rooms,n.walls,n.openCuts,s,n.wallKeyPitch,n.cellCm,n.gridPitch,n.coordinateScale,a):null;if(l&&("failed-core"===l.status||"not-applicable"===l.status))throw new Error("wall boolean geometry failed");const m=l?.paperGeom??u(n.space.rooms,n.walls,n.openCuts,n.wallKeyPitch,n.cellCm,n.gridPitch,n.coordinateScale);if(!m)throw new Error("floor boolean geometry failed");const g=l?.openingIndex||h(n.space.rooms,n.walls,n.openCuts,n.wallKeyPitch,n.cellCm,n.gridPitch,n.coordinateScale),w=i.map((e,i)=>{const a=r[i],s="gate"===e.type?!e.flipV:e.flipV,l=a?a.face:n.walls.length||"gate"===e.type?f(g,{x:e.x,y:e.y,angle:e.angle,length:e.length,flip_v:s}):{ox:0,oy:0,cm:0,side:-1};return function(e,n=t,o=H){const i=e.face.cm??0;if(!F([e.x,e.y,e.angle,e.length,e.face.ox,e.face.oy,i,n])||!(e.length>0)||!(n>0)||-1!==e.face.side&&1!==e.face.side||i<0)throw new Error("invalid isometric opening input");const a=e.length/2,r=e.angle*Math.PI/180,s=T(Math.cos(r),Math.sin(r)),l=T(-Math.sin(r),Math.cos(r)),c=T(e.x,e.y),d=T(e.x-s[0]*a,e.y-s[1]*a),u=T(e.x+s[0]*a,e.y+s[1]*a),h=T(e.face.ox,e.face.oy),f=T(d[0]+h[0],d[1]+h[1]),p=T(u[0]+h[0],u[1]+h[1]),m=T(d[0]-h[0],d[1]-h[1]),g=T(u[0]-h[0],u[1]-h[1]),w=Object.freeze({center:c,tangent:s,normal:l,start:d,end:u}),y=Object.freeze({side:e.face.side,cm:i,depth:2*Math.hypot(e.face.ox,e.face.oy),offset:h,selectedStart:f,selectedEnd:p,oppositeStart:m,oppositeEnd:g}),v="passage"===e.type?[]:[Object.freeze({jamb:0,center:d,selected:f,opposite:m}),Object.freeze({jamb:1,center:u,selected:p,opposite:g})];let x;if("passage"===e.type)x=[];else if("gate"===e.type){const t=e.face.side*o.gateTurnDeg;x=[E(e,0,[-a,0],[a,0],t,0,n*o.gateTopRatio),E(e,1,[a,0],[-a,0],-t,0,n*o.gateTopRatio)]}else x="window"===e.type?[E(e,0,[-a,0],[a,0],-90,n*o.windowBottomRatio,n*o.windowTopRatio),E(e,1,[a,0],[-a,0],90,n*o.windowBottomRatio,n*o.windowTopRatio)]:[E(e,0,[-a,0],[e.length,0],-90,0,n*o.doorTopRatio)];return Object.freeze({id:e.id,sourceIndex:e.sourceIndex,type:e.type,wallHeight:n,leafThickness:n*o.leafThicknessRatio,frameThickness:n*o.frameThicknessRatio,axis:w,face:y,reveals:Object.freeze(v),leaves:Object.freeze(x.map(e=>Object.freeze({...e,hinge:T(e.hinge[0],e.hinge[1]),closedVector:T(e.closedVector[0],e.closedVector[1]),quarterVector:T(e.quarterVector[0],e.quarterVector[1])})))})}({...e,face:l},p,o)}),y=Object.freeze(w);return{walls:l?.components.flatMap(e=>e.geom)||[],floor:m,openings:y,openingSurfaces:Object.freeze(y.flatMap(t=>function(t,n=e){if("passage"===t.type)return Object.freeze([]);const o=[];if(t.face.depth>1e-9)for(const e of t.reveals)o.push(_("jamb-reveal","reveal",e.selected,e.opposite,0,t.wallHeight,n,{jamb:e.jamb}));if("window"!==t.type||!t.leaves.length)return Object.freeze(o.sort((e,t)=>e.depth-t.depth||e.kind.localeCompare(t.kind)||(e.jamb??0)-(t.jamb??0)));const i=Math.min(...t.leaves.map(e=>e.bottom)),a=Math.max(...t.leaves.map(e=>e.top)),r=Math.min(t.frameThickness,Math.hypot(t.axis.end[0]-t.axis.start[0],t.axis.end[1]-t.axis.start[1])/4,(a-i)/4),s=L(t.axis.start,G(t.axis.tangent,r)),l=V(t.axis.end,G(t.axis.tangent,r)),c=t.face.depth>1e-9?[t.face.offset,T(-t.face.offset[0],-t.face.offset[1])]:[t.face.offset];for(const e of c){const c=L(t.axis.start,e),d=L(t.axis.end,e),u=L(s,e),h=L(l,e);o.push(_("window-frame-side","light-frame",c,u,i,a,n,{jamb:0}),_("window-frame-side","light-frame",h,d,i,a,n,{jamb:1}),_("window-frame-top","light-frame",u,h,Math.max(i,a-r),a,n))}return t.face.depth>1e-9&&o.push(D("window-sill","light-sill",[{point:t.face.selectedStart,z:i},{point:t.face.selectedEnd,z:i},{point:t.face.oppositeEnd,z:i},{point:t.face.oppositeStart,z:i}],n)),Object.freeze(o.sort((e,t)=>e.depth-t.depth||e.kind.localeCompare(t.kind)||(e.jamb??0)-(t.jamb??0)))}(t).map(e=>Object.freeze({...e,id:t.id,sourceIndex:t.sourceIndex,type:t.type}))))}}}}const Oe=e=>Array.isArray(e)?e:[];function Ae(e,t){const o=e=>Oe(e).flatMap(e=>Array.isArray(e)&&Number.isFinite(e[0])&&Number.isFinite(e[1])?[n([Number(e[0]),Number(e[1])],t)]:[]);return Oe(e).flatMap(e=>{const t=Oe(e);if(!t.length)return[];const n=o(t[0]);if(n.length<3)return[];return[{outer:n,holes:t.slice(1).map(o).filter(e=>e.length>=3)}]})}function Be(o){const i=a(t,o.cellCm),r=a(s,o.cellCm),c=a(l,o.cellCm),d=S(o.cache,o.source.key);let u=d.hit?d.value:void 0;if(!u){const a=o.source.build(),s=function(o,i=e,a=t){if(!Number.isFinite(a)||a<0)throw new Error("invalid wall height");const r=[],s=[],l=[],c=[];let d=0;for(let e=0;e<(o||[]).length;e++){const t=o[e],u=[];let h=-1/0;for(let o=0;o<(t||[]).length;o++){const s=N(t[o],o>0);if(s.length<3||Math.abs(j(s))<1e-9)continue;const f=O(s,i,a);r.push(f),u.push(f),h=Math.max(h,...s.map(e=>n(e,a,i)[1])),d+=s.length;for(let t=0;t<s.length;t++){const r=s[t],d=s[(t+1)%s.length],u=n(r,0,i),h=n(d,0,i);if(c.push(`M ${C(u)} L ${C(h)}`),A(r,d,i)<=1e-9)continue;const f=n(d,a,i),p=n(r,a,i),m=Object.freeze([u,h,f,p]);l.push({d:`M ${m.map(C).join(" L ")} Z`,points:m,depth:Math.max(u[1],h[1]),polygon:e,ring:o,edge:t})}}u.length&&s.push({d:u.join(" "),depth:h,component:e})}return l.sort((e,t)=>e.depth-t.depth||e.polygon-t.polygon||e.ring-t.ring||e.edge-t.edge),s.sort((e,t)=>e.depth-t.depth||e.component-t.component),{topPath:r.join(" "),topFaces:s,sides:l,contactPath:c.join(" "),edgeCount:d}}(a.walls,e,i),l=Ae(a.walls,i);u={geometry:s,floor:B(a.floor,r),wallSilhouettes:Object.freeze([...l,...s.sides.map(e=>({outer:e.points}))]),openings:a.openings,openingSurfaces:a.openingSurfaces},$(o.cache,o.source.key,u,8)}const h=function(e){let t=1/0,n=1/0,o=-1/0,i=-1/0;const a=(e,a=0)=>{t=Math.min(t,e[0]-a),n=Math.min(n,e[1]-a),o=Math.max(o,e[0]+a),i=Math.max(i,e[1]+a)};for(const t of e)if("passage"!==t.type){a(t.axis.start),a(t.axis.end),a(t.face.selectedStart),a(t.face.selectedEnd),a(t.face.oppositeStart),a(t.face.oppositeEnd);for(const e of t.leaves){const n=Math.hypot(e.closedVector[0],e.closedVector[1])+t.leafThickness/2;a(e.hinge,n)}}return F([t,n,o,i])?{x:t,y:n,w:o-t,h:i-n}:null}(u.openings),f=h?Re(o.liveFrame,h):o.liveFrame,p=k({rect:f,wallHeight:i,openingHeight:i,floorDepth:r,raisedHeight:c});return{key:o.source.key,...u,frame:p}}const Re=(e,t)=>{const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y);return{x:n,y:o,w:Math.max(e.x+e.w,t.x+t.w)-n,h:Math.max(e.y+e.h,t.y+t.h)-o}},He=e=>{if(!e.length||!e.every(e=>Number.isFinite(e[0])&&Number.isFinite(e[1])))return null;const t=e.map(e=>e[0]),n=e.map(e=>e[1]),o=Math.min(...t),i=Math.min(...n);return{x:o,y:i,w:Math.max(...t)-o,h:Math.max(...n)-i}},Fe=(e,t)=>{const n=e.placement,o=t?n.visualScene:n.raisedScene,[i,a]=e.screenHalfSize,r=t?n.footprint:n.footprint.map(e=>[e[0]-n.nudgeScene[0],e[1]-n.nudgeScene[1]]);return[n.floorScene,...r,[o[0]-i,o[1]-a],[o[0]+i,o[1]-a],[o[0]+i,o[1]+a],[o[0]-i,o[1]+a]]},Te=(e,t)=>void 0===t?e:e.filter(e=>e.placement.owner?.id===t);function Le(e,t){return e?He(Te(e.entries,t).flatMap(e=>Fe(e,!0))):null}function Ve(e){const t=Te(e.entries,e.ownerId),n=He(t.flatMap(e=>Fe(e,!1))),o=n?Re(e.baseBounds,n):e.baseBounds,i=e.targetView(o);if(!(i&&i.w>0&&i.h>0&&[i.x,i.y,i.w,i.h].every(Number.isFinite)))return null;const a=e.stageSize;if(!(n&&a&&a.width>0&&a.height>0))return{bounds:o,view:i};const r=e=>Math.max(e.w/a.width,e.h/a.height),s=t=>{const o=48*t,i={x:n.x-o,y:n.y-o,w:n.w+2*o,h:n.h+2*o},a=Re(e.baseBounds,i),r=e.targetView(a);return r&&[r.x,r.y,r.w,r.h].every(Number.isFinite)&&r.w>0&&r.h>0?{bounds:a,view:r}:null};let l=0,c=Math.max(r(i),Number.EPSILON),d=s(c);for(let e=0;d&&r(d.view)>c*(1+1e-10)&&e<24;e++)l=c,c*=2,d=s(c);if(!d)return null;for(let e=0;e<40;e++){const e=(l+c)/2,t=s(e);if(!t)return null;r(t.view)<=e?(c=e,d=t):l=e}return d}const Ge=new WeakMap,We=2048,Ee=new WeakMap,qe=new WeakMap,De=new WeakMap;function _e(e,t){if(e.size!==t.size)return!1;for(const[n,o]of t)if(e.get(n)!==o)return!1;return!0}function Ue(e){const t=Ge.get(e.rooms);if(t)return t;const n=e.rooms.flatMap((e,t)=>{const n=w(e);return n&&n.length>=3?[{room:e,index:t,poly:n}]:[]}),o=Object.freeze(n.map(({room:e,index:t,poly:o})=>{const i=y(o,n.filter(e=>e.index!==t).map(e=>e.poly)),a={id:e.id||`room-index-${t}`,outer:o.map(e=>[e[0],e[1]]),holes:i.map(e=>e.map(e=>[e[0],e[1]]))};return{room:e,overlayRoom:{...a,safePoint:ie(a)||void 0}}}));return Ge.set(e.rooms,o),o}function Ke(o){const s=o.stageSize&&o.stageSize.width>0&&o.stageSize.height>0?Math.max(o.view.w/o.stageSize.width,o.view.h/o.stageSize.height):Math.max(o.view.w,o.view.h)/1e3,l=Ue(o.space),c=l.map(e=>e.overlayRoom),d=a(t,o.cellCm),u=a(i,o.cellCm),h=new Map,f=new Map,p=new Map,m=[];let g=Ee.get(o.wallSilhouettes);g||(g=new Map,Ee.set(o.wallSilhouettes,g));let w=qe.get(l);w||(w=new Map,qe.set(l,w));const y=o.iconPct*r(o.space)*o.kioskIconScale/100,v=o.deviceBasePct*r(o.space)*o.kioskIconScale/100,x=(a,r,l,h,f,p=!1)=>{const m=`${!1===o.resolveCollisions?"fit":"live"}\0${a}\0${r}`,y=[l[0],l[1],h[0],h[1],f||"",d,u,o.layers.shadows?1:0,p?1:0].join("|"),v=`${y}|${s}`,x=S(g,m);if(x.hit&&x.value.signature===v)return x.value.placement;if(x.hit&&x.value.shapeSignature===y&&s<=x.value.unitsPerPixel){const e=x.value.placement,t=e.nudgeDistanceCss*x.value.unitsPerPixel/s;if(!e.nearWallBefore||e.cleared&&t<=48)return e}const M=`${a}\0${r}`,b=[l[0],l[1],f||""].join("|"),k=S(w,M),z=k.hit&&k.value.signature===b?k.value.owner:ae({kind:a,floorAnchor:l,rooms:c,roomsValidated:!0,preferredRoomId:f});k.hit&&k.value.signature===b||$(w,M,{signature:b,owner:z},We);const P=function(o){const a=o.camera||e,r=o.wallHeight??t,s=o.visualOffset??i,l=o.sceneUnitsPerCssPixel??1,c=o.safetyGapCssPx??4,d=o.maxNudgeCssPx??48;if(!Z(o.floorAnchor)||!Z(o.footprintHalfSize)||o.footprintHalfSize[0]<0||o.footprintHalfSize[1]<0||!Number.isFinite(r)||r<0||!Number.isFinite(s)||s<0||!Number.isFinite(l)||l<=0||!Number.isFinite(c)||c<0||!Number.isFinite(d)||d<0)throw new Error("invalid isometric overlay input");const u=[o.floorAnchor[0],o.floorAnchor[1]],h=n(u,0,a),f=(p=o.kind,!o.showBorders||"device"!==p&&"room-label"!==p&&"opening-lock"!==p?"floor":"raised");var p;if("floor"===f)return{plane:f,owner:null,floorAnchor:u,floorScene:h,raisedScene:h,visualScene:h,footprint:[],nudgeScene:[0,0],nudgeCss:[0,0],nudgeDistanceCss:0,nudged:!1,nearWallBefore:!1,nearWallAfter:!1,cleared:!0,capped:!1,grounding:{center:h,visible:!1},tether:ye(h,h,!1),status:"ok",reason:null};const m=r+s,g=n(u,m,a),w=o.ownerAlreadyResolved?o.resolvedOwner??null:ae(o),y=o.wallGeometryValidated??o.wallSilhouettes.every(ge),v=c*l,x=re(u,o.footprintHalfSize,m,a),M=e=>{const t=ue(e);return!!t&&o.wallSilhouettes.some(n=>me(e,t,n,v,!0===o.wallGeometryValidated))},b=!y||M(x);let S=0,$=[0,0],k=null,z=!1,P=y?"ok":"degraded",I=y?null:"invalid-wall-geometry";if(y&&b)if(w)if(w.safePoint){const e=o.rooms.find(e=>e.id===w.id)||null,t=n(w.safePoint,m,a),i=t[0]-g[0],r=t[1]-g[1],s=Math.hypot(i,r);if(s<=K)P="degraded",I="invalid-safe-point";else{const t=i/s,n=r/s,a=Math.min(d,s/l),c=a*l/s,h=[u[0]+(w.safePoint[0]-u[0])*c,u[1]+(w.safePoint[1]-u[1])*c],f=[t*a*l,n*a*l],p=ue([...x,...x.map(e=>[e[0]+f[0],e[1]+f[1]])]),m=p?o.wallSilhouettes.filter(e=>{const t=he(e,!0===o.wallGeometryValidated);return!!t&&fe(p,t,v)}):o.wallSilhouettes,g=!!e&&we(u,h,e),y=e=>{const i=[t*e*l,n*e*l],a=x.map(e=>[e[0]+i[0],e[1]+i[1]]),r=ue(a);return!!r&&m.some(e=>me(a,r,e,v,!0===o.wallGeometryValidated))},M=o.nudgeHintCss;if(Number.isFinite(M)&&M>=0&&M<=a){const t=M*l/s,n=[u[0]+(w.safePoint[0]-u[0])*t,u[1]+(w.safePoint[1]-u[1])*t];(g||e&&we(u,n,e))&&!y(M)&&(S=M,k=!1)}if(null===k){let t=null,n=0,o=!1;const i=Math.ceil(a);for(let r=1;r<=i;r++){const i=Math.min(a,r),c=i*l/s,d=[u[0]+(w.safePoint[0]-u[0])*c,u[1]+(w.safePoint[1]-u[1])*c];if(!(g||e&&we(u,d,e))){o=!0;break}if(!y(i)){t=i;break}n=i}if(null!==t){let e=n,o=t;for(let t=0;t<14;t++){const t=(e+o)/2;y(t)?e=t:o=t}S=o}else S=n,z=!0,P="degraded",I=o?"owner-boundary":"nudge-cap"}$=[t*S*l,n*S*l]}}else P="degraded",I="invalid-safe-point";else P="degraded",I="missing-owner";const C=[g[0]+$[0],g[1]+$[1]],j=re(u,o.footprintHalfSize,m,a,$),N=!y||(k??M(j)),O=S>K,A=O||b||N||!!o.hovered||!!o.focused||!!o.selected;return{plane:f,owner:w,floorAnchor:u,floorScene:h,raisedScene:g,visualScene:C,footprint:j,nudgeScene:$,nudgeCss:[$[0]/l,$[1]/l],nudgeDistanceCss:S,nudged:O,nearWallBefore:b,nearWallAfter:N,cleared:!N,capped:z,grounding:{center:h,visible:!1!==o.filtersSupported},tether:ye(h,C,A),status:P,reason:I}}({kind:a,floorAnchor:l,rooms:c,roomsValidated:!0,preferredRoomId:f,ownerAlreadyResolved:!0,resolvedOwner:z,nudgeHintCss:x.hit&&x.value.shapeSignature===y?x.value.placement.nudgeDistanceCss*x.value.unitsPerPixel/s:void 0,showBorders:!0,wallSilhouettes:!1===o.resolveCollisions?[]:o.wallSilhouettes,wallGeometryValidated:!0,footprintHalfSize:h,wallHeight:d,visualOffset:u,sceneUnitsPerCssPixel:s,filtersSupported:o.layers.shadows,hovered:!0,selected:p});return $(g,m,{signature:v,shapeSignature:y,unitsPerPixel:s,placement:P},We),P};for(const e of o.devices){const t=o.positionOf(e),n=o.presentationOf(e,o.showLqi),i=v*n.scale,a=Pe({kind:"device",core:i,presentation:n}),r=e.marker?.room_id||l.find(t=>!!e.area&&t.room.area===e.area)?.overlayRoom.id||null,s=x("device",e.id,[t.x,t.y],a,r,o.selectedDeviceId===e.id);h.set(e.id,s),m.push({id:e.id,kind:"device",placement:s,groundRadius:Math.max(.32*i,2),screenHalfSize:a})}for(const{room:e,overlayRoom:t}of l){if(!o.display.showNames||!e.name)continue;const n=o.labelPositionOf(e,o.space.id),i=.5*y*(o.labelScaleOf(e)*o.kioskFontScale*o.display.cardFontScale),a=Pe({kind:"room-label",font:i,room:e,display:o.display}),r=x("room-label",t.id,[n.x,n.y],a,t.id,o.focusedRoomId===e.id);f.set(e,r),m.push({id:t.id,kind:"room-label",placement:r,groundRadius:Math.max(.75*i,2),screenHalfSize:a})}const M=o.openings.filter(e=>!e.orphanReason&&("door"===e.type||"gate"===e.type)&&"string"==typeof e.lock&&!!e.lock&&o.openingEntityAvailable(e.lock));if(M.length){const e=o.openingWallIndex();for(const t of M){const n=Je(t,e,o.cellCm),i=n.floorAnchor,a=.62*y,r=Pe({kind:"opening-lock",size:a}),s=x("opening-lock",String(t.id),i,r,n.preferredRoomId,o.selectedOpeningId===t.id);p.set(String(t.id),s),m.push({id:String(t.id),kind:"opening-lock",placement:s,groundRadius:Math.max(.28*a,2),screenHalfSize:r})}}const b={devices:h,rooms:f,locks:p,entries:Object.freeze(m)},k=!1===o.resolveCollisions?"fit":"live";let z=De.get(o.wallSilhouettes);z||(z=new Map,De.set(o.wallSilhouettes,z));const P=z.get(k);return P&&function(e,t){return e.length===t.length&&t.every((t,n)=>{const o=e[n];return o.id===t.id&&o.kind===t.kind&&o.placement===t.placement&&o.groundRadius===t.groundRadius&&o.screenHalfSize[0]===t.screenHalfSize[0]&&o.screenHalfSize[1]===t.screenHalfSize[1]})}(P.entries,b.entries)&&_e(P.devices,b.devices)&&_e(P.rooms,b.rooms)&&_e(P.locks,b.locks)?P:(z.set(k,b),b)}function Ze(e,t,n){return Je(e,t,n).floorAnchor}function Je(e,t,n){const o=!e.flip_v,i="gate"===e.type?e.partitionHost?p(e.partitionHost,o):f(t,{x:e.rx,y:e.ry,angle:e.angle,length:e.rlen,flip_v:o}):null,[a,r]=m({x:e.rx,y:e.ry,angle:e.angle,flipV:!!e.flip_v,gateFace:i},n);if(e.partitionHost)return{floorAnchor:a,preferredRoomId:null};const s=g(t,{x:e.rx,y:e.ry,angle:e.angle,length:e.rlen},!0),l=r?"negative":"positive";return{floorAnchor:a,preferredRoomId:s[l]?.roomId||null}}function Qe(e){let t=!1;try{t="undefined"!=typeof CSS&&"function"==typeof CSS.supports&&CSS.supports("filter","blur(1px)")}catch{t=!1}let n=!1;try{n="function"==typeof matchMedia&&matchMedia("(forced-colors: active)").matches}catch{n=!0}return function(e){const t=!!e.showBorders;return{structural:t,panels:t&&!e.hideOpenings,shadows:t&&e.filtersSupported&&!e.forcedColors,materialNuance:t&&e.filtersSupported&&!e.forcedColors,floorSymbols:!e.hideOpenings&&!t}}({showBorders:e.showBorders,hideOpenings:e.hideOpenings,filtersSupported:t,forcedColors:n})}function Xe(e,t,n,o){if(!e.panels||!t)return[];return t.openings.flatMap(e=>{const t=n[e.sourceIndex];return t?U(e,o(t)):[]}).sort((e,t)=>e.depth-t.depth||e.sourceIndex-t.sourceIndex||e.leaf-t.leaf)}function Ye(e){const t=Qe(e.display),n=t.panels?Xe(t,e.scene,e.openings,e.amountOf):[],o=e.overlays(t),i=t=>({layers:t,panels:n,overlays:o,underlay:at(t,e.scene?.floor,e.cellCm),shadows:rt(t,n,e.scene?.geometry,e.cellCm),walls:st(e.projection,t,e.scene,n,e.cellCm),grounds:ot(o,t,e.cellCm),raised:it(o)});try{return i(t)}catch(e){if(!t.shadows&&!t.materialNuance)throw e;return i({...t,shadows:!1,materialNuance:!1})}}const et=()=>b``;function tt(e){return`translate(${a(4,e)} ${a(8,e)})`}function nt(e,t,n){const o=P(n);return b`<defs>
${"walls"===t&&e.materialNuance?b`
<linearGradient id="hp-iso-wall-side" data-hp-iso-material-def x1="0" y1="0" x2="0" y2="1">
<stop offset="0" class="iso-side-hi"></stop><stop offset="1" class="iso-side-lo"></stop>
</linearGradient>
<linearGradient id="hp-iso-wall-top" data-hp-iso-material-def x1="0" y1="0" x2="1" y2="1">
<stop offset="0" class="iso-top-hi"></stop><stop offset="1" class="iso-top-lo"></stop>
</linearGradient>
<pattern id="hp-iso-wall-texture" data-hp-iso-material-def patternUnits="userSpaceOnUse"
width="${12*o}" height="${12*o}">
<circle class="iso-texture-mark" cx="${2*o}" cy="${2*o}"
r="${.55*o}"></circle>
<path class="iso-texture-line" d="M ${5*o} ${10*o}
l ${5*o} ${-5*o}"></path>
</pattern>`:M}
${"underlay"===t&&e.materialNuance?b`
<pattern id="hp-iso-floor-texture" data-hp-iso-material-def patternUnits="userSpaceOnUse"
width="${14*o}" height="${14*o}">
<circle class="iso-texture-mark" cx="${3*o}" cy="${3*o}"
r="${.5*o}"></circle>
</pattern>`:M}
${"underlay"===t&&e.shadows?b`
<filter id="hp-iso-ambient-shadow" data-hp-iso-material-def x="-12%" y="-12%" width="124%" height="130%">
<feGaussianBlur stdDeviation="${7*o}"></feGaussianBlur>
</filter>`:M}
${"shadows"===t&&e.shadows?b`
<filter id="hp-iso-contact-shadow" data-hp-iso-material-def x="-8%" y="-20%" width="116%" height="140%">
<feGaussianBlur stdDeviation="${2.5*o}"></feGaussianBlur>
</filter>
<filter id="hp-iso-leaf-shadow" data-hp-iso-material-def x="-12%" y="-30%" width="124%" height="160%">
<feGaussianBlur stdDeviation="${2*o}"></feGaussianBlur>
</filter>`:M}
${"overlays"===t&&e.shadows?b`
<filter id="hp-iso-overlay-ground" data-hp-iso-material-def x="-45%" y="-80%" width="190%" height="260%">
<feGaussianBlur stdDeviation="${3*o}"></feGaussianBlur>
</filter>`:M}
</defs>`}function ot(e,t,n){if(!e)return et();const o=e.entries.map(e=>{const t=e.placement.grounding;return`${e.kind}\0${e.id}\0${t.center[0]}\0${t.center[1]}\0${t.visible?1:0}\0${e.groundRadius}`}).join("");return I([o,t.shadows,n],()=>b`
${nt(t,"overlays",n)}
<g class="iso-overlay-grounds" data-hp="iso-overlay-grounds"
aria-hidden="true" pointer-events="none">${e.entries.map(e=>{if(!t.shadows||!e.placement.grounding.visible)return M;const[o,i]=e.placement.grounding.center;return b`<ellipse class="iso-overlay-ground"
data-hp-iso-overlay-kind=${e.kind} data-id=${e.id}
cx=${o} cy=${i} rx=${e.groundRadius} ry=${Math.max(1,.32*e.groundRadius)}
transform=${tt(n)}></ellipse>`})}</g>`)}function it(e){return e?I([e],()=>b`
<g class="iso-raised-overlays" data-hp="iso-raised-overlays"
aria-hidden="true" pointer-events="none">
<g class="iso-overlay-tethers">${e.entries.map(e=>{const t=e.placement.tether;return t.visible?b`<line class="iso-overlay-tether"
data-hp-iso-overlay-kind=${e.kind} data-id=${e.id}
x1=${t.from[0]} y1=${t.from[1]}
x2=${t.to[0]} y2=${t.to[1]}></line>`:M})}</g>
</g>`):et()}function at(e,t,n){return e.structural&&t?b`<g class="iso-underlay" data-hp="iso-underlay" aria-hidden="true" pointer-events="none">
${nt(e,"underlay",n)}
${e.shadows&&t.footprintPath?b`<path class="iso-ambient-shadow" d=${t.footprintPath}
transform=${tt(n)}></path>`:M}
<g class="iso-floor-edge">${t.sides.map(t=>b`<path class="iso-floor-side" d=${t.d} data-component=${t.component}
data-edge=${t.edge}></path>${e.materialNuance?b`<path class="iso-material-texture iso-floor-texture" d=${t.d}></path>`:M}`)}</g>
</g>`:et()}function rt(e,t,n,o){return e.shadows&&n?b`<g class="iso-shadows" data-hp="iso-shadows" aria-hidden="true" pointer-events="none">
${nt(e,"shadows",o)}
<path class="iso-contact-shadow" d=${n.contactPath}
transform=${tt(o)}></path>
<g class="iso-leaf-shadows">${t.map(e=>b`<path class="iso-leaf-shadow" d=${e.shadowD}
data-id=${e.id} data-leaf=${e.leaf}
transform=${tt(o)}></path>`)}</g>
</g>`:et()}function st(e,t,n,o,i){if("iso"!==e||!t.structural||!n)return et();const a=t.panels?[...n.openingSurfaces,...o.flatMap(e=>e.surfaces.map(t=>({...t,id:e.id,sourceIndex:e.sourceIndex,type:e.type,leaf:e.leaf})))]:[],r=be(n.geometry,a);return b`<g class="iso-walls" data-hp="iso-walls" data-fingerprint=${n.key}>
${nt(t,"walls",i)}
<g class=${t.panels?"iso-wall-depth-queue iso-openings":"iso-wall-depth-queue"}
data-hp=${t.panels?"iso-openings":M}
aria-hidden="true" pointer-events="none">${r.map(e=>{if("wall-side"===e.layer){const n=e.face;return b`<path class="iso-wall-side" d=${n.d} data-edge=${n.edge}></path>${t.materialNuance?b`<path class="iso-material-texture iso-wall-texture" d=${n.d}></path>`:M}`}if("wall-top"===e.layer){const n=e.face;return b`<path class="iso-wall-top" d=${n.d} data-component=${n.component}
fill-rule="evenodd"></path>${t.materialNuance?b`<path class="iso-material-texture iso-wall-texture" d=${n.d}
fill-rule="evenodd"></path>`:M}`}const n=e.surface;return b`<path class="iso-opening-panel iso-${n.type} iso-opening-${n.kind} iso-material-${n.material}"
d=${n.d} data-id=${n.id} data-kind=${n.type}
data-surface=${n.kind} data-leaf=${n.leaf??M}></path>${t.materialNuance?b`<path class="iso-material-texture iso-wall-texture iso-opening-texture"
d=${n.d}></path>`:M}`})}</g>
</g>`}export{We as ISO_OVERLAY_PLACEMENT_CACHE_LIMIT,Se as ISO_RAISED_FOOTPRINT,ve as ISO_SCENE_RUNTIME_FINGERPRINT,Ke as buildIsoOverlayRenderScene,be as buildIsoWallDepthQueue,Ne as createIsoStructuralSource,tt as isoFixedLightTransform,Ze as isoOpeningLockAnchor,Je as isoOpeningLockPlacement,Ue as isoOverlayRooms,Le as isoOverlaySceneBounds,Pe as isoRaisedOverlayHalfSize,Ie as isoSourceOpenings,je as isoStructuralOpeningHost,Ce as isoStructuralRoomGeometry,Ae as isoWallSilhouettesOf,ot as renderIsoOverlayGrounds,it as renderIsoRaisedOverlays,rt as renderIsoShadows,at as renderIsoUnderlay,st as renderIsoWalls,Qe as resolveIsoDecorationLayers,Ye as resolveIsoFramePresentation,Xe as resolveIsoOpeningPanels,Ve as resolveIsoOverlayFitEnvelope,Be as resolveIsoScene};