{"version":3,"file":"rpmblocks.min.js","sources":["../blocks/accordion/accordion.js","../blocks/background-end/background-end.js","../blocks/billings/billings.js","../blocks/background-start/background-start.js","../blocks/buttons/buttons.js","../blocks/calendar/calendar.js","../blocks/call-to-action/call-to-action.js","../../../../../node_modules/@splidejs/splide/dist/js/splide.esm.js","../blocks/carousel/carousel.js","../blocks/callout/callout.js","../blocks/content-block/content-block.js","../blocks/firstfans/firstfans.js","../blocks/heading/heading.js","../blocks/group/group.js","../blocks/image/image.js","../blocks/listed-posts/listed-posts.js","../blocks/partners/partners.js","../blocks/poster/poster.js","../blocks/simple-content/simple-content.js","../blocks/video/video.js"],"sourcesContent":["export const RPMAccordion = (function () {\n\t'use strict';\n\n\tlet $accordion;\n\n\tfunction init() {\n\t\tevents();\n\t\tsetAccordionButton();\n\t}\n\n\tfunction events() {\n\t\tArray.prototype.slice.call(document.querySelectorAll('.accordion')).forEach(function (accordion) {\n\t\t\t// Allow for multiple accordion sections to be expanded at the same time\n\t\t\tvar allowMultiple = accordion.hasAttribute('data-allow-multiple');\n\t\t\t// Allow for each toggle to both open and close individually\n\t\t\tvar allowToggle = allowMultiple ? allowMultiple : accordion.hasAttribute('data-allow-toggle');\n\t\t\t// Create the array of toggle elements for the accordion group\n\t\t\tvar triggers = Array.prototype.slice.call(accordion.querySelectorAll('.accordion__trigger'));\n\t\t\tvar panels = Array.prototype.slice.call(accordion.querySelectorAll('.accordion__panel'));\n\n\t\t\taccordion.addEventListener('click', function (event) {\n\t\t\t\tvar target = event.target;\n\n\t\t\t\tif (target.classList.contains('accordion__trigger')) {\n\t\t\t\t\t// Check if the current toggle is expanded.\n\t\t\t\t\tvar isExpanded = target.getAttribute('aria-expanded') == 'true';\n\t\t\t\t\tvar active = accordion.querySelector('[aria-expanded=\"true\"]');\n\n\t\t\t\t\t// without allowMultiple, close the open accordion\n\t\t\t\t\tif (!allowMultiple && active && active !== target) {\n\t\t\t\t\t\t// Set the expanded state on the triggering element\n\t\t\t\t\t\tactive.setAttribute('aria-expanded', 'false');\n\t\t\t\t\t\t// Hide the accordion sections, using aria-controls to specify the desired section\n\t\t\t\t\t\tdocument.getElementById(active.getAttribute('aria-controls')).setAttribute('hidden', '');\n\n\t\t\t\t\t\t// When toggling is not allowed, clean up disabled state\n\t\t\t\t\t\tif (!allowToggle) {\n\t\t\t\t\t\t\tactive.removeAttribute('aria-disabled');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!isExpanded) {\n\t\t\t\t\t\t// Set the expanded state on the triggering element\n\t\t\t\t\t\ttarget.setAttribute('aria-expanded', 'true');\n\t\t\t\t\t\t// Hide the accordion sections, using aria-controls to specify the desired section\n\t\t\t\t\t\tdocument.getElementById(target.getAttribute('aria-controls')).removeAttribute('hidden');\n\n\t\t\t\t\t\t// If toggling is not allowed, set disabled state on trigger\n\t\t\t\t\t\tif (!allowToggle) {\n\t\t\t\t\t\t\ttarget.setAttribute('aria-disabled', 'true');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (allowToggle && isExpanded) {\n\t\t\t\t\t\t// Set the expanded state on the triggering element\n\t\t\t\t\t\ttarget.setAttribute('aria-expanded', 'false');\n\t\t\t\t\t\t// Hide the accordion sections, using aria-controls to specify the desired section\n\t\t\t\t\t\tdocument.getElementById(target.getAttribute('aria-controls')).setAttribute('hidden', '');\n\t\t\t\t\t}\n\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Bind keyboard behaviors on the main accordion container\n\t\t\taccordion.addEventListener('keydown', function (event) {\n\t\t\t\tvar target = event.target;\n\t\t\t\tvar key = event.which.toString();\n\n\t\t\t\tvar isExpanded = target.getAttribute('aria-expanded') == 'true';\n\t\t\t\tvar allowToggle = allowMultiple ? allowMultiple : accordion.hasAttribute('data-allow-toggle');\n\n\t\t\t\t// 33 = Page Up, 34 = Page Down\n\t\t\t\tvar ctrlModifier = event.ctrlKey && key.match(/33|34/);\n\n\t\t\t\t// Is this coming from an accordion header?\n\t\t\t\tif (target.classList.contains('accordion__trigger')) {\n\t\t\t\t\t// Up/ Down arrow and Control + Page Up/ Page Down keyboard operations\n\t\t\t\t\t// 38 = Up, 40 = Down\n\t\t\t\t\tif (key.match(/38|40/) || ctrlModifier) {\n\t\t\t\t\t\tvar index = triggers.indexOf(target);\n\t\t\t\t\t\tvar direction = key.match(/34|40/) ? 1 : -1;\n\t\t\t\t\t\tvar length = triggers.length;\n\t\t\t\t\t\tvar newIndex = (index + length + direction) % length;\n\n\t\t\t\t\t\ttriggers[newIndex].focus();\n\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t} else if (key.match(/35|36/)) {\n\t\t\t\t\t\t// 35 = End, 36 = Home keyboard operations\n\t\t\t\t\t\tswitch (key) {\n\t\t\t\t\t\t\t// Go to first accordion\n\t\t\t\t\t\t\tcase '36':\n\t\t\t\t\t\t\t\ttriggers[0].focus();\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t// Go to last accordion\n\t\t\t\t\t\t\tcase '35':\n\t\t\t\t\t\t\t\ttriggers[triggers.length - 1].focus();\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// These are used to style the accordion when one of the buttons has focus\n\t\t\taccordion.querySelectorAll('.accordion__trigger').forEach(function (trigger) {\n\t\t\t\ttrigger.addEventListener('focus', function (event) {\n\t\t\t\t\taccordion.classList.add('focus');\n\t\t\t\t});\n\t\t\t\ttrigger.addEventListener('blur', function (event) {\n\t\t\t\t\taccordion.classList.remove('focus');\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// Minor setup: will set disabled state, via aria-disabled, to an\n\t\t\t// expanded/ active accordion which is not allowed to be toggled close\n\t\t\tif (!allowToggle) {\n\t\t\t\t// Get the first expanded/ active accordion\n\t\t\t\tvar expanded = accordion.querySelector('[aria-expanded=\"true\"]');\n\t\t\t\t// If an expanded/ active accordion is found, disable\n\t\t\t\tif (expanded) {\n\t\t\t\t\texpanded.setAttribute('aria-disabled', 'true');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction setAccordionButton() {\n\t\t// open an item if it's in the URL hash\n\t\t$('.accordion').each(function () {\n\t\t\tlet $trigger = $(this).find('.accordion__trigger');\n\n\t\t\t// Check if there is a hashtag in the URL\n\t\t\tconst hash = window.location.hash.substr(1) + '_trigger';\n\t\t\tif (hash) {\n\t\t\t\t// Find the accordion__trigger with matching ID and open it\n\t\t\t\tconst $matchingTrigger = $trigger.filter(`[id=\"${hash}\"]`);\n\t\t\t\tif ($matchingTrigger.length > 0) {\n\t\t\t\t\t$matchingTrigger.attr('aria-expanded', 'true');\n\t\t\t\t\tdocument.getElementById($matchingTrigger.attr('aria-controls')).removeAttribute('hidden');\n\t\t\t\t}\n\t\t\t}\n\n\t\t});\n\n\t\t$('a[href*=\"#\"]').on('click', function (e) {\n\t\t\tconst hash = this.hash.substr(1) + '_trigger';\n\t\t\tconst $matchingTrigger = $('.accordion__trigger[id=\"' + hash + '\"]');\n\t\t\tif ($matchingTrigger.length > 0) {\n\t\t\t\t$matchingTrigger.attr('aria-expanded', 'true');\n\t\t\t\tdocument.getElementById($matchingTrigger.attr('aria-controls')).removeAttribute('hidden');\n\t\t\t}\n\t\t});\n\t}\n\n\treturn {\n\t\tinit: init,\n\t};\n})();\n","export const RPMBackgroundEnd = (function() {\n\t'use strict';\n\n\tfunction init() {\n\t\tevents();\n\t}\n\n\tfunction events() {}\n\n\treturn {\n\t\tinit: init\n\t};\n})();\n","export const RPMBilling = (function() {\n\t'use strict';\n\n\tlet $group;\n\n\tfunction init() {\n\t\t$group = $('.modal--billings');\n\t\tif($group.length > 0) {\n\t\t\tevents();\n\t\t}\n\t}\n\n\tfunction events() {\n\n\t\t$group.each(function(idx){\n\t\t\tlet $this = $(this);\n\t\t\tlet $prev = $group[idx-1] ? '#' + $($group[idx-1]).attr('id') : '';\n\t\t\tlet $next = $group[idx+1] ? '#' + $($group[idx+1]).attr('id') : '';\n\n\t\t\t$.ajax({\n\t\t\t\tmethod: 'GET',\n\t\t\t\turl: RPMConstants.themeDir + '/assets/svg/arrow.svg',\n\t\t\t\tdataType: 'html',\n\t\t\t}).done(function (result) {\n\t\t\t\t$('.arrow').html(result);\n\t\t\t}).fail(function (error) {\n\t\t\t\tconsole.log(error);\n\t\t\t});\n\n\t\t\t$this.append(`\n\t\t\t\t
\n\t\t\t`);\n\t\t});\n\t}\n\n\treturn {\n\t\tinit: init\n\t};\n\n})();\n","export const RPMBackgroundStart = (function() {\n\t'use strict';\n\n\tfunction init() {\n\t\tevents();\n\t}\n\n\tfunction events() {}\n\n\treturn {\n\t\tinit: init\n\t};\n})();\n","export const RPMButtons = (function() {\n\t'use strict';\n\n\tfunction init() {\n\t\tevents();\n\t}\n\n\tfunction events() {}\n\n\treturn {\n\t\tinit: init\n\t};\n})();\n","export const RPMCalendar = (function () {\n\t'use strict';\n\n\tlet weeklyCalendar, calendar, performanceName, $windowWidth, breakpoint, daysOfTheWeek;\n\n\tfunction init() {\n\t\tweeklyCalendar = document.querySelector('#weekly-calendar');\n\t\tcalendar = document.querySelector('#cal');\n\t\tperformanceName = 'How-To-Dance-In-Ohio';\n\t\t$windowWidth = $(window).width();\n\t\tbreakpoint = 768;\n\n\t\tdaysOfTheWeek = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n\n\t\tif (weeklyCalendar && weeklyCalendar.dataset.events) {\n\t\t\tweekly();\n\t\t}\n\t\tif (calendar && calendar.dataset.events) {\n\t\t\tmonthly();\n\t\t}\n\n\t\t// If mobile on init\n\t\tif ($windowWidth < breakpoint) {\n\t\t\trenderToggle();\n\t\t}\n\t\t// on window resize, rerender action\n\t\t$(window).resize(function () {\n\t\t\t$windowWidth = $(window).width();\n\t\t\trenderToggle();\n\t\t});\n\t}\n\n\tfunction renderToggle() {\n\t\tif ($windowWidth > breakpoint) {\n\t\t\treturn;\n\t\t}\n\t\t// console.log('in it');\n\t\tlet $container = $('.rpmblock--calendar__container');\n\t\tlet $buttons = $container.find('.rpmblock--calendar__monthly-button');\n\n\t\t$buttons.each(function () {\n\t\t\t$(this).on('click', function () {\n\t\t\t\t// Apply active class and remove active class from siblings\n\t\t\t\t$(this).addClass('active').siblings().removeClass('active');\n\n\t\t\t\t// Finds the ID to what needs to show.\n\t\t\t\tlet button_id = $(this).attr('aria-controls');\n\n\t\t\t\t// Finds ID based off the button and updates active classes\n\t\t\t\t$container.find('.toggle-cal').removeClass('active').fadeOut();\n\t\t\t\t$container\n\t\t\t\t\t.find('.toggle-cal--' + button_id)\n\t\t\t\t\t.addClass('active')\n\t\t\t\t\t.fadeIn();\n\t\t\t\t$container.find('.rpmblock--calendar__monthly-info span').text(button_id);\n\t\t\t});\n\t\t});\n\t}\n\n\tfunction weekly() {\n\t\tvar COMMONUTILS = {\n\t\t\tpageWidth: function () {\n\t\t\t\t'use strict';\n\t\t\t\treturn document.documentElement.clientWidth;\n\t\t\t},\n\t\t\tuserLocation: function () {\n\t\t\t\t'use strict';\n\t\t\t\tSCHEDULE.initWeekly('#weekly-calendar');\n\t\t\t\tSCHEDULE.Fetch(weeklyCalendar.dataset.events, function () {\n\t\t\t\t\tSCHEDULE.Weekly('#weekly-calendar');\n\t\t\t\t});\n\t\t\t},\n\t\t};\n\n\t\tvar SCHEDULE = {\n\t\t\tTimes: null,\n\t\t\tAvail: null,\n\t\t\tSchedule: null,\n\n\t\t\tgetData: function (schedule, targetdiv, href) {\n\t\t\t\t$.getJSON(\n\t\t\t\t\tschedule,\n\t\t\t\t\t{\n\t\t\t\t\t\tformat: 'json',\n\t\t\t\t\t},\n\t\t\t\t\tfunction (data) {\n\t\t\t\t\t\tvar dd = new Date();\n\t\t\t\t\t\tvar dn = dd.getMonth();\n\t\t\t\t\t\tdn++; // because months are 0 indexed\n\n\t\t\t\t\t\tfor (di = 0; di <= data.schedule_info.length; di++) {\n\t\t\t\t\t\t\t// changed < to <= to compare fill length\n\t\t\t\t\t\t\tcurrentMonth = Number(data.schedule_info[0].dateID);\n\t\t\t\t\t\t\tif (currentMonth < dn) {\n\t\t\t\t\t\t\t\tdata.schedule_info.shift();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$('.cal-right').click(function (e) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tvar months = $('.month').length - 1;\n\t\t\t\t\t\t\tvar next = $('.month:visible').index();\n\n\t\t\t\t\t\t\tif ($('.cal-left').hasClass('inactive')) {\n\t\t\t\t\t\t\t\t$('.cal-left').removeClass('inactive');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ($('.month:visible').index() < months) {\n\t\t\t\t\t\t\t\t$('.month:visible').hide();\n\t\t\t\t\t\t\t\t$('.month').eq(next).fadeIn('slow');\n\t\t\t\t\t\t\t} else if ($('.month:visible').index() == months) {\n\t\t\t\t\t\t\t\t$(this).addClass('inactive');\n\t\t\t\t\t\t\t\t$('.month:visible').hide();\n\t\t\t\t\t\t\t\t$('.month').eq(next).fadeIn('slow');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t$('.cal-left').click(function (e) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tvar months = 1;\n\t\t\t\t\t\t\tvar next = $('.month:visible').index() - 2;\n\t\t\t\t\t\t\tif ($('.cal-right').hasClass('inactive')) {\n\t\t\t\t\t\t\t\t$('.cal-right').removeClass('inactive');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ($('.month:visible').index() > months) {\n\t\t\t\t\t\t\t\t$('.month:visible').hide();\n\t\t\t\t\t\t\t\t$('.month').eq(next).fadeIn('slow');\n\t\t\t\t\t\t\t} else if ($('.month:visible').index() == months) {\n\t\t\t\t\t\t\t\t$(this).addClass('inactive');\n\t\t\t\t\t\t\t\t$('.month:visible').hide();\n\t\t\t\t\t\t\t\t$('.month').eq(next).fadeIn('slow');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t},\n\n\t\t\t// Get JSON file, call appropriate parsing function after\n\t\t\tFetch: function (source, callback) {\n\t\t\t\tif (typeof source === 'string') {\n\t\t\t\t\tlet data = JSON.parse(source);\n\t\t\t\t\tSCHEDULE.Times = data.schedule_info;\n\t\t\t\t\tcallback();\n\t\t\t\t} else {\n\t\t\t\t\t$.getJSON(source, function (data) {\n\t\t\t\t\t\t// console.log('here', data);\n\t\t\t\t\t\t// Format dates if Ticketmaster calendar\n\t\t\t\t\t\tSCHEDULE.Times = data.schedule_info;\n\t\t\t\t\t\t// console.log('schedule times set');\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t// Populates Schedule Menu\n\t\t\tPopulateWeekly: function (container, eventslist) {\n\t\t\t\t// console.log('here', eventslist);\n\n\t\t\t\t//Append ticket links to corresponding date div\n\t\t\t\tfor (var i = 0; i < eventslist.length; i++) {\n\t\t\t\t\t//var eventDate = \".\" + eventslist[i].start.slice(-5);\n\t\t\t\t\tlet eventDate = '.' + eventslist[i].start;\n\t\t\t\t\tlet eventTime = eventslist[i].title;\n\t\t\t\t\tlet isBest = eventslist[i].best ? 'event-time--best' : '';\n\t\t\t\t\tlet isFreePerformance = eventslist[i].freeperformance ? 'event-time--free-performance' : '';\n\t\t\t\t\tlet eventInfo;\n\n\t\t\t\t\teventTime = eventTime.replace(':00', \":00\");\n\n\t\t\t\t\t// console.log(eventslist[i]);\n\t\t\t\t\t// var eventInfo = \"\" + eventTime + \"\";\n\t\t\t\t\tif (eventslist[i].featured) {\n\t\t\t\t\t\teventInfo = \"\n\t\t\t\t\t\t\t\t\t${n}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t${n}
\n\t\t\t\t\t\t\t\t\t\t\t${d > 9 ? d : '0' + d}
\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t${renderDateNumber(dayNumber)}\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t${dayNumber < 10 ? '0' + dayNumber : dayNumber}\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t${renderDateNumber(dayNumber)}\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t${dayNumber < 10 ? '0' + dayNumber : dayNumber}\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t' +\n\t\t\t\t\t\t\t\t\t// (schedule_info[i].dateID < 10\n\t\t\t\t\t\t\t\t\t// \t? '0' + schedule_info[i].dateID\n\t\t\t\t\t\t\t\t\t// \t: schedule_info[i].dateID) +\n\t\t\t\t\t\t\t\t\t// '/' +\n\t\t\t\t\t\t\t\t\t(dayNumber < 10 ? '0' + dayNumber : dayNumber) +\n\t\t\t\t\t\t\t\t\t'
Click on a performance time in the calendar to get tickets.
\n\t\t\t\t\t\t\t\t\tBest Availability
${renderDateNumber(f)}
\n\t\t\t\t\t \n\t\t\t\t${renderDateNumber(t)}
\n\t\t\t\t \n\t\t\t