index of
/
home
/
thefkyzp
/
hulmvisaadvisor.com
/
wp-content
/
plugins
/
surecart
/
dist
/
File: /home/thefkyzp/hulmvisaadvisor.com/wp-content/plugins/surecart/dist/9676.js
"use strict";(self.webpackChunk_surecart_surecart=self.webpackChunk_surecart_surecart||[]).push([[9676],{2846:function(n,t,e){e.d(t,{i:function(){return r},m:function(){return o},z:function(){return i}});var i=["bif","byr","clp","djf","gnf","isk","jpy","kmf","krw","pyg","rwf","ugx","vnd","vuv","xaf","xag","xau","xba","xbb","xbc","xbd","xdr","xof","xpd","xpf","xpt","xts"],o=function(n,t){return r(t)?n:n/100},r=function(n){var t;return i.includes(null===(t=null==n?void 0:n.toLowerCase)||void 0===t?void 0:t.call(n))}},7154:function(n,t,e){e.d(t,{t:function(){return i}});var i=function(n,t){((null===window||void 0===window?void 0:window.dataLayer)||(null===window||void 0===window?void 0:window.gtag))&&t&&((null===window||void 0===window?void 0:window.gtag)?window.gtag("event",n,t):(window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:n,ecommerce:t})))}},5842:function(n,t,e){var i=e(4942),o=e(2846),r=e(7154);function u(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),e.push.apply(e,i)}return e}function l(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?u(Object(e),!0).forEach((function(t){(0,i.Z)(n,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):u(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}window.addEventListener("scSearched",(function(n){var t;if(null===window||void 0===window?void 0:window.fbq){var e=n.detail;window.fbq("track","Search",l({search_string:e.searchString,content_ids:e.searchResultIds},(null===(t=null==e?void 0:e.searchCollections)||void 0===t?void 0:t.length)?{content_category:e.searchCollections.join(",")}:{}))}})),window.addEventListener("scProductViewed",(function(n){var t,e,i,r,u,l;if(null===window||void 0===window?void 0:window.fbq){var a=n.detail;window.fbq("track","ViewContent",{content_ids:[a.id],content_category:null===(e=null===(t=null==a?void 0:a.product_collections)||void 0===t?void 0:t.data)||void 0===e?void 0:e.map((function(n){return n.name})).join(", "),content_name:(null==a?void 0:a.name)+((null===(i=null==a?void 0:a.variant_options)||void 0===i?void 0:i.length)?" - ".concat(null==a?void 0:a.variant_options.join(" / ")):""),content_type:"product",contents:[{id:a.id,quantity:1}],currency:null===(r=null==a?void 0:a.price)||void 0===r?void 0:r.currency,value:(0,o.m)((null===(u=a.price)||void 0===u?void 0:u.amount)||0,(null===(l=a.price)||void 0===l?void 0:l.currency)||"USD")})}})),window.addEventListener("scSearched",(function(n){var t;(0,r.t)("search",{search_term:null===(t=n.detail)||void 0===t?void 0:t.searchString})})),window.addEventListener("scProductViewed",(function(n){var t,e,i,u,a,c,d,v,s,f,p,m,y=n.detail;(0,r.t)("view_item",{value:(0,o.m)((null===(t=y.price)||void 0===t?void 0:t.amount)||0,(null===(e=y.price)||void 0===e?void 0:e.currency)||"USD"),currency:null===(i=y.price)||void 0===i?void 0:i.currency,items:[l(l({item_id:null==y?void 0:y.id,item_name:null==y?void 0:y.name,currency:null===(u=null==y?void 0:y.price)||void 0===u?void 0:u.currency,discount:(null==y?void 0:y.discount_amount)?(0,o.m)(null==y?void 0:y.discount_amount,null===(a=null==y?void 0:y.price)||void 0===a?void 0:a.currency):0,price:(0,o.m)(null===(c=null==y?void 0:y.price)||void 0===c?void 0:c.amount,null===(d=null==y?void 0:y.price)||void 0===d?void 0:d.currency),quantity:(null==y?void 0:y.quantity)||1},(null===(v=null==y?void 0:y.variant_options)||void 0===v?void 0:v.length)?{item_variant:null==y?void 0:y.variant_options.map((function(n){return n.name})).join(" / ")}:{}),(null===(f=null===(s=null==y?void 0:y.product_collections)||void 0===s?void 0:s.data)||void 0===f?void 0:f.length)?{item_category:null===(m=null===(p=null==y?void 0:y.product_collections)||void 0===p?void 0:p.data)||void 0===m?void 0:m.map((function(n){return n.name})).join(", ")}:{})]})})),window.addEventListener("scProductsViewed",(function(n){var t,e=n.detail;(0,r.t)("view_item_list",l(l({},(null==e?void 0:e.collectionId)?{item_list_id:e.collectionId}:{}),{},{item_list_name:e.pageTitle,items:null===(t=null==e?void 0:e.products)||void 0===t?void 0:t.map((function(n){var t,i,o,r;return l(l(l({item_id:null==n?void 0:n.id,item_name:null==n?void 0:n.name},(null===(i=null===(t=null==n?void 0:n.product_collections)||void 0===t?void 0:t.data)||void 0===i?void 0:i.length)?{item_category:null===(r=null===(o=null==n?void 0:n.product_collections)||void 0===o?void 0:o.data)||void 0===r?void 0:r.map((function(n){return n.name})).join(", ")}:{}),(null==e?void 0:e.collectionId)?{item_list_id:e.collectionId}:{}),{},{item_list_name:e.pageTitle})}))}))}))},6151:function(n,t,e){e.d(t,{c:function(){return v}});var i=e(8860);function o(n,t){(null==t||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e<t;e++)i[e]=n[e];return i}var r,u,l=function(n){return!("isConnected"in n)||n.isConnected},a=(r=function(n){var t,e=function(n,t){var e="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=function(n,t){if(n){if("string"==typeof n)return o(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);return"Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e?Array.from(n):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?o(n,t):void 0}}(n))||t&&n&&"number"==typeof n.length){e&&(n=e);var i=0,r=function(){};return{s:r,n:function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(n){throw n},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,l=!0,a=!1;return{s:function(){e=e.call(n)},n:function(){var n=e.next();return l=n.done,n},e:function(n){a=!0,u=n},f:function(){try{l||null==e.return||e.return()}finally{if(a)throw u}}}}(n.keys());try{for(e.s();!(t=e.n()).done;){var i=t.value;n.set(i,n.get(i).filter(l))}}catch(n){e.e(n)}finally{e.f()}},2e3,function(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];u&&clearTimeout(u),u=setTimeout((function(){u=0,r.apply(void 0,t)}),2e3)}),c=function(n){return"function"==typeof n?n():n},d=function(n,t){var e=n.indexOf(t);e>=0&&(n[e]=n[n.length-1],n.length--)},v=function(n,t){var e=function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(n,t){return n!==t},e=c(n),i=new Map(Object.entries(null!=e?e:{})),o={dispose:[],get:[],set:[],reset:[]},r=function(){var t;i=new Map(Object.entries(null!==(t=c(n))&&void 0!==t?t:{})),o.reset.forEach((function(n){return n()}))},u=function(){o.dispose.forEach((function(n){return n()})),r()},l=function(n){return o.get.forEach((function(t){return t(n)})),i.get(n)},a=function(n,e){var r=i.get(n);t(e,r,n)&&(i.set(n,e),o.set.forEach((function(t){return t(n,e,r)})))},v="undefined"==typeof Proxy?{}:new Proxy(e,{get:function(n,t){return l(t)},ownKeys:function(n){return Array.from(i.keys())},getOwnPropertyDescriptor:function(){return{enumerable:!0,configurable:!0}},has:function(n,t){return i.has(t)},set:function(n,t,e){return a(t,e),!0}}),s=function(n,t){return o[n].push(t),function(){d(o[n],t)}},f=function(t,e){var i=s("set",(function(n,i){n===t&&e(i)})),o=s("reset",(function(){return e(c(n)[t])}));return function(){i(),o()}},p=function(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];var i=t.reduce((function(n,t){return t.set&&n.push(s("set",t.set)),t.get&&n.push(s("get",t.get)),t.reset&&n.push(s("reset",t.reset)),t.dispose&&n.push(s("dispose",t.dispose)),n}),[]);return function(){return i.forEach((function(n){return n()}))}};return{state:v,get:l,set:a,on:s,onChange:f,use:p,dispose:u,reset:r,forceUpdate:function(n){var t=i.get(n);o.set.forEach((function(e){return e(n,t,t)}))}}}(n,t);return e.use(function(){if("function"!=typeof i.g)return{};var n=new Map;return{dispose:function(){return n.clear()},get:function(t){var e=(0,i.g)();e&&function(n,t,e){var i=n.get(t);i?i.includes(e)||i.push(e):n.set(t,[e])}(n,t,e)},set:function(t){var e=n.get(t);e&&n.set(t,e.filter(i.f)),a(n)},reset:function(){n.forEach((function(n){return n.forEach(i.f)})),a(n)}}}()),e}},6715:function(n,t,e){function i(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"polite",t=document.createElement("div");t.id="a11y-speak-".concat(n),t.className="a11y-speak-region",t.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),t.setAttribute("aria-live",n),t.setAttribute("aria-relevant","additions text"),t.setAttribute("aria-atomic","true");var e=document,i=e.body;return i&&i.appendChild(t),t}e.d(t,{s:function(){return u}});var o,r="";function u(n,t){!function(){for(var n=document.getElementsByClassName("a11y-speak-region"),t=document.getElementById("a11y-speak-intro-text"),e=0;e<n.length;e++)n[e].textContent="";t&&t.setAttribute("hidden","hidden")}(),n=function(n){return n=n.replace(/<[^<>]+>/g," "),r===n&&(n+=" "),r=n,n}(n);var e=document.getElementById("a11y-speak-intro-text"),i=document.getElementById("a11y-speak-assertive"),o=document.getElementById("a11y-speak-polite");i&&"assertive"===t?i.textContent=n:o&&(o.textContent=n),e&&e.removeAttribute("hidden")}o=function(){var n=document.getElementById("a11y-speak-intro-text"),t=document.getElementById("a11y-speak-assertive"),e=document.getElementById("a11y-speak-polite");null===n&&function(){var n=document.createElement("p");n.id="a11y-speak-intro-text",n.className="a11y-speak-intro-text",n.textContent=wp.i18n.__("Notifications"),n.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),n.setAttribute("hidden","hidden");var t=document.body;t&&t.appendChild(n)}(),null===t&&i("assertive"),null===e&&i("polite")},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",o):o())},9676:function(n,t,e){e.r(t),e.d(t,{sc_product_pills_variant_option:function(){return d}});var i=e(4942),o=e(5671),r=e(3144),u=e(8860),l=e(9634);function a(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),e.push.apply(e,i)}return e}function c(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?a(Object(e),!0).forEach((function(t){(0,i.Z)(n,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):a(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}e(6151),e(5842),e(6715);var d=function(){function n(t){(0,o.Z)(this,n),(0,u.r)(this,t),this.label=void 0,this.optionNumber=1,this.productId=void 0}return(0,r.Z)(n,[{key:"render",value:function(){var n=this;return(0,u.h)("sc-form-control",{label:this.label},(0,u.h)("span",{slot:"label"},this.label),(0,u.h)("div",{class:"sc-product-pills-variant-option__wrapper"},(l.s[this.productId].variant_options[this.optionNumber-1].values||[]).map((function(t){var e=(0,l.e)(n.productId,n.optionNumber,t)||(0,l.h)(n.productId,n.optionNumber,t);return(0,u.h)("sc-pill-option",{isUnavailable:e,isSelected:l.s[n.productId].variantValues["option_".concat(n.optionNumber)]===t,onClick:function(){return(0,l.b)(n.productId,{variantValues:c(c({},l.s[n.productId].variantValues),{},(0,i.Z)({},"option_".concat(n.optionNumber),t))})}},(0,u.h)("span",{"aria-hidden":"true"},t),(0,u.h)("sc-visually-hidden",null,wp.i18n.sprintf(wp.i18n.__("Select %s: %s.","surecart"),n.label,t),e&&(0,u.h)(u.F,null," ",wp.i18n.__("(option unavailable)","surecart")),l.s[n.productId].variantValues["option_".concat(n.optionNumber)]===t&&(0,u.h)(u.F,null," ",wp.i18n.__("This option is currently selected.","surecart"))))}))))}}]),n}();d.style=".sc-product-pills-variant-option__wrapper{display:flex;flex-wrap:wrap;gap:var(--sc-spacing-x-small)}"},7409:function(n,t,e){e.d(t,{a:function(){return u},b:function(){return r},g:function(){return a},i:function(){return c},s:function(){return l}});var i=e(1002);function o(n,t){(null==t||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e<t;e++)i[e]=n[e];return i}var r=function(n){var t;try{t=new URL(n)}catch(n){return!1}return"http:"===t.protocol||"https:"===t.protocol},u=function(n){var t=window.location.search;return new URLSearchParams(t).get(n)},l=function(n,t,e){return(n||[]).sort((function(n,i){return-1===e.indexOf(null==n?void 0:n[t])?1:-1===e.indexOf(null==i?void 0:i[t])?-1:e.indexOf(null==n?void 0:n[t])-e.indexOf(null==i?void 0:i[t])}))},a=function(n){var t,e=n.variants,r=n.values,u=Object.keys(r),l=function(n,t){var e="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=function(n,t){if(n){if("string"==typeof n)return o(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);return"Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e?Array.from(n):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?o(n,t):void 0}}(n))||t&&n&&"number"==typeof n.length){e&&(n=e);var i=0,r=function(){};return{s:r,n:function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(n){throw n},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,l=!0,a=!1;return{s:function(){e=e.call(n)},n:function(){var n=e.next();return l=n.done,n},e:function(n){a=!0,u=n},f:function(){try{l||null==e.return||e.return()}finally{if(a)throw u}}}}(e);try{var a=function(){var n=t.value,e=["option_1","option_2","option_3"].map((function(t){return n[t]})).filter((function(n){return null!=n}));if((null==e?void 0:e.length)===(null==u?void 0:u.length)&&u.every((function(n){return e.includes(r[n])})))return{v:n}};for(l.s();!(t=l.n()).done;){var c=a();if("object"===(0,i.Z)(c))return c.v}}catch(n){l.e(n)}finally{l.f()}return null},c=function(n,t){var e=parseInt(n);return!(t&&((null==t?void 0:t.ad_hoc_max_amount)||(null==t?void 0:t.ad_hoc_min_amount))&&((null==t?void 0:t.ad_hoc_max_amount)&&e>(null==t?void 0:t.ad_hoc_max_amount)||(null==t?void 0:t.ad_hoc_min_amount)&&e<(null==t?void 0:t.ad_hoc_min_amount)))}},8403:function(n,t,e){e.d(t,{a:function(){return l},g:function(){return r},i:function(){return u}});var i=e(9062),o=e(1002),r=function(){var n,t=document.querySelector('script[type="application/json"]#sc-store-data');if(!t)return{};try{var e=JSON.parse(t.textContent);if((n=e)&&"object"===(0,o.Z)(n)&&!Array.isArray(n))return e;throw Error("Parsed state is not an object")}catch(n){console.log(n)}return{}},u=function(n,t,e,o){var r,u,l,a,c;if(!(null==o?void 0:o.stock_enabled)||(null==o?void 0:o.allow_out_of_stock_purchases))return!1;if(1===n){var d=null===(l=(u=(null===(r=o.variants)||void 0===r?void 0:r.data)||[]).filter)||void 0===l?void 0:l.call(u,(function(n){return n.option_1===t}));return Math.max.apply(Math,(0,i.Z)(d.map((function(n){return n.available_stock}))))<=0}if(2===n){var v=((null===(a=o.variants)||void 0===a?void 0:a.data)||[]).filter((function(n){return(null==n?void 0:n.option_1)===e.option_1&&n.option_2===t}));return Math.max.apply(Math,(0,i.Z)(v.map((function(n){return n.available_stock}))))<=0}var s=((null===(c=o.variants)||void 0===c?void 0:c.data)||[]).filter((function(n){return(null==n?void 0:n.option_1)===e.option_1&&(null==n?void 0:n.option_2)===e.option_2&&n.option_3===t}));return Math.max.apply(Math,(0,i.Z)(s.map((function(n){return n.available_stock}))))<=0},l=function(n,t,e,i){var o,r,u;return 1===n?!((null===(o=null==i?void 0:i.variants)||void 0===o?void 0:o.data)||[]).some((function(n){return n.option_1===t})):2===n?!((null===(r=null==i?void 0:i.variants)||void 0===r?void 0:r.data)||[]).some((function(n){return(null==n?void 0:n.option_1)===e.option_1&&n.option_2===t})):!((null===(u=null==i?void 0:i.variants)||void 0===u?void 0:u.data)||[]).some((function(n){return(null==n?void 0:n.option_1)===e.option_1&&(null==n?void 0:n.option_2)===e.option_2&&n.option_3===t}))}},9634:function(n,t,e){e.d(t,{a:function(){return O},b:function(){return P},c:function(){return m},d:function(){return j},e:function(){return s},f:function(){return x},g:function(){return h},h:function(){return f},i:function(){return p},j:function(){return d},o:function(){return w},s:function(){return g}});var i=e(4942),o=e(6151),r=(e(5842),e(8403)),u=e(7409),l=e(6715);function a(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),e.push.apply(e,i)}return e}function c(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?a(Object(e),!0).forEach((function(t){(0,i.Z)(n,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):a(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}var d=function(n){var t;return((null===(t=g[n])||void 0===t?void 0:t.prices)||[]).filter((function(n){return!(null==n?void 0:n.archived)})).sort((function(n,t){return(null==n?void 0:n.position)-(null==t?void 0:t.position)}))},v=function(n){var t,e,i,o;return!(!(null===(e=null===(t=null==g?void 0:g[n])||void 0===t?void 0:t.product)||void 0===e?void 0:e.stock_enabled)||(null===(o=null===(i=null==g?void 0:g[n])||void 0===i?void 0:i.product)||void 0===o?void 0:o.allow_out_of_stock_purchases))},s=function(n,t,e){return(0,r.i)(t,e,g[n].variantValues,g[n].product)},f=function(n,t,e){return(0,r.a)(t,e,g[n].variantValues,g[n].product)},p=function(n){var t,e,i,o;return!!v(n)&&((null===(e=null===(t=null==g?void 0:g[n])||void 0===t?void 0:t.selectedVariant)||void 0===e?void 0:e.id)?(null===(o=g[n].selectedVariant)||void 0===o?void 0:o.available_stock)<=0:(null===(i=g[n].product)||void 0===i?void 0:i.available_stock)<=0)},m=function(n){var t,e,i;return!!(null===(e=null===(t=null==g?void 0:g[n])||void 0===t?void 0:t.variants)||void 0===e?void 0:e.length)&&void 0===(null===(i=(0,u.g)({variants:g[n].variants,values:g[n].variantValues}))||void 0===i?void 0:i.id)},y=function(){var n=(0,r.g)().product,t=void 0===n?{}:n;return Object.values(t).reduce((function(n,t){var e=t||{},i=e.selectedPrice,o=e.product,r=e.selectedVariant,u=c(c({},t),{},{quantity:1,total:null,dialog:null,busy:!1,error:null,adHocAmount:(null==i?void 0:i.amount)||null,disabled:(null==i?void 0:i.archived)||(null==o?void 0:o.archived),line_item:c(c({price_id:null==i?void 0:i.id,quantity:1},(null==i?void 0:i.ad_hoc)?{ad_hoc_amount:null==i?void 0:i.amount}:{}),(null==r?void 0:r.id)?{variant_id:null==r?void 0:r.id}:{}),variantValues:c(c(c({},(null==r?void 0:r.option_1)?{option_1:null==r?void 0:r.option_1}:{}),(null==r?void 0:r.option_2)?{option_2:null==r?void 0:r.option_2}:{}),(null==r?void 0:r.option_3)?{option_3:null==r?void 0:r.option_3}:{})});return n[o.id]=u,n}),{})||{}},h=Object.freeze({__proto__:null,availablePrices:d,getProduct:function(n){var t;return null!==(t=g[n])&&void 0!==t?t:null},isStockNeedsToBeChecked:v,isOptionSoldOut:s,isOptionMissing:f,isProductOutOfStock:p,isSelectedVariantMissing:m,getDefaultState:y,availableSubscriptionPrices:function(n){return(d(n)||[]).filter((function(n){return null==n?void 0:n.recurring_interval})).sort((function(n,t){return(null==n?void 0:n.position)-(null==t?void 0:t.position)}))},availableNonSubscriptionPrices:function(n){return(d(n)||[]).filter((function(n){return!(null==n?void 0:n.recurring_interval)})).sort((function(n,t){return(null==n?void 0:n.position)-(null==t?void 0:t.position)}))}}),_=y();Object.values(_).filter((function(n){return null==n?void 0:n.isProductPage})).forEach((function(n){var t;(null===(t=null==n?void 0:n.product)||void 0===t?void 0:t.id)&&function(n,t){var e,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=new CustomEvent("scProductViewed",{detail:{id:null==n?void 0:n.id,name:null==n?void 0:n.name,price:t,permalink:null==n?void 0:n.permalink,prices:null==n?void 0:n.prices,variant_options:null===(e=null==n?void 0:n.variant_options)||void 0===e?void 0:e.data,product_collections:null==n?void 0:n.product_collections,quantity:i},bubbles:!0});document.dispatchEvent(o)}(null==n?void 0:n.product,null==n?void 0:n.selectedPrice,null==n?void 0:n.quantity)}));var b=(0,o.c)(_,(function(n,t){return JSON.stringify(n)!==JSON.stringify(t)})),g=b.state,w=b.onChange,O=b.on,j=b.dispose,x=b.forceUpdate,P=function(n,t){n&&(g[n]=c(c({},g[n]),t))};O("set",(function(n,t,e){var i,o,r,u;(null===(i=null==t?void 0:t.selectedPrice)||void 0===i?void 0:i.id)!==(null===(o=null==e?void 0:e.selectedPrice)||void 0===o?void 0:o.id)&&E(n,t),(null===(r=null==t?void 0:t.selectedVariant)||void 0===r?void 0:r.id)!==(null===(u=null==e?void 0:e.selectedVariant)||void 0===u?void 0:u.id)&&S(n),(!e||["selectedPrice","adHocAmount","quantity","selectedVariant"].some((function(n){return JSON.stringify(t[n])!==JSON.stringify(e[n])})))&&A(n),(!e||JSON.stringify(null==t?void 0:t.variantValues)!==JSON.stringify(null==e?void 0:e.variantValues))&&k(n,t)}));var k=function(n,t){var e=(0,u.g)({variants:g[n].variants,values:null==t?void 0:t.variantValues});e&&P(n,{selectedVariant:e})},S=function(n){var t,e,i;g[n].selectedVariant&&v&&(null===(t=g[n])||void 0===t?void 0:t.selectedVariant.available_stock)<(null===(e=g[n])||void 0===e?void 0:e.quantity)&&(g[n].quantity=(null===(i=g[n])||void 0===i?void 0:i.selectedVariant.available_stock)||1,(0,l.s)(wp.i18n.sprintf(wp.i18n.__("There are just %d items left in stock, and the quantity has been adjusted to %d.","surecart"),g[n].quantity,g[n].quantity),"assertive"))},E=function(n,t){var e,i,o,r;P(n,{total:g[n].adHocAmount||(null===(e=null==t?void 0:t.selectedPrice)||void 0===e?void 0:e.amount)||0,adHocAmount:null===(i=null==t?void 0:t.selectedPrice)||void 0===i?void 0:i.amount,disabled:(null===(o=null==t?void 0:t.selectedPrice)||void 0===o?void 0:o.archived)||(null===(r=g[n].product)||void 0===r?void 0:r.archived)})},A=function(n){var t,e,i,o,r,u,l,a;P(n,{line_item:c(c({price_id:null===(e=null===(t=g[n])||void 0===t?void 0:t.selectedPrice)||void 0===e?void 0:e.id,quantity:Math.max((null===(o=null===(i=g[n])||void 0===i?void 0:i.selectedPrice)||void 0===o?void 0:o.ad_hoc)?1:g[n].quantity,1)},(null===(u=null===(r=g[n])||void 0===r?void 0:r.selectedPrice)||void 0===u?void 0:u.ad_hoc)?{ad_hoc_amount:null===(l=g[n])||void 0===l?void 0:l.adHocAmount}:{}),{},{variant:null===(a=g[n].selectedVariant)||void 0===a?void 0:a.id})})}},4942:function(n,t,e){function i(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}e.d(t,{Z:function(){return i}})}}]);