!function(e){e(document).ready(function(){"use strict";function t(){"off"==e("input[name=swm_meta_sub_header_title_on]:checked").val()&&e(".swm-meta-subheader-title-fields").hide()}function a(){"off"==e("input[name=swm_meta_sub_header_breadcrumb_on]:checked").val()&&e(".swm-meta-subheader-breadcrumbs-fields").hide()}function n(){"default"==e("input[name=swm_meta_content_padding_on]:checked").val()&&e(".swm-meta-content-padding").hide()}function s(){var t=e(".swm-meta-header-background-fields").hide(),a=e(".swm-meta-header-revolution-fields").hide(),n=e("#swm_meta_header_style").val();"standard"==n?t.show():"revolution_slider"==n&&a.show();var s=e("input[name=swm_meta_sub_header_on]:checked").val();"off"!=s&&"default"!=s||e(".swm-meta-subheader-fields").hide()}function m(){var t=e("#swm_archives_page").hide();e("#swm_events_page").hide();"templates/archives.php"==e("#page_template").val()&&t.show()}var _;m(),e("#page_template").on("change",m),function(){function t(t,a,n){e("input[name="+t+"]:checked").val()==n?e(a).css("display","block"):e(a).css("display","none")}t("swm_meta_sub_header_title_on",".swm-meta-sub-header-title-elements","on"),e("input[name=swm_meta_sub_header_title_on]").on("click",function(){t("swm_meta_sub_header_title_on",".swm-meta-sub-header-title-elements","on")}),t("swm_meta_sub_header_on",".swm-meta-subheader-fields","on"),e("input[name=swm_meta_sub_header_on]").on("click",function(){t("swm_meta_sub_header_on",".swm-meta-subheader-fields","on")}),t("swm_meta_sub_header_title_on",".swm-meta-subheader-title-fields","on"),e("input[name=swm_meta_sub_header_title_on]").on("click",function(){t("swm_meta_sub_header_title_on",".swm-meta-subheader-title-fields","on")}),t("swm_meta_sub_header_breadcrumb_on",".swm-meta-subheader-breadcrumbs-fields","on"),e("input[name=swm_meta_sub_header_breadcrumb_on]").on("click",function(){t("swm_meta_sub_header_breadcrumb_on",".swm-meta-subheader-breadcrumbs-fields","on")}),t("swm_meta_content_padding_on",".swm-meta-content-padding-fields","custom"),e("input[name=swm_meta_content_padding_on]").on("click",function(){t("swm_meta_content_padding_on",".swm-meta-content-padding-fields","custom")})}(),s(),e("#swm_meta_header_style").on("change",s),t(),e("#swm_meta_sub_header_title_on").on("change",t),a(),e("#swm_meta_sub_header_breadcrumb_on").on("change",a),n(),e("#swm_meta_content_padding_on").on("change",n),e("body").on("click","input.picture-select + button",function(t){e(this),t.preventDefault();var a=e(this).prev("input.picture-select");(_=wp.media.frames.mediaSelector=wp.media({title:"Select Image",button:{text:"Insert Image"},library:{type:"image"}})).on("select",function(){var e=_.state().get("selection").first();(e=e.toJSON()).id&&(a.hasClass("picture-select-id")?a.val(e.id).trigger("change"):a.val(e.url).trigger("change"))}),_.open()})})}(jQuery);