{"id":1634,"date":"2025-03-04T13:14:19","date_gmt":"2025-03-04T12:14:19","guid":{"rendered":"https:\/\/homezzy.com\/?page_id=1634"},"modified":"2026-02-13T11:28:18","modified_gmt":"2026-02-13T10:28:18","slug":"estate-agencies","status":"publish","type":"page","link":"https:\/\/homezzy.com\/ro\/estate-agencies\/","title":{"rendered":"Agen\u021bii imobiliare"},"content":{"rendered":"<div data-elementor-type=\"wp-page\" data-elementor-id=\"1634\" class=\"elementor elementor-1634\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-1cbc22f8 e-flex e-con-boxed e-con e-parent\" data-id=\"1cbc22f8\" data-element_type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-3160dcf0 elementor-widget__width-initial elementor-widget elementor-widget-image\" data-id=\"3160dcf0\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"393\" height=\"257\" src=\"https:\/\/homezzy.com\/wp-content\/uploads\/2024\/10\/Base2.png\" class=\"attachment-full size-full wp-image-1554\" alt=\"\" srcset=\"https:\/\/homezzy.com\/wp-content\/uploads\/2024\/10\/Base2.png 393w, https:\/\/homezzy.com\/wp-content\/uploads\/2024\/10\/Base2-300x196.png 300w\" sizes=\"(max-width: 393px) 100vw, 393px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-50e19acb elementor-widget elementor-widget-shortcode\" data-id=\"50e19acb\" data-element_type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<script>\r\n    let citiesByCountry = null;\r\n    async function loadCountriesWithCities() {\r\n        try {\r\n            const citiesByCountryResponse = await fetch('https:\/\/homezzy-api-hw74g.ondigitalocean.app' + '\/countries-with-cities');\r\n            if (!citiesByCountryResponse.ok) {\r\n                throw new Error(`HTTP error! status: ${citiesByCountryResponse.status}`);\r\n            }\r\n            citiesByCountry = await citiesByCountryResponse.json();\r\n            console.log('citiesByCountry: ', citiesByCountry);\r\n        } catch (error) {\r\n            throw new Error(`Error fetching countries with cities: ${error}`);\r\n        }\r\n    }\r\n\r\n    loadCountriesWithCities();\r\n\r\n    function updateCityList(country) {\r\n        console.log(`updateCityList(${country})`);\r\n        const cityContainers = document.querySelectorAll('.custom-search-filter-box-city-list');\r\n        Array.from(cityContainers).forEach(cityContainer => {\r\n            cityContainer.innerHTML = '';  \r\n\r\n            if (citiesByCountry[country]) {\r\n                citiesByCountry[country].forEach(city => {\r\n                    const cityLabel = document.createElement('label');\r\n                    cityLabel.classList.add('checkcontainer');\r\n                    cityLabel.innerHTML = `\r\n                        ${city}\r\n                        <input type=\"radio\" name=\"city\" value=\"${city}\">\r\n                        <span class=\"checkmark\"><\/span>\r\n                    `;\r\n                    cityContainer.appendChild(cityLabel);\r\n                });\r\n\r\n                const cityInputs = cityContainer.querySelectorAll('input[name=\"city\"]');\r\n                Array.from(cityInputs).forEach(input => {\r\n                    input.addEventListener('change', () => {\r\n                        console.log(`change for city input from updateCityList(country)`);\r\n                        const cityBtns = document.querySelectorAll('.search-bar-location-btn');\r\n                        Array.from(cityBtns).forEach(cityBtn => {\r\n                            cityBtn.textContent = input.value;\r\n                        });\r\n                        const cityContainerCheckboxes = document.querySelectorAll('.custom-search-filter-box-city-list label input');\r\n                        Array.from(cityContainerCheckboxes).forEach(cityContainerCheckbox => {\r\n                            if (cityContainerCheckbox.value === input.value) cityContainerCheckbox.checked = true;\r\n                        });\r\n                        const cityFilterBoxes = document.querySelectorAll('.custom-search-filter-box-city')\r\n                        Array.from(cityFilterBoxes).forEach(cityFilterBox => {\r\n                            cityFilterBox.style.display = 'none';\r\n                        });\r\n                    });\r\n                });\r\n\r\n                setupFilter('.search-filter-city', '.custom-search-filter-box-city-list');\r\n\r\n            } else {\r\n                \/\/console.error('Nie znaleziono miast dla wybranego kraju');\r\n            }\r\n        });\r\n    }\r\n\r\n    const isFirefox = typeof InstallTrigger !== 'undefined';\r\n    const isSafari = \/^((?!chrome|android).)*safari\/i.test(navigator.userAgent);\r\n\r\n    document.addEventListener(\"DOMContentLoaded\", function () {\r\n\r\n        if (isFirefox || isSafari) {\r\n            document.querySelectorAll('input.datepicker-input').forEach(input => {\r\n                input.type = \"text\";\r\n                flatpickr(input, {\r\n                    plugins: [\r\n                        new monthSelectPlugin({\r\n                            shorthand: true,\r\n                            dateFormat: \"Y-m\",\r\n                            theme: \"light\"\r\n                        })\r\n                    ]\r\n                });\r\n            });\r\n        }\r\n\r\n    });\r\n\r\n    document.addEventListener('DOMContentLoaded', () => {\r\n        console.log(`DOMContentLoaded for updateCityList`);\r\n        const urlParams = new URLSearchParams(window.location.search);\r\n        const countryFromUrl = urlParams.get('country');\r\n\r\n        if (countryFromUrl) {\r\n            updateCityList(countryFromUrl);\r\n\r\n            const countryRadios = document.querySelectorAll(`.custom-search-filter-box-country input[type=\"radio\"][value=\"${countryFromUrl}\"]`);\r\n            Array.from(countryRadios).forEach(countryRadio => {\r\n                countryRadio.checked = true;\r\n            });\r\n        }\r\n\r\n        Array.from(document.querySelectorAll('.custom-search-filter-box-country input[type=\"radio\"]')).forEach(checkbox => {\r\n            checkbox.addEventListener('change', handleCountrySelection);\r\n        });\r\n    });\r\n\r\n    function handleCountrySelection(event) {\r\n        console.log(`handleCountrySelection(${event})`);\r\n        const selectedCountry = event.target.value;\r\n        Array.from(document.querySelectorAll('.custom-search-filter-box-country input[type=\"radio\"]')).forEach(checkbox => {\r\n            if (checkbox.value === selectedCountry) checkbox.checked = true;\r\n        });\r\n        if (event.target.checked) {\r\n            updateCityList(selectedCountry);\r\n\r\n        }\r\n    }\r\n\r\n    function resetInputGroup(containerSelector, searchBarId = null, type = null) {\r\n        console.log(`resetInputGroup(${containerSelector}, ${searchBarId}, ${type})`);\r\n        const inputs = document.querySelectorAll(containerSelector + ' label input');\r\n        Array.from(inputs).forEach(input => {\r\n            input.checked = false;\r\n        });\r\n\r\n        if (searchBarId) {\r\n            const searchBars = document.querySelectorAll(searchBarId);\r\n            Array.from(searchBars).forEach(searchBar => {\r\n                searchBar.value = '';\r\n            });\r\n        }\r\n\r\n        const containers = document.querySelectorAll(containerSelector);\r\n        Array.from(containers).forEach(container => {\r\n            const labels = container.querySelectorAll('.checkcontainer');\r\n            Array.from(labels).forEach(label => {\r\n                label.style.display = '';\r\n            });\r\n        });\r\n\r\n        \/\/ const currentLang = document.documentElement.lang || 'en';\r\n        \/\/ const translations = {\r\n        \/\/     city: { en: 'City', ro: 'Ora\u0219', hr: 'Grad', pl: 'Miasto' },\r\n        \/\/     country: { en: 'Country', ro: '\u021aar\u0103', hr: 'Dr\u017eava', pl: 'Kraj' },\r\n        \/\/     type: { en: 'Type', ro: 'Tip', hr: 'Vrsta', pl: 'Typ'},\r\n        \/\/     language: { en: 'Language', ro: 'Limb\u0103', hr: 'Jezik', pl: 'J\u0119zyk' }\r\n        \/\/ };\r\n        \/\/ if (type && translations[type]) {\r\n        \/\/     const btns = document.querySelectorAll(`.search-bar-${type}-btn`);\r\n        \/\/     Array.from(btns).forEach(btn => {\r\n        \/\/         btn.textContent = translations[type][currentLang] || translations[type]['en'];\r\n        \/\/     });\r\n        \/\/ }\r\n        const translations = {\r\n            city: 'City',\r\n            country: 'Country',\r\n            type: 'Type',\r\n            language: 'Language'\r\n        };\r\n        if (type && translations[type]) {\r\n            const btns = document.querySelectorAll(`.search-bar-${type}-btn`);\r\n            Array.from(btns).forEach(btn => {\r\n                btn.textContent = window.t(translations[type]);\r\n            });\r\n        }\r\n    }\r\n<\/script>\r\n\r\n        <button type=\"button\" class=\"mobile-filters-button\">\r\n            <svg width=\"15\" height=\"14\" viewbox=\"0 0 15 14\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\r\n                <path d=\"M13.5484 13.0233L10.4234 9.89827M1.46509 6.14827C1.46509 3.27179 3.79694 0.939941 6.67342 0.939941C9.5499 0.939941 11.8818 3.27179 11.8818 6.14827C11.8818 9.02476 9.5499 11.3566 6.67342 11.3566C3.79694 11.3566 1.46509 9.02476 1.46509 6.14827Z\" stroke=\"white\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><\/path>\r\n            <\/svg>\u00cencepe\u021bi c\u0103utarea\r\n        <\/button>\r\n\r\n        <div class=\"mobile-filters-overlay\">\r\n            <div class=\"mobile-filters-content\">\r\n                <form method=\"get\" class=\"mobile-form-filters custom-search-filter-container-main short-let-container\" action=\"\">\r\n                    <div class=\"custom-search-container\">\r\n                        <div class=\"custom-search-bar\">\r\n                            <div class=\"search-bar-option-sale-rent\">\r\n                                <div class=\"search-bar-option-one\">\r\n                                    <label class=\"search-bar-sale-btn\">\r\n                                        <input\r\n                                                type=\"radio\"\r\n                                                name=\"sale-rent-option\"\r\n                                                value=\"sale\"\r\n                                                class=\"search-bar-sale-radio search-bar-type-select\"\r\n                                                \r\n                                        \/>\r\n                                        Cump\u0103ra\u021bi\r\n                                    <\/label>\r\n                                    <label class=\"search-bar-rent-btn\">\r\n                                        <input\r\n                                                type=\"radio\"\r\n                                                name=\"sale-rent-option\"\r\n                                                value=\"rent\"\r\n                                                class=\"search-bar-rent-radio search-bar-type-select\"\r\n                                        \/>\r\n                                        Chirie\r\n                                    <\/label>\r\n                                <\/div>\r\n                                <p>Grea alegere, nu-i a\u0219a?<\/p>\r\n                            <\/div>\r\n                            <div class=\"search-bar-option-country\">\r\n                                <button class=\"search-bar-country-btn\" id=\"\">\u021aara<\/button>\r\n                                <p>Unde \u021bi-ar pl\u0103cea s\u0103 locuie\u0219ti?<\/p>\r\n                            <\/div>\r\n                            <div class=\"custom-search-filter-box-country\" style=\"display: none;\">\r\n                                <input type=\"text\" placeholder=\"Introduce\u021bi o loca\u021bie de c\u0103utare\" class=\"search-filter-country\" name=\"country\">\r\n                                <div class=\"custom-search-filter-box-country-list\" id=\"countryListContainer\" data-no-translation=\"\">\r\n                                    \r\n                                                <label class=\"checkcontainer\">\r\n                                                    Albania                                                    <input type=\"radio\" name=\"country\" value=\"Albania\">\r\n                                                    <span class=\"checkmark\"><\/span>\r\n                                                <\/label>\r\n\r\n                                            \r\n                                                <label class=\"checkcontainer\">\r\n                                                    Austria                                                    <input type=\"radio\" name=\"country\" value=\"Austria\">\r\n                                                    <span class=\"checkmark\"><\/span>\r\n                                                <\/label>\r\n\r\n                                            \r\n                                                <label class=\"checkcontainer\">\r\n                                                    Bulgaria                                                    <input type=\"radio\" name=\"country\" value=\"Bulgaria\">\r\n                                                    <span class=\"checkmark\"><\/span>\r\n                                                <\/label>\r\n\r\n                                            \r\n                                                <label class=\"checkcontainer\">\r\n                                                    Croatia                                                    <input type=\"radio\" name=\"country\" value=\"Croatia\">\r\n                                                    <span class=\"checkmark\"><\/span>\r\n                                                <\/label>\r\n\r\n                                            \r\n                                                <label class=\"checkcontainer\">\r\n                                                    France                                                    <input type=\"radio\" name=\"country\" value=\"France\">\r\n                                                    <span class=\"checkmark\"><\/span>\r\n                                                <\/label>\r\n\r\n                                            \r\n                                                <label class=\"checkcontainer\">\r\n                                                    Germany                                                    <input type=\"radio\" name=\"country\" value=\"Germany\">\r\n                                                    <span class=\"checkmark\"><\/span>\r\n                                                <\/label>\r\n\r\n                                            \r\n                                                <label class=\"checkcontainer\">\r\n                                                    Malta                                                    <input type=\"radio\" name=\"country\" value=\"Malta\">\r\n                                                    <span class=\"checkmark\"><\/span>\r\n                                                <\/label>\r\n\r\n                                            \r\n                                                <label class=\"checkcontainer\">\r\n                                                    Montenegro                                                    <input type=\"radio\" name=\"country\" value=\"Montenegro\">\r\n                                                    <span class=\"checkmark\"><\/span>\r\n                                                <\/label>\r\n\r\n                                            \r\n                                                <label class=\"checkcontainer\">\r\n                                                    Poland                                                    <input type=\"radio\" name=\"country\" value=\"Poland\">\r\n                                                    <span class=\"checkmark\"><\/span>\r\n                                                <\/label>\r\n\r\n                                            \r\n                                                <label class=\"checkcontainer\">\r\n                                                    Romania                                                    <input type=\"radio\" name=\"country\" value=\"Romania\">\r\n                                                    <span class=\"checkmark\"><\/span>\r\n                                                <\/label>\r\n\r\n                                            \r\n                                                <label class=\"checkcontainer\">\r\n                                                    Slovakia                                                    <input type=\"radio\" name=\"country\" value=\"Slovakia\">\r\n                                                    <span class=\"checkmark\"><\/span>\r\n                                                <\/label>\r\n\r\n                                            \r\n                                                <label class=\"checkcontainer\">\r\n                                                    Slovenia                                                    <input type=\"radio\" name=\"country\" value=\"Slovenia\">\r\n                                                    <span class=\"checkmark\"><\/span>\r\n                                                <\/label>\r\n\r\n                                            \r\n                                                <label class=\"checkcontainer\">\r\n                                                    Spain                                                    <input type=\"radio\" name=\"country\" value=\"Spain\">\r\n                                                    <span class=\"checkmark\"><\/span>\r\n                                                <\/label>\r\n\r\n                                            \r\n                                                <label class=\"checkcontainer\">\r\n                                                    United Kingdom                                                    <input type=\"radio\" name=\"country\" value=\"United Kingdom\">\r\n                                                    <span class=\"checkmark\"><\/span>\r\n                                                <\/label>\r\n\r\n                                                                            <\/div>\r\n                                <div class=\"reset-btn\" onclick=\"resetInputGroup('.custom-search-filter-box-country', '.search-filter-country', 'country'); resetInputGroup('.custom-search-filter-box-city', '.search-filter-city', 'city');\">Resetare<\/div>\r\n\r\n                            <\/div>\r\n                            <div class=\"search-bar-option-location\">\r\n                                <button class=\"search-bar-location-btn search-bar-city-btn\" id=\"\">Ora\u0219<\/button>\r\n                                <p>De exemplu, Londra, Camden<\/p>\r\n                            <\/div>\r\n                            <div class=\"custom-search-filter-box-city\" style=\"display: none;\">\r\n                                <input type=\"text\" placeholder=\"Introduce\u021bi o loca\u021bie de c\u0103utare\" class=\"search-filter-city\" name=\"city\">\r\n                                <div class=\"custom-search-filter-box-city-list\">\r\n                                    <p>Selecta\u021bi mai \u00eent\u00e2i \u021bara<\/p>\r\n                                <\/div>\r\n                                <div class=\"reset-btn\" onclick=\"resetInputGroup('.custom-search-filter-box-city', '.search-filter-city', 'city')\">Resetare<\/div>\r\n\r\n                            <\/div>\r\n                            <div class=\"search-bar-option-type\">\r\n                                <button type=\"button\" class=\"search-bar-type-btn\" id=\"\">Tip<\/button>\r\n                                <p>Apartament sau poate o cas\u0103?<\/p>\r\n                            <\/div>\r\n                            <div class=\"custom-search-filter-box-type\" style=\"display: none;\">\r\n                                <div class=\"select-type-text\" id=\"selectTypeText\">\r\n                                    <p>Alege\u021bi 'Cump\u0103rare' sau '\u00cenchiriere' pentru a vedea tipurile de propriet\u0103\u021bi.<\/p>\r\n                                <\/div>\r\n\r\n                                <div class=\"custom-search-filter-box-type-list\" id=\"adTypeContainer\">\r\n                                                                    <\/div>\r\n                            <\/div>\r\n                        <\/div>\r\n                        <div class=\"search-button\">\r\n                            <button type=\"button\" class=\"mobile-filters-close\">\r\n                                <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"800px\" height=\"800px\" viewbox=\"0 0 24 24\" fill=\"none\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.29289 5.29289C5.68342 4.90237 6.31658 4.90237 6.70711 5.29289L12 10.5858L17.2929 5.29289C17.6834 4.90237 18.3166 4.90237 18.7071 5.29289C19.0976 5.68342 19.0976 6.31658 18.7071 6.70711L13.4142 12L18.7071 17.2929C19.0976 17.6834 19.0976 18.3166 18.7071 18.7071C18.3166 19.0976 17.6834 19.0976 17.2929 18.7071L12 13.4142L6.70711 18.7071C6.31658 19.0976 5.68342 19.0976 5.29289 18.7071C4.90237 18.3166 4.90237 17.6834 5.29289 17.2929L10.5858 12L5.29289 6.70711C4.90237 6.31658 4.90237 5.68342 5.29289 5.29289Z\" fill=\"#0F1729\"><\/path><\/svg>\r\n                            <\/button>\r\n                            <button type=\"submit\" class=\"mobile-filters-search\">\r\n                                C\u0103utare\r\n                                <svg width=\"15\" height=\"14\" viewbox=\"0 0 15 14\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\r\n                                    <path d=\"M13.5484 13.0233L10.4234 9.89827M1.46509 6.14827C1.46509 3.27179 3.79694 0.939941 6.67342 0.939941C9.5499 0.939941 11.8818 3.27179 11.8818 6.14827C11.8818 9.02476 9.5499 11.3566 6.67342 11.3566C3.79694 11.3566 1.46509 9.02476 1.46509 6.14827Z\" stroke=\"white\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\/>\r\n                                <\/svg>\r\n                            <\/button>\r\n                        <\/div>\r\n                    <\/div>\r\n                <input type=\"hidden\" name=\"trp-form-language\" value=\"ro\"\/><\/form>\r\n            <\/div>\r\n        <\/div>\r\n\r\n        <form method=\"get\" class=\"desktop-form-filters custom-search-filter-container-main\" action=\"\">\r\n            <div class=\"custom-search-container\">\r\n                <div class=\"custom-search-bar\">\r\n                    <div class=\"search-bar-option-sale-rent\">\r\n                        <div class=\"search-bar-option-one\">\r\n                            <label class=\"search-bar-sale-btn\">\r\n                                <input\r\n                                        type=\"radio\"\r\n                                        name=\"sale-rent-option\"\r\n                                        value=\"sale\"\r\n                                        class=\"search-bar-sale-radio search-bar-type-select\"\r\n                                        \r\n                                \/>\r\n                                Cump\u0103ra\u021bi\r\n                            <\/label>\r\n                            <label class=\"search-bar-rent-btn\">\r\n                                <input\r\n                                        type=\"radio\"\r\n                                        name=\"sale-rent-option\"\r\n                                        value=\"rent\"\r\n                                        class=\"search-bar-rent-radio search-bar-type-select\"\r\n                                \/>\r\n                                Chirie\r\n                            <\/label>\r\n                        <\/div>\r\n                        <p>Grea alegere, nu-i a\u0219a?<\/p>\r\n                    <\/div>\r\n\r\n                    <div class=\"search-bar-option-country\">\r\n                        <button type=\"button\" class=\"search-bar-country-btn\" id=\"\">\u021aara<\/button>\r\n                        <p>Unde \u021bi-ar pl\u0103cea s\u0103 locuie\u0219ti?<\/p>\r\n                    <\/div>\r\n                    <div class=\"search-bar-option-location\">\r\n                        <button type=\"button\" class=\"search-bar-location-btn search-bar-city-btn\" id=\"\">Ora\u0219<\/button>\r\n                        <p>De exemplu, Londra, Camden<\/p>\r\n                    <\/div>\r\n                    <div class=\"search-bar-option-type\">\r\n                        <button type=\"button\" class=\"search-bar-type-btn\" id=\"\">Tip<\/button>\r\n                        <p>Apartament sau poate o cas\u0103?<\/p>\r\n                    <\/div>\r\n                                    <!-- <div class=\"custom-search-filter-box-type\" style=\"display: none;\">\r\n                    <div class=\"select-type-text\" id=\"selectTypeText\">\r\n                        <p>Choose 'Buy' or 'Rent' to see property types.<\/p>\r\n                    <\/div>\r\n\r\n                    <div class=\"custom-search-filter-box-type-list\" id=\"adTypeContainer\">\r\n                                            <\/div>\r\n                <\/div> -->\r\n                <\/div>\r\n                <div class=\"search-button\">\r\n                    <button type=\"submit\">\r\n                        <svg width=\"15\" height=\"14\" viewbox=\"0 0 15 14\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\r\n                            <path d=\"M13.5484 13.0233L10.4234 9.89827M1.46509 6.14827C1.46509 3.27179 3.79694 0.939941 6.67342 0.939941C9.5499 0.939941 11.8818 3.27179 11.8818 6.14827C11.8818 9.02476 9.5499 11.3566 6.67342 11.3566C3.79694 11.3566 1.46509 9.02476 1.46509 6.14827Z\" stroke=\"white\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\/>\r\n                        <\/svg>\r\n                    <\/button>\r\n                <\/div>\r\n            <\/div>\r\n\r\n            <div class=\"custom-search-filter-container-main\">\r\n                <div class=\"custom-search-filter-box-country\" style=\"display: none;\">\r\n                    <input type=\"text\" placeholder=\"Introduce\u021bi o loca\u021bie de c\u0103utare\" class=\"search-filter-country\" name=\"country\">\r\n                    <div class=\"custom-search-filter-box-country-list\" id=\"countryListContainer\" data-no-translation=\"\">\r\n                        \r\n                                    <label class=\"checkcontainer\">\r\n                                        Albania                                        <input type=\"radio\" name=\"country\" value=\"Albania\">\r\n                                        <span class=\"checkmark\"><\/span>\r\n                                    <\/label>\r\n\r\n                                \r\n                                    <label class=\"checkcontainer\">\r\n                                        Austria                                        <input type=\"radio\" name=\"country\" value=\"Austria\">\r\n                                        <span class=\"checkmark\"><\/span>\r\n                                    <\/label>\r\n\r\n                                \r\n                                    <label class=\"checkcontainer\">\r\n                                        Bulgaria                                        <input type=\"radio\" name=\"country\" value=\"Bulgaria\">\r\n                                        <span class=\"checkmark\"><\/span>\r\n                                    <\/label>\r\n\r\n                                \r\n                                    <label class=\"checkcontainer\">\r\n                                        Croatia                                        <input type=\"radio\" name=\"country\" value=\"Croatia\">\r\n                                        <span class=\"checkmark\"><\/span>\r\n                                    <\/label>\r\n\r\n                                \r\n                                    <label class=\"checkcontainer\">\r\n                                        France                                        <input type=\"radio\" name=\"country\" value=\"France\">\r\n                                        <span class=\"checkmark\"><\/span>\r\n                                    <\/label>\r\n\r\n                                \r\n                                    <label class=\"checkcontainer\">\r\n                                        Germany                                        <input type=\"radio\" name=\"country\" value=\"Germany\">\r\n                                        <span class=\"checkmark\"><\/span>\r\n                                    <\/label>\r\n\r\n                                \r\n                                    <label class=\"checkcontainer\">\r\n                                        Malta                                        <input type=\"radio\" name=\"country\" value=\"Malta\">\r\n                                        <span class=\"checkmark\"><\/span>\r\n                                    <\/label>\r\n\r\n                                \r\n                                    <label class=\"checkcontainer\">\r\n                                        Montenegro                                        <input type=\"radio\" name=\"country\" value=\"Montenegro\">\r\n                                        <span class=\"checkmark\"><\/span>\r\n                                    <\/label>\r\n\r\n                                \r\n                                    <label class=\"checkcontainer\">\r\n                                        Poland                                        <input type=\"radio\" name=\"country\" value=\"Poland\">\r\n                                        <span class=\"checkmark\"><\/span>\r\n                                    <\/label>\r\n\r\n                                \r\n                                    <label class=\"checkcontainer\">\r\n                                        Romania                                        <input type=\"radio\" name=\"country\" value=\"Romania\">\r\n                                        <span class=\"checkmark\"><\/span>\r\n                                    <\/label>\r\n\r\n                                \r\n                                    <label class=\"checkcontainer\">\r\n                                        Slovakia                                        <input type=\"radio\" name=\"country\" value=\"Slovakia\">\r\n                                        <span class=\"checkmark\"><\/span>\r\n                                    <\/label>\r\n\r\n                                \r\n                                    <label class=\"checkcontainer\">\r\n                                        Slovenia                                        <input type=\"radio\" name=\"country\" value=\"Slovenia\">\r\n                                        <span class=\"checkmark\"><\/span>\r\n                                    <\/label>\r\n\r\n                                \r\n                                    <label class=\"checkcontainer\">\r\n                                        Spain                                        <input type=\"radio\" name=\"country\" value=\"Spain\">\r\n                                        <span class=\"checkmark\"><\/span>\r\n                                    <\/label>\r\n\r\n                                \r\n                                    <label class=\"checkcontainer\">\r\n                                        United Kingdom                                        <input type=\"radio\" name=\"country\" value=\"United Kingdom\">\r\n                                        <span class=\"checkmark\"><\/span>\r\n                                    <\/label>\r\n\r\n                                                    <\/div>\r\n                    <div class=\"reset-btn\" onclick=\"resetInputGroup('.custom-search-filter-box-country', '.search-filter-country', 'country'); resetInputGroup('.custom-search-filter-box-city', '.search-filter-city', 'city');\">Resetare<\/div>\r\n                <\/div>\r\n                <div class=\"custom-search-filter-box-city\" style=\"display: none;\">\r\n                    <input type=\"text\" placeholder=\"Introduce\u021bi o loca\u021bie de c\u0103utare\" class=\"search-filter-city\" name=\"city\">\r\n                    <div class=\"custom-search-filter-box-city-list\">\r\n                        <p>Selecta\u021bi mai \u00eent\u00e2i \u021bara<\/p>\r\n                    <\/div>\r\n                    <div class=\"reset-btn\" onclick=\"resetInputGroup('.custom-search-filter-box-city', '.search-filter-city', 'city')\">Resetare<\/div>\r\n                <\/div>\r\n\r\n\r\n                <div class=\"custom-search-filter-box-type\" style=\"display: none;\">\r\n                    <div class=\"select-type-text\" id=\"selectTypeText\">\r\n                        <p>Alege\u021bi 'Cump\u0103rare' sau '\u00cenchiriere' pentru a vedea tipurile de propriet\u0103\u021bi.<\/p>\r\n                    <\/div>\r\n\r\n                    <div class=\"custom-search-filter-box-type-list\" id=\"adTypeContainer\">\r\n                                            <\/div>\r\n                <\/div>\r\n\r\n\r\n            <\/div>\r\n        <input type=\"hidden\" name=\"trp-form-language\" value=\"ro\"\/><\/form>\r\n    <script>\r\n\r\n        function sanitizeInput(input) {\r\n            return input.value.replace(\/^[^a-zA-Z0-9]+\/, '');\r\n        }\r\n\r\n        function isValueInList(value, containerSelector) {\r\n            const container = document.querySelector(containerSelector);\r\n            if (!container) return false;\r\n            const labels = container.querySelectorAll('.checkcontainer');\r\n            return Array.from(labels).some(label => label.querySelector('input')?.value.trim().toLowerCase() === value.trim().toLowerCase());\r\n        }\r\n\r\n        document.querySelectorAll('.search-filter-country').forEach(input => {\r\n            input.addEventListener('input', () => {\r\n                input.value = sanitizeInput(input);\r\n            });\r\n\r\n            input.addEventListener('blur', () => {\r\n                if (!isValueInList(input.value, '.custom-search-filter-box-country-list')) {\r\n                    input.value = '';\r\n                    document.querySelectorAll('.search-bar-country-btn').forEach(btn => {\r\n                        btn.textContent = window.t('Country');\r\n                    });\r\n                } else {\r\n                    document.querySelectorAll('.search-bar-country-btn').forEach(btn => {\r\n                        btn.textContent = input.value;\r\n                    });\r\n                }\r\n            });\r\n        });\r\n\r\n        document.querySelectorAll('.search-filter-city').forEach(input => {\r\n            input.addEventListener('input', () => {\r\n                input.value = sanitizeInput(input);\r\n            });\r\n\r\n            input.addEventListener('blur', () => {\r\n                if (!isValueInList(input.value, '.custom-search-filter-box-city-list')) {\r\n                    input.value = '';\r\n                    document.querySelectorAll('.search-bar-location-btn').forEach(btn => {\r\n                        btn.textContent = window.t('City');\r\n                    });\r\n                } else {\r\n                    document.querySelectorAll('.search-bar-location-btn').forEach(btn => {\r\n                        btn.textContent = input.value;\r\n                    });\r\n                }\r\n            });\r\n        });\r\n\r\n        document.querySelectorAll('.search-bar-country-btn').forEach(btn => {\r\n            btn.addEventListener('click', (e) => {\r\n                const currentValue = btn.textContent.trim();\r\n                if (!currentValue || !isValueInList(currentValue, '.custom-search-filter-box-country-list')) {\r\n                    btn.textContent = window.t('Country');\r\n                }\r\n            });\r\n        });\r\n\r\n        document.addEventListener('DOMContentLoaded', function() {\r\n            console.log(`DOMContentLoaded for sale\/rent search bars`);\r\n            const saleBtns = document.getElementsByClassName('search-bar-sale-btn');\r\n            const rentBtns = document.getElementsByClassName('search-bar-rent-btn');\r\n            const forms = document.querySelectorAll('.custom-search-filter-container-main:has(button[type=\"submit\"])');\r\n\r\n            function selectSaleOrRent(selectedButton) {\r\n                console.log(`selectSaleOrRent(${selectedButton})`);\r\n                Array.from(saleBtns).forEach(btn => btn.classList.remove('selected'));\r\n                Array.from(rentBtns).forEach(btn => btn.classList.remove('selected'));\r\n\r\n                if (selectedButton.classList.contains('search-bar-sale-btn')) {\r\n                    Array.from(saleBtns).forEach(btn => btn.classList.add('selected'));\r\n                } else if (selectedButton.classList.contains('search-bar-rent-btn')) {\r\n                    Array.from(rentBtns).forEach(btn => btn.classList.add('selected'));\r\n                }\r\n            }\r\n\r\n            function setSaleRentFromUrl() {\r\n                console.log(`setSaleRentFromUrl()`);\r\n                const url = window.location.pathname;\r\n\r\n                const saleRadios = document.querySelectorAll('.search-bar-sale-radio');\r\n                const rentRadios = document.querySelectorAll('.search-bar-rent-radio');\r\n\r\n                const saleLabels = document.querySelectorAll('.search-bar-sale-btn');\r\n                const rentLabels = document.querySelectorAll('.search-bar-rent-btn');\r\n\r\n                Array.from(saleLabels).forEach(saleLabel => {\r\n                    saleLabel.classList.remove('selected');\r\n                });\r\n                Array.from(rentLabels).forEach(rentLabel => {\r\n                    rentLabel.classList.remove('selected');\r\n                });\r\n\r\n                if (url.includes('\/sale\/')) {\r\n                    Array.from(saleRadios).forEach(saleRadio => {\r\n                        saleRadio.checked = true;\r\n                    });\r\n                    Array.from(saleLabels).forEach(saleLabel => {\r\n                        saleLabel.classList.add('selected');\r\n                    });\r\n                    return;\r\n                }\r\n\r\n                if (url.includes('\/rent\/')) {\r\n                    Array.from(rentRadios).forEach(rentRadio => {\r\n                        rentRadio.checked = true;\r\n                    });\r\n                    Array.from(rentLabels).forEach(rentLabel => {\r\n                        rentLabel.classList.add('selected');\r\n                    });\r\n                    return;\r\n                }\r\n            }\r\n\r\n            setSaleRentFromUrl();\r\n\r\n            function updateTypeOptionsForSaleOrRent(saleOrRent) {\r\n                console.log(`updateTypeOptionsForSaleOrRent(${saleOrRent})`);\r\n                const typeFilterBoxes = document.querySelectorAll('.custom-search-filter-box-type-list');\r\n                Array.from(typeFilterBoxes).forEach((typeFilterBox, i) => {\r\n                    console.log(i, typeFilterBox);\r\n                });\r\n                Array.from(typeFilterBoxes).forEach(typeFilterBox => {\r\n                    typeFilterBox.innerHTML = '';\r\n                });\r\n                Array.from(typeFilterBoxes).forEach((typeFilterBox, i) => {\r\n                    console.log(i, typeFilterBox);\r\n                });\r\n\r\n                const pathname = window.location.pathname;\r\n\r\n                const commercialOptions = ['Office', 'Shared Office Space', 'Land', 'Warehouse', 'Retail', 'Hospitality', 'Leisure', 'Restaurant', 'Storage', 'Production', 'Workshop', 'Other'];\r\n                const saleOptions = ['Apartment', 'House', 'Land', 'Commercial', 'Parking'];\r\n                const rentOptions = ['Apartment', 'House', 'Room', 'Commercial', 'Parking'];\r\n\r\n                let options;\r\n\r\n                if (pathname.includes('\/commercial-sale') || pathname.includes('\/commercial-let')) {\r\n                    options = commercialOptions;\r\n                } else {\r\n                    options = saleOrRent === 'sale' ? saleOptions : rentOptions;\r\n                }\r\n\r\n                console.log(options);\r\n                options.forEach(option => {\r\n                    const label = document.createElement('label');\r\n                    label.classList.add('checkcontainer');\r\n                    label.textContent = window.t(option);\r\n\r\n                    const input = document.createElement('input');\r\n                    input.type = 'radio';\r\n                    input.name = 'type';\r\n                    input.value = option;\r\n\r\n                    const span = document.createElement('span');\r\n                    span.classList.add('checkmark');\r\n\r\n                    label.appendChild(input);\r\n                    label.appendChild(span);\r\n                    Array.from(typeFilterBoxes).forEach((typeFilterBox, i) => {\r\n                        typeFilterBox.appendChild(label.cloneNode(true));\r\n                    });\r\n                });\r\n\r\n                const resetButton = document.createElement('div');\r\n                resetButton.classList.add('reset-btn');\r\n                resetButton.setAttribute('onclick', \"resetInputGroup('.custom-search-filter-box-type-list', null, 'type')\");\r\n                resetButton.textContent = window.t('reset');\r\n\r\n                Array.from(typeFilterBoxes).forEach(typeFilterBox => {\r\n                    typeFilterBox.appendChild(resetButton.cloneNode(true));\r\n                });\r\n\r\n                Array.from(forms).forEach(form => {\r\n                    const selectTypeText = form.querySelector('.select-type-text');\r\n                    if (selectTypeText) selectTypeText.style.display = 'none';\r\n                });\r\n\r\n                Array.from(typeFilterBoxes).forEach(typeFilterBox => {\r\n                    const typeInputs = typeFilterBox.querySelectorAll('input[name=\"type\"]');\r\n                    Array.from(typeInputs).forEach(input => {\r\n                        input.addEventListener('change', () => {\r\n                            console.log(`change for type input`);\r\n                            Array.from(document.querySelectorAll('.custom-search-filter-box-type input[type=\"radio\"]')).forEach(checkbox => {\r\n                                console.log(`change for type input checking \"${checkbox.value}\" === \"${input.value}\" -> ${checkbox.checked}`);\r\n                                if (checkbox.value === input.value) {\r\n                                    console.log(`change for type input checking as true \"${checkbox.value}\" === \"${input.value}\" -> ${checkbox.checked}`);\r\n                                    checkbox.checked = true;\r\n                                    console.log(`change for type input checked \"${checkbox.value}\" === \"${input.value}\" -> ${checkbox.checked}`);\r\n                                }\r\n                            });\r\n                            Array.from(forms).forEach(form => {\r\n                                const typeBtn = form.querySelector('.search-bar-type-btn');\r\n                                if (typeBtn) typeBtn.textContent = window.t(input.value);\r\n                                const typeBox = form.querySelector('.custom-search-filter-box-type');\r\n                                if (typeBox) typeBox.style.display = 'none';\r\n                            });\r\n                        });\r\n                    });\r\n                });\r\n            }\r\n            Array.from(saleBtns).forEach(btn => {\r\n                btn.addEventListener('click', function(e) {\r\n                    console.log(`click for sale btn`);\r\n                    e.preventDefault();\r\n                    selectSaleOrRent(this);\r\n                    Array.from(forms).forEach( form => {\r\n                        const saleInputs = form.querySelectorAll('[name=\"sale-rent-option\"]');\r\n                        Array.from(saleInputs).forEach(input => {\r\n                            if (input.value === 'sale') input.checked = true;\r\n                        });\r\n                    });\r\n                    updateTypeOptionsForSaleOrRent('sale');\r\n                });\r\n            });\r\n\r\n            Array.from(rentBtns).forEach(btn => {\r\n                btn.addEventListener('click', function(e) {\r\n                    console.log(`click for rent btn`);\r\n                    e.preventDefault();\r\n                    selectSaleOrRent(this);\r\n                    Array.from(forms).forEach( form => {\r\n                        const saleInputs = form.querySelectorAll('[name=\"sale-rent-option\"]');\r\n                        Array.from(saleInputs).forEach(input => {\r\n                            if (input.value === 'rent') input.checked = true;\r\n                        });\r\n                    });\r\n                    updateTypeOptionsForSaleOrRent('rent');\r\n                });\r\n            });\r\n\r\n            \/\/ Allows you to change the type when sale\/rent is already selected\r\n            function checkUrlAndSetType() {\r\n                console.log(`checkUrlAndSetType()`);\r\n                const url = window.location.href;\r\n                if (url.includes('rent') || url.includes('commercial-let')) {\r\n                    updateTypeOptionsForSaleOrRent('rent');\r\n\r\n                    const rentRadios = document.querySelectorAll('input[name=\"sale-rent-option\"][value=\"rent\"]');\r\n                    Array.from(rentRadios).forEach(rentRadio => {\r\n                        rentRadio.checked = true;\r\n                    });\r\n\r\n                    Array.from(document.getElementsByClassName('search-bar-rent-btn')).forEach(btn => btn.classList.add('selected'));\r\n\r\n                } else if (url.includes('sale') || url.includes('commercial-sale')) {\r\n                    updateTypeOptionsForSaleOrRent('sale');\r\n                    const saleRadios = document.querySelectorAll('input[name=\"sale-rent-option\"][value=\"sale\"]');\r\n                    Array.from(saleRadios).forEach(saleRadio => {\r\n                        saleRadio.checked = true;\r\n                    });\r\n                    Array.from(document.getElementsByClassName('search-bar-sale-btn')).forEach(btn => btn.classList.add('selected'));\r\n                }\r\n\r\n                const pathname = window.location.pathname;\r\n                if (pathname.includes('\/commercial-sale') || pathname.includes('\/commercial-let')) {\r\n                    updateTypeOptionsForSaleOrRent('commercial');\r\n                }\r\n\r\n                const pathMatch = window.location.pathname.match(\/(?:\\\/[a-z]{2})?\\\/([a-z\\-]+)-for-(sale|rent)\/);\r\n                if (pathMatch && pathMatch[1]) {\r\n                    let rawType = pathMatch[1].replace(\/-\/g, '').toLowerCase(); \r\n                    const knownTypes = ['apartment', 'house', 'room', 'land', 'commercial', 'parking', 'office', 'studio', 'villa'];\r\n\r\n                    const matchedType = knownTypes.find(type => rawType.includes(type));\r\n                    if (matchedType) {\r\n                        const radios = document.querySelectorAll(`.custom-search-filter-box-type-list input[value=\"${capitalize(matchedType)}\"]`);\r\n                        Array.from(radios).forEach(radio => {\r\n                            radio.checked = true;\r\n                            Array.from(forms).forEach(form => {\r\n                                const typeBtn = form.querySelector('.search-bar-type-btn');\r\n                                if (typeBtn) {\r\n                                    typeBtn.textContent = window.t(capitalize(matchedType));\r\n                                    typeBtn.classList.add('selected');\r\n                                }\r\n                            });\r\n                        });\r\n                    }\r\n                }\r\n\r\n                function capitalize(str) {\r\n                    console.log(`capitalize(${str})`);\r\n                    return str.charAt(0).toUpperCase() + str.slice(1);\r\n                }\r\n            }\r\n\r\n            checkUrlAndSetType();\r\n\r\n            function hideAllFilterBoxes() {\r\n                console.log(`hideAllFilterBoxes()`);\r\n                Array.from(document.querySelectorAll('.custom-search-filter-box-country')).forEach(countryFilterBox => {\r\n                    countryFilterBox.style.display = 'none';\r\n                });\r\n                Array.from(document.querySelectorAll('.custom-search-filter-box-city')).forEach(locationFilterBox => {\r\n                    locationFilterBox.style.display = 'none';\r\n                });\r\n                Array.from(document.querySelectorAll('.custom-search-filter-box-type')).forEach(typeFilterBox => {\r\n                    typeFilterBox.style.display = 'none';\r\n                });\r\n\r\n                Array.from(document.querySelectorAll('.search-bar-location-btn')).forEach(locationBtn => {\r\n                    locationBtn.classList.remove('selected');\r\n                });\r\n                Array.from(document.querySelectorAll('.search-bar-type-btn')).forEach(typeBtn => {\r\n                    typeBtn.classList.remove('selected');\r\n                });\r\n            }\r\n\r\n            function toggleFilterBox(filterBox, button) {\r\n                console.log(`toggleFilterBox(${filterBox}, ${button})`);\r\n                if (filterBox.style.display === 'block') {\r\n                    filterBox.style.display = 'none';\r\n                    button.classList.remove('selected');\r\n                } else {\r\n                    hideAllFilterBoxes();\r\n                    filterBox.style.display = 'block';\r\n                    button.classList.add('selected');\r\n                }\r\n            }\r\n\r\n            Array.from(forms).forEach(form => {\r\n                const countryBtn = form.querySelector('.search-bar-country-btn');\r\n                const countryFilterBox = form.querySelector('.custom-search-filter-box-country');\r\n                if (countryBtn && countryFilterBox) {\r\n                    countryBtn.addEventListener('click', function(event) {\r\n                        console.log(`click for country btn`);\r\n                        toggleFilterBox(countryFilterBox, countryBtn);\r\n                        event.preventDefault();\r\n                    });\r\n                }\r\n\r\n                const locationBtn = form.querySelector('.search-bar-location-btn');\r\n                const locationFilterBox = form.querySelector('.custom-search-filter-box-city');\r\n                if (locationBtn && locationFilterBox) {\r\n                    locationBtn.addEventListener('click', function(event) {\r\n                        console.log(`click for location btn`);\r\n                        toggleFilterBox(locationFilterBox, locationBtn);\r\n                        event.preventDefault();\r\n                    });\r\n                }\r\n\r\n                const typeBtn = form.querySelector('.search-bar-type-btn');\r\n                const typeFilterBox = form.querySelector('.custom-search-filter-box-type');\r\n                if (typeBtn && typeFilterBox) {\r\n                    typeBtn.addEventListener('click', function(event) {\r\n                        console.log(`click for type btn`);\r\n                        toggleFilterBox(typeFilterBox, typeBtn);\r\n                        event.preventDefault();\r\n                    });\r\n                }\r\n            });\r\n\r\n            const countryInputs = document.querySelectorAll('[name=\"country\"]');\r\n\r\n            Array.from(countryInputs).forEach(input => {\r\n                input.addEventListener('change', () => {\r\n\r\n                    \/\/ Update button text\r\n                    Array.from(forms).forEach(form => {\r\n                        const countryBtn = form.querySelector('.search-bar-country-btn');\r\n                        if (countryBtn) {\r\n                            countryBtn.textContent = input.value;\r\n                            countryBtn.classList.add('selected');\r\n                        }\r\n                    });\r\n\r\n                    resetCitySelection();\r\n                    updateCityList(input.value);\r\n\r\n                    Array.from(forms).forEach(form => {\r\n                        const countryFilterBox = form.querySelector('.custom-search-filter-box-country');\r\n                        if (countryFilterBox) {\r\n                            countryFilterBox.style.display = 'none';\r\n                        }\r\n                    });\r\n                });\r\n            });\r\n\r\n            \/\/Protection against choosing a city that does not match the country\r\n            function resetCitySelection() {\r\n                console.log(`resetCitySelection()`);\r\n\r\n                const cityInputs = document.querySelectorAll('.custom-search-filter-box-city-list input[name=\"city\"]');\r\n                Array.from(cityInputs).forEach(input => {\r\n                    input.checked = false;\r\n                });\r\n\r\n                const cityInputFields = document.querySelectorAll('.search-filter-city');\r\n                Array.from(cityInputFields).forEach(cityInputField => {\r\n                    cityInputField.value = '';\r\n                });\r\n\r\n                const locationBtns = document.querySelectorAll('.search-bar-location-btn');\r\n                Array.from(locationBtns).forEach(locationBtn => {\r\n                    locationBtn.textContent = window.t('City');\r\n                    locationBtn.classList.remove('selected');\r\n                });\r\n\r\n            }\r\n\r\n            hideAllFilterBoxes();\r\n\r\n            document.addEventListener('click', function(event) {\r\n                console.log(`click for document to hideAllFilterBoxes()`);\r\n                if (!event.target.closest('.custom-search-filter-container-main') &&\r\n                    !event.target.closest('.search-bar-option-country') &&\r\n                    !event.target.closest('.search-bar-option-location') &&\r\n                    !event.target.closest('.search-bar-option-type')) {\r\n                    hideAllFilterBoxes();\r\n                }\r\n            });\r\n\r\n            function getUrlParams() {\r\n                console.log(`getUrlParams()`);\r\n                const params = new URLSearchParams(window.location.search);\r\n                const data = {};\r\n                params.forEach((value, key) => {\r\n                    data[key] = value;\r\n                });\r\n                return data;\r\n            }\r\n\r\n            function setFiltersFromUrl() {\r\n                console.log(`setFiltersFromUrl()`);\r\n                const urlParams = getUrlParams();\r\n                const pathname = window.location.pathname;\r\n\r\n                if (urlParams['country']) {\r\n                    Array.from(forms).forEach(form => {\r\n                        const countryInput = form.querySelector('[name=\"country\"]');\r\n                        if (countryInput) countryInput.value = urlParams['country'];\r\n                        const countryBtn = form.querySelector('.search-bar-country-btn');\r\n                        if (countryBtn) countryBtn.textContent = urlParams['country'];\r\n                    });\r\n\r\n                    updateCityList(urlParams['country']);\r\n                }\r\n\r\n                if (urlParams['city']) {\r\n                    Array.from(forms).forEach(form => {\r\n                        const cityInput = form.querySelector('[name=\"city\"]');\r\n                        if (cityInput) cityInput.value = urlParams['city'];\r\n                        const locationBtn = form.querySelector('.search-bar-location-btn');\r\n                        if (locationBtn) locationBtn.textContent = urlParams['city'];\r\n\r\n                        const cityRadio = form.querySelector(`.custom-search-filter-box-city-list input[name=\"city\"][value=\"${urlParams['city']}\"]`);\r\n                        if (cityRadio) cityRadio.checked = true;\r\n                    });\r\n                }\r\n\r\n                if (urlParams['sale-rent-option']) {\r\n                    const saleOrRent = urlParams['sale-rent-option'];\r\n                    Array.from(forms).forEach(form => {\r\n                        Array.from(form.querySelectorAll('[name=\"sale-rent-option\"]')).forEach(input => {\r\n                            input.checked = (input.value === saleOrRent);\r\n                        });\r\n                    });\r\n                    Array.from(saleBtns).forEach(btn => btn.classList.toggle('selected', saleOrRent === 'sale'));\r\n                    Array.from(rentBtns).forEach(btn => btn.classList.toggle('selected', saleOrRent === 'rent'));\r\n                    updateTypeOptionsForSaleOrRent(saleOrRent);\r\n                    setTimeout(() => {\r\n                        applyPurposeOrTypeFromUrl(); \/\/ ??? no definition\r\n                    }, 100);\r\n                }\r\n\r\n                if (pathname.includes('\/commercial-let') || pathname.includes('\/commercial-sale')) {\r\n                    if (urlParams['purpose']) {\r\n                        const typeValue = urlParams['purpose'];\r\n                        Array.from(forms).forEach(form => {\r\n                            const typeInput = form.querySelector(`input[name=\"type\"][value=\"${typeValue}\"]`);\r\n                            const typeBtn = form.querySelector('.search-bar-type-btn');\r\n\r\n                            if (typeInput && typeBtn) {\r\n                                typeInput.checked = true;\r\n                                typeBtn.textContent = window.t(typeValue);\r\n                                typeBtn.classList.add('selected');\r\n\r\n                                const typeFilterBox = form.querySelector('.custom-search-filter-box-type');\r\n                                if (typeFilterBox) {\r\n                                    typeFilterBox.style.display = 'none';\r\n                                }\r\n                            }\r\n                        });\r\n                    }\r\n                } else {\r\n                    if (urlParams['type']) {\r\n                        Array.from(forms).forEach(form => {\r\n                            const typeCheckbox = form.querySelector(`[name=\"type\"][value=\"${urlParams['type']}\"]`);\r\n                            if (typeCheckbox) {\r\n                                typeCheckbox.checked = true;\r\n                                const typeBtn = form.querySelector('.search-bar-type-btn');\r\n                                if (typeBtn) typeBtn.textContent = window.t(urlParams['type']);\r\n                            }\r\n                        });\r\n                    } \r\n                }\r\n            }\r\n\r\n            Array.from(forms).forEach(form => {\r\n                form.addEventListener('submit', function(event) {\r\n                    console.log(`submit for form`);\r\n                    event.preventDefault();\r\n\r\n                    const formData = new FormData(form);\r\n                    const data = Object.fromEntries(formData.entries());\r\n\r\n                    if (!data['sale-rent-option']) {\r\n                        alert(window.t('choose_sale_or_rent'));\r\n                        return;\r\n                    }\r\n\r\n                    const saleOrRent = data['sale-rent-option'];\r\n                    const type = data['type'];\r\n\r\n                    const isMap = window.location.pathname.includes('-map');\r\n\r\n                    let url = '';\r\n                    const queryParams = new URLSearchParams();\r\n\r\n                    if (data['country']) queryParams.append('country', data['country']);\r\n                    if (data['city']) queryParams.append('city', data['city']);\r\n\r\n                    const isCommercialPage = window.location.pathname.includes('\/commercial-sale') || window.location.pathname.includes('\/commercial-let');\r\n                    const commercialTypes = ['Commercial','Office','Shared Office Space','Warehouse','Retail','Hospitality','Leisure','Restaurant','Storage','Production','Workshop','Other','Land'];\r\n\r\n                    if (isCommercialPage && type && commercialTypes.includes(type)) {\r\n                        const rentOrLet = saleOrRent === 'rent' ? 'let' : 'sale';\r\n                        url = `\/commercial-${rentOrLet}${isMap ? '-map' : ''}\/`;\r\n                        if (type !== 'Commercial') {\r\n                            queryParams.append('purpose', type);\r\n                        }\r\n                    } else {\r\n                        if (type) {\r\n                            if (type === 'Commercial') {\r\n                                const rentOrLet = saleOrRent === 'rent' ? 'let' : 'sale';\r\n                                url = `\/commercial-${rentOrLet}${isMap ? '-map' : ''}\/`;\r\n                            } else {\r\n                                const typeSlug = type.toLowerCase().replace(\/\\s+\/g, '-');\r\n                                url = `\/${typeSlug}-for-${saleOrRent}${isMap ? '-map' : ''}\/`;\r\n                            }\r\n                        } else {\r\n                            url = `\/${saleOrRent}${isMap ? '-map' : ''}\/`;\r\n                        }\r\n                    }\r\n\r\n                    if (queryParams.toString()) {\r\n                        url += `?${queryParams.toString()}`;\r\n                    }\r\n\r\n                    window.location.href = lang && lang !== 'en' ? `\/${lang}${url}` : url;\r\n                });\r\n            });\r\n\r\n\r\n            setFiltersFromUrl();\r\n       \r\n            Array.from(forms).forEach(form => {\r\n                const countryBtn = form.querySelector('.search-bar-country-btn');\r\n                const locationBtn = form.querySelector('.search-bar-location-btn');\r\n                if (countryBtn) {\r\n                    if (countryBtn.textContent.trim() !== window.t('Country')) {\r\n                        countryBtn.classList.add('selected');\r\n                    }\r\n                }\r\n\r\n                if (locationBtn) {\r\n                    if (locationBtn.textContent.trim() !== window.t('City')) {\r\n                        locationBtn.classList.add('selected');\r\n                    }\r\n                }\r\n            });\r\n        });\r\n\r\n        const forms = document.querySelectorAll('.custom-search-filter-container-main:has(button[type=\"submit\"])');\r\n\r\n        function setupFilter(searchSelector, containerSelector, onAutoSelect = null) {\r\n            const searchInputs = document.querySelectorAll(searchSelector);\r\n            const containers = document.querySelectorAll(containerSelector);\r\n            if (!searchInputs || !containers) return;\r\n\r\n            searchInputs.forEach(searchInput => {\r\n                searchInput.addEventListener('input', () => {\r\n                    const query = searchInput.value.toLowerCase().trim();\r\n\r\n                    containers.forEach(container => {\r\n                        const labels = Array.from(container.querySelectorAll('.checkcontainer'));\r\n\r\n                        let visibleLabels = [];\r\n\r\n                        labels.forEach(label => {\r\n                            const text = label.querySelector('input')?.value.toLowerCase();\r\n                            const match = text.includes(query);\r\n                            label.style.display = match ? '' : 'none';\r\n                            if (match) visibleLabels.push(label);\r\n                        });\r\n\r\n                        if (visibleLabels.length === 1 && query.length >= 2) {\r\n                            const label = visibleLabels[0];\r\n                            const radio = label.querySelector('input[type=\"radio\"]');\r\n\r\n                            if (radio && !radio.checked) {\r\n                                radio.checked = true;\r\n                                searchInput.value = radio.value;\r\n\r\n                                if (typeof onAutoSelect === 'function') {\r\n                                    onAutoSelect(radio.value);\r\n                                }\r\n                            }\r\n                        }\r\n                    });\r\n                });\r\n            });\r\n        }\r\n\r\n        Array.from(forms).forEach(form => {\r\n            Array.from(form.querySelectorAll('.custom-search-filter-box-country input[type=\"radio\"]')).forEach(checkbox => {\r\n                checkbox.addEventListener('change', handleCountrySelection);\r\n            });\r\n        });\r\n\r\n        setupFilter('.search-filter-country', '.custom-search-filter-box-country-list');\r\n        setupFilter('.search-filter-city', '.custom-search-filter-box-city-list');\r\n\r\n    <\/script>\r\n\r\n\t\r\n<script>\r\n    document.addEventListener(\"DOMContentLoaded\", function() {\r\n        console.log(`DOMContentLoaded for mobile`);\r\n        const openBtn = document.querySelector(\".mobile-filters-button\");\r\n        const overlay = document.querySelector(\".mobile-filters-overlay\");\r\n        const closeBtn = document.querySelector(\".mobile-filters-close\");\r\n        const formBox = document.querySelector(\".mobile-form-filters\");\r\n\r\n        function closeModal() {\r\n            console.log(`closeModal()`);\r\n            if (overlay) overlay.style.display = \"none\";\r\n            document.body.style.overflow = \"\";\r\n        }\r\n\r\n        if (openBtn) {\r\n            openBtn.addEventListener(\"click\", () => {\r\n                console.log(`click for open btn`);\r\n                if (overlay) overlay.style.display = \"block\";\r\n                document.body.style.overflow = \"hidden\";\r\n            });\r\n        }\r\n\r\n        if (closeBtn) {\r\n            closeBtn.addEventListener(\"click\", closeModal);\r\n        }\r\n\r\n        if (overlay) {\r\n            overlay.addEventListener(\"click\", (event) => {\r\n                console.log(`click for overlay`);\r\n                if (!event.target.closest(\".mobile-form-filters\")) {\r\n                    closeModal();\r\n                }\r\n\r\n            });\r\n        }\r\n    });\r\n\r\n\r\n<\/script>\t\t<div class=\"elementor-shortcode\"><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-31313510 e-con-full e-flex e-con e-parent\" data-id=\"31313510\" data-element_type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-47e8e5ec elementor-widget elementor-widget-shortcode\" data-id=\"47e8e5ec\" data-element_type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\r\n\r\n\r\n    <h3 class=\"ads-list-start-title-page\">Wp Jsons<\/h3>\r\n\r\n<div class=\"post-main-start-container ads-list-start-container\">\r\n    <div class=\"post-main-breadcrumbs-box\">\r\n        <nav class=\"breadcrumbs\">\r\n            <a href=\"https:\/\/homezzy.com\/ro\">\r\n                <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.0\" width=\"3543.000000pt\" height=\"3543.000000pt\" viewbox=\"0 0 3543.000000 3543.000000\" preserveaspectratio=\"xMidYMid meet\" class=\"breadcrumbs-logo-main\" >\r\n                    <g transform=\"translate(0.000000,3543.000000) scale(0.100000,-0.100000)\" fill=\"#000000\" stroke=\"none\">\r\n                    <path d=\"M5207 30533 c-5 -4 -59 -11 -120 -15 -62 -4 -150 -12 -197 -17 -47 -6 -125 -15 -175 -20 -49 -6 -110 -15 -135 -21 -49 -11 -202 -38 -262 -47 -21 -3 -42 -10 -47 -17 -16 -19 31 -352 79 -552 114 -485 331 -973 633 -1424 206 -307 382 -518 671 -805 446 -442 959 -804 1538 -1083 192 -93 500 -222 530 -222 9 0 20 -4 23 -10 3 -5 14 -10 24 -10 17 0 61 -31 61 -43 0 -7 -14 -5 -165 24 -541 102 -1235 105 -1870 8 -215 -33 -558 -104 -680 -140 -16 -5 -77 -23 -135 -39 -181 -50 -230 -66 -415 -133 -466 -170 -857 -365 -1248 -624 -203 -134 -354 -250 -594 -458 -6 -5 -72 -70 -147 -144 l-136 -135 42 -44 c63 -65 231 -210 323 -279 340 -255 758 -455 1195 -574 159 -43 177 -48 235 -59 33 -7 78 -16 100 -21 66 -15 215 -40 300 -50 44 -5 114 -14 155 -19 326 -41 1015 -41 1375 -1 44 5 125 14 180 20 55 6 128 15 163 20 34 6 95 15 135 21 39 6 88 15 107 20 19 5 76 16 125 25 50 8 110 20 135 26 25 6 65 15 90 20 25 6 61 14 80 19 19 6 67 17 105 26 39 8 81 19 95 24 14 4 43 13 65 19 123 33 162 44 180 51 11 5 47 16 80 25 33 9 69 20 80 25 11 4 36 13 55 20 19 7 44 16 55 20 11 4 54 20 95 35 146 52 362 152 503 232 54 31 101 52 105 48 9 -9 -40 -50 -153 -127 -49 -34 -111 -78 -137 -97 -73 -57 -198 -147 -396 -287 -101 -71 -232 -164 -290 -207 -59 -43 -123 -89 -142 -103 -19 -14 -123 -88 -230 -165 -107 -77 -206 -148 -220 -157 -14 -9 -81 -57 -150 -108 -69 -50 -262 -189 -430 -309 -817 -586 -950 -682 -1020 -734 -220 -163 -349 -367 -413 -651 -21 -94 -21 -111 -24 -1562 l-4 -1468 858 0 c924 -1 955 -2 1100 -53 86 -30 199 -101 266 -165 113 -109 220 -282 254 -412 7 -30 19 -71 26 -90 9 -27 13 -1351 17 -5485 5 -5138 6 -5455 23 -5545 50 -271 114 -463 220 -660 76 -142 226 -339 339 -446 222 -210 489 -353 763 -408 44 -9 102 -21 128 -26 32 -7 3109 -10 8735 -10 8558 0 8689 1 8796 20 237 42 431 121 633 257 147 99 344 300 450 458 149 222 258 497 302 760 6 33 13 76 17 95 4 19 10 2488 13 5485 l6 5450 28 98 c29 101 83 226 121 281 65 93 101 136 158 187 74 65 184 132 253 155 28 8 59 19 70 24 46 20 150 23 998 27 l887 4 0 1466 0 1466 -26 116 c-63 281 -206 492 -454 668 -47 33 -178 127 -292 209 -285 205 -377 271 -787 565 -196 140 -469 336 -606 435 -138 98 -260 186 -272 194 -11 8 -72 52 -135 97 -62 45 -192 138 -288 207 -156 110 -248 177 -400 288 -25 18 -61 44 -81 58 -19 14 -120 86 -223 160 -103 74 -197 142 -209 150 -13 8 -100 71 -195 140 -95 69 -201 145 -236 170 -34 25 -129 92 -210 150 -82 58 -161 114 -176 125 -16 11 -87 62 -157 113 -70 51 -177 128 -238 171 -60 43 -229 164 -375 269 -146 104 -365 261 -486 348 -523 374 -1162 834 -1235 887 -29 21 -409 292 -494 352 -33 23 -222 158 -420 300 -198 142 -452 325 -565 405 -113 81 -320 229 -460 330 -291 210 -315 227 -782 561 -846 606 -1066 764 -1105 793 -23 17 -74 54 -115 83 -58 42 -324 232 -601 431 -21 15 -76 55 -122 90 -46 34 -87 62 -90 62 -4 0 -21 11 -38 24 -44 32 -168 97 -252 130 -38 16 -79 32 -90 37 -31 14 -171 48 -265 65 -160 29 -422 19 -607 -22 -204 -45 -441 -161 -653 -318 -52 -39 -108 -80 -124 -91 -16 -11 -41 -29 -56 -40 -16 -11 -93 -66 -172 -122 -78 -57 -208 -150 -288 -208 -80 -58 -156 -113 -170 -123 -14 -9 -128 -91 -255 -182 -126 -91 -340 -244 -474 -340 -134 -96 -353 -254 -487 -350 -134 -96 -309 -222 -390 -280 -80 -58 -217 -156 -303 -218 -86 -62 -174 -125 -196 -140 -45 -32 -467 -335 -777 -558 -114 -82 -257 -184 -318 -228 -80 -57 -109 -83 -106 -95 16 -53 88 -366 110 -476 67 -346 123 -729 156 -1070 6 -60 15 -150 20 -200 36 -332 73 -1066 55 -1095 -10 -16 -31 4 -40 38 -9 35 -109 332 -134 397 -11 28 -42 109 -70 180 -54 141 -143 357 -183 445 -14 30 -35 78 -48 105 -73 162 -298 606 -382 755 -18 30 -41 73 -53 95 -104 191 -415 673 -584 905 -127 174 -367 484 -442 570 -613 710 -1218 1253 -1864 1674 -66 43 -145 95 -175 116 -130 87 -743 420 -774 420 -2 0 -38 15 -78 34 -250 118 -720 288 -953 345 -22 5 -58 15 -80 21 -54 15 -96 25 -190 45 -44 9 -96 21 -115 26 -45 11 -73 16 -200 39 -150 28 -328 50 -555 71 -138 13 -798 23 -808 12z m16733 -9253 c527 -27 984 -167 1446 -446 193 -116 297 -192 469 -345 480 -425 819 -930 1047 -1564 70 -194 106 -324 153 -556 57 -284 76 -483 76 -794 0 -546 -82 -980 -281 -1495 -187 -485 -491 -946 -856 -1300 -548 -531 -1210 -845 -1919 -910 -86 -8 -1347 -10 -4430 -8 -3974 3 -4318 5 -4410 20 -380 64 -657 153 -980 318 -302 153 -547 332 -812 590 -579 568 -955 1326 -1087 2195 -27 175 -49 538 -42 684 10 196 34 453 51 551 9 47 20 109 25 139 32 185 119 478 215 726 102 263 279 581 472 845 335 461 819 858 1321 1084 349 158 716 247 1087 265 232 12 8226 12 8455 1z\"\/>\r\n                    <path d=\"M13135 18893 c-132 -15 -235 -44 -345 -96 -254 -120 -443 -343 -528 -624 -78 -256 -72 -579 16 -833 50 -143 149 -340 171 -340 5 0 11 32 15 72 37 402 316 650 776 689 136 12 424 0 526 -21 27 -6 94 -20 149 -31 168 -34 179 -37 276 -64 117 -33 324 -101 366 -120 17 -8 36 -15 42 -15 10 0 145 -51 186 -70 11 -5 45 -19 75 -30 158 -60 490 -223 735 -361 293 -164 423 -245 643 -401 75 -53 139 -95 141 -93 7 8 -319 418 -525 661 -190 224 -551 595 -754 775 -341 302 -644 515 -965 677 -298 150 -608 233 -860 230 -60 0 -123 -3 -140 -5z\"\/>\r\n                    <path d=\"M21885 18880 c-333 -57 -658 -197 -1024 -442 -468 -313 -986 -807 -1491 -1422 -191 -233 -354 -445 -348 -452 3 -2 33 16 67 41 317 233 901 571 1256 725 66 28 139 60 162 71 24 10 46 19 49 19 3 0 20 7 37 15 55 24 187 75 198 75 6 0 25 7 42 15 52 23 294 101 407 129 58 15 119 31 135 36 17 5 71 16 120 25 50 9 109 20 131 26 93 20 381 32 520 20 455 -37 726 -273 777 -676 l13 -100 38 58 c135 209 227 547 213 792 -25 463 -249 815 -622 980 -180 79 -449 105 -680 65z\"\/>\r\n                    <\/g>\r\n                <\/svg>\r\n            <\/a><span class=\"breadcrumbs-arrow\" data-no-translation=\"\"> \u00bb <\/span>\r\n\r\n                    <\/nav>\r\n    <\/div>\r\n\r\n    \r\n            <div class=\"sort-container\">\r\n            <p>Sortare: <\/p>\r\n            <select name=\"sort\" id=\"sort-select\">\r\n                <option value=\"low-high\">Pre\u021b sc\u0103zut - ridicat<\/option>\r\n                <option value=\"high-low\">Pre\u021b ridicat - sc\u0103zut<\/option>\r\n                <option value=\"old-new\">Cel mai vechi - Cel mai nou<\/option>\r\n                <option value=\"new-old\">Cel mai nou - Cel mai vechi<\/option>\r\n            <\/select> \r\n            <div class=\"sort-line\"><\/div>\r\n        <\/div>\r\n    \r\n            <a class=\"main-btn-blue\" href=\"\">\r\n            <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"32\" height=\"28\" viewbox=\"0 0 32 28\" fill=\"none\">\r\n                <path d=\"M16 0C12.1339 0 9 3.08492 9 6.89062C9 9.96734 13.575 15.575 15.3278 17.6105C15.6828 18.0228 16.3178 18.0228 16.6722 17.6105C18.425 15.575 23 9.96734 23 6.89062C23 3.08492 19.8661 0 16 0ZM16 9.1875C14.7111 9.1875 13.6667 8.15938 13.6667 6.89062C13.6667 5.62187 14.7111 4.59375 16 4.59375C17.2889 4.59375 18.3333 5.62187 18.3333 6.89062C18.3333 8.15938 17.2889 9.1875 16 9.1875ZM1.11778 11.8098C0.787877 11.9397 0.505073 12.1639 0.305839 12.4535C0.106605 12.7431 7.90116e-05 13.0848 0 13.4345V27.1239C0 27.743 0.635 28.1662 1.21889 27.9366L8.88889 24.5V11.7534C8.39778 10.8795 7.99611 10.0286 7.70833 9.21484L1.11778 11.8098ZM16 19.6695C15.2183 19.6695 14.4789 19.3315 13.9717 18.742C12.8794 17.4732 11.7178 16.0284 10.6667 14.5463V24.4995L21.3333 27.9995V14.5469C20.2822 16.0284 19.1211 17.4738 18.0283 18.7425C17.5211 19.3315 16.7817 19.6695 16 19.6695ZM30.7811 8.81344L23.1111 12.25V28L30.8822 24.9402C31.2122 24.8104 31.495 24.5862 31.6943 24.2966C31.8935 24.007 32 23.6652 32 23.3155V9.62609C32 9.00703 31.365 8.58375 30.7811 8.81344Z\" fill=\"white\"\/>\r\n            <\/svg>\r\n            Arat\u0103 harta\r\n        <\/a>\r\n    <\/div>\r\n\r\n\r\n\r\n\r\n    <div class=\"offers-info-container\">\r\n        <div class=\"all-offers-number\">0 Oferte<\/div>\r\n    <script>\r\n        document.addEventListener('DOMContentLoaded', () => {\r\n            \/\/ const offersNumberContainer = document.querySelector('.all-offers-number');\r\n\r\n            \/\/ function getSettingsByPage() {\r\n            \/\/     const path = window.location.pathname;\r\n            \/\/     switch (true) {\r\n            \/\/         case path.includes('apartment-for-sale'):\r\n            \/\/             return \"https:\/\/homezzy-api-hw74g.ondigitalocean.app\" + '\/saleapartments';\r\n            \/\/         case path.includes('house-for-sale'):\r\n            \/\/             return \"https:\/\/homezzy-api-hw74g.ondigitalocean.app\" + '\/salehouses';\r\n            \/\/         case path.includes('land-for-sale'):\r\n            \/\/             return \"https:\/\/homezzy-api-hw74g.ondigitalocean.app\" + '\/salelands';\r\n            \/\/         case path.includes('parking-for-sale'):\r\n            \/\/             return \"https:\/\/homezzy-api-hw74g.ondigitalocean.app\" + '\/saleparkings';\r\n            \/\/         case path.includes('house-for-rent'):\r\n            \/\/             return \"https:\/\/homezzy-api-hw74g.ondigitalocean.app\" + '\/renthouses';\r\n            \/\/         case path.includes('apartment-for-rent'):\r\n            \/\/             return \"https:\/\/homezzy-api-hw74g.ondigitalocean.app\" + '\/rentapartments';\r\n            \/\/         case path.includes('room-for-rent'):\r\n            \/\/             return \"https:\/\/homezzy-api-hw74g.ondigitalocean.app\" + '\/rentrooms';\r\n            \/\/         case path.includes('parking-for-rent'):\r\n            \/\/             return \"https:\/\/homezzy-api-hw74g.ondigitalocean.app\" + '\/rentparkings';\r\n            \/\/         case path.includes('commercial-sale'):\r\n            \/\/             return \"https:\/\/homezzy-api-hw74g.ondigitalocean.app\" + '\/salecommercials';\r\n            \/\/         case path.includes('commercial-let'):\r\n            \/\/             return \"https:\/\/homezzy-api-hw74g.ondigitalocean.app\" + '\/rentcommercials';\r\n            \/\/         case path.includes('short-let-apartment'):\r\n            \/\/             return \"https:\/\/homezzy-api-hw74g.ondigitalocean.app\" + '\/shortletapartments';\r\n            \/\/         case path.includes('short-let-house'):\r\n            \/\/             return \"https:\/\/homezzy-api-hw74g.ondigitalocean.app\" + '\/shortlethouses';\r\n            \/\/         case path.includes('short-let-parking'):\r\n            \/\/             return \"https:\/\/homezzy-api-hw74g.ondigitalocean.app\" + '\/shortletparkings';\r\n            \/\/         case path.includes('short-let-room'):\r\n            \/\/             return \"https:\/\/homezzy-api-hw74g.ondigitalocean.app\" + '\/shortletrooms';\r\n            \/\/         default:\r\n            \/\/             return null;\r\n            \/\/     }\r\n            \/\/ }\r\n\r\n            \/\/ const apiEndpoint = getSettingsByPage();\r\n\r\n            \/\/ async function fetchAds() {\r\n            \/\/     if (!apiEndpoint) {\r\n            \/\/         offersNumberContainer.textContent = 'No category found';\r\n            \/\/         return;\r\n            \/\/     }\r\n\r\n            \/\/     try {\r\n            \/\/         const response = await fetch(apiEndpoint);\r\n            \/\/         if (!response.ok) {\r\n            \/\/             throw new Error(`HTTP error! Status: ${response.status}`);\r\n            \/\/         }\r\n\r\n            \/\/         const ads = await response.json();\r\n            \/\/     } catch (error) {\r\n            \/\/         offersNumberContainer.textContent = 'Failed to load offers';\r\n            \/\/         console.error('Error fetching ads:', error);\r\n            \/\/     }\r\n            \/\/ }\r\n\r\n            const currentUrl = window.location.href;\r\n            const rules = [\r\n                {\r\n                    condition: url => url.includes(\"commercial-sale\"),\r\n                    transformations: {\r\n                        path: { from: \"commercial-let\", to: \"commercial-sale\" },\r\n                        advertisementType: { from: \"rent\", to: \"sale\" }\r\n                    }\r\n                },\r\n                {\r\n                    condition: url => url.includes(\"commercial-let\"),\r\n                    transformations: {\r\n                        path: { from: \"commercial-sale\", to: \"commercial-let\" },\r\n                        advertisementType: { from: \"sale\", to: \"rent\" }\r\n                    }\r\n                },\r\n                {\r\n                    condition: url => url.includes(\"apartment-for-sale\"),\r\n                    transformations: {\r\n                        path: { from: \"house-for-sale\", to: \"apartment-for-sale\" },\r\n                        advertisementType: { from: \"rent\", to: \"sale\" },\r\n                        propertyType: { from: \"houses\", to: \"appartments\" }\r\n                    }\r\n                },\r\n                {\r\n                    condition: url => url.includes(\"apartment-for-rent\"),\r\n                    transformations: {\r\n                        path: { from: \"house-for-sale\", to: \"apartment-for-rent\" },\r\n                        advertisementType: { from: \"sale\", to: \"rent\" },\r\n                        propertyType: { from: \"houses\", to: \"appartments\" }\r\n                    }\r\n                },\r\n                {\r\n                    condition: url => url.includes(\"house-for-rent\"),\r\n                    transformations: {\r\n                        path: { from: \"house-for-sale\", to: \"house-for-rent\" },\r\n                        advertisementType: { from: \"sale\", to: \"rent\" }\r\n                    }\r\n                },\r\n                {\r\n                    condition: url => url.includes(\"parking-for-rent\"),\r\n                    transformations: {\r\n                        path: { from: \"parking-for-sale\", to: \"parking-for-rent\" },\r\n                        advertisementType: { from: \"sale\", to: \"rent\" }\r\n                    }\r\n                },\r\n                {\r\n                    condition: url => url.includes(\"developments\"),\r\n                    transformations: {\r\n                        path: { from: \"house-for-sale\", to: \"developments\" },\r\n                        propertyType: { from: \"houses\", to: \"investments\" }\r\n                    }\r\n                }\r\n            ];\r\n\r\n            const applicableRule = rules.find(rule => rule.condition(currentUrl));\r\n            if (!applicableRule) return;\r\n\r\n            const { transformations } = applicableRule;\r\n\r\n            document.querySelectorAll(\".property-category-container-box\").forEach(link => {\r\n                const urlObj = new URL(link.getAttribute(\"href\"), window.location.origin);\r\n                let path = urlObj.pathname;\r\n                const params = urlObj.searchParams;\r\n\r\n                if (transformations.path && path.includes(transformations.path.from)) {\r\n                    path = path.replace(transformations.path.from, transformations.path.to);\r\n                }\r\n\r\n                if (\r\n                    transformations.advertisementType &&\r\n                    params.get(\"advertisementType\") === transformations.advertisementType.from\r\n                ) {\r\n                    params.set(\"advertisementType\", transformations.advertisementType.to);\r\n                }\r\n\r\n                if (\r\n                    transformations.propertyType &&\r\n                    params.get(\"propertyType\") === transformations.propertyType.from\r\n                ) {\r\n                    params.set(\"propertyType\", transformations.propertyType.to);\r\n                }\r\n\r\n                urlObj.pathname = path;\r\n                link.setAttribute(\"href\", urlObj.pathname + \"?\" + params.toString());\r\n            });\r\n\r\n\r\n\r\n\r\n            \/\/ fetchAds();\r\n        });\r\n\r\n        function modifyLinks() {\r\n            const links = document.querySelectorAll('a.main-btn-blue');\r\n            links.forEach(link => {\r\n                let currentURL = link.getAttribute('href') || window.location.href;\r\n\r\n                if (\r\n                    currentURL.includes(\"-sale\") ||\r\n                    currentURL.includes(\"-rent\") ||\r\n                    currentURL.includes(\"-let\") ||\r\n                    currentURL.includes(\"developments\") ||\r\n                    currentURL.includes(\"short-let\") ||\r\n                    currentURL.includes(\"\/sale\") ||\r\n                    currentURL.includes(\"\/rent\")\r\n                ) {\r\n                    let [baseURL, queryParams] = currentURL.split('?');\r\n\r\n                    if (baseURL.endsWith('\/')) {\r\n                        baseURL = baseURL.slice(0, -1);\r\n                    }\r\n\r\n                    if (!baseURL.endsWith('-map')) {\r\n                        baseURL += '-map';\r\n                    }\r\n\r\n                    const updatedURL = baseURL + (queryParams ? '?' + queryParams : '');\r\n                    link.href = updatedURL;\r\n                    \/\/console.log(updatedURL);\r\n                }\r\n            });\r\n        }\r\n\r\n        window.addEventListener(\"load\", modifyLinks);\r\n        window.addEventListener(\"popstate\", modifyLinks);\r\n\r\n\r\n    <\/script>\r\n\r\n\r\n    <\/div>\r\n\r\n\t\t<div class=\"elementor-shortcode\"><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-764938 e-con-full e-flex e-con e-parent\" data-id=\"764938\" data-element_type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t<div class=\"elementor-element elementor-element-3ef2a9c2 e-con-full e-flex e-con e-child\" data-id=\"3ef2a9c2\" data-element_type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-31a33108 elementor-widget elementor-widget-shortcode\" data-id=\"31a33108\" data-element_type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<div>Filtre indisponibile <\/div>\r\n\r\n<script>\r\n    document.addEventListener(\"DOMContentLoaded\", function () {\r\n        const rangeInput = document.querySelectorAll(\".range-input input\");\r\n        const priceInput = document.querySelectorAll(\".price-input input\");\r\n        const range = document.querySelector(\".slider .progress\");\r\n        let priceGap = 1000;\r\n\r\n        if (rangeInput.length === 2 && priceInput.length === 2 && range) {\r\n            priceInput.forEach((input) => {\r\n                input.addEventListener(\"input\", (e) => {\r\n                    let minPrice = parseInt(priceInput[0].value) || 0,\r\n                        maxPrice = parseInt(priceInput[1].value) || 0;\r\n\r\n                    if (minPrice < 0) {\r\n                        minPrice = 0;\r\n                        priceInput[0].value = 0;\r\n                    }\r\n                    if (maxPrice < 0) {\r\n                        maxPrice = 0;\r\n                        priceInput[1].value = 0;\r\n                    }\r\n\r\n                    if (minPrice > maxPrice) {\r\n                        if (e.target.classList.contains(\"input-min\")) {\r\n                            minPrice = maxPrice - priceGap;\r\n                            if (minPrice < 0) minPrice = 0;\r\n                            priceInput[0].value = minPrice;\r\n                        } else {\r\n                            maxPrice = minPrice + priceGap;\r\n                            priceInput[1].value = maxPrice;\r\n                        }\r\n                    }\r\n\r\n                    if (maxPrice - minPrice >= priceGap && maxPrice <= rangeInput[1].max) {\r\n                        rangeInput[0].value = minPrice;\r\n                        rangeInput[1].value = maxPrice;\r\n                        range.style.left = (minPrice \/ rangeInput[0].max) * 100 + \"%\";\r\n                        range.style.right = 100 - (maxPrice \/ rangeInput[1].max) * 100 + \"%\";\r\n                    }\r\n                });\r\n            });\r\n\r\n            rangeInput.forEach((input) => {\r\n                input.addEventListener(\"input\", (e) => {\r\n                    let minVal = parseInt(rangeInput[0].value),\r\n                        maxVal = parseInt(rangeInput[1].value);\r\n\r\n                    if (maxVal - minVal < priceGap) {\r\n                        if (e.target.className === \"range-min\") {\r\n                            rangeInput[0].value = maxVal - priceGap;\r\n                        } else {\r\n                            rangeInput[1].value = minVal + priceGap;\r\n                        }\r\n                    } else {\r\n                        priceInput[0].value = minVal;\r\n                        priceInput[1].value = maxVal;\r\n                        range.style.left = (minVal \/ rangeInput[0].max) * 100 + \"%\";\r\n                        range.style.right = 100 - (maxVal \/ rangeInput[1].max) * 100 + \"%\";\r\n                    }\r\n                });\r\n            });\r\n        }\r\n\r\n        const labelsRadio = document.querySelectorAll('.custom-advance-btn-radio');\r\n        if (labelsRadio.length) {\r\n            labelsRadio.forEach(label => {\r\n                label.addEventListener('click', (e) => {\r\n                    e.preventDefault();\r\n                    const input = label.querySelector('input');\r\n                    if (!input) return;\r\n\r\n                    const parentGroup = label.closest('.custom-advance-btn-group, .custom-advance-btn-group-radio');\r\n                    if (!parentGroup) return;\r\n\r\n                    if (input.type === \"radio\") {\r\n                        if (input.checked) {\r\n                            input.checked = false;\r\n                            label.classList.remove('active');\r\n                        } else {\r\n                            parentGroup.querySelectorAll('.custom-advance-btn-radio').forEach(lbl => {\r\n                                lbl.classList.remove('active');\r\n                                const inp = lbl.querySelector('input');\r\n                                if (inp) inp.checked = false;\r\n                            });\r\n                            input.checked = true;\r\n                            label.classList.add('active');\r\n                        }\r\n                    } else if (input.type === \"checkbox\") {\r\n                        input.checked = !input.checked;\r\n                        label.classList.toggle('active', input.checked);\r\n                    }\r\n                });\r\n            });\r\n        }\r\n\r\n        const labels = document.querySelectorAll('.custom-advance-btn');\r\n        if (labels.length) {\r\n            labels.forEach(label => {\r\n                if (label.closest('.custom-advance-btn-user-type')) return;\r\n                if (label.closest('.single-choice')) return;\r\n                if (label.closest('.market-advence')) return;\r\n                if (label.closest('.added-to-site-group')) return;\r\n\r\n                label.addEventListener('click', () => {\r\n                    const input = label.querySelector('input');\r\n                    if (!input) return;\r\n\r\n                    input.checked = !input.checked;\r\n                    label.classList.toggle('active', input.checked);\r\n                });\r\n            });\r\n        }\r\n\r\n        const toggleButtons = document.querySelectorAll('.toggleButton');\r\n        const toggleContents = document.querySelectorAll('.toggleContent');\r\n        const arrows = document.querySelectorAll('.toggle-arrow');\r\n        if (toggleButtons.length && toggleContents.length && arrows.length) {\r\n            toggleButtons.forEach((button, index) => {\r\n                button.addEventListener('click', function () {\r\n                    if (toggleContents[index]) toggleContents[index].classList.toggle('open');\r\n                    if (arrows[index + 1]) arrows[index + 1].classList.toggle('open');\r\n                });\r\n            });\r\n        }\r\n\r\n        const toggleButton = document.querySelector('.show-advance-filter');\r\n        const filterBox = document.querySelector('.custom-advance-filter-option-box');\r\n        if (toggleButton && filterBox) {\r\n            toggleButton.addEventListener('click', function () {\r\n                filterBox.style.display = (filterBox.style.display === 'flex') ? 'none' : 'flex';\r\n            });\r\n        }\r\n\r\n        const marketLabels = document.querySelectorAll(\".market-advence .custom-advance-btn\");\r\n        if (marketLabels.length) {\r\n            marketLabels.forEach(label => {\r\n                const input = label.querySelector(\"input\");\r\n                if (!input) return;\r\n\r\n                label.addEventListener(\"click\", (e) => {\r\n                    e.preventDefault();\r\n                    if (input.checked) {\r\n                        input.checked = false;\r\n                        label.classList.remove(\"active\");\r\n                    } else {\r\n                        marketLabels.forEach(lbl => {\r\n                            lbl.classList.remove(\"active\");\r\n                            const inp = lbl.querySelector(\"input\");\r\n                            if (inp) inp.checked = false;\r\n                        });\r\n                        input.checked = true;\r\n                        label.classList.add(\"active\");\r\n                    }\r\n                });\r\n            });\r\n        }\r\n\r\n        \/\/ Unit switcher\r\n        function checkUnitPreference() {\r\n            let unitElements = document.querySelectorAll('.unit-text');\r\n            let savedUnit = localStorage.getItem('unitPreference');\r\n            const switchy = document.querySelector('.switchyUnit');\r\n            if (!switchy) return;\r\n\r\n            if (savedUnit === 'imperial') {\r\n                unitElements.forEach(el => el.innerHTML = \"ft&sup2;\");\r\n                switchy.checked = true;\r\n            } else {\r\n                unitElements.forEach(el => el.innerHTML = \"m&sup2;\");\r\n                switchy.checked = false;\r\n            }\r\n        }\r\n        checkUnitPreference();\r\n\r\n        const switchy = document.querySelector('.switchyUnit');\r\n        if (switchy) {\r\n            switchy.addEventListener('change', function() {\r\n                const containers = document.querySelectorAll('.input-container');\r\n                containers.forEach(container => {\r\n                    let unitElements = container.querySelectorAll('.unit-text');\r\n                    if (!unitElements.length) return;\r\n\r\n                    let inputs = container.querySelectorAll('.custom-input');\r\n\r\n                    if (switchy.checked) {\r\n                        inputs.forEach(input => {\r\n                            const value = parseInt(input.value, 10);\r\n                            if (!isNaN(value)) {\r\n                                localStorage.setItem(input.name, value);\r\n                                const convertedRawValue = value * 10.7639;\r\n                                input.value = Math.round(convertedRawValue);\r\n                            }\r\n                        });\r\n                        unitElements.forEach(el => el.innerHTML = \"ft&sup2;\");\r\n                        localStorage.setItem('unitPreference', 'imperial');\r\n                    } else {\r\n                        inputs.forEach(input => {\r\n                            const oldValue = parseInt(localStorage.getItem(input.name), 10);\r\n                            if (!isNaN(oldValue)) {\r\n                                input.value = oldValue;\r\n                            }\r\n                        });\r\n                        unitElements.forEach(el => el.innerHTML = \"m&sup2;\");\r\n                        localStorage.setItem('unitPreference', 'metric');\r\n                    }\r\n                });\r\n            });\r\n        }\r\n\r\n        const urlParams = new URLSearchParams(window.location.search);\r\n        const districtInput = document.querySelector('.district-input');\r\n        if (districtInput) {\r\n            if (!urlParams.has('city') || !urlParams.has('country')) {\r\n                districtInput.disabled = true;\r\n                districtInput.placeholder = window.t('first_select_country_city');\r\n            }\r\n        }\r\n\r\n        const addedGroup = document.querySelector('.added-to-site-group');\r\n        if (addedGroup) {\r\n            const checkboxes = addedGroup.querySelectorAll('input[type=\"checkbox\"]');\r\n            checkboxes.forEach(cb => {\r\n                const label = cb.closest('label');\r\n                if (label?.classList.contains('active')) cb.checked = true;\r\n            });\r\n\r\n            addedGroup.addEventListener('click', (e) => {\r\n                const label = e.target.closest('label');\r\n                if (!label) return;\r\n                const cb = label.querySelector('input[type=\"checkbox\"]');\r\n                if (!cb) return;\r\n\r\n                e.preventDefault();\r\n                const isChecked = cb.checked;\r\n\r\n                checkboxes.forEach(other => {\r\n                    other.checked = false;\r\n                    other.closest('label')?.classList.remove('active');\r\n                });\r\n\r\n                if (!isChecked) {\r\n                    cb.checked = true;\r\n                    label.classList.add('active');\r\n                }\r\n            });\r\n        }\r\n\r\n        document.querySelectorAll(\".input-container\").forEach(container => {\r\n            const selects = container.querySelectorAll(\".range-select\");\r\n            if (selects.length !== 2) return;\r\n\r\n            const [minSelect, maxSelect] = selects;\r\n\r\n            minSelect.addEventListener(\"change\", () => {\r\n                const minVal = parseInt(minSelect.value);\r\n                Array.from(maxSelect.options).forEach(option => {\r\n                    if (!option.value) return;\r\n                    const val = parseInt(option.value);\r\n                    option.disabled = val <= minVal;\r\n                });\r\n                if (maxSelect.value && parseInt(maxSelect.value) <= minVal) {\r\n                    maxSelect.value = \"\";\r\n                }\r\n            });\r\n\r\n            maxSelect.addEventListener(\"change\", () => {\r\n                const maxVal = parseInt(maxSelect.value);\r\n                Array.from(minSelect.options).forEach(option => {\r\n                    if (!option.value) return;\r\n                    const val = parseInt(option.value);\r\n                    option.disabled = val >= maxVal;\r\n                });\r\n                if (minSelect.value && parseInt(minSelect.value) >= maxVal) {\r\n                    minSelect.value = \"\";\r\n                }\r\n            });\r\n        });\r\n\r\n        document.querySelectorAll('.input-container').forEach(container => {\r\n            const inputs = container.querySelectorAll('input[type=\"number\"]');\r\n            if (inputs.length !== 2) return;\r\n\r\n            const [minInput, maxInput] = inputs;\r\n\r\n            function validateRange() {\r\n                let minVal = parseFloat(minInput.value) || 0;\r\n                let maxVal = parseFloat(maxInput.value) || 0;\r\n                if (maxVal && maxVal < minVal) {\r\n                    maxInput.value = minVal;\r\n                }\r\n            }\r\n            minInput.addEventListener('blur', validateRange);\r\n            maxInput.addEventListener('blur', validateRange);\r\n        });\r\n\r\n        \/\/ \"Advertiser Type\"\r\n        const advGroup = document.querySelector('.custom-advance-btn-group.custom-advance-btn-user-type');\r\n        if (advGroup) {\r\n            const cbs = advGroup.querySelectorAll('input[type=\"checkbox\"][name=\"advertiserType\"]');\r\n            function syncAll() {\r\n                cbs.forEach(cb => {\r\n                    const lbl = cb.closest('label.custom-advance-btn');\r\n                    if (lbl) lbl.classList.toggle('active', cb.checked);\r\n                });\r\n            }\r\n            function handleMutualExclusion(clickedCb) {\r\n                if (!clickedCb) return;\r\n                const isAll = clickedCb.value === 'All advertisers';\r\n                if (isAll && clickedCb.checked) {\r\n                    cbs.forEach(cb => {\r\n                        if (cb !== clickedCb) {\r\n                            cb.checked = false;\r\n                            cb.closest('label.custom-advance-btn')?.classList.remove('active');\r\n                        }\r\n                    });\r\n                } else if (!isAll && clickedCb.checked) {\r\n                    const allCb = advGroup.querySelector('input[type=\"checkbox\"][name=\"advertiserType\"][value=\"All advertisers\"]');\r\n                    if (allCb) {\r\n                        allCb.checked = false;\r\n                        allCb.closest('label.custom-advance-btn')?.classList.remove('active');\r\n                    }\r\n                }\r\n                syncAll();\r\n            }\r\n            advGroup.addEventListener('click', function(e) {\r\n                const lbl = e.target.closest('label.custom-advance-btn');\r\n                if (!lbl || !advGroup.contains(lbl)) return;\r\n                e.preventDefault();\r\n                e.stopPropagation();\r\n                const cb = lbl.querySelector('input[type=\"checkbox\"][name=\"advertiserType\"]');\r\n                if (!cb) return;\r\n                cb.checked = !cb.checked;\r\n                handleMutualExclusion(cb);\r\n            });\r\n            cbs.forEach(cb => {\r\n                cb.addEventListener('change', function() {\r\n                    handleMutualExclusion(cb);\r\n                });\r\n            });\r\n            syncAll();\r\n        }\r\n\r\n        \/\/ Services\r\n        const params = new URLSearchParams(window.location.search);\r\n        const typeNames = params.getAll(\"type_name\");\r\n        if (typeNames.length > 0) {\r\n            document.querySelectorAll('.services-inputs input[name=\"type_name\"]').forEach(checkbox => {\r\n                if (typeNames.includes(checkbox.value)) {\r\n                    checkbox.checked = true;\r\n                    checkbox.dispatchEvent(new Event(\"change\", { bubbles: true }));\r\n                }\r\n            });\r\n        }\r\n\r\n\r\n        let citiesByCountrySelect = null;\r\n        async function loadCountriesSelectWithCities() {\r\n            try {\r\n                const response = await fetch('https:\/\/homezzy-api-hw74g.ondigitalocean.app\/countries-with-cities');\r\n                if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);\r\n                countriesWithCities = await response.json();\r\n                console.log('countriesWithCities:', countriesWithCities);\r\n            } catch (error) {\r\n                console.error(\"Error fetching countries with cities:\", error);\r\n            }\r\n        }\r\n\r\n        loadCountriesSelectWithCities().then(() => {\r\n            const countrySelects = document.querySelectorAll(\"#countrySelect\");\r\n            const citySelects = document.querySelectorAll(\"#citySelect\");\r\n\r\n            const urlParams = new URLSearchParams(window.location.search);\r\n            const urlCountry = urlParams.get(\"country\");\r\n            const urlCity = urlParams.get(\"city\");\r\n\r\n            countrySelects.forEach((countrySelect, index) => {\r\n                const citySelect = citySelects[index];\r\n\r\n                citySelect.disabled = true;\r\n\r\n                countrySelect.addEventListener(\"change\", function () {\r\n                    const country = this.value;\r\n                    citySelect.innerHTML = \"\";\r\n\r\n                    if (!countriesWithCities[country]) {\r\n                        citySelect.disabled = true;\r\n                        unlockDistrictIfReady(citySelect);\r\n                        return;\r\n                    }\r\n\r\n                    citySelect.disabled = false;\r\n\r\n                    const placeholder = document.createElement(\"option\");\r\n                    placeholder.textContent = window.t('choose_city');\r\n                    placeholder.disabled = true;\r\n                    placeholder.hidden = true;\r\n                    placeholder.selected = true;\r\n                    placeholder.value = \"\";\r\n                    citySelect.appendChild(placeholder);\r\n\r\n                    countriesWithCities[country].forEach(city => {\r\n                        const opt = document.createElement(\"option\");\r\n                        opt.value = city;\r\n                        opt.textContent = city;\r\n                        citySelect.appendChild(opt);\r\n                    });\r\n\r\n                    unlockDistrictIfReady(citySelect);\r\n                });\r\n\r\n                citySelect.addEventListener(\"change\", () => unlockDistrictIfReady(citySelect));\r\n\r\n                if (urlCountry && [...countrySelect.options].some(opt => opt.value === urlCountry)) {\r\n                    countrySelect.value = urlCountry;\r\n                    countrySelect.dispatchEvent(new Event(\"change\"));\r\n\r\n                    if (urlCity) {\r\n                        setTimeout(() => {\r\n                            if ([...citySelect.options].some(opt => opt.value === urlCity)) {\r\n                                citySelect.value = urlCity;\r\n                                citySelect.dispatchEvent(new Event(\"change\"));\r\n                            }\r\n                            unlockDistrictIfReady(citySelect);\r\n                        }, 50);\r\n                    }\r\n                }\r\n            });\r\n\r\n            function unlockDistrictIfReady(citySelect) {\r\n                const container = citySelect.closest(\".custom-advance-filter-option-box-filter-price\");\r\n                const districtInput = container ? container.querySelector(\".district-input\") : null;\r\n                const countrySelect = container ? container.querySelector(\"#countrySelect\") : null;\r\n\r\n                if (!districtInput || !countrySelect) return;\r\n\r\n                if (countrySelect.value && citySelect.value) {\r\n                    districtInput.disabled = false;\r\n                    districtInput.placeholder = window.t('district');\r\n                } else {\r\n                    districtInput.disabled = true;\r\n                    districtInput.placeholder = window.t('first_select_country_city');\r\n                }\r\n            }\r\n        });\r\n    });\r\n\r\n    \/\/ Mobile Filter\r\n\r\n    document.addEventListener(\"DOMContentLoaded\", function () {\r\n        const showAdvancedBtn = document.querySelector(\".show-advance-filter\");\r\n        const overlay = document.querySelector(\".mobile-advance-filters-overlay\");\r\n        const closeBtn = document.querySelector(\".mobile-advance-filters-close\");\r\n        const content = document.querySelector(\".mobile-advance-filters-content\");\r\n        const searchBtns = document.querySelectorAll(\"#search-form-btn\");\r\n\r\n        if (!showAdvancedBtn || !overlay || !closeBtn || !content) return;\r\n\r\n        showAdvancedBtn.addEventListener(\"click\", function () {\r\n            overlay.style.display = \"block\";\r\n            document.body.style.overflow = \"hidden\";\r\n            document.body.style.height = \"100vh\";\r\n\r\n            overlay.scrollIntoView({ behavior: 'smooth', block: 'start' });\r\n\r\n            content.scrollTop = 0;\r\n        });\r\n\r\n        function closeOverlay() {\r\n            overlay.style.display = \"none\";\r\n            document.body.style.overflow = \"\";\r\n            document.body.style.height = \"\";\r\n        }\r\n\r\n        closeBtn.addEventListener(\"click\", closeOverlay);\r\n\r\n        searchBtns.forEach(searchBtn => {\r\n            searchBtn.addEventListener(\"click\", function () {\r\n                closeOverlay();\r\n            });\r\n        });\r\n\r\n        overlay.addEventListener(\"click\", function (e) {\r\n            if (!content.contains(e.target)) {\r\n                closeOverlay();\r\n            }\r\n        });\r\n    });\r\n<\/script>\r\n\r\n<\/br>\r\n<div class=\"banners-advertising-small-desktop\">\r\n    <a href=\"https:\/\/www.concept-ave.com\/\"><img decoding=\"async\" src=\"https:\/\/homezzy.com\/wp-content\/uploads\/2025\/11\/banner_01.jpg\" class=\"\"><\/a>\r\n    <a href=\"https:\/\/cspropertygroup.co.uk\/\"><img decoding=\"async\" src=\"https:\/\/homezzy.com\/wp-content\/uploads\/2025\/11\/Banner_02.jpg\" class=\"\"><\/a>\r\n    <a href=\"\"><img decoding=\"async\" src=\"https:\/\/homezzy.com\/wp-content\/uploads\/2025\/11\/Banner_03.jpg\" class=\"\"><\/a>\r\n    <a href=\"https:\/\/www.cloudybites.com\/\"><img decoding=\"async\" src=\"https:\/\/homezzy.com\/wp-content\/uploads\/2025\/11\/banner_04.jpg\" class=\"\"><\/a>\r\n    <a href=\"https:\/\/homezzy.com\/ro\/\"><img decoding=\"async\" src=\"https:\/\/homezzy.com\/wp-content\/uploads\/2025\/11\/banner_05-1.jpg\" class=\"\"><\/a>\r\n<\/div>\t\t<div class=\"elementor-shortcode\"><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-47eb08be e-con-full e-flex e-con e-child\" data-id=\"47eb08be\" data-element_type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-74716b25 elementor-widget elementor-widget-shortcode\" data-id=\"74716b25\" data-element_type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<div class=\"ads-lists\" id=\"ads-lists\">\r\n        <div onclick=\"window.location.href='https:\/\/homezzy.com\/ro\/?agency=\/cs-apartments-10812412'\" onmousedown=\"handleMouseDown(event, https:\/\/homezzy.com\/ro\/?agency=\/cs-apartments-10812412'\" class=\"single-add-container\" data-first-name=\"CS Apartments\" data-no-translation=\"\">\r\n            <div class=\"single-add-container-photo\">\r\n                <span class=\"single-add-container-photo-type\" data-no-translation>United Kingdom<\/span>\r\n                <a href=\"https:\/\/homezzy.com\/ro\/?agency=\/cs-apartments-10812412\">\r\n                    <div class=\"container-img\">\r\n                        <img decoding=\"async\" src=\"https:\/\/homezzy.com\/wp-content\/uploads\/2026\/02\/Screenshot-2026-02-09-at-21.02.39.png\" alt=\"Agency avatar\" class=\"img-bg\"\/>\r\n                        <img decoding=\"async\" src=\"https:\/\/homezzy.com\/wp-content\/uploads\/2026\/02\/Screenshot-2026-02-09-at-21.02.39.png\" alt=\"Agency avatar\" class=\"img-main\"\/>\r\n                    <\/div>\r\n                <\/a>\r\n            <\/div>\r\n            <div class=\"single-add-container-info\">\r\n                <div class=\"single-add-container-info-main\">\r\n                    <div class=\"single-add-container-info-top\">\r\n                        <p class=\"single-add-container-info-location single-add-container-info-location-agency\" data-no-translation>City of Westminster, <\/p>\r\n                        <p class=\"single-add-container-info-price\" data-no-translation>CS Apartments<\/p>\r\n                    <\/div>\r\n\r\n                <\/div>\r\n                <span class=\"single-add-container-info-description\" data-no-translation>Estate Agency providing long term and short term rental in Central London.<\/span>\r\n            <\/div>\r\n            <div class=\"single-add-container-additional\">\r\n                <div class=\"single-add-container-info-additional\">\r\n                    <div class=\"single-add-container-info-additional-list\">\r\n                    <p><img decoding=\"async\" src=\"https:\/\/cdn-icons-png.freepik.com\/512\/942\/942140.png\"> 2<\/p>\r\n                    <p><img decoding=\"async\" src=\"https:\/\/cdn-icons-png.freepik.com\/512\/7373\/7373824.png\"> 0<\/p>\r\n                    <\/div>\r\n                <\/div>\r\n            <\/div>\r\n        <\/div>\r\n\r\n        \r\n        <div onclick=\"window.location.href='https:\/\/homezzy.com\/ro\/?agency=\/southina-6762589888'\" onmousedown=\"handleMouseDown(event, https:\/\/homezzy.com\/ro\/?agency=\/southina-6762589888'\" class=\"single-add-container\" data-first-name=\"Southina\" data-no-translation=\"\">\r\n            <div class=\"single-add-container-photo\">\r\n                <span class=\"single-add-container-photo-type\" data-no-translation>Montenegro<\/span>\r\n                <a href=\"https:\/\/homezzy.com\/ro\/?agency=\/southina-6762589888\">\r\n                    <div class=\"container-img\">\r\n                        <img decoding=\"async\" src=\"https:\/\/homezzy.com\/wp-content\/uploads\/2026\/02\/Soutina2.jpg\" alt=\"Agency avatar\" class=\"img-bg\"\/>\r\n                        <img decoding=\"async\" src=\"https:\/\/homezzy.com\/wp-content\/uploads\/2026\/02\/Soutina2.jpg\" alt=\"Agency avatar\" class=\"img-main\"\/>\r\n                    <\/div>\r\n                <\/a>\r\n            <\/div>\r\n            <div class=\"single-add-container-info\">\r\n                <div class=\"single-add-container-info-main\">\r\n                    <div class=\"single-add-container-info-top\">\r\n                        <p class=\"single-add-container-info-location single-add-container-info-location-agency\" data-no-translation>Tivat, <\/p>\r\n                        <p class=\"single-add-container-info-price\" data-no-translation>Southina<\/p>\r\n                    <\/div>\r\n\r\n                <\/div>\r\n                <span class=\"single-add-container-info-description\" data-no-translation><\/span>\r\n            <\/div>\r\n            <div class=\"single-add-container-additional\">\r\n                <div class=\"single-add-container-info-additional\">\r\n                    <div class=\"single-add-container-info-additional-list\">\r\n                    <p><img decoding=\"async\" src=\"https:\/\/cdn-icons-png.freepik.com\/512\/942\/942140.png\"> 16<\/p>\r\n                    <p><img decoding=\"async\" src=\"https:\/\/cdn-icons-png.freepik.com\/512\/7373\/7373824.png\"> 2<\/p>\r\n                    <\/div>\r\n                <\/div>\r\n            <\/div>\r\n        <\/div>\r\n\r\n        <\/div><div class=\"pagination\" id=\"pagination\"><\/div>\r\n\r\n<script>\r\n    window.MAP_API_KEY = \"pk.d32b42da475aa85fe322274fc8aa8922\";\r\n<\/script>\r\n\r\n<script src=\"https:\/\/homezzy.com\/wp-content\/plugins\/homezzy-plugin\/assets\/js\/display-normal-listings.js\"><\/script>\r\n\r\n<script>\r\n\r\n    document.getElementById('sort-select').addEventListener('change', function () {\r\n        const sortType = this.value;\r\n        const container = document.getElementById('ads-lists');\r\n        const items = Array.from(container.getElementsByClassName('single-add-container'));\r\n\r\n        items.sort((a, b) => {\r\n            const nameA = a.dataset.firstName.toLowerCase();\r\n            const nameB = b.dataset.firstName.toLowerCase();\r\n\r\n            if (sortType === 'a-z') {\r\n                return nameA.localeCompare(nameB);\r\n            } else {\r\n                return nameB.localeCompare(nameA);\r\n            }\r\n        });\r\n\r\n        \/\/ Prze\u0142aduj posortowane elementy\r\n        container.innerHTML = '';\r\n        items.forEach(item => container.appendChild(item));\r\n    });\r\n\r\n    document.addEventListener('DOMContentLoaded', function () {\r\n        const params = new URLSearchParams(window.location.search);\r\n        const data = {};\r\n        params.forEach((value, key) => {\r\n            data[key] = value;\r\n        });\r\n\r\n        if (data['country']) {\r\n            const container = document.getElementById('ads-lists');\r\n            const items = Array.from(container.getElementsByClassName('single-add-container'));\r\n\r\n            let filteredItems = items.filter(item => {\r\n                return item.querySelector('.single-add-container-photo-type').textContent.trim().toLowerCase() === data['country'].toLowerCase();\r\n            });\r\n\r\n            if (data['city']) {\r\n                filteredItems = filteredItems.filter(item => {\r\n                    return item.querySelector('.single-add-container-info-location').textContent.split(',')[0].trim().toLowerCase().replace(\/,\/g, '') === data['city'].toLowerCase();\r\n                });\r\n            }\r\n\r\n            \/\/ Prze\u0142aduj posortowane elementy\r\n            container.innerHTML = '';\r\n            filteredItems.forEach(item => container.appendChild(item));\r\n        }\r\n    });\r\n<\/script>\r\n\r\n<div class=\"banners-advertising-big\">\r\n    <a href=\"https:\/\/homezzy.com\/ro\/\"><img decoding=\"async\" src=\"https:\/\/homezzy.com\/wp-content\/uploads\/2025\/11\/banner_long-1.jpg\" class=\"\"><\/a>\r\n<\/div>\r\n<\/br>\r\n<div class=\"banners-advertising-small-mobile\">\r\n    <a href=\"https:\/\/www.concept-ave.com\/\"><img decoding=\"async\" src=\"https:\/\/homezzy.com\/wp-content\/uploads\/2025\/11\/banner_01.jpg\" class=\"\"><\/a>\r\n    <a href=\"https:\/\/cspropertygroup.co.uk\/\"><img decoding=\"async\" src=\"https:\/\/homezzy.com\/wp-content\/uploads\/2025\/11\/Banner_02.jpg\" class=\"\"><\/a>\r\n    <a href=\"\"><img decoding=\"async\" src=\"https:\/\/homezzy.com\/wp-content\/uploads\/2025\/11\/Banner_03.jpg\" class=\"\"><\/a>\r\n    <a href=\"https:\/\/www.cloudybites.com\/\"><img decoding=\"async\" src=\"https:\/\/homezzy.com\/wp-content\/uploads\/2025\/11\/banner_04.jpg\" class=\"\"><\/a>\r\n    <a href=\"https:\/\/homezzy.com\/ro\/\"><img decoding=\"async\" src=\"https:\/\/homezzy.com\/wp-content\/uploads\/2025\/11\/banner_05-1.jpg\" class=\"\"><\/a>\r\n<\/div>\t\t<div class=\"elementor-shortcode\"><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-4a6b756b e-flex e-con-boxed e-con e-parent\" data-id=\"4a6b756b\" data-element_type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"om_disable_all_campaigns":false,"pmpro_default_level":"","inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"class_list":["post-1634","page","type-page","status-publish","hentry","pmpro-has-access"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/homezzy.com\/ro\/wp-json\/wp\/v2\/pages\/1634","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/homezzy.com\/ro\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/homezzy.com\/ro\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/homezzy.com\/ro\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/homezzy.com\/ro\/wp-json\/wp\/v2\/comments?post=1634"}],"version-history":[{"count":4,"href":"https:\/\/homezzy.com\/ro\/wp-json\/wp\/v2\/pages\/1634\/revisions"}],"predecessor-version":[{"id":4071,"href":"https:\/\/homezzy.com\/ro\/wp-json\/wp\/v2\/pages\/1634\/revisions\/4071"}],"wp:attachment":[{"href":"https:\/\/homezzy.com\/ro\/wp-json\/wp\/v2\/media?parent=1634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}