function dtRadioImagesSetCheckbox(a){jQuery("#"+a).trigger("click")}!function(a){window.The7Options||(window.The7Options={}),window.The7Options.slider||(window.The7Options.slider=function(b){var c=a(b),d=c.next("input.of-slider-value");d.length&&(c.slider({value:parseInt(d.attr("data-value")),min:parseInt(d.attr("data-min")),max:parseInt(d.attr("data-max")),step:parseInt(d.attr("data-step")),range:"min",slide:function(a,b){d.val(b.value).trigger("change.of-slider-slide")}}),d.val(c.slider("value")),d.on("change",function(a){var b=parseInt(d.val());isNaN(b)&&(b=c.slider("option","min")),c.slider("value",b),d.val(c.slider("value"))}))})}(jQuery),function(a){function b(a){var b;return a=a.replace(/ /g,""),a.match(/rgba\(\d+\,\d+\,\d+\,([^\)]+)\)/)?(b=100*parseFloat(a.match(/rgba\(\d+\,\d+\,\d+\,([^\)]+)\)/)[1]).toFixed(2),b=parseInt(b)):b=100,b}function c(a,b,c,e){var f,g,h;f=b.data("a8cIris"),g=b.data("wpWpColorPicker"),f._color._alpha=a,h=f._color.toString(),b.val(h),g.toggler.css({"background-color":h}),e&&d(a,c),b.wpColorPicker("color",h)}function d(a,b){b.slider("value",a),b.find(".ui-slider-handle").text(a.toString())}window.The7Options||(window.The7Options={}),window.The7Options.alphaColor||(window.The7Options.alphaColor=function(b){a(b).alphaColorPicker()},Color.prototype.toString=function(a){if("no-alpha"==a)return this.toCSS("rgba","1").replace(/\s+/g,"");if(1>this._alpha)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var b=parseInt(this._color,10).toString(16);if(this.error)return"";if(b.length<6)for(var c=6-b.length-1;c>=0;c--)b="0"+b;return"#"+b},a.fn.alphaColorPicker=function(){return this.each(function(){var e,f,g,h,i,j,k,l,m,n,o;e=a(this),e.wrap('<div class="alpha-color-picker-wrap"></div>'),g=e.attr("data-palette")||"true",h=e.attr("data-show-opacity")||"true",i=e.attr("data-default-color")||"",j=g.indexOf("|")!==-1?g.split("|"):"false"!=g,f=e.val().replace(/\s+/g,""),""==f&&(f=i),k={change:function(a,c){var d,f,g,h;d=e.attr("data-customize-setting-link"),f=e.wpColorPicker("color"),i==f&&(g=b(f),m.find(".ui-slider-handle").text(g)),"undefined"!=typeof wp.customize&&wp.customize(d,function(a){a.set(f)}),h=l.find(".transparency"),h.css("background-color",c.color.toString("no-alpha"))},palettes:j},e.wpColorPicker(k),l=e.parents(".wp-picker-container:first"),a('<div class="alpha-color-picker-container"><div class="min-click-zone click-zone"></div><div class="max-click-zone click-zone"></div><div class="alpha-slider"></div><div class="transparency"></div></div>').appendTo(l.find(".wp-picker-holder")),m=l.find(".alpha-slider"),n=b(f),o={create:function(b,c){var d=a(this).slider("value");a(this).find(".ui-slider-handle").text(d),a(this).siblings(".transparency ").css("background-color",f)},value:n,range:"max",step:1,min:0,max:100,animate:300},m.slider(o),"true"==h&&m.find(".ui-slider-handle").addClass("show-opacity"),l.find(".min-click-zone").on("click",function(){c(0,e,m,!0)}),l.find(".max-click-zone").on("click",function(){c(100,e,m,!0)}),l.find(".iris-palette").on("click",function(){var c,f;c=a(this).css("background-color"),f=b(c),d(f,m),100!=f&&(c=c.replace(/[^,]+(?=\))/,(f/100).toFixed(2))),e.wpColorPicker("color",c)}),l.find(".button.wp-picker-default").on("click",function(){var a=b(i);d(a,m)}),e.on("input",function(){var c=a(this).val(),e=b(c);d(e,m)}),m.slider().on("slide",function(b,d){var f=parseFloat(d.value)/100;c(f,e,m,!1),a(this).find(".ui-slider-handle").text(d.value)})})})}(jQuery),function(a){function b(a,b){return a.position-b.position}function c(a,b){return"function"==typeof a.bind?a.bind(b):function(){a.apply(b,arguments)}}function d(b,d){this.$el=b,this.$el.css("position","relative"),this.opts=d;var e=a("<canvas class='gradientPicker-preview'></canvas>");this.$el.append(e);var g=e[0];g.width=this.opts.previewWidth,g.height=this.opts.previewHeight,this.g2d=g.getContext("2d");var h=a("<div class='gradientPicker-ctrlPts'></div>");h.css("width",this.opts.previewWidth),this.$el.append(h),this.$ctrlPtContainer=h,this.updatePreview=c(this.updatePreview,this),this.controlPoints=[],this.ctrlPtConfig=new f(this.$el,d);for(var i=0;i<d.controlPoints.length;++i){var j=this.createCtrlPt(d.controlPoints[i]);this.controlPoints.push(j)}this._maybeLockCtrlPoints(),this.docClicked=c(this.docClicked,this),this.destroyed=c(this.destroyed,this),a(document).bind("click",this.docClicked),this.$el.bind("destroyed",this.destroyed),this.previewClicked=c(this.previewClicked,this),e.click(this.previewClicked),this.updatePreview()}function e(b,d,e,f,g){if(this.$el=a("<div class='gradientPicker-ctrlPt'></div>"),b.append(this.$el),this.$parentEl=b,this.configView=g,"string"==typeof d?(d=d.split(" "),this.position=parseFloat(d[1])/100,this.color=d[0]):(this.position=d.position,this.color=d.color),this.listener=f,this.outerWidth=this.$el.outerWidth(),this.$el.css("background-color",this.color),"horizontal"==e){var h=(b.width()-this.$el.outerWidth())*this.position;this.$el.css("left",h)}else{var i=(b.height()-this.$el.outerHeight())*this.position;this.$el.css("top",i)}this.drag=c(this.drag,this),this.stop=c(this.stop,this),this.clicked=c(this.clicked,this),this.colorChanged=c(this.colorChanged,this),this.$el.draggable({axis:"horizontal"==e?"x":"y",drag:this.drag,stop:this.stop,containment:b}),this.$el.css("position","absolute"),this.$el.click(this.clicked)}function f(b,d){this.$el=a('<div class="gradientPicker-ptConfig" style="visibility: hidden"></div>'),b.append(this.$el);var e=a('<input class="color-chooser"></input>');this.$el.append(e);var f=a("<div class='gradientPicker-close'></div>");this.$el.append(f),this.colorChanged=c(this.colorChanged,this),this.removeClicked=c(this.removeClicked,this),e.alphaColorPicker(),e.wpColorPicker("option","clear",!1);var h=e.wpColorPicker("instance"),i=h.options.change,j=this;e.wpColorPicker("option","change",function(a,b){i(a,b),j.colorChanged(a,b)}),this.$cpicker=e,this.opts=d,this.visible=!1,f.click(this.removeClicked),this.$cpicker.parents(".wp-picker-container:first").find(".wp-color-result").off("click"),this.onChangePosition=c(this.onChangePosition,this),this.position=new g,this.position.onChangePosition(this.onChangePosition),this.$cpicker.closest(".wp-picker-input-wrap").after(this.position.getControls())}function g(){this.$positionParent=a('<span class="wp-picker-input-wrap wp-picker-position"><label><span class="screen-reader-text">Control point position</span><input class="point-position" type="number" min="0" max="100" step="1" size="3">%</label></span>'),this.$input=this.$positionParent.find(".point-position")}if(window.The7Options||(window.The7Options={}),!window.The7Options.gradientPicker){window.The7Options.gradientPicker=function(b){var c=a(b);c.gradientPicker({change:function(a,b){var c=parseInt(b.find(".of-gradient_picker-angle").val())+"deg",d=a.map(function(a){return a.color+" "+(100*a.position|0)+"%"}),e=[c].concat(d);b.find(".of-gradient_picker-value").val(e.join("|")),b.siblings(".of-gradient_picker-preview-box").first().css("background-image","linear-gradient("+e.join(",")+")")},controlPoints:c.find(".of-gradient_picker-value").val().split("|").slice(1),previewWidth:252,previewHeight:25}),c.find(".of-gradient_picker-angle").on("change.of-slider-slide",function(){c.gradientPicker("update",{})})},a.event.special.destroyed||(a.event.special.destroyed={remove:function(a){a.handler&&a.handler()}});var h="",i=window.navigator.userAgent;h=i.indexOf("WebKit")>=0?"-webkit-":i.indexOf("Mozilla")>=0?"-moz-":i.indexOf("Microsoft")>=0?"-ms-":"",d.prototype={docClicked:function(){this.ctrlPtConfig.hide()},createCtrlPt:function(a){return new e(this.$ctrlPtContainer,a,this.opts.orientation,this,this.ctrlPtConfig)},destroyed:function(){a(document).unbind("click",this.docClicked)},updateOptions:function(b){a.extend(this.opts,b),this.updatePreview()},updatePreview:function(){var a=[];this.controlPoints.sort(b);for(var c=this.g2d.createLinearGradient(0,0,this.g2d.canvas.width,0),d=0;d<this.controlPoints.length;++d){var e=this.controlPoints[d];c.addColorStop(e.position,e.color),a.push({position:e.position,color:e.color})}if(this.g2d.fillStyle=c,this.g2d.fillRect(0,0,this.g2d.canvas.width,this.g2d.canvas.height),this.opts.generateStyles)var f=this._generatePreviewStyles();this.opts.change(a,this.$el,f)},removeControlPoint:function(a){if(!this.ctrlPointsIsLocked){var b=this.controlPoints.indexOf(a);b!=-1&&(this.controlPoints.splice(b,1),a.$el.remove()),this._maybeLockCtrlPoints()}},previewClicked:function(c){var d=a(c.target).offset(),e=c.pageX-d.left,f=c.pageY-d.top,g=this.g2d.getImageData(e,f,1,1),h="rgb("+g.data[0]+","+g.data[1]+","+g.data[2]+")",i=this.createCtrlPt({position:e/this.g2d.canvas.width,color:h});this.controlPoints.push(i),this.controlPoints.sort(b),this._maybeLockCtrlPoints()},_generatePreviewStyles:function(){for(var a=this.opts.type+"-gradient("+("linear"==this.opts.type?this.opts.fillDirection+", ":""),b=!0,c=0;c<this.controlPoints.length;++c){var d=this.controlPoints[c];b?b=!1:a+=", ",a+=d.color+" "+(100*d.position|0)+"%"}a+=")";var e=[a,h+a];return e},_maybeLockCtrlPoints:function(){this.controlPoints.length<=this.opts.minCtrlPts?(this.ctrlPtConfig.lockCtrlPoints(),this.ctrlPointsIsLocked=!0):(this.ctrlPtConfig.unlockCtrlPoints(),this.ctrlPointsIsLocked=!1)}},e.prototype={changePosition:function(a){this.position=a,this.listener.updatePreview(),this.$el.css("left",this.position*(this.$parentEl.width()-this.outerWidth))},drag:function(a,b){var c=b.position.left;this.position=c/(this.$parentEl.width()-this.outerWidth),this.listener.updatePreview(),this.configView.setPosition(this.position)},stop:function(a,b){this.listener.updatePreview(),this.configView.show(this.$el.position(),this.color,this)},clicked:function(a){return this.configView.show(this.$el.position(),this.color,this),a.stopPropagation(),!1},colorChanged:function(a){this.color=a,this.$el.css("background-color",this.color),this.listener.updatePreview()},removeClicked:function(){this.listener.removeControlPoint(this),this.listener.updatePreview()}},f.prototype={show:function(a,b,c){this.listener=c,this.$el.css("visibility","visible"),this.$cpicker.wpColorPicker("color",b),this.$cpicker.trigger("input"),this.visible||this.$cpicker.wpColorPicker("open"),"horizontal"===this.opts.orientation?this.$el.css("left",0):this.$el.css("top",a.top),this.visible=!0,this.setPosition(c.position)},hide:function(){this.visible&&(this.$el.css("visibility","hidden"),this.visible=!1)},colorChanged:function(a,b){var c=b.color.toString();this.listener.colorChanged(c)},removeClicked:function(){this.listener.removeClicked(),this.hide()},lockCtrlPoints:function(){this.$el.addClass("gradientPicker-ctrlPointsLocked")},unlockCtrlPoints:function(){this.$el.removeClass("gradientPicker-ctrlPointsLocked")},setPosition:function(a){this.position.setPosition(a)},onChangePosition:function(a){a=parseInt(a),isNaN(a)||(a=window.Math.max(0,a),a=window.Math.min(100,a),this.listener.changePosition(a/100))}},g.prototype={getControls:function(){return this.$positionParent},setPosition:function(a){this.$input.val(window.Math.round(100*a))},getPosition:function(){return 0|this.$input.val()},onChangePosition:function(a){this.$input.on("change",{callback:a},this.changePosition)},changePosition:function(b){b.data.callback(a(this).val())}};var j={init:function(b){b=a.extend({controlPoints:["#FFF 0%","#000 100%"],minCtrlPts:2,orientation:"horizontal",type:"linear",fillDirection:"left",generateStyles:!0,previewWidth:200,previewHeight:20,change:function(){}},b),this.each(function(){var c=a(this),e=new d(c,b);c.data("gradientPicker-sel",e)})},update:function(b){this.each(function(){var c=a(this),d=c.data("gradientPicker-sel");null!=d&&d.updateOptions(b)})}};a.fn.gradientPicker=function(a,b){"string"==typeof a&&"init"!==a?j[a].call(this,b):(b=a,j.init.call(this,b))}}}(jQuery),function(a){"use strict";window.The7Options||(window.The7Options={}),window.The7Options.iconsPicker||(window.The7Options.iconsPicker=function(b){function c(){if("undefined"==typeof window.The7Options.iconsPicker.$iconsListCache)return window.The7Options.iconsPicker.$iconsListCache=a(),void a.post(ajaxurl,{action:"the7_get_icons_for_icons_picker"}).done(function(a){var b=a;if(b){var c="";for(var d in b){c+='<p class="of-icons_picker-list-group">'+d+"</p>";for(var e in b[d]){var f=b[d][e];c+='<li data-icon="'+f+'" title="'+f+'"><i class="moon-icon '+f+'"></i><label class="moon-icon">'+f+"</label></li>"}}window.The7Options.iconsPicker.$iconsListCache=window.The7Options.iconsPicker.$iconsListCache.add(c)}})}function d(a){a.attr("class","selected").siblings("li").removeAttr("class")}function e(a){a.removeClass(k).addClass(l)}function f(a){a.removeClass(l).addClass(k)}function g(a){return a.hasClass(l)}function h(b){var c=b.removeClass(k+" "+l).attr("class").split(" ").join(".");e(a(c))}var i=a(b),j=a(".of-icons_picker-search",i),k="of-icons_picker-list-sub-is-opened",l="of-icons_picker-list-sub-is-closed";c(),a(".selector-button",i).on("click",function(){var b=a(this),c=b.siblings(".of-icons_picker-list-sub");if(g(i)){if(h(i),f(i),!b.data("icons-loaded")){"undefined"!=typeof window.The7Options.iconsPicker.$iconsListCache&&(b.data("icons-loaded",!0),c.append(window.The7Options.iconsPicker.$iconsListCache.clone()));var k=b.closest(".of-icons_picker-selector").attr("data-icon");d(c.find('li[data-icon="'+k+'"]').first())}j.focus().val("").trigger("change")}else e(i)}),a(".of-icons_picker-list-sub",i).on("click","li",function(){var b=a(this),c=b.attr("data-icon"),f=b.parents(".of-icons_picker-selector");i.find("input.of-icons_picker-value").val(c),d(b),f.find("> i").removeAttr("class").attr("class",b.find("> i").attr("class")),e(i)}),j.on("change keyup",function(){var b=a(this),c=b.val();c?b.siblings("p, li").hide().filter('li[data-icon*="'+c+'"]').show():b.siblings(":hidden").show()})})}(jQuery),function(a){a(document).ready(function(){function b(b,c){var e,f=(a(".uploaded-file"),a(this));return b.preventDefault(),e?void e.open():(e=wp.media({title:f.data("choose"),button:{text:f.data("update"),close:!1}}),e.on("select",function(){var a=e.state().get("selection").first();e.close(),c.find(".upload").val(a.attributes.url),c.find(".upload-id").val(a.attributes.id),"image"==a.attributes.type&&c.find(".screenshot").empty().hide().append('<img src="'+a.attributes.url+'"><a class="remove-image">Remove</a>').slideDown("fast"),c.find(".upload-button").unbind().addClass("remove-file").removeClass("upload-button").val(optionsframework_l10n.remove),c.find(".of-background-properties").slideDown(),d(c)}),void e.open())}function c(b){b.find(".upload").val(""),b.find(".of-background-properties").hide(),b.find(".screenshot").slideUp(),b.find(".remove-image").unbind(),b.find(".remove-file").unbind().addClass("upload-button").removeClass("remove-file").val(optionsframework_l10n.upload),b.find(".upload-id").val(0),a(".section-upload .upload-notice").length>0&&a(".upload-button").remove(),d(b)}function d(){var d=arguments[0]||a("#optionsframework");a(".remove-image, .remove-file",d).on("click",function(){c(a(this).parents(".controls"))}),a(".upload-button",d).click(function(c){b(c,a(this).parents(".controls"))})}window.optionsframework_add_file=b,window.optionsframework_remove_file=c,window.optionsframework_file_bindings=d,d()})}(jQuery),function(a){window.The7Options||(window.The7Options={}),window.The7Options.codeEditor||(window.The7Options.codeEditor=function(b){if(!wp.codeEditor||!wp.codeEditor.defaultSettings)return null;var c=a(b),d=a.extend({},wp.codeEditor.defaultSettings);return d.codemirror=a.extend({},d.codemirror,{indentUnit:2,tabSize:2,mode:c.attr("data-code-style")}),wp.codeEditor.initialize(c,d)})}(jQuery),function(a){window.The7Options||(window.The7Options={}),window.The7Options.pagesList||(window.The7Options.pagesList=function(b,c){var d=a(b);d.on("change",function(){var b=a(this),d=b.val();b.siblings(".page-edit-link").remove(),d&&"0"!==d&&c&&a('<p class="page-edit-link">'+c.replace("%#%",b.val())+"</p>").insertAfter(b)}).trigger("change")})}(jQuery),function(a){window.The7Options||(window.The7Options={}),window.The7Options.switch||(window.The7Options.switch=function(b){a(".the7-option-switch-checkbox",b).on("change",function(){var b=a(this),c=JSON.parse(b.attr("data-values"));b.val(b.is(":checked")?c[0]:c[1])})})}(jQuery),function(a){a.belowthefold=function(b,c){var d=a(window).height()+a(window).scrollTop();return d<=a(b).offset().top-c.threshold},a.abovethetop=function(b,c){var d=a(window).scrollTop();return d>=a(b).offset().top+a(b).height()-c.threshold},a.rightofscreen=function(b,c){var d=a(window).width()+a(window).scrollLeft();return d<=a(b).offset().left-c.threshold},a.leftofscreen=function(b,c){var d=a(window).scrollLeft();return d>=a(b).offset().left+a(b).width()-c.threshold},a.inviewport=function(b,c){return!(a.rightofscreen(b,c)||a.leftofscreen(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))},a.extend(a.expr[":"],{"below-the-fold":function(b,c,d){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b,c,d){return a.abovethetop(b,{threshold:0})},"left-of-screen":function(b,c,d){return a.leftofscreen(b,{threshold:0})},"right-of-screen":function(b,c,d){return a.rightofscreen(b,{threshold:0})},"in-viewport":function(b,c,d){return a.inviewport(b,{threshold:0})}})}(jQuery),function(a){window.the7OptionsBootstrap=function(){function b(b){var c=a("<a></a>").attr("href",b);a('#optionsframework input[name="_wp_http_referer"]').val(c[0].pathname+c[0].search)}function c(a){return a?a.replace("-tab","-group"):""}function d(b){var d=c(b);a(".group").hide().filter("#"+d).fadeIn(),a("#optionsframework-wrap .nav-tab-wrapper a").removeClass("nav-tab-active").filter("#"+b).addClass("nav-tab-active").blur(),a("body").trigger("the7.options.tabChange")}function e(){a(this).attr("checked")?a(this).parent().parent().parent().nextAll().removeClass("hidden"):a(this).parent().parent().parent().nextAll().each(function(){return a(this).filter(".last").length?(a(this).addClass("hidden"),!1):void a(this).addClass("hidden")})}function f(a){var b=["Andale Mono","Arial","Arial:600","Arial:400italic","Arial:600italic","Arial Black","Comic Sans MS","Comic Sans MS:600","Courier New","Courier New:600","Courier New:400italic","Courier New:600italic","Georgia","Georgia:600","Georgia:400italic","Georgia:600italic","Impact Lucida Console","Lucida Sans Unicode","Marlett","Minion Web","Symbol","Times New Roman","Times New Roman:600","Times New Roman:400italic","Times New Roman:600italic","Tahoma","Trebuchet MS","Trebuchet MS:600","Trebuchet MS:400italic","Trebuchet MS:600italic","Verdana","Verdana:600","Verdana:400italic","Verdana:600italic","Webdings"];return-1!=b.indexOf(a)}function g(){jQuery(".of_fields_gen_del").click(function(){var a=jQuery(this).parents("li").find("div.of_fields_gen_title");return a.next("div.of_fields_gen_data").hide().detach(),a.hide("slow").detach(),!1})}function h(){jQuery(".item-edit").click(function(a){jQuery(a.target).parents(".of_fields_gen_title").is("div.of_fields_gen_title")&&jQuery(a.target).parents(".of_fields_gen_title").next("div.of_fields_gen_data").toggle()})}function i(){jQuery('.of_fields_gen_data input[type="checkbox"]').on("change",function(){var a=jQuery(this),b=a.next(".dt-hidden-desc");if(!b.length)return!0;b=b.clone().removeClass("dt-hidden-desc");var c=jQuery(event.target).parents("div.of_fields_gen_data").prev("div.of_fields_gen_title").children(".dt-menu-item-title");a.attr("checked")?c.after(b):c.parent().find("."+b.attr("class")).remove()})}function j(){x.css({width:v.width()})}function k(){if(0!==v.length){var b=v.offset().top+v.outerHeight(),c=a(window).scrollTop()+a(window).height();c<=b?x.addClass("flow"):x.removeClass("flow")}}function l(){if(y.length){var a=y[0].scrollHeight,b=y.height();a>b?x.addClass("flow"):x.removeClass("flow")}}function m(b,c){var d=b.find(".dt-web-fonts-preview span"),e=d.data("previewStyle")||{};d.data("previewStyle",a.extend(e,c)),d.attr("style",Object.keys(e).reduce(function(a,b){return a+e[b]},""))}var n={fields:[],dependencies:{},_depFields:[],init:function(a,b){b&&a&&(this.fields=a,this.dependencies=b,this._setDepFields(),this._triggerDependencies(),this._addEvents())},_addEvents:function(){var b=this;this.fields.find(":radio, select").on("change.of.dependency",function(){var c=a(this),d=b._getFieldID(c);b._setFieldValue(d,c.val()),b._triggerDependencies(d)}),this.fields.find(":checkbox").on("change.of.dependency",function(){var c=a(this),d=b._getFieldID(c),e=c.attr("data-values")?JSON.parse(c.attr("data-values")):["1","0"],f=c.is(":checked")?e[0]:e[1];b._setFieldValue(d,f),b._triggerDependencies(d)})},_fieldIsVisible:function(a){var b=this;return a.reduce(function(a,c){return a||c.reduce(function(a,c){var d=b._getFieldValue(c.field);return"=="===c.operator?a&&d===c.value:"!="===c.operator?a&&d!==c.value:"IN"===c.operator?c.value.indexOf(d)!==-1:"NOT_IN"===c.operator?c.value.indexOf(d)===-1:"undefined"!=typeof c.bool_value?a&&!!c.bool_value:a},!0)},!1)},_triggerDependencies:function(a){if("undefined"!=typeof a){if(!this._depFields[a])return;for(var b=[],c=this._depFields[a].length,d=0;d<c;d++){var e=this._depFields[a][d];this.dependencies[e]&&(b[e]=this.dependencies[e])}}else var b=this.dependencies;for(depField in b)this._fieldIsVisible(b[depField])?(this._showField(depField),this._showBox(depField)):(this._hideField(depField),this._hideBox(depField))},_setDepFields:function(){for(var a in this.dependencies)for(var b=this.dependencies[a],c=b.length,d=0;d<c;d++)for(var e=b[d],f=e.length,g=0;g<f;g++){var h=e[g],i=h.field;this._depFields[i]||(this._depFields[i]=new Array),this._depFields[i].push(a)}},_getFieldID:function(a){var b=a.closest(".section").attr("id")||"";return b.replace("section-","")},_showField:function(a){this._findField(a).show()},_hideField:function(a){this._findField(a).hide()},_findField:function(a){return this.fields.filter("#section-"+a)},_showBox:function(a){this._findBox(a).removeClass("block-disabled")},_hideBox:function(a){this._findBox(a).addClass("block-disabled")},_findBox:function(a){return this.fields.filter("#"+a+".postbox")},_getFieldValue:function(a){return this._findField(a).attr("data-value")},_setFieldValue:function(a,b){"undefined"!=typeof b&&this._findField(a).attr("data-value",b)}};n.init(a("#optionsframework .section"),optionsframework.dependencies);var o=a.extend(!0,{},n,{_showField:function(b){a("#optionsframework-wrap ."+b).removeClass("block-disabled")},_hideField:function(b){a("#optionsframework-wrap ."+b).addClass("block-disabled")}});o.init(a("#optionsframework .section"),optionsframework.blockDependencies),a(".fade").delay(5e3).fadeOut(1e3),a(".of-hex-color").wpColorPicker(),a(".of-rgba-color").each(function(){window.The7Options.alphaColor(this)}),a("#optionsframework-wrap .nav-tab-wrapper").show(),a(".group").hide(),a(".group .collapsed").each(function(){a(this).find("input:checked").parent().parent().parent().nextAll().each(function(){return a(this).hasClass("last")?(a(this).removeClass("hidden"),!1):void a(this).filter(".hidden").removeClass("hidden")})}),a("#optionsframework-wrap .nav-tab-wrapper a").click(function(e){e.preventDefault();var f=a(this);d(f.attr("id")),a(".wp-editor-wrap").each(function(){var b=a(this).find("iframe");b.height()<30&&b.css({height:"auto"})}),history.pushState({activeGroupId:"#"+c(f.attr("id"))},"",f.attr("href")),b(f.attr("href")),k()});var p=c(a("#optionsframework-wrap a.nav-tab-active").attr("id"));a("#"+p).fadeIn(),a(window).on("popstate",function(c){var e={};if(location.search.substr(1).split("&").forEach(function(a){e[a.split("=")[0]]=a.split("=")[1]}),e.tab)var f=e.tab;else var f=a("#optionsframework-wrap .nav-tab-wrapper a").first().attr("id");d(f),b(a("#"+f).attr("href"))});var q=a("#optionsframework-search").autocomplete({minLength:3,delay:500,select:function(a,b){return"none"!==b.item.value&&(window.location.href=b.item.value),!1},change:function(a,b){return!1},focus:function(){return!1},source:function(b,c){var d=a("#optionsframework-search-spinner").addClass("is-active");a.ajax({url:ajaxurl,data:{action:"optionsframework_search",search:b.term,_ajax_nonce:this.element.attr("data-nonce")}}).done(function(a){c(a)}).fail(function(){c([])}).always(function(){d.removeClass("is-active")})}}).autocomplete("instance");q._renderItem=function(b,c){var d="<span>"+c.label+"</span>";return"none"!==c.value&&(d='<a href="'+c.value+'">'+c.label+"</a>"),a("<li>").append(d).appendTo(b)},q._renderMenu=function(b,c){var d=this;a.each(c,function(a,c){d._renderItemData(b,c)}),a(b).addClass("the7-options-search-ui-menu")},a(".section.marked").each(function(){var b=a(this);setTimeout(function(){b.removeClass("marked")},3e3)}),a(".group .collapsed input:checkbox").click(e),a(".the7-postbox.section").each(function(){var b=a(this);b.find(".section").length<=0&&b.hide()});var r=function(a,b){this.valueField=a,this.spacing=[],this.addHandlers(b)};if(r.prototype.addSpace=function(a,b,c){this.spacing[a]={units:c,val:b,getVal:function(){return this.val=this.val||0,parseInt(this.val)+this.units}}},r.prototype.addHandlers=function(b){var c=this;b.each(function(b){var d=a(this),e=d.find(".dt_spacing-value"),f=d.find(".dt_spacing-units");c.addSpace(b,e.val(),f.attr("data-units")),e.on("blur",function(){c.spacing[b].val=a(this).val(),c.updateParamValue()}),f.on("change",function(){c.spacing[b].units=a(this).val(),c.updateParamValue()})})},r.prototype.updateParamValue=function(){var a=[];this.spacing.forEach(function(b){a.push(b.getVal())}),this.valueField.val(a.join(" "))},a(".section-spacing").each(function(){var b=a(this),c=b.find(".the7-option-field-value"),d=b.find(".dt_spacing-space");new r(c,d)}),a(".section-gradient_picker .grad_ex").each(function(){window.The7Options.gradientPicker(this)}),a(".of-icons_picker-controls").each(function(){window.The7Options.iconsPicker(this)}),window.The7Options.pagesList(a(".section-pages_list select"),optionsframework.editPageLinkTemplate),a(".of-radio-img-img").click(function(){a(this).parents(".controls").find(".of-radio-img-img").removeClass("of-radio-img-selected"),a(this).addClass("of-radio-img-selected")}),a(".section-background_img").on("click","a.remove-image, input.button",function(b){b.preventDefault(),a(this).parents(".controls").find(".of-radio-img-img").removeClass("of-radio-img-selected")}),a(".of-radio-img-label").on("click",function(b){b.preventDefault(),a(this).siblings(".of-radio-img-img").trigger("click")}),a(".of-radio-img-img").show(),a(".of-radio-img-radio").hide(),a(".of-input.dt-web-fonts").length>0){var s="Arial";a(".of-input.dt-web-fonts").on("click",function(){s=a(this).val().split(":").reduce(function(a){return a})}),a(".of-input.dt-web-fonts").on("change",function(){var b=a(this),c=b.val();if(c){var d=c.replace(/ /g,"+"),e=c.split("&")[0],g=bold="";if(e=e.split(":"),e[1]){var h=e[1].split("italic");2==h.length&&(g="font-style: italic;"),"700"==h[0]||"bold"==h[0]?bold="font-weight: bold;":"400"==h[0]||"normal"==h[0]?bold="font-weight: normal;":h[0]?bold="font-weight: "+parseInt(h[0])+";":bold="font-weight: normal;"}else bold="font-weight: normal;";var i="http:";"undefined"!=typeof document.location.protocol&&(i=document.location.protocol);var j=i+"//fonts.googleapis.com/css?family="+d,k='font-family: "'+e[0]+'", "'+s+'";'+g+bold;s=e[0],f(c)||a("head").append('<link href="'+j+'" rel="stylesheet" type="text/css">'),m(b.parent(),{fontFamily:k})}}),a(".of-input.dt-web-fonts").trigger("change")}jQuery("#optionsframework .of_fields_gen_list").length>0&&jQuery("#optionsframework .of_fields_gen_list").sortable(),jQuery("button.of_fields_gen_add").click(function(a){a.preventDefault();var b=jQuery(this).parent().prev(".of_fields_gen_list"),c=jQuery(this).parents("div.of_fields_gen_controls"),d='<div class="submitbox"><a href="#" class="of_fields_gen_del submitdelete">Delete</a></div>';if(!c.find(".of_fields_gen_title").val())return!1;var e=0;b.find("div.of_fields_gen_title").each(function(){var a=parseInt(jQuery(this).attr("data-index"));a>=e&&(e=a)}),e+=1;var f=c.clone();f.find("button.of_fields_gen_add").detach(),f.attr("class","").addClass("of_fields_gen_data menu-item-settings description").append(d);var h=jQuery('<span class="dt-menu-item-title">').text(jQuery(".of_fields_gen_title",c).val()),j=jQuery('<div class="of_fields_gen_title menu-item-handle" data-index="'+e+'"><span class="item-controls"><a class="item-edit"></a></span></div>');f.find("input, textarea, select").each(function(){var a=jQuery(this).attr("name").toString();jQuery(this).val(c.find('input[name="'+a+'"], textarea[name="'+a+'"], select[name="'+a+'"]').val()),a=a.replace("][","]["+e+"]["),jQuery(this).attr("name",a);var b=jQuery(this).next(".dt-hidden-desc");"checkbox"==jQuery(this).attr("type")&&jQuery(this).attr("checked")&&b&&j.prepend(b.clone().removeClass("dt-hidden-desc"))}),b.append(f),j.prepend(h),f.wrap('<li class="nav-menus-php"></li>').before(j),f.hide(),g(),i(),jQuery(".item-edit",j).click(function(a){jQuery(a.target).parents(".of_fields_gen_title").is("div.of_fields_gen_title")&&jQuery(a.target).parents(".of_fields_gen_title").next("div.of_fields_gen_data").toggle()})}),g(),h(),i(),jQuery(".section-fields_generator .nav-menus-php").each(function(){var a=jQuery(".dt-menu-item-title",jQuery(this));jQuery('input[type="checkbox"]:checked',jQuery(this)).each(function(){var b=jQuery(this).next(".dt-hidden-desc");if(b.length){var c=b.clone();a.after(c.removeClass("dt-hidden-desc"))}})}),jQuery("div.controls").change(function(a){if(jQuery(a.target).not("div").is(".of_fields_gen_title")){var b=jQuery(a.target).parents("div.of_fields_gen_data").prev("div.of_fields_gen_title").children(".dt-menu-item-title");b&&b.text(jQuery(a.target).val())}}),jQuery(".of-slider").each(function(){window.The7Options.slider(this)}),jQuery("#optionsframework .of-js-hider").each(function(){var b=jQuery(this),c=b.closest(".section").nextAll(".of-js-hide").first(),d=jQuery("."+b.closest(".section").attr("id").replace("section-",""));b.is('input[type="checkbox"]')?(b.on("click",function(){c.fadeToggle(400)}),b.prop("checked")&&c.show()):b.hasClass("of-slider")?b.hasClass("js-hide-if-not-max")&&(b.on("slidechange",function(a,b){var d=jQuery(this);b.value!=d.slider("option","max")?c.show():c.hide(400)}),b.slider("option","value")!=b.slider("option","max")&&c.show()):b.is('input[type="radio"]')?(b.attr("data-js-target")&&(c=b.attr("data-js-target"),"."!==c.charAt(0)&&(c="."+c),c=jQuery(c)),c.length>0&&(b.on("click",function(){d.length>0&&d.hide(),a(this).hasClass("js-hider-show")?c.show():c.hide()}),b.prop("checked")&&b.click())):b.is("select")&&b.on("change",function(){var b=a(this),e=b.find('option[value="'+b.val()+'"]');e.attr("data-js-target")&&(c=e.attr("data-js-target"),"."!==c.charAt(0)&&(c="."+c),c=a(c)),c&&c.length<=0||(d.length>0&&d.hide(),e.hasClass("js-hider-show")?c.show():c.hide())}).trigger("change")}),jQuery('#optionsframework input[type="checkbox"].of-js-hider-global').click(function(){var a=jQuery(this);a.parents(".section-block_begin").next(".of-js-hide").fadeToggle(400)}),jQuery('#optionsframework input[type="checkbox"]:checked.of-js-hider-global').each(function(){var a=jQuery(this);a.parents(".section-block_begin").next(".of-js-hide").show()}),jQuery("#optionsframework .section-social_buttons").each(function(){var b=a(this),c=b.attr("id");b.find(".connectedSortable").sortable({connectWith:"#"+c+" .connectedSortable",placeholder:"of-socbuttons-highlight",cancel:"li.ui-dt-sb-hidden"}).disableSelection()}),jQuery("#optionsframework .section-social_buttons .content-holder.connectedSortable").on("sortupdate",function(a,b){var c=b.item.find('input[type="hidden"]');jQuery(this);c.attr("name",c.attr("data-name"))}),jQuery("#optionsframework .section-social_buttons .tools-palette.connectedSortable").on("sortupdate",function(a,b){var c=b.item.find('input[type="hidden"]');c.removeAttr("name")}),jQuery("#optionsframework .section-sortable .connectedSortable").sortable({
connectWith:".connectedSortable",placeholder:"of-socbuttons-highlight",cancel:"li.ui-dt-sb-hidden"}).disableSelection(),jQuery("#optionsframework .section-sortable .content-holder.connectedSortable").on("sortupdate",function(a,b){var c=b.item.find('input[type="hidden"]'),d=jQuery(this);c.attr("name",d.attr("data-sortable-item-name"))}),jQuery("#optionsframework .section-sortable .tools-palette.connectedSortable").on("sortupdate",function(a,b){var c=b.item.find('input[type="hidden"]');c.removeAttr("name")}),window.The7Options.microwidgetSettingsPopup||(window.The7Options.microwidgetSettingsPopup={_vars:{tb_icon_bar_open:!1,tb_unload_binded:!1,origin_tb_position:null,microwidgetSettings:null,microwidgetSettingsContainer:null},_addEvents:function(){var b=this;a(".section-sortable .sortConfigIcon").on("click",function(c){c.preventDefault();var d=a(this).siblings("input").first().attr("value"),e=b._vars.microwidgetSettings=a("#microwidgets-"+d+"-block");b._vars.microwidgetSettingsContainer=e.parent(),b._vars.tb_icon_bar_open=!0;var f="presscore-microwidgets-settings",g=a("#"+f);g.length<=0&&(a("body").append('<div id="'+f+'" style="display: none;"><div id="optionsframework" class="presscore-modal-content"><div id="microwidget-settings-fields"></div></div></div>'),g=a("#"+f)),e.length>0&&a("#microwidget-settings-fields",g).append(e),tb_show(e.find("> h3").hide().text(),"#TB_inline?width=1024&height=768&inlineId="+f)})},_extendTBPosition:function(){var b=this;b._vars.origin_tb_position=tb_position,tb_position=function(){if(b._vars.tb_icon_bar_open){var c=a("#TB_window"),d=a(window).width(),e=20,f=840>d?d-10:840,g=function(b){return a(window).height()-2*b},h=g(e);c.hasClass("presscore-microwidget-modal")||c.addClass("presscore-microwidget-modal"),b._vars.tb_unload_binded||(b._vars.tb_unload_binded=!0,c.bind("tb_unload",function(){b._vars.tb_icon_bar_open=!1,b._vars.tb_unload_binded=!1,b._vars.microwidgetSettingsContainer.length>0&&b._vars.microwidgetSettingsContainer.append(b._vars.microwidgetSettings),a(window).off("resize.presscoreMicrowidgetsTB"),a(".submit-wrap .button-primary",c).off("click.presscoreMicrowidgetsTB")}),a(window).on("resize.presscoreMicrowidgetsTB",function(){var b=g(e);c.height(b),a(".presscore-modal-content",c).height(b-i-j)}),c.append('<div class="submit-wrap"><div class="optionsframework-submit"><a href="#closeTB" class="button-primary">Change and close</a><div class="clear"></div></div></div>'),a(".submit-wrap .button-primary",c).on("click.presscoreMicrowidgetsTB",function(a){tb_remove(),a.preventDefault()}));var i=a("#TB_title",c).height(),j=a(".submit-wrap",c).height();c.size()&&(c.width(f).height(h),a("#TB_ajaxContent",c).removeAttr("style"),c.css({left:parseInt((d-f)/2,10)+"px"}),"undefined"!=typeof document.body.style.maxWidth&&c.css({top:e+"px","margin-top":"0"}),a(".presscore-modal-content",c).height(h-i-j))}else b._vars.origin_tb_position()}},init:function(){this._extendTBPosition(),this._addEvents()}},window.The7Options.microwidgetSettingsPopup.init()),jQuery("#optionsframework #section-header-layout .controls input.of-radio-img-radio").on("click",function(a){var b=jQuery(this),c=b.parents(".section-block_begin");c.find(".of-js-hide.header-layout").hide(),b.prop("checked")&&c.find(".of-js-hide.header-layout-"+b.val()).show()}),jQuery("#optionsframework #section-header-layout .controls input:checked.of-radio-img-radio").trigger("click"),function(){var b=a(".header-overlay-elements-top_line-padding"),c=a(".header-overlay-elements-side_top_line"),d=c.parent().siblings(".sortable-field-title").first(),e=c.parents(".controls").first().find(".tools-palette"),f=a("#section-header-overlay-layout input.of-radio-img-radio");f.on("click",function(){"top_line"==a(this).val()?(b.slideDown(600),c.slideDown(600),d.slideDown(600)):(b.slideUp(600),c.slideUp(600),d.slideUp(600),c.find("li").appendTo(e).find("input").attr("name",""))}),f.filter("input:checked").trigger("click")}();var t=a(".dt-web-fonts");t.select2();var u={_XHR:null,_cache:{all:"",safe:"",web:""},_items:null,init:function(a){this._items=a,this._addEvents()},_addEvents:function(){var b=this;b._items.select2().on("select2:opening",function(c){var d=a(this),e=d.val(),f=d.data("fontsGroup");if(!b._XHR&&!d.data("fontsDone")){if(b._cache[f])return void d.html(b._cache[f]).data("fontsDone",!0).val(e);b._showSpinner(d,!0),b._XHR=a.ajax({method:"POST",url:ajaxurl,data:{action:"of_get_fonts",fontsGroup:f,_wpnonce:optionsframework.ajaxFontsNonce}}).done(function(a){b._XHR=null,a.success&&(b._cache[f]=a.data?a.data:"",d.html(b._cache[f]).data("fontsDone",!0).val(e),d.select2("open"),b._showSpinner(d,!1))}),c.preventDefault()}})},_showSpinner:function(a,b){a.data("select2Arrow")||a.data("select2Arrow",a.siblings(".select2").first().find(".select2-selection__arrow").first());var c=a.data("select2Arrow");b?c.addClass("spinner is-active"):c.removeClass("spinner is-active")}};u.init(t.filter("[data-fonts-group]"));var v=a("#optionsframework"),w=a("#optionsframework-metabox"),x=a("#submit-wrap"),y=(a("#wpfooter"),a("#optionsframework-wrap"));w.addClass("optionsframework-ready"),v.css({"padding-bottom":x.height()}),a("body").hasClass("the7-customizer")?(j(),l(),a("#optionsframework-wrap .nav-tab-wrapper > a").on("click",function(){j()})):(j(),k()),a(window).on("scroll",function(){k()}),a(window).on("resize",function(){j()}),a("#optionsframework-wrap").on("scroll",function(){l()}),a(".code-editor").each(function(){var b=window.The7Options.codeEditor(this);b&&a("body").on("the7.options.tabChange",function(){a(b.codemirror.getWrapperElement()).is(":hidden")||b.codemirror.refresh()}).on("the7.options.submit",function(){b.codemirror.save()})}),a('.sortable-element-title-val .controls input[type="text"]').on("change",function(){var b=a(this),c=b.val(),d=b.parents(".section-block").first(),e=d.attr("id").replace(/^microwidgets-(.*)-block$/,"$1"),f=a(".sortable-field-"+e+" .sortable-element-title");if(c)f.text(c),d.find(">h3").text(c);else{var g=f.attr("data-title");f.text(g),d.find(">h3").text(g)}}).trigger("change");var z={fontSelectorSection:null,fontSelector:null,headersSelectElementID:["#fonts-h1-typography-font_family","#fonts-h2-typography-font_family","#fonts-h3-typography-font_family","#fonts-h4-typography-font_family","#fonts-h5-typography-font_family","#fonts-h6-typography-font_family"],setup:function(){this.fontSelectorSection=a("#section-fonts-headers-font-family"),this.fontSelector=this.fontSelectorSection.find("#fonts-headers-font-family")},addHooks:function(){var b=this;b.fontSelector.on("change",function(c,d){if(b.fontSelectorSection.find(".dt-web-fonts-preview").slideDown(),"singleHeader"!==d){var e=a(this).val(),f=a(this).find("option:selected").text();b.headersSelectElementID.forEach(function(c){b.setSelectElementValue(a(c),e,f,"applyToAll")})}});var c=a(this.headersSelectElementID.join(", "));c.on("change",function(d,e){if("applyToAll"!==e){var f=a(this).val(),g=a.grep(c,function(b){return a(b).val()===f});if(g.length===c.length){var h=a(this).find("option:selected").text();b.setSelectElementValue(b.fontSelector,f,h,"singleHeader")}else b.dropHeadersFontSelector()}})},dropHeadersFontSelector:function(){this.fontSelectorSection.find("#select2-fonts-headers-font-family-container").attr("title","").text(""),this.fontSelector.val(""),this.fontSelectorSection.find(".dt-web-fonts-preview").slideUp()},setSelectElementValue:function(a,b,c,d){a.find('option[value="'+b+'"]').length||a.append('<option value="'+b+'">'+c+"</option>"),a.val(b).trigger("change",[d])}};z.setup(),z.addHooks(),a(z.headersSelectElementID[0]).trigger("change");var A={transformSelector:null,fontSelectorSection:null,headersTransformSelectorID:["#fonts-h1-typography-text_transform","#fonts-h2-typography-text_transform","#fonts-h3-typography-text_transform","#fonts-h4-typography-text_transform","#fonts-h5-typography-text_transform","#fonts-h6-typography-text_transform"],setup:function(){this.fontSelectorSection=a("#section-fonts-headers-font-family"),this.transformSelector=a("#fonts-headers-text-transform")},addHooks:function(){var b=this;b.transformSelector.on("change",function(c,d){var e=a(this).val();m(b.fontSelectorSection,{textTransform:e?"text-transform: "+e+";":""}),e&&"singleHeader"!==d&&b.headersTransformSelectorID.forEach(function(b){a(b).val(e).trigger("change",["applyToAll"])})});var c=a(b.headersTransformSelectorID.join(", "));c.on("change",function(d,e){if("applyToAll"!==e){var f=a(this).val(),g=a.grep(c,function(b){return a(b).val()===f}),h="";g.length===c.length&&(h=f),b.transformSelector.val(h).trigger("change",["singleHeader"])}})}};A.setup(),A.addHooks(),a(A.headersTransformSelectorID[0]).trigger("change"),window.The7Options.switch(a(".the7-option-switch")),a(".section-typography .text-transform .of-input").on("change",function(){var b=a(this),c=b.val();m(b.parents(".section-typography").first().find(".font-family"),{textTransform:c?"text-transform: "+c+";":""})}).trigger("change",["applyToAll"]),a(".section-typography .font-size .of-slider-value").on("change change.of-slider-slide",function(){var b=a(this);m(b.parents(".section-typography").first().find(".font-family"),{fontSize:"font-size: "+b.val()+"px;"})}).trigger("change"),a(".section-typography .line-height .of-slider-value").on("change change.of-slider-slide",function(){var b=a(this);m(b.parents(".section-typography").first().find(".font-family"),{lineHeight:"line-height: "+b.val()+"px;"})}).trigger("change")}}(jQuery),jQuery(function(a){window.the7OptionsBootstrap()}),jQuery(function(a){a(".section-background_img .of-radio-img-img").on("click",function(){var b=a(this).parents(".section-background_img"),c=a(this).attr("data-full-src"),d=(a(this).attr("src"),b.find(".upload-button")),e=b.find(".screenshot");b.find(".upload").val(c),b.find(".upload-id").val(0),e.find("img").length>0?(e.find("img").attr("src",c),e.show()):e.empty().append('<img src="'+c+'"><a class="remove-image">Remove</a>').slideDown("fast"),d.length>0&&(d.unbind().addClass("remove-file").removeClass("upload-button").val(optionsframework_l10n.remove),optionsframework_file_bindings(b)),b.find(".of-background-properties").slideDown()})}),jQuery(function(a){var b=a("#wp-admin-bar-view-desktop > a"),c=a("#wp-admin-bar-view-tablet > a"),d=a("#wp-admin-bar-view-mobile > a"),e=a("#the7-customizer-preview"),f=a("#wp-admin-bar-view-controls"),g=(a("#wp-admin-bar-the7-options-preview-switcher > a"),a("#wp-admin-bar-view"));switch($body=a("body"),b.on("click",function(){e.attr("class","desktop-view"),g.attr("class","menupop hover view-desktop"),wpCookies.set("the7-options-preview-device","desktop")}),c.on("click",function(){e.attr("class","tablet-view"),g.attr("class","menupop hover view-tablet"),wpCookies.set("the7-options-preview-device","tablet")}),d.on("click",function(){e.attr("class","mobile-view"),g.attr("class","menupop hover view-mobile"),wpCookies.set("the7-options-preview-device","mobile")}),f.on("click",function(){$body.toggleClass("hide-controls"),$body.hasClass("hide-controls")?f.removeClass("panel-shown").addClass("panel-hidden"):f.removeClass("panel-hidden").addClass("panel-shown")}),wpCookies.get("the7-options-preview-device")){case"tablet":e.attr("class","tablet-view");break;case"mobile":e.attr("class","mobile-view");break;default:e.attr("class","desktop-view")}a("#the7-customizer-preview").on("load",function(){wpCookies.set("the7-options-preview-url",document.getElementById("the7-customizer-preview").contentWindow.location.href)})}),function(a){"use strict";function b(){return a("input, textarea","#optionsframework-form").not('input[type="hidden"][name="_wp_http_referer"]').fieldSerialize()}var c=function(){function b(b,c){this.insertAfterObj=a(c),this.noticeID=b,this.noticeTplObj=a('<div id="'+b+'" class="settings-error notice"></div>')}return b.prototype.addError=function(b,c){return b?(a("html, body").animate({scrollTop:0},400),this.noticeTplObj.clone().html(b).addClass(c).insertAfter(this.insertAfterObj)):a()},b.prototype.removeErrors=function(){a("#"+this.noticeID).remove()},b.prototype.prepareMsg=function(a){return"<p><strong>"+a+"</strong></p>"},b}(),d=new c("optionsframework-options-saved","#optionsframework-wrap > h1"),e=function(){function a(a){this.buttonsObj=a,this.activeButton=null}return a.prototype.setActiveButton=function(a){this.activeButton=a?this.buttonsObj.filter(a):this.buttonsObj;var b=this.activeButton.attr("data-busy-value");b&&(this.activeButton.data("originValue",this.activeButton.val()),this.activeButton.val(b)),this.activeButton.addClass("active").focus(),this.buttonsObj.addClass("busy")},a.prototype.resetActiveButton=function(){return!!this.activeButton&&(this.activeButton.data("originValue")&&this.activeButton.val(this.activeButton.data("originValue")),this.activeButton.removeClass("active"),this.activeButton=null,this.buttonsObj.removeClass("busy"),!0)},a}(),f=new e(a("#optionsframework-submit input[type=submit]")),g=a("#optionsframework-submit input[type=submit][name=update]"),h=a("#optionsframework-submit input[type=submit][name=reset]"),i=!1;g.on("click",function(b){if(a(this).hasClass("busy"))return!1}),h.on("click",function(b){var c=a(this);return!c.hasClass("busy")&&(confirm(optionsframework.resetMsg)?(i=!0,f.setActiveButton(c),void d.removeErrors()):(b.preventDefault(),!1))}),a("#optionsframework-form").ajaxForm({url:ajaxurl,type:"post",beforeSerialize:function(){a("body").trigger("the7.options.submit")},beforeSubmit:function(a){a.find(function(a){return"update"===a.name})&&(f.setActiveButton(g),d.removeErrors())},success:function(a){try{if(a.data.msg&&(a.data.msg=d.prepareMsg(a.data.msg)),a.success){var c=d.addError(a.data.msg,"updated");setTimeout(function(){c.fadeOut()},5e3),j=b(),i&&window.location.reload(!0),a.data.redirectTo&&window.location.assign(a.data.redirectTo)}else d.addError(a.data.msg,"error");var e=document.getElementById("the7-customizer-preview");e&&e.contentWindow.location.reload(!0)}catch(b){d.addError(d.prepareMsg(optionsframework.serverErrorMsg),"error"),console.log(a,b)}f.resetActiveButton()},error:function(b){a.post({url:ajaxurl,data:{action:"get_the7_options_last_error"}}).done(function(a){try{d.addError(d.prepareMsg(a.data.msg),"error")}catch(b){d.addError(d.prepareMsg(optionsframework.serverErrorMsg),"error"),console.log(a,b)}}),f.resetActiveButton()}});var j=b();window.addEventListener("beforeunload",function(a){if(j!==b())return a.returnValue="Are you sure you want to leave?",a.returnValue})}(jQuery);