/* Form submission functions for the Mailchimp Widget */ (function ($) { function mc_beforeForm() { // Disable the submit button $('.mc_signup_submit_button').attr('disabled', 'disabled'); } function mc_success(data, status, xhr, submittedForm) { let form = $(submittedForm); if (!submittedForm || !form) { form = $('.mc_signup_form'); } // Re-enable the submit button $('.mc_signup_submit_button').removeAttr('disabled'); // Put the response in the message div form.find('.mc_message_wrapper').html(data); // See if we're successful, if so, wipe the fields const reg = /class=(["'])mc_success_msg\1/i; if (reg.test(data)) { $(form).each(function () { this.reset(); }); $('.mc_submit_type').val('js'); } window.scrollTo({ top: parseInt(form.offset().top, 10) - 28, behavior: 'smooth', }); } $(function ($) { // Change our submit type from HTML (default) to JS $('.mc_submit_type').val('js'); // Remove the no JS field. $('.mailchimp_sf_no_js').remove(); // Attach our form submitter action $('.mc_signup_form').ajaxForm({ url: window.mailchimpSF.ajax_url, type: 'POST', dataType: 'text', beforeSubmit: mc_beforeForm, success: mc_success, }); }); })(window.jQuery); /* Datepicker functions for the Mailchimp Widget */ (function ($) { if ($('.date-pick').length > 0) { // Datepicker for the date-pick class $('.date-pick').each(function () { let format = $(this).data('format') || 'mm/dd/yyyy'; format = format.replace(/yyyy/i, 'yy'); $(this).datepicker({ autoFocusNextInput: true, constrainInput: false, changeMonth: true, changeYear: true, // eslint-disable-next-line no-unused-vars beforeShow(input, inst) { $('#ui-datepicker-div').addClass('show'); }, dateFormat: format.toLowerCase(), }); }); } if ($('.birthdate-pick').length > 0) { const d = new Date(); $('.birthdate-pick').each(function () { let format = $(this).data('format') || 'mm/dd'; format = format.replace(/yyyy/i, 'yy'); $(this).datepicker({ autoFocusNextInput: true, constrainInput: false, changeMonth: true, changeYear: false, minDate: new Date(d.getFullYear(), 1 - 1, 1), maxDate: new Date(d.getFullYear(), 12 - 1, 31), // eslint-disable-next-line no-unused-vars beforeShow(input, inst) { $('#ui-datepicker-div').removeClass('show'); }, dateFormat: format.toLowerCase(), }); }); } // Phone validation custom error message. if ($('.mailchimp-sf-phone').length > 0) { $('.mailchimp-sf-phone').each(function () { $(this) .on('input', function () { this.setCustomValidity(''); }) .on('invalid', function () { if (!this.validity.valid) { this.setCustomValidity(window.mailchimpSF.phone_validation_error); } }); }); } })(window.jQuery); ; !function(){const e=(e,t)=>{if(!e.videoWidth||!e.videoHeight)return;const n=(e=>{const{videoWidth:t,videoHeight:n}=e,{width:i,height:d}=e.parentElement.getBoundingClientRect(),o=t/n;return o>i/d?{width:i,height:i/o}:{width:d*o,height:d}})(e);if(n){const i=(e.getBoundingClientRect().width-n.width)/2;t.style.left=`${i}px`,t.style.width=`${n.width}px`}},t=t=>{const n=document.querySelector(".global-header")||document.querySelector("header"),i=n?n.getBoundingClientRect().height:0,d=Math.max(0,window.innerHeight-i);t.style.maxHeight=`${d}px`;const o=()=>{if(!t.videoWidth||!t.videoHeight)return;const n=t.getBoundingClientRect().width;if(!n)return;const i=n*(t.videoHeight/t.videoWidth),o=Math.min(i,d);t.style.height=`${o}px`;const r=t.parentElement.querySelector(".progress-bar-container");r&&e(t,r)};o(),t.videoWidth&&t.videoHeight||t.addEventListener("loadedmetadata",o,{once:!0})};document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".wp-block-shiro-video-promo-container").forEach((n,i)=>{n.querySelectorAll("video").forEach((i,d)=>{if(!i)return;t(i),i.style.objectFit="cover",window.addEventListener("resize",()=>t(i)),i.addEventListener("play",()=>(e=>{e.autoplay||setTimeout(()=>{const t=document.querySelector(".global-header")||document.querySelector("header"),n=t?t.getBoundingClientRect().height:0,i=e.getBoundingClientRect().top+window.pageYOffset;window.scrollTo({top:Math.max(0,i-n),behavior:"smooth"})},100)})(i)),i.addEventListener("play",()=>(e=>{e.style.objectFit="contain"})(i)),i.addEventListener("ended",()=>(e=>{e.src="",e.src=e.currentSrc,e.style.objectFit="cover"})(i));const o=((t,n)=>{if("true"!==n.dataset.enableProgressBar)return null;const i=document.createElement("div");i.className="progress-bar-container";const d=document.createElement("div");return d.className="progress-bar",i.appendChild(d),t.after(i),e(t,i),t.addEventListener("loadedmetadata",()=>{e(t,i)}),new ResizeObserver(()=>{e(t,i)}).observe(t),window.addEventListener("resize",()=>e(t,i)),d})(i,n);o&&(i.addEventListener("timeupdate",()=>((e,t)=>{const n=e.duration;if(!Number.isFinite(n)||n<=0)return;const i=e.currentTime/n*100;t.style.width=`${Math.min(100,Math.max(0,i))}%`})(i,o)),i.addEventListener("ended",()=>(e=>{e.style.width="0%"})(o)),i.addEventListener("play",()=>(e=>{e.style.transition="width 0.5s linear"})(o)),i.addEventListener("pause",()=>(e=>{e.style.transition="none"})(o)))})})})}();; !function(){function t(t){const e=t.closest(".shiro-tabs");if(!e)return;const r=document.getElementById(t.getAttribute("aria-controls")),a=e.querySelectorAll('[role="tabpanel"]');e.querySelectorAll('[role="tab"][aria-selected="true"]').forEach(t=>{t.setAttribute("aria-selected",!1),t.setAttribute("tabindex",-1),t.classList.remove("shiro-tabs__nav-button--active")}),e.querySelectorAll(".shiro-tabs__nav-item").forEach(t=>{t.classList.remove("shiro-tabs__nav-item--active")}),t.setAttribute("aria-selected",!0),t.setAttribute("tabindex",0),t.classList.add("shiro-tabs__nav-button--active"),t.closest(".shiro-tabs__nav-item").classList.add("shiro-tabs__nav-item--active"),a.forEach(t=>{t.getAttribute("aria-labelledby")===r.getAttribute("id")?t.removeAttribute("hidden"):t.setAttribute("hidden",!0)})}function e(e){t(e.target)}function r(e){if(39!==e.keyCode&&37!==e.keyCode)return;const r=e.target.closest(".shiro-tabs"),a=r.querySelector('[role="tab"][aria-selected="true"]'),i=r.querySelectorAll('[role="tab"]'),o=Array.from(i).findIndex(t=>a.getAttribute("id")===t.getAttribute("id"));let s=37===e.keyCode?o-1:o+1;s=Math.min(Math.max(s,0),i.length),s!==o&&(t(i[s]),i[o].blur(),i[s].focus())}document.querySelectorAll(".shiro-tabs").forEach(t=>(t=>{const a=t.querySelectorAll('[role="tab"]'),i=t.querySelector('[role="tablist"]'),o=t.querySelector(".wp-block-shiro-tabbed-item");a.forEach(r=>{const a=t.querySelector(`#${r.getAttribute("aria-controls")}`);r.classList.contains("shiro-tabs__nav-button--active")?a.removeAttribute("hidden"):a.setAttribute("hidden",!0),r.addEventListener("click",e)}),i.addEventListener("keydown",r),o.toggleAttribute("aria-expanded")})(t))}();;