(function(){
jQuery(document).ready(function($){
crResizeAllGridItems();
crResizeTrustBadges();
jQuery("form#commentform").attr("enctype", "multipart/form-data").attr("encoding", "multipart/form-data");
jQuery("#commentform").on("submit", function(event){
if(cr_ajax_object.ivole_recaptcha==='1'){
var recaptcha=jQuery("#g-recaptcha-response").val();
if(recaptcha===""){
event.preventDefault();
alert("Please confirm that you are not a robot");
}}
});
jQuery("ol.commentlist").on("click", ".cr-comment-a", function(t){
if(cr_ajax_object.disable_lightbox==='0'){
t.preventDefault();
const oo=jQuery(".pswp");
if(0 < oo.length){
const o=oo[0];
var pics=jQuery(this).parent().parent().find(".cr-comment-a img");
var this_pic=jQuery(this).find("img");
var inx=0;
if(pics.length > 0&&this_pic.length > 0){
var a=[];
for (i=0; i < pics.length; i++){
a.push({
src: pics[i].src,
w: pics[i].naturalWidth,
h: pics[i].naturalHeight,
title: pics[i].alt
});
if(this_pic[0].src==pics[i].src){
inx=i;
}}
var r={
index: inx
};
new PhotoSwipe(o, PhotoSwipeUI_Default, a, r).init();
}}
}});
jQuery(".cr-reviews-grid").on("click", ".image-row-vid, .cr-comment-videoicon", function(t){
if(! jQuery(this).closest(".image-row").hasClass("cr-vid-playing")){
jQuery(this).closest(".image-row").addClass("cr-vid-playing");
jQuery(this).closest(".image-row").find(".image-row-vid").prop("controls", true);
jQuery(this).closest(".image-row").find(".image-row-vid").get(0).play();
}else{
jQuery(this).closest(".image-row").find(".image-row-vid").get(0).pause();
jQuery(this).closest(".image-row").find(".image-row-vid").prop("controls", false);
jQuery(this).closest(".image-row").removeClass("cr-vid-playing");
}
return false;
});
jQuery(".cr-ajax-reviews-cus-images-modal").on("click", ".cr-ajax-reviews-video, .cr-ajax-reviews-video .cr-comment-videoicon", function(t){
if(! jQuery(this).closest(".cr-ajax-reviews-video").hasClass("cr-vid-playing")){
jQuery(this).closest(".cr-ajax-reviews-video").addClass("cr-vid-playing");
jQuery(this).closest(".cr-ajax-reviews-video").find("video").prop("controls", true);
jQuery(this).closest(".cr-ajax-reviews-video").find("video").get(0).play();
}else{
jQuery(this).closest(".cr-ajax-reviews-video").find("video").get(0).pause();
jQuery(this).closest(".cr-ajax-reviews-video").find("video").prop("controls", false);
jQuery(this).closest(".cr-ajax-reviews-video").removeClass("cr-vid-playing");
}
return false;
});
jQuery(".cr-reviews-grid").on("click", ".media-row-count", function(t){
if(cr_ajax_object.disable_lightbox==='0'){
t.preventDefault();
const oo=jQuery(".pswp");
let media=jQuery(this).parent().find(".image-row-vid,.image-row-img"),
this_media=jQuery(this),
inx=0;
if(media.length > 0&&this_media.length > 0){
const o=oo[0];
var a=[];
for (i=0; i < media.length; i++){
if("vid"===media[i].dataset.crmedia){
a.push({
html: '<div class="cr-video-wrapper"><video class="cr-media-video" src="' + media[i].src + '" controls></video></div>',
title: media[i].dataset.crtitle
});
}else{
a.push({
src: media[i].src,
w: media[i].naturalWidth,
h: media[i].naturalHeight,
title: media[i].alt
});
}
if(this_media[0].src==media[i].src){
inx=i;
}}
var r={
index: inx
};
new PhotoSwipe(o, PhotoSwipeUI_Default, a, r).init();
}}
});
jQuery(document).on("click", ".cr-video-wrapper .cr-media-video", function(t){
const vid=jQuery(this).get(0);
if(vid){
const isVideoPlaying = !!(vid.currentTime > 0&&!vid.paused&&!vid.ended&&vid.readyState > 2);
if(isVideoPlaying){
vid.pause();
}else{
vid.play();
}}
return false;
});
jQuery(".cr-reviews-grid").on("click", ".image-row-img, .image-row-count", function(t){
if(cr_ajax_object.disable_lightbox==='0'){
t.preventDefault();
const oo=jQuery(".pswp");
if(0 < oo.length){
const o=oo[0];
var pics=jQuery(this).parent().find("img.image-row-img");
var this_pic=jQuery(this);
var inx=0;
if(pics.length > 0&&this_pic.length > 0){
var a=[];
for (i=0; i < pics.length; i++){
a.push({
src: pics[i].src,
w: pics[i].naturalWidth,
h: pics[i].naturalHeight,
title: pics[i].alt
});
if(this_pic[0].src==pics[i].src){
inx=i;
}}
var r={
index: inx
};
new PhotoSwipe(o, PhotoSwipeUI_Default, a, r).init();
}}
}});
initVoteClick("ol.commentlist", ".cr-voting-a", "cr_vote_review");
initVoteClick(".cr-ajax-reviews-cus-images-modal", ".cr-voting-a", "cr_vote_review");
initVoteClick(".cr-qna-block .cr-qna-list-block", ".cr-voting-a", "cr_vote_question");
jQuery("ol.commentlist").on("click", ".cr-video-a, .cr-comment-videoicon", function(t){
if(! jQuery(this).closest(".cr-comment-videos").hasClass("cr-comment-videos-modal")){
let tt=jQuery(this).closest("[class*='cr-comment-video-']");
jQuery(this).closest(".cr-comment-videos").addClass("cr-comment-videos-modal");
tt.addClass("cr-comment-video-modal");
tt.find("video").prop("controls", true);
tt.find(".cr-comment-videoicon").hide();
tt.find("video").get(0).play();
return false;
}
return false;
});
jQuery("ol.commentlist").on("click", ".cr-comment-videos", function(t){
if(jQuery(this).hasClass("cr-comment-videos-modal")){
jQuery(this).removeClass("cr-comment-videos-modal");
jQuery(this).find("[class*='cr-comment-video-']").each(function(index, element){
if(jQuery(element).hasClass("cr-comment-video-modal")){
jQuery(element).removeClass("cr-comment-video-modal");
jQuery(element).find("video").get(0).pause();
jQuery(element).find("video").prop("controls", false);
jQuery(element).find(".cr-comment-videoicon").show();
jQuery(element).removeAttr("style");
}});
return false;
}});
jQuery(".cr-show-more-reviews-prd").on("click", function(t){
t.preventDefault();
crShowMoreReviewsPrd(jQuery(this));
});
jQuery(".cr-ajax-reviews-sort").on("change", function(t){
t.preventDefault();
if(jQuery(this).parents(".cr-all-reviews-shortcode").length){
cr_filter_all_reviews(jQuery(this));
}else{
var cr_product_id=jQuery(this).parents(".cr-reviews-ajax-comments").find(".commentlist.cr-ajax-reviews-list").attr("data-product");
var cr_sort=jQuery(this).children("option:selected").val();
var cr_rating=jQuery(this).parents(".cr-reviews-ajax-comments").find(".cr-summaryBox-ajax tr.ivole-histogramRow.ivole-histogramRow-s .ivole-histogram-a").attr("data-rating");
if(!cr_rating){
cr_rating=0;
}
var cr_data={
"action": "cr_sort_reviews",
"productID": cr_product_id,
"sort": cr_sort,
"rating": cr_rating
};
jQuery(this).parents(".cr-reviews-ajax-comments").find(".cr-search-no-reviews").hide();
jQuery(this).parents(".cr-reviews-ajax-comments").find('.cr-ajax-search input').val("").trigger("change");
jQuery(this).parents(".cr-reviews-ajax-comments").find(".cr-show-more-reviews-prd").hide();
jQuery(this).parents(".cr-reviews-ajax-comments").find(".commentlist.cr-ajax-reviews-list").hide();
jQuery(this).parents(".cr-reviews-ajax-comments").find(".cr-show-more-review-spinner").show();
jQuery(this).parents(".cr-reviews-ajax-comments").find(".cr-summaryBox-ajax").addClass("cr-summaryBar-updating");
jQuery(this).addClass("cr-sort-updating");
jQuery.post({
url: cr_ajax_object.ajax_url,
data: cr_data,
context: this,
success: function(response){
jQuery(this).parents(".cr-reviews-ajax-comments").find(".cr-show-more-review-spinner").hide();
jQuery(this).parents(".cr-reviews-ajax-comments").find(".cr-summaryBox-ajax").removeClass("cr-summaryBar-updating");
jQuery(this).removeClass("cr-sort-updating");
if(response.page > 0){
jQuery(this).parents(".cr-reviews-ajax-comments").find(".commentlist.cr-ajax-reviews-list").empty();
jQuery(this).parents(".cr-reviews-ajax-comments").find(".commentlist.cr-ajax-reviews-list").append(response.html);
jQuery(this).parents(".cr-reviews-ajax-comments").find(".commentlist.cr-ajax-reviews-list").show();
jQuery(this).parents(".cr-reviews-ajax-comments").attr("data-page",response.page);
if(response.show_more_label){
jQuery(this).parents(".cr-reviews-ajax-comments").find(".cr-show-more-reviews-prd").text(response.show_more_label);
}
if(response.count_row){
jQuery(this).parents(".cr-reviews-ajax-comments").find(".cr-count-row .cr-count-row-count").html(response.count_row);
}
if(!response.last_page){
jQuery(this).parents(".cr-reviews-ajax-comments").find(".cr-show-more-reviews-prd").show();
}}
},
dataType: "json"
});
}});
jQuery(".cr-noAjax").on("click", ".ivole-histogram-a", function (t){
t.preventDefault();
const parser=new URL(window.location);
parser.searchParams.set(cr_ajax_object.rating_filter, jQuery(this).data("rating"));
parser.hash=cr_ajax_object.reviews_tab;
window.location=parser.href;
});
jQuery(".cr-reviews-ajax-comments").on("click", ".ivole-histogram-a, .cr-seeAllReviews", function(t){
t.preventDefault();
let tmpParent=jQuery(this).parents(".cr-reviews-ajax-comments");
let cr_product_id=tmpParent.find(".commentlist.cr-ajax-reviews-list").attr("data-product");
let cr_nonce=tmpParent.find(".cr-summaryBox-ajax").attr("data-nonce");
let cr_rating=jQuery(this).attr("data-rating");
let cr_sort=tmpParent.find(".cr-ajax-reviews-sort").children("option:selected").val();
let cr_data={
"action": "cr_filter_reviews",
"productID": cr_product_id,
"rating": cr_rating,
"sort": cr_sort,
"security": cr_nonce
};
tmpParent.find(".cr-summaryBox-ajax tr.ivole-histogramRow.ivole-histogramRow-s").removeClass("ivole-histogramRow-s");
if(cr_rating > 0){
jQuery(this).closest("tr.ivole-histogramRow").addClass("ivole-histogramRow-s");
}
tmpParent.find(".cr-search-no-reviews").hide();
tmpParent.find('.cr-ajax-search input').val("").trigger("change");
tmpParent.find(".cr-show-more-reviews-prd").hide();
tmpParent.find(".commentlist.cr-ajax-reviews-list").hide();
tmpParent.find(".cr-show-more-review-spinner").show();
tmpParent.find(".cr-summaryBox-ajax").addClass("cr-summaryBar-updating");
tmpParent.find(".cr-ajax-reviews-sort").addClass("cr-sort-updating");
jQuery.post({
url: cr_ajax_object.ajax_url,
data: cr_data,
context: tmpParent,
success: function(response){
this.find(".cr-show-more-review-spinner").hide();
this.find(".cr-summaryBox-ajax").removeClass("cr-summaryBar-updating");
this.find(".cr-ajax-reviews-sort").removeClass("cr-sort-updating");
if(response.page > 0){
this.find(".commentlist.cr-ajax-reviews-list").empty();
this.find(".commentlist.cr-ajax-reviews-list").append(response.html);
this.find(".commentlist.cr-ajax-reviews-list").show();
this.attr("data-page",response.page);
if(response.show_more_label){
this.find(".cr-show-more-reviews-prd").text(response.show_more_label);
}
if(response.count_row){
this.find(".cr-count-row .cr-count-row-count").html(response.count_row);
}
if(!response.last_page){
this.find(".cr-show-more-reviews-prd").show();
}}
},
dataType: "json"
});
});
jQuery('.cr-ajax-search input').on("keyup", function(e){
if(e.keyCode==13){
jQuery(this).parents(".cr-ajax-search").find("button").trigger("click");
}
if(jQuery(this).val()!==""){
jQuery(this).parents(".cr-ajax-search").find(".cr-clear-input").css("display", "inline-block");
}else{
jQuery(this).parents(".cr-ajax-search").find(".cr-clear-input").css("display", "none");
}}).on("change", function(){
if(jQuery(this).val()==="") jQuery(this).parents(".cr-ajax-search").find(".cr-clear-input").hide();
});
jQuery('.cr-reviews-ajax-reviews .cr-ajax-search input').on('keyup', crDebounce(
(ref)=> {
jQuery(ref.target).parents(".cr-reviews-ajax-comments").attr("data-page", 0);
jQuery(ref.target).parents(".cr-reviews-ajax-reviews").find(".cr-ajax-reviews-list").empty();
crShowMoreReviewsPrd(jQuery(ref.target));
},
1000
));
jQuery(".cr-ajax-search .cr-clear-input").on("click", function (){
jQuery(this).prev("input").val("");
jQuery(this).parents(".cr-ajax-search").find(".cr-clear-input").hide();
jQuery(this).parents(".cr-ajax-search").find("button").trigger("click");
if(jQuery(this).parents(".cr-reviews-ajax-reviews").length){
jQuery(this).parents(".cr-reviews-ajax-comments").attr("data-page", 0);
jQuery(this).parents(".cr-reviews-ajax-reviews").find(".cr-ajax-reviews-list").empty();
crShowMoreReviewsPrd(jQuery(this));
}});
jQuery(".cr-ajax-search button").on("click", function (e){
e.preventDefault();
if(jQuery(this).parents(".cr-all-reviews-shortcode").length){
cr_filter_all_reviews(jQuery(this));
}else{
jQuery(this).parents(".cr-reviews-ajax-comments").attr("data-page", 0);
jQuery(this).parents(".cr-reviews-ajax-comments").find(".cr-ajax-reviews-list").empty();
crShowMoreReviewsPrd(jQuery(this));
}});
jQuery(".cr-ajax-reviews-add-review, .cr-nosummary-add").on("click", function(t){
t.preventDefault();
jQuery(this).closest(".cr-reviews-ajax-reviews").find(".cr-reviews-ajax-comments").hide();
jQuery(this).closest(".cr-reviews-ajax-reviews").find(".cr-ajax-reviews-review-form").show();
});
jQuery(".cr-review-tags-filter span.cr-tags-filter").on("click", function (e){
e.preventDefault();
if(jQuery(this).hasClass("cr-tag-selected")){
jQuery(this).removeClass("cr-tag-selected");
}else{
jQuery(this).addClass("cr-tag-selected");
}
if(jQuery(this).parents(".cr-all-reviews-shortcode").length){
cr_filter_all_reviews(jQuery(this));
}else{
jQuery(this).parents(".cr-reviews-ajax-comments").attr("data-page", 0);
jQuery(this).parents(".cr-reviews-ajax-comments").find(".cr-ajax-reviews-list").empty();
crShowMoreReviewsPrd(jQuery(this));
}});
jQuery(".cr-comment-image-top .cr-comment-image-top-item").on("click", function(t){
t.preventDefault();
jQuery("body").addClass("cr-noscroll");
let slide_no=jQuery(this).data("slide");
let imgParent=jQuery(this).closest(".cr-ajax-reviews-cus-images-div").parent();
imgParent.find(".cr-ajax-reviews-cus-images-modal-cont").addClass("cr-mask-active");
imgParent.find(".cr-ajax-reviews-cus-images-modal .cr-ajax-reviews-cus-images-slider-main").slickk('setPosition');
imgParent.find(".cr-ajax-reviews-cus-images-modal .cr-ajax-reviews-cus-images-slider-nav").slickk('setPosition');
if(typeof slide_no!=='undefined'){
imgParent.find(".cr-ajax-reviews-cus-images-modal .cr-ajax-reviews-cus-images-slider-main").slickk('slickGoTo', slide_no, true);
imgParent.find(".cr-ajax-reviews-cus-images-modal .cr-ajax-reviews-cus-images-slider-nav").slickk('slickGoTo', slide_no, true);
}});
jQuery(".cr-comment-image-top .cr-comment-videoicon").on("click", function(t){
jQuery(this).closest(".cr-comment-image-top").find(".cr-comment-image-top-item").trigger("click");
});
jQuery(".cr-ajax-reviews-cus-images-modal-cont, .cr-ajax-reviews-cus-images-modal .cr-ajax-reviews-cus-images-close").on("click", function(t){
t.preventDefault();
let closeParent=jQuery(this).closest(".cr-ajax-reviews-cus-images-modal-cont.cr-mask-active");
closeParent.find(".cr-ajax-reviews-cus-images-modal .cr-ajax-reviews-cus-images-slider-main").slickk('slickGoTo',0,true);
closeParent.find(".cr-ajax-reviews-cus-images-modal .cr-ajax-reviews-cus-images-slider-nav").slickk('slickGoTo',0,true);
closeParent.removeClass("cr-mask-active");
jQuery("body").removeClass("cr-noscroll");
});
jQuery(".cr-ajax-reviews-cus-images-modal-cont .cr-ajax-reviews-cus-images-modal").on("click", function(t){
t.stopPropagation();
});
jQuery(".single_variation_wrap").on("show_variation", function(event, variation){
if(jQuery(".cr_gtin").length){
jQuery(".cr_gtin_val").text(variation._cr_gtin);
}
if(jQuery(".cr_mpn").length){
jQuery(".cr_mpn_val").text(variation._cr_mpn);
}
if(jQuery(".cr_brand").length){
jQuery(".cr_brand_val").text(variation._cr_brand);
}});
jQuery(document).on('reset_data', function (){
var cr_gtin=jQuery(".cr_gtin"),
cr_mpn=jQuery(".cr_mpn"),
cr_brand=jQuery(".cr_brand");
if(cr_gtin.length){
jQuery(".cr_gtin_val").text(cr_gtin.data("o_content"));
}
if(cr_mpn.length){
jQuery(".cr_mpn_val").text(cr_mpn.data("o_content"));
}
if(cr_brand.length){
jQuery(".cr_brand_val").text(cr_brand.data("o_content"));
}});
jQuery('.cr-all-reviews-shortcode .cr-show-more-button').on("click", function (e){
e.preventDefault();
cr_filter_all_reviews(jQuery(this), true);
});
jQuery('.cr-all-reviews-shortcode').on("click", ".cr-page-numbers-a", function (e){
e.preventDefault();
cr_filter_all_reviews(jQuery(this), true);
});
jQuery(".cr-all-reviews-shortcode").on("click", ".cr-histogram-a, .cr-seeAllReviews", function(t){
t.preventDefault();
let cr_rating=jQuery(this).data("rating");
jQuery("div.ivole-summaryBox tr.ivole-histogramRow.ivole-histogramRow-s").removeClass("ivole-histogramRow-s");
if(cr_rating > 0){
jQuery(this).closest("tr.ivole-histogramRow").addClass("ivole-histogramRow-s");
}
jQuery(this).parents(".cr-all-reviews-shortcode").find(".cr-review-tags-filter .cr-tag-selected").removeClass("cr-tag-selected");
cr_filter_all_reviews(jQuery(this));
});
jQuery(".cr-reviews-grid .cr-show-more-button").on("click", function (e){
e.preventDefault();
let $this=jQuery(this),
$spinner=$this.next(".cr-show-more-spinner"),
cr_rating=$this.parents(".cr-reviews-grid").find(".ivole-summaryBox.cr-grid-reviews-ajax tr.ivole-histogramRow.ivole-histogramRow-s .cr-histogram-a").attr("data-rating"),
attributes=$this.parents(".cr-reviews-grid").data("attributes");
attributes.comment__not_in=$this.parents(".cr-reviews-grid").find(".cr-review-card.cr-card-product").map(function(){
return jQuery(this).data("reviewid");
}).get();
attributes.comment__not_in=attributes.comment__not_in.concat($this.parents(".cr-reviews-grid").find(".cr-review-card.cr-card-shop").map(function(){
return jQuery(this).data("reviewid");
}).get());
var grid_data={
'action': "ivole_show_more_grid_reviews",
'rating': cr_rating,
'attributes': attributes
};
$this.hide();
$spinner.show();
jQuery.post(cr_ajax_object.ajax_url, grid_data, function(response){
$spinner.hide();
$reviews=jQuery(response.html).find(".cr-review-card");
let showMoreBtn=jQuery(response.html).find(".cr-show-more-button");
if($reviews.length){
$this.parents(".cr-reviews-grid").find(".cr-reviews-grid-inner").colcade("append", $reviews);
if(showMoreBtn.length){
$this.text(showMoreBtn.text());
$this.show();
}else{
$this.hide();
}}else{
$this.hide();
}}).fail(function(response){
$spinner.hide();
$this.show();
$this.parent().append('<div style="color:#cd2653;text-align:center;display:block;">'+response.responseText+'</div>');
});
});
jQuery(".cr-reviews-grid .cr-summaryBox-wrap").on("click", ".cr-histogram-a, .cr-seeAllReviews", function(e){
e.preventDefault();
let $this=jQuery(this),
$grid=$this.parents(".cr-reviews-grid"),
$spinner=$grid.find(".cr-show-more-spinner"),
cr_rating=$this.attr("data-rating"),
attributes=$grid.data("attributes");
attributes.show_more=attributes.count + attributes.count_shop_reviews;
attributes.comment__not_in=[];
if(!cr_rating) cr_rating=0;
var grid_data={
'action': "ivole_show_more_grid_reviews",
'rating': cr_rating,
'attributes': attributes
};
$grid.find("div.ivole-summaryBox tr.ivole-histogramRow.ivole-histogramRow-s").removeClass("ivole-histogramRow-s");
if(cr_rating > 0){
$this.closest("tr.ivole-histogramRow").addClass("ivole-histogramRow-s");
}
$grid.find(".cr-reviews-grid-inner").hide();
$grid.find(".cr-show-more-button").hide();
$spinner.show();
$grid.find("div.ivole-summaryBox").addClass("cr-summaryBar-updating");
jQuery.post(cr_ajax_object.ajax_url, grid_data, function(response){
$spinner.hide();
$grid.find(".cr-show-more-button").show();
$grid.find(".cr-summaryBox-wrap .cr-count-filtered-reviews").empty();
$reviews=jQuery(response.html).find(".cr-review-card");
if($reviews.length){
$grid.find(".cr-reviews-grid-inner").colcade("empty");
$grid.find(".cr-reviews-grid-inner").show();
$grid.find(".cr-reviews-grid-inner").colcade("append", $reviews);
$grid.find("div.ivole-summaryBox").removeClass("cr-summaryBar-updating");
$grid.find(".cr-summaryBox-wrap .cr-count-filtered-reviews").append(jQuery(response.html).find(".cr-count-filtered-reviews").html());
}}).fail(function(response){
$spinner.hide();
$this.parent().append('<div style="color: #cd2653;text-align: center;display: block;">'+response.responseText+'</div>');
});
});
jQuery('#cr_floatingtrustbadge').on("click", function(){
if(!jQuery(this).hasClass('cr-floatingbadge-big')){
jQuery(this).find('div.cr-badge.badge_size_compact').hide();
jQuery(this).find('div.cr-badge.badge--wide-mobile').css('display', 'block');
jQuery(this).find('div.cr-floatingbadge-close').css('display', 'block');
jQuery(this).addClass('cr-floatingbadge-big');
var crcolors=jQuery(this).data('crcolors');
if(typeof crcolors!=='undefined'){
jQuery(this).css('border-color', crcolors['big']['border']);
jQuery(this).find('div.cr-floatingbadge-background-top').css('background-color', crcolors['big']['top']);
jQuery(this).find('div.cr-floatingbadge-background-middle').css('background-color', crcolors['big']['middle']);
jQuery(this).find('div.cr-floatingbadge-background-bottom').css('background-color', crcolors['big']['bottom']);
jQuery(this).find('div.cr-floatingbadge-background-bottom').css('border-color', crcolors['big']['border']);
}}
});
jQuery('#cr_floatingtrustbadge .cr-floatingbadge-close').on("click", function(event){
if(jQuery('#cr_floatingtrustbadge').hasClass('cr-floatingbadge-big')){
jQuery(this).closest('#cr_floatingtrustbadge').find('div.cr-badge.badge--wide-mobile').hide();
jQuery(this).closest('#cr_floatingtrustbadge').find('div.cr-badge.badge_size_compact').css('display', 'block');
jQuery(this).closest('#cr_floatingtrustbadge').removeClass('cr-floatingbadge-big');
var crcolors=jQuery(this).closest('#cr_floatingtrustbadge').data('crcolors');
if(typeof crcolors!=='undefined'){
jQuery(this).closest('#cr_floatingtrustbadge').css('border-color', crcolors['small']['border']);
jQuery(this).closest('#cr_floatingtrustbadge').find('div.cr-floatingbadge-background-top').css('background-color', crcolors['small']['top']);
jQuery(this).closest('#cr_floatingtrustbadge').find('div.cr-floatingbadge-background-middle').css('background-color', crcolors['small']['middle']);
jQuery(this).closest('#cr_floatingtrustbadge').find('div.cr-floatingbadge-background-bottom').css('background-color', crcolors['small']['bottom']);
jQuery(this).closest('#cr_floatingtrustbadge').find('div.cr-floatingbadge-background-bottom').css('border-color', crcolors['small']['border']);
}}else{
jQuery('#cr_floatingtrustbadge').hide();
document.cookie='cr_hide_trustbadge=true; path=/; max-age='+60*60*24+';';
}
event.stopPropagation();
});
jQuery('.cr-reviews-slider').on('click', '.cr-slider-read-more a', function (e){
e.preventDefault();
let parent=jQuery(this).parents(".review-text");
parent.find(".cr-slider-read-more").hide();
parent.find(".cr-slider-details").css("display", "inline");
jQuery(this).parents(".cr-reviews-slider").slickk('setPosition');
});
jQuery('.cr-reviews-slider').on('click', '.cr-slider-read-less a', function (e){
e.preventDefault();
let parent=jQuery(this).parents(".review-text");
parent.find(".cr-slider-details").hide();
parent.find(".cr-slider-read-more").css("display", "inline");
jQuery(this).parents(".cr-reviews-slider").slickk('setPosition');
});
jQuery('.cr-reviews-grid').on('click', '.cr-grid-read-more a', function (e){
e.preventDefault();
let parent=jQuery(this).parents(".review-content");
if(0===parent.length){
parent=jQuery(this).parents(".cr-grid-reply-content");
}
parent.find(".cr-grid-read-more").hide();
parent.find(".cr-grid-details").css("display", "inline");
});
jQuery('.cr-reviews-grid').on('click', '.cr-grid-read-less a', function (e){
e.preventDefault();
let parent=jQuery(this).parents(".review-content");
if(0===parent.length){
parent=jQuery(this).parents(".cr-grid-reply-content");
}
parent.find(".cr-grid-details").hide();
parent.find(".cr-grid-read-more").css("display", "inline");
});
jQuery('.cr-qna-block .cr-qna-search-block .cr-qna-ask-button').on('click', function (e){
e.preventDefault();
jQuery(this).closest('.cr-qna-block').addClass('cr-qna-new-q-form-open');
});
jQuery(".cr-qna-block .cr-qna-list-block").on("click", ".cr-qna-ans-button", function (e){
e.preventDefault();
let nameField=jQuery(this).closest('.cr-qna-block').find(".cr-qna-new-q-form .cr-review-form-name");
let nameValue=nameField.find(".cr-review-form-txt").data("defval");
jQuery(this).closest('.cr-qna-list-q-b').find(".cr-qna-list-inl-answ .cr-review-form-name .cr-review-form-txt").val(nameValue);
let emailField=jQuery(this).closest('.cr-qna-block').find(".cr-qna-new-q-form .cr-review-form-email");
let emailValue=emailField.find(".cr-review-form-txt").data("defval");
jQuery(this).closest('.cr-qna-list-q-b').find(".cr-qna-list-inl-answ .cr-review-form-email .cr-review-form-txt").val(emailValue);
jQuery(this).closest('.cr-qna-list-q-b').addClass('cr-qna-ans-form-open');
});
jQuery(".cr-qna-block").on("click", ".cr-show-more-que", function(t){
t.preventDefault();
let qna_block=jQuery(this).parents(".cr-qna-block").eq(0);
let cr_product_id=jQuery(this).attr("data-product");
let cr_page=jQuery(this).attr("data-page");
let cr_attributes=qna_block.data("attributes");
let cr_search=qna_block.find(".cr-ajax-qna-search input").val();
let cr_permalink=jQuery(this).attr("data-permalink");
let cr_data={
"action": "cr_show_more_qna",
"productID": cr_product_id,
"page": cr_page,
"permalink": cr_permalink,
"search": cr_search,
"cr_attributes": cr_attributes
};
qna_block.find(".cr-search-no-qna").hide();
jQuery(this).hide();
qna_block.find("#cr-show-more-q-spinner").show();
jQuery.post(cr_ajax_object.ajax_url, cr_data, function(response){
jQuery(".cr-qna-block #cr-show-more-q-spinner").hide();
if(response.page >=0){
jQuery(".cr-qna-block .cr-qna-list-block .cr-qna-list-block-inner").append(response.html);
jQuery(".cr-qna-block #cr-show-more-q-id").attr("data-page",response.page);
if(!response.last_page){
jQuery(".cr-qna-block #cr-show-more-q-id").show();
}}
if(response.html===""&&response.page===0){
jQuery(".cr-qna-block .cr-search-no-qna").show();
}}, "json");
});
jQuery(".cr-qna-block .cr-ajax-qna-search input").on("keyup", cr_keyup_delay(function(e){
var code=(e.keyCode||e.which);
if(code==37||code==38||code==39||code==40){
return;
}
jQuery(".cr-qna-block #cr-show-more-q-id").attr("data-page", -1);
jQuery(".cr-qna-block .cr-qna-list-block .cr-qna-list-block-inner").empty();
jQuery(".cr-qna-block #cr-show-more-q-id").trigger("click");
}, 500));
jQuery(".cr-qna-block .cr-ajax-qna-search input").on("keyup", function(e){
if(jQuery(this).val()!==""){
jQuery(".cr-qna-block .cr-ajax-qna-search .cr-clear-input").css("display", "inline-block");
}else{
if(jQuery(this).val()==="") jQuery(".cr-qna-block .cr-ajax-qna-search .cr-clear-input").hide();
}}).on("change", function(){
if(jQuery(this).val()==="") jQuery(".cr-qna-block .cr-ajax-qna-search .cr-clear-input").hide();
});
jQuery(".cr-qna-block .cr-ajax-qna-search .cr-clear-input").on("click", function (){
jQuery(this).prev("input").val("");
jQuery(".cr-qna-block .cr-ajax-qna-search .cr-clear-input").hide();
jQuery(".cr-qna-block #cr-show-more-q-id").attr("data-page", -1);
jQuery(".cr-qna-block .cr-qna-list-block .cr-qna-list-block-inner").empty();
jQuery(".cr-qna-block #cr-show-more-q-id").trigger("click");
});
jQuery("body").on("click", "a.cr-qna-link", function (){
const cr_qna_tab=jQuery('.cr_qna_tab a');
if(cr_qna_tab.length){
cr_qna_tab.trigger("click");
}else{
jQuery('.cr-qna-block').parents(':hidden').show();
}
return true;
});
jQuery("body").on("click", ".cr-review-link", function (){
const wc_reviews_tab=jQuery('.reviews_tab a');
if(wc_reviews_tab.length){
wc_reviews_tab.trigger("click");
return true;
}});
jQuery("#cr_review_image").on("change", function (){
jQuery(".cr-upload-images-status").removeClass("cr-upload-images-status-error");
jQuery(".cr-upload-images-status").text(cr_ajax_object.cr_upload_initial);
let allowedTypes=['image/jpeg', 'image/png', 'image/jpg', 'image/gif', 'video/mp4', 'video/mpeg', 'video/ogg', 'video/webm', 'video/quicktime', 'video/x-msvideo'];
let uploadFiles=jQuery("#cr_review_image");
let countFiles=uploadFiles[0].files.length;
let countUploaded=jQuery(".cr-upload-images-preview .cr-upload-images-containers").length;
let lastIndex=1;
let cr_captcha="";
if(jQuery(this).attr("data-lastindex")){
lastIndex=parseInt(jQuery(this).attr("data-lastindex"));
}
if(countFiles + countUploaded > cr_ajax_object.cr_images_upload_limit){
jQuery(".cr-upload-images-status").addClass("cr-upload-images-status-error");
jQuery(".cr-upload-images-status").text(cr_ajax_object.cr_upload_error_too_many);
jQuery(".cr-upload-images-preview .cr-upload-images-containers").not(".cr-upload-ok").remove();
uploadFiles.val("");
return;
}
for(let i=0; i < countFiles; i++){
if(!allowedTypes.includes(uploadFiles[0].files[i].type)){
jQuery(".cr-upload-images-status").addClass("cr-upload-images-status-error");
jQuery(".cr-upload-images-status").text(cr_ajax_object.cr_upload_error_file_type);
jQuery(".cr-upload-images-preview .cr-upload-images-containers").not(".cr-upload-ok").remove();
uploadFiles.val("");
return;
}else if(uploadFiles[0].files[i].size&&uploadFiles[0].files[i].size > cr_ajax_object.cr_images_upload_max_size){
jQuery(".cr-upload-images-status").addClass("cr-upload-images-status-error");
jQuery(".cr-upload-images-status").text(cr_ajax_object.cr_upload_error_file_size);
jQuery(".cr-upload-images-preview .cr-upload-images-containers").not(".cr-upload-ok").remove();
uploadFiles.val("");
return;
}else{
let container=jQuery("<div/>", {class:"cr-upload-images-containers cr-upload-images-container-" + (lastIndex + i)});
let progressBar=jQuery("<div/>", {class:"cr-upload-images-pbar"});
progressBar.append(jQuery("<div/>", {class:"cr-upload-images-pbarin"})
);
if(-1===uploadFiles[0].files[i].type.indexOf('image')){
container.append(jQuery("<svg class='cr-upload-video-thumbnail' viewBox='0 0 576 512'><path d='M336.2 64H47.8C21.4 64 0 85.4 0 111.8v288.4C0 426.6 21.4 448 47.8 448h288.4c26.4 0 47.8-21.4 47.8-47.8V111.8c0-26.4-21.4-47.8-47.8-47.8zm189.4 37.7L416 177.3v157.4l109.6 75.5c21.2 14.6 50.4-.3 50.4-25.8V127.5c0-25.4-29.1-40.4-50.4-25.8z'></path></svg>")
);
}else{
container.append(jQuery("<img>", {class:"cr-upload-images-thumbnail",src:URL.createObjectURL(uploadFiles[0].files[i])})
);
}
container.append(progressBar
);
let removeButton=jQuery("<button/>", {class:"cr-upload-images-delete"});
removeButton.append('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><rect x="0" fill="none" width="20" height="20"/><g><path class="cr-no-icon" d="M12.12 10l3.53 3.53-2.12 2.12L10 12.12l-3.54 3.54-2.12-2.12L7.88 10 4.34 6.46l2.12-2.12L10 7.88l3.54-3.53 2.12 2.12z"/></g></svg>'
);
container.append(removeButton
);
container.append(jQuery("<input>", {name:"cr-upload-images-ids[]",type:"hidden",value:""})
);
container.append(jQuery("<span/>", {class:"cr-upload-images-delete-spinner"})
);
jQuery(".cr-upload-images-preview").append(container);
}}
for(let i=0; i < countFiles; i++){
let formData=new FormData();
formData.append("action", "cr_upload_local_images_frontend");
formData.append("cr_nonce", jQuery(this).attr("data-nonce"));
formData.append("cr_postid", jQuery(this).attr("data-postid"));
formData.append("cr_file", uploadFiles[0].files[i]);
if(typeof grecaptcha!=="undefined"&&cr_ajax_object.ivole_recaptcha==='1'){
cr_captcha=grecaptcha.getResponse();
grecaptcha.reset();
}
formData.append("cr_captcha", cr_captcha);
jQuery.ajax({
url: cr_ajax_object.ajax_url,
data: formData,
processData: false,
contentType: false,
dataType: "json",
type: "POST",
beforeSend: function(){
},
xhr: function(){
var myXhr=jQuery.ajaxSettings.xhr();
if(myXhr.upload){
myXhr.upload.addEventListener('progress', function(e){
if(e.lengthComputable){
let perc=(e.loaded / e.total) * 100;
perc=perc.toFixed(0);
jQuery(".cr-upload-images-preview .cr-upload-images-containers.cr-upload-images-container-" + (lastIndex + i) + " .cr-upload-images-pbar .cr-upload-images-pbarin").width(perc + "%");
}}, false);
}
return myXhr;
},
success: function(response){
if(200===response["code"]){
let idkey=JSON.stringify({ id: response["attachment"]["id"], key: response["attachment"]["key"] });
jQuery(".cr-upload-images-preview .cr-upload-images-containers.cr-upload-images-container-" + (lastIndex + i) + " input").val(idkey);
jQuery(".cr-upload-images-preview .cr-upload-images-containers.cr-upload-images-container-" + (lastIndex + i)).addClass("cr-upload-ok");
jQuery(".cr-upload-images-preview .cr-upload-images-containers.cr-upload-images-container-" + (lastIndex + i) + " button").attr("data-delnonce",response["attachment"]["nonce"]);
}else if(500 <=response["code"]){
jQuery(".cr-upload-images-preview .cr-upload-images-containers.cr-upload-images-container-" + (lastIndex + i)).remove();
jQuery(".cr-upload-images-status").addClass("cr-upload-images-status-error");
jQuery(".cr-upload-images-status").text(response["message"]);
}}
});
}
jQuery(this).attr("data-lastindex", lastIndex + countFiles);
uploadFiles.val("");
});
jQuery(".cr-upload-images-preview").on("click", ".cr-upload-images-delete", function (e){
e.preventDefault();
jQuery(".cr-upload-images-status").removeClass("cr-upload-images-status-error");
jQuery(".cr-upload-images-status").text(cr_ajax_object.cr_upload_initial);
let classList=jQuery(this).parent().eq(0).attr("class").split(/\s+/);
let classes="";
jQuery.each(classList, function(index, item){
classes +="." + item;
});
let ajaxData={
"action": "cr_delete_local_images_frontend",
"cr_nonce": jQuery(this).attr("data-delnonce"),
"image": jQuery(this).parent().children("input").eq(0).val(),
"class": classes
}
jQuery(this).parent().addClass("cr-upload-delete-pending");
jQuery.post(cr_ajax_object.ajax_url, ajaxData, function(response){
if(200===response["code"]&&response["class"]){
jQuery(".cr-upload-images-preview " + response["class"]).remove();
}
jQuery(".cr-upload-images-preview " + response["class"]).removeClass("cr-upload-delete-pending");
}, "json");
});
jQuery(".cr-review-form-rating .cr-review-form-rating-inner").on("mouseenter",
function(){
let rating=parseInt(jQuery(this).data("rating"));
let ratingActv=parseInt(jQuery(this).closest(".cr-review-form-rating-cont").find(".cr-review-form-rating-actv").data("rating"));
if(isNaN(ratingActv)){
ratingActv=0;
}
for(r=1; r < 6; r++){
if(r > rating&&r > ratingActv){
jQuery(this).closest(".cr-review-form-rating-cont").find(".cr-review-form-rating-inner[data-rating=" + r + "] .cr-rating-act").hide();
jQuery(this).closest(".cr-review-form-rating-cont").find(".cr-review-form-rating-inner[data-rating=" + r + "] .cr-rating-deact").show();
}else{
jQuery(this).closest(".cr-review-form-rating-cont").find(".cr-review-form-rating-inner[data-rating=" + r + "] .cr-rating-deact").hide();
jQuery(this).closest(".cr-review-form-rating-cont").find(".cr-review-form-rating-inner[data-rating=" + r + "] .cr-rating-act").show();
}}
jQuery(this).closest(".cr-review-form-rating-cont").find(".cr-review-form-rating-nbr").text(rating + "/5");
}
).on("mouseleave",
function(){
let ratingActv=parseInt(jQuery(this).closest(".cr-review-form-rating-cont").find(".cr-review-form-rating-actv").data("rating"));
if(isNaN(ratingActv)){
ratingActv=0;
}
for(r=1; r < 6; r++){
if(r > ratingActv){
jQuery(this).closest(".cr-review-form-rating-cont").find(".cr-review-form-rating-inner[data-rating=" + r + "] .cr-rating-act").hide();
jQuery(this).closest(".cr-review-form-rating-cont").find(".cr-review-form-rating-inner[data-rating=" + r + "] .cr-rating-deact").show();
}else{
jQuery(this).closest(".cr-review-form-rating-cont").find(".cr-review-form-rating-inner[data-rating=" + r + "] .cr-rating-deact").hide();
jQuery(this).closest(".cr-review-form-rating-cont").find(".cr-review-form-rating-inner[data-rating=" + r + "] .cr-rating-act").show();
}}
jQuery(this).closest(".cr-review-form-rating-cont").find(".cr-review-form-rating-nbr").text(ratingActv + "/5");
}
);
jQuery(".cr-review-form-rating .cr-review-form-rating-inner").on("click", function(e){
e.preventDefault();
let rating=parseInt(jQuery(this).data("rating"));
jQuery(this).closest(".cr-review-form-rating-cont").find(".cr-review-form-rating-inner").removeClass("cr-review-form-rating-actv");
jQuery(this).addClass("cr-review-form-rating-actv");
for(r=1; r < 6; r++){
if(r > rating){
jQuery(this).closest(".cr-review-form-rating-cont").find(".cr-review-form-rating-inner[data-rating=" + r + "] .cr-rating-act").hide();
jQuery(this).closest(".cr-review-form-rating-cont").find(".cr-review-form-rating-inner[data-rating=" + r + "] .cr-rating-deact").show();
}else{
jQuery(this).closest(".cr-review-form-rating-cont").find(".cr-review-form-rating-inner[data-rating=" + r + "] .cr-rating-deact").hide();
jQuery(this).closest(".cr-review-form-rating-cont").find(".cr-review-form-rating-inner[data-rating=" + r + "] .cr-rating-act").show();
}}
jQuery(this).closest(".cr-review-form-rating-cont").find(".cr-review-form-rating-nbr").text(rating + "/5");
jQuery(this).closest(".cr-review-form-rating").find(".cr-review-form-rating-inp").val(rating);
jQuery(this).closest(".cr-review-form-rating").removeClass("cr-review-form-error");
});
jQuery(".cr-all-reviews-shortcode .cr-nav-left svg, .cr-all-reviews-shortcode .cr-nav-right svg, .cr-all-reviews-shortcode .cr-review-form-cancel").on("click", function(e){
jQuery(this).closest(".cr-all-reviews-shortcode").removeClass("cr-all-reviews-new-review");
jQuery(this).closest(".cr-review-form-wrap").removeClass("cr-review-form-res");
cr_reset_review_form(jQuery(this));
});
jQuery(".cr-all-reviews-shortcode .cr-review-form-wrap").on("click", ".cr-review-form-success", function(e){
jQuery(this).closest(".cr-all-reviews-shortcode").removeClass("cr-all-reviews-new-review");
jQuery(this).closest(".cr-review-form-wrap").removeClass("cr-review-form-res");
cr_reset_review_form(jQuery(this));
window.location.reload();
});
jQuery(".cr-review-form-wrap").on("click", ".cr-review-form-error", function(e){
jQuery(this).closest(".cr-review-form-wrap").removeClass("cr-review-form-res");
});
jQuery(".cr-ajax-reviews-review-form .cr-nav-left svg, .cr-ajax-reviews-review-form .cr-nav-right svg, .cr-ajax-reviews-review-form .cr-review-form-cancel").on("click", function(e){
jQuery(this).closest(".cr-reviews-ajax-reviews").find(".cr-reviews-ajax-comments").show();
jQuery(this).closest(".cr-reviews-ajax-reviews").find(".cr-ajax-reviews-review-form").hide();
jQuery(this).closest(".cr-review-form-wrap").removeClass("cr-review-form-res");
cr_reset_review_form(jQuery(this));
});
jQuery(".cr-ajax-reviews-review-form .cr-review-form-wrap").on("click", ".cr-review-form-success", function(e){
jQuery(this).closest(".cr-reviews-ajax-reviews").find(".cr-reviews-ajax-comments").show();
jQuery(this).closest(".cr-reviews-ajax-reviews").find(".cr-ajax-reviews-review-form").hide();
jQuery(this).closest(".cr-review-form-wrap").removeClass("cr-review-form-res");
cr_reset_review_form(jQuery(this));
if(window.location.hash!=='#reviews'){
window.location.href=window.location.pathname + '#reviews';
}
window.location.reload();
});
jQuery(".cr-reviews-grid .cr-nav-left svg, .cr-reviews-grid .cr-nav-right svg, .cr-reviews-grid .cr-review-form-cancel").on("click", function(e){
jQuery(this).closest(".cr-reviews-grid").removeClass("cr-reviews-grid-new-review");
jQuery(this).closest(".cr-review-form-wrap").removeClass("cr-review-form-res");
cr_reset_review_form(jQuery(this));
});
jQuery(".cr-reviews-grid .cr-review-form-wrap").on("click", ".cr-review-form-success", function(e){
jQuery(this).closest(".cr-reviews-grid").removeClass("cr-reviews-grid-new-review");
jQuery(this).closest(".cr-review-form-wrap").removeClass("cr-review-form-res");
cr_reset_review_form(jQuery(this));
window.location.reload();
});
jQuery(".cr-qna-block").on("click", ".cr-qna-new-q-form .cr-nav-left svg, .cr-qna-new-q-form .cr-nav-right svg, .cr-qna-new-q-form .cr-review-form-cancel", function(e){
jQuery(this).closest(".cr-qna-block").removeClass("cr-qna-new-q-form-open");
jQuery(this).closest(".cr-qna-new-q-form").removeClass("cr-review-form-res");
cr_reset_qna_form(jQuery(this));
});
jQuery(".cr-qna-block").on("click", ".cr-qna-new-q-form .cr-review-form-success", function(e){
jQuery(this).closest(".cr-qna-block").removeClass("cr-qna-new-q-form-open");
jQuery(this).closest(".cr-qna-new-q-form").removeClass("cr-review-form-res");
cr_reset_qna_form(jQuery(this));
});
jQuery(".cr-qna-block").on("click", ".cr-qna-new-q-form .cr-review-form-error", function(e){
jQuery(this).closest(".cr-qna-new-q-form").removeClass("cr-review-form-res");
});
jQuery(".cr-qna-block").on("click", ".cr-qna-list-inl-answ .cr-nav-left svg, .cr-qna-list-inl-answ .cr-nav-right svg, .cr-qna-list-inl-answ .cr-review-form-cancel", function(e){
jQuery(this).closest(".cr-qna-list-q-b").removeClass("cr-qna-ans-form-open");
jQuery(this).closest(".cr-qna-list-inl-answ").removeClass("cr-review-form-res");
cr_reset_ans_form(jQuery(this));
});
jQuery(".cr-qna-block").on("click", ".cr-qna-list-inl-answ .cr-review-form-success", function(e){
jQuery(this).closest(".cr-qna-list-q-b").removeClass("cr-qna-ans-form-open");
jQuery(this).closest(".cr-qna-list-inl-answ").removeClass("cr-review-form-res");
cr_reset_ans_form(jQuery(this));
});
jQuery(".cr-qna-block").on("click", ".cr-qna-list-inl-answ .cr-review-form-error", function(e){
jQuery(this).closest(".cr-qna-list-inl-answ").removeClass("cr-review-form-res");
});
jQuery(".cr-review-form-wrap .cr-review-form-submit").on("click", function(e){
if(0 < jQuery(this).closest(".cr-review-form-wrap").find(".cr-form-item-media-preview .cr-upload-images-containers:not(.cr-upload-ok)").length){
return false;
}
jQuery(this).closest(".cr-review-form-wrap").find(".cr-review-form-rating").removeClass("cr-review-form-error");
jQuery(this).closest(".cr-review-form-wrap").find(".cr-review-form-comment").removeClass("cr-review-form-error");
jQuery(this).closest(".cr-review-form-wrap").find(".cr-review-form-name").removeClass("cr-review-form-error");
jQuery(this).closest(".cr-review-form-wrap").find(".cr-review-form-email").removeClass("cr-review-form-error");
jQuery(this).closest(".cr-review-form-wrap").find(".cr-onsite-question").removeClass("cr-review-form-error");
jQuery(this).closest(".cr-review-form-wrap").find(".cr-form-item-media").removeClass("cr-review-form-error");
jQuery(this).closest(".cr-review-form-wrap").find(".cr-review-form-captcha").removeClass("cr-review-form-error");
jQuery(this).closest(".cr-review-form-wrap").find(".cr-review-form-terms").removeClass("cr-review-form-error");
if(cr_validate_review_form(jQuery(this))){
let onsiteQuestions={};
jQuery(this).closest(".cr-review-form-wrap").find(".cr-review-form-rating input[type='hidden']").each(function(){
onsiteQuestions[jQuery(this).attr('name')]=jQuery(this).val();
}
)
jQuery(this).closest(".cr-review-form-wrap").find(".cr-onsite-question input").each(function(){
onsiteQuestions[jQuery(this).attr('name')]=jQuery(this).val();
}
)
let captchaResponse='';
if(0 < jQuery(this).closest(".cr-review-form-wrap").find('.cr-review-form-captcha .cr-recaptcha').length){
if(grecaptcha){
captchaResponse=grecaptcha.getResponse();
}}
let cr_data={
"action": "cr_submit_review",
"rating": jQuery(this).closest(".cr-review-form-wrap").find(".cr-review-form-rating-overall .cr-review-form-rating-inp").val(),
"review": jQuery(this).closest(".cr-review-form-wrap").find(".cr-review-form-comment-txt").val().trim(),
"name": jQuery(this).closest(".cr-review-form-wrap").find(".cr-review-form-name .cr-review-form-txt").val().trim(),
"id": jQuery(this).closest(".cr-review-form-wrap").find(".cr-review-form-item-id").val(),
"email": jQuery(this).closest(".cr-review-form-wrap").find(".cr-review-form-email .cr-review-form-txt").val().trim(),
"onsiteQuestions": onsiteQuestions,
"cr-upload-images-ids": jQuery(this).closest(".cr-review-form-wrap").find(".cr-form-item-media .cr-upload-images-containers input").map(function(){
return jQuery(this).val();
}).get(),
'g-recaptcha-response': captchaResponse
};
jQuery(this).closest(".cr-review-form-wrap").addClass("cr-review-form-submitting");
jQuery(this).closest(".cr-review-form-wrap").find(".cr-review-form-continue").removeClass("cr-review-form-success");
jQuery(this).closest(".cr-review-form-wrap").find(".cr-review-form-continue").removeClass("cr-review-form-error");
jQuery.post({
url: cr_ajax_object.ajax_url,
data: cr_data,
context: jQuery(this),
success: function(response){
if(! Object.hasOwn(response, 'button')){
response.button='OK';
}
if(! Object.hasOwn(response, 'description')){
response.description='An unexpected error that could be caused by a third-party plugin';
}
this.closest(".cr-review-form-wrap").removeClass("cr-review-form-submitting");
this.closest(".cr-review-form-wrap").addClass("cr-review-form-res");
this.closest(".cr-review-form-wrap").find(".cr-review-form-result span").html(response.description);
this.closest(".cr-review-form-wrap").find(".cr-review-form-continue").html(response.button);
if(0===response.code){
this.closest(".cr-review-form-wrap").find(".cr-review-form-continue").addClass("cr-review-form-success");
}else{
this.closest(".cr-review-form-wrap").find(".cr-review-form-continue").addClass("cr-review-form-error");
}},
dataType: "json"
}
);
};});
jQuery(".cr-qna-block .cr-qna-new-q-form").on("click", ".cr-review-form-submit", function(e){
jQuery(this).closest(".cr-qna-new-q-form").find(".cr-review-form-comment").removeClass("cr-review-form-error");
jQuery(this).closest(".cr-qna-new-q-form").find(".cr-review-form-name").removeClass("cr-review-form-error");
jQuery(this).closest(".cr-qna-new-q-form").find(".cr-review-form-email").removeClass("cr-review-form-error");
jQuery(this).closest(".cr-qna-new-q-form").find(".cr-review-form-terms").removeClass("cr-review-form-error");
if(cr_validate_qna(jQuery(this))){
let cr_data={
"action": "cr_new_qna",
"crNonce": jQuery(this).closest(".cr-qna-block").data("nonce"),
"currentPostID": jQuery(this).closest(".cr-qna-new-q-form").find(".cr-review-form-item-id").val(),
"text": jQuery(this).closest(".cr-qna-new-q-form").find(".cr-review-form-comment-txt").val().trim(),
"name": jQuery(this).closest(".cr-qna-new-q-form").find(".cr-review-form-name .cr-review-form-txt").val().trim(),
"email": jQuery(this).closest(".cr-qna-new-q-form").find(".cr-review-form-email .cr-review-form-txt").val().trim()
};
jQuery(this).closest(".cr-qna-new-q-form").addClass("cr-review-form-submitting");
jQuery(this).closest(".cr-qna-new-q-form").find(".cr-review-form-continue").removeClass("cr-review-form-success");
jQuery(this).closest(".cr-qna-new-q-form").find(".cr-review-form-continue").removeClass("cr-review-form-error");
const postQuestion=(token, data, ref)=> {
data.cptcha=token;
jQuery.post({
url: cr_ajax_object.ajax_url,
data: data,
context: jQuery(ref),
success: function(response){
this.closest(".cr-qna-new-q-form").removeClass("cr-review-form-submitting");
this.closest(".cr-qna-new-q-form").addClass("cr-review-form-res");
this.closest(".cr-qna-new-q-form").find(".cr-review-form-result span").html(response.description);
this.closest(".cr-qna-new-q-form").find(".cr-review-form-continue").html(response.button);
if(0===response.code){
this.closest(".cr-qna-new-q-form").find(".cr-review-form-continue").addClass("cr-review-form-success");
}else{
this.closest(".cr-qna-new-q-form").find(".cr-review-form-continue").addClass("cr-review-form-error");
}},
dataType: "json"
}
);
};
let cr_cptcha=jQuery(this).attr("data-crcptcha");
var rf=this;
if(cr_cptcha&&cr_cptcha.length > 0){
grecaptcha.ready(function(){
grecaptcha.execute(cr_cptcha, {action: 'submit'}).then(function(token){
postQuestion(token, cr_data, rf)
});
});
}else{
postQuestion('', cr_data, rf);
}};});
jQuery(".cr-qna-block").on("click", ".cr-qna-list-inl-answ .cr-review-form-submit", function(e){
jQuery(this).closest(".cr-qna-list-inl-answ").find(".cr-review-form-comment").removeClass("cr-review-form-error");
jQuery(this).closest(".cr-qna-list-inl-answ").find(".cr-review-form-name").removeClass("cr-review-form-error");
jQuery(this).closest(".cr-qna-list-inl-answ").find(".cr-review-form-email").removeClass("cr-review-form-error");
jQuery(this).closest(".cr-qna-list-inl-answ").find(".cr-review-form-terms").removeClass("cr-review-form-error");
if(cr_validate_ans(jQuery(this))){
let cr_data={
"action": "cr_new_qna",
"crNonce": jQuery(this).closest(".cr-qna-block").data("nonce"),
"currentPostID": jQuery(this).closest(".cr-qna-block").find(".cr-review-form-item-id").val(),
"questionID": jQuery(this).closest(".cr-qna-list-q-b").data("question"),
"productID": jQuery(this).closest(".cr-qna-list-q-b").data("post"),
"text": jQuery(this).closest(".cr-qna-list-inl-answ").find(".cr-review-form-comment-txt").val().trim(),
"name": jQuery(this).closest(".cr-qna-list-inl-answ").find(".cr-review-form-name .cr-review-form-txt").val().trim(),
"email": jQuery(this).closest(".cr-qna-list-inl-answ").find(".cr-review-form-email .cr-review-form-txt").val().trim()
};
jQuery(this).closest(".cr-qna-list-inl-answ").addClass("cr-review-form-submitting");
jQuery(this).closest(".cr-qna-list-inl-answ").find(".cr-review-form-continue").removeClass("cr-review-form-success");
jQuery(this).closest(".cr-qna-list-inl-answ").find(".cr-review-form-continue").removeClass("cr-review-form-error");
const postQuestion=(token, data, ref)=> {
data.cptcha=token;
jQuery.post({
url: cr_ajax_object.ajax_url,
data: data,
context: jQuery(ref),
success: function(response){
this.closest(".cr-qna-list-inl-answ").removeClass("cr-review-form-submitting");
this.closest(".cr-qna-list-inl-answ").addClass("cr-review-form-res");
this.closest(".cr-qna-list-inl-answ").find(".cr-review-form-result span").html(response.description);
this.closest(".cr-qna-list-inl-answ").find(".cr-review-form-continue").html(response.button);
if(0===response.code){
this.closest(".cr-qna-list-inl-answ").find(".cr-review-form-continue").addClass("cr-review-form-success");
}else{
this.closest(".cr-qna-list-inl-answ").find(".cr-review-form-continue").addClass("cr-review-form-error");
}},
dataType: "json"
}
);
};
let cr_cptcha=jQuery(this).attr("data-crcptcha");
var rf=this;
if(cr_cptcha&&cr_cptcha.length > 0&&grecaptcha){
grecaptcha.ready(function(){
grecaptcha.execute(cr_cptcha, {action: 'submit'}).then(function(token){
postQuestion(token, cr_data, rf)
});
});
}else{
postQuestion('', cr_data, rf);
}};});
jQuery(".cr-single-product-review").on("click", ".cr-single-product-rev-submit", function(t){
let validationResult=true;
let reviewForm=jQuery(this).closest(".cr-single-product-review");
reviewForm.find(".cr-review-form-rating-cont.cr-review-form-rating-req").each(function(index){
if(1 > jQuery(this).find(".cr-review-form-rating-actv").length){
jQuery(this).closest(".cr-review-form-rating").addClass("cr-review-form-error");
validationResult=false;
}});
reviewForm.find(".cr-onsite-question.cr-review-form-que-req").each(function(index){
if(1 > jQuery(this).find("input[type=text]").val().trim().length){
jQuery(this).closest(".cr-onsite-question").addClass("cr-review-form-error");
validationResult=false;
}else{
jQuery(this).closest(".cr-onsite-question").removeClass("cr-review-form-error");
}});
reviewForm.find(".cr-review-form-textbox").each(function(index){
if(1 > jQuery(this).val().trim().length){
jQuery(this).addClass("cr-review-form-error");
validationResult=false;
}else{
jQuery(this).removeClass("cr-review-form-error");
}});
if(0 < reviewForm.find('.cr-review-form-terms').length){
if(! reviewForm.find('.cr-review-form-terms .cr-review-form-checkbox').is(':checked')){
alert('Please tick the checkbox to proceed');
validationResult=false;
}}
if(! validationResult){
t.preventDefault();
}});
jQuery(".cr-all-reviews-add-review").on("click", function(t){
t.preventDefault();
if(0 < jQuery(this).closest(".cr-all-reviews-shortcode").length){
jQuery(this).closest(".cr-all-reviews-shortcode").addClass("cr-all-reviews-new-review");
}
if(0 < jQuery(this).closest(".cr-reviews-grid").length){
jQuery(this).closest(".cr-reviews-grid").addClass("cr-reviews-grid-new-review");
}});
jQuery(".cr-review-form-wrap .cr-form-item-media-none").on("click", function(t){
jQuery(this).parent().find("input.cr-form-item-media-file").trigger("click");
});
jQuery(".cr-review-form-wrap .cr-form-item-media-preview").on("click", ".cr-form-item-media-add", function(t){
jQuery(this).parents(".cr-form-item-media").find("input.cr-form-item-media-file").trigger("click");
});
jQuery(".cr-review-form-wrap .cr-form-item-media .cr-form-item-media-file").on("change", function (){
let allowedTypes=['image/jpeg', 'image/png', 'image/jpg', 'image/gif', 'video/mp4', 'video/mpeg', 'video/ogg', 'video/webm', 'video/quicktime', 'video/x-msvideo'],
uploadFiles=jQuery(this),
countFiles=uploadFiles[0].files.length,
lastIndex=1,
mediaPreview=jQuery(this).parent().find(".cr-form-item-media-preview"),
countUploaded=mediaPreview.children(".cr-upload-images-containers").length;
jQuery(this).closest(".cr-form-item-media").removeClass("cr-review-form-error");
if(jQuery(this).attr("data-lastindex")){
lastIndex=parseInt(jQuery(this).attr("data-lastindex"));
}
if(countFiles + countUploaded > cr_ajax_object.cr_images_upload_limit){
jQuery(this).closest(".cr-form-item-media").addClass("cr-review-form-error");
jQuery(this).closest(".cr-form-item-media").find(".cr-review-form-field-error").text(cr_ajax_object.cr_upload_error_too_many);
uploadFiles.val("");
return;
}
for(let i=0; i < countFiles; i++){
if(!allowedTypes.includes(uploadFiles[0].files[i].type)){
jQuery(this).closest(".cr-form-item-media").addClass("cr-review-form-error");
jQuery(this).closest(".cr-form-item-media").find(".cr-review-form-field-error").text(cr_ajax_object.cr_upload_error_file_type);
uploadFiles.val("");
return;
}else if(uploadFiles[0].files[i].size&&uploadFiles[0].files[i].size > cr_ajax_object.cr_images_upload_max_size * 100){
jQuery(this).closest(".cr-form-item-media").addClass("cr-review-form-error");
jQuery(this).closest(".cr-form-item-media").find(".cr-review-form-field-error").text(cr_ajax_object.cr_upload_error_file_size);
uploadFiles.val("");
return;
}else{
let container=jQuery("<div/>", {class:"cr-upload-images-containers cr-upload-images-container-" + (lastIndex + i)});
let progressBar=jQuery("<div/>", {class:"cr-upload-images-pbar"});
progressBar.append(jQuery("<div/>", {class:"cr-upload-images-pbarin"})
);
if(-1===uploadFiles[0].files[i].type.indexOf('image')){
container.append(jQuery("<svg class='cr-upload-video-thumbnail' viewBox='0 0 576 512'><path d='M336.2 64H47.8C21.4 64 0 85.4 0 111.8v288.4C0 426.6 21.4 448 47.8 448h288.4c26.4 0 47.8-21.4 47.8-47.8V111.8c0-26.4-21.4-47.8-47.8-47.8zm189.4 37.7L416 177.3v157.4l109.6 75.5c21.2 14.6 50.4-.3 50.4-25.8V127.5c0-25.4-29.1-40.4-50.4-25.8z'></path></svg>")
);
}else{
container.append(jQuery("<img>", {class:"cr-upload-images-thumbnail", src:URL.createObjectURL(uploadFiles[0].files[i])})
);
}
container.append(progressBar
);
let removeButton=jQuery("<button/>", {class:"cr-upload-images-delete"});
removeButton.append('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><rect x="0" fill="none" width="20" height="20"/><g><path class="cr-no-icon" d="M12.12 10l3.53 3.53-2.12 2.12L10 12.12l-3.54 3.54-2.12-2.12L7.88 10 4.34 6.46l2.12-2.12L10 7.88l3.54-3.53 2.12 2.12z"/></g></svg>'
);
container.append(removeButton
);
container.append(jQuery("<input>", {name:"cr-upload-images-ids[]",type:"hidden",value:""})
);
container.append(jQuery("<span/>", {class:"cr-upload-images-delete-spinner"})
);
mediaPreview.find(".cr-form-item-media-add").remove();
mediaPreview.append(container);
if(countFiles + countUploaded < cr_ajax_object.cr_images_upload_limit){
mediaPreview.append(jQuery("<div class='cr-form-item-media-add'>+</div>")
);
}}
}
if(0 < mediaPreview.children(".cr-upload-images-containers").length&&! mediaPreview.hasClass("cr-form-visible")){
mediaPreview.parents(".cr-form-item-subcontainer").addClass("cr-form-visible");
}
for(let i=0; i < countFiles; i++){
let formData=new FormData();
formData.append("action", "cr_upload_media");
formData.append("cr_file", uploadFiles[0].files[i]);
formData.append("cr_item", jQuery(this).closest(".cr-review-form-wrap").find(".cr-review-form-item-id").val());
var currentFileInput=jQuery(this);
jQuery.ajax({
url: cr_ajax_object.ajax_url,
data: formData,
processData: false,
contentType: false,
dataType: "json",
type: "POST",
context: this,
beforeSend: function(){
},
xhr: function(){
var myXhr=jQuery.ajaxSettings.xhr();
if(myXhr.upload){
myXhr.upload.addEventListener('progress', function(e){
if(e.lengthComputable){
let perc=(e.loaded / e.total) * 100;
perc=perc.toFixed(0);
currentFileInput.parent().find(".cr-form-item-media-preview .cr-upload-images-containers.cr-upload-images-container-" + (lastIndex + i) + " .cr-upload-images-pbar .cr-upload-images-pbarin").width(perc + "%");
}}, false);
}
return myXhr;
},
success: function(response){
if(200===response["code"]){
let idkey=JSON.stringify({ "id": response["attachment"]["id"], "key": response["attachment"]["key"] });
currentFileInput.parent().find(".cr-form-item-media-preview .cr-upload-images-containers.cr-upload-images-container-" + (lastIndex + i) + " input").val(idkey);
currentFileInput.parent().find(".cr-form-item-media-preview .cr-upload-images-containers.cr-upload-images-container-" + (lastIndex + i)).addClass("cr-upload-ok");
}else if(500 <=response["code"]){
currentFileInput.parent().find(".cr-form-item-media-preview .cr-upload-images-containers.cr-upload-images-container-" + (lastIndex + i)).remove();
let mediaPreview=jQuery(this).closest(".cr-form-item-media").find(".cr-form-item-media-preview");
let countUploaded=mediaPreview.find(".cr-upload-images-containers").length;
if(0 < countUploaded){
if(0===mediaPreview.children(".cr-form-item-media-add").length){
mediaPreview.append(jQuery("<div class='cr-form-item-media-add'>+</div>")
);
}}else{
mediaPreview.removeClass("cr-form-visible");
mediaPreview.parents(".cr-form-item-subcontainer").removeClass("cr-form-visible");
}
jQuery(this).closest(".cr-form-item-media").addClass("cr-review-form-error");
jQuery(this).closest(".cr-form-item-media").find(".cr-review-form-field-error").text(response["message"]);
}}
});
}
jQuery(this).attr("data-lastindex", lastIndex + countFiles);
uploadFiles.val("");
});
jQuery(".cr-review-form-wrap .cr-form-item-media-preview").on("click", ".cr-upload-images-delete", function (e){
e.preventDefault();
let imgContainer=jQuery(this).parent(),
mediaPreview=imgContainer.parent();
let ajaxData={
"action": "cr_delete_media",
"image": jQuery(this).parent().children("input").eq(0).val()
}
imgContainer.addClass("cr-upload-delete-pending");
jQuery.post(cr_ajax_object.ajax_url, ajaxData, function(response){
imgContainer.removeClass("cr-upload-delete-pending");
if(200===response["code"]){
imgContainer.remove();
let countUploaded=mediaPreview.children(".cr-upload-images-containers").length;
if(0 < countUploaded){
if(0===mediaPreview.children(".cr-form-item-media-add").length){
mediaPreview.append(jQuery("<div class='cr-form-item-media-add'>+</div>")
);
}}else{
mediaPreview.removeClass("cr-form-visible");
mediaPreview.parents(".cr-form-item-subcontainer").removeClass("cr-form-visible");
}}
}, "json");
});
cr_maybe_download_media_frontend();
if("object"===typeof elementorFrontend&&"hooks" in elementorFrontend){
elementorFrontend.hooks.addAction("frontend/element_ready/widget", function($scope){
if(-1!==$scope.data("widget_type").indexOf("shortcode")){
if(0 < $scope.find(".cr-reviews-grid-inner").length){
crResizeAllGridItems();
}}
});
}});
const crValidateEmail=(email)=> {
return email.match(/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
);
};
function initVoteClick(sel1, sel2, action){
jQuery(sel1).on("click", sel2, function(e){
e.preventDefault();
let reviewIDhtml=jQuery(this).data("vote");
let parent=jQuery(this).parents(".cr-voting-cont-uni");
if(reviewIDhtml!=null){
let reviewID=reviewIDhtml;
let data={
"action": action,
"reviewID": reviewID,
"upvote": jQuery(this).data("upvote")
};
parent.find(".cr-voting-a").removeClass("cr-voting-active");
parent.find(".cr-voting-a").addClass("cr-voting-update");
jQuery.post(cr_ajax_object.ajax_url, data, function(response){
parent.find(".cr-voting-a").removeClass("cr-voting-update");
if(response.code===0){
if(response.votes){
parent.find(".cr-voting-upvote-count").text("(" +  response.votes.upvotes + ")");
parent.find(".cr-voting-downvote-count").text("(" +  response.votes.downvotes + ")");
}
if(0!==response.votes.current){
if(0 < response.votes.current){
parent.find(".cr-voting-upvote").addClass("cr-voting-active");
}else{
parent.find(".cr-voting-downvote").addClass("cr-voting-active");
}}
}}, "json");
}});
}
function cr_keyup_delay(fn, ms){
let timer=0;
return function(...args){
clearTimeout(timer);
timer=setTimeout(fn.bind(this, ...args), ms||0);
};}
function cr_filter_all_reviews(refElement, show_more=false){
let attributes=refElement.parents(".cr-all-reviews-shortcode").data("attributes"),
cr_rating=refElement.parents(".cr-all-reviews-shortcode").find(".ivole-summaryBox .ivole-histogramRow.ivole-histogramRow-s .cr-histogram-a").attr("data-rating"),
cr_search=refElement.parents(".cr-all-reviews-shortcode").find(".cr-ajax-search input").val(),
cr_sort=refElement.parents(".cr-all-reviews-shortcode").find(".cr-ajax-reviews-sort").children("option:selected").val();
let cr_tags=[];
refElement.parents(".cr-all-reviews-shortcode").find(".cr-review-tags-filter .cr-tags-filter.cr-tag-selected").each(function(){
cr_tags.push(jQuery(this).attr("data-crtagid"));
}
);
let cr_data={
"action": "cr_show_more_all_reviews",
"attributes": attributes,
"rating": cr_rating,
"page": 0,
"search": cr_search,
"sort": cr_sort,
"tags": cr_tags
};
if(show_more){
cr_data.page=refElement.data("page");
jQuery(".cr-search-no-reviews").hide();
jQuery('.cr-show-more-button').hide();
if(refElement.hasClass("cr-page-numbers-a")){
refElement.closest(".cr-all-reviews-shortcode").find(".commentlist").addClass("cr-pagination-load");
refElement.closest(".cr-all-reviews-shortcode").find(".cr-all-reviews-pagination").addClass("cr-pagination-load");
}else{
refElement.closest(".cr-all-reviews-shortcode").find(".cr-show-more-review-spinner").show();
}
jQuery.post({
url: cr_ajax_object.ajax_url,
data: cr_data,
context: refElement,
success: function(response){
let shcode=jQuery(this).closest(".cr-all-reviews-shortcode");
shcode.find(".cr-show-more-review-spinner").hide();
if(response.html!==""){
if(jQuery(this).hasClass("cr-page-numbers-a")){
shcode.find(".commentlist").find("*").not(".cr-pagination-review-spinner").remove();
shcode.find(".commentlist").prepend(response.html);
}else{
shcode.find(".commentlist").append(response.html);
}
if(! response.last_page){
shcode.find(".cr-show-more-button").text(response.show_more_label);
shcode.find(".cr-show-more-button").show();
}
shcode.find(".cr-show-more-button").data("page", response.page);
shcode.find(".cr-count-row .cr-count-row-count").html(response.count_row);
if(response.pagination!==""){
shcode.find(".cr-all-reviews-pagination").html(response.pagination);
}}else{
shcode.find(".cr-show-more-button").hide();
}
if(response.html==""&&response.page===1){
shcode.find(".cr-search-no-reviews").show();
}
shcode.find(".commentlist").removeClass("cr-pagination-load");
shcode.find(".cr-all-reviews-pagination").removeClass("cr-pagination-load");
},
dataType: "json"
}
);
}else{
refElement.closest(".cr-all-reviews-shortcode").find(".cr-search-no-reviews").hide();
refElement.closest(".cr-all-reviews-shortcode").find(".cr-show-more-button").hide();
refElement.closest(".cr-all-reviews-shortcode").find(".commentlist").hide();
refElement.closest(".cr-all-reviews-shortcode").find(".cr-show-more-review-spinner").show();
refElement.closest(".cr-all-reviews-shortcode").find(".ivole-summaryBox").addClass("cr-summaryBar-updating");
refElement.closest(".cr-all-reviews-shortcode").find(".cr-seeAllReviews").addClass("cr-seeAll-updating");
refElement.closest(".cr-all-reviews-shortcode").find(".cr-ajax-reviews-sort").addClass("cr-sort-updating");
refElement.closest(".cr-all-reviews-shortcode").find(".cr-review-tags-filter").addClass("cr-tags-updating");
refElement.closest(".cr-all-reviews-shortcode").find(".cr-all-reviews-pagination").hide();
jQuery.post({
url: cr_ajax_object.ajax_url,
data: cr_data,
context: refElement,
success: function(response){
let shcode=jQuery(this).closest(".cr-all-reviews-shortcode");
shcode.find(".cr-show-more-review-spinner").hide();
shcode.find(".ivole-summaryBox").removeClass("cr-summaryBar-updating");
shcode.find(".cr-seeAllReviews").removeClass("cr-seeAll-updating");
shcode.find(".cr-ajax-reviews-sort").removeClass("cr-sort-updating");
shcode.find(".cr-review-tags-filter").removeClass("cr-tags-updating");
if(response.html!==""){
shcode.find(".commentlist").empty();
shcode.find(".commentlist").append(response.html);
shcode.find(".commentlist").show();
shcode.find(".cr-show-more-button").data("page",response.page);
if(!response.last_page){
shcode.find(".cr-show-more-button").text(response.show_more_label);
shcode.find(".cr-show-more-button").show();
}}else{
shcode.find(".cr-search-no-reviews").show();
}
shcode.find(".cr-count-row .cr-count-row-count").html(response.count_row);
shcode.find(".cr-all-reviews-pagination").html(response.pagination);
shcode.find(".cr-all-reviews-pagination").show();
},
dataType: "json"
}
);
}}
function cr_maybe_download_media_frontend(){
jQuery(".cr-comment-image-ext,.cr-comment-video-ext").each(function(){
let ajaxData={
"action": "cr_auto_download_media_frontend",
"reviewID": jQuery(this).data("reviewid")
}
jQuery.post(cr_ajax_object.ajax_url, ajaxData, function(response){
}, "json");
return false;
});
}
function cr_validate_review_form(submitBtn){
let validationResult=true;
submitBtn.closest(".cr-review-form-wrap").find(".cr-review-form-rating-cont.cr-review-form-rating-req").each(function(index){
if(1 > jQuery(this).find(".cr-review-form-rating-actv").length){
jQuery(this).closest(".cr-review-form-rating").addClass("cr-review-form-error");
validationResult=false;
}});
if(1 > submitBtn.closest(".cr-review-form-wrap").find(".cr-review-form-comment-txt").val().trim().length){
submitBtn.closest(".cr-review-form-wrap").find(".cr-review-form-comment").addClass("cr-review-form-error");
validationResult=false;
}
if(1 > submitBtn.closest(".cr-review-form-wrap").find(".cr-review-form-name .cr-review-form-txt").val().trim().length){
submitBtn.closest(".cr-review-form-wrap").find(".cr-review-form-name").addClass("cr-review-form-error");
validationResult=false;
}
if(! crValidateEmail(submitBtn.closest(".cr-review-form-wrap").find(".cr-review-form-email .cr-review-form-txt").val().trim())){
submitBtn.closest(".cr-review-form-wrap").find(".cr-review-form-email").addClass("cr-review-form-error");
validationResult=false;
}
submitBtn.closest(".cr-review-form-wrap").find(".cr-onsite-question.cr-review-form-que-req").each(function(index){
if(0 < jQuery(this).find("input[type=text]").length){
if(1 > jQuery(this).find("input[type=text]").val().trim().length){
jQuery(this).closest(".cr-onsite-question").addClass("cr-review-form-error");
validationResult=false;
}else{
jQuery(this).closest(".cr-onsite-question").removeClass("cr-review-form-error");
}}
if(0 < jQuery(this).find("input[type=number]").length){
if(1 > jQuery(this).find("input[type=number]").val().trim().length){
jQuery(this).closest(".cr-onsite-question").addClass("cr-review-form-error");
validationResult=false;
}else{
jQuery(this).closest(".cr-onsite-question").removeClass("cr-review-form-error");
}}
});
if(0 < submitBtn.closest(".cr-review-form-wrap").find('.cr-review-form-terms').length){
if(! submitBtn.closest(".cr-review-form-wrap").find('.cr-review-form-terms .cr-review-form-checkbox').is(':checked')){
submitBtn.closest(".cr-review-form-wrap").find(".cr-review-form-terms").addClass("cr-review-form-error");
validationResult=false;
}}
if(0 < submitBtn.closest(".cr-review-form-wrap").find('.cr-review-form-captcha .cr-recaptcha').length){
if(grecaptcha){
let widgetId=0;
if(0 < jQuery(".cr-review-form-captcha .cr-recaptcha").length){
jQuery(".cr-review-form-captcha .cr-recaptcha").each(function(index){
if(submitBtn.closest('.cr-review-form-wrap').find('.cr-review-form-captcha .cr-recaptcha').data('crcaptchaid')===jQuery(this).data('crcaptchaid')
){
widgetId=index;
}}
);
}
let captchaCheck="";
if(0 < widgetId){
captchaCheck=grecaptcha.getResponse(widgetId);
}else{
captchaCheck=grecaptcha.getResponse();
}
if(! captchaCheck.length > 0){
submitBtn.closest(".cr-review-form-wrap").find(".cr-review-form-captcha").addClass("cr-review-form-error");
validationResult=false;
}}
}
return validationResult;
}
function cr_validate_qna(submitBtn){
let validationResult=true;
if(1 > submitBtn.closest(".cr-qna-new-q-form").find(".cr-review-form-comment-txt").val().trim().length){
submitBtn.closest(".cr-qna-new-q-form").find(".cr-review-form-comment").addClass("cr-review-form-error");
validationResult=false;
}
if(1 > submitBtn.closest(".cr-qna-new-q-form").find(".cr-review-form-name .cr-review-form-txt").val().trim().length){
submitBtn.closest(".cr-qna-new-q-form").find(".cr-review-form-name").addClass("cr-review-form-error");
validationResult=false;
}
if(! crValidateEmail(submitBtn.closest(".cr-qna-new-q-form").find(".cr-review-form-email .cr-review-form-txt").val().trim())){
submitBtn.closest(".cr-qna-new-q-form").find(".cr-review-form-email").addClass("cr-review-form-error");
validationResult=false;
}
if(0 < submitBtn.closest(".cr-qna-new-q-form").find('.cr-review-form-terms').length){
if(! submitBtn.closest(".cr-qna-new-q-form").find('.cr-review-form-terms .cr-review-form-checkbox').is(':checked')){
submitBtn.closest(".cr-qna-new-q-form").find(".cr-review-form-terms").addClass("cr-review-form-error");
validationResult=false;
}}
return validationResult;
}
function cr_validate_ans(submitBtn){
let validationResult=true;
if(1 > submitBtn.closest(".cr-qna-list-inl-answ").find(".cr-review-form-comment-txt").val().trim().length){
submitBtn.closest(".cr-qna-list-inl-answ").find(".cr-review-form-comment").addClass("cr-review-form-error");
validationResult=false;
}
if(1 > submitBtn.closest(".cr-qna-list-inl-answ").find(".cr-review-form-name .cr-review-form-txt").val().trim().length){
submitBtn.closest(".cr-qna-list-inl-answ").find(".cr-review-form-name").addClass("cr-review-form-error");
validationResult=false;
}
if(! crValidateEmail(submitBtn.closest(".cr-qna-list-inl-answ").find(".cr-review-form-email .cr-review-form-txt").val().trim())){
submitBtn.closest(".cr-qna-list-inl-answ").find(".cr-review-form-email").addClass("cr-review-form-error");
validationResult=false;
}
if(0 < submitBtn.closest(".cr-qna-list-inl-answ").find('.cr-review-form-terms').length){
if(! submitBtn.closest(".cr-qna-list-inl-answ").find('.cr-review-form-terms .cr-review-form-checkbox').is(':checked')){
submitBtn.closest(".cr-qna-list-inl-answ").find(".cr-review-form-terms").addClass("cr-review-form-error");
validationResult=false;
}}
return validationResult;
}
function cr_reset_review_form(refElement){
refElement.closest(".cr-review-form-wrap").find(".cr-review-form-rating-cont .cr-review-form-rating-inner").removeClass("cr-review-form-rating-actv");
refElement.closest(".cr-review-form-wrap").find(".cr-review-form-rating-cont .cr-review-form-rating-inner .cr-rating-act").hide();
refElement.closest(".cr-review-form-wrap").find(".cr-review-form-rating-cont .cr-review-form-rating-inner .cr-rating-deact").show();
refElement.closest(".cr-review-form-wrap").find(".cr-review-form-rating-cont .cr-review-form-rating-nbr").text("0/5");
refElement.closest(".cr-review-form-wrap").find(".cr-review-form-rating").removeClass("cr-review-form-error");
refElement.closest(".cr-review-form-wrap").find(".cr-review-form-comment-txt").val('');
refElement.closest(".cr-review-form-wrap").find(".cr-review-form-comment").removeClass("cr-review-form-error");
refElement.closest(".cr-review-form-wrap").find(".cr-review-form-name .cr-review-form-txt").val('');
refElement.closest(".cr-review-form-wrap").find(".cr-review-form-name").removeClass("cr-review-form-error");
refElement.closest(".cr-review-form-wrap").find(".cr-review-form-email .cr-review-form-txt").val('');
refElement.closest(".cr-review-form-wrap").find(".cr-review-form-email").removeClass("cr-review-form-error");
refElement.closest(".cr-review-form-wrap").find(".cr-onsite-questions .cr-onsite-question").removeClass("cr-review-form-error");
refElement.closest(".cr-review-form-wrap").find(".cr-onsite-questions .cr-onsite-question input[type='text']").val('');
refElement.closest(".cr-review-form-wrap").find(".cr-onsite-questions .cr-onsite-question input[type='number']").val('');
refElement.closest(".cr-review-form-wrap").find(".cr-onsite-key-question").removeClass("cr-review-form-error");
refElement.closest(".cr-review-form-wrap").find(".cr-onsite-key-question input[type='text']").val('');
refElement.closest(".cr-review-form-wrap").find(".cr-onsite-key-question input[type='number']").val('');
refElement.closest(".cr-review-form-wrap").find(".cr-form-item-media .cr-upload-images-containers").remove();
refElement.closest(".cr-review-form-wrap").find(".cr-form-item-media .cr-form-item-media-preview").removeClass("cr-form-visible");
refElement.closest(".cr-review-form-wrap").find(".cr-form-item-media .cr-form-item-media-preview").parents(".cr-form-item-subcontainer").removeClass("cr-form-visible");
refElement.closest(".cr-review-form-wrap").find(".cr-review-form-terms .cr-review-form-checkbox").prop('checked', false);
refElement.closest(".cr-review-form-wrap").find(".cr-review-form-terms").removeClass("cr-review-form-error");
refElement.closest(".cr-review-form-wrap").find(".cr-review-form-captcha").removeClass("cr-review-form-error");
}
function cr_reset_qna_form(refElement){
refElement.closest(".cr-qna-new-q-form").find(".cr-review-form-comment-txt").val('');
refElement.closest(".cr-qna-new-q-form").find(".cr-review-form-comment").removeClass("cr-review-form-error");
const nameField=refElement.closest(".cr-qna-new-q-form").find(".cr-review-form-name");
nameField.find(".cr-review-form-txt").val(nameField.find(".cr-review-form-txt").data('defval'));
nameField.removeClass("cr-review-form-error");
const emailField=refElement.closest(".cr-qna-new-q-form").find(".cr-review-form-email");
emailField.find(".cr-review-form-txt").val(emailField.find(".cr-review-form-txt").data('defval'));
emailField.removeClass("cr-review-form-error");
refElement.closest(".cr-qna-new-q-form").find(".cr-review-form-terms .cr-review-form-checkbox").prop('checked', false);
refElement.closest(".cr-qna-new-q-form").find(".cr-review-form-terms").removeClass("cr-review-form-error");
}
function cr_reset_ans_form(refElement){
refElement.closest(".cr-qna-list-inl-answ").find(".cr-review-form-comment-txt").val("");
refElement.closest(".cr-qna-list-inl-answ").find(".cr-review-form-comment").removeClass("cr-review-form-error");
const nameField=refElement.closest(".cr-qna-list-inl-answ").find(".cr-review-form-name");
nameField.find(".cr-review-form-txt").val("");
nameField.removeClass("cr-review-form-error");
const emailField=refElement.closest(".cr-qna-list-inl-answ").find(".cr-review-form-email");
emailField.find(".cr-review-form-txt").val("");
emailField.removeClass("cr-review-form-error");
refElement.closest(".cr-qna-list-inl-answ").find(".cr-review-form-terms .cr-review-form-checkbox").prop('checked', false);
refElement.closest(".cr-qna-list-inl-answ").find(".cr-review-form-terms").removeClass("cr-review-form-error");
}
function crDebounce(callback, wait){
let timeout;
return (...args)=> {
clearTimeout(timeout);
if(0 < args.length&&13===args[0].keyCode){
wait=0;
}else{
wait=1000;
}
timeout=setTimeout(function (){ callback.apply(this, args); }, wait);
};}
function crShowMoreReviewsPrd(refElement){
let cr_product_id=refElement.parents(".cr-reviews-ajax-comments").find(".commentlist.cr-ajax-reviews-list").attr("data-product");
let cr_nonce=refElement.parents(".cr-reviews-ajax-comments").attr("data-nonce");
let cr_page=refElement.parents(".cr-reviews-ajax-comments").attr("data-page");
let cr_sort=refElement.parents(".cr-reviews-ajax-comments").find(".cr-ajax-reviews-sort").children("option:selected").val();
let cr_rating=refElement.parents(".cr-reviews-ajax-comments").find(".cr-summaryBox-ajax tr.ivole-histogramRow.ivole-histogramRow-s a.ivole-histogram-a").attr("data-rating");
let cr_search=refElement.parents(".cr-reviews-ajax-comments").find(".cr-ajax-search input").val();
let cr_tags=[];
refElement.parents(".cr-reviews-ajax-comments").find(".cr-review-tags-filter .cr-tags-filter.cr-tag-selected").each(function(){
cr_tags.push(jQuery(this).attr("data-crtagid"));
}
);
if(! cr_rating){
cr_rating=0;
}
let cr_data={
"action": "cr_show_more_reviews",
"productID": cr_product_id,
"page": cr_page,
"sort": cr_sort,
"rating": cr_rating,
"search": cr_search,
"tags": cr_tags,
"security": cr_nonce
};
refElement.parents(".cr-reviews-ajax-comments").find(".cr-summaryBox-ajax").addClass("cr-summaryBar-updating");
refElement.parents(".cr-reviews-ajax-comments").find(".cr-ajax-reviews-sort").addClass("cr-sort-updating");
refElement.parents(".cr-reviews-ajax-comments").find(".cr-review-tags-filter").addClass("cr-review-tags-filter-disabled");
refElement.parents(".cr-reviews-ajax-comments").find(".cr-search-no-reviews").hide();
refElement.parents(".cr-reviews-ajax-comments").find(".cr-show-more-reviews-prd").hide();
refElement.parents(".cr-reviews-ajax-comments").find(".cr-show-more-review-spinner").show();
jQuery.post({
url: cr_ajax_object.ajax_url,
data: cr_data,
context: refElement,
success: function(response){
jQuery(this).parents(".cr-reviews-ajax-comments").find(".cr-show-more-review-spinner").hide();
jQuery(this).parents(".cr-reviews-ajax-comments").find(".cr-summaryBox-ajax").removeClass("cr-summaryBar-updating");
jQuery(this).parents(".cr-reviews-ajax-comments").find(".cr-ajax-reviews-sort").removeClass("cr-sort-updating");
jQuery(this).parents(".cr-reviews-ajax-comments").find(".cr-review-tags-filter").removeClass("cr-review-tags-filter-disabled");
if(response.page > 0){
jQuery(this).parents(".cr-reviews-ajax-comments").find(".commentlist.cr-ajax-reviews-list").append(response.html);
jQuery(this).parents(".cr-reviews-ajax-comments").attr("data-page",response.page);
if(response.show_more_label){
jQuery(this).parents(".cr-reviews-ajax-comments").find(".cr-show-more-reviews-prd").text(response.show_more_label);
}
if(response.count_row){
jQuery(this).parents(".cr-reviews-ajax-comments").find(".cr-count-row .cr-count-row-count").html(response.count_row);
}
if(! response.last_page){
jQuery(this).parents(".cr-reviews-ajax-comments").find(".cr-show-more-reviews-prd").show();
}
cr_maybe_download_media_frontend();
}
if(response.html==null&&response.page===1){
jQuery(this).parents(".cr-reviews-ajax-comments").find(".cr-search-no-reviews").show();
}},
dataType: "json"
});
}})();
function crResizeAllGridItemsUtil(grids){
jQuery(grids).each(function(){
if(800 > jQuery(this).width()){
jQuery(this).find(".cr-reviews-grid-col3").addClass("cr-reviews-grid-col-none");
}
if(550 > jQuery(this).width()){
jQuery(this).find(".cr-reviews-grid-col2").addClass("cr-reviews-grid-col-none");
}
jQuery(this).colcade({
columns: ".cr-reviews-grid-col",
items: ".cr-review-card"
});
});
}
function crResizeAllGridItems(){
if(typeof Colcade!=="undefined" &&
typeof Colcade.makeJQueryPlugin!=="undefined" &&
typeof Colcade.makeJQueryPlugin==="function"
){
if(! typeof jQuery.fn.colcade==="function" ||
typeof jQuery.fn.colcade==="undefined"
){
Colcade.makeJQueryPlugin();
}}
crResizeAllGridItemsUtil(jQuery(".cr-reviews-grid-inner"));
}
function crResizeTrustBadges(){
jQuery(".cr-trustbadgef").each(function(){
let badge=jQuery(this).find(".cr-badge").eq(0);
let scale=jQuery(this).width() / badge.outerWidth();
if(1 > scale){
badge.css("transform", "scale(" + scale + ")");
}
badge.css("visibility", "visible");
});
};
(function(window, factory){
if(typeof define=='function'&&define.amd){
define(factory);
}else if(typeof module=='object'&&module.exports){
module.exports=factory();
}else{
window.Colcade=factory();
}}(window, function factory(){
function Colcade(element, options){
element=getQueryElement(element);
if(element&&element.colcadeGUID){
var instance=instances[ element.colcadeGUID ];
instance.option(options);
return instance;
}
this.element=element;
this.options={};
this.option(options);
this.lastAppend=[];
this.lastColumnHeights=[];
this.create();
element.classList.add('cr-colcade-loaded');
}
var proto=Colcade.prototype;
proto.option=function(options){
this.options=extend(this.options, options);
};
var GUID=0;
var instances={};
proto.create=function(){
this.errorCheck();
var guid=this.guid=++GUID;
this.element.colcadeGUID=guid;
instances[ guid ]=this;
this.reload();
this._windowResizeHandler=this.onWindowResize.bind(this);
this._loadHandler=this.onLoad.bind(this);
window.addEventListener('resize', this._windowResizeHandler);
this.element.addEventListener('load', this._loadHandler, true);
};
proto.errorCheck=function(){
var errors=[];
if(!this.element){
errors.push('Bad element: ' + this.element);
}
if(!this.options.columns){
errors.push('columns option required: ' + this.options.columns);
}
if(!this.options.items){
errors.push('items option required: ' + this.options.items);
}
if(errors.length){
throw new Error('[Colcade error] ' + errors.join('. '));
}};
proto.reload=function(){
this.updateColumns();
this.updateItems();
this.layout();
};
proto.updateColumns=function(){
this.columns=querySelect(this.options.columns, this.element);
};
proto.updateItems=function(){
this.items=querySelect(this.options.items, this.element);
};
proto.getActiveColumns=function(){
return this.columns.filter(function(column){
var style=getComputedStyle(column);
return style.display!='none';
});
};
proto.layout=function(){
this.activeColumns=this.getActiveColumns();
this._layout();
};
proto._layout=function(){
this.columnHeights=this.activeColumns.map(function(){
return 0;
});
this.layoutItems(this.items);
};
proto.layoutItems=function(items){
items.forEach(this.layoutItem, this);
};
proto.layoutItem=function(item){
var minHeight=Math.min.apply(Math, this.columnHeights);
var index=this.columnHeights.indexOf(minHeight);
this.activeColumns[ index ].appendChild(item);
this.columnHeights[ index ] +=item.offsetHeight||1;
};
proto.append=function(elems){
var items=this.getQueryItems(elems);
this.items=this.items.concat(items);
this.lastAppend.length=0;
this.lastAppend=items.slice();
this.lastColumnHeights.length=0;
this.lastColumnHeights=this.columnHeights.slice();
this.layoutItems(items);
};
proto.prepend=function(elems){
var items=this.getQueryItems(elems);
this.items=items.concat(this.items);
this._layout();
};
proto.getQueryItems=function(elems){
elems=makeArray(elems);
var fragment=document.createDocumentFragment();
elems.forEach(function(elem){
fragment.appendChild(elem);
});
return querySelect(this.options.items, fragment);
};
proto.empty=function(){
this.lastAppend.length=0;
this.lastColumnHeights.length=0;
this.items.forEach(function(item){
item.remove();
}, this);
this.items.length=0;
this._layout();
};
proto.measureColumnHeight=function(elem){
var boundingRect=this.element.getBoundingClientRect();
this.activeColumns.forEach(function(column, i){
if(!elem||column.contains(elem)){
var lastChildRect=column.lastElementChild.getBoundingClientRect();
this.columnHeights[ i ]=lastChildRect.bottom - boundingRect.top;
}}, this);
};
proto.onWindowResize=function(){
clearTimeout(this.resizeTimeout);
this.resizeTimeout=setTimeout(function(){
this.onDebouncedResize();
}.bind(this), 100);
};
proto.onDebouncedResize=function(){
var activeColumns=this.getActiveColumns();
var isSameLength=activeColumns.length==this.activeColumns.length;
var isSameColumns=true;
this.activeColumns.forEach(function(column, i){
isSameColumns=isSameColumns&&column==activeColumns[i];
});
if(isSameLength&&isSameColumns){
return;
}
this.activeColumns=activeColumns;
this._layout();
};
proto.onLoad=function(event){
this.measureColumnHeight(event.target);
if(0 < this.lastColumnHeights.length&&0 < this.lastAppend.length){
this.columnHeights.length=0;
this.columnHeights=this.lastColumnHeights.slice();
this.layoutItems(this.lastAppend);
}};
proto.destroy=function(){
this.items.forEach(function(item){
this.element.appendChild(item);
}, this);
window.removeEventListener('resize', this._windowResizeHandler);
this.element.removeEventListener('load', this._loadHandler, true);
delete this.element.colcadeGUID;
delete instances[ this.guid ];
};
docReady(function(){
var dataElems=querySelect('[data-colcade]');
dataElems.forEach(htmlInit);
});
function htmlInit(elem){
var attr=elem.getAttribute('data-colcade');
var attrParts=attr.split(',');
var options={};
attrParts.forEach(function(part){
var pair=part.split(':');
var key=pair[0].trim();
var value=pair[1].trim();
options[ key ]=value;
});
new Colcade(elem, options);
}
Colcade.data=function(elem){
elem=getQueryElement(elem);
var id=elem&&elem.colcadeGUID;
return id&&instances[ id ];
};
Colcade.makeJQueryPlugin=function($){
$=$||window.jQuery;
if(!$){
return;
}
$.fn.colcade=function(arg0 ){
if(typeof arg0=='string'){
var args=Array.prototype.slice.call(arguments, 1);
return methodCall(this, arg0, args);
}
plainCall(this, arg0);
return this;
};
function methodCall($elems, methodName, args){
var returnValue;
$elems.each(function(i, elem){
var colcade=$.data(elem, 'colcade');
if(!colcade){
return;
}
var value=colcade[ methodName ].apply(colcade, args);
returnValue=returnValue===undefined ? value:returnValue;
});
return returnValue!==undefined ? returnValue:$elems;
}
function plainCall($elems, options){
$elems.each(function(i, elem){
var colcade=$.data(elem, 'colcade');
if(colcade){
colcade.option(options);
colcade.layout();
}else{
colcade=new Colcade(elem, options);
$.data(elem, 'colcade', colcade);
}});
}};
Colcade.makeJQueryPlugin();
function extend(a, b){
for(var prop in b){
a[ prop ]=b[ prop ];
}
return a;
}
function makeArray(obj){
var ary=[];
if(Array.isArray(obj)){
ary=obj;
}else if(obj&&typeof obj.length=='number'){
for(var i=0; i < obj.length; i++){
ary.push(obj[i]);
}}else{
ary.push(obj);
}
return ary;
}
function querySelect(selector, elem){
elem=elem||document;
var elems=elem.querySelectorAll(selector);
return makeArray(elems);
}
function getQueryElement(elem){
if(typeof elem=='string'){
elem=document.querySelector(elem);
}
return elem;
}
function docReady(onReady){
if(document.readyState=='complete'){
onReady();
return;
}
document.addEventListener('DOMContentLoaded', onReady);
}
return Colcade;
}));
!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){"use strict";function b(a){if(a instanceof Date)return a;if(String(a).match(g))return String(a).match(/^[0-9]*$/)&&(a=Number(a)),String(a).match(/\-/)&&(a=String(a).replace(/\-/g,"/")),new Date(a);throw new Error("Couldn't cast `"+a+"` to a date object.")}function c(a){var b=a.toString().replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");return new RegExp(b)}function d(a){return function(b){var d=b.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi);if(d)for(var f=0,g=d.length;f<g;++f){var h=d[f].match(/%(-|!)?([a-zA-Z]{1})(:[^;]+;)?/),j=c(h[0]),k=h[1]||"",l=h[3]||"",m=null;h=h[2],i.hasOwnProperty(h)&&(m=i[h],m=Number(a[m])),null!==m&&("!"===k&&(m=e(l,m)),""===k&&m<10&&(m="0"+m.toString()),b=b.replace(j,m.toString()))}return b=b.replace(/%%/,"%")}}function e(a,b){var c="s",d="";return a&&(a=a.replace(/(:|;|\s)/gi,"").split(/\,/),1===a.length?c=a[0]:(d=a[0],c=a[1])),Math.abs(b)>1?c:d}var f=[],g=[],h={precision:100,elapse:!1,defer:!1};g.push(/^[0-9]*$/.source),g.push(/([0-9]{1,2}\/){2}[0-9]{4}([0-9]{1,2}(:[0-9]{2}){2})?/.source),g.push(/[0-9]{4}([\/\-][0-9]{1,2}){2}([0-9]{1,2}(:[0-9]{2}){2})?/.source),g=new RegExp(g.join("|"));var i={Y:"years",m:"months",n:"daysToMonth",d:"daysToWeek",w:"weeks",W:"weeksToMonth",H:"hours",M:"minutes",S:"seconds",D:"totalDays",I:"totalHours",N:"totalMinutes",T:"totalSeconds"},j=function(b,c,d){this.el=b,this.$el=a(b),this.interval=null,this.offset={},this.options=a.extend({},h),this.instanceNumber=f.length,f.push(this),this.$el.data("countdown-instance",this.instanceNumber),d&&("function"==typeof d?(this.$el.on("update.countdown",d),this.$el.on("stoped.countdown",d),this.$el.on("finish.countdown",d)):this.options=a.extend({},h,d)),this.setFinalDate(c),!1===this.options.defer&&this.start()};a.extend(j.prototype,{start:function(){null!==this.interval&&clearInterval(this.interval);var a=this;this.update(),this.interval=setInterval(function(){a.update.call(a)},this.options.precision)},stop:function(){clearInterval(this.interval),this.interval=null,this.dispatchEvent("stoped")},toggle:function(){this.interval?this.stop():this.start()},pause:function(){this.stop()},resume:function(){this.start()},remove:function(){this.stop.call(this),f[this.instanceNumber]=null,delete this.$el.data().countdownInstance},setFinalDate:function(a){this.finalDate=b(a)},update:function(){if(0===this.$el.closest("html").length)return void this.remove();var b,c=void 0!==a._data(this.el,"events"),d=new Date;b=this.finalDate.getTime()-d.getTime(),b=Math.ceil(b/1e3),b=!this.options.elapse&&b<0?0:Math.abs(b),this.totalSecsLeft!==b&&c&&(this.totalSecsLeft=b,this.elapsed=d>=this.finalDate,this.offset={seconds:this.totalSecsLeft%60,minutes:Math.floor(this.totalSecsLeft/60)%60,hours:Math.floor(this.totalSecsLeft/60/60)%24,days:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToWeek:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToMonth:Math.floor(this.totalSecsLeft/60/60/24%30.4368),weeks:Math.floor(this.totalSecsLeft/60/60/24/7),weeksToMonth:Math.floor(this.totalSecsLeft/60/60/24/7)%4,months:Math.floor(this.totalSecsLeft/60/60/24/30.4368),years:Math.abs(this.finalDate.getFullYear()-d.getFullYear()),totalDays:Math.floor(this.totalSecsLeft/60/60/24),totalHours:Math.floor(this.totalSecsLeft/60/60),totalMinutes:Math.floor(this.totalSecsLeft/60),totalSeconds:this.totalSecsLeft},this.options.elapse||0!==this.totalSecsLeft?this.dispatchEvent("update"):(this.stop(),this.dispatchEvent("finish")))},dispatchEvent:function(b){var c=a.Event(b+".countdown");c.finalDate=this.finalDate,c.elapsed=this.elapsed,c.offset=a.extend({},this.offset),c.strftime=d(this.offset),this.$el.trigger(c)}}),a.fn.wcstCountdown=function(){var b=Array.prototype.slice.call(arguments,0);return this.each(function(){var c=a(this).data("countdown-instance");if(void 0!==c){var d=f[c],e=b[0];j.prototype.hasOwnProperty(e)?d[e].apply(d,b.slice(1)):null===String(e).match(/^[$A-Z_][0-9A-Z_$]*$/i)?(d.setFinalDate.call(d,e),d.start()):a.error("Method %s does not exist on jQuery.countdown".replace(/\%s/gi,e))}else new j(this,b[0],b[1])})}});;function humanized_time_span(a,b,c,d){function e(){for(var a=0;a<c[j].length;a++)if(null==c[j][a].ceiling||i<=c[j][a].ceiling)return c[j][a];return null}function f(){for(var a=i,b={},c=0;c<d.length;c++){var e=Math.floor(a/d[c][0]);a-=d[c][0]*e,b[d[c][1]]=e}return b}function g(a){var b=f();return h(a.text.replace(/\$(\w+)/g,function(){return b[arguments[1]]}),b)}function h(a,b){for(var c in b)if(1==b[c]){var d=new RegExp("\\b"+c+"\\b");singlularText=c.replace(d,function(){return arguments[0].replace(/s\b/g,"")}),a=a.replace(c,wcst_data.hard_texts[singlularText])}return a}c=c||{past:[{ceiling:60,text:"$seconds "+wcst_data.hard_texts.secs},{ceiling:3600,text:"$minutes "+wcst_data.hard_texts.mins},{ceiling:86400,text:"$hours "+wcst_data.hard_texts.hrs},{ceiling:604800,text:"$days "+wcst_data.hard_texts.days},{ceiling:2592e3,text:"$weeks "+wcst_data.hard_texts.weeks},{ceiling:31556926,text:"$months "+wcst_data.hard_texts.months},{ceiling:null,text:"$years years"}],future:[{ceiling:60,text:"$seconds "+wcst_data.hard_texts.secs},{ceiling:3600,text:"$minutes "+wcst_data.hard_texts.mins},{ceiling:86400,text:"$hours "+wcst_data.hard_texts.hrs},{ceiling:604800,text:"$days "+wcst_data.hard_texts.days},{ceiling:2592e3,text:"$weeks "+wcst_data.hard_texts.weeks},{ceiling:31556926,text:"$months "+wcst_data.hard_texts.months},{ceiling:null,text:"$years years"}]},d=d||[[31556926,"years"],[2629744,"months"],[604800,"weeks"],[86400,"days"],[3600,"hours"],[60,"minutes"],[1,"seconds"]],a=new Date(a),b=b?new Date(b):new Date;var i=(b-a)/1e3,j="past";return i<0&&(j="future",i=0-i),g(e())};!function(a){"use strict";function b(){a(".wcst_low_stock").html(""),a(".wcst_deal_expiry").not(".wcst_static").html(""),a(".woocommerce-variation.single_variation .wcst_you_save_variation").html("")}function c(){if(void 0!==wcst_data.settings&&void 0!==wcst_data.settings.deal_expiry)for(var b in wcst_data.settings.deal_expiry){var c=".wcst_deal_expiry_key_"+wcst_data.current_postid+"_"+b;if(0!==a(c).length){var f,g,h,i,k,l,o=wcst_data.settings.deal_expiry[b],p=a(c).find("span").attr("data-date"),q={to:p},r=q.to-wcst_data.utc0_time,s="";if(!a(c).hasClass("wcst_deal_expiry_variable")&&!a(c).hasClass("wcst_timer")&&"reverse_timer"!=o.display_mode){if("reverse_date"===o.display_mode&&(f=humanized_time_span(j(q.to),j(wcst_data.utc0_time)),g=o.reverse_date_label,h="{{time_left}}"),o.switch_period>0){if(!(r<3600*o.switch_period))continue;f="",g=o.reverse_timer_label,h="{{countdown_timer}}",i=" wcst_timer",k="days",r<86400&&(k="hrs")}f='<span data-diff="'+(q.to-wcst_data.utc0_time)+'" data-display="'+k+'">'+f+"</span>"," wcst_timer"==i&&a(".wcst_deal_expiry.wcst_deal_expiry_key_"+wcst_data.current_postid+"_"+b).addClass("wcst_timer"),l=h,s=new RegExp(l,"g"),g=g.replace(s,f),a(".wcst_deal_expiry.wcst_deal_expiry_key_"+wcst_data.current_postid+"_"+b).html(g)}}}a(".wcst_timer,.wcst_manual_timer").each(function(){a.ajax({url:wcst_data.ajax_url,type:"POST",data:{action:"wcst_refreshed_times",location:document.location.href,endDate:a(this).children("span").attr("data-date")},beforeSend:function(){m++},success:function(b){n++,a(".wcst_timer,.wcst_manual_timer").find("span[data-date='"+b.old_diff+"']").each(function(){jQuery(this).attr("data-diff",b.diff)}),m===n&&(e(),d())}})})}function d(){a(".wcst_manual_timer").length>0&&a(".wcst_manual_timer").each(function(){var b,c=a(this),d=c.children("span");b=d.attr("data-format");var e=parseInt(d.attr("data-diff")),f=(new Date).getTime()+1e3*e;d.wcstCountdown(f,function(c){a(this).text(c.strftime(b))})})}function e(){if(a(".wcst_timer").length>0){l=wcst_data.hard_texts;var b="D",c="D",d="h",e="h",f="m",g="m",h="s",i="s";void 0!==l.day&&""!=l.day&&(b=l.day),void 0!==l.days&&""!=l.days&&(c=l.days),void 0!==l.hr&&""!=l.hr&&(d=l.hr),void 0!==l.hrs&&""!=l.hrs&&(e=l.hrs),void 0!==l.mins&&""!=l.mins&&(f=l.mins),void 0!==l.min&&""!=l.min&&(g=l.min),void 0!==l.sec&&""!=l.sec&&(h=l.sec),void 0!==l.secs&&""!=l.secs&&(i=l.secs),a(".wcst_timer").each(function(){var j,k=a(this),l=k.children("span").not(".amount"),m=parseInt(l.attr("data-diff")),n=(new Date).getTime()+1e3*m,o=l.attr("data-display");l.wcstCountdown(n,function(k){var l=k.offset.totalDays>1?c:b,m=k.offset.hours>1?e:d,n=k.offset.minutes>1?f:g,p=k.offset.seconds>1?i:h;j="%H"+m+" %M"+n+" %S"+p,"days"==o&&(j="%-D "+l+" %H "+m+" %M "+n+" %S "+p),a(this).text(k.strftime(j))})})}}function f(a,b,c,d){var e,f,g=a.scarcity_label,h=a.assurance_label,i=a.backorder_label,j=a.out_of_stock_label,k=null!==b?d.wcst_stock_qty:"";if((0===b||null===b||""===b)&&!0===d.wcst_is_on_backorder)return'<div class="wcst_low_stock_backorder"><span>'+i+"</span></div>";e="{{stock_quantity_left}}",f=new RegExp(e,"g"),g=g.replace(f,k),e="{{stock_quantity_left}}",f=new RegExp(e,"g"),h=h.replace(f,k);return!0===c?!1===d.wcst_manage_stock?'<div class="wcst_low_stock_assurance"><span>'+h+"</span></div>":0!==b&&null!==b&&""!==b||!1!==d.backorders_allowed?"0"==d.wcst_stock_qty&&!0===d.backorders_allowed?'<div class="wcst_low_stock_assurance"><span>'+h+"</span></div>":"scarcity"==a.default_mode?'<div class="wcst_low_stock_scarcity"><span>'+g+"</span></div>":a.switch_scarcity_min_stock>0&&a.switch_scarcity_min_stock>=d.wcst_stock_qty?'<div class="wcst_low_stock_scarcity"><span>'+g+"</span></div>":'<div class="wcst_low_stock_assurance"><span>'+h+"</span></div>":'<div class="wcst_low_stock_assurance"><span>'+h+"</span></div>":'<div class="wcst_low_stock_out"><span>'+j+"</span></div>"}function g(b,c,d){var e;if("yes"===c.show_below_variation_price){var f=d.display_regular_price,g=d.display_price,i=c.label,j=Math.abs(f-g);if(j>0&&a(".woocommerce-variation.single_variation").length>0&&a(".woocommerce-variation.single_variation .woocommerce-variation-price").length>0){var k=j/f*100,l=wcst_data.wc_decimal_count?wcst_data.wc_decimal_count:1;k=k.toFixed(l),k%1!=0&&"yes"!==c.hide_decimal_in_saving_percentage||(k=Math.floor(k)),e="{{savings_value}}",i.indexOf(e)>=0&&(i=i.split(e).join('<span class="you_save_value">'+h(j)+"</span>")),e="{{savings_percentage}}",i.indexOf(e)>=0&&(i=i.split(e).join('<span class="you_save_percentage">'+k+"%</span>")),e="{{savings_value_percentage}}",i.indexOf(e)>=0&&(i=i.split(e).join('<span class="you_save_value_percentage">'+h(j)+" ("+k+"%)</span>")),e="{{regular_price}}",i.indexOf(e)>=0&&(i=i.split(e).join('<span class="woocommerce-Price-amount amount">'+h(f)+"</span>")),e="{{sale_price}}",i.indexOf(e)>=0&&(i=i.split(e).join('<span class="woocommerce-Price-amount amount">'+h(g)+"</span>")),a(".woocommerce-variation.single_variation").find(".wcst_savings_variation").remove(),a(".woocommerce-variation.single_variation .woocommerce-variation-price").after('<div class="wcst_savings_variation wcst_savings_variation_key_'+wcst_data.current_postid+"_"+b+'">'+i+"</div>")}}}function h(a){var b;return"left"===wcst_data.currency_pos?b='<span class="woocommerce-Price-currencySymbol">'+wcst_data.currency+"</span>"+i(a,wcst_data.wc_decimal_count,wcst_data.wc_decimal_sep,wcst_data.wc_thousand_sep):"left_space"===wcst_data.currency_pos?b='<span class="woocommerce-Price-currencySymbol">'+wcst_data.currency+"</span> "+i(a,wcst_data.wc_decimal_count,wcst_data.wc_decimal_sep,wcst_data.wc_thousand_sep):"right"===wcst_data.currency_pos?b=i(a,wcst_data.wc_decimal_count,wcst_data.wc_decimal_sep,wcst_data.wc_thousand_sep)+'<span class="woocommerce-Price-currencySymbol">'+wcst_data.currency+"</span> ":"right_space"===wcst_data.currency_pos&&(b=i(a,wcst_data.wc_decimal_count,wcst_data.wc_decimal_sep,wcst_data.wc_thousand_sep)+' <span class="woocommerce-Price-currencySymbol">'+wcst_data.currency+"</span> "),b}function i(a,b,c,d){a=(a+"").replace(/[^0-9+\-Ee.]/g,"");var e=isFinite(+a)?+a:0,f=isFinite(+b)?Math.abs(b):0,g=void 0===d?",":d,h=void 0===c?".":c,i="",j=function(a,b){var c=Math.pow(10,b);return""+Math.round(a*c)/c};return i=(f?j(e,f):""+Math.round(e)).split("."),i[0].length>3&&(i[0]=i[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,g)),(i[1]||"").length<f&&(i[1]=i[1]||"",i[1]+=new Array(f-i[1].length+1).join("0")),i.join(h)}function j(a){var b=new Date(1e3*a),c=b.getFullYear(),d=b.getMonth(),e=b.getDate(),f=b.getHours(),g="0"+b.getMinutes(),h="0"+b.getSeconds();return d+=1,d<9&&(d="0"+d),f<9&&(f="0"+f),c+"/"+d+"/"+e+" "+f+":"+g.substr(-2)+":"+h.substr(-2)}function k(b,c,d,f){var g,h,i,k="",l="",m=0;m=d.to-wcst_data.utc0_time;var n,o,p,q,r=f.display_regular_price,s=f.display_price;"reverse_date"===c.display_mode||"expiry_date"===c.display_mode?("reverse_date"===c.display_mode&&(g=humanized_time_span(j(d.to),j(wcst_data.utc0_time)),h=c.reverse_date_label,i="{{time_left}}"),"expiry_date"==c.display_mode&&(g=f.wcst_sale_to_val,h=c.expiry_date_label,i="{{end_date}}"),c.switch_period>0&&m<3600*c.switch_period&&(h=c.reverse_timer_label,i="{{countdown_timer}}",k=" wcst_timer",l="days",m<86400&&(l="hrs")),g='<span data-diff="'+(d.to-wcst_data.utc0_time)+'" data-display="'+l+'">'+g+"</span>"," wcst_timer"==k?a(".wcst_deal_expiry.wcst_deal_expiry_key_"+wcst_data.current_postid+"_"+b).not(".wcst_static").addClass("wcst_timer"):a(".wcst_deal_expiry.wcst_deal_expiry_key_"+wcst_data.current_postid+"_"+b).not(".wcst_static").removeClass("wcst_timer"),n=i,o=new RegExp(n,"g"),h=h.replace(o,g),n="{{regular_price}}",o=new RegExp(n,"g"),p='<span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">'+wcst_data.currency+"</span>"+r.toFixed(2)+"</span>",h=h.replace(o,p),q='<span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">'+wcst_data.currency+"</span>"+s.toFixed(2)+"</span>",n="{{sale_price}}",o=new RegExp(n,"g"),h=h.replace(o,q),a(".wcst_deal_expiry.wcst_deal_expiry_key_"+wcst_data.current_postid+"_"+b).not(".wcst_static").html(h),e()):"reverse_timer"===c.display_mode&&(h=c.reverse_timer_label,i="{{countdown_timer}}",k=" wcst_timer",l="days",m<86400&&(l="hrs"),g='<span data-diff="'+(d.to-wcst_data.utc0_time)+'" data-display="'+l+'">'+g+"</span>"," wcst_timer"==k&&a(".wcst_deal_expiry").addClass("wcst_timer"),n=i,o=new RegExp(n,"g"),h=h.replace(o,g),n="{{regular_price}}",o=new RegExp(n,"g"),p='<span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">'+wcst_data.currency+"</span>"+r.toFixed(2)+"</span>",h=h.replace(o,p),q='<span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">'+wcst_data.currency+"</span>"+s.toFixed(2)+"</span>",n="{{sale_price}}",o=new RegExp(n,"g"),h=h.replace(o,q),a(".wcst_deal_expiry.wcst_deal_expiry_key_"+wcst_data.current_postid+"_"+b).not(".wcst_static").html(h),e())}var l,m=0,n=0;a(".variations_form").on("woocommerce_variation_select_change",function(){b()}),a(".variations_form").on("show_variation",function(c,d){if(b(),void 0!==d&&"undefined"!=typeof wcst_data&&void 0!==wcst_data.settings){var e=(d.variation_id,{});e.from=d.wcst_sale_from,e.to=d.wcst_sale_to;var h=d.is_in_stock,i=1;d.display_price==d.display_regular_price&&(i=0);var j=d.max_qty;if(0===j&&(h=!1),0===h)return!1;void 0!==wcst_data.settings.low_stock&&-1!==wcst_data.compatibility.low_stock.indexOf(wcst_data.product_type)&&Object.keys(wcst_data.settings.low_stock).length>0&&a(".wcst_low_stock").length>0&&(a(".wcst_low_stock").html(""),a.each(wcst_data.settings.low_stock,function(b,c){var e=f(c,j,h,d);!0===h?a(".wcst_low_stock.wcst_low_stock_key_"+wcst_data.current_postid+"_"+b).removeClass("wcst_out_of_stock"):a(".wcst_low_stock.wcst_low_stock_key_"+wcst_data.current_postid+"_"+b).addClass("wcst_out_of_stock"),a(".wcst_low_stock.wcst_low_stock_key_"+wcst_data.current_postid+"_"+b).html(e)})),void 0!==wcst_data.settings.savings&&-1!==wcst_data.compatibility.savings.indexOf(wcst_data.product_type)&&Object.keys(wcst_data.settings.savings).length>0&&1===i&&!0===h&&a.each(wcst_data.settings.savings,function(a,b){g(a,b,d)}),void 0!==wcst_data.settings.deal_expiry&&-1!==wcst_data.compatibility.deal_expiry.indexOf(wcst_data.product_type)&&Object.keys(wcst_data.settings.deal_expiry).length>0&&1===i&&!0===h&&""!==e.to&&e.to>0&&wcst_data.utc0_time<e.to&&""!==e.from&&e.from>0&&wcst_data.utc0_time>e.from&&a.each(wcst_data.settings.deal_expiry,function(a,b){k(a,b,e,d)})}}),a(document.body).on("wc_fragments_refreshed",function(){e()}),a(window).bind("load",function(){a(".wcst_deal_expiry,.wcst_manual_timer").length>0&&a.ajax({url:wcst_data.wcstajax_url,type:"POST",data:{wcst_action:"wcst_reset_current_time",location:document.location.href,product:wcst_data.current_postid},success:function(a){!0===a.hasOwnProperty("utc0_time")&&(wcst_data.utc0_time=a.utc0_time,c())}})}),a(window).bind("load",function(){function b(){try{return localStorage.setItem("feature_test","yes"),"yes"===localStorage.getItem("feature_test")&&(localStorage.removeItem("feature_test"),!0)}catch(a){return!1}}var c=b();if(!0===c){var d,e=[];for(d=0;d<localStorage.length;d++)"wcst_dynamic_number_"==localStorage.key(d).substring(0,20)&&e.push(localStorage.key(d));for(d=0;d<e.length;d++){var f=localStorage.getItem(e[d]);f=JSON.parse(f);var g=f.time;g=parseInt(g);var h=(new Date).getTime();h=h.toString(),h=h.slice(0,-3),h=parseInt(h),g<h&&localStorage.removeItem(e[d])}}a(".wcst_dynamic_number").length>0&&a(".wcst_dynamic_number").each(function(){var b=a(this),d=b.attr("data-product-id"),e=b.attr("data-trigger-id"),f=b.attr("data-hold-value-type"),g="",h="";if(e.length&&d.length){if(!0===c){var i="wcst_dynamic_number_"+e;"product"==f&&(i=i+"_"+d);var j=localStorage.getItem(i);null!==j&&j.length&&(j=JSON.parse(j),g=j.time,h=j.value)}a.ajax({url:wcst_data.ajax_url,type:"POST",data:{action:"wcst_display_dynamic_number",product_id:d,trigger_id:e,time:g,value:h},success:function(a){if(a.success&&(b.html(a.text),!0===c&&!1!==a.time)){var d={time:a.time,value:a.value},e=JSON.stringify(d);localStorage.setItem(i,e)}}})}})})}(jQuery);
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(x){"use strict";var t,e,i,n,W,C,o,s,r,l,a,h,u;function E(t,e,i){return[parseFloat(t[0])*(a.test(t[0])?e/100:1),parseFloat(t[1])*(a.test(t[1])?i/100:1)]}function L(t,e){return parseInt(x.css(t,e),10)||0}function N(t){return null!=t&&t===t.window}x.ui=x.ui||{},x.ui.version="1.13.3",
x.extend(x.expr.pseudos,{data:x.expr.createPseudo?x.expr.createPseudo(function(e){return function(t){return!!x.data(t,e)}}):function(t,e,i){return!!x.data(t,i[3])}}),
x.fn.extend({disableSelection:(t="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}}),
x.ui.focusable=function(t,e){var i,n,o,s=t.nodeName.toLowerCase();return"area"===s?(o=(i=t.parentNode).name,!(!t.href||!o||"map"!==i.nodeName.toLowerCase())&&0<(i=x("img[usemap='#"+o+"']")).length&&i.is(":visible")):(/^(input|select|textarea|button|object)$/.test(s)?(n=!t.disabled)&&(o=x(t).closest("fieldset")[0])&&(n=!o.disabled):n="a"===s&&t.href||e,n&&x(t).is(":visible")&&function(t){var e=t.css("visibility");for(;"inherit"===e;)t=t.parent(),e=t.css("visibility");return"visible"===e}(x(t)))},x.extend(x.expr.pseudos,{focusable:function(t){return x.ui.focusable(t,null!=x.attr(t,"tabindex"))}}),x.fn._form=function(){return"string"==typeof this[0].form?this.closest("form"):x(this[0].form)},
x.ui.formResetMixin={_formResetHandler:function(){var e=x(this);setTimeout(function(){var t=e.data("ui-form-reset-instances");x.each(t,function(){this.refresh()})})},_bindFormResetHandler:function(){var t;this.form=this.element._form(),this.form.length&&((t=this.form.data("ui-form-reset-instances")||[]).length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t))},_unbindFormResetHandler:function(){var t;this.form.length&&((t=this.form.data("ui-form-reset-instances")).splice(x.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset"))}},x.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),
x.expr.pseudos||(x.expr.pseudos=x.expr[":"]),x.uniqueSort||(x.uniqueSort=x.unique),x.escapeSelector||(e=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,i=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},x.escapeSelector=function(t){return(t+"").replace(e,i)}),x.fn.even&&x.fn.odd||x.fn.extend({even:function(){return this.filter(function(t){return t%2==0})},odd:function(){return this.filter(function(t){return t%2==1})}}),
x.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},
x.fn.labels=function(){var t,e,i;return this.length?this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(e=this.eq(0).parents("label"),(t=this.attr("id"))&&(i=(i=this.eq(0).parents().last()).add((i.length?i:this).siblings()),t="label[for='"+x.escapeSelector(t)+"']",e=e.add(i.find(t).addBack(t))),this.pushStack(e)):this.pushStack([])},x.ui.plugin={add:function(t,e,i){var n,o=x.ui[t].prototype;for(n in i)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([e,i[n]])},call:function(t,e,i,n){var o,s=t.plugins[e];if(s&&(n||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(o=0;o<s.length;o++)t.options[s[o][0]]&&s[o][1].apply(t.element,i)}},
W=Math.max,C=Math.abs,o=/left|center|right/,s=/top|center|bottom/,r=/[\+\-]\d+(\.[\d]+)?%?/,l=/^\w+/,a=/%$/,h=x.fn.position,x.position={scrollbarWidth:function(){var t,e,i;return void 0!==n?n:(i=(e=x("<div style='display:block;position:absolute;width:200px;height:200px;overflow:hidden;'><div style='height:300px;width:auto;'></div></div>")).children()[0],x("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),n=t-i)},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?x.position.scrollbarWidth():0,height:e?x.position.scrollbarWidth():0}},getWithinInfo:function(t){var e=x(t||window),i=N(e[0]),n=!!e[0]&&9===e[0].nodeType;return{element:e,isWindow:i,isDocument:n,offset:!i&&!n?x(t).offset():{left:0,top:0},scrollLeft:e.scrollLeft(),scrollTop:e.scrollTop(),width:e.outerWidth(),height:e.outerHeight()}}},x.fn.position=function(f){var c,d,p,g,m,v,y,w,b,_,t,e;return f&&f.of?(v="string"==typeof(f=x.extend({},f)).of?x(document).find(f.of):x(f.of),y=x.position.getWithinInfo(f.within),w=x.position.getScrollInfo(y),b=(f.collision||"flip").split(" "),_={},e=9===(e=(t=v)[0]).nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:N(e)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:e.preventDefault?{width:0,height:0,offset:{top:e.pageY,left:e.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()},v[0].preventDefault&&(f.at="left top"),d=e.width,p=e.height,m=x.extend({},g=e.offset),x.each(["my","at"],function(){var t,e,i=(f[this]||"").split(" ");(i=1===i.length?o.test(i[0])?i.concat(["center"]):s.test(i[0])?["center"].concat(i):["center","center"]:i)[0]=o.test(i[0])?i[0]:"center",i[1]=s.test(i[1])?i[1]:"center",t=r.exec(i[0]),e=r.exec(i[1]),_[this]=[t?t[0]:0,e?e[0]:0],f[this]=[l.exec(i[0])[0],l.exec(i[1])[0]]}),1===b.length&&(b[1]=b[0]),"right"===f.at[0]?m.left+=d:"center"===f.at[0]&&(m.left+=d/2),"bottom"===f.at[1]?m.top+=p:"center"===f.at[1]&&(m.top+=p/2),c=E(_.at,d,p),m.left+=c[0],m.top+=c[1],this.each(function(){var i,t,r=x(this),l=r.outerWidth(),a=r.outerHeight(),e=L(this,"marginLeft"),n=L(this,"marginTop"),o=l+e+L(this,"marginRight")+w.width,s=a+n+L(this,"marginBottom")+w.height,h=x.extend({},m),u=E(_.my,r.outerWidth(),r.outerHeight());"right"===f.my[0]?h.left-=l:"center"===f.my[0]&&(h.left-=l/2),"bottom"===f.my[1]?h.top-=a:"center"===f.my[1]&&(h.top-=a/2),h.left+=u[0],h.top+=u[1],i={marginLeft:e,marginTop:n},x.each(["left","top"],function(t,e){x.ui.position[b[t]]&&x.ui.position[b[t]][e](h,{targetWidth:d,targetHeight:p,elemWidth:l,elemHeight:a,collisionPosition:i,collisionWidth:o,collisionHeight:s,offset:[c[0]+u[0],c[1]+u[1]],my:f.my,at:f.at,within:y,elem:r})}),f.using&&(t=function(t){var e=g.left-h.left,i=e+d-l,n=g.top-h.top,o=n+p-a,s={target:{element:v,left:g.left,top:g.top,width:d,height:p},element:{element:r,left:h.left,top:h.top,width:l,height:a},horizontal:i<0?"left":0<e?"right":"center",vertical:o<0?"top":0<n?"bottom":"middle"};d<l&&C(e+i)<d&&(s.horizontal="center"),p<a&&C(n+o)<p&&(s.vertical="middle"),W(C(e),C(i))>W(C(n),C(o))?s.important="horizontal":s.important="vertical",f.using.call(this,t,s)}),r.offset(x.extend(h,{using:t}))})):h.apply(this,arguments)},x.ui.position={fit:{left:function(t,e){var i,n=e.within,o=n.isWindow?n.scrollLeft:n.offset.left,n=n.width,s=t.left-e.collisionPosition.marginLeft,r=o-s,l=s+e.collisionWidth-n-o;n<e.collisionWidth?0<r&&l<=0?(i=t.left+r+e.collisionWidth-n-o,t.left+=r-i):t.left=!(0<l&&r<=0)&&l<r?o+n-e.collisionWidth:o:0<r?t.left+=r:0<l?t.left-=l:t.left=W(t.left-s,t.left)},top:function(t,e){var i,n=e.within,n=n.isWindow?n.scrollTop:n.offset.top,o=e.within.height,s=t.top-e.collisionPosition.marginTop,r=n-s,l=s+e.collisionHeight-o-n;o<e.collisionHeight?0<r&&l<=0?(i=t.top+r+e.collisionHeight-o-n,t.top+=r-i):t.top=!(0<l&&r<=0)&&l<r?n+o-e.collisionHeight:n:0<r?t.top+=r:0<l?t.top-=l:t.top=W(t.top-s,t.top)}},flip:{left:function(t,e){var i=e.within,n=i.offset.left+i.scrollLeft,o=i.width,i=i.isWindow?i.scrollLeft:i.offset.left,s=t.left-e.collisionPosition.marginLeft,r=s-i,s=s+e.collisionWidth-o-i,l="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,a="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,h=-2*e.offset[0];r<0?((o=t.left+l+a+h+e.collisionWidth-o-n)<0||o<C(r))&&(t.left+=l+a+h):0<s&&(0<(n=t.left-e.collisionPosition.marginLeft+l+a+h-i)||C(n)<s)&&(t.left+=l+a+h)},top:function(t,e){var i=e.within,n=i.offset.top+i.scrollTop,o=i.height,i=i.isWindow?i.scrollTop:i.offset.top,s=t.top-e.collisionPosition.marginTop,r=s-i,s=s+e.collisionHeight-o-i,l="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,a="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,h=-2*e.offset[1];r<0?((o=t.top+l+a+h+e.collisionHeight-o-n)<0||o<C(r))&&(t.top+=l+a+h):0<s&&(0<(n=t.top-e.collisionPosition.marginTop+l+a+h-i)||C(n)<s)&&(t.top+=l+a+h)}},flipfit:{left:function(){x.ui.position.flip.left.apply(this,arguments),x.ui.position.fit.left.apply(this,arguments)},top:function(){x.ui.position.flip.top.apply(this,arguments),x.ui.position.fit.top.apply(this,arguments)}}},x.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}return i=(i=i||e.body).nodeName?i:e.body},x.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&x(t).trigger("blur")},
x.fn.scrollParent=function(t){var e=this.css("position"),i="absolute"===e,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,t=this.parents().filter(function(){var t=x(this);return(!i||"static"!==t.css("position"))&&n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&t.length?t:x(this[0].ownerDocument||document)},
x.extend(x.expr.pseudos,{tabbable:function(t){var e=x.attr(t,"tabindex"),i=null!=e;return(!i||0<=e)&&x.ui.focusable(t,i)}}),
x.fn.extend({uniqueId:(u=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++u)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&x(this).removeAttr("id")})}});
var f,c=0,d=Array.prototype.hasOwnProperty,p=Array.prototype.slice;x.cleanData=(f=x.cleanData,function(t){for(var e,i,n=0;null!=(i=t[n]);n++)(e=x._data(i,"events"))&&e.remove&&x(i).triggerHandler("remove");f(t)}),x.widget=function(t,i,e){var n,o,s,r={},l=t.split(".")[0],a=l+"-"+(t=t.split(".")[1]);return e||(e=i,i=x.Widget),Array.isArray(e)&&(e=x.extend.apply(null,[{}].concat(e))),x.expr.pseudos[a.toLowerCase()]=function(t){return!!x.data(t,a)},x[l]=x[l]||{},n=x[l][t],o=x[l][t]=function(t,e){if(!this||!this._createWidget)return new o(t,e);arguments.length&&this._createWidget(t,e)},x.extend(o,n,{version:e.version,_proto:x.extend({},e),_childConstructors:[]}),(s=new i).options=x.widget.extend({},s.options),x.each(e,function(e,n){function o(){return i.prototype[e].apply(this,arguments)}function s(t){return i.prototype[e].apply(this,t)}r[e]="function"!=typeof n?n:function(){var t,e=this._super,i=this._superApply;return this._super=o,this._superApply=s,t=n.apply(this,arguments),this._super=e,this._superApply=i,t}}),o.prototype=x.widget.extend(s,{widgetEventPrefix:n&&s.widgetEventPrefix||t},r,{constructor:o,namespace:l,widgetName:t,widgetFullName:a}),n?(x.each(n._childConstructors,function(t,e){var i=e.prototype;x.widget(i.namespace+"."+i.widgetName,o,e._proto)}),delete n._childConstructors):i._childConstructors.push(o),x.widget.bridge(t,o),o},x.widget.extend=function(t){for(var e,i,n=p.call(arguments,1),o=0,s=n.length;o<s;o++)for(e in n[o])i=n[o][e],d.call(n[o],e)&&void 0!==i&&(x.isPlainObject(i)?t[e]=x.isPlainObject(t[e])?x.widget.extend({},t[e],i):x.widget.extend({},i):t[e]=i);return t},x.widget.bridge=function(s,e){var r=e.prototype.widgetFullName||s;x.fn[s]=function(i){var t="string"==typeof i,n=p.call(arguments,1),o=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=x.data(this,r);return"instance"===i?(o=e,!1):e?"function"!=typeof e[i]||"_"===i.charAt(0)?x.error("no such method '"+i+"' for "+s+" widget instance"):(t=e[i].apply(e,n))!==e&&void 0!==t?(o=t&&t.jquery?o.pushStack(t.get()):t,!1):void 0:x.error("cannot call methods on "+s+" prior to initialization; attempted to call method '"+i+"'")}):o=void 0:(n.length&&(i=x.widget.extend.apply(null,[i].concat(n))),this.each(function(){var t=x.data(this,r);t?(t.option(i||{}),t._init&&t._init()):x.data(this,r,new e(i,this))})),o}},x.Widget=function(){},x.Widget._childConstructors=[],x.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=x(e||this.defaultElement||this)[0],this.element=x(e),this.uuid=c++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=x(),this.hoverable=x(),this.focusable=x(),this.classesElementLookup={},e!==this&&(x.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=x(e.style?e.ownerDocument:e.document||e),this.window=x(this.document[0].defaultView||this.document[0].parentWindow)),this.options=x.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:x.noop,_create:x.noop,_init:x.noop,destroy:function(){var i=this;this._destroy(),x.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:x.noop,widget:function(){return this.element},option:function(t,e){var i,n,o,s=t;if(0===arguments.length)return x.widget.extend({},this.options);if("string"==typeof t)if(s={},t=(i=t.split(".")).shift(),i.length){for(n=s[t]=x.widget.extend({},this.options[t]),o=0;o<i.length-1;o++)n[i[o]]=n[i[o]]||{},n=n[i[o]];if(t=i.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];s[t]=e}return this._setOptions(s),this},_setOptions:function(t){for(var e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,n;for(e in t)n=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&n&&n.length&&(i=x(n.get()),this._removeClass(n,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(o){var s=[],r=this;function t(t,e){for(var i,n=0;n<t.length;n++)i=r.classesElementLookup[t[n]]||x(),i=o.add?(function(){var i=[];o.element.each(function(t,e){x.map(r.classesElementLookup,function(t){return t}).some(function(t){return t.is(e)})||i.push(e)}),r._on(x(i),{remove:"_untrackClassesElement"})}(),x(x.uniqueSort(i.get().concat(o.element.get())))):x(i.not(o.element).get()),r.classesElementLookup[t[n]]=i,s.push(t[n]),e&&o.classes[t[n]]&&s.push(o.classes[t[n]])}return(o=x.extend({element:this.element,classes:this.options.classes||{}},o)).keys&&t(o.keys.match(/\S+/g)||[],!0),o.extra&&t(o.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(i){var n=this;x.each(n.classesElementLookup,function(t,e){-1!==x.inArray(i.target,e)&&(n.classesElementLookup[t]=x(e.not(i.target).get()))}),this._off(x(i.target))},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,n){var o="string"==typeof t||null===t,e={extra:o?e:i,keys:o?t:e,element:o?this.element:t,add:n="boolean"==typeof n?n:i};return e.element.toggleClass(this._classes(e),n),this},_on:function(o,s,t){var r,l=this;"boolean"!=typeof o&&(t=s,s=o,o=!1),t?(s=r=x(s),this.bindings=this.bindings.add(s)):(t=s,s=this.element,r=this.widget()),x.each(t,function(t,e){function i(){if(o||!0!==l.options.disabled&&!x(this).hasClass("ui-state-disabled"))return("string"==typeof e?l[e]:e).apply(l,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||x.guid++);var t=t.match(/^([\w:-]*)\s*(.*)$/),n=t[1]+l.eventNamespace,t=t[2];t?r.on(n,t,i):s.on(n,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e),this.bindings=x(this.bindings.not(t).get()),this.focusable=x(this.focusable.not(t).get()),this.hoverable=x(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(x(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(x(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(x(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(x(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var n,o,s=this.options[t];if(i=i||{},(e=x.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],o=e.originalEvent)for(n in o)n in e||(e[n]=o[n]);return this.element.trigger(e,i),!("function"==typeof s&&!1===s.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},x.each({show:"fadeIn",hide:"fadeOut"},function(s,r){x.Widget.prototype["_"+s]=function(e,t,i){var n,o=(t="string"==typeof t?{effect:t}:t)?!0!==t&&"number"!=typeof t&&t.effect||r:s;"number"==typeof(t=t||{})?t={duration:t}:!0===t&&(t={}),n=!x.isEmptyObject(t),t.complete=i,t.delay&&e.delay(t.delay),n&&x.effects&&x.effects.effect[o]?e[s](t):o!==s&&e[o]?e[o](t.duration,t.easing,i):e.queue(function(t){x(this)[s](),i&&i.call(e[0]),t()})}})});
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","../version","../keycode"],e):e(jQuery)}(function(V){"use strict";var n;function e(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:"",selectMonthLabel:"Select month",selectYearLabel:"Select year"},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,onUpdateDatepicker:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},V.extend(this._defaults,this.regional[""]),this.regional.en=V.extend(!0,{},this.regional[""]),this.regional["en-US"]=V.extend(!0,{},this.regional.en),this.dpDiv=a(V("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(e){var t="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",t,function(){V(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&V(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&V(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",t,d)}function d(){V.datepicker._isDisabledDatepicker((n.inline?n.dpDiv.parent():n.input)[0])||(V(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),V(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&V(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&V(this).addClass("ui-datepicker-next-hover"))}function c(e,t){for(var a in V.extend(e,t),t)null==t[a]&&(e[a]=t[a])}return V.extend(V.ui,{datepicker:{version:"1.13.3"}}),V.extend(e.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return c(this._defaults,e||{}),this},_attachDatepicker:function(e,t){var a,i=e.nodeName.toLowerCase(),s="div"===i||"span"===i;e.id||(this.uuid+=1,e.id="dp"+this.uuid),(a=this._newInst(V(e),s)).settings=V.extend({},t||{}),"input"===i?this._connectDatepicker(e,a):s&&this._inlineDatepicker(e,a)},_newInst:function(e,t){return{id:e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:t,dpDiv:t?a(V("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,t){var a=V(e);t.append=V([]),t.trigger=V([]),a.hasClass(this.markerClassName)||(this._attachments(a,t),a.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(t),V.data(e,"datepicker",t),t.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,t){var a,i=this._get(t,"appendText"),s=this._get(t,"isRTL");t.append&&t.append.remove(),i&&(t.append=V("<span>").addClass(this._appendClass).text(i),e[s?"before":"after"](t.append)),e.off("focus",this._showDatepicker),t.trigger&&t.trigger.remove(),"focus"!==(i=this._get(t,"showOn"))&&"both"!==i||e.on("focus",this._showDatepicker),"button"!==i&&"both"!==i||(i=this._get(t,"buttonText"),a=this._get(t,"buttonImage"),this._get(t,"buttonImageOnly")?t.trigger=V("<img>").addClass(this._triggerClass).attr({src:a,alt:i,title:i}):(t.trigger=V("<button type='button'>").addClass(this._triggerClass),a?t.trigger.html(V("<img>").attr({src:a,alt:i,title:i})):t.trigger.text(i)),e[s?"before":"after"](t.trigger),t.trigger.on("click",function(){return V.datepicker._datepickerShowing&&V.datepicker._lastInput===e[0]?V.datepicker._hideDatepicker():(V.datepicker._datepickerShowing&&V.datepicker._lastInput!==e[0]&&V.datepicker._hideDatepicker(),V.datepicker._showDatepicker(e[0])),!1}))},_autoSize:function(e){var t,a,i,s,r,n;this._get(e,"autoSize")&&!e.inline&&(r=new Date(2009,11,20),(n=this._get(e,"dateFormat")).match(/[DM]/)&&(r.setMonth((t=function(e){for(s=i=a=0;s<e.length;s++)e[s].length>a&&(a=e[s].length,i=s);return i})(this._get(e,n.match(/MM/)?"monthNames":"monthNamesShort"))),r.setDate(t(this._get(e,n.match(/DD/)?"dayNames":"dayNamesShort"))+20-r.getDay())),e.input.attr("size",this._formatDate(e,r).length))},_inlineDatepicker:function(e,t){var a=V(e);a.hasClass(this.markerClassName)||(a.addClass(this.markerClassName).append(t.dpDiv),V.data(e,"datepicker",t),this._setDate(t,this._getDefaultDate(t),!0),this._updateDatepicker(t),this._updateAlternate(t),t.settings.disabled&&this._disableDatepicker(e),t.dpDiv.css("display","block"))},_dialogDatepicker:function(e,t,a,i,s){var r,n=this._dialogInst;return n||(this.uuid+=1,r="dp"+this.uuid,this._dialogInput=V("<input type='text' id='"+r+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),V("body").append(this._dialogInput),(n=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},V.data(this._dialogInput[0],"datepicker",n)),c(n.settings,i||{}),t=t&&t.constructor===Date?this._formatDate(n,t):t,this._dialogInput.val(t),this._pos=s?s.length?s:[s.pageX,s.pageY]:null,this._pos||(r=document.documentElement.clientWidth,i=document.documentElement.clientHeight,t=document.documentElement.scrollLeft||document.body.scrollLeft,s=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[r/2-100+t,i/2-150+s]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),n.settings.onSelect=a,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),V.blockUI&&V.blockUI(this.dpDiv),V.data(this._dialogInput[0],"datepicker",n),this},_destroyDatepicker:function(e){var t,a=V(e),i=V.data(e,"datepicker");a.hasClass(this.markerClassName)&&(t=e.nodeName.toLowerCase(),V.removeData(e,"datepicker"),"input"===t?(i.append.remove(),i.trigger.remove(),a.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==t&&"span"!==t||a.removeClass(this.markerClassName).empty(),n===i)&&(n=null,this._curInst=null)},_enableDatepicker:function(t){var e,a=V(t),i=V.data(t,"datepicker");a.hasClass(this.markerClassName)&&("input"===(e=t.nodeName.toLowerCase())?(t.disabled=!1,i.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==e&&"span"!==e||((i=a.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=V.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var e,a=V(t),i=V.data(t,"datepicker");a.hasClass(this.markerClassName)&&("input"===(e=t.nodeName.toLowerCase())?(t.disabled=!0,i.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==e&&"span"!==e||((i=a.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=V.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(e)for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(e){try{return V.data(e,"datepicker")}catch(e){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,t,a){var i,s,r=this._getInst(e);if(2===arguments.length&&"string"==typeof t)return"defaults"===t?V.extend({},V.datepicker._defaults):r?"all"===t?V.extend({},r.settings):this._get(r,t):null;i=t||{},"string"==typeof t&&((i={})[t]=a),r&&(this._curInst===r&&this._hideDatepicker(),t=this._getDateDatepicker(e,!0),a=this._getMinMaxDate(r,"min"),s=this._getMinMaxDate(r,"max"),c(r.settings,i),null!==a&&void 0!==i.dateFormat&&void 0===i.minDate&&(r.settings.minDate=this._formatDate(r,a)),null!==s&&void 0!==i.dateFormat&&void 0===i.maxDate&&(r.settings.maxDate=this._formatDate(r,s)),"disabled"in i&&(i.disabled?this._disableDatepicker(e):this._enableDatepicker(e)),this._attachments(V(e),r),this._autoSize(r),this._setDate(r,t),this._updateAlternate(r),this._updateDatepicker(r))},_changeDatepicker:function(e,t,a){this._optionDatepicker(e,t,a)},_refreshDatepicker:function(e){e=this._getInst(e);e&&this._updateDatepicker(e)},_setDateDatepicker:function(e,t){e=this._getInst(e);e&&(this._setDate(e,t),this._updateDatepicker(e),this._updateAlternate(e))},_getDateDatepicker:function(e,t){e=this._getInst(e);return e&&!e.inline&&this._setDateFromField(e,t),e?this._getDate(e):null},_doKeyDown:function(e){var t,a,i=V.datepicker._getInst(e.target),s=!0,r=i.dpDiv.is(".ui-datepicker-rtl");if(i._keyEvent=!0,V.datepicker._datepickerShowing)switch(e.keyCode){case 9:V.datepicker._hideDatepicker(),s=!1;break;case 13:return(a=V("td."+V.datepicker._dayOverClass+":not(."+V.datepicker._currentClass+")",i.dpDiv))[0]&&V.datepicker._selectDay(e.target,i.selectedMonth,i.selectedYear,a[0]),(a=V.datepicker._get(i,"onSelect"))?(t=V.datepicker._formatDate(i),a.apply(i.input?i.input[0]:null,[t,i])):V.datepicker._hideDatepicker(),!1;case 27:V.datepicker._hideDatepicker();break;case 33:V.datepicker._adjustDate(e.target,e.ctrlKey?-V.datepicker._get(i,"stepBigMonths"):-V.datepicker._get(i,"stepMonths"),"M");break;case 34:V.datepicker._adjustDate(e.target,e.ctrlKey?+V.datepicker._get(i,"stepBigMonths"):+V.datepicker._get(i,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&V.datepicker._clearDate(e.target),s=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&V.datepicker._gotoToday(e.target),s=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&V.datepicker._adjustDate(e.target,r?1:-1,"D"),s=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&V.datepicker._adjustDate(e.target,e.ctrlKey?-V.datepicker._get(i,"stepBigMonths"):-V.datepicker._get(i,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&V.datepicker._adjustDate(e.target,-7,"D"),s=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&V.datepicker._adjustDate(e.target,r?-1:1,"D"),s=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&V.datepicker._adjustDate(e.target,e.ctrlKey?+V.datepicker._get(i,"stepBigMonths"):+V.datepicker._get(i,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&V.datepicker._adjustDate(e.target,7,"D"),s=e.ctrlKey||e.metaKey;break;default:s=!1}else 36===e.keyCode&&e.ctrlKey?V.datepicker._showDatepicker(this):s=!1;s&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var t,a=V.datepicker._getInst(e.target);if(V.datepicker._get(a,"constrainInput"))return a=V.datepicker._possibleChars(V.datepicker._get(a,"dateFormat")),t=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),e.ctrlKey||e.metaKey||t<" "||!a||-1<a.indexOf(t)},_doKeyUp:function(e){e=V.datepicker._getInst(e.target);if(e.input.val()!==e.lastVal)try{V.datepicker.parseDate(V.datepicker._get(e,"dateFormat"),e.input?e.input.val():null,V.datepicker._getFormatConfig(e))&&(V.datepicker._setDateFromField(e),V.datepicker._updateAlternate(e),V.datepicker._updateDatepicker(e))}catch(e){}return!0},_showDatepicker:function(e){var t,a,i,s;"input"!==(e=e.target||e).nodeName.toLowerCase()&&(e=V("input",e.parentNode)[0]),V.datepicker._isDisabledDatepicker(e)||V.datepicker._lastInput===e||(s=V.datepicker._getInst(e),V.datepicker._curInst&&V.datepicker._curInst!==s&&(V.datepicker._curInst.dpDiv.stop(!0,!0),s)&&V.datepicker._datepickerShowing&&V.datepicker._hideDatepicker(V.datepicker._curInst.input[0]),!1===(a=(a=V.datepicker._get(s,"beforeShow"))?a.apply(e,[e,s]):{}))||(c(s.settings,a),s.lastVal=null,V.datepicker._lastInput=e,V.datepicker._setDateFromField(s),V.datepicker._inDialog&&(e.value=""),V.datepicker._pos||(V.datepicker._pos=V.datepicker._findPos(e),V.datepicker._pos[1]+=e.offsetHeight),t=!1,V(e).parents().each(function(){return!(t|="fixed"===V(this).css("position"))}),a={left:V.datepicker._pos[0],top:V.datepicker._pos[1]},V.datepicker._pos=null,s.dpDiv.empty(),s.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),V.datepicker._updateDatepicker(s),a=V.datepicker._checkOffset(s,a,t),s.dpDiv.css({position:V.datepicker._inDialog&&V.blockUI?"static":t?"fixed":"absolute",display:"none",left:a.left+"px",top:a.top+"px"}),s.inline)||(a=V.datepicker._get(s,"showAnim"),i=V.datepicker._get(s,"duration"),s.dpDiv.css("z-index",function(e){for(var t;e.length&&e[0]!==document;){if(("absolute"===(t=e.css("position"))||"relative"===t||"fixed"===t)&&(t=parseInt(e.css("zIndex"),10),!isNaN(t))&&0!==t)return t;e=e.parent()}return 0}(V(e))+1),V.datepicker._datepickerShowing=!0,V.effects&&V.effects.effect[a]?s.dpDiv.show(a,V.datepicker._get(s,"showOptions"),i):s.dpDiv[a||"show"](a?i:null),V.datepicker._shouldFocusInput(s)&&s.input.trigger("focus"),V.datepicker._curInst=s)},_updateDatepicker:function(e){this.maxRows=4,(n=e).dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var t,a=this._getNumberOfMonths(e),i=a[1],s=e.dpDiv.find("."+this._dayOverClass+" a"),r=V.datepicker._get(e,"onUpdateDatepicker");0<s.length&&d.apply(s.get(0)),e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),1<i&&e.dpDiv.addClass("ui-datepicker-multi-"+i).css("width",17*i+"em"),e.dpDiv[(1!==a[0]||1!==a[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===V.datepicker._curInst&&V.datepicker._datepickerShowing&&V.datepicker._shouldFocusInput(e)&&e.input.trigger("focus"),e.yearshtml&&(t=e.yearshtml,setTimeout(function(){t===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year").first().replaceWith(e.yearshtml),t=e.yearshtml=null},0)),r&&r.apply(e.input?e.input[0]:null,[e])},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(e,t,a){var i=e.dpDiv.outerWidth(),s=e.dpDiv.outerHeight(),r=e.input?e.input.outerWidth():0,n=e.input?e.input.outerHeight():0,d=document.documentElement.clientWidth+(a?0:V(document).scrollLeft()),c=document.documentElement.clientHeight+(a?0:V(document).scrollTop());return t.left-=this._get(e,"isRTL")?i-r:0,t.left-=a&&t.left===e.input.offset().left?V(document).scrollLeft():0,t.top-=a&&t.top===e.input.offset().top+n?V(document).scrollTop():0,t.left-=Math.min(t.left,d<t.left+i&&i<d?Math.abs(t.left+i-d):0),t.top-=Math.min(t.top,c<t.top+s&&s<c?Math.abs(s+n):0),t},_findPos:function(e){for(var t=this._getInst(e),a=this._get(t,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||V.expr.pseudos.hidden(e));)e=e[a?"previousSibling":"nextSibling"];return[(t=V(e).offset()).left,t.top]},_hideDatepicker:function(e){var t,a,i=this._curInst;!i||e&&i!==V.data(e,"datepicker")||this._datepickerShowing&&(e=this._get(i,"showAnim"),a=this._get(i,"duration"),t=function(){V.datepicker._tidyDialog(i)},V.effects&&(V.effects.effect[e]||V.effects[e])?i.dpDiv.hide(e,V.datepicker._get(i,"showOptions"),a,t):i.dpDiv["slideDown"===e?"slideUp":"fadeIn"===e?"fadeOut":"hide"](e?a:null,t),e||t(),this._datepickerShowing=!1,(a=this._get(i,"onClose"))&&a.apply(i.input?i.input[0]:null,[i.input?i.input.val():"",i]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),V.blockUI)&&(V.unblockUI(),V("body").append(this.dpDiv)),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(e){var t;V.datepicker._curInst&&(e=V(e.target),t=V.datepicker._getInst(e[0]),!(e[0].id===V.datepicker._mainDivId||0!==e.parents("#"+V.datepicker._mainDivId).length||e.hasClass(V.datepicker.markerClassName)||e.closest("."+V.datepicker._triggerClass).length||!V.datepicker._datepickerShowing||V.datepicker._inDialog&&V.blockUI)||e.hasClass(V.datepicker.markerClassName)&&V.datepicker._curInst!==t)&&V.datepicker._hideDatepicker()},_adjustDate:function(e,t,a){var e=V(e),i=this._getInst(e[0]);this._isDisabledDatepicker(e[0])||(this._adjustInstDate(i,t,a),this._updateDatepicker(i))},_gotoToday:function(e){var t,e=V(e),a=this._getInst(e[0]);this._get(a,"gotoCurrent")&&a.currentDay?(a.selectedDay=a.currentDay,a.drawMonth=a.selectedMonth=a.currentMonth,a.drawYear=a.selectedYear=a.currentYear):(t=new Date,a.selectedDay=t.getDate(),a.drawMonth=a.selectedMonth=t.getMonth(),a.drawYear=a.selectedYear=t.getFullYear()),this._notifyChange(a),this._adjustDate(e)},_selectMonthYear:function(e,t,a){var e=V(e),i=this._getInst(e[0]);i["selected"+("M"===a?"Month":"Year")]=i["draw"+("M"===a?"Month":"Year")]=parseInt(t.options[t.selectedIndex].value,10),this._notifyChange(i),this._adjustDate(e)},_selectDay:function(e,t,a,i){var s=V(e);V(i).hasClass(this._unselectableClass)||this._isDisabledDatepicker(s[0])||((s=this._getInst(s[0])).selectedDay=s.currentDay=parseInt(V("a",i).attr("data-date")),s.selectedMonth=s.currentMonth=t,s.selectedYear=s.currentYear=a,this._selectDate(e,this._formatDate(s,s.currentDay,s.currentMonth,s.currentYear)))},_clearDate:function(e){e=V(e);this._selectDate(e,"")},_selectDate:function(e,t){var a,e=V(e),e=this._getInst(e[0]);t=null!=t?t:this._formatDate(e),e.input&&e.input.val(t),this._updateAlternate(e),(a=this._get(e,"onSelect"))?a.apply(e.input?e.input[0]:null,[t,e]):e.input&&e.input.trigger("change"),e.inline?this._updateDatepicker(e):(this._hideDatepicker(),this._lastInput=e.input[0],"object"!=typeof e.input[0]&&e.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(e){var t,a,i=this._get(e,"altField");i&&(a=this._get(e,"altFormat")||this._get(e,"dateFormat"),t=this._getDate(e),a=this.formatDate(a,t,this._getFormatConfig(e)),V(document).find(i).val(a))},noWeekends:function(e){e=e.getDay();return[0<e&&e<6,""]},iso8601Week:function(e){var t,e=new Date(e.getTime());return e.setDate(e.getDate()+4-(e.getDay()||7)),t=e.getTime(),e.setMonth(0),e.setDate(1),Math.floor(Math.round((t-e)/864e5)/7)+1},parseDate:function(t,s,e){if(null==t||null==s)throw"Invalid arguments";if(""===(s="object"==typeof s?s.toString():s+""))return null;for(var a,i,r=0,n=(e?e.shortYearCutoff:null)||this._defaults.shortYearCutoff,n="string"!=typeof n?n:(new Date).getFullYear()%100+parseInt(n,10),d=(e?e.dayNamesShort:null)||this._defaults.dayNamesShort,c=(e?e.dayNames:null)||this._defaults.dayNames,o=(e?e.monthNamesShort:null)||this._defaults.monthNamesShort,l=(e?e.monthNames:null)||this._defaults.monthNames,h=-1,u=-1,p=-1,g=-1,_=!1,f=function(e){e=y+1<t.length&&t.charAt(y+1)===e;return e&&y++,e},k=function(e){var t=f(e),t="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,e=new RegExp("^\\d{"+("y"===e?t:1)+","+t+"}"),t=s.substring(r).match(e);if(t)return r+=t[0].length,parseInt(t[0],10);throw"Missing number at position "+r},D=function(e,t,a){var i=-1,e=V.map(f(e)?a:t,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(V.each(e,function(e,t){var a=t[1];if(s.substr(r,a.length).toLowerCase()===a.toLowerCase())return i=t[0],r+=a.length,!1}),-1!==i)return i+1;throw"Unknown name at position "+r},m=function(){if(s.charAt(r)!==t.charAt(y))throw"Unexpected literal at position "+r;r++},y=0;y<t.length;y++)if(_)"'"!==t.charAt(y)||f("'")?m():_=!1;else switch(t.charAt(y)){case"d":p=k("d");break;case"D":D("D",d,c);break;case"o":g=k("o");break;case"m":u=k("m");break;case"M":u=D("M",o,l);break;case"y":h=k("y");break;case"@":h=(i=new Date(k("@"))).getFullYear(),u=i.getMonth()+1,p=i.getDate();break;case"!":h=(i=new Date((k("!")-this._ticksTo1970)/1e4)).getFullYear(),u=i.getMonth()+1,p=i.getDate();break;case"'":f("'")?m():_=!0;break;default:m()}if(r<s.length&&(e=s.substr(r),!/^\s+/.test(e)))throw"Extra/unparsed characters found in date: "+e;if(-1===h?h=(new Date).getFullYear():h<100&&(h+=(new Date).getFullYear()-(new Date).getFullYear()%100+(h<=n?0:-100)),-1<g)for(u=1,p=g;;){if(p<=(a=this._getDaysInMonth(h,u-1)))break;u++,p-=a}if((i=this._daylightSavingAdjust(new Date(h,u-1,p))).getFullYear()!==h||i.getMonth()+1!==u||i.getDate()!==p)throw"Invalid date";return i},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(t,e,a){if(!e)return"";function i(e,t,a){var i=""+t;if(l(e))for(;i.length<a;)i="0"+i;return i}function s(e,t,a,i){return(l(e)?i:a)[t]}var r,n=(a?a.dayNamesShort:null)||this._defaults.dayNamesShort,d=(a?a.dayNames:null)||this._defaults.dayNames,c=(a?a.monthNamesShort:null)||this._defaults.monthNamesShort,o=(a?a.monthNames:null)||this._defaults.monthNames,l=function(e){e=r+1<t.length&&t.charAt(r+1)===e;return e&&r++,e},h="",u=!1;if(e)for(r=0;r<t.length;r++)if(u)"'"!==t.charAt(r)||l("'")?h+=t.charAt(r):u=!1;else switch(t.charAt(r)){case"d":h+=i("d",e.getDate(),2);break;case"D":h+=s("D",e.getDay(),n,d);break;case"o":h+=i("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":h+=i("m",e.getMonth()+1,2);break;case"M":h+=s("M",e.getMonth(),c,o);break;case"y":h+=l("y")?e.getFullYear():(e.getFullYear()%100<10?"0":"")+e.getFullYear()%100;break;case"@":h+=e.getTime();break;case"!":h+=1e4*e.getTime()+this._ticksTo1970;break;case"'":l("'")?h+="'":u=!0;break;default:h+=t.charAt(r)}return h},_possibleChars:function(t){for(var e="",a=!1,i=function(e){e=s+1<t.length&&t.charAt(s+1)===e;return e&&s++,e},s=0;s<t.length;s++)if(a)"'"!==t.charAt(s)||i("'")?e+=t.charAt(s):a=!1;else switch(t.charAt(s)){case"d":case"m":case"y":case"@":e+="0123456789";break;case"D":case"M":return null;case"'":i("'")?e+="'":a=!0;break;default:e+=t.charAt(s)}return e},_get:function(e,t){return(void 0!==e.settings[t]?e.settings:this._defaults)[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var a=this._get(e,"dateFormat"),i=e.lastVal=e.input?e.input.val():null,s=this._getDefaultDate(e),r=s,n=this._getFormatConfig(e);try{r=this.parseDate(a,i,n)||s}catch(e){i=t?"":i}e.selectedDay=r.getDate(),e.drawMonth=e.selectedMonth=r.getMonth(),e.drawYear=e.selectedYear=r.getFullYear(),e.currentDay=i?r.getDate():0,e.currentMonth=i?r.getMonth():0,e.currentYear=i?r.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(d,e,t){var a,i=null==e||""===e?t:"string"==typeof e?function(e){try{return V.datepicker.parseDate(V.datepicker._get(d,"dateFormat"),e,V.datepicker._getFormatConfig(d))}catch(e){}for(var t=(e.toLowerCase().match(/^c/)?V.datepicker._getDate(d):null)||new Date,a=t.getFullYear(),i=t.getMonth(),s=t.getDate(),r=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,n=r.exec(e);n;){switch(n[2]||"d"){case"d":case"D":s+=parseInt(n[1],10);break;case"w":case"W":s+=7*parseInt(n[1],10);break;case"m":case"M":i+=parseInt(n[1],10),s=Math.min(s,V.datepicker._getDaysInMonth(a,i));break;case"y":case"Y":a+=parseInt(n[1],10),s=Math.min(s,V.datepicker._getDaysInMonth(a,i))}n=r.exec(e)}return new Date(a,i,s)}(e):"number"==typeof e?isNaN(e)?t:(i=e,(a=new Date).setDate(a.getDate()+i),a):new Date(e.getTime());return(i=i&&"Invalid Date"===i.toString()?t:i)&&(i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0)),this._daylightSavingAdjust(i)},_daylightSavingAdjust:function(e){return e?(e.setHours(12<e.getHours()?e.getHours()+2:0),e):null},_setDate:function(e,t,a){var i=!t,s=e.selectedMonth,r=e.selectedYear,t=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=t.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=t.getMonth(),e.drawYear=e.selectedYear=e.currentYear=t.getFullYear(),s===e.selectedMonth&&r===e.selectedYear||a||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(i?"":this._formatDate(e))},_getDate:function(e){return!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay))},_attachHandlers:function(e){var t=this._get(e,"stepMonths"),a="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){V.datepicker._adjustDate(a,-t,"M")},next:function(){V.datepicker._adjustDate(a,+t,"M")},hide:function(){V.datepicker._hideDatepicker()},today:function(){V.datepicker._gotoToday(a)},selectDay:function(){return V.datepicker._selectDay(a,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return V.datepicker._selectMonthYear(a,this,"M"),!1},selectYear:function(){return V.datepicker._selectMonthYear(a,this,"Y"),!1}};V(this).on(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,a,i,s,r,O,L,R,H,n,d,W,c,o,l,h,u,p,g,_,f,k,E,D,m,U,y,P,z,v,M,b,w=new Date,B=this._daylightSavingAdjust(new Date(w.getFullYear(),w.getMonth(),w.getDate())),C=this._get(e,"isRTL"),w=this._get(e,"showButtonPanel"),I=this._get(e,"hideIfNoPrevNext"),x=this._get(e,"navigationAsDateFormat"),Y=this._getNumberOfMonths(e),S=this._get(e,"showCurrentAtPos"),F=this._get(e,"stepMonths"),J=1!==Y[0]||1!==Y[1],N=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),T=this._getMinMaxDate(e,"min"),A=this._getMinMaxDate(e,"max"),K=e.drawMonth-S,j=e.drawYear;if(K<0&&(K+=12,j--),A)for(t=this._daylightSavingAdjust(new Date(A.getFullYear(),A.getMonth()-Y[0]*Y[1]+1,A.getDate())),t=T&&t<T?T:t;this._daylightSavingAdjust(new Date(j,K,1))>t;)--K<0&&(K=11,j--);for(e.drawMonth=K,e.drawYear=j,S=this._get(e,"prevText"),S=x?this.formatDate(S,this._daylightSavingAdjust(new Date(j,K-F,1)),this._getFormatConfig(e)):S,a=this._canAdjustMonth(e,-1,j,K)?V("<a>").attr({class:"ui-datepicker-prev ui-corner-all","data-handler":"prev","data-event":"click",title:S}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(C?"e":"w")).text(S))[0].outerHTML:I?"":V("<a>").attr({class:"ui-datepicker-prev ui-corner-all ui-state-disabled",title:S}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(C?"e":"w")).text(S))[0].outerHTML,S=this._get(e,"nextText"),S=x?this.formatDate(S,this._daylightSavingAdjust(new Date(j,K+F,1)),this._getFormatConfig(e)):S,i=this._canAdjustMonth(e,1,j,K)?V("<a>").attr({class:"ui-datepicker-next ui-corner-all","data-handler":"next","data-event":"click",title:S}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(C?"w":"e")).text(S))[0].outerHTML:I?"":V("<a>").attr({class:"ui-datepicker-next ui-corner-all ui-state-disabled",title:S}).append(V("<span>").attr("class","ui-icon ui-icon-circle-triangle-"+(C?"w":"e")).text(S))[0].outerHTML,F=this._get(e,"currentText"),I=this._get(e,"gotoCurrent")&&e.currentDay?N:B,F=x?this.formatDate(F,I,this._getFormatConfig(e)):F,S="",e.inline||(S=V("<button>").attr({type:"button",class:"ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all","data-handler":"hide","data-event":"click"}).text(this._get(e,"closeText"))[0].outerHTML),x="",w&&(x=V("<div class='ui-datepicker-buttonpane ui-widget-content'>").append(C?S:"").append(this._isInRange(e,I)?V("<button>").attr({type:"button",class:"ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all","data-handler":"today","data-event":"click"}).text(F):"").append(C?"":S)[0].outerHTML),s=parseInt(this._get(e,"firstDay"),10),s=isNaN(s)?0:s,r=this._get(e,"showWeek"),O=this._get(e,"dayNames"),L=this._get(e,"dayNamesMin"),R=this._get(e,"monthNames"),H=this._get(e,"monthNamesShort"),n=this._get(e,"beforeShowDay"),d=this._get(e,"showOtherMonths"),W=this._get(e,"selectOtherMonths"),c=this._getDefaultDate(e),o="",h=0;h<Y[0];h++){for(u="",this.maxRows=4,p=0;p<Y[1];p++){if(g=this._daylightSavingAdjust(new Date(j,K,e.selectedDay)),_=" ui-corner-all",f="",J){if(f+="<div class='ui-datepicker-group",1<Y[1])switch(p){case 0:f+=" ui-datepicker-group-first",_=" ui-corner-"+(C?"right":"left");break;case Y[1]-1:f+=" ui-datepicker-group-last",_=" ui-corner-"+(C?"left":"right");break;default:f+=" ui-datepicker-group-middle",_=""}f+="'>"}for(f+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+_+"'>"+(/all|left/.test(_)&&0===h?C?i:a:"")+(/all|right/.test(_)&&0===h?C?a:i:"")+this._generateMonthYearHeader(e,K,j,T,A,0<h||0<p,R,H)+"</div><table class='ui-datepicker-calendar'><thead><tr>",k=r?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",l=0;l<7;l++)k+="<th scope='col'"+(5<=(l+s+6)%7?" class='ui-datepicker-week-end'":"")+"><span title='"+O[E=(l+s)%7]+"'>"+L[E]+"</span></th>";for(f+=k+"</tr></thead><tbody>",m=this._getDaysInMonth(j,K),j===e.selectedYear&&K===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,m)),D=(this._getFirstDayOfMonth(j,K)-s+7)%7,m=Math.ceil((D+m)/7),U=J&&this.maxRows>m?this.maxRows:m,this.maxRows=U,y=this._daylightSavingAdjust(new Date(j,K,1-D)),P=0;P<U;P++){for(f+="<tr>",z=r?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(y)+"</td>":"",l=0;l<7;l++)v=n?n.apply(e.input?e.input[0]:null,[y]):[!0,""],b=(M=y.getMonth()!==K)&&!W||!v[0]||T&&y<T||A&&A<y,z+="<td class='"+(5<=(l+s+6)%7?" ui-datepicker-week-end":"")+(M?" ui-datepicker-other-month":"")+(y.getTime()===g.getTime()&&K===e.selectedMonth&&e._keyEvent||c.getTime()===y.getTime()&&c.getTime()===g.getTime()?" "+this._dayOverClass:"")+(b?" "+this._unselectableClass+" ui-state-disabled":"")+(M&&!d?"":" "+v[1]+(y.getTime()===N.getTime()?" "+this._currentClass:"")+(y.getTime()===B.getTime()?" ui-datepicker-today":""))+"'"+(M&&!d||!v[2]?"":" title='"+v[2].replace(/'/g,"&#39;")+"'")+(b?"":" data-handler='selectDay' data-event='click' data-month='"+y.getMonth()+"' data-year='"+y.getFullYear()+"'")+">"+(M&&!d?"&#xa0;":b?"<span class='ui-state-default'>"+y.getDate()+"</span>":"<a class='ui-state-default"+(y.getTime()===B.getTime()?" ui-state-highlight":"")+(y.getTime()===N.getTime()?" ui-state-active":"")+(M?" ui-priority-secondary":"")+"' href='#' aria-current='"+(y.getTime()===N.getTime()?"true":"false")+"' data-date='"+y.getDate()+"'>"+y.getDate()+"</a>")+"</td>",y.setDate(y.getDate()+1),y=this._daylightSavingAdjust(y);f+=z+"</tr>"}11<++K&&(K=0,j++),u+=f+="</tbody></table>"+(J?"</div>"+(0<Y[0]&&p===Y[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"")}o+=u}return o+=x,e._keyEvent=!1,o},_generateMonthYearHeader:function(e,t,a,i,s,r,n,d){var c,o,l,h,u,p,g=this._get(e,"changeMonth"),_=this._get(e,"changeYear"),f=this._get(e,"showMonthAfterYear"),k=this._get(e,"selectMonthLabel"),D=this._get(e,"selectYearLabel"),m="<div class='ui-datepicker-title'>",y="";if(r||!g)y+="<span class='ui-datepicker-month'>"+n[t]+"</span>";else{for(c=i&&i.getFullYear()===a,o=s&&s.getFullYear()===a,y+="<select class='ui-datepicker-month' aria-label='"+k+"' data-handler='selectMonth' data-event='change'>",l=0;l<12;l++)(!c||l>=i.getMonth())&&(!o||l<=s.getMonth())&&(y+="<option value='"+l+"'"+(l===t?" selected='selected'":"")+">"+d[l]+"</option>");y+="</select>"}if(f||(m+=y+(!r&&g&&_?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",r||!_)m+="<span class='ui-datepicker-year'>"+a+"</span>";else{for(n=this._get(e,"yearRange").split(":"),h=(new Date).getFullYear(),u=(k=function(e){e=e.match(/c[+\-].*/)?a+parseInt(e.substring(1),10):e.match(/[+\-].*/)?h+parseInt(e,10):parseInt(e,10);return isNaN(e)?h:e})(n[0]),p=Math.max(u,k(n[1]||"")),u=i?Math.max(u,i.getFullYear()):u,p=s?Math.min(p,s.getFullYear()):p,e.yearshtml+="<select class='ui-datepicker-year' aria-label='"+D+"' data-handler='selectYear' data-event='change'>";u<=p;u++)e.yearshtml+="<option value='"+u+"'"+(u===a?" selected='selected'":"")+">"+u+"</option>";e.yearshtml+="</select>",m+=e.yearshtml,e.yearshtml=null}return m+=this._get(e,"yearSuffix"),f&&(m+=(!r&&g&&_?"":"&#xa0;")+y),m+="</div>"},_adjustInstDate:function(e,t,a){var i=e.selectedYear+("Y"===a?t:0),s=e.selectedMonth+("M"===a?t:0),t=Math.min(e.selectedDay,this._getDaysInMonth(i,s))+("D"===a?t:0),i=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(i,s,t)));e.selectedDay=i.getDate(),e.drawMonth=e.selectedMonth=i.getMonth(),e.drawYear=e.selectedYear=i.getFullYear(),"M"!==a&&"Y"!==a||this._notifyChange(e)},_restrictMinMax:function(e,t){var a=this._getMinMaxDate(e,"min"),e=this._getMinMaxDate(e,"max"),a=a&&t<a?a:t;return e&&e<a?e:a},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){e=this._get(e,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,a,i){var s=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(a,i+(t<0?t:s[0]*s[1]),1));return t<0&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var a,i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),r=null,n=null,e=this._get(e,"yearRange");return e&&(e=e.split(":"),a=(new Date).getFullYear(),r=parseInt(e[0],10),n=parseInt(e[1],10),e[0].match(/[+\-].*/)&&(r+=a),e[1].match(/[+\-].*/))&&(n+=a),(!i||t.getTime()>=i.getTime())&&(!s||t.getTime()<=s.getTime())&&(!r||t.getFullYear()>=r)&&(!n||t.getFullYear()<=n)},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return{shortYearCutoff:"string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,a,i){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);i=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(i,a,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),i,this._getFormatConfig(e))}}),V.fn.datepicker=function(e){if(!this.length)return this;V.datepicker.initialized||(V(document).on("mousedown",V.datepicker._checkExternalClick),V.datepicker.initialized=!0),0===V("#"+V.datepicker._mainDivId).length&&V("body").append(V.datepicker.dpDiv);var t=Array.prototype.slice.call(arguments,1);return"string"==typeof e&&("isDisabled"===e||"getDate"===e||"widget"===e)||"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?V.datepicker["_"+e+"Datepicker"].apply(V.datepicker,[this[0]].concat(t)):this.each(function(){"string"==typeof e?V.datepicker["_"+e+"Datepicker"].apply(V.datepicker,[this].concat(t)):V.datepicker._attachDatepicker(this,e)})},V.datepicker=new e,V.datepicker.initialized=!1,V.datepicker.uuid=(new Date).getTime(),V.datepicker.version="1.13.3",V.datepicker});