From eee3af0919a9b294272e0eab5307112e7f419cb0 Mon Sep 17 00:00:00 2001 From: justin Date: Wed, 29 Apr 2026 09:38:35 -0500 Subject: [PATCH] Add CALEA retail/wholesale toggle to FCC compliance checker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When CALEA SSI card shows red/amber, ask if carrier serves end users (retail) or only other carriers (wholesale). Wholesale-only carriers are exempt as "interconnecting carriers" under CALEA — card turns green. Retail/both keeps the red status. Toggle integrates with existing pending-question system (CTA waits for all toggles answered). Co-Authored-By: Claude Opus 4.6 (1M context) --- .../tools/fcc-compliance-check/index.html | 43 ++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/site/public/tools/fcc-compliance-check/index.html b/site/public/tools/fcc-compliance-check/index.html index 9778407..3494477 100644 --- a/site/public/tools/fcc-compliance-check/index.html +++ b/site/public/tools/fcc-compliance-check/index.html @@ -406,6 +406,44 @@ Send reset link }); } + // CALEA toggle — wholesale-only carriers are exempt ("interconnecting carriers") + if (!checks.querySelector(".pw-calea-toggle")) { + var caleaCards = checks.querySelectorAll(":scope > div"); + caleaCards.forEach(function(card) { + if (card.textContent.indexOf("CALEA") < 0 && card.textContent.indexOf("SSI") < 0) return; + if (card.querySelector(".pw-calea-toggle")) return; + // Only show for red/amber cards (missing or needs attention) + if (!card.classList.contains("bg-red-50") && !card.classList.contains("bg-amber-50")) return; + var detail = card.querySelectorAll("p")[1]; + var icon = card.querySelector("span"); + var flexDiv = card.querySelector(".flex-1"); + if (!flexDiv || !detail) return; + + var q = document.createElement("div"); + q.className = "pw-calea-toggle mt-3 flex items-center gap-2 flex-wrap"; + q.innerHTML = + 'Do you serve end users directly (retail customers), or do you only sell to other carriers (wholesale)?' + + '' + + ''; + flexDiv.appendChild(q); + q.addEventListener("click", function(ev) { + var b = ev.target.closest("[data-calea]"); + if (!b) return; + q.remove(); + if (b.dataset.calea === "wholesale") { + // Wholesale-only carriers are exempt — "interconnecting carrier" under CALEA + card.className = "bg-green-50 border-green-200 border rounded-xl p-4 flex items-start gap-3"; + detail.innerHTML = 'Not required \u2014 wholesale-only carriers that serve other carriers (not end users) are generally exempt from CALEA as “interconnecting carriers.” CALEA applies to carriers providing service to the public.'; + detail.className = "text-xs text-green-800 mt-1"; + icon.className = "text-green-600 shrink-0 mt-0.5"; + icon.innerHTML = ''; + card.dataset.caleaExempt = "true"; + } + // If retail/both, leave as-is (red, needs SSI plan) + }); + }); + } + // Remediation CTA — rebuild if FRN changed (user searched new company) var currentFrn = (document.getElementById("entity-frn").textContent || "").replace(/\D/g, ""); var existingCta = document.getElementById("pw-remediation-cta"); @@ -433,7 +471,8 @@ Send reset link var hasBdcQuestion = !!checks.querySelector(".pw-bdc-toggle"); var hasRmdQuestion = !!checks.querySelector(".pw-rmd-toggle"); var has499aQuestion = !!checks.querySelector(".pw-499a-toggle"); - var hasPendingQuestion = hasBdcQuestion || hasRmdQuestion || has499aQuestion; + var hasCaleaQuestion = !!checks.querySelector(".pw-calea-toggle"); + var hasPendingQuestion = hasBdcQuestion || hasRmdQuestion || has499aQuestion || hasCaleaQuestion; var frn = currentFrn; var url = "/order/fcc-compliance?services=" + services.join(",") + (frn ? "&frn=" + frn : ""); var cta = document.createElement("div"); @@ -452,7 +491,7 @@ Send reset link ''; // Watch for toggle removal (= answered) var bdcWatcher = new MutationObserver(function() { - if (!checks.querySelector(".pw-bdc-toggle") && !checks.querySelector(".pw-rmd-toggle") && !checks.querySelector(".pw-499a-toggle")) { + if (!checks.querySelector(".pw-bdc-toggle") && !checks.querySelector(".pw-rmd-toggle") && !checks.querySelector(".pw-499a-toggle") && !checks.querySelector(".pw-calea-toggle")) { bdcWatcher.disconnect(); // Re-count actionable items (red + amber) var newServices = [];