!function(r){var s,i,a,o,c,n,u,l,d,p=wp.customize,h={};(i=history).replaceState&&(c=function(e){var t,n=document.createElement("a");return n.href=e,t=p.utils.parseQueryString(location.search.substr(1)),(e=p.utils.parseQueryString(n.search.substr(1))).customize_changeset_uuid=t.customize_changeset_uuid,t.customize_autosaved&&(e.customize_autosaved="on"),t.customize_theme&&(e.customize_theme=t.customize_theme),t.customize_messenger_channel&&(e.customize_messenger_channel=t.customize_messenger_channel),n.search=r.param(e),n.href},i.replaceState=(a=i.replaceState,function(e,t,n){return h=e,a.call(i,e,t,"string"==typeof n&&0",{type:"hidden",name:t,value:e}))}),p.settings.channel&&(i.target="_self")):p.settings.channel&&r(i).addClass("customize-unpreviewable")},p.keepAliveCurrentUrl=(n=location.pathname,u=location.search.substr(1),l=null,d=["customize_theme","customize_changeset_uuid","customize_messenger_channel","customize_autosaved"],function(){var e,t;u!==location.search.substr(1)||n!==location.pathname?(e=document.createElement("a"),null===l&&(e.search=u,l=p.utils.parseQueryString(u),_.each(d,function(e){delete l[e]})),e.href=location.href,t=p.utils.parseQueryString(e.search.substr(1)),_.each(d,function(e){delete t[e]}),n===location.pathname&&_.isEqual(l,t)?p.preview.send("keep-alive"):(e.search=r.param(t),e.hash="",p.settings.url.self=e.href,p.preview.send("ready",{currentUrl:p.settings.url.self,activePanels:p.settings.activePanels,activeSections:p.settings.activeSections,activeControls:p.settings.activeControls,settingValidities:p.settings.settingValidities})),l=t,u=location.search.substr(1),n=location.pathname):p.preview.send("keep-alive")}),p.settingPreviewHandlers={custom_logo:function(e){r("body").toggleClass("wp-custom-logo",!!e)},custom_css:function(e){r("#wp-custom-css").text(e)},background:function(){var e="",t={};_.each(["color","image","preset","position_x","position_y","size","repeat","attachment"],function(e){t[e]=p("background_"+e)}),r(document.body).toggleClass("custom-background",!(!t.color()&&!t.image())),t.color()&&(e+="background-color: "+t.color()+";"),t.image()&&(e+='background-image: url("'+t.image()+'");',e+="background-size: "+t.size()+";",e+="background-position: "+t.position_x()+" "+t.position_y()+";",e+="background-repeat: "+t.repeat()+";",e+="background-attachment: "+t.attachment()+";"),r("#custom-background-css").text("body.custom-background { "+e+" }")}},r(function(){var e,t,n;p.settings=window._wpCustomizeSettings,p.settings&&(p.preview=new p.Preview({url:window.location.href,channel:p.settings.channel}),p.addLinkPreviewing(),p.addRequestPreviewing(),p.addFormPreviewing(),t=function(e,t,n){var i=p(e);i?i.set(t):(n=n||!1,i=p.create(e,t,{id:e}),n&&(i._dirty=!0))},p.preview.bind("settings",function(e){r.each(e,t)}),p.preview.trigger("settings",p.settings.values),r.each(p.settings._dirty,function(e,t){t=p(t);t&&(t._dirty=!0)}),p.preview.bind("setting",function(e){t.apply(null,e.concat(!0))}),p.preview.bind("sync",function(t){t.settings&&t["settings-modified-while-loading"]&&_.each(_.keys(t.settings),function(e){p.has(e)&&!t["settings-modified-while-loading"][e]&&delete t.settings[e]}),r.each(t,function(e,t){p.preview.trigger(e,t)}),p.preview.send("synced")}),p.preview.bind("active",function(){p.preview.send("nonce",p.settings.nonce),p.preview.send("documentTitle",document.title),p.preview.send("scroll",r(window).scrollTop())}),n=function(e){p.settings.changeset.uuid=e,r(document.body).find("a[href], area").each(function(){p.prepareLinkPreview(this)}),r(document.body).find("form").each(function(){p.prepareFormPreview(this)}),history.replaceState&&history.replaceState(h,"",location.href)},p.preview.bind("changeset-uuid",n),p.preview.bind("saved",function(e){e.next_changeset_uuid&&n(e.next_changeset_uuid),p.trigger("saved",e)}),p.preview.bind("autosaving",function(){p.settings.changeset.autosaved||(p.settings.changeset.autosaved=!0,r(document.body).find("a[href], area").each(function(){p.prepareLinkPreview(this)}),r(document.body).find("form").each(function(){p.prepareFormPreview(this)}),history.replaceState&&history.replaceState(h,"",location.href))}),p.preview.bind("changeset-saved",function(e){_.each(e.saved_changeset_values,function(e,t){t=p(t);t&&_.isEqual(t.get(),e)&&(t._dirty=!1)})}),p.preview.bind("nonce-refresh",function(e){r.extend(p.settings.nonce,e)}),p.preview.send("ready",{currentUrl:p.settings.url.self,activePanels:p.settings.activePanels,activeSections:p.settings.activeSections,activeControls:p.settings.activeControls,settingValidities:p.settings.settingValidities}),setInterval(p.keepAliveCurrentUrl,p.settings.timeouts.keepAliveSend),p.preview.bind("loading-initiated",function(){r("body").addClass("wp-customizer-unloading")}),p.preview.bind("loading-failed",function(){r("body").removeClass("wp-customizer-unloading")}),e=r.map(["color","image","preset","position_x","position_y","size","repeat","attachment"],function(e){return"background_"+e}),p.when.apply(p,e).done(function(){r.each(arguments,function(){this.bind(p.settingPreviewHandlers.background)})}),p("custom_logo",function(e){p.settingPreviewHandlers.custom_logo.call(e,e.get()),e.bind(p.settingPreviewHandlers.custom_logo)}),p("custom_css["+p.settings.theme.stylesheet+"]",function(e){e.bind(p.settingPreviewHandlers.custom_css)}),p.trigger("preview-ready"))})}((wp,jQuery));