document.addEventListener("DOMContentLoaded", function () {
// --- 1. THE DATA STRUCTURE ---
// We store Heading, Text, and SVG for every state here.
const stateData = {
ALABAMA: {
name: "Alabama",
description:
"While SimpleK12 courses aren't aligned with standard license renewal requirements in Alabama, they're a powerful resource for your professional growth.
Whether you're looking to grow in your career, tackle classroom challenges, or bring fresh, high-impact strategies to your students, we're here to help. Our courses are designed to support real change: improving student outcomes, advancing your teaching practice, and helping you become the educator you want to be. Browse our catalog for topics that inspire you.",
svg: ``,
},
ALASKA: {
name: "Alaska",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Alaska with prior approval from your state or district.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Identify the courses, learning pathways, or microcredentials you're interested in and reach out to your state or district for approval before getting started.",
svg: ``,
},
ARIZONA: {
name: "Arizona",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Arizona—acceptance is subject to state or district approval.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Explore our catalog and enroll in the courses, learning pathways, or microcredentials that fit your goals.",
svg: ``,
},
ARKANSAS: {
name: "Arkansas",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Arkansas with prior approval from your state or district.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Identify the courses, learning pathways, or microcredentials you're interested in and reach out to your state or district for approval before getting started.",
svg: ``,
},
CALIFORNIA: {
name: "California",
description:
"While SimpleK12 courses aren't aligned with standard license renewal requirements in California, they're a powerful resource for your professional growth.
Whether you're looking to grow in your career, tackle classroom challenges, or bring fresh, high-impact strategies to your students—we're here to help. Our courses are designed to support real change: improving student outcomes, advancing your teaching practice, and helping you become the educator you want to be. Browse our catalog for topics that inspire you.",
svg: ``,
},
COLORADO: {
name: "Colorado",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Colorado—acceptance is subject to state or district approval.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Explore our catalog and enroll in the courses, learning pathways, or microcredentials that fit your goals.",
svg: ``,
},
CONNECTICUT: {
name: "Connecticut",
description:
"SimpleK12 courses are a great resource for professional development. We recommend checking with your state or district to see if they can be applied toward license renewal in Connecticut.
Whether you're looking to grow in your career, tackle classroom challenges, or bring fresh, high-impact strategies to your students—we're here to help. Our courses are designed to support real change: improving student outcomes, advancing your teaching practice, and helping you become the educator you want to be. Browse our catalog for topics that inspire you, and reach out to your state or district with any questions about renewal eligibility.",
svg: ``,
},
DELAWARE: {
name: "Delaware",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Delaware with prior approval from your state or district.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Identify the courses, learning pathways, or microcredentials you're interested in and reach out to your state or district for approval before getting started.",
svg: ``,
},
FLORIDA: {
name: "Florida",
description:
"SimpleK12 courses are a great resource for professional development. We recommend checking with your state or district to see if they can be applied toward license renewal in Florida.
Whether you're looking to grow in your career, tackle classroom challenges, or bring fresh, high-impact strategies to your students—we're here to help. Our courses are designed to support real change: improving student outcomes, advancing your teaching practice, and helping you become the educator you want to be. Browse our catalog for topics that inspire you, and reach out to your state or district with any questions about renewal eligibility.",
svg: ``,
},
GEORGIA: {
name: "Georgia",
description:
"While SimpleK12 courses aren't aligned with standard license renewal requirements in Georgia, they're a powerful resource for your professional growth.
Whether you're looking to grow in your career, tackle classroom challenges, or bring fresh, high-impact strategies to your students—we're here to help. Our courses are designed to support real change: improving student outcomes, advancing your teaching practice, and helping you become the educator you want to be. Browse our catalog for topics that inspire you.",
svg: ``,
},
HAWAII: {
name: "Hawaii",
description:
"While SimpleK12 courses aren't aligned with standard license renewal requirements in Hawaiʻi, they're a powerful resource for your professional growth.
Whether you're looking to grow in your career, tackle classroom challenges, or bring fresh, high-impact strategies to your students—we're here to help. Our courses are designed to support real change: improving student outcomes, advancing your teaching practice, and helping you become the educator you want to be. Browse our catalog for topics that inspire you.",
svg: ``,
},
IDAHO: {
name: "Idaho",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Idaho with prior approval from your state or district.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Identify the courses, learning pathways, or microcredentials you're interested in and reach out to your state or district for approval before getting started.",
svg: ``,
},
ILLINOIS: {
name: "Illinois",
description:
"While SimpleK12 courses aren't aligned with standard license renewal requirements in Illinois, they're a powerful resource for your professional growth.
Whether you're looking to grow in your career, tackle classroom challenges, or bring fresh, high-impact strategies to your students—we're here to help. Our courses are designed to support real change: improving student outcomes, advancing your teaching practice, and helping you become the educator you want to be. Browse our catalog for topics that inspire you.",
svg: ``,
},
INDIANA: {
name: "Indiana",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Indiana—acceptance is subject to state or district approval.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Explore our catalog and enroll in the courses, learning pathways, or microcredentials that fit your goals.",
svg: ``,
},
IOWA: {
name: "Iowa",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Iowa with prior approval from your state or district.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Identify the courses, learning pathways, or microcredentials you're interested in and reach out to your state or district for approval before getting started.",
svg: ``,
},
KANSAS: {
name: "Kansas",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Kansas—acceptance is subject to state or district approval.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Explore our catalog and enroll in the courses, learning pathways, or microcredentials that fit your goals.",
svg: ``,
},
KENTUCKY: {
name: "Kentucky",
description:
"While SimpleK12 courses aren't aligned with standard license renewal requirements in Kentucky, they're a powerful resource for your professional growth.
Whether you're looking to grow in your career, tackle classroom challenges, or bring fresh, high-impact strategies to your students—we're here to help. Our courses are designed to support real change: improving student outcomes, advancing your teaching practice, and helping you become the educator you want to be. Browse our catalog for topics that inspire you.",
svg: ``,
},
LOUISIANA: {
name: "Louisiana",
description:
"While SimpleK12 courses aren't aligned with standard license renewal requirements in Louisiana, they're a powerful resource for your professional growth.
Whether you're looking to grow in your career, tackle classroom challenges, or bring fresh, high-impact strategies to your students—we're here to help. Our courses are designed to support real change: improving student outcomes, advancing your teaching practice, and helping you become the educator you want to be. Browse our catalog for topics that inspire you.",
svg: ``,
},
MAINE: {
name: "Maine",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Maine—acceptance is subject to state or district approval.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Explore our catalog and enroll in the courses, learning pathways, or microcredentials that fit your goals.",
svg: ``,
},
MARYLAND: {
name: "Maryland",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Maryland with prior approval from your state or district.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Identify the courses, learning pathways, or microcredentials you're interested in and reach out to your state or district for approval before getting started.",
svg: ``,
},
MASSACHUSETTS: {
name: "Massachusetts",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Massachusetts with prior approval from your state or district.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Identify the courses, learning pathways, or microcredentials you're interested in and reach out to your state or district for approval before getting started.",
svg: ``,
},
MICHIGAN: {
name: "Michigan",
description:
"While SimpleK12 courses aren't aligned with standard license renewal requirements in Michigan, they're a powerful resource for your professional growth.
Whether you're looking to grow in your career, tackle classroom challenges, or bring fresh, high-impact strategies to your students—we're here to help. Our courses are designed to support real change: improving student outcomes, advancing your teaching practice, and helping you become the educator you want to be. Browse our catalog for topics that inspire you.",
svg: ``,
},
MINNESOTA: {
name: "Minnesota",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Minnesota—acceptance is subject to state or district approval.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Explore our catalog and enroll in the courses, learning pathways, or microcredentials that fit your goals.",
svg: ``,
},
MISSISSIPPI: {
name: "Mississippi",
description:
"SimpleK12 courses are a great resource for professional development. We recommend checking with your state or district to see if they can be applied toward license renewal in Mississippi.
Whether you're looking to grow in your career, tackle classroom challenges, or bring fresh, high-impact strategies to your students—we're here to help. Our courses are designed to support real change: improving student outcomes, advancing your teaching practice, and helping you become the educator you want to be. Browse our catalog for topics that inspire you, and reach out to your state or district with any questions about renewal eligibility.",
svg: ``,
},
MISSOURI: {
name: "Missouri",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Missouri—acceptance is subject to state or district approval.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Explore our catalog and enroll in the courses, learning pathways, or microcredentials that fit your goals.",
svg: ``,
},
MONTANA: {
name: "Montana",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Montana with prior approval from your state or district.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Identify the courses, learning pathways, or microcredentials you're interested in and reach out to your state or district for approval before getting started.",
svg: ``,
},
NEBRASKA: {
name: "Nebraska",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Nebraska—acceptance is subject to state or district approval.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Explore our catalog and enroll in the courses, learning pathways, or microcredentials that fit your goals.",
svg: ``,
},
NEVADA: {
name: "Nevada",
description:
"Great news! SimpleK12 is an approved Professional Development Provider in Nevada.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Identify the courses, learning pathways, or microcredentials you're interested in and reach out to your state or district for approval before getting started. Regardless of the categorization, educators are encouraged to consult with their employers regarding activities accepted for salary advancement.",
svg: ``,
},
"NEW HAMPSHIRE": {
name: "New Hampshire",
description:
"SimpleK12 courses may be accepted for teacher license renewal in New Hampshire—acceptance is subject to state or district approval.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Explore our catalog and enroll in the courses, learning pathways, or microcredentials that fit your goals.",
svg: ``,
},
"NEW JERSEY": {
name: "New Jersey",
description:
"SimpleK12 courses may be accepted for teacher license renewal in New Jersey with prior approval from your state or district.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Identify the courses, learning pathways, or microcredentials you're interested in and reach out to your state or district for approval before getting started.",
svg: ``,
},
"NEW MEXICO": {
name: "New Mexico",
description:
"While SimpleK12 courses aren't aligned with standard license renewal requirements in New Mexico, they're a powerful resource for your professional growth.
Whether you're looking to grow in your career, tackle classroom challenges, or bring fresh, high-impact strategies to your students—we're here to help. Our courses are designed to support real change: improving student outcomes, advancing your teaching practice, and helping you become the educator you want to be. Browse our catalog for topics that inspire you.",
svg: ``,
},
"NEW YORK": {
name: "New York",
description:
"Great news! SimpleK12 is an approved Continuing Teacher and Leader Education (CTLE) sponsor in New York. (SimpleK12 is a DBA of InfoSource, the name you'll find on the NYSED approved sponsor list.)
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Explore our catalog and enroll in the courses, learning pathways, or microcredentials that fit your goals.",
svg: ``,
},
"NORTH CAROLINA": {
name: "North Carolina",
description:
"SimpleK12 courses may be accepted for teacher license renewal in North Carolina—acceptance is subject to state or district approval.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Explore our catalog and enroll in the courses, learning pathways, or microcredentials that fit your goals.",
svg: ``,
},
"NORTH DAKOTA": {
name: "North Dakota",
description:
"While SimpleK12 courses aren't aligned with standard license renewal requirements in North Dakota, they're a powerful resource for your professional growth.
Whether you're looking to grow in your career, tackle classroom challenges, or bring fresh, high-impact strategies to your students—we're here to help. Our courses are designed to support real change: improving student outcomes, advancing your teaching practice, and helping you become the educator you want to be. Browse our catalog for topics that inspire you.",
svg: ``,
},
OHIO: {
name: "Ohio",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Ohio with prior approval from your state or district.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Identify the courses, learning pathways, or microcredentials you're interested in and reach out to your state or district for approval before getting started.",
svg: ``,
},
OKLAHOMA: {
name: "Oklahoma",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Oklahoma—acceptance is subject to state or district approval.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Explore our catalog and enroll in the courses, learning pathways, or microcredentials that fit your goals.",
svg: ``,
},
OREGON: {
name: "Oregon",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Oregon—acceptance is subject to state or district approval.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Explore our catalog and enroll in the courses, learning pathways, or microcredentials that fit your goals.",
svg: ``,
},
PENNSYLVANIA: {
name: "Pennsylvania",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Pennsylvania with prior approval from your state or district.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Identify the courses, learning pathways, or microcredentials you're interested in and reach out to your state or district for approval before getting started.",
svg: ``,
},
"RHODE ISLAND": {
name: "Rhode Island",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Rhode Island with prior approval from your state or district.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Identify the courses, learning pathways, or microcredentials you're interested in and reach out to your state or district for approval before getting started.",
svg: ``,
},
"SOUTH CAROLINA": {
name: "South Carolina",
description:
"SimpleK12 courses may be accepted for teacher license renewal in South Carolina with prior approval from your state or district.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Identify the courses, learning pathways, or microcredentials you're interested in and reach out to your state or district for approval before getting started.",
svg: ``,
},
"SOUTH DAKOTA": {
name: "South Dakota",
description:
"SimpleK12 courses may be accepted for teacher license renewal in South Dakota—acceptance is subject to state or district approval.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Explore our catalog and enroll in the courses, learning pathways, or microcredentials that fit your goals.",
svg: ``,
},
TENNESSEE: {
name: "Tennessee",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Tennessee—acceptance is subject to state or district approval.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Explore our catalog and enroll in the courses, learning pathways, or microcredentials that fit your goals.",
svg: ``,
},
TEXAS: {
name: "Texas",
description:
"Great news! SimpleK12 is a TEA-approved Continuing Professional Education (CPE) provider in Texas. Our Learning Paths and Microcredentials meet CPE requirements. (CPE provider number: 910024)
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Explore our catalog and enroll in the courses, learning pathways, or microcredentials that fit your goals.",
svg: ``,
},
UTAH: {
name: "Utah",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Utah—acceptance is subject to state or district approval.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Explore our catalog and enroll in the courses, learning pathways, or microcredentials that fit your goals.",
svg: ``,
},
VERMONT: {
name: "Vermont",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Vermont—acceptance is subject to state or district approval.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Explore our catalog and enroll in the courses, learning pathways, or microcredentials that fit your goals.",
svg: ``,
},
VIRGINIA: {
name: "Virginia",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Virginia with prior approval from your state or district.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Identify the courses, learning pathways, or microcredentials you're interested in and reach out to your state or district for approval before getting started.",
svg: ``,
},
WASHINGTON: {
name: "Washington",
description:
"While SimpleK12 courses aren't aligned with standard license renewal requirements in Washington, they're a powerful resource for your professional growth.
Whether you're looking to grow in your career, tackle classroom challenges, or bring fresh, high-impact strategies to your students—we're here to help. Our courses are designed to support real change: improving student outcomes, advancing your teaching practice, and helping you become the educator you want to be. Browse our catalog for topics that inspire you.",
svg: ``,
},
"WEST VIRGINIA": {
name: "West Virginia",
description:
"While SimpleK12 courses aren't aligned with standard license renewal requirements in West Virginia, they're a powerful resource for your professional growth.
Whether you're looking to grow in your career, tackle classroom challenges, or bring fresh, high-impact strategies to your students—we're here to help. Our courses are designed to support real change: improving student outcomes, advancing your teaching practice, and helping you become the educator you want to be. Browse our catalog for topics that inspire you.",
svg: ``,
},
WISCONSIN: {
name: "Wisconsin",
description:
"While SimpleK12 courses aren't aligned with standard license renewal requirements in Wisconsin, they're a powerful resource for your professional growth.
Whether you're looking to grow in your career, tackle classroom challenges, or bring fresh, high-impact strategies to your students—we're here to help. Our courses are designed to support real change: improving student outcomes, advancing your teaching practice, and helping you become the educator you want to be. Browse our catalog for topics that inspire you.",
svg: ``,
},
WYOMING: {
name: "Wyoming",
description:
"SimpleK12 courses may be accepted for teacher license renewal in Wyoming with prior approval from your state or district.
Whether you're working toward license renewal, looking to grow in your career, or simply want to bring fresh, high-impact strategies into your classroom—we're here to help. Our courses are designed to support real change: improving student outcomes, solving everyday teaching challenges, and helping you become the educator you want to be. Identify the courses, learning pathways, or microcredentials you're interested in and reach out to your state or district for approval before getting started.",
svg: ``,
},
};
const popupWrap = document.querySelector(".popup-wrap");
const popupTitle = document.getElementById("popup-state-name");
const popupDesc = document.getElementById("popup-state-desc");
const popupImg = document.getElementById("popup-state-img");
const closeBtn = document.getElementById("close-btn");
const searchInput = document.getElementById("state-search-input");
const searchResults = document.getElementById("state-search-results");
const mapTriggers = document.querySelectorAll(".map__state");
// --- 4. CORE FUNCTION: OPEN POPUP ---
function openPopup(stateKey) {
if (!stateKey) return;
const currentData = stateData[stateKey];
const prettyName = currentData ? currentData.name : toTitleCase(stateKey);
// A. Populate Title
if (popupTitle) popupTitle.innerText = prettyName;
// B. Populate Description (Updated Logic)
if (popupDesc) {
if (currentData && currentData.description) {
// Use custom description if it exists (using innerHTML allows tags)
popupDesc.innerHTML = currentData.description;
} else {
// Fallback to default sentence
popupDesc.innerText = defaultPara + " " + prettyName + ".";
}
}
// C. Populate Image
if (popupImg) {
// Priority 1: Use SVG from Data Object
if (currentData && currentData.svg && currentData.svg !== "") {
popupImg.innerHTML = currentData.svg;
}
// Priority 2: Fallback to finding SVG inside the map link
else {
const mapLink = document.querySelector(
`.map__state[state-name="${stateKey}"]`
);
const embeddedSvg = mapLink ? mapLink.querySelector("svg") : null;
if (embeddedSvg) {
popupImg.innerHTML = "";
popupImg.appendChild(embeddedSvg.cloneNode(true));
} else {
popupImg.innerHTML = "";
}
}
}
// D. Show Popup
if (popupWrap) {
popupWrap.style.display = "flex";
}
}
// --- 5. MAP INTERACTION LOGIC ---
mapTriggers.forEach((trigger) => {
trigger.addEventListener("click", function (e) {
e.preventDefault();
const stateKey = this.getAttribute("state-name");
openPopup(stateKey);
});
});
// --- 6. SEARCH LOGIC ---
if (searchInput && searchResults) {
searchInput.addEventListener("input", function (e) {
// 1. Get the value and convert to uppercase for case-insensitive matching
const val = this.value.toUpperCase();
searchResults.innerHTML = "";
if (!val) {
searchResults.style.display = "none";
return;
}
// 2. UPDATED FILTER LOGIC
const matches = Object.keys(stateData).filter((key) => {
// Get the full name of the state
const stateName = stateData[key].name.toUpperCase();
// Use .startsWith() instead of .includes()
// This ensures "A" finds "Arizona" but NOT "Kansas"
return stateName.startsWith(val);
});
if (matches.length > 0) {
// (This part remains the same as your original code)
searchResults.style.display = "block"; // Or 'flex' if you changed CSS
matches.forEach((key) => {
const div = document.createElement("div");
div.className = "state-search-item";
div.innerHTML = stateData[key].name;
div.addEventListener("click", function () {
openPopup(key);
searchInput.value = "";
searchResults.style.display = "none";
});
searchResults.appendChild(div);
});
} else {
searchResults.style.display = "none";
}
});
// (The rest of your click-away logic remains here)
document.addEventListener("click", function (e) {
if (
!searchInput.contains(e.target) &&
!searchResults.contains(e.target)
) {
searchResults.style.display = "none";
}
});
}
// --- 7. CLOSE POPUP LOGIC ---
if (popupWrap) {
popupWrap.addEventListener("click", function (e) {
if (e.target === this) {
this.style.display = "none";
}
});
}
if (closeBtn) {
closeBtn.addEventListener("click", function (e) {
e.preventDefault();
if (popupWrap) {
popupWrap.style.display = "none";
}
});
}
function toTitleCase(str) {
return str.replace(/\w\S*/g, function (txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});
}
});