')}else{$('#modalImageFooter').addClass('d-none')}});$('#imgMain').attr('src',imgSrc[0]);modalImage.show()}};let viewThumbnail=function(imgSrc){$('#imgMain').attr('src',imgSrc)};let sendBid=function(itemId,bid){let bodyFormData=new FormData();bodyFormData.append('id',itemId);bodyFormData.append('bid',bid);axios({method:"post",url:"/user/bid/",data:bodyFormData,headers:{"Content-Type":"multipart/form-data"}}).then(function(response){if(response.data.status=='failed'){if(response.data.action=='ALERT_PAYMENT'){modalAlertPayment.show()}else{bs5Utils.Snack.show('danger',response.data.message,delay=5000,dismissible=true)}}if(response.data.status=='success'){bs5Utils.Snack.show('success','Success',delay=5000,dismissible=true);setTimeout(()=>{location.reload()},100)}}).catch(function(response){bs5Utils.Snack.show('danger','Sign is required to perform the action, please sign in',delay=5000,dismissible=true);setTimeout(()=>{location.reload()},2000)})};$(document).ready(function(){modalImage=new bootstrap.Modal('#modalImage',{keyboard:true});modalAlertPayment=new bootstrap.Modal('#modalAlertPayment',{keyboard:true});$('.txtBid').keypress(function(event){let keycode=(event.keyCode?event.keyCode:event.which);if(keycode=='13'){let txtBid=$(this);let itemId=$(txtBid).attr('data-id');let bid=parseInt($(txtBid).val());sendBid(itemId,bid)}else{if(isNaN(String.fromCharCode(event.keyCode)))return false}event.stopPropagation()})});