var generic=generic||{};!function(t){"use strict";t.MAC={hasPersonalization:function(){var e=t||{};return(e=e.settings||{}).personal_block?1:0},ui:{back_top_duration:800}}}(Drupal),function(t,e,a){"use strict";e.behaviors.expandoBlock={attach:function(e){t(".js-expando-block-trigger",e).on("click",(function(){t(this).closest(".expando-block").toggleClass("expando-block--expanded")}))}},e.behaviors.siteWideBanner={attach:function(e){t(".basic-submenu-formatter-v1, .sec-nav, .submenu").length&&t("body").addClass("has-subnav"),t(window).trigger("loadSitewideBanner"),t(".site-banner").length||t(window).trigger("sidewideBanner:disabled")}},e.behaviors.forms={attach:function(e){t("html").hasClass("no-touch")&&t('select:not(".no-js")',e).select2({width:"100%",adaptDropdownCssClass:function(t){if(0===t.indexOf("s2-dropdown"))return t},minimumResultsForSearch:-1}),t("input:not('.no-js-element')[type=radio], input:not('.no-js-element')[type=checkbox]",e).picker(),t(".picker a",e).click((function(t){t.stopPropagation()}))}},e.behaviors.elementWindowHeight={attach:function(e){t(".js-element-window-height",e).elementWindowSize()}},e.behaviors.no_flexbox_match_height={attach:function(e){t(".no-flexbox .artistry--mosaic-tile",e).matchHeight(!0)}},e.behaviors.modernizr_mq_test={attach:function(){!1===a.mq("(min-width: 0px)")?t("html").addClass("no-mq"):t("html").addClass("mq")}},e.behaviors.sppShadeFilterPickerNuke={attach:function(e){t("#filter-grid-switch, .view-all-shades__wrapper input[type=checkbox]",e).picker("destroy")}},e.behaviors.displayToggle={attach:function(e){t(".js-display-toggle__trigger",e).on("click",(function(e){e.preventDefault(),t(this).parents(".js-display-toggle").find(".js-display-toggle__target").toggleClass("hidden"),t(".js-display-toggle__trigger").hasClass("search-active")&&t("#search").trigger("focus")}))}},e.behaviors.imgToBG={attach:function(i){var n=t(".js-turn-img-to-bg",i);function o(e){var i=[];e.find("source, img").each((function(){var e=t(this),a={};a.srcset=e.attr("srcset"),"source"===e[0].localName?a.media=e.attr("media"):a.media="(min-width: 1px)",i.push(a)}));var n=[];return _.each(i,(function(t){!0===a.mq(t.media)&&n.push(t)})),_.first(n).srcset}n.each((function(){t(this).find("img").not(".default-size").each((function(){var e,a=t(this),i="";a.closest("picture").length&&window.HTMLPictureElement||a.closest("picture").length&&!window.HTMLPictureElement?(i=o(a.closest("picture")),e=a.closest("picture")):(i=a.attr("src")||a.attr("data-lazy"),e=a),i&&i.length?!1===e.parent().hasClass("bg-img")&&(e.hide().wrap("
").parent().attr("style","background-image: url("+i+");").addClass("bg-img bg-img--expand"),a.parents(".media-block").addClass("has-bg-img")):console.log("img src wasn't found, so it wasn't turned into a background image.",a)}))})),t(window).resize(_.debounce((function(){e.behaviors.imgToBG.attach(),n.each((function(){var e=t(this).find(".bg-img > picture");if(e.length){var a=o(e);e.parent().attr("style","background-image: url("+a+");")}}))}),300))}},e.behaviors.faqBlock={attach:function(e){t(".mac-faq__q",e).on("click keydown",(function(e){var a=site.getKeycode(e);13!==a&&1!==a||(t(this).attr("aria-expanded","true"===t(this).attr("aria-expanded")?"false":"true"),t(this).closest(".mac-faq").toggleClass("mac-faq--expanded"))}))}},e.behaviors.simpleExpandingText={attach:function(e){t(".expanding-text__handle",e).on("click",(function(){t(this).closest(".expanding-text").toggleClass("expanding-text--expanded")}))}},e.behaviors.slideinClickaway={setWidth:function(e){var a=t(".slidein-clickaway").width();t(".slidein-clickaway__content, .slidein-clickaway__starting").width(a),t(".slidein-clickaway__rail").width(2*a)},attach:function(e){var a=this.setWidth;a(e);var i=setInterval((function(){/loaded|complete/.test(document.readyState)&&(clearInterval(i),t(document).trigger("document:readyState:complete"))}),10);t(".slidein-clickaway__starting",e).on("click",(function(){t(this).parent(".slidein-clickaway__rail").css("transform","translate3d(-50%,0,0)")})),t(".slidein-clickaway__close",e).on("click",(function(e){t(this).parents(".slidein-clickaway__rail").css("transform","translate3d(0,0,0)")}));var n=_.debounce(a,300);t(window).resize(n),t(".slidein-clickaway",e).each((function(){t(this).data("start-open")&&t(".slidein-clickaway__starting",t(this)).click()})),t(document).on("document:readyState:complete",(function(){var a=window.location.hash.replace("#","").split("&"),i=t(".js-tab-content",e);a.forEach((function(e){if(!(e.indexOf("show-")<0&&e.indexOf("tab-")<0||1===e.indexOf("/"))){if(0===e.indexOf("show-")){var a=t("a[data-scrollto="+e+"]");if(0===a.length)return;var i=0,n=setInterval((function(){t("html, body").animate({scrollTop:a.offset().top-t(".site-header__fixed-wrapper").height()+"px"},100,(function(){t(window).scrollTop()===ceil(a.offset().top-t(".site-header__fixed-wrapper").height())&&i++,10===i&&clearInterval(n)}))}),120)}if(0===e.indexOf("tab-"))t(".js-"+e).trigger("click")}})),i.on("click",(function(){var e=t(this).attr("href").replace("#","");t(".js-"+e).trigger("click")}))}))}},e.behaviors.overlayClickaway={attach:function(e){t(".overlay-clickaway",e).on("click",".overlay-clickaway__starting",(function(e){t(this).fadeOut(300)}))}},e.behaviors.footerNav={attach:function(e){t(".footer-menu--mobile .field-menu >.menu >li >a").click((function(){var e=t(this).parent();if(e.hasClass("expanded"))return e.toggleClass("submenu-visible"),!1}))}},e.behaviors.socialMedia={linkify:function(t){return t.replace(/http\S*/g,(function(t){return''+t+""}))},linkTwitterUser:function(t){return t.replace(/@\w*/g,(function(t){return''+t+""}))},twitter:function(a){function i(t,a){var i=a.text,n=a.user.screen_name,o=a.entity_id,s=moment(a.created_at),r="";s.isValid()&&(r=s.format("MMMM D, YYYY")+" AT "+s.format("h:mm a")),i=e.behaviors.socialMedia.linkify(i),i=e.behaviors.socialMedia.linkTwitterUser(i),t.find(".js-twitter-block__tweet").html(i),t.find(".js-twitter-block__user").text("@"+n).attr("href","http://twitter.com/"+n),t.find(".js-twitter-block__time").text(r).wrapInner('')}t.ajax({url:"//api.massrelevance.com/maconlinefeed/twitter_sr-artists.json?network=twitter",type:"GET",success:function(e,n,o){var s=e;t(".js-twitter-block[data-twitter-username]",a).each((function(e){var a=t(this),n=a.attr("data-twitter-username");console.log(n);var o=_.find(s,(function(t){return t.user.screen_name.toLowerCase()===n.toLowerCase()}));o?(i(a,o),s=_.without(s,o)):(a.removeAttr("data-twitter-username"),console.warn("The given Twitter username was not found in the feed, so the first available post was used instead. Username entered: "+n,a))})),t(".js-twitter-block:not([data-twitter-username])",a).each((function(e){i(t(this),s[e])}))},error:function(t,e,a){console.log("HTTP Request Failed")}})}},e.behaviors.oSCheck={attach:function(e){var a="Unknown OS";-1!=navigator.appVersion.indexOf("Win")&&(a="Windows"),-1!=navigator.appVersion.indexOf("Mac")&&(a="MacOS"),-1!=navigator.appVersion.indexOf("X11")&&(a="UNIX"),-1!=navigator.appVersion.indexOf("Linux")&&(a="Linux"),t("body",e).addClass("os--"+a),document.documentElement.setAttribute("data-useragent",navigator.userAgent)}},e.behaviors.clickable={makeClickable:function(e){t('[data-clickable!=""][data-clickable]',e).once("clickable").on("click",(function(){window.top.location.hash&&window.top.location.hash.indexOf("show-")<0&&window.top.location.hash.indexOf("#/shade")<0&&history.replaceState("","",t(this).data("clickable")),window.top.location.href=t(this).data("clickable")}))},attach:function(e,a){var i=this;i.makeClickable(e),t(window).on("window::clickable",(function(){i.makeClickable(e)}))}},e.behaviors.backToTop={attach:function(e){t(".js-back-to-top",e).once("back-to-top").on("click",(function(){t("html, body").animate({scrollTop:0},500)}))}},e.behaviors.backToTopFooter={attach:function(e,a){var i=t(".back-to-top",e);if(i&&!(i.length<1)){var n=t(".site-header").height()||0,o=-100,s=function(){o=3*(t(window).height()-n)*.85;var e=.75*t(".site-container").height();en?(a.addClass(i),a.css("top",n)):(a.removeClass(i),a.css("top","0"))}),10))}))}},e.behaviors.ieDetect={attach:function(e){function a(){var t=window.navigator.userAgent,e=t.indexOf("MSIE "),a=t.indexOf("Trident/");if(e>0)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);if(a>0){var i=t.indexOf("rv:");return parseInt(t.substring(i+3,t.indexOf(".",i)),10)}return!1}if(a()){var i="ie-"+a();t("body").addClass("ie").addClass(i)}else t("body").addClass("not-ie")}}}(jQuery,Drupal,Modernizr); //# sourceMappingURL=mac_base.min.js.map