perf: coarse lattice with refinement for isometric overlay placement (#583)

Разрешение коллизий 2.5D-подписей сканировало диск смещений с шагом 1 px и
для каждого кандидата спрашивало пространственный хэш и все стены. Замер
показал: на large-house-isometric-v1 580 размещений дают 2 523 652 смещения и
1 742 740 проверок отпечатка против стен, 98 % позиций отвергают стены.

Поиск переведён на решётку 4 px с уточнением 1 px вокруг найденного места
(и вокруг лучшего конфликтующего кандидата — без второго уточнения качество
разрешения падало с 308 до 304). Дешёвая часть кандидата (позиция, габариты,
конфликты, штраф) отделена от дорогой (комната-владелец, непрерывность
сегмента, зазор до стены); соседи считаются один раз на элемент; расстояния
таблицы смещений предвычислены; добавлены AABB комнаты-владельца и широкая
фаза по стенам.

Групповой проход 9584 → 839 мс, смещений 2 523 652 → 157 618, разрешено
308 / остаток 272 — как до правки.

Issue: #583
User-Visible: no
This commit is contained in:
Codex
2026-09-16 13:58:31 +03:00
parent 1734b077af
commit 699ab4710f
43 changed files with 608 additions and 430 deletions
@@ -1,85 +1,85 @@
{ {
"schema": 1, "schema": 1,
"fingerprint": "7d7d634b457de395f9087a171ae19ae5dd8b29cc2205221a8a00fca7156f6d71", "fingerprint": "e53b30c3c9da873ce146ad9277e308d6d94c0a64db834549c64230709021da6a",
"entry": "houseplan-card.js", "entry": "houseplan-card.js",
"panelEntry": "houseplan-panel.js", "panelEntry": "houseplan-panel.js",
"initialViewFiles": [ "initialViewFiles": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js", "houseplan-assets/houseplan-card-BwHO54W5.js",
"houseplan-card.js" "houseplan-card.js"
], ],
"initialViewGzipBytes": 291129, "initialViewGzipBytes": 291138,
"initialPanelFiles": [ "initialPanelFiles": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js", "houseplan-assets/houseplan-card-BwHO54W5.js",
"houseplan-panel.js" "houseplan-panel.js"
], ],
"initialPanelGzipBytes": 292652, "initialPanelGzipBytes": 292660,
"initialPanelOnlyFiles": [ "initialPanelOnlyFiles": [
"houseplan-panel.js" "houseplan-panel.js"
], ],
"initialPanelOnlyGzipBytes": 2326, "initialPanelOnlyGzipBytes": 2326,
"lazyFiles": [ "lazyFiles": [
"houseplan-assets/backdrop-pick-DbyFaYLE.js", "houseplan-assets/backdrop-pick-DXffOhAn.js",
"houseplan-assets/de-DwFh4Zlz.js", "houseplan-assets/de-D4BpWNDy.js",
"houseplan-assets/editor-C-R6yR6G.js", "houseplan-assets/editor-BNVcLBBu.js",
"houseplan-assets/fr-CuvaeWk1.js", "houseplan-assets/fr-BJE0dTJm.js",
"houseplan-assets/furniture-plan-art.generated-Dr2RUG6n.js", "houseplan-assets/furniture-plan-art.generated-cW4HByhl.js",
"houseplan-assets/houseplan-editor-runtime-BqW4n1Mh.js", "houseplan-assets/houseplan-editor-runtime-CIM3i2ZV.js",
"houseplan-assets/houseplan-onboarding-runtime-mDugU-dp.js", "houseplan-assets/houseplan-onboarding-runtime-DOiipnz2.js",
"houseplan-assets/hp-zigbee-topology-overlay-ArwNWgj8.js", "houseplan-assets/hp-zigbee-topology-overlay-BTNPYjHN.js",
"houseplan-assets/iso-scene-render-Dt8oursx.js", "houseplan-assets/iso-scene-render-D-wmXl79.js",
"houseplan-assets/live-interaction-runtime-BUeJnHZE.js", "houseplan-assets/live-interaction-runtime-DAKGAehV.js",
"houseplan-assets/pdf-export-DO8y2Ak4.js", "houseplan-assets/pdf-export-oUY5NKUF.js",
"houseplan-assets/summary-panel-runtime-loaded-BygdaMYA.js", "houseplan-assets/summary-panel-runtime-loaded-CMPY7SjL.js",
"houseplan-assets/zigbee-topology-runtime-DllensXq.js", "houseplan-assets/zigbee-topology-DjOib68n.js",
"houseplan-assets/zigbee-topology-u3KR6JXs.js" "houseplan-assets/zigbee-topology-runtime--t4EFNT8.js"
], ],
"lazyGzipBytes": 420096, "lazyGzipBytes": 420564,
"lazyEditorFiles": [ "lazyEditorFiles": [
"houseplan-assets/backdrop-pick-DbyFaYLE.js", "houseplan-assets/backdrop-pick-DXffOhAn.js",
"houseplan-assets/editor-C-R6yR6G.js", "houseplan-assets/editor-BNVcLBBu.js",
"houseplan-assets/furniture-plan-art.generated-Dr2RUG6n.js", "houseplan-assets/furniture-plan-art.generated-cW4HByhl.js",
"houseplan-assets/houseplan-editor-runtime-BqW4n1Mh.js", "houseplan-assets/houseplan-editor-runtime-CIM3i2ZV.js",
"houseplan-assets/zigbee-topology-u3KR6JXs.js" "houseplan-assets/zigbee-topology-DjOib68n.js"
], ],
"lazyEditorGzipBytes": 204956, "lazyEditorGzipBytes": 204959,
"lazyOnboardingFiles": [ "lazyOnboardingFiles": [
"houseplan-assets/backdrop-pick-DbyFaYLE.js", "houseplan-assets/backdrop-pick-DXffOhAn.js",
"houseplan-assets/houseplan-onboarding-runtime-mDugU-dp.js" "houseplan-assets/houseplan-onboarding-runtime-DOiipnz2.js"
], ],
"lazyOnboardingGzipBytes": 13917, "lazyOnboardingGzipBytes": 13918,
"lazyLocaleFiles": [ "lazyLocaleFiles": [
"houseplan-assets/de-DwFh4Zlz.js", "houseplan-assets/de-D4BpWNDy.js",
"houseplan-assets/fr-CuvaeWk1.js" "houseplan-assets/fr-BJE0dTJm.js"
], ],
"lazyLocaleGzipBytes": 54926, "lazyLocaleGzipBytes": 54929,
"lazyIsometricFiles": [ "lazyIsometricFiles": [
"houseplan-assets/iso-scene-render-Dt8oursx.js" "houseplan-assets/iso-scene-render-D-wmXl79.js"
], ],
"lazyIsometricGzipBytes": 14559, "lazyIsometricGzipBytes": 15018,
"lazyFurnitureArtFiles": [ "lazyFurnitureArtFiles": [
"houseplan-assets/furniture-plan-art.generated-Dr2RUG6n.js" "houseplan-assets/furniture-plan-art.generated-cW4HByhl.js"
], ],
"lazyFurnitureArtGzipBytes": 10252, "lazyFurnitureArtGzipBytes": 10250,
"lazyPdfFiles": [ "lazyPdfFiles": [
"houseplan-assets/furniture-plan-art.generated-Dr2RUG6n.js", "houseplan-assets/furniture-plan-art.generated-cW4HByhl.js",
"houseplan-assets/pdf-export-DO8y2Ak4.js" "houseplan-assets/pdf-export-oUY5NKUF.js"
], ],
"lazyPdfGzipBytes": 120123, "lazyPdfGzipBytes": 120121,
"files": [ "files": [
{ {
"path": "houseplan-assets/backdrop-pick-DbyFaYLE.js", "path": "houseplan-assets/backdrop-pick-DXffOhAn.js",
"sha256": "b9176e22bcde92ffb030a413d1b2aab5ea7b81038ca2ecdc366864268cbf2549", "sha256": "249badc55a32ae56641235d0dce08e41730b04dddec89a7dc048b36ac1d78c5d",
"rawBytes": 19956, "rawBytes": 19956,
"gzipBytes": 6880, "gzipBytes": 6880,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/de-DwFh4Zlz.js", "path": "houseplan-assets/de-D4BpWNDy.js",
"sha256": "5d94409c511d2282566e83dcb9864843491ad64d98d61216c7212d6624f73ac7", "sha256": "c45514f0a4ae9eddba7bae5b9397d4f345ea68b7f5f43f3a733dbd8334a608d5",
"rawBytes": 91590, "rawBytes": 91590,
"gzipBytes": 27746, "gzipBytes": 27746,
"isEntry": false, "isEntry": false,
@@ -87,209 +87,209 @@
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/editor-C-R6yR6G.js", "path": "houseplan-assets/editor-BNVcLBBu.js",
"sha256": "8391bb505f445b7e2c33ddcc63fab215ce9ff3ef9cab8cf4aab6d42faadb3ec3", "sha256": "1a9b16c32b4b0b39ba2873be681a5b1da41d2fb112a5558176620c45bdabeb1c",
"rawBytes": 3831, "rawBytes": 3831,
"gzipBytes": 1584, "gzipBytes": 1584,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/fr-CuvaeWk1.js", "path": "houseplan-assets/fr-BJE0dTJm.js",
"sha256": "c4759a1c6705b918be0d0f19c57cced49539a5aaf431f659400d2d450622d696", "sha256": "e3d2928826088af1e27cf08117a4059c430405493b3dfb687fd161ba3c4e56a8",
"rawBytes": 93884, "rawBytes": 93884,
"gzipBytes": 27180, "gzipBytes": 27183,
"isEntry": false, "isEntry": false,
"imports": [], "imports": [],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/furniture-plan-art.generated-Dr2RUG6n.js", "path": "houseplan-assets/furniture-plan-art.generated-cW4HByhl.js",
"sha256": "6097cccb755c81f5b34165a3b5575ab262f61f7e6aef661d611391209e65000d", "sha256": "282afdec3e439d50c55897ed671bb7d5e1a759950009fa76f83d542f23e07175",
"rawBytes": 33655, "rawBytes": 33655,
"gzipBytes": 10252, "gzipBytes": 10250,
"isEntry": false, "isEntry": false,
"imports": [], "imports": [],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/houseplan-card-DRCzjIQ2.js", "path": "houseplan-assets/houseplan-card-BwHO54W5.js",
"sha256": "0f679dcb32991b7ca5d1ba28230ee6fcbe1caf33d87fe5f925307c42044744ce", "sha256": "ad1bb0033b49a8c669aaee816ecca1e830d6e17b6706dd63db26692ae62afae3",
"rawBytes": 1034007, "rawBytes": 1034007,
"gzipBytes": 290326, "gzipBytes": 290334,
"isEntry": false, "isEntry": false,
"imports": [], "imports": [],
"dynamicImports": [ "dynamicImports": [
"houseplan-assets/de-DwFh4Zlz.js", "houseplan-assets/de-D4BpWNDy.js",
"houseplan-assets/editor-C-R6yR6G.js", "houseplan-assets/editor-BNVcLBBu.js",
"houseplan-assets/fr-CuvaeWk1.js", "houseplan-assets/fr-BJE0dTJm.js",
"houseplan-assets/furniture-plan-art.generated-Dr2RUG6n.js", "houseplan-assets/furniture-plan-art.generated-cW4HByhl.js",
"houseplan-assets/houseplan-editor-runtime-BqW4n1Mh.js", "houseplan-assets/houseplan-editor-runtime-CIM3i2ZV.js",
"houseplan-assets/houseplan-onboarding-runtime-mDugU-dp.js", "houseplan-assets/houseplan-onboarding-runtime-DOiipnz2.js",
"houseplan-assets/hp-zigbee-topology-overlay-ArwNWgj8.js", "houseplan-assets/hp-zigbee-topology-overlay-BTNPYjHN.js",
"houseplan-assets/iso-scene-render-Dt8oursx.js", "houseplan-assets/iso-scene-render-D-wmXl79.js",
"houseplan-assets/live-interaction-runtime-BUeJnHZE.js", "houseplan-assets/live-interaction-runtime-DAKGAehV.js",
"houseplan-assets/pdf-export-DO8y2Ak4.js", "houseplan-assets/pdf-export-oUY5NKUF.js",
"houseplan-assets/summary-panel-runtime-loaded-BygdaMYA.js" "houseplan-assets/summary-panel-runtime-loaded-CMPY7SjL.js"
] ]
}, },
{ {
"path": "houseplan-assets/houseplan-editor-runtime-BqW4n1Mh.js", "path": "houseplan-assets/houseplan-editor-runtime-CIM3i2ZV.js",
"sha256": "64c7b1ef7f336f3dfb17538731de32ba2da714dfc8d31bfda29f140173382b81", "sha256": "f083e7922ada296e4c9f9007c25ed1cdba8984c012bc59cf4713f60c5b23cade",
"rawBytes": 670150, "rawBytes": 670150,
"gzipBytes": 178814, "gzipBytes": 178814,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/backdrop-pick-DbyFaYLE.js", "houseplan-assets/backdrop-pick-DXffOhAn.js",
"houseplan-assets/furniture-plan-art.generated-Dr2RUG6n.js", "houseplan-assets/furniture-plan-art.generated-cW4HByhl.js",
"houseplan-assets/houseplan-card-DRCzjIQ2.js", "houseplan-assets/houseplan-card-BwHO54W5.js",
"houseplan-assets/zigbee-topology-u3KR6JXs.js" "houseplan-assets/zigbee-topology-DjOib68n.js"
], ],
"dynamicImports": [ "dynamicImports": [
"houseplan-assets/zigbee-topology-runtime-DllensXq.js" "houseplan-assets/zigbee-topology-runtime--t4EFNT8.js"
] ]
}, },
{ {
"path": "houseplan-assets/houseplan-onboarding-runtime-mDugU-dp.js", "path": "houseplan-assets/houseplan-onboarding-runtime-DOiipnz2.js",
"sha256": "2cefe30f30eca8af5be06a4d2df8dcf0c68486b44ca3c09d0256ff103135629b", "sha256": "0824591f0ce857978622c44a402ea6d5ceb80b975fec41cc46a256cfb1f0132a",
"rawBytes": 28287, "rawBytes": 28287,
"gzipBytes": 7037, "gzipBytes": 7038,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/backdrop-pick-DbyFaYLE.js", "houseplan-assets/backdrop-pick-DXffOhAn.js",
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/hp-zigbee-topology-overlay-ArwNWgj8.js", "path": "houseplan-assets/hp-zigbee-topology-overlay-BTNPYjHN.js",
"sha256": "c9d99e6bebe0c74169f6435b28d684c3f5e5ef8317254ee973cf4c2356eb6581", "sha256": "382900eacb3681742c0df824faac38a67b65276a7ac82ce87739aabd78b77c61",
"rawBytes": 10756, "rawBytes": 10756,
"gzipBytes": 3686, "gzipBytes": 3685,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js", "houseplan-assets/houseplan-card-BwHO54W5.js",
"houseplan-assets/zigbee-topology-runtime-DllensXq.js", "houseplan-assets/zigbee-topology-DjOib68n.js",
"houseplan-assets/zigbee-topology-u3KR6JXs.js" "houseplan-assets/zigbee-topology-runtime--t4EFNT8.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/iso-scene-render-Dt8oursx.js", "path": "houseplan-assets/iso-scene-render-D-wmXl79.js",
"sha256": "97b53f863be0e307bf38e3eea6104d79badeb58305655ef6b8ee343a9a6691f8", "sha256": "8eba7f629dfabe1a19544f65f4c8249eb0619c953bebd9fc45cb1f206a967793",
"rawBytes": 43068, "rawBytes": 44439,
"gzipBytes": 14559, "gzipBytes": 15018,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/live-interaction-runtime-BUeJnHZE.js", "path": "houseplan-assets/live-interaction-runtime-DAKGAehV.js",
"sha256": "48a5d8ab0205d3486c76a8bcd0981e82527d594112b785a44640cd8e96d56c1d", "sha256": "c57f884603150f2974f4fcb4f7fc5e8c6500cfa52b884f44ba76d16ab7f7a3d0",
"rawBytes": 8216, "rawBytes": 8216,
"gzipBytes": 3208, "gzipBytes": 3210,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/pdf-export-DO8y2Ak4.js", "path": "houseplan-assets/pdf-export-oUY5NKUF.js",
"sha256": "918018391821663424449b3c27263e1f30a453d089be7b5be8c14c165a815a9b", "sha256": "db70fc8198a4b0bdea53c955f100c1402d7c2602f88b4891f6f2c15d2fea0997",
"rawBytes": 236244, "rawBytes": 236244,
"gzipBytes": 109871, "gzipBytes": 109871,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/furniture-plan-art.generated-Dr2RUG6n.js", "houseplan-assets/furniture-plan-art.generated-cW4HByhl.js",
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/summary-panel-editor-Czf4K6I2.js", "path": "houseplan-assets/summary-panel-editor-9y_8uX0J.js",
"sha256": "df0ad6d7c8889ff33a8c7a0c5cd4d361ea7e65ad6c308cf97e412950621167dc", "sha256": "1dbdda18dafb8126e7ad120bdde703d56f11980f03ef31505f9593fbd30cdeee",
"rawBytes": 14824, "rawBytes": 14824,
"gzipBytes": 3402, "gzipBytes": 3404,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js", "houseplan-assets/houseplan-card-BwHO54W5.js",
"houseplan-assets/summary-panel-runtime-loaded-BygdaMYA.js" "houseplan-assets/summary-panel-runtime-loaded-CMPY7SjL.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/summary-panel-metrics-Dnp7gxnE.js", "path": "houseplan-assets/summary-panel-metrics-BHdOTChW.js",
"sha256": "9a4ded0910d0b555e38c2610a07b1a0c9bd1abe8594dde39f333dce9382b50ad", "sha256": "5856c494ff89cd875b9c395fba5bf30458e349ec384c7396502f4cdf3a57330a",
"rawBytes": 2610, "rawBytes": 2610,
"gzipBytes": 1308, "gzipBytes": 1307,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/summary-panel-runtime-loaded-BygdaMYA.js", "path": "houseplan-assets/summary-panel-runtime-loaded-CMPY7SjL.js",
"sha256": "f166ae677dfa80fffa5a39e7232a717da27ce8e2c2dd4e60af61b9eed516c075", "sha256": "49f5ae6480a6b59f60845aa4056e25a26dcad9d5c35135b8d4a6f1171c8b735f",
"rawBytes": 73366, "rawBytes": 73366,
"gzipBytes": 20087, "gzipBytes": 20089,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js"
], ],
"dynamicImports": [ "dynamicImports": [
"houseplan-assets/summary-panel-editor-Czf4K6I2.js", "houseplan-assets/summary-panel-editor-9y_8uX0J.js",
"houseplan-assets/summary-panel-metrics-Dnp7gxnE.js" "houseplan-assets/summary-panel-metrics-BHdOTChW.js"
] ]
}, },
{ {
"path": "houseplan-assets/zigbee-topology-runtime-DllensXq.js", "path": "houseplan-assets/zigbee-topology-DjOib68n.js",
"sha256": "946c4412328db049a1d17b31705de1a56c4e6580f2afc3aabdaa031c82937661", "sha256": "1d90800f37c0563399f580dc866a6d41db3c85d8022ea2cd89b0268cd1c6499e",
"rawBytes": 3941, "rawBytes": 18961,
"gzipBytes": 1766, "gzipBytes": 7431,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js", "houseplan-assets/houseplan-card-BwHO54W5.js"
"houseplan-assets/zigbee-topology-u3KR6JXs.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/zigbee-topology-u3KR6JXs.js", "path": "houseplan-assets/zigbee-topology-runtime--t4EFNT8.js",
"sha256": "573f48bb39a64259efc58ecbda9f302383713d9e086e7bb83ab15bf50b0a4cdc", "sha256": "999564c9fbe6af24d3afaaf9ec74cf963a2c12f32567e4415f0bcdb7a3cd0e55",
"rawBytes": 18961, "rawBytes": 3941,
"gzipBytes": 7426, "gzipBytes": 1765,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js",
"houseplan-assets/zigbee-topology-DjOib68n.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-card.js", "path": "houseplan-card.js",
"sha256": "aad009aa3d40e8db0faa474392dc543a7cc7fde547ac70e73aee5f1d2fe778fe", "sha256": "fb415bf838d5f63f674a7fa1a2110393e0808d4ac249882396c9a371232ea55b",
"rawBytes": 1205, "rawBytes": 1205,
"gzipBytes": 803, "gzipBytes": 804,
"isEntry": true, "isEntry": true,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-panel.js", "path": "houseplan-panel.js",
"sha256": "37c40ba5b21f8e1ad1c3ac8f2fa72d138246e8d62fe21418658a09ce7973211d", "sha256": "cd9a9dd3f8a1b92e0363695b424bbb93614f3be1aae614751b82872d5c96e55e",
"rawBytes": 6165, "rawBytes": 6165,
"gzipBytes": 2326, "gzipBytes": 2326,
"isEntry": true, "isEntry": true,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js"
], ],
"dynamicImports": [] "dynamicImports": []
} }
@@ -1,14 +1,14 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="7d7d634b457de395f9087a171ae19ae5dd8b29cc2205221a8a00fca7156f6d71";import{q as e,l as o,v as t,e5 as s,A as a,e6 as i,e7 as l,e8 as n,E as r,c}from"./houseplan-card-DRCzjIQ2.js";class h extends e{constructor(){super(...arguments),this._spaces=null,this._spacesLoading=!1,this._spacesAuthoritative=!1}setConfig(e){this._config=e}async _loadSpaces(){if(!this._spaces&&!this._spacesLoading&&this.hass){this._spacesLoading=!0;try{const e=await this.hass.callWS({type:"houseplan/config/get"});this._spaces=(e?.config?.spaces||[]).map(e=>({value:e.id,label:e.title||e.id})),this._spacesAuthoritative=!0}catch{this._spaces=[],this._spacesAuthoritative=!1}finally{this._spacesLoading=!1}}}get _lang(){return o(this.hass,this._config?.language)}get _floorToken(){const e=this._config?.floor;return"number"==typeof e?`__houseplan_yaml_floor_index__:${String(e)}`:null}get _formData(){const e={...this._config},o=this._floorToken;return o?e.floor=o:Object.prototype.hasOwnProperty.call(e,"floor")||(e.floor=""),e}get _schema(){const e=this._spaces||[],o=this._lang,a=[{value:"",label:t(o,"editor.floor_none")}],i=this._floorToken;i&&a.push({value:i,label:t(o,"editor.floor_index",{index:String(this._config?.floor)})});const l="string"==typeof this._config?.floor?this._config.floor:"";l&&!e.some(e=>e.value===l)&&a.push({value:l,label:l}),a.push(...e);const n="string"==typeof this._config?.default_floor?this._config.default_floor:"",r=[...e];return n&&!e.some(e=>e.value===n)&&r.unshift({value:n,label:n}),[{name:"title",selector:{text:{}}},{name:"floor",selector:{select:{mode:"dropdown",options:a}}},e.length?{name:"default_floor",selector:{select:{mode:"dropdown",options:r}}}:{name:"default_floor",selector:{text:{}}},{name:"language",selector:{select:{mode:"dropdown",options:s(t(o,"editor.lang_auto"),this._config?.language)}}},{name:"icon_size",selector:{number:{min:1,max:6,step:.1,mode:"box"}}},{name:"show_temperature",selector:{boolean:{}}},{name:"live_states",selector:{boolean:{}}},{name:"show_signal",selector:{boolean:{}}},{name:"kiosk",selector:{boolean:{}}},{name:"cycle",selector:{number:{min:0,max:3600,step:5,mode:"box"}}}]}render(){if(!this.hass||!this._config)return a;const e=i(this,l,o(this.hass,this._config.language));if("cold"===e)return n();if("warm"===e)return r;this._loadSpaces();const s=this._lang,h={title:t(s,"editor.title"),floor:t(s,"editor.floor"),default_floor:t(s,"editor.default_floor"),language:t(s,"editor.language"),icon_size:t(s,"editor.icon_size"),show_temperature:t(s,"editor.show_temperature"),live_states:t(s,"editor.live_states"),show_signal:t(s,"editor.show_signal"),kiosk:t(s,"editor.kiosk"),cycle:t(s,"editor.cycle")},f=this._schema,_=function(e,o,t){if(!t||null===o)return null;const s="string"==typeof e?.default_floor?e.default_floor:"";return!s||o.some(e=>e.value===s)?null:s}(this._config,this._spaces,this._spacesAuthoritative),d=e=>c`<ha-form globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="e53b30c3c9da873ce146ad9277e308d6d94c0a64db834549c64230709021da6a";import{q as e,l as o,v as t,e5 as s,A as a,e6 as i,e7 as l,e8 as n,E as r,c}from"./houseplan-card-BwHO54W5.js";class h extends e{constructor(){super(...arguments),this._spaces=null,this._spacesLoading=!1,this._spacesAuthoritative=!1}setConfig(e){this._config=e}async _loadSpaces(){if(!this._spaces&&!this._spacesLoading&&this.hass){this._spacesLoading=!0;try{const e=await this.hass.callWS({type:"houseplan/config/get"});this._spaces=(e?.config?.spaces||[]).map(e=>({value:e.id,label:e.title||e.id})),this._spacesAuthoritative=!0}catch{this._spaces=[],this._spacesAuthoritative=!1}finally{this._spacesLoading=!1}}}get _lang(){return o(this.hass,this._config?.language)}get _floorToken(){const e=this._config?.floor;return"number"==typeof e?`__houseplan_yaml_floor_index__:${String(e)}`:null}get _formData(){const e={...this._config},o=this._floorToken;return o?e.floor=o:Object.prototype.hasOwnProperty.call(e,"floor")||(e.floor=""),e}get _schema(){const e=this._spaces||[],o=this._lang,a=[{value:"",label:t(o,"editor.floor_none")}],i=this._floorToken;i&&a.push({value:i,label:t(o,"editor.floor_index",{index:String(this._config?.floor)})});const l="string"==typeof this._config?.floor?this._config.floor:"";l&&!e.some(e=>e.value===l)&&a.push({value:l,label:l}),a.push(...e);const n="string"==typeof this._config?.default_floor?this._config.default_floor:"",r=[...e];return n&&!e.some(e=>e.value===n)&&r.unshift({value:n,label:n}),[{name:"title",selector:{text:{}}},{name:"floor",selector:{select:{mode:"dropdown",options:a}}},e.length?{name:"default_floor",selector:{select:{mode:"dropdown",options:r}}}:{name:"default_floor",selector:{text:{}}},{name:"language",selector:{select:{mode:"dropdown",options:s(t(o,"editor.lang_auto"),this._config?.language)}}},{name:"icon_size",selector:{number:{min:1,max:6,step:.1,mode:"box"}}},{name:"show_temperature",selector:{boolean:{}}},{name:"live_states",selector:{boolean:{}}},{name:"show_signal",selector:{boolean:{}}},{name:"kiosk",selector:{boolean:{}}},{name:"cycle",selector:{number:{min:0,max:3600,step:5,mode:"box"}}}]}render(){if(!this.hass||!this._config)return a;const e=i(this,l,o(this.hass,this._config.language));if("cold"===e)return n();if("warm"===e)return r;this._loadSpaces();const s=this._lang,h={title:t(s,"editor.title"),floor:t(s,"editor.floor"),default_floor:t(s,"editor.default_floor"),language:t(s,"editor.language"),icon_size:t(s,"editor.icon_size"),show_temperature:t(s,"editor.show_temperature"),live_states:t(s,"editor.live_states"),show_signal:t(s,"editor.show_signal"),kiosk:t(s,"editor.kiosk"),cycle:t(s,"editor.cycle")},_=this._schema,f=function(e,o,t){if(!t||null===o)return null;const s="string"==typeof e?.default_floor?e.default_floor:"";return!s||o.some(e=>e.value===s)?null:s}(this._config,this._spaces,this._spacesAuthoritative),d=e=>c`<ha-form
.hass=${this.hass} .hass=${this.hass}
.data=${this._formData} .data=${this._formData}
.schema=${e} .schema=${e}
.computeLabel=${e=>h[e.name]||e.name} .computeLabel=${e=>h[e.name]||e.name}
@value-changed=${this._valueChanged} @value-changed=${this._valueChanged}
></ha-form>`;return c` ></ha-form>`;return c`
${d(f.slice(0,3))} ${d(_.slice(0,3))}
${_?c`<div class="default-floor-error" role="alert" ${f?c`<div class="default-floor-error" role="alert"
style="color:var(--error-color,#db4437);margin:-4px 0 12px;overflow-wrap:anywhere"> style="color:var(--error-color,#db4437);margin:-4px 0 12px;overflow-wrap:anywhere">
${t(s,"editor.default_floor_missing",{id:_})} ${t(s,"editor.default_floor_missing",{id:f})}
</div>`:a} </div>`:a}
${d(f.slice(3))} ${d(_.slice(3))}
`}_valueChanged(e){const o={...this._config,...e.detail.value};""===o.floor?delete o.floor:o.floor===this._floorToken&&(o.floor=this._config?.floor);const t=new Event("config-changed",{bubbles:!0,composed:!0});t.detail={config:o},this.dispatchEvent(t)}}h.properties={hass:{attribute:!1},_config:{state:!0},_spaces:{state:!0}},customElements.get("houseplan-card-editor")||customElements.define("houseplan-card-editor",h); `}_valueChanged(e){const o={...this._config,...e.detail.value};""===o.floor?delete o.floor:o.floor===this._floorToken&&(o.floor=this._config?.floor);const t=new Event("config-changed",{bubbles:!0,composed:!0});t.detail={config:o},this.dispatchEvent(t)}}h.properties={hass:{attribute:!1},_config:{state:!0},_spaces:{state:!0}},customElements.get("houseplan-card-editor")||customElements.define("houseplan-card-editor",h);
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="7d7d634b457de395f9087a171ae19ae5dd8b29cc2205221a8a00fca7156f6d71";import{l as t,b4 as s,A as e,v as a,c as o,cn as l,co as i,cp as h,cq as c,b1 as n,cr as r,cw as p,cs as d,ct as _,cu as u,cv as g,cx as m,cy as b,dt as $,du as v,dv as f,b0 as y,b2 as w,dw as D}from"./houseplan-card-DRCzjIQ2.js";import{c as k,e as S,r as C,a as M}from"./backdrop-pick-DbyFaYLE.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="7d7d634b457de395f9087a171ae19ae5dd8b29cc2205221a8a00fca7156f6d71";class L{constructor(t){this.host=t,this._toggleServerPlans=async()=>{const t=this.host._spaceDialog;if(t)if(t.pickSaved)this.host._spaceDialog={...t,pickSaved:!1};else{this.host._spaceDialog={...t,pickSaved:!0,savedBusy:!0};try{const t=await this.host.hass.callWS({type:"houseplan/plans/list"}),s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:t?.plans||[],savedBusy:!1})}catch(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:[],savedBusy:!1}),this.host._showToast(this.host._t("toast.plans_list_failed",{err:this.host._errText(t)}))}}}}_help(l){const i=`${l}.aria`,h=t(this.host.hass,this.host._config?.language);return s(h,l)&&s(h,i)?o`<hp-help data-help-key=${l} globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="e53b30c3c9da873ce146ad9277e308d6d94c0a64db834549c64230709021da6a";import{l as t,b4 as s,A as e,v as a,c as o,cn as l,co as i,cp as h,cq as c,b1 as n,cr as r,cw as p,cs as d,ct as _,cu as u,cv as g,cx as m,cy as b,dt as $,du as v,dv as f,b0 as y,b2 as w,dw as D}from"./houseplan-card-BwHO54W5.js";import{c as k,e as S,r as C,a as M}from"./backdrop-pick-DXffOhAn.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="e53b30c3c9da873ce146ad9277e308d6d94c0a64db834549c64230709021da6a";class L{constructor(t){this.host=t,this._toggleServerPlans=async()=>{const t=this.host._spaceDialog;if(t)if(t.pickSaved)this.host._spaceDialog={...t,pickSaved:!1};else{this.host._spaceDialog={...t,pickSaved:!0,savedBusy:!0};try{const t=await this.host.hass.callWS({type:"houseplan/plans/list"}),s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:t?.plans||[],savedBusy:!1})}catch(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:[],savedBusy:!1}),this.host._showToast(this.host._t("toast.plans_list_failed",{err:this.host._errText(t)}))}}}}_help(l){const i=`${l}.aria`,h=t(this.host.hass,this.host._config?.language);return s(h,l)&&s(h,i)?o`<hp-help data-help-key=${l}
.text=${a(h,l)} .ariaLabel=${a(h,i)}></hp-help>`:e}_openSpaceDialog(t,s){if(!this.host._serverStorage||!this.host._serverCfg)return void this.host._showToast(this.host._t("toast.integration_missing"));if("edit"===t){const e=this.host._serverCfg.spaces.find(t=>t.id===s);if(!e)return;const a=l(e),o=e.settings?.custom_fill&&"object"==typeof e.settings.custom_fill?i(e.settings.custom_fill):null,p="none"===a.fill?{...o||h,a:0}:o;return void(this.host._spaceDialog={mode:t,spaceId:s,title:e.title,planUrl:e.plan_url||null,planFile:null,source:e.plan_url?"file":"draw",showBorders:a.showBorders,showNames:a.showNames,zeroWallStyle:r(e),displayTouched:!0,hideDecor:a.hideDecor,hideOpenings:a.hideOpenings,roomColor:a.color,roomOpacity:a.opacity,fillMode:"none"===a.fill?"custom":a.fill,customFill:p,glowEnabled:a.glow,bgColor:a.bgColor,bgMode:"static"===e.settings?.bg_mode||"daynight"===e.settings?.bg_mode?e.settings.bg_mode:null,northDeg:n({},e.settings),sunRays:"boolean"==typeof e.settings?.sun_rays?e.settings.sun_rays:null,tempMin:a.tempMin,tempMax:a.tempMax,showLqi:a.showLqi??this.host._config?.show_signal??!0,cardFontScale:a.cardFontScale,labelTemp:a.labelTemp,labelHum:a.labelHum,labelLqi:a.labelLqi,labelLight:a.labelLight,cellCm:Number(e.cell_cm)>0?Number(e.cell_cm):5,cellCmInput:c(Number(e.cell_cm)>0?Number(e.cell_cm):5,this.host._imperial),cellCmTouched:!1,busy:!1})}const e=p(this.host._imperial);this.host._spaceDialog={mode:t,title:"",planUrl:null,planFile:null,...m(),hideDecor:!1,hideOpenings:!1,zeroWallStyle:"dashed",roomColor:g,roomOpacity:u,fillMode:"custom",customFill:{...h,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:_,tempMax:d,showLqi:this.host._config?.show_signal??!0,cardFontScale:1,labelTemp:!1,labelHum:!1,labelLqi:!1,labelLight:!1,cellCm:e,cellCmInput:c(e,this.host._imperial),cellCmTouched:!1,busy:!1}}async _pickPlanFile(t){const s=t.target,e=s.files?.[0];if(!e||!this.host._spaceDialog)return;s.value="";const a=await k(e);if("reject"===a.kind)return void this.host._showToast(this.host._t("toast.plan_formats"));if("guard"===a.kind)return void(this.host._backdropGuard=a.state);const o=await S(e,a.ext,e.name);this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:o})}_renderBackdropGuard(){return C(this.host,t=>{this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:t})},()=>{this.host._backdropGuard=null},this.host.hass)??e}_useServerPlan(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,planUrl:t,planFile:null,pickSaved:!1,savedAspect:void 0},this.host._aspectJob=this._readPlanAspect(t))}async _readPlanAspect(t){for(let s=0;s<40;s++){const s=this.host._display(t);if(s){const e=await new Promise(t=>{const e=new Image;e.onload=()=>t(e.naturalWidth&&e.naturalHeight?e.naturalWidth/e.naturalHeight:0),e.onerror=()=>t(0),e.src=s}),a=this.host._spaceDialog;return a&&a.planUrl===t&&Number.isFinite(e)&&e>0?(this.host._spaceDialog={...a,savedAspect:e},e):0}if(await new Promise(t=>setTimeout(t,150)),this.host._spaceDialog?.planUrl!==t)return 0}return 0}async _deleteServerPlan(t){const s=this.host._spaceDialog,e=s?.saved?.find(s=>s.name===t);if(!s||!e||e.used_by.length||e.url===s.planUrl)return;const a=await this.host._confirmDanger({key:"delete-plan",kind:"destructive",title:this.host._t("confirm.delete_plan_title"),message:this.host._t("confirm.delete_plan_body"),objectName:t,confirmLabel:this.host._t("btn.delete"),cancelLabel:this.host._t("btn.cancel")}),o=this.host._spaceDialog,l=o?.saved?.find(s=>s.name===t);if(a&&o&&l&&l.url===e.url&&l.modified===e.modified&&!l.used_by.length&&l.url!==o.planUrl)try{await this.host.hass.callWS({type:"houseplan/plans/delete",name:t});const s=this.host._spaceDialog;s?.saved&&(this.host._spaceDialog={...s,saved:s.saved.filter(s=>s.name!==t)})}catch(t){this.host._showToast(this.host._t("toast.plan_delete_failed",{err:this.host._errText(t)}))}}_renderServerPlans(t){if(t.savedBusy)return o`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return o`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return o`<div class="savedplans"> .text=${a(h,l)} .ariaLabel=${a(h,i)}></hp-help>`:e}_openSpaceDialog(t,s){if(!this.host._serverStorage||!this.host._serverCfg)return void this.host._showToast(this.host._t("toast.integration_missing"));if("edit"===t){const e=this.host._serverCfg.spaces.find(t=>t.id===s);if(!e)return;const a=l(e),o=e.settings?.custom_fill&&"object"==typeof e.settings.custom_fill?i(e.settings.custom_fill):null,p="none"===a.fill?{...o||h,a:0}:o;return void(this.host._spaceDialog={mode:t,spaceId:s,title:e.title,planUrl:e.plan_url||null,planFile:null,source:e.plan_url?"file":"draw",showBorders:a.showBorders,showNames:a.showNames,zeroWallStyle:r(e),displayTouched:!0,hideDecor:a.hideDecor,hideOpenings:a.hideOpenings,roomColor:a.color,roomOpacity:a.opacity,fillMode:"none"===a.fill?"custom":a.fill,customFill:p,glowEnabled:a.glow,bgColor:a.bgColor,bgMode:"static"===e.settings?.bg_mode||"daynight"===e.settings?.bg_mode?e.settings.bg_mode:null,northDeg:n({},e.settings),sunRays:"boolean"==typeof e.settings?.sun_rays?e.settings.sun_rays:null,tempMin:a.tempMin,tempMax:a.tempMax,showLqi:a.showLqi??this.host._config?.show_signal??!0,cardFontScale:a.cardFontScale,labelTemp:a.labelTemp,labelHum:a.labelHum,labelLqi:a.labelLqi,labelLight:a.labelLight,cellCm:Number(e.cell_cm)>0?Number(e.cell_cm):5,cellCmInput:c(Number(e.cell_cm)>0?Number(e.cell_cm):5,this.host._imperial),cellCmTouched:!1,busy:!1})}const e=p(this.host._imperial);this.host._spaceDialog={mode:t,title:"",planUrl:null,planFile:null,...m(),hideDecor:!1,hideOpenings:!1,zeroWallStyle:"dashed",roomColor:g,roomOpacity:u,fillMode:"custom",customFill:{...h,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:_,tempMax:d,showLqi:this.host._config?.show_signal??!0,cardFontScale:1,labelTemp:!1,labelHum:!1,labelLqi:!1,labelLight:!1,cellCm:e,cellCmInput:c(e,this.host._imperial),cellCmTouched:!1,busy:!1}}async _pickPlanFile(t){const s=t.target,e=s.files?.[0];if(!e||!this.host._spaceDialog)return;s.value="";const a=await k(e);if("reject"===a.kind)return void this.host._showToast(this.host._t("toast.plan_formats"));if("guard"===a.kind)return void(this.host._backdropGuard=a.state);const o=await S(e,a.ext,e.name);this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:o})}_renderBackdropGuard(){return C(this.host,t=>{this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:t})},()=>{this.host._backdropGuard=null},this.host.hass)??e}_useServerPlan(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,planUrl:t,planFile:null,pickSaved:!1,savedAspect:void 0},this.host._aspectJob=this._readPlanAspect(t))}async _readPlanAspect(t){for(let s=0;s<40;s++){const s=this.host._display(t);if(s){const e=await new Promise(t=>{const e=new Image;e.onload=()=>t(e.naturalWidth&&e.naturalHeight?e.naturalWidth/e.naturalHeight:0),e.onerror=()=>t(0),e.src=s}),a=this.host._spaceDialog;return a&&a.planUrl===t&&Number.isFinite(e)&&e>0?(this.host._spaceDialog={...a,savedAspect:e},e):0}if(await new Promise(t=>setTimeout(t,150)),this.host._spaceDialog?.planUrl!==t)return 0}return 0}async _deleteServerPlan(t){const s=this.host._spaceDialog,e=s?.saved?.find(s=>s.name===t);if(!s||!e||e.used_by.length||e.url===s.planUrl)return;const a=await this.host._confirmDanger({key:"delete-plan",kind:"destructive",title:this.host._t("confirm.delete_plan_title"),message:this.host._t("confirm.delete_plan_body"),objectName:t,confirmLabel:this.host._t("btn.delete"),cancelLabel:this.host._t("btn.cancel")}),o=this.host._spaceDialog,l=o?.saved?.find(s=>s.name===t);if(a&&o&&l&&l.url===e.url&&l.modified===e.modified&&!l.used_by.length&&l.url!==o.planUrl)try{await this.host.hass.callWS({type:"houseplan/plans/delete",name:t});const s=this.host._spaceDialog;s?.saved&&(this.host._spaceDialog={...s,saved:s.saved.filter(s=>s.name!==t)})}catch(t){this.host._showToast(this.host._t("toast.plan_delete_failed",{err:this.host._errText(t)}))}}_renderServerPlans(t){if(t.savedBusy)return o`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return o`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return o`<div class="savedplans">
${s.map(s=>{return o` ${s.map(s=>{return o`
<div class="savedplan ${s.url===t.planUrl?"cur":""}"> <div class="savedplan ${s.url===t.planUrl?"cur":""}">
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="7d7d634b457de395f9087a171ae19ae5dd8b29cc2205221a8a00fca7156f6d71";import{c as a,A as e}from"./houseplan-card-DRCzjIQ2.js";import{s,n as t,a as l,m as r,b as o,c as i,d as u}from"./summary-panel-runtime-loaded-BygdaMYA.js";const m=m=>{const{host:c,dialog:d,problems:n,t:b}=m,y=n.find(a=>"error"===a.kind),$=d.localShow!==d.baseLocalShow||!d.localOnly&&!s(t(d.draft),d.base),p=$&&!d.busy&&!y,v=a=>n.find(e=>e.path===a),h=a=>a?b(`summary.problem.${a.code}`):"",k=()=>m.close(),g=a`<label class="summary-switch" for="summary-local-show"> globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="e53b30c3c9da873ce146ad9277e308d6d94c0a64db834549c64230709021da6a";import{c as a,A as e}from"./houseplan-card-BwHO54W5.js";import{s,n as t,a as l,m as r,b as o,c as i,d as u}from"./summary-panel-runtime-loaded-CMPY7SjL.js";const m=m=>{const{host:c,dialog:d,problems:n,t:b}=m,y=n.find(a=>"error"===a.kind),$=d.localShow!==d.baseLocalShow||!d.localOnly&&!s(t(d.draft),d.base),p=$&&!d.busy&&!y,v=a=>n.find(e=>e.path===a),h=a=>a?b(`summary.problem.${a.code}`):"",k=()=>m.close(),g=a`<label class="summary-switch" for="summary-local-show">
<span class="summary-switch-caption"><strong>${b("summary.show_local")}</strong> <span class="summary-switch-caption"><strong>${b("summary.show_local")}</strong>
<small id="summary-local-show-hint">${b("summary.show_local_hint")}</small></span> <small id="summary-local-show-hint">${b("summary.show_local_hint")}</small></span>
<input id="summary-local-show" data-summary-local-show type="checkbox" <input id="summary-local-show" data-summary-local-show type="checkbox"
@@ -1 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="7d7d634b457de395f9087a171ae19ae5dd8b29cc2205221a8a00fca7156f6d71";import{eb as e,P as t,a5 as n,M as i,aq as r,N as o,bs as s,br as a,a4 as c,a3 as l,aA as d,ec as u,ed as f,bu as m,ee as g}from"./houseplan-card-DRCzjIQ2.js";function v(e){if(!e.registry.authoritative)return null;const t=new Set,n=d(e.markers);for(const i of Object.values(e.registry.devices||{}))i?.id&&"service"!==i.entry_type&&!n.devices.has(i.id)&&i.area_id&&e.areaToSpace[i.area_id]&&t.add(i.id);for(const i of e.markers||[]){if(i.removed||"virtual"===i.binding)continue;const r=String(i.binding||"").indexOf(":");if(r<1)continue;const o=i.binding.slice(0,r),s=i.binding.slice(r+1),a="device"===o?e.registry.devices?.[s]:null,c="entity"===o?e.registry.entities?.[s]:null,l="device"===o?s:c?.device_id,d="device"===o?a?.area_id:c?.area_id||l&&e.registry.devices?.[l]?.area_id,u="string"==typeof i.room_id&&i.room_id.length>0&&null===i.area?"":i.area||d||"",f=u&&e.areaToSpace[u]||i.space||e.firstSpaceId;l&&e.registry.devices?.[l]&&e.spaceIds.has(f)&&(!n.devices.has(l)||"entity"===o&&n.liveEntities.has(s))&&t.add(l)}return t}function y(e,t){return e?.length?t?.length?g(e,t):e:t}function _(e,t){const n=c(e.rooms,t.walls,t.openCuts,[],i,t.cellCm,r,o);return{roomGeom:"ok"===n.status||"degraded-extra"===n.status?n.roomGeom:void 0,multiWallNodes:l(e.rooms,t.walls,t.openCuts,i,t.cellCm,r,o)}}function*h(c,l,d=_){try{let u=0;for(const f of l){const l=c.spaces.find(e=>String(e?.id)===f.id);if(!l)continue;const m=e(l,f),g=d(f,m);let v=null;for(const e of f.rooms){if(!e.id)continue;const a=t(e);if(!a)continue;const c=n(f.rooms,e.id,m.walls,m.openCuts,i,m.cellCm,r,o,g.roomGeom,g.multiWallNodes)||a;v=y(v,s(c,m.physicalBodies)),yield}const _=m.cellCm/r;u+=a(v)*_*_/1e4}return u}catch{return null}}function p(e,t,n=_){const i=h(e,t,n);let r=i.next();for(;!r.done;)r=i.next();return r.value}function b(e,t,n,i){if("system"!==e.type)return null;if("device_count"===e.key)return null===t.deviceCount?null:String(t.deviceCount);if("total_area"===e.key)return null===t.areaM2?null:m(t.areaM2,"mi"===n?.config?.unit_system?.length);try{return new Intl.DateTimeFormat(i||void 0,{dateStyle:"short",timeStyle:"short",timeZone:n?.config?.time_zone||void 0}).format(t.now)}catch{return t.now.toLocaleString()}}function S(e,t){const n=e?.states?.[t];if(!n)return null;const i=u(e,t);return i?f(i,String(n.attributes?.unit_of_measurement||"")):null}export{h as cleanFloorAreaSteps,v as representedHaDeviceIds,_ as spaceWallGeometry,S as summaryEntityValue,b as summarySystemValue,p as totalCleanFloorAreaM2}; globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="e53b30c3c9da873ce146ad9277e308d6d94c0a64db834549c64230709021da6a";import{eb as e,P as t,a5 as n,M as i,aq as r,N as o,bs as s,br as a,a4 as c,a3 as l,aA as d,ec as u,ed as f,bu as m,ee as g}from"./houseplan-card-BwHO54W5.js";function v(e){if(!e.registry.authoritative)return null;const t=new Set,n=d(e.markers);for(const i of Object.values(e.registry.devices||{}))i?.id&&"service"!==i.entry_type&&!n.devices.has(i.id)&&i.area_id&&e.areaToSpace[i.area_id]&&t.add(i.id);for(const i of e.markers||[]){if(i.removed||"virtual"===i.binding)continue;const r=String(i.binding||"").indexOf(":");if(r<1)continue;const o=i.binding.slice(0,r),s=i.binding.slice(r+1),a="device"===o?e.registry.devices?.[s]:null,c="entity"===o?e.registry.entities?.[s]:null,l="device"===o?s:c?.device_id,d="device"===o?a?.area_id:c?.area_id||l&&e.registry.devices?.[l]?.area_id,u="string"==typeof i.room_id&&i.room_id.length>0&&null===i.area?"":i.area||d||"",f=u&&e.areaToSpace[u]||i.space||e.firstSpaceId;l&&e.registry.devices?.[l]&&e.spaceIds.has(f)&&(!n.devices.has(l)||"entity"===o&&n.liveEntities.has(s))&&t.add(l)}return t}function y(e,t){return e?.length?t?.length?g(e,t):e:t}function _(e,t){const n=c(e.rooms,t.walls,t.openCuts,[],i,t.cellCm,r,o);return{roomGeom:"ok"===n.status||"degraded-extra"===n.status?n.roomGeom:void 0,multiWallNodes:l(e.rooms,t.walls,t.openCuts,i,t.cellCm,r,o)}}function*h(c,l,d=_){try{let u=0;for(const f of l){const l=c.spaces.find(e=>String(e?.id)===f.id);if(!l)continue;const m=e(l,f),g=d(f,m);let v=null;for(const e of f.rooms){if(!e.id)continue;const a=t(e);if(!a)continue;const c=n(f.rooms,e.id,m.walls,m.openCuts,i,m.cellCm,r,o,g.roomGeom,g.multiWallNodes)||a;v=y(v,s(c,m.physicalBodies)),yield}const _=m.cellCm/r;u+=a(v)*_*_/1e4}return u}catch{return null}}function p(e,t,n=_){const i=h(e,t,n);let r=i.next();for(;!r.done;)r=i.next();return r.value}function b(e,t,n,i){if("system"!==e.type)return null;if("device_count"===e.key)return null===t.deviceCount?null:String(t.deviceCount);if("total_area"===e.key)return null===t.areaM2?null:m(t.areaM2,"mi"===n?.config?.unit_system?.length);try{return new Intl.DateTimeFormat(i||void 0,{dateStyle:"short",timeStyle:"short",timeZone:n?.config?.time_zone||void 0}).format(t.now)}catch{return t.now.toLocaleString()}}function S(e,t){const n=e?.states?.[t];if(!n)return null;const i=u(e,t);return i?f(i,String(n.attributes?.unit_of_measurement||"")):null}export{h as cleanFloorAreaSteps,v as representedHaDeviceIds,_ as spaceWallGeometry,S as summaryEntityValue,b as summarySystemValue,p as totalCleanFloorAreaM2};
@@ -1 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="7d7d634b457de395f9087a171ae19ae5dd8b29cc2205221a8a00fca7156f6d71";import{n as t,b as n}from"./zigbee-topology-u3KR6JXs.js";import{F as e}from"./houseplan-card-DRCzjIQ2.js";const o=new WeakMap;function i(t){const n=function(t){const n=t?.connection||t;return!n||"object"!=typeof n&&"function"!=typeof n?null:n}(t);if(!n)return null;let e=o.get(n);return e||(e={revision:0,topologies:[],states:{},listeners:new Set,inflight:new Map},o.set(n,e)),e}function r(t,n,e){t.states={...t.states,[n]:e},function(t){t.revision++;for(const n of t.listeners)n()}(t)}function s(t){const n=t?.code;if("permission"===n||"unsupported"===n||"timeout"===n||"invalid_topic"===n||"invalid_payload"===n)return n;const e=String(t?.message||"").toLowerCase();return e.includes("unauthor")||e.includes("permission")?"permission":e.includes("unknown_command")||e.includes("not found")?"unsupported":"provider"}function a(t){return Object.assign(new Error(t),{code:t})}function c(t,n,e){const o=t.inflight.get(n);if(o)return o;r(t,n,{phase:"loading"});const i=e().then(n=>{if(!n.nodes.length&&n.warnings.some(t=>"invalid_payload"===t.code))throw a("invalid_payload");!function(t,n){t.topologies=[...t.topologies.filter(t=>!(t.provider===n.provider&&t.instanceId===n.instanceId)),n],r(t,"zha"===n.provider?"zha":`z2m:${n.instanceId}`,{phase:"ready",obtainedAt:n.obtainedAt,partial:n.warnings.length>0})}(t,n)}).catch(e=>{r(t,n,{phase:"error",error:s(e)})}).finally(()=>t.inflight.delete(n));return t.inflight.set(n,i),i}function l(t){const n=i(t);return n?{revision:n.revision,topologies:n.topologies,states:n.states}:{revision:0,topologies:[],states:{}}}function u(t,n){const e=i(t);return e?(e.listeners.add(n),()=>e.listeners.delete(n)):()=>{}}function p(t){if(!0!==t?.user?.is_admin)throw a("permission")}function f(n){const e=i(n);return e?c(e,"zha",async()=>{if(p(n),"function"!=typeof n?.callWS)throw a("unsupported");return t(await n.callWS({type:"zha/devices"}))}):Promise.resolve()}function d(t){return null!==t&&"object"==typeof t?t:null}function h(t){const n=d(t),e=n?.payload??t;if("string"!=typeof e)return e;try{return JSON.parse(e)}catch{return null}}async function m(t,n){let e;try{return await Promise.race([t,new Promise((t,o)=>{e=globalThis.setTimeout(()=>o(a("timeout")),Math.max(1,n))})])}finally{void 0!==e&&globalThis.clearTimeout(e)}}function g(t,o,r=15e4){const s=i(t);if(!s)return Promise.resolve();const l=e(o);return c(s,`z2m:${l||String(o)}`,async()=>{if(p(t),!l)throw a("invalid_topic");const e=t.connection,o=e?.subscribeMessage;if("function"!=typeof o||"function"!=typeof t?.callService)throw a("unsupported");const i=function(){const t=globalThis.crypto;return"function"==typeof t?.randomUUID?`houseplan-${t.randomUUID()}`:`houseplan-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}(),s=Date.now()+Math.max(1,r);let c=!1,u=null,f=null,g=null;const y=new Promise(t=>{u=t}),w=new Promise((t,n)=>{f=t,g=n}),b=[];try{const r=await o.call(e,t=>{!0===d(t)?.retain&&h(t)&&u?.()},{type:"mqtt/subscribe",topic:`${l}/bridge/info`});"function"==typeof r&&b.push(r);const p=await o.call(e,t=>{if(!0===d(t)?.retain)return;const n=h(t);null!==n?n&&function(t){const n=d(t),e=n?.transaction??d(n?.data)?.transaction;return"string"==typeof e||"number"==typeof e?String(e):null}(n)===i&&f?.(n):c&&g?.(a("invalid_payload"))},{type:"mqtt/subscribe",topic:`${l}/bridge/response/networkmap`});"function"==typeof p&&b.push(p),await m(y,Math.min(4e3,Math.max(1,s-Date.now()))),c=!0,await t.callService("mqtt","publish",{topic:`${l}/bridge/request/networkmap`,payload:JSON.stringify({type:"raw",routes:!1,transaction:i}),qos:0,retain:!1});const v=await m(w,s-Date.now()),_=d(v)?.status;if(_&&"ok"!==_)throw a("provider");return n(v,l)}finally{for(const t of b)try{t()}catch{}}})}export{f as readZhaTopology,g as refreshZ2mTopology,u as subscribeZigbeeTopology,l as zigbeeTopologyRuntimeSnapshot}; globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="e53b30c3c9da873ce146ad9277e308d6d94c0a64db834549c64230709021da6a";import{n as t,b as n}from"./zigbee-topology-DjOib68n.js";import{F as e}from"./houseplan-card-BwHO54W5.js";const o=new WeakMap;function i(t){const n=function(t){const n=t?.connection||t;return!n||"object"!=typeof n&&"function"!=typeof n?null:n}(t);if(!n)return null;let e=o.get(n);return e||(e={revision:0,topologies:[],states:{},listeners:new Set,inflight:new Map},o.set(n,e)),e}function r(t,n,e){t.states={...t.states,[n]:e},function(t){t.revision++;for(const n of t.listeners)n()}(t)}function s(t){const n=t?.code;if("permission"===n||"unsupported"===n||"timeout"===n||"invalid_topic"===n||"invalid_payload"===n)return n;const e=String(t?.message||"").toLowerCase();return e.includes("unauthor")||e.includes("permission")?"permission":e.includes("unknown_command")||e.includes("not found")?"unsupported":"provider"}function a(t){return Object.assign(new Error(t),{code:t})}function c(t,n,e){const o=t.inflight.get(n);if(o)return o;r(t,n,{phase:"loading"});const i=e().then(n=>{if(!n.nodes.length&&n.warnings.some(t=>"invalid_payload"===t.code))throw a("invalid_payload");!function(t,n){t.topologies=[...t.topologies.filter(t=>!(t.provider===n.provider&&t.instanceId===n.instanceId)),n],r(t,"zha"===n.provider?"zha":`z2m:${n.instanceId}`,{phase:"ready",obtainedAt:n.obtainedAt,partial:n.warnings.length>0})}(t,n)}).catch(e=>{r(t,n,{phase:"error",error:s(e)})}).finally(()=>t.inflight.delete(n));return t.inflight.set(n,i),i}function l(t){const n=i(t);return n?{revision:n.revision,topologies:n.topologies,states:n.states}:{revision:0,topologies:[],states:{}}}function u(t,n){const e=i(t);return e?(e.listeners.add(n),()=>e.listeners.delete(n)):()=>{}}function p(t){if(!0!==t?.user?.is_admin)throw a("permission")}function f(n){const e=i(n);return e?c(e,"zha",async()=>{if(p(n),"function"!=typeof n?.callWS)throw a("unsupported");return t(await n.callWS({type:"zha/devices"}))}):Promise.resolve()}function d(t){return null!==t&&"object"==typeof t?t:null}function h(t){const n=d(t),e=n?.payload??t;if("string"!=typeof e)return e;try{return JSON.parse(e)}catch{return null}}async function m(t,n){let e;try{return await Promise.race([t,new Promise((t,o)=>{e=globalThis.setTimeout(()=>o(a("timeout")),Math.max(1,n))})])}finally{void 0!==e&&globalThis.clearTimeout(e)}}function g(t,o,r=15e4){const s=i(t);if(!s)return Promise.resolve();const l=e(o);return c(s,`z2m:${l||String(o)}`,async()=>{if(p(t),!l)throw a("invalid_topic");const e=t.connection,o=e?.subscribeMessage;if("function"!=typeof o||"function"!=typeof t?.callService)throw a("unsupported");const i=function(){const t=globalThis.crypto;return"function"==typeof t?.randomUUID?`houseplan-${t.randomUUID()}`:`houseplan-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}(),s=Date.now()+Math.max(1,r);let c=!1,u=null,f=null,g=null;const y=new Promise(t=>{u=t}),w=new Promise((t,n)=>{f=t,g=n}),b=[];try{const r=await o.call(e,t=>{!0===d(t)?.retain&&h(t)&&u?.()},{type:"mqtt/subscribe",topic:`${l}/bridge/info`});"function"==typeof r&&b.push(r);const p=await o.call(e,t=>{if(!0===d(t)?.retain)return;const n=h(t);null!==n?n&&function(t){const n=d(t),e=n?.transaction??d(n?.data)?.transaction;return"string"==typeof e||"number"==typeof e?String(e):null}(n)===i&&f?.(n):c&&g?.(a("invalid_payload"))},{type:"mqtt/subscribe",topic:`${l}/bridge/response/networkmap`});"function"==typeof p&&b.push(p),await m(y,Math.min(4e3,Math.max(1,s-Date.now()))),c=!0,await t.callService("mqtt","publish",{topic:`${l}/bridge/request/networkmap`,payload:JSON.stringify({type:"raw",routes:!1,transaction:i}),qos:0,retain:!1});const v=await m(w,s-Date.now()),_=d(v)?.status;if(_&&"ok"!==_)throw a("provider");return n(v,l)}finally{for(const t of b)try{t()}catch{}}})}export{f as readZhaTopology,g as refreshZ2mTopology,u as subscribeZigbeeTopology,l as zigbeeTopologyRuntimeSnapshot};
@@ -1 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="7d7d634b457de395f9087a171ae19ae5dd8b29cc2205221a8a00fca7156f6d71";try{await import("./houseplan-assets/houseplan-card-DRCzjIQ2.js")}catch(e){if(!customElements.get("houseplan-card")){const l=String(navigator.language||"en").toLowerCase();const m=l.startsWith("ru")?"House Plan обновился — перезагрузите страницу (Ctrl+F5).":l.startsWith("de")?"House Plan wurde aktualisiert — bitte laden Sie die Seite neu (Strg+F5).":l.startsWith("fr")?"House Plan a été mis à jour — veuillez recharger la page (Ctrl+F5).":"House Plan was updated — please reload the page (Ctrl+F5).";customElements.define("houseplan-card",class extends HTMLElement{setConfig(){}getCardSize(){return 1}connectedCallback(){this.style.cssText="display:block;box-sizing:border-box;padding:16px;border:1px solid var(--divider-color,#e0e0e0);border-radius:var(--ha-card-border-radius,12px);background:var(--card-background-color,#fff);color:var(--primary-text-color,#212121);font:14px/1.4 var(--paper-font-body1_-_font-family,sans-serif)";this.textContent=m}})}console.error("[houseplan] stale houseplan-card.js: the implementation chunk is unavailable",e)} globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="e53b30c3c9da873ce146ad9277e308d6d94c0a64db834549c64230709021da6a";try{await import("./houseplan-assets/houseplan-card-BwHO54W5.js")}catch(e){if(!customElements.get("houseplan-card")){const l=String(navigator.language||"en").toLowerCase();const m=l.startsWith("ru")?"House Plan обновился — перезагрузите страницу (Ctrl+F5).":l.startsWith("de")?"House Plan wurde aktualisiert — bitte laden Sie die Seite neu (Strg+F5).":l.startsWith("fr")?"House Plan a été mis à jour — veuillez recharger la page (Ctrl+F5).":"House Plan was updated — please reload the page (Ctrl+F5).";customElements.define("houseplan-card",class extends HTMLElement{setConfig(){}getCardSize(){return 1}connectedCallback(){this.style.cssText="display:block;box-sizing:border-box;padding:16px;border:1px solid var(--divider-color,#e0e0e0);border-radius:var(--ha-card-border-radius,12px);background:var(--card-background-color,#fff);color:var(--primary-text-color,#212121);font:14px/1.4 var(--paper-font-body1_-_font-family,sans-serif)";this.textContent=m}})}console.error("[houseplan] stale houseplan-card.js: the implementation chunk is unavailable",e)}
File diff suppressed because one or more lines are too long
+129 -129
View File
@@ -1,85 +1,85 @@
{ {
"schema": 1, "schema": 1,
"fingerprint": "7d7d634b457de395f9087a171ae19ae5dd8b29cc2205221a8a00fca7156f6d71", "fingerprint": "e53b30c3c9da873ce146ad9277e308d6d94c0a64db834549c64230709021da6a",
"entry": "houseplan-card.js", "entry": "houseplan-card.js",
"panelEntry": "houseplan-panel.js", "panelEntry": "houseplan-panel.js",
"initialViewFiles": [ "initialViewFiles": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js", "houseplan-assets/houseplan-card-BwHO54W5.js",
"houseplan-card.js" "houseplan-card.js"
], ],
"initialViewGzipBytes": 291129, "initialViewGzipBytes": 291138,
"initialPanelFiles": [ "initialPanelFiles": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js", "houseplan-assets/houseplan-card-BwHO54W5.js",
"houseplan-panel.js" "houseplan-panel.js"
], ],
"initialPanelGzipBytes": 292652, "initialPanelGzipBytes": 292660,
"initialPanelOnlyFiles": [ "initialPanelOnlyFiles": [
"houseplan-panel.js" "houseplan-panel.js"
], ],
"initialPanelOnlyGzipBytes": 2326, "initialPanelOnlyGzipBytes": 2326,
"lazyFiles": [ "lazyFiles": [
"houseplan-assets/backdrop-pick-DbyFaYLE.js", "houseplan-assets/backdrop-pick-DXffOhAn.js",
"houseplan-assets/de-DwFh4Zlz.js", "houseplan-assets/de-D4BpWNDy.js",
"houseplan-assets/editor-C-R6yR6G.js", "houseplan-assets/editor-BNVcLBBu.js",
"houseplan-assets/fr-CuvaeWk1.js", "houseplan-assets/fr-BJE0dTJm.js",
"houseplan-assets/furniture-plan-art.generated-Dr2RUG6n.js", "houseplan-assets/furniture-plan-art.generated-cW4HByhl.js",
"houseplan-assets/houseplan-editor-runtime-BqW4n1Mh.js", "houseplan-assets/houseplan-editor-runtime-CIM3i2ZV.js",
"houseplan-assets/houseplan-onboarding-runtime-mDugU-dp.js", "houseplan-assets/houseplan-onboarding-runtime-DOiipnz2.js",
"houseplan-assets/hp-zigbee-topology-overlay-ArwNWgj8.js", "houseplan-assets/hp-zigbee-topology-overlay-BTNPYjHN.js",
"houseplan-assets/iso-scene-render-Dt8oursx.js", "houseplan-assets/iso-scene-render-D-wmXl79.js",
"houseplan-assets/live-interaction-runtime-BUeJnHZE.js", "houseplan-assets/live-interaction-runtime-DAKGAehV.js",
"houseplan-assets/pdf-export-DO8y2Ak4.js", "houseplan-assets/pdf-export-oUY5NKUF.js",
"houseplan-assets/summary-panel-runtime-loaded-BygdaMYA.js", "houseplan-assets/summary-panel-runtime-loaded-CMPY7SjL.js",
"houseplan-assets/zigbee-topology-runtime-DllensXq.js", "houseplan-assets/zigbee-topology-DjOib68n.js",
"houseplan-assets/zigbee-topology-u3KR6JXs.js" "houseplan-assets/zigbee-topology-runtime--t4EFNT8.js"
], ],
"lazyGzipBytes": 420096, "lazyGzipBytes": 420564,
"lazyEditorFiles": [ "lazyEditorFiles": [
"houseplan-assets/backdrop-pick-DbyFaYLE.js", "houseplan-assets/backdrop-pick-DXffOhAn.js",
"houseplan-assets/editor-C-R6yR6G.js", "houseplan-assets/editor-BNVcLBBu.js",
"houseplan-assets/furniture-plan-art.generated-Dr2RUG6n.js", "houseplan-assets/furniture-plan-art.generated-cW4HByhl.js",
"houseplan-assets/houseplan-editor-runtime-BqW4n1Mh.js", "houseplan-assets/houseplan-editor-runtime-CIM3i2ZV.js",
"houseplan-assets/zigbee-topology-u3KR6JXs.js" "houseplan-assets/zigbee-topology-DjOib68n.js"
], ],
"lazyEditorGzipBytes": 204956, "lazyEditorGzipBytes": 204959,
"lazyOnboardingFiles": [ "lazyOnboardingFiles": [
"houseplan-assets/backdrop-pick-DbyFaYLE.js", "houseplan-assets/backdrop-pick-DXffOhAn.js",
"houseplan-assets/houseplan-onboarding-runtime-mDugU-dp.js" "houseplan-assets/houseplan-onboarding-runtime-DOiipnz2.js"
], ],
"lazyOnboardingGzipBytes": 13917, "lazyOnboardingGzipBytes": 13918,
"lazyLocaleFiles": [ "lazyLocaleFiles": [
"houseplan-assets/de-DwFh4Zlz.js", "houseplan-assets/de-D4BpWNDy.js",
"houseplan-assets/fr-CuvaeWk1.js" "houseplan-assets/fr-BJE0dTJm.js"
], ],
"lazyLocaleGzipBytes": 54926, "lazyLocaleGzipBytes": 54929,
"lazyIsometricFiles": [ "lazyIsometricFiles": [
"houseplan-assets/iso-scene-render-Dt8oursx.js" "houseplan-assets/iso-scene-render-D-wmXl79.js"
], ],
"lazyIsometricGzipBytes": 14559, "lazyIsometricGzipBytes": 15018,
"lazyFurnitureArtFiles": [ "lazyFurnitureArtFiles": [
"houseplan-assets/furniture-plan-art.generated-Dr2RUG6n.js" "houseplan-assets/furniture-plan-art.generated-cW4HByhl.js"
], ],
"lazyFurnitureArtGzipBytes": 10252, "lazyFurnitureArtGzipBytes": 10250,
"lazyPdfFiles": [ "lazyPdfFiles": [
"houseplan-assets/furniture-plan-art.generated-Dr2RUG6n.js", "houseplan-assets/furniture-plan-art.generated-cW4HByhl.js",
"houseplan-assets/pdf-export-DO8y2Ak4.js" "houseplan-assets/pdf-export-oUY5NKUF.js"
], ],
"lazyPdfGzipBytes": 120123, "lazyPdfGzipBytes": 120121,
"files": [ "files": [
{ {
"path": "houseplan-assets/backdrop-pick-DbyFaYLE.js", "path": "houseplan-assets/backdrop-pick-DXffOhAn.js",
"sha256": "b9176e22bcde92ffb030a413d1b2aab5ea7b81038ca2ecdc366864268cbf2549", "sha256": "249badc55a32ae56641235d0dce08e41730b04dddec89a7dc048b36ac1d78c5d",
"rawBytes": 19956, "rawBytes": 19956,
"gzipBytes": 6880, "gzipBytes": 6880,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/de-DwFh4Zlz.js", "path": "houseplan-assets/de-D4BpWNDy.js",
"sha256": "5d94409c511d2282566e83dcb9864843491ad64d98d61216c7212d6624f73ac7", "sha256": "c45514f0a4ae9eddba7bae5b9397d4f345ea68b7f5f43f3a733dbd8334a608d5",
"rawBytes": 91590, "rawBytes": 91590,
"gzipBytes": 27746, "gzipBytes": 27746,
"isEntry": false, "isEntry": false,
@@ -87,209 +87,209 @@
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/editor-C-R6yR6G.js", "path": "houseplan-assets/editor-BNVcLBBu.js",
"sha256": "8391bb505f445b7e2c33ddcc63fab215ce9ff3ef9cab8cf4aab6d42faadb3ec3", "sha256": "1a9b16c32b4b0b39ba2873be681a5b1da41d2fb112a5558176620c45bdabeb1c",
"rawBytes": 3831, "rawBytes": 3831,
"gzipBytes": 1584, "gzipBytes": 1584,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/fr-CuvaeWk1.js", "path": "houseplan-assets/fr-BJE0dTJm.js",
"sha256": "c4759a1c6705b918be0d0f19c57cced49539a5aaf431f659400d2d450622d696", "sha256": "e3d2928826088af1e27cf08117a4059c430405493b3dfb687fd161ba3c4e56a8",
"rawBytes": 93884, "rawBytes": 93884,
"gzipBytes": 27180, "gzipBytes": 27183,
"isEntry": false, "isEntry": false,
"imports": [], "imports": [],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/furniture-plan-art.generated-Dr2RUG6n.js", "path": "houseplan-assets/furniture-plan-art.generated-cW4HByhl.js",
"sha256": "6097cccb755c81f5b34165a3b5575ab262f61f7e6aef661d611391209e65000d", "sha256": "282afdec3e439d50c55897ed671bb7d5e1a759950009fa76f83d542f23e07175",
"rawBytes": 33655, "rawBytes": 33655,
"gzipBytes": 10252, "gzipBytes": 10250,
"isEntry": false, "isEntry": false,
"imports": [], "imports": [],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/houseplan-card-DRCzjIQ2.js", "path": "houseplan-assets/houseplan-card-BwHO54W5.js",
"sha256": "0f679dcb32991b7ca5d1ba28230ee6fcbe1caf33d87fe5f925307c42044744ce", "sha256": "ad1bb0033b49a8c669aaee816ecca1e830d6e17b6706dd63db26692ae62afae3",
"rawBytes": 1034007, "rawBytes": 1034007,
"gzipBytes": 290326, "gzipBytes": 290334,
"isEntry": false, "isEntry": false,
"imports": [], "imports": [],
"dynamicImports": [ "dynamicImports": [
"houseplan-assets/de-DwFh4Zlz.js", "houseplan-assets/de-D4BpWNDy.js",
"houseplan-assets/editor-C-R6yR6G.js", "houseplan-assets/editor-BNVcLBBu.js",
"houseplan-assets/fr-CuvaeWk1.js", "houseplan-assets/fr-BJE0dTJm.js",
"houseplan-assets/furniture-plan-art.generated-Dr2RUG6n.js", "houseplan-assets/furniture-plan-art.generated-cW4HByhl.js",
"houseplan-assets/houseplan-editor-runtime-BqW4n1Mh.js", "houseplan-assets/houseplan-editor-runtime-CIM3i2ZV.js",
"houseplan-assets/houseplan-onboarding-runtime-mDugU-dp.js", "houseplan-assets/houseplan-onboarding-runtime-DOiipnz2.js",
"houseplan-assets/hp-zigbee-topology-overlay-ArwNWgj8.js", "houseplan-assets/hp-zigbee-topology-overlay-BTNPYjHN.js",
"houseplan-assets/iso-scene-render-Dt8oursx.js", "houseplan-assets/iso-scene-render-D-wmXl79.js",
"houseplan-assets/live-interaction-runtime-BUeJnHZE.js", "houseplan-assets/live-interaction-runtime-DAKGAehV.js",
"houseplan-assets/pdf-export-DO8y2Ak4.js", "houseplan-assets/pdf-export-oUY5NKUF.js",
"houseplan-assets/summary-panel-runtime-loaded-BygdaMYA.js" "houseplan-assets/summary-panel-runtime-loaded-CMPY7SjL.js"
] ]
}, },
{ {
"path": "houseplan-assets/houseplan-editor-runtime-BqW4n1Mh.js", "path": "houseplan-assets/houseplan-editor-runtime-CIM3i2ZV.js",
"sha256": "64c7b1ef7f336f3dfb17538731de32ba2da714dfc8d31bfda29f140173382b81", "sha256": "f083e7922ada296e4c9f9007c25ed1cdba8984c012bc59cf4713f60c5b23cade",
"rawBytes": 670150, "rawBytes": 670150,
"gzipBytes": 178814, "gzipBytes": 178814,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/backdrop-pick-DbyFaYLE.js", "houseplan-assets/backdrop-pick-DXffOhAn.js",
"houseplan-assets/furniture-plan-art.generated-Dr2RUG6n.js", "houseplan-assets/furniture-plan-art.generated-cW4HByhl.js",
"houseplan-assets/houseplan-card-DRCzjIQ2.js", "houseplan-assets/houseplan-card-BwHO54W5.js",
"houseplan-assets/zigbee-topology-u3KR6JXs.js" "houseplan-assets/zigbee-topology-DjOib68n.js"
], ],
"dynamicImports": [ "dynamicImports": [
"houseplan-assets/zigbee-topology-runtime-DllensXq.js" "houseplan-assets/zigbee-topology-runtime--t4EFNT8.js"
] ]
}, },
{ {
"path": "houseplan-assets/houseplan-onboarding-runtime-mDugU-dp.js", "path": "houseplan-assets/houseplan-onboarding-runtime-DOiipnz2.js",
"sha256": "2cefe30f30eca8af5be06a4d2df8dcf0c68486b44ca3c09d0256ff103135629b", "sha256": "0824591f0ce857978622c44a402ea6d5ceb80b975fec41cc46a256cfb1f0132a",
"rawBytes": 28287, "rawBytes": 28287,
"gzipBytes": 7037, "gzipBytes": 7038,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/backdrop-pick-DbyFaYLE.js", "houseplan-assets/backdrop-pick-DXffOhAn.js",
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/hp-zigbee-topology-overlay-ArwNWgj8.js", "path": "houseplan-assets/hp-zigbee-topology-overlay-BTNPYjHN.js",
"sha256": "c9d99e6bebe0c74169f6435b28d684c3f5e5ef8317254ee973cf4c2356eb6581", "sha256": "382900eacb3681742c0df824faac38a67b65276a7ac82ce87739aabd78b77c61",
"rawBytes": 10756, "rawBytes": 10756,
"gzipBytes": 3686, "gzipBytes": 3685,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js", "houseplan-assets/houseplan-card-BwHO54W5.js",
"houseplan-assets/zigbee-topology-runtime-DllensXq.js", "houseplan-assets/zigbee-topology-DjOib68n.js",
"houseplan-assets/zigbee-topology-u3KR6JXs.js" "houseplan-assets/zigbee-topology-runtime--t4EFNT8.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/iso-scene-render-Dt8oursx.js", "path": "houseplan-assets/iso-scene-render-D-wmXl79.js",
"sha256": "97b53f863be0e307bf38e3eea6104d79badeb58305655ef6b8ee343a9a6691f8", "sha256": "8eba7f629dfabe1a19544f65f4c8249eb0619c953bebd9fc45cb1f206a967793",
"rawBytes": 43068, "rawBytes": 44439,
"gzipBytes": 14559, "gzipBytes": 15018,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/live-interaction-runtime-BUeJnHZE.js", "path": "houseplan-assets/live-interaction-runtime-DAKGAehV.js",
"sha256": "48a5d8ab0205d3486c76a8bcd0981e82527d594112b785a44640cd8e96d56c1d", "sha256": "c57f884603150f2974f4fcb4f7fc5e8c6500cfa52b884f44ba76d16ab7f7a3d0",
"rawBytes": 8216, "rawBytes": 8216,
"gzipBytes": 3208, "gzipBytes": 3210,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/pdf-export-DO8y2Ak4.js", "path": "houseplan-assets/pdf-export-oUY5NKUF.js",
"sha256": "918018391821663424449b3c27263e1f30a453d089be7b5be8c14c165a815a9b", "sha256": "db70fc8198a4b0bdea53c955f100c1402d7c2602f88b4891f6f2c15d2fea0997",
"rawBytes": 236244, "rawBytes": 236244,
"gzipBytes": 109871, "gzipBytes": 109871,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/furniture-plan-art.generated-Dr2RUG6n.js", "houseplan-assets/furniture-plan-art.generated-cW4HByhl.js",
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/summary-panel-editor-Czf4K6I2.js", "path": "houseplan-assets/summary-panel-editor-9y_8uX0J.js",
"sha256": "df0ad6d7c8889ff33a8c7a0c5cd4d361ea7e65ad6c308cf97e412950621167dc", "sha256": "1dbdda18dafb8126e7ad120bdde703d56f11980f03ef31505f9593fbd30cdeee",
"rawBytes": 14824, "rawBytes": 14824,
"gzipBytes": 3402, "gzipBytes": 3404,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js", "houseplan-assets/houseplan-card-BwHO54W5.js",
"houseplan-assets/summary-panel-runtime-loaded-BygdaMYA.js" "houseplan-assets/summary-panel-runtime-loaded-CMPY7SjL.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/summary-panel-metrics-Dnp7gxnE.js", "path": "houseplan-assets/summary-panel-metrics-BHdOTChW.js",
"sha256": "9a4ded0910d0b555e38c2610a07b1a0c9bd1abe8594dde39f333dce9382b50ad", "sha256": "5856c494ff89cd875b9c395fba5bf30458e349ec384c7396502f4cdf3a57330a",
"rawBytes": 2610, "rawBytes": 2610,
"gzipBytes": 1308, "gzipBytes": 1307,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/summary-panel-runtime-loaded-BygdaMYA.js", "path": "houseplan-assets/summary-panel-runtime-loaded-CMPY7SjL.js",
"sha256": "f166ae677dfa80fffa5a39e7232a717da27ce8e2c2dd4e60af61b9eed516c075", "sha256": "49f5ae6480a6b59f60845aa4056e25a26dcad9d5c35135b8d4a6f1171c8b735f",
"rawBytes": 73366, "rawBytes": 73366,
"gzipBytes": 20087, "gzipBytes": 20089,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js"
], ],
"dynamicImports": [ "dynamicImports": [
"houseplan-assets/summary-panel-editor-Czf4K6I2.js", "houseplan-assets/summary-panel-editor-9y_8uX0J.js",
"houseplan-assets/summary-panel-metrics-Dnp7gxnE.js" "houseplan-assets/summary-panel-metrics-BHdOTChW.js"
] ]
}, },
{ {
"path": "houseplan-assets/zigbee-topology-runtime-DllensXq.js", "path": "houseplan-assets/zigbee-topology-DjOib68n.js",
"sha256": "946c4412328db049a1d17b31705de1a56c4e6580f2afc3aabdaa031c82937661", "sha256": "1d90800f37c0563399f580dc866a6d41db3c85d8022ea2cd89b0268cd1c6499e",
"rawBytes": 3941, "rawBytes": 18961,
"gzipBytes": 1766, "gzipBytes": 7431,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js", "houseplan-assets/houseplan-card-BwHO54W5.js"
"houseplan-assets/zigbee-topology-u3KR6JXs.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/zigbee-topology-u3KR6JXs.js", "path": "houseplan-assets/zigbee-topology-runtime--t4EFNT8.js",
"sha256": "573f48bb39a64259efc58ecbda9f302383713d9e086e7bb83ab15bf50b0a4cdc", "sha256": "999564c9fbe6af24d3afaaf9ec74cf963a2c12f32567e4415f0bcdb7a3cd0e55",
"rawBytes": 18961, "rawBytes": 3941,
"gzipBytes": 7426, "gzipBytes": 1765,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js",
"houseplan-assets/zigbee-topology-DjOib68n.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-card.js", "path": "houseplan-card.js",
"sha256": "aad009aa3d40e8db0faa474392dc543a7cc7fde547ac70e73aee5f1d2fe778fe", "sha256": "fb415bf838d5f63f674a7fa1a2110393e0808d4ac249882396c9a371232ea55b",
"rawBytes": 1205, "rawBytes": 1205,
"gzipBytes": 803, "gzipBytes": 804,
"isEntry": true, "isEntry": true,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-panel.js", "path": "houseplan-panel.js",
"sha256": "37c40ba5b21f8e1ad1c3ac8f2fa72d138246e8d62fe21418658a09ce7973211d", "sha256": "cd9a9dd3f8a1b92e0363695b424bbb93614f3be1aae614751b82872d5c96e55e",
"rawBytes": 6165, "rawBytes": 6165,
"gzipBytes": 2326, "gzipBytes": 2326,
"isEntry": true, "isEntry": true,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-DRCzjIQ2.js" "houseplan-assets/houseplan-card-BwHO54W5.js"
], ],
"dynamicImports": [] "dynamicImports": []
} }
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,14 +1,14 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="7d7d634b457de395f9087a171ae19ae5dd8b29cc2205221a8a00fca7156f6d71";import{q as e,l as o,v as t,e5 as s,A as a,e6 as i,e7 as l,e8 as n,E as r,c}from"./houseplan-card-DRCzjIQ2.js";class h extends e{constructor(){super(...arguments),this._spaces=null,this._spacesLoading=!1,this._spacesAuthoritative=!1}setConfig(e){this._config=e}async _loadSpaces(){if(!this._spaces&&!this._spacesLoading&&this.hass){this._spacesLoading=!0;try{const e=await this.hass.callWS({type:"houseplan/config/get"});this._spaces=(e?.config?.spaces||[]).map(e=>({value:e.id,label:e.title||e.id})),this._spacesAuthoritative=!0}catch{this._spaces=[],this._spacesAuthoritative=!1}finally{this._spacesLoading=!1}}}get _lang(){return o(this.hass,this._config?.language)}get _floorToken(){const e=this._config?.floor;return"number"==typeof e?`__houseplan_yaml_floor_index__:${String(e)}`:null}get _formData(){const e={...this._config},o=this._floorToken;return o?e.floor=o:Object.prototype.hasOwnProperty.call(e,"floor")||(e.floor=""),e}get _schema(){const e=this._spaces||[],o=this._lang,a=[{value:"",label:t(o,"editor.floor_none")}],i=this._floorToken;i&&a.push({value:i,label:t(o,"editor.floor_index",{index:String(this._config?.floor)})});const l="string"==typeof this._config?.floor?this._config.floor:"";l&&!e.some(e=>e.value===l)&&a.push({value:l,label:l}),a.push(...e);const n="string"==typeof this._config?.default_floor?this._config.default_floor:"",r=[...e];return n&&!e.some(e=>e.value===n)&&r.unshift({value:n,label:n}),[{name:"title",selector:{text:{}}},{name:"floor",selector:{select:{mode:"dropdown",options:a}}},e.length?{name:"default_floor",selector:{select:{mode:"dropdown",options:r}}}:{name:"default_floor",selector:{text:{}}},{name:"language",selector:{select:{mode:"dropdown",options:s(t(o,"editor.lang_auto"),this._config?.language)}}},{name:"icon_size",selector:{number:{min:1,max:6,step:.1,mode:"box"}}},{name:"show_temperature",selector:{boolean:{}}},{name:"live_states",selector:{boolean:{}}},{name:"show_signal",selector:{boolean:{}}},{name:"kiosk",selector:{boolean:{}}},{name:"cycle",selector:{number:{min:0,max:3600,step:5,mode:"box"}}}]}render(){if(!this.hass||!this._config)return a;const e=i(this,l,o(this.hass,this._config.language));if("cold"===e)return n();if("warm"===e)return r;this._loadSpaces();const s=this._lang,h={title:t(s,"editor.title"),floor:t(s,"editor.floor"),default_floor:t(s,"editor.default_floor"),language:t(s,"editor.language"),icon_size:t(s,"editor.icon_size"),show_temperature:t(s,"editor.show_temperature"),live_states:t(s,"editor.live_states"),show_signal:t(s,"editor.show_signal"),kiosk:t(s,"editor.kiosk"),cycle:t(s,"editor.cycle")},f=this._schema,_=function(e,o,t){if(!t||null===o)return null;const s="string"==typeof e?.default_floor?e.default_floor:"";return!s||o.some(e=>e.value===s)?null:s}(this._config,this._spaces,this._spacesAuthoritative),d=e=>c`<ha-form globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="e53b30c3c9da873ce146ad9277e308d6d94c0a64db834549c64230709021da6a";import{q as e,l as o,v as t,e5 as s,A as a,e6 as i,e7 as l,e8 as n,E as r,c}from"./houseplan-card-BwHO54W5.js";class h extends e{constructor(){super(...arguments),this._spaces=null,this._spacesLoading=!1,this._spacesAuthoritative=!1}setConfig(e){this._config=e}async _loadSpaces(){if(!this._spaces&&!this._spacesLoading&&this.hass){this._spacesLoading=!0;try{const e=await this.hass.callWS({type:"houseplan/config/get"});this._spaces=(e?.config?.spaces||[]).map(e=>({value:e.id,label:e.title||e.id})),this._spacesAuthoritative=!0}catch{this._spaces=[],this._spacesAuthoritative=!1}finally{this._spacesLoading=!1}}}get _lang(){return o(this.hass,this._config?.language)}get _floorToken(){const e=this._config?.floor;return"number"==typeof e?`__houseplan_yaml_floor_index__:${String(e)}`:null}get _formData(){const e={...this._config},o=this._floorToken;return o?e.floor=o:Object.prototype.hasOwnProperty.call(e,"floor")||(e.floor=""),e}get _schema(){const e=this._spaces||[],o=this._lang,a=[{value:"",label:t(o,"editor.floor_none")}],i=this._floorToken;i&&a.push({value:i,label:t(o,"editor.floor_index",{index:String(this._config?.floor)})});const l="string"==typeof this._config?.floor?this._config.floor:"";l&&!e.some(e=>e.value===l)&&a.push({value:l,label:l}),a.push(...e);const n="string"==typeof this._config?.default_floor?this._config.default_floor:"",r=[...e];return n&&!e.some(e=>e.value===n)&&r.unshift({value:n,label:n}),[{name:"title",selector:{text:{}}},{name:"floor",selector:{select:{mode:"dropdown",options:a}}},e.length?{name:"default_floor",selector:{select:{mode:"dropdown",options:r}}}:{name:"default_floor",selector:{text:{}}},{name:"language",selector:{select:{mode:"dropdown",options:s(t(o,"editor.lang_auto"),this._config?.language)}}},{name:"icon_size",selector:{number:{min:1,max:6,step:.1,mode:"box"}}},{name:"show_temperature",selector:{boolean:{}}},{name:"live_states",selector:{boolean:{}}},{name:"show_signal",selector:{boolean:{}}},{name:"kiosk",selector:{boolean:{}}},{name:"cycle",selector:{number:{min:0,max:3600,step:5,mode:"box"}}}]}render(){if(!this.hass||!this._config)return a;const e=i(this,l,o(this.hass,this._config.language));if("cold"===e)return n();if("warm"===e)return r;this._loadSpaces();const s=this._lang,h={title:t(s,"editor.title"),floor:t(s,"editor.floor"),default_floor:t(s,"editor.default_floor"),language:t(s,"editor.language"),icon_size:t(s,"editor.icon_size"),show_temperature:t(s,"editor.show_temperature"),live_states:t(s,"editor.live_states"),show_signal:t(s,"editor.show_signal"),kiosk:t(s,"editor.kiosk"),cycle:t(s,"editor.cycle")},_=this._schema,f=function(e,o,t){if(!t||null===o)return null;const s="string"==typeof e?.default_floor?e.default_floor:"";return!s||o.some(e=>e.value===s)?null:s}(this._config,this._spaces,this._spacesAuthoritative),d=e=>c`<ha-form
.hass=${this.hass} .hass=${this.hass}
.data=${this._formData} .data=${this._formData}
.schema=${e} .schema=${e}
.computeLabel=${e=>h[e.name]||e.name} .computeLabel=${e=>h[e.name]||e.name}
@value-changed=${this._valueChanged} @value-changed=${this._valueChanged}
></ha-form>`;return c` ></ha-form>`;return c`
${d(f.slice(0,3))} ${d(_.slice(0,3))}
${_?c`<div class="default-floor-error" role="alert" ${f?c`<div class="default-floor-error" role="alert"
style="color:var(--error-color,#db4437);margin:-4px 0 12px;overflow-wrap:anywhere"> style="color:var(--error-color,#db4437);margin:-4px 0 12px;overflow-wrap:anywhere">
${t(s,"editor.default_floor_missing",{id:_})} ${t(s,"editor.default_floor_missing",{id:f})}
</div>`:a} </div>`:a}
${d(f.slice(3))} ${d(_.slice(3))}
`}_valueChanged(e){const o={...this._config,...e.detail.value};""===o.floor?delete o.floor:o.floor===this._floorToken&&(o.floor=this._config?.floor);const t=new Event("config-changed",{bubbles:!0,composed:!0});t.detail={config:o},this.dispatchEvent(t)}}h.properties={hass:{attribute:!1},_config:{state:!0},_spaces:{state:!0}},customElements.get("houseplan-card-editor")||customElements.define("houseplan-card-editor",h); `}_valueChanged(e){const o={...this._config,...e.detail.value};""===o.floor?delete o.floor:o.floor===this._floorToken&&(o.floor=this._config?.floor);const t=new Event("config-changed",{bubbles:!0,composed:!0});t.detail={config:o},this.dispatchEvent(t)}}h.properties={hass:{attribute:!1},_config:{state:!0},_spaces:{state:!0}},customElements.get("houseplan-card-editor")||customElements.define("houseplan-card-editor",h);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="7d7d634b457de395f9087a171ae19ae5dd8b29cc2205221a8a00fca7156f6d71";import{l as t,b4 as s,A as e,v as a,c as o,cn as l,co as i,cp as h,cq as c,b1 as n,cr as r,cw as p,cs as d,ct as _,cu as u,cv as g,cx as m,cy as b,dt as $,du as v,dv as f,b0 as y,b2 as w,dw as D}from"./houseplan-card-DRCzjIQ2.js";import{c as k,e as S,r as C,a as M}from"./backdrop-pick-DbyFaYLE.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="7d7d634b457de395f9087a171ae19ae5dd8b29cc2205221a8a00fca7156f6d71";class L{constructor(t){this.host=t,this._toggleServerPlans=async()=>{const t=this.host._spaceDialog;if(t)if(t.pickSaved)this.host._spaceDialog={...t,pickSaved:!1};else{this.host._spaceDialog={...t,pickSaved:!0,savedBusy:!0};try{const t=await this.host.hass.callWS({type:"houseplan/plans/list"}),s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:t?.plans||[],savedBusy:!1})}catch(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:[],savedBusy:!1}),this.host._showToast(this.host._t("toast.plans_list_failed",{err:this.host._errText(t)}))}}}}_help(l){const i=`${l}.aria`,h=t(this.host.hass,this.host._config?.language);return s(h,l)&&s(h,i)?o`<hp-help data-help-key=${l} globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="e53b30c3c9da873ce146ad9277e308d6d94c0a64db834549c64230709021da6a";import{l as t,b4 as s,A as e,v as a,c as o,cn as l,co as i,cp as h,cq as c,b1 as n,cr as r,cw as p,cs as d,ct as _,cu as u,cv as g,cx as m,cy as b,dt as $,du as v,dv as f,b0 as y,b2 as w,dw as D}from"./houseplan-card-BwHO54W5.js";import{c as k,e as S,r as C,a as M}from"./backdrop-pick-DXffOhAn.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="e53b30c3c9da873ce146ad9277e308d6d94c0a64db834549c64230709021da6a";class L{constructor(t){this.host=t,this._toggleServerPlans=async()=>{const t=this.host._spaceDialog;if(t)if(t.pickSaved)this.host._spaceDialog={...t,pickSaved:!1};else{this.host._spaceDialog={...t,pickSaved:!0,savedBusy:!0};try{const t=await this.host.hass.callWS({type:"houseplan/plans/list"}),s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:t?.plans||[],savedBusy:!1})}catch(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:[],savedBusy:!1}),this.host._showToast(this.host._t("toast.plans_list_failed",{err:this.host._errText(t)}))}}}}_help(l){const i=`${l}.aria`,h=t(this.host.hass,this.host._config?.language);return s(h,l)&&s(h,i)?o`<hp-help data-help-key=${l}
.text=${a(h,l)} .ariaLabel=${a(h,i)}></hp-help>`:e}_openSpaceDialog(t,s){if(!this.host._serverStorage||!this.host._serverCfg)return void this.host._showToast(this.host._t("toast.integration_missing"));if("edit"===t){const e=this.host._serverCfg.spaces.find(t=>t.id===s);if(!e)return;const a=l(e),o=e.settings?.custom_fill&&"object"==typeof e.settings.custom_fill?i(e.settings.custom_fill):null,p="none"===a.fill?{...o||h,a:0}:o;return void(this.host._spaceDialog={mode:t,spaceId:s,title:e.title,planUrl:e.plan_url||null,planFile:null,source:e.plan_url?"file":"draw",showBorders:a.showBorders,showNames:a.showNames,zeroWallStyle:r(e),displayTouched:!0,hideDecor:a.hideDecor,hideOpenings:a.hideOpenings,roomColor:a.color,roomOpacity:a.opacity,fillMode:"none"===a.fill?"custom":a.fill,customFill:p,glowEnabled:a.glow,bgColor:a.bgColor,bgMode:"static"===e.settings?.bg_mode||"daynight"===e.settings?.bg_mode?e.settings.bg_mode:null,northDeg:n({},e.settings),sunRays:"boolean"==typeof e.settings?.sun_rays?e.settings.sun_rays:null,tempMin:a.tempMin,tempMax:a.tempMax,showLqi:a.showLqi??this.host._config?.show_signal??!0,cardFontScale:a.cardFontScale,labelTemp:a.labelTemp,labelHum:a.labelHum,labelLqi:a.labelLqi,labelLight:a.labelLight,cellCm:Number(e.cell_cm)>0?Number(e.cell_cm):5,cellCmInput:c(Number(e.cell_cm)>0?Number(e.cell_cm):5,this.host._imperial),cellCmTouched:!1,busy:!1})}const e=p(this.host._imperial);this.host._spaceDialog={mode:t,title:"",planUrl:null,planFile:null,...m(),hideDecor:!1,hideOpenings:!1,zeroWallStyle:"dashed",roomColor:g,roomOpacity:u,fillMode:"custom",customFill:{...h,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:_,tempMax:d,showLqi:this.host._config?.show_signal??!0,cardFontScale:1,labelTemp:!1,labelHum:!1,labelLqi:!1,labelLight:!1,cellCm:e,cellCmInput:c(e,this.host._imperial),cellCmTouched:!1,busy:!1}}async _pickPlanFile(t){const s=t.target,e=s.files?.[0];if(!e||!this.host._spaceDialog)return;s.value="";const a=await k(e);if("reject"===a.kind)return void this.host._showToast(this.host._t("toast.plan_formats"));if("guard"===a.kind)return void(this.host._backdropGuard=a.state);const o=await S(e,a.ext,e.name);this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:o})}_renderBackdropGuard(){return C(this.host,t=>{this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:t})},()=>{this.host._backdropGuard=null},this.host.hass)??e}_useServerPlan(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,planUrl:t,planFile:null,pickSaved:!1,savedAspect:void 0},this.host._aspectJob=this._readPlanAspect(t))}async _readPlanAspect(t){for(let s=0;s<40;s++){const s=this.host._display(t);if(s){const e=await new Promise(t=>{const e=new Image;e.onload=()=>t(e.naturalWidth&&e.naturalHeight?e.naturalWidth/e.naturalHeight:0),e.onerror=()=>t(0),e.src=s}),a=this.host._spaceDialog;return a&&a.planUrl===t&&Number.isFinite(e)&&e>0?(this.host._spaceDialog={...a,savedAspect:e},e):0}if(await new Promise(t=>setTimeout(t,150)),this.host._spaceDialog?.planUrl!==t)return 0}return 0}async _deleteServerPlan(t){const s=this.host._spaceDialog,e=s?.saved?.find(s=>s.name===t);if(!s||!e||e.used_by.length||e.url===s.planUrl)return;const a=await this.host._confirmDanger({key:"delete-plan",kind:"destructive",title:this.host._t("confirm.delete_plan_title"),message:this.host._t("confirm.delete_plan_body"),objectName:t,confirmLabel:this.host._t("btn.delete"),cancelLabel:this.host._t("btn.cancel")}),o=this.host._spaceDialog,l=o?.saved?.find(s=>s.name===t);if(a&&o&&l&&l.url===e.url&&l.modified===e.modified&&!l.used_by.length&&l.url!==o.planUrl)try{await this.host.hass.callWS({type:"houseplan/plans/delete",name:t});const s=this.host._spaceDialog;s?.saved&&(this.host._spaceDialog={...s,saved:s.saved.filter(s=>s.name!==t)})}catch(t){this.host._showToast(this.host._t("toast.plan_delete_failed",{err:this.host._errText(t)}))}}_renderServerPlans(t){if(t.savedBusy)return o`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return o`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return o`<div class="savedplans"> .text=${a(h,l)} .ariaLabel=${a(h,i)}></hp-help>`:e}_openSpaceDialog(t,s){if(!this.host._serverStorage||!this.host._serverCfg)return void this.host._showToast(this.host._t("toast.integration_missing"));if("edit"===t){const e=this.host._serverCfg.spaces.find(t=>t.id===s);if(!e)return;const a=l(e),o=e.settings?.custom_fill&&"object"==typeof e.settings.custom_fill?i(e.settings.custom_fill):null,p="none"===a.fill?{...o||h,a:0}:o;return void(this.host._spaceDialog={mode:t,spaceId:s,title:e.title,planUrl:e.plan_url||null,planFile:null,source:e.plan_url?"file":"draw",showBorders:a.showBorders,showNames:a.showNames,zeroWallStyle:r(e),displayTouched:!0,hideDecor:a.hideDecor,hideOpenings:a.hideOpenings,roomColor:a.color,roomOpacity:a.opacity,fillMode:"none"===a.fill?"custom":a.fill,customFill:p,glowEnabled:a.glow,bgColor:a.bgColor,bgMode:"static"===e.settings?.bg_mode||"daynight"===e.settings?.bg_mode?e.settings.bg_mode:null,northDeg:n({},e.settings),sunRays:"boolean"==typeof e.settings?.sun_rays?e.settings.sun_rays:null,tempMin:a.tempMin,tempMax:a.tempMax,showLqi:a.showLqi??this.host._config?.show_signal??!0,cardFontScale:a.cardFontScale,labelTemp:a.labelTemp,labelHum:a.labelHum,labelLqi:a.labelLqi,labelLight:a.labelLight,cellCm:Number(e.cell_cm)>0?Number(e.cell_cm):5,cellCmInput:c(Number(e.cell_cm)>0?Number(e.cell_cm):5,this.host._imperial),cellCmTouched:!1,busy:!1})}const e=p(this.host._imperial);this.host._spaceDialog={mode:t,title:"",planUrl:null,planFile:null,...m(),hideDecor:!1,hideOpenings:!1,zeroWallStyle:"dashed",roomColor:g,roomOpacity:u,fillMode:"custom",customFill:{...h,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:_,tempMax:d,showLqi:this.host._config?.show_signal??!0,cardFontScale:1,labelTemp:!1,labelHum:!1,labelLqi:!1,labelLight:!1,cellCm:e,cellCmInput:c(e,this.host._imperial),cellCmTouched:!1,busy:!1}}async _pickPlanFile(t){const s=t.target,e=s.files?.[0];if(!e||!this.host._spaceDialog)return;s.value="";const a=await k(e);if("reject"===a.kind)return void this.host._showToast(this.host._t("toast.plan_formats"));if("guard"===a.kind)return void(this.host._backdropGuard=a.state);const o=await S(e,a.ext,e.name);this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:o})}_renderBackdropGuard(){return C(this.host,t=>{this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:t})},()=>{this.host._backdropGuard=null},this.host.hass)??e}_useServerPlan(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,planUrl:t,planFile:null,pickSaved:!1,savedAspect:void 0},this.host._aspectJob=this._readPlanAspect(t))}async _readPlanAspect(t){for(let s=0;s<40;s++){const s=this.host._display(t);if(s){const e=await new Promise(t=>{const e=new Image;e.onload=()=>t(e.naturalWidth&&e.naturalHeight?e.naturalWidth/e.naturalHeight:0),e.onerror=()=>t(0),e.src=s}),a=this.host._spaceDialog;return a&&a.planUrl===t&&Number.isFinite(e)&&e>0?(this.host._spaceDialog={...a,savedAspect:e},e):0}if(await new Promise(t=>setTimeout(t,150)),this.host._spaceDialog?.planUrl!==t)return 0}return 0}async _deleteServerPlan(t){const s=this.host._spaceDialog,e=s?.saved?.find(s=>s.name===t);if(!s||!e||e.used_by.length||e.url===s.planUrl)return;const a=await this.host._confirmDanger({key:"delete-plan",kind:"destructive",title:this.host._t("confirm.delete_plan_title"),message:this.host._t("confirm.delete_plan_body"),objectName:t,confirmLabel:this.host._t("btn.delete"),cancelLabel:this.host._t("btn.cancel")}),o=this.host._spaceDialog,l=o?.saved?.find(s=>s.name===t);if(a&&o&&l&&l.url===e.url&&l.modified===e.modified&&!l.used_by.length&&l.url!==o.planUrl)try{await this.host.hass.callWS({type:"houseplan/plans/delete",name:t});const s=this.host._spaceDialog;s?.saved&&(this.host._spaceDialog={...s,saved:s.saved.filter(s=>s.name!==t)})}catch(t){this.host._showToast(this.host._t("toast.plan_delete_failed",{err:this.host._errText(t)}))}}_renderServerPlans(t){if(t.savedBusy)return o`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return o`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return o`<div class="savedplans">
${s.map(s=>{return o` ${s.map(s=>{return o`
<div class="savedplan ${s.url===t.planUrl?"cur":""}"> <div class="savedplan ${s.url===t.planUrl?"cur":""}">
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="7d7d634b457de395f9087a171ae19ae5dd8b29cc2205221a8a00fca7156f6d71";import{c as a,A as e}from"./houseplan-card-DRCzjIQ2.js";import{s,n as t,a as l,m as r,b as o,c as i,d as u}from"./summary-panel-runtime-loaded-BygdaMYA.js";const m=m=>{const{host:c,dialog:d,problems:n,t:b}=m,y=n.find(a=>"error"===a.kind),$=d.localShow!==d.baseLocalShow||!d.localOnly&&!s(t(d.draft),d.base),p=$&&!d.busy&&!y,v=a=>n.find(e=>e.path===a),h=a=>a?b(`summary.problem.${a.code}`):"",k=()=>m.close(),g=a`<label class="summary-switch" for="summary-local-show"> globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="e53b30c3c9da873ce146ad9277e308d6d94c0a64db834549c64230709021da6a";import{c as a,A as e}from"./houseplan-card-BwHO54W5.js";import{s,n as t,a as l,m as r,b as o,c as i,d as u}from"./summary-panel-runtime-loaded-CMPY7SjL.js";const m=m=>{const{host:c,dialog:d,problems:n,t:b}=m,y=n.find(a=>"error"===a.kind),$=d.localShow!==d.baseLocalShow||!d.localOnly&&!s(t(d.draft),d.base),p=$&&!d.busy&&!y,v=a=>n.find(e=>e.path===a),h=a=>a?b(`summary.problem.${a.code}`):"",k=()=>m.close(),g=a`<label class="summary-switch" for="summary-local-show">
<span class="summary-switch-caption"><strong>${b("summary.show_local")}</strong> <span class="summary-switch-caption"><strong>${b("summary.show_local")}</strong>
<small id="summary-local-show-hint">${b("summary.show_local_hint")}</small></span> <small id="summary-local-show-hint">${b("summary.show_local_hint")}</small></span>
<input id="summary-local-show" data-summary-local-show type="checkbox" <input id="summary-local-show" data-summary-local-show type="checkbox"
@@ -1 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="7d7d634b457de395f9087a171ae19ae5dd8b29cc2205221a8a00fca7156f6d71";import{eb as e,P as t,a5 as n,M as i,aq as r,N as o,bs as s,br as a,a4 as c,a3 as l,aA as d,ec as u,ed as f,bu as m,ee as g}from"./houseplan-card-DRCzjIQ2.js";function v(e){if(!e.registry.authoritative)return null;const t=new Set,n=d(e.markers);for(const i of Object.values(e.registry.devices||{}))i?.id&&"service"!==i.entry_type&&!n.devices.has(i.id)&&i.area_id&&e.areaToSpace[i.area_id]&&t.add(i.id);for(const i of e.markers||[]){if(i.removed||"virtual"===i.binding)continue;const r=String(i.binding||"").indexOf(":");if(r<1)continue;const o=i.binding.slice(0,r),s=i.binding.slice(r+1),a="device"===o?e.registry.devices?.[s]:null,c="entity"===o?e.registry.entities?.[s]:null,l="device"===o?s:c?.device_id,d="device"===o?a?.area_id:c?.area_id||l&&e.registry.devices?.[l]?.area_id,u="string"==typeof i.room_id&&i.room_id.length>0&&null===i.area?"":i.area||d||"",f=u&&e.areaToSpace[u]||i.space||e.firstSpaceId;l&&e.registry.devices?.[l]&&e.spaceIds.has(f)&&(!n.devices.has(l)||"entity"===o&&n.liveEntities.has(s))&&t.add(l)}return t}function y(e,t){return e?.length?t?.length?g(e,t):e:t}function _(e,t){const n=c(e.rooms,t.walls,t.openCuts,[],i,t.cellCm,r,o);return{roomGeom:"ok"===n.status||"degraded-extra"===n.status?n.roomGeom:void 0,multiWallNodes:l(e.rooms,t.walls,t.openCuts,i,t.cellCm,r,o)}}function*h(c,l,d=_){try{let u=0;for(const f of l){const l=c.spaces.find(e=>String(e?.id)===f.id);if(!l)continue;const m=e(l,f),g=d(f,m);let v=null;for(const e of f.rooms){if(!e.id)continue;const a=t(e);if(!a)continue;const c=n(f.rooms,e.id,m.walls,m.openCuts,i,m.cellCm,r,o,g.roomGeom,g.multiWallNodes)||a;v=y(v,s(c,m.physicalBodies)),yield}const _=m.cellCm/r;u+=a(v)*_*_/1e4}return u}catch{return null}}function p(e,t,n=_){const i=h(e,t,n);let r=i.next();for(;!r.done;)r=i.next();return r.value}function b(e,t,n,i){if("system"!==e.type)return null;if("device_count"===e.key)return null===t.deviceCount?null:String(t.deviceCount);if("total_area"===e.key)return null===t.areaM2?null:m(t.areaM2,"mi"===n?.config?.unit_system?.length);try{return new Intl.DateTimeFormat(i||void 0,{dateStyle:"short",timeStyle:"short",timeZone:n?.config?.time_zone||void 0}).format(t.now)}catch{return t.now.toLocaleString()}}function S(e,t){const n=e?.states?.[t];if(!n)return null;const i=u(e,t);return i?f(i,String(n.attributes?.unit_of_measurement||"")):null}export{h as cleanFloorAreaSteps,v as representedHaDeviceIds,_ as spaceWallGeometry,S as summaryEntityValue,b as summarySystemValue,p as totalCleanFloorAreaM2}; globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="e53b30c3c9da873ce146ad9277e308d6d94c0a64db834549c64230709021da6a";import{eb as e,P as t,a5 as n,M as i,aq as r,N as o,bs as s,br as a,a4 as c,a3 as l,aA as d,ec as u,ed as f,bu as m,ee as g}from"./houseplan-card-BwHO54W5.js";function v(e){if(!e.registry.authoritative)return null;const t=new Set,n=d(e.markers);for(const i of Object.values(e.registry.devices||{}))i?.id&&"service"!==i.entry_type&&!n.devices.has(i.id)&&i.area_id&&e.areaToSpace[i.area_id]&&t.add(i.id);for(const i of e.markers||[]){if(i.removed||"virtual"===i.binding)continue;const r=String(i.binding||"").indexOf(":");if(r<1)continue;const o=i.binding.slice(0,r),s=i.binding.slice(r+1),a="device"===o?e.registry.devices?.[s]:null,c="entity"===o?e.registry.entities?.[s]:null,l="device"===o?s:c?.device_id,d="device"===o?a?.area_id:c?.area_id||l&&e.registry.devices?.[l]?.area_id,u="string"==typeof i.room_id&&i.room_id.length>0&&null===i.area?"":i.area||d||"",f=u&&e.areaToSpace[u]||i.space||e.firstSpaceId;l&&e.registry.devices?.[l]&&e.spaceIds.has(f)&&(!n.devices.has(l)||"entity"===o&&n.liveEntities.has(s))&&t.add(l)}return t}function y(e,t){return e?.length?t?.length?g(e,t):e:t}function _(e,t){const n=c(e.rooms,t.walls,t.openCuts,[],i,t.cellCm,r,o);return{roomGeom:"ok"===n.status||"degraded-extra"===n.status?n.roomGeom:void 0,multiWallNodes:l(e.rooms,t.walls,t.openCuts,i,t.cellCm,r,o)}}function*h(c,l,d=_){try{let u=0;for(const f of l){const l=c.spaces.find(e=>String(e?.id)===f.id);if(!l)continue;const m=e(l,f),g=d(f,m);let v=null;for(const e of f.rooms){if(!e.id)continue;const a=t(e);if(!a)continue;const c=n(f.rooms,e.id,m.walls,m.openCuts,i,m.cellCm,r,o,g.roomGeom,g.multiWallNodes)||a;v=y(v,s(c,m.physicalBodies)),yield}const _=m.cellCm/r;u+=a(v)*_*_/1e4}return u}catch{return null}}function p(e,t,n=_){const i=h(e,t,n);let r=i.next();for(;!r.done;)r=i.next();return r.value}function b(e,t,n,i){if("system"!==e.type)return null;if("device_count"===e.key)return null===t.deviceCount?null:String(t.deviceCount);if("total_area"===e.key)return null===t.areaM2?null:m(t.areaM2,"mi"===n?.config?.unit_system?.length);try{return new Intl.DateTimeFormat(i||void 0,{dateStyle:"short",timeStyle:"short",timeZone:n?.config?.time_zone||void 0}).format(t.now)}catch{return t.now.toLocaleString()}}function S(e,t){const n=e?.states?.[t];if(!n)return null;const i=u(e,t);return i?f(i,String(n.attributes?.unit_of_measurement||"")):null}export{h as cleanFloorAreaSteps,v as representedHaDeviceIds,_ as spaceWallGeometry,S as summaryEntityValue,b as summarySystemValue,p as totalCleanFloorAreaM2};
@@ -1 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="7d7d634b457de395f9087a171ae19ae5dd8b29cc2205221a8a00fca7156f6d71";import{n as t,b as n}from"./zigbee-topology-u3KR6JXs.js";import{F as e}from"./houseplan-card-DRCzjIQ2.js";const o=new WeakMap;function i(t){const n=function(t){const n=t?.connection||t;return!n||"object"!=typeof n&&"function"!=typeof n?null:n}(t);if(!n)return null;let e=o.get(n);return e||(e={revision:0,topologies:[],states:{},listeners:new Set,inflight:new Map},o.set(n,e)),e}function r(t,n,e){t.states={...t.states,[n]:e},function(t){t.revision++;for(const n of t.listeners)n()}(t)}function s(t){const n=t?.code;if("permission"===n||"unsupported"===n||"timeout"===n||"invalid_topic"===n||"invalid_payload"===n)return n;const e=String(t?.message||"").toLowerCase();return e.includes("unauthor")||e.includes("permission")?"permission":e.includes("unknown_command")||e.includes("not found")?"unsupported":"provider"}function a(t){return Object.assign(new Error(t),{code:t})}function c(t,n,e){const o=t.inflight.get(n);if(o)return o;r(t,n,{phase:"loading"});const i=e().then(n=>{if(!n.nodes.length&&n.warnings.some(t=>"invalid_payload"===t.code))throw a("invalid_payload");!function(t,n){t.topologies=[...t.topologies.filter(t=>!(t.provider===n.provider&&t.instanceId===n.instanceId)),n],r(t,"zha"===n.provider?"zha":`z2m:${n.instanceId}`,{phase:"ready",obtainedAt:n.obtainedAt,partial:n.warnings.length>0})}(t,n)}).catch(e=>{r(t,n,{phase:"error",error:s(e)})}).finally(()=>t.inflight.delete(n));return t.inflight.set(n,i),i}function l(t){const n=i(t);return n?{revision:n.revision,topologies:n.topologies,states:n.states}:{revision:0,topologies:[],states:{}}}function u(t,n){const e=i(t);return e?(e.listeners.add(n),()=>e.listeners.delete(n)):()=>{}}function p(t){if(!0!==t?.user?.is_admin)throw a("permission")}function f(n){const e=i(n);return e?c(e,"zha",async()=>{if(p(n),"function"!=typeof n?.callWS)throw a("unsupported");return t(await n.callWS({type:"zha/devices"}))}):Promise.resolve()}function d(t){return null!==t&&"object"==typeof t?t:null}function h(t){const n=d(t),e=n?.payload??t;if("string"!=typeof e)return e;try{return JSON.parse(e)}catch{return null}}async function m(t,n){let e;try{return await Promise.race([t,new Promise((t,o)=>{e=globalThis.setTimeout(()=>o(a("timeout")),Math.max(1,n))})])}finally{void 0!==e&&globalThis.clearTimeout(e)}}function g(t,o,r=15e4){const s=i(t);if(!s)return Promise.resolve();const l=e(o);return c(s,`z2m:${l||String(o)}`,async()=>{if(p(t),!l)throw a("invalid_topic");const e=t.connection,o=e?.subscribeMessage;if("function"!=typeof o||"function"!=typeof t?.callService)throw a("unsupported");const i=function(){const t=globalThis.crypto;return"function"==typeof t?.randomUUID?`houseplan-${t.randomUUID()}`:`houseplan-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}(),s=Date.now()+Math.max(1,r);let c=!1,u=null,f=null,g=null;const y=new Promise(t=>{u=t}),w=new Promise((t,n)=>{f=t,g=n}),b=[];try{const r=await o.call(e,t=>{!0===d(t)?.retain&&h(t)&&u?.()},{type:"mqtt/subscribe",topic:`${l}/bridge/info`});"function"==typeof r&&b.push(r);const p=await o.call(e,t=>{if(!0===d(t)?.retain)return;const n=h(t);null!==n?n&&function(t){const n=d(t),e=n?.transaction??d(n?.data)?.transaction;return"string"==typeof e||"number"==typeof e?String(e):null}(n)===i&&f?.(n):c&&g?.(a("invalid_payload"))},{type:"mqtt/subscribe",topic:`${l}/bridge/response/networkmap`});"function"==typeof p&&b.push(p),await m(y,Math.min(4e3,Math.max(1,s-Date.now()))),c=!0,await t.callService("mqtt","publish",{topic:`${l}/bridge/request/networkmap`,payload:JSON.stringify({type:"raw",routes:!1,transaction:i}),qos:0,retain:!1});const v=await m(w,s-Date.now()),_=d(v)?.status;if(_&&"ok"!==_)throw a("provider");return n(v,l)}finally{for(const t of b)try{t()}catch{}}})}export{f as readZhaTopology,g as refreshZ2mTopology,u as subscribeZigbeeTopology,l as zigbeeTopologyRuntimeSnapshot}; globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="e53b30c3c9da873ce146ad9277e308d6d94c0a64db834549c64230709021da6a";import{n as t,b as n}from"./zigbee-topology-DjOib68n.js";import{F as e}from"./houseplan-card-BwHO54W5.js";const o=new WeakMap;function i(t){const n=function(t){const n=t?.connection||t;return!n||"object"!=typeof n&&"function"!=typeof n?null:n}(t);if(!n)return null;let e=o.get(n);return e||(e={revision:0,topologies:[],states:{},listeners:new Set,inflight:new Map},o.set(n,e)),e}function r(t,n,e){t.states={...t.states,[n]:e},function(t){t.revision++;for(const n of t.listeners)n()}(t)}function s(t){const n=t?.code;if("permission"===n||"unsupported"===n||"timeout"===n||"invalid_topic"===n||"invalid_payload"===n)return n;const e=String(t?.message||"").toLowerCase();return e.includes("unauthor")||e.includes("permission")?"permission":e.includes("unknown_command")||e.includes("not found")?"unsupported":"provider"}function a(t){return Object.assign(new Error(t),{code:t})}function c(t,n,e){const o=t.inflight.get(n);if(o)return o;r(t,n,{phase:"loading"});const i=e().then(n=>{if(!n.nodes.length&&n.warnings.some(t=>"invalid_payload"===t.code))throw a("invalid_payload");!function(t,n){t.topologies=[...t.topologies.filter(t=>!(t.provider===n.provider&&t.instanceId===n.instanceId)),n],r(t,"zha"===n.provider?"zha":`z2m:${n.instanceId}`,{phase:"ready",obtainedAt:n.obtainedAt,partial:n.warnings.length>0})}(t,n)}).catch(e=>{r(t,n,{phase:"error",error:s(e)})}).finally(()=>t.inflight.delete(n));return t.inflight.set(n,i),i}function l(t){const n=i(t);return n?{revision:n.revision,topologies:n.topologies,states:n.states}:{revision:0,topologies:[],states:{}}}function u(t,n){const e=i(t);return e?(e.listeners.add(n),()=>e.listeners.delete(n)):()=>{}}function p(t){if(!0!==t?.user?.is_admin)throw a("permission")}function f(n){const e=i(n);return e?c(e,"zha",async()=>{if(p(n),"function"!=typeof n?.callWS)throw a("unsupported");return t(await n.callWS({type:"zha/devices"}))}):Promise.resolve()}function d(t){return null!==t&&"object"==typeof t?t:null}function h(t){const n=d(t),e=n?.payload??t;if("string"!=typeof e)return e;try{return JSON.parse(e)}catch{return null}}async function m(t,n){let e;try{return await Promise.race([t,new Promise((t,o)=>{e=globalThis.setTimeout(()=>o(a("timeout")),Math.max(1,n))})])}finally{void 0!==e&&globalThis.clearTimeout(e)}}function g(t,o,r=15e4){const s=i(t);if(!s)return Promise.resolve();const l=e(o);return c(s,`z2m:${l||String(o)}`,async()=>{if(p(t),!l)throw a("invalid_topic");const e=t.connection,o=e?.subscribeMessage;if("function"!=typeof o||"function"!=typeof t?.callService)throw a("unsupported");const i=function(){const t=globalThis.crypto;return"function"==typeof t?.randomUUID?`houseplan-${t.randomUUID()}`:`houseplan-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}(),s=Date.now()+Math.max(1,r);let c=!1,u=null,f=null,g=null;const y=new Promise(t=>{u=t}),w=new Promise((t,n)=>{f=t,g=n}),b=[];try{const r=await o.call(e,t=>{!0===d(t)?.retain&&h(t)&&u?.()},{type:"mqtt/subscribe",topic:`${l}/bridge/info`});"function"==typeof r&&b.push(r);const p=await o.call(e,t=>{if(!0===d(t)?.retain)return;const n=h(t);null!==n?n&&function(t){const n=d(t),e=n?.transaction??d(n?.data)?.transaction;return"string"==typeof e||"number"==typeof e?String(e):null}(n)===i&&f?.(n):c&&g?.(a("invalid_payload"))},{type:"mqtt/subscribe",topic:`${l}/bridge/response/networkmap`});"function"==typeof p&&b.push(p),await m(y,Math.min(4e3,Math.max(1,s-Date.now()))),c=!0,await t.callService("mqtt","publish",{topic:`${l}/bridge/request/networkmap`,payload:JSON.stringify({type:"raw",routes:!1,transaction:i}),qos:0,retain:!1});const v=await m(w,s-Date.now()),_=d(v)?.status;if(_&&"ok"!==_)throw a("provider");return n(v,l)}finally{for(const t of b)try{t()}catch{}}})}export{f as readZhaTopology,g as refreshZ2mTopology,u as subscribeZigbeeTopology,l as zigbeeTopologyRuntimeSnapshot};
+1 -1
View File
@@ -1 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="7d7d634b457de395f9087a171ae19ae5dd8b29cc2205221a8a00fca7156f6d71";try{await import("./houseplan-assets/houseplan-card-DRCzjIQ2.js")}catch(e){if(!customElements.get("houseplan-card")){const l=String(navigator.language||"en").toLowerCase();const m=l.startsWith("ru")?"House Plan обновился — перезагрузите страницу (Ctrl+F5).":l.startsWith("de")?"House Plan wurde aktualisiert — bitte laden Sie die Seite neu (Strg+F5).":l.startsWith("fr")?"House Plan a été mis à jour — veuillez recharger la page (Ctrl+F5).":"House Plan was updated — please reload the page (Ctrl+F5).";customElements.define("houseplan-card",class extends HTMLElement{setConfig(){}getCardSize(){return 1}connectedCallback(){this.style.cssText="display:block;box-sizing:border-box;padding:16px;border:1px solid var(--divider-color,#e0e0e0);border-radius:var(--ha-card-border-radius,12px);background:var(--card-background-color,#fff);color:var(--primary-text-color,#212121);font:14px/1.4 var(--paper-font-body1_-_font-family,sans-serif)";this.textContent=m}})}console.error("[houseplan] stale houseplan-card.js: the implementation chunk is unavailable",e)} globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="e53b30c3c9da873ce146ad9277e308d6d94c0a64db834549c64230709021da6a";try{await import("./houseplan-assets/houseplan-card-BwHO54W5.js")}catch(e){if(!customElements.get("houseplan-card")){const l=String(navigator.language||"en").toLowerCase();const m=l.startsWith("ru")?"House Plan обновился — перезагрузите страницу (Ctrl+F5).":l.startsWith("de")?"House Plan wurde aktualisiert — bitte laden Sie die Seite neu (Strg+F5).":l.startsWith("fr")?"House Plan a été mis à jour — veuillez recharger la page (Ctrl+F5).":"House Plan was updated — please reload the page (Ctrl+F5).";customElements.define("houseplan-card",class extends HTMLElement{setConfig(){}getCardSize(){return 1}connectedCallback(){this.style.cssText="display:block;box-sizing:border-box;padding:16px;border:1px solid var(--divider-color,#e0e0e0);border-radius:var(--ha-card-border-radius,12px);background:var(--card-background-color,#fff);color:var(--primary-text-color,#212121);font:14px/1.4 var(--paper-font-body1_-_font-family,sans-serif)";this.textContent=m}})}console.error("[houseplan] stale houseplan-card.js: the implementation chunk is unavailable",e)}
+1 -1
View File
File diff suppressed because one or more lines are too long
+206 -28
View File
@@ -643,6 +643,9 @@ const ISO_OVERLAY_GROUP_CELL_CSS_PX = 64;
* reused by every card. The radius is the public absolute displacement cap, * reused by every card. The radius is the public absolute displacement cap,
* not a per-collision allowance. * not a per-collision allowance.
*/ */
/** Смещение вместе с его расстоянием: hypot на 7238 кандидатов считался заново. */
interface GroupOffset { readonly offset: ScenePoint; readonly distance: number }
const ISO_OVERLAY_GROUP_OFFSETS_CSS: readonly ScenePoint[] = Object.freeze((() => { const ISO_OVERLAY_GROUP_OFFSETS_CSS: readonly ScenePoint[] = Object.freeze((() => {
const offsets: ScenePoint[] = []; const offsets: ScenePoint[] = [];
const limit = Math.floor(ISO_OVERLAY_MAX_NUDGE_CSS_PX / ISO_OVERLAY_GROUP_SEARCH_STEP_CSS_PX); const limit = Math.floor(ISO_OVERLAY_MAX_NUDGE_CSS_PX / ISO_OVERLAY_GROUP_SEARCH_STEP_CSS_PX);
@@ -661,6 +664,42 @@ const ISO_OVERLAY_GROUP_OFFSETS_CSS: readonly ScenePoint[] = Object.freeze((() =
return offsets; return offsets;
})()); })());
const ISO_OVERLAY_GROUP_OFFSET_TABLE: readonly GroupOffset[] = Object.freeze(
ISO_OVERLAY_GROUP_OFFSETS_CSS.map((offset) => Object.freeze({
offset, distance: Math.hypot(offset[0], offset[1]),
})) as GroupOffset[],
);
/**
* Шаг грубого прохода (#583 перед бетой .5).
*
* Поиск был ограничен радиусом, но не работой: диск в 48 px с шагом 1 px — это
* 7238 кандидатов, и у каждого проверяется попадание в комнату и близость к
* кладке. Замер на `large-house-isometric-v1`: 2 523 652 просмотренных смещения,
* 1 742 740 проверок footprint против силуэтов, из них 98 % отвергнуты стеной, —
* 9.6 с на групповой проход и профиль, пробитый в 2–33 раза.
*
* Сначала идёт решётка с шагом 4 px (около 450 кандидатов), затем — уточнение
* 1 px в окрестности найденного места. Тесная сцена, где законного места нет
* вовсе, стоит 450 проверок вместо 7238; §6.4 ТЗ и требовал ограниченного
* детерминированного поиска, а не полного перебора.
*/
const ISO_OVERLAY_GROUP_COARSE_STEP_CSS_PX = 4;
const ISO_OVERLAY_GROUP_COARSE_TABLE: readonly GroupOffset[] = Object.freeze(
ISO_OVERLAY_GROUP_OFFSET_TABLE.filter((entry) =>
entry.offset[0] % ISO_OVERLAY_GROUP_COARSE_STEP_CSS_PX === 0
&& entry.offset[1] % ISO_OVERLAY_GROUP_COARSE_STEP_CSS_PX === 0) as GroupOffset[],
);
/** Уточнение вокруг грубого попадания: те же смещения, но только рядом с ним. */
function refinementOffsets(around: ScenePoint): readonly GroupOffset[] {
const reach = ISO_OVERLAY_GROUP_COARSE_STEP_CSS_PX;
return ISO_OVERLAY_GROUP_OFFSET_TABLE.filter((entry) =>
Math.abs(entry.offset[0] - around[0]) <= reach
&& Math.abs(entry.offset[1] - around[1]) <= reach);
}
function overlayRootBounds( function overlayRootBounds(
item: IsoOverlayCollisionItem, center: ScenePoint, item: IsoOverlayCollisionItem, center: ScenePoint,
): Bounds { ): Bounds {
@@ -817,8 +856,42 @@ export function resolveIsoOverlayCollisions(
}) })
: input.wallSilhouettes; : input.wallSilhouettes;
const candidate = (offsetCss: ScenePoint): { /**
placement: IsoOverlayPlacement; * Дешёвая половина кандидата: где он окажется и с кем столкнётся.
*
* Порядок половин — не стиль, а цена (#583 перед бетой .5). Проверка
* комнаты и силуэтов стен строит трансформированный footprint и гоняет
* полигон против каждой стены-кандидата; на плотной группе полный обход
* диска в 7238 смещений делал это тысячи раз за один проход, и групповой
* резолвер стоил ~755 мс на вызов. Сначала считается то, что стоит
* обращения к сетке ячеек, и только у смещения, способного УЛУЧШИТЬ
* результат, проверяется допустимость.
*/
/**
* Соседи, до которых вообще можно дотянуться в пределах 48 px.
*
* Прежде каждое смещение спрашивало сетку ячеек заново: Set, разбор ключей
* и сортировка массива на каждого из 7238 кандидатов. Диапазон досягаемости
* известен заранее — он не зависит от смещения, — поэтому список строится
* один раз на элемент, и внутренний цикл остаётся арифметикой.
*/
const reachIndices = nearby(expandedBounds(
overlayRootBounds(item, base.raisedScene), maxNudge * unitsPerPixel,
));
const conflictsAt = (bounds: Bounds): { conflicts: number[]; penalty: number } => {
const conflicts: number[] = [];
let penalty = 0;
for (const index of reachIndices) {
const value = overlapPenalty(bounds, accepted[index].bounds, gapUnits);
if (value > EPS) { conflicts.push(index); penalty += value; }
}
return { conflicts, penalty };
};
const candidateShape = (offsetCss: ScenePoint): {
offsetScene: ScenePoint;
sameAsBase: boolean;
visualScene: ScenePoint;
bounds: Bounds; bounds: Bounds;
conflicts: readonly number[]; conflicts: readonly number[];
penalty: number; penalty: number;
@@ -834,43 +907,148 @@ export function resolveIsoOverlayCollisions(
base.raisedScene[0] + offsetScene[0], base.raisedScene[0] + offsetScene[0],
base.raisedScene[1] + offsetScene[1], base.raisedScene[1] + offsetScene[1],
]; ];
if (!sameAsBase) {
if (!wallsValid || !ownerRoom) return null;
const plan = raisedSceneToPlan(visualScene, visualOffset, camera);
if (!pointStrictlyInRoom(plan, ownerRoom)) return null;
if (pointStrictlyInRoom(currentPlan, ownerRoom)
&& !segmentStrictlyInRoom(currentPlan, plan, ownerRoom)) return null;
const footprint = baseFootprint.map((point) => [
point[0] + offsetScene[0], point[1] + offsetScene[1],
] as ScenePoint);
const footprintBounds = ringBounds(footprint);
if (!footprintBounds || wallCandidates.some((wall) =>
footprintNearSilhouette(footprint, footprintBounds, wall, gapUnits, true))) return null;
}
const bounds = overlayRootBounds(item, visualScene); const bounds = overlayRootBounds(item, visualScene);
const conflicts = nearby(bounds).filter((index) => const { conflicts, penalty } = conflictsAt(bounds);
overlapPenalty(bounds, accepted[index].bounds, gapUnits) > EPS); return { offsetScene, sameAsBase, visualScene, bounds, conflicts, penalty };
const penalty = conflicts.reduce((sum, index) => };
sum + overlapPenalty(bounds, accepted[index].bounds, gapUnits), 0);
/** Дорогая половина: комната владельца, кладка и непрерывность пути. */
/**
* Прямоугольник комнаты владельца — дешёвый отказ до полигонов (#583 перед
* бетой .5). Замер на `large-house-isometric-v1`: из 2 523 652 просмотренных
* смещений 1 911 721 доходило до проверки комнаты и кладки, и именно она
* съедала 8.5 из 9.6 секунд группового прохода. Подавляющее большинство
* этих точек лежит ВНЕ комнаты — узнать это можно сравнением четырёх чисел,
* а не обходом колец полигона и силуэтов стен.
*/
const ownerBox = ownerRoom ? ringBounds(ownerRoom.outer as readonly ScenePoint[]) : null;
/**
* Широкая фаза по стенам — то, чего требовал §6.4 ТЗ и чего не было.
*
* Замер на `large-house-isometric-v1`: 1 742 740 проверок footprint против
* 41 841 466 пар «кандидат × стена», 6.4 с из 8.9 с прохода. Стен в радиусе
* 48 px около двух десятков, но для КОНКРЕТНОГО смещения близка одна-две.
* Стены раскладываются по тем же ячейкам, что и принятые оверлеи, и каждый
* кандидат смотрит только свои ячейки.
*/
const wallCells = new Map<string, number[]>();
for (let index = 0; index < wallCandidates.length; index++) {
const wallBounds = silhouetteBounds(wallCandidates[index], true);
if (!wallBounds) continue;
const [minX, minY, maxX, maxY] = cellRange(expandedBounds(wallBounds, gapUnits));
for (let y = minY; y <= maxY; y++) {
for (let x = minX; x <= maxX; x++) {
const key = `${x}:${y}`;
const list = wallCells.get(key) || [];
list.push(index);
wallCells.set(key, list);
}
}
}
// Пометки поколения вместо Set на каждого кандидата: аллокация в этом цикле
// стоит дороже самой проверки.
const wallSeen = new Int32Array(wallCandidates.length);
let wallSeenGeneration = 0;
const wallsNear = (bounds: Bounds): IsoWallSilhouette[] => {
const [minX, minY, maxX, maxY] = cellRange(expandedBounds(bounds, gapUnits));
const result: IsoWallSilhouette[] = [];
wallSeenGeneration += 1;
for (let y = minY; y <= maxY; y++) {
for (let x = minX; x <= maxX; x++) {
for (const index of wallCells.get(`${x}:${y}`) || []) {
if (wallSeen[index] === wallSeenGeneration) continue;
wallSeen[index] = wallSeenGeneration;
result.push(wallCandidates[index]);
}
}
}
return result;
};
const candidateAllowed = (shape: {
offsetScene: ScenePoint; sameAsBase: boolean; visualScene: ScenePoint;
}): boolean => {
if (shape.sameAsBase) return true;
if (!wallsValid || !ownerRoom) return false;
const plan = raisedSceneToPlan(shape.visualScene, visualOffset, camera);
if (ownerBox && (plan[0] < ownerBox[0] || plan[0] > ownerBox[2]
|| plan[1] < ownerBox[1] || plan[1] > ownerBox[3])) return false;
if (!pointStrictlyInRoom(plan, ownerRoom)) return false;
if (pointStrictlyInRoom(currentPlan, ownerRoom)
&& !segmentStrictlyInRoom(currentPlan, plan, ownerRoom)) return false;
const footprint = baseFootprint.map((point) => [
point[0] + shape.offsetScene[0], point[1] + shape.offsetScene[1],
] as ScenePoint);
const footprintBounds = ringBounds(footprint);
if (!footprintBounds) return false;
return !wallsNear(footprintBounds).some((wall) =>
footprintNearSilhouette(footprint, footprintBounds, wall, gapUnits, true));
};
const candidate = (offsetCss: ScenePoint): {
placement: IsoOverlayPlacement;
bounds: Bounds;
conflicts: readonly number[];
penalty: number;
} | null => {
const shape = candidateShape(offsetCss);
if (!shape || !candidateAllowed(shape)) return null;
return { return {
placement: placementAtGroupOffset(base, offsetCss, unitsPerPixel, false), placement: placementAtGroupOffset(base, offsetCss, unitsPerPixel, false),
bounds, conflicts, penalty, bounds: shape.bounds, conflicts: shape.conflicts, penalty: shape.penalty,
}; };
}; };
let best = candidate(baseOffsetCss); let best = candidate(baseOffsetCss);
/**
* Грубый проход даёт место, уточнение возвращает минимальность: без него
* значок остановился бы на узле решётки 4 px, хотя ближе есть законная
* точка. Уточняется только окрестность найденного, а не весь диск.
*/
const refine = (coarse: {
placement: IsoOverlayPlacement; bounds: Bounds;
conflicts: readonly number[]; penalty: number;
}): typeof coarse => {
let refined = coarse;
for (const entry of refinementOffsets(coarse.placement.nudgeCss)) {
if (entry.distance >= refined.placement.nudgeDistanceCss - EPS) continue;
const shape = candidateShape(entry.offset);
if (!shape || shape.conflicts.length || !candidateAllowed(shape)) continue;
refined = {
placement: placementAtGroupOffset(base, entry.offset, unitsPerPixel, false),
bounds: shape.bounds, conflicts: shape.conflicts, penalty: shape.penalty,
};
}
return refined;
};
if (!best || best.conflicts.length) { if (!best || best.conflicts.length) {
for (const offset of ISO_OVERLAY_GROUP_OFFSETS_CSS) { for (const entry of ISO_OVERLAY_GROUP_COARSE_TABLE) {
if (Math.hypot(offset[0], offset[1]) > maxNudge + EPS) break; if (entry.distance > maxNudge + EPS) break;
const offset = entry.offset;
if (Math.abs(offset[0] - baseOffsetCss[0]) <= EPS if (Math.abs(offset[0] - baseOffsetCss[0]) <= EPS
&& Math.abs(offset[1] - baseOffsetCss[1]) <= EPS) continue; && Math.abs(offset[1] - baseOffsetCss[1]) <= EPS) continue;
const next = candidate(offset); const shape = candidateShape(offset);
if (!next) continue; if (!shape) continue;
if (!next.conflicts.length) { best = next; break; } // Смещения отсортированы по возрастанию расстояния, поэтому кандидат с
if (!best || next.penalty < best.penalty - EPS // тем же штрафом уже никогда не окажется ближе принятого: его отбор
|| Math.abs(next.penalty - best.penalty) <= EPS // невозможен, и платить за проверку кладки незачем. Результат тот же,
&& next.placement.nudgeDistanceCss < best.placement.nudgeDistanceCss - EPS) best = next; // что у прежнего порядка, — меняется только цена.
const canWin = !best || !shape.conflicts.length || shape.penalty < best.penalty - EPS;
if (!canWin || !candidateAllowed(shape)) continue;
const next = {
placement: placementAtGroupOffset(base, offset, unitsPerPixel, false),
bounds: shape.bounds, conflicts: shape.conflicts, penalty: shape.penalty,
};
if (!next.conflicts.length) { best = refine(next); break; }
best = next;
} }
// Грубая решётка могла пройти мимо законного места, которое лежит между
// её узлами: тогда лучший кандидат остаётся с пересечением. Уточнение
// вокруг него ищет ту самую точку с шагом 1 px — ограниченно и только
// один раз, а не по всему диску (АС4 ТЗ: разрешимое пересечение обязано
// быть устранено).
if (best && best.conflicts.length) best = refine(best);
} }
if (!best) { if (!best) {
const placement = placementAtGroupOffset(base, baseOffsetCss, unitsPerPixel, true); const placement = placementAtGroupOffset(base, baseOffsetCss, unitsPerPixel, true);