PageSourceSearch

https://rowanrookanddecard.com/wp-content/themes/rowanrookanddecard/dist/js/miniCart.js?ver=1787136194

js rowanrookanddecard.com collected 2026-10-03 23:06:32 UTC 51,824 bytes, 1 lines download raw bytes

1!function r(o,i,a){function c(e,t){if(!i[e]){if(!o[e]){var n="function"==typeof require&&require;if(!t&&n)return n(e,!0);if(u)return u(e,!0);throw(t=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",t}n=i[e]={exports:{}},o[e][0].call(n.exports,function(t){return c(o[e][1][t]||t)},n,n.exports,r,o,i,a)}return i[e].exports}for(var u="function"==typeof require&&require,t=0;t<a.length;t++)c(a[t]);return c}({1:[function(t,e,n){function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(t=>(t=((t,e)=>{if("object"!=o(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);if("object"!=o(n=n.call(t,e||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(t,"string"),"symbol"==o(t)?t:t+""))(r.key),r)}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=(()=>{function i(t,e,n,r){var o=this;if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");this.data={id:t,styles:e,element:null,shown:!1,onClick:n},this.attachTo=document.querySelector(r),this.attachTo||(this.attachTo=document.body),this.add(),jQuery(document.body).on("click","#mask-".concat(this.data.id),function(){o.click()})}return t=i,(e=[{key:"add",value:function(){this.attachTo.insertAdjacentHTML("beforeend",'<div id="mask-'.concat(this.data.id,'"></div>')),this.data.element=document.getElementById("mask-".concat(this.data.id)),this.data.element.style.position="fixed",this.data.element.style.top=0,this.data.element.style.left=0,this.data.element.style.right=0,this.data.element.style.bottom=0,this.data.element.style.display="none",this.data.element.style.opacity="0";for(var t=0,e=Object.keys(this.data.styles);t<e.length;t++){var n=e[t];this.data.element.style[n]=this.data.styles[n]}}},{key:"show",value:function(t){var e=this;gsap.to(this.data.element,{opacity:1,duration:.3,onStart:function(){e.data.element.style.display="block"},onComplete:function(){e.data.shown=!0,t&&t()}})}},{key:"hide",value:function(t){var e=this;gsap.to(this.data.element,{opacity:0,display:"none",duration:.3,onComplete:function(){e.data.shown=!0,t&&t()}})}},{key:"click",value:function(){this.data.shown&&this.data.onClick&&this.data.onClick()}}])&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n})()},{}],2:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.block=r,n.toggleBlock=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";"blocked"===t.dataset.hpyBlock?i(t):r(t,e)},n.unblock=i;var o=t("./helper");function r(t,e){var n,r;void 0===t||"blocked"===t.dataset.hpyBlock||"blocking"===t.dataset.hpyBlock||(void 0===e&&(e={}),n=document.createElement("div"),e=(0,o.mergeObject)(e,{color:"#FFFFFF",opacity:"0.8",cursor:"",zIndex:"",pointerEvents:"",HTML:""}),n.style.backgroundColor=e.color,n.classList.add("hpyBlock"),n.innerHTML=e.HTML,"absolute"!=t.style.position&&(t.style.position="relative"),"auto"===window.getComputedStyle(t).getPropertyValue("z-index")&&(t.style.zIndex="1"),t.appendChild(n),t.dataset.hpyBlock="blocking",r=window.getComputedStyle(n),r=1e3*parseFloat(r.transitionDuration),isNaN(r))||(n.dataset.blockTransition=r,n.style.opacity=e.opacity,n.style.cursor=e.cursor,n.style.zIndex=e.zIndex,t.style.pointerEvents=e.pointerEvents,setTimeout(function(){t.dataset.hpyBlock="blocked"},r))}function i(t){if(t&&-1!==["blocking","blocked"].indexOf(t.dataset.hpyBlock)){for(var e,n=t.children,r=0;r<n.length;r+=1)if("hpyBlock"===n[r].className){e=n[r];break}e.style.opacity=0,t.dataset.hpyBlock="blocking",setTimeout(function(){t.dataset.hpyBlock="",t.removeChild(e),t.style.pointerEvents=""},e.dataset.blockTransition)}}},{"./helper":3}],3:[function(t,e,n){function u(){var p,t="function"==typeof Symbol?Symbol:{},e=t.iterator||"@@iterator",n=t.toStringTag||"@@toStringTag";function r(t,e,n,r){var o,i,a,c,u,s,l,d,f,e=e&&e.prototype instanceof y?e:y,e=Object.create(e.prototype);return b(e,"_invoke",(o=t,i=n,l=r||[],d=!1,f={p:s=0,n:0,v:p,a:h,f:h.bind(p,4),d:function(t,e){return a=t,c=0,u=p,f.n=e,m}},function(t,e,n){if(1<s)throw TypeError("Generator is already running");for(d&&1===e&&h(e,n),c=e,u=n;(v=c<2?p:u)||!d;){a||(c?c<3?(1<c&&(f.n=-1),h(c,u)):f.n=u:f.v=u);try{if(s=2,a){if(v=a[t=c?t:"next"]){if(!(v=v.call(a,u)))throw TypeError("iterator result is not an object");
1if(!v.done)return v;u=v.value,c<2&&(c=0)}else 1===c&&(v=a.return)&&v.call(a),c<2&&(u=TypeError("The iterator does not provide a '"+t+"' method"),c=1);a=p}else if((v=(d=f.n<0)?u:o.call(i,f))!==m)break}catch(t){a=p,c=1,u=t}finally{s=1}}return{value:v,done:d}}),!0),e;function h(t,e){for(c=t,u=e,v=0;!d&&s&&!n&&v<l.length;v++){var n,r=l[v],o=f.p,i=r[2];3<t?(n=i===e)&&(u=r[(c=r[4])?5:c=3],r[4]=r[5]=p):r[0]<=o&&((n=t<2&&o<r[1])?(c=0,f.v=e,f.n=r[1]):o<i&&(n=t<3||r[0]>e||i<e)&&(r[4]=t,r[5]=e,f.n=i,c=0))}if(n||1<t)return m;throw d=!0,e}}var m={};function y(){}function o(){}function i(){}var v=Object.getPrototypeOf,t=[][e]?v(v([][e]())):(b(v={},e,function(){return this}),v),a=i.prototype=y.prototype=Object.create(t);function c(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,i):(t.__proto__=i,b(t,n,"GeneratorFunction")),t.prototype=Object.create(a),t}return b(a,"constructor",o.prototype=i),b(i,"constructor",o),b(i,n,o.displayName="GeneratorFunction"),b(a),b(a,n,"Generator"),b(a,e,function(){return this}),b(a,"toString",function(){return"[object Generator]"}),(u=function(){return{w:r,m:c}})()}function b(t,e,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}(b=function(t,e,n,r){function o(e,n){b(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(o("next",0),o("throw",1),o("return",2))})(t,e,n,r)}function s(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function a(t){return(new DOMParser).parseFromString(t,"text/html").body.childNodes[0]}Object.defineProperty(n,"__esModule",{value:!0}),n._debounce=function(n,r){var o;return function(){var t=arguments,e=this;clearTimeout(o),o=setTimeout(function(){return n.apply(e,t)},r)}},n._throttle=function(t,e){var n=!1;return function(){n||(t.call(),n=!0,setTimeout(function(){n=!1},e))}},n.attachEventToBody=function(o,i){var a=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"";document.getElementsByTagName("body")[0].addEventListener("click",function(t){var e,n=((t,e)=>{var n,r,o,i,a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(a)return o=!(r=!0),{s:function(){a=a.call(t)},n:function(){var t=a.next();return r=t.done,t},e:function(t){o=!0,n=t},f:function(){try{r||null==a.return||a.return()}finally{if(o)throw n}}};if(Array.isArray(t)||(a=((t,e)=>{var n;if(t)return"string"==typeof t?c(t,e):"Map"===(n="Object"===(n={}.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0})(t))||e&&t&&"number"==typeof t.length)return a&&(t=a),i=0,{s:e=function(){},n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})(document.querySelectorAll(o));try{for(n.s();!(e=n.n()).done;){var r=e.value;r.contains(t.target)&&i(r,a)}}catch(t){n.e(t)}finally{n.f()}})},n.copyToClipboard=function(){$(document.body).on("click",".copy-to-clipboard",(()=>{c=u().m(function t(e){var n,r,o,i;return u().w(function(t){for(;;)switch(t.p=t.n){case 0:if(e.preventDefault(),"true"===(n=this).dataset.copying)return t.a(2);t.n=1;break;case 1:if(n.dataset.copying=!0,r=a('<span style="\n\t\t\t\tpadding:10px;\n\t\t\t\tborder-radius:10px;\n\t\t\t\tposition:absolute;\n\t\t\t\tinset: 0px;\n\t\t\t\topacity:1;\n\t\t\t\tz-inder:10;\n\t\t\t">\n\t\t\t\t<span style="\n\t\t\t\t\tpadding: 10px;\n\t\t\t\t\tborder: 2px dashed;\n\t\t\t\t\tborder-radius: 6px;\n\t\t\t\t\ttext-transform: uppercase;\n\t\t\t\t\tletter-spacing: 0.05em;\n\t\t\t\t\theight: 100%;\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\talign-items: center;\n\t\t\t\t\tjustify-content: center;\n\t\t\t\t\tfont-size: inherit;\n\t\t\t\t"></span>\n\t\t\t</span>'),t.p=2,navigator.clipboard){t.n=3;break}throw"failed";case 3:return o=n.textContent.replace(/(\r\n|\n|\r|\t)/gm,""),t.n=4,navigator.clipboard.writeText(o);case 4:r.style.background="#77a464",r.children[0].style.borderColor="#396826",r.children[0].style.color="#396826",r.children[0].textContent="copied",t.n=6;break;case 5:t.p=5,r.style.background="#a94442",r.children[0].style.borderColor="#621f1d",r.children[0].style.color="#621f1d",r.children[0].textContent="Failed to copy";case 6:return t.p=6,i=n.style.position,n.style.position="relative",n.appendChild(r),setTimeout(function(){r.style.transition="opacity 0.3s",r.style.opacity="0",setTimeout(function(){n.style.position=i,r.remove(),n.dataset.copying=!1},300)},2e3),t.f(6);case 7:return t.a(2)}},t,this,[[2,5,6,7]])});var c,e=function(){var t=this,a=arguments;return new Promise(function(e,n){var r=c.apply(t,a);function o(t){s(r,e,n,o,i,"next",t)}function i(t){s(r,e,n,o,i,"throw",t)}o(void 0)})};return function(t){return e.apply(this,arguments)}})())},n.createElementFromString=a,n.disableScroll=function(){var t=window.pageYOffset||document.documentElement.scrollTop,e=window.pageXOffset||document.documentElement.scrollLeft;window.onscroll=function(){window.scrollTo(e,t)}},n.enableScroll=function(){window.onscroll=function(){}},n.getScrollbarWidth=function(){var t=document.createElement("div"),e=(t.style.visibility="hidden",t.style.width="100px",t.style.msOverflowStyle="scrollbar",document.body.appendChild(t),t.offsetWidth),n=(t.style.overflow="scroll",document.createElement("div")),n=(n.style.width="100%",t.appendChild(n),n.offsetWidth);return t.parentNode.removeChild(t),e-n}
1,n.getViewportHeight=function(){return Math.max(document.documentElement.clientHeight,window.innerHeight||0)},n.getViewportWidth=function(){return Math.max(document.documentElement.clientWidth,window.innerWidth||0)},n.isFunction=function(t){return t&&"[object Function]"==={}.toString.call(t)},n.mergeObject=function(t,e){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},n.skipLinkFocus=function(){var t=-1<navigator.userAgent.toLowerCase().indexOf("webkit"),e=-1<navigator.userAgent.toLowerCase().indexOf("opera"),n=-1<navigator.userAgent.toLowerCase().indexOf("msie");(t||e||n)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",function(){var t=location.hash.substring(1);/^[A-z0-9_-]+$/.test(t)&&(t=document.getElementById(t))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())},!1)},n.validateCommentSubmission=function(){jQuery("#commentform").on("submit",function(t){var e=[];jQuery(this).find("[required]").each(function(){jQuery(this).val()?"email"!==this.type||/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(jQuery(this).val())||e.push({element:$(this),message:'<strong class="text-uppercase">'+jQuery(this).parents("p").find("label").get(0).childNodes[0].textContent+"</strong> is an invalid email address"}):e.push({element:jQuery(this),message:'<strong class="text-uppercase">'+jQuery(this).parents("p").find("label").get(0).childNodes[0].textContent+"</strong> is required"})}),e.length?(t.preventDefault(),jQuery("#commentform-errors").show().find("ul").empty(),e.forEach(function(t){jQuery("#commentform-errors ul").append("<li>".concat(t.message,"</li>"))})):jQuery("#commentform-errors").hide()})}},{}],4:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=t("../helper/block");function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){var n,r,o,i,a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(a)return o=!(r=!0),{s:function(){a=a.call(t)},n:function(){var t=a.next();return r=t.done,t},e:function(t){o=!0,n=t},f:function(){try{r||null==a.return||a.return()}finally{if(o)throw n}}};if(Array.isArray(t)||(a=u(t))||e&&t&&"number"==typeof t.length)return a&&(t=a),i=0,{s:e=function(){},n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(t){return(t=>{if(Array.isArray(t))return r(t)})(t)||(t=>{if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)})(t)||u(t)||(()=>{throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function u(t,e){var n;if(t)return"string"==typeof t?r(t,e):"Map"===(n="Object"===(n={}.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(t=>(t=((t,e)=>{if("object"!=i(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);if("object"!=i(n=n.call(t,e||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(t,"string"),"symbol"==i(t)?t:t+""))(r.key),r)}}n.default=(()=>{function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.currentRequests=0,this.options={add:{color:"rgba( 255,255,255, 0.9)",opacity:"1",HTML:'<div class="hpy-add-to-cart-mask"><div></div></div>'},cart:{color:"rgba( 255,255,255, 0.9)",opacity:"1",HTML:'<div class="hpy-updating-cart-mask"><div class="hpy-add-to-cart-mask"><div></div></div></div>'}}}return e=t,(n=[{key:"blockProductRemoval",value:function(t){(0,o.block)(document.querySelector('.smc-row[data-key="'.concat(t,'"]')),this.options.add)}},{key:"unblockProductRemoval",value:function(t){(0,o.unblock)(document.querySelector('.smc-row[data-key="'.concat(t,'"]')))}},{key:"blockQueue",value:function(t){var e=this;this.currentRequests++,this.getElementsToBlock(t).forEach(function(t){t&&(0,o.block)(t,e.options.add)}),this.blockCommonElements(),this.blockMiniCart()}},{key:"unblockQueue",value:function(t){this.currentRequests--,this.getElementsToBlock(t).forEach(function(t){t&&(0,o.unblock)(t)}),0===this.currentRequests&&(this.unblockCommonElements(),this.unblockMiniCart())}},{key:"getCommonElements",value:function(){return[document.querySelector(".smc-checkout")].concat(c(document.querySelectorAll(".smc-continue")),[document.getElementById("smc")]).filter(function(t){return!!t})}},{key:"blockCommonElements",value:function(){var t,e=this,n=a(document.querySelectorAll(".smc"));try{for(n.s();!(t=n.n()).done;)t.value.classList.add("refreshing")}catch(t){n.e(t)}finally{n.f()}
1this.getCommonElements().forEach(function(t){t&&(0,o.block)(t,e.options.add)})}},{key:"unblockCommonElements",value:function(){var t,e=this,n=a(document.querySelectorAll(".smc"));try{for(n.s();!(t=n.n()).done;)t.value.classList.remove("refreshing")}catch(t){n.e(t)}finally{n.f()}this.getCommonElements().forEach(function(t){t&&(0,o.unblock)(t,e.options.add)})}},{key:"getElementsToBlock",value:function(){return[document.querySelector('.hpy-add-to-cart[data-id="'.concat(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",'"]'))||document.querySelector(".hpy-add-to-cart")].filter(function(t){return!!t})}},{key:"blockMiniCart",value:function(){(0,o.block)(document.querySelector(".smc-cart-wrap"),this.options.cart)}},{key:"unblockMiniCart",value:function(){(0,o.unblock)(document.querySelector(".smc-cart-wrap"))}},{key:"getCart",value:function(){return[document.querySelector(".woocommerce-cart-form"),document.querySelector(".cart_totals")]}},{key:"blockCart",value:function(){this.getCart().forEach(function(t){t&&(0,o.block)(t)})}},{key:"unblockCart",value:function(){this.getCart().forEach(function(t){t&&(0,o.unblock)(t)})}}])&&s(e.prototype,n),r&&s(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,r})()},{"../helper/block":2}],5:[function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){var n,r,o,i,a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(a)return o=!(r=!0),{s:function(){a=a.call(t)},n:function(){var t=a.next();return r=t.done,t},e:function(t){o=!0,n=t},f:function(){try{r||null==a.return||a.return()}finally{if(o)throw n}}};if(Array.isArray(t)||(a=((t,e)=>{var n;if(t)return"string"==typeof t?c(t,e):"Map"===(n="Object"===(n={}.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0})(t))||e&&t&&"number"==typeof t.length)return a&&(t=a),i=0,{s:e=function(){},n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function a(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}function l(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?a(Object(o),!0).forEach(function(t){var e,n;e=r,n=o[t=t],(t=u(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):a(Object(o)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(o,t))})}return r}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u(r.key),r)}}function u(t){t=((t,e)=>{if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);if("object"!=r(n=n.call(t,e||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(t,"string");return"symbol"==r(t)?t:t+""}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=(()=>{return t=function t(e){var n=this,r=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=this,i=t;if(!(o instanceof i))throw new TypeError("Cannot call a class as a function");this.isQuickShop=document.body.classList.contains("page-template-template-quick_shop"),this.data={contents:[],total:0,count:0},this.urls=e,r||(this.data.symbol=document.getElementById("smc-wrap").dataset.symbol,this.generate(),jQuery(document.body).on("wc_fragments_refreshed wc_fragments_loaded",function(){return n.generate()}))},(e=[{key:"add",value:function(t){var n=this,o=t.id,i=t.qty,a=t.variant,c=t.variations,u=t.nonce,s=t.attributes;return new Promise(function(e,r){jQuery.ajax({url:n.urls.rest.add,method:"POST",dataType:"json",data:l({id:o,quantity:i,variant:a,variations:c},s),beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",u)},error:function(t,e,n){r([t,e,n])},success:function(t){(t.success?e:r)(t.data)}})})}},{key:"remove",value:function(t){var n=this,o=t.key,i=t.nonce;
1return new Promise(function(e,r){o||r("No Key"),jQuery.ajax({url:n.urls.rest.remove,method:"POST",dataType:"json",data:{key:o},beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",i)},error:function(t,e,n){r([t,e,n])},success:function(t){t.success?e(t.data):r(t.error)}})})}},{key:"getContents",value:function(){return this.data.contents}},{key:"getTotal",value:function(){return this.data.total}},{key:"getCount",value:function(){return this.data.count}},{key:"getSymbol",value:function(){return this.data.symbol}},{key:"update",value:function(t){this.data.count=t.count,this.data.total=t.total}},{key:"addProduct",value:function(e){var t;this.data.contents.length&&(t=this.data.contents.find(function(t){return t.key===e.key}))?(t.qty=e.qty,t.price=e.price):this.data.contents.push(e)}},{key:"removeProduct",value:function(e){var t;this.data.contents.length&&(t=this.data.contents.findIndex(function(t){return t.key===e.key}),this.data.contents.splice(t,1))}},{key:"generate",value:function(){var t=JSON.parse(sessionStorage.getItem(wc_cart_fragments_params.fragment_name));t&&t.smc_cart_contents?(this.data.contents=t.smc_cart_contents.contents,this.data.total=parseFloat(t.smc_cart_contents.total),this.data.count=parseInt(t.smc_cart_contents.count)):this.generateCartFromDom()}},{key:"generateCartFromDom",value:function(){var t=document.getElementById("#smc-row-total"),t=(t&&(this.datat.total=parseFloat(t.dataset.total),this.data.count=parseInt(t.dataset.qty)),document.querySelectorAll("#smc-cart .smc-cart-items .smc-row"));if(t){var e,n=i(t);try{for(n.s();!(e=n.n()).done;){var r=e.value,o={key:r.dataset.key,id:r.dataset.id,name:r.dataset.name,qty:parseInt(r.dataset.qty),price:parseFloat(r.dataset.price)};this.data.contents.push(o)}}catch(t){n.e(t)}finally{n.f()}}}}])&&o(t.prototype,e),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n})()},{}],6:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=t("../helper/helper");function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(){var p,t="function"==typeof Symbol?Symbol:{},e=t.iterator||"@@iterator",n=t.toStringTag||"@@toStringTag";function r(t,e,n,r){var o,i,a,c,u,s,l,d,f,e=e&&e.prototype instanceof y?e:y,e=Object.create(e.prototype);return b(e,"_invoke",(o=t,i=n,l=r||[],d=!1,f={p:s=0,n:0,v:p,a:h,f:h.bind(p,4),d:function(t,e){return a=t,c=0,u=p,f.n=e,m}},function(t,e,n){if(1<s)throw TypeError("Generator is already running");for(d&&1===e&&h(e,n),c=e,u=n;(v=c<2?p:u)||!d;){a||(c?c<3?(1<c&&(f.n=-1),h(c,u)):f.n=u:f.v=u);try{if(s=2,a){if(v=a[t=c?t:"next"]){if(!(v=v.call(a,u)))throw TypeError("iterator result is not an object");if(!v.done)return v;u=v.value,c<2&&(c=0)}else 1===c&&(v=a.return)&&v.call(a),c<2&&(u=TypeError("The iterator does not provide a '"+t+"' method"),c=1);a=p}else if((v=(d=f.n<0)?u:o.call(i,f))!==m)break}catch(t){a=p,c=1,u=t}finally{s=1}}return{value:v,done:d}}),!0),e;function h(t,e){for(c=t,u=e,v=0;!d&&s&&!n&&v<l.length;v++){var n,r=l[v],o=f.p,i=r[2];3<t?(n=i===e)&&(u=r[(c=r[4])?5:c=3],r[4]=r[5]=p):r[0]<=o&&((n=t<2&&o<r[1])?(c=0,f.v=e,f.n=r[1]):o<i&&(n=t<3||r[0]>e||i<e)&&(r[4]=t,r[5]=e,f.n=i,c=0))}if(n||1<t)return m;throw d=!0,e}}var m={};function y(){}function o(){}function i(){}var v=Object.getPrototypeOf,t=[][e]?v(v([][e]())):(b(v={},e,function(){return this}),v),a=i.prototype=y.prototype=Object.create(t);function c(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,i):(t.__proto__=i,b(t,n,"GeneratorFunction")),t.prototype=Object.create(a),t}return b(a,"constructor",o.prototype=i),b(i,"constructor",o),b(i,n,o.displayName="GeneratorFunction"),b(a),b(a,n,"Generator"),b(a,e,function(){return this}),b(a,"toString",function(){return"[object Generator]"}),(u=function(){return{w:r,m:c}})()}function b(t,e,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}(b=function(t,e,n,r){function o(e,n){b(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(o("next",0),o("throw",1),o("return",2))})(t,e,n,r)}function s(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function a(c){return function(){var t=this,a=arguments;return new Promise(function(e,n){var r=c.apply(t,a);function o(t){s(r,e,n,o,i,"next",t)}function i(t){s(r,e,n,o,i,"throw",t)}o(void 0)})}}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(t=>(t=((t,e)=>{if("object"!=o(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);if("object"!=o(n=n.call(t,e||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(t,"string"),"symbol"==o(t)?t:t+""))(r.key),r)}}n.default=(()=>{function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");t&&t.method?(this.queue=[],this.callback=!1,this.state={running:!1,resultsCache:[]},this.results={complete:[],failed:[]},this.options=t):console.warn("No options provided for queue")}return t=e,(n=[{key:"add",value:function(t){this.queue.push(t),this.call("add",t),this.run()}},{key:"run",value:(o=a(u().m(function t(){var e;return u().w(function(t){for(;;)switch(t.p=t.n){case 0:if(this.state.running)return t.a(2);t.n=1;break;case 1:return this.state.running=!0,t.p=2,this.call("run"),t.n=3,this.processItem();case 3:t.n=5;break;case 4:t.p=4,e=t.v,console.error(e);case 5:return t.p=5,this.state.running=!1,this.call("complete",this.results),this.clearResults(),t.f(5);case 6:return t.a(2)}},t,this,[[2,4,5,6]])})),function(){return o.apply(this,arguments)})},{key:"processItem",value:function(){return new Promise((()=>{var n=a(u().m(function t(e,n){var r,o;return u().w(function(t){for(;;)switch(t.p=t.n){case 0:if(r=this.queue.shift(),t.p=1,r){t.n=2;break}throw"Item not found";case 2:return this.call("before",r),t.n=3,this.options.method(r);case 3:o=t.v,this.results.complete.push(o),this.call("step",{params:o,item:r}),t.n=5;break;case 4:t.p=4,o=t.v,console.error(o),this.results.failed.push({item:r,error:o}),this.call("error",{item:r,error:o});case 5:if(t.p=5,this.queue.length)return t.n=6,this.processItem();t.n=6;break;case 6:return e(),t.f(5);case 7:return t.a(2)}}
1,t,this,[[1,4,5,7]])}));return function(t,e){return n.apply(this,arguments)}})().bind(this))}},{key:"call",value:function(t,e){this.options[t]&&(0,i.isFunction)(this.options[t])&&this.options[t](e)}},{key:"clearResults",value:function(){this.results.timestamp=Date.now(),this.state.resultsCache.push(this.results),this.results={complete:[],failed:[]}}}])&&c(t.prototype,n),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,r,o})()},{"../helper/helper":3}],7:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=t("../helper/helper");function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(t=>(t=((t,e)=>{if("object"!=i(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);if("object"!=i(n=n.call(t,e||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(t,"string"),"symbol"==i(t)?t:t+""))(r.key),r)}}n.default=(()=>{function t(){var n=this;if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.wrap=!1,this.notices=[],this.limit=4,this.timeout=5e3,this.createNoticesBlock(),window.addEventListener("resize",this.calculatePosition.bind(this),{passive:!0}),document.addEventListener("scroll",this.calculatePosition.bind(this),{passive:!0}),jQuery(document.body).on("click",".hpy--notice",function(e){var t;"A"===e.target.tagName?e.target.classList.contains("button")&&(e.preventDefault(),jQuery(document.body).trigger("hpy_open_mini_cart")):(t=n.notices.find(function(t){return t.id==e.currentTarget.dataset.id}))&&n.removeNotice(t)})}return e=t,(n=[{key:"createNoticesBlock",value:function(){this.wrap=document.createElement("div"),this.wrap.id="hpy--notices",this.wrap.style.position="fixed",this.wrap.style.minWidth="20px",this.wrap.style.background="transparent",this.wrap.style.zIndex=98,this.wrap.style.maxWidth="500px",this.wrap.style.width="100%",this.wrap.style.paddingLeft="10px",this.wrap.style.right=0,this.calculatePosition(),document.body.appendChild(this.wrap)}},{key:"calculatePosition",value:function(){var t=document.getElementById("masthead"),e=document.querySelector(".hpy-breadcrumbs-wrap"),t=t.getBoundingClientRect(),e=(t=e?e.getBoundingClientRect():t).bottom;this.wrap.style.top="calc( ".concat(e=e<0?0:e,"px + 1rem )"),this.wrap.style.maxHeight="".concat((0,o.getViewportHeight)()-e,"px")}},{key:"add",value:function(t){var e=this,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"success";this.calculatePosition(),t.notices&&this.wrap&&t.notices.forEach(function(t){e.notices.length>=e.limit&&e.removeNotice(e.notices[0]),e.addNotice(t.notice,n)})}},{key:"clearWCNotices",value:function(){var t=document.querySelector(".notices .woocommerce-message");t&&t.parentElement.removeChild(t)}},{key:"removeNotice",value:function(e){var t=this,n=(clearTimeout(e.timeout),document.querySelector('.hpy--notice[data-id="'.concat(e.id,'"]')));n&&(n.style.transform="translateX(110%)",gsap.to(n,{x:"100%",onComplete:function(){t.wrap.removeChild(n.parentElement),t.notices=t.notices.filter(function(t){return t.id!==e.id}),t.calculatePosition()}})),this.calculatePosition()}},{key:"addNotice",value:function(t,e){var n=this,r={id:this.getUID(),text:t},t=(this.notices.push(r),this.wrap.insertAdjacentHTML("beforeend",this.createNotice(r,e)),this.wrap.querySelector('.hpy--notice[data-id="'.concat(r.id,'"]')));gsap.from(t,{x:"100%",onComplete:function(){n.calculatePosition(),r.timeout=setTimeout(function(){n.removeNotice(r)},n.timeout)}})}},{key:"getUID",value:function(){return Date.now()}},{key:"createNotice",value:function(t,e){return'<div class="justify-end d-flex"><div class="hpy--notice hpy--notice_'.concat(e,' d-inline-flex align-center" data-id="').concat(t.id,'">').concat(t.text,"</div></div>")}}])&&a(e.prototype,n),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,r})()},{"../helper/helper":3}],8:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0,t("regenerator-runtime/runtime");var i=t("./helper/helper"),a=r(t("./components/mask")),u=r(t("./mini-cart/Cart")),s=r(t("./mini-cart/ajaxQueue")),l=r(t("./mini-cart/Block")),d=r(t("./mini-cart/notices"));function r(t){return t&&t.__esModule?t:{default:t}}function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t){return(t=>{if(Array.isArray(t))return c(t)})(t)||(t=>{if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)})(t)||((t,e)=>{var n;if(t)return"string"==typeof t?c(t,e):"Map"===(n="Object"===(n={}.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0})(t)||(()=>{throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function h(){var p,t="function"==typeof Symbol?Symbol:{},e=t.iterator||"@@iterator",n=t.toStringTag||"@@toStringTag";function r(t,e,n,r){var o,i,a,c,u,s,l,d,f,e=e&&e.prototype instanceof y?e:y,e=Object.create(e.prototype);return b(e,"_invoke",(o=t,i=n,l=r||[],d=!1,f={p:s=0,n:0,v:p,a:h,f:h.bind(p,4),d:function(t,e){return a=t,c=0,u=p,f.n=e,m}},function(t,e,n){if(1<s)throw TypeError("Generator is already running");for(d&&1===e&&h(e,n),c=e,u=n;(v=c<2?p:u)||!d;){a||(c?c<3?(1<c&&(f.n=-1),h(c,u)):f.n=u:f.v=u);try{if(s=2,a){if(v=a[t=c?t:"next"]){if(!(v=v.call(a,u)))throw TypeError("iterator result is not an object");
1if(!v.done)return v;u=v.value,c<2&&(c=0)}else 1===c&&(v=a.return)&&v.call(a),c<2&&(u=TypeError("The iterator does not provide a '"+t+"' method"),c=1);a=p}else if((v=(d=f.n<0)?u:o.call(i,f))!==m)break}catch(t){a=p,c=1,u=t}finally{s=1}}return{value:v,done:d}}),!0),e;function h(t,e){for(c=t,u=e,v=0;!d&&s&&!n&&v<l.length;v++){var n,r=l[v],o=f.p,i=r[2];3<t?(n=i===e)&&(u=r[(c=r[4])?5:c=3],r[4]=r[5]=p):r[0]<=o&&((n=t<2&&o<r[1])?(c=0,f.v=e,f.n=r[1]):o<i&&(n=t<3||r[0]>e||i<e)&&(r[4]=t,r[5]=e,f.n=i,c=0))}if(n||1<t)return m;throw d=!0,e}}var m={};function y(){}function o(){}function i(){}var v=Object.getPrototypeOf,t=[][e]?v(v([][e]())):(b(v={},e,function(){return this}),v),a=i.prototype=y.prototype=Object.create(t);function c(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,i):(t.__proto__=i,b(t,n,"GeneratorFunction")),t.prototype=Object.create(a),t}return b(a,"constructor",o.prototype=i),b(i,"constructor",o),b(i,n,o.displayName="GeneratorFunction"),b(a),b(a,n,"Generator"),b(a,e,function(){return this}),b(a,"toString",function(){return"[object Generator]"}),(h=function(){return{w:r,m:c}})()}function b(t,e,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}(b=function(t,e,n,r){function o(e,n){b(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(o("next",0),o("throw",1),o("return",2))})(t,e,n,r)}function p(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function m(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(t=>(t=((t,e)=>{if("object"!=o(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);if("object"!=o(n=n.call(t,e||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(t,"string"),"symbol"==o(t)?t:t+""))(r.key),r)}}new(n.default=(()=>{function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.scrollbarWidth=(0,i.getScrollbarWidth)(),this.block=new l.default,this.state={open:!1,mask:new a.default("mini-cart",{backgroundColor:hpyMCApi.backgroundColor},this.close.bind(this)),currentRequests:0,cartPage:document.body.classList.contains("woocommerce-cart"),checkoutPage:document.body.classList.contains("woocommerce-checkout"),sizeInit:!1,runningRemove:!1,runningAdd:!1,shouldRefreshCart:!1},this.cart=new u.default(hpyMCApi),this.removeQueue=new s.default({method:this.cart.remove.bind(this.cart),add:this.onRemoveAdd.bind(this),run:this.onRemoveRun.bind(this),step:this.onRemoveStep.bind(this),complete:this.onRemoveComplete.bind(this),error:this.onRemoveError.bind(this)}),this.addQueue=new s.default({method:this.cart.add.bind(this.cart),add:this.onAdd.bind(this),step:this.onAddStep.bind(this),complete:this.onAddComplete.bind(this),error:this.onAddError.bind(this)}),this.removing=[],this.adding=[],this.notices=new d.default,this.sizeMiniCart(),this.events()}return e=t,(n=[{key:"events",value:function(){var e=this;jQuery(document.body).on("hpy_open_mini_cart",function(t){return e.open(t)}).on("wc_fragments_refreshed wc_fragments_loaded",function(){return e.cartFragmentsRefreshed()}).on("click","#smc",function(t){return e.open(t)}).on("click",".smc-checkout",function(){return jQuery(document).trigger("wpmBeginCheckout")}).on("click","#smc-header .smc-close",function(){return e.close()}).on("click",".smc-remove",function(t){return e.removeFromCart(t)}).on("click",".hpy-add-to-cart",this.addToCart.bind(this)),jQuery(window).on("load DOMContentLoaded",this.sizeMiniCart.bind(this)),window.addEventListener("resize",(0,i._debounce)(this.sizeMiniCart.bind(this),100),{passive:!0})}},{key:"addToCart",value:(c=h().m(function t(e){var n,r;return h().w(function(t){for(;;)switch(t.p=t.n){case 0:if(e.preventDefault(),e.currentTarget.classList.contains("disabled"))return t.a(2);t.n=1;break;case 1:if(t.p=1,(n=this.getAddtoCart(e.currentTarget))&&n.product&&n.product.id){t.n=2;break}return t.a(2);case 2:n.product.event=e,this.state.runningAdd=!0,this.addQueue.add(n.product),t.n=4;break;case 3:t.p=3,r=t.v,console.error(r);case 4:return t.a(2)}},t,this,[[1,3]])}),o=function(){var t=this,a=arguments;return new Promise(function(e,n){var r=c.apply(t,a);function o(t){p(r,e,n,o,i,"next",t)}function i(t){p(r,e,n,o,i,"throw",t)}o(void 0)})},function(t){return o.apply(this,arguments)})},{key:"removeFromCart",value:function(t){t=t.target.parentElement;t.dataset.key&&(this.state.runningRemove=!0,this.removeQueue.add({key:t.dataset.key,nonce:
1document.getElementById("smc-remove-nonce").value}))}},{key:"getAddtoCartSingleProduct",value:function(t,n){var e=n.row.find('input[name="quantity"]').val();if(!Number(e)&&0<e)return console.warn("Invalid quantity: ",t,e),!1;if(n.product.qty=e,n.product.name=n.row.find(".product_title").data("product_title"),n.product.attributes||(n.product.attributes={}),n.row.hasClass("product-type-variable")){n.product.id=n.row.find('input[name="product_id"]').val(),n.product.variant=n.row.find('input[name="variation_id"].variation_id').val();e=n.row.find(".product--variation_attribute select");if(n.product.variations={},n.product.name+=" -",e.each(function(t,e){e=jQuery(e),n.product.variations[e.attr("name")]=e.val(),n.product.name+=" ".concat(e.find("option:selected").text())}),0==n.product.variant)throw new Error("Invalid product, please try again")}else n.product.id=t.val();var r,o,i=t.closest("form.cart").serializeArray();for(r in i)n.product[i[r].name]||"add-to-cart"===i[r].name||(o=(o=document.getElementsByName(i[r].name)).length?f(o).filter(function(t){return null!==t.parentElement.offsetParent}):o).length&&("wp_rest_nonce"===i[r].name?n.product.nonce=i[r].value:n.product.attributes[i[r].name]=i[r].value);return n}},{key:"getAddtoCart",value:function(t){(t=jQuery(t)).hasClass("refresh-cart")&&(this.shouldRefreshCart=!0);var e="tooltip"===t.data("type"),e=t.closest(e?".tooltip-content":".product"),n={row:e,product:{id:0,qty:0,name:"",variant:0,variations:{},attributes:{}}};if(!n.row)return console.warn("Row not found for target: ",t),!1;var r=e.find('input[name^="_wpnonce"]').val();if(r&&(n.product.attributes._wpnonce=r),t.hasClass("single_add_to_cart_button"))return this.getAddtoCartSingleProduct(t,n);if(n.product.id=t.data("product_id"),n.product.qty=t.data("qty"),n.product.name=t.data("name"),n.row.hasClass("nyp-product")&&n.row.hasClass("product-type-simple")){n.product.attributes||(n.product.attributes={});r=e.find('input[name="nyp"]').val();if(!r||""===r.trim())return alert("Please enter a value"),!1;if(isNaN(parseFloat(r)))return alert("Please enter a numeric value"),!1;n.product.attributes.nyp=r,n.product.attributes["update-price"]=e.find('input[name="update-price"]').val(),n.product.attributes._nypnonce=e.find('input[name="_nypnonce"]').val()}if(n.row.hasClass("product-type-variable")){t=n.row.find("select.pnz--product_variation");if(n.product.variant=t.val(),!n.product.variant)return alert("Please select a variant"),!1;r=t.find('option[value="'.concat(n.product.variant,'"]'));n.product.variations=r.data("variations"),n.product.name+=" - ".concat(r.data("name"))}return n}},{key:"addToMenu",value:function(t,e){this.cart.getContents().length||(this.getItemsWrap().innerHTML="");e={key:t.item.key,id:e.id,name:e.name,qty:parseInt(t.item.qty),price:parseFloat(t.item.total)};this.updateMiniCart(t.fragments.fragments),this.cart.update(t.cart),this.cart.addProduct(e),this.state.sizeInit||this.sizeMiniCart()}},{key:"updateMiniCart",value:function(t){for(var e in t){var n,r=document.querySelector(e);r&&(n=(0,i.createElementFromString)(t[e]),"#smc-wrap"===e&&this.state.open&&(n.style.transform="translateX(0)",n.setAttribute("aria-expanded",!0)),r.replaceWith(n))}}},{key:"cartFragmentsRefreshed",value:function(){var t;this.sizeMiniCart(),this.state.open&&((t=this.getCartWrap()).style.transform="translateX(0)",t.setAttribute("aria-expanded",!0)),(this.state.runningAdd||this.state.runningRemove)&&(this.block.blockCommonElements(),this.block.blockMiniCart())}},{key:"sizeMiniCart",value:function(){var t=document.querySelector(".smc-cart-wrap");t&&(t.style.maxHeight=this.getMaxHeight(),t.style.width="calc( 100% + ".concat(this.scrollbarWidth,"px )"))}},{key:"getMaxHeight",value:function(){var t,e,n=document.querySelector(".smc-cart-total");return n?(this.state.sizeInit=!0,n=document.getElementById("smc-header").offsetHeight+this.getFooterHeight()+n.offsetHeight,t=(0,i.getViewportHeight)(),document.body.classList.contains("admin-bar")&&(e=document.getElementById("wpadminbar"))&&(t-=e.offsetHeight),"".concat(t-n,"px")):""}},{key:"getFooterHeight",value:function(){var t=document.getElementById("smc-footer");return t?t.offsetHeight:0}},{key:"open",value:function(t){var e,n=this;this.state.checkoutPage||(t.preventDefault(),this.state.open)||this.state.cartPage||(e=this.getCartWrap(),gsap.to(e,{x:0}),this.setDocumentOverflow(!0),this.state.mask.show(function(){e.setAttribute("aria-expanded",!0),n.state.open=!0}))}},{key:"close",value:function(){var t,e=this;this.state.open&&!this.state.runningRemove&&(t=this.getCartWrap(),gsap.to(t,{x:"105%"}),this.state.mask.hide(function(){t.setAttribute("aria-expanded",!1),e.state.open=!1,e.setDocumentOverflow()}))}},{key:"setDocumentOverflow",value:function(t){t?(document.documentElement.style.overflow="hidden",document.documentElement.style.height="100%",document.body.style.paddingRight="".concat(this.scrollbarWidth,"px")):(document.documentElement.style.overflow="",document.documentElement.style.height="%",document.body.style.paddingRight="")}},{key:"getCartWrap",value:function(){var t=document.getElementById("smc").getAttribute("aria-controls");return document.getElementById(t)}},{key:"getMiniCart",value:function(){return document.getElementById("smc-cart")}},{key:"getItemsWrap",value:function(){return document.querySelector("#smc-cart .smc-cart-items")}},{key:"onAdd",value:function(t){t=t.id;this.adding.push(t),this.block.blockQueue(t),this.shouldRefreshCart&&this.block.blockCart()}},{key:"onAddStep",value:function(t){var e=this,n=t.params,t=t.item,r=(this.block.unblockQueue(t.id),this.addToMenu(n,t),this.notices.clearWCNotices(),this.notices.add(n,"success"),this.removeFromAdding(t.id),this.adding.length&&this.adding.forEach(function(t){e.block.blockQueue(t),e.block.blockCart()}
1),jQuery('.hpy-add-to-cart[data-product_id="'.concat(t.id,'"]')));jQuery(document.body).trigger("hpy_add_to_cart",[t.event]),jQuery(document.body).trigger("added_to_cart",[n.fragments.fragments,n.fragments.cart_hash,r]),this.sizeMiniCart()}},{key:"onAddComplete",value:function(){this.state.runningAdd=!1,this.refreshCart(),jQuery(document.body).trigger("hpy_add_to_cart_complete")}},{key:"refreshCart",value:function(){this.shouldRefreshCart&&(this.block.unblockCart(),this.shouldRefreshCart=!1,jQuery(document).trigger("wc_update_cart"))}},{key:"onAddError",value:function(t){var e=t.item,t=t.error;this.removeFromAdding(e.id),this.notices.add(t,"error"),this.block.unblockQueue(e.id)}},{key:"removeFromAdding",value:function(t){t=this.adding.indexOf(t);-1!==t&&this.adding.splice(t,1)}},{key:"onRemoveAdd",value:function(t){t=t.key;this.removing.push(t),this.block.blockProductRemoval(t)}},{key:"onRemoveRun",value:function(){this.block.blockCommonElements()}},{key:"onRemoveStep",value:function(t){var e=this,t=t.params;this.updateMiniCart(t.fragments.fragments),this.cart.update(t.cart),this.cart.removeProduct(t.key),this.removeFromRemoving(t.key),this.removing.length&&this.removing.forEach(function(t){e.block.blockProductRemoval(t),e.block.blockCommonElements()}),0===t.cart.count&&(this.state.sizeInit=!1),this.sizeMiniCart()}},{key:"onRemoveComplete",value:function(t){this.state.runningRemove=!1,this.block.unblockCommonElements(),jQuery(document.body).trigger("hpy_remove_cart_item");t=t.complete[t.complete.length-1];jQuery(document.last).trigger("removed_from_cart",[t.fragments.fragments,t.fragments.cart_hash])}},{key:"onRemoveError",value:function(t){this.removeFromRemoving(t.item.key),this.block.unblockProductRemoval(t.item.key)}},{key:"removeFromRemoving",value:function(t){t=this.removing.indexOf(t);-1!==t&&this.removing.splice(t,1)}}])&&m(e.prototype,n),r&&m(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,r,c,o})())},{"./components/mask":1,"./helper/helper":3,"./mini-cart/Block":4,"./mini-cart/Cart":5,"./mini-cart/ajaxQueue":6,"./mini-cart/notices":7,"regenerator-runtime/runtime":9}],9:[function(t,e,n){function i(t,e,n,r){var o,i,a,c,e=e&&e.prototype instanceof s?e:s,e=Object.create(e.prototype),r=new f(r||[]);return e._invoke=(o=t,i=n,a=r,c=v,function(t,e){if(c===g)throw new Error("Generator is already running");if(c===w){if("throw"===t)throw e;return p()}for(a.method=t,a.arg=e;;){var n=a.delegate;if(n){n=function t(e,n){var r=e.iterator[n.method];if(r===y){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=y,t(e,n),"throw"===n.method))return k;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return k}r=u(r,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,k;r=r.arg;if(!r)return n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,k;{if(!r.done)return r;n[e.resultName]=r.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=y)}n.delegate=null;return k}(n,a);if(n){if(n===k)continue;return n}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===v)throw c=w,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=g;n=u(o,i,a);if("normal"===n.type){if(c=a.done?w:b,n.arg!==k)return{value:n.arg,done:a.done}}else"throw"===n.type&&(c=w,a.method="throw",a.arg=n.arg)}}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function s(){}function r(){}function o(){}function a(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function c(a){var e;this._invoke=function(n,r){function t(){return new Promise(function(t,e){!function e(t,n,r,o){t=u(a[t],a,n);if("throw"===t.type)o(t.arg);else{var i=t.arg;if((n=i.value)&&"object"==typeof n&&C.call(n,"__await"))return Promise.resolve(n.__await).then(function(t){e("next",t,r,o)},function(t){e("throw",t,r,o)});Promise.resolve(n).then(function(t){i.value=t,r(i)},o)}}(n,r,t,e)})}return e=e?e.then(t,t):t()}}function l(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function d(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function f(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(l,this),this.reset(!0)}function h(e){if(e){var n,t=e[_];if(t)return t.call(e);
vendor: 3,891 bytes, line 1
1if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(C.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=y,t.done=!0,t}).next=t}return{next:p}}function p(){return{value:y,done:!0}}var m,y,v,b,g,w,k,S,j,C,E,_,x,O,P;m=function(){return this}()||Function("return this")(),j=Object.prototype,C=j.hasOwnProperty,E="function"==typeof Symbol?Symbol:{},_=E.iterator||"@@iterator",x=E.asyncIterator||"@@asyncIterator",O=E.toStringTag||"@@toStringTag",E="object"==typeof e,(P=m.regeneratorRuntime)?E&&(e.exports=P):((P=m.regeneratorRuntime=E?e.exports:{}).wrap=i,v="suspendedStart",b="suspendedYield",g="executing",w="completed",k={},(m={})[_]=function(){return this},(E=(E=Object.getPrototypeOf)&&E(E(h([]))))&&E!==j&&C.call(E,_)&&(m=E),S=o.prototype=s.prototype=Object.create(m),(r.prototype=S.constructor=o).constructor=r,o[O]=r.displayName="GeneratorFunction",P.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===r||"GeneratorFunction"===(t.displayName||t.name))},P.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,o):(t.__proto__=o,O in t||(t[O]="GeneratorFunction")),t.prototype=Object.create(S),t},P.awrap=function(t){return{__await:t}},a(c.prototype),c.prototype[x]=function(){return this},P.AsyncIterator=c,P.async=function(t,e,n,r){var o=new c(i(t,e,n,r));return P.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},a(S),S[O]="Generator",S[_]=function(){return this},S.toString=function(){return"[object Generator]"},P.keys=function(n){var t,r=[];for(t in n)r.push(t);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},P.values=h,f.prototype={constructor:f,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=y,this.done=!1,this.delegate=null,this.method="next",this.arg=y,this.tryEntries.forEach(d),!t)for(var e in this)"t"===e.charAt(0)&&C.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=y)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return i.type="throw",i.arg=n,r.next=t,e&&(r.method="next",r.arg=y),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=C.call(o,"catchLoc"),c=C.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&C.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}var i=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,k):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),k},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),d(n),k}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(n=o.completion).type&&(r=n.arg,d(o)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:h(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=y),k}})},{}]},{},[8]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.