// source --> https://comfortzonetoronto.ca/wp-content/plugins/fat-event/assets/js/frontend/dist/fat-event.js?ver=5.0 
Number.prototype.format=function(t,a,e){a="\\d(?=(\\d{"+(a||3)+"})+"+(0<t?"\\.":"$")+")";return this.toFixed(Math.max(0,~~t)).replace(new RegExp(a,"g"),"$&"+e)};var FatEvent={};!function(C){FatEvent.init=function(){FatEvent.initIsotope(),FatEvent.initPopupGallery(),FatEvent.initFilter(),FatEvent.initPaging(),FatEvent.initCountdown(),FatEvent.initTimetable(),FatEvent.removeAutotop(),FatEvent.initPopupDetail(),FatEvent.initPopupShare(),FatEvent.initPopupBooking(),FatEvent.initTab(),C(".fat-event-sc.event-slide").each(function(){FatEvent.initCarousel(C(this))}),C(".fat-event-sc:not(.event-masonry)").each(function(){var t=C(this).closest(".fat-event-container");t.hasClass("has-animation")&&FatEvent.initAppearScroll(t)}),C("body").hasClass("single-fat-event")&&FatEvent.initPopupBooking(),C.isFunction(C.fn.fat_datetimepicker)&&C(".fat-event-date").each(function(){var t=C(this).attr("data-locale");void 0!==t&&""!=t&&C.datetimepicker.setLocale(t),C(this).fat_datetimepicker({datepicker:!0,timepicker:!1,format:"Y/m/d"})})},FatEvent.removeAutotop=function(){C("section.cd-container > p",".fat-maika-sc.event-timeline").remove()},FatEvent.initIsotope=function(){C.isFunction(C.fn.isotope)&&C(".fat-event-sc.event-masonry").each(function(){var t=C(this),a=C(this).closest(".fat-event-container"),e=".fat-col-md-"+t.attr("data-event-col");t.data("isotope")&&t.isotope("destroy"),a.on("arrangeComplete",function(){try{t.data("isotope")&&t.isotope("layout")}catch(t){}C(a).hasClass("has-animation")&&FatEvent.initAppearScroll(C(a))});var n,o=t.isotope({itemSelector:".fat-event-item",masonry:{columnWidth:e},percentPosition:!0,hiddenStyle:{opacity:0,transform:"translate3d(0, 100px, 0)"},visibleStyle:{opacity:1,transform:"translate3d(0, 0, 0)"},transitionDuration:"0.6s"}),i=0;o.imagesLoaded().progress(function(){n=150*++i;try{setTimeout(function(){o.isotope("layout")},n)}catch(t){}})})},FatEvent.initCarousel=function(n){C.isFunction(C.fn.owlCarousel)?(n.trigger("destroy.owl.carousel"),n.each(function(){var a=C(this),e=C.extend({},{items:4,nav:!1,navText:['<i class="fa fa-angle-left"></i> ',' <i class="fa fa-angle-right"></i>'],dots:!1,loop:!0,center:!1,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,autoplay:!1,autoplayTimeout:0,fluidSpeed:!1,dragEndSpeed:!1,autoplayHoverPause:!0},a.data("owl-options"));C(a).imagesLoaded(function(){a.owlCarousel(e);var t=n.closest(".fat-event-container");t.hasClass("has-animation")&&FatEvent.initAppearScroll(t)})})):FatEvent.showNotified('Owl Carousel library not found. Please do not check "Unload Owl-Carousel" in Fat Event -> Settings',8e3)},FatEvent.initTimetable=function(){C(".fat-event-container.event-timetable").each(function(){var o,t,a,e,n,i,s,p,r;C.isFunction(C.fn.fullCalendar)&&(r=(o=C(this)).attr("data-events"),t=o.attr("data-default-date"),a=o.attr("data-view"),e=o.attr("data-list-day"),n=o.attr("data-list-week"),i=o.attr("data-list-month"),s=o.attr("data-locale"),p="h:iA"===(p="H:i"===(p="h:ia"===(p=o.attr("data-single-time-format"))?"hh:mm a":p)?"HH:mm":p)?"hh:mm A":p,r={header:{left:"prev,next today",center:"title",right:"listDay,listWeek,month"},locale:s=void 0!==s||""==s?s:"en",defaultView:a,defaultDate:t,navLinks:!0,editable:!1,eventLimit:!0,events:r=C.parseJSON(r),timeFormat:p,eventClick:function(a){return a.url&&"single_window"==a.open_type?window.open(a.url+"?sd="+a.start.format("X")+"&ed="+a.end.format("X")):void 0!==FatEvent.isProcess&&0!=FatEvent.isProcess||(FatEvent.isProcess=1,FatEvent.showLoading(o,!0),C.ajax({url:fat_event_ajax.ajaxurl,type:"GET",data:{action:"fat_event_get_event_detail",id:a.id,s_date:a.start.format("X"),e_date:null!=a.end?a.end.format("X"):null},success:function(t){t=C.parseJSON(t),void 0!==a.time&&null!=a.time?t.time=a.time:void 0!==a.end&&null!=a.end?a.start.format("L")===a.end.format("L")?t.time=a.start.format(p)+" - "+a.end.format(p)+", "+a.start.format("MMM DD YYYY"):t.time=a.start.format(p+" MMM DD YYYY")+" - "+a.end.format(p+" MMM DD YYYY"):t.time=a.start.format(p+" MMM DD YYYY"),t.start_date=a.start.format("X"),t.end_date=null!=a.end?a.end.format("X"):"",FatEvent.showPopupDetail(t),void 0!==t.thumb&&""!=t.thumb||(C(".fat-event-popup-single").addClass("no-thumb"),C(".fat-event-popup-single .fat-event-popup-thumb img").hide()),FatEvent.closeLoading(o),FatEvent.isProcess=0},error:function(){FatEvent.closeLoading(o),FatEvent.isProcess=0}})),!1},viewRender:function(n,t){C(".fc-next-button, .fc-prev-button",o).on("click",function(){if(void 0===FatEvent.isProcess||0==FatEvent.isProcess){FatEvent.isProcess=1;var t=o.fullCalendar("getDate"),a=C(".fc-button-group .fc-button.fc-state-active",o),e=t.format("M");switch(e){case"1":e="Jan";break;case"2":e="Feb";break;case"3":e="Mar";break;case"4":e="Apr";break;case"5":e="May";break;case"6":e="Jun";break;case"7":e="Jul";break;case"8":e="Aug";break;case"9":e="Sep";break;case"10":e="Oct";break;case"11":e="Nov";break;case"12":e="Dec"}n=a.hasClass("fc-listDay-button")?"day":n,n=a.hasClass("fc-listWeek-button")?"listWeek":n,n=a.hasClass("fc-month-button")?"listDay":n,FatEvent.showLoading(o),C.ajax({url:fat_event_ajax.ajaxurl,type:"GET",data:{action:"fat_event_get_timetable",sc_id:o.attr("data-sc-id"),sc_category:o.attr("data-sc-cat"),sc_organizer:o.attr("data-sc-organizer"),month:e,year:t.format("Y"),view:n},success:function(t){t=C.parseJSON(t),o.fullCalendar("removeEvents"),o.fullCalendar("addEventSource",t),o.fullCalendar("rerenderEvents"),FatEvent.closeLoading(o),FatEvent.isProcess=0},error:function(){FatEvent.closeLoading(o),FatEvent.isProcess=0}})}})},views:{}},void 0!==e&&""!=e&&(r.views.listDay={buttonText:e}),void 0!==n&&""!=n&&(r.views.listWeek={buttonText:n}),void 0!==i&&""!=i&&(r.views.month={buttonText:i}),o.fullCalendar(r))})},FatEvent.initPopupGallery=function(){C.isFunction(C.fn.lightGallery)&&(C("a.fat-event-view-video").off("click").on("click",function(){var t=C(this),a=[];a.push({src:t.attr("data-video"),subHtml:"<h4>"+t.attr("data-title")+"</h4>",w:900,h:600}),t.lightGallery({downloadUrl:!1,download:!1,share:!1,dynamic:!0,dynamicEl:a,hash:!1}).on("onAfterOpen.lg",function(t,a){C(".lg-thumb-outer").css("opacity","0"),setTimeout(function(){C(".lg-has-thumb").removeClass("lg-thumb-open"),C(".lg-thumb-outer").css("opacity","1")},700)})}),C("a.fat-event-view-gallery").off("click").on("click",function(){var a=C(this),e=a.closest(".fat-event-container"),t=a.attr("data-event-id");FatEvent.showLoading(e,!0),C.ajax({url:fat_event_ajax.ajaxurl,type:"GET",data:{action:"fat_event_get_gallery",id:t},success:function(t){FatEvent.closeLoading(e),a.lightGallery({downloadUrl:!1,download:!1,share:!1,dynamic:!0,dynamicEl:JSON.parse(t),hash:!1}).on("onAfterOpen.lg",function(t,a){C(".lg-thumb-outer").css("opacity","0"),setTimeout(function(){C(".lg-has-thumb").removeClass("lg-thumb-open"),C(".lg-thumb-outer").css("opacity","1")},700)})},error:function(){FatEvent.closeLoading(e)}})}))},FatEvent.initFilter=function(){setTimeout(function(){C("#fat-event-filter-location").val(0),C("#fat-event-filter-organizer").val(0),C("#fat-event-filter-category").val(0)},500),C(".fat-event-filter-container select, .fat-event-filter-container input").on("change",function(t){var a=C(this).closest(".fat-event-container");C(".fat-event-sc",a).css("opacity",0),FatEvent.showLoading(a),C.ajax({url:fat_event_ajax.ajaxurl,type:"GET",data:{action:"fat_event_filter",sc_id:a.attr("data-sc-id"),date:void 0!==C("#fat-event-date",a).val()?C("#fat-event-date",a).val():"",name:C("#fat-event-filter-name",a).val(),tag:C("#fat-event-filter-tag").val(),category:C("#fat-event-filter-category",a).val(),location:C("#fat-event-filter-location",a).val(),organizer:C("#fat-event-filter-organizer",a).val(),current_page:1,layout:a.attr("data-layout")},success:function(t){FatEvent.closeLoading(a),"table"==a.attr("data-layout")?FatEvent.bindTableItem(a,t):FatEvent.bindItem(a,t)},error:function(){FatEvent.closeLoading(a),C(".fat-event-sc",a).css("opacity",1)}})}),C(".fat-event-filter-container ul.fat-event-filter a").off("click").on("click",function(t){t.preventDefault();var a=C(this).closest(".fat-event-container"),t=C(this).closest(".fat-event-filter");return C(".fat-event-sc",a).css("opacity",0),FatEvent.showLoading(a),C("a.active",t).removeClass("active"),C(this).addClass("active"),C.ajax({url:fat_event_ajax.ajaxurl,type:"GET",data:{action:"fat_event_filter",sc_id:a.attr("data-sc-id"),date:void 0!==C("#fat-event-date",a).val()?C("#fat-event-date",a).val():"",name:"",tag:"",category:C("a.fat-event-filter-category.active",a).attr("data-value"),location:C("a.fat-event-filter-location.active",a).attr("data-value"),organizer:C("a.fat-event-filter-organizer.active",a).attr("data-value"),current_page:1,layout:a.attr("data-layout")},success:function(t){FatEvent.closeLoading(a),"table"==a.attr("data-layout")?FatEvent.bindTableItem(a,t):FatEvent.bindItem(a,t)},error:function(){FatEvent.closeLoading(a),C(".fat-event-sc",a).css("opacity",1)}}),!1})},FatEvent.initCountdown=function(){C(".fat-event-sc.event-countdown .fat-event-cd-inner").each(function(){var a,t;C.isFunction(C.fn.countdown)?(a=C(this),C(this).closest(".fat-event-sc"),void 0!==(t=a.attr("data-start"))&&""!==t&&a.countdown(t,function(t){FatEvent.countdown_callback(t,a)}).on("update.countdown",function(t){FatEvent.countdown_callback(t,a)}).on("finish.countdown",function(t){C(".countdown-seconds",a).html("00")})):FatEvent.showNotified("Countdown library not found.",8e3)})},FatEvent.countdown_callback=function(t,a){var e=9<(e=parseInt(t.offset.seconds))?e:"0"+e,n=9<(n=parseInt(t.offset.minutes))?n:"0"+n,o=9<(o=parseInt(t.offset.hours))?o:"0"+o,t=9<(t=parseInt(t.offset.totalDays))?t:"0"+t;0<C(".fat-event-cd-second",a).length&&C(".fat-event-cd-second",a).html(e),0<C(".fat-event-cd-minute",a).length&&C(".fat-event-cd-minute",a).html(n),0<C(".fat-event-cd-hour",a).length&&C(".fat-event-cd-hour",a).html(o),0<C(".fat-event-cd-day",a).length&&C(".fat-event-cd-day",a).html(t)},FatEvent.bindItem=function(t,a,e){var n=C(".fat-event-sc",t),o=C(".fat-event-item",a),i=C(".fat-paging-navigation-wrap",a),s=C(".fat-paging-navigation-wrap a",t).hasClass("fat-event-load-more"),a=(C(".fat-event-item:last-child",t),(s?C(".fat-paging-navigation-wrap",t):t.closest(".fat-event-container")).offset().top);C(".fat-paging-navigation-wrap",t).remove(),void 0!==e&&0!=e||(n.data("isotope")&&C(n).isotope("destroy"),C(n).empty()),C(n).css("opacity",1),C(n).append(o),n.hasClass("event-slide")&&FatEvent.initCarousel(n),n.hasClass("event-masonry")?(s?C("html,body").animate({scrollTop:a-150},300):(a-=C("header").hasClass("fusion-is-sticky")?C("header div.fusion-header").height():0,a-=0<C("#wpadminbar").length?C("#wpadminbar").height():0,C("html,body").animate({scrollTop:a},300)),FatEvent.initIsotope(),FatEvent.initPopupGallery()):C(".fat-event-sc:not(.event-masonry)").each(function(){var t=C(this).closest(".fat-event-container");t.hasClass("has-animation")&&FatEvent.initAppearScroll(t)}),0<i.length&&(C(t).append(i),FatEvent.initPaging()),FatEvent.initPopupDetail()},FatEvent.bindTableItem=function(t,a){C("table tbody tr",t).remove(),C("table tbody",t).append(C("tbody tr",a)),C(".fat-event-sc",t).css("opacity",1),FatEvent.initPopupDetail()},FatEvent.initPaging=function(){C("a.page-numbers, .fat-paging-navigation-wrap a.fat-event-load-more, .fat-paging-navigation-wrap a.fat-event-infinite-scroll",".fat-event-container").off("click").on("click",function(t){t.preventDefault();var a=C(this).closest(".fat-event-container"),e=C(".fat-paging-navigation-wrap",a),t=1,n=!1;return C(this).hasClass("page-numbers")&&void 0!==C(this).attr("href")&&(t=FatEvent.getPageNumberFromHref(C(this).attr("href"))),(C(this).hasClass("fat-event-load-more")||C(this).hasClass("fat-event-infinite-scroll"))&&(t=parseInt(C(this).attr("data-next-page")),n=!0),C(".fat-paging-navigation-wrap .paging-navigation",a).css("opacity",0),FatEvent.showLoading(e),C.ajax({url:fat_event_ajax.ajaxurl,type:"GET",data:{action:"fat_event_filter",sc_id:a.attr("data-sc-id"),category:void 0!==a.attr("data-sc-cat")&&""!=a.attr("data-sc-cat")?a.attr("data-sc-cat"):C("#fat-event-filter-category",a).val(),location:C("#fat-event-filter-location",a).val(),organizer:void 0!==a.attr("data-sc-organizer")&&""!=a.attr("data-sc-organizer")?a.attr("data-sc-organizer"):C("#fat-event-filter-organizer",a).val(),current_page:t,layout:a.attr("data-layout")},success:function(t){FatEvent.closeLoading(e),FatEvent.bindItem(a,t,n)},error:function(){FatEvent.closeLoading(e),C(".fat-paging-navigation-wrap .paging-navigation",a).css("opacity",1)}}),!1})},FatEvent.initPopupDetail=function(){C('.fat-event-sc a[data-open-type="popup_modal"]').off("click").on("click",function(t){t.preventDefault();var a=C(this),e=a.closest(".fat-event-container"),n=a.closest(".fat-event-item"),o=n.attr("data-event-id"),t=n.attr("data-time"),i=n.attr("data-single-time"),s=a.attr("data-s"),p=a.attr("data-e");return void 0!==i&&0!=n.length&&void 0!==t&&void 0!==o||(o=void 0!==a.attr("data-event-id")?a.attr("data-event-id"):o,t=void 0!==a.attr("data-time")?a.attr("data-time"):t,a.attr("data-single-time"),i=a.attr("data-single-time"),a.closest(".fat-event-sc"),e=a.closest(".fat-event-sc")),FatEvent.showLoading(e,!0),C.ajax({url:fat_event_ajax.ajaxurl,type:"GET",data:{action:"fat_event_get_event_detail",id:o,s_date:s,e_date:p},success:function(t){(t=C.parseJSON(t)).time=i,t.start_date=s,t.end_date=p,t.email_location="";for(var a=0;a<t.location.length;a++)t.email_location+=""==t.email_location?t.location[a].location:". "+t.location[a].location;FatEvent.showPopupDetail(t),void 0!==t.thumb&&""!=t.thumb||(C(".fat-event-popup-single").addClass("no-thumb"),C(".fat-event-popup-single .fat-event-popup-thumb img").hide()),FatEvent.closeLoading(e),FatEvent.isProcess=0},error:function(){FatEvent.closeLoading(e),FatEvent.isProcess=0}}),!1})},FatEvent.initPopupBooking=function(){C("a.fat-event-register").off("click").on("click",function(t){var a=C(this).attr("data-payment");if(void 0!==a&&"external_link"==a)return!0;t.preventDefault();var o=C(this),e=wp.template("fat-event-popup-booking-template"),i=o.attr("data-id"),s=o.attr("data-start"),p=o.attr("data-end"),r=o.attr("data-fees-type"),n=o.attr("data-fees-package"),l=o.attr("data-ticket-class"),d=C(this).attr("data-fees"),c=C(".fat-event-fees-info","").attr("data-decimal"),v=C(".fat-event-fees-info","").attr("data-separator"),a=o.attr("data-location"),t=o.attr("data-amenities"),v=void 0===v||""==v?".":v,f={locations:"",amenities:""};if(void 0!==a&&(f.locations=C.parseJSON(a),f.locations=1<f.locations.length?f.locations:""),void 0!==t&&(f.amenities=C.parseJSON(t)),h=C(e(f)),d=isNaN(d)?0:parseFloat(d),1==fat_event_ajax.woocommerce_intergrated){if("ticket_class"==r||"package"==r)C("select#ticket_class").off("change").on("change",function(){var t=C("option:selected",this),a=parseInt(t.attr("data-seat")),e=C("select#ticket_number");e.empty();for(var n=1;n<=a;n++)e.append('<option value="'+n+'">'+n+"</option>")}),C("select#ticket_class").trigger("change"),C(".fat-event-price-variable").slideDown(),C("a.fat-bt-submit-to-WC").off("click").on("click",function(){var t=C("select#ticket_number").val(),a=C("select#ticket_class"),e=a.val(),n=C("option:selected",a),a=n.attr("data-class"),n=("ticket_class"==r?n:C("select#ticket_number option:selected")).attr("data-seat");FatEvent.addToWooCart(o,i,s,p,f,t,e,a,n)});else{var u=C("select#ticket_number"),m=parseInt(u.attr("data-seat"));u.empty();for(var g=1;g<=m;g++)u.append('<option value="'+g+'">'+g+"</option>");C(".fat-event-price-variable").slideDown(),C("a.fat-bt-submit-to-WC").off("click").on("click",function(){var t=C("select#ticket_number").val(),a=C("select#ticket_number").attr("data-seat");FatEvent.addToWooCart(o,i,s,p,f,t,"","",a)})}C(".fat-event-single").trigger("change")}else{C.isFunction(C.fn.selectize)&&C("#optCountry, #optLocation",h).selectize({plugins:["remove_button","drag_drop"],searchField:"text",delimiter:",",persist:!1}),C.isFunction(C.fn.datetimepicker)&&C(".fat-event-date-field",h).each(function(){C(this).datetimepicker({datepicker:!0,formatDate:"Y/m/d",format:"Y/m/d",timepicker:!1})}),C("body .fat-event-popup-modal.booking-popup").remove(),C("body").append(h),C(".fat-event-popup-modal.booking-popup a.fat-close-popup,.fat-event-popup-modal.booking-popup a.fat-popup-bt-cancel").on("click",function(){C("body .fat-event-popup-modal.booking-popup").remove(),C("body").removeClass("hide-overflow")});var e=C(".g-recaptcha",".fat-event-popup-modal.booking-popup"),h={sitekey:e.attr("data-sitekey"),theme:"light"};if(0<e.length&&grecaptcha.render(e[0],h),""!=r&&"package"==r&&""!=n&&0<JSON.parse(n).length){var b=JSON.parse(n),n=C('label[for="numQuantity"]',".fat-event-popup-modal.booking-popup"),k=C(".fat-event-popup-modal.booking-popup"),y=C(n).attr("data-package-title"),F=k.attr("data-currency-symbol"),E=k.attr("data-symbol-position");C("#numQuantity",".fat-event-popup-modal.booking-popup").val(b[0].quantity),d=parseFloat(b[0].fees),C(n).html(C(n).attr("data-package-title")),C(".fat-event-fees-info",".fat-event-popup-modal.booking-popup").addClass("fat-hidden-field"),C(n).closest(".fat-popup-field").removeClass("fat-popup-field-half-size");for(var w='<select id="numQuantity">',g=0;g<b.length;g++)w+="prefix"==E?'<option value="'+b[g].quantity+'">'+b[g].quantity+" "+y+" - "+F+b[g].fees+"</option>":'<option value="'+b[g].quantity+'">'+b[g].quantity+" "+y+" - "+b[g].fees+F+"</option>";w+="</select>";n=C("#numQuantity",".fat-event-popup-modal.booking-popup").closest(".fat-popup-field");C("#numQuantity",".fat-event-popup-modal.booking-popup").remove(),n.append(w)}if(""!=r&&"ticket_class"==r&&0<JSON.parse(l).length){C(".fat-popup-field.fat-event-quantity-info,.fat-popup-field.fat-event-fees-info",".fat-event-popup-modal.booking-popup").removeClass("fat-popup-field-half-size").addClass("fat-popup-field-ticket-class-size"),C(".fat-popup-field.fat-event-ticket-class-info",".fat-event-popup-modal.booking-popup").removeClass("fat-hidden-field");for(var _="",F=(k=C(".fat-event-popup-modal.booking-popup")).attr("data-currency-symbol"),E=k.attr("data-symbol-position"),x=C('select[name="optTicketClass"]',".fat-popup-field.fat-event-ticket-class-info"),l=JSON.parse(l),g=0;g<l.length;g++)_='<option value="'+l[g].class_id+'" data-fees="'+l[g].fees+'">'+l[g].class+" - ",_+="prefix"==E?F+l[g].fees:l[g].fees+F,"0"!=l[g].seat&&""!=l[g].seat&&(_+=" ("+l[g].seat_label+":"+l[g].seat+")"),x.append(_),0==g&&(d=parseFloat(l[g].fees));x.on("change",function(){FatEvent.calculatorPrice()})}C("a.fat-popup-bt-submit",".fat-event-popup-modal.booking-popup").attr("data-id",i),C("a.fat-popup-bt-submit",".fat-event-popup-modal.booking-popup").attr("data-start",s),C("a.fat-popup-bt-submit",".fat-event-popup-modal.booking-popup").attr("data-end",p),C("a.fat-popup-bt-submit",".fat-event-popup-modal.booking-popup").attr("data-fees",d),C("span.fat-event-fees",".fat-event-popup-modal.booking-popup").html(d.format(c,3,v)),C("span.fat-event-total-fees",".fat-event-popup-modal.booking-popup").html(d.format(c,3,v)),0==d?(C(".fat-event-fees-info",".fat-event-popup-modal.booking-popup").hide(),C(".fat-payment-method",".fat-event-popup-modal.booking-popup").hide()):(C(".fat-event-fees-info",".fat-event-popup-modal.booking-popup").show(),C(".fat-payment-method",".fat-event-popup-modal.booking-popup").show()),0<d&&FatEvent.initStripeCardInput(),FatEvent.processBooking(),FatEvent.processApplyCoupon(),FatEvent.initPopupBookingScroll(),C(window).resize(function(){FatEvent.initPopupBookingScroll()})}return!1})},FatEvent.processBooking=function(){C("#numQuantity",".fat-event-popup-modal.booking-popup").on("change",function(){FatEvent.calculatorPrice()}),C("input[required], textarea[require], select[required]",".fat-event-popup-modal.booking-popup").on("change",function(){""!=C(this).val()&&C(this).removeClass("fat-error-field")}),C('input[type="email"]',".fat-event-popup-modal.booking-popup").on("change",function(){""==C(this).val()||/\S+@\S+\.\S+/.test(C(this).val())&&C(this).removeClass("fat-error-field")}),C(".fat-event-radio-group[required],.fat-event-checkbox-group[required]",".fat-event-popup-modal.booking-popup").on("change",function(){void 0===C("input:checked",this).val()?C(this).addClass("fat-error-field"):C(this).removeClass("fat-error-field")}),C("a.fat-popup-bt-submit",".fat-event-popup-modal.booking-popup").off("click").on("click",function(){var n=C(this),o=n.closest(".fat-event-popup-modal"),i=(C('input[data-map-field="first_name"]',o).val(),C('input[data-map-field="last_name"]',o).val(),C('input[data-map-field="email"]',o).val(),C('input[data-map-field="phone"]',o).val(),C('input[data-map-field="address"]',o).val(),C("#numQuantity",o).val()),s=(C('input[data-map-field="address"]',o).val(),C('select[data-map-field="gender"]').val(),C('input[data-map-field="department"]').val(),C('input[data-map-field="company"]').val(),C('select[data-map-field="country"]').val(),C('select[name="paymentType"]').val()),t=C("select#optLocation").val(),a=[],e=!0,p=n.attr("data-id"),r=n.attr("data-fees"),l="";C(".fat-popup-error-message",o).empty();var d,c,v;C('input[type="email"]',".fat-event-popup-modal.booking-popup").each(function(){""!=C(this).val()&&(/\S+@\S+\.\S+/.test(C(this).val())?C(this).removeClass("fat-error-field"):(e=!1,C(this).addClass("fat-error-field"),void 0!==C(this).attr("data-error")&&""!==C(this).attr("data-error")&&(l+=C(this).attr("data-error")+"<br/>")))}),C("input[required], textarea[require], select[required]",".fat-event-popup-modal.booking-popup").each(function(){""!=C(this).val()?C(this).removeClass("fat-error-field"):(e=!1,C(this).addClass("fat-error-field"),void 0!==C(this).attr("data-error")&&""!==C(this).attr("data-error")&&(l+=C(this).attr("data-error")+"<br/>"))}),C(".fat-event-radio-group[required],.fat-event-checkbox-group[required]",".fat-event-popup-modal.booking-popup").each(function(){void 0===C("input:checked",this).val()?(C(this).addClass("fat-error-field"),e=!1,void 0!==C(this).attr("data-error")&&""!==C(this).attr("data-error")&&(l+=C(this).attr("data-error")+"<br/>")):C(this).removeClass("fat-error-field")}),C('.fat-popup-field.amenities-field input[name="amenities"]',".fat-event-popup-modal.booking-popup").each(function(){C(this).prop("checked")&&a.push(C(this).val())}),e?(v={},d=null!=C('select[name="optTicketClass"]').val()?C('select[name="optTicketClass"]').val():"",v=o.hasClass("booking-form-builder")?(c={},C(".fat-event-field-builder").each(function(){void 0!==C(this).attr("name")&&(void 0!==C(this).attr("data-map-field")&&""!=C(this).attr("data-map-field")&&"none"!=C(this).attr("data-map-field")?c[C(this).attr("data-map-field")]={name:C(this).attr("name"),label:C(this).attr("data-label"),value:C(this).val()}:c[C(this).attr("name")]={name:C(this).attr("name"),label:C(this).attr("data-label"),value:C(this).val()})}),C(".fat-event-radio-group,.fat-event-checkbox-group").each(function(){var t=C(this),a=[];void 0!==C("input:checked",t).val()&&(C("input",t).each(function(){C(this).is(":checked")&&a.push(C(this).val())}),void 0!==C(this).attr("data-map-field")&&""!=C(this).attr("data-map-field")&&"none"!=C(this).attr("data-map-field")?c[C(this).attr("data-map-field")]={name:C(this).attr("name"),label:C(this).attr("data-label"),value:a}:c[C(this).attr("name")]={name:C(this).attr("name"),label:C(this).attr("data-label"),value:a})}),{action:"fat_event_booking",id:p,data_form:c,quantity:i,paymentType:s,start_date:n.attr("data-start"),end_date:n.attr("data-end"),location:t,amenities:a,url:window.location.href,coupon:void 0!==C("#txtCoupon",".booking-popup").val()?C("#txtCoupon",".booking-popup").val():"",ticket_class:d}):{action:"fat_event_booking",id:p,firstName:C("input#txtFirstName",o).val(),lastName:C("input#txtLastName",o).val(),phone:C("input#txtPhone",o).val(),email:C("input#txtEmail",o).val(),quantity:i,note:C("#txtNote",o).val(),address:C("#txtAddress",o).val(),gender:C("#optGender",o).val(),department:C("#txtDepartment",o).val(),company:C("#txtCompany",o).val(),country:C("#optCountry",o).val(),paymentType:s,start_date:n.attr("data-start"),end_date:n.attr("data-end"),location:t,amenities:a,url:window.location.href,coupon:void 0!==C("#txtCoupon",".booking-popup").val()?C("#txtCoupon",".booking-popup").val():"",ticket_class:d},"stripe"===s&&0<r?C("button","form#stripe-payment-form").trigger("click"):(FatEvent.showLoading(n,!0),C.ajax({url:fat_event_ajax.ajaxurl,type:"POST",data:v,success:function(t){var a,e;t=C.parseJSON(t),(FatEvent.isProcess=0)<t.code?"myPOS"==s?((o=C(t.form)).hide(),C("body").append(o),C("form#ipcForm").submit()):"paypal"==s&&void 0!==t.url&&""!=t.url?window.location.href=t.url:(C.ajax({url:fat_event_ajax.ajaxurl,type:"POST",data:{action:"fat_event_booking_sendmail",id:t.code}}),FatEvent.closeLoading(n),C("body .fat-event-popup-modal").remove(),void 0!==t.message&&FatEvent.showPopupMessage(t.message),""==d?(e=(a=C(".fat-event-seats-available strong")).html(),isNaN(e)||(0<=(e=parseInt(e))-i?a.html(e-i):a.html(0))):(e=(a=C('.fat-event-seats-available[data-ticket-id="'+d+'"]',".fat-event-fees-package")).attr("data-seats"),isNaN(e)||(0<=(e=parseInt(e))-i?(C("span",a).html(e-i),a.attr("data-seats",e-i)):(C("span",a).html(0),a.attr("data-seats",0))))):(FatEvent.closeLoading(n),C(".fat-popup-error-message",o).append(t.message+"</br>"))},error:function(){FatEvent.closeLoading(n),FatEvent.isProcess=0}}))):(C(".fat-popup-error-message",o).append(l),FatEvent.initPopupBookingScroll())})},FatEvent.processApplyCoupon=function(){C("a.bt-apply-coupon",".fat-event-popup-booking").off("click").on("click",function(){var a=C(this),t=C("#txtCoupon",".fat-event-popup-booking").val(),e=C(".fat-popup-bt-submit",".fat-event-popup-booking"),n=e.attr("data-fees"),e=e.attr("data-id");1!=FatEvent.isProcess&&""!=t&&(n=parseFloat(n)*parseFloat(C("#numQuantity",".fat-event-popup-booking").val()),FatEvent.showLoading(a,!0),FatEvent.isProcess=1,C.ajax({url:fat_event_ajax.ajaxurl,type:"POST",data:{action:"fat_event_apply_coupon",coupon:t,event_id:e,total_spend:n,currency:a.attr("data-currency"),symbol_position:C(".fat-event-fees-info",".fat-event-popup-booking").attr("data-symbol-position")},success:function(t){t=C.parseJSON(t),FatEvent.isProcess=0,FatEvent.closeLoading(a),C(".fat-coupon-wrap .fat-coupon-error-message").remove(),C(".fat-coupon-wrap .fat-coupon-discount-message").remove(),0<t.code?(a.attr("data-discount-type",t.discount_type),a.attr("data-discount-amount",t.amount),C(".fat-coupon-wrap").append('<div class="fat-coupon-discount-message">'+t.discount_message+"</div>"),FatEvent.calculatorPrice()):C(".fat-coupon-wrap").append('<div class="fat-coupon-error-message">'+t.message+"</div>")},error:function(){FatEvent.closeLoading(a),FatEvent.isProcess=0}}))}),C("#txtCoupon",".fat-event-popup-booking").on("change",function(){var t=C("a.bt-apply-coupon",".fat-event-popup-booking");t.attr("data-discount-type",""),t.attr("data-discount-amount",0),C(".fat-coupon-wrap .fat-coupon-error-message").remove(),C(".fat-coupon-wrap .fat-coupon-discount-message").remove(),C(".fat-event-discount",".fat-event-popup-booking").html(""),FatEvent.calculatorPrice()})},FatEvent.initPopupBookingScroll=function(){setTimeout(function(){var t,a,e,n;0<C(".fat-event-popup-booking .fat-popup-fields").length&&(C(".fat-event-popup-booking .fat-popup-fields").css("height","auto"),t=C(".fat-event-popup-booking .fat-popup-fields").outerHeight(!0),a=C(".fat-popup-title h4").outerHeight(!0),e=C(".fat-popup-footer").outerHeight(!0),n=C(".fat-event-popup-modal .fat-event-popup-inner").outerHeight(!0),t=parseFloat(t),a=parseFloat(a),e=parseFloat(e),t=t<(n=parseFloat(n))-a-e-30?t:n-a-e-30,C(".fat-event-popup-booking .fat-popup-fields").css("height",t+"px"),new PerfectScrollbar(C(".fat-event-popup-booking .fat-popup-fields")[0],{wheelSpeed:2,wheelPropagation:!0,minScrollbarLength:20}))},500)},FatEvent.showPopupDetail=function(t){void 0!==t.latitude&&2==t.latitude.split(",").length?t.direction="https://www.google.com/maps/dir/?api=1&destination="+t.latitude.split(",")[0]+","+t.latitude.split(",")[1]:t.direction="javascript:;";var a=wp.template("fat-event-popup-template"),e=C(a(t));e.addClass("fat-event-popup-single"),0==t.enable_booking&&""==t.organizer&&0<t.hourly_schedule.length&&""==t.hourly_schedule[0].from&&0==C(".fat-event-share",e).length&&e.addClass("hide-col-right");var n,a=C(".fat-event-export-ical",e).attr("href");a+="&id="+t.id+"&s_date="+t.start_date+"&e_date="+t.end_date,C(".fat-event-export-ical",e).attr("href",a),C("body .fat-event-popup-modal").remove(),C("body").append(e),"object"==typeof t.fees_package&&(n=JSON.stringify(t.fees_package),C("a.fat-event-register",".fat-event-popup-modal").attr("data-fees-package",n)),"object"==typeof t.amenities&&C("a.fat-event-register",".fat-event-popup-modal").attr("data-amenities",JSON.stringify(t.amenities)),"object"==typeof t.location&&C("a.fat-event-register",".fat-event-popup-modal").attr("data-location",JSON.stringify(t.location)),C("body .fat-event-popup-modal").imagesLoaded().progress(function(){FatEvent.initPopupScroll(),C(window).resize(function(){setTimeout(function(){FatEvent.initPopupScroll()},200)}),FatEvent.initPopupShare()}),0<C(".fat-event-popup-single select#ticket_number").length&&(n="0"==t.seats?15:t.seats,C(".fat-event-popup-single select#ticket_number").attr("data-seat",n)),FatEvent.initPopupBooking(),C(".fat-event-popup-single").addClass("event-"+t.id),C("a.fat-close-popup",".fat-event-popup-modal").on("click",function(){C("body .fat-event-popup-modal").remove()})},FatEvent.initPopupScroll=function(){C(".fat-event-popup-content-wrap").css("height","auto");var t=C(".fat-event-popup-single .fat-event-popup-inner","body").outerHeight(!0)-C(".fat-event-popup-single .fat-event-popup-thumb","body").outerHeight(!0)-30;C(".fat-event-popup-content-wrap").css("height",t+"px"),0<C(".fat-event-popup-content-wrap").length&&new PerfectScrollbar(C(".fat-event-popup-content-wrap")[0],{wheelSpeed:2,wheelPropagation:!0,minScrollbarLength:20})},FatEvent.initPopupShare=function(){C(".fat-event-share a").off("click").on("click",function(){var t=C(this),a=t.attr("data-social"),e=t.closest(".fat-event-share"),n=(e.attr("data-title"),e.attr("data-link")),t=(e.attr("data-thumb"),""),e="";"facebook"===a&&(e="https://www.facebook.com/sharer/sharer.php?u="+n+"&t=TITLE",t="Facebook share"),"twitter"===a&&(e="http://www.twitter.com/intent/tweet?url="+n,t="Twitter share"),"google"===a&&(e="https://plus.google.com/share?url="+n,t="Google+ share"),""!=e&&(a=screen.width/2-250,n=screen.height/2-225,window.open(e,t,"width=500,height=450,resizable=0,top="+n+",left="+a).focus())})},FatEvent.initInfiniteScroll=function(){var t,a=C(window).scrollTop(),e=a+C(window).height();C(".fat-paging-navigation-wrap a.fat-event-infinite-scroll:not(.infinited)").each(function(){t=C(this).offset().top,t+C(this).height()<=e&&a<=t&&(C(this).addClass("infinited"),C(this).trigger("click"))})},FatEvent.getPageNumberFromHref=function(t){var a="",e=/paged=\d+/gi,a=new RegExp(e).test(t)?new RegExp(e).exec(t):(e=/page\/\d+/gi,new RegExp(e).test(t)?new RegExp(e).exec(t):a),e=/\d+/g;return new RegExp(e).test(a)?new RegExp(e).exec(a)[0]:1},FatEvent.initAppearScroll=function(t){C(window).scrollTop(),C(window).height();var a,e=100,n=[];C(".fat-event-item.has-infinite:not(.infinited)",t).each(function(){FatEvent.isAppear(this)&&n.push(C(this))});for(var o=0;o<n.length;o++)!function(t){e=void 0!==(e=C(n[t]).closest(".fat-event-container").attr("data-animation-duration"))?parseInt(e):200,setTimeout(function(){a=C(n[t]).closest(".fat-event-container").attr("data-animation"),C(n[t]).addClass("animated "+a),C(n[t]).removeClass("has-infinite").removeClass("waiting-init"),C(n[t]).addClass("infinited"),setTimeout(function(){C(n[t]).removeClass(a)},1500)},e*o)}(o)},FatEvent.isAppear=function(t,a){var e=C(window).scrollTop(),n=e+C(window).height(),o=C(t).height(),i=C(t).offset().top,s=i+o,t=s-n;return void 0!==a&&!isNaN(a)||(a=.9),(t<=0||t<=o*a)&&(e<=i||s<n)},FatEvent.initAnimation=function(){C(".fat-gallery-item",".fat-maika-container.has-animation").addClass("has-infinite"),C(".fat-maika-container.has-animation").each(function(){FatMaika.initAppearScroll(C(this))})},FatEvent.showLoading=function(t,a){var e=t.attr("data-spinner"),n="";switch(e=void 0===e?"atom":e){case"atom":n=C('<div class="epic-spinner-loading"><div class="epic-spinner-loading-inner"><div class="atom-spinner">\n        <div class="spinner-inner">\n            <div class="spinner-line"></div>\n            <div class="spinner-line"></div>\n            <div class="spinner-line"></div>\n            \x3c!--Chrome renders little circles malformed :(--\x3e\n            <div class="spinner-circle">\n                &#9679;\n            </div>\n        </div>\n    </div></div></div>');break;case"finger":n=C('<div class="epic-spinner-loading"><div class="epic-spinner-loading-inner"><div class="fingerprint-spinner">\n  <div class="spinner-ring"></div>\n  <div class="spinner-ring"></div>\n  <div class="spinner-ring"></div>\n  <div class="spinner-ring"></div>\n  <div class="spinner-ring"></div>\n  <div class="spinner-ring"></div>\n  <div class="spinner-ring"></div>\n  <div class="spinner-ring"></div>\n  <div class="spinner-ring"></div>\n</div></div></div>');break;case"flower":n=C('<div class="epic-spinner-loading"><div class="epic-spinner-loading-inner"><div class="flower-spinner">\n  <div class="dots-container">\n    <div class="bigger-dot">\n      <div class="smaller-dot"></div>\n    </div>\n  </div>\n</div></div></div>');break;case"half_circle":n=C('<div class="epic-spinner-loading"><div class="epic-spinner-loading-inner"><div class="half-circle-spinner">\n  <div class="circle circle-1"></div>\n  <div class="circle circle-2"></div>\n</div></div></div>');break;case"orbit":n=C('<div class="epic-spinner-loading"><div class="epic-spinner-loading-inner"><div class="orbit-spinner">\n  <div class="orbit"></div>\n  <div class="orbit"></div>\n  <div class="orbit"></div>\n</div></div></div>');break;case"self_building":n=C('<div class="epic-spinner-loading"><div class="epic-spinner-loading-inner"><div class="self-building-square-spinner">\n  <div class="square"></div>\n  <div class="square"></div>\n  <div class="square"></div>\n  <div class="square clear"></div>\n  <div class="square"></div>\n  <div class="square"></div>\n  <div class="square clear"></div>\n  <div class="square"></div>\n  <div class="square"></div>\n</div></div></div>');break;case"hollow_dots":n=C('<div class="epic-spinner-loading"><div class="epic-spinner-loading-inner"><div class="hollow-dots-spinner" :style="spinnerStyle">\n  <div class="dot"></div>\n  <div class="dot"></div>\n  <div class="dot"></div>\n</div></div></div>')}void 0!==a&&a?((t=C("body")).append(n),C(".epic-spinner-loading",t).addClass("epic-center-screen")):t.append(n)},FatEvent.closeLoading=function(t){C(".epic-spinner-loading",t).remove(),C("body .epic-spinner-loading").remove()},FatEvent.showNotified=function(t,a){C("body").append('<div class="fat-event-notified">'+t+"</div>"),a=void 0===a||isNaN(a)?5e3:a,setTimeout(function(){C(".fat-event-notified","body").fadeOut(function(){C(".fat-portfolio-notified","body").remove()})},a)},FatEvent.showPopupMessage=function(t){t=C('<div class="fat-event-popup-modal"><div class="fat-event-popup-message"><a class="fat-close-popup"><i class="fa fa-times-circle"></i></a><div class="fat-event-message">'+t+"</div></div></div>");C("body .fat-event-popup-modal").remove(),C("body").append(t),C("a.fat-close-popup",".fat-event-popup-modal").on("click",function(){C("body .fat-event-popup-modal").remove()})},FatEvent.initTab=function(){C(".fat-event-tabs a").off("click").on("click",function(){var t=C(this).closest("li"),a=C(this).attr("data-id"),e=C(this).closest(".fat-event-sections");t.hasClass("active")||(C(".fat-event-tabs li.active",e).removeClass("active"),t.addClass("active"),C(".fat-event-tab-content.active",e).fadeOut(function(){C(this).removeClass("active"),C('.fat-event-tab-content[data-id="'+a+'"]',e).fadeIn(function(){C(this).addClass("active")})}))})},FatEvent.initStripeCardInput=function(){if(0!=C("#stripe-payment-form").length)try{var t=C("form#stripe-payment-form").attr("data-pk"),a=Stripe(t),t=a.elements(),e=t.create("card",{style:{base:{color:"#32325d",lineHeight:"18px",fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#aab7c4"}},invalid:{color:"red",iconColor:"red"}}});e.mount("#card-element"),e.addEventListener("change",function(t){var a=document.getElementById("card-errors");t.error?a.textContent=t.error.message:a.textContent=""}),document.getElementById("stripe-payment-form").addEventListener("submit",function(t){t.preventDefault();t=C("a.fat-popup-bt-submit",".fat-event-popup-modal.booking-popup");FatEvent.showLoading(t,!0),a.createToken(e).then(function(t){var e,n,o,i,a;t.error?(document.getElementById("card-errors").textContent=t.error.message,FatEvent.closeLoading(C("a.fat-popup-bt-submit",".fat-event-popup-modal.booking-popup"))):(e=C("a.fat-popup-bt-submit",".fat-event-popup-modal.booking-popup"),n=e.closest(".fat-event-popup-modal"),o=C("#numQuantity",n).val(),a={},a=n.hasClass("booking-form-builder")?(i={},C(".fat-event-field-builder").each(function(){void 0!==C(this).attr("name")&&(void 0!==C(this).attr("data-map-field")&&""!=C(this).attr("data-map-field")&&"none"!=C(this).attr("data-map-field")?i[C(this).attr("data-map-field")]={name:C(this).attr("name"),label:C(this).attr("data-label"),value:C(this).val()}:i[C(this).attr("name")]={name:C(this).attr("name"),label:C(this).attr("data-label"),value:C(this).val()})}),C(".fat-event-radio-group,.fat-event-checkbox-group").each(function(){var t=C(this),a=[];void 0!==C("input:checked",t).val()&&(C("input",t).each(function(){C(this).is(":checked")&&a.push(C(this).val())}),void 0!==C(this).attr("data-map-field")&&""!=C(this).attr("data-map-field")&&"none"!=C(this).attr("data-map-field")?i[C(this).attr("data-map-field")]={name:C(this).attr("name"),label:C(this).attr("data-label"),value:a}:i[C(this).attr("name")]={name:C(this).attr("name"),label:C(this).attr("data-label"),value:a})}),{action:"fat_event_booking",id:e.attr("data-id"),token:t.token.id,data_form:i,quantity:o,paymentType:C('select[name="paymentType"]').val(),start_date:e.attr("data-start"),end_date:e.attr("data-end"),url:window.location.href,coupon:void 0!==C("#txtCoupon",".booking-popup").val()?C("#txtCoupon",".booking-popup").val():"",ticket_class:null!=C('select[name="optTicketClass"]').val()?C('select[name="optTicketClass"]').val():""}):{action:"fat_event_booking",id:e.attr("data-id"),token:t.token.id,firstName:C("input#txtFirstName",n).val(),lastName:C("input#txtLastName",n).val(),phone:C("input#txtPhone",n).val(),email:C("input#txtEmail",n).val(),quantity:o,note:C("#txtNote",n).val(),address:C("#txtAddress",n).val(),gender:C("#optGender",n).val(),department:C("#txtDepartment",n).val(),company:C("#txtCompany",n).val(),country:C("#optCountry",n).val(),paymentType:C('select[name="paymentType"]').val(),start_date:e.attr("data-start"),end_date:e.attr("data-end"),url:window.location.href,coupon:void 0!==C("#txtCoupon",".booking-popup").val()?C("#txtCoupon",".booking-popup").val():"",ticket_class:null!=C('select[name="optTicketClass"]').val()?C('select[name="optTicketClass"]').val():""},C.ajax({url:fat_event_ajax.ajaxurl,type:"POST",data:a,success:function(t){var a;t=C.parseJSON(t),(FatEvent.isProcess=0)<t.code?(C.ajax({url:fat_event_ajax.ajaxurl,type:"POST",data:{action:"fat_event_booking_sendmail",id:t.code}}),FatEvent.closeLoading(e),C("body .fat-event-popup-modal").remove(),void 0!==t.url&&""!=t.url&&(window.location.href=t.url),void 0!==t.message&&FatEvent.showPopupMessage(t.message),a=C(".fat-event-seats-available strong").html(),isNaN(a)||(0<=(a=parseInt(a))-o?C(".fat-event-seats-available strong").html(a-o):C(".fat-event-seats-available strong").html(0))):(FatEvent.closeLoading(e),C(".fat-popup-error-message",n).append(t.message+"</br>"))},error:function(){FatEvent.closeLoading(e),FatEvent.isProcess=0}}))})}),"stripe"===C('select[name="paymentType"]').val()?(C("#stripe-payment-form").show(),C(".g-recaptcha",".fat-event-popup-booking").hide()):(C("#stripe-payment-form").hide(),C(".g-recaptcha",".fat-event-popup-booking").show()),C('select[name="paymentType"]').on("change",function(){"stripe"===C(this).val()?(C("#stripe-payment-form").show(),C(".g-recaptcha",".fat-event-popup-booking").hide()):(C("#stripe-payment-form").hide(),C(".g-recaptcha",".fat-event-popup-booking").show())})}catch(t){}},FatEvent.initPopupBookingSize=function(){var t=C(".fat-event-popup-inner").outerHeight();t=(t=parseInt(t)-200)<250?250:t,C(".fat-event-popup-modal.booking-popup .fat-event-popup-inner .fat-popup-fields").css("height",t+"px"),new PerfectScrollbar(C(".fat-event-popup-modal.booking-popup .fat-event-popup-inner .fat-popup-fields")[0],{wheelSpeed:2,wheelPropagation:!0,minScrollbarLength:20})},FatEvent.calculatorPrice=function(){var t,a,e,n,o,i,s,p,r=C("#numQuantity",".fat-event-popup-modal.booking-popup");0<r.length&&""!=r.val()&&(t=C("#numQuantity",".fat-event-popup-modal.booking-popup").val(),p=0,a=parseFloat(C("a.fat-popup-bt-submit",".fat-event-popup-modal.booking-popup").attr("data-fees")),i=C(r).closest(".booking-popup"),e=(o=C(".fat-event-fees-info",i)).attr("data-decimal"),s=o.attr("data-separator"),n=o.attr("data-symbol-position"),s=void 0===s||""==s?".":"",void 0===(i=C('.fat-event-ticket-class-info select[name="optTicketClass"] :selected',".fat-event-popup-modal.booking-popup")).attr("data-fees")||isNaN("undefined"!=i.attr("data-fees"))||(a=parseFloat(i.attr("data-fees")),C(".fat-event-fees",".fat-event-popup-modal.booking-popup").html(a.format(e,3,s))),t=parseFloat(t),0<C(".bt-apply-coupon",".fat-event-popup-modal.booking-popup").length&&(o=void 0!==(r=C(".bt-apply-coupon",".fat-event-popup-modal.booking-popup")).attr("data-discount-amount")?r.attr("data-discount-amount"):0,i=void 0!==r.attr("data-discount-type")?r.attr("data-discount-type"):"fixed",r=r.attr("data-currency"),0<(p="fixed"==i?parseFloat(o):a*t*parseFloat(o/100))&&("prefix"==n?C("span.fat-event-discount",".fat-event-popup-modal.booking-popup").html("-"+r+p.format(e,3,s)):C("span.fat-event-discount",".fat-event-popup-modal.booking-popup").html("-"+p.format(e,3,s)+r))),p=0<(p=parseFloat(a*t-p))?p:0,C("span.fat-event-total-fees",".fat-event-popup-modal.booking-popup").html(p.format(e,3,s)))},FatEvent.addToWooCart=function(a,t,e,n,o,i,s,p,r){FatEvent.showLoading(a,!0),FatEvent.isProcess=1,C.ajax({url:fat_event_ajax.ajaxurl,type:"POST",data:{action:"fat_event_wc_booking",id:t,start_date:e,end_date:n,ticket_number:i,max_seat:r,class_id:s,class_name:p,location:o.locations,amenities:o.amenities},success:function(t){t=C.parseJSON(t),(FatEvent.isProcess=0)<t.code?1===t.code&&(void 0!==t.url?window.location.href=t.url:(FatEvent.closeLoading(a),FatEvent.showPopupMessage(t.message))):(FatEvent.closeLoading(a),void 0!==t.message&&FatEvent.showPopupMessage(t.message))},error:function(){FatEvent.closeLoading(a),FatEvent.isProcess=0}})},C(document).ready(function(){FatEvent.init(),C(window).scroll(function(){C(".fat-event-container.has-animation").each(function(){FatEvent.initAppearScroll(C(this))}),FatEvent.initInfiniteScroll()}),C(".vc_tta-tabs-list .vc_tta-tab > a").on("click",function(){setTimeout(function(){FatEvent.init()},500)}),C(document).on("tg_init_popup_detail",function(){FatEvent.initPopupDetail()}),C(document).on("fat_event_register_view_detail",function(){FatEvent.initPopupDetail()}),0<C("div#hook_main_wrapper").length&&C("div#hook_main_wrapper").addClass("hook_forced_menu")})}(jQuery);
// source --> https://comfortzonetoronto.ca/wp-content/plugins/fat-event/assets/js/frontend/dist/fat-event-single.js?ver=5.0 
"use strict";function fat_event_single_map(){jQuery("document").ready(function(){jQuery(".fat-event-single .fat-event-location").each(function(){var e=jQuery(this),t=jQuery(".fat-google-map",e),n=e.attr("data-latitude").split(";"),a="",o="",i=15;if(0!=t.length&&void 0!==n&&(i=1<n.length?12:i,2==n[0].split(",").length)){a=n[0].split(",")[0],o=n[0].split(",")[1];var s=new google.maps.LatLng(""==a?51.491676:a,""==o?-.16766:o),g=new google.maps.Map(t[0],{center:s,zoom:i,mapTypeId:"roadmap"});google.maps.event.addDomListener(window,"resize",function(){var e=g.getCenter();google.maps.event.trigger(t,"resize"),g.setCenter(e)});for(var l=0;l<n.length;l++)a=n[l].split(",")[0],o=n[l].split(",")[1],""!=a&&""!=o&&new google.maps.Marker({position:new google.maps.LatLng(a,o),draggable:!1,animation:google.maps.Animation.DROP}).setMap(g)}})})}!function(c){function e(){c(".fat-event-single.single-04 .fat-event-single-meta").each(function(){var e=0,t=c(this);767<c(window).width()?(c(".fat-event-meta:not(.exclude-height)",t).each(function(){c(".fat-event-meta-wrap",this).height()>e&&(e=c(".fat-event-meta-wrap",this).height())}),c(".fat-event-meta:not(.exclude-height)",t).css("height",e+"px")):c(".fat-event-meta:not(.exclude-height)",t).css("height","auto")})}c(document).ready(function(){c(".fat-event-location").each(function(){if("undefined"!=typeof mapboxgl){var e,t=c(this),n=c(".fat-mapbox",t),a=t.attr("data-access-token"),o=t.attr("data-latitude").split(";"),i="",s={container:n.attr("id"),style:"mapbox://styles/mapbox/streets-v11"};if(0<o.length){if(i=o[0].split(","),1==o.length)s.center=[i[0],i[1]],s.zoom=15;else try{for(var g=[],l=0;l<o.length;l++)g.push(turf.point([parseInt(o[l].split(",")[0]),parseInt(o[l].split(",")[1])]));var r=turf.featureCollection(g);s.center=turf.center(r).geometry.coordinates,s.zoom=6.5}catch(e){console.log(e)}for(mapboxgl.accessToken=a,(e=new mapboxgl.Map(s)).addControl(new mapboxgl.NavigationControl),l=0;l<o.length;l++)i=o[l].split(","),new mapboxgl.Marker({draggable:!1}).setLngLat([i[0],i[1]]).addTo(e)}}}),e(),c(".fat-event-single").on("change",function(){console.log("on change"),setTimeout(function(){e()},500)})}),c(window).on("resize",function(){setTimeout(function(){e()},500)})}(jQuery);