(function(){
const q = document.getElementById('q');
const sort = document.getElementById('sort');
const results = document.getElementById('results');
const cards = Array.from(results.querySelectorAll('.p-card'));
const resultCount = document.getElementById('resultCount');
const emptyState = document.getElementById('emptyState');
const activeFilters = document.getElementById('activeFilters');
const clearAll = document.getElementById('clearAll');
const toggleActivities = document.getElementById('toggleActivities');
const extraActivities = Array.from(document.querySelectorAll('.extra-activity'));
let activitiesOpen = false;
function selectedValues(name){
return Array.from(document.querySelectorAll('input[name="'+name+'"]:checked')).map(x => x.value);
}
function normalize(s){ return (s||'').toLowerCase().trim(); }
function updateCounts(){
const circuitCounts = {north:0,south:0,west:0,coast:0,lake:0};
const typeCounts = {
"national-park":0,"conservation-area":0,"marine-park":0,"game-reserve":0,
"nature-reserve":0,"island":0,"cultural-site":0,"mountain":0
};
const actCounts = {migration:0,bigcats:0,elephants:0,chimp:0,boat:0,walking:0,birds:0,beach:0};
cards.forEach(c => {
const circuit = (c.dataset.circuit||'');
const type = (c.dataset.type||'');
const acts = (c.dataset.activity||'').split(/\s+/).filter(Boolean);
if(circuitCounts[circuit] !== undefined) circuitCounts[circuit]++;
if(typeCounts[type] !== undefined) typeCounts[type]++;
acts.forEach(a => { if(actCounts[a] !== undefined) actCounts[a]++; });
});
Object.keys(circuitCounts).forEach(k=>{
const el = document.querySelector('.count[data-count="'+k+'"]');
if(el) el.textContent = circuitCounts[k];
});
Object.keys(typeCounts).forEach(k=>{
const el = document.querySelector('.count[data-count="'+k+'"]');
if(el) el.textContent = typeCounts[k];
});
Object.keys(actCounts).forEach(k=>{
const el = document.querySelector('.count[data-count="'+k+'"]');
if(el) el.textContent = actCounts[k];
});
}
function sortCards(visibleCards){
const mode = sort.value;
if(mode === 'az'){
visibleCards.sort((a,b)=> (a.dataset.name||'').localeCompare(b.dataset.name||''));
} else if(mode === 'circuit'){
const order = {north:1,south:2,west:3,coast:4,lake:5};
visibleCards.sort((a,b)=> (order[a.dataset.circuit]||99) - (order[b.dataset.circuit]||99) || (a.dataset.name||'').localeCompare(b.dataset.name||''));
} else if(mode === 'type'){
const order = {
"national-park":1,"conservation-area":2,"game-reserve":3,"marine-park":4,
"nature-reserve":5,"island":6,"cultural-site":7,"mountain":8
};
visibleCards.sort((a,b)=> (order[a.dataset.type]||99) - (order[b.dataset.type]||99) || (a.dataset.name||'').localeCompare(b.dataset.name||''));
} else {
visibleCards.sort((a,b)=> (parseInt(b.dataset.pop||'0',10) - parseInt(a.dataset.pop||'0',10)) || (a.dataset.name||'').localeCompare(b.dataset.name||''));
}
return visibleCards;
}
function apply(){
const text = normalize(q.value);
const circuits = selectedValues('circuit');
const types = selectedValues('type');
const activities = selectedValues('activity');
const active = circuits.length + types.length + activities.length + (text ? 1 : 0);
activeFilters.textContent = active + (active === 1 ? ' filter active' : ' filters active');
let visible = cards.filter(c => {
const hay = normalize(c.innerText);
const cCircuit = c.dataset.circuit || '';
const cType = c.dataset.type || '';
const cActs = (c.dataset.activity || '').split(/\s+/).filter(Boolean);
const okText = !text || hay.includes(text);
const okCircuit = circuits.length === 0 || circuits.includes(cCircuit);
const okType = types.length === 0 || types.includes(cType);
const okAct = activities.length === 0 || activities.every(a => cActs.includes(a));
return okText && okCircuit && okType && okAct;
});
visible = sortCards(visible);
cards.forEach(c => c.style.display = 'none');
visible.forEach(c => { c.style.display = ''; results.insertBefore(c, emptyState); });
resultCount.textContent = visible.length;
emptyState.style.display = visible.length ? 'none' : '';
}
function clearGroup(group){
document.querySelectorAll('input[name="'+group+'"]').forEach(i => i.checked = false);
apply();
}
q.addEventListener('input', apply);
sort.addEventListener('change', apply);
document.querySelectorAll('input[type="checkbox"]').forEach(cb => cb.addEventListener('change', apply));
document.querySelectorAll('[data-clear]').forEach(btn=>{
btn.addEventListener('click', ()=> clearGroup(btn.dataset.clear));
});
clearAll.addEventListener('click', ()=>{
q.value = '';
document.querySelectorAll('input[type="checkbox"]').forEach(i => i.checked = false);
sort.value = 'popular';
apply();
});
toggleActivities.addEventListener('click', ()=>{
activitiesOpen = !activitiesOpen;
extraActivities.forEach(x => x.style.display = activitiesOpen ? '' : 'none');
toggleActivities.textContent = activitiesOpen ? 'Show Less' : 'Show More';
});
updateCounts();
apply();
})();
const lazyloadRunObserver = () => {
const lazyloadBackgrounds = document.querySelectorAll( `.e-con.e-parent:not(.e-lazyloaded)` );
const lazyloadBackgroundObserver = new IntersectionObserver( ( entries ) => {
entries.forEach( ( entry ) => {
if ( entry.isIntersecting ) {
let lazyloadBackground = entry.target;
if( lazyloadBackground ) {
lazyloadBackground.classList.add( 'e-lazyloaded' );
}
lazyloadBackgroundObserver.unobserve( entry.target );
}
});
}, { rootMargin: '200px 0px 200px 0px' } );
lazyloadBackgrounds.forEach( ( lazyloadBackground ) => {
lazyloadBackgroundObserver.observe( lazyloadBackground );
} );
};
const events = [
'DOMContentLoaded',
'elementor/lazyload/observe',
];
events.forEach( ( event ) => {
document.addEventListener( event, lazyloadRunObserver );
} );
https://ottosafariguide.com/wp-content/plugins/business-reviews-wp/assets/js/app.min.js
https://ottosafariguide.com/wp-content/plugins/elementskit-lite/widgets/init/assets/js/widget-scripts.js
https://ottosafariguide.com/wp-content/plugins/wp-travel-engine/assets/lib/owl-carousel-2.3.4/owl.carousel.js
https://ottosafariguide.com/wp-content/plugins/wp-travel-engine/assets/lib/dropzone/dropzone.min.js
https://ottosafariguide.com/wp-content/plugins/wte-elementor-widgets/dist/js/wte-offcanvas.js
https://ottosafariguide.com/wp-content/plugins/wte-elementor-widgets/dist/js/wpte-animation.js
https://ottosafariguide.com/wp-content/plugins/wp-travel-engine/assets/lib/flatpickr-4.6.9/fpickr.js
https://ottosafariguide.com/wp-content/plugins/wp-travel-engine/assets/lib/flatpickr-4.6.9/l10n/en.js
https://ottosafariguide.com/wp-includes/js/dist/hooks.min.js
https://ottosafariguide.com/wp-includes/js/dist/i18n.min.js
wp.i18n.setLocaleData( { 'text direction\u0004ltr': [ 'ltr' ] } );
//# sourceURL=wp-i18n-js-after
;(function(){
var wte = window[wte] || {};
if(! window.wte){
window.wte = {"personFormat":"\/person","bookNow":"Book Now","totaltxt":"Total:","currency":{"code":"USD","symbol":"$"},"payments":[],"single_showtabs":false,"pax_labels":[],"booking_cutoff":{"enable":false,"cutoff":0,"unit":"days"}};
}
})();
;(function(){
var wte_account_page = window[wte_account_page] || {};
if(! window.wte_account_page){
window.wte_account_page = {"ajax_url":"https:\/\/ottosafariguide.com\/wp-admin\/admin-ajax.php","change_user_profile_msg":"Click here or Drop new image to update your profile picture"};
}
})();
;(function(){
var rtl = window[rtl] || {};
if(! window.rtl){
window.rtl = [];
}
})();
;(function(){
var wtePreFetch = window[wtePreFetch] || {};
if(! window.wtePreFetch){
window.wtePreFetch = {"tripID":8926,"wpapi":{"root":"https:\/\/ottosafariguide.com\/wp-json\/","nonce":"e97335d405","versionString":"wp\/v2\/"},"iframe_url":""};
}
})();
;(function(){
var WTEAjaxData = window[WTEAjaxData] || {};
if(! window.WTEAjaxData){
window.WTEAjaxData = {"ajaxurl":"https:\/\/ottosafariguide.com\/wp-admin\/admin-ajax.php","nonce":"e97335d405"};
}
})();
;(function(){
var wteL10n = window[wteL10n] || {};
if(! window.wteL10n){
window.wteL10n = {"version":"6.8.1","baseCurrency":"USD","baseCurrencySymbol":"$","currency":"USD","currencySymbol":"$","home_url":"https:\/\/ottosafariguide.com","_nonces":{"addtocart":"bee3f23c32","downloadSystemInfo":"f7e6783827"},"wpapi":{"root":"https:\/\/ottosafariguide.com\/wp-json\/","nonce":"e97335d405","versionString":"wp\/v2\/"},"wpxhr":{"root":"https:\/\/ottosafariguide.com\/wp-admin\/admin-ajax.php","nonce":"486b33d9d8"},"format":{"number":{"decimal":"default","decimalSeparator":".","thousandSeparator":","},"price":"%CURRENCY_SYMBOL%%FORMATED_AMOUNT%","date":"F j, Y","time":"g:i a","datetime":{"date":"F j, Y","time":"g:i a","GMTOffset":"+00:00","timezone":""},"enableRound":false},"extensions":[],"locale":"en_US","l10n":{"invalidCartTraveler":"No. of Travellers' should be at least %s","availableSeatsExceed":"The number of pax can not exceed more than %s","invalidCartExtraReq":"%s selection is essential. Please specify a number.","invalidCartExtra":"Extra Services marked with * is essential. Please specify a number.","extraServicesTitle":"","checkout.submitButtonText":"Book Now","checkout.bookingSummary":"Booking Summary","checkout.totalPayable":"Total Payable Now"},"layout":{"showFeaturedTripsOnTop":true,"showoptionfilter":true},"rtl":false};
}
})();
//# sourceURL=wp-travel-engine-js-before
https://ottosafariguide.com/wp-content/plugins/wp-travel-engine/dist/public/wte-public.js
https://ottosafariguide.com/wp-content/plugins/wp-travel-engine/dist/public/trip-search/widgets-dropdown.js
https://ottosafariguide.com/wp-content/plugins/wp-travel-engine/dist/public/trip-search/widgets-slider.js
https://ottosafariguide.com/wp-content/plugins/contact-form-7/includes/swv/js/index.js
var wpcf7 = {
"api": {
"root": "https:\/\/ottosafariguide.com\/wp-json\/",
"namespace": "contact-form-7\/v1"
},
"cached": 1
};
//# sourceURL=contact-form-7-js-before
https://ottosafariguide.com/wp-content/plugins/contact-form-7/includes/js/index.js
https://ottosafariguide.com/wp-content/plugins/travel-booking-toolkit/public/js/travel-booking-toolkit-public.min.js
https://ottosafariguide.com/wp-content/plugins/travel-booking-toolkit/public/js/fontawesome/all.min.js
https://ottosafariguide.com/wp-content/plugins/travel-booking-toolkit/public/js/fontawesome/v4-shims.min.js
window.nfdPerformance = window.nfdPerformance || {};
window.nfdPerformance.imageOptimization = window.nfdPerformance.imageOptimization || {};
window.nfdPerformance.imageOptimization.lazyLoading = {"classes":["nfd-performance-not-lazy","a3-notlazy","disable-lazyload","no-lazy","no-lazyload","skip-lazy"],"attributes":["data-lazy-src","data-crazy-lazy=\"exclude\"","data-no-lazy","data-no-lazy=\"1\""]};
//# sourceURL=nfd-performance-lazy-loader-js-before
https://ottosafariguide.com/wp-content/plugins/mojo-marketplace-wp-plugin//vendor/newfold-labs/wp-module-performance/build/image-lazy-loader.min.js
var travel_monster_custom = {"url":"https://ottosafariguide.com/wp-admin/admin-ajax.php","rtl":"","sticky_widget":"1","ed_sticky_header":""};
//# sourceURL=travel-monster-custom-js-extra
https://ottosafariguide.com/wp-content/themes/travel-monster/js/custom.min.js
https://ottosafariguide.com/wp-content/plugins/elementor/assets/js/webpack.runtime.min.js
https://ottosafariguide.com/wp-content/plugins/elementor/assets/js/frontend-modules.min.js
https://ottosafariguide.com/wp-includes/js/jquery/ui/core.min.js
var elementorFrontendConfig = {"environmentMode":{"edit":false,"wpPreview":false,"isScriptDebug":false},"i18n":{"shareOnFacebook":"Share on Facebook","shareOnTwitter":"Share on Twitter","pinIt":"Pin it","download":"Download","downloadImage":"Download image","fullscreen":"Fullscreen","zoom":"Zoom","share":"Share","playVideo":"Play Video","previous":"Previous","next":"Next","close":"Close","a11yCarouselPrevSlideMessage":"Previous slide","a11yCarouselNextSlideMessage":"Next slide","a11yCarouselFirstSlideMessage":"This is the first slide","a11yCarouselLastSlideMessage":"This is the last slide","a11yCarouselPaginationBulletMessage":"Go to slide"},"is_rtl":false,"breakpoints":{"xs":0,"sm":480,"md":768,"lg":1025,"xl":1440,"xxl":1600},"responsive":{"breakpoints":{"mobile":{"label":"Mobile Portrait","value":767,"default_value":767,"direction":"max","is_enabled":true},"mobile_extra":{"label":"Mobile Landscape","value":880,"default_value":880,"direction":"max","is_enabled":false},"tablet":{"label":"Tablet Portrait","value":1024,"default_value":1024,"direction":"max","is_enabled":true},"tablet_extra":{"label":"Tablet Landscape","value":1200,"default_value":1200,"direction":"max","is_enabled":false},"laptop":{"label":"Laptop","value":1366,"default_value":1366,"direction":"max","is_enabled":true},"widescreen":{"label":"Widescreen","value":2400,"default_value":2400,"direction":"min","is_enabled":false}},"hasCustomBreakpoints":true},"version":"4.1.4","is_static":false,"experimentalFeatures":{"e_font_icon_svg":true,"additional_custom_breakpoints":true,"container":true,"e_panel_promotions":true,"landing-pages":true,"nested-elements":true,"global_classes_should_enforce_capabilities":true,"e_variables":true,"e_opt_in_v4_page":true,"e_components":true,"e_interactions":true,"e_widget_creation":true,"import-export-customization":true},"urls":{"assets":"https:\/\/ottosafariguide.com\/wp-content\/plugins\/elementor\/assets\/","ajaxurl":"https:\/\/ottosafariguide.com\/wp-admin\/admin-ajax.php","uploadUrl":"https:\/\/ottosafariguide.com\/wp-content\/uploads"},"nonces":{"floatingButtonsClickTracking":"742c6ff3a3","atomicFormsSendForm":"0bb5846563"},"swiperClass":"swiper","settings":{"page":[],"editorPreferences":[]},"kit":{"active_breakpoints":["viewport_mobile","viewport_tablet","viewport_laptop"],"lightbox_enable_counter":"yes","lightbox_enable_fullscreen":"yes","lightbox_enable_zoom":"yes","lightbox_enable_share":"yes","lightbox_title_src":"title","lightbox_description_src":"description"},"post":{"id":8926,"title":"Tanzania%20National%20Parks%20%7C%20Top%20Safari%20Destinations%202025","excerpt":"","featuredImage":"https:\/\/ottosafariguide.com\/wp-content\/uploads\/2025\/07\/tanzania-national-parks-1024x682.jpeg"}};
//# sourceURL=elementor-frontend-js-before
https://ottosafariguide.com/wp-content/plugins/elementor/assets/js/frontend.min.js