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AAE,mCAChBA,IAAE,6CAA6Ca,OAC/C6D,EAAYrD,OACa,KAAtBqD,EAAYf,OACb3D,IAAE0E,EAAYE,QAAQvD,OAEtBrB,IAAE0E,EAAYG,OAAOA,QAAQxD,OAG5BqD,EAAYf,QAAU3D,IAAE,6CAA6CiB,OACtEjB,IAAE0E,EAAYG,QAAQxD,OAEtBrB,IAAE0E,EAAYE,OAAOA,QAAQvD,OAIjCqD,EAAc1E,IAAE,mCAChB,IAAI8E,EAAgB9E,IAAE0E,GAAaf,OAC/BV,EAAgBjD,IAAE,wBAAwB0D,MAC1CR,EAAmBlD,IAAE,2BAA2B0D,MAEhC,GAAjBoB,EACD9E,IAAE,gCAAgC2E,IAAI,UAAW,MAEjD3E,IAAE,gCAAgC2E,IAAI,UAAW,KACjD3E,IAAE,yCAAyCY,SAAS,qBAGnDkE,GAAiB9E,IAAE,6CAA6CiB,OACjEjB,IAAE,gCAAgC2E,IAAI,UAAW,KAEjD3E,IAAE,gCAAgC2E,IAAI,UAAW,KAGnDpE,EAAoBuE,EAAe7B,EAAeC,EAAkB5C,EAErE,GACF,G,WClcDyE,EAAOC,QAAUC,M","sources":["webpack://mgstarter/./page-templates/page-resources.js","webpack://mgstarter/external var \"jQuery\""],"sourcesContent":["import $ from 'jquery'\n\n$(document).ready( initResources )\n\nfunction initResources(){\n \n let ajaxurl = SITE.ajaxUrl;\n let $search = '';\n\n function load_resource_posts(page, resource_cat, resource_format, search){\n $('#resource-posts-list').addClass('loading');\n $('.resources__sidebar').addClass('loading');\n $('#resource-pagination').hide();\n\n // Data to receive from our server\n // the value in 'action' is the key that will be identified by the 'wp_ajax_' hook\n let data = {\n page: page,\n resource_cat: resource_cat,\n resource_format: resource_format,\n search: search,\n action: \"get_resource_posts_ajax\"\n };\n // Send the data\n $.post(ajaxurl, data, function(response) {\n // If successful Append the data into our html container\n if (response.length) {\n $(\"#resource-posts-list\").html(response);\n setTimeout(() => {\n $('#resource-posts-list').removeClass('loading');\n $('.resources__sidebar').removeClass('loading');\n $('#resource-pagination').show();\n }, \"700\");\n //launched video modal on resources cards if card link = vidyard\n $.ajax({\n type: \"GET\",\n url: \"https://play.vidyard.com/embed/v4.js\",\n dataType: \"script\",\n async: false\n });\n $('.post-item__link, .post-item__title a').each(function(e){\n let url = new URL($(this).attr('href'));\n if(url.hostname == 'play.vidyard.com'){\n let videoID = $(this).attr('href').split('/').pop().split('.')[0];\n let videoModal = '
';\n $(videoModal).appendTo('body');\n $(this).on('click', function(e){\n e.stopImmediatePropagation();\n e.preventDefault();\n let players = VidyardV4.api.getPlayersByUUID(videoID);\n let player = players[0];\n player.showLightbox();\n return false;\n });\n }\n });\n } else {\n $('#resource-pagination').hide();\n $(\"#resource-posts-list\").html('
\"binocolars\"

No results meet the filtered criteria, please reset filter.

