!function(t){formintorjs.define(["text!tpl/dashboard.html"],function(e){return Backbone.View.extend({className:"wpmudev-section--popup",popupTpl:Forminator.Utils.template(t(e).find("#forminator-apply-appearance-preset-tpl").html()),events:{"click #forminator-apply-preset":"applyPreset"},initialize:function(t){this.$target=t.$target},render:function(){this.$el.html(this.popupTpl({description:Forminator.Data.modules.ApplyPreset.description,notice:Forminator.Data.modules.ApplyPreset.notice,button:Forminator.Data.modules.ApplyPreset.button,selectbox:Forminator.Data.modules.ApplyPreset.selectbox}))},applyPreset:function(e){e.preventDefault(),e.stopImmediatePropagation();var o=t(e.target);o.addClass("sui-button-onload-text");var a=this.$target.data("form-id"),r=[],n=this.$el.find('select[name="appearance_preset"]').val();r=a?[a]:t("#forminator_bulk_ids").val().split(",");var i={action:"forminator_apply_appearance_preset",_ajax_nonce:Forminator.Data.modules.ApplyPreset.nonce,preset_id:n,ids:r};return t.ajax({url:Forminator.Data.ajaxUrl,type:"POST",data:i,success:function(t){t&&t.success?(Forminator.Notification.open("success",t.data,4e3),Forminator.Popup.close()):(Forminator.Notification.open("error",t.data,4e3),o.removeClass("sui-button-onload-text"))},error:function(t){Forminator.Notification.open("error",t.data,4e3),o.removeClass("sui-button-onload-text")}}),!1}})})}(jQuery);