core/1/iiko_files/tilda-cart-1.0.min.js

1 line
79 KiB
JavaScript
Raw Normal View History

2023-04-09 19:52:26 +05:00
if(window.t_cart__isiOS=!1,/iPhone|iPad|iPod/i.test(navigator.userAgent)&&(window.t_cart__isiOS=!0),window.t_cart__iOSMajorVersion="",window.t_cart__isiOS){var version=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);null!==version&&(window.t_cart__iOSMajorVersion=parseInt(version[1],10))}function tcart__init(t,e){var r=document.querySelector(".t706"),o=document.querySelectorAll(".t706").length;if(e||(e=r&&r.getAttribute("data-yandexmap-apikey")||""),window.tcart__ymapApiKey=e,"yes"===window.tcart_initted&&o>1){var a="RU"===window.t_cart__browserLang?"Ошибка: На странице присутствуют "+o+" виджета корзины (блок ST100). Пожалуйста, удалите дубликаты. Блоки могут находиться на странице Header или Footer.":"Error: "+o+" cart widgets (block ST100) on the page. Remove a duplicate. Blocks can be on the Header or Footer page.";return document.querySelector(".t706__previewmode-infobox .t706__previewmode-infobox-error")||Array.prototype.forEach.call(document.querySelectorAll(".t706__previewmode-infobox center"),(function(t){t.insertAdjacentHTML("beforeend",'<div class="t706__previewmode-infobox-error" style="color:red">'+a+"</div>")})),void(void 0===window.tcart_erroralert&&(alert(a),window.tcart_erroralert="yes",console.error("Error: Two cart widgets (block ST100) on the page. Remove a duplicate.")))}if(r){var c,n;"y"==r.getAttribute("data-cart-dontstore")&&(window.tcart_dontstore="y"),"y"==r.getAttribute("data-cart-oneproduct")&&(window.tcart_oneproduct="y");var i=r.getAttribute("data-cart-maxstoredays"),d;if(i&&(window.tcart_maxstoredays=i),"y"==r.getAttribute("data-cart-sendevent-onadd")&&(window.tcart_sendevent_onadd="y"),window.tcart_fullscreen="yes"===r.getAttribute("data-cart-fullscreen"),window.tcart_fullscreen){var s="https://static.tildacdn.com/css/tilda-cart-fullscreen-1.0.min.css",u;if(!document.querySelector('link[href^="'+s+'"]')){var l=document.createElement("link");l.setAttribute("rel","stylesheet"),l.setAttribute("type","text/css"),l.setAttribute("href",s),document.getElementsByTagName("head")[0].appendChild(l),document.querySelector("body").insertAdjacentElement("beforeend",l)}if("matchMedia"in window||"msMatchMedia"in window){var _,w=(window.matchMedia||window.msMatchMedia)("(max-width: 960px)");window.tcart_isMobile=w.matches,"function"==typeof w.addEventListener?w.addEventListener("change",T):w.addListener(T)}}window.tcart_initted="yes",tcart__drawBottomTotalAmount(),tcart__loadLocalObj(),tcart__reDrawCartIcon(),tcart__addEvent__links(),tcart__addEvents(),tcart__updateMinimals(),tcart__loadDiscounts(),window.addEventListener("pageshow",(function(t){t.persisted&&(tcart__loadLocalObj(),tcart__reDrawCartIcon())}),!1),setTimeout((function(){var t;tcart__addEvent__selectpayment();try{t=decodeURIComponent(document.location.hash)}catch(e){t=document.location.hash}if(t&&-1!==t.indexOf("#order:")){var e=document.querySelector('a[href="'+t+'"]');e&&e.click()}}));var p=document.querySelector("#rec"+t);p&&(p.setAttribute("data-animationappear","off"),p.style.opacity="1");var y=r.querySelector(".t706__cartwin-prodamount-label"),m=r.querySelector(".t706__cartwin-totalamount-label");if(r.querySelector(".t-input-group_dl")?(y&&(y.innerHTML=tcart_dict("subtotal")+": "),m&&(m.innerHTML=tcart_dict("grandTotal")+": ")):(y&&(y.innerHTML=tcart_dict("total")+": "),m&&(m.innerHTML=tcart_dict("total")+": ")),window.tcart_fullscreen){var y;(y=document.querySelector(".t706__sidebar-prodamount-label"))&&(y.innerHTML=tcart_dict("total")+": ");var v=r.querySelector(".t706__cartpage-prodamount .t706__cartpage-info-label");v&&(v.innerHTML=tcart_dict("subtotal")+": ");var f=r.querySelector(".t706__cartpage-order-total-label");f&&(f.innerHTML=tcart_dict("grandTotal")+":&nbsp;")}if(window.tcart_fullscreen){var b=r.querySelector(".t706__cartpage-heading"),h=r.querySelector(".t706__sidebar-heading");""===b.innerHTML&&(b.innerHTML=tcart_dict("yourOrder")),""===h.innerHTML&&(h.innerHTML=tcart_dict("yourOrder"))}else{var b;""==(b=r.querySe