');\n $('#resource-posts-list').removeClass('loading');\n $('.resources__sidebar').removeClass('loading');\n }\n });\n }\n\n function load_resource_pagination(resource_cat, resource_format, search){\n\n $('#resource-posts-list').addClass('loading');\n $('.resources__sidebar').addClass('loading');\n $('#resource-pagination').hide();\n\n // Data to receive from our server\n // the value in 'action' is the key that will be identified by the 'wp_ajax_' hook\n let data = {\n resource_cat: resource_cat,\n resource_format: resource_format,\n search: search,\n action: \"get_resource_posts_pagination\"\n };\n\n // Send the data\n $.post(ajaxurl, data, function(response) {\n // If successful Append the data into our html container\n $('#resource-pagination').html(response);\n setTimeout(() => {\n $('#resource-posts-list').removeClass('loading');\n $('.resources__sidebar').removeClass('loading');\n $('#resource-pagination').show(); \n }, \"700\");\n });\n }\n\n if ('URLSearchParams' in window) {\n let searchParams = new URLSearchParams(window.location.search);\n let $resource_cat = '';\n let $resource_format = '';\n if ( searchParams.has('topic') ) {\n $resource_cat = searchParams.get('topic');\n $('#resource-cat-buttons button').removeClass('active');\n $('#resource-cat-buttons button[data-cat=\"'+$resource_cat+'\"]').addClass('active');\n if ( $('#resource-cat-buttons button[data-cat=\"'+$resource_cat+'\"]').hasClass('has-children') ) {\n $('#resource-cat-buttons button[data-cat=\"' + $resource_cat + '\"]').siblings('ul').slideDown();\n }\n if ( $('#resource-cat-buttons button[data-cat=\"'+$resource_cat+'\"]').hasClass('js-resource-subfilter') ) {\n $('#resource-cat-buttons button[data-cat=\"' + $resource_cat + '\"]').parent().parent().slideDown();\n $('#resource-cat-buttons button[data-cat=\"'+$resource_cat+'\"]').parent().parent().siblings('.js-resource-filter').addClass('active');\n let $resource_cat_parent = $('#resource-cat-buttons button[data-cat=\"'+$resource_cat+'\"]').parent().parent().siblings('.js-resource-filter').attr('data-cat');\n $('#resource-cat-select').val($resource_cat_parent);\n $('.js-research-topic-label').text($('#resource-cat-buttons button[data-cat=\"'+$resource_cat_parent+'\"]').text());\n $('.js-research-subtopic-label').text(' - '+$('#resource-cat-buttons button[data-cat=\"'+$resource_cat+'\"]').text());\n } else {\n $('#resource-cat-select').val($resource_cat);\n $('.js-research-topic-label').text($('#resource-cat-buttons button[data-cat=\"'+$resource_cat+'\"]').text());\n }\n }\n if ( searchParams.has('format') ) {\n $resource_format = searchParams.get('format');\n $('#resource-format-buttons button').removeClass('active');\n $('#resource-format-buttons button[data-format=\"'+$resource_format+'\"]').addClass('active');\n $('#resource-format-select').val($resource_format);\n $('.js-research-format-label').text($('#resource-format-buttons button[data-format=\"'+$resource_format+'\"]').text());\n }\n load_resource_pagination($resource_cat, $resource_format, $search);\n load_resource_posts(1, $resource_cat, $resource_format, $search);\n } else {\n load_resource_pagination();\n load_resource_posts(1);\n }\n\n // Handle Search\n $('#resources-search-submit').on('click', function (e) {\n let $current_page = 1;\n let $resource_cat = $('#resource-cat-buttons').find('.active').attr('data-cat');;\n let $resource_format = $('#resource-format-buttons').find('.active').attr('data-format');\n $search = $('#resources-search').val();\n\n load_resource_pagination($resource_cat, $resource_format, $search);\n load_resource_posts($current_page, $resource_cat, $resource_format, $search);\n });\n\n $('#resources-search').on('keyup', function (e) {\n if (e.which == 13) {\n let $current_page = 1;\n let $resource_cat = $('#resource-cat-buttons').find('.active').attr('data-cat');;\n let $resource_format = $('#resource-format-buttons').find('.active').attr('data-format');\n $search = $('#resources-search').val();\n\n load_resource_pagination($resource_cat, $resource_format, $search);\n load_resource_posts($current_page, $resource_cat, $resource_format, $search);\n }\n });\n\n $('#resources-search').on('search', function (e) {\n if ( $search !=='' ) {\n let $current_page = 1;\n let $resource_cat = $('#resource-cat-buttons').find('.active').attr('data-cat');;\n let $resource_format = $('#resource-format-buttons').find('.active').attr('data-format');\n $search = $('#resources-search').val();\n\n load_resource_pagination($resource_cat, $resource_format, $search);\n load_resource_posts($current_page, $resource_cat, $resource_format, $search);\n }\n });\n\n // Handle the dropdown change\n $('#resource-cat-select').on('change',function(){\n let $current_page = 1;\n let $resource_cat = $(this).val();\n let $resource_format = $('#resource-format-select').val();\n $('#resource-cat-buttons .js-resource-filter').removeClass('active');\n $('#resource-cat-buttons .js-resource-filter[data-cat=\"'+$resource_cat+'\"]').addClass('active');\n $('#resource-cat-buttons ul').hide();\n $('.js-research-subtopic-label').text('');\n $('.js-resource-subfilter').removeClass('active');\n if ( $(this).find('option:selected').text() == 'View All' ) {\n $('.js-research-topic-label').text('All topics');\n } else {\n $('.js-research-topic-label').text($(this).find('option:selected').text());\n }\n if ('URLSearchParams' in window) {\n let searchParams = new URLSearchParams(window.location.search);\n searchParams.set('topic', $resource_cat);\n let newRelativePathQuery = window.location.pathname + '?' + searchParams.toString();\n history.pushState(null, '', newRelativePathQuery);\n }\n load_resource_pagination($resource_cat, $resource_format, $search);\n load_resource_posts($current_page, $resource_cat, $resource_format, $search);\n });\n\n $('#resource-format-select').on('change',function(){\n let $current_page = 1;\n let $resource_cat = $('#resource-cat-select').val();\n let $resource_format = $(this).val();\n $('#resource-format-buttons .js-resource-filter').removeClass('active');\n $('#resource-format-buttons .js-resource-filter[data-format=\"'+$resource_format+'\"]').addClass('active');\n if ( $(this).find('option:selected').text() == 'View All' ) {\n $('.js-research-format-label').text('All formats');\n } else {\n $('.js-research-format-label').text($(this).find('option:selected').text());\n }\n if ('URLSearchParams' in window) {\n let searchParams = new URLSearchParams(window.location.search);\n searchParams.set('format', $resource_format);\n let newRelativePathQuery = window.location.pathname + '?' + searchParams.toString();\n history.pushState(null, '', newRelativePathQuery);\n }\n\n load_resource_pagination($resource_cat, $resource_format, $search);\n load_resource_posts($current_page, $resource_cat, $resource_format, $search);\n });\n\n // Handle the filter button clicks\n $('#resource-cat-buttons .js-resource-filter').on('click',function(){\n if ( !$(this).hasClass('active') ) {\n $('#resource-cat-buttons ul').slideUp();\n }\n $('#resource-cat-buttons .js-resource-filter').removeClass('active');\n $(this).addClass('active');\n $(this).siblings('ul').slideDown();\n let $current_page = 1;\n let $resource_cat = $(this).attr('data-cat');\n let $resource_format = $('#resource-format-buttons').find('.active').attr('data-format');\n $('.js-research-subtopic-label').text('');\n $('.js-resource-subfilter').removeClass('active');\n $('#resource-cat-select').val($resource_cat);\n if ( $(this).text() == 'View All' ) {\n $('.js-research-topic-label').text('All topics');\n } else {\n $('.js-research-topic-label').text($(this).text());\n }\n if ('URLSearchParams' in window) {\n let searchParams = new URLSearchParams(window.location.search);\n searchParams.set('topic', $resource_cat);\n let newRelativePathQuery = window.location.pathname + '?' + searchParams.toString();\n history.pushState(null, '', newRelativePathQuery);\n }\n\n load_resource_pagination($resource_cat, $resource_format, $search);\n load_resource_posts($current_page, $resource_cat, $resource_format, $search);\n });\n\n $('#resource-cat-buttons .js-resource-subfilter').on('click',function(){\n $(this).parent().siblings().find('.js-resource-subfilter').removeClass('active');\n $(this).addClass('active');\n let $current_page = 1;\n let $resource_cat = $(this).attr('data-cat');\n let $resource_format = $('#resource-format-buttons').find('.active').attr('data-format');\n //$resource_cat_parent = $(this).parent().parent().siblings().find('js-resource-filter').attr('data-cat');\n //$('#resource-cat-select').val($resource_cat_parent);\n $('.js-research-subtopic-label').text(' - '+$(this).text());\n if ('URLSearchParams' in window) {\n let searchParams = new URLSearchParams(window.location.search);\n searchParams.set('topic', $resource_cat);\n let newRelativePathQuery = window.location.pathname + '?' + searchParams.toString();\n history.pushState(null, '', newRelativePathQuery);\n }\n\n load_resource_pagination($resource_cat, $resource_format, $search);\n load_resource_posts($current_page, $resource_cat, $resource_format, $search);\n });\n\n $('#resource-format-buttons .js-resource-filter').on('click',function(){\n $('#resource-format-buttons .js-resource-filter').removeClass('active');\n $(this).addClass('active');\n let $current_page = 1;\n let $resource_format = $(this).attr('data-format');\n let $resource_cat;\n if ( $('.js-resource-subfilter.active').length ) {\n $resource_cat = $('#resource-cat-buttons ul').find('.active').attr('data-cat');\n } else {\n $resource_cat = $('#resource-cat-buttons').find('.active').attr('data-cat');\n }\n $('#resource-format-select').val($resource_format);\n if ( $(this).text() == 'View All' ) {\n $('.js-research-format-label').text('All formats');\n } else {\n $('.js-research-format-label').text($(this).text());\n }\n if ('URLSearchParams' in window) {\n let searchParams = new URLSearchParams(window.location.search);\n searchParams.set('format', $resource_format);\n let newRelativePathQuery = window.location.pathname + '?' + searchParams.toString();\n history.pushState(null, '', newRelativePathQuery);\n }\n\n load_resource_pagination($resource_cat, $resource_format, $search);\n load_resource_posts($current_page, $resource_cat, $resource_format, $search);\n });\n\n // Handle cat link click\n $( \".resources__wrap\" ).on('click', '.js-resource-category-opt', function(e){\n e.preventDefault();\n $('#resource-pagination').hide();\n let $current_page = 1;\n let $resource_cat = $(this).data('cat');\n let $resource_format = $('#resource-format-select').val();\n $('#resource-cat-select').val($resource_cat);\n $('#resource-cat-buttons .js-resource-filter').removeClass('active');\n $('#resource-cat-buttons .js-resource-filter[data-cat=\"'+$resource_cat+'\"]').addClass('active');\n $('.js-research-topic-label').text($(this).text());\n $('.js-research-subtopic-label').text('');\n $('#resource-cat-buttons ul').slideUp();\n $('#resource-cat-buttons .active.js-resource-filter[data-cat=\"'+$resource_cat+'\"]').siblings('ul').slideDown();\n $('.js-resource-subfilter').removeClass('active');\n if ('URLSearchParams' in window) {\n let searchParams = new URLSearchParams(window.location.search);\n searchParams.set('topic', $resource_cat);\n let newRelativePathQuery = window.location.pathname + '?' + searchParams.toString();\n history.pushState(null, '', newRelativePathQuery);\n }\n\n load_resource_pagination($resource_cat, $resource_format, $search);\n load_resource_posts($current_page, $resource_cat, $resource_format, $search);\n });\n\n // Reset Cat/Format Button\n $( \".resources__sidebar\" ).on('click', '.js-resource-reset', function(){\n $('#resource-pagination').hide();\n let $current_page = 1;\n let $resource_cat = '';\n $('#resource-cat-select').val($resource_cat);\n let $resource_format = '';\n $('#resource-format-select').val($resource_format);\n $search = '';\n $('#resources-search').val($search);\n $('#resource-format-buttons .js-resource-filter').removeClass('active');\n $('#resource-cat-buttons .js-resource-filter').removeClass('active');\n $('#resource-format-buttons .js-resource-filter:first').addClass('active');\n $('#resource-cat-buttons .js-resource-filter:first').addClass('active');\n $('.js-research-topic-label').text('All topics');\n $('.js-research-subtopic-label').text('');\n $('.js-research-format-label').text('All formats');\n $('#resource-cat-buttons ul').slideUp();\n $('.js-resource-subfilter').removeClass('active');\n if ('URLSearchParams' in window) {\n let searchParams = new URLSearchParams(window.location.search);\n searchParams.delete('format');\n searchParams.delete('topic');\n let newRelativePathQuery = window.location.pathname;\n history.pushState(null, '', newRelativePathQuery);\n }\n\n load_resource_pagination($resource_cat, $resource_format, $search);\n load_resource_posts($current_page, $resource_cat, $resource_format, $search);\n });\n\n // Handle the pagination clicks\n $('#resource-pagination').on('click', 'li', function(e){\n\n $('html, body').animate({\n scrollTop: $(\"#resource-posts-list\").offset().top - 200\n }, 500);\n\n let $current_li = $('#resource-pagination li.current');\n\n if($(this).hasClass('prev') || $(this).hasClass('next')) {\n\n if($(this).css('opacity') == 0) {\n return false;\n }\n\n if($(this).hasClass('prev')) {\n\n $current_li.removeClass('current');\n $current_li.prev().addClass('current');\n $current_li = $('#resource-pagination li.current');\n\n\n $('#resource-pagination li:not(.prev, .next)').hide();\n $('#resource-pagination li.prev, #resource-pagination li.next').show();\n\n if($current_li.text() == '1') {\n $('.resources__pagination .prev').css('opacity', '0');\n } else {\n $('.resources__pagination .prev').css('opacity', '1');\n }\n\n $($current_li).show();\n if($current_li.text() != '1') {\n $($current_li.prev()).show();\n } else {\n $($current_li.next().next()).show();\n }\n $($current_li.next()).show();\n\n } else if($(this).hasClass('next')) {\n\n $current_li.removeClass('current');\n $current_li.next().addClass('current');\n $current_li = $('#resource-pagination li.current');\n $('#resource-pagination li:not(.prev, .next)').hide();\n $('#resource-pagination li.prev, #resource-pagination li.next').show();\n\n if($current_li.text() == $('#resource-pagination li:not(.prev, .next)').length) {\n $('.resources__pagination .next').css('opacity', '0');\n } else {\n $('.resources__pagination .next').css('opacity', '1');\n }\n\n $($current_li).show();\n $($current_li.prev()).show();\n if($current_li.text() != $('#resource-pagination li:not(.prev, .next)').length) {\n $($current_li.next()).show();\n } else {\n $($current_li.prev().prev()).show();\n }\n\n $($current_li.prev()).show();\n }\n\n } else {\n $('#resource-pagination li').removeClass('current');\n $(this).addClass('current');\n $current_li = $('#resource-pagination li.current');\n $('#resource-pagination li:not(.prev, .next)').hide();\n $current_li.show();\n if($current_li.text() != '1') {\n $($current_li.prev()).show();\n } else {\n $($current_li.next().next()).show();\n }\n\n if($current_li.text() != $('#resource-pagination li:not(.prev, .next)').length) {\n $($current_li.next()).show();\n } else {\n $($current_li.prev().prev()).show();\n }\n }\n\n $current_li = $('#resource-pagination li.current');\n let $current_page = $($current_li).text();\n let $resource_cat = $('#resource-cat-select').val();\n let $resource_format = $('#resource-format-select').val();\n\n if($current_page == 1) {\n $('#resource-pagination li.prev').css('opacity', '0');\n } else {\n $('#resource-pagination li.prev').css('opacity', '1');\n $('.archive-resources .featured-resource').addClass('is-category-page');\n }\n\n if($current_page == $('#resource-pagination li:not(.prev, .next)').length) {\n $('#resource-pagination li.next').css('opacity', '0');\n } else {\n $('#resource-pagination li.next').css('opacity', '1');\n }\n\n load_resource_posts($current_page, $resource_cat, $resource_format, $search);\n\n });\n}\n","module.exports = jQuery;"],"names":["$","document","ready","ajaxurl","SITE","ajaxUrl","$search","load_resource_posts","page","resource_cat","resource_format","search","addClass","hide","data","action","response","length","html","setTimeout","removeClass","show","type","url","dataType","async","each","e","URL","this","attr","hostname","videoID","split","pop","videoModal","appendTo","on","stopImmediatePropagation","preventDefault","VidyardV4","api","getPlayersByUUID","showLightbox","load_resource_pagination","window","searchParams","URLSearchParams","location","$resource_cat","$resource_format","has","get","hasClass","siblings","slideDown","parent","$resource_cat_parent","val","text","find","which","set","newRelativePathQuery","pathname","toString","history","pushState","slideUp","delete","animate","scrollTop","offset","top","$current_li","css","prev","next","$current_page","module","exports","jQuery"],"sourceRoot":""}