var Common = function () { var abortObjects = [], javaScriptInfoLoggingEnabled = !1, javaScriptTraceLoggingEnabled = !1; return { init: function () { Common.logInfo("Common.init..."), jQuery(document).delegate("ul.wpem-tabs-wrap li.wpem-tab-link", "click", Common.tabChanged), window.addEventListener("keydown", function (o) { 27 === o.keyCode && jQuery(".wpem-modal-close").length > 0 && jQuery(".wpem-modal-close").trigger("click") }), jQuery(".wpem-modal-button").click(function () { jQuery("body").addClass("wpem-modal-open"); var o = jQuery(this).attr("data-modal-id"); jQuery("#" + o).length > 0 && jQuery("#" + o).addClass("wpem-modal-open") }), jQuery(".wpem-modal-overlay").click(function () { jQuery("body").removeClass("wpem-modal-open"), jQuery(".wpem-modal").removeClass("wpem-modal-open") }), jQuery("#submit-organizer-form").submit(function (o) { jQuery("#submit-organizer-form").css("pointer-events", "none") }), jQuery("#submit-venue-form").submit(function (o) { jQuery("#submit-venue-form").css("pointer-events", "none") }), jQuery(".wpem-modal-close").click(function () { jQuery("body").removeClass("wpem-modal-open"), jQuery(".wpem-modal").removeClass("wpem-modal-open") }), jQuery(".wpem-listing-accordion").length > 0 && jQuery(".wpem-listing-accordion").click(function () { this.classList.toggle("active"); var o = this.nextElementSibling; "block" === o.style.display ? o.style.display = "none" : o.style.display = "block" }) }, tabChanged: function (o) { jQuery(this).addClass("active").parents("ul.wpem-tabs-wrap").find("li").not(jQuery(this)).removeClass("active"); var e = jQuery(this).data("tab"); jQuery(this).closest(".wpem-tabs-wrapper").find(".wpem-tab-content .wpem-tab-pane").not("#" + e).removeClass("active"), jQuery(this).closest(".wpem-tabs-wrapper").find(".wpem-tab-content .wpem-tab-pane#" + e).addClass("active") }, jsonToString: function (o) { return void 0 === o ? "" : JSON.stringify(o) }, stringToJson: function (jsonString) { if (Common.logInfo("stringToJson..."), void 0 !== jsonString && 0 !== jsonString.length) return eval("(" + jsonString + ")") }, getCurrentDateTime: function () { var o = new Date, e = o.getMonth() + 1; return o.getFullYear() + "-" + e + "-" + o.getDate() + " " + o.getHours() + ":" + o.getMinutes() + ":" + o.getSeconds() }, setLogValue: function (o) { void 0 !== o && 0 !== o.length && (javaScriptInfoLoggingEnabled = o) }, setTraceValue: function (o) { void 0 !== o && 0 !== o.length && (javaScriptTraceLoggingEnabled = o) }, logInfo: function (o) { javaScriptInfoLoggingEnabled && window.console && console.log(o) }, logTrace: function (o) { javaScriptTraceLoggingEnabled && window.console && console.log(o) }, logForce: function (o) { window.console && console.log(o) }, logError: function (o) { window.console && console.error(o) }, htmlEncode: function (o) { if (void 0 !== o && 0 !== o.length) return escape(o) }, htmlDecode: function (o) { if (void 0 !== o && 0 !== o.length) return unescape(o) }, validateEmail: function (o) { Common.logInfo("Common.validateEmail..."); return /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/.test(o) }, validatePincode: function (o) { Common.logInfo("Common.validatePincode..."); return /^[0-9]+$/.test(o) }, validateName: function (o) { Common.logInfo("Common.validateName..."); return /[A-Za-z \-_.\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/.test(o) }, isURL: function (o) { Common.logInfo("Common.isURL..."); var e = new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", "i"); return o.length < 2083 && e.test(o) }, showToggleContent: function (o) { Common.logInfo("Common.actions.showToggleContent..."), jQuery(this).toggleClass("wpem-active-button"), o.preventDefault() }, hideToggleContent: function (o) { Common.logInfo("Common.actions.hideToggleContent..."), o.preventDefault() } } }; Common = Common(), jQuery(document).ready(function (o) { Common.init() });