const apiKey = "your_api_key_here"; const apiUrl = "https://api.medspacircle.com/api/v1/";//update const remoteCss = "https://api.medspacircle.com/embed/1/style.css";//update const targetDiv = document.getElementById("MCLoader"); const slug = targetDiv.getAttribute("data-slug-id"); const withmap = targetDiv.getAttribute("data-with-map"); const mapApiKey = targetDiv.getAttribute("data-map-api-key"); const linkUrl = `https://go.medspacircle.com/clinics/${slug}/`; let branchData = []; let theMarkerLists = []; //load remote stylesheet function loadRemoteStylesheet(url) { const linkElement = document.createElement("link"); linkElement.rel = "stylesheet"; linkElement.href = url; document.head.appendChild(linkElement); } function loadGoogleFont(fontFamily) { const linkElement = document.createElement("link"); linkElement.rel = "stylesheet"; linkElement.href = `https://fonts.googleapis.com/css2?family=${encodeURIComponent( fontFamily )}`; document.head.appendChild(linkElement); } function loadScript(url, callback) { var script = document.createElement('script'); script.type = 'text/javascript'; if (script.readyState) { // IE script.onreadystatechange = function () { if (script.readyState === 'loaded' || script.readyState === 'complete') { script.onreadystatechange = null; if (callback) { callback(); } } }; } else { // Others script.onload = function () { if (callback) { callback(); } }; } script.src = url; document.getElementsByTagName('head')[0].appendChild(script); } // load momentjs loadScript('https://cdn.jsdelivr.net/npm/moment@2.29.4/moment.min.js', function () { // Do something after the script has loaded }); //loadRemoteStylesheet(remoteCss); //we load style directly // Create a