File: /www/wwwroot/www.xxlht.com/sh/251/index_files/timesact.js
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(d){return d.raw=d};$jscomp.createTemplateTagFirstArgWithRaw=function(d,b){d.raw=b;return d};$jscomp.arrayIteratorImpl=function(d){var b=0;return function(){return b<d.length?{done:!1,value:d[b++]}:{done:!0}}};$jscomp.arrayIterator=function(d){return{next:$jscomp.arrayIteratorImpl(d)}};$jscomp.makeIterator=function(d){var b="undefined"!=typeof Symbol&&Symbol.iterator&&d[Symbol.iterator];return b?b.call(d):$jscomp.arrayIterator(d)};
$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(d,b,f){if(d==Array.prototype||d==Object.prototype)return d;d[b]=f.value;return d};
$jscomp.getGlobal=function(d){d=["object"==typeof globalThis&&globalThis,d,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<d.length;++b){var f=d[b];if(f&&f.Math==Math)return f}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};
$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(d,b){var f=$jscomp.propertyToPolyfillSymbol[b];if(null==f)return d[b];f=d[f];return void 0!==f?f:d[b]};$jscomp.polyfill=function(d,b,f,g){b&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(d,b,f,g):$jscomp.polyfillUnisolated(d,b,f,g))};
$jscomp.polyfillUnisolated=function(d,b,f,g){f=$jscomp.global;d=d.split(".");for(g=0;g<d.length-1;g++){var k=d[g];if(!(k in f))return;f=f[k]}d=d[d.length-1];g=f[d];b=b(g);b!=g&&null!=b&&$jscomp.defineProperty(f,d,{configurable:!0,writable:!0,value:b})};
$jscomp.polyfillIsolated=function(d,b,f,g){var k=d.split(".");d=1===k.length;g=k[0];g=!d&&g in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var n=0;n<k.length-1;n++){var l=k[n];if(!(l in g))return;g=g[l]}k=k[k.length-1];f=$jscomp.IS_SYMBOL_NATIVE&&"es6"===f?g[k]:null;b=b(f);null!=b&&(d?$jscomp.defineProperty($jscomp.polyfills,k,{configurable:!0,writable:!0,value:b}):b!==f&&(void 0===$jscomp.propertyToPolyfillSymbol[k]&&(f=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[k]=$jscomp.IS_SYMBOL_NATIVE?
$jscomp.global.Symbol(k):$jscomp.POLYFILL_PREFIX+f+"$"+k),$jscomp.defineProperty(g,$jscomp.propertyToPolyfillSymbol[k],{configurable:!0,writable:!0,value:b})))};$jscomp.underscoreProtoCanBeSet=function(){var d={a:!0},b={};try{return b.__proto__=d,b.a}catch(f){}return!1};
$jscomp.setPrototypeOf=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(d,b){d.__proto__=b;if(d.__proto__!==b)throw new TypeError(d+" is not extensible");return d}:null;$jscomp.generator={};$jscomp.generator.ensureIteratorResultIsObject_=function(d){if(!(d instanceof Object))throw new TypeError("Iterator result "+d+" is not an object");};
$jscomp.generator.Context=function(){this.isRunning_=!1;this.yieldAllIterator_=null;this.yieldResult=void 0;this.nextAddress=1;this.finallyAddress_=this.catchAddress_=0;this.finallyContexts_=this.abruptCompletion_=null};$jscomp.generator.Context.prototype.start_=function(){if(this.isRunning_)throw new TypeError("Generator is already running");this.isRunning_=!0};$jscomp.generator.Context.prototype.stop_=function(){this.isRunning_=!1};
$jscomp.generator.Context.prototype.jumpToErrorHandler_=function(){this.nextAddress=this.catchAddress_||this.finallyAddress_};$jscomp.generator.Context.prototype.next_=function(d){this.yieldResult=d};$jscomp.generator.Context.prototype.throw_=function(d){this.abruptCompletion_={exception:d,isException:!0};this.jumpToErrorHandler_()};$jscomp.generator.Context.prototype["return"]=function(d){this.abruptCompletion_={"return":d};this.nextAddress=this.finallyAddress_};
$jscomp.generator.Context.prototype.jumpThroughFinallyBlocks=function(d){this.abruptCompletion_={jumpTo:d};this.nextAddress=this.finallyAddress_};$jscomp.generator.Context.prototype.yield=function(d,b){this.nextAddress=b;return{value:d}};$jscomp.generator.Context.prototype.yieldAll=function(d,b){var f=$jscomp.makeIterator(d),g=f.next();$jscomp.generator.ensureIteratorResultIsObject_(g);if(g.done)this.yieldResult=g.value,this.nextAddress=b;else return this.yieldAllIterator_=f,this.yield(g.value,b)};
$jscomp.generator.Context.prototype.jumpTo=function(d){this.nextAddress=d};$jscomp.generator.Context.prototype.jumpToEnd=function(){this.nextAddress=0};$jscomp.generator.Context.prototype.setCatchFinallyBlocks=function(d,b){this.catchAddress_=d;void 0!=b&&(this.finallyAddress_=b)};$jscomp.generator.Context.prototype.setFinallyBlock=function(d){this.catchAddress_=0;this.finallyAddress_=d||0};$jscomp.generator.Context.prototype.leaveTryBlock=function(d,b){this.nextAddress=d;this.catchAddress_=b||0};
$jscomp.generator.Context.prototype.enterCatchBlock=function(d){this.catchAddress_=d||0;d=this.abruptCompletion_.exception;this.abruptCompletion_=null;return d};$jscomp.generator.Context.prototype.enterFinallyBlock=function(d,b,f){f?this.finallyContexts_[f]=this.abruptCompletion_:this.finallyContexts_=[this.abruptCompletion_];this.catchAddress_=d||0;this.finallyAddress_=b||0};
$jscomp.generator.Context.prototype.leaveFinallyBlock=function(d,b){var f=this.finallyContexts_.splice(b||0)[0];if(f=this.abruptCompletion_=this.abruptCompletion_||f){if(f.isException)return this.jumpToErrorHandler_();void 0!=f.jumpTo&&this.finallyAddress_<f.jumpTo?(this.nextAddress=f.jumpTo,this.abruptCompletion_=null):this.nextAddress=this.finallyAddress_}else this.nextAddress=d};$jscomp.generator.Context.prototype.forIn=function(d){return new $jscomp.generator.Context.PropertyIterator(d)};
$jscomp.generator.Context.PropertyIterator=function(d){this.object_=d;this.properties_=[];for(var b in d)this.properties_.push(b);this.properties_.reverse()};$jscomp.generator.Context.PropertyIterator.prototype.getNext=function(){for(;0<this.properties_.length;){var d=this.properties_.pop();if(d in this.object_)return d}return null};$jscomp.generator.Engine_=function(d){this.context_=new $jscomp.generator.Context;this.program_=d};
$jscomp.generator.Engine_.prototype.next_=function(d){this.context_.start_();if(this.context_.yieldAllIterator_)return this.yieldAllStep_(this.context_.yieldAllIterator_.next,d,this.context_.next_);this.context_.next_(d);return this.nextStep_()};
$jscomp.generator.Engine_.prototype.return_=function(d){this.context_.start_();var b=this.context_.yieldAllIterator_;if(b)return this.yieldAllStep_("return"in b?b["return"]:function(f){return{value:f,done:!0}},d,this.context_["return"]);this.context_["return"](d);return this.nextStep_()};
$jscomp.generator.Engine_.prototype.throw_=function(d){this.context_.start_();if(this.context_.yieldAllIterator_)return this.yieldAllStep_(this.context_.yieldAllIterator_["throw"],d,this.context_.next_);this.context_.throw_(d);return this.nextStep_()};
$jscomp.generator.Engine_.prototype.yieldAllStep_=function(d,b,f){try{var g=d.call(this.context_.yieldAllIterator_,b);$jscomp.generator.ensureIteratorResultIsObject_(g);if(!g.done)return this.context_.stop_(),g;var k=g.value}catch(n){return this.context_.yieldAllIterator_=null,this.context_.throw_(n),this.nextStep_()}this.context_.yieldAllIterator_=null;f.call(this.context_,k);return this.nextStep_()};
$jscomp.generator.Engine_.prototype.nextStep_=function(){for(;this.context_.nextAddress;)try{var d=this.program_(this.context_);if(d)return this.context_.stop_(),{value:d.value,done:!1}}catch(b){this.context_.yieldResult=void 0,this.context_.throw_(b)}this.context_.stop_();if(this.context_.abruptCompletion_){d=this.context_.abruptCompletion_;this.context_.abruptCompletion_=null;if(d.isException)throw d.exception;return{value:d["return"],done:!0}}return{value:void 0,done:!0}};
$jscomp.generator.Generator_=function(d){this.next=function(b){return d.next_(b)};this["throw"]=function(b){return d.throw_(b)};this["return"]=function(b){return d.return_(b)};this[Symbol.iterator]=function(){return this}};$jscomp.generator.createGenerator=function(d,b){var f=new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(b));$jscomp.setPrototypeOf&&d.prototype&&$jscomp.setPrototypeOf(f,d.prototype);return f};
$jscomp.asyncExecutePromiseGenerator=function(d){function b(g){return d.next(g)}function f(g){return d["throw"](g)}return new Promise(function(g,k){function n(l){l.done?g(l.value):Promise.resolve(l.value).then(b,f).then(n,k)}n(d.next())})};$jscomp.asyncExecutePromiseGeneratorFunction=function(d){return $jscomp.asyncExecutePromiseGenerator(d())};$jscomp.asyncExecutePromiseGeneratorProgram=function(d){return $jscomp.asyncExecutePromiseGenerator(new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(d)))};
(function(){var d=function(b,f){var g=document.createElement("script");g.type="text/javascript";g.readyState?g.onreadystatechange=function(){if("loaded"==g.readyState||"complete"==g.readyState)g.onreadystatechange=null,f()}:g.onload=function(){f()};g.src=b;document.getElementsByTagName("head")[0].appendChild(g)};timesactScript=function(b){var f,g,k,n,l,L,K,w,B,t,E,z,J,A;return $jscomp.asyncExecutePromiseGeneratorProgram(function(M){f=document.createElement("style");f.id="TimesactCSS";f.innerHTML=
'.timesact-badge-ribbon span::before {\n content: "";\n position: absolute; left: 0px; top: 100%;\n z-index: -1;\n border-left: 3px solid #888888;\n border-right: 3px solid transparent;\n border-bottom: 3px solid transparent;\n border-top: 3px solid #888888;\n }\n .timesact-badge-ribbon span::after {\n content: "";\n position: absolute; right: 0px; top: 100%;\n z-index: -1;\n border-left: 3px solid transparent;\n border-right: 3px solid #888888;\n border-bottom: 3px solid transparent;\n border-top: 3px solid #888888;\n }\n .md-modal {\n position: fixed;\n top: 50%;\n left: 50%;\n width: 40%;\n height: auto;\n z-index: 2000;\n visibility: hidden;\n transform: translateX(-50%) translateY(-50%);\n }\n .md-content {\n background: #fff;\n position: relative;\n border-radius: 10px;\n margin: 0 auto;\n }\n .md-show {\n visibility: visible;\n }\n .md-show ~ .md-overlay {\n opacity: 1;\n visibility: visible;\n display: block;\n }\n .popup-container {\n min-height: 100%;\n display: none;\n }\n .md-overlay {\n position: fixed;\n width: 100%;\n height: 100%;\n visibility: hidden;\n top: 0;\n left: 0;\n z-index: 1000;\n opacity: 0;\n background: #c9c9c9c2;\n -webkit-transition: all 0.3s;\n -moz-transition: all 0.3s;\n transition: all 0.3s;\n }\n .md-body {\n text-align: center;\n padding-top: 10%;\n padding-bottom: 10%;\n font-family: "Roboto";\n }\n p.message {\n padding: 20px;\n\n }\n .md-close {\n background: #f70427;\n border: none;\n color: white;\n padding: 10px;\n border-radius: 4px;\n cursor: pointer;\n }\n @media screen and (max-width: 32em) {\n .md-modal { width: 80%; }\n }\n ';
document.getElementsByTagName("head")[0].appendChild(f);document.getElementsByTagName("body")[0].insertAdjacentHTML("afterbegin",'<div class="md-modal" id="mixed-modal"><div class="md-content"><div class="md-body"></div></div></div><div class="popup-container"><div class="column"><button class="md-trigger md-setperspective" data-modal="mixed-modal"></button></div></div><div class="md-overlay"></div>');g=function(){};g.prototype.add=function(a,c,e){"RIBBON"==c?(b(a).remove(".timesact-badge-common"),
b(a).remove(".timesact-badge-ribbon"),b(a).append("<div class='timesact-badge-ribbon'><span class='timesact-badge-ribbon-span'>"+e+"</span></div>")):("ROUNDED"==c&&(b(a).remove(".timesact-badge-ribbon"),b(a).remove(".timesact-badge-common"),b(a).append("<div class='timesact-badge-common'><span class='timesact-badge-rounded-span'>"+e+"</span></div>")),"SQUARE"==c&&(b(a).remove(".timesact-badge-ribbon"),b(a).remove(".timesact-badge-common"),b(a).append("<div class='timesact-badge-common'><span class='timesact-badge-square-span'>"+
e+"</span></div>")),"CIRCLE"==c&&(b(a).remove(".timesact-badge-ribbon"),b(a).remove(".timesact-badge-common"),b(a).append("<div class='timesact-badge-common'><span class='timesact-badge-circle-span'>"+e+"</span></div>")))};g.prototype.applyStyles=function(a){b(".timesact-badge").css({position:"relative"});b(".timesact-badge-ribbon").css({position:"absolute",right:"-5px",top:"-5px","z-index":"1",overflow:"hidden",width:"75px",height:"75px","text-align":"right"});b(".timesact-badge-ribbon span").css({"font-size":a.fontSize,
"font-weight":"bold",color:a.fontColor,"text-transform":"uppercase","text-align":"center","line-height":"20px",transform:"rotate(45deg)","-webkit-transform":"rotate(45deg)",width:"100px",display:"block",position:"absolute",top:"19px",right:"-21px"});b(".timesact-badge-ribbon-span").css({"background-color":a.backgroundColor,"box-shadow":"0 3px 10px -5px rgba(0, 0, 0, 1)"});b(".timesact-badge-rounded-span").css({border:"1px solid transparent","border-radius":"4rem",display:"inline-block","letter-spacing":".1rem",
"line-height":"1",padding:"0.6rem 1.3rem","text-align":"center","background-color":a.backgroundColor,"border-color":a.backgroundColor,"font-size":a.fontSize,color:a.fontColor,"font-weight":"bold","word-break":"break-word"});b(".timesact-badge-square-span").css({border:"1px solid transparent",display:"inline-block","letter-spacing":".1rem","line-height":"1","text-align":"center","background-color":a.backgroundColor,"border-color":a.backgroundColor,"font-size":a.fontSize,color:a.fontColor,"font-weight":"bold",
"word-break":"break-word",height:"60px",width:"60px","padding-top":"15px"});b(".timesact-badge-circle-span").css({border:"1px solid transparent","border-radius":"50%",display:"inline-block","letter-spacing":".1rem","line-height":"1","text-align":"center","background-color":a.backgroundColor,"border-color":a.backgroundColor,"font-size":a.fontSize,color:a.fontColor,"font-weight":"bold","word-break":"break-word",height:"60px",width:"60px","padding-top":"15px"});b(".timesact-badge-common").css({top:"1rem",
display:"flex","flex-wrap":"wrap",right:"10px",position:"absolute","z-index":"1"})};k=function(){};k.prototype.display=function(a){b(".md-body").append("<h3>"+a.header+'</h3><p class="message">'+a.body+'</p><button class="md-close">'+a.button+'</button><p><input type="checkbox" id="md-stop" name="md-stop"><label for="md-stop">'+a.stop+"</label></p>");b("#mixed-modal").addClass("md-show");b(".md-close, .md-overlay").click(function(){window.localStorage.setItem("showCartMixedAlert",!b("#md-stop").is(":checked"));
b("#mixed-modal").removeClass("md-show")})};n=function(a,c){this.id=a;this.variants=c};n.prototype.setCurrentVariant=function(a){this.variantId=a};n.prototype.setPreorderVariants=function(a){a&&a.variants?this.preorderVariants=a.variants:console.log("[ERROR 2002]: Product config is undefined.")};n.prototype.isPreorderEnabledForVariant=function(){return this.preorderVariants[this.variantId]&&this.preorderVariants[this.variantId].config?"ACTIVE"===this.preorderVariants[this.variantId].config.status||
"NO_STOCK"===this.preorderVariants[this.variantId].config.status:!1};n.prototype.getVariantSettings=function(a){if(!this.hasCustomSettings())return{buttonName:a.button.name,cartLabelTextKey:a.cart.labelText.key,cartLabelTextValue:a.cart.labelText.value,messageType:a.message.type,messageValue:a.message.value,badge:a.badge};var c=this.preorderVariants[this.variantId].settings;return{buttonName:c.buttonName||a.button.name,cartLabelTextKey:c.cartLabelTextKey||a.cart.labelText.key,cartLabelTextValue:c.cartLabelTextValue||
a.cart.labelText.value,messageType:c.messageType||a.message.type,messageValue:c.messageValue||a.message.value,badge:a.badge}};n.prototype.hasCustomSettings=function(){return this.preorderVariants[this.variantId].settings?"CUSTOM"===this.preorderVariants[this.variantId].settings.type:!1};n.prototype.isVariantOutOfStock=function(){if(!this.preorderVariants[this.variantId])return!1;var a=this.preorderVariants[this.variantId];return 0<a.quantity?!1:"DENY"===a.inventoryPolicy?!0:!1};l=function(){};l.prototype.init=
function(){"undefined"==typeof window.ta&&(window.ta={},window.ta.shop={},window.ta.products=localStorage.getItem("products")?JSON.parse(localStorage.getItem("products")):{},window.ta.lastProductUpdate=this.computeLastUpdate(window.ta.products),window.ta.selectors={badge:[".timesact-badge",".product-item","li.grid__item",".ProductItem"]},window.ta.cart={},window.ta.cart.showMixedCartAlert=localStorage.getItem("showCartMixedAlert")?JSON.parse(localStorage.getItem("showCartMixedAlert")):!0,window.ta.quickView=
{},window.ta.quickView.selectors={},window.ta.quickView.selectors.button=".productitem--action-qs, .boost-pfs-quickview-btn, .cc-quick-buy-btn, .button--quick-shop, .sca-qv-button, .quick-view-btn, .bc-quickview-btn-wrapper, .sca-qv-cartbtn, .js-quick-shop-link, .searchit-quick-view-button, .quick-view, .js-quickbuy-button, .quick-product__btn, .product-card-interaction-quickshop, .product-modal, .productitem--action button, a.quickview, .overlay, a.quickview, .has-quick-view .btn .v-b, .shop-now-button, .quick-buy, .quick_shop, a[data-action='show-product'], .trigger-quick-view, .quickview-button, .quick_view, .qview-button, button.btn-addToCart:last, .quick-shop, .fancybox.ajax, .quick-add-button-variants, .product-thumbnail__quickshop-button, .js-quickView-button",
window.ta.quickView.selectors.form=".product__form:visible, #sca-qv-add-item-form:visible, .shopify-product-form:visible, .bc-modal-wrapper:visible #bc-quickview-cart-form:visible, .product_form:visible, .searchit-quick-view-form-wrapper form:visible, .product-form:visible, .quick-buy__product-form:visible, .product-single__form:visible, form[action='/cart/add']:visible, #AddToCartForm:visible, form.module:visible, #add-to-cart-quickview-form:visible",window.ta.quickView.selectors.addToCartButton=
".sca-qv-cartbtn:visible, #addToCart:visible, #bc-quickview-cart-btn:visible, .add_to_cart:visible, #searchit-quick-view-add-to-cart:visible, .product-form__cart-submit:visible, .quickbuy__submit:visible, .add-to-cart:visible, .product-submit:visible, .add:visible, .product-form--atc-button:visible, input.action-button.submit:visible, .addto.cart.sliding-cart:visible, #AddToCart:visible, .product-add:visible, .add-to-cart:visible, .product__submit__add:visible, .product-add-to-cart:visible, #add-to-cart:visible, .product-submit.action-button.product-submit, .product-form__add-button:visible, .add-to-cart-btn:visible, .qview-btn-addtocart:visible, button.btn-addToCart:last, .button--add-to-cart:visible",
window.ta.quickView.selectors.variant="#sca-qv-variant-options select.single-option-selector, .bc-quickview-single-option-selector, .searchit-option-selector-wrapper select, .qview-variants select, select:visible, .radio-wrapper fieldset, input[type='radio']",window.ta.quickView.selectors.quantity="[name='quantity']",window.ta.quickView.selectors.quickviewModalContainer=".theme-modal--quickbuy, .quickview-product .product-quickview:visible, .sca-fancybox-wrap:visible, .mfp-container:visible, .bc-modal-wrapper:visible, .quick-shop:visible, .searchit-modal:visible, #colorbox:visible, .modal--quick-shop:visible, .quickshop:visible, .fancybox-wrap:visible, .fancybox-container:visible, .modal-content:visible, .product-quick-view, section.quick-view, #ShopNowContainer, #ProductScreens, .product.preview, .modal__inner__wrapper:visible, .halo-modal-content:visible, #quickView:visible, .quickshop-content:visible, .modal__inner:visible, .quick-view .content:visible, .qview-product:visible")};
l.prototype.computeLastUpdate=function(a){var c=parseInt((new Date).getTime()/1E3);a=$jscomp.makeIterator(Object.values(a));for(var e=a.next();!e.done;e=a.next())e=e.value,e.lastUpdate&&e.lastUpdate<c?c=e.lastUpdate:e.lastUpdate||(c=1);return c};l.prototype.isProductPage=function(a){return"undefined"!=typeof a&&"undefined"!=typeof a.product?!0:-1<window.location.href.indexOf("/products/")};l.prototype.shouldEnable=function(){return this.isCollectionPage()||this.isHomePage()||this.isSearchPage()||
this.isPagesPage()};l.prototype.isCollectionPage=function(){return-1<window.location.href.indexOf("/collections/")};l.prototype.isSearchPage=function(){return-1<window.location.href.indexOf("/search?")};l.prototype.isPagesPage=function(){return-1<window.location.href.indexOf("/pages/")};l.prototype.isHomePage=function(){return"/"===document.location.pathname};l.prototype.isCartPage=function(){return-1<window.location.pathname.indexOf("/cart")};l.prototype.initQuickView=function(){this.createQuickViewButtonListener()};
l.prototype.createQuickViewButtonListener=function(){var a=this;b(window.ta.quickView.selectors.button).click(function(c){c=a.getProductHandle(c.currentTarget);c=a.getProductPageJsURL(c);var e;b.getJSON(c,function(h){e=new n(h.product.id,h.product.variants)}).done(function(){(new A(e)).run(!0)}).fail(function(){console.log("[Error 1001]: Product could not be fetched.")})})};l.prototype.getProductHandle=function(a){var c=b(a).attr("handle");void 0===c&&(c=b(a).data("handle"));void 0===c&&(c=b(a).data("product-id"));
void 0===c&&(c=b(a).data("href").split("_")[0]);return c};l.prototype.getProductPageJsURL=function(a){return"https://"+window.location.hostname+"/products/"+a};l.prototype.sleep=function(a){return new Promise(function(c){setTimeout(c,a)})};l.prototype.cleanupModal=function(){b(window.ta.quickView.selectors.quickviewModalContainer).find("#preorder-label").remove();b(window.ta.quickView.selectors.quickviewModalContainer).find(".timesact-preorder-description").remove()};L=function(a){this.button=a.button;
this.cart=a.cart;this.message=a.message;this.badge=a.badge};K=function(){};K.prototype.extractVariantId=function(a,c){var e=window.location.search.match(/variant=([0-9]+)/);if(null!=e)return e[1];var h="radio"===b(c).find("select[name='id'], input[name='id'], select[name='id[]'], input[name='id[]']").attr("type")?b(c).find("input[name='id']:checked, input[name='id[]']:checked").val():b(c).find("select[name='id'], input[name='id'], select[name='id[]'], input[name='id[]']").val();return a.some(function(m){return m.id.toString()==
h})?h:a[0].id};w=function(a,c){this.buttonSelector=a;this.addToCartText=c.addToCartText||b(this.buttonSelector).text();this.preorderText=c.name;this.soldOutText=c.soldOutText;this.style=c.style;this.type=c.type;this.buttonTextSelector="[data-add-to-cart-text], #AddToCartText, .btn__text, #AddToCartText-product-template, #addToCartText-product-template, [data-cart-primary-submit-text], [data-cart-secondary-submit-text], .btn__text, .product-form--text, .txt_pre, .txt_add, span:first";"CUSTOM"===this.type&&
this.createTimesactButton()};w.prototype.createTimesactButton=function(){this.timesactButton=b(this.buttonSelector).first().clone();this.hasInsideSpan=!1;"span"==this.timesactButton.prop("tagName").toLowerCase()&&(this.timesactButton=b(this.buttonSelector).parent().clone(),this.hasInsideSpan=!0);this.timesactButton.addClass("timesact-button");this.timesactButton.prop("disabled",!1);this.hideTimesactButton();this.hasInsideSpan?(this.timesactButton.find(this.buttonTextSelector).val(this.preorderText),
this.timesactButton.find(this.buttonTextSelector).text(this.preorderText),b(this.buttonSelector).first().parent().after(this.timesactButton)):(this.timesactButton.val(this.preorderText),this.timesactButton.text(this.preorderText),b(this.buttonSelector).first().after(this.timesactButton))};w.prototype.showPreorderButton=function(){"DEFAULT"==this.type?(b(this.buttonSelector).val(this.preorderText),b(this.buttonSelector).text(this.preorderText),b(this.buttonSelector).prop("disabled",!1)):(b(this.timesactButton).show(),
this.timesactButton.prop("disabled",!1),this.hasInsideSpan?b(this.buttonSelector).parent().attr("style","display: none !important;"):b(this.buttonSelector).attr("style","display: none !important;"))};w.prototype.showAddToCartButton=function(){b(this.buttonSelector).val(this.addToCartText);b(this.buttonSelector).text(this.addToCartText);b(this.buttonSelector).prop("disabled",!1);"DEFAULT"!=this.type&&(this.hideTimesactButton(),this.hasInsideSpan?b(this.buttonSelector).parent().show():b(this.buttonSelector).show())};
w.prototype.showOutOfStockButton=function(){b(this.buttonSelector).val(this.soldOutText);b(this.buttonSelector).text(this.soldOutText);b(this.buttonSelector).prop("disabled",!0);"DEFAULT"!=this.type&&(this.hideTimesactButton(),this.hasInsideSpan?b(this.buttonSelector).parent().show():b(this.buttonSelector).show())};w.prototype.confirmButtonExists=function(){return 0<b(this.buttonSelector).closest("body").length};w.prototype.identifyButton=function(a){this.buttonSelector=a.formSelector.find(a.ids.addToCartButton)};
w.prototype.setPreorderText=function(a){this.preorderText=a};w.prototype.hideTimesactButton=function(){this.timesactButton.attr("style","display: none !important;\n width: "+this.style.width+";\n height: "+this.style.height+";\n background-color: "+this.style.backgroundColor+";\n border: "+this.style.borderWidth+" "+this.style.borderColor+" outset;\n border-color: "+this.style.borderColor+";\n border-radius: "+
this.style.borderRadius+";\n border-width: "+this.style.borderWidth+";\n color: "+this.style.fontColor+";\n font-size: "+this.style.fontSize+";")};B=function(a){this.locale=a};B.prototype.addStylePreorderMessage=function(a){b(".timesact-preorder-description").css({"font-size":a.fontSize,color:a.fontColor})};B.prototype.populateDynamicValues=function(a,c,e){c=c.replace("{{preorderQuantity}}",this.getQuantity(a,e));c=c.replace("{{shippingDate}}",
this.getShippingDate(a.config.shippingDate,e));c=c.replace("{{daysLeftUntilShippingDate}}",this.getDaysLeftUntilShippingDate(a.config.shippingDate,e));return c=c.replace("{{daysLeftUntilPreorderEndDate}}",this.getDaysLeftUntilEndDate(a.config,e))};B.prototype.getQuantity=function(a,c){return"STOCK3"==a.config.stock.option?a.quantity:a.config.stock.hasUnlimitedQuantity?c?"VARIABLE_NOT_SET":'<span style="color:red;">VARIABLE_NOT_SET</span>':a.config.stock.quantity};B.prototype.getShippingDate=function(a,
c){if(!a||"NO_SET"==a.type)return c?"VARIABLE_NOT_SET":'<span style="color:red;">VARIABLE_NOT_SET</span>';if("DATE"==a.type)return(new Date(1E3*a.date)).toLocaleDateString(this.locale,{day:"numeric",month:"long",year:"numeric"});if("PERIOD"==a.type){var e=1;switch(a.periodType){case "DAY":e=a.periodValue;break;case "WEEK":e=7*a.periodValue;break;case "MONTH":e=30*a.periodValue}var h=new Date;h.setDate(h.getDate()+e);return h.toLocaleDateString(this.locale,{day:"numeric",month:"long",year:"numeric"})}};
B.prototype.getDaysLeftUntilShippingDate=function(a,c){if(!a||"NO_SET"==a.type)return c?"VARIABLE_NOT_SET":'<span style="color:red;">VARIABLE_NOT_SET</span>';var e=new Date;if("DATE"==a.type)return Math.ceil(((new Date(1E3*a.date)).getTime()-e.getTime())/864E5);if("PERIOD"==a.type)switch(a.periodType){case "DAY":return a.periodValue;case "WEEK":return 7*a.periodValue;case "MONTH":return 30*a.periodValue;default:return 1}};B.prototype.getDaysLeftUntilEndDate=function(a,c){if(!a.hasEndDate)return c?
"VARIABLE_NOT_SET":'<span style="color:red;">VARIABLE_NOT_SET</span>';var e=new Date;return Math.ceil(((new Date(1E3*a.endDate)).getTime()-e.getTime())/864E5)};t=function(a,c,e){this.selectors=a;this.product=c;this.globalSettings=e;this.button=new w(this.selectors.buttonSelector,this.globalSettings.button);this.uuid=Math.floor(1E8+9E8*Math.random());b(this.selectors.variantSelector).addClass("timesact-variant-picker-"+this.uuid)};t.prototype.init=function(){this.createWidget();(new E).initVariantEventListener(this)};
t.prototype.createWidget=function(){if(this.product.isPreorderEnabledForVariant()){var a=this.product.preorderVariants[this.product.variantId];if("NO_STOCK"===a.config.status)this.button.showOutOfStockButton(),b(this.selectors.formSelector).find(".shopify-payment-button").hide();else{var c=this.product.getVariantSettings(this.globalSettings);this.button.setPreorderText(c.buttonName);this.button.confirmButtonExists()||(this.button.identifyButton(this.selectors),this.selectors.buttonSelector=b(this.selectors.formSelector).find(this.selectors.ids.addToCartButton));
this.button.showPreorderButton();b(this.selectors.formSelector).find(".shopify-payment-button").hide();var e=new B(this.globalSettings.message.locale||"en-US");if(""!=c.messageValue){var h=e.populateDynamicValues(a,c.messageValue,!1);this.showPreorderMessage(c.messageType,h);e.addStylePreorderMessage(this.globalSettings.message)}h=e.populateDynamicValues(a,c.cartLabelTextKey,!0);e=e.populateDynamicValues(a,c.cartLabelTextValue,!0);this.showPreorderLineItemProperty(h,e);a.config.stock.hasUnlimitedQuantity||
this.addQuantityListener(a.config.stock.quantity);c.badge.product&&(a=new g,a.add(this.selectors.badgeSelector,c.badge.type,c.badge.value),a.applyStyles(c.badge));this.selectors.hideProductElements&&b(this.selectors.hideProductElements).hide()}}};t.prototype.resetDefault=function(){this.button.confirmButtonExists()||(this.button.identifyButton(this.selectors),this.selectors.buttonSelector=b(this.selectors.formSelector).find(this.selectors.ids.addToCartButton));this.product.isVariantOutOfStock()?(this.button.showOutOfStockButton(),
b(this.selectors.formSelector).find(".shopify-payment-button").hide()):(this.button.showAddToCartButton(),b(this.selectors.formSelector).find(".shopify-payment-button").show());this.removePreorderLineItemProperty();this.removePreorderMessage();this.removePreorderBadge();this.removePreorderQuantity();this.selectors.hideProductElements&&this.addHiddenElements()};t.prototype.showPreorderLineItemProperty=function(a,c){0===b(this.selectors.formSelector).find("#preorder-label").length?b(this.selectors.formSelector).append('<input type="hidden" id="preorder-label" name="properties['+
a+']" value="'+c+'" />'):b(this.selectors.formSelector).find("#preorder-label").val(c)};t.prototype.removePreorderLineItemProperty=function(){b(this.selectors.formSelector).find("#preorder-label").remove()};t.prototype.removePreorderBadge=function(){b(".timesact-badge-ribbon").remove();b(".timesact-badge-common").remove()};t.prototype.showPreorderMessage=function(a,c){this.selectors.messageSelector?0===b(this.selectors.formSelector).find(".timesact-preorder-description").length?"BELOW"===a?b(this.selectors.messageSelector).after("<div class='timesact-preorder-description'>"+
c+"</div>"):b(this.selectors.messageSelector).before("<div class='timesact-preorder-description'>"+c+"</div>"):b(this.selectors.formSelector).find(".timesact-preorder-description").val(c):0===b(this.selectors.formSelector).find(".timesact-preorder-description").length?"BELOW"===a?b(this.selectors.buttonSelector).after("<div class='timesact-preorder-description'>"+c+"</div>"):b(this.selectors.buttonSelector).before("<div class='timesact-preorder-description'>"+c+"</div>"):b(this.selectors.formSelector).find(".timesact-preorder-description").val(c)};
t.prototype.removePreorderMessage=function(){b(this.selectors.formSelector).find(".timesact-preorder-description").remove()};t.prototype.removePreorderQuantity=function(){b(".timesact-quantity-message").remove();b(this.selectors.quantitySelector).off("change.quantityChange");b(this.selectors.buttonSelector).off("click.quantityButtonClick")};t.prototype.addHiddenElements=function(){b(this.selectors.hideProductElements).show()};t.prototype.addQuantityListener=function(a){var c=this.selectors;b(this.selectors.quantitySelector).on("change.quantityChange",
function(){a<parseInt(b(this).val())?(b(".timesact-quantity-message").length||(c.messageSelector?b(c.messageSelector).before("<div class='timesact-quantity-message' style='color:red'>You can only pre-order "+(a+" items!</div>")):b(c.buttonSelector).before("<div class='timesact-quantity-message' style='color:red'>You can only pre-order "+(a+" items!</div>"))),b(c.buttonSelector).prop("disabled",!0)):(b(".timesact-quantity-message").remove(),b(c.buttonSelector).prop("disabled",!1))});b(this.selectors.buttonSelector).on("click.quantityButtonClick",
function(e){var h=b(c.quantitySelector).val();a<parseInt(h)?(e.preventDefault(),b(".timesact-quantity-message").length||(c.messageSelector?b(c.messageSelector).before("<div class='timesact-quantity-message' style='color:red'>You can only pre-order "+(a+" items!</div>")):b(c.buttonSelector).before("<div class='timesact-quantity-message' style='color:red'>You can only pre-order "+(a+" items!</div>")))):b(".timesact-quantity-message").remove()})};E=function(){};E.prototype.initVariantEventListener=function(a){var c=
this;b(document).on("change",".timesact-variant-picker-"+a.uuid,function(e){c.variantChangeHandler(a)});c.setup(function(){c.variantChangeHandler(a)})};E.prototype.sleep=function(a){return new Promise(function(c){setTimeout(c,a)})};E.prototype.variantChangeHandler=function(a){this.sleep(a.selectors.variantChangingTime).then(function(){var c=window.location.search.replace(/.*variant=(\d+).*/,"$1");c||(c="radio"===b(a.selectors.formSelector).find("select[name='id'], input[name='id'], select[name='id[]'], input[name='id[]']").attr("type")?
b(a.selectors.formSelector).find("input[name='id']:checked, input[name='id[]']:checked").val():b(a.selectors.formSelector).find("select[name='id'], input[name='id'], select[name='id[]'], input[name='id[]']").val());a.product.setCurrentVariant(c);a.resetDefault();a.createWidget()})};E.prototype.track=function(a,c,e){return function(){if(e)return c.apply(this,arguments),a.apply(this,arguments);var h=a.apply(this,arguments);return c.apply(this,arguments),h}};E.prototype.setup=function(a){history.pushState=
this.track(history.pushState,a);history.replaceState=this.track(history.replaceState,a);window.addEventListener("popstate",a)};z=function(){};z.prototype.getProductPreOrderConfig=function(a){return $jscomp.asyncExecutePromiseGeneratorProgram(function(c){if(1==c.nextAddress)return c.setCatchFinallyBlocks(2),c.yield(b.ajax({url:"/apps/timesact/config?productId="+a,type:"GET",contentType:"application/json; charset=utf-8",dataType:"json"}),4);if(2!=c.nextAddress)return c["return"](c.yieldResult);c.enterCatchBlock();
console.log("Product is not active on pre-order.");return c["return"](null)})};z.prototype.getProducts=function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(a){if(1==a.nextAddress)return a.setCatchFinallyBlocks(2),a.yield(b.ajax({url:"/apps/timesact/products",type:"GET",contentType:"application/json; charset=utf-8",dataType:"json"}),4);if(2!=a.nextAddress)return a["return"](a.yieldResult);a.enterCatchBlock();console.log("Products config couldn't be fetched.");return a["return"](null)})};
z.prototype.getShop=function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(a){if(1==a.nextAddress)return a.setCatchFinallyBlocks(2),a.yield(b.ajax({url:"/apps/timesact/shop",type:"GET",contentType:"application/json; charset=utf-8",dataType:"json"}),4);if(2!=a.nextAddress)return a["return"](a.yieldResult);a.enterCatchBlock();console.log("Shop data couldn't be fetched.");return a["return"](null)})};J=function(a){this.ids=a};J.prototype.setNormalSelectors=function(){this.formSelector=
b(this.ids.form);this.buttonSelector=this.formSelector.find(this.ids.addToCartButton);0==this.buttonSelector.length&&(this.buttonSelector=this.formSelector.find('[type="submit"]:visible:first, [name="add"], .product-submit, .addtocart-button-active, .product-form--add-to-cart, .button--addToCart, .product-form__submit, .add-to-cart, .btn-addtocart, .single_add_to_cart_button, .product-form__cart-submit, .product-form--atc-button, .ProductForm__AddToCart, [type="button"]:visible:first').first());this.variantSelector=
this.formSelector.find(this.ids.variant);this.ids.quantity?this.quantitySelector=this.formSelector.find(this.ids.quantity):(this.quantitySelector=this.formSelector.find('[name="quantity"]'),0==this.quantitySelector.length&&(this.quantitySelector=b('[name="quantity"]')));this.badgeSelector=this.ids.badge?b(this.ids.badge):b(".timesact-badge");this.ids.message&&(this.messageSelector=this.formSelector.find(this.ids.message));this.ids.hide&&this.ids.hide.product&&(this.hideProductElements=this.ids.hide.product);
this.variantChangingTime=this.ids.variantChangingTime||250};J.prototype.setQuickViewSelectors=function(){this.formSelector=b(window.ta.quickView.selectors.quickviewModalContainer).find(window.ta.quickView.selectors.form);this.buttonSelector=b(window.ta.quickView.selectors.quickviewModalContainer).find(window.ta.quickView.selectors.addToCartButton);this.variantSelector=b(window.ta.quickView.selectors.quickviewModalContainer).find(window.ta.quickView.selectors.variant);this.quantitySelector=b(window.ta.quickView.selectors.quickviewModalContainer).find(window.ta.quickView.selectors.quantity);
this.ids.message&&(this.messageSelector=this.formSelector.find(this.ids.message));this.variantChangingTime=this.ids.variantChangingTime||250;this.badgeSelector=this.ids.badge?b(this.ids.badge):b(".timesact-badge")};A=function(a){this.product=a;this.productUtil=new K};A.prototype.run=function(a){var c=this,e,h;return $jscomp.asyncExecutePromiseGeneratorProgram(function(m){if(1==m.nextAddress)return m.yield((new z).getProductPreOrderConfig(c.product.id),2);e=m.yieldResult;if(!e)return window.ta.products[c.product.id]=
{isPreorder:!1,lastUpdate:parseInt((new Date).getTime()/1E3)},localStorage.setItem("products",JSON.stringify(window.ta.products)),m["return"]();c.globalSettings=new L(e.settings);c.selectors=new J(e.selectors);a?c.selectors.setQuickViewSelectors():c.selectors.setNormalSelectors();c.product.setCurrentVariant(c.productUtil.extractVariantId(c.product.variants,c.selectors.formSelector));c.product.setPreorderVariants(e.product);h=new t(c.selectors,c.product,c.globalSettings);h.init();window.ta.products[c.product.id]=
{isPreorder:c.isActiveOnPreorder(e.product.variants),settings:e.settings,variants:e.product.variants,lastUpdate:parseInt((new Date).getTime()/1E3)};localStorage.setItem("products",JSON.stringify(window.ta.products));m.jumpToEnd()})};A.prototype.runCollection=function(){var a,c,e,h;return $jscomp.asyncExecutePromiseGeneratorProgram(function(m){if(1==m.nextAddress)return m.yield((new z).getShop(),2);a=m.yieldResult;if(!a)return m["return"]();if(a.settings.badge.collection){a.lastProductUpdate&&window.ta.lastProductUpdate<
a.lastProductUpdate&&(window.ta.products={});c=window.ta.selectors.badge;a.selectors.collection&&a.selectors.collection.badge&&(c=[a.selectors.collection.badge]);e=[];for(h=0;h<c.length;h++)if(0<b(c[h]).length){e=b(c[h]);b(c[h]).css({position:"relative"});break}if(0==e.length)return console.log("No items detected."),m["return"]();Array.from(e).forEach(function(u,G){var C,p;return $jscomp.asyncExecutePromiseGeneratorProgram(function(H){C=b(u).find("a").attr("href");p=C.split("/").pop().split("?")[0];
console.log("handle",p,G);b.getJSON(window.location.origin+C,function(I){var x,v,q,D,F;return $jscomp.asyncExecutePromiseGeneratorProgram(function(y){if(1==y.nextAddress)return x=new g,v=String(I.product.id),window.ta.products[v]?(window.ta.products[v].isPreorder&&(x.add(u,a.settings.badge.type,a.settings.badge.value),x.applyStyles(a.settings.badge),a.selectors.hide&&a.selectors.hide.collection&&b(u).find(a.selectors.hide.collection).hide()),y["return"]()):y.yield((new z).getProductPreOrderConfig(v),
2);q=y.yieldResult;if(!q)return window.ta.products[v]={isPreorder:!1,lastUpdate:parseInt((new Date).getTime()/1E3)},localStorage.setItem("products",JSON.stringify(window.ta.products)),y["return"]();D=!0;for(F in q.product.variants)if("ACTIVE"!=q.product.variants[F].config.status){D=!1;break}D&&(x.add(u,a.settings.badge.type,a.settings.badge.value),x.applyStyles(a.settings.badge),a.selectors.hide&&a.selectors.hide.collection&&b(u).find(a.selectors.hide.collection).hide());window.ta.products[v]={isPreorder:D,
settings:q.settings,variants:q.product.variants,lastUpdate:parseInt((new Date).getTime()/1E3)};localStorage.setItem("products",JSON.stringify(window.ta.products));y.jumpToEnd()})}).fail(function(){console.log("[Error 1002]: Product on collection could not be fetched.")});H.jumpToEnd()})})}m.jumpToEnd()})};A.prototype.runMixedCartAlert=function(a){var c=this,e,h,m,u,G,C,p,H,I,x,v,q,D,F,y;return $jscomp.asyncExecutePromiseGeneratorProgram(function(r){switch(r.nextAddress){case 1:return window.ta.cart.showMixedCartAlert&&
a.items.length?r.yield((new z).getShop(),2):r["return"]();case 2:e=r.yieldResult;if(!e||!e.settings.cart.mixed.isEnabled)return r["return"]();m=h=!1;u={};G=$jscomp.makeIterator(a.items);for(C=G.next();!C.done;C=G.next())p=C.value,window.ta.products[p.product_id]?window.ta.products[p.product_id].variants&&window.ta.products[p.product_id].variants[p.variant_id]&&"ACTIVE"==window.ta.products[p.product_id].variants[p.variant_id].config.status?h=!0:m=!0:(u[p.product_id]=u[p.product_id]||[],u[p.product_id].push(p.variant_id));
H=new k;if(h&&m)return H.display(e.settings.cart.mixed),r["return"]();if(!Object.keys(u).length)return r["return"]();I=$jscomp.makeIterator(Object.keys(u));x=I.next();case 3:if(x.done){r.jumpTo(5);break}v=x.value;return r.yield((new z).getProductPreOrderConfig(v),6);case 6:q=r.yieldResult;if(!q){m=!0;window.ta.products[v]={isPreorder:!1,lastUpdate:parseInt((new Date).getTime()/1E3)};r.jumpTo(4);break}D=$jscomp.makeIterator(u[v]);for(F=D.next();!F.done;F=D.next())y=F.value,q.product.variants[y]&&"ACTIVE"==
q.product.variants[y].config.status?h=!0:m=!0;window.ta.products[v]={isPreorder:c.isActiveOnPreorder(q.product.variants),settings:q.settings,variants:q.product.variants,lastUpdate:parseInt((new Date).getTime()/1E3)};if(m&&h){H.display(e.settings.cart.mixed);r.jumpTo(5);break}case 4:x=I.next();r.jumpTo(3);break;case 5:localStorage.setItem("products",JSON.stringify(window.ta.products)),r.jumpToEnd()}})};A.prototype.isActiveOnPreorder=function(a){for(var c in a)if("ACTIVE"!=a[c].config.status)return!1;
return!0};b(document).ready(function(){var a=new l;a.init();if("undefined"!==typeof meta&&a.isProductPage(meta)){var c;b.getJSON(window.location.href,function(e){c=new n(e.product.id,e.product.variants)}).done(function(){(new A(c)).run(!1)}).fail(function(){console.log("[Error 1001]: Product could not be fetched.")})}if(a.isCollectionPage()||a.isHomePage()||a.isSearchPage()||a.isPagesPage())a.initQuickView(),(new A(a)).runCollection();a.isCartPage()&&b.getJSON(window.location.href,function(e){(new A(a)).runMixedCartAlert(e)}).fail(function(){console.log("[Error 1001]: Product could not be fetched.")})});
M.jumpToEnd()})};"undefined"===typeof jQuery||2.1>parseFloat(jQuery.fn.jquery)?d("https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js",function(){jQuery191=jQuery.noConflict(!0);timesactScript(jQuery191)}):timesactScript(jQuery)})();