(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(00&&this_pic.length>0){var a=[];for(i=0;i0&&this_media.length>0){const o=oo[0];var a=[];for(i=0;i',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!1});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(00&&this_pic.length>0){var a=[];for(i=0;i0){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,!0);imgParent.find(".cr-ajax-reviews-cus-images-modal .cr-ajax-reviews-cus-images-slider-nav").slickk('slickGoTo',slide_no,!0)}});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,!0);closeParent.find(".cr-ajax-reviews-cus-images-modal .cr-ajax-reviews-cus-images-slider-nav").slickk('slickGoTo',0,!0);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),!0)});jQuery('.cr-all-reviews-shortcode').on("click",".cr-page-numbers-a",function(e){e.preventDefault();cr_filter_all_reviews(jQuery(this),!0)});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('
'+response.responseText+'
')})});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('
'+response.responseText+'
')})});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-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!0});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!0}});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;icr_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("
",{class:"cr-upload-images-containers cr-upload-images-container-"+(lastIndex+i)});let progressBar=jQuery("
",{class:"cr-upload-images-pbar"});progressBar.append(jQuery("
",{class:"cr-upload-images-pbarin"}));if(-1===uploadFiles[0].files[i].type.indexOf('image')){container.append(jQuery(""))}else{container.append(jQuery("",{class:"cr-upload-images-thumbnail",src:URL.createObjectURL(uploadFiles[0].files[i])}))} container.append(progressBar);let removeButton=jQuery("
"))}}} if(0+
"))}}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+
"))}}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(0jQuery(this).find(".cr-review-form-rating-actv").length){jQuery(this).closest(".cr-review-form-rating").addClass("cr-review-form-error");validationResult=!1}});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=!1} 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=!1} 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=!1} submitBtn.closest(".cr-review-form-wrap").find(".cr-onsite-question.cr-review-form-que-req").each(function(index){if(0jQuery(this).find("input[type=text]").val().trim().length){jQuery(this).closest(".cr-onsite-question").addClass("cr-review-form-error");validationResult=!1}else{jQuery(this).closest(".cr-onsite-question").removeClass("cr-review-form-error")}} if(0jQuery(this).find("input[type=number]").val().trim().length){jQuery(this).closest(".cr-onsite-question").addClass("cr-review-form-error");validationResult=!1}else{jQuery(this).closest(".cr-onsite-question").removeClass("cr-review-form-error")}}});if(00){submitBtn.closest(".cr-review-form-wrap").find(".cr-review-form-captcha").addClass("cr-review-form-error");validationResult=!1}}} return validationResult} function cr_validate_qna(submitBtn){let validationResult=!0;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=!1} 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=!1} 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=!1} if(0submitBtn.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=!1} 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=!1} 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=!1} if(0{clearTimeout(timeout);if(00){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")})}