$(document).ready(function(){function n(n,t){if(typeof history.pushState!="undefined"){var i={Page:n,Url:t};history.pushState(i,i.Page,i.Url)}}function t(){var n="",t=$("#ReturnURL").val();return t&&(n="returnurl="+encodeURIComponent(t)),n}$('a[data-toggle="tab"]').on("shown.bs.tab",function(t){var i=$(t.target).attr("href");n("Product",i)});if($(".buy-section").click(function(){return $("#tocTab").click(),$("#div-Buy-Now").hide(),$("#buy-now-m").hide(),$('input[type=radio][name=productid][value="slices"]').attr("checked","checked"),!1}),$("input[type=radio][name=productid]").change(function(){if(this.value=="slices")return $("#selectedpurchaseoption").val(""),$(".selection").removeClass("hidden"),$(".selection").css("display",""),$(".po-row").css("display","none"),$(".default-po-row").css("display","block"),$("#div-Buy-Now").hide(),$("#buy-now-m").hide(),$("#div-Other-PurchaseOptions").removeClass("hidden"),$("#div-Other-PurchaseOptions").css("display",""),$("#tocTab").click(),!1;$("#selectedpurchaseoption").val(this.value);$("#div-Buy-Now").show();$("#buy-now-m").show();$("#divOtherPurchaseOptions").hide()}),$("#view-Other-PurchaseOptions").click(function(){return $("#section-side-bar input[type=radio][name=productid]:checked").val()=="slices"&&($("#div-Buy-Now").hide(),$("#buy-now-m").hide()),$("#div-Other-PurchaseOptions").css("display","none"),$(".po-row").css("display","block"),!1}),$("#view-Other-PurchaseOptions").click(function(){return $("#div-Other-PurchaseOptions").css("display","none"),$(".po-row").css("display","block"),!1}),$('#section-side-bar input[type=radio][value="slices"]:checked').val()=="slices"&&($("#div-Buy-Now").hide(),$("#buy-now-m").hide()),$("#paypal-div").length)paypal.Buttons({style:{label:"checkout",height:40},createOrder:function(){var n=$("#selectedpurchaseoption").val();return fetch("/cart/addcreate",{method:"post",headers:{"content-type":"application/json"},body:JSON.stringify({productid:n})}).then(function(n){return n.json()}).then(function(n){return n.Id})},onApprove:function(n){$.fn.ProcessApprovedOrder(n)},onCancel:function(){},onError:function(){alert("There was an error processing your request. Please try again or use our checkout process.")}}).render("#paypal-button-container"),paypal.Buttons({style:{label:"checkout",height:40},createOrder:function(){var n=$("#selectedpurchaseoption").val();return fetch("/cart/addcreate",{method:"post",headers:{"content-type":"application/json"},body:JSON.stringify({productid:n})}).then(function(n){return n.json()}).then(function(n){return n.Id})},onApprove:function(n){$.fn.ProcessApprovedOrder(n)},onCancel:function(){},onError:function(){alert("There was an error processing your request. Please try again or use our checkout process.")}}).render("#paypal-button-container-m");$.fn.ProcessApprovedOrder=function(n){window.location.href="/cart/checkout?ppid="+n.orderID+"&"+t()}})