| 1102 | id: tile.getAttribute("data-mobile-grid-tile") || "", |
| 1103 | width: Math.round(rect.width), |
| 1104 | height: Math.round(rect.height), |
| 1105 | visible: |
| 1106 | rect.width > 2 && |
| 1107 | rect.height > 2 && |
| 1108 | getComputedStyle(tile).display !== "none" && |
| 1109 | getComputedStyle(tile).visibility !== "hidden", |
| 1110 | }; |
| 1111 | }); |
| 1112 | const visibleTiles = tileRects.filter((tile) => tile.visible); |
| 1113 | const scores = parseJson(attrs["data-mobile-room-tiling-scores"], []); |
| 1114 | const warmReasons = parseJson(attrs["data-mobile-warm-reasons"], {}); |
| 1115 | const primaryIds = (attrs["data-mobile-primary-ids"] || "") |
| 1116 | .split(",") |
| 1117 | .filter(Boolean); |
| 1118 | const gridTileIds = (attrs["data-mobile-grid-visible-tile-ids"] || "") |
| 1119 | .split(",") |
| 1120 | .filter(Boolean); |
| 1121 | const ok = |
| 1122 | attrs["data-mobile-room-tiling-source"] === "client" && |
| 1123 | attrs["data-mobile-room-tiling-metadata-interval"] === "200" && |
| 1124 | attrs["data-mobile-room-tiling-promote-delay"] === "220" && |
| 1125 | attrs["data-mobile-room-tiling-min-switch-interval"] === "2200" && |
| 1126 | attrs["data-mobile-max-tiles"] === "9" && |
| 1127 | attrs["data-mobile-warm-hold"] === "3500" && |
| 1128 | Number(attrs["data-mobile-visible-count"] || 0) >= 1 && |
| 1129 | Number(attrs["data-mobile-total-people"] || 0) >= 1 && |
| 1130 | Number(attrs["data-mobile-grid-cols"] || 0) >= 1 && |
| 1131 | Number(attrs["data-mobile-grid-rows"] || 0) >= 1 && |
| 1132 | primaryIds.length >= 1 && |
| 1133 | gridTileIds.length >= 1 && |
| 1134 | visibleTiles.length >= 1 && |
| 1135 | scores.every((item, index) => |
| 1136 | typeof item.id === "string" && |
| 1137 | item.rank === index && |
| 1138 | typeof item.score === "number" && |
| 1139 | typeof item.visible === "boolean" && |
| 1140 | typeof item.hidden === "boolean" && |
| 1141 | typeof item.warm === "boolean" && |
| 1142 | Array.isArray(item.warmReasons) |
| 1143 | ) && |
| 1144 | warmReasons && |
| 1145 | typeof warmReasons === "object" && |
| 1146 | debug?.intervalMs === 200 && |
| 1147 | Number(debug?.sequence || 0) >= 1 && |
| 1148 | Array.isArray(debug?.history) && |
| 1149 | debug.history.length >= 1 && |
| 1150 | current?.source === "client" && |
| 1151 | current?.intervalMs === 200 && |
| 1152 | current?.promoteDelayMs === 220 && |