1
function em_load_jquery_css(e=!1){if(EM.ui_css&&0==jQuery("link#jquery-ui-em-css").length){var t=document.createElement("link");t.id="jquery-ui-em-css",t.rel="stylesheet",t.href=EM.ui_css,document.body.appendChild(t),e&&em_setup_jquery_ui_wrapper()}
2
}
3
function em_setup_jquery_ui_wrapper(){0===jQuery("#em-jquery-ui").length&&jQuery("body").append('<div id="em-jquery-ui" class="em">')}
4
jQuery(document).ready((function(e){e("#recurrence-frequency").length>0&&(e("#recurrence-frequency").addClass("em-recurrence-frequency"),e(".event-form-when .interval-desc").each((function(){this.classList.add(this.id)}
5
)),e(".event-form-when .alternate-selector").each((function(){this.classList.add("em-"+this.id)}
6
)),e("#recurrence-interval").addClass("em-recurrence-interval")),e("#em-wrapper").addClass("em");var t=!1;if(e("#start-time").each((function(t,n){e(n).addClass("em-time-input em-time-start").next("#end-time").addClass("em-time-input em-time-end").parent().addClass("em-time-range")}
7
)),e(".em-time-input").length>0&&em_setup_timepicker("body"),e(".events-table").on("click",".em-event-delete",(function(){if(!confirm("Are you sure you want to delete?"))return!1;window.location.href=this.href}
8
)),e("#event-form #event-image-delete, #location-form #location-image-delete").on("click",(function(){var t=e(this);t.is(":checked")?t.closest(".event-form-image, .location-form-image").find("#event-image-img, #location-image-img").hide():t.closest(".event-form-image, .location-form-image").find("#event-image-img, #location-image-img").show()}
9
)),e(".event-form-with-recurrence").each((function(){let t=e(this);t.on("change",".em-recurrence-checkbox",(function(){this.checked?(t.find(".em-recurring-text").each((function(){this.style.removeProperty("display")}
10
)),t.find(".em-event-text").each((function(){this.style.setProperty("display","none","important")}
11
))):(t.find(".em-recurring-text").each((function(){this.style.setProperty("display","none","important")}
12
)),t.find(".em-event-text").each((function(){this.style.removeProperty("display")}
13
)))}
14
))}
15
)),e(".event-form-with-recurrence .em-recurrence-checkbox").trigger("change"),e("#event-form.em-event-admin-recurring").on("submit",(function(t){var n=e(this);if(1==n.find('input[name="event_reschedule"]').first().val())var i=EM.event_reschedule_warning;else if(1==n.find('input[name="event_recreate_tickets"]').first().val())i=EM.event_recurrence_bookings;else i=EM.event_recurrence_overwrite;confirmation=confirm(i),0==confirmation&&t.preventDefault()}
16
)),e(".em-reschedule-trigger").on("click",(function(t){t.preventDefault();var n=e(this);n.closest(".em-recurrence-reschedule").find(n.data("target")).removeClass("reschedule-hidden"),n.siblings(".em-reschedule-value").val(1),n.addClass("reschedule-hidden").siblings("a").removeClass("reschedule-hidden")}
17
)),e(".em-reschedule-cancel").on("click",(function(t){t.preventDefault();var n=e(this);n.closest(".em-recurrence-reschedule").find(n.data("target")).addClass("reschedule-hidden"),n.siblings(".em-reschedule-value").val(0),n.addClass("reschedule-hidden").siblings("a").removeClass("reschedule-hidden")}
18
)),e('select[name="event_active_status"]').on("change",(function(t){if("0"==e(this).val()){var n=EM.event_cancellations.warning.replace(/\\n/g,"\n");confirmation=confirm(n),0==confirmation&&t.preventDefault()}
19
}
20
)),e("#em-tickets-form").length>0){e("#event-rsvp").on("click",(function(t){this.checked?e("#event-rsvp-options").fadeIn():(confirmation=confirm(EM.disable_bookings_warning),0==confirmation?t.preventDefault():e("#event-rsvp-options").hide())}
21
)),e("input#event-rsvp").is(":checked")?e("div#rsvp-data").fadeIn():e("div#rsvp-data").hide();var n=function(){e("#em-tickets-form table tbody tr.em-tickets-row").show(),e("#em-tickets-form table tbody tr.em-tickets-row-form").hide()}
22
;e("#em-recurrence-checkbox").length>0?e("#em-recurrence-checkbox").on("change",(function(){e("#em-recurrence-checkbox").is(":checked")?(e("#em-tickets-form .ticket-dates-from-recurring, #em-tickets-form .ticket-dates-to-recurring, #event-rsvp-options .em-booking-date-recurring").show(),e("#em-tickets-form .ticket-dates-from-normal, #em-tickets-form .ticket-dates-to-normal, #event-rsvp-options .em-booking-date-normal, #em-tickets-form .hidden").hide()):(e("#em-tickets-form .ticket-dates-from-normal, #em-tickets-form .ticket-dates-to-normal, #event-rsvp-options .em-booking-date-normal").show(),e("#em-tickets-form .ticket-dates-from-recurring, #em-tickets-form .ticket-dates-to-recurring, #event-rsvp-options .em-booking-date-recurring, #em-tickets-form .hidden").hide())}
23
)).trigger("change"):e("#em-form-recurrence").length>0?(e("#em-tickets-form .ticket-dates-from-recurring, #em-tickets-form .ticket-dates-to-recurring, #event-rsvp-options .em-booking-date-recurring").show(),e("#em-tickets-form .ticket-dates-from-normal, #em-tickets-form .ticket-dates-to-normal, #event-rsvp-options .em-booking-date-normal, #em-tickets-form .hidden").hide()):e("#em-tickets-form .ticket-dates-from-recurring, #em-tickets-form .ticket-dates-to-recurring, #event-rsvp-options .em-booking-date-recurring, #em-tickets-form .hidden").hide(),e("#em-tickets-add").on("click",(function(t){t.preventDefault(),n();var o=e("#em-tickets-form table tbody");o.first(".em-ticket-template").find("input.em-date-input.flatpickr-input").each((function(){"_flatpickr"in this&&this._flatpickr.destroy()}
24
));var a=o.length+1,r=o.first(".em-ticket-template").clone(!0).attr("id","em-ticket-"+a).removeClass("em-ticket-template").addClass("em-ticket").appendTo(e("#em-tickets-form table"));r.find("*[name]").each((function(t,n){(n=e(n)).attr("name",n.attr("name").replace("em_tickets[0]","em_tickets["+a+"]"))}
25
));let s=r.find(".ticket-dates-from-normal").first();if(s.attr("data-until-id")){let e=s.attr("data-until-id").replace("-0","-"+a);s.attr("data-until-id",e),r.find(".ticket-dates-to-normal").attr("id",s.attr("data-until-id"))}
26
r.show().find(".ticket-actions-edit").trigger("click"),r.find(".em-time-input").off().each((function(e,t){"object"==typeof this.em_timepickerObj&&this.em_timepicker("remove")}
27
)),em_setup_datepicker(r),em_setup_timepicker(r),e("html, body").animate({scrollTop:r.offset().top-30}
28
),i()}
29
)),e(document).on("click",".ticket-actions-edit",(function(t){t.preventDefault(),n();var i=e(this).closest("tbody");return i.find("tr.em-tickets-row").hide(),i.find("tr.em-tickets-row-form").fadeIn(),!1}
30
)),e(document).on("click",".ticket-actions-edited",(function(t){t.preventDefault();var n=e(this).closest("tbody"),i=n.attr("id").replace("em-ticket-","");return n.find(".em-tickets-row").fadeIn(),n.find(".em-tickets-row-form").hide(),n.find("*[name]").each((function(t,o){if("ticket_start_pub"==(o=e(o)).attr("name"))n.find("span.ticket_start").text(o.val());else if("ticket_end_pub"==o.attr("name"))n.find("span.ticket_end").text(o.val());else if(o.attr("name")=="em_tickets["+i+"][ticket_type]")"members"==o.find(":selected").val()&&n.find("span.ticket_name").prepend("* ");else if(o.attr("name")=="em_tickets["+i+"][ticket_start_recurring_days]"){var a="before"==n.find("select.ticket-dates-from-recurring-when").val()?"-"+o.val():o.val();""!=o.val()?(n.find("span.ticket_start_recurring_days").text(a),n.find("span.ticket_start_recurring_days_text, span.ticket_start_time").removeClass("hidden").show()):(n.find("span.ticket_start_recurring_days").text(" - "),n.find("span.ticket_start_recurring_days_text, span.ticket_start_time").removeClass("hidden").hide())}
31
else if(o.attr("name")=="em_tickets["+i+"][ticket_end_recurring_days]"){a="before"==n.find("select.ticket-dates-to-recurring-when").val()?"-"+o.val():o.val();""!=o.val()?(n.find("span.ticket_end_recurring_days").text(a),n.find("span.ticket_end_recurring_days_text, span.ticket_end_time").removeClass("hidden").show()):(n.find("span.ticket_end_recurring_days").text(" - "),n.find("span.ticket_end_recurring_days_text, span.ticket_end_time").removeClass("hidden").hide())}
32
else{var r=o.attr("name").replace("em_tickets["+i+"][","").replace("]","").replace("[]","");n.find(".em-tickets-row ."+r).text(o.val())}
33
}
34
)),e(document).triggerHandler("em_maps_tickets_edit",[n,i,!0]),e("html, body").animate({scrollTop:n.parent().offset().top-30}
35
),!1}
36
)),e(document).on("change",".em-ticket-form select.ticket_type",(function(t){var n=e(this);"members"==n.find("option:selected").val()?n.closest(".em-ticket-form").find(".ticket-roles").fadeIn():n.closest(".em-ticket-form").find(".ticket-roles").hide()}
37
)),e(document).on("click",".em-ticket-form .ticket-options-advanced",(function(t){t.preventDefault();var n=e(this);n.hasClass("show")?(n.closest(".em-ticket-form").find(".em-ticket-form-advanced").fadeIn(),n.find(".show,.show-advanced").hide(),n.find(".hide,.hide-advanced").show()):(n.closest(".em-ticket-form").find(".em-ticket-form-advanced").hide(),n.find(".show,.show-advanced").show(),n.find(".hide,.hide-advanced").hide()),n.toggleClass("show")}
38
)),e(".em-ticket-form").each((function(){var t=!1,n=e(this);n.find('.em-ticket-form-advanced input[type="text"]').each((function(){""!=this.value&&(t=!0)}
39
)),n.find('.em-ticket-form-advanced input[type="checkbox"]:checked').length>0&&(t=!0),n.find(".em-ticket-form-advanced option:selected").each((function(){""!=this.value&&(t=!0)}
40
)),t&&n.find(".ticket-options-advanced").trigger("click")}
...
</html>